@fpkit/acss 0.5.0 → 0.5.2

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 (134) hide show
  1. package/libs/chunk-GCGKYLDG.js +7 -0
  2. package/libs/chunk-GCGKYLDG.js.map +1 -0
  3. package/libs/chunk-PDD4N5P5.cjs +10 -0
  4. package/libs/chunk-PDD4N5P5.cjs.map +1 -0
  5. package/libs/chunk-TBM2QIVT.js +8 -0
  6. package/libs/chunk-TBM2QIVT.js.map +1 -0
  7. package/libs/chunk-VAH6X2DZ.cjs +31 -0
  8. package/libs/chunk-VAH6X2DZ.cjs.map +1 -0
  9. package/libs/components/badge/badge.css +1 -0
  10. package/libs/components/badge/badge.css.map +1 -0
  11. package/libs/components/badge/badge.min.css +3 -0
  12. package/libs/components/breadcrumbs/breadcrumb.css +1 -0
  13. package/libs/components/breadcrumbs/breadcrumb.css.map +1 -0
  14. package/libs/components/breadcrumbs/breadcrumb.min.css +3 -0
  15. package/libs/components/buttons/button.css +1 -0
  16. package/libs/components/buttons/button.css.map +1 -0
  17. package/libs/components/buttons/button.min.css +3 -0
  18. package/libs/components/cards/card-style.css +1 -0
  19. package/libs/components/cards/card-style.css.map +1 -0
  20. package/libs/components/cards/card-style.min.css +3 -0
  21. package/libs/components/cards/card.css +1 -0
  22. package/libs/components/cards/card.css.map +1 -0
  23. package/libs/components/cards/card.min.css +3 -0
  24. package/libs/components/details/details.css +1 -0
  25. package/libs/components/details/details.css.map +1 -0
  26. package/libs/components/details/details.min.css +3 -0
  27. package/libs/components/form/form.css +1 -0
  28. package/libs/components/form/form.css.map +1 -0
  29. package/libs/components/form/form.min.css +3 -0
  30. package/libs/components/icons/icon.css +1 -0
  31. package/libs/components/icons/icon.css.map +1 -0
  32. package/libs/components/icons/icon.min.css +3 -0
  33. package/libs/components/images/img.css +1 -0
  34. package/libs/components/images/img.css.map +1 -0
  35. package/libs/components/images/img.min.css +3 -0
  36. package/libs/components/layout/landmarks.css +1 -0
  37. package/libs/components/layout/landmarks.css.map +1 -0
  38. package/libs/components/layout/landmarks.min.css +3 -0
  39. package/libs/components/link/link.css +1 -0
  40. package/libs/components/link/link.css.map +1 -0
  41. package/libs/components/link/link.min.css +3 -0
  42. package/libs/components/nav/nav.css +1 -0
  43. package/libs/components/nav/nav.css.map +1 -0
  44. package/libs/components/nav/nav.min.css +3 -0
  45. package/libs/components/progress/progress.css +1 -0
  46. package/libs/components/progress/progress.css.map +1 -0
  47. package/libs/components/progress/progress.min.css +3 -0
  48. package/libs/components/styles/index.css +1 -0
  49. package/libs/components/styles/index.css.map +1 -0
  50. package/libs/components/styles/index.min.css +3 -0
  51. package/libs/components/tag/tag.css +1 -0
  52. package/libs/components/tag/tag.css.map +1 -0
  53. package/libs/components/tag/tag.min.css +3 -0
  54. package/libs/components/text-to-speech/text-to-speech.css +1 -0
  55. package/libs/components/text-to-speech/text-to-speech.css.map +1 -0
  56. package/libs/components/text-to-speech/text-to-speech.min.css +3 -0
  57. package/libs/hooks.cjs +12 -0
  58. package/{dist → libs}/hooks.d.cts +2 -2
  59. package/{dist → libs}/hooks.d.ts +2 -2
  60. package/libs/hooks.js +3 -0
  61. package/libs/icons-2f29127c.d.ts +349 -0
  62. package/libs/icons.cjs +12 -0
  63. package/libs/icons.cjs.map +1 -0
  64. package/libs/icons.d.cts +2 -0
  65. package/libs/icons.d.ts +2 -0
  66. package/libs/icons.js +3 -0
  67. package/libs/icons.js.map +1 -0
  68. package/libs/index.cjs +71 -0
  69. package/libs/index.cjs.map +1 -0
  70. package/libs/index.css +1 -0
  71. package/libs/index.css.map +1 -0
  72. package/libs/index.d.cts +561 -0
  73. package/libs/index.d.ts +561 -0
  74. package/libs/index.js +11 -0
  75. package/libs/index.js.map +1 -0
  76. package/package.json +3 -2
  77. package/src/components/badge/badge.scss +1 -0
  78. package/src/components/breadcrumbs/breadcrumb.stories.tsx +2 -2
  79. package/src/components/breadcrumbs/breadcrumb.tsx +2 -1
  80. package/src/components/buttons/button.scss +3 -4
  81. package/src/components/buttons/button.stories.tsx +49 -27
  82. package/src/components/buttons/button.tsx +31 -4
  83. package/src/components/cards/card.scss +5 -3
  84. package/src/components/cards/card.stories.tsx +2 -2
  85. package/src/components/cards/card.tsx +0 -1
  86. package/src/components/details/details.scss +2 -1
  87. package/src/components/heading/heading.tsx +2 -2
  88. package/src/components/icons/components/svg.tsx +1 -0
  89. package/src/components/icons/icon.scss +2 -0
  90. package/src/components/icons/icon.stories.tsx +23 -3
  91. package/src/components/icons/icon.tsx +11 -0
  92. package/src/components/icons/types.ts +1 -1
  93. package/src/components/list/list.stories.tsx +6 -0
  94. package/src/sass/_globals.scss +8 -7
  95. package/src/styles/badge/badge.css +1 -0
  96. package/src/styles/badge/badge.css.map +1 -1
  97. package/src/styles/buttons/button.css +3 -3
  98. package/src/styles/buttons/button.css.map +1 -1
  99. package/src/styles/cards/card.css +2 -8
  100. package/src/styles/cards/card.css.map +1 -5
  101. package/src/styles/details/details.css +2 -1
  102. package/src/styles/details/details.css.map +1 -1
  103. package/src/styles/form/form.css +0 -3
  104. package/src/styles/icons/icon.css +2 -0
  105. package/src/styles/icons/icon.css.map +1 -1
  106. package/src/styles/index.css +16 -14
  107. package/src/styles/index.css.map +1 -1
  108. package/dist/chunk-77CZU5XZ.cjs +0 -9
  109. package/dist/chunk-77CZU5XZ.cjs.map +0 -1
  110. package/dist/chunk-D43FJIRQ.cjs +0 -31
  111. package/dist/chunk-D43FJIRQ.cjs.map +0 -1
  112. package/dist/chunk-GJWMCDFS.js +0 -9
  113. package/dist/chunk-GJWMCDFS.js.map +0 -1
  114. package/dist/chunk-PCDUGD3C.js +0 -5
  115. package/dist/chunk-PCDUGD3C.js.map +0 -1
  116. package/dist/hooks.cjs +0 -10
  117. package/dist/hooks.cjs.map +0 -1
  118. package/dist/hooks.js +0 -8
  119. package/dist/hooks.js.map +0 -1
  120. package/dist/icon-e6044c73.d.ts +0 -227
  121. package/dist/icons.cjs +0 -73
  122. package/dist/icons.d.cts +0 -252
  123. package/dist/icons.d.ts +0 -252
  124. package/dist/icons.js +0 -4
  125. package/dist/index.cjs +0 -59
  126. package/dist/index.cjs.map +0 -1
  127. package/dist/index.d.cts +0 -566
  128. package/dist/index.d.ts +0 -566
  129. package/dist/index.js +0 -11
  130. package/dist/index.js.map +0 -1
  131. package/src/components/popover/node_modules/.vitest/results.json +0 -1
  132. package/src/hooks/popover/node_modules/.vitest/results.json +0 -1
  133. /package/{dist/icons.cjs.map → libs/hooks.cjs.map} +0 -0
  134. /package/{dist/icons.js.map → libs/hooks.js.map} +0 -0
package/dist/index.d.ts DELETED
@@ -1,566 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React$1 from 'react';
3
- import React__default from 'react';
4
- import { C as ComponentProps$1 } from './icon-e6044c73.js';
5
- export { I as Icon } from './icon-e6044c73.js';
6
-
7
- interface FpBadgeProps {
8
- elm?: 'span' | 'p';
9
- children: React__default.ReactNode;
10
- role: 'note' | 'alert' | 'status';
11
- renderStyles?: boolean;
12
- styles?: {};
13
- }
14
- /**
15
- * @description Creates a Badge component that wraps a child element with a badge.
16
- * @param {string} elm - element type to render
17
- * @param {string} role - aria role
18
- * @param {any} children - child element to render
19
- * @param {boolean} renderStyles - whether or not to render the default styles
20
- * @param {object} styles - styles to pass to the FP component
21
- * @param {object} props - additional props to pass to the FP component
22
- * @returns {any} - returns the Badge component
23
- */
24
- declare const Badge: {
25
- ({ elm, role, children, renderStyles, styles, ...props }: FpBadgeProps): react_jsx_runtime.JSX.Element;
26
- styles: {
27
- paddingInline: string;
28
- paddingBlock: string;
29
- color: string;
30
- fontSize: string;
31
- fontWeight: string;
32
- fontFamily: string;
33
- border: string;
34
- borderRadius: string;
35
- backgroundColor: string;
36
- textDecoration: string;
37
- textTransform: string;
38
- };
39
- displayName: string;
40
- };
41
-
42
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
43
- /**
44
- * The type of the button.
45
- */
46
- type: 'button' | 'submit' | 'reset';
47
- /**
48
- * Button label/content
49
- */
50
- children: React.ReactNode;
51
- /**
52
- * Button styles and props
53
- */
54
- styles?: object;
55
- /**
56
- * button classes
57
- */
58
- classes?: string;
59
- /**
60
- * @deprecated import styles Button.styles
61
- * default button styles
62
- */
63
- defaultStyles?: boolean;
64
- /**
65
- * Button pointer-down event (pointerOver, pointerLeave)
66
- */
67
- pointerDown?: (e: React.PointerEvent) => void;
68
- /**
69
- * Button pointer-down event (pointerOver, pointerLeave)
70
- */
71
- pointerOver?: (e: React.PointerEvent) => void;
72
- /**
73
- * Pointer leave event handler for the Button component.
74
- *
75
- * @param {React.PointerEvent} e - The pointer event
76
- */
77
- pointerLeave?: (e: React.PointerEvent) => void;
78
- }
79
- declare const Button: {
80
- ({ type, children, styles, disabled, classes, pointerDown, pointerOver, pointerLeave, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
81
- styles: {
82
- paddingInline: string;
83
- paddingBlock: string;
84
- display: string;
85
- placeItems: string;
86
- justifyContent: string;
87
- cursor: string;
88
- border: string;
89
- color: string;
90
- backgroundColor: string;
91
- borderRadius: string;
92
- };
93
- displayName: string;
94
- };
95
-
96
- interface ComponentProps {
97
- /**
98
- * The default child content/component to render.
99
- */
100
- children?: React.ReactNode;
101
- /**
102
- * Use defaylt component styles
103
- */
104
- renderStyles?: boolean;
105
- /**
106
- * Component id attribute
107
- */
108
- id?: string;
109
- /**
110
- * Styles object
111
- */
112
- styles?: {};
113
- /**
114
- * Component class attribute
115
- */
116
- classes?: string;
117
- /**
118
- * Style value for [data-style] attribute
119
- */
120
- dataStyle?: string;
121
- }
122
-
123
- interface SharedInputProps extends ComponentProps {
124
- /**
125
- * The input name
126
- */
127
- name?: string;
128
- /**
129
- * The input value
130
- */
131
- value?: string;
132
- /**
133
- * The input placeholder
134
- */
135
- placeholder?: string;
136
- /**
137
- * Input is required or not
138
- */
139
- required?: boolean;
140
- /**
141
- * Input id attribute
142
- */
143
- id: string;
144
- /**
145
- * Set the element as disabled
146
- */
147
- disabled?: boolean;
148
- /**
149
- * Set the element as readonly
150
- */
151
- readonly?: boolean;
152
- }
153
-
154
- interface CardProps extends ComponentProps$1 {
155
- elm?: 'div' | 'aside' | 'section' | 'article';
156
- }
157
- declare const Card: {
158
- ({ elm, styles, children, renderStyles, dataStyle, id, ...props }: CardProps): react_jsx_runtime.JSX.Element;
159
- styles: {
160
- padding: string;
161
- backgroundColor: string;
162
- boxShadow: string;
163
- borderRadius: string;
164
- border: string;
165
- color: string;
166
- };
167
- displayName: string;
168
- };
169
-
170
- interface DialogProps extends ComponentProps$1 {
171
- /**
172
- * React ref for dialog element
173
- */
174
- modalRef: React__default.RefObject<HTMLDialogElement>;
175
- /**
176
- * Handle close modal event
177
- */
178
- closeModal?: (e: React__default.SyntheticEvent<HTMLDialogElement>) => void;
179
- /**
180
- * open modal on mount
181
- */
182
- openOnMount?: boolean;
183
- }
184
- /**
185
- * Dialog component
186
- */
187
- declare const Dialog: {
188
- ({ id, children, modalRef, openOnMount, ...props }: DialogProps): react_jsx_runtime.JSX.Element;
189
- displayName: string;
190
- };
191
-
192
- interface DropdownProps$1 extends ComponentProps$1 {
193
- elm?: 'div' | 'aside';
194
- title: string;
195
- children: React.ReactNode;
196
- onToggle?: (e: React.SyntheticEvent) => void;
197
- }
198
-
199
- interface SummaryPros {
200
- children: React.ReactNode;
201
- styles?: {};
202
- renderStyles?: boolean;
203
- }
204
-
205
- interface DropdownProps extends ComponentProps$1 {
206
- title: string;
207
- summary: React.ReactNode;
208
- toggle?: (e: React.SyntheticEvent) => void;
209
- }
210
- declare const Dropdown: {
211
- ({ styles, children, summary, toggle, renderStyles, ...props }: DropdownProps): react_jsx_runtime.JSX.Element;
212
- styles: {
213
- display: string;
214
- placeContent: string;
215
- placeItems: string;
216
- gap: string;
217
- border: string;
218
- transition: string;
219
- backgroundColor: string;
220
- padding: string;
221
- minWidth: string;
222
- maxWidth: string;
223
- };
224
- Summary: {
225
- ({ children, styles, renderStyles, ...props }: SummaryPros): react_jsx_runtime.JSX.Element;
226
- styles: {
227
- listStyle: string;
228
- justifyContent: string;
229
- color: string;
230
- cursor: string;
231
- };
232
- displayName: string;
233
- };
234
- Details: {
235
- ({ title, children, styles, renderStyles, onToggle, ...props }: DropdownProps$1): react_jsx_runtime.JSX.Element;
236
- styles: {
237
- padding: string;
238
- backgroundColor: string;
239
- };
240
- displayName: string;
241
- };
242
- displayName: string;
243
- };
244
-
245
- interface FieldProps extends ComponentProps$1 {
246
- /**
247
- * Defines the for attribute of the label element
248
- */
249
- labelFor: string;
250
- /**
251
- * The label content
252
- */
253
- label: React.ReactNode;
254
- }
255
- /**
256
- * Field component that renders a label and children wrapped in a div element.
257
- * @param labelFor Defines the for attribute of the label element
258
- * @param styles Custom styles to be applied to the component
259
- * @param label The label content
260
- * @param children The children to be rendered inside the component
261
- * @param props Additional props to be spread to the component
262
- */
263
- declare const Field: {
264
- ({ labelFor, styles, label, children, ...props }: FieldProps): react_jsx_runtime.JSX.Element;
265
- styles: {};
266
- displayName: string;
267
- };
268
-
269
- declare const Header: {
270
- ({ children, styles, ...props }: ComponentProps$1): react_jsx_runtime.JSX.Element;
271
- displayName: string;
272
- };
273
- declare const Main: {
274
- ({ children, styles, ...props }: ComponentProps$1): react_jsx_runtime.JSX.Element;
275
- displayName: string;
276
- };
277
- declare const Footer: {
278
- ({ children, styles, ...props }: ComponentProps$1): react_jsx_runtime.JSX.Element;
279
- displayName: string;
280
- };
281
- declare const Aside: {
282
- ({ children, styles, ...props }: ComponentProps$1): react_jsx_runtime.JSX.Element;
283
- displayName: string;
284
- };
285
- declare const Section: {
286
- ({ children, styles, ...props }: ComponentProps$1): react_jsx_runtime.JSX.Element;
287
- displayName: string;
288
- };
289
- declare const Article: {
290
- ({ children, styles, ...props }: ComponentProps$1): react_jsx_runtime.JSX.Element;
291
- displayName: string;
292
- };
293
-
294
- interface ImageProps extends ComponentProps$1 {
295
- alt: string;
296
- src?: string;
297
- width?: number;
298
- height?: number;
299
- loading?: 'eager' | 'lazy';
300
- placeholder?: string;
301
- fetchpriority?: 'high' | 'low';
302
- decoding?: 'sync' | 'async' | 'auto';
303
- imgError?: (e: React.SyntheticEvent<HTMLImageElement, Event>) => void;
304
- imgLoaded?: (e: React.SyntheticEvent<HTMLImageElement, Event>) => void;
305
- }
306
- declare const Img: {
307
- ({ src, alt, width, height, styles, loading, placeholder, fetchpriority, decoding, imgLoaded, imgError, ...props }: ImageProps): react_jsx_runtime.JSX.Element;
308
- styles: {
309
- maxWidth: string;
310
- height: string;
311
- objectFit: string;
312
- objectPosition: string;
313
- aspectRatio: string;
314
- display: string;
315
- };
316
- displayName: string;
317
- };
318
-
319
- interface InputProps extends Omit<ComponentProps$1, 'children'> {
320
- /**
321
- * The type of the input.
322
- */
323
- type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search';
324
- /**
325
- * The input name
326
- */
327
- name?: string;
328
- /**
329
- * The input value
330
- */
331
- value?: string;
332
- /**
333
- * The input placeholder
334
- */
335
- placeholder?: string;
336
- /**
337
- * Pass a function to handle input change events
338
- */
339
- inputChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
340
- /**
341
- * Pass a function to handle input focus events
342
- */
343
- inputBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
344
- /**
345
- * Function prop to handle input keydown events
346
- */
347
- inputDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
348
- /**
349
- * Input is required or not
350
- */
351
- required?: boolean;
352
- /**
353
- * Input id attribute
354
- */
355
- id: string;
356
- /**
357
- * Set the element as disabled
358
- */
359
- isDisabled?: boolean;
360
- /**
361
- * Set the element as readonly
362
- */
363
- readonly?: boolean;
364
- /**
365
- * ref to the input element
366
- */
367
- inputRef?: React.RefObject<HTMLInputElement>;
368
- /**
369
- * Input styles
370
- */
371
- styles?: {};
372
- /**
373
- * input classes
374
- */
375
- classes?: string;
376
- }
377
- /**
378
- * Input component that renders an HTML input element.
379
- * @param {InputProps} props - The input component props.
380
- * @returns {JSX.Element} - The input component.
381
- */
382
- declare const Input: {
383
- ({ type, name, value, placeholder, id, styles, classes, isDisabled, readonly, required, inputRef, inputChange, inputBlur, inputDown, ...props }: InputProps): JSX.Element;
384
- styles: {
385
- minWidth: string;
386
- };
387
- displayName: string;
388
- };
389
-
390
- type LinkProps = Partial<ComponentProps$1> & {
391
- href: string;
392
- target?: string;
393
- rel?: string;
394
- children: React.ReactNode;
395
- prefetch?: boolean;
396
- onPointerDown?: (e: React.PointerEvent<HTMLAnchorElement>) => void;
397
- };
398
- declare const Link: {
399
- ({ href, target, rel, children, styles, prefetch, onPointerDown, ...props }: LinkProps): react_jsx_runtime.JSX.Element;
400
- displayName: string;
401
- };
402
-
403
- interface ListProps {
404
- styles?: {};
405
- classes?: string;
406
- children: React$1.ReactNode;
407
- type: 'ul' | 'ol' | 'dl';
408
- variant: string;
409
- }
410
- declare const List: ({ children, classes, type, variant, styles, ...props }: ListProps) => react_jsx_runtime.JSX.Element;
411
-
412
- interface ModalProps extends ComponentProps$1 {
413
- /**
414
- * The child component/content for open button
415
- */
416
- openChild?: React__default.ReactNode;
417
- /**
418
- * The child component/content for close button
419
- */
420
- closeChild?: React__default.ReactNode;
421
- /**
422
- * The child component/content for modal header
423
- */
424
- modalHeader?: React__default.ReactNode;
425
- /**
426
- * The child component/content for modal footer
427
- */
428
- modalFooter?: React__default.ReactNode;
429
- /**
430
- * The child component/content for modal body
431
- */
432
- children: React__default.ReactNode;
433
- /**
434
- * Open modal on mount when set to true
435
- */
436
- showOpen?: boolean;
437
- }
438
- declare const Modal: {
439
- ({ openChild, closeChild, modalHeader, modalFooter, children, showOpen, ...props }: ModalProps): react_jsx_runtime.JSX.Element;
440
- displayName: string;
441
- };
442
-
443
- interface TableProps extends ComponentProps$1 {
444
- tblHead: React.ReactNode;
445
- tblBody: React.ReactNode;
446
- tblCaption?: React.ReactNode;
447
- }
448
- /**
449
- * Render the table placing `caption`, `thead` and `tbody` in the correct order
450
- * caption is optional
451
- */
452
- declare const RenderTable: {
453
- ({ tblBody, tblCaption, tblHead }: TableProps): react_jsx_runtime.JSX.Element;
454
- displayName: string;
455
- };
456
-
457
- declare const Caption: {
458
- ({ children, ...props }: ComponentProps$1): react_jsx_runtime.JSX.Element;
459
- displayName: string;
460
- };
461
- declare const Thead: {
462
- ({ children, ...props }: ComponentProps$1): react_jsx_runtime.JSX.Element;
463
- displayName: string;
464
- };
465
- declare const Tbody: {
466
- ({ children, ...props }: ComponentProps$1): react_jsx_runtime.JSX.Element;
467
- displayName: string;
468
- };
469
- declare const Tr: {
470
- ({ children, ...props }: ComponentProps$1): react_jsx_runtime.JSX.Element;
471
- displayName: string;
472
- };
473
- declare const Td: {
474
- ({ children, ...props }: ComponentProps$1): react_jsx_runtime.JSX.Element;
475
- displayName: string;
476
- };
477
- declare const Table: {
478
- ({ id, dataStyle, children, ...props }: ComponentProps$1): react_jsx_runtime.JSX.Element;
479
- displayName: string;
480
- };
481
-
482
- type TextElements = 'p' | 'span' | 'a' | 'strong' | 'em' | 'small' | 's' | 'cite' | 'time' | 'code' | 'kbd' | 'sub' | 'sup' | 'i' | 'b' | 'u' | 'mark' | 'span' | 'blockquote';
483
- interface TextProps {
484
- /**
485
- * HTML element
486
- */
487
- elm?: TextElements;
488
- children?: React__default.ReactNode;
489
- text?: string;
490
- styles?: {};
491
- }
492
- declare const Text: {
493
- ({ elm, text, styles, children, ...props }: TextProps): react_jsx_runtime.JSX.Element;
494
- displayName: string;
495
- };
496
- interface TitleProps {
497
- /**
498
- * HTML headings
499
- */
500
- elm?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
501
- children?: React__default.ReactNode;
502
- styles?: {};
503
- }
504
- declare const Title: {
505
- ({ elm, children, styles, ...props }: TitleProps): react_jsx_runtime.JSX.Element;
506
- displayName: string;
507
- };
508
-
509
- interface TextareaProps extends SharedInputProps {
510
- /**
511
- * The number of lines in textarea
512
- */
513
- rows?: number;
514
- /**
515
- * The number of columns in textarea
516
- */
517
- cols?: number;
518
- /**
519
- * Textarea react ref
520
- */
521
- textareaRef?: React.RefObject<HTMLTextAreaElement>;
522
- /**
523
- * Textarea change event handler
524
- */
525
- textareaChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
526
- /**
527
- * Textarea area blur event handler
528
- */
529
- textareaBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
530
- /**
531
- * Textarea keydown event handler
532
- */
533
- textareaDown?: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
534
- }
535
- declare const Textarea: {
536
- ({ value, rows, cols, id, required, disabled, readonly, textareaBlur, textareaChange, textareaDown, textareaRef, ...props }: TextareaProps): react_jsx_runtime.JSX.Element;
537
- displayName: string;
538
- };
539
-
540
- type PolymorphicRef<C extends React__default.ElementType> = React__default.ComponentPropsWithRef<C>['ref'];
541
- type AsProp<C extends React__default.ElementType> = {
542
- as?: C;
543
- };
544
- type PropsToOmit<C extends React__default.ElementType, P> = keyof (AsProp<C> & P);
545
- type PolymorphicComponentProp<C extends React__default.ElementType, Props = {}> = React__default.PropsWithChildren<Props & AsProp<C>> & Omit<React__default.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;
546
- type PolymorphicComponentPropWithRef<C extends React__default.ElementType, Props = {}> = PolymorphicComponentProp<C, Props> & {
547
- ref?: PolymorphicRef<C>;
548
- };
549
- type FPProps<C extends React__default.ElementType> = PolymorphicComponentPropWithRef<C, {
550
- renderStyles?: boolean;
551
- styles?: {};
552
- }>;
553
- type FPComponent = <C extends React__default.ElementType = 'span'>(props: FPProps<C>) => React__default.ReactElement | any;
554
- /**
555
- * FP component is a polymorphic component that renders an HTML element with optional styles.
556
- * @param {Object} props - Component props
557
- * @param {React.ElementType} props.as - The HTML element to render. Defaults to 'div'.
558
- * @param {boolean} props.renderStyles - Whether to render styles or not. Defaults to true.
559
- * @param {Object} props.styles - The styles to apply to the component.
560
- * @param {Object} props.defaultStyles - The default styles to apply to the component.
561
- * @param {React.ReactNode} props.children - The children to render inside the component.
562
- * @returns {React.ReactElement} - A React component that renders an HTML element with optional styles.
563
- */
564
- declare const FP: FPComponent;
565
-
566
- export { Article, Aside, Badge, FP as Box, Button, Caption, Card, Dialog, Dropdown, FP, Field, Footer, Header, Img, Input, Link, List, Main, Modal, Section, RenderTable as TBL, Table, FP as Tag, Tbody, Td, Text, Textarea, Thead, Title, Link as To, Tr };
package/dist/index.js DELETED
@@ -1,11 +0,0 @@
1
- import { a } from './chunk-GJWMCDFS.js';
2
- import { c, b, a as a$1 } from './chunk-PCDUGD3C.js';
3
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
- import Se from 'react';
5
- export { a as Box, a as FP, q as Icon, a as Tag } from './chunk-GJWMCDFS.js';
6
-
7
- const ae={paddingInline:"var(--badge-px, 0.7rem)",paddingBlock:"var(--badge-py, 0.2rem)",color:"var(--badge-cl, black)",fontSize:"var(--badge-fs, 0.8rem)",fontWeight:"var(--badge-fw, normal)",fontFamily:"var(--badge-ff, sans-serif)",border:"var(--badge-brd, none)",borderRadius:"var(--badge-rds, 99rem)",backgroundColor:'var(--badge-bg, "blue")',textDecoration:"var(--badge-decoration, none)",textTransform:"var(--badge-tt, var(--tt))"}; const D=i=>{const m=i; const {elm:o="span",role:t,children:r,renderStyles:e=!0,styles:a$2={}}=m; const p=c(m,["elm","role","children","renderStyles","styles"]);return jsx(a,b(a$1({as:o,role:t,styles:a$2},p),{children:r}))};D.styles=ae;D.displayName="Badge";const se={paddingInline:"var(--btn-px, 1.4rem)",paddingBlock:"var(--btn-py, 0.8rem)",display:"var(--btn-dsp, inline-flex)",placeItems:"var(--btn-place, center)",justifyContent:"var(--btn-justify, center)",cursor:"var(--btn-cursor, pointer)",border:"var(--btn-border, none)",color:"var(--btn-color, white)",backgroundColor:"var(--btn-bg, royalblue)",borderRadius:"var(--btn-radius, 0.2rem)"}; const E=c$1=>{const f=c$1; const {type:o="button",children:t,styles:r,disabled:e,classes:a,pointerDown:p,pointerOver:i,pointerLeave:m}=f; const y=c(f,["type","children","styles","disabled","classes","pointerDown","pointerOver","pointerLeave"]);return jsx("button",b(a$1({type:o,onPointerOver:v=>{e||i==null||i(v);},onPointerDown:v=>{e||p==null||p(v);},onPointerLeave:v=>{e||m==null||m(v);},style:r,"aria-disabled":e},y),{children:t}))};E.styles=se;E.displayName="Button";const pe={padding:"var(--card-p, 2rem)",backgroundColor:"var(--card-bg, white)",boxShadow:"var(--card-shadow, 0 0 0.5rem 0.1rem rgba(0, 0, 0, 0.1))",borderRadius:"var(--card-rds, 0.2\xDFrem)",border:"var(--card-brd, none)",color:"var(--card-cl, black)"}; const A=m=>{const y=m; const {elm:o="div",styles:t,children:r,renderStyles:e=!0,dataStyle:a$2,id:p}=y; const i=c(y,["elm","styles","children","renderStyles","dataStyle","id"]);return jsx(a,b(a$1({as:o,id:p,styles:t,renderStyles:e,"data-card":a$2},i),{children:r}))};A.styles=pe;A.displayName="Card";const L=p=>{const i=p; const {id:o,children:t,modalRef:r,openOnMount:e}=i; const a$2=c(i,["id","children","modalRef","openOnMount"]);return jsx(a,b(a$1({as:"dialog",id:o,ref:r,open:e,onClick:y=>{y.currentTarget===y.target&&y.currentTarget.close();}},a$2),{children:t}))};L.displayName="Dialog";const me={padding:"var(--card-p, 1.2rem)",backgroundColor:"var(--card-bg, white)"}; const F=i=>{const m=i; const {title:o,children:t,styles:r,renderStyles:e=!0,onToggle:a$1}=m;c(m,["title","children","styles","renderStyles","onToggle"]);return jsx(a,{as:"details",title:o,onToggle:c=>{a$1==null||a$1(c);},styles:r,children:t})};F.styles=me;F.displayName="Details";const ye={listStyle:"none",justifyContent:"var(--summary-justify, space-between)",color:"var(--summary-color, currentColor)",cursor:"var(--detail-cursor, pointer)"}; const N=a$2=>{const p=a$2; const {children:o,styles:t,renderStyles:r=!0}=p; const e=c(p,["children","styles","renderStyles"]);return jsx(a,b(a$1({as:"summary",styles:t},e),{children:o}))};N.styles=ye;N.displayName="Summary";const ue={display:"flex",placeContent:"flex-start",placeItems:"center",gap:".7rem",border:"var(--summary-border, solid 1px #ccc)",transition:"all 0.2s ease",backgroundColor:"var(--summary-bg, whitesmoke)",padding:"var(--details-pd, 1.2rem)",minWidth:"var(--summary-min-w, 80vw)",maxWidth:"var(--summary-min-w, 80vw)"}; const M=i=>{const m=i; const {styles:o,children:t,summary:r,toggle:e,renderStyles:a=!0}=m; const p=c(m,["styles","children","summary","toggle","renderStyles"]);return jsxs(F,b(a$1({styles:o,onToggle:e},p),{children:[jsx(N,{children:r}),t]}))};M.styles=ue;M.Summary=N;M.Details=F;M.displayName="Dropdown";const xe={}; const O=p=>{const i=p; const {labelFor:o,styles:t,label:r,children:e}=i;c(i,["labelFor","styles","label","children"]);return jsxs(a,{as:"div",styles:t,"data-style":"fields",children:[jsx("label",{htmlFor:o,children:r}),e]})};O.styles=xe;O.displayName="Field";const V=e=>{const a$2=e; const {children:o,styles:t={}}=a$2; const r=c(a$2,["children","styles"]);return jsx(a,b(a$1({as:"header"},r),{styles:t,children:jsx(a,{as:"section",children:o})}))}; const X=e=>{const a$2=e; const {children:o,styles:t={}}=a$2; const r=c(a$2,["children","styles"]);return jsx(a,b(a$1({as:"main",styles:t},r),{children:o}))}; const _=e=>{const a$2=e; const {children:o,styles:t={}}=a$2; const r=c(a$2,["children","styles"]);return jsx(a,b(a$1({as:"footer",styles:t},r),{children:jsx(a,{as:"section",children:o||"Copyright \xA9 2022"})}))}; const G=e=>{const a$2=e; const {children:o,styles:t={}}=a$2; const r=c(a$2,["children","styles"]);return jsx(a,b(a$1({as:"aside",styles:t},r),{children:jsx(a,{as:"section",children:o})}))}; const Q=e=>{const a$2=e; const {children:o,styles:t={}}=a$2; const r=c(a$2,["children","styles"]);return jsx(a,b(a$1({as:"section",styles:t},r),{children:o}))}; const U=e=>{const a$2=e; const {children:o,styles:t={}}=a$2; const r=c(a$2,["children","styles"]);return jsx(a,b(a$1({as:"article",styles:t},r),{children:o}))};V.displayName="Header";X.displayName="Main";_.displayName="Footer";G.displayName="Aside";Q.displayName="Section";U.displayName="Article";const he={maxWidth:"var(--img-w, 100%)",height:"var(--img-h, auto)",objectFit:"var(--img-obj-fit, cover)",objectPosition:"var(--img-position, center center)",aspectRatio:"var(--img-ratio, auto 2/3)",display:"var(--img-display, initial)"}; const K=b=>{const P=b; const {src:o,alt:t,width:r=480,height:e,styles:a$2,loading:p="lazy",placeholder:i=`https://via.placeholder.com/${r}?text=PLACEHOLDER`,fetchpriority:m="low",decoding:y="auto",imgLoaded:c$1,imgError:f}=P; const u=c(P,["src","alt","width","height","styles","loading","placeholder","fetchpriority","decoding","imgLoaded","imgError"]);return jsx(a,a$1({as:"img",src:o,alt:t,width:r,height:e||"auto",loading:p,style:a$2,onError:x=>{if(f){f==null||f(x);return}x.currentTarget.src!==i&&(x.currentTarget.src=i);},onLoad:x=>{c$1==null||c$1(x);}},u))};K.styles=he;K.displayName="Img";const Re={minWidth:"var(--input-min-w, 60%)"}; const W=k=>{const x=k; const {type:o="text",name:t,value:r,placeholder:e,id:a$2,styles:p,classes:i,isDisabled:m,readonly:y,required:c$1,inputRef:f,inputChange:u,inputBlur:b,inputDown:P}=x; const v=c(x,["type","name","value","placeholder","id","styles","classes","isDisabled","readonly","required","inputRef","inputChange","inputBlur","inputDown"]);return jsx(a,a$1({as:"input",id:a$2,type:o,placeholder:e,className:i,styles:p,onChange:C=>{u&&!m&&(u==null||u(C));},onBlur:C=>{b&&!m&&(b==null||b(C));},onKeyDown:C=>{P&&!m&&(C.preventDefault(),P==null||P(C));},value:r,name:t,ref:f,"aria-disabled":m,"tab-index":m?-1:void 0,"aria-readonly":y,readOnly:y},v))};W.styles=Re;W.displayName="Input";const q=y=>{const c$1=y; const {href:o,target:t,rel:r,children:e,styles:a$2={},prefetch:p=!0,onPointerDown:i}=c$1; const m=c(c$1,["href","target","rel","children","styles","prefetch","onPointerDown"]);let f=r;return t==="_blank"&&(f=`noopener noreferrer ${p?"prefetch":""}`),jsx(a,b(a$1({as:"a",href:o,target:t,styles:a$2,rel:f,onPointerDown:b=>{i&&(i==null||i(b));}},m),{children:e!=null?e:"Link"}))}; const Ee=q;q.displayName="Link";const Ne=i=>{const m=i; const {children:o,classes:t,type:r="ul",variant:e,styles:a$2}=m; const p=c(m,["children","classes","type","variant","styles"]);return jsx(a,b(a$1({as:r,"data-variant":e,className:t,style:a$2},p),{children:o}))};const Y=m=>{const y=m; const {openChild:o,closeChild:t,modalHeader:r,modalFooter:e,children:a,showOpen:p=!1}=y; const i=c(y,["openChild","closeChild","modalHeader","modalFooter","children","showOpen"]);const c$1=Se.useRef(null); const f=()=>{c$1.current&&(p?c$1.current.show():c$1.current.showModal());}; const u=()=>{c$1.current&&c$1.current.close();};return jsxs(Fragment,{children:[jsx(L,b(a$1({modalRef:c$1,openOnMount:p},i),{children:jsxs("section",{children:[r,a,e!=null?e:jsxs("div",{children:[jsx(E,{type:"button",pointerDown:()=>{u();},children:t||"Close"})," "]})]})})),!p&&jsx(E,{type:"button",pointerDown:f,children:o||"Open Modal"})]})};Y.displayName="Modal";const H=r=>{const e=r; const {children:o}=e; const t=c(e,["children"]);return jsx(a,b(a$1({as:"caption"},t),{children:o}))}; const I=r=>{const e=r; const {children:o}=e; const t=c(e,["children"]);return jsx(a,b(a$1({as:"thead"},t),{children:o}))}; const S=r=>{const e=r; const {children:o}=e; const t=c(e,["children"]);return jsx(a,b(a$1({as:"tbody"},t),{children:o}))}; const w=r=>{const e=r; const {children:o}=e; const t=c(e,["children"]);return jsx(a,b(a$1({as:"tr"},t),{children:o}))}; const Z=r=>{const e=r; const {children:o}=e; const t=c(e,["children"]);return jsx(a,b(a$1({as:"td"},t),{children:o}))}; const B=a$2=>{const p=a$2; const {id:o,dataStyle:t,children:r}=p; const e=c(p,["id","dataStyle","children"]);return jsx(a,b(a$1({as:"section",id:o},e),{"data-style":"table-wrapper",children:jsx("table",{children:r})}))};B.displayName="Table";H.displayName="Caption";I.displayName="Thead";S.displayName="Tbody";w.displayName="Tr";Z.displayName="Td";const j=({tblBody:o,tblCaption:t,tblHead:r})=>jsxs(B,{children:[t&&jsx(H,{children:t}),jsx(I,{children:jsx(w,{children:r})}),jsx(S,{children:o})]});j.displayName="TBL";const ee=p=>{const i=p; const {elm:o="p",text:t,styles:r,children:e}=i; const a$2=c(i,["elm","text","styles","children"]);return jsx(a,b(a$1({as:o,styles:r},a$2),{children:e||t}))}; const te=a$2=>{const p=a$2; const {elm:o="h3",children:t,styles:r}=p; const e=c(p,["elm","children","styles"]);return jsx(a,b(a$1({as:o,styles:r},e),{children:t}))};ee.displayName="Text";te.displayName="Title";const ke={}; const oe=b=>{const P=b; const {value:o,rows:t,cols:r,id:e,required:a$2,disabled:p,readonly:i,textareaBlur:m,textareaChange:y,textareaDown:c$1,textareaRef:f}=P; const u=c(P,["value","rows","cols","id","required","disabled","readonly","textareaBlur","textareaChange","textareaDown","textareaRef"]);const v=R=>{y&&!p&&y(R);}; const k=R=>{m&&!p&&(m==null||m(R));}; const x=R=>{c$1&&!p&&(c$1==null||c$1(R));};return jsx(a,a$1({as:"textarea",ref:f,rows:t,cols:r,styles:a$1({},ke),"data-style":"textarea",id:e,required:a$2,value:o,"aria-disabled":p,readOnly:i,onChange:v,onBlur:k,onKeyDown:x},u))};oe.displayName="Textarea";
8
-
9
- export { U as Article, G as Aside, D as Badge, E as Button, H as Caption, A as Card, L as Dialog, M as Dropdown, O as Field, _ as Footer, V as Header, K as Img, W as Input, q as Link, Ne as List, X as Main, Y as Modal, Q as Section, j as TBL, B as Table, S as Tbody, Z as Td, ee as Text, oe as Textarea, I as Thead, te as Title, Ee as To, w as Tr };
10
- // # sourceMappingURL=out.js.map
11
- // # sourceMappingURL=index.js.map