@prismicio/editor-ui 0.4.16 → 0.4.17

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 (71) hide show
  1. package/README.md +12 -0
  2. package/dist/components/ActionList/ActionList.d.ts +5 -1
  3. package/dist/components/ActionList/ActionList.stories.d.ts +1 -3
  4. package/dist/components/AnimatedElement/AnimatedElement.d.ts +1 -1
  5. package/dist/components/Badge/Badge.d.ts +1 -1
  6. package/dist/components/Badge/Badge.stories.d.ts +1 -1
  7. package/dist/components/BaseInput/BaseInput.d.ts +1 -1
  8. package/dist/components/Box/Box.d.ts +9 -1
  9. package/dist/components/Button/Button.css.d.ts +1 -1
  10. package/dist/components/Button/Button.d.ts +1 -1
  11. package/dist/components/ButtonGroup/ButtonGroup.d.ts +15 -14
  12. package/dist/components/ButtonGroup/ButtonGroup.stories.d.ts +1 -9
  13. package/dist/components/Card/Card.d.ts +1 -1
  14. package/dist/components/DateInput/DateInput.d.ts +1 -1
  15. package/dist/components/Dialog/Dialog.d.ts +7 -3
  16. package/dist/components/Dialog/Dialog.stories.d.ts +4 -3
  17. package/dist/components/Dialog/Options/DialogOptions.d.ts +17 -3
  18. package/dist/components/Field/Field.stories.d.ts +20 -5
  19. package/dist/components/Form/Form.d.ts +1 -1
  20. package/dist/components/Form/FormDateInput.d.ts +1 -1
  21. package/dist/components/Form/FormField.d.ts +1 -1
  22. package/dist/components/Gradient/Gradient.d.ts +1 -1
  23. package/dist/components/HairlineButton/HairlineButton.d.ts +1 -1
  24. package/dist/components/HeaderTabLink/HeaderTabLink.d.ts +8 -0
  25. package/dist/components/HeaderTabLink/index.d.ts +1 -0
  26. package/dist/components/Icon/Icon.d.ts +1 -1
  27. package/dist/components/Icon/iconNames.d.ts +1 -1
  28. package/dist/components/IconButton/IconButton.d.ts +3 -0
  29. package/dist/components/NumberInput/NumberInput.d.ts +1 -1
  30. package/dist/components/Radio/RadioGroup.d.ts +1 -1
  31. package/dist/components/ScrollArea/ScrollArea.css.d.ts +1 -0
  32. package/dist/components/ScrollArea/ScrollArea.d.ts +10 -0
  33. package/dist/components/ScrollArea/ScrollArea.stories.d.ts +9 -0
  34. package/dist/components/ScrollArea/ScrollAreaControls.d.ts +14 -0
  35. package/dist/components/SearchInput/SearchInput.d.ts +2 -0
  36. package/dist/components/SearchInput/SearchInput.stories.d.ts +1 -0
  37. package/dist/components/Select/Select.d.ts +1 -1
  38. package/dist/components/Separator/Separator.d.ts +1 -1
  39. package/dist/components/Skeleton/Skeleton.d.ts +25 -9
  40. package/dist/components/Skeleton/Skeleton.stories.d.ts +2 -0
  41. package/dist/components/Switch/Switch.css.d.ts +1 -1
  42. package/dist/components/Table/Table.d.ts +2 -3
  43. package/dist/components/Text/Text.css.d.ts +1 -1
  44. package/dist/components/Text/Text.d.ts +1 -1
  45. package/dist/components/TextArea/TextArea.d.ts +1 -1
  46. package/dist/components/TextInput/TextInput.d.ts +1 -1
  47. package/dist/components/Toast/Toast.stories.d.ts +2 -2
  48. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.stories.d.ts +2 -2
  49. package/dist/components/Toolbar/Toolbar.d.ts +1 -1
  50. package/dist/components/Tooltip/Tooltip.stories.d.ts +2 -0
  51. package/dist/index.d.ts +1 -0
  52. package/dist/index.es.js +7124 -6506
  53. package/dist/style.css +1 -1
  54. package/dist/theme/colors.d.ts +0 -4
  55. package/dist/theme/mode.css.d.ts +1 -1
  56. package/dist/theme/new/Theme.stories.d.ts +9 -0
  57. package/dist/theme/new/install.d.ts +11 -0
  58. package/dist/theme/new/sx.d.ts +24 -0
  59. package/dist/theme/new/theme.d.ts +277 -0
  60. package/dist/theme/new/utils.d.ts +36 -0
  61. package/dist/theme/selectors.d.ts +20 -20
  62. package/dist/theme/sprinkles.css.d.ts +648 -753
  63. package/dist/theme/util.d.ts +1 -23
  64. package/dist/theme/vars.css.d.ts +2 -2
  65. package/package.json +4 -3
  66. package/dist/components/ActionList/ActionList.css.d.ts +0 -8
  67. package/dist/components/Checkbox/Checkbox.css.d.ts +0 -1
  68. package/dist/components/Dialog/Dialog.css.d.ts +0 -14
  69. package/dist/components/Dialog/Options/DialogOptions.css.d.ts +0 -8
  70. package/dist/components/Skeleton/Skeleton.css.d.ts +0 -12
  71. package/dist/components/Table/Table.css.d.ts +0 -12
@@ -195,10 +195,6 @@ export declare const colors: {
195
195
  readonly darkMode: "purpleDark12";
196
196
  readonly lightMode: "purpleLight12";
197
197
  };
198
- readonly purpleAlpha1: {
199
- readonly darkMode: "purpleAlpha1";
200
- readonly lightMode: "purpleAlpha1";
201
- };
202
198
  readonly greyAlpha1: {
203
199
  readonly darkMode: "greyAlpha1";
204
200
  readonly lightMode: "greyAlpha1";
@@ -1 +1 @@
1
- export declare const mode: Record<"dark" | "light", string>;
1
+ export declare const mode: Record<"light" | "dark", string>;
@@ -0,0 +1,9 @@
1
+ declare const _default: {
2
+ title: string;
3
+ component: typeof ThemeValues;
4
+ };
5
+ export default _default;
6
+ export declare const Theme: {
7
+ name: string;
8
+ };
9
+ declare function ThemeValues(): JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { type ColorScheme } from "./utils";
2
+ /**
3
+ * Installs theme values that never change but are read via CSS variables.
4
+ */
5
+ export declare function installTheme(element: HTMLElement): void;
6
+ export declare function uninstallTheme(element: HTMLElement): void;
7
+ /**
8
+ * Installs theme values that change depending on light/dark mode.
9
+ */
10
+ export declare function installColorScheme(element: HTMLElement, scheme: ColorScheme): void;
11
+ export declare function uninstallColorScheme(element: HTMLElement): void;
@@ -0,0 +1,24 @@
1
+ import type { CSSProperties } from "react";
2
+ import type { Theme } from "./theme";
3
+ export interface SX {
4
+ flexGrow?: 1;
5
+ flexShrink?: 0;
6
+ alignSelf?: "center" | "stretch";
7
+ justifySelf?: "center" | "stretch";
8
+ visibility?: "hidden" | "visible";
9
+ position?: "absolute" | "fixed" | "relative" | "sticky";
10
+ marginLeft?: keyof Theme["space"];
11
+ marginRight?: keyof Theme["space"];
12
+ marginTop?: keyof Theme["space"];
13
+ marginBottom?: keyof Theme["space"];
14
+ marginInline?: keyof Theme["space"];
15
+ marginBlock?: keyof Theme["space"];
16
+ top?: keyof Theme["space"];
17
+ left?: keyof Theme["space"];
18
+ right?: keyof Theme["space"];
19
+ bottom?: keyof Theme["space"];
20
+ height?: CSSProperties["height"];
21
+ width?: CSSProperties["width"];
22
+ zIndex?: keyof Theme["zIndex"];
23
+ [key: `--${string}`]: string | number;
24
+ }
@@ -0,0 +1,277 @@
1
+ export declare const theme: {
2
+ borderRadius: {
3
+ 0: string;
4
+ 1: string;
5
+ 2: string;
6
+ 4: string;
7
+ 6: string;
8
+ 8: string;
9
+ 10: string;
10
+ 12: string;
11
+ "50%": string;
12
+ "100%": string;
13
+ inherit: string;
14
+ } & {};
15
+ borderStyle: {
16
+ none: string;
17
+ dashed: string;
18
+ solid: string;
19
+ } & {};
20
+ borderWidth: {
21
+ 0: string;
22
+ 1: string;
23
+ 2: string;
24
+ 3: string;
25
+ } & {};
26
+ boxShadow: {
27
+ none: string;
28
+ } & {
29
+ "-1": string;
30
+ "1": string;
31
+ "2": string;
32
+ "3": string;
33
+ "4": string;
34
+ focus: string;
35
+ ghostFocus: string;
36
+ };
37
+ color: {
38
+ currentColor: string;
39
+ transparent: string;
40
+ inherit: string;
41
+ } & {
42
+ grey1: string;
43
+ grey2: string;
44
+ grey3: string;
45
+ grey4: string;
46
+ grey5: string;
47
+ grey6: string;
48
+ grey7: string;
49
+ grey8: string;
50
+ grey9: string;
51
+ grey10: string;
52
+ grey11: string;
53
+ grey12: string;
54
+ indigo2: string;
55
+ indigo7: string;
56
+ indigo10: string;
57
+ indigo11: string;
58
+ green3: string;
59
+ green4: string;
60
+ green9: string;
61
+ green10: string;
62
+ green11: string;
63
+ amber3: string;
64
+ amber4: string;
65
+ amber9: string;
66
+ amber10: string;
67
+ amber11: string;
68
+ tomato1: string;
69
+ tomato3: string;
70
+ tomato4: string;
71
+ tomato7: string;
72
+ tomato10: string;
73
+ tomato11: string;
74
+ purple1: string;
75
+ purple2: string;
76
+ purple3: string;
77
+ purple4: string;
78
+ purple5: string;
79
+ purple6: string;
80
+ purple7: string;
81
+ purple8: string;
82
+ purple9: string;
83
+ purple10: string;
84
+ purple11: string;
85
+ purple12: string;
86
+ greyAlpha1: string;
87
+ };
88
+ cursor: {
89
+ default: string;
90
+ move: string;
91
+ pointer: string;
92
+ text: string;
93
+ grab: string;
94
+ notAllowed: string;
95
+ } & {};
96
+ fontFamily: {
97
+ inherit: string;
98
+ } & {
99
+ body: string;
100
+ code: string;
101
+ };
102
+ gradient: {
103
+ checkerboardDark: string;
104
+ checkerboardLight: string;
105
+ };
106
+ opacity: {
107
+ 0: string;
108
+ 0.1: string;
109
+ 0.3: string;
110
+ 0.4: string;
111
+ 0.5: string;
112
+ 0.6: string;
113
+ 0.8: string;
114
+ 1: string;
115
+ } & {};
116
+ space: {
117
+ 0: string;
118
+ 1: string;
119
+ 2: string;
120
+ 4: string;
121
+ 6: string;
122
+ 8: string;
123
+ 10: string;
124
+ 12: string;
125
+ 16: string;
126
+ 24: string;
127
+ 32: string;
128
+ 40: string;
129
+ 48: string;
130
+ 72: string;
131
+ 80: string;
132
+ 100: string;
133
+ } & {};
134
+ transitionDuration: {
135
+ 0: string;
136
+ 75: string;
137
+ 100: string;
138
+ 150: string;
139
+ 200: string;
140
+ 250: string;
141
+ 300: string;
142
+ 400: string;
143
+ } & {};
144
+ zIndex: {
145
+ 0: string;
146
+ 1: string;
147
+ overlay: string;
148
+ dialog: string;
149
+ toolbar: string;
150
+ dropdownMenu: string;
151
+ } & {};
152
+ }, vars: {
153
+ borderRadius: {
154
+ [x: string]: string | {
155
+ light: string;
156
+ dark: string;
157
+ };
158
+ };
159
+ borderStyle: {
160
+ [x: string]: string | {
161
+ light: string;
162
+ dark: string;
163
+ };
164
+ };
165
+ borderWidth: {
166
+ [x: string]: string | {
167
+ light: string;
168
+ dark: string;
169
+ };
170
+ };
171
+ boxShadow: {
172
+ [x: string]: string | {
173
+ light: string;
174
+ dark: string;
175
+ };
176
+ };
177
+ color: {
178
+ [x: string]: string | {
179
+ light: string;
180
+ dark: string;
181
+ };
182
+ };
183
+ cursor: {
184
+ [x: string]: string | {
185
+ light: string;
186
+ dark: string;
187
+ };
188
+ };
189
+ fontFamily: {
190
+ [x: string]: string | {
191
+ light: string;
192
+ dark: string;
193
+ };
194
+ };
195
+ gradient: {
196
+ [x: string]: string | {
197
+ light: string;
198
+ dark: string;
199
+ };
200
+ };
201
+ opacity: {
202
+ [x: string]: string | {
203
+ light: string;
204
+ dark: string;
205
+ };
206
+ };
207
+ space: {
208
+ [x: string]: string | {
209
+ light: string;
210
+ dark: string;
211
+ };
212
+ };
213
+ transitionDuration: {
214
+ [x: string]: string | {
215
+ light: string;
216
+ dark: string;
217
+ };
218
+ };
219
+ zIndex: {
220
+ [x: string]: string | {
221
+ light: string;
222
+ dark: string;
223
+ };
224
+ };
225
+ }, literals: {
226
+ borderRadius: {
227
+ [x: string]: string;
228
+ [x: number]: string;
229
+ };
230
+ borderStyle: {
231
+ [x: string]: string;
232
+ [x: number]: string;
233
+ };
234
+ borderWidth: {
235
+ [x: string]: string;
236
+ [x: number]: string;
237
+ };
238
+ boxShadow: {
239
+ [x: string]: string;
240
+ [x: number]: string;
241
+ };
242
+ color: {
243
+ [x: string]: string;
244
+ [x: number]: string;
245
+ };
246
+ cursor: {
247
+ [x: string]: string;
248
+ [x: number]: string;
249
+ };
250
+ fontFamily: {
251
+ [x: string]: string;
252
+ [x: number]: string;
253
+ };
254
+ gradient: {
255
+ [x: string]: string;
256
+ [x: number]: string;
257
+ };
258
+ opacity: {
259
+ [x: string]: string;
260
+ [x: number]: string;
261
+ };
262
+ space: {
263
+ [x: string]: string;
264
+ [x: number]: string;
265
+ };
266
+ transitionDuration: {
267
+ [x: string]: string;
268
+ [x: number]: string;
269
+ };
270
+ zIndex: {
271
+ [x: string]: string;
272
+ [x: number]: string;
273
+ };
274
+ };
275
+ export type Theme = typeof theme;
276
+ export type ThemeKeys<Name extends keyof Theme, Keys extends keyof Theme[Name] = keyof Theme[Name]> = Keys;
277
+ export declare const cssTheme: Record<string, string[]>;
@@ -0,0 +1,36 @@
1
+ import type { PropertiesHyphen } from "csstype";
2
+ export declare function createTheme<Def extends CreateThemeDefinition>(def: Def): ThemeResult<Def>;
3
+ export declare function isSchemeValue(value: unknown): value is SchemeValue;
4
+ export declare function createCSSTheme<V extends Record<string, Vars>, L extends Record<string, Literals>, Def extends Record<keyof V & keyof L, (keyof PropertiesHyphen)[]>>(vars: V, literals: L, def: Def): Record<string, string[]>;
5
+ type CreateThemeDefinition = Record<string, ThemeValue>;
6
+ type ThemeValue = {
7
+ literals?: Literals;
8
+ varPrefix?: string;
9
+ vars: Vars;
10
+ } | {
11
+ literals: Literals;
12
+ varPrefix?: never;
13
+ vars?: never;
14
+ };
15
+ export type ColorScheme = "light" | "dark";
16
+ type SchemeValue = {
17
+ light: string;
18
+ dark: string;
19
+ };
20
+ type Literals = Record<string | number, string>;
21
+ type Vars = Record<string, string | SchemeValue>;
22
+ type ThemeResult<Def extends CreateThemeDefinition> = {
23
+ theme: {
24
+ [Key in keyof Def]: ThemeResultValue<Def[Key]>;
25
+ };
26
+ vars: {
27
+ [Key in keyof Def]: Vars;
28
+ };
29
+ literals: {
30
+ [Key in keyof Def]: Literals;
31
+ };
32
+ };
33
+ type ThemeResultValue<Value extends ThemeValue> = Value["literals"] & {
34
+ [Key in keyof Value["vars"]]: string;
35
+ };
36
+ export {};