@proyecto-viviana/solidaria-components 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionBar.d.ts.map +1 -1
- package/dist/ActionBar.js +2 -11
- package/dist/ActionBar.js.map +1 -1
- package/dist/ActionBar.jsx +2 -11
- package/dist/ActionBar.jsx.map +1 -1
- package/dist/ActionGroup.d.ts.map +1 -1
- package/dist/ActionGroup.js +1 -1
- package/dist/ActionGroup.js.map +1 -1
- package/dist/ActionGroup.jsx +1 -1
- package/dist/ActionGroup.jsx.map +1 -1
- package/dist/Autocomplete.d.ts +2 -2
- package/dist/Autocomplete.d.ts.map +1 -1
- package/dist/Autocomplete.js +7 -7
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Autocomplete.jsx +7 -7
- package/dist/Autocomplete.jsx.map +1 -1
- package/dist/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs.js +18 -18
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/Breadcrumbs.jsx +21 -26
- package/dist/Breadcrumbs.jsx.map +1 -1
- package/dist/Calendar.d.ts.map +1 -1
- package/dist/Calendar.js +100 -65
- package/dist/Calendar.js.map +1 -1
- package/dist/Calendar.jsx +10 -1
- package/dist/Calendar.jsx.map +1 -1
- package/dist/Color.d.ts.map +1 -1
- package/dist/Color.js +15 -18
- package/dist/Color.js.map +1 -1
- package/dist/Color.jsx +15 -19
- package/dist/Color.jsx.map +1 -1
- package/dist/ComboBox.d.ts +4 -0
- package/dist/ComboBox.d.ts.map +1 -1
- package/dist/ComboBox.js +21 -13
- package/dist/ComboBox.js.map +1 -1
- package/dist/ComboBox.jsx +23 -13
- package/dist/ComboBox.jsx.map +1 -1
- package/dist/DateField.d.ts +11 -2
- package/dist/DateField.d.ts.map +1 -1
- package/dist/DateField2.js +237 -234
- package/dist/DateField2.js.map +1 -1
- package/dist/DateField2.jsx +134 -97
- package/dist/DateField2.jsx.map +1 -1
- package/dist/DatePicker.d.ts +42 -3
- package/dist/DatePicker.d.ts.map +1 -1
- package/dist/DatePicker.js +6 -990
- package/dist/DatePicker.jsx +6 -681
- package/dist/DatePicker2.js +1171 -0
- package/dist/DatePicker2.js.map +1 -0
- package/dist/DatePicker2.jsx +820 -0
- package/dist/DatePicker2.jsx.map +1 -0
- package/dist/DateRangePickerContext.d.ts +2 -0
- package/dist/DateRangePickerContext.d.ts.map +1 -1
- package/dist/Disclosure.d.ts.map +1 -1
- package/dist/Disclosure.js +3 -0
- package/dist/Disclosure.js.map +1 -1
- package/dist/Disclosure.jsx +1 -1
- package/dist/Disclosure.jsx.map +1 -1
- package/dist/ElementTag.d.ts +29 -0
- package/dist/ElementTag.d.ts.map +1 -0
- package/dist/ElementTag.js +220 -0
- package/dist/ElementTag.js.map +1 -0
- package/dist/ElementTag.jsx +67 -0
- package/dist/ElementTag.jsx.map +1 -0
- package/dist/GridList.d.ts.map +1 -1
- package/dist/GridList.js +2 -2
- package/dist/GridList.js.map +1 -1
- package/dist/GridList.jsx +2 -2
- package/dist/GridList.jsx.map +1 -1
- package/dist/Landmark.js +4 -3
- package/dist/Landmark.js.map +1 -1
- package/dist/Landmark.jsx +3 -3
- package/dist/Landmark.jsx.map +1 -1
- package/dist/Link.js +3 -2
- package/dist/Link.js.map +1 -1
- package/dist/Link.jsx +3 -3
- package/dist/Link.jsx.map +1 -1
- package/dist/ListBox.d.ts +2 -2
- package/dist/ListBox.d.ts.map +1 -1
- package/dist/ListBox.js +327 -166
- package/dist/ListBox.js.map +1 -1
- package/dist/ListBox.jsx +161 -25
- package/dist/ListBox.jsx.map +1 -1
- package/dist/Modal.d.ts.map +1 -1
- package/dist/Modal.js +7 -5
- package/dist/Modal.js.map +1 -1
- package/dist/Modal.jsx +5 -5
- package/dist/Modal.jsx.map +1 -1
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Popover.js +16 -9
- package/dist/Popover.js.map +1 -1
- package/dist/Popover.jsx +25 -4
- package/dist/Popover.jsx.map +1 -1
- package/dist/RangeCalendar.d.ts.map +1 -1
- package/dist/RangeCalendar.js +182 -46
- package/dist/RangeCalendar.js.map +1 -1
- package/dist/RangeCalendar.jsx +72 -2
- package/dist/RangeCalendar.jsx.map +1 -1
- package/dist/SearchField.d.ts.map +1 -1
- package/dist/SearchField.js +26 -2
- package/dist/SearchField.js.map +1 -1
- package/dist/SearchField.jsx +26 -2
- package/dist/SearchField.jsx.map +1 -1
- package/dist/Select.d.ts +7 -0
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +64 -51
- package/dist/Select.js.map +1 -1
- package/dist/Select.jsx +35 -20
- package/dist/Select.jsx.map +1 -1
- package/dist/Separator.js +3 -2
- package/dist/Separator.js.map +1 -1
- package/dist/Separator.jsx +2 -2
- package/dist/Separator.jsx.map +1 -1
- package/dist/SharedElementTransition.d.ts.map +1 -1
- package/dist/SharedElementTransition.js +35 -33
- package/dist/SharedElementTransition.js.map +1 -1
- package/dist/SharedElementTransition.jsx +35 -33
- package/dist/SharedElementTransition.jsx.map +1 -1
- package/dist/StepList.d.ts.map +1 -1
- package/dist/StepList.js +2 -9
- package/dist/StepList.js.map +1 -1
- package/dist/StepList.jsx +1 -6
- package/dist/StepList.jsx.map +1 -1
- package/dist/Table.d.ts +2 -0
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +10 -3
- package/dist/Table.js.map +1 -1
- package/dist/Table.jsx +10 -3
- package/dist/Table.jsx.map +1 -1
- package/dist/Tabs.d.ts.map +1 -1
- package/dist/Tabs.js +3 -0
- package/dist/Tabs.js.map +1 -1
- package/dist/Tabs.jsx +1 -1
- package/dist/Tabs.jsx.map +1 -1
- package/dist/TagGroup.d.ts +3 -1
- package/dist/TagGroup.d.ts.map +1 -1
- package/dist/TagGroup.js +12 -8
- package/dist/TagGroup.js.map +1 -1
- package/dist/TagGroup.jsx +11 -8
- package/dist/TagGroup.jsx.map +1 -1
- package/dist/Text.d.ts.map +1 -1
- package/dist/Text.js +9 -8
- package/dist/Text.js.map +1 -1
- package/dist/Text.jsx +3 -3
- package/dist/Text.jsx.map +1 -1
- package/dist/TextField.js +4 -1
- package/dist/TextField.js.map +1 -1
- package/dist/TextField.jsx +4 -1
- package/dist/TextField.jsx.map +1 -1
- package/dist/TimeField.d.ts +14 -50
- package/dist/TimeField.d.ts.map +1 -1
- package/dist/TimeField.js +111 -205
- package/dist/TimeField.js.map +1 -1
- package/dist/TimeField.jsx +76 -82
- package/dist/TimeField.jsx.map +1 -1
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Tree.js +3 -3
- package/dist/Tree.js.map +1 -1
- package/dist/Tree.jsx +3 -3
- package/dist/Tree.jsx.map +1 -1
- package/dist/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden.js +3 -11
- package/dist/VisuallyHidden.js.map +1 -1
- package/dist/VisuallyHidden.jsx +3 -4
- package/dist/VisuallyHidden.jsx.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.jsx +6 -6
- package/dist/useDragAndDrop.d.ts +0 -8
- package/dist/useDragAndDrop.d.ts.map +1 -1
- package/dist/useDragAndDrop2.js +6 -2
- package/dist/useDragAndDrop2.js.map +1 -1
- package/dist/useDragAndDrop2.jsx +6 -2
- package/dist/useDragAndDrop2.jsx.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +2 -2
- package/dist/utils.js.map +1 -1
- package/dist/utils.jsx +2 -2
- package/dist/utils.jsx.map +1 -1
- package/package.json +3 -9
- package/src/ActionBar.tsx +10 -12
- package/src/ActionGroup.tsx +5 -3
- package/src/Autocomplete.tsx +14 -9
- package/src/Breadcrumbs.tsx +57 -42
- package/src/Calendar.tsx +30 -1
- package/src/Color.tsx +42 -27
- package/src/ComboBox.tsx +49 -17
- package/src/DateField.tsx +285 -52
- package/src/DatePicker.tsx +345 -57
- package/src/DateRangePickerContext.tsx +2 -0
- package/src/Disclosure.tsx +4 -0
- package/src/ElementTag.tsx +116 -0
- package/src/GridList.tsx +8 -2
- package/src/Landmark.tsx +4 -4
- package/src/Link.tsx +4 -4
- package/src/ListBox.tsx +323 -21
- package/src/Modal.tsx +21 -5
- package/src/Popover.tsx +28 -7
- package/src/RangeCalendar.tsx +120 -1
- package/src/SearchField.tsx +53 -1
- package/src/Select.tsx +114 -22
- package/src/Separator.tsx +3 -3
- package/src/SharedElementTransition.tsx +92 -36
- package/src/StepList.tsx +0 -7
- package/src/Table.tsx +19 -4
- package/src/Tabs.tsx +1 -0
- package/src/TagGroup.tsx +26 -6
- package/src/Text.tsx +5 -4
- package/src/TextField.tsx +1 -1
- package/src/TimeField.tsx +113 -196
- package/src/Tree.tsx +14 -4
- package/src/VisuallyHidden.tsx +8 -12
- package/src/index.ts +3 -8
- package/src/useDragAndDrop.ts +8 -10
- package/src/utils.tsx +3 -3
- package/dist/DatePicker.js.map +0 -1
- package/dist/DatePicker.jsx.map +0 -1
- package/dist/HiddenTimeInput.d.ts +0 -25
- package/dist/HiddenTimeInput.d.ts.map +0 -1
- package/dist/HiddenTimeInput.js +0 -104
- package/dist/HiddenTimeInput.js.map +0 -1
- package/dist/HiddenTimeInput.jsx +0 -69
- package/dist/HiddenTimeInput.jsx.map +0 -1
- package/src/HiddenTimeInput.tsx +0 -133
package/dist/ActionBar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBar.d.ts","sourceRoot":"","sources":["../src/ActionBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,KAAK,GAAG,EACR,KAAK,WAAW,EAOjB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,SAAS,EAGf,MAAM,SAAS,CAAC;AAEjB,KAAK,OAAO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K,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,GAAG,GAAG,CAAC,OAAO,CAYxF;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,GAAG,CAAC,OAAO,CAalF"}
|
package/dist/ActionBar.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { filterDOMProps, useRenderProps } from "./utils.js";
|
|
2
2
|
import { className, createComponent, delegateEvents, effect, getNextElement, insert, mergeProps, runHydrationEvents, setAttribute, spread, style, template, use } from "solid-js/web";
|
|
3
3
|
import { Show, createContext, createEffect, createMemo, splitProps, useContext } from "solid-js";
|
|
4
|
-
import { announce
|
|
4
|
+
import { announce } from "@proyecto-viviana/solidaria";
|
|
5
5
|
//#region src/ActionBar.tsx
|
|
6
6
|
/**
|
|
7
7
|
* ActionBar component for solidaria-components
|
|
@@ -39,15 +39,6 @@ function ActionBar(props) {
|
|
|
39
39
|
]);
|
|
40
40
|
const selectedItemCount = () => local.selectedItemCount ?? 0;
|
|
41
41
|
const isOpen = () => selectedItemCount() !== 0;
|
|
42
|
-
const { toolbarProps } = createToolbar({
|
|
43
|
-
orientation: "horizontal",
|
|
44
|
-
get "aria-label"() {
|
|
45
|
-
return local["aria-label"] ?? (local["aria-labelledby"] ? void 0 : "Actions");
|
|
46
|
-
},
|
|
47
|
-
get "aria-labelledby"() {
|
|
48
|
-
return local["aria-labelledby"];
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
42
|
let wasOpen = false;
|
|
52
43
|
createEffect(() => {
|
|
53
44
|
const open = isOpen();
|
|
@@ -94,7 +85,7 @@ function ActionBar(props) {
|
|
|
94
85
|
get children() {
|
|
95
86
|
var _el$ = getNextElement(_tmpl$);
|
|
96
87
|
use((el) => assignRef(local.ref, el), _el$);
|
|
97
|
-
spread(_el$, mergeProps(filteredDOMProps,
|
|
88
|
+
spread(_el$, mergeProps(filteredDOMProps, {
|
|
98
89
|
get ["class"]() {
|
|
99
90
|
return renderProps.class();
|
|
100
91
|
},
|
package/dist/ActionBar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBar.js","names":["JSX","ParentProps","Show","createContext","createMemo","createEffect","splitProps","useContext","announce","createToolbar","Key","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","RefLike","el","T","current","assignRef","ref","ActionBarRenderProps","isOpen","selectedItemCount","ActionBarProps","Omit","HTMLAttributes","HTMLDivElement","onClearSelection","onAction","key","children","Element","class","style","onKeyDown","EventHandlerUnion","KeyboardEvent","actionsAvailableMessage","ActionBarContextValue","ActionBarContext","useActionBarContext","ActionBar","props","local","domProps","toolbarProps","orientation","aria-label","undefined","aria-labelledby","wasOpen","open","message","handleKeyDown","e","EventHandler","defaultPrevented","preventDefault","stopPropagation","renderProps","defaultClassName","filteredDOMProps","Record","global","contextValue","_$createComponent","when","Provider","value","_el$","_$getNextElement","_tmpl$","_$use","_$spread","_$mergeProps","slot","data-open","_$insert","_$runHydrationEvents","ActionBarContainerProps","CSSProperties","ActionBarContainer","_el$2","_tmpl$2","_$effect","_p$","_v$","_v$2","_$className","t","_$style","ActionBarSelectionCountProps","ActionBarSelectionCount","ctx","text","count","_el$3","_tmpl$3","ActionBarClearButtonProps","ActionBarClearButton","_el$4","_tmpl$4","$$click","_v$3","_v$4","_$setAttribute","_$delegateEvents"],"sources":["../src/ActionBar.tsx"],"sourcesContent":["/**\n * ActionBar component for solidaria-components\n *\n * Headless action bar that appears when items are selected in a collection.\n * Shows a selection count, clear button, and action buttons.\n *\n * No RAC headless equivalent — this is a thin component layer that ties\n * selection state to visibility and keyboard behavior.\n */\n\nimport {\n type JSX,\n type ParentProps,\n Show,\n createContext,\n createMemo,\n createEffect,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport { announce, createToolbar } from \"@proyecto-viviana/solidaria\";\nimport type { Key } from \"@proyecto-viviana/solid-stately\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface ActionBarRenderProps {\n /** Whether the action bar is visible. */\n isOpen: boolean;\n /** The number of selected items. */\n selectedItemCount: number | \"all\";\n}\n\nexport interface ActionBarProps\n extends\n Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\" | \"ref\" | \"slot\">,\n SlotProps {\n /** The number of selected items. ActionBar is hidden when 0. @default 0 */\n selectedItemCount?: number | \"all\";\n /** Callback when the clear button is pressed. */\n onClearSelection?: () => void;\n /** Callback when an action is triggered. */\n onAction?: (key: Key) => void;\n /** The action buttons to display. */\n children?: JSX.Element;\n /** CSS class for the container. */\n class?: ClassNameOrFunction<ActionBarRenderProps>;\n /** Inline style for the container. */\n style?: StyleOrFunction<ActionBarRenderProps>;\n /** Accessible label for the action bar. @default 'Actions' */\n \"aria-label\"?: string;\n /** Identifies the element (or elements) that labels the action bar. */\n \"aria-labelledby\"?: string;\n /** Optional keydown handler on the action bar element. */\n onKeyDown?: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent>;\n /** Screen reader announcement when the action bar becomes available. */\n actionsAvailableMessage?: string;\n /** Ref for the underlying action bar element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface ActionBarContextValue {\n selectedItemCount: () => number | \"all\";\n onClearSelection?: () => void;\n onAction?: (key: Key) => void;\n}\n\nexport const ActionBarContext = createContext<ActionBarContextValue | null>(null);\n\nexport function useActionBarContext(): ActionBarContextValue | null {\n return useContext(ActionBarContext);\n}\n\nexport function ActionBar(props: ActionBarProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"selectedItemCount\",\n \"onClearSelection\",\n \"onAction\",\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n \"aria-label\",\n \"aria-labelledby\",\n \"onKeyDown\",\n \"actionsAvailableMessage\",\n \"ref\",\n ]);\n\n const selectedItemCount = () => local.selectedItemCount ?? 0;\n const isOpen = () => selectedItemCount() !== 0;\n\n const { toolbarProps } = createToolbar({\n orientation: \"horizontal\",\n get \"aria-label\"() {\n return local[\"aria-label\"] ?? (local[\"aria-labelledby\"] ? undefined : \"Actions\");\n },\n get \"aria-labelledby\"() {\n return local[\"aria-labelledby\"];\n },\n });\n\n let wasOpen = false;\n createEffect(() => {\n const open = isOpen();\n if (open && !wasOpen) {\n const message = local.actionsAvailableMessage ?? \"Actions available.\";\n if (message) {\n announce(message);\n }\n }\n wasOpen = open;\n });\n\n const handleKeyDown: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent> = (e) => {\n const onKeyDown = local.onKeyDown as\n | JSX.EventHandler<HTMLDivElement, KeyboardEvent>\n | undefined;\n onKeyDown?.(e);\n if (e.defaultPrevented) {\n return;\n }\n\n if (e.key === \"Escape\" && isOpen()) {\n e.preventDefault();\n e.stopPropagation();\n local.onClearSelection?.();\n }\n };\n\n const renderProps = useRenderProps(\n {\n children: undefined,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ActionBar\",\n },\n () => ({\n isOpen: isOpen(),\n selectedItemCount: selectedItemCount(),\n }),\n );\n\n const filteredDOMProps = createMemo(() =>\n filterDOMProps(domProps as Record<string, unknown>, { global: true }),\n );\n\n const contextValue = createMemo<ActionBarContextValue>(() => ({\n selectedItemCount,\n onClearSelection: local.onClearSelection,\n onAction: local.onAction,\n }));\n\n return (\n <Show when={isOpen()}>\n <ActionBarContext.Provider value={contextValue()}>\n <div\n {...filteredDOMProps()}\n {...toolbarProps}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-open={isOpen() || undefined}\n onKeyDown={handleKeyDown}\n ref={(el) => assignRef(local.ref, el)}\n >\n {local.children}\n </div>\n </ActionBarContext.Provider>\n </Show>\n );\n}\n\nexport interface ActionBarContainerProps extends ParentProps {\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * Container that positions a collection and its ActionBar.\n */\nexport function ActionBarContainer(props: ActionBarContainerProps): JSX.Element {\n return (\n <div\n class={props.class ?? \"solidaria-ActionBarContainer\"}\n style={{ position: \"relative\", ...props.style }}\n >\n {props.children}\n </div>\n );\n}\n\nexport interface ActionBarSelectionCountProps {\n class?: string;\n}\n\n/**\n * Displays the count of selected items.\n */\nexport function ActionBarSelectionCount(props: ActionBarSelectionCountProps): JSX.Element {\n const ctx = useActionBarContext();\n\n const text = () => {\n if (!ctx) return \"\";\n const count = ctx.selectedItemCount();\n if (count === \"all\") return \"All selected\";\n if (count === 0) return \"None selected\";\n return `${count} selected`;\n };\n\n return <span class={props.class}>{text()}</span>;\n}\n\nexport interface ActionBarClearButtonProps {\n class?: string;\n children?: JSX.Element;\n \"aria-label\"?: string;\n}\n\n/**\n * Button to clear the current selection.\n */\nexport function ActionBarClearButton(props: ActionBarClearButtonProps): JSX.Element {\n const ctx = useActionBarContext();\n\n return (\n <button\n type=\"button\"\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n class={props.class}\n onClick={() => ctx?.onClearSelection?.()}\n >\n {props.children ?? \"\\u2715\"}\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgCA,SAASoB,UAAaC,KAAiBJ,IAAa;CAClD,IAAI,CAACI,KAAK;CACV,IAAI,OAAOA,QAAQ,YACjBA,IAAIJ,EAAE;MAENI,IAAIF,UAAUF;AAElB;AA2CA,MAAawB,mBAAmBtC,cAA4C,IAAI;AAEhF,SAAgBuC,sBAAoD;CAClE,OAA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ACxF,MAAMmD,MAAMrD,oBAAoB;CAEhC,MAAMsD,aAAa;EACjB,IAAI,CAACD,KAAK,OAAO;EACjB,MAAME,QAAQF,IAAIvE,kBAAkB;EACpC,IAAIyE,UAAU,OAAO,OAAO;EAC5B,IAAIA,UAAU,GAAG,OAAO;EACxB,OAAO,GAAGA,MAAK;CACjB;CAEA,cAAA;EAAA,IAAAC,QAAA1B,eAAA2B,OAAA;EAAApB,OAAAmB,OAAkCF,IAAI;EAAAV,aAAAI,UAAAQ,OAAlBtD,MAAMV,KAAK,CAAA;EAAA,OAAAgE;CAAA,EAAA,CAAA;AACjC;;;;AAWA,SAAgBG,qBAAqBzD,OAA+C;CAClF,MAAMmD,MAAMrD,oBAAoB;CAEhC,cAAA;EAAA,IAAA4D,QAAA9B,eAAA+B,OAAA;EAAAD,MAAAE,gBAKmBT,KAAKlE,mBAAmB;EAACkD,OAAAuB,aAEvC1D,MAAMZ,YAAY,GAAQ;EAAAsD,QAAAC,QAAA;GAAA,IAAAkB,OAJf7D,MAAM,iBAAiB,mBAAiB8D,OAC7C9D,MAAMV;GAAKuE,SAAAlB,IAAA/B,KAAAmD,aAAAL,OAAA,cAAAf,IAAA/B,IAAAiD,IAAA;GAAAC,SAAAnB,IAAAI,KAAAD,UAAAY,OAAAf,IAAAI,IAAAe,IAAA;GAAA,OAAAnB;EAAA,GAAA;GAAA/B,GAAAN,KAAAA;GAAAyC,GAAAzC,KAAAA;EAAA,CAAA;EAAA8B,mBAAA;EAAA,OAAAsB;CAAA,EAAA,CAAA;AAMxB;AAACM,eAAA,CAAA,OAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"ActionBar.js","names":["JSX","ParentProps","Show","createContext","createMemo","createEffect","splitProps","useContext","announce","Key","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","RefLike","el","T","current","assignRef","ref","ActionBarRenderProps","isOpen","selectedItemCount","ActionBarProps","Omit","HTMLAttributes","HTMLDivElement","onClearSelection","onAction","key","children","Element","class","style","onKeyDown","EventHandlerUnion","KeyboardEvent","actionsAvailableMessage","ActionBarContextValue","ActionBarContext","useActionBarContext","ActionBar","props","local","domProps","wasOpen","open","message","handleKeyDown","e","EventHandler","defaultPrevented","preventDefault","stopPropagation","renderProps","undefined","defaultClassName","filteredDOMProps","Record","global","contextValue","_$createComponent","when","Provider","value","_el$","_$getNextElement","_tmpl$","_$use","_$spread","_$mergeProps","slot","data-open","_$insert","_$runHydrationEvents","ActionBarContainerProps","CSSProperties","ActionBarContainer","_el$2","_tmpl$2","_$effect","_p$","_v$","_v$2","_$className","t","_$style","ActionBarSelectionCountProps","ActionBarSelectionCount","ctx","text","count","_el$3","_tmpl$3","ActionBarClearButtonProps","ActionBarClearButton","_el$4","_tmpl$4","$$click","_v$3","_v$4","_$setAttribute","_$delegateEvents"],"sources":["../src/ActionBar.tsx"],"sourcesContent":["/**\n * ActionBar component for solidaria-components\n *\n * Headless action bar that appears when items are selected in a collection.\n * Shows a selection count, clear button, and action buttons.\n *\n * No RAC headless equivalent — this is a thin component layer that ties\n * selection state to visibility and keyboard behavior.\n */\n\nimport {\n type JSX,\n type ParentProps,\n Show,\n createContext,\n createMemo,\n createEffect,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport { announce } from \"@proyecto-viviana/solidaria\";\nimport type { Key } from \"@proyecto-viviana/solid-stately\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface ActionBarRenderProps {\n /** Whether the action bar is visible. */\n isOpen: boolean;\n /** The number of selected items. */\n selectedItemCount: number | \"all\";\n}\n\nexport interface ActionBarProps\n extends\n Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\" | \"ref\" | \"slot\">,\n SlotProps {\n /** The number of selected items. ActionBar is hidden when 0. @default 0 */\n selectedItemCount?: number | \"all\";\n /** Callback when the clear button is pressed. */\n onClearSelection?: () => void;\n /** Callback when an action is triggered. */\n onAction?: (key: Key) => void;\n /** The action buttons to display. */\n children?: JSX.Element;\n /** CSS class for the container. */\n class?: ClassNameOrFunction<ActionBarRenderProps>;\n /** Inline style for the container. */\n style?: StyleOrFunction<ActionBarRenderProps>;\n /** Accessible label for the action bar. @default 'Actions' */\n \"aria-label\"?: string;\n /** Identifies the element (or elements) that labels the action bar. */\n \"aria-labelledby\"?: string;\n /** Optional keydown handler on the action bar element. */\n onKeyDown?: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent>;\n /** Screen reader announcement when the action bar becomes available. */\n actionsAvailableMessage?: string;\n /** Ref for the underlying action bar element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface ActionBarContextValue {\n selectedItemCount: () => number | \"all\";\n onClearSelection?: () => void;\n onAction?: (key: Key) => void;\n}\n\nexport const ActionBarContext = createContext<ActionBarContextValue | null>(null);\n\nexport function useActionBarContext(): ActionBarContextValue | null {\n return useContext(ActionBarContext);\n}\n\nexport function ActionBar(props: ActionBarProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"selectedItemCount\",\n \"onClearSelection\",\n \"onAction\",\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n \"aria-label\",\n \"aria-labelledby\",\n \"onKeyDown\",\n \"actionsAvailableMessage\",\n \"ref\",\n ]);\n\n const selectedItemCount = () => local.selectedItemCount ?? 0;\n const isOpen = () => selectedItemCount() !== 0;\n\n // Faithful to S2 `ActionBar` (ActionBar.tsx:192): the ROOT is a PLAIN\n // container with NO `role` — S2 spreads only `keyboardProps` (an Escape\n // handler that clears the selection) onto it. The single `toolbar` is the\n // inner `ActionButtonGroup` (styled layer), NOT this root. Applying\n // `createToolbar` here would (a) give the root a spurious `role=\"toolbar\"`\n // S2 never renders and (b) nest the real action toolbar inside it, forcing\n // its role to downgrade to `group`. So the root deliberately carries no\n // toolbar props — `aria-label`/`aria-labelledby` are consumed by the inner\n // ActionButtonGroup at the styled layer.\n let wasOpen = false;\n createEffect(() => {\n const open = isOpen();\n if (open && !wasOpen) {\n const message = local.actionsAvailableMessage ?? \"Actions available.\";\n if (message) {\n announce(message);\n }\n }\n wasOpen = open;\n });\n\n const handleKeyDown: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent> = (e) => {\n const onKeyDown = local.onKeyDown as\n | JSX.EventHandler<HTMLDivElement, KeyboardEvent>\n | undefined;\n onKeyDown?.(e);\n if (e.defaultPrevented) {\n return;\n }\n\n if (e.key === \"Escape\" && isOpen()) {\n e.preventDefault();\n e.stopPropagation();\n local.onClearSelection?.();\n }\n };\n\n const renderProps = useRenderProps(\n {\n children: undefined,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ActionBar\",\n },\n () => ({\n isOpen: isOpen(),\n selectedItemCount: selectedItemCount(),\n }),\n );\n\n const filteredDOMProps = createMemo(() =>\n filterDOMProps(domProps as Record<string, unknown>, { global: true }),\n );\n\n const contextValue = createMemo<ActionBarContextValue>(() => ({\n selectedItemCount,\n onClearSelection: local.onClearSelection,\n onAction: local.onAction,\n }));\n\n return (\n <Show when={isOpen()}>\n <ActionBarContext.Provider value={contextValue()}>\n <div\n {...filteredDOMProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-open={isOpen() || undefined}\n onKeyDown={handleKeyDown}\n ref={(el) => assignRef(local.ref, el)}\n >\n {local.children}\n </div>\n </ActionBarContext.Provider>\n </Show>\n );\n}\n\nexport interface ActionBarContainerProps extends ParentProps {\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * Container that positions a collection and its ActionBar.\n */\nexport function ActionBarContainer(props: ActionBarContainerProps): JSX.Element {\n return (\n <div\n class={props.class ?? \"solidaria-ActionBarContainer\"}\n style={{ position: \"relative\", ...props.style }}\n >\n {props.children}\n </div>\n );\n}\n\nexport interface ActionBarSelectionCountProps {\n class?: string;\n}\n\n/**\n * Displays the count of selected items.\n */\nexport function ActionBarSelectionCount(props: ActionBarSelectionCountProps): JSX.Element {\n const ctx = useActionBarContext();\n\n const text = () => {\n if (!ctx) return \"\";\n const count = ctx.selectedItemCount();\n if (count === \"all\") return \"All selected\";\n if (count === 0) return \"None selected\";\n return `${count} selected`;\n };\n\n return <span class={props.class}>{text()}</span>;\n}\n\nexport interface ActionBarClearButtonProps {\n class?: string;\n children?: JSX.Element;\n \"aria-label\"?: string;\n}\n\n/**\n * Button to clear the current selection.\n */\nexport function ActionBarClearButton(props: ActionBarClearButtonProps): JSX.Element {\n const ctx = useActionBarContext();\n\n return (\n <button\n type=\"button\"\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n class={props.class}\n onClick={() => ctx?.onClearSelection?.()}\n >\n {props.children ?? \"\\u2715\"}\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgCA,SAASmB,UAAaC,KAAiBJ,IAAa;CAClD,IAAI,CAACI,KAAK;CACV,IAAI,OAAOA,QAAQ,YACjBA,IAAIJ,EAAE;MAENI,IAAIF,UAAUF;AAElB;AA2CA,MAAawB,mBAAmBrC,cAA4C,IAAI;AAEhF,SAAgBsC,sBAAoD;CAClE,OAAOlC,WAAWiC,gBAAgB;AACpC;AAEA,SAAgBE,UAAUC,OAAoC;CAC5D,MAAM,CAACC,OAAOC,YAAYvC,WAAWqC,OAAO;EAC1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAK,CACN;CAED,MAAMpB,0BAA0BqB,MAAMrB,qBAAqB;CAC3D,MAAMD,eAAeC,kBAAkB,MAAM;CAW7C,IAAIuB,UAAU;CACdzC,mBAAmB;EACjB,MAAM0C,OAAOzB,OAAO;EACpB,IAAIyB,QAAQ,CAACD,SAAS;GACpB,MAAME,UAAUJ,MAAMN,2BAA2B;GACjD,IAAIU,SACFxC,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QAAA;GAAA,IAAAkB,OAJfzD,MAAM,iBAAiB,mBAAiB0D,OAC7C1D,MAAMV;GAAKmE,SAAAlB,IAAAhC,KAAAoD,aAAAL,OAAA,cAAAf,IAAAhC,IAAAkD,IAAA;GAAAC,SAAAnB,IAAAI,KAAAD,UAAAY,OAAAf,IAAAI,IAAAe,IAAA;GAAA,OAAAnB;EAAA,GAAA;GAAAhC,GAAAM,KAAAA;GAAA8B,GAAA9B,KAAAA;EAAA,CAAA;EAAAmB,mBAAA;EAAA,OAAAsB;CAAA,EAAA,CAAA;AAMxB;AAACM,eAAA,CAAA,OAAA,CAAA"}
|
package/dist/ActionBar.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { filterDOMProps, useRenderProps } from "./utils.jsx";
|
|
2
2
|
import { Show, createContext, createEffect, createMemo, splitProps, useContext } from "solid-js";
|
|
3
|
-
import { announce
|
|
3
|
+
import { announce } from "@proyecto-viviana/solidaria";
|
|
4
4
|
//#region src/ActionBar.tsx
|
|
5
5
|
/**
|
|
6
6
|
* ActionBar component for solidaria-components
|
|
@@ -37,15 +37,6 @@ function ActionBar(props) {
|
|
|
37
37
|
]);
|
|
38
38
|
const selectedItemCount = () => local.selectedItemCount ?? 0;
|
|
39
39
|
const isOpen = () => selectedItemCount() !== 0;
|
|
40
|
-
const { toolbarProps } = createToolbar({
|
|
41
|
-
orientation: "horizontal",
|
|
42
|
-
get "aria-label"() {
|
|
43
|
-
return local["aria-label"] ?? (local["aria-labelledby"] ? void 0 : "Actions");
|
|
44
|
-
},
|
|
45
|
-
get "aria-labelledby"() {
|
|
46
|
-
return local["aria-labelledby"];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
40
|
let wasOpen = false;
|
|
50
41
|
createEffect(() => {
|
|
51
42
|
const open = isOpen();
|
|
@@ -82,7 +73,7 @@ function ActionBar(props) {
|
|
|
82
73
|
}));
|
|
83
74
|
return <Show when={isOpen()}>
|
|
84
75
|
<ActionBarContext.Provider value={contextValue()}>
|
|
85
|
-
<div {...filteredDOMProps()}
|
|
76
|
+
<div {...filteredDOMProps()} class={renderProps.class()} style={renderProps.style()} slot={local.slot} data-open={isOpen() || void 0} onKeyDown={handleKeyDown} ref={(el) => assignRef(local.ref, el)}>
|
|
86
77
|
{local.children}
|
|
87
78
|
</div>
|
|
88
79
|
</ActionBarContext.Provider>
|
package/dist/ActionBar.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBar.jsx","names":[],"sources":["../src/ActionBar.tsx"],"sourcesContent":["/**\n * ActionBar component for solidaria-components\n *\n * Headless action bar that appears when items are selected in a collection.\n * Shows a selection count, clear button, and action buttons.\n *\n * No RAC headless equivalent — this is a thin component layer that ties\n * selection state to visibility and keyboard behavior.\n */\n\nimport {\n type JSX,\n type ParentProps,\n Show,\n createContext,\n createMemo,\n createEffect,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport { announce
|
|
1
|
+
{"version":3,"file":"ActionBar.jsx","names":[],"sources":["../src/ActionBar.tsx"],"sourcesContent":["/**\n * ActionBar component for solidaria-components\n *\n * Headless action bar that appears when items are selected in a collection.\n * Shows a selection count, clear button, and action buttons.\n *\n * No RAC headless equivalent — this is a thin component layer that ties\n * selection state to visibility and keyboard behavior.\n */\n\nimport {\n type JSX,\n type ParentProps,\n Show,\n createContext,\n createMemo,\n createEffect,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport { announce } from \"@proyecto-viviana/solidaria\";\nimport type { Key } from \"@proyecto-viviana/solid-stately\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface ActionBarRenderProps {\n /** Whether the action bar is visible. */\n isOpen: boolean;\n /** The number of selected items. */\n selectedItemCount: number | \"all\";\n}\n\nexport interface ActionBarProps\n extends\n Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\" | \"ref\" | \"slot\">,\n SlotProps {\n /** The number of selected items. ActionBar is hidden when 0. @default 0 */\n selectedItemCount?: number | \"all\";\n /** Callback when the clear button is pressed. */\n onClearSelection?: () => void;\n /** Callback when an action is triggered. */\n onAction?: (key: Key) => void;\n /** The action buttons to display. */\n children?: JSX.Element;\n /** CSS class for the container. */\n class?: ClassNameOrFunction<ActionBarRenderProps>;\n /** Inline style for the container. */\n style?: StyleOrFunction<ActionBarRenderProps>;\n /** Accessible label for the action bar. @default 'Actions' */\n \"aria-label\"?: string;\n /** Identifies the element (or elements) that labels the action bar. */\n \"aria-labelledby\"?: string;\n /** Optional keydown handler on the action bar element. */\n onKeyDown?: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent>;\n /** Screen reader announcement when the action bar becomes available. */\n actionsAvailableMessage?: string;\n /** Ref for the underlying action bar element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface ActionBarContextValue {\n selectedItemCount: () => number | \"all\";\n onClearSelection?: () => void;\n onAction?: (key: Key) => void;\n}\n\nexport const ActionBarContext = createContext<ActionBarContextValue | null>(null);\n\nexport function useActionBarContext(): ActionBarContextValue | null {\n return useContext(ActionBarContext);\n}\n\nexport function ActionBar(props: ActionBarProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"selectedItemCount\",\n \"onClearSelection\",\n \"onAction\",\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n \"aria-label\",\n \"aria-labelledby\",\n \"onKeyDown\",\n \"actionsAvailableMessage\",\n \"ref\",\n ]);\n\n const selectedItemCount = () => local.selectedItemCount ?? 0;\n const isOpen = () => selectedItemCount() !== 0;\n\n // Faithful to S2 `ActionBar` (ActionBar.tsx:192): the ROOT is a PLAIN\n // container with NO `role` — S2 spreads only `keyboardProps` (an Escape\n // handler that clears the selection) onto it. The single `toolbar` is the\n // inner `ActionButtonGroup` (styled layer), NOT this root. Applying\n // `createToolbar` here would (a) give the root a spurious `role=\"toolbar\"`\n // S2 never renders and (b) nest the real action toolbar inside it, forcing\n // its role to downgrade to `group`. So the root deliberately carries no\n // toolbar props — `aria-label`/`aria-labelledby` are consumed by the inner\n // ActionButtonGroup at the styled layer.\n let wasOpen = false;\n createEffect(() => {\n const open = isOpen();\n if (open && !wasOpen) {\n const message = local.actionsAvailableMessage ?? \"Actions available.\";\n if (message) {\n announce(message);\n }\n }\n wasOpen = open;\n });\n\n const handleKeyDown: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent> = (e) => {\n const onKeyDown = local.onKeyDown as\n | JSX.EventHandler<HTMLDivElement, KeyboardEvent>\n | undefined;\n onKeyDown?.(e);\n if (e.defaultPrevented) {\n return;\n }\n\n if (e.key === \"Escape\" && isOpen()) {\n e.preventDefault();\n e.stopPropagation();\n local.onClearSelection?.();\n }\n };\n\n const renderProps = useRenderProps(\n {\n children: undefined,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ActionBar\",\n },\n () => ({\n isOpen: isOpen(),\n selectedItemCount: selectedItemCount(),\n }),\n );\n\n const filteredDOMProps = createMemo(() =>\n filterDOMProps(domProps as Record<string, unknown>, { global: true }),\n );\n\n const contextValue = createMemo<ActionBarContextValue>(() => ({\n selectedItemCount,\n onClearSelection: local.onClearSelection,\n onAction: local.onAction,\n }));\n\n return (\n <Show when={isOpen()}>\n <ActionBarContext.Provider value={contextValue()}>\n <div\n {...filteredDOMProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-open={isOpen() || undefined}\n onKeyDown={handleKeyDown}\n ref={(el) => assignRef(local.ref, el)}\n >\n {local.children}\n </div>\n </ActionBarContext.Provider>\n </Show>\n );\n}\n\nexport interface ActionBarContainerProps extends ParentProps {\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * Container that positions a collection and its ActionBar.\n */\nexport function ActionBarContainer(props: ActionBarContainerProps): JSX.Element {\n return (\n <div\n class={props.class ?? \"solidaria-ActionBarContainer\"}\n style={{ position: \"relative\", ...props.style }}\n >\n {props.children}\n </div>\n );\n}\n\nexport interface ActionBarSelectionCountProps {\n class?: string;\n}\n\n/**\n * Displays the count of selected items.\n */\nexport function ActionBarSelectionCount(props: ActionBarSelectionCountProps): JSX.Element {\n const ctx = useActionBarContext();\n\n const text = () => {\n if (!ctx) return \"\";\n const count = ctx.selectedItemCount();\n if (count === \"all\") return \"All selected\";\n if (count === 0) return \"None selected\";\n return `${count} selected`;\n };\n\n return <span class={props.class}>{text()}</span>;\n}\n\nexport interface ActionBarClearButtonProps {\n class?: string;\n children?: JSX.Element;\n \"aria-label\"?: string;\n}\n\n/**\n * Button to clear the current selection.\n */\nexport function ActionBarClearButton(props: ActionBarClearButtonProps): JSX.Element {\n const ctx = useActionBarContext();\n\n return (\n <button\n type=\"button\"\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n class={props.class}\n onClick={() => ctx?.onClearSelection?.()}\n >\n {props.children ?? \"\\u2715\"}\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAgCA,SAAS,UAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KAAK;CACV,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AA2CA,MAAa,mBAAmB,cAA4C,IAAI;AAEhF,SAAgB,sBAAoD;CAClE,OAAO,WAAW,gBAAgB;AACpC;AAEA,SAAgB,UAAU,OAAoC;CAC5D,MAAM,CAAC,OAAO,YAAY,WAAW,OAAO;EAC1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,0BAA0B,MAAM,qBAAqB;CAC3D,MAAM,eAAe,kBAAkB,MAAM;CAW7C,IAAI,UAAU;CACd,mBAAmB;EACjB,MAAM,OAAO,OAAO;EACpB,IAAI,QAAQ,CAAC,S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AAC,CAAC,GACzB,GAAG,CAAC,OAAO,CA0Hb;AAiDD,wBAAgB,qBAAqB,IAAI,uBAAuB,GAAG,IAAI,CAEtE"}
|
package/dist/ActionGroup.js
CHANGED
|
@@ -151,7 +151,7 @@ function ActionGroupItemWrapper(props) {
|
|
|
151
151
|
isDisabled: isDisabled(),
|
|
152
152
|
isFocused: isFocused()
|
|
153
153
|
}));
|
|
154
|
-
const
|
|
154
|
+
const [, restButtonProps] = splitProps(buttonProps, ["ref"]);
|
|
155
155
|
return (() => {
|
|
156
156
|
var _el$2 = getNextElement(_tmpl$2);
|
|
157
157
|
spread(_el$2, mergeProps(restButtonProps, {
|
package/dist/ActionGroup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionGroup.js","names":["JSX","ParentProps","createContext","createMemo","splitProps","useContext","For","createActionGroup","createActionGroupItem","AriaActionGroupProps","createListState","ListState","Key","SelectionMode","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","ActionGroupRenderProps","orientation","isDisabled","selectionMode","ActionGroupItemRenderProps","isSelected","isFocused","ActionGroupItem","id","label","key","ActionGroupProps","items","T","selectedKeys","Iterable","defaultSelectedKeys","onSelectionChange","keys","Set","onAction","disabledKeys","children","item","renderProps","Element","class","style","ActionGroupContextValue","state","ActionGroupContext","ActionGroupStateContext","ActionGroup","props","local","ariaGroupProps","domProps","getKey","getTextValue","getDisabled","groupAriaProps","aria-label","aria-labelledby","actionGroupProps","undefined","defaultClassName","filteredDOMProps","Record","global","_$createComponent","Provider","value","_el$","_$getNextElement","_tmpl$","_$use","el","HTMLDivElement","refFn","ref","HTMLElement","_$spread","_$mergeProps","slot","data-orientation","data-disabled","_$insert","each","ActionGroupItemWrapper","renderChild","rp","_$runHydrationEvents","ActionGroupItemWrapperProps","buttonProps","focusedKey","has","_ref","restButtonProps","_el$2","_tmpl$2","data-selected","data-focused","useActionGroupContext"],"sources":["../src/ActionGroup.tsx"],"sourcesContent":["/**\n * ActionGroup component for solidaria-components\n *\n * Pre-wired headless action group component that combines\n * createListState + createActionGroup/createActionGroupItem.\n * Provides proper dynamic roles (toolbar/radiogroup), keyboard\n * navigation, and ARIA attributes.\n *\n * No RAC equivalent exists — this bridges solidaria ARIA hooks\n * directly to a headless component.\n */\n\nimport {\n type JSX,\n type ParentProps,\n createContext,\n createMemo,\n splitProps,\n useContext,\n For,\n} from \"solid-js\";\nimport {\n createActionGroup,\n createActionGroupItem,\n type AriaActionGroupProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createListState,\n type ListState,\n type Key,\n type SelectionMode,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface ActionGroupRenderProps {\n /** The orientation of the action group. */\n orientation: \"horizontal\" | \"vertical\";\n /** Whether the entire group is disabled. */\n isDisabled: boolean;\n /** The selection mode. */\n selectionMode: SelectionMode;\n}\n\nexport interface ActionGroupItemRenderProps {\n /** Whether the item is selected. */\n isSelected: boolean;\n /** Whether the item is disabled. */\n isDisabled: boolean;\n /** Whether the item is focused. */\n isFocused: boolean;\n}\n\nexport interface ActionGroupItem {\n id: string;\n label: string;\n isDisabled?: boolean;\n [key: string]: unknown;\n}\n\nexport interface ActionGroupProps<T extends ActionGroupItem = ActionGroupItem> extends SlotProps {\n /** The items in the action group. */\n items: T[];\n /** The selection mode. @default 'none' */\n selectionMode?: SelectionMode;\n /** Orientation of the group. @default 'horizontal' */\n orientation?: \"horizontal\" | \"vertical\";\n /** Whether the entire group is disabled. */\n isDisabled?: boolean;\n /** Accessible label. */\n \"aria-label\"?: string;\n /** Labelled-by id. */\n \"aria-labelledby\"?: string;\n /** Currently selected keys (controlled). */\n selectedKeys?: Iterable<Key>;\n /** Default selected keys (uncontrolled). */\n defaultSelectedKeys?: Iterable<Key>;\n /** Handler called when selection changes. */\n onSelectionChange?: (keys: \"all\" | Set<Key>) => void;\n /** Handler called when an item action is triggered. */\n onAction?: (key: Key) => void;\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Render function for each item. */\n children: (item: T, renderProps: ActionGroupItemRenderProps) => JSX.Element;\n /** CSS class for the container. */\n class?: ClassNameOrFunction<ActionGroupRenderProps>;\n /** Inline style for the container. */\n style?: StyleOrFunction<ActionGroupRenderProps>;\n}\n\nexport interface ActionGroupContextValue<T extends ActionGroupItem = ActionGroupItem> {\n state: ListState<T>;\n}\n\nexport const ActionGroupContext = createContext<ActionGroupContextValue | null>(null);\nexport const ActionGroupStateContext = createContext<ListState<ActionGroupItem> | null>(null);\n\nexport function ActionGroup<T extends ActionGroupItem = ActionGroupItem>(\n props: ActionGroupProps<T>,\n): JSX.Element {\n const [local, ariaGroupProps, domProps] = splitProps(\n props,\n [\n \"items\",\n \"selectionMode\",\n \"orientation\",\n \"isDisabled\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"onAction\",\n \"disabledKeys\",\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n ],\n [\"aria-label\", \"aria-labelledby\"],\n );\n\n const state = createListState<T>({\n get items() {\n return local.items;\n },\n get selectionMode() {\n return local.selectionMode ?? \"none\";\n },\n get selectedKeys() {\n return local.selectedKeys;\n },\n get defaultSelectedKeys() {\n return local.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return local.onSelectionChange;\n },\n get disabledKeys() {\n return local.disabledKeys;\n },\n getKey: (item) => item.id,\n getTextValue: (item) => item.label,\n getDisabled: (item) => !!item.isDisabled,\n });\n\n const groupAriaProps: AriaActionGroupProps<T> = {\n get items() {\n return local.items;\n },\n get isDisabled() {\n return local.isDisabled;\n },\n get orientation() {\n return local.orientation;\n },\n get \"aria-label\"() {\n return ariaGroupProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaGroupProps[\"aria-labelledby\"];\n },\n get onAction() {\n return local.onAction;\n },\n };\n\n const { actionGroupProps } = createActionGroup(groupAriaProps, state as ListState<T>);\n\n const orientation = () => local.orientation ?? \"horizontal\";\n\n const renderProps = useRenderProps(\n {\n children: undefined,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ActionGroup\",\n },\n () => ({\n orientation: orientation(),\n isDisabled: !!local.isDisabled,\n selectionMode: (local.selectionMode ?? \"none\") as SelectionMode,\n }),\n );\n\n const filteredDOMProps = createMemo(() =>\n filterDOMProps(domProps as Record<string, unknown>, { global: true }),\n );\n\n return (\n <ActionGroupContext.Provider value={{ state: state as ListState<ActionGroupItem> }}>\n <ActionGroupStateContext.Provider value={state as ListState<ActionGroupItem>}>\n <div\n {...filteredDOMProps()}\n {...actionGroupProps}\n ref={(el: HTMLDivElement) => {\n const refFn = (actionGroupProps as { ref?: (el: HTMLElement) => void }).ref;\n refFn?.(el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-orientation={orientation()}\n data-disabled={local.isDisabled || undefined}\n >\n <For each={local.items}>\n {(item) => (\n <ActionGroupItemWrapper\n item={item}\n state={state as ListState<ActionGroupItem>}\n renderChild={\n local.children as (\n item: ActionGroupItem,\n rp: ActionGroupItemRenderProps,\n ) => JSX.Element\n }\n />\n )}\n </For>\n </div>\n </ActionGroupStateContext.Provider>\n </ActionGroupContext.Provider>\n );\n}\n\ninterface ActionGroupItemWrapperProps {\n item: ActionGroupItem;\n state: ListState<ActionGroupItem>;\n renderChild: (item: ActionGroupItem, renderProps: ActionGroupItemRenderProps) => JSX.Element;\n}\n\nfunction ActionGroupItemWrapper(props: ActionGroupItemWrapperProps): JSX.Element {\n const { buttonProps } = createActionGroupItem(\n {\n get key() {\n return props.item.id;\n },\n },\n props.state,\n );\n\n const isFocused = () => props.state.focusedKey() === props.item.id;\n const isSelected = () => {\n const keys = props.state.selectedKeys();\n return keys === \"all\" || (keys instanceof Set && keys.has(props.item.id));\n };\n const isDisabled = () => props.state.isDisabled(props.item.id);\n\n const renderProps = createMemo<ActionGroupItemRenderProps>(() => ({\n isSelected: isSelected(),\n isDisabled: isDisabled(),\n isFocused: isFocused(),\n }));\n\n const { ref: _ref, ...restButtonProps } = buttonProps as Record<string, unknown> & {\n ref?: unknown;\n };\n\n return (\n <button\n {...restButtonProps}\n data-selected={isSelected() || undefined}\n data-disabled={isDisabled() || undefined}\n data-focused={isFocused() || undefined}\n >\n {props.renderChild(props.item, renderProps())}\n </button>\n );\n}\n\nexport function useActionGroupContext(): ActionGroupContextValue | null {\n return useContext(ActionGroupContext);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAoGA,MAAaiD,qBAAqB/C,cAA8C,IAAI;AACpF,MAAagD,0BAA0BhD,cAAiD,IAAI;AAE5F,SAAgBiD,YACdC,OACa;CACb,MAAM,CAACC,OAAOC,gBAAgBC,YAAYnD,WACxCgD,OACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAM,GAER,CAAC,cAAc,iBAAiB,CAClC;CAEA,MAAMJ,QAAQtC,gBAAmB;EAC/B,IAAIqB,QAAQ;GACV,OAAOsB,MAAMtB;EACf;EACA,IAAIT,gBAAgB;GAClB,OAAO+B,MAAM/B,iBAAiB;EAChC;EACA,IAAIW,eAAe;GACjB,OAAOoB,MAAMpB;EACf;EACA,IAAIE,sBAAsB;GACxB,OAAOkB,MAAMlB;EACf;EACA,IAAIC,oBAAoB;GACtB,OAAOiB,MAAMjB;EACf;EACA,IAAII,eAAe;GACjB,OAAOa,MAAMb;EACf;EACAgB,SAASd,SAASA,KAAKf;EACvB8B,eAAef,SAASA,KAAKd;EAC7B8B,cAAchB,SAAS,CAAC,CAACA,KAAKrB;CAChC,CAAC;CAuBD,MAAM,EAAEyC,qBAAqBvD,kBAAkBoD;EApB7C,IAAI5B,QAAQ;GACV,OAAOsB,MAAMtB;EACf;EACA,IAAIV,aAAa;GACf,OAAOgC,MAAMhC;EACf;EACA,IAAID,cAAc;GAChB,OAAOiC,MAAMjC;EACf;EAC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,wBAAwD;CACtE,OAAOhG,WAAW4C,kBAAkB;AACtC"}
|
|
1
|
+
{"version":3,"file":"ActionGroup.js","names":["JSX","ParentProps","createContext","createMemo","splitProps","useContext","For","createActionGroup","createActionGroupItem","AriaActionGroupProps","createListState","ListState","Key","SelectionMode","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","ActionGroupRenderProps","orientation","isDisabled","selectionMode","ActionGroupItemRenderProps","isSelected","isFocused","ActionGroupItem","id","label","key","ActionGroupProps","items","T","selectedKeys","Iterable","defaultSelectedKeys","onSelectionChange","keys","Set","onAction","disabledKeys","children","item","renderProps","Element","class","style","ActionGroupContextValue","state","ActionGroupContext","ActionGroupStateContext","ActionGroup","props","local","ariaGroupProps","domProps","getKey","getTextValue","getDisabled","groupAriaProps","aria-label","aria-labelledby","actionGroupProps","undefined","defaultClassName","filteredDOMProps","Record","global","_$createComponent","Provider","value","_el$","_$getNextElement","_tmpl$","_$use","el","HTMLDivElement","refFn","ref","HTMLElement","_$spread","_$mergeProps","slot","data-orientation","data-disabled","_$insert","each","ActionGroupItemWrapper","renderChild","rp","_$runHydrationEvents","ActionGroupItemWrapperProps","buttonProps","focusedKey","has","restButtonProps","_el$2","_tmpl$2","data-selected","data-focused","useActionGroupContext"],"sources":["../src/ActionGroup.tsx"],"sourcesContent":["/**\n * ActionGroup component for solidaria-components\n *\n * Pre-wired headless action group component that combines\n * createListState + createActionGroup/createActionGroupItem.\n * Provides proper dynamic roles (toolbar/radiogroup), keyboard\n * navigation, and ARIA attributes.\n *\n * No RAC equivalent exists — this bridges solidaria ARIA hooks\n * directly to a headless component.\n */\n\nimport {\n type JSX,\n type ParentProps,\n createContext,\n createMemo,\n splitProps,\n useContext,\n For,\n} from \"solid-js\";\nimport {\n createActionGroup,\n createActionGroupItem,\n type AriaActionGroupProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createListState,\n type ListState,\n type Key,\n type SelectionMode,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface ActionGroupRenderProps {\n /** The orientation of the action group. */\n orientation: \"horizontal\" | \"vertical\";\n /** Whether the entire group is disabled. */\n isDisabled: boolean;\n /** The selection mode. */\n selectionMode: SelectionMode;\n}\n\nexport interface ActionGroupItemRenderProps {\n /** Whether the item is selected. */\n isSelected: boolean;\n /** Whether the item is disabled. */\n isDisabled: boolean;\n /** Whether the item is focused. */\n isFocused: boolean;\n}\n\nexport interface ActionGroupItem {\n id: string;\n label: string;\n isDisabled?: boolean;\n [key: string]: unknown;\n}\n\nexport interface ActionGroupProps<T extends ActionGroupItem = ActionGroupItem> extends SlotProps {\n /** The items in the action group. */\n items: T[];\n /** The selection mode. @default 'none' */\n selectionMode?: SelectionMode;\n /** Orientation of the group. @default 'horizontal' */\n orientation?: \"horizontal\" | \"vertical\";\n /** Whether the entire group is disabled. */\n isDisabled?: boolean;\n /** Accessible label. */\n \"aria-label\"?: string;\n /** Labelled-by id. */\n \"aria-labelledby\"?: string;\n /** Currently selected keys (controlled). */\n selectedKeys?: Iterable<Key>;\n /** Default selected keys (uncontrolled). */\n defaultSelectedKeys?: Iterable<Key>;\n /** Handler called when selection changes. */\n onSelectionChange?: (keys: \"all\" | Set<Key>) => void;\n /** Handler called when an item action is triggered. */\n onAction?: (key: Key) => void;\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Render function for each item. */\n children: (item: T, renderProps: ActionGroupItemRenderProps) => JSX.Element;\n /** CSS class for the container. */\n class?: ClassNameOrFunction<ActionGroupRenderProps>;\n /** Inline style for the container. */\n style?: StyleOrFunction<ActionGroupRenderProps>;\n}\n\nexport interface ActionGroupContextValue<T extends ActionGroupItem = ActionGroupItem> {\n state: ListState<T>;\n}\n\nexport const ActionGroupContext = createContext<ActionGroupContextValue | null>(null);\nexport const ActionGroupStateContext = createContext<ListState<ActionGroupItem> | null>(null);\n\nexport function ActionGroup<T extends ActionGroupItem = ActionGroupItem>(\n props: ActionGroupProps<T>,\n): JSX.Element {\n const [local, ariaGroupProps, domProps] = splitProps(\n props,\n [\n \"items\",\n \"selectionMode\",\n \"orientation\",\n \"isDisabled\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"onAction\",\n \"disabledKeys\",\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n ],\n [\"aria-label\", \"aria-labelledby\"],\n );\n\n const state = createListState<T>({\n get items() {\n return local.items;\n },\n get selectionMode() {\n return local.selectionMode ?? \"none\";\n },\n get selectedKeys() {\n return local.selectedKeys;\n },\n get defaultSelectedKeys() {\n return local.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return local.onSelectionChange;\n },\n get disabledKeys() {\n return local.disabledKeys;\n },\n getKey: (item) => item.id,\n getTextValue: (item) => item.label,\n getDisabled: (item) => !!item.isDisabled,\n });\n\n const groupAriaProps: AriaActionGroupProps<T> = {\n get items() {\n return local.items;\n },\n get isDisabled() {\n return local.isDisabled;\n },\n get orientation() {\n return local.orientation;\n },\n get \"aria-label\"() {\n return ariaGroupProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaGroupProps[\"aria-labelledby\"];\n },\n get onAction() {\n return local.onAction;\n },\n };\n\n const { actionGroupProps } = createActionGroup(groupAriaProps, state as ListState<T>);\n\n const orientation = () => local.orientation ?? \"horizontal\";\n\n const renderProps = useRenderProps(\n {\n children: undefined,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ActionGroup\",\n },\n () => ({\n orientation: orientation(),\n isDisabled: !!local.isDisabled,\n selectionMode: (local.selectionMode ?? \"none\") as SelectionMode,\n }),\n );\n\n const filteredDOMProps = createMemo(() =>\n filterDOMProps(domProps as Record<string, unknown>, { global: true }),\n );\n\n return (\n <ActionGroupContext.Provider value={{ state: state as ListState<ActionGroupItem> }}>\n <ActionGroupStateContext.Provider value={state as ListState<ActionGroupItem>}>\n <div\n {...filteredDOMProps()}\n {...actionGroupProps}\n ref={(el: HTMLDivElement) => {\n const refFn = (actionGroupProps as { ref?: (el: HTMLElement) => void }).ref;\n refFn?.(el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-orientation={orientation()}\n data-disabled={local.isDisabled || undefined}\n >\n <For each={local.items}>\n {(item) => (\n <ActionGroupItemWrapper\n item={item}\n state={state as ListState<ActionGroupItem>}\n renderChild={\n local.children as (\n item: ActionGroupItem,\n rp: ActionGroupItemRenderProps,\n ) => JSX.Element\n }\n />\n )}\n </For>\n </div>\n </ActionGroupStateContext.Provider>\n </ActionGroupContext.Provider>\n );\n}\n\ninterface ActionGroupItemWrapperProps {\n item: ActionGroupItem;\n state: ListState<ActionGroupItem>;\n renderChild: (item: ActionGroupItem, renderProps: ActionGroupItemRenderProps) => JSX.Element;\n}\n\nfunction ActionGroupItemWrapper(props: ActionGroupItemWrapperProps): JSX.Element {\n const { buttonProps } = createActionGroupItem(\n {\n get key() {\n return props.item.id;\n },\n },\n props.state,\n );\n\n const isFocused = () => props.state.focusedKey() === props.item.id;\n const isSelected = () => {\n const keys = props.state.selectedKeys();\n return keys === \"all\" || (keys instanceof Set && keys.has(props.item.id));\n };\n const isDisabled = () => props.state.isDisabled(props.item.id);\n\n const renderProps = createMemo<ActionGroupItemRenderProps>(() => ({\n isSelected: isSelected(),\n isDisabled: isDisabled(),\n isFocused: isFocused(),\n }));\n\n // splitProps (not object destructuring) so the reactive getters on buttonProps\n // — tabIndex (roving stop), onFocus (sets the focused key), role, aria-checked\n // — stay live. A rest-spread `{ ref, ...rest }` would FREEZE them at their\n // first-render values, pinning the roving tabIndex and killing focus tracking.\n const [, restButtonProps] = splitProps(buttonProps, [\"ref\"]);\n\n return (\n <button\n {...restButtonProps}\n data-selected={isSelected() || undefined}\n data-disabled={isDisabled() || undefined}\n data-focused={isFocused() || undefined}\n >\n {props.renderChild(props.item, renderProps())}\n </button>\n );\n}\n\nexport function useActionGroupContext(): ActionGroupContextValue | null {\n return useContext(ActionGroupContext);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAoGA,MAAaiD,qBAAqB/C,cAA8C,IAAI;AACpF,MAAagD,0BAA0BhD,cAAiD,IAAI;AAE5F,SAAgBiD,YACdC,OACa;CACb,MAAM,CAACC,OAAOC,gBAAgBC,YAAYnD,WACxCgD,OACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAM,GAER,CAAC,cAAc,iBAAiB,CAClC;CAEA,MAAMJ,QAAQtC,gBAAmB;EAC/B,IAAIqB,QAAQ;GACV,OAAOsB,MAAMtB;EACf;EACA,IAAIT,gBAAgB;GAClB,OAAO+B,MAAM/B,iBAAiB;EAChC;EACA,IAAIW,eAAe;GACjB,OAAOoB,MAAMpB;EACf;EACA,IAAIE,sBAAsB;GACxB,OAAOkB,MAAMlB;EACf;EACA,IAAIC,oBAAoB;GACtB,OAAOiB,MAAMjB;EACf;EACA,IAAII,eAAe;GACjB,OAAOa,MAAMb;EACf;EACAgB,SAASd,SAASA,KAAKf;EACvB8B,eAAef,SAASA,KAAKd;EAC7B8B,cAAchB,SAAS,CAAC,CAACA,KAAKrB;CAChC,CAAC;CAuBD,MAAM,EAAEyC,qBAAqBvD,kBAAkBoD;EApB7C,IAAI5B,QAAQ;GACV,OAAOsB,MAAMtB;EACf;EACA,IAAIV,aAAa;GACf,OAAOgC,MAAMhC;EACf;EACA,IAAID,cAAc;GAChB,OAAOiC,MAAMjC;EACf;EACA,IAAI,eAAe;GACjB,OAAOkC,eAAe;EACxB;EACA,IAAI,oBAAoB;GACtB,OAAOA,eAAe;EACxB;EACA,IAAIf,WAAW;GACb,OAAOc,MAAMd;EACf;CAG6CoB,GAAgBX,KAAqB;CAEpF,MAAM5B,oBAAoBiC,MAAMjC,eAAe;CAE/C,MAAMuB,cAAc1B,eAClB;EACEwB,UAAUsB,KAAAA;EACVlB,OAAOQ,MAAMR;EACbC,OAAO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ACR,OAAOuB,MAAMV,KAAKf;CACpB,EACF,GACAyB,MAAMJ,KACR;CAEA,MAAMvB,kBAAkB2B,MAAMJ,MAAM6C,WAAW,MAAMzC,MAAMV,KAAKf;CAChE,MAAMH,mBAAmB;EACvB,MAAMa,OAAOe,MAAMJ,MAAMf,aAAa;EACtC,OAAOI,SAAS,SAAUA,gBAAgBC,OAAOD,KAAKyD,IAAI1C,MAAMV,KAAKf,EAAE;CACzE;CACA,MAAMN,mBAAmB+B,MAAMJ,MAAM3B,WAAW+B,MAAMV,KAAKf,EAAE;CAE7D,MAAMgB,cAAcxC,kBAA8C;EAChEqB,YAAYA,WAAW;EACvBH,YAAYA,WAAW;EACvBI,WAAWA,UAAU;CACvB,EAAE;CAMF,MAAM,GAAGsE,mBAAmB3F,WAAWwF,aAAa,CAAC,KAAK,CAAC;CAE3D,cAAA;EAAA,IAAAI,QAAAxB,eAAAyB,OAAA;EAAAjB,OAAAgB,OAAAf,WAEQc,iBAAe;GAAA,KAAA,mBAAA;IAAA,OACJvE,WAAW,KAAKuC,KAAAA;GAAS;GAAA,KAAA,mBAAA;IAAA,OACzB1C,WAAW,KAAK0C,KAAAA;GAAS;GAAA,KAAA,kBAAA;IAAA,OAC1BtC,UAAU,KAAKsC,KAAAA;GAAS;EAAA,CAAA,GAAA,OAAA,IAAA;EAAAsB,OAAAW,aAErC5C,MAAMoC,YAAYpC,MAAMV,MAAMC,YAAY,CAAC,CAAC;EAAA+C,mBAAA;EAAA,OAAAM;CAAA,EAAA,CAAA;AAGnD;AAEA,SAAgBI,wBAAwD;CACtE,OAAO/F,WAAW4C,kBAAkB;AACtC"}
|
package/dist/ActionGroup.jsx
CHANGED
|
@@ -115,7 +115,7 @@ function ActionGroupItemWrapper(props) {
|
|
|
115
115
|
isDisabled: isDisabled(),
|
|
116
116
|
isFocused: isFocused()
|
|
117
117
|
}));
|
|
118
|
-
const
|
|
118
|
+
const [, restButtonProps] = splitProps(buttonProps, ["ref"]);
|
|
119
119
|
return <button {...restButtonProps} data-selected={isSelected() || void 0} data-disabled={isDisabled() || void 0} data-focused={isFocused() || void 0}>
|
|
120
120
|
{props.renderChild(props.item, renderProps())}
|
|
121
121
|
</button>;
|
package/dist/ActionGroup.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionGroup.jsx","names":[],"sources":["../src/ActionGroup.tsx"],"sourcesContent":["/**\n * ActionGroup component for solidaria-components\n *\n * Pre-wired headless action group component that combines\n * createListState + createActionGroup/createActionGroupItem.\n * Provides proper dynamic roles (toolbar/radiogroup), keyboard\n * navigation, and ARIA attributes.\n *\n * No RAC equivalent exists — this bridges solidaria ARIA hooks\n * directly to a headless component.\n */\n\nimport {\n type JSX,\n type ParentProps,\n createContext,\n createMemo,\n splitProps,\n useContext,\n For,\n} from \"solid-js\";\nimport {\n createActionGroup,\n createActionGroupItem,\n type AriaActionGroupProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createListState,\n type ListState,\n type Key,\n type SelectionMode,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface ActionGroupRenderProps {\n /** The orientation of the action group. */\n orientation: \"horizontal\" | \"vertical\";\n /** Whether the entire group is disabled. */\n isDisabled: boolean;\n /** The selection mode. */\n selectionMode: SelectionMode;\n}\n\nexport interface ActionGroupItemRenderProps {\n /** Whether the item is selected. */\n isSelected: boolean;\n /** Whether the item is disabled. */\n isDisabled: boolean;\n /** Whether the item is focused. */\n isFocused: boolean;\n}\n\nexport interface ActionGroupItem {\n id: string;\n label: string;\n isDisabled?: boolean;\n [key: string]: unknown;\n}\n\nexport interface ActionGroupProps<T extends ActionGroupItem = ActionGroupItem> extends SlotProps {\n /** The items in the action group. */\n items: T[];\n /** The selection mode. @default 'none' */\n selectionMode?: SelectionMode;\n /** Orientation of the group. @default 'horizontal' */\n orientation?: \"horizontal\" | \"vertical\";\n /** Whether the entire group is disabled. */\n isDisabled?: boolean;\n /** Accessible label. */\n \"aria-label\"?: string;\n /** Labelled-by id. */\n \"aria-labelledby\"?: string;\n /** Currently selected keys (controlled). */\n selectedKeys?: Iterable<Key>;\n /** Default selected keys (uncontrolled). */\n defaultSelectedKeys?: Iterable<Key>;\n /** Handler called when selection changes. */\n onSelectionChange?: (keys: \"all\" | Set<Key>) => void;\n /** Handler called when an item action is triggered. */\n onAction?: (key: Key) => void;\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Render function for each item. */\n children: (item: T, renderProps: ActionGroupItemRenderProps) => JSX.Element;\n /** CSS class for the container. */\n class?: ClassNameOrFunction<ActionGroupRenderProps>;\n /** Inline style for the container. */\n style?: StyleOrFunction<ActionGroupRenderProps>;\n}\n\nexport interface ActionGroupContextValue<T extends ActionGroupItem = ActionGroupItem> {\n state: ListState<T>;\n}\n\nexport const ActionGroupContext = createContext<ActionGroupContextValue | null>(null);\nexport const ActionGroupStateContext = createContext<ListState<ActionGroupItem> | null>(null);\n\nexport function ActionGroup<T extends ActionGroupItem = ActionGroupItem>(\n props: ActionGroupProps<T>,\n): JSX.Element {\n const [local, ariaGroupProps, domProps] = splitProps(\n props,\n [\n \"items\",\n \"selectionMode\",\n \"orientation\",\n \"isDisabled\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"onAction\",\n \"disabledKeys\",\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n ],\n [\"aria-label\", \"aria-labelledby\"],\n );\n\n const state = createListState<T>({\n get items() {\n return local.items;\n },\n get selectionMode() {\n return local.selectionMode ?? \"none\";\n },\n get selectedKeys() {\n return local.selectedKeys;\n },\n get defaultSelectedKeys() {\n return local.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return local.onSelectionChange;\n },\n get disabledKeys() {\n return local.disabledKeys;\n },\n getKey: (item) => item.id,\n getTextValue: (item) => item.label,\n getDisabled: (item) => !!item.isDisabled,\n });\n\n const groupAriaProps: AriaActionGroupProps<T> = {\n get items() {\n return local.items;\n },\n get isDisabled() {\n return local.isDisabled;\n },\n get orientation() {\n return local.orientation;\n },\n get \"aria-label\"() {\n return ariaGroupProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaGroupProps[\"aria-labelledby\"];\n },\n get onAction() {\n return local.onAction;\n },\n };\n\n const { actionGroupProps } = createActionGroup(groupAriaProps, state as ListState<T>);\n\n const orientation = () => local.orientation ?? \"horizontal\";\n\n const renderProps = useRenderProps(\n {\n children: undefined,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ActionGroup\",\n },\n () => ({\n orientation: orientation(),\n isDisabled: !!local.isDisabled,\n selectionMode: (local.selectionMode ?? \"none\") as SelectionMode,\n }),\n );\n\n const filteredDOMProps = createMemo(() =>\n filterDOMProps(domProps as Record<string, unknown>, { global: true }),\n );\n\n return (\n <ActionGroupContext.Provider value={{ state: state as ListState<ActionGroupItem> }}>\n <ActionGroupStateContext.Provider value={state as ListState<ActionGroupItem>}>\n <div\n {...filteredDOMProps()}\n {...actionGroupProps}\n ref={(el: HTMLDivElement) => {\n const refFn = (actionGroupProps as { ref?: (el: HTMLElement) => void }).ref;\n refFn?.(el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-orientation={orientation()}\n data-disabled={local.isDisabled || undefined}\n >\n <For each={local.items}>\n {(item) => (\n <ActionGroupItemWrapper\n item={item}\n state={state as ListState<ActionGroupItem>}\n renderChild={\n local.children as (\n item: ActionGroupItem,\n rp: ActionGroupItemRenderProps,\n ) => JSX.Element\n }\n />\n )}\n </For>\n </div>\n </ActionGroupStateContext.Provider>\n </ActionGroupContext.Provider>\n );\n}\n\ninterface ActionGroupItemWrapperProps {\n item: ActionGroupItem;\n state: ListState<ActionGroupItem>;\n renderChild: (item: ActionGroupItem, renderProps: ActionGroupItemRenderProps) => JSX.Element;\n}\n\nfunction ActionGroupItemWrapper(props: ActionGroupItemWrapperProps): JSX.Element {\n const { buttonProps } = createActionGroupItem(\n {\n get key() {\n return props.item.id;\n },\n },\n props.state,\n );\n\n const isFocused = () => props.state.focusedKey() === props.item.id;\n const isSelected = () => {\n const keys = props.state.selectedKeys();\n return keys === \"all\" || (keys instanceof Set && keys.has(props.item.id));\n };\n const isDisabled = () => props.state.isDisabled(props.item.id);\n\n const renderProps = createMemo<ActionGroupItemRenderProps>(() => ({\n isSelected: isSelected(),\n isDisabled: isDisabled(),\n isFocused: isFocused(),\n }));\n\n const { ref: _ref, ...restButtonProps } = buttonProps as Record<string, unknown> & {\n ref?: unknown;\n };\n\n return (\n <button\n {...restButtonProps}\n data-selected={isSelected() || undefined}\n data-disabled={isDisabled() || undefined}\n data-focused={isFocused() || undefined}\n >\n {props.renderChild(props.item, renderProps())}\n </button>\n );\n}\n\nexport function useActionGroupContext(): ActionGroupContextValue | null {\n return useContext(ActionGroupContext);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAoGA,MAAa,qBAAqB,cAA8C,IAAI;AACpF,MAAa,0BAA0B,cAAiD,IAAI;AAE5F,SAAgB,YACd,OACa;CACb,MAAM,CAAC,OAAO,gBAAgB,YAAY,WACxC,OACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,GACA,CAAC,cAAc,iBAAiB,CAClC;CAEA,MAAM,QAAQ,gBAAmB;EAC/B,IAAI,QAAQ;GACV,OAAO,MAAM;EACf;EACA,IAAI,gBAAgB;GAClB,OAAO,MAAM,iBAAiB;EAChC;EACA,IAAI,eAAe;GACjB,OAAO,MAAM;EACf;EACA,IAAI,sBAAsB;GACxB,OAAO,MAAM;EACf;EACA,IAAI,oBAAoB;GACtB,OAAO,MAAM;EACf;EACA,IAAI,eAAe;GACjB,OAAO,MAAM;EACf;EACA,SAAS,SAAS,KAAK;EACvB,eAAe,SAAS,KAAK;EAC7B,cAAc,SAAS,CAAC,CAAC,KAAK;CAChC,CAAC;CAuBD,M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kBAAkB,MAAM,MAAM,WAAW,MAAM,MAAM,KAAK;CAChE,MAAM,mBAAmB;EACvB,MAAM,OAAO,MAAM,MAAM,aAAa;EACtC,OAAO,SAAS,SAAU,gBAAgB,OAAO,KAAK,IAAI,MAAM,KAAK,EAAE;CACzE;CACA,MAAM,mBAAmB,MAAM,MAAM,WAAW,MAAM,KAAK,EAAE;CAE7D,MAAM,cAAc,kBAA8C;EAChE,YAAY,WAAW;EACvB,YAAY,WAAW;EACvB,WAAW,UAAU;CACvB,EAAE;CAEF,MAAM,EAAE,KAAK,MAAM,GAAG,oBAAoB;CAI1C,OACE,CAAC,WACK,iBACJ,eAAe,WAAW,KAAK,KAAA,GAC/B,eAAe,WAAW,KAAK,KAAA,GAC/B,cAAc,UAAU,KAAK,KAAA,GAC9B;OACE,MAAM,YAAY,MAAM,MAAM,YAAY,CAAC,EAAE;IAChD,EAAE;AAEN;AAEA,SAAgB,wBAAwD;CACtE,OAAO,WAAW,kBAAkB;AACtC"}
|
|
1
|
+
{"version":3,"file":"ActionGroup.jsx","names":[],"sources":["../src/ActionGroup.tsx"],"sourcesContent":["/**\n * ActionGroup component for solidaria-components\n *\n * Pre-wired headless action group component that combines\n * createListState + createActionGroup/createActionGroupItem.\n * Provides proper dynamic roles (toolbar/radiogroup), keyboard\n * navigation, and ARIA attributes.\n *\n * No RAC equivalent exists — this bridges solidaria ARIA hooks\n * directly to a headless component.\n */\n\nimport {\n type JSX,\n type ParentProps,\n createContext,\n createMemo,\n splitProps,\n useContext,\n For,\n} from \"solid-js\";\nimport {\n createActionGroup,\n createActionGroupItem,\n type AriaActionGroupProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createListState,\n type ListState,\n type Key,\n type SelectionMode,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\nexport interface ActionGroupRenderProps {\n /** The orientation of the action group. */\n orientation: \"horizontal\" | \"vertical\";\n /** Whether the entire group is disabled. */\n isDisabled: boolean;\n /** The selection mode. */\n selectionMode: SelectionMode;\n}\n\nexport interface ActionGroupItemRenderProps {\n /** Whether the item is selected. */\n isSelected: boolean;\n /** Whether the item is disabled. */\n isDisabled: boolean;\n /** Whether the item is focused. */\n isFocused: boolean;\n}\n\nexport interface ActionGroupItem {\n id: string;\n label: string;\n isDisabled?: boolean;\n [key: string]: unknown;\n}\n\nexport interface ActionGroupProps<T extends ActionGroupItem = ActionGroupItem> extends SlotProps {\n /** The items in the action group. */\n items: T[];\n /** The selection mode. @default 'none' */\n selectionMode?: SelectionMode;\n /** Orientation of the group. @default 'horizontal' */\n orientation?: \"horizontal\" | \"vertical\";\n /** Whether the entire group is disabled. */\n isDisabled?: boolean;\n /** Accessible label. */\n \"aria-label\"?: string;\n /** Labelled-by id. */\n \"aria-labelledby\"?: string;\n /** Currently selected keys (controlled). */\n selectedKeys?: Iterable<Key>;\n /** Default selected keys (uncontrolled). */\n defaultSelectedKeys?: Iterable<Key>;\n /** Handler called when selection changes. */\n onSelectionChange?: (keys: \"all\" | Set<Key>) => void;\n /** Handler called when an item action is triggered. */\n onAction?: (key: Key) => void;\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Render function for each item. */\n children: (item: T, renderProps: ActionGroupItemRenderProps) => JSX.Element;\n /** CSS class for the container. */\n class?: ClassNameOrFunction<ActionGroupRenderProps>;\n /** Inline style for the container. */\n style?: StyleOrFunction<ActionGroupRenderProps>;\n}\n\nexport interface ActionGroupContextValue<T extends ActionGroupItem = ActionGroupItem> {\n state: ListState<T>;\n}\n\nexport const ActionGroupContext = createContext<ActionGroupContextValue | null>(null);\nexport const ActionGroupStateContext = createContext<ListState<ActionGroupItem> | null>(null);\n\nexport function ActionGroup<T extends ActionGroupItem = ActionGroupItem>(\n props: ActionGroupProps<T>,\n): JSX.Element {\n const [local, ariaGroupProps, domProps] = splitProps(\n props,\n [\n \"items\",\n \"selectionMode\",\n \"orientation\",\n \"isDisabled\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"onAction\",\n \"disabledKeys\",\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n ],\n [\"aria-label\", \"aria-labelledby\"],\n );\n\n const state = createListState<T>({\n get items() {\n return local.items;\n },\n get selectionMode() {\n return local.selectionMode ?? \"none\";\n },\n get selectedKeys() {\n return local.selectedKeys;\n },\n get defaultSelectedKeys() {\n return local.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return local.onSelectionChange;\n },\n get disabledKeys() {\n return local.disabledKeys;\n },\n getKey: (item) => item.id,\n getTextValue: (item) => item.label,\n getDisabled: (item) => !!item.isDisabled,\n });\n\n const groupAriaProps: AriaActionGroupProps<T> = {\n get items() {\n return local.items;\n },\n get isDisabled() {\n return local.isDisabled;\n },\n get orientation() {\n return local.orientation;\n },\n get \"aria-label\"() {\n return ariaGroupProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaGroupProps[\"aria-labelledby\"];\n },\n get onAction() {\n return local.onAction;\n },\n };\n\n const { actionGroupProps } = createActionGroup(groupAriaProps, state as ListState<T>);\n\n const orientation = () => local.orientation ?? \"horizontal\";\n\n const renderProps = useRenderProps(\n {\n children: undefined,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ActionGroup\",\n },\n () => ({\n orientation: orientation(),\n isDisabled: !!local.isDisabled,\n selectionMode: (local.selectionMode ?? \"none\") as SelectionMode,\n }),\n );\n\n const filteredDOMProps = createMemo(() =>\n filterDOMProps(domProps as Record<string, unknown>, { global: true }),\n );\n\n return (\n <ActionGroupContext.Provider value={{ state: state as ListState<ActionGroupItem> }}>\n <ActionGroupStateContext.Provider value={state as ListState<ActionGroupItem>}>\n <div\n {...filteredDOMProps()}\n {...actionGroupProps}\n ref={(el: HTMLDivElement) => {\n const refFn = (actionGroupProps as { ref?: (el: HTMLElement) => void }).ref;\n refFn?.(el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-orientation={orientation()}\n data-disabled={local.isDisabled || undefined}\n >\n <For each={local.items}>\n {(item) => (\n <ActionGroupItemWrapper\n item={item}\n state={state as ListState<ActionGroupItem>}\n renderChild={\n local.children as (\n item: ActionGroupItem,\n rp: ActionGroupItemRenderProps,\n ) => JSX.Element\n }\n />\n )}\n </For>\n </div>\n </ActionGroupStateContext.Provider>\n </ActionGroupContext.Provider>\n );\n}\n\ninterface ActionGroupItemWrapperProps {\n item: ActionGroupItem;\n state: ListState<ActionGroupItem>;\n renderChild: (item: ActionGroupItem, renderProps: ActionGroupItemRenderProps) => JSX.Element;\n}\n\nfunction ActionGroupItemWrapper(props: ActionGroupItemWrapperProps): JSX.Element {\n const { buttonProps } = createActionGroupItem(\n {\n get key() {\n return props.item.id;\n },\n },\n props.state,\n );\n\n const isFocused = () => props.state.focusedKey() === props.item.id;\n const isSelected = () => {\n const keys = props.state.selectedKeys();\n return keys === \"all\" || (keys instanceof Set && keys.has(props.item.id));\n };\n const isDisabled = () => props.state.isDisabled(props.item.id);\n\n const renderProps = createMemo<ActionGroupItemRenderProps>(() => ({\n isSelected: isSelected(),\n isDisabled: isDisabled(),\n isFocused: isFocused(),\n }));\n\n // splitProps (not object destructuring) so the reactive getters on buttonProps\n // — tabIndex (roving stop), onFocus (sets the focused key), role, aria-checked\n // — stay live. A rest-spread `{ ref, ...rest }` would FREEZE them at their\n // first-render values, pinning the roving tabIndex and killing focus tracking.\n const [, restButtonProps] = splitProps(buttonProps, [\"ref\"]);\n\n return (\n <button\n {...restButtonProps}\n data-selected={isSelected() || undefined}\n data-disabled={isDisabled() || undefined}\n data-focused={isFocused() || undefined}\n >\n {props.renderChild(props.item, renderProps())}\n </button>\n );\n}\n\nexport function useActionGroupContext(): ActionGroupContextValue | null {\n return useContext(ActionGroupContext);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAoGA,MAAa,qBAAqB,cAA8C,IAAI;AACpF,MAAa,0BAA0B,cAAi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-8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { type JSX, type ParentProps } from "solid-js";
|
|
10
10
|
import { type AriaAutocompleteOptions, type AutocompleteInputProps, type CollectionOptions } from "@proyecto-viviana/solidaria";
|
|
11
|
-
import { type AutocompleteState, type AutocompleteStateOptions } from "@proyecto-viviana/solid-stately";
|
|
11
|
+
import { type AutocompleteState, type AutocompleteStateOptions, type CollectionNode } from "@proyecto-viviana/solid-stately";
|
|
12
12
|
import { type SlotProps } from "./utils";
|
|
13
13
|
export interface AutocompleteProps<T = unknown> extends Omit<AutocompleteStateOptions, "children">, Omit<AriaAutocompleteOptions<T>, "inputRef" | "collectionRef">, ParentProps, SlotProps {
|
|
14
14
|
}
|
|
@@ -19,7 +19,7 @@ export interface AutocompleteContextValue {
|
|
|
19
19
|
export interface AutocompleteCollectionContextValue {
|
|
20
20
|
collectionProps: CollectionOptions;
|
|
21
21
|
collectionRef: (el: HTMLElement) => void;
|
|
22
|
-
filter?: (
|
|
22
|
+
filter?: (nodeTextValue: string, node: CollectionNode<unknown>) => boolean;
|
|
23
23
|
}
|
|
24
24
|
export declare const AutocompleteContext: import("solid-js").Context<AutocompleteContextValue | null>;
|
|
25
25
|
export declare const AutocompleteStateContext: import("solid-js").Context<AutocompleteState | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../src/Autocomplete.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,KAAK,GAAG,EACR,KAAK,WAAW,EAMjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,
|
|
1
|
+
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../src/Autocomplete.tsx"],"names":[],"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wBAAgB,YAAY,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,CA2DlF"}
|
package/dist/Autocomplete.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createComponent } from "solid-js/web";
|
|
2
|
-
import { createContext, createMemo, splitProps, useContext } from "solid-js";
|
|
2
|
+
import { createContext, createMemo, createSignal, splitProps, useContext } from "solid-js";
|
|
3
3
|
import { createAutocomplete } from "@proyecto-viviana/solidaria";
|
|
4
4
|
import { createAutocompleteState } from "@proyecto-viviana/solid-stately";
|
|
5
5
|
//#region src/Autocomplete.tsx
|
|
@@ -83,23 +83,23 @@ function Autocomplete(props) {
|
|
|
83
83
|
"collectionAriaLabel"
|
|
84
84
|
]);
|
|
85
85
|
const state = createAutocompleteState(stateProps);
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
const [inputRef, setInputRef] = createSignal();
|
|
87
|
+
const [collectionRef, setCollectionRef] = createSignal();
|
|
88
88
|
const autocomplete = createAutocomplete({
|
|
89
89
|
...ariaProps,
|
|
90
|
-
inputRef
|
|
91
|
-
collectionRef
|
|
90
|
+
inputRef,
|
|
91
|
+
collectionRef
|
|
92
92
|
}, state);
|
|
93
93
|
const inputContextValue = createMemo(() => ({
|
|
94
94
|
inputProps: autocomplete.inputProps,
|
|
95
95
|
inputRef: (el) => {
|
|
96
|
-
|
|
96
|
+
setInputRef(el);
|
|
97
97
|
}
|
|
98
98
|
}));
|
|
99
99
|
const collectionContextValue = createMemo(() => ({
|
|
100
100
|
collectionProps: autocomplete.collectionProps,
|
|
101
101
|
collectionRef: (el) => {
|
|
102
|
-
|
|
102
|
+
setCollectionRef(el);
|
|
103
103
|
},
|
|
104
104
|
filter: autocomplete.filter
|
|
105
105
|
}));
|
package/dist/Autocomplete.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.js","names":["JSX","ParentProps","createContext","useContext","createMemo","splitProps","createSignal","createAutocomplete","AriaAutocompleteOptions","AutocompleteInputProps","CollectionOptions","createAutocompleteState","AutocompleteState","AutocompleteStateOptions","SlotProps","AutocompleteProps","Omit","T","AutocompleteContextValue","inputProps","inputRef","el","HTMLInputElement","AutocompleteCollectionContextValue","collectionProps","collectionRef","HTMLElement","filter","
|
|
1
|
+
{"version":3,"file":"Autocomplete.js","names":["JSX","ParentProps","createContext","useContext","createMemo","splitProps","createSignal","createAutocomplete","AriaAutocompleteOptions","AutocompleteInputProps","CollectionOptions","createAutocompleteState","AutocompleteState","AutocompleteStateOptions","CollectionNode","SlotProps","AutocompleteProps","Omit","T","AutocompleteContextValue","inputProps","inputRef","el","HTMLInputElement","AutocompleteCollectionContextValue","collectionProps","collectionRef","HTMLElement","filter","nodeTextValue","node","AutocompleteContext","AutocompleteStateContext","AutocompleteCollectionContext","useAutocompleteInput","useAutocompleteState","useAutocompleteCollection","Autocomplete","props","Element","stateProps","ariaProps","local","state","setInputRef","setCollectionRef","autocomplete","inputContextValue","collectionContextValue","_$createComponent","Provider","value","children"],"sources":["../src/Autocomplete.tsx"],"sourcesContent":["/**\n * Autocomplete component for solidaria-components\n *\n * Provides autocomplete functionality by wrapping a text input\n * with a filterable collection (ListBox/Menu).\n *\n * Port of react-aria-components/src/Autocomplete.tsx\n */\n\nimport {\n type JSX,\n type ParentProps,\n createContext,\n useContext,\n createMemo,\n splitProps,\n createSignal,\n} from \"solid-js\";\nimport {\n createAutocomplete,\n type AriaAutocompleteOptions,\n type AutocompleteInputProps,\n type CollectionOptions,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createAutocompleteState,\n type AutocompleteState,\n type AutocompleteStateOptions,\n type CollectionNode,\n} from \"@proyecto-viviana/solid-stately\";\nimport { type SlotProps } from \"./utils\";\n\nexport interface AutocompleteProps<T = unknown>\n extends\n Omit<AutocompleteStateOptions, \"children\">,\n Omit<AriaAutocompleteOptions<T>, \"inputRef\" | \"collectionRef\">,\n ParentProps,\n SlotProps {}\n\nexport interface AutocompleteContextValue {\n inputProps: AutocompleteInputProps;\n inputRef: (el: HTMLInputElement) => void;\n}\n\nexport interface AutocompleteCollectionContextValue {\n collectionProps: CollectionOptions;\n collectionRef: (el: HTMLElement) => void;\n filter?: (nodeTextValue: string, node: CollectionNode<unknown>) => boolean;\n}\n\nexport const AutocompleteContext = createContext<AutocompleteContextValue | null>(null);\nexport const AutocompleteStateContext = createContext<AutocompleteState | null>(null);\nexport const AutocompleteCollectionContext =\n createContext<AutocompleteCollectionContextValue | null>(null);\n\n/**\n * Hook to consume autocomplete input context.\n * Use this in your input component (TextField/SearchField) to get the autocomplete props.\n */\nexport function useAutocompleteInput() {\n return useContext(AutocompleteContext);\n}\n\n/**\n * Hook to consume autocomplete state context.\n */\nexport function useAutocompleteState() {\n return useContext(AutocompleteStateContext);\n}\n\n/**\n * Hook to consume autocomplete collection context.\n * Use this in your collection component (ListBox/Menu) to get the autocomplete props.\n */\nexport function useAutocompleteCollection() {\n return useContext(AutocompleteCollectionContext);\n}\n\n/**\n * An autocomplete allows users to search or filter a list of suggestions.\n * It wraps a text input and a collection component (ListBox or Menu),\n * providing keyboard navigation and filtering capabilities.\n *\n * @example\n * ```tsx\n * // Basic usage with SearchField and ListBox\n * <Autocomplete\n * filter={(textValue, inputValue) =>\n * textValue.toLowerCase().includes(inputValue.toLowerCase())\n * }\n * >\n * <SearchField aria-label=\"Search\">\n * <Input />\n * </SearchField>\n * <ListBox aria-label=\"Suggestions\">\n * <ListBoxItem>Option 1</ListBoxItem>\n * <ListBoxItem>Option 2</ListBoxItem>\n * <ListBoxItem>Option 3</ListBoxItem>\n * </ListBox>\n * </Autocomplete>\n *\n * // Controlled input value\n * const [value, setValue] = createSignal('');\n * <Autocomplete\n * inputValue={value()}\n * onInputChange={setValue}\n * filter={(textValue, inputValue) =>\n * textValue.toLowerCase().includes(inputValue.toLowerCase())\n * }\n * >\n * {/* ... *\\/}\n * </Autocomplete>\n * ```\n */\nexport function Autocomplete<T = unknown>(props: AutocompleteProps<T>): JSX.Element {\n const [stateProps, ariaProps, local] = splitProps(\n props,\n [\"inputValue\", \"defaultInputValue\", \"onInputChange\"],\n [\n \"filter\",\n \"disableAutoFocusFirst\",\n \"disableVirtualFocus\",\n \"collectionId\",\n \"collectionAriaLabel\",\n ],\n );\n\n const state = createAutocompleteState(stateProps);\n\n // Refs are signals so createAutocomplete's effects (the beforeinput listener\n // and the reverse-path focusin listener that mirrors aria-activedescendant)\n // bind reactively once the input/collection elements actually mount.\n const [inputRef, setInputRef] = createSignal<HTMLInputElement>();\n const [collectionRef, setCollectionRef] = createSignal<HTMLElement>();\n\n // Create autocomplete aria\n const autocomplete = createAutocomplete<T>(\n {\n ...ariaProps,\n inputRef,\n collectionRef,\n },\n state,\n );\n\n // Input context value\n const inputContextValue = createMemo<AutocompleteContextValue>(() => ({\n inputProps: autocomplete.inputProps,\n inputRef: (el: HTMLInputElement) => {\n setInputRef(el);\n },\n }));\n\n // Collection context value\n const collectionContextValue = createMemo<AutocompleteCollectionContextValue>(() => ({\n collectionProps: autocomplete.collectionProps,\n collectionRef: (el: HTMLElement) => {\n setCollectionRef(el);\n },\n filter: autocomplete.filter as\n | ((nodeTextValue: string, node: CollectionNode<unknown>) => boolean)\n | undefined,\n }));\n\n return (\n <AutocompleteStateContext.Provider value={state}>\n <AutocompleteContext.Provider value={inputContextValue()}>\n <AutocompleteCollectionContext.Provider value={collectionContextValue()}>\n {props.children}\n </AutocompleteCollectionContext.Provider>\n </AutocompleteContext.Provider>\n </AutocompleteStateContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAkDA,MAAa+B,sBAAsB7B,cAA+C,IAAI;AACtF,MAAa8B,2BAA2B9B,cAAwC,IAAI;AACpF,MAAa+B,gCACX/B,cAAyD,IAAI;;;;;AAM/D,SAAgBgC,uBAAuB;CACrC,OAAO/B,WAAW4B,mBAAmB;AACvC;;;;AAKA,SAAgBI,uBAAuB;CACrC,OAAOhC,W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
|
1
|
+
import { createContext, createMemo, createSignal, splitProps, useContext } from "solid-js";
|
|
2
2
|
import { createAutocomplete } from "@proyecto-viviana/solidaria";
|
|
3
3
|
import { createAutocompleteState } from "@proyecto-viviana/solid-stately";
|
|
4
4
|
//#region src/Autocomplete.tsx
|
|
@@ -82,23 +82,23 @@ function Autocomplete(props) {
|
|
|
82
82
|
"collectionAriaLabel"
|
|
83
83
|
]);
|
|
84
84
|
const state = createAutocompleteState(stateProps);
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
const [inputRef, setInputRef] = createSignal();
|
|
86
|
+
const [collectionRef, setCollectionRef] = createSignal();
|
|
87
87
|
const autocomplete = createAutocomplete({
|
|
88
88
|
...ariaProps,
|
|
89
|
-
inputRef
|
|
90
|
-
collectionRef
|
|
89
|
+
inputRef,
|
|
90
|
+
collectionRef
|
|
91
91
|
}, state);
|
|
92
92
|
const inputContextValue = createMemo(() => ({
|
|
93
93
|
inputProps: autocomplete.inputProps,
|
|
94
94
|
inputRef: (el) => {
|
|
95
|
-
|
|
95
|
+
setInputRef(el);
|
|
96
96
|
}
|
|
97
97
|
}));
|
|
98
98
|
const collectionContextValue = createMemo(() => ({
|
|
99
99
|
collectionProps: autocomplete.collectionProps,
|
|
100
100
|
collectionRef: (el) => {
|
|
101
|
-
|
|
101
|
+
setCollectionRef(el);
|
|
102
102
|
},
|
|
103
103
|
filter: autocomplete.filter
|
|
104
104
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.jsx","names":[],"sources":["../src/Autocomplete.tsx"],"sourcesContent":["/**\n * Autocomplete component for solidaria-components\n *\n * Provides autocomplete functionality by wrapping a text input\n * with a filterable collection (ListBox/Menu).\n *\n * Port of react-aria-components/src/Autocomplete.tsx\n */\n\nimport {\n type JSX,\n type ParentProps,\n createContext,\n useContext,\n createMemo,\n splitProps,\n createSignal,\n} from \"solid-js\";\nimport {\n createAutocomplete,\n type AriaAutocompleteOptions,\n type AutocompleteInputProps,\n type CollectionOptions,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createAutocompleteState,\n type AutocompleteState,\n type AutocompleteStateOptions,\n} from \"@proyecto-viviana/solid-stately\";\nimport { type SlotProps } from \"./utils\";\n\nexport interface AutocompleteProps<T = unknown>\n extends\n Omit<AutocompleteStateOptions, \"children\">,\n Omit<AriaAutocompleteOptions<T>, \"inputRef\" | \"collectionRef\">,\n ParentProps,\n SlotProps {}\n\nexport interface AutocompleteContextValue {\n inputProps: AutocompleteInputProps;\n inputRef: (el: HTMLInputElement) => void;\n}\n\nexport interface AutocompleteCollectionContextValue {\n collectionProps: CollectionOptions;\n collectionRef: (el: HTMLElement) => void;\n filter?: (
|
|
1
|
+
{"version":3,"file":"Autocomplete.jsx","names":[],"sources":["../src/Autocomplete.tsx"],"sourcesContent":["/**\n * Autocomplete component for solidaria-components\n *\n * Provides autocomplete functionality by wrapping a text input\n * with a filterable collection (ListBox/Menu).\n *\n * Port of react-aria-components/src/Autocomplete.tsx\n */\n\nimport {\n type JSX,\n type ParentProps,\n createContext,\n useContext,\n createMemo,\n splitProps,\n createSignal,\n} from \"solid-js\";\nimport {\n createAutocomplete,\n type AriaAutocompleteOptions,\n type AutocompleteInputProps,\n type CollectionOptions,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createAutocompleteState,\n type AutocompleteState,\n type AutocompleteStateOptions,\n type CollectionNode,\n} from \"@proyecto-viviana/solid-stately\";\nimport { type SlotProps } from \"./utils\";\n\nexport interface AutocompleteProps<T = unknown>\n extends\n Omit<AutocompleteStateOptions, \"children\">,\n Omit<AriaAutocompleteOptions<T>, \"inputRef\" | \"collectionRef\">,\n ParentProps,\n SlotProps {}\n\nexport interface AutocompleteContextValue {\n inputProps: AutocompleteInputProps;\n inputRef: (el: HTMLInputElement) => void;\n}\n\nexport interface AutocompleteCollectionContextValue {\n collectionProps: CollectionOptions;\n collectionRef: (el: HTMLElement) => void;\n filter?: (nodeTextValue: string, node: CollectionNode<unknown>) => boolean;\n}\n\nexport const AutocompleteContext = createContext<AutocompleteContextValue | null>(null);\nexport const AutocompleteStateContext = createContext<AutocompleteState | null>(null);\nexport const AutocompleteCollectionContext =\n createContext<AutocompleteCollectionContextValue | null>(null);\n\n/**\n * Hook to consume autocomplete input context.\n * Use this in your input component (TextField/SearchField) to get the autocomplete props.\n */\nexport function useAutocompleteInput() {\n return useContext(AutocompleteContext);\n}\n\n/**\n * Hook to consume autocomplete state context.\n */\nexport function useAutocompleteState() {\n return useContext(AutocompleteStateContext);\n}\n\n/**\n * Hook to consume autocomplete collection context.\n * Use this in your collection component (ListBox/Menu) to get the autocomplete props.\n */\nexport function useAutocompleteCollection() {\n return useContext(AutocompleteCollectionContext);\n}\n\n/**\n * An autocomplete allows users to search or filter a list of suggestions.\n * It wraps a text input and a collection component (ListBox or Menu),\n * providing keyboard navigation and filtering capabilities.\n *\n * @example\n * ```tsx\n * // Basic usage with SearchField and ListBox\n * <Autocomplete\n * filter={(textValue, inputValue) =>\n * textValue.toLowerCase().includes(inputValue.toLowerCase())\n * }\n * >\n * <SearchField aria-label=\"Search\">\n * <Input />\n * </SearchField>\n * <ListBox aria-label=\"Suggestions\">\n * <ListBoxItem>Option 1</ListBoxItem>\n * <ListBoxItem>Option 2</ListBoxItem>\n * <ListBoxItem>Option 3</ListBoxItem>\n * </ListBox>\n * </Autocomplete>\n *\n * // Controlled input value\n * const [value, setValue] = createSignal('');\n * <Autocomplete\n * inputValue={value()}\n * onInputChange={setValue}\n * filter={(textValue, inputValue) =>\n * textValue.toLowerCase().includes(inputValue.toLowerCase())\n * }\n * >\n * {/* ... *\\/}\n * </Autocomplete>\n * ```\n */\nexport function Autocomplete<T = unknown>(props: AutocompleteProps<T>): JSX.Element {\n const [stateProps, ariaProps, local] = splitProps(\n props,\n [\"inputValue\", \"defaultInputValue\", \"onInputChange\"],\n [\n \"filter\",\n \"disableAutoFocusFirst\",\n \"disableVirtualFocus\",\n \"collectionId\",\n \"collectionAriaLabel\",\n ],\n );\n\n const state = createAutocompleteState(stateProps);\n\n // Refs are signals so createAutocomplete's effects (the beforeinput listener\n // and the reverse-path focusin listener that mirrors aria-activedescendant)\n // bind reactively once the input/collection elements actually mount.\n const [inputRef, setInputRef] = createSignal<HTMLInputElement>();\n const [collectionRef, setCollectionRef] = createSignal<HTMLElement>();\n\n // Create autocomplete aria\n const autocomplete = createAutocomplete<T>(\n {\n ...ariaProps,\n inputRef,\n collectionRef,\n },\n state,\n );\n\n // Input context value\n const inputContextValue = createMemo<AutocompleteContextValue>(() => ({\n inputProps: autocomplete.inputProps,\n inputRef: (el: HTMLInputElement) => {\n setInputRef(el);\n },\n }));\n\n // Collection context value\n const collectionContextValue = createMemo<AutocompleteCollectionContextValue>(() => ({\n collectionProps: autocomplete.collectionProps,\n collectionRef: (el: HTMLElement) => {\n setCollectionRef(el);\n },\n filter: autocomplete.filter as\n | ((nodeTextValue: string, node: CollectionNode<unknown>) => boolean)\n | undefined,\n }));\n\n return (\n <AutocompleteStateContext.Provider value={state}>\n <AutocompleteContext.Provider value={inputContextValue()}>\n <AutocompleteCollectionContext.Provider value={collectionContextValue()}>\n {props.children}\n </AutocompleteCollectionContext.Provider>\n </AutocompleteContext.Provider>\n </AutocompleteStateContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAkDA,MAAa,sBAAsB,cAA+C,IAAI;AACtF,MAAa,2BAA2B,cAAwC,IAAI;AACpF,MAAa,gCACX,cAAyD,IAAI;;;;;AAM/D,SAAgB,uBAAuB;CACrC,OAAO,WAAW,mBAAmB;AACvC;;;;AAKA,SAAgB,uBAAuB;CACrC,OAAO,WAAW,wBAAwB;AAC5C;;;;;AAMA,SAAgB,4BAA4B;CAC1C,OAAO,WAAW,6BAA6B;AACjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,SAAgB,aAA0B,OAA0C;CAClF,MAAM,CAAC,YAAY,WAAW,SAAS,WACrC,OACA;EAAC;EAAc;EAAqB;CAAe,GACnD;E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