@cere/cere-design-system 0.1.0 → 0.2.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.
- package/README.md +76 -0
- package/dist/buttons.d.mts +27 -22
- package/dist/buttons.d.ts +27 -22
- package/dist/buttons.js +5 -5
- package/dist/buttons.mjs +4 -4
- package/dist/charts.d.mts +1 -23
- package/dist/charts.d.ts +1 -23
- package/dist/charts.js +2 -9
- package/dist/charts.js.map +1 -1
- package/dist/charts.mjs +1 -8
- package/dist/{chunk-THQKYTQE.js → chunk-2KDN37PQ.js} +28 -32
- package/dist/chunk-2KDN37PQ.js.map +1 -0
- package/dist/{chunk-3WCMINE5.mjs → chunk-34LFXT6C.mjs} +25 -29
- package/dist/chunk-34LFXT6C.mjs.map +1 -0
- package/dist/chunk-3KCXCVOX.mjs +411 -0
- package/dist/chunk-3KCXCVOX.mjs.map +1 -0
- package/dist/{chunk-NXTVJ6PY.js → chunk-4OKTICU5.js} +10 -10
- package/dist/chunk-4OKTICU5.js.map +1 -0
- package/dist/{chunk-FN5YL4BK.js → chunk-72TQ56EP.js} +47 -45
- package/dist/chunk-72TQ56EP.js.map +1 -0
- package/dist/{chunk-QYYQYZHV.js → chunk-7KXKK2RE.js} +3 -5
- package/dist/chunk-7KXKK2RE.js.map +1 -0
- package/dist/{chunk-CCN6M4LI.js → chunk-ARSCL4ZZ.js} +18 -10
- package/dist/chunk-ARSCL4ZZ.js.map +1 -0
- package/dist/chunk-AWVNEU6R.mjs +1478 -0
- package/dist/chunk-AWVNEU6R.mjs.map +1 -0
- package/dist/{chunk-CUCKULYC.mjs → chunk-BH4FNZKK.mjs} +74 -1260
- package/dist/chunk-BH4FNZKK.mjs.map +1 -0
- package/dist/{chunk-FFZ5S7PQ.mjs → chunk-BOQPWZIB.mjs} +6 -5
- package/dist/chunk-BOQPWZIB.mjs.map +1 -0
- package/dist/chunk-BT7XUTT5.mjs +392 -0
- package/dist/chunk-BT7XUTT5.mjs.map +1 -0
- package/dist/{chunk-ATIFLPH6.mjs → chunk-D7D25O6E.mjs} +4 -2
- package/dist/{chunk-ATIFLPH6.mjs.map → chunk-D7D25O6E.mjs.map} +1 -1
- package/dist/{chunk-JS4IB5IU.mjs → chunk-DRGMEIPT.mjs} +2 -2
- package/dist/chunk-DRGMEIPT.mjs.map +1 -0
- package/dist/{chunk-KF2Y7HO3.js → chunk-DZXNYLVG.js} +43 -246
- package/dist/chunk-DZXNYLVG.js.map +1 -0
- package/dist/{chunk-IE6GCHDI.mjs → chunk-GR52ENYI.mjs} +26 -29
- package/dist/chunk-GR52ENYI.mjs.map +1 -0
- package/dist/chunk-GTBKQXXI.js +1472 -0
- package/dist/chunk-GTBKQXXI.js.map +1 -0
- package/dist/{chunk-463SRKKD.js → chunk-HJ24WKU4.js} +14 -5
- package/dist/chunk-HJ24WKU4.js.map +1 -0
- package/dist/{chunk-EOF3QNPF.js → chunk-KKIKOIMP.js} +140 -1028
- package/dist/chunk-KKIKOIMP.js.map +1 -0
- package/dist/{chunk-MNM6HE72.js → chunk-LVJSKRX3.js} +16 -15
- package/dist/chunk-LVJSKRX3.js.map +1 -0
- package/dist/{chunk-KPDYKK3V.js → chunk-PFZZJZ64.js} +8 -8
- package/dist/{chunk-KPDYKK3V.js.map → chunk-PFZZJZ64.js.map} +1 -1
- package/dist/{chunk-KVBMZNWT.mjs → chunk-POCAW2G4.mjs} +18 -10
- package/dist/chunk-POCAW2G4.mjs.map +1 -0
- package/dist/{chunk-L2TIGA7I.js → chunk-QCFLZ7X3.js} +39 -42
- package/dist/chunk-QCFLZ7X3.js.map +1 -0
- package/dist/{chunk-6EUAU67C.mjs → chunk-SG2TD7FQ.mjs} +8 -8
- package/dist/chunk-SG2TD7FQ.mjs.map +1 -0
- package/dist/{chunk-QY65OUAC.mjs → chunk-SSFALO6S.mjs} +13 -4
- package/dist/chunk-SSFALO6S.mjs.map +1 -0
- package/dist/{chunk-PWF2NJDB.mjs → chunk-WC2TCWXK.mjs} +82 -14
- package/dist/chunk-WC2TCWXK.mjs.map +1 -0
- package/dist/{chunk-ZGCN5WCG.js → chunk-XZZZ4MZV.js} +83 -15
- package/dist/chunk-XZZZ4MZV.js.map +1 -0
- package/dist/chunk-YCDCQSYH.js +411 -0
- package/dist/chunk-YCDCQSYH.js.map +1 -0
- package/dist/{chunk-CWJ4OU6W.mjs → chunk-ZDAZYIXB.mjs} +2 -4
- package/dist/chunk-ZDAZYIXB.mjs.map +1 -0
- package/dist/feedback.d.mts +20 -8
- package/dist/feedback.d.ts +20 -8
- package/dist/feedback.js +5 -5
- package/dist/feedback.mjs +4 -4
- package/dist/fonts/HumanSans-BlackOblique.otf +0 -0
- package/dist/fonts/HumanSans-Thin.otf +0 -0
- package/dist/fonts/HumanSans-ThinOblique.otf +0 -0
- package/dist/fonts/human-sans-font.css +88 -0
- package/dist/fonts/human-sans.css +3 -0
- package/dist/fonts/inter.css +3 -0
- package/dist/icons.d.mts +2 -3
- package/dist/icons.d.ts +2 -3
- package/dist/icons.js +2 -2
- package/dist/icons.mjs +1 -1
- package/dist/index.d.mts +37 -8
- package/dist/index.d.ts +37 -8
- package/dist/index.js +23 -90
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -113
- package/dist/index.mjs.map +1 -1
- package/dist/inputs.d.mts +23 -3
- package/dist/inputs.d.ts +23 -3
- package/dist/inputs.js +5 -5
- package/dist/inputs.js.map +1 -1
- package/dist/inputs.mjs +15 -15
- package/dist/layout.d.mts +37 -283
- package/dist/layout.d.ts +37 -283
- package/dist/layout.js +8 -32
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +16 -40
- package/dist/navigation.d.mts +9 -114
- package/dist/navigation.d.ts +9 -114
- package/dist/navigation.js +5 -9
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +6 -10
- package/dist/third-party.d.mts +3 -527
- package/dist/third-party.d.ts +3 -527
- package/dist/third-party.js +2 -40
- package/dist/third-party.js.map +1 -1
- package/dist/third-party.mjs +3 -41
- package/dist/tokens.css +45 -71
- package/dist/utilities.js +2 -4
- package/dist/utilities.js.map +1 -1
- package/dist/utilities.mjs +2 -4
- package/package.json +23 -9
- package/dist/WorkflowNode-BnxXO6t_.d.mts +0 -46
- package/dist/WorkflowNode-BnxXO6t_.d.ts +0 -46
- package/dist/chunk-27JEWSWA.mjs +0 -233
- package/dist/chunk-27JEWSWA.mjs.map +0 -1
- package/dist/chunk-3WCMINE5.mjs.map +0 -1
- package/dist/chunk-463SRKKD.js.map +0 -1
- package/dist/chunk-6EUAU67C.mjs.map +0 -1
- package/dist/chunk-AIY6222Q.js +0 -11
- package/dist/chunk-AIY6222Q.js.map +0 -1
- package/dist/chunk-AJBM7IE6.mjs +0 -2366
- package/dist/chunk-AJBM7IE6.mjs.map +0 -1
- package/dist/chunk-CCN6M4LI.js.map +0 -1
- package/dist/chunk-CUCKULYC.mjs.map +0 -1
- package/dist/chunk-CWJ4OU6W.mjs.map +0 -1
- package/dist/chunk-EOF3QNPF.js.map +0 -1
- package/dist/chunk-FFZ5S7PQ.mjs.map +0 -1
- package/dist/chunk-FN5YL4BK.js.map +0 -1
- package/dist/chunk-HLH2VWXL.js +0 -2658
- package/dist/chunk-HLH2VWXL.js.map +0 -1
- package/dist/chunk-IE6GCHDI.mjs.map +0 -1
- package/dist/chunk-JS4IB5IU.mjs.map +0 -1
- package/dist/chunk-KF2Y7HO3.js.map +0 -1
- package/dist/chunk-KVBMZNWT.mjs.map +0 -1
- package/dist/chunk-L2TIGA7I.js.map +0 -1
- package/dist/chunk-MNM6HE72.js.map +0 -1
- package/dist/chunk-NXTVJ6PY.js.map +0 -1
- package/dist/chunk-PWF2NJDB.mjs.map +0 -1
- package/dist/chunk-QD6RLAO2.mjs +0 -11
- package/dist/chunk-QD6RLAO2.mjs.map +0 -1
- package/dist/chunk-QY65OUAC.mjs.map +0 -1
- package/dist/chunk-QYYQYZHV.js.map +0 -1
- package/dist/chunk-T7LPABOL.mjs +0 -595
- package/dist/chunk-T7LPABOL.mjs.map +0 -1
- package/dist/chunk-THQKYTQE.js.map +0 -1
- package/dist/chunk-X7E6GMFL.js +0 -233
- package/dist/chunk-X7E6GMFL.js.map +0 -1
- package/dist/chunk-XF66WQZE.mjs +0 -1535
- package/dist/chunk-XF66WQZE.mjs.map +0 -1
- package/dist/chunk-YQOZPLTY.js +0 -1535
- package/dist/chunk-YQOZPLTY.js.map +0 -1
- package/dist/chunk-ZGCN5WCG.js.map +0 -1
- package/dist/index.css +0 -79
- package/dist/index.css.map +0 -1
- /package/dist/{HumanSans-Black-C4YJONK7.otf → fonts/HumanSans-Black.otf} +0 -0
- /package/dist/{HumanSans-Bold-4EAJ3L3T.otf → fonts/HumanSans-Bold.otf} +0 -0
- /package/dist/{HumanSans-BoldOblique-4D325T4F.otf → fonts/HumanSans-BoldOblique.otf} +0 -0
- /package/dist/{HumanSans-ExtraLight-VL7DEKQ4.otf → fonts/HumanSans-ExtraLight.otf} +0 -0
- /package/dist/{HumanSans-ExtraLightOblique-VK2JTUXF.otf → fonts/HumanSans-ExtraLightOblique.otf} +0 -0
- /package/dist/{HumanSans-Light-YV7AFKRB.otf → fonts/HumanSans-Light.otf} +0 -0
- /package/dist/{HumanSans-LightOblique-VIXV7QA6.otf → fonts/HumanSans-LightOblique.otf} +0 -0
- /package/dist/{HumanSans-Medium-UULJ3PIR.otf → fonts/HumanSans-Medium.otf} +0 -0
- /package/dist/{HumanSans-MediumOblique-M7FHDZRS.otf → fonts/HumanSans-MediumOblique.otf} +0 -0
- /package/dist/{HumanSans-Regular-QMFEP3F6.otf → fonts/HumanSans-Regular.otf} +0 -0
- /package/dist/{HumanSans-RegularOblique-YPKQJAAM.otf → fonts/HumanSans-RegularOblique.otf} +0 -0
package/README.md
CHANGED
|
@@ -122,6 +122,61 @@ import {
|
|
|
122
122
|
<EmptyState title="No items" description="Create your first item" />
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
+
## Migration notes
|
|
126
|
+
|
|
127
|
+
### `ButtonProps` and `ChipProps` discriminated union
|
|
128
|
+
|
|
129
|
+
`tone='onGradient'` and `variant` are now mutually exclusive. Passing both is a
|
|
130
|
+
TypeScript error. Remove `variant` when using `tone='onGradient'`:
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
// Before (now a type error):
|
|
134
|
+
<Button tone="onGradient" variant="primary">...</Button>
|
|
135
|
+
|
|
136
|
+
// After:
|
|
137
|
+
<Button tone="onGradient">...</Button>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Runtime behavior is unchanged; this is a type-only tightening. Applies to both
|
|
141
|
+
`<Button>` and `<Chip>`.
|
|
142
|
+
|
|
143
|
+
## Design Tokens
|
|
144
|
+
|
|
145
|
+
Design tokens are authored in W3C DTCG JSON under `tokens/` and generated into
|
|
146
|
+
two artifacts via Style Dictionary v4:
|
|
147
|
+
|
|
148
|
+
- `src/theme/tokens.css` — CSS custom properties (`:root`) consumed at runtime
|
|
149
|
+
- `src/theme/tokens.generated.ts` — typed token values imported by `primitives.ts`, `semantic.ts`, and `webSurfaceTokens.ts`
|
|
150
|
+
|
|
151
|
+
Generation runs automatically before `npm run build` via `npm run tokens:build`.
|
|
152
|
+
To regenerate tokens manually:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
npm run tokens:build
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
To use the generated CSS in your application, import it once at the app root:
|
|
159
|
+
|
|
160
|
+
```ts
|
|
161
|
+
import '@cere/cere-design-system/tokens.css';
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Fonts (opt-in)
|
|
165
|
+
|
|
166
|
+
Fonts are **not** bundled into the main package entry. This is a consumer-facing
|
|
167
|
+
change from earlier versions. Import only the fonts your app needs:
|
|
168
|
+
|
|
169
|
+
```ts
|
|
170
|
+
// Self-hosted Inter (variable font via @fontsource-variable/inter)
|
|
171
|
+
import '@cere/cere-design-system/fonts/inter.css';
|
|
172
|
+
|
|
173
|
+
// Self-hosted Human Sans (Cere brand display font)
|
|
174
|
+
import '@cere/cere-design-system/fonts/human-sans.css';
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Next.js apps should continue to load Inter via `next/font/google` and skip the
|
|
178
|
+
`inter.css` subpath import to avoid duplicate font loading.
|
|
179
|
+
|
|
125
180
|
## Development
|
|
126
181
|
|
|
127
182
|
```bash
|
|
@@ -141,6 +196,27 @@ npm run type-check
|
|
|
141
196
|
npm run lint
|
|
142
197
|
```
|
|
143
198
|
|
|
199
|
+
## Contributing a changeset
|
|
200
|
+
|
|
201
|
+
This project uses [Changesets](https://github.com/changesets/changesets) to manage
|
|
202
|
+
versioning and publishing. When your PR contains a user-facing change, add a changeset:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
npm run changeset
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Follow the interactive prompts to select a bump type (`major` / `minor` / `patch`)
|
|
209
|
+
and describe the change. This creates a `.changeset/<hash>.md` file — commit it
|
|
210
|
+
alongside your code changes.
|
|
211
|
+
|
|
212
|
+
When a "Version Packages" PR (auto-created by the release workflow) is merged to
|
|
213
|
+
`master`, all pending changesets are applied: `package.json` version is bumped,
|
|
214
|
+
`CHANGELOG.md` is updated, and the package is published to NPM.
|
|
215
|
+
|
|
216
|
+
**Note for maintainers:** The release workflow (`.github/workflows/release.yaml`)
|
|
217
|
+
requires the `NPM_TOKEN_PUBLISH` secret to be set in GitHub repo settings before
|
|
218
|
+
it can publish. See the top-of-file comment in that workflow for details.
|
|
219
|
+
|
|
144
220
|
## Components
|
|
145
221
|
|
|
146
222
|
### Buttons (2)
|
package/dist/buttons.d.mts
CHANGED
|
@@ -2,40 +2,45 @@ import React__default from 'react';
|
|
|
2
2
|
import { ButtonProps as ButtonProps$1 } from '@mui/material/Button';
|
|
3
3
|
import { IconButtonProps as IconButtonProps$1 } from '@mui/material/IconButton';
|
|
4
4
|
import { LoadingButtonProps as LoadingButtonProps$1 } from '@mui/lab';
|
|
5
|
-
import { ButtonGroupProps as ButtonGroupProps$1 } from '@mui/material';
|
|
5
|
+
import { ButtonGroupProps as ButtonGroupProps$1 } from '@mui/material/ButtonGroup';
|
|
6
6
|
|
|
7
7
|
type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
|
|
8
8
|
type ButtonTone = 'default' | 'onGradient';
|
|
9
|
-
|
|
9
|
+
/** Shared base: props valid for both tone shapes. */
|
|
10
|
+
interface ButtonBaseProps extends Omit<ButtonProps$1, 'variant' | 'color'> {
|
|
11
|
+
size?: 'small' | 'medium' | 'large';
|
|
12
|
+
startIcon?: React__default.ReactNode;
|
|
13
|
+
endIcon?: React__default.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Default tone: `variant` controls the visual style.
|
|
17
|
+
* @default tone 'default'
|
|
18
|
+
*/
|
|
19
|
+
interface ButtonDefaultProps extends ButtonBaseProps {
|
|
20
|
+
tone?: 'default';
|
|
10
21
|
/**
|
|
11
|
-
* The visual style variant of the button
|
|
22
|
+
* The visual style variant of the button.
|
|
12
23
|
* - primary: Filled button with primary color background
|
|
13
24
|
* - secondary: Outlined button with transparent background and border
|
|
14
25
|
* - tertiary: Text button with no background or border
|
|
15
26
|
*/
|
|
16
27
|
variant?: ButtonVariant;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* onGradient tone: white pill on a dark gradient surface (banner CTA).
|
|
31
|
+
* `variant` must be omitted — it is not applicable when tone is 'onGradient'.
|
|
32
|
+
*/
|
|
33
|
+
interface ButtonOnGradientProps extends ButtonBaseProps {
|
|
34
|
+
tone: 'onGradient';
|
|
17
35
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* the button as a white pill on a dark gradient surface (banner CTA
|
|
21
|
-
* pattern). Use the default tone if you want `variant` to drive the look.
|
|
22
|
-
* @default 'default'
|
|
23
|
-
*/
|
|
24
|
-
tone?: ButtonTone;
|
|
25
|
-
/**
|
|
26
|
-
* The size of the button
|
|
27
|
-
*/
|
|
28
|
-
size?: 'small' | 'medium' | 'large';
|
|
29
|
-
/**
|
|
30
|
-
* Icon element to display before the button text
|
|
31
|
-
*/
|
|
32
|
-
startIcon?: React__default.ReactNode;
|
|
33
|
-
/**
|
|
34
|
-
* Icon element to display after the button text
|
|
36
|
+
* Not applicable when tone='onGradient'. Omit this prop.
|
|
37
|
+
* @deprecated Passing variant with tone='onGradient' is a type error.
|
|
35
38
|
*/
|
|
36
|
-
|
|
39
|
+
variant?: never;
|
|
37
40
|
}
|
|
38
|
-
|
|
41
|
+
/** ButtonProps is a discriminated union on `tone`. */
|
|
42
|
+
type ButtonProps = ButtonDefaultProps | ButtonOnGradientProps;
|
|
43
|
+
declare const Button: React__default.ForwardRefExoticComponent<(Omit<ButtonDefaultProps, "ref"> | Omit<ButtonOnGradientProps, "ref">) & React__default.RefAttributes<HTMLButtonElement>>;
|
|
39
44
|
|
|
40
45
|
interface IconButtonProps extends IconButtonProps$1 {
|
|
41
46
|
variant?: 'default' | 'primary' | 'secondary';
|
package/dist/buttons.d.ts
CHANGED
|
@@ -2,40 +2,45 @@ import React__default from 'react';
|
|
|
2
2
|
import { ButtonProps as ButtonProps$1 } from '@mui/material/Button';
|
|
3
3
|
import { IconButtonProps as IconButtonProps$1 } from '@mui/material/IconButton';
|
|
4
4
|
import { LoadingButtonProps as LoadingButtonProps$1 } from '@mui/lab';
|
|
5
|
-
import { ButtonGroupProps as ButtonGroupProps$1 } from '@mui/material';
|
|
5
|
+
import { ButtonGroupProps as ButtonGroupProps$1 } from '@mui/material/ButtonGroup';
|
|
6
6
|
|
|
7
7
|
type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
|
|
8
8
|
type ButtonTone = 'default' | 'onGradient';
|
|
9
|
-
|
|
9
|
+
/** Shared base: props valid for both tone shapes. */
|
|
10
|
+
interface ButtonBaseProps extends Omit<ButtonProps$1, 'variant' | 'color'> {
|
|
11
|
+
size?: 'small' | 'medium' | 'large';
|
|
12
|
+
startIcon?: React__default.ReactNode;
|
|
13
|
+
endIcon?: React__default.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Default tone: `variant` controls the visual style.
|
|
17
|
+
* @default tone 'default'
|
|
18
|
+
*/
|
|
19
|
+
interface ButtonDefaultProps extends ButtonBaseProps {
|
|
20
|
+
tone?: 'default';
|
|
10
21
|
/**
|
|
11
|
-
* The visual style variant of the button
|
|
22
|
+
* The visual style variant of the button.
|
|
12
23
|
* - primary: Filled button with primary color background
|
|
13
24
|
* - secondary: Outlined button with transparent background and border
|
|
14
25
|
* - tertiary: Text button with no background or border
|
|
15
26
|
*/
|
|
16
27
|
variant?: ButtonVariant;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* onGradient tone: white pill on a dark gradient surface (banner CTA).
|
|
31
|
+
* `variant` must be omitted — it is not applicable when tone is 'onGradient'.
|
|
32
|
+
*/
|
|
33
|
+
interface ButtonOnGradientProps extends ButtonBaseProps {
|
|
34
|
+
tone: 'onGradient';
|
|
17
35
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* the button as a white pill on a dark gradient surface (banner CTA
|
|
21
|
-
* pattern). Use the default tone if you want `variant` to drive the look.
|
|
22
|
-
* @default 'default'
|
|
23
|
-
*/
|
|
24
|
-
tone?: ButtonTone;
|
|
25
|
-
/**
|
|
26
|
-
* The size of the button
|
|
27
|
-
*/
|
|
28
|
-
size?: 'small' | 'medium' | 'large';
|
|
29
|
-
/**
|
|
30
|
-
* Icon element to display before the button text
|
|
31
|
-
*/
|
|
32
|
-
startIcon?: React__default.ReactNode;
|
|
33
|
-
/**
|
|
34
|
-
* Icon element to display after the button text
|
|
36
|
+
* Not applicable when tone='onGradient'. Omit this prop.
|
|
37
|
+
* @deprecated Passing variant with tone='onGradient' is a type error.
|
|
35
38
|
*/
|
|
36
|
-
|
|
39
|
+
variant?: never;
|
|
37
40
|
}
|
|
38
|
-
|
|
41
|
+
/** ButtonProps is a discriminated union on `tone`. */
|
|
42
|
+
type ButtonProps = ButtonDefaultProps | ButtonOnGradientProps;
|
|
43
|
+
declare const Button: React__default.ForwardRefExoticComponent<(Omit<ButtonDefaultProps, "ref"> | Omit<ButtonOnGradientProps, "ref">) & React__default.RefAttributes<HTMLButtonElement>>;
|
|
39
44
|
|
|
40
45
|
interface IconButtonProps extends IconButtonProps$1 {
|
|
41
46
|
variant?: 'default' | 'primary' | 'secondary';
|
package/dist/buttons.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk7KXKK2REjs = require('./chunk-7KXKK2RE.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkOWWDNDF4js = require('./chunk-OWWDNDF4.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
require('./chunk-
|
|
12
|
-
require('./chunk-
|
|
10
|
+
var _chunkLVJSKRX3js = require('./chunk-LVJSKRX3.js');
|
|
11
|
+
require('./chunk-72TQ56EP.js');
|
|
12
|
+
require('./chunk-XZZZ4MZV.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
exports.Button =
|
|
18
|
+
exports.Button = _chunkLVJSKRX3js.Button; exports.ButtonGroup = _chunk7KXKK2REjs.ButtonGroup; exports.IconButton = _chunkOWWDNDF4js.IconButton; exports.LoadingButton = _chunk7KXKK2REjs.LoadingButton;
|
|
19
19
|
//# sourceMappingURL=buttons.js.map
|
package/dist/buttons.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ButtonGroup,
|
|
3
3
|
LoadingButton
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZDAZYIXB.mjs";
|
|
5
5
|
import {
|
|
6
6
|
IconButton
|
|
7
7
|
} from "./chunk-5ASG6G6U.mjs";
|
|
8
8
|
import {
|
|
9
9
|
Button
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-BOQPWZIB.mjs";
|
|
11
|
+
import "./chunk-D7D25O6E.mjs";
|
|
12
|
+
import "./chunk-WC2TCWXK.mjs";
|
|
13
13
|
export {
|
|
14
14
|
Button,
|
|
15
15
|
ButtonGroup,
|
package/dist/charts.d.mts
CHANGED
|
@@ -13,28 +13,6 @@ type ChartWidgetProps = {
|
|
|
13
13
|
};
|
|
14
14
|
declare const ChartWidget: ({ title, value, history, formatValue, }: ChartWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
15
15
|
|
|
16
|
-
type MetricsHistoryRecord = {
|
|
17
|
-
storedBytes: number;
|
|
18
|
-
transferredBytes: number;
|
|
19
|
-
puts: number;
|
|
20
|
-
gets: number;
|
|
21
|
-
recordTime: Date;
|
|
22
|
-
};
|
|
23
|
-
type MetricsChartProps = {
|
|
24
|
-
history?: MetricsHistoryRecord[];
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* TODO: Refactor this component to use shared graphs configuration
|
|
28
|
-
*/
|
|
29
|
-
declare const MetricsChart: ({ history }: MetricsChartProps) => react_jsx_runtime.JSX.Element;
|
|
30
|
-
|
|
31
|
-
type MetricsPeriod = 'hour' | 'day' | 'week' | 'month';
|
|
32
|
-
type PeriodSelectProps = {
|
|
33
|
-
value?: MetricsPeriod;
|
|
34
|
-
onChange?: (value: MetricsPeriod) => void;
|
|
35
|
-
};
|
|
36
|
-
declare const PeriodSelect: ({ value, onChange }: PeriodSelectProps) => react_jsx_runtime.JSX.Element;
|
|
37
|
-
|
|
38
16
|
/**
|
|
39
17
|
* Represents a single time range option in the dropdown.
|
|
40
18
|
*/
|
|
@@ -206,4 +184,4 @@ interface TimeSeriesGraphProps {
|
|
|
206
184
|
*/
|
|
207
185
|
declare const TimeSeriesGraph: ({ title, series, timeRangeOptions, selectedTimeRange, onTimeRangeChange, summaryItems, showSummary, headerAction, loading, xAxisFormat, }: TimeSeriesGraphProps) => react_jsx_runtime.JSX.Element;
|
|
208
186
|
|
|
209
|
-
export { ChartWidget, type ChartWidgetProps, type DataPoint, type DataSeries,
|
|
187
|
+
export { ChartWidget, type ChartWidgetProps, type DataPoint, type DataSeries, type SummaryItem, SummaryStats, type SummaryStatsProps, type TimeRangeOption, TimeRangeSelect, type TimeRangeSelectProps, TimeSeriesGraph, type TimeSeriesGraphProps };
|
package/dist/charts.d.ts
CHANGED
|
@@ -13,28 +13,6 @@ type ChartWidgetProps = {
|
|
|
13
13
|
};
|
|
14
14
|
declare const ChartWidget: ({ title, value, history, formatValue, }: ChartWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
15
15
|
|
|
16
|
-
type MetricsHistoryRecord = {
|
|
17
|
-
storedBytes: number;
|
|
18
|
-
transferredBytes: number;
|
|
19
|
-
puts: number;
|
|
20
|
-
gets: number;
|
|
21
|
-
recordTime: Date;
|
|
22
|
-
};
|
|
23
|
-
type MetricsChartProps = {
|
|
24
|
-
history?: MetricsHistoryRecord[];
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* TODO: Refactor this component to use shared graphs configuration
|
|
28
|
-
*/
|
|
29
|
-
declare const MetricsChart: ({ history }: MetricsChartProps) => react_jsx_runtime.JSX.Element;
|
|
30
|
-
|
|
31
|
-
type MetricsPeriod = 'hour' | 'day' | 'week' | 'month';
|
|
32
|
-
type PeriodSelectProps = {
|
|
33
|
-
value?: MetricsPeriod;
|
|
34
|
-
onChange?: (value: MetricsPeriod) => void;
|
|
35
|
-
};
|
|
36
|
-
declare const PeriodSelect: ({ value, onChange }: PeriodSelectProps) => react_jsx_runtime.JSX.Element;
|
|
37
|
-
|
|
38
16
|
/**
|
|
39
17
|
* Represents a single time range option in the dropdown.
|
|
40
18
|
*/
|
|
@@ -206,4 +184,4 @@ interface TimeSeriesGraphProps {
|
|
|
206
184
|
*/
|
|
207
185
|
declare const TimeSeriesGraph: ({ title, series, timeRangeOptions, selectedTimeRange, onTimeRangeChange, summaryItems, showSummary, headerAction, loading, xAxisFormat, }: TimeSeriesGraphProps) => react_jsx_runtime.JSX.Element;
|
|
208
186
|
|
|
209
|
-
export { ChartWidget, type ChartWidgetProps, type DataPoint, type DataSeries,
|
|
187
|
+
export { ChartWidget, type ChartWidgetProps, type DataPoint, type DataSeries, type SummaryItem, SummaryStats, type SummaryStatsProps, type TimeRangeOption, TimeRangeSelect, type TimeRangeSelectProps, TimeSeriesGraph, type TimeSeriesGraphProps };
|
package/dist/charts.js
CHANGED
|
@@ -3,18 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
var _chunkDZXNYLVGjs = require('./chunk-DZXNYLVG.js');
|
|
6
7
|
|
|
7
8
|
|
|
8
|
-
var _chunkKF2Y7HO3js = require('./chunk-KF2Y7HO3.js');
|
|
9
|
-
require('./chunk-AIY6222Q.js');
|
|
10
|
-
require('./chunk-FN5YL4BK.js');
|
|
11
|
-
require('./chunk-ZGCN5WCG.js');
|
|
12
9
|
|
|
13
10
|
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
exports.ChartWidget = _chunkKF2Y7HO3js.ChartWidget; exports.MetricsChart = _chunkKF2Y7HO3js.MetricsChart; exports.PeriodSelect = _chunkKF2Y7HO3js.PeriodSelect; exports.SummaryStats = _chunkKF2Y7HO3js.SummaryStats; exports.TimeRangeSelect = _chunkKF2Y7HO3js.TimeRangeSelect; exports.TimeSeriesGraph = _chunkKF2Y7HO3js.TimeSeriesGraph;
|
|
12
|
+
exports.ChartWidget = _chunkDZXNYLVGjs.ChartWidget; exports.SummaryStats = _chunkDZXNYLVGjs.SummaryStats; exports.TimeRangeSelect = _chunkDZXNYLVGjs.TimeRangeSelect; exports.TimeSeriesGraph = _chunkDZXNYLVGjs.TimeSeriesGraph;
|
|
20
13
|
//# sourceMappingURL=charts.js.map
|
package/dist/charts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cere-design-system/cere-design-system/dist/charts.js"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cere-design-system/cere-design-system/dist/charts.js"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,sDAA4B;AAC5B;AACE;AACA;AACA;AACA;AACF,iOAAC","file":"/home/runner/work/cere-design-system/cere-design-system/dist/charts.js"}
|
package/dist/charts.mjs
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ChartWidget,
|
|
3
|
-
MetricsChart,
|
|
4
|
-
PeriodSelect,
|
|
5
3
|
SummaryStats,
|
|
6
4
|
TimeRangeSelect,
|
|
7
5
|
TimeSeriesGraph
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-QD6RLAO2.mjs";
|
|
10
|
-
import "./chunk-ATIFLPH6.mjs";
|
|
11
|
-
import "./chunk-PWF2NJDB.mjs";
|
|
6
|
+
} from "./chunk-BT7XUTT5.mjs";
|
|
12
7
|
export {
|
|
13
8
|
ChartWidget,
|
|
14
|
-
MetricsChart,
|
|
15
|
-
PeriodSelect,
|
|
16
9
|
SummaryStats,
|
|
17
10
|
TimeRangeSelect,
|
|
18
11
|
TimeSeriesGraph
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkARSCL4ZZjs = require('./chunk-ARSCL4ZZ.js'); var _chunkARSCL4ZZjs2 = _interopRequireDefault(_chunkARSCL4ZZjs);
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkJBHRAAN3js = require('./chunk-JBHRAAN3.js');
|
|
@@ -9,7 +9,7 @@ var _chunkJBHRAAN3js = require('./chunk-JBHRAAN3.js');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkXZZZ4MZVjs = require('./chunk-XZZZ4MZV.js');
|
|
13
13
|
|
|
14
14
|
// src/components/inputs/CopyableField.tsx
|
|
15
15
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
@@ -17,41 +17,41 @@ var _Box = require('@mui/material/Box'); var _Box2 = _interopRequireDefault(_Box
|
|
|
17
17
|
var _styles = require('@mui/material/styles');
|
|
18
18
|
var _jsxruntime = require('react/jsx-runtime');
|
|
19
19
|
var ValueButton = _styles.styled.call(void 0, "button")({
|
|
20
|
-
fontFamily:
|
|
20
|
+
fontFamily: _chunkXZZZ4MZVjs.fontFamilyMono,
|
|
21
21
|
fontSize: "11.5px",
|
|
22
22
|
fontWeight: 400,
|
|
23
23
|
lineHeight: 1.45,
|
|
24
24
|
padding: "8px 10px",
|
|
25
25
|
borderRadius: "8px",
|
|
26
|
-
backgroundColor:
|
|
27
|
-
border: `1px solid ${
|
|
28
|
-
color:
|
|
26
|
+
backgroundColor: _chunkXZZZ4MZVjs.webSurfaceTokens.surfaceMid,
|
|
27
|
+
border: `1px solid ${_chunkXZZZ4MZVjs.webSurfaceTokens.strokeOnLow}`,
|
|
28
|
+
color: _chunkXZZZ4MZVjs.webSurfaceTokens.textSecondary,
|
|
29
29
|
wordBreak: "break-all",
|
|
30
30
|
display: "block",
|
|
31
31
|
width: "100%",
|
|
32
32
|
textAlign: "left",
|
|
33
33
|
cursor: "pointer",
|
|
34
34
|
appearance: "none",
|
|
35
|
-
transition: `background ${
|
|
36
|
-
border-color ${
|
|
37
|
-
color ${
|
|
35
|
+
transition: `background ${_chunkXZZZ4MZVjs.motion.dur.fast} ${_chunkXZZZ4MZVjs.motion.ease.standard},
|
|
36
|
+
border-color ${_chunkXZZZ4MZVjs.motion.dur.fast} ${_chunkXZZZ4MZVjs.motion.ease.standard},
|
|
37
|
+
color ${_chunkXZZZ4MZVjs.motion.dur.fast} ${_chunkXZZZ4MZVjs.motion.ease.standard}`,
|
|
38
38
|
"&:hover": {
|
|
39
|
-
backgroundColor:
|
|
40
|
-
borderColor:
|
|
41
|
-
color:
|
|
39
|
+
backgroundColor: _chunkXZZZ4MZVjs.webSurfaceTokens.surfaceContrast,
|
|
40
|
+
borderColor: _chunkXZZZ4MZVjs.webSurfaceTokens.strokeOnMed,
|
|
41
|
+
color: _chunkXZZZ4MZVjs.webSurfaceTokens.textPrimary
|
|
42
42
|
},
|
|
43
43
|
"&:active": {
|
|
44
44
|
transform: "translateY(1px)"
|
|
45
45
|
},
|
|
46
46
|
"&:focus-visible": {
|
|
47
47
|
outline: "none",
|
|
48
|
-
boxShadow:
|
|
48
|
+
boxShadow: _chunkXZZZ4MZVjs.webSurfaceTokens.shadowFocus
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
var FlashLabel = _styles.styled.call(void 0, "span")({
|
|
52
52
|
fontSize: "11px",
|
|
53
53
|
fontWeight: 600,
|
|
54
|
-
color:
|
|
54
|
+
color: _chunkXZZZ4MZVjs.webSurfaceTokens.cVioletDark,
|
|
55
55
|
letterSpacing: "0.04em",
|
|
56
56
|
"@media (prefers-reduced-motion: no-preference)": {
|
|
57
57
|
animation: "cere-copyable-flash 180ms ease-out"
|
|
@@ -81,7 +81,7 @@ var CopyableField = _react2.default.forwardRef(
|
|
|
81
81
|
} catch (e2) {
|
|
82
82
|
}
|
|
83
83
|
}, [value, onCopy, flashDurationMs]);
|
|
84
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
84
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkARSCL4ZZjs.Card, { ref, variant: "tinted", sx: { p: 1.75 }, children: [
|
|
85
85
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
86
86
|
_Box2.default,
|
|
87
87
|
{
|
|
@@ -94,7 +94,7 @@ var CopyableField = _react2.default.forwardRef(
|
|
|
94
94
|
minHeight: label || copied ? void 0 : 0
|
|
95
95
|
},
|
|
96
96
|
children: [
|
|
97
|
-
label ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
97
|
+
label ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkARSCL4ZZjs2.default, { variant: "overline", children: label }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", {}),
|
|
98
98
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, FlashLabel, { role: "status", "aria-live": "polite", "aria-atomic": "true", children: copied ? flashLabel : "" })
|
|
99
99
|
]
|
|
100
100
|
}
|
|
@@ -223,26 +223,22 @@ var SearchField = _react2.default.forwardRef(
|
|
|
223
223
|
);
|
|
224
224
|
|
|
225
225
|
// src/components/inputs/FormControl.tsx
|
|
226
|
+
var _FormControl = require('@mui/material/FormControl'); var _FormControl2 = _interopRequireDefault(_FormControl);
|
|
227
|
+
var _FormLabel = require('@mui/material/FormLabel'); var _FormLabel2 = _interopRequireDefault(_FormLabel);
|
|
228
|
+
var _FormHelperText = require('@mui/material/FormHelperText'); var _FormHelperText2 = _interopRequireDefault(_FormHelperText);
|
|
229
|
+
var _FormControlLabel = require('@mui/material/FormControlLabel'); var _FormControlLabel2 = _interopRequireDefault(_FormControlLabel);
|
|
230
|
+
var _InputLabel = require('@mui/material/InputLabel'); var _InputLabel2 = _interopRequireDefault(_InputLabel);
|
|
226
231
|
|
|
227
232
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
var _material = require('@mui/material');
|
|
234
|
-
|
|
235
233
|
// src/components/inputs/ToggleButton.tsx
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
234
|
+
var _ToggleButton = require('@mui/material/ToggleButton'); var _ToggleButton2 = _interopRequireDefault(_ToggleButton);
|
|
235
|
+
var _ToggleButtonGroup = require('@mui/material/ToggleButtonGroup'); var _ToggleButtonGroup2 = _interopRequireDefault(_ToggleButtonGroup);
|
|
240
236
|
|
|
241
237
|
|
|
242
238
|
var ToggleButton = (props) => {
|
|
243
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
239
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ToggleButton2.default, { ...props });
|
|
244
240
|
};
|
|
245
|
-
var StyledToggleButtonGroup = _styles.styled.call(void 0, (0,
|
|
241
|
+
var StyledToggleButtonGroup = _styles.styled.call(void 0, (0, _ToggleButtonGroup2.default))(({ theme }) => ({
|
|
246
242
|
"& .MuiToggleButton-root": {
|
|
247
243
|
border: `1px solid ${theme.palette.grey[300]}`,
|
|
248
244
|
"&.Mui-selected": {
|
|
@@ -330,7 +326,7 @@ var Switch = ({
|
|
|
330
326
|
// src/components/inputs/Checkbox.tsx
|
|
331
327
|
var _Checkbox = require('@mui/material/Checkbox'); var _Checkbox2 = _interopRequireDefault(_Checkbox);
|
|
332
328
|
|
|
333
|
-
|
|
329
|
+
|
|
334
330
|
|
|
335
331
|
var StyledCheckbox = _styles.styled.call(void 0, (0, _Checkbox2.default))(({ theme }) => ({
|
|
336
332
|
color: theme.palette.grey[400],
|
|
@@ -486,5 +482,5 @@ var DateRangePicker = ({
|
|
|
486
482
|
|
|
487
483
|
|
|
488
484
|
|
|
489
|
-
exports.CopyableField = CopyableField; exports.useSearchHotkeys = useSearchHotkeys; exports.SearchField = SearchField; exports.
|
|
490
|
-
//# sourceMappingURL=chunk-
|
|
485
|
+
exports.CopyableField = CopyableField; exports.useSearchHotkeys = useSearchHotkeys; exports.SearchField = SearchField; exports.default = _FormControl2.default; exports.default2 = _FormLabel2.default; exports.default3 = _FormHelperText2.default; exports.default4 = _FormControlLabel2.default; exports.default5 = _InputLabel2.default; exports.default6 = _InputAdornment2.default; exports.ToggleButton = ToggleButton; exports.ToggleButtonGroup = ToggleButtonGroup; exports.Switch = Switch; exports.Checkbox = Checkbox; exports.RadioGroup = _RadioGroup2.default; exports.Radio = Radio; exports.DateRangePicker = DateRangePicker;
|
|
486
|
+
//# sourceMappingURL=chunk-2KDN37PQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cere-design-system/cere-design-system/dist/chunk-2KDN37PQ.js","../src/components/inputs/CopyableField.tsx","../src/components/inputs/SearchField.tsx","../src/components/inputs/useSearchHotkeys.ts","../src/components/inputs/FormControl.tsx","../src/components/inputs/ToggleButton.tsx","../src/components/inputs/Switch.tsx","../src/components/inputs/Checkbox.tsx","../src/components/inputs/Radio.tsx","../src/components/inputs/DateRangePicker/DateRangePicker.tsx"],"names":["jsx","Box","FormControlLabel"],"mappings":"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","file":"/home/runner/work/cere-design-system/cere-design-system/dist/chunk-2KDN37PQ.js","sourcesContent":[null,"import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport Box from '@mui/material/Box';\nimport { styled } from '@mui/material/styles';\nimport { Card } from '../layout/Card';\nimport { Typography } from '../layout/Typography';\nimport {\n fontFamilyMono,\n} from '../../theme/typography';\nimport { motion } from '../../theme/motion';\nimport { webSurfaceTokens } from '../../theme/webSurfaceTokens';\n\nexport interface CopyableFieldProps {\n /** The string copied to the clipboard. Also rendered as the button label. */\n value: string;\n /** Small label rendered above the value (overline-styled). */\n label?: React.ReactNode;\n /** Custom aria-label; defaults to \"Copy {value}\". */\n ariaLabel?: string;\n /** How long the \"Copied\" flash stays visible, in ms. @default 1400 */\n flashDurationMs?: number;\n /** Text shown during the flash. @default \"Copied\" */\n flashLabel?: string;\n /** Optional callback invoked after a successful copy. */\n onCopy?: (value: string) => void;\n}\n\nconst ValueButton = styled('button')({\n fontFamily: fontFamilyMono,\n fontSize: '11.5px',\n fontWeight: 400,\n lineHeight: 1.45,\n padding: '8px 10px',\n borderRadius: '8px',\n backgroundColor: webSurfaceTokens.surfaceMid,\n border: `1px solid ${webSurfaceTokens.strokeOnLow}`,\n color: webSurfaceTokens.textSecondary,\n wordBreak: 'break-all',\n display: 'block',\n width: '100%',\n textAlign: 'left',\n cursor: 'pointer',\n appearance: 'none',\n transition: `background ${motion.dur.fast} ${motion.ease.standard},\n border-color ${motion.dur.fast} ${motion.ease.standard},\n color ${motion.dur.fast} ${motion.ease.standard}`,\n '&:hover': {\n backgroundColor: webSurfaceTokens.surfaceContrast,\n borderColor: webSurfaceTokens.strokeOnMed,\n color: webSurfaceTokens.textPrimary,\n },\n '&:active': {\n transform: 'translateY(1px)',\n },\n '&:focus-visible': {\n outline: 'none',\n boxShadow: webSurfaceTokens.shadowFocus,\n },\n});\n\nconst FlashLabel = styled('span')({\n fontSize: '11px',\n fontWeight: 600,\n color: webSurfaceTokens.cVioletDark,\n letterSpacing: '0.04em',\n '@media (prefers-reduced-motion: no-preference)': {\n animation: 'cere-copyable-flash 180ms ease-out',\n },\n '@keyframes cere-copyable-flash': {\n from: { opacity: 0, transform: 'translateY(-2px)' },\n to: { opacity: 1, transform: 'translateY(0)' },\n },\n});\n\n/**\n * Tinted card with a label row and a monospace, click-to-copy value button.\n * Replaces ad-hoc `.share-card / .url / .share-card__flash` markup.\n */\nexport const CopyableField = React.forwardRef<HTMLDivElement, CopyableFieldProps>(\n function CopyableField(\n { value, label, ariaLabel, flashDurationMs = 1400, flashLabel = 'Copied', onCopy },\n ref,\n ) {\n const [copied, setCopied] = useState(false);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(\n () => () => {\n if (timerRef.current) clearTimeout(timerRef.current);\n },\n [],\n );\n\n const handleCopy = useCallback(async () => {\n try {\n await navigator.clipboard.writeText(value);\n setCopied(true);\n onCopy?.(value);\n if (timerRef.current) clearTimeout(timerRef.current);\n timerRef.current = setTimeout(() => setCopied(false), flashDurationMs);\n } catch {\n // Clipboard blocked (insecure context / permissions). The value is\n // still visible as plain text — silently no-op.\n }\n }, [value, onCopy, flashDurationMs]);\n\n return (\n <Card ref={ref} variant=\"tinted\" sx={{ p: 1.75 }}>\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 1,\n mb: label || copied ? '6px' : 0,\n minHeight: label || copied ? undefined : 0,\n }}\n >\n {label ? <Typography variant=\"overline\">{label}</Typography> : <span />}\n {/*\n * Live region stays mounted (even when empty) so SRs reliably\n * announce the swap to flashLabel after a copy. The visual flash\n * uses the same node, so we don't double-render the text.\n */}\n <FlashLabel role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n {copied ? flashLabel : ''}\n </FlashLabel>\n </Box>\n <ValueButton\n type=\"button\"\n onClick={handleCopy}\n aria-label={ariaLabel ?? `Copy ${value}`}\n >\n {value}\n </ValueButton>\n </Card>\n );\n },\n);\n","import React, { useEffect, useState } from 'react';\nimport { TextField, TextFieldProps } from './TextField';\nimport SearchIcon from '@mui/icons-material/Search';\nimport InputAdornment from '@mui/material/InputAdornment';\nimport Box from '@mui/material/Box';\nimport { useTheme } from '@mui/material/styles';\nimport { isMacPlatform } from './useSearchHotkeys';\n\nexport type SearchFieldVariant = 'standard' | 'pill';\n\nexport interface SearchFieldProps extends Omit<TextFieldProps, 'InputProps' | 'variant'> {\n placeholder?: string;\n /** Fires with the next input value on every change. */\n onSearch?: (value: string) => void;\n /** Visual treatment. `pill` renders a fully-rounded input. @default 'standard' */\n variant?: SearchFieldVariant;\n /**\n * Show a keyboard-shortcut hint adornment (⌘ K on Mac, Ctrl + K elsewhere) at\n * the right edge. Pair with `useSearchHotkeys` to wire the key handler.\n */\n shortcutHint?: boolean;\n}\n\nconst ShortcutHint = () => {\n // We render nothing on the server (and on the first client render) because\n // we have no reliable SSR signal for platform — `navigator.platform` is only\n // available after hydration. Rendering either default (⌘ or Ctrl) would be\n // wrong roughly half the time, so we accept a one-frame flash and swap to\n // the correct glyph in a post-mount effect. The hint is decorative.\n const [mounted, setMounted] = useState(false);\n useEffect(() => {\n setMounted(true);\n }, []);\n if (!mounted) return null;\n const isMac = isMacPlatform();\n // Mac convention is the cmd glyph + a thin gap before the letter; on other\n // platforms the explicit \"Ctrl + K\" form reads better than \"CtrlK\".\n const label = isMac ? '⌘ K' : 'Ctrl + K';\n return (\n <Box\n component=\"span\"\n aria-hidden\n sx={{\n fontFamily: 'monospace',\n fontSize: 11,\n letterSpacing: 0.4,\n px: 0.75,\n py: 0.25,\n borderRadius: 1,\n border: '1px solid',\n borderColor: 'divider',\n color: 'text.secondary',\n lineHeight: 1,\n }}\n >\n {label}\n </Box>\n );\n};\n\nexport const SearchField = React.forwardRef<HTMLDivElement, SearchFieldProps>(\n function SearchField(\n {\n placeholder = 'Search...',\n onSearch,\n onChange,\n variant = 'standard',\n shortcutHint = false,\n sx,\n ...props\n },\n ref,\n ) {\n const theme = useTheme();\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(e);\n onSearch?.(e.target.value);\n };\n\n const pillInputSx =\n variant === 'pill'\n ? { borderRadius: '999px', paddingRight: '6px' }\n : undefined;\n\n return (\n <TextField\n ref={ref}\n placeholder={placeholder}\n onChange={handleChange}\n sx={sx}\n slotProps={{\n input: {\n ...(pillInputSx ? { sx: pillInputSx } : {}),\n startAdornment: (\n <InputAdornment position=\"start\">\n <SearchIcon style={{ fontSize: 18, color: theme.palette.text.disabled }} />\n </InputAdornment>\n ),\n endAdornment: shortcutHint ? (\n <InputAdornment position=\"end\">\n <ShortcutHint />\n </InputAdornment>\n ) : undefined,\n },\n }}\n {...props}\n />\n );\n },\n);\n","import { RefObject, useEffect } from 'react';\n\nexport interface UseSearchHotkeysOptions {\n /** Cmd/Ctrl + K focuses the ref. @default true */\n k?: boolean;\n /** `/` (when not already typing in another field) focuses the ref. @default true */\n slash?: boolean;\n}\n\n/** Detect Mac via the modern `userAgentData.platform`, falling back to `navigator.platform`. */\nexport function isMacPlatform(): boolean {\n if (typeof navigator === 'undefined') return false;\n const uaDataPlatform = (navigator as Navigator & { userAgentData?: { platform?: string } })\n .userAgentData?.platform;\n if (typeof uaDataPlatform === 'string') return /mac/i.test(uaDataPlatform);\n return /Mac|iPhone|iPad|iPod/i.test(navigator.platform);\n}\n\n/**\n * Wire global Cmd+K (Mac) / Ctrl+K (everywhere else) and `/` hotkeys to focus\n * the input pointed to by `inputRef`. The `/` hotkey is suppressed while the\n * user is typing in another input, textarea or contentEditable element so it\n * doesn't hijack normal typing. Either hotkey can be disabled via options.\n */\nexport function useSearchHotkeys(\n inputRef: RefObject<HTMLInputElement | null>,\n options: UseSearchHotkeysOptions = {},\n) {\n const { k: enableK = true, slash: enableSlash = true } = options;\n\n useEffect(() => {\n if (!enableK && !enableSlash) return;\n const mac = isMacPlatform();\n function onKeyDown(event: KeyboardEvent) {\n if (enableK && event.key.toLowerCase() === 'k') {\n // Mac users press Cmd-K (metaKey); Ctrl-K is reserved for kill-to-end-of-line.\n // Everyone else uses Ctrl-K. Exclude Shift/Alt so we don't hijack browser\n // shortcuts like Cmd+Shift+K (Chrome dev tools tab).\n const correctMod = mac ? event.metaKey && !event.ctrlKey : event.ctrlKey && !event.metaKey;\n if (correctMod && !event.shiftKey && !event.altKey) {\n event.preventDefault();\n inputRef.current?.focus();\n return;\n }\n }\n if (enableSlash && event.key === '/') {\n const target = event.target as HTMLElement | null;\n const typingInField =\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n (target?.isContentEditable ?? false);\n if (!typingInField) {\n event.preventDefault();\n inputRef.current?.focus();\n }\n }\n }\n window.addEventListener('keydown', onKeyDown);\n return () => window.removeEventListener('keydown', onKeyDown);\n }, [inputRef, enableK, enableSlash]);\n}\n","export { default as FormControl } from '@mui/material/FormControl';\nexport type { FormControlProps } from '@mui/material/FormControl';\nexport { default as FormLabel } from '@mui/material/FormLabel';\nexport type { FormLabelProps } from '@mui/material/FormLabel';\nexport { default as FormHelperText } from '@mui/material/FormHelperText';\nexport type { FormHelperTextProps } from '@mui/material/FormHelperText';\nexport { default as FormControlLabel } from '@mui/material/FormControlLabel';\nexport type { FormControlLabelProps } from '@mui/material/FormControlLabel';\nexport { default as InputLabel } from '@mui/material/InputLabel';\nexport type { InputLabelProps } from '@mui/material/InputLabel';\nexport { default as InputAdornment } from '@mui/material/InputAdornment';\nexport type { InputAdornmentProps } from '@mui/material/InputAdornment';\n\n","import React from 'react';\nimport MuiToggleButton from '@mui/material/ToggleButton';\nimport type { ToggleButtonProps as MuiToggleButtonProps } from '@mui/material/ToggleButton';\nimport MuiToggleButtonGroup from '@mui/material/ToggleButtonGroup';\nimport type { ToggleButtonGroupProps as MuiToggleButtonGroupProps } from '@mui/material/ToggleButtonGroup';\nimport { styled } from '@mui/material/styles';\n\nexport type ToggleButtonProps = MuiToggleButtonProps\n\nexport const ToggleButton: React.FC<ToggleButtonProps> = (props) => {\n return <MuiToggleButton {...props} />;\n};\n\nexport type ToggleButtonGroupProps = MuiToggleButtonGroupProps\n\nconst StyledToggleButtonGroup = styled(MuiToggleButtonGroup)(({ theme }) => ({\n '& .MuiToggleButton-root': {\n border: `1px solid ${theme.palette.grey[300]}`,\n '&.Mui-selected': {\n backgroundColor: theme.palette.primary.main,\n color: theme.palette.primary.contrastText,\n '&:hover': {\n backgroundColor: theme.palette.primary.light,\n },\n },\n '&:hover': {\n backgroundColor: theme.palette.grey[50],\n },\n },\n}));\n\nexport const ToggleButtonGroup: React.FC<ToggleButtonGroupProps> = (props) => {\n return <StyledToggleButtonGroup {...props} />;\n};\n\n","import React from 'react';\nimport MuiSwitch, { SwitchProps as MuiSwitchProps } from '@mui/material/Switch';\nimport { styled } from '@mui/material/styles';\n\nexport interface SwitchProps extends MuiSwitchProps {\n label?: string;\n labelPosition?: 'left' | 'right';\n}\n\nconst StyledSwitch = styled(MuiSwitch)(({ theme }) => ({\n width: 44,\n height: 24,\n padding: 0,\n '& .MuiSwitch-switchBase': {\n padding: 0,\n margin: 2,\n transitionDuration: '300ms',\n '&.Mui-checked': {\n transform: 'translateX(20px)',\n color: theme.palette.common.white,\n '& + .MuiSwitch-track': {\n backgroundColor: theme.palette.success.main,\n opacity: 1,\n border: 0,\n },\n '&.Mui-disabled + .MuiSwitch-track': {\n opacity: 0.5,\n },\n },\n '&.Mui-focusVisible .MuiSwitch-thumb': {\n color: theme.palette.success.main,\n border: `6px solid ${theme.palette.common.white}`,\n },\n '&.Mui-disabled .MuiSwitch-thumb': {\n color: theme.palette.grey[300],\n },\n '&.Mui-disabled + .MuiSwitch-track': {\n opacity: 0.5,\n backgroundColor: theme.palette.grey[300],\n },\n },\n '& .MuiSwitch-thumb': {\n boxSizing: 'border-box',\n width: 20,\n height: 20,\n },\n '& .MuiSwitch-track': {\n borderRadius: 24 / 2,\n backgroundColor: theme.palette.grey[300],\n opacity: 1,\n transition: theme.transitions.create(['background-color'], {\n duration: 500,\n }),\n },\n}));\n\nexport const Switch: React.FC<SwitchProps> = ({\n label,\n labelPosition = 'right',\n ...props\n}) => {\n const switchComponent = <StyledSwitch {...props} />;\n\n if (!label) {\n return switchComponent;\n }\n\n return (\n <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>\n {labelPosition === 'left' && <span>{label}</span>}\n {switchComponent}\n {labelPosition === 'right' && <span>{label}</span>}\n </div>\n );\n};\n\n","import React from 'react';\nimport MuiCheckbox, { CheckboxProps as MuiCheckboxProps } from '@mui/material/Checkbox';\nimport { styled } from '@mui/material/styles';\nimport FormControlLabel from '@mui/material/FormControlLabel';\n\n/**\n * **Prop-forwarding note.**\n *\n * When `label` is absent, all props (including `sx` and `className`) are\n * forwarded directly to the inner `<Checkbox>` element.\n *\n * When `label` is provided, the component renders:\n * ```\n * <FormControlLabel control={<Checkbox {...props} />} label={label} />\n * ```\n * `sx` and `className` from the spread go to the inner `<Checkbox>`, NOT to\n * the outer `<FormControlLabel>`. If you need to style the label wrapper,\n * use MUI's `FormControlLabel` directly and pass `<Checkbox />` as `control`.\n */\nexport interface CheckboxProps extends Omit<MuiCheckboxProps, 'color'> {\n label?: string;\n labelPosition?: 'left' | 'right';\n}\n\nconst StyledCheckbox = styled(MuiCheckbox)(({ theme }) => ({\n color: theme.palette.grey[400],\n '&.Mui-checked': {\n color: theme.palette.primary.main,\n },\n '&.MuiCheckbox-indeterminate': {\n color: theme.palette.primary.main,\n },\n '&.Mui-disabled': {\n color: theme.palette.grey[300],\n },\n '&:hover': {\n backgroundColor: theme.palette.background.selected,\n },\n '&.Mui-focusVisible': {\n outline: `2px solid ${theme.palette.primary.main}`,\n outlineOffset: 2,\n },\n}));\n\nexport const Checkbox: React.FC<CheckboxProps> = ({\n label,\n labelPosition = 'right',\n ...props\n}) => {\n const checkboxComponent = <StyledCheckbox {...props} />;\n\n if (!label) {\n return checkboxComponent;\n }\n\n const labelPlacementMap: Record<string, 'start' | 'end' | 'top' | 'bottom'> = {\n left: 'start',\n right: 'end',\n };\n\n return (\n <FormControlLabel\n control={checkboxComponent}\n label={label}\n labelPlacement={labelPlacementMap[labelPosition] || 'end'}\n />\n );\n};\n\n","import React from 'react';\nimport MuiRadio, { RadioProps as MuiRadioProps } from '@mui/material/Radio';\nimport { styled } from '@mui/material/styles';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport RadioGroup from '@mui/material/RadioGroup';\n\nexport interface RadioProps extends Omit<MuiRadioProps, 'color'> {\n label?: string;\n labelPosition?: 'left' | 'right';\n}\n\nconst StyledRadio = styled(MuiRadio)(({ theme }) => ({\n color: theme.palette.grey[400],\n '&.Mui-checked': {\n color: theme.palette.primary.main,\n },\n '&.Mui-disabled': {\n color: theme.palette.grey[300],\n },\n '&:hover': {\n backgroundColor: theme.palette.background.selected,\n },\n '&.Mui-focusVisible': {\n outline: `2px solid ${theme.palette.primary.main}`,\n outlineOffset: 2,\n },\n}));\n\nexport const Radio: React.FC<RadioProps> = ({\n label,\n labelPosition = 'right',\n ...props\n}) => {\n const radioComponent = <StyledRadio {...props} />;\n\n if (!label) {\n return radioComponent;\n }\n\n const labelPlacementMap: Record<string, 'start' | 'end' | 'top' | 'bottom'> = {\n left: 'start',\n right: 'end',\n };\n\n return (\n <FormControlLabel\n control={radioComponent}\n label={label}\n labelPlacement={labelPlacementMap[labelPosition] || 'end'}\n />\n );\n};\n\nexport { RadioGroup };\n\n","import React from 'react';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\nimport { DatePicker } from '@mui/x-date-pickers/DatePicker';\nimport { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';\nimport { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3';\n\n/** Props for the DateRangePicker component. */\nexport interface DateRangePickerProps {\n /** The selected start date, or null if unset. */\n startDate: Date | null;\n /** The selected end date, or null if unset. */\n endDate: Date | null;\n /** Callback fired when the start date changes. */\n onStartDateChange: (date: Date | null) => void;\n /** Callback fired when the end date changes. */\n onEndDateChange: (date: Date | null) => void;\n /** Earliest selectable date for both pickers. */\n minDate?: Date;\n /** Latest selectable date for both pickers. */\n maxDate?: Date;\n /** If true, both date pickers are disabled. @default false */\n disabled?: boolean;\n /** Size of the text field inputs. @default 'small' */\n size?: 'small' | 'medium';\n}\n\nexport const DateRangePicker: React.FC<DateRangePickerProps> = ({\n startDate,\n endDate,\n onStartDateChange,\n onEndDateChange,\n minDate,\n maxDate,\n disabled = false,\n size = 'small',\n}) => {\n return (\n <LocalizationProvider dateAdapter={AdapterDateFns}>\n <Stack direction=\"row\" spacing={1} alignItems=\"center\">\n <DatePicker\n label=\"Start date\"\n value={startDate}\n onChange={onStartDateChange}\n minDate={minDate}\n maxDate={endDate ?? maxDate}\n disabled={disabled}\n slotProps={{\n textField: { size },\n }}\n />\n <Typography variant=\"body2\" color=\"text.secondary\">\n –\n </Typography>\n <DatePicker\n label=\"End date\"\n value={endDate}\n onChange={onEndDateChange}\n minDate={startDate ?? minDate}\n maxDate={maxDate}\n disabled={disabled}\n slotProps={{\n textField: { size },\n }}\n />\n </Stack>\n </LocalizationProvider>\n );\n};\n"]}
|