@nadicodeai/ui 12.1.203 → 12.1.204
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.
|
@@ -48,8 +48,10 @@ export type ChoiceboxGroupProps = ChoiceboxGroupBase & ({
|
|
|
48
48
|
* `ChoiceboxGroupItem`, which throws outside a `ChoiceboxGroup`. The group has a `label`
|
|
49
49
|
* and a `type`, and every tile a `title` and a `description`; a group or a tile without them does
|
|
50
50
|
* not compile. Tiles share one row and wrap to a column on a narrow screen;
|
|
51
|
-
* `orientation="vertical"` stacks them.
|
|
52
|
-
*
|
|
51
|
+
* `orientation="vertical"` stacks them. Tiles in a row take the tallest one's height, and the
|
|
52
|
+
* tint fills it. They are 12 px apart, each with 12 px inside and 24 px between its words and its
|
|
53
|
+
* corner mark, the mark level with the title, so the marks of a row sit level whatever each tile
|
|
54
|
+
* holds below its title. Colour: a selected,
|
|
53
55
|
* available tile is the one place blue sits on a choice, as a blue border, a blue tint behind the
|
|
54
56
|
* title and description, blue words, and a blue corner mark; a selected tile that is unavailable
|
|
55
57
|
* stays grey, never a faded blue. An unselected tile stays neutral and takes a grey fill on hover.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choicebox.d.ts","sourceRoot":"","sources":["../../src/components/choicebox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B,KAAK,kBAAkB,GAAG;IACxB,6FAA6F;IAC7F,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oEAAoE;IACpE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,mBAAm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CACzC,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC3C,CACJ,CAAC;AAQJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,iBAAS,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBA6DjD;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC,CAAC;AAEF,iBAAS,kBAAkB,CAAC,EAC1B,KAAK,EACL,KAAK,EACL,WAAW,EACX,KAAK,EACL,KAAK,EACL,cAAc,EACd,SAAS,EACT,aAAa,GACd,EAAE,uBAAuB,qBA4FzB;AAED,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -40,8 +40,10 @@ function asList(value) {
|
|
|
40
40
|
* `ChoiceboxGroupItem`, which throws outside a `ChoiceboxGroup`. The group has a `label`
|
|
41
41
|
* and a `type`, and every tile a `title` and a `description`; a group or a tile without them does
|
|
42
42
|
* not compile. Tiles share one row and wrap to a column on a narrow screen;
|
|
43
|
-
* `orientation="vertical"` stacks them.
|
|
44
|
-
*
|
|
43
|
+
* `orientation="vertical"` stacks them. Tiles in a row take the tallest one's height, and the
|
|
44
|
+
* tint fills it. They are 12 px apart, each with 12 px inside and 24 px between its words and its
|
|
45
|
+
* corner mark, the mark level with the title, so the marks of a row sit level whatever each tile
|
|
46
|
+
* holds below its title. Colour: a selected,
|
|
45
47
|
* available tile is the one place blue sits on a choice, as a blue border, a blue tint behind the
|
|
46
48
|
* title and description, blue words, and a blue corner mark; a selected tile that is unavailable
|
|
47
49
|
* stays grey, never a faded blue. An unselected tile stays neutral and takes a grey fill on hover.
|
|
@@ -113,6 +115,6 @@ function ChoiceboxGroupItem({ value, title, description, specs, badge, disabledR
|
|
|
113
115
|
disabled: Boolean(disabledReason) || group.groupReasonId !== undefined,
|
|
114
116
|
value,
|
|
115
117
|
};
|
|
116
|
-
return (_jsxs("div", { className: cn("group/choicebox flex flex-col overflow-hidden rounded-sm border bg-background nc-transition-paint not-has-data-disabled:hover:bg-accent has-focus-visible:nc-focus-outline has-focus-visible:outline-ring has-data-checked:not-has-data-disabled:border-info", className), "data-slot": "choicebox-item", children: [_jsxs("label", { className: "flex cursor-pointer items-
|
|
118
|
+
return (_jsxs("div", { className: cn("group/choicebox flex flex-col overflow-hidden rounded-sm border bg-background nc-transition-paint not-has-data-disabled:hover:bg-accent has-focus-visible:nc-focus-outline has-focus-visible:outline-ring has-data-checked:not-has-data-disabled:border-info", className), "data-slot": "choicebox-item", children: [_jsxs("label", { className: "flex flex-1 cursor-pointer items-start justify-between gap-6 p-3 nc-transition-paint has-data-checked:not-has-data-disabled:bg-info-soft has-data-disabled:cursor-not-allowed", children: [_jsxs("span", { className: "flex min-w-0 flex-col gap-1", children: [_jsxs("span", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-sm font-medium group-has-data-checked/choicebox:not-group-has-data-disabled/choicebox:text-info-soft-foreground group-has-data-disabled/choicebox:text-muted-foreground", id: titleId, children: title }), badge ? (_jsx(Badge, { id: badgeId, size: "sm", variant: "secondary", children: badge })) : null] }), specs?.length ? (_jsx("span", { className: "flex flex-wrap gap-1", id: specsId, children: specs.map((spec) => (_jsx(Badge, { size: "sm", variant: "secondary", children: spec }, spec))) })) : null, _jsx("span", { className: "text-sm text-muted-foreground group-has-data-checked/choicebox:not-group-has-data-disabled/choicebox:text-info-soft-foreground", id: descriptionId, children: description }), disabledReason ? (_jsx("span", { className: "text-sm text-muted-foreground", id: reasonId, children: disabledReason })) : null] }), group.type === "radio" ? (_jsx(RadioGroupItem, { ...control, className: "mt-0.5 outline-none data-checked:not-data-disabled:border-info-soft-foreground data-checked:not-data-disabled:text-info-soft-foreground" })) : (_jsx(Checkbox, { ...control, className: "mt-0.5 outline-none data-checked:not-data-disabled:border-info-soft-foreground data-checked:not-data-disabled:bg-info-soft-foreground data-checked:not-data-disabled:text-info-soft", name: group.name }))] }), selectedFacts?.length && group.selected.includes(value) ? (_jsx("div", { className: "p-2", "data-slot": "choicebox-content", children: selectedFacts.map((fact) => (_jsx(FieldDescription, { children: fact }, fact))) })) : null] }));
|
|
117
119
|
}
|
|
118
120
|
export { ChoiceboxGroup, ChoiceboxGroupItem };
|
|
@@ -538,7 +538,7 @@ export const USAGE = [
|
|
|
538
538
|
summary: "A group of larger tiles, each a radio or a checkbox with a title and a description.",
|
|
539
539
|
when: '"A choice that benefits from a larger tap target plus a description or icon, like a framework picker, plan comparison, or deployment region with latency." (https://vercel.com/geist/choicebox) "Single-select for mutually exclusive choices, multi-select for additive ones." (https://vercel.com/geist/choicebox) "Don’t mix the two within one group." (https://vercel.com/geist/choicebox) "Cap at 4–6 tiles." (https://vercel.com/geist/choicebox) Ours: where a Library entry applies, an API key\'s access level. The options are known in advance and number no more than six.',
|
|
540
540
|
instead: '"Past that, switch to `Select` or `Combobox` so the page doesn’t scroll for a single field." (https://vercel.com/geist/choicebox) "For plain text labels with no description, use `Radio`." (https://vercel.com/geist/choicebox) Ours: Geist\'s `Radio` is our `RadioGroup`, or a `Checkbox` for several. Two or three views of one surface are a `SegmentedControl`.',
|
|
541
|
-
behaviour: '"The whole tile is the click and focus target; tapping anywhere inside selects it." (https://vercel.com/geist/choicebox) "Don’t place nested buttons or links inside a tile that would steal the click." (https://vercel.com/geist/choicebox) "Selected state shows a check or filled dot in the corner." (https://vercel.com/geist/choicebox) "The border highlight alone isn’t enough on low-contrast screens." (https://vercel.com/geist/choicebox) "Disabled tiles need a Tooltip naming why (`Available on Pro`)." (https://vercel.com/geist/choicebox) "A faded tile with no reason reads as broken." (https://vercel.com/geist/choicebox) Ours: each tile is a `ChoiceboxGroupItem`, which throws outside a `ChoiceboxGroup`. The group has a `label` and a `type`, and every tile a `title` and a `description`; a group or a tile without them does not compile. Tiles share one row and wrap to a column on a narrow screen; `orientation="vertical"` stacks them. They are 12 px apart, each with 12 px inside and 24 px between its words and its corner mark, the mark
|
|
541
|
+
behaviour: '"The whole tile is the click and focus target; tapping anywhere inside selects it." (https://vercel.com/geist/choicebox) "Don’t place nested buttons or links inside a tile that would steal the click." (https://vercel.com/geist/choicebox) "Selected state shows a check or filled dot in the corner." (https://vercel.com/geist/choicebox) "The border highlight alone isn’t enough on low-contrast screens." (https://vercel.com/geist/choicebox) "Disabled tiles need a Tooltip naming why (`Available on Pro`)." (https://vercel.com/geist/choicebox) "A faded tile with no reason reads as broken." (https://vercel.com/geist/choicebox) Ours: each tile is a `ChoiceboxGroupItem`, which throws outside a `ChoiceboxGroup`. The group has a `label` and a `type`, and every tile a `title` and a `description`; a group or a tile without them does not compile. Tiles share one row and wrap to a column on a narrow screen; `orientation="vertical"` stacks them. Tiles in a row take the tallest one\'s height, and the tint fills it. They are 12 px apart, each with 12 px inside and 24 px between its words and its corner mark, the mark level with the title, so the marks of a row sit level whatever each tile holds below its title. Colour: a selected, available tile is the one place blue sits on a choice, as a blue border, a blue tint behind the title and description, blue words, and a blue corner mark; a selected tile that is unavailable stays grey, never a faded blue. An unselected tile stays neutral and takes a grey fill on hover. The corner always draws the dot or the check, empty until the tile is selected. The whole tinted row (title, specs, description, reason and corner mark) is the label that selects; `selectedFacts` of a tile appear below that row while it is selected, outside the label, so a click there does not select, and they are text for reading, never a link or a button. A tile, or the whole group, is unavailable only with a `disabledReason`, written under the tile\'s description or the legend, and only its title greys. A tile may carry `specs`, grey chips under its title, and one `badge` beside it for the option to prefer (*Recommended*); both are grey `secondary` badges, because blue marks only the selected tile.',
|
|
542
542
|
words: '"Titles are parallel: one Title Case title plus one sentence-case description per tile, ending in a period." (https://vercel.com/geist/choicebox) "Don’t restate the title in the description." (https://vercel.com/geist/choicebox) "The description adds the differentiator (`$20/mo · 100 GB bandwidth`), not a synonym." (https://vercel.com/geist/choicebox) "Icons are decorative when paired with a title; if the icon is the only label, give the tile an `aria-label` naming the choice." (https://vercel.com/geist/choicebox) Ours: the title is a short noun phrase in sentence case: *Pro trial*; the description is *Free for two weeks.* The label names the choice: *Plan*.',
|
|
543
543
|
access: '"Tiles render as radios or checkboxes under the hood, so keep them inside a `<fieldset>` with a `<legend>` so screen readers announce the group." (https://vercel.com/geist/choicebox) "Arrow keys move within a single-select group, Space toggles in multi-select." (https://vercel.com/geist/choicebox) "Don’t override those keys with custom handlers." (https://vercel.com/geist/choicebox) "Color is not the selection signal." (https://vercel.com/geist/choicebox) "Pair the highlight border with the corner check so colorblind users still see what’s active." (https://vercel.com/geist/choicebox) Ours: a `FieldSet` with the label as its legend, which names a group of checkboxes; a `role="radiogroup"` is labelled by the same legend. Each tile is named by its title and described by its description and reason. Keyboard focus outlines the whole tile, and the box in its corner draws no outline of its own.',
|
|
544
544
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadicodeai/ui",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.204",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#jsx": "./src/jsx/index.ts",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@headless-tree/react": "1.8.0",
|
|
79
79
|
"@iconify-icons/logos": "^2.0.3",
|
|
80
80
|
"@iconify/react": "^6.0.2",
|
|
81
|
-
"@nadicodeai/design-system": "12.1.
|
|
81
|
+
"@nadicodeai/design-system": "12.1.204",
|
|
82
82
|
"@tanstack/react-table": "^9.3.1",
|
|
83
83
|
"@vgpu/wgsl": "0.6.0",
|
|
84
84
|
"class-variance-authority": "^0.7.1",
|