@fpkit/acss 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/libs/components/alert/alert.min.min.css +2 -0
  2. package/libs/components/badge/badge.min.min.css +2 -0
  3. package/libs/components/breadcrumbs/breadcrumb.min.min.css +2 -0
  4. package/libs/components/buttons/button.min.min.css +2 -0
  5. package/libs/components/cards/card-style.min.min.css +2 -0
  6. package/libs/components/cards/card.min.min.css +2 -0
  7. package/libs/components/details/details.min.min.css +2 -0
  8. package/libs/components/dialog/dialog.min.min.css +2 -0
  9. package/libs/components/form/form.min.min.css +2 -0
  10. package/libs/components/icons/icon.d.cts +4 -445
  11. package/libs/components/icons/icon.d.ts +4 -445
  12. package/libs/components/icons/icon.min.min.css +2 -0
  13. package/libs/components/images/img.min.min.css +2 -0
  14. package/libs/components/layout/landmarks.min.min.css +2 -0
  15. package/libs/components/link/link.min.min.css +2 -0
  16. package/libs/components/list/list.min.min.css +2 -0
  17. package/libs/components/nav/nav.css +1 -1
  18. package/libs/components/nav/nav.css.map +1 -1
  19. package/libs/components/nav/nav.min.css +2 -2
  20. package/libs/components/nav/nav.min.min.css +2 -0
  21. package/libs/components/progress/progress.min.min.css +2 -0
  22. package/libs/components/styles/index.min.min.css +2 -0
  23. package/libs/components/tag/tag.min.min.css +2 -0
  24. package/libs/components/text-to-speech/text-to-speech.min.min.css +2 -0
  25. package/libs/icons-287fce3a.d.ts +445 -0
  26. package/libs/icons.d.cts +1 -1
  27. package/libs/icons.d.ts +1 -1
  28. package/libs/index.cjs +26 -21
  29. package/libs/index.cjs.map +1 -1
  30. package/libs/index.css +1 -1
  31. package/libs/index.css.map +1 -1
  32. package/libs/index.d.cts +159 -3
  33. package/libs/index.d.ts +159 -3
  34. package/libs/index.js +12 -10
  35. package/libs/index.js.map +1 -1
  36. package/package.json +2 -2
  37. package/src/components/alert/alert.tsx +2 -3
  38. package/src/components/nav/nav.scss +1 -1
  39. package/src/components/nav/nav.stories.tsx +4 -0
  40. package/src/index.ts +7 -1
  41. package/src/styles/index.css +3 -3
  42. package/src/styles/nav/nav.css +3 -3
package/libs/index.d.cts CHANGED
@@ -1,9 +1,10 @@
1
1
  export { Button, ButtonProps } from './components/button.cjs';
2
2
  export { Card, Content as CardContent, Footer as CardFooter, CardProps, Title as CardTitle } from './components/card.cjs';
3
+ import React, { ReactNode } from 'react';
4
+ import { I as IconProps } from './icons-287fce3a.js';
5
+ export { a as Icon, b as IconProps } from './icons-287fce3a.js';
3
6
  export { default as Field, FieldProps } from './components/form/fields.cjs';
4
7
  export { default as Input } from './components/form/inputs.cjs';
5
- export { default as Icon, IconProps } from './components/icons/icon.cjs';
6
- import React, { ReactNode } from 'react';
7
8
  export { default as Link, default as To } from './components/link/link.cjs';
8
9
  export { List } from './components/list/list.cjs';
9
10
  export { Modal, ModalProps } from './components/modal.cjs';
@@ -20,6 +21,161 @@ export { default as Breadcrumb, BreadcrumbProps, CustomRoute, useBreadcrumbSegme
20
21
  export { I as InputProps, T as TextareaProps } from './form.types-d25ebfac.js';
21
22
  export { L as ListItemProps } from './list.types-d26de310.js';
22
23
 
24
+ /**
25
+ * Valid severity levels for alerts.
26
+ * Each severity has associated colors, icons, and ARIA attributes.
27
+ */
28
+ type Severity = "default" | "info" | "success" | "warning" | "error";
29
+ /**
30
+ * Props for the Alert component.
31
+ */
32
+ type AlertProps = {
33
+ /**
34
+ * Whether the alert is open.
35
+ */
36
+ open: boolean;
37
+ /**
38
+ * The severity level of the alert.
39
+ * @default "default"
40
+ */
41
+ severity?: Severity;
42
+ /**
43
+ * The main message content.
44
+ */
45
+ children: React.ReactNode;
46
+ /**
47
+ * Optional title for the alert.
48
+ */
49
+ title?: string;
50
+ /**
51
+ * Whether the alert can be dismissed.
52
+ * @default false
53
+ */
54
+ dismissible?: boolean;
55
+ /**
56
+ * Callback when alert is dismissed.
57
+ */
58
+ onDismiss?: () => void;
59
+ /**
60
+ * Size of the severity icon in pixels.
61
+ * Allows customization of icon size for different contexts.
62
+ * @default 24
63
+ * @example
64
+ * ```tsx
65
+ * <Alert iconSize={32} severity="error">Larger icon</Alert>
66
+ * <Alert iconSize={16} severity="info">Smaller icon</Alert>
67
+ * ```
68
+ */
69
+ iconSize?: number;
70
+ /**
71
+ * Whether to hide the severity icon.
72
+ * When true, only text content is displayed.
73
+ * @default false
74
+ */
75
+ hideIcon?: boolean;
76
+ /**
77
+ * Additional props to pass to the Icon component.
78
+ * Allows fine-grained control over icon appearance.
79
+ * @example
80
+ * ```tsx
81
+ * <Alert iconProps={{ className: 'custom-icon', 'aria-label': 'Custom' }}>
82
+ * Alert with custom icon props
83
+ * </Alert>
84
+ * ```
85
+ */
86
+ iconProps?: IconProps;
87
+ /**
88
+ * Duration in milliseconds before the alert automatically dismisses.
89
+ * Set to 0 or undefined to disable auto-dismiss.
90
+ * @default undefined
91
+ * @example
92
+ * ```tsx
93
+ * <Alert autoHideDuration={5000}>Success message</Alert>
94
+ * ```
95
+ */
96
+ autoHideDuration?: number;
97
+ /**
98
+ * Whether to pause auto-dismiss when the alert is hovered or focused.
99
+ * Complies with WCAG 2.2.1 (Timing Adjustable).
100
+ * @default true
101
+ */
102
+ pauseOnHover?: boolean;
103
+ /**
104
+ * Semantic heading level for the title (2-6).
105
+ * When undefined, uses <strong> element instead of heading.
106
+ * Use this to maintain proper heading hierarchy on the page.
107
+ * @default undefined
108
+ * @example
109
+ * ```tsx
110
+ * <Alert titleLevel={2} title="Section Alert">...</Alert>
111
+ * <Alert titleLevel={3} title="Subsection Alert">...</Alert>
112
+ * ```
113
+ */
114
+ titleLevel?: 2 | 3 | 4 | 5 | 6;
115
+ /**
116
+ * Custom action buttons to display in the alert.
117
+ * @example
118
+ * ```tsx
119
+ * <Alert actions={<><Button>Undo</Button><Button>Dismiss</Button></>}>
120
+ * File deleted
121
+ * </Alert>
122
+ * ```
123
+ */
124
+ actions?: React.ReactNode;
125
+ /**
126
+ * Whether to automatically focus the alert when it becomes visible.
127
+ * Useful for critical alerts that require immediate attention.
128
+ * @default false
129
+ */
130
+ autoFocus?: boolean;
131
+ /**
132
+ * Visual variant of the alert.
133
+ * - outlined: Border with lighter background (default)
134
+ * - filled: Solid colored background
135
+ * - soft: No border, subtle background
136
+ * @default "outlined"
137
+ */
138
+ variant?: "outlined" | "filled" | "soft";
139
+ /**
140
+ * Content rendering mode for alert children.
141
+ * Determines how the children content is wrapped in the alert message area.
142
+ * - "text": Wraps children in a paragraph tag (default, for simple text content)
143
+ * - "node": Renders children directly without wrapper (for complex layouts, lists, or custom components)
144
+ * @default "text"
145
+ * @example Simple text content (uses default "text" mode)
146
+ * ```tsx
147
+ * <Alert severity="info">
148
+ * This is a simple text message that will be wrapped in a paragraph.
149
+ * </Alert>
150
+ * ```
151
+ * @example Complex content with list
152
+ * ```tsx
153
+ * <Alert severity="warning" contentType="node">
154
+ * <p>Please review the following items:</p>
155
+ * <ul>
156
+ * <li>Check your email settings</li>
157
+ * <li>Update your password</li>
158
+ * <li>Enable two-factor authentication</li>
159
+ * </ul>
160
+ * </Alert>
161
+ * ```
162
+ * @example Custom component layout
163
+ * ```tsx
164
+ * <Alert severity="success" contentType="node">
165
+ * <div className="custom-layout">
166
+ * <p>Operation completed successfully!</p>
167
+ * <div className="stats">
168
+ * <span>Items processed: 150</span>
169
+ * <span>Time elapsed: 2.5s</span>
170
+ * </div>
171
+ * </div>
172
+ * </Alert>
173
+ * ```
174
+ */
175
+ contentType?: "text" | "node";
176
+ } & Omit<React.HTMLAttributes<HTMLDivElement>, "title" | "children">;
177
+ declare const Alert: React.FC<AlertProps>;
178
+
23
179
  /**
24
180
  * Props for the Img component.
25
181
  *
@@ -1190,4 +1346,4 @@ type FPComponent = {
1190
1346
  */
1191
1347
  declare const FP: FPComponent;
1192
1348
 
1193
- export { Article, Aside, Badge, BadgeProps, FP as Box, Caption, ComponentProps$1 as ComponentProps, Details, FP, Footer, Header, Img, ImgProps, Landmarks, LinkProps, Main, Section, Table, Tag, TagProps, TagVariant, Tbody, Td, TextToSpeech, Thead, Tr };
1349
+ export { Alert, AlertProps, Article, Aside, Badge, BadgeProps, FP as Box, Caption, ComponentProps$1 as ComponentProps, Details, FP, Footer, Header, Img, ImgProps, Landmarks, LinkProps, Main, Section, Table, Tag, TagProps, TagVariant, Tbody, Td, TextToSpeech, Thead, Tr, UI };
package/libs/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  export { Button, ButtonProps } from './components/button.js';
2
2
  export { Card, Content as CardContent, Footer as CardFooter, CardProps, Title as CardTitle } from './components/card.js';
3
+ import React, { ReactNode } from 'react';
4
+ import { I as IconProps } from './icons-287fce3a.js';
5
+ export { a as Icon, b as IconProps } from './icons-287fce3a.js';
3
6
  export { default as Field, FieldProps } from './components/form/fields.js';
4
7
  export { default as Input } from './components/form/inputs.js';
5
- export { default as Icon, IconProps } from './components/icons/icon.js';
6
- import React, { ReactNode } from 'react';
7
8
  export { default as Link, default as To } from './components/link/link.js';
8
9
  export { List } from './components/list/list.js';
9
10
  export { Modal, ModalProps } from './components/modal.js';
@@ -20,6 +21,161 @@ export { default as Breadcrumb, BreadcrumbProps, CustomRoute, useBreadcrumbSegme
20
21
  export { I as InputProps, T as TextareaProps } from './form.types-d25ebfac.js';
21
22
  export { L as ListItemProps } from './list.types-d26de310.js';
22
23
 
24
+ /**
25
+ * Valid severity levels for alerts.
26
+ * Each severity has associated colors, icons, and ARIA attributes.
27
+ */
28
+ type Severity = "default" | "info" | "success" | "warning" | "error";
29
+ /**
30
+ * Props for the Alert component.
31
+ */
32
+ type AlertProps = {
33
+ /**
34
+ * Whether the alert is open.
35
+ */
36
+ open: boolean;
37
+ /**
38
+ * The severity level of the alert.
39
+ * @default "default"
40
+ */
41
+ severity?: Severity;
42
+ /**
43
+ * The main message content.
44
+ */
45
+ children: React.ReactNode;
46
+ /**
47
+ * Optional title for the alert.
48
+ */
49
+ title?: string;
50
+ /**
51
+ * Whether the alert can be dismissed.
52
+ * @default false
53
+ */
54
+ dismissible?: boolean;
55
+ /**
56
+ * Callback when alert is dismissed.
57
+ */
58
+ onDismiss?: () => void;
59
+ /**
60
+ * Size of the severity icon in pixels.
61
+ * Allows customization of icon size for different contexts.
62
+ * @default 24
63
+ * @example
64
+ * ```tsx
65
+ * <Alert iconSize={32} severity="error">Larger icon</Alert>
66
+ * <Alert iconSize={16} severity="info">Smaller icon</Alert>
67
+ * ```
68
+ */
69
+ iconSize?: number;
70
+ /**
71
+ * Whether to hide the severity icon.
72
+ * When true, only text content is displayed.
73
+ * @default false
74
+ */
75
+ hideIcon?: boolean;
76
+ /**
77
+ * Additional props to pass to the Icon component.
78
+ * Allows fine-grained control over icon appearance.
79
+ * @example
80
+ * ```tsx
81
+ * <Alert iconProps={{ className: 'custom-icon', 'aria-label': 'Custom' }}>
82
+ * Alert with custom icon props
83
+ * </Alert>
84
+ * ```
85
+ */
86
+ iconProps?: IconProps;
87
+ /**
88
+ * Duration in milliseconds before the alert automatically dismisses.
89
+ * Set to 0 or undefined to disable auto-dismiss.
90
+ * @default undefined
91
+ * @example
92
+ * ```tsx
93
+ * <Alert autoHideDuration={5000}>Success message</Alert>
94
+ * ```
95
+ */
96
+ autoHideDuration?: number;
97
+ /**
98
+ * Whether to pause auto-dismiss when the alert is hovered or focused.
99
+ * Complies with WCAG 2.2.1 (Timing Adjustable).
100
+ * @default true
101
+ */
102
+ pauseOnHover?: boolean;
103
+ /**
104
+ * Semantic heading level for the title (2-6).
105
+ * When undefined, uses <strong> element instead of heading.
106
+ * Use this to maintain proper heading hierarchy on the page.
107
+ * @default undefined
108
+ * @example
109
+ * ```tsx
110
+ * <Alert titleLevel={2} title="Section Alert">...</Alert>
111
+ * <Alert titleLevel={3} title="Subsection Alert">...</Alert>
112
+ * ```
113
+ */
114
+ titleLevel?: 2 | 3 | 4 | 5 | 6;
115
+ /**
116
+ * Custom action buttons to display in the alert.
117
+ * @example
118
+ * ```tsx
119
+ * <Alert actions={<><Button>Undo</Button><Button>Dismiss</Button></>}>
120
+ * File deleted
121
+ * </Alert>
122
+ * ```
123
+ */
124
+ actions?: React.ReactNode;
125
+ /**
126
+ * Whether to automatically focus the alert when it becomes visible.
127
+ * Useful for critical alerts that require immediate attention.
128
+ * @default false
129
+ */
130
+ autoFocus?: boolean;
131
+ /**
132
+ * Visual variant of the alert.
133
+ * - outlined: Border with lighter background (default)
134
+ * - filled: Solid colored background
135
+ * - soft: No border, subtle background
136
+ * @default "outlined"
137
+ */
138
+ variant?: "outlined" | "filled" | "soft";
139
+ /**
140
+ * Content rendering mode for alert children.
141
+ * Determines how the children content is wrapped in the alert message area.
142
+ * - "text": Wraps children in a paragraph tag (default, for simple text content)
143
+ * - "node": Renders children directly without wrapper (for complex layouts, lists, or custom components)
144
+ * @default "text"
145
+ * @example Simple text content (uses default "text" mode)
146
+ * ```tsx
147
+ * <Alert severity="info">
148
+ * This is a simple text message that will be wrapped in a paragraph.
149
+ * </Alert>
150
+ * ```
151
+ * @example Complex content with list
152
+ * ```tsx
153
+ * <Alert severity="warning" contentType="node">
154
+ * <p>Please review the following items:</p>
155
+ * <ul>
156
+ * <li>Check your email settings</li>
157
+ * <li>Update your password</li>
158
+ * <li>Enable two-factor authentication</li>
159
+ * </ul>
160
+ * </Alert>
161
+ * ```
162
+ * @example Custom component layout
163
+ * ```tsx
164
+ * <Alert severity="success" contentType="node">
165
+ * <div className="custom-layout">
166
+ * <p>Operation completed successfully!</p>
167
+ * <div className="stats">
168
+ * <span>Items processed: 150</span>
169
+ * <span>Time elapsed: 2.5s</span>
170
+ * </div>
171
+ * </div>
172
+ * </Alert>
173
+ * ```
174
+ */
175
+ contentType?: "text" | "node";
176
+ } & Omit<React.HTMLAttributes<HTMLDivElement>, "title" | "children">;
177
+ declare const Alert: React.FC<AlertProps>;
178
+
23
179
  /**
24
180
  * Props for the Img component.
25
181
  *
@@ -1190,4 +1346,4 @@ type FPComponent = {
1190
1346
  */
1191
1347
  declare const FP: FPComponent;
1192
1348
 
1193
- export { Article, Aside, Badge, BadgeProps, FP as Box, Caption, ComponentProps$1 as ComponentProps, Details, FP, Footer, Header, Img, ImgProps, Landmarks, LinkProps, Main, Section, Table, Tag, TagProps, TagVariant, Tbody, Td, TextToSpeech, Thead, Tr };
1349
+ export { Alert, AlertProps, Article, Aside, Badge, BadgeProps, FP as Box, Caption, ComponentProps$1 as ComponentProps, Details, FP, Footer, Header, Img, ImgProps, Landmarks, LinkProps, Main, Section, Table, Tag, TagProps, TagVariant, Tbody, Td, TextToSpeech, Thead, Tr, UI };
package/libs/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b } from './chunk-IRLFZ3OL.js';
1
+ import { b as b$2 } from './chunk-IRLFZ3OL.js';
2
2
  export { a as Textarea } from './chunk-IRLFZ3OL.js';
3
3
  export { a as Field } from './chunk-HRRHPLER.js';
4
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-Y2PFDELK.js';
@@ -14,6 +14,7 @@ import { b as b$1 } from './chunk-5QD3DWFI.js';
14
14
  export { a as Icon } from './chunk-5QD3DWFI.js';
15
15
  export { d as Card, b as CardContent, c as CardFooter, a as CardTitle } from './chunk-KK47SYZI.js';
16
16
  export { a as Modal } from './chunk-43TK2ICH.js';
17
+ import { b } from './chunk-KVKQLRJG.js';
17
18
  export { a as Button } from './chunk-KVKQLRJG.js';
18
19
  export { a as Input } from './chunk-F5EYMVQM.js';
19
20
  export { a as Box, a as FP } from './chunk-6SAHIYCZ.js';
@@ -21,22 +22,23 @@ import './chunk-BFK62VX5.js';
21
22
  import './chunk-75QHTLFO.js';
22
23
  export { a as Link, d as To } from './chunk-NNTBIHSD.js';
23
24
  import { a } from './chunk-HHLNOC5T.js';
24
- import u, { useCallback, useMemo, useState, useEffect } from 'react';
25
+ export { a as UI } from './chunk-HHLNOC5T.js';
26
+ import v, { useCallback, useMemo, useState, useEffect } from 'react';
25
27
 
26
- var V=({src:e="//",alt:s,width:t=480,height:n,styles:r,loading:i="lazy",placeholder:c,fetchpriority:m="low",decoding:d="auto",srcSet:T,sizes:x,onError:y,onLoad:P,...C})=>{let h=useMemo(()=>{let o=typeof t=="number"?t:480,p=typeof n=="number"?n:Math.round(o*.75),l=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${o} ${p}">
28
+ var ve={default:"",info:"Information: ",success:"Success: ",warning:"Warning: ",error:"Error: "},M=({severity:e})=>{let t=ve[e];return t?v.createElement("span",{className:"sr-only"},t):null};var Pe=(e,t)=>({info:v.createElement(b$1.InfoSolid,{...t}),success:v.createElement(b$1.SuccessSolid,{...t}),warning:v.createElement(b$1.WarnSolid,{...t}),error:v.createElement(b$1.AlertSolid,{...t}),default:v.createElement(b$1.AlertSquareSolid,{...t})})[e],R=({severity:e,iconProps:t,hideIcon:r})=>{if(r)return null;let o=Pe(e,t);return v.createElement(a,{"aria-hidden":"true",className:"alert-icon"},o)};var D=({title:e,titleLevel:t})=>{if(!e)return null;let r=t?`h${t}`:"strong";return v.createElement(a,{as:r,className:"alert-title"},e)};var z=({children:e,contentType:t})=>t==="node"?v.createElement(v.Fragment,null,e):v.createElement(a,{as:"p"},e);var H=({actions:e})=>e?v.createElement(a,{as:"div",className:"alert-actions"},e):null;var X=v.memo(({onDismiss:e,iconSize:t=16})=>v.createElement(b,{type:"button",onClick:e,"aria-label":"Close alert",className:"alert-dismiss","data-btn":"icon sm"},v.createElement(b$1,null,v.createElement(b$1.Close,{size:t})))),J=X;X.displayName="DismissButton";var Ee={default:"polite",info:"polite",success:"polite",warning:"polite",error:"assertive"},k=v.forwardRef(({severity:e,variant:t,isVisible:r,dismissible:o,onDismiss:s,onInteractionStart:i,onInteractionEnd:c,autoFocus:l,title:m,titleLevel:I,children:y,contentType:g,actions:T,hideIcon:f,iconProps:S,...C},x)=>v.createElement(a,{as:"div",ref:x,role:"alert","aria-live":Ee[e],"aria-atomic":"true",className:`alert alert-${e}`,"data-alert":e,"data-visible":r,"data-variant":t,tabIndex:l?-1:void 0,onMouseEnter:i,onMouseLeave:c,onFocus:i,onBlur:c,...C},v.createElement(M,{severity:e}),v.createElement(R,{severity:e,iconProps:S,hideIcon:f}),v.createElement(a,{as:"div",className:"alert-message"},v.createElement(D,{title:m,titleLevel:I}),v.createElement(z,{contentType:g},y),v.createElement(H,{actions:T})),o&&v.createElement(J,{onDismiss:s})));k.displayName="AlertView";var Ae=({open:e,onDismiss:t,dismissible:r,autoHideDuration:o,pauseOnHover:s,autoFocus:i,alertRef:c})=>{let[l,m]=v.useState(e),[I,y]=v.useState(e),[g,T]=v.useState(!1),f=v.useCallback(()=>{m(!1),setTimeout(()=>{y(!1),t?.();},300);},[t]);v.useEffect(()=>{e?(y(!0),m(!0)):m(!1);},[e]),v.useEffect(()=>{if(!o||!l||g)return;let x=setTimeout(()=>{f();},o);return ()=>clearTimeout(x)},[o,l,g,f]),v.useEffect(()=>{if(!r||!l)return;let x=u=>{u.key==="Escape"&&f();};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r,l,f]),v.useEffect(()=>{i&&l&&c.current&&c.current.focus();},[i,l,c]);let S=v.useCallback(()=>{s&&o&&T(!0);},[s,o]),C=v.useCallback(()=>{s&&o&&T(!1);},[s,o]);return {isVisible:l,shouldRender:I,handleDismiss:f,handleInteractionStart:S,handleInteractionEnd:C}},K=({open:e,severity:t="default",children:r,title:o,dismissible:s=!1,onDismiss:i,iconSize:c,iconProps:l,hideIcon:m,autoHideDuration:I,pauseOnHover:y=!0,titleLevel:g=3,actions:T,autoFocus:f=!1,variant:S="outlined",contentType:C="text",...x})=>{let u=v.useRef(null),{isVisible:a,shouldRender:p,handleDismiss:d,handleInteractionStart:U,handleInteractionEnd:oe}=Ae({open:e,onDismiss:i,dismissible:s,autoHideDuration:I,pauseOnHover:y,autoFocus:f,alertRef:u});if(!p)return null;let re={size:c||16,...l};return v.createElement(k,{ref:u,severity:t,variant:S,isVisible:a,dismissible:s,onDismiss:d,onInteractionStart:U,onInteractionEnd:oe,autoFocus:f,title:o,titleLevel:g,contentType:C,actions:T,hideIcon:m,iconProps:re,...x},r)};K.displayName="Alert";var Y=({src:e="//",alt:t,width:r=480,height:o,styles:s,loading:i="lazy",placeholder:c,fetchpriority:l="low",decoding:m="auto",srcSet:I,sizes:y,onError:g,onLoad:T,...f})=>{let S=useMemo(()=>{let a=typeof r=="number"?r:480,p=typeof o=="number"?o:Math.round(a*.75),d=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${a} ${p}">
27
29
  <defs>
28
- <linearGradient id="grad-${o}-${p}" x1="0%" y1="0%" x2="100%" y2="100%">
30
+ <linearGradient id="grad-${a}-${p}" x1="0%" y1="0%" x2="100%" y2="100%">
29
31
  <stop offset="0%" style="stop-color:#6366f1;stop-opacity:1" />
30
32
  <stop offset="50%" style="stop-color:#8b5cf6;stop-opacity:1" />
31
33
  <stop offset="100%" style="stop-color:#ec4899;stop-opacity:1" />
32
34
  </linearGradient>
33
35
  </defs>
34
- <rect width="${o}" height="${p}" fill="url(#grad-${o}-${p})"/>
35
- <circle cx="${o*.15}" cy="${p*.2}" r="${Math.min(o,p)*.08}" fill="rgba(255,255,255,0.2)"/>
36
- <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)"/>
37
- <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>
38
- </svg>`;return `data:image/svg+xml,${encodeURIComponent(l)}`},[t,n]),w=c??h;return u.createElement(a,{as:"img",src:e,alt:s,width:t,height:n||"auto",loading:i,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,...m&&{fetchpriority:m}})};V.displayName="Img";var M=e=>{let[s,t]=useState([]),[n,r]=useState(e),[i,c]=useState(!1),[m,d]=useState(!1),[T,x]=useState(null);return useEffect(()=>{let f=()=>{let o=window.speechSynthesis.getVoices();t(o);let p=o.find(l=>l.name==="Google US English");if(p)r(p);else {let l=o.find($=>$.lang.startsWith("en-"));l&&r(l);}};return f(),window.speechSynthesis.onvoiceschanged=f,()=>{window.speechSynthesis.onvoiceschanged=null;}},[]),{speak:(f,o={},p)=>{let l=new SpeechSynthesisUtterance(f);l.lang=o.lang??"en-US",l.pitch=o.pitch??1,l.rate=o.rate??1,l.voice=n??o.voice??null,l.onend=()=>{c(!1),d(!1),p&&p();},"speechSynthesis"in window?(window.speechSynthesis.speak(l),x(l),c(!0),d(!1)):console.error("Speech synthesis not supported");},pause:()=>{i&&!m&&(window.speechSynthesis.pause(),d(!0));},resume:()=>{i&&m&&(window.speechSynthesis.resume(),d(!1));},cancel:()=>{i&&(window.speechSynthesis.cancel(),c(!1),d(!1));},isSpeaking:i,isPaused:m,availableVoices:s,changeVoice:f=>{r(f);},currentVoice:n,getAvailableLanguages:()=>[...new Set(s.map(f=>f.lang))]}};var pe=({children:e,onClick:s})=>u.createElement(a,{as:"button",type:"button",className:"tts-border","data-btn":"sm text pill",onClick:s},e),U=u.memo(pe),L=({label:e,isSpeaking:s,isPaused:t,onSpeak:n,onPause:r,onResume:i,onCancel:c})=>u.createElement(a,{as:"div","data-tts":!0},e&&u.createElement("p",null,e),!s&&u.createElement(U,{"aria-label":"Speak",onClick:n},u.createElement(b$1.PlaySolid,{size:16})),s&&!t&&u.createElement(U,{"aria-label":"Pause",onClick:r},u.createElement(b$1.PauseSolid,{size:16})),t&&u.createElement(U,{"aria-label":"Resume",onClick:i},u.createElement(b$1.ResumeSolid,{size:16})),u.createElement(U,{"aria-label":"Stop",onClick:c},u.createElement(b$1.StopSolid,{size:16})));L.displayName="TextToSpeechControls";L.TTSButton=U;var H=L;var z=({initialText:e="",showTextInput:s=!1,voice:t,pitch:n=1,rate:r=1,language:i,label:c,onEnd:m})=>{let{speak:d,pause:T,resume:x,cancel:y,isSpeaking:P,isPaused:C,getAvailableLanguages:h,availableVoices:w}=M(),[I,f]=useState(e);console.log(h()),useEffect(()=>{f(e);},[e]);let o=()=>{I.trim()!==""&&d(I,{voice:t,pitch:n,rate:r},l);},p=$=>{f($.target.value);},l=()=>{m&&m();};return u.createElement(u.Fragment,null,s&&u.createElement(b,{value:I,onChange:p}),u.createElement(H,{label:c,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:s,headerBackground:t,styles:n,classes:r,...i})=>u.createElement(a,{as:"header",id:e,styles:n,className:r,...i},t,u.createElement(a,{as:"section"},s)),me=({id:e,children:s,styles:t,classes:n,...r})=>u.createElement(a,{as:"main",id:e,styles:t,...r,className:n},s),de=({id:e,classes:s,children:t,styles:n={},...r})=>u.createElement(a,{as:"footer",id:e,className:s,styles:n,...r},u.createElement(a,{as:"section"},t||"Copyright \xA9 2022")),fe=({id:e,children:s,styles:t={},classes:n,...r})=>u.createElement(a,{as:"aside",id:e,styles:t,className:n,...r},u.createElement(a,{as:"section"},s)),ue=({id:e,children:s,styles:t,classes:n,...r})=>u.createElement(a,{as:"section",id:e,styles:t,className:n,...r},s),ge=({id:e,children:s,styles:t,classes:n,...r})=>u.createElement(a,{as:"article",id:e,styles:t,className:n,...r},s);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:s,classes:t,children:n,variant:r,...i})=>u.createElement(a,{as:"sup",id:e,styles:s,className:t,"data-badge":r||void 0,role:"status",...i},u.createElement(a,{as:"span"},n));A.displayName="Badge";var xe=({elm:e="span",role:s="note",variant:t,children:n,styles:r,...i})=>u.createElement(a,{as:e,role:s,"data-tag":t||void 0,styles:r,...i},n);xe.displayName="Tag";var ye=u.forwardRef(({summary:e,icon:s,styles:t,classes:n,ariaLabel:r,name:i,open:c,onPointerDown:m,onToggle:d,children:T,...x},y)=>{let P=useCallback(h=>{m?.(h);},[m]),C=useCallback(h=>{d?.(h);},[d]);return u.createElement(a,{as:"details",styles:t,classes:n,onToggle:C,ref:y,open:c,"aria-label":r,name:i,...x},u.createElement(a,{as:"summary",onPointerDown:P},s,e),u.createElement(a,{as:"section"},T))});ye.displayName="Details";
36
+ <rect width="${a}" height="${p}" fill="url(#grad-${a}-${p})"/>
37
+ <circle cx="${a*.15}" cy="${p*.2}" r="${Math.min(a,p)*.08}" fill="rgba(255,255,255,0.2)"/>
38
+ <path d="M0,${p*.75} Q${a*.25},${p*.65} ${a*.5},${p*.75} T${a},${p*.75} L${a},${p} L0,${p} Z" fill="rgba(0,0,0,0.15)"/>
39
+ <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(a,p)*.05)}" font-weight="500" fill="rgba(255,255,255,0.9)">${a}\xD7${p}</text>
40
+ </svg>`;return `data:image/svg+xml,${encodeURIComponent(d)}`},[r,o]),C=c??S;return v.createElement(a,{as:"img",src:e,alt:t,width:r,height:o||"auto",loading:i,style:s,srcSet:I,sizes:y,onError:a=>{g&&g(a),a.defaultPrevented||a.currentTarget.src!==C&&(a.currentTarget.src=C);},onLoad:a=>{T?.(a);},decoding:m,...f,...l&&{fetchpriority:l}})};Y.displayName="Img";var j=e=>{let[t,r]=useState([]),[o,s]=useState(e),[i,c]=useState(!1),[l,m]=useState(!1),[I,y]=useState(null);return useEffect(()=>{let u=()=>{let a=window.speechSynthesis.getVoices();r(a);let p=a.find(d=>d.name==="Google US English");if(p)s(p);else {let d=a.find(U=>U.lang.startsWith("en-"));d&&s(d);}};return u(),window.speechSynthesis.onvoiceschanged=u,()=>{window.speechSynthesis.onvoiceschanged=null;}},[]),{speak:(u,a={},p)=>{let d=new SpeechSynthesisUtterance(u);d.lang=a.lang??"en-US",d.pitch=a.pitch??1,d.rate=a.rate??1,d.voice=o??a.voice??null,d.onend=()=>{c(!1),m(!1),p&&p();},"speechSynthesis"in window?(window.speechSynthesis.speak(d),y(d),c(!0),m(!1)):console.error("Speech synthesis not supported");},pause:()=>{i&&!l&&(window.speechSynthesis.pause(),m(!0));},resume:()=>{i&&l&&(window.speechSynthesis.resume(),m(!1));},cancel:()=>{i&&(window.speechSynthesis.cancel(),c(!1),m(!1));},isSpeaking:i,isPaused:l,availableVoices:t,changeVoice:u=>{s(u);},currentVoice:o,getAvailableLanguages:()=>[...new Set(t.map(u=>u.lang))]}};var Le=({children:e,onClick:t})=>v.createElement(a,{as:"button",type:"button",className:"tts-border","data-btn":"sm text pill",onClick:t},e),L=v.memo(Le),_=({label:e,isSpeaking:t,isPaused:r,onSpeak:o,onPause:s,onResume:i,onCancel:c})=>v.createElement(a,{as:"div","data-tts":!0},e&&v.createElement("p",null,e),!t&&v.createElement(L,{"aria-label":"Speak",onClick:o},v.createElement(b$1.PlaySolid,{size:16})),t&&!r&&v.createElement(L,{"aria-label":"Pause",onClick:s},v.createElement(b$1.PauseSolid,{size:16})),r&&v.createElement(L,{"aria-label":"Resume",onClick:i},v.createElement(b$1.ResumeSolid,{size:16})),v.createElement(L,{"aria-label":"Stop",onClick:c},v.createElement(b$1.StopSolid,{size:16})));_.displayName="TextToSpeechControls";_.TTSButton=L;var q=_;var Q=({initialText:e="",showTextInput:t=!1,voice:r,pitch:o=1,rate:s=1,language:i,label:c,onEnd:l})=>{let{speak:m,pause:I,resume:y,cancel:g,isSpeaking:T,isPaused:f,getAvailableLanguages:S,availableVoices:C}=j(),[x,u]=useState(e);console.log(S()),useEffect(()=>{u(e);},[e]);let a=()=>{x.trim()!==""&&m(x,{voice:r,pitch:o,rate:s},d);},p=U=>{u(U.target.value);},d=()=>{l&&l();};return v.createElement(v.Fragment,null,t&&v.createElement(b$2,{value:x,onChange:p}),v.createElement(q,{label:c,isSpeaking:T,isPaused:f,onSpeak:a,onPause:I,onResume:y,onCancel:g}))};Q.displayName="TextToSpeechComponent";var A=e=>v.createElement(v.Fragment,null,e),Be=({id:e,children:t,headerBackground:r,styles:o,classes:s,...i})=>v.createElement(a,{as:"header",id:e,styles:o,className:s,...i},r,v.createElement(a,{as:"section"},t)),$e=({id:e,children:t,styles:r,classes:o,...s})=>v.createElement(a,{as:"main",id:e,styles:r,...s,className:o},t),Me=({id:e,classes:t,children:r,styles:o={},...s})=>v.createElement(a,{as:"footer",id:e,className:t,styles:o,...s},v.createElement(a,{as:"section"},r||"Copyright \xA9 2022")),Re=({id:e,children:t,styles:r={},classes:o,...s})=>v.createElement(a,{as:"aside",id:e,styles:r,className:o,...s},v.createElement(a,{as:"section"},t)),De=({id:e,children:t,styles:r,classes:o,...s})=>v.createElement(a,{as:"section",id:e,styles:r,className:o,...s},t),Fe=({id:e,children:t,styles:r,classes:o,...s})=>v.createElement(a,{as:"article",id:e,styles:r,className:o,...s},t);A.displayName="Landmarks";A.Header=Be;A.Main=$e;A.Footer=Me;A.Aside=Re;A.Section=De;A.Article=Fe;var ee=({id:e,styles:t,classes:r,children:o,variant:s,...i})=>v.createElement(a,{as:"sup",id:e,styles:t,className:r,"data-badge":s||void 0,role:"status",...i},v.createElement(a,{as:"span"},o));ee.displayName="Badge";var He=({elm:e="span",role:t="note",variant:r,children:o,styles:s,...i})=>v.createElement(a,{as:e,role:t,"data-tag":r||void 0,styles:s,...i},o);He.displayName="Tag";var _e=v.forwardRef(({summary:e,icon:t,styles:r,classes:o,ariaLabel:s,name:i,open:c,onPointerDown:l,onToggle:m,children:I,...y},g)=>{let T=useCallback(S=>{l?.(S);},[l]),f=useCallback(S=>{m?.(S);},[m]);return v.createElement(a,{as:"details",styles:r,classes:o,onToggle:f,ref:g,open:c,"aria-label":s,name:i,...y},v.createElement(a,{as:"summary",onPointerDown:T},t,e),v.createElement(a,{as:"section"},I))});_e.displayName="Details";
39
41
 
40
- export { ge as Article, fe as Aside, A as Badge, ye as Details, de as Footer, ce as Header, V as Img, S as Landmarks, me as Main, ue as Section, xe as Tag, z as TextToSpeech };
42
+ export { K as Alert, Fe as Article, Re as Aside, ee as Badge, _e as Details, Me as Footer, Be as Header, Y as Img, A as Landmarks, $e as Main, De as Section, He as Tag, Q as TextToSpeech };
41
43
  //# sourceMappingURL=out.js.map
42
44
  //# sourceMappingURL=index.js.map