@designa8/vibedesign-nestora-ds-v1-176b 0.2.3 → 0.2.5
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/README.md +1 -1
- package/dist/index.cjs +9 -3
- package/dist/index.js +9 -3
- package/package.json +1 -1
- package/src/molecules/ListItem/ListItem.tsx +25 -3
- package/src/molecules/ListItem/preview.tsx +48 -23
- package/src/molecules/Rating/Rating.tsx +7 -1
- package/src/molecules/Rating/preview.tsx +6 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @designa8/vibedesign-nestora-ds-v1-176b
|
|
2
2
|
|
|
3
|
-
Complete design system generated by Atoms Design, version **0.2.
|
|
3
|
+
Complete design system generated by Atoms Design, version **0.2.5**.
|
|
4
4
|
Tokens, atoms, molecules, organisms, and templates — import from the package root;
|
|
5
5
|
never hardcode visual values in consumer code.
|
|
6
6
|
|
package/dist/index.cjs
CHANGED
|
@@ -5266,6 +5266,10 @@ var LEADING = "flex min-w-0 items-center gap-sm";
|
|
|
5266
5266
|
var TRAILING = "flex shrink-0 items-center gap-sm";
|
|
5267
5267
|
var META = "text-body-md font-weight-body-md text-muted";
|
|
5268
5268
|
var ROW_POINTER = "cursor-pointer transition duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue disabled:cursor-not-allowed disabled:opacity-50";
|
|
5269
|
+
var ROW_VARIANT = {
|
|
5270
|
+
card: { variant: "row", size: "md" },
|
|
5271
|
+
plain: { variant: "row-quiet", size: "md" }
|
|
5272
|
+
};
|
|
5269
5273
|
var ListItem = React40.forwardRef(
|
|
5270
5274
|
function ListItem2({
|
|
5271
5275
|
icon = "arrow-up-right",
|
|
@@ -5274,6 +5278,7 @@ var ListItem = React40.forwardRef(
|
|
|
5274
5278
|
selected,
|
|
5275
5279
|
trailingIcon = "chevron-right",
|
|
5276
5280
|
visualState = "rest",
|
|
5281
|
+
chrome = "card",
|
|
5277
5282
|
disabled = false,
|
|
5278
5283
|
className,
|
|
5279
5284
|
children,
|
|
@@ -5283,13 +5288,14 @@ var ListItem = React40.forwardRef(
|
|
|
5283
5288
|
}, ref) {
|
|
5284
5289
|
const leadingNode = leading ?? (icon ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon, { name: icon, size: 18, strokeWidth: 1.75, className: "shrink-0" }) : null);
|
|
5285
5290
|
const isOption = selected !== void 0;
|
|
5291
|
+
const recipe = ROW_VARIANT[chrome] ?? ROW_VARIANT.card;
|
|
5286
5292
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
5287
5293
|
Button,
|
|
5288
5294
|
{
|
|
5289
5295
|
ref,
|
|
5290
5296
|
type,
|
|
5291
|
-
variant:
|
|
5292
|
-
size:
|
|
5297
|
+
variant: recipe.variant,
|
|
5298
|
+
size: recipe.size,
|
|
5293
5299
|
role: role ?? (isOption ? "option" : void 0),
|
|
5294
5300
|
"aria-selected": isOption ? selected : void 0,
|
|
5295
5301
|
"aria-checked": isOption ? selected : void 0,
|
|
@@ -5765,7 +5771,7 @@ var Rating = React45.forwardRef(
|
|
|
5765
5771
|
const shown = hovered > 0 ? hovered : Math.min(Math.max(value, 0), starCount);
|
|
5766
5772
|
const focusIndex = Math.min(Math.max(Math.round(value), 1), starCount);
|
|
5767
5773
|
const countText = formatNumber(count);
|
|
5768
|
-
const fillFor = (index) =>
|
|
5774
|
+
const fillFor = (index) => Math.min(Math.max(shown - index, 0), 1);
|
|
5769
5775
|
const handleKey = (event) => {
|
|
5770
5776
|
const current = Math.max(1, Math.round(value));
|
|
5771
5777
|
let next = current;
|
package/dist/index.js
CHANGED
|
@@ -5141,6 +5141,10 @@ var LEADING = "flex min-w-0 items-center gap-sm";
|
|
|
5141
5141
|
var TRAILING = "flex shrink-0 items-center gap-sm";
|
|
5142
5142
|
var META = "text-body-md font-weight-body-md text-muted";
|
|
5143
5143
|
var ROW_POINTER = "cursor-pointer transition duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue disabled:cursor-not-allowed disabled:opacity-50";
|
|
5144
|
+
var ROW_VARIANT = {
|
|
5145
|
+
card: { variant: "row", size: "md" },
|
|
5146
|
+
plain: { variant: "row-quiet", size: "md" }
|
|
5147
|
+
};
|
|
5144
5148
|
var ListItem = React40.forwardRef(
|
|
5145
5149
|
function ListItem2({
|
|
5146
5150
|
icon = "arrow-up-right",
|
|
@@ -5149,6 +5153,7 @@ var ListItem = React40.forwardRef(
|
|
|
5149
5153
|
selected,
|
|
5150
5154
|
trailingIcon = "chevron-right",
|
|
5151
5155
|
visualState = "rest",
|
|
5156
|
+
chrome = "card",
|
|
5152
5157
|
disabled = false,
|
|
5153
5158
|
className,
|
|
5154
5159
|
children,
|
|
@@ -5158,13 +5163,14 @@ var ListItem = React40.forwardRef(
|
|
|
5158
5163
|
}, ref) {
|
|
5159
5164
|
const leadingNode = leading ?? (icon ? /* @__PURE__ */ jsx40(Icon, { name: icon, size: 18, strokeWidth: 1.75, className: "shrink-0" }) : null);
|
|
5160
5165
|
const isOption = selected !== void 0;
|
|
5166
|
+
const recipe = ROW_VARIANT[chrome] ?? ROW_VARIANT.card;
|
|
5161
5167
|
return /* @__PURE__ */ jsxs37(
|
|
5162
5168
|
Button,
|
|
5163
5169
|
{
|
|
5164
5170
|
ref,
|
|
5165
5171
|
type,
|
|
5166
|
-
variant:
|
|
5167
|
-
size:
|
|
5172
|
+
variant: recipe.variant,
|
|
5173
|
+
size: recipe.size,
|
|
5168
5174
|
role: role ?? (isOption ? "option" : void 0),
|
|
5169
5175
|
"aria-selected": isOption ? selected : void 0,
|
|
5170
5176
|
"aria-checked": isOption ? selected : void 0,
|
|
@@ -5640,7 +5646,7 @@ var Rating = React45.forwardRef(
|
|
|
5640
5646
|
const shown = hovered > 0 ? hovered : Math.min(Math.max(value, 0), starCount);
|
|
5641
5647
|
const focusIndex = Math.min(Math.max(Math.round(value), 1), starCount);
|
|
5642
5648
|
const countText = formatNumber(count);
|
|
5643
|
-
const fillFor = (index) =>
|
|
5649
|
+
const fillFor = (index) => Math.min(Math.max(shown - index, 0), 1);
|
|
5644
5650
|
const handleKey = (event) => {
|
|
5645
5651
|
const current = Math.max(1, Math.round(value));
|
|
5646
5652
|
let next = current;
|
package/package.json
CHANGED
|
@@ -11,6 +11,13 @@ type IconGlyph = React.ComponentProps<typeof Icon>["name"];
|
|
|
11
11
|
*/
|
|
12
12
|
export type ListItemVisualState = "rest" | "hover";
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Row chrome. `card` (default) is the bordered, canvas-filled row for a loose
|
|
16
|
+
* list. `plain` is the borderless, transparent row for a list that already sits
|
|
17
|
+
* inside a bordered panel — a command palette, a popover, a menu-like surface.
|
|
18
|
+
*/
|
|
19
|
+
export type ListItemChrome = "card" | "plain";
|
|
20
|
+
|
|
14
21
|
export interface ListItemProps
|
|
15
22
|
extends Omit<React.ComponentPropsWithoutRef<"button">, "children"> {
|
|
16
23
|
/** Row label — the primary line the row is about. */
|
|
@@ -31,6 +38,12 @@ export interface ListItemProps
|
|
|
31
38
|
trailingIcon?: IconGlyph | null;
|
|
32
39
|
/** Freezes one interaction state at rest (documentation boards). */
|
|
33
40
|
visualState?: ListItemVisualState;
|
|
41
|
+
/**
|
|
42
|
+
* `card` (default) keeps the bordered row. `plain` drops the border and the
|
|
43
|
+
* canvas fill so the row sits flush inside a panel that already owns a
|
|
44
|
+
* stroke — no box inside a box.
|
|
45
|
+
*/
|
|
46
|
+
chrome?: ListItemChrome;
|
|
34
47
|
}
|
|
35
48
|
|
|
36
49
|
const LEADING = "flex min-w-0 items-center gap-sm";
|
|
@@ -48,10 +61,16 @@ const ROW_POINTER =
|
|
|
48
61
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue " +
|
|
49
62
|
"disabled:cursor-not-allowed disabled:opacity-50";
|
|
50
63
|
|
|
64
|
+
const ROW_VARIANT = {
|
|
65
|
+
card: { variant: "row", size: "md" },
|
|
66
|
+
plain: { variant: "row-quiet", size: "md" },
|
|
67
|
+
} as const;
|
|
68
|
+
|
|
51
69
|
/**
|
|
52
70
|
* Compact navigation row: leading glyph, label, an optional trailing value, and
|
|
53
71
|
* a disclosure chevron. Used in a settings list, a category picker, or a
|
|
54
|
-
* selectable group.
|
|
72
|
+
* selectable group. Pass `chrome="plain"` inside an already-bordered panel
|
|
73
|
+
* (command palette results, popover lists).
|
|
55
74
|
*/
|
|
56
75
|
export const ListItem = React.forwardRef<HTMLButtonElement, ListItemProps>(
|
|
57
76
|
function ListItem(
|
|
@@ -62,6 +81,7 @@ export const ListItem = React.forwardRef<HTMLButtonElement, ListItemProps>(
|
|
|
62
81
|
selected,
|
|
63
82
|
trailingIcon = "chevron-right",
|
|
64
83
|
visualState = "rest",
|
|
84
|
+
chrome = "card",
|
|
65
85
|
disabled = false,
|
|
66
86
|
className,
|
|
67
87
|
children,
|
|
@@ -79,12 +99,14 @@ export const ListItem = React.forwardRef<HTMLButtonElement, ListItemProps>(
|
|
|
79
99
|
|
|
80
100
|
const isOption = selected !== undefined;
|
|
81
101
|
|
|
102
|
+
const recipe = ROW_VARIANT[chrome] ?? ROW_VARIANT.card;
|
|
103
|
+
|
|
82
104
|
return (
|
|
83
105
|
<Button
|
|
84
106
|
ref={ref}
|
|
85
107
|
type={type}
|
|
86
|
-
variant=
|
|
87
|
-
size=
|
|
108
|
+
variant={recipe.variant}
|
|
109
|
+
size={recipe.size}
|
|
88
110
|
role={role ?? (isOption ? "option" : undefined)}
|
|
89
111
|
aria-selected={isOption ? selected : undefined}
|
|
90
112
|
/* The shared row recipe paints its chosen state from aria-checked. */
|
|
@@ -7,12 +7,28 @@ const OPTIONS = [
|
|
|
7
7
|
{ id: "rent", label: "Rent", meta: "1,250 USD" },
|
|
8
8
|
];
|
|
9
9
|
|
|
10
|
+
const COMMANDS = [
|
|
11
|
+
{ id: "new-payment", label: "New payment", meta: "1,000 USD" },
|
|
12
|
+
{ id: "add-payee", label: "Add a payee", meta: "240 USD" },
|
|
13
|
+
{ id: "export", label: "Export statement", meta: "0 USD" },
|
|
14
|
+
];
|
|
15
|
+
|
|
10
16
|
const HEADING = "text-heading-xs text-ink";
|
|
11
17
|
|
|
12
18
|
const CAPTION = "block text-caption text-muted";
|
|
13
19
|
|
|
20
|
+
/* A panel that already owns the stroke — the rows inside it must not add one. */
|
|
21
|
+
const PANEL =
|
|
22
|
+
"w-full rounded-lg border border-hairline bg-surface p-xs shadow-card";
|
|
23
|
+
|
|
14
24
|
export default function ListItemPreview() {
|
|
15
|
-
const [selected, setSelected] = React.useState(
|
|
25
|
+
const [selected, setSelected] = React.useState<string | null>(null);
|
|
26
|
+
const [command, setCommand] = React.useState<string | null>(null);
|
|
27
|
+
|
|
28
|
+
const selectedLabel =
|
|
29
|
+
OPTIONS.find((option) => option.id === selected)?.label ?? "none";
|
|
30
|
+
const commandLabel =
|
|
31
|
+
COMMANDS.find((entry) => entry.id === command)?.label ?? "none";
|
|
16
32
|
|
|
17
33
|
return (
|
|
18
34
|
<div className="w-full max-w-3xl mx-auto space-y-xl p-lg text-ink">
|
|
@@ -23,21 +39,38 @@ export default function ListItemPreview() {
|
|
|
23
39
|
aria-label="Recent payees"
|
|
24
40
|
className="flex w-full flex-col gap-xs"
|
|
25
41
|
>
|
|
26
|
-
{OPTIONS.map((option) =>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
{OPTIONS.map((option) => (
|
|
43
|
+
<ListItem
|
|
44
|
+
key={option.id}
|
|
45
|
+
selected={selected === option.id}
|
|
46
|
+
meta={option.meta}
|
|
47
|
+
onClick={() => setSelected(option.id)}
|
|
48
|
+
>
|
|
49
|
+
{option.label}
|
|
50
|
+
</ListItem>
|
|
51
|
+
))}
|
|
52
|
+
</div>
|
|
53
|
+
<span className={CAPTION}>{`Selected: ${selectedLabel}`}</span>
|
|
54
|
+
</section>
|
|
55
|
+
|
|
56
|
+
<section className="space-y-sm">
|
|
57
|
+
<h2 className={HEADING}>Inside a bordered panel</h2>
|
|
58
|
+
<div role="listbox" aria-label="Command results" className={PANEL}>
|
|
59
|
+
{COMMANDS.map((entry) => (
|
|
60
|
+
<ListItem
|
|
61
|
+
key={entry.id}
|
|
62
|
+
chrome="plain"
|
|
63
|
+
selected={command === entry.id}
|
|
64
|
+
meta={entry.meta}
|
|
65
|
+
onClick={() => setCommand(entry.id)}
|
|
66
|
+
>
|
|
67
|
+
{entry.label}
|
|
68
|
+
</ListItem>
|
|
69
|
+
))}
|
|
39
70
|
</div>
|
|
40
|
-
<span className={CAPTION}>
|
|
71
|
+
<span className={CAPTION}>
|
|
72
|
+
{`Selected: ${commandLabel} — chrome="plain" keeps a single stroke on the panel.`}
|
|
73
|
+
</span>
|
|
41
74
|
</section>
|
|
42
75
|
|
|
43
76
|
<section className="space-y-sm">
|
|
@@ -51,14 +84,6 @@ export default function ListItemPreview() {
|
|
|
51
84
|
<ListItem visualState="hover">Transfers</ListItem>
|
|
52
85
|
<span className={CAPTION}>Hover</span>
|
|
53
86
|
</div>
|
|
54
|
-
<div className="space-y-xs">
|
|
55
|
-
<div role="listbox" aria-label="Selected example">
|
|
56
|
-
<ListItem selected meta="1,000 USD">
|
|
57
|
-
Transfers
|
|
58
|
-
</ListItem>
|
|
59
|
-
</div>
|
|
60
|
-
<span className={CAPTION}>Selected</span>
|
|
61
|
-
</div>
|
|
62
87
|
<div className="space-y-xs">
|
|
63
88
|
<ListItem meta="1,000 USD">Transfers</ListItem>
|
|
64
89
|
<span className={CAPTION}>With meta</span>
|
|
@@ -148,7 +148,13 @@ export const Rating = React.forwardRef<HTMLDivElement, RatingProps>(
|
|
|
148
148
|
const focusIndex = Math.min(Math.max(Math.round(value), 1), starCount);
|
|
149
149
|
const countText = formatNumber(count);
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
/**
|
|
152
|
+
* Share of one star that is filled, 0–1.
|
|
153
|
+
* `shown - index` is a star count (4.8 at index 0 leaves 3.8), so the
|
|
154
|
+
* leftover is clamped to a single glyph — 1 full star, 0.8 partial, 0 empty.
|
|
155
|
+
*/
|
|
156
|
+
const fillFor = (index: number) =>
|
|
157
|
+
Math.min(Math.max(shown - index, 0), 1);
|
|
152
158
|
|
|
153
159
|
const handleKey = (event: React.KeyboardEvent<HTMLButtonElement>) => {
|
|
154
160
|
const current = Math.max(1, Math.round(value));
|
|
@@ -24,7 +24,11 @@ export default function Preview() {
|
|
|
24
24
|
|
|
25
25
|
<div className="flex flex-col gap-sm">
|
|
26
26
|
<span className="text-caption text-muted">Partial</span>
|
|
27
|
-
<
|
|
27
|
+
<div className="flex flex-wrap items-center gap-lg">
|
|
28
|
+
<Rating value={3.5} readOnly />
|
|
29
|
+
<Rating value={4.8} readOnly />
|
|
30
|
+
<Rating value={4.8} size="sm" readOnly />
|
|
31
|
+
</div>
|
|
28
32
|
</div>
|
|
29
33
|
|
|
30
34
|
<div className="flex flex-col gap-sm">
|
|
@@ -50,7 +54,7 @@ export default function Preview() {
|
|
|
50
54
|
|
|
51
55
|
<div className="flex flex-col gap-sm">
|
|
52
56
|
<span className="text-caption text-muted">Large score with breakdown</span>
|
|
53
|
-
<Rating variant="summary" value={4.
|
|
57
|
+
<Rating variant="summary" value={4.8} readOnly breakdown={BREAKDOWN} />
|
|
54
58
|
</div>
|
|
55
59
|
|
|
56
60
|
<div className="flex flex-col gap-sm">
|