@workday/canvas-kit-react 10.0.5 → 10.0.7
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/button/lib/BaseButton.tsx +11 -15
- package/button/lib/DeleteButton.tsx +3 -2
- package/button/lib/PrimaryButton.tsx +3 -10
- package/button/lib/SecondaryButton.tsx +3 -9
- package/button/lib/TertiaryButton.tsx +3 -5
- package/common/lib/CanvasProvider.tsx +14 -10
- package/dist/commonjs/button/lib/BaseButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/BaseButton.js +31 -34
- package/dist/commonjs/button/lib/DeleteButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/DeleteButton.js +4 -3
- package/dist/commonjs/button/lib/PrimaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/PrimaryButton.js +5 -4
- package/dist/commonjs/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/SecondaryButton.js +5 -4
- package/dist/commonjs/button/lib/TertiaryButton.d.ts +1 -1
- package/dist/commonjs/button/lib/TertiaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/TertiaryButton.js +25 -25
- package/dist/commonjs/common/lib/CanvasProvider.d.ts.map +1 -1
- package/dist/commonjs/common/lib/CanvasProvider.js +6 -3
- package/dist/commonjs/layout/index.d.ts +2 -1
- package/dist/commonjs/layout/index.d.ts.map +1 -1
- package/dist/commonjs/layout/index.js +4 -1
- package/dist/commonjs/layout/lib/utils/mergeStyles.d.ts +61 -0
- package/dist/commonjs/layout/lib/utils/mergeStyles.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/mergeStyles.js +160 -0
- package/dist/commonjs/menu/lib/MenuItem.d.ts +1 -1
- package/dist/commonjs/modal/lib/ModalOverlay.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/ModalOverlay.js +9 -2
- package/dist/commonjs/tabs/lib/TabsItem.d.ts +1 -1
- package/dist/es6/button/lib/BaseButton.d.ts.map +1 -1
- package/dist/es6/button/lib/BaseButton.js +31 -34
- package/dist/es6/button/lib/DeleteButton.d.ts.map +1 -1
- package/dist/es6/button/lib/DeleteButton.js +4 -3
- package/dist/es6/button/lib/PrimaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/PrimaryButton.js +5 -4
- package/dist/es6/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/SecondaryButton.js +5 -4
- package/dist/es6/button/lib/TertiaryButton.d.ts +1 -1
- package/dist/es6/button/lib/TertiaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/TertiaryButton.js +25 -25
- package/dist/es6/common/lib/CanvasProvider.d.ts.map +1 -1
- package/dist/es6/common/lib/CanvasProvider.js +7 -4
- package/dist/es6/layout/index.d.ts +2 -1
- package/dist/es6/layout/index.d.ts.map +1 -1
- package/dist/es6/layout/index.js +2 -0
- package/dist/es6/layout/lib/utils/mergeStyles.d.ts +61 -0
- package/dist/es6/layout/lib/utils/mergeStyles.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/mergeStyles.js +156 -0
- package/dist/es6/menu/lib/MenuItem.d.ts +1 -1
- package/dist/es6/modal/lib/ModalOverlay.d.ts.map +1 -1
- package/dist/es6/modal/lib/ModalOverlay.js +9 -2
- package/dist/es6/tabs/lib/TabsItem.d.ts +1 -1
- package/layout/index.ts +4 -3
- package/layout/lib/utils/mergeStyles.ts +178 -0
- package/modal/lib/ModalOverlay.tsx +25 -15
- package/package.json +6 -4
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { buttonVars } from './BaseButton';
|
|
3
3
|
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
4
|
+
import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
4
5
|
import { createStyles, cssVar, createModifiers } from '@workday/canvas-kit-styling';
|
|
5
6
|
import { base, brand, system } from '@workday/canvas-tokens-web';
|
|
6
7
|
import { Button } from './Button';
|
|
7
|
-
const secondaryStyles = createStyles({ name: "
|
|
8
|
+
const secondaryStyles = createStyles({ name: "ug6iy", styles: "--css-button-vars-default-background:transparent;--css-button-vars-default-border:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--css-button-vars-default-borderRadius:var(--cnvs-sys-shape-round, 62.5rem);--css-button-vars-default-label:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--css-button-vars-default-icon:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--css-button-vars-hover-background:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--css-button-vars-hover-border:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--css-button-vars-hover-label:var(--cnvs-brand-primary-accent, rgba(255,255,255,1));--css-button-vars-hover-icon:var(--cnvs-brand-primary-accent, rgba(255,255,255,1));--css-button-vars-focus-background:transparent;--css-button-vars-focus-border:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--css-button-vars-focus-label:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--css-button-vars-focus-icon:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--css-button-vars-focus-boxShadowInner:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));--css-button-vars-focus-boxShadowOuter:var(--cnvs-brand-common-focus-outline, rgba(8,117,226,1));--css-button-vars-active-background:var(--cnvs-base-palette-black-pepper-500, rgba(31,31,31,1));--css-button-vars-active-border:var(--cnvs-base-palette-black-pepper-500, rgba(31,31,31,1));--css-button-vars-active-label:var(--cnvs-brand-primary-accent, rgba(255,255,255,1));--css-button-vars-active-icon:var(--cnvs-brand-primary-accent, rgba(255,255,255,1));--css-button-vars-disabled-background:transparent;--css-button-vars-disabled-border:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--css-button-vars-disabled-label:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--css-button-vars-disabled-opacity:0.4;--css-button-vars-disabled-icon:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));" });
|
|
8
9
|
export const secondaryButtonModifiers = createModifiers({
|
|
9
10
|
variant: {
|
|
10
|
-
inverse: createStyles({ name: "
|
|
11
|
+
inverse: createStyles({ name: "ug6iz", styles: "--css-button-vars-default-background:transparent;--css-button-vars-default-border:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));--css-button-vars-default-label:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));--css-button-vars-default-icon:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));--css-button-vars-hover-background:var(--cnvs-base-palette-soap-300, rgba(232,235,237,1));--css-button-vars-hover-border:var(--cnvs-base-palette-soap-300, rgba(232,235,237,1));--css-button-vars-hover-label:var(--cnvs-base-palette-black-pepper-500, rgba(31,31,31,1));--css-button-vars-hover-icon:var(--cnvs-base-palette-black-pepper-500, rgba(31,31,31,1));--css-button-vars-focus-background:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));--css-button-vars-focus-border:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));--css-button-vars-focus-label:var(--cnvs-base-palette-black-pepper-500, rgba(31,31,31,1));--css-button-vars-focus-icon:var(--cnvs-base-palette-black-pepper-500, rgba(31,31,31,1));--css-button-vars-focus-boxShadowInner:var(--cnvs-base-palette-black-pepper-500, rgba(31,31,31,1));--css-button-vars-focus-boxShadowOuter:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));--css-button-vars-active-background:var(--cnvs-base-palette-soap-400, rgba(224,227,230,1));--css-button-vars-active-border:var(--cnvs-base-palette-soap-400, rgba(224,227,230,1));--css-button-vars-active-label:var(--cnvs-base-palette-black-pepper-500, rgba(31,31,31,1));--css-button-vars-active-icon:var(--cnvs-base-palette-black-pepper-500, rgba(31,31,31,1));--css-button-vars-disabled-background:transparent;--css-button-vars-disabled-border:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));--css-button-vars-disabled-label:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));--css-button-vars-disabled-icon:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));" }),
|
|
11
12
|
},
|
|
12
13
|
});
|
|
13
14
|
export const SecondaryButton = createComponent('button')({
|
|
14
15
|
displayName: 'SecondaryButton',
|
|
15
|
-
Component: ({ children,
|
|
16
|
-
return (React.createElement(Button, Object.assign({ as: Element, ref: ref
|
|
16
|
+
Component: ({ children, variant, ...elemProps }, ref, Element) => {
|
|
17
|
+
return (React.createElement(Button, Object.assign({ as: Element, ref: ref }, mergeStyles(elemProps, [secondaryStyles, secondaryButtonModifiers({ variant: variant })])), children));
|
|
17
18
|
},
|
|
18
19
|
});
|
|
@@ -33,7 +33,7 @@ export declare const tertiaryButtonModifiers: {
|
|
|
33
33
|
extraSmallEnd: string;
|
|
34
34
|
};
|
|
35
35
|
} & ((modifiers: Partial<{
|
|
36
|
-
isThemeable:
|
|
36
|
+
isThemeable: true;
|
|
37
37
|
variant: "inverse";
|
|
38
38
|
iconPosition: "largeOnly" | "largeStart" | "largeEnd" | "mediumOnly" | "mediumStart" | "mediumEnd" | "smallOnly" | "smallStart" | "smallEnd" | "extraSmallOnly" | "extraSmallStart" | "extraSmallEnd";
|
|
39
39
|
}>) => string);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TertiaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/TertiaryButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TertiaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/TertiaryButton.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAS,WAAW,EAAC,MAAM,UAAU,CAAC;AAE7C;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACtD;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AA+CD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;cA0ElC,CAAC;AAEH,eAAO,MAAM,cAAc,4FA4CzB,CAAC"}
|
|
@@ -2,35 +2,36 @@ import * as React from 'react';
|
|
|
2
2
|
import { buttonVars, getIconPosition } from './BaseButton';
|
|
3
3
|
import { createComponent, focusRing } from '@workday/canvas-kit-react/common';
|
|
4
4
|
import { createStyles, cssVar, createModifiers } from '@workday/canvas-kit-styling';
|
|
5
|
+
import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
5
6
|
import { system, brand, base } from '@workday/canvas-tokens-web';
|
|
6
7
|
import { borderRadius, space } from '@workday/canvas-kit-react/tokens';
|
|
7
8
|
import { Button } from './Button';
|
|
8
|
-
const tertiaryStyles = createStyles({ name: "
|
|
9
|
+
const tertiaryStyles = createStyles({ name: "ug6ih", styles: "padding-inline:var(--cnvs-sys-space-x2, 0.5rem);min-width:auto;text-decoration:underline;border:0px;--css-button-vars-default-background:transparent;--css-button-vars-default-border:transparent;--css-button-vars-default-borderRadius:var(--cnvs-sys-shape-x1, 0.25rem);--css-button-vars-default-label:var(--cnvs-brand-primary-base, rgba(8,117,226,1));--css-button-vars-default-icon:var(--cnvs-base-palette-black-pepper-400, rgba(51, 51, 51, 1));--css-button-vars-hover-background:var(--cnvs-base-palette-soap-200, rgba(241, 242, 243, 1));--css-button-vars-hover-border:transparent;--css-button-vars-hover-label:var(--cnvs-brand-primary-dark, rgba(0,92,184,1));--css-button-vars-hover-icon:var(--cnvs-base-palette-black-pepper-500, rgba(31,31,31,1));--css-button-vars-focus-background:transparent;--css-button-vars-focus-border:transparent;--css-button-vars-focus-label:var(--cnvs-brand-primary-base, rgba(8,117,226,1));--css-button-vars-focus-icon:var(--cnvs-base-palette-black-pepper-500, rgba(31,31,31,1));--css-button-vars-focus-boxShadowInner:var(--cnvs-brand-common-focus-outline, rgba(8,117,226,1));--css-button-vars-focus-boxShadowOuter:var(--cnvs-brand-common-focus-outline, rgba(8,117,226,1));--css-button-vars-active-background:var(--cnvs-base-palette-soap-300, rgba(232,235,237,1));--css-button-vars-active-border:transparent;--css-button-vars-active-label:var(--cnvs-brand-primary-dark, rgba(0,92,184,1));--css-button-vars-active-icon:var(--cnvs-base-palette-black-pepper-500, rgba(31,31,31,1));--css-button-vars-disabled-background:transparent;--css-button-vars-disabled-border:var(--cnvs-base-palette-french-vanilla-100, #fff);--css-button-vars-disabled-label:var(--cnvs-brand-primary-base, rgba(8,117,226,1));--css-button-vars-disabled-icon:var(--cnvs-base-palette-black-pepper-400, rgba(51, 51, 51, 1));--css-button-vars-disabled-opacity:0.4;&:focus-visible, &.focus{box-shadow:0 0 0 0px var(--cnvs-base-palette-french-vanilla-100, var(--css-button-vars-focus-boxShadowInner)), 0 0 0 calc(2px + 0px) var(--cnvs-brand-common-focus-outline, var(--css-button-vars-focus-boxShadowOuter));}" });
|
|
9
10
|
export const tertiaryButtonModifiers = createModifiers({
|
|
10
11
|
isThemeable: {
|
|
11
|
-
true: createStyles({ name: "
|
|
12
|
+
true: createStyles({ name: "ug6ii", styles: "--css-button-vars-default-icon:var(--cnvs-brand-primary-base, rgba(8,117,226,1));--css-button-vars-hover-icon:var(--cnvs-brand-primary-dark, rgba(0,92,184,1));--css-button-vars-focus-icon:var(--cnvs-brand-primary-base, rgba(8,117,226,1));--css-button-vars-active-icon:var(--cnvs-brand-primary-dark, rgba(0,92,184,1));--css-button-vars-disabled-icon:var(--cnvs-brand-primary-base, rgba(8,117,226,1));" }),
|
|
12
13
|
},
|
|
13
14
|
variant: {
|
|
14
|
-
inverse: createStyles({ name: "
|
|
15
|
+
inverse: createStyles({ name: "ug6ij", styles: "--css-button-vars-default-background:transparent;--css-button-vars-default-border:transparent;--css-button-vars-default-label:var(--cnvs-base-palette-french-vanilla-100, #fff);--css-button-vars-default-icon:var(--cnvs-base-palette-french-vanilla-100, #fff);--css-button-vars-hover-background:var(--cnvs-base-palette-french-vanilla-100, #fff);--css-button-vars-hover-border:transparent;--css-button-vars-hover-label:var(--cnvs-base-palette-black-pepper-400, rgba(51, 51, 51, 1));--css-button-vars-hover-icon:var(--cnvs-base-palette-black-pepper-400, rgba(51, 51, 51, 1));--css-button-vars-focus-background:var(--cnvs-base-palette-french-vanilla-100, #fff);--css-button-vars-focus-border:transparent;--css-button-vars-focus-label:var(--cnvs-base-palette-black-pepper-400, rgba(51, 51, 51, 1));--css-button-vars-focus-icon:var(--cnvs-base-palette-black-pepper-400, rgba(51, 51, 51, 1));--css-button-vars-active-background:var(--cnvs-base-palette-soap-200, rgba(241, 242, 243, 1));--css-button-vars-active-border:transparent;--css-button-vars-active-label:var(--cnvs-base-palette-black-pepper-400, rgba(51, 51, 51, 1));--css-button-vars-active-icon:var(--cnvs-base-palette-black-pepper-400, rgba(51, 51, 51, 1));--css-button-vars-disabled-background:transparent;--css-button-vars-disabled-border:var(--cnvs-base-palette-french-vanilla-100, #fff);--css-button-vars-disabled-label:var(--cnvs-base-palette-french-vanilla-100, #fff);--css-button-vars-disabled-icon:var(--cnvs-base-palette-french-vanilla-100, #fff);&:focus-visible, &.focus{box-shadow:inset 0 0 0 2px var(--cnvs-base-palette-black-pepper-400, var(--css-button-vars-focus-boxShadowInner)), 0 0 0 2px var(--cnvs-base-palette-french-vanilla-100, var(--css-button-vars-focus-boxShadowOuter));}" }),
|
|
15
16
|
},
|
|
16
17
|
iconPosition: {
|
|
17
|
-
largeOnly: createStyles({ name: "
|
|
18
|
-
largeStart: createStyles({ name: "
|
|
19
|
-
largeEnd: createStyles({ name: "
|
|
20
|
-
mediumOnly: createStyles({ name: "
|
|
21
|
-
mediumStart: createStyles({ name: "
|
|
22
|
-
mediumEnd: createStyles({ name: "
|
|
23
|
-
smallOnly: createStyles({ name: "
|
|
24
|
-
smallStart: createStyles({ name: "
|
|
25
|
-
smallEnd: createStyles({ name: "
|
|
26
|
-
extraSmallOnly: createStyles({ name: "
|
|
27
|
-
extraSmallStart: createStyles({ name: "
|
|
28
|
-
extraSmallEnd: createStyles({ name: "
|
|
18
|
+
largeOnly: createStyles({ name: "ug6ik", styles: "border-radius:999px;padding:0;min-width:calc(var(--cnvs-sys-space-x4, 1rem) * 3);" }),
|
|
19
|
+
largeStart: createStyles({ name: "ug6il", styles: "padding-inline-start:0.5rem;padding-inline-end:0.75rem;" }),
|
|
20
|
+
largeEnd: createStyles({ name: "ug6im", styles: "padding-inline-start:0.75rem;padding-inline-end:0.5rem;" }),
|
|
21
|
+
mediumOnly: createStyles({ name: "ug6in", styles: "padding:0;min-width:2.5rem;border-radius:999px;" }),
|
|
22
|
+
mediumStart: createStyles({ name: "ug6io", styles: "padding-inline-start:0.5rem;padding-inline-end:0.75rem;" }),
|
|
23
|
+
mediumEnd: createStyles({ name: "ug6ip", styles: "padding-inline-start:0.75rem;padding-inline-end:0.5rem;" }),
|
|
24
|
+
smallOnly: createStyles({ name: "ug6iq", styles: "padding:0;min-width:2rem;border-radius:999px;" }),
|
|
25
|
+
smallStart: createStyles({ name: "ug6ir", styles: "padding-inline-start:0.5rem;padding-inline-end:0.75rem;" }),
|
|
26
|
+
smallEnd: createStyles({ name: "ug6is", styles: "padding-inline-start:0.75rem;padding-inline-end:0.5rem;" }),
|
|
27
|
+
extraSmallOnly: createStyles({ name: "ug6it", styles: "padding:0;min-width:1.5rem;border-radius:999px;" }),
|
|
28
|
+
extraSmallStart: createStyles({ name: "ug6iu", styles: "padding-inline-start:0.25rem;padding-inline-end:0.5rem;" }),
|
|
29
|
+
extraSmallEnd: createStyles({ name: "ug6iv", styles: "padding-inline-start:0.5rem;padding-inline-end:0.25rem;" }),
|
|
29
30
|
},
|
|
30
31
|
});
|
|
31
32
|
export const TertiaryButton = createComponent('button')({
|
|
32
33
|
displayName: 'TertiaryButton',
|
|
33
|
-
Component: ({ children, icon, colors, size = 'medium', isThemeable, variant, iconPosition,
|
|
34
|
+
Component: ({ children, icon, colors, size = 'medium', isThemeable, variant, iconPosition, ...elemProps }, ref, Element) => {
|
|
34
35
|
const baseIconPosition = iconPosition
|
|
35
36
|
? iconPosition
|
|
36
37
|
: icon
|
|
@@ -38,14 +39,13 @@ export const TertiaryButton = createComponent('button')({
|
|
|
38
39
|
? 'start'
|
|
39
40
|
: 'only'
|
|
40
41
|
: undefined;
|
|
41
|
-
return (React.createElement(Button, Object.assign({ as: Element, ref: ref, icon: icon, iconPosition: iconPosition, size: size,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
] }, elemProps), children));
|
|
42
|
+
return (React.createElement(Button, Object.assign({ as: Element, ref: ref, icon: icon, iconPosition: iconPosition, size: size }, mergeStyles(elemProps, [
|
|
43
|
+
tertiaryStyles,
|
|
44
|
+
tertiaryButtonModifiers({
|
|
45
|
+
isThemeable: (isThemeable || baseIconPosition !== 'only'),
|
|
46
|
+
variant: variant,
|
|
47
|
+
iconPosition: getIconPosition(size, baseIconPosition),
|
|
48
|
+
}),
|
|
49
|
+
])), children));
|
|
50
50
|
},
|
|
51
51
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasProvider.d.ts","sourceRoot":"","sources":["../../../../common/lib/CanvasProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAqB,yBAAyB,EAAW,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"CanvasProvider.d.ts","sourceRoot":"","sources":["../../../../common/lib/CanvasProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAqB,yBAAyB,EAAW,MAAM,WAAW,CAAC;AAKlF,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,yBAAyB,CAAC;CACnC;AAkCD,eAAO,MAAM,cAAc,kCAIxB,mBAAmB,GAAG,MAAM,cAAc,CAAC,WAAW,CAAC,gBAezD,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ThemeProvider } from '@emotion/react';
|
|
2
|
+
import { ThemeProvider, CacheProvider } from '@emotion/react';
|
|
3
3
|
import { InputProvider } from './InputProvider';
|
|
4
4
|
import { defaultCanvasTheme, useTheme } from './theming';
|
|
5
5
|
import { brand } from '@workday/canvas-tokens-web';
|
|
6
|
+
// eslint-disable-next-line @emotion/no-vanilla
|
|
7
|
+
import { cache } from '@emotion/css';
|
|
6
8
|
const mappedKeys = {
|
|
7
9
|
lightest: 'lightest',
|
|
8
10
|
light: 'light',
|
|
@@ -30,7 +32,8 @@ const useCanvasThemeToCssVars = (theme, elemProps) => {
|
|
|
30
32
|
export const CanvasProvider = ({ children, theme = { canvas: defaultCanvasTheme }, ...props }) => {
|
|
31
33
|
var _a;
|
|
32
34
|
const elemProps = useCanvasThemeToCssVars(theme, props);
|
|
33
|
-
return (React.createElement(
|
|
34
|
-
React.createElement(
|
|
35
|
-
|
|
35
|
+
return (React.createElement(CacheProvider, { value: cache },
|
|
36
|
+
React.createElement(ThemeProvider, { theme: theme },
|
|
37
|
+
React.createElement(InputProvider, null),
|
|
38
|
+
React.createElement("div", Object.assign({ dir: ((_a = theme === null || theme === void 0 ? void 0 : theme.canvas) === null || _a === void 0 ? void 0 : _a.direction) || defaultCanvasTheme.direction }, elemProps), children))));
|
|
36
39
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './lib/Box';
|
|
2
|
+
export * from './lib/utils/mergeStyles';
|
|
2
3
|
export * from './lib/utils/background';
|
|
3
4
|
export * from './lib/utils/border';
|
|
4
5
|
export * from './lib/utils/color';
|
|
@@ -18,6 +19,6 @@ export * from './lib/Flex';
|
|
|
18
19
|
export * from './lib/Grid';
|
|
19
20
|
export type { FlexStyleProps } from './lib/utils/flex';
|
|
20
21
|
export type { GridStyleProps } from './lib/utils/grid';
|
|
21
|
-
export
|
|
22
|
+
export { GridItemStyleProps, gridItemStyleFnConfigs } from './lib/utils/gridItem';
|
|
22
23
|
export * from './lib/utils/systemProps';
|
|
23
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAC,eAAe,EAAE,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AACvE,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAC,eAAe,EAAE,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAC,aAAa,EAAE,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AACvE,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAC,eAAe,EAAE,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AACvE,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAC,eAAe,EAAE,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAC,aAAa,EAAE,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AACvE,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,YAAY,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AACrD,YAAY,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAC,kBAAkB,EAAE,sBAAsB,EAAC,MAAM,sBAAsB,CAAC;AAChF,cAAc,yBAAyB,CAAC"}
|
package/dist/es6/layout/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './lib/Box';
|
|
2
|
+
export * from './lib/utils/mergeStyles';
|
|
2
3
|
export * from './lib/utils/background';
|
|
3
4
|
export * from './lib/utils/border';
|
|
4
5
|
export * from './lib/utils/color';
|
|
@@ -15,4 +16,5 @@ export { spaceStyleFnConfigs } from './lib/utils/space';
|
|
|
15
16
|
export * from './lib/utils/text';
|
|
16
17
|
export * from './lib/Flex';
|
|
17
18
|
export * from './lib/Grid';
|
|
19
|
+
export { gridItemStyleFnConfigs } from './lib/utils/gridItem';
|
|
18
20
|
export * from './lib/utils/systemProps';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { CSToPropsInput } from '@workday/canvas-kit-styling';
|
|
2
|
+
import { CommonStyleProps } from './styleProps';
|
|
3
|
+
/**
|
|
4
|
+
* This is an opinionated function that will force style merging with Emotion's runtime APIs,
|
|
5
|
+
* including [styled components](https://emotion.sh/docs/styled) and the [css
|
|
6
|
+
* prop](https://emotion.sh/docs/css-prop). It will also handle style props for as long as those are
|
|
7
|
+
* supported. `mergeStyles` is exported from the layout package since it supports style props
|
|
8
|
+
* defined in the layout packages.
|
|
9
|
+
*
|
|
10
|
+
* It works by detecting styles added via Emotion's runtime APIs and forcing styling merging if use
|
|
11
|
+
* of runtime APIs have been detected. If only `createStyles` were used to style a component, the
|
|
12
|
+
* faster non-runtime styling will be used.
|
|
13
|
+
*
|
|
14
|
+
* You can use `mergeStyles` if you wish to use {@link createStyles} on your own components and want
|
|
15
|
+
* your components to be compatible with Emotion's runtime styling APIs.
|
|
16
|
+
*
|
|
17
|
+
* ```tsx
|
|
18
|
+
* import {createStyles, CSProps} from '@workday/canvas-kit-styling';
|
|
19
|
+
* import {mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
20
|
+
*
|
|
21
|
+
* interface MyComponentProps extends CSProps {
|
|
22
|
+
* // other props
|
|
23
|
+
* }
|
|
24
|
+
*
|
|
25
|
+
* const myStyles = createStyles({
|
|
26
|
+
* background: 'green',
|
|
27
|
+
* height: 40,
|
|
28
|
+
* width: 40
|
|
29
|
+
* })
|
|
30
|
+
*
|
|
31
|
+
* const MyComponent = ({children, ...elemProps}: MyComponentProps) => {
|
|
32
|
+
* return (
|
|
33
|
+
* <div
|
|
34
|
+
* {...mergeStyles(elemProps, [myStyles])}
|
|
35
|
+
* >
|
|
36
|
+
* {children}
|
|
37
|
+
* </div>
|
|
38
|
+
* )
|
|
39
|
+
* }
|
|
40
|
+
*
|
|
41
|
+
* const StyledMyComponent(MyComponent)({
|
|
42
|
+
* background: 'red'
|
|
43
|
+
* })
|
|
44
|
+
*
|
|
45
|
+
* const myOverridingStyles = createStyles({
|
|
46
|
+
* background: 'blue'
|
|
47
|
+
* })
|
|
48
|
+
*
|
|
49
|
+
* // now everything works. Without `mergeStyles`, the last component would be a red box
|
|
50
|
+
* export default () => (
|
|
51
|
+
* <>
|
|
52
|
+
* <MyComponent>Green box</MyComponent>
|
|
53
|
+
* <StyledMyComponent>Red box</StyledMyComponent>
|
|
54
|
+
* <StyledMyComponent cs={myOverridingStyles}>Blue box</StyledMyComponent>
|
|
55
|
+
* </>
|
|
56
|
+
* )
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
*/
|
|
60
|
+
export declare function mergeStyles<T extends {}>(allProps: T, cs: CSToPropsInput): Omit<T, 'cs' | keyof CommonStyleProps>;
|
|
61
|
+
//# sourceMappingURL=mergeStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeStyles.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/mergeStyles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,cAAc,EAAoB,MAAM,6BAA6B,CAAC;AAYzF,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AA0B9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,EAAE,EACtC,QAAQ,EAAE,CAAC,EACX,EAAE,EAAE,cAAc,GACjB,IAAI,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,gBAAgB,CAAC,CA4ExC"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { getRegisteredStyles } from '@emotion/utils';
|
|
2
|
+
// eslint-disable-next-line @emotion/no-vanilla
|
|
3
|
+
import { cache, css } from '@emotion/css';
|
|
4
|
+
import { csToProps, createStylesCache } from '@workday/canvas-kit-styling';
|
|
5
|
+
import { boxStyleFn } from '../Box';
|
|
6
|
+
import { backgroundStyleFnConfigs } from './background';
|
|
7
|
+
import { borderStyleFnConfigs } from './border';
|
|
8
|
+
import { colorStyleFnConfigs } from './color';
|
|
9
|
+
import { depthStyleFnConfigs } from './depth';
|
|
10
|
+
import { flexItemStyleFnConfigs } from './flexItem';
|
|
11
|
+
import { gridItemStyleFnConfigs } from './gridItem';
|
|
12
|
+
import { layoutStyleFnConfigs } from './layout';
|
|
13
|
+
import { otherStyleFnConfigs } from './other';
|
|
14
|
+
import { positionStyleFnConfigs } from './position';
|
|
15
|
+
import { spaceStyleFnConfigs } from './space';
|
|
16
|
+
import { textStyleFnConfigs } from './text';
|
|
17
|
+
// get a hash of all the style props for a faster lookup
|
|
18
|
+
const stylePropHash = [
|
|
19
|
+
...backgroundStyleFnConfigs,
|
|
20
|
+
...borderStyleFnConfigs,
|
|
21
|
+
...colorStyleFnConfigs,
|
|
22
|
+
...depthStyleFnConfigs,
|
|
23
|
+
...flexItemStyleFnConfigs,
|
|
24
|
+
...gridItemStyleFnConfigs,
|
|
25
|
+
...layoutStyleFnConfigs,
|
|
26
|
+
...otherStyleFnConfigs,
|
|
27
|
+
...positionStyleFnConfigs,
|
|
28
|
+
...spaceStyleFnConfigs,
|
|
29
|
+
...textStyleFnConfigs,
|
|
30
|
+
].reduce((result, prop) => {
|
|
31
|
+
//@ts-ignore
|
|
32
|
+
result[prop.name] = true;
|
|
33
|
+
return result;
|
|
34
|
+
}, {});
|
|
35
|
+
function isStyleProps(prop) {
|
|
36
|
+
return stylePropHash[prop] || false;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* This is an opinionated function that will force style merging with Emotion's runtime APIs,
|
|
40
|
+
* including [styled components](https://emotion.sh/docs/styled) and the [css
|
|
41
|
+
* prop](https://emotion.sh/docs/css-prop). It will also handle style props for as long as those are
|
|
42
|
+
* supported. `mergeStyles` is exported from the layout package since it supports style props
|
|
43
|
+
* defined in the layout packages.
|
|
44
|
+
*
|
|
45
|
+
* It works by detecting styles added via Emotion's runtime APIs and forcing styling merging if use
|
|
46
|
+
* of runtime APIs have been detected. If only `createStyles` were used to style a component, the
|
|
47
|
+
* faster non-runtime styling will be used.
|
|
48
|
+
*
|
|
49
|
+
* You can use `mergeStyles` if you wish to use {@link createStyles} on your own components and want
|
|
50
|
+
* your components to be compatible with Emotion's runtime styling APIs.
|
|
51
|
+
*
|
|
52
|
+
* ```tsx
|
|
53
|
+
* import {createStyles, CSProps} from '@workday/canvas-kit-styling';
|
|
54
|
+
* import {mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
55
|
+
*
|
|
56
|
+
* interface MyComponentProps extends CSProps {
|
|
57
|
+
* // other props
|
|
58
|
+
* }
|
|
59
|
+
*
|
|
60
|
+
* const myStyles = createStyles({
|
|
61
|
+
* background: 'green',
|
|
62
|
+
* height: 40,
|
|
63
|
+
* width: 40
|
|
64
|
+
* })
|
|
65
|
+
*
|
|
66
|
+
* const MyComponent = ({children, ...elemProps}: MyComponentProps) => {
|
|
67
|
+
* return (
|
|
68
|
+
* <div
|
|
69
|
+
* {...mergeStyles(elemProps, [myStyles])}
|
|
70
|
+
* >
|
|
71
|
+
* {children}
|
|
72
|
+
* </div>
|
|
73
|
+
* )
|
|
74
|
+
* }
|
|
75
|
+
*
|
|
76
|
+
* const StyledMyComponent(MyComponent)({
|
|
77
|
+
* background: 'red'
|
|
78
|
+
* })
|
|
79
|
+
*
|
|
80
|
+
* const myOverridingStyles = createStyles({
|
|
81
|
+
* background: 'blue'
|
|
82
|
+
* })
|
|
83
|
+
*
|
|
84
|
+
* // now everything works. Without `mergeStyles`, the last component would be a red box
|
|
85
|
+
* export default () => (
|
|
86
|
+
* <>
|
|
87
|
+
* <MyComponent>Green box</MyComponent>
|
|
88
|
+
* <StyledMyComponent>Red box</StyledMyComponent>
|
|
89
|
+
* <StyledMyComponent cs={myOverridingStyles}>Blue box</StyledMyComponent>
|
|
90
|
+
* </>
|
|
91
|
+
* )
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
*/
|
|
95
|
+
export function mergeStyles(allProps, cs) {
|
|
96
|
+
const styleProps = {};
|
|
97
|
+
let shouldRuntimeMergeStyles = false;
|
|
98
|
+
// TypeScript can't handle a type where I declare T extends `{className?: string}` for some
|
|
99
|
+
// reason, so we'll do a `as any` any time we check for possible props on `allProps`
|
|
100
|
+
let className = allProps.className || '';
|
|
101
|
+
// separate style props from all other props. `cs` is special and should be forwarded to the
|
|
102
|
+
// `handleCsProp` function.
|
|
103
|
+
const elemProps = Object.keys(allProps).reduce((result, prop) => {
|
|
104
|
+
if (isStyleProps(prop)) {
|
|
105
|
+
shouldRuntimeMergeStyles = true;
|
|
106
|
+
// @ts-ignore
|
|
107
|
+
styleProps[prop] = allProps[prop];
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
if (prop !== 'cs') {
|
|
111
|
+
// @ts-ignore
|
|
112
|
+
result[prop] = allProps[prop];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return result;
|
|
116
|
+
}, {});
|
|
117
|
+
// We need to determine if style props have been used. If they have, we need to merge all the CSS
|
|
118
|
+
// classes into a single class name in the order that the class names are listed. This variable
|
|
119
|
+
// will collect the CSS class name created by Emotion if we detect style props.
|
|
120
|
+
let stylePropsClassName = '';
|
|
121
|
+
// We have style props. We need to create style and merge with our `csToProps` to get the correct
|
|
122
|
+
// merging order for styles
|
|
123
|
+
if (shouldRuntimeMergeStyles) {
|
|
124
|
+
const styles = boxStyleFn(styleProps);
|
|
125
|
+
stylePropsClassName = css(styles);
|
|
126
|
+
}
|
|
127
|
+
const returnProps = csToProps([
|
|
128
|
+
cs,
|
|
129
|
+
stylePropsClassName,
|
|
130
|
+
className,
|
|
131
|
+
allProps.cs,
|
|
132
|
+
allProps.style, // doesn't matter if `style` is undefined. csToProps will handle undefined. Thanks anyways, TypeScript
|
|
133
|
+
]);
|
|
134
|
+
// see if we need to do style merging based off use of Emotion runtime APIs. We do this by testing
|
|
135
|
+
// the Emotion cache for a match to any class names we find, filtering out those created via
|
|
136
|
+
// `createStyles`. If only `createStyles` is detected, there is no reason to merge styles
|
|
137
|
+
(returnProps.className || '').split(' ').forEach(name => {
|
|
138
|
+
if (!createStylesCache[name] && cache.registered[name]) {
|
|
139
|
+
shouldRuntimeMergeStyles = true;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
if (shouldRuntimeMergeStyles) {
|
|
143
|
+
const registeredStyles = [];
|
|
144
|
+
// We are using the raw `css` instead of `createStyles` because `css` uses style hashing and
|
|
145
|
+
// `createStyles` generates a new ID every time. We could use `createStyles` here, but it
|
|
146
|
+
// would be more wasteful and new styles would be generated each React render cycle. `css` is
|
|
147
|
+
// safe to use inside a render function while `createStyles` should always be used outside the
|
|
148
|
+
// React render cycle.
|
|
149
|
+
className = getRegisteredStyles(cache.registered, registeredStyles, returnProps.className || '');
|
|
150
|
+
className += css(registeredStyles);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
className = returnProps.className;
|
|
154
|
+
}
|
|
155
|
+
return { ...elemProps, ...returnProps, ...{ className } };
|
|
156
|
+
}
|
|
@@ -26,7 +26,7 @@ interface StyledMenuProps {
|
|
|
26
26
|
*/
|
|
27
27
|
isDisabled?: boolean;
|
|
28
28
|
}
|
|
29
|
-
export declare const StyledMenuItem: import("@emotion/styled").StyledComponent<import("@workday/canvas-kit-react/layout").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").GridItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStyleProps & import("@workday/canvas-kit-react/layout").SpaceStyleProps & import("@workday/canvas-kit-react/layout").TextStyleProps & import("@workday/canvas-kit-styling").CSProps & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "left" | "right" | "top" | "bottom" | "fill" | "as" | "color" | "resize" | "width" | "height" | "alignSelf" | "appearance" | "backgroundAttachment" | "backgroundColor" | "backgroundImage" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "boxShadow" | "boxSizing" | "content" | "cursor" | "display" | "flexBasis" | "flexGrow" | "flexShrink" | "float" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "inset" | "insetInlineEnd" | "insetInlineStart" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "objectFit" | "objectPosition" | "opacity" | "order" | "outlineOffset" | "overflowWrap" | "overflowX" | "overflowY" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pointerEvents" | "position" | "scrollMargin" | "scrollMarginBottom" | "scrollMarginInlineEnd" | "scrollMarginInlineStart" | "scrollMarginTop" | "scrollPadding" | "scrollPaddingBottom" | "scrollPaddingInlineEnd" | "scrollPaddingInlineStart" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "textAlign" | "textOverflow" | "textShadow" | "textTransform" | "transform" | "userSelect" | "verticalAlign" | "visibility" | "whiteSpace" | "wordBreak" | "zIndex" | "animation" | "background" | "backgroundPosition" | "border" | "borderBottom" | "borderColor" | "borderInlineEnd" | "borderInlineStart" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "gridColumn" | "gridRow" | "listStyle" | "margin" | "outline" | "overflow" | "padding" | "placeSelf" | "textDecoration" | "transition" | "stroke" | "depth" | "marginX" | "marginY" | "paddingX" | "paddingY"
|
|
29
|
+
export declare const StyledMenuItem: import("@emotion/styled").StyledComponent<import("@workday/canvas-kit-react/layout").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").GridItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStyleProps & import("@workday/canvas-kit-react/layout").SpaceStyleProps & import("@workday/canvas-kit-react/layout").TextStyleProps & import("@workday/canvas-kit-styling").CSProps & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "left" | "right" | "top" | "bottom" | "fill" | "as" | "color" | "resize" | "width" | "height" | "alignSelf" | "appearance" | "backgroundAttachment" | "backgroundColor" | "backgroundImage" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "boxShadow" | "boxSizing" | "content" | "cursor" | "display" | "flexBasis" | "flexGrow" | "flexShrink" | "float" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "inset" | "insetInlineEnd" | "insetInlineStart" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "objectFit" | "objectPosition" | "opacity" | "order" | "outlineOffset" | "overflowWrap" | "overflowX" | "overflowY" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pointerEvents" | "position" | "scrollMargin" | "scrollMarginBottom" | "scrollMarginInlineEnd" | "scrollMarginInlineStart" | "scrollMarginTop" | "scrollPadding" | "scrollPaddingBottom" | "scrollPaddingInlineEnd" | "scrollPaddingInlineStart" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "textAlign" | "textOverflow" | "textShadow" | "textTransform" | "transform" | "userSelect" | "verticalAlign" | "visibility" | "whiteSpace" | "wordBreak" | "zIndex" | "animation" | "background" | "backgroundPosition" | "border" | "borderBottom" | "borderColor" | "borderInlineEnd" | "borderInlineStart" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "gridColumn" | "gridRow" | "listStyle" | "margin" | "outline" | "overflow" | "padding" | "placeSelf" | "textDecoration" | "transition" | "stroke" | "cs" | "depth" | "marginX" | "marginY" | "paddingX" | "paddingY"> & {
|
|
30
30
|
ref?: React.Ref<HTMLButtonElement> | undefined;
|
|
31
31
|
} & {
|
|
32
32
|
theme?: import("@emotion/react").Theme | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalOverlay.d.ts","sourceRoot":"","sources":["../../../../modal/lib/ModalOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,EAAM,QAAQ,EAAC,MAAM,kCAAkC,CAAC;AAG/D,MAAM,WAAW,iBAAkB,SAAQ,QAAQ;CAAG;
|
|
1
|
+
{"version":3,"file":"ModalOverlay.d.ts","sourceRoot":"","sources":["../../../../modal/lib/ModalOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,EAAM,QAAQ,EAAC,MAAM,kCAAkC,CAAC;AAG/D,MAAM,WAAW,iBAAkB,SAAQ,QAAQ;CAAG;AAyDtD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;EAOvB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;EAQ1B,CAAC"}
|
|
@@ -27,6 +27,13 @@ const Container = styled(Box)({
|
|
|
27
27
|
'.wd-no-animation &': {
|
|
28
28
|
animation: 'none',
|
|
29
29
|
},
|
|
30
|
+
}, ({ theme }) => {
|
|
31
|
+
const { canvas: canvasTheme } = getTheme(theme);
|
|
32
|
+
return {
|
|
33
|
+
[canvasTheme.breakpoints.down('s')]: {
|
|
34
|
+
height: '100%',
|
|
35
|
+
},
|
|
36
|
+
};
|
|
30
37
|
});
|
|
31
38
|
// This centering container helps fix an issue with Chrome. Chrome doesn't normally do subpixel
|
|
32
39
|
// positioning, but seems to when using flexbox centering. This messes up Popper calculations inside
|
|
@@ -35,14 +42,14 @@ const Container = styled(Box)({
|
|
|
35
42
|
const ResponsiveContainer = styled('div')(({ theme }) => {
|
|
36
43
|
const { canvas: canvasTheme } = getTheme(theme);
|
|
37
44
|
return {
|
|
38
|
-
maxHeight: '
|
|
45
|
+
maxHeight: '100%',
|
|
39
46
|
display: 'flex',
|
|
40
47
|
position: 'absolute',
|
|
41
48
|
left: 0,
|
|
42
49
|
top: 0,
|
|
43
50
|
justifyContent: 'center',
|
|
44
51
|
alignItems: 'center',
|
|
45
|
-
height: '
|
|
52
|
+
height: '100%',
|
|
46
53
|
[canvasTheme.breakpoints.down('s')]: {
|
|
47
54
|
alignItems: 'end',
|
|
48
55
|
},
|
|
@@ -53,7 +53,7 @@ export interface TabsItemProps extends ExtractProps<typeof Box, never>, Partial<
|
|
|
53
53
|
*/
|
|
54
54
|
tabIndex?: number;
|
|
55
55
|
}
|
|
56
|
-
export declare const StyledTabItem: import("@emotion/styled").StyledComponent<import("@workday/canvas-kit-react/layout").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").GridItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStyleProps & import("@workday/canvas-kit-react/layout").SpaceStyleProps & import("@workday/canvas-kit-react/layout").TextStyleProps & import("@workday/canvas-kit-styling").CSProps & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "left" | "right" | "top" | "bottom" | "fill" | "as" | "color" | "resize" | "width" | "height" | "alignSelf" | "appearance" | "backgroundAttachment" | "backgroundColor" | "backgroundImage" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "boxShadow" | "boxSizing" | "content" | "cursor" | "display" | "flexBasis" | "flexGrow" | "flexShrink" | "float" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "inset" | "insetInlineEnd" | "insetInlineStart" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "objectFit" | "objectPosition" | "opacity" | "order" | "outlineOffset" | "overflowWrap" | "overflowX" | "overflowY" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pointerEvents" | "position" | "scrollMargin" | "scrollMarginBottom" | "scrollMarginInlineEnd" | "scrollMarginInlineStart" | "scrollMarginTop" | "scrollPadding" | "scrollPaddingBottom" | "scrollPaddingInlineEnd" | "scrollPaddingInlineStart" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "textAlign" | "textOverflow" | "textShadow" | "textTransform" | "transform" | "userSelect" | "verticalAlign" | "visibility" | "whiteSpace" | "wordBreak" | "zIndex" | "animation" | "background" | "backgroundPosition" | "border" | "borderBottom" | "borderColor" | "borderInlineEnd" | "borderInlineStart" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "gridColumn" | "gridRow" | "listStyle" | "margin" | "outline" | "overflow" | "padding" | "placeSelf" | "textDecoration" | "transition" | "stroke" | "depth" | "marginX" | "marginY" | "paddingX" | "paddingY"
|
|
56
|
+
export declare const StyledTabItem: import("@emotion/styled").StyledComponent<import("@workday/canvas-kit-react/layout").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").GridItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStyleProps & import("@workday/canvas-kit-react/layout").SpaceStyleProps & import("@workday/canvas-kit-react/layout").TextStyleProps & import("@workday/canvas-kit-styling").CSProps & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "left" | "right" | "top" | "bottom" | "fill" | "as" | "color" | "resize" | "width" | "height" | "alignSelf" | "appearance" | "backgroundAttachment" | "backgroundColor" | "backgroundImage" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "boxShadow" | "boxSizing" | "content" | "cursor" | "display" | "flexBasis" | "flexGrow" | "flexShrink" | "float" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "inset" | "insetInlineEnd" | "insetInlineStart" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "objectFit" | "objectPosition" | "opacity" | "order" | "outlineOffset" | "overflowWrap" | "overflowX" | "overflowY" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pointerEvents" | "position" | "scrollMargin" | "scrollMarginBottom" | "scrollMarginInlineEnd" | "scrollMarginInlineStart" | "scrollMarginTop" | "scrollPadding" | "scrollPaddingBottom" | "scrollPaddingInlineEnd" | "scrollPaddingInlineStart" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "textAlign" | "textOverflow" | "textShadow" | "textTransform" | "transform" | "userSelect" | "verticalAlign" | "visibility" | "whiteSpace" | "wordBreak" | "zIndex" | "animation" | "background" | "backgroundPosition" | "border" | "borderBottom" | "borderColor" | "borderInlineEnd" | "borderInlineStart" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "gridColumn" | "gridRow" | "listStyle" | "margin" | "outline" | "overflow" | "padding" | "placeSelf" | "textDecoration" | "transition" | "stroke" | "cs" | "depth" | "marginX" | "marginY" | "paddingX" | "paddingY"> & {
|
|
57
57
|
ref?: React.Ref<HTMLButtonElement> | undefined;
|
|
58
58
|
} & {
|
|
59
59
|
theme?: import("@emotion/react").Theme | undefined;
|
package/layout/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './lib/Box';
|
|
2
|
+
export * from './lib/utils/mergeStyles';
|
|
2
3
|
export * from './lib/utils/background';
|
|
3
4
|
export * from './lib/utils/border';
|
|
4
5
|
export * from './lib/utils/color';
|
|
@@ -16,7 +17,7 @@ export {AllStyleProps, CommonStyleProps} from './lib/utils/styleProps';
|
|
|
16
17
|
export * from './lib/utils/text';
|
|
17
18
|
export * from './lib/Flex';
|
|
18
19
|
export * from './lib/Grid';
|
|
19
|
-
export type {
|
|
20
|
-
export type {
|
|
21
|
-
export
|
|
20
|
+
export type {FlexStyleProps} from './lib/utils/flex';
|
|
21
|
+
export type {GridStyleProps} from './lib/utils/grid';
|
|
22
|
+
export {GridItemStyleProps, gridItemStyleFnConfigs} from './lib/utils/gridItem';
|
|
22
23
|
export * from './lib/utils/systemProps';
|