@codefast/ui 0.9.2 → 0.10.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 (188) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/README.md +3 -0
  3. package/dist/components/accordion.js +1 -1
  4. package/dist/components/alert-dialog.d.ts +1 -1
  5. package/dist/components/alert-dialog.js +2 -2
  6. package/dist/components/alert.d.ts +1 -1
  7. package/dist/components/alert.js +2 -2
  8. package/dist/components/attachment.d.ts +2 -2
  9. package/dist/components/attachment.js +3 -3
  10. package/dist/components/avatar.js +1 -1
  11. package/dist/components/badge.d.ts +1 -1
  12. package/dist/components/badge.js +1 -1
  13. package/dist/components/breadcrumb.js +3 -3
  14. package/dist/components/bubble.d.ts +1 -1
  15. package/dist/components/bubble.js +2 -2
  16. package/dist/components/button-group.d.ts +2 -2
  17. package/dist/components/button-group.js +3 -3
  18. package/dist/components/button.d.ts +1 -1
  19. package/dist/components/button.js +1 -1
  20. package/dist/components/calendar.d.ts +1 -1
  21. package/dist/components/calendar.js +3 -3
  22. package/dist/components/card.js +1 -1
  23. package/dist/components/carousel.d.ts +1 -1
  24. package/dist/components/carousel.js +17 -26
  25. package/dist/components/chart.js +1 -1
  26. package/dist/components/checkbox-cards.d.ts +1 -1
  27. package/dist/components/checkbox-cards.js +3 -3
  28. package/dist/components/checkbox-group.d.ts +1 -1
  29. package/dist/components/checkbox-group.js +2 -2
  30. package/dist/components/checkbox.js +1 -1
  31. package/dist/components/command.d.ts +8 -2
  32. package/dist/components/command.js +5 -5
  33. package/dist/components/context-menu.js +1 -1
  34. package/dist/components/dialog.d.ts +14 -2
  35. package/dist/components/dialog.js +6 -6
  36. package/dist/components/drawer.d.ts +2 -2
  37. package/dist/components/drawer.js +2 -2
  38. package/dist/components/dropdown-menu.js +1 -1
  39. package/dist/components/empty.d.ts +1 -1
  40. package/dist/components/empty.js +2 -2
  41. package/dist/components/field.d.ts +2 -2
  42. package/dist/components/field.js +4 -4
  43. package/dist/components/form.js +2 -2
  44. package/dist/components/hover-card.js +1 -1
  45. package/dist/components/input-group.d.ts +4 -4
  46. package/dist/components/input-group.js +5 -5
  47. package/dist/components/input-number.d.ts +2 -2
  48. package/dist/components/input-number.js +6 -6
  49. package/dist/components/input-otp.js +1 -1
  50. package/dist/components/input-password.d.ts +16 -3
  51. package/dist/components/input-password.js +3 -3
  52. package/dist/components/input-search.d.ts +8 -2
  53. package/dist/components/input-search.js +3 -3
  54. package/dist/components/input.js +1 -1
  55. package/dist/components/item.d.ts +2 -2
  56. package/dist/components/item.js +3 -3
  57. package/dist/components/kbd.js +1 -1
  58. package/dist/components/label.js +1 -1
  59. package/dist/components/marker.d.ts +1 -1
  60. package/dist/components/marker.js +2 -2
  61. package/dist/components/menubar.js +1 -1
  62. package/dist/components/message-scroller.d.ts +3 -3
  63. package/dist/components/message-scroller.js +3 -3
  64. package/dist/components/message.js +1 -1
  65. package/dist/components/native-select.js +1 -1
  66. package/dist/components/navigation-menu.js +2 -2
  67. package/dist/components/pagination.d.ts +2 -2
  68. package/dist/components/pagination.js +3 -3
  69. package/dist/components/popover.js +1 -1
  70. package/dist/components/progress-circle.d.ts +2 -2
  71. package/dist/components/progress-circle.js +3 -3
  72. package/dist/components/progress.d.ts +6 -1
  73. package/dist/components/progress.js +12 -4
  74. package/dist/components/radio-cards.js +2 -2
  75. package/dist/components/radio-group.js +1 -1
  76. package/dist/components/radio.js +1 -1
  77. package/dist/components/resizable.js +1 -1
  78. package/dist/components/scroll-area.d.ts +1 -1
  79. package/dist/components/scroll-area.js +2 -2
  80. package/dist/components/select.js +1 -1
  81. package/dist/components/separator.d.ts +1 -1
  82. package/dist/components/separator.js +2 -2
  83. package/dist/components/sheet.d.ts +9 -3
  84. package/dist/components/sheet.js +5 -5
  85. package/dist/components/sidebar.d.ts +19 -7
  86. package/dist/components/sidebar.js +66 -32
  87. package/dist/components/skeleton.js +1 -1
  88. package/dist/components/slider.js +1 -1
  89. package/dist/components/spinner.js +1 -1
  90. package/dist/components/switch.js +1 -1
  91. package/dist/components/table.js +1 -1
  92. package/dist/components/tabs.d.ts +1 -1
  93. package/dist/components/tabs.js +2 -2
  94. package/dist/components/textarea.js +1 -1
  95. package/dist/components/toggle-group.d.ts +2 -2
  96. package/dist/components/toggle-group.js +2 -2
  97. package/dist/components/toggle.d.ts +1 -1
  98. package/dist/components/toggle.js +1 -1
  99. package/dist/components/tooltip.js +1 -1
  100. package/dist/hooks/use-is-mobile.js +1 -1
  101. package/dist/hooks/use-media-query.d.ts +3 -3
  102. package/dist/hooks/use-media-query.js +15 -32
  103. package/dist/hooks/use-message-scroller-commands.d.ts +2 -2
  104. package/dist/hooks/use-message-scroller-commands.js +2 -2
  105. package/dist/hooks/use-message-scroller-controller.d.ts +2 -2
  106. package/dist/hooks/use-message-scroller-controller.js +4 -4
  107. package/dist/hooks/use-message-scroller-refs.d.ts +1 -1
  108. package/dist/hooks/use-message-scroller-refs.js +3 -3
  109. package/dist/index.d.ts +180 -180
  110. package/dist/index.js +93 -93
  111. package/dist/lib/message-scroller/geometry.d.ts +1 -1
  112. package/dist/lib/message-scroller/geometry.js +1 -1
  113. package/dist/lib/message-scroller/stores.d.ts +1 -1
  114. package/dist/lib/message-scroller/stores.js +1 -1
  115. package/dist/lib/message-scroller/types.d.ts +1 -1
  116. package/dist/primitives/input-number.d.ts +6 -6
  117. package/dist/primitives/input-number.js +6 -6
  118. package/dist/primitives/message-scroller.d.ts +6 -6
  119. package/dist/primitives/message-scroller.js +3 -3
  120. package/dist/variants/alert.d.ts +1 -1
  121. package/dist/variants/alert.js +1 -1
  122. package/dist/variants/attachment.d.ts +1 -1
  123. package/dist/variants/attachment.js +1 -1
  124. package/dist/variants/badge.d.ts +1 -1
  125. package/dist/variants/badge.js +1 -1
  126. package/dist/variants/bubble.d.ts +1 -1
  127. package/dist/variants/bubble.js +1 -1
  128. package/dist/variants/button-group.d.ts +1 -1
  129. package/dist/variants/button-group.js +1 -1
  130. package/dist/variants/button.d.ts +1 -1
  131. package/dist/variants/button.js +1 -1
  132. package/dist/variants/empty.d.ts +1 -1
  133. package/dist/variants/empty.js +1 -1
  134. package/dist/variants/field.d.ts +1 -1
  135. package/dist/variants/field.js +1 -1
  136. package/dist/variants/input-group.d.ts +1 -1
  137. package/dist/variants/input-group.js +1 -1
  138. package/dist/variants/item.d.ts +1 -1
  139. package/dist/variants/item.js +1 -1
  140. package/dist/variants/marker.d.ts +1 -1
  141. package/dist/variants/marker.js +1 -1
  142. package/dist/variants/navigation-menu.d.ts +1 -1
  143. package/dist/variants/navigation-menu.js +1 -1
  144. package/dist/variants/progress-circle.d.ts +1 -1
  145. package/dist/variants/progress-circle.js +1 -1
  146. package/dist/variants/scroll-area.d.ts +1 -1
  147. package/dist/variants/scroll-area.js +1 -1
  148. package/dist/variants/separator.d.ts +1 -1
  149. package/dist/variants/separator.js +1 -1
  150. package/dist/variants/sheet.d.ts +1 -1
  151. package/dist/variants/sheet.js +1 -1
  152. package/dist/variants/sidebar.d.ts +1 -1
  153. package/dist/variants/sidebar.js +1 -1
  154. package/dist/variants/tabs.d.ts +1 -1
  155. package/dist/variants/tabs.js +1 -1
  156. package/dist/variants/toggle.d.ts +1 -1
  157. package/dist/variants/toggle.js +1 -1
  158. package/package.json +8 -7
  159. package/src/css/foundation/base.css +68 -0
  160. package/src/css/foundation/motion.css +65 -0
  161. package/src/css/foundation/source.css +14 -0
  162. package/src/css/foundation/tokens.css +83 -0
  163. package/src/css/foundation/utilities.css +451 -0
  164. package/src/css/foundation/variants.css +121 -0
  165. package/src/css/preset.css +14 -0
  166. package/src/css/style.css +11 -0
  167. package/src/css/themes/amber.css +105 -0
  168. package/src/css/themes/blue.css +105 -0
  169. package/src/css/themes/cyan.css +105 -0
  170. package/src/css/themes/emerald.css +105 -0
  171. package/src/css/themes/fuchsia.css +105 -0
  172. package/src/css/themes/gray.css +105 -0
  173. package/src/css/themes/green.css +105 -0
  174. package/src/css/themes/indigo.css +105 -0
  175. package/src/css/themes/lime.css +105 -0
  176. package/src/css/themes/neutral.css +105 -0
  177. package/src/css/themes/orange.css +105 -0
  178. package/src/css/themes/pink.css +105 -0
  179. package/src/css/themes/purple.css +105 -0
  180. package/src/css/themes/red.css +105 -0
  181. package/src/css/themes/rose.css +105 -0
  182. package/src/css/themes/sky.css +105 -0
  183. package/src/css/themes/slate.css +105 -0
  184. package/src/css/themes/stone.css +105 -0
  185. package/src/css/themes/teal.css +105 -0
  186. package/src/css/themes/violet.css +105 -0
  187. package/src/css/themes/yellow.css +105 -0
  188. package/src/css/themes/zinc.css +105 -0
@@ -1,7 +1,7 @@
1
1
  import type { ComponentProps, JSX } from "react";
2
2
  import { Drawer as DrawerPrimitive } from "vaul";
3
- import type { VariantProps } from "#/lib/utils";
4
- import { buttonVariants } from "#/variants/button";
3
+ import type { VariantProps } from "#lib/utils";
4
+ import { buttonVariants } from "#variants/button";
5
5
  /**
6
6
  * @since 0.3.16-canary.0
7
7
  */
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Drawer as DrawerPrimitive } from "vaul";
3
- import { cn } from "#/lib/utils";
4
- import { buttonVariants } from "#/variants/button";
3
+ import { cn } from "#lib/utils";
4
+ import { buttonVariants } from "#variants/button";
5
5
  /**
6
6
  * @since 0.3.16-canary.0
7
7
  */
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { CheckIcon, ChevronRightIcon } from "lucide-react";
3
3
  import * as DropdownMenuPrimitive from "radix-ui/dropdown-menu";
4
- import { cn } from "#/lib/utils";
4
+ import { cn } from "#lib/utils";
5
5
  /**
6
6
  * @since 0.3.16-canary.0
7
7
  */
@@ -1,5 +1,5 @@
1
1
  import type { ComponentProps, JSX } from "react";
2
- import type { EmptyMediaVariants } from "#/variants/empty";
2
+ import type { EmptyMediaVariants } from "#variants/empty";
3
3
  /**
4
4
  * @since 0.3.16-canary.0
5
5
  */
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from "#/lib/utils";
3
- import { emptyMediaVariants } from "#/variants/empty";
2
+ import { cn } from "#lib/utils";
3
+ import { emptyMediaVariants } from "#variants/empty";
4
4
  /**
5
5
  * @since 0.3.16-canary.0
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import type { ComponentProps, JSX } from "react";
2
- import { Label } from "#/components/label";
3
- import type { FieldVariants } from "#/variants/field";
2
+ import { Label } from "#components/label";
3
+ import type { FieldVariants } from "#variants/field";
4
4
  /**
5
5
  * @since 0.3.16-canary.0
6
6
  */
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
- import { Label } from "#/components/label";
4
- import { Separator } from "#/components/separator";
5
- import { cn } from "#/lib/utils";
6
- import { fieldVariants } from "#/variants/field";
3
+ import { Label } from "#components/label";
4
+ import { Separator } from "#components/separator";
5
+ import { cn } from "#lib/utils";
6
+ import { fieldVariants } from "#variants/field";
7
7
  /**
8
8
  * @since 0.3.16-canary.0
9
9
  */
@@ -3,8 +3,8 @@ import { Context } from "radix-ui/internal";
3
3
  import * as Slot from "radix-ui/slot";
4
4
  import { useId } from "react";
5
5
  import { Controller, FormProvider, useFormContext, useFormState } from "react-hook-form";
6
- import { Label } from "#/components/label";
7
- import { cn } from "#/lib/utils";
6
+ import { Label } from "#components/label";
7
+ import { cn } from "#lib/utils";
8
8
  /**
9
9
  * @since 0.3.16-canary.0
10
10
  */
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as HoverCardPrimitive from "radix-ui/hover-card";
3
- import { cn } from "#/lib/utils";
3
+ import { cn } from "#lib/utils";
4
4
  /**
5
5
  * @since 0.3.16-canary.0
6
6
  */
@@ -1,8 +1,8 @@
1
1
  import type { ComponentProps, JSX } from "react";
2
- import type { ButtonProps } from "#/components/button";
3
- import type { InputProps } from "#/components/input";
4
- import type { TextareaProps } from "#/components/textarea";
5
- import type { InputGroupAddonVariants, InputGroupButtonVariants } from "#/variants/input-group";
2
+ import type { ButtonProps } from "#components/button";
3
+ import type { InputProps } from "#components/input";
4
+ import type { TextareaProps } from "#components/textarea";
5
+ import type { InputGroupAddonVariants, InputGroupButtonVariants } from "#variants/input-group";
6
6
  /**
7
7
  * @since 0.3.16-canary.0
8
8
  */
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Button } from "#/components/button";
3
- import { Input } from "#/components/input";
4
- import { Textarea } from "#/components/textarea";
5
- import { cn } from "#/lib/utils";
6
- import { inputGroupAddonVariants, inputGroupButtonVariants, inputGroupVariants } from "#/variants/input-group";
2
+ import { Button } from "#components/button";
3
+ import { Input } from "#components/input";
4
+ import { Textarea } from "#components/textarea";
5
+ import { cn } from "#lib/utils";
6
+ import { inputGroupAddonVariants, inputGroupButtonVariants, inputGroupVariants } from "#variants/input-group";
7
7
  /**
8
8
  * @since 0.3.16-canary.0
9
9
  */
@@ -1,5 +1,5 @@
1
1
  import type { ComponentProps, JSX } from "react";
2
- import * as InputNumberPrimitive from "#/primitives/input-number";
2
+ import * as InputNumberPrimitive from "#primitives/input-number";
3
3
  /**
4
4
  * @since 0.3.16-canary.0
5
5
  */
@@ -11,7 +11,7 @@ type InputNumberProps = ComponentProps<typeof InputNumberPrimitive.Root>;
11
11
  *
12
12
  * @since 0.3.16-canary.0
13
13
  */
14
- declare function InputNumber({ ariaDecrementLabel, ariaIncrementLabel, className, spinner, ...props }: InputNumberProps): JSX.Element;
14
+ declare function InputNumber({ className, decrementLabel, incrementLabel, spinner, ...props }: InputNumberProps): JSX.Element;
15
15
  /**
16
16
  * @since 0.5.0-canary.6
17
17
  */
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ChevronDownIcon, ChevronUpIcon, MinusIcon, PlusIcon } from "lucide-react";
3
- import { Spinner } from "#/components/spinner";
4
- import { cn } from "#/lib/utils";
5
- import * as InputNumberPrimitive from "#/primitives/input-number";
6
- import { buttonVariants } from "#/variants/button";
3
+ import { Spinner } from "#components/spinner";
4
+ import { cn } from "#lib/utils";
5
+ import * as InputNumberPrimitive from "#primitives/input-number";
6
+ import { buttonVariants } from "#variants/button";
7
7
  /**
8
8
  * The container that owns the numeric state (value, min, max, step, formatting).
9
9
  * Compose an {@link InputNumberField} with an {@link InputNumberStepper}, or with
@@ -11,8 +11,8 @@ import { buttonVariants } from "#/variants/button";
11
11
  *
12
12
  * @since 0.3.16-canary.0
13
13
  */
14
- function InputNumber({ ariaDecrementLabel = "Decrement", ariaIncrementLabel = "Increment", className, spinner, ...props }) {
15
- return (_jsx(InputNumberPrimitive.Root, { ariaDecrementLabel: ariaDecrementLabel, ariaIncrementLabel: ariaIncrementLabel, className: cn("group/input-number relative flex h-8 w-full min-w-0 items-center overflow-hidden rounded-lg bg-transparent text-base inset-ring inset-ring-input transition-[color,box-shadow] not-has-[input:disabled]:shadow-xs has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-aria-invalid:inset-ring-destructive has-[input:disabled]:bg-input/50 has-[input:disabled]:opacity-50 has-[input:focus-visible]:ring-3 has-[input:focus-visible]:ring-ring/50 has-[input:focus-visible]:inset-ring-ring motion-reduce:transition-none md:text-sm dark:bg-input/30 dark:has-aria-invalid:ring-destructive/40 dark:has-aria-invalid:inset-ring-destructive/50 dark:has-[input:disabled]:bg-input/80 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), "data-slot": "input-number", spinner: spinner ?? _jsx(Spinner, {}), ...props }));
14
+ function InputNumber({ className, decrementLabel = "Decrement", incrementLabel = "Increment", spinner, ...props }) {
15
+ return (_jsx(InputNumberPrimitive.Root, { className: cn("group/input-number relative flex h-8 w-full min-w-0 items-center overflow-hidden rounded-lg bg-transparent text-base inset-ring inset-ring-input transition-[color,box-shadow] not-has-[input:disabled]:shadow-xs has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-aria-invalid:inset-ring-destructive has-[input:disabled]:bg-input/50 has-[input:disabled]:opacity-50 has-[input:focus-visible]:ring-3 has-[input:focus-visible]:ring-ring/50 has-[input:focus-visible]:inset-ring-ring motion-reduce:transition-none md:text-sm dark:bg-input/30 dark:has-aria-invalid:ring-destructive/40 dark:has-aria-invalid:inset-ring-destructive/50 dark:has-[input:disabled]:bg-input/80 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), "data-slot": "input-number", decrementLabel: decrementLabel, incrementLabel: incrementLabel, spinner: spinner ?? _jsx(Spinner, {}), ...props }));
16
16
  }
17
17
  /**
18
18
  * The editable numeric input.
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { OTPInput, OTPInputContext } from "input-otp";
3
3
  import { MinusIcon } from "lucide-react";
4
4
  import { use } from "react";
5
- import { cn } from "#/lib/utils";
5
+ import { cn } from "#lib/utils";
6
6
  /**
7
7
  * @since 0.3.16-canary.0
8
8
  */
@@ -1,12 +1,25 @@
1
1
  import type { ComponentProps, JSX } from "react";
2
- import { InputGroupInput } from "#/components/input-group";
2
+ import { InputGroupInput } from "#components/input-group";
3
3
  /**
4
4
  * @since 0.3.16-canary.0
5
5
  */
6
- type InputPasswordProps = Omit<ComponentProps<typeof InputGroupInput>, "type">;
6
+ interface InputPasswordProps extends Omit<ComponentProps<typeof InputGroupInput>, "type"> {
7
+ /**
8
+ * The accessible name of the reveal toggle while the password is shown.
9
+ *
10
+ * @defaultValue `"Hide password"`
11
+ */
12
+ concealLabel?: string | undefined;
13
+ /**
14
+ * The accessible name of the reveal toggle while the password is hidden.
15
+ *
16
+ * @defaultValue `"Show password"`
17
+ */
18
+ revealLabel?: string | undefined;
19
+ }
7
20
  /**
8
21
  * @since 0.3.16-canary.0
9
22
  */
10
- declare function InputPassword({ className, disabled, readOnly, ...props }: InputPasswordProps): JSX.Element;
23
+ declare function InputPassword({ className, concealLabel, disabled, readOnly, revealLabel, ...props }: InputPasswordProps): JSX.Element;
11
24
  export { InputPassword };
12
25
  export type { InputPasswordProps };
@@ -1,16 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { EyeIcon, EyeOffIcon } from "lucide-react";
3
3
  import { useCallback, useState } from "react";
4
- import { InputGroup, InputGroupButton, InputGroupInput } from "#/components/input-group";
4
+ import { InputGroup, InputGroupButton, InputGroupInput } from "#components/input-group";
5
5
  /**
6
6
  * @since 0.3.16-canary.0
7
7
  */
8
- function InputPassword({ className, disabled, readOnly, ...props }) {
8
+ function InputPassword({ className, concealLabel = "Hide password", disabled, readOnly, revealLabel = "Show password", ...props }) {
9
9
  const [type, setType] = useState("password");
10
10
  const togglePasswordVisibility = useCallback(() => {
11
11
  setType((previous) => (previous === "password" ? "text" : "password"));
12
12
  }, []);
13
- return (_jsxs(InputGroup, { className: className, "data-disabled": disabled ? "true" : undefined, "data-slot": "input-password", children: [_jsx(InputGroupInput, { autoCapitalize: "none", disabled: disabled, readOnly: readOnly, type: type, ...props }), _jsx(InputGroupButton, { "aria-label": type === "password" ? "Show password" : "Hide password", className: "rounded-full", "data-slot": "input-password-toggle", disabled: disabled, size: "icon-sm", type: "button", variant: "ghost", onClick: togglePasswordVisibility, children: type === "password" ? _jsx(EyeOffIcon, {}) : _jsx(EyeIcon, {}) })] }));
13
+ return (_jsxs(InputGroup, { className: className, "data-disabled": disabled ? "true" : undefined, "data-slot": "input-password", children: [_jsx(InputGroupInput, { autoCapitalize: "none", disabled: disabled, readOnly: readOnly, type: type, ...props }), _jsx(InputGroupButton, { "aria-label": type === "password" ? revealLabel : concealLabel, className: "rounded-full", "data-slot": "input-password-toggle", disabled: disabled, size: "icon-sm", type: "button", variant: "ghost", onClick: togglePasswordVisibility, children: type === "password" ? _jsx(EyeOffIcon, {}) : _jsx(EyeIcon, {}) })] }));
14
14
  }
15
15
  // ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
16
16
  export { InputPassword };
@@ -1,9 +1,15 @@
1
1
  import type { ComponentProps, JSX } from "react";
2
- import { InputGroupInput } from "#/components/input-group";
2
+ import { InputGroupInput } from "#components/input-group";
3
3
  /**
4
4
  * @since 0.3.16-canary.0
5
5
  */
6
6
  interface InputSearchProps extends Omit<ComponentProps<typeof InputGroupInput>, "defaultValue" | "onChange" | "type" | "value"> {
7
+ /**
8
+ * The accessible name of the button that clears the query.
9
+ *
10
+ * @defaultValue `"Clear search"`
11
+ */
12
+ clearLabel?: string | undefined;
7
13
  defaultValue?: string;
8
14
  onChange?: (value?: string) => void;
9
15
  value?: string;
@@ -11,6 +17,6 @@ interface InputSearchProps extends Omit<ComponentProps<typeof InputGroupInput>,
11
17
  /**
12
18
  * @since 0.3.16-canary.0
13
19
  */
14
- declare function InputSearch({ className, defaultValue, disabled, onChange, readOnly, value: valueProperty, ...props }: InputSearchProps): JSX.Element;
20
+ declare function InputSearch({ className, clearLabel, defaultValue, disabled, onChange, readOnly, value: valueProperty, ...props }: InputSearchProps): JSX.Element;
15
21
  export { InputSearch };
16
22
  export type { InputSearchProps };
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { SearchIcon, XIcon } from "lucide-react";
3
3
  import { useControllableState } from "radix-ui/internal";
4
- import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "#/components/input-group";
4
+ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "#components/input-group";
5
5
  /**
6
6
  * @since 0.3.16-canary.0
7
7
  */
8
- function InputSearch({ className, defaultValue, disabled, onChange, readOnly, value: valueProperty, ...props }) {
8
+ function InputSearch({ className, clearLabel = "Clear search", defaultValue, disabled, onChange, readOnly, value: valueProperty, ...props }) {
9
9
  const [value, setValue] = useControllableState({
10
10
  defaultProp: defaultValue,
11
11
  prop: valueProperty,
@@ -13,7 +13,7 @@ function InputSearch({ className, defaultValue, disabled, onChange, readOnly, va
13
13
  });
14
14
  return (_jsxs(InputGroup, { className: className, "data-disabled": disabled ? "true" : undefined, "data-slot": "input-search", children: [_jsx(InputGroupAddon, { align: "inline-start", children: _jsx(SearchIcon, {}) }), _jsx(InputGroupInput, { disabled: disabled, readOnly: readOnly, type: "search", value: value ?? "", onChange: (event) => {
15
15
  setValue(event.target.value);
16
- }, ...props }), value ? (_jsx(InputGroupButton, { "aria-label": "Clear search", className: "rounded-full", "data-slot": "input-search-clear", disabled: disabled ?? readOnly, size: "icon-sm", type: "button", variant: "ghost", onClick: () => {
16
+ }, ...props }), value ? (_jsx(InputGroupButton, { "aria-label": clearLabel, className: "rounded-full", "data-slot": "input-search-clear", disabled: disabled || readOnly, size: "icon-sm", type: "button", variant: "ghost", onClick: () => {
17
17
  setValue("");
18
18
  }, children: _jsx(XIcon, {}) })) : null] }));
19
19
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from "#/lib/utils";
2
+ import { cn } from "#lib/utils";
3
3
  /**
4
4
  * @since 0.3.16-canary.0
5
5
  */
@@ -1,6 +1,6 @@
1
1
  import type { ComponentProps, JSX } from "react";
2
- import { Separator } from "#/components/separator";
3
- import type { ItemMediaVariants, ItemVariants } from "#/variants/item";
2
+ import { Separator } from "#components/separator";
3
+ import type { ItemMediaVariants, ItemVariants } from "#variants/item";
4
4
  /**
5
5
  * @since 0.3.16-canary.0
6
6
  */
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as Slot from "radix-ui/slot";
3
- import { Separator } from "#/components/separator";
4
- import { cn } from "#/lib/utils";
5
- import { itemMediaVariants, itemVariants } from "#/variants/item";
3
+ import { Separator } from "#components/separator";
4
+ import { cn } from "#lib/utils";
5
+ import { itemMediaVariants, itemVariants } from "#variants/item";
6
6
  /**
7
7
  * @since 0.3.16-canary.0
8
8
  */
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from "#/lib/utils";
2
+ import { cn } from "#lib/utils";
3
3
  /**
4
4
  * @since 0.3.16-canary.0
5
5
  */
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as LabelPrimitive from "radix-ui/label";
3
- import { cn } from "#/lib/utils";
3
+ import { cn } from "#lib/utils";
4
4
  /**
5
5
  * @since 0.3.16-canary.0
6
6
  */
@@ -1,5 +1,5 @@
1
1
  import type { ComponentProps, JSX } from "react";
2
- import type { MarkerVariants } from "#/variants/marker";
2
+ import type { MarkerVariants } from "#variants/marker";
3
3
  /**
4
4
  * Inline divider for a message feed — a date, unread line, or section label.
5
5
  *
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as Slot from "radix-ui/slot";
3
- import { cn } from "#/lib/utils";
4
- import { markerVariants } from "#/variants/marker";
3
+ import { cn } from "#lib/utils";
4
+ import { markerVariants } from "#variants/marker";
5
5
  /**
6
6
  * @since 0.5.0-canary.3
7
7
  */
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { CheckIcon, ChevronRightIcon } from "lucide-react";
3
3
  import * as MenubarPrimitive from "radix-ui/menubar";
4
- import { cn } from "#/lib/utils";
4
+ import { cn } from "#lib/utils";
5
5
  /**
6
6
  * @since 0.3.16-canary.0
7
7
  */
@@ -1,6 +1,6 @@
1
1
  import type { ComponentProps, JSX } from "react";
2
- import { Button } from "#/components/button";
3
- import { MessageScroller as MessageScrollerPrimitive, MessageScrollerButton as MessageScrollerButtonPrimitive, MessageScrollerContent as MessageScrollerContentPrimitive, MessageScrollerItem as MessageScrollerItemPrimitive, MessageScrollerProvider as MessageScrollerProviderPrimitive, MessageScrollerViewport as MessageScrollerViewportPrimitive, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility } from "#/primitives/message-scroller";
2
+ import { Button } from "#components/button";
3
+ import { MessageScroller as MessageScrollerPrimitive, MessageScrollerButton as MessageScrollerButtonPrimitive, MessageScrollerContent as MessageScrollerContentPrimitive, MessageScrollerItem as MessageScrollerItemPrimitive, MessageScrollerProvider as MessageScrollerProviderPrimitive, MessageScrollerViewport as MessageScrollerViewportPrimitive, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility } from "#primitives/message-scroller";
4
4
  /**
5
5
  * Owns scroll behavior for a transcript. Renders no DOM; wrap the frame.
6
6
  *
@@ -63,4 +63,4 @@ type MessageScrollerButtonProps = ComponentProps<typeof MessageScrollerButtonPri
63
63
  declare function MessageScrollerButton({ children, className, direction, render, size, variant, ...props }: MessageScrollerButtonProps): JSX.Element;
64
64
  export { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility, };
65
65
  export type { MessageScrollerButtonProps, MessageScrollerContentProps, MessageScrollerItemProps, MessageScrollerProps, MessageScrollerProviderProps, MessageScrollerViewportProps, };
66
- export type { MessageScrollerDefaultScrollPosition, MessageScrollerScrollAlign, MessageScrollerScrollable, MessageScrollerScrollOptions, MessageScrollerVisibilityState, } from "#/lib/message-scroller/types";
66
+ export type { MessageScrollerDefaultScrollPosition, MessageScrollerScrollAlign, MessageScrollerScrollable, MessageScrollerScrollOptions, MessageScrollerVisibilityState, } from "#lib/message-scroller/types";
@@ -1,8 +1,8 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ArrowDownIcon } from "lucide-react";
3
- import { Button } from "#/components/button";
4
- import { cn } from "#/lib/utils";
5
- import { MessageScroller as MessageScrollerPrimitive, MessageScrollerButton as MessageScrollerButtonPrimitive, MessageScrollerContent as MessageScrollerContentPrimitive, MessageScrollerItem as MessageScrollerItemPrimitive, MessageScrollerProvider as MessageScrollerProviderPrimitive, MessageScrollerViewport as MessageScrollerViewportPrimitive, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility, } from "#/primitives/message-scroller";
3
+ import { Button } from "#components/button";
4
+ import { cn } from "#lib/utils";
5
+ import { MessageScroller as MessageScrollerPrimitive, MessageScrollerButton as MessageScrollerButtonPrimitive, MessageScrollerContent as MessageScrollerContentPrimitive, MessageScrollerItem as MessageScrollerItemPrimitive, MessageScrollerProvider as MessageScrollerProviderPrimitive, MessageScrollerViewport as MessageScrollerViewportPrimitive, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility, } from "#primitives/message-scroller";
6
6
  /**
7
7
  * @since 0.5.0-canary.3
8
8
  */
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from "#/lib/utils";
2
+ import { cn } from "#lib/utils";
3
3
  /**
4
4
  * @since 0.5.0-canary.3
5
5
  */
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ChevronDownIcon } from "lucide-react";
3
- import { cn } from "#/lib/utils";
3
+ import { cn } from "#lib/utils";
4
4
  /**
5
5
  * @since 0.3.16-canary.0
6
6
  */
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ChevronDownIcon } from "lucide-react";
3
3
  import * as NavigationMenuPrimitive from "radix-ui/navigation-menu";
4
- import { cn } from "#/lib/utils";
5
- import { navigationMenuTriggerVariants } from "#/variants/navigation-menu";
4
+ import { cn } from "#lib/utils";
5
+ import { navigationMenuTriggerVariants } from "#variants/navigation-menu";
6
6
  /**
7
7
  * @since 0.3.16-canary.0
8
8
  */
@@ -1,6 +1,6 @@
1
1
  import type { ComponentProps, JSX } from "react";
2
- import type { VariantProps } from "#/lib/utils";
3
- import { buttonVariants } from "#/variants/button";
2
+ import type { VariantProps } from "#lib/utils";
3
+ import { buttonVariants } from "#variants/button";
4
4
  /**
5
5
  * @since 0.3.16-canary.0
6
6
  */
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
3
- import { cn } from "#/lib/utils";
4
- import { buttonVariants } from "#/variants/button";
3
+ import { cn } from "#lib/utils";
4
+ import { buttonVariants } from "#variants/button";
5
5
  /**
6
6
  * @since 0.3.16-canary.0
7
7
  */
@@ -42,7 +42,7 @@ function PaginationNext({ className, text = "Next", ...props }) {
42
42
  * @since 0.3.16-canary.0
43
43
  */
44
44
  function PaginationEllipsis({ className, ...props }) {
45
- return (_jsxs("span", { "aria-hidden": true, className: cn("flex size-8 items-center justify-center [&_svg:not([class*='size-'])]:size-4", className), "data-slot": "pagination-ellipsis", ...props, children: [_jsx(MoreHorizontalIcon, {}), _jsx("span", { className: "sr-only", children: "More pages" })] }));
45
+ return (_jsx("span", { "aria-hidden": true, className: cn("flex size-8 items-center justify-center [&_svg:not([class*='size-'])]:size-4", className), "data-slot": "pagination-ellipsis", ...props, children: _jsx(MoreHorizontalIcon, {}) }));
46
46
  }
47
47
  // ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
48
48
  export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, };
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as PopoverPrimitive from "radix-ui/popover";
3
- import { cn } from "#/lib/utils";
3
+ import { cn } from "#lib/utils";
4
4
  /**
5
5
  * @since 0.3.16-canary.0
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import type { ComponentProps, JSX } from "react";
2
- import * as ProgressCirclePrimitive from "#/primitives/progress-circle";
3
- import type { ProgressCircleVariants } from "#/variants/progress-circle";
2
+ import * as ProgressCirclePrimitive from "#primitives/progress-circle";
3
+ import type { ProgressCircleVariants } from "#variants/progress-circle";
4
4
  /**
5
5
  * @since 0.3.16-canary.0
6
6
  */
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useMemo } from "react";
3
- import { useAnimatedValue } from "#/hooks/use-animated-value";
4
- import * as ProgressCirclePrimitive from "#/primitives/progress-circle";
5
- import { progressCircleVariants } from "#/variants/progress-circle";
3
+ import { useAnimatedValue } from "#hooks/use-animated-value";
4
+ import * as ProgressCirclePrimitive from "#primitives/progress-circle";
5
+ import { progressCircleVariants } from "#variants/progress-circle";
6
6
  /**
7
7
  * @since 0.3.16-canary.0
8
8
  */
@@ -5,8 +5,13 @@ import type { ComponentProps, JSX } from "react";
5
5
  */
6
6
  type ProgressProps = ComponentProps<typeof ProgressPrimitive.Root>;
7
7
  /**
8
+ * A horizontal bar that fills to `value` out of `max`.
9
+ *
10
+ * @remarks `value` defaults to `0` and is clamped to `max`; `null` marks the work indeterminate, which leaves out
11
+ * `aria-valuenow`.
12
+ *
8
13
  * @since 0.3.16-canary.0
9
14
  */
10
- declare function Progress({ className, value, ...props }: ProgressProps): JSX.Element;
15
+ declare function Progress({ className, max, value, ...props }: ProgressProps): JSX.Element;
11
16
  export { Progress };
12
17
  export type { ProgressProps };
@@ -1,12 +1,20 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as ProgressPrimitive from "radix-ui/progress";
3
- import { cn } from "#/lib/utils";
3
+ import { cn } from "#lib/utils";
4
4
  /**
5
+ * A horizontal bar that fills to `value` out of `max`.
6
+ *
7
+ * @remarks `value` defaults to `0` and is clamped to `max`; `null` marks the work indeterminate, which leaves out
8
+ * `aria-valuenow`.
9
+ *
5
10
  * @since 0.3.16-canary.0
6
11
  */
7
- function Progress({ className, value, ...props }) {
8
- return (_jsx(ProgressPrimitive.Root, { className: cn("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted", className), "data-slot": "progress", ...props, children: _jsx(ProgressPrimitive.Indicator, { className: "size-full flex-1 bg-primary transition-all", "data-slot": "progress-indicator", style: {
9
- transform: `translateX(-${(100 - (value ?? 0)).toString()}%)`,
12
+ function Progress({ className, max = 100, value = 0, ...props }) {
13
+ // One clamped value feeds both Radix's ARIA state and the fill, so what is announced is what is drawn.
14
+ const clampedValue = value === null ? null : Math.min(Math.max(value, 0), max);
15
+ const filledPercent = clampedValue === null ? 0 : (clampedValue / max) * 100;
16
+ return (_jsx(ProgressPrimitive.Root, { className: cn("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted", className), "data-slot": "progress", max: max, value: clampedValue, ...props, children: _jsx(ProgressPrimitive.Indicator, { className: "size-full flex-1 bg-primary transition-all", "data-slot": "progress-indicator", style: {
17
+ transform: `translateX(-${(100 - filledPercent).toString()}%)`,
10
18
  } }) }));
11
19
  }
12
20
  // ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as RadioGroupPrimitive from "radix-ui/radio-group";
3
- import { Label } from "#/components/label";
4
- import { cn } from "#/lib/utils";
3
+ import { Label } from "#components/label";
4
+ import { cn } from "#lib/utils";
5
5
  /**
6
6
  * @since 0.3.16-canary.0
7
7
  */
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as RadioGroupPrimitive from "radix-ui/radio-group";
3
- import { cn } from "#/lib/utils";
3
+ import { cn } from "#lib/utils";
4
4
  /**
5
5
  * @since 0.3.16-canary.0
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { composeEventHandlers } from "radix-ui/internal";
3
- import { cn } from "#/lib/utils";
3
+ import { cn } from "#lib/utils";
4
4
  /**
5
5
  * @since 0.3.16-canary.0
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as ResizablePrimitive from "react-resizable-panels";
3
- import { cn } from "#/lib/utils";
3
+ import { cn } from "#lib/utils";
4
4
  /**
5
5
  * @since 0.3.16-canary.0
6
6
  */
@@ -1,7 +1,7 @@
1
1
  import { Context } from "radix-ui/internal";
2
2
  import * as ScrollAreaPrimitive from "radix-ui/scroll-area";
3
3
  import type { ComponentProps, JSX } from "react";
4
- import type { ScrollAreaScrollbarVariants } from "#/variants/scroll-area";
4
+ import type { ScrollAreaScrollbarVariants } from "#variants/scroll-area";
5
5
  type ScopedProps<P> = P & {
6
6
  __scopeScrollArea?: Context.Scope;
7
7
  };
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Context } from "radix-ui/internal";
3
3
  import * as ScrollAreaPrimitive from "radix-ui/scroll-area";
4
- import { cn } from "#/lib/utils";
5
- import { scrollAreaScrollbarVariants } from "#/variants/scroll-area";
4
+ import { cn } from "#lib/utils";
5
+ import { scrollAreaScrollbarVariants } from "#variants/scroll-area";
6
6
  // ── Context: ScrollArea ──────────────────────────────────────────────────────────────────────────────────────────────
7
7
  const SCROLL_AREA_NAME = "ScrollArea";
8
8
  const [createScrollAreaContext] = Context.createContextScope(SCROLL_AREA_NAME);
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
3
3
  import * as SelectPrimitive from "radix-ui/select";
4
- import { cn } from "#/lib/utils";
4
+ import { cn } from "#lib/utils";
5
5
  /**
6
6
  * @since 0.3.16-canary.0
7
7
  */
@@ -1,6 +1,6 @@
1
1
  import * as SeparatorPrimitive from "radix-ui/separator";
2
2
  import type { ComponentProps, JSX } from "react";
3
- import type { SeparatorVariants } from "#/variants/separator";
3
+ import type { SeparatorVariants } from "#variants/separator";
4
4
  /**
5
5
  * @since 0.3.16-canary.0
6
6
  */