@ciridae/ui 1.0.14 → 1.1.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.
Files changed (41) hide show
  1. package/dist/ciridae.css +5 -0
  2. package/dist/components/app-frame.d.ts +29 -4
  3. package/dist/components/app-frame.js +16 -5
  4. package/dist/components/app-navigation.d.ts +16 -1
  5. package/dist/components/app-navigation.js +18 -7
  6. package/dist/components/badge.d.ts +14 -0
  7. package/dist/components/badge.js +38 -1
  8. package/dist/components/copyable-id.d.ts +10 -3
  9. package/dist/components/copyable-id.js +5 -2
  10. package/dist/components/data-display.js +14 -4
  11. package/dist/components/data-grid.js +5 -1
  12. package/dist/components/drawer.js +9 -1
  13. package/dist/components/filter-bar.d.ts +17 -8
  14. package/dist/components/filter-bar.js +38 -32
  15. package/dist/components/input.d.ts +6 -1
  16. package/dist/components/input.js +9 -3
  17. package/dist/components/layout.d.ts +7 -2
  18. package/dist/components/layout.js +34 -7
  19. package/dist/components/locale.d.ts +20 -0
  20. package/dist/components/locale.js +19 -1
  21. package/dist/components/objective-header.d.ts +25 -0
  22. package/dist/components/objective-header.js +70 -0
  23. package/dist/components/panel.d.ts +4 -2
  24. package/dist/components/panel.js +26 -3
  25. package/dist/components/settings.d.ts +7 -2
  26. package/dist/components/settings.js +11 -3
  27. package/dist/components/shell.js +7 -1
  28. package/dist/components/side-panel.d.ts +13 -3
  29. package/dist/components/side-panel.js +28 -7
  30. package/dist/components/sidebar.js +7 -10
  31. package/dist/components/switch.d.ts +7 -3
  32. package/dist/components/switch.js +17 -3
  33. package/dist/components/tabs.js +4 -1
  34. package/dist/components/value-change.d.ts +13 -0
  35. package/dist/components/value-change.js +59 -0
  36. package/dist/preset.js +14 -1
  37. package/dist/styled-system/styles.css +168 -80
  38. package/dist/styled-system/tokens/index.mjs +33 -1
  39. package/dist/styled-system/tokens/tokens.d.ts +3 -3
  40. package/dist/styles.css +5 -0
  41. package/package.json +9 -1
@@ -12,7 +12,10 @@ export type StackProps = useRender.ComponentProps<"div"> & {
12
12
  export declare function Stack({ gap, align, justify, render, className, ...props }: StackProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
13
13
  export type ClusterProps = useRender.ComponentProps<"div"> & {
14
14
  gap?: Gap;
15
- /** Wraps onto more lines when narrow; `false` keeps one line. Defaults to true. */
15
+ /**
16
+ * Wraps onto more lines when narrow; `false` keeps one line. Defaults to true, and in a `Toolbar`
17
+ * to one line above a phone's width.
18
+ */
16
19
  wrap?: boolean;
17
20
  };
18
21
  /** Children in a row, centered on one line. */
@@ -152,6 +155,8 @@ export type ListRowProps = Omit<useRender.ComponentProps<"div">, "children"> & {
152
155
  /** The leading checkbox's state, such as `checked` and `onCheckedChange`. */
153
156
  checkbox?: Omit<ComponentProps<typeof Checkbox>, "children" | "className" | "wrapperClassName">;
154
157
  flush?: boolean;
158
+ /** A hairline above the row when another precedes it, with the roomier block padding of a settings list. */
159
+ divider?: boolean;
155
160
  loading?: boolean;
156
161
  /**
157
162
  * Makes the whole row a link to this address; `render` takes a router's link instead. Keep
@@ -159,7 +164,7 @@ export type ListRowProps = Omit<useRender.ComponentProps<"div">, "children"> & {
159
164
  */
160
165
  href?: string;
161
166
  };
162
- export declare function ListRow({ leading, label, detail, trailing, checkbox, flush, loading, href, render, className, ...props }: ListRowProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
167
+ export declare function ListRow({ leading, label, detail, trailing, checkbox, flush, divider, loading, href, render, className, ...props }: ListRowProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
163
168
  /** A responsive grid of ChoiceCards, shared by provider, role, and client pickers. */
164
169
  export declare function ChoiceGrid({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
165
170
  /**
@@ -58,18 +58,22 @@ const cluster = cva({
58
58
  // One line: the cluster and its children shrink, so a long label truncates instead of
59
59
  // pushing the row wider.
60
60
  false: { flexWrap: "nowrap", minWidth: "0", "& > *": { minWidth: "0" } },
61
+ // A toolbar's controls stay on the tab row, as the Figma draws them, and wrap only on a
62
+ // phone; unlike `false`, its controls keep their own widths.
63
+ toolbar: { flexWrap: "nowrap", _phone: { flexWrap: "wrap" } },
61
64
  },
62
65
  },
63
66
  });
64
67
  /** Children in a row, centered on one line. */
65
- export function Cluster({ gap = "8", wrap = true, render, className, ...props }) {
68
+ export function Cluster({ gap = "8", wrap, render, className, ...props }) {
69
+ const inToolbar = useInToolbar();
66
70
  return useRender({
67
71
  defaultTagName: "div",
68
72
  render,
69
73
  props: {
70
74
  ...props,
71
75
  "data-ciridae-ui": "",
72
- className: cx(cluster({ wrap }), layoutGap({ gap }), className),
76
+ className: cx(cluster({ wrap: wrap ?? (inToolbar ? "toolbar" : true) }), layoutGap({ gap }), className),
73
77
  },
74
78
  });
75
79
  }
@@ -159,8 +163,15 @@ const ToolbarContext = createContext(false);
159
163
  export function useInToolbar() {
160
164
  return useContext(ToolbarContext);
161
165
  }
166
+ // At least the 38 of the controls it holds, so a row of tabs alone keeps the toolbar's height.
162
167
  const toolbar = cva({
163
- base: { display: "flex", alignItems: "center", flexWrap: "wrap", minWidth: "0" },
168
+ base: {
169
+ display: "flex",
170
+ alignItems: "center",
171
+ flexWrap: "wrap",
172
+ minWidth: "0",
173
+ minHeight: "control.default",
174
+ },
164
175
  variants: {
165
176
  justify: { start: {}, between: { justifyContent: "space-between" } },
166
177
  stackOnPhone: {
@@ -205,8 +216,16 @@ const listRow = cva({
205
216
  },
206
217
  true: {},
207
218
  },
219
+ // The Figma's settings and agent lists: 14 above and below, and a hairline between rows.
220
+ divider: {
221
+ true: {
222
+ paddingBlock: "listRow.dividedBlock",
223
+ "&:not(:first-child)": { borderTop: "1px solid token(colors.border.divider)" },
224
+ },
225
+ false: {},
226
+ },
208
227
  },
209
- defaultVariants: { flush: false },
228
+ defaultVariants: { flush: false, divider: false },
210
229
  });
211
230
  const listRowLink = css({
212
231
  color: "[inherit]",
@@ -215,7 +234,15 @@ const listRowLink = css({
215
234
  _hover: { background: "bg.rowHover" },
216
235
  _focusVisible: { focusRing: "inset" },
217
236
  });
218
- const stackedText = css({ display: "flex", flexDirection: "column", flex: "1", minWidth: "0" });
237
+ // Its own leading, so a label and its detail sit 17 apart, as the Figma's list rows draw them,
238
+ // even in a table whose single-line cells are set at 100%.
239
+ const stackedText = css({
240
+ display: "flex",
241
+ flexDirection: "column",
242
+ flex: "1",
243
+ minWidth: "0",
244
+ lineHeight: "stacked",
245
+ });
219
246
  // A flush row stays one line, as a table row does: the detail follows the label, and both cut
220
247
  // with an ellipsis.
221
248
  const inlineText = css({
@@ -238,7 +265,7 @@ const rowCheckboxBox = css({ flexShrink: "0" });
238
265
  export function ListRowText({ label, detail, inline = false, }) {
239
266
  return (_jsxs("span", { className: inline ? inlineText : stackedText, children: [label, detail && _jsx("span", { className: cx(rowDetail, inline && inlineRowDetail), children: detail })] }));
240
267
  }
241
- export function ListRow({ leading, label, detail, trailing, checkbox, flush = false, loading = false, href, render, className, ...props }) {
268
+ export function ListRow({ leading, label, detail, trailing, checkbox, flush = false, divider = false, loading = false, href, render, className, ...props }) {
242
269
  const link = href !== undefined || render !== undefined;
243
270
  return useRender({
244
271
  defaultTagName: href !== undefined ? "a" : "div",
@@ -247,7 +274,7 @@ export function ListRow({ leading, label, detail, trailing, checkbox, flush = fa
247
274
  ...(href !== undefined ? { href } : {}),
248
275
  ...props,
249
276
  "aria-busy": loading || undefined,
250
- className: cx(listRow({ flush }), link && listRowLink, className),
277
+ className: cx(listRow({ flush, divider }), link && listRowLink, className),
251
278
  "data-ciridae-ui": "",
252
279
  children: loading ? (_jsxs(_Fragment, { children: [_jsx(Skeleton, { shape: "circle", style: { width: 16 } }), _jsx("span", { className: stackedText, children: _jsx(Skeleton, { shape: "text", style: { width: "40%" } }) })] })) : checkbox ? (_jsxs(_Fragment, { children: [_jsxs(Checkbox, { ...checkbox, wrapperClassName: rowCheckbox, className: rowCheckboxBox, children: [leading && (_jsx("span", { className: rowLeading, "aria-hidden": "true", children: leading })), _jsx(ListRowText, { label: label, detail: detail, inline: flush })] }), trailing] })) : (_jsxs(_Fragment, { children: [leading && _jsx("span", { className: rowLeading, children: leading }), _jsx(ListRowText, { label: label, detail: detail, inline: flush }), trailing] })),
253
280
  },
@@ -320,6 +320,9 @@ export declare const englishLabels: {
320
320
  noMatches: (search: string) => string;
321
321
  };
322
322
  filters: {
323
+ /** The Filter pill that opens the builder. */
324
+ filter: string;
325
+ /** No longer drawn: the pill reads `filter`. Kept so a locale that sets it still compiles. */
323
326
  addFilter: string;
324
327
  clearAll: string;
325
328
  filterBy: string;
@@ -432,6 +435,23 @@ export declare const englishLabels: {
432
435
  status: string;
433
436
  localBuild: string;
434
437
  updateAvailable: string;
438
+ /** The settings sidebar's first row, and the name of its navigation. */
439
+ backToApp: string;
440
+ settings: string;
441
+ };
442
+ /** `Priority`'s words for its three levels. */
443
+ priority: {
444
+ high: string;
445
+ medium: string;
446
+ low: string;
447
+ };
448
+ objectiveHeader: {
449
+ objective: string;
450
+ };
451
+ /** Read before a `ValueChange`'s old and new values, which a screen reader does not mark as struck. */
452
+ valueChange: {
453
+ from: string;
454
+ to: string;
435
455
  };
436
456
  accountMenu: {
437
457
  menu: string;
@@ -295,6 +295,9 @@ export const englishLabels = {
295
295
  noMatches: (search) => `No matches for “${search}”`,
296
296
  },
297
297
  filters: {
298
+ /** The Filter pill that opens the builder. */
299
+ filter: "Filter",
300
+ /** No longer drawn: the pill reads `filter`. Kept so a locale that sets it still compiles. */
298
301
  addFilter: "Add filter",
299
302
  clearAll: "Clear all",
300
303
  filterBy: "Filter by…",
@@ -394,7 +397,19 @@ export const englishLabels = {
394
397
  fullScreen: "Full screen",
395
398
  exitFullScreen: "Exit full screen",
396
399
  },
397
- appFrame: { status: "Status", localBuild: "local", updateAvailable: "Update available" },
400
+ appFrame: {
401
+ status: "Status",
402
+ localBuild: "local",
403
+ updateAvailable: "Update available",
404
+ /** The settings sidebar's first row, and the name of its navigation. */
405
+ backToApp: "Back to app",
406
+ settings: "Settings",
407
+ },
408
+ /** `Priority`'s words for its three levels. */
409
+ priority: { high: "High", medium: "Medium", low: "Low" },
410
+ objectiveHeader: { objective: "Objective" },
411
+ /** Read before a `ValueChange`'s old and new values, which a screen reader does not mark as struck. */
412
+ valueChange: { from: "from", to: "to" },
398
413
  accountMenu: { menu: "Account menu", signOut: "Sign out" },
399
414
  themeCustomizer: {
400
415
  colorTheme: "Color theme",
@@ -483,6 +498,9 @@ function mergeLabels(overrides) {
483
498
  clipboard: { ...englishLabels.clipboard, ...overrides.clipboard },
484
499
  accountMenu: { ...englishLabels.accountMenu, ...overrides.accountMenu },
485
500
  appFrame: { ...englishLabels.appFrame, ...overrides.appFrame },
501
+ priority: { ...englishLabels.priority, ...overrides.priority },
502
+ objectiveHeader: { ...englishLabels.objectiveHeader, ...overrides.objectiveHeader },
503
+ valueChange: { ...englishLabels.valueChange, ...overrides.valueChange },
486
504
  };
487
505
  }
488
506
  /** The locale value `useCiridaeLocale` returns, for use outside React or in tests. */
@@ -0,0 +1,25 @@
1
+ import { type ComponentProps, type ReactNode } from "react";
2
+ /** One fact on the measure line: its muted label, then its value, such as "Reads" "Invoices". */
3
+ export type ObjectiveMeasure = {
4
+ label: ReactNode;
5
+ value: ReactNode;
6
+ };
7
+ export type ObjectiveHeaderProps = Omit<ComponentProps<"section">, "title"> & {
8
+ /** What the agent is trying to achieve. */
9
+ objective: ReactNode;
10
+ /** The muted label over it; the locale's "Objective" when left out. */
11
+ eyebrow?: ReactNode;
12
+ /** The line under it, split by dots, such as "Measured as" and "Reads". */
13
+ measures?: readonly ObjectiveMeasure[];
14
+ /** The large figure at the far edge, such as "94%". */
15
+ figure?: ReactNode;
16
+ /** Under the figure, such as "Last 30 days · up 3 pts". */
17
+ caption?: ReactNode;
18
+ /** After a hairline at the far edge, such as an Edit button. */
19
+ actions?: ReactNode;
20
+ };
21
+ /**
22
+ * An agent's objective as a card: the objective with its measure line, and at the far edge the
23
+ * figure with its caption under it, then the actions.
24
+ */
25
+ export declare function ObjectiveHeader({ objective, eyebrow, measures, figure, caption, actions, className, ...props }: ObjectiveHeaderProps): import("react").JSX.Element;
@@ -0,0 +1,70 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /*
3
+ * The objective an agent works toward, as the Figma's Agent policies page opens with it: a muted
4
+ * "Objective" eyebrow, the objective, and a line of what it is measured as and reads; at the far
5
+ * edge the figure for the last period with its caption under it, a hairline, and the actions.
6
+ */
7
+ import { Fragment } from "react";
8
+ import { css, cx } from "#primitives/css";
9
+ import { useCiridaeLocale } from "./locale.js";
10
+ import { cardSurface } from "./panel.js";
11
+ const card = css(cardSurface, {
12
+ display: "flex",
13
+ alignItems: "center",
14
+ justifyContent: "space-between",
15
+ gap: "layout.clusterGap",
16
+ padding: "panel.comfortable",
17
+ _phone: { flexDirection: "column", alignItems: "stretch" },
18
+ });
19
+ const copy = css({ display: "grid", gap: "layout.controlGap", minWidth: "0" });
20
+ const heading = css({ display: "grid", gap: "layout.tightGap", minWidth: "0" });
21
+ const small = css({
22
+ fontSize: "code",
23
+ fontWeight: "medium",
24
+ letterSpacing: "compact",
25
+ lineHeight: "tight",
26
+ });
27
+ const muted = css({ color: "fg.label" });
28
+ const statement = css({
29
+ margin: "none",
30
+ fontSize: "body",
31
+ fontWeight: "medium",
32
+ letterSpacing: "compact",
33
+ lineHeight: "tight",
34
+ });
35
+ const measureLine = css({
36
+ display: "flex",
37
+ flexWrap: "wrap",
38
+ alignItems: "center",
39
+ gap: "layout.controlGap",
40
+ color: "fg.primary",
41
+ });
42
+ const measure = css({ display: "inline-flex", gap: "layout.tightGap" });
43
+ const result = css({
44
+ display: "flex",
45
+ alignItems: "center",
46
+ gap: "layout.clusterGap",
47
+ flexShrink: "0",
48
+ });
49
+ const score = css({ display: "grid", justifyItems: "end", gap: "control.iconGap" });
50
+ const figureText = css({
51
+ fontSize: "heading.page",
52
+ fontWeight: "medium",
53
+ letterSpacing: "compact",
54
+ lineHeight: "tight",
55
+ });
56
+ const divider = css({
57
+ width: "border.hairline",
58
+ alignSelf: "stretch",
59
+ background: "border.divider",
60
+ });
61
+ /**
62
+ * An agent's objective as a card: the objective with its measure line, and at the far edge the
63
+ * figure with its caption under it, then the actions.
64
+ */
65
+ export function ObjectiveHeader({ objective, eyebrow, measures = [], figure, caption, actions, className, ...props }) {
66
+ const { labels } = useCiridaeLocale();
67
+ const label = eyebrow ?? labels.objectiveHeader.objective;
68
+ const hasResult = figure !== undefined || caption !== undefined;
69
+ return (_jsxs("section", { "aria-label": typeof label === "string" ? label : undefined, ...props, className: cx(card, className), "data-ciridae-ui": "", children: [_jsxs("div", { className: copy, children: [_jsxs("div", { className: heading, children: [_jsx("span", { className: cx(small, muted), children: label }), _jsx("p", { className: statement, children: objective })] }), measures.length > 0 && (_jsx("span", { className: cx(small, measureLine), children: measures.map((item, index) => (_jsxs(Fragment, { children: [index > 0 && (_jsx("span", { className: muted, "aria-hidden": "true", children: "\u00B7" })), _jsxs("span", { className: measure, children: [_jsx("span", { className: muted, children: item.label }), _jsx("span", { children: item.value })] })] }, index))) }))] }), (hasResult || actions !== undefined) && (_jsxs("div", { className: result, children: [hasResult && (_jsxs("div", { className: score, children: [figure !== undefined && _jsx("span", { className: figureText, children: figure }), caption !== undefined && _jsx("span", { className: cx(small, muted), children: caption })] })), hasResult && actions !== undefined && _jsx("span", { className: divider, "aria-hidden": "true" }), actions] }))] }));
70
+ }
@@ -17,6 +17,8 @@ export type PanelProps = useRender.ComponentProps<"section"> & {
17
17
  export declare function Panel({ padding, tone, render, className, ...props }: PanelProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
18
18
  export type PanelHeaderProps = Omit<useRender.ComponentProps<"div">, "title"> & {
19
19
  title: ReactNode;
20
+ /** A muted line under the title saying what the panel holds or does. */
21
+ description?: ReactNode;
20
22
  /** Muted at the row's far edge, before the actions, such as a count or the period it covers. */
21
23
  meta?: ReactNode;
22
24
  /** At the row's end, such as a link to the full list. */
@@ -24,5 +26,5 @@ export type PanelHeaderProps = Omit<useRender.ComponentProps<"div">, "title"> &
24
26
  /** The title's heading level; a plain line when left out. */
25
27
  level?: 2 | 3 | 4;
26
28
  };
27
- /** A panel's top row: its title and meta, and its actions at the far edge. */
28
- export declare function PanelHeader({ title, meta, actions, level, render, className, ...props }: PanelHeaderProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
29
+ /** A panel's top row: its title and any description under it, and its meta and actions at the far edge. */
30
+ export declare function PanelHeader({ title, description, meta, actions, level, render, className, ...props }: PanelHeaderProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
@@ -75,6 +75,12 @@ const panelHeader = css({
75
75
  paddingInline: "none",
76
76
  paddingBottom: "panel.comfortable",
77
77
  marginBottom: "[calc(token(spacing.layout.contentGap) * -1)]",
78
+ "&[data-described]": { paddingTop: "none" },
79
+ },
80
+ "&[data-described]": {
81
+ height: "auto",
82
+ paddingTop: "panel.comfortable",
83
+ paddingBottom: "panelHeader.describedBottom",
78
84
  },
79
85
  });
80
86
  const panelHeaderTitle = css(singleLineText, {
@@ -85,6 +91,20 @@ const panelHeaderTitle = css(singleLineText, {
85
91
  font: "inherit",
86
92
  });
87
93
  const panelHeaderMeta = css({ color: "fg.subtle", fontSize: "code" });
94
+ // A title over its one-line description, 4 apart, as the Figma's settings panels draw them; the
95
+ // header then takes the description's height (16 above, 14 below, as the Figma pads it).
96
+ const panelHeaderCopy = css({
97
+ display: "flex",
98
+ flexDirection: "column",
99
+ gap: "layout.tightGap",
100
+ minWidth: "0",
101
+ });
102
+ const panelHeaderDescription = css(singleLineText, {
103
+ color: "fg.label",
104
+ fontSize: "code",
105
+ fontWeight: "medium",
106
+ letterSpacing: "compact",
107
+ });
88
108
  const panelHeaderActions = css({ display: "flex", alignItems: "center", gap: "layout.tightGap" });
89
109
  export function Card({ render, className, ...props }) {
90
110
  return useRender({
@@ -105,9 +125,10 @@ export function Panel({ padding = "default", tone, render, className, ...props }
105
125
  },
106
126
  });
107
127
  }
108
- /** A panel's top row: its title and meta, and its actions at the far edge. */
109
- export function PanelHeader({ title, meta, actions, level, render, className, ...props }) {
128
+ /** A panel's top row: its title and any description under it, and its meta and actions at the far edge. */
129
+ export function PanelHeader({ title, description, meta, actions, level, render, className, ...props }) {
110
130
  const Title = level ? `h${level}` : "span";
131
+ const hasDescription = description !== undefined && description !== null;
111
132
  return useRender({
112
133
  defaultTagName: "div",
113
134
  render,
@@ -116,7 +137,9 @@ export function PanelHeader({ title, meta, actions, level, render, className, ..
116
137
  className: cx(panelHeader, className),
117
138
  "data-ciridae-ui": "",
118
139
  "data-panel-header": "",
119
- children: (_jsxs(_Fragment, { children: [title !== undefined && title !== null && (_jsx(Title, { className: panelHeaderTitle, children: title })), (meta !== undefined || actions !== undefined) && (_jsxs("span", { className: panelHeaderActions, children: [meta !== undefined && _jsx("span", { className: panelHeaderMeta, children: meta }), actions] }))] })),
140
+ "data-described": hasDescription || undefined,
141
+ children: (_jsxs(_Fragment, { children: [hasDescription ? (_jsxs("span", { className: panelHeaderCopy, children: [title !== undefined && title !== null && (_jsx(Title, { className: panelHeaderTitle, children: title })), _jsx("span", { className: panelHeaderDescription, children: description })] })) : (title !== undefined &&
142
+ title !== null && _jsx(Title, { className: panelHeaderTitle, children: title })), (meta !== undefined || actions !== undefined) && (_jsxs("span", { className: panelHeaderActions, children: [meta !== undefined && _jsx("span", { className: panelHeaderMeta, children: meta }), actions] }))] })),
120
143
  },
121
144
  });
122
145
  }
@@ -23,9 +23,14 @@ export type SettingsLayoutProps<Value extends string> = Omit<ComponentProps<"div
23
23
  export declare function SettingsLayout<Value extends string>({ sections, value, onValueChange, children, labels: ownLabels, className, ...props }: SettingsLayoutProps<Value>): import("react").JSX.Element;
24
24
  /** A settings section's single column of panels; the shell header carries the page's title. */
25
25
  export declare function SettingsColumn({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
26
- /** One group of settings, under an optional heading with an optional action beside it. */
27
- export declare function SettingsPanel({ title, action, children, ...props }: Omit<PanelProps, "title" | "padding" | "tone"> & {
26
+ /**
27
+ * One group of settings, under an optional heading, a muted description under it and an optional
28
+ * action beside it.
29
+ */
30
+ export declare function SettingsPanel({ title, description, action, children, ...props }: Omit<PanelProps, "title" | "padding" | "tone"> & {
28
31
  title?: ReactNode;
32
+ /** A muted line under the title, such as what turning a setting off does. */
33
+ description?: ReactNode;
29
34
  action?: ReactNode;
30
35
  }): import("react").JSX.Element;
31
36
  /** A label and its value or control on one line inside a settings panel. */
@@ -27,12 +27,17 @@ const column = css({
27
27
  gap: "layout.clusterGap",
28
28
  maxWidth: "settings.column",
29
29
  });
30
+ // A hairline between rows, as the Figma's settings panels divide them.
30
31
  const row = css({
31
32
  display: "flex",
32
33
  alignItems: "center",
33
34
  justifyContent: "space-between",
34
35
  gap: "layout.contentGap",
35
36
  paddingBlock: "control.compactBlock",
37
+ "& + &": {
38
+ borderTop: "1px solid token(colors.border.divider)",
39
+ paddingTop: "layout.contentGap",
40
+ },
36
41
  });
37
42
  export function SettingsLayout({ sections, value, onValueChange, children, labels: ownLabels, className, ...props }) {
38
43
  const labels = { ...useCiridaeLocale().labels.settings, ...ownLabels };
@@ -46,9 +51,12 @@ export function SettingsLayout({ sections, value, onValueChange, children, label
46
51
  export function SettingsColumn({ className, ...props }) {
47
52
  return _jsx("div", { ...props, className: cx(column, className), "data-ciridae-ui": "" });
48
53
  }
49
- /** One group of settings, under an optional heading with an optional action beside it. */
50
- export function SettingsPanel({ title, action, children, ...props }) {
51
- return (_jsxs(Panel, { ...props, tone: "outline", children: [(title || action) && (_jsx(PanelHeader, { title: title, actions: action, level: title ? 2 : undefined })), children] }));
54
+ /**
55
+ * One group of settings, under an optional heading, a muted description under it and an optional
56
+ * action beside it.
57
+ */
58
+ export function SettingsPanel({ title, description, action, children, ...props }) {
59
+ return (_jsxs(Panel, { ...props, tone: "outline", children: [(title || action) && (_jsx(PanelHeader, { title: title, description: description, actions: action, level: title ? 2 : undefined })), children] }));
52
60
  }
53
61
  /** A label and its value or control on one line inside a settings panel. */
54
62
  export function SettingsRow({ label, children, className, ...props }) {
@@ -136,10 +136,16 @@ const headerTitle = css({
136
136
  fontWeight: "medium",
137
137
  lineHeight: "tight",
138
138
  });
139
+ // A page's blocks (heading, toolbar, list) stack 16 apart, as every page frame in the Figma draws
140
+ // them. Each keeps its own height (`ciridae.css`), so the page scrolls as a whole; a block that sets
141
+ // its own `flex`, such as a `fill` list, wins over that base-layer default and takes what is left.
139
142
  const content = css({
140
143
  flex: "1",
141
144
  minHeight: "0",
142
145
  overflow: "auto",
146
+ display: "flex",
147
+ flexDirection: "column",
148
+ gap: "layout.clusterGap",
143
149
  // Exposed so sticky descendants (table headers) can pin to the scroller's edge, not its padding.
144
150
  "--app-content-inset": "token(spacing.page.inline)",
145
151
  padding: "var(--app-content-inset)",
@@ -237,7 +243,7 @@ export function AppHeader({ className, children, actions, ...props }) {
237
243
  return (_jsxs("header", { ...props, className: cx(header, className), "data-ciridae-ui": "", children: [_jsx(AppMenuButton, {}), _jsx("div", { className: headerTitle, "data-header-title": "", children: children }), actions] }));
238
244
  }
239
245
  export function AppContent({ className, ...props }) {
240
- return _jsx("div", { ...props, className: cx(content, className), "data-ciridae-ui": "" });
246
+ return (_jsx("div", { ...props, className: cx(content, className), "data-ciridae-ui": "", "data-app-content": "" }));
241
247
  }
242
248
  // Sidebar pieces. The sidebar shows either its expanded content or, as a rail, its compact twins;
243
249
  // `AppSidebar` does the switching through these data attributes.
@@ -4,7 +4,7 @@ export type SidePanelProps = Omit<ComponentProps<"aside">, "title"> & {
4
4
  /** A muted line above the title, such as where the item sits in its list; the title then drops under the header row. */
5
5
  eyebrow?: ReactNode;
6
6
  subtitle?: ReactNode;
7
- /** Beside the title, such as a status badge. */
7
+ /** Beside the title, such as a status badge; the title then drops under the header row. */
8
8
  titleAccessory?: ReactNode;
9
9
  /** Header controls before the close button, such as a menu. */
10
10
  actions?: ReactNode;
@@ -28,8 +28,18 @@ export type SidePanelProps = Omit<ComponentProps<"aside">, "title"> & {
28
28
  * the list in a `SidePanelLayout`.
29
29
  */
30
30
  export declare function SidePanel({ title, eyebrow, subtitle, titleAccessory, actions, headerContent, footer, onClose, stepper, onPrevious, onNext, flushBody, bodyClassName, className, children, ...props }: SidePanelProps): import("react").JSX.Element;
31
- /** A list and its `SidePanel` side by side; the list takes the room the panel leaves. */
32
- export declare function SidePanelLayout({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
31
+ export type SidePanelLayoutProps = ComponentProps<"div"> & {
32
+ /**
33
+ * Hold the list and the panel to the height left in the page, the list scrolling inside: for a
34
+ * layout placed straight in a `PageFrame`, with a `DataGrid fill` as its list.
35
+ */
36
+ fill?: boolean;
37
+ };
38
+ /**
39
+ * A list and its `SidePanel` side by side; the list takes the room the panel leaves and ends after
40
+ * its last row, and the panel stays in view while the page scrolls.
41
+ */
42
+ export declare function SidePanelLayout({ fill, className, ...props }: SidePanelLayoutProps): import("react").JSX.Element;
33
43
  /** A labelled block of a side panel's body. */
34
44
  export declare function SidePanelSection({ label, className, children, ...props }: Omit<ComponentProps<"section">, "title"> & {
35
45
  label: ReactNode;
@@ -61,15 +61,18 @@ const titleBlock = css({
61
61
  paddingBlockStart: "panel.default",
62
62
  paddingInline: "panel.comfortable",
63
63
  });
64
+ // The Figma's preview panel sets its title at the list row's size (14, medium) with the status
65
+ // beside it, so a long log headline stays on a line or two rather than a page heading's three.
64
66
  const titleLine = css({
65
67
  display: "flex",
66
68
  alignItems: "center",
67
69
  flexWrap: "wrap",
68
70
  gap: "layout.controlGap",
69
71
  margin: "none",
70
- fontSize: "heading",
72
+ fontSize: "body",
71
73
  fontWeight: "medium",
72
- lineHeight: "tight",
74
+ letterSpacing: "compact",
75
+ lineHeight: "compact",
73
76
  });
74
77
  const subtitleLine = css({
75
78
  margin: "none",
@@ -106,12 +109,24 @@ const sheetBody = css({
106
109
  alignContent: "start",
107
110
  gap: "layout.clusterGap",
108
111
  });
112
+ // The list ends after its last row, as the Figma draws a short one, and the panel keeps its own
113
+ // height and stays in view while the page scrolls the list. `fill` instead holds both to the
114
+ // page's remaining height, as the Figma's list-and-panel frames draw them: the list scrolls inside
115
+ // (a `DataGrid fill` pins its head) and the panel stays put.
109
116
  const layout = css({
110
117
  display: "flex",
111
- alignItems: "stretch",
118
+ alignItems: "flex-start",
112
119
  gap: "layout.contentGap",
113
120
  minWidth: "0",
114
121
  "& > :first-child": { flex: "1", minWidth: "0" },
122
+ "& > aside": { position: "sticky", top: "none" },
123
+ "&[data-fill]": {
124
+ flex: "1",
125
+ minHeight: "0",
126
+ alignItems: "stretch",
127
+ "& > :first-child": { minHeight: "0", overflowY: "auto" },
128
+ "& > aside": { position: "static" },
129
+ },
115
130
  });
116
131
  const section = css({ display: "grid", gap: "layout.controlGap", minWidth: "0" });
117
132
  const sectionLabel = css({
@@ -172,11 +187,17 @@ export function SidePanel({ title, eyebrow, subtitle, titleAccessory, actions, h
172
187
  }, title: title, subtitle: subtitle, eyebrow: eyebrow, titleAccessory: titleAccessory, actions: _jsxs(_Fragment, { children: [stepButtons, actions] }), children: [_jsxs(DrawerBody, { flush: flushBody, className: cx(!flushBody && sheetBody, bodyClassName), children: [_jsx(SidePanelHotkeys, { ...stepHandlers }), headerContent, children] }), footer && _jsx(DrawerFooter, { children: footer })] }));
173
188
  }
174
189
  const titleContent = (_jsxs(_Fragment, { children: [title, titleAccessory] }));
175
- return (_jsxs(HotkeysProvider, { scope: scope, children: [_jsx(SidePanelHotkeys, { ...stepHandlers, onClose: onClose }), _jsxs("aside", { ...props, className: cx(aside, className), "data-ciridae-ui": "", children: [_jsxs("div", { className: headerRow, children: [_jsx("span", { className: headerLead, "data-eyebrow": eyebrow ? "" : undefined, children: eyebrow ?? titleContent }), _jsxs("span", { className: headerActions, children: [stepButtons, actions, _jsx(IconButton, { "aria-label": labels.common.close, size: "small", onClick: onClose, children: _jsx(XIcon, { className: icon({ size: "small" }) }) })] })] }), (eyebrow || subtitle || headerContent) && (_jsxs("div", { className: titleBlock, children: [eyebrow && _jsx("h2", { className: titleLine, children: titleContent }), subtitle && _jsx("p", { className: subtitleLine, children: subtitle }), headerContent] })), _jsx("div", { className: cx(body, bodyClassName), "data-flush": flushBody || undefined, children: children }), footer && _jsx("div", { className: footerRow, children: footer })] })] }));
190
+ // A title with an accessory, such as a status badge, drops under the header row as one with an
191
+ // eyebrow does, so the stepper and close never squeeze the badge.
192
+ const titleUnderHeader = Boolean(eyebrow || titleAccessory);
193
+ return (_jsxs(HotkeysProvider, { scope: scope, children: [_jsx(SidePanelHotkeys, { ...stepHandlers, onClose: onClose }), _jsxs("aside", { ...props, className: cx(aside, className), "data-ciridae-ui": "", children: [_jsxs("div", { className: headerRow, children: [_jsx("span", { className: headerLead, "data-eyebrow": eyebrow ? "" : undefined, children: titleUnderHeader ? eyebrow : titleContent }), _jsxs("span", { className: headerActions, children: [stepButtons, actions, _jsx(IconButton, { "aria-label": labels.common.close, size: "small", onClick: onClose, children: _jsx(XIcon, { className: icon({ size: "small" }) }) })] })] }), (titleUnderHeader || subtitle || headerContent) && (_jsxs("div", { className: titleBlock, children: [titleUnderHeader && _jsx("h2", { className: titleLine, children: titleContent }), subtitle && _jsx("p", { className: subtitleLine, children: subtitle }), headerContent] })), _jsx("div", { className: cx(body, bodyClassName), "data-flush": flushBody || undefined, children: children }), footer && _jsx("div", { className: footerRow, children: footer })] })] }));
176
194
  }
177
- /** A list and its `SidePanel` side by side; the list takes the room the panel leaves. */
178
- export function SidePanelLayout({ className, ...props }) {
179
- return _jsx("div", { ...props, className: cx(layout, className), "data-ciridae-ui": "" });
195
+ /**
196
+ * A list and its `SidePanel` side by side; the list takes the room the panel leaves and ends after
197
+ * its last row, and the panel stays in view while the page scrolls.
198
+ */
199
+ export function SidePanelLayout({ fill = false, className, ...props }) {
200
+ return (_jsx("div", { ...props, className: cx(layout, className), "data-ciridae-ui": "", "data-fill": fill || undefined }));
180
201
  }
181
202
  /** A labelled block of a side panel's body. */
182
203
  export function SidePanelSection({ label, className, children, ...props }) {
@@ -60,7 +60,8 @@ const item = css({
60
60
  height: "control.row",
61
61
  paddingInline: "control.compactInline",
62
62
  border: "0",
63
- borderRadius: "nav",
63
+ // The hover's shape from the start: the row is unfilled at rest, so only the wash appears.
64
+ borderRadius: "shell",
64
65
  background: "transparent",
65
66
  // Muted against the dark canvas; light keeps every item at full contrast, as Round 2 does.
66
67
  color: "fg.muted",
@@ -72,12 +73,11 @@ const item = css({
72
73
  lineHeight: "tight",
73
74
  textAlign: "start",
74
75
  cursor: "pointer",
75
- transitionProperty: "[background, color, border-radius]",
76
+ transitionProperty: "[background, color]",
76
77
  transitionDuration: "fast",
77
78
  "& > svg:first-child": { opacity: "[.7]" },
78
79
  "&[data-icon-tone=bronze] > svg:first-child": { color: "accent.bronze" },
79
80
  "&:hover, &[aria-pressed=true]": {
80
- borderRadius: "shell",
81
81
  background: "[token(gradients.selected)]",
82
82
  _light: { background: "bg.rowHover" },
83
83
  color: "fg.primary",
@@ -86,7 +86,6 @@ const item = css({
86
86
  // The open page keeps the hover shape and size; the field face and the canvas's edge mark it.
87
87
  // The design counts that edge inside the row, so its content sits a hairline further in.
88
88
  "&[aria-current=page]": {
89
- borderRadius: "shell",
90
89
  background: "bg.field",
91
90
  boxShadow: "[inset 0 0 0 1px token(colors.border.canvas)]",
92
91
  color: "fg.primary",
@@ -95,7 +94,7 @@ const item = css({
95
94
  paddingInline: "[calc(token(spacing.control.compactInline) + token(sizes.border.hairline))]",
96
95
  },
97
96
  },
98
- _focusVisible: { borderRadius: "shell", focusRing: "outer" },
97
+ _focusVisible: { focusRing: "outer" },
99
98
  // A secondary list under the navigation, such as recently opened records: a shorter row in
100
99
  // smaller, quieter text, so it reads apart from the pages above it.
101
100
  "&[data-size=compact]": {
@@ -122,17 +121,15 @@ const itemGroup = css({
122
121
  alignItems: "center",
123
122
  width: "full",
124
123
  minWidth: "0",
125
- borderRadius: "nav",
126
- transitionProperty: "[background, border-radius]",
124
+ borderRadius: "shell",
125
+ transitionProperty: "[background]",
127
126
  transitionDuration: "fast",
128
127
  "&:hover": {
129
- borderRadius: "shell",
130
128
  background: "[token(gradients.selected)]",
131
129
  _light: { background: "bg.rowHover" },
132
130
  },
133
131
  "&:hover > [data-sidebar-row]": { color: "fg.primary" },
134
132
  "&:has(> [data-sidebar-row][aria-current=page])": {
135
- borderRadius: "shell",
136
133
  background: "bg.field",
137
134
  boxShadow: "[inset 0 0 0 1px token(colors.border.canvas)]",
138
135
  },
@@ -141,7 +138,7 @@ const itemGroup = css({
141
138
  "& > [data-sidebar-row], & > [data-sidebar-row]:is(:hover, [aria-current=page], [aria-pressed=true])": { background: "transparent", boxShadow: "[none]" },
142
139
  // Focus rings the whole row, action included, not just the link inside it.
143
140
  "& > [data-sidebar-row]:focus-visible": { outline: "0" },
144
- "&:has(> [data-sidebar-row]:focus-visible)": { borderRadius: "shell", focusRing: "outer" },
141
+ "&:has(> [data-sidebar-row]:focus-visible)": { focusRing: "outer" },
145
142
  "&:hover > [data-sidebar-action], & > [data-sidebar-action]:focus-within": { opacity: "[1]" },
146
143
  });
147
144
  // Revealed on hover or focus; always shown where there is no hover to reveal it.