@lucian-seo/lucian-ui 0.1.2 → 0.1.3

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 (37) hide show
  1. package/dist/lib/Input-DzJm1Kv4.js +93 -0
  2. package/dist/lib/Input-DzJm1Kv4.js.map +1 -0
  3. package/dist/lib/{Switch-CMllJkGp.js → Switch-DyKAqvde.js} +173 -150
  4. package/dist/lib/Switch-DyKAqvde.js.map +1 -0
  5. package/dist/lib/{TagInput-BxbmmLeL.js → TagInput-CeA0n7ax.js} +2 -2
  6. package/dist/lib/{TagInput-BxbmmLeL.js.map → TagInput-CeA0n7ax.js.map} +1 -1
  7. package/dist/lib/{ToggleButton-DVmHmemS.js → ToggleButton-r73bokux.js} +4 -4
  8. package/dist/lib/ToggleButton-r73bokux.js.map +1 -0
  9. package/dist/lib/{Toolbar-C0Dn66Ry.js → Toolbar-DpCq_HXG.js} +440 -318
  10. package/dist/lib/Toolbar-DpCq_HXG.js.map +1 -0
  11. package/dist/lib/{Tooltip-BJSUlXS2.js → Tooltip-BW1-aVDg.js} +2 -2
  12. package/dist/lib/{Tooltip-BJSUlXS2.js.map → Tooltip-BW1-aVDg.js.map} +1 -1
  13. package/dist/lib/{VoiceControlBar-CpEz6uxS.js → VoiceControlBar-CZL-k7ym.js} +755 -720
  14. package/dist/lib/VoiceControlBar-CZL-k7ym.js.map +1 -0
  15. package/dist/lib/{Waveform-C6OQRKbh.js → Waveform-EahaE6uD.js} +2 -2
  16. package/dist/lib/{Waveform-C6OQRKbh.js.map → Waveform-EahaE6uD.js.map} +1 -1
  17. package/dist/lib/components/common/index.js +4 -4
  18. package/dist/lib/components/composed/Combobox/Combobox.d.ts +10 -8
  19. package/dist/lib/components/composed/DatePicker/dates.d.ts +2 -0
  20. package/dist/lib/components/composed/Pagination/Pagination.d.ts +3 -1
  21. package/dist/lib/components/composed/Tabs/Tabs.d.ts +3 -2
  22. package/dist/lib/components/composed/Tabs/index.d.ts +1 -1
  23. package/dist/lib/components/composed/index.js +1 -1
  24. package/dist/lib/components/derived/index.js +2 -2
  25. package/dist/lib/components/extended/DataGrid/DataGrid.d.ts +11 -1
  26. package/dist/lib/components/extended/DataGrid/index.d.ts +1 -1
  27. package/dist/lib/components/extended/index.js +1 -1
  28. package/dist/lib/index.js +8 -8
  29. package/dist/lib/styles.css +1 -1
  30. package/dist/lib/tokens.css +2 -0
  31. package/package.json +1 -1
  32. package/dist/lib/Input-Bv7L1_wj.js +0 -90
  33. package/dist/lib/Input-Bv7L1_wj.js.map +0 -1
  34. package/dist/lib/Switch-CMllJkGp.js.map +0 -1
  35. package/dist/lib/ToggleButton-DVmHmemS.js.map +0 -1
  36. package/dist/lib/Toolbar-C0Dn66Ry.js.map +0 -1
  37. package/dist/lib/VoiceControlBar-CpEz6uxS.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { n as e, s as t, t as n } from "./VisuallyHidden-DcE0EFpo.js";
2
- import { n as r, t as i } from "./Input-Bv7L1_wj.js";
2
+ import { n as r, t as i } from "./Input-DzJm1Kv4.js";
3
3
  import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
4
4
  import { useEffect as c, useState as l } from "react";
5
5
  import { Minus as u, Plus as d } from "lucide-react";
@@ -97,7 +97,7 @@ function g({ value: t, onValueChange: n, label: r, min: f = -Infinity, max: p =
97
97
  }, [C, t]);
98
98
  let O = (e) => {
99
99
  let t = h(e, f, p);
100
- T(String(t)), n(t);
100
+ D(!1), T(String(t)), n(t);
101
101
  }, k = (e) => {
102
102
  let [t, n = "0"] = String(e).toLowerCase().split("e");
103
103
  return Math.max(0, (t.split(".")[1] ?? "").length - Number(n));
@@ -123,7 +123,7 @@ function g({ value: t, onValueChange: n, label: r, min: f = -Infinity, max: p =
123
123
  inputMode: Number.isInteger(m) && Number.isInteger(C) ? "numeric" : "decimal",
124
124
  role: "spinbutton",
125
125
  name: b,
126
- value: w,
126
+ value: E ? w : String(C),
127
127
  onChange: (e) => {
128
128
  let t = e.target.value.replace(/[^\d.-]/g, "");
129
129
  D(!0), T(t);
@@ -238,4 +238,4 @@ function v({ children: e, pressed: n, onPressedChange: r, variant: i = "outline"
238
238
  //#endregion
239
239
  export { p as a, m as i, _ as n, f as o, g as r, v as t };
240
240
 
241
- //# sourceMappingURL=ToggleButton-DVmHmemS.js.map
241
+ //# sourceMappingURL=ToggleButton-r73bokux.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToggleButton-r73bokux.js","names":[],"sources":["../../src/components/derived/AvatarGroup/AvatarGroup.tsx","../../src/components/derived/InputGroup/InputGroup.tsx","../../src/components/derived/MorphIcon/MorphIcon.tsx","../../src/components/derived/NumberInput/NumberInput.tsx","../../src/components/derived/TextCycle/TextCycle.tsx","../../src/components/derived/ToggleButton/ToggleButton.tsx"],"sourcesContent":["import type { CSSProperties } from \"react\";\nimport { Avatar, type AvatarShape, type AvatarSize, type AvatarStatus } from \"../../common/Avatar\";\nimport { VisuallyHidden } from \"../../common/VisuallyHidden\";\nimport \"./AvatarGroup.css\";\n\nexport type AvatarGroupPerson = {\n /**\n * Who this is, if the caller has an id for them.\n *\n * Used for React's key and nothing else. Two people with the same name is not an edge case\n * in a document with a dozen readers in it, and keyed by name they shared one list item:\n * React warned about the duplicate key and then reconciled the wrong face when one of them\n * left. Optional, because a group of four names typed into a page has no ids to give.\n */\n id?: string;\n name: string;\n src?: string;\n /**\n * Online, away, busy, offline.\n *\n * Asked for by `PresenceBar`, which is a group of faces whose whole subject is what state\n * each of them is in. The dot is decorative — `said` is what carries it to a reader.\n */\n status?: AvatarStatus;\n /**\n * What to add to this person's name. \"(나)\", \"— 자리 비움\".\n *\n * The status dot is a colour, and a colour is nothing to a reader who cannot see it.\n */\n said?: string;\n};\n\nexport type AvatarGroupProps = {\n people: AvatarGroupPerson[];\n /**\n * What this group of people is. \"담당자\", \"참여자\", \"공유 대상\".\n *\n * Required: a bare row of faces reaches assistive technology as an unnamed list of names,\n * and a reader who lands on it hears four people without hearing what they have to do\n * with anything.\n */\n label: string;\n /** How many faces before the rest become a count. */\n max?: number;\n size?: AvatarSize;\n shape?: AvatarShape;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * Several people, overlapping, and then a number.\n *\n * A list, because that is what it is — and because a list tells a reader how many there are\n * before they have walked through all of them.\n */\nexport function AvatarGroup({\n people,\n label,\n max = 4,\n size = \"md\",\n shape = \"circle\",\n className,\n ...rest\n}: AvatarGroupProps) {\n const shown = people.slice(0, max);\n const hidden = people.slice(max);\n\n return (\n <ul\n {...rest}\n className={`avatar-group ${className ?? \"\"}`.trim()}\n data-size={size}\n aria-label={label}\n >\n {shown.map((person, index) => (\n <li\n key={person.id ?? `${index}-${person.name}`}\n className=\"avatar-group__item\"\n /*\n * Where this face sits in the stack. Counted down from the front so the first person\n * is on top, and written as a custom property because the enumeration it replaces\n * stopped at eight — a ninth face went under everyone in front of it.\n */\n style={{ \"--avatar-group-depth\": shown.length - index } as CSSProperties}\n >\n {/* The avatar is decorative and the name is text in the list item, so exactly one\n * element owns the name and a reader hears it once. */}\n <Avatar\n name={person.name}\n src={person.src}\n size={size}\n shape={shape}\n status={person.status}\n decorative\n />\n <VisuallyHidden>\n {person.name}\n {person.said ? ` ${person.said}` : \"\"}\n </VisuallyHidden>\n </li>\n ))}\n {hidden.length > 0 ? (\n /* The count goes on top of all of it: under the face beside it, the `+` is covered. */\n <li className=\"avatar-group__item\" style={{ \"--avatar-group-depth\": shown.length + 1 } as CSSProperties}>\n <span className=\"avatar-group__more\" data-shape={shape} aria-hidden=\"true\">\n +{hidden.length}\n </span>\n {/* The names, not just the number. A count tells a reader that something was\n * withheld; it does not tell them what. */}\n <VisuallyHidden>{`외 ${hidden.length}명: ${hidden.map((person) => person.name).join(\", \")}`}</VisuallyHidden>\n </li>\n ) : null}\n </ul>\n );\n}\n","import type { ReactNode } from \"react\";\nimport \"./InputGroup.css\";\n\nexport type InputGroupProps = {\n /** A field and whatever acts on it — a button, a select, a second field. */\n children: ReactNode;\n /**\n * What the pieces add up to. \"쿠폰 코드 적용\", \"도메인 확인\".\n *\n * Without it a reader meets a field and a button that look related on screen and are two\n * unrelated things in the accessibility tree.\n */\n label: string;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * A field joined to what acts on it.\n *\n * Drawn as one shape because they are one thing: a coupon code and its Apply, a domain and\n * its Check. Where `ButtonGroup` joins alternatives, this joins a value to its action —\n * which is why it is a `group` with a name rather than a row with a gap.\n */\nexport function InputGroup({ children, label, className, ...rest }: InputGroupProps) {\n return (\n <div {...rest} className={`input-group ${className ?? \"\"}`.trim()} role=\"group\" aria-label={label}>\n {children}\n </div>\n );\n}\n","import { useState } from \"react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport { VisuallyHidden } from \"../../common/VisuallyHidden\";\nimport \"./MorphIcon.css\";\n\nexport type MorphIconSize = \"xs\" | \"sm\" | \"md\" | \"lg\";\n/**\n * What arriving means, which is what decides how the new glyph lands.\n *\n * `archive/ui-assets/morph-state-icon` measured this and it is the part of that component\n * worth carrying over whole: a result that has arrived settles, and a failure does not. A\n * check mark that bounces in reads as a small celebration; a cross that bounces in reads as\n * a component that did not understand what it was saying.\n */\nexport type MorphIconTone = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\";\n\nexport type MorphIconProps = {\n /**\n * The glyph that is true **now**. Change it and the exchange plays.\n *\n * Omitted is a real value rather than an error: an empty slot of the right size, which is\n * what a file row needs before its result exists. The box is already there, so the name\n * beside it does not move when the tick arrives.\n */\n icon?: LucideIcon;\n /**\n * The state in words, and the accessible name of the whole thing.\n *\n * `\"복사\"` → `\"복사함\"`, not `\"복사\"` twice. The glyph is the part a reader may not be able\n * to see and it is the only part that changed, so a label that does not change with it is\n * a component announcing the old state for as long as it is on screen.\n *\n * Omitted, everything here is `aria-hidden` — right when a label beside it already says\n * the state, wrong when nothing does. The same rule `Icon` draws.\n */\n label?: string;\n tone?: MorphIconTone;\n size?: MorphIconSize;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * One slot, and the glyph in it became something else.\n *\n * **It does not interpolate paths, and that is a decision rather than a shortcut.** The\n * previous line of work shipped a real morphing engine — arcs to cubics, subpath padding,\n * segment resampling, winding correspondence — and its own README records why it had to:\n * two glyphs from a real icon set share no command count, no vocabulary, no start point and\n * no winding direction. Four hundred lines go into making a clipboard *comparable* to a\n * check mark, and the frame halfway between them is neither of those things. Every exchange\n * this library actually has is a trade of unrelated shapes — `Eye`/`EyeOff`, `Mic`/`MicOff`,\n * `Check`/`Minus`, `ShieldAlert`/`ShieldCheck`, `CheckCircle2`/`XCircle`, `ChevronsUpDown`/\n * `ArrowUp` — and not one of them is the same shape at another angle. So the trade is what\n * gets drawn, and the rule this stage runs on holds: an effect carries a fact or it does not\n * exist.\n *\n * **The box never changes size.** A row of icons with one of them mid-transition is a row\n * that would otherwise push its neighbours, and the reason to draw the change at all is that\n * the thing did *not* move.\n *\n * **It does not go inside a `Button` or an `IconButton`.** Those take `icon` as a\n * `LucideIcon` and draw it themselves; a node handed to `Button` lands in `button__label`,\n * which is the text slot — ellipsis, no gap, hard against the word. Every exchange site this\n * library actually has is a status mark beside a control rather than the control's own glyph\n * — `Dropzone`'s file rows, `RunStatusCard`'s mark, `ApprovalGate` — so that is the shape\n * this is built for. Making a toggle's own glyph exchange would be an axis on those two\n * components rather than a slot on them, and that is a separate decision about forty call\n * sites.\n *\n * **The state is in the accessible name, not in the motion.** `label` changes with the glyph,\n * so a reader who cannot see either still gets the new state — and a still screenshot says\n * which state this is in, because the state is a shape and a word rather than a transition\n * somebody had to be watching.\n */\nexport function MorphIcon({\n icon,\n label,\n tone = \"neutral\",\n size = \"sm\",\n className,\n ...rest\n}: MorphIconProps) {\n /*\n * The previous glyph, kept during render rather than in an effect.\n *\n * An effect runs after the browser has painted, so an exchange started from one would\n * begin at a frame where the arrival had already happened — a flash rather than a\n * transition. Adjusting state while rendering is the documented answer to \"a prop changed\n * and something has to be derived from what it was\".\n */\n const [shown, setShown] = useState<{ icon?: LucideIcon; was?: LucideIcon; turn: number }>({\n icon,\n turn: 0,\n });\n if (shown.icon !== icon) {\n setShown((last) => ({ icon, was: last.icon, turn: last.turn + 1 }));\n }\n\n return (\n <span\n {...rest}\n className={`morph-icon ${className ?? \"\"}`.trim()}\n data-tone={tone}\n data-size={size}\n >\n {/*\n * The outgoing glyph, removed when its animation ends rather than left behind.\n *\n * `animationend` is why the reduced-motion answer here is *no rule at all*: the token\n * layer collapses the duration to 0.01ms rather than to zero, so the event still\n * fires and the old glyph still leaves. A stylesheet writing `animation: none` here\n * would pin the old glyph on screen forever, for exactly the readers who asked for\n * less movement.\n */}\n {shown.was ? (\n <span\n key={`was-${shown.turn}`}\n className=\"morph-icon__glyph\"\n data-part=\"was\"\n aria-hidden=\"true\"\n onAnimationEnd={() => setShown((last) => ({ ...last, was: undefined }))}\n >\n <Icon icon={shown.was} size={size} />\n </span>\n ) : null}\n\n {shown.icon ? (\n <span\n key={`is-${shown.turn}`}\n className=\"morph-icon__glyph\"\n data-part=\"is\"\n /*\n * The arrival plays on an exchange and not on a first paint. A page whose forty\n * icons all pop in on load is a page announcing nothing — the fact this component\n * carries is that a glyph *changed*, and on the first frame none of them has.\n */\n data-exchanged={shown.turn > 0 ? \"\" : undefined}\n >\n <Icon icon={shown.icon} size={size} label={label} />\n </span>\n ) : label ? (\n /* An empty slot still has a state to say. */\n <VisuallyHidden>{label}</VisuallyHidden>\n ) : null}\n </span>\n );\n}\n","import { useEffect, useState } from \"react\";\nimport type { KeyboardEvent } from \"react\";\nimport { Minus, Plus } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { Input, type InputSize } from \"../../common/Input\";\nimport { IconButton } from \"../../common/IconButton\";\nimport type { ButtonTone } from \"../../common/Button\";\nimport \"./NumberInput.css\";\n\nexport type NumberInputProps = {\n value: number;\n onValueChange: (value: number) => void;\n /**\n * What is being counted. \"수량\", \"인원\", \"반복 횟수\".\n *\n * Names the field and both buttons. Two quantity steppers on a page whose buttons are both\n * called \"늘리기\" are two pairs of buttons a reader cannot tell apart — the same problem\n * `Tag` has with its remove control, and the same answer.\n */\n label: string;\n min?: number;\n max?: number;\n step?: number;\n /** Shown after the value and said aloud with it. \"개\", \"명\", \"분\". */\n unit?: string;\n size?: InputSize;\n /**\n * What the decrement control becomes once the value is at its floor.\n *\n * Asked for by `QuantityStepper`: in a basket, one below one is not zero — it is removing\n * the line, and every shop draws that as the minus turning into a bin. Without this the\n * button is simply disabled at 1 and the reader has to find some other control to take the\n * item out with.\n */\n atFloor?: { icon: LucideIcon; label: string; onPress: () => void; tone?: ButtonTone };\n disabled?: boolean;\n name?: string;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\nconst clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));\n\n/**\n * A number, and two ways to change it by one.\n *\n * Not `<input type=\"number\">`, and that is a decision rather than an oversight. A number\n * input changes its value when a reader scrolls the page with the pointer over it — a\n * quantity silently becoming 7 while someone scrolls past — and the usual repair is to blur\n * the field on wheel, which takes the reader out of it instead. It also reports an empty\n * string for anything it cannot parse, so \"12e\" and \"\" are the same value to the component.\n *\n * So: a text field that carries `role=\"spinbutton\"` and says its own bounds, with the arrow\n * keys, Home, End and the page keys implemented here. Everything a number input was going to\n * give is declared rather than inherited, and nothing it was going to take comes with it.\n */\nexport function NumberInput({\n value,\n onValueChange,\n label,\n min = Number.NEGATIVE_INFINITY,\n max = Number.POSITIVE_INFINITY,\n step = 1,\n unit,\n size = \"md\",\n atFloor,\n disabled,\n name,\n className,\n ...rest\n}: NumberInputProps) {\n /*\n * The typed text and the number are not the same thing. \"-\" and \"1.\" are both on the way\n * to a number and neither is one, and a field that refused them would be a field nobody\n * could type a negative or a decimal into.\n */\n /*\n * The value the component actually stands behind.\n *\n * Clamping only on the reader's own edits leaves the first render unguarded: `value={5}`\n * beside `max={3}` reports `aria-valuenow=\"5\"` under `aria-valuemax=\"3\"`, which is a\n * spinbutton contradicting itself, and the plus is disabled at a number the field says is\n * below the ceiling. Everything below reads this, and the effect tells the owner once.\n */\n const settled = clamp(value, min, max);\n\n const [draft, setDraft] = useState(String(settled));\n /*\n * Whether the text in the box is being typed right now.\n *\n * The value coming back from above is clamped, and while someone is typing \"99\" into a\n * field that stops at 10 the two disagree on purpose. Writing the clamped number back into\n * the box mid-keystroke rewrites what they are typing and throws the caret to the end.\n */\n const [editing, setEditing] = useState(false);\n useEffect(() => {\n if (editing) return;\n setDraft(String(settled));\n }, [settled, editing]);\n\n /*\n * Said once, upward. The field cannot hold a number of its own — it is controlled — so the\n * only way out of the contradiction is to tell the owner what the bounds it gave imply. A\n * caller that ignores it leaves `value` where it was, and the effect does not run again.\n */\n useEffect(() => {\n if (settled !== value) onValueChange(settled);\n // eslint-disable-next-line react-hooks/exhaustive-deps -- an unstable handler must not re-fire this\n }, [settled, value]);\n\n const commit = (next: number) => {\n const bounded = clamp(next, min, max);\n setEditing(false);\n setDraft(String(bounded));\n onValueChange(bounded);\n };\n\n /*\n * Stepping keeps the decimals it started with.\n *\n * `0.2 + 0.1` is `0.30000000000000004`, and a quantity field that prints seventeen digits\n * after one press of the up arrow is a field nobody trusts again.\n */\n const places = (of: number) => {\n const [coefficient, exponent = \"0\"] = String(of).toLowerCase().split(\"e\");\n return Math.max(0, (coefficient.split(\".\")[1] ?? \"\").length - Number(exponent));\n };\n const nudge = (by: number) => {\n const from = Number.isFinite(settled) ? settled : 0;\n const precision = Math.max(places(from), places(by));\n const next = from + by;\n /* toFixed accepts at most 100 places; preserve smaller numbers without rounding to zero. */\n commit(precision > 100 ? next : Number(next.toFixed(precision)));\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n /* An IME is mid-syllable, and its keys belong to the composition. */\n if (event.nativeEvent.isComposing || event.nativeEvent.keyCode === 229) return;\n const keys: Record<string, (() => void) | undefined> = {\n ArrowUp: () => nudge(step),\n ArrowDown: () => nudge(-step),\n PageUp: () => nudge(step * 10),\n PageDown: () => nudge(-step * 10),\n /*\n * Only bound when there is a bound.\n *\n * Claiming the key and then doing nothing with it leaves Home and End dead in a field\n * with no `min` or `max` — they no longer take the caret to either end of the text\n * either, which is what they do in every other text field on the page.\n */\n Home: Number.isFinite(min) ? () => commit(min) : undefined,\n End: Number.isFinite(max) ? () => commit(max) : undefined,\n };\n const handler = keys[event.key];\n if (!handler) return;\n event.preventDefault();\n handler();\n };\n\n /*\n * The floor swap follows the settled value, not the half-typed one.\n *\n * Otherwise the first `0` typed into a cart row turns the minus into a bin before the\n * reader has finished the number.\n */\n const atMin = !editing && settled <= min;\n const atMax = settled >= max;\n\n return (\n <Input\n {...rest}\n className={`number-input ${className ?? \"\"}`.trim()}\n type=\"text\"\n inputMode={Number.isInteger(step) && Number.isInteger(settled) ? \"numeric\" : \"decimal\"}\n role=\"spinbutton\"\n name={name}\n value={editing ? draft : String(settled)}\n onChange={(event) => {\n const cleaned = event.target.value.replace(/[^\\d.-]/g, \"\");\n setEditing(true);\n setDraft(cleaned);\n const parsed = Number(cleaned);\n /*\n * What goes up is inside the range, even while the box shows something outside it.\n *\n * Sending the raw number would put a quantity past the stock count into whatever is\n * listening — and `aria-valuenow` would contradict the `aria-valuemax` beside it.\n */\n if (cleaned !== \"\" && Number.isFinite(parsed)) onValueChange(clamp(parsed, min, max));\n }}\n onKeyDown={onKeyDown}\n onBlur={() => {\n setEditing(false);\n commit(Number.isFinite(Number(draft)) && draft !== \"\" ? Number(draft) : settled);\n }}\n aria-label={label}\n aria-valuenow={settled}\n aria-valuemin={Number.isFinite(min) ? min : undefined}\n aria-valuemax={Number.isFinite(max) ? max : undefined}\n aria-valuetext={unit ? `${settled}${unit}` : undefined}\n size={size}\n disabled={disabled}\n autoComplete=\"off\"\n slotStart={\n atMin && atFloor ? (\n <IconButton\n icon={atFloor.icon}\n label={atFloor.label}\n size=\"sm\"\n variant=\"ghost\"\n tone={atFloor.tone ?? \"neutral\"}\n shape=\"circle\"\n disabled={disabled}\n onClick={atFloor.onPress}\n data-part=\"floor\"\n />\n ) : (\n <IconButton\n icon={Minus}\n label={`${label} 줄이기`}\n size=\"sm\"\n variant=\"ghost\"\n tone=\"neutral\"\n shape=\"circle\"\n disabled={disabled || atMin}\n onClick={() => nudge(-step)}\n data-part=\"down\"\n />\n )\n }\n slotEnd={\n <>\n {/* Beside the value rather than inside it. Folding the unit into the field's own\n * value would mean the reader typing through it and the caret landing after it on\n * every keystroke; `aria-valuetext` carries it for anyone listening. */}\n {unit ? <span className=\"number-input__unit\">{unit}</span> : null}\n <IconButton\n icon={Plus}\n label={`${label} 늘리기`}\n size=\"sm\"\n variant=\"ghost\"\n tone=\"neutral\"\n shape=\"circle\"\n disabled={disabled || atMax}\n onClick={() => nudge(step)}\n data-part=\"up\"\n />\n </>\n }\n />\n );\n}\n","import { useState } from \"react\";\nimport \"./TextCycle.css\";\n\nexport type TextCycleProps = {\n /**\n * The line that is true **now**. Change it and the exchange plays.\n *\n * A string rather than a node, and that is the accessibility answer as much as a typing\n * decision: what is on screen has to be the only thing a screen reader can reach, and a\n * subtree is a place for a second focusable thing to hide behind an `aria-hidden` that is\n * about to be applied to it.\n */\n value: string;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * One line, and it says something else now.\n *\n * **It owns no timer, and that is the whole design.** The obvious version of this component\n * holds a pool of phrases and rotates them on an interval — and a phrase that changes\n * because a timer fired says nothing about the work. It is a component drawing progress it\n * has not been told about, which is the same thing `Waveform` refuses to do with amplitude\n * and for the same reason. The host says what is true now; this draws the change. A host\n * that really is cycling through steps it is really performing passes them one at a time,\n * and gets exactly the same picture — the difference is only whether the movement was\n * earned.\n *\n * **Nothing announces.** No live region, no `aria-live`, no `role=\"status\"`. A status line\n * that changes every few seconds and announces each change is a screen reader reading a\n * progress bar out loud, and the reader cannot get past it to the thing they came for. The\n * current line is ordinary text and the outgoing copy is `aria-hidden`, so assistive\n * technology sees one sentence — the true one — at every moment. A host that genuinely needs\n * a change announced wraps this in its own live region and chooses the politeness, which is\n * a decision only it can make.\n *\n * **It sets no type.** No size, no weight, no colour, no family. This is a mechanism for\n * exchanging one line for another and it inherits whatever the line was already wearing —\n * a component that also decided how status lines look would have to be fought everywhere it\n * was used.\n */\nexport function TextCycle({ value, className, ...rest }: TextCycleProps) {\n /*\n * Derived while rendering rather than in an effect: an effect runs after paint, so the new\n * line would already be sitting in place when the exchange started.\n */\n const [shown, setShown] = useState<{ value: string; was?: string; turn: number }>({\n value,\n turn: 0,\n });\n if (shown.value !== value) {\n setShown((last) => ({ value, was: last.value, turn: last.turn + 1 }));\n }\n\n return (\n <span {...rest} className={`text-cycle ${className ?? \"\"}`.trim()}>\n {/*\n * The outgoing line, out of flow so it cannot change the height of the box, and\n * removed when its animation ends. The token layer collapses these durations rather\n * than zeroing them, so `animationend` still fires under `prefers-reduced-motion` and\n * the exchange becomes an instant swap — see the stylesheet.\n */}\n {shown.was !== undefined ? (\n <span\n key={`was-${shown.turn}`}\n className=\"text-cycle__line\"\n data-part=\"was\"\n aria-hidden=\"true\"\n onAnimationEnd={() => setShown((last) => ({ ...last, was: undefined }))}\n >\n {shown.was}\n </span>\n ) : null}\n\n <span\n key={`is-${shown.turn}`}\n className=\"text-cycle__line\"\n data-part=\"is\"\n /* No entrance on the first paint: nothing has changed yet, so there is nothing to say. */\n data-exchanged={shown.turn > 0 ? \"\" : undefined}\n >\n {shown.value}\n </span>\n </span>\n );\n}\n","import type { ReactNode } from \"react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport \"./ToggleButton.css\";\n\nexport type ToggleButtonVariant = \"outline\" | \"ghost\" | \"soft\";\nexport type ToggleButtonTone = \"accent\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\nexport type ToggleButtonSize = \"sm\" | \"md\" | \"lg\";\nexport type ToggleButtonShape = \"rounded\" | \"pill\";\n\nexport type ToggleButtonProps = {\n /**\n * What it controls — and it does not change when the state does.\n *\n * A button labelled \"음소거\" that becomes \"음소거 해제\" while `aria-pressed` also flips\n * says the opposite thing twice, and a reader hears \"음소거 해제, 눌림\" and has to work out\n * which half to believe. The label names the thing; `aria-pressed` says whether it is on.\n */\n children: ReactNode;\n pressed: boolean;\n onPressedChange: (pressed: boolean) => void;\n variant?: ToggleButtonVariant;\n tone?: ToggleButtonTone;\n size?: ToggleButtonSize;\n shape?: ToggleButtonShape;\n icon?: LucideIcon;\n /**\n * `aria-disabled`, not `disabled` — the rule Button set and every button in this library\n * follows. A disabled button leaves the tab order, so a reader standing on one that is\n * switched off underneath them is dropped elsewhere with no idea why. Form controls are\n * the other way round: `Checkbox`, `Radio` and `SegmentedControl` take the real attribute,\n * because that is what keeps their value out of the submitted form.\n */\n disabled?: boolean;\n className?: string;\n [key: `data-${string}`]: unknown;\n [key: `aria-${string}`]: unknown;\n};\n\n/**\n * A button that stays down.\n *\n * `aria-pressed` rather than a checkbox, because this takes effect the moment it is pressed.\n * A checkbox announces \"checked\" and waits for a submit; a toggle button announces \"pressed\"\n * and has already done it.\n */\nexport function ToggleButton({\n children,\n pressed,\n onPressedChange,\n variant = \"outline\",\n tone = \"accent\",\n size = \"md\",\n shape = \"rounded\",\n icon,\n disabled,\n className,\n ...rest\n}: ToggleButtonProps) {\n return (\n <button\n {...rest}\n type=\"button\"\n className={`toggle-button ${className ?? \"\"}`.trim()}\n data-variant={variant}\n data-tone={tone}\n data-size={size}\n data-shape={shape}\n /*\n * Coerced, because `undefined` removes the attribute entirely.\n *\n * Every visual rule in this component's stylesheet hangs off `[aria-pressed=\"true\"]`\n * or `[aria-pressed=\"false\"]`. A missing attribute misses both, so a caller who slips\n * past the type gets a button with no pressed state, no hover and no press veil —\n * announced as an ordinary button rather than a toggle.\n */\n aria-pressed={Boolean(pressed)}\n aria-disabled={disabled || undefined}\n onClick={() => {\n if (disabled) return;\n onPressedChange(!pressed);\n }}\n >\n {icon ? <Icon icon={icon} size={size === \"lg\" ? \"md\" : \"sm\"} /> : null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