@fpkit/acss 0.4.19 → 0.5.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 (115) hide show
  1. package/package.json +2 -2
  2. package/src/components/badge/badge.stories.tsx +3 -3
  3. package/src/components/breadcrumbs/breadcrumb.stories.tsx +24 -8
  4. package/src/components/breadcrumbs/breadcrumb.tsx +47 -40
  5. package/src/components/buttons/button.stories.tsx +2 -2
  6. package/src/components/buttons/button.test.tsx +1 -1
  7. package/src/components/cards/card.stories.tsx +2 -2
  8. package/src/components/details/details.scss +10 -2
  9. package/src/components/details/details.stories.tsx +20 -4
  10. package/src/components/details/details.tsx +2 -1
  11. package/src/components/form/form.stories.tsx +2 -2
  12. package/src/components/form/input.stories.tsx +2 -2
  13. package/src/components/form/select.stories.tsx +2 -2
  14. package/src/components/form/select.tsx +23 -33
  15. package/src/components/fp.test.tsx +1 -1
  16. package/src/components/heading/heading.stories.tsx +2 -2
  17. package/src/components/images/figure.stories.tsx +3 -6
  18. package/src/components/images/img.stories.tsx +3 -3
  19. package/src/components/layout/footer.stories.tsx +2 -2
  20. package/src/components/layout/landmarks.stories.tsx +2 -2
  21. package/src/components/layout/main.stories.tsx +2 -2
  22. package/src/components/link/link.stories.tsx +2 -2
  23. package/src/components/list/list.stories.tsx +1 -2
  24. package/src/components/nav/nav.stories.tsx +4 -3
  25. package/src/components/popover/popover.stories.tsx +2 -2
  26. package/src/components/progress/progress.stories.tsx +2 -2
  27. package/src/components/tag/tag.stories.tsx +3 -3
  28. package/src/components/text/text.stories.tsx +6 -6
  29. package/src/patterns/page/page-header.stories.tsx +2 -2
  30. package/src/sass/_globals.scss +1 -0
  31. package/src/styles/cards/card.css +5 -0
  32. package/src/styles/cards/card.css.map +5 -1
  33. package/src/styles/details/details.css +9 -2
  34. package/src/styles/details/details.css.map +1 -1
  35. package/src/styles/form/form.css +3 -0
  36. package/src/styles/index.css +10 -2
  37. package/src/styles/index.css.map +1 -1
  38. package/LICENSE +0 -21
  39. package/libs/chunk-GCGKYLDG.js +0 -7
  40. package/libs/chunk-GCGKYLDG.js.map +0 -1
  41. package/libs/chunk-PDD4N5P5.cjs +0 -10
  42. package/libs/chunk-PDD4N5P5.cjs.map +0 -1
  43. package/libs/chunk-QHIABQNQ.js +0 -8
  44. package/libs/chunk-QHIABQNQ.js.map +0 -1
  45. package/libs/chunk-ZOHIKF6I.cjs +0 -31
  46. package/libs/chunk-ZOHIKF6I.cjs.map +0 -1
  47. package/libs/components/badge/badge.css +0 -1
  48. package/libs/components/badge/badge.css.map +0 -1
  49. package/libs/components/badge/badge.min.css +0 -3
  50. package/libs/components/breadcrumbs/breadcrumb.css +0 -1
  51. package/libs/components/breadcrumbs/breadcrumb.css.map +0 -1
  52. package/libs/components/breadcrumbs/breadcrumb.min.css +0 -3
  53. package/libs/components/buttons/button.css +0 -1
  54. package/libs/components/buttons/button.css.map +0 -1
  55. package/libs/components/buttons/button.min.css +0 -3
  56. package/libs/components/cards/card-style.css +0 -1
  57. package/libs/components/cards/card-style.css.map +0 -1
  58. package/libs/components/cards/card-style.min.css +0 -3
  59. package/libs/components/cards/card.css +0 -1
  60. package/libs/components/cards/card.css.map +0 -1
  61. package/libs/components/cards/card.min.css +0 -3
  62. package/libs/components/details/details.css +0 -1
  63. package/libs/components/details/details.css.map +0 -1
  64. package/libs/components/details/details.min.css +0 -3
  65. package/libs/components/form/form.css +0 -1
  66. package/libs/components/form/form.css.map +0 -1
  67. package/libs/components/form/form.min.css +0 -3
  68. package/libs/components/icons/icon.css +0 -1
  69. package/libs/components/icons/icon.css.map +0 -1
  70. package/libs/components/icons/icon.min.css +0 -3
  71. package/libs/components/images/img.css +0 -1
  72. package/libs/components/images/img.css.map +0 -1
  73. package/libs/components/images/img.min.css +0 -3
  74. package/libs/components/layout/landmarks.css +0 -1
  75. package/libs/components/layout/landmarks.css.map +0 -1
  76. package/libs/components/layout/landmarks.min.css +0 -3
  77. package/libs/components/link/link.css +0 -1
  78. package/libs/components/link/link.css.map +0 -1
  79. package/libs/components/link/link.min.css +0 -3
  80. package/libs/components/nav/nav.css +0 -1
  81. package/libs/components/nav/nav.css.map +0 -1
  82. package/libs/components/nav/nav.min.css +0 -3
  83. package/libs/components/progress/progress.css +0 -1
  84. package/libs/components/progress/progress.css.map +0 -1
  85. package/libs/components/progress/progress.min.css +0 -3
  86. package/libs/components/styles/index.css +0 -1
  87. package/libs/components/styles/index.css.map +0 -1
  88. package/libs/components/styles/index.min.css +0 -3
  89. package/libs/components/tag/tag.css +0 -1
  90. package/libs/components/tag/tag.css.map +0 -1
  91. package/libs/components/tag/tag.min.css +0 -3
  92. package/libs/components/text-to-speech/text-to-speech.css +0 -1
  93. package/libs/components/text-to-speech/text-to-speech.css.map +0 -1
  94. package/libs/components/text-to-speech/text-to-speech.min.css +0 -3
  95. package/libs/hooks.cjs +0 -12
  96. package/libs/hooks.cjs.map +0 -1
  97. package/libs/hooks.d.cts +0 -32
  98. package/libs/hooks.d.ts +0 -32
  99. package/libs/hooks.js +0 -3
  100. package/libs/hooks.js.map +0 -1
  101. package/libs/icons-1f5afc0c.d.ts +0 -318
  102. package/libs/icons.cjs +0 -12
  103. package/libs/icons.cjs.map +0 -1
  104. package/libs/icons.d.cts +0 -2
  105. package/libs/icons.d.ts +0 -2
  106. package/libs/icons.js +0 -3
  107. package/libs/icons.js.map +0 -1
  108. package/libs/index.cjs +0 -71
  109. package/libs/index.cjs.map +0 -1
  110. package/libs/index.css +0 -1
  111. package/libs/index.css.map +0 -1
  112. package/libs/index.d.cts +0 -558
  113. package/libs/index.d.ts +0 -558
  114. package/libs/index.js +0 -11
  115. package/libs/index.js.map +0 -1
package/libs/index.d.ts DELETED
@@ -1,558 +0,0 @@
1
- import { F as FP$1, C as ComponentProps$1 } from './icons-1f5afc0c.js';
2
- export { I as Icon } from './icons-1f5afc0c.js';
3
- import * as React from 'react';
4
- import React__default, { ReactNode } from 'react';
5
-
6
- type ButtonProps = React__default.ButtonHTMLAttributes<HTMLButtonElement> & Partial<React__default.ComponentProps<typeof FP$1>> & {
7
- /**
8
- * The button type
9
- * Required - 'button' | 'submit' | 'reset'
10
- */
11
- type: 'button' | 'submit' | 'reset';
12
- };
13
- declare const Button: {
14
- ({ type, children, styles, disabled, classes, onPointerDown, onPointerOver, onPointerLeave, ...props }: ButtonProps): React__default.JSX.Element;
15
- displayName: string;
16
- };
17
-
18
- type CardProps = {
19
- elm?: 'div' | 'aside' | 'section' | 'article';
20
- title?: React__default.ReactNode;
21
- footer?: React__default.ReactNode;
22
- } & React__default.ComponentProps<typeof FP$1>;
23
- declare const Card: {
24
- ({ elm, styles, children, classes, id, ...props }: CardProps): React__default.JSX.Element;
25
- displayName: string;
26
- Title: {
27
- ({ children, className, styles, as, ...props }: React__default.PropsWithChildren<{
28
- className?: string | undefined;
29
- styles?: React__default.CSSProperties | undefined;
30
- as?: React__default.ElementType<any> | undefined;
31
- }>): React__default.JSX.Element;
32
- displayName: string;
33
- };
34
- Content: {
35
- ({ children, className, styles, ...props }: React__default.PropsWithChildren<{
36
- className?: string | undefined;
37
- styles?: React__default.CSSProperties | undefined;
38
- }>): React__default.JSX.Element;
39
- displayName: string;
40
- };
41
- Footer: {
42
- ({ children, className, styles, ...props }: React__default.PropsWithChildren<{
43
- className?: string | undefined;
44
- styles?: React__default.CSSProperties | undefined;
45
- }>): React__default.JSX.Element;
46
- displayName: string;
47
- };
48
- };
49
-
50
- type DialogProps = {
51
- /**
52
- * React ref for dialog element
53
- */
54
- modalRef: React__default.RefObject<HTMLDialogElement>;
55
- /**
56
- * Handle close modal event
57
- */
58
- closeModal?: (e: React__default.SyntheticEvent<HTMLDialogElement>) => void;
59
- /**
60
- * open modal on mount
61
- */
62
- openOnMount?: boolean;
63
- } & React__default.ComponentProps<typeof FP$1>;
64
- /**
65
- * Dialog component
66
- */
67
- declare const Dialog: {
68
- ({ id, children, classes, modalRef, openOnMount, ...props }: DialogProps): React__default.JSX.Element;
69
- displayName: string;
70
- };
71
-
72
- type FieldProps = {
73
- /**
74
- * The label content
75
- */
76
- label: React__default.ReactNode;
77
- children: React__default.ReactNode;
78
- } & React__default.ComponentProps<'label'> & Partial<React__default.ComponentProps<typeof FP$1>>;
79
- /**
80
- * Field component that renders a label and children wrapped in a div element.
81
- * @param labelFor Defines the for attribute of the label element
82
- * @param styles Custom styles to be applied to the component
83
- * @param label The label content
84
- * @param children The children to be rendered inside the component
85
- * @param props Additional props to be spread to the component
86
- */
87
- declare const Field: {
88
- ({ label, labelFor, id, styles, classes, children, ...props }: FieldProps): React__default.JSX.Element;
89
- displayName: string;
90
- };
91
-
92
- type ComponentProps = React__default.ComponentProps<typeof FP$1>;
93
- /**
94
- * Renders children elements without any wrapping component.
95
- * Can be used as a placeholder when no semantic landmark is needed.
96
- */
97
- declare const Landmarks: {
98
- (children?: React__default.FC): React__default.JSX.Element;
99
- displayName: string;
100
- Header: ({ id, children, headerBackground, styles, classes, ...props }: HeaderProps) => React__default.JSX.Element;
101
- Main: ({ id, children, styles, classes, ...props }: ComponentProps) => React__default.JSX.Element;
102
- Footer: ({ id, classes, children, styles, ...props }: ComponentProps) => React__default.JSX.Element;
103
- Aside: ({ id, children, styles, classes, ...props }: ComponentProps) => React__default.JSX.Element;
104
- Section: ({ id, children, styles, classes, ...props }: ComponentProps) => React__default.JSX.Element;
105
- Article: ({ id, children, styles, classes, ...props }: ComponentProps) => React__default.JSX.Element;
106
- };
107
- type HeaderProps = {
108
- headerBackground?: ReactNode;
109
- } & ComponentProps;
110
- /**
111
- * Header component.
112
- *
113
- * Renders a header landmark with a section child.
114
- *
115
- * @param children - The content to render inside the header.
116
- * @param styles - Optional styles object.
117
- * @param props - Other props.
118
- */
119
- declare const Header: ({ id, children, headerBackground, styles, classes, ...props }: HeaderProps) => React__default.JSX.Element;
120
- /**
121
- * Main component.
122
- *
123
- * Renders a main landmark.
124
- *
125
- * @param children - The content to render inside the main element.
126
- * @param styles - Optional styles object.
127
- * @param props - Other props.
128
- */
129
- declare const Main: ({ id, children, styles, classes, ...props }: ComponentProps) => React__default.JSX.Element;
130
- /**
131
- * Footer component that renders a footer element with a section element inside.
132
- * @param {ReactNode} children - Child elements to render inside the section element.
133
- * @param styles - CSS styles to apply to the footer element.
134
- * @param props - Additional props to pass to the footer element.
135
- * @returns A React component that renders a footer element with a section element inside.
136
- */
137
- declare const Footer: ({ id, classes, children, styles, ...props }: ComponentProps) => React__default.JSX.Element;
138
- declare const Aside: ({ id, children, styles, classes, ...props }: ComponentProps) => React__default.JSX.Element;
139
- /**
140
- * Section component that renders a section element.
141
- *
142
- * @param children - Child elements to render inside the section.
143
- * @param styles - CSS styles to apply to the section.
144
- * @param props - Other props.
145
- */
146
- declare const Section: ({ id, children, styles, classes, ...props }: ComponentProps) => React__default.JSX.Element;
147
- /**
148
- * Article component renders an HTML <article> element.
149
- *
150
- * @param children - Child elements to render inside the article.
151
- * @param styles - CSS styles to apply to the article.
152
- * @param props - Additional props to pass to the article element.
153
- */
154
- declare const Article: ({ id, children, styles, classes, ...props }: ComponentProps) => React__default.JSX.Element;
155
-
156
- type ImageProps = React__default.ComponentProps<'img'> & React__default.ComponentProps<typeof FP$1>;
157
- declare const Img: {
158
- ({ src, alt, width, height, styles, loading, placeholder, fetchpriority, decoding, imgLoaded, imgError, ...props }: ImageProps): React__default.JSX.Element;
159
- displayName: string;
160
- };
161
-
162
- type PolymorphicRef<C extends React__default.ElementType> = React__default.ComponentPropsWithRef<C>['ref'];
163
- type AsProp<C extends React__default.ElementType> = {
164
- as?: C;
165
- };
166
- type PropsToOmit<C extends React__default.ElementType, P> = keyof (AsProp<C> & P);
167
- type PolymorphicComponentProp<C extends React__default.ElementType, Props = {}> = React__default.PropsWithChildren<Props & AsProp<C>> & Omit<React__default.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;
168
- type PolymorphicComponentPropWithRef<C extends React__default.ElementType, Props = {}> = PolymorphicComponentProp<C, Props> & {
169
- ref?: PolymorphicRef<C>;
170
- };
171
- type FPProps<C extends React__default.ElementType> = PolymorphicComponentPropWithRef<C, {
172
- renderStyles?: boolean;
173
- styles?: React__default.CSSProperties;
174
- classes?: string;
175
- }>;
176
- type FPComponent = <C extends React__default.ElementType = 'span'>(props: FPProps<C>) => React__default.ReactElement | any;
177
- /**
178
- * FP component is a polymorphic component that renders an HTML element with optional styles.
179
- * @param {Object} props - Component props
180
- * @param {React.ElementType} props.as - The HTML element to render. Defaults to 'div'.
181
- * @param {boolean} props.renderStyles - Whether to render styles or not. Defaults to true.
182
- * @param {Object} props.styles - The styles to apply to the component.
183
- * @param {Object} props.defaultStyles - The default styles to apply to the component.
184
- * @param {React.ReactNode} props.children - The children to render inside the component.
185
- * @returns {React.ReactElement} - A React component that renders an HTML element with optional styles.
186
- */
187
- declare const FP: FPComponent;
188
-
189
- type InputProps = {
190
- /**
191
- * The type of the input.
192
- */
193
- type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search';
194
- /**
195
- * Set the element as disabled
196
- */
197
- isDisabled?: boolean;
198
- } & React__default.ComponentProps<typeof FP>;
199
- /**
200
- * Input component that renders an HTML input element.
201
- * @param {InputProps} props - The input component props.
202
- * @returns {JSX.Element} - The input component.
203
- */
204
- declare const Input: {
205
- ({ type, name, value, placeholder, id, styles, classes, isDisabled, disabled, readonly, required, ref, onChange, onBlur, onPointerDown, ...props }: InputProps): JSX.Element;
206
- displayName: string;
207
- };
208
-
209
- type LinkProps = {
210
- /** Applies button styling to the link */
211
- btnStyle?: boolean;
212
- } & React__default.ComponentProps<typeof FP$1> & React__default.ComponentProps<'a'>;
213
- declare const Link: {
214
- ({ href, target, rel, children, styles, prefetch, btnStyle, onPointerDown, ...props }: LinkProps): React__default.JSX.Element;
215
- displayName: string;
216
- };
217
-
218
- type ListProps = {
219
- /** Type of list to render (default: 'ul') */
220
- type?: 'ul' | 'ol' | 'dl';
221
- /** variant of list to render (default: 'none') */
222
- variant?: string;
223
- } & React.ComponentProps<typeof FP$1>;
224
- type ListItemProps = {
225
- /** Type of list item to render (default: 'li') */
226
- type?: 'li' | 'dt' | 'dd';
227
- } & React.ComponentProps<typeof FP$1>;
228
- /**
229
- * List component renders a list element with provided props
230
- * @param children - Child elements to render inside the list
231
- * @param classes - CSS classes to apply
232
- * @param type - Type of list element (default: 'ul')
233
- * @param variant - Variant for styling purposes
234
- * @param styles - Inline styles object
235
- * @param role - ARIA role
236
- * @param props - Additional props to pass to underlying element
237
- */
238
- declare const List: {
239
- ({ children, classes, type, variant, styles, role, ...props }: ListProps): React.JSX.Element;
240
- displayName: string;
241
- ListItem: ({ type, id, styles, children, classes, ...props }: ListItemProps) => React.JSX.Element;
242
- };
243
-
244
- interface ModalProps extends ComponentProps$1 {
245
- /**
246
- * The child component/content for open button
247
- */
248
- openChild?: React__default.ReactNode;
249
- /**
250
- * The child component/content for close button
251
- */
252
- closeChild?: React__default.ReactNode;
253
- /**
254
- * The child component/content for modal header
255
- */
256
- modalHeader?: React__default.ReactNode;
257
- /**
258
- * The child component/content for modal footer
259
- */
260
- modalFooter?: React__default.ReactNode;
261
- /**
262
- * The child component/content for modal body
263
- */
264
- children: React__default.ReactNode;
265
- /**
266
- * Open modal on mount when set to true
267
- */
268
- showOpen?: boolean;
269
- }
270
- declare const Modal: {
271
- ({ openChild, closeChild, modalHeader, modalFooter, children, showOpen, ...props }: ModalProps): React__default.JSX.Element;
272
- displayName: string;
273
- };
274
-
275
- type NavListProps = React__default.ComponentProps<typeof List> & {
276
- isBlock?: boolean;
277
- };
278
- type NavItemProps = React__default.ComponentProps<typeof List.ListItem>;
279
- type NavProps = React__default.ComponentProps<typeof FP$1>;
280
- /**
281
- * Renders a NavList component.
282
- * @param {Object} props - The props for the component.
283
- * @param {ReactNode} props.children - The child elements.
284
- * @param {Object} props - Additional props to spread to the List component.
285
- * @returns {JSX.Element} The rendered NavList component.
286
- */
287
- declare const NavList: ({ isBlock, children, ...props }: NavListProps) => React__default.JSX.Element;
288
- /**
289
- * Renders a NavItem component.
290
- * @param {Object} props - The props for the component.
291
- * @param {string} [props.id] - The id for the component.
292
- * @param {Object} [props.styles] - The styles for the component.
293
- * @param {string} [props.classes] - The classes for the component.
294
- * @param {ReactNode} props.children - The child elements.
295
- * @param {boolean} [props.inline=true] - Whether the item should display inline.
296
- * @param {Object} props - Additional props to spread to the ListItem component.
297
- * @returns {JSX.Element} The rendered NavItem component.
298
- */
299
- declare const NavItem: ({ id, styles, classes, children, ...props }: NavItemProps) => React__default.JSX.Element;
300
- /**
301
- * Renders a Nav component.
302
- * @param {Object} props - The props for the component.
303
- * @param {ReactNode} props.children - The child elements.
304
- * @param {Object} props - Additional props to spread to the UI component.
305
- * @returns {JSX.Element} The rendered Nav component.
306
- */
307
- declare const Nav: {
308
- ({ children, ...props }: NavProps): React__default.JSX.Element;
309
- displayName: string;
310
- List: ({ isBlock, children, ...props }: NavListProps) => React__default.JSX.Element;
311
- Item: ({ id, styles, classes, children, ...props }: NavItemProps) => React__default.JSX.Element;
312
- };
313
-
314
- /**
315
- * Interface for props accepted by the Popover component
316
- *
317
- * @property {ReactNode} children - The content to show in the popover
318
- * @property {ReactNode} [content] - Optional alternative content for popover
319
- */
320
- type PopoverProps = {
321
- children: React__default.ReactNode;
322
- popoverTrigger: React__default.ReactNode;
323
- styles?: {};
324
- };
325
- /**
326
- * Popover component to display popover content.
327
- *
328
- * @param props - The props for the component
329
- * @param props.children - The content to show in the popover
330
- * @param props.popoverTrigger - The element that triggers the popover on hover
331
- *
332
- * @returns JSX.Element - The rendered JSX element for the Popover
333
- * @example - <Popover popoverTrigger={<button>Hover here</button>}>Popover content</Popover>
334
- *
335
- * The component uses the usePopover hook to handle popover visibility and positioning.
336
- *
337
- * It renders the triggerElement, and conditionally renders the popover content
338
- * positioned absolutely when visible.
339
- *
340
- * Inline styles handle visuals like background, border, padding, etc.
341
- *
342
- * Transforms and opacity animate the enter/exit transition of the popover.
343
- */
344
- declare const Popover: {
345
- ({ children, popoverTrigger, styles, ...props }: PopoverProps): JSX.Element;
346
- displayName: string;
347
- styles: React__default.CSSProperties;
348
- };
349
-
350
- interface TableProps extends ComponentProps$1 {
351
- tblHead: React__default.ReactNode;
352
- tblBody: React__default.ReactNode;
353
- tblCaption?: React__default.ReactNode;
354
- }
355
- /**
356
- * Render the table placing `caption`, `thead` and `tbody` in the correct order
357
- * caption is optional
358
- */
359
- declare const RenderTable: {
360
- ({ tblBody, tblCaption, tblHead }: TableProps): React__default.JSX.Element;
361
- displayName: string;
362
- };
363
-
364
- type TagProps = {
365
- /** HTML element to display the badge as span or p */
366
- elm?: 'span' | 'p';
367
- /** Aria role for the component - conditional */
368
- role: 'note' | 'status';
369
- } & React__default.ComponentProps<typeof FP$1>;
370
- declare const Tag: {
371
- ({ elm, role, children, styles, ...props }: TagProps): React__default.JSX.Element;
372
- displayName: string;
373
- };
374
-
375
- declare const Caption: {
376
- ({ children, ...props }: ComponentProps$1): React__default.JSX.Element;
377
- displayName: string;
378
- };
379
- declare const Thead: {
380
- ({ children, ...props }: ComponentProps$1): React__default.JSX.Element;
381
- displayName: string;
382
- };
383
- declare const Tbody: {
384
- ({ children, ...props }: ComponentProps$1): React__default.JSX.Element;
385
- displayName: string;
386
- };
387
- declare const Tr: {
388
- ({ children, ...props }: ComponentProps$1): React__default.JSX.Element;
389
- displayName: string;
390
- };
391
- declare const Td: {
392
- ({ children, ...props }: ComponentProps$1): React__default.JSX.Element;
393
- displayName: string;
394
- };
395
- declare const Table: {
396
- ({ id, dataStyle, children, ...props }: ComponentProps$1): React__default.JSX.Element;
397
- displayName: string;
398
- };
399
-
400
- type DetailsProps = {
401
- /**
402
- * The summary text shown for the details.
403
- * Required.
404
- */
405
- summary: React__default.ReactNode;
406
- /**
407
- * The aria-label element for accessibility.
408
- */
409
- ariaLabel: string;
410
- } & React__default.ComponentProps<'details'> & Partial<React__default.ComponentProps<typeof FP$1>>;
411
- /**3
412
- * Details component props interface.
413
- *
414
- * @param {React.CSSProperties} [styles] - CSS styles object.
415
- * @param {string} [classes] - Classnames string.
416
- * @param {boolean} [open] - Whether the details is open.
417
- * @param {(e: React.PointerEvent<HTMLDetailsElement>) => void} [onToggle] - onToggle callback.
418
- * @param {(e: React.PointerEvent<HTMLDetailsElement>) => void} [onPointerDown] - onPointerDown callback.
419
- * @param {ReactNode} children - The content inside the details.
420
- * @param {string} [ariaLabel] - aria-label for accessibility.
421
- * @param {React.Ref<any>} [ref] - Ref object.
422
- * @param {Object} props - Other props.
423
- */
424
- declare const Details: {
425
- ({ summary, icon, styles, classes, ariaLabel, name, open, onPointerDown, onToggle, children, ref, ...props }: DetailsProps): React__default.JSX.Element;
426
- displayName: string;
427
- };
428
-
429
- type InheritedProps = React__default.ComponentProps<typeof FP$1>;
430
- type TextElements = 'a' | 'b' | 'blockquote' | 'b' | 'blockquote' | 'cite' | 'code' | 'em' | 'i' | 'em' | 'i' | 'kbd' | 'mark' | 'p' | 's' | 'small' | 'span' | 'span' | 'strong' | 'mark' | 'p' | 's' | 'small' | 'span' | 'span' | 'strong' | 'sub' | 'sup' | 'time' | 'time' | 'u';
431
- type TextProps = {
432
- /**
433
- * Text element to to use
434
- * Text element to to use
435
- */
436
- elm?: TextElements;
437
- /** Pass a text element or string */
438
- text?: string;
439
- } & InheritedProps;
440
- declare const Text: {
441
- ({ elm, id, text, styles, classes, children, ...props }: TextProps): React__default.JSX.Element;
442
- displayName: string;
443
- };
444
- type TitleProps$1 = {
445
- /**
446
- * HTML headings
447
- */
448
- elm?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
449
- } & InheritedProps;
450
- declare const Title: {
451
- ({ elm, id, children, styles, classes, ...props }: TitleProps$1): React__default.JSX.Element;
452
- displayName: string;
453
- };
454
-
455
- type TextareaProps = React__default.ComponentProps<'textarea'> & React__default.ComponentProps<typeof FP$1>;
456
- /**
457
- * Textarea component.
458
- *
459
- * @param value - The value of the textarea.
460
- * @param rows - The number of rows.
461
- * @param cols - The number of columns.
462
- * @param id - The id of the textarea.
463
- * @param name - The name of the textarea.
464
- * @param required - Whether the textarea is required.
465
- * @param disabled - Whether the textarea is disabled.
466
- * @param readOnly - Whether the textarea is read only.
467
- * @param onBlur - Blur event handler.
468
- * @param onPointerDown - Pointer down event handler.
469
- * @param onChange - Change event handler.
470
- * @param ref - Ref for the textarea.
471
- * @param styles - Styles object for the textarea.
472
- * @param textareaRef - Ref specifically for the textarea element.
473
- * @param props - Other props.
474
- */
475
- declare const Textarea: {
476
- ({ id, classes, value, rows, cols, name, required, disabled, readOnly, onBlur, onPointerDown, onChange, ref, styles, placeholder, ...props }: TextareaProps): React__default.JSX.Element;
477
- displayName: string;
478
- };
479
-
480
- type TitleProps = {
481
- children: React__default.ReactNode;
482
- type: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
483
- ui?: string;
484
- } & React__default.ComponentProps<typeof FP$1>;
485
-
486
- type customRoute = {
487
- /** The path or id for routing */
488
- path?: string;
489
- /** The display name */
490
- name: string;
491
- /** The url if linking out */
492
- url?: string;
493
- };
494
- type BreadcrumbProps = {
495
- /** Array of custom route objects */
496
- routes?: customRoute[];
497
- /** Starting route node */
498
- startRoute?: React__default.ReactNode;
499
- /** Spacer node between routes */
500
- spacer?: React__default.ReactNode;
501
- /** String representing current route */
502
- currentRoute?: string;
503
- /** Prefix breadcrumb aria-label - "prefix breadcrumb" */
504
- ariaLabelPrefix?: string;
505
- /** Truncate breadcrumb text after this length */
506
- truncateLength?: number;
507
- } & React__default.ComponentProps<typeof FP$1>;
508
- /**
509
- * Navigation component for breadcrumbs.
510
- *
511
- * @param props - Props for the navigation component.
512
- * @param props.startRoute - Starting route node. Default 'Home'.
513
- * @param props.currentRoute - String representing current route.
514
- * @param props.spacer - Spacer node between routes. Default '&#47;'.
515
- * @param props.routes - Array of custom route objects.
516
- * @param props.styles - Styles object for the nav.
517
- * @param props.id - Id for the nav.
518
- * @param props.classes - Class names for the nav.
519
- * @param props.children - Child components.
520
- */
521
- declare const Breadcrumb: {
522
- ({ startRoute, currentRoute, spacer, routes, styles, id, classes, ariaLabelPrefix, truncateLength, ...props }: BreadcrumbProps): React__default.JSX.Element;
523
- displayName: string;
524
- Nav: ({ styles, id, classes, children, ...props }: React__default.ComponentProps<typeof FP$1>) => React__default.JSX.Element;
525
- List: ({ children, ...props }: React__default.ComponentProps<typeof FP$1>) => React__default.JSX.Element;
526
- Items: ({ styles, id, classes, children, ...props }: React__default.ComponentProps<typeof FP$1>) => React__default.JSX.Element;
527
- };
528
-
529
- /**
530
- * Props for the TextToSpeechComponent.
531
- * @interface TextToSpeechComponentProps
532
- */
533
- interface TextToSpeechComponentProps {
534
- /** Initial text to be spoken. Defaults to an empty string. */
535
- initialText?: string;
536
- /** Whether to show the text input field. Defaults to true. */
537
- showTextInput?: boolean;
538
- /** The voice to be used for speech synthesis. */
539
- voice?: SpeechSynthesisVoice | undefined;
540
- /** The pitch of the voice. Defaults to 1. */
541
- pitch?: number;
542
- /** The rate of speech. Defaults to 1. */
543
- rate?: number;
544
- /** The language to be used for speech synthesis. */
545
- language?: string;
546
- /** Player label */
547
- label?: string | React__default.ReactNode;
548
- /** Callback function to be called when speech ends. */
549
- onEnd?: () => void;
550
- }
551
- /**
552
- * A component that converts text to speech using the Web Speech API.
553
- * @param {TextToSpeechComponentProps} props - The props for the component.
554
- * @returns {JSX.Element} The rendered TextToSpeechComponent.
555
- */
556
- declare const TextToSpeech: React__default.FC<TextToSpeechComponentProps>;
557
-
558
- export { Article, Aside, FP as Box, Breadcrumb, Button, Caption, Card, Details, Dialog, FP, Field, Footer, Header, Img, Input, Landmarks, Link, List, Main, Modal, Nav, NavItem, NavItemProps, NavList, NavListProps, NavProps, Popover, Section, RenderTable as TBL, Table, Tag, TagProps, Tbody, Td, Text, TextProps, TextToSpeech, Textarea, TextareaProps, Thead, Title, TitleProps, Link as To, Tr };
package/libs/index.js DELETED
@@ -1,11 +0,0 @@
1
- import { b } from './chunk-GCGKYLDG.js';
2
- import { a, c as c$1 } from './chunk-QHIABQNQ.js';
3
- export { b as Icon } from './chunk-QHIABQNQ.js';
4
- import * as c from 'react';
5
- import c__default, { useState, useEffect } from 'react';
6
-
7
- var w=({type:e="button",children:t,styles:o,disabled:r,classes:n,onPointerDown:s,onPointerOver:i,onPointerLeave:p,...l})=>{let d=h=>{r||s?.(h);};return c__default.createElement(a,{as:"button",type:e,onPointerOver:h=>{r||i?.(h);},onPointerDown:d,onPointerLeave:h=>{r||p?.(h);},style:o,className:n,"aria-disabled":r,onClick:d,...l},t)};w.displayName="Button";var se=({children:e,className:t,styles:o,as:r="h3",...n})=>c__default.createElement(a,{as:r,className:`card-title ${t||""}`,styles:o,...n},e);se.displayName="Title";var ae=({children:e,className:t,styles:o,...r})=>c__default.createElement(a,{as:"article",className:`card-content ${t||""}`,styles:o,...r},e);ae.displayName="Content";var pe=({children:e,className:t,styles:o,...r})=>c__default.createElement(a,{as:"div",className:`card-footer ${t||""}`,styles:o,...r},e);pe.displayName="Footer";var M=({elm:e="div",styles:t,children:o,classes:r="shadow",id:n,...s})=>c__default.createElement(a,{as:e,id:n,styles:t,className:r,"data-card":!0,...s},o);M.displayName="Card";M.Title=se;M.Content=ae;M.Footer=pe;var V=({id:e,children:t,classes:o,modalRef:r,openOnMount:n,...s})=>c__default.createElement(a,{as:"dialog",id:e,classes:o,ref:r,open:n,onClick:p=>{p.currentTarget===p.target&&p.currentTarget.close();},...s},t);V.displayName="Dialog";var le=({label:e,labelFor:t,id:o,styles:r,classes:n,children:s,...i})=>c__default.createElement(a,{as:"div",id:o,styles:r,className:n,"data-style":"fields",...i},c__default.createElement("label",{htmlFor:t},e),s);le.displayName="Field";var R=e=>c__default.createElement(c__default.Fragment,null,e),be=({id:e,children:t,headerBackground:o,styles:r,classes:n,...s})=>c__default.createElement(a,{as:"header",id:e,styles:r,className:n,...s},o,c__default.createElement(a,{as:"section"},t)),Ue=({id:e,children:t,styles:o,classes:r,...n})=>c__default.createElement(a,{as:"main",id:e,styles:o,...n,className:r},t),Re=({id:e,classes:t,children:o,styles:r={},...n})=>c__default.createElement(a,{as:"footer",id:e,className:t,styles:r,...n},c__default.createElement(a,{as:"section"},o||"Copyright \xA9 2022")),Le=({id:e,children:t,styles:o={},classes:r,...n})=>c__default.createElement(a,{as:"aside",id:e,styles:o,className:r,...n},c__default.createElement(a,{as:"section"},t)),Ee=({id:e,children:t,styles:o,classes:r,...n})=>c__default.createElement(a,{as:"section",id:e,styles:o,className:r,...n},t),ke=({id:e,children:t,styles:o,classes:r,...n})=>c__default.createElement(a,{as:"article",id:e,styles:o,className:r,...n},t);R.displayName="Landmarks";R.Header=be;R.Main=Ue;R.Footer=Re;R.Aside=Le;R.Section=Ee;R.Article=ke;var me=({src:e="//",alt:t,width:o=480,height:r,styles:n,loading:s="lazy",placeholder:i=`https://via.placeholder.com/${o}?text=PLACEHOLDER`,fetchpriority:p="low",decoding:l="auto",imgLoaded:d,imgError:u,...T})=>c__default.createElement(a,{as:"img",src:e,alt:t,width:o,height:r||"auto",loading:s,style:n,onError:y=>{if(u){u?.(y);return}y.currentTarget.src!==i&&(y.currentTarget.src=i);},onLoad:y=>{d?.(y);},fetchPriority:p,decoding:l,...T});me.displayName="Img";var we=c__default.forwardRef(({as:e,styles:t,classes:o,children:r,defaultStyles:n,...s},i)=>{let p=e||"div",l={...n,...t};return c__default.createElement(p,{ref:i,style:l,className:o,...s},r)}),N=we;var de=({type:e="text",name:t,value:o,placeholder:r,id:n,styles:s,classes:i,isDisabled:p,disabled:l,readonly:d,required:u,ref:T,onChange:h,onBlur:x,onPointerDown:y,...I})=>{let P=m=>{h&&!l&&h?.(m);},f=m=>{x&&!l&&x?.(m);},C=m=>{y&&!l&&(m.preventDefault(),y?.(m));};return c__default.createElement(N,{as:"input",id:n,type:e,placeholder:r||`${u?"*":""} ${e} input `,className:i,styles:s,onChange:P,onBlur:f,onKeyDown:C,value:o,name:t,ref:T,"aria-disabled":p,tabIndex:p?-1:void 0,"aria-readonly":d,"aria-required":u,required:u,readOnly:d,...I})};de.displayName="Input";var J=({href:e,target:t,rel:o,children:r,styles:n,prefetch:s,btnStyle:i,onPointerDown:p,...l})=>{let d=o;return t==="_blank"&&(d=`noopener noreferrer ${s?"prefetch":""}`),c__default.createElement(a,{as:"a",href:e,target:t,styles:n,rel:d,onPointerDown:T=>{p&&p?.(T);},"data-btn":i,prefetch:s,...l},r)},He=J;J.displayName="Link";var De=({type:e="li",id:t,styles:o,children:r,classes:n,...s})=>c.createElement(a,{id:t,as:e,className:n,...s,style:o},r),A=({children:e,classes:t,type:o="ul",variant:r,styles:n,role:s,...i})=>c.createElement(a,{as:o,"data-variant":r,className:t,style:n,role:s,...i},e),X=A;A.displayName="List";A.ListItem=De;var ue=({openChild:e,closeChild:t,modalHeader:o,modalFooter:r,children:n,showOpen:s=!1,...i})=>{let p=c__default.useRef(null),l=()=>{p.current&&(s?p.current.show():p.current.showModal());},d=()=>{p.current&&p.current.close();};return c__default.createElement(c__default.Fragment,null,c__default.createElement(V,{modalRef:p,openOnMount:s,...i},c__default.createElement("section",null,o,n,r??c__default.createElement("div",null,c__default.createElement(w,{type:"button",pointerDown:()=>{d();}},t||"Close")," "))),!s&&c__default.createElement(w,{type:"button",pointerDown:l},e||"Open Modal"))};ue.displayName="Modal";var Ve=({isBlock:e,children:t,...o})=>c__default.createElement(X,{type:"ul",...o,"data-list":`unstyled ${e?"block":""}`},t),Ae=({id:e,styles:t,classes:o,children:r,...n})=>c__default.createElement(X.ListItem,{type:"li",id:e,classes:o,styles:t,...n},r),q=({children:e,...t})=>c__default.createElement(a,{as:"nav",...t},e);q.displayName="Nav";q.List=Ve;q.Item=Ae;var Oe={display:"block",position:"absolute",background:"#000",border:"1px solid #010101",padding:"10px",color:"#fff",transition:"opacity .5s ease-in-out"},_=({children:e,popoverTrigger:t,styles:o,...r})=>{let n=c__default.useRef(null),s=c__default.useRef(null),{isVisible:i,popoverPosition:p,handlePointerEvent:l,handlePointerLeave:d}=b(n,s),u={opacity:i?1:0,top:p.top,left:p.left,zIndex:999};return c__default.createElement(c__default.Fragment,null,c__default.createElement("div",{ref:n,onPointerEnter:l,onPointerLeave:d,...r},t),i&&c__default.createElement("div",{ref:s,style:{...u,...o}},e))};_.displayName="Popover";_.styles=Oe;var G=({children:e,...t})=>c__default.createElement(N,{as:"caption",...t},e),Q=({children:e,...t})=>c__default.createElement(N,{as:"thead",...t},e),O=({children:e,...t})=>c__default.createElement(N,{as:"tbody",...t},e),Y=({children:e,...t})=>c__default.createElement(N,{as:"tr",...t},e),$e=({children:e,...t})=>c__default.createElement(N,{as:"td",...t},e),Z=({id:e,dataStyle:t,children:o,...r})=>c__default.createElement(N,{as:"section",id:e,...r,"data-style":"table-wrapper"},c__default.createElement("table",null,o));Z.displayName="Table";G.displayName="Caption";Q.displayName="Thead";O.displayName="Tbody";Y.displayName="Tr";$e.displayName="Td";var fe=({tblBody:e,tblCaption:t,tblHead:o})=>c__default.createElement(Z,null,t&&c__default.createElement(G,null,t),c__default.createElement(Q,null,c__default.createElement(Y,null,o)),c__default.createElement(O,null,e));fe.displayName="TBL";var Ke=({elm:e="span",role:t="note",children:o,styles:r,...n})=>c__default.createElement(a,{as:e,role:t,styles:r,...n},o);Ke.displayName="Tag";var Xe=({summary:e,icon:t,styles:o,classes:r,ariaLabel:n,name:s,open:i,onPointerDown:p,onToggle:l,children:d,ref:u,...T})=>{let h={...o},x=I=>{p&&p?.(I),p&&p?.(I);};return c__default.createElement(a,{as:"details",style:h,className:r,onToggle:I=>{l&&p?.(I);},ref:u,open:i,"aria-label":n||"Details dropdown",name:s,...T},c__default.createElement(a,{as:"summary",role:"group",onPointerDown:x},t,e),c__default.createElement(a,{as:"section"},d))};Xe.displayName="Details";var ye=({elm:e="p",id:t,text:o,styles:r,classes:n,children:s,...i})=>c__default.createElement(a,{as:e,id:t,styles:r,className:n,...i},c__default.createElement(a,{as:e,id:t,styles:r,className:n,...i},s||o)),je=({elm:e="h3",id:t,children:o,styles:r,classes:n,...s})=>c__default.createElement(ye,{as:e,id:t,styles:r,className:n,...s},o);ye.displayName="Text";je.displayName="Title";var Pe=({id:e,classes:t,value:o,rows:r=5,cols:n=25,name:s,required:i,disabled:p,readOnly:l,onBlur:d,onPointerDown:u,onChange:T,ref:h,styles:x,placeholder:y,...I})=>c__default.createElement(a,{as:"textarea",id:e,name:s,rows:r,cols:n,styles:x,className:t,"data-style":"textarea",required:i,value:o,"aria-disabled":p,readOnly:l,onChange:m=>{T&&!p&&T?.(m);},onBlur:m=>{d&&!p&&d?.(m);},onPointerDown:m=>{u&&!p&&u?.(m);},ref:h,placeholder:y||`${i?"*":""} Message`,...I}),he=Pe;Pe.displayName="Textarea";var oe=(e,t=15)=>e.length>t?`${e.slice(0,t)}...`:e;var $=({styles:e,id:t,classes:o,children:r,...n})=>c__default.createElement("li",{"data-list":"unstyled inline",...n},r),xe=({children:e,...t})=>c__default.createElement(a,{as:"ol","data-list":"unstyled inline",...t},e),Ce=({styles:e,id:t,classes:o,children:r,...n})=>c__default.createElement(a,{as:"nav",id:t,styles:e,className:o,...n},c__default.createElement(xe,null,r)),z=({startRoute:e="Home",currentRoute:t,spacer:o=c__default.createElement(c__default.Fragment,null,"/"),routes:r,styles:n,id:s,classes:i,ariaLabelPrefix:p,truncateLength:l=15,...d})=>{let[u,T]=c__default.useState("");c__default.useEffect(()=>{let P=t||window.location.pathname;P.length&&T(P);},[]);let h=P=>{let f=r?.find(C=>C.path===P);return {path:f?.path||P,name:f?.name||P,url:f?.url||P}},x=u.split("/").filter(P=>P),y=x.length-1,I=c__default.useId();return u.length?c__default.createElement(Ce,{id:s,...d,styles:n,className:i,"aria-label":p},c__default.createElement($,{key:`${e}-${I}`},c__default.createElement("a",{href:"/"},e)),x.length?x.map((P,f)=>{let C=h(P),{name:m,url:g,path:k}=C;return f===y?c__default.createElement(c__default.Fragment,null,typeof x[y]=="string"&&x[y].length>3&&x[y]!==x[y-1]&&c__default.createElement($,{key:`${k||f}-${I}`},c__default.createElement(c__default.Fragment,null,c__default.createElement("span",{"aria-hidden":"true"},o),c__default.createElement("a",{"aria-current":"page","aria-label":m.length>l?m:void 0},oe(decodeURIComponent(m),l)))," ")):c__default.createElement($,{key:`${C?.name}-${I}`},c__default.createElement("span",{"aria-hidden":"true"},o),c__default.createElement("span",null,c__default.createElement("a",{href:g,"aria-label":m.length>l?m:void 0},oe(decodeURIComponent(m),l))))}):c__default.createElement(c__default.Fragment,null)):c__default.createElement(c__default.Fragment,null)};z.displayName="BreadCrumb";z.Nav=Ce;z.List=xe;z.Items=$;var Te=e=>{let[t,o]=useState([]),[r,n]=useState(e),[s,i]=useState(!1),[p,l]=useState(!1),[d,u]=useState(null);return useEffect(()=>{let f=()=>{let C=window.speechSynthesis.getVoices();o(C);let m=C.find(g=>g.name==="Google US English");if(m)n(m);else {let g=C.find(k=>k.lang.startsWith("en-"));g&&n(g);}};return f(),window.speechSynthesis.onvoiceschanged=f,()=>{window.speechSynthesis.onvoiceschanged=null;}},[]),{speak:(f,C={},m)=>{let g=new SpeechSynthesisUtterance(f);g.lang=C.lang??"en-US",g.pitch=C.pitch??1,g.rate=C.rate??1,g.voice=r??C.voice??null,g.onend=()=>{i(!1),l(!1),m&&m();},"speechSynthesis"in window?(window.speechSynthesis.speak(g),u(g),i(!0),l(!1)):console.error("Speech synthesis not supported");},pause:()=>{s&&!p&&(window.speechSynthesis.pause(),l(!0));},resume:()=>{s&&p&&(window.speechSynthesis.resume(),l(!1));},cancel:()=>{s&&(window.speechSynthesis.cancel(),i(!1),l(!1));},isSpeaking:s,isPaused:p,availableVoices:t,changeVoice:f=>{n(f);},currentVoice:r,getAvailableLanguages:()=>[...new Set(t.map(f=>f.lang))]}};var Ye=({children:e,onClick:t})=>c__default.createElement(a,{as:"button",type:"button",className:"tts-border","data-btn":"sm text pill",onClick:t},e),H=c__default.memo(Ye),re=({label:e,isSpeaking:t,isPaused:o,onSpeak:r,onPause:n,onResume:s,onCancel:i})=>c__default.createElement(a,{as:"div","data-tts":!0},e&&c__default.createElement("p",null,e),!t&&c__default.createElement(H,{"aria-label":"Speak",onClick:r},c__default.createElement(c$1.PlaySolid,{size:16})),t&&!o&&c__default.createElement(H,{"aria-label":"Pause",onClick:n},c__default.createElement(c$1.PauseSolid,{size:16})),o&&c__default.createElement(H,{"aria-label":"Resume",onClick:s},c__default.createElement(c$1.ResumeSolid,{size:16})),c__default.createElement(H,{"aria-label":"Stop",onClick:i},c__default.createElement(c$1.StopSolid,{size:16})));re.displayName="TextToSpeechControls";re.TTSButton=H;var ge=re;var Ie=({initialText:e="",showTextInput:t=!1,voice:o,pitch:r=1,rate:n=1,language:s,label:i,onEnd:p})=>{let{speak:l,pause:d,resume:u,cancel:T,isSpeaking:h,isPaused:x,getAvailableLanguages:y,availableVoices:I}=Te(),[P,f]=useState(e);console.log(y()),useEffect(()=>{f(e);},[e]);let C=()=>{P.trim()!==""&&l(P,{voice:o,pitch:r,rate:n},g);},m=k=>{f(k.target.value);},g=()=>{p&&p();};return c__default.createElement(c__default.Fragment,null,t&&c__default.createElement(he,{value:P,onChange:m}),c__default.createElement(ge,{label:i,isSpeaking:h,isPaused:x,onSpeak:C,onPause:d,onResume:u,onCancel:T}))};Ie.displayName="TextToSpeechComponent";
8
-
9
- export { ke as Article, Le as Aside, N as Box, z as Breadcrumb, w as Button, G as Caption, M as Card, Xe as Details, V as Dialog, N as FP, le as Field, Re as Footer, be as Header, me as Img, de as Input, R as Landmarks, J as Link, A as List, Ue as Main, ue as Modal, q as Nav, Ae as NavItem, Ve as NavList, _ as Popover, Ee as Section, fe as TBL, Z as Table, Ke as Tag, O as Tbody, $e as Td, ye as Text, Ie as TextToSpeech, Pe as Textarea, Q as Thead, je as Title, He as To, Y as Tr };
10
- //# sourceMappingURL=out.js.map
11
- //# sourceMappingURL=index.js.map