@proyecto-viviana/solidaria-components 0.4.0 → 0.5.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.
- package/dist/ActionBar.d.ts.map +1 -1
- package/dist/ActionBar.js +2 -11
- package/dist/ActionBar.js.map +1 -1
- package/dist/ActionBar.jsx +2 -11
- package/dist/ActionBar.jsx.map +1 -1
- package/dist/ActionGroup.d.ts.map +1 -1
- package/dist/ActionGroup.js +1 -1
- package/dist/ActionGroup.js.map +1 -1
- package/dist/ActionGroup.jsx +1 -1
- package/dist/ActionGroup.jsx.map +1 -1
- package/dist/Autocomplete.d.ts +2 -2
- package/dist/Autocomplete.d.ts.map +1 -1
- package/dist/Autocomplete.js +7 -7
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Autocomplete.jsx +7 -7
- package/dist/Autocomplete.jsx.map +1 -1
- package/dist/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs.js +18 -18
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/Breadcrumbs.jsx +21 -26
- package/dist/Breadcrumbs.jsx.map +1 -1
- package/dist/Calendar.d.ts.map +1 -1
- package/dist/Calendar.js +100 -65
- package/dist/Calendar.js.map +1 -1
- package/dist/Calendar.jsx +10 -1
- package/dist/Calendar.jsx.map +1 -1
- package/dist/Color.d.ts.map +1 -1
- package/dist/Color.js +15 -18
- package/dist/Color.js.map +1 -1
- package/dist/Color.jsx +15 -19
- package/dist/Color.jsx.map +1 -1
- package/dist/ComboBox.d.ts +4 -0
- package/dist/ComboBox.d.ts.map +1 -1
- package/dist/ComboBox.js +21 -13
- package/dist/ComboBox.js.map +1 -1
- package/dist/ComboBox.jsx +23 -13
- package/dist/ComboBox.jsx.map +1 -1
- package/dist/DateField.d.ts +11 -2
- package/dist/DateField.d.ts.map +1 -1
- package/dist/DateField2.js +237 -234
- package/dist/DateField2.js.map +1 -1
- package/dist/DateField2.jsx +134 -97
- package/dist/DateField2.jsx.map +1 -1
- package/dist/DatePicker.d.ts +42 -3
- package/dist/DatePicker.d.ts.map +1 -1
- package/dist/DatePicker.js +6 -990
- package/dist/DatePicker.jsx +6 -681
- package/dist/DatePicker2.js +1171 -0
- package/dist/DatePicker2.js.map +1 -0
- package/dist/DatePicker2.jsx +820 -0
- package/dist/DatePicker2.jsx.map +1 -0
- package/dist/DateRangePickerContext.d.ts +2 -0
- package/dist/DateRangePickerContext.d.ts.map +1 -1
- package/dist/Disclosure.d.ts.map +1 -1
- package/dist/Disclosure.js +3 -0
- package/dist/Disclosure.js.map +1 -1
- package/dist/Disclosure.jsx +1 -1
- package/dist/Disclosure.jsx.map +1 -1
- package/dist/ElementTag.d.ts +29 -0
- package/dist/ElementTag.d.ts.map +1 -0
- package/dist/ElementTag.js +220 -0
- package/dist/ElementTag.js.map +1 -0
- package/dist/ElementTag.jsx +67 -0
- package/dist/ElementTag.jsx.map +1 -0
- package/dist/GridList.d.ts.map +1 -1
- package/dist/GridList.js +2 -2
- package/dist/GridList.js.map +1 -1
- package/dist/GridList.jsx +2 -2
- package/dist/GridList.jsx.map +1 -1
- package/dist/Landmark.js +4 -3
- package/dist/Landmark.js.map +1 -1
- package/dist/Landmark.jsx +3 -3
- package/dist/Landmark.jsx.map +1 -1
- package/dist/Link.js +3 -2
- package/dist/Link.js.map +1 -1
- package/dist/Link.jsx +3 -3
- package/dist/Link.jsx.map +1 -1
- package/dist/ListBox.d.ts +2 -2
- package/dist/ListBox.d.ts.map +1 -1
- package/dist/ListBox.js +327 -166
- package/dist/ListBox.js.map +1 -1
- package/dist/ListBox.jsx +161 -25
- package/dist/ListBox.jsx.map +1 -1
- package/dist/Modal.d.ts.map +1 -1
- package/dist/Modal.js +7 -5
- package/dist/Modal.js.map +1 -1
- package/dist/Modal.jsx +5 -5
- package/dist/Modal.jsx.map +1 -1
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Popover.js +16 -9
- package/dist/Popover.js.map +1 -1
- package/dist/Popover.jsx +25 -4
- package/dist/Popover.jsx.map +1 -1
- package/dist/RangeCalendar.d.ts.map +1 -1
- package/dist/RangeCalendar.js +182 -46
- package/dist/RangeCalendar.js.map +1 -1
- package/dist/RangeCalendar.jsx +72 -2
- package/dist/RangeCalendar.jsx.map +1 -1
- package/dist/SearchField.d.ts.map +1 -1
- package/dist/SearchField.js +26 -2
- package/dist/SearchField.js.map +1 -1
- package/dist/SearchField.jsx +26 -2
- package/dist/SearchField.jsx.map +1 -1
- package/dist/Select.d.ts +7 -0
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +64 -51
- package/dist/Select.js.map +1 -1
- package/dist/Select.jsx +35 -20
- package/dist/Select.jsx.map +1 -1
- package/dist/Separator.js +3 -2
- package/dist/Separator.js.map +1 -1
- package/dist/Separator.jsx +2 -2
- package/dist/Separator.jsx.map +1 -1
- package/dist/SharedElementTransition.d.ts.map +1 -1
- package/dist/SharedElementTransition.js +35 -33
- package/dist/SharedElementTransition.js.map +1 -1
- package/dist/SharedElementTransition.jsx +35 -33
- package/dist/SharedElementTransition.jsx.map +1 -1
- package/dist/StepList.d.ts.map +1 -1
- package/dist/StepList.js +2 -9
- package/dist/StepList.js.map +1 -1
- package/dist/StepList.jsx +1 -6
- package/dist/StepList.jsx.map +1 -1
- package/dist/Table.d.ts +2 -0
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +10 -3
- package/dist/Table.js.map +1 -1
- package/dist/Table.jsx +10 -3
- package/dist/Table.jsx.map +1 -1
- package/dist/Tabs.d.ts.map +1 -1
- package/dist/Tabs.js +3 -0
- package/dist/Tabs.js.map +1 -1
- package/dist/Tabs.jsx +1 -1
- package/dist/Tabs.jsx.map +1 -1
- package/dist/TagGroup.d.ts +3 -1
- package/dist/TagGroup.d.ts.map +1 -1
- package/dist/TagGroup.js +12 -8
- package/dist/TagGroup.js.map +1 -1
- package/dist/TagGroup.jsx +11 -8
- package/dist/TagGroup.jsx.map +1 -1
- package/dist/Text.d.ts.map +1 -1
- package/dist/Text.js +9 -8
- package/dist/Text.js.map +1 -1
- package/dist/Text.jsx +3 -3
- package/dist/Text.jsx.map +1 -1
- package/dist/TextField.js +4 -1
- package/dist/TextField.js.map +1 -1
- package/dist/TextField.jsx +4 -1
- package/dist/TextField.jsx.map +1 -1
- package/dist/TimeField.d.ts +14 -50
- package/dist/TimeField.d.ts.map +1 -1
- package/dist/TimeField.js +111 -205
- package/dist/TimeField.js.map +1 -1
- package/dist/TimeField.jsx +76 -82
- package/dist/TimeField.jsx.map +1 -1
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Tree.js +3 -3
- package/dist/Tree.js.map +1 -1
- package/dist/Tree.jsx +3 -3
- package/dist/Tree.jsx.map +1 -1
- package/dist/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden.js +3 -11
- package/dist/VisuallyHidden.js.map +1 -1
- package/dist/VisuallyHidden.jsx +3 -4
- package/dist/VisuallyHidden.jsx.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.jsx +6 -6
- package/dist/useDragAndDrop.d.ts +0 -8
- package/dist/useDragAndDrop.d.ts.map +1 -1
- package/dist/useDragAndDrop2.js +6 -2
- package/dist/useDragAndDrop2.js.map +1 -1
- package/dist/useDragAndDrop2.jsx +6 -2
- package/dist/useDragAndDrop2.jsx.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +2 -2
- package/dist/utils.js.map +1 -1
- package/dist/utils.jsx +2 -2
- package/dist/utils.jsx.map +1 -1
- package/package.json +3 -9
- package/src/ActionBar.tsx +10 -12
- package/src/ActionGroup.tsx +5 -3
- package/src/Autocomplete.tsx +14 -9
- package/src/Breadcrumbs.tsx +57 -42
- package/src/Calendar.tsx +30 -1
- package/src/Color.tsx +42 -27
- package/src/ComboBox.tsx +49 -17
- package/src/DateField.tsx +285 -52
- package/src/DatePicker.tsx +345 -57
- package/src/DateRangePickerContext.tsx +2 -0
- package/src/Disclosure.tsx +4 -0
- package/src/ElementTag.tsx +116 -0
- package/src/GridList.tsx +8 -2
- package/src/Landmark.tsx +4 -4
- package/src/Link.tsx +4 -4
- package/src/ListBox.tsx +323 -21
- package/src/Modal.tsx +21 -5
- package/src/Popover.tsx +28 -7
- package/src/RangeCalendar.tsx +120 -1
- package/src/SearchField.tsx +53 -1
- package/src/Select.tsx +114 -22
- package/src/Separator.tsx +3 -3
- package/src/SharedElementTransition.tsx +92 -36
- package/src/StepList.tsx +0 -7
- package/src/Table.tsx +19 -4
- package/src/Tabs.tsx +1 -0
- package/src/TagGroup.tsx +26 -6
- package/src/Text.tsx +5 -4
- package/src/TextField.tsx +1 -1
- package/src/TimeField.tsx +113 -196
- package/src/Tree.tsx +14 -4
- package/src/VisuallyHidden.tsx +8 -12
- package/src/index.ts +3 -8
- package/src/useDragAndDrop.ts +8 -10
- package/src/utils.tsx +3 -3
- package/dist/DatePicker.js.map +0 -1
- package/dist/DatePicker.jsx.map +0 -1
- package/dist/HiddenTimeInput.d.ts +0 -25
- package/dist/HiddenTimeInput.d.ts.map +0 -1
- package/dist/HiddenTimeInput.js +0 -104
- package/dist/HiddenTimeInput.js.map +0 -1
- package/dist/HiddenTimeInput.jsx +0 -69
- package/dist/HiddenTimeInput.jsx.map +0 -1
- package/src/HiddenTimeInput.tsx +0 -133
package/dist/Select.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.jsx","names":["mergeProps"],"sources":["../src/Select.tsx"],"sourcesContent":["/**\n * Select component for solidaria-components\n *\n * A pre-wired headless select that combines state + aria hooks.\n * Port of react-aria-components/src/Select.tsx\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n splitProps,\n useContext,\n For,\n Show,\n untrack,\n} from \"solid-js\";\nimport {\n createSelect,\n createHiddenSelect,\n createListBox,\n createOption,\n createHover,\n createInteractOutside,\n FocusScope,\n focusSafely,\n mergeProps,\n type AriaSelectProps,\n type AriaListBoxProps,\n type AriaOptionProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSelectState,\n type ListState,\n type SelectState,\n type Key,\n type CollectionNode,\n DEFAULT_VALIDATION_RESULT,\n type ValidationResult,\n} from \"@proyecto-viviana/solid-stately\";\nimport { FieldErrorContext, type FieldErrorContextValue } from \"./FieldError\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport {\n SelectionIndicatorContext,\n type SelectionIndicatorContextValue,\n} from \"./SelectionIndicator\";\nimport { ListBoxLoadMoreItem } from \"./ListBox\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nfunction getNativeSelectValidation(select: HTMLSelectElement): ValidationResult {\n return {\n isInvalid: !select.validity.valid,\n validationDetails: {\n badInput: select.validity.badInput,\n customError: select.validity.customError,\n patternMismatch: select.validity.patternMismatch,\n rangeOverflow: select.validity.rangeOverflow,\n rangeUnderflow: select.validity.rangeUnderflow,\n stepMismatch: select.validity.stepMismatch,\n tooLong: select.validity.tooLong,\n tooShort: select.validity.tooShort,\n typeMismatch: select.validity.typeMismatch,\n valueMissing: select.validity.valueMissing,\n valid: select.validity.valid,\n },\n validationErrors: select.validationMessage ? [select.validationMessage] : [],\n };\n}\n\nexport interface SelectRenderProps {\n /** Whether the select is open. */\n isOpen: boolean;\n /** Whether the select is focused. */\n isFocused: boolean;\n /** Whether the select has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the select is disabled. */\n isDisabled: boolean;\n /** Whether the select is required. */\n isRequired: boolean;\n /** Whether a value is selected. */\n isSelected: boolean;\n}\n\nexport interface SelectProps<T> extends Omit<AriaSelectProps, \"children\">, SlotProps {\n /** The items to render in the select. */\n items: T[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Selection mode. */\n selectionMode?: \"single\" | \"multiple\";\n /** The currently selected key (controlled). */\n selectedKey?: Key | null;\n /** The default selected key (uncontrolled). */\n defaultSelectedKey?: Key | null;\n /** Currently selected keys (controlled, for multiple selection). */\n selectedKeys?: \"all\" | Iterable<Key>;\n /** Default selected keys (uncontrolled, for multiple selection). */\n defaultSelectedKeys?: \"all\" | Iterable<Key>;\n /** Handler called when selection changes. */\n onSelectionChange?: (key: Key | null) => void;\n /** Handler called when selected keys change. */\n onSelectionChangeKeys?: (keys: \"all\" | Set<Key>) => void;\n /** Whether the select is open (controlled). */\n isOpen?: boolean;\n /** Whether the select is open by default (uncontrolled). */\n defaultOpen?: boolean;\n /** Handler called when the open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** Placeholder text when no option is selected. */\n placeholder?: string;\n /** The name of the select, used when submitting an HTML form. */\n name?: string;\n /** The children of the component (compound components: SelectTrigger, SelectListBox). */\n children: RenderChildren<SelectRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectRenderProps>;\n /** Custom renderer for the outer select element. */\n render?: (\n props: JSX.HTMLAttributes<HTMLDivElement>,\n renderProps: SelectRenderProps,\n ) => JSX.Element;\n /** Ref for the outer select element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface SelectValueRenderProps<T> {\n /** The selected item. */\n selectedItem: CollectionNode<T> | null;\n /** The selected items. */\n selectedItems: CollectionNode<T>[];\n /** The text value of the selected item. */\n selectedText: string | null;\n /** Whether a value is selected. */\n isSelected: boolean;\n /** The placeholder text. */\n placeholder: string | undefined;\n}\n\nexport interface SelectValueProps<T> extends SlotProps {\n /** The children of the value. A function may be provided to receive render props. */\n children?: RenderChildren<SelectValueRenderProps<T>>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectValueRenderProps<T>>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectValueRenderProps<T>>;\n /** Placeholder text when no option is selected. Overrides the placeholder from Select. */\n placeholder?: string;\n}\n\nexport interface SelectTriggerRenderProps {\n /** Whether the select is open. */\n isOpen: boolean;\n /** Whether the trigger is focused. */\n isFocused: boolean;\n /** Whether the trigger has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the trigger is hovered. */\n isHovered: boolean;\n /** Whether the trigger is disabled. */\n isDisabled: boolean;\n}\n\nexport interface SelectTriggerProps extends SlotProps {\n /** The children of the trigger. A function may be provided to receive render props. */\n children?: RenderChildren<SelectTriggerRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectTriggerRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectTriggerRenderProps>;\n}\n\nexport interface SelectListBoxRenderProps {\n /** Whether the listbox is focused. */\n isFocused: boolean;\n}\n\nexport interface SelectListBoxProps<T> extends SlotProps {\n /** The children of the listbox. A function may be provided to render each item. */\n children?: (item: T) => JSX.Element;\n /** Content to display when the listbox has no items. */\n renderEmptyState?: () => JSX.Element;\n /** Called when the load more sentinel becomes visible. */\n onLoadMore?: () => void | Promise<void>;\n /** Whether additional items are currently loading. */\n isLoading?: boolean;\n /** Content to display in the load more sentinel row. */\n renderLoadMore?: () => JSX.Element | undefined;\n /** CSS class for the load more sentinel row. */\n loadMoreClass?: ClassNameOrFunction<{ isLoading: boolean }>;\n /** Whether the listbox is rendered inside an overlay popover. */\n isInPopover?: boolean;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectListBoxRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectListBoxRenderProps>;\n}\n\nexport interface SelectOptionRenderProps {\n /** Whether the option is selected. */\n isSelected: boolean;\n /** Whether the option is focused. */\n isFocused: boolean;\n /** Whether the option has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the option is pressed. */\n isPressed: boolean;\n /** Whether the option is hovered. */\n isHovered: boolean;\n /** Whether the option is disabled. */\n isDisabled: boolean;\n}\n\nexport interface SelectOptionProps<T> extends Omit<AriaOptionProps, \"children\" | \"key\">, SlotProps {\n /** The unique key for the option. */\n id: Key;\n /** The item value. */\n item?: T;\n /** The children of the option. A function may be provided to receive render props. */\n children?: RenderChildren<SelectOptionRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectOptionRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectOptionRenderProps>;\n /** The text value of the option (for typeahead). */\n textValue?: string;\n}\n\ninterface SelectContextValue<T> {\n state: SelectState<T>;\n rootRef: Accessor<HTMLElement | null>;\n triggerRef: Accessor<HTMLElement | null>;\n setTriggerRef: (el: HTMLElement | null) => void;\n triggerProps: JSX.HTMLAttributes<HTMLElement>;\n valueProps: JSX.HTMLAttributes<HTMLElement>;\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n menuProps: JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps?: JSX.HTMLAttributes<HTMLElement>;\n validation?: ValidationResult;\n isOpen: Accessor<boolean>;\n isFocused: Accessor<boolean>;\n isFocusVisible: Accessor<boolean>;\n isDisabled: Accessor<boolean>;\n placeholder?: string;\n items: T[];\n renderItem?: (item: T) => JSX.Element;\n slots?: Record<string, Partial<SelectProps<T>>>;\n autoFocus?: boolean;\n}\n\nexport const SelectContext = createContext<SelectContextValue<unknown> | null>(null);\nexport const SelectStateContext = createContext<SelectState<unknown> | null>(null);\nexport const SelectValueContext = SelectContext;\n\nconst selectRootLabelProps = new Set([\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n]);\n\n/**\n * A select displays a collapsible list of options and allows a user to select one of them.\n */\nexport function Select<T>(props: SelectProps<T>): JSX.Element {\n const parentContext = useContext(SelectContext) as SelectContextValue<T> | null;\n const contextSlotProps = parentContext?.slots?.[props.slot ?? \"default\"] as\n | Partial<SelectProps<T>>\n | undefined;\n const mergedSelectProps = (\n contextSlotProps ? mergeProps(contextSlotProps, props) : props\n ) as SelectProps<T>;\n const [local, stateProps, ariaProps] = splitProps(\n mergedSelectProps,\n [\"class\", \"style\", \"render\", \"ref\", \"slot\", \"children\"],\n [\n \"items\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"selectionMode\",\n \"selectedKey\",\n \"defaultSelectedKey\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"onSelectionChangeKeys\",\n \"isOpen\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"name\",\n ],\n );\n let rootRef: HTMLDivElement | undefined;\n const [selectValidation, setSelectValidation] =\n createSignal<ValidationResult>(DEFAULT_VALIDATION_RESULT);\n const errorMessageId = createUniqueId();\n\n const resolveDisabled = (): boolean => {\n const disabled = ariaProps.isDisabled;\n if (typeof disabled === \"function\") {\n return (disabled as () => boolean)();\n }\n return !!disabled;\n };\n\n const state = createSelectState<T>({\n get items() {\n return stateProps.items;\n },\n get getKey() {\n return stateProps.getKey;\n },\n get getTextValue() {\n return stateProps.getTextValue;\n },\n get getDisabled() {\n return stateProps.getDisabled;\n },\n get disabledKeys() {\n return stateProps.disabledKeys;\n },\n get selectionMode() {\n return stateProps.selectionMode;\n },\n get selectedKey() {\n return stateProps.selectedKey;\n },\n get defaultSelectedKey() {\n return stateProps.defaultSelectedKey;\n },\n get selectedKeys() {\n return stateProps.selectedKeys;\n },\n get defaultSelectedKeys() {\n return stateProps.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\n },\n get onSelectionChangeKeys() {\n return stateProps.onSelectionChangeKeys;\n },\n get isOpen() {\n return stateProps.isOpen;\n },\n get defaultOpen() {\n return stateProps.defaultOpen;\n },\n get onOpenChange() {\n return stateProps.onOpenChange;\n },\n get isDisabled() {\n return resolveDisabled();\n },\n get isRequired() {\n return ariaProps.isRequired;\n },\n });\n\n const selectAriaProps = createMemo(() => {\n const clean: Record<string, unknown> = {};\n for (const key in ariaProps as Record<string, unknown>) {\n if (!key.startsWith(\"data-\")) {\n clean[key] = (ariaProps as Record<string, unknown>)[key];\n }\n }\n return clean as typeof ariaProps;\n });\n\n const { labelProps, triggerProps, valueProps, menuProps, isFocused, isFocusVisible, isOpen } =\n createSelect<T>(selectAriaProps, state);\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return resolveDisabled();\n },\n });\n\n const renderValues = createMemo<SelectRenderProps>(() => ({\n isOpen: isOpen(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: resolveDisabled(),\n isRequired: !!ariaProps.isRequired,\n isSelected:\n state.selectionMode() === \"multiple\"\n ? state.selectedKeys() === \"all\" || (state.selectedKeys() as Set<Key>).size > 0\n : state.selectedKey() != null,\n }));\n const childRenderValues: SelectRenderProps = {\n get isOpen() {\n return isOpen();\n },\n get isFocused() {\n return isFocused();\n },\n get isFocusVisible() {\n return isFocusVisible();\n },\n get isDisabled() {\n return resolveDisabled();\n },\n get isRequired() {\n return !!ariaProps.isRequired;\n },\n get isSelected() {\n return hasSelection();\n },\n };\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n for (const key of selectRootLabelProps) {\n delete filtered[key];\n }\n return filtered;\n });\n\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanLabelProps = () => {\n const { ref: _ref, ...rest } = labelProps as Record<string, unknown>;\n return rest;\n };\n const setRootRef = (el: HTMLDivElement) => {\n rootRef = el;\n assignRef(local.ref, el);\n };\n const validation = createMemo<ValidationResult>(() => {\n const current = selectValidation();\n if (current.isInvalid || !ariaProps.isInvalid) {\n return current;\n }\n\n return {\n ...DEFAULT_VALIDATION_RESULT,\n isInvalid: true,\n };\n });\n const isInvalid = createMemo(() => validation().isInvalid);\n const triggerDescribedBy = () => {\n const ids = [\n (triggerProps as { \"aria-describedby\"?: string })[\"aria-describedby\"],\n isInvalid() ? errorMessageId : undefined,\n ]\n .filter(Boolean)\n .join(\" \")\n .split(\" \")\n .filter(Boolean);\n return ids.length ? Array.from(new Set(ids)).join(\" \") : undefined;\n };\n const triggerPropsWithValidation = () =>\n ({\n ...triggerProps,\n \"aria-describedby\": triggerDescribedBy(),\n }) as JSX.HTMLAttributes<HTMLElement>;\n const fieldErrorContext: FieldErrorContextValue = {\n get validation() {\n return validation();\n },\n get errorMessageProps() {\n return { id: errorMessageId };\n },\n };\n const focusTrigger = () => {\n triggerRef?.focus();\n };\n const hasSelection = () =>\n state.selectionMode() === \"multiple\"\n ? state.selectedKeys() === \"all\" || (state.selectedKeys() as Set<Key>).size > 0\n : state.selectedKey() != null;\n const hasNativeValidation = () => (ariaProps.validationBehavior ?? \"native\") === \"native\";\n const getSelectValidation = (select: HTMLSelectElement): ValidationResult => {\n if (ariaProps.isRequired && !hasSelection()) {\n return {\n isInvalid: true,\n validationDetails: {\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valueMissing: true,\n valid: false,\n },\n validationErrors: [select.validationMessage || \"Constraints not satisfied\"],\n };\n }\n return getNativeSelectValidation(select);\n };\n\n const { containerProps, selectProps: hiddenSelectProps } = createHiddenSelect({\n state,\n name: stateProps.name,\n form: ariaProps.form,\n isRequired: ariaProps.isRequired,\n validationBehavior: ariaProps.validationBehavior ?? \"native\",\n get isDisabled() {\n return resolveDisabled();\n },\n });\n const handleHiddenSelectInvalid: JSX.EventHandler<HTMLSelectElement, Event> = (event) => {\n setSelectValidation(getSelectValidation(event.currentTarget));\n focusTrigger();\n event.preventDefault();\n };\n const handleHiddenSelectChange: JSX.EventHandler<HTMLSelectElement, Event> = (event) => {\n (hiddenSelectProps as { onChange?: JSX.EventHandler<HTMLSelectElement, Event> }).onChange?.(\n event,\n );\n setSelectValidation(\n hasSelection() && event.currentTarget.validity.valid\n ? DEFAULT_VALIDATION_RESULT\n : getSelectValidation(event.currentTarget),\n );\n };\n createEffect(() => {\n if (hasSelection() && selectValidation().isInvalid) {\n setSelectValidation(DEFAULT_VALIDATION_RESULT);\n }\n });\n let triggerRef: HTMLElement | null = null;\n const setTriggerRef = (el: HTMLElement | null) => {\n triggerRef = el;\n };\n\n const RootChildren = () => {\n const selectChildren = untrack(() =>\n typeof local.children === \"function\"\n ? (local.children as (values: SelectRenderProps) => JSX.Element)(childRenderValues)\n : local.children,\n );\n\n return (\n <>\n <div {...containerProps}>\n <select\n {...hiddenSelectProps}\n name={hasSelection() ? undefined : stateProps.name}\n required={\n (hasNativeValidation() && ariaProps.isRequired && !hasSelection()) || undefined\n }\n onInvalid={handleHiddenSelectInvalid}\n onChange={handleHiddenSelectChange}\n >\n <Show when={state.selectionMode() !== \"multiple\"}>\n <option selected={state.selectedKey() == null} />\n </Show>\n <For each={stateProps.items}>\n {(item) => {\n const itemRecord = isObjectRecord(item) ? item : null;\n const fallbackKey =\n itemRecord != null ? (toKey(itemRecord.key) ?? toKey(itemRecord.id)) : undefined;\n const key = stateProps.getKey?.(item) ?? fallbackKey ?? String(item);\n const fallbackTextValue =\n itemRecord != null\n ? (toTextValue(itemRecord.textValue) ?? toTextValue(itemRecord.label))\n : undefined;\n const textValue =\n stateProps.getTextValue?.(item) ?? fallbackTextValue ?? String(item);\n const selectedKeys = state.selectedKeys();\n const isSelected =\n state.selectionMode() === \"multiple\"\n ? selectedKeys === \"all\"\n ? true\n : (selectedKeys as Set<Key>).has(key)\n : key === state.selectedKey();\n return (\n <option value={String(key)} selected={isSelected}>\n {textValue}\n </option>\n );\n }}\n </For>\n </select>\n <Show when={state.selectionMode() === \"multiple\" && stateProps.name}>\n <For\n each={\n state.selectedKeys() === \"all\"\n ? Array.from(state.collection()).map((item) => item.key)\n : Array.from(state.selectedKeys() as Set<Key>)\n }\n >\n {(key) => (\n <input\n type=\"hidden\"\n name={stateProps.name}\n form={ariaProps.form}\n value={String(key)}\n disabled={resolveDisabled()}\n />\n )}\n </For>\n </Show>\n <Show\n when={\n state.selectionMode() !== \"multiple\" && stateProps.name && state.selectedKey() != null\n }\n >\n <input\n type=\"hidden\"\n name={stateProps.name}\n form={ariaProps.form}\n value={String(state.selectedKey())}\n disabled={resolveDisabled()}\n />\n </Show>\n </div>\n <Show when={ariaProps.label}>\n <span {...cleanLabelProps()}>{ariaProps.label as JSX.Element}</span>\n </Show>\n {selectChildren}\n </>\n );\n };\n const baseRootProps = () =>\n ({\n ...domProps(),\n ...cleanHoverProps(),\n ref: setRootRef,\n class: renderProps.class(),\n style: renderProps.style(),\n slot: local.slot,\n \"data-open\": isOpen() || undefined,\n \"data-disabled\": resolveDisabled() || undefined,\n \"data-required\": ariaProps.isRequired || undefined,\n \"data-invalid\": isInvalid() || undefined,\n \"data-hovered\": isHovered() || undefined,\n }) as JSX.HTMLAttributes<HTMLDivElement>;\n const RootContent = () => {\n const renderedRootChildren = <RootChildren />;\n const rootProps = () =>\n ({\n ...baseRootProps(),\n children: renderedRootChildren,\n }) as JSX.HTMLAttributes<HTMLDivElement>;\n\n return local.render ? (\n local.render(rootProps(), renderValues())\n ) : (\n <div {...baseRootProps()}>{renderedRootChildren}</div>\n );\n };\n\n return (\n <SelectContext.Provider\n value={\n {\n state,\n rootRef: () => rootRef ?? null,\n triggerRef: () => triggerRef,\n setTriggerRef,\n get triggerProps() {\n return triggerPropsWithValidation();\n },\n valueProps,\n labelProps,\n menuProps,\n get errorMessageProps() {\n return { id: errorMessageId };\n },\n get validation() {\n return validation();\n },\n isOpen,\n isFocused,\n isFocusVisible,\n isDisabled: resolveDisabled,\n placeholder: ariaProps.placeholder,\n items: stateProps.items,\n autoFocus: !!ariaProps.autoFocus,\n } as SelectContextValue<unknown>\n }\n >\n <SelectStateContext.Provider value={state}>\n <FieldErrorContext.Provider value={fieldErrorContext}>\n <RootContent />\n </FieldErrorContext.Provider>\n </SelectStateContext.Provider>\n </SelectContext.Provider>\n );\n}\n\n/**\n * The trigger button for a select.\n */\nexport function SelectTrigger(props: SelectTriggerProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error(\"SelectTrigger must be used within a Select\");\n }\n const { isOpen, isFocused, isFocusVisible, state } = context;\n let triggerRef: HTMLButtonElement | undefined;\n const setTriggerRef = (el: HTMLButtonElement) => {\n triggerRef = el;\n context.setTriggerRef(el);\n };\n\n createEffect(() => {\n if (context.autoFocus) {\n triggerRef?.focus();\n }\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n const renderValues = createMemo<SelectTriggerRenderProps>(() => ({\n isOpen: isOpen(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n isDisabled: state.isDisabled,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-trigger\",\n },\n renderValues,\n );\n\n const cleanTriggerProps = () => {\n const { ref: _ref1, ...rest } = context.triggerProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const triggerAriaProps = () => context.triggerProps as Record<string, unknown>;\n const menuAriaProps = () => context.menuProps as Record<string, unknown>;\n return (\n <button\n ref={setTriggerRef}\n {...domProps}\n {...cleanTriggerProps()}\n {...cleanHoverProps()}\n type=\"button\"\n id={triggerAriaProps().id as string | undefined}\n tabIndex={state.isDisabled ? undefined : 0}\n aria-label={triggerAriaProps()[\"aria-label\"] as string | undefined}\n aria-labelledby={triggerAriaProps()[\"aria-labelledby\"] as string | undefined}\n aria-haspopup=\"listbox\"\n aria-expanded={isOpen()}\n aria-controls={isOpen() ? (menuAriaProps().id as string | undefined) : undefined}\n aria-disabled={state.isDisabled || undefined}\n aria-required={triggerAriaProps()[\"aria-required\"] as boolean | undefined}\n aria-describedby={triggerAriaProps()[\"aria-describedby\"] as string | undefined}\n class={renderProps.class()}\n style={renderProps.style()}\n data-open={isOpen() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={state.isDisabled || undefined}\n >\n {renderProps.renderChildren()}\n </button>\n );\n}\n\n// Default children function for SelectValue - defined at module level for SSR stability\nfunction defaultSelectValueChildren<T>(values: SelectValueRenderProps<T>) {\n return values.selectedText ?? values.placeholder ?? \"\";\n}\n\n/**\n * Displays the selected value in a select.\n */\nexport function SelectValue<T>(props: SelectValueProps<T>): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"placeholder\",\n \"children\",\n ]);\n\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error(\"SelectValue must be used within a Select\");\n }\n const { valueProps, placeholder: contextPlaceholder } = context;\n const state = context.state as SelectState<T>;\n\n const placeholder = () => local.placeholder ?? contextPlaceholder;\n\n const renderValues = createMemo<SelectValueRenderProps<T>>(() => {\n const collection = state.collection();\n const selectedItem =\n state.selectedKey() == null ? null : collection.getItem(state.selectedKey() as Key);\n const selectedKeys = state.selectedKeys();\n const selectedItems =\n selectedKeys === \"all\"\n ? Array.from(collection)\n : Array.from(selectedKeys as Set<Key>)\n .map((key) => collection.getItem(key))\n .filter((item): item is CollectionNode<T> => item != null);\n const selectedText =\n state.selectionMode() === \"multiple\"\n ? selectedItems.length > 0\n ? new Intl.ListFormat(undefined, { style: \"long\", type: \"conjunction\" }).format(\n selectedItems.map((item) => item.textValue),\n )\n : null\n : (selectedItem?.textValue ?? null);\n return {\n selectedItem,\n selectedItems,\n selectedText,\n isSelected:\n state.selectionMode() === \"multiple\" ? selectedItems.length > 0 : selectedItem != null,\n placeholder: placeholder(),\n };\n });\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children ?? defaultSelectValueChildren;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-value\",\n },\n renderValues,\n );\n\n return (\n <span\n {...domProps}\n {...valueProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-placeholder={!renderValues().isSelected || undefined}\n >\n {props.children == null\n ? (renderValues().selectedText ?? renderValues().placeholder ?? \"\")\n : renderProps.renderChildren()}\n </span>\n );\n}\n\n/**\n * The listbox popup for a select.\n */\nexport function SelectListBox<T>(props: SelectListBoxProps<T>): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"children\",\n \"renderEmptyState\",\n \"onLoadMore\",\n \"isLoading\",\n \"renderLoadMore\",\n \"loadMoreClass\",\n \"isInPopover\",\n ]);\n\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error(\"SelectListBox must be used within a Select\");\n }\n const { menuProps, rootRef, state: selectState, isOpen } = context;\n const state = selectState as SelectState<T>;\n\n createEffect(() => {\n if (!isOpen()) {\n return;\n }\n if (state.focusedKey() != null) {\n return;\n }\n const selectedKey = state.selectedKey();\n if (selectedKey != null && !state.collection().getItem(selectedKey)?.isDisabled) {\n state.setFocusedKey(selectedKey);\n }\n });\n\n let listBoxRef: HTMLUListElement | undefined;\n\n createInteractOutside({\n ref: () => rootRef() ?? listBoxRef ?? null,\n onInteractOutside: () => {\n if (isOpen()) {\n state.close();\n }\n },\n get isDisabled() {\n return !isOpen() || local.isInPopover === true;\n },\n });\n\n const { listBoxProps } = createListBox(\n {\n ...(menuProps as unknown as AriaListBoxProps),\n shouldSelectOnPressUp: true,\n shouldFocusOnHover: true,\n shouldSelectOnFocus: local.isInPopover === true ? false : undefined,\n get isDisabled() {\n return state.isDisabled;\n },\n },\n createSelectListStateAdapter(state),\n );\n\n const renderValues = createMemo<SelectListBoxRenderProps>(() => ({\n // Focus within the listbox itself (the selection manager's focus state),\n // not the select-level trigger focus.\n isFocused: state.selectionManager.isFocused,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-listbox\",\n },\n renderValues,\n );\n\n const cleanMenuProps = () => {\n const { ref: _ref1, ...rest } = menuProps as Record<string, unknown>;\n return rest;\n };\n const cleanListBoxProps = () => {\n const { ref: _ref2, ...rest } = listBoxProps as Record<string, unknown>;\n return rest;\n };\n\n const items = () => Array.from(state.collection());\n createEffect(() => {\n if (!isOpen()) return;\n const focusedKey = state.focusedKey();\n if (focusedKey == null) return;\n\n queueMicrotask(() => {\n const option = Array.from(\n listBoxRef?.querySelectorAll<HTMLElement>(\"[role='option']\") ?? [],\n ).find((element) => element.id === String(focusedKey));\n if (option && document.activeElement !== option) {\n focusSafely(option);\n }\n });\n });\n\n const listBox = () => (\n <ul\n ref={(el) => (listBoxRef = el)}\n {...domProps}\n {...cleanMenuProps()}\n {...cleanListBoxProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={state.selectionManager.isFocused || undefined}\n data-empty={state.collection().size === 0 || undefined}\n >\n {state.collection().size === 0 && local.renderEmptyState ? (\n <li role=\"option\" style={{ display: \"contents\" }} data-empty-state>\n {local.renderEmptyState()}\n </li>\n ) : (\n <Show\n when={local.children}\n fallback={\n <For each={items()}>\n {(node) => <SelectOption id={node.key}>{node.textValue}</SelectOption>}\n </For>\n }\n >\n <For each={items()}>\n {(node) => (node.value != null ? local.children!(node.value) : null)}\n </For>\n </Show>\n )}\n <Show when={local.onLoadMore}>\n <ListBoxLoadMoreItem\n onLoadMore={local.onLoadMore!}\n isLoading={local.isLoading}\n class={local.loadMoreClass}\n >\n {local.renderLoadMore?.()}\n </ListBoxLoadMoreItem>\n </Show>\n </ul>\n );\n\n return (\n <Show when={isOpen()}>\n <Show\n when={local.isInPopover}\n fallback={\n <FocusScope restoreFocus autoFocus>\n {listBox()}\n </FocusScope>\n }\n >\n {listBox()}\n </Show>\n </Show>\n );\n}\n\n/**\n * An option in a select listbox.\n */\nexport function SelectOption<T>(props: SelectOptionProps<T>): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"id\",\n \"item\",\n \"textValue\",\n ]);\n\n const context = useContext(SelectStateContext);\n if (!context) {\n throw new Error(\"SelectOption must be used within a Select\");\n }\n const state = context as SelectState<T>;\n const selectContext = useContext(SelectContext) as SelectContextValue<T> | null;\n const [ref, setRef] = createSignal<HTMLLIElement | null>(null);\n\n const optionAria = createOption<T>(\n {\n key: local.id,\n get isDisabled() {\n return Boolean(ariaProps.isDisabled || selectContext?.isDisabled());\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"] ?? local.textValue;\n },\n shouldSelectOnPressUp: true,\n shouldFocusOnHover: true,\n get onHoverStart() {\n return ariaProps.onHoverStart;\n },\n get onHoverEnd() {\n return ariaProps.onHoverEnd;\n },\n get onHoverChange() {\n return ariaProps.onHoverChange;\n },\n },\n {\n ...createSelectListStateAdapter(state),\n select: (key: Key) => {\n if (state.selectionMode() === \"multiple\") {\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n state.setSelectedKeys(new Set([...keys, key]));\n return;\n }\n state.setSelectedKey(key);\n state.close();\n },\n toggleSelection: (key: Key) => {\n if (state.selectionMode() === \"multiple\") {\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n const next = new Set(keys);\n if (next.has(key)) next.delete(key);\n else next.add(key);\n state.setSelectedKeys(next);\n return;\n }\n state.setSelectedKey(key);\n state.close();\n },\n replaceSelection: (key: Key) => {\n state.setSelectedKey(key);\n if (state.selectionMode() !== \"multiple\") {\n state.close();\n }\n },\n },\n () => ref(),\n );\n const isOptionFocusVisible = () =>\n optionAria.isFocused() && (selectContext?.isFocusVisible() ?? optionAria.isFocusVisible());\n\n const renderValues = createMemo<SelectOptionRenderProps>(() => ({\n isSelected: optionAria.isSelected(),\n isFocused: optionAria.isFocused(),\n isFocusVisible: isOptionFocusVisible(),\n isPressed: optionAria.isPressed(),\n isHovered: optionAria.isHovered(),\n isDisabled: optionAria.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-option\",\n },\n renderValues,\n );\n const hasPrimitiveLabel = () => {\n return typeof props.children === \"string\" || typeof props.children === \"number\";\n };\n\n const selectionIndicatorContext = createMemo<SelectionIndicatorContextValue>(() => ({\n isSelected: optionAria.isSelected,\n }));\n\n const cleanOptionProps = () => {\n const {\n ref: _ref1,\n \"aria-describedby\": _ariaDescribedby,\n ...rest\n } = optionAria.optionProps as Record<string, unknown>;\n if (!hasPrimitiveLabel() && rest[\"aria-label\"] == null) {\n delete rest[\"aria-labelledby\"];\n }\n const onClick = rest.onClick as ((event: MouseEvent) => void) | undefined;\n rest.onClick = ((event: MouseEvent) => {\n const wasSelected = optionAria.isSelected();\n onClick?.(event);\n if (typeof PointerEvent === \"undefined\") {\n return;\n }\n queueMicrotask(() => {\n if (state.selectionMode() !== \"multiple\" || optionAria.isSelected() === wasSelected) {\n selectOption();\n }\n });\n }) as JSX.EventHandler<HTMLLIElement, MouseEvent>;\n return rest;\n };\n const selectOption = () => {\n if (optionAria.isDisabled()) {\n return;\n }\n if (state.selectionMode() === \"multiple\") {\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n const next = new Set(keys);\n if (next.has(local.id)) next.delete(local.id);\n else next.add(local.id);\n state.setSelectedKeys(next);\n return;\n }\n state.setSelectedKey(local.id);\n state.close();\n };\n\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n <li\n ref={setRef}\n {...cleanOptionProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={optionAria.isSelected() || undefined}\n data-focused={optionAria.isFocused() || undefined}\n data-focus-visible={isOptionFocusVisible() || undefined}\n data-pressed={optionAria.isPressed() || undefined}\n data-hovered={optionAria.isHovered() || undefined}\n data-disabled={optionAria.isDisabled() || undefined}\n >\n {hasPrimitiveLabel() ? (\n <span {...optionAria.labelProps}>{renderProps.renderChildren()}</span>\n ) : (\n renderProps.renderChildren()\n )}\n </li>\n </SelectionIndicatorContext.Provider>\n );\n}\n\nfunction isObjectRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n\nfunction toKey(value: unknown): Key | undefined {\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value;\n }\n return undefined;\n}\n\nfunction toTextValue(value: unknown): string | undefined {\n if (typeof value === \"string\" || typeof value === \"number\") {\n return String(value);\n }\n return undefined;\n}\n\nfunction createSelectListStateAdapter<T>(state: SelectState<T>): ListState<T> {\n const selectedKeys = createMemo(() => {\n const keys = state.selectedKeys();\n return keys === \"all\" ? new Set(Array.from(state.collection()).map((item) => item.key)) : keys;\n });\n\n const disabledKeys = createMemo(() => {\n const keys = new Set<Key>();\n for (const node of state.collection()) {\n if (node.isDisabled) keys.add(node.key);\n }\n return keys;\n });\n\n return {\n collection: state.collection,\n selectionManager: state.selectionManager,\n // Collection-level focus (the selection manager's), not the select-level\n // trigger focus — upstream listbox internals only ever read\n // state.selectionManager.isFocused.\n isFocused: () => state.selectionManager.isFocused,\n setFocused: (isFocused) => state.selectionManager.setFocused(isFocused),\n focusedKey: state.focusedKey,\n setFocusedKey: (key) => state.setFocusedKey(key ?? null),\n childFocusStrategy: () => null,\n selectionMode: () => state.selectionMode(),\n selectionBehavior: () => \"replace\",\n disallowEmptySelection: () => true,\n selectedKeys,\n disabledKeys,\n disabledBehavior: () => \"all\",\n isEmpty: () => selectedKeys().size === 0,\n isSelectAll: () => state.selectedKeys() === \"all\",\n isSelected: (key) => selectedKeys().has(key),\n isDisabled: state.isKeyDisabled,\n setSelectionBehavior: () => {},\n toggleSelection: (key) => {\n if (state.selectionMode() !== \"multiple\") {\n state.setSelectedKey(key);\n return;\n }\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n const next = new Set(keys);\n if (next.has(key)) next.delete(key);\n else next.add(key);\n state.setSelectedKeys(next);\n },\n replaceSelection: (key) => state.setSelectedKey(key),\n setSelectedKeys: (keys) => state.setSelectedKeys(keys),\n selectAll: () => {},\n clearSelection: () =>\n state.selectionMode() === \"multiple\" ? state.setSelectedKeys([]) : state.setSelectedKey(null),\n toggleSelectAll: () => {},\n extendSelection: (toKey) => state.setSelectedKey(toKey),\n select: (key) =>\n state.selectionMode() === \"multiple\"\n ? state.setSelectedKeys([\n ...(state.selectedKeys() === \"all\" ? [] : (state.selectedKeys() as Set<Key>)),\n key,\n ])\n : state.setSelectedKey(key),\n };\n}\n\nSelect.Trigger = SelectTrigger;\nSelect.Value = SelectValue;\nSelect.ListBox = SelectListBox;\nSelect.Option = SelectOption;\n"],"mappings":";;;;;;;;;;;;;;AA6DA,SAAS,UAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KAAK;CACV,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AAEA,SAAS,0BAA0B,QAA6C;CAC9E,OAAO;EACL,WAAW,CAAC,OAAO,SAAS;EAC5B,mBAAmB;GACjB,UAAU,OAAO,SAAS;GAC1B,aAAa,OAAO,SAAS;GAC7B,iBAAiB,OAAO,SAAS;GACjC,eAAe,OAAO,SAAS;GAC/B,gBAAgB,OAAO,SAAS;GAChC,cAAc,OAAO,SAAS;GAC9B,SAAS,OAAO,SAAS;GACzB,UAAU,OAAO,SAAS;GAC1B,cAAc,OAAO,SAAS;GAC9B,cAAc,OAAO,SAAS;GAC9B,OAAO,OAAO,SAAS;EACzB;EACA,kBAAkB,OAAO,oBAAoB,CAAC,OAAO,iBAAiB,IAAI,CAAC;CAC7E;AACF;AA+LA,MAAa,gBAAgB,cAAkD,IAAI;AACnF,MAAa,qBAAqB,cAA2C,IAAI;AACjF,MAAa,qBAAqB;AAElC,MAAM,uBAAuB,IAAI,I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M,gBAAgB,IAAI;EAC5B;EACA,mBAAmB,QAAQ,MAAM,eAAe,GAAG;EACnD,kBAAkB,SAAS,MAAM,gBAAgB,IAAI;EACrD,iBAAiB,CAAC;EAClB,sBACE,MAAM,cAAc,MAAM,aAAa,MAAM,gBAAgB,CAAC,CAAC,IAAI,MAAM,eAAe,IAAI;EAC9F,uBAAuB,CAAC;EACxB,kBAAkB,UAAU,MAAM,eAAe,KAAK;EACtD,SAAS,QACP,MAAM,cAAc,MAAM,aACtB,MAAM,gBAAgB,CACpB,GAAI,MAAM,aAAa,MAAM,QAAQ,CAAC,IAAK,MAAM,aAAa,GAC9D,GACF,CAAC,IACD,MAAM,eAAe,GAAG;CAChC;AACF;AAEA,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,SAAS"}
|
|
1
|
+
{"version":3,"file":"Select.jsx","names":["mergeProps"],"sources":["../src/Select.tsx"],"sourcesContent":["/**\n * Select component for solidaria-components\n *\n * A pre-wired headless select that combines state + aria hooks.\n * Port of react-aria-components/src/Select.tsx\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n splitProps,\n useContext,\n For,\n Show,\n untrack,\n} from \"solid-js\";\nimport {\n createSelect,\n createHiddenSelect,\n createListBox,\n createOption,\n createHover,\n createInteractOutside,\n FocusScope,\n focusSafely,\n mergeProps,\n type AriaSelectProps,\n type AriaListBoxProps,\n type AriaOptionProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSelectState,\n type ListState,\n type SelectState,\n type Key,\n type CollectionNode,\n DEFAULT_VALIDATION_RESULT,\n type ValidationResult,\n} from \"@proyecto-viviana/solid-stately\";\nimport { FieldErrorContext, type FieldErrorContextValue } from \"./FieldError\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport {\n SelectionIndicatorContext,\n type SelectionIndicatorContextValue,\n} from \"./SelectionIndicator\";\nimport { ListBoxLoadMoreItem } from \"./ListBox\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nfunction getNativeSelectValidation(select: HTMLSelectElement): ValidationResult {\n return {\n isInvalid: !select.validity.valid,\n validationDetails: {\n badInput: select.validity.badInput,\n customError: select.validity.customError,\n patternMismatch: select.validity.patternMismatch,\n rangeOverflow: select.validity.rangeOverflow,\n rangeUnderflow: select.validity.rangeUnderflow,\n stepMismatch: select.validity.stepMismatch,\n tooLong: select.validity.tooLong,\n tooShort: select.validity.tooShort,\n typeMismatch: select.validity.typeMismatch,\n valueMissing: select.validity.valueMissing,\n valid: select.validity.valid,\n },\n validationErrors: select.validationMessage ? [select.validationMessage] : [],\n };\n}\n\nexport interface SelectRenderProps {\n /** Whether the select is open. */\n isOpen: boolean;\n /** Whether the select is focused. */\n isFocused: boolean;\n /** Whether the select has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the select is disabled. */\n isDisabled: boolean;\n /** Whether the select is required. */\n isRequired: boolean;\n /** Whether a value is selected. */\n isSelected: boolean;\n}\n\nexport interface SelectProps<T> extends Omit<AriaSelectProps, \"children\">, SlotProps {\n /** The items to render in the select. */\n items: T[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Selection mode. */\n selectionMode?: \"single\" | \"multiple\";\n /** The currently selected key (controlled). */\n selectedKey?: Key | null;\n /** The default selected key (uncontrolled). */\n defaultSelectedKey?: Key | null;\n /** Currently selected keys (controlled, for multiple selection). */\n selectedKeys?: \"all\" | Iterable<Key>;\n /** Default selected keys (uncontrolled, for multiple selection). */\n defaultSelectedKeys?: \"all\" | Iterable<Key>;\n /** Handler called when selection changes. */\n onSelectionChange?: (key: Key | null) => void;\n /** Handler called when selected keys change. */\n onSelectionChangeKeys?: (keys: \"all\" | Set<Key>) => void;\n /** Whether the select is open (controlled). */\n isOpen?: boolean;\n /** Whether the select is open by default (uncontrolled). */\n defaultOpen?: boolean;\n /** Handler called when the open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** Placeholder text when no option is selected. */\n placeholder?: string;\n /** The name of the select, used when submitting an HTML form. */\n name?: string;\n /** The children of the component (compound components: SelectTrigger, SelectListBox). */\n children: RenderChildren<SelectRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectRenderProps>;\n /** Custom renderer for the outer select element. */\n render?: (\n props: JSX.HTMLAttributes<HTMLDivElement>,\n renderProps: SelectRenderProps,\n ) => JSX.Element;\n /** Ref for the outer select element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface SelectValueRenderProps<T> {\n /** The selected item. */\n selectedItem: CollectionNode<T> | null;\n /** The selected items. */\n selectedItems: CollectionNode<T>[];\n /** The text value of the selected item. */\n selectedText: string | null;\n /** Whether a value is selected. */\n isSelected: boolean;\n /** The placeholder text. */\n placeholder: string | undefined;\n}\n\nexport interface SelectValueProps<T> extends SlotProps {\n /** The children of the value. A function may be provided to receive render props. */\n children?: RenderChildren<SelectValueRenderProps<T>>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectValueRenderProps<T>>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectValueRenderProps<T>>;\n /** Placeholder text when no option is selected. Overrides the placeholder from Select. */\n placeholder?: string;\n}\n\nexport interface SelectTriggerRenderProps {\n /** Whether the select is open. */\n isOpen: boolean;\n /** Whether the trigger is focused. */\n isFocused: boolean;\n /** Whether the trigger has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the trigger is hovered. */\n isHovered: boolean;\n /** Whether the trigger is pressed. */\n isPressed: boolean;\n /** Whether the trigger is disabled. */\n isDisabled: boolean;\n}\n\nexport interface SelectTriggerProps extends SlotProps {\n /** A ref callback/object for the underlying trigger button element. */\n ref?: RefLike<HTMLButtonElement>;\n /** The children of the trigger. A function may be provided to receive render props. */\n children?: RenderChildren<SelectTriggerRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectTriggerRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectTriggerRenderProps>;\n}\n\nexport interface SelectListBoxRenderProps {\n /** Whether the listbox is focused. */\n isFocused: boolean;\n}\n\nexport interface SelectListBoxProps<T> extends SlotProps {\n /** The children of the listbox. A function may be provided to render each item. */\n children?: (item: T) => JSX.Element;\n /** Content to display when the listbox has no items. */\n renderEmptyState?: () => JSX.Element;\n /** Called when the load more sentinel becomes visible. */\n onLoadMore?: () => void | Promise<void>;\n /** Whether additional items are currently loading. */\n isLoading?: boolean;\n /** Content to display in the load more sentinel row. */\n renderLoadMore?: () => JSX.Element | undefined;\n /** CSS class for the load more sentinel row. */\n loadMoreClass?: ClassNameOrFunction<{ isLoading: boolean }>;\n /** Whether the listbox is rendered inside an overlay popover. */\n isInPopover?: boolean;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectListBoxRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectListBoxRenderProps>;\n}\n\nexport interface SelectOptionRenderProps {\n /** Whether the option is selected. */\n isSelected: boolean;\n /** Whether the option is focused. */\n isFocused: boolean;\n /** Whether the option has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the option is pressed. */\n isPressed: boolean;\n /** Whether the option is hovered. */\n isHovered: boolean;\n /** Whether the option is disabled. */\n isDisabled: boolean;\n}\n\nexport interface SelectOptionProps<T> extends Omit<AriaOptionProps, \"children\" | \"key\">, SlotProps {\n /** A ref callback/object for the underlying option element. */\n ref?: RefLike<HTMLDivElement>;\n /** The unique key for the option. */\n id: Key;\n /** The item value. */\n item?: T;\n /** The children of the option. A function may be provided to receive render props. */\n children?: RenderChildren<SelectOptionRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectOptionRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectOptionRenderProps>;\n /** The text value of the option (for typeahead). */\n textValue?: string;\n}\n\ninterface SelectContextValue<T> {\n state: SelectState<T>;\n rootRef: Accessor<HTMLElement | null>;\n triggerRef: Accessor<HTMLElement | null>;\n setTriggerRef: (el: HTMLElement | null) => void;\n triggerProps: JSX.HTMLAttributes<HTMLElement>;\n valueProps: JSX.HTMLAttributes<HTMLElement>;\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n menuProps: JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps?: JSX.HTMLAttributes<HTMLElement>;\n validation?: ValidationResult;\n isOpen: Accessor<boolean>;\n isFocused: Accessor<boolean>;\n isFocusVisible: Accessor<boolean>;\n isPressed: Accessor<boolean>;\n isDisabled: Accessor<boolean>;\n placeholder?: string;\n items: T[];\n renderItem?: (item: T) => JSX.Element;\n slots?: Record<string, Partial<SelectProps<T>>>;\n autoFocus?: boolean;\n}\n\nexport const SelectContext = createContext<SelectContextValue<unknown> | null>(null);\nexport const SelectStateContext = createContext<SelectState<unknown> | null>(null);\nexport const SelectValueContext = SelectContext;\n\nconst selectRootLabelProps = new Set([\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n]);\n\n/**\n * A select displays a collapsible list of options and allows a user to select one of them.\n */\nexport function Select<T>(props: SelectProps<T>): JSX.Element {\n const parentContext = useContext(SelectContext) as SelectContextValue<T> | null;\n const contextSlotProps = parentContext?.slots?.[props.slot ?? \"default\"] as\n | Partial<SelectProps<T>>\n | undefined;\n const mergedSelectProps = (\n contextSlotProps ? mergeProps(contextSlotProps, props) : props\n ) as SelectProps<T>;\n const [local, stateProps, ariaProps] = splitProps(\n mergedSelectProps,\n [\"class\", \"style\", \"render\", \"ref\", \"slot\", \"children\"],\n [\n \"items\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"selectionMode\",\n \"selectedKey\",\n \"defaultSelectedKey\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"onSelectionChangeKeys\",\n \"isOpen\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"name\",\n ],\n );\n let rootRef: HTMLDivElement | undefined;\n const [selectValidation, setSelectValidation] =\n createSignal<ValidationResult>(DEFAULT_VALIDATION_RESULT);\n const errorMessageId = createUniqueId();\n\n const resolveDisabled = (): boolean => {\n const disabled = ariaProps.isDisabled;\n if (typeof disabled === \"function\") {\n return (disabled as () => boolean)();\n }\n return !!disabled;\n };\n\n const state = createSelectState<T>({\n get items() {\n return stateProps.items;\n },\n get getKey() {\n return stateProps.getKey;\n },\n get getTextValue() {\n return stateProps.getTextValue;\n },\n get getDisabled() {\n return stateProps.getDisabled;\n },\n get disabledKeys() {\n return stateProps.disabledKeys;\n },\n get selectionMode() {\n return stateProps.selectionMode;\n },\n get selectedKey() {\n return stateProps.selectedKey;\n },\n get defaultSelectedKey() {\n return stateProps.defaultSelectedKey;\n },\n get selectedKeys() {\n return stateProps.selectedKeys;\n },\n get defaultSelectedKeys() {\n return stateProps.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\n },\n get onSelectionChangeKeys() {\n return stateProps.onSelectionChangeKeys;\n },\n get isOpen() {\n return stateProps.isOpen;\n },\n get defaultOpen() {\n return stateProps.defaultOpen;\n },\n get onOpenChange() {\n return stateProps.onOpenChange;\n },\n get isDisabled() {\n return resolveDisabled();\n },\n get isRequired() {\n return ariaProps.isRequired;\n },\n });\n\n const selectAriaProps = createMemo(() => {\n const clean: Record<string, unknown> = {};\n for (const key in ariaProps as Record<string, unknown>) {\n if (!key.startsWith(\"data-\")) {\n clean[key] = (ariaProps as Record<string, unknown>)[key];\n }\n }\n return clean as typeof ariaProps;\n });\n\n const {\n labelProps,\n triggerProps,\n valueProps,\n menuProps,\n isFocused,\n isFocusVisible,\n isOpen,\n isPressed,\n } = createSelect<T>(selectAriaProps, state);\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return resolveDisabled();\n },\n });\n\n const renderValues = createMemo<SelectRenderProps>(() => ({\n isOpen: isOpen(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: resolveDisabled(),\n isRequired: !!ariaProps.isRequired,\n isSelected:\n state.selectionMode() === \"multiple\"\n ? state.selectedKeys() === \"all\" || (state.selectedKeys() as Set<Key>).size > 0\n : state.selectedKey() != null,\n }));\n const childRenderValues: SelectRenderProps = {\n get isOpen() {\n return isOpen();\n },\n get isFocused() {\n return isFocused();\n },\n get isFocusVisible() {\n return isFocusVisible();\n },\n get isDisabled() {\n return resolveDisabled();\n },\n get isRequired() {\n return !!ariaProps.isRequired;\n },\n get isSelected() {\n return hasSelection();\n },\n };\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n for (const key of selectRootLabelProps) {\n delete filtered[key];\n }\n return filtered;\n });\n\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanLabelProps = () => {\n const { ref: _ref, ...rest } = labelProps as Record<string, unknown>;\n return rest;\n };\n const setRootRef = (el: HTMLDivElement) => {\n rootRef = el;\n assignRef(local.ref, el);\n };\n const validation = createMemo<ValidationResult>(() => {\n const current = selectValidation();\n if (current.isInvalid || !ariaProps.isInvalid) {\n return current;\n }\n\n return {\n ...DEFAULT_VALIDATION_RESULT,\n isInvalid: true,\n };\n });\n const isInvalid = createMemo(() => validation().isInvalid);\n const triggerDescribedBy = () => {\n const ids = [\n (triggerProps as { \"aria-describedby\"?: string })[\"aria-describedby\"],\n isInvalid() ? errorMessageId : undefined,\n ]\n .filter(Boolean)\n .join(\" \")\n .split(\" \")\n .filter(Boolean);\n return ids.length ? Array.from(new Set(ids)).join(\" \") : undefined;\n };\n const triggerPropsWithValidation = () =>\n ({\n ...triggerProps,\n \"aria-describedby\": triggerDescribedBy(),\n }) as JSX.HTMLAttributes<HTMLElement>;\n const fieldErrorContext: FieldErrorContextValue = {\n get validation() {\n return validation();\n },\n get errorMessageProps() {\n return { id: errorMessageId };\n },\n };\n const focusTrigger = () => {\n triggerRef?.focus();\n };\n const hasSelection = () =>\n state.selectionMode() === \"multiple\"\n ? state.selectedKeys() === \"all\" || (state.selectedKeys() as Set<Key>).size > 0\n : state.selectedKey() != null;\n const hasNativeValidation = () => (ariaProps.validationBehavior ?? \"native\") === \"native\";\n const getSelectValidation = (select: HTMLSelectElement): ValidationResult => {\n if (ariaProps.isRequired && !hasSelection()) {\n return {\n isInvalid: true,\n validationDetails: {\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valueMissing: true,\n valid: false,\n },\n validationErrors: [select.validationMessage || \"Constraints not satisfied\"],\n };\n }\n return getNativeSelectValidation(select);\n };\n\n const { containerProps, selectProps: hiddenSelectProps } = createHiddenSelect({\n state,\n name: stateProps.name,\n form: ariaProps.form,\n isRequired: ariaProps.isRequired,\n validationBehavior: ariaProps.validationBehavior ?? \"native\",\n get isDisabled() {\n return resolveDisabled();\n },\n });\n const handleHiddenSelectInvalid: JSX.EventHandler<HTMLSelectElement, Event> = (event) => {\n setSelectValidation(getSelectValidation(event.currentTarget));\n focusTrigger();\n event.preventDefault();\n };\n const handleHiddenSelectChange: JSX.EventHandler<HTMLSelectElement, Event> = (event) => {\n (hiddenSelectProps as { onChange?: JSX.EventHandler<HTMLSelectElement, Event> }).onChange?.(\n event,\n );\n setSelectValidation(\n hasSelection() && event.currentTarget.validity.valid\n ? DEFAULT_VALIDATION_RESULT\n : getSelectValidation(event.currentTarget),\n );\n };\n createEffect(() => {\n if (hasSelection() && selectValidation().isInvalid) {\n setSelectValidation(DEFAULT_VALIDATION_RESULT);\n }\n });\n let triggerRef: HTMLElement | null = null;\n const setTriggerRef = (el: HTMLElement | null) => {\n triggerRef = el;\n };\n\n const RootChildren = () => {\n const selectChildren = untrack(() =>\n typeof local.children === \"function\"\n ? (local.children as (values: SelectRenderProps) => JSX.Element)(childRenderValues)\n : local.children,\n );\n\n return (\n <>\n <Show when={ariaProps.label}>\n <span {...cleanLabelProps()}>{ariaProps.label as JSX.Element}</span>\n </Show>\n {selectChildren}\n {/*\n The HiddenSelect (native `<select>` for form autofill/submission) renders\n AFTER the trigger button, mirroring upstream RAC `Select` which emits\n `{renderProps.children}` then `<HiddenSelect>` (Select.tsx:288-289). Order\n matters for the DOM tab/focus trail: the visible button must precede the\n form-only hidden control.\n */}\n <div {...containerProps}>\n <select\n {...hiddenSelectProps}\n name={hasSelection() ? undefined : stateProps.name}\n required={\n (hasNativeValidation() && ariaProps.isRequired && !hasSelection()) || undefined\n }\n onInvalid={handleHiddenSelectInvalid}\n onChange={handleHiddenSelectChange}\n >\n <Show when={state.selectionMode() !== \"multiple\"}>\n <option selected={state.selectedKey() == null} />\n </Show>\n <For each={stateProps.items}>\n {(item) => {\n const itemRecord = isObjectRecord(item) ? item : null;\n const fallbackKey =\n itemRecord != null ? (toKey(itemRecord.key) ?? toKey(itemRecord.id)) : undefined;\n const key = stateProps.getKey?.(item) ?? fallbackKey ?? String(item);\n // This hidden <select> re-derives each option's label straight\n // from the raw items array, bypassing the collection's textValue.\n // Mirror createListState's derivation: read the conventional\n // display fields (textValue/label/name/title) and, for an object\n // item with none of them, fall back to the key rather than\n // String(item) — which would render the useless \"[object Object]\".\n const fallbackTextValue =\n itemRecord != null\n ? (toTextValue(itemRecord.textValue) ??\n toTextValue(itemRecord.label) ??\n toTextValue(itemRecord.name) ??\n toTextValue(itemRecord.title))\n : undefined;\n const textValue =\n stateProps.getTextValue?.(item) ??\n fallbackTextValue ??\n (itemRecord != null ? String(key) : String(item));\n const selectedKeys = state.selectedKeys();\n const isSelected =\n state.selectionMode() === \"multiple\"\n ? selectedKeys === \"all\"\n ? true\n : (selectedKeys as Set<Key>).has(key)\n : key === state.selectedKey();\n return (\n <option value={String(key)} selected={isSelected}>\n {textValue}\n </option>\n );\n }}\n </For>\n </select>\n <Show when={state.selectionMode() === \"multiple\" && stateProps.name}>\n <For\n each={\n state.selectedKeys() === \"all\"\n ? Array.from(state.collection()).map((item) => item.key)\n : Array.from(state.selectedKeys() as Set<Key>)\n }\n >\n {(key) => (\n <input\n type=\"hidden\"\n name={stateProps.name}\n form={ariaProps.form}\n value={String(key)}\n disabled={resolveDisabled()}\n />\n )}\n </For>\n </Show>\n <Show\n when={\n state.selectionMode() !== \"multiple\" && stateProps.name && state.selectedKey() != null\n }\n >\n <input\n type=\"hidden\"\n name={stateProps.name}\n form={ariaProps.form}\n value={String(state.selectedKey())}\n disabled={resolveDisabled()}\n />\n </Show>\n </div>\n </>\n );\n };\n const baseRootProps = () =>\n ({\n ...domProps(),\n ...cleanHoverProps(),\n ref: setRootRef,\n class: renderProps.class(),\n style: renderProps.style(),\n slot: local.slot,\n \"data-open\": isOpen() || undefined,\n \"data-disabled\": resolveDisabled() || undefined,\n \"data-required\": ariaProps.isRequired || undefined,\n \"data-invalid\": isInvalid() || undefined,\n \"data-hovered\": isHovered() || undefined,\n }) as JSX.HTMLAttributes<HTMLDivElement>;\n const RootContent = () => {\n const renderedRootChildren = <RootChildren />;\n const rootProps = () =>\n ({\n ...baseRootProps(),\n children: renderedRootChildren,\n }) as JSX.HTMLAttributes<HTMLDivElement>;\n\n return local.render ? (\n local.render(rootProps(), renderValues())\n ) : (\n <div {...baseRootProps()}>{renderedRootChildren}</div>\n );\n };\n\n return (\n <SelectContext.Provider\n value={\n {\n state,\n rootRef: () => rootRef ?? null,\n triggerRef: () => triggerRef,\n setTriggerRef,\n get triggerProps() {\n return triggerPropsWithValidation();\n },\n valueProps,\n labelProps,\n menuProps,\n get errorMessageProps() {\n return { id: errorMessageId };\n },\n get validation() {\n return validation();\n },\n isOpen,\n isFocused,\n isFocusVisible,\n isPressed,\n isDisabled: resolveDisabled,\n placeholder: ariaProps.placeholder,\n items: stateProps.items,\n autoFocus: !!ariaProps.autoFocus,\n } as SelectContextValue<unknown>\n }\n >\n <SelectStateContext.Provider value={state}>\n <FieldErrorContext.Provider value={fieldErrorContext}>\n <RootContent />\n </FieldErrorContext.Provider>\n </SelectStateContext.Provider>\n </SelectContext.Provider>\n );\n}\n\n/**\n * The trigger button for a select.\n */\nexport function SelectTrigger(props: SelectTriggerProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\", \"ref\"]);\n\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error(\"SelectTrigger must be used within a Select\");\n }\n const { isOpen, isFocused, isFocusVisible, isPressed, state } = context;\n let triggerRef: HTMLButtonElement | undefined;\n const setTriggerRef = (el: HTMLButtonElement) => {\n triggerRef = el;\n context.setTriggerRef(el);\n assignRef(local.ref, el);\n };\n\n createEffect(() => {\n if (context.autoFocus) {\n triggerRef?.focus();\n }\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n const renderValues = createMemo<SelectTriggerRenderProps>(() => ({\n isOpen: isOpen(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n isPressed: isPressed(),\n isDisabled: state.isDisabled,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-trigger\",\n },\n renderValues,\n );\n\n const cleanTriggerProps = () => {\n const { ref: _ref1, ...rest } = context.triggerProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const triggerAriaProps = () => context.triggerProps as Record<string, unknown>;\n const menuAriaProps = () => context.menuProps as Record<string, unknown>;\n return (\n <button\n ref={setTriggerRef}\n {...domProps}\n {...cleanTriggerProps()}\n {...cleanHoverProps()}\n type=\"button\"\n id={triggerAriaProps().id as string | undefined}\n tabIndex={state.isDisabled ? undefined : 0}\n aria-label={triggerAriaProps()[\"aria-label\"] as string | undefined}\n aria-labelledby={triggerAriaProps()[\"aria-labelledby\"] as string | undefined}\n aria-haspopup=\"listbox\"\n aria-expanded={isOpen()}\n aria-controls={isOpen() ? (menuAriaProps().id as string | undefined) : undefined}\n aria-disabled={state.isDisabled || undefined}\n aria-required={triggerAriaProps()[\"aria-required\"] as boolean | undefined}\n aria-describedby={triggerAriaProps()[\"aria-describedby\"] as string | undefined}\n class={renderProps.class()}\n style={renderProps.style()}\n data-open={isOpen() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={state.isDisabled || undefined}\n >\n {renderProps.renderChildren()}\n </button>\n );\n}\n\n// Default children function for SelectValue - defined at module level for SSR stability\nfunction defaultSelectValueChildren<T>(values: SelectValueRenderProps<T>) {\n return values.selectedText ?? values.placeholder ?? \"\";\n}\n\n/**\n * Displays the selected value in a select.\n */\nexport function SelectValue<T>(props: SelectValueProps<T>): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"placeholder\",\n \"children\",\n ]);\n\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error(\"SelectValue must be used within a Select\");\n }\n const { valueProps, placeholder: contextPlaceholder } = context;\n const state = context.state as SelectState<T>;\n\n const placeholder = () => local.placeholder ?? contextPlaceholder;\n\n const renderValues = createMemo<SelectValueRenderProps<T>>(() => {\n const collection = state.collection();\n const selectedItem =\n state.selectedKey() == null ? null : collection.getItem(state.selectedKey() as Key);\n const selectedKeys = state.selectedKeys();\n const selectedItems =\n selectedKeys === \"all\"\n ? Array.from(collection)\n : Array.from(selectedKeys as Set<Key>)\n .map((key) => collection.getItem(key))\n .filter((item): item is CollectionNode<T> => item != null);\n const selectedText =\n state.selectionMode() === \"multiple\"\n ? selectedItems.length > 0\n ? new Intl.ListFormat(undefined, { style: \"long\", type: \"conjunction\" }).format(\n selectedItems.map((item) => item.textValue),\n )\n : null\n : (selectedItem?.textValue ?? null);\n return {\n selectedItem,\n selectedItems,\n selectedText,\n isSelected:\n state.selectionMode() === \"multiple\" ? selectedItems.length > 0 : selectedItem != null,\n placeholder: placeholder(),\n };\n });\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children ?? defaultSelectValueChildren;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-value\",\n },\n renderValues,\n );\n\n return (\n <span\n {...domProps}\n {...valueProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-placeholder={!renderValues().isSelected || undefined}\n >\n {props.children == null\n ? (renderValues().selectedText ?? renderValues().placeholder ?? \"\")\n : renderProps.renderChildren()}\n </span>\n );\n}\n\n/**\n * The listbox popup for a select.\n */\nexport function SelectListBox<T>(props: SelectListBoxProps<T>): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"children\",\n \"renderEmptyState\",\n \"onLoadMore\",\n \"isLoading\",\n \"renderLoadMore\",\n \"loadMoreClass\",\n \"isInPopover\",\n ]);\n\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error(\"SelectListBox must be used within a Select\");\n }\n const { menuProps, rootRef, state: selectState, isOpen } = context;\n const state = selectState as SelectState<T>;\n\n createEffect(() => {\n if (!isOpen()) {\n return;\n }\n // On open the listbox takes collection focus. Upstream `useSelect` sets\n // `menuProps.autoFocus = state.focusStrategy || true`, so the ListBox's\n // `useSelectableCollection` auto-focuses on mount — setting the selection\n // manager's `isFocused` true and focusing the selected option. Our\n // `createListBox` reimplements keyboard nav inline (no `autoFocus` effect),\n // so we set the manager focus here to match. Without it the selected option\n // never paints its focus-visible background (`data-focused` stays unset).\n state.selectionManager.setFocused(true);\n if (state.focusedKey() != null) {\n return;\n }\n const selectedKey = state.selectedKey();\n if (selectedKey != null && !state.collection().getItem(selectedKey)?.isDisabled) {\n state.setFocusedKey(selectedKey);\n }\n });\n\n let listBoxRef: HTMLDivElement | undefined;\n\n createInteractOutside({\n ref: () => rootRef() ?? listBoxRef ?? null,\n onInteractOutside: () => {\n if (isOpen()) {\n state.close();\n }\n },\n get isDisabled() {\n return !isOpen() || local.isInPopover === true;\n },\n });\n\n // Keep the hook result intact — destructuring `{ listBoxProps }` invokes the\n // `get listBoxProps()` getter ONCE and freezes it (the Solid \"destructuring a\n // get-prop freezes reactivity\" gotcha). The listbox `tabIndex` is computed from\n // `focusedKey` (`focusedKey != null ? -1 : 0`); on open the effect above sets a\n // focused key, so a frozen snapshot would leave the listbox tabbable (`0`) when\n // upstream flips it to `-1`. Reading `listBoxHook.listBoxProps` per access keeps\n // it reactive.\n const listBoxHook = createListBox(\n {\n ...(menuProps as unknown as AriaListBoxProps),\n shouldSelectOnPressUp: true,\n shouldFocusOnHover: true,\n shouldSelectOnFocus: local.isInPopover === true ? false : undefined,\n get isDisabled() {\n return state.isDisabled;\n },\n },\n createSelectListStateAdapter(state),\n );\n\n const renderValues = createMemo<SelectListBoxRenderProps>(() => ({\n // Focus within the listbox itself (the selection manager's focus state),\n // not the select-level trigger focus.\n isFocused: state.selectionManager.isFocused,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-listbox\",\n },\n renderValues,\n );\n\n const cleanMenuProps = () => {\n const { ref: _ref1, ...rest } = menuProps as Record<string, unknown>;\n return rest;\n };\n const cleanListBoxProps = () => {\n const {\n ref: _ref2,\n \"aria-activedescendant\": _activeDescendant,\n onFocus: _onFocus,\n ...rest\n } = listBoxHook.listBoxProps as Record<string, unknown>;\n // Faithful Select listbox focus model: the focused option receives REAL DOM\n // focus (the open effect above + `createSelectableItem`'s self-focus move\n // `document.activeElement` onto it), mirroring upstream `useSelect`. So the\n // listbox must (a) leave the tab sequence once an option is focused —\n // `useSelectableCollection` uses `tabIndex = focusedKey == null ? 0 : -1`\n // (useSelectableCollection.ts:687-690) — and (b) NOT expose\n // `aria-activedescendant`, which is the virtual-focus channel upstream Select\n // never uses. These are overridden here, not in the shared `createListBox`,\n // because the standalone `ListBox` keeps its container-focus model (focus\n // stays on the listbox, `aria-activedescendant` is its AT channel).\n //\n // We also drop `createListBox`'s container-focus TRAMPOLINE (`onFocus`): it\n // marshals the first key when the container is focused with `focusedKey ==\n // null`, which is exactly Select's deliberate click-open state (the open\n // effect sets `isFocused` true but leaves `focusedKey` null when nothing is\n // selected, so the first arrow enters the first item). Upstream's own\n // trampoline no-ops in this case because it guards on `manager.isFocused`\n // (already true); our shared guard uses `focusedKey == null` for the\n // standalone ListBox, so we strip it here to preserve Select's faithful\n // model. (Auto-selecting on focus under replace behavior would also toggle\n // the first item selected on open — the bug this override prevents.)\n return {\n ...rest,\n tabIndex: state.isDisabled ? undefined : state.focusedKey() != null ? -1 : 0,\n };\n };\n\n const items = () => Array.from(state.collection());\n createEffect(() => {\n if (!isOpen()) return;\n const focusedKey = state.focusedKey();\n if (focusedKey == null) return;\n\n queueMicrotask(() => {\n const option = Array.from(\n listBoxRef?.querySelectorAll<HTMLElement>(\"[role='option']\") ?? [],\n ).find((element) => element.id === String(focusedKey));\n if (option && document.activeElement !== option) {\n focusSafely(option);\n }\n });\n });\n\n const listBox = () => (\n // Upstream RAC ListBox (and our own Menu.tsx) render a `<div role=\"listbox\">`\n // over `<div role=\"option\">` rows, NOT `<ul>`/`<li>` — the collection is\n // div-based for virtualization parity. `<ul>`/`<li>` here was a self-inflicted\n // structural divergence surfaced by the Picker recertification (D5/D6/D8 saw\n // `li[option]`/`ul[listbox]` where the React oracle sees `div`).\n <div\n ref={(el) => (listBoxRef = el)}\n {...domProps}\n {...cleanMenuProps()}\n {...cleanListBoxProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={state.selectionManager.isFocused || undefined}\n data-empty={state.collection().size === 0 || undefined}\n >\n {state.collection().size === 0 && local.renderEmptyState ? (\n <div role=\"option\" style={{ display: \"contents\" }} data-empty-state>\n {local.renderEmptyState()}\n </div>\n ) : (\n <Show\n when={local.children}\n fallback={\n <For each={items()}>\n {(node) => <SelectOption id={node.key}>{node.textValue}</SelectOption>}\n </For>\n }\n >\n <For each={items()}>\n {(node) => (node.value != null ? local.children!(node.value) : null)}\n </For>\n </Show>\n )}\n <Show when={local.onLoadMore}>\n <ListBoxLoadMoreItem\n onLoadMore={local.onLoadMore!}\n isLoading={local.isLoading}\n class={local.loadMoreClass}\n >\n {local.renderLoadMore?.()}\n </ListBoxLoadMoreItem>\n </Show>\n </div>\n );\n\n return (\n <Show when={isOpen()}>\n <Show\n when={local.isInPopover}\n fallback={\n <FocusScope restoreFocus autoFocus>\n {listBox()}\n </FocusScope>\n }\n >\n {listBox()}\n </Show>\n </Show>\n );\n}\n\n/**\n * An option in a select listbox.\n */\nexport function SelectOption<T>(props: SelectOptionProps<T>): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"id\",\n \"item\",\n \"textValue\",\n \"ref\",\n ]);\n\n const context = useContext(SelectStateContext);\n if (!context) {\n throw new Error(\"SelectOption must be used within a Select\");\n }\n const state = context as SelectState<T>;\n const selectContext = useContext(SelectContext) as SelectContextValue<T> | null;\n const [ref, setRefSignal] = createSignal<HTMLDivElement | null>(null);\n const setRef = (el: HTMLDivElement | null) => {\n setRefSignal(el);\n assignRef(local.ref, el as HTMLDivElement);\n };\n\n const optionAria = createOption<T>(\n {\n key: local.id,\n get isDisabled() {\n return Boolean(ariaProps.isDisabled || selectContext?.isDisabled());\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"] ?? local.textValue;\n },\n shouldSelectOnPressUp: true,\n shouldFocusOnHover: true,\n get onHoverStart() {\n return ariaProps.onHoverStart;\n },\n get onHoverEnd() {\n return ariaProps.onHoverEnd;\n },\n get onHoverChange() {\n return ariaProps.onHoverChange;\n },\n },\n {\n ...createSelectListStateAdapter(state),\n select: (key: Key) => {\n if (state.selectionMode() === \"multiple\") {\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n state.setSelectedKeys(new Set([...keys, key]));\n return;\n }\n state.setSelectedKey(key);\n state.close();\n },\n toggleSelection: (key: Key) => {\n if (state.selectionMode() === \"multiple\") {\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n const next = new Set(keys);\n if (next.has(key)) next.delete(key);\n else next.add(key);\n state.setSelectedKeys(next);\n return;\n }\n state.setSelectedKey(key);\n state.close();\n },\n replaceSelection: (key: Key) => {\n state.setSelectedKey(key);\n if (state.selectionMode() !== \"multiple\") {\n state.close();\n }\n },\n },\n () => ref(),\n );\n const isOptionFocusVisible = () =>\n optionAria.isFocused() && (selectContext?.isFocusVisible() ?? optionAria.isFocusVisible());\n\n const renderValues = createMemo<SelectOptionRenderProps>(() => ({\n isSelected: optionAria.isSelected(),\n isFocused: optionAria.isFocused(),\n isFocusVisible: isOptionFocusVisible(),\n isPressed: optionAria.isPressed(),\n isHovered: optionAria.isHovered(),\n isDisabled: optionAria.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-option\",\n },\n renderValues,\n );\n const hasPrimitiveLabel = () => {\n return typeof props.children === \"string\" || typeof props.children === \"number\";\n };\n\n const selectionIndicatorContext = createMemo<SelectionIndicatorContextValue>(() => ({\n isSelected: optionAria.isSelected,\n }));\n\n const cleanOptionProps = () => {\n const {\n ref: _ref1,\n \"aria-describedby\": _ariaDescribedby,\n ...rest\n } = optionAria.optionProps as Record<string, unknown>;\n if (!hasPrimitiveLabel() && rest[\"aria-label\"] == null) {\n delete rest[\"aria-labelledby\"];\n }\n const onClick = rest.onClick as ((event: MouseEvent) => void) | undefined;\n rest.onClick = ((event: MouseEvent) => {\n const wasSelected = optionAria.isSelected();\n onClick?.(event);\n if (typeof PointerEvent === \"undefined\") {\n return;\n }\n queueMicrotask(() => {\n if (state.selectionMode() !== \"multiple\" || optionAria.isSelected() === wasSelected) {\n selectOption();\n }\n });\n }) as JSX.EventHandler<HTMLDivElement, MouseEvent>;\n return rest;\n };\n const selectOption = () => {\n if (optionAria.isDisabled()) {\n return;\n }\n if (state.selectionMode() === \"multiple\") {\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n const next = new Set(keys);\n if (next.has(local.id)) next.delete(local.id);\n else next.add(local.id);\n state.setSelectedKeys(next);\n return;\n }\n state.setSelectedKey(local.id);\n state.close();\n };\n\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n {/* `<div role=\"option\">`, not `<li>` — see the SelectListBox note; upstream\n RAC options are div-based. */}\n <div\n ref={setRef}\n {...cleanOptionProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={optionAria.isSelected() || undefined}\n data-focused={optionAria.isFocused() || undefined}\n data-focus-visible={isOptionFocusVisible() || undefined}\n data-pressed={optionAria.isPressed() || undefined}\n data-hovered={optionAria.isHovered() || undefined}\n data-disabled={optionAria.isDisabled() || undefined}\n >\n {hasPrimitiveLabel() ? (\n <span {...optionAria.labelProps}>{renderProps.renderChildren()}</span>\n ) : (\n renderProps.renderChildren()\n )}\n </div>\n </SelectionIndicatorContext.Provider>\n );\n}\n\nfunction isObjectRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n\nfunction toKey(value: unknown): Key | undefined {\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value;\n }\n return undefined;\n}\n\nfunction toTextValue(value: unknown): string | undefined {\n if (typeof value === \"string\" || typeof value === \"number\") {\n return String(value);\n }\n return undefined;\n}\n\nfunction createSelectListStateAdapter<T>(state: SelectState<T>): ListState<T> {\n const selectedKeys = createMemo(() => {\n const keys = state.selectedKeys();\n return keys === \"all\" ? new Set(Array.from(state.collection()).map((item) => item.key)) : keys;\n });\n\n const disabledKeys = createMemo(() => {\n const keys = new Set<Key>();\n for (const node of state.collection()) {\n if (node.isDisabled) keys.add(node.key);\n }\n return keys;\n });\n\n return {\n collection: state.collection,\n selectionManager: state.selectionManager,\n // Collection-level focus (the selection manager's), not the select-level\n // trigger focus — upstream listbox internals only ever read\n // state.selectionManager.isFocused.\n isFocused: () => state.selectionManager.isFocused,\n setFocused: (isFocused) => state.selectionManager.setFocused(isFocused),\n focusedKey: state.focusedKey,\n setFocusedKey: (key) => state.setFocusedKey(key ?? null),\n childFocusStrategy: () => null,\n selectionMode: () => state.selectionMode(),\n selectionBehavior: () => \"replace\",\n disallowEmptySelection: () => true,\n selectedKeys,\n disabledKeys,\n disabledBehavior: () => \"all\",\n isEmpty: () => selectedKeys().size === 0,\n isSelectAll: () => state.selectedKeys() === \"all\",\n isSelected: (key) => selectedKeys().has(key),\n isDisabled: state.isKeyDisabled,\n setSelectionBehavior: () => {},\n toggleSelection: (key) => {\n if (state.selectionMode() !== \"multiple\") {\n state.setSelectedKey(key);\n return;\n }\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n const next = new Set(keys);\n if (next.has(key)) next.delete(key);\n else next.add(key);\n state.setSelectedKeys(next);\n },\n replaceSelection: (key) => state.setSelectedKey(key),\n setSelectedKeys: (keys) => state.setSelectedKeys(keys),\n selectAll: () => {},\n clearSelection: () =>\n state.selectionMode() === \"multiple\" ? state.setSelectedKeys([]) : state.setSelectedKey(null),\n toggleSelectAll: () => {},\n extendSelection: (toKey) => state.setSelectedKey(toKey),\n select: (key) =>\n state.selectionMode() === \"multiple\"\n ? state.setSelectedKeys([\n ...(state.selectedKeys() === \"all\" ? [] : (state.selectedKeys() as Set<Key>)),\n key,\n ])\n : state.setSelectedKey(key),\n };\n}\n\nSelect.Trigger = SelectTrigger;\nSelect.Value = SelectValue;\nSelect.ListBox = SelectListBox;\nSelect.Option = SelectOption;\n"],"mappings":";;;;;;;;;;;;;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gBAAgB,CAAC,CAAC,IAAI,MAAM,eAAe,IAAI;EAC9F,uBAAuB,CAAC;EACxB,kBAAkB,UAAU,MAAM,eAAe,KAAK;EACtD,SAAS,QACP,MAAM,cAAc,MAAM,aACtB,MAAM,gBAAgB,CACpB,GAAI,MAAM,aAAa,MAAM,QAAQ,CAAC,IAAK,MAAM,aAAa,GAC9D,GACF,CAAC,IACD,MAAM,eAAe,GAAG;CAChC;AACF;AAEA,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,SAAS"}
|
package/dist/Separator.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { filterDOMProps } from "./utils.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ElementTag } from "./ElementTag.js";
|
|
3
|
+
import { createComponent, mergeProps } from "solid-js/web";
|
|
3
4
|
import { createContext, createMemo, splitProps } from "solid-js";
|
|
4
5
|
import { createSeparator } from "@proyecto-viviana/solidaria";
|
|
5
6
|
//#region src/Separator.tsx
|
|
@@ -76,7 +77,7 @@ function Separator(props) {
|
|
|
76
77
|
if (typeof style === "function") return style(renderValues());
|
|
77
78
|
return style;
|
|
78
79
|
});
|
|
79
|
-
return createComponent(
|
|
80
|
+
return createComponent(ElementTag, mergeProps({ get tag() {
|
|
80
81
|
return elementType();
|
|
81
82
|
} }, createMemo(() => filterDOMProps(ariaProps, { global: true })), () => separatorAria.separatorProps, {
|
|
82
83
|
ref: (el) => assignRef(local.ref, el),
|
package/dist/Separator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Separator.js","names":["JSX","createContext","createMemo","splitProps","
|
|
1
|
+
{"version":3,"file":"Separator.js","names":["JSX","createContext","createMemo","splitProps","ElementTag","createSeparator","AriaSeparatorProps","Orientation","SlotProps","filterDOMProps","RefLike","el","T","current","assignRef","ref","SeparatorRenderProps","orientation","SeparatorProps","class","renderProps","style","CSSProperties","HTMLElement","SeparatorContext","Separator","props","Element","local","ariaProps","elementType","element","separatorAria","aria-label","aria-labelledby","aria-describedby","aria-details","id","renderValues","resolvedClass","cls","resolvedStyle","domProps","global","_$createComponent","_$mergeProps","tag","separatorProps","slot"],"sources":["../src/Separator.tsx"],"sourcesContent":["/**\n * Separator component for solidaria-components\n *\n * Pre-wired headless separator component that combines aria hooks.\n * Port of react-aria-components/src/Separator.tsx\n */\n\nimport { type JSX, createContext, createMemo, splitProps } from \"solid-js\";\nimport { ElementTag } from \"./ElementTag\";\nimport {\n createSeparator,\n type AriaSeparatorProps,\n type Orientation,\n} from \"@proyecto-viviana/solidaria\";\nimport { type SlotProps, filterDOMProps } from \"./utils\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface SeparatorRenderProps {\n /** The orientation of the separator. */\n orientation: Orientation;\n}\n\nexport interface SeparatorProps extends AriaSeparatorProps, SlotProps {\n /** The CSS className for the element. A function may be provided to receive render props. */\n class?: string | ((renderProps: SeparatorRenderProps) => string);\n /** The inline style for the element. A function may be provided to receive render props. */\n style?: JSX.CSSProperties | ((renderProps: SeparatorRenderProps) => JSX.CSSProperties);\n /** Ref for the underlying separator element. */\n ref?: RefLike<HTMLElement>;\n}\n\nexport const SeparatorContext = createContext<SeparatorProps | null>(null);\n\n/**\n * A separator is a visual divider between two groups of content,\n * e.g. groups of menu items or sections of a page.\n *\n * @example\n * ```tsx\n * <Separator />\n *\n * // Vertical separator\n * <Separator orientation=\"vertical\" />\n *\n * // Custom element type\n * <Separator elementType=\"div\" />\n * ```\n */\nexport function Separator(props: SeparatorProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"ref\", \"slot\"]);\n\n const elementType = createMemo(() => {\n let element = ariaProps.elementType || \"hr\";\n // If vertical and using hr, switch to div since hr is inherently horizontal\n if (element === \"hr\" && ariaProps.orientation === \"vertical\") {\n element = \"div\";\n }\n return element;\n });\n\n const separatorAria = createSeparator({\n get orientation() {\n return ariaProps.orientation;\n },\n get elementType() {\n return ariaProps.elementType;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return ariaProps[\"aria-details\"];\n },\n get id() {\n return ariaProps.id;\n },\n });\n\n const renderValues = createMemo<SeparatorRenderProps>(() => ({\n orientation: ariaProps.orientation ?? \"horizontal\",\n }));\n\n const resolvedClass = createMemo(() => {\n const cls = local.class;\n if (typeof cls === \"function\") {\n return cls(renderValues());\n }\n return cls ?? \"solidaria-Separator\";\n });\n\n const resolvedStyle = createMemo(() => {\n const style = local.style;\n if (typeof style === \"function\") {\n return style(renderValues());\n }\n return style;\n });\n\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n return (\n <ElementTag\n tag={elementType()}\n {...domProps()}\n {...separatorAria.separatorProps}\n ref={(el: HTMLElement) => assignRef(local.ref, el)}\n class={resolvedClass()}\n style={resolvedStyle()}\n slot={local.slot}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAASc,UAAaC,KAAiBJ,IAAa;CAClD,IAAI,CAACI,KAAK;CACV,IAAI,OAAOA,QAAQ,YACjBA,IAAIJ,EAAE;MAENI,IAAIF,UAAUF;AAElB;AAgBA,MAAaa,mBAAmBvB,cAAqC,IAAI;;;;;;;;;;;;;;;;AAiBzE,SAAgBwB,UAAUC,OAAoC;CAC5D,MAAM,CAACE,OAAOC,aAAa1B,WAAWuB,OAAO;EAAC;EAAS;EAAS;EAAO;CAAM,CAAC;CAE9E,MAAMI,cAAc5B,iBAAiB;EACnC,IAAI6B,UAAUF,UAAUC,eAAe;EAEvC,IAAIC,YAAY,QAAQF,UAAUZ,gBAAgB,YAChDc,UAAU;EAEZ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2
|
+
import { ElementTag } from "./ElementTag.jsx";
|
|
2
3
|
import { createContext, createMemo, splitProps } from "solid-js";
|
|
3
|
-
import { Dynamic } from "solid-js/web";
|
|
4
4
|
import { createSeparator } from "@proyecto-viviana/solidaria";
|
|
5
5
|
//#region src/Separator.tsx
|
|
6
6
|
/**
|
|
@@ -77,7 +77,7 @@ function Separator(props) {
|
|
|
77
77
|
return style;
|
|
78
78
|
});
|
|
79
79
|
const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));
|
|
80
|
-
return <
|
|
80
|
+
return <ElementTag tag={elementType()} {...domProps()} {...separatorAria.separatorProps} ref={(el) => assignRef(local.ref, el)} class={resolvedClass()} style={resolvedStyle()} slot={local.slot} />;
|
|
81
81
|
}
|
|
82
82
|
//#endregion
|
|
83
83
|
export { Separator, SeparatorContext };
|
package/dist/Separator.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Separator.jsx","names":[],"sources":["../src/Separator.tsx"],"sourcesContent":["/**\n * Separator component for solidaria-components\n *\n * Pre-wired headless separator component that combines aria hooks.\n * Port of react-aria-components/src/Separator.tsx\n */\n\nimport { type JSX, createContext, createMemo, splitProps } from \"solid-js\";\nimport {
|
|
1
|
+
{"version":3,"file":"Separator.jsx","names":[],"sources":["../src/Separator.tsx"],"sourcesContent":["/**\n * Separator component for solidaria-components\n *\n * Pre-wired headless separator component that combines aria hooks.\n * Port of react-aria-components/src/Separator.tsx\n */\n\nimport { type JSX, createContext, createMemo, splitProps } from \"solid-js\";\nimport { ElementTag } from \"./ElementTag\";\nimport {\n createSeparator,\n type AriaSeparatorProps,\n type Orientation,\n} from \"@proyecto-viviana/solidaria\";\nimport { type SlotProps, filterDOMProps } from \"./utils\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface SeparatorRenderProps {\n /** The orientation of the separator. */\n orientation: Orientation;\n}\n\nexport interface SeparatorProps extends AriaSeparatorProps, SlotProps {\n /** The CSS className for the element. A function may be provided to receive render props. */\n class?: string | ((renderProps: SeparatorRenderProps) => string);\n /** The inline style for the element. A function may be provided to receive render props. */\n style?: JSX.CSSProperties | ((renderProps: SeparatorRenderProps) => JSX.CSSProperties);\n /** Ref for the underlying separator element. */\n ref?: RefLike<HTMLElement>;\n}\n\nexport const SeparatorContext = createContext<SeparatorProps | null>(null);\n\n/**\n * A separator is a visual divider between two groups of content,\n * e.g. groups of menu items or sections of a page.\n *\n * @example\n * ```tsx\n * <Separator />\n *\n * // Vertical separator\n * <Separator orientation=\"vertical\" />\n *\n * // Custom element type\n * <Separator elementType=\"div\" />\n * ```\n */\nexport function Separator(props: SeparatorProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"ref\", \"slot\"]);\n\n const elementType = createMemo(() => {\n let element = ariaProps.elementType || \"hr\";\n // If vertical and using hr, switch to div since hr is inherently horizontal\n if (element === \"hr\" && ariaProps.orientation === \"vertical\") {\n element = \"div\";\n }\n return element;\n });\n\n const separatorAria = createSeparator({\n get orientation() {\n return ariaProps.orientation;\n },\n get elementType() {\n return ariaProps.elementType;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return ariaProps[\"aria-details\"];\n },\n get id() {\n return ariaProps.id;\n },\n });\n\n const renderValues = createMemo<SeparatorRenderProps>(() => ({\n orientation: ariaProps.orientation ?? \"horizontal\",\n }));\n\n const resolvedClass = createMemo(() => {\n const cls = local.class;\n if (typeof cls === \"function\") {\n return cls(renderValues());\n }\n return cls ?? \"solidaria-Separator\";\n });\n\n const resolvedStyle = createMemo(() => {\n const style = local.style;\n if (typeof style === \"function\") {\n return style(renderValues());\n }\n return style;\n });\n\n const domProps = createMemo(() => filterDOMProps(ariaProps, { global: true }));\n\n return (\n <ElementTag\n tag={elementType()}\n {...domProps()}\n {...separatorAria.separatorProps}\n ref={(el: HTMLElement) => assignRef(local.ref, el)}\n class={resolvedClass()}\n style={resolvedStyle()}\n slot={local.slot}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;AAkBA,SAAS,UAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KAAK;CACV,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AAgBA,MAAa,mBAAmB,cAAqC,IAAI;;;;;;;;;;;;;;;;AAiBzE,SAAgB,UAAU,OAAoC;CAC5D,MAAM,CAAC,OAAO,aAAa,WAAW,OAAO;EAAC;EAAS;EAAS;EAAO;CAAM,CAAC;CAE9E,MAAM,cAAc,iBAAiB;EACnC,IAAI,UAAU,UAAU,eAAe;EAEvC,IAAI,YAAY,QAAQ,UAAU,gBAAgB,YAChD,UAAU;EAEZ,OAAO;CACT,CAAC;CAED,MAAM,gBAAgB,gBAAgB;EACpC,IAAI,cAAc;GAChB,OAAO,UAAU;EACnB;EACA,IAAI,cAAc;GAChB,OAAO,UAAU;EACnB;EACA,IAAI,eAAe;GACjB,OAAO,UAAU;EACnB;EACA,IAAI,oBAAoB;GACtB,OAAO,UAAU;EACnB;EACA,IAAI,qBAAqB;GACvB,OAAO,UAAU;EACnB;EACA,IAAI,iBAAiB;GACnB,OAAO,UAAU;EACnB;EACA,IAAI,KAAK;GACP,OAAO,UAAU;EACnB;CACF,CAAC;CAED,MAAM,eAAe,kBAAwC,EAC3D,aAAa,UAAU,eAAe,aACxC,EAAE;CAEF,MAAM,gBAAgB,iBAAiB;EACrC,MAAM,MAAM,MAAM;EAClB,IAAI,OAAO,QAAQ,YACjB,OAAO,IAAI,aAAa,CAAC;EAE3B,OAAO,OAAO;CAChB,CAAC;CAED,MAAM,gBAAgB,iBAAiB;EACrC,MAAM,QAAQ,MAAM;EACpB,IAAI,OAAO,UAAU,YACnB,OAAO,MAAM,aAAa,CAAC;EAE7B,OAAO;CACT,CAAC;CAED,MAAM,WAAW,iBAAiB,eAAe,WAAW,EAAE,QAAQ,KAAK,CAAC,CAAC;CAE7E,OACE,CAAC,WACC,KAAK,YAAY,OACb,SAAS,OACT,cAAc,gBAClB,MAAM,OAAoB,UAAU,MAAM,KAAK,EAAE,GACjD,OAAO,cAAc,GACrB,OAAO,cAAc,GACrB,MAAM,MAAM;AAGlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SharedElementTransition.d.ts","sourceRoot":"","sources":["../src/SharedElementTransition.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"SharedElementTransition.d.ts","sourceRoot":"","sources":["../src/SharedElementTransition.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,KAAK,GAAG,EAYT,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EAGpB,MAAM,SAAS,CAAC;AAoBjB,wBAAgB,kCAAkC,IAAI,OAAO,CAE5D;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,GAAG,GAAG,CAAC,OAAO,CAQxF;AAED,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAClD,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC,EAClC,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CACvC;IACC,QAAQ,CAAC,EAAE,cAAc,CAAC,wBAAwB,CAAC,CAAC;IACpD,KAAK,CAAC,EAAE,mBAAmB,CAAC,wBAAwB,CAAC,CAAC;IACtD,KAAK,CAAC,EAAE,eAAe,CAAC,wBAAwB,CAAC,CAAC;CACnD;AAED,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,cAAc,KAAK,IAAI,CAAC,GAAG;QAAE,OAAO,CAAC,EAAE,cAAc,CAAA;KAAE,CAAC;CACrE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAkO3E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { filterDOMProps, useRenderProps } from "./utils.js";
|
|
2
2
|
import { createComponent, getNextElement, insert, mergeProps, runHydrationEvents, spread, template, use } from "solid-js/web";
|
|
3
|
-
import { Show, createContext, createEffect, createMemo, createSignal, on, onCleanup, splitProps, useContext } from "solid-js";
|
|
3
|
+
import { Show, createContext, createEffect, createMemo, createRenderEffect, createSignal, on, onCleanup, splitProps, untrack, useContext } from "solid-js";
|
|
4
4
|
//#region src/SharedElementTransition.tsx
|
|
5
5
|
/**
|
|
6
6
|
* SharedElementTransition primitives for solidaria-components.
|
|
@@ -47,41 +47,61 @@ function SharedElement(props) {
|
|
|
47
47
|
"ref"
|
|
48
48
|
]);
|
|
49
49
|
const [lifecycle, setLifecycle] = createSignal(local.isVisible === false ? "hidden" : "visible");
|
|
50
|
-
|
|
50
|
+
const [element, setElement] = createSignal();
|
|
51
51
|
let frame;
|
|
52
52
|
const setRef = (el) => {
|
|
53
|
-
|
|
53
|
+
setElement(el);
|
|
54
54
|
const userRef = local.ref;
|
|
55
55
|
if (typeof userRef === "function") userRef(el);
|
|
56
56
|
else if (userRef !== void 0) userRef.current = el;
|
|
57
57
|
};
|
|
58
|
-
|
|
58
|
+
const storeSnapshot = () => {
|
|
59
|
+
const el = untrack(element);
|
|
60
|
+
if (el && el.isConnected && !el.hasAttribute("data-exiting")) {
|
|
61
|
+
const style = window.getComputedStyle(el);
|
|
62
|
+
if (style.transitionProperty !== "none") {
|
|
63
|
+
const transitionProperty = style.transitionProperty.split(/\s*,\s*/);
|
|
64
|
+
scope.snapshots[local.name] = {
|
|
65
|
+
rect: el.getBoundingClientRect(),
|
|
66
|
+
style: transitionProperty.map((property) => [property, style.getPropertyValue(property)])
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
createRenderEffect(on(() => local.isVisible !== false, (isVisible) => {
|
|
72
|
+
if (isVisible && untrack(lifecycle) === "hidden") setLifecycle("visible");
|
|
73
|
+
}));
|
|
74
|
+
createRenderEffect(on(() => local.isVisible !== false, (isVisible) => {
|
|
75
|
+
onCleanup(() => {
|
|
76
|
+
if (isVisible) storeSnapshot();
|
|
77
|
+
});
|
|
78
|
+
}));
|
|
79
|
+
createEffect(on([() => local.isVisible !== false, element], ([isVisible, el]) => {
|
|
59
80
|
const name = local.name;
|
|
60
|
-
const element = elementRef;
|
|
61
81
|
if (frame != null) {
|
|
62
82
|
cancelAnimationFrame(frame);
|
|
63
83
|
frame = void 0;
|
|
64
84
|
}
|
|
65
|
-
if (isVisible &&
|
|
85
|
+
if (isVisible && el) {
|
|
66
86
|
const prevSnapshot = scope.snapshots[name];
|
|
67
87
|
if (prevSnapshot) {
|
|
68
88
|
setLifecycle("visible");
|
|
69
|
-
const animations = getAnimations(
|
|
89
|
+
const animations = getAnimations(el);
|
|
70
90
|
const values = prevSnapshot.style.map(([property, prevValue]) => {
|
|
71
|
-
const value =
|
|
91
|
+
const value = el.style.getPropertyValue(property);
|
|
72
92
|
if (property === "translate") {
|
|
73
93
|
const prevRect = prevSnapshot.rect;
|
|
74
|
-
const currentRect =
|
|
94
|
+
const currentRect = el.getBoundingClientRect();
|
|
75
95
|
const deltaX = prevRect.left - currentRect.left;
|
|
76
96
|
const deltaY = prevRect.top - currentRect.top;
|
|
77
|
-
|
|
78
|
-
} else
|
|
97
|
+
el.style.setProperty("translate", `${deltaX}px ${deltaY}px`);
|
|
98
|
+
} else el.style.setProperty(property, prevValue);
|
|
79
99
|
return [property, value];
|
|
80
100
|
});
|
|
81
|
-
for (const a of getAnimations(
|
|
101
|
+
for (const a of getAnimations(el)) if (!animations.includes(a)) a.cancel();
|
|
82
102
|
frame = requestAnimationFrame(() => {
|
|
83
103
|
frame = void 0;
|
|
84
|
-
for (const [property, value] of values)
|
|
104
|
+
for (const [property, value] of values) el.style.setProperty(property, value);
|
|
85
105
|
});
|
|
86
106
|
delete scope.snapshots[name];
|
|
87
107
|
} else {
|
|
@@ -91,34 +111,16 @@ function SharedElement(props) {
|
|
|
91
111
|
setLifecycle("visible");
|
|
92
112
|
});
|
|
93
113
|
}
|
|
94
|
-
} else if (!isVisible &&
|
|
114
|
+
} else if (!isVisible && el) queueMicrotask(() => {
|
|
95
115
|
if (scope.snapshots[name]) {
|
|
96
116
|
delete scope.snapshots[name];
|
|
97
117
|
setLifecycle("exiting");
|
|
98
|
-
Promise.all(getAnimations(
|
|
118
|
+
Promise.all(getAnimations(el).map((a) => a.finished)).then(() => setLifecycle("hidden")).catch(() => {});
|
|
99
119
|
} else setLifecycle("hidden");
|
|
100
120
|
});
|
|
101
|
-
else if (isVisible) {
|
|
102
|
-
setLifecycle("entering");
|
|
103
|
-
frame = requestAnimationFrame(() => {
|
|
104
|
-
frame = void 0;
|
|
105
|
-
setLifecycle("visible");
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
121
|
}));
|
|
109
122
|
onCleanup(() => {
|
|
110
123
|
if (frame != null) cancelAnimationFrame(frame);
|
|
111
|
-
const element = elementRef;
|
|
112
|
-
if (element && element.isConnected && !element.hasAttribute("data-exiting")) {
|
|
113
|
-
const style = window.getComputedStyle(element);
|
|
114
|
-
if (style.transitionProperty !== "none") {
|
|
115
|
-
const transitionProperty = style.transitionProperty.split(/\s*,\s*/);
|
|
116
|
-
scope.snapshots[local.name] = {
|
|
117
|
-
rect: element.getBoundingClientRect(),
|
|
118
|
-
style: transitionProperty.map((property) => [property, style.getPropertyValue(property)])
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
124
|
});
|
|
123
125
|
const renderProps = useRenderProps({
|
|
124
126
|
get children() {
|