@proyecto-viviana/solidaria-components 0.4.1 → 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.
Files changed (52) hide show
  1. package/dist/Breadcrumbs.d.ts.map +1 -1
  2. package/dist/Breadcrumbs.js +3 -2
  3. package/dist/Breadcrumbs.js.map +1 -1
  4. package/dist/Breadcrumbs.jsx +3 -3
  5. package/dist/Breadcrumbs.jsx.map +1 -1
  6. package/dist/ElementTag.d.ts +29 -0
  7. package/dist/ElementTag.d.ts.map +1 -0
  8. package/dist/ElementTag.js +220 -0
  9. package/dist/ElementTag.js.map +1 -0
  10. package/dist/ElementTag.jsx +67 -0
  11. package/dist/ElementTag.jsx.map +1 -0
  12. package/dist/Landmark.js +4 -3
  13. package/dist/Landmark.js.map +1 -1
  14. package/dist/Landmark.jsx +3 -3
  15. package/dist/Landmark.jsx.map +1 -1
  16. package/dist/Link.js +3 -2
  17. package/dist/Link.js.map +1 -1
  18. package/dist/Link.jsx +3 -3
  19. package/dist/Link.jsx.map +1 -1
  20. package/dist/Select.d.ts.map +1 -1
  21. package/dist/Select.js +2 -2
  22. package/dist/Select.js.map +1 -1
  23. package/dist/Select.jsx +2 -2
  24. package/dist/Select.jsx.map +1 -1
  25. package/dist/Separator.js +3 -2
  26. package/dist/Separator.js.map +1 -1
  27. package/dist/Separator.jsx +2 -2
  28. package/dist/Separator.jsx.map +1 -1
  29. package/dist/Text.d.ts.map +1 -1
  30. package/dist/Text.js +9 -8
  31. package/dist/Text.js.map +1 -1
  32. package/dist/Text.jsx +3 -3
  33. package/dist/Text.jsx.map +1 -1
  34. package/dist/VisuallyHidden.d.ts.map +1 -1
  35. package/dist/VisuallyHidden.js +3 -11
  36. package/dist/VisuallyHidden.js.map +1 -1
  37. package/dist/VisuallyHidden.jsx +3 -4
  38. package/dist/VisuallyHidden.jsx.map +1 -1
  39. package/dist/index.d.ts +1 -0
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +2 -1
  42. package/dist/index.jsx +2 -1
  43. package/package.json +3 -3
  44. package/src/Breadcrumbs.tsx +5 -7
  45. package/src/ElementTag.tsx +116 -0
  46. package/src/Landmark.tsx +4 -4
  47. package/src/Link.tsx +4 -4
  48. package/src/Select.tsx +13 -2
  49. package/src/Separator.tsx +3 -3
  50. package/src/Text.tsx +5 -4
  51. package/src/VisuallyHidden.tsx +8 -12
  52. package/src/index.ts +2 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../src/Breadcrumbs.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,GAAG,EAST,MAAM,UAAU,CAAC;AAElB,OAAO,EAML,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAE7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,SAAS,EAGf,MAAM,SAAS,CAAC;AAEjB,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,CAAA;CAAE,GAAG,SAAS,CAAC;AAczE,MAAM,WAAW,sBAAsB;IACrC,4CAA4C;IAC5C,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,oBAAoB,EAAE,YAAY,CAAC,EAAE,SAAS;IAC9F,8CAA8C;IAC9C,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;IACZ,4CAA4C;IAC5C,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,CAAC;IACtC,4CAA4C;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC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ynamic, createComponent, getNextElement, insert, memo, mergeProps, runHydrationEvents, spread, template, use } from "solid-js/web";
2
+ import { ElementTag } from "./ElementTag.js";
3
+ import { createComponent, getNextElement, insert, memo, mergeProps, runHydrationEvents, spread, template, use } from "solid-js/web";
3
4
  import { For, Show, children, createContext, createMemo, createSignal, splitProps, useContext } from "solid-js";
4
5
  import { createBreadcrumbItem, createBreadcrumbs, createFocusRing, createHover, mergeProps as mergeProps$2 } from "@proyecto-viviana/solidaria";
5
6
  //#region src/Breadcrumbs.tsx
@@ -287,7 +288,7 @@ function BreadcrumbItem(props) {
287
288
  ...userStyle
288
289
  } : baseStyle;
289
290
  };
290
- return createComponent(Dynamic, mergeProps({ get component() {
291
+ return createComponent(ElementTag, mergeProps({ get tag() {
291
292
  return elementType();
292
293
  } }, mergedItemProps, {
293
294
  ref: (element) => assignRef(local.ref, element),
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs.js","names":["Accessor","JSX","createContext","createMemo","createSignal","children","resolveChildren","splitProps","useContext","For","Show","Dynamic","createBreadcrumbs","createBreadcrumbItem","createFocusRing","createHover","mergeProps","AriaBreadcrumbsProps","AriaBreadcrumbItemProps","PressEvent","RenderChildren","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","RefLike","el","T","current","assignRef","ref","BreadcrumbsRenderProps","isDisabled","BreadcrumbsProps","Omit","items","getKey","item","onAction","key","Element","class","style","HTMLElement","BreadcrumbItemRenderProps","isCurrent","isPressed","isFocused","isFocusVisible","isHovered","BreadcrumbItemProps","BreadcrumbsContextValue","registerStaticItem","staticItemCount","resetStaticItems","setStaticItemCount","count","BreadcrumbsContext","BreadcrumbItemContextValue","itemKey","isLast","BreadcrumbItemContext","defaultItemKey","index","maybeItem","id","Breadcrumbs","props","local","ariaProps","rest","hasCollectionItems","undefined","getItemKey","nextStaticIndex","navProps","aria-label","aria-labelledby","aria-describedby","renderValues","renderProps","defaultClassName","domProps","Record","global","_$createComponent","Provider","value","_el$","_$getNextElement","_tmpl$","_$use","element","_$spread","_$mergeProps","data-disabled","_$insert","when","fallback","StaticBreadcrumbItems","each","length","renderItem","_el$2","_tmpl$2","_$runHydrationEvents","context","staticChildren","childArray","array","toArray","child","_el$3","BreadcrumbItem","itemContext","staticIndex","elementType","href","linkElementType","handlePress","e","onPress","itemAria","target","rel","onPressStart","onPressEnd","onClick","onFocus","onBlur","onFocusChange","onKeyDown","onKeyUp","autoFocus","aria-details","aria-current","focusProps","hoverProps","mergedItemProps","itemProps","mergedStyle","userStyle","baseStyle","display","component","_$memo","aria-disabled","data-current","data-pressed","data-focused","data-focus-visible","data-hovered","renderChildren","Item"],"sources":["../src/Breadcrumbs.tsx"],"sourcesContent":["/**\n * Breadcrumbs component for solidaria-components\n *\n * A pre-wired headless breadcrumbs component that combines aria hooks.\n * Port of react-aria-components Breadcrumbs.\n */\n\nimport {\n type Accessor,\n type JSX,\n createContext,\n createMemo,\n createSignal,\n children as resolveChildren,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport {\n createBreadcrumbs,\n createBreadcrumbItem,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaBreadcrumbsProps,\n type AriaBreadcrumbItemProps,\n type PressEvent,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\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) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface BreadcrumbsRenderProps {\n /** Whether the breadcrumbs are disabled. */\n isDisabled: boolean;\n}\n\nexport interface BreadcrumbsProps<T> extends Omit<AriaBreadcrumbsProps, \"isDisabled\">, SlotProps {\n /** The items to render in the breadcrumbs. */\n items?: T[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => string | number;\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean;\n /** Handler called when a breadcrumb item is activated. */\n onAction?: (key: string | number) => void;\n /** The children of the component, or a render function for collection items. */\n children?: JSX.Element | ((item: T) => JSX.Element);\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<BreadcrumbsRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<BreadcrumbsRenderProps>;\n /** Ref for the navigation element. */\n ref?: RefLike<HTMLElement>;\n}\n\nexport interface BreadcrumbItemRenderProps {\n /** Whether this is the current/last item. */\n isCurrent: boolean;\n /** Whether the item is disabled. */\n isDisabled: boolean;\n /** Whether the item is pressed. */\n isPressed: boolean;\n /** Whether the item is focused. */\n isFocused: boolean;\n /** Whether the item has visible focus ring. */\n isFocusVisible: boolean;\n /** Whether the item is hovered. */\n isHovered: boolean;\n}\n\nexport interface BreadcrumbItemProps\n extends Omit<AriaBreadcrumbItemProps, \"isDisabled\">, SlotProps {\n /** The children of the breadcrumb item. */\n children?: RenderChildren<BreadcrumbItemRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<BreadcrumbItemRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<BreadcrumbItemRenderProps>;\n /** Whether this item is disabled. */\n isDisabled?: boolean;\n /** Ref for the breadcrumb item element. */\n ref?: RefLike<HTMLElement>;\n}\n\ninterface BreadcrumbsContextValue {\n isDisabled: Accessor<boolean>;\n onAction?: (key: string | number) => void;\n registerStaticItem?: () => number;\n staticItemCount?: Accessor<number>;\n resetStaticItems?: () => void;\n setStaticItemCount?: (count: number) => void;\n}\n\nexport const BreadcrumbsContext = createContext<BreadcrumbsContextValue | null>(null);\n\ninterface BreadcrumbItemContextValue {\n itemKey: string | number | null;\n isLast: Accessor<boolean>;\n}\n\nexport const BreadcrumbItemContext = createContext<BreadcrumbItemContextValue | null>(null);\n\nfunction defaultItemKey(item: unknown, index: number): string | number {\n const maybeItem = item as { key?: string | number; id?: string | number };\n return maybeItem.key ?? maybeItem.id ?? index;\n}\n\n/**\n * Breadcrumbs show hierarchy and navigational context for a user's location within an application.\n */\nexport function Breadcrumbs<T>(props: BreadcrumbsProps<T>): JSX.Element {\n const [local, ariaProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"items\", \"getKey\", \"isDisabled\", \"onAction\", \"ref\"],\n [\"aria-label\", \"aria-labelledby\", \"aria-describedby\", \"aria-details\"],\n );\n\n const isDisabled = () => local.isDisabled ?? false;\n const items = () => local.items ?? [];\n const hasCollectionItems = () => local.items !== undefined;\n const getItemKey = (item: T, index: number): string | number =>\n local.getKey?.(item) ?? defaultItemKey(item, index);\n const [staticItemCount, setStaticItemCount] = createSignal(0);\n let nextStaticIndex = 0;\n const resetStaticItems = () => {\n nextStaticIndex = 0;\n setStaticItemCount(0);\n };\n const registerStaticItem = () => {\n const index = nextStaticIndex;\n nextStaticIndex += 1;\n return index;\n };\n\n const { navProps } = createBreadcrumbs({\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const renderValues = createMemo<BreadcrumbsRenderProps>(() => ({\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Breadcrumbs\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n return (\n <BreadcrumbsContext.Provider\n value={{\n isDisabled,\n onAction: local.onAction,\n registerStaticItem,\n staticItemCount,\n resetStaticItems,\n setStaticItemCount,\n }}\n >\n {/*\n Faithful to react-aria-components Breadcrumbs: the accessible name (navProps'\n aria-label) sits directly on the <ol> (role=\"list\"), with NO wrapping <nav>\n landmark (react-spectrum/packages/react-aria-components/src/Breadcrumbs.tsx\n renders `<dom.ol {...mergeProps(DOMProps, navProps)} style={props.style}>`).\n The <ol> carries ONLY the consumer's class/style — no hard-coded inline\n layout reset. An inline reset would beat the styled layer's class (inline\n wins over class), which is exactly what broke S2 parity: the solid-spectrum\n `wrapperStyles` class supplies display:flex / list-style:none / padding:0 /\n marginStart and deliberately leaves align-items at its `normal` default, so\n a hard-coded inline `align-items:center` + `margin:0` clobbered the\n wrapper's margin and diverged from S2 (whose <ol> has neither).\n */}\n <ol\n {...navProps}\n {...domProps()}\n ref={(element) => assignRef(local.ref, element)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={isDisabled() || undefined}\n >\n <Show\n when={hasCollectionItems()}\n fallback={\n <StaticBreadcrumbItems>{local.children as JSX.Element}</StaticBreadcrumbItems>\n }\n >\n <For each={items()}>\n {(item, index) => {\n const itemKey = getItemKey(item, index());\n const isLast = () => index() === items().length - 1;\n const renderItem = local.children as ((item: T) => JSX.Element) | undefined;\n\n return (\n <li style={{ display: \"flex\", \"align-items\": \"center\" }}>\n <BreadcrumbItemContext.Provider value={{ itemKey, isLast }}>\n {renderItem?.(item)}\n </BreadcrumbItemContext.Provider>\n </li>\n );\n }}\n </For>\n </Show>\n </ol>\n </BreadcrumbsContext.Provider>\n );\n}\n\nfunction StaticBreadcrumbItems(props: { children?: JSX.Element }): JSX.Element {\n const context = useContext(BreadcrumbsContext);\n const staticChildren = resolveChildren(() => props.children);\n const childArray = createMemo(() => {\n context?.resetStaticItems?.();\n const array = staticChildren.toArray();\n context?.setStaticItemCount?.(array.length);\n return array;\n });\n\n return (\n <For each={childArray()}>\n {(child) => <li style={{ display: \"flex\", \"align-items\": \"center\" }}>{child}</li>}\n </For>\n );\n}\n\n/**\n * A BreadcrumbItem represents an individual breadcrumb in the navigation trail.\n */\nexport function BreadcrumbItem(props: BreadcrumbItemProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"isDisabled\", \"ref\"]);\n\n const context = useContext(BreadcrumbsContext);\n const itemContext = useContext(BreadcrumbItemContext);\n const staticIndex = itemContext ? null : context?.registerStaticItem?.();\n const isDisabled = () => local.isDisabled ?? context?.isDisabled() ?? false;\n const isCurrent = () =>\n ariaProps.isCurrent ??\n itemContext?.isLast() ??\n (staticIndex !== null &&\n staticIndex !== undefined &&\n context?.staticItemCount !== undefined &&\n staticIndex === context.staticItemCount() - 1);\n const itemKey = () => itemContext?.itemKey ?? ariaProps.id ?? null;\n\n // Mirror react-aria-components' Link: render an <a> only when there is an\n // href on an enabled, non-current item; otherwise fall back to a <span\n // role=\"link\"> (via createLink). A styled layer may force the element type\n // (S2 renders the current item as a plain <div>), which takes precedence.\n const elementType = () =>\n ariaProps.elementType ?? (ariaProps.href && !isDisabled() && !isCurrent() ? \"a\" : \"span\");\n // The current breadcrumb is the current page and is non-interactive: S2\n // renders it as a plain element with no link role. createLink only omits\n // role=\"link\" for an <a>, so treat the current item as an \"a\" purely for the\n // role decision while still rendering the resolved element type above.\n const linkElementType = () => (isCurrent() ? \"a\" : elementType());\n\n const handlePress = (e: PressEvent) => {\n ariaProps.onPress?.(e);\n const key = itemKey();\n if (key !== null && !isCurrent() && !isDisabled()) {\n context?.onAction?.(key);\n }\n };\n\n const itemAria = createBreadcrumbItem({\n get id() {\n return ariaProps.id;\n },\n get isCurrent() {\n return isCurrent();\n },\n get isDisabled() {\n return isDisabled();\n },\n get href() {\n return ariaProps.href;\n },\n get target() {\n return ariaProps.target;\n },\n get rel() {\n return ariaProps.rel;\n },\n get elementType() {\n return linkElementType();\n },\n get onPress() {\n return handlePress;\n },\n get onPressStart() {\n return ariaProps.onPressStart;\n },\n get onPressEnd() {\n return ariaProps.onPressEnd;\n },\n get onClick() {\n return ariaProps.onClick;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return ariaProps[\"aria-details\"];\n },\n get \"aria-current\"() {\n return ariaProps[\"aria-current\"];\n },\n });\n\n const isPressed = itemAria.isPressed;\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return isDisabled();\n },\n });\n // Read itemAria.itemProps fresh inside the memo (do NOT destructure it above):\n // the reactive getter re-runs createBreadcrumbItem → createLink each time this\n // memo re-evaluates, so role/tabIndex track elementType once isCurrent settles.\n const mergedItemProps = createMemo(() =>\n mergeProps(\n itemAria.itemProps as Record<string, unknown>,\n focusProps as Record<string, unknown>,\n hoverProps as Record<string, unknown>,\n ),\n );\n\n const renderValues = createMemo<BreadcrumbItemRenderProps>(() => ({\n isCurrent: isCurrent(),\n isDisabled: isDisabled(),\n isPressed: isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-BreadcrumbItem\",\n },\n renderValues,\n );\n\n const mergedStyle = () => {\n const userStyle = renderProps.style();\n const baseStyle = { display: \"inline-flex\", \"align-items\": \"center\" };\n return userStyle ? { ...baseStyle, ...userStyle } : baseStyle;\n };\n\n return (\n <Dynamic\n component={elementType()}\n {...mergedItemProps()}\n ref={(element: HTMLElement) => assignRef(local.ref, element)}\n aria-current={isCurrent() ? (ariaProps[\"aria-current\"] ?? \"page\") : undefined}\n aria-disabled={isDisabled() || isCurrent() || undefined}\n class={renderProps.class()}\n style={mergedStyle()}\n data-current={isCurrent() || undefined}\n data-disabled={isDisabled() || undefined}\n data-pressed={isPressed() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n >\n {renderProps.renderChildren()}\n </Dynamic>\n );\n}\n\nBreadcrumbs.Item = BreadcrumbItem;\n"],"mappings":";;;;;;;;;;;;AAyCA,SAAS8B,UAAaC,KAAiBJ,IAAa;CAClD,IAAI,CAACI,KACH;CAGF,IAAI,OAAOA,QAAQ,YACjBA,IAAIJ,EAAE;MAENI,IAAIF,UAAUF;AAElB;AAgEA,MAAa+B,qBAAqBxD,cAA8C,IAAI;AAOpF,MAAa4D,wBAAwB5D,cAAiD,IAAI;AAE1F,SAAS6D,eAAezB,MAAe0B,OAAgC;CACrE,MAAMC,YAAY3B;CAClB,OAAO2B,UAAUzB,OAAOyB,UAAUC,MAAMF;AAC1C;;;;AAKA,SAAgBG,YAAeC,OAAyC;CACtE,MAAM,CAACC,OAAOC,WAAWC,QAAQhE,WAC/B6D,OACA;EAAC;EAAY;EAAS;EAAS;EAAQ;EAAS;EAAU;EAAc;EAAY;CAAK,GACzF;EAAC;EAAc;EAAmB;EAAoB;CAAc,CACtE;CAEA,MAAMnC,mBAAmBoC,MAAMpC,cAAc;CAC7C,MAAMG,cAAciC,MAAMjC,SAAS,CAAA;CACnC,MAAMoC,2BAA2BH,MAAMjC,UAAUqC,KAAAA;CACjD,MAAMC,cAAcpC,MAAS0B,UAC3BK,MAAMhC,SAASC,IAAI,KAAKyB,eAAezB,MAAM0B,KAAK;CACpD,MAAM,CAACV,iBAAiBE,sBAAsBpD,aAAa,CAAC;CAC5D,IAAIuE,kBAAkB;CACtB,MAAMpB,yBAAyB;EAC7BoB,kBAAkB;EAClBnB,mBAAmB,CAAC;CACtB;CACA,MAAMH,2BAA2B;EAC/B,MAAMW,QAAQW;EACdA,mBAAmB;EACnB,OAAOX;CACT;CAEA,MAAM,EAAEY,aAAahE,kBAAkB;EACrC,IAAI,eAAe;GACjB,OAAO0D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D,YAAS;EAAA,OAAE5B,YAAY;CAAC,EAAA,GACpBsB,iBAAe;EAAA5G,MACb8D,YAAyB/D,UAAUuC,MAAMtC,KAAK8D,OAAO;EAAC,KAAA,kBAAA;GAAA,OAC9CqD,WAAA,CAAA,CAAApG,UAAU,CAAC,CAAA,CAAA,IAAIwB,UAAU,mBAAmB,SAAUG,KAAAA;EAAS;EAAA,KAAA,mBAAA;GAAA,OAC9DxC,WAAW,KAAKa,UAAU,KAAK2B,KAAAA;EAAS;EAAA,KAAA,WAAA;GAAA,OAChDQ,YAAYvC,MAAM;EAAC;EAAA,IAC1BC,QAAK;GAAA,OAAEkG,YAAY;EAAC;EAAA,KAAA,kBAAA;GAAA,OACN/F,UAAU,KAAK2B,KAAAA;EAAS;EAAA,KAAA,mBAAA;GAAA,OACvBxC,WAAW,KAAKwC,KAAAA;EAAS;EAAA,KAAA,kBAAA;GAAA,OAC1B1B,UAAU,KAAK0B,KAAAA;EAAS;EAAA,KAAA,kBAAA;GAAA,OACxBzB,UAAU,KAAKyB,KAAAA;EAAS;EAAA,KAAA,wBAAA;GAAA,OAClBxB,eAAe,KAAKwB,KAAAA;EAAS;EAAA,KAAA,kBAAA;GAAA,OACnCvB,UAAU,KAAKuB,KAAAA;EAAS;EAAA,IAAApE,WAAA;GAAA,OAErC4E,YAAYwE,eAAe;EAAC;CAAA,CAAA,CAAA;AAGnC;AAEAtF,YAAYuF,OAAOxC"}
1
+ {"version":3,"file":"Breadcrumbs.js","names":["Accessor","JSX","createContext","createMemo","createSignal","children","resolveChildren","splitProps","useContext","For","Show","ElementTag","createBreadcrumbs","createBreadcrumbItem","createFocusRing","createHover","mergeProps","AriaBreadcrumbsProps","AriaBreadcrumbItemProps","PressEvent","RenderChildren","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","RefLike","el","T","current","assignRef","ref","BreadcrumbsRenderProps","isDisabled","BreadcrumbsProps","Omit","items","getKey","item","onAction","key","Element","class","style","HTMLElement","BreadcrumbItemRenderProps","isCurrent","isPressed","isFocused","isFocusVisible","isHovered","BreadcrumbItemProps","BreadcrumbsContextValue","registerStaticItem","staticItemCount","resetStaticItems","setStaticItemCount","count","BreadcrumbsContext","BreadcrumbItemContextValue","itemKey","isLast","BreadcrumbItemContext","defaultItemKey","index","maybeItem","id","Breadcrumbs","props","local","ariaProps","rest","hasCollectionItems","undefined","getItemKey","nextStaticIndex","navProps","aria-label","aria-labelledby","aria-describedby","renderValues","renderProps","defaultClassName","domProps","Record","global","_$createComponent","Provider","value","_el$","_$getNextElement","_tmpl$","_$use","element","_$spread","_$mergeProps","data-disabled","_$insert","when","fallback","StaticBreadcrumbItems","each","length","renderItem","_el$2","_tmpl$2","_$runHydrationEvents","context","staticChildren","childArray","array","toArray","child","_el$3","BreadcrumbItem","itemContext","staticIndex","elementType","href","linkElementType","handlePress","e","onPress","itemAria","target","rel","onPressStart","onPressEnd","onClick","onFocus","onBlur","onFocusChange","onKeyDown","onKeyUp","autoFocus","aria-details","aria-current","focusProps","hoverProps","mergedItemProps","itemProps","mergedStyle","userStyle","baseStyle","display","tag","_$memo","aria-disabled","data-current","data-pressed","data-focused","data-focus-visible","data-hovered","renderChildren","Item"],"sources":["../src/Breadcrumbs.tsx"],"sourcesContent":["/**\n * Breadcrumbs component for solidaria-components\n *\n * A pre-wired headless breadcrumbs component that combines aria hooks.\n * Port of react-aria-components Breadcrumbs.\n */\n\nimport {\n type Accessor,\n type JSX,\n createContext,\n createMemo,\n createSignal,\n children as resolveChildren,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport { ElementTag } from \"./ElementTag\";\nimport {\n createBreadcrumbs,\n createBreadcrumbItem,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaBreadcrumbsProps,\n type AriaBreadcrumbItemProps,\n type PressEvent,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\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) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface BreadcrumbsRenderProps {\n /** Whether the breadcrumbs are disabled. */\n isDisabled: boolean;\n}\n\nexport interface BreadcrumbsProps<T> extends Omit<AriaBreadcrumbsProps, \"isDisabled\">, SlotProps {\n /** The items to render in the breadcrumbs. */\n items?: T[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => string | number;\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean;\n /** Handler called when a breadcrumb item is activated. */\n onAction?: (key: string | number) => void;\n /** The children of the component, or a render function for collection items. */\n children?: JSX.Element | ((item: T) => JSX.Element);\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<BreadcrumbsRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<BreadcrumbsRenderProps>;\n /** Ref for the navigation element. */\n ref?: RefLike<HTMLElement>;\n}\n\nexport interface BreadcrumbItemRenderProps {\n /** Whether this is the current/last item. */\n isCurrent: boolean;\n /** Whether the item is disabled. */\n isDisabled: boolean;\n /** Whether the item is pressed. */\n isPressed: boolean;\n /** Whether the item is focused. */\n isFocused: boolean;\n /** Whether the item has visible focus ring. */\n isFocusVisible: boolean;\n /** Whether the item is hovered. */\n isHovered: boolean;\n}\n\nexport interface BreadcrumbItemProps\n extends Omit<AriaBreadcrumbItemProps, \"isDisabled\">, SlotProps {\n /** The children of the breadcrumb item. */\n children?: RenderChildren<BreadcrumbItemRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<BreadcrumbItemRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<BreadcrumbItemRenderProps>;\n /** Whether this item is disabled. */\n isDisabled?: boolean;\n /** Ref for the breadcrumb item element. */\n ref?: RefLike<HTMLElement>;\n}\n\ninterface BreadcrumbsContextValue {\n isDisabled: Accessor<boolean>;\n onAction?: (key: string | number) => void;\n registerStaticItem?: () => number;\n staticItemCount?: Accessor<number>;\n resetStaticItems?: () => void;\n setStaticItemCount?: (count: number) => void;\n}\n\nexport const BreadcrumbsContext = createContext<BreadcrumbsContextValue | null>(null);\n\ninterface BreadcrumbItemContextValue {\n itemKey: string | number | null;\n isLast: Accessor<boolean>;\n}\n\nexport const BreadcrumbItemContext = createContext<BreadcrumbItemContextValue | null>(null);\n\nfunction defaultItemKey(item: unknown, index: number): string | number {\n const maybeItem = item as { key?: string | number; id?: string | number };\n return maybeItem.key ?? maybeItem.id ?? index;\n}\n\n/**\n * Breadcrumbs show hierarchy and navigational context for a user's location within an application.\n */\nexport function Breadcrumbs<T>(props: BreadcrumbsProps<T>): JSX.Element {\n const [local, ariaProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"items\", \"getKey\", \"isDisabled\", \"onAction\", \"ref\"],\n [\"aria-label\", \"aria-labelledby\", \"aria-describedby\", \"aria-details\"],\n );\n\n const isDisabled = () => local.isDisabled ?? false;\n const items = () => local.items ?? [];\n const hasCollectionItems = () => local.items !== undefined;\n const getItemKey = (item: T, index: number): string | number =>\n local.getKey?.(item) ?? defaultItemKey(item, index);\n const [staticItemCount, setStaticItemCount] = createSignal(0);\n let nextStaticIndex = 0;\n const resetStaticItems = () => {\n nextStaticIndex = 0;\n setStaticItemCount(0);\n };\n const registerStaticItem = () => {\n const index = nextStaticIndex;\n nextStaticIndex += 1;\n return index;\n };\n\n const { navProps } = createBreadcrumbs({\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const renderValues = createMemo<BreadcrumbsRenderProps>(() => ({\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Breadcrumbs\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n return (\n <BreadcrumbsContext.Provider\n value={{\n isDisabled,\n onAction: local.onAction,\n registerStaticItem,\n staticItemCount,\n resetStaticItems,\n setStaticItemCount,\n }}\n >\n {/*\n Faithful to react-aria-components Breadcrumbs: the accessible name (navProps'\n aria-label) sits directly on the <ol> (role=\"list\"), with NO wrapping <nav>\n landmark (react-spectrum/packages/react-aria-components/src/Breadcrumbs.tsx\n renders `<dom.ol {...mergeProps(DOMProps, navProps)} style={props.style}>`).\n The <ol> carries ONLY the consumer's class/style — no hard-coded inline\n layout reset. An inline reset would beat the styled layer's class (inline\n wins over class), which is exactly what broke S2 parity: the solid-spectrum\n `wrapperStyles` class supplies display:flex / list-style:none / padding:0 /\n marginStart and deliberately leaves align-items at its `normal` default, so\n a hard-coded inline `align-items:center` + `margin:0` clobbered the\n wrapper's margin and diverged from S2 (whose <ol> has neither).\n */}\n <ol\n {...navProps}\n {...domProps()}\n ref={(element) => assignRef(local.ref, element)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={isDisabled() || undefined}\n >\n <Show\n when={hasCollectionItems()}\n fallback={<StaticBreadcrumbItems>{local.children as JSX.Element}</StaticBreadcrumbItems>}\n >\n <For each={items()}>\n {(item, index) => {\n const itemKey = getItemKey(item, index());\n const isLast = () => index() === items().length - 1;\n const renderItem = local.children as ((item: T) => JSX.Element) | undefined;\n\n return (\n <li style={{ display: \"flex\", \"align-items\": \"center\" }}>\n <BreadcrumbItemContext.Provider value={{ itemKey, isLast }}>\n {renderItem?.(item)}\n </BreadcrumbItemContext.Provider>\n </li>\n );\n }}\n </For>\n </Show>\n </ol>\n </BreadcrumbsContext.Provider>\n );\n}\n\nfunction StaticBreadcrumbItems(props: { children?: JSX.Element }): JSX.Element {\n const context = useContext(BreadcrumbsContext);\n const staticChildren = resolveChildren(() => props.children);\n const childArray = createMemo(() => {\n context?.resetStaticItems?.();\n const array = staticChildren.toArray();\n context?.setStaticItemCount?.(array.length);\n return array;\n });\n\n return (\n <For each={childArray()}>\n {(child) => <li style={{ display: \"flex\", \"align-items\": \"center\" }}>{child}</li>}\n </For>\n );\n}\n\n/**\n * A BreadcrumbItem represents an individual breadcrumb in the navigation trail.\n */\nexport function BreadcrumbItem(props: BreadcrumbItemProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"isDisabled\", \"ref\"]);\n\n const context = useContext(BreadcrumbsContext);\n const itemContext = useContext(BreadcrumbItemContext);\n const staticIndex = itemContext ? null : context?.registerStaticItem?.();\n const isDisabled = () => local.isDisabled ?? context?.isDisabled() ?? false;\n const isCurrent = () =>\n ariaProps.isCurrent ??\n itemContext?.isLast() ??\n (staticIndex !== null &&\n staticIndex !== undefined &&\n context?.staticItemCount !== undefined &&\n staticIndex === context.staticItemCount() - 1);\n const itemKey = () => itemContext?.itemKey ?? ariaProps.id ?? null;\n\n // Mirror react-aria-components' Link: render an <a> only when there is an\n // href on an enabled, non-current item; otherwise fall back to a <span\n // role=\"link\"> (via createLink). A styled layer may force the element type\n // (S2 renders the current item as a plain <div>), which takes precedence.\n const elementType = () =>\n ariaProps.elementType ?? (ariaProps.href && !isDisabled() && !isCurrent() ? \"a\" : \"span\");\n // The current breadcrumb is the current page and is non-interactive: S2\n // renders it as a plain element with no link role. createLink only omits\n // role=\"link\" for an <a>, so treat the current item as an \"a\" purely for the\n // role decision while still rendering the resolved element type above.\n const linkElementType = () => (isCurrent() ? \"a\" : elementType());\n\n const handlePress = (e: PressEvent) => {\n ariaProps.onPress?.(e);\n const key = itemKey();\n if (key !== null && !isCurrent() && !isDisabled()) {\n context?.onAction?.(key);\n }\n };\n\n const itemAria = createBreadcrumbItem({\n get id() {\n return ariaProps.id;\n },\n get isCurrent() {\n return isCurrent();\n },\n get isDisabled() {\n return isDisabled();\n },\n get href() {\n return ariaProps.href;\n },\n get target() {\n return ariaProps.target;\n },\n get rel() {\n return ariaProps.rel;\n },\n get elementType() {\n return linkElementType();\n },\n get onPress() {\n return handlePress;\n },\n get onPressStart() {\n return ariaProps.onPressStart;\n },\n get onPressEnd() {\n return ariaProps.onPressEnd;\n },\n get onClick() {\n return ariaProps.onClick;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return ariaProps[\"aria-details\"];\n },\n get \"aria-current\"() {\n return ariaProps[\"aria-current\"];\n },\n });\n\n const isPressed = itemAria.isPressed;\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return isDisabled();\n },\n });\n // Read itemAria.itemProps fresh inside the memo (do NOT destructure it above):\n // the reactive getter re-runs createBreadcrumbItem → createLink each time this\n // memo re-evaluates, so role/tabIndex track elementType once isCurrent settles.\n const mergedItemProps = createMemo(() =>\n mergeProps(\n itemAria.itemProps as Record<string, unknown>,\n focusProps as Record<string, unknown>,\n hoverProps as Record<string, unknown>,\n ),\n );\n\n const renderValues = createMemo<BreadcrumbItemRenderProps>(() => ({\n isCurrent: isCurrent(),\n isDisabled: isDisabled(),\n isPressed: isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-BreadcrumbItem\",\n },\n renderValues,\n );\n\n const mergedStyle = () => {\n const userStyle = renderProps.style();\n const baseStyle = { display: \"inline-flex\", \"align-items\": \"center\" };\n return userStyle ? { ...baseStyle, ...userStyle } : baseStyle;\n };\n\n return (\n <ElementTag\n tag={elementType()}\n {...mergedItemProps()}\n ref={(element: HTMLElement) => assignRef(local.ref, element)}\n aria-current={isCurrent() ? (ariaProps[\"aria-current\"] ?? \"page\") : undefined}\n aria-disabled={isDisabled() || isCurrent() || undefined}\n class={renderProps.class()}\n style={mergedStyle()}\n data-current={isCurrent() || undefined}\n data-disabled={isDisabled() || undefined}\n data-pressed={isPressed() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n >\n {renderProps.renderChildren()}\n </ElementTag>\n );\n}\n\nBreadcrumbs.Item = BreadcrumbItem;\n"],"mappings":";;;;;;;;;;;;;AAyCA,SAAS8B,UAAaC,KAAiBJ,IAAa;CAClD,IAAI,CAACI,KACH;CAGF,IAAI,OAAOA,QAAQ,YACjBA,IAAIJ,EAAE;MAENI,IAAIF,UAAUF;AAElB;AAgEA,MAAa+B,qBAAqBxD,cAA8C,IAAI;AAOpF,MAAa4D,wBAAwB5D,cAAiD,IAAI;AAE1F,SAAS6D,eAAezB,MAAe0B,OAAgC;CACrE,MAAMC,YAAY3B;CAClB,OAAO2B,UAAUzB,OAAOyB,UAAUC,MAAMF;AAC1C;;;;AAKA,SAAgBG,YAAeC,OAAyC;CACtE,MAAM,CAACC,OAAOC,WAAWC,QAAQhE,WAC/B6D,OACA;EAAC;EAAY;EAAS;EAAS;EAAQ;EAAS;EAAU;EAAc;EAAY;CAAK,GACzF;EAAC;EAAc;EAAmB;EAAoB;CAAc,CACtE;CAEA,MAAMnC,mBAAmBoC,MAAMpC,cAAc;CAC7C,MAAMG,cAAciC,MAAMjC,SAAS,CAAA;CACnC,MAAMoC,2BAA2BH,MAAMjC,UAAUqC,KAAAA;CACjD,MAAMC,cAAcpC,MAAS0B,UAC3BK,M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,6 @@
1
1
  import { filterDOMProps, useRenderProps } from "./utils.jsx";
2
+ import { ElementTag } from "./ElementTag.jsx";
2
3
  import { For, Show, children, createContext, createMemo, createSignal, splitProps, useContext } from "solid-js";
3
- import { Dynamic } from "solid-js/web";
4
4
  import { createBreadcrumbItem, createBreadcrumbs, createFocusRing, createHover, mergeProps as mergeProps$1 } from "@proyecto-viviana/solidaria";
5
5
  //#region src/Breadcrumbs.tsx
6
6
  /**
@@ -250,9 +250,9 @@ function BreadcrumbItem(props) {
250
250
  ...userStyle
251
251
  } : baseStyle;
252
252
  };
253
- return <Dynamic component={elementType()} {...mergedItemProps()} ref={(element) => assignRef(local.ref, element)} aria-current={isCurrent() ? ariaProps["aria-current"] ?? "page" : void 0} aria-disabled={isDisabled() || isCurrent() || void 0} class={renderProps.class()} style={mergedStyle()} data-current={isCurrent() || void 0} data-disabled={isDisabled() || void 0} data-pressed={isPressed() || void 0} data-focused={isFocused() || void 0} data-focus-visible={isFocusVisible() || void 0} data-hovered={isHovered() || void 0}>
253
+ return <ElementTag tag={elementType()} {...mergedItemProps()} ref={(element) => assignRef(local.ref, element)} aria-current={isCurrent() ? ariaProps["aria-current"] ?? "page" : void 0} aria-disabled={isDisabled() || isCurrent() || void 0} class={renderProps.class()} style={mergedStyle()} data-current={isCurrent() || void 0} data-disabled={isDisabled() || void 0} data-pressed={isPressed() || void 0} data-focused={isFocused() || void 0} data-focus-visible={isFocusVisible() || void 0} data-hovered={isHovered() || void 0}>
254
254
  {renderProps.renderChildren()}
255
- </Dynamic>;
255
+ </ElementTag>;
256
256
  }
257
257
  Breadcrumbs.Item = BreadcrumbItem;
258
258
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs.jsx","names":["resolveChildren","mergeProps"],"sources":["../src/Breadcrumbs.tsx"],"sourcesContent":["/**\n * Breadcrumbs component for solidaria-components\n *\n * A pre-wired headless breadcrumbs component that combines aria hooks.\n * Port of react-aria-components Breadcrumbs.\n */\n\nimport {\n type Accessor,\n type JSX,\n createContext,\n createMemo,\n createSignal,\n children as resolveChildren,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport {\n createBreadcrumbs,\n createBreadcrumbItem,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaBreadcrumbsProps,\n type AriaBreadcrumbItemProps,\n type PressEvent,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\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) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface BreadcrumbsRenderProps {\n /** Whether the breadcrumbs are disabled. */\n isDisabled: boolean;\n}\n\nexport interface BreadcrumbsProps<T> extends Omit<AriaBreadcrumbsProps, \"isDisabled\">, SlotProps {\n /** The items to render in the breadcrumbs. */\n items?: T[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => string | number;\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean;\n /** Handler called when a breadcrumb item is activated. */\n onAction?: (key: string | number) => void;\n /** The children of the component, or a render function for collection items. */\n children?: JSX.Element | ((item: T) => JSX.Element);\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<BreadcrumbsRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<BreadcrumbsRenderProps>;\n /** Ref for the navigation element. */\n ref?: RefLike<HTMLElement>;\n}\n\nexport interface BreadcrumbItemRenderProps {\n /** Whether this is the current/last item. */\n isCurrent: boolean;\n /** Whether the item is disabled. */\n isDisabled: boolean;\n /** Whether the item is pressed. */\n isPressed: boolean;\n /** Whether the item is focused. */\n isFocused: boolean;\n /** Whether the item has visible focus ring. */\n isFocusVisible: boolean;\n /** Whether the item is hovered. */\n isHovered: boolean;\n}\n\nexport interface BreadcrumbItemProps\n extends Omit<AriaBreadcrumbItemProps, \"isDisabled\">, SlotProps {\n /** The children of the breadcrumb item. */\n children?: RenderChildren<BreadcrumbItemRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<BreadcrumbItemRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<BreadcrumbItemRenderProps>;\n /** Whether this item is disabled. */\n isDisabled?: boolean;\n /** Ref for the breadcrumb item element. */\n ref?: RefLike<HTMLElement>;\n}\n\ninterface BreadcrumbsContextValue {\n isDisabled: Accessor<boolean>;\n onAction?: (key: string | number) => void;\n registerStaticItem?: () => number;\n staticItemCount?: Accessor<number>;\n resetStaticItems?: () => void;\n setStaticItemCount?: (count: number) => void;\n}\n\nexport const BreadcrumbsContext = createContext<BreadcrumbsContextValue | null>(null);\n\ninterface BreadcrumbItemContextValue {\n itemKey: string | number | null;\n isLast: Accessor<boolean>;\n}\n\nexport const BreadcrumbItemContext = createContext<BreadcrumbItemContextValue | null>(null);\n\nfunction defaultItemKey(item: unknown, index: number): string | number {\n const maybeItem = item as { key?: string | number; id?: string | number };\n return maybeItem.key ?? maybeItem.id ?? index;\n}\n\n/**\n * Breadcrumbs show hierarchy and navigational context for a user's location within an application.\n */\nexport function Breadcrumbs<T>(props: BreadcrumbsProps<T>): JSX.Element {\n const [local, ariaProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"items\", \"getKey\", \"isDisabled\", \"onAction\", \"ref\"],\n [\"aria-label\", \"aria-labelledby\", \"aria-describedby\", \"aria-details\"],\n );\n\n const isDisabled = () => local.isDisabled ?? false;\n const items = () => local.items ?? [];\n const hasCollectionItems = () => local.items !== undefined;\n const getItemKey = (item: T, index: number): string | number =>\n local.getKey?.(item) ?? defaultItemKey(item, index);\n const [staticItemCount, setStaticItemCount] = createSignal(0);\n let nextStaticIndex = 0;\n const resetStaticItems = () => {\n nextStaticIndex = 0;\n setStaticItemCount(0);\n };\n const registerStaticItem = () => {\n const index = nextStaticIndex;\n nextStaticIndex += 1;\n return index;\n };\n\n const { navProps } = createBreadcrumbs({\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const renderValues = createMemo<BreadcrumbsRenderProps>(() => ({\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Breadcrumbs\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n return (\n <BreadcrumbsContext.Provider\n value={{\n isDisabled,\n onAction: local.onAction,\n registerStaticItem,\n staticItemCount,\n resetStaticItems,\n setStaticItemCount,\n }}\n >\n {/*\n Faithful to react-aria-components Breadcrumbs: the accessible name (navProps'\n aria-label) sits directly on the <ol> (role=\"list\"), with NO wrapping <nav>\n landmark (react-spectrum/packages/react-aria-components/src/Breadcrumbs.tsx\n renders `<dom.ol {...mergeProps(DOMProps, navProps)} style={props.style}>`).\n The <ol> carries ONLY the consumer's class/style — no hard-coded inline\n layout reset. An inline reset would beat the styled layer's class (inline\n wins over class), which is exactly what broke S2 parity: the solid-spectrum\n `wrapperStyles` class supplies display:flex / list-style:none / padding:0 /\n marginStart and deliberately leaves align-items at its `normal` default, so\n a hard-coded inline `align-items:center` + `margin:0` clobbered the\n wrapper's margin and diverged from S2 (whose <ol> has neither).\n */}\n <ol\n {...navProps}\n {...domProps()}\n ref={(element) => assignRef(local.ref, element)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={isDisabled() || undefined}\n >\n <Show\n when={hasCollectionItems()}\n fallback={\n <StaticBreadcrumbItems>{local.children as JSX.Element}</StaticBreadcrumbItems>\n }\n >\n <For each={items()}>\n {(item, index) => {\n const itemKey = getItemKey(item, index());\n const isLast = () => index() === items().length - 1;\n const renderItem = local.children as ((item: T) => JSX.Element) | undefined;\n\n return (\n <li style={{ display: \"flex\", \"align-items\": \"center\" }}>\n <BreadcrumbItemContext.Provider value={{ itemKey, isLast }}>\n {renderItem?.(item)}\n </BreadcrumbItemContext.Provider>\n </li>\n );\n }}\n </For>\n </Show>\n </ol>\n </BreadcrumbsContext.Provider>\n );\n}\n\nfunction StaticBreadcrumbItems(props: { children?: JSX.Element }): JSX.Element {\n const context = useContext(BreadcrumbsContext);\n const staticChildren = resolveChildren(() => props.children);\n const childArray = createMemo(() => {\n context?.resetStaticItems?.();\n const array = staticChildren.toArray();\n context?.setStaticItemCount?.(array.length);\n return array;\n });\n\n return (\n <For each={childArray()}>\n {(child) => <li style={{ display: \"flex\", \"align-items\": \"center\" }}>{child}</li>}\n </For>\n );\n}\n\n/**\n * A BreadcrumbItem represents an individual breadcrumb in the navigation trail.\n */\nexport function BreadcrumbItem(props: BreadcrumbItemProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"isDisabled\", \"ref\"]);\n\n const context = useContext(BreadcrumbsContext);\n const itemContext = useContext(BreadcrumbItemContext);\n const staticIndex = itemContext ? null : context?.registerStaticItem?.();\n const isDisabled = () => local.isDisabled ?? context?.isDisabled() ?? false;\n const isCurrent = () =>\n ariaProps.isCurrent ??\n itemContext?.isLast() ??\n (staticIndex !== null &&\n staticIndex !== undefined &&\n context?.staticItemCount !== undefined &&\n staticIndex === context.staticItemCount() - 1);\n const itemKey = () => itemContext?.itemKey ?? ariaProps.id ?? null;\n\n // Mirror react-aria-components' Link: render an <a> only when there is an\n // href on an enabled, non-current item; otherwise fall back to a <span\n // role=\"link\"> (via createLink). A styled layer may force the element type\n // (S2 renders the current item as a plain <div>), which takes precedence.\n const elementType = () =>\n ariaProps.elementType ?? (ariaProps.href && !isDisabled() && !isCurrent() ? \"a\" : \"span\");\n // The current breadcrumb is the current page and is non-interactive: S2\n // renders it as a plain element with no link role. createLink only omits\n // role=\"link\" for an <a>, so treat the current item as an \"a\" purely for the\n // role decision while still rendering the resolved element type above.\n const linkElementType = () => (isCurrent() ? \"a\" : elementType());\n\n const handlePress = (e: PressEvent) => {\n ariaProps.onPress?.(e);\n const key = itemKey();\n if (key !== null && !isCurrent() && !isDisabled()) {\n context?.onAction?.(key);\n }\n };\n\n const itemAria = createBreadcrumbItem({\n get id() {\n return ariaProps.id;\n },\n get isCurrent() {\n return isCurrent();\n },\n get isDisabled() {\n return isDisabled();\n },\n get href() {\n return ariaProps.href;\n },\n get target() {\n return ariaProps.target;\n },\n get rel() {\n return ariaProps.rel;\n },\n get elementType() {\n return linkElementType();\n },\n get onPress() {\n return handlePress;\n },\n get onPressStart() {\n return ariaProps.onPressStart;\n },\n get onPressEnd() {\n return ariaProps.onPressEnd;\n },\n get onClick() {\n return ariaProps.onClick;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return ariaProps[\"aria-details\"];\n },\n get \"aria-current\"() {\n return ariaProps[\"aria-current\"];\n },\n });\n\n const isPressed = itemAria.isPressed;\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return isDisabled();\n },\n });\n // Read itemAria.itemProps fresh inside the memo (do NOT destructure it above):\n // the reactive getter re-runs createBreadcrumbItem → createLink each time this\n // memo re-evaluates, so role/tabIndex track elementType once isCurrent settles.\n const mergedItemProps = createMemo(() =>\n mergeProps(\n itemAria.itemProps as Record<string, unknown>,\n focusProps as Record<string, unknown>,\n hoverProps as Record<string, unknown>,\n ),\n );\n\n const renderValues = createMemo<BreadcrumbItemRenderProps>(() => ({\n isCurrent: isCurrent(),\n isDisabled: isDisabled(),\n isPressed: isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-BreadcrumbItem\",\n },\n renderValues,\n );\n\n const mergedStyle = () => {\n const userStyle = renderProps.style();\n const baseStyle = { display: \"inline-flex\", \"align-items\": \"center\" };\n return userStyle ? { ...baseStyle, ...userStyle } : baseStyle;\n };\n\n return (\n <Dynamic\n component={elementType()}\n {...mergedItemProps()}\n ref={(element: HTMLElement) => assignRef(local.ref, element)}\n aria-current={isCurrent() ? (ariaProps[\"aria-current\"] ?? \"page\") : undefined}\n aria-disabled={isDisabled() || isCurrent() || undefined}\n class={renderProps.class()}\n style={mergedStyle()}\n data-current={isCurrent() || undefined}\n data-disabled={isDisabled() || undefined}\n data-pressed={isPressed() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n >\n {renderProps.renderChildren()}\n </Dynamic>\n );\n}\n\nBreadcrumbs.Item = BreadcrumbItem;\n"],"mappings":";;;;;;;;;;;AAyCA,SAAS,UAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KACH;CAGF,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AAgEA,MAAa,qBAAqB,cAA8C,IAAI;AAOpF,MAAa,wBAAwB,cAAiD,IAAI;AAE1F,SAAS,eAAe,MAAe,OAAgC;CACrE,MAAM,YAAY;CAClB,OAAO,UAAU,OAAO,UAAU,MAAM;AAC1C;;;;AAKA,SAAgB,YAAe,OAAyC;CACtE,MAAM,CAAC,OAAO,W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AY,OAAO"}
1
+ {"version":3,"file":"Breadcrumbs.jsx","names":["resolveChildren","mergeProps"],"sources":["../src/Breadcrumbs.tsx"],"sourcesContent":["/**\n * Breadcrumbs component for solidaria-components\n *\n * A pre-wired headless breadcrumbs component that combines aria hooks.\n * Port of react-aria-components Breadcrumbs.\n */\n\nimport {\n type Accessor,\n type JSX,\n createContext,\n createMemo,\n createSignal,\n children as resolveChildren,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport { ElementTag } from \"./ElementTag\";\nimport {\n createBreadcrumbs,\n createBreadcrumbItem,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaBreadcrumbsProps,\n type AriaBreadcrumbItemProps,\n type PressEvent,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\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) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface BreadcrumbsRenderProps {\n /** Whether the breadcrumbs are disabled. */\n isDisabled: boolean;\n}\n\nexport interface BreadcrumbsProps<T> extends Omit<AriaBreadcrumbsProps, \"isDisabled\">, SlotProps {\n /** The items to render in the breadcrumbs. */\n items?: T[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => string | number;\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean;\n /** Handler called when a breadcrumb item is activated. */\n onAction?: (key: string | number) => void;\n /** The children of the component, or a render function for collection items. */\n children?: JSX.Element | ((item: T) => JSX.Element);\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<BreadcrumbsRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<BreadcrumbsRenderProps>;\n /** Ref for the navigation element. */\n ref?: RefLike<HTMLElement>;\n}\n\nexport interface BreadcrumbItemRenderProps {\n /** Whether this is the current/last item. */\n isCurrent: boolean;\n /** Whether the item is disabled. */\n isDisabled: boolean;\n /** Whether the item is pressed. */\n isPressed: boolean;\n /** Whether the item is focused. */\n isFocused: boolean;\n /** Whether the item has visible focus ring. */\n isFocusVisible: boolean;\n /** Whether the item is hovered. */\n isHovered: boolean;\n}\n\nexport interface BreadcrumbItemProps\n extends Omit<AriaBreadcrumbItemProps, \"isDisabled\">, SlotProps {\n /** The children of the breadcrumb item. */\n children?: RenderChildren<BreadcrumbItemRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<BreadcrumbItemRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<BreadcrumbItemRenderProps>;\n /** Whether this item is disabled. */\n isDisabled?: boolean;\n /** Ref for the breadcrumb item element. */\n ref?: RefLike<HTMLElement>;\n}\n\ninterface BreadcrumbsContextValue {\n isDisabled: Accessor<boolean>;\n onAction?: (key: string | number) => void;\n registerStaticItem?: () => number;\n staticItemCount?: Accessor<number>;\n resetStaticItems?: () => void;\n setStaticItemCount?: (count: number) => void;\n}\n\nexport const BreadcrumbsContext = createContext<BreadcrumbsContextValue | null>(null);\n\ninterface BreadcrumbItemContextValue {\n itemKey: string | number | null;\n isLast: Accessor<boolean>;\n}\n\nexport const BreadcrumbItemContext = createContext<BreadcrumbItemContextValue | null>(null);\n\nfunction defaultItemKey(item: unknown, index: number): string | number {\n const maybeItem = item as { key?: string | number; id?: string | number };\n return maybeItem.key ?? maybeItem.id ?? index;\n}\n\n/**\n * Breadcrumbs show hierarchy and navigational context for a user's location within an application.\n */\nexport function Breadcrumbs<T>(props: BreadcrumbsProps<T>): JSX.Element {\n const [local, ariaProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"items\", \"getKey\", \"isDisabled\", \"onAction\", \"ref\"],\n [\"aria-label\", \"aria-labelledby\", \"aria-describedby\", \"aria-details\"],\n );\n\n const isDisabled = () => local.isDisabled ?? false;\n const items = () => local.items ?? [];\n const hasCollectionItems = () => local.items !== undefined;\n const getItemKey = (item: T, index: number): string | number =>\n local.getKey?.(item) ?? defaultItemKey(item, index);\n const [staticItemCount, setStaticItemCount] = createSignal(0);\n let nextStaticIndex = 0;\n const resetStaticItems = () => {\n nextStaticIndex = 0;\n setStaticItemCount(0);\n };\n const registerStaticItem = () => {\n const index = nextStaticIndex;\n nextStaticIndex += 1;\n return index;\n };\n\n const { navProps } = createBreadcrumbs({\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const renderValues = createMemo<BreadcrumbsRenderProps>(() => ({\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Breadcrumbs\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n return (\n <BreadcrumbsContext.Provider\n value={{\n isDisabled,\n onAction: local.onAction,\n registerStaticItem,\n staticItemCount,\n resetStaticItems,\n setStaticItemCount,\n }}\n >\n {/*\n Faithful to react-aria-components Breadcrumbs: the accessible name (navProps'\n aria-label) sits directly on the <ol> (role=\"list\"), with NO wrapping <nav>\n landmark (react-spectrum/packages/react-aria-components/src/Breadcrumbs.tsx\n renders `<dom.ol {...mergeProps(DOMProps, navProps)} style={props.style}>`).\n The <ol> carries ONLY the consumer's class/style — no hard-coded inline\n layout reset. An inline reset would beat the styled layer's class (inline\n wins over class), which is exactly what broke S2 parity: the solid-spectrum\n `wrapperStyles` class supplies display:flex / list-style:none / padding:0 /\n marginStart and deliberately leaves align-items at its `normal` default, so\n a hard-coded inline `align-items:center` + `margin:0` clobbered the\n wrapper's margin and diverged from S2 (whose <ol> has neither).\n */}\n <ol\n {...navProps}\n {...domProps()}\n ref={(element) => assignRef(local.ref, element)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={isDisabled() || undefined}\n >\n <Show\n when={hasCollectionItems()}\n fallback={<StaticBreadcrumbItems>{local.children as JSX.Element}</StaticBreadcrumbItems>}\n >\n <For each={items()}>\n {(item, index) => {\n const itemKey = getItemKey(item, index());\n const isLast = () => index() === items().length - 1;\n const renderItem = local.children as ((item: T) => JSX.Element) | undefined;\n\n return (\n <li style={{ display: \"flex\", \"align-items\": \"center\" }}>\n <BreadcrumbItemContext.Provider value={{ itemKey, isLast }}>\n {renderItem?.(item)}\n </BreadcrumbItemContext.Provider>\n </li>\n );\n }}\n </For>\n </Show>\n </ol>\n </BreadcrumbsContext.Provider>\n );\n}\n\nfunction StaticBreadcrumbItems(props: { children?: JSX.Element }): JSX.Element {\n const context = useContext(BreadcrumbsContext);\n const staticChildren = resolveChildren(() => props.children);\n const childArray = createMemo(() => {\n context?.resetStaticItems?.();\n const array = staticChildren.toArray();\n context?.setStaticItemCount?.(array.length);\n return array;\n });\n\n return (\n <For each={childArray()}>\n {(child) => <li style={{ display: \"flex\", \"align-items\": \"center\" }}>{child}</li>}\n </For>\n );\n}\n\n/**\n * A BreadcrumbItem represents an individual breadcrumb in the navigation trail.\n */\nexport function BreadcrumbItem(props: BreadcrumbItemProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"isDisabled\", \"ref\"]);\n\n const context = useContext(BreadcrumbsContext);\n const itemContext = useContext(BreadcrumbItemContext);\n const staticIndex = itemContext ? null : context?.registerStaticItem?.();\n const isDisabled = () => local.isDisabled ?? context?.isDisabled() ?? false;\n const isCurrent = () =>\n ariaProps.isCurrent ??\n itemContext?.isLast() ??\n (staticIndex !== null &&\n staticIndex !== undefined &&\n context?.staticItemCount !== undefined &&\n staticIndex === context.staticItemCount() - 1);\n const itemKey = () => itemContext?.itemKey ?? ariaProps.id ?? null;\n\n // Mirror react-aria-components' Link: render an <a> only when there is an\n // href on an enabled, non-current item; otherwise fall back to a <span\n // role=\"link\"> (via createLink). A styled layer may force the element type\n // (S2 renders the current item as a plain <div>), which takes precedence.\n const elementType = () =>\n ariaProps.elementType ?? (ariaProps.href && !isDisabled() && !isCurrent() ? \"a\" : \"span\");\n // The current breadcrumb is the current page and is non-interactive: S2\n // renders it as a plain element with no link role. createLink only omits\n // role=\"link\" for an <a>, so treat the current item as an \"a\" purely for the\n // role decision while still rendering the resolved element type above.\n const linkElementType = () => (isCurrent() ? \"a\" : elementType());\n\n const handlePress = (e: PressEvent) => {\n ariaProps.onPress?.(e);\n const key = itemKey();\n if (key !== null && !isCurrent() && !isDisabled()) {\n context?.onAction?.(key);\n }\n };\n\n const itemAria = createBreadcrumbItem({\n get id() {\n return ariaProps.id;\n },\n get isCurrent() {\n return isCurrent();\n },\n get isDisabled() {\n return isDisabled();\n },\n get href() {\n return ariaProps.href;\n },\n get target() {\n return ariaProps.target;\n },\n get rel() {\n return ariaProps.rel;\n },\n get elementType() {\n return linkElementType();\n },\n get onPress() {\n return handlePress;\n },\n get onPressStart() {\n return ariaProps.onPressStart;\n },\n get onPressEnd() {\n return ariaProps.onPressEnd;\n },\n get onClick() {\n return ariaProps.onClick;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return ariaProps[\"aria-details\"];\n },\n get \"aria-current\"() {\n return ariaProps[\"aria-current\"];\n },\n });\n\n const isPressed = itemAria.isPressed;\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return isDisabled();\n },\n });\n // Read itemAria.itemProps fresh inside the memo (do NOT destructure it above):\n // the reactive getter re-runs createBreadcrumbItem → createLink each time this\n // memo re-evaluates, so role/tabIndex track elementType once isCurrent settles.\n const mergedItemProps = createMemo(() =>\n mergeProps(\n itemAria.itemProps as Record<string, unknown>,\n focusProps as Record<string, unknown>,\n hoverProps as Record<string, unknown>,\n ),\n );\n\n const renderValues = createMemo<BreadcrumbItemRenderProps>(() => ({\n isCurrent: isCurrent(),\n isDisabled: isDisabled(),\n isPressed: isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-BreadcrumbItem\",\n },\n renderValues,\n );\n\n const mergedStyle = () => {\n const userStyle = renderProps.style();\n const baseStyle = { display: \"inline-flex\", \"align-items\": \"center\" };\n return userStyle ? { ...baseStyle, ...userStyle } : baseStyle;\n };\n\n return (\n <ElementTag\n tag={elementType()}\n {...mergedItemProps()}\n ref={(element: HTMLElement) => assignRef(local.ref, element)}\n aria-current={isCurrent() ? (ariaProps[\"aria-current\"] ?? \"page\") : undefined}\n aria-disabled={isDisabled() || isCurrent() || undefined}\n class={renderProps.class()}\n style={mergedStyle()}\n data-current={isCurrent() || undefined}\n data-disabled={isDisabled() || undefined}\n data-pressed={isPressed() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n >\n {renderProps.renderChildren()}\n </ElementTag>\n );\n}\n\nBreadcrumbs.Item = BreadcrumbItem;\n"],"mappings":";;;;;;;;;;;AAyCA,SAAS,UAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KACH;CAGF,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AAgEA,MAAa,qBA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WAAW,KAAK,KAAA,GAC/B,cAAc,UAAU,KAAK,KAAA,GAC7B,cAAc,UAAU,KAAK,KAAA,GAC7B,oBAAoB,eAAe,KAAK,KAAA,GACxC,cAAc,UAAU,KAAK,KAAA,GAC9B;OACE,YAAY,eAAe,EAAE;IAChC,EAAE;AAEN;AAEA,YAAY,OAAO"}
@@ -0,0 +1,29 @@
1
+ import { type JSX } from "solid-js";
2
+ export interface ElementTagProps extends Record<string, unknown> {
3
+ /** The HTML tag name to render. */
4
+ tag: string;
5
+ children?: JSX.Element;
6
+ }
7
+ /**
8
+ * Renders a string tag as a *statically compiled* element.
9
+ *
10
+ * A drop-in replacement for `<Dynamic component={someString}>`, which is unsafe
11
+ * anywhere that can render after hydration settles. Solid's `createDynamic`
12
+ * string branch calls `getNextElement()` with **no** `template` argument
13
+ * (solid-js 1.9.14, `web/dist/dev.js:771`). `getNextElement(template)` only
14
+ * reaches the registry while `isHydrating()` holds; once `sharedConfig.done` is
15
+ * set — hydration finished, but `sharedConfig.context` still live — it falls
16
+ * through to `return template()` and throws `TypeError: template is not a
17
+ * function`. Any deferred child lands on exactly that path: a `<Show>` that
18
+ * flips, a Suspense resolution, a portal, a container that defers its children.
19
+ *
20
+ * Each branch below is real JSX, so the compiler emits a `template()` of its own
21
+ * and hands it to `getNextElement(template)` — which adopts the SSR node from the
22
+ * registry during hydration and clones the template afterwards. Both phases work.
23
+ *
24
+ * Props other than `tag` are spread through untouched, `children` included, so
25
+ * this matches `<Dynamic>`'s behaviour exactly (`Dynamic` likewise splits only
26
+ * `component` and spreads the rest onto the element).
27
+ */
28
+ export declare function ElementTag(props: ElementTagProps): JSX.Element;
29
+ //# sourceMappingURL=ElementTag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ElementTag.d.ts","sourceRoot":"","sources":["../src/ElementTag.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAA0B,MAAM,UAAU,CAAC;AAG5D,MAAM,WAAW,eAAgB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC9D,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAqF9D"}
@@ -0,0 +1,220 @@
1
+ import { Dynamic, createComponent, getNextElement, mergeProps, runHydrationEvents, spread, template } from "solid-js/web";
2
+ import { createMemo, splitProps } from "solid-js";
3
+ //#region src/ElementTag.tsx
4
+ var _tmpl$ = /*#__PURE__*/ template(`<span>`), _tmpl$2 = /*#__PURE__*/ template(`<a>`), _tmpl$3 = /*#__PURE__*/ template(`<p>`), _tmpl$4 = /*#__PURE__*/ template(`<label>`), _tmpl$5 = /*#__PURE__*/ template(`<strong>`), _tmpl$6 = /*#__PURE__*/ template(`<em>`), _tmpl$7 = /*#__PURE__*/ template(`<small>`), _tmpl$8 = /*#__PURE__*/ template(`<div>`), _tmpl$9 = /*#__PURE__*/ template(`<hr>`), _tmpl$0 = /*#__PURE__*/ template(`<li>`), _tmpl$1 = /*#__PURE__*/ template(`<ul>`), _tmpl$10 = /*#__PURE__*/ template(`<ol>`), _tmpl$11 = /*#__PURE__*/ template(`<figure>`), _tmpl$12 = /*#__PURE__*/ template(`<blockquote>`), _tmpl$13 = /*#__PURE__*/ template(`<address>`), _tmpl$14 = /*#__PURE__*/ template(`<h1>`), _tmpl$15 = /*#__PURE__*/ template(`<h2>`), _tmpl$16 = /*#__PURE__*/ template(`<h3>`), _tmpl$17 = /*#__PURE__*/ template(`<h4>`), _tmpl$18 = /*#__PURE__*/ template(`<h5>`), _tmpl$19 = /*#__PURE__*/ template(`<h6>`), _tmpl$20 = /*#__PURE__*/ template(`<main>`), _tmpl$21 = /*#__PURE__*/ template(`<nav>`), _tmpl$22 = /*#__PURE__*/ template(`<header>`), _tmpl$23 = /*#__PURE__*/ template(`<footer>`), _tmpl$24 = /*#__PURE__*/ template(`<aside>`), _tmpl$25 = /*#__PURE__*/ template(`<section>`), _tmpl$26 = /*#__PURE__*/ template(`<article>`), _tmpl$27 = /*#__PURE__*/ template(`<form>`), _tmpl$28 = /*#__PURE__*/ template(`<search>`);
5
+ /**
6
+ * Renders a string tag as a *statically compiled* element.
7
+ *
8
+ * A drop-in replacement for `<Dynamic component={someString}>`, which is unsafe
9
+ * anywhere that can render after hydration settles. Solid's `createDynamic`
10
+ * string branch calls `getNextElement()` with **no** `template` argument
11
+ * (solid-js 1.9.14, `web/dist/dev.js:771`). `getNextElement(template)` only
12
+ * reaches the registry while `isHydrating()` holds; once `sharedConfig.done` is
13
+ * set — hydration finished, but `sharedConfig.context` still live — it falls
14
+ * through to `return template()` and throws `TypeError: template is not a
15
+ * function`. Any deferred child lands on exactly that path: a `<Show>` that
16
+ * flips, a Suspense resolution, a portal, a container that defers its children.
17
+ *
18
+ * Each branch below is real JSX, so the compiler emits a `template()` of its own
19
+ * and hands it to `getNextElement(template)` — which adopts the SSR node from the
20
+ * registry during hydration and clones the template afterwards. Both phases work.
21
+ *
22
+ * Props other than `tag` are spread through untouched, `children` included, so
23
+ * this matches `<Dynamic>`'s behaviour exactly (`Dynamic` likewise splits only
24
+ * `component` and spreads the rest onto the element).
25
+ */
26
+ function ElementTag(props) {
27
+ const [local, rest] = splitProps(props, ["tag"]);
28
+ const cached = createMemo(() => local.tag);
29
+ return createMemo(() => {
30
+ switch (cached()) {
31
+ case "span": return (() => {
32
+ var _el$ = getNextElement(_tmpl$);
33
+ spread(_el$, rest, false, false);
34
+ runHydrationEvents();
35
+ return _el$;
36
+ })();
37
+ case "a": return (() => {
38
+ var _el$2 = getNextElement(_tmpl$2);
39
+ spread(_el$2, rest, false, false);
40
+ runHydrationEvents();
41
+ return _el$2;
42
+ })();
43
+ case "p": return (() => {
44
+ var _el$3 = getNextElement(_tmpl$3);
45
+ spread(_el$3, rest, false, false);
46
+ runHydrationEvents();
47
+ return _el$3;
48
+ })();
49
+ case "label": return (() => {
50
+ var _el$4 = getNextElement(_tmpl$4);
51
+ spread(_el$4, rest, false, false);
52
+ runHydrationEvents();
53
+ return _el$4;
54
+ })();
55
+ case "strong": return (() => {
56
+ var _el$5 = getNextElement(_tmpl$5);
57
+ spread(_el$5, rest, false, false);
58
+ runHydrationEvents();
59
+ return _el$5;
60
+ })();
61
+ case "em": return (() => {
62
+ var _el$6 = getNextElement(_tmpl$6);
63
+ spread(_el$6, rest, false, false);
64
+ runHydrationEvents();
65
+ return _el$6;
66
+ })();
67
+ case "small": return (() => {
68
+ var _el$7 = getNextElement(_tmpl$7);
69
+ spread(_el$7, rest, false, false);
70
+ runHydrationEvents();
71
+ return _el$7;
72
+ })();
73
+ case "div": return (() => {
74
+ var _el$8 = getNextElement(_tmpl$8);
75
+ spread(_el$8, rest, false, false);
76
+ runHydrationEvents();
77
+ return _el$8;
78
+ })();
79
+ case "hr": return (() => {
80
+ var _el$9 = getNextElement(_tmpl$9);
81
+ spread(_el$9, rest, false, false);
82
+ runHydrationEvents();
83
+ return _el$9;
84
+ })();
85
+ case "li": return (() => {
86
+ var _el$0 = getNextElement(_tmpl$0);
87
+ spread(_el$0, rest, false, false);
88
+ runHydrationEvents();
89
+ return _el$0;
90
+ })();
91
+ case "ul": return (() => {
92
+ var _el$1 = getNextElement(_tmpl$1);
93
+ spread(_el$1, rest, false, false);
94
+ runHydrationEvents();
95
+ return _el$1;
96
+ })();
97
+ case "ol": return (() => {
98
+ var _el$10 = getNextElement(_tmpl$10);
99
+ spread(_el$10, rest, false, false);
100
+ runHydrationEvents();
101
+ return _el$10;
102
+ })();
103
+ case "figure": return (() => {
104
+ var _el$11 = getNextElement(_tmpl$11);
105
+ spread(_el$11, rest, false, false);
106
+ runHydrationEvents();
107
+ return _el$11;
108
+ })();
109
+ case "blockquote": return (() => {
110
+ var _el$12 = getNextElement(_tmpl$12);
111
+ spread(_el$12, rest, false, false);
112
+ runHydrationEvents();
113
+ return _el$12;
114
+ })();
115
+ case "address": return (() => {
116
+ var _el$13 = getNextElement(_tmpl$13);
117
+ spread(_el$13, rest, false, false);
118
+ runHydrationEvents();
119
+ return _el$13;
120
+ })();
121
+ case "h1": return (() => {
122
+ var _el$14 = getNextElement(_tmpl$14);
123
+ spread(_el$14, rest, false, false);
124
+ runHydrationEvents();
125
+ return _el$14;
126
+ })();
127
+ case "h2": return (() => {
128
+ var _el$15 = getNextElement(_tmpl$15);
129
+ spread(_el$15, rest, false, false);
130
+ runHydrationEvents();
131
+ return _el$15;
132
+ })();
133
+ case "h3": return (() => {
134
+ var _el$16 = getNextElement(_tmpl$16);
135
+ spread(_el$16, rest, false, false);
136
+ runHydrationEvents();
137
+ return _el$16;
138
+ })();
139
+ case "h4": return (() => {
140
+ var _el$17 = getNextElement(_tmpl$17);
141
+ spread(_el$17, rest, false, false);
142
+ runHydrationEvents();
143
+ return _el$17;
144
+ })();
145
+ case "h5": return (() => {
146
+ var _el$18 = getNextElement(_tmpl$18);
147
+ spread(_el$18, rest, false, false);
148
+ runHydrationEvents();
149
+ return _el$18;
150
+ })();
151
+ case "h6": return (() => {
152
+ var _el$19 = getNextElement(_tmpl$19);
153
+ spread(_el$19, rest, false, false);
154
+ runHydrationEvents();
155
+ return _el$19;
156
+ })();
157
+ case "main": return (() => {
158
+ var _el$20 = getNextElement(_tmpl$20);
159
+ spread(_el$20, rest, false, false);
160
+ runHydrationEvents();
161
+ return _el$20;
162
+ })();
163
+ case "nav": return (() => {
164
+ var _el$21 = getNextElement(_tmpl$21);
165
+ spread(_el$21, rest, false, false);
166
+ runHydrationEvents();
167
+ return _el$21;
168
+ })();
169
+ case "header": return (() => {
170
+ var _el$22 = getNextElement(_tmpl$22);
171
+ spread(_el$22, rest, false, false);
172
+ runHydrationEvents();
173
+ return _el$22;
174
+ })();
175
+ case "footer": return (() => {
176
+ var _el$23 = getNextElement(_tmpl$23);
177
+ spread(_el$23, rest, false, false);
178
+ runHydrationEvents();
179
+ return _el$23;
180
+ })();
181
+ case "aside": return (() => {
182
+ var _el$24 = getNextElement(_tmpl$24);
183
+ spread(_el$24, rest, false, false);
184
+ runHydrationEvents();
185
+ return _el$24;
186
+ })();
187
+ case "section": return (() => {
188
+ var _el$25 = getNextElement(_tmpl$25);
189
+ spread(_el$25, rest, false, false);
190
+ runHydrationEvents();
191
+ return _el$25;
192
+ })();
193
+ case "article": return (() => {
194
+ var _el$26 = getNextElement(_tmpl$26);
195
+ spread(_el$26, rest, false, false);
196
+ runHydrationEvents();
197
+ return _el$26;
198
+ })();
199
+ case "form": return (() => {
200
+ var _el$27 = getNextElement(_tmpl$27);
201
+ spread(_el$27, rest, false, false);
202
+ runHydrationEvents();
203
+ return _el$27;
204
+ })();
205
+ case "search": return (() => {
206
+ var _el$28 = getNextElement(_tmpl$28);
207
+ spread(_el$28, rest, false, false);
208
+ runHydrationEvents();
209
+ return _el$28;
210
+ })();
211
+ default: return createComponent(Dynamic, mergeProps({ get component() {
212
+ return local.tag;
213
+ } }, rest));
214
+ }
215
+ });
216
+ }
217
+ //#endregion
218
+ export { ElementTag };
219
+
220
+ //# sourceMappingURL=ElementTag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ElementTag.js","names":["JSX","createMemo","splitProps","Dynamic","ElementTagProps","Record","tag","children","Element","ElementTag","props","local","rest","cached","_el$","_$getNextElement","_tmpl$","_$spread","_$runHydrationEvents","_el$2","_tmpl$2","_el$3","_tmpl$3","_el$4","_tmpl$4","_el$5","_tmpl$5","_el$6","_tmpl$6","_el$7","_tmpl$7","_el$8","_tmpl$8","_el$9","_tmpl$9","_el$0","_tmpl$0","_el$1","_tmpl$1","_el$10","_tmpl$10","_el$11","_tmpl$11","_el$12","_tmpl$12","_el$13","_tmpl$13","_el$14","_tmpl$14","_el$15","_tmpl$15","_el$16","_tmpl$16","_el$17","_tmpl$17","_el$18","_tmpl$18","_el$19","_tmpl$19","_el$20","_tmpl$20","_el$21","_tmpl$21","_el$22","_tmpl$22","_el$23","_tmpl$23","_el$24","_tmpl$24","_el$25","_tmpl$25","_el$26","_tmpl$26","_el$27","_tmpl$27","_el$28","_tmpl$28","_$createComponent","_$mergeProps","component"],"sources":["../src/ElementTag.tsx"],"sourcesContent":["import { type JSX, createMemo, splitProps } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\n\nexport interface ElementTagProps extends Record<string, unknown> {\n /** The HTML tag name to render. */\n tag: string;\n children?: JSX.Element;\n}\n\n/**\n * Renders a string tag as a *statically compiled* element.\n *\n * A drop-in replacement for `<Dynamic component={someString}>`, which is unsafe\n * anywhere that can render after hydration settles. Solid's `createDynamic`\n * string branch calls `getNextElement()` with **no** `template` argument\n * (solid-js 1.9.14, `web/dist/dev.js:771`). `getNextElement(template)` only\n * reaches the registry while `isHydrating()` holds; once `sharedConfig.done` is\n * set — hydration finished, but `sharedConfig.context` still live — it falls\n * through to `return template()` and throws `TypeError: template is not a\n * function`. Any deferred child lands on exactly that path: a `<Show>` that\n * flips, a Suspense resolution, a portal, a container that defers its children.\n *\n * Each branch below is real JSX, so the compiler emits a `template()` of its own\n * and hands it to `getNextElement(template)` — which adopts the SSR node from the\n * registry during hydration and clones the template afterwards. Both phases work.\n *\n * Props other than `tag` are spread through untouched, `children` included, so\n * this matches `<Dynamic>`'s behaviour exactly (`Dynamic` likewise splits only\n * `component` and spreads the rest onto the element).\n */\nexport function ElementTag(props: ElementTagProps): JSX.Element {\n const [local, rest] = splitProps(props, [\"tag\"]);\n // Two memos, layered exactly as `<Dynamic>` layers them, and for the same reason.\n // Reading a single key off a merged-props proxy forces the dynamic spread behind\n // it to evaluate (to settle key precedence), which subscribes the reader to every\n // signal that spread touches. Absorbing that read in `cached` keeps it off the memo\n // below: `cached` re-runs freely, but its *value* only moves when the tag really\n // changes, so the element is rebuilt only then. Inline the read into the memo below\n // instead and any prop change recreates the DOM node — blowing away focus, and\n // looping where an ancestor counts the children it just rendered.\n const cached = createMemo(() => local.tag);\n return createMemo(() => {\n switch (cached()) {\n // Text / inline\n case \"span\":\n return <span {...rest} />;\n case \"a\":\n return <a {...rest} />;\n case \"p\":\n return <p {...rest} />;\n case \"label\":\n return <label {...rest} />;\n case \"strong\":\n return <strong {...rest} />;\n case \"em\":\n return <em {...rest} />;\n case \"small\":\n return <small {...rest} />;\n // Flow\n case \"div\":\n return <div {...rest} />;\n case \"hr\":\n return <hr {...rest} />;\n case \"li\":\n return <li {...rest} />;\n case \"ul\":\n return <ul {...rest} />;\n case \"ol\":\n return <ol {...rest} />;\n case \"figure\":\n return <figure {...rest} />;\n case \"blockquote\":\n return <blockquote {...rest} />;\n case \"address\":\n return <address {...rest} />;\n // Headings\n case \"h1\":\n return <h1 {...rest} />;\n case \"h2\":\n return <h2 {...rest} />;\n case \"h3\":\n return <h3 {...rest} />;\n case \"h4\":\n return <h4 {...rest} />;\n case \"h5\":\n return <h5 {...rest} />;\n case \"h6\":\n return <h6 {...rest} />;\n // Landmarks\n case \"main\":\n return <main {...rest} />;\n case \"nav\":\n return <nav {...rest} />;\n case \"header\":\n return <header {...rest} />;\n case \"footer\":\n return <footer {...rest} />;\n case \"aside\":\n return <aside {...rest} />;\n case \"section\":\n return <section {...rest} />;\n case \"article\":\n return <article {...rest} />;\n case \"form\":\n return <form {...rest} />;\n case \"search\":\n return <search {...rest} />;\n default:\n // A tag no component in this package emits. Kept on `<Dynamic>` rather\n // than hand-built so hydration still adopts the SSR node; it inherits\n // the post-hydration caveat above, which is why every tag the library\n // itself renders is listed explicitly.\n return <Dynamic component={local.tag} {...rest} />;\n }\n }) as unknown as JSX.Element;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,SAAgBS,WAAWC,OAAqC;CAC9D,MAAM,CAACC,OAAOC,QAAQV,WAAWQ,OAAO,CAAC,KAAK,CAAC;CAS/C,MAAMG,SAASZ,iBAAiBU,MAAML,GAAG;CACzC,OAAOL,iBAAiB;EACtB,QAAQY,OAAO,GAAf;GAEE,KAAK,QAC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,IAAAE,SAAApD,eAAAqD,QAAA;IAAAnD,OAAAkD,QAAkBvD,MAAI,OAAA,KAAA;IAAAM,mBAAA;IAAA,OAAAiD;GAAA,EAAA,CAAA;GACxB,KAAK,WACH,cAAA;IAAA,IAAAE,SAAAtD,eAAAuD,QAAA;IAAArD,OAAAoD,QAAoBzD,MAAI,OAAA,KAAA;IAAAM,mBAAA;IAAA,OAAAmD;GAAA,EAAA,CAAA;GAC1B,KAAK,WACH,cAAA;IAAA,IAAAE,SAAAxD,eAAAyD,QAAA;IAAAvD,OAAAsD,QAAoB3D,MAAI,OAAA,KAAA;IAAAM,mBAAA;IAAA,OAAAqD;GAAA,EAAA,CAAA;GAC1B,KAAK,QACH,cAAA;IAAA,IAAAE,SAAA1D,eAAA2D,QAAA;IAAAzD,OAAAwD,QAAiB7D,MAAI,OAAA,KAAA;IAAAM,mBAAA;IAAA,OAAAuD;GAAA,EAAA,CAAA;GACvB,KAAK,UACH,cAAA;IAAA,IAAAE,SAAA5D,eAAA6D,QAAA;IAAA3D,OAAA0D,QAAmB/D,MAAI,OAAA,KAAA;IAAAM,mBAAA;IAAA,OAAAyD;GAAA,EAAA,CAAA;GACzB,SAKE,OAAAE,gBAAQ1E,SAAO2E,WAAA,EAAA,IAACC,YAAS;IAAA,OAAEpE,MAAML;GAAG,EAAA,GAAMM,IAAI,CAAA;EAClD;CACF,CAAC;AACH"}
@@ -0,0 +1,67 @@
1
+ import { createMemo, splitProps } from "solid-js";
2
+ import { Dynamic } from "solid-js/web";
3
+ //#region src/ElementTag.tsx
4
+ /**
5
+ * Renders a string tag as a *statically compiled* element.
6
+ *
7
+ * A drop-in replacement for `<Dynamic component={someString}>`, which is unsafe
8
+ * anywhere that can render after hydration settles. Solid's `createDynamic`
9
+ * string branch calls `getNextElement()` with **no** `template` argument
10
+ * (solid-js 1.9.14, `web/dist/dev.js:771`). `getNextElement(template)` only
11
+ * reaches the registry while `isHydrating()` holds; once `sharedConfig.done` is
12
+ * set — hydration finished, but `sharedConfig.context` still live — it falls
13
+ * through to `return template()` and throws `TypeError: template is not a
14
+ * function`. Any deferred child lands on exactly that path: a `<Show>` that
15
+ * flips, a Suspense resolution, a portal, a container that defers its children.
16
+ *
17
+ * Each branch below is real JSX, so the compiler emits a `template()` of its own
18
+ * and hands it to `getNextElement(template)` — which adopts the SSR node from the
19
+ * registry during hydration and clones the template afterwards. Both phases work.
20
+ *
21
+ * Props other than `tag` are spread through untouched, `children` included, so
22
+ * this matches `<Dynamic>`'s behaviour exactly (`Dynamic` likewise splits only
23
+ * `component` and spreads the rest onto the element).
24
+ */
25
+ function ElementTag(props) {
26
+ const [local, rest] = splitProps(props, ["tag"]);
27
+ const cached = createMemo(() => local.tag);
28
+ return createMemo(() => {
29
+ switch (cached()) {
30
+ case "span": return <span {...rest} />;
31
+ case "a": return <a {...rest} />;
32
+ case "p": return <p {...rest} />;
33
+ case "label": return <label {...rest} />;
34
+ case "strong": return <strong {...rest} />;
35
+ case "em": return <em {...rest} />;
36
+ case "small": return <small {...rest} />;
37
+ case "div": return <div {...rest} />;
38
+ case "hr": return <hr {...rest} />;
39
+ case "li": return <li {...rest} />;
40
+ case "ul": return <ul {...rest} />;
41
+ case "ol": return <ol {...rest} />;
42
+ case "figure": return <figure {...rest} />;
43
+ case "blockquote": return <blockquote {...rest} />;
44
+ case "address": return <address {...rest} />;
45
+ case "h1": return <h1 {...rest} />;
46
+ case "h2": return <h2 {...rest} />;
47
+ case "h3": return <h3 {...rest} />;
48
+ case "h4": return <h4 {...rest} />;
49
+ case "h5": return <h5 {...rest} />;
50
+ case "h6": return <h6 {...rest} />;
51
+ case "main": return <main {...rest} />;
52
+ case "nav": return <nav {...rest} />;
53
+ case "header": return <header {...rest} />;
54
+ case "footer": return <footer {...rest} />;
55
+ case "aside": return <aside {...rest} />;
56
+ case "section": return <section {...rest} />;
57
+ case "article": return <article {...rest} />;
58
+ case "form": return <form {...rest} />;
59
+ case "search": return <search {...rest} />;
60
+ default: return <Dynamic component={local.tag} {...rest} />;
61
+ }
62
+ });
63
+ }
64
+ //#endregion
65
+ export { ElementTag };
66
+
67
+ //# sourceMappingURL=ElementTag.jsx.map