@cere/cere-design-system 0.0.35 → 0.0.37
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/.specify/memory/components-reference.md +109 -10
- package/dist/index.d.mts +801 -489
- package/dist/index.d.ts +801 -489
- package/dist/index.js +2811 -2426
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2642 -2262
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -598,7 +598,7 @@ import { Dialog, Button } from '@cere/cere-design-system';
|
|
|
598
598
|
- `fullScreen?: boolean`
|
|
599
599
|
|
|
600
600
|
### Drawer
|
|
601
|
-
Side drawer panel.
|
|
601
|
+
Side drawer panel with optional header, tabs, and footer.
|
|
602
602
|
|
|
603
603
|
```typescript
|
|
604
604
|
import { Drawer } from '@cere/cere-design-system';
|
|
@@ -607,6 +607,8 @@ import { Drawer } from '@cere/cere-design-system';
|
|
|
607
607
|
open={open}
|
|
608
608
|
onClose={() => setOpen(false)}
|
|
609
609
|
anchor="right"
|
|
610
|
+
title="Run details"
|
|
611
|
+
width={{ xs: '100vw', sm: '80vw', md: '70vw', lg: '60vw', xl: 1200 }}
|
|
610
612
|
>
|
|
611
613
|
<div>Drawer content</div>
|
|
612
614
|
</Drawer>
|
|
@@ -617,6 +619,17 @@ import { Drawer } from '@cere/cere-design-system';
|
|
|
617
619
|
- `onClose?: () => void` - Close handler
|
|
618
620
|
- `anchor?: 'left' | 'right' | 'top' | 'bottom'`
|
|
619
621
|
- `variant?: 'permanent' | 'persistent' | 'temporary'`
|
|
622
|
+
- `width?: number | string | { xs?, sm?, md?, lg?, xl? }` - Either a single
|
|
623
|
+
width or a mobile-first per-breakpoint object (values can be numbers or CSS
|
|
624
|
+
strings like `'100vw'`). Defaults: 400 for temporary/persistent, 240 for permanent
|
|
625
|
+
- `miniWidth?: number` - Collapsed width when `collapsed` is true (default 72)
|
|
626
|
+
- `collapsed?: boolean` - Render the mini-rail variant
|
|
627
|
+
- `title?: ReactNode` - Shown in the header; close button appears automatically
|
|
628
|
+
- `header?: ReactNode` - Fully custom header (replaces `title`)
|
|
629
|
+
- `showCloseButton?: boolean` - Override default (on for temporary/persistent)
|
|
630
|
+
- `tabs?: string[]` + `activeTab`, `onTabChange` - Tabbed header content
|
|
631
|
+
- `footer?: ReactNode` - Sticky footer section
|
|
632
|
+
- `topOffset?: number` - Offset from the viewport top in px (e.g., for a fixed app bar)
|
|
620
633
|
|
|
621
634
|
### List & ListItem
|
|
622
635
|
Lists with items.
|
|
@@ -862,6 +875,44 @@ import { Logo } from '@cere/cere-design-system';
|
|
|
862
875
|
- `size?: 'small' | 'medium' | 'large'` | number
|
|
863
876
|
- `variant?: 'full' | 'icon'`
|
|
864
877
|
|
|
878
|
+
### MetaField
|
|
879
|
+
Compact label-over-value column for metadata lists. Uppercase eyebrow label,
|
|
880
|
+
single-line value that truncates with an ellipsis and shows the full text on
|
|
881
|
+
hover (for string values by default).
|
|
882
|
+
|
|
883
|
+
```typescript
|
|
884
|
+
import { MetaField } from '@cere/cere-design-system';
|
|
885
|
+
|
|
886
|
+
<MetaField label="Run ID" value="run_abc123" mono />
|
|
887
|
+
<MetaField label="Status" value={<Chip label="Running" variant="info" />} />
|
|
888
|
+
```
|
|
889
|
+
|
|
890
|
+
**Props:**
|
|
891
|
+
- `label: string` - Uppercase eyebrow label
|
|
892
|
+
- `value: ReactNode` - Value to display
|
|
893
|
+
- `mono?: boolean` - Render the value in a monospace font
|
|
894
|
+
- `title?: string` - Override the auto-generated hover tooltip
|
|
895
|
+
|
|
896
|
+
### ScrollableRow
|
|
897
|
+
Horizontally-scrolling container. Chevron buttons appear at the edges only
|
|
898
|
+
when content overflows, driven by a ResizeObserver and MutationObserver so
|
|
899
|
+
they stay in sync when children change.
|
|
900
|
+
|
|
901
|
+
```typescript
|
|
902
|
+
import { ScrollableRow, Chip } from '@cere/cere-design-system';
|
|
903
|
+
|
|
904
|
+
<ScrollableRow>
|
|
905
|
+
{activities.map(a => <Chip key={a.id} label={a.name} />)}
|
|
906
|
+
</ScrollableRow>
|
|
907
|
+
```
|
|
908
|
+
|
|
909
|
+
**Props:**
|
|
910
|
+
- `children: ReactNode` - Row content (any children, not just chips)
|
|
911
|
+
- `leftLabel?: string` - Aria-label for the left chevron (default 'Scroll left')
|
|
912
|
+
- `rightLabel?: string` - Aria-label for the right chevron (default 'Scroll right')
|
|
913
|
+
- `minNudge?: number` - Minimum scroll distance per chevron click (default 160)
|
|
914
|
+
- `nudgeFraction?: number` - Fraction of viewport scrolled per click (default 0.6)
|
|
915
|
+
|
|
865
916
|
---
|
|
866
917
|
|
|
867
918
|
## FEEDBACK
|
|
@@ -920,23 +971,25 @@ import { Badge } from '@cere/cere-design-system';
|
|
|
920
971
|
- `invisible?: boolean`
|
|
921
972
|
|
|
922
973
|
### Chip
|
|
923
|
-
Compact element representing an input, attribute, or action.
|
|
974
|
+
Compact element representing an input, attribute, status, or action. Colors
|
|
975
|
+
come entirely from the `variant` prop — don't pass MUI's `color` directly.
|
|
924
976
|
|
|
925
977
|
```typescript
|
|
926
978
|
import { Chip } from '@cere/cere-design-system';
|
|
927
979
|
|
|
928
|
-
<Chip
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
icon={<Icon />}
|
|
933
|
-
/>
|
|
980
|
+
<Chip label="Tag" />
|
|
981
|
+
<Chip label="Selected" variant="active" />
|
|
982
|
+
<Chip label="Succeeded" variant="success" />
|
|
983
|
+
<Chip label="Failed" variant="error" onDelete={handleDelete} />
|
|
934
984
|
```
|
|
935
985
|
|
|
936
986
|
**Props:**
|
|
937
987
|
- `label: string` - Chip text
|
|
938
|
-
- `variant?: '
|
|
939
|
-
- `
|
|
988
|
+
- `variant?: 'default' | 'active' | 'success' | 'error' | 'warning' | 'info'`
|
|
989
|
+
- `default` - grey surface, text-primary color
|
|
990
|
+
- `active` - brand-selected background, primary text
|
|
991
|
+
- `success/error/warning/info` - solid pill using `theme.palette.<status>.main`
|
|
992
|
+
surface + `.contrastText` (typically white); hover uses `.dark`
|
|
940
993
|
- `size?: 'small' | 'medium'`
|
|
941
994
|
- `icon?: ReactNode` - Icon before label
|
|
942
995
|
- `avatar?: ReactNode` - Avatar before label
|
|
@@ -945,6 +998,11 @@ import { Chip } from '@cere/cere-design-system';
|
|
|
945
998
|
- `disabled?: boolean`
|
|
946
999
|
- `clickable?: boolean`
|
|
947
1000
|
|
|
1001
|
+
The pure `getChipVariantStyles(variant, theme)` helper is also exported so
|
|
1002
|
+
domain-layer wrappers (e.g., a `RunStatusChip` that maps an app enum to a
|
|
1003
|
+
variant) can reuse the same color resolution without re-rendering a styled
|
|
1004
|
+
component.
|
|
1005
|
+
|
|
948
1006
|
### Tooltip
|
|
949
1007
|
Informative tooltip on hover.
|
|
950
1008
|
|
|
@@ -1042,6 +1100,47 @@ import { AppLoading } from '@cere/cere-design-system';
|
|
|
1042
1100
|
**Props:**
|
|
1043
1101
|
- Minimal props - displays animated Cere logo
|
|
1044
1102
|
|
|
1103
|
+
### StatusDot
|
|
1104
|
+
Small colored circle indicating entity status. Pair with a text label for a
|
|
1105
|
+
labeled status, or pass `aria-label` to promote the dot into a standalone
|
|
1106
|
+
accessible indicator.
|
|
1107
|
+
|
|
1108
|
+
```typescript
|
|
1109
|
+
import { StatusDot } from '@cere/cere-design-system';
|
|
1110
|
+
|
|
1111
|
+
<StatusDot status="success" />
|
|
1112
|
+
<StatusDot status="info" pulse aria-label="Running" />
|
|
1113
|
+
```
|
|
1114
|
+
|
|
1115
|
+
**Props:**
|
|
1116
|
+
- `status: 'success' | 'error' | 'warning' | 'info' | 'primary' | 'neutral'`
|
|
1117
|
+
- `size?: number` - Diameter in px (default 8)
|
|
1118
|
+
- `pulse?: boolean` - Animate for in-progress states (respects `prefers-reduced-motion`)
|
|
1119
|
+
- `aria-label?: string` - Presentational by default; setting this sets `role="img"`
|
|
1120
|
+
|
|
1121
|
+
### CopyChip
|
|
1122
|
+
Compact inline copy-to-clipboard control. Monospace text + an icon that
|
|
1123
|
+
toggles to a check mark for a moment after a successful copy. Use in dense
|
|
1124
|
+
metadata rows where `IDBlock` is too heavy.
|
|
1125
|
+
|
|
1126
|
+
```typescript
|
|
1127
|
+
import { CopyChip } from '@cere/cere-design-system';
|
|
1128
|
+
|
|
1129
|
+
<CopyChip text="run_abc123" />
|
|
1130
|
+
<CopyChip text={longHexId} aria-label="Copy workspace ID" onCopy={track} />
|
|
1131
|
+
```
|
|
1132
|
+
|
|
1133
|
+
**Props:**
|
|
1134
|
+
- `text: string` - Text to display and copy
|
|
1135
|
+
- `maxWidth?: number` - Ellipsize threshold for the label (default 260px)
|
|
1136
|
+
- `aria-label?: string` - Override the default `Copy <text>` label
|
|
1137
|
+
- `tooltipLabel?: string` / `tooltipCopiedLabel?: string` - Tooltip copy
|
|
1138
|
+
- `onCopy?: () => void` - Fires after the clipboard write
|
|
1139
|
+
|
|
1140
|
+
**CopyChip vs IDBlock:**
|
|
1141
|
+
- Use `CopyChip` for inline, dense metadata (quiet icon-swap feedback, no snackbar)
|
|
1142
|
+
- Use `IDBlock` when the ID is the primary affordance on the surface (boxed, labeled, snackbar feedback)
|
|
1143
|
+
|
|
1045
1144
|
---
|
|
1046
1145
|
|
|
1047
1146
|
## UTILITIES
|