@gridui/select 1.1.1 → 1.1.2

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/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/shared/style.ts", "../src/shared/combobox-options.tsx", "../src/shared/selection-actions.tsx", "../src/shared/selection-form.tsx", "../src/shared/selection-popup.tsx", "../src/shared/options.ts", "../src/shared/scroll-option.ts", "../src/shared/use-search-options.ts", "../src/shared/use-selection-popup.ts", "../src/shared/use-selection-value.ts", "../src/combobox/style.ts", "../src/combobox/combobox.tsx", "../src/multi-select/multi-select.tsx", "../src/select/style.ts", "../src/select/select-options.tsx", "../src/select/select.tsx", "../src/use-async-options/request.ts", "../src/use-async-options/use-async-options.ts"],
4
- "sourcesContent": ["/**\n * @author WMXPY\n * @package Select\n * @namespace Shared\n * @description Style\n */\n\nimport { dropdownItemStyles } from \"@gridui/dropdown-menu\";\nimport { overlaySurfaceStyles } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const selectItemStyles = cva(cn(dropdownItemStyles(), \"gridui-u-min-w-0\"));\n\nexport const selectIconStyles = cva(\"gridui-u-inline-flex gridui-u-shrink-0 gridui-u-items-center gridui-u-[&_svg]:size-gridui-16\");\n\nexport const selectOptionContentStyles = cva(\"gridui-u-min-w-0 gridui-u-flex-1 gridui-u-whitespace-normal gridui-u-wrap-anywhere\");\n\nexport const selectOptionDescriptionStyles = cva(\"gridui-u-block gridui-u-text-muted gridui-u-type-caption gridui-u-mt-gridui-4\");\n\nexport const selectListStyles = cva(\"gridui-u-min-h-0 gridui-u-overflow-y-auto\");\n\nexport const selectEmptyStyles = cva(\"gridui-u-p-gridui-8 gridui-u-text-muted gridui-u-type-caption\");\n\nexport const selectActionsStyles = cva(\"gridui-u-shrink-0 gridui-u-border-t gridui-u-border-border gridui-u-pt-gridui-4\");\n\nexport const selectActionStyles = cva(cn(\n selectItemStyles(),\n \"gridui-u-w-full gridui-u-text-start gridui-u-whitespace-normal gridui-u-wrap-anywhere\",\n));\n\nexport const comboboxContentStyles = cva(cn(\n overlaySurfaceStyles(),\n \"gridui-u-z-(--gridui-z-popover) gridui-u-p-gridui-4 gridui-u-type-data\",\n \"gridui-combobox-content gridui-u-box-border gridui-u-flex gridui-u-flex-col gridui-u-overflow-hidden gridui-u-min-w-0 gridui-u-w-(--anchor-width) gridui-u-max-h-(--available-height) gridui-u-max-w-(--available-width)\",\n));\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared\n * @description Combobox Options\n */\n\nimport { selectIconStyles, selectItemStyles, selectListStyles, selectOptionContentStyles, selectOptionDescriptionStyles } from \"./style\";\nimport type { SelectGroup, SelectOption } from \"./types\";\nimport { dropdownIndicatorStyles, dropdownLabelStyles } from \"@gridui/dropdown-menu\";\nimport { useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { Check } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type ComboboxOptionsProps = {\n readonly id: string;\n readonly label: string;\n readonly options: readonly (SelectOption | SelectGroup)[];\n readonly selected: string | readonly string[];\n readonly multiple?: boolean;\n readonly active: string | null;\n readonly optionId: (value: string) => string;\n readonly onSelect: (option: SelectOption) => void;\n readonly onHighlight: (value: string) => void;\n};\n\nexport const ComboboxOptions: FC<ComboboxOptionsProps> = (props: ComboboxOptionsProps) => {\n const { id, label, options, selected, multiple, active, optionId, onSelect, onHighlight } = props;\n const scrollbarRef = useScrollbars<HTMLDivElement>();\n const ref = useInteractionOutline<HTMLDivElement>({\n ref: scrollbarRef,\n selector: '[role=\"option\"]',\n });\n const renderOption = (option: SelectOption) => {\n const itemId = optionId(option.value);\n const checked = typeof selected === \"string\" ? selected === option.value : selected.includes(option.value);\n return (<div\n key={option.value}\n id={itemId}\n role=\"option\"\n aria-selected={checked}\n aria-disabled={option.disabled}\n aria-labelledby={`${itemId}-label`}\n aria-describedby={option.description ? `${itemId}-description` : undefined}\n data-disabled={option.disabled ? \"\" : undefined}\n data-highlighted={active === option.value ? \"\" : undefined}\n className={selectItemStyles()}\n onPointerMove={() => {\n onHighlight(option.value);\n }}\n onPointerDown={(event) => {\n event.preventDefault();\n }}\n onClick={() => {\n if (!option.disabled) {\n onSelect(option);\n }\n }}\n >\n <span\n className={dropdownIndicatorStyles()}\n aria-hidden=\"true\"\n >\n {checked && (<Check\n size={16}\n />)}\n </span>\n {option.icon && (<span\n className={selectIconStyles()}\n aria-hidden=\"true\"\n >\n {option.icon}\n </span>)}\n <span\n className={selectOptionContentStyles()}\n >\n <span\n id={`${itemId}-label`}\n >\n {option.label}\n </span>\n {option.description && (<span\n id={`${itemId}-description`}\n className={selectOptionDescriptionStyles()}\n >\n {option.description}\n </span>)}\n </span>\n </div>);\n };\n return (<div\n ref={ref}\n id={id}\n role=\"listbox\"\n aria-multiselectable={multiple || undefined}\n aria-label={label}\n className={selectListStyles()}\n >\n {options.map((entry, index) => {\n return \"options\" in entry\n ? (<div\n key={entry.label}\n role=\"group\"\n aria-labelledby={`${id}-group-${index}`}\n >\n <div\n id={`${id}-group-${index}`}\n className={dropdownLabelStyles()}\n >\n {entry.label}\n </div>\n {entry.options.map(renderOption)}\n </div>)\n : renderOption(entry);\n })}\n </div>);\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared\n * @description Selection Actions\n */\n\nimport { selectActionsStyles, selectActionStyles, selectIconStyles } from \"./style\";\nimport type { SelectAction } from \"./types\";\nimport type { FC } from \"react\";\n\nexport type SelectionActionsProps = {\n readonly actions: readonly SelectAction[];\n readonly onAction: (action: SelectAction) => boolean;\n};\n\nexport const SelectionActions: FC<SelectionActionsProps> = (props: SelectionActionsProps) => {\n const { actions, onAction } = props;\n return (<>\n {actions.length > 0 && (<div\n className={selectActionsStyles()}\n >\n {actions.map((action) => {\n const content = (<>\n {action.icon && (<span\n className={selectIconStyles()}\n aria-hidden=\"true\"\n >\n {action.icon}\n </span>)}\n {action.label}\n </>);\n const actionClass = selectActionStyles();\n if (action.href !== undefined) {\n return (<a\n key={action.id}\n href={action.disabled ? undefined : action.href}\n target={action.target}\n rel={action.rel}\n aria-disabled={action.disabled || undefined}\n data-disabled={action.disabled ? \"\" : undefined}\n tabIndex={action.disabled ? -1 : undefined}\n className={actionClass}\n onClick={(event) => {\n if (action.disabled) {\n event.preventDefault();\n return;\n }\n if (!onAction(action)) {\n event.preventDefault();\n }\n }}\n >\n {content}\n </a>);\n }\n return (<button\n key={action.id}\n type=\"button\"\n disabled={action.disabled}\n data-disabled={action.disabled ? \"\" : undefined}\n className={actionClass}\n onClick={() => {\n onAction(action);\n }}\n >\n {content}\n </button>);\n })}\n </div>)}\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared\n * @description Selection Form\n */\n\nimport type { SelectionProps, SelectOption } from \"./types\";\nimport { focusInvalidControl, useFormReset } from \"@gridui/form\";\nimport { type FC, useLayoutEffect, useRef } from \"react\";\nimport { flushSync } from \"react-dom\";\n\nexport type SelectionFormProps = {\n readonly [Key in \"name\" | \"form\" | \"required\" | \"disabled\"]: SelectionProps[Key];\n} & {\n readonly selectedValue: string;\n readonly allOptions: readonly SelectOption[];\n readonly onValueChange: (value: string) => void;\n readonly onReset: () => void;\n readonly onInvalid: () => void;\n};\n\nexport const SelectionForm: FC<SelectionFormProps> = (props: SelectionFormProps) => {\n\n const {\n name, form, required, disabled, selectedValue, allOptions,\n onValueChange, onReset, onInvalid,\n } = props;\n const nativeRef = useRef<HTMLSelectElement | null>(null);\n const resetSelection = useRef(onReset);\n const currentValue = useRef(selectedValue);\n useLayoutEffect(() => {\n resetSelection.current = onReset;\n currentValue.current = selectedValue;\n }, [\n onReset,\n selectedValue,\n ]);\n useFormReset(nativeRef, () => {\n flushSync(() => {\n resetSelection.current();\n });\n if (nativeRef.current) {\n nativeRef.current.value = currentValue.current;\n }\n }, form);\n\n return (<select\n ref={nativeRef}\n aria-hidden=\"true\"\n tabIndex={-1}\n className=\"gridui-u-sr-only\"\n name={name}\n form={form}\n required={required}\n disabled={disabled}\n value={selectedValue}\n onChange={(event) => {\n\n onValueChange(event.currentTarget.value);\n }}\n onInvalid={(event) => {\n\n focusInvalidControl(event, onInvalid);\n }}\n >\n {!allOptions.some((option) => {\n\n return option.value === \"\";\n }) && (<option\n value=\"\"\n />)}\n {selectedValue !== \"\" && !allOptions.some(option => {\n return option.value === selectedValue;\n }) && (<option\n value={selectedValue}\n >\n {selectedValue}\n </option>)}\n {allOptions.map((option) => {\n\n return (<option\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n >\n {option.label}\n </option>);\n })}\n </select>);\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared\n * @description Selection Popup\n */\n\nimport { comboboxContentStyles } from \"./style\";\nimport { isComposingKeyEvent } from \"@gridui/interaction\";\nimport { interactionLayerProps } from \"@gridui/overlay\";\nimport * as Primitive from \"@radix-ui/react-popover\";\nimport type { ComponentPropsWithRef, FC, RefObject } from \"react\";\n\nexport type SelectionPopupProps = Pick<ComponentPropsWithRef<typeof Primitive.Content>, \"ref\" | \"children\" | \"dir\" | \"role\" | \"aria-label\"> & {\n readonly container?: ComponentPropsWithRef<typeof Primitive.Portal>[\"container\"];\n readonly anchorRef?: RefObject<HTMLElement | null>;\n readonly initialFocus?: () => void;\n readonly finalFocus: () => HTMLElement | false;\n readonly onEscape: () => void;\n readonly onDismiss?: () => void;\n};\n\nexport const SelectionPopup: FC<SelectionPopupProps> = (props: SelectionPopupProps) => {\n const { container, anchorRef, initialFocus, finalFocus, onEscape, onDismiss, ...restProps } = props;\n return (<Primitive.Portal\n container={container}\n >\n <Primitive.Content\n {...interactionLayerProps}\n {...restProps}\n sideOffset={8}\n align=\"start\"\n collisionPadding={16}\n className={comboboxContentStyles()}\n onOpenAutoFocus={event => {\n event.preventDefault();\n initialFocus?.();\n }}\n onCloseAutoFocus={event => {\n event.preventDefault();\n const target = finalFocus();\n if (target) {\n target.focus();\n }\n }}\n onInteractOutside={event => {\n if (anchorRef?.current?.contains(event.target as Node)) {\n event.preventDefault();\n } else {\n onDismiss?.();\n }\n }}\n onEscapeKeyDown={event => {\n event.preventDefault();\n event.stopPropagation();\n if (!isComposingKeyEvent(event)) {\n onEscape();\n }\n }}\n onKeyDown={event => {\n if (event.key === \"Escape\") {\n event.stopPropagation();\n }\n }}\n />\n </Primitive.Portal>);\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared\n * @description Options\n */\n\nimport type { SelectGroup, SelectOption } from \"./types\";\n\nexport const flattenOptions = (options: readonly (SelectOption | SelectGroup)[]): SelectOption[] => {\n return options.flatMap((entry) => {\n return \"options\" in entry ? entry.options : [entry];\n });\n};\n\nexport const filterOptions = (\n options: readonly (SelectOption | SelectGroup)[],\n query: string,\n): readonly (SelectOption | SelectGroup)[] => {\n const term = query.trim().normalize(\"NFKC\")\n .toLowerCase();\n if (!term) {\n return options;\n }\n const matches = (option: SelectOption): boolean => {\n return `${option.label} ${option.description ?? \"\"}`.normalize(\"NFKC\")\n .toLowerCase()\n .includes(term);\n };\n return options.flatMap((entry): (SelectOption | SelectGroup)[] => {\n if (\"options\" in entry) {\n const items = entry.options.filter(matches);\n return items.length ? [\n {\n ...entry,\n options: items,\n },\n ] : [];\n }\n return matches(entry) ? [entry] : [];\n });\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared\n * @description Scroll Option\n */\n\n/** Keep active options visible without moving the page beneath a portal. */\nexport const scrollOption = (id: string): void => {\n const option = document.getElementById(id);\n const list = option?.closest<HTMLElement>('[role=\"listbox\"]');\n if (!option || !list) {\n return;\n }\n const itemBounds = option.getBoundingClientRect();\n const listBounds = list.getBoundingClientRect();\n if (itemBounds.top < listBounds.top) {\n list.scrollTop += itemBounds.top - listBounds.top;\n }\n else if (itemBounds.bottom > listBounds.bottom) {\n list.scrollTop += itemBounds.bottom - listBounds.bottom;\n }\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared\n * @description Use Search Options\n */\n\nimport { filterOptions, flattenOptions } from \"./options\";\nimport { scrollOption } from \"./scroll-option\";\nimport type { SelectGroup, SelectionSearchProps, SelectOption } from \"./types\";\nimport { useEffect, useRef, useState } from \"react\";\n\ntype SearchState = {\n readonly query: string | null;\n readonly highlighted: string | null;\n};\n\nconst INITIAL_SEARCH: SearchState = {\n query: null,\n highlighted: null,\n};\n\nexport const useSearchOptions = (\n options: readonly (SelectOption | SelectGroup)[],\n selected: readonly string[],\n listId: string,\n open: boolean,\n searchProps: SelectionSearchProps = {},\n) => {\n const [\n search,\n setSearch,\n ] = useState(INITIAL_SEARCH);\n const { query: controlledQuery, onQueryChange, filterOptions: shouldFilter = true, loading, errorLabel } = searchProps;\n const wasOpen = useRef(open);\n const query = open ? controlledQuery ?? search.query : null;\n const all = flattenOptions(options);\n const availableOptions = shouldFilter ? filterOptions(options, query ?? \"\") : options;\n const filtered = loading || errorLabel ? [] : availableOptions;\n const visible = flattenOptions(filtered);\n const highlighted = visible.find(option => {\n return option.value === search.highlighted;\n });\n const selectedOption = query === null ? visible.find(option => {\n return selected.includes(option.value);\n }) : undefined;\n const active = highlighted ?? selectedOption ?? visible[0];\n const activeValue = active?.value ?? null;\n const optionIndices = new Map(all.map((option, index) => {\n return [\n option.value,\n index,\n ] as const;\n }));\n const optionId = (value: string): string => {\n return `${listId}-${optionIndices.get(value) ?? -1}`;\n };\n const activeOptionId = active ? optionId(active.value) : undefined;\n useEffect(() => {\n if (!open && wasOpen.current) {\n setSearch(INITIAL_SEARCH);\n onQueryChange?.(\"\");\n }\n wasOpen.current = open;\n }, [\n open,\n onQueryChange,\n ]);\n useEffect(() => {\n if (open && activeOptionId !== undefined) {\n scrollOption(activeOptionId);\n }\n }, [\n open,\n activeOptionId,\n ]);\n const highlight = (value: string): void => {\n setSearch(current => {\n return {\n ...current,\n highlighted: value,\n };\n });\n };\n return {\n all,\n filtered,\n visible,\n query,\n active: activeValue,\n activeOption: active,\n activeOptionId,\n optionId,\n highlight,\n changeQuery: (text: string): void => {\n onQueryChange?.(text);\n setSearch({\n query: text,\n highlighted: null,\n });\n },\n moveActive: (direction: number): void => {\n const index = visible.findIndex(option => {\n return option.value === activeValue;\n });\n const next = visible[Math.max(0, Math.min(visible.length - 1, index + direction))];\n if (next) {\n highlight(next.value);\n }\n },\n };\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared\n * @description Use Selection Popup\n */\n\nimport type { SelectAction } from \"./types\";\nimport { type RefObject, useEffect, useRef, useState } from \"react\";\nimport { flushSync } from \"react-dom\";\n\ntype SelectionPopupOptions = {\n readonly disabled?: boolean | undefined;\n readonly readOnly?: boolean | undefined;\n readonly controlRef: RefObject<HTMLElement | null>;\n};\n\nexport const useSelectionPopup = ({ disabled, readOnly, controlRef }: SelectionPopupOptions) => {\n const [\n localOpen,\n setLocalOpen,\n ] = useState(false);\n const popupRef = useRef<HTMLDivElement>(null);\n const restoreFocus = useRef(true);\n const unavailable = Boolean(disabled || readOnly);\n useEffect(() => {\n if (unavailable) {\n setLocalOpen(false);\n }\n }, [unavailable]);\n const available = (): boolean => {\n return !unavailable && !controlRef.current?.matches(\":disabled\");\n };\n const changeOpen = (next: boolean): void => {\n if (next && !available()) {\n return;\n }\n if (next) {\n restoreFocus.current = true;\n }\n setLocalOpen(next);\n };\n const close = (): void => {\n restoreFocus.current = false;\n setLocalOpen(false);\n };\n const focus = (): void => {\n controlRef.current?.focus();\n };\n const finalFocus = (): HTMLElement | false => {\n const control = controlRef.current;\n if (!restoreFocus.current || !control) {\n return false;\n }\n // Closing animations may finish after focus moves to another control.\n const active = control.ownerDocument.activeElement;\n if (active && active !== control.ownerDocument.body && active !== control\n && !popupRef.current?.contains(active)) {\n return false;\n }\n return control;\n };\n const runAction = (action: SelectAction): boolean => {\n if (action.disabled || !available()) {\n return false;\n }\n if (action.closeOnAction !== false) {\n flushSync(close);\n focus();\n }\n action.onAction?.();\n return true;\n };\n return {\n open: localOpen && !unavailable,\n popupRef,\n available,\n changeOpen,\n close,\n focus,\n finalFocus,\n runAction,\n };\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared\n * @description Use Selection Value\n */\n\nimport type { SelectionValueProps } from \"./types\";\nimport { useRef, useState } from \"react\";\n\ntype SelectionValueOptions = {\n readonly [Key in \"value\" | \"defaultValue\" | \"onValueChange\"]: SelectionValueProps[Key];\n};\n\nexport const useSelectionValue = (props: SelectionValueOptions, available: () => boolean) => {\n const { value, defaultValue = \"\", onValueChange } = props;\n const [\n localValue,\n setLocalValue,\n ] = useState(defaultValue);\n const selectedValue = value ?? localValue;\n const initialValue = useRef(selectedValue);\n const update = (next: string): void => {\n if (next === selectedValue) {\n return;\n }\n if (value === undefined) {\n setLocalValue(next);\n }\n onValueChange?.(next);\n };\n return {\n selectedValue,\n change: (next: string | null): void => {\n if (next !== null && available()) {\n update(next);\n }\n },\n reset: (): void => {\n update(initialValue.current);\n },\n };\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Combobox\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const comboboxInputStyles = cva(\"gridui-u-pr-11 gridui-u-text-ellipsis\");\n\nexport const comboboxTriggerStyles = cva(\"gridui-u-absolute gridui-u-inset-y-0 gridui-u-right-0 gridui-u-flex gridui-u-w-9 gridui-u-items-center gridui-u-justify-center gridui-u-rounded-control gridui-u-text-foreground gridui-u-cursor-pointer gridui-u-disabled:cursor-not-allowed gridui-u-disabled:opacity-50\");\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Combobox\n * @description Combobox\n */\n\nimport { ComboboxOptions } from \"../shared/combobox-options\";\nimport { SelectionActions } from \"../shared/selection-actions\";\nimport { SelectionForm } from \"../shared/selection-form\";\nimport { SelectionPopup } from \"../shared/selection-popup\";\nimport { selectEmptyStyles } from \"../shared/style\";\nimport type { SelectionProps, SelectionSearchProps, SelectOption } from \"../shared/types\";\nimport { useSearchOptions } from \"../shared/use-search-options\";\nimport { useSelectionPopup } from \"../shared/use-selection-popup\";\nimport { useSelectionValue } from \"../shared/use-selection-value\";\nimport { comboboxInputStyles, comboboxTriggerStyles } from \"./style\";\nimport { controlVariants } from \"@gridui/input\";\nimport { isComposingKeyEvent } from \"@gridui/interaction\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-popover\";\nimport { ChevronDown, X } from \"lucide-react\";\nimport { type ComponentPropsWithRef, type FC, useId, useRef } from \"react\";\n\nexport type ComboboxProps = Omit<ComponentPropsWithRef<\"input\">,\n \"children\" | \"value\" | \"defaultValue\" | \"onChange\" | \"type\" | \"size\"> & SelectionProps & SelectionSearchProps & {\n readonly searchLabel: string;\n readonly emptyLabel: string;\n };\n\nexport const Combobox: FC<ComboboxProps> = (props: ComboboxProps) => {\n const { options, actions = [], value, defaultValue = \"\", onValueChange, controlSize = \"standard\", clearLabel,\n required, disabled, readOnly, name, form, dir, portalContainer, className, ref, searchLabel, emptyLabel,\n placeholder, onKeyDown, onClick, query: controlledQuery, onQueryChange, filterOptions,\n loading, loadingLabel, errorLabel, resultCountLabel, ...restProps } = props;\n const controlRef = useRef<HTMLElement>(null);\n const anchorRef = useRef<HTMLDivElement>(null);\n const { open, popupRef, available, changeOpen, close, focus, runAction, finalFocus } = useSelectionPopup({\n disabled,\n readOnly,\n controlRef,\n });\n const { selectedValue, change, reset } = useSelectionValue({\n value,\n defaultValue,\n onValueChange,\n }, available);\n const inputId = useId();\n const listId = `${inputId}-list`;\n const search = useSearchOptions(options, [selectedValue], listId, open, {\n query: controlledQuery,\n onQueryChange,\n filterOptions,\n loading,\n errorLabel,\n });\n const { all: allOptions, filtered, visible, query, active, optionId, activeOptionId } = search;\n const selected = allOptions.find(option => {\n return option.value === selectedValue;\n });\n const text = query ?? selected?.label ?? selectedValue;\n const show = () => {\n changeOpen(true);\n };\n const choose = (option: SelectOption) => {\n if (option.disabled || loading || errorLabel || !available()) {\n return;\n }\n change(option.value);\n close();\n focus();\n };\n return (<Primitive.Root\n open={open}\n onOpenChange={changeOpen}\n >\n <div\n className=\"gridui-u-relative gridui-u-flex gridui-u-min-w-0 gridui-u-w-full gridui-u-items-stretch gridui-u-gap-gridui-4\"\n dir={dir}\n >\n <Primitive.Anchor\n asChild\n >\n <div\n ref={anchorRef}\n className=\"gridui-u-relative gridui-u-flex gridui-u-min-w-0 gridui-u-flex-1 gridui-u-items-stretch\"\n >\n <input\n {...restProps}\n id={restProps.id ?? inputId}\n type=\"text\"\n role=\"combobox\"\n ref={(element) => {\n controlRef.current = element;\n if (typeof ref === \"function\") {\n return ref(element);\n }\n if (ref) {\n ref.current = element;\n }\n }}\n aria-label={restProps[\"aria-label\"] ?? (restProps.id ? undefined : searchLabel)}\n aria-required={required}\n aria-autocomplete=\"list\"\n aria-busy={loading || undefined}\n aria-expanded={open}\n aria-controls={open ? listId : undefined}\n aria-activedescendant={open ? activeOptionId : undefined}\n placeholder={placeholder ?? searchLabel}\n autoComplete=\"off\"\n form={form}\n disabled={disabled}\n readOnly={readOnly}\n className={cn(controlVariants({ size: controlSize }), comboboxInputStyles(), className)}\n value={text}\n onClick={(event) => {\n onClick?.(event); if (!event.defaultPrevented && !open) {\n show();\n }\n }}\n onChange={(event) => {\n if (readOnly) {\n return;\n }\n search.changeQuery(event.target.value);\n changeOpen(true);\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || readOnly) {\n return;\n }\n if (isComposingKeyEvent(event.nativeEvent)) {\n if (event.key === \"Enter\" || event.key === \"Escape\") {\n event.stopPropagation();\n }\n return;\n }\n if (event.key === \"Escape\" && open) {\n event.preventDefault(); event.stopPropagation(); close();\n }\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n if (!open) {\n show(); return;\n }\n search.moveActive(event.key === \"ArrowDown\" ? 1 : -1);\n }\n if (event.key === \"Enter\" && open) {\n event.preventDefault();\n const option = search.activeOption;\n if (option) {\n choose(option);\n }\n }\n if (event.key === \"Tab\" && open) {\n const action = !event.shiftKey && popupRef.current?.querySelector<HTMLElement>(\"button:not(:disabled), a[href]\");\n if (action) {\n event.preventDefault(); action.focus();\n } else {\n close();\n }\n }\n }}\n />\n <button\n type=\"button\"\n aria-label={searchLabel}\n disabled={disabled || readOnly}\n className={comboboxTriggerStyles()}\n onClick={() => {\n if (open) {\n close();\n } else {\n show();\n } focus();\n }}\n >\n <ChevronDown\n size={16}\n aria-hidden=\"true\"\n />\n </button>\n </div>\n </Primitive.Anchor>\n {clearLabel && (<button\n type=\"button\"\n disabled={disabled || readOnly || required || selectedValue === \"\"}\n aria-label={clearLabel}\n onClick={() => {\n change(\"\"); close(); focus();\n }}\n className={cn(controlVariants({ size: controlSize }), \"gridui-u-flex gridui-u-w-auto gridui-u-shrink-0 gridui-u-items-center gridui-u-justify-center gridui-u-min-w-11 gridui-u-cursor-pointer\")}\n >\n <X\n size={16}\n aria-hidden=\"true\"\n />\n </button>)}\n <SelectionForm\n name={name}\n form={form}\n required={required}\n disabled={disabled}\n selectedValue={selectedValue}\n allOptions={allOptions}\n onValueChange={change}\n onReset={() => {\n reset();\n close();\n }}\n onInvalid={focus}\n />\n </div>\n <SelectionPopup\n container={portalContainer}\n ref={popupRef}\n role=\"presentation\"\n dir={dir}\n finalFocus={finalFocus}\n anchorRef={anchorRef}\n onDismiss={close}\n onEscape={() => {\n close();\n focus();\n }}\n >\n <div\n role=\"status\"\n aria-atomic=\"true\"\n className={cn(selectEmptyStyles(), \"gridui-u-empty:hidden\")}\n >\n {loading ? loadingLabel : errorLabel ?? (visible.length ? resultCountLabel?.(visible.length) : emptyLabel)}\n </div>\n <ComboboxOptions\n id={listId}\n label={searchLabel}\n options={filtered}\n selected={selectedValue}\n active={active}\n optionId={optionId}\n onSelect={choose}\n onHighlight={search.highlight}\n />\n <SelectionActions\n actions={actions}\n onAction={runAction}\n />\n </SelectionPopup>\n </Primitive.Root>);\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace MultiSelect\n * @description Multi Select\n */\n\nimport { ComboboxOptions } from \"../shared/combobox-options\";\nimport { SelectionPopup } from \"../shared/selection-popup\";\nimport { selectEmptyStyles } from \"../shared/style\";\nimport type { SelectGroup, SelectionSearchProps, SelectOption } from \"../shared/types\";\nimport { useSearchOptions } from \"../shared/use-search-options\";\nimport { useSelectionPopup } from \"../shared/use-selection-popup\";\nimport { ListFieldControl, type ListFieldProps, useListField } from \"@gridui/form\";\nimport { controlVariants } from \"@gridui/input\";\nimport { isComposingKeyEvent } from \"@gridui/interaction\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-popover\";\nimport { ChevronDown, X } from \"lucide-react\";\nimport { type ComponentPropsWithRef, type FC, useId, useRef } from \"react\";\n\nexport type MultiSelectProps = Omit<ComponentPropsWithRef<\"button\">, \"children\" | \"value\" | \"defaultValue\" | \"onChange\" | \"type\"> & ListFieldProps & SelectionSearchProps & {\n readonly options: readonly (SelectOption | SelectGroup)[];\n readonly placeholder: string;\n readonly searchLabel: string;\n readonly emptyLabel: string;\n readonly clearLabel?: string;\n readonly required?: boolean;\n readonly portalContainer?: HTMLElement | null;\n};\n\nexport const MultiSelect: FC<MultiSelectProps> = (props: MultiSelectProps) => {\n const { value, defaultValue, onValueChange, options, placeholder, searchLabel, emptyLabel, clearLabel, required, disabled, readOnly,\n name, form, portalContainer, className, ref, onKeyDown, query: controlledQuery, onQueryChange, filterOptions,\n loading, loadingLabel, errorLabel, resultCountLabel, ...restProps } = props;\n const search = useRef<HTMLInputElement>(null);\n const id = useId();\n const { selected, native, control, change } = useListField({\n value,\n defaultValue,\n onValueChange,\n disabled,\n readOnly,\n form,\n }, () => {\n close();\n });\n const { open, popupRef: popup, available, changeOpen, close, focus, finalFocus } = useSelectionPopup({\n disabled,\n readOnly,\n controlRef: control,\n });\n const searchOptions = useSearchOptions(options, selected, `${id}-list`, open, {\n query: controlledQuery,\n onQueryChange,\n filterOptions,\n loading,\n errorLabel,\n });\n const { all, filtered, visible, query, active, optionId, activeOptionId } = searchOptions;\n const choose = (option: SelectOption) => {\n if (option.disabled || loading || errorLabel || !available()) {\n return;\n }\n change(selected.includes(option.value) ? selected.filter(entry => {\n return entry !== option.value;\n }) : [\n ...selected,\n option.value,\n ]);\n search.current?.focus({ preventScroll: true });\n };\n return (<Primitive.Root\n open={open}\n onOpenChange={changeOpen}\n >\n <div\n className=\"gridui-u-flex gridui-u-min-w-0 gridui-u-items-stretch gridui-u-gap-gridui-4\"\n dir={restProps.dir}\n >\n <Primitive.Trigger\n asChild\n >\n <button\n {...restProps}\n type=\"button\"\n form={form}\n disabled={disabled}\n aria-readonly={readOnly}\n aria-required={required}\n ref={(element) => {\n control.current = element; if (typeof ref === \"function\") {\n return ref(element);\n } if (ref) {\n ref.current = element;\n }\n }}\n className={cn(controlVariants(), \"gridui-u-flex gridui-u-flex-1 gridui-u-items-center gridui-u-gap-gridui-8 gridui-u-text-start\", className)}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented && (event.key === \"ArrowDown\" || event.key === \"ArrowUp\")) {\n event.preventDefault(); changeOpen(true);\n }\n }}\n >\n <span\n className=\"gridui-u-min-w-0 gridui-u-flex-1 gridui-u-wrap-anywhere\"\n >\n {selected.length\n ? selected.map(entry => {\n return all.find(option => {\n return option.value === entry;\n })?.label ?? entry;\n }).join(\", \")\n : placeholder}\n </span>\n <ChevronDown\n size={16}\n aria-hidden=\"true\"\n />\n </button>\n </Primitive.Trigger>\n {clearLabel && (<button\n type=\"button\"\n aria-label={clearLabel}\n disabled={disabled || readOnly || required || !selected.length}\n className={cn(controlVariants(), \"gridui-u-flex gridui-u-w-auto gridui-u-shrink-0 gridui-u-items-center gridui-u-justify-center gridui-u-min-w-11 gridui-u-cursor-pointer\")}\n onClick={() => {\n change([]); control.current?.focus();\n }}\n >\n <X\n size={16}\n aria-hidden=\"true\"\n />\n </button>)}\n <ListFieldControl\n ref={native}\n name={name}\n form={form}\n required={required}\n disabled={disabled}\n value={selected}\n onValueChange={change}\n onInvalidFocus={() => {\n control.current?.focus();\n }}\n >\n {all.map(option => {\n return (<option\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n >\n {option.label}\n </option>);\n })}\n {selected.filter(entry => {\n return !all.some(option => {\n return option.value === entry;\n });\n }).map(entry => {\n return (<option\n key={entry}\n value={entry}\n >\n {entry}\n </option>);\n })}\n </ListFieldControl>\n </div>\n <SelectionPopup\n container={portalContainer}\n ref={popup}\n aria-label={searchLabel}\n dir={restProps.dir}\n finalFocus={finalFocus}\n initialFocus={() => {\n search.current?.focus({ preventScroll: true });\n }}\n onEscape={() => {\n close();\n focus();\n }}\n >\n <input\n ref={search}\n type=\"text\"\n role=\"combobox\"\n aria-label={searchLabel}\n aria-expanded=\"true\"\n aria-autocomplete=\"list\"\n aria-busy={loading || undefined}\n aria-controls={`${id}-list`}\n aria-activedescendant={activeOptionId}\n value={query ?? \"\"}\n className={cn(controlVariants({ size: \"small\" }), \"gridui-u-mb-gridui-4 gridui-u-shrink-0\")}\n onChange={(event) => {\n searchOptions.changeQuery(event.target.value);\n }}\n onKeyDown={(event) => {\n if (isComposingKeyEvent(event.nativeEvent)) {\n event.stopPropagation(); return;\n }\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n searchOptions.moveActive(event.key === \"ArrowDown\" ? 1 : -1);\n }\n if (event.key === \"Enter\") {\n event.preventDefault();\n const option = searchOptions.activeOption;\n if (option) {\n choose(option);\n }\n }\n }}\n />\n <ComboboxOptions\n id={`${id}-list`}\n label={searchLabel}\n options={filtered}\n selected={selected}\n multiple\n active={active}\n optionId={optionId}\n onSelect={choose}\n onHighlight={searchOptions.highlight}\n />\n <div\n role=\"status\"\n aria-atomic=\"true\"\n className={cn(selectEmptyStyles(), \"gridui-u-empty:hidden\")}\n >\n {loading ? loadingLabel : errorLabel ?? (visible.length ? resultCountLabel?.(visible.length) : emptyLabel)}\n </div>\n </SelectionPopup>\n </Primitive.Root>);\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Select\n * @description Style\n */\n\nimport { selectItemStyles } from \"../shared/style\";\nimport { overlaySurfaceStyles } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const selectContentStyles = cva(cn(\n overlaySurfaceStyles(),\n \"gridui-u-z-(--gridui-z-popover) gridui-u-p-gridui-4 gridui-u-type-data\",\n \"gridui-select-content gridui-u-box-border gridui-u-relative gridui-u-flex gridui-u-flex-col gridui-u-overflow-hidden gridui-u-min-w-0 gridui-u-w-(--anchor-width) gridui-u-max-w-(--available-width) gridui-u-max-h-(--available-height)\",\n));\n\nexport const selectMenuItemStyles = cva(cn(selectItemStyles(), \"gridui-u-relative gridui-u-px-gridui-4 gridui-u-pr-9\"));\n\nexport const selectIndicatorStyles = cva(\"gridui-u-absolute gridui-u-inset-y-0 gridui-u-right-gridui-4 gridui-u-flex gridui-u-w-gridui-16 gridui-u-items-center gridui-u-justify-center gridui-u-text-foreground\");\n\nexport const selectScrollArrowStyles = cva(\"gridui-u-absolute gridui-u-inset-x-0 gridui-u-z-(--gridui-z-content) gridui-u-flex gridui-u-h-gridui-24 gridui-u-items-center gridui-u-justify-center gridui-u-bg-background gridui-u-text-foreground\", {\n variants: {\n direction: {\n up: \"gridui-u-top-0\",\n down: \"gridui-u-bottom-0\",\n },\n },\n});\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Select\n * @description Select Options\n */\n\nimport { selectIconStyles, selectListStyles, selectOptionContentStyles, selectOptionDescriptionStyles } from \"../shared/style\";\nimport type { SelectGroup, SelectOption } from \"../shared/types\";\nimport { selectIndicatorStyles, selectMenuItemStyles } from \"./style\";\nimport { dropdownLabelStyles } from \"@gridui/dropdown-menu\";\nimport { useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport * as Primitive from \"@radix-ui/react-select\";\nimport { Check } from \"lucide-react\";\nimport { type FC, useId } from \"react\";\n\nexport type SelectOptionsProps = {\n readonly options: readonly (SelectOption | SelectGroup)[];\n readonly id: string;\n readonly label?: string | undefined;\n};\n\nexport const SelectOptions: FC<SelectOptionsProps> = (props: SelectOptionsProps) => {\n\n const { options, id, label } = props;\n const scrollbarRef = useScrollbars<HTMLDivElement>();\n const ref = useInteractionOutline<HTMLDivElement>({\n ref: scrollbarRef,\n selector: '[role=\"option\"]',\n });\n\n return (<Primitive.Viewport\n ref={ref}\n className={selectListStyles()}\n role=\"listbox\"\n id={id}\n aria-label={label}\n >\n {options.map((entry) => {\n\n if (!(\"options\" in entry)) {\n return (<SelectOptionItem\n key={entry.value}\n option={entry}\n />);\n }\n\n return (<Primitive.Group\n key={entry.label}\n >\n <Primitive.Label\n className={dropdownLabelStyles()}\n >\n {entry.label}\n </Primitive.Label>\n {entry.options.map(option => {\n return (<SelectOptionItem\n key={option.value}\n option={option}\n />);\n })}\n </Primitive.Group>);\n })}\n </Primitive.Viewport>);\n};\n\nexport type SelectOptionItemProps = {\n readonly option: SelectOption;\n};\n\nexport const SelectOptionItem: FC<SelectOptionItemProps> = (props: SelectOptionItemProps) => {\n const { option } = props;\n const labelId = useId();\n const descriptionId = `${labelId}-description`;\n return (<Primitive.Item\n value={`gridui:${option.value}`}\n aria-labelledby={labelId}\n aria-describedby={option.description ? descriptionId : undefined}\n textValue={option.label}\n disabled={option.disabled}\n className={selectMenuItemStyles()}\n >\n {option.icon && (<span\n className={selectIconStyles()}\n aria-hidden=\"true\"\n >\n {option.icon}\n </span>)}\n <span\n className={selectOptionContentStyles()}\n >\n <Primitive.ItemText\n id={labelId}\n >\n {option.label}\n </Primitive.ItemText>\n {option.description && (<span\n id={descriptionId}\n className={selectOptionDescriptionStyles()}\n >\n {option.description}\n </span>)}\n </span>\n <Primitive.ItemIndicator\n className={selectIndicatorStyles()}\n aria-hidden=\"true\"\n >\n <Check\n size={16}\n />\n </Primitive.ItemIndicator>\n </Primitive.Item>);\n\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Select\n * @description Select\n */\n\nimport { flattenOptions } from \"../shared/options\";\nimport { SelectionActions } from \"../shared/selection-actions\";\nimport { SelectionForm } from \"../shared/selection-form\";\nimport { selectIconStyles } from \"../shared/style\";\nimport type { SelectionProps } from \"../shared/types\";\nimport { useSelectionPopup } from \"../shared/use-selection-popup\";\nimport { useSelectionValue } from \"../shared/use-selection-value\";\nimport { SelectOptions } from \"./select-options\";\nimport { selectContentStyles, selectScrollArrowStyles } from \"./style\";\nimport { controlVariants } from \"@gridui/input\";\nimport { interactionLayerProps } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-select\";\nimport { ChevronDown, ChevronUp, X } from \"lucide-react\";\nimport { type ComponentPropsWithRef, type FC, useId, useRef, useState } from \"react\";\n\nexport type SelectProps = Omit<ComponentPropsWithRef<\"button\">,\n \"children\" | \"value\" | \"defaultValue\" | \"onChange\" | \"type\"> & SelectionProps & {\n readonly placeholder?: string;\n readonly position?: \"item-aligned\" | \"popper\";\n };\n\nexport const Select: FC<SelectProps> = (props: SelectProps) => {\n\n const {\n options, actions = [], value, defaultValue = \"\", onValueChange, placeholder,\n controlSize = \"standard\", position = \"popper\", clearLabel, required, disabled,\n name, form, dir, portalContainer,\n className, ref, ...restProps\n } = props;\n const controlRef = useRef<HTMLElement>(null);\n const {\n open,\n popupRef,\n available,\n changeOpen,\n close,\n focus,\n runAction,\n finalFocus,\n } = useSelectionPopup({\n disabled,\n controlRef,\n });\n const { selectedValue, change, reset } = useSelectionValue({\n value,\n defaultValue,\n onValueChange,\n }, available);\n const listId = useId();\n const [\n triggerWidth,\n setTriggerWidth,\n ] = useState<number>();\n const allOptions = flattenOptions(options);\n const selected = allOptions.find(option => {\n\n return option.value === selectedValue;\n });\n const fallback = selectedValue === \"\" ? placeholder ?? \"\" : selectedValue;\n const display = selected?.label ?? fallback;\n\n // SelectionForm owns form reset and submission, including canceled resets.\n return (<Primitive.Root\n form={`${listId}-detached`}\n value={selected ? `gridui:${selectedValue}` : \"\"}\n disabled={disabled}\n open={open}\n onOpenChange={(next) => {\n if (next) {\n setTriggerWidth(controlRef.current?.getBoundingClientRect().width);\n }\n changeOpen(next);\n }}\n onValueChange={(next) => {\n change(next.slice(7));\n }}\n dir={dir === \"rtl\" ? \"rtl\" : \"ltr\"}\n >\n <div\n className=\"gridui-u-relative gridui-u-flex gridui-u-min-w-0 gridui-u-w-full gridui-u-items-stretch gridui-u-gap-gridui-4\"\n dir={dir}\n >\n <Primitive.Trigger\n {...restProps}\n form={form}\n aria-controls={open ? listId : undefined}\n aria-required={required}\n ref={(element) => {\n\n controlRef.current = element;\n if (typeof ref === \"function\") {\n return ref(element);\n }\n if (ref) {\n ref.current = element;\n }\n }}\n className={cn(controlVariants({ size: controlSize }), \"gridui-u-flex gridui-u-flex-1 gridui-u-items-center gridui-u-gap-gridui-8 gridui-u-text-start\", className)}\n >\n {selected?.icon && (<span\n className={selectIconStyles()}\n aria-hidden=\"true\"\n >\n {selected.icon}\n </span>)}\n <span\n className=\"gridui-u-min-w-0 gridui-u-flex-1 gridui-u-whitespace-normal gridui-u-wrap-anywhere\"\n >\n <Primitive.Value\n placeholder={display}\n >\n {display}\n </Primitive.Value>\n </span>\n <Primitive.Icon>\n <ChevronDown\n size={16}\n className=\"gridui-u-shrink-0\"\n aria-hidden=\"true\"\n />\n </Primitive.Icon>\n </Primitive.Trigger>\n {clearLabel && (<button\n type=\"button\"\n disabled={disabled || required || selectedValue === \"\"}\n aria-label={clearLabel}\n onClick={() => {\n\n change(\"\");\n controlRef.current?.focus();\n }}\n className={cn(controlVariants({ size: controlSize }), \"gridui-u-flex gridui-u-w-auto gridui-u-shrink-0 gridui-u-items-center gridui-u-justify-center gridui-u-min-w-11 gridui-u-cursor-pointer\")}\n >\n <X\n size={16}\n aria-hidden=\"true\"\n />\n </button>)}\n <SelectionForm\n name={name}\n form={form}\n required={required}\n disabled={disabled}\n selectedValue={selectedValue}\n allOptions={allOptions}\n onValueChange={change}\n onReset={() => {\n reset();\n close();\n }}\n onInvalid={focus}\n />\n </div>\n <Primitive.Portal\n container={portalContainer}\n >\n <Primitive.Content\n {...interactionLayerProps}\n position={position}\n align=\"start\"\n sideOffset={8}\n collisionPadding={16}\n ref={popupRef}\n role=\"presentation\"\n {...(position === \"item-aligned\" ? {\n \"data-side\": \"none\",\n style: { width: triggerWidth },\n } : {})}\n className={selectContentStyles()}\n dir={dir}\n onCloseAutoFocus={(event) => {\n event.preventDefault();\n const target = finalFocus();\n if (target) {\n target.focus();\n }\n }}\n onPointerDownOutside={() => {\n close();\n }}\n onEscapeKeyDown={(event) => {\n event.preventDefault();\n event.stopPropagation(); changeOpen(false);\n }}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.stopPropagation();\n }\n if (event.key === \"Tab\") {\n event.preventDefault();\n const controls = Array.from(event.currentTarget.querySelectorAll<HTMLElement>(\"button:not(:disabled), a[href]\"));\n const active = controls.indexOf(event.target as HTMLElement);\n const next = controls[active + (event.shiftKey ? -1 : 1)];\n if (next) {\n next.focus();\n }\n else {\n popupRef.current?.querySelector<HTMLElement>('[role=\"option\"][data-state=\"checked\"]')?.focus();\n }\n }\n if ((event.target as HTMLElement).closest(\"button, a\") && event.key !== \"Tab\") {\n event.stopPropagation();\n }\n }}\n >\n <div\n className=\"gridui-u-relative gridui-u-flex gridui-u-min-h-0 gridui-u-flex-col\"\n >\n <Primitive.ScrollUpButton\n className={selectScrollArrowStyles({ direction: \"up\" })}\n >\n <ChevronUp\n size={16}\n aria-hidden=\"true\"\n />\n </Primitive.ScrollUpButton>\n <SelectOptions\n options={options}\n id={listId}\n label={restProps[\"aria-label\"]}\n />\n <Primitive.ScrollDownButton\n className={selectScrollArrowStyles({ direction: \"down\" })}\n >\n <ChevronDown\n size={16}\n aria-hidden=\"true\"\n />\n </Primitive.ScrollDownButton>\n </div>\n <SelectionActions\n actions={actions}\n onAction={runAction}\n />\n\n </Primitive.Content>\n </Primitive.Portal>\n </Primitive.Root>);\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace UseAsyncOptions\n * @description Request\n */\n\nexport type AsyncOptionsLoader<T> = (query: string, signal: AbortSignal) => Promise<readonly T[]>;\n\nexport type AsyncOptionsState<T> = {\n readonly query: string;\n readonly options: readonly T[];\n readonly loading: boolean;\n readonly error: unknown;\n};\n\nexport const createOptionsRequest = <T>(\n loadOptions: AsyncOptionsLoader<T>,\n onState: (state: AsyncOptionsState<T>) => void,\n) => {\n let controller: AbortController | undefined;\n const cancel = () => {\n controller?.abort();\n controller = undefined;\n };\n const run = async (query: string) => {\n cancel();\n const current = new AbortController();\n controller = current;\n onState({\n query,\n options: [],\n loading: true,\n error: null,\n });\n try {\n const options = await loadOptions(query, current.signal);\n if (controller === current && !current.signal.aborted) {\n onState({\n query,\n options,\n loading: false,\n error: null,\n });\n }\n } catch (error: unknown) {\n if (controller === current && !current.signal.aborted) {\n onState({\n query,\n options: [],\n loading: false,\n error,\n });\n }\n }\n };\n return {\n run,\n cancel,\n };\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace UseAsyncOptions\n * @description Use Async Options\n */\n\nimport { type AsyncOptionsLoader, type AsyncOptionsState, createOptionsRequest } from \"./request\";\nimport { useEffect, useState } from \"react\";\n\nexport type UseAsyncOptionsOptions<T> = {\n readonly query: string;\n readonly loadOptions: AsyncOptionsLoader<T>;\n readonly debounceMs?: number;\n readonly enabled?: boolean;\n};\n\ntype OwnedOptionsState<T> = {\n readonly loader: AsyncOptionsLoader<T>;\n readonly result: AsyncOptionsState<T>;\n};\n\nexport const useAsyncOptions = <T>({ query, loadOptions, debounceMs = 150, enabled = true }: UseAsyncOptionsOptions<T>): AsyncOptionsState<T> => {\n if (!Number.isFinite(debounceMs) || debounceMs < 0) {\n throw new RangeError(\"Option search debounce must be finite and nonnegative.\");\n }\n const [\n state,\n setState,\n ] = useState<OwnedOptionsState<T>>({\n loader: loadOptions,\n result: {\n query,\n options: [],\n loading: enabled,\n error: null,\n },\n });\n useEffect(() => {\n const publish = (result: AsyncOptionsState<T>) => {\n setState({\n loader: loadOptions,\n result,\n });\n };\n const request = createOptionsRequest(loadOptions, publish);\n publish({\n query,\n options: [],\n loading: enabled,\n error: null,\n });\n if (!enabled) {\n return request.cancel;\n }\n const timer = setTimeout(() => {\n void request.run(query);\n }, debounceMs);\n return () => {\n clearTimeout(timer);\n request.cancel();\n };\n }, [\n query,\n loadOptions,\n debounceMs,\n enabled,\n ]);\n return state.loader === loadOptions && state.result.query === query && enabled ? state.result : {\n query,\n options: [],\n loading: enabled,\n error: null,\n };\n};\n"],
5
- "mappings": ";AAOA,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,mBAAmB,IAAI,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;AAEzE,IAAM,mBAAmB,IAAI,8FAA8F;AAE3H,IAAM,4BAA4B,IAAI,oFAAoF;AAE1H,IAAM,gCAAgC,IAAI,+EAA+E;AAEzH,IAAM,mBAAmB,IAAI,2CAA2C;AAExE,IAAM,oBAAoB,IAAI,+DAA+D;AAE7F,IAAM,sBAAsB,IAAI,iFAAiF;AAEjH,IAAM,qBAAqB,IAAI;AAAA,EAClC,iBAAiB;AAAA,EACjB;AACJ,CAAC;AAEM,IAAM,wBAAwB,IAAI;AAAA,EACrC,qBAAqB;AAAA,EACrB;AAAA,EACA;AACJ,CAAC;;;AC1BD,SAAS,yBAAyB,2BAA2B;AAC7D,SAAS,uBAAuB,qBAAqB;AACrD,SAAS,aAAa;AAoDO,cAUjB,YAViB;AArCtB,IAAM,kBAA4C,CAAC,UAAgC;AACtF,QAAM,EAAE,IAAI,OAAO,SAAS,UAAU,UAAU,QAAQ,UAAU,UAAU,YAAY,IAAI;AAC5F,QAAM,eAAe,cAA8B;AACnD,QAAM,MAAM,sBAAsC;AAAA,IAC9C,KAAK;AAAA,IACL,UAAU;AAAA,EACd,CAAC;AACD,QAAM,eAAe,CAAC,WAAyB;AAC3C,UAAM,S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", "cva", "isComposingKeyEvent", "cn", "Primitive", "useRef", "jsx", "jsxs", "filterOptions", "controlVariants", "isComposingKeyEvent", "cn", "Primitive", "ChevronDown", "X", "useId", "useRef", "jsx", "jsxs", "filterOptions", "overlaySurfaceStyles", "cn", "cva", "dropdownLabelStyles", "useInteractionOutline", "useScrollbars", "Primitive", "Check", "useId", "jsx", "jsxs", "controlVariants", "interactionLayerProps", "cn", "Primitive", "ChevronDown", "X", "useId", "useRef", "useState", "jsx", "jsxs", "useEffect", "useState"]
3
+ "sources": ["../src/shared/style.ts", "../src/shared/popup/selection-actions.tsx", "../src/shared/popup/selection-popup.tsx", "../src/shared/popup/use-selection-popup.ts", "../src/shared/search/combobox-options.tsx", "../src/shared/options.ts", "../src/shared/search/scroll-option.ts", "../src/shared/search/use-search-options.ts", "../src/shared/selection-form.tsx", "../src/shared/use-selection-value.ts", "../src/combobox/style.ts", "../src/combobox/combobox.tsx", "../src/multi-select/multi-select.tsx", "../src/select/select-options.tsx", "../src/select/style.ts", "../src/select/select.tsx", "../src/use-async-options/request.ts", "../src/use-async-options/use-async-options.ts"],
4
+ "sourcesContent": ["/**\n * @author WMXPY\n * @package Select\n * @namespace Shared\n * @description Style\n */\n\nimport { overlayListItemStyles, overlayListStyles } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const selectIconStyles = cva(\"gridui-u-select--inline-flex gridui-u-select--shrink-0 gridui-u-select--items-center gridui-u-select--[&_svg]:size-gridui-16\");\n\nexport const selectOptionContentStyles = cva(\"gridui-u-select--min-w-0 gridui-u-select--flex-1 gridui-u-select--whitespace-normal gridui-u-select--wrap-anywhere\");\n\nexport const selectOptionDescriptionStyles = cva(\"gridui-u-select--block gridui-u-select--text-muted gridui-u-select--type-caption gridui-u-select--mt-gridui-4\");\n\nexport const selectListStyles = cva(\"gridui-u-select--min-h-0 gridui-u-select--overflow-y-auto\");\n\nexport const selectEmptyStyles = cva(\"gridui-u-select--p-gridui-8 gridui-u-select--text-muted gridui-u-select--type-caption\");\n\nexport const selectActionsStyles = cva(\"gridui-u-select--shrink-0 gridui-u-select--border-t gridui-u-select--border-border\");\n\nexport const selectActionStyles = cva(cn(\n overlayListItemStyles(),\n \"gridui-u-select--w-full gridui-u-select--text-start\",\n));\n\nexport const comboboxContentStyles = cva(cn(\n overlayListStyles(),\n \"gridui-combobox-content gridui-u-select--box-border gridui-u-select--flex gridui-u-select--flex-col gridui-u-select--overflow-hidden gridui-u-select--min-w-0 gridui-u-select--w-(--anchor-width) gridui-u-select--max-h-(--available-height) gridui-u-select--max-w-(--available-width)\",\n));\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared_Popup\n * @description Selection Actions\n */\n\nimport { selectActionsStyles, selectActionStyles, selectIconStyles } from \"../style\";\nimport type { SelectAction } from \"../types\";\nimport type { FC } from \"react\";\n\nexport type SelectionActionsProps = {\n readonly actions: readonly SelectAction[];\n readonly onAction: (action: SelectAction) => boolean;\n};\n\nexport const SelectionActions: FC<SelectionActionsProps> = (props: SelectionActionsProps) => {\n const { actions, onAction } = props;\n return (<>\n {actions.length > 0 && (<div\n className={selectActionsStyles()}\n >\n {actions.map((action) => {\n const content = (<>\n {action.icon && (<span\n className={selectIconStyles()}\n aria-hidden=\"true\"\n >\n {action.icon}\n </span>)}\n {action.label}\n </>);\n const actionClass = selectActionStyles();\n if (action.href !== undefined) {\n return (<a\n key={action.id}\n href={action.disabled ? undefined : action.href}\n target={action.target}\n rel={action.rel}\n aria-disabled={action.disabled || undefined}\n data-disabled={action.disabled ? \"\" : undefined}\n tabIndex={action.disabled ? -1 : undefined}\n className={actionClass}\n onClick={(event) => {\n if (action.disabled) {\n event.preventDefault();\n return;\n }\n if (!onAction(action)) {\n event.preventDefault();\n }\n }}\n >\n {content}\n </a>);\n }\n return (<button\n key={action.id}\n type=\"button\"\n disabled={action.disabled}\n data-disabled={action.disabled ? \"\" : undefined}\n className={actionClass}\n onClick={() => {\n onAction(action);\n }}\n >\n {content}\n </button>);\n })}\n </div>)}\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared_Popup\n * @description Selection Popup\n */\n\nimport { comboboxContentStyles } from \"../style\";\nimport { isComposingKeyEvent } from \"@gridui/interaction\";\nimport { interactionLayerProps } from \"@gridui/overlay\";\nimport * as Primitive from \"@radix-ui/react-popover\";\nimport type { ComponentPropsWithRef, FC, RefObject } from \"react\";\n\nexport type SelectionPopupProps = Pick<ComponentPropsWithRef<typeof Primitive.Content>, \"ref\" | \"children\" | \"dir\" | \"role\" | \"aria-label\"> & {\n readonly container?: ComponentPropsWithRef<typeof Primitive.Portal>[\"container\"];\n readonly anchorRef?: RefObject<HTMLElement | null>;\n readonly initialFocus?: () => void;\n readonly finalFocus: () => HTMLElement | false;\n readonly onEscape: () => void;\n readonly onDismiss?: () => void;\n};\n\nexport const SelectionPopup: FC<SelectionPopupProps> = (props: SelectionPopupProps) => {\n const { container, anchorRef, initialFocus, finalFocus, onEscape, onDismiss, ...restProps } = props;\n return (<Primitive.Portal\n container={container}\n >\n <Primitive.Content\n {...interactionLayerProps}\n {...restProps}\n sideOffset={8}\n align=\"start\"\n collisionPadding={16}\n className={comboboxContentStyles()}\n onOpenAutoFocus={event => {\n event.preventDefault();\n initialFocus?.();\n }}\n onCloseAutoFocus={event => {\n event.preventDefault();\n const target = finalFocus();\n if (target) {\n target.focus();\n }\n }}\n onInteractOutside={event => {\n if (anchorRef?.current?.contains(event.target as Node)) {\n event.preventDefault();\n } else {\n onDismiss?.();\n }\n }}\n onEscapeKeyDown={event => {\n event.preventDefault();\n event.stopPropagation();\n if (!isComposingKeyEvent(event)) {\n onEscape();\n }\n }}\n onKeyDown={event => {\n if (event.key === \"Escape\") {\n event.stopPropagation();\n }\n }}\n />\n </Primitive.Portal>);\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared_Popup\n * @description Use Selection Popup\n */\n\nimport type { SelectAction } from \"../types\";\nimport { type RefObject, useEffect, useRef, useState } from \"react\";\nimport { flushSync } from \"react-dom\";\n\ntype SelectionPopupOptions = {\n readonly disabled?: boolean | undefined;\n readonly readOnly?: boolean | undefined;\n readonly controlRef: RefObject<HTMLElement | null>;\n};\n\nexport const useSelectionPopup = ({ disabled, readOnly, controlRef }: SelectionPopupOptions) => {\n const [\n localOpen,\n setLocalOpen,\n ] = useState(false);\n const popupRef = useRef<HTMLDivElement>(null);\n const restoreFocus = useRef(true);\n const unavailable = Boolean(disabled || readOnly);\n useEffect(() => {\n if (unavailable) {\n setLocalOpen(false);\n }\n }, [unavailable]);\n const available = (): boolean => {\n return !unavailable && !controlRef.current?.matches(\":disabled\");\n };\n const changeOpen = (next: boolean): void => {\n if (next && !available()) {\n return;\n }\n if (next) {\n restoreFocus.current = true;\n }\n setLocalOpen(next);\n };\n const close = (): void => {\n restoreFocus.current = false;\n setLocalOpen(false);\n };\n const focus = (): void => {\n controlRef.current?.focus();\n };\n const finalFocus = (): HTMLElement | false => {\n const control = controlRef.current;\n if (!restoreFocus.current || !control) {\n return false;\n }\n // Closing animations may finish after focus moves to another control.\n const active = control.ownerDocument.activeElement;\n if (active && active !== control.ownerDocument.body && active !== control\n && !popupRef.current?.contains(active)) {\n return false;\n }\n return control;\n };\n const runAction = (action: SelectAction): boolean => {\n if (action.disabled || !available()) {\n return false;\n }\n if (action.closeOnAction !== false) {\n flushSync(close);\n focus();\n }\n action.onAction?.();\n return true;\n };\n return {\n open: localOpen && !unavailable,\n popupRef,\n available,\n changeOpen,\n close,\n focus,\n finalFocus,\n runAction,\n };\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared_Search\n * @description Combobox Options\n */\n\nimport { selectIconStyles, selectListStyles, selectOptionContentStyles, selectOptionDescriptionStyles } from \"../style\";\nimport type { SelectionListOptions, SelectOption } from \"../types\";\nimport { overlayListIndicatorStyles, overlayListItemStyles, overlayListLabelStyles, useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { Check } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type ComboboxOptionsProps = SelectionListOptions & {\n readonly label: string;\n readonly selected: string | readonly string[];\n readonly multiple?: boolean;\n readonly active: string | null;\n readonly optionId: (value: string) => string;\n readonly onSelect: (option: SelectOption) => void;\n readonly onHighlight: (value: string) => void;\n};\n\nexport const ComboboxOptions: FC<ComboboxOptionsProps> = (props: ComboboxOptionsProps) => {\n const { id, label, options, selected, multiple, active, optionId, onSelect, onHighlight } = props;\n const scrollbarRef = useScrollbars<HTMLDivElement>();\n const ref = useInteractionOutline<HTMLDivElement>({\n ref: scrollbarRef,\n selector: '[role=\"option\"]',\n });\n const renderOption = (option: SelectOption) => {\n const itemId = optionId(option.value);\n const checked = typeof selected === \"string\" ? selected === option.value : selected.includes(option.value);\n return (<div\n key={option.value}\n id={itemId}\n role=\"option\"\n aria-selected={checked}\n aria-disabled={option.disabled}\n aria-labelledby={`${itemId}-label`}\n aria-describedby={option.description ? `${itemId}-description` : undefined}\n data-disabled={option.disabled ? \"\" : undefined}\n data-highlighted={active === option.value ? \"\" : undefined}\n className={overlayListItemStyles()}\n onPointerMove={() => {\n onHighlight(option.value);\n }}\n onPointerDown={(event) => {\n event.preventDefault();\n }}\n onClick={() => {\n if (!option.disabled) {\n onSelect(option);\n }\n }}\n >\n {option.icon && (<span\n className={selectIconStyles()}\n aria-hidden=\"true\"\n >\n {option.icon}\n </span>)}\n <span\n className={selectOptionContentStyles()}\n >\n <span\n id={`${itemId}-label`}\n >\n {option.label}\n </span>\n {option.description && (<span\n id={`${itemId}-description`}\n className={selectOptionDescriptionStyles()}\n >\n {option.description}\n </span>)}\n </span>\n <span\n className={overlayListIndicatorStyles()}\n aria-hidden=\"true\"\n >\n {checked && (<Check\n size={16}\n />)}\n </span>\n </div>);\n };\n return (<div\n ref={ref}\n id={id}\n role=\"listbox\"\n aria-multiselectable={multiple || undefined}\n aria-label={label}\n className={selectListStyles()}\n >\n {options.map((entry, index) => {\n return \"options\" in entry\n ? (<div\n key={entry.label}\n role=\"group\"\n aria-labelledby={`${id}-group-${index}`}\n >\n <div\n id={`${id}-group-${index}`}\n className={overlayListLabelStyles()}\n >\n {entry.label}\n </div>\n {entry.options.map(renderOption)}\n </div>)\n : renderOption(entry);\n })}\n </div>);\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared\n * @description Options\n */\n\nimport type { SelectGroup, SelectOption } from \"./types\";\n\nexport const flattenOptions = (options: readonly (SelectOption | SelectGroup)[]): SelectOption[] => {\n return options.flatMap((entry) => {\n return \"options\" in entry ? entry.options : [entry];\n });\n};\n\nexport const filterOptions = (\n options: readonly (SelectOption | SelectGroup)[],\n query: string,\n): readonly (SelectOption | SelectGroup)[] => {\n const term = query.trim().normalize(\"NFKC\")\n .toLowerCase();\n if (!term) {\n return options;\n }\n const matches = (option: SelectOption): boolean => {\n return `${option.label} ${option.description ?? \"\"}`.normalize(\"NFKC\")\n .toLowerCase()\n .includes(term);\n };\n return options.flatMap((entry): (SelectOption | SelectGroup)[] => {\n if (\"options\" in entry) {\n const items = entry.options.filter(matches);\n return items.length ? [\n {\n ...entry,\n options: items,\n },\n ] : [];\n }\n return matches(entry) ? [entry] : [];\n });\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared_Search\n * @description Scroll Option\n */\n\n/** Keep active options visible without moving the page beneath a portal. */\nexport const scrollOption = (id: string): void => {\n const option = document.getElementById(id);\n const list = option?.closest<HTMLElement>('[role=\"listbox\"]');\n if (!option || !list) {\n return;\n }\n const itemBounds = option.getBoundingClientRect();\n const listBounds = list.getBoundingClientRect();\n if (itemBounds.top < listBounds.top) {\n list.scrollTop += itemBounds.top - listBounds.top;\n }\n else if (itemBounds.bottom > listBounds.bottom) {\n list.scrollTop += itemBounds.bottom - listBounds.bottom;\n }\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared_Search\n * @description Use Search Options\n */\n\nimport { filterOptions, flattenOptions } from \"../options\";\nimport type { SelectGroup, SelectionSearchProps, SelectOption } from \"../types\";\nimport { scrollOption } from \"./scroll-option\";\nimport { useEffect, useRef, useState } from \"react\";\n\ntype SearchState = {\n readonly query: string | null;\n readonly highlighted: string | null;\n};\n\nconst INITIAL_SEARCH: SearchState = {\n query: null,\n highlighted: null,\n};\n\nexport const useSearchOptions = (\n options: readonly (SelectOption | SelectGroup)[],\n selected: readonly string[],\n listId: string,\n open: boolean,\n searchProps: SelectionSearchProps = {},\n) => {\n const [\n search,\n setSearch,\n ] = useState(INITIAL_SEARCH);\n const { query: controlledQuery, onQueryChange, filterOptions: shouldFilter = true, loading, errorLabel } = searchProps;\n const wasOpen = useRef(open);\n const query = open ? controlledQuery ?? search.query : null;\n const all = flattenOptions(options);\n const availableOptions = shouldFilter ? filterOptions(options, query ?? \"\") : options;\n const filtered = loading || errorLabel ? [] : availableOptions;\n const visible = flattenOptions(filtered);\n const highlighted = visible.find(option => {\n return option.value === search.highlighted;\n });\n const selectedOption = query === null ? visible.find(option => {\n return selected.includes(option.value);\n }) : undefined;\n const active = highlighted ?? selectedOption ?? visible[0];\n const activeValue = active?.value ?? null;\n const optionIndices = new Map(all.map((option, index) => {\n return [\n option.value,\n index,\n ] as const;\n }));\n const optionId = (value: string): string => {\n return `${listId}-${optionIndices.get(value) ?? -1}`;\n };\n const activeOptionId = active ? optionId(active.value) : undefined;\n useEffect(() => {\n if (!open && wasOpen.current) {\n setSearch(INITIAL_SEARCH);\n onQueryChange?.(\"\");\n }\n wasOpen.current = open;\n }, [\n open,\n onQueryChange,\n ]);\n useEffect(() => {\n if (open && activeOptionId !== undefined) {\n scrollOption(activeOptionId);\n }\n }, [\n open,\n activeOptionId,\n ]);\n const highlight = (value: string): void => {\n setSearch(current => {\n return {\n ...current,\n highlighted: value,\n };\n });\n };\n return {\n all,\n filtered,\n visible,\n query,\n active: activeValue,\n activeOption: active,\n activeOptionId,\n optionId,\n highlight,\n changeQuery: (text: string): void => {\n onQueryChange?.(text);\n setSearch({\n query: text,\n highlighted: null,\n });\n },\n moveActive: (direction: number): void => {\n const index = visible.findIndex(option => {\n return option.value === activeValue;\n });\n const next = visible[Math.max(0, Math.min(visible.length - 1, index + direction))];\n if (next) {\n highlight(next.value);\n }\n },\n };\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared\n * @description Selection Form\n */\n\nimport type { SelectionProps, SelectOption } from \"./types\";\nimport { focusInvalidControl, useFormReset } from \"@gridui/form\";\nimport { type FC, useLayoutEffect, useRef } from \"react\";\nimport { flushSync } from \"react-dom\";\n\nexport type SelectionFormProps = {\n readonly [Key in \"name\" | \"form\" | \"required\" | \"disabled\"]: SelectionProps[Key];\n} & {\n readonly selectedValue: string;\n readonly allOptions: readonly SelectOption[];\n readonly onValueChange: (value: string) => void;\n readonly onReset: () => void;\n readonly onInvalid: () => void;\n};\n\nexport const SelectionForm: FC<SelectionFormProps> = (props: SelectionFormProps) => {\n\n const {\n name, form, required, disabled, selectedValue, allOptions,\n onValueChange, onReset, onInvalid,\n } = props;\n const nativeRef = useRef<HTMLSelectElement | null>(null);\n const resetSelection = useRef(onReset);\n const currentValue = useRef(selectedValue);\n useLayoutEffect(() => {\n resetSelection.current = onReset;\n currentValue.current = selectedValue;\n }, [\n onReset,\n selectedValue,\n ]);\n useFormReset(nativeRef, () => {\n flushSync(() => {\n resetSelection.current();\n });\n if (nativeRef.current) {\n nativeRef.current.value = currentValue.current;\n }\n }, form);\n\n return (<select\n ref={nativeRef}\n aria-hidden=\"true\"\n tabIndex={-1}\n className=\"gridui-u-select--sr-only\"\n name={name}\n form={form}\n required={required}\n disabled={disabled}\n value={selectedValue}\n onChange={(event) => {\n\n onValueChange(event.currentTarget.value);\n }}\n onInvalid={(event) => {\n\n focusInvalidControl(event, onInvalid);\n }}\n >\n {!allOptions.some((option) => {\n\n return option.value === \"\";\n }) && (<option\n value=\"\"\n />)}\n {selectedValue !== \"\" && !allOptions.some(option => {\n return option.value === selectedValue;\n }) && (<option\n value={selectedValue}\n >\n {selectedValue}\n </option>)}\n {allOptions.map((option) => {\n\n return (<option\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n >\n {option.label}\n </option>);\n })}\n </select>);\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Shared\n * @description Use Selection Value\n */\n\nimport type { SelectionValueProps } from \"./types\";\nimport { useRef, useState } from \"react\";\n\ntype SelectionValueOptions = {\n readonly [Key in \"value\" | \"defaultValue\" | \"onValueChange\"]: SelectionValueProps[Key];\n};\n\nexport const useSelectionValue = (props: SelectionValueOptions, available: () => boolean) => {\n const { value, defaultValue = \"\", onValueChange } = props;\n const [\n localValue,\n setLocalValue,\n ] = useState(defaultValue);\n const selectedValue = value ?? localValue;\n const initialValue = useRef(selectedValue);\n const update = (next: string): void => {\n if (next === selectedValue) {\n return;\n }\n if (value === undefined) {\n setLocalValue(next);\n }\n onValueChange?.(next);\n };\n return {\n selectedValue,\n change: (next: string | null): void => {\n if (next !== null && available()) {\n update(next);\n }\n },\n reset: (): void => {\n update(initialValue.current);\n },\n };\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Combobox\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const comboboxInputStyles = cva(\"gridui-u-select--pr-11 gridui-u-select--text-ellipsis\");\n\nexport const comboboxTriggerStyles = cva(\"gridui-u-select--absolute gridui-u-select--inset-y-0 gridui-u-select--right-0 gridui-u-select--flex gridui-u-select--w-9 gridui-u-select--items-center gridui-u-select--justify-center gridui-u-select--rounded-control gridui-u-select--text-foreground gridui-u-select--cursor-pointer gridui-u-select--disabled:cursor-not-allowed gridui-u-select--disabled:opacity-50\");\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Combobox\n * @description Combobox\n */\n\nimport { SelectionActions } from \"../shared/popup/selection-actions\";\nimport { SelectionPopup } from \"../shared/popup/selection-popup\";\nimport { useSelectionPopup } from \"../shared/popup/use-selection-popup\";\nimport { ComboboxOptions } from \"../shared/search/combobox-options\";\nimport { useSearchOptions } from \"../shared/search/use-search-options\";\nimport { SelectionForm } from \"../shared/selection-form\";\nimport { selectEmptyStyles } from \"../shared/style\";\nimport type { SelectionProps, SelectionSearchLabels, SelectionSearchProps, SelectOption } from \"../shared/types\";\nimport { useSelectionValue } from \"../shared/use-selection-value\";\nimport { comboboxInputStyles, comboboxTriggerStyles } from \"./style\";\nimport { controlVariants } from \"@gridui/input\";\nimport { isComposingKeyEvent } from \"@gridui/interaction\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-popover\";\nimport { ChevronDown, X } from \"lucide-react\";\nimport { type ComponentPropsWithRef, type FC, useId, useRef } from \"react\";\n\nexport type ComboboxProps = Omit<ComponentPropsWithRef<\"input\">,\n \"children\" | \"value\" | \"defaultValue\" | \"onChange\" | \"type\" | \"size\"> & SelectionProps & SelectionSearchProps & SelectionSearchLabels;\n\nexport const Combobox: FC<ComboboxProps> = (props: ComboboxProps) => {\n const { options, actions = [], value, defaultValue = \"\", onValueChange, controlSize = \"standard\", clearLabel,\n required, disabled, readOnly, name, form, dir, portalContainer, className, ref, searchLabel, emptyLabel,\n placeholder, onKeyDown, onClick, query: controlledQuery, onQueryChange, filterOptions,\n loading, loadingLabel, errorLabel, resultCountLabel, ...restProps } = props;\n const controlRef = useRef<HTMLElement>(null);\n const anchorRef = useRef<HTMLDivElement>(null);\n const { open, popupRef, available, changeOpen, close, focus, runAction, finalFocus } = useSelectionPopup({\n disabled,\n readOnly,\n controlRef,\n });\n const { selectedValue, change, reset } = useSelectionValue({\n value,\n defaultValue,\n onValueChange,\n }, available);\n const inputId = useId();\n const listId = `${inputId}-list`;\n const search = useSearchOptions(options, [selectedValue], listId, open, {\n query: controlledQuery,\n onQueryChange,\n filterOptions,\n loading,\n errorLabel,\n });\n const { all: allOptions, filtered, visible, query, active, optionId, activeOptionId } = search;\n const selected = allOptions.find(option => {\n return option.value === selectedValue;\n });\n const text = query ?? selected?.label ?? selectedValue;\n const show = () => {\n changeOpen(true);\n };\n const choose = (option: SelectOption) => {\n if (option.disabled || loading || errorLabel || !available()) {\n return;\n }\n change(option.value);\n close();\n focus();\n };\n return (<Primitive.Root\n open={open}\n onOpenChange={changeOpen}\n >\n <div\n className=\"gridui-u-select--relative gridui-u-select--flex gridui-u-select--min-w-0 gridui-u-select--w-full gridui-u-select--items-stretch gridui-u-select--gap-gridui-4\"\n dir={dir}\n >\n <Primitive.Anchor\n asChild\n >\n <div\n ref={anchorRef}\n className=\"gridui-u-select--relative gridui-u-select--flex gridui-u-select--min-w-0 gridui-u-select--flex-1 gridui-u-select--items-stretch\"\n >\n <input\n {...restProps}\n id={restProps.id ?? inputId}\n type=\"text\"\n role=\"combobox\"\n ref={(element) => {\n controlRef.current = element;\n if (typeof ref === \"function\") {\n return ref(element);\n }\n if (ref) {\n ref.current = element;\n }\n }}\n aria-label={restProps[\"aria-label\"] ?? (restProps.id ? undefined : searchLabel)}\n aria-required={required}\n aria-autocomplete=\"list\"\n aria-busy={loading || undefined}\n aria-expanded={open}\n aria-controls={open ? listId : undefined}\n aria-activedescendant={open ? activeOptionId : undefined}\n placeholder={placeholder ?? searchLabel}\n autoComplete=\"off\"\n form={form}\n disabled={disabled}\n readOnly={readOnly}\n className={cn(controlVariants({ size: controlSize }), comboboxInputStyles(), className)}\n value={text}\n onClick={(event) => {\n onClick?.(event); if (!event.defaultPrevented && !open) {\n show();\n }\n }}\n onChange={(event) => {\n if (readOnly) {\n return;\n }\n search.changeQuery(event.target.value);\n changeOpen(true);\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || readOnly) {\n return;\n }\n if (isComposingKeyEvent(event.nativeEvent)) {\n if (event.key === \"Enter\" || event.key === \"Escape\") {\n event.stopPropagation();\n }\n return;\n }\n if (event.key === \"Escape\" && open) {\n event.preventDefault(); event.stopPropagation(); close();\n }\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n if (!open) {\n show(); return;\n }\n search.moveActive(event.key === \"ArrowDown\" ? 1 : -1);\n }\n if (event.key === \"Enter\" && open) {\n event.preventDefault();\n const option = search.activeOption;\n if (option) {\n choose(option);\n }\n }\n if (event.key === \"Tab\" && open) {\n const action = !event.shiftKey && popupRef.current?.querySelector<HTMLElement>(\"button:not(:disabled), a[href]\");\n if (action) {\n event.preventDefault(); action.focus();\n } else {\n close();\n }\n }\n }}\n />\n <button\n type=\"button\"\n aria-label={searchLabel}\n disabled={disabled || readOnly}\n className={comboboxTriggerStyles()}\n onClick={() => {\n if (open) {\n close();\n } else {\n show();\n } focus();\n }}\n >\n <ChevronDown\n size={16}\n aria-hidden=\"true\"\n />\n </button>\n </div>\n </Primitive.Anchor>\n {clearLabel && (<button\n type=\"button\"\n disabled={disabled || readOnly || required || selectedValue === \"\"}\n aria-label={clearLabel}\n onClick={() => {\n change(\"\"); close(); focus();\n }}\n className={cn(controlVariants({ size: controlSize }), \"gridui-u-select--flex gridui-u-select--w-auto gridui-u-select--shrink-0 gridui-u-select--items-center gridui-u-select--justify-center gridui-u-select--min-w-11 gridui-u-select--cursor-pointer\")}\n >\n <X\n size={16}\n aria-hidden=\"true\"\n />\n </button>)}\n <SelectionForm\n name={name}\n form={form}\n required={required}\n disabled={disabled}\n selectedValue={selectedValue}\n allOptions={allOptions}\n onValueChange={change}\n onReset={() => {\n reset();\n close();\n }}\n onInvalid={focus}\n />\n </div>\n <SelectionPopup\n container={portalContainer}\n ref={popupRef}\n role=\"presentation\"\n dir={dir}\n finalFocus={finalFocus}\n anchorRef={anchorRef}\n onDismiss={close}\n onEscape={() => {\n close();\n focus();\n }}\n >\n <div\n role=\"status\"\n aria-atomic=\"true\"\n className={cn(selectEmptyStyles(), \"gridui-u-select--empty:hidden\")}\n >\n {loading ? loadingLabel : errorLabel ?? (visible.length ? resultCountLabel?.(visible.length) : emptyLabel)}\n </div>\n <ComboboxOptions\n id={listId}\n label={searchLabel}\n options={filtered}\n selected={selectedValue}\n active={active}\n optionId={optionId}\n onSelect={choose}\n onHighlight={search.highlight}\n />\n <SelectionActions\n actions={actions}\n onAction={runAction}\n />\n </SelectionPopup>\n </Primitive.Root>);\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace MultiSelect\n * @description Multi Select\n */\n\nimport { SelectionPopup } from \"../shared/popup/selection-popup\";\nimport { useSelectionPopup } from \"../shared/popup/use-selection-popup\";\nimport { ComboboxOptions } from \"../shared/search/combobox-options\";\nimport { useSearchOptions } from \"../shared/search/use-search-options\";\nimport { selectEmptyStyles } from \"../shared/style\";\nimport type { SelectionControlOptions, SelectionSearchLabels, SelectionSearchProps, SelectOption } from \"../shared/types\";\nimport { ListFieldControl, type ListFieldProps, useListField } from \"@gridui/form\";\nimport { controlVariants } from \"@gridui/input\";\nimport { isComposingKeyEvent } from \"@gridui/interaction\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-popover\";\nimport { ChevronDown, X } from \"lucide-react\";\nimport { type ComponentPropsWithRef, type FC, useId, useRef } from \"react\";\n\nexport type MultiSelectProps = Omit<ComponentPropsWithRef<\"button\">, \"children\" | \"value\" | \"defaultValue\" | \"onChange\" | \"type\"> & ListFieldProps & SelectionControlOptions & SelectionSearchProps & SelectionSearchLabels & {\n readonly placeholder: string;\n};\n\nexport const MultiSelect: FC<MultiSelectProps> = (props: MultiSelectProps) => {\n const { value, defaultValue, onValueChange, options, placeholder, searchLabel, emptyLabel, clearLabel, required, disabled, readOnly,\n name, form, portalContainer, className, ref, onKeyDown, query: controlledQuery, onQueryChange, filterOptions,\n loading, loadingLabel, errorLabel, resultCountLabel, ...restProps } = props;\n const search = useRef<HTMLInputElement>(null);\n const id = useId();\n const { selected, native, control, change } = useListField({\n value,\n defaultValue,\n onValueChange,\n disabled,\n readOnly,\n form,\n }, () => {\n close();\n });\n const { open, popupRef: popup, available, changeOpen, close, focus, finalFocus } = useSelectionPopup({\n disabled,\n readOnly,\n controlRef: control,\n });\n const searchOptions = useSearchOptions(options, selected, `${id}-list`, open, {\n query: controlledQuery,\n onQueryChange,\n filterOptions,\n loading,\n errorLabel,\n });\n const { all, filtered, visible, query, active, optionId, activeOptionId } = searchOptions;\n const choose = (option: SelectOption) => {\n if (option.disabled || loading || errorLabel || !available()) {\n return;\n }\n change(selected.includes(option.value) ? selected.filter(entry => {\n return entry !== option.value;\n }) : [\n ...selected,\n option.value,\n ]);\n search.current?.focus({ preventScroll: true });\n };\n return (<Primitive.Root\n open={open}\n onOpenChange={changeOpen}\n >\n <div\n className=\"gridui-u-select--flex gridui-u-select--min-w-0 gridui-u-select--items-stretch gridui-u-select--gap-gridui-4\"\n dir={restProps.dir}\n >\n <Primitive.Trigger\n asChild\n >\n <button\n {...restProps}\n type=\"button\"\n form={form}\n disabled={disabled}\n aria-readonly={readOnly}\n aria-required={required}\n ref={(element) => {\n control.current = element; if (typeof ref === \"function\") {\n return ref(element);\n } if (ref) {\n ref.current = element;\n }\n }}\n className={cn(controlVariants(), \"gridui-u-select--flex gridui-u-select--flex-1 gridui-u-select--items-center gridui-u-select--gap-gridui-8 gridui-u-select--text-start\", className)}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented && (event.key === \"ArrowDown\" || event.key === \"ArrowUp\")) {\n event.preventDefault(); changeOpen(true);\n }\n }}\n >\n <span\n className=\"gridui-u-select--min-w-0 gridui-u-select--flex-1 gridui-u-select--wrap-anywhere\"\n >\n {selected.length\n ? selected.map(entry => {\n return all.find(option => {\n return option.value === entry;\n })?.label ?? entry;\n }).join(\", \")\n : placeholder}\n </span>\n <ChevronDown\n size={16}\n aria-hidden=\"true\"\n />\n </button>\n </Primitive.Trigger>\n {clearLabel && (<button\n type=\"button\"\n aria-label={clearLabel}\n disabled={disabled || readOnly || required || !selected.length}\n className={cn(controlVariants(), \"gridui-u-select--flex gridui-u-select--w-auto gridui-u-select--shrink-0 gridui-u-select--items-center gridui-u-select--justify-center gridui-u-select--min-w-11 gridui-u-select--cursor-pointer\")}\n onClick={() => {\n change([]); control.current?.focus();\n }}\n >\n <X\n size={16}\n aria-hidden=\"true\"\n />\n </button>)}\n <ListFieldControl\n ref={native}\n name={name}\n form={form}\n required={required}\n disabled={disabled}\n value={selected}\n onValueChange={change}\n onInvalidFocus={() => {\n control.current?.focus();\n }}\n >\n {all.map(option => {\n return (<option\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n >\n {option.label}\n </option>);\n })}\n {selected.filter(entry => {\n return !all.some(option => {\n return option.value === entry;\n });\n }).map(entry => {\n return (<option\n key={entry}\n value={entry}\n >\n {entry}\n </option>);\n })}\n </ListFieldControl>\n </div>\n <SelectionPopup\n container={portalContainer}\n ref={popup}\n aria-label={searchLabel}\n dir={restProps.dir}\n finalFocus={finalFocus}\n initialFocus={() => {\n search.current?.focus({ preventScroll: true });\n }}\n onEscape={() => {\n close();\n focus();\n }}\n >\n <input\n ref={search}\n type=\"text\"\n role=\"combobox\"\n aria-label={searchLabel}\n aria-expanded=\"true\"\n aria-autocomplete=\"list\"\n aria-busy={loading || undefined}\n aria-controls={`${id}-list`}\n aria-activedescendant={activeOptionId}\n value={query ?? \"\"}\n className={cn(controlVariants({ size: \"small\" }), \"gridui-u-select--m-gridui-8 gridui-u-select--w-auto gridui-u-select--shrink-0\")}\n onChange={(event) => {\n searchOptions.changeQuery(event.target.value);\n }}\n onKeyDown={(event) => {\n if (isComposingKeyEvent(event.nativeEvent)) {\n event.stopPropagation(); return;\n }\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n searchOptions.moveActive(event.key === \"ArrowDown\" ? 1 : -1);\n }\n if (event.key === \"Enter\") {\n event.preventDefault();\n const option = searchOptions.activeOption;\n if (option) {\n choose(option);\n }\n }\n }}\n />\n <ComboboxOptions\n id={`${id}-list`}\n label={searchLabel}\n options={filtered}\n selected={selected}\n multiple\n active={active}\n optionId={optionId}\n onSelect={choose}\n onHighlight={searchOptions.highlight}\n />\n <div\n role=\"status\"\n aria-atomic=\"true\"\n className={cn(selectEmptyStyles(), \"gridui-u-select--empty:hidden\")}\n >\n {loading ? loadingLabel : errorLabel ?? (visible.length ? resultCountLabel?.(visible.length) : emptyLabel)}\n </div>\n </SelectionPopup>\n </Primitive.Root>);\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Select\n * @description Select Options\n */\n\nimport { selectIconStyles, selectListStyles, selectOptionContentStyles, selectOptionDescriptionStyles } from \"../shared/style\";\nimport type { SelectionListOptions, SelectOption } from \"../shared/types\";\nimport { overlayListIndicatorStyles, overlayListItemStyles, overlayListLabelStyles, useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport * as Primitive from \"@radix-ui/react-select\";\nimport { Check } from \"lucide-react\";\nimport { type FC, useId } from \"react\";\n\nexport type SelectOptionsProps = SelectionListOptions;\n\nexport const SelectOptions: FC<SelectOptionsProps> = (props: SelectOptionsProps) => {\n\n const { options, id, label } = props;\n const scrollbarRef = useScrollbars<HTMLDivElement>();\n const ref = useInteractionOutline<HTMLDivElement>({\n ref: scrollbarRef,\n selector: '[role=\"option\"]',\n });\n\n return (<Primitive.Viewport\n ref={ref}\n className={selectListStyles()}\n role=\"listbox\"\n id={id}\n aria-label={label}\n >\n {options.map((entry) => {\n\n if (!(\"options\" in entry)) {\n return (<SelectOptionItem\n key={entry.value}\n option={entry}\n />);\n }\n\n return (<Primitive.Group\n key={entry.label}\n >\n <Primitive.Label\n className={overlayListLabelStyles()}\n >\n {entry.label}\n </Primitive.Label>\n {entry.options.map(option => {\n return (<SelectOptionItem\n key={option.value}\n option={option}\n />);\n })}\n </Primitive.Group>);\n })}\n </Primitive.Viewport>);\n};\n\nexport type SelectOptionItemProps = {\n readonly option: SelectOption;\n};\n\nexport const SelectOptionItem: FC<SelectOptionItemProps> = (props: SelectOptionItemProps) => {\n const { option } = props;\n const labelId = useId();\n const descriptionId = `${labelId}-description`;\n return (<Primitive.Item\n value={`gridui:${option.value}`}\n aria-labelledby={labelId}\n aria-describedby={option.description ? descriptionId : undefined}\n textValue={option.label}\n disabled={option.disabled}\n className={overlayListItemStyles()}\n >\n {option.icon && (<span\n className={selectIconStyles()}\n aria-hidden=\"true\"\n >\n {option.icon}\n </span>)}\n <span\n className={selectOptionContentStyles()}\n >\n <Primitive.ItemText\n id={labelId}\n >\n {option.label}\n </Primitive.ItemText>\n {option.description && (<span\n id={descriptionId}\n className={selectOptionDescriptionStyles()}\n >\n {option.description}\n </span>)}\n </span>\n <span\n className={overlayListIndicatorStyles()}\n aria-hidden=\"true\"\n >\n <Primitive.ItemIndicator>\n <Check\n size={16}\n />\n </Primitive.ItemIndicator>\n </span>\n </Primitive.Item>);\n\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Select\n * @description Style\n */\n\nimport { overlayListStyles } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const selectContentStyles = cva(cn(\n overlayListStyles(),\n \"gridui-select-content gridui-u-select--box-border gridui-u-select--relative gridui-u-select--flex gridui-u-select--flex-col gridui-u-select--overflow-hidden gridui-u-select--min-w-0 gridui-u-select--w-(--anchor-width) gridui-u-select--max-w-(--available-width) gridui-u-select--max-h-(--available-height)\",\n));\n\nexport const selectScrollArrowStyles = cva(\"gridui-u-select--absolute gridui-u-select--inset-x-0 gridui-u-select--z-(--gridui-z-content) gridui-u-select--flex gridui-u-select--h-gridui-24 gridui-u-select--items-center gridui-u-select--justify-center gridui-u-select--bg-background gridui-u-select--text-foreground\", {\n variants: {\n direction: {\n up: \"gridui-u-select--top-0\",\n down: \"gridui-u-select--bottom-0\",\n },\n },\n});\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace Select\n * @description Select\n */\n\nimport { flattenOptions } from \"../shared/options\";\nimport { SelectionActions } from \"../shared/popup/selection-actions\";\nimport { useSelectionPopup } from \"../shared/popup/use-selection-popup\";\nimport { SelectionForm } from \"../shared/selection-form\";\nimport { selectIconStyles } from \"../shared/style\";\nimport type { SelectionProps } from \"../shared/types\";\nimport { useSelectionValue } from \"../shared/use-selection-value\";\nimport { SelectOptions } from \"./select-options\";\nimport { selectContentStyles, selectScrollArrowStyles } from \"./style\";\nimport { controlVariants } from \"@gridui/input\";\nimport { interactionLayerProps } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-select\";\nimport { ChevronDown, ChevronUp, X } from \"lucide-react\";\nimport { type ComponentPropsWithRef, type FC, useId, useRef, useState } from \"react\";\n\nexport type SelectProps = Omit<ComponentPropsWithRef<\"button\">,\n \"children\" | \"value\" | \"defaultValue\" | \"onChange\" | \"type\"> & SelectionProps & {\n readonly placeholder?: string;\n readonly position?: \"item-aligned\" | \"popper\";\n };\n\nexport const Select: FC<SelectProps> = (props: SelectProps) => {\n\n const {\n options, actions = [], value, defaultValue = \"\", onValueChange, placeholder,\n controlSize = \"standard\", position = \"popper\", clearLabel, required, disabled,\n name, form, dir, portalContainer,\n className, ref, ...restProps\n } = props;\n const controlRef = useRef<HTMLElement>(null);\n const {\n open,\n popupRef,\n available,\n changeOpen,\n close,\n focus,\n runAction,\n finalFocus,\n } = useSelectionPopup({\n disabled,\n controlRef,\n });\n const { selectedValue, change, reset } = useSelectionValue({\n value,\n defaultValue,\n onValueChange,\n }, available);\n const listId = useId();\n const [\n triggerWidth,\n setTriggerWidth,\n ] = useState<number>();\n const allOptions = flattenOptions(options);\n const selected = allOptions.find(option => {\n\n return option.value === selectedValue;\n });\n const fallback = selectedValue === \"\" ? placeholder ?? \"\" : selectedValue;\n const display = selected?.label ?? fallback;\n\n // SelectionForm owns form reset and submission, including canceled resets.\n return (<Primitive.Root\n form={`${listId}-detached`}\n value={selected ? `gridui:${selectedValue}` : \"\"}\n disabled={disabled}\n open={open}\n onOpenChange={(next) => {\n if (next) {\n setTriggerWidth(controlRef.current?.getBoundingClientRect().width);\n }\n changeOpen(next);\n }}\n onValueChange={(next) => {\n change(next.slice(7));\n }}\n dir={dir === \"rtl\" ? \"rtl\" : \"ltr\"}\n >\n <div\n className=\"gridui-u-select--relative gridui-u-select--flex gridui-u-select--min-w-0 gridui-u-select--w-full gridui-u-select--items-stretch gridui-u-select--gap-gridui-4\"\n dir={dir}\n >\n <Primitive.Trigger\n {...restProps}\n form={form}\n aria-controls={open ? listId : undefined}\n aria-required={required}\n ref={(element) => {\n\n controlRef.current = element;\n if (typeof ref === \"function\") {\n return ref(element);\n }\n if (ref) {\n ref.current = element;\n }\n }}\n className={cn(controlVariants({ size: controlSize }), \"gridui-u-select--flex gridui-u-select--flex-1 gridui-u-select--items-center gridui-u-select--gap-gridui-8 gridui-u-select--text-start\", className)}\n >\n {selected?.icon && (<span\n className={selectIconStyles()}\n aria-hidden=\"true\"\n >\n {selected.icon}\n </span>)}\n <span\n className=\"gridui-u-select--min-w-0 gridui-u-select--flex-1 gridui-u-select--whitespace-normal gridui-u-select--wrap-anywhere\"\n >\n <Primitive.Value\n placeholder={display}\n >\n {display}\n </Primitive.Value>\n </span>\n <Primitive.Icon>\n <ChevronDown\n size={16}\n className=\"gridui-u-select--shrink-0\"\n aria-hidden=\"true\"\n />\n </Primitive.Icon>\n </Primitive.Trigger>\n {clearLabel && (<button\n type=\"button\"\n disabled={disabled || required || selectedValue === \"\"}\n aria-label={clearLabel}\n onClick={() => {\n\n change(\"\");\n controlRef.current?.focus();\n }}\n className={cn(controlVariants({ size: controlSize }), \"gridui-u-select--flex gridui-u-select--w-auto gridui-u-select--shrink-0 gridui-u-select--items-center gridui-u-select--justify-center gridui-u-select--min-w-11 gridui-u-select--cursor-pointer\")}\n >\n <X\n size={16}\n aria-hidden=\"true\"\n />\n </button>)}\n <SelectionForm\n name={name}\n form={form}\n required={required}\n disabled={disabled}\n selectedValue={selectedValue}\n allOptions={allOptions}\n onValueChange={change}\n onReset={() => {\n reset();\n close();\n }}\n onInvalid={focus}\n />\n </div>\n <Primitive.Portal\n container={portalContainer}\n >\n <Primitive.Content\n {...interactionLayerProps}\n position={position}\n align=\"start\"\n sideOffset={8}\n collisionPadding={16}\n ref={popupRef}\n role=\"presentation\"\n {...(position === \"item-aligned\" ? {\n \"data-side\": \"none\",\n style: { width: triggerWidth },\n } : {})}\n className={selectContentStyles()}\n dir={dir}\n onCloseAutoFocus={(event) => {\n event.preventDefault();\n const target = finalFocus();\n if (target) {\n target.focus();\n }\n }}\n onPointerDownOutside={() => {\n close();\n }}\n onEscapeKeyDown={(event) => {\n event.preventDefault();\n event.stopPropagation(); changeOpen(false);\n }}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.stopPropagation();\n }\n if (event.key === \"Tab\") {\n event.preventDefault();\n const controls = Array.from(event.currentTarget.querySelectorAll<HTMLElement>(\"button:not(:disabled), a[href]\"));\n const active = controls.indexOf(event.target as HTMLElement);\n const next = controls[active + (event.shiftKey ? -1 : 1)];\n if (next) {\n next.focus();\n }\n else {\n popupRef.current?.querySelector<HTMLElement>('[role=\"option\"][data-state=\"checked\"]')?.focus();\n }\n }\n if ((event.target as HTMLElement).closest(\"button, a\") && event.key !== \"Tab\") {\n event.stopPropagation();\n }\n }}\n >\n <div\n className=\"gridui-u-select--relative gridui-u-select--flex gridui-u-select--min-h-0 gridui-u-select--flex-col\"\n >\n <Primitive.ScrollUpButton\n className={selectScrollArrowStyles({ direction: \"up\" })}\n >\n <ChevronUp\n size={16}\n aria-hidden=\"true\"\n />\n </Primitive.ScrollUpButton>\n <SelectOptions\n options={options}\n id={listId}\n label={restProps[\"aria-label\"]}\n />\n <Primitive.ScrollDownButton\n className={selectScrollArrowStyles({ direction: \"down\" })}\n >\n <ChevronDown\n size={16}\n aria-hidden=\"true\"\n />\n </Primitive.ScrollDownButton>\n </div>\n <SelectionActions\n actions={actions}\n onAction={runAction}\n />\n\n </Primitive.Content>\n </Primitive.Portal>\n </Primitive.Root>);\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace UseAsyncOptions\n * @description Request\n */\n\nexport type AsyncOptionsLoader<T> = (query: string, signal: AbortSignal) => Promise<readonly T[]>;\n\nexport type AsyncOptionsState<T> = {\n readonly query: string;\n readonly options: readonly T[];\n readonly loading: boolean;\n readonly error: unknown;\n};\n\nexport const createOptionsRequest = <T>(\n loadOptions: AsyncOptionsLoader<T>,\n onState: (state: AsyncOptionsState<T>) => void,\n) => {\n let controller: AbortController | undefined;\n const cancel = () => {\n controller?.abort();\n controller = undefined;\n };\n const run = async (query: string) => {\n cancel();\n const current = new AbortController();\n controller = current;\n onState({\n query,\n options: [],\n loading: true,\n error: null,\n });\n try {\n const options = await loadOptions(query, current.signal);\n if (controller === current && !current.signal.aborted) {\n onState({\n query,\n options,\n loading: false,\n error: null,\n });\n }\n } catch (error: unknown) {\n if (controller === current && !current.signal.aborted) {\n onState({\n query,\n options: [],\n loading: false,\n error,\n });\n }\n }\n };\n return {\n run,\n cancel,\n };\n};\n", "/**\n * @author WMXPY\n * @package Select\n * @namespace UseAsyncOptions\n * @description Use Async Options\n */\n\nimport { type AsyncOptionsLoader, type AsyncOptionsState, createOptionsRequest } from \"./request\";\nimport { useEffect, useState } from \"react\";\n\nexport type UseAsyncOptionsOptions<T> = {\n readonly query: string;\n readonly loadOptions: AsyncOptionsLoader<T>;\n readonly debounceMs?: number;\n readonly enabled?: boolean;\n};\n\ntype OwnedOptionsState<T> = {\n readonly loader: AsyncOptionsLoader<T>;\n readonly result: AsyncOptionsState<T>;\n};\n\nexport const useAsyncOptions = <T>({ query, loadOptions, debounceMs = 150, enabled = true }: UseAsyncOptionsOptions<T>): AsyncOptionsState<T> => {\n if (!Number.isFinite(debounceMs) || debounceMs < 0) {\n throw new RangeError(\"Option search debounce must be finite and nonnegative.\");\n }\n const [\n state,\n setState,\n ] = useState<OwnedOptionsState<T>>({\n loader: loadOptions,\n result: {\n query,\n options: [],\n loading: enabled,\n error: null,\n },\n });\n useEffect(() => {\n const publish = (result: AsyncOptionsState<T>) => {\n setState({\n loader: loadOptions,\n result,\n });\n };\n const request = createOptionsRequest(loadOptions, publish);\n publish({\n query,\n options: [],\n loading: enabled,\n error: null,\n });\n if (!enabled) {\n return request.cancel;\n }\n const timer = setTimeout(() => {\n void request.run(query);\n }, debounceMs);\n return () => {\n clearTimeout(timer);\n request.cancel();\n };\n }, [\n query,\n loadOptions,\n debounceMs,\n enabled,\n ]);\n return state.loader === loadOptions && state.result.query === query && enabled ? state.result : {\n query,\n options: [],\n loading: enabled,\n error: null,\n };\n};\n"],
5
+ "mappings": ";AAOA,SAAS,uBAAuB,yBAAyB;AACzD,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,mBAAmB,IAAI,8HAA8H;AAE3J,IAAM,4BAA4B,IAAI,oHAAoH;AAE1J,IAAM,gCAAgC,IAAI,+GAA+G;AAEzJ,IAAM,mBAAmB,IAAI,2DAA2D;AAExF,IAAM,oBAAoB,IAAI,uFAAuF;AAErH,IAAM,sBAAsB,IAAI,oFAAoF;AAEpH,IAAM,qBAAqB,IAAI;AAAA,EAClC,sBAAsB;AAAA,EACtB;AACJ,CAAC;AAEM,IAAM,wBAAwB,IAAI;AAAA,EACrC,kBAAkB;AAAA,EAClB;AACJ,CAAC;;;ACRgC,mBACI,KADJ;AAP1B,IAAM,mBAA8C,CAAC,UAAiC;AACzF,QAAM,EAAE,SAAS,SAAS,IAAI;AAC9B,SAAQ,gCACH,kBAAQ,SAAS,KAAM;AAAA,IAAC;AAAA;AAAA,MACrB,WAAW,oBAAoB;AAAA,MAE9B,kBAAQ,IAAI,CAAC,WAAW;AACrB,cAAM,UAAW,iCACZ;AAAA,iBAAO,QAAS;AAAA,YAAC;AAAA;AAAA,cACd,WAAW,iBAAiB;AAAA,cAC5B,eAAY;AAAA,cAEX,iBAAO;AAAA;AAAA,UACZ;AAAA,UACC,OAAO;AAAA,WACZ;AACA,cAAM,cAAc,mBAAmB;AACvC,YAAI,OAAO,SAAS,QAAW;AAC3B,iBAAQ;AAAA,YAAC;AAAA;AAAA,cAEL,MAAM,OAAO,WAAW,SAAY,OAAO;AAAA,cAC3C,QAAQ,OAAO;AAAA,cACf,KAAK,OAAO;AAAA,cACZ,iBAAe,OAAO,YAAY;AAAA,cAClC,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AAAA,EACJ,IAAIA,UAA+B;AAAA,IAC/B,QAAQ;AAAA,IACR,QAAQ;AAAA,MACJ;AAAA,MACA,SAAS,CAAC;AAAA,MACV,SAAS;AAAA,MACT,OAAO;AAAA,IACX;AAAA,EACJ,CAAC;AACD,EAAAD,WAAU,MAAM;AACZ,UAAM,UAAU,CAAC,WAAiC;AAC9C,eAAS;AAAA,QACL,QAAQ;AAAA,QACR;AAAA,MACJ,CAAC;AAAA,IACL;AACA,UAAM,UAAU,qBAAqB,aAAa,OAAO;AACzD,YAAQ;AAAA,MACJ;AAAA,MACA,SAAS,CAAC;AAAA,MACV,SAAS;AAAA,MACT,OAAO;AAAA,IACX,CAAC;AACD,QAAI,CAAC,SAAS;AACV,aAAO,QAAQ;AAAA,IACnB;AACA,UAAM,QAAQ,WAAW,MAAM;AAC3B,WAAK,QAAQ,IAAI,KAAK;AAAA,IAC1B,GAAG,UAAU;AACb,WAAO,MAAM;AACT,mBAAa,KAAK;AAClB,cAAQ,OAAO;AAAA,IACnB;AAAA,EACJ,GAAG;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAC;AACD,SAAO,MAAM,WAAW,eAAe,MAAM,OAAO,UAAU,SAAS,UAAU,MAAM,SAAS;AAAA,IAC5F;AAAA,IACA,SAAS,CAAC;AAAA,IACV,SAAS;AAAA,IACT,OAAO;AAAA,EACX;AACJ;",
6
+ "names": ["jsx", "overlayListItemStyles", "jsx", "jsxs", "useEffect", "useRef", "useState", "useRef", "flushSync", "jsx", "jsxs", "useRef", "useState", "cva", "isComposingKeyEvent", "cn", "Primitive", "useRef", "jsx", "jsxs", "filterOptions", "controlVariants", "isComposingKeyEvent", "cn", "Primitive", "ChevronDown", "X", "useId", "useRef", "jsx", "jsxs", "filterOptions", "overlayListIndicatorStyles", "overlayListItemStyles", "overlayListLabelStyles", "useInteractionOutline", "useScrollbars", "Primitive", "Check", "useId", "jsx", "jsxs", "overlayListStyles", "cn", "cva", "controlVariants", "interactionLayerProps", "cn", "Primitive", "ChevronDown", "X", "useId", "useRef", "useState", "jsx", "jsxs", "useEffect", "useState"]
7
7
  }
@@ -4,16 +4,10 @@
4
4
  * @namespace MultiSelect
5
5
  * @description Multi Select
6
6
  */
7
- import type { SelectGroup, SelectionSearchProps, SelectOption } from "../shared/types";
7
+ import type { SelectionControlOptions, SelectionSearchLabels, SelectionSearchProps } from "../shared/types";
8
8
  import { type ListFieldProps } from "@gridui/form";
9
9
  import { type ComponentPropsWithRef, type FC } from "react";
10
- export type MultiSelectProps = Omit<ComponentPropsWithRef<"button">, "children" | "value" | "defaultValue" | "onChange" | "type"> & ListFieldProps & SelectionSearchProps & {
11
- readonly options: readonly (SelectOption | SelectGroup)[];
10
+ export type MultiSelectProps = Omit<ComponentPropsWithRef<"button">, "children" | "value" | "defaultValue" | "onChange" | "type"> & ListFieldProps & SelectionControlOptions & SelectionSearchProps & SelectionSearchLabels & {
12
11
  readonly placeholder: string;
13
- readonly searchLabel: string;
14
- readonly emptyLabel: string;
15
- readonly clearLabel?: string;
16
- readonly required?: boolean;
17
- readonly portalContainer?: HTMLElement | null;
18
12
  };
19
13
  export declare const MultiSelect: FC<MultiSelectProps>;
@@ -4,13 +4,9 @@
4
4
  * @namespace Select
5
5
  * @description Select Options
6
6
  */
7
- import type { SelectGroup, SelectOption } from "../shared/types";
7
+ import type { SelectionListOptions, SelectOption } from "../shared/types";
8
8
  import { type FC } from "react";
9
- export type SelectOptionsProps = {
10
- readonly options: readonly (SelectOption | SelectGroup)[];
11
- readonly id: string;
12
- readonly label?: string | undefined;
13
- };
9
+ export type SelectOptionsProps = SelectionListOptions;
14
10
  export declare const SelectOptions: FC<SelectOptionsProps>;
15
11
  export type SelectOptionItemProps = {
16
12
  readonly option: SelectOption;
@@ -5,8 +5,6 @@
5
5
  * @description Style
6
6
  */
7
7
  export declare const selectContentStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
8
- export declare const selectMenuItemStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
9
- export declare const selectIndicatorStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
10
8
  export declare const selectScrollArrowStyles: (props?: ({
11
9
  direction?: "up" | "down" | null | undefined;
12
10
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @author WMXPY
3
3
  * @package Select
4
- * @namespace Shared
4
+ * @namespace Shared_Popup
5
5
  * @description Selection Actions
6
6
  */
7
- import type { SelectAction } from "./types";
7
+ import type { SelectAction } from "../types";
8
8
  import type { FC } from "react";
9
9
  export type SelectionActionsProps = {
10
10
  readonly actions: readonly SelectAction[];
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @author WMXPY
3
3
  * @package Select
4
- * @namespace Shared
4
+ * @namespace Shared_Popup
5
5
  * @description Selection Popup
6
6
  */
7
7
  import * as Primitive from "@radix-ui/react-popover";
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @author WMXPY
3
3
  * @package Select
4
- * @namespace Shared
4
+ * @namespace Shared_Popup
5
5
  * @description Use Selection Popup
6
6
  */
7
- import type { SelectAction } from "./types";
7
+ import type { SelectAction } from "../types";
8
8
  import { type RefObject } from "react";
9
9
  type SelectionPopupOptions = {
10
10
  readonly disabled?: boolean | undefined;
@@ -1,15 +1,13 @@
1
1
  /**
2
2
  * @author WMXPY
3
3
  * @package Select
4
- * @namespace Shared
4
+ * @namespace Shared_Search
5
5
  * @description Combobox Options
6
6
  */
7
- import type { SelectGroup, SelectOption } from "./types";
7
+ import type { SelectionListOptions, SelectOption } from "../types";
8
8
  import type { FC } from "react";
9
- export type ComboboxOptionsProps = {
10
- readonly id: string;
9
+ export type ComboboxOptionsProps = SelectionListOptions & {
11
10
  readonly label: string;
12
- readonly options: readonly (SelectOption | SelectGroup)[];
13
11
  readonly selected: string | readonly string[];
14
12
  readonly multiple?: boolean;
15
13
  readonly active: string | null;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @author WMXPY
3
3
  * @package Select
4
- * @namespace Shared
4
+ * @namespace Shared_Search
5
5
  * @description Scroll Option
6
6
  */
7
7
  /** Keep active options visible without moving the page beneath a portal. */
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @author WMXPY
3
3
  * @package Select
4
- * @namespace Shared
4
+ * @namespace Shared_Search
5
5
  * @description Use Search Options
6
6
  */
7
- import type { SelectGroup, SelectionSearchProps, SelectOption } from "./types";
7
+ import type { SelectGroup, SelectionSearchProps, SelectOption } from "../types";
8
8
  export declare const useSearchOptions: (options: readonly (SelectOption | SelectGroup)[], selected: readonly string[], listId: string, open: boolean, searchProps?: SelectionSearchProps) => {
9
9
  all: SelectOption[];
10
10
  filtered: readonly (SelectOption | SelectGroup)[];
@@ -4,7 +4,6 @@
4
4
  * @namespace Shared
5
5
  * @description Style
6
6
  */
7
- export declare const selectItemStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
8
7
  export declare const selectIconStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
9
8
  export declare const selectOptionContentStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
10
9
  export declare const selectOptionDescriptionStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;