rift-ds 1.28.0 → 1.30.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 (140) hide show
  1. package/README.md +5 -4
  2. package/bin/rift-ds.mjs +5 -4
  3. package/bin/templates/app/components/rift/ColorModeScript.tsx +7 -3
  4. package/bin/templates/blocks/app/settings/ProfileForm.tsx +98 -0
  5. package/bin/templates/blocks/app/settings/page.module.css +11 -0
  6. package/bin/templates/blocks/app/settings/page.tsx +84 -0
  7. package/bin/templates/blocks/app/shader/page.module.css +75 -0
  8. package/bin/templates/blocks/app/shader/page.tsx +81 -0
  9. package/bin/templates/blocks/components/blocks/AppShell.module.css +8 -41
  10. package/bin/templates/blocks/components/blocks/AppShell.tsx +9 -11
  11. package/bin/templates/blocks/components/blocks/emberScene.ts +53 -0
  12. package/bin/templates/blocks/registry.json +24 -0
  13. package/bin/templates/chat/app/api/chat/feedback/route.ts +0 -3
  14. package/bin/templates/chat/app/api/chat/followups/route.ts +0 -3
  15. package/bin/templates/chat/app/api/chat/route.ts +0 -2
  16. package/chat/ChatLauncher.d.ts +9 -1
  17. package/chat/ChatLauncher.js +3 -1
  18. package/chat/threads.js +7 -4
  19. package/components/Alert/Alert.css +12 -0
  20. package/components/Alert/Alert.d.ts +2 -0
  21. package/components/Alert/Alert.js +3 -1
  22. package/components/Attachment/Attachment.css +92 -0
  23. package/components/Attachment/FileRow.d.ts +47 -0
  24. package/components/Attachment/FileRow.js +38 -0
  25. package/components/Avatar/Avatar.css +14 -0
  26. package/components/Avatar/Avatar.d.ts +3 -1
  27. package/components/Avatar/Avatar.js +3 -2
  28. package/components/Button/Button.css +38 -0
  29. package/components/Button/Button.d.ts +8 -0
  30. package/components/Button/Button.js +2 -0
  31. package/components/Chart/AreaChart.d.ts +2 -0
  32. package/components/Chart/AreaChart.js +2 -1
  33. package/components/Chart/BarChart.d.ts +2 -0
  34. package/components/Chart/BarChart.js +2 -1
  35. package/components/Chart/ComboChart.d.ts +4 -0
  36. package/components/Chart/ComboChart.js +4 -2
  37. package/components/Chart/LineChart.d.ts +2 -0
  38. package/components/Chart/LineChart.js +2 -1
  39. package/components/Chart/PieChart.d.ts +4 -4
  40. package/components/Chart/PieChart.js +1 -1
  41. package/components/Chart/ScatterChart.d.ts +2 -0
  42. package/components/Chart/ScatterChart.js +2 -1
  43. package/components/Checklist/Checklist.css +123 -0
  44. package/components/Checklist/Checklist.d.ts +66 -0
  45. package/components/Checklist/Checklist.js +115 -0
  46. package/components/CircularButton/CircularButton.css +39 -0
  47. package/components/CircularButton/CircularButton.d.ts +13 -0
  48. package/components/CircularButton/CircularButton.js +18 -4
  49. package/components/ColourSwatch/ColourSwatch.css +3 -1
  50. package/components/ColourSwatch/ColourSwatch.d.ts +5 -3
  51. package/components/ColourSwatch/ColourSwatch.js +5 -0
  52. package/components/Combobox/Combobox.d.ts +4 -2
  53. package/components/Combobox/Combobox.js +7 -3
  54. package/components/DataTable/DataTable.css +35 -0
  55. package/components/DataTable/DataTable.d.ts +34 -2
  56. package/components/DataTable/DataTable.js +58 -5
  57. package/components/DataTable/columnTypes.d.ts +1 -1
  58. package/components/DataTable/columnTypes.js +1 -1
  59. package/components/DateInput/DateInput.d.ts +4 -2
  60. package/components/DateInput/DateInput.js +7 -3
  61. package/components/DescriptionList/DescriptionList.css +28 -0
  62. package/components/DescriptionList/DescriptionList.d.ts +3 -1
  63. package/components/DescriptionList/DescriptionList.js +4 -3
  64. package/components/DescriptionList/DescriptionListCopy.js +2 -0
  65. package/components/Dropdown/Dropdown.d.ts +4 -2
  66. package/components/Dropdown/Dropdown.js +7 -3
  67. package/components/EmptyState/EmptyState.css +12 -0
  68. package/components/EmptyState/EmptyState.d.ts +7 -0
  69. package/components/EmptyState/EmptyState.js +2 -0
  70. package/components/EventCalendar/EventCalendar.css +59 -0
  71. package/components/EventCalendar/EventCalendar.d.ts +24 -2
  72. package/components/EventCalendar/EventCalendar.js +104 -19
  73. package/components/FormSection/FormSection.css +70 -0
  74. package/components/FormSection/FormSection.d.ts +35 -0
  75. package/components/FormSection/FormSection.js +35 -0
  76. package/components/Grid/Grid.css +52 -0
  77. package/components/Grid/Grid.d.ts +30 -0
  78. package/components/Grid/Grid.js +36 -0
  79. package/components/Icon/Icon.css +55 -0
  80. package/components/Icon/Icon.d.ts +27 -0
  81. package/components/Icon/Icon.js +42 -0
  82. package/components/NumberInput/NumberInput.d.ts +4 -2
  83. package/components/NumberInput/NumberInput.js +7 -3
  84. package/components/OrgChart/OrgChart.css +143 -0
  85. package/components/OrgChart/OrgChart.d.ts +44 -0
  86. package/components/OrgChart/OrgChart.js +26 -0
  87. package/components/PageHeader/PageHeader.css +74 -0
  88. package/components/PageHeader/PageHeader.d.ts +39 -0
  89. package/components/PageHeader/PageHeader.js +33 -0
  90. package/components/Panel/Panel.css +7 -0
  91. package/components/Panel/Panel.d.ts +5 -2
  92. package/components/Panel/Panel.js +2 -1
  93. package/components/ResourceTimeline/ResourceTimeline.css +194 -0
  94. package/components/ResourceTimeline/ResourceTimeline.d.ts +57 -0
  95. package/components/ResourceTimeline/ResourceTimeline.js +129 -0
  96. package/components/ShaderField/useShaderField.js +13 -1
  97. package/components/ShaderScene/ShaderScene.d.ts +39 -15
  98. package/components/ShaderScene/ShaderScene.js +87 -6
  99. package/components/ShaderScene/assemble.d.ts +10 -3
  100. package/components/ShaderScene/assemble.js +29 -0
  101. package/components/ShaderScene/renderer.d.ts +12 -4
  102. package/components/ShaderScene/renderer.js +32 -20
  103. package/components/ShaderScene/scenes.d.ts +78 -0
  104. package/components/ShaderScene/scenes.js +933 -1
  105. package/components/ShaderScene/types.d.ts +52 -23
  106. package/components/Stack/Stack.css +68 -0
  107. package/components/Stack/Stack.d.ts +37 -0
  108. package/components/Stack/Stack.js +39 -0
  109. package/components/Stat/Stat.css +65 -0
  110. package/components/Stat/Stat.d.ts +7 -1
  111. package/components/Stat/Stat.js +16 -1
  112. package/components/Table/Table.css +11 -0
  113. package/components/Table/Table.d.ts +2 -0
  114. package/components/Table/Table.js +5 -1
  115. package/components/Tabs/Tabs.css +23 -0
  116. package/components/Tabs/Tabs.d.ts +9 -8
  117. package/components/Tabs/Tabs.js +38 -5
  118. package/components/Textarea/Textarea.d.ts +4 -2
  119. package/components/Textarea/Textarea.js +7 -3
  120. package/components/ThemeToggle/colorMode.d.ts +17 -1
  121. package/components/ThemeToggle/colorMode.js +11 -2
  122. package/components/Widget/Widget.css +21 -0
  123. package/components/Widget/Widget.d.ts +4 -0
  124. package/components/Widget/Widget.js +13 -5
  125. package/components/Wizard/Wizard.css +67 -0
  126. package/components/Wizard/Wizard.d.ts +54 -0
  127. package/components/Wizard/Wizard.js +71 -0
  128. package/components/registry.d.ts +25 -0
  129. package/components/registry.js +8 -0
  130. package/components/registry.json +234 -33
  131. package/components/registry.json.d.ts +234 -33
  132. package/components/registry.json.js +1 -1
  133. package/index.d.ts +10 -0
  134. package/index.js +20 -0
  135. package/package.json +1 -1
  136. package/tokens/motion.d.ts +2 -0
  137. package/tokens/motion.js +2 -0
  138. package/tokens/values.d.ts +31 -0
  139. package/tokens/values.js +16 -0
  140. package/tokens/values.json.js +1 -1
@@ -27,6 +27,7 @@ const NumberInput = React.forwardRef(
27
27
  required = false,
28
28
  error = false,
29
29
  helperText,
30
+ errorText,
30
31
  onChange,
31
32
  onValueChange,
32
33
  decreaseLabel = "Decrease value",
@@ -44,10 +45,12 @@ const NumberInput = React.forwardRef(
44
45
  );
45
46
  const currentValue = isControlled ? value : internalValue;
46
47
  const currentNumber = parseValue(currentValue);
48
+ const hasErrorText = errorText != null && errorText !== false && errorText !== "";
49
+ const invalid = error || hasErrorText;
47
50
  const classes = [
48
51
  baseClass,
49
52
  size === "compact" ? `${baseClass}--compact` : "",
50
- error ? `${baseClass}--error` : "",
53
+ invalid ? `${baseClass}--error` : "",
51
54
  disabled ? `${baseClass}--disabled` : "",
52
55
  className
53
56
  ].filter(Boolean).join(" ");
@@ -81,13 +84,14 @@ const NumberInput = React.forwardRef(
81
84
  const atMin = min !== void 0 && currentNumber !== null && currentNumber <= min;
82
85
  const atMax = max !== void 0 && currentNumber !== null && currentNumber >= max;
83
86
  const inputId = id || name || label?.toLowerCase().replace(/\s+/g, "-");
84
- const describedBy = helperText ? `${inputId}-helper` : rest["aria-describedby"];
87
+ const describedBy = [rest["aria-describedby"], hasErrorText ? `${inputId}-error` : void 0, helperText ? `${inputId}-helper` : void 0].filter(Boolean).join(" ") || void 0;
85
88
  return /* @__PURE__ */ jsx(
86
89
  Field,
87
90
  {
88
91
  className: classes,
89
92
  label,
90
93
  helperText,
94
+ errorText,
91
95
  error,
92
96
  required,
93
97
  disabled,
@@ -121,7 +125,7 @@ const NumberInput = React.forwardRef(
121
125
  disabled,
122
126
  required,
123
127
  "aria-label": rest["aria-label"] || label,
124
- "aria-invalid": error,
128
+ "aria-invalid": invalid,
125
129
  "aria-describedby": describedBy,
126
130
  onChange: handleChange,
127
131
  onBlur: handleBlur
@@ -0,0 +1,143 @@
1
+ /* ============================================
2
+ ORG CHART
3
+ Nested lists drawn top down: each item is a
4
+ card with its reports in a row beneath it.
5
+ The lines are borders on pseudo-elements on
6
+ --color-divider: a stem down from a card, a
7
+ rail across its reports and a stem up into
8
+ each, so the chart needs no measuring. The
9
+ rail stops at the first and last report's
10
+ centres, on logical sides, so it mirrors in a
11
+ right-to-left context.
12
+ ============================================ */
13
+
14
+ /* Base */
15
+ .ds-org-chart {
16
+ min-width: 0;
17
+ }
18
+
19
+ .ds-org-chart__scroll {
20
+ overflow-x: auto;
21
+ padding-block: var(--padding-200);
22
+ }
23
+
24
+ .ds-org-chart__tree,
25
+ .ds-org-chart__reports {
26
+ display: flex;
27
+ justify-content: center;
28
+ margin: 0;
29
+ padding: 0;
30
+ list-style: none;
31
+ }
32
+
33
+ .ds-org-chart__tree {
34
+ min-width: max-content;
35
+ }
36
+
37
+ /* The reports sit a gap below their manager, with a stem down from it. */
38
+ .ds-org-chart__reports {
39
+ position: relative;
40
+ padding-block-start: var(--gap-500);
41
+ }
42
+
43
+ .ds-org-chart__reports::before {
44
+ content: '';
45
+ position: absolute;
46
+ inset-block-start: 0;
47
+ inset-inline-start: 50%;
48
+ block-size: calc(var(--gap-500) / 2);
49
+ border-inline-start: var(--border-025) solid var(--color-divider);
50
+ }
51
+
52
+ /* Items */
53
+ .ds-org-chart__item {
54
+ position: relative;
55
+ display: flex;
56
+ flex-direction: column;
57
+ align-items: center;
58
+ padding-inline: var(--padding-200);
59
+ }
60
+
61
+ /* Inside a list of reports: a stem up from each card to the rail, and the
62
+ rail across the item, cut back to the centre at either end of the row. */
63
+ .ds-org-chart__reports > .ds-org-chart__item::before,
64
+ .ds-org-chart__reports > .ds-org-chart__item::after {
65
+ content: '';
66
+ position: absolute;
67
+ inset-block-start: calc(var(--gap-500) / -2);
68
+ }
69
+
70
+ .ds-org-chart__reports > .ds-org-chart__item::before {
71
+ inset-inline-start: 50%;
72
+ block-size: calc(var(--gap-500) / 2);
73
+ border-inline-start: var(--border-025) solid var(--color-divider);
74
+ }
75
+
76
+ .ds-org-chart__reports > .ds-org-chart__item::after {
77
+ inset-inline: 0;
78
+ border-block-start: var(--border-025) solid var(--color-divider);
79
+ }
80
+
81
+ .ds-org-chart__reports > .ds-org-chart__item:first-child::after {
82
+ inset-inline-start: 50%;
83
+ }
84
+
85
+ .ds-org-chart__reports > .ds-org-chart__item:last-child::after {
86
+ inset-inline-end: 50%;
87
+ }
88
+
89
+ .ds-org-chart__reports > .ds-org-chart__item:only-child::after {
90
+ display: none;
91
+ }
92
+
93
+ /* The card: the Widget tile's edge on the primary container. */
94
+ .ds-org-chart__card {
95
+ display: flex;
96
+ align-items: center;
97
+ gap: var(--gap-200);
98
+ min-width: 0;
99
+ padding: var(--padding-200) var(--padding-300);
100
+ background-color: var(--color-bg-container-primary);
101
+ border: var(--border-025) solid var(--color-bg-container-border);
102
+ border-radius: var(--radius-300);
103
+ white-space: nowrap;
104
+ }
105
+
106
+ .ds-org-chart__text {
107
+ display: flex;
108
+ flex-direction: column;
109
+ min-width: 0;
110
+ }
111
+
112
+ .ds-org-chart__name {
113
+ font-family: var(--font-paragraph-sm-emphasis-family);
114
+ font-size: var(--font-paragraph-sm-emphasis-size);
115
+ font-weight: var(--font-paragraph-sm-emphasis-weight);
116
+ line-height: var(--font-paragraph-sm-emphasis-line-height);
117
+ letter-spacing: var(--font-paragraph-sm-emphasis-letter-spacing);
118
+ color: var(--color-text-primary);
119
+ }
120
+
121
+ .ds-org-chart__name--link {
122
+ text-decoration: none;
123
+ border-radius: var(--radius-100);
124
+ }
125
+
126
+ .ds-org-chart__name--link:hover,
127
+ .ds-org-chart__name--link:focus-visible {
128
+ text-decoration: underline;
129
+ }
130
+
131
+ .ds-org-chart__name--link:focus-visible {
132
+ outline: 2px solid var(--color-action-primary-bg);
133
+ outline-offset: 2px;
134
+ }
135
+
136
+ .ds-org-chart__role {
137
+ font-family: var(--font-caption-family);
138
+ font-size: var(--font-caption-size);
139
+ font-weight: var(--font-caption-weight);
140
+ line-height: var(--font-caption-line-height);
141
+ letter-spacing: var(--font-caption-letter-spacing);
142
+ color: var(--color-text-tertiary);
143
+ }
@@ -0,0 +1,44 @@
1
+ import { default as React } from 'react';
2
+ import { LinkComponent } from '../../behaviors/LinkProvider';
3
+ /** One person in the chart, and the people who report to them. */
4
+ export interface OrgChartNode {
5
+ /** A stable id for the person. */
6
+ id: string;
7
+ /** Their name. */
8
+ name: string;
9
+ /** Their role ("Head of design"). */
10
+ role?: string;
11
+ /** An image for their avatar; their initials show without one. */
12
+ avatarSrc?: string;
13
+ /** Makes the person's name a link to their profile. */
14
+ href?: string;
15
+ /** The people who report to them, in order. */
16
+ reports?: OrgChartNode[];
17
+ }
18
+ /** Props owned by OrgChart itself; everything else falls through to the root `<div>`. */
19
+ type OrgChartOwnProps = {
20
+ /** The person at the top, with everyone under them. */
21
+ root: OrgChartNode;
22
+ /** The chart's name, read before the people in it ("Design team"). */
23
+ label: string;
24
+ /**
25
+ * The component the people's links render with, such as Next.js's `Link`,
26
+ * so they navigate through the app's router; a plain `<a>` when unset.
27
+ * This component can render on the server, so it never reads a
28
+ * LinkProvider: pass the prop even under one.
29
+ */
30
+ linkComponent?: LinkComponent;
31
+ /** Additional CSS classes */
32
+ className?: string;
33
+ };
34
+ export interface OrgChartProps extends OrgChartOwnProps, Omit<React.ComponentPropsWithRef<'div'>, keyof OrgChartOwnProps | 'children'> {
35
+ }
36
+ /**
37
+ * Who reports to whom: each person a card with their avatar, name and role,
38
+ * their reports in a row beneath them, joined by lines. The hierarchy is
39
+ * nested lists, so a screen reader hears each person's reports as a list
40
+ * inside their item, at its level. A chart wider than its column scrolls
41
+ * sideways. Server-renderable.
42
+ */
43
+ export declare function OrgChart({ root, label, linkComponent, className, ref, ...rest }: OrgChartProps): React.JSX.Element;
44
+ export {};
@@ -0,0 +1,26 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import "react";
3
+ import { ScrollRegion } from "../../behaviors/ScrollRegion.js";
4
+ import { Avatar } from "../Avatar/Avatar.js";
5
+ import "./OrgChart.css";
6
+ function OrgChart({ root, label, linkComponent, className = "", ref, ...rest }) {
7
+ const Link = linkComponent ?? "a";
8
+ const node = (person) => {
9
+ const reports = person.reports ?? [];
10
+ return /* @__PURE__ */ jsxs("li", { className: "ds-org-chart__item", children: [
11
+ /* @__PURE__ */ jsxs("div", { className: "ds-org-chart__card", children: [
12
+ /* @__PURE__ */ jsx(Avatar, { name: person.name, src: person.avatarSrc, size: "sm", "aria-hidden": "true" }),
13
+ /* @__PURE__ */ jsxs("span", { className: "ds-org-chart__text", children: [
14
+ person.href !== void 0 ? /* @__PURE__ */ jsx(Link, { href: person.href, className: "ds-org-chart__name ds-org-chart__name--link", children: person.name }) : /* @__PURE__ */ jsx("span", { className: "ds-org-chart__name", children: person.name }),
15
+ person.role && /* @__PURE__ */ jsx("span", { className: "ds-org-chart__role", children: person.role })
16
+ ] })
17
+ ] }),
18
+ reports.length > 0 && /* @__PURE__ */ jsx("ul", { className: "ds-org-chart__reports", children: reports.map(node) })
19
+ ] }, person.id);
20
+ };
21
+ const classes = ["ds-org-chart", className].filter(Boolean).join(" ");
22
+ return /* @__PURE__ */ jsx("div", { role: "group", "aria-label": label, ...rest, ref, className: classes, children: /* @__PURE__ */ jsx(ScrollRegion, { className: "ds-org-chart__scroll", children: /* @__PURE__ */ jsx("ul", { className: "ds-org-chart__tree", children: node(root) }) }) });
23
+ }
24
+ export {
25
+ OrgChart
26
+ };
@@ -0,0 +1,74 @@
1
+ /* ============================================
2
+ PAGE HEADER
3
+ Breadcrumb, then the title row: the heading
4
+ and its description at the start, the page's
5
+ actions at the end. The header is its own
6
+ size container, so the actions fold under the
7
+ text by the room it has, never the viewport.
8
+ ============================================ */
9
+
10
+ /* Base */
11
+ .ds-page-header {
12
+ container-type: inline-size;
13
+ display: flex;
14
+ flex-direction: column;
15
+ gap: var(--gap-100);
16
+ min-width: 0;
17
+ }
18
+
19
+ /* Title row */
20
+ .ds-page-header__row {
21
+ display: flex;
22
+ align-items: flex-end;
23
+ justify-content: space-between;
24
+ gap: var(--gap-400);
25
+ }
26
+
27
+ .ds-page-header__text {
28
+ display: flex;
29
+ flex-direction: column;
30
+ gap: var(--gap-100);
31
+ min-width: 0;
32
+ }
33
+
34
+ .ds-page-header__title {
35
+ margin: 0;
36
+ }
37
+
38
+ .ds-page-header__description {
39
+ margin: 0;
40
+ font-family: var(--font-paragraph-family);
41
+ font-size: var(--font-paragraph-size);
42
+ font-weight: var(--font-paragraph-weight);
43
+ line-height: var(--font-paragraph-line-height);
44
+ letter-spacing: var(--font-paragraph-letter-spacing);
45
+ color: var(--color-text-secondary);
46
+ }
47
+
48
+ /* Actions */
49
+ .ds-page-header__actions {
50
+ display: flex;
51
+ flex-wrap: wrap;
52
+ align-items: center;
53
+ justify-content: flex-end;
54
+ gap: var(--gap-200);
55
+ flex-shrink: 0;
56
+ }
57
+
58
+ /* Narrow: the actions take the row under the text and share it evenly. */
59
+ @container (max-width: 560px) {
60
+ .ds-page-header__row {
61
+ flex-direction: column;
62
+ align-items: stretch;
63
+ }
64
+
65
+ .ds-page-header__actions {
66
+ justify-content: stretch;
67
+ }
68
+
69
+ /* Each action starts at its own width and grows to share the row, so a
70
+ label never squeezes: actions that cannot fit side by side wrap. */
71
+ .ds-page-header__actions > * {
72
+ flex: 1 1 auto;
73
+ }
74
+ }
@@ -0,0 +1,39 @@
1
+ import { default as React } from 'react';
2
+ import { LinkComponent } from '../../behaviors/LinkProvider';
3
+ import { BreadcrumbItem } from '../Breadcrumb/Breadcrumb';
4
+ /** Props owned by PageHeader itself; everything else falls through to the root `<header>`. */
5
+ type PageHeaderOwnProps = {
6
+ /**
7
+ * The page's title, its heading.
8
+ * Note: this shadows the native `title` tooltip attribute, which PageHeader does not expose.
9
+ */
10
+ title: React.ReactNode;
11
+ /** A sentence under the title on what the page is for or what it holds. */
12
+ description?: React.ReactNode;
13
+ /** The trail above the title, from the top of the app to this page; the last item is this page and takes no `href`. */
14
+ breadcrumb?: BreadcrumbItem[];
15
+ /** The page's own actions at the end of the title row: one primary Button, a secondary or two. On a narrow page they take the row under the text. */
16
+ actions?: React.ReactNode;
17
+ /** The heading's place in the outline. The page's title is its `h1`; a header inside a tab or a pane can be an `h2`. */
18
+ headingLevel?: 1 | 2;
19
+ /**
20
+ * The component the breadcrumb's links render with, such as Next.js's
21
+ * `Link`, so they navigate through the app's router; a plain `<a>` when
22
+ * unset. This component can render on the server, so it never reads a
23
+ * LinkProvider: pass the prop even under one.
24
+ */
25
+ linkComponent?: LinkComponent;
26
+ /** Additional CSS classes */
27
+ className?: string;
28
+ };
29
+ export interface PageHeaderProps extends PageHeaderOwnProps, Omit<React.ComponentPropsWithRef<'header'>, keyof PageHeaderOwnProps | 'children'> {
30
+ }
31
+ /**
32
+ * The top of a page: where it sits, what it is called, what it is for, and
33
+ * what can be done from it. Breadcrumb, Heading and the page's own actions in
34
+ * one layout that folds the actions under the text when the header is narrow.
35
+ * Inside `<main>` the `<header>` is no landmark, so it takes no name of its
36
+ * own; the heading names the page. Server-renderable.
37
+ */
38
+ export declare function PageHeader({ title, description, breadcrumb, actions, headingLevel, linkComponent, className, ref, ...rest }: PageHeaderProps): React.JSX.Element;
39
+ export {};
@@ -0,0 +1,33 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import "react";
3
+ import { Breadcrumb } from "../Breadcrumb/Breadcrumb.js";
4
+ import { Heading } from "../Heading/Heading.js";
5
+ import "./PageHeader.css";
6
+ function PageHeader({
7
+ title,
8
+ description,
9
+ breadcrumb,
10
+ actions,
11
+ headingLevel = 1,
12
+ linkComponent,
13
+ className = "",
14
+ ref,
15
+ ...rest
16
+ }) {
17
+ const hasDescription = description != null && description !== false && description !== "";
18
+ const hasActions = actions != null && actions !== false;
19
+ const classes = ["ds-page-header", className].filter(Boolean).join(" ");
20
+ return /* @__PURE__ */ jsxs("header", { ...rest, ref, className: classes, children: [
21
+ breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsx(Breadcrumb, { items: breadcrumb, linkComponent, className: "ds-page-header__breadcrumb" }),
22
+ /* @__PURE__ */ jsxs("div", { className: "ds-page-header__row", children: [
23
+ /* @__PURE__ */ jsxs("div", { className: "ds-page-header__text", children: [
24
+ /* @__PURE__ */ jsx(Heading, { level: headingLevel, className: "ds-page-header__title", children: title }),
25
+ hasDescription && /* @__PURE__ */ jsx("p", { className: "ds-page-header__description", children: description })
26
+ ] }),
27
+ hasActions && /* @__PURE__ */ jsx("div", { className: "ds-page-header__actions", children: actions })
28
+ ] })
29
+ ] });
30
+ }
31
+ export {
32
+ PageHeader
33
+ };
@@ -13,6 +13,13 @@
13
13
  padding: var(--padding-500);
14
14
  }
15
15
 
16
+ /* The Widget tile's edge, for a theme whose page fill matches the panel's.
17
+ Box-sizing keeps a bordered panel the size of a plain one beside it. */
18
+ .ds-panel--bordered {
19
+ box-sizing: border-box;
20
+ border: var(--border-025) solid var(--color-bg-container-border);
21
+ }
22
+
16
23
  /* ============================================
17
24
  PADDING VARIANTS
18
25
  ============================================ */
@@ -3,6 +3,8 @@ import { default as React } from 'react';
3
3
  type PanelOwnProps = {
4
4
  /** Interior padding: 'default' uses --padding-500, 'compact' uses --padding-400, 'none' removes it */
5
5
  padding?: 'default' | 'compact' | 'none';
6
+ /** Draws the container border the Widget tile wears, so the panel keeps a visible edge in a theme whose page fill matches the panel's. */
7
+ bordered?: boolean;
6
8
  /** Additional CSS classes */
7
9
  className?: string;
8
10
  /** Panel content */
@@ -12,8 +14,9 @@ export interface PanelProps extends PanelOwnProps, Omit<React.ComponentPropsWith
12
14
  }
13
15
  /**
14
16
  * Panel component: the plain dashboard surface.
15
- * A rounded container on the primary container background with no border and
16
- * no shadow: just the surface, ready for whatever a dashboard region holds.
17
+ * A rounded container on the primary container background with no shadow and,
18
+ * unless `bordered`, no border: just the surface, ready for whatever a
19
+ * dashboard region holds.
17
20
  * Content stacks vertically with a medium gap.
18
21
  *
19
22
  * Forwards a ref to the `<div>` element and spreads unrecognised props onto it.
@@ -2,12 +2,13 @@ import { jsx } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import "./Panel.css";
4
4
  const Panel = React.forwardRef(
5
- ({ padding = "default", className = "", children, ...rest }, ref) => {
5
+ ({ padding = "default", bordered = false, className = "", children, ...rest }, ref) => {
6
6
  const baseClass = "ds-panel";
7
7
  const classes = [
8
8
  baseClass,
9
9
  padding === "compact" ? `${baseClass}--compact` : "",
10
10
  padding === "none" ? `${baseClass}--flush` : "",
11
+ bordered ? `${baseClass}--bordered` : "",
11
12
  className
12
13
  ].filter(Boolean).join(" ");
13
14
  return /* @__PURE__ */ jsx("div", { ...rest, ref, className: classes, children });
@@ -0,0 +1,194 @@
1
+ /* ============================================
2
+ RESOURCE TIMELINE
3
+ A label column and a track of hours. Bars sit
4
+ on the track by their start and length as a
5
+ share of the day shown, on logical insets, so
6
+ the day runs from the reading direction's
7
+ start. A bar wears the calendar's event pill:
8
+ the event fill with an accent edge and the
9
+ label in the primary text colour, so it reads
10
+ on every theme whatever the accent.
11
+ ============================================ */
12
+
13
+ /* Base */
14
+ .ds-resource-timeline {
15
+ --ds-resource-timeline-label: 9rem;
16
+ /* The narrowest an hour gets before the timeline scrolls: wide enough that
17
+ the first tick, held inside the axis, clears the centred one after it. */
18
+ --ds-resource-timeline-hour: calc(var(--gap-1000) + var(--gap-500));
19
+
20
+ min-width: 0;
21
+ }
22
+
23
+ /* A narrow column scrolls the day sideways; ScrollRegion makes it a
24
+ keyboard stop only while it does. */
25
+ .ds-resource-timeline__scroll {
26
+ display: flex;
27
+ flex-direction: column;
28
+ overflow-x: auto;
29
+ }
30
+
31
+ /* Header: the label column's title and the hour ticks */
32
+ .ds-resource-timeline__head {
33
+ display: grid;
34
+ grid-template-columns: var(--ds-resource-timeline-label) minmax(0, 1fr);
35
+ min-width: calc(var(--ds-resource-timeline-label) + var(--ds-resource-timeline-hours, 16) * var(--ds-resource-timeline-hour));
36
+ padding-block-end: var(--padding-200);
37
+ border-block-end: var(--border-025) solid var(--color-divider);
38
+ }
39
+
40
+ .ds-resource-timeline__row-header,
41
+ .ds-resource-timeline__tick {
42
+ font-family: var(--font-caption-family);
43
+ font-size: var(--font-caption-size);
44
+ font-weight: var(--font-caption-weight);
45
+ line-height: var(--font-caption-line-height);
46
+ letter-spacing: var(--font-caption-letter-spacing);
47
+ color: var(--color-text-tertiary);
48
+ }
49
+
50
+ .ds-resource-timeline__axis {
51
+ position: relative;
52
+ min-height: var(--font-caption-line-height);
53
+ }
54
+
55
+ .ds-resource-timeline__tick {
56
+ position: absolute;
57
+ inset-block-start: 0;
58
+ transform: translateX(calc(-50% * var(--ds-inline-sign, 1)));
59
+ white-space: nowrap;
60
+ font-variant-numeric: tabular-nums;
61
+ }
62
+
63
+ /* The ticks centre on their hour; the first and last sit inside the axis
64
+ so neither hangs past the track's ends. */
65
+ .ds-resource-timeline__tick:first-child {
66
+ transform: none;
67
+ }
68
+
69
+ .ds-resource-timeline__tick:last-child {
70
+ transform: translateX(calc(-100% * var(--ds-inline-sign, 1)));
71
+ }
72
+
73
+ /* Rows */
74
+ .ds-resource-timeline__rows {
75
+ display: flex;
76
+ flex-direction: column;
77
+ margin: 0;
78
+ padding: 0;
79
+ list-style: none;
80
+ min-width: calc(var(--ds-resource-timeline-label) + var(--ds-resource-timeline-hours, 16) * var(--ds-resource-timeline-hour));
81
+ }
82
+
83
+ .ds-resource-timeline__row {
84
+ display: grid;
85
+ grid-template-columns: var(--ds-resource-timeline-label) minmax(0, 1fr);
86
+ align-items: center;
87
+ min-height: var(--control-height-default);
88
+ border-block-end: var(--border-025) solid var(--color-divider);
89
+ }
90
+
91
+ .ds-resource-timeline__label {
92
+ overflow: hidden;
93
+ text-overflow: ellipsis;
94
+ white-space: nowrap;
95
+ padding-inline-end: var(--padding-300);
96
+ font-family: var(--font-paragraph-sm-family);
97
+ font-size: var(--font-paragraph-sm-size);
98
+ font-weight: var(--font-paragraph-sm-weight);
99
+ line-height: var(--font-paragraph-sm-line-height);
100
+ letter-spacing: var(--font-paragraph-sm-letter-spacing);
101
+ color: var(--color-text-primary);
102
+ }
103
+
104
+ .ds-resource-timeline__track {
105
+ position: relative;
106
+ align-self: stretch;
107
+ }
108
+
109
+ /* Each hour's line sits on the hour, its width back over it, so the last
110
+ one stays inside the track's end. */
111
+ .ds-resource-timeline__gridline {
112
+ position: absolute;
113
+ inset-block: 0;
114
+ margin-inline-start: calc(var(--border-025) * -1);
115
+ border-inline-start: var(--border-025) solid var(--color-divider);
116
+ }
117
+
118
+ /* The time now: a line across the row in the error role, the convention
119
+ for a live marker on a schedule. */
120
+ .ds-resource-timeline__now {
121
+ position: absolute;
122
+ inset-block: 0;
123
+ border-inline-start: var(--border-050) solid var(--color-status-error-border);
124
+ }
125
+
126
+ /* Bars */
127
+ .ds-resource-timeline__bar {
128
+ --ds-resource-timeline-accent: var(--color-status-neutral-border);
129
+
130
+ position: absolute;
131
+ inset-block: var(--padding-100);
132
+ display: flex;
133
+ align-items: center;
134
+ min-width: 0;
135
+ margin: 0;
136
+ padding: 0 var(--padding-150);
137
+ overflow: hidden;
138
+ background-color: var(--color-calendar-event-bg);
139
+ border: var(--border-025) solid var(--color-calendar-event-border);
140
+ border-inline-start: var(--border-050) solid var(--ds-resource-timeline-accent);
141
+ border-radius: var(--radius-100);
142
+ text-align: start;
143
+ }
144
+
145
+ button.ds-resource-timeline__bar {
146
+ cursor: pointer;
147
+ transition: background-color var(--motion-duration-fast) var(--motion-ease-standard);
148
+ }
149
+
150
+ button.ds-resource-timeline__bar:hover {
151
+ background-color: var(--color-calendar-event-bg-hover);
152
+ }
153
+
154
+ button.ds-resource-timeline__bar:focus-visible {
155
+ outline: 2px solid var(--color-action-primary-bg);
156
+ outline-offset: 2px;
157
+ }
158
+
159
+ .ds-resource-timeline__bar-label {
160
+ overflow: hidden;
161
+ text-overflow: ellipsis;
162
+ white-space: nowrap;
163
+ font-family: var(--font-paragraph-sm-emphasis-family);
164
+ font-size: var(--font-paragraph-sm-emphasis-size);
165
+ font-weight: var(--font-paragraph-sm-emphasis-weight);
166
+ line-height: var(--font-paragraph-sm-emphasis-line-height);
167
+ letter-spacing: var(--font-paragraph-sm-emphasis-letter-spacing);
168
+ color: var(--color-text-primary);
169
+ }
170
+
171
+ /* Accents: the core accent roles, never the action colour */
172
+ .ds-resource-timeline__bar--coral {
173
+ --ds-resource-timeline-accent: var(--color-core-accent-coral);
174
+ }
175
+
176
+ .ds-resource-timeline__bar--violet {
177
+ --ds-resource-timeline-accent: var(--color-core-accent-violet);
178
+ }
179
+
180
+ .ds-resource-timeline__bar--cobalt {
181
+ --ds-resource-timeline-accent: var(--color-core-accent-cobalt);
182
+ }
183
+
184
+ .ds-resource-timeline__bar--amber {
185
+ --ds-resource-timeline-accent: var(--color-core-accent-amber);
186
+ }
187
+
188
+ .ds-resource-timeline__bar--gold {
189
+ --ds-resource-timeline-accent: var(--color-core-accent-gold);
190
+ }
191
+
192
+ .ds-resource-timeline__bar--mint {
193
+ --ds-resource-timeline-accent: var(--color-core-accent-mint);
194
+ }