mado-ui 0.3.2 → 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.
- package/css/index.css +604 -6
- package/dist/components/button.d.ts +3 -23
- package/dist/components/details.d.ts +2 -2
- package/dist/components/drop-down.d.ts +6 -5
- package/dist/components/form/fieldset.d.ts +35 -7
- package/dist/components/form/index.d.ts +5 -6
- package/dist/components/form/input/date/index.d.ts +36 -0
- package/dist/components/form/input/index.d.ts +78 -12
- package/dist/components/form/submit-button.d.ts +1 -1
- package/dist/components/form/textarea.d.ts +1 -1
- package/dist/components/ghost.d.ts +1 -1
- package/dist/components/heading.d.ts +1 -1
- package/dist/components/iframe.d.ts +15 -0
- package/dist/components/index.d.ts +12 -11
- package/dist/components/link.d.ts +3 -14
- package/dist/components/modal.d.ts +1 -1
- package/dist/components/time.d.ts +1 -1
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/video.d.ts +30 -0
- package/dist/components.esm.js +891 -129
- package/dist/components.esm.js.map +1 -1
- package/dist/components.js +892 -126
- package/dist/components.js.map +1 -1
- package/dist/hooks/create-fast-context.d.ts +1 -1
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/use-fieldset-context.d.ts +22 -0
- package/dist/hooks/use-form-context.d.ts +18 -10
- package/dist/hooks.esm.js +99 -5
- package/dist/hooks.esm.js.map +1 -1
- package/dist/hooks.js +100 -3
- package/dist/hooks.js.map +1 -1
- package/dist/icons/10-arrow-trianglehead-clockwise.d.ts +2 -0
- package/dist/icons/10-arrow-trianglehead-counterclockwise.d.ts +2 -0
- package/dist/icons/15-arrow-trianglehead-clockwise.d.ts +2 -0
- package/dist/icons/15-arrow-trianglehead-counterclockwise.d.ts +2 -0
- package/dist/icons/3-people.d.ts +2 -2
- package/dist/icons/3-rectangles-desktop-fill.d.ts +2 -2
- package/dist/icons/3-rectangles-desktop.d.ts +2 -2
- package/dist/icons/30-arrow-trianglehead-clockwise.d.ts +2 -0
- package/dist/icons/30-arrow-trianglehead-counterclockwise.d.ts +2 -0
- package/dist/icons/45-arrow-trianglehead-clockwise.d.ts +2 -0
- package/dist/icons/45-arrow-trianglehead-counterclockwise.d.ts +2 -0
- package/dist/icons/5-arrow-trianglehead-clockwise.d.ts +2 -0
- package/dist/icons/5-arrow-trianglehead-counterclockwise.d.ts +2 -0
- package/dist/icons/60-arrow-trianglehead-clockwise.d.ts +2 -0
- package/dist/icons/60-arrow-trianglehead-counterclockwise.d.ts +2 -0
- package/dist/icons/75-arrow-trianglehead-clockwise.d.ts +2 -0
- package/dist/icons/75-arrow-trianglehead-counterclockwise.d.ts +2 -0
- package/dist/icons/90-arrow-trianglehead-clockwise.d.ts +2 -0
- package/dist/icons/90-arrow-trianglehead-counterclockwise.d.ts +2 -0
- package/dist/icons/airplane.d.ts +2 -2
- package/dist/icons/arrow-down-backward-and-arrow-up-forward-rectangle.d.ts +2 -0
- package/dist/icons/arrow-triangle-2-circlepath-circle-fill.d.ts +2 -2
- package/dist/icons/arrow-triangle-2-circlepath-circle.d.ts +2 -2
- package/dist/icons/arrow-up-forward-and-arrow-down-backward-rectangle.d.ts +2 -0
- package/dist/icons/bag-fill.d.ts +2 -2
- package/dist/icons/banknote.d.ts +2 -2
- package/dist/icons/bell-fill.d.ts +2 -2
- package/dist/icons/bolt-car.d.ts +2 -2
- package/dist/icons/bolt-fill.d.ts +2 -2
- package/dist/icons/bolt-ring-closed.d.ts +2 -2
- package/dist/icons/bolt-trianglebadge-exclamationmark.d.ts +2 -2
- package/dist/icons/book-fill.d.ts +2 -2
- package/dist/icons/bookmark-fill.d.ts +2 -2
- package/dist/icons/briefcase-fill.d.ts +2 -2
- package/dist/icons/bubble-left-fill.d.ts +2 -2
- package/dist/icons/building-2-fill.d.ts +2 -2
- package/dist/icons/calendar.d.ts +2 -2
- package/dist/icons/camera-fill.d.ts +2 -2
- package/dist/icons/car-fill.d.ts +2 -2
- package/dist/icons/cart-fill.d.ts +2 -2
- package/dist/icons/chart-bar-doc-horizontal.d.ts +2 -2
- package/dist/icons/checkmark-seal.d.ts +2 -2
- package/dist/icons/checkmark.d.ts +2 -2
- package/dist/icons/chevron-compact-down.d.ts +1 -1
- package/dist/icons/chevron-down.d.ts +2 -2
- package/dist/icons/chevron-left-forwardslash-chevron-right.d.ts +2 -2
- package/dist/icons/chevron-left.d.ts +2 -2
- package/dist/icons/chevron-right.d.ts +2 -2
- package/dist/icons/chevron-up-chevron-down.d.ts +2 -2
- package/dist/icons/circle-fill.d.ts +2 -2
- package/dist/icons/clock-badge-checkmark.d.ts +2 -2
- package/dist/icons/clock-fill.d.ts +2 -2
- package/dist/icons/cloud-fill.d.ts +2 -2
- package/dist/icons/cube-fill.d.ts +2 -2
- package/dist/icons/curve-point-left.d.ts +2 -2
- package/dist/icons/dial-high.d.ts +2 -2
- package/dist/icons/doc-fill.d.ts +2 -2
- package/dist/icons/doc-on-clipboard.d.ts +2 -2
- package/dist/icons/doc-on-doc-fill.d.ts +2 -2
- package/dist/icons/doc-on-doc.d.ts +2 -2
- package/dist/icons/doc-text-magnifyingglass.d.ts +2 -2
- package/dist/icons/dollar-sign.d.ts +2 -2
- package/dist/icons/ellipsis-circle-fill.d.ts +2 -2
- package/dist/icons/ellipsis-circle.d.ts +2 -2
- package/dist/icons/envelope-fill.d.ts +2 -2
- package/dist/icons/envelope.d.ts +2 -2
- package/dist/icons/exclamationmark-octagon.d.ts +2 -2
- package/dist/icons/eye.d.ts +2 -2
- package/dist/icons/figure-water-fitness.d.ts +2 -2
- package/dist/icons/flag-fill.d.ts +2 -2
- package/dist/icons/flame-fill.d.ts +2 -2
- package/dist/icons/folder-fill.d.ts +2 -2
- package/dist/icons/folder.d.ts +2 -2
- package/dist/icons/gearshape-fill.d.ts +2 -2
- package/dist/icons/gearshape.d.ts +2 -2
- package/dist/icons/gift-fill.d.ts +2 -2
- package/dist/icons/globe-americas-fill.d.ts +2 -2
- package/dist/icons/hare-fill.d.ts +2 -2
- package/dist/icons/house-deskclock.d.ts +2 -2
- package/dist/icons/house-fill.d.ts +2 -2
- package/dist/icons/house.d.ts +2 -2
- package/dist/icons/index.d.ts +143 -104
- package/dist/icons/iphone-house.d.ts +2 -2
- package/dist/icons/light-ribbon.d.ts +2 -2
- package/dist/icons/lightbulb-fill.d.ts +2 -2
- package/dist/icons/lightbulb-led.d.ts +2 -2
- package/dist/icons/list-bullet-clipboard-fill.d.ts +2 -2
- package/dist/icons/magnifyingglass.d.ts +2 -2
- package/dist/icons/map-pin-ellipse.d.ts +2 -2
- package/dist/icons/minus-plus-batterblock.d.ts +2 -2
- package/dist/icons/network-shield.d.ts +2 -2
- package/dist/icons/network.d.ts +2 -2
- package/dist/icons/newspaper-fill.d.ts +2 -2
- package/dist/icons/number.d.ts +2 -2
- package/dist/icons/paperplane-fill.d.ts +2 -2
- package/dist/icons/pause-fill.d.ts +2 -0
- package/dist/icons/person-crop-square.d.ts +2 -2
- package/dist/icons/person-fill-questionmark.d.ts +2 -2
- package/dist/icons/person-fill.d.ts +2 -2
- package/dist/icons/person.d.ts +2 -2
- package/dist/icons/phone-arrow-up-right.d.ts +2 -2
- package/dist/icons/phone-fill.d.ts +2 -2
- package/dist/icons/phone.d.ts +2 -2
- package/dist/icons/photo-badge-arrow-down-fill.d.ts +2 -0
- package/dist/icons/photo-badge-arrow-down.d.ts +2 -0
- package/dist/icons/play-fill.d.ts +2 -0
- package/dist/icons/play-rectangle-fill.d.ts +2 -2
- package/dist/icons/plus.d.ts +2 -2
- package/dist/icons/qrcode.d.ts +2 -2
- package/dist/icons/rectangle-fill-on-arrow-down-forward-topleading-rectangle.d.ts +2 -0
- package/dist/icons/rectangle-fill.d.ts +2 -0
- package/dist/icons/rectangle-portrait-and-arrow-left-fill.d.ts +2 -2
- package/dist/icons/rectangle-portrait-and-arrow-left.d.ts +2 -2
- package/dist/icons/rectangle-triangle-up.d.ts +2 -0
- package/dist/icons/rectangle.d.ts +2 -0
- package/dist/icons/sensor.d.ts +2 -2
- package/dist/icons/signature.d.ts +2 -2
- package/dist/icons/solar-panel.d.ts +2 -2
- package/dist/icons/speaker-fill.d.ts +2 -0
- package/dist/icons/speaker-minus-fill.d.ts +2 -0
- package/dist/icons/speaker-minus.d.ts +2 -0
- package/dist/icons/speaker-plus-fill.d.ts +2 -0
- package/dist/icons/speaker-plus.d.ts +2 -0
- package/dist/icons/speaker-slash-fill.d.ts +2 -0
- package/dist/icons/speaker-slash.d.ts +2 -0
- package/dist/icons/speaker-wave-1-fill.d.ts +2 -0
- package/dist/icons/speaker-wave-1.d.ts +2 -0
- package/dist/icons/speaker-wave-2-fill.d.ts +2 -0
- package/dist/icons/speaker-wave-2.d.ts +2 -0
- package/dist/icons/speaker-wave-3-fill.d.ts +2 -0
- package/dist/icons/speaker-wave-3.d.ts +2 -0
- package/dist/icons/speaker.d.ts +2 -0
- package/dist/icons/square-and-arrow-down-fill.d.ts +2 -2
- package/dist/icons/square-and-arrow-down.d.ts +2 -2
- package/dist/icons/square-and-arrow-up-fill.d.ts +2 -2
- package/dist/icons/square-and-arrow-up.d.ts +2 -2
- package/dist/icons/square-and-pencil-fill.d.ts +2 -2
- package/dist/icons/square-and-pencil.d.ts +2 -2
- package/dist/icons/text-bubble.d.ts +2 -2
- package/dist/icons/trash-fill.d.ts +2 -2
- package/dist/icons/trash.d.ts +2 -2
- package/dist/icons/tree.d.ts +2 -2
- package/dist/icons/umbrella-fill.d.ts +2 -2
- package/dist/icons/xmark.d.ts +2 -2
- package/dist/icons.esm.js +162 -2
- package/dist/icons.esm.js.map +1 -1
- package/dist/icons.js +203 -3
- package/dist/icons.js.map +1 -1
- package/dist/index.esm.js +891 -129
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +892 -126
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -2
- package/dist/types/utils.d.ts +20 -0
- package/dist/utils/get-date.d.ts +17 -0
- package/dist/utils/index.d.ts +8 -9
- package/dist/utils/string-manipulation.d.ts +38 -3
- package/dist/utils/tw-sort.d.ts +1 -1
- package/dist/utils.esm.js +112 -21
- package/dist/utils.esm.js.map +1 -1
- package/dist/utils.js +113 -20
- package/dist/utils.js.map +1 -1
- package/package.json +95 -94
|
@@ -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
|
-
|
|
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
|
|
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
|
|
16
|
+
export declare function Details<TTag extends ElementType = 'div'>({ as, className, ...props }: DetailsProps<TTag>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { AnyElementProps } from '../types';
|
|
1
2
|
import { ElementType, ReactNode } from 'react';
|
|
2
3
|
export type DropDownButtonProps<TTag extends ElementType = 'button'> = Omit<MenuButtonProps<TTag>, 'as' | 'className'> & {
|
|
3
4
|
arrow?: boolean | ReactNode;
|
|
4
5
|
as?: TTag | ElementType;
|
|
5
6
|
className?: string;
|
|
6
7
|
};
|
|
7
|
-
export type DropDownItemProps = MenuItemProps
|
|
8
|
+
export type DropDownItemProps<TTag extends ElementType = 'div'> = Omit<MenuItemProps<TTag>, 'as'> & AnyElementProps<TTag>;
|
|
8
9
|
export type DropDownItemsProps = Omit<MenuItemsProps, 'className' | 'transition'> & {
|
|
9
10
|
className?: string;
|
|
10
11
|
containerClassName?: string;
|
|
@@ -19,11 +20,11 @@ export type DropDownSectionProps = MenuSectionProps & {
|
|
|
19
20
|
separatorAbove?: boolean;
|
|
20
21
|
separatorBelow?: boolean;
|
|
21
22
|
};
|
|
22
|
-
export type DropDownSeparatorProps = MenuSeparatorProps
|
|
23
|
+
export type DropDownSeparatorProps<TTag extends ElementType = 'div'> = Omit<MenuSeparatorProps<TTag>, 'as'> & AnyElementProps<TTag>;
|
|
23
24
|
import { MenuButtonProps, MenuHeadingProps, MenuItemProps, MenuItemsProps, MenuProps, MenuSectionProps, MenuSeparatorProps } from '@headlessui/react';
|
|
24
25
|
export declare function DropDownButton<TTag extends ElementType = 'button'>({ arrow, as, children, className, ...props }: DropDownButtonProps<TTag>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export declare function DropDownItem({ as, ...props }: DropDownItemProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function DropDownItem<TTag extends ElementType = 'div'>({ as, ...props }: DropDownItemProps<TTag>): import("react/jsx-runtime").JSX.Element;
|
|
26
27
|
export declare function DropDownItems({ anchor, children, className, containerClassName, style, ...props }: DropDownItemsProps): import("react/jsx-runtime").JSX.Element;
|
|
27
28
|
export declare function DropDownSection({ children, label, labelProps, separatorAbove, separatorBelow, ...props }: DropDownSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export declare function DropDownSeparator({ className, ...props }: DropDownSeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
export
|
|
29
|
+
export declare function DropDownSeparator<TTag extends ElementType = 'div'>({ as, className, ...props }: DropDownSeparatorProps<TTag>): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare function DropDown(props: DropDownProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
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
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
31
|
+
options?: Partial<PasswordOptions>;
|
|
13
32
|
},
|
|
14
33
|
{
|
|
15
|
-
type?:
|
|
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'> &
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
19
|
+
export declare function Heading({ as, children, customize, className, id, ref, ...props }: HeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
export type IFrameAllowAttribute = 'accelerometer' | 'ambient-light-sensor' | 'attribution-reporting' | 'autoplay' | 'bluetooth' | 'camera' | 'captured-surface-control' | 'compute-pressure' | 'cross-origin-isolated' | 'deferred-fetch' | 'deferred-fetch-minimal' | 'display-capture' | 'encrypted-media' | 'fullscreen' | 'gamepad' | 'geolocation' | 'gyroscope' | 'hid' | 'identity-credentials-get' | 'idle-detection' | 'language-detector' | 'local-fonts' | 'magnetometer' | 'microphone' | 'midi' | 'otp-credentials' | 'payment' | 'picture-in-picture' | 'publickey-credentials-get' | 'screen-wake-lock' | 'serial' | 'speaker-selection' | 'storage-access' | 'translator' | 'summarizer' | 'usb' | 'web-share' | 'window-management' | 'xr-spatial-tracking';
|
|
3
|
+
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';
|
|
4
|
+
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-storage-access-by-user-activation' | 'allow-top-navigation' | 'allow-top-navigation-by-user-activation' | 'allow-top-navigation-to-custom-protocols';
|
|
5
|
+
export type IFrameProps = Omit<ComponentPropsWithRef<'iframe'>, 'allow' | 'children' | 'referrerPolicy' | 'sandbox' | 'title'> & {
|
|
6
|
+
allow?: (IFrameAllowAttribute | Record<IFrameAllowAttribute, string[] | boolean>)[] | 'allow-all';
|
|
7
|
+
referrerPolicy?: IFrameReferrerPolicyAttribute;
|
|
8
|
+
sandbox?: IFrameSandboxAttribute[];
|
|
9
|
+
title: string;
|
|
10
|
+
};
|
|
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,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
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 './iframe';
|
|
8
|
+
export * from './link';
|
|
9
|
+
export * from './modal';
|
|
10
|
+
export * from './time';
|
|
11
|
+
export * from './tooltip';
|
|
12
|
+
export * from './video';
|
|
@@ -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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
26
|
+
export declare function Tooltip({ anchor, arrow, arrowClassName, children, delay, offset, onClose, onOpen, portal, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { OneOf } from '../types';
|
|
2
|
+
export type VideoControl = 'download' | 'fullscreen' | 'playbackrate' | 'pause' | 'remoteplayback' | 'seeking' | 'volume';
|
|
3
|
+
type Source = {
|
|
4
|
+
src: string;
|
|
5
|
+
type: 'video/avi' | 'video/flv' | 'video/mkv' | 'video/mov' | 'video/mp4' | 'video/ogg' | 'video/webm';
|
|
6
|
+
};
|
|
7
|
+
type SourceOrSourceGroup = OneOf<[
|
|
8
|
+
Source,
|
|
9
|
+
{
|
|
10
|
+
srcGroup: Source[];
|
|
11
|
+
}
|
|
12
|
+
]>;
|
|
13
|
+
export type VideoProps = Omit<ComponentPropsWithRef<'video'>, 'controls' | 'controlList' | 'poster' | 'src' | 'title'> & {
|
|
14
|
+
controls?: boolean | VideoControl | VideoControl[];
|
|
15
|
+
poster?: {
|
|
16
|
+
primary?: boolean;
|
|
17
|
+
src: string;
|
|
18
|
+
type: 'image/apng' | 'image/avif' | 'image/gif' | 'image/jpeg' | 'image/png' | 'image/svg+xml' | 'image/webp';
|
|
19
|
+
width: number;
|
|
20
|
+
}[];
|
|
21
|
+
/** @deprecated Even if you only have on source file, please use srcSet. */
|
|
22
|
+
src?: never;
|
|
23
|
+
srcSet: (SourceOrSourceGroup & {
|
|
24
|
+
width: number;
|
|
25
|
+
})[];
|
|
26
|
+
title: string;
|
|
27
|
+
};
|
|
28
|
+
import { ComponentPropsWithRef } from 'react';
|
|
29
|
+
export declare function Video({ autoPlay, className, controls, poster, ref, srcSet, title, ...props }: VideoProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export {};
|