@devslab/dds-react 0.21.2 → 0.22.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 (50) hide show
  1. package/README.ko.md +6 -1
  2. package/README.md +6 -1
  3. package/dist/calendar-view-I_sNlioP.js +145 -0
  4. package/dist/calendar-view-I_sNlioP.js.map +1 -0
  5. package/dist/calendar-view.d.ts +16 -0
  6. package/dist/calendar-view.d.ts.map +1 -0
  7. package/dist/calendar.d.ts +19 -0
  8. package/dist/calendar.d.ts.map +1 -0
  9. package/dist/calendar.js +51 -0
  10. package/dist/calendar.js.map +1 -0
  11. package/dist/choice-B3vNMfKK.js +300 -0
  12. package/dist/choice-B3vNMfKK.js.map +1 -0
  13. package/dist/choice-types.d.ts +56 -0
  14. package/dist/choice-types.d.ts.map +1 -0
  15. package/dist/combobox.d.ts +4 -0
  16. package/dist/combobox.d.ts.map +1 -0
  17. package/dist/combobox.js +13 -0
  18. package/dist/combobox.js.map +1 -0
  19. package/dist/controls-BajigKUv.js +139 -0
  20. package/dist/controls-BajigKUv.js.map +1 -0
  21. package/dist/date-only.d.ts +36 -0
  22. package/dist/date-only.d.ts.map +1 -0
  23. package/dist/date-picker.d.ts +8 -9
  24. package/dist/date-picker.d.ts.map +1 -1
  25. package/dist/date-picker.js +198 -0
  26. package/dist/date-picker.js.map +1 -0
  27. package/dist/dropdown-menu.d.ts +31 -0
  28. package/dist/dropdown-menu.d.ts.map +1 -0
  29. package/dist/dropdown-menu.js +73 -0
  30. package/dist/dropdown-menu.js.map +1 -0
  31. package/dist/index.d.ts +6 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +203 -578
  34. package/dist/index.js.map +1 -1
  35. package/dist/input.d.ts +22 -0
  36. package/dist/input.d.ts.map +1 -0
  37. package/dist/input.js +92 -0
  38. package/dist/input.js.map +1 -0
  39. package/dist/internal/choice.d.ts +5 -0
  40. package/dist/internal/choice.d.ts.map +1 -0
  41. package/dist/popover.d.ts +21 -0
  42. package/dist/popover.d.ts.map +1 -0
  43. package/dist/popover.js +49 -0
  44. package/dist/popover.js.map +1 -0
  45. package/dist/select-picker.d.ts +4 -0
  46. package/dist/select-picker.d.ts.map +1 -0
  47. package/dist/select-picker.js +13 -0
  48. package/dist/select-picker.js.map +1 -0
  49. package/package.json +46 -10
  50. package/styles.css +10 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"choice-B3vNMfKK.js","names":[],"sources":["../src/choice-types.ts","../src/internal/choice.tsx"],"sourcesContent":["export interface ChoiceOption {\n value: string;\n label: string;\n description?: string;\n disabled?: boolean;\n}\nexport interface ChoiceMessages {\n open?: string;\n clear?: string;\n loading?: string;\n empty?: string;\n error?: string;\n retry?: string;\n}\nexport type ChoiceVirtualization =\n | false\n | { itemHeight?: number; overscan?: number };\nexport interface ChoiceProps {\n items: ChoiceOption[];\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n selectedOption?: ChoiceOption;\n disabled?: boolean;\n readOnly?: boolean;\n required?: boolean;\n name?: string;\n form?: string;\n id?: string;\n label?: string;\n labelPlacement?: \"outside\" | \"inside\" | \"hidden\";\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n placeholder?: string;\n clearable?: boolean;\n messages?: ChoiceMessages;\n virtualization?: ChoiceVirtualization;\n}\nexport interface ComboboxProps extends ChoiceProps {\n inputValue?: string;\n defaultInputValue?: string;\n onInputValueChange?: (value: string) => void;\n filterMode?: \"local\" | \"external\";\n loading?: boolean;\n error?: string | boolean;\n onRetry?: () => void;\n}\nexport interface SelectPickerProps extends ChoiceProps {}\n\nexport function validateOptions(items: ChoiceOption[]) {\n const ids = new Set<string>();\n for (const item of items) {\n if (!item.value || ids.has(item.value))\n throw new Error(\n `DDS choice: option IDs must be nonempty and unique (${JSON.stringify(item.value)})`,\n );\n ids.add(item.value);\n }\n}\nexport const choiceMessages: Required<ChoiceMessages> = {\n open: \"선택 열기\",\n clear: \"선택 지우기\",\n loading: \"불러오는 중\",\n empty: \"결과 없음\",\n error: \"불러오지 못했습니다\",\n retry: \"다시 시도\",\n};\n\n/** Read the consumer environment at runtime, rather than the library build mode. */\nexport function choiceWarningsEnabled() {\n return (\n (globalThis as { process?: { env?: { NODE_ENV?: string } } }).process?.env\n ?.NODE_ENV !== \"production\"\n );\n}\n","import { Combobox as C, createListCollection } from \"@ark-ui/react/combobox\";\nimport { Select as S } from \"@ark-ui/react/select\";\nimport { Portal } from \"@ark-ui/react/portal\";\nimport { defaultRangeExtractor, useVirtualizer } from \"@tanstack/react-virtual\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\nimport {\n choiceMessages,\n choiceWarningsEnabled,\n validateOptions,\n type ComboboxProps,\n} from \"../choice-types\";\n\n/** The native validation input stores one ID, never a second option collection. */\nconst validationStyle = {\n position: \"absolute\",\n width: 1,\n height: 1,\n padding: 0,\n border: 0,\n clipPath: \"inset(50%)\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n} as const;\nexport function Choice(props: ComboboxProps & { searchable: boolean }) {\n validateOptions(props.items);\n const [internal, setInternal] = useState(props.defaultValue ?? \"\");\n const value = props.value ?? internal;\n const selected =\n props.items.find((item) => item.value === value) ??\n (props.selectedOption?.value === value ? props.selectedOption : undefined);\n const label = selected?.label ?? value;\n const [draft, setDraft] = useState(props.defaultInputValue ?? label);\n const inputValue = props.inputValue ?? draft;\n const [open, setOpen] = useState(false),\n [highlight, setHighlight] = useState<string | null>(null);\n const visibleRef = useRef<HTMLInputElement | HTMLButtonElement>(null),\n validationRef = useRef<HTMLInputElement>(null),\n scrollRef = useRef<HTMLDivElement>(null);\n const [portalMount, setPortalMount] = useState<HTMLElement | null>(null);\n useEffect(() => {\n const control = visibleRef.current;\n if (control) {\n // Modal isolation hides body siblings. Keep nested choices in the modal's\n // DOM subtree so their options remain available to assistive technology.\n setPortalMount(\n control.closest<HTMLElement>('[role=\"dialog\"], [role=\"alertdialog\"]') ??\n control.ownerDocument.body,\n );\n }\n }, []);\n const composing = useRef(false),\n previousSelection = useRef({ value, label });\n const pendingRestore = useRef<{ from: string; to: string } | null>(null);\n const resolveLabel = (id: string) =>\n props.items.find((item) => item.value === id)?.label ??\n (props.selectedOption?.value === id ? props.selectedOption.label : id);\n const messages = { ...choiceMessages, ...props.messages };\n const blocked = props.disabled || props.readOnly;\n const setInput = (next: string) => {\n if (\n pendingRestore.current?.from === inputValue &&\n pendingRestore.current.to === next\n )\n return;\n pendingRestore.current = null;\n if (props.inputValue === undefined) setDraft(next);\n props.onInputValueChange?.(next);\n };\n const restoreInput = (next: string) => {\n if (next === inputValue) return;\n if (\n pendingRestore.current?.from === inputValue &&\n pendingRestore.current.to === next\n )\n return;\n pendingRestore.current = { from: inputValue, to: next };\n if (props.inputValue === undefined) setDraft(next);\n else props.onInputValueChange?.(next);\n };\n const setValue = (next: string) => {\n if (props.value === undefined) setInternal(next);\n props.onValueChange?.(next);\n };\n useEffect(() => {\n if (\n previousSelection.current.value !== value ||\n previousSelection.current.label !== label\n ) {\n previousSelection.current = { value, label };\n restoreInput(label);\n }\n }, [value, label]);\n useEffect(() => {\n if (choiceWarningsEnabled() && value && !selected)\n console.warn(\n `DDS choice: no label supplied for selected ID ${JSON.stringify(value)}; pass selectedOption when the selection is outside items.`,\n );\n }, [value, selected]);\n useEffect(() => {\n const form = validationRef.current?.form;\n if (!form) return;\n const reset = (event: Event) =>\n queueMicrotask(() => {\n if (event.defaultPrevented) return;\n const resetValue = props.value ?? props.defaultValue ?? \"\";\n const resetLabel = resolveLabel(resetValue);\n previousSelection.current = { value: resetValue, label: resetLabel };\n if (props.value === undefined) setInternal(resetValue);\n const resetQuery = props.defaultInputValue ?? resetLabel;\n pendingRestore.current = null;\n if (props.inputValue === undefined) setDraft(resetQuery);\n else restoreInput(resetQuery);\n setOpen(false);\n if (visibleRef.current instanceof HTMLInputElement)\n visibleRef.current.value = props.inputValue ?? resetQuery;\n if (validationRef.current) validationRef.current.value = resetValue;\n });\n form.addEventListener(\"reset\", reset);\n return () => form.removeEventListener(\"reset\", reset);\n }, [\n props.defaultValue,\n props.defaultInputValue,\n props.value,\n props.inputValue,\n props.items,\n props.selectedOption,\n props.form,\n ]);\n const items = useMemo(\n () =>\n props.searchable &&\n props.filterMode !== \"external\" &&\n inputValue !== label\n ? props.items.filter((item) =>\n item.label\n .toLocaleLowerCase()\n .includes(inputValue.toLocaleLowerCase()),\n )\n : props.items,\n [props.items, props.searchable, props.filterMode, inputValue, label],\n );\n const collection = useMemo(\n () =>\n createListCollection({\n items,\n itemToString: (item) => item.label,\n itemToValue: (item) => item.value,\n isItemDisabled: (item) => !!item.disabled,\n }),\n [items],\n );\n const virtual = !!props.virtualization;\n const configuredHeight = props.virtualization\n ? props.virtualization.itemHeight\n : undefined;\n const height = Number.isFinite(configuredHeight)\n ? Math.max(40, configuredHeight!)\n : 40;\n const activeIndex = items.findIndex((item) => item.value === highlight);\n const virtualizer = useVirtualizer({\n count: items.length,\n getScrollElement: () => scrollRef.current,\n estimateSize: () => height,\n overscan: props.virtualization ? (props.virtualization.overscan ?? 5) : 5,\n enabled: virtual && open,\n initialRect: { width: 0, height: 320 },\n rangeExtractor: (range) => {\n const indexes = defaultRangeExtractor(range);\n if (activeIndex >= 0 && !indexes.includes(activeIndex))\n indexes.push(activeIndex);\n return indexes.sort((a, b) => a - b);\n },\n });\n useEffect(() => {\n setHighlight(null);\n if (virtual && open)\n virtualizer.scrollToIndex(\n Math.max(\n 0,\n items.findIndex((item) => item.value === value),\n ),\n { align: \"auto\" },\n );\n }, [items, open]);\n const Parts = props.searchable ? C : S;\n const rows = virtual\n ? virtualizer\n .getVirtualItems()\n .map((row) => ({ index: row.index, start: row.start }))\n : items.map((_, index) => ({ index, start: 0 }));\n // Keep the active row mounted even before the scroll element has a measured range.\n if (\n virtual &&\n activeIndex >= 0 &&\n !rows.some((row) => row.index === activeIndex)\n )\n rows.push({ index: activeIndex, start: activeIndex * height });\n const status = props.loading\n ? messages.loading\n : props.error\n ? typeof props.error === \"string\"\n ? props.error\n : messages.error\n : items.length === 0\n ? messages.empty\n : \"\";\n const rootProps = {\n collection,\n value: value ? [value] : [],\n open: open && !blocked,\n disabled: props.disabled,\n readOnly: props.readOnly,\n onOpenChange: (details: { open: boolean }) => {\n if (!blocked) setOpen(details.open);\n },\n onValueChange: (details: { value: string[] }) => {\n if (blocked || composing.current) return;\n const next = details.value[0] ?? \"\";\n if (next !== value) setValue(next);\n },\n onHighlightChange: (details: { highlightedValue: string | null }) =>\n setHighlight(details.highlightedValue),\n scrollToIndexFn: virtual\n ? ({ index }: { index: number }) =>\n virtualizer.scrollToIndex(index, { align: \"auto\" })\n : undefined,\n positioning: {\n placement: \"bottom-start\" as const,\n sameWidth: true,\n gutter: 4,\n strategy: portalMount?.matches('[role=\"dialog\"], [role=\"alertdialog\"]')\n ? (\"fixed\" as const)\n : (\"absolute\" as const),\n hideWhenDetached: !!portalMount?.matches(\n '[role=\"dialog\"], [role=\"alertdialog\"]',\n ),\n },\n };\n const inputProps = props.searchable\n ? {\n inputValue,\n onInputValueChange: (details: {\n inputValue: string;\n reason?: string;\n }) => {\n if (!blocked && details.inputValue !== inputValue)\n setInput(details.inputValue);\n },\n selectionBehavior: \"preserve\" as const,\n }\n : {};\n return (\n <Parts.Root\n {...rootProps}\n {...inputProps}\n id={props.id}\n className=\"dds-choice\"\n data-label-placement={props.labelPlacement ?? \"outside\"}\n data-has-value={value || inputValue ? \"\" : undefined}\n >\n {props.label && (\n <Parts.Label\n className=\"dds-choice-label\"\n onClick={() => visibleRef.current?.focus()}\n >\n {props.label}\n </Parts.Label>\n )}\n <Parts.Control className=\"dds-choice-control\">\n {props.searchable ? (\n <C.Input\n ref={(node) => {\n visibleRef.current = node;\n }}\n className=\"dds-choice-input\"\n aria-label={props[\"aria-label\"]}\n aria-labelledby={props[\"aria-labelledby\"]}\n aria-describedby={props[\"aria-describedby\"]}\n aria-required={props.required}\n placeholder={props.placeholder}\n onCompositionStart={() => {\n composing.current = true;\n }}\n onCompositionEnd={() => {\n composing.current = false;\n }}\n onKeyDown={(event) => {\n if (composing.current && event.key === \"Enter\") {\n event.preventDefault();\n event.stopPropagation();\n }\n }}\n onBlur={() => {\n if (value) restoreInput(label);\n }}\n />\n ) : null}\n <Parts.Trigger\n ref={(node) => {\n if (!props.searchable) visibleRef.current = node;\n }}\n className=\"dds-choice-trigger\"\n aria-label={props.searchable ? messages.open : props[\"aria-label\"]}\n aria-labelledby={props[\"aria-labelledby\"]}\n aria-describedby={props[\"aria-describedby\"]}\n aria-required={props.required}\n >\n {props.searchable ? (\n \"⌄\"\n ) : (\n <span className=\"dds-choice-value\">\n {label || props.placeholder || messages.open}\n </span>\n )}\n </Parts.Trigger>\n {props.clearable && !blocked && (value || inputValue) ? (\n <button\n className=\"dds-choice-clear\"\n type=\"button\"\n aria-label={messages.clear}\n onPointerDown={(event) => event.preventDefault()}\n onClick={() => {\n setValue(\"\");\n setInput(\"\");\n setOpen(false);\n visibleRef.current?.focus();\n }}\n >\n ×\n </button>\n ) : null}\n </Parts.Control>\n <input\n ref={validationRef}\n className=\"dds-choice-validation\"\n style={validationStyle}\n tabIndex={-1}\n aria-hidden=\"true\"\n name={props.name}\n form={props.form}\n value={value}\n required={props.required}\n disabled={props.disabled}\n onChange={() => {}}\n onInvalid={(event) => {\n event.preventDefault();\n visibleRef.current?.focus();\n }}\n />\n <div className=\"dds-choice-status\" role=\"status\" aria-live=\"polite\">\n {status}\n {props.error && props.onRetry ? (\n <button\n className=\"dds-choice-retry\"\n type=\"button\"\n onClick={props.onRetry}\n >\n {messages.retry}\n </button>\n ) : null}\n </div>\n {portalMount && (\n <Portal container={{ current: portalMount }}>\n <Parts.Positioner className=\"dds-choice-positioner\">\n <Parts.Content\n ref={scrollRef}\n className=\"dds-choice-content\"\n style={{\n maxHeight: \"min(320px, var(--available-height, 320px))\",\n overflow: \"auto\",\n }}\n >\n <div\n style={\n virtual\n ? {\n height: virtualizer.getTotalSize(),\n position: \"relative\",\n }\n : undefined\n }\n >\n {rows.map((row) => {\n const item = items[row.index]!;\n return (\n <Parts.Item\n key={item.value}\n item={item}\n className=\"dds-choice-item\"\n aria-posinset={row.index + 1}\n aria-setsize={items.length}\n style={\n virtual\n ? {\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n height,\n transform: `translateY(${row.start}px)`,\n }\n : undefined\n }\n >\n <Parts.ItemText>{item.label}</Parts.ItemText>\n {item.description ? (\n <span className=\"dds-choice-description\">\n {item.description}\n </span>\n ) : null}\n </Parts.Item>\n );\n })}\n </div>\n </Parts.Content>\n </Parts.Positioner>\n </Portal>\n )}\n </Parts.Root>\n );\n}\n"],"mappings":";;;;;;;AAkDA,SAAgB,EAAgB,GAAuB;CACrD,IAAM,oBAAM,IAAI,IAAY;CAC5B,KAAK,IAAM,KAAQ,GAAO;EACxB,IAAI,CAAC,EAAK,SAAS,EAAI,IAAI,EAAK,KAAK,GACnC,MAAU,MACR,uDAAuD,KAAK,UAAU,EAAK,KAAK,EAAE,EACpF;EACF,EAAI,IAAI,EAAK,KAAK;CACpB;AACF;AACA,IAAa,IAA2C;CACtD,MAAM;CACN,OAAO;CACP,SAAS;CACT,OAAO;CACP,OAAO;CACP,OAAO;AACT;AAGA,SAAgB,IAAwB;CACtC,OACG,WAA6D,SAAS,KACnE,aAAa;AAErB;;;AC9DA,IAAM,IAAkB;CACtB,UAAU;CACV,OAAO;CACP,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,YAAY;AACd;AACA,SAAgB,EAAO,GAAgD;CACrE,EAAgB,EAAM,KAAK;CAC3B,IAAM,CAAC,GAAU,KAAe,EAAS,EAAM,gBAAgB,EAAE,GAC3D,IAAQ,EAAM,SAAS,GACvB,IACJ,EAAM,MAAM,MAAM,MAAS,EAAK,UAAU,CAAK,MAC9C,EAAM,gBAAgB,UAAU,IAAQ,EAAM,iBAAiB,KAAA,IAC5D,IAAQ,GAAU,SAAS,GAC3B,CAA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,EAAM,SAAS,EAAM,UACpB,kBAAC,UAAD;KACE,WAAU;KACV,MAAK;KACL,SAAS,EAAM;KAEd,UAAA,EAAS;IACJ,CAAA,IACN,IACD;;GACJ,KACC,kBAAC,GAAD;IAAQ,WAAW,EAAE,SAAS,EAAY;IACxC,UAAA,kBAAC,EAAM,YAAP;KAAkB,WAAU;KAC1B,UAAA,kBAAC,EAAM,SAAP;MACE,KAAK;MACL,WAAU;MACV,OAAO;OACL,WAAW;OACX,UAAU;MACZ;MAEA,UAAA,kBAAC,OAAD;OACE,OACE,IACI;QACE,QAAQ,EAAY,aAAa;QACjC,UAAU;OACZ,IACA,KAAA;OAGL,UAAA,EAAK,KAAK,MAAQ;QACjB,IAAM,IAAO,EAAM,EAAI;QACvB,OACE,kBAAC,EAAM,MAAP;SAEQ;SACN,WAAU;SACV,iBAAe,EAAI,QAAQ;SAC3B,gBAAc,EAAM;SACpB,OACE,IACI;UACE,UAAU;UACV,KAAK;UACL,MAAM;UACN,OAAO;UACP;UACA,WAAW,cAAc,EAAI,MAAM;SACrC,IACA,KAAA;SAhBR,UAAA,CAmBE,kBAAC,EAAM,UAAP,EAAA,UAAiB,EAAK,MAAsB,CAAA,GAC3C,EAAK,cACJ,kBAAC,QAAD;UAAM,WAAU;UACb,UAAA,EAAK;SACF,CAAA,IACJ,IACM;QAxBL,GAAA,EAAK,KAwBA;OAEhB,CAAC;MACE,CAAA;KACQ,CAAA;IACC,CAAA;GACZ,CAAA;EAEA;;AAEhB"}
@@ -0,0 +1,56 @@
1
+ export interface ChoiceOption {
2
+ value: string;
3
+ label: string;
4
+ description?: string;
5
+ disabled?: boolean;
6
+ }
7
+ export interface ChoiceMessages {
8
+ open?: string;
9
+ clear?: string;
10
+ loading?: string;
11
+ empty?: string;
12
+ error?: string;
13
+ retry?: string;
14
+ }
15
+ export type ChoiceVirtualization = false | {
16
+ itemHeight?: number;
17
+ overscan?: number;
18
+ };
19
+ export interface ChoiceProps {
20
+ items: ChoiceOption[];
21
+ value?: string;
22
+ defaultValue?: string;
23
+ onValueChange?: (value: string) => void;
24
+ selectedOption?: ChoiceOption;
25
+ disabled?: boolean;
26
+ readOnly?: boolean;
27
+ required?: boolean;
28
+ name?: string;
29
+ form?: string;
30
+ id?: string;
31
+ label?: string;
32
+ labelPlacement?: "outside" | "inside" | "hidden";
33
+ "aria-label"?: string;
34
+ "aria-labelledby"?: string;
35
+ "aria-describedby"?: string;
36
+ placeholder?: string;
37
+ clearable?: boolean;
38
+ messages?: ChoiceMessages;
39
+ virtualization?: ChoiceVirtualization;
40
+ }
41
+ export interface ComboboxProps extends ChoiceProps {
42
+ inputValue?: string;
43
+ defaultInputValue?: string;
44
+ onInputValueChange?: (value: string) => void;
45
+ filterMode?: "local" | "external";
46
+ loading?: boolean;
47
+ error?: string | boolean;
48
+ onRetry?: () => void;
49
+ }
50
+ export interface SelectPickerProps extends ChoiceProps {
51
+ }
52
+ export declare function validateOptions(items: ChoiceOption[]): void;
53
+ export declare const choiceMessages: Required<ChoiceMessages>;
54
+ /** Read the consumer environment at runtime, rather than the library build mode. */
55
+ export declare function choiceWarningsEnabled(): boolean;
56
+ //# sourceMappingURL=choice-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"choice-types.d.ts","sourceRoot":"","sources":["../src/choice-types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AACD,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,MA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E,MAAM,GAAG,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AACD,MAAM,WAAW,iBAAkB,SAAQ,WAAW;CAAG;AAEzD,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,QASpD;AACD,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,cAAc,CAOnD,CAAC;AAEF,oFAAoF;AACpF,wBAAgB,qBAAqB,YAKpC"}
@@ -0,0 +1,4 @@
1
+ import type { ComboboxProps } from "./choice-types";
2
+ export type { ComboboxProps, ChoiceOption, ChoiceMessages, ChoiceVirtualization, } from "./choice-types";
3
+ export declare function Combobox(props: ComboboxProps): import("react").JSX.Element;
4
+ //# sourceMappingURL=combobox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../src/combobox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,YAAY,EACV,aAAa,EACb,YAAY,EACZ,cAAc,EACd,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AACxB,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,+BAE5C"}
@@ -0,0 +1,13 @@
1
+ import { t as e } from "./choice-B3vNMfKK.js";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ //#region src/combobox.tsx
4
+ function n(n) {
5
+ return /* @__PURE__ */ t(e, {
6
+ ...n,
7
+ searchable: !0
8
+ });
9
+ }
10
+ //#endregion
11
+ export { n as Combobox };
12
+
13
+ //# sourceMappingURL=combobox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox.js","names":[],"sources":["../src/combobox.tsx"],"sourcesContent":["import { Choice } from \"./internal/choice\";\nimport type { ComboboxProps } from \"./choice-types\";\nexport type {\n ComboboxProps,\n ChoiceOption,\n ChoiceMessages,\n ChoiceVirtualization,\n} from \"./choice-types\";\nexport function Combobox(props: ComboboxProps) {\n return <Choice {...props} searchable />;\n}\n"],"mappings":";;;AAQA,SAAgB,EAAS,GAAsB;CAC7C,OAAO,kBAAC,GAAD;EAAQ,GAAI;EAAO,YAAA;CAAY,CAAA;AACxC"}
@@ -0,0 +1,139 @@
1
+ import { forwardRef as e, useId as t } from "react";
2
+ import { Field as n } from "@ark-ui/react/field";
3
+ import { Checkbox as r } from "@ark-ui/react/checkbox";
4
+ import { Switch as i } from "@ark-ui/react/switch";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ //#region src/controls.tsx
7
+ var s = (...e) => e.filter(Boolean).join(" "), c = e(function({ tone: e = "primary", size: t = "md", loading: n, disabled: r, type: i = "button", className: c, children: l, ...u }, d) {
8
+ return /* @__PURE__ */ o("button", {
9
+ ...u,
10
+ ref: d,
11
+ type: i,
12
+ disabled: r || n,
13
+ "aria-busy": n || void 0,
14
+ className: s("dds-btn", `dds-btn--${e}`, t !== "md" && `dds-btn--${t}`, c),
15
+ children: [n && /* @__PURE__ */ a("span", {
16
+ className: "dds-spinner",
17
+ "aria-hidden": !0
18
+ }), l]
19
+ });
20
+ }), l = e(function({ tone: e = "ghost", size: t = "md", loading: n, disabled: r, type: i = "button", className: o, children: c, ...l }, u) {
21
+ return /* @__PURE__ */ a("button", {
22
+ ...l,
23
+ ref: u,
24
+ type: i,
25
+ disabled: r || n,
26
+ "aria-busy": n || void 0,
27
+ className: s("dds-iconbtn", e !== "ghost" && `dds-iconbtn--${e}`, t !== "md" && `dds-iconbtn--${t}`, o),
28
+ children: n ? /* @__PURE__ */ a("span", {
29
+ className: "dds-spinner",
30
+ "aria-hidden": !0
31
+ }) : c
32
+ });
33
+ }), u = e(function({ id: e, label: r, helpText: i, error: c, required: l, className: u, children: d, ...f }, p) {
34
+ let m = t(), h = e ?? `dds-field-${m}`, g = {
35
+ id: h,
36
+ "aria-describedby": [i && `${h}-help`, c && `${h}-error`].filter(Boolean).join(" ") || void 0,
37
+ "aria-invalid": c ? !0 : void 0,
38
+ "aria-required": l ? !0 : void 0
39
+ };
40
+ return /* @__PURE__ */ o(n.Root, {
41
+ ...f,
42
+ ref: p,
43
+ invalid: !!c,
44
+ required: l,
45
+ id: h,
46
+ ids: {
47
+ control: `${h}-root`,
48
+ helperText: `${h}-help`,
49
+ errorText: `${h}-error`
50
+ },
51
+ className: s("dds-field", !!c && "dds-field--error", u),
52
+ children: [
53
+ /* @__PURE__ */ o(n.Label, {
54
+ htmlFor: h,
55
+ className: "dds-field__label",
56
+ children: [r, l && /* @__PURE__ */ a("span", {
57
+ "aria-hidden": !0,
58
+ children: " *"
59
+ })]
60
+ }),
61
+ typeof d == "function" ? d(g) : d,
62
+ i && /* @__PURE__ */ a(n.HelperText, {
63
+ className: "dds-field__help",
64
+ children: i
65
+ }),
66
+ c && /* @__PURE__ */ a(n.ErrorText, {
67
+ className: "dds-field__error",
68
+ role: "alert",
69
+ children: c
70
+ })
71
+ ]
72
+ });
73
+ }), d = e(function({ invalid: e, wrapperClassName: t, className: n, children: r, ...i }, o) {
74
+ return /* @__PURE__ */ a("span", {
75
+ className: s("dds-select", t),
76
+ children: /* @__PURE__ */ a("select", {
77
+ ...i,
78
+ ref: o,
79
+ className: s("dds-select__input", n),
80
+ "aria-invalid": e || i["aria-invalid"],
81
+ children: r
82
+ })
83
+ });
84
+ }), f = e(function({ kind: e, label: t, checked: n, defaultChecked: c, onCheckedChange: l, id: u, name: d, value: f, disabled: p, required: m, readOnly: h, form: g, className: _, inputClassName: v, onChange: y, ...b }, x) {
85
+ let S = e === "switch" ? i.Root : r.Root, C = e === "switch" ? i.Label : r.Label, w = e === "switch" ? i.Context : r.Context, T = e === "switch" ? "dds-switch" : "dds-check";
86
+ return /* @__PURE__ */ o(S, {
87
+ checked: n,
88
+ defaultChecked: c,
89
+ onCheckedChange: (e) => l?.(e.checked === !0),
90
+ ids: u ? { hiddenInput: u } : void 0,
91
+ name: d,
92
+ value: String(f ?? "on"),
93
+ disabled: p,
94
+ required: m,
95
+ readOnly: h,
96
+ form: g,
97
+ className: s(T, _),
98
+ children: [/* @__PURE__ */ a(w, { children: (t) => {
99
+ let { style: n, defaultChecked: r, ...i } = t.getHiddenInputProps();
100
+ return /* @__PURE__ */ a("input", {
101
+ ...i,
102
+ ...b,
103
+ ref: x,
104
+ checked: t.checked,
105
+ role: e === "switch" ? "switch" : void 0,
106
+ onChange: y ?? (() => {}),
107
+ onClick: (e) => {
108
+ b.onClick?.(e), e.defaultPrevented || i.onClick?.(e);
109
+ },
110
+ className: s(`${T}__input`, v)
111
+ });
112
+ } }), /* @__PURE__ */ a(C, { children: t })]
113
+ });
114
+ }), p = e((e, t) => /* @__PURE__ */ a(f, {
115
+ ...e,
116
+ kind: "checkbox",
117
+ ref: t
118
+ })), m = e((e, t) => /* @__PURE__ */ a(f, {
119
+ ...e,
120
+ kind: "switch",
121
+ ref: t
122
+ })), h = e(function({ label: e, className: t, inputClassName: n, onCheckedChange: r, onChange: i, ...c }, l) {
123
+ return /* @__PURE__ */ o("label", {
124
+ className: s("dds-check", t),
125
+ children: [/* @__PURE__ */ a("input", {
126
+ ...c,
127
+ ref: l,
128
+ type: "radio",
129
+ className: s("dds-check__input", n),
130
+ onChange: (e) => {
131
+ i?.(e), e.defaultPrevented || r?.(e.currentTarget.checked);
132
+ }
133
+ }), /* @__PURE__ */ a("span", { children: e })]
134
+ });
135
+ });
136
+ //#endregion
137
+ export { h as a, s as c, l as i, p as n, d as o, u as r, m as s, c as t };
138
+
139
+ //# sourceMappingURL=controls-BajigKUv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controls-BajigKUv.js","names":[],"sources":["../src/controls.tsx"],"sourcesContent":["import {\n forwardRef,\n useId,\n type ButtonHTMLAttributes,\n type InputHTMLAttributes,\n type SelectHTMLAttributes,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Field as ArkField } from \"@ark-ui/react/field\";\nimport { Checkbox as ArkCheckbox } from \"@ark-ui/react/checkbox\";\nimport { Switch as ArkSwitch } from \"@ark-ui/react/switch\";\nexport const classes = (...values: (string | false | undefined)[]) =>\n values.filter(Boolean).join(\" \");\nexport type ButtonTone = \"primary\" | \"secondary\" | \"ghost\" | \"danger\";\nexport type ControlSize = \"sm\" | \"md\" | \"lg\";\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n tone?: ButtonTone;\n size?: ControlSize;\n loading?: boolean;\n}\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(\n {\n tone = \"primary\",\n size = \"md\",\n loading,\n disabled,\n type = \"button\",\n className,\n children,\n ...rest\n },\n ref\n ) {\n return (\n <button\n {...rest}\n ref={ref}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n className={classes(\n \"dds-btn\",\n `dds-btn--${tone}`,\n size !== \"md\" && `dds-btn--${size}`,\n className\n )}\n >\n {loading && <span className=\"dds-spinner\" aria-hidden />}\n {children}\n </button>\n );\n }\n);\nexport interface IconButtonProps extends Omit<ButtonProps, \"tone\"> {\n \"aria-label\": string;\n tone?: \"ghost\" | \"secondary\" | \"danger\";\n}\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n function IconButton(\n {\n tone = \"ghost\",\n size = \"md\",\n loading,\n disabled,\n type = \"button\",\n className,\n children,\n ...rest\n },\n ref\n ) {\n return (\n <button\n {...rest}\n ref={ref}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n className={classes(\n \"dds-iconbtn\",\n tone !== \"ghost\" && `dds-iconbtn--${tone}`,\n size !== \"md\" && `dds-iconbtn--${size}`,\n className\n )}\n >\n {loading ? <span className=\"dds-spinner\" aria-hidden /> : children}\n </button>\n );\n }\n);\nexport interface FieldControlProps {\n id: string;\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: true;\n \"aria-required\"?: true;\n}\nexport interface FieldProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"children\"> {\n label: ReactNode;\n helpText?: ReactNode;\n error?: ReactNode;\n required?: boolean;\n children: ReactNode | ((props: FieldControlProps) => ReactNode);\n}\nexport const Field = forwardRef<HTMLDivElement, FieldProps>(function Field(\n {\n id: requested,\n label,\n helpText,\n error,\n required,\n className,\n children,\n ...rest\n },\n ref\n) {\n const generated = useId();\n const id = requested ?? `dds-field-${generated}`;\n const control: FieldControlProps = {\n id,\n \"aria-describedby\":\n [helpText && `${id}-help`, error && `${id}-error`]\n .filter(Boolean)\n .join(\" \") || undefined,\n \"aria-invalid\": error ? true : undefined,\n \"aria-required\": required ? true : undefined,\n };\n return (\n <ArkField.Root\n {...rest}\n ref={ref}\n invalid={Boolean(error)}\n required={required}\n id={id}\n ids={{\n control: `${id}-root`,\n helperText: `${id}-help`,\n errorText: `${id}-error`,\n }}\n className={classes(\n \"dds-field\",\n Boolean(error) && \"dds-field--error\",\n className\n )}\n >\n <ArkField.Label htmlFor={id} className=\"dds-field__label\">\n {label}\n {required && <span aria-hidden> *</span>}\n </ArkField.Label>\n {typeof children === \"function\" ? children(control) : children}\n {helpText && (\n <ArkField.HelperText className=\"dds-field__help\">\n {helpText}\n </ArkField.HelperText>\n )}\n {error && (\n <ArkField.ErrorText className=\"dds-field__error\" role=\"alert\">\n {error}\n </ArkField.ErrorText>\n )}\n </ArkField.Root>\n );\n});\nexport interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {\n invalid?: boolean;\n wrapperClassName?: string;\n}\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n function Select(\n { invalid, wrapperClassName, className, children, ...rest },\n ref\n ) {\n return (\n <span className={classes(\"dds-select\", wrapperClassName)}>\n <select\n {...rest}\n ref={ref}\n className={classes(\"dds-select__input\", className)}\n aria-invalid={invalid || rest[\"aria-invalid\"]}\n >\n {children}\n </select>\n </span>\n );\n }\n);\nexport interface CheckboxProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\" | \"children\"> {\n label: ReactNode;\n onCheckedChange?: (checked: boolean) => void;\n inputClassName?: string;\n}\nexport type RadioProps = CheckboxProps;\nexport type SwitchProps = CheckboxProps;\nconst Checkable = forwardRef<\n HTMLInputElement,\n CheckboxProps & { kind: \"checkbox\" | \"switch\" }\n>(function Checkable(\n {\n kind,\n label,\n checked,\n defaultChecked,\n onCheckedChange,\n id,\n name,\n value,\n disabled,\n required,\n readOnly,\n form,\n className,\n inputClassName,\n onChange,\n ...rest\n },\n ref\n) {\n const Root = kind === \"switch\" ? ArkSwitch.Root : ArkCheckbox.Root;\n const Label = kind === \"switch\" ? ArkSwitch.Label : ArkCheckbox.Label;\n const Context = kind === \"switch\" ? ArkSwitch.Context : ArkCheckbox.Context;\n const base = kind === \"switch\" ? \"dds-switch\" : \"dds-check\";\n return (\n <Root\n checked={checked}\n defaultChecked={defaultChecked}\n onCheckedChange={(details) => onCheckedChange?.(details.checked === true)}\n ids={id ? { hiddenInput: id } : undefined}\n name={name}\n value={String(value ?? \"on\")}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n form={form}\n className={classes(base, className)}\n >\n <Context>\n {(api) => {\n // DDS styles the actual input. Keep Ark's events and state, but omit\n // its visually hidden style and use React's controlled checked prop\n // so a caller-declined change also restores the native DOM value.\n const {\n style: _,\n defaultChecked: __,\n ...inputProps\n } = api.getHiddenInputProps();\n return (\n <input\n {...inputProps}\n {...rest}\n ref={ref}\n checked={api.checked}\n role={kind === \"switch\" ? \"switch\" : undefined}\n onChange={onChange ?? (() => {})}\n onClick={(event) => {\n rest.onClick?.(event);\n if (!event.defaultPrevented) inputProps.onClick?.(event);\n }}\n className={classes(`${base}__input`, inputClassName)}\n />\n );\n }}\n </Context>\n <Label>{label}</Label>\n </Root>\n );\n});\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n (props, ref) => <Checkable {...props} kind=\"checkbox\" ref={ref} />\n);\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(\n (props, ref) => <Checkable {...props} kind=\"switch\" ref={ref} />\n);\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n { label, className, inputClassName, onCheckedChange, onChange, ...rest },\n ref\n) {\n return (\n <label className={classes(\"dds-check\", className)}>\n <input\n {...rest}\n ref={ref}\n type=\"radio\"\n className={classes(\"dds-check__input\", inputClassName)}\n onChange={(event) => {\n onChange?.(event);\n if (!event.defaultPrevented)\n onCheckedChange?.(event.currentTarget.checked);\n }}\n />\n <span>{label}</span>\n </label>\n );\n});\n"],"mappings":";;;;;;AAYA,IAAa,KAAW,GAAG,MACzB,EAAO,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,GAQpB,IAAS,EACpB,SACE,EACE,UAAO,WACP,UAAO,MACP,YACA,aACA,UAAO,UACP,cACA,aACA,GAAG,KAEL,GACA;CACA,OACE,kBAAC,UAAD;EACE,GAAI;EACC;EACC;EACN,UAAU,KAAY;EACtB,aAAW,KAAW,KAAA;EACtB,WAAW,EACT,WACA,YAAY,KACZ,MAAS,QAAQ,YAAY,KAC7B,CACF;EAXF,UAAA,CAaG,KAAW,kBAAC,QAAD;GAAM,WAAU;GAAc,eAAA;EAAa,CAAA,GACtD,CACK;;AAEZ,CACF,GAKa,IAAa,EACxB,SACE,EACE,UAAO,SACP,UAAO,MACP,YACA,aACA,UAAO,UACP,cACA,aACA,GAAG,KAEL,GACA;CACA,OACE,kBAAC,UAAD;EACE,GAAI;EACC;EACC;EACN,UAAU,KAAY;EACtB,aAAW,KAAW,KAAA;EACtB,WAAW,EACT,eACA,MAAS,WAAW,gBAAgB,KACpC,MAAS,QAAQ,gBAAgB,KACjC,CACF;EAEC,UAAA,IAAU,kBAAC,QAAD;GAAM,WAAU;GAAc,eAAA;EAAa,CAAA,IAAI;CACpD,CAAA;AAEZ,CACF,GAea,IAAQ,EAAuC,SAC1D,EACE,IAAI,GACJ,UACA,aACA,UACA,aACA,cACA,aACA,GAAG,KAEL,GACA;CACA,IAAM,IAAY,EAAM,GAClB,IAAK,KAAa,aAAa,KAC/B,IAA6B;EACjC;EACA,oBACE,CAAC,KAAY,GAAG,EAAG,QAAQ,KAAS,GAAG,EAAG,OA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D,kBAAC,QAAD,EAAA,UAAO,EAAY,CAAA,CACd;;AAEX,CAAC"}
@@ -0,0 +1,36 @@
1
+ export interface DatePickerValidity {
2
+ /** Exact displayed draft; never persist this display text as an API date. */
3
+ inputValue: string;
4
+ /** Valid ISO date, optional empty string, or null when invalid/incomplete. */
5
+ value: string | null;
6
+ valid: boolean;
7
+ reason: "valid" | "required" | "incomplete" | "invalid" | "rangeUnderflow" | "rangeOverflow";
8
+ }
9
+ export declare function isCalendarDate(value: string): boolean;
10
+ export declare function isKorean(locale: string): boolean;
11
+ export declare function displayDate(value: string, locale: string): string;
12
+ export declare function canonicalInput(inputValue: string, locale: string): string;
13
+ export declare function validateInput(inputValue: string, required: boolean, min?: string, max?: string, locale?: string): DatePickerValidity;
14
+ export interface CalendarMessages {
15
+ previousMonth?: string;
16
+ nextMonth?: string;
17
+ today?: string;
18
+ clear?: string;
19
+ openCalendar?: string;
20
+ selectDate?: (dateText: string) => string;
21
+ required?: string;
22
+ invalid?: string;
23
+ }
24
+ export declare function dateMessages(locale: string, messages?: CalendarMessages): {
25
+ previousMonth: string;
26
+ nextMonth: string;
27
+ today: string;
28
+ clear: string;
29
+ openCalendar: string;
30
+ selectDate: (text: string) => string;
31
+ required: string;
32
+ invalid: string;
33
+ };
34
+ /** Today is the sole timestamp boundary; stored dates remain Gregorian date-only strings. */
35
+ export declare function todayDate(timeZone: string): string;
36
+ //# sourceMappingURL=date-only.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-only.d.ts","sourceRoot":"","sources":["../src/date-only.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EACF,OAAO,GACP,UAAU,GACV,YAAY,GACZ,SAAS,GACT,gBAAgB,GAChB,eAAe,CAAC;CACrB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,WAW3C;AACD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,WAEtC;AACD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAIxD;AACD,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAIhE;AACD,wBAAgB,aAAa,CAC3B,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,OAAO,EACjB,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,EACZ,MAAM,SAAU,GACf,kBAAkB,CAyBpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AACD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAE,gBAAqB;;;;;;uBAQrD,MAAM;;;EAO5B;AAED,6FAA6F;AAC7F,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,UAUzC"}
@@ -1,11 +1,5 @@
1
- export interface DatePickerValidity {
2
- /** Exact displayed draft; never persist this display text as an API date. */
3
- inputValue: string;
4
- /** Valid ISO date, optional empty string, or null when invalid/incomplete. */
5
- value: string | null;
6
- valid: boolean;
7
- reason: 'valid' | 'required' | 'incomplete' | 'invalid' | 'rangeUnderflow' | 'rangeOverflow';
8
- }
1
+ import { type CalendarMessages, type DatePickerValidity } from "./date-only";
2
+ export type { DatePickerValidity, CalendarMessages } from "./date-only";
9
3
  export interface DatePickerProps {
10
4
  label: string;
11
5
  /** ISO calendar date (YYYY-MM-DD), or an empty string. */
@@ -20,6 +14,11 @@ export interface DatePickerProps {
20
14
  onValidityChange?: (state: DatePickerValidity) => void;
21
15
  min?: string;
22
16
  max?: string;
17
+ startOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
18
+ labelPlacement?: "outside" | "inside" | "hidden";
19
+ messages?: CalendarMessages;
20
+ clearable?: boolean;
21
+ showToday?: boolean;
23
22
  }
24
- export declare function DatePicker({ label, value, onChange, locale, timeZone, disabled, readOnly, required, onValidityChange, min, max }: DatePickerProps): import("react").JSX.Element;
23
+ export declare function DatePicker({ label, value, onChange, locale, timeZone, disabled, readOnly, required, onValidityChange, min, max, startOfWeek, labelPlacement, messages, clearable, showToday, }: DatePickerProps): import("react").JSX.Element;
25
24
  //# sourceMappingURL=date-picker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../src/date-picker.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,UAAU,EAAC,MAAM,CAAC;IAClB,8EAA8E;IAC9E,KAAK,EAAC,MAAM,GAAC,IAAI,CAAC;IAClB,KAAK,EAAC,OAAO,CAAC;IACd,MAAM,EAAC,OAAO,GAAC,UAAU,GAAC,YAAY,GAAC,SAAS,GAAC,gBAAgB,GAAC,eAAe,CAAC;CACnF;AACD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAC,MAAM,CAAC;IACb,0DAA0D;IAC1D,KAAK,EAAC,MAAM,CAAC;IACb,QAAQ,EAAC,CAAC,KAAK,EAAC,MAAM,KAAG,IAAI,CAAC;IAC9B,MAAM,CAAC,EAAC,MAAM,CAAC;IACf,QAAQ,CAAC,EAAC,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAC,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAC,OAAO,CAAC;IAClB,QAAQ,C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AAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACjD,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAqBD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,MAAgB,EAChB,QAAuB,EACvB,QAAgB,EAChB,QAAgB,EAChB,QAAgB,EAChB,gBAAgB,EAChB,GAAG,EACH,GAAG,EACH,WAAe,EACf,cAA0B,EAC1B,QAAQ,EACR,SAAgB,EAChB,SAAgB,GACjB,EAAE,eAAe,+BA+PjB"}
@@ -0,0 +1,198 @@
1
+ import { r as e, t } from "./controls-BajigKUv.js";
2
+ import { a as n, i as r, n as i, o as ee, r as a, s as o, t as s } from "./calendar-view-I_sNlioP.js";
3
+ import { useEffect as c, useRef as l, useState as u } from "react";
4
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
5
+ import { Portal as p } from "@ark-ui/react/portal";
6
+ import { DatePicker as m, parseDate as h } from "@ark-ui/react/date-picker";
7
+ //#region src/date-picker.tsx
8
+ function g() {
9
+ return /* @__PURE__ */ f("svg", {
10
+ width: "20",
11
+ height: "20",
12
+ viewBox: "0 0 24 24",
13
+ fill: "none",
14
+ stroke: "currentColor",
15
+ strokeWidth: "1.5",
16
+ "aria-hidden": "true",
17
+ children: [/* @__PURE__ */ d("rect", {
18
+ x: "3.5",
19
+ y: "5.5",
20
+ width: "17",
21
+ height: "15",
22
+ rx: "2"
23
+ }), /* @__PURE__ */ d("path", { d: "M7.5 3v5M16.5 3v5M3.5 10.5h17" })]
24
+ });
25
+ }
26
+ function _(e) {
27
+ return n(e) ? [h(e)] : [];
28
+ }
29
+ function v({ label: v, value: y, onChange: b, locale: x = "ko-KR", timeZone: S = "Asia/Seoul", disabled: C = !1, readOnly: w = !1, required: T = !1, onValidityChange: E, min: D, max: O, startOfWeek: k = 0, labelPlacement: te = "outside", messages: A, clearable: ne = !0, showToday: re = !0 }) {
30
+ let [j, M] = u(() => r(y, x)), [N, P] = u(() => _(y)), [F, I] = u(!1), L = l(null), R = l(null), z = l(void 0);
31
+ c(() => () => {
32
+ z.current !== void 0 && cancelAnimationFrame(z.current);
33
+ }, []);
34
+ let [B, V] = u(null);
35
+ c(() => {
36
+ let e = L.current;
37
+ e && V(e.closest("[role=\"dialog\"], [role=\"alertdialog\"]") ?? e.ownerDocument.body);
38
+ }, []);
39
+ let H = l(!1), U = l(y), W = l(x), G = l([]), K = l(y), q = l(""), J = i(j, W.current), Y = W.current !== x && n(J) ? r(J, x) : j, X = o(Y, T, D, O, x), Z = a(x, A), Q = X.valid ? void 0 : X.reason === "required" ? Z.required : Z.invalid;
40
+ c(() => {
41
+ let e = W.current;
42
+ if (W.current = x, U.current === y) {
43
+ e !== x && M(Y);
44
+ return;
45
+ }
46
+ U.current = y;
47
+ let t = G.current.indexOf(y);
48
+ if (t !== -1) {
49
+ G.current.splice(t, 1);
50
+ return;
51
+ }
52
+ G.current = [], K.current = y, M(r(y, x)), (y === "" || n(y)) && P(_(y));
53
+ }, [y, x]), c(() => {
54
+ L.current?.setCustomValidity(Q ?? "");
55
+ let e = JSON.stringify(X);
56
+ E && q.current !== e && (q.current = e, E(X));
57
+ }, [
58
+ j,
59
+ T,
60
+ D,
61
+ O,
62
+ x,
63
+ Q,
64
+ E
65
+ ]), c(() => {
66
+ (C || w) && (H.current = !1, I(!1));
67
+ }, [C, w]), c(() => {
68
+ if (!H.current || C || w) return;
69
+ let e = requestAnimationFrame(() => {
70
+ H.current = !1, L.current?.focus({ preventScroll: !0 });
71
+ });
72
+ return () => cancelAnimationFrame(e);
73
+ }, [
74
+ F,
75
+ N,
76
+ C,
77
+ w
78
+ ]);
79
+ function $(e) {
80
+ let t = o(e, T, D, O, x);
81
+ if (e !== "" && !t.valid) return;
82
+ let n = e === "" ? "" : t.value;
83
+ P(_(n)), n !== K.current && (K.current = n, G.current.push(n), b(n));
84
+ }
85
+ function ie(e) {
86
+ M(e);
87
+ let t = o(e, T, D, O, x);
88
+ L.current?.setCustomValidity(t.valid ? "" : Q ?? "Enter a valid date (YYYY-MM-DD)."), (e === "" || t.valid) && (M(r(t.value ?? "", x)), $(e));
89
+ }
90
+ return /* @__PURE__ */ d(e, {
91
+ label: v,
92
+ required: T,
93
+ error: Q,
94
+ className: `dds-date-picker dds-date-picker--${te}`,
95
+ "data-filled": Y === "" ? void 0 : "true",
96
+ children: (e) => /* @__PURE__ */ f(m.Root, {
97
+ locale: x,
98
+ timeZone: S,
99
+ disabled: C,
100
+ readOnly: w,
101
+ required: T,
102
+ invalid: !X.valid,
103
+ open: F && !C && !w,
104
+ onOpenChange: (e) => I(e.open && !C && !w),
105
+ min: D && n(D) ? h(D) : void 0,
106
+ max: O && n(O) ? h(O) : void 0,
107
+ startOfWeek: k,
108
+ minView: "day",
109
+ maxView: "day",
110
+ fixedWeeks: !0,
111
+ translations: {
112
+ dayCell: (e) => Z.selectDate(e.valueText),
113
+ clearTrigger: Z.clear
114
+ },
115
+ value: N,
116
+ format: (e) => r(e.toString(), x),
117
+ onValueChange: (e) => {
118
+ let t = e.value[0]?.toString() || "";
119
+ t !== "" && !o(t, T, D, O, x).valid || (H.current = !0, M(r(t, x)), $(t));
120
+ },
121
+ positioning: {
122
+ placement: "bottom-start",
123
+ gutter: 8,
124
+ strategy: B?.matches("[role=\"dialog\"], [role=\"alertdialog\"]") ? "fixed" : "absolute",
125
+ hideWhenDetached: !!B?.matches("[role=\"dialog\"], [role=\"alertdialog\"]")
126
+ },
127
+ children: [/* @__PURE__ */ f(m.Control, {
128
+ className: "dds-date-picker-control",
129
+ children: [/* @__PURE__ */ d("input", {
130
+ ...e,
131
+ ref: L,
132
+ type: "text",
133
+ value: Y,
134
+ onChange: () => {},
135
+ required: T,
136
+ readOnly: w,
137
+ disabled: C,
138
+ placeholder: ee(x) ? "YYYY/MM/DD" : "YYYY-MM-DD",
139
+ autoComplete: "off",
140
+ autoCorrect: "off",
141
+ spellCheck: !1,
142
+ onInputCapture: (e) => {
143
+ C || w || (e.stopPropagation(), ie(e.currentTarget.value));
144
+ },
145
+ onBlur: () => {
146
+ !C && !w && $(Y);
147
+ },
148
+ onKeyDownCapture: (e) => {
149
+ e.key === "Enter" && !e.nativeEvent.isComposing && (e.preventDefault(), e.stopPropagation(), !C && !w && $(Y));
150
+ }
151
+ }), /* @__PURE__ */ d(m.Trigger, {
152
+ asChild: !0,
153
+ children: /* @__PURE__ */ d(t, {
154
+ ref: R,
155
+ type: "button",
156
+ tone: "secondary",
157
+ "aria-label": `${v} ${Z.openCalendar}`,
158
+ children: /* @__PURE__ */ d(g, {})
159
+ })
160
+ })]
161
+ }), /* @__PURE__ */ d(p, {
162
+ container: B ? { current: B } : void 0,
163
+ children: /* @__PURE__ */ d(m.Positioner, {
164
+ className: "dds-date-picker-positioner",
165
+ children: /* @__PURE__ */ d(m.Content, {
166
+ onKeyDownCapture: (e) => {
167
+ e.key === "Escape" && (H.current = !1, z.current !== void 0 && cancelAnimationFrame(z.current), z.current = requestAnimationFrame(() => {
168
+ z.current = requestAnimationFrame(() => {
169
+ !C && !w && R.current?.focus({ preventScroll: !0 });
170
+ });
171
+ }));
172
+ },
173
+ className: "dds-date-picker-content",
174
+ "aria-label": `${v} 날짜 선택`,
175
+ children: /* @__PURE__ */ d(s, {
176
+ timeZone: S,
177
+ min: D,
178
+ max: O,
179
+ locale: x,
180
+ messages: A,
181
+ disabled: C,
182
+ readOnly: w,
183
+ showToday: re,
184
+ showClear: ne,
185
+ onClear: () => {
186
+ M(""), $("");
187
+ }
188
+ })
189
+ })
190
+ })
191
+ })]
192
+ })
193
+ });
194
+ }
195
+ //#endregion
196
+ export { v as DatePicker };
197
+
198
+ //# sourceMappingURL=date-picker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-picker.js","names":[],"sources":["../src/date-picker.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport {\n DatePicker as ArkDatePicker,\n parseDate,\n} from \"@ark-ui/react/date-picker\";\nimport { Portal } from \"@ark-ui/react/portal\";\nimport { Button, Field } from \"./controls\";\nimport { CalendarView } from \"./calendar-view\";\nimport {\n isCalendarDate,\n isKorean,\n displayDate,\n canonicalInput,\n validateInput,\n dateMessages,\n type CalendarMessages,\n type DatePickerValidity,\n} from \"./date-only\";\nexport type { DatePickerValidity, CalendarMessages } from \"./date-only\";\n\nexport interface DatePickerProps {\n label: string;\n /** ISO calendar date (YYYY-MM-DD), or an empty string. */\n value: string;\n onChange: (value: string) => void;\n locale?: string;\n timeZone?: string;\n disabled?: boolean;\n readOnly?: boolean;\n required?: boolean;\n /** Initial mount and semantic draft changes, deduped across callback identity changes. Key by editor identity for a fresh initial report. Button/API saves must guard validity and use its canonical value. */\n onValidityChange?: (state: DatePickerValidity) => void;\n min?: string;\n max?: string;\n startOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n labelPlacement?: \"outside\" | \"inside\" | \"hidden\";\n messages?: CalendarMessages;\n clearable?: boolean;\n showToday?: boolean;\n}\nfunction CalendarIcon() {\n return (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n aria-hidden=\"true\"\n >\n <rect x=\"3.5\" y=\"5.5\" width=\"17\" height=\"15\" rx=\"2\" />\n <path d=\"M7.5 3v5M16.5 3v5M3.5 10.5h17\" />\n </svg>\n );\n}\nfunction calendarSelection(value: string) {\n return isCalendarDate(value) ? [parseDate(value)] : [];\n}\n\nexport function DatePicker({\n label,\n value,\n onChange,\n locale = \"ko-KR\",\n timeZone = \"Asia/Seoul\",\n disabled = false,\n readOnly = false,\n required = false,\n onValidityChange,\n min,\n max,\n startOfWeek = 0,\n labelPlacement = \"outside\",\n messages,\n clearable = true,\n showToday = true,\n}: DatePickerProps) {\n const [draft, setDraft] = useState(() => displayDate(value, locale));\n const [selection, setSelection] = useState(() => calendarSelection(value));\n const [open, setOpen] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const escapeFrame = useRef<number | undefined>(undefined);\n useEffect(\n () => () => {\n if (escapeFrame.current !== undefined)\n cancelAnimationFrame(escapeFrame.current);\n },\n [],\n );\n const [portalMount, setPortalMount] = useState<HTMLElement | null>(null);\n useEffect(() => {\n const input = inputRef.current;\n if (input) {\n // A modal hides its body siblings from assistive technology. Keep the\n // calendar within that modal while preserving the server Portal boundary.\n setPortalMount(\n input.closest<HTMLElement>('[role=\"dialog\"], [role=\"alertdialog\"]') ??\n input.ownerDocument.body,\n );\n }\n }, []);\n const restoreInputFocus = useRef(false);\n const observedValue = useRef(value);\n const observedLocale = useRef(locale);\n // Every outstanding emission is retained, including repeated B/C/B values.\n // Entries end on acknowledgement, an unmatched external reset, or unmount.\n const pendingEchoes = useRef<string[]>([]);\n const emittedValue = useRef(value);\n const notified = useRef(\"\");\n // Convert a complete draft before reporting validity in the new locale.\n const canonicalDraft = canonicalInput(draft, observedLocale.current);\n const effectiveDraft =\n observedLocale.current !== locale && isCalendarDate(canonicalDraft)\n ? displayDate(canonicalDraft, locale)\n : draft;\n const validity = validateInput(effectiveDraft, required, min, max, locale);\n const text = dateMessages(locale, messages);\n const error = validity.valid\n ? undefined\n : validity.reason === \"required\"\n ? text.required\n : text.invalid;\n useEffect(() => {\n const previousLocale = observedLocale.current;\n observedLocale.current = locale;\n if (observedValue.current === value) {\n if (previousLocale !== locale) setDraft(effectiveDraft);\n return;\n }\n observedValue.current = value;\n // A matched outstanding value is an acknowledgement, not a draft reset.\n const acknowledged = pendingEchoes.current.indexOf(value);\n if (acknowledged !== -1) {\n pendingEchoes.current.splice(acknowledged, 1);\n return;\n }\n pendingEchoes.current = [];\n emittedValue.current = value;\n setDraft(displayDate(value, locale));\n if (value === \"\" || isCalendarDate(value))\n setSelection(calendarSelection(value));\n }, [value, locale]);\n useEffect(() => {\n inputRef.current?.setCustomValidity(error ?? \"\");\n const key = JSON.stringify(validity);\n if (onValidityChange && notified.current !== key) {\n notified.current = key;\n onValidityChange(validity);\n }\n }, [draft, required, min, max, locale, error, onValidityChange]);\n useEffect(() => {\n if (disabled || readOnly) {\n restoreInputFocus.current = false;\n setOpen(false);\n }\n }, [disabled, readOnly]);\n // Ark's calendar restores focus to its trigger when it does not own an Input.\n // Return to the DDS input after that calendar frame; cancel on lock/unmount.\n useEffect(() => {\n if (!restoreInputFocus.current || disabled || readOnly) return;\n const frame = requestAnimationFrame(() => {\n restoreInputFocus.current = false;\n inputRef.current?.focus({ preventScroll: true });\n });\n return () => cancelAnimationFrame(frame);\n }, [open, selection, disabled, readOnly]);\n function commit(next: string) {\n const state = validateInput(next, required, min, max, locale);\n if (next !== \"\" && !state.valid) return;\n const canonical = next === \"\" ? \"\" : state.value!;\n setSelection(calendarSelection(canonical));\n // Blur/Enter must not emit the same local commit again while props lag.\n if (canonical !== emittedValue.current) {\n emittedValue.current = canonical;\n pendingEchoes.current.push(canonical);\n onChange(canonical);\n }\n }\n function changeDraft(next: string) {\n setDraft(next);\n const state = validateInput(next, required, min, max, locale);\n // Native form submission and callback-based saves both see this edit.\n inputRef.current?.setCustomValidity(\n state.valid ? \"\" : (error ?? \"Enter a valid date (YYYY-MM-DD).\"),\n );\n if (next === \"\" || state.valid) {\n setDraft(displayDate(state.value ?? \"\", locale));\n commit(next);\n }\n }\n return (\n <Field\n label={label}\n required={required}\n error={error}\n className={`dds-date-picker dds-date-picker--${labelPlacement}`}\n data-filled={effectiveDraft !== \"\" ? \"true\" : undefined}\n >\n {(control) => (\n <ArkDatePicker.Root\n locale={locale}\n timeZone={timeZone}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n invalid={!validity.valid}\n open={open && !disabled && !readOnly}\n onOpenChange={(details) =>\n setOpen(details.open && !disabled && !readOnly)\n }\n min={min && isCalendarDate(min) ? parseDate(min) : undefined}\n max={max && isCalendarDate(max) ? parseDate(max) : undefined}\n startOfWeek={startOfWeek}\n minView=\"day\"\n maxView=\"day\"\n fixedWeeks\n translations={{\n dayCell: (state) => text.selectDate(state.valueText),\n clearTrigger: text.clear,\n }}\n value={selection}\n format={(v) => displayDate(v.toString(), locale)}\n onValueChange={(details) => {\n const next = details.value[0]?.toString() || \"\";\n if (\n next !== \"\" &&\n !validateInput(next, required, min, max, locale).valid\n )\n return;\n restoreInputFocus.current = true;\n setDraft(displayDate(next, locale));\n commit(next);\n }}\n positioning={{\n placement: \"bottom-start\",\n gutter: 8,\n strategy: portalMount?.matches(\n '[role=\"dialog\"], [role=\"alertdialog\"]',\n )\n ? \"fixed\"\n : \"absolute\",\n hideWhenDetached: !!portalMount?.matches(\n '[role=\"dialog\"], [role=\"alertdialog\"]',\n ),\n }}\n >\n {/* DDS owns the raw text input; Ark owns calendar interaction, not draft DOM writes. */}\n <ArkDatePicker.Control className=\"dds-date-picker-control\">\n <input\n {...control}\n ref={inputRef}\n type=\"text\"\n value={effectiveDraft}\n onChange={() => {}}\n required={required}\n readOnly={readOnly}\n disabled={disabled}\n placeholder={isKorean(locale) ? \"YYYY/MM/DD\" : \"YYYY-MM-DD\"}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n spellCheck={false}\n onInputCapture={(event) => {\n if (disabled || readOnly) return;\n event.stopPropagation();\n changeDraft(event.currentTarget.value);\n }}\n onBlur={() => {\n if (!disabled && !readOnly) commit(effectiveDraft);\n }}\n onKeyDownCapture={(event) => {\n if (event.key === \"Enter\" && !event.nativeEvent.isComposing) {\n event.preventDefault();\n event.stopPropagation();\n if (!disabled && !readOnly) commit(effectiveDraft);\n }\n }}\n />\n <ArkDatePicker.Trigger asChild>\n <Button\n ref={triggerRef}\n type=\"button\"\n tone=\"secondary\"\n aria-label={`${label} ${text.openCalendar}`}\n >\n <CalendarIcon />\n </Button>\n </ArkDatePicker.Trigger>\n </ArkDatePicker.Control>\n <Portal\n container={portalMount ? { current: portalMount } : undefined}\n >\n <ArkDatePicker.Positioner className=\"dds-date-picker-positioner\">\n <ArkDatePicker.Content\n onKeyDownCapture={(event) => {\n if (event.key !== \"Escape\") return;\n restoreInputFocus.current = false;\n if (escapeFrame.current !== undefined)\n cancelAnimationFrame(escapeFrame.current);\n escapeFrame.current = requestAnimationFrame(() => {\n escapeFrame.current = requestAnimationFrame(() => {\n if (!disabled && !readOnly)\n triggerRef.current?.focus({ preventScroll: true });\n });\n });\n }}\n className=\"dds-date-picker-content\"\n aria-label={`${label} 날짜 선택`}\n >\n <CalendarView\n timeZone={timeZone}\n min={min}\n max={max}\n locale={locale}\n messages={messages}\n disabled={disabled}\n readOnly={readOnly}\n showToday={showToday}\n showClear={clearable}\n onClear={() => {\n setDraft(\"\");\n commit(\"\");\n }}\n />\n </ArkDatePicker.Content>\n </ArkDatePicker.Positioner>\n </Portal>\n </ArkDatePicker.Root>\n )}\n </Field>\n );\n}\n"],"mappings":";;;;;;;AAwCA,SAAS,IAAe;CACtB,OACE,kBAAC,OAAD;EACE,OAAM;EACN,QAAO;EACP,SAAQ;EACR,MAAK;EACL,QAAO;EACP,aAAY;EACZ,eAAY;EAPd,UAAA,CASE,kBAAC,QAAD;GAAM,GAAE;GAAM,GAAE;GAAM,OAAM;GAAK,QAAO;GAAK,IAAG;EAAK,CAAA,GACrD,kBAAC,QAAD,EAAM,GAAE,gCAAiC,CAAA,CACtC;;AAET;AACA,SAAS,EAAkB,GAAe;CACxC,OAAO,EAAe,CAAK,IAAI,CAAC,EAAU,CAAK,CAAC,IAAI,CAAC;AACvD;AAEA,SAAgB,EAAW,EACzB,UACA,UACA,aACA,YAAS,SACT,cAAW,cACX,cAAW,IACX,cAAW,IACX,cAAW,IACX,qBACA,QACA,QACA,iBAAc,GACd,qBAAiB,WACjB,aACA,gBAAY,IACZ,gBAAY,MACM;CAClB,IAAM,CAAC,GAAO,KAAY,QAAe,EAAY,GAAO,CAAM,CAAC,GAC7D,CAAC,GAAW,KAAgB,QAAe,EAAkB,CAAK,CAAC,GACnE,CAAC,GAAM,KAAW,EAA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