@zendeskgarden/react-theming 9.0.0-next.8 → 9.0.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.
@@ -6,9 +6,4 @@
6
6
  */
7
7
  import React, { PropsWithChildren } from 'react';
8
8
  import { IThemeProviderProps } from '../types';
9
- export declare const ThemeProvider: {
10
- ({ theme, ...other }: PropsWithChildren<IThemeProviderProps>): React.JSX.Element;
11
- defaultProps: {
12
- theme: import("../types").IGardenTheme;
13
- };
14
- };
9
+ export declare const ThemeProvider: ({ theme, ...other }: PropsWithChildren<IThemeProviderProps>) => React.JSX.Element;
@@ -9,11 +9,9 @@ declare const PALETTE: {
9
9
  white: string;
10
10
  product: {
11
11
  support: string;
12
- message: string;
13
12
  explore: string;
14
13
  gather: string;
15
14
  guide: string;
16
- connect: string;
17
15
  chat: string;
18
16
  talk: string;
19
17
  sell: string;
@@ -115,8 +113,6 @@ declare const PALETTE: {
115
113
  1000: string;
116
114
  1100: string;
117
115
  1200: string;
118
- M400: string;
119
- M600: string;
120
116
  };
121
117
  pink: {
122
118
  100: string;
@@ -131,8 +127,6 @@ declare const PALETTE: {
131
127
  1000: string;
132
128
  1100: string;
133
129
  1200: string;
134
- M400: string;
135
- M600: string;
136
130
  };
137
131
  crimson: {
138
132
  100: string;
@@ -147,8 +141,6 @@ declare const PALETTE: {
147
141
  1000: string;
148
142
  1100: string;
149
143
  1200: string;
150
- M400: string;
151
- M600: string;
152
144
  };
153
145
  orange: {
154
146
  100: string;
@@ -163,8 +155,6 @@ declare const PALETTE: {
163
155
  1000: string;
164
156
  1100: string;
165
157
  1200: string;
166
- M400: string;
167
- M600: string;
168
158
  };
169
159
  lemon: {
170
160
  100: string;
@@ -179,8 +169,6 @@ declare const PALETTE: {
179
169
  1000: string;
180
170
  1100: string;
181
171
  1200: string;
182
- M400: string;
183
- M600: string;
184
172
  };
185
173
  lime: {
186
174
  100: string;
@@ -195,8 +183,6 @@ declare const PALETTE: {
195
183
  1000: string;
196
184
  1100: string;
197
185
  1200: string;
198
- M400: string;
199
- M600: string;
200
186
  };
201
187
  mint: {
202
188
  100: string;
@@ -211,8 +197,6 @@ declare const PALETTE: {
211
197
  1000: string;
212
198
  1100: string;
213
199
  1200: string;
214
- M400: string;
215
- M600: string;
216
200
  };
217
201
  teal: {
218
202
  100: string;
@@ -227,8 +211,6 @@ declare const PALETTE: {
227
211
  1000: string;
228
212
  1100: string;
229
213
  1200: string;
230
- M400: string;
231
- M600: string;
232
214
  };
233
215
  azure: {
234
216
  100: string;
@@ -243,8 +225,6 @@ declare const PALETTE: {
243
225
  1000: string;
244
226
  1100: string;
245
227
  1200: string;
246
- M400: string;
247
- M600: string;
248
228
  };
249
229
  royal: {
250
230
  100: string;
@@ -259,8 +239,6 @@ declare const PALETTE: {
259
239
  1000: string;
260
240
  1100: string;
261
241
  1200: string;
262
- M400: string;
263
- M600: string;
264
242
  };
265
243
  purple: {
266
244
  100: string;
@@ -275,8 +253,6 @@ declare const PALETTE: {
275
253
  1000: string;
276
254
  1100: string;
277
255
  1200: string;
278
- M400: string;
279
- M600: string;
280
256
  };
281
257
  };
282
258
  export default PALETTE;
@@ -7,9 +7,9 @@
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 PALETTE_V8 } from './elements/palette/v8';
11
10
  export { default as retrieveComponentStyles } from './utils/retrieveComponentStyles';
12
11
  export { getArrowPosition } from './utils/getArrowPosition';
12
+ export { getCheckeredBackground } from './utils/getCheckeredBackground';
13
13
  export { getColor } from './utils/getColor';
14
14
  export { getColorV8 } from './utils/getColorV8';
15
15
  export { getFloatingPlacements } from './utils/getFloatingPlacements';
@@ -23,4 +23,5 @@ export { useWindow } from './utils/useWindow';
23
23
  export { useText } from './utils/useText';
24
24
  export { default as menuStyles } from './utils/menuStyles';
25
25
  export { focusStyles, SELECTOR_FOCUS_VISIBLE } from './utils/focusStyles';
26
- export { ARROW_POSITION, MENU_POSITION, PLACEMENT, type IGardenTheme, type IThemeProviderProps, type ArrowPosition, type ColorParameters, type FocusBoxShadowParameters, type FocusStylesParameters, type MenuPosition, type Placement } from './types';
26
+ export { StyledBaseIcon } from './utils/StyledBaseIcon';
27
+ 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';
@@ -11,6 +11,13 @@ export declare const MENU_POSITION: readonly ["top", "right", "bottom", "left"];
11
11
  export type MenuPosition = (typeof MENU_POSITION)[number];
12
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"];
13
13
  export type Placement = (typeof PLACEMENT)[number];
14
+ export type CheckeredBackgroundParameters = {
15
+ overlay?: string;
16
+ positionY?: number;
17
+ repeat?: 'repeat' | 'repeat-x';
18
+ size: number;
19
+ theme: IGardenTheme;
20
+ };
14
21
  export type ColorParameters = {
15
22
  dark?: {
16
23
  hue?: string;
@@ -85,11 +92,13 @@ export interface IGardenTheme {
85
92
  background: Record<string, string>;
86
93
  border: Record<string, string>;
87
94
  foreground: Record<string, string>;
95
+ shadow: Record<string, string>;
88
96
  };
89
97
  light: {
90
98
  background: Record<string, string>;
91
99
  border: Record<string, string>;
92
100
  foreground: Record<string, string>;
101
+ shadow: Record<string, string>;
93
102
  };
94
103
  };
95
104
  };
@@ -131,6 +140,7 @@ export interface IGardenTheme {
131
140
  xxl: string;
132
141
  xxxl: string;
133
142
  };
143
+ opacity: Record<number, number>;
134
144
  palette: Record<string, Hue>;
135
145
  shadowWidths: {
136
146
  xs: string;
@@ -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>;
@@ -8,24 +8,9 @@ import { ArrowPosition } from '../types';
8
8
  type ArrowOptions = {
9
9
  size?: string;
10
10
  inset?: string;
11
+ shift?: string;
11
12
  animationModifier?: string;
12
13
  };
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
14
  /**
30
15
  * CSS for an arrow at the given position and with the given size. The arrow is
31
16
  * positioned via `::before` and `::after` pseudo-elements and inherits the
@@ -53,6 +38,8 @@ export declare const exponentialSymbols: {
53
38
  * (right angle) of the arrow expressed as a CSS dimension.
54
39
  * @param {string} [options.inset='0'] Tweak arrow positioning by adjusting with
55
40
  * either a positive (push the arrow in) or negative (pull the arrow out) value.
41
+ * @param {string} [options.shift='0'] Shifts arrow positioning along
42
+ * the edge of the parent container.
56
43
  * @param {string} [options.animationModifier] A CSS class or attribute selector
57
44
  * which, when applied, animates the arrow's appearance.
58
45
  *
@@ -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;
@@ -4,7 +4,6 @@
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
- /// <reference types="lodash" />
8
7
  import { ColorParameters } from '../types';
9
8
  /**
10
9
  * Get a color value from the theme. Variable lookup takes precedence, followed
@@ -12,7 +11,7 @@ import { ColorParameters } from '../types';
12
11
  * `shade`, `offset`, and `transparency` are used as fallbacks to determine the
13
12
  * color.
14
13
  *
15
- * @param {Object} [options.theme] Provides values used to resolve the desired color
14
+ * @param {Object} options.theme Provides values used to resolve the desired color
16
15
  * @param {string} [options.variable] A variable key (i.e. `'background.default'`) used to resolve a color value for the theme color base
17
16
  * @param {Object} [options.dark] An object with `hue`, `shade`, `offset`, and `transparency` values to be used in dark mode
18
17
  * @param {Object} [options.light] An object with `hue`, `shade`, `offset`, and `transparency` values to be used in light mode
@@ -25,6 +24,6 @@ import { ColorParameters } from '../types';
25
24
  * - `'chromeHue'` = `theme.colors.chromeHue`
26
25
  * @param {number} [options.shade] A hue shade
27
26
  * @param {number} [options.offset] A positive or negative value to adjust the shade
28
- * @param {number} [options.transparency] An alpha-channel value between 0 and 1
27
+ * @param {number} [options.transparency] A `theme.opacity` key or an alpha-channel value between 0 and 1
29
28
  */
30
29
  export declare const getColor: (({ dark, hue, light, offset, shade, theme, transparency, variable }: ColorParameters) => string) & import("lodash").MemoizedFunction;
@@ -4,7 +4,6 @@
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
- /// <reference types="lodash" />
8
7
  import { Hue } from '../types';
9
8
  import { DefaultTheme } from 'styled-components';
10
9
  export declare const DEFAULT_SHADE = 600;
@@ -33,5 +33,5 @@ type MenuOptions = {
33
33
  * @param {string} [options.animationModifier] A CSS class or attribute selector
34
34
  * which, when applied, animates the menu's appearance.
35
35
  */
36
- export default function menuStyles(position: MenuPosition, options?: MenuOptions): import("styled-components").FlattenSimpleInterpolation;
36
+ export default function menuStyles(position: MenuPosition, options?: MenuOptions): import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<DefaultTheme>>;
37
37
  export {};
@@ -16,4 +16,4 @@ import { FC } from 'react';
16
16
  * @param text The default text to apply if the value of `props[name]` is undefined
17
17
  * @param condition An optional condition that can be used to prevent evaluation
18
18
  */
19
- export declare const useText: (component: Pick<FC, 'displayName'>, props: Record<string, any>, name: string, text: string, condition?: boolean) => string | undefined;
19
+ export declare const useText: (component: Pick<FC, "displayName">, props: Record<string, any>, name: string, text: string, condition?: boolean) => string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/react-theming",
3
- "version": "9.0.0-next.8",
3
+ "version": "9.0.0",
4
4
  "description": "Theming utilities and components within the Garden Design System",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Zendesk Garden <garden@zendesk.com>",
@@ -22,19 +22,18 @@
22
22
  "types": "dist/typings/index.d.ts",
23
23
  "dependencies": {
24
24
  "@floating-ui/react-dom": "^2.0.0",
25
- "chroma-js": "^2.4.2",
25
+ "color2k": "^2.0.3",
26
26
  "lodash.get": "^4.4.2",
27
27
  "lodash.memoize": "^4.1.2",
28
- "polished": "^4.0.0",
28
+ "polished": "^4.3.1",
29
29
  "prop-types": "^15.5.7"
30
30
  },
31
31
  "peerDependencies": {
32
- "react": ">=16.8.0",
33
- "react-dom": ">=16.8.0",
32
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
33
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
34
34
  "styled-components": "^4.2.0 || ^5.3.1"
35
35
  },
36
36
  "devDependencies": {
37
- "@types/chroma-js": "2.4.4",
38
37
  "@types/lodash.get": "4.4.9",
39
38
  "@types/lodash.memoize": "4.1.9"
40
39
  },
@@ -47,6 +46,5 @@
47
46
  "publishConfig": {
48
47
  "access": "public"
49
48
  },
50
- "zendeskgarden:src": "src/index.ts",
51
- "gitHead": "a3d6534843d5a4f5cb60b52bc67264f3230f2da0"
49
+ "zendeskgarden:src": "src/index.ts"
52
50
  }
package/LICENSE.md DELETED
@@ -1,176 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS