@ciridae/ui 1.2.2 → 1.4.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 (64) hide show
  1. package/README.md +2 -2
  2. package/dist/components/app-frame.js +4 -4
  3. package/dist/components/button.d.ts +0 -11
  4. package/dist/components/button.js +1 -26
  5. package/dist/components/color-theme.d.ts +3 -12
  6. package/dist/components/color-theme.js +2 -29
  7. package/dist/components/dropzone.d.ts +0 -4
  8. package/dist/components/dropzone.js +4 -9
  9. package/dist/components/feedback-sheet.d.ts +1 -16
  10. package/dist/components/feedback-sheet.js +7 -144
  11. package/dist/components/hotkeys.d.ts +1 -11
  12. package/dist/components/hotkeys.js +3 -44
  13. package/dist/components/keyboard-shortcuts.d.ts +0 -2
  14. package/dist/components/keyboard-shortcuts.js +2 -46
  15. package/dist/components/locale.d.ts +11 -42
  16. package/dist/components/locale.js +12 -48
  17. package/dist/components/log-list.d.ts +0 -2
  18. package/dist/components/log-list.js +0 -22
  19. package/dist/components/profile-dialog.d.ts +10 -0
  20. package/dist/components/profile-dialog.js +46 -0
  21. package/dist/components/record.d.ts +0 -23
  22. package/dist/components/record.js +2 -80
  23. package/dist/components/select.d.ts +7 -0
  24. package/dist/components/select.js +21 -2
  25. package/dist/components/sidebar.d.ts +0 -1
  26. package/dist/components/sidebar.js +0 -10
  27. package/dist/components/tabs.d.ts +0 -3
  28. package/dist/components/tabs.js +0 -4
  29. package/dist/feedback/contract.d.ts +1 -25
  30. package/dist/feedback/contract.js +2 -6
  31. package/dist/feedback/operator-controller.d.ts +3 -10
  32. package/dist/feedback/operator-controller.js +1 -28
  33. package/dist/preset.d.ts +0 -6
  34. package/dist/preset.js +0 -5
  35. package/dist/styled-system/styles.css +20 -82
  36. package/dist/theme/options.d.ts +1 -19
  37. package/dist/theme/options.js +0 -1
  38. package/dist/theme/tokens.d.ts +1 -8
  39. package/dist/theme/tokens.js +1 -17
  40. package/package.json +5 -49
  41. package/dist/components/profile-header.d.ts +0 -15
  42. package/dist/components/profile-header.js +0 -40
  43. package/dist/components/recent-items.d.ts +0 -28
  44. package/dist/components/recent-items.js +0 -63
  45. package/dist/components/theme-customizer.d.ts +0 -50
  46. package/dist/components/theme-customizer.js +0 -84
  47. package/dist/components/theme-toggle.d.ts +0 -3
  48. package/dist/components/theme-toggle.js +0 -65
  49. package/dist/feedback/comment-types.d.ts +0 -17
  50. package/dist/feedback/comment-types.js +0 -1
  51. package/dist/feedback/feedback-cache.d.ts +0 -6
  52. package/dist/feedback/feedback-cache.js +0 -58
  53. package/dist/feedback/feedback-center-model.d.ts +0 -8
  54. package/dist/feedback/feedback-center-model.js +0 -37
  55. package/dist/feedback/feedback-composer-types.d.ts +0 -11
  56. package/dist/feedback/feedback-composer-types.js +0 -1
  57. package/dist/feedback/feedback-controller.d.ts +0 -56
  58. package/dist/feedback/feedback-controller.js +0 -181
  59. package/dist/feedback/feedback-tracking-types.d.ts +0 -14
  60. package/dist/feedback/feedback-tracking-types.js +0 -1
  61. package/dist/feedback/submit-feedback-with-attachments.d.ts +0 -10
  62. package/dist/feedback/submit-feedback-with-attachments.js +0 -10
  63. package/dist/theme/index.d.ts +0 -3
  64. package/dist/theme/index.js +0 -7
@@ -3,19 +3,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  * The keyboard cheat sheet: `?` opens a dialog of every hotkey registered with a `meta.name`,
4
4
  * grouped by `meta.group`, read from the hotkeys registry, so it lists what the mounted app and
5
5
  * page bind. A row joins the hotkeys that share a name, such as ← and Page Up for the previous page.
6
- * `KeyboardShortcutSettings` lists the app's rebindable hotkeys (`defineAppHotkeys` on the root
7
- * `HotkeysProvider`) and records a new one for each.
8
6
  */
9
- import { useState } from "react";
10
7
  import { css } from "#primitives/css";
11
- import { Button } from "./button.js";
12
8
  import { useControllableState } from "./controllable-state.js";
13
- import { formatForDisplay, useAppHotkeyList, useCustomHotkeys, useHotkey, useHotkeyRecorder, useHotkeyRegistrations, } from "./hotkeys.js";
9
+ import { formatForDisplay, useHotkey, useHotkeyRegistrations, } from "./hotkeys.js";
14
10
  import { ShortcutHint } from "./keycap.js";
15
- import { Cluster, Eyebrow, MutedText } from "./layout.js";
11
+ import { Eyebrow } from "./layout.js";
16
12
  import { useCiridaeLocale } from "./locale.js";
17
13
  import { Dialog } from "./overlays.js";
18
- import { SettingsPanel, SettingsRow } from "./settings.js";
19
14
  const groupStyle = css({ display: "grid", gap: "layout.controlGap", margin: "none" });
20
15
  const rowStyle = css({
21
16
  display: "flex",
@@ -50,42 +45,3 @@ export function KeyboardShortcuts({ hotkey = "Mod+/", open: ownOpen, onOpenChang
50
45
  const groups = useShortcutGroups(labels.keyboard.general);
51
46
  return (_jsx(Dialog, { open: open, onOpenChange: (next) => setOpen(next), kind: "info", title: labels.keyboard.shortcuts, children: [...groups].map(([group, rows]) => (_jsxs("section", { className: groupStyle, children: [_jsx(Eyebrow, { render: _jsx("h3", {}), children: group }), _jsx("dl", { className: groupStyle, children: [...rows].map(([name, hotkeys]) => (_jsxs("div", { className: rowStyle, children: [_jsx("dt", { children: name }), _jsx("dd", { children: [...hotkeys].map(([key, rowHotkey]) => (_jsx(ShortcutHint, { hotkey: rowHotkey }, key))) })] }, name))) })] }, group))) }));
52
47
  }
53
- /** A row's hotkey, recorded anew on Change: a chord, or two steps such as G then I. */
54
- function ShortcutSettingRow({ appHotkey, isCustom }) {
55
- const { labels } = useCiridaeLocale();
56
- const { findConflicts, setCustomHotkey, resetCustomHotkey } = useCustomHotkeys();
57
- const [problem, setProblem] = useState(null);
58
- const recorder = useHotkeyRecorder({
59
- maxSteps: 2,
60
- // By the key's character, as the defaults are written, so conflicts compare like with like.
61
- recordBy: "key",
62
- validate: (hotkey) => {
63
- const [conflict] = findConflicts(appHotkey.id, hotkey);
64
- return conflict ? labels.keyboard.usedBy(conflict.meta?.name ?? conflict.id) : true;
65
- },
66
- onReject: (rejection) => setProblem(rejection.message),
67
- onRecord: (hotkey) => {
68
- setProblem(null);
69
- setCustomHotkey(appHotkey.id, hotkey);
70
- },
71
- });
72
- return (_jsx(SettingsRow, { label: appHotkey.meta?.name ?? appHotkey.id, children: _jsxs(Cluster, { gap: "8", children: [problem && _jsx(MutedText, { children: problem }), recorder.isRecording ? (_jsx(MutedText, { children: recorder.steps.length > 0
73
- ? formatForDisplay(recorder.steps)
74
- : labels.keyboard.pressKeys })) : appHotkey.hotkey ? (_jsx(ShortcutHint, { hotkey: appHotkey.hotkey })) : (_jsx(MutedText, { children: labels.keyboard.unassigned })), _jsx(Button, { variant: "secondary", onClick: () => {
75
- setProblem(null);
76
- if (recorder.isRecording)
77
- recorder.cancelRecording();
78
- else
79
- recorder.startRecording();
80
- }, children: recorder.isRecording ? labels.common.cancel : labels.keyboard.change }), isCustom && (_jsx(Button, { variant: "ghost", onClick: () => resetCustomHotkey(appHotkey.id), children: labels.keyboard.reset }))] }) }));
81
- }
82
- /** The app's rebindable hotkeys under their groups, each with Change and, once changed, Reset. */
83
- export function KeyboardShortcutSettings() {
84
- const { labels } = useCiridaeLocale();
85
- const groups = new Map();
86
- for (const item of useAppHotkeyList()) {
87
- const group = item.appHotkey.meta?.group ?? labels.keyboard.general;
88
- groups.set(group, [...(groups.get(group) ?? []), item]);
89
- }
90
- return [...groups].map(([group, items]) => (_jsx(SettingsPanel, { title: group, children: items.map((item) => (_jsx(ShortcutSettingRow, { appHotkey: item.appHotkey, isCustom: item.isCustom }, item.appHotkey.id))) }, group)));
91
- }
@@ -101,12 +101,6 @@ export declare const englishLabels: {
101
101
  closePanel: string;
102
102
  record: string;
103
103
  editField: string;
104
- /** `KeyboardShortcutSettings`. */
105
- change: string;
106
- reset: string;
107
- unassigned: string;
108
- pressKeys: string;
109
- usedBy: (name: string) => string;
110
104
  };
111
105
  dates: {
112
106
  today: string;
@@ -151,6 +145,14 @@ export declare const englishLabels: {
151
145
  clearFilters: string;
152
146
  unavailable: string;
153
147
  };
148
+ profileDialog: {
149
+ title: string;
150
+ name: string;
151
+ saveName: string;
152
+ changePicture: string;
153
+ nameFailed: string;
154
+ pictureFailed: string;
155
+ };
154
156
  activity: {
155
157
  show: string;
156
158
  all: string;
@@ -237,18 +239,6 @@ export declare const englishLabels: {
237
239
  pointerNote: (index: number) => string;
238
240
  removePointer: (index: number) => string;
239
241
  };
240
- /** The feedback sheet's Tickets tab, for the people who answer feedback. */
241
- feedbackOperator: {
242
- allTitle: string;
243
- mine: string;
244
- search: string;
245
- status: string;
246
- type: string;
247
- reporter: string;
248
- noneReceived: string;
249
- noMatches: string;
250
- statusFailed: string;
251
- };
252
242
  lightbox: {
253
243
  previous: string;
254
244
  next: string;
@@ -299,13 +289,6 @@ export declare const englishLabels: {
299
289
  reading: string;
300
290
  scrollToLatest: string;
301
291
  };
302
- projectCard: {
303
- default: string;
304
- dedicated: string;
305
- archived: string;
306
- created: (when: ReactNode) => ReactNode;
307
- lastEdited: (when: ReactNode) => ReactNode;
308
- };
309
292
  table: {
310
293
  nothingToShow: string;
311
294
  noResults: string;
@@ -483,17 +466,12 @@ export declare const englishLabels: {
483
466
  menu: string;
484
467
  signOut: string;
485
468
  };
486
- themeCustomizer: {
487
- colorTheme: string;
469
+ /** The account menu's Color theme item and its three choices. */
470
+ colorTheme: {
471
+ title: string;
488
472
  system: string;
489
473
  light: string;
490
474
  dark: string;
491
- displayFont: string;
492
- sansFont: string;
493
- monoFont: string;
494
- };
495
- profileHeader: {
496
- email: string;
497
475
  };
498
476
  editableField: {
499
477
  edit: (label: string) => string;
@@ -513,14 +491,6 @@ export type CiridaeLabelOverrides = {
513
491
  export type DateInput = Date | number | string;
514
492
  /** Epoch milliseconds, a Date, or an ISO string; a string without a zone is UTC. */
515
493
  export declare function toDate(value: DateInput): Date;
516
- export type MoneyFormatOptions = {
517
- /** An ISO 4217 code: "USD", "EUR", "JPY", ... Defaults to USD. */
518
- currency?: string;
519
- /** Abbreviate to K, M and B. */
520
- compact?: boolean;
521
- /** Show minor units; defaults to true unless compact. */
522
- cents?: boolean;
523
- };
524
494
  /** Plural forms keyed by `Intl.PluralRules` category; `#` stands for the formatted count. */
525
495
  export type PluralForms = Partial<Record<Intl.LDMLPluralRule, string>> & {
526
496
  other: string;
@@ -538,7 +508,6 @@ export type CiridaeLocale = {
538
508
  /** "3 hours ago", "in 2 days", "yesterday", against `now`. */
539
509
  formatRelative: (value: DateInput, now?: number) => string;
540
510
  formatNumber: (value: number, options?: Intl.NumberFormatOptions) => string;
541
- formatMoney: (amount: number, options?: MoneyFormatOptions) => string;
542
511
  /** `12 kB`, `1.4 MB`, in units of 1024. */
543
512
  formatFileSize: (bytes: number) => string;
544
513
  /** Items as a list, joined by the `common.listSeparator` label, keeping each item's content. */
@@ -89,12 +89,6 @@ export const englishLabels = {
89
89
  closePanel: "Close panel",
90
90
  record: "Record",
91
91
  editField: "Edit field",
92
- /** `KeyboardShortcutSettings`. */
93
- change: "Change",
94
- reset: "Reset",
95
- unassigned: "Unassigned",
96
- pressKeys: "Press keys…",
97
- usedBy: (name) => `Used by ${name}`,
98
92
  },
99
93
  dates: { today: "Today", yesterday: "Yesterday", earlier: "Earlier" },
100
94
  dropzone: {
@@ -124,6 +118,14 @@ export const englishLabels = {
124
118
  clearFilters: "Clear filters",
125
119
  unavailable: "Could not load members",
126
120
  },
121
+ profileDialog: {
122
+ title: "Profile",
123
+ name: "Name",
124
+ saveName: "Save name",
125
+ changePicture: "Change picture",
126
+ nameFailed: "Name was not saved.",
127
+ pictureFailed: "Picture was not saved.",
128
+ },
127
129
  activity: {
128
130
  show: "Show",
129
131
  all: "All",
@@ -210,18 +212,6 @@ export const englishLabels = {
210
212
  pointerNote: (index) => `Pointer ${index} note`,
211
213
  removePointer: (index) => `Remove pointer ${index}`,
212
214
  },
213
- /** The feedback sheet's Tickets tab, for the people who answer feedback. */
214
- feedbackOperator: {
215
- allTitle: "All feedback",
216
- mine: "Mine",
217
- search: "Search feedback",
218
- status: "Status",
219
- type: "Type",
220
- reporter: "Reporter",
221
- noneReceived: "No feedback yet",
222
- noMatches: "No feedback matches",
223
- statusFailed: "Couldn't change the status",
224
- },
225
215
  lightbox: {
226
216
  previous: "Previous file",
227
217
  next: "Next file",
@@ -268,13 +258,6 @@ export const englishLabels = {
268
258
  reading: "Reading",
269
259
  scrollToLatest: "Scroll to latest",
270
260
  },
271
- projectCard: {
272
- default: "Default",
273
- dedicated: "Dedicated",
274
- archived: "Archived",
275
- created: (when) => _jsxs(_Fragment, { children: ["Created: ", when] }),
276
- lastEdited: (when) => _jsxs(_Fragment, { children: ["Last edited: ", when] }),
277
- },
278
261
  table: {
279
262
  nothingToShow: "Nothing to show.",
280
263
  noResults: "No results",
@@ -428,16 +411,8 @@ export const englishLabels = {
428
411
  /** Read before a `ValueChange`'s old and new values, which a screen reader does not mark as struck. */
429
412
  valueChange: { from: "from", to: "to" },
430
413
  accountMenu: { menu: "Account menu", signOut: "Sign out" },
431
- themeCustomizer: {
432
- colorTheme: "Color theme",
433
- system: "System",
434
- light: "Light",
435
- dark: "Dark",
436
- displayFont: "Display font",
437
- sansFont: "Body font",
438
- monoFont: "Mono font",
439
- },
440
- profileHeader: { email: "email" },
414
+ /** The account menu's Color theme item and its three choices. */
415
+ colorTheme: { title: "Color theme", system: "System", light: "Light", dark: "Dark" },
441
416
  editableField: {
442
417
  edit: (label) => `Change ${label}`,
443
418
  saving: "Saving",
@@ -493,12 +468,12 @@ function mergeLabels(overrides) {
493
468
  dropzone: { ...englishLabels.dropzone, ...overrides.dropzone },
494
469
  userChip: { ...englishLabels.userChip, ...overrides.userChip },
495
470
  memberDirectory: { ...englishLabels.memberDirectory, ...overrides.memberDirectory },
471
+ profileDialog: { ...englishLabels.profileDialog, ...overrides.profileDialog },
496
472
  activity: { ...englishLabels.activity, ...overrides.activity },
497
473
  notifications: { ...englishLabels.notifications, ...overrides.notifications },
498
474
  feedback: { ...englishLabels.feedback, ...overrides.feedback },
499
475
  chat: { ...englishLabels.chat, ...overrides.chat },
500
476
  lightbox: { ...englishLabels.lightbox, ...overrides.lightbox },
501
- projectCard: { ...englishLabels.projectCard, ...overrides.projectCard },
502
477
  table: { ...englishLabels.table, ...overrides.table },
503
478
  sidePanel: { ...englishLabels.sidePanel, ...overrides.sidePanel },
504
479
  checklist: { ...englishLabels.checklist, ...overrides.checklist },
@@ -510,11 +485,9 @@ function mergeLabels(overrides) {
510
485
  settings: { ...englishLabels.settings, ...overrides.settings },
511
486
  navigation: { ...englishLabels.navigation, ...overrides.navigation },
512
487
  documentViewer: { ...englishLabels.documentViewer, ...overrides.documentViewer },
513
- themeCustomizer: { ...englishLabels.themeCustomizer, ...overrides.themeCustomizer },
514
- profileHeader: { ...englishLabels.profileHeader, ...overrides.profileHeader },
515
- feedbackOperator: { ...englishLabels.feedbackOperator, ...overrides.feedbackOperator },
516
488
  clipboard: { ...englishLabels.clipboard, ...overrides.clipboard },
517
489
  accountMenu: { ...englishLabels.accountMenu, ...overrides.accountMenu },
490
+ colorTheme: { ...englishLabels.colorTheme, ...overrides.colorTheme },
518
491
  appFrame: { ...englishLabels.appFrame, ...overrides.appFrame },
519
492
  priority: { ...englishLabels.priority, ...overrides.priority },
520
493
  objectiveHeader: { ...englishLabels.objectiveHeader, ...overrides.objectiveHeader },
@@ -543,15 +516,6 @@ export function createCiridaeLocale(locale, { labels, dir = "ltr" } = {}) {
543
516
  return relativeFormat.format(unit === "second" ? 0 : Math.round(seconds / size), unit);
544
517
  },
545
518
  formatNumber,
546
- formatMoney: (amount, { currency = "USD", compact = false, cents = !compact } = {}) => formatNumber(amount, {
547
- style: "currency",
548
- currency,
549
- ...(compact
550
- ? { notation: "compact", compactDisplay: "short", maximumFractionDigits: 1 }
551
- : cents
552
- ? {}
553
- : { maximumFractionDigits: 0 }),
554
- }),
555
519
  formatFileSize: (bytes) => {
556
520
  if (bytes < 1024)
557
521
  return formatNumber(bytes, { style: "unit", unit: "byte", unitDisplay: "short" });
@@ -16,5 +16,3 @@ export declare function LogOutput({ tone, framed, className, ref, ...props }: Co
16
16
  framed?: boolean;
17
17
  ref?: Ref<HTMLPreElement>;
18
18
  }): import("react").JSX.Element;
19
- /** Placeholder for plain monospace output such as Docker Compose logs. */
20
- export declare function LogOutputSkeleton(): import("react").JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { css, cx } from "#primitives/css";
3
- import { Skeleton } from "./skeleton.js";
4
3
  // The frame below is repeated per composition rather than layered with `cx`, so that each
5
4
  // variant's own `overflow` wins regardless of the order Panda emits its utilities in.
6
5
  const list = css({
@@ -55,21 +54,6 @@ const errorTone = css({
55
54
  borderRadius: "inset",
56
55
  color: "accent.red",
57
56
  });
58
- const skeletonOutput = css({
59
- containerType: "inline-size",
60
- height: "table.scroll",
61
- minHeight: "log.minimum",
62
- margin: "none",
63
- padding: "panel.default",
64
- overflow: "hidden",
65
- whiteSpace: "pre-wrap",
66
- overflowWrap: "anywhere",
67
- border: "1px solid token(colors.border.subtle)",
68
- background: "bg.panel",
69
- fontFamily: "numeric",
70
- fontSize: "log.body",
71
- lineHeight: "body",
72
- });
73
57
  /**
74
58
  * Scroll frame holding a deployment's log rows. `fill` grows it to the rest of a flex column, such
75
59
  * as an overlay, instead of a fixed height.
@@ -84,9 +68,3 @@ export function LogList({ fill = false, className, ref, ...props }) {
84
68
  export function LogOutput({ tone, framed = false, className, ref, ...props }) {
85
69
  return (_jsx("pre", { ...props, ref: ref, className: cx(framed ? framedOutput : output, tone === "error" && errorTone, className) }));
86
70
  }
87
- const rows = Array.from({ length: 40 }, (_, index) => index);
88
- const messageWidths = ["82%", "64%", "91%", "48%", "73%", "57%"];
89
- /** Placeholder for plain monospace output such as Docker Compose logs. */
90
- export function LogOutputSkeleton() {
91
- return (_jsx("div", { className: skeletonOutput, children: rows.map((index) => (_jsx(Skeleton, { shape: "text", style: { width: messageWidths[index % messageWidths.length] } }, index))) }));
92
- }
@@ -0,0 +1,10 @@
1
+ import { type ComponentProps } from "react";
2
+ import { Dialog } from "./overlays.js";
3
+ export type ProfileDialogProps = Pick<ComponentProps<typeof Dialog>, "trigger" | "open" | "onOpenChange"> & {
4
+ name: string | null;
5
+ email: string | null;
6
+ pictureUrl: string | null;
7
+ onSaveName: (name: string) => Promise<unknown>;
8
+ onSavePicture: (picture: File) => Promise<unknown>;
9
+ };
10
+ export declare function ProfileDialog({ name, email, pictureUrl, onSaveName, onSavePicture, onOpenChange, ...dialogProps }: ProfileDialogProps): import("react").JSX.Element;
@@ -0,0 +1,46 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { PlusIcon } from "@phosphor-icons/react";
3
+ import { useMutation } from "@tanstack/react-query";
4
+ import { useRef, useState } from "react";
5
+ import { Button, IconButton } from "./button.js";
6
+ import { Avatar } from "./data-display.js";
7
+ import { Field, FieldError, FieldLabel, Form } from "./form-layout.js";
8
+ import { icon, Spinner } from "./icon.js";
9
+ import { Input } from "./input.js";
10
+ import { Cluster } from "./layout.js";
11
+ import { useCiridaeLocale } from "./locale.js";
12
+ import { Dialog } from "./overlays.js";
13
+ /*
14
+ * Edits the signed-in person's name and picture. The app saves them, so this works with any
15
+ * session; pass `trigger`, or `open` and `onOpenChange`. Each save settles on its own and the
16
+ * dialog stays open, so a new picture shows beside the name still being edited.
17
+ */
18
+ const PICTURE_TYPES = "image/png,image/jpeg,image/webp";
19
+ const MAX_NAME_LENGTH = 256;
20
+ /** The server's reason for a rejected change, or `fallback` when it gave none. */
21
+ function failureMessage(error, fallback) {
22
+ return "detail" in error && typeof error.detail === "string" ? error.detail : fallback;
23
+ }
24
+ export function ProfileDialog({ name, email, pictureUrl, onSaveName, onSavePicture, onOpenChange, ...dialogProps }) {
25
+ const { labels: allLabels } = useCiridaeLocale();
26
+ const labels = allLabels.profileDialog;
27
+ const pictureInput = useRef(null);
28
+ const [draft, setDraft] = useState(name ?? "");
29
+ const trimmedDraft = draft.trim();
30
+ const rename = useMutation({ mutationFn: onSaveName });
31
+ const picture = useMutation({ mutationFn: onSavePicture });
32
+ return (_jsxs(Dialog, { ...dialogProps, kind: "info", onOpenChange: (open, details) => {
33
+ setDraft(name ?? "");
34
+ rename.reset();
35
+ picture.reset();
36
+ onOpenChange?.(open, details);
37
+ }, pending: rename.isPending || picture.isPending, title: labels.title, children: [_jsx(Avatar, { badge: _jsx(IconButton, { "aria-busy": picture.isPending || undefined, "aria-label": labels.changePicture, disabled: picture.isPending, onClick: () => pictureInput.current?.click(), size: "compact", variant: "primary", children: picture.isPending ? (_jsx(Spinner, { "aria-hidden": "true" })) : (_jsx(PlusIcon, { className: icon({ size: "small" }) })) }), color: "blue", label: name ?? email ?? "", size: "large", src: pictureUrl }), _jsx("input", { accept: PICTURE_TYPES, hidden: true, onChange: (event) => {
38
+ const file = event.target.files?.[0];
39
+ event.target.value = "";
40
+ if (file)
41
+ picture.mutate(file);
42
+ }, ref: pictureInput, type: "file" }), picture.error ? (_jsx(FieldError, { children: failureMessage(picture.error, labels.pictureFailed) })) : null, _jsxs(Form, { onSubmit: (event) => {
43
+ event.preventDefault();
44
+ rename.mutate(trimmedDraft);
45
+ }, children: [_jsxs(Field, { children: [_jsx(FieldLabel, { children: labels.name }), _jsx(Input, { autoComplete: "name", maxLength: MAX_NAME_LENGTH, onChange: (event) => setDraft(event.target.value), value: draft })] }), rename.error ? (_jsx(FieldError, { children: failureMessage(rename.error, labels.nameFailed) })) : null, _jsx(Cluster, { children: _jsx(Button, { disabled: !trimmedDraft || trimmedDraft === name, loading: rename.isPending, type: "submit", children: labels.saveName }) })] })] }));
46
+ }
@@ -40,29 +40,6 @@ export type RelatedTabsProps = Omit<ComponentProps<typeof TabsRoot>, "children"
40
40
  onValueChange?: (value: string) => void;
41
41
  };
42
42
  export declare function RelatedTabs({ tabs, value, defaultValue, onValueChange, className, ...props }: RelatedTabsProps): import("react").JSX.Element | null;
43
- export type ItemCardField = {
44
- label: ReactNode;
45
- value: ReactNode;
46
- /** The column's share of the row, as a grid `fr`. Defaults to 1. */
47
- weight?: number;
48
- };
49
- export type ItemCardProps = Omit<useRender.ComponentProps<"button">, "children" | "onSelect"> & {
50
- title: ReactNode;
51
- progress?: readonly StepStatus[];
52
- fields: readonly ItemCardField[];
53
- /** The footer's start: the stage the item is at. */
54
- status: {
55
- label: ReactNode;
56
- status: StepStatus;
57
- };
58
- /** The footer's end, such as what comes next. */
59
- footer?: ReactNode;
60
- selected?: boolean;
61
- /** Makes the card a button; `href` or a router link as `render` makes it a link. */
62
- onSelect?: () => void;
63
- href?: string;
64
- };
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>>;
66
43
  export type PartRowProps = Omit<ComponentProps<"div">, "children" | "onSelect"> & {
67
44
  /** `wide` is one line, as in a table; `compact` stacks for a narrow column. */
68
45
  layout?: "wide" | "compact";
@@ -2,8 +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
- * `PartRow` as a row; `RelatedList` lists the records and documents it points at.
5
+ * record holds; `PartRow` is one of a record's parts, such as a shipment or a draw, as a row;
6
+ * `RelatedList` lists the records and documents it points at.
7
7
  */
8
8
  import { useRender } from "@base-ui/react/use-render";
9
9
  import { CaretRightIcon } from "@phosphor-icons/react";
@@ -14,7 +14,6 @@ import { useControllableState } from "./controllable-state.js";
14
14
  import { directional, icon } from "./icon.js";
15
15
  import { MutedText } from "./layout.js";
16
16
  import { useCiridaeLocale } from "./locale.js";
17
- import { cardSurface } from "./panel.js";
18
17
  import { StepDot } from "./stages.js";
19
18
  import { TabsList, TabsPanel, TabsRoot, TabsTab } from "./tabs.js";
20
19
  /*
@@ -111,33 +110,6 @@ export function RelatedTabs({ tabs, value, defaultValue, onValueChange, classNam
111
110
  return null;
112
111
  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)))] }));
113
112
  }
114
- const itemCard = css(cardSurface, {
115
- display: "grid",
116
- gap: "layout.clusterGap",
117
- padding: "panel.comfortable",
118
- textAlign: "start",
119
- color: "fg.primary",
120
- font: "inherit",
121
- letterSpacing: "compact",
122
- textDecoration: "none",
123
- "&:is(button, a)": { cursor: "pointer", _hover: { borderColor: "border.glass" } },
124
- "&[data-selected]": {
125
- borderColor: "accent.green",
126
- boxShadow: "soft",
127
- _hover: { borderColor: "accent.green" },
128
- },
129
- _focusVisible: { focusRing: "outer" },
130
- });
131
- const itemHeader = css({
132
- display: "flex",
133
- alignItems: "center",
134
- justifyContent: "space-between",
135
- gap: "layout.controlGap",
136
- fontSize: "body",
137
- fontWeight: "medium",
138
- lineHeight: "tight",
139
- whiteSpace: "nowrap",
140
- });
141
113
  const progressStrip = css({
142
114
  display: "inline-flex",
143
115
  flexShrink: "0",
@@ -154,56 +126,6 @@ const progressConnector = css({
154
126
  function MiniStrip({ progress }) {
155
127
  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))) }));
156
128
  }
157
- const itemFields = css({
158
- display: "grid",
159
- gap: "layout.controlGap",
160
- paddingBottom: "panel.default",
161
- fontSize: "code",
162
- fontWeight: "medium",
163
- });
164
- const itemFieldLabel = css({
165
- display: "block",
166
- marginBottom: "layout.controlGap",
167
- color: "fg.subtle",
168
- fontWeight: "regular",
169
- letterSpacing: "[normal]",
170
- });
171
- const itemFooter = css({
172
- display: "flex",
173
- alignItems: "center",
174
- justifyContent: "space-between",
175
- gap: "layout.controlGap",
176
- paddingTop: "panel.default",
177
- borderTop: "1px solid token(colors.border.panel)",
178
- color: "fg.muted",
179
- fontSize: "code",
180
- fontWeight: "medium",
181
- });
182
- const itemStatus = css({ display: "inline-flex", alignItems: "center", gap: "layout.tightGap" });
183
- export function ItemCard({ title, progress, fields, status, footer, selected = false, onSelect, onClick, href, render, className, style, ...props }) {
184
- const interactive = onSelect !== undefined || href !== undefined || render !== undefined;
185
- const columns = {
186
- gridTemplateColumns: fields.map((field) => `minmax(0, ${field.weight ?? 1}fr)`).join(" "),
187
- };
188
- return useRender({
189
- defaultTagName: href !== undefined ? "a" : interactive ? "button" : "div",
190
- render,
191
- props: {
192
- ...(href !== undefined ? { href } : interactive ? { type: "button" } : {}),
193
- ...props,
194
- style,
195
- onClick: (event) => {
196
- onClick?.(event);
197
- onSelect?.();
198
- },
199
- className: cx(itemCard, className),
200
- "data-ciridae-ui": "",
201
- "data-selected": selected || undefined,
202
- "aria-pressed": onSelect !== undefined && href === undefined ? selected : undefined,
203
- children: (_jsxs(_Fragment, { children: [_jsxs("span", { className: itemHeader, children: [title, progress && _jsx(MiniStrip, { progress: progress })] }), _jsxs("span", { className: css({ display: "grid" }), children: [_jsx("span", { className: itemFields, style: columns, children: fields.map((field, index) => (_jsxs("span", { children: [_jsx("span", { className: itemFieldLabel, children: field.label }), field.value] }, index))) }), _jsxs("span", { className: itemFooter, children: [_jsxs("span", { className: itemStatus, children: [_jsx(StepDot, { status: status.status, size: "small" }), status.label] }), footer] })] })] })),
204
- },
205
- });
206
- }
207
129
  const partRow = css({
208
130
  position: "relative",
209
131
  display: "flex",
@@ -27,6 +27,13 @@ export type SelectProps = {
27
27
  disabled?: boolean;
28
28
  };
29
29
  export declare function Select({ options, value, onValueChange, placeholder, label, size: controlSize, variant, name, required, disabled, }: SelectProps): import("react").JSX.Element;
30
+ export type MultiSelectProps = Pick<SelectProps, "options" | "placeholder" | "label" | "size" | "variant" | "disabled"> & {
31
+ value: readonly string[];
32
+ onValueChange: (value: string[]) => void;
33
+ onOpenChange?: (open: boolean) => void;
34
+ };
35
+ /** A `Select` that holds several options; its menu stays open while they are toggled. */
36
+ export declare function MultiSelect({ options, value, onValueChange, onOpenChange, placeholder, label, size: controlSize, variant, disabled, }: MultiSelectProps): import("react").JSX.Element;
30
37
  export type SlicerProps = Omit<SelectProps, "size" | "variant" | "placeholder"> & {
31
38
  /** What the slicer filters by, shown muted before the chosen value. */
32
39
  label: string;
@@ -126,14 +126,33 @@ function density(size) {
126
126
  function SelectMenu({ options, popupClassName, itemClassName, }) {
127
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))) }) }) }) }) }));
128
128
  }
129
- export function Select({ options, value, onValueChange, placeholder, label, size: controlSize = "small", variant = controlSize === "small" ? "raised" : "field", name, required, disabled, }) {
129
+ function SelectTrigger({ variant, size, label, children, }) {
130
130
  const { labels } = useCiridaeLocale();
131
131
  const fieldIds = useFieldControl({});
132
132
  const inField = useInField();
133
+ return (_jsxs(BaseSelect.Trigger, { ...fieldIds, className: cx(trigger({ variant, size }), variant === "raised" && toolbarEdge.className), "aria-label": label ?? (inField ? undefined : labels.select.label), "data-ciridae-ui": "", "data-edge": variant === "raised" ? toolbarEdge["data-edge"] : undefined, children: [children, _jsx(BaseSelect.Icon, { children: _jsx(CaretDownIcon, { className: icon({ size: "small" }) }) })] }));
134
+ }
135
+ export function Select({ options, value, onValueChange, placeholder, label, size: controlSize = "small", variant = controlSize === "small" ? "raised" : "field", name, required, disabled, }) {
136
+ const { labels } = useCiridaeLocale();
133
137
  const underline = variant === "underline";
134
138
  // An underline trigger is sized to its value, so its menu may run wider, at its body text.
135
139
  const size = underline ? "regular" : density(controlSize);
136
- return (_jsxs(BaseSelect.Root, { items: options, value: value, onValueChange: onValueChange, name: name, required: required, disabled: disabled, children: [_jsxs(BaseSelect.Trigger, { ...fieldIds, className: cx(trigger({ variant, size }), variant === "raised" && toolbarEdge.className), "aria-label": label ?? (inField ? undefined : labels.select.label), "data-ciridae-ui": "", "data-edge": variant === "raised" ? toolbarEdge["data-edge"] : undefined, children: [_jsx(BaseSelect.Value, { placeholder: placeholder ?? labels.select.placeholder }), _jsx(BaseSelect.Icon, { children: _jsx(CaretDownIcon, { className: icon({ size: "small" }) }) })] }), _jsx(SelectMenu, { options: options, popupClassName: underline ? popup.compact : popup[size], itemClassName: item[size] })] }));
140
+ return (_jsxs(BaseSelect.Root, { items: options, value: value, onValueChange: onValueChange, name: name, required: required, disabled: disabled, children: [_jsx(SelectTrigger, { variant: variant, size: size, label: label, children: _jsx(BaseSelect.Value, { placeholder: placeholder ?? labels.select.placeholder }) }), _jsx(SelectMenu, { options: options, popupClassName: underline ? popup.compact : popup[size], itemClassName: item[size] })] }));
141
+ }
142
+ /** A `Select` that holds several options; its menu stays open while they are toggled. */
143
+ export function MultiSelect({ options, value, onValueChange, onOpenChange, placeholder, label, size: controlSize = "small", variant = controlSize === "small" ? "raised" : "field", disabled, }) {
144
+ const { labels } = useCiridaeLocale();
145
+ // The trigger keeps its label while open, so toggling never resizes it and moves the menu.
146
+ const [valueWhenOpened, setValueWhenOpened] = useState(null);
147
+ const underline = variant === "underline";
148
+ const size = underline ? "regular" : density(controlSize);
149
+ return (_jsxs(BaseSelect.Root, { multiple: true, items: options, value: [...value], onValueChange: onValueChange, onOpenChange: (open) => {
150
+ setValueWhenOpened(open ? value : null);
151
+ onOpenChange?.(open);
152
+ }, disabled: disabled, children: [_jsx(SelectTrigger, { variant: variant, size: size, label: label, children: _jsx(BaseSelect.Value, { placeholder: placeholder ?? labels.select.placeholder, children: (selected) => options
153
+ .filter((option) => (valueWhenOpened ?? selected).includes(option.value))
154
+ .map((option) => option.label)
155
+ .join(", ") }) }), _jsx(SelectMenu, { options: options, popupClassName: underline ? popup.compact : popup[size], itemClassName: item[size] })] }));
137
156
  }
138
157
  /*
139
158
  * A slicer is a filter's pill: the dimension it cuts by, then the value chosen, then the caret.
@@ -1,7 +1,6 @@
1
1
  import { useRender } from "@base-ui/react/use-render";
2
2
  import type { ComponentProps, ReactNode } from "react";
3
3
  export declare function SidebarNavigation({ className, ...props }: ComponentProps<"nav">): import("react").JSX.Element;
4
- export declare function SidebarDivider({ className, ...props }: ComponentProps<"hr">): import("react").JSX.Element;
5
4
  export declare function SidebarRailRule({ className, ...props }: ComponentProps<"hr">): import("react").JSX.Element;
6
5
  export declare function SidebarPanel({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
7
6
  export declare function SidebarSection({ label, action, iconTone, className, children, ...props }: ComponentProps<"div"> & {
@@ -44,13 +44,6 @@ const railRule = css({
44
44
  border: "0",
45
45
  background: "border.divider",
46
46
  });
47
- const divider = css({
48
- width: "full",
49
- height: "border.hairline",
50
- margin: "none",
51
- border: "0",
52
- background: "border.hairline",
53
- });
54
47
  // A hover is a faint wash in light and the selected glass in dark.
55
48
  const item = css({
56
49
  display: "flex",
@@ -182,9 +175,6 @@ const headingName = css({
182
175
  export function SidebarNavigation({ className, ...props }) {
183
176
  return _jsx("nav", { ...props, className: cx(navigation, className), "data-ciridae-ui": "" });
184
177
  }
185
- export function SidebarDivider({ className, ...props }) {
186
- return _jsx("hr", { ...props, className: cx(divider, className), "data-ciridae-ui": "" });
187
- }
188
178
  export function SidebarRailRule({ className, ...props }) {
189
179
  return _jsx("hr", { ...props, className: cx(railRule, className), "data-ciridae-ui": "" });
190
180
  }
@@ -4,9 +4,6 @@ export declare function TabsRoot({ className, ...props }: Omit<ComponentProps<ty
4
4
  className?: string;
5
5
  }): import("react").JSX.Element;
6
6
  export declare const TabsPanel: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").TabsPanelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
7
- export declare function TabsGroup({ border, className, ...props }: ComponentProps<"span"> & {
8
- border?: "control" | "glass";
9
- }): import("react").JSX.Element;
10
7
  export declare function TabsList({ className, variant, overflow: ownOverflow, children, ...props }: Omit<ComponentProps<typeof BaseTabs.List>, "className"> & {
11
8
  className?: string;
12
9
  /**
@@ -134,10 +134,6 @@ const tab = css({
134
134
  fontSize: "caption",
135
135
  },
136
136
  });
137
- const group = css({ display: "flex", flexShrink: "0", borderRadius: "pill" });
138
- export function TabsGroup({ border = "control", className, ...props }) {
139
- return _jsx("span", { ...props, className: cx(group, className), "data-ciridae-ui": "", "data-edge": border });
140
- }
141
137
  const InTabsBarContext = createContext(false);
142
138
  /*
143
139
  * Moves the tabs that do not fit the row's width into a trailing "more" menu, measuring every tab