@ciridae/ui 1.0.5 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/chat/conversation-source.d.ts +1 -3
- package/dist/chat/message-text.js +6 -6
- package/dist/chat/use-chat-conversation.d.ts +7 -2
- package/dist/chat/use-chat-conversation.js +2 -1
- package/dist/components/activity-feed.d.ts +0 -1
- package/dist/components/activity-feed.js +6 -7
- package/dist/components/agent-work.d.ts +5 -1
- package/dist/components/agent-work.js +27 -13
- package/dist/components/app-frame.d.ts +3 -17
- package/dist/components/app-frame.js +11 -30
- package/dist/components/app-navigation.d.ts +5 -6
- package/dist/components/app-navigation.js +65 -40
- package/dist/components/badge.d.ts +0 -4
- package/dist/components/badge.js +17 -27
- package/dist/components/bulk-action-bar.js +2 -2
- package/dist/components/button.js +41 -50
- package/dist/components/calendar.js +5 -8
- package/dist/components/centered-page.js +4 -4
- package/dist/components/chart.js +3 -4
- package/dist/components/chat-client-source.js +55 -34
- package/dist/components/chat-page.js +1 -1
- package/dist/components/chat-sheet.d.ts +30 -20
- package/dist/components/chat-sheet.js +109 -51
- package/dist/components/chat.d.ts +27 -56
- package/dist/components/chat.js +151 -129
- package/dist/components/checkbox-item.js +4 -4
- package/dist/components/checkbox-list.js +6 -6
- package/dist/components/chip.js +2 -2
- package/dist/components/collapsible.js +3 -3
- package/dist/components/color-theme.d.ts +3 -6
- package/dist/components/color-theme.js +10 -11
- package/dist/components/column-settings.js +3 -3
- package/dist/components/command-menu.d.ts +1 -2
- package/dist/components/command-menu.js +56 -77
- package/dist/components/command-palette.js +5 -2
- package/dist/components/copyable-id.js +5 -5
- package/dist/components/data-display.d.ts +1 -7
- package/dist/components/data-display.js +32 -55
- package/dist/components/data-grid.d.ts +4 -7
- package/dist/components/data-grid.js +106 -90
- package/dist/components/date-range-picker.js +4 -5
- package/dist/components/document-viewer.js +23 -23
- package/dist/components/drawer.d.ts +2 -1
- package/dist/components/drawer.js +45 -20
- package/dist/components/dropzone.js +13 -13
- package/dist/components/editable-field.d.ts +2 -12
- package/dist/components/editable-field.js +13 -26
- package/dist/components/email-input.js +2 -3
- package/dist/components/environment-frame.js +7 -7
- package/dist/components/expandable-text.js +2 -2
- package/dist/components/feedback-screenshot.js +7 -7
- package/dist/components/feedback-sheet.js +8 -8
- package/dist/components/filter-bar.js +41 -27
- package/dist/components/form-controls.d.ts +3 -6
- package/dist/components/form-controls.js +15 -22
- package/dist/components/form-layout.d.ts +6 -6
- package/dist/components/form-layout.js +10 -16
- package/dist/components/glass-menu.d.ts +2 -0
- package/dist/components/glass-menu.js +14 -18
- package/dist/components/gradient-edge.d.ts +0 -1
- package/dist/components/gradient-edge.js +8 -9
- package/dist/components/icon.js +1 -1
- package/dist/components/input.js +18 -17
- package/dist/components/keycap.d.ts +2 -6
- package/dist/components/keycap.js +4 -12
- package/dist/components/layout.js +11 -10
- package/dist/components/lightbox.js +8 -8
- package/dist/components/link.js +1 -1
- package/dist/components/locale.d.ts +23 -7
- package/dist/components/locale.js +19 -7
- package/dist/components/log-entry.d.ts +2 -14
- package/dist/components/log-entry.js +11 -22
- package/dist/components/log-list.js +1 -1
- package/dist/components/mention-input.js +13 -14
- package/dist/components/menu.d.ts +7 -4
- package/dist/components/menu.js +23 -10
- package/dist/components/meter.d.ts +2 -3
- package/dist/components/meter.js +12 -16
- package/dist/components/navigation.d.ts +0 -7
- package/dist/components/navigation.js +3 -12
- package/dist/components/notification-tray.js +7 -7
- package/dist/components/overlays.d.ts +5 -2
- package/dist/components/overlays.js +24 -24
- package/dist/components/panel.js +3 -3
- package/dist/components/progress.js +2 -2
- package/dist/components/radio-card.d.ts +1 -1
- package/dist/components/radio-card.js +9 -9
- package/dist/components/record.d.ts +2 -4
- package/dist/components/record.js +19 -32
- package/dist/components/scroll-area.js +10 -10
- package/dist/components/segmented-bar.js +9 -9
- package/dist/components/select.d.ts +3 -5
- package/dist/components/select.js +26 -44
- package/dist/components/settings.js +1 -1
- package/dist/components/shell-skeleton.js +1 -1
- package/dist/components/shell.d.ts +1 -1
- package/dist/components/shell.js +69 -24
- package/dist/components/side-panel.js +3 -3
- package/dist/components/sidebar.d.ts +0 -5
- package/dist/components/sidebar.js +25 -33
- package/dist/components/single-line-text.js +3 -4
- package/dist/components/site-banner.js +4 -4
- package/dist/components/skeleton.js +19 -22
- package/dist/components/skeletons.d.ts +0 -3
- package/dist/components/skeletons.js +5 -10
- package/dist/components/stages.d.ts +6 -3
- package/dist/components/stages.js +77 -105
- package/dist/components/stat-card.d.ts +2 -5
- package/dist/components/stat-card.js +23 -31
- package/dist/components/status-banner.js +6 -6
- package/dist/components/status.js +3 -3
- package/dist/components/steps.js +2 -2
- package/dist/components/switch.js +1 -1
- package/dist/components/tabs.js +15 -18
- package/dist/components/theme-customizer.d.ts +5 -8
- package/dist/components/theme-customizer.js +9 -41
- package/dist/components/theme-toggle.d.ts +0 -1
- package/dist/components/theme-toggle.js +6 -11
- package/dist/components/toast.d.ts +1 -7
- package/dist/components/toast.js +19 -22
- package/dist/components/user-chip.js +8 -8
- package/dist/components/wizard.js +6 -4
- package/dist/preset.d.ts +1 -2
- package/dist/preset.js +39 -89
- package/dist/styled-system/css/conditions.mjs +1 -1
- package/dist/styled-system/css/css.mjs +1 -1
- package/dist/styled-system/styles.css +805 -1279
- package/dist/styled-system/tokens/index.mjs +74 -1926
- package/dist/styled-system/tokens/tokens.d.ts +18 -33
- package/dist/styled-system/types/conditions.d.ts +0 -74
- package/dist/styled-system/types/prop-type.d.ts +15 -40
- package/dist/styled-system/types/style-props.d.ts +705 -705
- package/dist/theme/color.d.ts +0 -1
- package/dist/theme/color.js +0 -16
- package/dist/theme/derive.d.ts +3 -3
- package/dist/theme/derive.js +9 -32
- package/dist/theme/index.d.ts +1 -2
- package/dist/theme/index.js +3 -5
- package/dist/theme/options.d.ts +2 -4
- package/dist/theme/options.js +0 -1
- package/dist/theme/{palettes.d.ts → palette.d.ts} +12 -23
- package/dist/theme/palette.js +127 -0
- package/dist/theme/tokens.d.ts +8 -13
- package/dist/theme/tokens.js +38 -92
- package/package.json +1 -1
- package/dist/theme/palettes.js +0 -254
|
@@ -13,7 +13,7 @@ const card = css({
|
|
|
13
13
|
display: "flex",
|
|
14
14
|
alignItems: "flex-start",
|
|
15
15
|
gap: "layout.contentGap",
|
|
16
|
-
width: "
|
|
16
|
+
width: "full",
|
|
17
17
|
padding: "panel.default",
|
|
18
18
|
border: "1px solid token(colors.border.control)",
|
|
19
19
|
borderRadius: "action",
|
|
@@ -26,11 +26,11 @@ const card = css({
|
|
|
26
26
|
lineHeight: "tight",
|
|
27
27
|
textAlign: "start",
|
|
28
28
|
cursor: "pointer",
|
|
29
|
-
transitionProperty: "background, border-color",
|
|
29
|
+
transitionProperty: "[background, border-color]",
|
|
30
30
|
transitionDuration: "fast",
|
|
31
|
-
_hover: { background: "token(gradients.raisedHover)" },
|
|
31
|
+
_hover: { background: "[token(gradients.raisedHover)]" },
|
|
32
32
|
"&[data-checked]": {
|
|
33
|
-
background: "token(gradients.selected)",
|
|
33
|
+
background: "[token(gradients.selected)]",
|
|
34
34
|
borderColor: "fg.primary",
|
|
35
35
|
},
|
|
36
36
|
_focusVisible: { focusRing: "outer" },
|
|
@@ -40,13 +40,13 @@ const card = css({
|
|
|
40
40
|
const mark = css({
|
|
41
41
|
// Centered on the title's first line, which is one `em` tall, so a detail line below it can't pull
|
|
42
42
|
// the mark down.
|
|
43
|
-
marginTop: "calc((1em - token(sizes.control.radio)) / 2)",
|
|
43
|
+
marginTop: "[calc((1em - token(sizes.control.radio)) / 2)]",
|
|
44
44
|
"[data-checked] > &": {
|
|
45
|
-
background: "token(gradients.primary)",
|
|
46
|
-
_light: { background: "token(gradients.primary)" },
|
|
47
|
-
_before: { background: "token(gradients.border.primary)" },
|
|
45
|
+
background: "[token(gradients.primary)]",
|
|
46
|
+
_light: { background: "[token(gradients.primary)]" },
|
|
47
|
+
_before: { background: "[token(gradients.border.primary)]" },
|
|
48
48
|
},
|
|
49
|
-
"[data-checked]:hover > &": { opacity: "checkedHover", _light: { opacity: "1" } },
|
|
49
|
+
"[data-checked]:hover > &": { opacity: "checkedHover", _light: { opacity: "[1]" } },
|
|
50
50
|
});
|
|
51
51
|
const copy = css({ flex: "1", minWidth: "0", display: "grid", gap: "layout.tightGap" });
|
|
52
52
|
const detailText = css({ color: "fg.muted", fontSize: "code" });
|
|
@@ -48,7 +48,6 @@ export type ItemCardField = {
|
|
|
48
48
|
};
|
|
49
49
|
export type ItemCardProps = Omit<useRender.ComponentProps<"button">, "children" | "onSelect"> & {
|
|
50
50
|
title: ReactNode;
|
|
51
|
-
/** One dot per stage, in its status. */
|
|
52
51
|
progress?: readonly StepStatus[];
|
|
53
52
|
fields: readonly ItemCardField[];
|
|
54
53
|
/** The footer's start: the stage the item is at. */
|
|
@@ -63,16 +62,15 @@ export type ItemCardProps = Omit<useRender.ComponentProps<"button">, "children"
|
|
|
63
62
|
onSelect?: () => void;
|
|
64
63
|
href?: string;
|
|
65
64
|
};
|
|
66
|
-
export declare function ItemCard({ title, progress, fields, status, footer, selected, onSelect, href, render, className, style, ...props }: ItemCardProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
65
|
+
export declare function ItemCard({ title, progress, fields, status, footer, selected, onSelect, onClick, href, render, className, style, ...props }: ItemCardProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
67
66
|
export type PartRowProps = Omit<ComponentProps<"div">, "children" | "onSelect"> & {
|
|
68
67
|
/** `wide` is one line, as in a table; `compact` stacks for a narrow column. */
|
|
69
68
|
layout?: "wide" | "compact";
|
|
70
69
|
name: ReactNode;
|
|
71
70
|
/** Under the name, such as the part's phase and amount. */
|
|
72
71
|
detail?: ReactNode;
|
|
73
|
-
/** One dot per step, in its status
|
|
72
|
+
/** One dot per step, in its status. */
|
|
74
73
|
progress: readonly StepStatus[];
|
|
75
|
-
/** The stage the part is at. */
|
|
76
74
|
stage: ReactNode;
|
|
77
75
|
/** Whose move it is: `yourMove` sets the next step in the ink, the others in grey. */
|
|
78
76
|
state: "yourMove" | "waiting" | "done" | "notStarted";
|
|
@@ -2,9 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
/*
|
|
3
3
|
* The pieces a record's page is laid out with. `DetailLayout` splits it into the work and a side
|
|
4
4
|
* column; `PageHeading` (also exported here) is the record's title row; `RelatedTabs` is the tabbed card of what the
|
|
5
|
-
* record holds; `ItemCard` is one of a record's parts, such as a shipment or a draw, as a card and
|
|
6
|
-
* a row; `RelatedList`
|
|
7
|
-
* lists the records and documents it points at.
|
|
5
|
+
* record holds; `ItemCard` is one of a record's parts, such as a shipment or a draw, as a card and
|
|
6
|
+
* `PartRow` as a row; `RelatedList` lists the records and documents it points at.
|
|
8
7
|
*/
|
|
9
8
|
import { useRender } from "@base-ui/react/use-render";
|
|
10
9
|
import { CaretRightIcon } from "@phosphor-icons/react";
|
|
@@ -47,9 +46,9 @@ const detailAside = css({
|
|
|
47
46
|
_notWide: {
|
|
48
47
|
"[data-sticky-aside]:not([data-stacked]) > &": {
|
|
49
48
|
position: "sticky",
|
|
50
|
-
top: "
|
|
49
|
+
top: "none",
|
|
51
50
|
alignSelf: "start",
|
|
52
|
-
height: "calc(100dvh - token(spacing.panel.compact) * 2 - token(sizes.shell.header) - var(--app-content-inset) * 2 - 3px)",
|
|
51
|
+
height: "[calc(100dvh - token(spacing.panel.compact) * 2 - token(sizes.shell.header) - var(--app-content-inset) * 2 - 3px)]",
|
|
53
52
|
},
|
|
54
53
|
},
|
|
55
54
|
});
|
|
@@ -101,7 +100,7 @@ const relatedHeader = css({
|
|
|
101
100
|
gap: "layout.controlGap",
|
|
102
101
|
minHeight: "control.field",
|
|
103
102
|
paddingInlineEnd: "panel.default",
|
|
104
|
-
"& > :first-child": { minWidth: "0", maxWidth: "
|
|
103
|
+
"& > :first-child": { minWidth: "0", maxWidth: "full" },
|
|
105
104
|
});
|
|
106
105
|
// Wrapped under the tabs, the meta keeps the rows' inset.
|
|
107
106
|
const relatedMeta = css({ paddingInlineStart: "control.block", fontSize: "code" });
|
|
@@ -112,10 +111,6 @@ export function RelatedTabs({ tabs, value, defaultValue, onValueChange, classNam
|
|
|
112
111
|
return null;
|
|
113
112
|
return (_jsxs(TabsRoot, { value: open.value, onValueChange: (next) => setChosen(String(next)), ...props, className: cx(relatedCard, className), "data-ciridae-ui": "", children: [_jsxs("div", { className: relatedHeader, children: [_jsx(TabsList, { variant: "contained", children: tabs.map((tab) => (_jsx(TabsTab, { value: tab.value, count: tab.count, children: tab.label }, tab.value))) }), open.meta !== undefined && _jsx(MutedText, { className: relatedMeta, children: open.meta })] }), tabs.map((tab) => (_jsx(TabsPanel, { value: tab.value, children: tab.content }, tab.value)))] }));
|
|
114
113
|
}
|
|
115
|
-
/*
|
|
116
|
-
* Item card: one of a record's parts, the kit's Part card, with its progress as a mini strip of
|
|
117
|
-
* step dots. The chosen one lifts onto the solid card inside a green edge.
|
|
118
|
-
*/
|
|
119
114
|
const itemCard = css(cardSurface, {
|
|
120
115
|
display: "grid",
|
|
121
116
|
gap: "layout.clusterGap",
|
|
@@ -149,15 +144,13 @@ const progressStrip = css({
|
|
|
149
144
|
alignItems: "center",
|
|
150
145
|
gap: "layout.tightGap",
|
|
151
146
|
});
|
|
152
|
-
// 16px between dots, green out of a finished step as the stage strip's connectors are.
|
|
153
147
|
const progressConnector = css({
|
|
154
|
-
width: "token(spacing.layout.clusterGap)",
|
|
148
|
+
width: "[token(spacing.layout.clusterGap)]",
|
|
155
149
|
height: "border.hairline",
|
|
156
150
|
borderRadius: "round",
|
|
157
151
|
background: "border.divider",
|
|
158
152
|
"&[data-after=done]": { background: "accent.green" },
|
|
159
153
|
});
|
|
160
|
-
/** A part's progress: one 12px dot a step, joined by 16px connectors. */
|
|
161
154
|
function MiniStrip({ progress }) {
|
|
162
155
|
return (_jsx("span", { className: progressStrip, "aria-hidden": "true", children: progress.map((step, index) => (_jsxs(Fragment, { children: [index > 0 && (_jsx("span", { className: progressConnector, "data-after": progress[index - 1] === "done" ? "done" : undefined })), _jsx(StepDot, { status: step, size: "chip" })] }, index))) }));
|
|
163
156
|
}
|
|
@@ -173,7 +166,7 @@ const itemFieldLabel = css({
|
|
|
173
166
|
marginBottom: "layout.controlGap",
|
|
174
167
|
color: "fg.subtle",
|
|
175
168
|
fontWeight: "regular",
|
|
176
|
-
letterSpacing: "normal",
|
|
169
|
+
letterSpacing: "[normal]",
|
|
177
170
|
});
|
|
178
171
|
const itemFooter = css({
|
|
179
172
|
display: "flex",
|
|
@@ -187,7 +180,7 @@ const itemFooter = css({
|
|
|
187
180
|
fontWeight: "medium",
|
|
188
181
|
});
|
|
189
182
|
const itemStatus = css({ display: "inline-flex", alignItems: "center", gap: "layout.tightGap" });
|
|
190
|
-
export function ItemCard({ title, progress, fields, status, footer, selected = false, onSelect, href, render, className, style, ...props }) {
|
|
183
|
+
export function ItemCard({ title, progress, fields, status, footer, selected = false, onSelect, onClick, href, render, className, style, ...props }) {
|
|
191
184
|
const interactive = onSelect !== undefined || href !== undefined || render !== undefined;
|
|
192
185
|
const columns = {
|
|
193
186
|
gridTemplateColumns: fields.map((field) => `minmax(0, ${field.weight ?? 1}fr)`).join(" "),
|
|
@@ -199,7 +192,10 @@ export function ItemCard({ title, progress, fields, status, footer, selected = f
|
|
|
199
192
|
...(href !== undefined ? { href } : interactive ? { type: "button" } : {}),
|
|
200
193
|
...props,
|
|
201
194
|
style,
|
|
202
|
-
onClick:
|
|
195
|
+
onClick: (event) => {
|
|
196
|
+
onClick?.(event);
|
|
197
|
+
onSelect?.();
|
|
198
|
+
},
|
|
203
199
|
className: cx(itemCard, className),
|
|
204
200
|
"data-ciridae-ui": "",
|
|
205
201
|
"data-selected": selected || undefined,
|
|
@@ -208,18 +204,12 @@ export function ItemCard({ title, progress, fields, status, footer, selected = f
|
|
|
208
204
|
},
|
|
209
205
|
});
|
|
210
206
|
}
|
|
211
|
-
/*
|
|
212
|
-
* Part row: one of a record's parts as a table-like row, the kit's Part in its Wide and Compact
|
|
213
|
-
* layouts: name over detail, the mini strip, the stage, a badge for the reader's move, the next
|
|
214
|
-
* step and at most one action. Wide keeps it on one 56px line, wrapping the detail and next step
|
|
215
|
-
* only when the row is narrow; compact stacks the name and strip over the rest. The whole row chooses the part through its name; the action stays its own button.
|
|
216
|
-
*/
|
|
217
207
|
const partRow = css({
|
|
218
208
|
position: "relative",
|
|
219
209
|
display: "flex",
|
|
220
210
|
alignItems: "center",
|
|
221
211
|
gap: "layout.clusterGap",
|
|
222
|
-
minHeight: "calc(token(sizes.control.compact) + token(spacing.panel.default) * 2)",
|
|
212
|
+
minHeight: "[calc(token(sizes.control.compact) + token(spacing.panel.default) * 2)]",
|
|
223
213
|
paddingBlock: "panel.default",
|
|
224
214
|
paddingInline: "panel.comfortable",
|
|
225
215
|
borderBottom: "1px solid token(colors.border.divider)",
|
|
@@ -227,7 +217,7 @@ const partRow = css({
|
|
|
227
217
|
letterSpacing: "compact",
|
|
228
218
|
lineHeight: "tight",
|
|
229
219
|
"&:has([data-part-name]:hover)": { background: "bg.rowHover" },
|
|
230
|
-
"&[data-selected]": { background: "token(gradients.selected)" },
|
|
220
|
+
"&[data-selected]": { background: "[token(gradients.selected)]" },
|
|
231
221
|
// Wide is a grid, so the strips and stages of a list of parts line up. The name and the next
|
|
232
222
|
// step share what the strip, stage and action leave, two parts to three, close to the kit's
|
|
233
223
|
// 240 and 488 in its 1092 row, so a narrow row narrows both rather than starving one.
|
|
@@ -251,7 +241,7 @@ const partLine = css({
|
|
|
251
241
|
const partName = css({
|
|
252
242
|
display: "grid",
|
|
253
243
|
gap: "control.trackInset",
|
|
254
|
-
flex: "1 1 0",
|
|
244
|
+
flex: "[1 1 0]",
|
|
255
245
|
minWidth: "0",
|
|
256
246
|
textAlign: "start",
|
|
257
247
|
"& > *": { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
|
|
@@ -266,8 +256,8 @@ const partNameButton = css({
|
|
|
266
256
|
fontSize: "body",
|
|
267
257
|
textAlign: "start",
|
|
268
258
|
cursor: "pointer",
|
|
269
|
-
_after: { content: '""', position: "absolute", inset: "
|
|
270
|
-
_focusVisible: { outline: "
|
|
259
|
+
_after: { content: '""', position: "absolute", inset: "none" },
|
|
260
|
+
_focusVisible: { outline: "0", _after: { focusRing: "inset" } },
|
|
271
261
|
});
|
|
272
262
|
// A narrow wide row wraps the detail rather than cut off its amount.
|
|
273
263
|
const partDetail = css({
|
|
@@ -289,7 +279,6 @@ const partStatus = css({
|
|
|
289
279
|
flexShrink: "0",
|
|
290
280
|
"[data-layout=wide] > * > &": { display: "contents" },
|
|
291
281
|
});
|
|
292
|
-
// Wide sets the badge after the stage, in the next step's cell; compact leads the status with it.
|
|
293
282
|
const partNextCell = css({
|
|
294
283
|
display: "flex",
|
|
295
284
|
alignItems: "center",
|
|
@@ -302,7 +291,6 @@ const partBadge = css({
|
|
|
302
291
|
flexShrink: "0",
|
|
303
292
|
"[data-layout=compact] &": { order: "-1" },
|
|
304
293
|
});
|
|
305
|
-
// The step the reader acts on wraps in a narrow row, never cut short.
|
|
306
294
|
const partNext = css({
|
|
307
295
|
minWidth: "0",
|
|
308
296
|
color: "fg.secondary",
|
|
@@ -310,7 +298,6 @@ const partNext = css({
|
|
|
310
298
|
lineHeight: "compact",
|
|
311
299
|
"[data-state=yourMove] &": { color: "fg.primary" },
|
|
312
300
|
});
|
|
313
|
-
// The action sits over the stretched name, so it stays its own button.
|
|
314
301
|
const partAction = css({ position: "relative", flexShrink: "0" });
|
|
315
302
|
export function PartRow({ layout = "wide", name, detail, progress, stage, state, badge, next, action, selected = false, onSelect, className, ...props }) {
|
|
316
303
|
return (_jsxs("div", { ...props, className: cx(partRow, className), "data-ciridae-ui": "", "data-layout": layout, "data-state": state, "data-selected": selected || undefined, children: [_jsxs("span", { className: partLine, children: [_jsxs("span", { className: partName, children: [onSelect ? (_jsx("button", { type: "button", className: partNameButton, "data-part-name": "", "aria-pressed": selected, onClick: onSelect, children: name })) : (_jsx("span", { className: css({ fontSize: "body" }), children: name })), layout === "wide" && detail !== undefined && (_jsx("span", { className: partDetail, children: detail }))] }), _jsx(MiniStrip, { progress: progress })] }), _jsxs("span", { className: partLine, children: [layout === "compact" && _jsx("span", { className: cx(partName, partDetail), children: detail }), _jsxs("span", { className: partStatus, children: [_jsx("span", { className: partStage, children: stage }), _jsxs("span", { className: partNextCell, children: [badge !== undefined && _jsx("span", { className: partBadge, children: badge }), _jsx("span", { className: partNext, children: next })] }), action && (_jsx(Button, { variant: "secondary", className: partAction, onClick: action.onClick, children: action.label }))] })] })] }));
|
|
@@ -335,7 +322,7 @@ const relatedRow = css({
|
|
|
335
322
|
display: "flex",
|
|
336
323
|
alignItems: "center",
|
|
337
324
|
gap: "layout.contentGap",
|
|
338
|
-
width: "
|
|
325
|
+
width: "full",
|
|
339
326
|
padding: "panel.default",
|
|
340
327
|
border: "0",
|
|
341
328
|
borderRadius: "action",
|
|
@@ -347,7 +334,7 @@ const relatedRow = css({
|
|
|
347
334
|
// The kit's Linked record hovers to the selected glass in dark and the row wash in light.
|
|
348
335
|
"&:is(button, a)": {
|
|
349
336
|
cursor: "pointer",
|
|
350
|
-
_hover: { background: "token(gradients.selected)", _light: { background: "bg.rowHover" } },
|
|
337
|
+
_hover: { background: "[token(gradients.selected)]", _light: { background: "bg.rowHover" } },
|
|
351
338
|
},
|
|
352
339
|
_focusVisible: { focusRing: "outer" },
|
|
353
340
|
});
|
|
@@ -18,28 +18,28 @@ const viewport = css({
|
|
|
18
18
|
const scrollbar = css({
|
|
19
19
|
zIndex: "scrollbar",
|
|
20
20
|
display: "flex",
|
|
21
|
-
padding: "1px",
|
|
22
|
-
opacity: "0.7",
|
|
23
|
-
transitionProperty: "opacity",
|
|
21
|
+
padding: "[1px]",
|
|
22
|
+
opacity: "[0.7]",
|
|
23
|
+
transitionProperty: "[opacity]",
|
|
24
24
|
transitionDuration: "fast",
|
|
25
25
|
"&[data-orientation=vertical]": {
|
|
26
26
|
width: "scroll.bar",
|
|
27
|
-
marginBlock: "2px",
|
|
28
|
-
marginInlineEnd: "1px",
|
|
27
|
+
marginBlock: "[2px]",
|
|
28
|
+
marginInlineEnd: "[1px]",
|
|
29
29
|
},
|
|
30
30
|
"&[data-orientation=horizontal]": {
|
|
31
31
|
height: "scroll.bar",
|
|
32
|
-
marginInline: "2px",
|
|
33
|
-
marginBottom: "1px",
|
|
32
|
+
marginInline: "[2px]",
|
|
33
|
+
marginBottom: "[1px]",
|
|
34
34
|
},
|
|
35
|
-
"&[data-hovering], &[data-scrolling]": { opacity: "1" },
|
|
35
|
+
"&[data-hovering], &[data-scrolling]": { opacity: "[1]" },
|
|
36
36
|
});
|
|
37
37
|
// Base UI sizes the thumb along its track; it fills the track's other axis.
|
|
38
38
|
const thumb = css({
|
|
39
39
|
borderRadius: "round",
|
|
40
40
|
background: "border.control",
|
|
41
|
-
"&[data-orientation=vertical]": { width: "
|
|
42
|
-
"&[data-orientation=horizontal]": { height: "
|
|
41
|
+
"&[data-orientation=vertical]": { width: "full" },
|
|
42
|
+
"&[data-orientation=horizontal]": { height: "full" },
|
|
43
43
|
});
|
|
44
44
|
/**
|
|
45
45
|
* A region that scrolls inside its own bounds and shows a slim scrollbar while it overflows. Size
|
|
@@ -10,7 +10,7 @@ import { css, cva, cx } from "#primitives/css";
|
|
|
10
10
|
import { useCiridaeLocale } from "./locale.js";
|
|
11
11
|
import { Popover } from "./overlays.js";
|
|
12
12
|
const root = css({ display: "flex", flexDirection: "column", gap: "layout.sectionGap" });
|
|
13
|
-
const bar = css({ display: "flex", gap: "layout.tightGap", height: "8px" });
|
|
13
|
+
const bar = css({ display: "flex", gap: "layout.tightGap", height: "[8px]" });
|
|
14
14
|
// The chart's data marks, so a segment and its swatch match the series in a chart.
|
|
15
15
|
const toneColor = cva({
|
|
16
16
|
variants: {
|
|
@@ -25,15 +25,15 @@ const toneColor = cva({
|
|
|
25
25
|
},
|
|
26
26
|
});
|
|
27
27
|
const segmentButton = css({
|
|
28
|
-
minWidth: "8px",
|
|
29
|
-
height: "
|
|
30
|
-
padding: "
|
|
28
|
+
minWidth: "[8px]",
|
|
29
|
+
height: "full",
|
|
30
|
+
padding: "none",
|
|
31
31
|
border: "0",
|
|
32
32
|
borderRadius: "round",
|
|
33
33
|
cursor: "pointer",
|
|
34
|
-
transitionProperty: "opacity",
|
|
34
|
+
transitionProperty: "[opacity]",
|
|
35
35
|
transitionDuration: "fast",
|
|
36
|
-
"&[data-dimmed]": { opacity: "0.5" },
|
|
36
|
+
"&[data-dimmed]": { opacity: "[0.5]" },
|
|
37
37
|
_focusVisible: { focusRing: "outer" },
|
|
38
38
|
});
|
|
39
39
|
const legendRow = css({
|
|
@@ -60,9 +60,9 @@ const legendKey = css({
|
|
|
60
60
|
color: "fg.secondary",
|
|
61
61
|
fontSize: "code",
|
|
62
62
|
});
|
|
63
|
-
const swatch = css({ width: "6px", height: "12px", borderRadius: "control" });
|
|
63
|
+
const swatch = css({ width: "[6px]", height: "[12px]", borderRadius: "control" });
|
|
64
64
|
export function SegmentedBar({ segments, legend = true, renderDetail, onSegmentSelect, formatValue, className, ...props }) {
|
|
65
|
-
const { formatNumber } = useCiridaeLocale();
|
|
65
|
+
const { formatNumber, labels } = useCiridaeLocale();
|
|
66
66
|
const format = formatValue ?? ((value) => formatNumber(value));
|
|
67
67
|
const [markedId, setMarkedId] = useState(null);
|
|
68
68
|
const mark = (id, marked) => setMarkedId((current) => (marked ? id : current === id ? null : current));
|
|
@@ -74,7 +74,7 @@ export function SegmentedBar({ segments, legend = true, renderDetail, onSegmentS
|
|
|
74
74
|
.filter((segment) => segment.value > 0)
|
|
75
75
|
.map((segment) => {
|
|
76
76
|
const color = colorOf(segment);
|
|
77
|
-
const button = (_jsx("button", { type: "button", className: cx(segmentButton, color.className), style: { ...color.style, flexGrow: segment.value, flexBasis: 0 }, "aria-label":
|
|
77
|
+
const button = (_jsx("button", { type: "button", className: cx(segmentButton, color.className), style: { ...color.style, flexGrow: segment.value, flexBasis: 0 }, "aria-label": labels.common.labelWithValue(segment.label, format(segment.value)), "data-dimmed": markedId !== null && markedId !== segment.id ? "" : undefined, onClick: onSegmentSelect && (() => onSegmentSelect(segment)), onMouseEnter: renderDetail ? undefined : () => mark(segment.id, true), onMouseLeave: renderDetail ? undefined : () => mark(segment.id, false) }));
|
|
78
78
|
if (!renderDetail)
|
|
79
79
|
return _jsx(Fragment, { children: button }, segment.id);
|
|
80
80
|
return (_jsx(Popover, { openOnHover: true, density: "compact", width: "narrow", onOpenChange: (open) => mark(segment.id, open), trigger: button, children: renderDetail(segment) }, segment.id));
|
|
@@ -18,10 +18,7 @@ export type SelectProps = {
|
|
|
18
18
|
label?: string;
|
|
19
19
|
/** `medium` is the Round 2 field height; `small` is the pill beside other filters. */
|
|
20
20
|
size?: ControlSize;
|
|
21
|
-
/**
|
|
22
|
-
* Defaults to the flat `field` at medium and the glass `raised` face when small. `underline` is
|
|
23
|
-
* a 34px row control at the body size, such as a table footer's rows per page, whatever `size`.
|
|
24
|
-
*/
|
|
21
|
+
/** `underline` is a 34px row control at the body size, whatever `size`. */
|
|
25
22
|
variant?: "field" | "raised" | "underline";
|
|
26
23
|
/** Submits the value with an enclosing form under this name. */
|
|
27
24
|
name?: string;
|
|
@@ -37,7 +34,8 @@ export type SlicerProps = Omit<SelectProps, "size" | "variant" | "placeholder">
|
|
|
37
34
|
export declare function Slicer({ options, value, onValueChange, label, name, required, disabled, }: SlicerProps): import("react").JSX.Element;
|
|
38
35
|
export type ComboboxProps<Option extends SelectOption> = {
|
|
39
36
|
options: readonly Option[];
|
|
40
|
-
value
|
|
37
|
+
/** The chosen option's value; `undefined` for none. A combobox is controlled: set it from `onValueChange`. */
|
|
38
|
+
value: string | undefined;
|
|
41
39
|
onValueChange?: (value: string | null) => void;
|
|
42
40
|
/** The locale's "Search…" by default. */
|
|
43
41
|
placeholder?: string;
|
|
@@ -8,18 +8,13 @@ import { useEffect, useRef, useState } from "react";
|
|
|
8
8
|
import { css, cva, cx } from "#primitives/css";
|
|
9
9
|
import { Button } from "./button.js";
|
|
10
10
|
import { useFieldControl, useInField } from "./field-context.js";
|
|
11
|
-
import { glassMenuDivider, glassMenuRow, glassMenuSurface } from "./glass-menu.js";
|
|
11
|
+
import { glassMenuDivider, glassMenuOffsetFromTrigger, glassMenuRow, glassMenuSurface, } from "./glass-menu.js";
|
|
12
12
|
import { faceEdge } from "./gradient-edge.js";
|
|
13
13
|
import { HotkeyLayer } from "./hotkeys.js";
|
|
14
14
|
import { icon, Spinner } from "./icon.js";
|
|
15
15
|
import { useCiridaeLocale } from "./locale.js";
|
|
16
16
|
import { Popover } from "./overlays.js";
|
|
17
|
-
/*
|
|
18
|
-
* Round 2 draws three select triggers. `field` is the input's flat well, for a form. `raised` is
|
|
19
|
-
* the glass face of a toolbar control; at the compact size it is a pill. `underline` has no face,
|
|
20
|
-
* only a bottom hairline, for a control set in a row such as a table footer. Open, every one draws
|
|
21
|
-
* its edge in the text color, and its menu floats just below it.
|
|
22
|
-
*/
|
|
17
|
+
/* Open, every one of the three triggers draws its edge in the text color. */
|
|
23
18
|
const trigger = cva({
|
|
24
19
|
base: {
|
|
25
20
|
display: "inline-flex",
|
|
@@ -35,7 +30,7 @@ const trigger = cva({
|
|
|
35
30
|
letterSpacing: "compact",
|
|
36
31
|
whiteSpace: "nowrap",
|
|
37
32
|
cursor: "pointer",
|
|
38
|
-
transitionProperty: "background, border-color",
|
|
33
|
+
transitionProperty: "[background, border-color]",
|
|
39
34
|
transitionDuration: "fast",
|
|
40
35
|
"&[data-popup-open]": { borderColor: "fg.primary" },
|
|
41
36
|
_focusVisible: { focusRing: "outer" },
|
|
@@ -48,27 +43,23 @@ const trigger = cva({
|
|
|
48
43
|
background: "bg.formField",
|
|
49
44
|
borderColor: "border.control",
|
|
50
45
|
_hover: {
|
|
51
|
-
background: "linear-gradient(token(colors.bg.controlHover), token(colors.bg.controlHover)), token(colors.bg.formField)",
|
|
46
|
+
background: "[linear-gradient(token(colors.bg.controlHover), token(colors.bg.controlHover)), token(colors.bg.formField)]",
|
|
52
47
|
},
|
|
53
48
|
// Open, the well rests under the pointer too; only the edge changes.
|
|
54
49
|
"&[data-popup-open]:hover": { background: "bg.formField" },
|
|
55
50
|
},
|
|
56
|
-
|
|
57
|
-
* The hairline is `toolbarEdge` on the trigger; the border stays clear for it. The face is
|
|
58
|
-
* the selected tint, and hovers to the raised face.
|
|
59
|
-
*/
|
|
51
|
+
// The hairline is `toolbarEdge` on the trigger; the border stays clear for it.
|
|
60
52
|
raised: {
|
|
61
|
-
background: "token(gradients.selected)",
|
|
53
|
+
background: "[token(gradients.selected)]",
|
|
62
54
|
borderColor: "transparent",
|
|
63
|
-
_hover: { background: "token(gradients.raisedHover)" },
|
|
55
|
+
_hover: { background: "[token(gradients.raisedHover)]" },
|
|
64
56
|
// Open, the face rests under the pointer too; only the edge changes.
|
|
65
|
-
"&[data-popup-open]:hover": { background: "token(gradients.selected)" },
|
|
57
|
+
"&[data-popup-open]:hover": { background: "[token(gradients.selected)]" },
|
|
66
58
|
},
|
|
67
|
-
// The caret takes the secondary ink beside the value.
|
|
68
59
|
underline: {
|
|
69
60
|
borderWidth: "0 0 1px",
|
|
70
61
|
borderColor: "border.control",
|
|
71
|
-
borderRadius: "
|
|
62
|
+
borderRadius: "none",
|
|
72
63
|
background: "transparent",
|
|
73
64
|
"& svg": { color: "fg.muted" },
|
|
74
65
|
},
|
|
@@ -86,7 +77,6 @@ const trigger = cva({
|
|
|
86
77
|
compoundVariants: [
|
|
87
78
|
{ variant: "raised", size: "compact", css: { borderRadius: "pill" } },
|
|
88
79
|
{ variant: "raised", size: "regular", css: { gap: "layout.controlGap" } },
|
|
89
|
-
// A row's height at the body size, sized to its value.
|
|
90
80
|
{
|
|
91
81
|
variant: "underline",
|
|
92
82
|
size: "regular",
|
|
@@ -103,8 +93,6 @@ const trigger = cva({
|
|
|
103
93
|
const toolbarEdge = faceEdge("toolbar");
|
|
104
94
|
/** The positioner is the positioned element, so it carries the stacking order. */
|
|
105
95
|
const positioner = css({ zIndex: "popover" });
|
|
106
|
-
/** How far a menu floats from its trigger, in px. */
|
|
107
|
-
const menuGap = 4;
|
|
108
96
|
/* The menu floats on the glass sheet just below its trigger, at least the trigger's width. A
|
|
109
97
|
compact trigger is sized to its value, so its menu may run wider to keep every option whole. A
|
|
110
98
|
long list stops at `overlay.menuList`, or the room left in the viewport, and scrolls inside. */
|
|
@@ -112,9 +100,9 @@ const popupStyle = css.raw(glassMenuSurface, {
|
|
|
112
100
|
display: "flex",
|
|
113
101
|
flexDirection: "column",
|
|
114
102
|
width: "var(--anchor-width)",
|
|
115
|
-
maxHeight: "min(token(sizes.overlay.menuList), var(--available-height))",
|
|
103
|
+
maxHeight: "[min(token(sizes.overlay.menuList), var(--available-height))]",
|
|
116
104
|
});
|
|
117
|
-
const compactPopupStyle = css.raw({ width: "max-content", minWidth: "var(--anchor-width)" });
|
|
105
|
+
const compactPopupStyle = css.raw({ width: "[max-content]", minWidth: "var(--anchor-width)" });
|
|
118
106
|
const popup = {
|
|
119
107
|
regular: css(popupStyle),
|
|
120
108
|
compact: css(popupStyle, compactPopupStyle),
|
|
@@ -125,7 +113,6 @@ const itemStyle = css.raw(glassMenuRow, {
|
|
|
125
113
|
"& > :first-child": { minWidth: "0", overflow: "hidden", textOverflow: "ellipsis" },
|
|
126
114
|
whiteSpace: "nowrap",
|
|
127
115
|
});
|
|
128
|
-
// A compact trigger's menu reads at the trigger's own text size.
|
|
129
116
|
const item = {
|
|
130
117
|
regular: css(itemStyle),
|
|
131
118
|
compact: css(itemStyle, { fontSize: "caption" }),
|
|
@@ -137,7 +124,7 @@ function density(size) {
|
|
|
137
124
|
return size === "small" ? "compact" : "regular";
|
|
138
125
|
}
|
|
139
126
|
function SelectMenu({ options, popupClassName, itemClassName, }) {
|
|
140
|
-
return (_jsx(BaseSelect.Portal, { children: _jsx(HotkeyLayer, { children: _jsx(BaseSelect.Positioner, { className: positioner, sideOffset:
|
|
127
|
+
return (_jsx(BaseSelect.Portal, { children: _jsx(HotkeyLayer, { children: _jsx(BaseSelect.Positioner, { className: positioner, sideOffset: glassMenuOffsetFromTrigger, align: "start", alignItemWithTrigger: false, children: _jsx(BaseSelect.Popup, { className: popupClassName, "data-ciridae-ui": "", children: _jsx(BaseSelect.List, { className: list, children: options.map((option) => (_jsxs(BaseSelect.Item, { className: itemClassName, value: option.value, children: [_jsx(BaseSelect.ItemText, { children: option.label }), _jsx(BaseSelect.ItemIndicator, { className: itemIndicator, children: _jsx(CheckIcon, { className: icon({ size: "small" }) }) })] }, option.value))) }) }) }) }) }));
|
|
141
128
|
}
|
|
142
129
|
export function Select({ options, value, onValueChange, placeholder, label, size: controlSize = "small", variant = controlSize === "small" ? "raised" : "field", name, required, disabled, }) {
|
|
143
130
|
const { labels } = useCiridaeLocale();
|
|
@@ -160,20 +147,17 @@ const slicerTrigger = css({
|
|
|
160
147
|
const slicerLabel = css({ color: "fg.muted", _light: { color: "fg.secondary" } });
|
|
161
148
|
const slicerValue = css({ flex: "1", textAlign: "start" });
|
|
162
149
|
/** A combobox role takes no name from its content, so a slicer names its dimension and value. */
|
|
163
|
-
function slicerName(label,
|
|
164
|
-
const chosen = options.find((option) => option.value === value);
|
|
150
|
+
function slicerName(label, chosen) {
|
|
165
151
|
return chosen ? `${label}: ${chosen.label}` : label;
|
|
166
152
|
}
|
|
167
153
|
export function Slicer({ options, value, onValueChange, label, name, required, disabled, }) {
|
|
168
|
-
return (_jsxs(BaseSelect.Root, { items: options, value: value, onValueChange: onValueChange, name: name, required: required, disabled: disabled, children: [_jsxs(BaseSelect.Trigger, { className: cx(trigger({ variant: "raised", size: "compact" }), slicerTrigger, toolbarEdge.className), "aria-label": slicerName(label, options
|
|
154
|
+
return (_jsxs(BaseSelect.Root, { items: options, value: value, onValueChange: onValueChange, name: name, required: required, disabled: disabled, children: [_jsxs(BaseSelect.Trigger, { className: cx(trigger({ variant: "raised", size: "compact" }), slicerTrigger, toolbarEdge.className), "aria-label": slicerName(label, options.find((option) => option.value === value)), "data-ciridae-ui": "", "data-edge": toolbarEdge["data-edge"], children: [_jsx("span", { className: slicerLabel, "data-slicer-label": "", children: label }), _jsx(BaseSelect.Value, { className: slicerValue }), _jsx(BaseSelect.Icon, { children: _jsx(CaretDownIcon, { className: icon({ size: "small" }) }) })] }), _jsx(SelectMenu, { options: options, popupClassName: popup.compact, itemClassName: item.compact })] }));
|
|
169
155
|
}
|
|
170
|
-
/*
|
|
171
|
-
goes to the text color as a `Select`'s does. The ring shows only while closed, since open the
|
|
172
|
-
menu is the focus. */
|
|
156
|
+
/* The ring shows only while closed, since open the menu is the focus. */
|
|
173
157
|
const comboboxField = css({
|
|
174
158
|
display: "flex",
|
|
175
159
|
alignItems: "center",
|
|
176
|
-
width: "
|
|
160
|
+
width: "full",
|
|
177
161
|
minWidth: "overlay.menu",
|
|
178
162
|
height: "control.default",
|
|
179
163
|
border: "1px solid token(colors.border.control)",
|
|
@@ -186,7 +170,7 @@ const comboboxField = css({
|
|
|
186
170
|
const comboboxInput = css({
|
|
187
171
|
flex: "1",
|
|
188
172
|
minWidth: "0",
|
|
189
|
-
height: "
|
|
173
|
+
height: "full",
|
|
190
174
|
paddingInline: "control.compactInline",
|
|
191
175
|
border: "0",
|
|
192
176
|
background: "transparent",
|
|
@@ -195,7 +179,7 @@ const comboboxInput = css({
|
|
|
195
179
|
fontSize: "body",
|
|
196
180
|
fontWeight: "medium",
|
|
197
181
|
letterSpacing: "compact",
|
|
198
|
-
outline: "
|
|
182
|
+
outline: "0",
|
|
199
183
|
"&::placeholder": { color: "fg.subtle" },
|
|
200
184
|
"&:disabled": { cursor: "not-allowed" },
|
|
201
185
|
});
|
|
@@ -208,20 +192,19 @@ const comboboxCaret = css({
|
|
|
208
192
|
background: "transparent",
|
|
209
193
|
color: "fg.primary",
|
|
210
194
|
cursor: "pointer",
|
|
211
|
-
outline: "
|
|
195
|
+
outline: "0",
|
|
212
196
|
"&:disabled": { cursor: "not-allowed" },
|
|
213
197
|
});
|
|
214
|
-
/*
|
|
215
|
-
the top of its menu over a divider. The menu keeps one width while typing narrows it. */
|
|
198
|
+
/* The menu keeps one width while typing narrows it. */
|
|
216
199
|
const comboboxPopup = {
|
|
217
200
|
regular: popup.regular,
|
|
218
201
|
compact: css(popupStyle, compactPopupStyle, {
|
|
219
|
-
width: "max(var(--anchor-width), token(sizes.overlay.menu))",
|
|
202
|
+
width: "[max(var(--anchor-width), token(sizes.overlay.menu))]",
|
|
220
203
|
}),
|
|
221
204
|
};
|
|
222
205
|
const comboboxSearch = css({
|
|
223
206
|
flexShrink: "0",
|
|
224
|
-
width: "
|
|
207
|
+
width: "full",
|
|
225
208
|
height: "control.compact",
|
|
226
209
|
paddingInline: "search.inline",
|
|
227
210
|
border: "0",
|
|
@@ -231,7 +214,7 @@ const comboboxSearch = css({
|
|
|
231
214
|
fontSize: "caption",
|
|
232
215
|
fontWeight: "medium",
|
|
233
216
|
letterSpacing: "compact",
|
|
234
|
-
outline: "
|
|
217
|
+
outline: "0",
|
|
235
218
|
"&::placeholder": { color: "fg.subtle" },
|
|
236
219
|
});
|
|
237
220
|
const optionContent = css({
|
|
@@ -289,16 +272,15 @@ export function Combobox({ options, value, onValueChange, placeholder: ownPlaceh
|
|
|
289
272
|
if (details.reason === "input-change" || details.reason === "input-clear")
|
|
290
273
|
search(input);
|
|
291
274
|
},
|
|
292
|
-
}), children: [size === "compact" ? (_jsxs(BaseCombobox.Trigger, { className: cx(trigger({ variant: "raised", size: "compact" }), slicerTrigger, toolbarEdge.className), "aria-label": slicerName(label,
|
|
275
|
+
}), children: [size === "compact" ? (_jsxs(BaseCombobox.Trigger, { className: cx(trigger({ variant: "raised", size: "compact" }), slicerTrigger, toolbarEdge.className), "aria-label": slicerName(label, selected), "data-ciridae-ui": "", "data-edge": toolbarEdge["data-edge"], children: [_jsx("span", { className: slicerLabel, "data-slicer-label": "", children: label }), _jsx("span", { className: slicerValue, children: selected?.label }), _jsx(CaretDownIcon, { className: icon({ size: "small" }) })] })) : (_jsxs(BaseCombobox.InputGroup, { className: comboboxField, "data-ciridae-ui": "", children: [_jsx(BaseCombobox.Input, { ...fieldIds, className: comboboxInput, "aria-label": inputLabel, placeholder: placeholder, autoFocus: autoFocus }), _jsx(BaseCombobox.Trigger, { className: comboboxCaret, "aria-label": label, tabIndex: -1, children: _jsx(CaretDownIcon, { className: icon({ size: "small" }) }) })] })), _jsx(BaseCombobox.Portal, { children: _jsx(HotkeyLayer, { children: _jsx(BaseCombobox.Positioner, { className: positioner, sideOffset: glassMenuOffsetFromTrigger, align: "start", children: _jsxs(BaseCombobox.Popup, { className: comboboxPopup[size], "data-ciridae-ui": "", children: [size === "compact" && (_jsxs(_Fragment, { children: [_jsx(BaseCombobox.Input, { className: comboboxSearch, "aria-label": label, placeholder: placeholder }), _jsx("div", { className: searchDivider })] })), loading ? (_jsx("div", { className: emptyMessageStyle, children: _jsx(Spinner, { size: "compact" }) })) : (_jsx(BaseCombobox.Empty, { className: emptyMessageStyle, children: emptyMessage ?? labels.common.noResults })), virtualized ? (_jsx(VirtualOptions, { size: size, renderOption: renderOption, scrollToOption: scrollToOption })) : (_jsx(BaseCombobox.List, { className: list, children: (option) => (_jsxs(BaseCombobox.Item, { className: item[size], value: option, children: [_jsx("span", { className: optionContent, children: renderOption ? renderOption(option) : option.label }), _jsx(BaseCombobox.ItemIndicator, { className: itemIndicator, children: _jsx(CheckIcon, { className: icon({ size: "small" }) }) })] }, option.value)) }))] }) }) }) })] }));
|
|
293
276
|
}
|
|
294
277
|
/** Past this many options a combobox draws only those near the view. */
|
|
295
278
|
const virtualizeOptionsPast = 50;
|
|
296
|
-
/** An option row's height before it is measured, in px. */
|
|
297
279
|
const optionHeight = 32;
|
|
298
280
|
// The options lie over a box as tall as all of them, each moved down to its place.
|
|
299
281
|
const virtualOptions = css({
|
|
300
282
|
position: "relative",
|
|
301
|
-
"& > *": { position: "absolute", top: "
|
|
283
|
+
"& > *": { position: "absolute", top: "none", insetInline: "none" },
|
|
302
284
|
});
|
|
303
285
|
/** The filtered options near the view, inside the combobox's list, which scrolls them. */
|
|
304
286
|
function VirtualOptions({ size, renderOption, scrollToOption, }) {
|
|
@@ -342,7 +324,7 @@ const filterStack = css({
|
|
|
342
324
|
display: "grid",
|
|
343
325
|
gap: "layout.controlGap",
|
|
344
326
|
width: "overlay.tooltip",
|
|
345
|
-
maxWidth: "
|
|
327
|
+
maxWidth: "full",
|
|
346
328
|
});
|
|
347
329
|
export function FilterPopover({ label, count = 0, open, onOpenChange, onClear, children, }) {
|
|
348
330
|
const { labels } = useCiridaeLocale();
|
|
@@ -18,7 +18,7 @@ const layout = css({
|
|
|
18
18
|
gap: "layout.sectionGap",
|
|
19
19
|
_phone: { gridTemplateColumns: "minmax(0, 1fr)", gap: "layout.clusterGap" },
|
|
20
20
|
});
|
|
21
|
-
const sectionColumn = css({ position: "sticky", top: "
|
|
21
|
+
const sectionColumn = css({ position: "sticky", top: "none", _phone: { display: "none" } });
|
|
22
22
|
const sectionTabs = css({ display: "none", minWidth: "0", _phone: { display: "block" } });
|
|
23
23
|
const content = css({ minWidth: "0" });
|
|
24
24
|
const column = css({
|
|
@@ -11,5 +11,5 @@ import { PanelSkeleton, SidebarRowsSkeleton } from "./skeletons.js";
|
|
|
11
11
|
/** Names itself for assistive tech with the locale's "Loading" unless given an `aria-label`. */
|
|
12
12
|
export function ShellSkeleton({ children, ...props }) {
|
|
13
13
|
const { labels } = useCiridaeLocale();
|
|
14
|
-
return (_jsxs(AppShell, { "aria-busy": "true", "aria-label": labels.common.loading, ...props, children: [_jsxs(AppSidebar, { children: [_jsxs(AppSidebarGroup, { children: [_jsx(Skeleton, { height: "control" }), _jsx(Skeleton, { height: "control" })] }), _jsxs(AppSidebarRail, { children: [_jsx(Skeleton, { shape: "circle", style: { width:
|
|
14
|
+
return (_jsxs(AppShell, { "aria-busy": "true", "aria-label": labels.common.loading, ...props, children: [_jsxs(AppSidebar, { children: [_jsxs(AppSidebarGroup, { children: [_jsx(Skeleton, { height: "control" }), _jsx(Skeleton, { height: "control" })] }), _jsxs(AppSidebarRail, { children: [_jsx(Skeleton, { shape: "circle", style: { width: "var(--sizes-control\\.round-rail)" } }), _jsx(Skeleton, { shape: "circle", style: { width: "var(--sizes-control\\.round-rail)" } })] }), _jsx(AppSidebarNav, { children: _jsx(SidebarRowsSkeleton, {}) }), _jsx(AppSidebarFooter, { children: _jsx(Skeleton, { shape: "text", width: "70%" }) })] }), _jsxs(AppMain, { children: [_jsx(AppHeader, { children: _jsx(Skeleton, { shape: "text", width: "medium" }) }), _jsx(AppContent, { children: children ?? _jsx(PanelSkeleton, { rows: 6 }) })] })] }));
|
|
15
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useRender } from "@base-ui/react/use-render";
|
|
2
2
|
import type { ComponentProps, ReactNode } from "react";
|
|
3
3
|
export declare function AppShell({ className, children, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
4
|
-
export declare function AppSidebar({ className, collapsed, onClickCapture, ...props }: ComponentProps<"aside"> & {
|
|
4
|
+
export declare function AppSidebar({ className, collapsed, onClickCapture, onKeyDown, ...props }: Omit<ComponentProps<"aside">, "ref"> & {
|
|
5
5
|
collapsed?: boolean;
|
|
6
6
|
}): import("react").JSX.Element;
|
|
7
7
|
export declare function AppMain({ className, ...props }: ComponentProps<"main">): import("react").JSX.Element;
|