@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.
package/dist/types.d.ts CHANGED
@@ -1,17 +1,17 @@
1
- import type { ComponentPropsWithRef, ElementType } from "react";
1
+ import type { ComponentPropsWithRef, ElementType } from 'react';
2
2
  export type AnyElementProps<TTag extends ElementType, Props extends Record<PropertyKey, any> = Record<PropertyKey, any>> = AsElement<TTag> & Omit<ComponentPropsWithRef<TTag>, keyof AsElement> & Props;
3
- export type AsElement<TTag extends ElementType = "div"> = {
3
+ export type AsElement<TTag extends ElementType = 'div'> = {
4
4
  /** Specify what element should be rendered */
5
5
  as?: TTag;
6
6
  };
7
7
  export type ColorTheme = OneOf<[
8
8
  {
9
9
  /** Color theme. */
10
- theme?: "amber" | "blue" | "cyan" | "emerald" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "mauve" | "mist" | "neutral" | "olive" | "orange" | "pink" | "purple" | "red" | "rose" | "sky" | "slate" | "stone" | "taupe" | "teal" | "violet" | "yellow" | "zinc";
10
+ theme?: 'amber' | 'amber-50' | 'amber-100' | 'amber-200' | 'amber-300' | 'amber-400' | 'amber-500' | 'amber-600' | 'amber-700' | 'amber-800' | 'amber-900' | 'amber-950' | 'blue' | 'blue-50' | 'blue-100' | 'blue-200' | 'blue-300' | 'blue-400' | 'blue-500' | 'blue-600' | 'blue-700' | 'blue-800' | 'blue-900' | 'blue-950' | 'cyan' | 'cyan-50' | 'cyan-100' | 'cyan-200' | 'cyan-300' | 'cyan-400' | 'cyan-500' | 'cyan-600' | 'cyan-700' | 'cyan-800' | 'cyan-900' | 'cyan-950' | 'emerald' | 'emerald-50' | 'emerald-100' | 'emerald-200' | 'emerald-300' | 'emerald-400' | 'emerald-500' | 'emerald-600' | 'emerald-700' | 'emerald-800' | 'emerald-900' | 'emerald-950' | 'fuchsia' | 'fuchsia-50' | 'fuchsia-100' | 'fuchsia-200' | 'fuchsia-300' | 'fuchsia-400' | 'fuchsia-500' | 'fuchsia-600' | 'fuchsia-700' | 'fuchsia-800' | 'fuchsia-900' | 'fuchsia-950' | 'gray' | 'gray-50' | 'gray-100' | 'gray-200' | 'gray-300' | 'gray-400' | 'gray-500' | 'gray-600' | 'gray-700' | 'gray-800' | 'gray-900' | 'gray-950' | 'green' | 'green-50' | 'green-100' | 'green-200' | 'green-300' | 'green-400' | 'green-500' | 'green-600' | 'green-700' | 'green-800' | 'green-900' | 'green-950' | 'indigo' | 'indigo-50' | 'indigo-100' | 'indigo-200' | 'indigo-300' | 'indigo-400' | 'indigo-500' | 'indigo-600' | 'indigo-700' | 'indigo-800' | 'indigo-900' | 'indigo-950' | 'lime' | 'lime-50' | 'lime-100' | 'lime-200' | 'lime-300' | 'lime-400' | 'lime-500' | 'lime-600' | 'lime-700' | 'lime-800' | 'lime-900' | 'lime-950' | 'mauve' | 'mauve-50' | 'mauve-100' | 'mauve-200' | 'mauve-300' | 'mauve-400' | 'mauve-500' | 'mauve-600' | 'mauve-700' | 'mauve-800' | 'mauve-900' | 'mauve-950' | 'mist' | 'mist-50' | 'mist-100' | 'mist-200' | 'mist-300' | 'mist-400' | 'mist-500' | 'mist-600' | 'mist-700' | 'mist-800' | 'mist-900' | 'mist-950' | 'neutral' | 'neutral-50' | 'neutral-100' | 'neutral-200' | 'neutral-300' | 'neutral-400' | 'neutral-500' | 'neutral-600' | 'neutral-700' | 'neutral-800' | 'neutral-900' | 'neutral-950' | 'olive' | 'olive-50' | 'olive-100' | 'olive-200' | 'olive-300' | 'olive-400' | 'olive-500' | 'olive-600' | 'olive-700' | 'olive-800' | 'olive-900' | 'olive-950' | 'orange' | 'orange-50' | 'orange-100' | 'orange-200' | 'orange-300' | 'orange-400' | 'orange-500' | 'orange-600' | 'orange-700' | 'orange-800' | 'orange-900' | 'orange-950' | 'pink' | 'pink-50' | 'pink-100' | 'pink-200' | 'pink-300' | 'pink-400' | 'pink-500' | 'pink-600' | 'pink-700' | 'pink-800' | 'pink-900' | 'pink-950' | 'purple' | 'purple-50' | 'purple-100' | 'purple-200' | 'purple-300' | 'purple-400' | 'purple-500' | 'purple-600' | 'purple-700' | 'purple-800' | 'purple-900' | 'purple-950' | 'red' | 'red-50' | 'red-100' | 'red-200' | 'red-300' | 'red-400' | 'red-500' | 'red-600' | 'red-700' | 'red-800' | 'red-900' | 'red-950' | 'rose' | 'rose-50' | 'rose-100' | 'rose-200' | 'rose-300' | 'rose-400' | 'rose-500' | 'rose-600' | 'rose-700' | 'rose-800' | 'rose-900' | 'rose-950' | 'sky' | 'sky-50' | 'sky-100' | 'sky-200' | 'sky-300' | 'sky-400' | 'sky-500' | 'sky-600' | 'sky-700' | 'sky-800' | 'sky-900' | 'sky-950' | 'slate' | 'slate-50' | 'slate-100' | 'slate-200' | 'slate-300' | 'slate-400' | 'slate-500' | 'slate-600' | 'slate-700' | 'slate-800' | 'slate-900' | 'slate-950' | 'stone' | 'stone-50' | 'stone-100' | 'stone-200' | 'stone-300' | 'stone-400' | 'stone-500' | 'stone-600' | 'stone-700' | 'stone-800' | 'stone-900' | 'stone-950' | 'taupe' | 'taupe-50' | 'taupe-100' | 'taupe-200' | 'taupe-300' | 'taupe-400' | 'taupe-500' | 'taupe-600' | 'taupe-700' | 'taupe-800' | 'taupe-900' | 'taupe-950' | 'teal' | 'teal-50' | 'teal-100' | 'teal-200' | 'teal-300' | 'teal-400' | 'teal-500' | 'teal-600' | 'teal-700' | 'teal-800' | 'teal-900' | 'teal-950' | 'violet' | 'violet-50' | 'violet-100' | 'violet-200' | 'violet-300' | 'violet-400' | 'violet-500' | 'violet-600' | 'violet-700' | 'violet-800' | 'violet-900' | 'violet-950' | 'yellow' | 'yellow-50' | 'yellow-100' | 'yellow-200' | 'yellow-300' | 'yellow-400' | 'yellow-500' | 'yellow-600' | 'yellow-700' | 'yellow-800' | 'yellow-900' | 'yellow-950' | 'zinc' | 'zinc-50' | 'zinc-100' | 'zinc-200' | 'zinc-300' | 'zinc-400' | 'zinc-500' | 'zinc-600' | 'zinc-700' | 'zinc-800' | 'zinc-900' | 'zinc-950';
11
11
  },
12
12
  {
13
13
  /** Color theme. */
14
- theme?: "custom";
14
+ theme?: 'custom';
15
15
  customTheme: OneOf<[
16
16
  {
17
17
  /** Example: `'[--theme-color:var(--color-blue-500)]'` */
@@ -24,10 +24,7 @@ export type ColorTheme = OneOf<[
24
24
  ]>;
25
25
  }
26
26
  ]>;
27
- export type MergeTypes<TypesArray extends unknown[], Result = object> = TypesArray extends [
28
- infer Head,
29
- ...infer Remaining
30
- ] ? MergeTypes<Remaining, Result & Head> : Result;
27
+ export type MergeTypes<TypesArray extends unknown[], Result = object> = TypesArray extends [infer Head, ...infer Remaining] ? MergeTypes<Remaining, Result & Head> : Result;
31
28
  export type OneOf<TypesArray extends unknown[], Result = never, AllProps = MergeTypes<TypesArray>> = TypesArray extends [infer Head, ...infer Remaining] ? OneOf<Remaining, Result | OnlyFirst<Head, AllProps>, AllProps> : Result;
32
29
  export type OnlyFirst<F, L> = F & {
33
30
  [Key in keyof Omit<L, keyof F>]?: never;
@@ -0,0 +1,3 @@
1
+ import type { ColorTheme } from '../types';
2
+ export declare function getThemeColor(theme?: ColorTheme['theme']): string;
3
+ export declare function getTextColor(theme?: ColorTheme['theme'], asVariable?: boolean): string;
@@ -1,5 +1,4 @@
1
1
  import { extendTailwindMerge } from "tailwind-merge";
2
-
3
2
  //#region src/utils/class-management.ts
4
3
  /**
5
4
  * ### Has Class
@@ -121,7 +120,6 @@ function toggleClass(elements, classList) {
121
120
  element.classList.toggle(classItem);
122
121
  }));
123
122
  }
124
-
125
123
  //#endregion
126
124
  //#region src/utils/custom-tailwind-merge.ts
127
125
  const isInteger = (classPart) => /^\d+$/.test(classPart);
@@ -315,7 +313,6 @@ function extendMadoTailwindMerge(configExtension) {
315
313
  ...configExtension
316
314
  });
317
315
  }
318
-
319
316
  //#endregion
320
317
  //#region src/utils/get-date.ts
321
318
  /** The current date as a Date object */
@@ -598,13 +595,11 @@ function getTimezone() {
598
595
  const timezonePart = Intl.DateTimeFormat("en-US", { timeZoneName: "short" }).formatToParts(date).find((part) => part.type === "timeZoneName");
599
596
  return timezonePart ? timezonePart.value : "";
600
597
  }
601
-
602
598
  //#endregion
603
599
  //#region src/utils/math.ts
604
600
  function easeOutExpo(time, start, end, duration) {
605
601
  return time == duration ? start + end : end * (-Math.pow(2, -10 * time / duration) + 1) + start;
606
602
  }
607
-
608
603
  //#endregion
609
604
  //#region src/utils/regex.ts
610
605
  const emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
@@ -623,7 +618,6 @@ const telRegex = /(?:\+1\s|1\s|)?\d{3}\.\d{3}\.\d{4}|(?:\+1\s|1\s|)?\d{3}-\d{3}-
623
618
  function isPhoneNumber(tel) {
624
619
  return telRegex.test(tel);
625
620
  }
626
-
627
621
  //#endregion
628
622
  //#region src/utils/string-manipulation.ts
629
623
  /**
@@ -748,6 +742,5 @@ function toTitleCase(string, delimiter = " ") {
748
742
  if (typeof string !== "string") return string;
749
743
  return string.toLowerCase().split(delimiter).map((str) => str.substring(0, 1).toUpperCase() + str.substring(1, str.length).toLowerCase()).join(" ");
750
744
  }
751
-
752
745
  //#endregion
753
- export { addClass, currentMonthName, currentWeekdayName, daysInMonth, easeOutExpo, emailRegex, extendMadoTailwindMerge, firstOfMonth, formatPhoneNumber, getDate, getHours, getHoursIn12, getLocalTime, getMeridianFromHour, getMilliseconds, getMinutes, getMonth, getMonthIndexFromName, getMonthName, getNextMonth, getPreviousMonth, getSeconds, getTimezone, getUserReadableDate, getUserReadableDateFromTimestampz, getWeekdayName, getYearsInRange, hasClass, isEmail, isPhoneNumber, monthNamesList, removeClass, splitCamelCase, telRegex, toCamelCase, toFullDateString, toLowerCase, toTitleCase, toggleClass, twMerge, weekdayNamesList };
746
+ export { addClass, currentMonthName, currentWeekdayName, daysInMonth, easeOutExpo, emailRegex, extendMadoTailwindMerge, firstOfMonth, formatPhoneNumber, getDate, getHours, getHoursIn12, getLocalTime, getMeridianFromHour, getMilliseconds, getMinutes, getMonth, getMonthIndexFromName, getMonthName, getNextMonth, getPreviousMonth, getSeconds, getTimezone, getUserReadableDate, getUserReadableDateFromTimestampz, getWeekdayName, getYearsInRange, hasClass, isEmail, isPhoneNumber, monthNamesList, removeClass, splitCamelCase, telRegex, toCamelCase, toFullDateString, toLowerCase, toTitleCase, toggleClass, twMerge, weekdayNamesList };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@andrilla/mado-ui",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "窓 UI is a collection of opinionated React 19 components built on Tailwind CSS 4.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
8
8
  "module": "./dist/index.js",
9
- "typings": "./dist/index.d.ts",
9
+ "types": "./dist/index.d.ts",
10
10
  "files": [
11
11
  "README.md",
12
12
  "dist"
@@ -20,23 +20,32 @@
20
20
  "import": "./dist/client.js",
21
21
  "types": "./dist/index.d.ts"
22
22
  },
23
- "./client/components": {
24
- "import": "./dist/client/components/index.js",
25
- "types": "./dist/components/index.d.ts"
26
- },
27
- "./client/graphics": {
28
- "import": "./dist/client/graphics/index.js",
29
- "types": "./dist/graphics/index.d.ts"
23
+ "./client/*": {
24
+ "import": "./dist/client/*/index.js",
25
+ "types": "./dist/*/index.d.ts"
30
26
  },
31
27
  "./components": {
32
28
  "import": "./dist/components/index.js",
33
29
  "types": "./dist/components/index.d.ts"
34
30
  },
31
+ "./components/*": {
32
+ "import": "./dist/components/*.js",
33
+ "types": "./dist/components/*.d.ts"
34
+ },
35
35
  "./css": "./dist/css/index.css",
36
+ "./tailwindcss": "./dist/css/tailwindcss.css",
36
37
  "./graphics": {
37
38
  "import": "./dist/graphics/index.js",
38
39
  "types": "./dist/graphics/index.d.ts"
39
40
  },
41
+ "./graphics/social-media": {
42
+ "import": "./dist/graphics/social-media/index.js",
43
+ "types": "./dist/graphics/social-media/index.d.ts"
44
+ },
45
+ "./graphics/social-media/*": {
46
+ "import": "./dist/graphics/social-media/*.js",
47
+ "types": "./dist/graphics/social-media/*.d.ts"
48
+ },
40
49
  "./hooks": {
41
50
  "import": "./dist/hooks/index.js",
42
51
  "types": "./dist/hooks/index.d.ts"
@@ -56,7 +65,7 @@
56
65
  "repository": {
57
66
  "type": "git",
58
67
  "url": "git+https://gitlab.com/andrilla-llc/mado-ui.git",
59
- "directory": ""
68
+ "directory": "https://mado-ui.andrilla.net"
60
69
  },
61
70
  "scripts": {
62
71
  "bundle": "./scripts/bundle.sh",
@@ -64,19 +73,23 @@
64
73
  "bundle:rm": "rm -rf dist",
65
74
  "bundle:rolldown": "rolldown -c",
66
75
  "bundle:tsc": "tsc --emitDeclarationOnly",
76
+ "prep-playground:app": "cp -r ./playground.local/app ./playground/app",
77
+ "prep-playground:components": "cp -r ./playground.local/components ./playground/components",
78
+ "prep-playground:hooks": "cp -r ./playground.local/hooks ./playground/hooks",
79
+ "prep-playground:images": "cp -r ./playground.local/images ./playground/images",
80
+ "prep-playground:public": "cp -r ./playground.local/public ./playground/public",
81
+ "prep-playground:symbols": "cp -r ./playground.local/symbols ./playground/symbols",
82
+ "prep-playground": "npm run prep-playground:app && npm run prep-playground:components && npm run prep-playground:hooks && npm run prep-playground:images && npm run prep-playground:public && npm run prep-playground:symbols",
67
83
  "publish": "./scripts/publish.sh"
68
84
  },
69
85
  "dependencies": {
70
- "@floating-ui/react-dom": "^2.1.7",
86
+ "@floating-ui/react-dom": "^2.1.8",
71
87
  "animejs": "^4.3.6"
72
88
  },
73
89
  "devDependencies": {
74
- "@tailwindcss/postcss": "^4.2.0",
75
90
  "@types/react": "^19.2.14",
76
91
  "@types/react-dom": "^19.2.3",
77
- "postcss": "^8.5.6",
78
- "postcss-cli": "^11.0.1",
79
- "rolldown": "^1.0.0-rc.5",
92
+ "rolldown": "^1.0.0-rc.9",
80
93
  "typescript": "^5.9.3"
81
94
  },
82
95
  "peerDependencies": {