@cere/cere-design-system 0.0.45 → 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.
Files changed (164) hide show
  1. package/README.md +76 -0
  2. package/dist/buttons.d.mts +119 -0
  3. package/dist/buttons.d.ts +119 -0
  4. package/dist/buttons.js +19 -0
  5. package/dist/buttons.js.map +1 -0
  6. package/dist/buttons.mjs +19 -0
  7. package/dist/buttons.mjs.map +1 -0
  8. package/dist/carousel.d.mts +51 -0
  9. package/dist/carousel.d.ts +51 -0
  10. package/dist/carousel.js +185 -0
  11. package/dist/carousel.js.map +1 -0
  12. package/dist/carousel.mjs +185 -0
  13. package/dist/carousel.mjs.map +1 -0
  14. package/dist/charts.d.mts +187 -0
  15. package/dist/charts.d.ts +187 -0
  16. package/dist/charts.js +13 -0
  17. package/dist/charts.js.map +1 -0
  18. package/dist/charts.mjs +13 -0
  19. package/dist/charts.mjs.map +1 -0
  20. package/dist/chunk-2EBCST6X.js +25 -0
  21. package/dist/chunk-2EBCST6X.js.map +1 -0
  22. package/dist/chunk-2KDN37PQ.js +486 -0
  23. package/dist/chunk-2KDN37PQ.js.map +1 -0
  24. package/dist/chunk-34LFXT6C.mjs +486 -0
  25. package/dist/chunk-34LFXT6C.mjs.map +1 -0
  26. package/dist/chunk-3KCXCVOX.mjs +411 -0
  27. package/dist/chunk-3KCXCVOX.mjs.map +1 -0
  28. package/dist/chunk-4OKTICU5.js +374 -0
  29. package/dist/chunk-4OKTICU5.js.map +1 -0
  30. package/dist/chunk-5ASG6G6U.mjs +40 -0
  31. package/dist/chunk-5ASG6G6U.mjs.map +1 -0
  32. package/dist/chunk-72TQ56EP.js +280 -0
  33. package/dist/chunk-72TQ56EP.js.map +1 -0
  34. package/dist/chunk-7KXKK2RE.js +43 -0
  35. package/dist/chunk-7KXKK2RE.js.map +1 -0
  36. package/dist/chunk-ARSCL4ZZ.js +111 -0
  37. package/dist/chunk-ARSCL4ZZ.js.map +1 -0
  38. package/dist/chunk-AWVNEU6R.mjs +1478 -0
  39. package/dist/chunk-AWVNEU6R.mjs.map +1 -0
  40. package/dist/chunk-BH4FNZKK.mjs +1472 -0
  41. package/dist/chunk-BH4FNZKK.mjs.map +1 -0
  42. package/dist/chunk-BIZK6FUD.js +37 -0
  43. package/dist/chunk-BIZK6FUD.js.map +1 -0
  44. package/dist/chunk-BOQPWZIB.mjs +147 -0
  45. package/dist/chunk-BOQPWZIB.mjs.map +1 -0
  46. package/dist/chunk-BT7XUTT5.mjs +392 -0
  47. package/dist/chunk-BT7XUTT5.mjs.map +1 -0
  48. package/dist/chunk-D7D25O6E.mjs +280 -0
  49. package/dist/chunk-D7D25O6E.mjs.map +1 -0
  50. package/dist/chunk-DRGMEIPT.mjs +162 -0
  51. package/dist/chunk-DRGMEIPT.mjs.map +1 -0
  52. package/dist/chunk-DZXNYLVG.js +392 -0
  53. package/dist/chunk-DZXNYLVG.js.map +1 -0
  54. package/dist/chunk-GR52ENYI.mjs +527 -0
  55. package/dist/chunk-GR52ENYI.mjs.map +1 -0
  56. package/dist/chunk-GTBKQXXI.js +1472 -0
  57. package/dist/chunk-GTBKQXXI.js.map +1 -0
  58. package/dist/chunk-HJ24WKU4.js +120 -0
  59. package/dist/chunk-HJ24WKU4.js.map +1 -0
  60. package/dist/chunk-JBHRAAN3.js +31 -0
  61. package/dist/chunk-JBHRAAN3.js.map +1 -0
  62. package/dist/chunk-KKIKOIMP.js +1478 -0
  63. package/dist/chunk-KKIKOIMP.js.map +1 -0
  64. package/dist/chunk-LVJSKRX3.js +147 -0
  65. package/dist/chunk-LVJSKRX3.js.map +1 -0
  66. package/dist/chunk-OWWDNDF4.js +40 -0
  67. package/dist/chunk-OWWDNDF4.js.map +1 -0
  68. package/dist/chunk-PFZZJZ64.js +162 -0
  69. package/dist/chunk-PFZZJZ64.js.map +1 -0
  70. package/dist/chunk-PHMNZK2R.mjs +18 -0
  71. package/dist/chunk-PHMNZK2R.mjs.map +1 -0
  72. package/dist/chunk-POCAW2G4.mjs +111 -0
  73. package/dist/chunk-POCAW2G4.mjs.map +1 -0
  74. package/dist/chunk-QBCRH7YF.mjs +37 -0
  75. package/dist/chunk-QBCRH7YF.mjs.map +1 -0
  76. package/dist/chunk-QCFLZ7X3.js +527 -0
  77. package/dist/chunk-QCFLZ7X3.js.map +1 -0
  78. package/dist/chunk-SG2TD7FQ.mjs +374 -0
  79. package/dist/chunk-SG2TD7FQ.mjs.map +1 -0
  80. package/dist/chunk-SSFALO6S.mjs +120 -0
  81. package/dist/chunk-SSFALO6S.mjs.map +1 -0
  82. package/dist/chunk-U2QHFISG.js +18 -0
  83. package/dist/chunk-U2QHFISG.js.map +1 -0
  84. package/dist/chunk-UPGFBPFX.mjs +25 -0
  85. package/dist/chunk-UPGFBPFX.mjs.map +1 -0
  86. package/dist/chunk-WC2TCWXK.mjs +445 -0
  87. package/dist/chunk-WC2TCWXK.mjs.map +1 -0
  88. package/dist/chunk-XZZZ4MZV.js +445 -0
  89. package/dist/chunk-XZZZ4MZV.js.map +1 -0
  90. package/dist/chunk-YCDCQSYH.js +411 -0
  91. package/dist/chunk-YCDCQSYH.js.map +1 -0
  92. package/dist/chunk-ZDAZYIXB.mjs +43 -0
  93. package/dist/chunk-ZDAZYIXB.mjs.map +1 -0
  94. package/dist/chunk-ZP26PGMS.mjs +31 -0
  95. package/dist/chunk-ZP26PGMS.mjs.map +1 -0
  96. package/dist/feedback.d.mts +368 -0
  97. package/dist/feedback.d.ts +368 -0
  98. package/dist/feedback.js +43 -0
  99. package/dist/feedback.js.map +1 -0
  100. package/dist/feedback.mjs +43 -0
  101. package/dist/feedback.mjs.map +1 -0
  102. package/dist/fonts/HumanSans-BlackOblique.otf +0 -0
  103. package/dist/fonts/HumanSans-Thin.otf +0 -0
  104. package/dist/fonts/HumanSans-ThinOblique.otf +0 -0
  105. package/dist/fonts/human-sans-font.css +88 -0
  106. package/dist/fonts/human-sans.css +3 -0
  107. package/dist/fonts/inter.css +3 -0
  108. package/dist/icons.d.mts +21 -0
  109. package/dist/icons.d.ts +21 -0
  110. package/dist/icons.js +23 -0
  111. package/dist/icons.js.map +1 -0
  112. package/dist/icons.mjs +23 -0
  113. package/dist/icons.mjs.map +1 -0
  114. package/dist/index.d.mts +196 -3082
  115. package/dist/index.d.ts +196 -3082
  116. package/dist/index.js +253 -10082
  117. package/dist/index.js.map +1 -1
  118. package/dist/index.mjs +229 -10017
  119. package/dist/index.mjs.map +1 -1
  120. package/dist/inputs.d.mts +129 -0
  121. package/dist/inputs.d.ts +129 -0
  122. package/dist/inputs.js +43 -0
  123. package/dist/inputs.js.map +1 -0
  124. package/dist/inputs.mjs +43 -0
  125. package/dist/inputs.mjs.map +1 -0
  126. package/dist/layout.d.mts +681 -0
  127. package/dist/layout.d.ts +681 -0
  128. package/dist/layout.js +98 -0
  129. package/dist/layout.js.map +1 -0
  130. package/dist/layout.mjs +98 -0
  131. package/dist/layout.mjs.map +1 -0
  132. package/dist/navigation.d.mts +611 -0
  133. package/dist/navigation.d.ts +611 -0
  134. package/dist/navigation.js +54 -0
  135. package/dist/navigation.js.map +1 -0
  136. package/dist/navigation.mjs +54 -0
  137. package/dist/navigation.mjs.map +1 -0
  138. package/dist/third-party.d.mts +113 -0
  139. package/dist/third-party.d.ts +113 -0
  140. package/dist/third-party.js +7 -0
  141. package/dist/third-party.js.map +1 -0
  142. package/dist/third-party.mjs +7 -0
  143. package/dist/third-party.mjs.map +1 -0
  144. package/dist/tokens.css +45 -71
  145. package/dist/utilities.d.mts +39 -0
  146. package/dist/utilities.d.ts +39 -0
  147. package/dist/utilities.js +17 -0
  148. package/dist/utilities.js.map +1 -0
  149. package/dist/utilities.mjs +17 -0
  150. package/dist/utilities.mjs.map +1 -0
  151. package/package.json +76 -8
  152. package/dist/index.css +0 -79
  153. package/dist/index.css.map +0 -1
  154. /package/dist/{HumanSans-Black-C4YJONK7.otf → fonts/HumanSans-Black.otf} +0 -0
  155. /package/dist/{HumanSans-Bold-4EAJ3L3T.otf → fonts/HumanSans-Bold.otf} +0 -0
  156. /package/dist/{HumanSans-BoldOblique-4D325T4F.otf → fonts/HumanSans-BoldOblique.otf} +0 -0
  157. /package/dist/{HumanSans-ExtraLight-VL7DEKQ4.otf → fonts/HumanSans-ExtraLight.otf} +0 -0
  158. /package/dist/{HumanSans-ExtraLightOblique-VK2JTUXF.otf → fonts/HumanSans-ExtraLightOblique.otf} +0 -0
  159. /package/dist/{HumanSans-Light-YV7AFKRB.otf → fonts/HumanSans-Light.otf} +0 -0
  160. /package/dist/{HumanSans-LightOblique-VIXV7QA6.otf → fonts/HumanSans-LightOblique.otf} +0 -0
  161. /package/dist/{HumanSans-Medium-UULJ3PIR.otf → fonts/HumanSans-Medium.otf} +0 -0
  162. /package/dist/{HumanSans-MediumOblique-M7FHDZRS.otf → fonts/HumanSans-MediumOblique.otf} +0 -0
  163. /package/dist/{HumanSans-Regular-QMFEP3F6.otf → fonts/HumanSans-Regular.otf} +0 -0
  164. /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)
@@ -0,0 +1,119 @@
1
+ import React__default from 'react';
2
+ import { ButtonProps as ButtonProps$1 } from '@mui/material/Button';
3
+ import { IconButtonProps as IconButtonProps$1 } from '@mui/material/IconButton';
4
+ import { LoadingButtonProps as LoadingButtonProps$1 } from '@mui/lab';
5
+ import { ButtonGroupProps as ButtonGroupProps$1 } from '@mui/material/ButtonGroup';
6
+
7
+ type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
8
+ type ButtonTone = 'default' | 'onGradient';
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';
21
+ /**
22
+ * The visual style variant of the button.
23
+ * - primary: Filled button with primary color background
24
+ * - secondary: Outlined button with transparent background and border
25
+ * - tertiary: Text button with no background or border
26
+ */
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';
35
+ /**
36
+ * Not applicable when tone='onGradient'. Omit this prop.
37
+ * @deprecated Passing variant with tone='onGradient' is a type error.
38
+ */
39
+ variant?: never;
40
+ }
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>>;
44
+
45
+ interface IconButtonProps extends IconButtonProps$1 {
46
+ variant?: 'default' | 'primary' | 'secondary';
47
+ }
48
+ declare const IconButton: React__default.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
49
+
50
+ interface LoadingButtonProps extends LoadingButtonProps$1 {
51
+ /**
52
+ * If `true`, the button will show a loading indicator
53
+ */
54
+ loading?: boolean;
55
+ /**
56
+ * The loading indicator can be positioned inside the button or in the center
57
+ */
58
+ loadingPosition?: 'start' | 'end' | 'center';
59
+ }
60
+ /**
61
+ * LoadingButton component - Button with loading state from MUI Lab
62
+ *
63
+ * @example
64
+ * ```tsx
65
+ * <LoadingButton
66
+ * variant="contained"
67
+ * loading={isLoading}
68
+ * onClick={handleSubmit}
69
+ * >
70
+ * Submit
71
+ * </LoadingButton>
72
+ * ```
73
+ */
74
+ declare const LoadingButton: React__default.ForwardRefExoticComponent<Omit<LoadingButtonProps, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
75
+
76
+ interface ButtonGroupProps extends ButtonGroupProps$1 {
77
+ /**
78
+ * The content of the button group
79
+ */
80
+ children?: React__default.ReactNode;
81
+ /**
82
+ * If `true`, the buttons will be disabled
83
+ */
84
+ disabled?: boolean;
85
+ /**
86
+ * If `true`, the button group will take full width
87
+ */
88
+ fullWidth?: boolean;
89
+ /**
90
+ * The orientation of the button group
91
+ * @default 'horizontal'
92
+ */
93
+ orientation?: 'horizontal' | 'vertical';
94
+ /**
95
+ * The size of the buttons
96
+ * @default 'medium'
97
+ */
98
+ size?: 'small' | 'medium' | 'large';
99
+ /**
100
+ * The variant to use
101
+ * @default 'outlined'
102
+ */
103
+ variant?: 'text' | 'outlined' | 'contained';
104
+ }
105
+ /**
106
+ * ButtonGroup component - groups related buttons together
107
+ *
108
+ * @example
109
+ * ```tsx
110
+ * <ButtonGroup variant="contained">
111
+ * <Button>One</Button>
112
+ * <Button>Two</Button>
113
+ * <Button>Three</Button>
114
+ * </ButtonGroup>
115
+ * ```
116
+ */
117
+ declare const ButtonGroup: React__default.FC<ButtonGroupProps>;
118
+
119
+ export { Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonTone, type ButtonVariant, IconButton, type IconButtonProps, LoadingButton, type LoadingButtonProps };
@@ -0,0 +1,119 @@
1
+ import React__default from 'react';
2
+ import { ButtonProps as ButtonProps$1 } from '@mui/material/Button';
3
+ import { IconButtonProps as IconButtonProps$1 } from '@mui/material/IconButton';
4
+ import { LoadingButtonProps as LoadingButtonProps$1 } from '@mui/lab';
5
+ import { ButtonGroupProps as ButtonGroupProps$1 } from '@mui/material/ButtonGroup';
6
+
7
+ type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
8
+ type ButtonTone = 'default' | 'onGradient';
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';
21
+ /**
22
+ * The visual style variant of the button.
23
+ * - primary: Filled button with primary color background
24
+ * - secondary: Outlined button with transparent background and border
25
+ * - tertiary: Text button with no background or border
26
+ */
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';
35
+ /**
36
+ * Not applicable when tone='onGradient'. Omit this prop.
37
+ * @deprecated Passing variant with tone='onGradient' is a type error.
38
+ */
39
+ variant?: never;
40
+ }
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>>;
44
+
45
+ interface IconButtonProps extends IconButtonProps$1 {
46
+ variant?: 'default' | 'primary' | 'secondary';
47
+ }
48
+ declare const IconButton: React__default.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
49
+
50
+ interface LoadingButtonProps extends LoadingButtonProps$1 {
51
+ /**
52
+ * If `true`, the button will show a loading indicator
53
+ */
54
+ loading?: boolean;
55
+ /**
56
+ * The loading indicator can be positioned inside the button or in the center
57
+ */
58
+ loadingPosition?: 'start' | 'end' | 'center';
59
+ }
60
+ /**
61
+ * LoadingButton component - Button with loading state from MUI Lab
62
+ *
63
+ * @example
64
+ * ```tsx
65
+ * <LoadingButton
66
+ * variant="contained"
67
+ * loading={isLoading}
68
+ * onClick={handleSubmit}
69
+ * >
70
+ * Submit
71
+ * </LoadingButton>
72
+ * ```
73
+ */
74
+ declare const LoadingButton: React__default.ForwardRefExoticComponent<Omit<LoadingButtonProps, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
75
+
76
+ interface ButtonGroupProps extends ButtonGroupProps$1 {
77
+ /**
78
+ * The content of the button group
79
+ */
80
+ children?: React__default.ReactNode;
81
+ /**
82
+ * If `true`, the buttons will be disabled
83
+ */
84
+ disabled?: boolean;
85
+ /**
86
+ * If `true`, the button group will take full width
87
+ */
88
+ fullWidth?: boolean;
89
+ /**
90
+ * The orientation of the button group
91
+ * @default 'horizontal'
92
+ */
93
+ orientation?: 'horizontal' | 'vertical';
94
+ /**
95
+ * The size of the buttons
96
+ * @default 'medium'
97
+ */
98
+ size?: 'small' | 'medium' | 'large';
99
+ /**
100
+ * The variant to use
101
+ * @default 'outlined'
102
+ */
103
+ variant?: 'text' | 'outlined' | 'contained';
104
+ }
105
+ /**
106
+ * ButtonGroup component - groups related buttons together
107
+ *
108
+ * @example
109
+ * ```tsx
110
+ * <ButtonGroup variant="contained">
111
+ * <Button>One</Button>
112
+ * <Button>Two</Button>
113
+ * <Button>Three</Button>
114
+ * </ButtonGroup>
115
+ * ```
116
+ */
117
+ declare const ButtonGroup: React__default.FC<ButtonGroupProps>;
118
+
119
+ export { Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonTone, type ButtonVariant, IconButton, type IconButtonProps, LoadingButton, type LoadingButtonProps };
@@ -0,0 +1,19 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunk7KXKK2REjs = require('./chunk-7KXKK2RE.js');
5
+
6
+
7
+ var _chunkOWWDNDF4js = require('./chunk-OWWDNDF4.js');
8
+
9
+
10
+ var _chunkLVJSKRX3js = require('./chunk-LVJSKRX3.js');
11
+ require('./chunk-72TQ56EP.js');
12
+ require('./chunk-XZZZ4MZV.js');
13
+
14
+
15
+
16
+
17
+
18
+ exports.Button = _chunkLVJSKRX3js.Button; exports.ButtonGroup = _chunk7KXKK2REjs.ButtonGroup; exports.IconButton = _chunkOWWDNDF4js.IconButton; exports.LoadingButton = _chunk7KXKK2REjs.LoadingButton;
19
+ //# sourceMappingURL=buttons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/cere-design-system/cere-design-system/dist/buttons.js"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B,+BAA4B;AAC5B,+BAA4B;AAC5B;AACE;AACA;AACA;AACA;AACF,uMAAC","file":"/home/runner/work/cere-design-system/cere-design-system/dist/buttons.js"}
@@ -0,0 +1,19 @@
1
+ import {
2
+ ButtonGroup,
3
+ LoadingButton
4
+ } from "./chunk-ZDAZYIXB.mjs";
5
+ import {
6
+ IconButton
7
+ } from "./chunk-5ASG6G6U.mjs";
8
+ import {
9
+ Button
10
+ } from "./chunk-BOQPWZIB.mjs";
11
+ import "./chunk-D7D25O6E.mjs";
12
+ import "./chunk-WC2TCWXK.mjs";
13
+ export {
14
+ Button,
15
+ ButtonGroup,
16
+ IconButton,
17
+ LoadingButton
18
+ };
19
+ //# sourceMappingURL=buttons.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,51 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode, Key } from 'react';
3
+ import { SxProps, Theme } from '@mui/material/styles';
4
+ import { EmblaOptionsType } from 'embla-carousel';
5
+
6
+ interface CarouselProps<T> {
7
+ /** Slide data. Each entry is passed to `renderSlide`. */
8
+ slides: T[];
9
+ /** Render function for an individual slide. */
10
+ renderSlide: (item: T, index: number) => ReactNode;
11
+ /**
12
+ * Stable per-slide React key. Always set this when `slides` can be reordered
13
+ * or filtered; otherwise React will reuse the wrong slide's internal state
14
+ * across renders. Defaults to the slide's array index when omitted.
15
+ */
16
+ getKey?: (item: T, index: number) => Key;
17
+ /** Slides visible in the viewport. @default 1 */
18
+ slidesPerView?: number;
19
+ /** Auto-advance every `autoplayDelayMs` while not hovered. @default true */
20
+ autoplay?: boolean;
21
+ /** Autoplay tick in milliseconds. @default 5000 */
22
+ autoplayDelayMs?: number;
23
+ /** Show dot indicators when more than one slide. @default true */
24
+ showDots?: boolean;
25
+ /** Show the `01 / 03`-style counter when more than one slide. @default true */
26
+ showCounter?: boolean;
27
+ /** Show prev/next chevrons when more than one slide. @default true */
28
+ showArrows?: boolean;
29
+ /** Pause autoplay while the pointer is over the carousel. @default true */
30
+ pauseOnHover?: boolean;
31
+ /** Accessible label for the surrounding region. */
32
+ ariaLabel?: string;
33
+ /** Fires with the new index whenever embla selects a slide. */
34
+ onSelect?: (index: number) => void;
35
+ /** Override the IconButton sx for the prev/next arrows. */
36
+ arrowSx?: SxProps<Theme>;
37
+ /** Override the dot color (inactive). Accepts any CSS color string. */
38
+ dotColor?: string;
39
+ /** Override the active dot color. Accepts any CSS color string. */
40
+ dotActiveColor?: string;
41
+ /** Escape hatch for advanced embla options. Most consumers don't need this. */
42
+ emblaOptions?: EmblaOptionsType;
43
+ }
44
+ /**
45
+ * Carousel — embla-carousel-based slide deck with autoplay, dots, counter,
46
+ * prev/next arrows and pause-on-hover. Generic over slide payload type; the
47
+ * caller decides the slide markup via `renderSlide`.
48
+ */
49
+ declare function Carousel<T>({ slides, renderSlide, getKey, slidesPerView, autoplay, autoplayDelayMs, showDots, showCounter, showArrows, pauseOnHover, ariaLabel, onSelect, arrowSx, dotColor, dotActiveColor, emblaOptions, }: CarouselProps<T>): react_jsx_runtime.JSX.Element | null;
50
+
51
+ export { Carousel, type CarouselProps };
@@ -0,0 +1,51 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode, Key } from 'react';
3
+ import { SxProps, Theme } from '@mui/material/styles';
4
+ import { EmblaOptionsType } from 'embla-carousel';
5
+
6
+ interface CarouselProps<T> {
7
+ /** Slide data. Each entry is passed to `renderSlide`. */
8
+ slides: T[];
9
+ /** Render function for an individual slide. */
10
+ renderSlide: (item: T, index: number) => ReactNode;
11
+ /**
12
+ * Stable per-slide React key. Always set this when `slides` can be reordered
13
+ * or filtered; otherwise React will reuse the wrong slide's internal state
14
+ * across renders. Defaults to the slide's array index when omitted.
15
+ */
16
+ getKey?: (item: T, index: number) => Key;
17
+ /** Slides visible in the viewport. @default 1 */
18
+ slidesPerView?: number;
19
+ /** Auto-advance every `autoplayDelayMs` while not hovered. @default true */
20
+ autoplay?: boolean;
21
+ /** Autoplay tick in milliseconds. @default 5000 */
22
+ autoplayDelayMs?: number;
23
+ /** Show dot indicators when more than one slide. @default true */
24
+ showDots?: boolean;
25
+ /** Show the `01 / 03`-style counter when more than one slide. @default true */
26
+ showCounter?: boolean;
27
+ /** Show prev/next chevrons when more than one slide. @default true */
28
+ showArrows?: boolean;
29
+ /** Pause autoplay while the pointer is over the carousel. @default true */
30
+ pauseOnHover?: boolean;
31
+ /** Accessible label for the surrounding region. */
32
+ ariaLabel?: string;
33
+ /** Fires with the new index whenever embla selects a slide. */
34
+ onSelect?: (index: number) => void;
35
+ /** Override the IconButton sx for the prev/next arrows. */
36
+ arrowSx?: SxProps<Theme>;
37
+ /** Override the dot color (inactive). Accepts any CSS color string. */
38
+ dotColor?: string;
39
+ /** Override the active dot color. Accepts any CSS color string. */
40
+ dotActiveColor?: string;
41
+ /** Escape hatch for advanced embla options. Most consumers don't need this. */
42
+ emblaOptions?: EmblaOptionsType;
43
+ }
44
+ /**
45
+ * Carousel — embla-carousel-based slide deck with autoplay, dots, counter,
46
+ * prev/next arrows and pause-on-hover. Generic over slide payload type; the
47
+ * caller decides the slide markup via `renderSlide`.
48
+ */
49
+ declare function Carousel<T>({ slides, renderSlide, getKey, slidesPerView, autoplay, autoplayDelayMs, showDots, showCounter, showArrows, pauseOnHover, ariaLabel, onSelect, arrowSx, dotColor, dotActiveColor, emblaOptions, }: CarouselProps<T>): react_jsx_runtime.JSX.Element | null;
50
+
51
+ export { Carousel, type CarouselProps };
@@ -0,0 +1,185 @@
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; }// src/components/layout/Carousel.tsx
2
+ var _react = require('react');
3
+ var _Box = require('@mui/material/Box'); var _Box2 = _interopRequireDefault(_Box);
4
+ var _IconButton = require('@mui/material/IconButton'); var _IconButton2 = _interopRequireDefault(_IconButton);
5
+ var _Typography = require('@mui/material/Typography'); var _Typography2 = _interopRequireDefault(_Typography);
6
+ var _ChevronLeft = require('@mui/icons-material/ChevronLeft'); var _ChevronLeft2 = _interopRequireDefault(_ChevronLeft);
7
+ var _ChevronRight = require('@mui/icons-material/ChevronRight'); var _ChevronRight2 = _interopRequireDefault(_ChevronRight);
8
+ var _styles = require('@mui/material/styles');
9
+ var _emblacarouselreact = require('embla-carousel-react'); var _emblacarouselreact2 = _interopRequireDefault(_emblacarouselreact);
10
+ var _emblacarouselautoplay = require('embla-carousel-autoplay'); var _emblacarouselautoplay2 = _interopRequireDefault(_emblacarouselautoplay);
11
+ var _jsxruntime = require('react/jsx-runtime');
12
+ var pad2 = (n) => String(n).padStart(2, "0");
13
+ function Carousel({
14
+ slides,
15
+ renderSlide,
16
+ getKey,
17
+ slidesPerView = 1,
18
+ autoplay = true,
19
+ autoplayDelayMs = 5e3,
20
+ showDots = true,
21
+ showCounter = true,
22
+ showArrows = true,
23
+ pauseOnHover = true,
24
+ ariaLabel,
25
+ onSelect,
26
+ arrowSx,
27
+ dotColor,
28
+ dotActiveColor,
29
+ emblaOptions
30
+ }) {
31
+ const plugins = _react.useMemo.call(void 0,
32
+ () => autoplay ? [
33
+ _emblacarouselautoplay2.default.call(void 0, {
34
+ delay: autoplayDelayMs,
35
+ stopOnInteraction: true,
36
+ stopOnMouseEnter: pauseOnHover
37
+ })
38
+ ] : [],
39
+ [autoplay, autoplayDelayMs, pauseOnHover]
40
+ );
41
+ const [emblaRef, emblaApi] = _emblacarouselreact2.default.call(void 0,
42
+ { loop: true, align: "start", ...emblaOptions },
43
+ plugins
44
+ );
45
+ const [selected, setSelected] = _react.useState.call(void 0, 0);
46
+ const [snapCount, setSnapCount] = _react.useState.call(void 0, 0);
47
+ const count = slides.length;
48
+ _react.useEffect.call(void 0, () => {
49
+ if (!emblaApi) return;
50
+ const refreshSnaps = () => {
51
+ setSnapCount(emblaApi.scrollSnapList().length);
52
+ };
53
+ const handleSelect = () => {
54
+ const next = emblaApi.selectedScrollSnap();
55
+ setSelected(next);
56
+ _optionalChain([onSelect, 'optionalCall', _2 => _2(next)]);
57
+ };
58
+ emblaApi.on("select", handleSelect);
59
+ emblaApi.on("reInit", refreshSnaps);
60
+ refreshSnaps();
61
+ handleSelect();
62
+ return () => {
63
+ emblaApi.off("select", handleSelect);
64
+ emblaApi.off("reInit", refreshSnaps);
65
+ };
66
+ }, [emblaApi, onSelect]);
67
+ if (count === 0) return null;
68
+ const showControls = count > 1;
69
+ const slideBasis = `${100 / Math.max(1, slidesPerView)}%`;
70
+ const dotCount = snapCount > 0 ? snapCount : count;
71
+ const arrowBaseSx = {
72
+ position: "absolute",
73
+ top: "50%",
74
+ transform: "translateY(-50%)",
75
+ bgcolor: "background.paper",
76
+ boxShadow: 1,
77
+ "&:hover": { bgcolor: "background.paper" }
78
+ };
79
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
80
+ _Box2.default,
81
+ {
82
+ role: "region",
83
+ "aria-roledescription": "carousel",
84
+ "aria-label": ariaLabel,
85
+ sx: { position: "relative", width: "100%" },
86
+ children: [
87
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Box2.default, { ref: emblaRef, sx: { overflow: "hidden" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Box2.default, { sx: { display: "flex" }, children: slides.map((item, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
88
+ _Box2.default,
89
+ {
90
+ role: "group",
91
+ "aria-roledescription": "slide",
92
+ "aria-label": `${i + 1} of ${count}`,
93
+ sx: { flex: `0 0 ${slideBasis}`, minWidth: 0 },
94
+ children: renderSlide(item, i)
95
+ },
96
+ getKey ? getKey(item, i) : i
97
+ )) }) }),
98
+ showControls && showArrows && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
99
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
100
+ _IconButton2.default,
101
+ {
102
+ "aria-label": "Previous slide",
103
+ onClick: () => _optionalChain([emblaApi, 'optionalAccess', _3 => _3.scrollPrev, 'call', _4 => _4()]),
104
+ sx: [arrowBaseSx, { left: 8 }, ...Array.isArray(arrowSx) ? arrowSx : [arrowSx]],
105
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ChevronLeft2.default, {})
106
+ }
107
+ ),
108
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
109
+ _IconButton2.default,
110
+ {
111
+ "aria-label": "Next slide",
112
+ onClick: () => _optionalChain([emblaApi, 'optionalAccess', _5 => _5.scrollNext, 'call', _6 => _6()]),
113
+ sx: [arrowBaseSx, { right: 8 }, ...Array.isArray(arrowSx) ? arrowSx : [arrowSx]],
114
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ChevronRight2.default, {})
115
+ }
116
+ )
117
+ ] }),
118
+ showControls && showCounter && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
119
+ _Typography2.default,
120
+ {
121
+ variant: "caption",
122
+ sx: (theme) => ({
123
+ position: "absolute",
124
+ top: 12,
125
+ right: 16,
126
+ px: 1,
127
+ py: 0.25,
128
+ borderRadius: 1,
129
+ bgcolor: _styles.alpha.call(void 0, theme.palette.common.black, 0.5),
130
+ color: "common.white",
131
+ letterSpacing: 1
132
+ }),
133
+ children: [
134
+ pad2(selected + 1),
135
+ " / ",
136
+ pad2(dotCount)
137
+ ]
138
+ }
139
+ ),
140
+ showControls && showDots && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
141
+ _Box2.default,
142
+ {
143
+ role: "tablist",
144
+ "aria-label": "Carousel slides",
145
+ sx: {
146
+ position: "absolute",
147
+ bottom: 12,
148
+ left: 0,
149
+ right: 0,
150
+ display: "flex",
151
+ justifyContent: "center",
152
+ gap: 1
153
+ },
154
+ children: Array.from({ length: dotCount }).map((_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
155
+ _Box2.default,
156
+ {
157
+ component: "button",
158
+ role: "tab",
159
+ "aria-selected": i === selected,
160
+ "aria-label": `Go to slide ${i + 1}`,
161
+ type: "button",
162
+ onClick: () => _optionalChain([emblaApi, 'optionalAccess', _7 => _7.scrollTo, 'call', _8 => _8(i)]),
163
+ sx: (theme) => ({
164
+ width: i === selected ? 24 : 8,
165
+ height: 8,
166
+ borderRadius: 4,
167
+ border: "none",
168
+ padding: 0,
169
+ cursor: "pointer",
170
+ bgcolor: i === selected ? _nullishCoalesce(dotActiveColor, () => ( theme.palette.primary.main)) : _nullishCoalesce(dotColor, () => ( theme.palette.action.disabled)),
171
+ transition: "width 0.2s ease, background 0.2s ease"
172
+ })
173
+ },
174
+ i
175
+ ))
176
+ }
177
+ )
178
+ ]
179
+ }
180
+ );
181
+ }
182
+
183
+
184
+ exports.Carousel = Carousel;
185
+ //# sourceMappingURL=carousel.js.map