@zendeskgarden/react-theming 9.0.0-next.2 → 9.0.0-next.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/elements/ThemeProvider.js +24 -0
- package/dist/esm/elements/palette/index.js +259 -0
- package/dist/esm/elements/palette/v8.js +149 -0
- package/dist/esm/elements/theme/index.js +240 -0
- package/dist/esm/index.js +28 -0
- package/dist/esm/types/index.js +11 -0
- package/dist/esm/utils/StyledBaseIcon.js +22 -0
- package/dist/esm/utils/arrowStyles.js +52 -0
- package/dist/esm/utils/focusStyles.js +43 -0
- package/dist/esm/utils/getArrowPosition.js +35 -0
- package/dist/esm/utils/getCheckeredBackground.js +40 -0
- package/dist/esm/utils/getColor.js +245 -0
- package/dist/esm/utils/getColorV8.js +72 -0
- package/dist/esm/utils/getFloatingPlacements.js +58 -0
- package/dist/esm/utils/getFocusBoxShadow.js +45 -0
- package/dist/esm/utils/getLineHeight.js +22 -0
- package/dist/esm/utils/getMenuPosition.js +11 -0
- package/dist/esm/utils/mediaQuery.js +56 -0
- package/dist/esm/utils/menuStyles.js +70 -0
- package/dist/esm/utils/retrieveComponentStyles.js +19 -0
- package/dist/esm/utils/useDocument.js +21 -0
- package/dist/esm/utils/useText.js +29 -0
- package/dist/esm/utils/useWindow.js +21 -0
- package/dist/index.cjs.js +848 -201
- package/dist/typings/elements/ThemeProvider.d.ts +1 -1
- package/dist/typings/elements/palette/index.d.ts +134 -26
- package/dist/typings/elements/palette/v8.d.ts +149 -0
- package/dist/typings/elements/theme/index.d.ts +0 -1
- package/dist/typings/index.d.ts +6 -4
- package/dist/typings/types/index.d.ts +61 -16
- package/dist/typings/utils/StyledBaseIcon.d.ts +8 -0
- package/dist/typings/utils/arrowStyles.d.ts +0 -16
- package/dist/typings/utils/focusStyles.d.ts +3 -11
- package/dist/typings/utils/getCheckeredBackground.d.ts +20 -0
- package/dist/typings/utils/getColor.d.ts +14 -9
- package/dist/typings/utils/getColorV8.d.ts +27 -0
- package/dist/typings/utils/getFocusBoxShadow.d.ts +6 -21
- package/dist/typings/utils/menuStyles.d.ts +1 -1
- package/package.json +8 -7
- package/dist/index.esm.js +0 -714
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import React, { PropsWithChildren } from 'react';
|
|
8
8
|
import { IThemeProviderProps } from '../types';
|
|
9
9
|
export declare const ThemeProvider: {
|
|
10
|
-
({ theme,
|
|
10
|
+
({ theme, ...other }: PropsWithChildren<IThemeProviderProps>): React.JSX.Element;
|
|
11
11
|
defaultProps: {
|
|
12
12
|
theme: import("../types").IGardenTheme;
|
|
13
13
|
};
|
|
@@ -4,17 +4,14 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
/** @ignore */
|
|
8
7
|
declare const PALETTE: {
|
|
9
8
|
black: string;
|
|
10
9
|
white: string;
|
|
11
10
|
product: {
|
|
12
11
|
support: string;
|
|
13
|
-
message: string;
|
|
14
12
|
explore: string;
|
|
15
13
|
gather: string;
|
|
16
14
|
guide: string;
|
|
17
|
-
connect: string;
|
|
18
15
|
chat: string;
|
|
19
16
|
talk: string;
|
|
20
17
|
sell: string;
|
|
@@ -28,6 +25,10 @@ declare const PALETTE: {
|
|
|
28
25
|
600: string;
|
|
29
26
|
700: string;
|
|
30
27
|
800: string;
|
|
28
|
+
900: string;
|
|
29
|
+
1000: string;
|
|
30
|
+
1100: string;
|
|
31
|
+
1200: string;
|
|
31
32
|
};
|
|
32
33
|
blue: {
|
|
33
34
|
100: string;
|
|
@@ -38,6 +39,10 @@ declare const PALETTE: {
|
|
|
38
39
|
600: string;
|
|
39
40
|
700: string;
|
|
40
41
|
800: string;
|
|
42
|
+
900: string;
|
|
43
|
+
1000: string;
|
|
44
|
+
1100: string;
|
|
45
|
+
1200: string;
|
|
41
46
|
};
|
|
42
47
|
red: {
|
|
43
48
|
100: string;
|
|
@@ -48,6 +53,10 @@ declare const PALETTE: {
|
|
|
48
53
|
600: string;
|
|
49
54
|
700: string;
|
|
50
55
|
800: string;
|
|
56
|
+
900: string;
|
|
57
|
+
1000: string;
|
|
58
|
+
1100: string;
|
|
59
|
+
1200: string;
|
|
51
60
|
};
|
|
52
61
|
yellow: {
|
|
53
62
|
100: string;
|
|
@@ -58,6 +67,10 @@ declare const PALETTE: {
|
|
|
58
67
|
600: string;
|
|
59
68
|
700: string;
|
|
60
69
|
800: string;
|
|
70
|
+
900: string;
|
|
71
|
+
1000: string;
|
|
72
|
+
1100: string;
|
|
73
|
+
1200: string;
|
|
61
74
|
};
|
|
62
75
|
green: {
|
|
63
76
|
100: string;
|
|
@@ -68,6 +81,10 @@ declare const PALETTE: {
|
|
|
68
81
|
600: string;
|
|
69
82
|
700: string;
|
|
70
83
|
800: string;
|
|
84
|
+
900: string;
|
|
85
|
+
1000: string;
|
|
86
|
+
1100: string;
|
|
87
|
+
1200: string;
|
|
71
88
|
};
|
|
72
89
|
kale: {
|
|
73
90
|
100: string;
|
|
@@ -78,73 +95,164 @@ declare const PALETTE: {
|
|
|
78
95
|
600: string;
|
|
79
96
|
700: string;
|
|
80
97
|
800: string;
|
|
98
|
+
900: string;
|
|
99
|
+
1000: string;
|
|
100
|
+
1100: string;
|
|
101
|
+
1200: string;
|
|
81
102
|
};
|
|
82
103
|
fuschia: {
|
|
104
|
+
100: string;
|
|
105
|
+
200: string;
|
|
106
|
+
300: string;
|
|
83
107
|
400: string;
|
|
108
|
+
500: string;
|
|
84
109
|
600: string;
|
|
85
|
-
|
|
86
|
-
|
|
110
|
+
700: string;
|
|
111
|
+
800: string;
|
|
112
|
+
900: string;
|
|
113
|
+
1000: string;
|
|
114
|
+
1100: string;
|
|
115
|
+
1200: string;
|
|
87
116
|
};
|
|
88
117
|
pink: {
|
|
118
|
+
100: string;
|
|
119
|
+
200: string;
|
|
120
|
+
300: string;
|
|
89
121
|
400: string;
|
|
122
|
+
500: string;
|
|
90
123
|
600: string;
|
|
91
|
-
|
|
92
|
-
|
|
124
|
+
700: string;
|
|
125
|
+
800: string;
|
|
126
|
+
900: string;
|
|
127
|
+
1000: string;
|
|
128
|
+
1100: string;
|
|
129
|
+
1200: string;
|
|
93
130
|
};
|
|
94
131
|
crimson: {
|
|
132
|
+
100: string;
|
|
133
|
+
200: string;
|
|
134
|
+
300: string;
|
|
95
135
|
400: string;
|
|
136
|
+
500: string;
|
|
96
137
|
600: string;
|
|
97
|
-
|
|
98
|
-
|
|
138
|
+
700: string;
|
|
139
|
+
800: string;
|
|
140
|
+
900: string;
|
|
141
|
+
1000: string;
|
|
142
|
+
1100: string;
|
|
143
|
+
1200: string;
|
|
99
144
|
};
|
|
100
145
|
orange: {
|
|
146
|
+
100: string;
|
|
147
|
+
200: string;
|
|
148
|
+
300: string;
|
|
101
149
|
400: string;
|
|
150
|
+
500: string;
|
|
102
151
|
600: string;
|
|
103
|
-
|
|
104
|
-
|
|
152
|
+
700: string;
|
|
153
|
+
800: string;
|
|
154
|
+
900: string;
|
|
155
|
+
1000: string;
|
|
156
|
+
1100: string;
|
|
157
|
+
1200: string;
|
|
105
158
|
};
|
|
106
159
|
lemon: {
|
|
160
|
+
100: string;
|
|
161
|
+
200: string;
|
|
162
|
+
300: string;
|
|
107
163
|
400: string;
|
|
164
|
+
500: string;
|
|
108
165
|
600: string;
|
|
109
|
-
|
|
110
|
-
|
|
166
|
+
700: string;
|
|
167
|
+
800: string;
|
|
168
|
+
900: string;
|
|
169
|
+
1000: string;
|
|
170
|
+
1100: string;
|
|
171
|
+
1200: string;
|
|
111
172
|
};
|
|
112
173
|
lime: {
|
|
174
|
+
100: string;
|
|
175
|
+
200: string;
|
|
176
|
+
300: string;
|
|
113
177
|
400: string;
|
|
178
|
+
500: string;
|
|
114
179
|
600: string;
|
|
115
|
-
|
|
116
|
-
|
|
180
|
+
700: string;
|
|
181
|
+
800: string;
|
|
182
|
+
900: string;
|
|
183
|
+
1000: string;
|
|
184
|
+
1100: string;
|
|
185
|
+
1200: string;
|
|
117
186
|
};
|
|
118
187
|
mint: {
|
|
188
|
+
100: string;
|
|
189
|
+
200: string;
|
|
190
|
+
300: string;
|
|
119
191
|
400: string;
|
|
192
|
+
500: string;
|
|
120
193
|
600: string;
|
|
121
|
-
|
|
122
|
-
|
|
194
|
+
700: string;
|
|
195
|
+
800: string;
|
|
196
|
+
900: string;
|
|
197
|
+
1000: string;
|
|
198
|
+
1100: string;
|
|
199
|
+
1200: string;
|
|
123
200
|
};
|
|
124
201
|
teal: {
|
|
202
|
+
100: string;
|
|
203
|
+
200: string;
|
|
204
|
+
300: string;
|
|
125
205
|
400: string;
|
|
206
|
+
500: string;
|
|
126
207
|
600: string;
|
|
127
|
-
|
|
128
|
-
|
|
208
|
+
700: string;
|
|
209
|
+
800: string;
|
|
210
|
+
900: string;
|
|
211
|
+
1000: string;
|
|
212
|
+
1100: string;
|
|
213
|
+
1200: string;
|
|
129
214
|
};
|
|
130
215
|
azure: {
|
|
216
|
+
100: string;
|
|
217
|
+
200: string;
|
|
218
|
+
300: string;
|
|
131
219
|
400: string;
|
|
220
|
+
500: string;
|
|
132
221
|
600: string;
|
|
133
|
-
|
|
134
|
-
|
|
222
|
+
700: string;
|
|
223
|
+
800: string;
|
|
224
|
+
900: string;
|
|
225
|
+
1000: string;
|
|
226
|
+
1100: string;
|
|
227
|
+
1200: string;
|
|
135
228
|
};
|
|
136
229
|
royal: {
|
|
230
|
+
100: string;
|
|
231
|
+
200: string;
|
|
232
|
+
300: string;
|
|
137
233
|
400: string;
|
|
234
|
+
500: string;
|
|
138
235
|
600: string;
|
|
139
|
-
|
|
140
|
-
|
|
236
|
+
700: string;
|
|
237
|
+
800: string;
|
|
238
|
+
900: string;
|
|
239
|
+
1000: string;
|
|
240
|
+
1100: string;
|
|
241
|
+
1200: string;
|
|
141
242
|
};
|
|
142
243
|
purple: {
|
|
244
|
+
100: string;
|
|
245
|
+
200: string;
|
|
246
|
+
300: string;
|
|
143
247
|
400: string;
|
|
248
|
+
500: string;
|
|
144
249
|
600: string;
|
|
145
|
-
|
|
146
|
-
|
|
250
|
+
700: string;
|
|
251
|
+
800: string;
|
|
252
|
+
900: string;
|
|
253
|
+
1000: string;
|
|
254
|
+
1100: string;
|
|
255
|
+
1200: string;
|
|
147
256
|
};
|
|
148
257
|
};
|
|
149
|
-
/** @component */
|
|
150
258
|
export default PALETTE;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
/** @deprecated INTERNAL ONLY – DO NOT USE */
|
|
8
|
+
declare const PALETTE_V8: {
|
|
9
|
+
black: string;
|
|
10
|
+
white: string;
|
|
11
|
+
product: {
|
|
12
|
+
support: string;
|
|
13
|
+
message: string;
|
|
14
|
+
explore: string;
|
|
15
|
+
gather: string;
|
|
16
|
+
guide: string;
|
|
17
|
+
connect: string;
|
|
18
|
+
chat: string;
|
|
19
|
+
talk: string;
|
|
20
|
+
sell: string;
|
|
21
|
+
};
|
|
22
|
+
grey: {
|
|
23
|
+
100: string;
|
|
24
|
+
200: string;
|
|
25
|
+
300: string;
|
|
26
|
+
400: string;
|
|
27
|
+
500: string;
|
|
28
|
+
600: string;
|
|
29
|
+
700: string;
|
|
30
|
+
800: string;
|
|
31
|
+
};
|
|
32
|
+
blue: {
|
|
33
|
+
100: string;
|
|
34
|
+
200: string;
|
|
35
|
+
300: string;
|
|
36
|
+
400: string;
|
|
37
|
+
500: string;
|
|
38
|
+
600: string;
|
|
39
|
+
700: string;
|
|
40
|
+
800: string;
|
|
41
|
+
};
|
|
42
|
+
red: {
|
|
43
|
+
100: string;
|
|
44
|
+
200: string;
|
|
45
|
+
300: string;
|
|
46
|
+
400: string;
|
|
47
|
+
500: string;
|
|
48
|
+
600: string;
|
|
49
|
+
700: string;
|
|
50
|
+
800: string;
|
|
51
|
+
};
|
|
52
|
+
yellow: {
|
|
53
|
+
100: string;
|
|
54
|
+
200: string;
|
|
55
|
+
300: string;
|
|
56
|
+
400: string;
|
|
57
|
+
500: string;
|
|
58
|
+
600: string;
|
|
59
|
+
700: string;
|
|
60
|
+
800: string;
|
|
61
|
+
};
|
|
62
|
+
green: {
|
|
63
|
+
100: string;
|
|
64
|
+
200: string;
|
|
65
|
+
300: string;
|
|
66
|
+
400: string;
|
|
67
|
+
500: string;
|
|
68
|
+
600: string;
|
|
69
|
+
700: string;
|
|
70
|
+
800: string;
|
|
71
|
+
};
|
|
72
|
+
kale: {
|
|
73
|
+
100: string;
|
|
74
|
+
200: string;
|
|
75
|
+
300: string;
|
|
76
|
+
400: string;
|
|
77
|
+
500: string;
|
|
78
|
+
600: string;
|
|
79
|
+
700: string;
|
|
80
|
+
800: string;
|
|
81
|
+
};
|
|
82
|
+
fuschia: {
|
|
83
|
+
400: string;
|
|
84
|
+
600: string;
|
|
85
|
+
M400: string;
|
|
86
|
+
M600: string;
|
|
87
|
+
};
|
|
88
|
+
pink: {
|
|
89
|
+
400: string;
|
|
90
|
+
600: string;
|
|
91
|
+
M400: string;
|
|
92
|
+
M600: string;
|
|
93
|
+
};
|
|
94
|
+
crimson: {
|
|
95
|
+
400: string;
|
|
96
|
+
600: string;
|
|
97
|
+
M400: string;
|
|
98
|
+
M600: string;
|
|
99
|
+
};
|
|
100
|
+
orange: {
|
|
101
|
+
400: string;
|
|
102
|
+
600: string;
|
|
103
|
+
M400: string;
|
|
104
|
+
M600: string;
|
|
105
|
+
};
|
|
106
|
+
lemon: {
|
|
107
|
+
400: string;
|
|
108
|
+
600: string;
|
|
109
|
+
M400: string;
|
|
110
|
+
M600: string;
|
|
111
|
+
};
|
|
112
|
+
lime: {
|
|
113
|
+
400: string;
|
|
114
|
+
600: string;
|
|
115
|
+
M400: string;
|
|
116
|
+
M600: string;
|
|
117
|
+
};
|
|
118
|
+
mint: {
|
|
119
|
+
400: string;
|
|
120
|
+
600: string;
|
|
121
|
+
M400: string;
|
|
122
|
+
M600: string;
|
|
123
|
+
};
|
|
124
|
+
teal: {
|
|
125
|
+
400: string;
|
|
126
|
+
600: string;
|
|
127
|
+
M400: string;
|
|
128
|
+
M600: string;
|
|
129
|
+
};
|
|
130
|
+
azure: {
|
|
131
|
+
400: string;
|
|
132
|
+
600: string;
|
|
133
|
+
M400: string;
|
|
134
|
+
M600: string;
|
|
135
|
+
};
|
|
136
|
+
royal: {
|
|
137
|
+
400: string;
|
|
138
|
+
600: string;
|
|
139
|
+
M400: string;
|
|
140
|
+
M600: string;
|
|
141
|
+
};
|
|
142
|
+
purple: {
|
|
143
|
+
400: string;
|
|
144
|
+
600: string;
|
|
145
|
+
M400: string;
|
|
146
|
+
M600: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
export default PALETTE_V8;
|
package/dist/typings/index.d.ts
CHANGED
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
export { ThemeProvider } from './elements/ThemeProvider';
|
|
8
8
|
export { default as DEFAULT_THEME } from './elements/theme';
|
|
9
9
|
export { default as PALETTE } from './elements/palette';
|
|
10
|
-
export { default as
|
|
11
|
-
|
|
12
|
-
default as retrieveTheme } from './utils/retrieveComponentStyles';
|
|
10
|
+
export { default as PALETTE_V8 } from './elements/palette/v8';
|
|
11
|
+
export { default as retrieveComponentStyles } from './utils/retrieveComponentStyles';
|
|
13
12
|
export { getArrowPosition } from './utils/getArrowPosition';
|
|
13
|
+
export { getCheckeredBackground } from './utils/getCheckeredBackground';
|
|
14
14
|
export { getColor } from './utils/getColor';
|
|
15
|
+
export { getColorV8 } from './utils/getColorV8';
|
|
15
16
|
export { getFloatingPlacements } from './utils/getFloatingPlacements';
|
|
16
17
|
export { getFocusBoxShadow } from './utils/getFocusBoxShadow';
|
|
17
18
|
export { default as getLineHeight } from './utils/getLineHeight';
|
|
@@ -23,4 +24,5 @@ export { useWindow } from './utils/useWindow';
|
|
|
23
24
|
export { useText } from './utils/useText';
|
|
24
25
|
export { default as menuStyles } from './utils/menuStyles';
|
|
25
26
|
export { focusStyles, SELECTOR_FOCUS_VISIBLE } from './utils/focusStyles';
|
|
26
|
-
export {
|
|
27
|
+
export { StyledBaseIcon } from './utils/StyledBaseIcon';
|
|
28
|
+
export { ARROW_POSITION, MENU_POSITION, PLACEMENT, type IGardenTheme, type IThemeProviderProps, type ArrowPosition, type CheckeredBackgroundParameters, type ColorParameters, type FocusBoxShadowParameters, type FocusStylesParameters, type MenuPosition, type Placement } from './types';
|
|
@@ -4,15 +4,55 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
import { ThemeProps } from 'styled-components';
|
|
7
|
+
import { CSSObject, ThemeProviderProps } from 'styled-components';
|
|
9
8
|
export declare const ARROW_POSITION: readonly ["top", "top-left", "top-right", "right", "right-top", "right-bottom", "bottom", "bottom-left", "bottom-right", "left", "left-top", "left-bottom"];
|
|
10
9
|
export type ArrowPosition = (typeof ARROW_POSITION)[number];
|
|
11
10
|
export declare const MENU_POSITION: readonly ["top", "right", "bottom", "left"];
|
|
12
11
|
export type MenuPosition = (typeof MENU_POSITION)[number];
|
|
13
12
|
export declare const PLACEMENT: readonly ["top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "end", "end-top", "end-bottom", "start", "start-top", "start-bottom"];
|
|
14
13
|
export type Placement = (typeof PLACEMENT)[number];
|
|
15
|
-
type
|
|
14
|
+
export type CheckeredBackgroundParameters = {
|
|
15
|
+
overlay?: string;
|
|
16
|
+
positionY?: number;
|
|
17
|
+
repeat?: 'repeat' | 'repeat-x';
|
|
18
|
+
size: number;
|
|
19
|
+
theme: IGardenTheme;
|
|
20
|
+
};
|
|
21
|
+
export type ColorParameters = {
|
|
22
|
+
dark?: {
|
|
23
|
+
hue?: string;
|
|
24
|
+
offset?: number;
|
|
25
|
+
shade?: number;
|
|
26
|
+
transparency?: number;
|
|
27
|
+
};
|
|
28
|
+
hue?: string;
|
|
29
|
+
light?: {
|
|
30
|
+
hue?: string;
|
|
31
|
+
offset?: number;
|
|
32
|
+
shade?: number;
|
|
33
|
+
transparency?: number;
|
|
34
|
+
};
|
|
35
|
+
offset?: number;
|
|
36
|
+
shade?: number;
|
|
37
|
+
theme: IGardenTheme;
|
|
38
|
+
transparency?: number;
|
|
39
|
+
variable?: string;
|
|
40
|
+
};
|
|
41
|
+
export type FocusStylesParameters = FocusBoxShadowParameters & {
|
|
42
|
+
condition?: boolean;
|
|
43
|
+
selector?: string;
|
|
44
|
+
styles?: CSSObject;
|
|
45
|
+
};
|
|
46
|
+
export type FocusBoxShadowParameters = {
|
|
47
|
+
boxShadow?: string;
|
|
48
|
+
inset?: boolean;
|
|
49
|
+
color?: Omit<ColorParameters, 'theme'>;
|
|
50
|
+
shadowWidth?: 'sm' | 'md';
|
|
51
|
+
spacerColor?: Omit<ColorParameters, 'theme'>;
|
|
52
|
+
spacerWidth?: null | 'xs' | 'sm';
|
|
53
|
+
theme: IGardenTheme;
|
|
54
|
+
};
|
|
55
|
+
export type Hue = Record<number | string, string> | string;
|
|
16
56
|
export interface IGardenTheme {
|
|
17
57
|
rtl: boolean;
|
|
18
58
|
document?: any;
|
|
@@ -41,14 +81,26 @@ export interface IGardenTheme {
|
|
|
41
81
|
};
|
|
42
82
|
colors: {
|
|
43
83
|
base: 'light' | 'dark';
|
|
44
|
-
background: string;
|
|
45
|
-
foreground: string;
|
|
46
84
|
primaryHue: string;
|
|
47
85
|
dangerHue: string;
|
|
48
86
|
warningHue: string;
|
|
49
87
|
successHue: string;
|
|
50
88
|
neutralHue: string;
|
|
51
89
|
chromeHue: string;
|
|
90
|
+
variables: {
|
|
91
|
+
dark: {
|
|
92
|
+
background: Record<string, string>;
|
|
93
|
+
border: Record<string, string>;
|
|
94
|
+
foreground: Record<string, string>;
|
|
95
|
+
shadow: Record<string, string>;
|
|
96
|
+
};
|
|
97
|
+
light: {
|
|
98
|
+
background: Record<string, string>;
|
|
99
|
+
border: Record<string, string>;
|
|
100
|
+
foreground: Record<string, string>;
|
|
101
|
+
shadow: Record<string, string>;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
52
104
|
};
|
|
53
105
|
components: Record<string, any>;
|
|
54
106
|
fonts: {
|
|
@@ -88,6 +140,8 @@ export interface IGardenTheme {
|
|
|
88
140
|
xxl: string;
|
|
89
141
|
xxxl: string;
|
|
90
142
|
};
|
|
143
|
+
opacity: Record<number, number>;
|
|
144
|
+
palette: Record<string, Hue>;
|
|
91
145
|
shadowWidths: {
|
|
92
146
|
xs: string;
|
|
93
147
|
sm: string;
|
|
@@ -109,21 +163,12 @@ export interface IGardenTheme {
|
|
|
109
163
|
xl: string;
|
|
110
164
|
xxl: string;
|
|
111
165
|
};
|
|
112
|
-
palette: Record<string, Hue>;
|
|
113
166
|
}
|
|
114
|
-
export interface IThemeProviderProps extends Partial<
|
|
167
|
+
export interface IThemeProviderProps extends Partial<ThemeProviderProps<IGardenTheme>> {
|
|
115
168
|
/**
|
|
116
169
|
* Provides values for component styling. See styled-components
|
|
117
170
|
* [`ThemeProvider`](https://styled-components.com/docs/api#themeprovider)
|
|
118
171
|
* for details.
|
|
119
172
|
*/
|
|
120
|
-
theme?: IGardenTheme;
|
|
121
|
-
/**
|
|
122
|
-
* Provides a reference to the DOM node used to scope a `:focus-visible`
|
|
123
|
-
* polyfill. If left `undefined`, a scoping `<div>` will be rendered.
|
|
124
|
-
* Assigning `null` (on a nested `ThemeProvider`, for example) prevents the
|
|
125
|
-
* added polyfill and scoping `<div>`.
|
|
126
|
-
*/
|
|
127
|
-
focusVisibleRef?: React.RefObject<HTMLElement> | null;
|
|
173
|
+
theme?: IGardenTheme | ((theme: IGardenTheme) => IGardenTheme);
|
|
128
174
|
}
|
|
129
|
-
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
export declare const StyledBaseIcon: import("styled-components").StyledComponent<({ children, theme, ...props }: any) => React.DetailedReactHTMLElement<any, HTMLElement>, import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -10,22 +10,6 @@ type ArrowOptions = {
|
|
|
10
10
|
inset?: string;
|
|
11
11
|
animationModifier?: string;
|
|
12
12
|
};
|
|
13
|
-
export declare const exponentialSymbols: {
|
|
14
|
-
symbols: {
|
|
15
|
-
sqrt: {
|
|
16
|
-
func: {
|
|
17
|
-
symbol: string;
|
|
18
|
-
f: (a: number) => number;
|
|
19
|
-
notation: string;
|
|
20
|
-
precedence: number;
|
|
21
|
-
rightToLeft: number;
|
|
22
|
-
argCount: number;
|
|
23
|
-
};
|
|
24
|
-
symbol: string;
|
|
25
|
-
regSymbol: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
13
|
/**
|
|
30
14
|
* CSS for an arrow at the given position and with the given size. The arrow is
|
|
31
15
|
* positioned via `::before` and `::after` pseudo-elements and inherits the
|
|
@@ -4,14 +4,8 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
export declare const SELECTOR_FOCUS_VISIBLE = "&:focus-visible, &[data-garden-focus-visible=\"true\"]";
|
|
10
|
-
type FocusStylesParameters = FocusBoxShadowParameters & {
|
|
11
|
-
condition?: boolean;
|
|
12
|
-
selector?: string;
|
|
13
|
-
styles?: CSSObject;
|
|
14
|
-
};
|
|
7
|
+
import { FocusStylesParameters } from '../types';
|
|
8
|
+
export declare const SELECTOR_FOCUS_VISIBLE = "&:focus-visible";
|
|
15
9
|
/**
|
|
16
10
|
* Garden standard `box-shadow` focus styling.
|
|
17
11
|
*
|
|
@@ -33,8 +27,7 @@ type FocusStylesParameters = FocusBoxShadowParameters & {
|
|
|
33
27
|
* outline: none;
|
|
34
28
|
* }
|
|
35
29
|
*
|
|
36
|
-
* :focus-visible
|
|
37
|
-
* [data-garden-focus-visible='true'] {
|
|
30
|
+
* :focus-visible {
|
|
38
31
|
* box-shadow: 0 0 0 {1px} #fff,
|
|
39
32
|
* 0 0 0 {3px} {blue};
|
|
40
33
|
* outline: {2px} solid transparent;
|
|
@@ -44,4 +37,3 @@ type FocusStylesParameters = FocusBoxShadowParameters & {
|
|
|
44
37
|
* ```
|
|
45
38
|
*/
|
|
46
39
|
export declare const focusStyles: ({ condition, selector, shadowWidth, spacerWidth, styles: { boxShadow, ...styles }, theme, ...options }: FocusStylesParameters) => import("styled-components").FlattenSimpleInterpolation;
|
|
47
|
-
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { CheckeredBackgroundParameters } from '../types';
|
|
8
|
+
/**
|
|
9
|
+
* Get a checkered background image.
|
|
10
|
+
*
|
|
11
|
+
* @param {Object} options.theme Provides information for pattern color and LTR/RTL layout
|
|
12
|
+
* @param {number} options.size The pixel size of the checkered pattern
|
|
13
|
+
* @param {string} [options.overlay] Optional
|
|
14
|
+
* [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) with transparency or
|
|
15
|
+
* [`linear-gradient()`](https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient)
|
|
16
|
+
* overlay to apply on top of the checkered pattern
|
|
17
|
+
* @param {number} [options.positionY=0] Optional vertical position for starting the pattern (default `0`)
|
|
18
|
+
* @param {string} [options.repeat='repeat'] Optional repeat value for the pattern; either `'repeat'` or `'repeat-x'` (default `'repeat'`)
|
|
19
|
+
*/
|
|
20
|
+
export declare const getCheckeredBackground: ({ theme, size, overlay, positionY, repeat }: CheckeredBackgroundParameters) => string;
|
|
@@ -5,21 +5,26 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
/// <reference types="lodash" />
|
|
8
|
-
import {
|
|
9
|
-
export type Hue = Record<number | string, string> | string;
|
|
10
|
-
export declare const DEFAULT_SHADE = 600;
|
|
8
|
+
import { ColorParameters } from '../types';
|
|
11
9
|
/**
|
|
12
|
-
* Get
|
|
10
|
+
* Get a color value from the theme. Variable lookup takes precedence, followed
|
|
11
|
+
* by `dark` and `light` object values. If none of these are provided, `hue`,
|
|
12
|
+
* `shade`, `offset`, and `transparency` are used as fallbacks to determine the
|
|
13
|
+
* color.
|
|
13
14
|
*
|
|
14
|
-
* @param {
|
|
15
|
+
* @param {Object} options.theme Provides values used to resolve the desired color
|
|
16
|
+
* @param {string} [options.variable] A variable key (i.e. `'background.default'`) used to resolve a color value for the theme color base
|
|
17
|
+
* @param {Object} [options.dark] An object with `hue`, `shade`, `offset`, and `transparency` values to be used in dark mode
|
|
18
|
+
* @param {Object} [options.light] An object with `hue`, `shade`, `offset`, and `transparency` values to be used in light mode
|
|
19
|
+
* @param {string} [options.hue] A `theme.palette` hue or one of the following `theme.colors` keys:
|
|
15
20
|
* - `'primaryHue'` = `theme.colors.primaryHue`
|
|
16
21
|
* - `'dangerHue'` = `theme.colors.dangerHue`
|
|
17
22
|
* - `'warningHue'` = `theme.colors.warningHue`
|
|
18
23
|
* - `'successHue'` = `theme.colors.successHue`
|
|
19
24
|
* - `'neutralHue'` = `theme.colors.neutralHue`
|
|
20
25
|
* - `'chromeHue'` = `theme.colors.chromeHue`
|
|
21
|
-
* @param {number} [shade
|
|
22
|
-
* @param {
|
|
23
|
-
* @param {
|
|
26
|
+
* @param {number} [options.shade] A hue shade
|
|
27
|
+
* @param {number} [options.offset] A positive or negative value to adjust the shade
|
|
28
|
+
* @param {number} [options.transparency] A `theme.opacity` key or an alpha-channel value between 0 and 1
|
|
24
29
|
*/
|
|
25
|
-
export declare const getColor: ((hue
|
|
30
|
+
export declare const getColor: (({ dark, hue, light, offset, shade, theme, transparency, variable }: ColorParameters) => string) & import("lodash").MemoizedFunction;
|