@fpkit/acss 2.0.0 → 2.1.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.
@@ -0,0 +1,445 @@
1
+ import { C as ComponentProps } from './component-props-67d978a2.js';
2
+ import React from 'react';
3
+ import { U as UI } from './ui-d01b50d4.js';
4
+
5
+ /**
6
+ * Props for individual icon SVG components (e.g., Icon.Code, Icon.Home).
7
+ *
8
+ * These props control the visual presentation of SVG icons. Icon components
9
+ * are decorative by default and should be wrapped in the `Icon` container
10
+ * component which handles accessibility concerns.
11
+ *
12
+ * @property {string} [fill] - SVG fill color (CSS color value)
13
+ * @property {number} [size] - Icon size in pixels (sets both width and height)
14
+ * @property {string} [strokeColor] - SVG stroke color (CSS color value)
15
+ * @property {string} [strokeWidth] - SVG stroke width (e.g., '2px', '1.5')
16
+ * @property {string} [role] - ARIA role (use 'img' for semantic icons)
17
+ * @property {string} [aria-label] - Accessible label for standalone icons
18
+ * @property {boolean} [aria-hidden] - Hide from screen readers (default: true via Icon wrapper)
19
+ * @property {string} [alt] - @deprecated Use aria-label instead. Legacy prop for accessible label.
20
+ * @property {number} [width] - Explicit width in pixels (overrides size)
21
+ * @property {number} [height] - Explicit height in pixels (overrides size)
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * // Decorative icon with custom styling
26
+ * <Icon>
27
+ * <Icon.Code size={24} fill="blue" />
28
+ * View Code
29
+ * </Icon>
30
+ *
31
+ * // Standalone semantic icon
32
+ * <Icon aria-hidden={false} aria-label="Code snippet">
33
+ * <Icon.Code size={20} />
34
+ * </Icon>
35
+ * ```
36
+ */
37
+ interface IconProps$1 extends Partial<ComponentProps> {
38
+ /** SVG fill color */
39
+ fill?: string;
40
+ /** Icon size in pixels (sets both width and height) */
41
+ size?: number;
42
+ /** SVG stroke color */
43
+ strokeColor?: string;
44
+ /** SVG stroke width */
45
+ strokeWidth?: string;
46
+ /** ARIA role (use 'img' for semantic icons) */
47
+ role?: string;
48
+ /** Accessible label (required for standalone icons) */
49
+ 'aria-label'?: string;
50
+ /** Hide from screen readers (default: true) */
51
+ 'aria-hidden'?: boolean;
52
+ /**
53
+ * @deprecated Use aria-label instead. This prop exists for backward compatibility.
54
+ * The alt attribute is only valid for img elements, not SVG.
55
+ */
56
+ alt?: string;
57
+ /** Explicit width in pixels */
58
+ width?: number;
59
+ /** Explicit height in pixels */
60
+ height?: number;
61
+ }
62
+
63
+ declare function Star({ size, fill, strokeColor, styles, role, alt, ...props }: Pick<IconProps$1, 'strokeColor' | 'fill' | 'styles' | 'size' | 'role' | 'alt'>): React.JSX.Element;
64
+ declare namespace Star {
65
+ var displayName: string;
66
+ }
67
+
68
+ type IconProps = React.ComponentProps<typeof UI> & {
69
+ /**
70
+ * Controls screen reader visibility.
71
+ * - `true` (default): Hides icon from screen readers (decorative icon)
72
+ * - `false`: Makes icon visible to screen readers (semantic icon)
73
+ *
74
+ * **When to use decorative (aria-hidden="true", default):**
75
+ * - Icon accompanies visible text (e.g., button with icon + label)
76
+ * - Icon is purely visual decoration
77
+ *
78
+ * **When to use semantic (aria-hidden="false"):**
79
+ * - Icon is the only content (e.g., icon-only button)
80
+ * - Must provide `aria-label` or `aria-labelledby` for accessible name
81
+ *
82
+ * @default true
83
+ * @see https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html
84
+ */
85
+ "aria-hidden"?: boolean;
86
+ /**
87
+ * Accessible label for semantic icons.
88
+ * Required when icon is standalone (not accompanied by visible text).
89
+ *
90
+ * @example
91
+ * ```tsx
92
+ * // ✅ GOOD: Icon-only button with accessible name
93
+ * <button>
94
+ * <Icon aria-hidden={false} aria-label="Close dialog">
95
+ * <Icon.Remove />
96
+ * </Icon>
97
+ * </button>
98
+ *
99
+ * // ✅ GOOD: Icon with visible text (default decorative)
100
+ * <button>
101
+ * <Icon><Icon.Add /></Icon>
102
+ * Add Item
103
+ * </button>
104
+ * ```
105
+ */
106
+ "aria-label"?: string;
107
+ /**
108
+ * Semantic role override.
109
+ * Use `role="img"` when icon conveys meaning and is not decorative.
110
+ *
111
+ * @default undefined (no role for decorative icons)
112
+ */
113
+ role?: string;
114
+ };
115
+ /**
116
+ * Icon wrapper component that enforces accessibility best practices.
117
+ *
118
+ * **Default behavior (decorative icon):**
119
+ * - Hidden from screen readers (`aria-hidden="true"`)
120
+ * - Used when icon accompanies visible text
121
+ *
122
+ * **Semantic icon pattern:**
123
+ * - Set `aria-hidden={false}` to expose to screen readers
124
+ * - Must provide `aria-label` for accessible name
125
+ * - Consider `role="img"` for complex SVG icons
126
+ *
127
+ * @param {IconProps} props - Component props
128
+ * @returns {React.ReactElement} Accessible icon wrapper
129
+ *
130
+ * @example
131
+ * // ✅ Decorative icon with text (default)
132
+ * <button>
133
+ * <Icon><Icon.Save /></Icon>
134
+ * Save Changes
135
+ * </button>
136
+ *
137
+ * @example
138
+ * // ✅ Semantic icon-only button
139
+ * <button aria-label="Close dialog">
140
+ * <Icon aria-hidden={false}>
141
+ * <Icon.Remove />
142
+ * </Icon>
143
+ * </button>
144
+ *
145
+ * @example
146
+ * // ❌ BAD: Icon-only button without accessible name
147
+ * <button>
148
+ * <Icon><Icon.Remove /></Icon>
149
+ * </button>
150
+ */
151
+ declare const Icon: {
152
+ ({ id, classes, children, styles, "aria-hidden": ariaHidden, "aria-label": ariaLabel, role, ...props }: IconProps): React.JSX.Element;
153
+ displayName: string;
154
+ Add: {
155
+ ({ fill, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): JSX.Element;
156
+ styles: {
157
+ fill: string;
158
+ display: string;
159
+ alignItems: string;
160
+ width: string;
161
+ };
162
+ displayName: string;
163
+ };
164
+ ArrowDown: {
165
+ ({ fill, styles, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size">): React.JSX.Element;
166
+ styles: {
167
+ display: string;
168
+ alignItems: string;
169
+ width: string;
170
+ };
171
+ displayName: string;
172
+ };
173
+ ArrowLeft: {
174
+ ({ strokeColor, fill, size, styles, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
175
+ styles: {
176
+ display: string;
177
+ alignItems: string;
178
+ width: string;
179
+ };
180
+ displayName: string;
181
+ };
182
+ ArrowRight: {
183
+ ({ size, fill, strokeColor, styles, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
184
+ displayName: string;
185
+ };
186
+ ArrowUp: {
187
+ ({ strokeColor, styles, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
188
+ displayName: string;
189
+ style: {
190
+ fill: string;
191
+ stroke: string;
192
+ display: string;
193
+ alignItems: string;
194
+ width: string;
195
+ };
196
+ };
197
+ Chat: {
198
+ ({ size, strokeColor, styles, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): JSX.Element;
199
+ styles: {
200
+ display: string;
201
+ alignItems: string;
202
+ width: string;
203
+ };
204
+ displayName: string;
205
+ };
206
+ Code: {
207
+ ({ strokeColor, fill, size, styles, role, alt, ...props }?: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
208
+ styles: {
209
+ fill: string;
210
+ stroke: string;
211
+ display: string;
212
+ alignItems: string;
213
+ width: string;
214
+ };
215
+ };
216
+ Copy: {
217
+ ({ size, strokeColor, styles, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): JSX.Element;
218
+ displayName: string;
219
+ styles: {
220
+ stroke: string;
221
+ display: string;
222
+ alignItems: string;
223
+ width: string;
224
+ };
225
+ };
226
+ Down: {
227
+ ({ size, fill, styles, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
228
+ displayName: string;
229
+ styles: {
230
+ display: string;
231
+ alignItems: string;
232
+ width: string;
233
+ };
234
+ };
235
+ Home: {
236
+ ({ strokeColor, fill, size, styles, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
237
+ displayName: string;
238
+ styles: {
239
+ fill: string;
240
+ stroke: string;
241
+ display: string;
242
+ alignItems: string;
243
+ width: string;
244
+ };
245
+ };
246
+ Info: {
247
+ ({ fill, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): JSX.Element;
248
+ displayName: string;
249
+ };
250
+ InfoSolid: {
251
+ ({ fill, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): JSX.Element;
252
+ displayName: string;
253
+ };
254
+ AlertSolid: {
255
+ ({ fill, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): JSX.Element;
256
+ displayName: string;
257
+ };
258
+ Left: {
259
+ ({ fill, size, styles, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
260
+ displayName: string;
261
+ styles: {
262
+ fill: string;
263
+ display: string;
264
+ alignItems: string;
265
+ width: string;
266
+ };
267
+ };
268
+ Minus: {
269
+ ({ size, fill, styles, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
270
+ displayName: string;
271
+ styles: {
272
+ fill: string;
273
+ };
274
+ };
275
+ Pause: {
276
+ ({ strokeColor, styles, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
277
+ displayName: string;
278
+ style: {
279
+ fill: string;
280
+ stroke: string;
281
+ display: string;
282
+ alignItems: string;
283
+ width: string;
284
+ };
285
+ };
286
+ PauseSolid: {
287
+ ({ strokeColor, styles, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
288
+ displayName: string;
289
+ style: {
290
+ fill: string;
291
+ stroke: string;
292
+ display: string;
293
+ alignItems: string;
294
+ width: string;
295
+ };
296
+ };
297
+ Play: {
298
+ ({ strokeColor, styles, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
299
+ displayName: string;
300
+ style: {
301
+ fill: string;
302
+ stroke: string;
303
+ display: string;
304
+ alignItems: string;
305
+ width: string;
306
+ };
307
+ };
308
+ PlaySolid: {
309
+ ({ strokeColor, styles, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
310
+ displayName: string;
311
+ style: {
312
+ fill: string;
313
+ stroke: string;
314
+ display: string;
315
+ alignItems: string;
316
+ width: string;
317
+ };
318
+ };
319
+ Remove: {
320
+ ({ size, fill, styles, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
321
+ displayName: string;
322
+ styles: {
323
+ fill: string;
324
+ };
325
+ };
326
+ Resume: {
327
+ ({ strokeColor, styles, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
328
+ displayName: string;
329
+ style: {
330
+ fill: string;
331
+ stroke: string;
332
+ display: string;
333
+ alignItems: string;
334
+ width: string;
335
+ };
336
+ };
337
+ ResumeSolid: {
338
+ ({ strokeColor, styles, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
339
+ displayName: string;
340
+ style: {
341
+ fill: string;
342
+ stroke: string;
343
+ display: string;
344
+ alignItems: string;
345
+ width: string;
346
+ };
347
+ };
348
+ Right: {
349
+ ({ size, fill, styles, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
350
+ displayName: string;
351
+ styles: {
352
+ fill: string;
353
+ };
354
+ };
355
+ Star: typeof Star;
356
+ Stop: {
357
+ ({ strokeColor, styles, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
358
+ displayName: string;
359
+ style: {
360
+ fill: string;
361
+ stroke: string;
362
+ display: string;
363
+ alignItems: string;
364
+ width: string;
365
+ }; /**
366
+ * Controls screen reader visibility.
367
+ * - `true` (default): Hides icon from screen readers (decorative icon)
368
+ * - `false`: Makes icon visible to screen readers (semantic icon)
369
+ *
370
+ * **When to use decorative (aria-hidden="true", default):**
371
+ * - Icon accompanies visible text (e.g., button with icon + label)
372
+ * - Icon is purely visual decoration
373
+ *
374
+ * **When to use semantic (aria-hidden="false"):**
375
+ * - Icon is the only content (e.g., icon-only button)
376
+ * - Must provide `aria-label` or `aria-labelledby` for accessible name
377
+ *
378
+ * @default true
379
+ * @see https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html
380
+ */
381
+ };
382
+ StopSolid: {
383
+ ({ strokeColor, styles, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
384
+ displayName: string;
385
+ style: {
386
+ fill: string;
387
+ stroke: string;
388
+ display: string;
389
+ alignItems: string;
390
+ width: string;
391
+ };
392
+ };
393
+ Up: {
394
+ ({ size, fill, styles, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
395
+ displayName: string;
396
+ styles: {
397
+ display: string;
398
+ alignItems: string;
399
+ width: string;
400
+ };
401
+ };
402
+ User: {
403
+ ({ size, fill, strokeColor, styles, alt, role, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
404
+ styles: {
405
+ fill: string;
406
+ stroke: string;
407
+ display: string;
408
+ alignItems: string;
409
+ width: string;
410
+ };
411
+ displayName: string;
412
+ };
413
+ styles: {
414
+ display: string;
415
+ direction: string;
416
+ gap: string;
417
+ placeItems: string;
418
+ width: string;
419
+ };
420
+ QuestionSolid: {
421
+ ({ fill, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): JSX.Element;
422
+ displayName: string;
423
+ };
424
+ WarnSolid: {
425
+ ({ fill, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): JSX.Element;
426
+ displayName: string;
427
+ };
428
+ SuccessSolid: {
429
+ ({ fill, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): JSX.Element;
430
+ displayName: string;
431
+ };
432
+ AlertSquareSolid: {
433
+ ({ fill, size, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): JSX.Element;
434
+ displayName: string;
435
+ };
436
+ Close: {
437
+ ({ size, fill, styles, role, alt, ...props }: Pick<IconProps$1, "styles" | "role" | "fill" | "alt" | "size" | "strokeColor">): React.JSX.Element;
438
+ displayName: string;
439
+ styles: {
440
+ fill: string;
441
+ };
442
+ };
443
+ };
444
+
445
+ export { IconProps$1 as I, Icon as a, IconProps as b };
package/libs/icons.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { default as Icon, IconProps } from './components/icons/icon.cjs';
1
+ export { a as Icon, b as IconProps } from './icons-287fce3a.js';
2
2
  import './component-props-67d978a2.js';
3
3
  import 'react';
4
4
  import './ui-d01b50d4.js';
package/libs/icons.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { default as Icon, IconProps } from './components/icons/icon.js';
1
+ export { a as Icon, b as IconProps } from './icons-287fce3a.js';
2
2
  import './component-props-67d978a2.js';
3
3
  import 'react';
4
4
  import './ui-d01b50d4.js';
package/libs/index.cjs CHANGED
@@ -21,25 +21,25 @@ require('./chunk-PNWIRCG3.cjs');
21
21
  require('./chunk-TON2YGMD.cjs');
22
22
  var chunk5PJYLVFY_cjs = require('./chunk-5PJYLVFY.cjs');
23
23
  var chunkENTCUJ3A_cjs = require('./chunk-ENTCUJ3A.cjs');
24
- var u = require('react');
24
+ var v = require('react');
25
25
 
26
26
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
27
27
 
28
- var u__default = /*#__PURE__*/_interopDefault(u);
28
+ var v__default = /*#__PURE__*/_interopDefault(v);
29
29
 
30
- 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=u.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}">
30
+ var ve={default:"",info:"Information: ",success:"Success: ",warning:"Warning: ",error:"Error: "},M=({severity:e})=>{let t=ve[e];return t?v__default.default.createElement("span",{className:"sr-only"},t):null};var Pe=(e,t)=>({info:v__default.default.createElement(chunk6WTC4JXH_cjs.b.InfoSolid,{...t}),success:v__default.default.createElement(chunk6WTC4JXH_cjs.b.SuccessSolid,{...t}),warning:v__default.default.createElement(chunk6WTC4JXH_cjs.b.WarnSolid,{...t}),error:v__default.default.createElement(chunk6WTC4JXH_cjs.b.AlertSolid,{...t}),default:v__default.default.createElement(chunk6WTC4JXH_cjs.b.AlertSquareSolid,{...t})})[e],R=({severity:e,iconProps:t,hideIcon:r})=>{if(r)return null;let o=Pe(e,t);return v__default.default.createElement(chunkENTCUJ3A_cjs.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__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:r,className:"alert-title"},e)};var z=({children:e,contentType:t})=>t==="node"?v__default.default.createElement(v__default.default.Fragment,null,e):v__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"p"},e);var H=({actions:e})=>e?v__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"div",className:"alert-actions"},e):null;var X=v__default.default.memo(({onDismiss:e,iconSize:t=16})=>v__default.default.createElement(chunkE4OSROCA_cjs.b,{type:"button",onClick:e,"aria-label":"Close alert",className:"alert-dismiss","data-btn":"icon sm"},v__default.default.createElement(chunk6WTC4JXH_cjs.b,null,v__default.default.createElement(chunk6WTC4JXH_cjs.b.Close,{size:t})))),J=X;X.displayName="DismissButton";var Ee={default:"polite",info:"polite",success:"polite",warning:"polite",error:"assertive"},k=v__default.default.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__default.default.createElement(chunkENTCUJ3A_cjs.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__default.default.createElement(M,{severity:e}),v__default.default.createElement(R,{severity:e,iconProps:S,hideIcon:f}),v__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"div",className:"alert-message"},v__default.default.createElement(D,{title:m,titleLevel:I}),v__default.default.createElement(z,{contentType:g},y),v__default.default.createElement(H,{actions:T})),o&&v__default.default.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__default.default.useState(e),[I,y]=v__default.default.useState(e),[g,T]=v__default.default.useState(!1),f=v__default.default.useCallback(()=>{m(!1),setTimeout(()=>{y(!1),t?.();},300);},[t]);v__default.default.useEffect(()=>{e?(y(!0),m(!0)):m(!1);},[e]),v__default.default.useEffect(()=>{if(!o||!l||g)return;let x=setTimeout(()=>{f();},o);return ()=>clearTimeout(x)},[o,l,g,f]),v__default.default.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__default.default.useEffect(()=>{i&&l&&c.current&&c.current.focus();},[i,l,c]);let S=v__default.default.useCallback(()=>{s&&o&&T(!0);},[s,o]),C=v__default.default.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__default.default.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__default.default.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=v.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}">
31
31
  <defs>
32
- <linearGradient id="grad-${o}-${p}" x1="0%" y1="0%" x2="100%" y2="100%">
32
+ <linearGradient id="grad-${a}-${p}" x1="0%" y1="0%" x2="100%" y2="100%">
33
33
  <stop offset="0%" style="stop-color:#6366f1;stop-opacity:1" />
34
34
  <stop offset="50%" style="stop-color:#8b5cf6;stop-opacity:1" />
35
35
  <stop offset="100%" style="stop-color:#ec4899;stop-opacity:1" />
36
36
  </linearGradient>
37
37
  </defs>
38
- <rect width="${o}" height="${p}" fill="url(#grad-${o}-${p})"/>
39
- <circle cx="${o*.15}" cy="${p*.2}" r="${Math.min(o,p)*.08}" fill="rgba(255,255,255,0.2)"/>
40
- <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)"/>
41
- <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>
42
- </svg>`;return `data:image/svg+xml,${encodeURIComponent(l)}`},[t,n]),w=c??h;return u__default.default.createElement(chunkENTCUJ3A_cjs.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]=u.useState([]),[n,r]=u.useState(e),[i,c]=u.useState(!1),[m,d]=u.useState(!1),[T,x]=u.useState(null);return u.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__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"button",type:"button",className:"tts-border","data-btn":"sm text pill",onClick:s},e),U=u__default.default.memo(pe),L=({label:e,isSpeaking:s,isPaused:t,onSpeak:n,onPause:r,onResume:i,onCancel:c})=>u__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"div","data-tts":!0},e&&u__default.default.createElement("p",null,e),!s&&u__default.default.createElement(U,{"aria-label":"Speak",onClick:n},u__default.default.createElement(chunk6WTC4JXH_cjs.b.PlaySolid,{size:16})),s&&!t&&u__default.default.createElement(U,{"aria-label":"Pause",onClick:r},u__default.default.createElement(chunk6WTC4JXH_cjs.b.PauseSolid,{size:16})),t&&u__default.default.createElement(U,{"aria-label":"Resume",onClick:i},u__default.default.createElement(chunk6WTC4JXH_cjs.b.ResumeSolid,{size:16})),u__default.default.createElement(U,{"aria-label":"Stop",onClick:c},u__default.default.createElement(chunk6WTC4JXH_cjs.b.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]=u.useState(e);console.log(h()),u.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__default.default.createElement(u__default.default.Fragment,null,s&&u__default.default.createElement(chunkWXBFBWYF_cjs.b,{value:I,onChange:p}),u__default.default.createElement(H,{label:c,isSpeaking:P,isPaused:C,onSpeak:o,onPause:T,onResume:x,onCancel:y}))};z.displayName="TextToSpeechComponent";var S=e=>u__default.default.createElement(u__default.default.Fragment,null,e),ce=({id:e,children:s,headerBackground:t,styles:n,classes:r,...i})=>u__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"header",id:e,styles:n,className:r,...i},t,u__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"section"},s)),me=({id:e,children:s,styles:t,classes:n,...r})=>u__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"main",id:e,styles:t,...r,className:n},s),de=({id:e,classes:s,children:t,styles:n={},...r})=>u__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"footer",id:e,className:s,styles:n,...r},u__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"section"},t||"Copyright \xA9 2022")),fe=({id:e,children:s,styles:t={},classes:n,...r})=>u__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"aside",id:e,styles:t,className:n,...r},u__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"section"},s)),ue=({id:e,children:s,styles:t,classes:n,...r})=>u__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"section",id:e,styles:t,className:n,...r},s),ge=({id:e,children:s,styles:t,classes:n,...r})=>u__default.default.createElement(chunkENTCUJ3A_cjs.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__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"sup",id:e,styles:s,className:t,"data-badge":r||void 0,role:"status",...i},u__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"span"},n));A.displayName="Badge";var xe=({elm:e="span",role:s="note",variant:t,children:n,styles:r,...i})=>u__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:e,role:s,"data-tag":t||void 0,styles:r,...i},n);xe.displayName="Tag";var ye=u__default.default.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=u.useCallback(h=>{m?.(h);},[m]),C=u.useCallback(h=>{d?.(h);},[d]);return u__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"details",styles:t,classes:n,onToggle:C,ref:y,open:c,"aria-label":r,name:i,...x},u__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"summary",onPointerDown:P},s,e),u__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"section"},T))});ye.displayName="Details";
38
+ <rect width="${a}" height="${p}" fill="url(#grad-${a}-${p})"/>
39
+ <circle cx="${a*.15}" cy="${p*.2}" r="${Math.min(a,p)*.08}" fill="rgba(255,255,255,0.2)"/>
40
+ <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)"/>
41
+ <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>
42
+ </svg>`;return `data:image/svg+xml,${encodeURIComponent(d)}`},[r,o]),C=c??S;return v__default.default.createElement(chunkENTCUJ3A_cjs.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]=v.useState([]),[o,s]=v.useState(e),[i,c]=v.useState(!1),[l,m]=v.useState(!1),[I,y]=v.useState(null);return v.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__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"button",type:"button",className:"tts-border","data-btn":"sm text pill",onClick:t},e),L=v__default.default.memo(Le),_=({label:e,isSpeaking:t,isPaused:r,onSpeak:o,onPause:s,onResume:i,onCancel:c})=>v__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"div","data-tts":!0},e&&v__default.default.createElement("p",null,e),!t&&v__default.default.createElement(L,{"aria-label":"Speak",onClick:o},v__default.default.createElement(chunk6WTC4JXH_cjs.b.PlaySolid,{size:16})),t&&!r&&v__default.default.createElement(L,{"aria-label":"Pause",onClick:s},v__default.default.createElement(chunk6WTC4JXH_cjs.b.PauseSolid,{size:16})),r&&v__default.default.createElement(L,{"aria-label":"Resume",onClick:i},v__default.default.createElement(chunk6WTC4JXH_cjs.b.ResumeSolid,{size:16})),v__default.default.createElement(L,{"aria-label":"Stop",onClick:c},v__default.default.createElement(chunk6WTC4JXH_cjs.b.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]=v.useState(e);console.log(S()),v.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__default.default.createElement(v__default.default.Fragment,null,t&&v__default.default.createElement(chunkWXBFBWYF_cjs.b,{value:x,onChange:p}),v__default.default.createElement(q,{label:c,isSpeaking:T,isPaused:f,onSpeak:a,onPause:I,onResume:y,onCancel:g}))};Q.displayName="TextToSpeechComponent";var A=e=>v__default.default.createElement(v__default.default.Fragment,null,e),Be=({id:e,children:t,headerBackground:r,styles:o,classes:s,...i})=>v__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"header",id:e,styles:o,className:s,...i},r,v__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"section"},t)),$e=({id:e,children:t,styles:r,classes:o,...s})=>v__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"main",id:e,styles:r,...s,className:o},t),Me=({id:e,classes:t,children:r,styles:o={},...s})=>v__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"footer",id:e,className:t,styles:o,...s},v__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"section"},r||"Copyright \xA9 2022")),Re=({id:e,children:t,styles:r={},classes:o,...s})=>v__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"aside",id:e,styles:r,className:o,...s},v__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"section"},t)),De=({id:e,children:t,styles:r,classes:o,...s})=>v__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"section",id:e,styles:r,className:o,...s},t),Fe=({id:e,children:t,styles:r,classes:o,...s})=>v__default.default.createElement(chunkENTCUJ3A_cjs.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__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"sup",id:e,styles:t,className:r,"data-badge":s||void 0,role:"status",...i},v__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"span"},o));ee.displayName="Badge";var He=({elm:e="span",role:t="note",variant:r,children:o,styles:s,...i})=>v__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:e,role:t,"data-tag":r||void 0,styles:s,...i},o);He.displayName="Tag";var _e=v__default.default.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=v.useCallback(S=>{l?.(S);},[l]),f=v.useCallback(S=>{m?.(S);},[m]);return v__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"details",styles:r,classes:o,onToggle:f,ref:g,open:c,"aria-label":s,name:i,...y},v__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"summary",onPointerDown:T},t,e),v__default.default.createElement(chunkENTCUJ3A_cjs.a,{as:"section"},I))});_e.displayName="Details";
43
43
 
44
44
  Object.defineProperty(exports, 'Textarea', {
45
45
  enumerable: true,
@@ -169,17 +169,22 @@ Object.defineProperty(exports, 'To', {
169
169
  enumerable: true,
170
170
  get: function () { return chunk5PJYLVFY_cjs.d; }
171
171
  });
172
- exports.Article = ge;
173
- exports.Aside = fe;
174
- exports.Badge = A;
175
- exports.Details = ye;
176
- exports.Footer = de;
177
- exports.Header = ce;
178
- exports.Img = V;
179
- exports.Landmarks = S;
180
- exports.Main = me;
181
- exports.Section = ue;
182
- exports.Tag = xe;
183
- exports.TextToSpeech = z;
172
+ Object.defineProperty(exports, 'UI', {
173
+ enumerable: true,
174
+ get: function () { return chunkENTCUJ3A_cjs.a; }
175
+ });
176
+ exports.Alert = K;
177
+ exports.Article = Fe;
178
+ exports.Aside = Re;
179
+ exports.Badge = ee;
180
+ exports.Details = _e;
181
+ exports.Footer = Me;
182
+ exports.Header = Be;
183
+ exports.Img = Y;
184
+ exports.Landmarks = A;
185
+ exports.Main = $e;
186
+ exports.Section = De;
187
+ exports.Tag = He;
188
+ exports.TextToSpeech = Q;
184
189
  //# sourceMappingURL=out.js.map
185
190
  //# sourceMappingURL=index.cjs.map