@timmbr/ui 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -10
- package/dist/components/Alert/Alert.styles.d.ts +2 -2
- package/dist/components/AlertDialog/AlertDialog.d.ts +5 -3
- package/dist/components/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/components/AlertDialog/AlertDialog.js +21 -8
- package/dist/components/AlertDialog/AlertDialog.styles.d.ts +7 -1
- package/dist/components/AlertDialog/AlertDialog.styles.d.ts.map +1 -1
- package/dist/components/AlertDialog/AlertDialog.styles.js +26 -3
- package/dist/components/AlertDialog/AlertDialog.types.d.ts +19 -2
- package/dist/components/AlertDialog/AlertDialog.types.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.styles.d.ts +2 -2
- package/dist/components/Badge/Badge.styles.d.ts +2 -2
- package/dist/components/Badge/Badge.styles.d.ts.map +1 -1
- package/dist/components/Badge/Badge.styles.js +3 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +6 -0
- package/dist/components/Button/Button.styles.d.ts +4 -2
- package/dist/components/Button/Button.styles.d.ts.map +1 -1
- package/dist/components/Button/Button.styles.js +26 -7
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/Card.js +51 -32
- package/dist/components/Card/Card.styles.d.ts +32 -5
- package/dist/components/Card/Card.styles.d.ts.map +1 -1
- package/dist/components/Card/Card.styles.js +69 -10
- package/dist/components/Card/Card.types.d.ts +14 -3
- package/dist/components/Card/Card.types.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.styles.d.ts +2 -2
- package/dist/components/Chip/Chip.styles.d.ts +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +30 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.js +57 -0
- package/dist/components/ConfirmDialog/index.d.ts +2 -0
- package/dist/components/ConfirmDialog/index.d.ts.map +1 -0
- package/dist/components/Container/Container.styles.d.ts +1 -1
- package/dist/components/DataList/DataList.d.ts +3 -1
- package/dist/components/DataList/DataList.d.ts.map +1 -1
- package/dist/components/DataList/DataList.js +53 -15
- package/dist/components/DataList/DataList.styles.d.ts +17 -4
- package/dist/components/DataList/DataList.styles.d.ts.map +1 -1
- package/dist/components/DataList/DataList.styles.js +53 -10
- package/dist/components/DataList/DataList.types.d.ts +19 -2
- package/dist/components/DataList/DataList.types.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +4 -3
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.js +33 -6
- package/dist/components/Drawer/Drawer.styles.d.ts +4 -0
- package/dist/components/Drawer/Drawer.styles.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.styles.js +8 -5
- package/dist/components/Drawer/Drawer.types.d.ts +1 -0
- package/dist/components/Drawer/Drawer.types.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.js +23 -10
- package/dist/components/Dropdown/Dropdown.styles.d.ts +5 -1
- package/dist/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.styles.js +12 -2
- package/dist/components/Dropdown/Dropdown.types.d.ts +4 -0
- package/dist/components/Dropdown/Dropdown.types.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.js +2 -1
- package/dist/components/EmptyState/EmptyState.styles.d.ts +3 -2
- package/dist/components/EmptyState/EmptyState.styles.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.styles.js +5 -0
- package/dist/components/Fieldset/Fieldset.d.ts +14 -0
- package/dist/components/Fieldset/Fieldset.d.ts.map +1 -0
- package/dist/components/Fieldset/Fieldset.js +24 -0
- package/dist/components/Fieldset/index.d.ts +2 -0
- package/dist/components/Fieldset/index.d.ts.map +1 -0
- package/dist/components/FormActions/FormActions.d.ts +13 -0
- package/dist/components/FormActions/FormActions.d.ts.map +1 -0
- package/dist/components/FormActions/FormActions.js +24 -0
- package/dist/components/FormActions/index.d.ts +2 -0
- package/dist/components/FormActions/index.d.ts.map +1 -0
- package/dist/components/Grid/Grid.d.ts +3 -1
- package/dist/components/Grid/Grid.d.ts.map +1 -1
- package/dist/components/Grid/Grid.js +31 -5
- package/dist/components/Grid/Grid.styles.d.ts +86 -0
- package/dist/components/Grid/Grid.styles.d.ts.map +1 -1
- package/dist/components/Grid/Grid.styles.js +85 -1
- package/dist/components/Grid/Grid.types.d.ts +31 -3
- package/dist/components/Grid/Grid.types.d.ts.map +1 -1
- package/dist/components/Heading/Heading.styles.d.ts +2 -2
- package/dist/components/Heading/Heading.styles.d.ts.map +1 -1
- package/dist/components/Heading/Heading.styles.js +3 -1
- package/dist/components/Heading/Heading.types.d.ts +1 -1
- package/dist/components/Heading/Heading.types.d.ts.map +1 -1
- package/dist/components/Icon/Icon.styles.d.ts +2 -2
- package/dist/components/Icon/Icon.styles.d.ts.map +1 -1
- package/dist/components/Icon/Icon.styles.js +6 -2
- package/dist/components/IconTile/IconTile.d.ts +8 -0
- package/dist/components/IconTile/IconTile.d.ts.map +1 -0
- package/dist/components/IconTile/IconTile.js +23 -0
- package/dist/components/IconTile/IconTile.styles.d.ts +7 -0
- package/dist/components/IconTile/IconTile.styles.d.ts.map +1 -0
- package/dist/components/IconTile/IconTile.styles.js +24 -0
- package/dist/components/IconTile/IconTile.types.d.ts +12 -0
- package/dist/components/IconTile/IconTile.types.d.ts.map +1 -0
- package/dist/components/IconTile/index.d.ts +4 -0
- package/dist/components/IconTile/index.d.ts.map +1 -0
- package/dist/components/Inline/Inline.d.ts.map +1 -1
- package/dist/components/Inline/Inline.js +10 -2
- package/dist/components/Inline/Inline.types.d.ts +6 -1
- package/dist/components/Inline/Inline.types.d.ts.map +1 -1
- package/dist/components/Input/Input.styles.d.ts +1 -1
- package/dist/components/Label/Label.styles.d.ts +1 -1
- package/dist/components/LinkButton/LinkButton.d.ts.map +1 -1
- package/dist/components/LinkButton/LinkButton.js +2 -0
- package/dist/components/LinkButton/LinkButton.styles.d.ts +3 -2
- package/dist/components/LinkButton/LinkButton.styles.d.ts.map +1 -1
- package/dist/components/LinkButton/LinkButton.styles.js +6 -0
- package/dist/components/List/List.d.ts.map +1 -1
- package/dist/components/List/List.js +18 -5
- package/dist/components/List/List.styles.d.ts +3 -1
- package/dist/components/List/List.styles.d.ts.map +1 -1
- package/dist/components/List/List.styles.js +4 -3
- package/dist/components/List/List.types.d.ts +7 -0
- package/dist/components/List/List.types.d.ts.map +1 -1
- package/dist/components/MediaCard/MediaCard.d.ts +13 -0
- package/dist/components/MediaCard/MediaCard.d.ts.map +1 -0
- package/dist/components/MediaCard/MediaCard.js +123 -0
- package/dist/components/MediaCard/MediaCard.styles.d.ts +17 -0
- package/dist/components/MediaCard/MediaCard.styles.d.ts.map +1 -0
- package/dist/components/MediaCard/MediaCard.styles.js +57 -0
- package/dist/components/MediaCard/MediaCard.types.d.ts +73 -0
- package/dist/components/MediaCard/MediaCard.types.d.ts.map +1 -0
- package/dist/components/MediaCard/index.d.ts +4 -0
- package/dist/components/MediaCard/index.d.ts.map +1 -0
- package/dist/components/NavFooter/NavFooter.styles.d.ts +1 -1
- package/dist/components/NavHeader/NavHeader.d.ts.map +1 -1
- package/dist/components/NavHeader/NavHeader.js +2 -1
- package/dist/components/NavHeader/NavHeader.styles.d.ts +1 -1
- package/dist/components/NavHeader/NavHeader.types.d.ts +22 -0
- package/dist/components/NavHeader/NavHeader.types.d.ts.map +1 -1
- package/dist/components/NavHeader/index.d.ts +1 -1
- package/dist/components/NavHeader/index.d.ts.map +1 -1
- package/dist/components/NavHeader/subcomponents/NavActions.d.ts +5 -0
- package/dist/components/NavHeader/subcomponents/NavActions.d.ts.map +1 -1
- package/dist/components/NavHeader/subcomponents/NavActions.js +32 -2
- package/dist/components/OtpInput/OtpInput.styles.d.ts +1 -1
- package/dist/components/PageHeader/PageHeader.d.ts +8 -0
- package/dist/components/PageHeader/PageHeader.d.ts.map +1 -0
- package/dist/components/PageHeader/PageHeader.js +55 -0
- package/dist/components/PageHeader/PageHeader.styles.d.ts +10 -0
- package/dist/components/PageHeader/PageHeader.styles.d.ts.map +1 -0
- package/dist/components/PageHeader/PageHeader.styles.js +23 -0
- package/dist/components/PageHeader/PageHeader.types.d.ts +24 -0
- package/dist/components/PageHeader/PageHeader.types.d.ts.map +1 -0
- package/dist/components/PageHeader/index.d.ts +4 -0
- package/dist/components/PageHeader/index.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.d.ts +9 -3
- package/dist/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.js +60 -39
- package/dist/components/Pagination/Pagination.styles.d.ts +1 -1
- package/dist/components/Pagination/Pagination.types.d.ts +23 -14
- package/dist/components/Pagination/Pagination.types.d.ts.map +1 -1
- package/dist/components/Price/Price.d.ts +10 -0
- package/dist/components/Price/Price.d.ts.map +1 -0
- package/dist/components/Price/Price.js +49 -0
- package/dist/components/Price/Price.styles.d.ts +15 -0
- package/dist/components/Price/Price.styles.d.ts.map +1 -0
- package/dist/components/Price/Price.styles.js +44 -0
- package/dist/components/Price/Price.types.d.ts +22 -0
- package/dist/components/Price/Price.types.d.ts.map +1 -0
- package/dist/components/Price/index.d.ts +4 -0
- package/dist/components/Price/index.d.ts.map +1 -0
- package/dist/components/Progress/Progress.styles.d.ts +1 -1
- package/dist/components/Radio/Radio.styles.d.ts +2 -2
- package/dist/components/Rating/Rating.d.ts +5 -0
- package/dist/components/Rating/Rating.d.ts.map +1 -0
- package/dist/components/Rating/Rating.js +38 -0
- package/dist/components/Rating/Rating.styles.d.ts +6 -0
- package/dist/components/Rating/Rating.styles.d.ts.map +1 -0
- package/dist/components/Rating/Rating.styles.js +13 -0
- package/dist/components/Rating/Rating.types.d.ts +18 -0
- package/dist/components/Rating/Rating.types.d.ts.map +1 -0
- package/dist/components/Rating/index.d.ts +4 -0
- package/dist/components/Rating/index.d.ts.map +1 -0
- package/dist/components/ResponsiveDialog/ResponsiveDialog.d.ts +29 -0
- package/dist/components/ResponsiveDialog/ResponsiveDialog.d.ts.map +1 -0
- package/dist/components/ResponsiveDialog/ResponsiveDialog.js +74 -0
- package/dist/components/ResponsiveDialog/ResponsiveDialog.types.d.ts +27 -0
- package/dist/components/ResponsiveDialog/ResponsiveDialog.types.d.ts.map +1 -0
- package/dist/components/ResponsiveDialog/index.d.ts +3 -0
- package/dist/components/ResponsiveDialog/index.d.ts.map +1 -0
- package/dist/components/SectionNav/SectionNav.d.ts +12 -0
- package/dist/components/SectionNav/SectionNav.d.ts.map +1 -0
- package/dist/components/SectionNav/SectionNav.js +67 -0
- package/dist/components/SectionNav/SectionNav.styles.d.ts +11 -0
- package/dist/components/SectionNav/SectionNav.styles.d.ts.map +1 -0
- package/dist/components/SectionNav/SectionNav.styles.js +28 -0
- package/dist/components/SectionNav/SectionNav.types.d.ts +37 -0
- package/dist/components/SectionNav/SectionNav.types.d.ts.map +1 -0
- package/dist/components/SectionNav/index.d.ts +4 -0
- package/dist/components/SectionNav/index.d.ts.map +1 -0
- package/dist/components/Select/Select.styles.d.ts +1 -1
- package/dist/components/Spinner/Spinner.styles.d.ts +1 -1
- package/dist/components/Stack/Stack.d.ts.map +1 -1
- package/dist/components/Stack/Stack.js +16 -1
- package/dist/components/Stack/Stack.types.d.ts +14 -1
- package/dist/components/Stack/Stack.types.d.ts.map +1 -1
- package/dist/components/Stepper/Stepper.d.ts +9 -0
- package/dist/components/Stepper/Stepper.d.ts.map +1 -0
- package/dist/components/Stepper/Stepper.js +81 -0
- package/dist/components/Stepper/Stepper.styles.d.ts +14 -0
- package/dist/components/Stepper/Stepper.styles.d.ts.map +1 -0
- package/dist/components/Stepper/Stepper.styles.js +40 -0
- package/dist/components/Stepper/Stepper.types.d.ts +17 -0
- package/dist/components/Stepper/Stepper.types.d.ts.map +1 -0
- package/dist/components/Stepper/index.d.ts +4 -0
- package/dist/components/Stepper/index.d.ts.map +1 -0
- package/dist/components/Steps/Steps.d.ts +9 -0
- package/dist/components/Steps/Steps.d.ts.map +1 -0
- package/dist/components/Steps/Steps.js +81 -0
- package/dist/components/Steps/Steps.styles.d.ts +14 -0
- package/dist/components/Steps/Steps.styles.d.ts.map +1 -0
- package/dist/components/Steps/Steps.styles.js +40 -0
- package/dist/components/Steps/Steps.types.d.ts +17 -0
- package/dist/components/Steps/Steps.types.d.ts.map +1 -0
- package/dist/components/Steps/index.d.ts +4 -0
- package/dist/components/Steps/index.d.ts.map +1 -0
- package/dist/components/SubNav/SubNav.d.ts +17 -0
- package/dist/components/SubNav/SubNav.d.ts.map +1 -0
- package/dist/components/SubNav/SubNav.js +87 -0
- package/dist/components/SubNav/SubNav.styles.d.ts +18 -0
- package/dist/components/SubNav/SubNav.styles.d.ts.map +1 -0
- package/dist/components/SubNav/SubNav.styles.js +33 -0
- package/dist/components/SubNav/SubNav.types.d.ts +45 -0
- package/dist/components/SubNav/SubNav.types.d.ts.map +1 -0
- package/dist/components/SubNav/index.d.ts +4 -0
- package/dist/components/SubNav/index.d.ts.map +1 -0
- package/dist/components/Switch/Switch.styles.d.ts +2 -2
- package/dist/components/Table/Table.styles.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +73 -6
- package/dist/components/Tabs/Tabs.styles.d.ts +10 -2
- package/dist/components/Tabs/Tabs.styles.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.styles.js +17 -2
- package/dist/components/Tabs/Tabs.types.d.ts +13 -0
- package/dist/components/Tabs/Tabs.types.d.ts.map +1 -1
- package/dist/components/Text/Text.d.ts.map +1 -1
- package/dist/components/Text/Text.js +4 -0
- package/dist/components/Text/Text.styles.d.ts +4 -2
- package/dist/components/Text/Text.styles.d.ts.map +1 -1
- package/dist/components/Text/Text.styles.js +16 -2
- package/dist/components/Text/Text.types.d.ts +1 -1
- package/dist/components/Text/Text.types.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.styles.d.ts +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +8 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js +14 -0
- package/dist/components/VisuallyHidden/index.d.ts +2 -0
- package/dist/components/VisuallyHidden/index.d.ts.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -13
- package/dist/utils/gap.d.ts +21 -1
- package/dist/utils/gap.d.ts.map +1 -1
- package/dist/utils/gap.js +306 -46
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -67,16 +67,18 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
|
|
67
67
|
|
|
68
68
|
| Category | Components | Description |
|
|
69
69
|
| :--- | :--- | :--- |
|
|
70
|
-
| **
|
|
71
|
-
| **Typography** | `
|
|
72
|
-
| **
|
|
73
|
-
| **
|
|
74
|
-
| **
|
|
75
|
-
| **
|
|
76
|
-
| **
|
|
77
|
-
| **
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
| **Layout** | `Container`, `Stack`, `Inline`, `Grid`, `GridItem`, `Center`, `Divider`, `PageHeader`, `VisuallyHidden` | Responsive containers, flex and grid layout, separators, and page titles with description, actions and a back link. |
|
|
71
|
+
| **Typography** | `Heading`, `Text` | Typography primitives restricted to semantic elements (`<p>`, `<span>`, `<h1>`–`<h6>`) with design token scaling. |
|
|
72
|
+
| **Actions** | `Button`, `LinkButton` | Accessible buttons and anchor links with `next/link` default SPA routing, adornment icons, loading spinners, cross-zone delegation, and destructive variants. |
|
|
73
|
+
| **Forms** | `Input`, `Textarea`, `Select`, `Checkbox`, `Radio`, `Switch`, `RangeSlider`, `OtpInput`, `ImageUpload`, `FormField`, `Label`, `Fieldset`, `FormActions` | Form primitives with labels, helper text, validation error states, one-time codes and uploads. |
|
|
74
|
+
| **Data Display** | `Card`, `MediaCard`, `Badge`, `Chip`, `Avatar`, `IconTile`, `Price`, `Rating`, `DataList`, `List`, `Table`, `Stat`, `Accordion`, `Icon` | Surfaces and cards (`MediaCard` is the media + text template that feature cards build on), status pills, prices with discounts, read-only ratings, key-value lists, tables and KPIs. |
|
|
75
|
+
| **Feedback** | `Alert`, `EmptyState`, `Progress`, `Skeleton`, `Spinner`, `Toast` | Status banners, empty states, progress, shimmer loaders and toasts. |
|
|
76
|
+
| **Overlays** | `Dialog`, `AlertDialog`, `ConfirmDialog`, `Drawer`, `ResponsiveDialog`, `Dropdown`, `Popover`, `Tooltip`, `AuthModal` | Dialogs and confirmations, off-canvas drawers and bottom sheets (`ResponsiveDialog`: dialog on desktop, bottom sheet on phones), menus (with icons and destructive items), popovers, tooltips and the sign-in modal. |
|
|
77
|
+
| **Navigation** | `NavHeader`, `NavFooter`, `SideBarNavigation`, `SubNav`, `Tabs`, `Pagination`, `Stepper` | Site header and footer, app sidebar, in-page section navigation (`SubNav`), tabs, pagination and step progress (`Stepper`). |
|
|
78
|
+
|
|
79
|
+
Use theme tokens (`bg-card`, `border-border`, `text-muted-foreground`, …) and the DS primitives (`Text`, `Stack`, `Card` parts…) inside components rather than palette steps or raw typography, so a theme change lands in one place.
|
|
80
|
+
|
|
81
|
+
Storybook uses the same groups (`Foundations` holds the design tokens).
|
|
80
82
|
|
|
81
83
|
|
|
82
84
|
## Component Usage
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const alertVariants: (props?: ({
|
|
3
3
|
variant?: "default" | "destructive" | "success" | "warning" | "info" | null | undefined;
|
|
4
|
-
size?: "
|
|
4
|
+
size?: "sm" | "lg" | "default" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export declare const alertIconVariants: (props?: ({
|
|
7
7
|
variant?: "default" | "destructive" | "success" | "warning" | "info" | null | undefined;
|
|
8
|
-
size?: "
|
|
8
|
+
size?: "sm" | "lg" | "default" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
export type AlertVariants = VariantProps<typeof alertVariants>;
|
|
11
11
|
//# sourceMappingURL=Alert.styles.d.ts.map
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
3
|
-
import type { AlertDialogProps, AlertDialogContentProps, AlertDialogHeaderProps, AlertDialogBodyProps, AlertDialogFooterProps } from './AlertDialog.types';
|
|
3
|
+
import type { AlertDialogProps, AlertDialogContentProps, AlertDialogHeaderProps, AlertDialogBodyProps, AlertDialogFooterProps, AlertDialogActionProps, AlertDialogCancelProps, AlertDialogMediaProps } from './AlertDialog.types';
|
|
4
4
|
export declare const AlertDialog: React.FC<AlertDialogProps>;
|
|
5
5
|
export declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
export declare const AlertDialogPortal: React.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
|
|
7
7
|
export declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
export declare const AlertDialogContent: React.ForwardRefExoticComponent<AlertDialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export declare const AlertDialogHeader: React.FC<AlertDialogHeaderProps>;
|
|
10
|
+
/** Icon circle above the title, e.g. a warning for a destructive confirmation. */
|
|
11
|
+
export declare const AlertDialogMedia: React.FC<AlertDialogMediaProps>;
|
|
10
12
|
export declare const AlertDialogBody: React.FC<AlertDialogBodyProps>;
|
|
11
13
|
export declare const AlertDialogFooter: React.FC<AlertDialogFooterProps>;
|
|
12
14
|
export declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
13
15
|
export declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
14
|
-
export declare const AlertDialogAction: React.ForwardRefExoticComponent<
|
|
15
|
-
export declare const AlertDialogCancel: React.ForwardRefExoticComponent<
|
|
16
|
+
export declare const AlertDialogAction: React.ForwardRefExoticComponent<AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
export declare const AlertDialogCancel: React.ForwardRefExoticComponent<AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>>;
|
|
16
18
|
//# sourceMappingURL=AlertDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../../src/components/AlertDialog/AlertDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../../src/components/AlertDialog/AlertDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAerE,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAA6B,CAAC;AACjF,eAAO,MAAM,kBAAkB,wHAA+B,CAAC;AAC/D,eAAO,MAAM,iBAAiB,uDAA8B,CAAC;AAE7D,eAAO,MAAM,kBAAkB,wKAU7B,CAAC;AAGH,eAAO,MAAM,kBAAkB,gGA4B7B,CAAC;AAGH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAE9D,CAAC;AAGF,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAO5D,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAE1D,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAE9D,CAAC;AAGF,eAAO,MAAM,gBAAgB,8KAU3B,CAAC;AAGH,eAAO,MAAM,sBAAsB,wLAUjC,CAAC;AAGH,eAAO,MAAM,iBAAiB,kGAW5B,CAAC;AAGH,eAAO,MAAM,iBAAiB,kGAW5B,CAAC"}
|
|
@@ -4,7 +4,8 @@ import * as React from 'react';
|
|
|
4
4
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
5
5
|
import { cn } from '@timmbr/utils';
|
|
6
6
|
import { resolveMotion } from '../../types/motion.js';
|
|
7
|
-
import { alertDialogBodyVariants, alertDialogContentVariants, alertDialogDescriptionVariants, alertDialogFooterVariants, alertDialogHeaderVariants, alertDialogOverlayVariants, alertDialogTitleVariants } from './AlertDialog.styles.js';
|
|
7
|
+
import { alertDialogBodyVariants, alertDialogContentVariants, alertDialogDescriptionVariants, alertDialogFooterVariants, alertDialogHeaderVariants, alertDialogMediaVariants, alertDialogOverlayVariants, alertDialogTitleVariants } from './AlertDialog.styles.js';
|
|
8
|
+
import { buttonVariants } from '../Button/Button.styles.js';
|
|
8
9
|
import { useGlobalAnimation } from '../../providers/AnimationProvider.js';
|
|
9
10
|
|
|
10
11
|
const AlertDialog = AlertDialogPrimitive.Root;
|
|
@@ -20,7 +21,7 @@ const AlertDialogOverlay = React.forwardRef(({ className, ...props }, ref) => /*
|
|
|
20
21
|
}
|
|
21
22
|
));
|
|
22
23
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
23
|
-
const AlertDialogContent = React.forwardRef(({ className, children, motion, ...props }, ref) => {
|
|
24
|
+
const AlertDialogContent = React.forwardRef(({ className, children, motion, size, ...props }, ref) => {
|
|
24
25
|
const globalMotion = useGlobalAnimation();
|
|
25
26
|
const { shouldAnimate, motionClass } = resolveMotion(motion, globalMotion);
|
|
26
27
|
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
@@ -32,7 +33,7 @@ const AlertDialogContent = React.forwardRef(({ className, children, motion, ...p
|
|
|
32
33
|
"data-slot": "alert-dialog-content",
|
|
33
34
|
role: "alertdialog",
|
|
34
35
|
className: cn(
|
|
35
|
-
alertDialogContentVariants(),
|
|
36
|
+
alertDialogContentVariants({ size }),
|
|
36
37
|
!shouldAnimate && "transition-none animate-none",
|
|
37
38
|
motionClass,
|
|
38
39
|
className
|
|
@@ -46,6 +47,16 @@ const AlertDialogContent = React.forwardRef(({ className, children, motion, ...p
|
|
|
46
47
|
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
47
48
|
const AlertDialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { "data-slot": "alert-dialog-header", className: cn(alertDialogHeaderVariants(), className), ...props });
|
|
48
49
|
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
50
|
+
const AlertDialogMedia = ({ className, tone, ...props }) => /* @__PURE__ */ jsx(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
"data-slot": "alert-dialog-media",
|
|
54
|
+
"aria-hidden": "true",
|
|
55
|
+
className: cn(alertDialogMediaVariants({ tone }), className),
|
|
56
|
+
...props
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
AlertDialogMedia.displayName = "AlertDialogMedia";
|
|
49
60
|
const AlertDialogBody = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { "data-slot": "alert-dialog-body", className: cn(alertDialogBodyVariants(), className), ...props });
|
|
50
61
|
AlertDialogBody.displayName = "AlertDialogBody";
|
|
51
62
|
const AlertDialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { "data-slot": "alert-dialog-footer", className: cn(alertDialogFooterVariants(), className), ...props });
|
|
@@ -70,25 +81,27 @@ const AlertDialogDescription = React.forwardRef(({ className, ...props }, ref) =
|
|
|
70
81
|
}
|
|
71
82
|
));
|
|
72
83
|
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
73
|
-
const AlertDialogAction = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
84
|
+
const AlertDialogAction = React.forwardRef(({ className, variant = "primary", size, asChild, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
74
85
|
AlertDialogPrimitive.Action,
|
|
75
86
|
{
|
|
76
87
|
ref,
|
|
88
|
+
asChild,
|
|
77
89
|
"data-slot": "alert-dialog-action",
|
|
78
|
-
className: cn(className),
|
|
90
|
+
className: cn(!asChild && buttonVariants({ variant, size }), className),
|
|
79
91
|
...props
|
|
80
92
|
}
|
|
81
93
|
));
|
|
82
94
|
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
83
|
-
const AlertDialogCancel = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
95
|
+
const AlertDialogCancel = React.forwardRef(({ className, variant = "outline", size, asChild, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
84
96
|
AlertDialogPrimitive.Cancel,
|
|
85
97
|
{
|
|
86
98
|
ref,
|
|
99
|
+
asChild,
|
|
87
100
|
"data-slot": "alert-dialog-cancel",
|
|
88
|
-
className: cn(className),
|
|
101
|
+
className: cn(!asChild && buttonVariants({ variant, size }), className),
|
|
89
102
|
...props
|
|
90
103
|
}
|
|
91
104
|
));
|
|
92
105
|
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
93
106
|
|
|
94
|
-
export { AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
|
|
107
|
+
export { AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
export declare const alertDialogOverlayVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
2
|
-
export declare const alertDialogContentVariants: (props?:
|
|
2
|
+
export declare const alertDialogContentVariants: (props?: ({
|
|
3
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
|
+
/** Title and description; a leading AlertDialogMedia gets more room. */
|
|
3
6
|
export declare const alertDialogHeaderVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
4
7
|
export declare const alertDialogBodyVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
5
8
|
export declare const alertDialogFooterVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
6
9
|
export declare const alertDialogTitleVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
7
10
|
export declare const alertDialogDescriptionVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
11
|
+
export declare const alertDialogMediaVariants: (props?: ({
|
|
12
|
+
tone?: "default" | "destructive" | "warning" | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
14
|
//# sourceMappingURL=AlertDialog.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialog.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AlertDialog/AlertDialog.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B,oFAEtC,CAAC;AAEF,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"AlertDialog.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AlertDialog/AlertDialog.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B,oFAEtC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;8EAYtC,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,yBAAyB,oFAErC,CAAC;AAEF,eAAO,MAAM,uBAAuB,oFAEnC,CAAC;AAEF,eAAO,MAAM,yBAAyB,oFAErC,CAAC;AAEF,eAAO,MAAM,wBAAwB,oFAEpC,CAAC;AAEF,eAAO,MAAM,8BAA8B,oFAE1C,CAAC;AAGF,eAAO,MAAM,wBAAwB;;8EAYpC,CAAC"}
|
|
@@ -4,10 +4,20 @@ const alertDialogOverlayVariants = cva(
|
|
|
4
4
|
"fixed inset-0 z-50 bg-grey-1000/60 backdrop-blur-xs transition-opacity duration-200 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out"
|
|
5
5
|
);
|
|
6
6
|
const alertDialogContentVariants = cva(
|
|
7
|
-
"relative pointer-events-auto flex flex-col w-full
|
|
7
|
+
"relative pointer-events-auto flex flex-col w-full rounded-xl border border-grey-200 dark:border-grey-800 bg-grey-50 dark:bg-grey-900 shadow-xl font-sans text-foreground overflow-hidden p-6 gap-4 data-[state=open]:animate-dialog-scale-in data-[state=closed]:animate-dialog-scale-out",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
size: {
|
|
11
|
+
sm: "max-w-md",
|
|
12
|
+
md: "max-w-lg",
|
|
13
|
+
lg: "max-w-2xl"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: { size: "md" }
|
|
17
|
+
}
|
|
8
18
|
);
|
|
9
19
|
const alertDialogHeaderVariants = cva(
|
|
10
|
-
"flex flex-col
|
|
20
|
+
"flex flex-col gap-1.5 text-left has-[>[data-slot=alert-dialog-media]]:gap-3"
|
|
11
21
|
);
|
|
12
22
|
const alertDialogBodyVariants = cva(
|
|
13
23
|
"flex flex-col space-y-3 min-h-0"
|
|
@@ -21,5 +31,18 @@ const alertDialogTitleVariants = cva(
|
|
|
21
31
|
const alertDialogDescriptionVariants = cva(
|
|
22
32
|
"text-body-2 text-muted-foreground leading-relaxed"
|
|
23
33
|
);
|
|
34
|
+
const alertDialogMediaVariants = cva(
|
|
35
|
+
"flex size-12 shrink-0 items-center justify-center rounded-full [&_svg]:size-6",
|
|
36
|
+
{
|
|
37
|
+
variants: {
|
|
38
|
+
tone: {
|
|
39
|
+
default: "bg-primary/10 text-primary",
|
|
40
|
+
destructive: "bg-destructive/10 text-destructive",
|
|
41
|
+
warning: "bg-warning/15 text-warning-foreground"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
defaultVariants: { tone: "default" }
|
|
45
|
+
}
|
|
46
|
+
);
|
|
24
47
|
|
|
25
|
-
export { alertDialogBodyVariants, alertDialogContentVariants, alertDialogDescriptionVariants, alertDialogFooterVariants, alertDialogHeaderVariants, alertDialogOverlayVariants, alertDialogTitleVariants };
|
|
48
|
+
export { alertDialogBodyVariants, alertDialogContentVariants, alertDialogDescriptionVariants, alertDialogFooterVariants, alertDialogHeaderVariants, alertDialogMediaVariants, alertDialogOverlayVariants, alertDialogTitleVariants };
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
2
|
import type * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
3
3
|
import type { MotionProp } from '../../types/motion';
|
|
4
|
+
import type { ButtonVariants } from '../Button/Button.styles';
|
|
4
5
|
export type AlertDialogProps = AlertDialogPrimitive.AlertDialogProps;
|
|
5
6
|
export interface AlertDialogContentProps extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content> {
|
|
7
|
+
/** Width: sm (28rem), md (32rem, default), lg (42rem). */
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
9
|
/**
|
|
7
10
|
* Motion transition control.
|
|
8
11
|
*/
|
|
@@ -11,6 +14,20 @@ export interface AlertDialogContentProps extends React.ComponentPropsWithoutRef<
|
|
|
11
14
|
export type AlertDialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
12
15
|
export type AlertDialogBodyProps = React.HTMLAttributes<HTMLDivElement>;
|
|
13
16
|
export type AlertDialogFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Button look of the footer actions. Ignored with `asChild` (the child, e.g.
|
|
19
|
+
* a `Button`, brings its own styles).
|
|
20
|
+
*/
|
|
21
|
+
export interface AlertDialogButtonStyleProps {
|
|
22
|
+
variant?: ButtonVariants['variant'];
|
|
23
|
+
size?: ButtonVariants['size'];
|
|
24
|
+
}
|
|
25
|
+
export interface AlertDialogActionProps extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>, AlertDialogButtonStyleProps {
|
|
26
|
+
}
|
|
27
|
+
export interface AlertDialogCancelProps extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>, AlertDialogButtonStyleProps {
|
|
28
|
+
}
|
|
29
|
+
export interface AlertDialogMediaProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
30
|
+
/** Tint of the icon circle. */
|
|
31
|
+
tone?: 'default' | 'destructive' | 'warning';
|
|
32
|
+
}
|
|
16
33
|
//# sourceMappingURL=AlertDialog.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialog.types.d.ts","sourceRoot":"","sources":["../../../src/components/AlertDialog/AlertDialog.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"AlertDialog.types.d.ts","sourceRoot":"","sources":["../../../src/components/AlertDialog/AlertDialog.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,gBAAgB,CAAC;AAErE,MAAM,WAAW,uBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC;IAC3E,0DAA0D;IAC1D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAC1E,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AACxE,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAE1E;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACpC,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,sBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,EACxE,2BAA2B;CAAG;AAElC,MAAM,WAAW,sBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,EACxE,2BAA2B;CAAG;AAElC,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACjF,+BAA+B;IAC/B,IAAI,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,CAAC;CAC9C"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const avatarRootVariants: (props?: ({
|
|
3
|
-
size?: "sm" | "
|
|
3
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | null | undefined;
|
|
4
4
|
variant?: "grey" | "outline" | "subtle" | "primary" | "secondary" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export declare const avatarStatusVariants: (props?: ({
|
|
7
7
|
status?: "offline" | "online" | "busy" | "away" | null | undefined;
|
|
8
|
-
size?: "sm" | "
|
|
8
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
export type AvatarVariants = VariantProps<typeof avatarRootVariants>;
|
|
11
11
|
//# sourceMappingURL=Avatar.styles.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const badgeVariants: (props?: ({
|
|
3
|
-
variant?: "default" | "destructive" | "success" | "outline" | "subtle" | "primary" | "secondary" | "brand" | null | undefined;
|
|
4
|
-
size?: "sm" | "
|
|
3
|
+
variant?: "default" | "destructive" | "success" | "warning" | "info" | "outline" | "subtle" | "primary" | "secondary" | "brand" | null | undefined;
|
|
4
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export type BadgeVariants = VariantProps<typeof badgeVariants>;
|
|
7
7
|
//# sourceMappingURL=Badge.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,aAAa;;;
|
|
1
|
+
{"version":3,"file":"Badge.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,aAAa;;;8EA2BzB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -12,7 +12,9 @@ const badgeVariants = cva(
|
|
|
12
12
|
outline: "border border-grey-300 dark:border-grey-700 bg-transparent text-foreground",
|
|
13
13
|
subtle: "bg-bg-subtle text-foreground",
|
|
14
14
|
success: "bg-success text-grey-50",
|
|
15
|
-
destructive: "bg-destructive text-grey-50"
|
|
15
|
+
destructive: "bg-destructive text-grey-50",
|
|
16
|
+
warning: "bg-warning text-warning-foreground",
|
|
17
|
+
info: "bg-info text-info-foreground"
|
|
16
18
|
},
|
|
17
19
|
size: {
|
|
18
20
|
sm: "px-1.5 py-0.5 text-body-3",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,eAAO,MAAM,MAAM,uFAqGlB,CAAC"}
|
|
@@ -15,6 +15,8 @@ const Button = React.forwardRef(
|
|
|
15
15
|
style,
|
|
16
16
|
variant,
|
|
17
17
|
size,
|
|
18
|
+
shape,
|
|
19
|
+
fullWidth,
|
|
18
20
|
asChild = false,
|
|
19
21
|
motion,
|
|
20
22
|
leftIcon,
|
|
@@ -40,6 +42,8 @@ const Button = React.forwardRef(
|
|
|
40
42
|
buttonVariants({
|
|
41
43
|
variant: resolvedVariant,
|
|
42
44
|
size: resolvedSize,
|
|
45
|
+
shape,
|
|
46
|
+
fullWidth,
|
|
43
47
|
className
|
|
44
48
|
}),
|
|
45
49
|
!shouldAnimate && "transition-none active:scale-100",
|
|
@@ -66,6 +70,8 @@ const Button = React.forwardRef(
|
|
|
66
70
|
buttonVariants({
|
|
67
71
|
variant: resolvedVariant,
|
|
68
72
|
size: resolvedSize,
|
|
73
|
+
shape,
|
|
74
|
+
fullWidth,
|
|
69
75
|
className
|
|
70
76
|
}),
|
|
71
77
|
!shouldAnimate && "transition-none active:scale-100",
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const buttonVariants: (props?: ({
|
|
3
|
-
variant?: "link" | "default" | "destructive" | "outline" | "ghost" | "primary" | "secondary" | null | undefined;
|
|
4
|
-
size?: "
|
|
3
|
+
variant?: "link" | "default" | "destructive" | "overlay" | "outline" | "ghost" | "primary" | "secondary" | "destructive-outline" | "destructive-ghost" | null | undefined;
|
|
4
|
+
size?: "sm" | "md" | "lg" | "default" | "icon" | "icon-sm" | null | undefined;
|
|
5
|
+
shape?: "default" | "circle" | null | undefined;
|
|
6
|
+
fullWidth?: boolean | null | undefined;
|
|
5
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
8
|
export type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
7
9
|
//# sourceMappingURL=Button.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"Button.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,cAAc;;;;;8EAuD1B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cva } from 'class-variance-authority';
|
|
2
2
|
|
|
3
3
|
const buttonVariants = cva(
|
|
4
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap
|
|
4
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap font-sans font-semibold transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-pointer select-none active:scale-[0.98]",
|
|
5
5
|
{
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
@@ -11,19 +11,38 @@ const buttonVariants = cva(
|
|
|
11
11
|
outline: "border border-grey-300 dark:border-grey-700 bg-transparent text-foreground hover:bg-grey-100 dark:hover:bg-grey-900 active:bg-grey-200 dark:active:bg-grey-800 hover:border-grey-400 dark:hover:border-grey-600",
|
|
12
12
|
ghost: "text-foreground hover:bg-grey-100 dark:hover:bg-grey-900 active:bg-grey-200 dark:active:bg-grey-800",
|
|
13
13
|
destructive: "bg-destructive text-grey-50 hover:bg-destructive/90 hover:brightness-105 hover:shadow-md active:brightness-95 shadow-sm",
|
|
14
|
+
"destructive-outline": "border border-destructive/40 bg-transparent text-destructive hover:bg-destructive/10 hover:border-destructive active:bg-destructive/15",
|
|
15
|
+
"destructive-ghost": "text-destructive hover:bg-destructive/10 active:bg-destructive/15",
|
|
16
|
+
/** Floating over imagery (e.g. a wishlist toggle on a product photo). */
|
|
17
|
+
overlay: "bg-card/90 text-foreground shadow-xs backdrop-blur-xs hover:bg-card hover:text-primary aria-pressed:text-primary [&[aria-pressed=true]_svg]:fill-current",
|
|
14
18
|
link: "text-primary underline-offset-4 hover:underline p-0 h-auto active:scale-100 font-normal"
|
|
15
19
|
},
|
|
16
20
|
size: {
|
|
17
|
-
sm: "h-9 px-3 text-body-3",
|
|
18
|
-
default: "h-11 px-5 text-body-2",
|
|
19
|
-
md: "h-11 px-5 text-body-2",
|
|
20
|
-
lg: "h-[52px] px-6 text-body-1",
|
|
21
|
-
icon: "h-10 w-10 p-0 shrink-0"
|
|
21
|
+
sm: "h-9 px-3 text-body-3 [&_svg]:size-3.5",
|
|
22
|
+
default: "h-11 px-5 text-body-2 [&_svg]:size-4",
|
|
23
|
+
md: "h-11 px-5 text-body-2 [&_svg]:size-4",
|
|
24
|
+
lg: "h-[52px] px-6 text-body-1 [&_svg]:size-5",
|
|
25
|
+
icon: "h-10 w-10 p-0 shrink-0 [&_svg]:size-5",
|
|
26
|
+
"icon-sm": "h-8 w-8 p-0 shrink-0 [&_svg]:size-4.5"
|
|
27
|
+
},
|
|
28
|
+
shape: {
|
|
29
|
+
default: "rounded-[2px]",
|
|
30
|
+
circle: "rounded-full"
|
|
31
|
+
},
|
|
32
|
+
fullWidth: {
|
|
33
|
+
true: "w-full",
|
|
34
|
+
false: ""
|
|
22
35
|
}
|
|
23
36
|
},
|
|
37
|
+
compoundVariants: [
|
|
38
|
+
// A text link keeps its inline size: no button height or padding.
|
|
39
|
+
{ variant: "link", className: "h-auto px-0 py-0" }
|
|
40
|
+
],
|
|
24
41
|
defaultVariants: {
|
|
25
42
|
variant: "default",
|
|
26
|
-
size: "default"
|
|
43
|
+
size: "default",
|
|
44
|
+
shape: "default",
|
|
45
|
+
fullWidth: false
|
|
27
46
|
}
|
|
28
47
|
}
|
|
29
48
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EAChB,MAAM,cAAc,CAAC;AAUtB,eAAO,MAAM,IAAI,kFAkBhB,CAAC;AAGF,eAAO,MAAM,UAAU,wFAmCtB,CAAC;AAGF,eAAO,MAAM,SAAS,2FAKrB,CAAC;AAGF,eAAO,MAAM,eAAe,mGAK3B,CAAC;AAGF,eAAO,MAAM,WAAW,yFAYvB,CAAC;AAGF,eAAO,MAAM,UAAU,wFAgBtB,CAAC"}
|
|
@@ -1,32 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import { Slot } from '@radix-ui/react-slot';
|
|
4
5
|
import { cn } from '@timmbr/utils';
|
|
5
|
-
import { cardVariants, cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardTitleVariants } from './Card.styles.js';
|
|
6
|
+
import { cardVariants, cardContentVariants, cardSectionPadding, cardDescriptionVariants, cardFooterVariants, cardSectionFooterPadding, cardHeaderVariants, cardTitleVariants } from './Card.styles.js';
|
|
6
7
|
|
|
8
|
+
const CardContext = React.createContext({
|
|
9
|
+
sectioned: false,
|
|
10
|
+
padding: "default"
|
|
11
|
+
});
|
|
7
12
|
const Card = React.forwardRef(
|
|
8
|
-
({ className, variant, padding, asChild = false, ...props }, ref) => {
|
|
13
|
+
({ className, variant, padding, selected = false, sectioned = false, asChild = false, ...props }, ref) => {
|
|
9
14
|
const Comp = asChild ? Slot : "div";
|
|
10
|
-
|
|
15
|
+
const context = React.useMemo(
|
|
16
|
+
() => ({ sectioned, padding: padding ?? "default" }),
|
|
17
|
+
[sectioned, padding]
|
|
18
|
+
);
|
|
19
|
+
return /* @__PURE__ */ jsx(CardContext.Provider, { value: context, children: /* @__PURE__ */ jsx(
|
|
11
20
|
Comp,
|
|
12
21
|
{
|
|
13
22
|
ref,
|
|
14
|
-
|
|
23
|
+
"data-selected": selected || void 0,
|
|
24
|
+
className: cn(cardVariants({ variant, padding, selected, sectioned }), className),
|
|
15
25
|
...props
|
|
16
26
|
}
|
|
17
|
-
);
|
|
27
|
+
) });
|
|
18
28
|
}
|
|
19
29
|
);
|
|
20
30
|
Card.displayName = "Card";
|
|
21
31
|
const CardHeader = React.forwardRef(
|
|
22
|
-
({ className, asChild = false, ...props }, ref) => {
|
|
32
|
+
({ className, asChild = false, divider = false, actions, children, ...props }, ref) => {
|
|
33
|
+
const { sectioned, padding } = React.useContext(CardContext);
|
|
23
34
|
const Comp = asChild ? Slot : "div";
|
|
24
|
-
|
|
35
|
+
const classes = cn(
|
|
36
|
+
cardHeaderVariants({ sectioned, divider }),
|
|
37
|
+
sectioned && cardSectionPadding[padding],
|
|
38
|
+
// Without a divider the content's own top padding is the gap.
|
|
39
|
+
sectioned && !divider && "pb-0",
|
|
40
|
+
className
|
|
41
|
+
);
|
|
42
|
+
if (actions === void 0 || actions === null || actions === false) {
|
|
43
|
+
return /* @__PURE__ */ jsx(Comp, { ref, className: classes, ...props, children });
|
|
44
|
+
}
|
|
45
|
+
return /* @__PURE__ */ jsxs(
|
|
25
46
|
Comp,
|
|
26
47
|
{
|
|
27
48
|
ref,
|
|
28
|
-
className: cn(
|
|
29
|
-
...props
|
|
49
|
+
className: cn(classes, "flex-row flex-wrap items-start justify-between gap-3"),
|
|
50
|
+
...props,
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-col gap-1.5", "data-slot": "card-header-text", children }),
|
|
53
|
+
/* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", "data-slot": "card-header-actions", children: actions })
|
|
54
|
+
]
|
|
30
55
|
}
|
|
31
56
|
);
|
|
32
57
|
}
|
|
@@ -35,37 +60,26 @@ CardHeader.displayName = "CardHeader";
|
|
|
35
60
|
const CardTitle = React.forwardRef(
|
|
36
61
|
({ className, asChild = false, ...props }, ref) => {
|
|
37
62
|
const Comp = asChild ? Slot : "h3";
|
|
38
|
-
return /* @__PURE__ */ jsx(
|
|
39
|
-
Comp,
|
|
40
|
-
{
|
|
41
|
-
ref,
|
|
42
|
-
className: cn(cardTitleVariants(), className),
|
|
43
|
-
...props
|
|
44
|
-
}
|
|
45
|
-
);
|
|
63
|
+
return /* @__PURE__ */ jsx(Comp, { ref, className: cn(cardTitleVariants(), className), ...props });
|
|
46
64
|
}
|
|
47
65
|
);
|
|
48
66
|
CardTitle.displayName = "CardTitle";
|
|
49
|
-
const CardDescription = React.forwardRef(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
Comp,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
className: cn(cardDescriptionVariants(), className),
|
|
56
|
-
...props
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
});
|
|
67
|
+
const CardDescription = React.forwardRef(
|
|
68
|
+
({ className, asChild = false, ...props }, ref) => {
|
|
69
|
+
const Comp = asChild ? Slot : "p";
|
|
70
|
+
return /* @__PURE__ */ jsx(Comp, { ref, className: cn(cardDescriptionVariants(), className), ...props });
|
|
71
|
+
}
|
|
72
|
+
);
|
|
60
73
|
CardDescription.displayName = "CardDescription";
|
|
61
74
|
const CardContent = React.forwardRef(
|
|
62
75
|
({ className, asChild = false, ...props }, ref) => {
|
|
76
|
+
const { sectioned, padding } = React.useContext(CardContext);
|
|
63
77
|
const Comp = asChild ? Slot : "div";
|
|
64
78
|
return /* @__PURE__ */ jsx(
|
|
65
79
|
Comp,
|
|
66
80
|
{
|
|
67
81
|
ref,
|
|
68
|
-
className: cn(cardContentVariants(), className),
|
|
82
|
+
className: cn(cardContentVariants({ sectioned }), sectioned && cardSectionPadding[padding], className),
|
|
69
83
|
...props
|
|
70
84
|
}
|
|
71
85
|
);
|
|
@@ -73,13 +87,18 @@ const CardContent = React.forwardRef(
|
|
|
73
87
|
);
|
|
74
88
|
CardContent.displayName = "CardContent";
|
|
75
89
|
const CardFooter = React.forwardRef(
|
|
76
|
-
({ className, asChild = false, ...props }, ref) => {
|
|
90
|
+
({ className, asChild = false, justify, ...props }, ref) => {
|
|
91
|
+
const { sectioned, padding } = React.useContext(CardContext);
|
|
77
92
|
const Comp = asChild ? Slot : "div";
|
|
78
93
|
return /* @__PURE__ */ jsx(
|
|
79
94
|
Comp,
|
|
80
95
|
{
|
|
81
96
|
ref,
|
|
82
|
-
className: cn(
|
|
97
|
+
className: cn(
|
|
98
|
+
cardFooterVariants({ sectioned, justify }),
|
|
99
|
+
sectioned && cardSectionFooterPadding[padding],
|
|
100
|
+
className
|
|
101
|
+
),
|
|
83
102
|
...props
|
|
84
103
|
}
|
|
85
104
|
);
|
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const cardVariants: (props?: ({
|
|
3
|
-
variant?: "outline" | "subtle" | "elevated" | "interactive" | null | undefined;
|
|
4
|
-
padding?: "none" | "
|
|
3
|
+
variant?: "inset" | "outline" | "subtle" | "elevated" | "interactive" | null | undefined;
|
|
4
|
+
padding?: "none" | "sm" | "md" | "lg" | "default" | null | undefined;
|
|
5
|
+
selected?: boolean | null | undefined;
|
|
6
|
+
sectioned?: boolean | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
/** Section padding of a `sectioned` card (follows the Card's `padding`). */
|
|
9
|
+
export declare const cardSectionPadding: {
|
|
10
|
+
readonly none: "";
|
|
11
|
+
readonly sm: "p-4";
|
|
12
|
+
readonly default: "p-6";
|
|
13
|
+
readonly md: "p-6";
|
|
14
|
+
readonly lg: "p-8";
|
|
15
|
+
};
|
|
16
|
+
/** Footer of a `sectioned` card: the same side padding, shorter vertically. */
|
|
17
|
+
export declare const cardSectionFooterPadding: {
|
|
18
|
+
readonly none: "";
|
|
19
|
+
readonly sm: "px-4 py-2";
|
|
20
|
+
readonly default: "px-6 py-3";
|
|
21
|
+
readonly md: "px-6 py-3";
|
|
22
|
+
readonly lg: "px-8 py-4";
|
|
23
|
+
};
|
|
24
|
+
export declare const cardHeaderVariants: (props?: ({
|
|
25
|
+
sectioned?: boolean | null | undefined;
|
|
26
|
+
divider?: boolean | null | undefined;
|
|
5
27
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
-
export declare const cardHeaderVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
7
28
|
export declare const cardTitleVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
8
29
|
export declare const cardDescriptionVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
9
|
-
export declare const cardContentVariants: (props?:
|
|
10
|
-
|
|
30
|
+
export declare const cardContentVariants: (props?: ({
|
|
31
|
+
sectioned?: boolean | null | undefined;
|
|
32
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
33
|
+
export declare const cardFooterVariants: (props?: ({
|
|
34
|
+
sectioned?: boolean | null | undefined;
|
|
35
|
+
justify?: "start" | "end" | "between" | null | undefined;
|
|
36
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
37
|
export type CardVariants = VariantProps<typeof cardVariants>;
|
|
38
|
+
export type CardFooterVariants = VariantProps<typeof cardFooterVariants>;
|
|
12
39
|
//# sourceMappingURL=Card.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"Card.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,YAAY;;;;;8EA0CxB,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB;;;;;;CAMrB,CAAC;AAEX,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB;;;;;;CAM3B,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;8EAa7B,CAAC;AACH,eAAO,MAAM,iBAAiB,oFAAwE,CAAC;AACvG,eAAO,MAAM,uBAAuB,oFAA2D,CAAC;AAChG,eAAO,MAAM,mBAAmB;;8EAK9B,CAAC;AACH,eAAO,MAAM,kBAAkB;;;8EAa9B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC;AAC7D,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|