diff --git a/packages/x-design-system/demo/src/app.vue b/packages/x-design-system/demo/src/app.vue index dcef79d0a0..6ba0b09ba1 100644 --- a/packages/x-design-system/demo/src/app.vue +++ b/packages/x-design-system/demo/src/app.vue @@ -1,11 +1,13 @@ diff --git a/packages/x-design-system/demo/src/components/button-group.vue b/packages/x-design-system/demo/src/components/button-group.vue new file mode 100644 index 0000000000..c1f434e9f5 --- /dev/null +++ b/packages/x-design-system/demo/src/components/button-group.vue @@ -0,0 +1,242 @@ + + + diff --git a/packages/x-design-system/lib/components/button-group.css b/packages/x-design-system/lib/components/button-group.css new file mode 100644 index 0000000000..6487ea8f80 --- /dev/null +++ b/packages/x-design-system/lib/components/button-group.css @@ -0,0 +1,25 @@ +/* Base */ +@utility button-group { + @apply xds:inline-flex; + @apply xds:text-neutral-50; + + /* We should only remove the left border if the button group doesn't have gap */ + &:not([class*='gap']) > .xds\:button + .xds\:button { + @apply xds:border-l-0; + } + + & > :not(.xds\:button-circle):first-child { + @apply xds:rounded-tl-[inherit] xds:rounded-bl-[inherit]; + } + + & > :not(.xds\:button-circle):last-child { + @apply xds:rounded-tr-[inherit] xds:rounded-br-[inherit]; + } +} + +/* Divider */ +@utility button-group-divider { + @apply xds:border-l-1 xds:border-l-inherit; + @apply xds:my-8; + @apply xds:self-stretch; +} diff --git a/packages/x-design-system/lib/components/index.css b/packages/x-design-system/lib/components/index.css index 4e38413133..70d5e5a434 100644 --- a/packages/x-design-system/lib/components/index.css +++ b/packages/x-design-system/lib/components/index.css @@ -1,2 +1,3 @@ @import './badge.css'; @import './button.css'; +@import './button-group.css';