@andrilla/mado-ui 1.0.7 → 1.0.9

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.
@@ -1,18 +1,19 @@
1
1
  import type { AnyElementProps, ColorTheme, OneOf } from '../types';
2
2
  import type { ElementType, JSX } from 'react';
3
- export type AnchorProps<TTag extends ElementType = 'a'> = AnyElementProps<TTag> & {
3
+ export type AnchorProps<TTag extends ElementType = 'a'> = AnyElementProps<TTag, {
4
4
  disabled?: boolean;
5
- };
6
- export declare function Anchor<TTag extends ElementType = 'a'>({ as, className, disabled, href, onClick, target, rel, ...props }: AnchorProps<TTag>): JSX.Element;
5
+ removeHash?: boolean;
6
+ }>;
7
+ export declare function Anchor<TTag extends ElementType = 'a'>({ as, className, disabled, href, onClick, target, rel, removeHash, ...props }: AnchorProps<TTag>): JSX.Element;
7
8
  export type LinkProps<TTag extends ElementType = typeof Anchor> = AnyElementProps<TTag, OneOf<[
8
9
  {
9
- type?: 'center' | 'lift' | 'ltr' | 'multiline' | 'multiline-center' | 'multiline-lift' | 'multiline-ltr' | 'multiline-rtl' | 'multiline-static' | 'normal' | 'rtl' | 'static';
10
+ lineType?: 'center' | 'lift' | 'ltr' | 'multiline' | 'multiline-center' | 'multiline-lift' | 'multiline-ltr' | 'multiline-rtl' | 'multiline-static' | 'normal' | 'rtl' | 'static';
10
11
  },
11
12
  {
12
- type?: 'fill' | 'fill-lift' | 'fill-ltr' | 'fill-rtl' | 'multiline-fill' | 'multiline-fill-center' | 'multiline-fill-ltr' | 'multiline-fill-lift' | 'multiline-fill-rtl';
13
+ lineType?: 'fill' | 'fill-lift' | 'fill-ltr' | 'fill-rtl' | 'multiline-fill' | 'multiline-fill-center' | 'multiline-fill-ltr' | 'multiline-fill-lift' | 'multiline-fill-rtl';
13
14
  } & ColorTheme
14
15
  ]>>;
15
- export declare function getLinkClasses({ customTheme, theme, type, }: Pick<LinkProps, 'customTheme' | 'theme' | 'type'>): string;
16
+ export declare function getLinkClasses({ customTheme, theme, lineType, }: Pick<LinkProps, 'customTheme' | 'theme' | 'lineType'>): string;
16
17
  /**
17
18
  * # Link
18
19
  *
@@ -34,12 +35,15 @@ export declare function getLinkClasses({ customTheme, theme, type, }: Pick<LinkP
34
35
  * ## Examples
35
36
  *
36
37
  * @example
37
- * <Link href='/about' type='ltr' title='About Us'>Learn more about our company</Link>
38
+ * <Link href='/about' lineType='ltr' title='About Us'>Learn more about our company</Link>
38
39
  *
39
40
  * @example
40
- * <Link href='/about' type='fill-ltr' title='About Us'>Learn more about our company</Link>
41
+ * <Link href='/about' lineType='fill-ltr' title='About Us'>Learn more about our company</Link>
41
42
  *
42
43
  * @example
43
- * <Link href='/about' type='fill-ltr' theme='red' title='About Us'>Learn more about our company</Link>
44
+ * <Link href='/about' lineType='multiline-fill-rtl' theme='red' title='About Us'>Learn more about our company</Link>
45
+ *
46
+ * @example
47
+ * <Link as='button' lineType='fill-lift' theme='mauve-700'>Edit</Link>
44
48
  */
45
- export declare function Link<TTag extends ElementType = typeof Anchor>({ as, className, customTheme, theme, type, ...props }: LinkProps<TTag>): JSX.Element;
49
+ export declare function Link<TTag extends ElementType = typeof Anchor>({ as, className, customTheme, lineType, theme, ...props }: LinkProps<TTag>): JSX.Element;
@@ -1,5 +1,5 @@
1
- import type { AnyElementProps } from '../types';
2
- export type ModalProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
1
+ import type { AnyElementProps, AsElement } from '../types';
2
+ export type ModalProps = Omit<ComponentPropsWithRef<'div'>, 'children'> & {
3
3
  children: ReactNode | (({ openModal, closeModal, }: {
4
4
  openModal: () => void;
5
5
  closeModal: () => void;
@@ -9,10 +9,13 @@ export type ModalProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
9
9
  onOpen?: () => void;
10
10
  place?: 'center' | 'bottom';
11
11
  };
12
- import { type ElementType, type HTMLAttributes, type JSX, type ReactNode } from 'react';
12
+ import { type ComponentPropsWithRef, type ElementType, type JSX, type ReactNode, type RefObject } from 'react';
13
13
  import { Button as HeadlessButton, type DialogTitleProps } from '@headlessui/react';
14
14
  export declare function ModalTrigger<TTag extends ElementType = typeof HeadlessButton>({ as, onClick, ...props }: AnyElementProps<TTag>): JSX.Element;
15
- export declare function ModalTitle(props: DialogTitleProps): JSX.Element;
16
- export declare function ModalDialog(props: HTMLAttributes<HTMLDivElement>): JSX.Element;
17
- export declare function ModalClose<T extends ElementType = typeof HeadlessButton>({ as, ...props }: AnyElementProps<T>): JSX.Element;
15
+ export type ModalTitleProps<TTag extends ElementType = 'h2'> = Omit<DialogTitleProps<TTag>, 'as'> & AsElement<TTag> & {
16
+ ref?: RefObject<TTag | null>;
17
+ };
18
+ export declare function ModalTitle<TTag extends ElementType = 'h2'>({ as, ref, ...props }: ModalTitleProps<TTag>): JSX.Element;
19
+ export declare function ModalDialog(props: ComponentPropsWithRef<'div'>): JSX.Element;
20
+ export declare function ModalClose<TTag extends ElementType = typeof HeadlessButton>({ as, onClick, ...props }: AnyElementProps<TTag>): JSX.Element;
18
21
  export declare function Modal(props: ModalProps): JSX.Element;
@@ -1,4 +1,4 @@
1
- export type SelectProps = Omit<ListboxProps, 'children' | 'defaultValue' | 'multiple' | 'onChange'> & {
1
+ export type SelectProps = Omit<ListboxProps, 'children' | 'defaultValue' | 'multiple' | 'name' | 'onChange'> & {
2
2
  buttonProps?: Omit<ListboxButtonProps, 'className'> & {
3
3
  /** @deprecated use `className` prop instead */
4
4
  className?: never;
@@ -19,6 +19,7 @@ export type SelectProps = Omit<ListboxProps, 'children' | 'defaultValue' | 'mult
19
19
  /** @deprecated use `label` prop instead */
20
20
  children?: never;
21
21
  };
22
+ name: string;
22
23
  optionsProps?: ListboxOptionsProps;
23
24
  placeholder?: ListboxSelectedOptionProps['placeholder'];
24
25
  required?: boolean;
@@ -3,6 +3,7 @@ type TimeProps = HTMLAttributes<HTMLTimeElement> & Partial<{
3
3
  dateTime: string;
4
4
  day: boolean;
5
5
  hours: boolean;
6
+ militaryTime: boolean;
6
7
  milliseconds: boolean;
7
8
  minutes: boolean;
8
9
  month: boolean;
@@ -22,11 +23,12 @@ import { type HTMLAttributes, type JSX, type RefObject } from 'react';
22
23
  * @prop dateTime - Set the dateTime itself.
23
24
  * @prop day - Include the day of the month in the display.
24
25
  * @prop hours - Include the hours in the display.
26
+ * @prop militaryTime - Use military time (24-hour clock) instead of AM/PM.
25
27
  * @prop milliseconds - Include the milliseconds in the display.
26
28
  * @prop minutes - Include the minutes in the display.
27
29
  * @prop month - Include the month in the display.
28
30
  * @prop seconds - Include the seconds in the display.
29
31
  * @prop year - Include the year in the display.
30
32
  */
31
- export declare function Time({ children, dateObject, dateTime, day, hours, milliseconds, minutes, month, seconds, year, ref, ...props }: TimeProps): JSX.Element;
33
+ export declare function Time({ children, dateObject, dateTime, day, hours, militaryTime, milliseconds, minutes, month, seconds, year, ref, ...props }: TimeProps): JSX.Element;
32
34
  export {};
package/dist/css/base.css CHANGED
@@ -1,31 +1,3 @@
1
- @property --base-theme-color {
2
- syntax: '<color>';
3
- inherits: false;
4
- initial-value: oklch(62.3% 0.214 259.815);
5
- }
6
-
7
- @property --base-theme-color--foreground {
8
- syntax: '<color>';
9
- inherits: false;
10
- initial-value: color-mix(
11
- in oklch,
12
- oklch(62.3% 0.214 259.815) 5%,
13
- oklch(100% 0 0)
14
- );
15
- }
16
-
17
- @property --global-bg {
18
- syntax: '<color>';
19
- inherits: false;
20
- initial-value: light-dark(oklch(98.5% 0 0), oklch(20.5% 0 0));
21
- }
22
-
23
- @property --global-text {
24
- syntax: '<color>';
25
- inherits: false;
26
- initial-value: light-dark(oklch(14.5% 0 0), oklch(97% 0 0));
27
- }
28
-
29
1
  @layer base {
30
2
  * {
31
3
  position: relative;
@@ -1,4 +1,3 @@
1
- @import 'tailwindcss';
2
1
  @source '../components';
3
2
  @source '../graphics';
4
3
  @import './theme.css';
@@ -0,0 +1,2 @@
1
+ @import 'tailwindcss';
2
+ @import './index.css';
@@ -50,6 +50,13 @@
50
50
  --animation-state-paused: paused;
51
51
  --animation-state-running: running;
52
52
 
53
+ --base-theme-color: var(--color-blue-500);
54
+ --base-theme-color--foreground: color-mix(
55
+ in oklch,
56
+ var(--base-theme-color) 5%,
57
+ var(--color-white)
58
+ );
59
+
53
60
  --corner-shape-bevel: bevel;
54
61
  --corner-shape-notch: notch;
55
62
  --corner-shape-round: round;
@@ -61,6 +68,9 @@
61
68
  --ease-exponential: cubic-bezier(0.25, 0.5, 0, 0.99);
62
69
  --ease-spring: cubic-bezier(0.35, 1.67, 0.44, 0.78);
63
70
 
71
+ --global-bg: light-dark(var(--color-neutral-50), var(--color-neutral-900));
72
+ --global-text: light-dark(var(--color-neutral-950), var(--color-neutral-100));
73
+
64
74
  --text-smaller: smaller;
65
75
  --text-larger: larger;
66
76
  }
@@ -293,6 +293,12 @@
293
293
  corner-bottom-left-shape: superellipse(calc(--value(number) * -1));
294
294
  }
295
295
 
296
+ @property --tw-gap {
297
+ syntax: '<length>';
298
+ initial-value: 0;
299
+ inherits: true;
300
+ }
301
+
296
302
  @utility gap-* {
297
303
  --tw-gap: --value([*]);
298
304
  --tw-gap-x: --value([*]);
@@ -302,16 +308,36 @@
302
308
  --tw-gap-y: var(--tw-gap, calc(var(--spacing) * --value(number)));
303
309
  }
304
310
 
311
+ @property --tw-gap-x {
312
+ syntax: '<length>';
313
+ initial-value: 0;
314
+ inherits: true;
315
+ }
316
+
305
317
  @utility gap-x-* {
306
318
  --tw-gap-x: --value([*]);
307
319
  --tw-gap-x: calc(var(--spacing) * --value(number));
308
320
  }
309
321
 
322
+ @property --tw-gap-y {
323
+ syntax: '<length>';
324
+ initial-value: 0;
325
+ inherits: true;
326
+ }
327
+
310
328
  @utility gap-y-* {
311
329
  --tw-gap-y: --value([*]);
312
330
  --tw-gap-y: calc(var(--spacing) * --value(number));
313
331
  }
314
332
 
333
+ @utility grid-cols-0fr {
334
+ grid-template-columns: 0fr;
335
+ }
336
+
337
+ @utility grid-cols-1fr {
338
+ grid-template-columns: 1fr;
339
+ }
340
+
315
341
  @utility grid-rows-0fr {
316
342
  grid-template-rows: 0fr;
317
343
  }
@@ -1,6 +1,5 @@
1
1
  import { extendTailwindMerge } from "tailwind-merge";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
-
4
3
  //#region src/utils/custom-tailwind-merge.ts
5
4
  const isInteger = (classPart) => /^\d+$/.test(classPart);
6
5
  const isFloat = (classPart) => /^\d+\.\d+$/.test(classPart);
@@ -95,7 +94,6 @@ const twMerge = extendTailwindMerge({ extend: { classGroups: {
95
94
  "grid-rows": [{ "grid-rows": ["0fr", "1fr"] }],
96
95
  transition: [{ transition: ["transition-cols", "transition-rows"] }]
97
96
  } } });
98
-
99
97
  //#endregion
100
98
  //#region src/graphics/social-media/facebook-logo.tsx
101
99
  /**
@@ -170,7 +168,6 @@ function FacebookLogo({ className, cutout = false, targets, variant = "circle",
170
168
  ]
171
169
  });
172
170
  }
173
-
174
171
  //#endregion
175
172
  //#region src/graphics/social-media/google-logo.tsx
176
173
  /**
@@ -276,7 +273,6 @@ function GoogleLogo({ gradient = true, ...props }) {
276
273
  ] }) : /* @__PURE__ */ jsx("path", { d: "M992.945,417.01L511.964,417.01L511.964,613.859L788.338,613.859C783.897,641.717 773.921,669.122 759.31,694.112C742.575,722.744 721.881,744.542 700.67,761.138C637.14,810.865 563.07,821.031 511.628,821.031C381.685,821.031 270.653,735.251 227.672,618.689C225.937,614.461 224.786,610.09 223.383,605.772C213.887,576.108 208.697,544.687 208.697,512.032C208.697,478.046 214.317,445.514 224.561,414.789C264.982,293.606 378.511,203.097 511.721,203.097C538.518,203.097 564.319,206.353 588.786,212.851C644.708,227.698 684.261,256.943 708.499,280.075L854.747,133.794C765.786,50.482 649.815,0 511.478,0C400.888,-0.004 298.788,35.19 215.121,94.667C147.265,142.902 91.616,207.482 54.06,282.487C19.128,352.029 0,429.093 0,511.953C0,594.821 19.158,672.685 54.09,741.588L54.09,742.052C90.988,815.198 144.943,878.178 210.526,926.192C267.816,968.135 370.54,1024 511.478,1024C592.529,1024 664.363,1009.08 727.713,981.104C773.413,960.926 813.904,934.608 850.563,900.787C899,856.093 936.938,800.815 962.829,737.214C988.724,673.612 1002.57,601.692 1002.57,523.719C1002.57,487.404 999.002,450.524 992.945,417.01Z" })
277
274
  });
278
275
  }
279
-
280
276
  //#endregion
281
277
  //#region src/graphics/social-media/instagram-logo.tsx
282
278
  /**
@@ -397,7 +393,6 @@ function InstagramLogo({ gradient = true, ...props }) {
397
393
  ] })
398
394
  });
399
395
  }
400
-
401
396
  //#endregion
402
397
  //#region src/graphics/social-media/linkedin-logo.tsx
403
398
  /**
@@ -430,7 +425,6 @@ function LinkedInLogo({ className, cutout, targets, ...props }) {
430
425
  })]
431
426
  });
432
427
  }
433
-
434
428
  //#endregion
435
429
  //#region src/graphics/social-media/tiktok-logo.tsx
436
430
  /**
@@ -469,7 +463,6 @@ function TikTokLogo({ className, targets, variant = "multicolor", ...props }) {
469
463
  ] }), variant === "solid" && /* @__PURE__ */ jsx("path", { d: "M667.348,44.69C680.075,111.724 720.791,169.313 777.229,205.249L777.286,205.307C816.62,230.358 863.44,244.986 913.716,244.986L913.716,420.98C820.306,420.98 733.749,391.782 663.086,342.197L663.086,700.001C663.086,878.644 514.39,1024 331.543,1024C260.881,1024 195.401,1002.23 141.555,965.316L141.44,965.201C55.977,906.517 0,809.536 0,699.944C0,521.301 148.754,375.887 331.543,375.887C346.747,375.887 361.605,377.154 376.233,379.054L376.233,558.849C362.066,554.53 347.15,551.996 331.543,551.996C248.038,551.996 180.14,618.397 180.14,700.001C180.14,756.784 213.139,806.196 261.284,830.96C282.304,841.787 306.204,847.949 331.543,847.949C413.09,847.949 479.663,784.543 482.658,705.53L482.946,0L663.086,0C663.086,15.261 664.584,30.177 667.348,44.69Z" })]
470
464
  });
471
465
  }
472
-
473
466
  //#endregion
474
467
  //#region src/graphics/social-media/x-logo.tsx
475
468
  /**
@@ -482,7 +475,6 @@ function XLogo(props) {
482
475
  children: /* @__PURE__ */ jsx("path", { d: "M806.464,0L963.472,0L620.432,392.08L1024,925.6L708.016,925.6L460.528,602.016L177.328,925.6L20.224,925.6L387.136,506.24L0,0L324,0L547.712,295.76L806.464,0ZM751.344,831.616L838.352,831.616L276.736,89.04L183.36,89.04L751.344,831.616Z" })
483
476
  });
484
477
  }
485
-
486
478
  //#endregion
487
479
  //#region src/graphics/social-media/youtube-logo.tsx
488
480
  /**
@@ -516,6 +508,5 @@ function YouTubeLogo({ className, cutout = false, targets, ...props }) {
516
508
  })] })
517
509
  });
518
510
  }
519
-
520
511
  //#endregion
521
- export { FacebookLogo, GoogleLogo, InstagramLogo, LinkedInLogo, TikTokLogo, XLogo, YouTubeLogo };
512
+ export { FacebookLogo, GoogleLogo, InstagramLogo, LinkedInLogo, TikTokLogo, XLogo, YouTubeLogo };
@@ -1,6 +1,5 @@
1
1
  import { Suspense, createContext, useCallback, useContext, useEffect, useId, useRef, useState, useSyncExternalStore } from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
-
4
3
  //#region src/hooks/create-fast-context.tsx
5
4
  function createFastContext(defaultInitialState) {
6
5
  function useStoreData(initialState = defaultInitialState) {
@@ -41,7 +40,6 @@ function createFastContext(defaultInitialState) {
41
40
  useStore
42
41
  };
43
42
  }
44
-
45
43
  //#endregion
46
44
  //#region src/hooks/use-form-status.tsx
47
45
  const DEFAULT_STATUS = "incomplete";
@@ -55,7 +53,6 @@ function FormStatusProvider({ children, initialStatus = DEFAULT_STATUS }) {
55
53
  function useFormStatus() {
56
54
  return useStore((store) => store);
57
55
  }
58
-
59
56
  //#endregion
60
57
  //#region src/hooks/use-pointer-movement.ts
61
58
  function usePointerMovement(props) {
@@ -169,6 +166,5 @@ function usePointerMovement(props) {
169
166
  trackPointerMovement
170
167
  };
171
168
  }
172
-
173
169
  //#endregion
174
- export { FormStatusProvider, createFastContext, useFormStatus, usePointerMovement };
170
+ export { FormStatusProvider, createFastContext, useFormStatus, usePointerMovement };