@proyecto-viviana/solidaria-components 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +15 -16
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/Breadcrumbs.jsx +19 -24
- 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/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/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 +62 -49
- package/dist/Select.js.map +1 -1
- package/dist/Select.jsx +33 -18
- package/dist/Select.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/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/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -6
- package/dist/index.jsx +5 -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 +55 -38
- 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/GridList.tsx +8 -2
- 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 +101 -20
- 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/TextField.tsx +1 -1
- package/src/TimeField.tsx +113 -196
- package/src/Tree.tsx +14 -4
- package/src/index.ts +1 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangeCalendar.jsx","names":[],"sources":["../src/RangeCalendar.tsx"],"sourcesContent":["/**\n * RangeCalendar component for solidaria-components\n *\n * Pre-wired headless range calendar component that combines aria hooks.\n * Port of react-aria-components/src/RangeCalendar.tsx\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n For,\n Index,\n Show,\n} from \"solid-js\";\nimport {\n createRangeCalendar,\n createCalendarGrid,\n createRangeCalendarCell,\n createHover,\n type AriaRangeCalendarProps,\n type AriaCalendarGridProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createRangeCalendarState,\n type RangeCalendarState,\n type RangeCalendarStateProps,\n type CalendarDate,\n type DateValue,\n type RangeValue,\n endOfMonth,\n isSameMonth,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n useIsHydrated,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface RangeCalendarRenderProps {\n /** Whether the calendar is disabled. */\n isDisabled: boolean;\n /** Whether the calendar is read-only. */\n isReadOnly: boolean;\n /** Whether the current selection is invalid. */\n isInvalid: boolean;\n /** Whether the user is currently selecting a range. */\n isDragging: boolean;\n}\n\nexport interface RangeCalendarProps<T extends DateValue = DateValue>\n extends\n Omit<AriaRangeCalendarProps, \"id\" | \"isDisabled\" | \"isReadOnly\">,\n Omit<RangeCalendarStateProps<T>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n /** Ref for the range calendar root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface RangeCalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface RangeCalendarGridProps\n extends Omit<AriaCalendarGridProps, \"startDate\" | \"endDate\">, SlotProps {\n /** The children of the component (render function receiving dates). */\n children?: (date: CalendarDate) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarGridRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarGridRenderProps>;\n /** Class name for weekday header cells. */\n headerCellClass?: string;\n /** Inline style for weekday header cells. */\n headerCellStyle?: JSX.CSSProperties;\n /** Number of months to offset from the start. */\n offset?: { months?: number };\n}\n\nexport interface RangeCalendarCellRenderProps {\n /** Whether the cell is within the selected range. */\n isSelected: boolean;\n /** Whether the cell is the start of the selection. */\n isSelectionStart: boolean;\n /** Whether the cell is the end of the selection. */\n isSelectionEnd: boolean;\n /** Whether the cell is focused. */\n isFocused: boolean;\n /** Whether the cell is disabled. */\n isDisabled: boolean;\n /** Whether the cell is unavailable. */\n isUnavailable: boolean;\n /** Whether the cell is part of an invalid selection. */\n isInvalid: boolean;\n /** Whether the cell is outside the visible month. */\n isOutsideMonth: boolean;\n /** Whether the cell represents today. */\n isToday: boolean;\n /** Whether the cell is pressed. */\n isPressed: boolean;\n /** Whether the cell is hovered. */\n isHovered: boolean;\n /** Whether the cell is the first day slot in its row. */\n isFirstChild: boolean;\n /** Whether the cell is the last day slot in its row. */\n isLastChild: boolean;\n /** Whether the cell is in the first rendered week row. */\n isFirstWeek: boolean;\n /** Whether the cell is in the last rendered week row. */\n isLastWeek: boolean;\n /** The formatted date string. */\n formattedDate: string;\n}\n\nexport interface RangeCalendarCellProps extends SlotProps {\n /** The date for this cell. */\n date: CalendarDate;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<RangeCalendarCellRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarCellRenderProps>;\n /** Class name for the table cell wrapper. */\n cellClass?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** Inline style for the table cell wrapper. */\n cellStyle?: StyleOrFunction<RangeCalendarCellRenderProps>;\n}\n\nexport const RangeCalendarContext = createContext<RangeCalendarState<DateValue> | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState<DateValue> | null>(null);\nconst RangeCalendarGridMonthContext = createContext<Accessor<CalendarDate> | null>(null);\nconst RangeCalendarGridCellPositionContext = createContext<Accessor<{\n weekIndex: number;\n dayIndex: number;\n lastWeekIndex: number;\n}> | null>(null);\n\nexport function useRangeCalendarContext(): RangeCalendarState<DateValue> {\n const context = useContext(RangeCalendarContext);\n if (!context) {\n throw new Error(\"RangeCalendar components must be used within a RangeCalendar\");\n }\n return context;\n}\n\n/**\n * A range calendar displays a grid of days and allows users to select a contiguous range of dates.\n *\n * @example\n * ```tsx\n * <RangeCalendar aria-label=\"Date range\">\n * <header>\n * <RangeCalendarButton slot=\"previous\">◀</RangeCalendarButton>\n * <RangeCalendarHeading />\n * <RangeCalendarButton slot=\"next\">▶</RangeCalendarButton>\n * </header>\n * <RangeCalendarGrid>\n * {(date) => <RangeCalendarCell date={date} />}\n * </RangeCalendarGrid>\n * </RangeCalendar>\n * ```\n */\nexport function RangeCalendar<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n // Use hydration-safe pattern for client-only rendering\n const isHydrated = useIsHydrated();\n\n return (\n <Show\n when={isHydrated()}\n fallback={\n <div\n class=\"solidaria-RangeCalendar solidaria-RangeCalendar--placeholder\"\n aria-hidden=\"true\"\n />\n }\n >\n <RangeCalendarInner {...props} />\n </Show>\n );\n}\n\n/**\n * Internal RangeCalendar component that renders after client mount.\n */\nfunction RangeCalendarInner<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = createRangeCalendarState(stateProps);\n\n const calendarAria = createRangeCalendar(rest, state as unknown as RangeCalendarState<DateValue>);\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isInvalid: state.isValueInvalid(),\n isDragging: state.isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext.Provider value={state as unknown as RangeCalendarState<DateValue>}>\n <RangeCalendarContext.Provider value={state as unknown as RangeCalendarState<DateValue>}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => assignRef(local.ref, el)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n data-dragging={dataAttr(state.isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n </div>\n </RangeCalendarContext.Provider>\n </RangeCalendarStateContext.Provider>\n );\n}\n\nexport interface RangeCalendarHeadingProps extends SlotProps {\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\n/**\n * Displays the current month and year in the range calendar.\n */\nexport function RangeCalendarHeading(props: RangeCalendarHeadingProps): JSX.Element {\n const state = useRangeCalendarContext();\n\n return (\n <h2\n class={props.class ?? \"solidaria-RangeCalendarHeading\"}\n style={props.style}\n aria-live=\"polite\"\n >\n {state.title()}\n </h2>\n );\n}\n\nexport interface RangeCalendarButtonProps extends SlotProps {\n /** The slot for this button (previous or next). */\n slot?: \"previous\" | \"next\";\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n /** Whether the button is disabled. */\n isDisabled?: boolean;\n}\n\n/**\n * A button for navigating the range calendar.\n */\nexport function RangeCalendarButton(props: RangeCalendarButtonProps): JSX.Element {\n const state = useRangeCalendarContext();\n const calendarAria = createRangeCalendar({}, state);\n\n const buttonProps = createMemo(() => {\n if (props.slot === \"previous\") {\n return calendarAria.prevButtonProps;\n }\n return calendarAria.nextButtonProps;\n });\n const isDisabled = createMemo(\n () => props.isDisabled || Boolean(buttonProps().disabled) || state.isDisabled(),\n );\n\n return (\n <button\n {...buttonProps()}\n class={props.class ?? \"solidaria-RangeCalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * Displays a grid of range calendar cells.\n */\nexport function RangeCalendarGrid(props: RangeCalendarGridProps): JSX.Element {\n const state = useRangeCalendarContext();\n const [gridRef, setGridRef] = createSignal<HTMLTableElement | null>(null);\n const startDate = createMemo(() => {\n const offsetMonths = props.offset?.months ?? 0;\n const baseStart = state.visibleRange().start;\n return offsetMonths ? baseStart.add({ months: offsetMonths }) : baseStart;\n });\n\n const gridAria = createCalendarGrid(\n {\n startDate: startDate(),\n endDate: endOfMonth(startDate()),\n weekdayStyle: props.weekdayStyle,\n },\n state as unknown as Parameters<typeof createCalendarGrid>[1],\n gridRef,\n );\n\n const renderValues = createMemo<RangeCalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarGrid\",\n },\n renderValues,\n );\n\n // Memoize all dates for the grid to avoid reactive loops in render paths.\n const allDates = createMemo(() => {\n const monthStart = startDate();\n const numWeeks = state.getWeeksInMonth(monthStart);\n const weekDates: (CalendarDate | null)[][] = [];\n\n for (let weekIndex = 0; weekIndex < numWeeks; weekIndex++) {\n weekDates.push(state.getDatesInWeek(weekIndex, monthStart));\n }\n\n return weekDates;\n });\n\n return (\n <RangeCalendarGridMonthContext.Provider value={startDate}>\n <table\n ref={setGridRef}\n {...gridAria.gridProps}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <thead {...gridAria.headerProps}>\n <tr>\n <For each={gridAria.weekDays}>\n {(day) => (\n <th\n scope=\"col\"\n class={props.headerCellClass ?? \"solidaria-RangeCalendarHeaderCell\"}\n style={props.headerCellStyle}\n >\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <Index each={allDates()}>\n {(weekDates, weekIndex) => (\n <tr>\n <Index each={weekDates()}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext.Provider\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext.Provider>\n </Show>\n )}\n </Index>\n </tr>\n )}\n </Index>\n </tbody>\n </table>\n </RangeCalendarGridMonthContext.Provider>\n );\n}\n\n/**\n * A cell in the range calendar grid representing a single day.\n */\nexport function RangeCalendarCell(props: RangeCalendarCellProps): JSX.Element {\n const state = useRangeCalendarContext();\n const currentMonthStart = useContext(RangeCalendarGridMonthContext);\n const cellPosition = useContext(RangeCalendarGridCellPositionContext);\n const [cellRef, setCellRef] = createSignal<HTMLDivElement | null>(null);\n const isOutsideMonth = createMemo(\n () => currentMonthStart != null && !isSameMonth(currentMonthStart(), props.date),\n );\n const position = createMemo(\n () =>\n cellPosition?.() ?? {\n weekIndex: 0,\n dayIndex: 0,\n lastWeekIndex: 0,\n },\n );\n\n const cellAria = createRangeCalendarCell(\n () => ({\n date: props.date,\n isOutsideMonth: isOutsideMonth(),\n }),\n state,\n cellRef,\n );\n const { hoverProps, isHovered } = createHover(() => ({\n isDisabled: cellAria.isDisabled || cellAria.isUnavailable,\n }));\n\n const renderValues = createMemo<RangeCalendarCellRenderProps>(() => ({\n isSelected: cellAria.isSelected,\n isSelectionStart: cellAria.isSelectionStart,\n isSelectionEnd: cellAria.isSelectionEnd,\n isFocused: cellAria.isFocused,\n isDisabled: cellAria.isDisabled,\n isUnavailable: cellAria.isUnavailable,\n isInvalid: cellAria.isInvalid,\n isOutsideMonth: cellAria.isOutsideMonth,\n isToday: cellAria.isToday,\n isPressed: cellAria.isPressed,\n isHovered: isHovered(),\n isFirstChild: position().dayIndex === 0,\n isLastChild: position().dayIndex === 6,\n isFirstWeek: position().weekIndex === 0,\n isLastWeek: position().weekIndex === position().lastWeekIndex,\n formattedDate: cellAria.formattedDate,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarCell\",\n },\n renderValues,\n );\n const cellRenderProps = useRenderProps(\n {\n class: props.cellClass,\n style: props.cellStyle,\n defaultClassName: \"solidaria-RangeCalendarCellWrapper\",\n },\n renderValues,\n );\n\n // Determine children content - avoid Show for SSR hydration compatibility\n const getChildren = () => {\n if (typeof props.children === \"function\") {\n return renderProps.renderChildren();\n }\n return cellAria.formattedDate;\n };\n\n return (\n <td {...cellAria.cellProps} class={cellRenderProps.class()} style={cellRenderProps.style()}>\n <div\n ref={setCellRef}\n {...cellAria.buttonProps}\n {...hoverProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\n data-selection-start={dataAttr(cellAria.isSelectionStart)}\n data-selection-end={dataAttr(cellAria.isSelectionEnd)}\n data-focused={dataAttr(cellAria.isFocused)}\n data-disabled={dataAttr(cellAria.isDisabled)}\n data-unavailable={dataAttr(cellAria.isUnavailable)}\n data-invalid={dataAttr(cellAria.isInvalid)}\n data-outside-month={dataAttr(cellAria.isOutsideMonth)}\n data-today={dataAttr(cellAria.isToday)}\n data-pressed={dataAttr(cellAria.isPressed)}\n data-hovered={dataAttr(isHovered())}\n >\n {getChildren()}\n </div>\n </td>\n );\n}\n\nexport type { RangeCalendarState, RangeValue };\n"],"mappings":";;;;;;;;;;;;AAkDA,SAAS,UAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KACH;CAGF,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AAqGA,MAAa,uBAAuB,cAAoD,IAAI;AAC5F,MAAa,4BAA4B,cAAoD,IAAI;AACjG,MAAM,gCAAgC,cAA6C,IAAI;AACvF,MAAM,uCAAuC,cAIlC,IAAI;AAEf,SAAgB,0BAAyD;CACvE,MAAM,UAAU,WAAW,oBAAoB;CAC/C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,8DAA8D;CAEhF,OAAO;AACT;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,cACd,OACa;CAEb,MAAM,aAAa,cAAc;CAEjC,OACE,CAAC,KACC,MAAM,WAAW,GACjB,UACE,CAAC,IACC,qEACA,uBAGL;MACC,CAAC,uBAAuB,SAAS;IACnC,EAAE;AAEN;;;;AAKA,SAAS,mBACP,OACa;CACb,MAAM,CAAC,OAAO,YAAY,QAAQ,WAChC,OACA;EAAC;EAAY;EAAS;EAAS;EAAQ;CAAK,GAC5C;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,MAAM,QAAQ,yBAAyB,UAAU;CAEjD,MAAM,eAAe,oBAAoB,MAAM,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ClB,WAAW,SAAS;EACpB,WAAW,UAAU;EACrB,cAAc,SAAS,CAAC,CAAC,aAAa;EACtC,aAAa,SAAS,CAAC,CAAC,aAAa;EACrC,aAAa,SAAS,CAAC,CAAC,cAAc;EACtC,YAAY,SAAS,CAAC,CAAC,cAAc,SAAS,CAAC,CAAC;EAChD,eAAe,SAAS;CAC1B,EAAE;CAEF,MAAM,cAAc,eAClB;EACE,IAAI,WAAW;GACb,OAAO,MAAM;EACf;EACA,OAAO,MAAM;EACb,OAAO,MAAM;EACb,kBAAkB;CACpB,GACA,YACF;CACA,MAAM,kBAAkB,eACtB;EACE,OAAO,MAAM;EACb,OAAO,MAAM;EACb,kBAAkB;CACpB,GACA,YACF;CAGA,MAAM,oBAAoB;EACxB,IAAI,OAAO,MAAM,aAAa,YAC5B,OAAO,YAAY,eAAe;EAEpC,OAAO,SAAS;CAClB;CAEA,OACE,CAAC,OAAO,SAAS,WAAW,OAAO,gBAAgB,MAAM,GAAG,OAAO,gBAAgB,MAAM,GAAG;MAC1F,CAAC,IACC,KAAK,gBACD,SAAS,iBACT,YACJ,OAAO,YAAY,MAAM,GACzB,OAAO,YAAY,MAAM,GACzB,eAAe,SAAS,SAAS,UAAU,GAC3C,sBAAsB,SAAS,SAAS,gBAAgB,GACxD,oBAAoB,SAAS,SAAS,cAAc,GACpD,cAAc,SAAS,SAAS,SAAS,GACzC,eAAe,SAAS,SAAS,UAAU,GAC3C,kBAAkB,SAAS,SAAS,aAAa,GACjD,cAAc,SAAS,SAAS,SAAS,GACzC,oBAAoB,SAAS,SAAS,cAAc,GACpD,YAAY,SAAS,SAAS,OAAO,GACrC,cAAc,SAAS,SAAS,SAAS,GACzC,cAAc,SAAS,UAAU,CAAC,GACnC;SACE,YAAY,EAAE;MACjB,EAAE,IAAI;IACR,EAAE;AAEN"}
|
|
1
|
+
{"version":3,"file":"RangeCalendar.jsx","names":[],"sources":["../src/RangeCalendar.tsx"],"sourcesContent":["/**\n * RangeCalendar component for solidaria-components\n *\n * Pre-wired headless range calendar component that combines aria hooks.\n * Port of react-aria-components/src/RangeCalendar.tsx\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n For,\n Index,\n Show,\n} from \"solid-js\";\nimport {\n createRangeCalendar,\n createCalendarGrid,\n createRangeCalendarCell,\n createHover,\n type AriaRangeCalendarProps,\n type AriaCalendarGridProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createRangeCalendarState,\n type RangeCalendarState,\n type RangeCalendarStateProps,\n type CalendarDate,\n type DateValue,\n type RangeValue,\n endOfMonth,\n isSameMonth,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n useIsHydrated,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface RangeCalendarRenderProps {\n /** Whether the calendar is disabled. */\n isDisabled: boolean;\n /** Whether the calendar is read-only. */\n isReadOnly: boolean;\n /** Whether the current selection is invalid. */\n isInvalid: boolean;\n /** Whether the user is currently selecting a range. */\n isDragging: boolean;\n}\n\nexport interface RangeCalendarProps<T extends DateValue = DateValue>\n extends\n Omit<AriaRangeCalendarProps, \"id\" | \"isDisabled\" | \"isReadOnly\">,\n Omit<RangeCalendarStateProps<T>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n /** Ref for the range calendar root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface RangeCalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface RangeCalendarGridProps\n extends Omit<AriaCalendarGridProps, \"startDate\" | \"endDate\">, SlotProps {\n /** The children of the component (render function receiving dates). */\n children?: (date: CalendarDate) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarGridRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarGridRenderProps>;\n /** Class name for weekday header cells. */\n headerCellClass?: string;\n /** Inline style for weekday header cells. */\n headerCellStyle?: JSX.CSSProperties;\n /** Number of months to offset from the start. */\n offset?: { months?: number };\n}\n\nexport interface RangeCalendarCellRenderProps {\n /** Whether the cell is within the selected range. */\n isSelected: boolean;\n /** Whether the cell is the start of the selection. */\n isSelectionStart: boolean;\n /** Whether the cell is the end of the selection. */\n isSelectionEnd: boolean;\n /** Whether the cell is focused. */\n isFocused: boolean;\n /** Whether the cell is disabled. */\n isDisabled: boolean;\n /** Whether the cell is unavailable. */\n isUnavailable: boolean;\n /** Whether the cell is part of an invalid selection. */\n isInvalid: boolean;\n /** Whether the cell is outside the visible month. */\n isOutsideMonth: boolean;\n /** Whether the cell represents today. */\n isToday: boolean;\n /** Whether the cell is pressed. */\n isPressed: boolean;\n /** Whether the cell is hovered. */\n isHovered: boolean;\n /** Whether the cell is the first day slot in its row. */\n isFirstChild: boolean;\n /** Whether the cell is the last day slot in its row. */\n isLastChild: boolean;\n /** Whether the cell is in the first rendered week row. */\n isFirstWeek: boolean;\n /** Whether the cell is in the last rendered week row. */\n isLastWeek: boolean;\n /** The formatted date string. */\n formattedDate: string;\n}\n\nexport interface RangeCalendarCellProps extends SlotProps {\n /** The date for this cell. */\n date: CalendarDate;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<RangeCalendarCellRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarCellRenderProps>;\n /** Class name for the table cell wrapper. */\n cellClass?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** Inline style for the table cell wrapper. */\n cellStyle?: StyleOrFunction<RangeCalendarCellRenderProps>;\n}\n\nexport const RangeCalendarContext = createContext<RangeCalendarState<DateValue> | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState<DateValue> | null>(null);\nconst RangeCalendarGridMonthContext = createContext<Accessor<CalendarDate> | null>(null);\nconst RangeCalendarGridCellPositionContext = createContext<Accessor<{\n weekIndex: number;\n dayIndex: number;\n lastWeekIndex: number;\n}> | null>(null);\n\nexport function useRangeCalendarContext(): RangeCalendarState<DateValue> {\n const context = useContext(RangeCalendarContext);\n if (!context) {\n throw new Error(\"RangeCalendar components must be used within a RangeCalendar\");\n }\n return context;\n}\n\n/**\n * A range calendar displays a grid of days and allows users to select a contiguous range of dates.\n *\n * @example\n * ```tsx\n * <RangeCalendar aria-label=\"Date range\">\n * <header>\n * <RangeCalendarButton slot=\"previous\">◀</RangeCalendarButton>\n * <RangeCalendarHeading />\n * <RangeCalendarButton slot=\"next\">▶</RangeCalendarButton>\n * </header>\n * <RangeCalendarGrid>\n * {(date) => <RangeCalendarCell date={date} />}\n * </RangeCalendarGrid>\n * </RangeCalendar>\n * ```\n */\nexport function RangeCalendar<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n // When rendered inside a composite that owns the range state (e.g.\n // DateRangePicker provides `RangeCalendarContext`), reuse that shared state\n // instead of minting a fresh one — otherwise the composite's focus/anchor\n // flags (e.g. the popover-open `setFocused(true)`) drive a different state\n // instance than the one this grid renders. Mirrors the single `Calendar`.\n const inheritedState = useContext(RangeCalendarContext);\n\n // Use hydration-safe pattern for client-only rendering\n const isHydrated = useIsHydrated();\n\n return (\n <Show\n when={isHydrated()}\n fallback={\n <div\n class=\"solidaria-RangeCalendar solidaria-RangeCalendar--placeholder\"\n aria-hidden=\"true\"\n />\n }\n >\n <Show when={inheritedState} fallback={<RangeCalendarInner {...props} />}>\n <RangeCalendarWithState\n state={inheritedState as RangeCalendarState<DateValue>}\n {...props}\n />\n </Show>\n </Show>\n );\n}\n\n/**\n * RangeCalendar variant that renders against an externally-owned state (from\n * `RangeCalendarContext`) rather than creating its own. Mirrors the single\n * `CalendarWithState`.\n */\nfunction RangeCalendarWithState<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T> & { state: RangeCalendarState<DateValue> },\n): JSX.Element {\n const [local, , rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"state\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = () => props.state;\n\n const calendarAria = createRangeCalendar(rest, state());\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state().isDisabled(),\n isReadOnly: state().isReadOnly(),\n isInvalid: state().isValueInvalid(),\n isDragging: state().isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext.Provider value={state()}>\n <RangeCalendarContext.Provider value={state()}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => assignRef(local.ref, el)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state().isDisabled())}\n data-readonly={dataAttr(state().isReadOnly())}\n data-invalid={dataAttr(state().isValueInvalid())}\n data-dragging={dataAttr(state().isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Mirrors react-aria-components\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabIndex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext.Provider>\n </RangeCalendarStateContext.Provider>\n );\n}\n\n/**\n * Internal RangeCalendar component that renders after client mount.\n */\nfunction RangeCalendarInner<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = createRangeCalendarState(stateProps);\n\n const calendarAria = createRangeCalendar(rest, state as unknown as RangeCalendarState<DateValue>);\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isInvalid: state.isValueInvalid(),\n isDragging: state.isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext.Provider value={state as unknown as RangeCalendarState<DateValue>}>\n <RangeCalendarContext.Provider value={state as unknown as RangeCalendarState<DateValue>}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => assignRef(local.ref, el)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n data-dragging={dataAttr(state.isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Mirrors react-aria-components\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabIndex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext.Provider>\n </RangeCalendarStateContext.Provider>\n );\n}\n\nexport interface RangeCalendarHeadingProps extends SlotProps {\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\n/**\n * Displays the current month and year in the range calendar.\n */\nexport function RangeCalendarHeading(props: RangeCalendarHeadingProps): JSX.Element {\n const state = useRangeCalendarContext();\n\n return (\n <h2\n class={props.class ?? \"solidaria-RangeCalendarHeading\"}\n style={props.style}\n aria-live=\"polite\"\n >\n {state.title()}\n </h2>\n );\n}\n\nexport interface RangeCalendarButtonProps extends SlotProps {\n /** The slot for this button (previous or next). */\n slot?: \"previous\" | \"next\";\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n /** Whether the button is disabled. */\n isDisabled?: boolean;\n}\n\n/**\n * A button for navigating the range calendar.\n */\nexport function RangeCalendarButton(props: RangeCalendarButtonProps): JSX.Element {\n const state = useRangeCalendarContext();\n const calendarAria = createRangeCalendar({}, state);\n\n const buttonProps = createMemo(() => {\n if (props.slot === \"previous\") {\n return calendarAria.prevButtonProps;\n }\n return calendarAria.nextButtonProps;\n });\n const isDisabled = createMemo(\n () => props.isDisabled || Boolean(buttonProps().disabled) || state.isDisabled(),\n );\n\n return (\n <button\n {...buttonProps()}\n class={props.class ?? \"solidaria-RangeCalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n // Mirror useFocusable (same as CalendarButton): always set an explicit\n // tabIndex on an enabled focusable nav button (0), and drop it entirely\n // when disabled — so the prev/next buttons appear in the roving tab order\n // exactly as the S2 oracle does.\n tabindex={isDisabled() ? undefined : 0}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * Displays a grid of range calendar cells.\n */\nexport function RangeCalendarGrid(props: RangeCalendarGridProps): JSX.Element {\n const state = useRangeCalendarContext();\n const [gridRef, setGridRef] = createSignal<HTMLTableElement | null>(null);\n const startDate = createMemo(() => {\n const offsetMonths = props.offset?.months ?? 0;\n const baseStart = state.visibleRange().start;\n return offsetMonths ? baseStart.add({ months: offsetMonths }) : baseStart;\n });\n\n const gridAria = createCalendarGrid(\n {\n startDate: startDate(),\n endDate: endOfMonth(startDate()),\n weekdayStyle: props.weekdayStyle,\n },\n state as unknown as Parameters<typeof createCalendarGrid>[1],\n gridRef,\n );\n\n const renderValues = createMemo<RangeCalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarGrid\",\n },\n renderValues,\n );\n\n // Memoize all dates for the grid to avoid reactive loops in render paths.\n const allDates = createMemo(() => {\n const monthStart = startDate();\n const numWeeks = state.getWeeksInMonth(monthStart);\n const weekDates: (CalendarDate | null)[][] = [];\n\n for (let weekIndex = 0; weekIndex < numWeeks; weekIndex++) {\n weekDates.push(state.getDatesInWeek(weekIndex, monthStart));\n }\n\n return weekDates;\n });\n\n return (\n <RangeCalendarGridMonthContext.Provider value={startDate}>\n <table\n ref={setGridRef}\n {...gridAria.gridProps}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <thead {...gridAria.headerProps}>\n <tr>\n <For each={gridAria.weekDays}>\n {(day) => (\n <th\n scope=\"col\"\n class={props.headerCellClass ?? \"solidaria-RangeCalendarHeaderCell\"}\n style={props.headerCellStyle}\n >\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <Index each={allDates()}>\n {(weekDates, weekIndex) => (\n <tr>\n <Index each={weekDates()}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext.Provider\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext.Provider>\n </Show>\n )}\n </Index>\n </tr>\n )}\n </Index>\n </tbody>\n </table>\n </RangeCalendarGridMonthContext.Provider>\n );\n}\n\n/**\n * A cell in the range calendar grid representing a single day.\n */\nexport function RangeCalendarCell(props: RangeCalendarCellProps): JSX.Element {\n const state = useRangeCalendarContext();\n const currentMonthStart = useContext(RangeCalendarGridMonthContext);\n const cellPosition = useContext(RangeCalendarGridCellPositionContext);\n const [cellRef, setCellRef] = createSignal<HTMLDivElement | null>(null);\n const isOutsideMonth = createMemo(\n () => currentMonthStart != null && !isSameMonth(currentMonthStart(), props.date),\n );\n const position = createMemo(\n () =>\n cellPosition?.() ?? {\n weekIndex: 0,\n dayIndex: 0,\n lastWeekIndex: 0,\n },\n );\n\n const cellAria = createRangeCalendarCell(\n () => ({\n date: props.date,\n isOutsideMonth: isOutsideMonth(),\n }),\n state,\n cellRef,\n );\n const { hoverProps, isHovered } = createHover(() => ({\n isDisabled: cellAria.isDisabled || cellAria.isUnavailable,\n }));\n\n const renderValues = createMemo<RangeCalendarCellRenderProps>(() => ({\n isSelected: cellAria.isSelected,\n isSelectionStart: cellAria.isSelectionStart,\n isSelectionEnd: cellAria.isSelectionEnd,\n isFocused: cellAria.isFocused,\n isDisabled: cellAria.isDisabled,\n isUnavailable: cellAria.isUnavailable,\n isInvalid: cellAria.isInvalid,\n isOutsideMonth: cellAria.isOutsideMonth,\n isToday: cellAria.isToday,\n isPressed: cellAria.isPressed,\n isHovered: isHovered(),\n isFirstChild: position().dayIndex === 0,\n isLastChild: position().dayIndex === 6,\n isFirstWeek: position().weekIndex === 0,\n isLastWeek: position().weekIndex === position().lastWeekIndex,\n formattedDate: cellAria.formattedDate,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarCell\",\n },\n renderValues,\n );\n const cellRenderProps = useRenderProps(\n {\n class: props.cellClass,\n style: props.cellStyle,\n defaultClassName: \"solidaria-RangeCalendarCellWrapper\",\n },\n renderValues,\n );\n\n // Determine children content - avoid Show for SSR hydration compatibility\n const getChildren = () => {\n if (typeof props.children === \"function\") {\n return renderProps.renderChildren();\n }\n return cellAria.formattedDate;\n };\n\n return (\n <td {...cellAria.cellProps} class={cellRenderProps.class()} style={cellRenderProps.style()}>\n <div\n ref={setCellRef}\n {...cellAria.buttonProps}\n {...hoverProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\n data-selection-start={dataAttr(cellAria.isSelectionStart)}\n data-selection-end={dataAttr(cellAria.isSelectionEnd)}\n data-focused={dataAttr(cellAria.isFocused)}\n data-disabled={dataAttr(cellAria.isDisabled)}\n data-unavailable={dataAttr(cellAria.isUnavailable)}\n data-invalid={dataAttr(cellAria.isInvalid)}\n data-outside-month={dataAttr(cellAria.isOutsideMonth)}\n data-today={dataAttr(cellAria.isToday)}\n data-pressed={dataAttr(cellAria.isPressed)}\n data-hovered={dataAttr(isHovered())}\n >\n {getChildren()}\n </div>\n </td>\n );\n}\n\nexport type { RangeCalendarState, RangeValue };\n"],"mappings":";;;;;;;;;;;;AAkDA,SAAS,UAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KACH;CAGF,IAAI,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src/SearchField.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EAQb,MAAM,UAAU,CAAC;AAClB,OAAO,EAML,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,KAAK,gBAAgB,EAEtB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,SAAS,EAIf,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchField.d.ts","sourceRoot":"","sources":["../src/SearchField.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EAQb,MAAM,UAAU,CAAC;AAClB,OAAO,EAML,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,KAAK,gBAAgB,EAEtB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,SAAS,EAIf,MAAM,SAAS,CAAC;AAIjB,MAAM,WAAW,sBAAsB;IACrC,yCAAyC;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,4CAA4C;IAC5C,UAAU,EAAE,OAAO,CAAC;IACpB,2CAA2C;IAC3C,SAAS,EAAE,OAAO,CAAC;IACnB,6CAA6C;IAC7C,UAAU,EAAE,OAAO,CAAC;IACpB,4CAA4C;IAC5C,UAAU,EAAE,OAAO,CAAC;IACpB,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC,EAAE,SAAS;IACtF,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC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AAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAC1C;AAED,eAAO,MAAM,kBAAkB,yCAAsD,CAAC;AA0EtF;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAyYhE;yBAzYe,WAAW;;;;;AA2Y3B;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC;CAC3B,GAAG,GAAG,CAAC,OAAO,CAoBd;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,GAAG,CAAC,OAAO,CA4I1E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,GAAG,GAAG,CAAC,OAAO,CAiFtF"}
|
package/dist/SearchField.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Provider, filterDOMProps, useRenderProps } from "./utils.js";
|
|
|
2
2
|
import { FieldErrorContext } from "./FieldError.js";
|
|
3
3
|
import { TextContext } from "./Text.js";
|
|
4
4
|
import { FormContext } from "./Form.js";
|
|
5
|
+
import { useAutocompleteInput } from "./Autocomplete.js";
|
|
5
6
|
import { createComponent, getNextElement, insert, mergeProps, runHydrationEvents, spread, template, use } from "solid-js/web";
|
|
6
7
|
import { Show, createContext, createMemo, onCleanup, onMount, splitProps, useContext } from "solid-js";
|
|
7
8
|
import { createFocusRing, createHover, createPress, createSearchField, mergeProps as mergeProps$2 } from "@proyecto-viviana/solidaria";
|
|
@@ -66,7 +67,18 @@ function SearchField(props) {
|
|
|
66
67
|
const { state: _state, inputProps: _inputProps, clearButtonProps: _clearButtonProps, labelProps: _labelProps, descriptionProps: _descriptionProps, errorMessageProps: _errorMessageProps, isDisabled: _isDisabled, isInvalid: _isInvalid, isRequired: _isRequired, isReadOnly: _isReadOnly, setInputRef: _setInputRef, slots: _slots, ...restContextProps } = contextProps;
|
|
67
68
|
return restContextProps;
|
|
68
69
|
});
|
|
69
|
-
const
|
|
70
|
+
const baseProps = contextProps ? mergeProps$2(contextBaseProps(), contextSlotProps ?? {}, props) : props;
|
|
71
|
+
const autocompleteInput = useAutocompleteInput();
|
|
72
|
+
const autocompleteProps = autocompleteInput ? {
|
|
73
|
+
get value() {
|
|
74
|
+
return autocompleteInput.inputProps.value();
|
|
75
|
+
},
|
|
76
|
+
onChange: autocompleteInput.inputProps.onChange,
|
|
77
|
+
onKeyDown: autocompleteInput.inputProps.onKeyDown,
|
|
78
|
+
onFocus: autocompleteInput.inputProps.onFocus,
|
|
79
|
+
onBlur: autocompleteInput.inputProps.onBlur
|
|
80
|
+
} : void 0;
|
|
81
|
+
const [local, stateProps, ariaProps, rest] = splitProps(withFormValidationBehavior(autocompleteProps ? mergeProps$2(baseProps, autocompleteProps) : baseProps, formContext), [
|
|
70
82
|
"children",
|
|
71
83
|
"class",
|
|
72
84
|
"style",
|
|
@@ -447,6 +459,7 @@ function SearchFieldInput(props) {
|
|
|
447
459
|
let inputElement;
|
|
448
460
|
const context = useContext(SearchFieldContext);
|
|
449
461
|
if (!context) throw new Error("SearchFieldInput must be used within a SearchField");
|
|
462
|
+
const autocompleteInput = useAutocompleteInput();
|
|
450
463
|
const { isFocused, isFocusVisible, focusProps } = createFocusRing();
|
|
451
464
|
const { isHovered, hoverProps } = createHover({ get isDisabled() {
|
|
452
465
|
return context.isDisabled;
|
|
@@ -475,11 +488,21 @@ function SearchFieldInput(props) {
|
|
|
475
488
|
const { ref: _ref, ...rest } = hoverProps;
|
|
476
489
|
return rest;
|
|
477
490
|
};
|
|
491
|
+
const autocompleteInputAttrs = () => {
|
|
492
|
+
if (!autocompleteInput) return {};
|
|
493
|
+
const inputProps = autocompleteInput.inputProps;
|
|
494
|
+
return {
|
|
495
|
+
"aria-controls": inputProps["aria-controls"],
|
|
496
|
+
"aria-autocomplete": inputProps["aria-autocomplete"],
|
|
497
|
+
"aria-activedescendant": inputProps["aria-activedescendant"]()
|
|
498
|
+
};
|
|
499
|
+
};
|
|
478
500
|
const mergedInputProps = () => ({
|
|
479
501
|
...domProps,
|
|
480
502
|
...cleanInputProps(),
|
|
481
503
|
...cleanFocusProps(),
|
|
482
|
-
...cleanHoverProps()
|
|
504
|
+
...cleanHoverProps(),
|
|
505
|
+
...autocompleteInputAttrs()
|
|
483
506
|
});
|
|
484
507
|
onMount(() => {
|
|
485
508
|
const element = inputElement;
|
|
@@ -509,6 +532,7 @@ function SearchFieldInput(props) {
|
|
|
509
532
|
use((element) => {
|
|
510
533
|
inputElement = element;
|
|
511
534
|
context.setInputRef?.(element);
|
|
535
|
+
autocompleteInput?.inputRef(element);
|
|
512
536
|
const ref = domProps.ref;
|
|
513
537
|
if (typeof ref === "function") ref(element);
|
|
514
538
|
}, _el$3);
|
package/dist/SearchField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchField.js","names":["JSX","Context","createContext","createMemo","onCleanup","onMount","splitProps","useContext","Show","createSearchField","createFocusRing","createHover","createPress","mergeProps","AriaSearchFieldProps","createSearchFieldState","VALID_VALIDITY_STATE","SearchFieldState","ValidationResult","FormContext","FormProps","FieldErrorContext","FieldErrorContextValue","RenderChildren","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","Provider","TextContext","SearchFieldRenderProps","isEmpty","isDisabled","isInvalid","isReadOnly","isRequired","value","SearchFieldProps","Omit","defaultValue","onChange","onSubmit","onClear","label","Element","children","class","style","ref","el","HTMLDivElement","SearchFieldInputRenderProps","isFocused","isFocusVisible","isHovered","SearchFieldInputProps","InputHTMLAttributes","HTMLInputElement","SearchFieldClearButtonRenderProps","isPressed","SearchFieldClearButtonProps","ButtonHTMLAttributes","HTMLButtonElement","SearchFieldContextValue","Partial","state","inputProps","clearButtonProps","tabIndex","disabled","onMouseDown","e","MouseEvent","onClick","labelProps","HTMLAttributes","HTMLElement","descriptionProps","errorMessageProps","setInputRef","slots","Record","SearchFieldContext","withFormValidationBehavior","props","formContext","validationBehavior","Proxy","get","target","property","receiver","localValue","Reflect","undefined","has","ownKeys","keys","Set","add","Array","from","getOwnPropertyDescriptor","descriptor","enumerable","configurable","eventWithCurrentTarget","event","Event","element","T","bind","clearDelegatedTextEntryHandlers","delegatedElement","$$input","$$change","SearchField","contextProps","contextSlotProps","slot","contextBaseProps","_state","_inputProps","_clearButtonProps","_labelProps","_descriptionProps","_errorMessageProps","_isDisabled","_isInvalid","_isRequired","_isReadOnly","_setInputRef","_slots","restContextProps","baseProps","mergedProps","local","stateProps","ariaProps","rest","inputRef","searchFieldAria","aria-label","aria-labelledby","aria-describedby","description","errorMessage","placeholder","name","form","type","autoFocus","excludeFromTabOrder","autoComplete","inputMode","enterKeyHint","autoCorrect","autoCapitalize","spellCheck","maxLength","minLength","pattern","onFocus","onBlur","onFocusChange","onKeyDown","onKeyUp","onCopy","onCut","onPaste","onCompositionStart","onCompositionEnd","onCompositionUpdate","onSelect","onBeforeInput","onInput","renderValues","renderProps","defaultClassName","childRenderValues","domProps","global","fieldValidation","validationErrors","validationDetails","customError","valid","fieldErrorContext","validation","contextValue","fieldChildren","textSlots","_$createComponent","_el$","_$getNextElement","_tmpl$","_ref$","_$use","_$spread","_$mergeProps","data-empty","data-disabled","data-invalid","data-required","data-readonly","_$insert","values","_$runHydrationEvents","SearchFieldLabel","CSSProperties","context","Error","cleanLabelProps","_ref","_el$2","_tmpl$2","SearchFieldInput","inputElement","focusProps","hoverProps","cleanInputProps","cleanFocusProps","cleanHoverProps","mergedInputProps","inputHandler","handler","EventHandler","InputEvent","currentTarget","stopPropagation","changeHandler","addEventListener","removeEventListener","_el$3","_tmpl$3","data-focused","data-focus-visible","data-hovered","SearchFieldClearButton","clear","pressProps","onPress","cleanPressProps","when","_el$4","_tmpl$4","data-pressed","renderChildren","Label","Input","ClearButton"],"sources":["../src/SearchField.tsx"],"sourcesContent":["/**\n * SearchField component for solidaria-components\n *\n * A pre-wired headless search field that combines state + aria hooks.\n * Port of react-aria-components/src/SearchField.tsx\n */\n\nimport {\n type JSX,\n type Context,\n createContext,\n createMemo,\n onCleanup,\n onMount,\n splitProps,\n useContext,\n Show,\n} from \"solid-js\";\nimport {\n createSearchField,\n createFocusRing,\n createHover,\n createPress,\n mergeProps,\n type AriaSearchFieldProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSearchFieldState,\n VALID_VALIDITY_STATE,\n type SearchFieldState,\n type ValidationResult,\n} from \"@proyecto-viviana/solid-stately\";\nimport { FormContext, type FormProps } from \"./Form\";\nimport { FieldErrorContext, type FieldErrorContextValue } from \"./FieldError\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n Provider,\n} from \"./utils\";\nimport { TextContext } from \"./Text\";\n\nexport interface SearchFieldRenderProps {\n /** Whether the search field is empty. */\n isEmpty: boolean;\n /** Whether the search field is disabled. */\n isDisabled: boolean;\n /** Whether the search field is invalid. */\n isInvalid: boolean;\n /** Whether the search field is read-only. */\n isReadOnly: boolean;\n /** Whether the search field is required. */\n isRequired: boolean;\n /** The current value. */\n value: string;\n}\n\nexport interface SearchFieldProps extends Omit<AriaSearchFieldProps, \"label\">, SlotProps {\n /** The current value (controlled). */\n value?: string;\n /** The default value (uncontrolled). */\n defaultValue?: string;\n /** Handler called when the value changes. */\n onChange?: (value: string) => void;\n /** Handler called when the user submits the search. */\n onSubmit?: (value: string) => void;\n /** Handler called when the field is cleared. */\n onClear?: () => void;\n /** A visible label for the search field. */\n label?: JSX.Element;\n /** The children of the component. */\n children?: RenderChildren<SearchFieldRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SearchFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SearchFieldRenderProps>;\n /** Ref for the outer search field element. */\n ref?: (el: HTMLDivElement) => void;\n}\n\nexport interface SearchFieldInputRenderProps {\n /** Whether the input is focused. */\n isFocused: boolean;\n /** Whether the input has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the input is hovered. */\n isHovered: boolean;\n /** Whether the input is disabled. */\n isDisabled: boolean;\n /** Whether the input is invalid. */\n isInvalid: boolean;\n}\n\nexport interface SearchFieldInputProps\n extends SlotProps, Omit<JSX.InputHTMLAttributes<HTMLInputElement>, \"class\" | \"style\"> {\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SearchFieldInputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SearchFieldInputRenderProps>;\n}\n\nexport interface SearchFieldClearButtonRenderProps {\n /** Whether the button is pressed. */\n isPressed: boolean;\n /** Whether the button is hovered. */\n isHovered: boolean;\n /** Whether the button is disabled. */\n isDisabled: boolean;\n}\n\nexport interface SearchFieldClearButtonProps\n extends\n SlotProps,\n Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the button. */\n children?: RenderChildren<SearchFieldClearButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SearchFieldClearButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SearchFieldClearButtonRenderProps>;\n}\n\ninterface SearchFieldContextValue extends Partial<SearchFieldProps> {\n state?: SearchFieldState;\n inputProps?: JSX.InputHTMLAttributes<HTMLInputElement>;\n clearButtonProps?: {\n \"aria-label\": string;\n tabIndex: number;\n disabled?: boolean;\n onMouseDown: (e: MouseEvent) => void;\n onClick: () => void;\n };\n labelProps?: JSX.HTMLAttributes<HTMLElement>;\n descriptionProps?: JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps?: JSX.HTMLAttributes<HTMLElement>;\n isDisabled?: boolean;\n isInvalid?: boolean;\n isRequired?: boolean;\n isReadOnly?: boolean;\n setInputRef?: (el: HTMLInputElement) => void;\n slots?: Record<string, SearchFieldProps>;\n}\n\nexport const SearchFieldContext = createContext<SearchFieldContextValue | null>(null);\n\nfunction withFormValidationBehavior(\n props: SearchFieldProps,\n formContext: FormProps | null,\n): SearchFieldProps {\n if (!formContext?.validationBehavior) {\n return props;\n }\n\n return new Proxy(props, {\n get(target, property, receiver) {\n const localValue = Reflect.get(target, property, receiver);\n if (property === \"validationBehavior\" && localValue === undefined) {\n return formContext.validationBehavior;\n }\n\n return localValue;\n },\n has(target, property) {\n return (\n Reflect.has(target, property) ||\n (property === \"validationBehavior\" && formContext.validationBehavior !== undefined)\n );\n },\n ownKeys(target) {\n const keys = new Set(Reflect.ownKeys(target));\n if (formContext.validationBehavior !== undefined) {\n keys.add(\"validationBehavior\");\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (property === \"validationBehavior\" && formContext.validationBehavior !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => formContext.validationBehavior,\n };\n }\n\n return undefined;\n },\n });\n}\n\nfunction eventWithCurrentTarget<T extends HTMLElement>(event: Event, element: T): Event {\n return new Proxy(event, {\n get(target, property, receiver) {\n if (property === \"target\" || property === \"currentTarget\") {\n return element;\n }\n\n const value = Reflect.get(target, property, receiver);\n return typeof value === \"function\" ? value.bind(target) : value;\n },\n });\n}\n\nfunction clearDelegatedTextEntryHandlers(element: HTMLElement) {\n const delegatedElement = element as HTMLElement & {\n $$input?: unknown;\n $$change?: unknown;\n };\n delete delegatedElement.$$input;\n delete delegatedElement.$$change;\n}\n\n/**\n * A search field allows a user to enter and clear a search query.\n */\nexport function SearchField(props: SearchFieldProps): JSX.Element {\n const formContext = useContext(FormContext);\n const contextProps = useContext(SearchFieldContext);\n const contextSlotProps = contextProps?.slots?.[props.slot ?? \"default\"];\n const contextBaseProps = createMemo<SearchFieldProps>(() => {\n if (!contextProps) return {};\n const {\n state: _state,\n inputProps: _inputProps,\n clearButtonProps: _clearButtonProps,\n labelProps: _labelProps,\n descriptionProps: _descriptionProps,\n errorMessageProps: _errorMessageProps,\n isDisabled: _isDisabled,\n isInvalid: _isInvalid,\n isRequired: _isRequired,\n isReadOnly: _isReadOnly,\n setInputRef: _setInputRef,\n slots: _slots,\n ...restContextProps\n } = contextProps;\n return restContextProps as SearchFieldProps;\n });\n const baseProps = (\n contextProps ? mergeProps(contextBaseProps(), contextSlotProps ?? {}, props) : props\n ) as SearchFieldProps;\n const mergedProps = withFormValidationBehavior(baseProps, formContext);\n\n const [local, stateProps, ariaProps, rest] = splitProps(\n mergedProps,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\"value\", \"defaultValue\", \"onChange\", \"onSubmit\", \"onClear\"],\n [\n \"label\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"isDisabled\",\n \"isReadOnly\",\n \"isRequired\",\n \"isInvalid\",\n \"description\",\n \"errorMessage\",\n \"id\",\n \"autoFocus\",\n \"excludeFromTabOrder\",\n \"name\",\n \"form\",\n \"validationBehavior\",\n \"type\",\n \"placeholder\",\n \"autoComplete\",\n \"inputMode\",\n \"enterKeyHint\",\n \"autoCorrect\",\n \"autoCapitalize\",\n \"spellCheck\",\n \"maxLength\",\n \"minLength\",\n \"pattern\",\n \"onFocus\",\n \"onBlur\",\n \"onFocusChange\",\n \"onKeyDown\",\n \"onKeyUp\",\n \"onCopy\",\n \"onCut\",\n \"onPaste\",\n \"onCompositionStart\",\n \"onCompositionEnd\",\n \"onCompositionUpdate\",\n \"onSelect\",\n \"onBeforeInput\",\n \"onInput\",\n ],\n );\n\n const state = createSearchFieldState({\n get value() {\n return stateProps.value;\n },\n get defaultValue() {\n return stateProps.defaultValue;\n },\n get onChange() {\n return stateProps.onChange;\n },\n });\n\n let inputRef: HTMLInputElement | undefined;\n const setInputRef = (el: HTMLInputElement) => {\n inputRef = el;\n };\n\n const searchFieldAria = createSearchField(\n {\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly;\n },\n get isRequired() {\n return ariaProps.isRequired;\n },\n get isInvalid() {\n return ariaProps.isInvalid;\n },\n get label() {\n return ariaProps.label;\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 description() {\n return ariaProps.description;\n },\n get errorMessage() {\n return ariaProps.errorMessage;\n },\n get placeholder() {\n return ariaProps.placeholder;\n },\n get name() {\n return ariaProps.name;\n },\n get form() {\n return ariaProps.form;\n },\n get validationBehavior() {\n return ariaProps.validationBehavior;\n },\n get type() {\n return ariaProps.type;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get excludeFromTabOrder() {\n return ariaProps.excludeFromTabOrder;\n },\n get autoComplete() {\n return ariaProps.autoComplete;\n },\n get inputMode() {\n return ariaProps.inputMode;\n },\n get enterKeyHint() {\n return ariaProps.enterKeyHint;\n },\n get autoCorrect() {\n return ariaProps.autoCorrect;\n },\n get autoCapitalize() {\n return ariaProps.autoCapitalize;\n },\n get spellCheck() {\n return ariaProps.spellCheck;\n },\n get maxLength() {\n return ariaProps.maxLength;\n },\n get minLength() {\n return ariaProps.minLength;\n },\n get pattern() {\n return ariaProps.pattern;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get onCopy() {\n return ariaProps.onCopy;\n },\n get onCut() {\n return ariaProps.onCut;\n },\n get onPaste() {\n return ariaProps.onPaste;\n },\n get onCompositionStart() {\n return ariaProps.onCompositionStart;\n },\n get onCompositionEnd() {\n return ariaProps.onCompositionEnd;\n },\n get onCompositionUpdate() {\n return ariaProps.onCompositionUpdate;\n },\n get onSelect() {\n return ariaProps.onSelect;\n },\n get onBeforeInput() {\n return ariaProps.onBeforeInput;\n },\n get onInput() {\n return ariaProps.onInput;\n },\n get onSubmit() {\n return stateProps.onSubmit;\n },\n get onClear() {\n return stateProps.onClear;\n },\n },\n state,\n () => inputRef ?? null,\n );\n\n const renderValues = createMemo<SearchFieldRenderProps>(() => ({\n isEmpty: state.value() === \"\",\n isDisabled: ariaProps.isDisabled ?? false,\n isInvalid: searchFieldAria.isInvalid ?? false,\n isRequired: ariaProps.isRequired ?? false,\n isReadOnly: ariaProps.isReadOnly ?? false,\n value: state.value(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return local.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-SearchField\",\n },\n renderValues,\n );\n const childRenderValues: SearchFieldRenderProps = {\n get isEmpty() {\n return state.value() === \"\";\n },\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return searchFieldAria.isInvalid ?? false;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n get value() {\n return state.value();\n },\n };\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const fieldValidation = createMemo<ValidationResult>(() => {\n const isInvalid = searchFieldAria.isInvalid;\n const errorMessage = ariaProps.errorMessage;\n const validationErrors = isInvalid && typeof errorMessage === \"string\" ? [errorMessage] : [];\n\n return {\n isInvalid,\n validationErrors,\n validationDetails: isInvalid\n ? { ...VALID_VALIDITY_STATE, customError: true, valid: false }\n : VALID_VALIDITY_STATE,\n };\n });\n const fieldErrorContext: FieldErrorContextValue = {\n get validation() {\n return fieldValidation();\n },\n get errorMessageProps() {\n return searchFieldAria.errorMessageProps;\n },\n };\n const contextValue: SearchFieldContextValue = {\n state,\n get inputProps() {\n return searchFieldAria.inputProps;\n },\n get clearButtonProps() {\n return searchFieldAria.clearButtonProps;\n },\n get labelProps() {\n return searchFieldAria.labelProps as JSX.HTMLAttributes<HTMLElement>;\n },\n get descriptionProps() {\n return searchFieldAria.descriptionProps;\n },\n get errorMessageProps() {\n return searchFieldAria.errorMessageProps;\n },\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return searchFieldAria.isInvalid ?? false;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n setInputRef,\n };\n const fieldChildren = () => {\n const children = local.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n };\n // Provide the description / errorMessage props as `TextContext` slots (mirrors\n // react-aria-components' SearchField), so a `<Text slot=\"description\">` /\n // `<Text slot=\"errorMessage\">` child picks up the `id` its `aria-describedby`\n // references. Additive: existing consumers reading these off\n // `SearchFieldContext` are unaffected.\n const textSlots = {\n slots: {\n get description() {\n return searchFieldAria.descriptionProps;\n },\n get errorMessage() {\n return searchFieldAria.errorMessageProps;\n },\n },\n };\n\n return (\n <FieldErrorContext.Provider value={fieldErrorContext}>\n <SearchFieldContext.Provider value={contextValue}>\n <div\n {...domProps()}\n ref={local.ref}\n class={renderProps.class()}\n style={renderProps.style()}\n data-empty={state.value() === \"\" || undefined}\n data-disabled={ariaProps.isDisabled || undefined}\n data-invalid={searchFieldAria.isInvalid || undefined}\n data-required={ariaProps.isRequired || undefined}\n data-readonly={ariaProps.isReadOnly || undefined}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n {fieldChildren()}\n </Provider>\n </div>\n </SearchFieldContext.Provider>\n </FieldErrorContext.Provider>\n );\n}\n\n/**\n * The label for a search field.\n */\nexport function SearchFieldLabel(props: {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}): JSX.Element {\n const context = useContext(SearchFieldContext);\n if (!context) {\n throw new Error(\"SearchFieldLabel must be used within a SearchField\");\n }\n\n const cleanLabelProps = () => {\n const { ref: _ref, ...rest } = context.labelProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <label\n {...cleanLabelProps()}\n class={props.class ?? \"solidaria-SearchField-label\"}\n style={props.style}\n >\n {props.children}\n </label>\n );\n}\n\n/**\n * The input element for a search field.\n */\nexport function SearchFieldInput(props: SearchFieldInputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\"]);\n let inputElement: HTMLInputElement | undefined;\n\n const context = useContext(SearchFieldContext);\n if (!context) {\n throw new Error(\"SearchFieldInput must be used within a SearchField\");\n }\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled;\n },\n });\n\n const renderValues = createMemo<SearchFieldInputRenderProps>(() => ({\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n isDisabled: !!context.isDisabled,\n isInvalid: !!context.isInvalid,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-SearchField-input\",\n },\n renderValues,\n );\n\n const cleanInputProps = () => {\n const { ref: _ref, ...rest } = context.inputProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n const mergedInputProps = () =>\n ({\n ...domProps,\n ...cleanInputProps(),\n ...cleanFocusProps(),\n ...cleanHoverProps(),\n }) as Record<string, unknown>;\n\n onMount(() => {\n const element = inputElement;\n if (!element) {\n return;\n }\n\n const inputHandler = (event: Event) => {\n const handler = mergedInputProps().onInput as\n | JSX.EventHandler<HTMLInputElement, InputEvent>\n | undefined;\n handler?.(\n eventWithCurrentTarget(event, element) as InputEvent & {\n currentTarget: HTMLInputElement;\n target: Element;\n },\n );\n clearDelegatedTextEntryHandlers(element);\n event.stopPropagation();\n };\n const changeHandler = (event: Event) => {\n const handler = mergedInputProps().onChange as\n | JSX.EventHandler<HTMLInputElement, Event>\n | undefined;\n handler?.(\n eventWithCurrentTarget(event, element) as Event & {\n currentTarget: HTMLInputElement;\n target: Element;\n },\n );\n clearDelegatedTextEntryHandlers(element);\n event.stopPropagation();\n };\n\n element.addEventListener(\"input\", inputHandler);\n element.addEventListener(\"change\", changeHandler);\n clearDelegatedTextEntryHandlers(element);\n onCleanup(() => {\n element.removeEventListener(\"input\", inputHandler);\n element.removeEventListener(\"change\", changeHandler);\n });\n });\n\n return (\n <input\n {...mergedInputProps()}\n ref={(element) => {\n inputElement = element;\n context.setInputRef?.(element);\n const ref = (domProps as { ref?: unknown }).ref;\n if (typeof ref === \"function\") {\n ref(element);\n }\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={context.isDisabled || undefined}\n data-invalid={context.isInvalid || undefined}\n />\n );\n}\n\n/**\n * The clear button for a search field.\n */\nexport function SearchFieldClearButton(props: SearchFieldClearButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SearchFieldContext);\n if (!context) {\n throw new Error(\"SearchFieldClearButton must be used within a SearchField\");\n }\n\n const isDisabled = () => !!(context.isDisabled || context.isReadOnly);\n const isEmpty = () => (context.state?.value() ?? \"\") === \"\";\n const clear = () => {\n if (!isDisabled() && !isEmpty()) {\n context.clearButtonProps?.onClick();\n }\n };\n\n const { isPressed, pressProps } = createPress({\n get isDisabled() {\n return context.isDisabled || context.isReadOnly;\n },\n onClick: clear,\n onPress: clear,\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || context.isReadOnly;\n },\n });\n\n const renderValues = createMemo<SearchFieldClearButtonRenderProps>(() => ({\n isPressed: isPressed(),\n isHovered: isHovered(),\n isDisabled: 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-SearchField-clear\",\n },\n renderValues,\n );\n\n const cleanPressProps = () => {\n const { ref: _ref, ...rest } = pressProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <Show when={!isEmpty()}>\n <button\n {...domProps}\n type=\"button\"\n aria-label={context.clearButtonProps?.[\"aria-label\"] ?? \"Clear search\"}\n tabIndex={context.clearButtonProps?.tabIndex ?? -1}\n disabled={context.clearButtonProps?.disabled}\n onMouseDown={context.clearButtonProps?.onMouseDown}\n {...cleanPressProps()}\n onPointerUp={clear}\n onMouseUp={clear}\n onClick={clear}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-pressed={isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={isDisabled() || undefined}\n >\n {renderProps.renderChildren()}\n </button>\n </Show>\n );\n}\n\nSearchField.Label = SearchFieldLabel;\nSearchField.Input = SearchFieldInput;\nSearchField.ClearButton = SearchFieldClearButton;\n"],"mappings":";;;;;;;;;;;;;;;;AAkJA,MAAamF,qBAAqBjF,cAA8C,IAAI;AAEpF,SAASkF,2BACPC,OACAC,aACkB;CAClB,IAAI,CAACA,aAAaC,oBAChB,OAAOF;CAGT,OAAO,IAAIG,MAAMH,OAAO;EACtBI,IAAIC,QAAQC,UAAUC,UAAU;GAC9B,MAAMC,aAAaC,QAAQL,IAAIC,QAAQC,UAAUC,QAAQ;GACzD,IAAID,aAAa,wBAAwBE,eAAeE,KAAAA,GACtD,OAAOT,YAAYC;GAGrB,OAAOM;EACT;EACAG,IAAIN,QAAQC,UAAU;GACpB,OACEG,QAAQE,IAAIN,QAAQC,QAAQ,KAC3BA,aAAa,wBAAwBL,YAAYC,uBAAuBQ,KAAAA;EAE7E;EACAE,QAAQP,QAAQ;GACd,MAAMQ,OAAO,IAAIC,IAAIL,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ext","Show","createSearchField","createFocusRing","createHover","createPress","mergeProps","AriaSearchFieldProps","createSearchFieldState","VALID_VALIDITY_STATE","SearchFieldState","ValidationResult","FormContext","FormProps","FieldErrorContext","FieldErrorContextValue","RenderChildren","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","Provider","TextContext","useAutocompleteInput","SearchFieldRenderProps","isEmpty","isDisabled","isInvalid","isReadOnly","isRequired","value","SearchFieldProps","Omit","defaultValue","onChange","onSubmit","onClear","label","Element","children","class","style","ref","el","HTMLDivElement","SearchFieldInputRenderProps","isFocused","isFocusVisible","isHovered","SearchFieldInputProps","InputHTMLAttributes","HTMLInputElement","SearchFieldClearButtonRenderProps","isPressed","SearchFieldClearButtonProps","ButtonHTMLAttributes","HTMLButtonElement","SearchFieldContextValue","Partial","state","inputProps","clearButtonProps","tabIndex","disabled","onMouseDown","e","MouseEvent","onClick","labelProps","HTMLAttributes","HTMLElement","descriptionProps","errorMessageProps","setInputRef","slots","Record","SearchFieldContext","withFormValidationBehavior","props","formContext","validationBehavior","Proxy","get","target","property","receiver","localValue","Reflect","undefined","has","ownKeys","keys","Set","add","Array","from","getOwnPropertyDescriptor","descriptor","enumerable","configurable","eventWithCurrentTarget","event","Event","element","T","bind","clearDelegatedTextEntryHandlers","delegatedElement","$$input","$$change","SearchField","contextProps","contextSlotProps","slot","contextBaseProps","_state","_inputProps","_clearButtonProps","_labelProps","_descriptionProps","_errorMessageProps","_isDisabled","_isInvalid","_isRequired","_isReadOnly","_setInputRef","_slots","restContextProps","baseProps","autocompleteInput","autocompleteProps","onKeyDown","onFocus","onBlur","mergedProps","local","stateProps","ariaProps","rest","inputRef","searchFieldAria","aria-label","aria-labelledby","aria-describedby","description","errorMessage","placeholder","name","form","type","autoFocus","excludeFromTabOrder","autoComplete","inputMode","enterKeyHint","autoCorrect","autoCapitalize","spellCheck","maxLength","minLength","pattern","onFocusChange","onKeyUp","onCopy","onCut","onPaste","onCompositionStart","onCompositionEnd","onCompositionUpdate","onSelect","onBeforeInput","onInput","renderValues","renderProps","defaultClassName","childRenderValues","domProps","global","fieldValidation","validationErrors","validationDetails","customError","valid","fieldErrorContext","validation","contextValue","fieldChildren","textSlots","_$createComponent","_el$","_$getNextElement","_tmpl$","_ref$","_$use","_$spread","_$mergeProps","data-empty","data-disabled","data-invalid","data-required","data-readonly","_$insert","values","_$runHydrationEvents","SearchFieldLabel","CSSProperties","context","Error","cleanLabelProps","_ref","_el$2","_tmpl$2","SearchFieldInput","inputElement","focusProps","hoverProps","cleanInputProps","cleanFocusProps","cleanHoverProps","autocompleteInputAttrs","mergedInputProps","inputHandler","handler","EventHandler","InputEvent","currentTarget","stopPropagation","changeHandler","addEventListener","removeEventListener","_el$3","_tmpl$3","data-focused","data-focus-visible","data-hovered","SearchFieldClearButton","clear","pressProps","onPress","cleanPressProps","when","_el$4","_tmpl$4","data-pressed","renderChildren","Label","Input","ClearButton"],"sources":["../src/SearchField.tsx"],"sourcesContent":["/**\n * SearchField component for solidaria-components\n *\n * A pre-wired headless search field that combines state + aria hooks.\n * Port of react-aria-components/src/SearchField.tsx\n */\n\nimport {\n type JSX,\n type Context,\n createContext,\n createMemo,\n onCleanup,\n onMount,\n splitProps,\n useContext,\n Show,\n} from \"solid-js\";\nimport {\n createSearchField,\n createFocusRing,\n createHover,\n createPress,\n mergeProps,\n type AriaSearchFieldProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSearchFieldState,\n VALID_VALIDITY_STATE,\n type SearchFieldState,\n type ValidationResult,\n} from \"@proyecto-viviana/solid-stately\";\nimport { FormContext, type FormProps } from \"./Form\";\nimport { FieldErrorContext, type FieldErrorContextValue } from \"./FieldError\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n Provider,\n} from \"./utils\";\nimport { TextContext } from \"./Text\";\nimport { useAutocompleteInput } from \"./Autocomplete\";\n\nexport interface SearchFieldRenderProps {\n /** Whether the search field is empty. */\n isEmpty: boolean;\n /** Whether the search field is disabled. */\n isDisabled: boolean;\n /** Whether the search field is invalid. */\n isInvalid: boolean;\n /** Whether the search field is read-only. */\n isReadOnly: boolean;\n /** Whether the search field is required. */\n isRequired: boolean;\n /** The current value. */\n value: string;\n}\n\nexport interface SearchFieldProps extends Omit<AriaSearchFieldProps, \"label\">, SlotProps {\n /** The current value (controlled). */\n value?: string;\n /** The default value (uncontrolled). */\n defaultValue?: string;\n /** Handler called when the value changes. */\n onChange?: (value: string) => void;\n /** Handler called when the user submits the search. */\n onSubmit?: (value: string) => void;\n /** Handler called when the field is cleared. */\n onClear?: () => void;\n /** A visible label for the search field. */\n label?: JSX.Element;\n /** The children of the component. */\n children?: RenderChildren<SearchFieldRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SearchFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SearchFieldRenderProps>;\n /** Ref for the outer search field element. */\n ref?: (el: HTMLDivElement) => void;\n}\n\nexport interface SearchFieldInputRenderProps {\n /** Whether the input is focused. */\n isFocused: boolean;\n /** Whether the input has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the input is hovered. */\n isHovered: boolean;\n /** Whether the input is disabled. */\n isDisabled: boolean;\n /** Whether the input is invalid. */\n isInvalid: boolean;\n}\n\nexport interface SearchFieldInputProps\n extends SlotProps, Omit<JSX.InputHTMLAttributes<HTMLInputElement>, \"class\" | \"style\"> {\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SearchFieldInputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SearchFieldInputRenderProps>;\n}\n\nexport interface SearchFieldClearButtonRenderProps {\n /** Whether the button is pressed. */\n isPressed: boolean;\n /** Whether the button is hovered. */\n isHovered: boolean;\n /** Whether the button is disabled. */\n isDisabled: boolean;\n}\n\nexport interface SearchFieldClearButtonProps\n extends\n SlotProps,\n Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the button. */\n children?: RenderChildren<SearchFieldClearButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SearchFieldClearButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SearchFieldClearButtonRenderProps>;\n}\n\ninterface SearchFieldContextValue extends Partial<SearchFieldProps> {\n state?: SearchFieldState;\n inputProps?: JSX.InputHTMLAttributes<HTMLInputElement>;\n clearButtonProps?: {\n \"aria-label\": string;\n tabIndex: number;\n disabled?: boolean;\n onMouseDown: (e: MouseEvent) => void;\n onClick: () => void;\n };\n labelProps?: JSX.HTMLAttributes<HTMLElement>;\n descriptionProps?: JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps?: JSX.HTMLAttributes<HTMLElement>;\n isDisabled?: boolean;\n isInvalid?: boolean;\n isRequired?: boolean;\n isReadOnly?: boolean;\n setInputRef?: (el: HTMLInputElement) => void;\n slots?: Record<string, SearchFieldProps>;\n}\n\nexport const SearchFieldContext = createContext<SearchFieldContextValue | null>(null);\n\nfunction withFormValidationBehavior(\n props: SearchFieldProps,\n formContext: FormProps | null,\n): SearchFieldProps {\n if (!formContext?.validationBehavior) {\n return props;\n }\n\n return new Proxy(props, {\n get(target, property, receiver) {\n const localValue = Reflect.get(target, property, receiver);\n if (property === \"validationBehavior\" && localValue === undefined) {\n return formContext.validationBehavior;\n }\n\n return localValue;\n },\n has(target, property) {\n return (\n Reflect.has(target, property) ||\n (property === \"validationBehavior\" && formContext.validationBehavior !== undefined)\n );\n },\n ownKeys(target) {\n const keys = new Set(Reflect.ownKeys(target));\n if (formContext.validationBehavior !== undefined) {\n keys.add(\"validationBehavior\");\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (property === \"validationBehavior\" && formContext.validationBehavior !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => formContext.validationBehavior,\n };\n }\n\n return undefined;\n },\n });\n}\n\nfunction eventWithCurrentTarget<T extends HTMLElement>(event: Event, element: T): Event {\n return new Proxy(event, {\n get(target, property, receiver) {\n if (property === \"target\" || property === \"currentTarget\") {\n return element;\n }\n\n const value = Reflect.get(target, property, receiver);\n return typeof value === \"function\" ? value.bind(target) : value;\n },\n });\n}\n\nfunction clearDelegatedTextEntryHandlers(element: HTMLElement) {\n const delegatedElement = element as HTMLElement & {\n $$input?: unknown;\n $$change?: unknown;\n };\n delete delegatedElement.$$input;\n delete delegatedElement.$$change;\n}\n\n/**\n * A search field allows a user to enter and clear a search query.\n */\nexport function SearchField(props: SearchFieldProps): JSX.Element {\n const formContext = useContext(FormContext);\n const contextProps = useContext(SearchFieldContext);\n const contextSlotProps = contextProps?.slots?.[props.slot ?? \"default\"];\n const contextBaseProps = createMemo<SearchFieldProps>(() => {\n if (!contextProps) return {};\n const {\n state: _state,\n inputProps: _inputProps,\n clearButtonProps: _clearButtonProps,\n labelProps: _labelProps,\n descriptionProps: _descriptionProps,\n errorMessageProps: _errorMessageProps,\n isDisabled: _isDisabled,\n isInvalid: _isInvalid,\n isRequired: _isRequired,\n isReadOnly: _isReadOnly,\n setInputRef: _setInputRef,\n slots: _slots,\n ...restContextProps\n } = contextProps;\n return restContextProps as SearchFieldProps;\n });\n const baseProps = (\n contextProps ? mergeProps(contextBaseProps(), contextSlotProps ?? {}, props) : props\n ) as SearchFieldProps;\n\n // When rendered inside an <Autocomplete>, the FieldInputContext (AutocompleteContext)\n // controls the input's value and keyboard handling: value + onChange make the field's\n // state controlled by the shared autocomplete state (which drives the collection\n // filter), and onKeyDown/onFocus/onBlur chain the autocomplete's virtual-focus\n // navigation into the input. This mirrors RAC's\n // useContextProps(props, inputRef, FieldInputContext). The remaining passthroughs\n // (aria-activedescendant/aria-controls/aria-autocomplete) and the input-ref\n // registration are applied at the <input> in SearchFieldInput.\n const autocompleteInput = useAutocompleteInput();\n const autocompleteProps = autocompleteInput\n ? ({\n get value() {\n return autocompleteInput.inputProps.value();\n },\n onChange: autocompleteInput.inputProps.onChange,\n onKeyDown: autocompleteInput.inputProps\n .onKeyDown as unknown as SearchFieldProps[\"onKeyDown\"],\n onFocus: autocompleteInput.inputProps.onFocus as unknown as SearchFieldProps[\"onFocus\"],\n onBlur: autocompleteInput.inputProps.onBlur as unknown as SearchFieldProps[\"onBlur\"],\n } as Partial<SearchFieldProps>)\n : undefined;\n\n const mergedProps = withFormValidationBehavior(\n autocompleteProps\n ? (mergeProps(baseProps, autocompleteProps) as SearchFieldProps)\n : baseProps,\n formContext,\n );\n\n const [local, stateProps, ariaProps, rest] = splitProps(\n mergedProps,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\"value\", \"defaultValue\", \"onChange\", \"onSubmit\", \"onClear\"],\n [\n \"label\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"isDisabled\",\n \"isReadOnly\",\n \"isRequired\",\n \"isInvalid\",\n \"description\",\n \"errorMessage\",\n \"id\",\n \"autoFocus\",\n \"excludeFromTabOrder\",\n \"name\",\n \"form\",\n \"validationBehavior\",\n \"type\",\n \"placeholder\",\n \"autoComplete\",\n \"inputMode\",\n \"enterKeyHint\",\n \"autoCorrect\",\n \"autoCapitalize\",\n \"spellCheck\",\n \"maxLength\",\n \"minLength\",\n \"pattern\",\n \"onFocus\",\n \"onBlur\",\n \"onFocusChange\",\n \"onKeyDown\",\n \"onKeyUp\",\n \"onCopy\",\n \"onCut\",\n \"onPaste\",\n \"onCompositionStart\",\n \"onCompositionEnd\",\n \"onCompositionUpdate\",\n \"onSelect\",\n \"onBeforeInput\",\n \"onInput\",\n ],\n );\n\n const state = createSearchFieldState({\n get value() {\n return stateProps.value;\n },\n get defaultValue() {\n return stateProps.defaultValue;\n },\n get onChange() {\n return stateProps.onChange;\n },\n });\n\n let inputRef: HTMLInputElement | undefined;\n const setInputRef = (el: HTMLInputElement) => {\n inputRef = el;\n };\n\n const searchFieldAria = createSearchField(\n {\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly;\n },\n get isRequired() {\n return ariaProps.isRequired;\n },\n get isInvalid() {\n return ariaProps.isInvalid;\n },\n get label() {\n return ariaProps.label;\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 description() {\n return ariaProps.description;\n },\n get errorMessage() {\n return ariaProps.errorMessage;\n },\n get placeholder() {\n return ariaProps.placeholder;\n },\n get name() {\n return ariaProps.name;\n },\n get form() {\n return ariaProps.form;\n },\n get validationBehavior() {\n return ariaProps.validationBehavior;\n },\n get type() {\n return ariaProps.type;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get excludeFromTabOrder() {\n return ariaProps.excludeFromTabOrder;\n },\n get autoComplete() {\n return ariaProps.autoComplete;\n },\n get inputMode() {\n return ariaProps.inputMode;\n },\n get enterKeyHint() {\n return ariaProps.enterKeyHint;\n },\n get autoCorrect() {\n return ariaProps.autoCorrect;\n },\n get autoCapitalize() {\n return ariaProps.autoCapitalize;\n },\n get spellCheck() {\n return ariaProps.spellCheck;\n },\n get maxLength() {\n return ariaProps.maxLength;\n },\n get minLength() {\n return ariaProps.minLength;\n },\n get pattern() {\n return ariaProps.pattern;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get onCopy() {\n return ariaProps.onCopy;\n },\n get onCut() {\n return ariaProps.onCut;\n },\n get onPaste() {\n return ariaProps.onPaste;\n },\n get onCompositionStart() {\n return ariaProps.onCompositionStart;\n },\n get onCompositionEnd() {\n return ariaProps.onCompositionEnd;\n },\n get onCompositionUpdate() {\n return ariaProps.onCompositionUpdate;\n },\n get onSelect() {\n return ariaProps.onSelect;\n },\n get onBeforeInput() {\n return ariaProps.onBeforeInput;\n },\n get onInput() {\n return ariaProps.onInput;\n },\n get onSubmit() {\n return stateProps.onSubmit;\n },\n get onClear() {\n return stateProps.onClear;\n },\n },\n state,\n () => inputRef ?? null,\n );\n\n const renderValues = createMemo<SearchFieldRenderProps>(() => ({\n isEmpty: state.value() === \"\",\n isDisabled: ariaProps.isDisabled ?? false,\n isInvalid: searchFieldAria.isInvalid ?? false,\n isRequired: ariaProps.isRequired ?? false,\n isReadOnly: ariaProps.isReadOnly ?? false,\n value: state.value(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return local.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-SearchField\",\n },\n renderValues,\n );\n const childRenderValues: SearchFieldRenderProps = {\n get isEmpty() {\n return state.value() === \"\";\n },\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return searchFieldAria.isInvalid ?? false;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n get value() {\n return state.value();\n },\n };\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const fieldValidation = createMemo<ValidationResult>(() => {\n const isInvalid = searchFieldAria.isInvalid;\n const errorMessage = ariaProps.errorMessage;\n const validationErrors = isInvalid && typeof errorMessage === \"string\" ? [errorMessage] : [];\n\n return {\n isInvalid,\n validationErrors,\n validationDetails: isInvalid\n ? { ...VALID_VALIDITY_STATE, customError: true, valid: false }\n : VALID_VALIDITY_STATE,\n };\n });\n const fieldErrorContext: FieldErrorContextValue = {\n get validation() {\n return fieldValidation();\n },\n get errorMessageProps() {\n return searchFieldAria.errorMessageProps;\n },\n };\n const contextValue: SearchFieldContextValue = {\n state,\n get inputProps() {\n return searchFieldAria.inputProps;\n },\n get clearButtonProps() {\n return searchFieldAria.clearButtonProps;\n },\n get labelProps() {\n return searchFieldAria.labelProps as JSX.HTMLAttributes<HTMLElement>;\n },\n get descriptionProps() {\n return searchFieldAria.descriptionProps;\n },\n get errorMessageProps() {\n return searchFieldAria.errorMessageProps;\n },\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return searchFieldAria.isInvalid ?? false;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n setInputRef,\n };\n const fieldChildren = () => {\n const children = local.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n };\n // Provide the description / errorMessage props as `TextContext` slots (mirrors\n // react-aria-components' SearchField), so a `<Text slot=\"description\">` /\n // `<Text slot=\"errorMessage\">` child picks up the `id` its `aria-describedby`\n // references. Additive: existing consumers reading these off\n // `SearchFieldContext` are unaffected.\n const textSlots = {\n slots: {\n get description() {\n return searchFieldAria.descriptionProps;\n },\n get errorMessage() {\n return searchFieldAria.errorMessageProps;\n },\n },\n };\n\n return (\n <FieldErrorContext.Provider value={fieldErrorContext}>\n <SearchFieldContext.Provider value={contextValue}>\n <div\n {...domProps()}\n ref={local.ref}\n class={renderProps.class()}\n style={renderProps.style()}\n data-empty={state.value() === \"\" || undefined}\n data-disabled={ariaProps.isDisabled || undefined}\n data-invalid={searchFieldAria.isInvalid || undefined}\n data-required={ariaProps.isRequired || undefined}\n data-readonly={ariaProps.isReadOnly || undefined}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n {fieldChildren()}\n </Provider>\n </div>\n </SearchFieldContext.Provider>\n </FieldErrorContext.Provider>\n );\n}\n\n/**\n * The label for a search field.\n */\nexport function SearchFieldLabel(props: {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}): JSX.Element {\n const context = useContext(SearchFieldContext);\n if (!context) {\n throw new Error(\"SearchFieldLabel must be used within a SearchField\");\n }\n\n const cleanLabelProps = () => {\n const { ref: _ref, ...rest } = context.labelProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <label\n {...cleanLabelProps()}\n class={props.class ?? \"solidaria-SearchField-label\"}\n style={props.style}\n >\n {props.children}\n </label>\n );\n}\n\n/**\n * The input element for a search field.\n */\nexport function SearchFieldInput(props: SearchFieldInputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\"]);\n let inputElement: HTMLInputElement | undefined;\n\n const context = useContext(SearchFieldContext);\n if (!context) {\n throw new Error(\"SearchFieldInput must be used within a SearchField\");\n }\n\n // Inside an <Autocomplete>, expose the ARIA attributes that identify the\n // controlled collection and its virtually-focused option. value/onChange and the\n // keyboard handlers are already merged upstream in SearchField(); here we only add\n // the passthrough attributes that createTextField doesn't forward, and register the\n // input element as the autocomplete inputRef so the beforeinput + reverse-path\n // (aria-activedescendant mirror) listeners bind. Mirrors RAC's\n // [InputContext, {...inputProps, ref: inputRef}].\n const autocompleteInput = useAutocompleteInput();\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled;\n },\n });\n\n const renderValues = createMemo<SearchFieldInputRenderProps>(() => ({\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n isDisabled: !!context.isDisabled,\n isInvalid: !!context.isInvalid,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-SearchField-input\",\n },\n renderValues,\n );\n\n const cleanInputProps = () => {\n const { ref: _ref, ...rest } = context.inputProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n const autocompleteInputAttrs = (): Record<string, unknown> => {\n if (!autocompleteInput) {\n return {};\n }\n const inputProps = autocompleteInput.inputProps;\n return {\n \"aria-controls\": inputProps[\"aria-controls\"],\n \"aria-autocomplete\": inputProps[\"aria-autocomplete\"],\n \"aria-activedescendant\": inputProps[\"aria-activedescendant\"](),\n };\n };\n\n const mergedInputProps = () =>\n ({\n ...domProps,\n ...cleanInputProps(),\n ...cleanFocusProps(),\n ...cleanHoverProps(),\n ...autocompleteInputAttrs(),\n }) as Record<string, unknown>;\n\n onMount(() => {\n const element = inputElement;\n if (!element) {\n return;\n }\n\n const inputHandler = (event: Event) => {\n const handler = mergedInputProps().onInput as\n | JSX.EventHandler<HTMLInputElement, InputEvent>\n | undefined;\n handler?.(\n eventWithCurrentTarget(event, element) as InputEvent & {\n currentTarget: HTMLInputElement;\n target: Element;\n },\n );\n clearDelegatedTextEntryHandlers(element);\n event.stopPropagation();\n };\n const changeHandler = (event: Event) => {\n const handler = mergedInputProps().onChange as\n | JSX.EventHandler<HTMLInputElement, Event>\n | undefined;\n handler?.(\n eventWithCurrentTarget(event, element) as Event & {\n currentTarget: HTMLInputElement;\n target: Element;\n },\n );\n clearDelegatedTextEntryHandlers(element);\n event.stopPropagation();\n };\n\n element.addEventListener(\"input\", inputHandler);\n element.addEventListener(\"change\", changeHandler);\n clearDelegatedTextEntryHandlers(element);\n onCleanup(() => {\n element.removeEventListener(\"input\", inputHandler);\n element.removeEventListener(\"change\", changeHandler);\n });\n });\n\n return (\n <input\n {...mergedInputProps()}\n ref={(element) => {\n inputElement = element;\n context.setInputRef?.(element);\n autocompleteInput?.inputRef(element);\n const ref = (domProps as { ref?: unknown }).ref;\n if (typeof ref === \"function\") {\n ref(element);\n }\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={context.isDisabled || undefined}\n data-invalid={context.isInvalid || undefined}\n />\n );\n}\n\n/**\n * The clear button for a search field.\n */\nexport function SearchFieldClearButton(props: SearchFieldClearButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SearchFieldContext);\n if (!context) {\n throw new Error(\"SearchFieldClearButton must be used within a SearchField\");\n }\n\n const isDisabled = () => !!(context.isDisabled || context.isReadOnly);\n const isEmpty = () => (context.state?.value() ?? \"\") === \"\";\n const clear = () => {\n if (!isDisabled() && !isEmpty()) {\n context.clearButtonProps?.onClick();\n }\n };\n\n const { isPressed, pressProps } = createPress({\n get isDisabled() {\n return context.isDisabled || context.isReadOnly;\n },\n onClick: clear,\n onPress: clear,\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || context.isReadOnly;\n },\n });\n\n const renderValues = createMemo<SearchFieldClearButtonRenderProps>(() => ({\n isPressed: isPressed(),\n isHovered: isHovered(),\n isDisabled: 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-SearchField-clear\",\n },\n renderValues,\n );\n\n const cleanPressProps = () => {\n const { ref: _ref, ...rest } = pressProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <Show when={!isEmpty()}>\n <button\n {...domProps}\n type=\"button\"\n aria-label={context.clearButtonProps?.[\"aria-label\"] ?? \"Clear search\"}\n tabIndex={context.clearButtonProps?.tabIndex ?? -1}\n disabled={context.clearButtonProps?.disabled}\n onMouseDown={context.clearButtonProps?.onMouseDown}\n {...cleanPressProps()}\n onPointerUp={clear}\n onMouseUp={clear}\n onClick={clear}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-pressed={isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={isDisabled() || undefined}\n >\n {renderProps.renderChildren()}\n </button>\n </Show>\n );\n}\n\nSearchField.Label = SearchFieldLabel;\nSearchField.Input = SearchFieldInput;\nSearchField.ClearButton = S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
|
|
3
3
|
import { TextContext } from "./Text.jsx";
|
|
4
4
|
import { FormContext } from "./Form.jsx";
|
|
5
|
+
import { useAutocompleteInput } from "./Autocomplete.jsx";
|
|
5
6
|
import { Show, createContext, createMemo, onCleanup, onMount, splitProps, useContext } from "solid-js";
|
|
6
7
|
import { createFocusRing, createHover, createPress, createSearchField, mergeProps as mergeProps$1 } from "@proyecto-viviana/solidaria";
|
|
7
8
|
import { VALID_VALIDITY_STATE, createSearchFieldState } from "@proyecto-viviana/solid-stately";
|
|
@@ -64,7 +65,18 @@ function SearchField(props) {
|
|
|
64
65
|
const { state: _state, inputProps: _inputProps, clearButtonProps: _clearButtonProps, labelProps: _labelProps, descriptionProps: _descriptionProps, errorMessageProps: _errorMessageProps, isDisabled: _isDisabled, isInvalid: _isInvalid, isRequired: _isRequired, isReadOnly: _isReadOnly, setInputRef: _setInputRef, slots: _slots, ...restContextProps } = contextProps;
|
|
65
66
|
return restContextProps;
|
|
66
67
|
});
|
|
67
|
-
const
|
|
68
|
+
const baseProps = contextProps ? mergeProps$1(contextBaseProps(), contextSlotProps ?? {}, props) : props;
|
|
69
|
+
const autocompleteInput = useAutocompleteInput();
|
|
70
|
+
const autocompleteProps = autocompleteInput ? {
|
|
71
|
+
get value() {
|
|
72
|
+
return autocompleteInput.inputProps.value();
|
|
73
|
+
},
|
|
74
|
+
onChange: autocompleteInput.inputProps.onChange,
|
|
75
|
+
onKeyDown: autocompleteInput.inputProps.onKeyDown,
|
|
76
|
+
onFocus: autocompleteInput.inputProps.onFocus,
|
|
77
|
+
onBlur: autocompleteInput.inputProps.onBlur
|
|
78
|
+
} : void 0;
|
|
79
|
+
const [local, stateProps, ariaProps, rest] = splitProps(withFormValidationBehavior(autocompleteProps ? mergeProps$1(baseProps, autocompleteProps) : baseProps, formContext), [
|
|
68
80
|
"children",
|
|
69
81
|
"class",
|
|
70
82
|
"style",
|
|
@@ -399,6 +411,7 @@ function SearchFieldInput(props) {
|
|
|
399
411
|
let inputElement;
|
|
400
412
|
const context = useContext(SearchFieldContext);
|
|
401
413
|
if (!context) throw new Error("SearchFieldInput must be used within a SearchField");
|
|
414
|
+
const autocompleteInput = useAutocompleteInput();
|
|
402
415
|
const { isFocused, isFocusVisible, focusProps } = createFocusRing();
|
|
403
416
|
const { isHovered, hoverProps } = createHover({ get isDisabled() {
|
|
404
417
|
return context.isDisabled;
|
|
@@ -427,11 +440,21 @@ function SearchFieldInput(props) {
|
|
|
427
440
|
const { ref: _ref, ...rest } = hoverProps;
|
|
428
441
|
return rest;
|
|
429
442
|
};
|
|
443
|
+
const autocompleteInputAttrs = () => {
|
|
444
|
+
if (!autocompleteInput) return {};
|
|
445
|
+
const inputProps = autocompleteInput.inputProps;
|
|
446
|
+
return {
|
|
447
|
+
"aria-controls": inputProps["aria-controls"],
|
|
448
|
+
"aria-autocomplete": inputProps["aria-autocomplete"],
|
|
449
|
+
"aria-activedescendant": inputProps["aria-activedescendant"]()
|
|
450
|
+
};
|
|
451
|
+
};
|
|
430
452
|
const mergedInputProps = () => ({
|
|
431
453
|
...domProps,
|
|
432
454
|
...cleanInputProps(),
|
|
433
455
|
...cleanFocusProps(),
|
|
434
|
-
...cleanHoverProps()
|
|
456
|
+
...cleanHoverProps(),
|
|
457
|
+
...autocompleteInputAttrs()
|
|
435
458
|
});
|
|
436
459
|
onMount(() => {
|
|
437
460
|
const element = inputElement;
|
|
@@ -459,6 +482,7 @@ function SearchFieldInput(props) {
|
|
|
459
482
|
return <input {...mergedInputProps()} ref={(element) => {
|
|
460
483
|
inputElement = element;
|
|
461
484
|
context.setInputRef?.(element);
|
|
485
|
+
autocompleteInput?.inputRef(element);
|
|
462
486
|
const ref = domProps.ref;
|
|
463
487
|
if (typeof ref === "function") ref(element);
|
|
464
488
|
}} class={renderProps.class()} style={renderProps.style()} data-focused={isFocused() || void 0} data-focus-visible={isFocusVisible() || void 0} data-hovered={isHovered() || void 0} data-disabled={context.isDisabled || void 0} data-invalid={context.isInvalid || void 0} />;
|