@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
package/src/Tabs.tsx
CHANGED
|
@@ -102,10 +102,6 @@ export interface TabListRenderProps {
|
|
|
102
102
|
orientation: TabOrientation;
|
|
103
103
|
/** Whether the tab list is disabled. */
|
|
104
104
|
isDisabled: boolean;
|
|
105
|
-
/** Whether the tab list has focus. */
|
|
106
|
-
isFocused: boolean;
|
|
107
|
-
/** Whether the tab list has visible focus. */
|
|
108
|
-
isFocusVisible: boolean;
|
|
109
105
|
}
|
|
110
106
|
|
|
111
107
|
export interface TabListProps<T> extends Omit<AriaTabListProps, "children">, SlotProps {
|
|
@@ -319,7 +315,9 @@ export function Tabs<T>(props: TabsProps<T>): JSX.Element {
|
|
|
319
315
|
{
|
|
320
316
|
class: local.class,
|
|
321
317
|
style: local.style,
|
|
322
|
-
children
|
|
318
|
+
get children() {
|
|
319
|
+
return props.children;
|
|
320
|
+
},
|
|
323
321
|
defaultClassName: "solidaria-Tabs",
|
|
324
322
|
},
|
|
325
323
|
renderValues,
|
|
@@ -437,13 +435,9 @@ function TabListInner<T>(props: {
|
|
|
437
435
|
// Create tab list aria props
|
|
438
436
|
const { tabListProps } = createTabList<T>(props.ariaProps as AriaTabListProps, state);
|
|
439
437
|
|
|
440
|
-
const { isFocused, isFocusVisible, focusProps } = createFocusRing();
|
|
441
|
-
|
|
442
438
|
const renderValues = createMemo<TabListRenderProps>(() => ({
|
|
443
439
|
orientation: state.orientation(),
|
|
444
440
|
isDisabled: state.isDisabled(),
|
|
445
|
-
isFocused: state.isFocused() || isFocused(),
|
|
446
|
-
isFocusVisible: isFocusVisible(),
|
|
447
441
|
}));
|
|
448
442
|
|
|
449
443
|
const renderProps = useRenderProps(
|
|
@@ -455,42 +449,16 @@ function TabListInner<T>(props: {
|
|
|
455
449
|
renderValues,
|
|
456
450
|
);
|
|
457
451
|
|
|
458
|
-
// Helper to safely call event handlers that may be bound tuples
|
|
459
|
-
const callHandler = <E extends Event>(
|
|
460
|
-
handler: JSX.EventHandlerUnion<HTMLElement, E> | undefined,
|
|
461
|
-
event: E,
|
|
462
|
-
) => {
|
|
463
|
-
if (!handler) return;
|
|
464
|
-
if (Array.isArray(handler)) {
|
|
465
|
-
handler[1].call(handler[0], event);
|
|
466
|
-
return;
|
|
467
|
-
}
|
|
468
|
-
if (typeof handler === "function") {
|
|
469
|
-
(handler as (evt: E) => void)(event);
|
|
470
|
-
return;
|
|
471
|
-
}
|
|
472
|
-
if (
|
|
473
|
-
typeof handler === "object" &&
|
|
474
|
-
"handleEvent" in handler &&
|
|
475
|
-
typeof handler.handleEvent === "function"
|
|
476
|
-
) {
|
|
477
|
-
(handler.handleEvent as (evt: E) => void)(event);
|
|
478
|
-
}
|
|
479
|
-
};
|
|
480
|
-
|
|
481
|
-
// Combine event handlers
|
|
482
452
|
const handleKeyDown = (e: KeyboardEvent) => {
|
|
483
453
|
tabListProps.onKeyDown(e);
|
|
484
454
|
};
|
|
485
455
|
|
|
486
456
|
const handleFocus = (e: FocusEvent) => {
|
|
487
|
-
tabListProps.
|
|
488
|
-
callHandler(focusProps.onFocus, e);
|
|
457
|
+
tabListProps.onFocusIn(e);
|
|
489
458
|
};
|
|
490
459
|
|
|
491
460
|
const handleBlur = (e: FocusEvent) => {
|
|
492
|
-
tabListProps.
|
|
493
|
-
callHandler(focusProps.onBlur, e);
|
|
461
|
+
tabListProps.onFocusOut(e);
|
|
494
462
|
};
|
|
495
463
|
|
|
496
464
|
return (
|
|
@@ -503,10 +471,8 @@ function TabListInner<T>(props: {
|
|
|
503
471
|
class={renderProps.class()}
|
|
504
472
|
style={renderProps.style()}
|
|
505
473
|
onKeyDown={handleKeyDown}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
data-focused={state.isFocused() || undefined}
|
|
509
|
-
data-focus-visible={isFocusVisible() || undefined}
|
|
474
|
+
onFocusIn={handleFocus}
|
|
475
|
+
onFocusOut={handleBlur}
|
|
510
476
|
data-orientation={state.orientation()}
|
|
511
477
|
data-disabled={state.isDisabled() || undefined}
|
|
512
478
|
>
|
|
@@ -611,7 +577,9 @@ function TabInner(props: {
|
|
|
611
577
|
|
|
612
578
|
const renderProps = useRenderProps(
|
|
613
579
|
{
|
|
614
|
-
children
|
|
580
|
+
get children() {
|
|
581
|
+
return props.children;
|
|
582
|
+
},
|
|
615
583
|
class: props.local.class,
|
|
616
584
|
style: props.local.style,
|
|
617
585
|
defaultClassName: "solidaria-Tab",
|
|
@@ -634,7 +602,7 @@ function TabInner(props: {
|
|
|
634
602
|
aria-controls={tabAria.isSelected() ? tabAria.tabProps["aria-controls"] : undefined}
|
|
635
603
|
aria-label={tabAria.tabProps["aria-label"]}
|
|
636
604
|
aria-labelledby={tabAria.tabProps["aria-labelledby"]}
|
|
637
|
-
tabIndex={tabAria.
|
|
605
|
+
tabIndex={tabAria.tabProps.tabIndex}
|
|
638
606
|
class={renderProps.class()}
|
|
639
607
|
style={renderProps.style()}
|
|
640
608
|
onKeyDown={tabAria.tabProps.onKeyDown}
|
|
@@ -642,6 +610,8 @@ function TabInner(props: {
|
|
|
642
610
|
onPointerDown={tabAria.tabProps.onPointerDown}
|
|
643
611
|
onClick={tabAria.tabProps.onClick}
|
|
644
612
|
onFocus={tabAria.tabProps.onFocus}
|
|
613
|
+
onFocusIn={tabAria.tabProps.onFocusIn}
|
|
614
|
+
onBlur={tabAria.tabProps.onBlur}
|
|
645
615
|
{...hoverProps}
|
|
646
616
|
data-selected={tabAria.isSelected() || undefined}
|
|
647
617
|
data-focused={tabAria.isFocused() || undefined}
|
|
@@ -650,7 +620,7 @@ function TabInner(props: {
|
|
|
650
620
|
data-hovered={isHovered() || undefined}
|
|
651
621
|
data-disabled={tabAria.isDisabled() || undefined}
|
|
652
622
|
>
|
|
653
|
-
{renderProps.
|
|
623
|
+
{renderProps.renderChildrenStable()}
|
|
654
624
|
</div>
|
|
655
625
|
</SelectionIndicatorContext.Provider>
|
|
656
626
|
);
|
|
@@ -750,7 +720,9 @@ export function TabPanel(props: TabPanelProps): JSX.Element {
|
|
|
750
720
|
|
|
751
721
|
const renderProps = useRenderProps(
|
|
752
722
|
{
|
|
753
|
-
children
|
|
723
|
+
get children() {
|
|
724
|
+
return props.children;
|
|
725
|
+
},
|
|
754
726
|
class: local.class,
|
|
755
727
|
style: local.style,
|
|
756
728
|
defaultClassName: "solidaria-TabPanel",
|
package/src/TagGroup.tsx
CHANGED
|
@@ -18,7 +18,12 @@ import {
|
|
|
18
18
|
For,
|
|
19
19
|
Show,
|
|
20
20
|
} from "solid-js";
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
createTagGroup,
|
|
23
|
+
createTag,
|
|
24
|
+
useLocale,
|
|
25
|
+
type AriaTagGroupProps,
|
|
26
|
+
} from "@proyecto-viviana/solidaria";
|
|
22
27
|
import {
|
|
23
28
|
createListState,
|
|
24
29
|
type ListState,
|
|
@@ -31,9 +36,11 @@ import {
|
|
|
31
36
|
type ClassNameOrFunction,
|
|
32
37
|
type StyleOrFunction,
|
|
33
38
|
type SlotProps,
|
|
39
|
+
type RefLike,
|
|
34
40
|
useRenderProps,
|
|
35
41
|
filterDOMProps,
|
|
36
42
|
dataAttr,
|
|
43
|
+
mergeRefs,
|
|
37
44
|
} from "./utils";
|
|
38
45
|
import { SharedElementTransition } from "./SharedElementTransition";
|
|
39
46
|
import {
|
|
@@ -140,6 +147,8 @@ export interface TagProps extends SlotProps {
|
|
|
140
147
|
class?: ClassNameOrFunction<TagRenderProps>;
|
|
141
148
|
/** The inline style for the element. */
|
|
142
149
|
style?: StyleOrFunction<TagRenderProps>;
|
|
150
|
+
/** A ref to the tag's DOM element (merged with the internal collection ref). */
|
|
151
|
+
ref?: RefLike<HTMLDivElement>;
|
|
143
152
|
/** Handler called when the tag is activated. */
|
|
144
153
|
onAction?: (key: Key) => void;
|
|
145
154
|
}
|
|
@@ -254,6 +263,11 @@ export function TagList<T extends { id?: Key; key?: Key }>(props: TagListProps<T
|
|
|
254
263
|
},
|
|
255
264
|
});
|
|
256
265
|
|
|
266
|
+
// The tag group navigates on the inline axis, so ArrowLeft/ArrowRight flip
|
|
267
|
+
// under RTL. Thread the resolved layout direction into the hook (mirrors
|
|
268
|
+
// ListBox, and useTagGroup passing `direction` to the ListKeyboardDelegate).
|
|
269
|
+
const locale = useLocale();
|
|
270
|
+
|
|
257
271
|
// Create tag group accessibility props
|
|
258
272
|
const tagGroupAria = createTagGroup(
|
|
259
273
|
{
|
|
@@ -272,6 +286,9 @@ export function TagList<T extends { id?: Key; key?: Key }>(props: TagListProps<T
|
|
|
272
286
|
get onRemove() {
|
|
273
287
|
return local.onRemove;
|
|
274
288
|
},
|
|
289
|
+
get direction() {
|
|
290
|
+
return locale().direction;
|
|
291
|
+
},
|
|
275
292
|
},
|
|
276
293
|
state,
|
|
277
294
|
gridRef,
|
|
@@ -312,18 +329,20 @@ export function TagList<T extends { id?: Key; key?: Key }>(props: TagListProps<T
|
|
|
312
329
|
{...tagGroupAria.gridProps}
|
|
313
330
|
class={renderProps.class()}
|
|
314
331
|
style={renderProps.style()}
|
|
315
|
-
|
|
332
|
+
// Track focus-within via the BUBBLING focusin/focusout pair (not the
|
|
333
|
+
// non-bubbling focus/blur the hook's trampoline uses) so this render-prop
|
|
334
|
+
// signal never clobbers `gridProps.onFocus` — the container focus
|
|
335
|
+
// trampoline that marshals entry onto the first/last row.
|
|
336
|
+
onFocusIn={() => {
|
|
316
337
|
setIsFocused(true);
|
|
317
|
-
state.setFocused(true);
|
|
318
338
|
}}
|
|
319
|
-
|
|
339
|
+
onFocusOut={(e) => {
|
|
320
340
|
const nextTarget = e.relatedTarget as Node | null;
|
|
321
341
|
if (nextTarget && e.currentTarget.contains(nextTarget)) {
|
|
322
342
|
return;
|
|
323
343
|
}
|
|
324
344
|
|
|
325
345
|
setIsFocused(false);
|
|
326
|
-
state.setFocused(false);
|
|
327
346
|
}}
|
|
328
347
|
data-empty={dataAttr(local.items.length === 0)}
|
|
329
348
|
data-focused={dataAttr(isFocused())}
|
|
@@ -351,6 +370,7 @@ export function Tag(props: TagProps): JSX.Element {
|
|
|
351
370
|
"isDisabled",
|
|
352
371
|
"textValue",
|
|
353
372
|
"onAction",
|
|
373
|
+
"ref",
|
|
354
374
|
]);
|
|
355
375
|
|
|
356
376
|
const state = useContext(TagListStateContext);
|
|
@@ -404,7 +424,9 @@ export function Tag(props: TagProps): JSX.Element {
|
|
|
404
424
|
|
|
405
425
|
const renderProps = useRenderProps(
|
|
406
426
|
{
|
|
407
|
-
children
|
|
427
|
+
get children() {
|
|
428
|
+
return props.children;
|
|
429
|
+
},
|
|
408
430
|
class: local.class,
|
|
409
431
|
style: local.style,
|
|
410
432
|
defaultClassName: "solidaria-Tag",
|
|
@@ -431,7 +453,7 @@ export function Tag(props: TagProps): JSX.Element {
|
|
|
431
453
|
}}
|
|
432
454
|
>
|
|
433
455
|
<div
|
|
434
|
-
ref={setTagRef}
|
|
456
|
+
ref={mergeRefs(setTagRef, local.ref)}
|
|
435
457
|
{...domProps()}
|
|
436
458
|
{...tagAria.rowProps}
|
|
437
459
|
class={renderProps.class()}
|
package/src/Text.tsx
CHANGED
|
@@ -1,18 +1,39 @@
|
|
|
1
|
-
import { type JSX, createContext } from "solid-js";
|
|
2
|
-
import
|
|
1
|
+
import { type JSX, createContext, splitProps } from "solid-js";
|
|
2
|
+
import { Dynamic } from "solid-js/web";
|
|
3
|
+
import { type ContextValue, type SlotProps, useContextProps, filterDOMProps } from "./utils";
|
|
3
4
|
|
|
4
|
-
export interface TextProps extends SlotProps {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
style?: JSX.CSSProperties;
|
|
5
|
+
export interface TextProps extends JSX.HTMLAttributes<HTMLElement>, SlotProps {
|
|
6
|
+
/** The element type to render as. @default 'span' */
|
|
7
|
+
elementType?: string;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Slotted context for `Text`. A field provides description / errorMessage props
|
|
12
|
+
* (each carrying the `id` its `aria-describedby` references) under named slots,
|
|
13
|
+
* so a `<Text slot="description">` child picks up the right `id` without the field
|
|
14
|
+
* threading it manually. Mirrors react-aria-components' `TextContext` (default
|
|
15
|
+
* `{}` so an unprovided `Text` merges against an empty context and renders as-is).
|
|
16
|
+
*/
|
|
17
|
+
export const TextContext = createContext<ContextValue<TextProps, HTMLElement>>({});
|
|
11
18
|
|
|
19
|
+
/**
|
|
20
|
+
* A piece of text, typically a label, description, or error message inside a
|
|
21
|
+
* field. Port of react-aria-components' `Text`: it consumes its slot from
|
|
22
|
+
* `TextContext` (via `useContextProps`) so a field can supply the `id` and other
|
|
23
|
+
* props for the matching slot, then renders them onto the element.
|
|
24
|
+
*/
|
|
12
25
|
export function Text(props: TextProps): JSX.Element {
|
|
26
|
+
const [merged] = useContextProps(props, undefined, TextContext);
|
|
27
|
+
// `slot` stays a logical prop (not a DOM attribute) and `ref`/`class`/`children`
|
|
28
|
+
// are rendered explicitly; everything else (notably the slotted `id`) is spread.
|
|
29
|
+
const [local, domProps] = splitProps(merged, ["elementType", "class", "children", "slot", "ref"]);
|
|
13
30
|
return (
|
|
14
|
-
<
|
|
15
|
-
{
|
|
16
|
-
|
|
31
|
+
<Dynamic
|
|
32
|
+
component={local.elementType ?? "span"}
|
|
33
|
+
class={local.class ?? "solidaria-Text"}
|
|
34
|
+
{...filterDOMProps(domProps, { global: true })}
|
|
35
|
+
>
|
|
36
|
+
{local.children}
|
|
37
|
+
</Dynamic>
|
|
17
38
|
);
|
|
18
39
|
}
|
package/src/TextField.tsx
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
type JSX,
|
|
10
|
+
type Context,
|
|
10
11
|
createContext,
|
|
11
12
|
useContext,
|
|
12
13
|
createMemo,
|
|
@@ -38,7 +39,9 @@ import {
|
|
|
38
39
|
type SlotProps,
|
|
39
40
|
useRenderProps,
|
|
40
41
|
filterDOMProps,
|
|
42
|
+
Provider,
|
|
41
43
|
} from "./utils";
|
|
44
|
+
import { TextContext } from "./Text";
|
|
42
45
|
|
|
43
46
|
export interface TextFieldRenderProps {
|
|
44
47
|
/** Whether the text field is disabled. */
|
|
@@ -149,8 +152,21 @@ export interface LabelProps extends JSX.LabelHTMLAttributes<HTMLLabelElement> {
|
|
|
149
152
|
export function Label(props: LabelProps): JSX.Element {
|
|
150
153
|
const context = useContext(TextFieldContext);
|
|
151
154
|
|
|
155
|
+
const localDOMProps = () => {
|
|
156
|
+
const result: Record<string, unknown> = {};
|
|
157
|
+
const propsRecord = props as Record<string, unknown>;
|
|
158
|
+
|
|
159
|
+
for (const key in propsRecord) {
|
|
160
|
+
if (key !== "children") {
|
|
161
|
+
result[key] = propsRecord[key];
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return result;
|
|
165
|
+
};
|
|
166
|
+
|
|
152
167
|
// Merge context labelProps with local props (local props take precedence)
|
|
153
168
|
const mergedProps = () => {
|
|
169
|
+
const localProps = localDOMProps();
|
|
154
170
|
if (context) {
|
|
155
171
|
const { ref: _ref, ...contextLabelProps } = (context.labelProps ?? {}) as Record<
|
|
156
172
|
string,
|
|
@@ -159,14 +175,14 @@ export function Label(props: LabelProps): JSX.Element {
|
|
|
159
175
|
const merged = {
|
|
160
176
|
...contextLabelProps,
|
|
161
177
|
...(context.inputId ? { for: context.inputId } : {}),
|
|
162
|
-
...
|
|
178
|
+
...localProps,
|
|
163
179
|
} as Record<string, unknown>;
|
|
164
180
|
if (merged.class == null) {
|
|
165
181
|
merged.class = "solidaria-Label";
|
|
166
182
|
}
|
|
167
183
|
return merged;
|
|
168
184
|
}
|
|
169
|
-
return
|
|
185
|
+
return localProps.class == null ? { ...localProps, class: "solidaria-Label" } : localProps;
|
|
170
186
|
};
|
|
171
187
|
|
|
172
188
|
return <label {...mergedProps()}>{props.children}</label>;
|
|
@@ -481,7 +497,9 @@ export function TextField(props: TextFieldProps): JSX.Element {
|
|
|
481
497
|
|
|
482
498
|
const renderProps = useRenderProps(
|
|
483
499
|
{
|
|
484
|
-
children
|
|
500
|
+
get children() {
|
|
501
|
+
return local.children;
|
|
502
|
+
},
|
|
485
503
|
class: local.class,
|
|
486
504
|
style: local.style,
|
|
487
505
|
defaultClassName: "solidaria-TextField",
|
|
@@ -513,7 +531,7 @@ export function TextField(props: TextFieldProps): JSX.Element {
|
|
|
513
531
|
};
|
|
514
532
|
|
|
515
533
|
const domProps = createMemo(() => {
|
|
516
|
-
const filtered = filterDOMProps(ariaProps, { global: true });
|
|
534
|
+
const filtered = filterDOMProps(ariaProps, { global: true, events: false });
|
|
517
535
|
delete (filtered as Record<string, unknown>).id;
|
|
518
536
|
return filtered;
|
|
519
537
|
});
|
|
@@ -586,6 +604,26 @@ export function TextField(props: TextFieldProps): JSX.Element {
|
|
|
586
604
|
const children = local.children;
|
|
587
605
|
return typeof children === "function" ? children(childRenderValues) : children;
|
|
588
606
|
});
|
|
607
|
+
// Provide the description / errorMessage props as `TextContext` slots (mirrors
|
|
608
|
+
// react-aria-components' TextField), so a `<Text slot="description">` /
|
|
609
|
+
// `<Text slot="errorMessage">` child picks up the `id` its `aria-describedby`
|
|
610
|
+
// references. Additive: existing consumers reading these off `TextFieldContext`
|
|
611
|
+
// are unaffected.
|
|
612
|
+
const textSlots = {
|
|
613
|
+
slots: {
|
|
614
|
+
get description() {
|
|
615
|
+
return textFieldAria.descriptionProps as JSX.HTMLAttributes<HTMLElement>;
|
|
616
|
+
},
|
|
617
|
+
get errorMessage() {
|
|
618
|
+
return textFieldAria.errorMessageProps as JSX.HTMLAttributes<HTMLElement>;
|
|
619
|
+
},
|
|
620
|
+
},
|
|
621
|
+
};
|
|
622
|
+
const FieldChildrenSlotted = () => (
|
|
623
|
+
<Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>
|
|
624
|
+
<FieldChildren />
|
|
625
|
+
</Provider>
|
|
626
|
+
);
|
|
589
627
|
const rootProps = () =>
|
|
590
628
|
({
|
|
591
629
|
...domProps(),
|
|
@@ -604,7 +642,7 @@ export function TextField(props: TextFieldProps): JSX.Element {
|
|
|
604
642
|
const customRootProps = () =>
|
|
605
643
|
({
|
|
606
644
|
...rootProps(),
|
|
607
|
-
children: <
|
|
645
|
+
children: <FieldChildrenSlotted />,
|
|
608
646
|
}) as JSX.HTMLAttributes<HTMLDivElement>;
|
|
609
647
|
|
|
610
648
|
return (
|
|
@@ -614,7 +652,7 @@ export function TextField(props: TextFieldProps): JSX.Element {
|
|
|
614
652
|
local.render(customRootProps(), renderValues())
|
|
615
653
|
) : (
|
|
616
654
|
<div {...rootProps()}>
|
|
617
|
-
<
|
|
655
|
+
<FieldChildrenSlotted />
|
|
618
656
|
</div>
|
|
619
657
|
)}
|
|
620
658
|
</TextFieldContext.Provider>
|