@zendeskgarden/react-theming 9.0.0-next.1 → 9.0.0-next.11

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 (40) hide show
  1. package/dist/esm/elements/ThemeProvider.js +24 -0
  2. package/dist/esm/elements/palette/index.js +259 -0
  3. package/dist/esm/elements/palette/v8.js +149 -0
  4. package/dist/esm/elements/theme/index.js +230 -0
  5. package/dist/esm/index.js +28 -0
  6. package/dist/esm/types/index.js +11 -0
  7. package/dist/esm/utils/StyledBaseIcon.js +22 -0
  8. package/dist/esm/utils/arrowStyles.js +64 -0
  9. package/dist/esm/utils/focusStyles.js +43 -0
  10. package/dist/esm/utils/getArrowPosition.js +35 -0
  11. package/dist/esm/utils/getCheckeredBackground.js +40 -0
  12. package/dist/esm/utils/getColor.js +187 -0
  13. package/dist/esm/utils/getColorV8.js +72 -0
  14. package/dist/esm/utils/getFloatingPlacements.js +58 -0
  15. package/dist/esm/utils/getFocusBoxShadow.js +45 -0
  16. package/dist/esm/utils/getLineHeight.js +22 -0
  17. package/dist/esm/utils/getMenuPosition.js +11 -0
  18. package/dist/esm/utils/mediaQuery.js +56 -0
  19. package/dist/esm/utils/menuStyles.js +63 -0
  20. package/dist/esm/utils/retrieveComponentStyles.js +19 -0
  21. package/dist/esm/utils/useDocument.js +21 -0
  22. package/dist/esm/utils/useText.js +29 -0
  23. package/dist/esm/utils/useWindow.js +21 -0
  24. package/dist/index.cjs.js +766 -177
  25. package/dist/typings/elements/ThemeProvider.d.ts +1 -1
  26. package/dist/typings/elements/palette/index.d.ts +134 -26
  27. package/dist/typings/elements/palette/v8.d.ts +149 -0
  28. package/dist/typings/elements/theme/index.d.ts +0 -1
  29. package/dist/typings/index.d.ts +6 -4
  30. package/dist/typings/types/index.d.ts +59 -16
  31. package/dist/typings/utils/StyledBaseIcon.d.ts +8 -0
  32. package/dist/typings/utils/focusStyles.d.ts +3 -11
  33. package/dist/typings/utils/getArrowPosition.d.ts +4 -2
  34. package/dist/typings/utils/getCheckeredBackground.d.ts +20 -0
  35. package/dist/typings/utils/getColor.d.ts +14 -9
  36. package/dist/typings/utils/getColorV8.d.ts +27 -0
  37. package/dist/typings/utils/getFocusBoxShadow.d.ts +6 -21
  38. package/dist/typings/utils/menuStyles.d.ts +2 -2
  39. package/package.json +8 -6
  40. package/dist/index.esm.js +0 -708
@@ -0,0 +1,27 @@
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
+ /// <reference types="lodash" />
8
+ import { Hue } from '../types';
9
+ import { DefaultTheme } from 'styled-components';
10
+ export declare const DEFAULT_SHADE = 600;
11
+ /**
12
+ * @deprecated Use `getColor` instead.
13
+ *
14
+ * Get the palette color for the given hue, shade, and theme.
15
+ *
16
+ * @param {string|Object} hue A `theme.palette` hue or one of the following `theme.colors` keys:
17
+ * - `'primaryHue'` = `theme.colors.primaryHue`
18
+ * - `'dangerHue'` = `theme.colors.dangerHue`
19
+ * - `'warningHue'` = `theme.colors.warningHue`
20
+ * - `'successHue'` = `theme.colors.successHue`
21
+ * - `'neutralHue'` = `theme.colors.neutralHue`
22
+ * - `'chromeHue'` = `theme.colors.chromeHue`
23
+ * @param {number} [shade=DEFAULT_SHADE] A hue shade.
24
+ * @param {Object} theme Context `theme` object.
25
+ * @param {Number} [transparency] An alpha-channel value between 0 and 1.
26
+ */
27
+ export declare const getColorV8: ((hue: Hue, shade?: number, theme?: DefaultTheme, transparency?: number) => string | undefined) & import("lodash").MemoizedFunction;
@@ -4,34 +4,19 @@
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 { IGardenTheme } from '../types';
8
- import { Hue } from './getColor';
9
- export type FocusBoxShadowParameters = {
10
- boxShadow?: string;
11
- inset?: boolean;
12
- hue?: Hue;
13
- shade?: number;
14
- shadowWidth?: 'sm' | 'md';
15
- spacerHue?: Hue;
16
- spacerShade?: number;
17
- spacerWidth?: null | 'xs' | 'sm';
18
- theme: IGardenTheme;
19
- };
7
+ import { FocusBoxShadowParameters } from '../types';
20
8
  /**
21
- * Get a CSS `box-shadow` property value for focus state styling. The `hue` and
22
- * `shade` are used to determine the color of the focus ring.
9
+ * Get a CSS `box-shadow` property value for focus state styling.
23
10
  *
24
11
  * @param {string} [options.boxShadow] Provides an existing `box-shadow` (a drop shadow, for example) to be retained along with the focus ring
25
12
  * @param {boolean} [options.inset=false] Determines whether the `box-shadow` is inset
26
- * @param {string|Object} [options.hue='primaryHue'] Provides a theme object `palette` hue or `color` key, or any valid CSS color notation
27
- * @param {number} [options.shade=600] Selects a shade for the given `hue`
13
+ * @param {Object} [options.color={ variable: 'border.primaryEmphasis' }] Provides an object with `getColor` parameters used to determine the focus ring color
28
14
  * @param {string} [options.shadowWidth='md'] Provides a theme object `shadowWidth` key for the cumulative width of the `box-shadow`
29
- * @param {string|Object} [options.spacerHue='background'] Provides a theme object `palette` hue or `color` key, or any valid CSS color notation
30
- * @param {number} [options.spacerShade=600] Selects a shade for the given `spacerHue`
15
+ * @param {Object} [options.spacerColor={ variable: 'background.default' }] Provides an object with `getColor` parameters used to determine the spacer color
31
16
  * @param {string} [options.spacerWidth='xs'] Provides a theme object `shadowWidth` for the white spacer, or `null` to remove
32
17
  * @param {Object} options.theme Provides values used to resolve the desired color
33
18
  *
34
19
  * @returns A `box-shadow` property value for the given options. Default is a
35
- * 3px `blue[600]` ring with a 1px white spacer overlay.
20
+ * 3px blue ring with a 1px spacer overlay that matches the background.
36
21
  */
37
- export declare const getFocusBoxShadow: ({ boxShadow, inset, hue, shade, shadowWidth, spacerHue, spacerShade, spacerWidth, theme }: FocusBoxShadowParameters) => string;
22
+ export declare const getFocusBoxShadow: ({ boxShadow, inset, color, shadowWidth, spacerColor, spacerWidth, theme, ...args }: FocusBoxShadowParameters) => string;
@@ -16,8 +16,8 @@ type MenuOptions = {
16
16
  };
17
17
  /**
18
18
  * CSS for a `wrapper > menu` at the given position. The wrapper provides
19
- * absolute positioning (e.g. via Popper). The menu provides basic styling and
20
- * optional animation.
19
+ * absolute positioning (e.g. via Floating-UI). The menu provides basic styling
20
+ * and optional animation.
21
21
  *
22
22
  * @param {string} position One of:
23
23
  * - `'top'`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/react-theming",
3
- "version": "9.0.0-next.1",
3
+ "version": "9.0.0-next.11",
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>",
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/zendeskgarden/react-components/issues"
11
11
  },
12
12
  "main": "dist/index.cjs.js",
13
- "module": "dist/index.esm.js",
13
+ "module": "dist/esm/index.js",
14
14
  "files": [
15
15
  "dist"
16
16
  ],
@@ -22,8 +22,8 @@
22
22
  "types": "dist/typings/index.d.ts",
23
23
  "dependencies": {
24
24
  "@floating-ui/react-dom": "^2.0.0",
25
- "@zendeskgarden/container-focusvisible": "^2.0.0",
26
- "@zendeskgarden/container-utilities": "^2.0.0",
25
+ "chroma-js": "^2.4.2",
26
+ "lodash.get": "^4.4.2",
27
27
  "lodash.memoize": "^4.1.2",
28
28
  "polished": "^4.0.0",
29
29
  "prop-types": "^15.5.7"
@@ -31,9 +31,11 @@
31
31
  "peerDependencies": {
32
32
  "react": ">=16.8.0",
33
33
  "react-dom": ">=16.8.0",
34
- "styled-components": "^4.2.0 || ^5.1.0"
34
+ "styled-components": "^4.2.0 || ^5.3.1"
35
35
  },
36
36
  "devDependencies": {
37
+ "@types/chroma-js": "2.4.4",
38
+ "@types/lodash.get": "4.4.9",
37
39
  "@types/lodash.memoize": "4.1.9"
38
40
  },
39
41
  "keywords": [
@@ -46,5 +48,5 @@
46
48
  "access": "public"
47
49
  },
48
50
  "zendeskgarden:src": "src/index.ts",
49
- "gitHead": "a9e4e776bf6ad8860a198fc24f27b2b5cbc83320"
51
+ "gitHead": "0de1cc664807bd993ccd3beeb78e8fd1f3828320"
50
52
  }