mado-ui 0.3.2 → 0.4.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 (148) hide show
  1. package/css/index.css +41 -6
  2. package/dist/components/button.d.ts +3 -23
  3. package/dist/components/details.d.ts +2 -2
  4. package/dist/components/drop-down.d.ts +1 -1
  5. package/dist/components/form/fieldset.d.ts +35 -7
  6. package/dist/components/form/index.d.ts +5 -6
  7. package/dist/components/form/input/date/index.d.ts +36 -0
  8. package/dist/components/form/input/index.d.ts +78 -12
  9. package/dist/components/form/submit-button.d.ts +1 -1
  10. package/dist/components/form/textarea.d.ts +1 -1
  11. package/dist/components/ghost.d.ts +1 -1
  12. package/dist/components/heading.d.ts +1 -1
  13. package/dist/components/iframe.d.ts +15 -0
  14. package/dist/components/index.d.ts +10 -11
  15. package/dist/components/link.d.ts +3 -14
  16. package/dist/components/modal.d.ts +1 -1
  17. package/dist/components/time.d.ts +1 -1
  18. package/dist/components/tooltip.d.ts +1 -1
  19. package/dist/components.esm.js +466 -122
  20. package/dist/components.esm.js.map +1 -1
  21. package/dist/components.js +465 -119
  22. package/dist/components.js.map +1 -1
  23. package/dist/hooks/index.d.ts +4 -3
  24. package/dist/hooks/use-fieldset-context.d.ts +22 -0
  25. package/dist/hooks/use-form-context.d.ts +18 -10
  26. package/dist/hooks.esm.js +99 -5
  27. package/dist/hooks.esm.js.map +1 -1
  28. package/dist/hooks.js +100 -3
  29. package/dist/hooks.js.map +1 -1
  30. package/dist/icons/3-people.d.ts +2 -2
  31. package/dist/icons/3-rectangles-desktop-fill.d.ts +2 -2
  32. package/dist/icons/3-rectangles-desktop.d.ts +2 -2
  33. package/dist/icons/airplane.d.ts +2 -2
  34. package/dist/icons/arrow-triangle-2-circlepath-circle-fill.d.ts +2 -2
  35. package/dist/icons/arrow-triangle-2-circlepath-circle.d.ts +2 -2
  36. package/dist/icons/bag-fill.d.ts +2 -2
  37. package/dist/icons/banknote.d.ts +2 -2
  38. package/dist/icons/bell-fill.d.ts +2 -2
  39. package/dist/icons/bolt-car.d.ts +2 -2
  40. package/dist/icons/bolt-fill.d.ts +2 -2
  41. package/dist/icons/bolt-ring-closed.d.ts +2 -2
  42. package/dist/icons/bolt-trianglebadge-exclamationmark.d.ts +2 -2
  43. package/dist/icons/book-fill.d.ts +2 -2
  44. package/dist/icons/bookmark-fill.d.ts +2 -2
  45. package/dist/icons/briefcase-fill.d.ts +2 -2
  46. package/dist/icons/bubble-left-fill.d.ts +2 -2
  47. package/dist/icons/building-2-fill.d.ts +2 -2
  48. package/dist/icons/calendar.d.ts +2 -2
  49. package/dist/icons/camera-fill.d.ts +2 -2
  50. package/dist/icons/car-fill.d.ts +2 -2
  51. package/dist/icons/cart-fill.d.ts +2 -2
  52. package/dist/icons/chart-bar-doc-horizontal.d.ts +2 -2
  53. package/dist/icons/checkmark-seal.d.ts +2 -2
  54. package/dist/icons/checkmark.d.ts +2 -2
  55. package/dist/icons/chevron-down.d.ts +2 -2
  56. package/dist/icons/chevron-left-forwardslash-chevron-right.d.ts +2 -2
  57. package/dist/icons/chevron-left.d.ts +2 -2
  58. package/dist/icons/chevron-right.d.ts +2 -2
  59. package/dist/icons/chevron-up-chevron-down.d.ts +2 -2
  60. package/dist/icons/circle-fill.d.ts +2 -2
  61. package/dist/icons/clock-badge-checkmark.d.ts +2 -2
  62. package/dist/icons/clock-fill.d.ts +2 -2
  63. package/dist/icons/cloud-fill.d.ts +2 -2
  64. package/dist/icons/cube-fill.d.ts +2 -2
  65. package/dist/icons/curve-point-left.d.ts +2 -2
  66. package/dist/icons/dial-high.d.ts +2 -2
  67. package/dist/icons/doc-fill.d.ts +2 -2
  68. package/dist/icons/doc-on-clipboard.d.ts +2 -2
  69. package/dist/icons/doc-on-doc-fill.d.ts +2 -2
  70. package/dist/icons/doc-on-doc.d.ts +2 -2
  71. package/dist/icons/doc-text-magnifyingglass.d.ts +2 -2
  72. package/dist/icons/dollar-sign.d.ts +2 -2
  73. package/dist/icons/ellipsis-circle-fill.d.ts +2 -2
  74. package/dist/icons/ellipsis-circle.d.ts +2 -2
  75. package/dist/icons/envelope-fill.d.ts +2 -2
  76. package/dist/icons/envelope.d.ts +2 -2
  77. package/dist/icons/exclamationmark-octagon.d.ts +2 -2
  78. package/dist/icons/eye.d.ts +2 -2
  79. package/dist/icons/figure-water-fitness.d.ts +2 -2
  80. package/dist/icons/flag-fill.d.ts +2 -2
  81. package/dist/icons/flame-fill.d.ts +2 -2
  82. package/dist/icons/folder-fill.d.ts +2 -2
  83. package/dist/icons/folder.d.ts +2 -2
  84. package/dist/icons/gearshape-fill.d.ts +2 -2
  85. package/dist/icons/gearshape.d.ts +2 -2
  86. package/dist/icons/gift-fill.d.ts +2 -2
  87. package/dist/icons/globe-americas-fill.d.ts +2 -2
  88. package/dist/icons/hare-fill.d.ts +2 -2
  89. package/dist/icons/house-deskclock.d.ts +2 -2
  90. package/dist/icons/house-fill.d.ts +2 -2
  91. package/dist/icons/house.d.ts +2 -2
  92. package/dist/icons/iphone-house.d.ts +2 -2
  93. package/dist/icons/light-ribbon.d.ts +2 -2
  94. package/dist/icons/lightbulb-fill.d.ts +2 -2
  95. package/dist/icons/lightbulb-led.d.ts +2 -2
  96. package/dist/icons/list-bullet-clipboard-fill.d.ts +2 -2
  97. package/dist/icons/magnifyingglass.d.ts +2 -2
  98. package/dist/icons/map-pin-ellipse.d.ts +2 -2
  99. package/dist/icons/minus-plus-batterblock.d.ts +2 -2
  100. package/dist/icons/network-shield.d.ts +2 -2
  101. package/dist/icons/network.d.ts +2 -2
  102. package/dist/icons/newspaper-fill.d.ts +2 -2
  103. package/dist/icons/number.d.ts +2 -2
  104. package/dist/icons/paperplane-fill.d.ts +2 -2
  105. package/dist/icons/person-crop-square.d.ts +2 -2
  106. package/dist/icons/person-fill-questionmark.d.ts +2 -2
  107. package/dist/icons/person-fill.d.ts +2 -2
  108. package/dist/icons/person.d.ts +2 -2
  109. package/dist/icons/phone-arrow-up-right.d.ts +2 -2
  110. package/dist/icons/phone-fill.d.ts +2 -2
  111. package/dist/icons/phone.d.ts +2 -2
  112. package/dist/icons/play-rectangle-fill.d.ts +2 -2
  113. package/dist/icons/plus.d.ts +2 -2
  114. package/dist/icons/qrcode.d.ts +2 -2
  115. package/dist/icons/rectangle-portrait-and-arrow-left-fill.d.ts +2 -2
  116. package/dist/icons/rectangle-portrait-and-arrow-left.d.ts +2 -2
  117. package/dist/icons/sensor.d.ts +2 -2
  118. package/dist/icons/signature.d.ts +2 -2
  119. package/dist/icons/solar-panel.d.ts +2 -2
  120. package/dist/icons/square-and-arrow-down-fill.d.ts +2 -2
  121. package/dist/icons/square-and-arrow-down.d.ts +2 -2
  122. package/dist/icons/square-and-arrow-up-fill.d.ts +2 -2
  123. package/dist/icons/square-and-arrow-up.d.ts +2 -2
  124. package/dist/icons/square-and-pencil-fill.d.ts +2 -2
  125. package/dist/icons/square-and-pencil.d.ts +2 -2
  126. package/dist/icons/text-bubble.d.ts +2 -2
  127. package/dist/icons/trash-fill.d.ts +2 -2
  128. package/dist/icons/trash.d.ts +2 -2
  129. package/dist/icons/tree.d.ts +2 -2
  130. package/dist/icons/umbrella-fill.d.ts +2 -2
  131. package/dist/icons/xmark.d.ts +2 -2
  132. package/dist/icons.esm.js.map +1 -1
  133. package/dist/icons.js.map +1 -1
  134. package/dist/index.esm.js +466 -122
  135. package/dist/index.esm.js.map +1 -1
  136. package/dist/index.js +465 -119
  137. package/dist/index.js.map +1 -1
  138. package/dist/types/index.d.ts +1 -2
  139. package/dist/types/utils.d.ts +20 -0
  140. package/dist/utils/get-date.d.ts +17 -0
  141. package/dist/utils/index.d.ts +8 -9
  142. package/dist/utils/string-manipulation.d.ts +38 -3
  143. package/dist/utils/tw-sort.d.ts +1 -1
  144. package/dist/utils.esm.js +112 -21
  145. package/dist/utils.esm.js.map +1 -1
  146. package/dist/utils.js +113 -20
  147. package/dist/utils.js.map +1 -1
  148. package/package.json +4 -4
package/css/index.css CHANGED
@@ -81,6 +81,7 @@
81
81
  --blur-md: 12px;
82
82
  --blur-2xl: 40px;
83
83
  --blur-3xl: 64px;
84
+ --aspect-video: 16 / 9;
84
85
  --default-transition-duration: 150ms;
85
86
  --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
86
87
  --default-font-family: var(--font-sans);
@@ -382,6 +383,9 @@
382
383
  .field-sizing-content {
383
384
  field-sizing: content;
384
385
  }
386
+ .aspect-video {
387
+ aspect-ratio: var(--aspect-video);
388
+ }
385
389
  .size-5 {
386
390
  width: calc(var(--spacing) * 5);
387
391
  height: calc(var(--spacing) * 5);
@@ -540,6 +544,9 @@
540
544
  .list-disc {
541
545
  list-style-type: disc;
542
546
  }
547
+ .grid-cols-2 {
548
+ grid-template-columns: repeat(2, minmax(0, 1fr));
549
+ }
543
550
  .grid-cols-\[1fr_1rem\] {
544
551
  grid-template-columns: 1fr 1rem;
545
552
  }
@@ -558,6 +565,9 @@
558
565
  .justify-center {
559
566
  justify-content: center;
560
567
  }
568
+ .gap-\(--tw-gap\) {
569
+ gap: var(--tw-gap);
570
+ }
561
571
  .gap-1 {
562
572
  gap: calc(var(--spacing) * 1);
563
573
  }
@@ -1112,6 +1122,12 @@
1112
1122
  .text-black {
1113
1123
  color: var(--color-black);
1114
1124
  }
1125
+ .text-current\/80 {
1126
+ color: currentcolor;
1127
+ @supports (color: color-mix(in lab, red, red)) {
1128
+ color: color-mix(in oklab, currentcolor 80%, transparent);
1129
+ }
1130
+ }
1115
1131
  .text-neutral-50 {
1116
1132
  color: var(--color-neutral-50);
1117
1133
  }
@@ -1357,6 +1373,31 @@
1357
1373
  --tw-ease: var(--ease-in-out);
1358
1374
  transition-timing-function: var(--ease-in-out);
1359
1375
  }
1376
+ .gap-1 {
1377
+ --tw-gap: calc(var(--spacing) * 1);
1378
+ --tw-gap-x: var(--tw-gap, calc(var(--spacing) * 1));
1379
+ --tw-gap-y: var(--tw-gap, calc(var(--spacing) * 1));
1380
+ }
1381
+ .gap-2 {
1382
+ --tw-gap: calc(var(--spacing) * 2);
1383
+ --tw-gap-x: var(--tw-gap, calc(var(--spacing) * 2));
1384
+ --tw-gap-y: var(--tw-gap, calc(var(--spacing) * 2));
1385
+ }
1386
+ .gap-3 {
1387
+ --tw-gap: calc(var(--spacing) * 3);
1388
+ --tw-gap-x: var(--tw-gap, calc(var(--spacing) * 3));
1389
+ --tw-gap-y: var(--tw-gap, calc(var(--spacing) * 3));
1390
+ }
1391
+ .gap-4 {
1392
+ --tw-gap: calc(var(--spacing) * 4);
1393
+ --tw-gap-x: var(--tw-gap, calc(var(--spacing) * 4));
1394
+ --tw-gap-y: var(--tw-gap, calc(var(--spacing) * 4));
1395
+ }
1396
+ .gap-8 {
1397
+ --tw-gap: calc(var(--spacing) * 8);
1398
+ --tw-gap-x: var(--tw-gap, calc(var(--spacing) * 8));
1399
+ --tw-gap-y: var(--tw-gap, calc(var(--spacing) * 8));
1400
+ }
1360
1401
  .animation-delay-150 {
1361
1402
  --tw-animation-delay: 150ms;
1362
1403
  animation-delay: var(--tw-animation-delay);
@@ -2283,12 +2324,6 @@
2283
2324
  line-height: var(--tw-leading, var(--text-5xl--line-height));
2284
2325
  }
2285
2326
  }
2286
- .sm\:text-xl {
2287
- @media (width >= 40rem) {
2288
- font-size: var(--text-xl);
2289
- line-height: var(--tw-leading, var(--text-xl--line-height));
2290
- }
2291
- }
2292
2327
  .sm\:text-\[12rem\] {
2293
2328
  @media (width >= 40rem) {
2294
2329
  font-size: 12rem;
@@ -1,26 +1,6 @@
1
1
  import { Url, UrlObject } from 'node:url';
2
2
  import { ElementType } from 'react';
3
- import { AnyElementProps, OneOf } from '../types';
4
- type ColorTheme = OneOf<[
5
- {
6
- /** Color theme. */
7
- theme?: 'blue' | 'brown' | 'green' | 'grey' | 'sky-blue' | 'magenta' | 'orange' | 'pink' | 'purple' | 'red' | 'violet' | 'yellow';
8
- },
9
- {
10
- /** Color theme. */
11
- theme?: 'custom';
12
- customTheme: OneOf<[
13
- {
14
- /** Example: `'[--theme-color:var(--color-blue-500)]'` */
15
- themeColor: string;
16
- },
17
- {
18
- /** This doesn't use any preset color theme classes. */
19
- classes: string;
20
- }
21
- ]>;
22
- }
23
- ]>;
3
+ import { AnyElementProps, ColorTheme, OneOf } from '../types';
24
4
  type LinkOrOther<TTag extends ElementType = typeof HeadlessButton> = OneOf<[
25
5
  AnyElementProps<TTag> & {
26
6
  href?: never;
@@ -66,7 +46,7 @@ export type ExtendedButtonConfig = {
66
46
  };
67
47
  };
68
48
  };
69
- export type ExtendedThemeNames<T extends ExtendedButtonConfig> = T['theme'] extends Record<string, unknown> ? keyof T['theme'] : never;
49
+ type ExtendedThemeNames<T extends ExtendedButtonConfig> = T['theme'] extends Record<string, unknown> ? keyof T['theme'] : never;
70
50
  export type ExtendedButtonProps<TExtendedConfig extends ExtendedButtonConfig, TTag extends ElementType = typeof HeadlessButton> = Omit<ButtonProps<TTag>, 'theme' | 'customTheme'> & {
71
51
  theme?: ButtonProps<TTag>['theme'] | ExtendedThemeNames<TExtendedConfig>;
72
52
  customTheme?: ButtonProps<TTag>['customTheme'];
@@ -77,7 +57,7 @@ import { Button as HeadlessButton } from '@headlessui/react';
77
57
  * # Button
78
58
  * - A pre-styled button with utility props for easy customization depending on use case.
79
59
  */
80
- export default function Button<TTag extends ElementType = typeof HeadlessButton>({ className, customTheme, gradient, padding, rounded, theme, ...props }: ButtonProps<TTag>): import("react/jsx-runtime").JSX.Element;
60
+ export declare function Button<TTag extends ElementType = typeof HeadlessButton>({ className, customTheme, gradient, padding, rounded, theme, ...props }: ButtonProps<TTag>): import("react/jsx-runtime").JSX.Element;
81
61
  /**
82
62
  * # createButton
83
63
  * Creates an extended Button component with additional theme options.
@@ -10,7 +10,7 @@ export type DetailsSummaryProps<TTag extends ElementType = typeof Button<typeof
10
10
  className?: string;
11
11
  };
12
12
  import { Button as HeadlessButton, DisclosureProps, DisclosureButtonProps, DisclosurePanelProps } from '@headlessui/react';
13
- import Button from './button';
13
+ import { Button } from './button';
14
14
  export declare function DetailsSummary<TTag extends ElementType = typeof Button>({ arrow, children, className, ...props }: DetailsSummaryProps<TTag>): import("react/jsx-runtime").JSX.Element;
15
15
  export declare function DetailsBody<TTag extends ElementType = 'div'>({ children, className, ...props }: DetailsBodyProps<TTag>): import("react/jsx-runtime").JSX.Element;
16
- export default function Details<TTag extends ElementType = 'div'>({ as, className, ...props }: DetailsProps<TTag>): import("react/jsx-runtime").JSX.Element;
16
+ export declare function Details<TTag extends ElementType = 'div'>({ as, className, ...props }: DetailsProps<TTag>): import("react/jsx-runtime").JSX.Element;
@@ -26,4 +26,4 @@ export declare function DropDownItem({ as, ...props }: DropDownItemProps): impor
26
26
  export declare function DropDownItems({ anchor, children, className, containerClassName, style, ...props }: DropDownItemsProps): import("react/jsx-runtime").JSX.Element;
27
27
  export declare function DropDownSection({ children, label, labelProps, separatorAbove, separatorBelow, ...props }: DropDownSectionProps): import("react/jsx-runtime").JSX.Element;
28
28
  export declare function DropDownSeparator({ className, ...props }: DropDownSeparatorProps): import("react/jsx-runtime").JSX.Element;
29
- export default function DropDown(props: DropDownProps): import("react/jsx-runtime").JSX.Element;
29
+ export declare function DropDown(props: DropDownProps): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,37 @@
1
- export type FieldsetProps = HeadlessFieldsetProps & {
2
- legend?: string;
3
- legendProps?: Omit<LegendProps, 'children'> & {
4
- /** @deprecated Use the `legend` prop instead. */
5
- children?: never;
6
- };
1
+ import { OneOf } from '../../types';
2
+ type NameOrLegend = OneOf<[
3
+ {
4
+ legend: string;
5
+ legendProps?: Omit<LegendProps, 'children'> & {
6
+ /** @deprecated Use the `legend` prop instead. */
7
+ children?: never;
8
+ };
9
+ },
10
+ {
11
+ name: string;
12
+ }
13
+ ]>;
14
+ export type FieldsetProps = Omit<HeadlessFieldsetProps, 'name'> & NameOrLegend & {
15
+ /** When true, the fieldset will only be used for decoration and will not affect the `formContext`. */
16
+ decorative?: boolean;
17
+ /**
18
+ * Joins all values in the fieldset into a single string value.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * <Fieldset legend='Full Name' join=' '>
23
+ * <Input name='First Name />
24
+ * <Input name='Last Name />
25
+ * </Fieldset>
26
+ * ```
27
+ * `[{ name: 'First Name', value: 'Johnny' }, { name: 'Last Name', value: 'Appleseed' }]`
28
+ *
29
+ * ↓
30
+ *
31
+ * `[{ name: 'Full Name', value: 'Johnny Appleseed' }]`
32
+ */
33
+ join?: string;
7
34
  };
8
35
  import { FieldsetProps as HeadlessFieldsetProps, LegendProps } from '@headlessui/react';
9
- export default function Fieldset({ children, className, legend, legendProps, ...props }: FieldsetProps): import("react/jsx-runtime").JSX.Element;
36
+ export declare function Fieldset({ children, className, decorative, join, legend, legendProps, name, ...props }: FieldsetProps): import("react/jsx-runtime").JSX.Element;
37
+ export {};
@@ -24,9 +24,8 @@ export type FormProps<T extends ElementType = 'form'> = Omit<AnyElementProps<T,
24
24
  }>;
25
25
  };
26
26
  import { FormContext, FormStatus } from '../../hooks';
27
- export default function Form<T extends ElementType = 'form'>({ controlled, initialStatus, ...props }: FormProps<T>): import("react/jsx-runtime").JSX.Element;
28
- import Fieldset, { FieldsetProps } from './fieldset';
29
- import Input, { InputProps } from './input';
30
- import SubmitButton, { SubmitButtonProps } from './submit-button';
31
- import Textarea, { TextareaProps } from './textarea';
32
- export { Fieldset, FieldsetProps, Input, InputProps, Textarea, TextareaProps, SubmitButton, SubmitButtonProps };
27
+ export declare function Form<T extends ElementType = 'form'>({ controlled, initialStatus, ...props }: FormProps<T>): import("react/jsx-runtime").JSX.Element;
28
+ export * from './fieldset';
29
+ export * from './input';
30
+ export * from './submit-button';
31
+ export * from './textarea';
@@ -0,0 +1,36 @@
1
+ import { ColorTheme, OneOf } from '../../../../types';
2
+ export type DateOrTimeSelectorType = 'dropdown' | 'rotary';
3
+ export type DateSelectorType = DateOrTimeSelectorType | 'calendar';
4
+ export type TimeSelectorType = DateOrTimeSelectorType | 'clock';
5
+ export type DateAndTimeSelectorType = DateOrTimeSelectorType | 'clock-and-calendar';
6
+ export type DateTimeInputProps = OneOf<[
7
+ {
8
+ type: 'date';
9
+ /** Using an array, offers multiple, defaulting to the first listed option. */
10
+ ui?: DateSelectorType | DateSelectorType[] | {
11
+ desktop: DateSelectorType | DateSelectorType[];
12
+ mobile: DateSelectorType | DateSelectorType[];
13
+ };
14
+ },
15
+ {
16
+ type: 'datetime';
17
+ /** Using an array, offers multiple, defaulting to the first listed option. */
18
+ ui?: DateAndTimeSelectorType | DateAndTimeSelectorType[] | {
19
+ desktop: DateAndTimeSelectorType | DateAndTimeSelectorType[];
20
+ mobile: DateAndTimeSelectorType | DateAndTimeSelectorType[];
21
+ };
22
+ },
23
+ {
24
+ type: 'time';
25
+ /** Using an array, offers multiple, defaulting to the first listed option. */
26
+ ui?: TimeSelectorType | TimeSelectorType[] | {
27
+ desktop: TimeSelectorType | TimeSelectorType[];
28
+ mobile: TimeSelectorType | TimeSelectorType[];
29
+ };
30
+ }
31
+ ]> & {
32
+ max?: Date;
33
+ min?: Date;
34
+ theme?: ColorTheme;
35
+ };
36
+ export declare function DateTimeInput({ theme, type, ui, ...props }: DateTimeInputProps): import("react/jsx-runtime").JSX.Element;
@@ -1,21 +1,54 @@
1
1
  import { OneOf } from '../../../types';
2
- type PasswordOptionList = {
3
- matchPreviousInput: boolean;
4
- requireLowercaseCharacter: boolean;
5
- requireNumber: boolean;
6
- requireSpecialCharacter: boolean;
7
- requireUppercaseCharacter: boolean;
8
- };
9
- type TypeOfPasswordOrNot = OneOf<[
2
+ type DateMinMax = Date | [number, DateTimeObject['month'], DateTimeObject['day']] | Pick<DateTimeObject, 'day' | 'month' | 'year'>;
3
+ type DateTimeMinMax = Date | [
4
+ number,
5
+ DateTimeObject['month'],
6
+ DateTimeObject['day'],
7
+ DateTimeObject['hour'],
8
+ DateTimeObject['minute'],
9
+ DateTimeObject['second']
10
+ ] | DateTimeObject;
11
+ type TimeMinMax = [DateTimeObject['hour'], DateTimeObject['minute'], DateTimeObject['second']] | Pick<DateTimeObject, 'hour' | 'minute' | 'second'>;
12
+ type WeekMinMax = [number, WeekNumber];
13
+ type InputType = OneOf<[
14
+ {
15
+ type?: 'date';
16
+ min?: DateMinMax;
17
+ max?: DateMinMax;
18
+ },
19
+ {
20
+ type?: 'datetime' | 'datetime-local';
21
+ min?: DateTimeMinMax;
22
+ max?: DateTimeMinMax;
23
+ },
24
+ {
25
+ type?: 'number';
26
+ max?: number;
27
+ min?: number;
28
+ },
10
29
  {
11
30
  type?: 'password';
12
- passwordOptions?: Partial<PasswordOptionList>;
31
+ options?: Partial<PasswordOptions>;
13
32
  },
14
33
  {
15
- type?: Exclude<HTMLInputTypeAttribute, 'password'>;
34
+ type?: 'tel';
35
+ options?: Partial<PhoneOptions>;
36
+ },
37
+ {
38
+ type?: 'time';
39
+ min?: TimeMinMax;
40
+ max?: TimeMinMax;
41
+ },
42
+ {
43
+ type?: 'week';
44
+ min?: WeekMinMax;
45
+ max?: WeekMinMax;
46
+ },
47
+ {
48
+ type?: Exclude<HTMLInputTypeAttribute, 'date' | 'datetime' | 'datetime-local' | 'number' | 'password' | 'tel' | 'time' | 'week'>;
16
49
  }
17
50
  ]>;
18
- export type InputProps = Omit<HeadlessInputProps, 'name' | 'type'> & TypeOfPasswordOrNot & {
51
+ export type InputProps = Omit<HeadlessInputProps, 'max' | 'min' | 'name' | 'type'> & InputType & {
19
52
  description?: ReactNode;
20
53
  descriptionProps?: Omit<DescriptionProps, 'children'> & {
21
54
  /** @deprecated Use the `description` prop instead. */
@@ -30,7 +63,40 @@ export type InputProps = Omit<HeadlessInputProps, 'name' | 'type'> & TypeOfPassw
30
63
  name: string;
31
64
  ref?: RefObject<HTMLInputElement | null>;
32
65
  };
66
+ type PasswordOptions = {
67
+ matchPreviousInput: boolean;
68
+ requireLowercaseCharacter: boolean;
69
+ requireNumber: boolean;
70
+ requireSpecialCharacter: boolean;
71
+ requireUppercaseCharacter: boolean;
72
+ };
73
+ type PhoneOptions = {
74
+ countryCode: string;
75
+ /**
76
+ * @example
77
+ * format: 'continuous'
78
+ * returns: 5555555555
79
+ *
80
+ * @example
81
+ * format: 'dot'
82
+ * returns: 555.555.5555
83
+ *
84
+ * @example
85
+ * format: 'hyphenated'
86
+ * returns: 555-555-5555
87
+ *
88
+ * @example
89
+ * format: 'space'
90
+ * returns: 555 555 5555
91
+ *
92
+ * @example
93
+ * format: 'standard' (default)
94
+ * returns: (555) 555-5555
95
+ */
96
+ format: 'continuous' | 'dot' | 'hyphenated' | 'none' | 'space' | 'standard';
97
+ };
33
98
  import { HTMLInputTypeAttribute, ReactNode, RefObject } from 'react';
34
99
  import { DescriptionProps, FieldProps, InputProps as HeadlessInputProps, LabelProps } from '@headlessui/react';
35
- export default function Input({ checked, className, defaultValue, description, descriptionProps, disabled, fieldProps, invalid, label, labelProps, name, onBlur, onChange, placeholder, ref, required, type, value, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
100
+ import { DateTimeObject, WeekNumber } from '../../../utils';
101
+ export declare function Input({ checked, className, defaultValue, description, descriptionProps, disabled, fieldProps, invalid, label, labelProps, max, min, name, onBlur, onChange, options, placeholder, ref, required, type, value, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
36
102
  export {};
@@ -35,4 +35,4 @@ export type SubmitButtonProps = Omit<ButtonProps, 'as' | 'customTheme' | 'href'
35
35
  theme?: never;
36
36
  };
37
37
  import { ButtonProps } from '../button';
38
- export default function SubmitButton({ children, className, customTheme, error, incomplete, loading, success, type, ...props }: SubmitButtonProps): import("react/jsx-runtime").JSX.Element;
38
+ export declare function SubmitButton({ children, className, customTheme, error, incomplete, loading, success, type, ...props }: SubmitButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -15,4 +15,4 @@ export type TextareaProps = Omit<HeadlessTextareaProps, 'name'> & {
15
15
  };
16
16
  import { ReactNode, RefObject } from 'react';
17
17
  import { DescriptionProps, FieldProps, TextareaProps as HeadlessTextareaProps, LabelProps } from '@headlessui/react';
18
- export default function Textarea({ className, defaultValue, description, descriptionProps, disabled, fieldProps, invalid, label, labelProps, name, onBlur, onChange, placeholder, ref, required, value, ...props }: TextareaProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function Textarea({ className, defaultValue, description, descriptionProps, disabled, fieldProps, invalid, label, labelProps, name, onBlur, onChange, placeholder, ref, required, value, ...props }: TextareaProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { HTMLAttributes } from 'react';
2
2
  type GhostProps = HTMLAttributes<HTMLDivElement>;
3
- export default function Ghost({ children, className, ...props }: GhostProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function Ghost({ children, className, ...props }: GhostProps): import("react/jsx-runtime").JSX.Element;
4
4
  export {};
@@ -16,4 +16,4 @@ import { HTMLAttributes, RefObject } from 'react';
16
16
  * A heading component that renders HTML heading elements (h1-h6) with appropriate styling.
17
17
  * Automatically generates an ID for the heading based on its content if none is provided.
18
18
  */
19
- export default function Heading({ as, children, customize, className, id, ref, ...props }: HeadingProps): import("react/jsx-runtime").JSX.Element;
19
+ export declare function Heading({ as, children, customize, className, id, ref, ...props }: HeadingProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ export type IFrameAllowAttribute = 'accelerometer' | 'autoplay' | 'camera' | 'encrypted-media' | 'fullscreen' | 'gyroscope' | 'magnetometer' | 'microphone' | 'payment' | 'picture-in-picture' | 'publickey-credentials-get' | 'usb';
2
+ export type IFrameReferrerPolicyAttribute = 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
3
+ export type IFrameSandboxAttribute = 'allow-downloads' | 'allow-forms' | 'allow-modals' | 'allow-orientation-lock' | 'allow-pointer-lock' | 'allow-popups' | 'allow-popups-to-escape-sandbox' | 'allow-presentation' | 'allow-same-origin' | 'allow-scripts' | 'allow-top-navigation' | 'allow-top-navigation-by-user-activation' | 'allow-top-navigation-to-custom-protocols';
4
+ export type IFrameProps = Omit<ComponentPropsWithRef<'iframe'>, 'allow' | 'children' | 'referrerPolicy' | 'sandbox' | 'title'> & {
5
+ allow?: IFrameAllowAttribute | IFrameAllowAttribute[] | 'allow-all';
6
+ referrerPolicy?: IFrameReferrerPolicyAttribute;
7
+ sandbox?: IFrameSandboxAttribute | IFrameSandboxAttribute[] | 'allow-all';
8
+ title: string;
9
+ };
10
+ import { ComponentPropsWithRef } from 'react';
11
+ /**
12
+ * # iFrame
13
+ * - An `<iframe/>` with preset classes, backup, and required title for SEO.
14
+ */
15
+ export declare function IFrame({ allow, className, referrerPolicy, sandbox, ...props }: IFrameProps): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,10 @@
1
- import Button, { ButtonProps, createButton, ExtendedButtonConfig, ExtendedButtonProps } from './button';
2
- import Details, { DetailsBody, DetailsBodyProps, DetailsProps, DetailsSummary, DetailsSummaryProps } from './details';
3
- import DropDown, { DropDownButton, DropDownButtonProps, DropDownItem, DropDownItemProps, DropDownItems, DropDownItemsProps, DropDownProps, DropDownSection, DropDownSectionProps, DropDownSeparator, DropDownSeparatorProps } from './drop-down';
4
- import Form, { Fieldset, FieldsetProps, FormProps, FormSubmitArgs, Input, InputProps, SubmitButton, SubmitButtonProps, Textarea, TextareaProps } from './form';
5
- import Ghost from './ghost';
6
- import Heading, { HeadingProps } from './heading';
7
- import Link, { Anchor, AnchorProps, createLink, ExtendedLinkConfig, ExtendedLinkProps, LinkProps } from './link';
8
- import Modal, { ModalDialog, ModalProps, ModalTrigger } from './modal';
9
- import Time from './time';
10
- import Tooltip, { TooltipPanel, TooltipProps, TooltipTrigger } from './tooltip';
11
- export { Anchor, AnchorProps, Button, ButtonProps, createButton, createLink, Details, DetailsBody, DetailsBodyProps, DetailsProps, DetailsSummary, DetailsSummaryProps, DropDown, DropDownButton, DropDownButtonProps, DropDownItem, DropDownItemProps, DropDownItems, DropDownItemsProps, DropDownProps, DropDownSection, DropDownSectionProps, DropDownSeparator, DropDownSeparatorProps, ExtendedButtonConfig, ExtendedButtonProps, ExtendedLinkConfig, ExtendedLinkProps, Fieldset, FieldsetProps, Form, FormProps, FormSubmitArgs, Ghost, Heading, HeadingProps, Input, InputProps, Link, LinkProps, Modal, ModalDialog, ModalProps, ModalTrigger, SubmitButton, SubmitButtonProps, Textarea, TextareaProps, Time, Tooltip, TooltipPanel, TooltipProps, TooltipTrigger, };
1
+ export * from './button';
2
+ export * from './details';
3
+ export * from './drop-down';
4
+ export * from './form';
5
+ export * from './ghost';
6
+ export * from './heading';
7
+ export * from './link';
8
+ export * from './modal';
9
+ export * from './time';
10
+ export * from './tooltip';
@@ -1,4 +1,4 @@
1
- import { AnyElementProps, OneOf } from '../types';
1
+ import { AnyElementProps, ColorTheme, OneOf } from '../types';
2
2
  import { ElementType } from 'react';
3
3
  export type AnchorProps<TTag extends ElementType = 'a'> = AnyElementProps<TTag> & {
4
4
  disabled?: boolean;
@@ -17,17 +17,6 @@ type ThemeColorOrClasses = OneOf<[
17
17
  classes: string;
18
18
  }
19
19
  ]>;
20
- type ColorTheme = OneOf<[
21
- {
22
- /** Color theme. */
23
- theme?: 'blue' | 'brown' | 'green' | 'grey' | 'sky-blue' | 'magenta' | 'orange' | 'pink' | 'purple' | 'red' | 'violet' | 'yellow';
24
- },
25
- {
26
- /** Color theme. */
27
- theme?: 'custom';
28
- customTheme: ThemeColorOrClasses;
29
- }
30
- ]>;
31
20
  export type LinkProps<TTag extends ElementType = typeof Anchor> = AnyElementProps<TTag, OneOf<[
32
21
  {
33
22
  type?: 'center' | 'lift' | 'ltr' | 'multiline' | 'multiline-center' | 'multiline-lift' | 'multiline-ltr' | 'multiline-rtl' | 'multiline-static' | 'normal' | 'rtl' | 'static';
@@ -65,7 +54,7 @@ export type LinkProps<TTag extends ElementType = typeof Anchor> = AnyElementProp
65
54
  * @example
66
55
  * <Link href='/about' type='fill-ltr' theme='red' title='About Us'>Learn more about our company</Link>
67
56
  */
68
- export default function Link<TTag extends ElementType = typeof Anchor>({ as, className, customTheme, theme, type, ...props }: LinkProps<TTag>): import("react/jsx-runtime").JSX.Element;
57
+ export declare function Link<TTag extends ElementType = typeof Anchor>({ as, className, customTheme, theme, type, ...props }: LinkProps<TTag>): import("react/jsx-runtime").JSX.Element;
69
58
  export type ExtendedLinkConfig = {
70
59
  /** Modifies the default element that is rendered. The `as` prop on the component still overrides the default set here. */
71
60
  as?: ElementType;
@@ -92,7 +81,7 @@ export type ExtendedLinkConfig = {
92
81
  };
93
82
  };
94
83
  };
95
- export type ExtendedThemeNames<T extends ExtendedLinkConfig> = T['theme'] extends Record<string, unknown> ? keyof T['theme'] : never;
84
+ type ExtendedThemeNames<T extends ExtendedLinkConfig> = T['theme'] extends Record<string, unknown> ? keyof T['theme'] : never;
96
85
  export type ExtendedLinkProps<TExtendedConfig extends ExtendedLinkConfig, TTag extends ElementType = typeof Anchor> = Omit<LinkProps<TTag>, 'theme' | 'customTheme'> & {
97
86
  theme?: LinkProps<TTag>['theme'] | ExtendedThemeNames<TExtendedConfig>;
98
87
  customTheme?: LinkProps<TTag>['customTheme'];
@@ -15,4 +15,4 @@ export declare function ModalTrigger<T extends ElementType = typeof HeadlessButt
15
15
  export declare function ModalTitle(props: DialogTitleProps): import("react/jsx-runtime").JSX.Element;
16
16
  export declare function ModalDialog(props: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
17
17
  export declare function ModalClose<T extends ElementType = typeof HeadlessButton>({ as, ...props }: AnyElementProps<T>): import("react/jsx-runtime").JSX.Element;
18
- export default function Modal({ children, className, onClose, onOpen, place }: ModalProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function Modal({ children, className, onClose, onOpen, place }: ModalProps): import("react/jsx-runtime").JSX.Element;
@@ -12,5 +12,5 @@ type TimeProps = HTMLAttributes<HTMLTimeElement> & Partial<{
12
12
  ref?: RefObject<HTMLTimeElement | null>;
13
13
  };
14
14
  import { HTMLAttributes, RefObject } from 'react';
15
- export default function Time({ children, dateObject, dateTime, day, hours, milliseconds, minutes, month, seconds, year, ref, ...props }: TimeProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function Time({ children, dateObject, dateTime, day, hours, milliseconds, minutes, month, seconds, year, ref, ...props }: TimeProps): import("react/jsx-runtime").JSX.Element;
16
16
  export {};
@@ -23,4 +23,4 @@ import { Placement } from '@floating-ui/react-dom';
23
23
  import { Button as HeadlessButton } from '@headlessui/react';
24
24
  export declare function TooltipTrigger<T extends ElementType = typeof HeadlessButton>({ as, asChild, children, ...props }: TooltipTriggerProps<T>): import("react/jsx-runtime").JSX.Element;
25
25
  export declare function TooltipPanel<T extends ElementType = 'div'>({ as, children, className, style, ...props }: TooltipPanelProps<T>): import("react/jsx-runtime").JSX.Element;
26
- export default function Tooltip({ anchor, arrow, arrowClassName, children, delay, offset, onClose, onOpen, portal, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
26
+ export declare function Tooltip({ anchor, arrow, arrowClassName, children, delay, offset, onClose, onOpen, portal, }: TooltipProps): import("react/jsx-runtime").JSX.Element;