@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
package/dist/components/toast.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* button. Mount
|
|
6
|
-
* one `Toaster` at the app's root; raise toasts with `toast` from anywhere, or `useToast().add`
|
|
7
|
-
* with the kit's options.
|
|
3
|
+
* Mount one `Toaster` at the app's root; raise toasts with `toast` from anywhere, or
|
|
4
|
+
* `useToast().add` with the kit's options.
|
|
8
5
|
*/
|
|
9
6
|
import { CheckCircleIcon, InfoIcon, SpinnerGapIcon, WarningCircleIcon, WarningIcon, XIcon, } from "@phosphor-icons/react";
|
|
10
7
|
import { Toaster as SonnerToaster, toast } from "sonner";
|
|
@@ -17,15 +14,15 @@ const card = css({
|
|
|
17
14
|
display: "flex",
|
|
18
15
|
alignItems: "center",
|
|
19
16
|
gap: "layout.contentGap",
|
|
20
|
-
width: "
|
|
21
|
-
maxWidth: "calc(100vw - token(spacing.layout.pageGap) * 2)",
|
|
17
|
+
width: "full",
|
|
18
|
+
maxWidth: "[calc(100vw - token(spacing.layout.pageGap) * 2)]",
|
|
22
19
|
paddingBlock: "control.block",
|
|
23
20
|
paddingInlineStart: "control.inline",
|
|
24
21
|
paddingInlineEnd: "control.block",
|
|
25
22
|
border: "1px solid token(colors.border.divider)",
|
|
26
23
|
borderRadius: "card",
|
|
27
24
|
// Solid in both themes: the panel's glass laid on the canvas in dark.
|
|
28
|
-
background: "linear-gradient(token(colors.bg.panel), token(colors.bg.panel)), token(colors.bg.canvas)",
|
|
25
|
+
background: "[linear-gradient(token(colors.bg.panel), token(colors.bg.panel)), token(colors.bg.canvas)]",
|
|
29
26
|
_light: { background: "bg.surface" },
|
|
30
27
|
color: "fg.primary",
|
|
31
28
|
boxShadow: "soft",
|
|
@@ -35,7 +32,7 @@ const card = css({
|
|
|
35
32
|
lineHeight: "compact",
|
|
36
33
|
pointerEvents: "auto",
|
|
37
34
|
});
|
|
38
|
-
const content = css({ display: "grid", gap: "2px", flex: "1", minWidth: "0" });
|
|
35
|
+
const content = css({ display: "grid", gap: "[2px]", flex: "1", minWidth: "0" });
|
|
39
36
|
// Capped so a long message, such as a raw server error, can't grow the toast down the screen.
|
|
40
37
|
const title = css({ fontWeight: "medium", lineClamp: "3", overflowWrap: "anywhere" });
|
|
41
38
|
const description = css({
|
|
@@ -46,24 +43,20 @@ const description = css({
|
|
|
46
43
|
});
|
|
47
44
|
const iconSlot = css({
|
|
48
45
|
display: "inline-flex",
|
|
49
|
-
height: "1lh",
|
|
46
|
+
height: "[1lh]",
|
|
50
47
|
alignItems: "center",
|
|
51
48
|
flexShrink: "0",
|
|
52
49
|
});
|
|
53
|
-
|
|
54
|
-
* An action raised through sonner's own `toast` with `{ label, onClick }`: the small secondary
|
|
55
|
-
* button's shape and face, with a flat hairline, since sonner draws the button. `useToast` draws a
|
|
56
|
-
* kit `Button` instead.
|
|
57
|
-
*/
|
|
50
|
+
// `useToast` draws a kit `Button` for an action; sonner's own `toast` draws the button, so this styles it.
|
|
58
51
|
const actionButton = css({
|
|
59
52
|
flexShrink: "0",
|
|
60
53
|
height: "control.small",
|
|
61
54
|
paddingInline: "control.compactInline",
|
|
62
55
|
border: "1px solid token(colors.border.glass)",
|
|
63
56
|
borderRadius: "pill",
|
|
64
|
-
background: "token(gradients.raised)",
|
|
57
|
+
background: "[token(gradients.raised)]",
|
|
65
58
|
color: "fg.primary",
|
|
66
|
-
fontFamily: "inherit",
|
|
59
|
+
fontFamily: "[inherit]",
|
|
67
60
|
fontSize: "caption",
|
|
68
61
|
fontWeight: "medium",
|
|
69
62
|
letterSpacing: "compact",
|
|
@@ -91,7 +84,6 @@ const closeButton = css({
|
|
|
91
84
|
_hover: { color: "fg.primary", background: "bg.hover" },
|
|
92
85
|
_focusVisible: { focusRing: "outer" },
|
|
93
86
|
});
|
|
94
|
-
/* A progress toast's track and how far along it is, after its message. */
|
|
95
87
|
const progressMessage = css({ display: "flex", alignItems: "center", gap: "layout.contentGap" });
|
|
96
88
|
const progressMessageText = css({ flex: "1", minWidth: "0" });
|
|
97
89
|
const progress = css({
|
|
@@ -106,9 +98,9 @@ const progressTrack = css({
|
|
|
106
98
|
overflow: "hidden",
|
|
107
99
|
borderRadius: "round",
|
|
108
100
|
background: "border.control",
|
|
109
|
-
_light: { background: "token(gradients.canvas)" },
|
|
101
|
+
_light: { background: "[token(gradients.canvas)]" },
|
|
110
102
|
});
|
|
111
|
-
const progressFill = css({ height: "
|
|
103
|
+
const progressFill = css({ height: "full", borderRadius: "round", background: "fg.primary" });
|
|
112
104
|
const progressPercent = css({
|
|
113
105
|
color: "fg.muted",
|
|
114
106
|
_light: { color: "fg.secondary" },
|
|
@@ -129,7 +121,11 @@ const toasterStyle = {
|
|
|
129
121
|
export function Toaster(props) {
|
|
130
122
|
const { labels, dir } = useCiridaeLocale();
|
|
131
123
|
const small = icon({ size: "small" });
|
|
132
|
-
return (_jsx(SonnerToaster
|
|
124
|
+
return (_jsx(SonnerToaster
|
|
125
|
+
// Sonner places by physical corner: the end corner of the line is the left one in RTL.
|
|
126
|
+
, {
|
|
127
|
+
// Sonner places by physical corner: the end corner of the line is the left one in RTL.
|
|
128
|
+
position: dir === "rtl" ? "bottom-left" : "bottom-right", gap: 6,
|
|
133
129
|
// Listed apart rather than stacked under each other, so every message reads at once.
|
|
134
130
|
expand: true, closeButton: true, dir: dir, icons: {
|
|
135
131
|
success: _jsx(CheckCircleIcon, { className: cx(small, toneIcon.success), weight: "fill" }),
|
|
@@ -184,6 +180,7 @@ function addToast({ title: ownMessage, description: detail, variant, timeout, ac
|
|
|
184
180
|
}
|
|
185
181
|
}
|
|
186
182
|
/** The kit's toast calls: `add` raises one and returns its id, `close` dismisses it. */
|
|
183
|
+
const toastCalls = { add: addToast, close: (id) => toast.dismiss(id) };
|
|
187
184
|
export function useToast() {
|
|
188
|
-
return
|
|
185
|
+
return toastCalls;
|
|
189
186
|
}
|
|
@@ -18,7 +18,7 @@ const chip = css({
|
|
|
18
18
|
display: "inline-flex",
|
|
19
19
|
alignItems: "center",
|
|
20
20
|
gap: "layout.controlGap",
|
|
21
|
-
maxWidth: "
|
|
21
|
+
maxWidth: "full",
|
|
22
22
|
minWidth: "0",
|
|
23
23
|
height: "workspace.avatar",
|
|
24
24
|
color: "fg.primary",
|
|
@@ -37,15 +37,15 @@ const chip = css({
|
|
|
37
37
|
const person = css({
|
|
38
38
|
display: "inline-flex",
|
|
39
39
|
alignItems: "center",
|
|
40
|
-
gap: "inherit",
|
|
40
|
+
gap: "[inherit]",
|
|
41
41
|
minWidth: "0",
|
|
42
|
-
maxWidth: "
|
|
42
|
+
maxWidth: "full",
|
|
43
43
|
padding: "none",
|
|
44
44
|
border: "0",
|
|
45
45
|
background: "transparent",
|
|
46
|
-
color: "inherit",
|
|
46
|
+
color: "[inherit]",
|
|
47
47
|
font: "inherit",
|
|
48
|
-
letterSpacing: "inherit",
|
|
48
|
+
letterSpacing: "[inherit]",
|
|
49
49
|
textDecoration: "none",
|
|
50
50
|
"&:is(button, a)": {
|
|
51
51
|
cursor: "pointer",
|
|
@@ -79,7 +79,7 @@ const actionButton = css({
|
|
|
79
79
|
const card = css({
|
|
80
80
|
display: "grid",
|
|
81
81
|
minWidth: "overlay.menu",
|
|
82
|
-
maxWidth: "min(token(sizes.overlay.tooltip), calc(100vw - token(spacing.layout.pageGap) * 2))",
|
|
82
|
+
maxWidth: "[min(token(sizes.overlay.tooltip), calc(100vw - token(spacing.layout.pageGap) * 2))]",
|
|
83
83
|
color: "fg.primary",
|
|
84
84
|
fontSize: "caption",
|
|
85
85
|
fontWeight: "regular",
|
|
@@ -110,7 +110,7 @@ const emailRow = css({
|
|
|
110
110
|
display: "flex",
|
|
111
111
|
alignItems: "center",
|
|
112
112
|
gap: "control.iconGap",
|
|
113
|
-
marginBlock: "calc(token(spacing.layout.tightGap) * -1)",
|
|
113
|
+
marginBlock: "[calc(token(spacing.layout.tightGap) * -1)]",
|
|
114
114
|
color: "fg.secondary",
|
|
115
115
|
"& > span": { flex: "1", minWidth: "0", overflow: "hidden", textOverflow: "ellipsis" },
|
|
116
116
|
});
|
|
@@ -131,7 +131,7 @@ const cardAction = css({
|
|
|
131
131
|
font: "inherit",
|
|
132
132
|
textAlign: "start",
|
|
133
133
|
cursor: "pointer",
|
|
134
|
-
outline: "
|
|
134
|
+
outline: "0",
|
|
135
135
|
"& > svg": { color: "fg.muted" },
|
|
136
136
|
"&:hover, &:focus-visible": { background: "bg.rowHover" },
|
|
137
137
|
_disabled: { opacity: "disabled", cursor: "not-allowed" },
|
|
@@ -5,6 +5,7 @@ import { css, cx } from "#primitives/css";
|
|
|
5
5
|
import { DialogHeightResetContext } from "./dialog-height-context.js";
|
|
6
6
|
import { icon, spinning } from "./icon.js";
|
|
7
7
|
import { Heading } from "./layout.js";
|
|
8
|
+
import { useCiridaeLocale } from "./locale.js";
|
|
8
9
|
const wizard = css({ display: "grid", gap: "layout.contentGap", minWidth: "0" });
|
|
9
10
|
const progressBar = css({ display: "flex", gap: "layout.tightGap" });
|
|
10
11
|
const segment = css({
|
|
@@ -27,7 +28,7 @@ const panel = css({
|
|
|
27
28
|
animationFillMode: "both",
|
|
28
29
|
"&[data-direction=forward]": { animationName: "wizardEnterForward" },
|
|
29
30
|
"&[data-direction=back]": { animationName: "wizardEnterBack" },
|
|
30
|
-
_motionReduce: { animationName: "none!" },
|
|
31
|
+
_motionReduce: { animationName: "[none!]" },
|
|
31
32
|
});
|
|
32
33
|
const result = css({
|
|
33
34
|
display: "grid",
|
|
@@ -49,8 +50,8 @@ const resultIcon = css({
|
|
|
49
50
|
const resultMark = css({ display: "inline-flex", position: "relative" });
|
|
50
51
|
const resultBadge = css({
|
|
51
52
|
position: "absolute",
|
|
52
|
-
insetInlineEnd: "calc(token(spacing.layout.tightGap) * -1)",
|
|
53
|
-
bottom: "calc(token(spacing.layout.tightGap) * -1)",
|
|
53
|
+
insetInlineEnd: "[calc(token(spacing.layout.tightGap) * -1)]",
|
|
54
|
+
bottom: "[calc(token(spacing.layout.tightGap) * -1)]",
|
|
54
55
|
background: "bg.card",
|
|
55
56
|
borderRadius: "round",
|
|
56
57
|
});
|
|
@@ -66,6 +67,7 @@ const resultActions = css({
|
|
|
66
67
|
* step shown before it. `steps` labels each step for the progress bar and assistive technology.
|
|
67
68
|
*/
|
|
68
69
|
export function Wizard({ step, steps, progress = step, showProgress = true, state = "step", children, className, ...props }) {
|
|
70
|
+
const { labels } = useCiridaeLocale();
|
|
69
71
|
const resetDialogHeight = useContext(DialogHeightResetContext);
|
|
70
72
|
useLayoutEffect(() => {
|
|
71
73
|
resetDialogHeight?.();
|
|
@@ -77,7 +79,7 @@ export function Wizard({ step, steps, progress = step, showProgress = true, stat
|
|
|
77
79
|
setPreviousStep(step);
|
|
78
80
|
setDirection(step > previousStep ? "forward" : "back");
|
|
79
81
|
}
|
|
80
|
-
return (_jsxs("div", { ...props, className: cx(wizard, className), "data-ciridae-ui": "", "data-wizard-state": state, children: [showProgress && state !== "result" && steps.length > 1 && (_jsx("div", { className: progressBar, role: "progressbar", "aria-valuemin": 1, "aria-valuemax": steps.length, "aria-valuenow": Math.min(progress + 1, steps.length), "aria-valuetext": steps[progress], children: steps.map((_label, index) => (_jsx("span", { className: segment, "data-reached": index <= progress ? "" : undefined }, index))) })), _jsx("div", { className: viewport, children: _jsx("div", { className: panel, "data-direction": state === "result" ? undefined : direction, children: children }, step) })] }));
|
|
82
|
+
return (_jsxs("div", { ...props, className: cx(wizard, className), "data-ciridae-ui": "", "data-wizard-state": state, children: [showProgress && state !== "result" && steps.length > 1 && (_jsx("div", { className: progressBar, role: "progressbar", "aria-label": labels.common.progress, "aria-valuemin": 1, "aria-valuemax": steps.length, "aria-valuenow": Math.min(progress + 1, steps.length), "aria-valuetext": steps[progress], children: steps.map((_label, index) => (_jsx("span", { className: segment, "data-reached": index <= progress ? "" : undefined }, index))) })), _jsx("div", { className: viewport, children: _jsx("div", { className: panel, "data-direction": state === "result" ? undefined : direction, children: children }, step) })] }));
|
|
81
83
|
}
|
|
82
84
|
/** The end of a wizard: what happened, and what the reader can do next. */
|
|
83
85
|
export function WizardResult({ variant, icon: mark, title, description, children, }) {
|
package/dist/preset.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { CiridaeTheme } from "./theme/options.js";
|
|
2
2
|
export type { Brand, CiridaeTheme, ColorTheme } from "./theme/options.js";
|
|
3
3
|
export { breakpointQuery, breakpoints, type Breakpoint } from "./theme/breakpoints.js";
|
|
4
|
-
export {
|
|
5
|
-
export { deriveThemeTokens, themeVariables, type ThemeTokens } from "./theme/tokens.js";
|
|
4
|
+
export { deriveThemeTokens, type ThemeTokens } from "./theme/tokens.js";
|
|
6
5
|
export type CiridaePresetOptions = Partial<CiridaeTheme> & {
|
|
7
6
|
/**
|
|
8
7
|
* Element defaults for an app that owns the whole page: `html`, `body` and `#root` fill the
|