@stoa-dev/kit 1.1.1 → 1.2.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 (43) hide show
  1. package/README.md +2 -2
  2. package/dist/i18n/locales/at.json.js +7 -3
  3. package/dist/i18n/locales/at.json.js.map +1 -1
  4. package/dist/i18n/locales/de.json.js +10 -6
  5. package/dist/i18n/locales/de.json.js.map +1 -1
  6. package/dist/i18n/locales/en.json.js +14 -10
  7. package/dist/i18n/locales/en.json.js.map +1 -1
  8. package/dist/i18n/locales/it.json.js +7 -3
  9. package/dist/i18n/locales/it.json.js.map +1 -1
  10. package/dist/kit.css +1 -1
  11. package/dist/shell/ScrollToTop/index.js +80 -0
  12. package/dist/shell/ScrollToTop/index.js.map +1 -0
  13. package/dist/shell/index.js +34 -32
  14. package/dist/shell/index.js.map +1 -1
  15. package/dist/types/i18n/index.d.ts +116 -0
  16. package/dist/types/i18n/index.d.ts.map +1 -1
  17. package/dist/types/shell/ScrollToTop/index.d.ts +17 -0
  18. package/dist/types/shell/ScrollToTop/index.d.ts.map +1 -0
  19. package/dist/types/shell/index.d.ts +1 -0
  20. package/dist/types/shell/index.d.ts.map +1 -1
  21. package/dist/types/ui/audio-player/index.d.ts +30 -0
  22. package/dist/types/ui/audio-player/index.d.ts.map +1 -0
  23. package/dist/types/ui/file-viewer/index.d.ts +31 -0
  24. package/dist/types/ui/file-viewer/index.d.ts.map +1 -0
  25. package/dist/types/ui/index.d.ts +2 -0
  26. package/dist/types/ui/index.d.ts.map +1 -1
  27. package/dist/types/ui/input/index.d.ts.map +1 -1
  28. package/dist/ui/audio-player/AudioPlayer.module.scss.js +60 -0
  29. package/dist/ui/audio-player/AudioPlayer.module.scss.js.map +1 -0
  30. package/dist/ui/audio-player/index.js +323 -0
  31. package/dist/ui/audio-player/index.js.map +1 -0
  32. package/dist/ui/file-viewer/FileViewer.module.scss.js +56 -0
  33. package/dist/ui/file-viewer/FileViewer.module.scss.js.map +1 -0
  34. package/dist/ui/file-viewer/index.js +251 -0
  35. package/dist/ui/file-viewer/index.js.map +1 -0
  36. package/dist/ui/index.js +119 -114
  37. package/dist/ui/index.js.map +1 -1
  38. package/dist/ui/input/index.js +22 -21
  39. package/dist/ui/input/index.js.map +1 -1
  40. package/dist/ui/textarea/index.js +1 -1
  41. package/dist/ui/textarea/index.js.map +1 -1
  42. package/package.json +1 -1
  43. package/styles/instrument.css +3 -2
@@ -0,0 +1,251 @@
1
+ import { jsxs as l, jsx as e, Fragment as X } from "react/jsx-runtime";
2
+ import { ChevronLeft as q, ChevronRight as G, Minus as J, Plus as Q } from "lucide-react";
3
+ import { useId as U, useRef as Y, useState as N, useEffect as ee } from "react";
4
+ import { useTranslation as ie } from "react-i18next";
5
+ import { STOA_NS as te } from "../../i18n/namespace.js";
6
+ import { cn as ae } from "../../utils/cn.js";
7
+ import i from "./FileViewer.module.scss.js";
8
+ const re = [
9
+ 0.25,
10
+ 0.5,
11
+ 0.75,
12
+ 1,
13
+ 1.5,
14
+ 2,
15
+ 3,
16
+ 4
17
+ ], o = re, le = 12;
18
+ function ne(r) {
19
+ let c = 0;
20
+ for (let u = 1; u < o.length; u += 1)
21
+ Math.abs(o[u] - r) < Math.abs(o[c] - r) && (c = u);
22
+ return c;
23
+ }
24
+ const S = (r) => String(r).padStart(2, "0");
25
+ function he({
26
+ src: r,
27
+ name: c,
28
+ kind: u,
29
+ description: E,
30
+ index: m = 0,
31
+ count: d = 1,
32
+ onIndexChange: O,
33
+ errorMessage: R,
34
+ footer: T,
35
+ onError: D,
36
+ className: L
37
+ }) {
38
+ const { t: a } = ie(te), $ = U(), A = Y(null), [M, W] = N(!1), [s, h] = N(null), [p, _] = N(0), [P, F] = N(1), [j, B] = N(r);
39
+ r !== j && (B(r), W(!1), h(null), _(0), F(1));
40
+ const I = u ?? (/\.pdf$/i.test(c) ? "pdf" : "image"), v = I === "pdf", f = r !== null && !M, w = d > 1 && !!O;
41
+ function y(t) {
42
+ w && O?.((m + t + d) % d);
43
+ }
44
+ ee(() => {
45
+ const t = A.current;
46
+ if (s !== null || !t || !p) return;
47
+ const n = () => F(t.clientWidth / p);
48
+ n();
49
+ const b = new ResizeObserver(n);
50
+ return b.observe(t), () => b.disconnect();
51
+ }, [s, p]);
52
+ const k = () => s ?? P;
53
+ function V(t) {
54
+ const n = k(), b = t > 0 ? o.find((C) => C > n + 1e-3) : [...o].reverse().find((C) => C < n - 1e-3);
55
+ b !== void 0 && h(b);
56
+ }
57
+ function Z() {
58
+ W(!0), D?.();
59
+ }
60
+ function H(t) {
61
+ if (!t.target.closest("input, textarea, select"))
62
+ if (t.key === "ArrowLeft" && w)
63
+ t.preventDefault(), y(-1);
64
+ else if (t.key === "ArrowRight" && w)
65
+ t.preventDefault(), y(1);
66
+ else {
67
+ if (v || !f) return;
68
+ t.key === "+" || t.key === "=" ? V(1) : t.key === "-" ? V(-1) : t.key === "0" && h(null);
69
+ }
70
+ }
71
+ const g = ne(f ? k() : 1), x = `${Math.round((s ?? k()) * 100)} %`, K = [a(v ? "fileViewer.pdf" : "fileViewer.image")], z = a("fileViewer.position", { current: m + 1, count: d });
72
+ return /* @__PURE__ */ l(
73
+ "section",
74
+ {
75
+ className: ae(i.viewer, L),
76
+ "data-slot": "file-viewer",
77
+ "data-kind": I,
78
+ "data-zoomed": s !== null || void 0,
79
+ "aria-labelledby": `${$}-title`,
80
+ onKeyDown: H,
81
+ children: [
82
+ /* @__PURE__ */ l("header", { className: i.header, children: [
83
+ /* @__PURE__ */ l("div", { className: i.heading, children: [
84
+ /* @__PURE__ */ e(
85
+ "h2",
86
+ {
87
+ id: `${$}-title`,
88
+ className: "truncate font-heading text-2xl leading-snug font-semibold tracking-tight",
89
+ children: c || a("fileViewer.title")
90
+ }
91
+ ),
92
+ /* @__PURE__ */ l("p", { className: i.caption, children: [
93
+ K,
94
+ E && /* @__PURE__ */ l(X, { children: [
95
+ " · ",
96
+ E
97
+ ] })
98
+ ] })
99
+ ] }),
100
+ d > 1 && /* @__PURE__ */ l("span", { className: i.index, title: z, children: [
101
+ /* @__PURE__ */ e("span", { className: "sr-only", children: z }),
102
+ /* @__PURE__ */ l("span", { "aria-hidden": "true", children: [
103
+ S(m + 1),
104
+ " / ",
105
+ S(d)
106
+ ] })
107
+ ] })
108
+ ] }),
109
+ /* @__PURE__ */ l("div", { className: i.stage, children: [
110
+ /* @__PURE__ */ l("div", { className: i.marks, "aria-hidden": "true", children: [
111
+ /* @__PURE__ */ e("i", { "data-corner": "tl" }),
112
+ /* @__PURE__ */ e("i", { "data-corner": "tr" }),
113
+ /* @__PURE__ */ e("i", { "data-corner": "bl" }),
114
+ /* @__PURE__ */ e("i", { "data-corner": "br" }),
115
+ /* @__PURE__ */ e("i", { "data-edge": "top" }),
116
+ /* @__PURE__ */ e("i", { "data-edge": "bottom" }),
117
+ /* @__PURE__ */ e("i", { "data-edge": "left" }),
118
+ /* @__PURE__ */ e("i", { "data-edge": "right" }),
119
+ /* @__PURE__ */ e("i", { "data-center": "" })
120
+ ] }),
121
+ /* @__PURE__ */ e("div", { className: i.viewport, children: M ? /* @__PURE__ */ e("p", { className: i.error, role: "alert", children: R ?? a("fileViewer.error") }) : r === null ? /* @__PURE__ */ e("p", { className: i.loading, role: "status", children: a("fileViewer.loading") }) : v ? /* @__PURE__ */ e("iframe", { src: r, title: c, className: i.pdf }, r) : /* @__PURE__ */ e("div", { className: i.canvas, children: /* @__PURE__ */ e(
122
+ "img",
123
+ {
124
+ ref: A,
125
+ src: r,
126
+ alt: c,
127
+ className: i.image,
128
+ style: s === null || !p ? void 0 : {
129
+ width: p * s,
130
+ maxWidth: "none",
131
+ maxHeight: "none"
132
+ },
133
+ onLoad: (t) => _(t.currentTarget.naturalWidth),
134
+ onError: Z
135
+ },
136
+ r
137
+ ) }) })
138
+ ] }),
139
+ /* @__PURE__ */ l("div", { className: i.controls, children: [
140
+ w && /* @__PURE__ */ l("div", { className: i.paging, children: [
141
+ /* @__PURE__ */ e(
142
+ "button",
143
+ {
144
+ type: "button",
145
+ className: i.round,
146
+ "aria-label": a("fileViewer.previous"),
147
+ title: a("fileViewer.previous"),
148
+ onClick: () => y(-1),
149
+ children: /* @__PURE__ */ e(q, {})
150
+ }
151
+ ),
152
+ d <= le ? /* @__PURE__ */ e("ol", { className: i.dots, "aria-label": z, children: Array.from({ length: d }, (t, n) => /* @__PURE__ */ e(
153
+ "li",
154
+ {
155
+ "aria-current": n === m ? "true" : void 0
156
+ },
157
+ n
158
+ )) }) : /* @__PURE__ */ l("span", { className: i.counter, "aria-hidden": "true", children: [
159
+ S(m + 1),
160
+ " / ",
161
+ S(d)
162
+ ] }),
163
+ /* @__PURE__ */ e(
164
+ "button",
165
+ {
166
+ type: "button",
167
+ className: i.round,
168
+ "aria-label": a("fileViewer.next"),
169
+ title: a("fileViewer.next"),
170
+ onClick: () => y(1),
171
+ children: /* @__PURE__ */ e(G, {})
172
+ }
173
+ )
174
+ ] }),
175
+ !v && /* @__PURE__ */ l("div", { className: i.zoom, children: [
176
+ /* @__PURE__ */ e(
177
+ "button",
178
+ {
179
+ type: "button",
180
+ className: i.round,
181
+ disabled: !f || g === 0,
182
+ "aria-label": a("fileViewer.zoomOut"),
183
+ title: a("fileViewer.zoomOut"),
184
+ onClick: () => V(-1),
185
+ children: /* @__PURE__ */ e(J, {})
186
+ }
187
+ ),
188
+ /* @__PURE__ */ l("div", { className: i.scale, children: [
189
+ /* @__PURE__ */ e(
190
+ "input",
191
+ {
192
+ className: i.slider,
193
+ type: "range",
194
+ min: 0,
195
+ max: o.length - 1,
196
+ step: 1,
197
+ value: g,
198
+ disabled: !f,
199
+ "aria-label": a("fileViewer.zoom"),
200
+ "aria-valuetext": s === null ? `${a("fileViewer.fit")} (${x})` : x,
201
+ style: {
202
+ "--progress": `${g / (o.length - 1) * 100}%`
203
+ },
204
+ onChange: (t) => h(o[t.currentTarget.valueAsNumber])
205
+ }
206
+ ),
207
+ /* @__PURE__ */ e("div", { className: i.ruler, "aria-hidden": "true", children: o.map((t, n) => /* @__PURE__ */ e(
208
+ "i",
209
+ {
210
+ "data-major": t === 1 || void 0,
211
+ "data-passed": n <= g || void 0
212
+ },
213
+ t
214
+ )) })
215
+ ] }),
216
+ /* @__PURE__ */ e(
217
+ "button",
218
+ {
219
+ type: "button",
220
+ className: i.round,
221
+ disabled: !f || g === o.length - 1,
222
+ "aria-label": a("fileViewer.zoomIn"),
223
+ title: a("fileViewer.zoomIn"),
224
+ onClick: () => V(1),
225
+ children: /* @__PURE__ */ e(Q, {})
226
+ }
227
+ ),
228
+ /* @__PURE__ */ e("span", { className: i.readout, "aria-hidden": "true", children: x }),
229
+ /* @__PURE__ */ e(
230
+ "button",
231
+ {
232
+ type: "button",
233
+ className: i.fit,
234
+ disabled: !f,
235
+ "aria-pressed": s === null,
236
+ onClick: () => h(s === null ? 1 : null),
237
+ children: a("fileViewer.fit")
238
+ }
239
+ )
240
+ ] })
241
+ ] }),
242
+ T && /* @__PURE__ */ e("footer", { className: i.footer, children: T })
243
+ ]
244
+ }
245
+ );
246
+ }
247
+ export {
248
+ re as FILE_VIEWER_ZOOM_STEPS,
249
+ he as FileViewer
250
+ };
251
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/ui/file-viewer/index.tsx"],"sourcesContent":["'use client'\n\nimport { ChevronLeft, ChevronRight, Minus, Plus } from 'lucide-react'\nimport {\n\ttype CSSProperties,\n\ttype KeyboardEvent,\n\ttype ReactNode,\n\tuseEffect,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { STOA_NS } from '../../i18n/namespace'\nimport { cn } from '../../utils/cn'\nimport styles from './FileViewer.module.scss'\n\nexport type FileViewerKind = 'image' | 'pdf'\n\nexport interface FileViewerProps {\n\t/** File URL; `null` while the app is still resolving it. */\n\tsrc: string | null\n\t/** File name: heading, alt text and the source of the default `kind`. */\n\tname: string\n\t/** Defaults to `pdf` for `*.pdf` names, otherwise `image`. */\n\tkind?: FileViewerKind\n\t/** Extra caption next to the kind, e.g. the file size. */\n\tdescription?: ReactNode\n\t/** Position in a collection (0-based) for paging. */\n\tindex?: number\n\tcount?: number\n\tonIndexChange?: (index: number) => void\n\t/** Shown instead of the default message when the file cannot be displayed. */\n\terrorMessage?: ReactNode\n\t/** Extra actions below the controls, e.g. \"open in default app\". */\n\tfooter?: ReactNode\n\tonError?: () => void\n\tclassName?: string\n}\n\n/** Zoom stops of the scale; `null` (fit) sits outside the scale. */\nexport const FILE_VIEWER_ZOOM_STEPS = [\n\t0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4,\n] as const\nconst STEPS = FILE_VIEWER_ZOOM_STEPS\nconst DOTS_MAX = 12\n\nfunction nearestStep(scale: number) {\n\tlet best = 0\n\tfor (let index = 1; index < STEPS.length; index += 1)\n\t\tif (Math.abs(STEPS[index] - scale) < Math.abs(STEPS[best] - scale))\n\t\t\tbest = index\n\treturn best\n}\n\nconst pad = (value: number) => String(value).padStart(2, '0')\n\n/**\n * In-app viewer for images and PDFs in the instrument style: a stage with\n * viewfinder marks, a straight zoom scale, and paging through a collection.\n * PDFs use the webview's own PDF viewer (pages, scrolling, zoom).\n */\nexport function FileViewer({\n\tsrc,\n\tname,\n\tkind,\n\tdescription,\n\tindex = 0,\n\tcount = 1,\n\tonIndexChange,\n\terrorMessage,\n\tfooter,\n\tonError,\n\tclassName,\n}: FileViewerProps) {\n\tconst { t } = useTranslation(STOA_NS)\n\tconst id = useId()\n\tconst image = useRef<HTMLImageElement>(null)\n\tconst [failed, setFailed] = useState(false)\n\t// `null` fits the image into the stage.\n\tconst [zoom, setZoom] = useState<number | null>(null)\n\tconst [naturalWidth, setNaturalWidth] = useState(0)\n\t// The scale the fitted image is shown at, measured from the layout.\n\tconst [fitScale, setFitScale] = useState(1)\n\n\t// A new file starts fitted (reset during render, no extra effect).\n\tconst [previousSrc, setPreviousSrc] = useState(src)\n\tif (src !== previousSrc) {\n\t\tsetPreviousSrc(src)\n\t\tsetFailed(false)\n\t\tsetZoom(null)\n\t\tsetNaturalWidth(0)\n\t\tsetFitScale(1)\n\t}\n\n\tconst type: FileViewerKind = kind ?? (/\\.pdf$/i.test(name) ? 'pdf' : 'image')\n\tconst pdf = type === 'pdf'\n\tconst ready = src !== null && !failed\n\tconst paging = count > 1 && Boolean(onIndexChange)\n\n\tfunction go(step: number) {\n\t\tif (!paging) return\n\t\tonIndexChange?.((index + step + count) % count)\n\t}\n\n\tuseEffect(() => {\n\t\tconst element = image.current\n\t\tif (zoom !== null || !element || !naturalWidth) return\n\t\tconst measure = () => setFitScale(element.clientWidth / naturalWidth)\n\t\tmeasure()\n\t\tconst observer = new ResizeObserver(measure)\n\t\tobserver.observe(element)\n\t\treturn () => observer.disconnect()\n\t}, [zoom, naturalWidth])\n\n\t/** The scale the image is shown at right now, also while fitted. */\n\tconst shownScale = () => zoom ?? fitScale\n\n\tfunction zoomBy(direction: 1 | -1) {\n\t\tconst from = shownScale()\n\t\tconst next =\n\t\t\tdirection > 0\n\t\t\t\t? STEPS.find((step) => step > from + 0.001)\n\t\t\t\t: [...STEPS].reverse().find((step) => step < from - 0.001)\n\t\tif (next !== undefined) setZoom(next)\n\t}\n\n\tfunction fail() {\n\t\tsetFailed(true)\n\t\tonError?.()\n\t}\n\n\tfunction onKeyDown(event: KeyboardEvent) {\n\t\tconst target = event.target as HTMLElement\n\t\tif (target.closest('input, textarea, select')) return\n\t\tif (event.key === 'ArrowLeft' && paging) {\n\t\t\tevent.preventDefault()\n\t\t\tgo(-1)\n\t\t} else if (event.key === 'ArrowRight' && paging) {\n\t\t\tevent.preventDefault()\n\t\t\tgo(1)\n\t\t} else if (pdf || !ready) return\n\t\telse if (event.key === '+' || event.key === '=') zoomBy(1)\n\t\telse if (event.key === '-') zoomBy(-1)\n\t\telse if (event.key === '0') setZoom(null)\n\t}\n\n\tconst stepIndex = nearestStep(ready ? shownScale() : 1)\n\tconst percent = `${Math.round((zoom ?? shownScale()) * 100)} %`\n\tconst caption = [t(pdf ? 'fileViewer.pdf' : 'fileViewer.image')]\n\tconst position = t('fileViewer.position', { current: index + 1, count })\n\n\treturn (\n\t\t<section\n\t\t\tclassName={cn(styles.viewer, className)}\n\t\t\tdata-slot='file-viewer'\n\t\t\tdata-kind={type}\n\t\t\tdata-zoomed={zoom !== null || undefined}\n\t\t\taria-labelledby={`${id}-title`}\n\t\t\tonKeyDown={onKeyDown}\n\t\t>\n\t\t\t<header className={styles.header}>\n\t\t\t\t<div className={styles.heading}>\n\t\t\t\t\t<h2\n\t\t\t\t\t\tid={`${id}-title`}\n\t\t\t\t\t\tclassName='truncate font-heading text-2xl leading-snug font-semibold tracking-tight'\n\t\t\t\t\t>\n\t\t\t\t\t\t{name || t('fileViewer.title')}\n\t\t\t\t\t</h2>\n\t\t\t\t\t<p className={styles.caption}>\n\t\t\t\t\t\t{caption}\n\t\t\t\t\t\t{description && <> · {description}</>}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t{count > 1 && (\n\t\t\t\t\t<span className={styles.index} title={position}>\n\t\t\t\t\t\t<span className='sr-only'>{position}</span>\n\t\t\t\t\t\t<span aria-hidden='true'>\n\t\t\t\t\t\t\t{pad(index + 1)} / {pad(count)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t</header>\n\n\t\t\t<div className={styles.stage}>\n\t\t\t\t{/* Viewfinder marks behind the content: decoration only. */}\n\t\t\t\t<div className={styles.marks} aria-hidden='true'>\n\t\t\t\t\t<i data-corner='tl' />\n\t\t\t\t\t<i data-corner='tr' />\n\t\t\t\t\t<i data-corner='bl' />\n\t\t\t\t\t<i data-corner='br' />\n\t\t\t\t\t<i data-edge='top' />\n\t\t\t\t\t<i data-edge='bottom' />\n\t\t\t\t\t<i data-edge='left' />\n\t\t\t\t\t<i data-edge='right' />\n\t\t\t\t\t<i data-center='' />\n\t\t\t\t</div>\n\t\t\t\t<div className={styles.viewport}>\n\t\t\t\t\t{failed ? (\n\t\t\t\t\t\t<p className={styles.error} role='alert'>\n\t\t\t\t\t\t\t{errorMessage ?? t('fileViewer.error')}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) : src === null ? (\n\t\t\t\t\t\t<p className={styles.loading} role='status'>\n\t\t\t\t\t\t\t{t('fileViewer.loading')}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) : pdf ? (\n\t\t\t\t\t\t<iframe key={src} src={src} title={name} className={styles.pdf} />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div className={styles.canvas}>\n\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\tref={image}\n\t\t\t\t\t\t\t\tkey={src}\n\t\t\t\t\t\t\t\tsrc={src}\n\t\t\t\t\t\t\t\talt={name}\n\t\t\t\t\t\t\t\tclassName={styles.image}\n\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\tzoom === null || !naturalWidth\n\t\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\t\t\twidth: naturalWidth * zoom,\n\t\t\t\t\t\t\t\t\t\t\t\tmaxWidth: 'none',\n\t\t\t\t\t\t\t\t\t\t\t\tmaxHeight: 'none',\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonLoad={(event) =>\n\t\t\t\t\t\t\t\t\tsetNaturalWidth(event.currentTarget.naturalWidth)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonError={fail}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div className={styles.controls}>\n\t\t\t\t{paging && (\n\t\t\t\t\t<div className={styles.paging}>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype='button'\n\t\t\t\t\t\t\tclassName={styles.round}\n\t\t\t\t\t\t\taria-label={t('fileViewer.previous')}\n\t\t\t\t\t\t\ttitle={t('fileViewer.previous')}\n\t\t\t\t\t\t\tonClick={() => go(-1)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ChevronLeft />\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t{count <= DOTS_MAX ? (\n\t\t\t\t\t\t\t<ol className={styles.dots} aria-label={position}>\n\t\t\t\t\t\t\t\t{Array.from({ length: count }, (_, dot) => (\n\t\t\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: one dot per position\n\t\t\t\t\t\t\t\t\t\tkey={dot}\n\t\t\t\t\t\t\t\t\t\taria-current={dot === index ? 'true' : undefined}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</ol>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<span className={styles.counter} aria-hidden='true'>\n\t\t\t\t\t\t\t\t{pad(index + 1)} / {pad(count)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype='button'\n\t\t\t\t\t\t\tclassName={styles.round}\n\t\t\t\t\t\t\taria-label={t('fileViewer.next')}\n\t\t\t\t\t\t\ttitle={t('fileViewer.next')}\n\t\t\t\t\t\t\tonClick={() => go(1)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ChevronRight />\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\n\t\t\t\t{!pdf && (\n\t\t\t\t\t<div className={styles.zoom}>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype='button'\n\t\t\t\t\t\t\tclassName={styles.round}\n\t\t\t\t\t\t\tdisabled={!ready || stepIndex === 0}\n\t\t\t\t\t\t\taria-label={t('fileViewer.zoomOut')}\n\t\t\t\t\t\t\ttitle={t('fileViewer.zoomOut')}\n\t\t\t\t\t\t\tonClick={() => zoomBy(-1)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Minus />\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<div className={styles.scale}>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tclassName={styles.slider}\n\t\t\t\t\t\t\t\ttype='range'\n\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\tmax={STEPS.length - 1}\n\t\t\t\t\t\t\t\tstep={1}\n\t\t\t\t\t\t\t\tvalue={stepIndex}\n\t\t\t\t\t\t\t\tdisabled={!ready}\n\t\t\t\t\t\t\t\taria-label={t('fileViewer.zoom')}\n\t\t\t\t\t\t\t\taria-valuetext={\n\t\t\t\t\t\t\t\t\tzoom === null\n\t\t\t\t\t\t\t\t\t\t? `${t('fileViewer.fit')} (${percent})`\n\t\t\t\t\t\t\t\t\t\t: percent\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'--progress': `${(stepIndex / (STEPS.length - 1)) * 100}%`,\n\t\t\t\t\t\t\t\t\t} as CSSProperties\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonChange={(event) =>\n\t\t\t\t\t\t\t\t\tsetZoom(STEPS[event.currentTarget.valueAsNumber])\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<div className={styles.ruler} aria-hidden='true'>\n\t\t\t\t\t\t\t\t{STEPS.map((step, tick) => (\n\t\t\t\t\t\t\t\t\t<i\n\t\t\t\t\t\t\t\t\t\tkey={step}\n\t\t\t\t\t\t\t\t\t\tdata-major={step === 1 || undefined}\n\t\t\t\t\t\t\t\t\t\tdata-passed={tick <= stepIndex || undefined}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype='button'\n\t\t\t\t\t\t\tclassName={styles.round}\n\t\t\t\t\t\t\tdisabled={!ready || stepIndex === STEPS.length - 1}\n\t\t\t\t\t\t\taria-label={t('fileViewer.zoomIn')}\n\t\t\t\t\t\t\ttitle={t('fileViewer.zoomIn')}\n\t\t\t\t\t\t\tonClick={() => zoomBy(1)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Plus />\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<span className={styles.readout} aria-hidden='true'>\n\t\t\t\t\t\t\t{percent}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype='button'\n\t\t\t\t\t\t\tclassName={styles.fit}\n\t\t\t\t\t\t\tdisabled={!ready}\n\t\t\t\t\t\t\taria-pressed={zoom === null}\n\t\t\t\t\t\t\tonClick={() => setZoom(zoom === null ? 1 : null)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{t('fileViewer.fit')}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\n\t\t\t{footer && <footer className={styles.footer}>{footer}</footer>}\n\t\t</section>\n\t)\n}\n"],"names":["FILE_VIEWER_ZOOM_STEPS","STEPS","DOTS_MAX","nearestStep","scale","best","index","pad","value","FileViewer","src","name","kind","description","count","onIndexChange","errorMessage","footer","onError","className","t","useTranslation","STOA_NS","id","useId","image","useRef","failed","setFailed","useState","zoom","setZoom","naturalWidth","setNaturalWidth","fitScale","setFitScale","previousSrc","setPreviousSrc","type","pdf","ready","paging","go","step","useEffect","element","measure","observer","shownScale","zoomBy","direction","from","next","fail","onKeyDown","event","stepIndex","percent","caption","position","jsxs","cn","styles","jsx","Fragment","ChevronLeft","_","dot","ChevronRight","Minus","tick","Plus"],"mappings":";;;;;;;AAyCO,MAAMA,KAAyB;AAAA,EACrC;AAAA,EAAM;AAAA,EAAK;AAAA,EAAM;AAAA,EAAG;AAAA,EAAK;AAAA,EAAG;AAAA,EAAG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AM2B,MACjB,gBAAAP;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBAEA,cAAYpB,MAAS,KAAK;AAAA,kBAC1B,eAAa2B,KAAQd,KAAa;AAAA,gBAAA;AAAA,gBAF7Bb;AAAA,cAAA,CAIN,EAAA,CACF;AAAA,YAAA,GACD;AAAA,YACA,gBAAAoB;AAAA,cAAC;AAAA,cAAA;AAAA,gBACA,MAAK;AAAA,gBACL,WAAWD,EAAO;AAAA,gBAClB,UAAU,CAACtB,KAASgB,MAAcvD,EAAM,SAAS;AAAA,gBACjD,cAAYmB,EAAE,mBAAmB;AAAA,gBACjC,OAAOA,EAAE,mBAAmB;AAAA,gBAC5B,SAAS,MAAM6B,EAAO,CAAC;AAAA,gBAEvB,4BAACsB,GAAA,CAAA,CAAK;AAAA,cAAA;AAAA,YAAA;AAAA,8BAEN,QAAA,EAAK,WAAWT,EAAO,SAAS,eAAY,QAC3C,UAAAL,GACF;AAAA,YACA,gBAAAM;AAAA,cAAC;AAAA,cAAA;AAAA,gBACA,MAAK;AAAA,gBACL,WAAWD,EAAO;AAAA,gBAClB,UAAU,CAACtB;AAAA,gBACX,gBAAcV,MAAS;AAAA,gBACvB,SAAS,MAAMC,EAAQD,MAAS,OAAO,IAAI,IAAI;AAAA,gBAE9C,YAAE,gBAAgB;AAAA,cAAA;AAAA,YAAA;AAAA,UACpB,EAAA,CACD;AAAA,QAAA,GAEF;AAAA,QAECb,KAAU,gBAAA8C,EAAC,UAAA,EAAO,WAAWD,EAAO,QAAS,UAAA7C,EAAA,CAAO;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGxD;"}
package/dist/ui/index.js CHANGED
@@ -1,124 +1,129 @@
1
1
  import { Accordion as e, AccordionContent as t, AccordionItem as p, AccordionTrigger as n } from "./accordion/index.js";
2
- import { Button as i, buttonVariants as a } from "./button/index.js";
3
- import { Calendar as u, CalendarDayButton as c } from "./calendar/index.js";
4
- import { Card as g, CardAction as x, CardContent as D, CardDescription as f, CardFooter as S, CardHeader as T, CardTitle as C } from "./card/index.js";
5
- import { ColorPicker as M } from "./color-picker/index.js";
6
- import { ColorPickerToggle as P } from "./color-picker-toggle/index.js";
7
- import { Dialog as G, DialogClose as b, DialogContent as v, DialogDescription as s, DialogFooter as A, DialogHeader as h, DialogOverlay as B, DialogPortal as L, DialogTitle as k, DialogTrigger as R } from "./dialog/index.js";
8
- import { DropdownMenu as V, DropdownMenuCheckboxItem as y, DropdownMenuContent as E, DropdownMenuGroup as O, DropdownMenuItem as U, DropdownMenuLabel as j, DropdownMenuPortal as q, DropdownMenuRadioGroup as z, DropdownMenuRadioItem as J, DropdownMenuSeparator as K, DropdownMenuShortcut as N, DropdownMenuSub as Q, DropdownMenuSubContent as W, DropdownMenuSubTrigger as X, DropdownMenuTrigger as Y } from "./dropdown-menu/index.js";
9
- import { Field as _, FieldContent as $, FieldDescription as oo, FieldError as ro, FieldGroup as eo, FieldLabel as to, FieldLegend as po, FieldSeparator as no, FieldSet as lo, FieldTitle as io } from "./field/index.js";
10
- import { Input as uo } from "./input/index.js";
11
- import { InputGroup as mo, InputGroupAddon as go, InputGroupButton as xo, InputGroupInput as Do, InputGroupText as fo, InputGroupTextarea as So } from "./input-group/index.js";
12
- import { Label as Co } from "./label/index.js";
13
- import { MarkedText as Mo } from "./marked-text/index.js";
14
- import { Pill as Po } from "./pill/index.js";
15
- import { Popover as Go, PopoverAnchor as bo, PopoverContent as vo, PopoverDescription as so, PopoverHeader as Ao, PopoverTitle as ho, PopoverTrigger as Bo } from "./popover/index.js";
16
- import { RadioGroup as ko, RadioGroupItem as Ro } from "./radio-group/index.js";
17
- import { ScrollArea as Vo, ScrollBar as yo } from "./scroll-area/index.js";
18
- import { Select as Oo, SelectContent as Uo, SelectGroup as jo, SelectItem as qo, SelectLabel as zo, SelectScrollDownButton as Jo, SelectScrollUpButton as Ko, SelectSeparator as No, SelectTrigger as Qo, SelectValue as Wo } from "./select/index.js";
19
- import { Separator as Yo } from "./separator/index.js";
20
- import { Toaster as _o } from "./sonner/index.js";
21
- import { Switch as or } from "./switch/index.js";
22
- import { Textarea as er } from "./textarea/index.js";
23
- import { ThemeSwitch as pr } from "./theme-switch/index.js";
24
- import { ThemeToggle as lr } from "./theme-toggle/index.js";
25
- import { Toggle as ar, toggleVariants as dr } from "./toggle/index.js";
26
- import { Tooltip as cr, TooltipContent as mr, TooltipProvider as gr, TooltipTrigger as xr } from "./tooltip/index.js";
2
+ import { AudioPlayer as i } from "./audio-player/index.js";
3
+ import { Button as d, buttonVariants as u } from "./button/index.js";
4
+ import { Calendar as c, CalendarDayButton as g } from "./calendar/index.js";
5
+ import { Card as D, CardAction as f, CardContent as S, CardDescription as T, CardFooter as C, CardHeader as w, CardTitle as M } from "./card/index.js";
6
+ import { ColorPicker as P } from "./color-picker/index.js";
7
+ import { ColorPickerToggle as G } from "./color-picker-toggle/index.js";
8
+ import { Dialog as v, DialogClose as A, DialogContent as s, DialogDescription as h, DialogFooter as B, DialogHeader as L, DialogOverlay as E, DialogPortal as R, DialogTitle as V, DialogTrigger as k } from "./dialog/index.js";
9
+ import { DropdownMenu as H, DropdownMenuCheckboxItem as O, DropdownMenuContent as _, DropdownMenuGroup as U, DropdownMenuItem as W, DropdownMenuLabel as Z, DropdownMenuPortal as j, DropdownMenuRadioGroup as q, DropdownMenuRadioItem as z, DropdownMenuSeparator as J, DropdownMenuShortcut as K, DropdownMenuSub as N, DropdownMenuSubContent as Q, DropdownMenuSubTrigger as X, DropdownMenuTrigger as Y } from "./dropdown-menu/index.js";
10
+ import { Field as oo, FieldContent as ro, FieldDescription as eo, FieldError as to, FieldGroup as po, FieldLabel as no, FieldLegend as lo, FieldSeparator as io, FieldSet as ao, FieldTitle as uo } from "./field/index.js";
11
+ import { FILE_VIEWER_ZOOM_STEPS as co, FileViewer as go } from "./file-viewer/index.js";
12
+ import { Input as Do } from "./input/index.js";
13
+ import { InputGroup as So, InputGroupAddon as To, InputGroupButton as Co, InputGroupInput as wo, InputGroupText as Mo, InputGroupTextarea as Io } from "./input-group/index.js";
14
+ import { Label as Fo } from "./label/index.js";
15
+ import { MarkedText as bo } from "./marked-text/index.js";
16
+ import { Pill as Ao } from "./pill/index.js";
17
+ import { Popover as ho, PopoverAnchor as Bo, PopoverContent as Lo, PopoverDescription as Eo, PopoverHeader as Ro, PopoverTitle as Vo, PopoverTrigger as ko } from "./popover/index.js";
18
+ import { RadioGroup as Ho, RadioGroupItem as Oo } from "./radio-group/index.js";
19
+ import { ScrollArea as Uo, ScrollBar as Wo } from "./scroll-area/index.js";
20
+ import { Select as jo, SelectContent as qo, SelectGroup as zo, SelectItem as Jo, SelectLabel as Ko, SelectScrollDownButton as No, SelectScrollUpButton as Qo, SelectSeparator as Xo, SelectTrigger as Yo, SelectValue as $o } from "./select/index.js";
21
+ import { Separator as rr } from "./separator/index.js";
22
+ import { Toaster as tr } from "./sonner/index.js";
23
+ import { Switch as nr } from "./switch/index.js";
24
+ import { Textarea as ir } from "./textarea/index.js";
25
+ import { ThemeSwitch as dr } from "./theme-switch/index.js";
26
+ import { ThemeToggle as mr } from "./theme-toggle/index.js";
27
+ import { Toggle as gr, toggleVariants as xr } from "./toggle/index.js";
28
+ import { Tooltip as fr, TooltipContent as Sr, TooltipProvider as Tr, TooltipTrigger as Cr } from "./tooltip/index.js";
27
29
  export {
28
30
  e as Accordion,
29
31
  t as AccordionContent,
30
32
  p as AccordionItem,
31
33
  n as AccordionTrigger,
32
- i as Button,
33
- u as Calendar,
34
- c as CalendarDayButton,
35
- g as Card,
36
- x as CardAction,
37
- D as CardContent,
38
- f as CardDescription,
39
- S as CardFooter,
40
- T as CardHeader,
41
- C as CardTitle,
42
- M as ColorPicker,
43
- P as ColorPickerToggle,
44
- G as Dialog,
45
- b as DialogClose,
46
- v as DialogContent,
47
- s as DialogDescription,
48
- A as DialogFooter,
49
- h as DialogHeader,
50
- B as DialogOverlay,
51
- L as DialogPortal,
52
- k as DialogTitle,
53
- R as DialogTrigger,
54
- V as DropdownMenu,
55
- y as DropdownMenuCheckboxItem,
56
- E as DropdownMenuContent,
57
- O as DropdownMenuGroup,
58
- U as DropdownMenuItem,
59
- j as DropdownMenuLabel,
60
- q as DropdownMenuPortal,
61
- z as DropdownMenuRadioGroup,
62
- J as DropdownMenuRadioItem,
63
- K as DropdownMenuSeparator,
64
- N as DropdownMenuShortcut,
65
- Q as DropdownMenuSub,
66
- W as DropdownMenuSubContent,
34
+ i as AudioPlayer,
35
+ d as Button,
36
+ c as Calendar,
37
+ g as CalendarDayButton,
38
+ D as Card,
39
+ f as CardAction,
40
+ S as CardContent,
41
+ T as CardDescription,
42
+ C as CardFooter,
43
+ w as CardHeader,
44
+ M as CardTitle,
45
+ P as ColorPicker,
46
+ G as ColorPickerToggle,
47
+ v as Dialog,
48
+ A as DialogClose,
49
+ s as DialogContent,
50
+ h as DialogDescription,
51
+ B as DialogFooter,
52
+ L as DialogHeader,
53
+ E as DialogOverlay,
54
+ R as DialogPortal,
55
+ V as DialogTitle,
56
+ k as DialogTrigger,
57
+ H as DropdownMenu,
58
+ O as DropdownMenuCheckboxItem,
59
+ _ as DropdownMenuContent,
60
+ U as DropdownMenuGroup,
61
+ W as DropdownMenuItem,
62
+ Z as DropdownMenuLabel,
63
+ j as DropdownMenuPortal,
64
+ q as DropdownMenuRadioGroup,
65
+ z as DropdownMenuRadioItem,
66
+ J as DropdownMenuSeparator,
67
+ K as DropdownMenuShortcut,
68
+ N as DropdownMenuSub,
69
+ Q as DropdownMenuSubContent,
67
70
  X as DropdownMenuSubTrigger,
68
71
  Y as DropdownMenuTrigger,
69
- _ as Field,
70
- $ as FieldContent,
71
- oo as FieldDescription,
72
- ro as FieldError,
73
- eo as FieldGroup,
74
- to as FieldLabel,
75
- po as FieldLegend,
76
- no as FieldSeparator,
77
- lo as FieldSet,
78
- io as FieldTitle,
79
- uo as Input,
80
- mo as InputGroup,
81
- go as InputGroupAddon,
82
- xo as InputGroupButton,
83
- Do as InputGroupInput,
84
- fo as InputGroupText,
85
- So as InputGroupTextarea,
86
- Co as Label,
87
- Mo as MarkedText,
88
- Po as Pill,
89
- Go as Popover,
90
- bo as PopoverAnchor,
91
- vo as PopoverContent,
92
- so as PopoverDescription,
93
- Ao as PopoverHeader,
94
- ho as PopoverTitle,
95
- Bo as PopoverTrigger,
96
- ko as RadioGroup,
97
- Ro as RadioGroupItem,
98
- Vo as ScrollArea,
99
- yo as ScrollBar,
100
- Oo as Select,
101
- Uo as SelectContent,
102
- jo as SelectGroup,
103
- qo as SelectItem,
104
- zo as SelectLabel,
105
- Jo as SelectScrollDownButton,
106
- Ko as SelectScrollUpButton,
107
- No as SelectSeparator,
108
- Qo as SelectTrigger,
109
- Wo as SelectValue,
110
- Yo as Separator,
111
- or as Switch,
112
- er as Textarea,
113
- pr as ThemeSwitch,
114
- lr as ThemeToggle,
115
- _o as Toaster,
116
- ar as Toggle,
117
- cr as Tooltip,
118
- mr as TooltipContent,
119
- gr as TooltipProvider,
120
- xr as TooltipTrigger,
121
- a as buttonVariants,
122
- dr as toggleVariants
72
+ co as FILE_VIEWER_ZOOM_STEPS,
73
+ oo as Field,
74
+ ro as FieldContent,
75
+ eo as FieldDescription,
76
+ to as FieldError,
77
+ po as FieldGroup,
78
+ no as FieldLabel,
79
+ lo as FieldLegend,
80
+ io as FieldSeparator,
81
+ ao as FieldSet,
82
+ uo as FieldTitle,
83
+ go as FileViewer,
84
+ Do as Input,
85
+ So as InputGroup,
86
+ To as InputGroupAddon,
87
+ Co as InputGroupButton,
88
+ wo as InputGroupInput,
89
+ Mo as InputGroupText,
90
+ Io as InputGroupTextarea,
91
+ Fo as Label,
92
+ bo as MarkedText,
93
+ Ao as Pill,
94
+ ho as Popover,
95
+ Bo as PopoverAnchor,
96
+ Lo as PopoverContent,
97
+ Eo as PopoverDescription,
98
+ Ro as PopoverHeader,
99
+ Vo as PopoverTitle,
100
+ ko as PopoverTrigger,
101
+ Ho as RadioGroup,
102
+ Oo as RadioGroupItem,
103
+ Uo as ScrollArea,
104
+ Wo as ScrollBar,
105
+ jo as Select,
106
+ qo as SelectContent,
107
+ zo as SelectGroup,
108
+ Jo as SelectItem,
109
+ Ko as SelectLabel,
110
+ No as SelectScrollDownButton,
111
+ Qo as SelectScrollUpButton,
112
+ Xo as SelectSeparator,
113
+ Yo as SelectTrigger,
114
+ $o as SelectValue,
115
+ rr as Separator,
116
+ nr as Switch,
117
+ ir as Textarea,
118
+ dr as ThemeSwitch,
119
+ mr as ThemeToggle,
120
+ tr as Toaster,
121
+ gr as Toggle,
122
+ fr as Tooltip,
123
+ Sr as TooltipContent,
124
+ Tr as TooltipProvider,
125
+ Cr as TooltipTrigger,
126
+ u as buttonVariants,
127
+ xr as toggleVariants
123
128
  };
124
129
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,37 +1,37 @@
1
- import { jsx as o, jsxs as g, Fragment as P } from "react/jsx-runtime";
2
- import { useId as j, useState as k, useRef as N, useEffect as S } from "react";
3
- import { cn as B } from "../../utils/cn.js";
1
+ import { jsx as o, jsxs as g, Fragment as j } from "react/jsx-runtime";
2
+ import { useId as k, useState as N, useRef as S, useEffect as B } from "react";
3
+ import { cn as F } from "../../utils/cn.js";
4
4
  function M({
5
5
  className: p,
6
6
  type: w,
7
7
  label: i,
8
8
  icon: t,
9
9
  transitionStyle: v = "default",
10
- suggestions: d,
10
+ suggestions: s,
11
11
  list: l,
12
12
  placeholder: n,
13
13
  "aria-label": x,
14
14
  onFocus: b,
15
15
  onBlur: T,
16
- ...y
16
+ ...P
17
17
  }) {
18
- const c = j(), u = l === void 0 && !!d?.length, [r, a] = k({
18
+ const c = k(), u = l === void 0 && !!s?.length, [r, a] = N({
19
19
  focused: !1,
20
20
  showingPlaceholder: !1
21
- }), s = N(void 0);
22
- S(() => () => window.clearTimeout(s.current), []);
21
+ }), d = S(void 0);
22
+ B(() => () => window.clearTimeout(d.current), []);
23
23
  function f(e) {
24
- window.clearTimeout(s.current);
25
- const { showingPlaceholder: h } = r;
26
- if (!i || !n || e === h || window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
24
+ window.clearTimeout(d.current);
25
+ const { showingPlaceholder: m } = r;
26
+ if (!i || !n || e === m || window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
27
27
  a({ focused: e, showingPlaceholder: e });
28
28
  return;
29
29
  }
30
- a({ focused: e, showingPlaceholder: h }), s.current = window.setTimeout(() => {
30
+ a({ focused: e, showingPlaceholder: m }), d.current = window.setTimeout(() => {
31
31
  a({ focused: e, showingPlaceholder: e });
32
32
  }, 90);
33
33
  }
34
- const I = i && (n ? r.focused !== r.showingPlaceholder : r.focused), m = /* @__PURE__ */ o(
34
+ const y = i && (n ? r.focused !== r.showingPlaceholder : r.focused), I = !i || r.showingPlaceholder && n, h = /* @__PURE__ */ o(
35
35
  "input",
36
36
  {
37
37
  type: w,
@@ -39,9 +39,10 @@ function M({
39
39
  "data-slot": "input",
40
40
  "data-transition-style": v,
41
41
  "data-has-icon": t ? "" : void 0,
42
- "data-inline-label": i ? I ? "hidden" : "visible" : void 0,
43
- className: B(
44
- "h-12 w-full min-w-0 rounded-lg border-[1.5px] border-foreground/35 bg-transparent px-3 py-1 text-sm transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:font-semibold placeholder:text-foreground/75 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
42
+ "data-inline-label": i ? y ? "hidden" : "visible" : void 0,
43
+ "data-placeholder-role": I ? "hint" : "label",
44
+ className: F(
45
+ "h-12 w-full min-w-0 rounded-lg border-[1.5px] border-foreground/35 bg-transparent px-3 py-1 text-sm transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:font-semibold placeholder:text-muted-foreground data-[placeholder-role=label]:placeholder:text-foreground/75 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
45
46
  t && "peer pr-10",
46
47
  p
47
48
  ),
@@ -53,12 +54,12 @@ function M({
53
54
  onBlur: (e) => {
54
55
  f(!1), T?.(e);
55
56
  },
56
- ...y
57
+ ...P
57
58
  }
58
59
  );
59
- return /* @__PURE__ */ g(P, { children: [
60
+ return /* @__PURE__ */ g(j, { children: [
60
61
  t ? /* @__PURE__ */ g("div", { className: "flex min-w-0 items-center", children: [
61
- m,
62
+ h,
62
63
  /* @__PURE__ */ o(
63
64
  "span",
64
65
  {
@@ -68,8 +69,8 @@ function M({
68
69
  children: t
69
70
  }
70
71
  )
71
- ] }) : m,
72
- u && /* @__PURE__ */ o("datalist", { id: c, children: Array.from(new Set(d), (e) => /* @__PURE__ */ o("option", { value: e }, e)) })
72
+ ] }) : h,
73
+ u && /* @__PURE__ */ o("datalist", { id: c, children: Array.from(new Set(s), (e) => /* @__PURE__ */ o("option", { value: e }, e)) })
73
74
  ] });
74
75
  }
75
76
  export {