asheeui 0.5.0 → 0.6.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 (118) hide show
  1. package/dist/components/accordion/Accordion.d.ts.map +1 -1
  2. package/dist/components/accordion/Accordion.js +1 -1
  3. package/dist/components/autocomplete/autocomplete-config.js +6 -6
  4. package/dist/components/button/Button.d.ts.map +1 -1
  5. package/dist/components/button/Button.js +17 -17
  6. package/dist/components/card/Card.d.ts.map +1 -1
  7. package/dist/components/card/Card.js +14 -14
  8. package/dist/components/carousel/Carousel.d.ts.map +1 -1
  9. package/dist/components/carousel/Carousel.js +1 -1
  10. package/dist/components/chip/Chip.d.ts.map +1 -1
  11. package/dist/components/chip/Chip.js +1 -1
  12. package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
  13. package/dist/components/date-picker/DatePicker.js +4 -4
  14. package/dist/components/drawer/Drawer.d.ts.map +1 -1
  15. package/dist/components/drawer/Drawer.js +1 -1
  16. package/dist/components/field/FieldShell.d.ts.map +1 -1
  17. package/dist/components/field/FieldShell.js +1 -1
  18. package/dist/components/image/Image.d.ts.map +1 -1
  19. package/dist/components/image/Image.js +8 -8
  20. package/dist/components/input/Input.d.ts.map +1 -1
  21. package/dist/components/input/Input.js +9 -9
  22. package/dist/components/input/PasswordInput.d.ts.map +1 -1
  23. package/dist/components/input/PasswordInput.js +1 -1
  24. package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
  25. package/dist/components/keyboard/OnScreenKeyboard.js +8 -8
  26. package/dist/components/link/Link.d.ts.map +1 -1
  27. package/dist/components/link/Link.js +12 -12
  28. package/dist/components/marquee/Marquee.d.ts.map +1 -1
  29. package/dist/components/marquee/Marquee.js +21 -21
  30. package/dist/components/modal/Modal.d.ts.map +1 -1
  31. package/dist/components/modal/Modal.js +12 -12
  32. package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
  33. package/dist/components/multi-select/MultiSelect.js +10 -10
  34. package/dist/components/multi-select/multi-select-config.js +6 -6
  35. package/dist/components/radio/Radio.d.ts.map +1 -1
  36. package/dist/components/radio/Radio.js +1 -1
  37. package/dist/components/radio/RadioGroup.d.ts.map +1 -1
  38. package/dist/components/radio/RadioGroup.js +11 -11
  39. package/dist/components/radio/radio-styles.d.ts.map +1 -1
  40. package/dist/components/radio/radio-styles.js +4 -9
  41. package/dist/components/resizable-screen/ResizableScreen.d.ts.map +1 -1
  42. package/dist/components/resizable-screen/ResizableScreen.js +12 -12
  43. package/dist/components/select/Select.d.ts.map +1 -1
  44. package/dist/components/select/Select.js +11 -11
  45. package/dist/components/select/select-config.js +8 -8
  46. package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
  47. package/dist/components/select-menu/SelectMenu.js +24 -24
  48. package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
  49. package/dist/components/sidebar/Sidebar.js +7 -7
  50. package/dist/components/spinner/spinner-styles.d.ts.map +1 -1
  51. package/dist/components/spinner/spinner-styles.js +0 -1
  52. package/dist/components/spinner/spinner.d.ts.map +1 -1
  53. package/dist/components/spinner/spinner.js +9 -9
  54. package/dist/components/switch/Switch.d.ts.map +1 -1
  55. package/dist/components/switch/Switch.js +10 -10
  56. package/dist/components/table/Table.d.ts.map +1 -1
  57. package/dist/components/table/Table.js +1 -1
  58. package/dist/components/table/table-styles.d.ts.map +1 -1
  59. package/dist/components/table/table-styles.js +6 -11
  60. package/dist/components/tabs/Tabs.d.ts.map +1 -1
  61. package/dist/components/tabs/Tabs.js +14 -14
  62. package/dist/components/textarea/Textarea.d.ts.map +1 -1
  63. package/dist/components/textarea/Textarea.js +18 -18
  64. package/dist/components/toast/ToastItem.d.ts.map +1 -1
  65. package/dist/components/toast/ToastItem.js +1 -1
  66. package/dist/components/toast/toast-context.d.ts.map +1 -1
  67. package/dist/components/toast/toast-context.js +12 -12
  68. package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
  69. package/dist/components/tooltip/Tooltip.js +28 -28
  70. package/dist/config/config.d.ts +2 -2
  71. package/dist/config/config.d.ts.map +1 -1
  72. package/dist/config/resolve-config.js +1 -1
  73. package/dist/icons/ArrowLeftIcon.js +1 -1
  74. package/dist/icons/CalendarIcon.js +1 -1
  75. package/dist/icons/CheckIcon.js +1 -1
  76. package/dist/icons/ChevronDownIcon.js +1 -1
  77. package/dist/icons/ChevronLeftIcon.js +1 -1
  78. package/dist/icons/ChevronRightIcon.js +1 -1
  79. package/dist/icons/ClearIcon.js +1 -1
  80. package/dist/icons/ClockIcon.js +1 -1
  81. package/dist/icons/CloseIcon.js +1 -1
  82. package/dist/icons/ErrorIcon.js +1 -1
  83. package/dist/icons/ExternalLinkIcon.js +1 -1
  84. package/dist/icons/EyeIcon.js +1 -1
  85. package/dist/icons/EyeOffIcon.js +1 -1
  86. package/dist/icons/InfoIcon.js +1 -1
  87. package/dist/icons/SearchIcon.js +1 -1
  88. package/dist/icons/WarningIcon.js +1 -1
  89. package/dist/index.d.ts +2 -2
  90. package/dist/index.d.ts.map +1 -1
  91. package/dist/index.js +10 -10
  92. package/dist/libs/context.d.ts +2 -0
  93. package/dist/libs/context.d.ts.map +1 -1
  94. package/dist/libs/context.js +1 -1
  95. package/dist/libs/use-isomorphic-layout-effect.d.ts +2 -2
  96. package/dist/libs/use-isomorphic-layout-effect.d.ts.map +1 -1
  97. package/dist/provider.d.ts +33 -0
  98. package/dist/provider.d.ts.map +1 -0
  99. package/dist/provider.js +23 -0
  100. package/dist/scripts/AsheeThemeScript.js +19 -21
  101. package/dist/shared/variant.d.ts +1 -1
  102. package/dist/shared/variant.d.ts.map +1 -1
  103. package/dist/shared/variant.js +10 -15
  104. package/dist/utils/cn.d.ts +20 -0
  105. package/dist/utils/cn.d.ts.map +1 -0
  106. package/dist/utils/cn.js +9 -0
  107. package/dist/utils/index.d.ts +11 -0
  108. package/dist/utils/index.d.ts.map +1 -0
  109. package/dist/utils/index.js +3 -0
  110. package/dist/utils/merge-object.d.ts +24 -0
  111. package/dist/utils/merge-object.d.ts.map +1 -0
  112. package/dist/utils/merge-object.js +17 -0
  113. package/dist/utils/types.d.ts +10 -0
  114. package/dist/utils/types.d.ts.map +1 -0
  115. package/package.json +4 -2
  116. package/dist/AsheeUIProvider.d.ts +0 -6
  117. package/dist/AsheeUIProvider.d.ts.map +0 -1
  118. package/dist/AsheeUIProvider.js +0 -24
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { AsheeUIProvider as r } from "./AsheeUIProvider.js";
2
+ import { AsheeProvider as r } from "./provider.js";
3
3
  import { THEME_STORAGE_KEY as f, themeController as C } from "./theme/controller.js";
4
4
  import { useTheme as A } from "./theme/useTheme.js";
5
5
  import { Accordion as x } from "./components/accordion/Accordion.js";
@@ -14,7 +14,7 @@ import { FALLBACK_ACCORDION_CONFIG as G, defaultAccordionConfig as g } from "./c
14
14
  import { FALLBACK_AUTOCOMPLETE_CONFIG as S, defaultAutocompleteConfig as R } from "./components/autocomplete/autocomplete-config.js";
15
15
  import { FALLBACK_BUTTON_CONFIG as c, defaultButtonConfig as b } from "./components/button/button-config.js";
16
16
  import { FALLBACK_CARD_CONFIG as M, defaultCardConfig as P } from "./components/card/card-config.js";
17
- import { FALLBACK_CAROUSEL_CONFIG as U, defaultCarouselConfig as w } from "./components/carousel/carousel-config.js";
17
+ import { FALLBACK_CAROUSEL_CONFIG as w, defaultCarouselConfig as y } from "./components/carousel/carousel-config.js";
18
18
  import { FALLBACK_CHIP_CONFIG as k, defaultChipConfig as v } from "./components/chip/chip-config.js";
19
19
  import { FALLBACK_DATE_PICKER_CONFIG as q, defaultDatePickerConfig as z } from "./components/date-picker/date-picker-config.js";
20
20
  import { FALLBACK_DRAWER_CONFIG as Q, defaultDrawerConfig as X } from "./components/drawer/drawer-config.js";
@@ -32,7 +32,7 @@ import { FALLBACK_SPINNER_CONFIG as go, defaultSpinnerConfig as Eo } from "./com
32
32
  import { FALLBACK_SWITCH_CONFIG as Ro, defaultSwitchConfig as so } from "./components/switch/switch-config.js";
33
33
  import { FALLBACK_TABLE_CONFIG as bo, defaultTableConfig as Do } from "./components/table/table-config.js";
34
34
  import { FALLBACK_TABS_CONFIG as Po, defaultTabsConfig as ho } from "./components/tabs/tabs-config.js";
35
- import { FALLBACK_TEXTAREA_CONFIG as wo, defaultTextAreaConfig as yo } from "./components/textarea/textarea-config.js";
35
+ import { FALLBACK_TEXTAREA_CONFIG as yo, defaultTextAreaConfig as Uo } from "./components/textarea/textarea-config.js";
36
36
  import { FALLBACK_TOAST_CONFIG as vo, defaultToastConfig as Ho } from "./components/toast/toast-config.js";
37
37
  import { FALLBACK_TOOLTIP_CONFIG as zo, defaultTooltipConfig as Wo } from "./components/tooltip/tooltip-config.js";
38
38
  import { FieldShell as Xo } from "./components/field/FieldShell.js";
@@ -56,14 +56,14 @@ import { Switch as se } from "./components/switch/Switch.js";
56
56
  import { Table as be } from "./components/table/Table.js";
57
57
  import { Tabs as Me } from "./components/tabs/Tabs.js";
58
58
  import { TextArea as he } from "./components/textarea/Textarea.js";
59
- import { ToastItem as we } from "./components/toast/ToastItem.js";
59
+ import { ToastItem as ye } from "./components/toast/ToastItem.js";
60
60
  import { ToastProvider as ke, useToast as ve } from "./components/toast/toast-context.js";
61
61
  import { Tooltip as qe } from "./components/tooltip/Tooltip.js";
62
62
  import { defaultInputConfig as We } from "./components/input/input-config.js";
63
63
  import { useKeyboardField as Xe } from "./components/keyboard/use-keyboard-field.js";
64
64
  export {
65
65
  x as Accordion,
66
- r as AsheeUIProvider,
66
+ r as AsheeProvider,
67
67
  L as Autocomplete,
68
68
  _ as Button,
69
69
  l as Card,
@@ -75,7 +75,7 @@ export {
75
75
  S as FALLBACK_AUTOCOMPLETE_CONFIG,
76
76
  c as FALLBACK_BUTTON_CONFIG,
77
77
  M as FALLBACK_CARD_CONFIG,
78
- U as FALLBACK_CAROUSEL_CONFIG,
78
+ w as FALLBACK_CAROUSEL_CONFIG,
79
79
  k as FALLBACK_CHIP_CONFIG,
80
80
  q as FALLBACK_DATE_PICKER_CONFIG,
81
81
  Q as FALLBACK_DRAWER_CONFIG,
@@ -93,7 +93,7 @@ export {
93
93
  Ro as FALLBACK_SWITCH_CONFIG,
94
94
  bo as FALLBACK_TABLE_CONFIG,
95
95
  Po as FALLBACK_TABS_CONFIG,
96
- wo as FALLBACK_TEXTAREA_CONFIG,
96
+ yo as FALLBACK_TEXTAREA_CONFIG,
97
97
  vo as FALLBACK_TOAST_CONFIG,
98
98
  zo as FALLBACK_TOOLTIP_CONFIG,
99
99
  Xo as FieldShell,
@@ -119,14 +119,14 @@ export {
119
119
  be as Table,
120
120
  Me as Tabs,
121
121
  he as TextArea,
122
- we as ToastItem,
122
+ ye as ToastItem,
123
123
  ke as ToastProvider,
124
124
  qe as Tooltip,
125
125
  g as defaultAccordionConfig,
126
126
  R as defaultAutocompleteConfig,
127
127
  b as defaultButtonConfig,
128
128
  P as defaultCardConfig,
129
- w as defaultCarouselConfig,
129
+ y as defaultCarouselConfig,
130
130
  v as defaultChipConfig,
131
131
  z as defaultDatePickerConfig,
132
132
  X as defaultDrawerConfig,
@@ -145,7 +145,7 @@ export {
145
145
  so as defaultSwitchConfig,
146
146
  Do as defaultTableConfig,
147
147
  ho as defaultTabsConfig,
148
- yo as defaultTextAreaConfig,
148
+ Uo as defaultTextAreaConfig,
149
149
  Ho as defaultToastConfig,
150
150
  Wo as defaultTooltipConfig,
151
151
  C as themeController,
@@ -1,4 +1,6 @@
1
1
  import { Config } from '../config/config';
2
2
  export declare const AsheeConfigContext: import('react').Context<Config | null>;
3
3
  export declare function useAsheeConfig(): Config;
4
+ /** Alias for {@link useAsheeConfig}, exported from the `asheeui` root. */
5
+ export declare const useAshee: typeof useAsheeConfig;
4
6
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/libs/context.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,eAAO,MAAM,kBAAkB,wCAAqC,CAAC;AAErE,wBAAgB,cAAc,IAAI,MAAM,CAQvC"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/libs/context.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,eAAO,MAAM,kBAAkB,wCAAqC,CAAC;AAErE,wBAAgB,cAAc,IAAI,MAAM,CAQvC;AAED,0EAA0E;AAC1E,eAAO,MAAM,QAAQ,uBAAiB,CAAC"}
@@ -5,7 +5,7 @@ function i() {
5
5
  const e = o(n);
6
6
  if (!e)
7
7
  throw new Error(
8
- "useAsheeConfig must be used within an AsheeUIProvider - wrap your app root with <AsheeUIProvider>."
8
+ "useAsheeConfig must be used within an AsheeProvider - wrap your app root with <AsheeProvider>."
9
9
  );
10
10
  return e;
11
11
  }
@@ -1,3 +1,3 @@
1
- import { useLayoutEffect } from 'react';
2
- export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
1
+ import { useEffect } from 'react';
2
+ export declare const useIsomorphicLayoutEffect: typeof useEffect;
3
3
  //# sourceMappingURL=use-isomorphic-layout-effect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-isomorphic-layout-effect.d.ts","sourceRoot":"","sources":["../../src/libs/use-isomorphic-layout-effect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,eAAe,EAAE,MAAM,OAAO,CAAC;AAEnD,eAAO,MAAM,yBAAyB,wBACuB,CAAC"}
1
+ {"version":3,"file":"use-isomorphic-layout-effect.d.ts","sourceRoot":"","sources":["../../src/libs/use-isomorphic-layout-effect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,OAAO,CAAC;AAEnD,eAAO,MAAM,yBAAyB,kBACuB,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { ReactNode } from 'react';
2
+ import { ExternalConfig } from './config/config';
3
+ export interface AsheeProviderProps {
4
+ /**
5
+ * Optional partial runtime config merged over the library defaults.
6
+ *
7
+ * Pass the object exported by an `asheeui.config.*` file (or any
8
+ * inline {@link ExternalConfig}) to customize colors, radius, theme
9
+ * defaults and per-component options at runtime.
10
+ */
11
+ config?: ExternalConfig;
12
+ children: ReactNode;
13
+ }
14
+ /**
15
+ * Runtime configuration provider.
16
+ *
17
+ * Resolves {@link AsheeProviderProps.config} against the library
18
+ * defaults and exposes the resulting config through React context
19
+ * (consumed via `useAsheeConfig` / `useAshee`). Theme controller
20
+ * setup and the pre-paint theme script are wired automatically.
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * import { AsheeProvider } from "asheeui";
25
+ * import config from "./asheeui.config";
26
+ *
27
+ * export function Providers({ children }) {
28
+ * return <AsheeProvider config={config}>{children}</AsheeProvider>;
29
+ * }
30
+ * ```
31
+ */
32
+ export declare function AsheeProvider({ config, children }: AsheeProviderProps): import("react").JSX.Element;
33
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAOtD,MAAM,WAAW,kBAAkB;IACjC;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,EAAE,MAAW,EAAE,QAAQ,EAAE,EAAE,kBAAkB,+BAgB1E"}
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { jsxs as t, jsx as m } from "react/jsx-runtime";
3
+ import { useMemo as i } from "react";
4
+ import { resolveConfig as s } from "./config/resolve-config.js";
5
+ import { AsheeConfigContext as f } from "./libs/context.js";
6
+ import { useIsomorphicLayoutEffect as n } from "./libs/use-isomorphic-layout-effect.js";
7
+ import { AsheeThemeScript as c } from "./scripts/AsheeThemeScript.js";
8
+ import { themeController as h } from "./theme/controller.js";
9
+ function g({ config: o = {}, children: r }) {
10
+ const e = i(() => s(o), [o]);
11
+ return n(() => {
12
+ h.configure({
13
+ defaultTheme: e.defaultTheme ?? "system",
14
+ themes: Object.keys(e.color)
15
+ });
16
+ }, [e]), /* @__PURE__ */ t(f.Provider, { value: e, children: [
17
+ /* @__PURE__ */ m(c, { config: e }),
18
+ r
19
+ ] });
20
+ }
21
+ export {
22
+ g as AsheeProvider
23
+ };
@@ -1,9 +1,7 @@
1
1
  "use client";
2
- import { jsx as i } from "react/jsx-runtime";
3
- import c from "virtual:ashee-config";
4
- import { resolveConfig as m } from "../config/resolve-config.js";
5
- import { THEME_STORAGE_KEY as d } from "../theme/controller.js";
6
- const h = {
2
+ import { jsx as c } from "react/jsx-runtime";
3
+ import { THEME_STORAGE_KEY as i } from "../theme/controller.js";
4
+ const d = {
7
5
  background: "--ashee-background",
8
6
  foreground: "--ashee-foreground",
9
7
  primary: "--ashee-primary",
@@ -14,25 +12,25 @@ const h = {
14
12
  success: "--ashee-success",
15
13
  scrollbarThumb: "--ashee-scrollbar-thumb",
16
14
  scrollbarTrack: "--ashee-scrollbar-track"
17
- }, a = "ashee-theme-vars";
18
- function y(e) {
19
- return Object.entries(e).map(([t, s]) => {
20
- const r = Object.entries(s).map(([o, l]) => ` ${h[o]}: ${l};`).join(`
15
+ }, l = "ashee-theme-vars";
16
+ function h(e) {
17
+ return Object.entries(e).map(([s, t]) => {
18
+ const r = Object.entries(t).map(([a, n]) => ` ${d[a]}: ${n};`).join(`
21
19
  `);
22
- return `${t === "light" ? ":root, .theme-light" : `.theme-${t}`} {
20
+ return `${s === "light" ? ":root, .theme-light" : `.theme-${s}`} {
23
21
  ${r}
24
22
  }`;
25
23
  }).join(`
26
24
 
27
25
  `);
28
26
  }
29
- function v() {
30
- const e = m(c ?? {}), t = Object.keys(e.color ?? {}), s = e.defaultTheme ?? "system", r = d, n = y(e.color), o = `
27
+ function u({ config: e }) {
28
+ const s = Object.keys(e.color ?? {}), t = e.defaultTheme ?? "system", r = i, o = h(e.color), a = `
31
29
  (function() {
32
30
  var el = document.documentElement;
33
31
  var storageKey = ${JSON.stringify(r)};
34
- var defaultTheme = ${JSON.stringify(s)};
35
- var themes = ${JSON.stringify(t)};
32
+ var defaultTheme = ${JSON.stringify(t)};
33
+ var themes = ${JSON.stringify(s)};
36
34
  var systemDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
37
35
 
38
36
  var stored = null;
@@ -53,25 +51,25 @@ function v() {
53
51
  el.style.colorScheme = resolved;
54
52
 
55
53
  // Synchronously inject style tag before first paint
56
- var styleEl = document.getElementById(${JSON.stringify(a)});
54
+ var styleEl = document.getElementById(${JSON.stringify(l)});
57
55
  if (!styleEl) {
58
56
  styleEl = document.createElement('style');
59
- styleEl.id = ${JSON.stringify(a)};
60
- styleEl.textContent = ${JSON.stringify(n)};
57
+ styleEl.id = ${JSON.stringify(l)};
58
+ styleEl.textContent = ${JSON.stringify(o)};
61
59
  document.head.appendChild(styleEl);
62
60
  }
63
61
  })();
64
62
  `;
65
- return /* @__PURE__ */ i(
63
+ return /* @__PURE__ */ c(
66
64
  "script",
67
65
  {
68
66
  id: "ashee-theme-script",
69
- dangerouslySetInnerHTML: { __html: o },
67
+ dangerouslySetInnerHTML: { __html: a },
70
68
  suppressHydrationWarning: !0
71
69
  }
72
70
  );
73
71
  }
74
72
  export {
75
- v as AsheeThemeScript,
76
- a as THEME_VARS_STYLE_ID
73
+ u as AsheeThemeScript,
74
+ l as THEME_VARS_STYLE_ID
77
75
  };
@@ -1,4 +1,4 @@
1
1
  export type Variant = "solid" | "ghost" | "bordered" | "faded" | "underlined";
2
- export type Color = "none" | "default" | "primary" | "secondary" | "danger" | "warning" | "success";
2
+ export type Color = "none" | "primary" | "secondary" | "danger" | "warning" | "success";
3
3
  export declare function resolveVariantClass(variant: Variant, color: Color): string;
4
4
  //# sourceMappingURL=variant.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"variant.d.ts","sourceRoot":"","sources":["../../src/shared/variant.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,CAAC;AAC9E,MAAM,MAAM,KAAK,GACb,MAAM,GACN,SAAS,GACT,SAAS,GACT,WAAW,GACX,QAAQ,GACR,SAAS,GACT,SAAS,CAAC;AA+Dd,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,CAE1E"}
1
+ {"version":3,"file":"variant.d.ts","sourceRoot":"","sources":["../../src/shared/variant.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,CAAC;AAC9E,MAAM,MAAM,KAAK,GACb,MAAM,GACN,SAAS,GACT,WAAW,GACX,QAAQ,GACR,SAAS,GACT,SAAS,CAAC;AA0Dd,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,CAE1E"}
@@ -1,8 +1,7 @@
1
1
  "use client";
2
- import { cn as r } from "@asheeui/utils";
3
- const s = {
2
+ import { cn as r } from "../utils/cn.js";
3
+ const t = {
4
4
  none: "bg-background text-foreground",
5
- default: "bg-secondary text-foreground",
6
5
  primary: "bg-primary text-secondary",
7
6
  secondary: "bg-secondary text-foreground",
8
7
  danger: "bg-danger text-secondary",
@@ -10,23 +9,20 @@ const s = {
10
9
  success: "bg-success text-secondary"
11
10
  }, e = {
12
11
  none: "bg-transparent text-foreground hover:bg-foreground/10",
13
- default: "bg-transparent text-foreground hover:bg-foreground/10",
14
12
  primary: "bg-transparent text-primary hover:bg-primary/10",
15
13
  secondary: "bg-transparent text-foreground hover:bg-secondary/10",
16
14
  danger: "bg-transparent text-danger hover:bg-danger/10",
17
15
  warning: "bg-transparent text-warning hover:bg-warning/10",
18
16
  success: "bg-transparent text-success hover:bg-success/10"
19
- }, b = {
17
+ }, g = {
20
18
  none: r(e.primary, "border-2 border-background"),
21
- default: r(e.primary, "border-2 border-secondary"),
22
19
  primary: r(e.primary, "border-2 border-primary"),
23
20
  secondary: r(e.secondary, "border-2 border-border"),
24
21
  danger: r(e.danger, "border-2 border-danger"),
25
22
  warning: r(e.warning, "border-2 border-warning"),
26
23
  success: r(e.success, "border-2 border-success")
27
- }, g = {
24
+ }, b = {
28
25
  none: "bg-secondary/40 text-foreground border-2 border-transparent",
29
- default: "bg-secondary/40 text-foreground border-2 border-border",
30
26
  primary: "bg-primary/10 text-primary border-2 border-primary/20",
31
27
  secondary: "bg-secondary/15 text-foreground border-2 border-secondary/30",
32
28
  danger: "bg-danger/10 text-danger border-2 border-danger/20",
@@ -34,23 +30,22 @@ const s = {
34
30
  success: "bg-success/10 text-success border-2 border-success/20"
35
31
  }, n = "border-b-2 border-t-0 border-x-0 rounded-none bg-transparent shadow-none", c = {
36
32
  none: r(n, "border-background text-foreground"),
37
- default: r(n, "border-border text-foreground"),
38
33
  primary: r(n, "border-primary text-primary"),
39
34
  secondary: r(n, "border-secondary text-secondary"),
40
35
  danger: r(n, "border-danger text-danger"),
41
36
  warning: r(n, "border-warning text-warning"),
42
37
  success: r(n, "border-success text-success")
43
38
  }, d = {
44
- solid: s,
39
+ solid: t,
45
40
  ghost: e,
46
- bordered: b,
47
- faded: g,
41
+ bordered: g,
42
+ faded: b,
48
43
  underlined: c
49
44
  };
50
- function i(a, t) {
45
+ function y(a, s) {
51
46
  var o;
52
- return ((o = d[a]) == null ? void 0 : o[t]) ?? d.bordered.default;
47
+ return ((o = d[a]) == null ? void 0 : o[s]) ?? d.bordered.secondary;
53
48
  }
54
49
  export {
55
- i as resolveVariantClass
50
+ y as resolveVariantClass
56
51
  };
@@ -0,0 +1,20 @@
1
+ import { ClassValue } from 'clsx';
2
+ /**
3
+ * Merge Tailwind CSS class names, resolving conflicts deterministically.
4
+ *
5
+ * Combines `clsx` (conditional class composition) with `tailwind-merge`
6
+ * (later conflicting utilities win), which keeps generated class
7
+ * strings short and predictable.
8
+ *
9
+ * @param inputs - Class values: strings, objects, arrays, or falsy
10
+ * values that are ignored.
11
+ * @returns A single space-separated class string.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * cn("px-2 p-4", isActive && "bg-primary", "rounded-md");
16
+ * // isActive=false -> "p-4 rounded-md"; px-2 conflicts with p-4 and is dropped
17
+ * ```
18
+ */
19
+ export declare function cn(...inputs: ClassValue[]): string;
20
+ //# sourceMappingURL=cn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAElD"}
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { clsx as t } from "clsx";
3
+ import { twMerge as e } from "tailwind-merge";
4
+ function c(...r) {
5
+ return e(t(r));
6
+ }
7
+ export {
8
+ c as cn
9
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * AsheeUI shared utilities.
3
+ *
4
+ * Client-safe helpers (`cn`, `mergeObject`) plus the `DeepPartial` type,
5
+ * migrated from the former `@asheeui/utils` package. Node-only helpers
6
+ * (config discovery) live under `./node`.
7
+ */
8
+ export { cn } from './cn';
9
+ export { mergeObject } from './merge-object';
10
+ export type { DeepPartial } from './types';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./cn.js";
2
+ export * from "./merge-object.js";
3
+ export * from "./resolve-token.js";
@@ -0,0 +1,24 @@
1
+ import { DeepPartial } from './types';
2
+ /**
3
+ * Deeply merge a partial user config over a set of defaults.
4
+ *
5
+ * Nested plain objects are merged recursively; arrays and scalar
6
+ * values from `userConfig` replace the default outright. Keys whose
7
+ * user value is `undefined` are skipped, leaving the default intact.
8
+ * The `defaults` object is not mutated.
9
+ *
10
+ * @param defaults - Baseline object providing fallback values.
11
+ * @param userConfig - Optional partial override object.
12
+ * @returns A new object with the user overrides applied.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const config = mergeObject(
17
+ * { theme: { color: "primary", radius: "md" } },
18
+ * { theme: { radius: "lg" } },
19
+ * );
20
+ * // -> { theme: { color: "primary", radius: "lg" } }
21
+ * ```
22
+ */
23
+ export declare function mergeObject<T extends Record<string, unknown>>(defaults: T, userConfig?: DeepPartial<T>): T;
24
+ //# sourceMappingURL=merge-object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge-object.d.ts","sourceRoot":"","sources":["../../src/utils/merge-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAY3C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3D,QAAQ,EAAE,CAAC,EACX,UAAU,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAC1B,CAAC,CAuBH"}
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ function u(e) {
3
+ return typeof e == "object" && e !== null && !Array.isArray(e);
4
+ }
5
+ function l(e, n) {
6
+ if (!n)
7
+ return e;
8
+ const o = { ...e }, s = e, i = n;
9
+ for (const t of Object.keys(n)) {
10
+ const c = i[t], r = s[t];
11
+ c !== void 0 && (u(r) && u(c) ? o[t] = l(r, c) : o[t] = c);
12
+ }
13
+ return o;
14
+ }
15
+ export {
16
+ l as mergeObject
17
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Recursively make every property of `T` optional.
3
+ *
4
+ * Arrays and primitives are left untouched; only object properties are
5
+ * mapped. Useful for typed partial configuration overrides.
6
+ */
7
+ export type DeepPartial<T> = T extends object ? {
8
+ [P in keyof T]?: DeepPartial<T[P]>;
9
+ } : T;
10
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GACzC;KACG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACnC,GACD,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asheeui",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -28,6 +28,7 @@
28
28
  "./styles.css": "./dist/index.css"
29
29
  },
30
30
  "publishConfig": {
31
+ "access": "public",
31
32
  "style": "./dist/index.css"
32
33
  },
33
34
  "files": [
@@ -38,7 +39,8 @@
38
39
  ],
39
40
  "dependencies": {
40
41
  "@floating-ui/react": "^0.27.20",
41
- "@asheeui/utils": "0.3.0"
42
+ "clsx": "^2.1.1",
43
+ "tailwind-merge": "^3.6.0"
42
44
  },
43
45
  "peerDependencies": {
44
46
  "react": "^18.0.0 || ^19.0.0",
@@ -1,6 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export interface AsheeUIProviderProps {
3
- children: ReactNode;
4
- }
5
- export declare function AsheeUIProvider({ children }: AsheeUIProviderProps): import("react").JSX.Element;
6
- //# sourceMappingURL=AsheeUIProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AsheeUIProvider.d.ts","sourceRoot":"","sources":["../src/AsheeUIProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAOhD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE,oBAAoB,+BAgBjE"}
@@ -1,24 +0,0 @@
1
- "use client";
2
- import { jsxs as r, jsx as t } from "react/jsx-runtime";
3
- import m from "virtual:ashee-config";
4
- import { useMemo as i } from "react";
5
- import { resolveConfig as f } from "./config/resolve-config.js";
6
- import { AsheeConfigContext as s } from "./libs/context.js";
7
- import { useIsomorphicLayoutEffect as n } from "./libs/use-isomorphic-layout-effect.js";
8
- import { AsheeThemeScript as c } from "./scripts/AsheeThemeScript.js";
9
- import { themeController as p } from "./theme/controller.js";
10
- function v({ children: o }) {
11
- const e = i(() => f(m ?? {}), []);
12
- return n(() => {
13
- p.configure({
14
- defaultTheme: e.defaultTheme ?? "system",
15
- themes: Object.keys(e.color)
16
- });
17
- }, [e]), /* @__PURE__ */ r(s.Provider, { value: e, children: [
18
- /* @__PURE__ */ t(c, {}),
19
- o
20
- ] });
21
- }
22
- export {
23
- v as AsheeUIProvider
24
- };