@fpkit/acss 6.1.0 → 6.3.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.
- package/libs/chunk-25KCUE3R.cjs +17 -0
- package/libs/chunk-25KCUE3R.cjs.map +1 -0
- package/libs/chunk-34NWHFHP.js +10 -0
- package/libs/chunk-34NWHFHP.js.map +1 -0
- package/libs/{chunk-SQ44OCJ2.js → chunk-6NMLU5FA.js} +2 -2
- package/libs/{chunk-GVVCXXKI.cjs → chunk-6YVR4TDM.cjs} +3 -3
- package/libs/chunk-DSQ2TUCR.js +7 -0
- package/libs/chunk-DSQ2TUCR.js.map +1 -0
- package/libs/{chunk-H6A2CUWA.js → chunk-VQTCTLFN.js} +2 -2
- package/libs/chunk-ZJ4RUKI2.cjs +14 -0
- package/libs/chunk-ZJ4RUKI2.cjs.map +1 -0
- package/libs/{chunk-H4JRUNKU.cjs → chunk-ZOPHCNFD.cjs} +3 -3
- package/libs/components/button.cjs +3 -3
- package/libs/components/button.d.cts +34 -1
- package/libs/components/button.d.ts +34 -1
- package/libs/components/button.js +1 -1
- package/libs/components/buttons/button.css +1 -1
- package/libs/components/buttons/button.css.map +1 -1
- package/libs/components/buttons/button.min.css +2 -2
- package/libs/components/buttons/icon-button.css +1 -0
- package/libs/components/buttons/icon-button.css.map +1 -0
- package/libs/components/buttons/icon-button.min.css +3 -0
- package/libs/components/dialog/dialog.cjs +4 -4
- package/libs/components/dialog/dialog.js +2 -2
- package/libs/components/icons/icon.d.cts +1 -1
- package/libs/components/icons/icon.d.ts +1 -1
- package/libs/components/layout/landmarks.css +1 -1
- package/libs/components/layout/landmarks.css.map +1 -1
- package/libs/components/layout/landmarks.min.css +2 -2
- package/libs/components/link/link.css +1 -1
- package/libs/components/link/link.min.css +1 -1
- package/libs/components/modal.cjs +3 -3
- package/libs/components/modal.js +2 -2
- package/libs/components/popover/popover.cjs +3 -8
- package/libs/components/popover/popover.css +1 -0
- package/libs/components/popover/popover.css.map +1 -0
- package/libs/components/popover/popover.d.cts +54 -26
- package/libs/components/popover/popover.d.ts +54 -26
- package/libs/components/popover/popover.js +1 -2
- package/libs/components/popover/popover.min.css +3 -0
- package/libs/hooks.cjs +3 -6
- package/libs/hooks.cjs.map +1 -1
- package/libs/hooks.d.cts +30 -10
- package/libs/hooks.d.ts +30 -10
- package/libs/hooks.js +5 -1
- package/libs/hooks.js.map +1 -1
- package/libs/{icons-48788561.d.ts → icons-2c09535c.d.ts} +32 -32
- package/libs/icons.d.cts +1 -1
- package/libs/icons.d.ts +1 -1
- package/libs/index.cjs +41 -40
- package/libs/index.cjs.map +1 -1
- package/libs/index.css +1 -1
- package/libs/index.css.map +1 -1
- package/libs/index.d.cts +101 -5
- package/libs/index.d.ts +101 -5
- package/libs/index.js +14 -15
- package/libs/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/buttons/README.mdx +107 -11
- package/src/components/buttons/STYLES.mdx +182 -47
- package/src/components/buttons/button.scss +93 -16
- package/src/components/buttons/button.stories.tsx +149 -0
- package/src/components/buttons/button.test.tsx +12 -0
- package/src/components/buttons/button.tsx +50 -6
- package/src/components/buttons/icon-button.scss +45 -0
- package/src/components/buttons/icon-button.stories.tsx +200 -0
- package/src/components/buttons/icon-button.test.tsx +132 -0
- package/src/components/buttons/icon-button.tsx +72 -0
- package/src/components/form/select.tsx +55 -51
- package/src/components/layout/README.mdx +1117 -0
- package/src/components/layout/STYLES.mdx +159 -4
- package/src/components/layout/fieldset.stories.tsx +387 -0
- package/src/components/layout/landmarks.scss +115 -2
- package/src/components/layout/landmarks.stories.tsx +2 -6
- package/src/components/layout/landmarks.tsx +96 -27
- package/src/components/link/link.scss +2 -2
- package/src/components/popover/README.mdx +478 -0
- package/src/components/popover/STYLES.mdx +389 -0
- package/src/components/popover/index.ts +3 -0
- package/src/components/popover/popover.scss +249 -0
- package/src/components/popover/popover.stories.tsx +315 -15
- package/src/components/popover/popover.test.tsx +249 -37
- package/src/components/popover/popover.tsx +165 -62
- package/src/hooks/popover/popover.tsx +26 -10
- package/src/hooks/popover/use-popover.tsx +30 -10
- package/src/hooks.ts +5 -0
- package/src/index.scss +1 -0
- package/src/index.ts +1 -0
- package/src/styles/buttons/button.css +78 -16
- package/src/styles/buttons/button.css.map +1 -1
- package/src/styles/buttons/icon-button.css +32 -0
- package/src/styles/buttons/icon-button.css.map +1 -0
- package/src/styles/index.css +350 -18
- package/src/styles/index.css.map +1 -1
- package/src/styles/layout/landmarks.css +83 -0
- package/src/styles/layout/landmarks.css.map +1 -1
- package/src/styles/link/link.css +2 -2
- package/src/styles/popover/popover.css +190 -0
- package/src/styles/popover/popover.css.map +1 -0
- package/src/types/popover.d.ts +64 -0
- package/libs/chunk-4I5MF54P.js +0 -8
- package/libs/chunk-4I5MF54P.js.map +0 -1
- package/libs/chunk-GCGKYLDG.js +0 -7
- package/libs/chunk-GCGKYLDG.js.map +0 -1
- package/libs/chunk-NZVSXRTB.cjs +0 -16
- package/libs/chunk-NZVSXRTB.cjs.map +0 -1
- package/libs/chunk-PDD4N5P5.cjs +0 -10
- package/libs/chunk-PDD4N5P5.cjs.map +0 -1
- package/libs/chunk-S7NIA6PI.cjs +0 -17
- package/libs/chunk-S7NIA6PI.cjs.map +0 -1
- package/libs/chunk-X2RDXWH5.js +0 -10
- package/libs/chunk-X2RDXWH5.js.map +0 -1
- /package/libs/{chunk-SQ44OCJ2.js.map → chunk-6NMLU5FA.js.map} +0 -0
- /package/libs/{chunk-GVVCXXKI.cjs.map → chunk-6YVR4TDM.cjs.map} +0 -0
- /package/libs/{chunk-H6A2CUWA.js.map → chunk-VQTCTLFN.js.map} +0 -0
- /package/libs/{chunk-H4JRUNKU.cjs.map → chunk-ZOPHCNFD.cjs.map} +0 -0
package/libs/index.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
1
|
+
import { ButtonProps } from './components/button.cjs';
|
|
2
|
+
export { Button } from './components/button.cjs';
|
|
3
3
|
import React$1, { ReactNode } from 'react';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
export { Card, Content as CardContent, Footer as CardFooter, CardProps, Title as CardTitle } from './components/card.cjs';
|
|
5
|
+
import { I as IconProps } from './icons-2c09535c.js';
|
|
6
|
+
export { a as Icon, b as IconProps } from './icons-2c09535c.js';
|
|
6
7
|
export { default as Field, FieldProps } from './components/form/fields.cjs';
|
|
7
8
|
export { default as Input } from './components/form/inputs.cjs';
|
|
8
9
|
import { I as InputProps } from './form.types-d25ebfac.js';
|
|
@@ -22,6 +23,64 @@ export { default as Textarea } from './components/form/textarea.cjs';
|
|
|
22
23
|
export { default as Breadcrumb, BreadcrumbProps, CustomRoute, useBreadcrumbSegments } from './components/breadcrumbs/breadcrumb.cjs';
|
|
23
24
|
export { L as ListItemProps, a as ListProps } from './list.types-bf2c44c1.js';
|
|
24
25
|
|
|
26
|
+
/**
|
|
27
|
+
* XOR constraint: exactly one of aria-label or aria-labelledby is required.
|
|
28
|
+
* Passing both or neither is a TypeScript compile-time error.
|
|
29
|
+
* Satisfies WCAG 2.1 SC 1.1.1 (Non-text Content).
|
|
30
|
+
*/
|
|
31
|
+
type WithAriaLabel = {
|
|
32
|
+
"aria-label": string;
|
|
33
|
+
"aria-labelledby"?: never;
|
|
34
|
+
};
|
|
35
|
+
type WithAriaLabelledBy = {
|
|
36
|
+
"aria-labelledby": string;
|
|
37
|
+
"aria-label"?: never;
|
|
38
|
+
};
|
|
39
|
+
type IconButtonProps = Omit<ButtonProps, "children"> & (WithAriaLabel | WithAriaLabelledBy) & {
|
|
40
|
+
/** The icon element rendered inside the button. */
|
|
41
|
+
icon: React$1.ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* Optional text shown alongside the icon at desktop widths.
|
|
44
|
+
* Hidden visually below the `$icon-label-bp` SCSS breakpoint (default 48rem / 768px),
|
|
45
|
+
* but remains in the accessibility tree — screen readers always announce it.
|
|
46
|
+
*
|
|
47
|
+
* NOTE: When `label` is used, the default `variant="icon"` removes padding.
|
|
48
|
+
* Override with a different variant (e.g. `variant="outline"`) for a padded layout.
|
|
49
|
+
*/
|
|
50
|
+
label?: string;
|
|
51
|
+
/** Button type: button, submit, or reset. Required. */
|
|
52
|
+
type: "button" | "submit" | "reset";
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Accessible icon button component. Wraps `Button` with:
|
|
56
|
+
* - Required accessible label via `aria-label` or `aria-labelledby` (XOR enforced)
|
|
57
|
+
* - Optional visible `label` text that hides on mobile (visual only — always in a11y tree)
|
|
58
|
+
* - `variant="icon"` default (square, no padding)
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* // Icon only
|
|
62
|
+
* <IconButton type="button" aria-label="Close menu" icon={<CloseIcon />} />
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* // Icon + label (label hides on mobile)
|
|
66
|
+
* <IconButton
|
|
67
|
+
* type="button"
|
|
68
|
+
* aria-label="Settings"
|
|
69
|
+
* icon={<SettingsIcon />}
|
|
70
|
+
* label="Settings"
|
|
71
|
+
* variant="outline"
|
|
72
|
+
* />
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* // Labelled by external element
|
|
76
|
+
* <span id="btn-label">Delete item</span>
|
|
77
|
+
* <IconButton type="button" aria-labelledby="btn-label" icon={<TrashIcon />} />
|
|
78
|
+
*/
|
|
79
|
+
declare const IconButton: {
|
|
80
|
+
({ icon, label, variant, type, ...props }: IconButtonProps): React$1.JSX.Element;
|
|
81
|
+
displayName: string;
|
|
82
|
+
};
|
|
83
|
+
|
|
25
84
|
/**
|
|
26
85
|
* Valid severity levels for alerts.
|
|
27
86
|
* Each severity has associated colors, icons, and ARIA attributes.
|
|
@@ -781,6 +840,7 @@ declare const Landmarks: {
|
|
|
781
840
|
Aside: ({ id, children, styles, classes, ...props }: ComponentProps) => React$1.JSX.Element;
|
|
782
841
|
Section: ({ id, children, styles, classes, ...props }: ComponentProps) => React$1.JSX.Element;
|
|
783
842
|
Article: ({ id, children, styles, classes, ...props }: ComponentProps) => React$1.JSX.Element;
|
|
843
|
+
Fieldset: ({ id, children, legend, description, descriptionId, styles, classes, ...props }: FieldsetProps) => React$1.JSX.Element;
|
|
784
844
|
};
|
|
785
845
|
type HeaderProps = {
|
|
786
846
|
headerBackground?: ReactNode;
|
|
@@ -830,6 +890,42 @@ declare const Section: ({ id, children, styles, classes, ...props }: ComponentPr
|
|
|
830
890
|
* @param props - Additional props to pass to the article element.
|
|
831
891
|
*/
|
|
832
892
|
declare const Article: ({ id, children, styles, classes, ...props }: ComponentProps) => React$1.JSX.Element;
|
|
893
|
+
type FieldsetProps = {
|
|
894
|
+
/**
|
|
895
|
+
* Optional legend content displayed as the fieldset's accessible name
|
|
896
|
+
*/
|
|
897
|
+
legend?: ReactNode;
|
|
898
|
+
/**
|
|
899
|
+
* Additional description text for complex fieldsets
|
|
900
|
+
* Enhances accessibility via aria-describedby
|
|
901
|
+
*/
|
|
902
|
+
description?: string;
|
|
903
|
+
/**
|
|
904
|
+
* Custom ID for the description element
|
|
905
|
+
* Auto-generated if description is provided without custom ID
|
|
906
|
+
*/
|
|
907
|
+
descriptionId?: string;
|
|
908
|
+
} & ComponentProps;
|
|
909
|
+
/**
|
|
910
|
+
* Fieldset landmark for semantic content grouping.
|
|
911
|
+
* Provides WCAG 2.1 Level AA compliant form grouping with optional descriptions.
|
|
912
|
+
*
|
|
913
|
+
* @param legend - Optional legend content (accessible name)
|
|
914
|
+
* @param description - Optional description for additional context
|
|
915
|
+
* @param descriptionId - Custom ID for description element
|
|
916
|
+
* @param children - Content inside fieldset section
|
|
917
|
+
*
|
|
918
|
+
* @example
|
|
919
|
+
* ```tsx
|
|
920
|
+
* <Fieldset
|
|
921
|
+
* legend="Shipping Address"
|
|
922
|
+
* description="This address will be used for delivery"
|
|
923
|
+
* >
|
|
924
|
+
* {/* form controls *\/}
|
|
925
|
+
* </Fieldset>
|
|
926
|
+
* ```
|
|
927
|
+
*/
|
|
928
|
+
declare const Fieldset: ({ id, children, legend, description, descriptionId, styles, classes, ...props }: FieldsetProps) => React$1.JSX.Element;
|
|
833
929
|
|
|
834
930
|
/**
|
|
835
931
|
* Shared types for layout primitive components (Box, Stack, Cluster, Grid)
|
|
@@ -2800,4 +2896,4 @@ type FPComponent = {
|
|
|
2800
2896
|
*/
|
|
2801
2897
|
declare const FP: FPComponent;
|
|
2802
2898
|
|
|
2803
|
-
export { Alert, AlertProps, Article, Aside, Badge, BadgeProps, Box, BoxProps, Caption, Checkbox, CheckboxProps, Cluster, ClusterProps, Col, ColProps, ComponentProps$1 as ComponentProps, Details, FP, Flex, FlexAlign, FlexAlignContent, FlexAlignSelf, FlexContainerElement, FlexDirection, FlexGap, FlexItemElement, FlexItemProps, FlexJustify, FlexProps, FlexSpacerProps, FlexVariant, FlexWrap, Footer, GridWithItem as Grid, GridItem, GridItemProps, GridProps, Header, Img, ImgProps, InputProps, Landmarks, Main, ResponsiveFlexProps, Row, RowProps, Section, Stack, StackProps, Table, Tag, TagProps, TagVariant, Tbody, Td, TextToSpeech, Thead, Tr, UI };
|
|
2899
|
+
export { Alert, AlertProps, Article, Aside, Badge, BadgeProps, Box, BoxProps, ButtonProps, Caption, Checkbox, CheckboxProps, Cluster, ClusterProps, Col, ColProps, ComponentProps$1 as ComponentProps, Details, FP, Fieldset, Flex, FlexAlign, FlexAlignContent, FlexAlignSelf, FlexContainerElement, FlexDirection, FlexGap, FlexItemElement, FlexItemProps, FlexJustify, FlexProps, FlexSpacerProps, FlexVariant, FlexWrap, Footer, GridWithItem as Grid, GridItem, GridItemProps, GridProps, Header, IconButton, IconButtonProps, Img, ImgProps, InputProps, Landmarks, Main, ResponsiveFlexProps, Row, RowProps, Section, Stack, StackProps, Table, Tag, TagProps, TagVariant, Tbody, Td, TextToSpeech, Thead, Tr, UI };
|
package/libs/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
1
|
+
import { ButtonProps } from './components/button.js';
|
|
2
|
+
export { Button } from './components/button.js';
|
|
3
3
|
import React$1, { ReactNode } from 'react';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
export { Card, Content as CardContent, Footer as CardFooter, CardProps, Title as CardTitle } from './components/card.js';
|
|
5
|
+
import { I as IconProps } from './icons-2c09535c.js';
|
|
6
|
+
export { a as Icon, b as IconProps } from './icons-2c09535c.js';
|
|
6
7
|
export { default as Field, FieldProps } from './components/form/fields.js';
|
|
7
8
|
export { default as Input } from './components/form/inputs.js';
|
|
8
9
|
import { I as InputProps } from './form.types-d25ebfac.js';
|
|
@@ -22,6 +23,64 @@ export { default as Textarea } from './components/form/textarea.js';
|
|
|
22
23
|
export { default as Breadcrumb, BreadcrumbProps, CustomRoute, useBreadcrumbSegments } from './components/breadcrumbs/breadcrumb.js';
|
|
23
24
|
export { L as ListItemProps, a as ListProps } from './list.types-bf2c44c1.js';
|
|
24
25
|
|
|
26
|
+
/**
|
|
27
|
+
* XOR constraint: exactly one of aria-label or aria-labelledby is required.
|
|
28
|
+
* Passing both or neither is a TypeScript compile-time error.
|
|
29
|
+
* Satisfies WCAG 2.1 SC 1.1.1 (Non-text Content).
|
|
30
|
+
*/
|
|
31
|
+
type WithAriaLabel = {
|
|
32
|
+
"aria-label": string;
|
|
33
|
+
"aria-labelledby"?: never;
|
|
34
|
+
};
|
|
35
|
+
type WithAriaLabelledBy = {
|
|
36
|
+
"aria-labelledby": string;
|
|
37
|
+
"aria-label"?: never;
|
|
38
|
+
};
|
|
39
|
+
type IconButtonProps = Omit<ButtonProps, "children"> & (WithAriaLabel | WithAriaLabelledBy) & {
|
|
40
|
+
/** The icon element rendered inside the button. */
|
|
41
|
+
icon: React$1.ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* Optional text shown alongside the icon at desktop widths.
|
|
44
|
+
* Hidden visually below the `$icon-label-bp` SCSS breakpoint (default 48rem / 768px),
|
|
45
|
+
* but remains in the accessibility tree — screen readers always announce it.
|
|
46
|
+
*
|
|
47
|
+
* NOTE: When `label` is used, the default `variant="icon"` removes padding.
|
|
48
|
+
* Override with a different variant (e.g. `variant="outline"`) for a padded layout.
|
|
49
|
+
*/
|
|
50
|
+
label?: string;
|
|
51
|
+
/** Button type: button, submit, or reset. Required. */
|
|
52
|
+
type: "button" | "submit" | "reset";
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Accessible icon button component. Wraps `Button` with:
|
|
56
|
+
* - Required accessible label via `aria-label` or `aria-labelledby` (XOR enforced)
|
|
57
|
+
* - Optional visible `label` text that hides on mobile (visual only — always in a11y tree)
|
|
58
|
+
* - `variant="icon"` default (square, no padding)
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* // Icon only
|
|
62
|
+
* <IconButton type="button" aria-label="Close menu" icon={<CloseIcon />} />
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* // Icon + label (label hides on mobile)
|
|
66
|
+
* <IconButton
|
|
67
|
+
* type="button"
|
|
68
|
+
* aria-label="Settings"
|
|
69
|
+
* icon={<SettingsIcon />}
|
|
70
|
+
* label="Settings"
|
|
71
|
+
* variant="outline"
|
|
72
|
+
* />
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* // Labelled by external element
|
|
76
|
+
* <span id="btn-label">Delete item</span>
|
|
77
|
+
* <IconButton type="button" aria-labelledby="btn-label" icon={<TrashIcon />} />
|
|
78
|
+
*/
|
|
79
|
+
declare const IconButton: {
|
|
80
|
+
({ icon, label, variant, type, ...props }: IconButtonProps): React$1.JSX.Element;
|
|
81
|
+
displayName: string;
|
|
82
|
+
};
|
|
83
|
+
|
|
25
84
|
/**
|
|
26
85
|
* Valid severity levels for alerts.
|
|
27
86
|
* Each severity has associated colors, icons, and ARIA attributes.
|
|
@@ -781,6 +840,7 @@ declare const Landmarks: {
|
|
|
781
840
|
Aside: ({ id, children, styles, classes, ...props }: ComponentProps) => React$1.JSX.Element;
|
|
782
841
|
Section: ({ id, children, styles, classes, ...props }: ComponentProps) => React$1.JSX.Element;
|
|
783
842
|
Article: ({ id, children, styles, classes, ...props }: ComponentProps) => React$1.JSX.Element;
|
|
843
|
+
Fieldset: ({ id, children, legend, description, descriptionId, styles, classes, ...props }: FieldsetProps) => React$1.JSX.Element;
|
|
784
844
|
};
|
|
785
845
|
type HeaderProps = {
|
|
786
846
|
headerBackground?: ReactNode;
|
|
@@ -830,6 +890,42 @@ declare const Section: ({ id, children, styles, classes, ...props }: ComponentPr
|
|
|
830
890
|
* @param props - Additional props to pass to the article element.
|
|
831
891
|
*/
|
|
832
892
|
declare const Article: ({ id, children, styles, classes, ...props }: ComponentProps) => React$1.JSX.Element;
|
|
893
|
+
type FieldsetProps = {
|
|
894
|
+
/**
|
|
895
|
+
* Optional legend content displayed as the fieldset's accessible name
|
|
896
|
+
*/
|
|
897
|
+
legend?: ReactNode;
|
|
898
|
+
/**
|
|
899
|
+
* Additional description text for complex fieldsets
|
|
900
|
+
* Enhances accessibility via aria-describedby
|
|
901
|
+
*/
|
|
902
|
+
description?: string;
|
|
903
|
+
/**
|
|
904
|
+
* Custom ID for the description element
|
|
905
|
+
* Auto-generated if description is provided without custom ID
|
|
906
|
+
*/
|
|
907
|
+
descriptionId?: string;
|
|
908
|
+
} & ComponentProps;
|
|
909
|
+
/**
|
|
910
|
+
* Fieldset landmark for semantic content grouping.
|
|
911
|
+
* Provides WCAG 2.1 Level AA compliant form grouping with optional descriptions.
|
|
912
|
+
*
|
|
913
|
+
* @param legend - Optional legend content (accessible name)
|
|
914
|
+
* @param description - Optional description for additional context
|
|
915
|
+
* @param descriptionId - Custom ID for description element
|
|
916
|
+
* @param children - Content inside fieldset section
|
|
917
|
+
*
|
|
918
|
+
* @example
|
|
919
|
+
* ```tsx
|
|
920
|
+
* <Fieldset
|
|
921
|
+
* legend="Shipping Address"
|
|
922
|
+
* description="This address will be used for delivery"
|
|
923
|
+
* >
|
|
924
|
+
* {/* form controls *\/}
|
|
925
|
+
* </Fieldset>
|
|
926
|
+
* ```
|
|
927
|
+
*/
|
|
928
|
+
declare const Fieldset: ({ id, children, legend, description, descriptionId, styles, classes, ...props }: FieldsetProps) => React$1.JSX.Element;
|
|
833
929
|
|
|
834
930
|
/**
|
|
835
931
|
* Shared types for layout primitive components (Box, Stack, Cluster, Grid)
|
|
@@ -2800,4 +2896,4 @@ type FPComponent = {
|
|
|
2800
2896
|
*/
|
|
2801
2897
|
declare const FP: FPComponent;
|
|
2802
2898
|
|
|
2803
|
-
export { Alert, AlertProps, Article, Aside, Badge, BadgeProps, Box, BoxProps, Caption, Checkbox, CheckboxProps, Cluster, ClusterProps, Col, ColProps, ComponentProps$1 as ComponentProps, Details, FP, Flex, FlexAlign, FlexAlignContent, FlexAlignSelf, FlexContainerElement, FlexDirection, FlexGap, FlexItemElement, FlexItemProps, FlexJustify, FlexProps, FlexSpacerProps, FlexVariant, FlexWrap, Footer, GridWithItem as Grid, GridItem, GridItemProps, GridProps, Header, Img, ImgProps, InputProps, Landmarks, Main, ResponsiveFlexProps, Row, RowProps, Section, Stack, StackProps, Table, Tag, TagProps, TagVariant, Tbody, Td, TextToSpeech, Thead, Tr, UI };
|
|
2899
|
+
export { Alert, AlertProps, Article, Aside, Badge, BadgeProps, Box, BoxProps, ButtonProps, Caption, Checkbox, CheckboxProps, Cluster, ClusterProps, Col, ColProps, ComponentProps$1 as ComponentProps, Details, FP, Fieldset, Flex, FlexAlign, FlexAlignContent, FlexAlignSelf, FlexContainerElement, FlexDirection, FlexGap, FlexItemElement, FlexItemProps, FlexJustify, FlexProps, FlexSpacerProps, FlexVariant, FlexWrap, Footer, GridWithItem as Grid, GridItem, GridItemProps, GridProps, Header, IconButton, IconButtonProps, Img, ImgProps, InputProps, Landmarks, Main, ResponsiveFlexProps, Row, RowProps, Section, Stack, StackProps, Table, Tag, TagProps, TagVariant, Tbody, Td, TextToSpeech, Thead, Tr, UI };
|
package/libs/index.js
CHANGED
|
@@ -2,20 +2,19 @@ import { b as b$2 } from './chunk-6ADHES7B.js';
|
|
|
2
2
|
export { a as Textarea } from './chunk-6ADHES7B.js';
|
|
3
3
|
export { a as Field } from './chunk-MAG46S3P.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-FMIM3332.js';
|
|
5
|
-
export { a as Dialog } from './chunk-
|
|
5
|
+
export { a as Dialog } from './chunk-VQTCTLFN.js';
|
|
6
6
|
export { c as Nav, b as NavItem, a as NavList } from './chunk-3ENBUQIB.js';
|
|
7
7
|
export { c as List } from './chunk-RQSMWB3J.js';
|
|
8
|
-
export {
|
|
8
|
+
export { a as Popover } from './chunk-DSQ2TUCR.js';
|
|
9
9
|
export { a as Text } from './chunk-SPESKPUA.js';
|
|
10
10
|
export { b as Heading, a as Title } from './chunk-AQAI6COH.js';
|
|
11
11
|
export { b as Breadcrumb, a as useBreadcrumbSegments } from './chunk-2ZJV6KQ3.js';
|
|
12
|
-
import './chunk-GCGKYLDG.js';
|
|
13
12
|
import { b as b$1 } from './chunk-4F6SI5V5.js';
|
|
14
13
|
export { a as Icon } from './chunk-4F6SI5V5.js';
|
|
15
14
|
export { d as Card, b as CardContent, c as CardFooter, a as CardTitle } from './chunk-MJJKNHVH.js';
|
|
16
|
-
export { a as Modal } from './chunk-
|
|
17
|
-
import { b } from './chunk-
|
|
18
|
-
export { a as Button } from './chunk-
|
|
15
|
+
export { a as Modal } from './chunk-6NMLU5FA.js';
|
|
16
|
+
import { b, a as a$2 } from './chunk-34NWHFHP.js';
|
|
17
|
+
export { a as Button } from './chunk-34NWHFHP.js';
|
|
19
18
|
import { a as a$1 } from './chunk-F5EYMVQM.js';
|
|
20
19
|
export { a as Input } from './chunk-F5EYMVQM.js';
|
|
21
20
|
export { a as FP } from './chunk-6SAHIYCZ.js';
|
|
@@ -24,22 +23,22 @@ import './chunk-75QHTLFO.js';
|
|
|
24
23
|
export { d as Link, d as To } from './chunk-M5ES7OWP.js';
|
|
25
24
|
import { a } from './chunk-4KJP3L35.js';
|
|
26
25
|
export { a as UI } from './chunk-4KJP3L35.js';
|
|
27
|
-
import
|
|
26
|
+
import v, { useCallback, useMemo, useState, useEffect } from 'react';
|
|
28
27
|
|
|
29
|
-
var
|
|
28
|
+
var re=({icon:e,label:t,variant:o="icon",type:s="button",...r})=>v.createElement(a$2,{variant:o,"data-icon-btn":t?"has-label":"icon",...r,type:s},e,t&&v.createElement("span",{"data-icon-label":!0},t));re.displayName="IconButton";var Je={default:"",info:"Information: ",success:"Success: ",warning:"Warning: ",error:"Error: "},W=({severity:e})=>{let t=Je[e];return t?v.createElement("span",{className:"sr-only"},t):null};var Ke=(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],_=({severity:e,iconProps:t,hideIcon:o})=>{if(o)return null;let s=Ke(e,t);return v.createElement(a,{"aria-hidden":"true",className:"alert-icon"},s)};var q=({title:e,titleLevel:t})=>{if(!e)return null;let o=t?`h${t}`:"strong";return v.createElement(a,{as:o,className:"alert-title"},e)};var K=({children:e,contentType:t})=>t==="node"?v.createElement(v.Fragment,null,e):v.createElement(a,{as:"p"},e);var X=({actions:e})=>e?v.createElement(a,{as:"div",className:"alert-actions"},e):null;var ne=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})))),ie=ne;ne.displayName="DismissButton";var Ye={default:"polite",info:"polite",success:"polite",warning:"polite",error:"assertive"},R=v.forwardRef(({severity:e,variant:t,isVisible:o,dismissible:s,onDismiss:r,onInteractionStart:i,onInteractionEnd:a$1,autoFocus:l,title:p,titleLevel:y,children:u,contentType:f,actions:I,hideIcon:g,iconProps:b,...d},x)=>v.createElement(a,{as:"div",ref:x,role:"alert","aria-live":Ye[e],"aria-atomic":"true",className:`alert alert-${e}`,"data-alert":e,"data-visible":o,"data-variant":t,tabIndex:l?-1:void 0,onMouseEnter:i,onMouseLeave:a$1,onFocus:i,onBlur:a$1,...d},v.createElement(W,{severity:e}),v.createElement(_,{severity:e,iconProps:b,hideIcon:g}),v.createElement(a,{as:"div",classes:"alert-message"},v.createElement(q,{title:p,titleLevel:y}),v.createElement(K,{contentType:f},u),v.createElement(X,{actions:I})),s&&v.createElement(ie,{onDismiss:r})));R.displayName="AlertView";var Ze=({open:e,onDismiss:t,dismissible:o,autoHideDuration:s,pauseOnHover:r,autoFocus:i,alertRef:a})=>{let[l,p]=v.useState(e),[y,u]=v.useState(e),[f,I]=v.useState(!1),g=v.useCallback(()=>{p(!1),setTimeout(()=>{u(!1),t?.();},300);},[t]);v.useEffect(()=>{e?(u(!0),p(!0)):p(!1);},[e]),v.useEffect(()=>{if(!s||!l||f)return;let x=setTimeout(()=>{g();},s);return ()=>clearTimeout(x)},[s,l,f,g]),v.useEffect(()=>{if(!o||!l)return;let x=h=>{h.key==="Escape"&&g();};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[o,l,g]),v.useEffect(()=>{i&&l&&a.current&&a.current.focus();},[i,l,a]);let b=v.useCallback(()=>{r&&s&&I(!0);},[r,s]),d=v.useCallback(()=>{r&&s&&I(!1);},[r,s]);return {isVisible:l,shouldRender:y,handleDismiss:g,handleInteractionStart:b,handleInteractionEnd:d}},ae=({open:e,severity:t="default",children:o,title:s,dismissible:r=!1,onDismiss:i,iconSize:a,iconProps:l,hideIcon:p,autoHideDuration:y,pauseOnHover:u=!0,titleLevel:f=3,actions:I,autoFocus:g=!1,variant:b="outlined",contentType:d="text",...x})=>{let h=v.useRef(null),{isVisible:c,shouldRender:m,handleDismiss:F,handleInteractionStart:S,handleInteractionEnd:w}=Ze({open:e,onDismiss:i,dismissible:r,autoHideDuration:y,pauseOnHover:u,autoFocus:g,alertRef:h});if(!m)return null;let U={size:a||16,...l};return v.createElement(R,{ref:h,severity:t,variant:b,isVisible:c,dismissible:r,onDismiss:F,onInteractionStart:S,onInteractionEnd:w,autoFocus:g,title:s,titleLevel:f,contentType:d,actions:I,hideIcon:p,iconProps:U,...x},o)};ae.displayName="Alert";var le=v.forwardRef(({id:e,label:t,checked:o,defaultChecked:s,value:r="on",onChange:i,classes:a,inputClasses:l,styles:p,size:y,name:u,disabled:f,required:I,validationState:g,errorMessage:b,hintText:d,onBlur:x,onFocus:h,autoFocus:c,...m},F)=>{let S=v.useCallback(Be=>{i?.(Be.target.checked);},[i]),w=o!==void 0,U=w?{checked:o}:{},Ne=!w&&s!==void 0?{defaultChecked:s}:{},j=v.useRef(w);return v.useEffect(()=>{process.env.NODE_ENV==="development"&&(j.current!==w&&console.warn(`Checkbox with id="${e}" is changing from ${j.current?"controlled":"uncontrolled"} to ${w?"controlled":"uncontrolled"}. This is likely a bug. Decide between using "checked" (controlled) or "defaultChecked" (uncontrolled) and stick with it.`),j.current=w);},[w,e]),v.createElement("div",{className:a,style:p,"data-checkbox-size":y},v.createElement(a$1,{ref:F,type:"checkbox",id:e,name:u,value:r,...U,...Ne,classes:l||"checkbox-input",disabled:f,required:I,validationState:g,errorMessage:b,hintText:d,onChange:S,onBlur:x,onFocus:h,autoFocus:c,...m}),v.createElement("label",{htmlFor:e,className:"checkbox-label"},t,I&&v.createElement("span",{className:"checkbox-required","aria-label":"required"}," *")))});le.displayName="Checkbox";var pe=({src:e="//",alt:t,width:o=480,height:s,styles:r,loading:i="lazy",placeholder:a$1,fetchpriority:l="low",decoding:p="auto",srcSet:y,sizes:u,onError:f,onLoad:I,...g})=>{let b=useMemo(()=>{let c=typeof o=="number"?o:480,m=typeof s=="number"?s:Math.round(c*.75),F=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${c} ${m}">
|
|
30
29
|
<defs>
|
|
31
|
-
<linearGradient id="grad-${
|
|
30
|
+
<linearGradient id="grad-${c}-${m}" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
32
31
|
<stop offset="0%" style="stop-color:#6366f1;stop-opacity:1" />
|
|
33
32
|
<stop offset="50%" style="stop-color:#8b5cf6;stop-opacity:1" />
|
|
34
33
|
<stop offset="100%" style="stop-color:#ec4899;stop-opacity:1" />
|
|
35
34
|
</linearGradient>
|
|
36
35
|
</defs>
|
|
37
|
-
<rect width="${
|
|
38
|
-
<circle cx="${
|
|
39
|
-
<path d="M0,${
|
|
40
|
-
<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(
|
|
41
|
-
</svg>`;return `data:image/svg+xml,${encodeURIComponent(E)}`},[o,s]),m=a$1??v;return C.createElement(a,{as:"img",src:e,alt:t,width:o,height:s||"auto",loading:i,style:r,srcSet:y,sizes:u,onError:p=>{f&&f(p),p.defaultPrevented||p.currentTarget.src!==m&&(p.currentTarget.src=m);},onLoad:p=>{S?.(p);},decoding:c,...g,...l&&{fetchpriority:l}})};ie.displayName="Img";var ae=e=>{let[t,o]=useState([]),[s,r]=useState(e),[i,a]=useState(!1),[l,c]=useState(!1);return useEffect(()=>{let m=()=>{let x=window.speechSynthesis.getVoices();o(x);let h=x.find(p=>p.name==="Google US English");if(h)r(h);else {let p=x.find(d=>d.lang.startsWith("en-"));p&&r(p);}};return m(),window.speechSynthesis.onvoiceschanged=m,()=>{window.speechSynthesis.onvoiceschanged=null;}},[]),{speak:(m,x={},h)=>{let p=new SpeechSynthesisUtterance(m);p.lang=x.lang??"en-US",p.pitch=x.pitch??1,p.rate=x.rate??1,p.voice=s??x.voice??null,p.onend=()=>{a(!1),c(!1),h&&h();},"speechSynthesis"in window?(window.speechSynthesis.speak(p),a(!0),c(!1)):a(!1);},pause:()=>{i&&!l&&(window.speechSynthesis.pause(),c(!0));},resume:()=>{i&&l&&(window.speechSynthesis.resume(),c(!1));},cancel:()=>{i&&(window.speechSynthesis.cancel(),a(!1),c(!1));},isSpeaking:i,isPaused:l,availableVoices:t,changeVoice:m=>{r(m);},currentVoice:s,getAvailableLanguages:()=>[...new Set(t.map(m=>m.lang))]}};var tt=({children:e,onClick:t})=>C.createElement(a,{as:"button",type:"button",className:"tts-border","data-btn":"sm text pill",onClick:t},e),M=C.memo(tt),X=({label:e,isSpeaking:t,isPaused:o,onSpeak:s,onPause:r,onResume:i,onCancel:a$1})=>C.createElement(a,{as:"div","data-tts":!0},e&&C.createElement("p",null,e),!t&&C.createElement(M,{"aria-label":"Speak",onClick:s},C.createElement(b$1.PlaySolid,{size:16})),t&&!o&&C.createElement(M,{"aria-label":"Pause",onClick:r},C.createElement(b$1.PauseSolid,{size:16})),o&&C.createElement(M,{"aria-label":"Resume",onClick:i},C.createElement(b$1.ResumeSolid,{size:16})),C.createElement(M,{"aria-label":"Stop",onClick:a$1},C.createElement(b$1.StopSolid,{size:16})));X.displayName="TextToSpeechControls";X.TTSButton=M;var le=X;var pe=({initialText:e="",showTextInput:t=!1,voice:o,pitch:s=1,rate:r=1,label:i,onEnd:a})=>{let{speak:l,pause:c,resume:y,cancel:u,isSpeaking:f,isPaused:S}=ae(),[g,v]=useState(e);useEffect(()=>{v(e);},[e]);let m=()=>{g.trim()!==""&&l(g,{voice:o,pitch:s,rate:r},h);},x=p=>{v(p.target.value);},h=()=>{a&&a();};return C.createElement(C.Fragment,null,t&&C.createElement(b$2,{value:g,onChange:x}),C.createElement(le,{label:i,isSpeaking:f,isPaused:S,onSpeak:m,onPause:c,onResume:y,onCancel:u}))};pe.displayName="TextToSpeechComponent";var F=e=>C.createElement(C.Fragment,null,e),rt=({id:e,children:t,headerBackground:o,styles:s,classes:r,...i})=>C.createElement(a,{as:"header",id:e,styles:s,className:r,...i},o,C.createElement(a,{as:"section"},t)),nt=({id:e,children:t,styles:o,classes:s,...r})=>C.createElement(a,{as:"main",id:e,styles:o,...r,className:s},t),it=({id:e,classes:t,children:o,styles:s={},...r})=>C.createElement(a,{as:"footer",id:e,className:t,styles:s,...r},C.createElement(a,{as:"section"},o||"Copyright \xA9 2022")),at=({id:e,children:t,styles:o={},classes:s,...r})=>C.createElement(a,{as:"aside",id:e,styles:o,className:s,...r},C.createElement(a,{as:"section"},t)),lt=({id:e,children:t,styles:o,classes:s,...r})=>C.createElement(a,{as:"section",id:e,styles:o,className:s,...r},t),pt=({id:e,children:t,styles:o,classes:s,...r})=>C.createElement(a,{as:"article",id:e,styles:o,className:s,...r},t);F.displayName="Landmarks";F.Header=rt;F.Main=nt;F.Footer=it;F.Aside=at;F.Section=lt;F.Article=pt;var fe=C.forwardRef(({padding:e,paddingInline:t,paddingBlock:o,margin:s,marginInline:r,marginBlock:i,width:a$1,maxWidth:l,radius:c,as:y="div",className:u,classes:f,children:S,...g},v)=>{let m=[];e&&m.push(`box-padding-${e}`),t&&m.push(`box-padding-inline-${t}`),o&&m.push(`box-padding-block-${o}`),s&&m.push(`box-margin-${s}`),r&&m.push(`box-margin-inline-${r}`),i&&m.push(`box-margin-block-${i}`),a$1&&m.push(`box-width-${a$1}`),l&&m.push(`box-max-width-${l}`),c&&m.push(`box-radius-${c}`);let x=[...m,u,f].filter(Boolean).join(" ");return C.createElement(a,{as:y,ref:v,classes:x||void 0,...g},S)});fe.displayName="Box";var de=C.forwardRef(({gap:e,direction:t="vertical",align:o,justify:s,wrap:r,as:i="div",className:a$1,classes:l,children:c,...y},u)=>{let f=["stack"];t==="horizontal"?f.push("stack-horizontal"):f.push("stack-vertical"),e&&f.push(`stack-gap-${e}`),o&&f.push(`stack-align-${o}`),s&&f.push(`stack-justify-${s}`),r&&f.push(`stack-${r}`);let S=[...f,a$1,l].filter(Boolean).join(" ");return C.createElement(a,{as:i,ref:u,classes:S,...y},c)});de.displayName="Stack";var xe=C.forwardRef(({gap:e,justify:t,align:o,as:s="div",className:r,classes:i,children:a$1,...l},c)=>{let y=["cluster"];e&&y.push(`cluster-gap-${e}`),t&&y.push(`cluster-justify-${t}`),o&&y.push(`cluster-align-${o}`);let u=[...y,r,i].filter(Boolean).join(" ");return C.createElement(a,{as:s,ref:c,classes:u,...l},a$1)});xe.displayName="Cluster";var ye=C.forwardRef(({columns:e,auto:t,minColumnWidth:o,gap:s,gapX:r,gapY:i,justifyItems:a$1,alignItems:l,as:c="div",className:y,classes:u,children:f,style:S,styles:g,...v},m)=>{let x=["grid"];e&&x.push(`grid-cols-${e}`),t&&x.push(`grid-auto-${t}`),s&&x.push(`grid-gap-${s}`),r&&x.push(`grid-gap-x-${r}`),i&&x.push(`grid-gap-y-${i}`),a$1&&x.push(`grid-justify-items-${a$1}`),l&&x.push(`grid-align-items-${l}`);let h=[...x,y,u].filter(Boolean).join(" "),p={...S||{},...g||{}};return t&&o&&(p.gridTemplateColumns=`repeat(auto-${t}, minmax(${o}, 1fr))`),C.createElement(a,{as:c,ref:m,classes:h,style:Object.keys(p).length>0?p:void 0,...v},f)});ye.displayName="Grid";var Q=C.forwardRef(({span:e,rowSpan:t,as:o="div",className:s,classes:r,children:i,...a$1},l)=>{let c=[];e&&c.push(`grid-col-span-${e}`),t&&c.push(`grid-row-span-${t}`);let y=[...c,s,r].filter(Boolean).join(" ");return C.createElement(a,{as:o,ref:l,classes:y,...a$1},i)});Q.displayName="GridItem";var he=ye;he.Item=Q;var ct=he;var Se=C.forwardRef(({gap:e,justify:t,align:o,wrap:s,alwaysProportional:r=!1,as:i="div",className:a$1,classes:l,children:c,...y},u)=>{process.env.NODE_ENV==="development"&&r&&console.warn('[fpkit] Row: alwaysProportional is deprecated and will be removed in v5.0.0. Use responsive column utilities instead: className="col-sm-6 col-md-4"');let f=["col-row"];e&&f.push(`col-row-gap-${e}`),t&&f.push(`col-row-justify-${t}`),o&&f.push(`col-row-align-${o}`),s&&s!=="wrap"&&f.push(`col-row-${s}`),r&&f.push("col-row-proportional");let S=[...f,a$1,l].filter(Boolean).join(" ");return C.createElement(a,{as:i,ref:u,classes:S,...y},c)});Se.displayName="Row";var Ie=C.forwardRef(({span:e,offset:t,order:o,auto:s=!1,as:r="div",className:i,classes:a$1,children:l,...c},y)=>{let u=[];s?u.push("col-auto"):e==="flex"?u.push("col-flex"):e&&u.push(`col-${e}`),t!==void 0&&u.push(`col-offset-${t}`),o!==void 0&&u.push(`col-order-${o}`);let f=[...u,i,a$1].filter(Boolean).join(" ");return C.createElement(a,{as:r,ref:y,classes:f,...c},l)});Ie.displayName="Col";var B=(e,t="")=>{let o=[];if(e.direction){let s={row:"flex-row","row-reverse":"flex-row-reverse",column:"flex-col","column-reverse":"flex-col-reverse"};o.push(`${t}${s[e.direction]}`);}if(e.wrap){let s={wrap:"flex-wrap",nowrap:"flex-nowrap","wrap-reverse":"flex-wrap-reverse"};o.push(`${t}${s[e.wrap]}`);}if(e.gap&&o.push(`${t}gap-${e.gap}`),e.rowGap&&o.push(`${t}row-gap-${e.rowGap}`),e.colGap&&o.push(`${t}col-gap-${e.colGap}`),e.justify){let s={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"};o.push(`${t}${s[e.justify]}`);}if(e.align){let s={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"};o.push(`${t}${s[e.align]}`);}if(e.alignContent){let s={start:"content-start",end:"content-end",center:"content-center",between:"content-between",around:"content-around",evenly:"content-evenly",stretch:"content-stretch"};o.push(`${t}${s[e.alignContent]}`);}return o},Pe=C.forwardRef((e,t)=>{let{variant:o,inline:s=!1,as:r="div",className:i="",styles:a$1,children:l,sm:c,md:y,lg:u,xl:f,direction:S,wrap:g,gap:v,rowGap:m,colGap:x,justify:h,align:p,alignContent:d,...E}=e,P=[];if(P.push(s?"flex-inline":"flex"),o){let A={center:"flex-center",between:"flex-between",around:"flex-around",stack:"flex-stack",spread:"flex-spread"};P.push(A[o]);}P.push(...B({direction:S,wrap:g,gap:v,rowGap:m,colGap:x,justify:h,align:p,alignContent:d})),c&&P.push(...B(c,"sm:")),y&&P.push(...B(y,"md:")),u&&P.push(...B(u,"lg:")),f&&P.push(...B(f,"xl:"));let T=[...P,i].filter(Boolean).join(" ");return C.createElement(a,{as:r,ref:t,classes:T,styles:a$1,...E},l)});Pe.displayName="Flex";var Ce=C.forwardRef((e,t)=>{let{grow:o,shrink:s,basis:r,flex:i,alignSelf:a$1,order:l,as:c="div",className:y="",styles:u,children:f,sm:S,md:g,lg:v,xl:m,...x}=e,h=[];if(i){let d={1:"flex-1",auto:"flex-auto",initial:"flex-initial",none:"flex-none"};h.push(d[i]);}if(o!==void 0&&h.push(`flex-grow-${o}`),s!==void 0&&h.push(`flex-shrink-${s}`),r){let d={auto:"flex-basis-auto",0:"flex-basis-0",full:"flex-basis-full"};h.push(d[r]);}if(a$1){let d={auto:"self-auto",start:"self-start",end:"self-end",center:"self-center",baseline:"self-baseline",stretch:"self-stretch"};h.push(d[a$1]);}if(l){let d={first:"order-first",last:"order-last",none:"order-none"};h.push(d[l]);}if(S?.flex){let d={1:"flex-1",auto:"flex-auto",none:"flex-none"};h.push(`sm:${d[S.flex]}`);}if(g?.flex){let d={1:"flex-1",auto:"flex-auto",none:"flex-none"};h.push(`md:${d[g.flex]}`);}if(v?.flex){let d={1:"flex-1",auto:"flex-auto",none:"flex-none"};h.push(`lg:${d[v.flex]}`);}if(m?.flex){let d={1:"flex-1",auto:"flex-auto",none:"flex-none"};h.push(`xl:${d[m.flex]}`);}let p=[...h,y].filter(Boolean).join(" ");return C.createElement(a,{as:c,ref:t,classes:p,styles:u,...x},f)});Ce.displayName="Flex.Item";var be=C.forwardRef((e,t)=>{let{as:o="div",className:s="",styles:r,...i}=e,a$1=["flex-1",s].filter(Boolean).join(" ");return C.createElement(a,{as:o,ref:t,classes:a$1,styles:r,...i})});be.displayName="Flex.Spacer";var Y=Pe;Y.Item=Ce;Y.Spacer=be;var ft=Y;var we=({id:e,styles:t,classes:o,children:s,variant:r,...i})=>C.createElement(a,{as:"sup",id:e,styles:t,className:o,"data-badge":r||void 0,role:"status",...i},C.createElement(a,{as:"span"},s));we.displayName="Badge";var dt=({elm:e="span",role:t="note",variant:o,children:s,styles:r,...i})=>C.createElement(a,{as:e,role:t,"data-tag":o||void 0,styles:r,...i},s);dt.displayName="Tag";var ut=C.forwardRef(({summary:e,icon:t,styles:o,classes:s,ariaLabel:r,name:i,open:a$1,onPointerDown:l,onToggle:c,children:y,...u},f)=>{let S=useCallback(v=>{l?.(v);},[l]),g=useCallback(v=>{c?.(v);},[c]);return C.createElement(a,{as:"details",styles:o,classes:s,onToggle:g,ref:f,open:a$1,"aria-label":r,name:i,...u},C.createElement(a,{as:"summary",onPointerDown:S},t,e),C.createElement(a,{as:"section"},y))});ut.displayName="Details";
|
|
36
|
+
<rect width="${c}" height="${m}" fill="url(#grad-${c}-${m})"/>
|
|
37
|
+
<circle cx="${c*.15}" cy="${m*.2}" r="${Math.min(c,m)*.08}" fill="rgba(255,255,255,0.2)"/>
|
|
38
|
+
<path d="M0,${m*.75} Q${c*.25},${m*.65} ${c*.5},${m*.75} T${c},${m*.75} L${c},${m} L0,${m} 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(c,m)*.05)}" font-weight="500" fill="rgba(255,255,255,0.9)">${c}\xD7${m}</text>
|
|
40
|
+
</svg>`;return `data:image/svg+xml,${encodeURIComponent(F)}`},[o,s]),d=a$1??b;return v.createElement(a,{as:"img",src:e,alt:t,width:o,height:s||"auto",loading:i,style:r,srcSet:y,sizes:u,onError:c=>{f&&f(c),c.defaultPrevented||c.currentTarget.src!==d&&(c.currentTarget.src=d);},onLoad:c=>{I?.(c);},decoding:p,...g,...l&&{fetchpriority:l}})};pe.displayName="Img";var ce=e=>{let[t,o]=useState([]),[s,r]=useState(e),[i,a]=useState(!1),[l,p]=useState(!1);return useEffect(()=>{let d=()=>{let x=window.speechSynthesis.getVoices();o(x);let h=x.find(c=>c.name==="Google US English");if(h)r(h);else {let c=x.find(m=>m.lang.startsWith("en-"));c&&r(c);}};return d(),window.speechSynthesis.onvoiceschanged=d,()=>{window.speechSynthesis.onvoiceschanged=null;}},[]),{speak:(d,x={},h)=>{let c=new SpeechSynthesisUtterance(d);c.lang=x.lang??"en-US",c.pitch=x.pitch??1,c.rate=x.rate??1,c.voice=s??x.voice??null,c.onend=()=>{a(!1),p(!1),h&&h();},"speechSynthesis"in window?(window.speechSynthesis.speak(c),a(!0),p(!1)):a(!1);},pause:()=>{i&&!l&&(window.speechSynthesis.pause(),p(!0));},resume:()=>{i&&l&&(window.speechSynthesis.resume(),p(!1));},cancel:()=>{i&&(window.speechSynthesis.cancel(),a(!1),p(!1));},isSpeaking:i,isPaused:l,availableVoices:t,changeVoice:d=>{r(d);},currentVoice:s,getAvailableLanguages:()=>[...new Set(t.map(d=>d.lang))]}};var st=({children:e,onClick:t})=>v.createElement(a,{as:"button",type:"button",className:"tts-border","data-btn":"sm text pill",onClick:t},e),A=v.memo(st),Q=({label:e,isSpeaking:t,isPaused:o,onSpeak:s,onPause:r,onResume:i,onCancel:a$1})=>v.createElement(a,{as:"div","data-tts":!0},e&&v.createElement("p",null,e),!t&&v.createElement(A,{"aria-label":"Speak",onClick:s},v.createElement(b$1.PlaySolid,{size:16})),t&&!o&&v.createElement(A,{"aria-label":"Pause",onClick:r},v.createElement(b$1.PauseSolid,{size:16})),o&&v.createElement(A,{"aria-label":"Resume",onClick:i},v.createElement(b$1.ResumeSolid,{size:16})),v.createElement(A,{"aria-label":"Stop",onClick:a$1},v.createElement(b$1.StopSolid,{size:16})));Q.displayName="TextToSpeechControls";Q.TTSButton=A;var fe=Q;var de=({initialText:e="",showTextInput:t=!1,voice:o,pitch:s=1,rate:r=1,label:i,onEnd:a})=>{let{speak:l,pause:p,resume:y,cancel:u,isSpeaking:f,isPaused:I}=ce(),[g,b]=useState(e);useEffect(()=>{b(e);},[e]);let d=()=>{g.trim()!==""&&l(g,{voice:o,pitch:s,rate:r},h);},x=c=>{b(c.target.value);},h=()=>{a&&a();};return v.createElement(v.Fragment,null,t&&v.createElement(b$2,{value:g,onChange:x}),v.createElement(fe,{label:i,isSpeaking:f,isPaused:I,onSpeak:d,onPause:p,onResume:y,onCancel:u}))};de.displayName="TextToSpeechComponent";var E=e=>v.createElement(v.Fragment,null,e),it=({id:e,children:t,headerBackground:o,styles:s,classes:r,...i})=>v.createElement(a,{as:"header",id:e,styles:s,className:r,...i},o,v.createElement(a,{as:"section"},t)),at=({id:e,children:t,styles:o,classes:s,...r})=>v.createElement(a,{as:"main",id:e,styles:o,...r,className:s},t),lt=({id:e,classes:t,children:o,styles:s={},...r})=>v.createElement(a,{as:"footer",id:e,className:t,styles:s,...r},v.createElement(a,{as:"section"},o||"Copyright \xA9 2022")),pt=({id:e,children:t,styles:o={},classes:s,...r})=>v.createElement(a,{as:"aside",id:e,styles:o,className:s,...r},v.createElement(a,{as:"section"},t)),ct=({id:e,children:t,styles:o,classes:s,...r})=>v.createElement(a,{as:"section",id:e,styles:o,className:s,...r},t),ft=({id:e,children:t,styles:o,classes:s,...r})=>v.createElement(a,{as:"article",id:e,styles:o,className:s,...r},t),dt=({id:e,children:t,legend:o,description:s,descriptionId:r,styles:i,classes:a$1,...l})=>{let p=r||(s?`${e}-desc`:void 0);return v.createElement(a,{as:"fieldset",id:e,styles:i,className:a$1,"aria-describedby":p,...l},o&&v.createElement(a,{as:"legend"},o),s&&v.createElement("p",{id:p,className:"fieldset-description"},s),t)};E.displayName="Landmarks";E.Header=it;E.Main=at;E.Footer=lt;E.Aside=pt;E.Section=ct;E.Article=ft;E.Fieldset=dt;var ue=v.forwardRef(({padding:e,paddingInline:t,paddingBlock:o,margin:s,marginInline:r,marginBlock:i,width:a$1,maxWidth:l,radius:p,as:y="div",className:u,classes:f,children:I,...g},b)=>{let d=[];e&&d.push(`box-padding-${e}`),t&&d.push(`box-padding-inline-${t}`),o&&d.push(`box-padding-block-${o}`),s&&d.push(`box-margin-${s}`),r&&d.push(`box-margin-inline-${r}`),i&&d.push(`box-margin-block-${i}`),a$1&&d.push(`box-width-${a$1}`),l&&d.push(`box-max-width-${l}`),p&&d.push(`box-radius-${p}`);let x=[...d,u,f].filter(Boolean).join(" ");return v.createElement(a,{as:y,ref:b,classes:x||void 0,...g},I)});ue.displayName="Box";var ye=v.forwardRef(({gap:e,direction:t="vertical",align:o,justify:s,wrap:r,as:i="div",className:a$1,classes:l,children:p,...y},u)=>{let f=["stack"];t==="horizontal"?f.push("stack-horizontal"):f.push("stack-vertical"),e&&f.push(`stack-gap-${e}`),o&&f.push(`stack-align-${o}`),s&&f.push(`stack-justify-${s}`),r&&f.push(`stack-${r}`);let I=[...f,a$1,l].filter(Boolean).join(" ");return v.createElement(a,{as:i,ref:u,classes:I,...y},p)});ye.displayName="Stack";var ge=v.forwardRef(({gap:e,justify:t,align:o,as:s="div",className:r,classes:i,children:a$1,...l},p)=>{let y=["cluster"];e&&y.push(`cluster-gap-${e}`),t&&y.push(`cluster-justify-${t}`),o&&y.push(`cluster-align-${o}`);let u=[...y,r,i].filter(Boolean).join(" ");return v.createElement(a,{as:s,ref:p,classes:u,...l},a$1)});ge.displayName="Cluster";var Ie=v.forwardRef(({columns:e,auto:t,minColumnWidth:o,gap:s,gapX:r,gapY:i,justifyItems:a$1,alignItems:l,as:p="div",className:y,classes:u,children:f,style:I,styles:g,...b},d)=>{let x=["grid"];e&&x.push(`grid-cols-${e}`),t&&x.push(`grid-auto-${t}`),s&&x.push(`grid-gap-${s}`),r&&x.push(`grid-gap-x-${r}`),i&&x.push(`grid-gap-y-${i}`),a$1&&x.push(`grid-justify-items-${a$1}`),l&&x.push(`grid-align-items-${l}`);let h=[...x,y,u].filter(Boolean).join(" "),c={...I||{},...g||{}};return t&&o&&(c.gridTemplateColumns=`repeat(auto-${t}, minmax(${o}, 1fr))`),v.createElement(a,{as:p,ref:d,classes:h,style:Object.keys(c).length>0?c:void 0,...b},f)});Ie.displayName="Grid";var Y=v.forwardRef(({span:e,rowSpan:t,as:o="div",className:s,classes:r,children:i,...a$1},l)=>{let p=[];e&&p.push(`grid-col-span-${e}`),t&&p.push(`grid-row-span-${t}`);let y=[...p,s,r].filter(Boolean).join(" ");return v.createElement(a,{as:o,ref:l,classes:y,...a$1},i)});Y.displayName="GridItem";var be=Ie;be.Item=Y;var mt=be;var ve=v.forwardRef(({gap:e,justify:t,align:o,wrap:s,alwaysProportional:r=!1,as:i="div",className:a$1,classes:l,children:p,...y},u)=>{process.env.NODE_ENV==="development"&&r&&console.warn('[fpkit] Row: alwaysProportional is deprecated and will be removed in v5.0.0. Use responsive column utilities instead: className="col-sm-6 col-md-4"');let f=["col-row"];e&&f.push(`col-row-gap-${e}`),t&&f.push(`col-row-justify-${t}`),o&&f.push(`col-row-align-${o}`),s&&s!=="wrap"&&f.push(`col-row-${s}`),r&&f.push("col-row-proportional");let I=[...f,a$1,l].filter(Boolean).join(" ");return v.createElement(a,{as:i,ref:u,classes:I,...y},p)});ve.displayName="Row";var Ce=v.forwardRef(({span:e,offset:t,order:o,auto:s=!1,as:r="div",className:i,classes:a$1,children:l,...p},y)=>{let u=[];s?u.push("col-auto"):e==="flex"?u.push("col-flex"):e&&u.push(`col-${e}`),t!==void 0&&u.push(`col-offset-${t}`),o!==void 0&&u.push(`col-order-${o}`);let f=[...u,i,a$1].filter(Boolean).join(" ");return v.createElement(a,{as:r,ref:y,classes:f,...p},l)});Ce.displayName="Col";var L=(e,t="")=>{let o=[];if(e.direction){let s={row:"flex-row","row-reverse":"flex-row-reverse",column:"flex-col","column-reverse":"flex-col-reverse"};o.push(`${t}${s[e.direction]}`);}if(e.wrap){let s={wrap:"flex-wrap",nowrap:"flex-nowrap","wrap-reverse":"flex-wrap-reverse"};o.push(`${t}${s[e.wrap]}`);}if(e.gap&&o.push(`${t}gap-${e.gap}`),e.rowGap&&o.push(`${t}row-gap-${e.rowGap}`),e.colGap&&o.push(`${t}col-gap-${e.colGap}`),e.justify){let s={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"};o.push(`${t}${s[e.justify]}`);}if(e.align){let s={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"};o.push(`${t}${s[e.align]}`);}if(e.alignContent){let s={start:"content-start",end:"content-end",center:"content-center",between:"content-between",around:"content-around",evenly:"content-evenly",stretch:"content-stretch"};o.push(`${t}${s[e.alignContent]}`);}return o},Te=v.forwardRef((e,t)=>{let{variant:o,inline:s=!1,as:r="div",className:i="",styles:a$1,children:l,sm:p,md:y,lg:u,xl:f,direction:I,wrap:g,gap:b,rowGap:d,colGap:x,justify:h,align:c,alignContent:m,...F}=e,S=[];if(S.push(s?"flex-inline":"flex"),o){let U={center:"flex-center",between:"flex-between",around:"flex-around",stack:"flex-stack",spread:"flex-spread"};S.push(U[o]);}S.push(...L({direction:I,wrap:g,gap:b,rowGap:d,colGap:x,justify:h,align:c,alignContent:m})),p&&S.push(...L(p,"sm:")),y&&S.push(...L(y,"md:")),u&&S.push(...L(u,"lg:")),f&&S.push(...L(f,"xl:"));let w=[...S,i].filter(Boolean).join(" ");return v.createElement(a,{as:r,ref:t,classes:w,styles:a$1,...F},l)});Te.displayName="Flex";var we=v.forwardRef((e,t)=>{let{grow:o,shrink:s,basis:r,flex:i,alignSelf:a$1,order:l,as:p="div",className:y="",styles:u,children:f,sm:I,md:g,lg:b,xl:d,...x}=e,h=[];if(i){let m={1:"flex-1",auto:"flex-auto",initial:"flex-initial",none:"flex-none"};h.push(m[i]);}if(o!==void 0&&h.push(`flex-grow-${o}`),s!==void 0&&h.push(`flex-shrink-${s}`),r){let m={auto:"flex-basis-auto",0:"flex-basis-0",full:"flex-basis-full"};h.push(m[r]);}if(a$1){let m={auto:"self-auto",start:"self-start",end:"self-end",center:"self-center",baseline:"self-baseline",stretch:"self-stretch"};h.push(m[a$1]);}if(l){let m={first:"order-first",last:"order-last",none:"order-none"};h.push(m[l]);}if(I?.flex){let m={1:"flex-1",auto:"flex-auto",none:"flex-none"};h.push(`sm:${m[I.flex]}`);}if(g?.flex){let m={1:"flex-1",auto:"flex-auto",none:"flex-none"};h.push(`md:${m[g.flex]}`);}if(b?.flex){let m={1:"flex-1",auto:"flex-auto",none:"flex-none"};h.push(`lg:${m[b.flex]}`);}if(d?.flex){let m={1:"flex-1",auto:"flex-auto",none:"flex-none"};h.push(`xl:${m[d.flex]}`);}let c=[...h,y].filter(Boolean).join(" ");return v.createElement(a,{as:p,ref:t,classes:c,styles:u,...x},f)});we.displayName="Flex.Item";var $e=v.forwardRef((e,t)=>{let{as:o="div",className:s="",styles:r,...i}=e,a$1=["flex-1",s].filter(Boolean).join(" ");return v.createElement(a,{as:o,ref:t,classes:a$1,styles:r,...i})});$e.displayName="Flex.Spacer";var Z=Te;Z.Item=we;Z.Spacer=$e;var ut=Z;var Ee=({id:e,styles:t,classes:o,children:s,variant:r,...i})=>v.createElement(a,{as:"sup",id:e,styles:t,className:o,"data-badge":r||void 0,role:"status",...i},v.createElement(a,{as:"span"},s));Ee.displayName="Badge";var yt=({elm:e="span",role:t="note",variant:o,children:s,styles:r,...i})=>v.createElement(a,{as:e,role:t,"data-tag":o||void 0,styles:r,...i},s);yt.displayName="Tag";var ht=v.forwardRef(({summary:e,icon:t,styles:o,classes:s,ariaLabel:r,name:i,open:a$1,onPointerDown:l,onToggle:p,children:y,...u},f)=>{let I=useCallback(b=>{l?.(b);},[l]),g=useCallback(b=>{p?.(b);},[p]);return v.createElement(a,{as:"details",styles:o,classes:s,onToggle:g,ref:f,open:a$1,"aria-label":r,name:i,...u},v.createElement(a,{as:"summary",onPointerDown:I},t,e),v.createElement(a,{as:"section"},y))});ht.displayName="Details";
|
|
42
41
|
|
|
43
|
-
export {
|
|
42
|
+
export { ae as Alert, ft as Article, pt as Aside, Ee as Badge, ue as Box, le as Checkbox, ge as Cluster, Ce as Col, ht as Details, dt as Fieldset, ut as Flex, lt as Footer, mt as Grid, Y as GridItem, it as Header, re as IconButton, pe as Img, E as Landmarks, at as Main, ve as Row, ct as Section, ye as Stack, yt as Tag, de as TextToSpeech };
|
|
44
43
|
//# sourceMappingURL=out.js.map
|
|
45
44
|
//# sourceMappingURL=index.js.map
|