@fpkit/acss 0.5.12 → 0.5.13
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 +89 -0
- package/libs/{chunk-DV56L5YX.cjs → chunk-2LTJ7HHX.cjs} +4 -4
- package/libs/{chunk-EQ67LF46.js → chunk-2Y7W75TT.js} +3 -3
- package/libs/{chunk-KKLTUJFB.cjs → chunk-3MKLDCKQ.cjs} +5 -5
- package/libs/chunk-3MKLDCKQ.cjs.map +1 -0
- package/libs/{chunk-X3EVB7VS.cjs → chunk-5S4ORA4C.cjs} +3 -3
- package/libs/{chunk-O6QZBB6G.js → chunk-772NRB75.js} +5 -5
- package/libs/chunk-772NRB75.js.map +1 -0
- package/libs/{chunk-6BVXFW7U.cjs → chunk-AHDJGCG5.cjs} +3 -3
- package/libs/{chunk-E3XP6BEX.cjs → chunk-B7F5FS6D.cjs} +3 -3
- package/libs/chunk-D4YLRWAO.cjs +18 -0
- package/libs/chunk-D4YLRWAO.cjs.map +1 -0
- package/libs/chunk-ETFLFC2S.js +10 -0
- package/libs/chunk-ETFLFC2S.js.map +1 -0
- package/libs/chunk-GZ4QFPRY.js +9 -0
- package/libs/chunk-GZ4QFPRY.js.map +1 -0
- package/libs/{chunk-LHVJKDMA.cjs → chunk-J32EZPYD.cjs} +3 -3
- package/libs/chunk-JJ43O4Y5.js +8 -0
- package/libs/chunk-JJ43O4Y5.js.map +1 -0
- package/libs/chunk-KUKIVRC2.js +7 -0
- package/libs/chunk-KUKIVRC2.js.map +1 -0
- package/libs/chunk-L75OQKEI.cjs +13 -0
- package/libs/chunk-L75OQKEI.cjs.map +1 -0
- package/libs/{chunk-LL7HTLMS.cjs → chunk-M5RRNTVX.cjs} +3 -3
- package/libs/{chunk-LIQJ7ZZR.js → chunk-NGTJDDFO.js} +2 -2
- package/libs/chunk-OK5QEIMD.cjs +17 -0
- package/libs/chunk-OK5QEIMD.cjs.map +1 -0
- package/libs/chunk-P2DC76ZZ.cjs +18 -0
- package/libs/chunk-P2DC76ZZ.cjs.map +1 -0
- package/libs/chunk-PQ2K3BM6.cjs +17 -0
- package/libs/chunk-PQ2K3BM6.cjs.map +1 -0
- package/libs/{chunk-QCMV4VQZ.js → chunk-QLZWHAMK.js} +2 -2
- package/libs/{chunk-BIP2NY53.js → chunk-RIVUMPOG.js} +2 -2
- package/libs/{chunk-ICCKQ2GC.cjs → chunk-ROZI23GS.cjs} +4 -4
- package/libs/{chunk-NHYXGV3L.js → chunk-SMYRLO3E.js} +2 -2
- package/libs/{chunk-5ZM4XL44.js → chunk-TYRCEX2L.js} +2 -2
- package/libs/chunk-VUH3FXGJ.js +11 -0
- package/libs/chunk-VUH3FXGJ.js.map +1 -0
- package/libs/{chunk-PPOOBUOS.js → chunk-XBA562WW.js} +2 -2
- package/libs/{chunk-QVV34QEH.cjs → chunk-XTQKWY7W.cjs} +3 -3
- package/libs/{chunk-YWOYVRFT.js → chunk-ZANSFMTD.js} +3 -3
- package/libs/components/alert/alert.css +1 -1
- package/libs/components/alert/alert.css.map +1 -1
- package/libs/components/alert/alert.min.css +2 -2
- package/libs/components/badge/badge.css +1 -1
- package/libs/components/badge/badge.css.map +1 -1
- package/libs/components/badge/badge.min.css +2 -2
- package/libs/components/breadcrumbs/breadcrumb.cjs +9 -5
- package/libs/components/breadcrumbs/breadcrumb.d.cts +271 -32
- package/libs/components/breadcrumbs/breadcrumb.d.ts +271 -32
- package/libs/components/breadcrumbs/breadcrumb.js +3 -3
- package/libs/components/button.cjs +4 -4
- package/libs/components/button.d.cts +2 -2
- package/libs/components/button.d.ts +2 -2
- package/libs/components/button.js +2 -2
- package/libs/components/buttons/button.css +1 -1
- package/libs/components/buttons/button.css.map +1 -1
- package/libs/components/buttons/button.min.css +2 -2
- package/libs/components/card.cjs +7 -7
- package/libs/components/card.d.cts +277 -33
- package/libs/components/card.d.ts +277 -33
- package/libs/components/card.js +2 -2
- package/libs/components/cards/card.css +1 -1
- package/libs/components/cards/card.css.map +1 -1
- package/libs/components/cards/card.min.css +2 -2
- package/libs/components/details/details.css +1 -1
- package/libs/components/details/details.css.map +1 -1
- package/libs/components/details/details.min.css +2 -2
- package/libs/components/dialog/dialog.cjs +7 -7
- package/libs/components/dialog/dialog.css +1 -1
- package/libs/components/dialog/dialog.css.map +1 -1
- package/libs/components/dialog/dialog.d.cts +88 -34
- package/libs/components/dialog/dialog.d.ts +88 -34
- package/libs/components/dialog/dialog.js +5 -5
- package/libs/components/dialog/dialog.min.css +2 -2
- package/libs/components/form/fields.cjs +4 -4
- package/libs/components/form/fields.d.cts +2 -2
- package/libs/components/form/fields.d.ts +2 -2
- package/libs/components/form/fields.js +2 -2
- package/libs/components/form/textarea.cjs +4 -4
- package/libs/components/form/textarea.d.cts +2 -2
- package/libs/components/form/textarea.d.ts +2 -2
- package/libs/components/form/textarea.js +2 -2
- package/libs/components/heading/heading.cjs +3 -3
- package/libs/components/heading/heading.d.cts +3 -14
- package/libs/components/heading/heading.d.ts +3 -14
- package/libs/components/heading/heading.js +2 -2
- package/libs/components/icons/icon.cjs +4 -4
- package/libs/components/icons/icon.d.cts +148 -4
- package/libs/components/icons/icon.d.ts +148 -4
- package/libs/components/icons/icon.js +2 -2
- package/libs/components/images/img.css +1 -1
- package/libs/components/images/img.css.map +1 -1
- package/libs/components/images/img.min.css +2 -2
- package/libs/components/link/link.cjs +4 -4
- package/libs/components/link/link.d.cts +2 -2
- package/libs/components/link/link.d.ts +2 -2
- package/libs/components/link/link.js +2 -2
- package/libs/components/list/list.cjs +5 -5
- package/libs/components/list/list.d.cts +3 -3
- package/libs/components/list/list.d.ts +3 -3
- package/libs/components/list/list.js +2 -2
- package/libs/components/modal.cjs +4 -4
- package/libs/components/modal.js +3 -3
- package/libs/components/nav/nav.cjs +7 -7
- package/libs/components/nav/nav.d.cts +2 -2
- package/libs/components/nav/nav.d.ts +2 -2
- package/libs/components/nav/nav.js +3 -3
- package/libs/components/text/text.cjs +5 -5
- package/libs/components/text/text.d.cts +2 -2
- package/libs/components/text/text.d.ts +2 -2
- package/libs/components/text/text.js +2 -2
- package/libs/heading-3648c538.d.ts +250 -0
- package/libs/hooks.cjs +7 -0
- package/libs/hooks.d.cts +5 -0
- package/libs/hooks.d.ts +5 -0
- package/libs/hooks.js +3 -0
- package/libs/icons.cjs +3 -3
- package/libs/icons.d.cts +1 -1
- package/libs/icons.d.ts +1 -1
- package/libs/icons.js +2 -2
- package/libs/index.cjs +112 -91
- package/libs/index.cjs.map +1 -1
- package/libs/index.css +1 -1
- package/libs/index.css.map +1 -1
- package/libs/index.d.cts +515 -31
- package/libs/index.d.ts +515 -31
- package/libs/index.js +31 -19
- package/libs/index.js.map +1 -1
- package/libs/ui-645f95b5.d.ts +285 -0
- package/package.json +2 -83
- package/src/components/README-UI.mdx +416 -0
- package/src/components/alert/ACCESSIBILITY.md +319 -0
- package/src/components/alert/README.mdx +475 -19
- package/src/components/alert/alert.scss +113 -6
- package/src/components/alert/alert.stories.tsx +372 -0
- package/src/components/alert/alert.test.tsx +762 -0
- package/src/components/alert/alert.tsx +331 -66
- package/src/components/alert/views/alert-actions.tsx +13 -0
- package/src/components/alert/views/alert-content.tsx +17 -0
- package/src/components/alert/views/alert-icon.tsx +53 -0
- package/src/components/alert/views/alert-screen-reader-text.tsx +30 -0
- package/src/components/alert/views/alert-title.tsx +23 -0
- package/src/components/alert/views/alert-view.tsx +158 -0
- package/src/components/alert/views/index.ts +12 -0
- package/src/components/badge/badge.mdx +186 -49
- package/src/components/badge/badge.scss +20 -2
- package/src/components/badge/badge.stories.tsx +160 -14
- package/src/components/badge/badge.test.tsx +179 -0
- package/src/components/badge/badge.tsx +97 -4
- package/src/components/breadcrumbs/README.mdx +364 -45
- package/src/components/breadcrumbs/__snapshots__/breadcrumb.test.tsx.snap +152 -0
- package/src/components/breadcrumbs/breadcrumb.stories.tsx +7 -3
- package/src/components/breadcrumbs/breadcrumb.test.tsx +490 -0
- package/src/components/breadcrumbs/breadcrumb.tsx +427 -170
- package/src/components/buttons/button.scss +34 -31
- package/src/components/buttons/button.stories.tsx +35 -0
- package/src/components/cards/README.mdx +657 -0
- package/src/components/cards/card.scss +22 -0
- package/src/components/cards/card.stories.tsx +167 -5
- package/src/components/cards/card.test.tsx +360 -20
- package/src/components/cards/card.tsx +200 -79
- package/src/components/cards/card.types.ts +135 -0
- package/src/components/cards/card.utils.ts +79 -0
- package/src/components/details/ACCESSIBILITY-REVIEW-LIVE.md +1050 -0
- package/src/components/details/ACCESSIBILITY-REVIEW.md +502 -0
- package/src/components/details/README.mdx +437 -69
- package/src/components/details/details.scss +16 -7
- package/src/components/details/details.test.tsx +385 -0
- package/src/components/details/details.tsx +101 -69
- package/src/components/details/details.types.ts +76 -0
- package/src/components/dialog/README.mdx +513 -110
- package/src/components/dialog/dialog-modal.tsx +79 -56
- package/src/components/dialog/dialog.scss +53 -3
- package/src/components/dialog/dialog.stories.tsx +10 -7
- package/src/components/dialog/dialog.test.tsx +450 -0
- package/src/components/dialog/dialog.tsx +69 -59
- package/src/components/dialog/dialog.types.ts +133 -0
- package/src/components/dialog/views/dialog-footer.tsx +54 -11
- package/src/components/dialog/views/dialog-header.tsx +20 -15
- package/src/components/heading/heading.stories.tsx +44 -4
- package/src/components/heading/heading.tsx +89 -23
- package/src/components/icons/README.mdx +332 -0
- package/src/components/icons/icon.stories.tsx +74 -1
- package/src/components/icons/icon.tsx +89 -1
- package/src/components/icons/types.ts +47 -0
- package/src/components/images/README.mdx +340 -24
- package/src/components/images/img.scss +19 -3
- package/src/components/images/img.stories.tsx +424 -15
- package/src/components/images/img.test.tsx +354 -25
- package/src/components/images/img.tsx +186 -63
- package/src/components/images/img.types.ts +211 -0
- package/src/components/title/MIGRATION.md +199 -0
- package/src/components/title/README.md +326 -0
- package/src/components/title/README.mdx +452 -0
- package/src/components/title/title.stories.tsx +393 -0
- package/src/components/title/title.test.tsx +251 -0
- package/src/components/title/title.tsx +219 -0
- package/src/components/ui.stories.tsx +894 -0
- package/src/components/ui.test.tsx +559 -0
- package/src/components/ui.tsx +266 -15
- package/src/components/word-count/README.md +240 -0
- package/src/hooks.ts +1 -0
- package/src/index.ts +10 -2
- package/src/sass/_properties.scss +1 -0
- package/src/styles/alert/alert.css +94 -4
- package/src/styles/alert/alert.css.map +1 -1
- package/src/styles/badge/badge.css +20 -2
- package/src/styles/badge/badge.css.map +1 -1
- package/src/styles/buttons/button.css +31 -31
- package/src/styles/buttons/button.css.map +1 -1
- package/src/styles/cards/card.css +16 -0
- package/src/styles/cards/card.css.map +1 -1
- package/src/styles/details/details.css +19 -8
- package/src/styles/details/details.css.map +1 -1
- package/src/styles/dialog/dialog.css +43 -2
- package/src/styles/dialog/dialog.css.map +1 -1
- package/src/styles/images/img.css +15 -3
- package/src/styles/images/img.css.map +1 -1
- package/src/styles/index.css +240 -51
- package/src/styles/index.css.map +1 -1
- package/src/test/setup.d.ts +9 -0
- package/src/test/setup.ts +53 -1
- package/libs/chunk-6TE5QEVE.cjs +0 -13
- package/libs/chunk-6TE5QEVE.cjs.map +0 -1
- package/libs/chunk-7K76RW2A.cjs +0 -18
- package/libs/chunk-7K76RW2A.cjs.map +0 -1
- package/libs/chunk-BSPKFLO4.js +0 -8
- package/libs/chunk-BSPKFLO4.js.map +0 -1
- package/libs/chunk-BV5CLH44.cjs +0 -18
- package/libs/chunk-BV5CLH44.cjs.map +0 -1
- package/libs/chunk-DKGJHKGW.js +0 -9
- package/libs/chunk-DKGJHKGW.js.map +0 -1
- package/libs/chunk-ECLD37WN.cjs +0 -16
- package/libs/chunk-ECLD37WN.cjs.map +0 -1
- package/libs/chunk-HYBZBN4G.js +0 -8
- package/libs/chunk-HYBZBN4G.js.map +0 -1
- package/libs/chunk-KKLTUJFB.cjs.map +0 -1
- package/libs/chunk-M5QL5TAE.cjs +0 -14
- package/libs/chunk-M5QL5TAE.cjs.map +0 -1
- package/libs/chunk-NE6YXTMC.js +0 -7
- package/libs/chunk-NE6YXTMC.js.map +0 -1
- package/libs/chunk-O6QZBB6G.js.map +0 -1
- package/libs/chunk-SXVZSWX6.js +0 -11
- package/libs/chunk-SXVZSWX6.js.map +0 -1
- package/libs/ui-9a6f9f8d.d.ts +0 -24
- package/src/components/cards/README.md +0 -80
- package/src/components/dialog/hooks/useClickOutside.ts +0 -33
- /package/libs/{chunk-DV56L5YX.cjs.map → chunk-2LTJ7HHX.cjs.map} +0 -0
- /package/libs/{chunk-EQ67LF46.js.map → chunk-2Y7W75TT.js.map} +0 -0
- /package/libs/{chunk-X3EVB7VS.cjs.map → chunk-5S4ORA4C.cjs.map} +0 -0
- /package/libs/{chunk-6BVXFW7U.cjs.map → chunk-AHDJGCG5.cjs.map} +0 -0
- /package/libs/{chunk-E3XP6BEX.cjs.map → chunk-B7F5FS6D.cjs.map} +0 -0
- /package/libs/{chunk-LHVJKDMA.cjs.map → chunk-J32EZPYD.cjs.map} +0 -0
- /package/libs/{chunk-LL7HTLMS.cjs.map → chunk-M5RRNTVX.cjs.map} +0 -0
- /package/libs/{chunk-LIQJ7ZZR.js.map → chunk-NGTJDDFO.js.map} +0 -0
- /package/libs/{chunk-QCMV4VQZ.js.map → chunk-QLZWHAMK.js.map} +0 -0
- /package/libs/{chunk-BIP2NY53.js.map → chunk-RIVUMPOG.js.map} +0 -0
- /package/libs/{chunk-ICCKQ2GC.cjs.map → chunk-ROZI23GS.cjs.map} +0 -0
- /package/libs/{chunk-NHYXGV3L.js.map → chunk-SMYRLO3E.js.map} +0 -0
- /package/libs/{chunk-5ZM4XL44.js.map → chunk-TYRCEX2L.js.map} +0 -0
- /package/libs/{chunk-PPOOBUOS.js.map → chunk-XBA562WW.js.map} +0 -0
- /package/libs/{chunk-QVV34QEH.cjs.map → chunk-XTQKWY7W.cjs.map} +0 -0
- /package/libs/{chunk-YWOYVRFT.js.map → chunk-ZANSFMTD.js.map} +0 -0
|
@@ -1,56 +1,300 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { U as UI } from '../ui-645f95b5.js';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Base props shared across all Card sub-components.
|
|
6
|
+
*
|
|
7
|
+
* This interface provides common styling and structural props
|
|
8
|
+
* that all Card sub-components support.
|
|
9
|
+
*/
|
|
10
|
+
interface CardSubComponentProps {
|
|
11
|
+
/** CSS class names to apply */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Inline styles to apply */
|
|
14
|
+
style?: React__default.CSSProperties;
|
|
15
|
+
/** Child elements to render */
|
|
16
|
+
children?: React__default.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Props for the Card.Title sub-component.
|
|
20
|
+
*
|
|
21
|
+
* @extends CardSubComponentProps
|
|
22
|
+
*/
|
|
23
|
+
interface CardTitleProps extends CardSubComponentProps {
|
|
24
|
+
/**
|
|
25
|
+
* HTML element to render as.
|
|
26
|
+
* @default 'h3'
|
|
27
|
+
*/
|
|
28
|
+
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
29
|
+
/**
|
|
30
|
+
* HTML id attribute for the title.
|
|
31
|
+
* Useful for aria-labelledby references.
|
|
32
|
+
*/
|
|
33
|
+
id?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Props for the Card.Content sub-component.
|
|
37
|
+
*
|
|
38
|
+
* @extends CardSubComponentProps
|
|
39
|
+
*/
|
|
40
|
+
interface CardContentProps extends CardSubComponentProps {
|
|
41
|
+
/**
|
|
42
|
+
* HTML element to render as.
|
|
43
|
+
* Use 'article' for standalone content, 'div' for generic containers.
|
|
44
|
+
* @default 'article'
|
|
45
|
+
*/
|
|
46
|
+
as?: 'article' | 'div' | 'section';
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Props for the Card.Footer sub-component.
|
|
50
|
+
*
|
|
51
|
+
* @extends CardSubComponentProps
|
|
52
|
+
*/
|
|
53
|
+
interface CardFooterProps extends CardSubComponentProps {
|
|
54
|
+
/**
|
|
55
|
+
* HTML element to render as.
|
|
56
|
+
* @default 'div'
|
|
57
|
+
*/
|
|
58
|
+
as?: 'div' | 'footer';
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Props for the main Card component.
|
|
62
|
+
*
|
|
63
|
+
* Extends all props from the UI component while adding Card-specific functionality.
|
|
64
|
+
* Supports polymorphic rendering via the `as` prop.
|
|
65
|
+
*
|
|
66
|
+
* @extends React.ComponentProps<typeof UI>
|
|
67
|
+
*/
|
|
68
|
+
interface CardProps extends React__default.ComponentProps<typeof UI> {
|
|
69
|
+
/**
|
|
70
|
+
* HTML element to render the Card as.
|
|
71
|
+
* Inherits from UI component's polymorphic `as` prop.
|
|
72
|
+
* @default 'div'
|
|
73
|
+
*/
|
|
74
|
+
as?: React__default.ElementType;
|
|
75
|
+
/**
|
|
76
|
+
* ARIA role for the card.
|
|
77
|
+
* Use 'article' for standalone content, 'region' with aria-label for landmarks.
|
|
78
|
+
* @example
|
|
79
|
+
* ```tsx
|
|
80
|
+
* <Card role="article">...</Card>
|
|
81
|
+
* <Card role="region" aria-label="User profile">...</Card>
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
role?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Accessible label for the card.
|
|
87
|
+
* Required when using interactive cards or role="region".
|
|
88
|
+
* @example
|
|
89
|
+
* ```tsx
|
|
90
|
+
* <Card role="region" aria-label="Featured products">...</Card>
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
'aria-label'?: string;
|
|
94
|
+
/**
|
|
95
|
+
* ID of element that labels this card.
|
|
96
|
+
* @example
|
|
97
|
+
* ```tsx
|
|
98
|
+
* <Card aria-labelledby="card-title-1">
|
|
99
|
+
* <Card.Title id="card-title-1">Title</Card.Title>
|
|
100
|
+
* </Card>
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
'aria-labelledby'?: string;
|
|
104
|
+
/**
|
|
105
|
+
* ID of element that describes this card.
|
|
106
|
+
*/
|
|
107
|
+
'aria-describedby'?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Makes the card interactive with keyboard support.
|
|
110
|
+
* Adds tabIndex, role="button", and keyboard event handlers.
|
|
111
|
+
* @default false
|
|
112
|
+
*/
|
|
113
|
+
interactive?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Click handler for interactive cards.
|
|
116
|
+
* When provided without `interactive`, a warning will be logged in development.
|
|
117
|
+
*/
|
|
118
|
+
onClick?: (event: React__default.MouseEvent | React__default.KeyboardEvent) => void;
|
|
119
|
+
/**
|
|
120
|
+
* Tab index for keyboard navigation.
|
|
121
|
+
* Automatically set to 0 when `interactive` is true.
|
|
122
|
+
*/
|
|
123
|
+
tabIndex?: number;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Card.Title - Title sub-component for Card
|
|
128
|
+
*
|
|
129
|
+
* Renders a heading element for the card title. Defaults to h3 for proper
|
|
130
|
+
* document outline, but can be customized via the `as` prop.
|
|
131
|
+
*
|
|
132
|
+
* ## Accessibility
|
|
133
|
+
* - Use appropriate heading level based on document structure
|
|
134
|
+
* - Combine with `aria-labelledby` on parent Card for accessible names
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```tsx
|
|
138
|
+
* <Card aria-labelledby="card-title-1">
|
|
139
|
+
* <Card.Title id="card-title-1">Featured Product</Card.Title>
|
|
140
|
+
* </Card>
|
|
141
|
+
* ```
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```tsx
|
|
145
|
+
* // Custom heading level
|
|
146
|
+
* <Card.Title as="h2">Section Title</Card.Title>
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
9
149
|
declare const Title: {
|
|
10
|
-
({ children, className,
|
|
11
|
-
className?: string | undefined;
|
|
12
|
-
styles?: React__default.CSSProperties | undefined;
|
|
13
|
-
as?: React__default.ElementType<any> | undefined;
|
|
14
|
-
}>): React__default.JSX.Element;
|
|
150
|
+
({ children, className, style, as, ...props }: CardTitleProps): React__default.JSX.Element;
|
|
15
151
|
displayName: string;
|
|
16
152
|
};
|
|
153
|
+
/**
|
|
154
|
+
* Card.Content - Content sub-component for Card
|
|
155
|
+
*
|
|
156
|
+
* Renders the main content area of the card. Defaults to `<article>` for
|
|
157
|
+
* standalone content, but can be changed to `div` or `section` via the `as` prop.
|
|
158
|
+
*
|
|
159
|
+
* ## Semantic HTML Guidelines
|
|
160
|
+
* - Use `article` (default) for self-contained, syndicate-able content
|
|
161
|
+
* - Use `div` for generic content containers
|
|
162
|
+
* - Use `section` for thematic groupings with a heading
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* ```tsx
|
|
166
|
+
* <Card>
|
|
167
|
+
* <Card.Title>Article Title</Card.Title>
|
|
168
|
+
* <Card.Content>
|
|
169
|
+
* <p>This is standalone content...</p>
|
|
170
|
+
* </Card.Content>
|
|
171
|
+
* </Card>
|
|
172
|
+
* ```
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```tsx
|
|
176
|
+
* // Generic container (not standalone content)
|
|
177
|
+
* <Card.Content as="div">
|
|
178
|
+
* <p>Generic content...</p>
|
|
179
|
+
* </Card.Content>
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
17
182
|
declare const Content: {
|
|
18
|
-
({ children, className,
|
|
19
|
-
className?: string | undefined;
|
|
20
|
-
styles?: React__default.CSSProperties | undefined;
|
|
21
|
-
}>): React__default.JSX.Element;
|
|
183
|
+
({ children, className, style, as, ...props }: CardContentProps): React__default.JSX.Element;
|
|
22
184
|
displayName: string;
|
|
23
185
|
};
|
|
186
|
+
/**
|
|
187
|
+
* Card.Footer - Footer sub-component for Card
|
|
188
|
+
*
|
|
189
|
+
* Renders a footer section for the card. Use for actions, metadata, or
|
|
190
|
+
* supplementary information.
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```tsx
|
|
194
|
+
* <Card>
|
|
195
|
+
* <Card.Title>Product</Card.Title>
|
|
196
|
+
* <Card.Content>Description...</Card.Content>
|
|
197
|
+
* <Card.Footer>
|
|
198
|
+
* <button>Add to Cart</button>
|
|
199
|
+
* <span>$29.99</span>
|
|
200
|
+
* </Card.Footer>
|
|
201
|
+
* </Card>
|
|
202
|
+
* ```
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* ```tsx
|
|
206
|
+
* // Semantic footer element
|
|
207
|
+
* <Card.Footer as="footer">
|
|
208
|
+
* <p>Last updated: 2024-01-15</p>
|
|
209
|
+
* </Card.Footer>
|
|
210
|
+
* ```
|
|
211
|
+
*/
|
|
24
212
|
declare const Footer: {
|
|
25
|
-
({ children, className,
|
|
26
|
-
className?: string | undefined;
|
|
27
|
-
styles?: React__default.CSSProperties | undefined;
|
|
28
|
-
}>): React__default.JSX.Element;
|
|
213
|
+
({ children, className, style, as, ...props }: CardFooterProps): React__default.JSX.Element;
|
|
29
214
|
displayName: string;
|
|
30
215
|
};
|
|
216
|
+
/**
|
|
217
|
+
* Card - A flexible, accessible card component with compound component pattern
|
|
218
|
+
*
|
|
219
|
+
* The Card component provides a container for grouping related content and actions.
|
|
220
|
+
* It follows the compound component pattern, exposing `Card.Title`, `Card.Content`,
|
|
221
|
+
* and `Card.Footer` sub-components for structured layouts.
|
|
222
|
+
*
|
|
223
|
+
* ## Features
|
|
224
|
+
* - **Polymorphic rendering**: Render as any HTML element via `as` prop
|
|
225
|
+
* - **Compound components**: Structured sub-components for consistent layouts
|
|
226
|
+
* - **Interactive variant**: Built-in keyboard navigation and ARIA support
|
|
227
|
+
* - **Fully accessible**: WCAG 2.1 AA compliant with proper semantic HTML
|
|
228
|
+
*
|
|
229
|
+
* ## Accessibility
|
|
230
|
+
*
|
|
231
|
+
* ### Non-Interactive Cards
|
|
232
|
+
* - Use semantic HTML: `article` for standalone content, `section` for groupings
|
|
233
|
+
* - Provide accessible names with `aria-labelledby` referencing the title
|
|
234
|
+
*
|
|
235
|
+
* ### Interactive Cards (Clickable)
|
|
236
|
+
* - Set `interactive={true}` to enable keyboard navigation (Enter/Space)
|
|
237
|
+
* - Provide accessible name via `aria-label` or `aria-labelledby`
|
|
238
|
+
* - Ensure adequate focus indicators (handled by CSS)
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* // Basic card with compound components
|
|
242
|
+
* ```tsx
|
|
243
|
+
* <Card>
|
|
244
|
+
* <Card.Title>Product Name</Card.Title>
|
|
245
|
+
* <Card.Content>
|
|
246
|
+
* <p>Product description goes here...</p>
|
|
247
|
+
* </Card.Content>
|
|
248
|
+
* <Card.Footer>
|
|
249
|
+
* <button>Buy Now</button>
|
|
250
|
+
* </Card.Footer>
|
|
251
|
+
* </Card>
|
|
252
|
+
* ```
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* // Accessible interactive card
|
|
256
|
+
* ```tsx
|
|
257
|
+
* <Card
|
|
258
|
+
* interactive
|
|
259
|
+
* aria-label="View product details"
|
|
260
|
+
* onClick={() => navigate('/product/123')}
|
|
261
|
+
* >
|
|
262
|
+
* <Card.Title>Product Name</Card.Title>
|
|
263
|
+
* <Card.Content>Click anywhere to view details</Card.Content>
|
|
264
|
+
* </Card>
|
|
265
|
+
* ```
|
|
266
|
+
*
|
|
267
|
+
* @example
|
|
268
|
+
* // Semantic article card with accessible name
|
|
269
|
+
* ```tsx
|
|
270
|
+
* <Card as="article" aria-labelledby="article-title">
|
|
271
|
+
* <Card.Title id="article-title">Article Headline</Card.Title>
|
|
272
|
+
* <Card.Content>Article body...</Card.Content>
|
|
273
|
+
* </Card>
|
|
274
|
+
* ```
|
|
275
|
+
*
|
|
276
|
+
* @example
|
|
277
|
+
* // Card as a landmark region
|
|
278
|
+
* ```tsx
|
|
279
|
+
* <Card role="region" aria-label="Featured products">
|
|
280
|
+
* <Card.Title>Featured</Card.Title>
|
|
281
|
+
* <Card.Content>...</Card.Content>
|
|
282
|
+
* </Card>
|
|
283
|
+
* ```
|
|
284
|
+
*/
|
|
31
285
|
declare const Card: {
|
|
32
|
-
({
|
|
286
|
+
({ as, styles, children, classes, id, interactive, onClick, tabIndex, role, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ...props }: CardProps): React__default.JSX.Element;
|
|
33
287
|
displayName: string;
|
|
34
288
|
Title: {
|
|
35
|
-
({ children, className,
|
|
36
|
-
className?: string | undefined;
|
|
37
|
-
styles?: React__default.CSSProperties | undefined;
|
|
38
|
-
as?: React__default.ElementType<any> | undefined;
|
|
39
|
-
}>): React__default.JSX.Element;
|
|
289
|
+
({ children, className, style, as, ...props }: CardTitleProps): React__default.JSX.Element;
|
|
40
290
|
displayName: string;
|
|
41
291
|
};
|
|
42
292
|
Content: {
|
|
43
|
-
({ children, className,
|
|
44
|
-
className?: string | undefined;
|
|
45
|
-
styles?: React__default.CSSProperties | undefined;
|
|
46
|
-
}>): React__default.JSX.Element;
|
|
293
|
+
({ children, className, style, as, ...props }: CardContentProps): React__default.JSX.Element;
|
|
47
294
|
displayName: string;
|
|
48
295
|
};
|
|
49
296
|
Footer: {
|
|
50
|
-
({ children, className,
|
|
51
|
-
className?: string | undefined;
|
|
52
|
-
styles?: React__default.CSSProperties | undefined;
|
|
53
|
-
}>): React__default.JSX.Element;
|
|
297
|
+
({ children, className, style, as, ...props }: CardFooterProps): React__default.JSX.Element;
|
|
54
298
|
displayName: string;
|
|
55
299
|
};
|
|
56
300
|
};
|
package/libs/components/card.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { d as Card, b as Content, c as Footer, a as Title, e as default } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { d as Card, b as Content, c as Footer, a as Title, e as default } from '../chunk-JJ43O4Y5.js';
|
|
2
|
+
import '../chunk-KUKIVRC2.js';
|
|
3
3
|
//# sourceMappingURL=out.js.map
|
|
4
4
|
//# sourceMappingURL=card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--card-p: 2rem;--card-bg: #fff;--card-radius: calc(var(--card-p) / 4);--card-position: relative;--card-display: flex;--card-direction: column;--card-gap: 1rem}[data-card],[data-component~=card]{display:var(--card-display);flex-direction:var(--card-direction);gap:var(--card-gap);border-radius:var(--card-radius);background-color:var(--card-bg);text-align:var(--card-align, left)}[data-card] h3,[data-card] h2,[data-component~=card] h3,[data-component~=card] h2{margin-block-end:0;padding-block-end:0}[data-card]+div,[data-component~=card]+div{margin-block-start:0}[data-card]>article,[data-component~=card]>article{display:flex;flex-direction:column;flex:2}[data-card]>*:not(img),[data-component~=card]>*:not(img){padding-inline:var(--card-p)}[data-card]>*:last-child:not(img),[data-component~=card]>*:last-child:not(img){padding-block-end:var(--card-p)}[data-card]>*:first-child:not(img),[data-component~=card]>*:first-child:not(img){padding-block-start:calc(var(--card-p) - .5rem)}/*# sourceMappingURL=card.css.map */
|
|
1
|
+
:root{--card-p: 2rem;--card-bg: #fff;--card-radius: calc(var(--card-p) / 4);--card-position: relative;--card-display: flex;--card-direction: column;--card-gap: 1rem}[data-card],[data-component~=card]{display:var(--card-display);flex-direction:var(--card-direction);gap:var(--card-gap);border-radius:var(--card-radius);background-color:var(--card-bg);text-align:var(--card-align, left)}[data-card] h3,[data-card] h2,[data-component~=card] h3,[data-component~=card] h2{margin-block-end:0;padding-block-end:0}[data-card]+div,[data-component~=card]+div{margin-block-start:0}[data-card]>article,[data-component~=card]>article{display:flex;flex-direction:column;flex:2}[data-card]>*:not(img),[data-component~=card]>*:not(img){padding-inline:var(--card-p)}[data-card]>*:last-child:not(img),[data-component~=card]>*:last-child:not(img){padding-block-end:var(--card-p)}[data-card]>*:first-child:not(img),[data-component~=card]>*:first-child:not(img){padding-block-start:calc(var(--card-p) - .5rem)}[data-card=interactive]{cursor:pointer;transition:box-shadow .2s ease,transform .2s ease}[data-card=interactive]:hover{transform:translateY(-2px);box-shadow:0 .25rem .75rem rgba(0,0,0,.15)}[data-card=interactive]:focus-visible{outline:.125rem solid var(--focus-color, #0066CC);outline-offset:.125rem}[data-card=interactive]:focus:not(:focus-visible){outline:none}/*# sourceMappingURL=card.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../../src/components/cards/card.scss"],"names":[],"mappings":"AAAA,MACE,eACA,gBACA,uCACA,0BACA,qBACA,yBACA,iBAGF,mCAEE,4BACA,qCACA,oBACA,iCACA,gCACA,mCAEA,kFAEE,mBACA,oBAEF,2CACE,qBAEF,mDACE,aACA,sBACA,OAGF,yDACE,6BAEF,+EAEE,gCAEF,iFACE","file":"card.css"}
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../src/components/cards/card.scss"],"names":[],"mappings":"AAAA,MACE,eACA,gBACA,uCACA,0BACA,qBACA,yBACA,iBAGF,mCAEE,4BACA,qCACA,oBACA,iCACA,gCACA,mCAEA,kFAEE,mBACA,oBAEF,2CACE,qBAEF,mDACE,aACA,sBACA,OAGF,yDACE,6BAEF,+EAEE,gCAEF,iFACE,gDAKJ,wBACE,eACA,kDAEA,8BACE,2BACA,2CAIF,sCACE,kDACA,uBAIF,kDACE","file":"card.css"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
:root{--card-p: 2rem;--card-bg: #fff;--card-radius: calc(var(--card-p) / 4);--card-position: relative;--card-display: flex;--card-direction: column;--card-gap: 1rem}[data-card],[data-component~=card]{display:var(--card-display);flex-direction:var(--card-direction);gap:var(--card-gap);border-radius:var(--card-radius);background-color:var(--card-bg);text-align:var(--card-align, left)}[data-card] h3,[data-card] h2,[data-component~=card] h3,[data-component~=card] h2{margin-block-end:0;padding-block-end:0}[data-card]+div,[data-component~=card]+div{margin-block-start:0}[data-card]>article,[data-component~=card]>article{display:flex;flex-direction:column;flex:2}[data-card]>*:not(img),[data-component~=card]>*:not(img){padding-inline:var(--card-p)}[data-card]>*:last-child:not(img),[data-component~=card]>*:last-child:not(img){padding-block-end:var(--card-p)}[data-card]>*:first-child:not(img),[data-component~=card]>*:first-child:not(img){padding-block-start:calc(var(--card-p) - .5rem)}
|
|
1
|
+
:root{--card-p: 2rem;--card-bg: #fff;--card-radius: calc(var(--card-p) / 4);--card-position: relative;--card-display: flex;--card-direction: column;--card-gap: 1rem}[data-card],[data-component~=card]{display:var(--card-display);flex-direction:var(--card-direction);gap:var(--card-gap);border-radius:var(--card-radius);background-color:var(--card-bg);text-align:var(--card-align, left)}[data-card] h3,[data-card] h2,[data-component~=card] h3,[data-component~=card] h2{margin-block-end:0;padding-block-end:0}[data-card]+div,[data-component~=card]+div{margin-block-start:0}[data-card]>article,[data-component~=card]>article{display:flex;flex-direction:column;flex:2}[data-card]>*:not(img),[data-component~=card]>*:not(img){padding-inline:var(--card-p)}[data-card]>*:last-child:not(img),[data-component~=card]>*:last-child:not(img){padding-block-end:var(--card-p)}[data-card]>*:first-child:not(img),[data-component~=card]>*:first-child:not(img){padding-block-start:calc(var(--card-p) - .5rem)}[data-card=interactive]{cursor:pointer;transition:box-shadow .2s ease,transform .2s ease}[data-card=interactive]:hover{transform:translateY(-2px);box-shadow:0 .25rem .75rem rgba(0,0,0,.15)}[data-card=interactive]:focus-visible{outline:.125rem solid var(--focus-color, #0066CC);outline-offset:.125rem}[data-card=interactive]:focus:not(:focus-visible){outline:none}
|
|
2
2
|
|
|
3
|
-
/*# sourceMappingURL=data:application/json;base64,
|
|
3
|
+
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL2NhcmRzL2NhcmQuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUNFLGNBQUEsQ0FDQSxlQUFBLENBQ0Esc0NBQUEsQ0FDQSx5QkFBQSxDQUNBLG9CQUFBLENBQ0Esd0JBQUEsQ0FDQSxnQkFBQSxDQUdGLG1DQUVFLDJCQUFBLENBQ0Esb0NBQUEsQ0FDQSxtQkFBQSxDQUNBLGdDQUFBLENBQ0EsK0JBQUEsQ0FDQSxrQ0FBQSxDQUVBLGtGQUVFLGtCQUFBLENBQ0EsbUJBQUEsQ0FFRiwyQ0FDRSxvQkFBQSxDQUVGLG1EQUNFLFlBQUEsQ0FDQSxxQkFBQSxDQUNBLE1BQUEsQ0FHRix5REFDRSw0QkFBQSxDQUVGLCtFQUVFLCtCQUFBLENBRUYsaUZBQ0UsK0NBQUEsQ0FLSix3QkFDRSxjQUFBLENBQ0EsaURBQUEsQ0FFQSw4QkFDRSwwQkFBQSxDQUNBLDBDQUFBLENBSUYsc0NBQ0UsaURBQUEsQ0FDQSxzQkFBQSxDQUlGLGtEQUNFLFlBQUEiLCJmaWxlIjoiY2FyZC5taW4uY3NzIn0= */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
details{--details-border: 0.0625rem solid #dfdfdf;--details-direction: column;--details-display: flex;--details-gap: 0rem;--details-h: max-content;--details-justify: flex-start;--details-px: 1.5rem;--details-py: 1rem;--details-radius: 0;--details-w: 100%;--max-h-closed: 6.25rem;--max-h-open: 50rem;--summary-align: center;--summary-cursor: pointer;--summary-display: flex;--summary-gap: 0.5rem;--summary-justify: flex-start;--summary-transitions: all 0.75s ease-in-out;interpolate-size:allow-keywords;display:var(--details-display);flex-direction:var(--details-direction);justify-content:var(--details-justify);gap:var(--details-gap);width:var(--details-w);border:var(--details-border);border-left:none;border-right:none;transition:var(--summary-transitions);max-height:var(--max-h-closed);overflow:clip}details+details{border-radius:0;border-top:none}details:first-of-type{border-radius:var(--details-radius) var(--details-radius) 0 0}details:last-of-type{border-radius:0 0 var(--details-radius) var(--details-radius)}details:only-of-type{border-radius:var(--details-radius)}details::marker{content:none}details summary{display:var(--summary-display);justify-content:var(--summary-justify);align-items:var(--summary-align);padding-inline:var(--summary-px, var(--details-px));padding-block:var(--summary-py, var(--details-py));gap:var(--summary-gap);list-style:none;border-top-left-radius:var(--details-radius);border-top-right-radius:var(--details-radius);transition:var(--summary-transitions)}
|
|
1
|
+
details{--details-border: 0.0625rem solid #dfdfdf;--details-direction: column;--details-display: flex;--details-gap: 0rem;--details-h: max-content;--details-justify: flex-start;--details-px: 1.5rem;--details-py: 1rem;--details-radius: 0;--details-w: 100%;--max-h-closed: 6.25rem;--max-h-open: 50rem;--summary-align: center;--summary-cursor: pointer;--summary-display: flex;--summary-gap: 0.5rem;--summary-justify: flex-start;--summary-transitions: all 0.75s ease-in-out;interpolate-size:allow-keywords;display:var(--details-display);flex-direction:var(--details-direction);justify-content:var(--details-justify);gap:var(--details-gap);width:var(--details-w);border:var(--details-border);border-left:none;border-right:none;transition:var(--summary-transitions);max-height:var(--max-h-closed);overflow:clip}@starting-style{details{transition:var(--summary-transitions);color:red}}details+details{border-radius:0;border-top:none}details:first-of-type{border-radius:var(--details-radius) var(--details-radius) 0 0}details:last-of-type{border-radius:0 0 var(--details-radius) var(--details-radius)}details:only-of-type{border-radius:var(--details-radius)}details::marker{content:none}details summary{display:var(--summary-display);justify-content:var(--summary-justify);align-items:var(--summary-align);padding-inline:var(--summary-px, var(--details-px));padding-block:var(--summary-py, var(--details-py));gap:var(--summary-gap);list-style:none;border-top-left-radius:var(--details-radius);border-top-right-radius:var(--details-radius);transition:var(--summary-transitions)}details summary::-webkit-details-marker{display:none}details summary:focus-within{outline:none;border-bottom:solid 2px currentColor;background-color:#f5f5f5}details summary:hover{cursor:var(--summary-cursor)}details summary>section{width:var(--details-w)}details .list-styles summary{border-left:none;border-right:none}details>section{padding-inline:var(--details-px);padding-block:var(--details-py);margin-block-start:0;border:1px rgba(0,0,0,0) solid}details[open]{max-height:max-content;transition:var(--summary-transitions)}details[open]>summary{border-bottom:var(--details-border)}details[open]>section{max-height:var(--max-h-open)}@starting-style{details[open]>section{max-height:0}}@supports(transition-behavior: allow-discrete){@starting-style{details{max-height:0;transition:var(--summary-transitions)}}}/*# sourceMappingURL=details.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../../src/components/details/details.scss"],"names":[],"mappings":"AAAA,QACE,0CACA,4BACA,wBACA,oBACA,yBACA,8BACA,qBACA,mBACA,oBACA,kBACA,wBACA,oBACA,wBACA,0BACA,wBACA,sBACA,8BACA,6CAEA,gCACA,+BACA,wCACA,uCACA,uBACA,uBACA,6BACA,iBACA,kBACA,sCACA,+BACA,
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../src/components/details/details.scss"],"names":[],"mappings":"AAAA,QACE,0CACA,4BACA,wBACA,oBACA,yBACA,8BACA,qBACA,mBACA,oBACA,kBACA,wBACA,oBACA,wBACA,0BACA,wBACA,sBACA,8BACA,6CAEA,gCACA,+BACA,wCACA,uCACA,uBACA,uBACA,6BACA,iBACA,kBACA,sCACA,+BACA,cAEA,gBAjCF,QAkCI,sCACA,WAGF,gBACE,gBACA,gBAGF,sBACE,8DAGF,qBACE,8DAIF,qBACE,oCAGF,gBACE,aAGF,gBACE,+BACA,uCACA,iCACA,oDACA,mDACA,uBACA,gBACA,6CACA,8CACA,sCAEA,wCACE,aAGF,6BACE,aACA,qCACA,yBAIF,sBACE,6BAEF,wBACE,uBAKF,6BACE,iBACA,kBAIJ,gBACE,iCACA,gCACA,qBACA,+BAGF,cACE,uBACA,sCACA,sBACE,oCAEF,sBACE,6BACA,gBAFF,sBAGI,cAKN,+CACE,gBAxHJ,QAyHM,aACA","file":"details.css"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
details{--details-border: 0.0625rem solid #dfdfdf;--details-direction: column;--details-display: flex;--details-gap: 0rem;--details-h: max-content;--details-justify: flex-start;--details-px: 1.5rem;--details-py: 1rem;--details-radius: 0;--details-w: 100%;--max-h-closed: 6.25rem;--max-h-open: 50rem;--summary-align: center;--summary-cursor: pointer;--summary-display: flex;--summary-gap: 0.5rem;--summary-justify: flex-start;--summary-transitions: all 0.75s ease-in-out;interpolate-size:allow-keywords;display:var(--details-display);flex-direction:var(--details-direction);justify-content:var(--details-justify);gap:var(--details-gap);width:var(--details-w);border:var(--details-border);border-left:none;border-right:none;transition:var(--summary-transitions);max-height:var(--max-h-closed);overflow:clip}details+details{border-radius:0;border-top:none}details:first-of-type{border-radius:var(--details-radius) var(--details-radius) 0 0}details:last-of-type{border-radius:0 0 var(--details-radius) var(--details-radius)}details:only-of-type{border-radius:var(--details-radius)}details::marker{content:none}details summary{display:var(--summary-display);justify-content:var(--summary-justify);align-items:var(--summary-align);padding-inline:var(--summary-px, var(--details-px));padding-block:var(--summary-py, var(--details-py));gap:var(--summary-gap);list-style:none;border-top-left-radius:var(--details-radius);border-top-right-radius:var(--details-radius);transition:var(--summary-transitions)}
|
|
1
|
+
details{--details-border: 0.0625rem solid #dfdfdf;--details-direction: column;--details-display: flex;--details-gap: 0rem;--details-h: max-content;--details-justify: flex-start;--details-px: 1.5rem;--details-py: 1rem;--details-radius: 0;--details-w: 100%;--max-h-closed: 6.25rem;--max-h-open: 50rem;--summary-align: center;--summary-cursor: pointer;--summary-display: flex;--summary-gap: 0.5rem;--summary-justify: flex-start;--summary-transitions: all 0.75s ease-in-out;interpolate-size:allow-keywords;display:var(--details-display);flex-direction:var(--details-direction);justify-content:var(--details-justify);gap:var(--details-gap);width:var(--details-w);border:var(--details-border);border-left:none;border-right:none;transition:var(--summary-transitions);max-height:var(--max-h-closed);overflow:clip}@starting-style{details{transition:var(--summary-transitions);color:red}}details+details{border-radius:0;border-top:none}details:first-of-type{border-radius:var(--details-radius) var(--details-radius) 0 0}details:last-of-type{border-radius:0 0 var(--details-radius) var(--details-radius)}details:only-of-type{border-radius:var(--details-radius)}details::marker{content:none}details summary{display:var(--summary-display);justify-content:var(--summary-justify);align-items:var(--summary-align);padding-inline:var(--summary-px, var(--details-px));padding-block:var(--summary-py, var(--details-py));gap:var(--summary-gap);list-style:none;border-top-left-radius:var(--details-radius);border-top-right-radius:var(--details-radius);transition:var(--summary-transitions)}details summary::-webkit-details-marker{display:none}details summary:focus-within{outline:none;border-bottom:solid 2px currentColor;background-color:#f5f5f5}details summary:hover{cursor:var(--summary-cursor)}details summary>section{width:var(--details-w)}details .list-styles summary{border-left:none;border-right:none}details>section{padding-inline:var(--details-px);padding-block:var(--details-py);margin-block-start:0;border:1px rgba(0,0,0,0) solid}details[open]{max-height:-moz-max-content;max-height:max-content;transition:var(--summary-transitions)}details[open]>summary{border-bottom:var(--details-border)}details[open]>section{max-height:var(--max-h-open)}@starting-style{details[open]>section{max-height:0}}@supports(transition-behavior: allow-discrete){@starting-style{details{max-height:0;transition:var(--summary-transitions)}}}
|
|
2
2
|
|
|
3
|
-
/*# sourceMappingURL=data:application/json;base64,
|
|
3
|
+
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL2RldGFpbHMvZGV0YWlscy5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFFBQ0UseUNBQUEsQ0FDQSwyQkFBQSxDQUNBLHVCQUFBLENBQ0EsbUJBQUEsQ0FDQSx3QkFBQSxDQUNBLDZCQUFBLENBQ0Esb0JBQUEsQ0FDQSxrQkFBQSxDQUNBLG1CQUFBLENBQ0EsaUJBQUEsQ0FDQSx1QkFBQSxDQUNBLG1CQUFBLENBQ0EsdUJBQUEsQ0FDQSx5QkFBQSxDQUNBLHVCQUFBLENBQ0EscUJBQUEsQ0FDQSw2QkFBQSxDQUNBLDRDQUFBLENBRUEsK0JBQUEsQ0FDQSw4QkFBQSxDQUNBLHVDQUFBLENBQ0Esc0NBQUEsQ0FDQSxzQkFBQSxDQUNBLHNCQUFBLENBQ0EsNEJBQUEsQ0FDQSxnQkFBQSxDQUNBLGlCQUFBLENBQ0EscUNBQUEsQ0FDQSw4QkFBQSxDQUNBLGFBQUEsQ0FFQSxnQkFqQ0YsUUFrQ0kscUNBQUEsQ0FDQSxTQUFBLENBQUEsQ0FHRixnQkFDRSxlQUFBLENBQ0EsZUFBQSxDQUdGLHNCQUNFLDZEQUFBLENBR0YscUJBQ0UsNkRBQUEsQ0FJRixxQkFDRSxtQ0FBQSxDQUdGLGdCQUNFLFlBQUEsQ0FHRixnQkFDRSw4QkFBQSxDQUNBLHNDQUFBLENBQ0EsZ0NBQUEsQ0FDQSxtREFBQSxDQUNBLGtEQUFBLENBQ0Esc0JBQUEsQ0FDQSxlQUFBLENBQ0EsNENBQUEsQ0FDQSw2Q0FBQSxDQUNBLHFDQUFBLENBRUEsd0NBQ0UsWUFBQSxDQUdGLDZCQUNFLFlBQUEsQ0FDQSxvQ0FBQSxDQUNBLHdCQUFBLENBSUYsc0JBQ0UsNEJBQUEsQ0FFRix3QkFDRSxzQkFBQSxDQUtGLDZCQUNFLGdCQUFBLENBQ0EsaUJBQUEsQ0FJSixnQkFDRSxnQ0FBQSxDQUNBLCtCQUFBLENBQ0Esb0JBQUEsQ0FDQSw4QkFBQSxDQUdGLGNBQ0UsMkJBQUEsQ0FBQSxzQkFBQSxDQUNBLHFDQUFBLENBQ0Esc0JBQ0UsbUNBQUEsQ0FFRixzQkFDRSw0QkFBQSxDQUNBLGdCQUZGLHNCQUdJLFlBQUEsQ0FBQSxDQUtOLCtDQUNFLGdCQXhISixRQXlITSxZQUFBLENBQ0EscUNBQUEsQ0FBQSxDQUFBIiwiZmlsZSI6ImRldGFpbHMubWluLmNzcyJ9 */
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../../chunk-
|
|
7
|
-
require('../../chunk-
|
|
8
|
-
require('../../chunk-
|
|
9
|
-
require('../../chunk-
|
|
5
|
+
var chunkD4YLRWAO_cjs = require('../../chunk-D4YLRWAO.cjs');
|
|
6
|
+
require('../../chunk-PQ2K3BM6.cjs');
|
|
7
|
+
require('../../chunk-3MKLDCKQ.cjs');
|
|
8
|
+
require('../../chunk-J32EZPYD.cjs');
|
|
9
|
+
require('../../chunk-L75OQKEI.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
Object.defineProperty(exports, 'Dialog', {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkD4YLRWAO_cjs.a; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, 'default', {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkD4YLRWAO_cjs.b; }
|
|
20
20
|
});
|
|
21
21
|
//# sourceMappingURL=out.js.map
|
|
22
22
|
//# sourceMappingURL=dialog.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--dialog-min-w: max(20rem, 80%);--dialog-gap: 0.625rem;--dialog-border-color: lightgray;--dialog-border-width: thin;--dialog-border-style: solid;--dialog-border-radius: var(--border-radius);--dialog-padding: 1.5rem;--dialog-padding-inline: 1rem;--dialog-close-color: gray;--dialog-button-bg: transparent;--dialog-button-border: transparent thin solid;--dialog-button-hover-bg: whitesmoke;--dialog-display: flex;--dialog-flex-direction: column}dialog{width:var(--dialog-min-w);min-width:var(--min-w);gap:var(--dialog-gap);border:var(--dialog-border-color) var(--dialog-border-width) solid;border-radius:var(--dialog-border-radius);padding:var(--dialog-padding);padding-block-start:
|
|
1
|
+
:root{--dialog-min-w: max(20rem, 80%);--dialog-gap: 0.625rem;--dialog-border-color: lightgray;--dialog-border-width: thin;--dialog-border-style: solid;--dialog-border-radius: var(--border-radius);--dialog-padding: 1.5rem;--dialog-padding-inline: 1rem;--dialog-close-color: gray;--dialog-button-bg: transparent;--dialog-button-border: transparent thin solid;--dialog-button-hover-bg: whitesmoke;--dialog-display: flex;--dialog-flex-direction: column;--dialog-focus-color: #0066cc;--dialog-focus-width: 0.125rem;--dialog-focus-offset: 0.125rem;--dialog-focus-outline: var(--dialog-focus-width) solid var(--dialog-focus-color)}@media(prefers-contrast: high){:root{--dialog-border-color: currentColor;--dialog-border-width: 0.125rem;--dialog-close-color: currentColor;--dialog-button-border: currentColor 0.125rem solid;--dialog-focus-width: 0.1875rem}}dialog{width:var(--dialog-min-w);min-width:var(--min-w);gap:var(--dialog-gap);border:var(--dialog-border-color) var(--dialog-border-width) solid;border-radius:var(--dialog-border-radius);padding:var(--dialog-padding);padding-block-start:var(--dialog-padding)}dialog:focus-visible{outline:var(--dialog-focus-outline);outline-offset:var(--dialog-focus-offset)}dialog[open]{display:var(--dialog-display);flex-direction:var(--dialog-flex-direction);gap:var(--dialog-gap)}dialog section{width:100%;display:flex;justify-content:start;gap:var(--dialog-gap);flex-direction:var(--dialog-flex-direction);margin-block-start:0;--sect-y: 0}.dialog-header{display:flex;justify-content:space-between;align-items:center;width:100%;min-width:100%}.dialog-header h3{margin-block-start:0;margin-block-end:0}.dialog-header .dialog-close{margin-block-end:0}.dialog-header button[type=button]{background-color:var(--dialog-button-bg);border:var(--dialog-button-border);cursor:pointer}.dialog-header button[type=button]:hover{border-color:var(--dialog-close-color);background-color:var(--dialog-button-hover-bg)}.dialog-header button[type=button]:focus-visible{outline:var(--dialog-focus-outline);outline-offset:var(--dialog-focus-offset);border-color:var(--dialog-focus-color);background-color:var(--dialog-button-hover-bg)}.dialog-header button[type=button]:focus:not(:focus-visible){outline:none}.alert-dialog-actions,.dialog-footer{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:var(--dialog-footer-justify, flex-end);gap:var(--dialog-gap);width:100%}.alert-dialog-actions button:focus-visible,.dialog-footer button:focus-visible{outline:var(--dialog-focus-outline);outline-offset:var(--dialog-focus-offset)}.alert-dialog-actions button:focus:not(:focus-visible),.dialog-footer button:focus:not(:focus-visible){outline:none}/*# sourceMappingURL=dialog.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../../src/components/dialog/dialog.scss"],"names":[],"mappings":"AAAA,MACE,gCACA,uBACA,iCACA,4BACA,6BACA,6CACA,yBACA,8BACA,2BACA,gCACA,+CACA,qCACA,uBACA,
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../src/components/dialog/dialog.scss"],"names":[],"mappings":"AAAA,MACE,gCACA,uBACA,iCACA,4BACA,6BACA,6CACA,yBACA,8BACA,2BACA,gCACA,+CACA,qCACA,uBACA,gCAGA,8BACA,+BACA,gCACA,kFAIF,+BACE,MACE,oCACA,gCACA,mCACA,oDACA,iCAIJ,OACE,0BACA,uBACA,sBACA,mEACA,0CACA,8BACA,0CAGA,qBACE,oCACA,0CAGF,aACE,8BACA,4CACA,sBAGF,eACE,WACA,aACA,sBACA,sBACA,4CACA,qBACA,YAIJ,eACE,aACA,8BACA,mBACA,WACA,eAEA,kBACE,qBACA,mBAGF,6BACE,mBAGF,mCACE,yCACA,mCACA,eAEA,yCACE,uCACA,+CAIF,iDACE,oCACA,0CACA,uCACA,+CAIF,6DACE,aAKN,qCAEE,aACA,mBACA,eACA,uDACA,sBACA,WAGA,+EACE,oCACA,0CAGF,uGACE","file":"dialog.css"}
|
|
@@ -1,51 +1,105 @@
|
|
|
1
|
-
import React__default, { CSSProperties } from 'react';
|
|
2
|
-
import { F as FP } from '../../ui-9a6f9f8d.js';
|
|
1
|
+
import React__default, { ReactNode, CSSProperties } from 'react';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
4
|
+
* Base properties shared by all dialog variants.
|
|
6
5
|
*
|
|
7
|
-
* @property {
|
|
8
|
-
* @property {
|
|
9
|
-
* @property {
|
|
10
|
-
* @property {string}
|
|
11
|
-
* @property {
|
|
12
|
-
* @property {React.ReactNode} children - The content to be displayed inside the dialog.
|
|
13
|
-
* @property {() => void | Promise<void>} [onConfirm] - A callback function to be called when the user confirms the dialog.
|
|
14
|
-
* @property {string} [confirmLabel] - The label for the confirm button.
|
|
15
|
-
* @property {string} [cancelLabel] - The label for the cancel button.
|
|
16
|
-
* @property {string} [className] - An optional CSS class name to be applied to the dialog.
|
|
17
|
-
* @property {CSSProperties} [styles] - Optional inline styles to be applied to the dialog.
|
|
6
|
+
* @property {string} dialogTitle - The title displayed in the dialog header
|
|
7
|
+
* @property {string} [dialogLabel] - Optional accessible label for the dialog (aria-label)
|
|
8
|
+
* @property {ReactNode} children - Content to be displayed inside the dialog body
|
|
9
|
+
* @property {string} [className] - Additional CSS classes to apply to the dialog
|
|
10
|
+
* @property {CSSProperties} [styles] - Inline styles to apply to the dialog element
|
|
18
11
|
*/
|
|
19
|
-
|
|
12
|
+
interface BaseDialogProps {
|
|
13
|
+
/** The title displayed in the dialog header */
|
|
20
14
|
dialogTitle: string;
|
|
15
|
+
/** Optional accessible label for the dialog (aria-label) */
|
|
21
16
|
dialogLabel?: string;
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
/** Content to be displayed inside the dialog body */
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
/** Additional CSS classes to apply to the dialog */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Inline styles to apply to the dialog element */
|
|
22
|
+
styles?: CSSProperties;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Props for the controlled Dialog component.
|
|
26
|
+
* Use this when you want to manage dialog state externally.
|
|
27
|
+
*
|
|
28
|
+
* @extends BaseDialogProps
|
|
29
|
+
* @property {boolean} isOpen - Controls whether the dialog is currently open
|
|
30
|
+
* @property {(open: boolean) => void} onOpenChange - Callback fired when dialog open state should change
|
|
31
|
+
* @property {boolean} [isAlertDialog=false] - If true, renders as non-modal inline alert using dialog.show()
|
|
32
|
+
* @property {() => void} [onClose] - Deprecated: Use onOpenChange instead. Called when dialog closes.
|
|
33
|
+
* @property {() => void | Promise<void>} [onConfirm] - Callback fired when confirm button is clicked
|
|
34
|
+
* @property {string} [confirmLabel="Confirm"] - Text label for the confirm button
|
|
35
|
+
* @property {string} [cancelLabel="Cancel"] - Text label for the cancel button
|
|
36
|
+
* @property {boolean} [hideFooter=false] - If true, hides the dialog footer with action buttons
|
|
37
|
+
*/
|
|
38
|
+
interface DialogProps extends BaseDialogProps {
|
|
39
|
+
/** Controls whether the dialog is currently open (controlled component) */
|
|
40
|
+
isOpen: boolean;
|
|
41
|
+
/** Callback fired when dialog open state should change */
|
|
42
|
+
onOpenChange: (open: boolean) => void;
|
|
43
|
+
/** If true, renders as non-modal inline alert using dialog.show() instead of dialog.showModal() */
|
|
24
44
|
isAlertDialog?: boolean;
|
|
45
|
+
/** @deprecated Use onOpenChange instead. Called when dialog closes. */
|
|
25
46
|
onClose?: () => void;
|
|
47
|
+
/** Callback fired when confirm button is clicked */
|
|
26
48
|
onConfirm?: () => void | Promise<void>;
|
|
49
|
+
/** Text label for the confirm button */
|
|
27
50
|
confirmLabel?: string;
|
|
51
|
+
/** Text label for the cancel button */
|
|
28
52
|
cancelLabel?: string;
|
|
29
|
-
|
|
53
|
+
/** If true, hides the dialog footer with action buttons */
|
|
30
54
|
hideFooter?: boolean;
|
|
31
|
-
|
|
32
|
-
|
|
55
|
+
}
|
|
56
|
+
|
|
33
57
|
/**
|
|
34
|
-
*
|
|
58
|
+
* A controlled dialog component that supports both modal and non-modal (inline alert) modes.
|
|
59
|
+
*
|
|
60
|
+
* **Modal Dialog** (default): Uses native `<dialog>` element with `.showModal()` which provides:
|
|
61
|
+
* - Automatic focus trap (Tab cycles within dialog)
|
|
62
|
+
* - Escape key closes dialog (native behavior)
|
|
63
|
+
* - Backdrop overlay with click-to-close
|
|
64
|
+
* - Inert background (page content becomes non-interactive)
|
|
65
|
+
*
|
|
66
|
+
* **Inline Alert Dialog** (`isAlertDialog={true}`): Uses `.show()` for non-modal inline alerts:
|
|
67
|
+
* - No focus trap (page remains interactive)
|
|
68
|
+
* - No escape key behavior
|
|
69
|
+
* - Positioned inline in page flow
|
|
70
|
+
* - User must explicitly close with button
|
|
71
|
+
*
|
|
72
|
+
* @component
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* // Controlled usage
|
|
76
|
+
* const [open, setOpen] = useState(false);
|
|
77
|
+
* <Dialog
|
|
78
|
+
* isOpen={open}
|
|
79
|
+
* onOpenChange={setOpen}
|
|
80
|
+
* dialogTitle="Confirm Delete"
|
|
81
|
+
* >
|
|
82
|
+
* Are you sure you want to delete this item?
|
|
83
|
+
* </Dialog>
|
|
84
|
+
* ```
|
|
35
85
|
*
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
39
|
-
* @param dialogTitle - The title
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
42
|
-
* @param
|
|
43
|
-
* @param
|
|
44
|
-
* @param
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
86
|
+
* @param {DialogProps} props - Component props
|
|
87
|
+
* @param {boolean} props.isOpen - Controls whether the dialog is currently open
|
|
88
|
+
* @param {(open: boolean) => void} props.onOpenChange - Callback fired when dialog open state changes
|
|
89
|
+
* @param {string} props.dialogTitle - The title displayed in the dialog header
|
|
90
|
+
* @param {boolean} [props.isAlertDialog=false] - If true, renders as non-modal inline alert
|
|
91
|
+
* @param {() => void} [props.onClose] - Deprecated: Use onOpenChange. Called when dialog closes.
|
|
92
|
+
* @param {ReactNode} props.children - Content to display inside the dialog body
|
|
93
|
+
* @param {() => void | Promise<void>} [props.onConfirm] - Callback fired when confirm button is clicked
|
|
94
|
+
* @param {string} [props.confirmLabel="Confirm"] - Text label for confirm button
|
|
95
|
+
* @param {string} [props.cancelLabel="Cancel"] - Text label for cancel button
|
|
96
|
+
* @param {boolean} [props.hideFooter=false] - If true, hides the footer with action buttons
|
|
97
|
+
* @param {string} [props.className] - Additional CSS classes to apply
|
|
98
|
+
* @param {string} [props.dialogLabel] - Optional aria-label for the dialog
|
|
99
|
+
* @param {CSSProperties} [props.styles] - Inline styles to apply to dialog element
|
|
100
|
+
* @returns {JSX.Element} A controlled dialog component
|
|
47
101
|
*/
|
|
48
|
-
declare const Dialog: React__default.FC<
|
|
49
|
-
declare const _default: React__default.NamedExoticComponent<
|
|
102
|
+
declare const Dialog: React__default.FC<DialogProps>;
|
|
103
|
+
declare const _default: React__default.NamedExoticComponent<DialogProps>;
|
|
50
104
|
|
|
51
105
|
export { Dialog, _default as default };
|