@api7/ui-components 0.4.0 → 0.6.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 (113) hide show
  1. package/README.md +221 -30
  2. package/dist/animations.css +12 -0
  3. package/dist/components/alert/alert.d.ts +0 -2
  4. package/dist/components/alert/alert.js +8 -9
  5. package/dist/components/avatar/avatar.d.ts +4 -6
  6. package/dist/components/avatar/avatar.js +7 -8
  7. package/dist/components/badge/badge.d.ts +0 -2
  8. package/dist/components/badge/badge.js +15 -16
  9. package/dist/components/button/button.d.ts +1 -4
  10. package/dist/components/button/button.js +15 -16
  11. package/dist/components/calendar/calendar.d.ts +1 -3
  12. package/dist/components/calendar/calendar.js +29 -30
  13. package/dist/components/checkbox/checkbox.d.ts +0 -2
  14. package/dist/components/checkbox/checkbox.js +4 -5
  15. package/dist/components/combobox/combobox.d.ts +0 -2
  16. package/dist/components/combobox/combobox.js +25 -25
  17. package/dist/components/data-table/data-table.d.ts +0 -2
  18. package/dist/components/data-table/data-table.js +8 -9
  19. package/dist/components/data-table/filter-header.d.ts +1 -3
  20. package/dist/components/data-table/filter-header.js +5 -6
  21. package/dist/components/data-table/sort-header.js +3 -4
  22. package/dist/components/date-picker/date-picker.d.ts +0 -2
  23. package/dist/components/date-picker/date-picker.js +15 -16
  24. package/dist/components/description-list/description-list.d.ts +24 -0
  25. package/dist/components/description-list/description-list.js +88 -0
  26. package/dist/components/dialog/dialog.d.ts +0 -2
  27. package/dist/components/dialog/dialog.js +12 -13
  28. package/dist/components/drawer/drawer.d.ts +0 -2
  29. package/dist/components/drawer/drawer.js +13 -14
  30. package/dist/components/empty/empty.d.ts +0 -2
  31. package/dist/components/empty/empty.js +9 -10
  32. package/dist/components/field/field.d.ts +0 -2
  33. package/dist/components/field/field.js +7 -8
  34. package/dist/components/field/labeled-field.d.ts +33 -0
  35. package/dist/components/field/labeled-field.js +67 -0
  36. package/dist/components/form/choice-fields.d.ts +1 -3
  37. package/dist/components/form/choice-fields.js +1 -2
  38. package/dist/components/form/date-fields.d.ts +0 -2
  39. package/dist/components/form/date-fields.js +2 -3
  40. package/dist/components/form/errors.d.ts +1 -3
  41. package/dist/components/form/errors.js +1 -2
  42. package/dist/components/form/form-context.d.ts +1 -3
  43. package/dist/components/form/form-context.js +1 -2
  44. package/dist/components/form/form-item.d.ts +6 -17
  45. package/dist/components/form/form-item.js +9 -58
  46. package/dist/components/form/form.d.ts +1 -3
  47. package/dist/components/form/form.js +1 -2
  48. package/dist/components/form/lazy-field-components.js +2 -3
  49. package/dist/components/form/submit-button.d.ts +1 -3
  50. package/dist/components/form/submit-button.js +1 -2
  51. package/dist/components/form/text-field.d.ts +1 -3
  52. package/dist/components/form/text-field.js +1 -2
  53. package/dist/components/form/toggle-fields.d.ts +1 -3
  54. package/dist/components/form/toggle-fields.js +30 -46
  55. package/dist/components/input/input.d.ts +0 -2
  56. package/dist/components/input/input.js +2 -3
  57. package/dist/components/input-group/input-group.d.ts +0 -2
  58. package/dist/components/input-group/input-group.js +12 -13
  59. package/dist/components/menu/menu.d.ts +14 -4
  60. package/dist/components/menu/menu.js +43 -31
  61. package/dist/components/number-field/number-field.d.ts +0 -2
  62. package/dist/components/number-field/number-field.js +8 -9
  63. package/dist/components/pagination/pagination.d.ts +1 -3
  64. package/dist/components/pagination/pagination.js +13 -14
  65. package/dist/components/popover/popover.d.ts +3 -3
  66. package/dist/components/popover/popover.js +14 -7
  67. package/dist/components/progress/progress.d.ts +17 -0
  68. package/dist/components/progress/progress.js +35 -0
  69. package/dist/components/radio-group/radio-group.d.ts +0 -2
  70. package/dist/components/radio-group/radio-group.js +4 -5
  71. package/dist/components/select/select.d.ts +0 -2
  72. package/dist/components/select/select.js +18 -18
  73. package/dist/components/separator/separator.d.ts +0 -2
  74. package/dist/components/separator/separator.js +2 -3
  75. package/dist/components/sidebar/sidebar.d.ts +0 -2
  76. package/dist/components/sidebar/sidebar.js +11 -12
  77. package/dist/components/skeleton/skeleton.d.ts +0 -2
  78. package/dist/components/skeleton/skeleton.js +2 -3
  79. package/dist/components/spinner/spinner.d.ts +12 -0
  80. package/dist/components/spinner/spinner.js +27 -0
  81. package/dist/components/switch/switch.d.ts +0 -2
  82. package/dist/components/switch/switch.js +3 -4
  83. package/dist/components/table/table.d.ts +0 -2
  84. package/dist/components/table/table.js +8 -9
  85. package/dist/components/tabs/tabs.d.ts +0 -2
  86. package/dist/components/tabs/tabs.js +5 -6
  87. package/dist/components/textarea/textarea.d.ts +0 -2
  88. package/dist/components/textarea/textarea.js +2 -3
  89. package/dist/components/toast/toast.d.ts +0 -2
  90. package/dist/components/toast/toast.js +19 -20
  91. package/dist/components/tooltip/tooltip.d.ts +0 -2
  92. package/dist/components/tooltip/tooltip.js +5 -4
  93. package/dist/config/config-provider.d.ts +1 -3
  94. package/dist/config/config-provider.js +1 -2
  95. package/dist/config/messages.d.ts +5 -3
  96. package/dist/config/messages.js +3 -2
  97. package/dist/index.d.ts +6 -2
  98. package/dist/index.js +7 -3
  99. package/dist/lib/cn.js +5 -6
  100. package/dist/lib/control.js +4 -5
  101. package/dist/lib/popup.js +6 -6
  102. package/dist/theme.css +220 -0
  103. package/dist/tokens/contrast.d.ts +1 -3
  104. package/dist/tokens/contrast.js +1 -2
  105. package/dist/tokens/palette.d.ts +0 -2
  106. package/dist/tokens/palette.js +1 -2
  107. package/dist/tokens/scale.js +1 -2
  108. package/dist/tokens/semantic.d.ts +0 -2
  109. package/dist/tokens/semantic.js +0 -1
  110. package/dist/tokens/types.d.ts +1 -3
  111. package/dist/tokens/types.js +1 -2
  112. package/package.json +11 -9
  113. package/dist/styles.css +0 -2
@@ -8,7 +8,7 @@ import { useCallback, useState } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { CalendarIcon } from "lucide-react";
10
10
  import { Field } from "@base-ui/react/field";
11
- //#region src/components/date-picker/date-picker.tsx
11
+ // src/components/date-picker/date-picker.tsx
12
12
  function pad(value) {
13
13
  return String(value).padStart(2, "0");
14
14
  }
@@ -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-text"),
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",
@@ -232,5 +232,4 @@ function DateRangePicker(props) {
232
232
  })]
233
233
  });
234
234
  }
235
- //#endregion
236
235
  export { DatePicker, DateRangePicker };
@@ -0,0 +1,24 @@
1
+ import { ComponentProps } from "react";
2
+ import { VariantProps } from "class-variance-authority";
3
+ declare const descriptionListVariants: (props?: ({
4
+ variant?: "default" | "outline" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ export type DescriptionListProps = Omit<ComponentProps<'dl'>, 'className'> & VariantProps<typeof descriptionListVariants> & {
7
+ className?: string;
8
+ columns?: number;
9
+ };
10
+ export type DescriptionListItemProps = Omit<ComponentProps<'div'>, 'className'> & {
11
+ className?: string;
12
+ colSpan?: number;
13
+ };
14
+ export type DescriptionListLabelProps = Omit<ComponentProps<'dt'>, 'className'> & {
15
+ className?: string;
16
+ };
17
+ export type DescriptionListValueProps = Omit<ComponentProps<'dd'>, 'className'> & {
18
+ className?: string;
19
+ };
20
+ declare function DescriptionList({ className, variant, columns, style, ...props }: DescriptionListProps): import("react").JSX.Element;
21
+ declare function DescriptionListItem({ className, colSpan, style, ...props }: DescriptionListItemProps): import("react").JSX.Element;
22
+ declare function DescriptionListLabel({ className, ...props }: DescriptionListLabelProps): import("react").JSX.Element;
23
+ declare function DescriptionListValue({ className, ...props }: DescriptionListValueProps): import("react").JSX.Element;
24
+ export { DescriptionList, DescriptionListItem, DescriptionListLabel, DescriptionListValue, descriptionListVariants };
@@ -0,0 +1,88 @@
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
+ // 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
+ export { DescriptionList, DescriptionListItem, DescriptionListLabel, DescriptionListValue, descriptionListVariants };
@@ -1,6 +1,5 @@
1
1
  import { ComponentProps } from "react";
2
2
  import { Dialog } from "@base-ui/react/dialog";
3
- //#region src/components/dialog/dialog.d.ts
4
3
  type WithClassName<P> = Omit<P, 'className'> & {
5
4
  className?: string;
6
5
  };
@@ -26,5 +25,4 @@ export type DialogFooterProps = ComponentProps<'div'>;
26
25
  declare function DialogFooter({ className, ...props }: DialogFooterProps): import("react").JSX.Element;
27
26
  export type DialogCloseProps = WithClassName<Dialog.Close.Props>;
28
27
  declare function DialogClose({ className, ...props }: DialogCloseProps): import("react").JSX.Element;
29
- //#endregion
30
28
  export { Dialog$1 as Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
@@ -6,7 +6,7 @@ import { createContext, useContext } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { XIcon } from "lucide-react";
8
8
  import { Dialog } from "@base-ui/react/dialog";
9
- //#region src/components/dialog/dialog.tsx
9
+ // src/components/dialog/dialog.tsx
10
10
  const DialogModalContext = createContext(true);
11
11
  function Dialog$1({ modal = true, ...props }) {
12
12
  return /* @__PURE__ */ jsx(DialogModalContext.Provider, {
@@ -25,22 +25,22 @@ function DialogTrigger({ className, ...props }) {
25
25
  });
26
26
  }
27
27
  const dialogContentSizeClassName = {
28
- sm: "asu:max-w-md",
29
- md: "asu:max-w-xl",
30
- lg: "asu:max-w-3xl"
28
+ sm: "max-w-md",
29
+ md: "max-w-xl",
30
+ lg: "max-w-3xl"
31
31
  };
32
32
  function DialogContent({ className, showCloseButton = true, closeLabel, size = "md", children, ...props }) {
33
33
  const messages = useMessages();
34
34
  const showBackdrop = useContext(DialogModalContext) === true;
35
35
  return /* @__PURE__ */ jsxs(Dialog.Portal, { children: [showBackdrop && /* @__PURE__ */ jsx(Dialog.Backdrop, {
36
- className: "asu:fixed asu:inset-0 asu:bg-overlay asu:transition-opacity asu:duration-150 asu:motion-reduce:transition-none asu:data-ending-style:opacity-0 asu:data-starting-style:opacity-0",
36
+ className: "fixed inset-0 z-50 bg-overlay transition-opacity duration-150 motion-reduce:transition-none data-ending-style:opacity-0 data-starting-style:opacity-0",
37
37
  "data-slot": "dialog-backdrop"
38
38
  }), /* @__PURE__ */ jsxs(Dialog.Popup, {
39
- className: cn("asu:fixed asu:top-1/2 asu:left-1/2 asu:flex asu:max-h-[calc(100vh-4rem)] asu:w-[calc(100vw-2rem)] asu:-translate-x-1/2 asu:-translate-y-1/2 asu:flex-col asu:rounded-md asu:bg-background asu:text-foreground asu:shadow-lg asu:dark:ring-1 asu:dark:ring-border asu:outline-none asu:transition-[opacity,scale] asu:duration-150 asu:motion-reduce:transition-none asu:data-starting-style:scale-95 asu:data-starting-style:opacity-0 asu:data-ending-style:scale-95 asu:data-ending-style:opacity-0", dialogContentSizeClassName[size], className),
39
+ className: cn("fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-4rem)] w-[calc(100vw-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-md bg-background text-foreground shadow-lg dark:ring-1 dark:ring-border outline-none transition-[opacity,scale] duration-150 motion-reduce:transition-none data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0", dialogContentSizeClassName[size], className),
40
40
  ...props,
41
41
  "data-slot": "dialog-content",
42
42
  children: [showCloseButton && /* @__PURE__ */ jsx(Dialog.Close, {
43
- className: "asu:absolute asu:top-3 asu:right-4",
43
+ className: "absolute top-3 right-4",
44
44
  render: /* @__PURE__ */ jsx(Button, {
45
45
  variant: "ghost",
46
46
  size: "icon"
@@ -52,35 +52,35 @@ function DialogContent({ className, showCloseButton = true, closeLabel, size = "
52
52
  }
53
53
  function DialogHeader({ className, ...props }) {
54
54
  return /* @__PURE__ */ jsx("div", {
55
- className: cn("asu:flex asu:flex-col asu:gap-1 asu:border-b asu:border-border asu:p-4 asu:pr-12", className),
55
+ className: cn("flex flex-col gap-1 border-b border-border p-4 pr-12", className),
56
56
  ...props,
57
57
  "data-slot": "dialog-header"
58
58
  });
59
59
  }
60
60
  function DialogTitle({ className, ...props }) {
61
61
  return /* @__PURE__ */ jsx(Dialog.Title, {
62
- className: cn("asu:text-lg asu:font-medium asu:text-foreground", className),
62
+ className: cn("text-lg font-medium text-foreground", className),
63
63
  ...props,
64
64
  "data-slot": "dialog-title"
65
65
  });
66
66
  }
67
67
  function DialogDescription({ className, ...props }) {
68
68
  return /* @__PURE__ */ jsx(Dialog.Description, {
69
- className: cn("asu:text-sm asu:text-muted-foreground", className),
69
+ className: cn("text-sm text-muted-foreground", className),
70
70
  ...props,
71
71
  "data-slot": "dialog-description"
72
72
  });
73
73
  }
74
74
  function DialogBody({ className, ...props }) {
75
75
  return /* @__PURE__ */ jsx("div", {
76
- className: cn("asu:max-h-[596px] asu:overflow-y-auto asu:p-6", className),
76
+ className: cn("max-h-[596px] overflow-y-auto p-6", className),
77
77
  ...props,
78
78
  "data-slot": "dialog-body"
79
79
  });
80
80
  }
81
81
  function DialogFooter({ className, ...props }) {
82
82
  return /* @__PURE__ */ jsx("div", {
83
- className: cn("asu:flex asu:items-center asu:justify-end asu:gap-3 asu:border-t asu:border-border asu:px-6 asu:py-4", className),
83
+ className: cn("flex items-center justify-end gap-3 border-t border-border px-6 py-4", className),
84
84
  ...props,
85
85
  "data-slot": "dialog-footer"
86
86
  });
@@ -92,5 +92,4 @@ function DialogClose({ className, ...props }) {
92
92
  "data-slot": "dialog-close"
93
93
  });
94
94
  }
95
- //#endregion
96
95
  export { Dialog$1 as Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
@@ -1,6 +1,5 @@
1
1
  import { ComponentProps } from "react";
2
2
  import { Drawer } from "@base-ui/react/drawer";
3
- //#region src/components/drawer/drawer.d.ts
4
3
  type WithClassName<P> = Omit<P, 'className'> & {
5
4
  className?: string;
6
5
  };
@@ -26,5 +25,4 @@ export type DrawerFooterProps = ComponentProps<'div'>;
26
25
  declare function DrawerFooter({ className, ...props }: DrawerFooterProps): import("react").JSX.Element;
27
26
  export type DrawerCloseProps = WithClassName<Drawer.Close.Props>;
28
27
  declare function DrawerClose({ className, ...props }: DrawerCloseProps): import("react").JSX.Element;
29
- //#endregion
30
28
  export { Drawer$1 as Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger };
@@ -6,7 +6,7 @@ import { createContext, useContext } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { XIcon } from "lucide-react";
8
8
  import { Drawer } from "@base-ui/react/drawer";
9
- //#region src/components/drawer/drawer.tsx
9
+ // src/components/drawer/drawer.tsx
10
10
  const DrawerModalContext = createContext(true);
11
11
  function Drawer$1({ swipeDirection = "right", modal = true, ...props }) {
12
12
  return /* @__PURE__ */ jsx(DrawerModalContext.Provider, {
@@ -26,26 +26,26 @@ function DrawerTrigger({ className, ...props }) {
26
26
  });
27
27
  }
28
28
  const drawerContentSizeClassName = {
29
- md: "asu:w-[588px] asu:max-w-[100vw]",
30
- lg: "asu:w-[748px] asu:max-w-[100vw]",
31
- full: "asu:w-[90vw] asu:max-w-[100vw]"
29
+ md: "w-[588px] max-w-[100vw]",
30
+ lg: "w-[748px] max-w-[100vw]",
31
+ full: "w-[90vw] max-w-[100vw]"
32
32
  };
33
33
  function DrawerContent({ className, showCloseButton = true, closeLabel, size = "md", children, ...props }) {
34
34
  const messages = useMessages();
35
35
  const isNonModal = useContext(DrawerModalContext) !== true;
36
36
  const showBackdrop = !isNonModal;
37
37
  return /* @__PURE__ */ jsxs(Drawer.Portal, { children: [showBackdrop && /* @__PURE__ */ jsx(Drawer.Backdrop, {
38
- className: "asu:fixed asu:inset-0 asu:bg-overlay asu:transition-opacity asu:duration-150 asu:motion-reduce:transition-none asu:data-ending-style:opacity-0 asu:data-starting-style:opacity-0",
38
+ className: "fixed inset-0 z-50 bg-overlay transition-opacity duration-150 motion-reduce:transition-none data-ending-style:opacity-0 data-starting-style:opacity-0",
39
39
  "data-slot": "drawer-backdrop"
40
40
  }), /* @__PURE__ */ jsx(Drawer.Viewport, {
41
- className: cn("asu:fixed asu:inset-0", isNonModal && "asu:pointer-events-none"),
41
+ className: cn("fixed inset-0 z-50", isNonModal && "pointer-events-none"),
42
42
  "data-slot": "drawer-viewport",
43
43
  children: /* @__PURE__ */ jsxs(Drawer.Popup, {
44
- className: cn("asu:fixed asu:inset-y-0 asu:right-0 asu:flex asu:h-full asu:flex-col asu:bg-background asu:text-foreground asu:shadow-lg asu:dark:ring-1 asu:dark:ring-border asu:outline-none asu:transition-transform asu:duration-200 asu:motion-reduce:transition-none asu:data-ending-style:translate-x-full asu:data-starting-style:translate-x-full", isNonModal && "asu:pointer-events-auto", drawerContentSizeClassName[size], className),
44
+ className: cn("fixed inset-y-0 right-0 flex h-full flex-col bg-background text-foreground shadow-lg dark:ring-1 dark:ring-border outline-none transition-transform duration-200 motion-reduce:transition-none data-ending-style:translate-x-full data-starting-style:translate-x-full", isNonModal && "pointer-events-auto", drawerContentSizeClassName[size], className),
45
45
  ...props,
46
46
  "data-slot": "drawer-content",
47
47
  children: [showCloseButton && /* @__PURE__ */ jsx(Drawer.Close, {
48
- className: "asu:absolute asu:top-3 asu:right-4",
48
+ className: "absolute top-3 right-4",
49
49
  render: /* @__PURE__ */ jsx(Button, {
50
50
  variant: "ghost",
51
51
  size: "icon"
@@ -58,35 +58,35 @@ function DrawerContent({ className, showCloseButton = true, closeLabel, size = "
58
58
  }
59
59
  function DrawerHeader({ className, ...props }) {
60
60
  return /* @__PURE__ */ jsx("div", {
61
- className: cn("asu:flex asu:flex-col asu:gap-1 asu:border-b asu:border-border asu:px-6 asu:py-4 asu:pr-12", className),
61
+ className: cn("flex flex-col gap-1 border-b border-border px-6 py-4 pr-12", className),
62
62
  ...props,
63
63
  "data-slot": "drawer-header"
64
64
  });
65
65
  }
66
66
  function DrawerTitle({ className, ...props }) {
67
67
  return /* @__PURE__ */ jsx(Drawer.Title, {
68
- className: cn("asu:text-lg asu:font-semibold asu:text-foreground", className),
68
+ className: cn("text-lg font-semibold text-foreground", className),
69
69
  ...props,
70
70
  "data-slot": "drawer-title"
71
71
  });
72
72
  }
73
73
  function DrawerDescription({ className, ...props }) {
74
74
  return /* @__PURE__ */ jsx(Drawer.Description, {
75
- className: cn("asu:text-sm asu:text-muted-foreground", className),
75
+ className: cn("text-sm text-muted-foreground", className),
76
76
  ...props,
77
77
  "data-slot": "drawer-description"
78
78
  });
79
79
  }
80
80
  function DrawerBody({ className, ...props }) {
81
81
  return /* @__PURE__ */ jsx("div", {
82
- className: cn("asu:flex-1 asu:overflow-y-auto asu:px-6 asu:py-4", className),
82
+ className: cn("flex-1 overflow-y-auto px-6 py-4", className),
83
83
  ...props,
84
84
  "data-slot": "drawer-body"
85
85
  });
86
86
  }
87
87
  function DrawerFooter({ className, ...props }) {
88
88
  return /* @__PURE__ */ jsx("div", {
89
- className: cn("asu:flex asu:items-center asu:justify-end asu:gap-4 asu:border-t asu:border-border asu:px-6 asu:py-3", className),
89
+ className: cn("flex items-center justify-end gap-4 border-t border-border px-6 py-3", className),
90
90
  ...props,
91
91
  "data-slot": "drawer-footer"
92
92
  });
@@ -98,5 +98,4 @@ function DrawerClose({ className, ...props }) {
98
98
  "data-slot": "drawer-close"
99
99
  });
100
100
  }
101
- //#endregion
102
101
  export { Drawer$1 as Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger };
@@ -1,6 +1,5 @@
1
1
  import { ComponentProps } from "react";
2
2
  import { VariantProps } from "class-variance-authority";
3
- //#region src/components/empty/empty.d.ts
4
3
  declare const emptyMediaVariants: (props?: ({
5
4
  variant?: "default" | "icon" | null | undefined;
6
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -16,5 +15,4 @@ declare function EmptyMedia({ variant, className, ...props }: EmptyMediaProps):
16
15
  declare function EmptyTitle({ className, ...props }: EmptyTitleProps): import("react").JSX.Element;
17
16
  declare function EmptyDescription({ className, ...props }: EmptyDescriptionProps): import("react").JSX.Element;
18
17
  declare function EmptyContent({ className, ...props }: EmptyContentProps): import("react").JSX.Element;
19
- //#endregion
20
18
  export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, emptyMediaVariants };
@@ -1,12 +1,12 @@
1
1
  import { cn } from "../../lib/cn.js";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { cva } from "class-variance-authority";
4
- //#region src/components/empty/empty.tsx
5
- const emptyVariants = cva("asu:flex asu:w-full asu:min-w-0 asu:flex-col asu:items-center asu:justify-center asu:gap-3 asu:rounded-sm asu:border-[3px] asu:border-dashed asu:border-border asu:px-4 asu:py-4 asu:text-center");
6
- const emptyMediaVariants = cva("asu:flex asu:shrink-0 asu:items-center asu:justify-center", {
4
+ // src/components/empty/empty.tsx
5
+ const emptyVariants = cva("flex w-full min-w-0 flex-col items-center justify-center gap-3 rounded-sm border-[3px] border-dashed border-border px-4 py-4 text-center");
6
+ const emptyMediaVariants = cva("flex shrink-0 items-center justify-center", {
7
7
  variants: { variant: {
8
- default: "asu:size-[76px] asu:[&_img]:size-full asu:[&_img]:object-contain asu:[&_svg]:size-full",
9
- icon: "asu:size-10 asu:rounded-sm asu:bg-muted asu:text-foreground asu:[&_svg:not([class*=size-])]:size-5"
8
+ default: "size-[76px] [&_img]:size-full [&_img]:object-contain [&_svg]:size-full",
9
+ icon: "size-10 rounded-sm bg-muted text-foreground [&_svg:not([class*=size-])]:size-5"
10
10
  } },
11
11
  defaultVariants: { variant: "default" }
12
12
  });
@@ -19,7 +19,7 @@ function Empty({ className, ...props }) {
19
19
  }
20
20
  function EmptyHeader({ className, ...props }) {
21
21
  return /* @__PURE__ */ jsx("div", {
22
- className: cn("asu:flex asu:max-w-sm asu:flex-col asu:items-center asu:gap-1", className),
22
+ className: cn("flex max-w-sm flex-col items-center gap-1", className),
23
23
  ...props,
24
24
  "data-slot": "empty-header"
25
25
  });
@@ -34,24 +34,23 @@ function EmptyMedia({ variant = "default", className, ...props }) {
34
34
  }
35
35
  function EmptyTitle({ className, ...props }) {
36
36
  return /* @__PURE__ */ jsx("div", {
37
- className: cn("asu:text-base asu:font-medium asu:text-foreground", className),
37
+ className: cn("text-base font-medium text-foreground", className),
38
38
  ...props,
39
39
  "data-slot": "empty-title"
40
40
  });
41
41
  }
42
42
  function EmptyDescription({ className, ...props }) {
43
43
  return /* @__PURE__ */ jsx("div", {
44
- className: cn("asu:text-xs asu:text-muted-foreground", className),
44
+ className: cn("text-xs text-muted-foreground", className),
45
45
  ...props,
46
46
  "data-slot": "empty-description"
47
47
  });
48
48
  }
49
49
  function EmptyContent({ className, ...props }) {
50
50
  return /* @__PURE__ */ jsx("div", {
51
- className: cn("asu:flex asu:max-w-sm asu:flex-col asu:items-center asu:gap-2", className),
51
+ className: cn("flex max-w-sm flex-col items-center gap-2", className),
52
52
  ...props,
53
53
  "data-slot": "empty-content"
54
54
  });
55
55
  }
56
- //#endregion
57
56
  export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, emptyMediaVariants };
@@ -1,6 +1,5 @@
1
1
  import { Field } from "@base-ui/react/field";
2
2
  import { Fieldset } from "@base-ui/react/fieldset";
3
- //#region src/components/field/field.d.ts
4
3
  type WithClassName<P> = Omit<P, 'className'> & {
5
4
  className?: string;
6
5
  };
@@ -16,5 +15,4 @@ declare function FieldDescription({ className, ...props }: FieldDescriptionProps
16
15
  declare function FieldError({ className, ...props }: FieldErrorProps): import("react").JSX.Element;
17
16
  declare function Fieldset$1({ className, ...props }: FieldsetProps): import("react").JSX.Element;
18
17
  declare function FieldsetLegend({ className, ...props }: FieldsetLegendProps): import("react").JSX.Element;
19
- //#endregion
20
18
  export { Field$1 as Field, FieldDescription, FieldError, FieldLabel, Fieldset$1 as Fieldset, FieldsetLegend };
@@ -3,48 +3,47 @@ import { cn } from "../../lib/cn.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { Field } from "@base-ui/react/field";
5
5
  import { Fieldset } from "@base-ui/react/fieldset";
6
- //#region src/components/field/field.tsx
6
+ // src/components/field/field.tsx
7
7
  function Field$1({ className, ...props }) {
8
8
  return /* @__PURE__ */ jsx(Field.Root, {
9
- className: cn("asu:flex asu:flex-col asu:gap-1.5", className),
9
+ className: cn("flex flex-col gap-1.5", className),
10
10
  ...props,
11
11
  "data-slot": "field"
12
12
  });
13
13
  }
14
14
  function FieldLabel({ className, ...props }) {
15
15
  return /* @__PURE__ */ jsx(Field.Label, {
16
- className: cn("asu:inline-flex asu:items-center asu:gap-2 asu:text-sm asu:leading-5 asu:font-medium asu:text-foreground asu:data-disabled:text-muted-foreground", className),
16
+ className: cn("inline-flex items-center gap-2 text-sm leading-5 font-medium text-foreground data-disabled:text-muted-foreground", className),
17
17
  ...props,
18
18
  "data-slot": "field-label"
19
19
  });
20
20
  }
21
21
  function FieldDescription({ className, ...props }) {
22
22
  return /* @__PURE__ */ jsx(Field.Description, {
23
- className: cn("asu:text-sm asu:text-muted-foreground", className),
23
+ className: cn("text-sm text-muted-foreground", className),
24
24
  ...props,
25
25
  "data-slot": "field-description"
26
26
  });
27
27
  }
28
28
  function FieldError({ className, ...props }) {
29
29
  return /* @__PURE__ */ jsx(Field.Error, {
30
- className: cn("asu:text-sm asu:text-destructive-text", className),
30
+ className: cn("text-sm text-destructive-text", className),
31
31
  ...props,
32
32
  "data-slot": "field-error"
33
33
  });
34
34
  }
35
35
  function Fieldset$1({ className, ...props }) {
36
36
  return /* @__PURE__ */ jsx(Fieldset.Root, {
37
- className: cn("asu:m-0 asu:flex asu:flex-col asu:gap-3 asu:border-0 asu:p-0", className),
37
+ className: cn("m-0 flex flex-col gap-3 border-0 p-0", className),
38
38
  ...props,
39
39
  "data-slot": "fieldset"
40
40
  });
41
41
  }
42
42
  function FieldsetLegend({ className, ...props }) {
43
43
  return /* @__PURE__ */ jsx(Fieldset.Legend, {
44
- className: cn("asu:mb-1 asu:text-sm asu:font-medium asu:text-foreground", className),
44
+ className: cn("mb-1 text-sm font-medium text-foreground", className),
45
45
  ...props,
46
46
  "data-slot": "fieldset-legend"
47
47
  });
48
48
  }
49
- //#endregion
50
49
  export { Field$1 as Field, FieldDescription, FieldError, FieldLabel, Fieldset$1 as Fieldset, FieldsetLegend };
@@ -0,0 +1,33 @@
1
+ import { ReactNode } from "react";
2
+ export type LabeledFieldLayout = 'stacked' | 'inline-end' | 'inline-start';
3
+ export interface LabeledFieldProps {
4
+ label?: ReactNode;
5
+ description?: ReactNode;
6
+ /** Info icon next to the label that shows this content in a tooltip. */
7
+ labelTooltip?: ReactNode;
8
+ /** Appends the "Optional" marker to the label. */
9
+ optional?: boolean;
10
+ optionalLabel?: string;
11
+ moreInfoLabel?: string;
12
+ className?: string;
13
+ layout?: LabeledFieldLayout;
14
+ /**
15
+ * Renders a fieldset whose legend is the label, for a group of controls such as radio
16
+ * buttons. Only the stacked layout applies to a group.
17
+ */
18
+ group?: boolean;
19
+ /** Name of the field, given to the control inside it. */
20
+ name?: string;
21
+ /** Marks the field and its control invalid and shows the errors. */
22
+ invalid?: boolean;
23
+ touched?: boolean;
24
+ dirty?: boolean;
25
+ /** Messages shown under the field while it is invalid. */
26
+ errors?: readonly string[];
27
+ children: ReactNode;
28
+ }
29
+ /**
30
+ * A form row: label, optional marker, label tooltip, control, description and errors. It
31
+ * takes the field state as props, so any form library or plain React state can drive it.
32
+ */
33
+ export declare function LabeledField({ label, description, labelTooltip, optional, optionalLabel, moreInfoLabel, className, layout, group, name, invalid, touched, dirty, errors, children }: LabeledFieldProps): import("react").JSX.Element;