@sdxc/kit 2026.10.29 → 2026.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.jsonl +93 -0
- package/dist/make/declare.js +32 -11
- package/package.json +2 -2
- package/registry/ui/accordion.json +2 -2
- package/registry/ui/alert-dialog.json +2 -2
- package/registry/ui/alert.json +2 -2
- package/registry/ui/aspect-ratio.json +2 -2
- package/registry/ui/avatar.json +6 -3
- package/registry/ui/badge.json +2 -2
- package/registry/ui/breadcrumbs.json +2 -2
- package/registry/ui/button.json +5 -3
- package/registry/ui/calendar.json +2 -2
- package/registry/ui/card.json +2 -2
- package/registry/ui/carousel.json +2 -2
- package/registry/ui/checkbox-group.json +2 -2
- package/registry/ui/checkbox.json +2 -2
- package/registry/ui/combobox.json +2 -2
- package/registry/ui/command.json +2 -2
- package/registry/ui/cta-group.json +2 -2
- package/registry/ui/date-field.json +2 -2
- package/registry/ui/date-picker.json +2 -2
- package/registry/ui/date-range-picker.json +2 -2
- package/registry/ui/description.json +2 -2
- package/registry/ui/dialog-dismiss.json +13 -0
- package/registry/ui/dialog.json +2 -2
- package/registry/ui/disclosure.json +2 -2
- package/registry/ui/drawer.json +2 -2
- package/registry/ui/field-error.json +2 -2
- package/registry/ui/form.json +2 -2
- package/registry/ui/group.json +2 -2
- package/registry/ui/header.json +2 -2
- package/registry/ui/heading-scope.json +2 -2
- package/registry/ui/heading.json +3 -3
- package/registry/ui/highlight.json +3 -3
- package/registry/ui/hover-card.json +2 -2
- package/registry/ui/image-placeholder.json +2 -2
- package/registry/ui/input.json +2 -2
- package/registry/ui/item.json +2 -2
- package/registry/ui/keyboard.json +2 -2
- package/registry/ui/label.json +2 -2
- package/registry/ui/link-button.json +5 -3
- package/registry/ui/link.json +2 -2
- package/registry/ui/listbox.json +2 -2
- package/registry/ui/menu.json +2 -2
- package/registry/ui/meter.json +2 -2
- package/registry/ui/modal.json +2 -2
- package/registry/ui/nav-link.json +2 -2
- package/registry/ui/navigation-menu.json +2 -2
- package/registry/ui/number-field.json +2 -2
- package/registry/ui/otp-field.json +2 -2
- package/registry/ui/overlay-arrow.json +2 -2
- package/registry/ui/pagination.json +2 -2
- package/registry/ui/popover.json +2 -2
- package/registry/ui/progress-bar.json +2 -2
- package/registry/ui/radio-group.json +2 -2
- package/registry/ui/range-calendar.json +2 -2
- package/registry/ui/scroll-area.json +2 -2
- package/registry/ui/search-field.json +2 -2
- package/registry/ui/section.json +2 -2
- package/registry/ui/select.json +2 -2
- package/registry/ui/selection-indicator.json +2 -2
- package/registry/ui/sentinel-row.json +2 -2
- package/registry/ui/separator.json +2 -2
- package/registry/ui/shared-element.json +2 -2
- package/registry/ui/sheet.json +2 -2
- package/registry/ui/sidebar.json +2 -2
- package/registry/ui/slider.json +2 -2
- package/registry/ui/spinner.json +2 -2
- package/registry/ui/switch.json +2 -2
- package/registry/ui/tabs.json +2 -2
- package/registry/ui/tag-group.json +2 -2
- package/registry/ui/text-field.json +2 -2
- package/registry/ui/text.json +2 -2
- package/registry/ui/textarea.json +2 -2
- package/registry/ui/time-field.json +2 -2
- package/registry/ui/toggle-button.json +2 -2
- package/registry/ui/tooltip.json +2 -2
- package/registry/ui/typeset.json +2 -2
- package/registry/ui/youtube-embed.json +2 -2
- package/stubs/scaffold.controller.index.stub +1 -1
- package/registry/ui/attachment.json +0 -15
- package/registry/ui/bubble.json +0 -13
- package/registry/ui/chart.json +0 -13
- package/registry/ui/color-area.json +0 -13
- package/registry/ui/color-field.json +0 -20
- package/registry/ui/color-picker.json +0 -17
- package/registry/ui/color-slider.json +0 -13
- package/registry/ui/color-swatch-picker.json +0 -15
- package/registry/ui/color-swatch.json +0 -13
- package/registry/ui/color-wheel.json +0 -13
- package/registry/ui/context-menu.json +0 -16
- package/registry/ui/drop-indicator.json +0 -13
- package/registry/ui/drop-zone.json +0 -13
- package/registry/ui/empty.json +0 -15
- package/registry/ui/feature.json +0 -18
- package/registry/ui/file-trigger.json +0 -13
- package/registry/ui/grid-list.json +0 -18
- package/registry/ui/logo-cloud.json +0 -16
- package/registry/ui/marker.json +0 -13
- package/registry/ui/marketing-header.json +0 -18
- package/registry/ui/marketing-section.json +0 -16
- package/registry/ui/menubar.json +0 -13
- package/registry/ui/message-scroller.json +0 -16
- package/registry/ui/message.json +0 -13
- package/registry/ui/resizable.json +0 -13
- package/registry/ui/shortcut-list.json +0 -18
- package/registry/ui/skeleton.json +0 -13
- package/registry/ui/split.json +0 -16
- package/registry/ui/stat-strip.json +0 -16
- package/registry/ui/table.json +0 -16
- package/registry/ui/toast.json +0 -16
- package/registry/ui/toolbar.json +0 -13
- package/registry/ui/tree.json +0 -18
package/registry/ui/tree.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "tree",
|
|
3
|
-
"changedIn": "2026.10.13",
|
|
4
|
-
"dependencies": [
|
|
5
|
-
"sentinel-row"
|
|
6
|
-
],
|
|
7
|
-
"exports": [
|
|
8
|
-
"Tree"
|
|
9
|
-
],
|
|
10
|
-
"source": {
|
|
11
|
-
"path": "tree.tsx",
|
|
12
|
-
"content": "/**\n * A hierarchical list of nodes built from nested `<details>` and `<summary>`\n * elements, so a branch's expand/collapse state, keyboard toggling, and\n * content hiding all come from the platform rather than tracked state.\n * {@link Tree.Item} nests further {@link Tree.Item} nodes directly inside\n * itself to describe a subtree, {@link Tree.ItemContent} renders each node's\n * always-visible row, and {@link Tree.LoadMoreItem} holds a trailing loading\n * placeholder exactly like a row list's own.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { ChevronRightIcon } from \"@sdxc/icons\";\nimport { bg, fg, outline } from \"@sdxc/u/color\";\nimport { opacity, rounded, transition, transitionDuration } from \"@sdxc/u/effects\";\nimport { cursor, listStyle, raw } from \"@sdxc/u/general\";\nimport { center, hidden, hstack, interpolateSize, shrink, vstack } from \"@sdxc/u/layout\";\nimport { clip } from \"@sdxc/u/overflow\";\nimport { media } from \"@sdxc/u/responsive\";\nimport { bs, is, pb, pie, pi } from \"@sdxc/u/size\";\nimport { detailsContent, when } from \"@sdxc/u/state\";\nimport { rotate } from \"@sdxc/u/transform\";\nimport { text } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { panelChrome } from \"@sdxc/ui/styles\";\nimport { warnIfNoAccessibleLabel } from \"@sdxc/ui/utils\";\n\nimport { SentinelRow } from \"@sdxc/ui/sentinel-row\";\n\n/** `role=\"tree\"` applied to {@link Tree} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_ROLE = \"tree\";\n\n/**\n * `role=\"group\"` applied to {@link Tree.Item} through {@link attrs} unless a\n * consumer supplies its own `role` — the only role a native `<details>`\n * accepts, and a fitting one since each item's own `<details>` groups its nodes.\n */\nconst DEFAULT_ITEM_ROLE = \"group\";\n\n/** `role=\"treeitem\"` applied to {@link Tree.ItemContent} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_CONTENT_ROLE = \"treeitem\";\n\n/**\n * Nesting depth {@link Tree.Item} falls back to when nothing wraps it in\n * another {@link Tree.Item} at all, so a root-level node's row renders with\n * no extra indentation and an `aria-level` of `1`.\n */\nconst DEFAULT_DEPTH = 0;\n\n/**\n * Marker {@link Tree.ExpandButton} always carries as its `data-slot`\n * attribute, applied through {@link attrs} unless a consumer supplies its\n * own value, letting {@link Tree.Item}'s styling target just this chevron.\n */\nconst DEFAULT_EXPAND_BUTTON_SLOT = \"expand-button\";\n\n/**\n * Inline space a row with no {@link Tree.ExpandButton} keeps where the chevron would\n * sit — the chevron's own width plus the row's gap — so a leaf's icon lines up under\n * the icons of the branches around it instead of under their chevrons.\n */\nconst LEAF_GUTTER = \"calc(var(--ui-spacing, 0.25rem) * 7)\";\n\n/**\n * Prop and context types for {@link Tree} and its compound parts.\n */\nexport namespace Tree {\n\t/** Value each {@link Tree.Item} provides to the nodes nested inside it. */\n\texport interface ItemContext {\n\t\t/** Nesting depth this item occupies, `0` for a node rendered directly inside {@link Tree}. */\n\t\tdepth: number;\n\t}\n\n\t/**\n\t * Props accepted by {@link Tree}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** {@link Tree.Item} and {@link Tree.LoadMoreItem} nodes to render. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Tree.Item}. Every native `<details>` attribute\n\t * still applies, so `open` sets a branch's initial and current expanded\n\t * state declaratively, exactly as on any native `<details>` element.\n\t */\n\texport interface ItemProps extends TagProps<\"details\"> {\n\t\t/**\n\t\t * Stable identifier for this node, mirrored onto the rendered element's\n\t\t * own `id` and a `data-rmx-key` attribute so a paired selection, navigation, or\n\t\t * reorder behavior can correlate the node with its own tracked state.\n\t\t */\n\t\tid: string;\n\t\t/** The node's {@link Tree.ItemContent} row, followed by zero or more nested {@link Tree.Item} nodes describing its subtree. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Tree.ItemContent}.\n\t */\n\texport interface ItemContentProps extends TagProps<\"summary\"> {}\n\n\t/**\n\t * Props accepted by {@link Tree.LoadMoreItem}.\n\t */\n\texport interface LoadMoreItemProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Props accepted by {@link Tree.ExpandButton}: every native `<span>` attribute.\n\t *\n\t * No accessible name is asked for, because the chevron names nothing: the row it\n\t * sits in is a `<summary>`, which announces the branch and its expanded state on\n\t * its own, and a second name beside it would be read out twice.\n\t */\n\texport interface ExpandButtonProps extends TagProps<\"span\"> {}\n}\n\n/**\n * Reads the nesting depth published by the nearest ancestor {@link Tree.Item},\n * resolving to `undefined` when the lookup finds no ancestor item at all.\n *\n * @param handle Runtime handle of the component performing the lookup.\n * @returns The nearest ancestor item's depth, or `undefined` where nothing wraps the caller.\n * @example\n * let ambient = readAmbientDepth(handle); // 1, nested one level inside a Tree.Item holding depth 1\n */\nfunction readAmbientDepth(handle: Handle<unknown, any>): number | undefined {\n\ttry {\n\t\tlet ambient = handle.context.get(TreeItem) as Tree.ItemContext | undefined;\n\n\t\treturn ambient?.depth;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/**\n * Renders the tree's root host: a bordered `<div>` carrying `role=\"tree\"`,\n * stacking {@link Tree.Item} nodes in block flow, with `data-empty`\n * centering a fallback message; an unlabeled tree logs a dev `console.warn`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the tree's markup.\n * @example\n * <Tree aria-label={t(\"files.title\")}>\n * \t<Tree.Item id=\"src\">\n * \t\t<Tree.ItemContent>\n * \t\t\t<Tree.ExpandButton aria-label={t(\"files.expand\")} />\n * \t\t\t{t(\"files.folder\", { name: \"src\" })}\n * \t\t</Tree.ItemContent>\n * \t\t<Tree.Item id=\"src-index\">\n * \t\t\t<Tree.ItemContent>{t(\"files.file\", { name: \"index.ts\" })}</Tree.ItemContent>\n * \t\t</Tree.Item>\n * \t</Tree.Item>\n * </Tree>\n * @example\n * <Tree aria-label={t(\"files.title\")} data-empty>\n * \t{t(\"files.empty\")}\n * </Tree>\n */\nexport function Tree(handle: Handle<Tree.Props>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t'Tree: needs an \"aria-label\" or \"aria-labelledby\" describing its contents for assistive technology.',\n\t\t);\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_ROLE }),\n\t\t\t\t\tpanelChrome(),\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\tvstack(),\n\t\t\t\t\tpb(1),\n\t\t\t\t\tpi(1),\n\t\t\t\t\toutline(\"none\"),\n\t\t\t\t\twhen(\"&[data-empty]\", [center(), pb(8), fg(\"neutral.muted\")]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n}\n\n/**\n * Renders a node as a native `<details>`, so a subtree's reveal and `[open]`\n * state come from the platform. Nest {@link Tree.ItemContent} first as the\n * row, then nested {@link Tree.Item} children; reveal animates via `::details-content`.\n *\n * @param handle Runtime handle carrying the host `<details>`'s props and providing {@link Tree.ItemContext} to nodes nested inside it.\n * @returns The render function producing the node's markup.\n * @example\n * <Tree.Item id=\"src\">\n * \t<Tree.ItemContent>\n * \t\t<Tree.ExpandButton aria-label={t(\"files.expand\")} />\n * \t\t{t(\"files.folder\", { name: \"src\" })}\n * \t</Tree.ItemContent>\n * \t<Tree.Item id=\"src-index\">\n * \t\t<Tree.ItemContent>{t(\"files.file\", { name: \"index.ts\" })}</Tree.ItemContent>\n * \t</Tree.Item>\n * </Tree.Item>\n * @example\n * <Tree.Item id=\"src\" open>\n * \t<Tree.ItemContent>\n * \t\t<Tree.ExpandButton aria-label={t(\"files.collapse\")} />\n * \t\t{t(\"files.folder\", { name: \"src\" })}\n * \t</Tree.ItemContent>\n * </Tree.Item>\n */\nfunction TreeItem(handle: Handle<Tree.ItemProps, Tree.ItemContext>) {\n\treturn () => {\n\t\tlet { id, children, mix, ...rest } = handle.props;\n\t\tlet ambient = readAmbientDepth(handle);\n\t\tlet depth = ambient === undefined ? DEFAULT_DEPTH : ambient + 1;\n\n\t\thandle.context.set({ depth });\n\n\t\treturn (\n\t\t\t<details\n\t\t\t\t{...rest}\n\t\t\t\tid={id}\n\t\t\t\tdata-rmx-key={id}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_ITEM_ROLE }),\n\t\t\t\t\tinterpolateSize(),\n\t\t\t\t\tdetailsContent([\n\t\t\t\t\t\tclip(),\n\t\t\t\t\t\traw({\n\t\t\t\t\t\t\ttransitionProperty: \"block-size, content-visibility\",\n\t\t\t\t\t\t\ttransitionBehavior: \"allow-discrete\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t\ttransitionDuration(\"200ms\"),\n\t\t\t\t\t]),\n\t\t\t\t\t/**\n\t\t\t\t\t * Collapsed and expanded sizes are written under selectors that never\n\t\t\t\t\t * match at once, so the reveal holds whichever order the cascade puts\n\t\t\t\t\t * the pair in.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"&:not([open])::details-content\", bs(0)),\n\t\t\t\t\twhen(\"&[open]::details-content\", bs(\"auto\")),\n\t\t\t\t\twhen(`&[open] > summary [data-slot=\"${DEFAULT_EXPAND_BUTTON_SLOT}\"]`, rotate(90)),\n\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", detailsContent(transitionDuration(\"0s\"))),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</details>\n\t\t);\n\t};\n}\n\nTree.Item = TreeItem;\n\n/**\n * Renders {@link Tree.ItemContentProps.children} inside a native\n * `<summary>` — the enclosing {@link Tree.Item}'s always-visible row —\n * indented from its ambient depth, with `aria-selected`/`aria-disabled` styling.\n *\n * @param handle Runtime handle carrying the host `<summary>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <Tree.ItemContent>\n * \t<Tree.ExpandButton aria-label={t(\"files.expand\")} />\n * \t{t(\"files.folder\", { name: \"src\" })}\n * </Tree.ItemContent>\n * @example\n * <Tree.ItemContent aria-selected=\"true\">\n * \t{t(\"files.file\", { name: \"index.ts\" })}\n * </Tree.ItemContent>\n */\nTree.ItemContent = function TreeItemContent(handle: Handle<Tree.ItemContentProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\t\tlet depth = readAmbientDepth(handle) ?? DEFAULT_DEPTH;\n\n\t\treturn (\n\t\t\t<summary\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\tattrs({ role: DEFAULT_CONTENT_ROLE, \"aria-level\": depth + 1 }),\n\t\t\t\t\thstack({ gap: 2, align: \"center\" }),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tpb(1.5),\n\t\t\t\t\tpie(3),\n\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\tlistStyle(),\n\t\t\t\t\t/**\n\t\t\t\t\t * The two indents are written under selectors that never match at once, so\n\t\t\t\t\t * a row keeps its own whichever order the cascade puts the pair in.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\n\t\t\t\t\t\t`&:has([data-slot=\"${DEFAULT_EXPAND_BUTTON_SLOT}\"])`,\n\t\t\t\t\t\traw({\n\t\t\t\t\t\t\tpaddingInlineStart: `calc(0.5rem + ${depth} * var(--ui-tree-indent, 1.25rem))`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t\t\twhen(\n\t\t\t\t\t\t`&:not(:has([data-slot=\"${DEFAULT_EXPAND_BUTTON_SLOT}\"]))`,\n\t\t\t\t\t\traw({\n\t\t\t\t\t\t\tpaddingInlineStart: `calc(0.5rem + ${depth} * var(--ui-tree-indent, 1.25rem) + ${LEAF_GUTTER})`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t\t\toutline(\"none\"),\n\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\twhen(\"&::-webkit-details-marker\", hidden()),\n\t\t\t\t\twhen(\"&::marker\", raw({ content: '\"\"' })),\n\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", transitionDuration(\"0s\")),\n\t\t\t\t\twhen(\"&:hover\", bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\twhen(\"&:active\", bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\twhen(\"&:focus\", bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\twhen('&[aria-selected=\"true\"]', bg(\"brand.tint\")),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', opacity(50)),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</summary>\n\t\t);\n\t};\n};\n\n/**\n * Renders a decorative sentinel node: a `<div>` styled as centered, muted\n * small text sized to match {@link Tree.ItemContent}'s vertical rhythm,\n * ready to hold whatever loading indicator a paired enhancement supplies.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the sentinel node's markup.\n * @example\n * <Tree.LoadMoreItem>{t(\"files.loadingMore\")}</Tree.LoadMoreItem>\n */\nTree.LoadMoreItem = SentinelRow;\n\n/**\n * Renders the chevron a node's row shows for a subtree, rotated 90 degrees\n * while the enclosing {@link Tree.Item}'s `<details>` carries `[open]`.\n *\n * It is decoration, not a control: the row it sits in is a `<summary>`, which is already\n * the thing that opens the branch, and a button nested inside one takes the activation\n * for itself — the chevron would be the one place on the row that did not expand it.\n *\n * @param handle Runtime handle carrying the host `<span>`'s props.\n * @returns The render function producing the chevron's markup.\n * @example\n * <Tree.ItemContent>\n * \t<Tree.ExpandButton aria-label={t(\"files.expand\")} />\n * \t{t(\"files.folder\", { name: \"src\" })}\n * </Tree.ItemContent>\n */\nTree.ExpandButton = function TreeExpandButton(handle: Handle<Tree.ExpandButtonProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<span\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ \"data-slot\": DEFAULT_EXPAND_BUTTON_SLOT, \"aria-hidden\": \"true\" }),\n\t\t\t\t\tcenter(),\n\t\t\t\t\tis(5),\n\t\t\t\t\tbs(5),\n\t\t\t\t\trounded(\"sm\"),\n\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\ttransition(\"transform, background-color\"),\n\t\t\t\t\tshrink(),\n\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", transitionDuration(\"0s\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children ?? <ChevronRightIcon size={16} />}\n\t\t\t</span>\n\t\t);\n\t};\n};\n"
|
|
13
|
-
},
|
|
14
|
-
"test": {
|
|
15
|
-
"path": "tree.test.tsx",
|
|
16
|
-
"content": "/**\n * Tests for the `type` {@link Tree.ExpandButton} writes: an explicit\n * `type=\"button\"`, positioned before the consumer's own attributes, without\n * which the platform refuses to run an Invoker Command the chevron carries\n * inside a `<form>` — it decides whether the pairing is ambiguous while it\n * parses `command`/`commandfor` and never sees a `type` serialized after them.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { Tree } from \"@sdxc/ui/tree\";\n\ndescribe(\"Tree.ExpandButton\", () => {\n\ttest(\"renders as decoration, so the summary it sits in keeps the activation\", async () => {\n\t\tlet html = await renderToString(<Tree.ExpandButton />);\n\n\t\texpect(html).not.toContain(\"<button\");\n\t\texpect(html).toContain(\"<span\");\n\t});\n\n\ttest(\"is hidden from the accessibility tree, which the row already speaks for\", async () => {\n\t\tlet html = await renderToString(<Tree.ExpandButton />);\n\n\t\texpect(html).toContain('aria-hidden=\"true\"');\n\t});\n});\n"
|
|
17
|
-
}
|
|
18
|
-
}
|