@solid2-aria/components 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/README.md +6 -0
  2. package/dist/NOTICE.txt +33 -11
  3. package/dist/browser/collection-dnd.js +37 -40
  4. package/dist/browser/collection-dnd.js.map +1 -1
  5. package/dist/browser/color-field.js +12 -6
  6. package/dist/browser/color-field.js.map +1 -1
  7. package/dist/browser/drop-zone.js +6 -3
  8. package/dist/browser/drop-zone.js.map +1 -1
  9. package/dist/browser/grid-list.d.ts +2 -2
  10. package/dist/browser/grid-list.js +8 -7
  11. package/dist/browser/grid-list.js.map +1 -1
  12. package/dist/browser/list-box.js +31 -37
  13. package/dist/browser/list-box.js.map +1 -1
  14. package/dist/browser/menu.js +16 -19
  15. package/dist/browser/menu.js.map +1 -1
  16. package/dist/browser/modal.js +28 -31
  17. package/dist/browser/modal.js.map +1 -1
  18. package/dist/browser/number-field.js +5 -4
  19. package/dist/browser/number-field.js.map +1 -1
  20. package/dist/browser/popover.js +26 -29
  21. package/dist/browser/popover.js.map +1 -1
  22. package/dist/browser/shared-element-transition.js +19 -22
  23. package/dist/browser/shared-element-transition.js.map +1 -1
  24. package/dist/browser/sheet.d.ts +1 -1
  25. package/dist/browser/sheet.js +82 -7
  26. package/dist/browser/sheet.js.map +1 -1
  27. package/dist/browser/table.d.ts +2 -2
  28. package/dist/browser/table.js +5 -2
  29. package/dist/browser/table.js.map +1 -1
  30. package/dist/browser/tabs.d.ts +1 -1
  31. package/dist/browser/tabs.js +65 -26
  32. package/dist/browser/tabs.js.map +1 -1
  33. package/dist/browser/toast.js +43 -46
  34. package/dist/browser/toast.js.map +1 -1
  35. package/dist/browser/token-field.js +0 -1
  36. package/dist/browser/token-field.js.map +1 -1
  37. package/dist/browser/tooltip.js +22 -25
  38. package/dist/browser/tooltip.js.map +1 -1
  39. package/dist/browser/tree.js +21 -10
  40. package/dist/browser/tree.js.map +1 -1
  41. package/dist/server/calendar.js +3 -1
  42. package/dist/server/calendar.js.map +1 -1
  43. package/dist/server/checkbox.js +3 -1
  44. package/dist/server/checkbox.js.map +1 -1
  45. package/dist/server/collection-dnd.js +8 -36
  46. package/dist/server/collection-dnd.js.map +1 -1
  47. package/dist/server/color-field.js +7 -2
  48. package/dist/server/color-field.js.map +1 -1
  49. package/dist/server/color-thumb.js +6 -2
  50. package/dist/server/color-thumb.js.map +1 -1
  51. package/dist/server/drop-zone.js +12 -5
  52. package/dist/server/drop-zone.js.map +1 -1
  53. package/dist/server/grid-list.js +16 -32
  54. package/dist/server/grid-list.js.map +1 -1
  55. package/dist/server/hidden-date-input.js +3 -1
  56. package/dist/server/hidden-date-input.js.map +1 -1
  57. package/dist/server/list-box.js +25 -69
  58. package/dist/server/list-box.js.map +1 -1
  59. package/dist/server/menu.js +10 -31
  60. package/dist/server/menu.js.map +1 -1
  61. package/dist/server/modal.js +35 -67
  62. package/dist/server/modal.js.map +1 -1
  63. package/dist/server/popover.js +71 -98
  64. package/dist/server/popover.js.map +1 -1
  65. package/dist/server/radio-group.js +3 -1
  66. package/dist/server/radio-group.js.map +1 -1
  67. package/dist/server/shared-element-transition.js +13 -42
  68. package/dist/server/shared-element-transition.js.map +1 -1
  69. package/dist/server/sheet.js +135 -60
  70. package/dist/server/sheet.js.map +1 -1
  71. package/dist/server/slider.js +3 -1
  72. package/dist/server/slider.js.map +1 -1
  73. package/dist/server/switch.js +3 -1
  74. package/dist/server/switch.js.map +1 -1
  75. package/dist/server/table.js +8 -3
  76. package/dist/server/table.js.map +1 -1
  77. package/dist/server/tabs.js +180 -169
  78. package/dist/server/tabs.js.map +1 -1
  79. package/dist/server/toast.js +68 -101
  80. package/dist/server/toast.js.map +1 -1
  81. package/dist/server/token-field.js +2 -2
  82. package/dist/server/tooltip.js +34 -61
  83. package/dist/server/tooltip.js.map +1 -1
  84. package/dist/server/tree.js +156 -130
  85. package/dist/server/tree.js.map +1 -1
  86. package/dist/server/virtualizer.js +3 -1
  87. package/dist/server/virtualizer.js.map +1 -1
  88. package/package.json +12 -11
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.js","names":["{aria.calendarProps[\"aria-label\"]}","aria.calendarProps[\"aria-label\"]","<h2>{aria.calendarProps[\"aria-label\"]}</h2>","aria-label={aria.nextButtonProps[\"aria-label\"]}","aria.nextButtonProps[\"aria-label\"]","disabled={aria.nextButtonProps.isDisabled}","aria.nextButtonProps.isDisabled","<button\n aria-label={aria.nextButtonProps[\"aria-label\"]}\n disabled={aria.nextButtonProps.isDisabled}\n onClick={() => {\n state.focusNextPage();\n }}\n tabindex={-1}\n />","{render.children}","typeof props.slot === \"string\" && props.slot.length > 0\n ? props.slot\n : undefined","{typeof props.children === \"function\"\n ? props.children(date)\n : null}","dom.table","<dom.table\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.gridProps)\n )}\n ref={(element: HTMLTableElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n style={props.style}\n\n class={props.class ?? \"solid2-aria-CalendarGrid\"}\n render={props.render}\n >\n {typeof props.children === \"function\" ? (\n <>\n <CalendarGridHeader>\n {(day) => <CalendarHeaderCell>{day}</CalendarHeaderCell>}\n </CalendarGridHeader>\n <CalendarGridBody>\n {(date) => (\n <>\n {typeof props.children === \"function\"\n ? props.children(date)\n : null}\n </>\n )}\n </CalendarGridBody>\n </>\n ) : (\n props.children\n )}\n </dom.table>","<For each={ctx.weekDays}>{(day) => <>{props.children(day)}</>}</For>","{props.children(day)}","<tr>\n <For each={ctx.weekDays}>{(day) => <>{props.children(day)}</>}</For>\n </tr>","<td />","<For each={state.getDatesInWeek(week, ctx.startDate)} keyed={false}>\n {(date) => (\n <Show when={date()} fallback={<td />}>\n {(current) => <>{props.children(current())}</>}\n </Show>\n )}\n </For>","{props.children(current())}","<tr>\n <For each={state.getDatesInWeek(week, ctx.startDate)} keyed={false}>\n {(date) => (\n <Show when={date()} fallback={<td />}>\n {(current) => <>{props.children(current())}</>}\n </Show>\n )}\n </For>\n </tr>","dom.div","<dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n render,\n merge(() => aria.calendarProps)\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={\n typeof props.slot === \"string\" && props.slot.length > 0\n ? props.slot\n : undefined\n }\n data-disabled={props.isDisabled === true ? true : undefined}\n data-invalid={state.isValueInvalid || undefined}\n >\n <ButtonContext\n value={{\n slots: {\n get next() {\n return aria.nextButtonProps;\n },\n get previous() {\n return aria.prevButtonProps;\n },\n },\n }}\n >\n <HeadingContext\n value={{\n \"aria-hidden\": \"true\",\n get children() {\n return aria.title;\n },\n level: 2,\n }}\n >\n <CalendarStateContext value={state}>\n <CalendarContext value={contextProps}>\n <TextContext\n value={{\n slots: {\n get errorMessage() {\n return aria.errorMessageProps;\n },\n },\n }}\n >\n <VisuallyHidden>\n <h2>{aria.calendarProps[\"aria-label\"]}</h2>\n </VisuallyHidden>\n {render.children}\n <VisuallyHidden>\n <button\n aria-label={aria.nextButtonProps[\"aria-label\"]}\n disabled={aria.nextButtonProps.isDisabled}\n onClick={() => {\n state.focusNextPage();\n }}\n tabindex={-1}\n />\n </VisuallyHidden>\n </TextContext>\n </CalendarContext>\n </CalendarStateContext>\n </HeadingContext>\n </ButtonContext>\n </dom.div>","<dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n render,\n merge(() => aria.calendarProps)\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={\n typeof props.slot === \"string\" && props.slot.length > 0\n ? props.slot\n : undefined\n }\n data-disabled={props.isDisabled === true ? true : undefined}\n data-invalid={state.isValueInvalid || undefined}\n >\n <ButtonContext\n value={{\n slots: {\n get next() {\n return aria.nextButtonProps;\n },\n get previous() {\n return aria.prevButtonProps;\n },\n },\n }}\n >\n <HeadingContext\n value={{\n \"aria-hidden\": \"true\",\n get children() {\n return aria.title;\n },\n level: 2,\n }}\n >\n <RangeCalendarStateContext value={state}>\n <RangeCalendarContext value={contextProps}>\n <TextContext\n value={{\n slots: {\n get errorMessage() {\n return aria.errorMessageProps;\n },\n },\n }}\n >\n <VisuallyHidden>\n <h2>{aria.calendarProps[\"aria-label\"]}</h2>\n </VisuallyHidden>\n {render.children}\n <VisuallyHidden>\n <button\n aria-label={aria.nextButtonProps[\"aria-label\"]}\n disabled={aria.nextButtonProps.isDisabled}\n onClick={() => {\n state.focusNextPage();\n }}\n tabindex={-1}\n />\n </VisuallyHidden>\n </TextContext>\n </RangeCalendarContext>\n </RangeCalendarStateContext>\n </HeadingContext>\n </ButtonContext>\n </dom.div>","dom.thead","<dom.thead\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => ctx.headerProps)\n )}\n ref={(el: HTMLTableSectionElement) => {\n assignRef(\n untrack(() => props.ref),\n el\n );\n }}\n style={props.style}\n class={props.class ?? \"solid2-aria-CalendarGridHeader\"}\n render={props.render}\n >\n <tr>\n <For each={ctx.weekDays}>{(day) => <>{props.children(day)}</>}</For>\n </tr>\n </dom.thead>","dom.th","<dom.th\n {...filterDOMProps(props, { global: true })}\n ref={(el: HTMLTableCellElement) => {\n assignRef(\n untrack(() => props.ref),\n el\n );\n }}\n style={props.style}\n class={props.class ?? \"solid2-aria-CalendarHeaderCell\"}\n render={props.render}\n >\n {props.children}\n </dom.th>","dom.tbody","<dom.tbody\n {...filterDOMProps(props, { global: true })}\n ref={(el: HTMLTableSectionElement) => {\n assignRef(\n untrack(() => props.ref),\n el\n );\n }}\n style={props.style}\n class={props.class ?? \"solid2-aria-CalendarGridBody\"}\n render={props.render}\n >\n <For each={weeks()}>\n {(week) => (\n <tr>\n <For each={state.getDatesInWeek(week, ctx.startDate)} keyed={false}>\n {(date) => (\n <Show when={date()} fallback={<td />}>\n {(current) => <>{props.children(current())}</>}\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>\n </dom.tbody>","<td\n {...aria.cellProps}\n ref={(element: HTMLTableCellElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n >\n <dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.buttonProps),\n merge(() => focus.focusProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n omit(render, \"children\")\n )}\n ref={(element: HTMLDivElement) => {\n setButtonRef(element);\n }}\n data-focused={aria.isFocused || undefined}\n data-hovered={hover.isHovered || undefined}\n data-pressed={aria.isPressed || undefined}\n data-unavailable={aria.isUnavailable || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-focus-visible={values.isFocusVisible || undefined}\n data-outside-visible-range={aria.isOutsideVisibleRange || undefined}\n data-outside-month={outside() || undefined}\n data-selected={aria.isSelected || undefined}\n data-selection-start={values.isSelectionStart || undefined}\n data-selection-end={values.isSelectionEnd || undefined}\n data-invalid={aria.isInvalid || undefined}\n data-today={values.isToday || undefined}\n >\n {content()}\n </dom.div>\n </td>","<dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.buttonProps),\n merge(() => focus.focusProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n omit(render, \"children\")\n )}\n ref={(element: HTMLDivElement) => {\n setButtonRef(element);\n }}\n data-focused={aria.isFocused || undefined}\n data-hovered={hover.isHovered || undefined}\n data-pressed={aria.isPressed || undefined}\n data-unavailable={aria.isUnavailable || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-focus-visible={values.isFocusVisible || undefined}\n data-outside-visible-range={aria.isOutsideVisibleRange || undefined}\n data-outside-month={outside() || undefined}\n data-selected={aria.isSelected || undefined}\n data-selection-start={values.isSelectionStart || undefined}\n data-selection-end={values.isSelectionEnd || undefined}\n data-invalid={aria.isInvalid || undefined}\n data-today={values.isToday || undefined}\n >\n {content()}\n </dom.div>","<Heading\n {\n // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n ...omit(props, \"offset\", \"format\")\n // oxlint-enable solid/reactivity\n }\n class={props.class ?? \"solid2-aria-CalendarHeading\"}\n >\n {text()}\n </Heading>","_$ssrHydrationKey","_$scope","_$escape","_$ssr","_$ssrGroup","_$ssrAttribute","_$memo","_$mergeProps","createInternationalCalendar","createCalendar","_$ssrElement"],"sources":["../../src/calendar.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-aria-components/src/Calendar.tsx.\n * Modified for Solid Aria: composed Solid Aria and Stately primitives with Solid 2 contexts, reactive getters, and DOM refs; uses Solid class props.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport {\n createCalendar as createInternationalCalendar,\n endOfMonth,\n isSameDay,\n isSameMonth,\n isToday,\n} from \"@internationalized/date\";\nimport type {\n CalendarDate,\n CalendarIdentifier,\n Calendar as ICalendar,\n DateDuration,\n} from \"@internationalized/date\";\nimport { createCalendar } from \"@solid2-aria/core/calendar/create-calendar\";\nimport type { AriaCalendarProps } from \"@solid2-aria/core/calendar/create-calendar\";\nimport { createCalendarCell } from \"@solid2-aria/core/calendar/create-calendar-cell\";\nimport type { CalendarCellAria } from \"@solid2-aria/core/calendar/create-calendar-cell\";\nimport { createCalendarGrid } from \"@solid2-aria/core/calendar/create-calendar-grid\";\nimport { createCalendarHeading } from \"@solid2-aria/core/calendar/create-calendar-heading\";\nimport type { CalendarHeadingProps as AriaCalendarHeadingProps } from \"@solid2-aria/core/calendar/create-calendar-heading\";\nimport { createCalendarMonthPicker } from \"@solid2-aria/core/calendar/create-calendar-month-picker\";\nimport type {\n CalendarMonthPickerProps as AriaCalendarMonthPickerProps,\n CalendarMonthPickerAria,\n} from \"@solid2-aria/core/calendar/create-calendar-month-picker\";\nimport { createCalendarYearPicker } from \"@solid2-aria/core/calendar/create-calendar-year-picker\";\nimport type {\n CalendarYearPickerProps as AriaCalendarYearPickerProps,\n CalendarYearPickerAria,\n} from \"@solid2-aria/core/calendar/create-calendar-year-picker\";\nimport { createRangeCalendar } from \"@solid2-aria/core/calendar/create-range-calendar\";\nimport type { AriaRangeCalendarProps } from \"@solid2-aria/core/calendar/create-range-calendar\";\nimport { createFocusRing } from \"@solid2-aria/core/focus/create-focus-ring\";\nimport { createLocale } from \"@solid2-aria/core/i18n/i18n-provider\";\nimport { createHover } from \"@solid2-aria/core/interactions/create-hover\";\nimport { filterDOMProps } from \"@solid2-aria/core/utils/filter-dom-props\";\nimport { mergeProps } from \"@solid2-aria/core/utils/merge-props\";\nimport { requireValue } from \"@solid2-aria/core/utils/require-value\";\nimport { VisuallyHidden } from \"@solid2-aria/core/visually-hidden/visually-hidden\";\nimport { createCalendarState } from \"@solid2-aria/stately/calendar/create-calendar-state\";\nimport { createRangeCalendarState } from \"@solid2-aria/stately/calendar/create-range-calendar-state\";\nimport type {\n CalendarState,\n CalendarSelectionMode,\n RangeCalendarState,\n DateValue,\n} from \"@solid2-aria/stately/calendar/types\";\nimport type { HoverEvents } from \"@solid2-aria/types-shared\";\nimport type {\n GlobalDOMAttributes,\n DOMAttributes,\n} from \"@solid2-aria/types-shared-web\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n untrack,\n merge,\n createSignal,\n createContext,\n createMemo,\n For,\n Show,\n omit,\n useContext,\n} from \"solid-js\";\n\nimport { ButtonContext } from \"./button\";\nimport { Heading, HeadingContext } from \"./heading\";\nimport type { HeadingProps } from \"./heading\";\nimport { TextContext } from \"./text\";\nimport {\n dom,\n assignRef,\n createContextProps,\n createSlottedContext,\n createRenderProps,\n} from \"./utils\";\nimport type {\n ContextValue,\n RenderProps,\n StyleProps,\n SlotProps,\n DOMRenderProps,\n Ref,\n} from \"./utils\";\n\nexport interface CalendarRenderProps<\n M extends CalendarSelectionMode = \"single\",\n> {\n isDisabled: boolean;\n state: CalendarState<M>;\n isInvalid: boolean;\n}\n\nexport interface RangeCalendarRenderProps extends Omit<\n CalendarRenderProps,\n \"state\"\n> {\n state: RangeCalendarState;\n}\n\nexport interface CalendarProps<\n T extends DateValue,\n M extends CalendarSelectionMode = \"single\",\n>\n extends\n Omit<AriaCalendarProps<T, M>, \"errorMessage\" | \"validationState\">,\n RenderProps<CalendarRenderProps<M>>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n visibleDuration?: DateDuration;\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport interface RangeCalendarProps<T extends DateValue>\n extends\n Omit<AriaRangeCalendarProps<T>, \"errorMessage\" | \"validationState\">,\n RenderProps<RangeCalendarRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n visibleDuration?: DateDuration;\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar;\n ref?: Ref<HTMLDivElement>;\n}\n\ntype CalendarContextProps = CalendarProps<DateValue, CalendarSelectionMode>;\n\nexport const CalendarContext =\n createContext<ContextValue<CalendarContextProps, HTMLDivElement>>(null);\n\nexport const RangeCalendarContext =\n createContext<ContextValue<RangeCalendarProps<DateValue>, HTMLDivElement>>(\n null\n );\n\nexport const CalendarStateContext =\n createContext<CalendarState<CalendarSelectionMode> | null>(null);\n\nexport const RangeCalendarStateContext =\n createContext<RangeCalendarState | null>(null);\n\nexport function Calendar<\n T extends DateValue,\n M extends CalendarSelectionMode = \"single\",\n>(input: CalendarProps<T, M>): JSX.Element {\n const [props, , setRef] = createContextProps(\n input,\n untrack(() => input.ref),\n CalendarContext\n );\n\n const locale = createLocale();\n // SAFETY: A calendar subtree preserves its input date class and selection mode; the shared context represents both supported modes.\n // oxlint-disable-next-line anti-slop/no-chained-type-assertions, typescript/no-unsafe-type-assertion -- Generic callback variance is erased only at this shared context boundary.\n const contextProps = props as unknown as CalendarContextProps;\n\n const state = createCalendarState(\n mergeProps(props, {\n get createCalendar() {\n return props.createCalendar ?? createInternationalCalendar;\n },\n get locale() {\n return locale.locale;\n },\n })\n );\n\n const aria = createCalendar(props, state);\n\n const values: CalendarRenderProps<M> = {\n get isDisabled() {\n return props.isDisabled ?? false;\n },\n get isInvalid() {\n return state.isValueInvalid;\n },\n state,\n };\n\n const render = createRenderProps(\n mergeProps(props, { defaultClass: \"solid2-aria-Calendar\", values })\n );\n\n return (\n <dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n render,\n merge(() => aria.calendarProps)\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={\n typeof props.slot === \"string\" && props.slot.length > 0\n ? props.slot\n : undefined\n }\n data-disabled={props.isDisabled === true ? true : undefined}\n data-invalid={state.isValueInvalid || undefined}\n >\n <ButtonContext\n value={{\n slots: {\n get next() {\n return aria.nextButtonProps;\n },\n get previous() {\n return aria.prevButtonProps;\n },\n },\n }}\n >\n <HeadingContext\n value={{\n \"aria-hidden\": \"true\",\n get children() {\n return aria.title;\n },\n level: 2,\n }}\n >\n <CalendarStateContext value={state}>\n <CalendarContext value={contextProps}>\n <TextContext\n value={{\n slots: {\n get errorMessage() {\n return aria.errorMessageProps;\n },\n },\n }}\n >\n <VisuallyHidden>\n <h2>{aria.calendarProps[\"aria-label\"]}</h2>\n </VisuallyHidden>\n {render.children}\n <VisuallyHidden>\n <button\n aria-label={aria.nextButtonProps[\"aria-label\"]}\n disabled={aria.nextButtonProps.isDisabled}\n onClick={() => {\n state.focusNextPage();\n }}\n tabindex={-1}\n />\n </VisuallyHidden>\n </TextContext>\n </CalendarContext>\n </CalendarStateContext>\n </HeadingContext>\n </ButtonContext>\n </dom.div>\n );\n}\n\nexport function RangeCalendar<T extends DateValue>(\n input: RangeCalendarProps<T>\n): JSX.Element {\n const [props, ref, setRef] = createContextProps(\n input,\n untrack(() => input.ref),\n RangeCalendarContext\n );\n\n const locale = createLocale();\n\n // SAFETY: Range calendar state preserves the date class supplied by its value and callback; the internal factory exposes the common DateValue interface.\n // oxlint-disable-next-line anti-slop/no-chained-type-assertions, typescript/no-unsafe-type-assertion -- Widen the invariant generic callback at the state and context boundary.\n const contextProps = props as unknown as RangeCalendarProps<DateValue>;\n\n const state = createRangeCalendarState(\n mergeProps(contextProps, {\n get createCalendar() {\n return props.createCalendar ?? createInternationalCalendar;\n },\n get locale() {\n return locale.locale;\n },\n })\n );\n\n const aria = createRangeCalendar(props, state, ref);\n\n const values: RangeCalendarRenderProps = {\n get isDisabled() {\n return props.isDisabled ?? false;\n },\n get isInvalid() {\n return state.isValueInvalid;\n },\n state,\n };\n\n const render = createRenderProps(\n mergeProps(props, { defaultClass: \"solid2-aria-RangeCalendar\", values })\n );\n\n return (\n <dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n render,\n merge(() => aria.calendarProps)\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={\n typeof props.slot === \"string\" && props.slot.length > 0\n ? props.slot\n : undefined\n }\n data-disabled={props.isDisabled === true ? true : undefined}\n data-invalid={state.isValueInvalid || undefined}\n >\n <ButtonContext\n value={{\n slots: {\n get next() {\n return aria.nextButtonProps;\n },\n get previous() {\n return aria.prevButtonProps;\n },\n },\n }}\n >\n <HeadingContext\n value={{\n \"aria-hidden\": \"true\",\n get children() {\n return aria.title;\n },\n level: 2,\n }}\n >\n <RangeCalendarStateContext value={state}>\n <RangeCalendarContext value={contextProps}>\n <TextContext\n value={{\n slots: {\n get errorMessage() {\n return aria.errorMessageProps;\n },\n },\n }}\n >\n <VisuallyHidden>\n <h2>{aria.calendarProps[\"aria-label\"]}</h2>\n </VisuallyHidden>\n {render.children}\n <VisuallyHidden>\n <button\n aria-label={aria.nextButtonProps[\"aria-label\"]}\n disabled={aria.nextButtonProps.isDisabled}\n onClick={() => {\n state.focusNextPage();\n }}\n tabindex={-1}\n />\n </VisuallyHidden>\n </TextContext>\n </RangeCalendarContext>\n </RangeCalendarStateContext>\n </HeadingContext>\n </ButtonContext>\n </dom.div>\n );\n}\n\ninterface InternalCalendarGridContextValue {\n headerProps: DOMAttributes;\n weekDays: string[];\n startDate: CalendarDate;\n weeksInMonth: number;\n}\n\nconst InternalCalendarGridContext =\n createContext<InternalCalendarGridContextValue | null>(null);\n\nexport interface CalendarGridProps\n extends\n StyleProps,\n DOMRenderProps<\"table\", undefined>,\n GlobalDOMAttributes<HTMLTableElement> {\n children?: JSX.Element | ((date: CalendarDate) => JSX.Element);\n offset?: DateDuration;\n weekdayStyle?: \"narrow\" | \"short\" | \"long\";\n ref?: Ref<HTMLTableElement>;\n}\n\nexport interface CalendarGridHeaderProps\n extends\n StyleProps,\n DOMRenderProps<\"thead\", undefined>,\n GlobalDOMAttributes<HTMLTableSectionElement> {\n children: (day: string) => JSX.Element;\n ref?: Ref<HTMLTableSectionElement>;\n}\n\nexport interface CalendarHeaderCellProps\n extends\n StyleProps,\n DOMRenderProps<\"th\", undefined>,\n GlobalDOMAttributes<HTMLTableCellElement> {\n children?: JSX.Element;\n ref?: Ref<HTMLTableCellElement>;\n id?: string;\n}\n\nexport interface CalendarGridBodyProps\n extends\n StyleProps,\n DOMRenderProps<\"tbody\", undefined>,\n GlobalDOMAttributes<HTMLTableSectionElement> {\n children: (date: CalendarDate) => JSX.Element;\n ref?: Ref<HTMLTableSectionElement>;\n}\n\nfunction calendarState() {\n return (\n useContext(CalendarStateContext) ??\n requireValue(\n useContext(RangeCalendarStateContext),\n \"Expected required element or component context\"\n )\n );\n}\n\nexport function CalendarGrid(props: CalendarGridProps): JSX.Element {\n const state = calendarState();\n const calendar = createSlottedContext(CalendarContext);\n const rangeCalendar = createSlottedContext(RangeCalendarContext);\n\n const start = createMemo(() =>\n props.offset\n ? state.visibleRange.start.add(props.offset)\n : state.visibleRange.start\n );\n\n const aria = createCalendarGrid(\n {\n get endDate() {\n return endOfMonth(start());\n },\n get firstDayOfWeek() {\n return calendar?.firstDayOfWeek ?? rangeCalendar?.firstDayOfWeek;\n },\n get startDate() {\n return start();\n },\n get weekdayStyle() {\n return props.weekdayStyle;\n },\n },\n state\n );\n\n const context = {\n get headerProps() {\n return aria.headerProps;\n },\n get startDate() {\n return start();\n },\n get weekDays() {\n return aria.weekDays;\n },\n get weeksInMonth() {\n return aria.weeksInMonth;\n },\n };\n\n return (\n <InternalCalendarGridContext value={context}>\n <dom.table\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.gridProps)\n )}\n ref={(element: HTMLTableElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n style={props.style}\n\n class={props.class ?? \"solid2-aria-CalendarGrid\"}\n render={props.render}\n >\n {typeof props.children === \"function\" ? (\n <>\n <CalendarGridHeader>\n {(day) => <CalendarHeaderCell>{day}</CalendarHeaderCell>}\n </CalendarGridHeader>\n <CalendarGridBody>\n {(date) => (\n <>\n {typeof props.children === \"function\"\n ? props.children(date)\n : null}\n </>\n )}\n </CalendarGridBody>\n </>\n ) : (\n props.children\n )}\n </dom.table>\n </InternalCalendarGridContext>\n );\n}\n\nexport function CalendarGridHeader(\n props: CalendarGridHeaderProps\n): JSX.Element {\n const ctx = requireValue(\n useContext(InternalCalendarGridContext),\n \"Expected required element or component context\"\n );\n\n return (\n <dom.thead\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => ctx.headerProps)\n )}\n ref={(el: HTMLTableSectionElement) => {\n assignRef(\n untrack(() => props.ref),\n el\n );\n }}\n style={props.style}\n class={props.class ?? \"solid2-aria-CalendarGridHeader\"}\n render={props.render}\n >\n <tr>\n <For each={ctx.weekDays}>{(day) => <>{props.children(day)}</>}</For>\n </tr>\n </dom.thead>\n );\n}\n\nexport function CalendarHeaderCell(\n props: CalendarHeaderCellProps\n): JSX.Element {\n return (\n <dom.th\n {...filterDOMProps(props, { global: true })}\n ref={(el: HTMLTableCellElement) => {\n assignRef(\n untrack(() => props.ref),\n el\n );\n }}\n style={props.style}\n class={props.class ?? \"solid2-aria-CalendarHeaderCell\"}\n render={props.render}\n >\n {props.children}\n </dom.th>\n );\n}\n\nexport function CalendarGridBody(props: CalendarGridBodyProps): JSX.Element {\n const state = calendarState();\n\n const ctx = requireValue(\n useContext(InternalCalendarGridContext),\n \"Expected required element or component context\"\n );\n\n const weeks = createMemo(() =>\n Array.from({ length: ctx.weeksInMonth }, (_, index) => index)\n );\n\n return (\n <dom.tbody\n {...filterDOMProps(props, { global: true })}\n ref={(el: HTMLTableSectionElement) => {\n assignRef(\n untrack(() => props.ref),\n el\n );\n }}\n style={props.style}\n class={props.class ?? \"solid2-aria-CalendarGridBody\"}\n render={props.render}\n >\n <For each={weeks()}>\n {(week) => (\n <tr>\n <For each={state.getDatesInWeek(week, ctx.startDate)} keyed={false}>\n {(date) => (\n <Show when={date()} fallback={<td />}>\n {(current) => <>{props.children(current())}</>}\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>\n </dom.tbody>\n );\n}\n\nexport interface CalendarCellRenderProps extends Omit<\n CalendarCellAria,\n \"cellProps\" | \"buttonProps\"\n> {\n date: CalendarDate;\n isHovered: boolean;\n isSelectionStart: boolean;\n isSelectionEnd: boolean;\n isFocusVisible: boolean;\n isOutsideMonth: boolean;\n isToday: boolean;\n}\n\nexport interface CalendarCellProps\n extends\n RenderProps<CalendarCellRenderProps>,\n HoverEvents,\n GlobalDOMAttributes<HTMLTableCellElement> {\n date: CalendarDate;\n ref?: Ref<HTMLTableCellElement>;\n}\n\nexport function CalendarCell(props: CalendarCellProps): JSX.Element {\n const state = calendarState();\n const grid = useContext(InternalCalendarGridContext);\n\n const [buttonRef, setButtonRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const outside = () =>\n Boolean(state.visibleDuration.days) || Boolean(state.visibleDuration.weeks)\n ? false\n : !isSameMonth(grid?.startDate ?? state.visibleRange.start, props.date);\n\n const aria = createCalendarCell(\n {\n get date() {\n return props.date;\n },\n get isOutsideMonth() {\n return outside();\n },\n },\n state,\n buttonRef\n );\n\n const focus = createFocusRing();\n\n const hover = createHover(\n mergeProps(props, {\n get isDisabled() {\n return aria.isDisabled || aria.isUnavailable;\n },\n })\n );\n\n const boundary = (end: boolean) =>\n \"highlightedRange\" in state &&\n !!state.highlightedRange &&\n isSameDay(\n props.date,\n end ? state.highlightedRange.end : state.highlightedRange.start\n );\n\n const values: CalendarCellRenderProps = mergeProps(\n omit(aria, \"cellProps\", \"buttonProps\"),\n {\n get date() {\n return props.date;\n },\n get isFocusVisible() {\n return aria.isFocused && focus.isFocusVisible;\n },\n get isHovered() {\n return hover.isHovered;\n },\n get isOutsideMonth() {\n return outside();\n },\n get isSelectionEnd() {\n return boundary(true);\n },\n get isSelectionStart() {\n return boundary(false);\n },\n get isToday() {\n return isToday(props.date, state.timeZone);\n },\n }\n );\n\n const render = createRenderProps(\n mergeProps(props, {\n get defaultChildren() {\n return aria.formattedDate;\n },\n defaultClass: \"solid2-aria-CalendarCell\",\n values,\n })\n );\n\n const content = createMemo(() => render.children);\n\n return (\n <td\n {...aria.cellProps}\n ref={(element: HTMLTableCellElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n >\n <dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.buttonProps),\n merge(() => focus.focusProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n omit(render, \"children\")\n )}\n ref={(element: HTMLDivElement) => {\n setButtonRef(element);\n }}\n data-focused={aria.isFocused || undefined}\n data-hovered={hover.isHovered || undefined}\n data-pressed={aria.isPressed || undefined}\n data-unavailable={aria.isUnavailable || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-focus-visible={values.isFocusVisible || undefined}\n data-outside-visible-range={aria.isOutsideVisibleRange || undefined}\n data-outside-month={outside() || undefined}\n data-selected={aria.isSelected || undefined}\n data-selection-start={values.isSelectionStart || undefined}\n data-selection-end={values.isSelectionEnd || undefined}\n data-invalid={aria.isInvalid || undefined}\n data-today={values.isToday || undefined}\n >\n {content()}\n </dom.div>\n </td>\n );\n}\n\nexport interface CalendarYearPickerProps extends AriaCalendarYearPickerProps {\n children: (props: CalendarYearPickerAria) => JSX.Element;\n}\n\nexport function CalendarYearPicker(\n props: CalendarYearPickerProps\n): JSX.Element {\n const aria = createCalendarYearPicker(props, calendarState());\n\n return untrack(() => props.children(aria));\n}\n\nexport interface CalendarMonthPickerProps extends AriaCalendarMonthPickerProps {\n children: (props: CalendarMonthPickerAria) => JSX.Element;\n}\n\nexport function CalendarMonthPicker(\n props: CalendarMonthPickerProps\n): JSX.Element {\n const aria = createCalendarMonthPicker(props, calendarState());\n\n return untrack(() => props.children(aria));\n}\n\nexport interface CalendarHeadingProps\n extends AriaCalendarHeadingProps, HeadingProps {}\n\nexport function CalendarHeading(props: CalendarHeadingProps): JSX.Element {\n const text = createCalendarHeading(props, calendarState());\n\n return (\n <Heading\n {\n // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n ...omit(props, \"offset\", \"format\")\n // oxlint-enable solid/reactivity\n }\n class={props.class ?? \"solid2-aria-CalendarHeading\"}\n >\n {text()}\n </Heading>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;E,UA2PkBgC,gBAA0C,G,OAAtChC,YAAAA;GAACC,OAAAA,OAAAA,KAAK,cAAc,aAAY;EAAC,CAAA;EAArC,OAAAC,IAAAA,QAAAA,KAAIF,IAAsC;;;;;;;;;;;;;E,WAI1CgC,gBAOC,G,MAPDI,eAAA;GACEjC,OAAAA,CAAAA,aAAAA,cAAYC,OAAAA,KAAK,gBAAgB,eAArB,IAAiC,CAAC,GAC9CC,aAAAA,YAAUC,OAAAA,KAAK,gBAAgB,YAArB,IAA8B,CAAC,CAAA;EAF3CC,GAAAA,CAAAA;EAAA,OAAAA,IAAAA,SAAAA,MAAAA,KAAAA,GAOC;;;;;;;;;;;;;;EAr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,CAgBO,CAAA,CAAA,CAAA;CACP,GApCJ,IAoCI;AAER;AAMA,SAAgB,mBACd,OACa;CACb,MAAM,OAAO,yBAAyB,OAAO,cAAc,CAAC;CAE5D,OAAO,cAAc,MAAM,SAAS,IAAI,CAAC;AAC3C;AAMA,SAAgB,oBACd,OACa;CACb,MAAM,OAAO,0BAA0B,OAAO,cAAc,CAAC;CAE7D,OAAO,cAAc,MAAM,SAAS,IAAI,CAAC;AAC3C;AAKA,SAAgB,gBAAgB,OAA0C;CACxE,MAAM,OAAO,sBAAsB,OAAO,cAAc,CAAC;CAEzD,OAAA,QACEC,mBACE;EAEK,OAAA,KAAK,OAAO,UAAU,QAAQ;CAEnC,GALF,IAAA,MAMS,OAEN,IACM,CAAA,CAAA;AAEb"}
1
+ {"version":3,"file":"calendar.js","names":["{aria.calendarProps[\"aria-label\"]}","aria.calendarProps[\"aria-label\"]","<h2>{aria.calendarProps[\"aria-label\"]}</h2>","aria-label={aria.nextButtonProps[\"aria-label\"]}","aria.nextButtonProps[\"aria-label\"]","disabled={aria.nextButtonProps.isDisabled}","aria.nextButtonProps.isDisabled","<button\n aria-label={aria.nextButtonProps[\"aria-label\"]}\n disabled={aria.nextButtonProps.isDisabled}\n onClick={() => {\n state.focusNextPage();\n }}\n tabindex={-1}\n />","{render.children}","typeof props.slot === \"string\" && props.slot.length > 0\n ? props.slot\n : undefined","{typeof props.children === \"function\"\n ? props.children(date)\n : null}","dom.table","<dom.table\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.gridProps)\n )}\n ref={(element: HTMLTableElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n style={props.style}\n\n class={props.class ?? \"solid2-aria-CalendarGrid\"}\n render={props.render}\n >\n {typeof props.children === \"function\" ? (\n <>\n <CalendarGridHeader>\n {(day) => <CalendarHeaderCell>{day}</CalendarHeaderCell>}\n </CalendarGridHeader>\n <CalendarGridBody>\n {(date) => (\n <>\n {typeof props.children === \"function\"\n ? props.children(date)\n : null}\n </>\n )}\n </CalendarGridBody>\n </>\n ) : (\n props.children\n )}\n </dom.table>","<For each={ctx.weekDays}>{(day) => <>{props.children(day)}</>}</For>","{props.children(day)}","<tr>\n <For each={ctx.weekDays}>{(day) => <>{props.children(day)}</>}</For>\n </tr>","<td />","<For each={state.getDatesInWeek(week, ctx.startDate)} keyed={false}>\n {(date) => (\n <Show when={date()} fallback={<td />}>\n {(current) => <>{props.children(current())}</>}\n </Show>\n )}\n </For>","{props.children(current())}","<tr>\n <For each={state.getDatesInWeek(week, ctx.startDate)} keyed={false}>\n {(date) => (\n <Show when={date()} fallback={<td />}>\n {(current) => <>{props.children(current())}</>}\n </Show>\n )}\n </For>\n </tr>","dom.div","<dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n render,\n merge(() => aria.calendarProps)\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={\n typeof props.slot === \"string\" && props.slot.length > 0\n ? props.slot\n : undefined\n }\n data-disabled={props.isDisabled === true ? true : undefined}\n data-invalid={state.isValueInvalid || undefined}\n >\n <ButtonContext\n value={{\n slots: {\n get next() {\n return aria.nextButtonProps;\n },\n get previous() {\n return aria.prevButtonProps;\n },\n },\n }}\n >\n <HeadingContext\n value={{\n \"aria-hidden\": \"true\",\n get children() {\n return aria.title;\n },\n level: 2,\n }}\n >\n <CalendarStateContext value={state}>\n <CalendarContext value={contextProps}>\n <TextContext\n value={{\n slots: {\n get errorMessage() {\n return aria.errorMessageProps;\n },\n },\n }}\n >\n <VisuallyHidden>\n <h2>{aria.calendarProps[\"aria-label\"]}</h2>\n </VisuallyHidden>\n {render.children}\n <VisuallyHidden>\n <button\n aria-label={aria.nextButtonProps[\"aria-label\"]}\n disabled={aria.nextButtonProps.isDisabled}\n onClick={() => {\n state.focusNextPage();\n }}\n tabindex={-1}\n />\n </VisuallyHidden>\n </TextContext>\n </CalendarContext>\n </CalendarStateContext>\n </HeadingContext>\n </ButtonContext>\n </dom.div>","<dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n render,\n merge(() => aria.calendarProps)\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={\n typeof props.slot === \"string\" && props.slot.length > 0\n ? props.slot\n : undefined\n }\n data-disabled={props.isDisabled === true ? true : undefined}\n data-invalid={state.isValueInvalid || undefined}\n >\n <ButtonContext\n value={{\n slots: {\n get next() {\n return aria.nextButtonProps;\n },\n get previous() {\n return aria.prevButtonProps;\n },\n },\n }}\n >\n <HeadingContext\n value={{\n \"aria-hidden\": \"true\",\n get children() {\n return aria.title;\n },\n level: 2,\n }}\n >\n <RangeCalendarStateContext value={state}>\n <RangeCalendarContext value={contextProps}>\n <TextContext\n value={{\n slots: {\n get errorMessage() {\n return aria.errorMessageProps;\n },\n },\n }}\n >\n <VisuallyHidden>\n <h2>{aria.calendarProps[\"aria-label\"]}</h2>\n </VisuallyHidden>\n {render.children}\n <VisuallyHidden>\n <button\n aria-label={aria.nextButtonProps[\"aria-label\"]}\n disabled={aria.nextButtonProps.isDisabled}\n onClick={() => {\n state.focusNextPage();\n }}\n tabindex={-1}\n />\n </VisuallyHidden>\n </TextContext>\n </RangeCalendarContext>\n </RangeCalendarStateContext>\n </HeadingContext>\n </ButtonContext>\n </dom.div>","dom.thead","<dom.thead\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => ctx.headerProps)\n )}\n ref={(el: HTMLTableSectionElement) => {\n assignRef(\n untrack(() => props.ref),\n el\n );\n }}\n style={props.style}\n class={props.class ?? \"solid2-aria-CalendarGridHeader\"}\n render={props.render}\n >\n <tr>\n <For each={ctx.weekDays}>{(day) => <>{props.children(day)}</>}</For>\n </tr>\n </dom.thead>","dom.th","<dom.th\n {...filterDOMProps(props, { global: true })}\n ref={(el: HTMLTableCellElement) => {\n assignRef(\n untrack(() => props.ref),\n el\n );\n }}\n style={props.style}\n class={props.class ?? \"solid2-aria-CalendarHeaderCell\"}\n render={props.render}\n >\n {props.children}\n </dom.th>","dom.tbody","<dom.tbody\n {...filterDOMProps(props, { global: true })}\n ref={(el: HTMLTableSectionElement) => {\n assignRef(\n untrack(() => props.ref),\n el\n );\n }}\n style={props.style}\n class={props.class ?? \"solid2-aria-CalendarGridBody\"}\n render={props.render}\n >\n <For each={weeks()}>\n {(week) => (\n <tr>\n <For each={state.getDatesInWeek(week, ctx.startDate)} keyed={false}>\n {(date) => (\n <Show when={date()} fallback={<td />}>\n {(current) => <>{props.children(current())}</>}\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>\n </dom.tbody>","<td\n {...aria.cellProps}\n ref={(element: HTMLTableCellElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n >\n <dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.buttonProps),\n merge(() => focus.focusProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n omit(render, \"children\")\n )}\n ref={(element: HTMLDivElement) => {\n setButtonRef(element);\n }}\n data-focused={aria.isFocused || undefined}\n data-hovered={hover.isHovered || undefined}\n data-pressed={aria.isPressed || undefined}\n data-unavailable={aria.isUnavailable || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-focus-visible={values.isFocusVisible || undefined}\n data-outside-visible-range={aria.isOutsideVisibleRange || undefined}\n data-outside-month={outside() || undefined}\n data-selected={aria.isSelected || undefined}\n data-selection-start={values.isSelectionStart || undefined}\n data-selection-end={values.isSelectionEnd || undefined}\n data-invalid={aria.isInvalid || undefined}\n data-today={values.isToday || undefined}\n >\n {content()}\n </dom.div>\n </td>","<dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.buttonProps),\n merge(() => focus.focusProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n omit(render, \"children\")\n )}\n ref={(element: HTMLDivElement) => {\n setButtonRef(element);\n }}\n data-focused={aria.isFocused || undefined}\n data-hovered={hover.isHovered || undefined}\n data-pressed={aria.isPressed || undefined}\n data-unavailable={aria.isUnavailable || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-focus-visible={values.isFocusVisible || undefined}\n data-outside-visible-range={aria.isOutsideVisibleRange || undefined}\n data-outside-month={outside() || undefined}\n data-selected={aria.isSelected || undefined}\n data-selection-start={values.isSelectionStart || undefined}\n data-selection-end={values.isSelectionEnd || undefined}\n data-invalid={aria.isInvalid || undefined}\n data-today={values.isToday || undefined}\n >\n {content()}\n </dom.div>","<Heading\n {\n // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n ...omit(props, \"offset\", \"format\")\n // oxlint-enable solid/reactivity\n }\n class={props.class ?? \"solid2-aria-CalendarHeading\"}\n >\n {text()}\n </Heading>","_$ssrHydrationKey","_$scope","_$escape","_$ssr","_$ssrGroup","_$ssrAttribute","_$memo","_$mergeProps","createInternationalCalendar","createCalendar","_$ssrElement"],"sources":["../../src/calendar.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-aria-components/src/Calendar.tsx.\n * Modified for Solid Aria: composed Solid Aria and Stately primitives with Solid 2 contexts, reactive getters, and DOM refs; uses Solid class props.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport {\n createCalendar as createInternationalCalendar,\n endOfMonth,\n isSameDay,\n isSameMonth,\n isToday,\n} from \"@internationalized/date\";\nimport type {\n CalendarDate,\n CalendarIdentifier,\n Calendar as ICalendar,\n DateDuration,\n} from \"@internationalized/date\";\nimport { createCalendar } from \"@solid2-aria/core/calendar/create-calendar\";\nimport type { AriaCalendarProps } from \"@solid2-aria/core/calendar/create-calendar\";\nimport { createCalendarCell } from \"@solid2-aria/core/calendar/create-calendar-cell\";\nimport type { CalendarCellAria } from \"@solid2-aria/core/calendar/create-calendar-cell\";\nimport { createCalendarGrid } from \"@solid2-aria/core/calendar/create-calendar-grid\";\nimport { createCalendarHeading } from \"@solid2-aria/core/calendar/create-calendar-heading\";\nimport type { CalendarHeadingProps as AriaCalendarHeadingProps } from \"@solid2-aria/core/calendar/create-calendar-heading\";\nimport { createCalendarMonthPicker } from \"@solid2-aria/core/calendar/create-calendar-month-picker\";\nimport type {\n CalendarMonthPickerProps as AriaCalendarMonthPickerProps,\n CalendarMonthPickerAria,\n} from \"@solid2-aria/core/calendar/create-calendar-month-picker\";\nimport { createCalendarYearPicker } from \"@solid2-aria/core/calendar/create-calendar-year-picker\";\nimport type {\n CalendarYearPickerProps as AriaCalendarYearPickerProps,\n CalendarYearPickerAria,\n} from \"@solid2-aria/core/calendar/create-calendar-year-picker\";\nimport { createRangeCalendar } from \"@solid2-aria/core/calendar/create-range-calendar\";\nimport type { AriaRangeCalendarProps } from \"@solid2-aria/core/calendar/create-range-calendar\";\nimport { createFocusRing } from \"@solid2-aria/core/focus/create-focus-ring\";\nimport { createLocale } from \"@solid2-aria/core/i18n/i18n-provider\";\nimport { createHover } from \"@solid2-aria/core/interactions/create-hover\";\nimport { filterDOMProps } from \"@solid2-aria/core/utils/filter-dom-props\";\nimport { mergeProps } from \"@solid2-aria/core/utils/merge-props\";\nimport { requireValue } from \"@solid2-aria/core/utils/require-value\";\nimport { VisuallyHidden } from \"@solid2-aria/core/visually-hidden/visually-hidden\";\nimport { createCalendarState } from \"@solid2-aria/stately/calendar/create-calendar-state\";\nimport { createRangeCalendarState } from \"@solid2-aria/stately/calendar/create-range-calendar-state\";\nimport type {\n CalendarState,\n CalendarSelectionMode,\n RangeCalendarState,\n DateValue,\n} from \"@solid2-aria/stately/calendar/types\";\nimport type { HoverEvents } from \"@solid2-aria/types-shared\";\nimport type {\n GlobalDOMAttributes,\n DOMAttributes,\n} from \"@solid2-aria/types-shared-web\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n untrack,\n merge,\n createSignal,\n createContext,\n createMemo,\n For,\n Show,\n omit,\n useContext,\n} from \"solid-js\";\n\nimport { ButtonContext } from \"./button\";\nimport { Heading, HeadingContext } from \"./heading\";\nimport type { HeadingProps } from \"./heading\";\nimport { TextContext } from \"./text\";\nimport {\n dom,\n assignRef,\n createContextProps,\n createSlottedContext,\n createRenderProps,\n} from \"./utils\";\nimport type {\n ContextValue,\n RenderProps,\n StyleProps,\n SlotProps,\n DOMRenderProps,\n Ref,\n} from \"./utils\";\n\nexport interface CalendarRenderProps<\n M extends CalendarSelectionMode = \"single\",\n> {\n isDisabled: boolean;\n state: CalendarState<M>;\n isInvalid: boolean;\n}\n\nexport interface RangeCalendarRenderProps extends Omit<\n CalendarRenderProps,\n \"state\"\n> {\n state: RangeCalendarState;\n}\n\nexport interface CalendarProps<\n T extends DateValue,\n M extends CalendarSelectionMode = \"single\",\n>\n extends\n Omit<AriaCalendarProps<T, M>, \"errorMessage\" | \"validationState\">,\n RenderProps<CalendarRenderProps<M>>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n visibleDuration?: DateDuration;\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport interface RangeCalendarProps<T extends DateValue>\n extends\n Omit<AriaRangeCalendarProps<T>, \"errorMessage\" | \"validationState\">,\n RenderProps<RangeCalendarRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n visibleDuration?: DateDuration;\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar;\n ref?: Ref<HTMLDivElement>;\n}\n\ntype CalendarContextProps = CalendarProps<DateValue, CalendarSelectionMode>;\n\nexport const CalendarContext =\n createContext<ContextValue<CalendarContextProps, HTMLDivElement>>(null);\n\nexport const RangeCalendarContext =\n createContext<ContextValue<RangeCalendarProps<DateValue>, HTMLDivElement>>(\n null\n );\n\nexport const CalendarStateContext =\n createContext<CalendarState<CalendarSelectionMode> | null>(null);\n\nexport const RangeCalendarStateContext =\n createContext<RangeCalendarState | null>(null);\n\nexport function Calendar<\n T extends DateValue,\n M extends CalendarSelectionMode = \"single\",\n>(input: CalendarProps<T, M>): JSX.Element {\n const [props, , setRef] = createContextProps(\n input,\n untrack(() => input.ref),\n CalendarContext\n );\n\n const locale = createLocale();\n // SAFETY: A calendar subtree preserves its input date class and selection mode; the shared context represents both supported modes.\n // oxlint-disable-next-line anti-slop/no-chained-type-assertions, typescript/no-unsafe-type-assertion -- Generic callback variance is erased only at this shared context boundary.\n const contextProps = props as unknown as CalendarContextProps;\n\n const state = createCalendarState(\n mergeProps(props, {\n get createCalendar() {\n return props.createCalendar ?? createInternationalCalendar;\n },\n get locale() {\n return locale.locale;\n },\n })\n );\n\n const aria = createCalendar(props, state);\n\n const values: CalendarRenderProps<M> = {\n get isDisabled() {\n return props.isDisabled ?? false;\n },\n get isInvalid() {\n return state.isValueInvalid;\n },\n state,\n };\n\n const render = createRenderProps(\n mergeProps(props, { defaultClass: \"solid2-aria-Calendar\", values })\n );\n\n return (\n <dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n render,\n merge(() => aria.calendarProps)\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={\n typeof props.slot === \"string\" && props.slot.length > 0\n ? props.slot\n : undefined\n }\n data-disabled={props.isDisabled === true ? true : undefined}\n data-invalid={state.isValueInvalid || undefined}\n >\n <ButtonContext\n value={{\n slots: {\n get next() {\n return aria.nextButtonProps;\n },\n get previous() {\n return aria.prevButtonProps;\n },\n },\n }}\n >\n <HeadingContext\n value={{\n \"aria-hidden\": \"true\",\n get children() {\n return aria.title;\n },\n level: 2,\n }}\n >\n <CalendarStateContext value={state}>\n <CalendarContext value={contextProps}>\n <TextContext\n value={{\n slots: {\n get errorMessage() {\n return aria.errorMessageProps;\n },\n },\n }}\n >\n <VisuallyHidden>\n <h2>{aria.calendarProps[\"aria-label\"]}</h2>\n </VisuallyHidden>\n {render.children}\n <VisuallyHidden>\n <button\n aria-label={aria.nextButtonProps[\"aria-label\"]}\n disabled={aria.nextButtonProps.isDisabled}\n onClick={() => {\n state.focusNextPage();\n }}\n tabindex={-1}\n />\n </VisuallyHidden>\n </TextContext>\n </CalendarContext>\n </CalendarStateContext>\n </HeadingContext>\n </ButtonContext>\n </dom.div>\n );\n}\n\nexport function RangeCalendar<T extends DateValue>(\n input: RangeCalendarProps<T>\n): JSX.Element {\n const [props, ref, setRef] = createContextProps(\n input,\n untrack(() => input.ref),\n RangeCalendarContext\n );\n\n const locale = createLocale();\n\n // SAFETY: Range calendar state preserves the date class supplied by its value and callback; the internal factory exposes the common DateValue interface.\n // oxlint-disable-next-line anti-slop/no-chained-type-assertions, typescript/no-unsafe-type-assertion -- Widen the invariant generic callback at the state and context boundary.\n const contextProps = props as unknown as RangeCalendarProps<DateValue>;\n\n const state = createRangeCalendarState(\n mergeProps(contextProps, {\n get createCalendar() {\n return props.createCalendar ?? createInternationalCalendar;\n },\n get locale() {\n return locale.locale;\n },\n })\n );\n\n const aria = createRangeCalendar(props, state, ref);\n\n const values: RangeCalendarRenderProps = {\n get isDisabled() {\n return props.isDisabled ?? false;\n },\n get isInvalid() {\n return state.isValueInvalid;\n },\n state,\n };\n\n const render = createRenderProps(\n mergeProps(props, { defaultClass: \"solid2-aria-RangeCalendar\", values })\n );\n\n return (\n <dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n render,\n merge(() => aria.calendarProps)\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={\n typeof props.slot === \"string\" && props.slot.length > 0\n ? props.slot\n : undefined\n }\n data-disabled={props.isDisabled === true ? true : undefined}\n data-invalid={state.isValueInvalid || undefined}\n >\n <ButtonContext\n value={{\n slots: {\n get next() {\n return aria.nextButtonProps;\n },\n get previous() {\n return aria.prevButtonProps;\n },\n },\n }}\n >\n <HeadingContext\n value={{\n \"aria-hidden\": \"true\",\n get children() {\n return aria.title;\n },\n level: 2,\n }}\n >\n <RangeCalendarStateContext value={state}>\n <RangeCalendarContext value={contextProps}>\n <TextContext\n value={{\n slots: {\n get errorMessage() {\n return aria.errorMessageProps;\n },\n },\n }}\n >\n <VisuallyHidden>\n <h2>{aria.calendarProps[\"aria-label\"]}</h2>\n </VisuallyHidden>\n {render.children}\n <VisuallyHidden>\n <button\n aria-label={aria.nextButtonProps[\"aria-label\"]}\n disabled={aria.nextButtonProps.isDisabled}\n onClick={() => {\n state.focusNextPage();\n }}\n tabindex={-1}\n />\n </VisuallyHidden>\n </TextContext>\n </RangeCalendarContext>\n </RangeCalendarStateContext>\n </HeadingContext>\n </ButtonContext>\n </dom.div>\n );\n}\n\ninterface InternalCalendarGridContextValue {\n headerProps: DOMAttributes;\n weekDays: string[];\n startDate: CalendarDate;\n weeksInMonth: number;\n}\n\nconst InternalCalendarGridContext =\n createContext<InternalCalendarGridContextValue | null>(null);\n\nexport interface CalendarGridProps\n extends\n StyleProps,\n DOMRenderProps<\"table\", undefined>,\n GlobalDOMAttributes<HTMLTableElement> {\n children?: JSX.Element | ((date: CalendarDate) => JSX.Element);\n offset?: DateDuration;\n weekdayStyle?: \"narrow\" | \"short\" | \"long\";\n ref?: Ref<HTMLTableElement>;\n}\n\nexport interface CalendarGridHeaderProps\n extends\n StyleProps,\n DOMRenderProps<\"thead\", undefined>,\n GlobalDOMAttributes<HTMLTableSectionElement> {\n children: (day: string) => JSX.Element;\n ref?: Ref<HTMLTableSectionElement>;\n}\n\nexport interface CalendarHeaderCellProps\n extends\n StyleProps,\n DOMRenderProps<\"th\", undefined>,\n GlobalDOMAttributes<HTMLTableCellElement> {\n children?: JSX.Element;\n ref?: Ref<HTMLTableCellElement>;\n id?: string;\n}\n\nexport interface CalendarGridBodyProps\n extends\n StyleProps,\n DOMRenderProps<\"tbody\", undefined>,\n GlobalDOMAttributes<HTMLTableSectionElement> {\n children: (date: CalendarDate) => JSX.Element;\n ref?: Ref<HTMLTableSectionElement>;\n}\n\nfunction calendarState() {\n return (\n useContext(CalendarStateContext) ??\n requireValue(\n useContext(RangeCalendarStateContext),\n \"Expected required element or component context\"\n )\n );\n}\n\nexport function CalendarGrid(props: CalendarGridProps): JSX.Element {\n const state = calendarState();\n const calendar = createSlottedContext(CalendarContext);\n const rangeCalendar = createSlottedContext(RangeCalendarContext);\n\n const start = createMemo(() =>\n props.offset\n ? state.visibleRange.start.add(props.offset)\n : state.visibleRange.start\n );\n\n const aria = createCalendarGrid(\n {\n get endDate() {\n return endOfMonth(start());\n },\n get firstDayOfWeek() {\n return calendar?.firstDayOfWeek ?? rangeCalendar?.firstDayOfWeek;\n },\n get startDate() {\n return start();\n },\n get weekdayStyle() {\n return props.weekdayStyle;\n },\n },\n state\n );\n\n const context = {\n get headerProps() {\n return aria.headerProps;\n },\n get startDate() {\n return start();\n },\n get weekDays() {\n return aria.weekDays;\n },\n get weeksInMonth() {\n return aria.weeksInMonth;\n },\n };\n\n return (\n <InternalCalendarGridContext value={context}>\n <dom.table\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.gridProps)\n )}\n ref={(element: HTMLTableElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n style={props.style}\n\n class={props.class ?? \"solid2-aria-CalendarGrid\"}\n render={props.render}\n >\n {typeof props.children === \"function\" ? (\n <>\n <CalendarGridHeader>\n {(day) => <CalendarHeaderCell>{day}</CalendarHeaderCell>}\n </CalendarGridHeader>\n <CalendarGridBody>\n {(date) => (\n <>\n {typeof props.children === \"function\"\n ? props.children(date)\n : null}\n </>\n )}\n </CalendarGridBody>\n </>\n ) : (\n props.children\n )}\n </dom.table>\n </InternalCalendarGridContext>\n );\n}\n\nexport function CalendarGridHeader(\n props: CalendarGridHeaderProps\n): JSX.Element {\n const ctx = requireValue(\n useContext(InternalCalendarGridContext),\n \"Expected required element or component context\"\n );\n\n return (\n <dom.thead\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => ctx.headerProps)\n )}\n ref={(el: HTMLTableSectionElement) => {\n assignRef(\n untrack(() => props.ref),\n el\n );\n }}\n style={props.style}\n class={props.class ?? \"solid2-aria-CalendarGridHeader\"}\n render={props.render}\n >\n <tr>\n <For each={ctx.weekDays}>{(day) => <>{props.children(day)}</>}</For>\n </tr>\n </dom.thead>\n );\n}\n\nexport function CalendarHeaderCell(\n props: CalendarHeaderCellProps\n): JSX.Element {\n return (\n <dom.th\n {...filterDOMProps(props, { global: true })}\n ref={(el: HTMLTableCellElement) => {\n assignRef(\n untrack(() => props.ref),\n el\n );\n }}\n style={props.style}\n class={props.class ?? \"solid2-aria-CalendarHeaderCell\"}\n render={props.render}\n >\n {props.children}\n </dom.th>\n );\n}\n\nexport function CalendarGridBody(props: CalendarGridBodyProps): JSX.Element {\n const state = calendarState();\n\n const ctx = requireValue(\n useContext(InternalCalendarGridContext),\n \"Expected required element or component context\"\n );\n\n const weeks = createMemo(() =>\n Array.from({ length: ctx.weeksInMonth }, (_, index) => index)\n );\n\n return (\n <dom.tbody\n {...filterDOMProps(props, { global: true })}\n ref={(el: HTMLTableSectionElement) => {\n assignRef(\n untrack(() => props.ref),\n el\n );\n }}\n style={props.style}\n class={props.class ?? \"solid2-aria-CalendarGridBody\"}\n render={props.render}\n >\n <For each={weeks()}>\n {(week) => (\n <tr>\n <For each={state.getDatesInWeek(week, ctx.startDate)} keyed={false}>\n {(date) => (\n <Show when={date()} fallback={<td />}>\n {(current) => <>{props.children(current())}</>}\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>\n </dom.tbody>\n );\n}\n\nexport interface CalendarCellRenderProps extends Omit<\n CalendarCellAria,\n \"cellProps\" | \"buttonProps\"\n> {\n date: CalendarDate;\n isHovered: boolean;\n isSelectionStart: boolean;\n isSelectionEnd: boolean;\n isFocusVisible: boolean;\n isOutsideMonth: boolean;\n isToday: boolean;\n}\n\nexport interface CalendarCellProps\n extends\n RenderProps<CalendarCellRenderProps>,\n HoverEvents,\n GlobalDOMAttributes<HTMLTableCellElement> {\n date: CalendarDate;\n ref?: Ref<HTMLTableCellElement>;\n}\n\nexport function CalendarCell(props: CalendarCellProps): JSX.Element {\n const state = calendarState();\n const grid = useContext(InternalCalendarGridContext);\n\n const [buttonRef, setButtonRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const outside = () =>\n Boolean(state.visibleDuration.days) || Boolean(state.visibleDuration.weeks)\n ? false\n : !isSameMonth(grid?.startDate ?? state.visibleRange.start, props.date);\n\n const aria = createCalendarCell(\n {\n get date() {\n return props.date;\n },\n get isOutsideMonth() {\n return outside();\n },\n },\n state,\n buttonRef\n );\n\n const focus = createFocusRing();\n\n const hover = createHover(\n mergeProps(props, {\n get isDisabled() {\n return aria.isDisabled || aria.isUnavailable;\n },\n })\n );\n\n const boundary = (end: boolean) =>\n \"highlightedRange\" in state &&\n !!state.highlightedRange &&\n isSameDay(\n props.date,\n end ? state.highlightedRange.end : state.highlightedRange.start\n );\n\n const values: CalendarCellRenderProps = mergeProps(\n omit(aria, \"cellProps\", \"buttonProps\"),\n {\n get date() {\n return props.date;\n },\n get isFocusVisible() {\n return aria.isFocused && focus.isFocusVisible;\n },\n get isHovered() {\n return hover.isHovered;\n },\n get isOutsideMonth() {\n return outside();\n },\n get isSelectionEnd() {\n return boundary(true);\n },\n get isSelectionStart() {\n return boundary(false);\n },\n get isToday() {\n return isToday(props.date, state.timeZone);\n },\n }\n );\n\n const render = createRenderProps(\n mergeProps(props, {\n get defaultChildren() {\n return aria.formattedDate;\n },\n defaultClass: \"solid2-aria-CalendarCell\",\n values,\n })\n );\n\n const content = createMemo(() => render.children);\n\n return (\n <td\n {...aria.cellProps}\n ref={(element: HTMLTableCellElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n >\n <dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.buttonProps),\n merge(() => focus.focusProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n omit(render, \"children\")\n )}\n ref={(element: HTMLDivElement) => {\n setButtonRef(element);\n }}\n data-focused={aria.isFocused || undefined}\n data-hovered={hover.isHovered || undefined}\n data-pressed={aria.isPressed || undefined}\n data-unavailable={aria.isUnavailable || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-focus-visible={values.isFocusVisible || undefined}\n data-outside-visible-range={aria.isOutsideVisibleRange || undefined}\n data-outside-month={outside() || undefined}\n data-selected={aria.isSelected || undefined}\n data-selection-start={values.isSelectionStart || undefined}\n data-selection-end={values.isSelectionEnd || undefined}\n data-invalid={aria.isInvalid || undefined}\n data-today={values.isToday || undefined}\n >\n {content()}\n </dom.div>\n </td>\n );\n}\n\nexport interface CalendarYearPickerProps extends AriaCalendarYearPickerProps {\n children: (props: CalendarYearPickerAria) => JSX.Element;\n}\n\nexport function CalendarYearPicker(\n props: CalendarYearPickerProps\n): JSX.Element {\n const aria = createCalendarYearPicker(props, calendarState());\n\n return untrack(() => props.children(aria));\n}\n\nexport interface CalendarMonthPickerProps extends AriaCalendarMonthPickerProps {\n children: (props: CalendarMonthPickerAria) => JSX.Element;\n}\n\nexport function CalendarMonthPicker(\n props: CalendarMonthPickerProps\n): JSX.Element {\n const aria = createCalendarMonthPicker(props, calendarState());\n\n return untrack(() => props.children(aria));\n}\n\nexport interface CalendarHeadingProps\n extends AriaCalendarHeadingProps, HeadingProps {}\n\nexport function CalendarHeading(props: CalendarHeadingProps): JSX.Element {\n const text = createCalendarHeading(props, calendarState());\n\n return (\n <Heading\n {\n // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n ...omit(props, \"offset\", \"format\")\n // oxlint-enable solid/reactivity\n }\n class={props.class ?? \"solid2-aria-CalendarHeading\"}\n >\n {text()}\n </Heading>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;E,UA2PkBgC,gB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;CACF,CAAC,CACH;CAEA,MAAM,UAAU,iBAAiB,OAAO,QAAQ;CAEhD,OACEC,WAAAA,YACM;EAAK,OAAA,KAAA;CAAQ,SADnB;EASEC,OAAAA,OAAAA,IAACV,IAADU,mBACE;GAAI,OAAA,WACF,eAAe,OAAO,EAAE,QAAQ,KAAK,CAAC,GACtC,YAAY,KAAK,WAAW,GAC5B,YAAY,MAAM,cAAc,CAAC,CAAC,GAClC,YAAY,MAAM,cAAc,CAAC,CAAC,GAClC,KAAK,QAAQ,UAAU,CACzB;EAAC,GAPH,IAAA,MAWgB,MACA,OAIM,QAEA,SAOnB,UAjBK,YAA4B;GAChC,aAAa,OAAO;EACtB,CAgBO,CAAA,CAAA,CAAA;CACP,GApCJ,IAoCI;AAER;AAMA,SAAgB,mBACd,OACa;CACb,MAAM,OAAO,yBAAyB,OAAO,cAAc,CAAC;CAE5D,OAAO,cAAc,MAAM,SAAS,IAAI,CAAC;AAC3C;AAMA,SAAgB,oBACd,OACa;CACb,MAAM,OAAO,0BAA0B,OAAO,cAAc,CAAC;CAE7D,OAAO,cAAc,MAAM,SAAS,IAAI,CAAC;AAC3C;AAKA,SAAgB,gBAAgB,OAA0C;CACxE,MAAM,OAAO,sBAAsB,OAAO,cAAc,CAAC;CAEzD,OAAA,QACEC,mBACE;EAEK,OAAA,KAAK,OAAO,UAAU,QAAQ;CAEnC,GALF,IAAA,MAMS,OAEN,IACM,CAAA,CAAA;AAEb"}
@@ -185,7 +185,9 @@ var _d$12 = {
185
185
  get() {
186
186
  const ctx = this[_m$];
187
187
  const focus = this[_m$2];
188
- return ssrElement("input", mergeProps(merge(() => ctx.aria.inputProps ?? {}), merge(() => focus.focusProps ?? {})), void 0, true);
188
+ return ssrElement("input", () => {
189
+ return mergeProps(merge(() => ctx.aria.inputProps ?? {}), merge(() => focus.focusProps ?? {}));
190
+ }, void 0, true);
189
191
  },
190
192
  enumerable: true,
191
193
  configurable: true
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","names":["ref={(element: HTMLLabelElement) => {\n setRef(element);\n }}","{render.children}","ref={props.ref}","dom.div","<dom.div\n {\n // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n ...omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\")\n // oxlint-enable solid/reactivity\n }\n {...render}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={props.slot ?? undefined}\n data-selected={values.isSelected || undefined}\n data-disabled={values.isDisabled || undefined}\n data-invalid={values.isInvalid || undefined}\n data-readonly={values.isReadOnly || undefined}\n data-required={values.isRequired || undefined}\n >\n <InternalContext value={ctx}>\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return values.isSelected;\n },\n }}\n >\n <TextContext\n value={{\n slots: {\n get description() {\n return ctx.aria.descriptionProps;\n },\n get errorMessage() {\n return ctx.aria.errorMessageProps;\n },\n },\n }}\n >\n {render.children}\n </TextContext>\n </SelectionIndicatorContext>\n </InternalContext>\n </dom.div>","dom.label","<dom.label\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\"),\n merge(() => ctx.aria.labelProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n render\n )}\n ref={props.ref}\n slot={props.slot ?? undefined}\n data-selected={fields.isSelected || undefined}\n data-indeterminate={fields.isIndeterminate || undefined}\n data-disabled={fields.isDisabled || undefined}\n data-readonly={fields.isReadOnly || undefined}\n data-invalid={fields.isInvalid || undefined}\n data-required={fields.isRequired || undefined}\n data-pressed={ctx.aria.isPressed || undefined}\n data-hovered={hover.isHovered || undefined}\n data-focused={focus.isFocused || undefined}\n data-focus-visible={focus.isFocusVisible || undefined}\n >\n <VisuallyHidden elementType=\"span\">\n <input\n {...mergeProps(\n merge(() => ctx.aria.inputProps ?? {}),\n merge(() => focus.focusProps ?? {})\n )}\n ref={(element: HTMLInputElement) => {\n ctx.setInputRef(element);\n }}\n />\n </VisuallyHidden>\n {render.children}\n </dom.label>","<dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.groupProps ?? {}),\n render\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={props.slot ?? undefined}\n data-disabled={values.isDisabled || undefined}\n data-readonly={values.isReadOnly || undefined}\n data-required={values.isRequired || undefined}\n data-invalid={values.isInvalid || undefined}\n >\n <CheckboxGroupStateContext value={state}>\n <LabelContext value={labelProps}>\n <TextContext\n value={{\n slots: {\n get description() {\n return aria.descriptionProps;\n },\n get errorMessage() {\n return aria.errorMessageProps;\n },\n },\n }}\n >\n <FieldErrorContext value={aria}>\n {render.children}\n </FieldErrorContext>\n </TextContext>\n </LabelContext>\n </CheckboxGroupStateContext>\n </dom.div>","_$mergeProps","_$ssrElement","_$memo","_$applyRef"],"sources":["../../src/checkbox.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-aria-components/src/Checkbox.tsx.\n * Modified for Solid Aria: adapted components, contexts, refs, and reactive properties for Solid 2; uses Solid class props.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport { createCheckbox } from \"@solid2-aria/core/checkbox/create-checkbox\";\nimport type {\n AriaCheckboxProps,\n CheckboxAria,\n} from \"@solid2-aria/core/checkbox/create-checkbox\";\nimport { createCheckboxGroup } from \"@solid2-aria/core/checkbox/create-checkbox-group\";\nimport type { AriaCheckboxGroupProps } from \"@solid2-aria/core/checkbox/create-checkbox-group\";\nimport { createCheckboxGroupItem } from \"@solid2-aria/core/checkbox/create-checkbox-group-item\";\nimport { createFocusRing } from \"@solid2-aria/core/focus/create-focus-ring\";\nimport { createHover } from \"@solid2-aria/core/interactions/create-hover\";\nimport { filterDOMProps } from \"@solid2-aria/core/utils/filter-dom-props\";\nimport { mergeProps } from \"@solid2-aria/core/utils/merge-props\";\nimport { isTruthy } from \"@solid2-aria/core/utils/truthy\";\nimport { VisuallyHidden } from \"@solid2-aria/core/visually-hidden/visually-hidden\";\nimport { createCheckboxGroupState } from \"@solid2-aria/stately/checkbox/create-checkbox-group-state\";\nimport type { CheckboxGroupState } from \"@solid2-aria/stately/checkbox/create-checkbox-group-state\";\nimport { createToggleState } from \"@solid2-aria/stately/toggle/create-toggle-state\";\nimport type { ToggleState } from \"@solid2-aria/stately/toggle/create-toggle-state\";\nimport type { HoverEvents } from \"@solid2-aria/types-shared\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n untrack,\n createSignal,\n merge,\n createContext,\n useContext,\n omit,\n} from \"solid-js\";\nimport type { Accessor } from \"solid-js\";\n\nimport { FieldErrorContext } from \"./field-error\";\nimport { FormContext } from \"./form\";\nimport { LabelContext } from \"./label\";\nimport { SelectionIndicatorContext } from \"./selection-indicator\";\nimport { TextContext } from \"./text\";\nimport {\n dom,\n createContextProps,\n createRenderProps,\n createSlottedContext,\n createSlot,\n} from \"./utils\";\nimport type { Ref, ContextValue, SlotProps, RenderProps } from \"./utils\";\n\nexport interface CheckboxRenderProps {\n isSelected: boolean;\n isHovered: boolean;\n isPressed: boolean;\n isFocused: boolean;\n isFocusVisible: boolean;\n isDisabled: boolean;\n isReadOnly: boolean;\n isInvalid: boolean;\n isRequired: boolean;\n isIndeterminate: boolean;\n}\n\nexport type CheckboxFieldRenderProps = Omit<\n CheckboxRenderProps,\n \"isHovered\" | \"isPressed\" | \"isFocused\" | \"isFocusVisible\"\n>;\n\nexport type CheckboxButtonRenderProps = CheckboxRenderProps;\n\nexport interface CheckboxProps\n extends\n Omit<AriaCheckboxProps, \"children\">,\n SlotProps,\n HoverEvents,\n RenderProps<CheckboxRenderProps, \"label\"> {\n inputRef?: Ref<HTMLInputElement>;\n ref?: Ref<HTMLLabelElement>;\n}\n\nexport interface CheckboxFieldProps\n extends\n Omit<AriaCheckboxProps, \"children\">,\n SlotProps,\n HoverEvents,\n RenderProps<CheckboxFieldRenderProps> {\n inputRef?: Ref<HTMLInputElement>;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport interface CheckboxButtonProps\n extends\n SlotProps,\n HoverEvents,\n RenderProps<CheckboxButtonRenderProps, \"label\"> {\n id?: string;\n ref?: Ref<HTMLLabelElement>;\n}\n\nexport const CheckboxContext =\n createContext<ContextValue<CheckboxProps, HTMLLabelElement>>(null);\n\nexport const CheckboxFieldContext =\n createContext<ContextValue<CheckboxFieldProps, HTMLDivElement>>(null);\n\ninterface InternalValue {\n aria: CheckboxAria;\n inputRef: Accessor<HTMLInputElement | null>;\n setInputRef: (element: HTMLInputElement) => void;\n state: ToggleState;\n props: Omit<AriaCheckboxProps, \"children\">;\n defaultClass: string;\n}\n\nconst InternalContext = createContext<InternalValue | null>(null);\n\nexport const CheckboxGroupStateContext =\n createContext<CheckboxGroupState | null>(null);\n\nfunction createAria(props: CheckboxProps | CheckboxFieldProps): InternalValue {\n const [inputRef, setInputRef] = createSignal<HTMLInputElement | null>(null, {\n ownedWrite: true,\n });\n\n const form = createSlottedContext(FormContext);\n\n const options = mergeProps(omit(props, \"children\"), {\n children: true,\n get validationBehavior() {\n return props.validationBehavior ?? form?.validationBehavior ?? \"native\";\n },\n });\n\n const group = useContext(CheckboxGroupStateContext);\n const state = createToggleState(props);\n\n const aria = group\n ? createCheckboxGroupItem(\n mergeProps(options, {\n get value() {\n return props.value ?? \"\";\n },\n }),\n group,\n inputRef\n )\n : createCheckbox(options, state, inputRef);\n\n return {\n aria,\n defaultClass: \"solid2-aria-Checkbox\",\n inputRef,\n props,\n setInputRef: (element: HTMLInputElement) => {\n setInputRef(element);\n },\n state,\n };\n}\n\nfunction fieldValues(ctx: InternalValue): CheckboxFieldRenderProps {\n return {\n get isDisabled() {\n return ctx.aria.isDisabled;\n },\n get isIndeterminate() {\n return ctx.props.isIndeterminate === true;\n },\n get isInvalid() {\n return ctx.aria.isInvalid;\n },\n get isReadOnly() {\n return ctx.aria.isReadOnly;\n },\n get isRequired() {\n return ctx.props.isRequired === true;\n },\n get isSelected() {\n return ctx.aria.isSelected;\n },\n };\n}\n\nexport function Checkbox(input: CheckboxProps): JSX.Element {\n const [props, , setRef] = createContextProps(\n input,\n untrack(() => input.ref),\n CheckboxContext\n );\n\n const ctx = createAria(props);\n\n return (\n <InternalContext value={ctx}>\n <CheckboxButton\n {...props}\n ref={(element: HTMLLabelElement) => {\n setRef(element);\n }}\n />\n </InternalContext>\n );\n}\n\nexport function CheckboxField(input: CheckboxFieldProps): JSX.Element {\n const [props, , setRef] = createContextProps(\n input,\n untrack(() => input.ref),\n CheckboxFieldContext\n );\n\n const ctx = createAria(props);\n ctx.defaultClass = \"solid2-aria-CheckboxButton\";\n const values = fieldValues(ctx);\n\n const render = createRenderProps(\n mergeProps(props, { defaultClass: \"solid2-aria-CheckboxField\", values })\n );\n\n return (\n <dom.div\n {\n // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n ...omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\")\n // oxlint-enable solid/reactivity\n }\n {...render}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={props.slot ?? undefined}\n data-selected={values.isSelected || undefined}\n data-disabled={values.isDisabled || undefined}\n data-invalid={values.isInvalid || undefined}\n data-readonly={values.isReadOnly || undefined}\n data-required={values.isRequired || undefined}\n >\n <InternalContext value={ctx}>\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return values.isSelected;\n },\n }}\n >\n <TextContext\n value={{\n slots: {\n get description() {\n return ctx.aria.descriptionProps;\n },\n get errorMessage() {\n return ctx.aria.errorMessageProps;\n },\n },\n }}\n >\n {render.children}\n </TextContext>\n </SelectionIndicatorContext>\n </InternalContext>\n </dom.div>\n );\n}\n\nexport function CheckboxButton(props: CheckboxButtonProps): JSX.Element {\n const ctx = useContext(InternalContext);\n\n if (!ctx) {\n throw new Error(\"CheckboxButton must be inside CheckboxField.\");\n }\n\n const focus = createFocusRing();\n const fields = fieldValues(ctx);\n\n const hover = createHover(\n mergeProps(props, {\n get isDisabled() {\n return fields.isDisabled || fields.isReadOnly;\n },\n })\n );\n\n const values: CheckboxButtonRenderProps = mergeProps(fields, {\n get isFocusVisible() {\n return focus.isFocusVisible;\n },\n get isFocused() {\n return focus.isFocused;\n },\n get isHovered() {\n return hover.isHovered;\n },\n get isPressed() {\n return ctx.aria.isPressed;\n },\n });\n\n const render = createRenderProps(\n mergeProps(props, {\n get defaultClass() {\n return ctx.defaultClass;\n },\n values,\n })\n );\n\n return (\n <dom.label\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\"),\n merge(() => ctx.aria.labelProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n render\n )}\n ref={props.ref}\n slot={props.slot ?? undefined}\n data-selected={fields.isSelected || undefined}\n data-indeterminate={fields.isIndeterminate || undefined}\n data-disabled={fields.isDisabled || undefined}\n data-readonly={fields.isReadOnly || undefined}\n data-invalid={fields.isInvalid || undefined}\n data-required={fields.isRequired || undefined}\n data-pressed={ctx.aria.isPressed || undefined}\n data-hovered={hover.isHovered || undefined}\n data-focused={focus.isFocused || undefined}\n data-focus-visible={focus.isFocusVisible || undefined}\n >\n <VisuallyHidden elementType=\"span\">\n <input\n {...mergeProps(\n merge(() => ctx.aria.inputProps ?? {}),\n merge(() => focus.focusProps ?? {})\n )}\n ref={(element: HTMLInputElement) => {\n ctx.setInputRef(element);\n }}\n />\n </VisuallyHidden>\n {render.children}\n </dom.label>\n );\n}\n\nexport interface CheckboxGroupRenderProps {\n isDisabled: boolean;\n isReadOnly: boolean;\n isRequired: boolean;\n isInvalid: boolean;\n state: CheckboxGroupState;\n}\n\nexport interface CheckboxGroupProps\n extends\n Omit<\n AriaCheckboxGroupProps,\n \"children\" | \"label\" | \"description\" | \"errorMessage\"\n >,\n SlotProps,\n RenderProps<CheckboxGroupRenderProps> {\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const CheckboxGroupContext =\n createContext<ContextValue<CheckboxGroupProps, HTMLDivElement>>(null);\n\nexport function CheckboxGroup(input: CheckboxGroupProps): JSX.Element {\n const [props, , setRef] = createContextProps(\n input,\n untrack(() => input.ref),\n CheckboxGroupContext\n );\n\n const form = createSlottedContext(FormContext);\n\n const [registerLabel, label] = createSlot(\n () => !isTruthy(props[\"aria-label\"]) && !isTruthy(props[\"aria-labelledby\"])\n );\n\n const options = mergeProps(props, {\n get label() {\n return label();\n },\n get validationBehavior() {\n return props.validationBehavior ?? form?.validationBehavior ?? \"native\";\n },\n });\n\n const state = createCheckboxGroupState(options);\n const aria = createCheckboxGroup(options, state);\n\n const values: CheckboxGroupRenderProps = {\n get isDisabled() {\n return state.isDisabled;\n },\n get isInvalid() {\n return state.isInvalid;\n },\n get isReadOnly() {\n return state.isReadOnly;\n },\n get isRequired() {\n return props.isRequired === true;\n },\n state,\n };\n\n const labelProps = mergeProps(\n merge(() => aria.labelProps),\n { elementType: \"span\" as const, registerSlot: registerLabel }\n );\n\n const render = createRenderProps(\n mergeProps(props, { defaultClass: \"solid2-aria-CheckboxGroup\", values })\n );\n\n return (\n <dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.groupProps ?? {}),\n render\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={props.slot ?? undefined}\n data-disabled={values.isDisabled || undefined}\n data-readonly={values.isReadOnly || undefined}\n data-required={values.isRequired || undefined}\n data-invalid={values.isInvalid || undefined}\n >\n <CheckboxGroupStateContext value={state}>\n <LabelContext value={labelProps}>\n <TextContext\n value={{\n slots: {\n get description() {\n return aria.descriptionProps;\n },\n get errorMessage() {\n return aria.errorMessageProps;\n },\n },\n }}\n >\n <FieldErrorContext value={aria}>\n {render.children}\n </FieldErrorContext>\n </TextContext>\n </LabelContext>\n </CheckboxGroupStateContext>\n </dom.div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6MM,OAAA,eAAAQ,aACM,OADN,EAEER,MAAM,YAA8B;GAClC,OAAO,OAAO;EAChB,EACD,CAAA,CAAA;;;;;;;;;;;;;;EA0DK,O,SAAC,CAAO;;;;;;;;;;;;;;;EAZV,OAAA,YAAA,IAAA,KAYG,QAXM,EACL,OAAO;GACL,IAAI,cAAc;IAChB,OAAO,IAAI,KAAK;GAClB;GACA,IAAI,eAAe;IACjB,OAAO,IAAI,KAAK;GAClB;EACF,EACF,CAGW,CAAA;;;;;;;;;;;;;;;;;EApBf,OAAA,0BAAA,IAAA,KAmBK,QARY,KAVR,EACL,IAAI,aAAa;GACf,OAAO,OAAO;EAChB,EACF,CAgByB,CAAA;;;;;;;;;;;;;;;EA7B7B,O,SAAM,CAAM,QAAQ,KAAA;;;;;;;EACpB,O,UAAe,CAAO,cAAc,KAAA;;;;;;;EACpC,O,UAAe,CAAO,cAAc,KAAA;;;;;;;EACpC,O,UAAc,CAAO,aAAa,KAAA;;;;;;;EAClC,O,UAAe,CAAO,cAAc,KAAA;;;;;;;EACpC,O,UAAe,CAAO,cAAc,KAAA;;;;;;;;;;EAEpC,OAAA,gBAAA,IAAA,KAoBO,QARY,KARJ,QAJS,GAuBP,CAAA;;;;;;;;;;;;;;;;;;;;;;;;EAqEf,OAAAS,WAAA,SACM,WACF,YAAY,IAAI,KAAK,cAAc,CAAC,CAAC,GACrC,YAAY,MAAM,cAAc,CAAC,CAAC,CACpC,GAAA,KAAA,GAJF,IAQC;;;;;;;;;;;;;;EArBH,O,SAAM,CAAM,QAAQ,KAAA;;;;;;;EACpB,O,UAAe,CAAO,cAAc,KAAA;;;;;;;EACpC,O,UAAoB,CAAO,mBAAmB,KAAA;;;;;;;EAC9C,O,UAAe,CAAO,cAAc,K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setRef(element);\n }}","{render.children}","ref={props.ref}","dom.div","<dom.div\n {\n // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n ...omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\")\n // oxlint-enable solid/reactivity\n }\n {...render}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={props.slot ?? undefined}\n data-selected={values.isSelected || undefined}\n data-disabled={values.isDisabled || undefined}\n data-invalid={values.isInvalid || undefined}\n data-readonly={values.isReadOnly || undefined}\n data-required={values.isRequired || undefined}\n >\n <InternalContext value={ctx}>\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return values.isSelected;\n },\n }}\n >\n <TextContext\n value={{\n slots: {\n get description() {\n return ctx.aria.descriptionProps;\n },\n get errorMessage() {\n return ctx.aria.errorMessageProps;\n },\n },\n }}\n >\n {render.children}\n </TextContext>\n </SelectionIndicatorContext>\n </InternalContext>\n </dom.div>","dom.label","<dom.label\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\"),\n merge(() => ctx.aria.labelProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n render\n )}\n ref={props.ref}\n slot={props.slot ?? undefined}\n data-selected={fields.isSelected || undefined}\n data-indeterminate={fields.isIndeterminate || undefined}\n data-disabled={fields.isDisabled || undefined}\n data-readonly={fields.isReadOnly || undefined}\n data-invalid={fields.isInvalid || undefined}\n data-required={fields.isRequired || undefined}\n data-pressed={ctx.aria.isPressed || undefined}\n data-hovered={hover.isHovered || undefined}\n data-focused={focus.isFocused || undefined}\n data-focus-visible={focus.isFocusVisible || undefined}\n >\n <VisuallyHidden elementType=\"span\">\n <input\n {...mergeProps(\n merge(() => ctx.aria.inputProps ?? {}),\n merge(() => focus.focusProps ?? {})\n )}\n ref={(element: HTMLInputElement) => {\n ctx.setInputRef(element);\n }}\n />\n </VisuallyHidden>\n {render.children}\n </dom.label>","<dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.groupProps ?? {}),\n render\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={props.slot ?? undefined}\n data-disabled={values.isDisabled || undefined}\n data-readonly={values.isReadOnly || undefined}\n data-required={values.isRequired || undefined}\n data-invalid={values.isInvalid || undefined}\n >\n <CheckboxGroupStateContext value={state}>\n <LabelContext value={labelProps}>\n <TextContext\n value={{\n slots: {\n get description() {\n return aria.descriptionProps;\n },\n get errorMessage() {\n return aria.errorMessageProps;\n },\n },\n }}\n >\n <FieldErrorContext value={aria}>\n {render.children}\n </FieldErrorContext>\n </TextContext>\n </LabelContext>\n </CheckboxGroupStateContext>\n </dom.div>","_$mergeProps","_$ssrElement","_$memo","_$applyRef"],"sources":["../../src/checkbox.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-aria-components/src/Checkbox.tsx.\n * Modified for Solid Aria: adapted components, contexts, refs, and reactive properties for Solid 2; uses Solid class props.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport { createCheckbox } from \"@solid2-aria/core/checkbox/create-checkbox\";\nimport type {\n AriaCheckboxProps,\n CheckboxAria,\n} from \"@solid2-aria/core/checkbox/create-checkbox\";\nimport { createCheckboxGroup } from \"@solid2-aria/core/checkbox/create-checkbox-group\";\nimport type { AriaCheckboxGroupProps } from \"@solid2-aria/core/checkbox/create-checkbox-group\";\nimport { createCheckboxGroupItem } from \"@solid2-aria/core/checkbox/create-checkbox-group-item\";\nimport { createFocusRing } from \"@solid2-aria/core/focus/create-focus-ring\";\nimport { createHover } from \"@solid2-aria/core/interactions/create-hover\";\nimport { filterDOMProps } from \"@solid2-aria/core/utils/filter-dom-props\";\nimport { mergeProps } from \"@solid2-aria/core/utils/merge-props\";\nimport { isTruthy } from \"@solid2-aria/core/utils/truthy\";\nimport { VisuallyHidden } from \"@solid2-aria/core/visually-hidden/visually-hidden\";\nimport { createCheckboxGroupState } from \"@solid2-aria/stately/checkbox/create-checkbox-group-state\";\nimport type { CheckboxGroupState } from \"@solid2-aria/stately/checkbox/create-checkbox-group-state\";\nimport { createToggleState } from \"@solid2-aria/stately/toggle/create-toggle-state\";\nimport type { ToggleState } from \"@solid2-aria/stately/toggle/create-toggle-state\";\nimport type { HoverEvents } from \"@solid2-aria/types-shared\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n untrack,\n createSignal,\n merge,\n createContext,\n useContext,\n omit,\n} from \"solid-js\";\nimport type { Accessor } from \"solid-js\";\n\nimport { FieldErrorContext } from \"./field-error\";\nimport { FormContext } from \"./form\";\nimport { LabelContext } from \"./label\";\nimport { SelectionIndicatorContext } from \"./selection-indicator\";\nimport { TextContext } from \"./text\";\nimport {\n dom,\n createContextProps,\n createRenderProps,\n createSlottedContext,\n createSlot,\n} from \"./utils\";\nimport type { Ref, ContextValue, SlotProps, RenderProps } from \"./utils\";\n\nexport interface CheckboxRenderProps {\n isSelected: boolean;\n isHovered: boolean;\n isPressed: boolean;\n isFocused: boolean;\n isFocusVisible: boolean;\n isDisabled: boolean;\n isReadOnly: boolean;\n isInvalid: boolean;\n isRequired: boolean;\n isIndeterminate: boolean;\n}\n\nexport type CheckboxFieldRenderProps = Omit<\n CheckboxRenderProps,\n \"isHovered\" | \"isPressed\" | \"isFocused\" | \"isFocusVisible\"\n>;\n\nexport type CheckboxButtonRenderProps = CheckboxRenderProps;\n\nexport interface CheckboxProps\n extends\n Omit<AriaCheckboxProps, \"children\">,\n SlotProps,\n HoverEvents,\n RenderProps<CheckboxRenderProps, \"label\"> {\n inputRef?: Ref<HTMLInputElement>;\n ref?: Ref<HTMLLabelElement>;\n}\n\nexport interface CheckboxFieldProps\n extends\n Omit<AriaCheckboxProps, \"children\">,\n SlotProps,\n HoverEvents,\n RenderProps<CheckboxFieldRenderProps> {\n inputRef?: Ref<HTMLInputElement>;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport interface CheckboxButtonProps\n extends\n SlotProps,\n HoverEvents,\n RenderProps<CheckboxButtonRenderProps, \"label\"> {\n id?: string;\n ref?: Ref<HTMLLabelElement>;\n}\n\nexport const CheckboxContext =\n createContext<ContextValue<CheckboxProps, HTMLLabelElement>>(null);\n\nexport const CheckboxFieldContext =\n createContext<ContextValue<CheckboxFieldProps, HTMLDivElement>>(null);\n\ninterface InternalValue {\n aria: CheckboxAria;\n inputRef: Accessor<HTMLInputElement | null>;\n setInputRef: (element: HTMLInputElement) => void;\n state: ToggleState;\n props: Omit<AriaCheckboxProps, \"children\">;\n defaultClass: string;\n}\n\nconst InternalContext = createContext<InternalValue | null>(null);\n\nexport const CheckboxGroupStateContext =\n createContext<CheckboxGroupState | null>(null);\n\nfunction createAria(props: CheckboxProps | CheckboxFieldProps): InternalValue {\n const [inputRef, setInputRef] = createSignal<HTMLInputElement | null>(null, {\n ownedWrite: true,\n });\n\n const form = createSlottedContext(FormContext);\n\n const options = mergeProps(omit(props, \"children\"), {\n children: true,\n get validationBehavior() {\n return props.validationBehavior ?? form?.validationBehavior ?? \"native\";\n },\n });\n\n const group = useContext(CheckboxGroupStateContext);\n const state = createToggleState(props);\n\n const aria = group\n ? createCheckboxGroupItem(\n mergeProps(options, {\n get value() {\n return props.value ?? \"\";\n },\n }),\n group,\n inputRef\n )\n : createCheckbox(options, state, inputRef);\n\n return {\n aria,\n defaultClass: \"solid2-aria-Checkbox\",\n inputRef,\n props,\n setInputRef: (element: HTMLInputElement) => {\n setInputRef(element);\n },\n state,\n };\n}\n\nfunction fieldValues(ctx: InternalValue): CheckboxFieldRenderProps {\n return {\n get isDisabled() {\n return ctx.aria.isDisabled;\n },\n get isIndeterminate() {\n return ctx.props.isIndeterminate === true;\n },\n get isInvalid() {\n return ctx.aria.isInvalid;\n },\n get isReadOnly() {\n return ctx.aria.isReadOnly;\n },\n get isRequired() {\n return ctx.props.isRequired === true;\n },\n get isSelected() {\n return ctx.aria.isSelected;\n },\n };\n}\n\nexport function Checkbox(input: CheckboxProps): JSX.Element {\n const [props, , setRef] = createContextProps(\n input,\n untrack(() => input.ref),\n CheckboxContext\n );\n\n const ctx = createAria(props);\n\n return (\n <InternalContext value={ctx}>\n <CheckboxButton\n {...props}\n ref={(element: HTMLLabelElement) => {\n setRef(element);\n }}\n />\n </InternalContext>\n );\n}\n\nexport function CheckboxField(input: CheckboxFieldProps): JSX.Element {\n const [props, , setRef] = createContextProps(\n input,\n untrack(() => input.ref),\n CheckboxFieldContext\n );\n\n const ctx = createAria(props);\n ctx.defaultClass = \"solid2-aria-CheckboxButton\";\n const values = fieldValues(ctx);\n\n const render = createRenderProps(\n mergeProps(props, { defaultClass: \"solid2-aria-CheckboxField\", values })\n );\n\n return (\n <dom.div\n {\n // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n ...omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\")\n // oxlint-enable solid/reactivity\n }\n {...render}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={props.slot ?? undefined}\n data-selected={values.isSelected || undefined}\n data-disabled={values.isDisabled || undefined}\n data-invalid={values.isInvalid || undefined}\n data-readonly={values.isReadOnly || undefined}\n data-required={values.isRequired || undefined}\n >\n <InternalContext value={ctx}>\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return values.isSelected;\n },\n }}\n >\n <TextContext\n value={{\n slots: {\n get description() {\n return ctx.aria.descriptionProps;\n },\n get errorMessage() {\n return ctx.aria.errorMessageProps;\n },\n },\n }}\n >\n {render.children}\n </TextContext>\n </SelectionIndicatorContext>\n </InternalContext>\n </dom.div>\n );\n}\n\nexport function CheckboxButton(props: CheckboxButtonProps): JSX.Element {\n const ctx = useContext(InternalContext);\n\n if (!ctx) {\n throw new Error(\"CheckboxButton must be inside CheckboxField.\");\n }\n\n const focus = createFocusRing();\n const fields = fieldValues(ctx);\n\n const hover = createHover(\n mergeProps(props, {\n get isDisabled() {\n return fields.isDisabled || fields.isReadOnly;\n },\n })\n );\n\n const values: CheckboxButtonRenderProps = mergeProps(fields, {\n get isFocusVisible() {\n return focus.isFocusVisible;\n },\n get isFocused() {\n return focus.isFocused;\n },\n get isHovered() {\n return hover.isHovered;\n },\n get isPressed() {\n return ctx.aria.isPressed;\n },\n });\n\n const render = createRenderProps(\n mergeProps(props, {\n get defaultClass() {\n return ctx.defaultClass;\n },\n values,\n })\n );\n\n return (\n <dom.label\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\"),\n merge(() => ctx.aria.labelProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n render\n )}\n ref={props.ref}\n slot={props.slot ?? undefined}\n data-selected={fields.isSelected || undefined}\n data-indeterminate={fields.isIndeterminate || undefined}\n data-disabled={fields.isDisabled || undefined}\n data-readonly={fields.isReadOnly || undefined}\n data-invalid={fields.isInvalid || undefined}\n data-required={fields.isRequired || undefined}\n data-pressed={ctx.aria.isPressed || undefined}\n data-hovered={hover.isHovered || undefined}\n data-focused={focus.isFocused || undefined}\n data-focus-visible={focus.isFocusVisible || undefined}\n >\n <VisuallyHidden elementType=\"span\">\n <input\n {...mergeProps(\n merge(() => ctx.aria.inputProps ?? {}),\n merge(() => focus.focusProps ?? {})\n )}\n ref={(element: HTMLInputElement) => {\n ctx.setInputRef(element);\n }}\n />\n </VisuallyHidden>\n {render.children}\n </dom.label>\n );\n}\n\nexport interface CheckboxGroupRenderProps {\n isDisabled: boolean;\n isReadOnly: boolean;\n isRequired: boolean;\n isInvalid: boolean;\n state: CheckboxGroupState;\n}\n\nexport interface CheckboxGroupProps\n extends\n Omit<\n AriaCheckboxGroupProps,\n \"children\" | \"label\" | \"description\" | \"errorMessage\"\n >,\n SlotProps,\n RenderProps<CheckboxGroupRenderProps> {\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const CheckboxGroupContext =\n createContext<ContextValue<CheckboxGroupProps, HTMLDivElement>>(null);\n\nexport function CheckboxGroup(input: CheckboxGroupProps): JSX.Element {\n const [props, , setRef] = createContextProps(\n input,\n untrack(() => input.ref),\n CheckboxGroupContext\n );\n\n const form = createSlottedContext(FormContext);\n\n const [registerLabel, label] = createSlot(\n () => !isTruthy(props[\"aria-label\"]) && !isTruthy(props[\"aria-labelledby\"])\n );\n\n const options = mergeProps(props, {\n get label() {\n return label();\n },\n get validationBehavior() {\n return props.validationBehavior ?? form?.validationBehavior ?? \"native\";\n },\n });\n\n const state = createCheckboxGroupState(options);\n const aria = createCheckboxGroup(options, state);\n\n const values: CheckboxGroupRenderProps = {\n get isDisabled() {\n return state.isDisabled;\n },\n get isInvalid() {\n return state.isInvalid;\n },\n get isReadOnly() {\n return state.isReadOnly;\n },\n get isRequired() {\n return props.isRequired === true;\n },\n state,\n };\n\n const labelProps = mergeProps(\n merge(() => aria.labelProps),\n { elementType: \"span\" as const, registerSlot: registerLabel }\n );\n\n const render = createRenderProps(\n mergeProps(props, { defaultClass: \"solid2-aria-CheckboxGroup\", values })\n );\n\n return (\n <dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.groupProps ?? {}),\n render\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={props.slot ?? undefined}\n data-disabled={values.isDisabled || undefined}\n data-readonly={values.isReadOnly || undefined}\n data-required={values.isRequired || undefined}\n data-invalid={values.isInvalid || undefined}\n >\n <CheckboxGroupStateContext value={state}>\n <LabelContext value={labelProps}>\n <TextContext\n value={{\n slots: {\n get description() {\n return aria.descriptionProps;\n },\n get errorMessage() {\n return aria.errorMessageProps;\n },\n },\n }}\n >\n <FieldErrorContext value={aria}>\n {render.children}\n </FieldErrorContext>\n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{ DragAndDropContext } from "./drag-and-drop.js";
19
19
  import { mergeProps } from "@solid2-aria/core/utils/merge-props";
20
- import { Show, createMemo, createSignal, merge, untrack, useContext } from "solid-js";
20
+ import { createMemo, createSignal, merge, untrack, useContext } from "solid-js";
21
21
  import { dynamic, memo, mergeProps as mergeProps$1, ssrElement } from "@solidjs/web";
22
22
  import { requireValue } from "@solid2-aria/core/utils/require-value";
23
23
  import { createVisuallyHidden } from "@solid2-aria/core/visually-hidden/visually-hidden";
@@ -29,7 +29,6 @@ var _m$2 = Symbol();
29
29
  var _m$3 = Symbol();
30
30
  var _m$4 = Symbol();
31
31
  var _m$5 = Symbol();
32
- var _m$6 = Symbol();
33
32
  var _d$ = {
34
33
  get() {
35
34
  return this[_m$].columnCount;
@@ -92,39 +91,6 @@ function _P$2(_p6, _p7, _p8, _p9, _p0, _p1, _p10) {
92
91
  Object.defineProperty(this, "children", _d$4);
93
92
  }
94
93
  _P$2.prototype = Object.prototype;
95
- var _d$5 = {
96
- get() {
97
- return !this[_m$].isHidden;
98
- },
99
- enumerable: true,
100
- configurable: true
101
- };
102
- var _d$6 = {
103
- get() {
104
- const Tag = this[_m$2];
105
- const render = this[_m$3];
106
- const aria = this[_m$];
107
- const Cell = this[_m$4];
108
- const props = this[_m$5];
109
- const hidden = this[_m$6];
110
- return Tag(mergeProps$1(render, new _P$2(aria, Cell, props, hidden, render, "row", (element) => {
111
- assignRef(untrack(() => props.ref), element);
112
- })));
113
- },
114
- enumerable: true,
115
- configurable: true
116
- };
117
- function _P$3(_p11, _p12, _p13, _p14, _p15, _p16) {
118
- this[_m$] = _p11;
119
- this[_m$2] = _p12;
120
- this[_m$3] = _p13;
121
- this[_m$4] = _p14;
122
- this[_m$5] = _p15;
123
- this[_m$6] = _p16;
124
- Object.defineProperty(this, "when", _d$5);
125
- Object.defineProperty(this, "children", _d$6);
126
- }
127
- _P$3.prototype = Object.prototype;
128
94
  function createCollectionDragAndDrop(options) {
129
95
  const hooks = untrack(() => options.hooks);
130
96
  const [previewRef, setPreviewRef] = createSignal(null, { ownedWrite: true });
@@ -194,7 +160,13 @@ function CollectionDropIndicator(props) {
194
160
  }));
195
161
  const Tag = dynamic(() => props.table === true ? dom.tr : dom.div);
196
162
  const Cell = dynamic(() => props.table === true ? dom.td : dom.div);
197
- return Show(new _P$3(aria, Tag, render, Cell, props, hidden));
163
+ return memo(() => {
164
+ return memo(() => {
165
+ return !aria.isHidden;
166
+ })() ? Tag(mergeProps$1(render, new _P$2(aria, Cell, props, hidden, render, "row", (element) => {
167
+ assignRef(untrack(() => props.ref), element);
168
+ }))) : void 0;
169
+ });
198
170
  }
199
171
  function createCollectionItemDragAndDrop(context, key, dropRef, activateButtonRef) {
200
172
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"collection-dnd.js","names":["<div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => aria.dropIndicatorProps ?? {})\n )}\n role=\"button\"\n ref={(element: HTMLDivElement) => {\n setButtonRef(element);\n }}\n />","{render.children}","ref={(element: DragPreviewRenderer | null) => {\n setPreviewRef(() => element);\n }}","<Preview\n ref={(element: DragPreviewRenderer | null) => {\n setPreviewRef(() => element);\n }}\n >\n {renderDragPreview}\n </Preview>","_$ssrElement","_$memo","_$mergeProps"],"sources":["../../src/collection-dnd.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-aria-components/src/GridList.tsx.\n * Modified for Solid Aria: collections, selection, drag and drop, and DOM rendering use Solid 2 ownership and reactive getters; uses Solid class props.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport type { DroppableCollectionOptions } from \"@solid2-aria/core/dnd/create-droppable-collection\";\nimport { ListKeyboardDelegate } from \"@solid2-aria/core/selection/list-keyboard-delegate\";\nimport type { HTMLAttributes } from \"@solid2-aria/core/types\";\nimport { mergeProps } from \"@solid2-aria/core/utils/merge-props\";\nimport { requireValue } from \"@solid2-aria/core/utils/require-value\";\nimport { createVisuallyHidden } from \"@solid2-aria/core/visually-hidden/visually-hidden\";\nimport type { DraggableCollectionState } from \"@solid2-aria/stately/dnd/create-draggable-collection-state\";\nimport type { DroppableCollectionState } from \"@solid2-aria/stately/dnd/create-droppable-collection-state\";\nimport type { MultipleSelectionManager } from \"@solid2-aria/stately/selection/types\";\nimport type {\n Collection as ICollection,\n Node,\n Key,\n DragPreviewRenderer,\n Orientation,\n KeyboardDelegate,\n DroppableCollectionProps,\n DropTargetDelegate,\n} from \"@solid2-aria/types-shared\";\nimport { dynamic } from \"@solidjs/web\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n merge,\n untrack,\n createSignal,\n createMemo,\n useContext,\n Show,\n} from \"solid-js\";\nimport type { Accessor } from \"solid-js\";\n\nimport type { DragAndDropHooks } from \"./create-drag-and-drop\";\nimport { DragAndDropContext } from \"./drag-and-drop\";\nimport type {\n DragAndDropContextValue,\n DropIndicatorProps,\n} from \"./drag-and-drop\";\nimport { assignRef, dom, createRenderProps } from \"./utils\";\n\nexport interface CollectionDragAndDrop<T> {\n readonly collectionProps: HTMLAttributes | undefined;\n dragAndDropHooks: DragAndDropHooks<T> | undefined;\n dragState: DraggableCollectionState | undefined;\n dropState: DroppableCollectionState | undefined;\n readonly preview: JSX.Element;\n}\n\nexport function createCollectionDragAndDrop<T>(options: {\n hooks?: DragAndDropHooks<T>;\n collection: ICollection<Node<T>>;\n selectionManager: MultipleSelectionManager;\n ref: Accessor<HTMLElement | null>;\n keyboardDelegate?: KeyboardDelegate;\n dropTargetCollection?: Iterable<Node<T>>;\n onDropActivate?: DroppableCollectionProps[\"onDropActivate\"];\n onKeyDown?: DroppableCollectionOptions[\"onKeyDown\"];\n dropTargetDelegate?: DropTargetDelegate;\n layout?: \"stack\" | \"grid\";\n orientation?: Orientation;\n direction?: \"ltr\" | \"rtl\";\n}): CollectionDragAndDrop<T> {\n const hooks = untrack(() => options.hooks);\n\n const [previewRef, setPreviewRef] = createSignal<DragPreviewRenderer | null>(\n null,\n { ownedWrite: true }\n );\n\n const dragState = hooks?.createDraggableCollectionState?.({\n get collection() {\n return options.collection;\n },\n preview: hooks.renderDragPreview ? previewRef : undefined,\n get selectionManager() {\n return options.selectionManager;\n },\n });\n\n if (dragState) {\n hooks?.createDraggableCollection?.({}, dragState, options.ref);\n }\n\n const dropState = hooks?.createDroppableCollectionState?.({\n get collection() {\n return options.collection;\n },\n get selectionManager() {\n return options.selectionManager;\n },\n });\n\n const liveCollection: Iterable<Node<T>> = {\n [Symbol.iterator]() {\n return (options.dropTargetCollection ?? options.collection)[\n Symbol.iterator\n ]();\n },\n };\n\n const fallbackKeyboard = createMemo(\n () =>\n new ListKeyboardDelegate(\n options.collection,\n options.selectionManager.disabledKeys,\n options.ref\n )\n );\n\n const result = dropState\n ? hooks?.createDroppableCollection?.(\n {\n dropTargetDelegate:\n options.dropTargetDelegate ??\n hooks.dropTargetDelegate ??\n new hooks.ListDropTargetDelegate(liveCollection, options.ref, {\n direction: options.direction,\n layout: options.layout,\n orientation: options.orientation,\n }),\n get keyboardDelegate() {\n return options.keyboardDelegate ?? fallbackKeyboard();\n },\n onDropActivate: options.onDropActivate,\n onKeyDown: options.onKeyDown,\n },\n dropState,\n options.ref\n )\n : undefined;\n\n const Preview = hooks?.DragPreview;\n const renderDragPreview = hooks?.renderDragPreview;\n\n return {\n get collectionProps() {\n return result?.collectionProps;\n },\n dragAndDropHooks: hooks,\n dragState,\n dropState,\n get preview() {\n return (\n <>\n {Preview && renderDragPreview && (\n <Preview\n ref={(element: DragPreviewRenderer | null) => {\n setPreviewRef(() => element);\n }}\n >\n {renderDragPreview}\n </Preview>\n )}\n </>\n );\n },\n };\n}\n\nexport function CollectionDropIndicator(\n props: DropIndicatorProps & { table?: boolean; columnCount?: number }\n) {\n const context = useContext(DragAndDropContext);\n\n const [buttonRef, setButtonRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const aria = untrack(() =>\n requireValue(\n requireValue(\n context.dragAndDropHooks,\n \"Expected context.dragAndDropHooks\"\n ).createDropIndicator,\n \"Expected context.dragAndDropHooks!.createDropIndicator\"\n )(\n props,\n requireValue(context.dropState, \"Expected context.dropState\"),\n buttonRef\n )\n );\n\n const hidden = createVisuallyHidden();\n\n const render = createRenderProps(\n mergeProps(props, {\n defaultClass: \"solid2-aria-DropIndicator\",\n get values() {\n return { isDropTarget: aria.isDropTarget };\n },\n })\n );\n\n const Tag = dynamic(() => (props.table === true ? dom.tr : dom.div));\n const Cell = dynamic(() => (props.table === true ? dom.td : dom.div));\n\n return (\n <Show when={!aria.isHidden}>\n <Tag\n {...render}\n role=\"row\"\n ref={(element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n data-drop-target={aria.isDropTarget || undefined}\n >\n <Cell role=\"gridcell\" colspan={props.columnCount}>\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => aria.dropIndicatorProps ?? {})\n )}\n role=\"button\"\n ref={(element: HTMLDivElement) => {\n setButtonRef(element);\n }}\n />\n {render.children}\n </Cell>\n </Tag>\n </Show>\n );\n}\n\nexport function createCollectionItemDragAndDrop(\n context: DragAndDropContextValue,\n key: Key,\n dropRef: Accessor<HTMLElement | null>,\n activateButtonRef?: Accessor<HTMLElement | null>\n) {\n const drag = context.dragState\n ? context.dragAndDropHooks?.createDraggableItem?.(\n { hasDragButton: true, key },\n context.dragState\n )\n : undefined;\n\n const drop = context.dropState\n ? context.dragAndDropHooks?.createDropIndicator?.(\n {\n activateButtonRef,\n target: { dropPosition: \"on\", key, type: \"item\" },\n },\n context.dropState,\n dropRef\n )\n : undefined;\n\n return { drag, drop };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiO8B,O,SAAS,CAAM;;;;;;;;;;EAArC,OAAkD,CAChDA,WAAAA,aACM;GACF,OAAA,WAAA,YAAY,OAAO,uBAAuB,CAAC,CAAC,GAC5C,YAAY,KAAK,sBAAsB,CAAC,CAAC,CAC3C;EAJF,GAAA,KAAA,GAAA,MAAA,MAAA,kBASC,GACDC,WAAAA;GAAC,OAAA,OAAO;EAAQ,CAAA,CAVjB;;;;;;;;;;;;;;;;;EAHD,O,SAAkB,CAAK,gBAAgB,KAAA;;;;;;;;;;;;EAEvC,OAAA,KAAA,IAAA,IAA+B,OAGb,QACA,MAOf,QAXG,UAYA,CAAA;;;;;;;;;;;;;;;;;;;EAxBJ,OAAM,C,SAAC,CAAK;;;;;;;;;;;;;EAChB,OAAA,IAAAK,aACM,QADN,IAAA,KASoB,MAAA,MAEa,OAGb,QAQf,QApBH,QACM,YAAyB;GAC7B,UACE,cAAc,MAAM,GAAG,GACvB,OACF;EACF,CAgBG,CAAA,CAAA;;;;;;;;;;;;;;;;AA9KX,SAAgB,4BAA+B,SAalB;CAC3B,MAAM,QAAQ,cAAc,QAAQ,KAAK;CAEzC,MAAM,CAAC,YAAY,iBAAiB,aAClC,MACA,EAAE,YAAY,KAAK,CACrB;CAEA,MAAM,YAAY,OAAO,iCAAiC;EACxD,IAAI,aAAa;GACf,OAAO,QAAQ;EACjB;EACA,SAAS,MAAM,oBAAoB,aAAa,KAAA;EAChD,IAAI,mBAAmB;GACrB,OAAO,QAAQ;EACjB;CACF,CAAC;CAED,IAAI,WACF,OAAO,4BAA4B,CAAC,GAAG,WAAW,QAAQ,GAAG;CAG/D,MAAM,YAAY,OAAO,iCAAiC;EACxD,IAAI,aAAa;GACf,OAAO,QAAQ;EACjB;EACA,IAAI,mBAAmB;GAC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C3C;CACF,CAAC,CACH;CAEA,MAAM,MAAM,cAAe,MAAM,UAAU,OAAO,IAAI,KAAK,IAAI,GAAI;CACnE,MAAM,OAAO,cAAe,MAAM,UAAU,OAAO,IAAI,KAAK,IAAI,GAAI;CAEpE,OAAA,KACE,IAAA,KAAa,MAAA,KAEL,QAAA,MAU2B,OAGb,MAWhB,CAAA;AAEV;AAEA,SAAgB,gCACd,SACA,KACA,SACA,mBACA;CAmBA,OAAO;EAAE,MAlBI,QAAQ,YACjB,QAAQ,kBAAkB,sBACxB;GAAE,eAAe;GAAM;EAAI,GAC3B,QAAQ,SACV,IACA,KAAA;EAaW,MAXF,QAAQ,YACjB,QAAQ,kBAAkB,sBACxB;GACE;GACA,QAAQ;IAAE,cAAc;IAAM;IAAK,MAAM;GAAO;EAClD,GACA,QAAQ,WACR,OACF,IACA,KAAA;CAEgB;AACtB"}
1
+ {"version":3,"file":"collection-dnd.js","names":["<div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => aria.dropIndicatorProps ?? {})\n )}\n role=\"button\"\n ref={(element: HTMLDivElement) => {\n setButtonRef(element);\n }}\n />","{render.children}","ref={(element: DragPreviewRenderer | null) => {\n setPreviewRef(() => element);\n }}","<Preview\n ref={(element: DragPreviewRenderer | null) => {\n setPreviewRef(() => element);\n }}\n >\n {renderDragPreview}\n </Preview>","<Show when={!aria.isHidden}>\n <Tag\n {...render}\n role=\"row\"\n ref={(element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n data-drop-target={aria.isDropTarget || undefined}\n >\n <Cell role=\"gridcell\" colspan={props.columnCount}>\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => aria.dropIndicatorProps ?? {})\n )}\n role=\"button\"\n ref={(element: HTMLDivElement) => {\n setButtonRef(element);\n }}\n />\n {render.children}\n </Cell>\n </Tag>\n </Show>","<Tag\n {...render}\n role=\"row\"\n ref={(element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n data-drop-target={aria.isDropTarget || undefined}\n >\n <Cell role=\"gridcell\" colspan={props.columnCount}>\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => aria.dropIndicatorProps ?? {})\n )}\n role=\"button\"\n ref={(element: HTMLDivElement) => {\n setButtonRef(element);\n }}\n />\n {render.children}\n </Cell>\n </Tag>","_$ssrElement","_$memo","_$mergeProps"],"sources":["../../src/collection-dnd.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-aria-components/src/GridList.tsx.\n * Modified for Solid Aria: collections, selection, drag and drop, and DOM rendering use Solid 2 ownership and reactive getters; uses Solid class props.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport type { DroppableCollectionOptions } from \"@solid2-aria/core/dnd/create-droppable-collection\";\nimport { ListKeyboardDelegate } from \"@solid2-aria/core/selection/list-keyboard-delegate\";\nimport type { HTMLAttributes } from \"@solid2-aria/core/types\";\nimport { mergeProps } from \"@solid2-aria/core/utils/merge-props\";\nimport { requireValue } from \"@solid2-aria/core/utils/require-value\";\nimport { createVisuallyHidden } from \"@solid2-aria/core/visually-hidden/visually-hidden\";\nimport type { DraggableCollectionState } from \"@solid2-aria/stately/dnd/create-draggable-collection-state\";\nimport type { DroppableCollectionState } from \"@solid2-aria/stately/dnd/create-droppable-collection-state\";\nimport type { MultipleSelectionManager } from \"@solid2-aria/stately/selection/types\";\nimport type {\n Collection as ICollection,\n Node,\n Key,\n DragPreviewRenderer,\n Orientation,\n KeyboardDelegate,\n DroppableCollectionProps,\n DropTargetDelegate,\n} from \"@solid2-aria/types-shared\";\nimport { dynamic } from \"@solidjs/web\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n merge,\n untrack,\n createSignal,\n createMemo,\n useContext,\n Show,\n} from \"solid-js\";\nimport type { Accessor } from \"solid-js\";\n\nimport type { DragAndDropHooks } from \"./create-drag-and-drop\";\nimport { DragAndDropContext } from \"./drag-and-drop\";\nimport type {\n DragAndDropContextValue,\n DropIndicatorProps,\n} from \"./drag-and-drop\";\nimport { assignRef, dom, createRenderProps } from \"./utils\";\n\nexport interface CollectionDragAndDrop<T> {\n readonly collectionProps: HTMLAttributes | undefined;\n dragAndDropHooks: DragAndDropHooks<T> | undefined;\n dragState: DraggableCollectionState | undefined;\n dropState: DroppableCollectionState | undefined;\n readonly preview: JSX.Element;\n}\n\nexport function createCollectionDragAndDrop<T>(options: {\n hooks?: DragAndDropHooks<T>;\n collection: ICollection<Node<T>>;\n selectionManager: MultipleSelectionManager;\n ref: Accessor<HTMLElement | null>;\n keyboardDelegate?: KeyboardDelegate;\n dropTargetCollection?: Iterable<Node<T>>;\n onDropActivate?: DroppableCollectionProps[\"onDropActivate\"];\n onKeyDown?: DroppableCollectionOptions[\"onKeyDown\"];\n dropTargetDelegate?: DropTargetDelegate;\n layout?: \"stack\" | \"grid\";\n orientation?: Orientation;\n direction?: \"ltr\" | \"rtl\";\n}): CollectionDragAndDrop<T> {\n const hooks = untrack(() => options.hooks);\n\n const [previewRef, setPreviewRef] = createSignal<DragPreviewRenderer | null>(\n null,\n { ownedWrite: true }\n );\n\n const dragState = hooks?.createDraggableCollectionState?.({\n get collection() {\n return options.collection;\n },\n preview: hooks.renderDragPreview ? previewRef : undefined,\n get selectionManager() {\n return options.selectionManager;\n },\n });\n\n if (dragState) {\n hooks?.createDraggableCollection?.({}, dragState, options.ref);\n }\n\n const dropState = hooks?.createDroppableCollectionState?.({\n get collection() {\n return options.collection;\n },\n get selectionManager() {\n return options.selectionManager;\n },\n });\n\n const liveCollection: Iterable<Node<T>> = {\n [Symbol.iterator]() {\n return (options.dropTargetCollection ?? options.collection)[\n Symbol.iterator\n ]();\n },\n };\n\n const fallbackKeyboard = createMemo(\n () =>\n new ListKeyboardDelegate(\n options.collection,\n options.selectionManager.disabledKeys,\n options.ref\n )\n );\n\n const result = dropState\n ? hooks?.createDroppableCollection?.(\n {\n dropTargetDelegate:\n options.dropTargetDelegate ??\n hooks.dropTargetDelegate ??\n new hooks.ListDropTargetDelegate(liveCollection, options.ref, {\n direction: options.direction,\n layout: options.layout,\n orientation: options.orientation,\n }),\n get keyboardDelegate() {\n return options.keyboardDelegate ?? fallbackKeyboard();\n },\n onDropActivate: options.onDropActivate,\n onKeyDown: options.onKeyDown,\n },\n dropState,\n options.ref\n )\n : undefined;\n\n const Preview = hooks?.DragPreview;\n const renderDragPreview = hooks?.renderDragPreview;\n\n return {\n get collectionProps() {\n return result?.collectionProps;\n },\n dragAndDropHooks: hooks,\n dragState,\n dropState,\n get preview() {\n return (\n <>\n {Preview && renderDragPreview && (\n <Preview\n ref={(element: DragPreviewRenderer | null) => {\n setPreviewRef(() => element);\n }}\n >\n {renderDragPreview}\n </Preview>\n )}\n </>\n );\n },\n };\n}\n\nexport function CollectionDropIndicator(\n props: DropIndicatorProps & { table?: boolean; columnCount?: number }\n) {\n const context = useContext(DragAndDropContext);\n\n const [buttonRef, setButtonRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const aria = untrack(() =>\n requireValue(\n requireValue(\n context.dragAndDropHooks,\n \"Expected context.dragAndDropHooks\"\n ).createDropIndicator,\n \"Expected context.dragAndDropHooks!.createDropIndicator\"\n )(\n props,\n requireValue(context.dropState, \"Expected context.dropState\"),\n buttonRef\n )\n );\n\n const hidden = createVisuallyHidden();\n\n const render = createRenderProps(\n mergeProps(props, {\n defaultClass: \"solid2-aria-DropIndicator\",\n get values() {\n return { isDropTarget: aria.isDropTarget };\n },\n })\n );\n\n const Tag = dynamic(() => (props.table === true ? dom.tr : dom.div));\n const Cell = dynamic(() => (props.table === true ? dom.td : dom.div));\n\n return (\n <Show when={!aria.isHidden}>\n <Tag\n {...render}\n role=\"row\"\n ref={(element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n data-drop-target={aria.isDropTarget || undefined}\n >\n <Cell role=\"gridcell\" colspan={props.columnCount}>\n <div\n {...mergeProps(\n merge(() => hidden.visuallyHiddenProps ?? {}),\n merge(() => aria.dropIndicatorProps ?? {})\n )}\n role=\"button\"\n ref={(element: HTMLDivElement) => {\n setButtonRef(element);\n }}\n />\n {render.children}\n </Cell>\n </Tag>\n </Show>\n );\n}\n\nexport function createCollectionItemDragAndDrop(\n context: DragAndDropContextValue,\n key: Key,\n dropRef: Accessor<HTMLElement | null>,\n activateButtonRef?: Accessor<HTMLElement | null>\n) {\n const drag = context.dragState\n ? context.dragAndDropHooks?.createDraggableItem?.(\n { hasDragButton: true, key },\n context.dragState\n )\n : undefined;\n\n const drop = context.dropState\n ? context.dragAndDropHooks?.createDropIndicator?.(\n {\n activateButtonRef,\n target: { dropPosition: \"on\", key, type: \"item\" },\n },\n context.dropState,\n dropRef\n )\n : undefined;\n\n return { drag, drop };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiO8B,O,SAAS,CAAM;;;;;;;;;;EAArC,OAAkD,CAChDA,WAAAA,aACM;GACF,OAAA,WAAA,YAAY,OAAO,uBAAuB,CAAC,CAAC,GAC5C,YAAY,KAAK,sBAAsB,CAAC,CAAC,CAC3C;EAJF,GAAA,KAAA,GAAA,MAAA,MAAA,kBASC,GACDC,WAAAA;GAAC,OAAA,OAAO;EAAQ,CAAA,CAVjB;;;;;;;;;;;;;;;;;EAHD,O,SAAkB,CAAK,gBAAgB,KAAA;;;;;;;;;;;;EAEvC,OAAA,KAAA,IAAA,IAA+B,O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 -14,10 +14,11 @@
14
14
  * Modified for Solid Aria: composed Solid Aria and Stately primitives with Solid 2 contexts, reactive getters, and DOM refs; uses Solid class props.
15
15
  * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
16
16
  */
17
- import { assignRef, createContextProps, createRenderProps, createSlot, dom, removeDataAttributes } from "./utils.js";
17
+ import { assignRef, createContextProps, createRenderProps, createSlot, createSlottedContext, dom, removeDataAttributes } from "./utils.js";
18
18
  import { LabelContext } from "./label.js";
19
19
  import { TextContext } from "./text.js";
20
20
  import { FieldErrorContext } from "./field-error.js";
21
+ import { FormContext } from "./form.js";
21
22
  import { GroupContext } from "./group.js";
22
23
  import { InputContext } from "./input.js";
23
24
  import { mergeProps } from "@solid2-aria/core/utils/merge-props";
@@ -304,7 +305,11 @@ _P$9.prototype = Object.prototype;
304
305
  const ColorFieldContext = createContext(null);
305
306
  const ColorFieldStateContext = createContext(null);
306
307
  function ColorField(input) {
307
- const [props, , setRef] = createContextProps(input, untrack(() => input.ref), ColorFieldContext);
308
+ const [contextProps, , setRef] = createContextProps(input, untrack(() => input.ref), ColorFieldContext);
309
+ const form = createSlottedContext(FormContext);
310
+ const props = mergeProps(contextProps, { get validationBehavior() {
311
+ return contextProps.validationBehavior ?? form?.validationBehavior ?? "native";
312
+ } });
308
313
  return Show(new _P$2(props, setRef, (channel) => ColorChannelField(mergeProps$1(props, new _P$(channel, (element) => {
309
314
  setRef(element);
310
315
  })))));