@fabio.caffarello/react-design-system 1.24.0 → 2.0.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 (147) hide show
  1. package/README.md +2 -12
  2. package/dist/index.cjs +204 -375
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.js +7399 -6914
  5. package/dist/index.js.map +1 -1
  6. package/dist/react-design-system.css +1 -1
  7. package/dist/ui/components/Accordion/Accordion.d.ts +1 -1
  8. package/dist/ui/components/Autocomplete/Autocomplete.d.ts +0 -1
  9. package/dist/ui/components/Autocomplete/AutocompleteList.d.ts +1 -1
  10. package/dist/ui/components/Autocomplete/index.d.ts +1 -1
  11. package/dist/ui/components/Breadcrumb/Breadcrumb.d.ts +1 -1
  12. package/dist/ui/components/ButtonGroup/ButtonGroup.d.ts +1 -1
  13. package/dist/ui/components/Card/Card.d.ts +1 -1
  14. package/dist/ui/components/ColorPicker/ColorPicker.d.ts +1 -1
  15. package/dist/ui/components/CommandPalette/CommandPalette.d.ts +1 -1
  16. package/dist/ui/components/DashboardLayout/DashboardLayout.d.ts +1 -1
  17. package/dist/ui/components/DataGrid/DataGrid.d.ts +27 -4
  18. package/dist/ui/components/DataTablePattern/DataTablePattern.d.ts +1 -1
  19. package/dist/ui/components/DatePicker/DatePicker.d.ts +4 -4
  20. package/dist/ui/components/DatePicker/DatePickerCalendar.d.ts +1 -1
  21. package/dist/ui/components/DatePicker/DatePickerInput.d.ts +1 -1
  22. package/dist/ui/components/DatePicker/DatePickerProvider.d.ts +1 -1
  23. package/dist/ui/components/Dialog/AlertDialog.d.ts +1 -1
  24. package/dist/ui/components/Dialog/Dialog.d.ts +1 -1
  25. package/dist/ui/components/Dialog/DialogClose.d.ts +6 -2
  26. package/dist/ui/components/Dialog/DialogContent.d.ts +1 -1
  27. package/dist/ui/components/Dialog/DialogDescription.d.ts +1 -1
  28. package/dist/ui/components/Dialog/DialogFooter.d.ts +1 -1
  29. package/dist/ui/components/Dialog/DialogHeader.d.ts +1 -1
  30. package/dist/ui/components/Dialog/DialogTitle.d.ts +1 -1
  31. package/dist/ui/components/Dialog/DialogTrigger.d.ts +6 -2
  32. package/dist/ui/components/Drawer/Drawer.d.ts +1 -1
  33. package/dist/ui/components/Drawer/DrawerContext.d.ts +1 -1
  34. package/dist/ui/components/Drawer/DrawerFooter.d.ts +1 -1
  35. package/dist/ui/components/Drawer/DrawerHeader.d.ts +1 -1
  36. package/dist/ui/components/Dropdown/Dropdown.d.ts +2 -1
  37. package/dist/ui/components/EmptyState/EmptyState.d.ts +1 -1
  38. package/dist/ui/components/FileUpload/FileUpload.d.ts +1 -1
  39. package/dist/ui/components/Form/Form.d.ts +1 -1
  40. package/dist/ui/components/Form/FormContext.d.ts +15 -4
  41. package/dist/ui/components/Form/FormField.d.ts +3 -3
  42. package/dist/ui/components/Form/FormProvider.d.ts +1 -1
  43. package/dist/ui/components/Form/useFormFieldArray.d.ts +2 -2
  44. package/dist/ui/components/FormWizardPattern/FormWizardPattern.d.ts +1 -1
  45. package/dist/ui/components/Header/Header.d.ts +1 -1
  46. package/dist/ui/components/Header/components/HeaderActions.d.ts +1 -1
  47. package/dist/ui/components/Header/components/HeaderHamburger.d.ts +2 -2
  48. package/dist/ui/components/Header/components/HeaderLogo.d.ts +1 -1
  49. package/dist/ui/components/Header/components/HeaderMobileMenu.d.ts +1 -1
  50. package/dist/ui/components/Header/components/HeaderNavigation.d.ts +1 -1
  51. package/dist/ui/components/Header/contexts/HeaderContext.d.ts +1 -1
  52. package/dist/ui/components/LoginBox/LoginBox.d.ts +1 -1
  53. package/dist/ui/components/Menu/Menu.d.ts +1 -1
  54. package/dist/ui/components/Menu/MenuContext.d.ts +1 -1
  55. package/dist/ui/components/Menu/MenuSeparator.d.ts +1 -1
  56. package/dist/ui/components/Modal/Modal.d.ts +1 -1
  57. package/dist/ui/components/Navigation/Navigation.d.ts +1 -1
  58. package/dist/ui/components/PageHeader/PageHeader.d.ts +1 -1
  59. package/dist/ui/components/Pagination/Pagination.d.ts +1 -1
  60. package/dist/ui/components/Popover/Popover.d.ts +1 -1
  61. package/dist/ui/components/Rating/Rating.d.ts +1 -1
  62. package/dist/ui/components/SearchAndFilterPattern/SearchAndFilterPattern.d.ts +1 -1
  63. package/dist/ui/components/SearchInput/SearchInput.d.ts +1 -1
  64. package/dist/ui/components/SideNavbar/SideNavbar.d.ts +1 -1
  65. package/dist/ui/components/SideNavbar/components/Navbar/Navbar.d.ts +2 -1
  66. package/dist/ui/components/SideNavbar/components/Navbar/NavbarGroup.d.ts +1 -1
  67. package/dist/ui/components/SideNavbar/components/Navbar/NavbarItem.d.ts +2 -1
  68. package/dist/ui/components/SideNavbar/components/Navbar/NavbarSeparator.d.ts +1 -1
  69. package/dist/ui/components/SideNavbar/components/Navbar/NavbarToggle.d.ts +1 -1
  70. package/dist/ui/components/SideNavbar/components/SideNavbarBackdrop.d.ts +1 -1
  71. package/dist/ui/components/SideNavbar/components/SideNavbarGroup.d.ts +1 -1
  72. package/dist/ui/components/SideNavbar/components/SideNavbarResizeHandle.d.ts +1 -1
  73. package/dist/ui/components/SideNavbar/components/SideNavbarRoot.d.ts +2 -1
  74. package/dist/ui/components/SideNavbar/components/SideNavbarToggle.d.ts +1 -1
  75. package/dist/ui/components/SideNavbar/components/Sidebar/Sidebar.d.ts +1 -1
  76. package/dist/ui/components/SideNavbar/components/Sidebar/SidebarContent.d.ts +2 -1
  77. package/dist/ui/components/SideNavbar/components/Sidebar/SidebarFooter.d.ts +1 -1
  78. package/dist/ui/components/SideNavbar/components/Sidebar/SidebarGroup.d.ts +1 -1
  79. package/dist/ui/components/SideNavbar/components/Sidebar/SidebarHeader.d.ts +1 -1
  80. package/dist/ui/components/SideNavbar/components/Sidebar/SidebarSlot.d.ts +1 -1
  81. package/dist/ui/components/SideNavbar/components/Sidebar/SidebarSlotContent.d.ts +1 -1
  82. package/dist/ui/components/SideNavbar/hooks/useSideNavbar.d.ts +3 -3
  83. package/dist/ui/components/SideNavbar/providers/SideNavbarConfigProvider.d.ts +1 -1
  84. package/dist/ui/components/SideNavbar/providers/SideNavbarProvider.d.ts +1 -1
  85. package/dist/ui/components/SideNavbar/providers/SideNavbarStateProvider.d.ts +1 -1
  86. package/dist/ui/components/SideNavbar/providers/SideNavbarThemeProvider.d.ts +1 -1
  87. package/dist/ui/components/SideNavbar/providers/SidebarSlotProvider.d.ts +1 -1
  88. package/dist/ui/components/SideNavbar/types/index.d.ts +31 -3
  89. package/dist/ui/components/Stepper/Stepper.d.ts +1 -1
  90. package/dist/ui/components/Table/Table.d.ts +1 -1
  91. package/dist/ui/components/Table/TableActions/TableActions.d.ts +1 -1
  92. package/dist/ui/components/Table/TableActions.d.ts +1 -1
  93. package/dist/ui/components/Table/TableBody.d.ts +2 -2
  94. package/dist/ui/components/Table/TableCell.d.ts +1 -1
  95. package/dist/ui/components/Table/TableContext.d.ts +20 -2
  96. package/dist/ui/components/Table/TableEmptyState.d.ts +1 -1
  97. package/dist/ui/components/Table/TableFilters/TableFilters.d.ts +1 -1
  98. package/dist/ui/components/Table/TableFilters.d.ts +1 -1
  99. package/dist/ui/components/Table/TableHeader.d.ts +1 -1
  100. package/dist/ui/components/Table/TableHeaderCell.d.ts +1 -1
  101. package/dist/ui/components/Table/TableHeaderRow.d.ts +1 -1
  102. package/dist/ui/components/Table/TablePagination/TablePagination.d.ts +1 -1
  103. package/dist/ui/components/Table/TablePagination.d.ts +1 -1
  104. package/dist/ui/components/Table/TableProvider.d.ts +1 -1
  105. package/dist/ui/components/Table/TableRow.d.ts +1 -1
  106. package/dist/ui/components/Tabs/TabsContent.d.ts +1 -1
  107. package/dist/ui/components/Tabs/TabsList.d.ts +12 -3
  108. package/dist/ui/components/Tabs/TabsProvider.d.ts +1 -1
  109. package/dist/ui/components/Tabs/TabsTrigger.d.ts +1 -1
  110. package/dist/ui/components/TimePicker/TimePicker.d.ts +1 -1
  111. package/dist/ui/components/Timeline/Timeline.d.ts +1 -1
  112. package/dist/ui/components/Toast/Toast.d.ts +1 -1
  113. package/dist/ui/components/Toast/ToastContainer.d.ts +1 -1
  114. package/dist/ui/components/index.d.ts +1 -1
  115. package/dist/ui/hooks/createGenericContext.d.ts +85 -0
  116. package/dist/ui/hooks/focusable.d.ts +33 -0
  117. package/dist/ui/hooks/useAutoFocus.d.ts +37 -0
  118. package/dist/ui/hooks/useFocusRestore.d.ts +28 -0
  119. package/dist/ui/hooks/useFocusTrap.d.ts +33 -0
  120. package/dist/ui/primitives/Avatar/AvatarGroup.d.ts +1 -1
  121. package/dist/ui/primitives/Checkbox/Checkbox.d.ts +9 -0
  122. package/dist/ui/primitives/Collapsible/Collapsible.d.ts +8 -2
  123. package/dist/ui/primitives/ErrorMessage/ErrorMessage.d.ts +1 -1
  124. package/dist/ui/primitives/Info/Info.d.ts +1 -1
  125. package/dist/ui/primitives/NavLink/NavLink.d.ts +12 -1
  126. package/dist/ui/primitives/Radio/Radio.d.ts +9 -0
  127. package/dist/ui/primitives/Separator/Separator.d.ts +1 -1
  128. package/dist/ui/primitives/Skeleton/Skeleton.d.ts +1 -1
  129. package/dist/ui/primitives/Spinner/Spinner.d.ts +1 -1
  130. package/dist/ui/primitives/Switch/Switch.d.ts +16 -2
  131. package/dist/ui/primitives/Text/Text.d.ts +0 -1
  132. package/dist/ui/primitives/Textarea/Textarea.d.ts +18 -0
  133. package/dist/ui/primitives/Tooltip/Tooltip.d.ts +2 -1
  134. package/dist/ui/providers/AppProvider.d.ts +1 -1
  135. package/dist/ui/providers/ConfigProvider.d.ts +1 -1
  136. package/dist/ui/providers/DialogProvider.d.ts +1 -1
  137. package/dist/ui/providers/ThemeProvider.d.ts +1 -1
  138. package/dist/ui/providers/ToastProvider.d.ts +1 -1
  139. package/dist/ui/tokens/TokenVisualizations.d.ts +8 -8
  140. package/dist/ui/tokens/spacing.d.ts +1 -1
  141. package/dist/ui/utils/index.d.ts +1 -0
  142. package/dist/ui/utils/mergeRefs.d.ts +16 -0
  143. package/package.json +56 -35
  144. package/dist/ui/components/Dialog/DialogContext.d.ts +0 -10
  145. package/dist/ui/components/Dialog/DialogProvider.d.ts +0 -10
  146. package/dist/ui/components/Toast/ToastContext.d.ts +0 -21
  147. package/dist/ui/components/Toast/ToastProvider.d.ts +0 -7
@@ -1,7 +1,12 @@
1
1
  import { type HTMLAttributes, type ReactNode } from "react";
2
2
  export interface CollapsibleProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
3
3
  children: ReactNode;
4
- trigger: ReactNode;
4
+ /**
5
+ * Content for the toggle button. When omitted, Collapsible renders only
6
+ * the animated content panel — the caller is responsible for its own
7
+ * trigger and `open`-state wiring (SidebarGroup/SideNavbarGroup pattern).
8
+ */
9
+ trigger?: ReactNode;
5
10
  defaultOpen?: boolean;
6
11
  open?: boolean;
7
12
  onOpenChange?: (open: boolean) => void;
@@ -26,4 +31,5 @@ export interface CollapsibleProps extends Omit<HTMLAttributes<HTMLDivElement>, "
26
31
  * </Collapsible>
27
32
  * ```
28
33
  */
29
- export default function Collapsible({ children, trigger, defaultOpen, open, onOpenChange, disabled, duration, storageKey, className, ...props }: CollapsibleProps): import("react/jsx-runtime").JSX.Element;
34
+ declare const Collapsible: import("react").ForwardRefExoticComponent<CollapsibleProps & import("react").RefAttributes<HTMLDivElement>>;
35
+ export default Collapsible;
@@ -14,5 +14,5 @@ interface Props extends HTMLAttributes<HTMLDivElement> {
14
14
  * <ErrorMessage message="This field is required" id="email-error" />
15
15
  * ```
16
16
  */
17
- export default function ErrorMessage({ message, id, className, ...props }: Props): import("react/jsx-runtime").JSX.Element;
17
+ export default function ErrorMessage({ message, id, className, ...props }: Props): import("react").JSX.Element;
18
18
  export {};
@@ -2,4 +2,4 @@ import type { HTMLAttributes } from "react";
2
2
  export interface InfoProps extends HTMLAttributes<HTMLDivElement> {
3
3
  variant?: "info" | "warning" | "error";
4
4
  }
5
- export default function Info({ variant, className, ...props }: InfoProps): import("react/jsx-runtime").JSX.Element;
5
+ export default function Info({ variant, className, ...props }: InfoProps): import("react").JSX.Element;
@@ -1,3 +1,14 @@
1
+ /**
2
+ * NavLink Component
3
+ *
4
+ * Navigation link component with active state detection and Next.js integration.
5
+ *
6
+ * @see EPIC-001: NavLink Component (Atom)
7
+ * @see RFC-001: NavLink Hook Strategy (APPROVED)
8
+ * @see RFC-002: Next.js Integration Strategy (APPROVED)
9
+ * @see ADR-001: Active State Detection (ACCEPTED)
10
+ */
11
+ import React from "react";
1
12
  import type { NavLinkProps } from "./types";
2
13
  /**
3
14
  * NavLink Component
@@ -15,5 +26,5 @@ import type { NavLinkProps } from "./types";
15
26
  * to avoid issues with conditional hook calls. For now, use the `active` prop manually
16
27
  * or implement pathname detection in the parent component.
17
28
  */
18
- export declare function NavLink({ href, children, active, disabled, variant, size, as, className, "aria-label": ariaLabel, onClick, onKeyDown, ...props }: NavLinkProps): import("react/jsx-runtime").JSX.Element;
29
+ export declare const NavLink: React.ForwardRefExoticComponent<NavLinkProps & React.RefAttributes<HTMLAnchorElement>>;
19
30
  export default NavLink;
@@ -2,6 +2,15 @@ import type { InputHTMLAttributes, ReactNode } from "react";
2
2
  export interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
3
3
  label?: ReactNode;
4
4
  error?: boolean;
5
+ /**
6
+ * Validation success state — paints the border and (when
7
+ * `helperText` is also set) the helper-text color green. Matches
8
+ * the Input + Select + Checkbox + Switch + Textarea convention;
9
+ * the three feedback flags (`error`, `success`, `helperText`)
10
+ * cover every form primitive in the DS. Error takes precedence
11
+ * when both `error` and `success` are set.
12
+ */
13
+ success?: boolean;
5
14
  helperText?: string;
6
15
  }
7
16
  /**
@@ -19,5 +19,5 @@ export interface SeparatorProps extends HTMLAttributes<HTMLHRElement> {
19
19
  * <Separator orientation="vertical" variant="dashed" />
20
20
  * ```
21
21
  */
22
- declare const Separator: import("react").NamedExoticComponent<SeparatorProps>;
22
+ declare const Separator: import("react").MemoExoticComponent<({ orientation, variant, className, ...props }: SeparatorProps) => import("react").JSX.Element>;
23
23
  export default Separator;
@@ -17,4 +17,4 @@ export interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
17
17
  * <Skeleton variant="text" lines={3} />
18
18
  * ```
19
19
  */
20
- export default function Skeleton({ variant, width, height, lines, className, "aria-label": ariaLabel, ...props }: SkeletonProps): import("react/jsx-runtime").JSX.Element;
20
+ export default function Skeleton({ variant, width, height, lines, className, "aria-label": ariaLabel, ...props }: SkeletonProps): import("react").JSX.Element;
@@ -6,5 +6,5 @@ export interface SpinnerProps extends HTMLAttributes<HTMLDivElement> {
6
6
  variant?: SpinnerVariant;
7
7
  label?: string;
8
8
  }
9
- declare const Spinner: import("react").NamedExoticComponent<SpinnerProps>;
9
+ declare const Spinner: import("react").MemoExoticComponent<({ size, variant, label, className, ...props }: SpinnerProps) => import("react").JSX.Element>;
10
10
  export default Spinner;
@@ -3,8 +3,22 @@ export type SwitchSize = "sm" | "md" | "lg";
3
3
  export interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> {
4
4
  size?: SwitchSize;
5
5
  label?: string;
6
- description?: string;
6
+ /**
7
+ * Secondary text rendered beneath the label, wired through
8
+ * `aria-describedby`. Named `helperText` to match Input, Select,
9
+ * Checkbox, and Radio — every form primitive in the DS uses the
10
+ * same prop name for this role.
11
+ */
12
+ helperText?: string;
7
13
  error?: boolean;
14
+ /**
15
+ * Validation success state — paints the (off-state) track border
16
+ * and (when `helperText` is also set) the helper-text color green.
17
+ * Matches the Input + Select + Checkbox + Radio + Textarea
18
+ * convention. Error takes precedence when both `error` and
19
+ * `success` are set.
20
+ */
21
+ success?: boolean;
8
22
  }
9
23
  /**
10
24
  * Switch Component
@@ -18,7 +32,7 @@ export interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
18
32
  *
19
33
  * <Switch
20
34
  * label="Enable notifications"
21
- * description="Receive email notifications"
35
+ * helperText="Receive email notifications"
22
36
  * checked={notifications}
23
37
  * onChange={(e) => setNotifications(e.target.checked)}
24
38
  * />
@@ -6,7 +6,6 @@ interface Props<T extends ElementType> extends HTMLAttributes<JSX.IntrinsicEleme
6
6
  as?: T;
7
7
  bold?: boolean;
8
8
  italic?: boolean;
9
- color?: string;
10
9
  colorRole?: TextColorRole;
11
10
  colorShade?: TextColorShade;
12
11
  }
@@ -1,8 +1,26 @@
1
1
  import type { TextareaHTMLAttributes } from "react";
2
2
  interface Props extends TextareaHTMLAttributes<HTMLTextAreaElement> {
3
3
  error?: boolean;
4
+ /**
5
+ * Validation success state — paints the border and (when
6
+ * `helperText` is also set) the helper-text color green. Matches
7
+ * the Input + Select + Checkbox + Radio + Switch convention; the
8
+ * three feedback flags (`error`, `success`, `helperText`) cover
9
+ * every form primitive in the DS. Error takes precedence when
10
+ * both `error` and `success` are set.
11
+ */
12
+ success?: boolean;
4
13
  resize?: "none" | "both" | "horizontal" | "vertical";
5
14
  label?: string;
15
+ /**
16
+ * Secondary text rendered beneath the textarea, wired through
17
+ * `aria-describedby`. Named `helperText` to match Input, Select,
18
+ * Checkbox, Radio, and Switch — every form primitive in the DS
19
+ * uses the same prop name for this role. When `error` or
20
+ * `success` is also set, the helper text inherits the matching
21
+ * red / green color.
22
+ */
23
+ helperText?: string;
6
24
  }
7
25
  /**
8
26
  * Textarea Component
@@ -24,4 +24,5 @@ export interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
24
24
  * </Tooltip>
25
25
  * ```
26
26
  */
27
- export default function Tooltip({ content, children, position, delay, className, "aria-label": _ariaLabel, preservePositioning, ...props }: TooltipProps): import("react/jsx-runtime").JSX.Element;
27
+ declare const Tooltip: import("react").ForwardRefExoticComponent<TooltipProps & import("react").RefAttributes<HTMLDivElement>>;
28
+ export default Tooltip;
@@ -71,7 +71,7 @@ export interface AppProviderProps {
71
71
  * </AppProvider>
72
72
  * ```
73
73
  */
74
- export declare function AppProvider({ children, config }: AppProviderProps): import("react/jsx-runtime").JSX.Element;
74
+ export declare function AppProvider({ children, config }: AppProviderProps): import("react").JSX.Element;
75
75
  /**
76
76
  * Hook to access AppProvider context
77
77
  *
@@ -114,7 +114,7 @@ export interface ConfigProviderProps {
114
114
  * </ConfigProvider>
115
115
  * ```
116
116
  */
117
- export declare function ConfigProvider({ children, config: customConfig, strategy: _strategy, }: ConfigProviderProps): import("react/jsx-runtime").JSX.Element;
117
+ export declare function ConfigProvider({ children, config: customConfig, strategy: _strategy, }: ConfigProviderProps): import("react").JSX.Element;
118
118
  /**
119
119
  * Hook to use config context
120
120
  *
@@ -7,4 +7,4 @@ export interface DialogProviderProps {
7
7
  titleId?: string;
8
8
  descriptionId?: string;
9
9
  }
10
- export declare function DialogProvider({ children, open: controlledOpen, defaultOpen, onOpenChange, titleId, descriptionId, }: DialogProviderProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function DialogProvider({ children, open: controlledOpen, defaultOpen, onOpenChange, titleId, descriptionId, }: DialogProviderProps): import("react").JSX.Element;
@@ -27,7 +27,7 @@ export interface ThemeProviderProps {
27
27
  * </ThemeProvider>
28
28
  * ```
29
29
  */
30
- export declare function ThemeProvider({ children, defaultTheme, storageKey, }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
30
+ export declare function ThemeProvider({ children, defaultTheme, storageKey, }: ThemeProviderProps): import("react").JSX.Element;
31
31
  /**
32
32
  * Hook to use theme context
33
33
  */
@@ -4,4 +4,4 @@ export interface ToastProviderProps {
4
4
  defaultDuration?: number;
5
5
  maxToasts?: number;
6
6
  }
7
- export declare function ToastProvider({ children, defaultDuration, maxToasts, }: ToastProviderProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function ToastProvider({ children, defaultDuration, maxToasts, }: ToastProviderProps): import("react").JSX.Element;
@@ -6,32 +6,32 @@
6
6
  /**
7
7
  * Color Palette Visualization
8
8
  */
9
- export declare function ColorPalette(): import("react/jsx-runtime").JSX.Element;
9
+ export declare function ColorPalette(): import("react").JSX.Element;
10
10
  /**
11
11
  * Spacing Reference Visualization
12
12
  */
13
- export declare function SpacingReference(): import("react/jsx-runtime").JSX.Element;
13
+ export declare function SpacingReference(): import("react").JSX.Element;
14
14
  /**
15
15
  * Typography Reference Visualization
16
16
  */
17
- export declare function TypographyReference(): import("react/jsx-runtime").JSX.Element;
17
+ export declare function TypographyReference(): import("react").JSX.Element;
18
18
  /**
19
19
  * Shadow Reference Visualization
20
20
  */
21
- export declare function ShadowReference(): import("react/jsx-runtime").JSX.Element;
21
+ export declare function ShadowReference(): import("react").JSX.Element;
22
22
  /**
23
23
  * Radius Reference Visualization
24
24
  */
25
- export declare function RadiusReference(): import("react/jsx-runtime").JSX.Element;
25
+ export declare function RadiusReference(): import("react").JSX.Element;
26
26
  /**
27
27
  * Animation Reference Visualization
28
28
  */
29
- export declare function AnimationReference(): import("react/jsx-runtime").JSX.Element;
29
+ export declare function AnimationReference(): import("react").JSX.Element;
30
30
  /**
31
31
  * Z-Index Reference Visualization
32
32
  */
33
- export declare function ZIndexReference(): import("react/jsx-runtime").JSX.Element;
33
+ export declare function ZIndexReference(): import("react").JSX.Element;
34
34
  /**
35
35
  * Opacity Reference Visualization
36
36
  */
37
- export declare function OpacityReference(): import("react/jsx-runtime").JSX.Element;
37
+ export declare function OpacityReference(): import("react").JSX.Element;
@@ -54,4 +54,4 @@ export declare function getSpacing(scale: keyof typeof SPACING_TOKENS): SpacingT
54
54
  /**
55
55
  * Helper function to get spacing as Tailwind class
56
56
  */
57
- export declare function getSpacingClass(scale: keyof typeof SPACING_TOKENS, direction?: "p" | "m" | "px" | "mx" | "py" | "my" | "pt" | "mt" | "pr" | "mr" | "pb" | "mb" | "pl" | "ml" | "gap" | "gap-x" | "gap-y" | "space-y"): string;
57
+ export declare function getSpacingClass(scale: keyof typeof SPACING_TOKENS, direction?: "p" | "m" | "px" | "mx" | "py" | "my" | "pt" | "mt" | "pr" | "mr" | "pb" | "mb" | "pl" | "ml" | "gap" | "gap-x" | "gap-y" | "space-x" | "space-y"): string;
@@ -5,3 +5,4 @@
5
5
  */
6
6
  export { cn } from "./cn";
7
7
  export { cva, type VariantProps } from "./cva";
8
+ export { mergeRefs } from "./mergeRefs";
@@ -0,0 +1,16 @@
1
+ import type { Ref, RefCallback } from "react";
2
+ /**
3
+ * Compose multiple refs into a single ref callback.
4
+ *
5
+ * Each input ref receives the node when the returned callback is invoked.
6
+ * Callback refs are called with the node; object refs receive it via
7
+ * `.current`; `null`/`undefined` entries are ignored. Designed for the
8
+ * common cloneElement pattern where a parent owns an internal ref to a
9
+ * trigger AND the consumer may have supplied their own ref on that
10
+ * trigger — both need to land on the same node.
11
+ *
12
+ * Under React 19, a consumer's ref attached to `<Child ref={r}/>` flows
13
+ * through `child.props.ref` after cloneElement; pass that into mergeRefs
14
+ * alongside the parent's internal ref.
15
+ */
16
+ export declare function mergeRefs<T>(...refs: Array<Ref<T> | undefined>): RefCallback<T>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fabio.caffarello/react-design-system",
3
3
  "private": false,
4
- "version": "1.24.0",
4
+ "version": "2.0.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -26,9 +26,10 @@
26
26
  "access": "public"
27
27
  },
28
28
  "scripts": {
29
- "build": "npx tsc --project tsconfig.app.json --declaration --emitDeclarationOnly --outDir dist || true && vite build && npm run build:validate",
29
+ "build": "npx tsc --project tsconfig.app.json --declaration --emitDeclarationOnly --outDir dist && vite build && npm run build:validate",
30
30
  "build:validate": "tsx scripts/validate-build-exports.ts",
31
31
  "lint": "eslint .",
32
+ "typecheck": "tsc --build --force tsconfig.json",
32
33
  "storybook": "storybook dev -p 6006",
33
34
  "build-storybook": "storybook build",
34
35
  "storybook:smoke": "npm run build-storybook && node scripts/storybook-smoke.mjs",
@@ -40,12 +41,34 @@
40
41
  "prepare": "husky"
41
42
  },
42
43
  "peerDependencies": {
43
- "@hookform/resolvers": "^3.0.0",
44
- "lucide-react": "^0.552.0",
44
+ "lucide-react": "^0.552.0 || ^1.0.0",
45
45
  "react": ">=19",
46
46
  "react-dom": ">=19",
47
- "react-hook-form": "^7.71.0",
48
- "zod": "^3.0.0"
47
+ "react-hook-form": "^7.77.0"
48
+ },
49
+ "overrides": {
50
+ "handlebars": "^4.7.9",
51
+ "lodash": "^4.17.24",
52
+ "fast-uri": "^3.1.2",
53
+ "flatted": "^3.4.2",
54
+ "qs": "^6.15.2",
55
+ "js-yaml": "^4.2.0",
56
+ "yaml": "^2.9.0",
57
+ "rollup": "^4.59.0",
58
+ "picomatch": "^4.0.4",
59
+ "@commitlint/config-validator": {
60
+ "ajv": "^8.17.2"
61
+ },
62
+ "@jsdevtools/coverage-istanbul-loader": {
63
+ "ajv": "^8.17.2"
64
+ },
65
+ "micromatch": {
66
+ "picomatch": "^2.3.2"
67
+ },
68
+ "test-exclude": {
69
+ "minimatch": "^3.1.4",
70
+ "brace-expansion": "^1.1.13"
71
+ }
49
72
  },
50
73
  "dependencies": {
51
74
  "@tailwindcss/postcss": "^4.1.16",
@@ -53,62 +76,60 @@
53
76
  "clsx": "^2.1.1",
54
77
  "react": ">=19",
55
78
  "react-dom": ">=19",
56
- "tailwind-merge": "^3.4.0"
79
+ "tailwind-merge": "^3.6.0"
57
80
  },
58
81
  "devDependencies": {
59
82
  "@commitlint/cli": "^20.3.1",
60
83
  "@commitlint/config-conventional": "^20.3.1",
61
- "@eslint/js": "^9.36.0",
62
- "@hookform/resolvers": "^3.0.0",
84
+ "@eslint/js": "^10.0.1",
63
85
  "@playwright/test": "^1.60.0",
64
- "@storybook/addon-a11y": "^10.0.3",
65
- "@storybook/addon-coverage": "^3.0.0",
66
- "@storybook/addon-designs": "^11.1.1",
67
- "@storybook/addon-docs": "^10.0.3",
86
+ "@storybook/addon-a11y": "^10.4.2",
87
+ "@storybook/addon-coverage": "^3.0.1",
88
+ "@storybook/addon-designs": "^11.1.3",
89
+ "@storybook/addon-docs": "^10.4.2",
68
90
  "@storybook/addon-measure": "^9.0.8",
69
91
  "@storybook/addon-outline": "^9.0.8",
70
- "@storybook/addon-vitest": "^10.0.3",
71
- "@storybook/react-vite": "^10.0.3",
92
+ "@storybook/addon-vitest": "^10.4.2",
93
+ "@storybook/react-vite": "^10.4.2",
72
94
  "@storybook/test": "^8.6.15",
73
95
  "@tailwindcss/vite": "^4.1.16",
74
96
  "@testing-library/dom": "^10.4.1",
75
97
  "@testing-library/jest-dom": "^6.9.1",
76
- "@testing-library/react": "^16.3.0",
98
+ "@testing-library/react": "^16.3.2",
77
99
  "@types/bun": "^1.3.7",
78
100
  "@types/node": "^24.6.0",
79
- "@types/react": "^19.1.16",
80
- "@types/react-dom": "^19.1.9",
101
+ "@types/react": "^19.2.16",
102
+ "@types/react-dom": "^19.2.3",
81
103
  "@vitejs/plugin-react": "^5.0.4",
82
- "@vitest/browser-playwright": "^4.0.6",
83
- "@vitest/coverage-v8": "^4.0.6",
104
+ "@vitest/browser-playwright": "^4.1.8",
105
+ "@vitest/coverage-v8": "^4.1.8",
84
106
  "autoprefixer": "^10.4.21",
85
- "baseline-browser-mapping": "^2.9.14",
107
+ "baseline-browser-mapping": "^2.10.32",
86
108
  "dependency-cruiser": "^17.3.6",
87
- "eslint": "^9.36.0",
109
+ "eslint": "^10.4.1",
88
110
  "eslint-plugin-react-hooks": "^5.2.0",
89
111
  "eslint-plugin-react-refresh": "^0.4.22",
90
- "eslint-plugin-storybook": "^10.0.3",
112
+ "eslint-plugin-storybook": "^10.4.2",
91
113
  "globals": "^16.4.0",
92
114
  "husky": "^9.1.7",
93
- "jsdom": "^27.0.1",
115
+ "jsdom": "^29.1.1",
94
116
  "lint-staged": "^16.2.7",
95
- "lucide-react": "^0.552.0",
117
+ "lucide-react": "^1.17.0",
96
118
  "madge": "^8.0.0",
97
119
  "plop": "^4.0.4",
98
120
  "postcss": "^8.5.6",
99
- "prettier": "^3.6.2",
100
- "react-hook-form": "^7.71.0",
121
+ "prettier": "^3.8.3",
122
+ "react-hook-form": "^7.77.0",
101
123
  "remark-gfm": "^4.0.1",
102
- "storybook": "^10.0.3",
124
+ "storybook": "^10.4.2",
103
125
  "storybook-addon-performance": "^0.17.3",
104
- "tailwindcss": "^4.1.16",
105
- "tsx": "^4.19.2",
106
- "typescript": "~5.9.3",
107
- "typescript-eslint": "^8.45.0",
126
+ "tailwindcss": "^4.3.0",
127
+ "tsx": "^4.22.4",
128
+ "typescript": "~6.0.3",
129
+ "typescript-eslint": "^8.60.1",
108
130
  "vite": "^7.1.7",
109
- "vite-tsconfig-paths": "^5.1.4",
110
- "vitest": "^4.0.6",
111
- "zod": "^3.0.0"
131
+ "vite-tsconfig-paths": "^6.1.1",
132
+ "vitest": "^4.1.8"
112
133
  },
113
134
  "eslintConfig": {
114
135
  "extends": [
@@ -1,10 +0,0 @@
1
- export interface DialogContextValue {
2
- isOpen: boolean;
3
- onOpenChange: (open: boolean) => void;
4
- onClose: () => void;
5
- titleId?: string;
6
- descriptionId?: string;
7
- }
8
- export declare const DialogContext: import("react").Context<DialogContextValue | undefined>;
9
- export declare function useDialogContext(): DialogContextValue;
10
- export declare function useDialogContextOptional(): DialogContextValue | undefined;
@@ -1,10 +0,0 @@
1
- import { type ReactNode } from "react";
2
- export interface DialogProviderProps {
3
- children: ReactNode;
4
- open?: boolean;
5
- defaultOpen?: boolean;
6
- onOpenChange?: (open: boolean) => void;
7
- titleId?: string;
8
- descriptionId?: string;
9
- }
10
- export declare function DialogProvider({ children, open: controlledOpen, defaultOpen, onOpenChange, titleId, descriptionId, }: DialogProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,21 +0,0 @@
1
- export type ToastVariant = "success" | "error" | "warning" | "info";
2
- export interface Toast {
3
- id: string;
4
- title: string;
5
- description?: string;
6
- variant: ToastVariant;
7
- duration?: number;
8
- action?: {
9
- label: string;
10
- onClick: () => void;
11
- };
12
- }
13
- export interface ToastContextValue {
14
- toasts: Toast[];
15
- addToast: (toast: Omit<Toast, "id">) => string;
16
- removeToast: (id: string) => void;
17
- clearAll: () => void;
18
- }
19
- export declare const ToastContext: import("react").Context<ToastContextValue | undefined>;
20
- export declare function useToastContext(): ToastContextValue;
21
- export declare function useToastContextOptional(): ToastContextValue | undefined;
@@ -1,7 +0,0 @@
1
- import { type ReactNode } from "react";
2
- export interface ToastProviderProps {
3
- children: ReactNode;
4
- defaultDuration?: number;
5
- maxToasts?: number;
6
- }
7
- export declare function ToastProvider({ children, defaultDuration, maxToasts, }: ToastProviderProps): import("react/jsx-runtime").JSX.Element;