@aleph-alpha/ui-library 5.3.1 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config.d.ts +38 -3
- package/config.js +103 -6
- package/dist/system/lib.js +8926 -8768
- package/dist/system/patterns/UiDataTable/UiDataTableFilterMenu.vue.d.ts +24 -0
- package/dist/system/patterns/UiDataTable/constants.d.ts +10 -0
- package/dist/system/patterns/UiDataTable/index.d.ts +1 -0
- package/dist/system/patterns/UiDataTable/types.d.ts +23 -1
- package/dist/system/patterns/UiFloatActions/UiFloatActionItems.vue.d.ts +173 -2
- package/dist/system/patterns/UiFloatActions/floatActionItemContext.d.ts +15 -1
- package/dist/system/patterns/UiFloatActions/types.d.ts +25 -1
- package/dist/system/story-sidebar-icons.json +5 -1
- package/docs/public-docs/getting-started-designers.md +3 -1
- package/package.json +5 -3
- package/src/components/UiAutocomplete/UiAutocomplete.stories.ts +2 -1
- package/src/components/UiAutocomplete/UiAutocomplete.vue +5 -5
- package/src/components/UiButton/UiButton.stories.ts +14 -14
- package/src/components/UiCheckbox/UiCheckbox.stories.ts +260 -9
- package/src/components/UiCheckbox/__tests__/UiCheckbox.test.ts +3 -18
- package/src/components/UiChip/UiChip.vue +1 -1
- package/src/components/UiDrawer/UiDrawer.stories.ts +2 -2
- package/src/components/UiDropdownMenu/UiDropdownMenu.stories.ts +4 -4
- package/src/components/UiEmpty/UiEmpty.vue +2 -2
- package/src/components/UiField/UiField.stories.ts +610 -3
- package/src/components/UiField/UiFieldDescription.vue +7 -2
- package/src/components/UiField/UiFieldLabelInfo.vue +1 -1
- package/src/components/UiFileUploadBox/UiFileUploadBox.stories.ts +2 -2
- package/src/components/UiFileUploadBox/UiFileUploadBox.vue +2 -2
- package/src/components/UiInput/UiInput.stories.ts +336 -2
- package/src/components/UiInput/UiInput.vue +3 -3
- package/src/components/UiInput/__tests__/UiInput.test.ts +20 -28
- package/src/components/UiItem/UiItem.stories.ts +236 -1
- package/src/components/UiItem/__tests__/UiItem.test.ts +11 -72
- package/src/components/UiKbd/UiKbd.stories.ts +14 -14
- package/src/components/UiNavigationMenu/UiNavigationMenu.stories.ts +42 -42
- package/src/components/UiPopover/UiPopover.stories.ts +6 -6
- package/src/components/UiRadioGroup/UiRadioGroup.stories.ts +2 -2
- package/src/components/UiResizable/UiResizable.stories.ts +6 -5
- package/src/components/UiSeparator/UiSeparator.stories.ts +6 -6
- package/src/components/UiSheet/UiSheet.stories.ts +2 -2
- package/src/components/UiSlider/UiSlider.stories.ts +8 -8
- package/src/components/UiSnackbar/UiSnackbar.stories.ts +6 -6
- package/src/components/UiSnackbar/UiSnackbar.vue +4 -4
- package/src/components/UiSnackbar/UiSnackbarContent.vue +4 -4
- package/src/components/UiSpinner/UiSpinner.stories.ts +8 -8
- package/src/components/UiSwitch/UiSwitch.stories.ts +2 -2
- package/src/components/UiTabs/UiTabs.stories.ts +30 -30
- package/src/components/UiToggle/__tests__/UiToggle.test.ts +5 -3
- package/src/components/UiToggleGroup/UiToggleGroup.stories.ts +9 -9
- package/src/components/UiTooltip/UiTooltip.stories.ts +3 -3
- package/src/components/core/accordion/AccordionTrigger.vue +2 -2
- package/src/components/core/alert/AlertDescription.vue +1 -1
- package/src/components/core/badge/index.ts +1 -1
- package/src/components/core/button/index.ts +2 -2
- package/src/components/core/calendar/CalendarCellTrigger.vue +2 -2
- package/src/components/core/calendar/CalendarHeadCell.vue +1 -1
- package/src/components/core/card/CardDescription.vue +1 -1
- package/src/components/core/checkbox/Checkbox.vue +1 -2
- package/src/components/core/drawer/DrawerDescription.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuItem.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuShortcut.vue +1 -1
- package/src/components/core/field/FieldDescription.vue +1 -1
- package/src/components/core/field/FieldLabel.vue +1 -1
- package/src/components/core/field/FieldSeparator.vue +1 -1
- package/src/components/core/input/Input.vue +2 -2
- package/src/components/core/item/index.ts +1 -1
- package/src/components/core/kbd/Kbd.vue +1 -1
- package/src/components/core/listbox/ListboxFilter.vue +1 -1
- package/src/components/core/listbox/ListboxGroupLabel.vue +4 -1
- package/src/components/core/listbox/ListboxItem.vue +1 -1
- package/src/components/core/native-select/NativeSelect.vue +3 -3
- package/src/components/core/navigation-menu/NavigationMenuLink.vue +1 -1
- package/src/components/core/navigation-menu/index.ts +1 -1
- package/src/components/core/radio-group/RadioGroupItem.vue +1 -1
- package/src/components/core/range-calendar/RangeCalendarCellTrigger.vue +2 -2
- package/src/components/core/range-calendar/RangeCalendarHeadCell.vue +1 -1
- package/src/components/core/select/SelectItem.vue +1 -1
- package/src/components/core/select/SelectLabel.vue +4 -1
- package/src/components/core/select/SelectTrigger.vue +1 -1
- package/src/components/core/sheet/SheetDescription.vue +3 -1
- package/src/components/core/switch/Switch.vue +1 -1
- package/src/components/core/table/TableCaption.vue +3 -1
- package/src/components/core/tabs/TabsList.vue +1 -1
- package/src/components/core/tabs/TabsTrigger.vue +1 -1
- package/src/components/core/tags-input/TagsInput.vue +1 -1
- package/src/components/core/tags-input/TagsInputInput.vue +1 -1
- package/src/components/core/tags-input/TagsInputItemDelete.vue +1 -1
- package/src/components/core/textarea/Textarea.vue +1 -1
- package/src/components/core/toggle/index.ts +3 -3
- package/src/components/core/toggle-group/index.ts +2 -2
- package/src/lib/useDrag.stories.ts +8 -8
- package/src/patterns/UiDataTable/UiDataTable.stories.ts +913 -16
- package/src/patterns/UiDataTable/UiDataTableColumnFilter.vue +1 -1
- package/src/patterns/UiDataTable/UiDataTableFilterMenu.vue +91 -0
- package/src/patterns/UiDataTable/UiDataTablePagination.vue +1 -1
- package/src/patterns/UiDataTable/__tests__/UiDataTable.test.ts +7 -184
- package/src/patterns/UiDataTable/constants.ts +12 -0
- package/src/patterns/UiDataTable/index.ts +1 -0
- package/src/patterns/UiDataTable/types.ts +24 -0
- package/src/patterns/UiDatePicker/UiDatePicker.stories.ts +4 -4
- package/src/patterns/UiDatePicker/UiDatePicker.vue +1 -1
- package/src/patterns/UiFloatActions/UiFloatActionItems.vue +140 -12
- package/src/patterns/UiFloatActions/UiFloatActions.stories.ts +1231 -438
- package/src/patterns/UiFloatActions/UiFloatActions.vue +1 -1
- package/src/patterns/UiFloatActions/__tests__/UiFloatActionItems.test.ts +46 -24
- package/src/patterns/UiFloatActions/floatActionItemContext.ts +16 -1
- package/src/patterns/UiFloatActions/types.ts +28 -1
- package/src/patterns/UiSidebar/UiSidebarMenuButton.stories.ts +2 -2
- package/src/components/UiField/__tests__/UiFieldError.test.ts +0 -39
- package/src/patterns/UiFloatActions/__tests__/UiFloatActions.a11y.test.ts +0 -152
|
@@ -16,7 +16,7 @@ const props = defineProps<{
|
|
|
16
16
|
:for="props.for"
|
|
17
17
|
:class="
|
|
18
18
|
cn(
|
|
19
|
-
'group/field-label peer/field-label flex w-fit items-center gap-2 leading-snug group-data-[disabled=true]/field:opacity-50',
|
|
19
|
+
'group/field-label peer/field-label flex w-fit items-center gap-2 leading-snug text-content-on-surface-muted body-14-medium group-data-[disabled=true]/field:opacity-50',
|
|
20
20
|
'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4',
|
|
21
21
|
'has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10',
|
|
22
22
|
props.class,
|
|
@@ -22,7 +22,7 @@ const props = defineProps<{
|
|
|
22
22
|
<Separator class="absolute inset-0 top-1/2" />
|
|
23
23
|
<span
|
|
24
24
|
v-if="$slots.default"
|
|
25
|
-
class="bg-background text-muted
|
|
25
|
+
class="bg-background text-content-on-surface-muted relative mx-auto block w-fit px-2"
|
|
26
26
|
data-slot="field-separator-content"
|
|
27
27
|
>
|
|
28
28
|
<slot />
|
|
@@ -25,8 +25,8 @@ const modelValue = useVModel(props, 'modelValue', emits, {
|
|
|
25
25
|
data-slot="input"
|
|
26
26
|
:class="
|
|
27
27
|
cn(
|
|
28
|
-
'file:text-foreground placeholder:text-muted
|
|
29
|
-
'
|
|
28
|
+
'file:text-foreground placeholder:text-content-on-surface-muted selection:bg-primary selection:text-primary-foreground border-input h-9 w-full min-w-0 rounded-md border bg-background-input-default px-3 py-1 label-16-regular transition-[color] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:label-14-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:label-14-regular',
|
|
29
|
+
'ui-focus-ring',
|
|
30
30
|
'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
|
31
31
|
props.class,
|
|
32
32
|
)
|
|
@@ -13,7 +13,7 @@ export { default as ItemSeparator } from './ItemSeparator.vue';
|
|
|
13
13
|
export { default as ItemTitle } from './ItemTitle.vue';
|
|
14
14
|
|
|
15
15
|
export const itemVariants = cva(
|
|
16
|
-
'group/item flex items-center label-14-regular rounded-md transition-[background-color,color,box-shadow] [a]:transition-colors duration-100 flex-wrap
|
|
16
|
+
'group/item flex items-center label-14-regular rounded-md transition-[background-color,color,box-shadow] [a]:transition-colors duration-100 flex-wrap ui-focus-ring disabled:pointer-events-none disabled:opacity-50',
|
|
17
17
|
{
|
|
18
18
|
variants: {
|
|
19
19
|
variant: {
|
|
@@ -10,7 +10,7 @@ const props = defineProps<{ class?: HTMLAttributes['class'] }>();
|
|
|
10
10
|
data-slot="kbd"
|
|
11
11
|
:class="
|
|
12
12
|
cn(
|
|
13
|
-
'pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-background-surface-muted px-1.5 font-mono text-[10px] font-medium text-muted
|
|
13
|
+
'pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-background-surface-muted px-1.5 font-mono text-[10px] font-medium text-content-on-surface-muted',
|
|
14
14
|
props.class,
|
|
15
15
|
)
|
|
16
16
|
"
|
|
@@ -20,7 +20,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
|
20
20
|
data-slot="listbox-filter"
|
|
21
21
|
:class="
|
|
22
22
|
cn(
|
|
23
|
-
'placeholder:text-muted
|
|
23
|
+
'placeholder:text-content-on-surface-muted flex h-9 w-full rounded-md bg-transparent px-3 py-2 label-14-regular outline-none disabled:cursor-not-allowed disabled:opacity-50',
|
|
24
24
|
props.class,
|
|
25
25
|
)
|
|
26
26
|
"
|
|
@@ -18,7 +18,10 @@ const forwardedProps = useForwardProps(delegatedProps);
|
|
|
18
18
|
<ListboxGroupLabel
|
|
19
19
|
data-slot="listbox-group-label"
|
|
20
20
|
:class="
|
|
21
|
-
cn(
|
|
21
|
+
cn(
|
|
22
|
+
'text-content-on-surface-muted px-2 py-1.5 label-12-medium',
|
|
23
|
+
props.class,
|
|
24
|
+
)
|
|
22
25
|
"
|
|
23
26
|
v-bind="forwardedProps"
|
|
24
27
|
>
|
|
@@ -20,7 +20,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
|
20
20
|
data-slot="listbox-item"
|
|
21
21
|
:class="
|
|
22
22
|
cn(
|
|
23
|
-
'hover-layer hover-layer-default data-[highlighted]:text-foreground [&_svg:not([class*=\'text-\'])]:text-muted
|
|
23
|
+
'hover-layer hover-layer-default data-[highlighted]:text-foreground [&_svg:not([class*=\'text-\'])]:text-content-on-surface-muted relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 label-14-regular outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4',
|
|
24
24
|
props.class,
|
|
25
25
|
)
|
|
26
26
|
"
|
|
@@ -43,8 +43,8 @@ const delegatedProps = reactiveOmit(props, 'class');
|
|
|
43
43
|
data-slot="native-select"
|
|
44
44
|
:class="
|
|
45
45
|
cn(
|
|
46
|
-
'border-input placeholder:text-muted
|
|
47
|
-
'
|
|
46
|
+
'border-input placeholder:text-content-on-surface-muted selection:bg-primary selection:text-primary-foreground h-9 w-full min-w-0 appearance-none rounded-md border bg-background-input-default px-3 py-2 pr-9 label-14-regular shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed',
|
|
47
|
+
'ui-focus-ring',
|
|
48
48
|
'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
|
49
49
|
props.class,
|
|
50
50
|
)
|
|
@@ -55,7 +55,7 @@ const delegatedProps = reactiveOmit(props, 'class');
|
|
|
55
55
|
<UiIcon
|
|
56
56
|
name="chevron-down"
|
|
57
57
|
:size="16"
|
|
58
|
-
class="text-muted
|
|
58
|
+
class="text-content-on-surface-muted pointer-events-none absolute top-1/2 right-3.5 -translate-y-1/2 opacity-50 select-none"
|
|
59
59
|
aria-hidden="true"
|
|
60
60
|
data-slot="native-select-icon"
|
|
61
61
|
/>
|
|
@@ -23,7 +23,7 @@ const forwarded = useForwardPropsEmits(props, emits);
|
|
|
23
23
|
// Focus-visible: mirrors UiButton's focus recipe (focus-ring border
|
|
24
24
|
// + tinted ring shadow at 3px) so keyboard focus reads consistently
|
|
25
25
|
// across buttons and nav links.
|
|
26
|
-
'bg-transparent text-content-on-surface-primary border border-transparent flex flex-col gap-1 rounded-sm p-2 label-14-regular transition-[color,box-shadow,border-color] outline-none hover:bg-background-surface-muted data-[active]:bg-background-surface-muted [&_svg:not([class*=\'text-\'])]:text-
|
|
26
|
+
'bg-transparent text-content-on-surface-primary border border-transparent flex flex-col gap-1 rounded-sm p-2 label-14-regular transition-[color,box-shadow,border-color] outline-none hover:bg-background-surface-muted data-[active]:bg-background-surface-muted [&_svg:not([class*=\'text-\'])]:text-content-on-surface-muted ui-focus-ring [&_svg:not([class*=\'size-\'])]:size-4',
|
|
27
27
|
$attrs.class ?? '',
|
|
28
28
|
)
|
|
29
29
|
"
|
|
@@ -19,5 +19,5 @@ export { default as NavigationMenuViewport } from './NavigationMenuViewport.vue'
|
|
|
19
19
|
// tinted ring shadow, 3px wide (no plain `:focus` bg —
|
|
20
20
|
// pointer hovers and kb focus are decoupled here)
|
|
21
21
|
export const navigationMenuTriggerStyle = cva(
|
|
22
|
-
'group inline-flex h-9 w-max items-center justify-center rounded-md border border-transparent bg-transparent px-4 py-2 label-14-medium text-content-on-surface-primary transition-[color,box-shadow,border-color] outline-none hover:bg-background-surface-muted data-[state=open]:bg-background-surface-muted data-[active]:bg-background-surface-muted disabled:pointer-events-none disabled:opacity-50
|
|
22
|
+
'group inline-flex h-9 w-max items-center justify-center rounded-md border border-transparent bg-transparent px-4 py-2 label-14-medium text-content-on-surface-primary transition-[color,box-shadow,border-color] outline-none hover:bg-background-surface-muted data-[state=open]:bg-background-surface-muted data-[active]:bg-background-surface-muted disabled:pointer-events-none disabled:opacity-50 ui-focus-ring',
|
|
23
23
|
);
|
|
@@ -20,7 +20,7 @@ const forwardedProps = useForwardProps(delegatedProps);
|
|
|
20
20
|
v-bind="forwardedProps"
|
|
21
21
|
:class="
|
|
22
22
|
cn(
|
|
23
|
-
'border-input data-[state=checked]:border-accent-default
|
|
23
|
+
'border-input data-[state=checked]:border-accent-default ui-focus-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50',
|
|
24
24
|
props.class,
|
|
25
25
|
)
|
|
26
26
|
"
|
|
@@ -35,9 +35,9 @@ const forwardedProps = useForwardProps(delegatedProps);
|
|
|
35
35
|
// Selection End: accent-default background with accent-default foreground
|
|
36
36
|
'data-[selection-end]:bg-accent-default data-[selection-end]:text-accent-default-foreground data-[selection-end]:hover:bg-accent-default data-[selection-end]:hover:text-accent-default-foreground data-[selection-end]:focus:bg-accent-default data-[selection-end]:focus:text-accent-default-foreground',
|
|
37
37
|
// Outside months
|
|
38
|
-
'data-[outside-view]:text-muted
|
|
38
|
+
'data-[outside-view]:text-content-on-surface-muted',
|
|
39
39
|
// Disabled
|
|
40
|
-
'data-[disabled]:text-muted
|
|
40
|
+
'data-[disabled]:text-content-on-surface-muted data-[disabled]:opacity-50',
|
|
41
41
|
// Unavailable
|
|
42
42
|
'data-[unavailable]:text-destructive-foreground data-[unavailable]:line-through',
|
|
43
43
|
props.class,
|
|
@@ -19,7 +19,7 @@ const forwardedProps = useForwardProps(delegatedProps);
|
|
|
19
19
|
data-slot="range-calendar-head-cell"
|
|
20
20
|
:class="
|
|
21
21
|
cn(
|
|
22
|
-
'w-8 rounded-md text-[0.8rem] font-normal text-muted
|
|
22
|
+
'w-8 rounded-md text-[0.8rem] font-normal text-content-on-surface-muted',
|
|
23
23
|
props.class,
|
|
24
24
|
)
|
|
25
25
|
"
|
|
@@ -26,7 +26,7 @@ const forwardedProps = useForwardProps(delegatedProps);
|
|
|
26
26
|
v-bind="forwardedProps"
|
|
27
27
|
:class="
|
|
28
28
|
cn(
|
|
29
|
-
'hover-layer hover-layer-default focus:text-foreground [&_svg:not([class*=\'text-\'])]:text-muted
|
|
29
|
+
'hover-layer hover-layer-default focus:text-foreground [&_svg:not([class*=\'text-\'])]:text-content-on-surface-muted relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-12 pl-2 label-14-regular outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([data-slot=icon]):not([class*=\'size-\'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2',
|
|
30
30
|
props.class,
|
|
31
31
|
)
|
|
32
32
|
"
|
|
@@ -13,7 +13,10 @@ const props = defineProps<
|
|
|
13
13
|
<SelectLabel
|
|
14
14
|
data-slot="select-label"
|
|
15
15
|
:class="
|
|
16
|
-
cn(
|
|
16
|
+
cn(
|
|
17
|
+
'text-content-on-surface-muted px-2 py-1.5 label-12-regular',
|
|
18
|
+
props.class,
|
|
19
|
+
)
|
|
17
20
|
"
|
|
18
21
|
>
|
|
19
22
|
<slot />
|
|
@@ -27,7 +27,7 @@ const forwardedProps = useForwardProps(delegatedProps);
|
|
|
27
27
|
v-bind="forwardedProps"
|
|
28
28
|
:class="
|
|
29
29
|
cn(
|
|
30
|
-
'border-input data-[placeholder]:text-muted
|
|
30
|
+
'border-input data-[placeholder]:text-content-on-surface-muted data-[placeholder]:bg-background-input-default [&:not([data-placeholder])]:border-border-surface-focus-ring [&_svg:not([class*=\'text-\'])]:text-content-on-surface-muted focus:border-border-surface-focus-ring focus-visible:border-border-surface-focus-ring active:border-border-surface-focus-ring data-[state=open]:border-border-surface-focus-ring focus:ring-ring/50 focus-visible:ring-ring/50 focus:shadow-xs focus-visible:shadow-xs aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex w-fit items-center justify-between gap-2 rounded-md border bg-accent px-3 py-2 label-14-regular whitespace-nowrap transition-[color,box-shadow] outline-none focus:ring-[3px] focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([data-slot=icon]):not([class*=\'size-\'])]:size-4',
|
|
31
31
|
props.class,
|
|
32
32
|
)
|
|
33
33
|
"
|
|
@@ -11,7 +11,9 @@ const forwarded = useForwardProps(props);
|
|
|
11
11
|
<template>
|
|
12
12
|
<DialogDescription
|
|
13
13
|
data-slot="sheet-description"
|
|
14
|
-
:class="
|
|
14
|
+
:class="
|
|
15
|
+
cn('body-14-regular text-content-on-surface-muted', $attrs.class ?? '')
|
|
16
|
+
"
|
|
15
17
|
v-bind="forwarded"
|
|
16
18
|
>
|
|
17
19
|
<slot />
|
|
@@ -23,7 +23,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
|
23
23
|
v-bind="forwarded"
|
|
24
24
|
:class="
|
|
25
25
|
cn(
|
|
26
|
-
'peer data-[state=checked]:bg-background-accent-default data-[state=unchecked]:bg-background-surface-muted-strong
|
|
26
|
+
'peer data-[state=checked]:bg-background-accent-default data-[state=unchecked]:bg-background-surface-muted-strong ui-focus-ring dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all disabled:cursor-not-allowed disabled:opacity-50 p-0.5 h-5 w-9',
|
|
27
27
|
props.class,
|
|
28
28
|
)
|
|
29
29
|
"
|
|
@@ -10,7 +10,9 @@ const props = defineProps<{
|
|
|
10
10
|
<template>
|
|
11
11
|
<caption
|
|
12
12
|
data-slot="table-caption"
|
|
13
|
-
:class="
|
|
13
|
+
:class="
|
|
14
|
+
cn('body-14-regular text-content-on-surface-muted mt-4', props.class)
|
|
15
|
+
"
|
|
14
16
|
>
|
|
15
17
|
<slot />
|
|
16
18
|
</caption>
|
|
@@ -18,7 +18,7 @@ const delegatedProps = reactiveOmit(props, 'class');
|
|
|
18
18
|
v-bind="delegatedProps"
|
|
19
19
|
:class="
|
|
20
20
|
cn(
|
|
21
|
-
'bg-background-surface-muted-subtle text-muted
|
|
21
|
+
'bg-background-surface-muted-subtle text-content-on-surface-muted inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]',
|
|
22
22
|
props.class,
|
|
23
23
|
)
|
|
24
24
|
"
|
|
@@ -19,7 +19,7 @@ const forwardedProps = useForwardProps(delegatedProps);
|
|
|
19
19
|
data-slot="tabs-trigger"
|
|
20
20
|
:class="
|
|
21
21
|
cn(
|
|
22
|
-
'hover:bg-background-surface-secondary data-[state=active]:bg-background-surface-secondary
|
|
22
|
+
'hover:bg-background-surface-secondary data-[state=active]:bg-background-surface-secondary ui-focus-ring text-foreground dark:text-content-on-surface-muted inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 label-14-medium whitespace-nowrap transition-[color,background-color] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4',
|
|
23
23
|
props.class,
|
|
24
24
|
)
|
|
25
25
|
"
|
|
@@ -21,7 +21,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
|
21
21
|
data-slot="tags-input"
|
|
22
22
|
:class="
|
|
23
23
|
cn(
|
|
24
|
-
'border-input focus-
|
|
24
|
+
'border-input ui-focus-ring-within flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-md border bg-background-input-default px-3 py-1 label-14-regular shadow-xs transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50',
|
|
25
25
|
props.class,
|
|
26
26
|
)
|
|
27
27
|
"
|
|
@@ -19,7 +19,7 @@ const forwardedProps = useForwardProps(delegatedProps);
|
|
|
19
19
|
data-slot="tags-input-input"
|
|
20
20
|
:class="
|
|
21
21
|
cn(
|
|
22
|
-
'placeholder:text-muted
|
|
22
|
+
'placeholder:text-content-on-surface-muted flex-1 bg-transparent outline-none',
|
|
23
23
|
props.class,
|
|
24
24
|
)
|
|
25
25
|
"
|
|
@@ -19,7 +19,7 @@ const forwardedProps = useForwardProps(delegatedProps);
|
|
|
19
19
|
data-slot="tags-input-item-delete"
|
|
20
20
|
:class="
|
|
21
21
|
cn(
|
|
22
|
-
'hover:bg-secondary-foreground/20
|
|
22
|
+
'hover:bg-secondary-foreground/20 ui-focus-ring -mr-0.5 flex size-4 items-center justify-center rounded-sm transition-[color,box-shadow]',
|
|
23
23
|
props.class,
|
|
24
24
|
)
|
|
25
25
|
"
|
|
@@ -25,7 +25,7 @@ const modelValue = useVModel(props, 'modelValue', emits, {
|
|
|
25
25
|
data-slot="textarea"
|
|
26
26
|
:class="
|
|
27
27
|
cn(
|
|
28
|
-
'border-input placeholder:text-
|
|
28
|
+
'border-input placeholder:text-content-on-surface-muted ui-focus-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-md border bg-background-input-default px-3 py-2 label-16-regular shadow-xs transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50 md:label-14-regular',
|
|
29
29
|
props.class,
|
|
30
30
|
)
|
|
31
31
|
"
|
|
@@ -3,15 +3,15 @@ import { cva, type VariantProps } from 'class-variance-authority';
|
|
|
3
3
|
export { default as Toggle } from './Toggle.vue';
|
|
4
4
|
|
|
5
5
|
export const toggleVariants = cva(
|
|
6
|
-
'inline-flex items-center justify-center gap-2 rounded-md label-14-medium transition-colors hover:bg-background-surface-muted-subtle
|
|
6
|
+
'inline-flex items-center justify-center gap-2 rounded-md label-14-medium transition-colors hover:bg-background-surface-muted-subtle ui-focus-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
|
|
7
7
|
{
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
10
|
default:
|
|
11
11
|
'border border-border-button-outlined bg-transparent data-[state=on]:bg-accent-default data-[state=on]:text-accent-default-foreground data-[state=on]:hover:bg-accent-default data-[state=on]:hover:text-accent-default-foreground data-[state=open]:bg-accent-default data-[state=open]:text-accent-default-foreground data-[state=open]:hover:bg-accent-default data-[state=open]:hover:text-accent-default-foreground aria-pressed:bg-accent-default aria-pressed:text-accent-default-foreground aria-pressed:hover:bg-accent-default aria-pressed:hover:text-accent-default-foreground',
|
|
12
12
|
outline:
|
|
13
|
-
'border border-input bg-transparent shadow-sm
|
|
14
|
-
soft: 'border border-border-button-outlined bg-transparent data-[state=on]:border-accent-
|
|
13
|
+
'border border-input bg-transparent shadow-sm data-[state=on]:bg-accent-default data-[state=on]:text-accent-default-foreground data-[state=on]:hover:bg-accent-default data-[state=on]:hover:text-accent-default-foreground data-[state=open]:bg-accent-default data-[state=open]:text-accent-default-foreground data-[state=open]:hover:bg-accent-default data-[state=open]:hover:text-accent-default-foreground aria-pressed:bg-accent-default aria-pressed:text-accent-default-foreground aria-pressed:hover:bg-accent-default aria-pressed:hover:text-accent-default-foreground',
|
|
14
|
+
soft: 'border border-border-button-outlined bg-transparent data-[state=on]:border-background-accent-soft data-[state=on]:bg-background-accent-soft data-[state=on]:text-content-on-accent-soft data-[state=on]:hover:bg-background-accent-soft data-[state=on]:hover:text-content-on-accent-soft data-[state=open]:border-background-accent-soft data-[state=open]:bg-background-accent-soft data-[state=open]:text-content-on-accent-soft data-[state=open]:hover:bg-background-accent-soft data-[state=open]:hover:text-content-on-accent-soft aria-pressed:border-background-accent-soft aria-pressed:bg-background-accent-soft aria-pressed:text-content-on-accent-soft aria-pressed:hover:bg-background-accent-soft aria-pressed:hover:text-content-on-accent-soft',
|
|
15
15
|
},
|
|
16
16
|
size: {
|
|
17
17
|
default: 'h-9 px-2 min-w-9',
|
|
@@ -5,14 +5,14 @@ export { default as ToggleGroupItem } from './ToggleGroupItem.vue';
|
|
|
5
5
|
export { toggleGroupContextKey, type ToggleGroupContext } from './context';
|
|
6
6
|
|
|
7
7
|
export const toggleGroupVariants = cva(
|
|
8
|
-
'inline-flex items-center justify-center gap-2 rounded-md label-14-medium transition-colors hover:bg-background-surface-muted-subtle
|
|
8
|
+
'inline-flex items-center justify-center gap-2 rounded-md label-14-medium transition-colors hover:bg-background-surface-muted-subtle ui-focus-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
12
|
default:
|
|
13
13
|
'bg-transparent data-[state=on]:bg-accent-default data-[state=on]:text-accent-default-foreground data-[state=on]:hover:bg-accent-default data-[state=on]:hover:text-accent-default-foreground data-[state=open]:bg-accent-default data-[state=open]:text-accent-default-foreground data-[state=open]:hover:bg-accent-default data-[state=open]:hover:text-accent-default-foreground aria-pressed:bg-accent-default aria-pressed:text-accent-default-foreground aria-pressed:hover:bg-accent-default aria-pressed:hover:text-accent-default-foreground',
|
|
14
14
|
outline:
|
|
15
|
-
'border border-input bg-transparent shadow-sm
|
|
15
|
+
'border border-input bg-transparent shadow-sm data-[state=on]:bg-accent-default data-[state=on]:text-accent-default-foreground data-[state=on]:hover:bg-accent-default data-[state=on]:hover:text-accent-default-foreground data-[state=open]:bg-accent-default data-[state=open]:text-accent-default-foreground data-[state=open]:hover:bg-accent-default data-[state=open]:hover:text-accent-default-foreground aria-pressed:bg-accent-default aria-pressed:text-accent-default-foreground aria-pressed:hover:bg-accent-default aria-pressed:hover:text-accent-default-foreground',
|
|
16
16
|
soft: 'bg-transparent data-[state=on]:bg-accent data-[state=on]:text-accent-foreground data-[state=on]:border data-[state=on]:border-accent-default data-[state=on]:hover:bg-accent data-[state=on]:hover:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:border data-[state=open]:border-accent-default data-[state=open]:hover:bg-accent data-[state=open]:hover:text-accent-foreground aria-pressed:bg-accent aria-pressed:text-accent-foreground aria-pressed:border aria-pressed:border-accent-default aria-pressed:hover:bg-accent aria-pressed:hover:text-accent-foreground',
|
|
17
17
|
},
|
|
18
18
|
size: {
|
|
@@ -130,7 +130,7 @@ function onDragStart(event: DragEvent, itemId: string) {
|
|
|
130
130
|
|
|
131
131
|
<template>
|
|
132
132
|
<div class="max-w-md space-y-3">
|
|
133
|
-
<p class="text-muted
|
|
133
|
+
<p class="text-content-on-surface-muted body-14-regular">
|
|
134
134
|
Drag an item over another item. The helper keeps the native drag data,
|
|
135
135
|
creates an empty bordered ghost, and reorders on drop.
|
|
136
136
|
</p>
|
|
@@ -152,7 +152,7 @@ function onDragStart(event: DragEvent, itemId: string) {
|
|
|
152
152
|
{{ item.label }}
|
|
153
153
|
</div>
|
|
154
154
|
</div>
|
|
155
|
-
<div class="text-muted
|
|
155
|
+
<div class="text-content-on-surface-muted grid gap-1 label-12-regular">
|
|
156
156
|
<span>Dragged item: {{ draggedItem?.label ?? 'none' }}</span>
|
|
157
157
|
<span>Active item: {{ activeItem?.label ?? 'none' }}</span>
|
|
158
158
|
<span>Original order: {{ originalItems?.map((item) => item.id).join(' -> ') ?? 'none' }}</span>
|
|
@@ -201,7 +201,7 @@ function onDragStart(event: DragEvent, itemId: string) {
|
|
|
201
201
|
},
|
|
202
202
|
template: `
|
|
203
203
|
<div class="max-w-md space-y-3">
|
|
204
|
-
<p class="text-muted
|
|
204
|
+
<p class="text-content-on-surface-muted body-14-regular">
|
|
205
205
|
Drag an item over another item. The helper keeps the native drag data,
|
|
206
206
|
creates an empty bordered ghost, and reorders on drop.
|
|
207
207
|
</p>
|
|
@@ -223,7 +223,7 @@ function onDragStart(event: DragEvent, itemId: string) {
|
|
|
223
223
|
{{ item.label }}
|
|
224
224
|
</div>
|
|
225
225
|
</div>
|
|
226
|
-
<div class="text-muted
|
|
226
|
+
<div class="text-content-on-surface-muted grid gap-1 label-12-regular">
|
|
227
227
|
<span>Dragged item: {{ draggedItem?.label ?? 'none' }}</span>
|
|
228
228
|
<span>Active item: {{ activeItem?.label ?? 'none' }}</span>
|
|
229
229
|
<span>Original order: {{ originalItems?.map((item) => item.id).join(' -> ') ?? 'none' }}</span>
|
|
@@ -239,7 +239,7 @@ export const VerticalCards: Story = {
|
|
|
239
239
|
setup: setupCardDragStory,
|
|
240
240
|
template: `
|
|
241
241
|
<div class="max-w-lg space-y-3">
|
|
242
|
-
<p class="text-muted
|
|
242
|
+
<p class="text-content-on-surface-muted body-14-regular">
|
|
243
243
|
Vertical card sorting with model-backed drop handling.
|
|
244
244
|
</p>
|
|
245
245
|
<div class="space-y-3">
|
|
@@ -258,7 +258,7 @@ export const VerticalCards: Story = {
|
|
|
258
258
|
@dragend="resetDragState"
|
|
259
259
|
>
|
|
260
260
|
<h3 class="label-14-medium text-content-on-surface-primary">{{ item.label }}</h3>
|
|
261
|
-
<p class="text-muted
|
|
261
|
+
<p class="text-content-on-surface-muted mt-1 body-14-regular">{{ item.description }}</p>
|
|
262
262
|
</article>
|
|
263
263
|
</div>
|
|
264
264
|
</div>
|
|
@@ -271,7 +271,7 @@ export const GridCards: Story = {
|
|
|
271
271
|
setup: setupCardDragStory,
|
|
272
272
|
template: `
|
|
273
273
|
<div class="max-w-3xl space-y-3">
|
|
274
|
-
<p class="text-muted
|
|
274
|
+
<p class="text-content-on-surface-muted body-14-regular">
|
|
275
275
|
Grid card sorting uses the same active-item model and default drop reorder.
|
|
276
276
|
</p>
|
|
277
277
|
<div class="grid gap-3 sm:grid-cols-2">
|
|
@@ -290,7 +290,7 @@ export const GridCards: Story = {
|
|
|
290
290
|
@dragend="resetDragState"
|
|
291
291
|
>
|
|
292
292
|
<h3 class="label-14-medium text-content-on-surface-primary">{{ item.label }}</h3>
|
|
293
|
-
<p class="text-muted
|
|
293
|
+
<p class="text-content-on-surface-muted mt-2 body-14-regular">{{ item.description }}</p>
|
|
294
294
|
</article>
|
|
295
295
|
</div>
|
|
296
296
|
</div>
|