@workday/canvas-kit-react 8.0.0-alpha.246-next.16 → 8.0.0-alpha.250-next.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/common/index.ts +1 -0
  2. package/common/lib/responsive/useResponsiveContainerStyles.ts +128 -0
  3. package/common/lib/utils/isWithinBreakpoint.ts +6 -0
  4. package/dist/commonjs/common/index.d.ts +1 -0
  5. package/dist/commonjs/common/index.d.ts.map +1 -1
  6. package/dist/commonjs/common/index.js +1 -0
  7. package/dist/commonjs/common/lib/responsive/useResponsiveContainerStyles.d.ts +78 -0
  8. package/dist/commonjs/common/lib/responsive/useResponsiveContainerStyles.d.ts.map +1 -0
  9. package/dist/commonjs/common/lib/responsive/useResponsiveContainerStyles.js +139 -0
  10. package/dist/commonjs/common/lib/utils/isWithinBreakpoint.d.ts +5 -0
  11. package/dist/commonjs/common/lib/utils/isWithinBreakpoint.d.ts.map +1 -0
  12. package/dist/commonjs/common/lib/utils/isWithinBreakpoint.js +10 -0
  13. package/dist/commonjs/layout/lib/Flex.d.ts +2 -2
  14. package/dist/commonjs/layout/lib/Flex.d.ts.map +1 -1
  15. package/dist/commonjs/layout/lib/Grid.d.ts +2 -2
  16. package/dist/commonjs/layout/lib/Grid.d.ts.map +1 -1
  17. package/dist/commonjs/layout/lib/Stack.d.ts +1 -1
  18. package/dist/commonjs/layout/lib/utils/flex.d.ts +2 -2
  19. package/dist/commonjs/layout/lib/utils/flex.d.ts.map +1 -1
  20. package/dist/commonjs/layout/lib/utils/grid.d.ts +2 -2
  21. package/dist/commonjs/layout/lib/utils/grid.d.ts.map +1 -1
  22. package/dist/es6/common/index.d.ts +1 -0
  23. package/dist/es6/common/index.d.ts.map +1 -1
  24. package/dist/es6/common/index.js +1 -0
  25. package/dist/es6/common/lib/responsive/useResponsiveContainerStyles.d.ts +78 -0
  26. package/dist/es6/common/lib/responsive/useResponsiveContainerStyles.d.ts.map +1 -0
  27. package/dist/es6/common/lib/responsive/useResponsiveContainerStyles.js +135 -0
  28. package/dist/es6/common/lib/utils/isWithinBreakpoint.d.ts +5 -0
  29. package/dist/es6/common/lib/utils/isWithinBreakpoint.d.ts.map +1 -0
  30. package/dist/es6/common/lib/utils/isWithinBreakpoint.js +6 -0
  31. package/dist/es6/layout/lib/Flex.d.ts +2 -2
  32. package/dist/es6/layout/lib/Flex.d.ts.map +1 -1
  33. package/dist/es6/layout/lib/Grid.d.ts +2 -2
  34. package/dist/es6/layout/lib/Grid.d.ts.map +1 -1
  35. package/dist/es6/layout/lib/Stack.d.ts +1 -1
  36. package/dist/es6/layout/lib/utils/flex.d.ts +2 -2
  37. package/dist/es6/layout/lib/utils/flex.d.ts.map +1 -1
  38. package/dist/es6/layout/lib/utils/grid.d.ts +2 -2
  39. package/dist/es6/layout/lib/utils/grid.d.ts.map +1 -1
  40. package/layout/lib/Box.tsx +1 -1
  41. package/layout/lib/Flex.tsx +1 -1
  42. package/layout/lib/Grid.tsx +1 -1
  43. package/layout/lib/utils/flex.ts +2 -2
  44. package/layout/lib/utils/grid.ts +2 -2
  45. package/package.json +3 -3
package/common/index.ts CHANGED
@@ -7,3 +7,4 @@ export * from './lib/utils';
7
7
  export * from './lib/CanvasProvider';
8
8
  export * from './lib/InputProvider';
9
9
  export * from './lib/EllipsisText';
10
+ export * from './lib/responsive/useResponsiveContainerStyles';
@@ -0,0 +1,128 @@
1
+ import { useTheme, breakpointKeys, CanvasBreakpoints } from "@workday/canvas-kit-react/common";
2
+ import type {AllStyleProps} from "@workday/canvas-kit-react/layout";
3
+ import {isWithinBreakpoint} from '../utils/isWithinBreakpoint'
4
+
5
+ export type BreakpointKeys = typeof breakpointKeys[number];
6
+
7
+ type ResponsiveCSSObject<T> = {
8
+ [P in keyof T]: Partial<Record<BreakpointKeys, AllStyleProps>> &
9
+ AllStyleProps;
10
+ };
11
+ type CSSObject<T> = {
12
+ [P in keyof T]: AllStyleProps;
13
+ };
14
+
15
+ // Takes in CanvasBreakpoint keys and returns current breakpoint key. Current breakpoint key is determined by the `width` of the container
16
+
17
+ const getSize = (width: number, breakpoints: CanvasBreakpoints) => {
18
+ const ranges: {[key: string ]: [number, number?]} = {
19
+ 'zero': [0, breakpoints.s],
20
+ 's': [breakpoints.s, breakpoints.m],
21
+ 'm': [breakpoints.m, breakpoints.l],
22
+ 'l': [breakpoints.l, breakpoints.xl],
23
+ 'xl': [breakpoints.xl]
24
+ };
25
+ return breakpointKeys.find((size: BreakpointKeys) => isWithinBreakpoint(width, ...ranges[size])) || 'zero';
26
+ }
27
+
28
+ // Returns responsive style objects that are within the current CanvasBreakpoint size
29
+
30
+ function getStyles<T>(key: BreakpointKeys, styles: ResponsiveCSSObject<T>) {
31
+ const responsiveStyles = {} as CSSObject<T>;
32
+ const breakpointSize = breakpointKeys.indexOf(key);
33
+ for (let i = 0; i <= breakpointSize; i++) {
34
+ const breakpointName = breakpointKeys[i];
35
+ // property is key of the style object
36
+ Object.keys(styles).forEach((property) => {
37
+ const { zero, s, m, l, xl, ...base } = styles[property as keyof T];
38
+ const currentBreakpointStyles =
39
+ styles[property as keyof T][breakpointName] ?? {};
40
+ const previousBreakpointStyles = responsiveStyles[property as keyof T] ?? {};
41
+ responsiveStyles[property as keyof T] = {
42
+ ...base,
43
+ ...previousBreakpointStyles,
44
+ ...currentBreakpointStyles
45
+ };
46
+ });
47
+ }
48
+ return responsiveStyles;
49
+ }
50
+
51
+ /**
52
+ * useResponsiveContainerStyles
53
+ *
54
+ * ---
55
+ *
56
+ * This hook allows you to create container-based responsive styles with objects.
57
+ * It accepts two or three arguments: the responsive style object, the container width, and (optionally) the theme object.
58
+ * Each style object accepts five breakpoint keys: "zero", "s", "m", "l", and "xl".
59
+ * The sizes will act like `min-width`. For example, if you want to apply styles from `medium` and up, then you would write those styles under `m`.
60
+ *
61
+ * @example
62
+ * ```tsx
63
+ import {Flex, Box} from '@workday/canvas-kit-react/layout';
64
+ import {
65
+ useResponsiveStyles,
66
+ } from '@workday/canvas-kit-react/common';
67
+
68
+ const ref = React.useRef(null);
69
+ const [containerWidth, setContainerWidth] = React.useState(0);
70
+
71
+ useResizeObserver({
72
+ ref: ref,
73
+ onResize: data => {
74
+ setWidth(data.width || 0);
75
+ },
76
+ });
77
+
78
+ const containerResponsiveStyles = useResponsiveStyles(
79
+ {
80
+ flex: {
81
+ flexDirection: 'column',
82
+ padding: 'm',
83
+ depth: 1,
84
+ borderRadius: 'l',
85
+ zero: {
86
+ backgroundColor: 'Red',
87
+ },
88
+ s: {
89
+ backgroundColor: 'Orange',
90
+ },
91
+ m: {
92
+ backgroundColor: 'Yellow',
93
+ },
94
+ l: {
95
+ backgroundColor: 'Green',
96
+ },
97
+ xl: {
98
+ backgroundColor: 'Blue',
99
+ },
100
+ },
101
+ box: {
102
+ padding: 's',
103
+ },
104
+ },
105
+ containerWidth
106
+ );
107
+
108
+ return (
109
+ <Box ref={ref}>
110
+ <Flex {...containerResponsiveStyles.flex}>
111
+ <Box {...containerResponsiveStyles.box}>Hello World</Box>
112
+ </Flex>
113
+ </Box>
114
+ );
115
+ ```
116
+ */
117
+
118
+ export function useResponsiveContainerStyles<T extends ResponsiveCSSObject<T>>(
119
+ styles: ResponsiveCSSObject<T>,
120
+ width: number,
121
+ theme = {}
122
+ ) {
123
+ const canvasTheme = useTheme(theme);
124
+ const breakpoints = canvasTheme.canvas.breakpoints.values;
125
+
126
+ const size = getSize(width, breakpoints);
127
+ return getStyles(size, styles);
128
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This function determines whether or not a container's width is within two values.
3
+ */
4
+ export const isWithinBreakpoint = (width: number, min: number, max?: number) => {
5
+ return width >= min && (!max || (max && width <= max - 0.5));
6
+ };
@@ -7,4 +7,5 @@ export * from './lib/utils';
7
7
  export * from './lib/CanvasProvider';
8
8
  export * from './lib/InputProvider';
9
9
  export * from './lib/EllipsisText';
10
+ export * from './lib/responsive/useResponsiveContainerStyles';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+CAA+C,CAAC"}
@@ -19,3 +19,4 @@ __exportStar(require("./lib/utils"), exports);
19
19
  __exportStar(require("./lib/CanvasProvider"), exports);
20
20
  __exportStar(require("./lib/InputProvider"), exports);
21
21
  __exportStar(require("./lib/EllipsisText"), exports);
22
+ __exportStar(require("./lib/responsive/useResponsiveContainerStyles"), exports);
@@ -0,0 +1,78 @@
1
+ import { breakpointKeys } from "@workday/canvas-kit-react/common";
2
+ import type { AllStyleProps } from "@workday/canvas-kit-react/layout";
3
+ export declare type BreakpointKeys = typeof breakpointKeys[number];
4
+ declare type ResponsiveCSSObject<T> = {
5
+ [P in keyof T]: Partial<Record<BreakpointKeys, AllStyleProps>> & AllStyleProps;
6
+ };
7
+ declare type CSSObject<T> = {
8
+ [P in keyof T]: AllStyleProps;
9
+ };
10
+ /**
11
+ * useResponsiveContainerStyles
12
+ *
13
+ * ---
14
+ *
15
+ * This hook allows you to create container-based responsive styles with objects.
16
+ * It accepts two or three arguments: the responsive style object, the container width, and (optionally) the theme object.
17
+ * Each style object accepts five breakpoint keys: "zero", "s", "m", "l", and "xl".
18
+ * The sizes will act like `min-width`. For example, if you want to apply styles from `medium` and up, then you would write those styles under `m`.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ import {Flex, Box} from '@workday/canvas-kit-react/layout';
23
+ import {
24
+ useResponsiveStyles,
25
+ } from '@workday/canvas-kit-react/common';
26
+
27
+ const ref = React.useRef(null);
28
+ const [containerWidth, setContainerWidth] = React.useState(0);
29
+
30
+ useResizeObserver({
31
+ ref: ref,
32
+ onResize: data => {
33
+ setWidth(data.width || 0);
34
+ },
35
+ });
36
+
37
+ const containerResponsiveStyles = useResponsiveStyles(
38
+ {
39
+ flex: {
40
+ flexDirection: 'column',
41
+ padding: 'm',
42
+ depth: 1,
43
+ borderRadius: 'l',
44
+ zero: {
45
+ backgroundColor: 'Red',
46
+ },
47
+ s: {
48
+ backgroundColor: 'Orange',
49
+ },
50
+ m: {
51
+ backgroundColor: 'Yellow',
52
+ },
53
+ l: {
54
+ backgroundColor: 'Green',
55
+ },
56
+ xl: {
57
+ backgroundColor: 'Blue',
58
+ },
59
+ },
60
+ box: {
61
+ padding: 's',
62
+ },
63
+ },
64
+ containerWidth
65
+ );
66
+
67
+ return (
68
+ <Box ref={ref}>
69
+ <Flex {...containerResponsiveStyles.flex}>
70
+ <Box {...containerResponsiveStyles.box}>Hello World</Box>
71
+ </Flex>
72
+ </Box>
73
+ );
74
+ ```
75
+ */
76
+ export declare function useResponsiveContainerStyles<T extends ResponsiveCSSObject<T>>(styles: ResponsiveCSSObject<T>, width: number, theme?: {}): CSSObject<T>;
77
+ export {};
78
+ //# sourceMappingURL=useResponsiveContainerStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResponsiveContainerStyles.d.ts","sourceRoot":"","sources":["../../../../../common/lib/responsive/useResponsiveContainerStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,cAAc,EAAqB,MAAM,kCAAkC,CAAC;AAC/F,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAGpE,oBAAY,cAAc,GAAG,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAE3D,aAAK,mBAAmB,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC,GAC5D,aAAa;CAChB,CAAC;AACF,aAAK,SAAS,CAAC,CAAC,IAAI;KACjB,CAAC,IAAI,MAAM,CAAC,GAAG,aAAa;CAC9B,CAAC;AAsCF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAEH,wBAAgB,4BAA4B,CAAC,CAAC,SAAS,mBAAmB,CAAC,CAAC,CAAC,EAC3E,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAC9B,KAAK,EAAE,MAAM,EACb,KAAK,KAAK,gBAOX"}
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ var __spreadArrays = (this && this.__spreadArrays) || function () {
25
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
26
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
27
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
28
+ r[k] = a[j];
29
+ return r;
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.useResponsiveContainerStyles = void 0;
33
+ var common_1 = require("@workday/canvas-kit-react/common");
34
+ var isWithinBreakpoint_1 = require("../utils/isWithinBreakpoint");
35
+ // Takes in CanvasBreakpoint keys and returns current breakpoint key. Current breakpoint key is determined by the `width` of the container
36
+ var getSize = function (width, breakpoints) {
37
+ var ranges = {
38
+ 'zero': [0, breakpoints.s],
39
+ 's': [breakpoints.s, breakpoints.m],
40
+ 'm': [breakpoints.m, breakpoints.l],
41
+ 'l': [breakpoints.l, breakpoints.xl],
42
+ 'xl': [breakpoints.xl]
43
+ };
44
+ return common_1.breakpointKeys.find(function (size) { return isWithinBreakpoint_1.isWithinBreakpoint.apply(void 0, __spreadArrays([width], ranges[size])); }) || 'zero';
45
+ };
46
+ // Returns responsive style objects that are within the current CanvasBreakpoint size
47
+ function getStyles(key, styles) {
48
+ var responsiveStyles = {};
49
+ var breakpointSize = common_1.breakpointKeys.indexOf(key);
50
+ var _loop_1 = function (i) {
51
+ var breakpointName = common_1.breakpointKeys[i];
52
+ // property is key of the style object
53
+ Object.keys(styles).forEach(function (property) {
54
+ var _a, _b;
55
+ var _c = styles[property], zero = _c.zero, s = _c.s, m = _c.m, l = _c.l, xl = _c.xl, base = __rest(_c, ["zero", "s", "m", "l", "xl"]);
56
+ var currentBreakpointStyles = (_a = styles[property][breakpointName]) !== null && _a !== void 0 ? _a : {};
57
+ var previousBreakpointStyles = (_b = responsiveStyles[property]) !== null && _b !== void 0 ? _b : {};
58
+ responsiveStyles[property] = __assign(__assign(__assign({}, base), previousBreakpointStyles), currentBreakpointStyles);
59
+ });
60
+ };
61
+ for (var i = 0; i <= breakpointSize; i++) {
62
+ _loop_1(i);
63
+ }
64
+ return responsiveStyles;
65
+ }
66
+ /**
67
+ * useResponsiveContainerStyles
68
+ *
69
+ * ---
70
+ *
71
+ * This hook allows you to create container-based responsive styles with objects.
72
+ * It accepts two or three arguments: the responsive style object, the container width, and (optionally) the theme object.
73
+ * Each style object accepts five breakpoint keys: "zero", "s", "m", "l", and "xl".
74
+ * The sizes will act like `min-width`. For example, if you want to apply styles from `medium` and up, then you would write those styles under `m`.
75
+ *
76
+ * @example
77
+ * ```tsx
78
+ import {Flex, Box} from '@workday/canvas-kit-react/layout';
79
+ import {
80
+ useResponsiveStyles,
81
+ } from '@workday/canvas-kit-react/common';
82
+
83
+ const ref = React.useRef(null);
84
+ const [containerWidth, setContainerWidth] = React.useState(0);
85
+
86
+ useResizeObserver({
87
+ ref: ref,
88
+ onResize: data => {
89
+ setWidth(data.width || 0);
90
+ },
91
+ });
92
+
93
+ const containerResponsiveStyles = useResponsiveStyles(
94
+ {
95
+ flex: {
96
+ flexDirection: 'column',
97
+ padding: 'm',
98
+ depth: 1,
99
+ borderRadius: 'l',
100
+ zero: {
101
+ backgroundColor: 'Red',
102
+ },
103
+ s: {
104
+ backgroundColor: 'Orange',
105
+ },
106
+ m: {
107
+ backgroundColor: 'Yellow',
108
+ },
109
+ l: {
110
+ backgroundColor: 'Green',
111
+ },
112
+ xl: {
113
+ backgroundColor: 'Blue',
114
+ },
115
+ },
116
+ box: {
117
+ padding: 's',
118
+ },
119
+ },
120
+ containerWidth
121
+ );
122
+
123
+ return (
124
+ <Box ref={ref}>
125
+ <Flex {...containerResponsiveStyles.flex}>
126
+ <Box {...containerResponsiveStyles.box}>Hello World</Box>
127
+ </Flex>
128
+ </Box>
129
+ );
130
+ ```
131
+ */
132
+ function useResponsiveContainerStyles(styles, width, theme) {
133
+ if (theme === void 0) { theme = {}; }
134
+ var canvasTheme = common_1.useTheme(theme);
135
+ var breakpoints = canvasTheme.canvas.breakpoints.values;
136
+ var size = getSize(width, breakpoints);
137
+ return getStyles(size, styles);
138
+ }
139
+ exports.useResponsiveContainerStyles = useResponsiveContainerStyles;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This function determines whether or not a container's width is within two values.
3
+ */
4
+ export declare const isWithinBreakpoint: (width: number, min: number, max?: number | undefined) => boolean | 0;
5
+ //# sourceMappingURL=isWithinBreakpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isWithinBreakpoint.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/isWithinBreakpoint.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,kBAAkB,UAAW,MAAM,OAAO,MAAM,0CAE5D,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isWithinBreakpoint = void 0;
4
+ /**
5
+ * This function determines whether or not a container's width is within two values.
6
+ */
7
+ var isWithinBreakpoint = function (width, min, max) {
8
+ return width >= min && (!max || (max && width <= max - 0.5));
9
+ };
10
+ exports.isWithinBreakpoint = isWithinBreakpoint;
@@ -1,6 +1,6 @@
1
1
  import { BoxProps } from './Box';
2
2
  import { FlexStyleProps } from './utils/flex';
3
- export declare type FlexProps = BoxProps & FlexStyleProps;
3
+ export declare type FlexProps = Omit<BoxProps, 'display'> & FlexStyleProps;
4
4
  /**
5
5
  * `Flex` is a low-level layout component that provides a common, ergonomic API for applying CSS flexbox styles.
6
6
  * It is highly flexible, and can be used on its own or to build other components.
@@ -23,7 +23,7 @@ export declare type FlexProps = BoxProps & FlexStyleProps;
23
23
  * );
24
24
  * ```
25
25
  */
26
- export declare const Flex: import("../../common").ElementComponent<"div", import("..").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").GridItemStyleProps & import("..").LayoutStyleProps & import("..").OtherStyleProps & import("..").PositionStyleProps & import("..").SpaceStyleProps & import("..").TextStyleProps & FlexStyleProps> & {
26
+ export declare const Flex: import("../../common").ElementComponent<"div", FlexProps> & {
27
27
  Item: import("../../common").ElementComponent<"div", import("..").CommonStyleProps>;
28
28
  };
29
29
  //# sourceMappingURL=Flex.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Flex.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;AASlD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,IAAI;;CAYf,CAAC"}
1
+ {"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Flex.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,SAAS,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,cAAc,CAAC;AASnE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,IAAI;;CAYf,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { BoxProps } from './Box';
2
2
  import { GridStyleProps } from './utils/grid';
3
- export declare type GridProps = BoxProps & GridStyleProps;
3
+ export declare type GridProps = Omit<BoxProps, 'display'> & GridStyleProps;
4
4
  export declare type GridItemProps = BoxProps;
5
5
  /**
6
6
  * `Grid` is a two-dimensional layout system for the web. It lets you lay content out in rows and columns.
@@ -24,7 +24,7 @@ export declare type GridItemProps = BoxProps;
24
24
  * );
25
25
  *```
26
26
  */
27
- export declare const Grid: import("../../common").ElementComponent<"div", import("..").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").GridItemStyleProps & import("..").LayoutStyleProps & import("..").OtherStyleProps & import("..").PositionStyleProps & import("..").SpaceStyleProps & import("..").TextStyleProps & GridStyleProps> & {
27
+ export declare const Grid: import("../../common").ElementComponent<"div", GridProps> & {
28
28
  /**
29
29
  * `<Grid.Item />` is the child specific sub-component to `<Grid/>`. `<Grid.Item />` gets child specific props, whereas `<Grid./>` gets parent container props.
30
30
  *
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Grid.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;AAClD,oBAAY,aAAa,GAAG,QAAQ,CAAC;AAoBrC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,IAAI;IAUb;;;;;;;;;;;;;;;;;;;;OAoBG;;CAIL,CAAC"}
1
+ {"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Grid.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,SAAS,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,cAAc,CAAC;AACnE,oBAAY,aAAa,GAAG,QAAQ,CAAC;AAoBrC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,IAAI;IAUb;;;;;;;;;;;;;;;;;;;;OAoBG;;CAIL,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { FlexProps } from './Flex';
2
2
  import { StackStyleProps } from './utils/stack';
3
3
  export declare type StackProps = FlexProps & StackStyleProps;
4
- export declare const Stack: import("../../common").ElementComponent<"div", import("..").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").GridItemStyleProps & import("..").LayoutStyleProps & import("..").OtherStyleProps & import("..").PositionStyleProps & import("..").SpaceStyleProps & import("..").TextStyleProps & import("..").FlexStyleProps & StackStyleProps> & {
4
+ export declare const Stack: import("../../common").ElementComponent<"div", StackProps> & {
5
5
  Item: import("../../common").ElementComponent<"div", import("..").CommonStyleProps>;
6
6
  };
7
7
  export interface HStackProps extends StackProps {
@@ -1,4 +1,4 @@
1
- import { Property } from 'csstype';
1
+ import { Property, Globals } from 'csstype';
2
2
  import { StyleFnConfig } from './buildStyleFns';
3
3
  import { SystemPropValues } from './systemProps';
4
4
  /** style props to for CSS flexbox container properties */
@@ -11,7 +11,7 @@ export declare type FlexStyleProps = {
11
11
  * - sets [CSS display property](https://developer.mozilla.org/en-US/docs/Web/CSS/display)
12
12
  * - @default 'flex'
13
13
  * */
14
- display?: 'flex' | 'inline-flex';
14
+ display?: 'flex' | 'inline-flex' | 'none' | Globals | (string & {});
15
15
  /** sets [CSS justify-items property](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items) */
16
16
  justifyItems?: Property.JustifyItems;
17
17
  /** sets [CSS justify-content property](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) */
@@ -1 +1 @@
1
- {"version":3,"file":"flex.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/flex.ts"],"names":[],"m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,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAE/C,0DAA0D;AAC1D,oBAAY,cAAc,GAAG;IAC3B,oGAAoG;IACpG,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,wGAAwG;IACxG,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC;;;SAGK;IACL,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACpE,wGAAwG;IACxG,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC,4GAA4G;IAC5G,cAAc,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC;IACzC,gGAAgG;IAChG,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAC7B,0GAA0G;IAC1G,aAAa,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC;IACvC;;;SAGK;IACL,GAAG,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChC;;;SAGK;IACL,SAAS,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACtC;;;SAGK;IACL,MAAM,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,aAAa,EAmD7C,CAAC;AAEF,eAAO,MAAM,YAAY,oCAAoC,CAAC;AAC9D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,IAAI,+BAAiD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Property } from 'csstype';
1
+ import { Property, Globals } from 'csstype';
2
2
  import { StyleFnConfig } from './buildStyleFns';
3
3
  import { SystemPropValues } from './systemProps';
4
4
  /** style props to for CSS grid container properties */
@@ -11,7 +11,7 @@ export declare type GridStyleProps = {
11
11
  * - sets [CSS display property](https://developer.mozilla.org/en-US/docs/Web/CSS/display)
12
12
  * - @default 'grid'
13
13
  * */
14
- display?: 'grid' | 'inline-grid';
14
+ display?: 'grid' | 'inline-grid' | 'none' | Globals | (string & {});
15
15
  /** sets [CSS justify-items property](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items) */
16
16
  justifyItems?: Property.JustifyItems;
17
17
  /** sets [CSS justify-content property](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) */
@@ -1 +1 @@
1
- {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAkC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAE/C,uDAAuD;AACvD,oBAAY,cAAc,GAAG;IAC3B,oGAAoG;IACpG,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,wGAAwG;IACxG,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC;;;SAGK;IACL,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IACjC,wGAAwG;IACxG,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC,4GAA4G;IAC5G,cAAc,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC;IACzC,wGAAwG;IACxG,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC,oHAAoH;IACpH,iBAAiB,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC;IAC/C,wHAAwH;IACxH,mBAAmB,CAAC,EAAE,QAAQ,CAAC,mBAAmB,CAAC;IACnD,kHAAkH;IAClH,gBAAgB,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAC7C;;;SAGK;IACL,aAAa,CAAC,EAAE,QAAQ,CAAC,aAAa,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACnE;;;SAGK;IACL,UA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;;;;;GAaG;AACH,eAAO,MAAM,IAAI,+BAAiD,CAAC"}
@@ -7,4 +7,5 @@ export * from './lib/utils';
7
7
  export * from './lib/CanvasProvider';
8
8
  export * from './lib/InputProvider';
9
9
  export * from './lib/EllipsisText';
10
+ export * from './lib/responsive/useResponsiveContainerStyles';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+CAA+C,CAAC"}
@@ -7,3 +7,4 @@ export * from './lib/utils';
7
7
  export * from './lib/CanvasProvider';
8
8
  export * from './lib/InputProvider';
9
9
  export * from './lib/EllipsisText';
10
+ export * from './lib/responsive/useResponsiveContainerStyles';
@@ -0,0 +1,78 @@
1
+ import { breakpointKeys } from "@workday/canvas-kit-react/common";
2
+ import type { AllStyleProps } from "@workday/canvas-kit-react/layout";
3
+ export declare type BreakpointKeys = typeof breakpointKeys[number];
4
+ declare type ResponsiveCSSObject<T> = {
5
+ [P in keyof T]: Partial<Record<BreakpointKeys, AllStyleProps>> & AllStyleProps;
6
+ };
7
+ declare type CSSObject<T> = {
8
+ [P in keyof T]: AllStyleProps;
9
+ };
10
+ /**
11
+ * useResponsiveContainerStyles
12
+ *
13
+ * ---
14
+ *
15
+ * This hook allows you to create container-based responsive styles with objects.
16
+ * It accepts two or three arguments: the responsive style object, the container width, and (optionally) the theme object.
17
+ * Each style object accepts five breakpoint keys: "zero", "s", "m", "l", and "xl".
18
+ * The sizes will act like `min-width`. For example, if you want to apply styles from `medium` and up, then you would write those styles under `m`.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ import {Flex, Box} from '@workday/canvas-kit-react/layout';
23
+ import {
24
+ useResponsiveStyles,
25
+ } from '@workday/canvas-kit-react/common';
26
+
27
+ const ref = React.useRef(null);
28
+ const [containerWidth, setContainerWidth] = React.useState(0);
29
+
30
+ useResizeObserver({
31
+ ref: ref,
32
+ onResize: data => {
33
+ setWidth(data.width || 0);
34
+ },
35
+ });
36
+
37
+ const containerResponsiveStyles = useResponsiveStyles(
38
+ {
39
+ flex: {
40
+ flexDirection: 'column',
41
+ padding: 'm',
42
+ depth: 1,
43
+ borderRadius: 'l',
44
+ zero: {
45
+ backgroundColor: 'Red',
46
+ },
47
+ s: {
48
+ backgroundColor: 'Orange',
49
+ },
50
+ m: {
51
+ backgroundColor: 'Yellow',
52
+ },
53
+ l: {
54
+ backgroundColor: 'Green',
55
+ },
56
+ xl: {
57
+ backgroundColor: 'Blue',
58
+ },
59
+ },
60
+ box: {
61
+ padding: 's',
62
+ },
63
+ },
64
+ containerWidth
65
+ );
66
+
67
+ return (
68
+ <Box ref={ref}>
69
+ <Flex {...containerResponsiveStyles.flex}>
70
+ <Box {...containerResponsiveStyles.box}>Hello World</Box>
71
+ </Flex>
72
+ </Box>
73
+ );
74
+ ```
75
+ */
76
+ export declare function useResponsiveContainerStyles<T extends ResponsiveCSSObject<T>>(styles: ResponsiveCSSObject<T>, width: number, theme?: {}): CSSObject<T>;
77
+ export {};
78
+ //# sourceMappingURL=useResponsiveContainerStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResponsiveContainerStyles.d.ts","sourceRoot":"","sources":["../../../../../common/lib/responsive/useResponsiveContainerStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,cAAc,EAAqB,MAAM,kCAAkC,CAAC;AAC/F,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAGpE,oBAAY,cAAc,GAAG,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAE3D,aAAK,mBAAmB,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC,GAC5D,aAAa;CAChB,CAAC;AACF,aAAK,SAAS,CAAC,CAAC,IAAI;KACjB,CAAC,IAAI,MAAM,CAAC,GAAG,aAAa;CAC9B,CAAC;AAsCF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAEH,wBAAgB,4BAA4B,CAAC,CAAC,SAAS,mBAAmB,CAAC,CAAC,CAAC,EAC3E,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAC9B,KAAK,EAAE,MAAM,EACb,KAAK,KAAK,gBAOX"}
@@ -0,0 +1,135 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ var __spreadArrays = (this && this.__spreadArrays) || function () {
24
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
25
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
26
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
27
+ r[k] = a[j];
28
+ return r;
29
+ };
30
+ import { useTheme, breakpointKeys } from "@workday/canvas-kit-react/common";
31
+ import { isWithinBreakpoint } from '../utils/isWithinBreakpoint';
32
+ // Takes in CanvasBreakpoint keys and returns current breakpoint key. Current breakpoint key is determined by the `width` of the container
33
+ var getSize = function (width, breakpoints) {
34
+ var ranges = {
35
+ 'zero': [0, breakpoints.s],
36
+ 's': [breakpoints.s, breakpoints.m],
37
+ 'm': [breakpoints.m, breakpoints.l],
38
+ 'l': [breakpoints.l, breakpoints.xl],
39
+ 'xl': [breakpoints.xl]
40
+ };
41
+ return breakpointKeys.find(function (size) { return isWithinBreakpoint.apply(void 0, __spreadArrays([width], ranges[size])); }) || 'zero';
42
+ };
43
+ // Returns responsive style objects that are within the current CanvasBreakpoint size
44
+ function getStyles(key, styles) {
45
+ var responsiveStyles = {};
46
+ var breakpointSize = breakpointKeys.indexOf(key);
47
+ var _loop_1 = function (i) {
48
+ var breakpointName = breakpointKeys[i];
49
+ // property is key of the style object
50
+ Object.keys(styles).forEach(function (property) {
51
+ var _a, _b;
52
+ var _c = styles[property], zero = _c.zero, s = _c.s, m = _c.m, l = _c.l, xl = _c.xl, base = __rest(_c, ["zero", "s", "m", "l", "xl"]);
53
+ var currentBreakpointStyles = (_a = styles[property][breakpointName]) !== null && _a !== void 0 ? _a : {};
54
+ var previousBreakpointStyles = (_b = responsiveStyles[property]) !== null && _b !== void 0 ? _b : {};
55
+ responsiveStyles[property] = __assign(__assign(__assign({}, base), previousBreakpointStyles), currentBreakpointStyles);
56
+ });
57
+ };
58
+ for (var i = 0; i <= breakpointSize; i++) {
59
+ _loop_1(i);
60
+ }
61
+ return responsiveStyles;
62
+ }
63
+ /**
64
+ * useResponsiveContainerStyles
65
+ *
66
+ * ---
67
+ *
68
+ * This hook allows you to create container-based responsive styles with objects.
69
+ * It accepts two or three arguments: the responsive style object, the container width, and (optionally) the theme object.
70
+ * Each style object accepts five breakpoint keys: "zero", "s", "m", "l", and "xl".
71
+ * The sizes will act like `min-width`. For example, if you want to apply styles from `medium` and up, then you would write those styles under `m`.
72
+ *
73
+ * @example
74
+ * ```tsx
75
+ import {Flex, Box} from '@workday/canvas-kit-react/layout';
76
+ import {
77
+ useResponsiveStyles,
78
+ } from '@workday/canvas-kit-react/common';
79
+
80
+ const ref = React.useRef(null);
81
+ const [containerWidth, setContainerWidth] = React.useState(0);
82
+
83
+ useResizeObserver({
84
+ ref: ref,
85
+ onResize: data => {
86
+ setWidth(data.width || 0);
87
+ },
88
+ });
89
+
90
+ const containerResponsiveStyles = useResponsiveStyles(
91
+ {
92
+ flex: {
93
+ flexDirection: 'column',
94
+ padding: 'm',
95
+ depth: 1,
96
+ borderRadius: 'l',
97
+ zero: {
98
+ backgroundColor: 'Red',
99
+ },
100
+ s: {
101
+ backgroundColor: 'Orange',
102
+ },
103
+ m: {
104
+ backgroundColor: 'Yellow',
105
+ },
106
+ l: {
107
+ backgroundColor: 'Green',
108
+ },
109
+ xl: {
110
+ backgroundColor: 'Blue',
111
+ },
112
+ },
113
+ box: {
114
+ padding: 's',
115
+ },
116
+ },
117
+ containerWidth
118
+ );
119
+
120
+ return (
121
+ <Box ref={ref}>
122
+ <Flex {...containerResponsiveStyles.flex}>
123
+ <Box {...containerResponsiveStyles.box}>Hello World</Box>
124
+ </Flex>
125
+ </Box>
126
+ );
127
+ ```
128
+ */
129
+ export function useResponsiveContainerStyles(styles, width, theme) {
130
+ if (theme === void 0) { theme = {}; }
131
+ var canvasTheme = useTheme(theme);
132
+ var breakpoints = canvasTheme.canvas.breakpoints.values;
133
+ var size = getSize(width, breakpoints);
134
+ return getStyles(size, styles);
135
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This function determines whether or not a container's width is within two values.
3
+ */
4
+ export declare const isWithinBreakpoint: (width: number, min: number, max?: number | undefined) => boolean | 0;
5
+ //# sourceMappingURL=isWithinBreakpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isWithinBreakpoint.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/isWithinBreakpoint.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,kBAAkB,UAAW,MAAM,OAAO,MAAM,0CAE5D,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This function determines whether or not a container's width is within two values.
3
+ */
4
+ export var isWithinBreakpoint = function (width, min, max) {
5
+ return width >= min && (!max || (max && width <= max - 0.5));
6
+ };
@@ -1,6 +1,6 @@
1
1
  import { BoxProps } from './Box';
2
2
  import { FlexStyleProps } from './utils/flex';
3
- export declare type FlexProps = BoxProps & FlexStyleProps;
3
+ export declare type FlexProps = Omit<BoxProps, 'display'> & FlexStyleProps;
4
4
  /**
5
5
  * `Flex` is a low-level layout component that provides a common, ergonomic API for applying CSS flexbox styles.
6
6
  * It is highly flexible, and can be used on its own or to build other components.
@@ -23,7 +23,7 @@ export declare type FlexProps = BoxProps & FlexStyleProps;
23
23
  * );
24
24
  * ```
25
25
  */
26
- export declare const Flex: import("../../common").ElementComponent<"div", import("..").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").GridItemStyleProps & import("..").LayoutStyleProps & import("..").OtherStyleProps & import("..").PositionStyleProps & import("..").SpaceStyleProps & import("..").TextStyleProps & FlexStyleProps> & {
26
+ export declare const Flex: import("../../common").ElementComponent<"div", FlexProps> & {
27
27
  Item: import("../../common").ElementComponent<"div", import("..").CommonStyleProps>;
28
28
  };
29
29
  //# sourceMappingURL=Flex.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Flex.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;AASlD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,IAAI;;CAYf,CAAC"}
1
+ {"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Flex.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,SAAS,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,cAAc,CAAC;AASnE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,IAAI;;CAYf,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { BoxProps } from './Box';
2
2
  import { GridStyleProps } from './utils/grid';
3
- export declare type GridProps = BoxProps & GridStyleProps;
3
+ export declare type GridProps = Omit<BoxProps, 'display'> & GridStyleProps;
4
4
  export declare type GridItemProps = BoxProps;
5
5
  /**
6
6
  * `Grid` is a two-dimensional layout system for the web. It lets you lay content out in rows and columns.
@@ -24,7 +24,7 @@ export declare type GridItemProps = BoxProps;
24
24
  * );
25
25
  *```
26
26
  */
27
- export declare const Grid: import("../../common").ElementComponent<"div", import("..").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").GridItemStyleProps & import("..").LayoutStyleProps & import("..").OtherStyleProps & import("..").PositionStyleProps & import("..").SpaceStyleProps & import("..").TextStyleProps & GridStyleProps> & {
27
+ export declare const Grid: import("../../common").ElementComponent<"div", GridProps> & {
28
28
  /**
29
29
  * `<Grid.Item />` is the child specific sub-component to `<Grid/>`. `<Grid.Item />` gets child specific props, whereas `<Grid./>` gets parent container props.
30
30
  *
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Grid.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;AAClD,oBAAY,aAAa,GAAG,QAAQ,CAAC;AAoBrC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,IAAI;IAUb;;;;;;;;;;;;;;;;;;;;OAoBG;;CAIL,CAAC"}
1
+ {"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Grid.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,SAAS,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,cAAc,CAAC;AACnE,oBAAY,aAAa,GAAG,QAAQ,CAAC;AAoBrC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,IAAI;IAUb;;;;;;;;;;;;;;;;;;;;OAoBG;;CAIL,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { FlexProps } from './Flex';
2
2
  import { StackStyleProps } from './utils/stack';
3
3
  export declare type StackProps = FlexProps & StackStyleProps;
4
- export declare const Stack: import("../../common").ElementComponent<"div", import("..").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").GridItemStyleProps & import("..").LayoutStyleProps & import("..").OtherStyleProps & import("..").PositionStyleProps & import("..").SpaceStyleProps & import("..").TextStyleProps & import("..").FlexStyleProps & StackStyleProps> & {
4
+ export declare const Stack: import("../../common").ElementComponent<"div", StackProps> & {
5
5
  Item: import("../../common").ElementComponent<"div", import("..").CommonStyleProps>;
6
6
  };
7
7
  export interface HStackProps extends StackProps {
@@ -1,4 +1,4 @@
1
- import { Property } from 'csstype';
1
+ import { Property, Globals } from 'csstype';
2
2
  import { StyleFnConfig } from './buildStyleFns';
3
3
  import { SystemPropValues } from './systemProps';
4
4
  /** style props to for CSS flexbox container properties */
@@ -11,7 +11,7 @@ export declare type FlexStyleProps = {
11
11
  * - sets [CSS display property](https://developer.mozilla.org/en-US/docs/Web/CSS/display)
12
12
  * - @default 'flex'
13
13
  * */
14
- display?: 'flex' | 'inline-flex';
14
+ display?: 'flex' | 'inline-flex' | 'none' | Globals | (string & {});
15
15
  /** sets [CSS justify-items property](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items) */
16
16
  justifyItems?: Property.JustifyItems;
17
17
  /** sets [CSS justify-content property](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) */
@@ -1 +1 @@
1
- {"version":3,"file":"flex.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/flex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAkC,aAAa,EAAC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G;IAC3B,oGAAoG;IACpG,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,wGAAwG;IACxG,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC;;;SAGK;IACL,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACpE,wGAAwG;IACxG,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC,4GAA4G;IAC5G,cAAc,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC;IACzC,gGAAgG;IAChG,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAC7B,0GAA0G;IAC1G,aAAa,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC;IACvC;;;SAGK;IACL,GAAG,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChC;;;SAGK;IACL,SAAS,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACtC;;;SAGK;IACL,MAAM,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,aAAa,EAmD7C,CAAC;AAEF,eAAO,MAAM,YAAY,oCAAoC,CAAC;AAC9D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,IAAI,+BAAiD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Property } from 'csstype';
1
+ import { Property, Globals } from 'csstype';
2
2
  import { StyleFnConfig } from './buildStyleFns';
3
3
  import { SystemPropValues } from './systemProps';
4
4
  /** style props to for CSS grid container properties */
@@ -11,7 +11,7 @@ export declare type GridStyleProps = {
11
11
  * - sets [CSS display property](https://developer.mozilla.org/en-US/docs/Web/CSS/display)
12
12
  * - @default 'grid'
13
13
  * */
14
- display?: 'grid' | 'inline-grid';
14
+ display?: 'grid' | 'inline-grid' | 'none' | Globals | (string & {});
15
15
  /** sets [CSS justify-items property](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items) */
16
16
  justifyItems?: Property.JustifyItems;
17
17
  /** sets [CSS justify-content property](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) */
@@ -1 +1 @@
1
- {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAkC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAE/C,uDAAuD;AACvD,oBAAY,cAAc,GAAG;IAC3B,oGAAoG;IACpG,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,wGAAwG;IACxG,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC;;;SAGK;IACL,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IACjC,wGAAwG;IACxG,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC,4GAA4G;IAC5G,cAAc,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC;IACzC,wGAAwG;IACxG,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC,oHAAoH;IACpH,iBAAiB,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC;IAC/C,wHAAwH;IACxH,mBAAmB,CAAC,EAAE,QAAQ,CAAC,mBAAmB,CAAC;IACnD,kHAAkH;IAClH,gBAAgB,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAC7C;;;SAGK;IACL,aAAa,CAAC,EAAE,QAAQ,CAAC,aAAa,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACnE;;;SAGK;IACL,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC7D;;;SA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'./utils/styleProps';
21
21
  * Box Props
22
22
  * ---
23
23
  * Common style props + children
24
- *
24
+ *
25
25
  * - background
26
26
  * - border
27
27
  * - color
@@ -5,7 +5,7 @@ import {Box, BoxProps} from './Box';
5
5
 
6
6
  import {flex, FlexStyleProps} from './utils/flex';
7
7
 
8
- export type FlexProps = BoxProps & FlexStyleProps;
8
+ export type FlexProps = Omit<BoxProps, 'display'> & FlexStyleProps;
9
9
 
10
10
  const StyledFlex = styled(Box)<StyledType & FlexProps>(
11
11
  {
@@ -5,7 +5,7 @@ import {Box, BoxProps} from './Box';
5
5
 
6
6
  import {grid, GridStyleProps} from './utils/grid';
7
7
 
8
- export type GridProps = BoxProps & GridStyleProps;
8
+ export type GridProps = Omit<BoxProps, 'display'> & GridStyleProps;
9
9
  export type GridItemProps = BoxProps;
10
10
 
11
11
  const StyledGrid = styled(Box)<StyledType & GridProps>(
@@ -1,4 +1,4 @@
1
- import {Property} from 'csstype';
1
+ import {Property, Globals} from 'csstype';
2
2
 
3
3
  import {buildStyleFns, buildStylePropFn, StyleFnConfig} from './buildStyleFns';
4
4
  import {SystemPropValues} from './systemProps';
@@ -13,7 +13,7 @@ export type FlexStyleProps = {
13
13
  * - sets [CSS display property](https://developer.mozilla.org/en-US/docs/Web/CSS/display)
14
14
  * - @default 'flex'
15
15
  * */
16
- display?: 'flex' | 'inline-flex';
16
+ display?: 'flex' | 'inline-flex' | 'none' | Globals | (string & {});
17
17
  /** sets [CSS justify-items property](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items) */
18
18
  justifyItems?: Property.JustifyItems;
19
19
  /** sets [CSS justify-content property](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) */
@@ -1,4 +1,4 @@
1
- import {Property} from 'csstype';
1
+ import {Property, Globals} from 'csstype';
2
2
 
3
3
  import {buildStyleFns, buildStylePropFn, StyleFnConfig} from './buildStyleFns';
4
4
  import {SystemPropValues} from './systemProps';
@@ -13,7 +13,7 @@ export type GridStyleProps = {
13
13
  * - sets [CSS display property](https://developer.mozilla.org/en-US/docs/Web/CSS/display)
14
14
  * - @default 'grid'
15
15
  * */
16
- display?: 'grid' | 'inline-grid';
16
+ display?: 'grid' | 'inline-grid' | 'none' | Globals | (string & {});
17
17
  /** sets [CSS justify-items property](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items) */
18
18
  justifyItems?: Property.JustifyItems;
19
19
  /** sets [CSS justify-content property](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-react",
3
- "version": "8.0.0-alpha.246-next.16+61d2c997",
3
+ "version": "8.0.0-alpha.250-next.19+c91bf36c",
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",
@@ -49,7 +49,7 @@
49
49
  "@emotion/styled": "^11.6.0",
50
50
  "@popperjs/core": "^2.5.4",
51
51
  "@workday/canvas-colors-web": "^2.0.0",
52
- "@workday/canvas-kit-popup-stack": "^8.0.0-alpha.246-next.16+61d2c997",
52
+ "@workday/canvas-kit-popup-stack": "^8.0.0-alpha.250-next.19+c91bf36c",
53
53
  "@workday/canvas-system-icons-web": "^3.0.0",
54
54
  "@workday/design-assets-types": "^0.2.8",
55
55
  "chroma-js": "^2.1.0",
@@ -67,5 +67,5 @@
67
67
  "@workday/canvas-accent-icons-web": "^3.0.0",
68
68
  "@workday/canvas-applet-icons-web": "^2.0.0"
69
69
  },
70
- "gitHead": "61d2c997ac9ac0eb4d0c96a9a10b949ead61ab08"
70
+ "gitHead": "c91bf36c41b82f12b0d8323da5fb1fc290e2d5b9"
71
71
  }