jenosize-ui 0.1.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 (182) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +100 -0
  3. package/THIRD-PARTY-NOTICES.md +163 -0
  4. package/dist/Button-Bt7pzM4R.d.ts +82 -0
  5. package/dist/PaymentInput-CKPIPNWH.d.ts +141 -0
  6. package/dist/Select-CVbEQ2Ep.d.ts +118 -0
  7. package/dist/TagInput-CTJYOB4J.d.ts +90 -0
  8. package/dist/avatar.d.ts +161 -0
  9. package/dist/avatar.js +11 -0
  10. package/dist/badge.d.ts +109 -0
  11. package/dist/badge.js +10 -0
  12. package/dist/breadcrumb.d.ts +58 -0
  13. package/dist/breadcrumb.js +7 -0
  14. package/dist/button.d.ts +54 -0
  15. package/dist/button.js +14 -0
  16. package/dist/calendar.d.ts +368 -0
  17. package/dist/calendar.js +21 -0
  18. package/dist/callout.d.ts +70 -0
  19. package/dist/callout.js +16 -0
  20. package/dist/card-nWicloNi.d.ts +80 -0
  21. package/dist/card.d.ts +2 -0
  22. package/dist/card.js +7 -0
  23. package/dist/checkbox.d.ts +133 -0
  24. package/dist/checkbox.js +11 -0
  25. package/dist/chunk-24TO7E32.js +42 -0
  26. package/dist/chunk-3Y5X7B5C.js +146 -0
  27. package/dist/chunk-4OLULPQG.js +202 -0
  28. package/dist/chunk-4P2NBLBW.js +103 -0
  29. package/dist/chunk-52IFGFTL.js +11 -0
  30. package/dist/chunk-5FATN5YD.js +115 -0
  31. package/dist/chunk-5NOBSXJN.js +297 -0
  32. package/dist/chunk-5RAPA22E.js +106 -0
  33. package/dist/chunk-7EUAMHMU.js +16 -0
  34. package/dist/chunk-7EWQKTNQ.js +1336 -0
  35. package/dist/chunk-7HOIZ3UO.js +110 -0
  36. package/dist/chunk-7IU5TMFL.js +452 -0
  37. package/dist/chunk-7JBNLEJ7.js +29 -0
  38. package/dist/chunk-7S2TBALK.js +23 -0
  39. package/dist/chunk-BJUZVYQC.js +188 -0
  40. package/dist/chunk-BVJWBYIG.js +66 -0
  41. package/dist/chunk-CME4DIML.js +65 -0
  42. package/dist/chunk-CYPPEUX5.js +73 -0
  43. package/dist/chunk-D5BTFSL7.js +71 -0
  44. package/dist/chunk-D6TPWNRK.js +387 -0
  45. package/dist/chunk-DJSXIAFH.js +66 -0
  46. package/dist/chunk-DRZCJCBO.js +46 -0
  47. package/dist/chunk-DWKILXHE.js +17 -0
  48. package/dist/chunk-E7ZSWBAK.js +70 -0
  49. package/dist/chunk-EDSK6FEH.js +8 -0
  50. package/dist/chunk-F2K7VJUV.js +114 -0
  51. package/dist/chunk-F6NLE6XJ.js +40 -0
  52. package/dist/chunk-FHHAPGCR.js +32 -0
  53. package/dist/chunk-FXIBGTS5.js +14 -0
  54. package/dist/chunk-GCVA3OIV.js +72 -0
  55. package/dist/chunk-GFOAJVW5.js +336 -0
  56. package/dist/chunk-GRLSUQQE.js +136 -0
  57. package/dist/chunk-GTHJWR3Q.js +77 -0
  58. package/dist/chunk-HMUZE6EK.js +67 -0
  59. package/dist/chunk-I7WU4GTY.js +503 -0
  60. package/dist/chunk-J2BCKBHC.js +151 -0
  61. package/dist/chunk-J36M3KRX.js +1315 -0
  62. package/dist/chunk-J7ZQQFPT.js +113 -0
  63. package/dist/chunk-JP26LPCY.js +234 -0
  64. package/dist/chunk-JTNFJLIY.js +1046 -0
  65. package/dist/chunk-JVJRHBTD.js +50 -0
  66. package/dist/chunk-JYGR44ZC.js +133 -0
  67. package/dist/chunk-KDLPXXD2.js +173 -0
  68. package/dist/chunk-KMSYEE23.js +224 -0
  69. package/dist/chunk-KNYKWUYX.js +52 -0
  70. package/dist/chunk-LME57Z6J.js +138 -0
  71. package/dist/chunk-MFJP5FA7.js +20 -0
  72. package/dist/chunk-MKC5HNA7.js +1692 -0
  73. package/dist/chunk-MQGD2OUF.js +39 -0
  74. package/dist/chunk-MUFHLP4S.js +566 -0
  75. package/dist/chunk-O2LG3PNI.js +74 -0
  76. package/dist/chunk-O4GRKO3I.js +66 -0
  77. package/dist/chunk-OHUFNYGN.js +791 -0
  78. package/dist/chunk-PWKWNDBS.js +243 -0
  79. package/dist/chunk-QA74ITR4.js +103 -0
  80. package/dist/chunk-R6RGJF4L.js +170 -0
  81. package/dist/chunk-S7NNXWIN.js +7 -0
  82. package/dist/chunk-SV56BSUQ.js +162 -0
  83. package/dist/chunk-T7FCG7XV.js +435 -0
  84. package/dist/chunk-THC2ISYP.js +57 -0
  85. package/dist/chunk-VWC72TR3.js +115 -0
  86. package/dist/chunk-W46K56XU.js +216 -0
  87. package/dist/chunk-W5GGOUUI.js +75 -0
  88. package/dist/chunk-WEUJYDCV.js +269 -0
  89. package/dist/chunk-WFY7DKQD.js +279 -0
  90. package/dist/chunk-WZQFC7ZN.js +448 -0
  91. package/dist/chunk-Z3ETJN5G.js +136 -0
  92. package/dist/chunk-ZOOX3TUB.js +192 -0
  93. package/dist/chunk-ZSNJ6UA3.js +42 -0
  94. package/dist/chunk-ZZA2LUTL.js +130 -0
  95. package/dist/chunk-ZZT2E5VT.js +24 -0
  96. package/dist/color-CtSxc1Rh.d.ts +6 -0
  97. package/dist/combobox.d.ts +184 -0
  98. package/dist/combobox.js +21 -0
  99. package/dist/date-input.d.ts +83 -0
  100. package/dist/date-input.js +16 -0
  101. package/dist/date-picker.d.ts +249 -0
  102. package/dist/date-picker.js +29 -0
  103. package/dist/date-utils-7hTFTXNK.d.ts +34 -0
  104. package/dist/date-vMJBKAFK.d.ts +22 -0
  105. package/dist/dialog.d.ts +86 -0
  106. package/dist/dialog.js +15 -0
  107. package/dist/drawer.d.ts +77 -0
  108. package/dist/drawer.js +14 -0
  109. package/dist/dropdown-menu.d.ts +218 -0
  110. package/dist/dropdown-menu.js +10 -0
  111. package/dist/file-trigger.d.ts +42 -0
  112. package/dist/file-trigger.js +3 -0
  113. package/dist/form.d.ts +487 -0
  114. package/dist/form.js +1179 -0
  115. package/dist/header-navigation.d.ts +74 -0
  116. package/dist/header-navigation.js +23 -0
  117. package/dist/icons/app.d.ts +48 -0
  118. package/dist/icons/app.js +282 -0
  119. package/dist/icons/flag.d.ts +817 -0
  120. package/dist/icons/flag.js +58336 -0
  121. package/dist/icons/integration.d.ts +36 -0
  122. package/dist/icons/integration.js +531 -0
  123. package/dist/icons/payment.d.ts +116 -0
  124. package/dist/icons/payment.js +2418 -0
  125. package/dist/icons.d.ts +2013 -0
  126. package/dist/icons.js +2012 -0
  127. package/dist/illustration.d.ts +48 -0
  128. package/dist/illustration.js +4 -0
  129. package/dist/index.d.ts +68 -0
  130. package/dist/index.js +73 -0
  131. package/dist/indicator.d.ts +51 -0
  132. package/dist/indicator.js +7 -0
  133. package/dist/input.d.ts +66 -0
  134. package/dist/input.js +15 -0
  135. package/dist/multi-value-CJb_tnvi.d.ts +8 -0
  136. package/dist/nav-Bla0o_-1.d.ts +98 -0
  137. package/dist/number-input.d.ts +80 -0
  138. package/dist/number-input.js +15 -0
  139. package/dist/options-CPEIgjtd.d.ts +68 -0
  140. package/dist/overflow-Df0h42Oi.d.ts +29 -0
  141. package/dist/pagination.d.ts +77 -0
  142. package/dist/pagination.js +17 -0
  143. package/dist/payment-input.d.ts +7 -0
  144. package/dist/payment-input.js +15 -0
  145. package/dist/popover.d.ts +60 -0
  146. package/dist/popover.js +14 -0
  147. package/dist/progress.d.ts +87 -0
  148. package/dist/progress.js +5 -0
  149. package/dist/radio.d.ts +77 -0
  150. package/dist/radio.js +12 -0
  151. package/dist/select.d.ts +68 -0
  152. package/dist/select.js +24 -0
  153. package/dist/shared-BNXAdgh2.d.ts +9 -0
  154. package/dist/shared-BYXJPnsN.d.ts +11 -0
  155. package/dist/shared-Dc-GgA16.d.ts +42 -0
  156. package/dist/sidebar-navigation.d.ts +129 -0
  157. package/dist/sidebar-navigation.js +15 -0
  158. package/dist/styles.css +2 -0
  159. package/dist/switch.d.ts +23 -0
  160. package/dist/switch.js +7 -0
  161. package/dist/table.d.ts +692 -0
  162. package/dist/table.js +44 -0
  163. package/dist/tabs.d.ts +111 -0
  164. package/dist/tabs.js +8 -0
  165. package/dist/tag-input.d.ts +12 -0
  166. package/dist/tag-input.js +19 -0
  167. package/dist/tag.d.ts +98 -0
  168. package/dist/tag.js +9 -0
  169. package/dist/textarea.d.ts +40 -0
  170. package/dist/textarea.js +12 -0
  171. package/dist/theme-script.d.ts +29 -0
  172. package/dist/theme-script.js +15 -0
  173. package/dist/theme.css +929 -0
  174. package/dist/theme.d.ts +71 -0
  175. package/dist/theme.js +15 -0
  176. package/dist/toast.d.ts +242 -0
  177. package/dist/toast.js +15 -0
  178. package/dist/tooltip.d.ts +70 -0
  179. package/dist/tooltip.js +6 -0
  180. package/dist/tree.d.ts +308 -0
  181. package/dist/tree.js +11 -0
  182. package/package.json +352 -0
@@ -0,0 +1,136 @@
1
+ import { Button } from './chunk-W46K56XU.js';
2
+ import { MoonIcon, SunIcon } from './chunk-24TO7E32.js';
3
+ import * as React from 'react';
4
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
+
6
+ var ThemeContext = React.createContext(null);
7
+ var THEMES = /* @__PURE__ */ new Set(["light", "dark", "system"]);
8
+ function readSystemTheme() {
9
+ try {
10
+ return globalThis.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
11
+ } catch {
12
+ return "light";
13
+ }
14
+ }
15
+ function readStoredTheme(storageKey, fallback) {
16
+ if (typeof window === "undefined") return fallback;
17
+ try {
18
+ const stored = localStorage.getItem(storageKey);
19
+ if (stored && THEMES.has(stored)) return stored;
20
+ } catch {
21
+ }
22
+ return fallback;
23
+ }
24
+ function applyTheme(resolvedTheme) {
25
+ const el = document.documentElement;
26
+ const wantDark = resolvedTheme === "dark";
27
+ const alreadyApplied = el.classList.contains("dark") === wantDark && el.style.colorScheme === resolvedTheme;
28
+ if (alreadyApplied) {
29
+ return;
30
+ }
31
+ const style = document.createElement("style");
32
+ style.append(document.createTextNode("*,*::before,*::after{transition:none !important}"));
33
+ document.head.append(style);
34
+ el.classList.toggle("dark", resolvedTheme === "dark");
35
+ el.style.colorScheme = resolvedTheme;
36
+ void globalThis.getComputedStyle(document.body).transitionProperty;
37
+ globalThis.setTimeout(() => style.remove(), 0);
38
+ }
39
+ function ThemeProvider(props) {
40
+ const { defaultTheme = "system", storageKey = "jz-theme", children } = props;
41
+ const [theme, setThemeState] = React.useState(() => readStoredTheme(storageKey, defaultTheme));
42
+ const [systemTheme, setSystemTheme] = React.useState(() => typeof window === "undefined" ? "light" : readSystemTheme());
43
+ React.useEffect(() => {
44
+ setSystemTheme(readSystemTheme());
45
+ try {
46
+ const stored = localStorage.getItem(storageKey);
47
+ if (stored && THEMES.has(stored)) setThemeState(stored);
48
+ } catch {
49
+ }
50
+ }, [storageKey]);
51
+ React.useEffect(() => {
52
+ let mq;
53
+ try {
54
+ mq = globalThis.matchMedia("(prefers-color-scheme: dark)");
55
+ } catch {
56
+ return;
57
+ }
58
+ const onChange = () => setSystemTheme(mq.matches ? "dark" : "light");
59
+ mq.addEventListener("change", onChange);
60
+ return () => mq.removeEventListener("change", onChange);
61
+ }, []);
62
+ React.useEffect(() => {
63
+ const onStorage = (event) => {
64
+ if (event.key === storageKey && event.newValue && THEMES.has(event.newValue)) {
65
+ setThemeState(event.newValue);
66
+ }
67
+ };
68
+ globalThis.addEventListener("storage", onStorage);
69
+ return () => globalThis.removeEventListener("storage", onStorage);
70
+ }, [storageKey]);
71
+ const resolvedTheme = theme === "system" ? systemTheme : theme;
72
+ React.useEffect(() => {
73
+ applyTheme(resolvedTheme);
74
+ }, [resolvedTheme]);
75
+ const setTheme = React.useCallback(
76
+ (next) => {
77
+ setThemeState(next);
78
+ try {
79
+ localStorage.setItem(storageKey, next);
80
+ } catch {
81
+ }
82
+ },
83
+ [storageKey]
84
+ );
85
+ const toggle = React.useCallback(() => {
86
+ setTheme(resolvedTheme === "dark" ? "light" : "dark");
87
+ }, [resolvedTheme, setTheme]);
88
+ const value = React.useMemo(
89
+ () => ({ theme, resolvedTheme, systemTheme, setTheme, toggle }),
90
+ [theme, resolvedTheme, systemTheme, setTheme, toggle]
91
+ );
92
+ return /* @__PURE__ */ jsx(ThemeContext.Provider, { value, children });
93
+ }
94
+ function useTheme() {
95
+ const ctx = React.useContext(ThemeContext);
96
+ if (!ctx) {
97
+ throw new Error("[jenosize-ui] useTheme must be used within <ThemeProvider>.");
98
+ }
99
+ return ctx;
100
+ }
101
+
102
+ // src/theme/script.ts
103
+ function buildThemeScript(options = {}) {
104
+ const storageKey = JSON.stringify(options.storageKey ?? "jz-theme");
105
+ const defaultTheme = JSON.stringify(options.defaultTheme ?? "system");
106
+ return `(function(){try{var k=${storageKey},d=${defaultTheme};var t=localStorage.getItem(k);if(t!=="light"&&t!=="dark"&&t!=="system"){t=d;}var s=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";var r=t==="system"?s:t;var e=document.documentElement;e.classList.toggle("dark",r==="dark");e.style.colorScheme=r;}catch(e){}})();`;
107
+ }
108
+ function ThemeScript({ storageKey, defaultTheme, nonce }) {
109
+ return /* @__PURE__ */ jsx("script", { nonce, dangerouslySetInnerHTML: { __html: buildThemeScript({ storageKey, defaultTheme }) } });
110
+ }
111
+ function ThemeToggle({ size = "sm", className }) {
112
+ const { resolvedTheme, toggle } = useTheme();
113
+ const [mounted, setMounted] = React.useState(false);
114
+ React.useEffect(() => setMounted(true), []);
115
+ const label = mounted ? resolvedTheme === "dark" ? "Switch to light theme" : "Switch to dark theme" : "Toggle theme";
116
+ return /* @__PURE__ */ jsx(
117
+ Button,
118
+ {
119
+ variant: "secondary",
120
+ size,
121
+ iconOnly: true,
122
+ "aria-label": label,
123
+ onClick: toggle,
124
+ className,
125
+ leading: /* @__PURE__ */ jsxs(Fragment, { children: [
126
+ /* @__PURE__ */ jsx(MoonIcon, { className: "block dark:hidden" }),
127
+ /* @__PURE__ */ jsx(SunIcon, { className: "hidden dark:block" })
128
+ ] }),
129
+ children: label
130
+ }
131
+ );
132
+ }
133
+
134
+ export { ThemeProvider, ThemeScript, ThemeToggle, buildThemeScript, useTheme };
135
+ //# sourceMappingURL=chunk-GRLSUQQE.js.map
136
+ //# sourceMappingURL=chunk-GRLSUQQE.js.map
@@ -0,0 +1,77 @@
1
+ import { SURFACE_BASE, SURFACE_VARIANT, SURFACE_PADDING } from './chunk-MFJP5FA7.js';
2
+ import { cn } from './chunk-ZSNJ6UA3.js';
3
+ import 'react';
4
+ import { jsxs, jsx } from 'react/jsx-runtime';
5
+
6
+ var OPTION_ROW_GAP = {
7
+ md: "gap-2",
8
+ lg: "gap-3"
9
+ };
10
+ var OPTION_TEXT_GAP = {
11
+ md: "",
12
+ lg: "gap-0.5"
13
+ };
14
+ var OPTION_TEXT_SIZE = {
15
+ md: "text-sm",
16
+ lg: "text-md"
17
+ };
18
+ function optionLabelClass(size) {
19
+ return cn("font-medium text-secondary", OPTION_TEXT_SIZE[size]);
20
+ }
21
+ function optionHintClass(size) {
22
+ return cn("font-normal text-tertiary", OPTION_TEXT_SIZE[size]);
23
+ }
24
+ function optionCardClasses(size, opts = {}) {
25
+ return cn(
26
+ SURFACE_BASE,
27
+ SURFACE_VARIANT.outlined,
28
+ "w-full transition-colors duration-100 ease-linear",
29
+ size === "md" ? SURFACE_PADDING.sm : SURFACE_PADDING.md,
30
+ "has-[[data-checked]]:ring-2 has-[[data-checked]]:ring-brand",
31
+ opts.disabled && "cursor-not-allowed"
32
+ );
33
+ }
34
+ function ControlText(props) {
35
+ const { size, label, hint, labelId, hintId, className } = props;
36
+ const hasLabel = label != null && label !== "";
37
+ const hasHint = hint != null && hint !== "";
38
+ if (!hasLabel && !hasHint) return null;
39
+ return /* @__PURE__ */ jsxs("span", { className: cn("flex flex-col", OPTION_TEXT_GAP[size], className), children: [
40
+ hasLabel ? /* @__PURE__ */ jsx("span", { id: labelId, className: optionLabelClass(size), children: label }) : null,
41
+ hasHint ? /* @__PURE__ */ jsx(
42
+ "span",
43
+ {
44
+ id: hintId,
45
+ "aria-hidden": hasLabel ? void 0 : true,
46
+ className: optionHintClass(size),
47
+ children: hint
48
+ }
49
+ ) : null
50
+ ] });
51
+ }
52
+ ControlText.displayName = "ControlText";
53
+ function OptionRow(props) {
54
+ const { size, control, label, hint, labelId, hintId, bordered = false, disabled = false, className, ...labelProps } = props;
55
+ return /* @__PURE__ */ jsxs(
56
+ "label",
57
+ {
58
+ className: cn(
59
+ "inline-flex items-start select-none",
60
+ OPTION_ROW_GAP[size],
61
+ disabled ? "cursor-not-allowed" : "cursor-pointer",
62
+ bordered && optionCardClasses(size, { disabled }),
63
+ className
64
+ ),
65
+ ...labelProps,
66
+ children: [
67
+ control,
68
+ /* @__PURE__ */ jsx(ControlText, { size, label, hint, labelId, hintId })
69
+ ]
70
+ }
71
+ );
72
+ }
73
+ OptionRow.displayName = "OptionRow";
74
+
75
+ export { OptionRow };
76
+ //# sourceMappingURL=chunk-GTHJWR3Q.js.map
77
+ //# sourceMappingURL=chunk-GTHJWR3Q.js.map
@@ -0,0 +1,67 @@
1
+ import { OptionRow } from './chunk-GTHJWR3Q.js';
2
+ import { warnNeedsName } from './chunk-GCVA3OIV.js';
3
+ import { cn } from './chunk-ZSNJ6UA3.js';
4
+ import { Switch as Switch$1 } from '@base-ui/react/switch';
5
+ import * as React from 'react';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ var SIZE = {
9
+ md: {
10
+ track: "h-5 w-9",
11
+ thumb: "size-4 data-[checked]:translate-x-4"
12
+ },
13
+ lg: {
14
+ track: "h-6 w-11",
15
+ thumb: "size-5 data-[checked]:translate-x-5"
16
+ }
17
+ };
18
+ var TRACK_BASE = "relative inline-flex shrink-0 items-center rounded-full p-0.5 transition-colors duration-150 ease-linear bg-tertiary ring-[0.5px] ring-inset ring-secondary data-[checked]:bg-brand-solid outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2";
19
+ var THUMB_BASE = "pointer-events-none block translate-x-0 rounded-full bg-fg-white shadow-sm transition-transform duration-150 ease-in-out";
20
+ function Switch(props) {
21
+ const { size = "md", label, hint, bordered = false, onCheckedChange, disabled = false, id, className, ...rest } = props;
22
+ const reactId = React.useId();
23
+ const resolvedId = id ?? reactId;
24
+ const labelId = `${reactId}-label`;
25
+ const hintId = `${reactId}-hint`;
26
+ const hasLabel = label != null && label !== "";
27
+ const hasHint = hint != null && hint !== "";
28
+ warnNeedsName("Switch", Boolean(label) || "aria-label" in rest || "aria-labelledby" in rest, "a `label`, `aria-label`, or `aria-labelledby`");
29
+ const track = cn(
30
+ TRACK_BASE,
31
+ SIZE[size].track,
32
+ // Untitled UI's only interactive fill change is checked + hover; no unchecked-hover
33
+ // and no press/active state.
34
+ disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer data-[checked]:hover:bg-brand-solid_hover"
35
+ );
36
+ const thumb = cn(THUMB_BASE, SIZE[size].thumb);
37
+ return /* @__PURE__ */ jsx(
38
+ OptionRow,
39
+ {
40
+ size,
41
+ bordered,
42
+ disabled,
43
+ label,
44
+ hint,
45
+ labelId,
46
+ hintId,
47
+ className,
48
+ control: /* @__PURE__ */ jsx(
49
+ Switch$1.Root,
50
+ {
51
+ ...rest,
52
+ id: resolvedId,
53
+ disabled,
54
+ "aria-labelledby": hasLabel ? labelId : void 0,
55
+ "aria-describedby": hasHint ? hintId : void 0,
56
+ onCheckedChange: onCheckedChange ? (checked, details) => onCheckedChange(checked, details.event) : void 0,
57
+ className: track,
58
+ children: /* @__PURE__ */ jsx(Switch$1.Thumb, { className: thumb })
59
+ }
60
+ )
61
+ }
62
+ );
63
+ }
64
+
65
+ export { Switch };
66
+ //# sourceMappingURL=chunk-HMUZE6EK.js.map
67
+ //# sourceMappingURL=chunk-HMUZE6EK.js.map