@api7/ui-components 0.3.0 → 0.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.
Files changed (61) hide show
  1. package/README.md +192 -28
  2. package/dist/animations.css +12 -0
  3. package/dist/components/alert/alert.js +7 -7
  4. package/dist/components/avatar/avatar.d.ts +4 -4
  5. package/dist/components/avatar/avatar.js +6 -6
  6. package/dist/components/badge/badge.js +14 -14
  7. package/dist/components/button/button.d.ts +1 -2
  8. package/dist/components/button/button.js +14 -14
  9. package/dist/components/calendar/calendar.d.ts +1 -1
  10. package/dist/components/calendar/calendar.js +28 -28
  11. package/dist/components/checkbox/checkbox.js +3 -3
  12. package/dist/components/combobox/combobox.js +24 -23
  13. package/dist/components/data-table/data-table.js +7 -7
  14. package/dist/components/data-table/filter-header.js +4 -4
  15. package/dist/components/data-table/sort-header.js +2 -2
  16. package/dist/components/date-picker/date-picker.js +14 -14
  17. package/dist/components/description-list/description-list.d.ts +26 -0
  18. package/dist/components/description-list/description-list.js +89 -0
  19. package/dist/components/dialog/dialog.js +11 -11
  20. package/dist/components/drawer/drawer.js +12 -12
  21. package/dist/components/empty/empty.js +8 -8
  22. package/dist/components/field/field.js +6 -6
  23. package/dist/components/form/date-fields.js +1 -1
  24. package/dist/components/form/form-item.js +6 -6
  25. package/dist/components/form/lazy-field-components.js +1 -1
  26. package/dist/components/form/toggle-fields.js +4 -4
  27. package/dist/components/input/input.js +1 -1
  28. package/dist/components/input-group/input-group.js +11 -12
  29. package/dist/components/menu/menu.js +13 -11
  30. package/dist/components/number-field/number-field.js +7 -7
  31. package/dist/components/pagination/pagination.js +12 -12
  32. package/dist/components/popover/popover.js +5 -4
  33. package/dist/components/progress/progress.d.ts +19 -0
  34. package/dist/components/progress/progress.js +36 -0
  35. package/dist/components/radio-group/radio-group.js +3 -3
  36. package/dist/components/select/select.js +17 -16
  37. package/dist/components/separator/separator.js +1 -1
  38. package/dist/components/sidebar/sidebar.js +9 -9
  39. package/dist/components/skeleton/skeleton.js +1 -1
  40. package/dist/components/spinner/spinner.d.ts +14 -0
  41. package/dist/components/spinner/spinner.js +28 -0
  42. package/dist/components/switch/switch.js +2 -2
  43. package/dist/components/table/table.js +7 -7
  44. package/dist/components/tabs/tabs.js +4 -4
  45. package/dist/components/textarea/textarea.js +1 -1
  46. package/dist/components/toast/toast.js +18 -18
  47. package/dist/components/tooltip/tooltip.js +4 -2
  48. package/dist/config/messages.d.ts +4 -0
  49. package/dist/config/messages.js +2 -0
  50. package/dist/index.d.ts +4 -1
  51. package/dist/index.js +4 -1
  52. package/dist/lib/cn.js +4 -4
  53. package/dist/lib/control.js +3 -3
  54. package/dist/lib/popup.js +5 -4
  55. package/dist/theme.css +220 -0
  56. package/dist/tokens/contrast.d.ts +1 -1
  57. package/dist/tokens/contrast.js +17 -6
  58. package/dist/tokens/semantic.d.ts +2 -2
  59. package/dist/tokens/semantic.js +90 -42
  60. package/package.json +8 -6
  61. package/dist/styles.css +0 -2
@@ -10,7 +10,7 @@ import { enUS, zhCN } from "react-day-picker/locale";
10
10
  //#region src/components/calendar/calendar.tsx
11
11
  /** Merges a consumer's `classNames` prop with ours key by key. Consumer classes are appended to the
12
12
  * key's own classes (the cell's fixed size, range-band fillers and state looks), which they cannot
13
- * replace: only `asu:` utilities take part in `cn`'s conflict resolution. */
13
+ * replace: only `` utilities take part in `cn`'s conflict resolution. */
14
14
  function mergeClassNames(base, overrides = {}) {
15
15
  const merged = { ...base };
16
16
  for (const key of Object.keys(overrides)) merged[key] = cn(base[key], overrides[key]);
@@ -36,15 +36,15 @@ function CalendarRoot({ className: rootClassName, rootRef, ...rootProps }) {
36
36
  /** Module-scope for stable identity (see CalendarRoot). */
37
37
  function CalendarChevron({ className: chevronClassName, orientation, ...chevronProps }) {
38
38
  if (orientation === "left") return /* @__PURE__ */ jsx(ChevronLeft, {
39
- className: cn("asu:size-4", chevronClassName),
39
+ className: cn("size-4", chevronClassName),
40
40
  ...chevronProps
41
41
  });
42
42
  if (orientation === "right") return /* @__PURE__ */ jsx(ChevronRight, {
43
- className: cn("asu:size-4", chevronClassName),
43
+ className: cn("size-4", chevronClassName),
44
44
  ...chevronProps
45
45
  });
46
46
  return /* @__PURE__ */ jsx(ChevronDown, {
47
- className: cn("asu:size-4", chevronClassName),
47
+ className: cn("size-4", chevronClassName),
48
48
  ...chevronProps
49
49
  });
50
50
  }
@@ -76,7 +76,7 @@ function CalendarDay({ day, modifiers, ...dayProps }) {
76
76
  * look of their own, such as `today`, with the app's own class; the library's state looks (for
77
77
  * example `selected`) cannot be replaced. Today is not highlighted unless `classNames.today` is set,
78
78
  * for example `classNames={{ today: 'my-today' }}` with `.my-today > button { border: 1px solid
79
- * var(--asu-primary); }` in the app's CSS.
79
+ * var(--color-primary); }` in the app's CSS.
80
80
  */
81
81
  function Calendar({ className, classNames, locale, navLayout, components, ...props }) {
82
82
  const configLocale = useLocale();
@@ -96,37 +96,37 @@ function Calendar({ className, classNames, locale, navLayout, components, ...pro
96
96
  }), [components]);
97
97
  const ownClassNames = {
98
98
  root: cn(defaultClassNames.root),
99
- months: cn("asu:flex asu:flex-col asu:gap-4 asu:sm:flex-row", defaultClassNames.months),
100
- month: cn("asu:relative asu:flex asu:w-full asu:flex-col asu:gap-3", defaultClassNames.month),
101
- button_previous: cn(buttonVariants({ variant: "ghost" }), "asu:absolute asu:top-0 asu:left-0 asu:size-7 asu:rounded-sm asu:p-0 asu:hover:bg-accent-hover", defaultClassNames.button_previous),
102
- button_next: cn(buttonVariants({ variant: "ghost" }), "asu:absolute asu:top-0 asu:right-0 asu:size-7 asu:rounded-sm asu:p-0 asu:hover:bg-accent-hover", defaultClassNames.button_next),
103
- month_caption: cn("asu:flex asu:h-7 asu:items-center asu:justify-center", defaultClassNames.month_caption),
104
- caption_label: cn("asu:text-sm asu:font-medium asu:select-none", props.captionLayout?.startsWith("dropdown") && "asu:flex asu:items-center asu:gap-1 asu:rounded-sm asu:[&>svg]:size-3.5 asu:[&>svg]:text-muted-foreground", defaultClassNames.caption_label),
105
- dropdowns: cn("asu:flex asu:items-center asu:justify-center asu:gap-1.5 asu:text-sm asu:font-medium", defaultClassNames.dropdowns),
106
- dropdown_root: cn("asu:relative asu:rounded-sm asu:has-focus-visible:ring-2 asu:has-focus-visible:ring-ring/40", defaultClassNames.dropdown_root),
107
- dropdown: cn("asu:absolute asu:inset-0 asu:opacity-0", defaultClassNames.dropdown),
108
- month_grid: cn("asu:w-full asu:border-collapse", defaultClassNames.month_grid),
109
- weekdays: cn("asu:flex", defaultClassNames.weekdays),
110
- weekday: cn("asu:flex asu:size-8 asu:items-center asu:justify-center asu:text-xs asu:font-normal asu:text-muted-foreground", defaultClassNames.weekday),
111
- week: cn("asu:mt-1 asu:flex", defaultClassNames.week),
112
- week_number_header: cn("asu:size-8", defaultClassNames.week_number_header),
113
- week_number: cn("asu:flex asu:size-8 asu:items-center asu:justify-center asu:text-xs asu:text-muted-foreground", defaultClassNames.week_number),
114
- day: cn("asu:relative asu:size-8 asu:p-0 asu:text-center asu:align-middle", "asu:data-join-next:after:absolute asu:data-join-next:after:top-1/2 asu:data-join-next:after:right-0 asu:data-join-next:after:h-6 asu:data-join-next:after:w-1 asu:data-join-next:after:-translate-y-1/2 asu:data-join-next:after:bg-info-subtle", "asu:data-join-prev:after:absolute asu:data-join-prev:after:top-1/2 asu:data-join-prev:after:left-0 asu:data-join-prev:after:h-6 asu:data-join-prev:after:w-1 asu:data-join-prev:after:-translate-y-1/2 asu:data-join-prev:after:bg-info-subtle", defaultClassNames.day),
99
+ months: cn("flex flex-col gap-4 sm:flex-row", defaultClassNames.months),
100
+ month: cn("relative flex w-full flex-col gap-3", defaultClassNames.month),
101
+ button_previous: cn(buttonVariants({ variant: "ghost" }), "absolute top-0 left-0 size-7 rounded-sm p-0 hover:bg-accent-hover", defaultClassNames.button_previous),
102
+ button_next: cn(buttonVariants({ variant: "ghost" }), "absolute top-0 right-0 size-7 rounded-sm p-0 hover:bg-accent-hover", defaultClassNames.button_next),
103
+ month_caption: cn("flex h-7 items-center justify-center", defaultClassNames.month_caption),
104
+ caption_label: cn("text-sm font-medium select-none", props.captionLayout?.startsWith("dropdown") && "flex items-center gap-1 rounded-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
105
+ dropdowns: cn("flex items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
106
+ dropdown_root: cn("relative rounded-sm has-focus-visible:ring-2 has-focus-visible:ring-ring/40", defaultClassNames.dropdown_root),
107
+ dropdown: cn("absolute inset-0 opacity-0", defaultClassNames.dropdown),
108
+ month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
109
+ weekdays: cn("flex", defaultClassNames.weekdays),
110
+ weekday: cn("flex size-8 items-center justify-center text-xs font-normal text-muted-foreground", defaultClassNames.weekday),
111
+ week: cn("mt-1 flex", defaultClassNames.week),
112
+ week_number_header: cn("size-8", defaultClassNames.week_number_header),
113
+ week_number: cn("flex size-8 items-center justify-center text-xs text-muted-foreground", defaultClassNames.week_number),
114
+ day: cn("relative size-8 p-0 text-center align-middle", "data-join-next:after:absolute data-join-next:after:top-1/2 data-join-next:after:right-0 data-join-next:after:h-6 data-join-next:after:w-1 data-join-next:after:-translate-y-1/2 data-join-next:after:bg-info-subtle", "data-join-prev:after:absolute data-join-prev:after:top-1/2 data-join-prev:after:left-0 data-join-prev:after:h-6 data-join-prev:after:w-1 data-join-prev:after:-translate-y-1/2 data-join-prev:after:bg-info-subtle", defaultClassNames.day),
115
115
  range_start: cn(defaultClassNames.range_start),
116
- range_middle: cn("asu:relative asu:before:absolute asu:before:inset-x-0 asu:before:inset-y-1 asu:before:bg-info-subtle", "asu:data-row-start:before:start-1 asu:data-row-end:before:end-1", defaultClassNames.range_middle),
116
+ range_middle: cn("relative before:absolute before:inset-x-0 before:inset-y-1 before:bg-info-subtle", "data-row-start:before:start-1 data-row-end:before:end-1", defaultClassNames.range_middle),
117
117
  range_end: cn(defaultClassNames.range_end),
118
- hidden: cn("asu:invisible", defaultClassNames.hidden),
118
+ hidden: cn("invisible", defaultClassNames.hidden),
119
119
  today: cn(defaultClassNames.today),
120
- selected: cn("asu:[&:not([data-range-middle])>button]:bg-primary asu:[&:not([data-range-middle])>button]:text-primary-foreground asu:[&:not([data-range-middle])>button]:hover:bg-primary", defaultClassNames.selected),
121
- disabled: cn("asu:[&>button]:pointer-events-none asu:[&>button]:text-muted-foreground asu:[&>button]:opacity-50", defaultClassNames.disabled),
122
- outside: cn("asu:[&>button]:text-muted-foreground asu:[&>button]:opacity-50", defaultClassNames.outside)
120
+ selected: cn("[&:not([data-range-middle])>button]:bg-primary [&:not([data-range-middle])>button]:text-primary-foreground [&:not([data-range-middle])>button]:hover:bg-primary", defaultClassNames.selected),
121
+ disabled: cn("[&>button]:pointer-events-none [&>button]:text-muted-foreground [&>button]:opacity-50", defaultClassNames.disabled),
122
+ outside: cn("[&>button]:text-muted-foreground [&>button]:opacity-50", defaultClassNames.outside)
123
123
  };
124
124
  return /* @__PURE__ */ jsx(CalendarDayContext.Provider, {
125
125
  value: dayContextValue,
126
126
  children: /* @__PURE__ */ jsx(DayPicker, {
127
127
  locale: resolvedLocale,
128
128
  navLayout: navLayout ?? "around",
129
- className: cn("asu:w-fit asu:select-none", className),
129
+ className: cn("w-fit select-none", className),
130
130
  classNames: mergeClassNames(ownClassNames, classNames),
131
131
  components: mergedComponents,
132
132
  ...props.mode === "range" ? { resetOnSelect: true } : {},
@@ -156,7 +156,7 @@ function CalendarDayButton({ className, day, modifiers, ref: forwardedRef, ...pr
156
156
  else if (forwardedRef) forwardedRef.current = node;
157
157
  },
158
158
  "data-slot": "calendar-day",
159
- className: cn("asu:absolute asu:inset-0 asu:m-auto asu:flex asu:size-6 asu:items-center asu:justify-center asu:rounded-sm asu:text-sm asu:outline-none asu:hover:bg-accent-hover asu:focus-visible:ring-2 asu:focus-visible:ring-ring/40", className)
159
+ className: cn("absolute inset-0 m-auto flex size-6 items-center justify-center rounded-sm text-sm outline-none hover:bg-accent-hover focus-visible:ring-2 focus-visible:ring-ring/40", className)
160
160
  });
161
161
  }
162
162
  //#endregion
@@ -7,15 +7,15 @@ import { Checkbox } from "@base-ui/react/checkbox";
7
7
  function Checkbox$1({ className, ...props }) {
8
8
  return /* @__PURE__ */ jsx(Checkbox.Root, {
9
9
  "data-base-ui-swipe-ignore": true,
10
- className: cn("asu:peer asu:inline-flex asu:size-4 asu:shrink-0 asu:items-center asu:justify-center asu:rounded-sm asu:border asu:border-input asu:bg-background asu:text-primary-foreground asu:transition-colors asu:outline-none asu:focus-visible:ring-2 asu:focus-visible:ring-ring/40 asu:data-checked:border-primary asu:data-checked:bg-primary asu:data-indeterminate:border-primary asu:data-indeterminate:bg-primary asu:data-disabled:cursor-not-allowed asu:data-disabled:opacity-50 asu:aria-invalid:border-destructive", className),
10
+ className: cn("peer inline-flex size-4 shrink-0 items-center justify-center rounded-sm border border-input bg-background text-primary-foreground transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/40 data-checked:border-primary data-checked:bg-primary data-indeterminate:border-primary data-indeterminate:bg-primary data-disabled:cursor-not-allowed data-disabled:opacity-50 aria-invalid:border-destructive", className),
11
11
  ...props,
12
12
  "data-slot": "checkbox",
13
13
  children: /* @__PURE__ */ jsx(Checkbox.Indicator, {
14
- className: "asu:flex asu:items-center asu:justify-center",
14
+ className: "flex items-center justify-center",
15
15
  "data-slot": "checkbox-indicator",
16
16
  render: (indicatorProps, state) => /* @__PURE__ */ jsx("span", {
17
17
  ...indicatorProps,
18
- children: state.indeterminate ? /* @__PURE__ */ jsx(MinusIcon, { className: "asu:size-3" }) : /* @__PURE__ */ jsx(CheckIcon, { className: "asu:size-3" })
18
+ children: state.indeterminate ? /* @__PURE__ */ jsx(MinusIcon, { className: "size-3" }) : /* @__PURE__ */ jsx(CheckIcon, { className: "size-3" })
19
19
  })
20
20
  })
21
21
  });
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { useMessages } from "../../config/config-provider.js";
3
3
  import { cn } from "../../lib/cn.js";
4
- import { listItemClassName, listboxClassName } from "../../lib/popup.js";
4
+ import { listItemClassName, listboxClassName, popupLayerClassName } from "../../lib/popup.js";
5
5
  import { controlFocus, controlFocusWithin, controlSurface } from "../../lib/control.js";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react";
@@ -13,26 +13,26 @@ function Combobox$1(props) {
13
13
  function ComboboxInput({ className, clearLabel, toggleLabel, ...props }) {
14
14
  const messages = useMessages();
15
15
  return /* @__PURE__ */ jsxs("div", {
16
- className: "asu:relative",
16
+ className: "relative",
17
17
  "data-slot": "combobox-input-group",
18
18
  children: [/* @__PURE__ */ jsx(Combobox.Input, {
19
- className: cn(controlSurface, controlFocus, "asu:h-8 asu:w-full asu:pr-16 asu:pl-3", className),
19
+ className: cn(controlSurface, controlFocus, "h-8 w-full pr-16 pl-3", className),
20
20
  ...props,
21
21
  "data-slot": "combobox-input"
22
22
  }), /* @__PURE__ */ jsxs("span", {
23
- className: "asu:absolute asu:top-1/2 asu:right-2 asu:flex asu:-translate-y-1/2 asu:items-center asu:gap-2",
23
+ className: "absolute top-1/2 right-2 flex -translate-y-1/2 items-center gap-2",
24
24
  children: [/* @__PURE__ */ jsx(Combobox.Clear, {
25
25
  "aria-label": clearLabel ?? messages.combobox.clear,
26
- className: "asu:text-muted-foreground asu:hover:text-foreground",
26
+ className: "text-muted-foreground hover:text-foreground",
27
27
  "data-slot": "combobox-clear",
28
- children: /* @__PURE__ */ jsx(XIcon, { className: "asu:size-3" })
28
+ children: /* @__PURE__ */ jsx(XIcon, { className: "size-3" })
29
29
  }), /* @__PURE__ */ jsx(Combobox.Trigger, {
30
30
  "aria-label": toggleLabel ?? messages.combobox.toggle,
31
- className: "asu:flex asu:items-center",
31
+ className: "flex items-center",
32
32
  "data-slot": "combobox-trigger",
33
33
  children: /* @__PURE__ */ jsx(ChevronDownIcon, {
34
34
  "aria-hidden": "true",
35
- className: "asu:size-5 asu:shrink-0 asu:text-foreground"
35
+ className: "size-5 shrink-0 text-foreground"
36
36
  })
37
37
  })]
38
38
  })]
@@ -40,11 +40,12 @@ function ComboboxInput({ className, clearLabel, toggleLabel, ...props }) {
40
40
  }
41
41
  function ComboboxContent({ className, side = "bottom", sideOffset = 4, align = "start", children, empty = /* @__PURE__ */ jsx(ComboboxEmpty, {}), ...props }) {
42
42
  return /* @__PURE__ */ jsx(Combobox.Portal, { children: /* @__PURE__ */ jsx(Combobox.Positioner, {
43
+ className: popupLayerClassName,
43
44
  side,
44
45
  sideOffset,
45
46
  align,
46
47
  children: /* @__PURE__ */ jsxs(Combobox.Popup, {
47
- className: cn(listboxClassName, "asu:min-w-(--anchor-width) asu:outline-none", className),
48
+ className: cn(listboxClassName, "min-w-(--anchor-width) outline-none", className),
48
49
  ...props,
49
50
  "data-slot": "combobox-content",
50
51
  children: [/* @__PURE__ */ jsx(Combobox.List, {
@@ -56,22 +57,22 @@ function ComboboxContent({ className, side = "bottom", sideOffset = 4, align = "
56
57
  }
57
58
  function ComboboxItem({ className, children, ...props }) {
58
59
  return /* @__PURE__ */ jsxs(Combobox.Item, {
59
- className: cn(listItemClassName, "asu:border-b asu:border-border asu:last:border-b-0", className),
60
+ className: cn(listItemClassName, "border-b border-border last:border-b-0", className),
60
61
  ...props,
61
62
  "data-slot": "combobox-item",
62
63
  children: [/* @__PURE__ */ jsx("span", {
63
- className: "asu:min-w-0 asu:flex-1 asu:truncate",
64
+ className: "min-w-0 flex-1 truncate",
64
65
  children
65
66
  }), /* @__PURE__ */ jsx(Combobox.ItemIndicator, {
66
- className: "asu:flex asu:size-4 asu:shrink-0 asu:items-center asu:justify-center",
67
- children: /* @__PURE__ */ jsx(CheckIcon, { className: "asu:size-4" })
67
+ className: "flex size-4 shrink-0 items-center justify-center",
68
+ children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" })
68
69
  })]
69
70
  });
70
71
  }
71
72
  function ComboboxEmpty({ className, children, ...props }) {
72
73
  const messages = useMessages();
73
74
  return /* @__PURE__ */ jsx(Combobox.Empty, {
74
- className: cn("asu:px-4 asu:py-2.5 asu:text-sm asu:text-muted-foreground asu:empty:p-0", className),
75
+ className: cn("px-4 py-2.5 text-sm text-muted-foreground empty:p-0", className),
75
76
  ...props,
76
77
  "data-slot": "combobox-empty",
77
78
  children: children ?? messages.combobox.empty
@@ -86,7 +87,7 @@ function ComboboxGroup({ className, ...props }) {
86
87
  }
87
88
  function ComboboxGroupLabel({ className, ...props }) {
88
89
  return /* @__PURE__ */ jsx(Combobox.GroupLabel, {
89
- className: cn("asu:px-4 asu:py-2 asu:text-xs asu:font-medium asu:text-muted-foreground", className),
90
+ className: cn("px-4 py-2 text-xs font-medium text-muted-foreground", className),
90
91
  ...props,
91
92
  "data-slot": "combobox-group-label"
92
93
  });
@@ -97,17 +98,17 @@ function ComboboxValue(props) {
97
98
  function ComboboxChips({ className, clearLabel, ...props }) {
98
99
  const messages = useMessages();
99
100
  return /* @__PURE__ */ jsxs(Combobox.InputGroup, {
100
- className: cn(controlSurface, controlFocusWithin, "asu:flex asu:min-h-8 asu:items-start asu:gap-1 asu:px-2 asu:py-1", className),
101
+ className: cn(controlSurface, controlFocusWithin, "flex min-h-8 items-start gap-1 px-2 py-1", className),
101
102
  "data-slot": "combobox-chips-group",
102
103
  children: [/* @__PURE__ */ jsx(Combobox.Chips, {
103
- className: "asu:flex asu:min-w-0 asu:flex-1 asu:flex-wrap asu:items-center asu:gap-1",
104
+ className: "flex min-w-0 flex-1 flex-wrap items-center gap-1",
104
105
  ...props,
105
106
  "data-slot": "combobox-chips"
106
107
  }), /* @__PURE__ */ jsx(Combobox.Clear, {
107
108
  "aria-label": clearLabel ?? messages.combobox.clear,
108
- className: "asu:flex asu:h-6 asu:shrink-0 asu:items-center asu:text-muted-foreground asu:hover:text-foreground",
109
+ className: "flex h-6 shrink-0 items-center text-muted-foreground hover:text-foreground",
109
110
  "data-slot": "combobox-chips-clear",
110
- children: /* @__PURE__ */ jsx(XIcon, { className: "asu:size-3" })
111
+ children: /* @__PURE__ */ jsx(XIcon, { className: "size-3" })
111
112
  })]
112
113
  });
113
114
  }
@@ -116,23 +117,23 @@ function ComboboxChip({ className, children, removeLabel, ...props }) {
116
117
  const defaultLabel = typeof children === "string" ? children : void 0;
117
118
  return /* @__PURE__ */ jsxs(Combobox.Chip, {
118
119
  "aria-label": defaultLabel,
119
- className: cn("asu:inline-flex asu:h-6 asu:items-center asu:gap-1 asu:rounded-full asu:bg-secondary asu:px-2 asu:text-sm asu:text-secondary-foreground", className),
120
+ className: cn("inline-flex h-6 items-center gap-1 rounded-full bg-secondary px-2 text-sm text-secondary-foreground", className),
120
121
  ...props,
121
122
  "data-slot": "combobox-chip",
122
123
  children: [children, /* @__PURE__ */ jsx(Combobox.ChipRemove, {
123
124
  "aria-label": removeLabel ?? (defaultLabel ? `${messages.combobox.remove} ${defaultLabel}` : messages.combobox.remove),
124
- className: "asu:flex asu:items-center asu:text-secondary-foreground/70 asu:hover:text-secondary-foreground",
125
+ className: "flex items-center text-secondary-foreground/70 hover:text-secondary-foreground",
125
126
  "data-slot": "combobox-chip-remove",
126
127
  children: /* @__PURE__ */ jsx(XIcon, {
127
128
  "aria-hidden": "true",
128
- className: "asu:size-3"
129
+ className: "size-3"
129
130
  })
130
131
  })]
131
132
  });
132
133
  }
133
134
  function ComboboxChipsInput({ className, ...props }) {
134
135
  return /* @__PURE__ */ jsx(Combobox.Input, {
135
- className: cn("asu:h-6 asu:min-w-16 asu:flex-1 asu:bg-transparent asu:text-sm asu:text-foreground asu:outline-none asu:placeholder:text-muted-foreground asu:disabled:cursor-not-allowed asu:disabled:opacity-50", className),
136
+ className: cn("h-6 min-w-16 flex-1 bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className),
136
137
  ...props,
137
138
  "data-slot": "combobox-chips-input"
138
139
  });
@@ -110,11 +110,11 @@ function DataTable({ columns, data, getRowId, sorting, defaultSorting, onSorting
110
110
  hidePagination
111
111
  ]);
112
112
  return /* @__PURE__ */ jsxs("div", {
113
- className: cn("asu:w-full", className),
113
+ className: cn("w-full", className),
114
114
  "data-slot": "data-table",
115
115
  children: [
116
116
  toolbar ? /* @__PURE__ */ jsx("div", {
117
- className: "asu:flex asu:justify-end asu:gap-2 asu:pb-3",
117
+ className: "flex justify-end gap-2 pb-3",
118
118
  "data-slot": "data-table-toolbar",
119
119
  children: toolbar
120
120
  }) : null,
@@ -132,7 +132,7 @@ function DataTable({ columns, data, getRowId, sorting, defaultSorting, onSorting
132
132
  className: header.column.columnDef.meta?.className,
133
133
  "aria-sort": ariaSort,
134
134
  children: header.isPlaceholder ? null : filter ? /* @__PURE__ */ jsxs("div", {
135
- className: "asu:flex asu:items-center asu:gap-1",
135
+ className: "flex items-center gap-1",
136
136
  children: [title, /* @__PURE__ */ jsx(FilterHeader, {
137
137
  column: header.column,
138
138
  filter
@@ -140,11 +140,11 @@ function DataTable({ columns, data, getRowId, sorting, defaultSorting, onSorting
140
140
  }) : title
141
141
  }, header.id);
142
142
  }) }, headerGroup.id)) }), /* @__PURE__ */ jsx(TableBody, { children: loading ? Array.from({ length: LOADING_ROW_COUNT }).map((_, rowIndex) => /* @__PURE__ */ jsx(TableRow, {
143
- className: "asu:h-14",
144
- children: table.getVisibleLeafColumns().map((column) => /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "asu:h-4 asu:w-full" }) }, column.id))
143
+ className: "h-14",
144
+ children: table.getVisibleLeafColumns().map((column) => /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full" }) }, column.id))
145
145
  }, `skeleton-${rowIndex}`)) : table.getRowModel().rows.length === 0 ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, {
146
146
  colSpan: table.getVisibleLeafColumns().length,
147
- className: "asu:h-[200px] asu:text-center asu:text-xl asu:font-medium asu:text-muted-foreground",
147
+ className: "h-[200px] text-center text-xl font-medium text-muted-foreground",
148
148
  children: empty ?? messages.dataTable.empty
149
149
  }) }) : table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx(TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(TableCell, {
150
150
  className: cell.column.columnDef.meta?.className,
@@ -170,7 +170,7 @@ function DataTable({ columns, data, getRowId, sorting, defaultSorting, onSorting
170
170
  }
171
171
  function DataTableRowActions({ className, ...props }) {
172
172
  return /* @__PURE__ */ jsx("div", {
173
- className: cn("asu:opacity-0 asu:group-hover/row:opacity-100 asu:group-focus-within/row:opacity-100", className),
173
+ className: cn("opacity-0 group-hover/row:opacity-100 group-focus-within/row:opacity-100", className),
174
174
  ...props,
175
175
  "data-slot": "data-table-row-actions"
176
176
  });
@@ -19,7 +19,7 @@ function FilterHeader({ column, filter }) {
19
19
  render: /* @__PURE__ */ jsx(Button, {
20
20
  variant: "ghost",
21
21
  size: "icon",
22
- className: "asu:size-6",
22
+ className: "size-6",
23
23
  "aria-label": active ? messages.dataTable.filterActive({
24
24
  label: filter.label,
25
25
  count: chosen.length
@@ -27,18 +27,18 @@ function FilterHeader({ column, filter }) {
27
27
  }),
28
28
  children: /* @__PURE__ */ jsx(Funnel, {
29
29
  "aria-hidden": "true",
30
- className: active ? "asu:text-primary asu:fill-current" : "asu:text-muted-foreground"
30
+ className: active ? "text-primary-text fill-current" : "text-muted-foreground"
31
31
  })
32
32
  }), /* @__PURE__ */ jsxs(MenuContent, {
33
33
  align: "start",
34
- className: "asu:min-w-48",
34
+ className: "min-w-48",
35
35
  children: [
36
36
  filter.options.map((option) => /* @__PURE__ */ jsxs(MenuCheckboxItem, {
37
37
  checked: chosen.includes(option.value),
38
38
  disabled: required && chosen.length === 1 && chosen.includes(option.value),
39
39
  onCheckedChange: (on) => change(on ? [...chosen, option.value] : chosen.filter((value) => value !== option.value)),
40
40
  children: [option.label, option.count !== void 0 && /* @__PURE__ */ jsx("span", {
41
- className: "asu:ml-auto asu:pl-4 asu:text-muted-foreground",
41
+ className: "ml-auto pl-4 text-muted-foreground",
42
42
  children: option.count
43
43
  })]
44
44
  }, option.value)),
@@ -9,8 +9,8 @@ function SortHeader({ column, children }) {
9
9
  return /* @__PURE__ */ jsxs("button", {
10
10
  type: "button",
11
11
  onClick: column.getToggleSortingHandler(),
12
- className: cn("asu:inline-flex asu:items-center asu:gap-1 asu:outline-none asu:focus-visible:ring-2 asu:focus-visible:ring-ring/40", sorted ? "asu:text-foreground" : "asu:text-muted-foreground"),
13
- children: [children, /* @__PURE__ */ jsx(Icon, { className: "asu:size-3.5" })]
12
+ className: cn("inline-flex items-center gap-1 outline-none focus-visible:ring-2 focus-visible:ring-ring/40", sorted ? "text-foreground" : "text-muted-foreground"),
13
+ children: [children, /* @__PURE__ */ jsx(Icon, { className: "size-3.5" })]
14
14
  });
15
15
  }
16
16
  //#endregion
@@ -42,7 +42,7 @@ function withTimeString(date, timeString) {
42
42
  function isSameRange(a, b) {
43
43
  return a?.from?.getTime() === b?.from?.getTime() && a?.to?.getTime() === b?.to?.getTime();
44
44
  }
45
- const timeInputClassName = cn(controlSurface, controlFocus, "asu:h-8 asu:w-full asu:px-3");
45
+ const timeInputClassName = cn(controlSurface, controlFocus, "h-8 w-full px-3");
46
46
  /** Popover trigger + single-selection Calendar, matching Input's control surface. */
47
47
  function DatePicker(props) {
48
48
  const { value, defaultValue, onValueChange, onOpenChange, onBlur, placeholder, disabled, showTime, formatDate, calendarProps, className } = props;
@@ -74,15 +74,15 @@ function DatePicker(props) {
74
74
  render: /* @__PURE__ */ jsxs(PopoverTrigger, {
75
75
  disabled,
76
76
  onBlur,
77
- className: cn(controlSurface, controlFocus, "asu:flex asu:h-8 asu:items-center asu:gap-2 asu:px-3 asu:text-left", className),
78
- children: [/* @__PURE__ */ jsx(CalendarIcon, { className: "asu:size-4 asu:shrink-0 asu:text-muted-foreground" }), /* @__PURE__ */ jsx("span", {
79
- className: cn("asu:min-w-0 asu:flex-1 asu:truncate", !currentValue && "asu:text-muted-foreground"),
77
+ className: cn(controlSurface, controlFocus, "flex h-8 items-center gap-2 px-3 text-left", className),
78
+ children: [/* @__PURE__ */ jsx(CalendarIcon, { className: "size-4 shrink-0 text-muted-foreground" }), /* @__PURE__ */ jsx("span", {
79
+ className: cn("min-w-0 flex-1 truncate", !currentValue && "text-muted-foreground"),
80
80
  children: currentValue ? format(currentValue) : resolvedPlaceholder
81
81
  })]
82
82
  })
83
83
  }), /* @__PURE__ */ jsx(PopoverContent, {
84
84
  "aria-label": resolvedPlaceholder,
85
- className: "asu:w-auto",
85
+ className: "w-auto",
86
86
  children: /* @__PURE__ */ jsxs("div", {
87
87
  "data-slot": "date-picker-content",
88
88
  children: [/* @__PURE__ */ jsx(Calendar, {
@@ -98,7 +98,7 @@ function DatePicker(props) {
98
98
  value: currentValue ? timeInputValue(currentValue) : "",
99
99
  disabled: !currentValue,
100
100
  onChange: (event) => handleTimeChange(event.target.value),
101
- className: cn(timeInputClassName, "asu:mt-3"),
101
+ className: cn(timeInputClassName, "mt-3"),
102
102
  "data-slot": "date-picker-time"
103
103
  })]
104
104
  })
@@ -171,22 +171,22 @@ function DateRangePicker(props) {
171
171
  render: /* @__PURE__ */ jsxs(PopoverTrigger, {
172
172
  disabled,
173
173
  onBlur,
174
- className: cn(controlSurface, controlFocus, "asu:flex asu:h-8 asu:items-center asu:gap-2 asu:px-3 asu:text-left", className),
175
- children: [/* @__PURE__ */ jsx(CalendarIcon, { className: "asu:size-4 asu:shrink-0 asu:text-muted-foreground" }), /* @__PURE__ */ jsx("span", {
176
- className: cn("asu:min-w-0 asu:flex-1 asu:truncate", !displayText && "asu:text-muted-foreground"),
174
+ className: cn(controlSurface, controlFocus, "flex h-8 items-center gap-2 px-3 text-left", className),
175
+ children: [/* @__PURE__ */ jsx(CalendarIcon, { className: "size-4 shrink-0 text-muted-foreground" }), /* @__PURE__ */ jsx("span", {
176
+ className: cn("min-w-0 flex-1 truncate", !displayText && "text-muted-foreground"),
177
177
  children: displayText ?? resolvedPlaceholder
178
178
  })]
179
179
  })
180
180
  }), /* @__PURE__ */ jsx(PopoverContent, {
181
181
  "aria-label": resolvedPlaceholder,
182
- className: "asu:w-auto",
182
+ className: "w-auto",
183
183
  children: /* @__PURE__ */ jsxs("div", {
184
- className: "asu:flex asu:gap-3",
184
+ className: "flex gap-3",
185
185
  "data-slot": "date-range-picker-content",
186
186
  children: [presets && presets.length > 0 && /* @__PURE__ */ jsx("div", {
187
187
  role: "group",
188
188
  "aria-label": messages.datePicker.presetsLabel,
189
- className: "asu:flex asu:shrink-0 asu:flex-col asu:gap-1 asu:border-r asu:border-border asu:pr-3",
189
+ className: "flex shrink-0 flex-col gap-1 border-r border-border pr-3",
190
190
  "data-slot": "date-range-picker-presets",
191
191
  children: presets.map((preset, index) => {
192
192
  const isSelected = presetSelection?.index === index && presetSelection.label === preset.label && isSameRange(presetSelection.range, currentValue);
@@ -194,7 +194,7 @@ function DateRangePicker(props) {
194
194
  type: "button",
195
195
  "aria-pressed": isSelected,
196
196
  onClick: () => handlePresetClick(preset, index),
197
- className: cn("asu:h-8 asu:whitespace-nowrap asu:rounded-sm asu:px-3 asu:text-left asu:text-sm asu:text-foreground asu:outline-none asu:hover:bg-accent asu:focus-visible:ring-2 asu:focus-visible:ring-ring/40", isSelected && "asu:bg-accent asu:font-medium asu:text-primary"),
197
+ className: cn("h-8 whitespace-nowrap rounded-sm px-3 text-left text-sm text-foreground outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/40", isSelected && "bg-accent font-medium text-primary-text"),
198
198
  "data-slot": "date-range-picker-preset",
199
199
  children: preset.label
200
200
  }, index);
@@ -207,7 +207,7 @@ function DateRangePicker(props) {
207
207
  selected: currentValue,
208
208
  onSelect: handleSelect
209
209
  }), showTime && /* @__PURE__ */ jsxs("div", {
210
- className: "asu:mt-3 asu:flex asu:gap-2",
210
+ className: "mt-3 flex gap-2",
211
211
  children: [/* @__PURE__ */ jsx("input", {
212
212
  type: "time",
213
213
  step: "1",
@@ -0,0 +1,26 @@
1
+ import { ComponentProps } from "react";
2
+ import { VariantProps } from "class-variance-authority";
3
+ //#region src/components/description-list/description-list.d.ts
4
+ declare const descriptionListVariants: (props?: ({
5
+ variant?: "default" | "outline" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export type DescriptionListProps = Omit<ComponentProps<'dl'>, 'className'> & VariantProps<typeof descriptionListVariants> & {
8
+ className?: string;
9
+ columns?: number;
10
+ };
11
+ export type DescriptionListItemProps = Omit<ComponentProps<'div'>, 'className'> & {
12
+ className?: string;
13
+ colSpan?: number;
14
+ };
15
+ export type DescriptionListLabelProps = Omit<ComponentProps<'dt'>, 'className'> & {
16
+ className?: string;
17
+ };
18
+ export type DescriptionListValueProps = Omit<ComponentProps<'dd'>, 'className'> & {
19
+ className?: string;
20
+ };
21
+ declare function DescriptionList({ className, variant, columns, style, ...props }: DescriptionListProps): import("react").JSX.Element;
22
+ declare function DescriptionListItem({ className, colSpan, style, ...props }: DescriptionListItemProps): import("react").JSX.Element;
23
+ declare function DescriptionListLabel({ className, ...props }: DescriptionListLabelProps): import("react").JSX.Element;
24
+ declare function DescriptionListValue({ className, ...props }: DescriptionListValueProps): import("react").JSX.Element;
25
+ //#endregion
26
+ export { DescriptionList, DescriptionListItem, DescriptionListLabel, DescriptionListValue, descriptionListVariants };
@@ -0,0 +1,89 @@
1
+ "use client";
2
+ import { cn } from "../../lib/cn.js";
3
+ import { createContext, useContext } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { cva } from "class-variance-authority";
6
+ //#region src/components/description-list/description-list.tsx
7
+ const descriptionListVariants = cva("grid w-full grid-cols-[repeat(var(--description-list-columns,1),var(--description-list-label-width,160px)_minmax(0,1fr))] text-sm leading-5", {
8
+ variants: { variant: {
9
+ default: "",
10
+ outline: "border-t border-l border-border"
11
+ } },
12
+ defaultVariants: { variant: "default" }
13
+ });
14
+ const DescriptionListContext = createContext({
15
+ variant: "default",
16
+ columns: 1
17
+ });
18
+ function normalizeColumns(value) {
19
+ if (value === void 0 || !Number.isFinite(value)) return 1;
20
+ return Math.max(1, Math.floor(value));
21
+ }
22
+ function clampColSpan(value, columns) {
23
+ if (value === void 0 || !Number.isFinite(value) || value < 1) return 1;
24
+ return Math.min(columns, Math.floor(value));
25
+ }
26
+ const descriptionListLabelVariants = cva("col-start-1 min-w-0 font-normal text-muted-foreground", {
27
+ variants: { variant: {
28
+ default: "py-2 pr-4",
29
+ outline: "border-r border-b border-border bg-table-header px-4 py-3"
30
+ } },
31
+ defaultVariants: { variant: "default" }
32
+ });
33
+ const descriptionListValueVariants = cva("col-[2/-1] m-0 min-w-0 wrap-anywhere text-foreground", {
34
+ variants: { variant: {
35
+ default: "py-2",
36
+ outline: "border-r border-b border-border px-2 py-3"
37
+ } },
38
+ defaultVariants: { variant: "default" }
39
+ });
40
+ function DescriptionList({ className, variant, columns, style, ...props }) {
41
+ const resolved = variant ?? "default";
42
+ const count = normalizeColumns(columns);
43
+ return /* @__PURE__ */ jsx(DescriptionListContext.Provider, {
44
+ value: {
45
+ variant: resolved,
46
+ columns: count
47
+ },
48
+ children: /* @__PURE__ */ jsx("dl", {
49
+ className: cn(descriptionListVariants({ variant: resolved }), className),
50
+ "data-variant": resolved,
51
+ style: {
52
+ "--description-list-columns": count,
53
+ ...style
54
+ },
55
+ ...props,
56
+ "data-slot": "description-list"
57
+ })
58
+ });
59
+ }
60
+ function DescriptionListItem({ className, colSpan, style, ...props }) {
61
+ const { columns } = useContext(DescriptionListContext);
62
+ return /* @__PURE__ */ jsx("div", {
63
+ className: cn("grid grid-cols-subgrid", className),
64
+ style: {
65
+ gridColumn: `span ${2 * clampColSpan(colSpan, columns)}`,
66
+ ...style
67
+ },
68
+ ...props,
69
+ "data-slot": "description-list-item"
70
+ });
71
+ }
72
+ function DescriptionListLabel({ className, ...props }) {
73
+ const { variant } = useContext(DescriptionListContext);
74
+ return /* @__PURE__ */ jsx("dt", {
75
+ className: cn(descriptionListLabelVariants({ variant }), className),
76
+ ...props,
77
+ "data-slot": "description-list-label"
78
+ });
79
+ }
80
+ function DescriptionListValue({ className, ...props }) {
81
+ const { variant } = useContext(DescriptionListContext);
82
+ return /* @__PURE__ */ jsx("dd", {
83
+ className: cn(descriptionListValueVariants({ variant }), className),
84
+ ...props,
85
+ "data-slot": "description-list-value"
86
+ });
87
+ }
88
+ //#endregion
89
+ export { DescriptionList, DescriptionListItem, DescriptionListLabel, DescriptionListValue, descriptionListVariants };