@gridui/select 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ {
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/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"],
4
+ "sourcesContent": ["/**\n * @author WMXPY\n * @package Select\n * @namespace Shared\n * @description Style\n */\n\nimport { dropdownContentStyles, dropdownItemStyles } from \"@gridui/dropdown-menu\";\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const selectItemStyles = cva(cn(dropdownItemStyles(), \"min-w-0\"));\n\nexport const selectIconStyles = cva(\"inline-flex shrink-0 items-center [&_svg]:size-gridui-16\");\n\nexport const selectOptionContentStyles = cva(\"min-w-0 flex-1 whitespace-normal wrap-anywhere\");\n\nexport const selectOptionDescriptionStyles = cva(\"block text-muted type-caption mt-gridui-4\");\n\nexport const selectListStyles = cva(\"min-h-0 overflow-y-auto\");\n\nexport const selectEmptyStyles = cva(\"p-gridui-8 text-muted type-caption\");\n\nexport const selectActionsStyles = cva(\"shrink-0 border-t border-border pt-gridui-4\");\n\nexport const selectActionStyles = cva(cn(\n selectItemStyles(),\n \"w-full text-start whitespace-normal wrap-anywhere hover:bg-surface focus-visible:bg-surface\",\n));\n\nexport const comboboxContentStyles = cva(cn(\n dropdownContentStyles(),\n \"gridui-combobox-content box-border flex flex-col overflow-hidden min-w-0 w-(--anchor-width) max-h-(--available-height) 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 { 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 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 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 { type FC, useEffect, 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 useEffect(() => {\n\n const owner = nativeRef.current?.form;\n let mounted = true;\n const reset = (event: Event): void => {\n\n setTimeout(() => {\n\n if (mounted && !event.defaultPrevented) {\n flushSync(() => {\n resetSelection.current();\n });\n if (nativeRef.current) {\n nativeRef.current.value = currentValue.current;\n }\n }\n }, 0);\n };\n owner?.addEventListener(\"reset\", reset);\n\n return () => {\n\n mounted = false;\n owner?.removeEventListener(\"reset\", reset);\n };\n }, [form]);\n\n return (<select\n ref={nativeRef}\n aria-hidden=\"true\"\n tabIndex={-1}\n className=\"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 event.preventDefault();\n 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 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, SelectOption } from \"./types\";\nimport { useEffect, 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) => {\n const [\n search,\n setSearch,\n ] = useState(INITIAL_SEARCH);\n const query = open ? search.query : null;\n const all = flattenOptions(options);\n const filtered = filterOptions(options, query ?? \"\");\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 optionId = (value: string): string => {\n return `${listId}-${all.findIndex(option => {\n return option.value === value;\n })}`;\n };\n const activeOptionId = active ? optionId(active.value) : undefined;\n useEffect(() => {\n if (!open) {\n setSearch(INITIAL_SEARCH);\n }\n }, [open]);\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 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(\"pr-11 text-ellipsis\");\n\nexport const comboboxTriggerStyles = cva(\"absolute inset-y-0 right-0 flex w-9 items-center justify-center rounded-control text-foreground cursor-pointer disabled:cursor-not-allowed 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 { comboboxContentStyles, selectEmptyStyles } from \"../shared/style\";\nimport type { SelectionProps, 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 { 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 & {\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, ...restProps } = props;\n const controlRef = useRef<HTMLElement>(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 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 || !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=\"relative flex min-w-0 w-full items-stretch gap-gridui-4\"\n dir={dir}\n >\n <Primitive.Anchor\n asChild\n >\n <div\n className=\"relative flex min-w-0 flex-1 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-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 (event.nativeEvent.isComposing) {\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 }), \"flex w-auto shrink-0 items-center justify-center min-w-11 cursor-pointer hover:enabled:bg-surface\")}\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 ref={popupRef}\n role=\"presentation\"\n sideOffset={8}\n align=\"start\"\n collisionPadding={16}\n className={comboboxContentStyles()}\n dir={dir}\n onOpenAutoFocus={(event) => {\n event.preventDefault();\n }}\n onCloseAutoFocus={(event) => {\n event.preventDefault(); const target = finalFocus(); if (target) {\n target.focus();\n }\n }}\n onInteractOutside={(event) => {\n if (controlRef.current?.parentElement?.contains(event.target as Node)) {\n event.preventDefault();\n }\n else {\n close();\n }\n }}\n onEscapeKeyDown={(event) => {\n event.preventDefault();\n event.stopPropagation();\n if (!event.isComposing) {\n close(); focus();\n }\n }}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.stopPropagation();\n }\n }}\n >\n {visible.length === 0 && (<div\n role=\"status\"\n className={selectEmptyStyles()}\n >\n {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 </Primitive.Content>\n </Primitive.Portal>\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 { comboboxContentStyles, selectEmptyStyles } from \"../shared/style\";\nimport type { SelectGroup, SelectOption } from \"../shared/types\";\nimport { useSearchOptions } from \"../shared/use-search-options\";\nimport { useSelectionPopup } from \"../shared/use-selection-popup\";\nimport { type ListFieldProps, useListField } from \"@gridui/form\";\nimport { controlVariants } from \"@gridui/input\";\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 & {\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, ...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 const { all, filtered, visible, query, active, optionId, activeOptionId } = searchOptions;\n const choose = (option: SelectOption) => {\n if (option.disabled || !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=\"flex min-w-0 items-stretch 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(), \"flex flex-1 items-center gap-gridui-8 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=\"min-w-0 flex-1 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(), \"flex w-auto shrink-0 items-center justify-center min-w-11 cursor-pointer hover:enabled:bg-surface\")}\n onClick={() => {\n change([]); control.current?.focus();\n }}\n >\n <X\n size={16}\n aria-hidden=\"true\"\n />\n </button>)}\n <select\n ref={native}\n multiple\n className=\"sr-only\"\n aria-hidden=\"true\"\n tabIndex={-1}\n name={name}\n form={form}\n required={required}\n disabled={disabled}\n value={selected}\n onChange={(event) => {\n change(Array.from(event.currentTarget.selectedOptions, option => {\n return option.value;\n }));\n }}\n onInvalid={(event) => {\n event.preventDefault(); 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 </select>\n </div>\n <Primitive.Portal\n container={portalContainer}\n >\n <Primitive.Content\n ref={popup}\n aria-label={searchLabel}\n sideOffset={8}\n align=\"start\"\n collisionPadding={16}\n dir={restProps.dir}\n className={comboboxContentStyles()}\n onOpenAutoFocus={(event) => {\n event.preventDefault(); search.current?.focus({ preventScroll: true });\n }}\n onCloseAutoFocus={(event) => {\n event.preventDefault();\n const target = finalFocus();\n if (target) {\n target.focus();\n }\n }}\n onEscapeKeyDown={(event) => {\n event.preventDefault(); event.stopPropagation();\n if (!event.isComposing) {\n close();\n focus();\n }\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-controls={`${id}-list`}\n aria-activedescendant={activeOptionId}\n value={query ?? \"\"}\n className={cn(controlVariants({ size: \"small\" }), \"mb-gridui-4 shrink-0\")}\n onChange={(event) => {\n searchOptions.changeQuery(event.target.value);\n }}\n onKeyDown={(event) => {\n if (event.nativeEvent.isComposing) {\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 {!visible.length && (<div\n role=\"status\"\n className={selectEmptyStyles()}\n >\n {emptyLabel}\n </div>)}\n </Primitive.Content>\n </Primitive.Portal>\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 { dropdownContentStyles } from \"@gridui/dropdown-menu\";\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const selectContentStyles = cva(cn(\n dropdownContentStyles(),\n \"gridui-select-content box-border relative flex flex-col overflow-hidden min-w-0 w-(--anchor-width) max-w-(--available-width) max-h-(--available-height)\",\n));\n\nexport const selectMenuItemStyles = cva(cn(selectItemStyles(), \"relative px-gridui-4 pr-9\"));\n\nexport const selectIndicatorStyles = cva(\"absolute inset-y-0 right-gridui-4 flex w-gridui-16 items-center justify-center text-foreground\");\n\nexport const selectScrollArrowStyles = cva(\"absolute inset-x-0 z-(--gridui-z-content) flex h-gridui-24 items-center justify-center bg-background text-foreground\", {\n variants: {\n direction: {\n up: \"top-0\",\n down: \"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 * 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\n return (<Primitive.Viewport\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 { 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=\"relative flex min-w-0 w-full items-stretch 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 }), \"flex flex-1 items-center gap-gridui-8 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=\"min-w-0 flex-1 whitespace-normal 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=\"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 }), \"flex w-auto shrink-0 items-center justify-center min-w-11 cursor-pointer hover:enabled:bg-surface\")}\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 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=\"relative flex min-h-0 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"],
5
+ "mappings": ";AAOA,SAAS,uBAAuB,0BAA0B;AAC1D,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,mBAAmB,IAAI,GAAG,mBAAmB,GAAG,SAAS,CAAC;AAEhE,IAAM,mBAAmB,IAAI,0DAA0D;AAEvF,IAAM,4BAA4B,IAAI,gDAAgD;AAEtF,IAAM,gCAAgC,IAAI,2CAA2C;AAErF,IAAM,mBAAmB,IAAI,yBAAyB;AAEtD,IAAM,oBAAoB,IAAI,oCAAoC;AAElE,IAAM,sBAAsB,IAAI,6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AAU;AAAA;AAAA,kBACd;AAAA;AAAA;AAAA,YAEJ;AAAA;AAAA,QACJ;AAAA;AAAA;AAAA,EACJ;AACJ;",
6
+ "names": ["jsx", "jsxs", "jsx", "jsxs", "useEffect", "useEffect", "useRef", "useState", "flushSync", "useRef", "useState", "cva", "cn", "useRef", "jsx", "jsxs", "controlVariants", "cn", "Primitive", "ChevronDown", "X", "useId", "useRef", "jsx", "jsxs", "dropdownContentStyles", "cn", "cva", "dropdownLabelStyles", "Primitive", "Check", "useId", "jsx", "jsxs", "controlVariants", "cn", "Primitive", "ChevronDown", "X", "useId", "useRef", "useState", "jsx", "jsxs"]
7
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Select
4
+ * @namespace MultiSelect
5
+ * @description Multi Select
6
+ */
7
+ import type { SelectGroup, SelectOption } from "../shared/types";
8
+ import { type ListFieldProps } from "@gridui/form";
9
+ import { type ComponentPropsWithRef, type FC } from "react";
10
+ export type MultiSelectProps = Omit<ComponentPropsWithRef<"button">, "children" | "value" | "defaultValue" | "onChange" | "type"> & ListFieldProps & {
11
+ readonly options: readonly (SelectOption | SelectGroup)[];
12
+ 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
+ };
19
+ export declare const MultiSelect: FC<MultiSelectProps>;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Select
4
+ * @namespace Select
5
+ * @description Select Options
6
+ */
7
+ import type { SelectGroup, SelectOption } from "../shared/types";
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
+ };
14
+ export declare const SelectOptions: FC<SelectOptionsProps>;
15
+ export type SelectOptionItemProps = {
16
+ readonly option: SelectOption;
17
+ };
18
+ export declare const SelectOptionItem: FC<SelectOptionItemProps>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Select
4
+ * @namespace Select
5
+ * @description Select
6
+ */
7
+ import type { SelectionProps } from "../shared/types";
8
+ import { type ComponentPropsWithRef, type FC } from "react";
9
+ export type SelectProps = Omit<ComponentPropsWithRef<"button">, "children" | "value" | "defaultValue" | "onChange" | "type"> & SelectionProps & {
10
+ readonly placeholder?: string;
11
+ readonly position?: "item-aligned" | "popper";
12
+ };
13
+ export declare const Select: FC<SelectProps>;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Select
4
+ * @namespace Select
5
+ * @description Style
6
+ */
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
+ export declare const selectScrollArrowStyles: (props?: ({
11
+ direction?: "up" | "down" | null | undefined;
12
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Select
4
+ * @namespace Shared
5
+ * @description Combobox Options
6
+ */
7
+ import type { SelectGroup, SelectOption } from "./types";
8
+ import type { FC } from "react";
9
+ export type ComboboxOptionsProps = {
10
+ readonly id: string;
11
+ readonly label: string;
12
+ readonly options: readonly (SelectOption | SelectGroup)[];
13
+ readonly selected: string | readonly string[];
14
+ readonly multiple?: boolean;
15
+ readonly active: string | null;
16
+ readonly optionId: (value: string) => string;
17
+ readonly onSelect: (option: SelectOption) => void;
18
+ readonly onHighlight: (value: string) => void;
19
+ };
20
+ export declare const ComboboxOptions: FC<ComboboxOptionsProps>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Select
4
+ * @namespace Shared
5
+ * @description Options
6
+ */
7
+ import type { SelectGroup, SelectOption } from "./types";
8
+ export declare const flattenOptions: (options: readonly (SelectOption | SelectGroup)[]) => SelectOption[];
9
+ export declare const filterOptions: (options: readonly (SelectOption | SelectGroup)[], query: string) => readonly (SelectOption | SelectGroup)[];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Select
4
+ * @namespace Shared
5
+ * @description Scroll Option
6
+ */
7
+ /** Keep active options visible without moving the page beneath a portal. */
8
+ export declare const scrollOption: (id: string) => void;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Select
4
+ * @namespace Shared
5
+ * @description Selection Actions
6
+ */
7
+ import type { SelectAction } from "./types";
8
+ import type { FC } from "react";
9
+ export type SelectionActionsProps = {
10
+ readonly actions: readonly SelectAction[];
11
+ readonly onAction: (action: SelectAction) => boolean;
12
+ };
13
+ export declare const SelectionActions: FC<SelectionActionsProps>;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Select
4
+ * @namespace Shared
5
+ * @description Selection Form
6
+ */
7
+ import type { SelectionProps, SelectOption } from "./types";
8
+ import { type FC } from "react";
9
+ export type SelectionFormProps = {
10
+ readonly [Key in "name" | "form" | "required" | "disabled"]: SelectionProps[Key];
11
+ } & {
12
+ readonly selectedValue: string;
13
+ readonly allOptions: readonly SelectOption[];
14
+ readonly onValueChange: (value: string) => void;
15
+ readonly onReset: () => void;
16
+ readonly onInvalid: () => void;
17
+ };
18
+ export declare const SelectionForm: FC<SelectionFormProps>;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Select
4
+ * @namespace Shared
5
+ * @description Style
6
+ */
7
+ export declare const selectItemStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
8
+ export declare const selectIconStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
9
+ export declare const selectOptionContentStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
10
+ export declare const selectOptionDescriptionStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
11
+ export declare const selectListStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
12
+ export declare const selectEmptyStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
13
+ export declare const selectActionsStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
14
+ export declare const selectActionStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
15
+ export declare const comboboxContentStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Select
4
+ * @namespace Shared
5
+ * @description Types
6
+ */
7
+ import type { ReactNode } from "react";
8
+ export type SelectOption = {
9
+ readonly value: string;
10
+ readonly label: string;
11
+ readonly description?: string;
12
+ readonly icon?: ReactNode;
13
+ readonly disabled?: boolean;
14
+ };
15
+ export type SelectGroup = {
16
+ readonly label: string;
17
+ readonly options: readonly SelectOption[];
18
+ };
19
+ export type SelectAction = {
20
+ readonly id: string;
21
+ readonly label: string;
22
+ readonly icon?: ReactNode;
23
+ readonly disabled?: boolean;
24
+ readonly closeOnAction?: boolean;
25
+ } & ({
26
+ readonly href: string;
27
+ readonly target?: string;
28
+ readonly rel?: string;
29
+ readonly onAction?: never;
30
+ } | {
31
+ readonly onAction: () => void;
32
+ readonly href?: never;
33
+ });
34
+ export interface SelectionValueProps {
35
+ readonly value?: string;
36
+ readonly defaultValue?: string;
37
+ readonly onValueChange?: (value: string) => void;
38
+ }
39
+ export interface SelectionProps extends SelectionValueProps {
40
+ readonly options: readonly (SelectOption | SelectGroup)[];
41
+ readonly actions?: readonly SelectAction[];
42
+ readonly controlSize?: "standard" | "small";
43
+ readonly clearLabel?: string;
44
+ readonly portalContainer?: HTMLElement | null;
45
+ readonly name?: string;
46
+ readonly form?: string;
47
+ readonly required?: boolean;
48
+ readonly disabled?: boolean;
49
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Select
4
+ * @namespace Shared
5
+ * @description Use Search Options
6
+ */
7
+ import type { SelectGroup, SelectOption } from "./types";
8
+ export declare const useSearchOptions: (options: readonly (SelectOption | SelectGroup)[], selected: readonly string[], listId: string, open: boolean) => {
9
+ all: SelectOption[];
10
+ filtered: readonly (SelectOption | SelectGroup)[];
11
+ visible: SelectOption[];
12
+ query: string | null;
13
+ active: string | null;
14
+ activeOption: SelectOption | undefined;
15
+ activeOptionId: string | undefined;
16
+ optionId: (value: string) => string;
17
+ highlight: (value: string) => void;
18
+ changeQuery: (text: string) => void;
19
+ moveActive: (direction: number) => void;
20
+ };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Select
4
+ * @namespace Shared
5
+ * @description Use Selection Popup
6
+ */
7
+ import type { SelectAction } from "./types";
8
+ import { type RefObject } from "react";
9
+ type SelectionPopupOptions = {
10
+ readonly disabled?: boolean | undefined;
11
+ readonly readOnly?: boolean | undefined;
12
+ readonly controlRef: RefObject<HTMLElement | null>;
13
+ };
14
+ export declare const useSelectionPopup: ({ disabled, readOnly, controlRef }: SelectionPopupOptions) => {
15
+ open: boolean;
16
+ popupRef: RefObject<HTMLDivElement | null>;
17
+ available: () => boolean;
18
+ changeOpen: (next: boolean) => void;
19
+ close: () => void;
20
+ focus: () => void;
21
+ finalFocus: () => HTMLElement | false;
22
+ runAction: (action: SelectAction) => boolean;
23
+ };
24
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Select
4
+ * @namespace Shared
5
+ * @description Use Selection Value
6
+ */
7
+ import type { SelectionValueProps } from "./types";
8
+ type SelectionValueOptions = {
9
+ readonly [Key in "value" | "defaultValue" | "onValueChange"]: SelectionValueProps[Key];
10
+ };
11
+ export declare const useSelectionValue: (props: SelectionValueOptions, available: () => boolean) => {
12
+ selectedValue: string;
13
+ change: (next: string | null) => void;
14
+ reset: () => void;
15
+ };
16
+ export {};