@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
package/libs/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export { Card, Content as CardContent, Footer as CardFooter, CardProps, Title as
|
|
|
3
3
|
export { default as Field, FieldProps } from './components/form/fields.js';
|
|
4
4
|
export { F as Box, F as FP, I as Input, a as InputProps } from './inputs-f3a216db.js';
|
|
5
5
|
export { default as Icon, IconProps } from './components/icons/icon.js';
|
|
6
|
-
import { F as FP } from './ui-9a6f9f8d.js';
|
|
7
6
|
import React__default, { ReactNode } from 'react';
|
|
8
7
|
export { default as Link, LinkProps, default as To } from './components/link/link.js';
|
|
9
8
|
export { default as List, ListItemProps } from './components/list/list.js';
|
|
@@ -11,16 +10,319 @@ export { Modal, ModalProps } from './components/modal.js';
|
|
|
11
10
|
export { default as Popover, PopoverProps } from './components/popover/popover.js';
|
|
12
11
|
export { RenderTable as TBL, TableProps } from './components/tables/table.js';
|
|
13
12
|
export { Dialog } from './components/dialog/dialog.js';
|
|
13
|
+
import { U as UI } from './ui-645f95b5.js';
|
|
14
14
|
export { default as Nav, NavItem, NavItemProps, NavList, NavListProps, NavProps } from './components/nav/nav.js';
|
|
15
|
-
export { default as Text, TextProps
|
|
16
|
-
export { TitleProps } from './
|
|
15
|
+
export { default as Text, TextProps } from './components/text/text.js';
|
|
16
|
+
export { b as Heading, H as HeadingLevel, T as Title, a as TitleProps } from './heading-3648c538.js';
|
|
17
17
|
export { default as Textarea, TextareaProps } from './components/form/textarea.js';
|
|
18
18
|
import { C as ComponentProps$1 } from './component-props-a8a2f97e.js';
|
|
19
|
-
export { default as Breadcrumb } from './components/breadcrumbs/breadcrumb.js';
|
|
19
|
+
export { default as Breadcrumb, BreadcrumbProps, CustomRoute, useBreadcrumbSegments } from './components/breadcrumbs/breadcrumb.js';
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Props for the Img component.
|
|
23
|
+
*
|
|
24
|
+
* Extends native HTML img element attributes with additional functionality
|
|
25
|
+
* for responsive images, loading states, and error handling.
|
|
26
|
+
*
|
|
27
|
+
* ## Accessibility Guidelines (WCAG 2.1 AA)
|
|
28
|
+
*
|
|
29
|
+
* **Decorative Images:**
|
|
30
|
+
* Images that are purely visual decoration should have an empty alt attribute.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* // ✅ Decorative image (border, background pattern, visual separator)
|
|
35
|
+
* <Img src="/decorative-border.png" alt="" />
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* **Semantic Images:**
|
|
39
|
+
* Images that convey information or meaning must have descriptive alt text.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // ✅ Semantic image (charts, diagrams, photos with meaning)
|
|
44
|
+
* <Img
|
|
45
|
+
* src="/sales-chart.png"
|
|
46
|
+
* alt="Sales chart showing 30% growth in Q4 2024"
|
|
47
|
+
* />
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* **Responsive Images:**
|
|
51
|
+
* Use srcset and sizes for responsive images to optimize performance.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* // ✅ Responsive image with srcset
|
|
56
|
+
* <Img
|
|
57
|
+
* src="/photo.jpg"
|
|
58
|
+
* srcSet="/photo-320w.jpg 320w, /photo-640w.jpg 640w, /photo-1024w.jpg 1024w"
|
|
59
|
+
* sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw"
|
|
60
|
+
* alt="Team photo from annual conference"
|
|
61
|
+
* />
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @see https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html
|
|
65
|
+
*/
|
|
66
|
+
interface ImgProps extends Omit<React__default.ImgHTMLAttributes<HTMLImageElement>, 'placeholder'> {
|
|
67
|
+
/**
|
|
68
|
+
* The image source URL.
|
|
69
|
+
* @default '//'
|
|
70
|
+
*/
|
|
71
|
+
src?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Alternative text for the image.
|
|
74
|
+
* - **Empty string (`""`)** for decorative images
|
|
75
|
+
* - **Descriptive text** for semantic images that convey meaning
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```tsx
|
|
79
|
+
* // Decorative
|
|
80
|
+
* <Img src="/border.png" alt="" />
|
|
81
|
+
*
|
|
82
|
+
* // Semantic
|
|
83
|
+
* <Img src="/logo.png" alt="Company logo" />
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
alt?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Width of the image in pixels.
|
|
89
|
+
* @default 480
|
|
90
|
+
*/
|
|
91
|
+
width?: number | string;
|
|
92
|
+
/**
|
|
93
|
+
* Height of the image in pixels.
|
|
94
|
+
* When not provided, defaults to 'auto'.
|
|
95
|
+
*/
|
|
96
|
+
height?: number | string;
|
|
97
|
+
/**
|
|
98
|
+
* Inline styles to apply to the image.
|
|
99
|
+
*/
|
|
100
|
+
styles?: React__default.CSSProperties;
|
|
101
|
+
/**
|
|
102
|
+
* Loading behavior for the image.
|
|
103
|
+
* - `"lazy"` (default): Defers loading until near viewport
|
|
104
|
+
* - `"eager"`: Loads immediately
|
|
105
|
+
*
|
|
106
|
+
* @default "lazy"
|
|
107
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#loading
|
|
108
|
+
*/
|
|
109
|
+
loading?: 'eager' | 'lazy';
|
|
110
|
+
/**
|
|
111
|
+
* Fallback placeholder image URL to display on error.
|
|
112
|
+
* If not provided and image fails to load, a default placeholder is used.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```tsx
|
|
116
|
+
* <Img
|
|
117
|
+
* src="/photo.jpg"
|
|
118
|
+
* placeholder="/fallback.png"
|
|
119
|
+
* alt="User profile photo"
|
|
120
|
+
* />
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
placeholder?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Hint for the browser to prioritize image fetching.
|
|
126
|
+
* - `"high"`: High priority (above-the-fold images)
|
|
127
|
+
* - `"low"` (default): Low priority
|
|
128
|
+
* - `"auto"`: Browser decides
|
|
129
|
+
*
|
|
130
|
+
* @default "low"
|
|
131
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#fetchpriority
|
|
132
|
+
*/
|
|
133
|
+
fetchpriority?: 'high' | 'low' | 'auto';
|
|
134
|
+
/**
|
|
135
|
+
* Decoding hint for the browser.
|
|
136
|
+
* - `"async"`: Decode asynchronously (don't block rendering)
|
|
137
|
+
* - `"sync"`: Decode synchronously
|
|
138
|
+
* - `"auto"` (default): Browser decides
|
|
139
|
+
*
|
|
140
|
+
* @default "auto"
|
|
141
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#decoding
|
|
142
|
+
*/
|
|
143
|
+
decoding?: 'sync' | 'async' | 'auto';
|
|
144
|
+
/**
|
|
145
|
+
* Responsive image sources with width descriptors.
|
|
146
|
+
* Allows browser to choose appropriate image based on viewport.
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```tsx
|
|
150
|
+
* <Img
|
|
151
|
+
* src="/photo.jpg"
|
|
152
|
+
* srcSet="/photo-320w.jpg 320w, /photo-640w.jpg 640w"
|
|
153
|
+
* sizes="(max-width: 640px) 100vw, 640px"
|
|
154
|
+
* alt="Responsive image"
|
|
155
|
+
* />
|
|
156
|
+
* ```
|
|
157
|
+
*
|
|
158
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#srcset
|
|
159
|
+
*/
|
|
160
|
+
srcSet?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Media conditions for responsive image sizing.
|
|
163
|
+
* Works with srcSet to determine which image to load.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```tsx
|
|
167
|
+
* sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 800px"
|
|
168
|
+
* ```
|
|
169
|
+
*
|
|
170
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#sizes
|
|
171
|
+
*/
|
|
172
|
+
sizes?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Callback fired when the image fails to load.
|
|
175
|
+
* The default SVG placeholder is still applied after calling this handler.
|
|
176
|
+
* Call `event.preventDefault()` to prevent the default fallback behavior.
|
|
177
|
+
*
|
|
178
|
+
* @param event - The error event
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* ```tsx
|
|
182
|
+
* // Log error and show default placeholder
|
|
183
|
+
* <Img
|
|
184
|
+
* src="/photo.jpg"
|
|
185
|
+
* onError={(e) => console.error('Image failed to load', e)}
|
|
186
|
+
* alt="Photo"
|
|
187
|
+
* />
|
|
188
|
+
*
|
|
189
|
+
* // Prevent default and use custom fallback
|
|
190
|
+
* <Img
|
|
191
|
+
* src="/photo.jpg"
|
|
192
|
+
* onError={(e) => {
|
|
193
|
+
* e.preventDefault()
|
|
194
|
+
* e.currentTarget.src = '/custom-fallback.jpg'
|
|
195
|
+
* }}
|
|
196
|
+
* alt="Photo"
|
|
197
|
+
* />
|
|
198
|
+
* ```
|
|
199
|
+
*/
|
|
200
|
+
onError?: (event: React__default.SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
201
|
+
/**
|
|
202
|
+
* Callback fired when the image successfully loads.
|
|
203
|
+
*
|
|
204
|
+
* @param event - The load event
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* ```tsx
|
|
208
|
+
* <Img
|
|
209
|
+
* src="/photo.jpg"
|
|
210
|
+
* onLoad={(e) => console.log('Image loaded successfully')}
|
|
211
|
+
* alt="Photo"
|
|
212
|
+
* />
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
onLoad?: (event: React__default.SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Img - A semantic image component with accessibility and performance best practices.
|
|
220
|
+
*
|
|
221
|
+
* This component wraps the native `<img>` element with enhanced features:
|
|
222
|
+
* - **Responsive images** via optional srcset/sizes
|
|
223
|
+
* - **Lazy loading** by default for performance
|
|
224
|
+
* - **Error handling** with configurable fallback placeholders
|
|
225
|
+
* - **Type safety** with full TypeScript support
|
|
226
|
+
*
|
|
227
|
+
* ## Accessibility Patterns (WCAG 2.1 AA)
|
|
228
|
+
*
|
|
229
|
+
* ### Decorative Images
|
|
230
|
+
* Images that are purely visual decoration should use an empty alt attribute.
|
|
231
|
+
* These images are typically borders, patterns, or visual separators.
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* ```tsx
|
|
235
|
+
* // ✅ GOOD: Decorative border image
|
|
236
|
+
* <Img src="/decorative-border.png" alt="" />
|
|
237
|
+
*
|
|
238
|
+
* // ✅ GOOD: Background pattern
|
|
239
|
+
* <Img src="/pattern.svg" alt="" loading="eager" />
|
|
240
|
+
* ```
|
|
241
|
+
*
|
|
242
|
+
* ### Semantic Images
|
|
243
|
+
* Images that convey information must have descriptive alt text that explains
|
|
244
|
+
* the content and purpose of the image.
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```tsx
|
|
248
|
+
* // ✅ GOOD: Informative image with descriptive alt
|
|
249
|
+
* <Img
|
|
250
|
+
* src="/sales-chart.png"
|
|
251
|
+
* alt="Sales chart showing 30% revenue growth in Q4 2024"
|
|
252
|
+
* />
|
|
253
|
+
*
|
|
254
|
+
* // ✅ GOOD: Product photo with context
|
|
255
|
+
* <Img
|
|
256
|
+
* src="/laptop.jpg"
|
|
257
|
+
* alt="Silver MacBook Pro 14-inch on wooden desk"
|
|
258
|
+
* />
|
|
259
|
+
* ```
|
|
260
|
+
*
|
|
261
|
+
* ## Performance Optimization
|
|
262
|
+
*
|
|
263
|
+
* ### Lazy Loading
|
|
264
|
+
* By default, images use lazy loading to improve page load performance.
|
|
265
|
+
* Only use `loading="eager"` for above-the-fold images.
|
|
266
|
+
*
|
|
267
|
+
* @example
|
|
268
|
+
* ```tsx
|
|
269
|
+
* // ✅ GOOD: Lazy load below-the-fold image
|
|
270
|
+
* <Img src="/photo.jpg" alt="Photo" />
|
|
271
|
+
*
|
|
272
|
+
* // ✅ GOOD: Eager load hero image
|
|
273
|
+
* <Img
|
|
274
|
+
* src="/hero.jpg"
|
|
275
|
+
* alt="Hero banner"
|
|
276
|
+
* loading="eager"
|
|
277
|
+
* fetchpriority="high"
|
|
278
|
+
* />
|
|
279
|
+
* ```
|
|
280
|
+
*
|
|
281
|
+
* ### Responsive Images
|
|
282
|
+
* Use srcset and sizes for responsive images to serve appropriate image sizes
|
|
283
|
+
* based on viewport width, improving performance and bandwidth usage.
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* ```tsx
|
|
287
|
+
* // ✅ GOOD: Responsive image with multiple sizes
|
|
288
|
+
* <Img
|
|
289
|
+
* src="/photo.jpg"
|
|
290
|
+
* srcSet="/photo-320w.jpg 320w, /photo-640w.jpg 640w, /photo-1024w.jpg 1024w"
|
|
291
|
+
* sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 800px"
|
|
292
|
+
* alt="Responsive image adapts to viewport"
|
|
293
|
+
* />
|
|
294
|
+
* ```
|
|
295
|
+
*
|
|
296
|
+
* ## Error Handling
|
|
297
|
+
*
|
|
298
|
+
* @example
|
|
299
|
+
* ```tsx
|
|
300
|
+
* // ✅ GOOD: Custom placeholder on error
|
|
301
|
+
* <Img
|
|
302
|
+
* src="/photo.jpg"
|
|
303
|
+
* placeholder="/fallback.png"
|
|
304
|
+
* alt="User profile photo"
|
|
305
|
+
* />
|
|
306
|
+
*
|
|
307
|
+
* // ✅ GOOD: Custom error handler
|
|
308
|
+
* <Img
|
|
309
|
+
* src="/photo.jpg"
|
|
310
|
+
* onError={(e) => {
|
|
311
|
+
* console.error('Image failed to load')
|
|
312
|
+
* logToAnalytics('image_error', { src: e.currentTarget.src })
|
|
313
|
+
* }}
|
|
314
|
+
* alt="Photo"
|
|
315
|
+
* />
|
|
316
|
+
* ```
|
|
317
|
+
*
|
|
318
|
+
* @param {ImgProps} props - Component props extending native img attributes
|
|
319
|
+
* @returns {React.ReactElement} Image element with enhanced functionality
|
|
320
|
+
*
|
|
321
|
+
* @see {@link ImgProps} for complete prop documentation
|
|
322
|
+
* @see https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html
|
|
323
|
+
*/
|
|
22
324
|
declare const Img: {
|
|
23
|
-
({ src, alt, width, height, styles, loading, placeholder, fetchpriority, decoding,
|
|
325
|
+
({ src, alt, width, height, styles, loading, placeholder, fetchpriority, decoding, srcSet, sizes, onError, onLoad, ...props }: ImgProps): React__default.JSX.Element;
|
|
24
326
|
displayName: string;
|
|
25
327
|
};
|
|
26
328
|
|
|
@@ -53,7 +355,7 @@ interface TextToSpeechComponentProps {
|
|
|
53
355
|
*/
|
|
54
356
|
declare const TextToSpeech: React__default.FC<TextToSpeechComponentProps>;
|
|
55
357
|
|
|
56
|
-
type ComponentProps = React__default.ComponentProps<typeof
|
|
358
|
+
type ComponentProps = React__default.ComponentProps<typeof UI>;
|
|
57
359
|
/**
|
|
58
360
|
* Renders children elements without any wrapping component.
|
|
59
361
|
* Can be used as a placeholder when no semantic landmark is needed.
|
|
@@ -117,12 +419,102 @@ declare const Section: ({ id, children, styles, classes, ...props }: ComponentPr
|
|
|
117
419
|
*/
|
|
118
420
|
declare const Article: ({ id, children, styles, classes, ...props }: ComponentProps) => React__default.JSX.Element;
|
|
119
421
|
|
|
422
|
+
/**
|
|
423
|
+
* Props for the Badge component
|
|
424
|
+
*
|
|
425
|
+
* @property {React.ReactNode} children - Content to display inside the badge (typically numbers or short text)
|
|
426
|
+
* @property {string} [id] - Optional HTML id attribute for the badge element
|
|
427
|
+
* @property {React.CSSProperties} [styles] - Inline styles to apply to the badge
|
|
428
|
+
* @property {string} [classes] - CSS class names to apply to the badge
|
|
429
|
+
* @property {'rounded'} [variant] - Visual variant of the badge. Use 'rounded' for circular badges (fixed size with ellipsis for overflow)
|
|
430
|
+
* @property {string} [aria-label] - Accessible label for screen readers. Required for icon-only or number-only badges
|
|
431
|
+
* @property {'status' | 'note'} [role] - ARIA role for the badge. Defaults to 'status' for dynamic content
|
|
432
|
+
*/
|
|
433
|
+
type BadgeProps = {
|
|
434
|
+
/**
|
|
435
|
+
* Content to display inside the badge (typically numbers or short text)
|
|
436
|
+
*/
|
|
437
|
+
children?: React__default.ReactNode;
|
|
438
|
+
/**
|
|
439
|
+
* Visual variant of the badge
|
|
440
|
+
* - 'rounded': Circular badge style
|
|
441
|
+
*/
|
|
442
|
+
variant?: 'rounded';
|
|
443
|
+
} & React__default.ComponentProps<typeof UI>;
|
|
444
|
+
/**
|
|
445
|
+
* Badge - A small label component for displaying status, counts, or notifications
|
|
446
|
+
*
|
|
447
|
+
* The Badge component is used to display supplementary information alongside other content,
|
|
448
|
+
* such as notification counts, status indicators, or labels. It renders as a semantic `<sup>`
|
|
449
|
+
* element with a nested `<span>` required for the component's styling architecture.
|
|
450
|
+
*
|
|
451
|
+
* ## Styling Architecture
|
|
452
|
+
*
|
|
453
|
+
* The Badge uses a nested structure (`<sup><span>content</span></sup>`) which is required
|
|
454
|
+
* for the SCSS styling system. The outer `<sup>` element provides positioning context,
|
|
455
|
+
* while the inner `<span>` receives the visual styling (background, padding, border-radius).
|
|
456
|
+
*
|
|
457
|
+
* ## Rounded Variant Behavior
|
|
458
|
+
*
|
|
459
|
+
* The `rounded` variant creates a perfect circular badge with fixed dimensions (1.5625rem).
|
|
460
|
+
* Content that exceeds the available space will be truncated with an ellipsis (...).
|
|
461
|
+
* **Best practice**: Format large numbers yourself (e.g., pass "99+" instead of "999").
|
|
462
|
+
*
|
|
463
|
+
* ## Accessibility Considerations
|
|
464
|
+
*
|
|
465
|
+
* - **Semantic HTML**: Uses `<sup>` (superscript) element for proper positioning context
|
|
466
|
+
* - **ARIA Role**: Defaults to `role="status"` for dynamic badges (e.g., unread counts)
|
|
467
|
+
* - **Accessible Names**: For icon-only or number-only badges, provide an `aria-label`
|
|
468
|
+
* to give context (e.g., "3 unread messages" instead of just "3")
|
|
469
|
+
* - **Live Regions**: The `role="status"` makes badges announce updates to screen readers
|
|
470
|
+
*
|
|
471
|
+
* @param {BadgeProps} props - Component props
|
|
472
|
+
* @returns {React.ReactElement} A Badge component
|
|
473
|
+
*
|
|
474
|
+
* @example
|
|
475
|
+
* // Basic badge with notification count
|
|
476
|
+
* <p>
|
|
477
|
+
* Messages
|
|
478
|
+
* <Badge aria-label="3 unread messages">3</Badge>
|
|
479
|
+
* </p>
|
|
480
|
+
*
|
|
481
|
+
* @example
|
|
482
|
+
* // Rounded badge variant (perfect circle)
|
|
483
|
+
* <p>
|
|
484
|
+
* Notifications
|
|
485
|
+
* <Badge variant="rounded" aria-label="99 or more notifications">99+</Badge>
|
|
486
|
+
* </p>
|
|
487
|
+
*
|
|
488
|
+
* @example
|
|
489
|
+
* // Status badge with custom styling
|
|
490
|
+
* <p>
|
|
491
|
+
* Active Users
|
|
492
|
+
* <Badge styles={{ backgroundColor: 'green', color: 'white' }}>21</Badge>
|
|
493
|
+
* </p>
|
|
494
|
+
*
|
|
495
|
+
* @example
|
|
496
|
+
* // ✅ GOOD: Accessible badge with descriptive label and formatted content
|
|
497
|
+
* <Badge variant="rounded" aria-label="12 items in cart">12</Badge>
|
|
498
|
+
*
|
|
499
|
+
* @example
|
|
500
|
+
* // ✅ GOOD: Large numbers formatted by developer
|
|
501
|
+
* <Badge variant="rounded" aria-label="More than 99 notifications">99+</Badge>
|
|
502
|
+
*
|
|
503
|
+
* @example
|
|
504
|
+
* // ❌ BAD: Number-only badge without context for screen readers
|
|
505
|
+
* <Badge>12</Badge>
|
|
506
|
+
*/
|
|
507
|
+
declare const Badge: {
|
|
508
|
+
({ id, styles, classes, children, variant, ...props }: BadgeProps): React__default.JSX.Element;
|
|
509
|
+
displayName: string;
|
|
510
|
+
};
|
|
511
|
+
|
|
120
512
|
type TagProps = {
|
|
121
513
|
/** HTML element to display the badge as span or p */
|
|
122
514
|
elm?: 'span' | 'p';
|
|
123
515
|
/** Aria role for the component - conditional */
|
|
124
516
|
role: 'note' | 'status';
|
|
125
|
-
} & React__default.ComponentProps<typeof
|
|
517
|
+
} & React__default.ComponentProps<typeof UI>;
|
|
126
518
|
declare const Tag: {
|
|
127
519
|
({ elm, role, children, styles, ...props }: TagProps): React__default.JSX.Element;
|
|
128
520
|
displayName: string;
|
|
@@ -153,33 +545,125 @@ declare const Table: {
|
|
|
153
545
|
displayName: string;
|
|
154
546
|
};
|
|
155
547
|
|
|
548
|
+
/**
|
|
549
|
+
* Props for the Details component.
|
|
550
|
+
*
|
|
551
|
+
* Combines native HTML details element props with custom styling and interaction handlers.
|
|
552
|
+
* The Details component uses the native `<details>` element for progressive disclosure,
|
|
553
|
+
* providing built-in keyboard support and semantic HTML.
|
|
554
|
+
*
|
|
555
|
+
* @example
|
|
556
|
+
* ```tsx
|
|
557
|
+
* <Details
|
|
558
|
+
* summary="Click to expand"
|
|
559
|
+
* icon={<ChevronIcon />}
|
|
560
|
+
* onToggle={(e) => console.log('Toggled:', e.currentTarget.open)}
|
|
561
|
+
* >
|
|
562
|
+
* <p>Hidden content revealed when opened</p>
|
|
563
|
+
* </Details>
|
|
564
|
+
* ```
|
|
565
|
+
*/
|
|
156
566
|
type DetailsProps = {
|
|
157
567
|
/**
|
|
158
|
-
* The summary text shown
|
|
159
|
-
*
|
|
568
|
+
* The summary text or element shown in the clickable header.
|
|
569
|
+
* This is always visible and acts as the toggle control.
|
|
570
|
+
*
|
|
571
|
+
* @required
|
|
572
|
+
* @example
|
|
573
|
+
* ```tsx
|
|
574
|
+
* summary="Shipping Information"
|
|
575
|
+
* // or
|
|
576
|
+
* summary={<><Icon /> Shipping Information</>}
|
|
577
|
+
* ```
|
|
160
578
|
*/
|
|
161
579
|
summary: React__default.ReactNode;
|
|
162
580
|
/**
|
|
163
|
-
*
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
581
|
+
* Optional icon displayed before the summary text.
|
|
582
|
+
* Commonly used for chevron/arrow indicators.
|
|
583
|
+
*
|
|
584
|
+
* @example
|
|
585
|
+
* ```tsx
|
|
586
|
+
* icon={<ChevronDownIcon />}
|
|
587
|
+
* ```
|
|
588
|
+
*/
|
|
589
|
+
icon?: React__default.ReactNode;
|
|
590
|
+
/**
|
|
591
|
+
* Accessible label for screen readers.
|
|
592
|
+
* If not provided, the native `<details>` semantic will be used.
|
|
593
|
+
*
|
|
594
|
+
* Note: Native `<details>` elements are already semantic and announced properly
|
|
595
|
+
* by screen readers. Only provide this if you need to override the default behavior.
|
|
596
|
+
*
|
|
597
|
+
* @optional
|
|
598
|
+
* @example
|
|
599
|
+
* ```tsx
|
|
600
|
+
* ariaLabel="Product details section"
|
|
601
|
+
* ```
|
|
602
|
+
*/
|
|
603
|
+
ariaLabel?: string;
|
|
604
|
+
/**
|
|
605
|
+
* Groups multiple details elements into an accordion where only one can be open.
|
|
606
|
+
* Multiple details elements with the same `name` will behave as a mutually exclusive group.
|
|
607
|
+
*
|
|
608
|
+
* @optional
|
|
609
|
+
* @example
|
|
610
|
+
* ```tsx
|
|
611
|
+
* <Details name="faq-accordion" summary="Question 1">...</Details>
|
|
612
|
+
* <Details name="faq-accordion" summary="Question 2">...</Details>
|
|
613
|
+
* ```
|
|
614
|
+
*/
|
|
615
|
+
name?: string;
|
|
616
|
+
} & React__default.ComponentProps<"details"> & Partial<React__default.ComponentProps<typeof UI>>;
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Details - A progressive disclosure component using native HTML `<details>` element.
|
|
620
|
+
*
|
|
621
|
+
* This component wraps the native `<details>` and `<summary>` elements to provide
|
|
622
|
+
* an accessible, semantic way to show and hide content. It supports accordion behavior
|
|
623
|
+
* through the `name` attribute and includes proper keyboard navigation out of the box.
|
|
624
|
+
*
|
|
625
|
+
* ## Key Features:
|
|
626
|
+
* - **Semantic HTML**: Uses native `<details>` for built-in accessibility
|
|
627
|
+
* - **Keyboard Support**: Space/Enter to toggle, fully accessible by default
|
|
628
|
+
* - **Accordion Mode**: Group multiple details with `name` for exclusive expansion
|
|
629
|
+
* - **Customizable**: Supports icons, custom styles, and event handlers
|
|
630
|
+
*
|
|
631
|
+
* ## Accessibility:
|
|
632
|
+
* - ✅ WCAG 2.1 AA compliant using semantic HTML
|
|
633
|
+
* - ✅ Native keyboard support (Space, Enter)
|
|
634
|
+
* - ✅ Screen reader compatible (announced as "disclosure" or "expandable")
|
|
635
|
+
* - ✅ Focus indicators automatically applied via CSS
|
|
636
|
+
* - ✅ `aria-expanded` managed automatically by browser
|
|
637
|
+
*
|
|
638
|
+
* @example
|
|
639
|
+
* ```tsx
|
|
640
|
+
* // Basic usage
|
|
641
|
+
* <Details summary="Click to expand">
|
|
642
|
+
* <p>Hidden content here</p>
|
|
643
|
+
* </Details>
|
|
644
|
+
* ```
|
|
645
|
+
*
|
|
646
|
+
* @example
|
|
647
|
+
* ```tsx
|
|
648
|
+
* // With icon and custom styling
|
|
649
|
+
* <Details
|
|
650
|
+
* summary="Shipping Information"
|
|
651
|
+
* icon={<ChevronDownIcon />}
|
|
652
|
+
* classes="custom-details"
|
|
653
|
+
* onToggle={(e) => console.log('Open:', e.currentTarget.open)}
|
|
654
|
+
* >
|
|
655
|
+
* <p>Ships within 2-3 business days</p>
|
|
656
|
+
* </Details>
|
|
657
|
+
* ```
|
|
658
|
+
*
|
|
659
|
+
* @example
|
|
660
|
+
* ```tsx
|
|
661
|
+
* // Accordion mode - only one open at a time
|
|
662
|
+
* <Details name="faq" summary="Question 1">Answer 1</Details>
|
|
663
|
+
* <Details name="faq" summary="Question 2">Answer 2</Details>
|
|
664
|
+
* <Details name="faq" summary="Question 3">Answer 3</Details>
|
|
665
|
+
* ```
|
|
179
666
|
*/
|
|
180
|
-
declare const Details:
|
|
181
|
-
({ summary, icon, styles, classes, ariaLabel, name, open, onPointerDown, onToggle, children, ref, ...props }: DetailsProps): React__default.JSX.Element;
|
|
182
|
-
displayName: string;
|
|
183
|
-
};
|
|
667
|
+
declare const Details: React__default.ForwardRefExoticComponent<Omit<DetailsProps, "ref"> & React__default.RefAttributes<HTMLDetailsElement>>;
|
|
184
668
|
|
|
185
|
-
export { Article, Aside, Caption, ComponentProps$1 as ComponentProps, Details, Footer, Header,
|
|
669
|
+
export { Article, Aside, Badge, BadgeProps, Caption, ComponentProps$1 as ComponentProps, Details, Footer, Header, Img, ImgProps, Landmarks, Main, Section, Table, Tag, TagProps, Tbody, Td, TextToSpeech, Thead, Tr };
|
package/libs/index.js
CHANGED
|
@@ -1,28 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { a as
|
|
4
|
-
export { a as Field } from './chunk-BIP2NY53.js';
|
|
1
|
+
import { b } from './chunk-XBA562WW.js';
|
|
2
|
+
export { a as Textarea } from './chunk-XBA562WW.js';
|
|
3
|
+
export { a as Field } from './chunk-RIVUMPOG.js';
|
|
5
4
|
export { a as Caption, i as TBL, f as Table, c as Tbody, e as Td, b as Thead, d as Tr } from './chunk-5M57K4SW.js';
|
|
6
|
-
export { a as Dialog } from './chunk-
|
|
7
|
-
export { c as Nav, b as NavItem, a as NavList } from './chunk-
|
|
8
|
-
export { b as List } from './chunk-
|
|
5
|
+
export { a as Dialog } from './chunk-VUH3FXGJ.js';
|
|
6
|
+
export { c as Nav, b as NavItem, a as NavList } from './chunk-2Y7W75TT.js';
|
|
7
|
+
export { b as List } from './chunk-SMYRLO3E.js';
|
|
9
8
|
export { b as Popover } from './chunk-23ANBDCR.js';
|
|
10
|
-
export { a as Text
|
|
11
|
-
|
|
9
|
+
export { a as Text } from './chunk-NGTJDDFO.js';
|
|
10
|
+
export { b as Heading, a as Title } from './chunk-ETFLFC2S.js';
|
|
11
|
+
export { b as Breadcrumb, a as useBreadcrumbSegments } from './chunk-GZ4QFPRY.js';
|
|
12
12
|
import './chunk-GCGKYLDG.js';
|
|
13
|
-
import { b as b$1 } from './chunk-
|
|
14
|
-
export { a as Icon } from './chunk-
|
|
15
|
-
export { d as Card, b as CardContent, c as CardFooter, a as CardTitle } from './chunk-
|
|
16
|
-
export { a as Modal } from './chunk-
|
|
17
|
-
export { a as Button } from './chunk-
|
|
13
|
+
import { b as b$1 } from './chunk-772NRB75.js';
|
|
14
|
+
export { a as Icon } from './chunk-772NRB75.js';
|
|
15
|
+
export { d as Card, b as CardContent, c as CardFooter, a as CardTitle } from './chunk-JJ43O4Y5.js';
|
|
16
|
+
export { a as Modal } from './chunk-ZANSFMTD.js';
|
|
17
|
+
export { a as Button } from './chunk-QLZWHAMK.js';
|
|
18
18
|
export { a as Input } from './chunk-BHRQBJRY.js';
|
|
19
19
|
export { a as Box, a as FP } from './chunk-P7TTEYCD.js';
|
|
20
|
-
export { a as Link, b as To } from './chunk-
|
|
21
|
-
import { a } from './chunk-
|
|
22
|
-
import
|
|
20
|
+
export { a as Link, b as To } from './chunk-TYRCEX2L.js';
|
|
21
|
+
import { a } from './chunk-KUKIVRC2.js';
|
|
22
|
+
import u, { useCallback, useMemo, useState, useEffect } from 'react';
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var M=({src:e="//",alt:t,width:s=480,height:n,styles:r,loading:l="lazy",placeholder:m,fetchpriority:c="low",decoding:d="auto",srcSet:T,sizes:x,onError:y,onLoad:P,...C})=>{let h=useMemo(()=>{let o=typeof s=="number"?s:480,p=typeof n=="number"?n:Math.round(o*.75),i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${o} ${p}">
|
|
25
|
+
<defs>
|
|
26
|
+
<linearGradient id="grad-${o}-${p}" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
27
|
+
<stop offset="0%" style="stop-color:#6366f1;stop-opacity:1" />
|
|
28
|
+
<stop offset="50%" style="stop-color:#8b5cf6;stop-opacity:1" />
|
|
29
|
+
<stop offset="100%" style="stop-color:#ec4899;stop-opacity:1" />
|
|
30
|
+
</linearGradient>
|
|
31
|
+
</defs>
|
|
32
|
+
<rect width="${o}" height="${p}" fill="url(#grad-${o}-${p})"/>
|
|
33
|
+
<circle cx="${o*.15}" cy="${p*.2}" r="${Math.min(o,p)*.08}" fill="rgba(255,255,255,0.2)"/>
|
|
34
|
+
<path d="M0,${p*.75} Q${o*.25},${p*.65} ${o*.5},${p*.75} T${o},${p*.75} L${o},${p} L0,${p} Z" fill="rgba(0,0,0,0.15)"/>
|
|
35
|
+
<text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-family="system-ui,-apple-system,sans-serif" font-size="${Math.max(16,Math.min(o,p)*.05)}" font-weight="500" fill="rgba(255,255,255,0.9)">${o}\xD7${p}</text>
|
|
36
|
+
</svg>`;return `data:image/svg+xml,${encodeURIComponent(i)}`},[s,n]),w=m??h;return u.createElement(a,{as:"img",src:e,alt:t,width:s,height:n||"auto",loading:l,style:r,srcSet:T,sizes:x,onError:o=>{y&&y(o),o.defaultPrevented||o.currentTarget.src!==w&&(o.currentTarget.src=w);},onLoad:o=>{P?.(o);},decoding:d,...C,...c&&{fetchpriority:c}})};M.displayName="Img";var V=e=>{let[t,s]=useState([]),[n,r]=useState(e),[l,m]=useState(!1),[c,d]=useState(!1),[T,x]=useState(null);return useEffect(()=>{let f=()=>{let o=window.speechSynthesis.getVoices();s(o);let p=o.find(i=>i.name==="Google US English");if(p)r(p);else {let i=o.find($=>$.lang.startsWith("en-"));i&&r(i);}};return f(),window.speechSynthesis.onvoiceschanged=f,()=>{window.speechSynthesis.onvoiceschanged=null;}},[]),{speak:(f,o={},p)=>{let i=new SpeechSynthesisUtterance(f);i.lang=o.lang??"en-US",i.pitch=o.pitch??1,i.rate=o.rate??1,i.voice=n??o.voice??null,i.onend=()=>{m(!1),d(!1),p&&p();},"speechSynthesis"in window?(window.speechSynthesis.speak(i),x(i),m(!0),d(!1)):console.error("Speech synthesis not supported");},pause:()=>{l&&!c&&(window.speechSynthesis.pause(),d(!0));},resume:()=>{l&&c&&(window.speechSynthesis.resume(),d(!1));},cancel:()=>{l&&(window.speechSynthesis.cancel(),m(!1),d(!1));},isSpeaking:l,isPaused:c,availableVoices:t,changeVoice:f=>{r(f);},currentVoice:n,getAvailableLanguages:()=>[...new Set(t.map(f=>f.lang))]}};var pe=({children:e,onClick:t})=>u.createElement(a,{as:"button",type:"button",className:"tts-border","data-btn":"sm text pill",onClick:t},e),U=u.memo(pe),L=({label:e,isSpeaking:t,isPaused:s,onSpeak:n,onPause:r,onResume:l,onCancel:m})=>u.createElement(a,{as:"div","data-tts":!0},e&&u.createElement("p",null,e),!t&&u.createElement(U,{"aria-label":"Speak",onClick:n},u.createElement(b$1.PlaySolid,{size:16})),t&&!s&&u.createElement(U,{"aria-label":"Pause",onClick:r},u.createElement(b$1.PauseSolid,{size:16})),s&&u.createElement(U,{"aria-label":"Resume",onClick:l},u.createElement(b$1.ResumeSolid,{size:16})),u.createElement(U,{"aria-label":"Stop",onClick:m},u.createElement(b$1.StopSolid,{size:16})));L.displayName="TextToSpeechControls";L.TTSButton=U;var H=L;var z=({initialText:e="",showTextInput:t=!1,voice:s,pitch:n=1,rate:r=1,language:l,label:m,onEnd:c})=>{let{speak:d,pause:T,resume:x,cancel:y,isSpeaking:P,isPaused:C,getAvailableLanguages:h,availableVoices:w}=V(),[I,f]=useState(e);console.log(h()),useEffect(()=>{f(e);},[e]);let o=()=>{I.trim()!==""&&d(I,{voice:s,pitch:n,rate:r},i);},p=$=>{f($.target.value);},i=()=>{c&&c();};return u.createElement(u.Fragment,null,t&&u.createElement(b,{value:I,onChange:p}),u.createElement(H,{label:m,isSpeaking:P,isPaused:C,onSpeak:o,onPause:T,onResume:x,onCancel:y}))};z.displayName="TextToSpeechComponent";var S=e=>u.createElement(u.Fragment,null,e),ce=({id:e,children:t,headerBackground:s,styles:n,classes:r,...l})=>u.createElement(a,{as:"header",id:e,styles:n,className:r,...l},s,u.createElement(a,{as:"section"},t)),me=({id:e,children:t,styles:s,classes:n,...r})=>u.createElement(a,{as:"main",id:e,styles:s,...r,className:n},t),de=({id:e,classes:t,children:s,styles:n={},...r})=>u.createElement(a,{as:"footer",id:e,className:t,styles:n,...r},u.createElement(a,{as:"section"},s||"Copyright \xA9 2022")),fe=({id:e,children:t,styles:s={},classes:n,...r})=>u.createElement(a,{as:"aside",id:e,styles:s,className:n,...r},u.createElement(a,{as:"section"},t)),ue=({id:e,children:t,styles:s,classes:n,...r})=>u.createElement(a,{as:"section",id:e,styles:s,className:n,...r},t),ge=({id:e,children:t,styles:s,classes:n,...r})=>u.createElement(a,{as:"article",id:e,styles:s,className:n,...r},t);S.displayName="Landmarks";S.Header=ce;S.Main=me;S.Footer=de;S.Aside=fe;S.Section=ue;S.Article=ge;var A=({id:e,styles:t,classes:s,children:n,variant:r,...l})=>u.createElement(a,{as:"sup",id:e,styles:t,className:s,"data-badge":r||void 0,role:"status",...l},u.createElement(a,{as:"span"},n));A.displayName="Badge";var xe=({elm:e="span",role:t="note",children:s,styles:n,...r})=>u.createElement(a,{as:e,role:t,styles:n,...r},s);xe.displayName="Tag";var ye=u.forwardRef(({summary:e,icon:t,styles:s,classes:n,ariaLabel:r,name:l,open:m,onPointerDown:c,onToggle:d,children:T,...x},y)=>{let P=useCallback(h=>{c?.(h);},[c]),C=useCallback(h=>{d?.(h);},[d]);return u.createElement(a,{as:"details",styles:s,classes:n,onToggle:C,ref:y,open:m,"aria-label":r,name:l,...x},u.createElement(a,{as:"summary",onPointerDown:P},t,e),u.createElement(a,{as:"section"},T))});ye.displayName="Details";
|
|
25
37
|
|
|
26
|
-
export {
|
|
38
|
+
export { ge as Article, fe as Aside, A as Badge, ye as Details, de as Footer, ce as Header, M as Img, S as Landmarks, me as Main, ue as Section, xe as Tag, z as TextToSpeech };
|
|
27
39
|
//# sourceMappingURL=out.js.map
|
|
28
40
|
//# sourceMappingURL=index.js.map
|