@workday/canvas-kit-react 14.0.9 → 14.1.0-1282-next.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.
- package/common/lib/theming/createCanvasTheme.ts +4 -0
- package/common/lib/theming/styled.ts +6 -0
- package/common/lib/theming/theme.ts +3 -0
- package/common/lib/theming/useIsRTL.ts +1 -1
- package/common/lib/theming/useTheme.ts +3 -0
- package/common/lib/theming/useThemedRing.ts +4 -0
- package/dist/commonjs/common/lib/theming/createCanvasTheme.d.ts +4 -0
- package/dist/commonjs/common/lib/theming/createCanvasTheme.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/createCanvasTheme.js +4 -0
- package/dist/commonjs/common/lib/theming/styled.d.ts +6 -0
- package/dist/commonjs/common/lib/theming/styled.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/styled.js +6 -0
- package/dist/commonjs/common/lib/theming/theme.d.ts +3 -0
- package/dist/commonjs/common/lib/theming/theme.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/theme.js +3 -0
- package/dist/commonjs/common/lib/theming/useIsRTL.d.ts +1 -1
- package/dist/commonjs/common/lib/theming/useIsRTL.js +1 -1
- package/dist/commonjs/common/lib/theming/useTheme.d.ts +2 -0
- package/dist/commonjs/common/lib/theming/useTheme.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/useTheme.js +3 -0
- package/dist/commonjs/common/lib/theming/useThemedRing.d.ts +4 -0
- package/dist/commonjs/common/lib/theming/useThemedRing.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/useThemedRing.js +4 -0
- package/dist/es6/common/lib/theming/createCanvasTheme.d.ts +4 -0
- package/dist/es6/common/lib/theming/createCanvasTheme.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/createCanvasTheme.js +4 -0
- package/dist/es6/common/lib/theming/styled.d.ts +6 -0
- package/dist/es6/common/lib/theming/styled.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/styled.js +6 -0
- package/dist/es6/common/lib/theming/theme.d.ts +3 -0
- package/dist/es6/common/lib/theming/theme.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/theme.js +3 -0
- package/dist/es6/common/lib/theming/useIsRTL.d.ts +1 -1
- package/dist/es6/common/lib/theming/useIsRTL.js +1 -1
- package/dist/es6/common/lib/theming/useTheme.d.ts +2 -0
- package/dist/es6/common/lib/theming/useTheme.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/useTheme.js +3 -0
- package/dist/es6/common/lib/theming/useThemedRing.d.ts +4 -0
- package/dist/es6/common/lib/theming/useThemedRing.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/useThemedRing.js +4 -0
- package/package.json +4 -4
|
@@ -15,6 +15,9 @@ import {pickForegroundColor} from '../utils';
|
|
|
15
15
|
import {deepMerge} from '../utils/deepMerge';
|
|
16
16
|
import {memoize} from '../utils/memoize';
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated ⚠️ `shiftColor` is deprecated and will be removed in a future major version. While we work on an algorithm for color shifting, you can use [oklch from or with calc](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/oklch) to calculate colors.
|
|
20
|
+
*/
|
|
18
21
|
export const shiftColor = memoize(
|
|
19
22
|
(hexColor: string, amount = 100) => {
|
|
20
23
|
const canvasColor = Object.keys(colors).find(color => colors[color] === hexColor);
|
|
@@ -105,5 +108,6 @@ function calculateCanvasTheme(partialTheme: PartialCanvasTheme): CanvasTheme {
|
|
|
105
108
|
* Creates a full {@link CanvasTheme} from any partial theme by deeply merging with the
|
|
106
109
|
* `defaultCanvasTheme` object. The function is memoized, but it is best to run this function
|
|
107
110
|
* only once and save the result.
|
|
111
|
+
* @deprecated ⚠️ `createCanvasTheme` is deprecated and will be removed in a future major version. Please use our CSS Branding tokens to create a theme. For more information, please use our [theming docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs).
|
|
108
112
|
*/
|
|
109
113
|
export const createCanvasTheme = memoize(calculateCanvasTheme, (...args) => JSON.stringify(args));
|
|
@@ -10,6 +10,9 @@ interface ThemingStyledOptions {
|
|
|
10
10
|
shouldForwardProp?: (prop: any) => boolean;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated ⚠️ `filterOutProps` is deprecated and will be removed in a future major version. Use our `createComponent` and `handleCsProp` helpers to handle props. For more information, view our [Meriging Styles Docs](https://workday.github.io/canvas-kit/?path=/docs/styling-guides-merging-styles--docs#handlecsprop).
|
|
15
|
+
*/
|
|
13
16
|
export const filterOutProps = (omittedProps: string[]) => {
|
|
14
17
|
return (prop: string) => !omittedProps.includes(prop);
|
|
15
18
|
};
|
|
@@ -42,4 +45,7 @@ function styled<Props>(node: any, options?: ThemingStyledOptions) {
|
|
|
42
45
|
};
|
|
43
46
|
}
|
|
44
47
|
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated ⚠️ `styled` is deprecated and will be removed in a future major version. Please use `createStyles` or `createStencil` instead with [CSS logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values). For more information, view our [Styling docs](https://workday.github.io/canvas-kit/?path=/docs/styling-getting-started-overview--docs).
|
|
50
|
+
*/
|
|
45
51
|
export default styled as CreateStyled;
|
|
@@ -2,6 +2,9 @@ import {CanvasTheme, ContentDirection} from './types';
|
|
|
2
2
|
import {base} from '@workday/canvas-tokens-web';
|
|
3
3
|
import {breakpoints, up, down, between, only} from './breakpoints';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated ⚠️ `defaultCanvasTheme` is deprecated and will be removed in a future major version. If you want to reset the theme, use `defaultBranding` and apply it to the `CanvasProvider`. For more information, view our [theming docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs).
|
|
7
|
+
*/
|
|
5
8
|
export const defaultCanvasTheme: CanvasTheme = {
|
|
6
9
|
palette: {
|
|
7
10
|
primary: {
|
|
@@ -14,7 +14,7 @@ function useDefaultTheme<T, C>(theme: T | undefined, config: C, fn: (config: C)
|
|
|
14
14
|
* const isRTL = useIsRTL();
|
|
15
15
|
* ```
|
|
16
16
|
*
|
|
17
|
-
* @deprecated
|
|
17
|
+
* @deprecated ⚠️ `useIsRTL` is deprecated and will be removed in a future major version. Please use `isElementRTL` instead.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
export const useIsRTL = (partialTheme?: PartialEmotionCanvasTheme) => {
|
|
@@ -13,6 +13,7 @@ import {base} from '@workday/canvas-tokens-web';
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* We can adjust the shift but this should get us close enough until we clean up the algorithm to determine the colors.
|
|
16
|
+
* @deprecated ⚠️ `shiftColor` is deprecated and will be removed in a future major version. While we work on an algorithm for color shifting, you can use [`oklch from`](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/oklch) to generate a palette.
|
|
16
17
|
*/
|
|
17
18
|
const shiftColor = (color: string, value: number) => {
|
|
18
19
|
return `oklch(from ${color} calc(l ${value > 0 ? '+' : '-'} ${Math.abs(value) / 1000}) c h)`;
|
|
@@ -108,6 +109,7 @@ const getFilledTheme = (theme: PartialEmotionCanvasTheme): EmotionCanvasTheme =>
|
|
|
108
109
|
* margin: space.l
|
|
109
110
|
* }
|
|
110
111
|
* }
|
|
112
|
+
* @deprecated ⚠️ `getTheme` is deprecated and will be removed in a future major version. Please use our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs) to theme components.
|
|
111
113
|
*/
|
|
112
114
|
export function getTheme(theme?: PartialEmotionCanvasTheme): EmotionCanvasTheme {
|
|
113
115
|
if (theme?.canvas) {
|
|
@@ -150,6 +152,7 @@ export function getTheme(theme?: PartialEmotionCanvasTheme): EmotionCanvasTheme
|
|
|
150
152
|
* <Subtext size="large" color={theme.canvas.palette.error.main}>
|
|
151
153
|
* );
|
|
152
154
|
* }
|
|
155
|
+
* @deprecated ⚠️ `useTheme` is deprecated and will be removed in a future major version. Please use our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs) to theme components.
|
|
153
156
|
*/
|
|
154
157
|
export function useTheme(theme?: PartialEmotionCanvasTheme): EmotionCanvasTheme {
|
|
155
158
|
if (!theme) {
|
|
@@ -40,6 +40,9 @@ const getPaletteColorsFromTheme = (
|
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated ⚠️ `getPaletteColorsForFocusRing` is deprecated and will be removed in a future major version. Please use the `brand.common.focusRing` CSS variable to theme focus rings. For more information, view our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs).
|
|
45
|
+
*/
|
|
43
46
|
export function getPaletteColorsForFocusRing(
|
|
44
47
|
type: paletteSelection,
|
|
45
48
|
theme: EmotionCanvasTheme
|
|
@@ -99,6 +102,7 @@ export function getPaletteColorsForFocusRing(
|
|
|
99
102
|
* );
|
|
100
103
|
* };
|
|
101
104
|
*```
|
|
105
|
+
* @deprecated `useThemedRing` is deprecated and will be removed in a future major version. Please use `brand.common.focusOutline` CSS variable instead. View our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs) for more information.
|
|
102
106
|
*/
|
|
103
107
|
export const useThemedRing = (type: paletteSelection): CSSProperties => {
|
|
104
108
|
const theme = useTheme();
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { CanvasTheme, PartialCanvasTheme } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated ⚠️ `shiftColor` is deprecated and will be removed in a future major version. While we work on an algorithm for color shifting, you can use [oklch from or with calc](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/oklch) to calculate colors.
|
|
4
|
+
*/
|
|
2
5
|
export declare const shiftColor: (hexColor: string, amount?: any) => string;
|
|
3
6
|
declare function calculateCanvasTheme(partialTheme: PartialCanvasTheme): CanvasTheme;
|
|
4
7
|
/**
|
|
5
8
|
* Creates a full {@link CanvasTheme} from any partial theme by deeply merging with the
|
|
6
9
|
* `defaultCanvasTheme` object. The function is memoized, but it is best to run this function
|
|
7
10
|
* only once and save the result.
|
|
11
|
+
* @deprecated ⚠️ `createCanvasTheme` is deprecated and will be removed in a future major version. Please use our CSS Branding tokens to create a theme. For more information, please use our [theming docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs).
|
|
8
12
|
*/
|
|
9
13
|
export declare const createCanvasTheme: typeof calculateCanvasTheme;
|
|
10
14
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCanvasTheme.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/createCanvasTheme.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,kBAAkB,EAInB,MAAM,SAAS,CAAC;AAQjB,eAAO,MAAM,UAAU,aACV,MAAM,yBA+BlB,CAAC;AAkCF,iBAAS,oBAAoB,CAAC,YAAY,EAAE,kBAAkB,GAAG,WAAW,CAkB3E;AAED
|
|
1
|
+
{"version":3,"file":"createCanvasTheme.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/createCanvasTheme.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,kBAAkB,EAInB,MAAM,SAAS,CAAC;AAQjB;;GAEG;AACH,eAAO,MAAM,UAAU,aACV,MAAM,yBA+BlB,CAAC;AAkCF,iBAAS,oBAAoB,CAAC,YAAY,EAAE,kBAAkB,GAAG,WAAW,CAkB3E;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,6BAAmE,CAAC"}
|
|
@@ -12,6 +12,9 @@ const utils_1 = require("../utils");
|
|
|
12
12
|
// Should these be exported?
|
|
13
13
|
const deepMerge_1 = require("../utils/deepMerge");
|
|
14
14
|
const memoize_1 = require("../utils/memoize");
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated ⚠️ `shiftColor` is deprecated and will be removed in a future major version. While we work on an algorithm for color shifting, you can use [oklch from or with calc](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/oklch) to calculate colors.
|
|
17
|
+
*/
|
|
15
18
|
exports.shiftColor = (0, memoize_1.memoize)((hexColor, amount = 100) => {
|
|
16
19
|
const canvasColor = Object.keys(canvas_colors_web_1.default).find(color => canvas_colors_web_1.default[color] === hexColor);
|
|
17
20
|
if (canvasColor) {
|
|
@@ -79,5 +82,6 @@ function calculateCanvasTheme(partialTheme) {
|
|
|
79
82
|
* Creates a full {@link CanvasTheme} from any partial theme by deeply merging with the
|
|
80
83
|
* `defaultCanvasTheme` object. The function is memoized, but it is best to run this function
|
|
81
84
|
* only once and save the result.
|
|
85
|
+
* @deprecated ⚠️ `createCanvasTheme` is deprecated and will be removed in a future major version. Please use our CSS Branding tokens to create a theme. For more information, please use our [theming docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs).
|
|
82
86
|
*/
|
|
83
87
|
exports.createCanvasTheme = (0, memoize_1.memoize)(calculateCanvasTheme, (...args) => JSON.stringify(args));
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { CreateStyled } from '@emotion/styled';
|
|
2
2
|
import { CSSProperties } from '@workday/canvas-kit-react/tokens';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated ⚠️ `filterOutProps` is deprecated and will be removed in a future major version. Use our `createComponent` and `handleCsProp` helpers to handle props. For more information, view our [Meriging Styles Docs](https://workday.github.io/canvas-kit/?path=/docs/styling-guides-merging-styles--docs#handlecsprop).
|
|
5
|
+
*/
|
|
3
6
|
export declare const filterOutProps: (omittedProps: string[]) => (prop: string) => boolean;
|
|
4
7
|
export type StyleRewriteFn = (obj?: CSSProperties) => CSSProperties | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated ⚠️ `styled` is deprecated and will be removed in a future major version. Please use `createStyles` or `createStencil` instead with [CSS logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values). For more information, view our [Styling docs](https://workday.github.io/canvas-kit/?path=/docs/styling-getting-started-overview--docs).
|
|
10
|
+
*/
|
|
5
11
|
declare const _default: CreateStyled;
|
|
6
12
|
export default _default;
|
|
7
13
|
//# sourceMappingURL=styled.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,YAAY,EAA2B,MAAM,iBAAiB,CAAC;AACjG,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAW/D,eAAO,MAAM,cAAc,iBAAkB,MAAM,EAAE,YACrC,MAAM,YACrB,CAAC;AAIF,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,CAAC,EAAE,aAAa,KAAK,aAAa,GAAG,SAAS,CAAC;;
|
|
1
|
+
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,YAAY,EAA2B,MAAM,iBAAiB,CAAC;AACjG,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAW/D;;GAEG;AACH,eAAO,MAAM,cAAc,iBAAkB,MAAM,EAAE,YACrC,MAAM,YACrB,CAAC;AAIF,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,CAAC,EAAE,aAAa,KAAK,aAAa,GAAG,SAAS,CAAC;AA0BhF;;GAEG;;AACH,wBAAsC"}
|
|
@@ -8,6 +8,9 @@ const styled_1 = __importDefault(require("@emotion/styled"));
|
|
|
8
8
|
const index_1 = require("./index");
|
|
9
9
|
const rtl_css_js_1 = __importDefault(require("rtl-css-js"));
|
|
10
10
|
const noop = (styles) => styles;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated ⚠️ `filterOutProps` is deprecated and will be removed in a future major version. Use our `createComponent` and `handleCsProp` helpers to handle props. For more information, view our [Meriging Styles Docs](https://workday.github.io/canvas-kit/?path=/docs/styling-guides-merging-styles--docs#handlecsprop).
|
|
13
|
+
*/
|
|
11
14
|
const filterOutProps = (omittedProps) => {
|
|
12
15
|
return (prop) => !omittedProps.includes(prop);
|
|
13
16
|
};
|
|
@@ -32,4 +35,7 @@ function styled(node, options) {
|
|
|
32
35
|
return (0, styled_1.default)(node, options)(newArgs);
|
|
33
36
|
};
|
|
34
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated ⚠️ `styled` is deprecated and will be removed in a future major version. Please use `createStyles` or `createStencil` instead with [CSS logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values). For more information, view our [Styling docs](https://workday.github.io/canvas-kit/?path=/docs/styling-getting-started-overview--docs).
|
|
40
|
+
*/
|
|
35
41
|
exports.default = styled;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { CanvasTheme } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated ⚠️ `defaultCanvasTheme` is deprecated and will be removed in a future major version. If you want to reset the theme, use `defaultBranding` and apply it to the `CanvasProvider`. For more information, view our [theming docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs).
|
|
4
|
+
*/
|
|
2
5
|
export declare const defaultCanvasTheme: CanvasTheme;
|
|
3
6
|
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAmB,MAAM,SAAS,CAAC;AAItD,eAAO,MAAM,kBAAkB,EAAE,WA8DhC,CAAC"}
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAmB,MAAM,SAAS,CAAC;AAItD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,WA8DhC,CAAC"}
|
|
@@ -4,6 +4,9 @@ exports.defaultCanvasTheme = void 0;
|
|
|
4
4
|
const types_1 = require("./types");
|
|
5
5
|
const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
6
6
|
const breakpoints_1 = require("./breakpoints");
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated ⚠️ `defaultCanvasTheme` is deprecated and will be removed in a future major version. If you want to reset the theme, use `defaultBranding` and apply it to the `CanvasProvider`. For more information, view our [theming docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs).
|
|
9
|
+
*/
|
|
7
10
|
exports.defaultCanvasTheme = {
|
|
8
11
|
palette: {
|
|
9
12
|
primary: {
|
|
@@ -7,7 +7,7 @@ import { PartialEmotionCanvasTheme } from './types';
|
|
|
7
7
|
* const isRTL = useIsRTL();
|
|
8
8
|
* ```
|
|
9
9
|
*
|
|
10
|
-
* @deprecated
|
|
10
|
+
* @deprecated ⚠️ `useIsRTL` is deprecated and will be removed in a future major version. Please use `isElementRTL` instead.
|
|
11
11
|
*/
|
|
12
12
|
export declare const useIsRTL: (partialTheme?: PartialEmotionCanvasTheme) => boolean;
|
|
13
13
|
//# sourceMappingURL=useIsRTL.d.ts.map
|
|
@@ -38,7 +38,7 @@ function useDefaultTheme(theme, config, fn) {
|
|
|
38
38
|
* const isRTL = useIsRTL();
|
|
39
39
|
* ```
|
|
40
40
|
*
|
|
41
|
-
* @deprecated
|
|
41
|
+
* @deprecated ⚠️ `useIsRTL` is deprecated and will be removed in a future major version. Please use `isElementRTL` instead.
|
|
42
42
|
*/
|
|
43
43
|
const useIsRTL = (partialTheme) => {
|
|
44
44
|
const theme = useDefaultTheme(partialTheme, react_1.ThemeContext, React.useContext);
|
|
@@ -31,6 +31,7 @@ import { EmotionCanvasTheme, PartialEmotionCanvasTheme } from './index';
|
|
|
31
31
|
* margin: space.l
|
|
32
32
|
* }
|
|
33
33
|
* }
|
|
34
|
+
* @deprecated ⚠️ `getTheme` is deprecated and will be removed in a future major version. Please use our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs) to theme components.
|
|
34
35
|
*/
|
|
35
36
|
export declare function getTheme(theme?: PartialEmotionCanvasTheme): EmotionCanvasTheme;
|
|
36
37
|
/**
|
|
@@ -60,6 +61,7 @@ export declare function getTheme(theme?: PartialEmotionCanvasTheme): EmotionCanv
|
|
|
60
61
|
* <Subtext size="large" color={theme.canvas.palette.error.main}>
|
|
61
62
|
* );
|
|
62
63
|
* }
|
|
64
|
+
* @deprecated ⚠️ `useTheme` is deprecated and will be removed in a future major version. Please use our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs) to theme components.
|
|
63
65
|
*/
|
|
64
66
|
export declare function useTheme(theme?: PartialEmotionCanvasTheme): EmotionCanvasTheme;
|
|
65
67
|
//# sourceMappingURL=useTheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/useTheme.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,kBAAkB,EAClB,yBAAyB,EAE1B,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/useTheme.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,kBAAkB,EAClB,yBAAyB,EAE1B,MAAM,SAAS,CAAC;AAsEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,QAAQ,CAAC,KAAK,CAAC,EAAE,yBAAyB,GAAG,kBAAkB,CAY9E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,QAAQ,CAAC,KAAK,CAAC,EAAE,yBAAyB,GAAG,kBAAkB,CAkB9E"}
|
|
@@ -9,6 +9,7 @@ const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
|
9
9
|
const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
10
10
|
/**
|
|
11
11
|
* We can adjust the shift but this should get us close enough until we clean up the algorithm to determine the colors.
|
|
12
|
+
* @deprecated ⚠️ `shiftColor` is deprecated and will be removed in a future major version. While we work on an algorithm for color shifting, you can use [`oklch from`](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/oklch) to generate a palette.
|
|
12
13
|
*/
|
|
13
14
|
const shiftColor = (color, value) => {
|
|
14
15
|
return `oklch(from ${color} calc(l ${value > 0 ? '+' : '-'} ${Math.abs(value) / 1000}) c h)`;
|
|
@@ -93,6 +94,7 @@ const getFilledTheme = (theme) => {
|
|
|
93
94
|
* margin: space.l
|
|
94
95
|
* }
|
|
95
96
|
* }
|
|
97
|
+
* @deprecated ⚠️ `getTheme` is deprecated and will be removed in a future major version. Please use our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs) to theme components.
|
|
96
98
|
*/
|
|
97
99
|
function getTheme(theme) {
|
|
98
100
|
var _a, _b;
|
|
@@ -133,6 +135,7 @@ exports.getTheme = getTheme;
|
|
|
133
135
|
* <Subtext size="large" color={theme.canvas.palette.error.main}>
|
|
134
136
|
* );
|
|
135
137
|
* }
|
|
138
|
+
* @deprecated ⚠️ `useTheme` is deprecated and will be removed in a future major version. Please use our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs) to theme components.
|
|
136
139
|
*/
|
|
137
140
|
function useTheme(theme) {
|
|
138
141
|
if (!theme) {
|
|
@@ -5,6 +5,9 @@ interface ContrastColors {
|
|
|
5
5
|
outer?: string;
|
|
6
6
|
inner?: string;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated ⚠️ `getPaletteColorsForFocusRing` is deprecated and will be removed in a future major version. Please use the `brand.common.focusRing` CSS variable to theme focus rings. For more information, view our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs).
|
|
10
|
+
*/
|
|
8
11
|
export declare function getPaletteColorsForFocusRing(type: paletteSelection, theme: EmotionCanvasTheme): ContrastColors;
|
|
9
12
|
/**
|
|
10
13
|
* This is a way to automatically add themed colors to your input and is helpful when showing alerts, success or errors to users.
|
|
@@ -40,6 +43,7 @@ export declare function getPaletteColorsForFocusRing(type: paletteSelection, the
|
|
|
40
43
|
* );
|
|
41
44
|
* };
|
|
42
45
|
*```
|
|
46
|
+
* @deprecated `useThemedRing` is deprecated and will be removed in a future major version. Please use `brand.common.focusOutline` CSS variable instead. View our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs) for more information.
|
|
43
47
|
*/
|
|
44
48
|
export declare const useThemedRing: (type: paletteSelection) => CSSProperties;
|
|
45
49
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemedRing.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/useThemedRing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,kBAAkB,EAAW,MAAM,kCAAkC,CAAC;AAE3F,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAG/D,KAAK,gBAAgB,GAAG,OAAO,CAAC,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;AACzF,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAiCD,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,kBAAkB,GACxB,cAAc,CAoBhB;AAED
|
|
1
|
+
{"version":3,"file":"useThemedRing.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/useThemedRing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,kBAAkB,EAAW,MAAM,kCAAkC,CAAC;AAE3F,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAG/D,KAAK,gBAAgB,GAAG,OAAO,CAAC,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;AACzF,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAiCD;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,kBAAkB,GACxB,cAAc,CAoBhB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,aAAa,SAAU,gBAAgB,KAAG,aA0BtD,CAAC"}
|
|
@@ -30,6 +30,9 @@ const getPaletteColorsFromTheme = (palette, fallbackColors, errorType) => {
|
|
|
30
30
|
inner: (0, canvas_kit_styling_1.cssVar)(canvas_tokens_web_1.brand.common.focusOutline),
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated ⚠️ `getPaletteColorsForFocusRing` is deprecated and will be removed in a future major version. Please use the `brand.common.focusRing` CSS variable to theme focus rings. For more information, view our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs).
|
|
35
|
+
*/
|
|
33
36
|
function getPaletteColorsForFocusRing(type, theme) {
|
|
34
37
|
switch (type) {
|
|
35
38
|
case 'error': {
|
|
@@ -86,6 +89,7 @@ exports.getPaletteColorsForFocusRing = getPaletteColorsForFocusRing;
|
|
|
86
89
|
* );
|
|
87
90
|
* };
|
|
88
91
|
*```
|
|
92
|
+
* @deprecated `useThemedRing` is deprecated and will be removed in a future major version. Please use `brand.common.focusOutline` CSS variable instead. View our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs) for more information.
|
|
89
93
|
*/
|
|
90
94
|
const useThemedRing = (type) => {
|
|
91
95
|
const theme = (0, common_1.useTheme)();
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { CanvasTheme, PartialCanvasTheme } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated ⚠️ `shiftColor` is deprecated and will be removed in a future major version. While we work on an algorithm for color shifting, you can use [oklch from or with calc](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/oklch) to calculate colors.
|
|
4
|
+
*/
|
|
2
5
|
export declare const shiftColor: (hexColor: string, amount?: any) => string;
|
|
3
6
|
declare function calculateCanvasTheme(partialTheme: PartialCanvasTheme): CanvasTheme;
|
|
4
7
|
/**
|
|
5
8
|
* Creates a full {@link CanvasTheme} from any partial theme by deeply merging with the
|
|
6
9
|
* `defaultCanvasTheme` object. The function is memoized, but it is best to run this function
|
|
7
10
|
* only once and save the result.
|
|
11
|
+
* @deprecated ⚠️ `createCanvasTheme` is deprecated and will be removed in a future major version. Please use our CSS Branding tokens to create a theme. For more information, please use our [theming docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs).
|
|
8
12
|
*/
|
|
9
13
|
export declare const createCanvasTheme: typeof calculateCanvasTheme;
|
|
10
14
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCanvasTheme.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/createCanvasTheme.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,kBAAkB,EAInB,MAAM,SAAS,CAAC;AAQjB,eAAO,MAAM,UAAU,aACV,MAAM,yBA+BlB,CAAC;AAkCF,iBAAS,oBAAoB,CAAC,YAAY,EAAE,kBAAkB,GAAG,WAAW,CAkB3E;AAED
|
|
1
|
+
{"version":3,"file":"createCanvasTheme.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/createCanvasTheme.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,kBAAkB,EAInB,MAAM,SAAS,CAAC;AAQjB;;GAEG;AACH,eAAO,MAAM,UAAU,aACV,MAAM,yBA+BlB,CAAC;AAkCF,iBAAS,oBAAoB,CAAC,YAAY,EAAE,kBAAkB,GAAG,WAAW,CAkB3E;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,6BAAmE,CAAC"}
|
|
@@ -6,6 +6,9 @@ import { pickForegroundColor } from '../utils';
|
|
|
6
6
|
// Should these be exported?
|
|
7
7
|
import { deepMerge } from '../utils/deepMerge';
|
|
8
8
|
import { memoize } from '../utils/memoize';
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated ⚠️ `shiftColor` is deprecated and will be removed in a future major version. While we work on an algorithm for color shifting, you can use [oklch from or with calc](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/oklch) to calculate colors.
|
|
11
|
+
*/
|
|
9
12
|
export const shiftColor = memoize((hexColor, amount = 100) => {
|
|
10
13
|
const canvasColor = Object.keys(colors).find(color => colors[color] === hexColor);
|
|
11
14
|
if (canvasColor) {
|
|
@@ -73,5 +76,6 @@ function calculateCanvasTheme(partialTheme) {
|
|
|
73
76
|
* Creates a full {@link CanvasTheme} from any partial theme by deeply merging with the
|
|
74
77
|
* `defaultCanvasTheme` object. The function is memoized, but it is best to run this function
|
|
75
78
|
* only once and save the result.
|
|
79
|
+
* @deprecated ⚠️ `createCanvasTheme` is deprecated and will be removed in a future major version. Please use our CSS Branding tokens to create a theme. For more information, please use our [theming docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs).
|
|
76
80
|
*/
|
|
77
81
|
export const createCanvasTheme = memoize(calculateCanvasTheme, (...args) => JSON.stringify(args));
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { CreateStyled } from '@emotion/styled';
|
|
2
2
|
import { CSSProperties } from '@workday/canvas-kit-react/tokens';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated ⚠️ `filterOutProps` is deprecated and will be removed in a future major version. Use our `createComponent` and `handleCsProp` helpers to handle props. For more information, view our [Meriging Styles Docs](https://workday.github.io/canvas-kit/?path=/docs/styling-guides-merging-styles--docs#handlecsprop).
|
|
5
|
+
*/
|
|
3
6
|
export declare const filterOutProps: (omittedProps: string[]) => (prop: string) => boolean;
|
|
4
7
|
export type StyleRewriteFn = (obj?: CSSProperties) => CSSProperties | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated ⚠️ `styled` is deprecated and will be removed in a future major version. Please use `createStyles` or `createStencil` instead with [CSS logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values). For more information, view our [Styling docs](https://workday.github.io/canvas-kit/?path=/docs/styling-getting-started-overview--docs).
|
|
10
|
+
*/
|
|
5
11
|
declare const _default: CreateStyled;
|
|
6
12
|
export default _default;
|
|
7
13
|
//# sourceMappingURL=styled.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,YAAY,EAA2B,MAAM,iBAAiB,CAAC;AACjG,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAW/D,eAAO,MAAM,cAAc,iBAAkB,MAAM,EAAE,YACrC,MAAM,YACrB,CAAC;AAIF,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,CAAC,EAAE,aAAa,KAAK,aAAa,GAAG,SAAS,CAAC;;
|
|
1
|
+
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,YAAY,EAA2B,MAAM,iBAAiB,CAAC;AACjG,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAW/D;;GAEG;AACH,eAAO,MAAM,cAAc,iBAAkB,MAAM,EAAE,YACrC,MAAM,YACrB,CAAC;AAIF,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,CAAC,EAAE,aAAa,KAAK,aAAa,GAAG,SAAS,CAAC;AA0BhF;;GAEG;;AACH,wBAAsC"}
|
|
@@ -2,6 +2,9 @@ import { default as emotionStyled } from '@emotion/styled';
|
|
|
2
2
|
import { useTheme, ContentDirection } from './index';
|
|
3
3
|
import rtlCSSJS from 'rtl-css-js';
|
|
4
4
|
const noop = (styles) => styles;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated ⚠️ `filterOutProps` is deprecated and will be removed in a future major version. Use our `createComponent` and `handleCsProp` helpers to handle props. For more information, view our [Meriging Styles Docs](https://workday.github.io/canvas-kit/?path=/docs/styling-guides-merging-styles--docs#handlecsprop).
|
|
7
|
+
*/
|
|
5
8
|
export const filterOutProps = (omittedProps) => {
|
|
6
9
|
return (prop) => !omittedProps.includes(prop);
|
|
7
10
|
};
|
|
@@ -25,4 +28,7 @@ function styled(node, options) {
|
|
|
25
28
|
return emotionStyled(node, options)(newArgs);
|
|
26
29
|
};
|
|
27
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated ⚠️ `styled` is deprecated and will be removed in a future major version. Please use `createStyles` or `createStencil` instead with [CSS logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values). For more information, view our [Styling docs](https://workday.github.io/canvas-kit/?path=/docs/styling-getting-started-overview--docs).
|
|
33
|
+
*/
|
|
28
34
|
export default styled;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { CanvasTheme } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated ⚠️ `defaultCanvasTheme` is deprecated and will be removed in a future major version. If you want to reset the theme, use `defaultBranding` and apply it to the `CanvasProvider`. For more information, view our [theming docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs).
|
|
4
|
+
*/
|
|
2
5
|
export declare const defaultCanvasTheme: CanvasTheme;
|
|
3
6
|
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAmB,MAAM,SAAS,CAAC;AAItD,eAAO,MAAM,kBAAkB,EAAE,WA8DhC,CAAC"}
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAmB,MAAM,SAAS,CAAC;AAItD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,WA8DhC,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ContentDirection } from './types';
|
|
2
2
|
import { base } from '@workday/canvas-tokens-web';
|
|
3
3
|
import { breakpoints, up, down, between, only } from './breakpoints';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated ⚠️ `defaultCanvasTheme` is deprecated and will be removed in a future major version. If you want to reset the theme, use `defaultBranding` and apply it to the `CanvasProvider`. For more information, view our [theming docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs).
|
|
6
|
+
*/
|
|
4
7
|
export const defaultCanvasTheme = {
|
|
5
8
|
palette: {
|
|
6
9
|
primary: {
|
|
@@ -7,7 +7,7 @@ import { PartialEmotionCanvasTheme } from './types';
|
|
|
7
7
|
* const isRTL = useIsRTL();
|
|
8
8
|
* ```
|
|
9
9
|
*
|
|
10
|
-
* @deprecated
|
|
10
|
+
* @deprecated ⚠️ `useIsRTL` is deprecated and will be removed in a future major version. Please use `isElementRTL` instead.
|
|
11
11
|
*/
|
|
12
12
|
export declare const useIsRTL: (partialTheme?: PartialEmotionCanvasTheme) => boolean;
|
|
13
13
|
//# sourceMappingURL=useIsRTL.d.ts.map
|
|
@@ -12,7 +12,7 @@ function useDefaultTheme(theme, config, fn) {
|
|
|
12
12
|
* const isRTL = useIsRTL();
|
|
13
13
|
* ```
|
|
14
14
|
*
|
|
15
|
-
* @deprecated
|
|
15
|
+
* @deprecated ⚠️ `useIsRTL` is deprecated and will be removed in a future major version. Please use `isElementRTL` instead.
|
|
16
16
|
*/
|
|
17
17
|
export const useIsRTL = (partialTheme) => {
|
|
18
18
|
const theme = useDefaultTheme(partialTheme, ThemeContext, React.useContext);
|
|
@@ -31,6 +31,7 @@ import { EmotionCanvasTheme, PartialEmotionCanvasTheme } from './index';
|
|
|
31
31
|
* margin: space.l
|
|
32
32
|
* }
|
|
33
33
|
* }
|
|
34
|
+
* @deprecated ⚠️ `getTheme` is deprecated and will be removed in a future major version. Please use our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs) to theme components.
|
|
34
35
|
*/
|
|
35
36
|
export declare function getTheme(theme?: PartialEmotionCanvasTheme): EmotionCanvasTheme;
|
|
36
37
|
/**
|
|
@@ -60,6 +61,7 @@ export declare function getTheme(theme?: PartialEmotionCanvasTheme): EmotionCanv
|
|
|
60
61
|
* <Subtext size="large" color={theme.canvas.palette.error.main}>
|
|
61
62
|
* );
|
|
62
63
|
* }
|
|
64
|
+
* @deprecated ⚠️ `useTheme` is deprecated and will be removed in a future major version. Please use our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs) to theme components.
|
|
63
65
|
*/
|
|
64
66
|
export declare function useTheme(theme?: PartialEmotionCanvasTheme): EmotionCanvasTheme;
|
|
65
67
|
//# sourceMappingURL=useTheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/useTheme.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,kBAAkB,EAClB,yBAAyB,EAE1B,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/useTheme.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,kBAAkB,EAClB,yBAAyB,EAE1B,MAAM,SAAS,CAAC;AAsEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,QAAQ,CAAC,KAAK,CAAC,EAAE,yBAAyB,GAAG,kBAAkB,CAY9E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,QAAQ,CAAC,KAAK,CAAC,EAAE,yBAAyB,GAAG,kBAAkB,CAkB9E"}
|
|
@@ -6,6 +6,7 @@ import { cssVar } from '@workday/canvas-kit-styling';
|
|
|
6
6
|
import { base } from '@workday/canvas-tokens-web';
|
|
7
7
|
/**
|
|
8
8
|
* We can adjust the shift but this should get us close enough until we clean up the algorithm to determine the colors.
|
|
9
|
+
* @deprecated ⚠️ `shiftColor` is deprecated and will be removed in a future major version. While we work on an algorithm for color shifting, you can use [`oklch from`](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/oklch) to generate a palette.
|
|
9
10
|
*/
|
|
10
11
|
const shiftColor = (color, value) => {
|
|
11
12
|
return `oklch(from ${color} calc(l ${value > 0 ? '+' : '-'} ${Math.abs(value) / 1000}) c h)`;
|
|
@@ -90,6 +91,7 @@ const getFilledTheme = (theme) => {
|
|
|
90
91
|
* margin: space.l
|
|
91
92
|
* }
|
|
92
93
|
* }
|
|
94
|
+
* @deprecated ⚠️ `getTheme` is deprecated and will be removed in a future major version. Please use our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs) to theme components.
|
|
93
95
|
*/
|
|
94
96
|
export function getTheme(theme) {
|
|
95
97
|
var _a, _b;
|
|
@@ -129,6 +131,7 @@ export function getTheme(theme) {
|
|
|
129
131
|
* <Subtext size="large" color={theme.canvas.palette.error.main}>
|
|
130
132
|
* );
|
|
131
133
|
* }
|
|
134
|
+
* @deprecated ⚠️ `useTheme` is deprecated and will be removed in a future major version. Please use our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs) to theme components.
|
|
132
135
|
*/
|
|
133
136
|
export function useTheme(theme) {
|
|
134
137
|
if (!theme) {
|
|
@@ -5,6 +5,9 @@ interface ContrastColors {
|
|
|
5
5
|
outer?: string;
|
|
6
6
|
inner?: string;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated ⚠️ `getPaletteColorsForFocusRing` is deprecated and will be removed in a future major version. Please use the `brand.common.focusRing` CSS variable to theme focus rings. For more information, view our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs).
|
|
10
|
+
*/
|
|
8
11
|
export declare function getPaletteColorsForFocusRing(type: paletteSelection, theme: EmotionCanvasTheme): ContrastColors;
|
|
9
12
|
/**
|
|
10
13
|
* This is a way to automatically add themed colors to your input and is helpful when showing alerts, success or errors to users.
|
|
@@ -40,6 +43,7 @@ export declare function getPaletteColorsForFocusRing(type: paletteSelection, the
|
|
|
40
43
|
* );
|
|
41
44
|
* };
|
|
42
45
|
*```
|
|
46
|
+
* @deprecated `useThemedRing` is deprecated and will be removed in a future major version. Please use `brand.common.focusOutline` CSS variable instead. View our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs) for more information.
|
|
43
47
|
*/
|
|
44
48
|
export declare const useThemedRing: (type: paletteSelection) => CSSProperties;
|
|
45
49
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemedRing.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/useThemedRing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,kBAAkB,EAAW,MAAM,kCAAkC,CAAC;AAE3F,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAG/D,KAAK,gBAAgB,GAAG,OAAO,CAAC,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;AACzF,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAiCD,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,kBAAkB,GACxB,cAAc,CAoBhB;AAED
|
|
1
|
+
{"version":3,"file":"useThemedRing.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/useThemedRing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,kBAAkB,EAAW,MAAM,kCAAkC,CAAC;AAE3F,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAG/D,KAAK,gBAAgB,GAAG,OAAO,CAAC,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;AACzF,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAiCD;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,kBAAkB,GACxB,cAAc,CAoBhB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,aAAa,SAAU,gBAAgB,KAAG,aA0BtD,CAAC"}
|
|
@@ -27,6 +27,9 @@ const getPaletteColorsFromTheme = (palette, fallbackColors, errorType) => {
|
|
|
27
27
|
inner: cssVar(brand.common.focusOutline),
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated ⚠️ `getPaletteColorsForFocusRing` is deprecated and will be removed in a future major version. Please use the `brand.common.focusRing` CSS variable to theme focus rings. For more information, view our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs).
|
|
32
|
+
*/
|
|
30
33
|
export function getPaletteColorsForFocusRing(type, theme) {
|
|
31
34
|
switch (type) {
|
|
32
35
|
case 'error': {
|
|
@@ -82,6 +85,7 @@ export function getPaletteColorsForFocusRing(type, theme) {
|
|
|
82
85
|
* );
|
|
83
86
|
* };
|
|
84
87
|
*```
|
|
88
|
+
* @deprecated `useThemedRing` is deprecated and will be removed in a future major version. Please use `brand.common.focusOutline` CSS variable instead. View our [CSS tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-brand-tokens--docs) for more information.
|
|
85
89
|
*/
|
|
86
90
|
export const useThemedRing = (type) => {
|
|
87
91
|
const theme = useTheme();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.1.0-1282-next.0",
|
|
4
4
|
"description": "The parent module that contains all Workday Canvas Kit React components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"@popperjs/core": "^2.5.4",
|
|
53
53
|
"@tanstack/react-virtual": "^3.13.9",
|
|
54
54
|
"@workday/canvas-colors-web": "^2.0.0",
|
|
55
|
-
"@workday/canvas-kit-popup-stack": "^14.0.
|
|
56
|
-
"@workday/canvas-kit-styling": "^14.0.
|
|
55
|
+
"@workday/canvas-kit-popup-stack": "^14.1.0-1282-next.0",
|
|
56
|
+
"@workday/canvas-kit-styling": "^14.1.0-1282-next.0",
|
|
57
57
|
"@workday/canvas-system-icons-web": "^3.0.36",
|
|
58
58
|
"@workday/canvas-tokens-web": "^3.1.1",
|
|
59
59
|
"@workday/design-assets-types": "^0.2.10",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"@workday/canvas-accent-icons-web": "^3.0.0",
|
|
69
69
|
"@workday/canvas-applet-icons-web": "^2.0.0"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "69e1e3b1fb6262a3db424e4b538fb6dc1afb20f2"
|
|
72
72
|
}
|