Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/x-design-system/demo/src/app.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<template>
<Badge />
<Button />
<ButtonGroup />
<Integration />
</template>

<script setup lang="ts">
import Badge from './components/badge.vue'
import ButtonGroup from './components/button-group.vue'
import Button from './components/button.vue'
import Integration from './components/integration.vue'
</script>
242 changes: 242 additions & 0 deletions packages/x-design-system/demo/src/components/button-group.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
<template>
<Wrapper feature="Button" :rows="rows">
<template #default>
<div class="xds:flex xds:flex-wrap xds:gap-5">
<div class="xds:button-group">
<button class="xds:button">BUTTON 1</button>
<button class="xds:button">BUTTON 2</button>
<button class="xds:button">BUTTON 3</button>
</div>
<div class="xds:button-group xds:gap-8">
<button class="xds:button">BUTTON 1</button>
<span class="xds:button-group-divider"></span>
<button class="xds:button">BUTTON 2</button>
<span class="xds:button-group-divider"></span>
<button class="xds:button">BUTTON 3</button>
</div>
<div class="xds:button-group">
<button class="xds:button xds:button-outlined">BUTTON 1</button>
<button class="xds:button xds:button-outlined">BUTTON 2</button>
<button class="xds:button">BUTTON 3</button>
</div>
<div class="xds:button-group xds:gap-8">
<button class="xds:button xds:button-outlined">BUTTON 1</button>
<button class="xds:button xds:button-outlined">BUTTON 2</button>
<button class="xds:button">BUTTON 3</button>
</div>
<div class="xds:button-group xds:gap-8">
<button class="xds:button xds:button-outlined">BUTTON 1</button>
<span class="xds:button-group-divider"></span>
<button class="xds:button xds:button-outlined">BUTTON 2</button>
<span class="xds:button-group-divider"></span>
<button class="xds:button">BUTTON 3</button>
</div>
<div class="xds:button-group xds:text-red-500">
<button class="xds:button xds:button-ghost">BUTTON 1</button>
<span class="xds:button-group-divider"></span>
<button class="xds:button xds:button-ghost">BUTTON 2</button>
<span class="xds:button-group-divider"></span>
<button class="xds:button xds:button-ghost xds:button-warning">BUTTON 3</button>
</div>
<div class="xds:button-group xds:gap-8 xds:text-red-500">
<button class="xds:button xds:button-tight">BUTTON 1</button>
<button class="xds:button xds:button-tight">BUTTON 2</button>
<button class="xds:button xds:button-tight xds:button-warning">BUTTON 3</button>
</div>
<div class="xds:button-group xds:text-red-500">
<button class="xds:button xds:button-highlight xds:button-circle">
<svg
viewBox="0 0 8 8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="xds:size-12"
>
<path
d="M4 1.5V6.5M1.5 4H6.5"
stroke="currentColor"
stroke-width="0.4"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</button>
<button class="xds:button xds:button-ghost xds:button-success xds:button-square">
<svg
viewBox="0 0 8 8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="xds:size-12"
>
<path
d="M4 1.5V6.5M1.5 4H6.5"
stroke="currentColor"
stroke-width="0.4"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</button>
</div>
<div class="xds:button-group xds:text-red-500">
<button class="xds:button xds:button-highlight xds:button-square">
<svg
viewBox="0 0 8 8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="xds:size-12"
>
<path
d="M4 1.5V6.5M1.5 4H6.5"
stroke="currentColor"
stroke-width="0.4"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</button>
<button class="xds:button xds:button-ghost xds:button-success xds:button-square">
<svg
viewBox="0 0 8 8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="xds:size-12"
>
<path
d="M4 1.5V6.5M1.5 4H6.5"
stroke="currentColor"
stroke-width="0.4"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</button>
</div>
</div>
</template>
<template #rounded>
<div class="xds:flex xds:flex-wrap xds:gap-5 xds:rounded-xl">
<div class="xds:button-group">
<button class="xds:button">BUTTON 1</button>
<button class="xds:button">BUTTON 2</button>
<button class="xds:button">BUTTON 3</button>
</div>
<div class="xds:button-group xds:gap-8 xds:rounded-xl">
<button class="xds:button">BUTTON 1</button>
<span class="xds:button-group-divider"></span>
<button class="xds:button">BUTTON 2</button>
<span class="xds:button-group-divider"></span>
<button class="xds:button">BUTTON 3</button>
</div>
<div class="xds:button-group xds:rounded-xl">
<button class="xds:button xds:button-outlined">BUTTON 1</button>
<button class="xds:button xds:button-outlined">BUTTON 2</button>
<button class="xds:button">BUTTON 3</button>
</div>
<div class="xds:button-group xds:gap-8 xds:rounded-xl">
<button class="xds:button xds:button-outlined">BUTTON 1</button>
<button class="xds:button xds:button-outlined">BUTTON 2</button>
<button class="xds:button">BUTTON 3</button>
</div>
<div class="xds:button-group xds:gap-8 xds:rounded-xl">
<button class="xds:button xds:button-outlined">BUTTON 1</button>
<span class="xds:button-group-divider"></span>
<button class="xds:button xds:button-outlined">BUTTON 2</button>
<span class="xds:button-group-divider"></span>
<button class="xds:button">BUTTON 3</button>
</div>
<div class="xds:button-group xds:text-red-500 xds:rounded-xl">
<button class="xds:button xds:button-ghost">BUTTON 1</button>
<span class="xds:button-group-divider"></span>
<button class="xds:button xds:button-ghost">BUTTON 2</button>
<span class="xds:button-group-divider"></span>
<button class="xds:button xds:button-ghost xds:button-warning">BUTTON 3</button>
</div>
<div class="xds:button-group xds:gap-8 xds:text-red-500">
<button class="xds:button xds:button-tight">BUTTON 1</button>
<button class="xds:button xds:button-tight">BUTTON 2</button>
<button class="xds:button xds:button-tight xds:button-warning">BUTTON 3</button>
</div>
<div class="xds:button-group xds:text-red-500 xds:rounded-xl">
<button class="xds:button xds:button-highlight xds:button-circle">
<svg
viewBox="0 0 8 8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="xds:size-12"
>
<path
d="M4 1.5V6.5M1.5 4H6.5"
stroke="currentColor"
stroke-width="0.4"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</button>
<button class="xds:button xds:button-ghost xds:button-success xds:button-square">
<svg
viewBox="0 0 8 8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="xds:size-12"
>
<path
d="M4 1.5V6.5M1.5 4H6.5"
stroke="currentColor"
stroke-width="0.4"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</button>
</div>
<div class="xds:button-group xds:text-red-500 xds:rounded-xl">
<button class="xds:button xds:button-highlight xds:button-square">
<svg
viewBox="0 0 8 8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="xds:size-12"
>
<path
d="M4 1.5V6.5M1.5 4H6.5"
stroke="currentColor"
stroke-width="0.4"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</button>
<button class="xds:button xds:button-ghost xds:button-success xds:button-square">
<svg
viewBox="0 0 8 8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="xds:size-12"
>
<path
d="M4 1.5V6.5M1.5 4H6.5"
stroke="currentColor"
stroke-width="0.4"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</button>
</div>
</div>

<div class="xds:button-group xds:rounded-xl">
<button class="xds:button">BUTTON 1</button>
<button class="xds:button">BUTTON 2</button>
<button class="xds:button">BUTTON 3</button>
</div>
</template>
</Wrapper>
</template>

<script setup lang="ts">
import Wrapper from './wrapper.vue'
const rows = ['default', 'rounded']
</script>
25 changes: 25 additions & 0 deletions packages/x-design-system/lib/components/button-group.css
Original file line number Diff line number Diff line change
@@ -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;
}
1 change: 1 addition & 0 deletions packages/x-design-system/lib/components/index.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@import './badge.css';
@import './button.css';
@import './button-group.css';