@stll/ui 0.75.0 → 0.77.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 (103) hide show
  1. package/dist/components/button-classes.d.ts +66 -0
  2. package/dist/components/button-classes.js +62 -0
  3. package/dist/components/button.d.ts +11 -4
  4. package/dist/components/button.js +8 -48
  5. package/dist/components/checkbox.js +1 -1
  6. package/dist/components/command.js +1 -1
  7. package/dist/components/composer-tokens.d.ts +9 -1
  8. package/dist/components/composer-tokens.js +9 -1
  9. package/dist/components/composer.d.ts +2 -2
  10. package/dist/components/composer.js +4 -4
  11. package/dist/components/control-face.d.ts +158 -0
  12. package/dist/components/control-face.js +192 -0
  13. package/dist/components/court-badge.d.ts +4 -2
  14. package/dist/components/court-badge.js +5 -3
  15. package/dist/components/details-grid.d.ts +8 -3
  16. package/dist/components/details-grid.js +28 -15
  17. package/dist/components/details-list-face.d.ts +7 -0
  18. package/dist/components/details-list-face.js +25 -0
  19. package/dist/components/document-mark.shared.d.ts +149 -0
  20. package/dist/components/document-mark.shared.js +62 -0
  21. package/dist/components/field-classes.d.ts +4 -0
  22. package/dist/components/field-classes.js +6 -0
  23. package/dist/components/field.js +5 -3
  24. package/dist/components/frame.d.ts +5 -1
  25. package/dist/components/frame.js +2 -2
  26. package/dist/components/input-otp-face.d.ts +4 -0
  27. package/dist/components/input-otp-face.js +15 -0
  28. package/dist/components/input-otp.d.ts +1 -1
  29. package/dist/components/input-otp.js +3 -8
  30. package/dist/components/label-classes.d.ts +20 -0
  31. package/dist/components/label-classes.js +21 -0
  32. package/dist/components/label.d.ts +2 -20
  33. package/dist/components/label.js +2 -19
  34. package/dist/components/landing-shell.d.ts +64 -0
  35. package/dist/components/landing-shell.js +189 -0
  36. package/dist/components/landing.d.ts +2 -39
  37. package/dist/components/landing.js +2 -66
  38. package/dist/components/list-shell.d.ts +39 -0
  39. package/dist/components/list-shell.js +99 -0
  40. package/dist/components/list.d.ts +3 -24
  41. package/dist/components/list.js +2 -49
  42. package/dist/components/outcome-screen-core.d.ts +25 -0
  43. package/dist/components/outcome-screen-core.js +76 -0
  44. package/dist/components/outcome-screen-face.d.ts +3 -0
  45. package/dist/components/outcome-screen-face.js +6 -0
  46. package/dist/components/outcome-screen-view.d.ts +9 -21
  47. package/dist/components/outcome-screen-view.js +36 -101
  48. package/dist/components/segmented-icon-toggle.d.ts +4 -1
  49. package/dist/components/segmented-icon-toggle.js +5 -4
  50. package/dist/components/select-classes.d.ts +10 -0
  51. package/dist/components/select-classes.js +13 -0
  52. package/dist/components/select.js +3 -7
  53. package/dist/components/skeleton.d.ts +3 -1
  54. package/dist/components/skeleton.js +9 -2
  55. package/dist/components/split-button.d.ts +2 -1
  56. package/dist/components/split-button.js +6 -14
  57. package/dist/components/switch.d.ts +1 -5
  58. package/dist/components/switch.js +2 -5
  59. package/dist/components/table-cell.d.ts +35 -0
  60. package/dist/components/table-cell.js +26 -0
  61. package/dist/components/table-shell.d.ts +131 -0
  62. package/dist/components/table-shell.js +141 -0
  63. package/dist/components/table.d.ts +4 -88
  64. package/dist/components/table.js +21 -70
  65. package/dist/components/tabs-classes.d.ts +8 -0
  66. package/dist/components/tabs-classes.js +10 -0
  67. package/dist/components/tabs.js +4 -3
  68. package/dist/components/toggle-classes.d.ts +13 -0
  69. package/dist/components/toggle-classes.js +10 -0
  70. package/dist/components/toggle-group-classes.d.ts +12 -0
  71. package/dist/components/toggle-group-classes.js +13 -0
  72. package/dist/components/toggle-group.js +3 -2
  73. package/dist/components/truncated-text-face.d.ts +33 -0
  74. package/dist/components/truncated-text-face.js +30 -0
  75. package/dist/components/truncated-text.d.ts +1 -6
  76. package/dist/components/truncated-text.js +1 -15
  77. package/dist/components/view-toolbar-classes.d.ts +13 -0
  78. package/dist/components/view-toolbar-classes.js +15 -0
  79. package/dist/components/view-toolbar-shell.d.ts +24 -0
  80. package/dist/components/view-toolbar-shell.js +43 -0
  81. package/dist/components/view-toolbar.d.ts +2 -15
  82. package/dist/components/view-toolbar.js +8 -26
  83. package/dist/data-table/table.js +2 -1
  84. package/dist/icons.d.ts +2 -2
  85. package/dist/icons.js +2 -2
  86. package/dist/index.d.ts +15 -9
  87. package/dist/index.js +11 -8
  88. package/dist/kanban/card-shell.js +1 -1
  89. package/dist/kanban/column-bands.d.ts +0 -8
  90. package/dist/kanban/column-bands.js +1 -18
  91. package/dist/kanban/column-header-shell.d.ts +39 -0
  92. package/dist/kanban/column-header-shell.js +48 -0
  93. package/dist/kanban/column-header.js +9 -12
  94. package/dist/kanban/index.d.ts +2 -2
  95. package/dist/kanban/index.js +3 -3
  96. package/dist/kanban/layout-tokens.d.ts +18 -1
  97. package/dist/kanban/layout-tokens.js +18 -1
  98. package/dist/kanban/sticky-lane.d.ts +2 -7
  99. package/dist/kanban/sticky-lane.js +1 -6
  100. package/dist/kanban/subgroup-board.js +2 -2
  101. package/dist/lib/{menu-row.js → list-row-metric.js} +1 -1
  102. package/package.json +52 -4
  103. /package/dist/lib/{menu-row.d.ts → list-row-metric.d.ts} +0 -0
@@ -0,0 +1,99 @@
1
+ "use client";
2
+ import { cn } from "../lib/utils.js";
3
+ import { InlineSkeleton, Skeleton } from "./skeleton.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ // src/components/list-shell.tsx
6
+ const ListGroup = ({ className, ...props }) => /* @__PURE__ */ jsx("section", {
7
+ className: cn("flex flex-col gap-2.5", className),
8
+ "data-slot": "list-group",
9
+ ...props
10
+ });
11
+ const ListGroupHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("header", {
12
+ className: cn("flex items-end gap-4 px-1", className),
13
+ "data-slot": "list-group-header",
14
+ ...props
15
+ });
16
+ /** Title and description stack; takes the space the header action leaves. */
17
+ const ListGroupHeading = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
18
+ className: cn("flex min-w-0 flex-1 flex-col gap-0.5", className),
19
+ "data-slot": "list-group-heading",
20
+ ...props
21
+ });
22
+ const ListGroupTitle = ({ className, children, ...props }) => /* @__PURE__ */ jsx("h2", {
23
+ className: cn("text-foreground text-sm font-medium text-balance", className),
24
+ "data-slot": "list-group-title",
25
+ ...props,
26
+ children
27
+ });
28
+ /** The group's one quiet line under its title. */
29
+ const ListGroupDescription = ({ className, ...props }) => /* @__PURE__ */ jsx("p", {
30
+ className: cn("text-muted-foreground text-xs text-pretty", className),
31
+ "data-slot": "list-group-description",
32
+ ...props
33
+ });
34
+ /**
35
+ * The surface. Depth comes from a ring plus a soft shadow, not a frame.
36
+ *
37
+ * A row wrapped in `EntityActions` sits inside its `display: contents`
38
+ * listener, which draws no border, and its menu anchor follows it as a
39
+ * sibling, so `divide-y` cannot reach it: such a row draws its own hairline
40
+ * on top, from the second wrapped row on.
41
+ */
42
+ const List = ({ className, ...props }) => /* @__PURE__ */ jsx("ul", {
43
+ className: cn("bg-background ring-border divide-border flex flex-col divide-y overflow-hidden rounded-xl shadow-xs/5 ring-1", "[&>[data-slot=entity-actions]~[data-slot=entity-actions]>*]:border-border [&>[data-slot=entity-actions]~[data-slot=entity-actions]>*]:border-t", className),
44
+ "data-slot": "list",
45
+ ...props
46
+ });
47
+ /** A row's box: its height floor, inset and the gap between its slots. */
48
+ const LIST_ITEM_ROW_CLASS = "flex min-h-14 w-full items-center gap-3 px-4 py-2.5 text-start";
49
+ const LIST_ITEM_TITLE_WIDTHS = [
50
+ "w-56",
51
+ "w-44",
52
+ "w-64",
53
+ "w-48"
54
+ ];
55
+ const LIST_ITEM_DESCRIPTION_WIDTHS = [
56
+ "w-40",
57
+ "w-32",
58
+ "w-36",
59
+ "w-28"
60
+ ];
61
+ /**
62
+ * A `ListItem` while its data loads: the row's box, and a bar on each line
63
+ * the row will hold (a `text-sm` title, a `text-xs` description, the
64
+ * trailing text), so the row that arrives takes its place without moving
65
+ * anything. Decoration: the loading view announces itself once.
66
+ */
67
+ const ListItemSkeleton = ({ description = true, index, media = false, trailing }) => /* @__PURE__ */ jsx("li", {
68
+ "aria-hidden": "true",
69
+ className: "flex",
70
+ "data-slot": "list-item-skeleton",
71
+ children: /* @__PURE__ */ jsxs("div", {
72
+ className: LIST_ITEM_ROW_CLASS,
73
+ children: [
74
+ media && /* @__PURE__ */ jsx(Skeleton, { className: "size-8 shrink-0 rounded-lg" }),
75
+ /* @__PURE__ */ jsxs("div", {
76
+ className: "flex min-w-0 flex-1 flex-col gap-0.5",
77
+ children: [/* @__PURE__ */ jsx("span", {
78
+ className: "flex h-5 items-center",
79
+ children: /* @__PURE__ */ jsx(InlineSkeleton, { className: cn("h-3.5 max-w-full", LIST_ITEM_TITLE_WIDTHS[index % LIST_ITEM_TITLE_WIDTHS.length]) })
80
+ }), description && /* @__PURE__ */ jsx("span", {
81
+ className: "flex h-4 items-center",
82
+ children: /* @__PURE__ */ jsx(InlineSkeleton, { className: cn("h-3 max-w-full", LIST_ITEM_DESCRIPTION_WIDTHS[index % LIST_ITEM_DESCRIPTION_WIDTHS.length]) })
83
+ })]
84
+ }),
85
+ trailing === "text" && /* @__PURE__ */ jsx("span", {
86
+ className: "flex h-4 shrink-0 items-center",
87
+ children: /* @__PURE__ */ jsx(InlineSkeleton, { className: "h-3 w-12" })
88
+ })
89
+ ]
90
+ })
91
+ });
92
+ /** A group title whose text waits on data: a bar on the title's line. */
93
+ const ListGroupTitlePending = () => /* @__PURE__ */ jsx("span", {
94
+ "aria-hidden": "true",
95
+ className: "flex h-5 items-center",
96
+ "data-slot": "list-group-title-skeleton",
97
+ children: /* @__PURE__ */ jsx(InlineSkeleton, { className: "h-3.5 w-24" })
98
+ });
99
+ export { LIST_ITEM_ROW_CLASS, List, ListGroup, ListGroupDescription, ListGroupHeader, ListGroupHeading, ListGroupTitle, ListGroupTitlePending, ListItemSkeleton };
@@ -1,20 +1,9 @@
1
+ import "./truncated-text.js";
1
2
  import * as React from "react";
2
- import { TruncatedTextLines } from "./truncated-text.js";
3
+ import { List, ListGroup, ListGroupDescription, ListGroupHeader, ListGroupHeading, ListGroupTitle } from "./list-shell.js";
4
+ import { TruncatedTextLines } from "./truncated-text-face.js";
3
5
  import { VariantProps } from "class-variance-authority";
4
6
  import { useRender } from "@base-ui/react/use-render";
5
- /**
6
- * Grouped list: a titled section holding one surface of hairline-divided
7
- * rows. Use it for settings and inventories of named things (connections,
8
- * sessions, members, keys) where each row is icon + name + one quiet line +
9
- * trailing status or action. Rows never scroll sideways: the content column
10
- * truncates and the trailing column keeps its width, so actions stay on
11
- * screen at any viewport.
12
- */
13
- declare const ListGroup: ({ className, ...props }: React.ComponentProps<"section">) => React.JSX.Element;
14
- declare const ListGroupHeader: ({ className, ...props }: React.ComponentProps<"header">) => React.JSX.Element;
15
- /** Title and description stack; takes the space the header action leaves. */
16
- declare const ListGroupHeading: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
17
- declare const ListGroupTitle: ({ className, children, ...props }: React.ComponentProps<"h2">) => React.JSX.Element;
18
7
  /**
19
8
  * Quiet item count after the title; shows matches while a search filters,
20
9
  * and a changed digit fades in rather than snapping. `count` arrives
@@ -23,18 +12,8 @@ declare const ListGroupTitle: ({ className, children, ...props }: React.Componen
23
12
  declare const ListGroupCount: ({ className, count, ...props }: Omit<React.ComponentProps<"span">, "children"> & {
24
13
  count: string;
25
14
  }) => React.JSX.Element;
26
- declare const ListGroupDescription: ({ className, ...props }: React.ComponentProps<"p">) => React.JSX.Element;
27
15
  /** Quiet trailing affordance on the header row (a link or ghost button). */
28
16
  declare const ListGroupAction: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
29
- /**
30
- * The surface. Depth comes from a ring plus a soft shadow, not a frame.
31
- *
32
- * A row wrapped in `EntityActions` sits inside its `display: contents`
33
- * listener, which draws no border, and its menu anchor follows it as a
34
- * sibling, so `divide-y` cannot reach it: such a row draws its own hairline
35
- * on top, from the second wrapped row on.
36
- */
37
- declare const List: ({ className, ...props }: React.ComponentProps<"ul">) => React.JSX.Element;
38
17
  /**
39
18
  * One row. Pass `render` (a link or button element) to make the whole row the
40
19
  * target; then keep other interactive elements out of it. Rows with their own
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { cn } from "../lib/utils.js";
3
3
  import { AnimatedCount } from "./animated-count.js";
4
+ import { LIST_ITEM_ROW_CLASS, List, ListGroup, ListGroupDescription, ListGroupHeader, ListGroupHeading, ListGroupTitle } from "./list-shell.js";
4
5
  import { TruncatedText } from "./truncated-text.js";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
  import { mergeProps } from "@base-ui/react/merge-props";
@@ -8,36 +9,6 @@ import { useRender } from "@base-ui/react/use-render";
8
9
  import { cva } from "class-variance-authority";
9
10
  // src/components/list.tsx
10
11
  /**
11
- * Grouped list: a titled section holding one surface of hairline-divided
12
- * rows. Use it for settings and inventories of named things (connections,
13
- * sessions, members, keys) where each row is icon + name + one quiet line +
14
- * trailing status or action. Rows never scroll sideways: the content column
15
- * truncates and the trailing column keeps its width, so actions stay on
16
- * screen at any viewport.
17
- */
18
- const ListGroup = ({ className, ...props }) => /* @__PURE__ */ jsx("section", {
19
- className: cn("flex flex-col gap-2.5", className),
20
- "data-slot": "list-group",
21
- ...props
22
- });
23
- const ListGroupHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("header", {
24
- className: cn("flex items-end gap-4 px-1", className),
25
- "data-slot": "list-group-header",
26
- ...props
27
- });
28
- /** Title and description stack; takes the space the header action leaves. */
29
- const ListGroupHeading = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
30
- className: cn("flex min-w-0 flex-1 flex-col gap-0.5", className),
31
- "data-slot": "list-group-heading",
32
- ...props
33
- });
34
- const ListGroupTitle = ({ className, children, ...props }) => /* @__PURE__ */ jsx("h2", {
35
- className: cn("text-foreground text-sm font-medium text-balance", className),
36
- "data-slot": "list-group-title",
37
- ...props,
38
- children
39
- });
40
- /**
41
12
  * Quiet item count after the title; shows matches while a search filters,
42
13
  * and a changed digit fades in rather than snapping. `count` arrives
43
14
  * formatted in the caller's locale.
@@ -48,11 +19,6 @@ const ListGroupCount = ({ className, count, ...props }) => /* @__PURE__ */ jsx("
48
19
  ...props,
49
20
  children: /* @__PURE__ */ jsx(AnimatedCount, { value: count })
50
21
  });
51
- const ListGroupDescription = ({ className, ...props }) => /* @__PURE__ */ jsx("p", {
52
- className: cn("text-muted-foreground text-xs text-pretty", className),
53
- "data-slot": "list-group-description",
54
- ...props
55
- });
56
22
  /** Quiet trailing affordance on the header row (a link or ghost button). */
57
23
  const ListGroupAction = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
58
24
  className: cn("flex shrink-0 items-center gap-1", className),
@@ -60,26 +26,13 @@ const ListGroupAction = ({ className, ...props }) => /* @__PURE__ */ jsx("div",
60
26
  ...props
61
27
  });
62
28
  /**
63
- * The surface. Depth comes from a ring plus a soft shadow, not a frame.
64
- *
65
- * A row wrapped in `EntityActions` sits inside its `display: contents`
66
- * listener, which draws no border, and its menu anchor follows it as a
67
- * sibling, so `divide-y` cannot reach it: such a row draws its own hairline
68
- * on top, from the second wrapped row on.
69
- */
70
- const List = ({ className, ...props }) => /* @__PURE__ */ jsx("ul", {
71
- className: cn("bg-background ring-border divide-border flex flex-col divide-y overflow-hidden rounded-xl shadow-xs/5 ring-1", "[&>[data-slot=entity-actions]~[data-slot=entity-actions]>*]:border-border [&>[data-slot=entity-actions]~[data-slot=entity-actions]>*]:border-t", className),
72
- "data-slot": "list",
73
- ...props
74
- });
75
- /**
76
29
  * One row. Pass `render` (a link or button element) to make the whole row the
77
30
  * target; then keep other interactive elements out of it. Rows with their own
78
31
  * trailing buttons stay a plain `li` and put the actions in `ListItemActions`.
79
32
  */
80
33
  const ListItem = ({ className, render, children, ...props }) => {
81
34
  const defaultProps = {
82
- className: cn("flex min-h-14 w-full items-center gap-3 px-4 py-2.5 text-start", render !== void 0 && "hover:bg-muted/50 focus-visible:bg-muted/50 focus-visible:ring-ring cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-inset", className),
35
+ className: cn(LIST_ITEM_ROW_CLASS, render !== void 0 && "hover:bg-muted/50 focus-visible:bg-muted/50 focus-visible:ring-ring cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-inset", className),
83
36
  "data-slot": "list-item",
84
37
  children
85
38
  };
@@ -0,0 +1,25 @@
1
+ import { ReactNode, Ref } from "react";
2
+ export type OutcomeTone = "success" | "error";
3
+ export type OutcomeContentProps = {
4
+ tone: OutcomeTone;
5
+ title: ReactNode;
6
+ description?: ReactNode;
7
+ actions?: ReactNode;
8
+ documentTitle?: string;
9
+ headingRef?: Ref<HTMLHeadingElement>;
10
+ };
11
+ type OutcomeCoreProps = OutcomeContentProps & {
12
+ glyph?: ReactNode;
13
+ beforeActions?: ReactNode;
14
+ afterActions?: ReactNode;
15
+ };
16
+ export declare const OUTCOME_TILE_CLASS = "bg-card text-foreground shadow-outcome-tile relative flex size-14 shrink-0 items-center justify-center rounded-2xl";
17
+ export declare const OutcomeStatusBadge: ({ className, tone }: {
18
+ className?: string;
19
+ tone: OutcomeTone;
20
+ }) => import("react").JSX.Element;
21
+ export declare const StellaOutcomeTile: () => import("react").JSX.Element;
22
+ export declare const OutcomeTitle: ({ documentTitle, title }: Pick<OutcomeContentProps, "documentTitle" | "title">) => import("react").JSX.Element | null;
23
+ export declare const OutcomeContent: ({ tone, title, description, actions, headingRef, glyph, beforeActions, afterActions }: OutcomeCoreProps) => import("react").JSX.Element;
24
+ export declare const OutcomePage: (props: OutcomeCoreProps) => import("react").JSX.Element;
25
+ export {};
@@ -0,0 +1,76 @@
1
+ import { CheckIcon, XIcon } from "../icons.js";
2
+ import { cn } from "../lib/utils.js";
3
+ import { StellaMark } from "./stella-mark.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ // src/components/outcome-screen-core.tsx
6
+ const TONE_BADGE = {
7
+ success: {
8
+ className: "bg-success",
9
+ Icon: CheckIcon
10
+ },
11
+ error: {
12
+ className: "bg-destructive",
13
+ Icon: XIcon
14
+ }
15
+ };
16
+ const OUTCOME_TILE_CLASS = "bg-card text-foreground shadow-outcome-tile relative flex size-14 shrink-0 items-center justify-center rounded-2xl";
17
+ const OutcomeStatusBadge = ({ className, tone }) => {
18
+ const { className: toneClass, Icon } = TONE_BADGE[tone];
19
+ return /* @__PURE__ */ jsx("span", {
20
+ className: cn("text-background ring-background motion-safe:animate-outcome-badge flex size-5 items-center justify-center rounded-full ring-2", toneClass, className),
21
+ "data-slot": "outcome-badge",
22
+ "data-tone": tone,
23
+ children: /* @__PURE__ */ jsx(Icon, {
24
+ className: "size-3",
25
+ strokeWidth: 3
26
+ })
27
+ });
28
+ };
29
+ const StellaOutcomeTile = () => /* @__PURE__ */ jsx("span", {
30
+ className: OUTCOME_TILE_CLASS,
31
+ "data-slot": "outcome-tile",
32
+ children: /* @__PURE__ */ jsx(StellaMark, { className: "size-7" })
33
+ });
34
+ const OutcomeGlyph = ({ tone }) => /* @__PURE__ */ jsxs("div", {
35
+ className: "relative",
36
+ "aria-hidden": "true",
37
+ children: [/* @__PURE__ */ jsx(StellaOutcomeTile, {}), /* @__PURE__ */ jsx(OutcomeStatusBadge, {
38
+ className: "absolute -end-1.25 -bottom-1.25",
39
+ tone
40
+ })]
41
+ });
42
+ const OutcomeTitle = ({ documentTitle, title }) => {
43
+ const text = documentTitle ?? (typeof title === "string" ? title : void 0);
44
+ return text === void 0 ? null : /* @__PURE__ */ jsx("title", { children: text });
45
+ };
46
+ const OutcomeContent = ({ tone, title, description, actions, headingRef, glyph, beforeActions, afterActions }) => /* @__PURE__ */ jsxs("section", {
47
+ className: "motion-safe:animate-rise flex w-full max-w-[26rem] flex-col items-center text-center wrap-anywhere",
48
+ "data-slot": "outcome",
49
+ "data-tone": tone,
50
+ role: "status",
51
+ children: [
52
+ glyph ?? /* @__PURE__ */ jsx(OutcomeGlyph, { tone }),
53
+ /* @__PURE__ */ jsx("h1", {
54
+ className: "mt-7 text-2xl font-semibold tracking-tight text-balance outline-none",
55
+ ref: headingRef,
56
+ tabIndex: headingRef === void 0 ? void 0 : -1,
57
+ children: title
58
+ }),
59
+ description === void 0 ? null : /* @__PURE__ */ jsx("p", {
60
+ className: "text-muted-foreground mt-2 max-w-[22rem] text-sm text-pretty",
61
+ children: description
62
+ }),
63
+ beforeActions,
64
+ actions === void 0 ? null : /* @__PURE__ */ jsx("div", {
65
+ className: "mt-7 flex flex-wrap justify-center gap-2",
66
+ children: actions
67
+ }),
68
+ afterActions
69
+ ]
70
+ });
71
+ const OutcomePage = (props) => /* @__PURE__ */ jsxs("main", {
72
+ className: "bg-background text-foreground flex min-h-dvh w-full flex-col items-center justify-center px-4 pt-12 pb-[14svh] font-sans",
73
+ "data-slot": "outcome-screen",
74
+ children: [/* @__PURE__ */ jsx(OutcomeTitle, { ...props }), /* @__PURE__ */ jsx(OutcomeContent, { ...props })]
75
+ });
76
+ export { OUTCOME_TILE_CLASS, OutcomeContent, OutcomePage, OutcomeStatusBadge, OutcomeTitle, StellaOutcomeTile };
@@ -0,0 +1,3 @@
1
+ import { OutcomeContentProps } from "./outcome-screen-core.js";
2
+ /** The page outcome before its interactive behavior mounts. */
3
+ export declare const OutcomeScreenFace: (props: Pick<OutcomeContentProps, "actions" | "description" | "title" | "tone">) => import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { OutcomePage } from "./outcome-screen-core.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ // src/components/outcome-screen-face.tsx
4
+ /** The page outcome before its interactive behavior mounts. */
5
+ const OutcomeScreenFace = (props) => /* @__PURE__ */ jsx(OutcomePage, { ...props });
6
+ export { OutcomeScreenFace };
@@ -1,5 +1,5 @@
1
- import { ReactNode, Ref } from "react";
2
- export type OutcomeTone = "success" | "error";
1
+ import { OutcomeContentProps, OutcomeTone } from "./outcome-screen-core.js";
2
+ import { ReactNode } from "react";
3
3
  /** One fact about what the flow connected, e.g. Account: jan@firm.example. */
4
4
  export type OutcomeDetail = {
5
5
  /** What the fact is, in a word or two. */
@@ -7,33 +7,21 @@ export type OutcomeDetail = {
7
7
  /** The fact itself; isolated as its own bidi run (names, emails). */
8
8
  value: ReactNode;
9
9
  };
10
- type OutcomeLayoutProps = {
11
- tone: OutcomeTone;
12
- /** What happened, in a few words. Also the document title. */
13
- title: string;
14
- /** What it means, or what to do next. */
15
- description?: ReactNode;
10
+ type OutcomeLayoutProps = OutcomeContentProps & {
16
11
  /** The other side's identity (a logo), drawn in a tile beside stella's. */
17
12
  counterpart?: ReactNode;
18
13
  /** The flow's facts, drawn by `OutcomeDetailList`. */
19
14
  details?: ReactNode;
20
15
  /** A command to run next, drawn by `OutcomeCommand`. */
21
16
  command?: ReactNode;
22
- /** The way on, as buttons or links. */
23
- actions?: ReactNode;
24
17
  /** A quiet footnote, drawn by `OutcomeNote`. */
25
18
  note?: ReactNode;
26
- /**
27
- * `page` owns the viewport; `embedded` sits inside a layout that already
28
- * frames the page (the sign-in layout).
29
- */
19
+ /** A page owns the viewport, or is embedded in a frame that already owns it. */
30
20
  surface?: "page" | "embedded";
31
- /** The document title, when it differs from `title` (an app suffix). */
32
- documentTitle?: string;
33
- /** Makes the heading focusable and hands it over, to move focus to it. */
34
- headingRef?: Ref<HTMLHeadingElement>;
35
21
  };
36
- export type OutcomeScreenViewProps = Omit<OutcomeLayoutProps, "details" | "command" | "note"> & {
22
+ export type OutcomeScreenViewProps = Omit<OutcomeLayoutProps, "details" | "command" | "note" | "title"> & {
23
+ /** What happened. Also the document title when none is supplied. */
24
+ title: string;
37
25
  /**
38
26
  * What the flow connected, 1 to 3 facts it already holds (the account, the
39
27
  * organization, the access granted). Leave it out when there is nothing
@@ -83,6 +71,6 @@ export declare const OutcomeNote: ({ children }: {
83
71
  * The screen with every optional part already drawn: `OutcomeScreenView`
84
72
  * draws them from props, the generator puts template slots in their place.
85
73
  */
86
- export declare const OutcomeLayout: ({ tone, title, description, counterpart, details, command, actions, note, surface, documentTitle, headingRef }: OutcomeLayoutProps) => import("react").JSX.Element;
74
+ export declare const OutcomeLayout: ({ counterpart, details, command, note, surface, ...layout }: OutcomeLayoutProps) => import("react").JSX.Element;
87
75
  export declare const OutcomeScreenView: ({ details, command, note, ...layout }: OutcomeScreenViewProps) => import("react").JSX.Element;
88
- export {};
76
+ export type { OutcomeTone };
@@ -1,68 +1,28 @@
1
- import { CheckIcon, XIcon } from "../icons.js";
2
- import { cn } from "../lib/utils.js";
3
- import { StellaMark } from "./stella-mark.js";
4
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { OUTCOME_TILE_CLASS, OutcomeContent, OutcomePage, OutcomeStatusBadge, OutcomeTitle, StellaOutcomeTile } from "./outcome-screen-core.js";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
3
  // src/components/outcome-screen-view.tsx
6
- const TONE_BADGE = {
7
- success: {
8
- className: "bg-success",
9
- Icon: CheckIcon
10
- },
11
- error: {
12
- className: "bg-destructive",
13
- Icon: XIcon
14
- }
15
- };
16
- const TILE_CLASS = "bg-card text-foreground shadow-outcome-tile relative flex size-14 shrink-0 items-center justify-center rounded-2xl";
17
- const StatusBadge = ({ className, tone }) => {
18
- const { className: toneClass, Icon } = TONE_BADGE[tone];
19
- return /* @__PURE__ */ jsx("span", {
20
- className: cn("text-background ring-background motion-safe:animate-outcome-badge flex size-5 items-center justify-center rounded-full ring-2", toneClass, className),
21
- "data-slot": "outcome-badge",
22
- "data-tone": tone,
23
- children: /* @__PURE__ */ jsx(Icon, {
24
- className: "size-3",
25
- strokeWidth: 3
26
- })
27
- });
28
- };
29
- const OutcomeGlyph = ({ counterpart, tone }) => {
30
- const stellaTile = /* @__PURE__ */ jsx("span", {
31
- className: TILE_CLASS,
32
- "data-slot": "outcome-tile",
33
- children: /* @__PURE__ */ jsx(StellaMark, { className: "size-7" })
34
- });
35
- if (counterpart === void 0 || counterpart === null) return /* @__PURE__ */ jsxs("div", {
36
- className: "relative",
37
- "aria-hidden": "true",
38
- children: [stellaTile, /* @__PURE__ */ jsx(StatusBadge, {
39
- className: "absolute -end-1.25 -bottom-1.25",
40
- tone
41
- })]
42
- });
43
- return /* @__PURE__ */ jsxs("div", {
44
- className: "flex items-center",
45
- "aria-hidden": "true",
46
- children: [
47
- /* @__PURE__ */ jsx("span", {
48
- className: TILE_CLASS,
49
- "data-slot": "outcome-tile",
50
- children: counterpart
51
- }),
52
- /* @__PURE__ */ jsxs("span", {
53
- className: "relative flex w-16 items-center justify-center",
54
- children: [/* @__PURE__ */ jsx("span", {
55
- className: "bg-border motion-safe:animate-outcome-connector h-px w-full",
56
- "data-slot": "outcome-connector"
57
- }), /* @__PURE__ */ jsx(StatusBadge, {
58
- className: "absolute",
59
- tone
60
- })]
61
- }),
62
- stellaTile
63
- ]
64
- });
65
- };
4
+ const PairedOutcomeGlyph = ({ counterpart, tone }) => /* @__PURE__ */ jsxs("div", {
5
+ className: "flex items-center",
6
+ "aria-hidden": "true",
7
+ children: [
8
+ /* @__PURE__ */ jsx("span", {
9
+ className: OUTCOME_TILE_CLASS,
10
+ "data-slot": "outcome-tile",
11
+ children: counterpart
12
+ }),
13
+ /* @__PURE__ */ jsxs("span", {
14
+ className: "relative flex w-16 items-center justify-center",
15
+ children: [/* @__PURE__ */ jsx("span", {
16
+ className: "bg-border motion-safe:animate-outcome-connector h-px w-full",
17
+ "data-slot": "outcome-connector"
18
+ }), /* @__PURE__ */ jsx(OutcomeStatusBadge, {
19
+ className: "absolute",
20
+ tone
21
+ })]
22
+ }),
23
+ /* @__PURE__ */ jsx(StellaOutcomeTile, {})
24
+ ]
25
+ });
66
26
  /** The facts' one quiet surface; its rows are `OutcomeDetailRow`s. */
67
27
  const OutcomeDetailList = ({ children }) => /* @__PURE__ */ jsx("dl", {
68
28
  className: "bg-muted mt-6 grid w-full max-w-[22rem] grid-cols-[max-content_minmax(0,1fr)] gap-x-4 rounded-xl px-4 py-2 text-start text-sm",
@@ -116,47 +76,22 @@ const OutcomeNote = ({ children }) => /* @__PURE__ */ jsx("p", {
116
76
  * The screen with every optional part already drawn: `OutcomeScreenView`
117
77
  * draws them from props, the generator puts template slots in their place.
118
78
  */
119
- const OutcomeLayout = ({ tone, title, description, counterpart, details, command, actions, note, surface = "page", documentTitle, headingRef }) => {
120
- const outcome = /* @__PURE__ */ jsxs("section", {
121
- className: "motion-safe:animate-rise flex w-full max-w-[26rem] flex-col items-center text-center wrap-anywhere",
122
- "data-slot": "outcome",
123
- "data-tone": tone,
124
- role: "status",
125
- children: [
126
- /* @__PURE__ */ jsx(OutcomeGlyph, {
127
- counterpart,
128
- tone
129
- }),
130
- /* @__PURE__ */ jsx("h1", {
131
- className: "mt-7 text-2xl font-semibold tracking-tight text-balance outline-none",
132
- ref: headingRef,
133
- tabIndex: headingRef === void 0 ? void 0 : -1,
134
- children: title
135
- }),
136
- description === void 0 ? null : /* @__PURE__ */ jsx("p", {
137
- className: "text-muted-foreground mt-2 max-w-[22rem] text-sm text-pretty",
138
- children: description
139
- }),
140
- details,
141
- command,
142
- actions === void 0 ? null : /* @__PURE__ */ jsx("div", {
143
- className: "mt-7 flex flex-wrap justify-center gap-2",
144
- children: actions
145
- }),
146
- note
147
- ]
148
- });
149
- const titleElement = /* @__PURE__ */ jsx("title", { children: documentTitle ?? title });
79
+ const OutcomeLayout = ({ counterpart, details, command, note, surface = "page", ...layout }) => {
80
+ const content = {
81
+ ...layout,
82
+ glyph: counterpart === void 0 || counterpart === null ? void 0 : /* @__PURE__ */ jsx(PairedOutcomeGlyph, {
83
+ counterpart,
84
+ tone: layout.tone
85
+ }),
86
+ beforeActions: /* @__PURE__ */ jsxs(Fragment, { children: [details, command] }),
87
+ afterActions: note
88
+ };
150
89
  if (surface === "embedded") return /* @__PURE__ */ jsxs("div", {
151
90
  className: "flex w-full justify-center py-10",
152
91
  "data-slot": "outcome-screen",
153
- children: [titleElement, outcome]
154
- });
155
- return /* @__PURE__ */ jsxs("main", {
156
- className: "bg-background text-foreground flex min-h-dvh w-full flex-col items-center justify-center px-4 pt-12 pb-[14svh] font-sans",
157
- "data-slot": "outcome-screen",
158
- children: [titleElement, outcome]
92
+ children: [/* @__PURE__ */ jsx(OutcomeTitle, { ...layout }), /* @__PURE__ */ jsx(OutcomeContent, { ...content })]
159
93
  });
94
+ return /* @__PURE__ */ jsx(OutcomePage, { ...content });
160
95
  };
161
96
  const OutcomeScreenView = ({ details, command, note, ...layout }) => /* @__PURE__ */ jsx(OutcomeLayout, {
162
97
  ...layout,
@@ -1,5 +1,8 @@
1
1
  import { ComponentType } from "react";
2
+ import { SegmentedIconToggleSize } from "./toggle-group-classes.js";
2
3
  type SegmentedIconToggleOption<T extends string> = {
4
+ /** A fixed id for the option, where generated ones would differ per mount. */
5
+ id?: string | undefined;
3
6
  value: T;
4
7
  icon: ComponentType<{
5
8
  className?: string;
@@ -11,7 +14,7 @@ type SegmentedIconToggleProps<T extends string> = {
11
14
  value: T;
12
15
  options: readonly SegmentedIconToggleOption<T>[];
13
16
  onChange: (value: T) => void;
14
- size?: "compact" | "touch";
17
+ size?: SegmentedIconToggleSize;
15
18
  };
16
19
  /** Compact segmented control of icon buttons (e.g. table row wrap, list
17
20
  * density). One shared shell so every density/mode switch looks and behaves
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { cn } from "../lib/utils.js";
3
2
  import { ToggleGroup, ToggleGroupItem } from "./toggle-group.js";
3
+ import { SEGMENTED_ICON_TOGGLE_ICON_CLASS_NAME, segmentedIconToggleClassName, segmentedIconToggleItemClassName } from "./toggle-group-classes.js";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  // src/components/segmented-icon-toggle.tsx
6
6
  /** Compact segmented control of icon buttons (e.g. table row wrap, list
@@ -8,7 +8,7 @@ import { jsx } from "react/jsx-runtime";
8
8
  * the same across the app. A `ToggleGroup` of icon items that always holds
9
9
  * one value: clicking the chosen option keeps it. */
10
10
  const SegmentedIconToggle = ({ value, options, onChange, size = "compact" }) => /* @__PURE__ */ jsx(ToggleGroup, {
11
- className: cn("rounded-md", size === "touch" ? "h-7 [@media(any-pointer:coarse)]:h-12" : "h-7"),
11
+ className: segmentedIconToggleClassName(size),
12
12
  "data-slot": "segmented-icon-toggle",
13
13
  onValueChange: (next) => {
14
14
  const [chosen] = next;
@@ -19,11 +19,12 @@ const SegmentedIconToggle = ({ value, options, onChange, size = "compact" }) =>
19
19
  const Icon = option.icon;
20
20
  return /* @__PURE__ */ jsx(ToggleGroupItem, {
21
21
  "aria-label": option.label,
22
- className: cn("h-6 w-7 rounded-sm sm:h-6", size === "touch" && "[@media(any-pointer:coarse)]:h-11 [@media(any-pointer:coarse)]:w-11"),
22
+ className: segmentedIconToggleItemClassName(size),
23
23
  "data-control-value": option.value,
24
+ id: option.id,
24
25
  size: "icon-xs",
25
26
  value: option.value,
26
- children: /* @__PURE__ */ jsx(Icon, { className: "size-3.5" })
27
+ children: /* @__PURE__ */ jsx(Icon, { className: SEGMENTED_ICON_TOGGLE_ICON_CLASS_NAME })
27
28
  }, option.value);
28
29
  })
29
30
  });
@@ -0,0 +1,10 @@
1
+ /** The trigger's metric per control size, over the field trigger's box. */
2
+ export declare const SELECT_TRIGGER_SIZE_CLASS_NAMES: {
3
+ readonly sm: "min-h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] text-sm sm:min-h-7 sm:text-xs";
4
+ readonly default: undefined;
5
+ readonly lg: "min-h-10 sm:min-h-9";
6
+ };
7
+ /** The chosen value's line inside the trigger. */
8
+ export declare const SELECT_VALUE_CLASS_NAME = "data-placeholder:text-muted-foreground flex-1 truncate";
9
+ /** The up-down chevrons at the trigger's end. */
10
+ export declare const SELECT_TRIGGER_ICON_CLASS_NAME = "-me-1 size-4.5 opacity-80 sm:size-4";
@@ -0,0 +1,13 @@
1
+ import { CONTROL_SIZE } from "../lib/control-size.js";
2
+ // src/components/select-classes.ts
3
+ /** The trigger's metric per control size, over the field trigger's box. */
4
+ const SELECT_TRIGGER_SIZE_CLASS_NAMES = {
5
+ [CONTROL_SIZE.sm]: "min-h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] text-sm sm:min-h-7 sm:text-xs",
6
+ [CONTROL_SIZE.default]: void 0,
7
+ [CONTROL_SIZE.lg]: "min-h-10 sm:min-h-9"
8
+ };
9
+ /** The chosen value's line inside the trigger. */
10
+ const SELECT_VALUE_CLASS_NAME = "data-placeholder:text-muted-foreground flex-1 truncate";
11
+ /** The up-down chevrons at the trigger's end. */
12
+ const SELECT_TRIGGER_ICON_CLASS_NAME = "-me-1 size-4.5 opacity-80 sm:size-4";
13
+ export { SELECT_TRIGGER_ICON_CLASS_NAME, SELECT_TRIGGER_SIZE_CLASS_NAMES, SELECT_VALUE_CLASS_NAME };