@workday/canvas-kit-react 6.0.0-alpha.0-next.26 → 6.0.0-alpha.0-next.27
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/action-bar/lib/ActionBar.tsx +43 -30
- package/common/lib/theming/README.md +189 -25
- package/common/lib/theming/breakpoints.ts +296 -16
- package/common/lib/theming/types.ts +191 -1
- package/dist/commonjs/action-bar/lib/ActionBar.d.ts.map +1 -1
- package/dist/commonjs/action-bar/lib/ActionBar.js +35 -27
- package/dist/commonjs/button/lib/parts/ButtonLabel.d.ts +1 -1
- package/dist/commonjs/common/lib/theming/breakpoints.d.ts +287 -6
- package/dist/commonjs/common/lib/theming/breakpoints.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/breakpoints.js +192 -10
- package/dist/commonjs/common/lib/theming/types.d.ts +191 -1
- package/dist/commonjs/common/lib/theming/types.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/components.d.ts +1 -1
- package/dist/commonjs/pagination/lib/Pagination/PageList.d.ts +1 -1
- package/dist/commonjs/pagination/lib/Pagination/Pagination.d.ts +5 -5
- package/dist/commonjs/pagination/lib/Pagination/common/List.d.ts +1 -1
- package/dist/commonjs/pagination/lib/Pagination/common/utils/space.d.ts +28 -28
- package/dist/es6/action-bar/lib/ActionBar.d.ts.map +1 -1
- package/dist/es6/action-bar/lib/ActionBar.js +33 -22
- package/dist/es6/button/lib/parts/ButtonLabel.d.ts +1 -1
- package/dist/es6/common/lib/theming/breakpoints.d.ts +287 -6
- package/dist/es6/common/lib/theming/breakpoints.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/breakpoints.js +192 -10
- package/dist/es6/common/lib/theming/types.d.ts +191 -1
- package/dist/es6/common/lib/theming/types.d.ts.map +1 -1
- package/dist/es6/pagination/lib/Pagination/PageList.d.ts +1 -1
- package/dist/es6/pagination/lib/Pagination/Pagination.d.ts +5 -5
- package/dist/es6/pagination/lib/Pagination/common/List.d.ts +1 -1
- package/dist/es6/pagination/lib/Pagination/common/utils/space.d.ts +28 -28
- package/package.json +5 -5
- package/ts3.5/dist/commonjs/button/lib/parts/ButtonLabel.d.ts +1 -1
- package/ts3.5/dist/commonjs/common/lib/theming/breakpoints.d.ts +287 -6
- package/ts3.5/dist/commonjs/common/lib/theming/types.d.ts +191 -1
- package/ts3.5/dist/commonjs/common/lib/utils/components.d.ts +1 -1
- package/ts3.5/dist/commonjs/pagination/lib/Pagination/PageList.d.ts +1 -1
- package/ts3.5/dist/commonjs/pagination/lib/Pagination/Pagination.d.ts +5 -5
- package/ts3.5/dist/commonjs/pagination/lib/Pagination/common/List.d.ts +1 -1
- package/ts3.5/dist/commonjs/pagination/lib/Pagination/common/utils/space.d.ts +28 -28
- package/ts3.5/dist/es6/button/lib/parts/ButtonLabel.d.ts +1 -1
- package/ts3.5/dist/es6/common/lib/theming/breakpoints.d.ts +287 -6
- package/ts3.5/dist/es6/common/lib/theming/types.d.ts +191 -1
- package/ts3.5/dist/es6/pagination/lib/Pagination/PageList.d.ts +1 -1
- package/ts3.5/dist/es6/pagination/lib/Pagination/Pagination.d.ts +5 -5
- package/ts3.5/dist/es6/pagination/lib/Pagination/common/List.d.ts +1 -1
- package/ts3.5/dist/es6/pagination/lib/Pagination/common/utils/space.d.ts +28 -28
|
@@ -9,39 +9,221 @@ var BreakpointKey;
|
|
|
9
9
|
BreakpointKey["xl"] = "xl";
|
|
10
10
|
})(BreakpointKey = exports.BreakpointKey || (exports.BreakpointKey = {}));
|
|
11
11
|
exports.breakpointKeys = ['zero', 's', 'm', 'l', 'xl'];
|
|
12
|
+
/**
|
|
13
|
+
* ### Theme Breakpoint Values
|
|
14
|
+
*
|
|
15
|
+
* Breakpoints are used by media queries to conditionally apply or modify styles based on the viewport width.
|
|
16
|
+
* This allows the UI to be responsive to various screen sizes. This object provides five breakpoint values
|
|
17
|
+
* that correspond to the min-widths of our standard screen sizes.
|
|
18
|
+
*
|
|
19
|
+
* - `zero`: 0
|
|
20
|
+
* - `s`: 320
|
|
21
|
+
* - `m`: 768
|
|
22
|
+
* - `l`: 1024
|
|
23
|
+
* - `xl`: 1440
|
|
24
|
+
*
|
|
25
|
+
* And these are our standard screen size ranges:
|
|
26
|
+
*
|
|
27
|
+
* - `small` (320px - 767px) Used for mobile-sized screens
|
|
28
|
+
* - `medium` (768px - 1023px) Used for tablet-sized screens
|
|
29
|
+
* - `large` - (1024px - 1439px) Used for laptop and small desktop screens
|
|
30
|
+
* - `extra-large` (≥1440px) Used for very large screens
|
|
31
|
+
*
|
|
32
|
+
* Note: Some applications may only require a subset of screen sizes and not use all breakpoints.
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
12
35
|
exports.breakpoints = {
|
|
13
36
|
zero: 0,
|
|
14
|
-
s:
|
|
15
|
-
m:
|
|
16
|
-
l:
|
|
17
|
-
xl:
|
|
37
|
+
s: 320,
|
|
38
|
+
m: 768,
|
|
39
|
+
l: 1024,
|
|
40
|
+
xl: 1440,
|
|
18
41
|
};
|
|
19
42
|
var step = 0.5;
|
|
43
|
+
/**
|
|
44
|
+
* ### Up
|
|
45
|
+
*
|
|
46
|
+
* _Returns a media query above the `min-width` for the range of a given breakpoint_
|
|
47
|
+
*
|
|
48
|
+
* Given a `start` breakpoint key ("zero", "s", "m", "l", "xl"),
|
|
49
|
+
* this function returns a media query (string) using a `min-width`.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* import { useTheme } from '@workday/canvas-kit-react/common';
|
|
54
|
+
* import { space } from '@workday/canvas-kit-react/tokens';
|
|
55
|
+
*
|
|
56
|
+
* const theme = useTheme();
|
|
57
|
+
* const { up } = theme.canvas.breakpoints;
|
|
58
|
+
* const mediaQuery = up('l'); // Returns '@media (min-width: 1024px)'
|
|
59
|
+
* const styles = {
|
|
60
|
+
* [mediaQuery]: {
|
|
61
|
+
* padding: space.m,
|
|
62
|
+
* }
|
|
63
|
+
* };
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
20
66
|
function up(key) {
|
|
21
67
|
var value = typeof exports.breakpoints[key] === 'number' ? exports.breakpoints[key] : key;
|
|
22
|
-
return "@media (min-width:" + value + "px)";
|
|
68
|
+
return "@media (min-width: " + value + "px)";
|
|
23
69
|
}
|
|
24
70
|
exports.up = up;
|
|
25
|
-
|
|
26
|
-
|
|
71
|
+
/**
|
|
72
|
+
* ### Down
|
|
73
|
+
*
|
|
74
|
+
* _Returns a media query below the `max-width` for the range of a given breakpoint_
|
|
75
|
+
*
|
|
76
|
+
* Given an `end` breakpoint key ("zero", "s", "m", "l", "xl"),
|
|
77
|
+
* this function returns a media query (string) using a `max-width`.
|
|
78
|
+
*
|
|
79
|
+
* Note: This function subtracts `0.5px` from the next breakpoint value to prevent collisions.
|
|
80
|
+
* For example, `breakpoints.values.s`, has a `min-width` of `320px`, and the `max-width` is `767.5px`).
|
|
81
|
+
*
|
|
82
|
+
* If the `xl` breakpoint is provided, this function returns a media query with only a `min-width` of `0`,
|
|
83
|
+
* as seen in the second example below.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* import { useTheme } from '@workday/canvas-kit-react/common';
|
|
88
|
+
* import { space } from '@workday/canvas-kit-react/tokens';
|
|
89
|
+
*
|
|
90
|
+
* const theme = useTheme();
|
|
91
|
+
* const { down } = theme.canvas.breakpoints;
|
|
92
|
+
* const mediaQuery = down('m'); // Returns '@media (max-width: 1023.5px)'
|
|
93
|
+
* const styles = {
|
|
94
|
+
* [mediaQuery]: {
|
|
95
|
+
* padding: space.m,
|
|
96
|
+
* }
|
|
97
|
+
* };
|
|
98
|
+
* ```
|
|
99
|
+
*
|
|
100
|
+
* This example uses the `xl` breakpoint and only adds a `min-width` of `0` to the media query.
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* import { useTheme } from '@workday/canvas-kit-react/common';
|
|
104
|
+
* import { space } from '@workday/canvas-kit-react/tokens';
|
|
105
|
+
*
|
|
106
|
+
* const theme = useTheme();
|
|
107
|
+
* const { down } = theme.canvas.breakpoints;
|
|
108
|
+
* const mediaQuery = down('xl'); // Returns '@media (min-width: 0)'
|
|
109
|
+
* const styles = {
|
|
110
|
+
* [mediaQuery]: {
|
|
111
|
+
* padding: space.m,
|
|
112
|
+
* }
|
|
113
|
+
* };
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
function down(endKey) {
|
|
117
|
+
var endIndex = exports.breakpointKeys.indexOf(endKey) + 1;
|
|
27
118
|
var upperbound = exports.breakpoints[exports.breakpointKeys[endIndex]];
|
|
28
119
|
if (endIndex === exports.breakpointKeys.length) {
|
|
29
120
|
// xl down applies to all sizes
|
|
30
121
|
return up(BreakpointKey.zero);
|
|
31
122
|
}
|
|
32
123
|
var value = typeof upperbound === 'number' && endIndex > 0 ? upperbound : 0;
|
|
33
|
-
return "@media (max-width:" + (value - step) + "px)";
|
|
124
|
+
return "@media (max-width: " + (value - step) + "px)";
|
|
34
125
|
}
|
|
35
126
|
exports.down = down;
|
|
127
|
+
/**
|
|
128
|
+
* ### Between
|
|
129
|
+
*
|
|
130
|
+
* _Returns a media query between two given breakpoints_
|
|
131
|
+
*
|
|
132
|
+
* Given `start` and `end` breakpoint keys ("zero", "s", "m", "l", "xl"),
|
|
133
|
+
* this function returns a media query (string) using a min-width and max-width.
|
|
134
|
+
*
|
|
135
|
+
* Note: This function subtracts `0.5px` from the next breakpoint value to prevent collisions.
|
|
136
|
+
* For example, `breakpoints.values.s`, has a `min-width` of `320px`, and the `max-width` is `767.5px`).
|
|
137
|
+
*
|
|
138
|
+
* If the `xl` breakpoint is provided, this function returns a media query with only a `min-width`,
|
|
139
|
+
* as seen in the second example below.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```ts
|
|
143
|
+
* import { useTheme } from '@workday/canvas-kit-react/common';
|
|
144
|
+
* import { space } from '@workday/canvas-kit-react/tokens';
|
|
145
|
+
*
|
|
146
|
+
* const theme = useTheme();
|
|
147
|
+
* const { between } = theme.canvas.breakpoints;
|
|
148
|
+
* // Returns '@media (min-width: 320px) and (max-width: 1023.5px)'
|
|
149
|
+
* const mediaQuery = between('s', 'm');
|
|
150
|
+
* const styles = {
|
|
151
|
+
* [mediaQuery]: {
|
|
152
|
+
* padding: space.s,
|
|
153
|
+
* }
|
|
154
|
+
* };
|
|
155
|
+
* ```
|
|
156
|
+
*
|
|
157
|
+
* This example uses `xl` as the `end` breakpoint and only adds a min-width to the media query.
|
|
158
|
+
* @example
|
|
159
|
+
* ```ts
|
|
160
|
+
* import { useTheme } from '@workday/canvas-kit-react/common';
|
|
161
|
+
* import { space } from '@workday/canvas-kit-react/tokens';
|
|
162
|
+
*
|
|
163
|
+
* const theme = useTheme();
|
|
164
|
+
* const { between } = theme.canvas.breakpoints;
|
|
165
|
+
* const mediaQuery = between('m', 'xl'); // Returns '@media (min-width: 768px)'
|
|
166
|
+
* const styles = {
|
|
167
|
+
* [mediaQuery]: {
|
|
168
|
+
* padding: space.s,
|
|
169
|
+
* }
|
|
170
|
+
* };
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
36
173
|
function between(start, end) {
|
|
37
174
|
var endIndex = exports.breakpointKeys.indexOf(end) + 1;
|
|
38
175
|
if (endIndex === exports.breakpointKeys.length) {
|
|
39
176
|
return up(start);
|
|
40
177
|
}
|
|
41
|
-
return ("@media (min-width:" + exports.breakpoints[start] + "px) and " +
|
|
42
|
-
("(max-width:" + (exports.breakpoints[exports.breakpointKeys[endIndex]] - step) + "px)"));
|
|
178
|
+
return ("@media (min-width: " + exports.breakpoints[start] + "px) and " +
|
|
179
|
+
("(max-width: " + (exports.breakpoints[exports.breakpointKeys[endIndex]] - step) + "px)"));
|
|
43
180
|
}
|
|
44
181
|
exports.between = between;
|
|
182
|
+
/**
|
|
183
|
+
* ### Only
|
|
184
|
+
*
|
|
185
|
+
* _Returns a media query with a `min-width` and `max-width` for a given breakpoint_
|
|
186
|
+
*
|
|
187
|
+
* Given a breakpoint key ("zero", "s", "m", "l", "xl"),
|
|
188
|
+
* this function returns a media query (string) using a `min-width` and `max-width`.
|
|
189
|
+
*
|
|
190
|
+
* Note: This function subtracts `0.5px` from the next breakpoint value to prevent collisions.
|
|
191
|
+
* For example, `breakpoints.values.s`, has a `min-width` of `320px`, and the `max-width` is `767.5px`).
|
|
192
|
+
*
|
|
193
|
+
* If the `xl` breakpoint is provided, this function returns a media query with only a `min-width` of `1440px`,
|
|
194
|
+
* as seen in the second example below.
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* ```ts
|
|
198
|
+
* import { useTheme } from '@workday/canvas-kit-react/common';
|
|
199
|
+
* import { space } from '@workday/canvas-kit-react/tokens';
|
|
200
|
+
*
|
|
201
|
+
* const theme = useTheme();
|
|
202
|
+
* const { only } = theme.canvas.breakpoints;
|
|
203
|
+
* const mediaQuery = only('s'); // Returns '@media (min-width: 320px) and (max-width: 767.5px)'
|
|
204
|
+
* const styles = {
|
|
205
|
+
* [mediaQuery]: {
|
|
206
|
+
* padding: space.s,
|
|
207
|
+
* }
|
|
208
|
+
* };
|
|
209
|
+
* ```
|
|
210
|
+
*
|
|
211
|
+
* This example uses the `xl` breakpoint and only adds a `min-width` of `1440px` to the media query.
|
|
212
|
+
* @example
|
|
213
|
+
* ```ts
|
|
214
|
+
* import { useTheme } from '@workday/canvas-kit-react/common';
|
|
215
|
+
* import { space } from '@workday/canvas-kit-react/tokens';
|
|
216
|
+
*
|
|
217
|
+
* const theme = useTheme();
|
|
218
|
+
* const { only } = theme.canvas.breakpoints;
|
|
219
|
+
* const mediaQuery = only('xl'); // Returns '@media (min-width: 1440px)'
|
|
220
|
+
* const styles = {
|
|
221
|
+
* [mediaQuery]: {
|
|
222
|
+
* padding: space.s,
|
|
223
|
+
* }
|
|
224
|
+
* };
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
45
227
|
function only(key) {
|
|
46
228
|
return between(key, key);
|
|
47
229
|
}
|
|
@@ -32,12 +32,202 @@ export interface CanvasTheme {
|
|
|
32
32
|
success: CanvasThemePalette;
|
|
33
33
|
neutral: CanvasThemePalette;
|
|
34
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* ### Theme Breakpoints
|
|
37
|
+
*
|
|
38
|
+
* Breakpoints are used by media queries to conditionally apply or modify styles based on the viewport width.
|
|
39
|
+
* This allows the UI to be responsive to various screen sizes.
|
|
40
|
+
*
|
|
41
|
+
* This breakpoints object contains `values` and several helper functions: `up`, `down`, `between`, and `only`.
|
|
42
|
+
* You can find more detailed information by inspecting individual values and functions.
|
|
43
|
+
*/
|
|
35
44
|
breakpoints: {
|
|
45
|
+
/**
|
|
46
|
+
* ### Breakpoint Values
|
|
47
|
+
*
|
|
48
|
+
* This object provides five breakpoint values
|
|
49
|
+
* that correspond to the min-widths of our standard screen sizes.
|
|
50
|
+
*
|
|
51
|
+
* - `zero`: 0
|
|
52
|
+
* - `s`: 320
|
|
53
|
+
* - `m`: 768
|
|
54
|
+
* - `l`: 1024
|
|
55
|
+
* - `xl`: 1440
|
|
56
|
+
*
|
|
57
|
+
* And these are our standard screen size ranges:
|
|
58
|
+
*
|
|
59
|
+
* - `small` (320px - 767px) Used for mobile-sized screens
|
|
60
|
+
* - `medium` (768px - 1023px) Used for tablet-sized screens
|
|
61
|
+
* - `large` - (1024px - 1439px) Used for laptop and small desktop screens
|
|
62
|
+
* - `extra-large` (≥1440px) Used for very large screens
|
|
63
|
+
*
|
|
64
|
+
* Note: Some applications may only require a subset of screen sizes and not use all breakpoints.
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
36
67
|
values: CanvasBreakpoints;
|
|
68
|
+
/**
|
|
69
|
+
* ### Up
|
|
70
|
+
*
|
|
71
|
+
* _Returns a media query above the `min-width` for the range of a given breakpoint_
|
|
72
|
+
*
|
|
73
|
+
* Given a `start` breakpoint key ("zero", "s", "m", "l", "xl"),
|
|
74
|
+
* this function returns a media query (string) using a `min-width`.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* import { useTheme } from '@workday/canvas-kit-react/common';
|
|
79
|
+
* import { space } from '@workday/canvas-kit-react/tokens';
|
|
80
|
+
*
|
|
81
|
+
* const theme = useTheme();
|
|
82
|
+
* const { up } = theme.canvas.breakpoints;
|
|
83
|
+
* const mediaQuery = up('l'); // Returns '@media (min-width: 1024px)'
|
|
84
|
+
* const styles = {
|
|
85
|
+
* [mediaQuery]: {
|
|
86
|
+
* padding: space.m,
|
|
87
|
+
* }
|
|
88
|
+
* };
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
37
91
|
up: (key: BreakpointFnParam) => string;
|
|
92
|
+
/**
|
|
93
|
+
* ### Down
|
|
94
|
+
*
|
|
95
|
+
* _Returns a media query below the `max-width` for the range of a given breakpoint_
|
|
96
|
+
*
|
|
97
|
+
* Given an `end` breakpoint key ("zero", "s", "m", "l", "xl"),
|
|
98
|
+
* this function returns a media query (string) using a `max-width`.
|
|
99
|
+
*
|
|
100
|
+
* Note: This function subtracts `0.5px` from the next breakpoint value to prevent collisions.
|
|
101
|
+
* For example, `breakpoints.values.s`, has a `min-width` of `320px`, and the `max-width` is `767.5px`).
|
|
102
|
+
*
|
|
103
|
+
* If the `xl` breakpoint is provided, this function returns a media query with only a `min-width` of `0`,
|
|
104
|
+
* as seen in the second example below.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* import { useTheme } from '@workday/canvas-kit-react/common';
|
|
109
|
+
* import { space } from '@workday/canvas-kit-react/tokens';
|
|
110
|
+
*
|
|
111
|
+
* const theme = useTheme();
|
|
112
|
+
* const { down } = theme.canvas.breakpoints;
|
|
113
|
+
* const mediaQuery = down('m'); // Returns '@media (max-width: 1023.5px)'
|
|
114
|
+
* const styles = {
|
|
115
|
+
* [mediaQuery]: {
|
|
116
|
+
* padding: space.m,
|
|
117
|
+
* }
|
|
118
|
+
* };
|
|
119
|
+
* ```
|
|
120
|
+
*
|
|
121
|
+
* This example uses the `xl` breakpoint and only adds a `min-width` of `0` to the media query.
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* import { useTheme } from '@workday/canvas-kit-react/common';
|
|
125
|
+
* import { space } from '@workday/canvas-kit-react/tokens';
|
|
126
|
+
*
|
|
127
|
+
* const theme = useTheme();
|
|
128
|
+
* const { down } = theme.canvas.breakpoints;
|
|
129
|
+
* const mediaQuery = down('xl'); // Returns '@media (min-width: 0)'
|
|
130
|
+
* const styles = {
|
|
131
|
+
* [mediaQuery]: {
|
|
132
|
+
* padding: space.m,
|
|
133
|
+
* }
|
|
134
|
+
* };
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
38
137
|
down: (key: BreakpointFnParam) => string;
|
|
39
|
-
|
|
138
|
+
/**
|
|
139
|
+
* ### Between
|
|
140
|
+
*
|
|
141
|
+
* _Returns a media query between two given breakpoints_
|
|
142
|
+
*
|
|
143
|
+
* Given `start` and `end` breakpoint keys ("zero", "s", "m", "l", "xl"),
|
|
144
|
+
* this function returns a media query (string) using a min-width and max-width.
|
|
145
|
+
*
|
|
146
|
+
* Note: This function subtracts `0.5px` from the next breakpoint value to prevent collisions.
|
|
147
|
+
* For example, `breakpoints.values.s`, has a `min-width` of `320px`, and the `max-width` is `767.5px`).
|
|
148
|
+
*
|
|
149
|
+
* If the `xl` breakpoint is provided, this function returns a media query with only a `min-width`,
|
|
150
|
+
* as seen in the second example below.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```ts
|
|
154
|
+
* import { useTheme } from '@workday/canvas-kit-react/common';
|
|
155
|
+
* import { space } from '@workday/canvas-kit-react/tokens';
|
|
156
|
+
*
|
|
157
|
+
* const theme = useTheme();
|
|
158
|
+
* const { between } = theme.canvas.breakpoints;
|
|
159
|
+
* // Returns '@media (min-width: 320px) and (max-width: 1023.5px)'
|
|
160
|
+
* const mediaQuery = between('s', 'm');
|
|
161
|
+
* const styles = {
|
|
162
|
+
* [mediaQuery]: {
|
|
163
|
+
* padding: space.s,
|
|
164
|
+
* }
|
|
165
|
+
* };
|
|
166
|
+
* ```
|
|
167
|
+
*
|
|
168
|
+
* This example uses `xl` as the `end` breakpoint and only adds a min-width to the media query.
|
|
169
|
+
* @example
|
|
170
|
+
* ```ts
|
|
171
|
+
* import { useTheme } from '@workday/canvas-kit-react/common';
|
|
172
|
+
* import { space } from '@workday/canvas-kit-react/tokens';
|
|
173
|
+
*
|
|
174
|
+
* const theme = useTheme();
|
|
175
|
+
* const { between } = theme.canvas.breakpoints;
|
|
176
|
+
* const mediaQuery = between('m', 'xl'); // Returns '@media (min-width: 768px)'
|
|
177
|
+
* const styles = {
|
|
178
|
+
* [mediaQuery]: {
|
|
179
|
+
* padding: space.s,
|
|
180
|
+
* }
|
|
181
|
+
* };
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
40
184
|
between: (start: BreakpointFnParam, end: BreakpointFnParam) => string;
|
|
185
|
+
/**
|
|
186
|
+
* ### Only
|
|
187
|
+
*
|
|
188
|
+
* _Returns a media query with a `min-width` and `max-width` for a given breakpoint_
|
|
189
|
+
*
|
|
190
|
+
* Given a breakpoint key ("zero", "s", "m", "l", "xl"),
|
|
191
|
+
* this function returns a media query (string) using a `min-width` and `max-width`.
|
|
192
|
+
*
|
|
193
|
+
* Note: This function subtracts `0.5px` from the next breakpoint value to prevent collisions.
|
|
194
|
+
* For example, `breakpoints.values.s`, has a `min-width` of `320px`, and the `max-width` is `767.5px`).
|
|
195
|
+
*
|
|
196
|
+
* If the `xl` breakpoint is provided, this function returns a media query with only a `min-width` of `1440px`,
|
|
197
|
+
* as seen in the second example below.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```ts
|
|
201
|
+
* import { useTheme } from '@workday/canvas-kit-react/common';
|
|
202
|
+
* import { space } from '@workday/canvas-kit-react/tokens';
|
|
203
|
+
*
|
|
204
|
+
* const theme = useTheme();
|
|
205
|
+
* const { only } = theme.canvas.breakpoints;
|
|
206
|
+
* const mediaQuery = only('s'); // Returns '@media (min-width: 320px) and (max-width: 767.5px)'
|
|
207
|
+
* const styles = {
|
|
208
|
+
* [mediaQuery]: {
|
|
209
|
+
* padding: space.s,
|
|
210
|
+
* }
|
|
211
|
+
* };
|
|
212
|
+
* ```
|
|
213
|
+
*
|
|
214
|
+
* This example uses the `xl` breakpoint and only adds a `min-width` of `1440px` to the media query.
|
|
215
|
+
* @example
|
|
216
|
+
* ```ts
|
|
217
|
+
* import { useTheme } from '@workday/canvas-kit-react/common';
|
|
218
|
+
* import { space } from '@workday/canvas-kit-react/tokens';
|
|
219
|
+
*
|
|
220
|
+
* const theme = useTheme();
|
|
221
|
+
* const { only } = theme.canvas.breakpoints;
|
|
222
|
+
* const mediaQuery = only('xl'); // Returns '@media (min-width: 1440px)'
|
|
223
|
+
* const styles = {
|
|
224
|
+
* [mediaQuery]: {
|
|
225
|
+
* padding: space.s,
|
|
226
|
+
* }
|
|
227
|
+
* };
|
|
228
|
+
* ```
|
|
229
|
+
*/
|
|
230
|
+
only: (key: BreakpointFnParam) => string;
|
|
41
231
|
};
|
|
42
232
|
direction: ContentDirection;
|
|
43
233
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAEnE;;GAEG;AACH,oBAAY,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,aAAK,wBAAwB,GAAG;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,oBAAY,gBAAgB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
|
@@ -107,7 +107,7 @@ interface RefForwardingComponent<T, P = {}> {
|
|
|
107
107
|
* return type is `Component<element, Props>` which looks like `Component<'div', Props>` which is a
|
|
108
108
|
* clean interface that tells you the default element that is used.
|
|
109
109
|
*/
|
|
110
|
-
export declare const createComponent: <E extends "symbol" | "object" | "s" | "
|
|
110
|
+
export declare const createComponent: <E extends "symbol" | "object" | "s" | "big" | "link" | "small" | "sub" | "sup" | "circle" | "stop" | "path" | "style" | "map" | "filter" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "samp" | "script" | "section" | "select" | "source" | "span" | "strong" | "summary" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | ElementComponent<any, any> | React.ComponentClass<{}, any> | React.FunctionComponent<{}> | undefined = undefined>(as?: E | undefined) => <P, SubComponents = {}>({ displayName, Component, subComponents, }: {
|
|
111
111
|
/** This is what the component will look like in the React dev tools. Encouraged to more easily
|
|
112
112
|
* understand the component tree */
|
|
113
113
|
displayName?: string | undefined;
|
|
@@ -8,5 +8,5 @@ export interface PageListProps extends Omit<ListProps, 'as'> {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const PageList: ({ model, children, ...elemProps }: PageListProps) => JSX.Element;
|
|
10
10
|
export declare type PageListItemProps = ListItemProps;
|
|
11
|
-
export declare const PageListItem: ({ children, ...elemProps }: Pick<import("./common/Flex").FlexProps, "m" | "
|
|
11
|
+
export declare const PageListItem: ({ children, ...elemProps }: Pick<import("./common/Flex").FlexProps, "m" | "css" | "style" | "p" | "title" | "dir" | "slot" | "children" | "hidden" | "width" | "height" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "alignContent" | "alignItems" | "alignSelf" | "direction" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "justifyContent" | "justifyItems" | "justifySelf" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "overflowX" | "overflowY" | "verticalAlign" | "flex" | "margin" | "overflow" | "padding" | "wrap" | "grow" | "marginX" | "marginY" | "paddingX" | "paddingY" | "basis" | "mx" | "my" | "marginT" | "mt" | "marginR" | "mr" | "marginB" | "mb" | "marginL" | "ml" | "px" | "py" | "paddingT" | "pt" | "paddingR" | "pr" | "paddingB" | "pb" | "paddingL" | "pl" | "shrink">) => JSX.Element;
|
|
12
12
|
//# sourceMappingURL=PageList.d.ts.map
|