mado-ui 0.3.1 → 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.
- package/css/index.css +69 -14
- package/dist/components/button.d.ts +74 -29
- package/dist/components/details.d.ts +5 -7
- package/dist/components/drop-down.d.ts +4 -3
- 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 +3 -4
- 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 +10 -11
- package/dist/components/link.d.ts +62 -16
- 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.esm.js +612 -138
- package/dist/components.esm.js.map +1 -1
- package/dist/components.js +613 -135
- package/dist/components.js.map +1 -1
- package/dist/hooks/index.d.ts +4 -3
- 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/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/airplane.d.ts +2 -2
- 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/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-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/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/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/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-portrait-and-arrow-left-fill.d.ts +2 -2
- package/dist/icons/rectangle-portrait-and-arrow-left.d.ts +2 -2
- 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/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.map +1 -1
- package/dist/icons.js.map +1 -1
- package/dist/index.esm.js +612 -138
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +613 -135
- 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 +4 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AnyElementProps, OneOf } from '../types';
|
|
1
|
+
import { AnyElementProps, ColorTheme, OneOf } from '../types';
|
|
2
2
|
import { ElementType } from 'react';
|
|
3
|
-
export type AnchorProps<TTag extends ElementType
|
|
3
|
+
export type AnchorProps<TTag extends ElementType = 'a'> = AnyElementProps<TTag> & {
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
};
|
|
6
|
-
export declare function Anchor({ as, className, disabled, href, onClick, target, rel, ...props }: AnchorProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function Anchor<TTag extends ElementType = 'a'>({ as, className, disabled, href, onClick, target, rel, ...props }: AnchorProps<TTag>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
type ThemeColorOrClasses = OneOf<[
|
|
8
8
|
{
|
|
9
9
|
/**
|
|
@@ -17,18 +17,7 @@ type ThemeColorOrClasses = OneOf<[
|
|
|
17
17
|
classes: string;
|
|
18
18
|
}
|
|
19
19
|
]>;
|
|
20
|
-
type
|
|
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
|
-
export type LinkProps<TTag extends ElementType<any, 'a'> = 'a'> = AnyElementProps<TTag, OneOf<[
|
|
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';
|
|
34
23
|
},
|
|
@@ -65,5 +54,62 @@ export type LinkProps<TTag extends ElementType<any, 'a'> = 'a'> = 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;
|
|
58
|
+
export type ExtendedLinkConfig = {
|
|
59
|
+
/** Modifies the default element that is rendered. The `as` prop on the component still overrides the default set here. */
|
|
60
|
+
as?: ElementType;
|
|
61
|
+
/** Adds default classes. */
|
|
62
|
+
className?: string;
|
|
63
|
+
/** Sets the default theme. */
|
|
64
|
+
defaultTheme?: ColorTheme['theme'] | string;
|
|
65
|
+
/** Sets the default for the `type` prop. */
|
|
66
|
+
type?: LinkProps['type'];
|
|
67
|
+
/** Add more theme options. */
|
|
68
|
+
theme?: {
|
|
69
|
+
[themeName: string]: {
|
|
70
|
+
/** Custom theme configuration - supports both multiline and regular link theme formats */
|
|
71
|
+
customTheme: Omit<ThemeColorOrClasses, 'themeColor'> & {
|
|
72
|
+
themeColor?: {
|
|
73
|
+
/** Example: `'after:[--theme-color:var(--color-blue-500)]'` */
|
|
74
|
+
fill: string;
|
|
75
|
+
/** Example: `'[--theme-color:var(--color-blue-500)]'` */
|
|
76
|
+
multilineFill: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
/** Additional CSS classes to apply */
|
|
80
|
+
className?: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
type ExtendedThemeNames<T extends ExtendedLinkConfig> = T['theme'] extends Record<string, unknown> ? keyof T['theme'] : never;
|
|
85
|
+
export type ExtendedLinkProps<TExtendedConfig extends ExtendedLinkConfig, TTag extends ElementType = typeof Anchor> = Omit<LinkProps<TTag>, 'theme' | 'customTheme'> & {
|
|
86
|
+
theme?: LinkProps<TTag>['theme'] | ExtendedThemeNames<TExtendedConfig>;
|
|
87
|
+
customTheme?: LinkProps<TTag>['customTheme'];
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* # createLink
|
|
91
|
+
* Creates an extended Link component with additional theme options.
|
|
92
|
+
*
|
|
93
|
+
* @param config - Configuration object defining new themes and defaults
|
|
94
|
+
* @returns A new Link component with extended theme support
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```tsx
|
|
98
|
+
* const MyLink = createLink({
|
|
99
|
+
* as: NextLink,
|
|
100
|
+
* className: 'font-bold',
|
|
101
|
+
* type: 'fill',
|
|
102
|
+
* theme: {
|
|
103
|
+
* primary: {
|
|
104
|
+
* customTheme: {
|
|
105
|
+
* fill: 'after:[--theme-color:var(--color-primary-500)]',
|
|
106
|
+
* multilineFill: '[--theme-color:var(--color-primary-500)]'
|
|
107
|
+
* },
|
|
108
|
+
* className: 'text-white'
|
|
109
|
+
* }
|
|
110
|
+
* }
|
|
111
|
+
* })
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
export declare function createLink<TExtendedConfig extends ExtendedLinkConfig>(config: TExtendedConfig): <TTag extends ElementType = typeof Anchor>({ theme, className, customTheme, type, as, ...props }: ExtendedLinkProps<TExtendedConfig, TTag>) => import("react/jsx-runtime").JSX.Element;
|
|
69
115
|
export {};
|
|
@@ -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;
|