@fabio.caffarello/react-design-system 1.24.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -12
- package/dist/index.cjs +204 -375
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7400 -6914
- package/dist/index.js.map +1 -1
- package/dist/react-design-system.css +1 -1
- package/dist/styles/index.cjs +1 -1
- package/dist/styles/index.js +1 -1
- package/dist/ui/components/Accordion/Accordion.d.ts +1 -1
- package/dist/ui/components/Autocomplete/Autocomplete.d.ts +0 -1
- package/dist/ui/components/Autocomplete/AutocompleteList.d.ts +1 -1
- package/dist/ui/components/Autocomplete/index.d.ts +1 -1
- package/dist/ui/components/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/ui/components/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/dist/ui/components/Card/Card.d.ts +1 -1
- package/dist/ui/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/dist/ui/components/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/ui/components/DashboardLayout/DashboardLayout.d.ts +1 -1
- package/dist/ui/components/DataGrid/DataGrid.d.ts +27 -4
- package/dist/ui/components/DataTablePattern/DataTablePattern.d.ts +1 -1
- package/dist/ui/components/DatePicker/DatePicker.d.ts +4 -4
- package/dist/ui/components/DatePicker/DatePickerCalendar.d.ts +1 -1
- package/dist/ui/components/DatePicker/DatePickerInput.d.ts +1 -1
- package/dist/ui/components/DatePicker/DatePickerProvider.d.ts +1 -1
- package/dist/ui/components/Dialog/AlertDialog.d.ts +1 -1
- package/dist/ui/components/Dialog/Dialog.d.ts +1 -1
- package/dist/ui/components/Dialog/DialogClose.d.ts +6 -2
- package/dist/ui/components/Dialog/DialogContent.d.ts +1 -1
- package/dist/ui/components/Dialog/DialogDescription.d.ts +1 -1
- package/dist/ui/components/Dialog/DialogFooter.d.ts +1 -1
- package/dist/ui/components/Dialog/DialogHeader.d.ts +1 -1
- package/dist/ui/components/Dialog/DialogTitle.d.ts +1 -1
- package/dist/ui/components/Dialog/DialogTrigger.d.ts +6 -2
- package/dist/ui/components/Drawer/Drawer.d.ts +1 -1
- package/dist/ui/components/Drawer/DrawerContext.d.ts +1 -1
- package/dist/ui/components/Drawer/DrawerFooter.d.ts +1 -1
- package/dist/ui/components/Drawer/DrawerHeader.d.ts +1 -1
- package/dist/ui/components/Dropdown/Dropdown.d.ts +2 -1
- package/dist/ui/components/EmptyState/EmptyState.d.ts +1 -1
- package/dist/ui/components/FileUpload/FileUpload.d.ts +1 -1
- package/dist/ui/components/Form/Form.d.ts +1 -1
- package/dist/ui/components/Form/FormContext.d.ts +15 -4
- package/dist/ui/components/Form/FormField.d.ts +3 -3
- package/dist/ui/components/Form/FormProvider.d.ts +1 -1
- package/dist/ui/components/Form/useFormFieldArray.d.ts +2 -2
- package/dist/ui/components/FormWizardPattern/FormWizardPattern.d.ts +1 -1
- package/dist/ui/components/Header/Header.d.ts +1 -1
- package/dist/ui/components/Header/components/HeaderActions.d.ts +1 -1
- package/dist/ui/components/Header/components/HeaderHamburger.d.ts +2 -2
- package/dist/ui/components/Header/components/HeaderLogo.d.ts +1 -1
- package/dist/ui/components/Header/components/HeaderMobileMenu.d.ts +1 -1
- package/dist/ui/components/Header/components/HeaderNavigation.d.ts +1 -1
- package/dist/ui/components/Header/contexts/HeaderContext.d.ts +1 -1
- package/dist/ui/components/LoginBox/LoginBox.d.ts +1 -1
- package/dist/ui/components/Menu/Menu.d.ts +1 -1
- package/dist/ui/components/Menu/MenuContext.d.ts +1 -1
- package/dist/ui/components/Menu/MenuSeparator.d.ts +1 -1
- package/dist/ui/components/Modal/Modal.d.ts +1 -1
- package/dist/ui/components/Navigation/Navigation.d.ts +1 -1
- package/dist/ui/components/PageHeader/PageHeader.d.ts +1 -1
- package/dist/ui/components/Pagination/Pagination.d.ts +1 -1
- package/dist/ui/components/Popover/Popover.d.ts +1 -1
- package/dist/ui/components/Rating/Rating.d.ts +1 -1
- package/dist/ui/components/SearchAndFilterPattern/SearchAndFilterPattern.d.ts +1 -1
- package/dist/ui/components/SearchInput/SearchInput.d.ts +1 -1
- package/dist/ui/components/SideNavbar/SideNavbar.d.ts +1 -1
- package/dist/ui/components/SideNavbar/components/Navbar/Navbar.d.ts +2 -1
- package/dist/ui/components/SideNavbar/components/Navbar/NavbarGroup.d.ts +1 -1
- package/dist/ui/components/SideNavbar/components/Navbar/NavbarItem.d.ts +2 -1
- package/dist/ui/components/SideNavbar/components/Navbar/NavbarSeparator.d.ts +1 -1
- package/dist/ui/components/SideNavbar/components/Navbar/NavbarToggle.d.ts +1 -1
- package/dist/ui/components/SideNavbar/components/SideNavbarBackdrop.d.ts +1 -1
- package/dist/ui/components/SideNavbar/components/SideNavbarGroup.d.ts +1 -1
- package/dist/ui/components/SideNavbar/components/SideNavbarResizeHandle.d.ts +1 -1
- package/dist/ui/components/SideNavbar/components/SideNavbarRoot.d.ts +2 -1
- package/dist/ui/components/SideNavbar/components/SideNavbarToggle.d.ts +1 -1
- package/dist/ui/components/SideNavbar/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/ui/components/SideNavbar/components/Sidebar/SidebarContent.d.ts +2 -1
- package/dist/ui/components/SideNavbar/components/Sidebar/SidebarFooter.d.ts +1 -1
- package/dist/ui/components/SideNavbar/components/Sidebar/SidebarGroup.d.ts +1 -1
- package/dist/ui/components/SideNavbar/components/Sidebar/SidebarHeader.d.ts +1 -1
- package/dist/ui/components/SideNavbar/components/Sidebar/SidebarSlot.d.ts +1 -1
- package/dist/ui/components/SideNavbar/components/Sidebar/SidebarSlotContent.d.ts +1 -1
- package/dist/ui/components/SideNavbar/hooks/useSideNavbar.d.ts +3 -3
- package/dist/ui/components/SideNavbar/providers/SideNavbarConfigProvider.d.ts +1 -1
- package/dist/ui/components/SideNavbar/providers/SideNavbarProvider.d.ts +1 -1
- package/dist/ui/components/SideNavbar/providers/SideNavbarStateProvider.d.ts +1 -1
- package/dist/ui/components/SideNavbar/providers/SideNavbarThemeProvider.d.ts +1 -1
- package/dist/ui/components/SideNavbar/providers/SidebarSlotProvider.d.ts +1 -1
- package/dist/ui/components/SideNavbar/types/index.d.ts +31 -3
- package/dist/ui/components/Stepper/Stepper.d.ts +1 -1
- package/dist/ui/components/Table/Table.d.ts +1 -1
- package/dist/ui/components/Table/TableActions/TableActions.d.ts +1 -1
- package/dist/ui/components/Table/TableActions.d.ts +1 -1
- package/dist/ui/components/Table/TableBody.d.ts +2 -2
- package/dist/ui/components/Table/TableCell.d.ts +1 -1
- package/dist/ui/components/Table/TableContext.d.ts +20 -2
- package/dist/ui/components/Table/TableEmptyState.d.ts +1 -1
- package/dist/ui/components/Table/TableFilters/TableFilters.d.ts +1 -1
- package/dist/ui/components/Table/TableFilters.d.ts +1 -1
- package/dist/ui/components/Table/TableHeader.d.ts +1 -1
- package/dist/ui/components/Table/TableHeaderCell.d.ts +1 -1
- package/dist/ui/components/Table/TableHeaderRow.d.ts +1 -1
- package/dist/ui/components/Table/TablePagination/TablePagination.d.ts +1 -1
- package/dist/ui/components/Table/TablePagination.d.ts +1 -1
- package/dist/ui/components/Table/TableProvider.d.ts +1 -1
- package/dist/ui/components/Table/TableRow.d.ts +1 -1
- package/dist/ui/components/Tabs/TabsContent.d.ts +1 -1
- package/dist/ui/components/Tabs/TabsList.d.ts +12 -3
- package/dist/ui/components/Tabs/TabsProvider.d.ts +1 -1
- package/dist/ui/components/Tabs/TabsTrigger.d.ts +1 -1
- package/dist/ui/components/TimePicker/TimePicker.d.ts +1 -1
- package/dist/ui/components/Timeline/Timeline.d.ts +1 -1
- package/dist/ui/components/Toast/Toast.d.ts +1 -1
- package/dist/ui/components/Toast/ToastContainer.d.ts +1 -1
- package/dist/ui/components/index.d.ts +1 -1
- package/dist/ui/hooks/createGenericContext.d.ts +85 -0
- package/dist/ui/hooks/focusable.d.ts +33 -0
- package/dist/ui/hooks/useAutoFocus.d.ts +37 -0
- package/dist/ui/hooks/useFocusRestore.d.ts +28 -0
- package/dist/ui/hooks/useFocusTrap.d.ts +33 -0
- package/dist/ui/primitives/Avatar/AvatarGroup.d.ts +1 -1
- package/dist/ui/primitives/Checkbox/Checkbox.d.ts +9 -0
- package/dist/ui/primitives/Collapsible/Collapsible.d.ts +8 -2
- package/dist/ui/primitives/ErrorMessage/ErrorMessage.d.ts +1 -1
- package/dist/ui/primitives/Info/Info.d.ts +1 -1
- package/dist/ui/primitives/NavLink/NavLink.d.ts +12 -1
- package/dist/ui/primitives/Radio/Radio.d.ts +9 -0
- package/dist/ui/primitives/Separator/Separator.d.ts +1 -1
- package/dist/ui/primitives/Skeleton/Skeleton.d.ts +1 -1
- package/dist/ui/primitives/Spinner/Spinner.d.ts +1 -1
- package/dist/ui/primitives/Switch/Switch.d.ts +16 -2
- package/dist/ui/primitives/Text/Text.d.ts +0 -1
- package/dist/ui/primitives/Textarea/Textarea.d.ts +18 -0
- package/dist/ui/primitives/Tooltip/Tooltip.d.ts +2 -1
- package/dist/ui/providers/AppProvider.d.ts +1 -1
- package/dist/ui/providers/ConfigProvider.d.ts +1 -1
- package/dist/ui/providers/DialogProvider.d.ts +1 -1
- package/dist/ui/providers/ThemeProvider.d.ts +1 -1
- package/dist/ui/providers/ToastProvider.d.ts +1 -1
- package/dist/ui/tokens/TokenVisualizations.d.ts +8 -8
- package/dist/ui/tokens/spacing.d.ts +1 -1
- package/dist/ui/utils/index.d.ts +1 -0
- package/dist/ui/utils/mergeRefs.d.ts +16 -0
- package/package.json +58 -36
- package/dist/ui/components/Dialog/DialogContext.d.ts +0 -10
- package/dist/ui/components/Dialog/DialogProvider.d.ts +0 -10
- package/dist/ui/components/Toast/ToastContext.d.ts +0 -21
- 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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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").
|
|
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
|
|
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").
|
|
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
|
-
|
|
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
|
-
*
|
|
35
|
+
* helperText="Receive email notifications"
|
|
22
36
|
* checked={notifications}
|
|
23
37
|
* onChange={(e) => setNotifications(e.target.checked)}
|
|
24
38
|
* />
|
|
@@ -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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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;
|
package/dist/ui/utils/index.d.ts
CHANGED
|
@@ -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": "
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -26,13 +26,15 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
|
-
"build": "npx tsc --project tsconfig.app.json --declaration --emitDeclarationOnly --outDir dist
|
|
30
|
-
"build:validate": "tsx scripts/validate-build-exports.ts",
|
|
29
|
+
"build": "npx tsc --project tsconfig.app.json --declaration --emitDeclarationOnly --outDir dist && vite build && npm run build:validate",
|
|
30
|
+
"build:validate": "tsx scripts/validate-build-exports.ts && node scripts/validate-use-client-in-dist.mjs",
|
|
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",
|
|
35
36
|
"test:a11y:baseline": "npm run build-storybook && node scripts/a11y-serial-baseline.mjs",
|
|
37
|
+
"test:next-smoke": "node scripts/next-smoke.mjs",
|
|
36
38
|
"plop": "plop",
|
|
37
39
|
"postplop": "prettier -w './src/ui/**/*.{ts,tsx}'",
|
|
38
40
|
"test": "node scripts/run-tests.mjs",
|
|
@@ -40,12 +42,34 @@
|
|
|
40
42
|
"prepare": "husky"
|
|
41
43
|
},
|
|
42
44
|
"peerDependencies": {
|
|
43
|
-
"
|
|
44
|
-
"lucide-react": "^0.552.0",
|
|
45
|
+
"lucide-react": "^0.552.0 || ^1.0.0",
|
|
45
46
|
"react": ">=19",
|
|
46
47
|
"react-dom": ">=19",
|
|
47
|
-
"react-hook-form": "^7.
|
|
48
|
-
|
|
48
|
+
"react-hook-form": "^7.77.0"
|
|
49
|
+
},
|
|
50
|
+
"overrides": {
|
|
51
|
+
"handlebars": "^4.7.9",
|
|
52
|
+
"lodash": "^4.17.24",
|
|
53
|
+
"fast-uri": "^3.1.2",
|
|
54
|
+
"flatted": "^3.4.2",
|
|
55
|
+
"qs": "^6.15.2",
|
|
56
|
+
"js-yaml": "^4.2.0",
|
|
57
|
+
"yaml": "^2.9.0",
|
|
58
|
+
"rollup": "^4.59.0",
|
|
59
|
+
"picomatch": "^4.0.4",
|
|
60
|
+
"@commitlint/config-validator": {
|
|
61
|
+
"ajv": "^8.17.2"
|
|
62
|
+
},
|
|
63
|
+
"@jsdevtools/coverage-istanbul-loader": {
|
|
64
|
+
"ajv": "^8.17.2"
|
|
65
|
+
},
|
|
66
|
+
"micromatch": {
|
|
67
|
+
"picomatch": "^2.3.2"
|
|
68
|
+
},
|
|
69
|
+
"test-exclude": {
|
|
70
|
+
"minimatch": "^3.1.4",
|
|
71
|
+
"brace-expansion": "^1.1.13"
|
|
72
|
+
}
|
|
49
73
|
},
|
|
50
74
|
"dependencies": {
|
|
51
75
|
"@tailwindcss/postcss": "^4.1.16",
|
|
@@ -53,62 +77,60 @@
|
|
|
53
77
|
"clsx": "^2.1.1",
|
|
54
78
|
"react": ">=19",
|
|
55
79
|
"react-dom": ">=19",
|
|
56
|
-
"tailwind-merge": "^3.
|
|
80
|
+
"tailwind-merge": "^3.6.0"
|
|
57
81
|
},
|
|
58
82
|
"devDependencies": {
|
|
59
83
|
"@commitlint/cli": "^20.3.1",
|
|
60
84
|
"@commitlint/config-conventional": "^20.3.1",
|
|
61
|
-
"@eslint/js": "^
|
|
62
|
-
"@hookform/resolvers": "^3.0.0",
|
|
85
|
+
"@eslint/js": "^10.0.1",
|
|
63
86
|
"@playwright/test": "^1.60.0",
|
|
64
|
-
"@storybook/addon-a11y": "^10.
|
|
65
|
-
"@storybook/addon-coverage": "^3.0.
|
|
66
|
-
"@storybook/addon-designs": "^11.1.
|
|
67
|
-
"@storybook/addon-docs": "^10.
|
|
87
|
+
"@storybook/addon-a11y": "^10.4.2",
|
|
88
|
+
"@storybook/addon-coverage": "^3.0.1",
|
|
89
|
+
"@storybook/addon-designs": "^11.1.3",
|
|
90
|
+
"@storybook/addon-docs": "^10.4.2",
|
|
68
91
|
"@storybook/addon-measure": "^9.0.8",
|
|
69
92
|
"@storybook/addon-outline": "^9.0.8",
|
|
70
|
-
"@storybook/addon-vitest": "^10.
|
|
71
|
-
"@storybook/react-vite": "^10.
|
|
93
|
+
"@storybook/addon-vitest": "^10.4.2",
|
|
94
|
+
"@storybook/react-vite": "^10.4.2",
|
|
72
95
|
"@storybook/test": "^8.6.15",
|
|
73
96
|
"@tailwindcss/vite": "^4.1.16",
|
|
74
97
|
"@testing-library/dom": "^10.4.1",
|
|
75
98
|
"@testing-library/jest-dom": "^6.9.1",
|
|
76
|
-
"@testing-library/react": "^16.3.
|
|
99
|
+
"@testing-library/react": "^16.3.2",
|
|
77
100
|
"@types/bun": "^1.3.7",
|
|
78
101
|
"@types/node": "^24.6.0",
|
|
79
|
-
"@types/react": "^19.
|
|
80
|
-
"@types/react-dom": "^19.
|
|
102
|
+
"@types/react": "^19.2.16",
|
|
103
|
+
"@types/react-dom": "^19.2.3",
|
|
81
104
|
"@vitejs/plugin-react": "^5.0.4",
|
|
82
|
-
"@vitest/browser-playwright": "^4.
|
|
83
|
-
"@vitest/coverage-v8": "^4.
|
|
105
|
+
"@vitest/browser-playwright": "^4.1.8",
|
|
106
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
84
107
|
"autoprefixer": "^10.4.21",
|
|
85
|
-
"baseline-browser-mapping": "^2.
|
|
108
|
+
"baseline-browser-mapping": "^2.10.32",
|
|
86
109
|
"dependency-cruiser": "^17.3.6",
|
|
87
|
-
"eslint": "^
|
|
110
|
+
"eslint": "^10.4.1",
|
|
88
111
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
89
112
|
"eslint-plugin-react-refresh": "^0.4.22",
|
|
90
|
-
"eslint-plugin-storybook": "^10.
|
|
113
|
+
"eslint-plugin-storybook": "^10.4.2",
|
|
91
114
|
"globals": "^16.4.0",
|
|
92
115
|
"husky": "^9.1.7",
|
|
93
|
-
"jsdom": "^
|
|
116
|
+
"jsdom": "^29.1.1",
|
|
94
117
|
"lint-staged": "^16.2.7",
|
|
95
|
-
"lucide-react": "^
|
|
118
|
+
"lucide-react": "^1.17.0",
|
|
96
119
|
"madge": "^8.0.0",
|
|
97
120
|
"plop": "^4.0.4",
|
|
98
121
|
"postcss": "^8.5.6",
|
|
99
|
-
"prettier": "^3.
|
|
100
|
-
"react-hook-form": "^7.
|
|
122
|
+
"prettier": "^3.8.3",
|
|
123
|
+
"react-hook-form": "^7.77.0",
|
|
101
124
|
"remark-gfm": "^4.0.1",
|
|
102
|
-
"storybook": "^10.
|
|
125
|
+
"storybook": "^10.4.2",
|
|
103
126
|
"storybook-addon-performance": "^0.17.3",
|
|
104
|
-
"tailwindcss": "^4.
|
|
105
|
-
"tsx": "^4.
|
|
106
|
-
"typescript": "~
|
|
107
|
-
"typescript-eslint": "^8.
|
|
127
|
+
"tailwindcss": "^4.3.0",
|
|
128
|
+
"tsx": "^4.22.4",
|
|
129
|
+
"typescript": "~6.0.3",
|
|
130
|
+
"typescript-eslint": "^8.60.1",
|
|
108
131
|
"vite": "^7.1.7",
|
|
109
|
-
"vite-tsconfig-paths": "^
|
|
110
|
-
"vitest": "^4.
|
|
111
|
-
"zod": "^3.0.0"
|
|
132
|
+
"vite-tsconfig-paths": "^6.1.1",
|
|
133
|
+
"vitest": "^4.1.8"
|
|
112
134
|
},
|
|
113
135
|
"eslintConfig": {
|
|
114
136
|
"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;
|