@proyecto-viviana/solidaria-components 0.3.2 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionBar.d.ts.map +1 -1
- package/dist/ActionBar.js +175 -0
- package/dist/ActionBar.js.map +1 -0
- package/dist/ActionBar.jsx +119 -0
- package/dist/ActionBar.jsx.map +1 -0
- package/dist/ActionGroup.d.ts.map +1 -1
- package/dist/ActionGroup.js +179 -0
- package/dist/ActionGroup.js.map +1 -0
- package/dist/ActionGroup.jsx +129 -0
- package/dist/ActionGroup.jsx.map +1 -0
- package/dist/Alert.js +111 -0
- package/dist/Alert.js.map +1 -0
- package/dist/Alert.jsx +82 -0
- package/dist/Alert.jsx.map +1 -0
- package/dist/Autocomplete.d.ts +2 -2
- package/dist/Autocomplete.d.ts.map +1 -1
- package/dist/Autocomplete.js +130 -0
- package/dist/Autocomplete.js.map +1 -0
- package/dist/Autocomplete.jsx +116 -0
- package/dist/Autocomplete.jsx.map +1 -0
- package/dist/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs.js +333 -0
- package/dist/Breadcrumbs.js.map +1 -0
- package/dist/Breadcrumbs.jsx +261 -0
- package/dist/Breadcrumbs.jsx.map +1 -0
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +348 -0
- package/dist/Button.js.map +1 -0
- package/dist/Button.jsx +314 -0
- package/dist/Button.jsx.map +1 -0
- package/dist/Calendar.d.ts +4 -4
- package/dist/Calendar.d.ts.map +1 -1
- package/dist/Calendar.js +573 -0
- package/dist/Calendar.js.map +1 -0
- package/dist/Calendar.jsx +342 -0
- package/dist/Calendar.jsx.map +1 -0
- package/dist/CalendarPicker.d.ts +33 -0
- package/dist/CalendarPicker.d.ts.map +1 -0
- package/dist/CalendarPicker.js +44 -0
- package/dist/CalendarPicker.js.map +1 -0
- package/dist/CalendarPicker.jsx +44 -0
- package/dist/CalendarPicker.jsx.map +1 -0
- package/dist/Checkbox.d.ts +83 -4
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox.js +923 -0
- package/dist/Checkbox.js.map +1 -0
- package/dist/Checkbox.jsx +707 -0
- package/dist/Checkbox.jsx.map +1 -0
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +202 -0
- package/dist/Collection.js.map +1 -0
- package/dist/Collection.jsx +152 -0
- package/dist/Collection.jsx.map +1 -0
- package/dist/Color.d.ts.map +1 -1
- package/dist/Color.js +1717 -0
- package/dist/Color.js.map +1 -0
- package/dist/Color.jsx +1340 -0
- package/dist/Color.jsx.map +1 -0
- package/dist/ColorEditor.js +208 -0
- package/dist/ColorEditor.js.map +1 -0
- package/dist/ColorEditor.jsx +120 -0
- package/dist/ColorEditor.jsx.map +1 -0
- package/dist/ComboBox.d.ts +8 -4
- package/dist/ComboBox.d.ts.map +1 -1
- package/dist/ComboBox.js +1000 -0
- package/dist/ComboBox.js.map +1 -0
- package/dist/ComboBox.jsx +724 -0
- package/dist/ComboBox.jsx.map +1 -0
- package/dist/ContextualHelpTrigger.js +146 -0
- package/dist/ContextualHelpTrigger.js.map +1 -0
- package/dist/ContextualHelpTrigger.jsx +109 -0
- package/dist/ContextualHelpTrigger.jsx.map +1 -0
- package/dist/DateField.d.ts +14 -5
- package/dist/DateField.d.ts.map +1 -1
- package/dist/DateField.js +4 -0
- package/dist/DateField.jsx +4 -0
- package/dist/DateField2.js +502 -0
- package/dist/DateField2.js.map +1 -0
- package/dist/DateField2.jsx +354 -0
- package/dist/DateField2.jsx.map +1 -0
- package/dist/DatePicker.d.ts +46 -7
- package/dist/DatePicker.d.ts.map +1 -1
- package/dist/DatePicker.js +7 -0
- package/dist/DatePicker.jsx +7 -0
- package/dist/DatePicker2.js +1171 -0
- package/dist/DatePicker2.js.map +1 -0
- package/dist/DatePicker2.jsx +820 -0
- package/dist/DatePicker2.jsx.map +1 -0
- package/dist/DateRangePickerContext.d.ts +2 -0
- package/dist/DateRangePickerContext.d.ts.map +1 -1
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Dialog.js +337 -0
- package/dist/Dialog.js.map +1 -0
- package/dist/Dialog.jsx +192 -0
- package/dist/Dialog.jsx.map +1 -0
- package/dist/Disclosure.d.ts.map +1 -1
- package/dist/Disclosure.js +331 -0
- package/dist/Disclosure.js.map +1 -0
- package/dist/Disclosure.jsx +230 -0
- package/dist/Disclosure.jsx.map +1 -0
- package/dist/DragAndDrop.d.ts.map +1 -1
- package/dist/DragAndDrop.js +176 -0
- package/dist/DragAndDrop.js.map +1 -0
- package/dist/DragAndDrop.jsx +160 -0
- package/dist/DragAndDrop.jsx.map +1 -0
- package/dist/DropZone.d.ts.map +1 -1
- package/dist/DropZone.js +189 -0
- package/dist/DropZone.js.map +1 -0
- package/dist/DropZone.jsx +144 -0
- package/dist/DropZone.jsx.map +1 -0
- package/dist/FieldError.js +66 -0
- package/dist/FieldError.js.map +1 -0
- package/dist/FieldError.jsx +47 -0
- package/dist/FieldError.jsx.map +1 -0
- package/dist/FileTrigger.js +79 -0
- package/dist/FileTrigger.js.map +1 -0
- package/dist/FileTrigger.jsx +49 -0
- package/dist/FileTrigger.jsx.map +1 -0
- package/dist/Focusable.js +70 -0
- package/dist/Focusable.js.map +1 -0
- package/dist/Focusable.jsx +69 -0
- package/dist/Focusable.jsx.map +1 -0
- package/dist/Form.js +99 -0
- package/dist/Form.js.map +1 -0
- package/dist/Form.jsx +73 -0
- package/dist/Form.jsx.map +1 -0
- package/dist/GridList.d.ts +34 -2
- package/dist/GridList.d.ts.map +1 -1
- package/dist/GridList.js +723 -0
- package/dist/GridList.js.map +1 -0
- package/dist/GridList.jsx +552 -0
- package/dist/GridList.jsx.map +1 -0
- package/dist/Icon.d.ts.map +1 -1
- package/dist/Icon.js +127 -0
- package/dist/Icon.js.map +1 -0
- package/dist/Icon.jsx +72 -0
- package/dist/Icon.jsx.map +1 -0
- package/dist/Keyboard.js +30 -0
- package/dist/Keyboard.js.map +1 -0
- package/dist/Keyboard.jsx +24 -0
- package/dist/Keyboard.jsx.map +1 -0
- package/dist/Landmark.js +134 -0
- package/dist/Landmark.js.map +1 -0
- package/dist/Landmark.jsx +118 -0
- package/dist/Landmark.jsx.map +1 -0
- package/dist/Link.d.ts.map +1 -1
- package/dist/Link.js +219 -0
- package/dist/Link.js.map +1 -0
- package/dist/Link.jsx +189 -0
- package/dist/Link.jsx.map +1 -0
- package/dist/ListBox.d.ts +2 -2
- package/dist/ListBox.d.ts.map +1 -1
- package/dist/ListBox.js +831 -0
- package/dist/ListBox.js.map +1 -0
- package/dist/ListBox.jsx +644 -0
- package/dist/ListBox.jsx.map +1 -0
- package/dist/Menu.d.ts +27 -9
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Menu.js +1254 -0
- package/dist/Menu.js.map +1 -0
- package/dist/Menu.jsx +1042 -0
- package/dist/Menu.jsx.map +1 -0
- package/dist/Meter.d.ts.map +1 -1
- package/dist/Meter.js +123 -0
- package/dist/Meter.js.map +1 -0
- package/dist/Meter.jsx +107 -0
- package/dist/Meter.jsx.map +1 -0
- package/dist/Modal.d.ts.map +1 -1
- package/dist/Modal.js +382 -0
- package/dist/Modal.js.map +1 -0
- package/dist/Modal.jsx +314 -0
- package/dist/Modal.jsx.map +1 -0
- package/dist/NumberField.d.ts +3 -3
- package/dist/NumberField.d.ts.map +1 -1
- package/dist/NumberField.js +573 -0
- package/dist/NumberField.js.map +1 -0
- package/dist/NumberField.jsx +443 -0
- package/dist/NumberField.jsx.map +1 -0
- package/dist/Popover.d.ts +10 -2
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Popover.js +471 -0
- package/dist/Popover.js.map +1 -0
- package/dist/Popover.jsx +354 -0
- package/dist/Popover.jsx.map +1 -0
- package/dist/Pressable.js +69 -0
- package/dist/Pressable.js.map +1 -0
- package/dist/Pressable.jsx +68 -0
- package/dist/Pressable.jsx.map +1 -0
- package/dist/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar.js +130 -0
- package/dist/ProgressBar.js.map +1 -0
- package/dist/ProgressBar.jsx +114 -0
- package/dist/ProgressBar.jsx.map +1 -0
- package/dist/RadioGroup.d.ts +82 -4
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup.js +931 -0
- package/dist/RadioGroup.js.map +1 -0
- package/dist/RadioGroup.jsx +681 -0
- package/dist/RadioGroup.jsx.map +1 -0
- package/dist/RangeCalendar.d.ts.map +1 -1
- package/dist/RangeCalendar.js +546 -0
- package/dist/RangeCalendar.js.map +1 -0
- package/dist/RangeCalendar.jsx +323 -0
- package/dist/RangeCalendar.jsx.map +1 -0
- package/dist/RouterProvider.js +118 -0
- package/dist/RouterProvider.js.map +1 -0
- package/dist/RouterProvider.jsx +112 -0
- package/dist/RouterProvider.jsx.map +1 -0
- package/dist/SearchField.d.ts +2 -2
- package/dist/SearchField.d.ts.map +1 -1
- package/dist/SearchField.js +667 -0
- package/dist/SearchField.js.map +1 -0
- package/dist/SearchField.jsx +550 -0
- package/dist/SearchField.jsx.map +1 -0
- package/dist/Select.d.ts +7 -0
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +1044 -0
- package/dist/Select.js.map +1 -0
- package/dist/Select.jsx +759 -0
- package/dist/Select.jsx.map +1 -0
- package/dist/SelectionIndicator.d.ts.map +1 -1
- package/dist/SelectionIndicator.js +86 -0
- package/dist/SelectionIndicator.js.map +1 -0
- package/dist/SelectionIndicator.jsx +50 -0
- package/dist/SelectionIndicator.jsx.map +1 -0
- package/dist/Separator.js +97 -0
- package/dist/Separator.js.map +1 -0
- package/dist/Separator.jsx +85 -0
- package/dist/Separator.jsx.map +1 -0
- package/dist/SharedElementTransition.d.ts.map +1 -1
- package/dist/SharedElementTransition.js +167 -0
- package/dist/SharedElementTransition.js.map +1 -0
- package/dist/SharedElementTransition.jsx +140 -0
- package/dist/SharedElementTransition.jsx.map +1 -0
- package/dist/Slider.d.ts +33 -1
- package/dist/Slider.d.ts.map +1 -1
- package/dist/Slider.js +515 -0
- package/dist/Slider.js.map +1 -0
- package/dist/Slider.jsx +403 -0
- package/dist/Slider.jsx.map +1 -0
- package/dist/StepList.d.ts.map +1 -1
- package/dist/StepList.js +191 -0
- package/dist/StepList.js.map +1 -0
- package/dist/StepList.jsx +136 -0
- package/dist/StepList.jsx.map +1 -0
- package/dist/Switch.d.ts +65 -2
- package/dist/Switch.d.ts.map +1 -1
- package/dist/Switch.js +534 -0
- package/dist/Switch.js.map +1 -0
- package/dist/Switch.jsx +393 -0
- package/dist/Switch.jsx.map +1 -0
- package/dist/Table.d.ts +50 -0
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +1766 -0
- package/dist/Table.js.map +1 -0
- package/dist/Table.jsx +1355 -0
- package/dist/Table.jsx.map +1 -0
- package/dist/Tabs.d.ts +0 -4
- package/dist/Tabs.d.ts.map +1 -1
- package/dist/Tabs.js +598 -0
- package/dist/Tabs.js.map +1 -0
- package/dist/Tabs.jsx +367 -0
- package/dist/Tabs.jsx.map +1 -0
- package/dist/TagGroup.d.ts +3 -1
- package/dist/TagGroup.d.ts.map +1 -1
- package/dist/TagGroup.js +382 -0
- package/dist/TagGroup.js.map +1 -0
- package/dist/TagGroup.jsx +273 -0
- package/dist/TagGroup.jsx.map +1 -0
- package/dist/Text.d.ts +18 -6
- package/dist/Text.d.ts.map +1 -1
- package/dist/Text.js +42 -0
- package/dist/Text.js.map +1 -0
- package/dist/Text.jsx +35 -0
- package/dist/Text.jsx.map +1 -0
- package/dist/TextField.d.ts +6 -6
- package/dist/TextField.d.ts.map +1 -1
- package/dist/TextField.js +439 -0
- package/dist/TextField.js.map +1 -0
- package/dist/TextField.jsx +406 -0
- package/dist/TextField.jsx.map +1 -0
- package/dist/TimeField.d.ts +17 -53
- package/dist/TimeField.d.ts.map +1 -1
- package/dist/TimeField.js +278 -0
- package/dist/TimeField.js.map +1 -0
- package/dist/TimeField.jsx +218 -0
- package/dist/TimeField.jsx.map +1 -0
- package/dist/Toast.d.ts +14 -0
- package/dist/Toast.d.ts.map +1 -1
- package/dist/Toast.js +551 -0
- package/dist/Toast.js.map +1 -0
- package/dist/Toast.jsx +361 -0
- package/dist/Toast.jsx.map +1 -0
- package/dist/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton.js +123 -0
- package/dist/ToggleButton.js.map +1 -0
- package/dist/ToggleButton.jsx +88 -0
- package/dist/ToggleButton.jsx.map +1 -0
- package/dist/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/ToggleButtonGroup.js +114 -0
- package/dist/ToggleButtonGroup.js.map +1 -0
- package/dist/ToggleButtonGroup.jsx +85 -0
- package/dist/ToggleButtonGroup.jsx.map +1 -0
- package/dist/Toolbar.js +112 -0
- package/dist/Toolbar.js.map +1 -0
- package/dist/Toolbar.jsx +92 -0
- package/dist/Toolbar.jsx.map +1 -0
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip.js +539 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/Tooltip.jsx +465 -0
- package/dist/Tooltip.jsx.map +1 -0
- package/dist/Tree.d.ts +14 -2
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Tree.js +1424 -0
- package/dist/Tree.js.map +1 -0
- package/dist/Tree.jsx +1172 -0
- package/dist/Tree.jsx.map +1 -0
- package/dist/Virtualizer.d.ts +16 -2
- package/dist/Virtualizer.d.ts.map +1 -1
- package/dist/Virtualizer.js +2 -0
- package/dist/Virtualizer.jsx +2 -0
- package/dist/Virtualizer2.js +751 -0
- package/dist/Virtualizer2.js.map +1 -0
- package/dist/Virtualizer2.jsx +730 -0
- package/dist/Virtualizer2.jsx.map +1 -0
- package/dist/VirtualizerLayouts.d.ts +18 -0
- package/dist/VirtualizerLayouts.d.ts.map +1 -1
- package/dist/VisuallyHidden.js +42 -0
- package/dist/VisuallyHidden.js.map +1 -0
- package/dist/VisuallyHidden.jsx +35 -0
- package/dist/VisuallyHidden.jsx.map +1 -0
- package/dist/contexts.js +33 -0
- package/dist/contexts.js.map +1 -0
- package/dist/contexts.jsx +33 -0
- package/dist/contexts.jsx.map +1 -0
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +69 -23932
- package/dist/index.jsx +69 -18337
- package/dist/useDragAndDrop.d.ts +0 -8
- package/dist/useDragAndDrop.d.ts.map +1 -1
- package/dist/useDragAndDrop.js +2 -0
- package/dist/useDragAndDrop.jsx +2 -0
- package/dist/useDragAndDrop2.js +399 -0
- package/dist/useDragAndDrop2.js.map +1 -0
- package/dist/useDragAndDrop2.jsx +399 -0
- package/dist/useDragAndDrop2.jsx.map +1 -0
- package/dist/utils.d.ts +84 -11
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +285 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.jsx +277 -0
- package/dist/utils.jsx.map +1 -0
- package/dist/virtualizer/Layout.js +144 -0
- package/dist/virtualizer/Layout.js.map +1 -0
- package/dist/virtualizer/Layout.jsx +144 -0
- package/dist/virtualizer/Layout.jsx.map +1 -0
- package/package.json +395 -4
- package/src/ActionBar.tsx +10 -12
- package/src/ActionGroup.tsx +5 -3
- package/src/Autocomplete.tsx +14 -9
- package/src/Breadcrumbs.tsx +58 -39
- package/src/Button.tsx +22 -2
- package/src/Calendar.tsx +57 -11
- package/src/CalendarPicker.tsx +73 -0
- package/src/Checkbox.tsx +539 -3
- package/src/Collection.tsx +9 -3
- package/src/Color.tsx +84 -41
- package/src/ComboBox.tsx +97 -21
- package/src/DateField.tsx +304 -53
- package/src/DatePicker.tsx +402 -62
- package/src/DateRangePickerContext.tsx +2 -0
- package/src/Dialog.tsx +13 -5
- package/src/Disclosure.tsx +7 -1
- package/src/DragAndDrop.tsx +3 -1
- package/src/DropZone.tsx +3 -1
- package/src/GridList.tsx +133 -26
- package/src/Icon.tsx +3 -1
- package/src/Link.tsx +3 -1
- package/src/ListBox.tsx +354 -25
- package/src/Menu.tsx +252 -128
- package/src/Meter.tsx +3 -1
- package/src/Modal.tsx +120 -56
- package/src/NumberField.tsx +51 -8
- package/src/Popover.tsx +68 -17
- package/src/ProgressBar.tsx +3 -1
- package/src/RadioGroup.tsx +468 -4
- package/src/RangeCalendar.tsx +123 -2
- package/src/SearchField.tsx +80 -4
- package/src/Select.tsx +122 -26
- package/src/SelectionIndicator.tsx +3 -1
- package/src/SharedElementTransition.tsx +95 -37
- package/src/Slider.tsx +159 -13
- package/src/StepList.tsx +0 -7
- package/src/Switch.tsx +395 -2
- package/src/Table.tsx +428 -99
- package/src/Tabs.tsx +17 -45
- package/src/TagGroup.tsx +29 -7
- package/src/Text.tsx +31 -10
- package/src/TextField.tsx +44 -6
- package/src/TimeField.tsx +127 -192
- package/src/Toast.tsx +79 -14
- package/src/ToggleButton.tsx +3 -1
- package/src/ToggleButtonGroup.tsx +3 -1
- package/src/Tooltip.tsx +3 -1
- package/src/Tree.tsx +91 -13
- package/src/Virtualizer.tsx +180 -31
- package/src/VirtualizerLayouts.ts +45 -10
- package/src/index.ts +51 -8
- package/src/useDragAndDrop.ts +8 -10
- package/src/utils.tsx +246 -30
- package/dist/HiddenTimeInput.d.ts +0 -25
- package/dist/HiddenTimeInput.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.jsx.map +0 -1
- package/src/HiddenTimeInput.tsx +0 -133
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { Provider, dataAttr, useIsHydrated, useRenderProps } from "./utils.js";
|
|
2
|
+
import { TextContext } from "./Text.js";
|
|
3
|
+
import { FormContext } from "./Form.js";
|
|
4
|
+
import { n as DateFieldContext, o as DateFieldStateContext } from "./DateField2.js";
|
|
5
|
+
import { className, createComponent, effect, getNextElement, insert, mergeProps, runHydrationEvents, setAttribute, spread, style, template, use } from "solid-js/web";
|
|
6
|
+
import { Show, createContext, createMemo, createSignal, splitProps, useContext } from "solid-js";
|
|
7
|
+
import { createTimeField, mergeProps as mergeProps$2 } from "@proyecto-viviana/solidaria";
|
|
8
|
+
import { access, createTimeFieldState } from "@proyecto-viviana/solid-stately";
|
|
9
|
+
//#region src/TimeField.tsx
|
|
10
|
+
/**
|
|
11
|
+
* TimeField component for solidaria-components
|
|
12
|
+
*
|
|
13
|
+
* Pre-wired headless time field. Faithful port of react-aria-components'
|
|
14
|
+
* TimeField, which does NOT define its own segment primitives — it reuses
|
|
15
|
+
* `DateInput`/`DateSegment` (there is no `TimeInput`/`TimeSegment` upstream).
|
|
16
|
+
* `TimeFieldState` IS a `DateFieldState` (plus `timeValue`), so this component
|
|
17
|
+
* drives the certified DateField segment/group stack directly: it provides the
|
|
18
|
+
* shared `DateFieldContext`/`DateFieldStateContext` that `DateInput`/`DateSegment`
|
|
19
|
+
* read, plus a `TimeFieldContext` for the time-field label/description/error
|
|
20
|
+
* chrome. Unlike DateField, TimeField renders NO root hidden autofill input (RAC
|
|
21
|
+
* TimeField renders none); its native-validation `<input>` is still emitted by
|
|
22
|
+
* the inner DateInput sibling.
|
|
23
|
+
*/
|
|
24
|
+
var _tmpl$ = /*#__PURE__*/ template(`<div class="solidaria-TimeField solidaria-TimeField--placeholder"aria-hidden=true>`), _tmpl$2 = /*#__PURE__*/ template(`<div>`), _tmpl$3 = /*#__PURE__*/ template(`<span>`);
|
|
25
|
+
const TimeFieldContext = createContext(null);
|
|
26
|
+
const TimeFieldStateContext = createContext(null);
|
|
27
|
+
function withFormValidationBehavior(props, formContext) {
|
|
28
|
+
if (!formContext?.validationBehavior) return props;
|
|
29
|
+
return new Proxy(props, {
|
|
30
|
+
get(target, property, receiver) {
|
|
31
|
+
const localValue = Reflect.get(target, property, receiver);
|
|
32
|
+
if (property === "validationBehavior" && localValue === void 0) return formContext.validationBehavior;
|
|
33
|
+
return localValue;
|
|
34
|
+
},
|
|
35
|
+
has(target, property) {
|
|
36
|
+
return Reflect.has(target, property) || property === "validationBehavior" && formContext.validationBehavior !== void 0;
|
|
37
|
+
},
|
|
38
|
+
ownKeys(target) {
|
|
39
|
+
const keys = new Set(Reflect.ownKeys(target));
|
|
40
|
+
if (formContext.validationBehavior !== void 0) keys.add("validationBehavior");
|
|
41
|
+
return Array.from(keys);
|
|
42
|
+
},
|
|
43
|
+
getOwnPropertyDescriptor(target, property) {
|
|
44
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(target, property);
|
|
45
|
+
if (descriptor) return descriptor;
|
|
46
|
+
if (property === "validationBehavior" && formContext.validationBehavior !== void 0) return {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
configurable: true,
|
|
49
|
+
get: () => formContext.validationBehavior
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function useTimeFieldContextValue() {
|
|
55
|
+
const context = useContext(TimeFieldContext);
|
|
56
|
+
if (!context) throw new Error("TimeField components must be used within a TimeField");
|
|
57
|
+
return context;
|
|
58
|
+
}
|
|
59
|
+
function useTimeFieldContext() {
|
|
60
|
+
return useTimeFieldContextValue().state;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* A time field allows users to enter and edit time values using a keyboard.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```tsx
|
|
67
|
+
* <TimeField label="Time">
|
|
68
|
+
* <Label>Time</Label>
|
|
69
|
+
* <DateInput>
|
|
70
|
+
* {(segment) => <DateSegment segment={segment} />}
|
|
71
|
+
* </DateInput>
|
|
72
|
+
* </TimeField>
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
function TimeField(props) {
|
|
76
|
+
const isHydrated = useIsHydrated();
|
|
77
|
+
const formContext = useContext(FormContext);
|
|
78
|
+
return createComponent(Show, {
|
|
79
|
+
get when() {
|
|
80
|
+
return isHydrated();
|
|
81
|
+
},
|
|
82
|
+
get fallback() {
|
|
83
|
+
return getNextElement(_tmpl$);
|
|
84
|
+
},
|
|
85
|
+
get children() {
|
|
86
|
+
return createComponent(TimeFieldInner, mergeProps(props, { __formContext: formContext }));
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Internal TimeField component that renders after client mount.
|
|
92
|
+
*/
|
|
93
|
+
function TimeFieldInner(props) {
|
|
94
|
+
const [local, stateProps, rest] = splitProps(withFormValidationBehavior(props, props.__formContext ?? useContext(FormContext)), [
|
|
95
|
+
"children",
|
|
96
|
+
"class",
|
|
97
|
+
"style",
|
|
98
|
+
"slot",
|
|
99
|
+
"__formContext"
|
|
100
|
+
], [
|
|
101
|
+
"value",
|
|
102
|
+
"defaultValue",
|
|
103
|
+
"onChange",
|
|
104
|
+
"minValue",
|
|
105
|
+
"maxValue",
|
|
106
|
+
"isInvalid",
|
|
107
|
+
"isDisabled",
|
|
108
|
+
"isReadOnly",
|
|
109
|
+
"isRequired",
|
|
110
|
+
"locale",
|
|
111
|
+
"granularity",
|
|
112
|
+
"hourCycle",
|
|
113
|
+
"hideTimeZone",
|
|
114
|
+
"shouldForceLeadingZeros",
|
|
115
|
+
"validationState",
|
|
116
|
+
"validationBehavior",
|
|
117
|
+
"validate",
|
|
118
|
+
"description",
|
|
119
|
+
"errorMessage",
|
|
120
|
+
"placeholderValue"
|
|
121
|
+
]);
|
|
122
|
+
const [fieldRef, setFieldRef] = createSignal(null);
|
|
123
|
+
const [validationInputRef, setValidationInputRef] = createSignal(null);
|
|
124
|
+
const state = createTimeFieldState(stateProps);
|
|
125
|
+
const fieldAria = createTimeField(() => ({
|
|
126
|
+
...rest,
|
|
127
|
+
isDisabled: access(stateProps.isDisabled),
|
|
128
|
+
isReadOnly: access(stateProps.isReadOnly),
|
|
129
|
+
isRequired: access(stateProps.isRequired),
|
|
130
|
+
validationBehavior: stateProps.validationBehavior ?? "native",
|
|
131
|
+
description: stateProps.description,
|
|
132
|
+
errorMessage: stateProps.errorMessage,
|
|
133
|
+
inputRef: () => validationInputRef() ?? void 0
|
|
134
|
+
}), state, fieldRef);
|
|
135
|
+
const renderValues = createMemo(() => ({
|
|
136
|
+
isDisabled: state.isDisabled(),
|
|
137
|
+
isReadOnly: state.isReadOnly(),
|
|
138
|
+
isRequired: state.isRequired(),
|
|
139
|
+
isInvalid: state.isInvalid()
|
|
140
|
+
}));
|
|
141
|
+
const renderProps = useRenderProps({
|
|
142
|
+
class: local.class,
|
|
143
|
+
style: local.style,
|
|
144
|
+
defaultClassName: "solidaria-TimeField"
|
|
145
|
+
}, renderValues);
|
|
146
|
+
const textSlots = { slots: {
|
|
147
|
+
get description() {
|
|
148
|
+
return fieldAria.descriptionProps;
|
|
149
|
+
},
|
|
150
|
+
get errorMessage() {
|
|
151
|
+
return fieldAria.errorMessageProps;
|
|
152
|
+
}
|
|
153
|
+
} };
|
|
154
|
+
const dateFieldContextValue = {
|
|
155
|
+
get state() {
|
|
156
|
+
return state;
|
|
157
|
+
},
|
|
158
|
+
aria: {
|
|
159
|
+
get labelProps() {
|
|
160
|
+
return fieldAria.labelProps;
|
|
161
|
+
},
|
|
162
|
+
get inputProps() {
|
|
163
|
+
return fieldAria.fieldProps;
|
|
164
|
+
},
|
|
165
|
+
get hiddenInputProps() {
|
|
166
|
+
return mergeProps$2(fieldAria.inputProps, { ref: setValidationInputRef });
|
|
167
|
+
},
|
|
168
|
+
get descriptionProps() {
|
|
169
|
+
return fieldAria.descriptionProps;
|
|
170
|
+
},
|
|
171
|
+
get errorMessageProps() {
|
|
172
|
+
return fieldAria.errorMessageProps;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
return createComponent(TimeFieldStateContext.Provider, {
|
|
177
|
+
value: state,
|
|
178
|
+
get children() {
|
|
179
|
+
return createComponent(DateFieldStateContext.Provider, {
|
|
180
|
+
value: state,
|
|
181
|
+
get children() {
|
|
182
|
+
return createComponent(DateFieldContext.Provider, {
|
|
183
|
+
value: dateFieldContextValue,
|
|
184
|
+
get children() {
|
|
185
|
+
return createComponent(TimeFieldContext.Provider, {
|
|
186
|
+
value: {
|
|
187
|
+
state,
|
|
188
|
+
aria: {
|
|
189
|
+
get labelProps() {
|
|
190
|
+
return fieldAria.labelProps;
|
|
191
|
+
},
|
|
192
|
+
get inputProps() {
|
|
193
|
+
return fieldAria.fieldProps;
|
|
194
|
+
},
|
|
195
|
+
get descriptionProps() {
|
|
196
|
+
return fieldAria.descriptionProps;
|
|
197
|
+
},
|
|
198
|
+
get errorMessageProps() {
|
|
199
|
+
return fieldAria.errorMessageProps;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
get children() {
|
|
204
|
+
var _el$2 = getNextElement(_tmpl$2);
|
|
205
|
+
use(setFieldRef, _el$2);
|
|
206
|
+
insert(_el$2, createComponent(Provider, {
|
|
207
|
+
values: [[TextContext, textSlots]],
|
|
208
|
+
get children() {
|
|
209
|
+
return local.children;
|
|
210
|
+
}
|
|
211
|
+
}));
|
|
212
|
+
effect((_p$) => {
|
|
213
|
+
var _v$ = renderProps.class(), _v$2 = renderProps.style(), _v$3 = dataAttr(state.isDisabled()), _v$4 = dataAttr(state.isReadOnly()), _v$5 = dataAttr(state.isRequired()), _v$6 = dataAttr(state.isInvalid());
|
|
214
|
+
_v$ !== _p$.e && className(_el$2, _p$.e = _v$);
|
|
215
|
+
_p$.t = style(_el$2, _v$2, _p$.t);
|
|
216
|
+
_v$3 !== _p$.a && setAttribute(_el$2, "data-disabled", _p$.a = _v$3);
|
|
217
|
+
_v$4 !== _p$.o && setAttribute(_el$2, "data-readonly", _p$.o = _v$4);
|
|
218
|
+
_v$5 !== _p$.i && setAttribute(_el$2, "data-required", _p$.i = _v$5);
|
|
219
|
+
_v$6 !== _p$.n && setAttribute(_el$2, "data-invalid", _p$.n = _v$6);
|
|
220
|
+
return _p$;
|
|
221
|
+
}, {
|
|
222
|
+
e: void 0,
|
|
223
|
+
t: void 0,
|
|
224
|
+
a: void 0,
|
|
225
|
+
o: void 0,
|
|
226
|
+
i: void 0,
|
|
227
|
+
n: void 0
|
|
228
|
+
});
|
|
229
|
+
return _el$2;
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
function TimeFieldLabel(props) {
|
|
240
|
+
const { aria } = useTimeFieldContextValue();
|
|
241
|
+
return (() => {
|
|
242
|
+
var _el$3 = getNextElement(_tmpl$3);
|
|
243
|
+
spread(_el$3, mergeProps(() => aria.labelProps, { get ["class"]() {
|
|
244
|
+
return props.class;
|
|
245
|
+
} }), false, true);
|
|
246
|
+
insert(_el$3, () => props.children);
|
|
247
|
+
runHydrationEvents();
|
|
248
|
+
return _el$3;
|
|
249
|
+
})();
|
|
250
|
+
}
|
|
251
|
+
function TimeFieldDescription(props) {
|
|
252
|
+
const { aria } = useTimeFieldContextValue();
|
|
253
|
+
return (() => {
|
|
254
|
+
var _el$4 = getNextElement(_tmpl$3);
|
|
255
|
+
spread(_el$4, mergeProps(() => aria.descriptionProps, { get ["class"]() {
|
|
256
|
+
return props.class;
|
|
257
|
+
} }), false, true);
|
|
258
|
+
insert(_el$4, () => props.children);
|
|
259
|
+
runHydrationEvents();
|
|
260
|
+
return _el$4;
|
|
261
|
+
})();
|
|
262
|
+
}
|
|
263
|
+
function TimeFieldErrorMessage(props) {
|
|
264
|
+
const { aria } = useTimeFieldContextValue();
|
|
265
|
+
return (() => {
|
|
266
|
+
var _el$5 = getNextElement(_tmpl$3);
|
|
267
|
+
spread(_el$5, mergeProps(() => aria.errorMessageProps, { get ["class"]() {
|
|
268
|
+
return props.class;
|
|
269
|
+
} }), false, true);
|
|
270
|
+
insert(_el$5, () => props.children);
|
|
271
|
+
runHydrationEvents();
|
|
272
|
+
return _el$5;
|
|
273
|
+
})();
|
|
274
|
+
}
|
|
275
|
+
//#endregion
|
|
276
|
+
export { TimeField, TimeFieldContext, TimeFieldDescription, TimeFieldErrorMessage, TimeFieldLabel, TimeFieldStateContext, useTimeFieldContext };
|
|
277
|
+
|
|
278
|
+
//# sourceMappingURL=TimeField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeField.js","names":["JSX","Context","createContext","createMemo","createSignal","splitProps","useContext","Show","createTimeField","mergeProps","AriaTimeFieldProps","createTimeFieldState","access","TimeFieldState","TimeFieldStateProps","TimeSegment","TimeSegmentType","TimeValue","DateFieldContext","DateFieldStateContext","DateFieldContextValue","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","dataAttr","useIsHydrated","Provider","TextContext","FormContext","FormProps","TimeFieldRenderProps","isDisabled","isReadOnly","isRequired","isInvalid","TimeFieldProps","Omit","T","children","Element","segment","class","style","locale","TimeFieldContextValue","state","aria","labelProps","Record","inputProps","descriptionProps","errorMessageProps","TimeFieldContext","TimeFieldStateContext","withFormValidationBehavior","props","P","formContext","validationBehavior","Proxy","get","target","property","receiver","localValue","Reflect","undefined","has","ownKeys","keys","Set","add","Array","from","getOwnPropertyDescriptor","descriptor","enumerable","configurable","useTimeFieldContextValue","context","Error","useTimeFieldContext","TimeField","isHydrated","_$createComponent","when","fallback","_$getNextElement","_tmpl$","TimeFieldInner","_$mergeProps","__formContext","TimeFieldInnerProps","mergedProps","local","stateProps","rest","fieldRef","setFieldRef","HTMLDivElement","validationInputRef","setValidationInputRef","HTMLInputElement","fieldAria","description","errorMessage","inputRef","renderValues","renderProps","defaultClassName","textSlots","slots","dateFieldContextValue","fieldProps","hiddenInputProps","ref","value","_el$2","_tmpl$2","_$use","_$insert","values","_$effect","_p$","_v$","_v$2","_v$3","_v$4","_v$5","_v$6","e","_$className","t","_$style","a","_$setAttribute","o","i","n","TimeFieldLabelProps","TimeFieldLabel","_el$3","_tmpl$3","_$spread","_$runHydrationEvents","TimeFieldDescriptionProps","TimeFieldDescription","_el$4","TimeFieldErrorMessageProps","TimeFieldErrorMessage","_el$5"],"sources":["../src/TimeField.tsx"],"sourcesContent":["/**\n * TimeField component for solidaria-components\n *\n * Pre-wired headless time field. Faithful port of react-aria-components'\n * TimeField, which does NOT define its own segment primitives — it reuses\n * `DateInput`/`DateSegment` (there is no `TimeInput`/`TimeSegment` upstream).\n * `TimeFieldState` IS a `DateFieldState` (plus `timeValue`), so this component\n * drives the certified DateField segment/group stack directly: it provides the\n * shared `DateFieldContext`/`DateFieldStateContext` that `DateInput`/`DateSegment`\n * read, plus a `TimeFieldContext` for the time-field label/description/error\n * chrome. Unlike DateField, TimeField renders NO root hidden autofill input (RAC\n * TimeField renders none); its native-validation `<input>` is still emitted by\n * the inner DateInput sibling.\n */\n\nimport {\n type JSX,\n type Context,\n createContext,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n Show,\n} from \"solid-js\";\nimport { createTimeField, mergeProps, type AriaTimeFieldProps } from \"@proyecto-viviana/solidaria\";\nimport {\n createTimeFieldState,\n access,\n type TimeFieldState,\n type TimeFieldStateProps,\n type TimeSegment as TimeSegmentType,\n type TimeValue,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n DateFieldContext,\n DateFieldStateContext,\n type DateFieldContextValue,\n} from \"./DateField\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n useIsHydrated,\n Provider,\n} from \"./utils\";\nimport { TextContext } from \"./Text\";\nimport { FormContext, type FormProps } from \"./Form\";\n\nexport interface TimeFieldRenderProps {\n /** Whether the field is disabled. */\n isDisabled: boolean;\n /** Whether the field is read-only. */\n isReadOnly: boolean;\n /** Whether the field is required. */\n isRequired: boolean;\n /** Whether the field is invalid. */\n isInvalid: boolean;\n}\n\nexport interface TimeFieldProps<T extends TimeValue = TimeValue>\n extends\n Omit<AriaTimeFieldProps, \"id\" | \"isDisabled\" | \"isReadOnly\" | \"isRequired\">,\n Omit<TimeFieldStateProps<T>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element | ((segment: TimeSegmentType) => JSX.Element);\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TimeFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TimeFieldRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n}\n\nexport interface TimeFieldContextValue {\n state: TimeFieldState<TimeValue>;\n aria: {\n labelProps: Record<string, unknown>;\n inputProps: Record<string, unknown>;\n descriptionProps: Record<string, unknown>;\n errorMessageProps: Record<string, unknown>;\n };\n}\n\nexport const TimeFieldContext = createContext<TimeFieldContextValue | null>(null);\nexport const TimeFieldStateContext = createContext<TimeFieldState<TimeValue> | null>(null);\n\nfunction withFormValidationBehavior<P extends object>(props: P, formContext: FormProps | null): P {\n if (!formContext?.validationBehavior) {\n return props;\n }\n\n return new Proxy(props, {\n get(target, property, receiver) {\n const localValue = Reflect.get(target, property, receiver);\n if (property === \"validationBehavior\" && localValue === undefined) {\n return formContext.validationBehavior;\n }\n\n return localValue;\n },\n has(target, property) {\n return (\n Reflect.has(target, property) ||\n (property === \"validationBehavior\" && formContext.validationBehavior !== undefined)\n );\n },\n ownKeys(target) {\n const keys = new Set(Reflect.ownKeys(target));\n if (formContext.validationBehavior !== undefined) {\n keys.add(\"validationBehavior\");\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (property === \"validationBehavior\" && formContext.validationBehavior !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => formContext.validationBehavior,\n };\n }\n\n return undefined;\n },\n });\n}\n\nfunction useTimeFieldContextValue(): TimeFieldContextValue {\n const context = useContext(TimeFieldContext);\n if (!context) {\n throw new Error(\"TimeField components must be used within a TimeField\");\n }\n return context;\n}\n\nexport function useTimeFieldContext(): TimeFieldState<TimeValue> {\n return useTimeFieldContextValue().state;\n}\n\n/**\n * A time field allows users to enter and edit time values using a keyboard.\n *\n * @example\n * ```tsx\n * <TimeField label=\"Time\">\n * <Label>Time</Label>\n * <DateInput>\n * {(segment) => <DateSegment segment={segment} />}\n * </DateInput>\n * </TimeField>\n * ```\n */\nexport function TimeField<T extends TimeValue = TimeValue>(props: TimeFieldProps<T>): JSX.Element {\n // Use hydration-safe pattern for client-only rendering\n const isHydrated = useIsHydrated();\n const formContext = useContext(FormContext);\n\n return (\n <Show\n when={isHydrated()}\n fallback={\n <div class=\"solidaria-TimeField solidaria-TimeField--placeholder\" aria-hidden=\"true\" />\n }\n >\n <TimeFieldInner {...props} __formContext={formContext} />\n </Show>\n );\n}\n\ntype TimeFieldInnerProps<T extends TimeValue = TimeValue> = TimeFieldProps<T> & {\n __formContext?: FormProps | null;\n};\n\n/**\n * Internal TimeField component that renders after client mount.\n */\nfunction TimeFieldInner<T extends TimeValue = TimeValue>(\n props: TimeFieldInnerProps<T>,\n): JSX.Element {\n const formContext = props.__formContext ?? useContext(FormContext);\n const mergedProps = withFormValidationBehavior(props, formContext);\n const [local, stateProps, rest] = splitProps(\n mergedProps,\n [\"children\", \"class\", \"style\", \"slot\", \"__formContext\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isInvalid\",\n \"isDisabled\",\n \"isReadOnly\",\n \"isRequired\",\n \"locale\",\n \"granularity\",\n \"hourCycle\",\n \"hideTimeZone\",\n \"shouldForceLeadingZeros\",\n \"validationState\",\n \"validationBehavior\",\n \"validate\",\n \"description\",\n \"errorMessage\",\n \"placeholderValue\",\n ],\n );\n\n const [fieldRef, setFieldRef] = createSignal<HTMLDivElement | null>(null);\n // Ref to the hidden validation <input> (the DateInput's `<Input>` sibling).\n // Mirrors DateField: create it here, hand it to createTimeField below, and\n // attach it to the same input through the DateFieldContext getter.\n const [validationInputRef, setValidationInputRef] =\n createSignal<HTMLInputElement | null>(null);\n\n const state = createTimeFieldState(stateProps);\n\n const fieldAria = createTimeField(\n () => ({\n ...(rest as Record<string, unknown>),\n // RAC threads these props into both useTimeFieldState and useTimeField;\n // they live in `stateProps` here, so forward them for the field hook's\n // aria-disabled and the native validation <input> (type/required).\n isDisabled: access(stateProps.isDisabled),\n isReadOnly: access(stateProps.isReadOnly),\n isRequired: access(stateProps.isRequired),\n // Standalone default flips the hidden input to type=\"text\" so an empty\n // required value blocks HTML form submission (mirrors DateField).\n validationBehavior: stateProps.validationBehavior ?? \"native\",\n description: stateProps.description,\n errorMessage: stateProps.errorMessage,\n inputRef: () => validationInputRef() ?? undefined,\n }),\n state as unknown as TimeFieldState<TimeValue>,\n fieldRef,\n );\n\n const renderValues = createMemo<TimeFieldRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isRequired: state.isRequired(),\n isInvalid: state.isInvalid(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-TimeField\",\n },\n renderValues,\n );\n\n const textSlots = {\n slots: {\n get description() {\n return fieldAria.descriptionProps;\n },\n get errorMessage() {\n return fieldAria.errorMessageProps;\n },\n },\n };\n\n // The shared context read by the reused DateInput/DateSegment. Read through\n // getters so consumers see the LIVE memo values (createDescription appends the\n // value-description id via a deferred effect; a frozen snapshot would miss it).\n const dateFieldContextValue: DateFieldContextValue = {\n get state() {\n return state as unknown as DateFieldContextValue[\"state\"];\n },\n aria: {\n get labelProps() {\n return fieldAria.labelProps;\n },\n // The segment group props (role=\"group\", aria-labelledby, unicode-bidi\n // isolate, arrow-key nav, focus-within handlers) are routed to the\n // DateInput element; the outer wrapper stays roleless.\n get inputProps() {\n return fieldAria.fieldProps;\n },\n // The native validation <input> props (type/hidden/required/onChange under\n // native validation), rendered as the DateInput's sibling. Thread the\n // validation-input ref so createTimeField's form-reset/validation wiring\n // resolves to the mounted element.\n get hiddenInputProps() {\n return mergeProps(fieldAria.inputProps, { ref: setValidationInputRef });\n },\n get descriptionProps() {\n return fieldAria.descriptionProps;\n },\n get errorMessageProps() {\n return fieldAria.errorMessageProps;\n },\n },\n };\n\n return (\n <TimeFieldStateContext.Provider value={state as unknown as TimeFieldState<TimeValue>}>\n <DateFieldStateContext.Provider\n value={state as unknown as DateFieldContextValue[\"state\"]}\n >\n <DateFieldContext.Provider value={dateFieldContextValue}>\n <TimeFieldContext.Provider\n value={{\n state: state as unknown as TimeFieldState<TimeValue>,\n aria: {\n get labelProps() {\n return fieldAria.labelProps;\n },\n get inputProps() {\n return fieldAria.fieldProps;\n },\n get descriptionProps() {\n return fieldAria.descriptionProps;\n },\n get errorMessageProps() {\n return fieldAria.errorMessageProps;\n },\n },\n }}\n >\n <div\n ref={setFieldRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-required={dataAttr(state.isRequired())}\n data-invalid={dataAttr(state.isInvalid())}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n {local.children as JSX.Element}\n </Provider>\n </div>\n {/*\n Unlike DateField, TimeField renders NO root hidden autofill input —\n RAC TimeField renders none (react-aria-components TimeField.mjs). The\n native-validation <input> is emitted by the inner DateInput sibling.\n */}\n </TimeFieldContext.Provider>\n </DateFieldContext.Provider>\n </DateFieldStateContext.Provider>\n </TimeFieldStateContext.Provider>\n );\n}\n\nexport interface TimeFieldLabelProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function TimeFieldLabel(props: TimeFieldLabelProps): JSX.Element {\n const { aria } = useTimeFieldContextValue();\n return (\n <span {...aria.labelProps} class={props.class}>\n {props.children}\n </span>\n );\n}\n\nexport interface TimeFieldDescriptionProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function TimeFieldDescription(props: TimeFieldDescriptionProps): JSX.Element {\n const { aria } = useTimeFieldContextValue();\n return (\n <span {...aria.descriptionProps} class={props.class}>\n {props.children}\n </span>\n );\n}\n\nexport interface TimeFieldErrorMessageProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function TimeFieldErrorMessage(props: TimeFieldErrorMessageProps): JSX.Element {\n const { aria } = useTimeFieldContextValue();\n return (\n <span {...aria.errorMessageProps} class={props.class}>\n {props.children}\n </span>\n );\n}\n\nexport type { TimeFieldState, TimeSegmentType, TimeValue };\n"],"mappings":";;;;;;;;;;;;;;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d;EAAK,EAAA,CAAA,GAAA,OAAA,IAAA;EAAA+E,OAAAqB,aAC1CtF,MAAMjB,QAAQ;EAAA0G,mBAAA;EAAA,OAAAH;CAAA,EAAA,CAAA;AAGrB;AAOA,SAAgBK,qBAAqB3F,OAA+C;CAClF,MAAM,EAAET,SAASgC,yBAAyB;CAC1C,cAAA;EAAA,IAAAqE,QAAA5D,eAAAuD,OAAA;EAAAC,OAAAI,OAAAzD,iBACY5C,KAAKI,kBAAgB,EAAA,KAAA,WAAA;GAAA,OAASK,MAAMd;EAAK,EAAA,CAAA,GAAA,OAAA,IAAA;EAAA+E,OAAA2B,aAChD5F,MAAMjB,QAAQ;EAAA0G,mBAAA;EAAA,OAAAG;CAAA,EAAA,CAAA;AAGrB;AAOA,SAAgBE,sBAAsB9F,OAAgD;CACpF,MAAM,EAAET,SAASgC,yBAAyB;CAC1C,cAAA;EAAA,IAAAwE,QAAA/D,eAAAuD,OAAA;EAAAC,OAAAO,OAAA5D,iBACY5C,KAAKK,mBAAiB,EAAA,KAAA,WAAA;GAAA,OAASI,MAAMd;EAAK,EAAA,CAAA,GAAA,OAAA,IAAA;EAAA+E,OAAA8B,aACjD/F,MAAMjB,QAAQ;EAAA0G,mBAAA;EAAA,OAAAM;CAAA,EAAA,CAAA;AAGrB"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { Provider, dataAttr, useIsHydrated, useRenderProps } from "./utils.jsx";
|
|
2
|
+
import { TextContext } from "./Text.jsx";
|
|
3
|
+
import { FormContext } from "./Form.jsx";
|
|
4
|
+
import { n as DateFieldContext, o as DateFieldStateContext } from "./DateField2.jsx";
|
|
5
|
+
import { Show, createContext, createMemo, createSignal, splitProps, useContext } from "solid-js";
|
|
6
|
+
import { createTimeField, mergeProps as mergeProps$1 } from "@proyecto-viviana/solidaria";
|
|
7
|
+
import { access, createTimeFieldState } from "@proyecto-viviana/solid-stately";
|
|
8
|
+
//#region src/TimeField.tsx
|
|
9
|
+
/**
|
|
10
|
+
* TimeField component for solidaria-components
|
|
11
|
+
*
|
|
12
|
+
* Pre-wired headless time field. Faithful port of react-aria-components'
|
|
13
|
+
* TimeField, which does NOT define its own segment primitives — it reuses
|
|
14
|
+
* `DateInput`/`DateSegment` (there is no `TimeInput`/`TimeSegment` upstream).
|
|
15
|
+
* `TimeFieldState` IS a `DateFieldState` (plus `timeValue`), so this component
|
|
16
|
+
* drives the certified DateField segment/group stack directly: it provides the
|
|
17
|
+
* shared `DateFieldContext`/`DateFieldStateContext` that `DateInput`/`DateSegment`
|
|
18
|
+
* read, plus a `TimeFieldContext` for the time-field label/description/error
|
|
19
|
+
* chrome. Unlike DateField, TimeField renders NO root hidden autofill input (RAC
|
|
20
|
+
* TimeField renders none); its native-validation `<input>` is still emitted by
|
|
21
|
+
* the inner DateInput sibling.
|
|
22
|
+
*/
|
|
23
|
+
const TimeFieldContext = createContext(null);
|
|
24
|
+
const TimeFieldStateContext = createContext(null);
|
|
25
|
+
function withFormValidationBehavior(props, formContext) {
|
|
26
|
+
if (!formContext?.validationBehavior) return props;
|
|
27
|
+
return new Proxy(props, {
|
|
28
|
+
get(target, property, receiver) {
|
|
29
|
+
const localValue = Reflect.get(target, property, receiver);
|
|
30
|
+
if (property === "validationBehavior" && localValue === void 0) return formContext.validationBehavior;
|
|
31
|
+
return localValue;
|
|
32
|
+
},
|
|
33
|
+
has(target, property) {
|
|
34
|
+
return Reflect.has(target, property) || property === "validationBehavior" && formContext.validationBehavior !== void 0;
|
|
35
|
+
},
|
|
36
|
+
ownKeys(target) {
|
|
37
|
+
const keys = new Set(Reflect.ownKeys(target));
|
|
38
|
+
if (formContext.validationBehavior !== void 0) keys.add("validationBehavior");
|
|
39
|
+
return Array.from(keys);
|
|
40
|
+
},
|
|
41
|
+
getOwnPropertyDescriptor(target, property) {
|
|
42
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(target, property);
|
|
43
|
+
if (descriptor) return descriptor;
|
|
44
|
+
if (property === "validationBehavior" && formContext.validationBehavior !== void 0) return {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
configurable: true,
|
|
47
|
+
get: () => formContext.validationBehavior
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function useTimeFieldContextValue() {
|
|
53
|
+
const context = useContext(TimeFieldContext);
|
|
54
|
+
if (!context) throw new Error("TimeField components must be used within a TimeField");
|
|
55
|
+
return context;
|
|
56
|
+
}
|
|
57
|
+
function useTimeFieldContext() {
|
|
58
|
+
return useTimeFieldContextValue().state;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A time field allows users to enter and edit time values using a keyboard.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* <TimeField label="Time">
|
|
66
|
+
* <Label>Time</Label>
|
|
67
|
+
* <DateInput>
|
|
68
|
+
* {(segment) => <DateSegment segment={segment} />}
|
|
69
|
+
* </DateInput>
|
|
70
|
+
* </TimeField>
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
function TimeField(props) {
|
|
74
|
+
const isHydrated = useIsHydrated();
|
|
75
|
+
const formContext = useContext(FormContext);
|
|
76
|
+
return <Show when={isHydrated()} fallback={<div class="solidaria-TimeField solidaria-TimeField--placeholder" aria-hidden="true" />}>
|
|
77
|
+
<TimeFieldInner {...props} __formContext={formContext} />
|
|
78
|
+
</Show>;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Internal TimeField component that renders after client mount.
|
|
82
|
+
*/
|
|
83
|
+
function TimeFieldInner(props) {
|
|
84
|
+
const [local, stateProps, rest] = splitProps(withFormValidationBehavior(props, props.__formContext ?? useContext(FormContext)), [
|
|
85
|
+
"children",
|
|
86
|
+
"class",
|
|
87
|
+
"style",
|
|
88
|
+
"slot",
|
|
89
|
+
"__formContext"
|
|
90
|
+
], [
|
|
91
|
+
"value",
|
|
92
|
+
"defaultValue",
|
|
93
|
+
"onChange",
|
|
94
|
+
"minValue",
|
|
95
|
+
"maxValue",
|
|
96
|
+
"isInvalid",
|
|
97
|
+
"isDisabled",
|
|
98
|
+
"isReadOnly",
|
|
99
|
+
"isRequired",
|
|
100
|
+
"locale",
|
|
101
|
+
"granularity",
|
|
102
|
+
"hourCycle",
|
|
103
|
+
"hideTimeZone",
|
|
104
|
+
"shouldForceLeadingZeros",
|
|
105
|
+
"validationState",
|
|
106
|
+
"validationBehavior",
|
|
107
|
+
"validate",
|
|
108
|
+
"description",
|
|
109
|
+
"errorMessage",
|
|
110
|
+
"placeholderValue"
|
|
111
|
+
]);
|
|
112
|
+
const [fieldRef, setFieldRef] = createSignal(null);
|
|
113
|
+
const [validationInputRef, setValidationInputRef] = createSignal(null);
|
|
114
|
+
const state = createTimeFieldState(stateProps);
|
|
115
|
+
const fieldAria = createTimeField(() => ({
|
|
116
|
+
...rest,
|
|
117
|
+
isDisabled: access(stateProps.isDisabled),
|
|
118
|
+
isReadOnly: access(stateProps.isReadOnly),
|
|
119
|
+
isRequired: access(stateProps.isRequired),
|
|
120
|
+
validationBehavior: stateProps.validationBehavior ?? "native",
|
|
121
|
+
description: stateProps.description,
|
|
122
|
+
errorMessage: stateProps.errorMessage,
|
|
123
|
+
inputRef: () => validationInputRef() ?? void 0
|
|
124
|
+
}), state, fieldRef);
|
|
125
|
+
const renderValues = createMemo(() => ({
|
|
126
|
+
isDisabled: state.isDisabled(),
|
|
127
|
+
isReadOnly: state.isReadOnly(),
|
|
128
|
+
isRequired: state.isRequired(),
|
|
129
|
+
isInvalid: state.isInvalid()
|
|
130
|
+
}));
|
|
131
|
+
const renderProps = useRenderProps({
|
|
132
|
+
class: local.class,
|
|
133
|
+
style: local.style,
|
|
134
|
+
defaultClassName: "solidaria-TimeField"
|
|
135
|
+
}, renderValues);
|
|
136
|
+
const textSlots = { slots: {
|
|
137
|
+
get description() {
|
|
138
|
+
return fieldAria.descriptionProps;
|
|
139
|
+
},
|
|
140
|
+
get errorMessage() {
|
|
141
|
+
return fieldAria.errorMessageProps;
|
|
142
|
+
}
|
|
143
|
+
} };
|
|
144
|
+
const dateFieldContextValue = {
|
|
145
|
+
get state() {
|
|
146
|
+
return state;
|
|
147
|
+
},
|
|
148
|
+
aria: {
|
|
149
|
+
get labelProps() {
|
|
150
|
+
return fieldAria.labelProps;
|
|
151
|
+
},
|
|
152
|
+
get inputProps() {
|
|
153
|
+
return fieldAria.fieldProps;
|
|
154
|
+
},
|
|
155
|
+
get hiddenInputProps() {
|
|
156
|
+
return mergeProps$1(fieldAria.inputProps, { ref: setValidationInputRef });
|
|
157
|
+
},
|
|
158
|
+
get descriptionProps() {
|
|
159
|
+
return fieldAria.descriptionProps;
|
|
160
|
+
},
|
|
161
|
+
get errorMessageProps() {
|
|
162
|
+
return fieldAria.errorMessageProps;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
return <TimeFieldStateContext.Provider value={state}>
|
|
167
|
+
<DateFieldStateContext.Provider value={state}>
|
|
168
|
+
<DateFieldContext.Provider value={dateFieldContextValue}>
|
|
169
|
+
<TimeFieldContext.Provider value={{
|
|
170
|
+
state,
|
|
171
|
+
aria: {
|
|
172
|
+
get labelProps() {
|
|
173
|
+
return fieldAria.labelProps;
|
|
174
|
+
},
|
|
175
|
+
get inputProps() {
|
|
176
|
+
return fieldAria.fieldProps;
|
|
177
|
+
},
|
|
178
|
+
get descriptionProps() {
|
|
179
|
+
return fieldAria.descriptionProps;
|
|
180
|
+
},
|
|
181
|
+
get errorMessageProps() {
|
|
182
|
+
return fieldAria.errorMessageProps;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}}>
|
|
186
|
+
<div ref={setFieldRef} class={renderProps.class()} style={renderProps.style()} data-disabled={dataAttr(state.isDisabled())} data-readonly={dataAttr(state.isReadOnly())} data-required={dataAttr(state.isRequired())} data-invalid={dataAttr(state.isInvalid())}>
|
|
187
|
+
<Provider values={[[TextContext, textSlots]]}>
|
|
188
|
+
{local.children}
|
|
189
|
+
</Provider>
|
|
190
|
+
</div>
|
|
191
|
+
{}
|
|
192
|
+
</TimeFieldContext.Provider>
|
|
193
|
+
</DateFieldContext.Provider>
|
|
194
|
+
</DateFieldStateContext.Provider>
|
|
195
|
+
</TimeFieldStateContext.Provider>;
|
|
196
|
+
}
|
|
197
|
+
function TimeFieldLabel(props) {
|
|
198
|
+
const { aria } = useTimeFieldContextValue();
|
|
199
|
+
return <span {...aria.labelProps} class={props.class}>
|
|
200
|
+
{props.children}
|
|
201
|
+
</span>;
|
|
202
|
+
}
|
|
203
|
+
function TimeFieldDescription(props) {
|
|
204
|
+
const { aria } = useTimeFieldContextValue();
|
|
205
|
+
return <span {...aria.descriptionProps} class={props.class}>
|
|
206
|
+
{props.children}
|
|
207
|
+
</span>;
|
|
208
|
+
}
|
|
209
|
+
function TimeFieldErrorMessage(props) {
|
|
210
|
+
const { aria } = useTimeFieldContextValue();
|
|
211
|
+
return <span {...aria.errorMessageProps} class={props.class}>
|
|
212
|
+
{props.children}
|
|
213
|
+
</span>;
|
|
214
|
+
}
|
|
215
|
+
//#endregion
|
|
216
|
+
export { TimeField, TimeFieldContext, TimeFieldDescription, TimeFieldErrorMessage, TimeFieldLabel, TimeFieldStateContext, useTimeFieldContext };
|
|
217
|
+
|
|
218
|
+
//# sourceMappingURL=TimeField.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeField.jsx","names":["mergeProps"],"sources":["../src/TimeField.tsx"],"sourcesContent":["/**\n * TimeField component for solidaria-components\n *\n * Pre-wired headless time field. Faithful port of react-aria-components'\n * TimeField, which does NOT define its own segment primitives — it reuses\n * `DateInput`/`DateSegment` (there is no `TimeInput`/`TimeSegment` upstream).\n * `TimeFieldState` IS a `DateFieldState` (plus `timeValue`), so this component\n * drives the certified DateField segment/group stack directly: it provides the\n * shared `DateFieldContext`/`DateFieldStateContext` that `DateInput`/`DateSegment`\n * read, plus a `TimeFieldContext` for the time-field label/description/error\n * chrome. Unlike DateField, TimeField renders NO root hidden autofill input (RAC\n * TimeField renders none); its native-validation `<input>` is still emitted by\n * the inner DateInput sibling.\n */\n\nimport {\n type JSX,\n type Context,\n createContext,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n Show,\n} from \"solid-js\";\nimport { createTimeField, mergeProps, type AriaTimeFieldProps } from \"@proyecto-viviana/solidaria\";\nimport {\n createTimeFieldState,\n access,\n type TimeFieldState,\n type TimeFieldStateProps,\n type TimeSegment as TimeSegmentType,\n type TimeValue,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n DateFieldContext,\n DateFieldStateContext,\n type DateFieldContextValue,\n} from \"./DateField\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n useIsHydrated,\n Provider,\n} from \"./utils\";\nimport { TextContext } from \"./Text\";\nimport { FormContext, type FormProps } from \"./Form\";\n\nexport interface TimeFieldRenderProps {\n /** Whether the field is disabled. */\n isDisabled: boolean;\n /** Whether the field is read-only. */\n isReadOnly: boolean;\n /** Whether the field is required. */\n isRequired: boolean;\n /** Whether the field is invalid. */\n isInvalid: boolean;\n}\n\nexport interface TimeFieldProps<T extends TimeValue = TimeValue>\n extends\n Omit<AriaTimeFieldProps, \"id\" | \"isDisabled\" | \"isReadOnly\" | \"isRequired\">,\n Omit<TimeFieldStateProps<T>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element | ((segment: TimeSegmentType) => JSX.Element);\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TimeFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TimeFieldRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n}\n\nexport interface TimeFieldContextValue {\n state: TimeFieldState<TimeValue>;\n aria: {\n labelProps: Record<string, unknown>;\n inputProps: Record<string, unknown>;\n descriptionProps: Record<string, unknown>;\n errorMessageProps: Record<string, unknown>;\n };\n}\n\nexport const TimeFieldContext = createContext<TimeFieldContextValue | null>(null);\nexport const TimeFieldStateContext = createContext<TimeFieldState<TimeValue> | null>(null);\n\nfunction withFormValidationBehavior<P extends object>(props: P, formContext: FormProps | null): P {\n if (!formContext?.validationBehavior) {\n return props;\n }\n\n return new Proxy(props, {\n get(target, property, receiver) {\n const localValue = Reflect.get(target, property, receiver);\n if (property === \"validationBehavior\" && localValue === undefined) {\n return formContext.validationBehavior;\n }\n\n return localValue;\n },\n has(target, property) {\n return (\n Reflect.has(target, property) ||\n (property === \"validationBehavior\" && formContext.validationBehavior !== undefined)\n );\n },\n ownKeys(target) {\n const keys = new Set(Reflect.ownKeys(target));\n if (formContext.validationBehavior !== undefined) {\n keys.add(\"validationBehavior\");\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (property === \"validationBehavior\" && formContext.validationBehavior !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => formContext.validationBehavior,\n };\n }\n\n return undefined;\n },\n });\n}\n\nfunction useTimeFieldContextValue(): TimeFieldContextValue {\n const context = useContext(TimeFieldContext);\n if (!context) {\n throw new Error(\"TimeField components must be used within a TimeField\");\n }\n return context;\n}\n\nexport function useTimeFieldContext(): TimeFieldState<TimeValue> {\n return useTimeFieldContextValue().state;\n}\n\n/**\n * A time field allows users to enter and edit time values using a keyboard.\n *\n * @example\n * ```tsx\n * <TimeField label=\"Time\">\n * <Label>Time</Label>\n * <DateInput>\n * {(segment) => <DateSegment segment={segment} />}\n * </DateInput>\n * </TimeField>\n * ```\n */\nexport function TimeField<T extends TimeValue = TimeValue>(props: TimeFieldProps<T>): JSX.Element {\n // Use hydration-safe pattern for client-only rendering\n const isHydrated = useIsHydrated();\n const formContext = useContext(FormContext);\n\n return (\n <Show\n when={isHydrated()}\n fallback={\n <div class=\"solidaria-TimeField solidaria-TimeField--placeholder\" aria-hidden=\"true\" />\n }\n >\n <TimeFieldInner {...props} __formContext={formContext} />\n </Show>\n );\n}\n\ntype TimeFieldInnerProps<T extends TimeValue = TimeValue> = TimeFieldProps<T> & {\n __formContext?: FormProps | null;\n};\n\n/**\n * Internal TimeField component that renders after client mount.\n */\nfunction TimeFieldInner<T extends TimeValue = TimeValue>(\n props: TimeFieldInnerProps<T>,\n): JSX.Element {\n const formContext = props.__formContext ?? useContext(FormContext);\n const mergedProps = withFormValidationBehavior(props, formContext);\n const [local, stateProps, rest] = splitProps(\n mergedProps,\n [\"children\", \"class\", \"style\", \"slot\", \"__formContext\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isInvalid\",\n \"isDisabled\",\n \"isReadOnly\",\n \"isRequired\",\n \"locale\",\n \"granularity\",\n \"hourCycle\",\n \"hideTimeZone\",\n \"shouldForceLeadingZeros\",\n \"validationState\",\n \"validationBehavior\",\n \"validate\",\n \"description\",\n \"errorMessage\",\n \"placeholderValue\",\n ],\n );\n\n const [fieldRef, setFieldRef] = createSignal<HTMLDivElement | null>(null);\n // Ref to the hidden validation <input> (the DateInput's `<Input>` sibling).\n // Mirrors DateField: create it here, hand it to createTimeField below, and\n // attach it to the same input through the DateFieldContext getter.\n const [validationInputRef, setValidationInputRef] =\n createSignal<HTMLInputElement | null>(null);\n\n const state = createTimeFieldState(stateProps);\n\n const fieldAria = createTimeField(\n () => ({\n ...(rest as Record<string, unknown>),\n // RAC threads these props into both useTimeFieldState and useTimeField;\n // they live in `stateProps` here, so forward them for the field hook's\n // aria-disabled and the native validation <input> (type/required).\n isDisabled: access(stateProps.isDisabled),\n isReadOnly: access(stateProps.isReadOnly),\n isRequired: access(stateProps.isRequired),\n // Standalone default flips the hidden input to type=\"text\" so an empty\n // required value blocks HTML form submission (mirrors DateField).\n validationBehavior: stateProps.validationBehavior ?? \"native\",\n description: stateProps.description,\n errorMessage: stateProps.errorMessage,\n inputRef: () => validationInputRef() ?? undefined,\n }),\n state as unknown as TimeFieldState<TimeValue>,\n fieldRef,\n );\n\n const renderValues = createMemo<TimeFieldRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isRequired: state.isRequired(),\n isInvalid: state.isInvalid(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-TimeField\",\n },\n renderValues,\n );\n\n const textSlots = {\n slots: {\n get description() {\n return fieldAria.descriptionProps;\n },\n get errorMessage() {\n return fieldAria.errorMessageProps;\n },\n },\n };\n\n // The shared context read by the reused DateInput/DateSegment. Read through\n // getters so consumers see the LIVE memo values (createDescription appends the\n // value-description id via a deferred effect; a frozen snapshot would miss it).\n const dateFieldContextValue: DateFieldContextValue = {\n get state() {\n return state as unknown as DateFieldContextValue[\"state\"];\n },\n aria: {\n get labelProps() {\n return fieldAria.labelProps;\n },\n // The segment group props (role=\"group\", aria-labelledby, unicode-bidi\n // isolate, arrow-key nav, focus-within handlers) are routed to the\n // DateInput element; the outer wrapper stays roleless.\n get inputProps() {\n return fieldAria.fieldProps;\n },\n // The native validation <input> props (type/hidden/required/onChange under\n // native validation), rendered as the DateInput's sibling. Thread the\n // validation-input ref so createTimeField's form-reset/validation wiring\n // resolves to the mounted element.\n get hiddenInputProps() {\n return mergeProps(fieldAria.inputProps, { ref: setValidationInputRef });\n },\n get descriptionProps() {\n return fieldAria.descriptionProps;\n },\n get errorMessageProps() {\n return fieldAria.errorMessageProps;\n },\n },\n };\n\n return (\n <TimeFieldStateContext.Provider value={state as unknown as TimeFieldState<TimeValue>}>\n <DateFieldStateContext.Provider\n value={state as unknown as DateFieldContextValue[\"state\"]}\n >\n <DateFieldContext.Provider value={dateFieldContextValue}>\n <TimeFieldContext.Provider\n value={{\n state: state as unknown as TimeFieldState<TimeValue>,\n aria: {\n get labelProps() {\n return fieldAria.labelProps;\n },\n get inputProps() {\n return fieldAria.fieldProps;\n },\n get descriptionProps() {\n return fieldAria.descriptionProps;\n },\n get errorMessageProps() {\n return fieldAria.errorMessageProps;\n },\n },\n }}\n >\n <div\n ref={setFieldRef}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-required={dataAttr(state.isRequired())}\n data-invalid={dataAttr(state.isInvalid())}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n {local.children as JSX.Element}\n </Provider>\n </div>\n {/*\n Unlike DateField, TimeField renders NO root hidden autofill input —\n RAC TimeField renders none (react-aria-components TimeField.mjs). The\n native-validation <input> is emitted by the inner DateInput sibling.\n */}\n </TimeFieldContext.Provider>\n </DateFieldContext.Provider>\n </DateFieldStateContext.Provider>\n </TimeFieldStateContext.Provider>\n );\n}\n\nexport interface TimeFieldLabelProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function TimeFieldLabel(props: TimeFieldLabelProps): JSX.Element {\n const { aria } = useTimeFieldContextValue();\n return (\n <span {...aria.labelProps} class={props.class}>\n {props.children}\n </span>\n );\n}\n\nexport interface TimeFieldDescriptionProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function TimeFieldDescription(props: TimeFieldDescriptionProps): JSX.Element {\n const { aria } = useTimeFieldContextValue();\n return (\n <span {...aria.descriptionProps} class={props.class}>\n {props.children}\n </span>\n );\n}\n\nexport interface TimeFieldErrorMessageProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function TimeFieldErrorMessage(props: TimeFieldErrorMessageProps): JSX.Element {\n const { aria } = useTimeFieldContextValue();\n return (\n <span {...aria.errorMessageProps} class={props.class}>\n {props.children}\n </span>\n );\n}\n\nexport type { TimeFieldState, TimeSegmentType, TimeValue };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuFA,MAAa,mBAAmB,cAA4C,IAAI;AAChF,MAAa,wBAAwB,cAAgD,IAAI;AAEzF,SAAS,2BAA6C,OAAU,aAAkC;CAChG,IAAI,CAAC,aAAa,oBAChB,OAAO;CAGT,OAAO,IAAI,MAAM,OA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ED
|
@@ -158,6 +158,20 @@ export interface ToastDescriptionProps {
|
|
|
158
158
|
* ToastDescription renders the toast description with proper accessibility attributes.
|
|
159
159
|
*/
|
|
160
160
|
export declare function ToastDescription(props: ToastDescriptionProps): JSX.Element;
|
|
161
|
+
export interface ToastContentProps {
|
|
162
|
+
children: JSX.Element;
|
|
163
|
+
class?: string;
|
|
164
|
+
style?: JSX.CSSProperties;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* ToastContent wraps the toast message (title + description) in the live region
|
|
168
|
+
* announced to screen readers. It carries `role="alert"` / `aria-live="assertive"`
|
|
169
|
+
* from createToast's contentProps so the toast text is announced when it appears.
|
|
170
|
+
*
|
|
171
|
+
* It is rendered as a sibling of the close button (never wrapping it) so screen
|
|
172
|
+
* readers announce the message without reading the close button first.
|
|
173
|
+
*/
|
|
174
|
+
export declare function ToastContent(props: ToastContentProps): JSX.Element;
|
|
161
175
|
export interface ToastCloseButtonProps {
|
|
162
176
|
/** The toast to close. */
|
|
163
177
|
toast: QueuedToast<ToastContent>;
|
package/dist/Toast.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../src/Toast.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,GAAG,EACR,KAAK,QAAQ,EASd,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,UAAU,EAEX,MAAM,iCAAiC,CAAC;AAMzC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EAIrB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,YAAY;IAC3B,oFAAoF;IACpF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6FAA6F;IAC7F,CAAC,aAAa,EAAE,QAAQ,MAAM,EAAE,GAAG,MAAM,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