@inshorts/glint-ui 0.5.4 → 0.6.1
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.
- package/README.md +3 -1
- package/dist/alert.cjs +96 -0
- package/dist/alert.cjs.map +1 -0
- package/dist/alert.d.cts +29 -0
- package/dist/alert.d.ts +29 -0
- package/dist/alert.js +10 -0
- package/dist/alert.js.map +1 -0
- package/dist/autocomplete.cjs +578 -0
- package/dist/autocomplete.cjs.map +1 -0
- package/dist/autocomplete.d.cts +56 -0
- package/dist/autocomplete.d.ts +56 -0
- package/dist/autocomplete.js +11 -0
- package/dist/autocomplete.js.map +1 -0
- package/dist/badge.cjs +89 -0
- package/dist/badge.cjs.map +1 -0
- package/dist/badge.d.cts +25 -0
- package/dist/badge.d.ts +25 -0
- package/dist/badge.js +10 -0
- package/dist/badge.js.map +1 -0
- package/dist/breadcrumb.cjs +88 -0
- package/dist/breadcrumb.cjs.map +1 -0
- package/dist/breadcrumb.d.cts +14 -0
- package/dist/breadcrumb.d.ts +14 -0
- package/dist/breadcrumb.js +8 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/button.cjs +143 -0
- package/dist/button.cjs.map +1 -0
- package/dist/button.d.cts +34 -0
- package/dist/button.d.ts +34 -0
- package/dist/button.js +9 -0
- package/dist/button.js.map +1 -0
- package/dist/card.cjs +111 -0
- package/dist/card.cjs.map +1 -0
- package/dist/card.d.cts +15 -0
- package/dist/card.d.ts +15 -0
- package/dist/card.js +18 -0
- package/dist/card.js.map +1 -0
- package/dist/checkbox.cjs +66 -0
- package/dist/checkbox.cjs.map +1 -0
- package/{src/checkbox.tsx → dist/checkbox.d.cts} +5 -22
- package/dist/checkbox.d.ts +25 -0
- package/dist/checkbox.js +10 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/chunk-5MEOZHJA.js +513 -0
- package/dist/chunk-5MEOZHJA.js.map +1 -0
- package/dist/chunk-67ACNS42.js +29 -0
- package/dist/chunk-67ACNS42.js.map +1 -0
- package/dist/chunk-A6GRLKOO.js +85 -0
- package/dist/chunk-A6GRLKOO.js.map +1 -0
- package/dist/chunk-DS3QYIKL.js +90 -0
- package/dist/chunk-DS3QYIKL.js.map +1 -0
- package/dist/chunk-EWSBFU54.js +53 -0
- package/dist/chunk-EWSBFU54.js.map +1 -0
- package/dist/chunk-G4ZQUSAJ.js +38 -0
- package/dist/chunk-G4ZQUSAJ.js.map +1 -0
- package/dist/chunk-GMCUXEFI.js +67 -0
- package/dist/chunk-GMCUXEFI.js.map +1 -0
- package/dist/chunk-HBBOR43A.js +85 -0
- package/dist/chunk-HBBOR43A.js.map +1 -0
- package/dist/chunk-HCA5ODCD.js +11 -0
- package/dist/chunk-HCA5ODCD.js.map +1 -0
- package/dist/chunk-HYRJYUPI.js +26 -0
- package/dist/chunk-HYRJYUPI.js.map +1 -0
- package/dist/chunk-IRCTGJQB.js +26 -0
- package/dist/chunk-IRCTGJQB.js.map +1 -0
- package/dist/chunk-ISPICB4W.js +70 -0
- package/dist/chunk-ISPICB4W.js.map +1 -0
- package/dist/chunk-JDE5XYPT.js +30 -0
- package/dist/chunk-JDE5XYPT.js.map +1 -0
- package/dist/chunk-JSJEEKR3.js +59 -0
- package/dist/chunk-JSJEEKR3.js.map +1 -0
- package/dist/chunk-KR3BCFP7.js +85 -0
- package/dist/chunk-KR3BCFP7.js.map +1 -0
- package/dist/chunk-MLRSOTFI.js +81 -0
- package/dist/chunk-MLRSOTFI.js.map +1 -0
- package/dist/chunk-MQT5RAQV.js +202 -0
- package/dist/chunk-MQT5RAQV.js.map +1 -0
- package/dist/chunk-MUPW2TFJ.js +102 -0
- package/dist/chunk-MUPW2TFJ.js.map +1 -0
- package/dist/chunk-OUYT6SPU.js +76 -0
- package/dist/chunk-OUYT6SPU.js.map +1 -0
- package/dist/chunk-PM2VE7DJ.js +100 -0
- package/dist/chunk-PM2VE7DJ.js.map +1 -0
- package/dist/chunk-PPYR3O3L.js +44 -0
- package/dist/chunk-PPYR3O3L.js.map +1 -0
- package/dist/chunk-PUTC52SI.js +98 -0
- package/dist/chunk-PUTC52SI.js.map +1 -0
- package/dist/chunk-PWAKTEXF.js +18 -0
- package/dist/chunk-PWAKTEXF.js.map +1 -0
- package/dist/chunk-QTFWORA7.js +26 -0
- package/dist/chunk-QTFWORA7.js.map +1 -0
- package/dist/chunk-RUPL2H6V.js +49 -0
- package/dist/chunk-RUPL2H6V.js.map +1 -0
- package/dist/chunk-S7PVZAPL.js +28 -0
- package/dist/chunk-S7PVZAPL.js.map +1 -0
- package/dist/chunk-SQDV2AKJ.js +49 -0
- package/dist/chunk-SQDV2AKJ.js.map +1 -0
- package/dist/chunk-T2KXVH3O.js +297 -0
- package/dist/chunk-T2KXVH3O.js.map +1 -0
- package/dist/chunk-T4WCCHJQ.js +29 -0
- package/dist/chunk-T4WCCHJQ.js.map +1 -0
- package/dist/chunk-UC3ZIQPE.js +93 -0
- package/dist/chunk-UC3ZIQPE.js.map +1 -0
- package/dist/chunk-UE7JY7VR.js +28 -0
- package/dist/chunk-UE7JY7VR.js.map +1 -0
- package/dist/chunk-Y5WCT6XN.js +93 -0
- package/dist/chunk-Y5WCT6XN.js.map +1 -0
- package/dist/chunk-YDICVETX.js +151 -0
- package/dist/chunk-YDICVETX.js.map +1 -0
- package/dist/chunk-ZFSQVMLJ.js +126 -0
- package/dist/chunk-ZFSQVMLJ.js.map +1 -0
- package/dist/chunk-ZHATD73Y.js +46 -0
- package/dist/chunk-ZHATD73Y.js.map +1 -0
- package/dist/chunk-ZLAA4DGG.js +111 -0
- package/dist/chunk-ZLAA4DGG.js.map +1 -0
- package/dist/chunk-ZP252OJZ.js +56 -0
- package/dist/chunk-ZP252OJZ.js.map +1 -0
- package/dist/clipboard.cjs +125 -0
- package/dist/clipboard.cjs.map +1 -0
- package/dist/clipboard.d.cts +52 -0
- package/dist/clipboard.d.ts +52 -0
- package/dist/clipboard.js +23 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/collapsible.cjs +94 -0
- package/dist/collapsible.cjs.map +1 -0
- package/dist/collapsible.d.cts +21 -0
- package/dist/collapsible.d.ts +21 -0
- package/dist/collapsible.js +9 -0
- package/dist/collapsible.js.map +1 -0
- package/dist/confirm-dialog.cjs +369 -0
- package/dist/confirm-dialog.cjs.map +1 -0
- package/dist/confirm-dialog.d.cts +16 -0
- package/dist/confirm-dialog.d.ts +16 -0
- package/dist/confirm-dialog.js +13 -0
- package/dist/confirm-dialog.js.map +1 -0
- package/dist/copy-button.cjs +102 -0
- package/dist/copy-button.cjs.map +1 -0
- package/dist/copy-button.d.cts +18 -0
- package/dist/copy-button.d.ts +18 -0
- package/dist/copy-button.js +10 -0
- package/dist/copy-button.js.map +1 -0
- package/dist/data-table.cjs +140 -0
- package/dist/data-table.cjs.map +1 -0
- package/dist/data-table.d.cts +81 -0
- package/dist/data-table.d.ts +81 -0
- package/dist/data-table.js +8 -0
- package/dist/data-table.js.map +1 -0
- package/dist/date-range-picker/dateRange.cjs +138 -0
- package/dist/date-range-picker/dateRange.cjs.map +1 -0
- package/dist/date-range-picker/dateRange.d.cts +57 -0
- package/dist/date-range-picker/dateRange.d.ts +57 -0
- package/dist/date-range-picker/dateRange.js +31 -0
- package/dist/date-range-picker/dateRange.js.map +1 -0
- package/dist/date-range-picker/index.cjs +375 -0
- package/dist/date-range-picker/index.cjs.map +1 -0
- package/dist/date-range-picker/index.d.cts +18 -0
- package/dist/date-range-picker/index.d.ts +18 -0
- package/dist/date-range-picker/index.js +10 -0
- package/dist/date-range-picker/index.js.map +1 -0
- package/dist/dialogLayer.cjs +121 -0
- package/dist/dialogLayer.cjs.map +1 -0
- package/dist/dialogLayer.d.cts +11 -0
- package/dist/dialogLayer.d.ts +11 -0
- package/dist/dialogLayer.js +8 -0
- package/dist/dialogLayer.js.map +1 -0
- package/dist/feature-access-gate.cjs +160 -0
- package/dist/feature-access-gate.cjs.map +1 -0
- package/dist/feature-access-gate.d.cts +14 -0
- package/dist/feature-access-gate.d.ts +14 -0
- package/dist/feature-access-gate.js +11 -0
- package/dist/feature-access-gate.js.map +1 -0
- package/dist/field.cjs +58 -0
- package/dist/field.cjs.map +1 -0
- package/dist/field.d.cts +23 -0
- package/dist/field.d.ts +23 -0
- package/dist/field.js +8 -0
- package/dist/field.js.map +1 -0
- package/dist/image-uploader.cjs +293 -0
- package/dist/image-uploader.cjs.map +1 -0
- package/dist/image-uploader.d.cts +34 -0
- package/dist/image-uploader.d.ts +34 -0
- package/dist/image-uploader.js +12 -0
- package/dist/image-uploader.js.map +1 -0
- package/dist/index.cjs +3008 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +41 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +232 -0
- package/dist/index.js.map +1 -0
- package/dist/input.cjs +58 -0
- package/dist/input.cjs.map +1 -0
- package/dist/input.d.cts +7 -0
- package/dist/input.d.ts +7 -0
- package/dist/input.js +10 -0
- package/dist/input.js.map +1 -0
- package/dist/label.cjs +67 -0
- package/dist/label.cjs.map +1 -0
- package/dist/label.d.cts +7 -0
- package/dist/label.d.ts +7 -0
- package/dist/label.js +9 -0
- package/dist/label.js.map +1 -0
- package/dist/modal.cjs +212 -0
- package/dist/modal.cjs.map +1 -0
- package/dist/modal.d.cts +39 -0
- package/dist/modal.d.ts +39 -0
- package/dist/modal.js +12 -0
- package/dist/modal.js.map +1 -0
- package/dist/page-header.cjs +78 -0
- package/dist/page-header.cjs.map +1 -0
- package/dist/page-header.d.cts +35 -0
- package/dist/page-header.d.ts +35 -0
- package/dist/page-header.js +8 -0
- package/dist/page-header.js.map +1 -0
- package/dist/pagination.cjs +237 -0
- package/dist/pagination.cjs.map +1 -0
- package/dist/pagination.d.cts +15 -0
- package/dist/pagination.d.ts +15 -0
- package/dist/pagination.js +11 -0
- package/dist/pagination.js.map +1 -0
- package/dist/panel-brand-mark.cjs +59 -0
- package/dist/panel-brand-mark.cjs.map +1 -0
- package/dist/panel-brand-mark.d.cts +13 -0
- package/dist/panel-brand-mark.d.ts +13 -0
- package/dist/panel-brand-mark.js +8 -0
- package/dist/panel-brand-mark.js.map +1 -0
- package/dist/panel-sign-in.cjs +256 -0
- package/dist/panel-sign-in.cjs.map +1 -0
- package/dist/panel-sign-in.d.cts +31 -0
- package/dist/panel-sign-in.d.ts +31 -0
- package/dist/panel-sign-in.js +14 -0
- package/dist/panel-sign-in.js.map +1 -0
- package/dist/segmented-control.cjs +122 -0
- package/dist/segmented-control.cjs.map +1 -0
- package/dist/segmented-control.d.cts +58 -0
- package/dist/segmented-control.d.ts +58 -0
- package/dist/segmented-control.js +9 -0
- package/dist/segmented-control.js.map +1 -0
- package/dist/select.cjs +648 -0
- package/dist/select.cjs.map +1 -0
- package/dist/select.d.cts +30 -0
- package/dist/select.d.ts +30 -0
- package/dist/select.js +12 -0
- package/dist/select.js.map +1 -0
- package/dist/separator.cjs +70 -0
- package/dist/separator.cjs.map +1 -0
- package/dist/separator.d.cts +13 -0
- package/dist/separator.d.ts +13 -0
- package/dist/separator.js +9 -0
- package/dist/separator.js.map +1 -0
- package/dist/side-drawer.cjs +321 -0
- package/dist/side-drawer.cjs.map +1 -0
- package/dist/side-drawer.d.cts +21 -0
- package/dist/side-drawer.d.ts +21 -0
- package/dist/side-drawer.js +13 -0
- package/dist/side-drawer.js.map +1 -0
- package/dist/spinner.cjs +57 -0
- package/dist/spinner.cjs.map +1 -0
- package/{src/spinner.tsx → dist/spinner.d.cts} +11 -22
- package/dist/spinner.d.ts +27 -0
- package/dist/spinner.js +8 -0
- package/dist/spinner.js.map +1 -0
- package/dist/spreadsheet-grid.cjs +238 -0
- package/dist/spreadsheet-grid.cjs.map +1 -0
- package/dist/spreadsheet-grid.d.cts +48 -0
- package/dist/spreadsheet-grid.d.ts +48 -0
- package/dist/spreadsheet-grid.js +8 -0
- package/dist/spreadsheet-grid.js.map +1 -0
- package/dist/state-panel.cjs +86 -0
- package/dist/state-panel.cjs.map +1 -0
- package/dist/state-panel.d.cts +23 -0
- package/dist/state-panel.d.ts +23 -0
- package/dist/state-panel.js +9 -0
- package/dist/state-panel.js.map +1 -0
- package/dist/switch.cjs +87 -0
- package/dist/switch.cjs.map +1 -0
- package/dist/switch.d.cts +13 -0
- package/dist/switch.d.ts +13 -0
- package/dist/switch.js +9 -0
- package/dist/switch.js.map +1 -0
- package/dist/table.cjs +139 -0
- package/dist/table.cjs.map +1 -0
- package/dist/table.d.cts +16 -0
- package/dist/table.d.ts +16 -0
- package/dist/table.js +22 -0
- package/dist/table.js.map +1 -0
- package/dist/tabs.cjs +168 -0
- package/dist/tabs.cjs.map +1 -0
- package/dist/tabs.d.cts +59 -0
- package/dist/tabs.d.ts +59 -0
- package/dist/tabs.js +11 -0
- package/dist/tabs.js.map +1 -0
- package/dist/textarea.cjs +66 -0
- package/dist/textarea.cjs.map +1 -0
- package/dist/textarea.d.cts +18 -0
- package/dist/textarea.d.ts +18 -0
- package/dist/textarea.js +10 -0
- package/dist/textarea.js.map +1 -0
- package/dist/utils.cjs +35 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +5 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +7 -0
- package/dist/utils.js.map +1 -0
- package/package.json +391 -14
- package/src/alert.tsx +0 -74
- package/src/autocomplete.tsx +0 -666
- package/src/badge.tsx +0 -60
- package/src/breadcrumb.tsx +0 -71
- package/src/button.tsx +0 -113
- package/src/card.tsx +0 -79
- package/src/clipboard.ts +0 -144
- package/src/collapsible.tsx +0 -63
- package/src/confirm-dialog.tsx +0 -84
- package/src/copy-button.tsx +0 -58
- package/src/data-table.tsx +0 -190
- package/src/date-range-picker/dateRange.ts +0 -142
- package/src/date-range-picker/index.tsx +0 -366
- package/src/dialogLayer.ts +0 -142
- package/src/feature-access-gate.tsx +0 -38
- package/src/field.tsx +0 -56
- package/src/image-uploader.tsx +0 -181
- package/src/index.ts +0 -37
- package/src/input.tsx +0 -16
- package/src/label.tsx +0 -23
- package/src/modal.tsx +0 -117
- package/src/page-header.tsx +0 -75
- package/src/pagination.tsx +0 -116
- package/src/panel-brand-mark.tsx +0 -32
- package/src/panel-sign-in.tsx +0 -134
- package/src/segmented-control.tsx +0 -155
- package/src/select.tsx +0 -105
- package/src/separator.tsx +0 -32
- package/src/side-drawer.tsx +0 -87
- package/src/spreadsheet-grid.tsx +0 -264
- package/src/state-panel.tsx +0 -46
- package/src/switch.tsx +0 -47
- package/src/table.tsx +0 -110
- package/src/tabs.tsx +0 -201
- package/src/textarea.tsx +0 -32
- package/src/utils.ts +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/select.tsx","../src/autocomplete.tsx","../src/modal.tsx","../src/utils.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { Autocomplete, type AutocompleteOption } from \"./autocomplete\";\n\ntype SelectChange = {\n target: { value: string };\n currentTarget: { value: string };\n};\n\nexport type SelectProps = {\n id?: string;\n className?: string;\n disabled?: boolean;\n /** Accessible name when the control is not wrapped in a label. */\n \"aria-label\"?: string;\n /** `compact` fits a spreadsheet cell. Typing still filters the list. */\n size?: \"default\" | \"compact\";\n value?: string | number | readonly string[];\n placeholder?: string;\n children?: React.ReactNode;\n onChange?: (event: SelectChange) => void;\n};\n\nfunction optionText(node: React.ReactNode): string {\n if (node == null || typeof node === \"boolean\") return \"\";\n if (typeof node === \"string\" || typeof node === \"number\") return String(node);\n if (Array.isArray(node)) return node.map(optionText).join(\"\");\n if (React.isValidElement<{ children?: React.ReactNode }>(node)) {\n return optionText(node.props.children);\n }\n return \"\";\n}\n\nfunction optionsFromChildren(children: React.ReactNode): AutocompleteOption[] {\n const options: AutocompleteOption[] = [];\n React.Children.forEach(children, (child) => {\n if (!React.isValidElement(child)) return;\n if (child.type === React.Fragment) {\n options.push(\n ...optionsFromChildren(\n (child.props as { children?: React.ReactNode }).children,\n ),\n );\n return;\n }\n const props = child.props as {\n value?: string | number;\n disabled?: boolean;\n children?: React.ReactNode;\n };\n const value = props.value == null ? \"\" : String(props.value);\n options.push({\n value,\n label: optionText(props.children).trim() || value,\n disabled: Boolean(props.disabled),\n });\n });\n return options;\n}\n\n/**\n * The dropdown. It is the searchable autocomplete, not a native `<select>`,\n * so a long list can be typed into and an empty list still opens.\n */\nexport function Select({\n id,\n className,\n disabled,\n value,\n placeholder,\n children,\n onChange,\n size = \"default\",\n \"aria-label\": ariaLabel,\n}: SelectProps) {\n const options = optionsFromChildren(children);\n const current = Array.isArray(value)\n ? String(value[0] ?? \"\")\n : value == null\n ? \"\"\n : String(value);\n const blank = options.find((option) => option.value === \"\");\n\n return (\n <Autocomplete\n id={id}\n className={className}\n disabled={Boolean(disabled)}\n ariaLabel={ariaLabel}\n size={size}\n options={options}\n value={current}\n clearable={false}\n placeholder={placeholder ?? blank?.label ?? \"Search…\"}\n onChange={(next) =>\n onChange?.({\n target: { value: next },\n currentTarget: { value: next },\n })\n }\n />\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Check, ChevronDown, Search, X } from \"lucide-react\";\n\nimport { useHasMounted } from \"./modal\";\nimport { cn } from \"./utils\";\n\n/** Room the list wants below the control before it gives up and flips. */\nconst PREFERRED_LIST_HEIGHT = 224;\n/** Below this there is no point opening downward at all. */\nconst MIN_LIST_HEIGHT = 120;\nconst VIEWPORT_MARGIN = 8;\nconst ANCHOR_GAP = 4;\n\ntype DropdownPosition = {\n left: number;\n width: number;\n maxHeight: number;\n /** One of the two is set: `top` opens downward, `bottom` opens upward. */\n top?: number;\n bottom?: number;\n};\n\nexport type AutocompleteOption = {\n value: string;\n label: string;\n disabled?: boolean;\n};\n\ntype BaseAutocompleteProps = {\n options: AutocompleteOption[];\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n emptyMessage?: string;\n id?: string;\n /**\n * Accessible name for the combobox.\n *\n * `Field` renders its label as a `<span>`, so without this the control is\n * announced as an unnamed combobox and cannot be queried by name — the\n * filter toolbars work around it by counting comboboxes on the page.\n */\n ariaLabel?: string;\n /**\n * `compact` is the spreadsheet cell: no search icon, no min height, and a\n * list wide enough to read a name. The closed control still shows the\n * chosen label, and typing filters the list.\n */\n size?: \"default\" | \"compact\";\n /**\n * Type a value and press Enter (or paste a list) to add it, like antd\n * `Select mode=\"tags\"`. With `multiple` a pasted list is split into several\n * values; on a single-value control it accepts one typed value the options\n * do not offer — an id for a record the list has not loaded, say.\n */\n creatable?: boolean;\n /**\n * Shows the clear button once a value is chosen. Off for dropdowns that\n * always keep one of their options, where clearing would blank a required\n * field.\n */\n clearable?: boolean;\n};\n\ntype SingleAutocompleteProps = BaseAutocompleteProps & {\n multiple?: false;\n value: string;\n onChange: (value: string) => void;\n};\n\ntype MultipleAutocompleteProps = BaseAutocompleteProps & {\n multiple: true;\n value: string[];\n onChange: (value: string[]) => void;\n};\n\nexport type AutocompleteProps =\n SingleAutocompleteProps | MultipleAutocompleteProps;\n\nfunction normalizeQuery(query: string) {\n return query.trim().toLowerCase();\n}\n\nfunction filterOptions(options: AutocompleteOption[], query: string) {\n const normalized = normalizeQuery(query);\n if (!normalized) return options;\n\n return options.filter(\n (option) =>\n option.label.toLowerCase().includes(normalized) ||\n option.value.toLowerCase().includes(normalized),\n );\n}\n\nfunction getOptionLabel(options: AutocompleteOption[], value: string) {\n return options.find((option) => option.value === value)?.label ?? value;\n}\n\nfunction parseTagTokens(raw: string): string[] {\n const seen = new Set<string>();\n const tokens: string[] = [];\n for (const part of raw.split(/[\\s,]+/)) {\n const token = part.trim();\n if (!token || seen.has(token)) continue;\n seen.add(token);\n tokens.push(token);\n }\n return tokens;\n}\n\nexport function Autocomplete(props: AutocompleteProps) {\n const {\n options,\n placeholder = \"Search…\",\n disabled = false,\n className,\n emptyMessage = \"No results found\",\n id,\n ariaLabel,\n size = \"default\",\n creatable = false,\n clearable = true,\n } = props;\n\n const multiple = props.multiple ?? false;\n const singleValue = multiple\n ? undefined\n : (props as SingleAutocompleteProps).value;\n const multipleValue = multiple\n ? (props as MultipleAutocompleteProps).value\n : undefined;\n\n // Memoized so dependent callbacks below keep stable identities across renders.\n const selectedValues = React.useMemo<string[]>(() => {\n if (multiple) return multipleValue ?? [];\n return singleValue ? [singleValue] : [];\n }, [multiple, multipleValue, singleValue]);\n\n const onSingleChange = !multiple\n ? (props as SingleAutocompleteProps).onChange\n : undefined;\n const onMultipleChange = multiple\n ? (props as MultipleAutocompleteProps).onChange\n : undefined;\n\n const containerRef = React.useRef<HTMLDivElement>(null);\n const dropdownRef = React.useRef<HTMLDivElement>(null);\n const inputRef = React.useRef<HTMLInputElement>(null);\n const listRef = React.useRef<HTMLUListElement>(null);\n const ignoreBlurRef = React.useRef(false);\n\n const mounted = useHasMounted();\n const [open, setOpen] = React.useState(false);\n const [position, setPosition] = React.useState<DropdownPosition | null>(null);\n const [query, setQuery] = React.useState(\"\");\n const [highlightedIndex, setHighlightedIndex] = React.useState(0);\n\n const filteredOptions = React.useMemo(\n () => filterOptions(options, query),\n [options, query],\n );\n\n // Clamp during render instead of via a setState-in-effect: if the option list\n // shrinks below the stored index, fall back to the last valid row.\n const safeHighlightedIndex =\n highlightedIndex >= filteredOptions.length\n ? Math.max(filteredOptions.length - 1, 0)\n : highlightedIndex;\n\n const close = React.useCallback(() => {\n setOpen(false);\n setQuery(\"\");\n setHighlightedIndex(0);\n }, []);\n\n const openDropdown = React.useCallback(() => {\n if (disabled) return;\n setOpen(true);\n setHighlightedIndex(0);\n }, [disabled]);\n\n const commitSingleValue = React.useCallback(\n (value: string) => {\n if (!multiple) {\n onSingleChange?.(value);\n close();\n }\n },\n [close, multiple, onSingleChange],\n );\n\n const toggleMultipleValue = React.useCallback(\n (value: string) => {\n if (!multiple || !onMultipleChange) return;\n\n onMultipleChange(\n selectedValues.includes(value)\n ? selectedValues.filter((item) => item !== value)\n : [...selectedValues, value],\n );\n setQuery(\"\");\n setHighlightedIndex(0);\n },\n [multiple, onMultipleChange, selectedValues],\n );\n\n const commitCustomValues = React.useCallback(\n (raw: string) => {\n if (!creatable) return;\n\n if (!multiple) {\n const value = raw.trim();\n if (!value) return;\n commitSingleValue(value);\n return;\n }\n\n if (!onMultipleChange) return;\n const tokens = parseTagTokens(raw);\n if (!tokens.length) return;\n const next = [...selectedValues];\n for (const token of tokens) {\n if (!next.includes(token)) next.push(token);\n }\n onMultipleChange(next);\n setQuery(\"\");\n setHighlightedIndex(0);\n },\n [commitSingleValue, creatable, multiple, onMultipleChange, selectedValues],\n );\n\n const removeValue = React.useCallback(\n (value: string) => {\n if (!multiple || !onMultipleChange) return;\n onMultipleChange(selectedValues.filter((item) => item !== value));\n window.requestAnimationFrame(() => inputRef.current?.focus());\n },\n [multiple, onMultipleChange, selectedValues],\n );\n\n const selectOption = React.useCallback(\n (option: AutocompleteOption) => {\n if (option.disabled) return;\n\n ignoreBlurRef.current = true;\n window.setTimeout(() => {\n ignoreBlurRef.current = false;\n }, 0);\n\n if (multiple) {\n toggleMultipleValue(option.value);\n window.requestAnimationFrame(() => inputRef.current?.focus());\n return;\n }\n\n commitSingleValue(option.value);\n },\n [commitSingleValue, multiple, toggleMultipleValue],\n );\n\n const selectHighlighted = React.useCallback(() => {\n const option = filteredOptions[safeHighlightedIndex];\n if (!option) return;\n selectOption(option);\n }, [filteredOptions, safeHighlightedIndex, selectOption]);\n\n React.useEffect(() => {\n if (!open) return;\n\n function handlePointerDown(event: PointerEvent) {\n const target = event.target as Node;\n // The list is portalled to the body, so containment has to be checked\n // against both halves or picking an option would close the control\n // before the choice registered.\n if (\n containerRef.current?.contains(target) ||\n dropdownRef.current?.contains(target)\n ) {\n return;\n }\n close();\n }\n\n document.addEventListener(\"pointerdown\", handlePointerDown);\n return () => document.removeEventListener(\"pointerdown\", handlePointerDown);\n }, [close, open]);\n\n /*\n The list is measured against the viewport and rendered in a portal.\n\n Anchored inside the control it was clipped by whatever `overflow` ancestor\n happened to be above it — inside a dialog body that is the scroll region,\n so the last field on a form showed one row of a six-hundred-row list. It\n opens downward when there is room, upward when there is not, and shrinks to\n what is left when neither side can take the whole list.\n */\n React.useLayoutEffect(() => {\n // Not cleared on close: the render is gated on `open`, and the layout\n // effect recomputes before the next paint, so a stale value is never seen.\n if (!open) return;\n\n const update = () => {\n const anchor = containerRef.current;\n if (!anchor) return;\n const rect = anchor.getBoundingClientRect();\n const below =\n window.innerHeight - rect.bottom - ANCHOR_GAP - VIEWPORT_MARGIN;\n const above = rect.top - ANCHOR_GAP - VIEWPORT_MARGIN;\n const flip =\n below < Math.min(PREFERRED_LIST_HEIGHT, MIN_LIST_HEIGHT) &&\n above > below;\n const room = flip ? above : below;\n const width = Math.max(rect.width, size === \"compact\" ? 220 : 0);\n const left = Math.max(\n VIEWPORT_MARGIN,\n Math.min(rect.left, window.innerWidth - width - VIEWPORT_MARGIN),\n );\n setPosition({\n left,\n width,\n maxHeight: Math.max(\n MIN_LIST_HEIGHT,\n Math.min(PREFERRED_LIST_HEIGHT, room),\n ),\n ...(flip\n ? { bottom: window.innerHeight - rect.top + ANCHOR_GAP }\n : { top: rect.bottom + ANCHOR_GAP }),\n });\n };\n\n update();\n // Capture, so a scroll in any ancestor — the dialog body included — moves\n // the list with its control instead of leaving it behind.\n window.addEventListener(\"scroll\", update, true);\n window.addEventListener(\"resize\", update);\n return () => {\n window.removeEventListener(\"scroll\", update, true);\n window.removeEventListener(\"resize\", update);\n };\n }, [open, size]);\n\n React.useEffect(() => {\n if (!open || !listRef.current) return;\n\n const highlighted = listRef.current.children[safeHighlightedIndex] as\n HTMLElement | undefined;\n\n highlighted?.scrollIntoView({ block: \"nearest\" });\n }, [safeHighlightedIndex, open]);\n\n function handleInputKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n if (disabled) return;\n\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault();\n if (!open) {\n openDropdown();\n return;\n }\n setHighlightedIndex(\n Math.min(safeHighlightedIndex + 1, filteredOptions.length - 1),\n );\n break;\n case \"ArrowUp\":\n event.preventDefault();\n if (!open) {\n openDropdown();\n return;\n }\n setHighlightedIndex(Math.max(safeHighlightedIndex - 1, 0));\n break;\n case \"Enter\":\n event.preventDefault();\n if (creatable && query.trim()) {\n // A single-value control filters its list as you type, so a match\n // is what Enter means there; only an unmatched query is taken as a\n // new value. Tags have no such list to defer to.\n if (multiple || filteredOptions.length === 0) {\n commitCustomValues(query);\n return;\n }\n }\n if (!open) {\n openDropdown();\n return;\n }\n selectHighlighted();\n break;\n case \",\":\n if (creatable && multiple && query.trim()) {\n event.preventDefault();\n commitCustomValues(query);\n }\n break;\n case \"Escape\":\n event.preventDefault();\n close();\n break;\n case \"Backspace\":\n if (multiple && query.length === 0 && selectedValues.length > 0) {\n event.preventDefault();\n removeValue(selectedValues[selectedValues.length - 1]);\n }\n break;\n case \"Tab\":\n close();\n break;\n default:\n break;\n }\n }\n\n const displayValue =\n !multiple && !open && !query && selectedValues[0]\n ? getOptionLabel(options, selectedValues[0])\n : query;\n\n const inputPlaceholder =\n multiple && selectedValues.length > 0 ? \"\" : placeholder;\n\n const createLabel = query.trim();\n const canCreate =\n creatable && Boolean(createLabel) && !selectedValues.includes(createLabel);\n\n const listboxId = id ? `${id}-listbox` : undefined;\n\n return (\n <div\n ref={containerRef}\n className={cn(\n \"relative\",\n size === \"compact\" ? \"w-auto min-w-24\" : \"w-full\",\n className,\n )}\n >\n <div\n className={cn(\n \"border-border bg-background flex w-full cursor-pointer items-center rounded-md border transition-colors\",\n \"focus-within:border-ring focus-within:ring-ring/30 focus-within:ring-2\",\n size === \"compact\"\n ? \"min-h-0 gap-0.5 border-transparent bg-transparent px-1 py-0.5 text-xs shadow-none\"\n : \"min-h-9 gap-1.5 px-2 py-1.5 text-sm shadow-sm\",\n disabled && \"cursor-not-allowed opacity-50\",\n open && \"border-ring ring-ring/30 ring-2\",\n )}\n onPointerDown={(event) => {\n if (disabled) return;\n if ((event.target as HTMLElement).closest(\"[data-option]\")) return;\n if ((event.target as HTMLElement).closest(\"[data-chip-remove]\"))\n return;\n\n if (!(event.target as HTMLElement).closest(\"input\")) {\n event.preventDefault();\n inputRef.current?.focus();\n }\n\n openDropdown();\n }}\n >\n {size === \"compact\" ? null : (\n <Search className=\"text-muted-foreground size-4 shrink-0\" />\n )}\n\n <div className=\"flex min-w-0 flex-1 flex-wrap items-center gap-1\">\n {multiple &&\n selectedValues.map((value) => (\n <span\n key={value}\n className=\"bg-primary/10 text-primary inline-flex max-w-full items-center gap-1 rounded-md px-2 py-0.5 text-xs font-medium\"\n >\n <span className=\"truncate\">\n {getOptionLabel(options, value)}\n </span>\n <button\n type=\"button\"\n data-chip-remove\n className=\"text-primary/70 hover:bg-primary/15 hover:text-primary rounded-sm transition\"\n onPointerDown={(event) => {\n event.preventDefault();\n event.stopPropagation();\n removeValue(value);\n }}\n aria-label={`Remove ${getOptionLabel(options, value)}`}\n >\n <X className=\"size-3\" />\n </button>\n </span>\n ))}\n\n <input\n ref={inputRef}\n id={id}\n type=\"text\"\n role=\"combobox\"\n aria-label={ariaLabel}\n aria-expanded={open}\n aria-controls={listboxId}\n aria-autocomplete=\"list\"\n disabled={disabled}\n value={displayValue}\n placeholder={inputPlaceholder}\n className={cn(\n \"placeholder:text-muted-foreground flex-1 bg-transparent outline-none\",\n size === \"compact\" ? \"min-w-0\" : \"min-w-[6rem]\",\n )}\n onFocus={openDropdown}\n onBlur={() => {\n if (ignoreBlurRef.current) return;\n close();\n }}\n onChange={(event) => {\n setQuery(event.target.value);\n setHighlightedIndex(0);\n if (!open) setOpen(true);\n }}\n onKeyDown={handleInputKeyDown}\n onPaste={(event) => {\n if (!creatable || !multiple) return;\n const text = event.clipboardData.getData(\"text\");\n if (!/[\\s,]/.test(text)) return;\n event.preventDefault();\n commitCustomValues(text);\n }}\n />\n </div>\n\n {clearable && !multiple && selectedValues[0] && !disabled && (\n <button\n type=\"button\"\n className=\"text-muted-foreground hover:bg-muted hover:text-foreground rounded-sm p-0.5 transition\"\n onPointerDown={(event) => {\n event.preventDefault();\n event.stopPropagation();\n onSingleChange?.(\"\");\n setQuery(\"\");\n inputRef.current?.focus();\n }}\n aria-label=\"Clear selection\"\n >\n <X className=\"size-3.5\" />\n </button>\n )}\n\n <ChevronDown\n className={cn(\n \"text-muted-foreground shrink-0 transition-transform\",\n size === \"compact\" ? \"size-3\" : \"size-4\",\n open && \"rotate-180\",\n )}\n />\n </div>\n\n {open && mounted && position\n ? createPortal(\n <div\n ref={dropdownRef}\n data-autocomplete-dropdown\n style={{\n position: \"fixed\",\n left: position.left,\n width: position.width,\n top: position.top,\n bottom: position.bottom,\n // Above the modal shell (z-100) it is usually opened inside.\n zIndex: 200,\n }}\n className=\"border-border bg-background overflow-hidden rounded-md border shadow-lg\"\n >\n <ul\n ref={listRef}\n id={listboxId}\n role=\"listbox\"\n aria-multiselectable={multiple || undefined}\n className=\"overflow-y-auto p-1\"\n style={{ maxHeight: position.maxHeight }}\n >\n {filteredOptions.length === 0 && !canCreate ? (\n <li className=\"text-muted-foreground px-3 py-6 text-center text-sm\">\n {emptyMessage}\n </li>\n ) : (\n <>\n {filteredOptions.map((option, index) => {\n const isSelected = selectedValues.includes(option.value);\n const isHighlighted = index === safeHighlightedIndex;\n\n return (\n <li\n key={option.value}\n data-option\n role=\"option\"\n aria-selected={isSelected}\n aria-disabled={option.disabled || undefined}\n className={cn(\n \"flex cursor-pointer items-center gap-2 rounded-sm transition-colors\",\n size === \"compact\"\n ? \"px-2 py-1 text-xs\"\n : \"px-2.5 py-2 text-sm\",\n isHighlighted && \"bg-muted\",\n option.disabled && \"cursor-not-allowed opacity-50\",\n )}\n onMouseEnter={() => setHighlightedIndex(index)}\n onPointerDown={(event) => {\n event.preventDefault();\n event.stopPropagation();\n selectOption(option);\n }}\n >\n {multiple ? (\n <span\n className={cn(\n \"border-border flex size-4 shrink-0 items-center justify-center rounded border\",\n isSelected &&\n \"border-primary bg-primary text-primary-foreground\",\n )}\n >\n {isSelected ? <Check className=\"size-3\" /> : null}\n </span>\n ) : (\n <Check\n className={cn(\n \"text-primary size-4 shrink-0\",\n isSelected ? \"opacity-100\" : \"opacity-0\",\n )}\n />\n )}\n <span className=\"truncate\">{option.label}</span>\n </li>\n );\n })}\n {canCreate ? (\n <li\n data-option\n role=\"option\"\n aria-selected={false}\n className=\"hover:bg-muted flex cursor-pointer items-center gap-2 rounded-sm px-2.5 py-2 text-sm transition-colors\"\n onPointerDown={(event) => {\n event.preventDefault();\n event.stopPropagation();\n ignoreBlurRef.current = true;\n window.setTimeout(() => {\n ignoreBlurRef.current = false;\n }, 0);\n commitCustomValues(query);\n window.requestAnimationFrame(() =>\n inputRef.current?.focus(),\n );\n }}\n >\n Add “{createLabel}”\n </li>\n ) : null}\n </>\n )}\n </ul>\n </div>,\n document.body,\n )\n : null}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport { useDialogLayer } from \"./dialogLayer\";\nimport { cn } from \"./utils\";\n\nconst emptySubscribe = () => () => {};\n\n/**\n * Returns false during SSR and the first client render, then true once mounted.\n * `useSyncExternalStore` is the React-recommended way to read client-only state\n * without a setState-in-effect (which triggers cascading renders).\n */\nexport function useHasMounted(): boolean {\n return React.useSyncExternalStore(\n emptySubscribe,\n () => true,\n () => false,\n );\n}\n\ninterface ModalProps {\n isOpen: boolean;\n /** id of the element labelling the dialog; wired to aria-labelledby. */\n labelledBy: string;\n /**\n * Optional id(s) of elements describing the dialog (APG alertdialog body).\n * Space-separated when multiple.\n */\n describedBy?: string;\n /** Accessible label for the backdrop dismiss button. */\n closeLabel: string;\n onClose: () => void;\n children: React.ReactNode;\n /**\n * When false, Escape and backdrop clicks do not close the modal (e.g. while a\n * save is in flight). Defaults to true.\n */\n dismissible?: boolean;\n /** Use \"alertdialog\" for destructive confirmations. Defaults to \"dialog\". */\n role?: \"dialog\" | \"alertdialog\";\n /** Tailwind max-width class for the panel. Defaults to \"max-w-md\". */\n panelClassName?: string;\n}\n\n/**\n * Shared modal shell: renders a portal-backed, scroll-locked, Escape-dismissible\n * overlay with a centered panel. Callers provide the panel body (heading, form,\n * footer). Consolidates the boilerplate previously copied across every dialog.\n */\nexport function Modal({\n isOpen,\n labelledBy,\n describedBy,\n closeLabel,\n onClose,\n children,\n dismissible = true,\n role = \"dialog\",\n panelClassName,\n}: ModalProps) {\n const mounted = useHasMounted();\n const panelRef = React.useRef<HTMLDivElement>(null);\n\n useDialogLayer({\n // Gated on `mounted` too: before that the panel is not rendered, so there\n // would be nothing to move focus into.\n active: isOpen && mounted,\n containerRef: panelRef,\n onEscape: dismissible ? onClose : undefined,\n });\n\n if (!mounted || !isOpen) return null;\n\n return createPortal(\n /*\n `overflow-y-auto` on the overlay, `my-auto` on the panel — not\n `items-center`. A flex item centred with `align-items` overflows equally\n in both directions once it is taller than its container, and the half\n above the top edge cannot be scrolled to: with the page behind it locked,\n an over-tall dialog was simply unreachable at both ends. Auto margins\n centre a short panel the same way and collapse to zero on a tall one,\n which scrolls.\n */\n <div className=\"fixed inset-0 z-[100] flex justify-center overflow-y-auto p-4\">\n {/* `fixed`, not `absolute`: inside a scrolling overlay an absolute\n backdrop scrolls away with the content and leaves the rest of a tall\n dialog sitting on an undimmed page. */}\n <button\n type=\"button\"\n aria-label={closeLabel}\n tabIndex={-1}\n className=\"fixed inset-0 bg-overlay/50\"\n onClick={() => {\n if (dismissible) onClose();\n }}\n />\n <div\n ref={panelRef}\n role={role}\n aria-modal=\"true\"\n aria-labelledby={labelledBy}\n aria-describedby={describedBy}\n tabIndex={-1}\n className={cn(\n \"border-border bg-background relative z-10 my-auto w-full rounded-lg border shadow-2xl outline-none\",\n panelClassName ?? \"max-w-md p-6\",\n )}\n >\n {children}\n </div>\n </div>,\n document.body,\n );\n}\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,SAAuB;;;ACAvB,IAAAC,SAAuB;AACvB,IAAAC,oBA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SAAS,OAAO,KAAK,OAAO,MAAM,KAAK;AAC3D,YAAQ,KAAK;AAAA,MACX;AAAA,MACA,OAAO,WAAW,MAAM,QAAQ,EAAE,KAAK,KAAK;AAAA,MAC5C,UAAU,QAAQ,MAAM,QAAQ;AAAA,IAClC,CAAC;AAAA,EACH,CAAC;AACD,SAAO;AACT;AAMO,SAAS,OAAO;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,cAAc;AAChB,GAAgB;AACd,QAAM,UAAU,oBAAoB,QAAQ;AAC5C,QAAM,UAAU,MAAM,QAAQ,KAAK,IAC/B,OAAO,MAAM,CAAC,KAAK,EAAE,IACrB,SAAS,OACP,KACA,OAAO,KAAK;AAClB,QAAM,QAAQ,QAAQ,KAAK,CAAC,WAAW,OAAO,UAAU,EAAE;AAE1D,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,UAAU,QAAQ,QAAQ;AAAA,MAC1B;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP,WAAW;AAAA,MACX,aAAa,eAAe,OAAO,SAAS;AAAA,MAC5C,UAAU,CAAC,SACT,WAAW;AAAA,QACT,QAAQ,EAAE,OAAO,KAAK;AAAA,QACtB,eAAe,EAAE,OAAO,KAAK;AAAA,MAC/B,CAAC;AAAA;AAAA,EAEL;AAEJ;","names":["React","React","import_react_dom","import_jsx_runtime","import_jsx_runtime"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type SelectChange = {
|
|
4
|
+
target: {
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
currentTarget: {
|
|
8
|
+
value: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
type SelectProps = {
|
|
12
|
+
id?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** Accessible name when the control is not wrapped in a label. */
|
|
16
|
+
"aria-label"?: string;
|
|
17
|
+
/** `compact` fits a spreadsheet cell. Typing still filters the list. */
|
|
18
|
+
size?: "default" | "compact";
|
|
19
|
+
value?: string | number | readonly string[];
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
onChange?: (event: SelectChange) => void;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The dropdown. It is the searchable autocomplete, not a native `<select>`,
|
|
26
|
+
* so a long list can be typed into and an empty list still opens.
|
|
27
|
+
*/
|
|
28
|
+
declare function Select({ id, className, disabled, value, placeholder, children, onChange, size, "aria-label": ariaLabel, }: SelectProps): React.JSX.Element;
|
|
29
|
+
|
|
30
|
+
export { Select, type SelectProps };
|
package/dist/select.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type SelectChange = {
|
|
4
|
+
target: {
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
currentTarget: {
|
|
8
|
+
value: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
type SelectProps = {
|
|
12
|
+
id?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** Accessible name when the control is not wrapped in a label. */
|
|
16
|
+
"aria-label"?: string;
|
|
17
|
+
/** `compact` fits a spreadsheet cell. Typing still filters the list. */
|
|
18
|
+
size?: "default" | "compact";
|
|
19
|
+
value?: string | number | readonly string[];
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
onChange?: (event: SelectChange) => void;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The dropdown. It is the searchable autocomplete, not a native `<select>`,
|
|
26
|
+
* so a long list can be typed into and an empty list still opens.
|
|
27
|
+
*/
|
|
28
|
+
declare function Select({ id, className, disabled, value, placeholder, children, onChange, size, "aria-label": ariaLabel, }: SelectProps): React.JSX.Element;
|
|
29
|
+
|
|
30
|
+
export { Select, type SelectProps };
|
package/dist/select.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Select
|
|
4
|
+
} from "./chunk-OUYT6SPU.js";
|
|
5
|
+
import "./chunk-5MEOZHJA.js";
|
|
6
|
+
import "./chunk-DS3QYIKL.js";
|
|
7
|
+
import "./chunk-HBBOR43A.js";
|
|
8
|
+
import "./chunk-HCA5ODCD.js";
|
|
9
|
+
export {
|
|
10
|
+
Select
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
"use client";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
|
|
32
|
+
// src/separator.tsx
|
|
33
|
+
var separator_exports = {};
|
|
34
|
+
__export(separator_exports, {
|
|
35
|
+
Separator: () => Separator
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(separator_exports);
|
|
38
|
+
var React = __toESM(require("react"), 1);
|
|
39
|
+
|
|
40
|
+
// src/utils.ts
|
|
41
|
+
var import_clsx = require("clsx");
|
|
42
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
43
|
+
function cn(...inputs) {
|
|
44
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// src/separator.tsx
|
|
48
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
49
|
+
var Separator = React.forwardRef(
|
|
50
|
+
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
ref,
|
|
54
|
+
role: decorative ? "none" : "separator",
|
|
55
|
+
"aria-orientation": orientation,
|
|
56
|
+
className: cn(
|
|
57
|
+
"bg-border shrink-0",
|
|
58
|
+
orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
|
|
59
|
+
className
|
|
60
|
+
),
|
|
61
|
+
...props
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
);
|
|
65
|
+
Separator.displayName = "Separator";
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
Separator
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=separator.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/separator.tsx","../src/utils.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"./utils\";\n\nexport type SeparatorProps = React.HTMLAttributes<HTMLDivElement> & {\n orientation?: \"horizontal\" | \"vertical\";\n decorative?: boolean;\n};\n\n/** Thin rule between sections. */\nexport const Separator = React.forwardRef<HTMLDivElement, SeparatorProps>(\n (\n { className, orientation = \"horizontal\", decorative = true, ...props },\n ref,\n ) => (\n <div\n ref={ref}\n role={decorative ? \"none\" : \"separator\"}\n aria-orientation={orientation}\n className={cn(\n \"bg-border shrink-0\",\n orientation === \"horizontal\" ? \"h-px w-full\" : \"h-full w-px\",\n className,\n )}\n {...props}\n />\n ),\n);\n\nSeparator.displayName = \"Separator\";\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;;;ACFvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADYI;AALG,IAAM,YAAkB;AAAA,EAC7B,CACE,EAAE,WAAW,cAAc,cAAc,aAAa,MAAM,GAAG,MAAM,GACrE,QAEA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,MAAM,aAAa,SAAS;AAAA,MAC5B,oBAAkB;AAAA,MAClB,WAAW;AAAA,QACT;AAAA,QACA,gBAAgB,eAAe,gBAAgB;AAAA,QAC/C;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,UAAU,cAAc;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type SeparatorProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
orientation?: "horizontal" | "vertical";
|
|
5
|
+
decorative?: boolean;
|
|
6
|
+
};
|
|
7
|
+
/** Thin rule between sections. */
|
|
8
|
+
declare const Separator: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
9
|
+
orientation?: "horizontal" | "vertical";
|
|
10
|
+
decorative?: boolean;
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
|
|
13
|
+
export { Separator, type SeparatorProps };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type SeparatorProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
orientation?: "horizontal" | "vertical";
|
|
5
|
+
decorative?: boolean;
|
|
6
|
+
};
|
|
7
|
+
/** Thin rule between sections. */
|
|
8
|
+
declare const Separator: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
9
|
+
orientation?: "horizontal" | "vertical";
|
|
10
|
+
decorative?: boolean;
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
|
|
13
|
+
export { Separator, type SeparatorProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
"use client";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
|
|
32
|
+
// src/side-drawer.tsx
|
|
33
|
+
var side_drawer_exports = {};
|
|
34
|
+
__export(side_drawer_exports, {
|
|
35
|
+
SideDrawer: () => SideDrawer
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(side_drawer_exports);
|
|
38
|
+
var import_lucide_react2 = require("lucide-react");
|
|
39
|
+
var React4 = __toESM(require("react"), 1);
|
|
40
|
+
var import_react_dom2 = require("react-dom");
|
|
41
|
+
|
|
42
|
+
// src/button.tsx
|
|
43
|
+
var React = __toESM(require("react"), 1);
|
|
44
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
45
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
46
|
+
|
|
47
|
+
// src/spinner.tsx
|
|
48
|
+
var import_lucide_react = require("lucide-react");
|
|
49
|
+
|
|
50
|
+
// src/utils.ts
|
|
51
|
+
var import_clsx = require("clsx");
|
|
52
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
53
|
+
function cn(...inputs) {
|
|
54
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// src/spinner.tsx
|
|
58
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
59
|
+
var SIZES = {
|
|
60
|
+
sm: "size-3.5",
|
|
61
|
+
md: "size-4",
|
|
62
|
+
lg: "size-5",
|
|
63
|
+
xl: "size-10 border-2"
|
|
64
|
+
};
|
|
65
|
+
function Spinner({ size = "md", className, ...props }) {
|
|
66
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
|
+
import_lucide_react.Loader2,
|
|
68
|
+
{
|
|
69
|
+
"aria-hidden": true,
|
|
70
|
+
className: cn("animate-spin", SIZES[size], className),
|
|
71
|
+
...props
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// src/button.tsx
|
|
77
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
78
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
79
|
+
"inline-flex h-9 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md px-3 text-sm font-medium transition duration-200 active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
80
|
+
{
|
|
81
|
+
variants: {
|
|
82
|
+
variant: {
|
|
83
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
84
|
+
secondary: "bg-muted text-foreground hover:bg-muted/80",
|
|
85
|
+
ghost: "hover:bg-muted",
|
|
86
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
87
|
+
outline: "border border-border bg-background hover:bg-muted"
|
|
88
|
+
},
|
|
89
|
+
size: {
|
|
90
|
+
sm: "h-8 px-2.5",
|
|
91
|
+
md: "h-9 px-3",
|
|
92
|
+
lg: "h-10 px-4",
|
|
93
|
+
icon: "h-9 w-9 px-0",
|
|
94
|
+
// Square, matching `sm`'s height — for an icon-only control sitting in
|
|
95
|
+
// a table row or beside `sm` buttons, where `icon` is a row taller.
|
|
96
|
+
"icon-sm": "h-8 w-8 px-0"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
defaultVariants: {
|
|
100
|
+
variant: "default",
|
|
101
|
+
size: "md"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
var ICON_SIZES = /* @__PURE__ */ new Set(["icon", "icon-sm"]);
|
|
106
|
+
var Button = React.forwardRef(
|
|
107
|
+
({
|
|
108
|
+
className,
|
|
109
|
+
variant,
|
|
110
|
+
size,
|
|
111
|
+
asChild = false,
|
|
112
|
+
loading,
|
|
113
|
+
disabled,
|
|
114
|
+
children,
|
|
115
|
+
...props
|
|
116
|
+
}, ref) => {
|
|
117
|
+
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
118
|
+
if (asChild) {
|
|
119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
120
|
+
Comp,
|
|
121
|
+
{
|
|
122
|
+
ref,
|
|
123
|
+
className: cn(buttonVariants({ variant, size }), className),
|
|
124
|
+
...props,
|
|
125
|
+
children
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
130
|
+
"button",
|
|
131
|
+
{
|
|
132
|
+
ref,
|
|
133
|
+
disabled: disabled || loading,
|
|
134
|
+
"aria-busy": loading || void 0,
|
|
135
|
+
className: cn(buttonVariants({ variant, size }), className),
|
|
136
|
+
...props,
|
|
137
|
+
children: [
|
|
138
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Spinner, { size: "sm" }) : null,
|
|
139
|
+
loading && size != null && ICON_SIZES.has(size) ? null : children
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
Button.displayName = "Button";
|
|
146
|
+
|
|
147
|
+
// src/dialogLayer.ts
|
|
148
|
+
var React2 = __toESM(require("react"), 1);
|
|
149
|
+
var layers = [];
|
|
150
|
+
var FOCUSABLE = [
|
|
151
|
+
"a[href]",
|
|
152
|
+
"button:not([disabled])",
|
|
153
|
+
"input:not([disabled])",
|
|
154
|
+
"select:not([disabled])",
|
|
155
|
+
"textarea:not([disabled])",
|
|
156
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
157
|
+
].join(",");
|
|
158
|
+
function isVisible(element) {
|
|
159
|
+
if (element.closest("[hidden]")) return false;
|
|
160
|
+
if (element.getAttribute("aria-hidden") === "true") return false;
|
|
161
|
+
return typeof element.checkVisibility === "function" ? element.checkVisibility() : true;
|
|
162
|
+
}
|
|
163
|
+
function focusableWithin(container) {
|
|
164
|
+
return Array.from(container.querySelectorAll(FOCUSABLE)).filter(
|
|
165
|
+
isVisible
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
function useDialogLayer({
|
|
169
|
+
active,
|
|
170
|
+
containerRef,
|
|
171
|
+
onEscape
|
|
172
|
+
}) {
|
|
173
|
+
const escapeRef = React2.useRef(onEscape);
|
|
174
|
+
React2.useEffect(() => {
|
|
175
|
+
escapeRef.current = onEscape;
|
|
176
|
+
});
|
|
177
|
+
React2.useEffect(() => {
|
|
178
|
+
if (!active) return;
|
|
179
|
+
const layer = /* @__PURE__ */ Symbol("dialog-layer");
|
|
180
|
+
layers.push(layer);
|
|
181
|
+
const isTopLayer = () => layers[layers.length - 1] === layer;
|
|
182
|
+
const previouslyFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
183
|
+
const container = containerRef.current;
|
|
184
|
+
if (container && !container.contains(document.activeElement)) {
|
|
185
|
+
const [first] = focusableWithin(container);
|
|
186
|
+
(container.hasAttribute("tabindex") ? container : first)?.focus();
|
|
187
|
+
}
|
|
188
|
+
function handleKeyDown(event) {
|
|
189
|
+
if (!isTopLayer()) return;
|
|
190
|
+
if (event.key === "Escape") {
|
|
191
|
+
escapeRef.current?.();
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (event.key !== "Tab") return;
|
|
195
|
+
const panel = containerRef.current;
|
|
196
|
+
if (!panel) return;
|
|
197
|
+
const items = focusableWithin(panel);
|
|
198
|
+
if (items.length === 0) {
|
|
199
|
+
event.preventDefault();
|
|
200
|
+
panel.focus();
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const first = items[0];
|
|
204
|
+
const last = items[items.length - 1];
|
|
205
|
+
const active2 = document.activeElement;
|
|
206
|
+
const outside = !panel.contains(active2);
|
|
207
|
+
if (event.shiftKey && (active2 === first || outside)) {
|
|
208
|
+
event.preventDefault();
|
|
209
|
+
last.focus();
|
|
210
|
+
} else if (!event.shiftKey && (active2 === last || outside)) {
|
|
211
|
+
event.preventDefault();
|
|
212
|
+
first.focus();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
216
|
+
const previousOverflow = document.body.style.overflow;
|
|
217
|
+
document.body.style.overflow = "hidden";
|
|
218
|
+
return () => {
|
|
219
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
220
|
+
document.body.style.overflow = previousOverflow;
|
|
221
|
+
const index = layers.indexOf(layer);
|
|
222
|
+
if (index !== -1) layers.splice(index, 1);
|
|
223
|
+
if (previouslyFocused?.isConnected) previouslyFocused.focus();
|
|
224
|
+
};
|
|
225
|
+
}, [active, containerRef]);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// src/modal.tsx
|
|
229
|
+
var React3 = __toESM(require("react"), 1);
|
|
230
|
+
var import_react_dom = require("react-dom");
|
|
231
|
+
var import_jsx_runtime3 = (
|
|
232
|
+
/*
|
|
233
|
+
`overflow-y-auto` on the overlay, `my-auto` on the panel — not
|
|
234
|
+
`items-center`. A flex item centred with `align-items` overflows equally
|
|
235
|
+
in both directions once it is taller than its container, and the half
|
|
236
|
+
above the top edge cannot be scrolled to: with the page behind it locked,
|
|
237
|
+
an over-tall dialog was simply unreachable at both ends. Auto margins
|
|
238
|
+
centre a short panel the same way and collapse to zero on a tall one,
|
|
239
|
+
which scrolls.
|
|
240
|
+
*/
|
|
241
|
+
require("react/jsx-runtime")
|
|
242
|
+
);
|
|
243
|
+
var emptySubscribe = () => () => {
|
|
244
|
+
};
|
|
245
|
+
function useHasMounted() {
|
|
246
|
+
return React3.useSyncExternalStore(
|
|
247
|
+
emptySubscribe,
|
|
248
|
+
() => true,
|
|
249
|
+
() => false
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// src/side-drawer.tsx
|
|
254
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
255
|
+
function SideDrawer({
|
|
256
|
+
isOpen,
|
|
257
|
+
title,
|
|
258
|
+
onClose,
|
|
259
|
+
children,
|
|
260
|
+
panelClassName
|
|
261
|
+
}) {
|
|
262
|
+
const mounted = useHasMounted();
|
|
263
|
+
const headingId = React4.useId();
|
|
264
|
+
const panelRef = React4.useRef(null);
|
|
265
|
+
useDialogLayer({
|
|
266
|
+
// Gated on `mounted` too: before that the panel is not rendered, so there
|
|
267
|
+
// would be nothing to move focus into.
|
|
268
|
+
active: isOpen && mounted,
|
|
269
|
+
containerRef: panelRef,
|
|
270
|
+
onEscape: onClose
|
|
271
|
+
});
|
|
272
|
+
if (!mounted || !isOpen) return null;
|
|
273
|
+
return (0, import_react_dom2.createPortal)(
|
|
274
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
275
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
276
|
+
"div",
|
|
277
|
+
{
|
|
278
|
+
"aria-hidden": true,
|
|
279
|
+
onClick: onClose,
|
|
280
|
+
className: "fixed inset-0 z-[90] bg-overlay/30"
|
|
281
|
+
}
|
|
282
|
+
),
|
|
283
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
284
|
+
"aside",
|
|
285
|
+
{
|
|
286
|
+
ref: panelRef,
|
|
287
|
+
role: "dialog",
|
|
288
|
+
"aria-modal": "true",
|
|
289
|
+
"aria-labelledby": headingId,
|
|
290
|
+
tabIndex: -1,
|
|
291
|
+
className: cn(
|
|
292
|
+
"border-border bg-background fixed inset-y-0 right-0 z-[95] flex flex-col border-l shadow-2xl outline-none",
|
|
293
|
+
panelClassName ?? "w-full max-w-md"
|
|
294
|
+
),
|
|
295
|
+
children: [
|
|
296
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "border-border flex items-center justify-between gap-3 border-b px-4 py-3", children: [
|
|
297
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { id: headingId, className: "truncate text-base font-semibold", children: title }),
|
|
298
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
299
|
+
Button,
|
|
300
|
+
{
|
|
301
|
+
variant: "ghost",
|
|
302
|
+
size: "icon",
|
|
303
|
+
"aria-label": "Close panel",
|
|
304
|
+
onClick: onClose,
|
|
305
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.X, { className: "h-4 w-4", "aria-hidden": true })
|
|
306
|
+
}
|
|
307
|
+
)
|
|
308
|
+
] }),
|
|
309
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "min-h-0 flex-1 overflow-y-auto p-4", children })
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
)
|
|
313
|
+
] }),
|
|
314
|
+
document.body
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
318
|
+
0 && (module.exports = {
|
|
319
|
+
SideDrawer
|
|
320
|
+
});
|
|
321
|
+
//# sourceMappingURL=side-drawer.cjs.map
|