@stll/ui 0.0.1-placeholder.0 → 0.3.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 (149) hide show
  1. package/README.md +84 -0
  2. package/dist/components/accordion.d.ts +8 -0
  3. package/dist/components/accordion.js +38 -0
  4. package/dist/components/alert-dialog.d.ts +32 -0
  5. package/dist/components/alert-dialog.js +75 -0
  6. package/dist/components/avatar.d.ts +7 -0
  7. package/dist/components/avatar.js +22 -0
  8. package/dist/components/bidi-text.d.ts +24 -0
  9. package/dist/components/bidi-text.js +38 -0
  10. package/dist/components/brand-icons.d.ts +7 -0
  11. package/dist/components/brand-icons.js +18 -0
  12. package/dist/components/breadcrumb.d.ts +12 -0
  13. package/dist/components/breadcrumb.js +61 -0
  14. package/dist/components/button-variants.d.ts +17 -0
  15. package/dist/components/button-variants.js +43 -0
  16. package/dist/components/button.d.ts +20 -0
  17. package/dist/components/button.js +53 -0
  18. package/dist/components/checkbox.d.ts +5 -0
  19. package/dist/components/checkbox.js +44 -0
  20. package/dist/components/color-picker.d.ts +47 -0
  21. package/dist/components/color-picker.js +249 -0
  22. package/dist/components/combobox.d.ts +40 -0
  23. package/dist/components/combobox.js +208 -0
  24. package/dist/components/command.d.ts +34 -0
  25. package/dist/components/command.js +100 -0
  26. package/dist/components/date-picker-popover.d.ts +29 -0
  27. package/dist/components/date-picker-popover.js +548 -0
  28. package/dist/components/date-picker-popover.logic.d.ts +14 -0
  29. package/dist/components/date-picker-popover.logic.js +26 -0
  30. package/dist/components/destructive-action-confirmation.d.ts +21 -0
  31. package/dist/components/destructive-action-confirmation.js +60 -0
  32. package/dist/components/destructive-confirm-dialog.d.ts +17 -0
  33. package/dist/components/destructive-confirm-dialog.js +49 -0
  34. package/dist/components/dialog.d.ts +37 -0
  35. package/dist/components/dialog.js +92 -0
  36. package/dist/components/directional-icon.d.ts +30 -0
  37. package/dist/components/directional-icon.js +12 -0
  38. package/dist/components/field.d.ts +11 -0
  39. package/dist/components/field.js +34 -0
  40. package/dist/components/form.d.ts +5 -0
  41. package/dist/components/form.js +12 -0
  42. package/dist/components/frame.d.ts +10 -0
  43. package/dist/components/frame.js +35 -0
  44. package/dist/components/hex-color-picker.d.ts +11 -0
  45. package/dist/components/hex-color-picker.js +366 -0
  46. package/dist/components/input-group.d.ts +15 -0
  47. package/dist/components/input-group.js +53 -0
  48. package/dist/components/input-otp.d.ts +13 -0
  49. package/dist/components/input-otp.js +39 -0
  50. package/dist/components/input.d.ts +12 -0
  51. package/dist/components/input.js +46 -0
  52. package/dist/components/label.d.ts +5 -0
  53. package/dist/components/label.js +18 -0
  54. package/dist/components/menu.d.ts +44 -0
  55. package/dist/components/menu.js +152 -0
  56. package/dist/components/outline-rail.d.ts +43 -0
  57. package/dist/components/outline-rail.js +416 -0
  58. package/dist/components/pagination.d.ts +17 -0
  59. package/dist/components/pagination.js +78 -0
  60. package/dist/components/popover.d.ts +34 -0
  61. package/dist/components/popover.js +67 -0
  62. package/dist/components/preview-card.d.ts +12 -0
  63. package/dist/components/preview-card.js +25 -0
  64. package/dist/components/preview-pane.d.ts +23 -0
  65. package/dist/components/preview-pane.js +33 -0
  66. package/dist/components/scroll-area.d.ts +19 -0
  67. package/dist/components/scroll-area.js +38 -0
  68. package/dist/components/scroll-to-top.d.ts +12 -0
  69. package/dist/components/scroll-to-top.js +43 -0
  70. package/dist/components/secret-input.d.ts +9 -0
  71. package/dist/components/secret-input.js +38 -0
  72. package/dist/components/segmented-icon-toggle.d.ts +22 -0
  73. package/dist/components/segmented-icon-toggle.js +30 -0
  74. package/dist/components/select.d.ts +25 -0
  75. package/dist/components/select.js +196 -0
  76. package/dist/components/separator.d.ts +16 -0
  77. package/dist/components/separator.js +26 -0
  78. package/dist/components/sheet.d.ts +29 -0
  79. package/dist/components/sheet.js +87 -0
  80. package/dist/components/skeleton.d.ts +4 -0
  81. package/dist/components/skeleton.js +10 -0
  82. package/dist/components/stella-mark.d.ts +5 -0
  83. package/dist/components/stella-mark.js +12 -0
  84. package/dist/components/stella-wordmark.d.ts +5 -0
  85. package/dist/components/stella-wordmark.js +21 -0
  86. package/dist/components/table.d.ts +20 -0
  87. package/dist/components/table.js +80 -0
  88. package/dist/components/tabs.d.ts +11 -0
  89. package/dist/components/tabs.js +46 -0
  90. package/dist/components/textarea.d.ts +9 -0
  91. package/dist/components/textarea.js +31 -0
  92. package/dist/components/toast.d.ts +60 -0
  93. package/dist/components/toast.js +261 -0
  94. package/dist/components/tooltip-trigger-helper.d.ts +11 -0
  95. package/dist/components/tooltip-trigger-helper.js +14 -0
  96. package/dist/components/tooltip.d.ts +15 -0
  97. package/dist/components/tooltip.js +32 -0
  98. package/dist/data-table/index.d.ts +2 -0
  99. package/dist/data-table/index.js +2 -0
  100. package/dist/data-table/schema.d.ts +70 -0
  101. package/dist/data-table/schema.js +40 -0
  102. package/dist/hooks/use-contained-handler.d.ts +55 -0
  103. package/dist/hooks/use-contained-handler.js +54 -0
  104. package/dist/hooks/use-content-dir.d.ts +48 -0
  105. package/dist/hooks/use-content-dir.js +45 -0
  106. package/dist/hooks/use-mobile.d.ts +4 -0
  107. package/dist/hooks/use-mobile.js +16 -0
  108. package/dist/hooks/use-viewport-width.d.ts +5 -0
  109. package/dist/hooks/use-viewport-width.js +14 -0
  110. package/dist/index.d.ts +67 -0
  111. package/dist/index.js +65 -0
  112. package/dist/inspector/chrome.d.ts +72 -0
  113. package/dist/inspector/chrome.js +153 -0
  114. package/dist/inspector/dock.d.ts +48 -0
  115. package/dist/inspector/dock.js +36 -0
  116. package/dist/inspector/index.d.ts +6 -0
  117. package/dist/inspector/index.js +6 -0
  118. package/dist/inspector/layout-tokens.d.ts +28 -0
  119. package/dist/inspector/layout-tokens.js +28 -0
  120. package/dist/inspector/pane-width.d.ts +64 -0
  121. package/dist/inspector/pane-width.js +53 -0
  122. package/dist/inspector/use-pane-width.d.ts +99 -0
  123. package/dist/inspector/use-pane-width.js +149 -0
  124. package/dist/kanban/card-properties.d.ts +27 -0
  125. package/dist/kanban/card-properties.js +19 -0
  126. package/dist/kanban/card-shell.d.ts +32 -0
  127. package/dist/kanban/card-shell.js +46 -0
  128. package/dist/kanban/column-header.d.ts +23 -0
  129. package/dist/kanban/column-header.js +24 -0
  130. package/dist/kanban/grouping.d.ts +84 -0
  131. package/dist/kanban/grouping.js +76 -0
  132. package/dist/kanban/index.d.ts +5 -0
  133. package/dist/kanban/index.js +5 -0
  134. package/dist/lib/button-disposition.d.ts +63 -0
  135. package/dist/lib/button-disposition.js +52 -0
  136. package/dist/lib/option-color.d.ts +28 -0
  137. package/dist/lib/option-color.js +59 -0
  138. package/dist/lib/overlay-layer.d.ts +22 -0
  139. package/dist/lib/overlay-layer.js +21 -0
  140. package/dist/lib/tab-order.d.ts +15 -0
  141. package/dist/lib/tab-order.js +15 -0
  142. package/dist/lib/tooltip-content.d.ts +13 -0
  143. package/dist/lib/tooltip-content.js +12 -0
  144. package/dist/lib/utils.d.ts +20 -0
  145. package/dist/lib/utils.js +41 -0
  146. package/dist/lib/week.d.ts +25 -0
  147. package/dist/lib/week.js +40 -0
  148. package/dist/styles/theme.css +1209 -0
  149. package/package.json +518 -2
@@ -0,0 +1,366 @@
1
+ "use client";
2
+ import { cn } from "../lib/utils.js";
3
+ import { containedHandler } from "../hooks/use-contained-handler.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { useEffect, useRef, useState } from "react";
6
+ //#region src/components/hex-color-picker.tsx
7
+ /**
8
+ * Hex color picker — saturation/brightness square + hue strip.
9
+ *
10
+ * Adapted from react-colorful (MIT, Copyright 2020 Vlad Shilov).
11
+ * https://github.com/omgovich/react-colorful
12
+ *
13
+ * Changes from upstream:
14
+ * - Trimmed to hex-only (no RGB/HSL/alpha variants)
15
+ * - Dropped React.memo, useMemo, useCallback (React Compiler handles this)
16
+ * - Converted CSS classes to Tailwind
17
+ * - Merged small utility files into one module
18
+ * - Strict TypeScript (no `any`, no enums)
19
+ * - Arrow functions per project conventions
20
+ */
21
+ const clamp = (n, min = 0, max = 1) => (() => {
22
+ if (n > max) return max;
23
+ if (n < min) return min;
24
+ return n;
25
+ })();
26
+ const round = (n, digits = 0) => {
27
+ const base = 10 ** digits;
28
+ return Math.round(base * n) / base;
29
+ };
30
+ const hexToRgba = (hex) => {
31
+ const h = hex.startsWith("#") ? hex.slice(1) : hex;
32
+ if (h.length < 6) {
33
+ const r0 = h.charAt(0);
34
+ const g0 = h.charAt(1);
35
+ const b0 = h.charAt(2);
36
+ return {
37
+ r: Number.parseInt(r0 + r0, 16),
38
+ g: Number.parseInt(g0 + g0, 16),
39
+ b: Number.parseInt(b0 + b0, 16),
40
+ a: 1
41
+ };
42
+ }
43
+ return {
44
+ r: Number.parseInt(h.slice(0, 2), 16),
45
+ g: Number.parseInt(h.slice(2, 4), 16),
46
+ b: Number.parseInt(h.slice(4, 6), 16),
47
+ a: 1
48
+ };
49
+ };
50
+ const rgbaToHsva = ({ r, g, b, a }) => {
51
+ const max = Math.max(r, g, b);
52
+ const delta = max - Math.min(r, g, b);
53
+ const hh = (() => {
54
+ if (delta) return (() => {
55
+ if (max === r) return (g - b) / delta;
56
+ if (max === g) return 2 + (b - r) / delta;
57
+ return 4 + (r - g) / delta;
58
+ })();
59
+ return 0;
60
+ })();
61
+ return {
62
+ h: round(60 * (hh < 0 ? hh + 6 : hh)),
63
+ s: round(max ? delta / max * 100 : 0),
64
+ v: round(max / 255 * 100),
65
+ a
66
+ };
67
+ };
68
+ const hexToHsva = (hex) => rgbaToHsva(hexToRgba(hex));
69
+ const hsvaToRgba = ({ h, s, v, a }) => {
70
+ const hNorm = h / 360 * 6;
71
+ const sNorm = s / 100;
72
+ const vNorm = v / 100;
73
+ const hFloor = Math.floor(hNorm);
74
+ const bVal = vNorm * (1 - sNorm);
75
+ const cVal = vNorm * (1 - (hNorm - hFloor) * sNorm);
76
+ const dVal = vNorm * (1 - (1 - hNorm + hFloor) * sNorm);
77
+ const mod = hFloor % 6;
78
+ const rLookup = [
79
+ vNorm,
80
+ cVal,
81
+ bVal,
82
+ bVal,
83
+ dVal,
84
+ vNorm
85
+ ];
86
+ const gLookup = [
87
+ dVal,
88
+ vNorm,
89
+ vNorm,
90
+ cVal,
91
+ bVal,
92
+ bVal
93
+ ];
94
+ const bLookup = [
95
+ bVal,
96
+ bVal,
97
+ dVal,
98
+ vNorm,
99
+ vNorm,
100
+ cVal
101
+ ];
102
+ return {
103
+ r: round((rLookup[mod] ?? 0) * 255),
104
+ g: round((gLookup[mod] ?? 0) * 255),
105
+ b: round((bLookup[mod] ?? 0) * 255),
106
+ a: round(a, 2)
107
+ };
108
+ };
109
+ const formatHexByte = (n) => {
110
+ const hex = n.toString(16);
111
+ return hex.length < 2 ? `0${hex}` : hex;
112
+ };
113
+ const rgbaToHex = ({ r, g, b }) => `#${formatHexByte(r)}${formatHexByte(g)}${formatHexByte(b)}`;
114
+ const hsvaToHex = (hsva) => rgbaToHex(hsvaToRgba(hsva));
115
+ const hsvaToHsla = ({ h, s, v, a }) => {
116
+ const hh = (200 - s) * v / 100;
117
+ return {
118
+ h: round(h),
119
+ s: round((() => {
120
+ if (hh > 0 && hh < 200) return s * v / 100 / (hh <= 100 ? hh : 200 - hh) * 100;
121
+ return 0;
122
+ })()),
123
+ l: round(hh / 2),
124
+ a: round(a, 2)
125
+ };
126
+ };
127
+ const hsvaToHslString = (hsva) => {
128
+ const { h, s, l } = hsvaToHsla(hsva);
129
+ return `hsl(${h}, ${s}%, ${l}%)`;
130
+ };
131
+ const equalHex = (a, b) => {
132
+ if (a.toLowerCase() === b.toLowerCase()) return true;
133
+ const ra = hexToRgba(a);
134
+ const rb = hexToRgba(b);
135
+ return ra.r === rb.r && ra.g === rb.g && ra.b === rb.b && ra.a === rb.a;
136
+ };
137
+ const useEventCallback = (handler) => {
138
+ const callbackRef = useRef(handler);
139
+ const fn = useRef((value) => {
140
+ callbackRef.current?.(value);
141
+ });
142
+ callbackRef.current = handler;
143
+ return fn.current;
144
+ };
145
+ const useColorManipulation = (color, onChange) => {
146
+ const onChangeCallback = useEventCallback(onChange);
147
+ const [hsva, setHsva] = useState(() => hexToHsva(color));
148
+ const [committedColor, setCommittedColor] = useState(color);
149
+ if (!equalHex(color, committedColor)) {
150
+ setCommittedColor(color);
151
+ setHsva(hexToHsva(color));
152
+ }
153
+ const handleChange = (params) => {
154
+ const next = {
155
+ ...hsva,
156
+ ...params
157
+ };
158
+ setHsva(next);
159
+ const hex = hsvaToHex(next);
160
+ if (!equalHex(hex, committedColor)) {
161
+ setCommittedColor(hex);
162
+ onChangeCallback(hex);
163
+ }
164
+ };
165
+ return [hsva, handleChange];
166
+ };
167
+ const isTouch = (e) => "touches" in e;
168
+ const isMouseMoveEvent = (event) => "buttons" in event && "pageX" in event && "pageY" in event;
169
+ const isMoveEvent = (event) => isMouseMoveEvent(event) || "touches" in event;
170
+ const getTouchPoint = (touches, id) => {
171
+ return Array.from(touches).find((t) => t.identifier === id) ?? touches.item(0);
172
+ };
173
+ const getParentWindow = (node) => node?.ownerDocument.defaultView ?? self;
174
+ const getRelativePosition = (node, event, touchId) => {
175
+ const rect = node.getBoundingClientRect();
176
+ const pointer = isTouch(event) ? getTouchPoint(event.touches, touchId) : event;
177
+ if (!pointer) return null;
178
+ const win = getParentWindow(node);
179
+ return {
180
+ left: clamp((pointer.pageX - (rect.left + win.pageXOffset)) / rect.width),
181
+ top: clamp((pointer.pageY - (rect.top + win.pageYOffset)) / rect.height)
182
+ };
183
+ };
184
+ const InteractiveArea = ({ onMove, onKey, children, ...rest }) => {
185
+ const container = useRef(null);
186
+ const onMoveRef = useEventCallback(onMove);
187
+ const onKeyRef = useEventCallback(onKey);
188
+ const touchId = useRef(null);
189
+ const hasTouch = useRef(false);
190
+ const listenersRef = useRef(null);
191
+ const detachListeners = () => {
192
+ const l = listenersRef.current;
193
+ if (!l) return;
194
+ l.win.removeEventListener(l.moveType, l.handleMove);
195
+ l.win.removeEventListener(l.endType, l.handleEnd);
196
+ listenersRef.current = null;
197
+ };
198
+ const attachListeners = () => {
199
+ detachListeners();
200
+ const win = getParentWindow(container.current);
201
+ const touch = hasTouch.current;
202
+ const moveType = touch ? "touchmove" : "mousemove";
203
+ const endType = touch ? "touchend" : "mouseup";
204
+ const handleMove = (event) => {
205
+ if (!isMoveEvent(event)) {
206
+ detachListeners();
207
+ return;
208
+ }
209
+ if (!isTouch(event)) event.preventDefault();
210
+ if ((isTouch(event) ? event.touches.length > 0 : event.buttons > 0) && container.current) {
211
+ const position = getRelativePosition(container.current, event, touchId.current);
212
+ if (position) onMoveRef(position);
213
+ } else detachListeners();
214
+ };
215
+ const handleEnd = () => detachListeners();
216
+ listenersRef.current = {
217
+ moveType,
218
+ endType,
219
+ handleMove,
220
+ handleEnd,
221
+ win
222
+ };
223
+ win.addEventListener(moveType, handleMove);
224
+ win.addEventListener(endType, handleEnd);
225
+ };
226
+ useEffect(() => detachListeners, []);
227
+ const handleStart = (e) => {
228
+ const el = container.current;
229
+ if (!el) return;
230
+ const native = e.nativeEvent;
231
+ if (!isTouch(native)) native.preventDefault();
232
+ if (hasTouch.current && !isTouch(native)) return;
233
+ if (isTouch(native)) {
234
+ hasTouch.current = true;
235
+ const first = native.changedTouches.item(0);
236
+ if (first) touchId.current = first.identifier;
237
+ }
238
+ el.focus();
239
+ const position = getRelativePosition(el, native, touchId.current);
240
+ if (position) onMoveRef(position);
241
+ attachListeners();
242
+ };
243
+ const handleKeyDown = (e) => {
244
+ const key = e.key;
245
+ if (key !== "ArrowLeft" && key !== "ArrowRight" && key !== "ArrowUp" && key !== "ArrowDown") return;
246
+ e.preventDefault();
247
+ onKeyRef({
248
+ left: (() => {
249
+ if (key === "ArrowRight") return .05;
250
+ if (key === "ArrowLeft") return -.05;
251
+ return 0;
252
+ })(),
253
+ top: (() => {
254
+ if (key === "ArrowDown") return .05;
255
+ if (key === "ArrowUp") return -.05;
256
+ return 0;
257
+ })()
258
+ });
259
+ };
260
+ return /* @__PURE__ */ jsx("div", {
261
+ ...rest,
262
+ className: "absolute inset-0 touch-none rounded-[inherit] outline-none",
263
+ onKeyDown: handleKeyDown,
264
+ onMouseDown: containedHandler(container, handleStart),
265
+ onTouchStart: containedHandler(container, handleStart),
266
+ ref: container,
267
+ role: "slider",
268
+ tabIndex: 0,
269
+ children
270
+ });
271
+ };
272
+ const Pointer = ({ left, top = .5, color }) => /* @__PURE__ */ jsx("div", {
273
+ className: "absolute z-1 size-7 -translate-1/2 rounded-full border-2 border-white shadow-[0_2px_4px_rgba(0,0,0,0.2)]",
274
+ style: {
275
+ top: `${top * 100}%`,
276
+ left: `${left * 100}%`
277
+ },
278
+ children: /* @__PURE__ */ jsx("div", {
279
+ className: "absolute inset-0 rounded-full",
280
+ style: { backgroundColor: color }
281
+ })
282
+ });
283
+ const Saturation = ({ hsva, onChange }) => {
284
+ const handleMove = (interaction) => {
285
+ onChange({
286
+ s: interaction.left * 100,
287
+ v: 100 - interaction.top * 100
288
+ });
289
+ };
290
+ const handleKey = (offset) => {
291
+ onChange({
292
+ s: clamp(hsva.s + offset.left * 100, 0, 100),
293
+ v: clamp(hsva.v - offset.top * 100, 0, 100)
294
+ });
295
+ };
296
+ return /* @__PURE__ */ jsx("div", {
297
+ className: "relative grow rounded-t-lg border-b-[12px] border-b-black shadow-[inset_0_0_0_1px_rgba(0,0,0,0.05)]",
298
+ style: {
299
+ backgroundColor: hsvaToHslString({
300
+ h: hsva.h,
301
+ s: 100,
302
+ v: 100,
303
+ a: 1
304
+ }),
305
+ backgroundImage: "linear-gradient(to top, #000, rgba(0,0,0,0)), linear-gradient(to right, #fff, rgba(255,255,255,0))"
306
+ },
307
+ children: /* @__PURE__ */ jsx(InteractiveArea, {
308
+ "aria-label": "Color",
309
+ "aria-valuemax": 100,
310
+ "aria-valuemin": 0,
311
+ "aria-valuenow": round(hsva.s),
312
+ "aria-valuetext": `Saturation ${round(hsva.s)}%, Brightness ${round(hsva.v)}%`,
313
+ onKey: handleKey,
314
+ onMove: handleMove,
315
+ children: /* @__PURE__ */ jsx(Pointer, {
316
+ color: hsvaToHslString(hsva),
317
+ left: hsva.s / 100,
318
+ top: 1 - hsva.v / 100
319
+ })
320
+ })
321
+ });
322
+ };
323
+ const HueStrip = ({ hue, onChange }) => {
324
+ const handleMove = (interaction) => {
325
+ onChange({ h: 360 * interaction.left });
326
+ };
327
+ const handleKey = (offset) => {
328
+ onChange({ h: clamp(hue + offset.left * 360, 0, 360) });
329
+ };
330
+ return /* @__PURE__ */ jsx("div", {
331
+ className: "relative h-6 rounded-b-lg",
332
+ style: { background: "linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)" },
333
+ children: /* @__PURE__ */ jsx(InteractiveArea, {
334
+ "aria-label": "Hue",
335
+ "aria-valuemax": 360,
336
+ "aria-valuemin": 0,
337
+ "aria-valuenow": round(hue),
338
+ onKey: handleKey,
339
+ onMove: handleMove,
340
+ children: /* @__PURE__ */ jsx(Pointer, {
341
+ color: hsvaToHslString({
342
+ h: hue,
343
+ s: 100,
344
+ v: 100,
345
+ a: 1
346
+ }),
347
+ left: hue / 360
348
+ })
349
+ })
350
+ });
351
+ };
352
+ const HexColorPicker = ({ color = "000000", onChange, className }) => {
353
+ const [hsva, updateHsva] = useColorManipulation(color, onChange);
354
+ return /* @__PURE__ */ jsxs("div", {
355
+ className: cn("relative flex h-[200px] w-[200px] cursor-default flex-col select-none", className),
356
+ children: [/* @__PURE__ */ jsx(Saturation, {
357
+ hsva,
358
+ onChange: updateHsva
359
+ }), /* @__PURE__ */ jsx(HueStrip, {
360
+ hue: hsva.h,
361
+ onChange: updateHsva
362
+ })]
363
+ });
364
+ };
365
+ //#endregion
366
+ export { HexColorPicker };
@@ -0,0 +1,15 @@
1
+ import { InputProps } from "./input.js";
2
+ import { TextareaProps } from "./textarea.js";
3
+ import { VariantProps } from "class-variance-authority";
4
+ import * as React$1 from "react";
5
+ //#region src/components/input-group.d.ts
6
+ declare const InputGroup: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
7
+ declare const inputGroupAddonVariants: (props?: ({
8
+ align?: "inline-end" | "inline-start" | "block-end" | "block-start" | null | undefined;
9
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
+ declare const InputGroupAddon: ({ className, align, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) => React$1.JSX.Element;
11
+ declare const InputGroupText: ({ className, ...props }: React$1.ComponentProps<"span">) => React$1.JSX.Element;
12
+ declare const InputGroupInput: ({ className, ...props }: InputProps) => React$1.JSX.Element;
13
+ declare const InputGroupTextarea: ({ className, ...props }: TextareaProps) => React$1.JSX.Element;
14
+ //#endregion
15
+ export { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputGroupTextarea };
@@ -0,0 +1,53 @@
1
+ "use client";
2
+ import { cn } from "../lib/utils.js";
3
+ import { Input } from "./input.js";
4
+ import { Textarea } from "./textarea.js";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { cva } from "class-variance-authority";
7
+ //#region src/components/input-group.tsx
8
+ const InputGroup = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
9
+ className: cn("border-input bg-background text-foreground ring-ring/24 has-autofill:bg-foreground/4 has-[input:focus-visible,textarea:focus-visible]:border-ring has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/36 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/16 dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/24 relative inline-flex w-full min-w-0 items-center rounded-lg border text-base shadow-xs/5 transition-shadow not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_1px_--theme(--color-black/4%)] has-data-[align=block-end]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:h-auto has-data-[align=block-start]:flex-col has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid],textarea[aria-invalid]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] has-[textarea]:h-auto sm:text-sm dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_-1px_--theme(--color-white/6%)] has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=inline-start]:**:[input]:ps-2 has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto **:[textarea_button]:rounded-[calc(var(--radius-md)-1px)] **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5", className),
10
+ "data-slot": "input-group",
11
+ role: "group",
12
+ ...props
13
+ });
14
+ const inputGroupAddonVariants = cva("flex h-auto cursor-text items-center justify-center gap-2 leading-none select-none [&_svg]:-mx-0.5 in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80 [&>kbd]:rounded-[calc(var(--radius)-5px)]", {
15
+ defaultVariants: { align: "inline-start" },
16
+ variants: { align: {
17
+ "block-end": "order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]",
18
+ "block-start": "order-first w-full justify-start px-[calc(--spacing(3)-1px)] pt-[calc(--spacing(3)-1px)] [.border-b]:pb-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]",
19
+ "inline-end": "order-last pe-[calc(--spacing(3)-1px)] has-[>:last-child[data-slot=badge]]:-me-1.5 has-[>button]:-me-2 has-[>kbd:last-child]:me-[-0.35rem] [[data-size=sm]+&]:pe-[calc(--spacing(2.5)-1px)]",
20
+ "inline-start": "order-first ps-[calc(--spacing(3)-1px)] has-[>:last-child[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 has-[>kbd:last-child]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]"
21
+ } }
22
+ });
23
+ const InputGroupAddon = ({ className, align = "inline-start", ...props }) => /* @__PURE__ */ jsx("div", {
24
+ className: cn(inputGroupAddonVariants({ align }), className),
25
+ "data-align": align,
26
+ "data-slot": "input-group-addon",
27
+ onMouseDown: (e) => {
28
+ const { target } = e;
29
+ if (!(target instanceof Element)) return;
30
+ if (target.closest("button, a, input, select, textarea, [role='button'], [role='combobox'], [role='listbox'], [data-slot='select-trigger']")) return;
31
+ e.preventDefault();
32
+ const parent = e.currentTarget.parentElement;
33
+ const input = parent?.querySelector("input, textarea");
34
+ if (input && !parent?.querySelector("input:focus, textarea:focus")) input.focus();
35
+ },
36
+ ...props
37
+ });
38
+ const InputGroupText = ({ className, ...props }) => /* @__PURE__ */ jsx("span", {
39
+ className: cn("text-muted-foreground line-clamp-1 flex items-center gap-2 leading-none [&_svg]:pointer-events-none [&_svg]:-mx-0.5 in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4", className),
40
+ ...props
41
+ });
42
+ const InputGroupInput = ({ className, ...props }) => /* @__PURE__ */ jsx(Input, {
43
+ className,
44
+ unstyled: true,
45
+ ...props
46
+ });
47
+ const InputGroupTextarea = ({ className, ...props }) => /* @__PURE__ */ jsx(Textarea, {
48
+ className,
49
+ unstyled: true,
50
+ ...props
51
+ });
52
+ //#endregion
53
+ export { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputGroupTextarea };
@@ -0,0 +1,13 @@
1
+ import * as React$1 from "react";
2
+ import { OTPInput } from "input-otp";
3
+ //#region src/components/input-otp.d.ts
4
+ declare const InputOTP: ({ className, containerClassName, ...props }: React$1.ComponentProps<typeof OTPInput> & {
5
+ containerClassName?: string;
6
+ }) => React$1.JSX.Element;
7
+ declare const InputOTPGroup: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
8
+ declare const InputOTPSlot: ({ index, className, ...props }: React$1.ComponentProps<"div"> & {
9
+ index: number;
10
+ }) => React$1.JSX.Element;
11
+ declare const InputOTPSeparator: ({ ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
12
+ //#endregion
13
+ export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { cn } from "../lib/utils.js";
3
+ import { MinusIcon } from "lucide-react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import * as React$1 from "react";
6
+ import { OTPInput, OTPInputContext } from "input-otp";
7
+ //#region src/components/input-otp.tsx
8
+ const InputOTP = ({ className, containerClassName, ...props }) => /* @__PURE__ */ jsx(OTPInput, {
9
+ className: cn("disabled:cursor-not-allowed", className),
10
+ containerClassName: cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName),
11
+ "data-slot": "input-otp",
12
+ ...props
13
+ });
14
+ const InputOTPGroup = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
15
+ className: cn("flex items-center", className),
16
+ "data-slot": "input-otp-group",
17
+ ...props
18
+ });
19
+ const InputOTPSlot = ({ index, className, ...props }) => {
20
+ const { char, hasFakeCaret, isActive } = React$1.use(OTPInputContext).slots[index] ?? {};
21
+ return /* @__PURE__ */ jsxs("div", {
22
+ className: cn("border-input aria-invalid:border-destructive data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40 relative flex h-9 w-9 items-center justify-center border-y border-e text-sm shadow-xs transition-[border-color,outline] outline-none first:rounded-s-md first:border-s last:rounded-e-md data-[active=true]:z-10 data-[active=true]:ring-[3px]", className),
23
+ "data-active": isActive,
24
+ "data-slot": "input-otp-slot",
25
+ ...props,
26
+ children: [char, hasFakeCaret && /* @__PURE__ */ jsx("div", {
27
+ className: "pointer-events-none absolute inset-0 flex items-center justify-center",
28
+ children: /* @__PURE__ */ jsx("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" })
29
+ })]
30
+ });
31
+ };
32
+ const InputOTPSeparator = ({ ...props }) => /* @__PURE__ */ jsx("div", {
33
+ "data-slot": "input-otp-separator",
34
+ role: "separator",
35
+ ...props,
36
+ children: /* @__PURE__ */ jsx(MinusIcon, {})
37
+ });
38
+ //#endregion
39
+ export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
@@ -0,0 +1,12 @@
1
+ import * as React$1 from "react";
2
+ import { Input as Input$1 } from "@base-ui/react/input";
3
+ //#region src/components/input.d.ts
4
+ type InputProps = Omit<Input$1.Props & React$1.RefAttributes<HTMLInputElement>, "size" | "style"> & {
5
+ size?: "sm" | "default" | "lg" | number;
6
+ style?: React$1.CSSProperties;
7
+ unstyled?: boolean;
8
+ nativeInput?: boolean;
9
+ };
10
+ declare const Input: ({ className, size, unstyled, nativeInput, dir, onChange, ...props }: InputProps) => React$1.JSX.Element;
11
+ //#endregion
12
+ export { Input, type InputProps };
@@ -0,0 +1,46 @@
1
+ "use client";
2
+ import { cn } from "../lib/utils.js";
3
+ import { isStructuredInputType, useContentDir } from "../hooks/use-content-dir.js";
4
+ import { SearchIcon } from "lucide-react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Input as Input$1 } from "@base-ui/react/input";
7
+ //#region src/components/input.tsx
8
+ const Input = ({ className, size = "default", unstyled = false, nativeInput = false, dir, onChange, ...props }) => {
9
+ const contentDir = useContentDir({
10
+ dir: dir ?? (isStructuredInputType(props.type) ? "ltr" : void 0),
11
+ value: props.value,
12
+ defaultValue: props.defaultValue
13
+ });
14
+ const handleChange = (event) => {
15
+ contentDir.trackValue(event.currentTarget.value);
16
+ onChange?.(event);
17
+ };
18
+ const inputClassName = cn("placeholder:text-foreground-placeholder h-8.5 w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] leading-8.5 outline-none [transition:background-color_5000000s_ease-in-out_0s] sm:h-7.5 sm:leading-7.5", size === "sm" && "h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5", size === "lg" && "h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5", props.type === "search" && "ps-8 [&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none", props.type === "file" && "text-muted-foreground file:text-foreground file:me-3 file:bg-transparent file:text-sm file:font-medium");
19
+ return /* @__PURE__ */ jsxs("span", {
20
+ className: cn(!unstyled && "border-input bg-background text-foreground ring-ring/24 has-autofill:bg-foreground/4 has-focus-visible:border-ring has-aria-invalid:border-destructive/36 has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 relative inline-flex w-full rounded-lg border text-base shadow-xs/5 transition-shadow not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:ring-[3px] has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none sm:text-sm dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]", className) || void 0,
21
+ "data-size": size,
22
+ "data-slot": "input-control",
23
+ dir: contentDir.dir,
24
+ children: [props.type === "search" && /* @__PURE__ */ jsx(SearchIcon, {
25
+ "aria-hidden": "true",
26
+ className: "text-muted-foreground pointer-events-none absolute start-2.5 top-1/2 z-1 size-3.5 -translate-y-1/2",
27
+ "data-slot": "input-search-icon"
28
+ }), nativeInput ? /* @__PURE__ */ jsx("input", {
29
+ className: inputClassName,
30
+ "data-slot": "input",
31
+ size: typeof size === "number" ? size : void 0,
32
+ ...props,
33
+ dir: contentDir.dir,
34
+ onChange: handleChange
35
+ }) : /* @__PURE__ */ jsx(Input$1, {
36
+ className: inputClassName,
37
+ "data-slot": "input",
38
+ size: typeof size === "number" ? size : void 0,
39
+ ...props,
40
+ dir: contentDir.dir,
41
+ onChange: handleChange
42
+ })]
43
+ });
44
+ };
45
+ //#endregion
46
+ export { Input };
@@ -0,0 +1,5 @@
1
+ import { useRender } from "@base-ui/react/use-render";
2
+ //#region src/components/label.d.ts
3
+ declare function Label({ className, render, ...props }: useRender.ComponentProps<"label">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
4
+ //#endregion
5
+ export { Label };
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import { cn } from "../lib/utils.js";
3
+ import { mergeProps } from "@base-ui/react/merge-props";
4
+ import { useRender } from "@base-ui/react/use-render";
5
+ //#region src/components/label.tsx
6
+ function Label({ className, render, ...props }) {
7
+ const defaultProps = {
8
+ className: cn("text-foreground inline-flex items-center gap-2 text-base/4.5 font-medium sm:text-sm/4", className),
9
+ "data-slot": "label"
10
+ };
11
+ return useRender({
12
+ defaultTagName: "label",
13
+ props: mergeProps(defaultProps, props),
14
+ render
15
+ });
16
+ }
17
+ //#endregion
18
+ export { Label };
@@ -0,0 +1,44 @@
1
+ import * as React$1 from "react";
2
+ import { Menu as Menu$1 } from "@base-ui/react/menu";
3
+ //#region src/components/menu.d.ts
4
+ declare const MenuCreateHandle: typeof Menu$1.createHandle;
5
+ declare const Menu: <Payload>(props: Menu$1.Root.Props<Payload>) => import("react/jsx-runtime").JSX.Element;
6
+ declare const MenuPortal: React$1.ForwardRefExoticComponent<Omit<import("@base-ui/react").ContextMenuPortalProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
7
+ declare function MenuTrigger({ tooltip, ...props }: Menu$1.Trigger.Props & {
8
+ tooltip?: React$1.ReactNode;
9
+ }): React$1.JSX.Element;
10
+ declare const MenuPopup: ({ children, className, sideOffset, align, alignOffset, side, anchor, ...props }: Menu$1.Popup.Props & {
11
+ align?: Menu$1.Positioner.Props["align"];
12
+ sideOffset?: Menu$1.Positioner.Props["sideOffset"];
13
+ alignOffset?: Menu$1.Positioner.Props["alignOffset"];
14
+ side?: Menu$1.Positioner.Props["side"];
15
+ anchor?: Menu$1.Positioner.Props["anchor"];
16
+ }) => React$1.JSX.Element;
17
+ declare const MenuGroup: (props: Menu$1.Group.Props) => React$1.JSX.Element;
18
+ declare const MenuItem: ({ className, inset, variant, ...props }: Menu$1.Item.Props & {
19
+ inset?: boolean;
20
+ variant?: "default" | "destructive";
21
+ }) => React$1.JSX.Element;
22
+ declare const MenuCheckboxItem: ({ className, children, checked, variant, ...props }: Menu$1.CheckboxItem.Props & {
23
+ variant?: "default" | "switch";
24
+ }) => React$1.JSX.Element;
25
+ declare const MenuRadioGroup: (props: Menu$1.RadioGroup.Props) => React$1.JSX.Element;
26
+ declare const MenuRadioItem: ({ className, children, indicator, ...props }: Menu$1.RadioItem.Props & {
27
+ indicator?: "check" | "none";
28
+ }) => React$1.JSX.Element;
29
+ declare const MenuGroupLabel: ({ className, inset, ...props }: Menu$1.GroupLabel.Props & {
30
+ inset?: boolean;
31
+ }) => React$1.JSX.Element;
32
+ declare const MenuSeparator: ({ className, ...props }: Menu$1.Separator.Props) => React$1.JSX.Element;
33
+ declare const MenuShortcut: ({ className, ...props }: React$1.ComponentProps<"kbd">) => React$1.JSX.Element;
34
+ declare const MenuSub: (props: Menu$1.SubmenuRoot.Props) => React$1.JSX.Element;
35
+ declare const MenuSubTrigger: ({ className, inset, children, ...props }: Menu$1.SubmenuTrigger.Props & {
36
+ inset?: boolean;
37
+ }) => React$1.JSX.Element;
38
+ declare const MenuSubPopup: ({ className, sideOffset, alignOffset, align, ...props }: Menu$1.Popup.Props & {
39
+ align?: Menu$1.Positioner.Props["align"];
40
+ sideOffset?: Menu$1.Positioner.Props["sideOffset"];
41
+ alignOffset?: Menu$1.Positioner.Props["alignOffset"];
42
+ }) => React$1.JSX.Element;
43
+ //#endregion
44
+ export { Menu as DropdownMenu, Menu, MenuCheckboxItem as DropdownMenuCheckboxItem, MenuCheckboxItem, MenuPopup as DropdownMenuContent, MenuPopup, MenuCreateHandle as DropdownMenuCreateHandle, MenuCreateHandle, MenuGroup as DropdownMenuGroup, MenuGroup, MenuItem as DropdownMenuItem, MenuItem, MenuGroupLabel as DropdownMenuLabel, MenuGroupLabel, MenuPortal as DropdownMenuPortal, MenuPortal, MenuRadioGroup as DropdownMenuRadioGroup, MenuRadioGroup, MenuRadioItem as DropdownMenuRadioItem, MenuRadioItem, MenuSeparator as DropdownMenuSeparator, MenuSeparator, MenuShortcut as DropdownMenuShortcut, MenuShortcut, MenuSub as DropdownMenuSub, MenuSub, MenuSubPopup as DropdownMenuSubContent, MenuSubPopup, MenuSubTrigger as DropdownMenuSubTrigger, MenuSubTrigger, MenuTrigger as DropdownMenuTrigger, MenuTrigger };