@ciridae/ui 1.0.14 → 1.1.1
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/dist/ciridae.css +5 -0
- package/dist/components/app-frame.d.ts +29 -4
- package/dist/components/app-frame.js +16 -5
- package/dist/components/app-navigation.d.ts +16 -1
- package/dist/components/app-navigation.js +18 -7
- package/dist/components/badge.d.ts +14 -0
- package/dist/components/badge.js +38 -1
- package/dist/components/copyable-id.d.ts +10 -3
- package/dist/components/copyable-id.js +5 -2
- package/dist/components/data-display.js +14 -4
- package/dist/components/data-grid.js +5 -1
- package/dist/components/drawer.js +9 -1
- package/dist/components/filter-bar.d.ts +17 -8
- package/dist/components/filter-bar.js +38 -32
- package/dist/components/input.d.ts +6 -1
- package/dist/components/input.js +9 -3
- package/dist/components/layout.d.ts +7 -2
- package/dist/components/layout.js +34 -7
- package/dist/components/locale.d.ts +20 -0
- package/dist/components/locale.js +19 -1
- package/dist/components/objective-header.d.ts +25 -0
- package/dist/components/objective-header.js +70 -0
- package/dist/components/panel.d.ts +4 -2
- package/dist/components/panel.js +26 -3
- package/dist/components/settings.d.ts +7 -2
- package/dist/components/settings.js +11 -3
- package/dist/components/shell.js +7 -1
- package/dist/components/side-panel.d.ts +13 -3
- package/dist/components/side-panel.js +28 -7
- package/dist/components/sidebar.js +7 -10
- package/dist/components/switch.d.ts +7 -3
- package/dist/components/switch.js +17 -3
- package/dist/components/tabs.js +4 -1
- package/dist/components/value-change.d.ts +13 -0
- package/dist/components/value-change.js +59 -0
- package/dist/preset.js +14 -1
- package/dist/styled-system/styles.css +168 -80
- package/dist/styled-system/tokens/index.mjs +33 -1
- package/dist/styled-system/tokens/tokens.d.ts +3 -3
- package/dist/styles.css +5 -0
- package/package.json +9 -1
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Switch as BaseSwitch } from "@base-ui/react/switch";
|
|
2
|
-
import type { ComponentProps } from "react";
|
|
3
|
-
export type SwitchProps = Omit<ComponentProps<typeof BaseSwitch.Root>, "className"> & {
|
|
2
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
3
|
+
export type SwitchProps = Omit<ComponentProps<typeof BaseSwitch.Root>, "className" | "children"> & {
|
|
4
|
+
/** The visible label after the track, which names the switch and toggles it when pressed. */
|
|
5
|
+
children?: ReactNode;
|
|
4
6
|
className?: string;
|
|
7
|
+
/** The label's class, with `children`. */
|
|
8
|
+
wrapperClassName?: string;
|
|
5
9
|
};
|
|
6
|
-
export declare function Switch({ className, ...props }: SwitchProps): import("react").JSX.Element;
|
|
10
|
+
export declare function Switch({ children, className, wrapperClassName, ...props }: SwitchProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Switch as BaseSwitch } from "@base-ui/react/switch";
|
|
3
3
|
import { css, cx } from "#primitives/css";
|
|
4
4
|
// The Round 2 toggle: a short track two insets wider than its knob, grey off and green on.
|
|
@@ -34,6 +34,20 @@ const thumb = css({
|
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
});
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
// A switch's visible label after its track, as a checkbox's sits after its box.
|
|
38
|
+
const label = css({
|
|
39
|
+
display: "inline-flex",
|
|
40
|
+
alignItems: "center",
|
|
41
|
+
gap: "layout.controlGap",
|
|
42
|
+
color: "fg.primary",
|
|
43
|
+
fontSize: "caption",
|
|
44
|
+
fontWeight: "[normal]",
|
|
45
|
+
cursor: "pointer",
|
|
46
|
+
"&:has([data-disabled])": { cursor: "not-allowed" },
|
|
47
|
+
});
|
|
48
|
+
export function Switch({ children, className, wrapperClassName, ...props }) {
|
|
49
|
+
const control = (_jsx(BaseSwitch.Root, { ...props, className: cx(track, className), "data-ciridae-ui": "", children: _jsx(BaseSwitch.Thumb, { className: thumb }) }));
|
|
50
|
+
if (children === undefined || children === null || children === false)
|
|
51
|
+
return control;
|
|
52
|
+
return (_jsxs("label", { className: cx(label, wrapperClassName), "data-ciridae-ui": "", children: [control, children] }));
|
|
39
53
|
}
|
package/dist/components/tabs.js
CHANGED
|
@@ -228,6 +228,8 @@ const bar = css({
|
|
|
228
228
|
flexWrap: "nowrap",
|
|
229
229
|
gap: "layout.contentGap",
|
|
230
230
|
minWidth: "0",
|
|
231
|
+
// The row keeps the 38 of the controls the open section puts on it, with or without them.
|
|
232
|
+
minHeight: "control.default",
|
|
231
233
|
"& > :first-child": { flex: "[1 1 auto]", minWidth: "0", maxWidth: "full" },
|
|
232
234
|
_phone: { flexWrap: "wrap" },
|
|
233
235
|
});
|
|
@@ -235,7 +237,8 @@ const barActions = css({
|
|
|
235
237
|
display: "flex",
|
|
236
238
|
alignItems: "center",
|
|
237
239
|
justifyContent: "flex-end",
|
|
238
|
-
flexWrap: "
|
|
240
|
+
flexWrap: "nowrap",
|
|
241
|
+
_phone: { flexWrap: "wrap" },
|
|
239
242
|
gap: "layout.controlGap",
|
|
240
243
|
marginInlineStart: "auto",
|
|
241
244
|
flexShrink: "0",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
export type ValueChangeProps = Omit<ComponentProps<"div">, "children"> & {
|
|
3
|
+
/** The field that changed, such as "Bank account". */
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
/** Its value before the change, struck through. */
|
|
6
|
+
before: ReactNode;
|
|
7
|
+
/** Its value after the change. */
|
|
8
|
+
after: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/** One field's change: its label, the old value struck through, an arrow, then the new value. */
|
|
11
|
+
export declare function ValueChange({ label: fieldLabel, before, after, className, ...props }: ValueChangeProps): import("react").JSX.Element;
|
|
12
|
+
/** The rows of what changed, in a field well with hairlines between them; children are `ValueChange`s. */
|
|
13
|
+
export declare function ValueChangeList({ className, ...props }: ComponentProps<"dl">): import("react").JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* What changed, as the Figma's Activity log draws it under an entry and in its panel: one row per
|
|
4
|
+
* field, its muted label, the old value muted and struck through, an arrow, then the new value.
|
|
5
|
+
* `ValueChangeList` is the well that holds the rows, hairlines between them.
|
|
6
|
+
*/
|
|
7
|
+
import { ArrowRightIcon } from "@phosphor-icons/react";
|
|
8
|
+
import { css, cx } from "#primitives/css";
|
|
9
|
+
import { directional, icon } from "./icon.js";
|
|
10
|
+
import { useCiridaeLocale } from "./locale.js";
|
|
11
|
+
const list = css({
|
|
12
|
+
display: "grid",
|
|
13
|
+
minWidth: "0",
|
|
14
|
+
margin: "none",
|
|
15
|
+
paddingInline: "panel.default",
|
|
16
|
+
border: "1px solid token(colors.border.control)",
|
|
17
|
+
borderRadius: "action",
|
|
18
|
+
background: "bg.formField",
|
|
19
|
+
});
|
|
20
|
+
const row = css({
|
|
21
|
+
display: "grid",
|
|
22
|
+
gridTemplateColumns: "token(sizes.valueChange.label) minmax(0, 1fr)",
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
columnGap: "layout.contentGap",
|
|
25
|
+
paddingBlock: "panel.default",
|
|
26
|
+
lineHeight: "tight",
|
|
27
|
+
"&:not(:last-child)": { borderBottom: "1px solid token(colors.border.divider)" },
|
|
28
|
+
_phone: { gridTemplateColumns: "minmax(0, 1fr)", rowGap: "layout.controlGap" },
|
|
29
|
+
});
|
|
30
|
+
const label = css({
|
|
31
|
+
color: "fg.label",
|
|
32
|
+
fontSize: "code",
|
|
33
|
+
fontWeight: "medium",
|
|
34
|
+
letterSpacing: "compact",
|
|
35
|
+
});
|
|
36
|
+
const values = css({
|
|
37
|
+
display: "flex",
|
|
38
|
+
flexWrap: "wrap",
|
|
39
|
+
alignItems: "center",
|
|
40
|
+
gap: "layout.controlGap",
|
|
41
|
+
minWidth: "0",
|
|
42
|
+
margin: "none",
|
|
43
|
+
fontSize: "body",
|
|
44
|
+
fontWeight: "medium",
|
|
45
|
+
letterSpacing: "compact",
|
|
46
|
+
"& del": { color: "fg.muted", textDecorationLine: "line-through" },
|
|
47
|
+
"& ins": { color: "fg.primary", textDecorationLine: "none" },
|
|
48
|
+
"& > svg": { flexShrink: "0", color: "fg.muted" },
|
|
49
|
+
});
|
|
50
|
+
const srOnly = css({ srOnly: true });
|
|
51
|
+
/** One field's change: its label, the old value struck through, an arrow, then the new value. */
|
|
52
|
+
export function ValueChange({ label: fieldLabel, before, after, className, ...props }) {
|
|
53
|
+
const { labels } = useCiridaeLocale();
|
|
54
|
+
return (_jsxs("div", { ...props, className: cx(row, className), "data-ciridae-ui": "", children: [_jsx("dt", { className: label, children: fieldLabel }), _jsxs("dd", { className: values, children: [_jsx("span", { className: srOnly, children: labels.valueChange.from }), _jsx("del", { children: before }), _jsx(ArrowRightIcon, { "aria-hidden": "true", className: cx(icon({ size: "small" }), directional) }), _jsx("span", { className: srOnly, children: labels.valueChange.to }), _jsx("ins", { children: after })] })] }));
|
|
55
|
+
}
|
|
56
|
+
/** The rows of what changed, in a field well with hairlines between them; children are `ValueChange`s. */
|
|
57
|
+
export function ValueChangeList({ className, ...props }) {
|
|
58
|
+
return _jsx("dl", { ...props, className: cx(list, className), "data-ciridae-ui": "" });
|
|
59
|
+
}
|
package/dist/preset.js
CHANGED
|
@@ -190,6 +190,10 @@ export function createCiridaePreset({ appBase = false, ...theme } = {}) {
|
|
|
190
190
|
"panel.compact": { value: "8px" },
|
|
191
191
|
"panel.default": { value: "12px" },
|
|
192
192
|
"panel.comfortable": { value: "16px" },
|
|
193
|
+
// Under a panel header's description, and a divided list row's block padding: the Figma's
|
|
194
|
+
// settings panels pad them 14.
|
|
195
|
+
"panelHeader.describedBottom": { value: "14px" },
|
|
196
|
+
"listRow.dividedBlock": { value: "14px" },
|
|
193
197
|
"panel.roomy": { value: "24px" },
|
|
194
198
|
"panel.card": { value: "20px" },
|
|
195
199
|
"tile.block": { value: "18px" },
|
|
@@ -324,6 +328,8 @@ export function createCiridaePreset({ appBase = false, ...theme } = {}) {
|
|
|
324
328
|
"emptyState.minimum": { value: "200px" },
|
|
325
329
|
"search.regularPreview": { value: "250px" },
|
|
326
330
|
"search.sidebarPreview": { value: "264px" },
|
|
331
|
+
// A list toolbar's search field, as the Figma's list and log toolbars draw it.
|
|
332
|
+
"search.toolbar": { value: "240px" },
|
|
327
333
|
"shell.sidebar": { value: "248px" },
|
|
328
334
|
// The glass shell round each dialog and palette adds its padding.
|
|
329
335
|
"overlay.dialog": { value: "440px" },
|
|
@@ -334,6 +340,10 @@ export function createCiridaePreset({ appBase = false, ...theme } = {}) {
|
|
|
334
340
|
"overlay.dialogWide": { value: "720px" },
|
|
335
341
|
// The floating drawer's sheet, inside its 8px shell.
|
|
336
342
|
"overlay.sheet": { value: "480px" },
|
|
343
|
+
// A value change's label column, as the Figma's What changed rows set it.
|
|
344
|
+
"valueChange.label": { value: "120px" },
|
|
345
|
+
// The least a sheet footer's note narrows to before its actions wrap under it.
|
|
346
|
+
"sheet.footerNote": { value: "192px" },
|
|
337
347
|
// The agent sheet: narrower as a drawer, and docked beside the page it grows with the
|
|
338
348
|
// window, 428px at 1440 and 488px from 1650 up.
|
|
339
349
|
"overlay.sheetNarrow": { value: "400px" },
|
|
@@ -347,7 +357,7 @@ export function createCiridaePreset({ appBase = false, ...theme } = {}) {
|
|
|
347
357
|
"chat.bubble": { value: "85%" },
|
|
348
358
|
// A file sent with a message, as a square tile over its bubble.
|
|
349
359
|
"chat.attachment": { value: "88px" },
|
|
350
|
-
"settings.column": { value: "
|
|
360
|
+
"settings.column": { value: "760px" },
|
|
351
361
|
"card.centered": { value: "480px" },
|
|
352
362
|
"scroll.bar": { value: "6px" },
|
|
353
363
|
"card.centeredWide": { value: "720px" },
|
|
@@ -385,6 +395,9 @@ export function createCiridaePreset({ appBase = false, ...theme } = {}) {
|
|
|
385
395
|
// A single line, its box the type's own height. Text that can wrap takes another.
|
|
386
396
|
tight: { value: "1" },
|
|
387
397
|
compact: { value: "1.25" },
|
|
398
|
+
// A row's label over its detail: 16px lines put them 17 apart baseline to baseline, as the
|
|
399
|
+
// Figma's list rows do, in the 32px a row's avatar takes, so the row stays 56.
|
|
400
|
+
stacked: { value: "16px" },
|
|
388
401
|
log: { value: "1.4" },
|
|
389
402
|
body: { value: "1.4" },
|
|
390
403
|
},
|