@fpkit/acss 1.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.
Files changed (72) hide show
  1. package/README.md +60 -0
  2. package/libs/{chunk-7XPFW7CB.js → chunk-43TK2ICH.js} +2 -2
  3. package/libs/chunk-5PJYLVFY.cjs +17 -0
  4. package/libs/chunk-5PJYLVFY.cjs.map +1 -0
  5. package/libs/chunk-E4OSROCA.cjs +17 -0
  6. package/libs/chunk-E4OSROCA.cjs.map +1 -0
  7. package/libs/chunk-KVKQLRJG.js +10 -0
  8. package/libs/chunk-KVKQLRJG.js.map +1 -0
  9. package/libs/{chunk-QVW6W76L.cjs → chunk-MGPWZRBX.cjs} +3 -3
  10. package/libs/chunk-NNTBIHSD.js +8 -0
  11. package/libs/chunk-NNTBIHSD.js.map +1 -0
  12. package/libs/{chunk-X3JCTEPD.js → chunk-QKHPHMG2.js} +2 -2
  13. package/libs/{chunk-T4T6GWYQ.cjs → chunk-R7NLLZU2.cjs} +3 -3
  14. package/libs/{chunk-X5LGFCWG.js → chunk-UJAQVHWC.js} +3 -3
  15. package/libs/{chunk-DKTHCQ5P.cjs → chunk-X5RKCLDC.cjs} +3 -3
  16. package/libs/components/breadcrumbs/breadcrumb.cjs +5 -5
  17. package/libs/components/breadcrumbs/breadcrumb.d.cts +1 -1
  18. package/libs/components/breadcrumbs/breadcrumb.d.ts +1 -1
  19. package/libs/components/breadcrumbs/breadcrumb.js +2 -2
  20. package/libs/components/button.cjs +3 -3
  21. package/libs/components/button.d.cts +1 -1
  22. package/libs/components/button.d.ts +1 -1
  23. package/libs/components/button.js +1 -1
  24. package/libs/components/dialog/dialog.cjs +4 -4
  25. package/libs/components/dialog/dialog.js +2 -2
  26. package/libs/components/icons/icon.d.cts +4 -445
  27. package/libs/components/icons/icon.d.ts +4 -445
  28. package/libs/components/link/link.cjs +11 -3
  29. package/libs/components/link/link.d.cts +131 -3
  30. package/libs/components/link/link.d.ts +131 -3
  31. package/libs/components/link/link.js +1 -1
  32. package/libs/components/modal.cjs +3 -3
  33. package/libs/components/modal.js +2 -2
  34. package/libs/hooks.cjs +3 -3
  35. package/libs/hooks.d.cts +1 -1
  36. package/libs/hooks.d.ts +1 -1
  37. package/libs/hooks.js +2 -2
  38. package/libs/icons-287fce3a.d.ts +445 -0
  39. package/libs/icons.d.cts +1 -1
  40. package/libs/icons.d.ts +1 -1
  41. package/libs/index.cjs +39 -34
  42. package/libs/index.cjs.map +1 -1
  43. package/libs/index.d.cts +395 -4
  44. package/libs/index.d.ts +395 -4
  45. package/libs/index.js +17 -15
  46. package/libs/index.js.map +1 -1
  47. package/package.json +2 -2
  48. package/src/components/alert/alert.tsx +2 -3
  49. package/src/components/breadcrumbs/breadcrumb.test.tsx +1 -2
  50. package/src/components/buttons/README.mdx +19 -9
  51. package/src/components/buttons/button.tsx +19 -15
  52. package/src/components/link/link.stories.tsx +205 -8
  53. package/src/components/link/link.test.tsx +1 -1
  54. package/src/components/link/link.tsx +22 -0
  55. package/src/components/link/link.types.ts +11 -3
  56. package/src/docs/fpkit-developer.mdx +131 -53
  57. package/src/index.ts +7 -1
  58. package/libs/chunk-33PNJ4LO.cjs +0 -15
  59. package/libs/chunk-33PNJ4LO.cjs.map +0 -1
  60. package/libs/chunk-GT77BX4L.cjs +0 -17
  61. package/libs/chunk-GT77BX4L.cjs.map +0 -1
  62. package/libs/chunk-OVWLQYMK.js +0 -10
  63. package/libs/chunk-OVWLQYMK.js.map +0 -1
  64. package/libs/chunk-UEPAWMDF.js +0 -8
  65. package/libs/chunk-UEPAWMDF.js.map +0 -1
  66. package/libs/link-5192f411.d.ts +0 -323
  67. /package/libs/{chunk-7XPFW7CB.js.map → chunk-43TK2ICH.js.map} +0 -0
  68. /package/libs/{chunk-QVW6W76L.cjs.map → chunk-MGPWZRBX.cjs.map} +0 -0
  69. /package/libs/{chunk-X3JCTEPD.js.map → chunk-QKHPHMG2.js.map} +0 -0
  70. /package/libs/{chunk-T4T6GWYQ.cjs.map → chunk-R7NLLZU2.cjs.map} +0 -0
  71. /package/libs/{chunk-X5LGFCWG.js.map → chunk-UJAQVHWC.js.map} +0 -0
  72. /package/libs/{chunk-DKTHCQ5P.cjs.map → chunk-X5RKCLDC.cjs.map} +0 -0
package/libs/index.d.ts CHANGED
@@ -1,10 +1,11 @@
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
- export { L as Link, a as LinkProps, L as To } from './link-5192f411.js';
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';
10
11
  export { default as Popover, PopoverProps } from './components/popover/popover.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
  *
@@ -328,6 +484,241 @@ declare const Img: {
328
484
  displayName: string;
329
485
  };
330
486
 
487
+ /**
488
+ * Props for the Link component.
489
+ *
490
+ * The Link component renders accessible anchor elements with enhanced security,
491
+ * styling variants, and WCAG 2.1 AA compliance. It supports both traditional
492
+ * text links and button-styled links for call-to-action scenarios.
493
+ *
494
+ * ## Accessibility Considerations
495
+ *
496
+ * - External links automatically include `rel="noopener noreferrer"` for security
497
+ * - Links should have descriptive text or `aria-label` for screen readers
498
+ * - Focus indicators must meet WCAG 2.4.7 contrast requirements (3:1 minimum)
499
+ * - Button-styled links maintain semantic `<a>` element for proper navigation
500
+ *
501
+ * @example
502
+ * ```tsx
503
+ * // Basic link
504
+ * <Link href="/about">About Us</Link>
505
+ *
506
+ * // External link with prefetch
507
+ * <Link href="https://example.com" target="_blank" prefetch>
508
+ * Visit Example
509
+ * </Link>
510
+ *
511
+ * // Button-styled link
512
+ * <Link href="/signup" btnStyle="primary">
513
+ * <b>Sign Up Now</b>
514
+ * </Link>
515
+ * ```
516
+ */
517
+ type LinkProps = {
518
+ /**
519
+ * The URL that the hyperlink points to.
520
+ * Can be relative or absolute, internal or external.
521
+ *
522
+ * @example
523
+ * ```tsx
524
+ * href="/products"
525
+ * href="https://example.com"
526
+ * href="mailto:hello@example.com"
527
+ * href="tel:+1234567890"
528
+ * ```
529
+ */
530
+ href?: string;
531
+ /**
532
+ * Where to display the linked URL.
533
+ *
534
+ * - `_self` (default): Current browsing context
535
+ * - `_blank`: New tab/window (automatically adds security attributes)
536
+ * - `_parent`: Parent browsing context
537
+ * - `_top`: Top-level browsing context
538
+ *
539
+ * Note: When `target="_blank"`, `rel="noopener noreferrer"` is automatically
540
+ * added for security unless explicitly overridden.
541
+ *
542
+ * @example
543
+ * ```tsx
544
+ * target="_blank" // Opens in new tab with security
545
+ * ```
546
+ */
547
+ target?: string;
548
+ /**
549
+ * Relationship between current document and linked URL.
550
+ *
551
+ * Common values:
552
+ * - `noopener`: Prevents window.opener access (security)
553
+ * - `noreferrer`: Prevents referrer header (privacy)
554
+ * - `nofollow`: Hints search engines not to follow (SEO)
555
+ * - `prefetch`: Hints to prefetch the resource (performance)
556
+ *
557
+ * Note: For `target="_blank"`, this component automatically merges
558
+ * `noopener noreferrer` with any user-provided values for security.
559
+ *
560
+ * @example
561
+ * ```tsx
562
+ * rel="nofollow noopener"
563
+ * rel="author"
564
+ * ```
565
+ */
566
+ rel?: string;
567
+ /**
568
+ * Content to display inside the link.
569
+ *
570
+ * For accessibility, ensure link text is descriptive and meaningful.
571
+ * Avoid generic text like "click here" or "read more" without context.
572
+ *
573
+ * @example
574
+ * ```tsx
575
+ * // ✅ Good: Descriptive link text
576
+ * <Link href="/products">View all products</Link>
577
+ *
578
+ * // ❌ Bad: Generic link text without context
579
+ * <Link href="/products">Click here</Link>
580
+ *
581
+ * // ✅ Good: Icon with accessible label
582
+ * <Link href="/home" aria-label="Return to homepage">
583
+ * <HomeIcon aria-hidden="true" />
584
+ * </Link>
585
+ * ```
586
+ */
587
+ children: React.ReactNode;
588
+ /**
589
+ * Inline CSS styles to apply to the link element.
590
+ * Can be used to override CSS custom properties.
591
+ *
592
+ * @example
593
+ * ```tsx
594
+ * styles={{
595
+ * '--link-color': '#ff0000',
596
+ * '--link-decoration': 'underline',
597
+ * }}
598
+ * ```
599
+ */
600
+ styles?: React.CSSProperties;
601
+ /**
602
+ * Hints to the browser to prefetch the linked resource.
603
+ *
604
+ * When `true` and `target="_blank"`, adds `rel="prefetch"` along with
605
+ * security attributes. This can improve perceived performance but should
606
+ * be used judiciously as it consumes bandwidth.
607
+ *
608
+ * Note: Browser support varies. Modern browsers may ignore this hint.
609
+ *
610
+ * @default false
611
+ * @example
612
+ * ```tsx
613
+ * <Link href="/next-page" prefetch>Next Page</Link>
614
+ * ```
615
+ */
616
+ prefetch?: boolean;
617
+ /**
618
+ * Applies button-like styling to the link.
619
+ *
620
+ * When set, the link renders with button styling including padding,
621
+ * borders, and hover effects while maintaining semantic anchor behavior.
622
+ *
623
+ * Common values:
624
+ * - `"btn"`: Standard button styling
625
+ * - `"pill"`: Rounded pill button styling
626
+ *
627
+ * Alternative: Wrap children in `<b>` or `<i>` tags for automatic styling:
628
+ * - `<b>`: Applies button styling
629
+ * - `<i>`: Applies pill styling
630
+ *
631
+ * @example
632
+ * ```tsx
633
+ * // Using btnStyle prop
634
+ * <Link href="/signup" btnStyle="btn">Sign Up</Link>
635
+ *
636
+ * // Using child wrapper (automatic detection)
637
+ * <Link href="/signup"><b>Sign Up</b></Link>
638
+ * <Link href="/signup"><i>Pill Button</i></Link>
639
+ * ```
640
+ */
641
+ btnStyle?: string;
642
+ /**
643
+ * Event handler called when the link is clicked or activated.
644
+ *
645
+ * **Recommended for most use cases**, especially analytics and tracking.
646
+ * This event fires for:
647
+ * - Mouse clicks
648
+ * - Touch/tap interactions
649
+ * - Keyboard activation (Enter key)
650
+ * - Assistive technology activation
651
+ *
652
+ * Use `onClick` when you need to track ALL user activations, including
653
+ * keyboard users. This ensures full accessibility coverage.
654
+ *
655
+ * @param event - The mouse event
656
+ * @example
657
+ * ```tsx
658
+ * // ✅ RECOMMENDED: onClick tracks all activation methods
659
+ * <Link
660
+ * href="/products"
661
+ * onClick={(e) => {
662
+ * trackEvent('link_click', { href: '/products' });
663
+ * }}
664
+ * >
665
+ * Products
666
+ * </Link>
667
+ * ```
668
+ */
669
+ onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
670
+ /**
671
+ * Event handler called when a pointer device button is pressed on the link.
672
+ *
673
+ * Use this for specific pointer interactions like:
674
+ * - Drag-and-drop detection
675
+ * - Touch gesture recognition
676
+ * - Distinguishing input types (mouse vs touch vs pen)
677
+ * - Providing early visual feedback before click completes
678
+ *
679
+ * **⚠️ Accessibility Note**: Unlike `onClick`, this does NOT fire for
680
+ * keyboard activation (Enter key). If you need to track all user interactions
681
+ * including keyboard users, use `onClick` instead.
682
+ *
683
+ * @param event - The pointer event
684
+ * @example
685
+ * ```tsx
686
+ * // Use onPointerDown for pointer-specific interactions
687
+ * <Link
688
+ * href="/products"
689
+ * onPointerDown={(e) => {
690
+ * // Distinguish between mouse (2), touch (5), and pen (3)
691
+ * console.log('Pointer type:', e.pointerType);
692
+ * }}
693
+ * >
694
+ * Products
695
+ * </Link>
696
+ * ```
697
+ *
698
+ * @example
699
+ * ```tsx
700
+ * // ✅ Use both handlers together for comprehensive tracking
701
+ * <Link
702
+ * href="/products"
703
+ * onClick={(e) => trackAllActivations(e)}
704
+ * onPointerDown={(e) => provideFeedback(e)}
705
+ * >
706
+ * Products
707
+ * </Link>
708
+ * ```
709
+ */
710
+ onPointerDown?: (event: React.PointerEvent<HTMLAnchorElement>) => void;
711
+ /**
712
+ * Icon element to display in the link (used by IconLink).
713
+ *
714
+ * @example
715
+ * ```tsx
716
+ * <IconLink href="/home" icon={<HomeIcon />} />
717
+ * ```
718
+ */
719
+ icon?: React.ReactNode;
720
+ } & Omit<React.ComponentPropsWithoutRef<"a">, 'style'>;
721
+
331
722
  /**
332
723
  * Props for the TextToSpeechComponent.
333
724
  * @interface TextToSpeechComponentProps
@@ -955,4 +1346,4 @@ type FPComponent = {
955
1346
  */
956
1347
  declare const FP: FPComponent;
957
1348
 
958
- export { Article, Aside, Badge, BadgeProps, FP as Box, Caption, ComponentProps$1 as ComponentProps, Details, FP, Footer, Header, Img, ImgProps, Landmarks, 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,42 +1,44 @@
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';
5
- export { a as Dialog } from './chunk-X3JCTEPD.js';
5
+ export { a as Dialog } from './chunk-QKHPHMG2.js';
6
6
  export { c as Nav, b as NavItem, a as NavList } from './chunk-FVROL3V5.js';
7
7
  export { b as List } from './chunk-IEB64SWY.js';
8
8
  export { b as Popover } from './chunk-23ANBDCR.js';
9
9
  export { a as Text } from './chunk-IQ76HGVP.js';
10
10
  export { b as Heading, a as Title } from './chunk-ZFJ4U45S.js';
11
- export { b as Breadcrumb, a as useBreadcrumbSegments } from './chunk-X5LGFCWG.js';
11
+ export { b as Breadcrumb, a as useBreadcrumbSegments } from './chunk-UJAQVHWC.js';
12
12
  import './chunk-GCGKYLDG.js';
13
13
  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
- export { a as Modal } from './chunk-7XPFW7CB.js';
17
- export { a as Button } from './chunk-OVWLQYMK.js';
16
+ export { a as Modal } from './chunk-43TK2ICH.js';
17
+ import { b } from './chunk-KVKQLRJG.js';
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';
20
21
  import './chunk-BFK62VX5.js';
21
22
  import './chunk-75QHTLFO.js';
22
- export { a as Link, b as To } from './chunk-UEPAWMDF.js';
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