@workday/canvas-kit-react 8.0.0-alpha.204-next.4 → 8.0.0-alpha.216-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/lib/utils/elements.ts +4 -4
- package/dist/commonjs/card/lib/Card.d.ts +1 -1
- package/dist/commonjs/card/lib/CardBody.d.ts +1 -1
- package/dist/commonjs/card/lib/CardBody.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/elements.d.ts +1 -1
- package/dist/commonjs/common/lib/utils/elements.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/elements.js +3 -3
- package/dist/commonjs/dialog/lib/Dialog.d.ts +1 -1
- package/dist/commonjs/icon/lib/SystemIcon.d.ts +1 -1
- package/dist/commonjs/icon/lib/SystemIcon.d.ts.map +1 -1
- package/dist/commonjs/layout/index.d.ts +8 -4
- package/dist/commonjs/layout/index.d.ts.map +1 -1
- package/dist/commonjs/layout/index.js +10 -2
- package/dist/commonjs/layout/lib/Box.d.ts +6 -4
- package/dist/commonjs/layout/lib/Box.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Box.js +8 -9
- package/dist/commonjs/layout/lib/Flex.d.ts +5 -2
- package/dist/commonjs/layout/lib/Flex.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Flex.js +5 -1
- package/dist/commonjs/layout/lib/Grid.d.ts +5 -6
- package/dist/commonjs/layout/lib/Grid.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Grid.js +2 -2
- package/dist/commonjs/layout/lib/Stack.d.ts +4 -4
- package/dist/commonjs/layout/lib/utils/background.d.ts +44 -0
- package/dist/commonjs/layout/lib/utils/background.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/background.js +57 -0
- package/dist/commonjs/layout/lib/utils/border/color.d.ts +47 -0
- package/dist/commonjs/layout/lib/utils/border/color.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/color.js +42 -0
- package/dist/commonjs/layout/lib/utils/border/index.d.ts +26 -0
- package/dist/commonjs/layout/lib/utils/border/index.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/index.js +46 -0
- package/dist/commonjs/layout/lib/utils/border/lineStyle.d.ts +38 -0
- package/dist/commonjs/layout/lib/utils/border/lineStyle.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/lineStyle.js +52 -0
- package/dist/commonjs/layout/lib/utils/border/radius.d.ts +33 -0
- package/dist/commonjs/layout/lib/utils/border/radius.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/radius.js +32 -0
- package/dist/commonjs/layout/lib/utils/border/shorthand.d.ts +34 -0
- package/dist/commonjs/layout/lib/utils/border/shorthand.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/shorthand.js +42 -0
- package/dist/commonjs/layout/lib/utils/border/width.d.ts +34 -0
- package/dist/commonjs/layout/lib/utils/border/width.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/width.js +42 -0
- package/dist/commonjs/layout/lib/utils/buildStyleFns.d.ts +12 -0
- package/dist/commonjs/layout/lib/utils/buildStyleFns.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/buildStyleFns.js +90 -0
- package/dist/commonjs/layout/lib/utils/color.d.ts +23 -16
- package/dist/commonjs/layout/lib/utils/color.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/color.js +25 -49
- package/dist/commonjs/layout/lib/utils/depth.d.ts +17 -11
- package/dist/commonjs/layout/lib/utils/depth.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/depth.js +20 -20
- package/dist/commonjs/layout/lib/utils/flex.d.ts +31 -12
- package/dist/commonjs/layout/lib/utils/flex.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/flex.js +58 -25
- package/dist/commonjs/layout/lib/utils/flexItem.d.ts +18 -15
- package/dist/commonjs/layout/lib/utils/flexItem.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/flexItem.js +43 -26
- package/dist/commonjs/layout/lib/utils/grid.d.ts +40 -35
- package/dist/commonjs/layout/lib/utils/grid.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/grid.js +99 -72
- package/dist/commonjs/layout/lib/utils/gridItem.d.ts +17 -14
- package/dist/commonjs/layout/lib/utils/gridItem.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/gridItem.js +58 -30
- package/dist/commonjs/layout/lib/utils/layout.d.ts +47 -25
- package/dist/commonjs/layout/lib/utils/layout.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/layout.js +71 -33
- package/dist/commonjs/layout/lib/utils/other.d.ts +44 -2
- package/dist/commonjs/layout/lib/utils/other.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/other.js +101 -17
- package/dist/commonjs/layout/lib/utils/position.d.ts +37 -20
- package/dist/commonjs/layout/lib/utils/position.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/position.js +49 -66
- package/dist/commonjs/layout/lib/utils/space.d.ts +107 -51
- package/dist/commonjs/layout/lib/utils/space.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/space.js +98 -148
- package/dist/commonjs/layout/lib/utils/stack.d.ts +3 -6
- package/dist/commonjs/layout/lib/utils/stack.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/stack.js +13 -39
- package/dist/commonjs/layout/lib/utils/systemProps.d.ts +31 -0
- package/dist/commonjs/layout/lib/utils/systemProps.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/systemProps.js +2 -0
- package/dist/commonjs/layout/lib/utils/text.d.ts +33 -15
- package/dist/commonjs/layout/lib/utils/text.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/text.js +74 -38
- package/dist/commonjs/modal/lib/Modal.d.ts +1 -1
- package/dist/commonjs/popup/lib/Popup.d.ts +1 -1
- package/dist/commonjs/popup/lib/PopupBody.d.ts +1 -1
- package/dist/commonjs/popup/lib/hooks/useReturnFocus.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/hooks/useReturnFocus.js +102 -2
- package/dist/commonjs/tabs/lib/TabsItem.d.ts +1 -1
- package/dist/commonjs/tokens/lib/colors.types.d.ts +4 -6
- package/dist/commonjs/tokens/lib/colors.types.d.ts.map +1 -1
- package/dist/es6/card/lib/Card.d.ts +1 -1
- package/dist/es6/card/lib/CardBody.d.ts +1 -1
- package/dist/es6/card/lib/CardBody.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/elements.d.ts +1 -1
- package/dist/es6/common/lib/utils/elements.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/elements.js +3 -3
- package/dist/es6/dialog/lib/Dialog.d.ts +1 -1
- package/dist/es6/icon/lib/SystemIcon.d.ts +1 -1
- package/dist/es6/icon/lib/SystemIcon.d.ts.map +1 -1
- package/dist/es6/layout/index.d.ts +8 -4
- package/dist/es6/layout/index.d.ts.map +1 -1
- package/dist/es6/layout/index.js +7 -1
- package/dist/es6/layout/lib/Box.d.ts +6 -4
- package/dist/es6/layout/lib/Box.d.ts.map +1 -1
- package/dist/es6/layout/lib/Box.js +8 -9
- package/dist/es6/layout/lib/Flex.d.ts +5 -2
- package/dist/es6/layout/lib/Flex.d.ts.map +1 -1
- package/dist/es6/layout/lib/Flex.js +5 -1
- package/dist/es6/layout/lib/Grid.d.ts +5 -6
- package/dist/es6/layout/lib/Grid.d.ts.map +1 -1
- package/dist/es6/layout/lib/Grid.js +2 -2
- package/dist/es6/layout/lib/Stack.d.ts +4 -4
- package/dist/es6/layout/lib/utils/background.d.ts +44 -0
- package/dist/es6/layout/lib/utils/background.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/background.js +54 -0
- package/dist/es6/layout/lib/utils/border/color.d.ts +47 -0
- package/dist/es6/layout/lib/utils/border/color.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/color.js +39 -0
- package/dist/es6/layout/lib/utils/border/index.d.ts +26 -0
- package/dist/es6/layout/lib/utils/border/index.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/index.js +43 -0
- package/dist/es6/layout/lib/utils/border/lineStyle.d.ts +38 -0
- package/dist/es6/layout/lib/utils/border/lineStyle.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/lineStyle.js +49 -0
- package/dist/es6/layout/lib/utils/border/radius.d.ts +33 -0
- package/dist/es6/layout/lib/utils/border/radius.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/radius.js +29 -0
- package/dist/es6/layout/lib/utils/border/shorthand.d.ts +34 -0
- package/dist/es6/layout/lib/utils/border/shorthand.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/shorthand.js +39 -0
- package/dist/es6/layout/lib/utils/border/width.d.ts +34 -0
- package/dist/es6/layout/lib/utils/border/width.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/width.js +39 -0
- package/dist/es6/layout/lib/utils/buildStyleFns.d.ts +12 -0
- package/dist/es6/layout/lib/utils/buildStyleFns.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/buildStyleFns.js +85 -0
- package/dist/es6/layout/lib/utils/color.d.ts +23 -16
- package/dist/es6/layout/lib/utils/color.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/color.js +24 -47
- package/dist/es6/layout/lib/utils/depth.d.ts +17 -11
- package/dist/es6/layout/lib/utils/depth.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/depth.js +19 -18
- package/dist/es6/layout/lib/utils/flex.d.ts +31 -12
- package/dist/es6/layout/lib/utils/flex.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/flex.js +57 -23
- package/dist/es6/layout/lib/utils/flexItem.d.ts +18 -15
- package/dist/es6/layout/lib/utils/flexItem.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/flexItem.js +42 -24
- package/dist/es6/layout/lib/utils/grid.d.ts +40 -35
- package/dist/es6/layout/lib/utils/grid.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/grid.js +98 -70
- package/dist/es6/layout/lib/utils/gridItem.d.ts +17 -14
- package/dist/es6/layout/lib/utils/gridItem.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/gridItem.js +57 -28
- package/dist/es6/layout/lib/utils/layout.d.ts +47 -25
- package/dist/es6/layout/lib/utils/layout.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/layout.js +70 -31
- package/dist/es6/layout/lib/utils/other.d.ts +44 -2
- package/dist/es6/layout/lib/utils/other.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/other.js +100 -15
- package/dist/es6/layout/lib/utils/position.d.ts +37 -20
- package/dist/es6/layout/lib/utils/position.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/position.js +48 -64
- package/dist/es6/layout/lib/utils/space.d.ts +107 -51
- package/dist/es6/layout/lib/utils/space.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/space.js +97 -146
- package/dist/es6/layout/lib/utils/stack.d.ts +3 -6
- package/dist/es6/layout/lib/utils/stack.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/stack.js +13 -39
- package/dist/es6/layout/lib/utils/systemProps.d.ts +31 -0
- package/dist/es6/layout/lib/utils/systemProps.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/systemProps.js +1 -0
- package/dist/es6/layout/lib/utils/text.d.ts +33 -15
- package/dist/es6/layout/lib/utils/text.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/text.js +73 -36
- package/dist/es6/modal/lib/Modal.d.ts +1 -1
- package/dist/es6/popup/lib/Popup.d.ts +1 -1
- package/dist/es6/popup/lib/PopupBody.d.ts +1 -1
- package/dist/es6/popup/lib/hooks/useReturnFocus.d.ts.map +1 -1
- package/dist/es6/popup/lib/hooks/useReturnFocus.js +103 -3
- package/dist/es6/tabs/lib/TabsItem.d.ts +1 -1
- package/dist/es6/tokens/lib/colors.types.d.ts +4 -6
- package/dist/es6/tokens/lib/colors.types.d.ts.map +1 -1
- package/icon/lib/SystemIcon.tsx +1 -1
- package/layout/index.ts +8 -4
- package/layout/lib/Box.tsx +10 -36
- package/layout/lib/Flex.tsx +5 -1
- package/layout/lib/Grid.tsx +3 -4
- package/layout/lib/utils/background.ts +83 -0
- package/layout/lib/utils/border/color.ts +85 -0
- package/layout/lib/utils/border/index.ts +49 -0
- package/layout/lib/utils/border/lineStyle.ts +87 -0
- package/layout/lib/utils/border/radius.ts +61 -0
- package/layout/lib/utils/border/shorthand.ts +73 -0
- package/layout/lib/utils/border/width.ts +73 -0
- package/layout/lib/utils/buildStyleFns.ts +117 -0
- package/layout/lib/utils/color.ts +40 -55
- package/layout/lib/utils/depth.ts +28 -24
- package/layout/lib/utils/flex.ts +83 -32
- package/layout/lib/utils/flexItem.ts +54 -36
- package/layout/lib/utils/grid.ts +131 -94
- package/layout/lib/utils/gridItem.ts +69 -41
- package/layout/lib/utils/layout.ts +109 -50
- package/layout/lib/utils/other.ts +142 -15
- package/layout/lib/utils/position.ts +79 -73
- package/layout/lib/utils/space.ts +202 -196
- package/layout/lib/utils/stack.ts +19 -45
- package/layout/lib/utils/systemProps.ts +46 -0
- package/layout/lib/utils/text.ts +99 -34
- package/package.json +3 -3
- package/popup/lib/hooks/useReturnFocus.tsx +117 -4
- package/tokens/lib/colors.types.ts +4 -7
- package/dist/commonjs/layout/lib/utils/border.d.ts +0 -103
- package/dist/commonjs/layout/lib/utils/border.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/border.js +0 -153
- package/dist/commonjs/layout/lib/utils/font.d.ts +0 -29
- package/dist/commonjs/layout/lib/utils/font.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/font.js +0 -57
- package/dist/es6/layout/lib/utils/border.d.ts +0 -103
- package/dist/es6/layout/lib/utils/border.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/border.js +0 -149
- package/dist/es6/layout/lib/utils/font.d.ts +0 -29
- package/dist/es6/layout/lib/utils/font.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/font.js +0 -53
- package/layout/lib/utils/border.ts +0 -263
- package/layout/lib/utils/font.ts +0 -67
|
@@ -1,35 +1,53 @@
|
|
|
1
1
|
import { Property } from 'csstype';
|
|
2
|
-
|
|
2
|
+
import { StyleFnConfig } from './buildStyleFns';
|
|
3
|
+
import { SystemPropValues } from './systemProps';
|
|
4
|
+
/** style props to for CSS font and text properties */
|
|
3
5
|
export declare type TextStyleProps = {
|
|
4
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* - sets [CSS font-family property](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family)
|
|
8
|
+
* - system tokens: `font` */
|
|
9
|
+
fontFamily?: Property.FontFamily | SystemPropValues['font'];
|
|
10
|
+
/**
|
|
11
|
+
* - sets [CSS font-size property](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
|
|
12
|
+
* - system tokens: `fontSize` */
|
|
13
|
+
fontSize?: Property.FontSize | SystemPropValues['fontSize'];
|
|
14
|
+
/** sets [CSS font-style property](https://developer.mozilla.org/en-US/docs/Web/CSS/font-style) */
|
|
15
|
+
fontStyle?: Property.FontStyle;
|
|
16
|
+
/**
|
|
17
|
+
* - sets [CSS font-weight property](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)
|
|
18
|
+
* - system tokens: `fontWeight` */
|
|
19
|
+
fontWeight?: Property.FontWeight | SystemPropValues['fontWeight'];
|
|
20
|
+
/** sets [CSS line-height property](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height) */
|
|
5
21
|
lineHeight?: Property.LineHeight;
|
|
6
|
-
/** sets
|
|
22
|
+
/** sets [CSS letter-spacing property](https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing) */
|
|
7
23
|
letterSpacing?: Property.LetterSpacing;
|
|
8
|
-
/** sets
|
|
24
|
+
/** sets [CSS text-align property](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align) */
|
|
9
25
|
textAlign?: Property.TextAlign;
|
|
10
|
-
/** sets
|
|
26
|
+
/** sets [CSS text-decoration property](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration) */
|
|
11
27
|
textDecoration?: Property.TextDecoration;
|
|
12
|
-
/** sets
|
|
28
|
+
/** sets [CSS text-overflow property](https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow) */
|
|
13
29
|
textOverflow?: Property.TextOverflow;
|
|
14
|
-
/** sets
|
|
30
|
+
/** sets [CSS text-transform property](https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform) */
|
|
15
31
|
textTransform?: Property.TextTransform;
|
|
16
|
-
/** sets
|
|
32
|
+
/** sets [CSS text-shadow property](https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow) */
|
|
17
33
|
textShadow?: Property.TextShadow;
|
|
18
|
-
/** sets
|
|
34
|
+
/** sets [CSS white-space property](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space) */
|
|
19
35
|
whiteSpace?: Property.WhiteSpace;
|
|
20
|
-
/** sets
|
|
36
|
+
/** sets [CSS word-break property](https://developer.mozilla.org/en-US/docs/Web/CSS/word-break) */
|
|
21
37
|
wordBreak?: Property.WordBreak;
|
|
22
38
|
};
|
|
39
|
+
export declare const textStyleFnConfigs: StyleFnConfig[];
|
|
40
|
+
export declare const textStyleFns: import("./buildStyleFns").StyleFns;
|
|
23
41
|
/**
|
|
24
|
-
* A style prop function that takes
|
|
42
|
+
* A style prop function that takes component props and returns font and text styles.
|
|
25
43
|
* If no `TextStyleProps` are found, it returns an empty object.
|
|
26
44
|
*
|
|
27
45
|
* @example
|
|
28
|
-
*
|
|
46
|
+
* ```
|
|
29
47
|
* const BoxExample = () => (
|
|
30
|
-
* <Box textAlign="center">Hello, alignment!</Box>
|
|
48
|
+
* <Box textAlign="center" fontWeight="medium">Hello, alignment!</Box>
|
|
31
49
|
* );
|
|
32
|
-
*
|
|
50
|
+
* ```
|
|
33
51
|
*/
|
|
34
|
-
export declare
|
|
52
|
+
export declare const text: (props: TextStyleProps) => {};
|
|
35
53
|
//# sourceMappingURL=text.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["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AQ,CAAC,UAAU,CAAC;IACjC,kGAAkG;IAClG,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,aAAa,EAkE7C,CAAC;AAEF,eAAO,MAAM,YAAY,oCAAoC,CAAC;AAC9D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI,+BAAiD,CAAC"}
|
|
@@ -1,48 +1,84 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.text = void 0;
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
3
|
+
exports.text = exports.textStyleFns = exports.textStyleFnConfigs = void 0;
|
|
4
|
+
var buildStyleFns_1 = require("./buildStyleFns");
|
|
5
|
+
exports.textStyleFnConfigs = [
|
|
6
|
+
{
|
|
7
|
+
name: 'fontFamily',
|
|
8
|
+
properties: ['fontFamily'],
|
|
9
|
+
system: 'font',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'fontSize',
|
|
13
|
+
properties: ['fontSize'],
|
|
14
|
+
system: 'fontSize',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'fontStyle',
|
|
18
|
+
properties: ['fontStyle'],
|
|
19
|
+
system: 'none',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'fontWeight',
|
|
23
|
+
properties: ['fontWeight'],
|
|
24
|
+
system: 'fontWeight',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'lineHeight',
|
|
28
|
+
properties: ['lineHeight'],
|
|
29
|
+
system: 'none',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'letterSpacing',
|
|
33
|
+
properties: ['letterSpacing'],
|
|
34
|
+
system: 'none',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'textAlign',
|
|
38
|
+
properties: ['textAlign'],
|
|
39
|
+
system: 'none',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'textDecoration',
|
|
43
|
+
properties: ['textDecoration'],
|
|
44
|
+
system: 'none',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'textOverflow',
|
|
48
|
+
properties: ['textOverflow'],
|
|
49
|
+
system: 'none',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'textTransform',
|
|
53
|
+
properties: ['textTransform'],
|
|
54
|
+
system: 'none',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'textShadow',
|
|
58
|
+
properties: ['textShadow'],
|
|
59
|
+
system: 'none',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'whiteSpace',
|
|
63
|
+
properties: ['whiteSpace'],
|
|
64
|
+
system: 'none',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'wordBreak',
|
|
68
|
+
properties: ['wordBreak'],
|
|
69
|
+
system: 'none',
|
|
70
|
+
},
|
|
25
71
|
];
|
|
72
|
+
exports.textStyleFns = buildStyleFns_1.buildStyleFns(exports.textStyleFnConfigs);
|
|
26
73
|
/**
|
|
27
|
-
* A style prop function that takes
|
|
74
|
+
* A style prop function that takes component props and returns font and text styles.
|
|
28
75
|
* If no `TextStyleProps` are found, it returns an empty object.
|
|
29
76
|
*
|
|
30
77
|
* @example
|
|
31
|
-
*
|
|
78
|
+
* ```
|
|
32
79
|
* const BoxExample = () => (
|
|
33
|
-
* <Box textAlign="center">Hello, alignment!</Box>
|
|
80
|
+
* <Box textAlign="center" fontWeight="medium">Hello, alignment!</Box>
|
|
34
81
|
* );
|
|
35
|
-
*
|
|
82
|
+
* ```
|
|
36
83
|
*/
|
|
37
|
-
|
|
38
|
-
var _a;
|
|
39
|
-
var styles = {};
|
|
40
|
-
for (var key in props) {
|
|
41
|
-
if (textProps.includes(key)) {
|
|
42
|
-
var value = props[key];
|
|
43
|
-
styles = __assign(__assign({}, styles), (_a = {}, _a[key] = value, _a));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return styles;
|
|
47
|
-
}
|
|
48
|
-
exports.text = text;
|
|
84
|
+
exports.text = buildStyleFns_1.buildStylePropFn(exports.textStyleFns);
|
|
@@ -99,7 +99,7 @@ export declare const Modal: import("../../common").ComponentM<import("../../dial
|
|
|
99
99
|
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
100
100
|
};
|
|
101
101
|
}> & {
|
|
102
|
-
Body: import("../../common").ElementComponentM<"div", import("../..").
|
|
102
|
+
Body: import("../../common").ElementComponentM<"div", import("../..").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("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").GridItemStyleProps & import("../..").LayoutStyleProps & import("../..").OtherStyleProps & import("../..").PositionStyleProps & import("../..").SpaceStyleProps & import("../..").TextStyleProps & React.HTMLAttributes<HTMLDivElement>, {
|
|
103
103
|
state: {
|
|
104
104
|
stackRef: React.RefObject<HTMLDivElement>;
|
|
105
105
|
targetRef: React.RefObject<HTMLButtonElement>;
|
|
@@ -106,7 +106,7 @@ export declare const Popup: import("../../common").ComponentM<PopupProps & Parti
|
|
|
106
106
|
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
107
107
|
};
|
|
108
108
|
}>;
|
|
109
|
-
Body: import("../../common").ElementComponentM<"div", import("../..").
|
|
109
|
+
Body: import("../../common").ElementComponentM<"div", import("../..").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("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").GridItemStyleProps & import("../..").LayoutStyleProps & import("../..").OtherStyleProps & import("../..").PositionStyleProps & import("../..").SpaceStyleProps & import("../..").TextStyleProps & React.HTMLAttributes<HTMLDivElement>, {
|
|
110
110
|
state: {
|
|
111
111
|
stackRef: React.RefObject<HTMLDivElement>;
|
|
112
112
|
targetRef: React.RefObject<HTMLButtonElement>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare const PopupBody: import("../../common").ElementComponentM<"div", import("../..").
|
|
2
|
+
export declare const PopupBody: import("../../common").ElementComponentM<"div", import("../..").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("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").GridItemStyleProps & import("../..").LayoutStyleProps & import("../..").OtherStyleProps & import("../..").PositionStyleProps & import("../..").SpaceStyleProps & import("../..").TextStyleProps & React.HTMLAttributes<HTMLDivElement>, {
|
|
3
3
|
state: {
|
|
4
4
|
stackRef: React.RefObject<HTMLDivElement>;
|
|
5
5
|
targetRef: React.RefObject<HTMLButtonElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReturnFocus.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useReturnFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useReturnFocus.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useReturnFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgC1B;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;OAsGzB,CAAC"}
|
|
@@ -7,6 +7,28 @@ exports.useReturnFocus = void 0;
|
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
8
|
var common_1 = require("@workday/canvas-kit-react/common");
|
|
9
9
|
var usePopupModel_1 = require("./usePopupModel");
|
|
10
|
+
function getScrollParent(element) {
|
|
11
|
+
if (element === document.body || !element.parentElement) {
|
|
12
|
+
return element;
|
|
13
|
+
}
|
|
14
|
+
var styles = getComputedStyle(element);
|
|
15
|
+
if (styles.overflowY === 'scroll' || styles.overflowY === 'auto') {
|
|
16
|
+
return element;
|
|
17
|
+
}
|
|
18
|
+
return getScrollParent(element.parentElement);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get a focusable element in an element's tree
|
|
22
|
+
*/
|
|
23
|
+
function getFocusableElement(element) {
|
|
24
|
+
if (element === null || element === document.body || !element.parentElement) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
else if (common_1.isFocusable(element)) {
|
|
28
|
+
return element;
|
|
29
|
+
}
|
|
30
|
+
return getFocusableElement(element.parentElement);
|
|
31
|
+
}
|
|
10
32
|
/**
|
|
11
33
|
* Returns focus to the target element when the popup is hidden. This works well with
|
|
12
34
|
* `useInitialFocus`. This should be used with `useFocusRedirect` or `useFocusTrap` for a complete
|
|
@@ -16,15 +38,93 @@ var usePopupModel_1 = require("./usePopupModel");
|
|
|
16
38
|
*/
|
|
17
39
|
exports.useReturnFocus = common_1.createElemPropsHook(usePopupModel_1.usePopupModel)(function (model) {
|
|
18
40
|
var visible = model.state.visibility !== 'hidden';
|
|
41
|
+
var elementRef = react_1.default.useRef(null);
|
|
42
|
+
// This boolean tracks keyboard-driven focus changes. This is required for `useFocusRedirect` as
|
|
43
|
+
// focus redirection needs synchronous focus management and everything else needs asynchronous
|
|
44
|
+
// focus management.
|
|
45
|
+
var requiresFocusChangeRef = react_1.default.useRef(false);
|
|
46
|
+
var onKeyDown = react_1.default.useCallback(function (event) {
|
|
47
|
+
// The tab key changes focus
|
|
48
|
+
if (event.key === 'Tab') {
|
|
49
|
+
requiresFocusChangeRef.current = true;
|
|
50
|
+
}
|
|
51
|
+
}, []);
|
|
52
|
+
var onKeyUp = react_1.default.useCallback(function (event) {
|
|
53
|
+
requiresFocusChangeRef.current = false;
|
|
54
|
+
}, []);
|
|
55
|
+
// track mousedown events to determine if the mouse target is a focusable element. If it is, we
|
|
56
|
+
// should not return focus
|
|
57
|
+
var onMouseDown = react_1.default.useCallback(function (event) {
|
|
58
|
+
elementRef.current = event.target;
|
|
59
|
+
}, []);
|
|
60
|
+
var onMouseUp = react_1.default.useCallback(function () {
|
|
61
|
+
elementRef.current = null;
|
|
62
|
+
}, []);
|
|
63
|
+
// We use `useLayoutEffect` because the callback will be called _before_ the browser changes
|
|
64
|
+
// focus. This allows the browser to change focus as normal. For example, if the popup closes
|
|
65
|
+
// because the user hits the tab key when focused on the last focusable element,
|
|
66
|
+
// `useFocusRedirect` will cause the popup to close before the browser is finished processing the
|
|
67
|
+
// `keydown`. The browser's default action of a keydown of a tab key is to advance focus to the
|
|
68
|
+
// next focusable element. This means that the `useFocusRedirect` will change focus back to the
|
|
69
|
+
// target, then the tab key is processed by the browser to focus on the next item after the target
|
|
70
|
+
// without us having to use a focus manager to guess what the next focusable element is.
|
|
71
|
+
//
|
|
72
|
+
// But because we're using `useLayoutEffect` instead of `useEffect`, we cannot use
|
|
73
|
+
// `document.activeElement` (because the focus hasn't changed yet because the browser hasn't
|
|
74
|
+
// triggered a default action yet) to determine if a user clicked on something that can accept
|
|
75
|
+
// focus itself. If we don't short-circuit return focus, the user will intend to click on an
|
|
76
|
+
// `input` element only to get focus changed back. This is annoying to users and unintuitive. Instead,
|
|
77
|
+
// we'll use `mousedown` and `mouseup` to determine if we're closing because of a mouse click.
|
|
19
78
|
react_1.default.useLayoutEffect(function () {
|
|
20
79
|
if (!visible) {
|
|
21
80
|
return;
|
|
22
81
|
}
|
|
23
82
|
// capture the element here. The refs will be null by the time the cleanup function is called
|
|
24
83
|
var element = (model.state.returnFocusRef || model.state.targetRef).current;
|
|
84
|
+
document.addEventListener('mousedown', onMouseDown, true);
|
|
85
|
+
document.addEventListener('mouseup', onMouseUp, true);
|
|
86
|
+
document.addEventListener('keydown', onKeyDown, true);
|
|
87
|
+
document.addEventListener('keyup', onKeyUp, true);
|
|
25
88
|
return function () {
|
|
26
|
-
|
|
89
|
+
document.removeEventListener('mousedown', onMouseDown, true);
|
|
90
|
+
document.removeEventListener('mouseup', onMouseUp, true);
|
|
91
|
+
document.removeEventListener('keydown', onKeyDown, true);
|
|
92
|
+
document.removeEventListener('keyup', onKeyUp, true);
|
|
93
|
+
var scrollParent = getScrollParent(element);
|
|
94
|
+
var scrollParentRect = scrollParent.getBoundingClientRect();
|
|
95
|
+
var elementRect = element.getBoundingClientRect();
|
|
96
|
+
// Don't change focus if user focused on a different element like a `input` or the target
|
|
97
|
+
// element isn't on at least halfway rendered on the screen.
|
|
98
|
+
if ((elementRef.current && getFocusableElement(elementRef.current)) ||
|
|
99
|
+
elementRect.top + elementRect.height / 2 < scrollParentRect.top ||
|
|
100
|
+
elementRect.bottom - elementRect.height / 2 > scrollParentRect.bottom ||
|
|
101
|
+
elementRect.left + elementRect.width / 2 < scrollParentRect.left ||
|
|
102
|
+
elementRect.right - elementRect.width / 2 > scrollParentRect.right) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (requiresFocusChangeRef.current) {
|
|
106
|
+
// We need to change focus _before_ the browser process the default action of picking a new
|
|
107
|
+
// focus target. Doing this immediately prevents the `focus` event from firing on `element`,
|
|
108
|
+
// but that's okay because the browser will change focus anyways.
|
|
109
|
+
common_1.changeFocus(element);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
// We wait a frame for the current event to process, allowing the browser to fire default
|
|
113
|
+
// actions. This delay allows the focus change to trigger a `focus` event on `element`.
|
|
114
|
+
requestAnimationFrame(function () {
|
|
115
|
+
common_1.changeFocus(element);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
elementRef.current = null;
|
|
27
119
|
};
|
|
28
|
-
}, [
|
|
120
|
+
}, [
|
|
121
|
+
model.state.returnFocusRef,
|
|
122
|
+
model.state.targetRef,
|
|
123
|
+
visible,
|
|
124
|
+
onMouseDown,
|
|
125
|
+
onMouseUp,
|
|
126
|
+
onKeyDown,
|
|
127
|
+
onKeyUp,
|
|
128
|
+
]);
|
|
29
129
|
return {};
|
|
30
130
|
});
|
|
@@ -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("../../layout").
|
|
56
|
+
export declare const StyledTabItem: import("@emotion/styled").StyledComponent<import("../../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("../../layout").ColorStyleProps & import("../../layout").DepthStyleProps & import("../../layout").FlexItemStyleProps & import("../../layout").GridItemStyleProps & import("../../layout").LayoutStyleProps & import("../../layout").OtherStyleProps & import("../../layout").PositionStyleProps & import("../../layout").SpaceStyleProps & import("../../layout").TextStyleProps & Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "name" | "style" | "ref" | "form" | "slot" | "title" | "dir" | "value" | "children" | "hidden" | "disabled" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "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" | "key" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & {
|
|
57
57
|
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
58
58
|
} & {
|
|
59
59
|
theme?: import("@emotion/react").Theme | undefined;
|
|
@@ -25,11 +25,9 @@ export declare enum BrandingColor {
|
|
|
25
25
|
Licorice = "licorice",
|
|
26
26
|
BlackPepper = "blackPepper"
|
|
27
27
|
}
|
|
28
|
-
declare type
|
|
29
|
-
[K in keyof T
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
} ? U : never;
|
|
33
|
-
export declare type CanvasColor = KnownKeys<typeof colors>;
|
|
28
|
+
declare type RemoveIndex<T> = {
|
|
29
|
+
[K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
|
|
30
|
+
};
|
|
31
|
+
export declare type CanvasColor = keyof RemoveIndex<typeof colors>;
|
|
34
32
|
export {};
|
|
35
33
|
//# sourceMappingURL=colors.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.types.d.ts","sourceRoot":"","sources":["../../../../tokens/lib/colors.types.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAEhD,oBAAY,aAAa;IACvB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,aAAa,kBAAkB;IAC/B,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,kBAAkB,uBAAuB;IACzC,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;CAC5B;
|
|
1
|
+
{"version":3,"file":"colors.types.d.ts","sourceRoot":"","sources":["../../../../tokens/lib/colors.types.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAEhD,oBAAY,aAAa;IACvB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,aAAa,kBAAkB;IAC/B,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,kBAAkB,uBAAuB;IACzC,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;CAC5B;AAED,aAAK,WAAW,CAAC,CAAC,IAAI;KAClB,CAAC,IAAI,MAAM,CAAC,IAAI,MAAM,SAAS,CAAC,GAAG,KAAK,GAAG,MAAM,SAAS,CAAC,GAAG,KAAK,GAAG,CAAC,GAAK,CAAC,CAAC,CAAC,CAAC;CACnF,CAAC;AAEF,oBAAY,WAAW,GAAG,MAAM,WAAW,CAAC,OAAO,MAAM,CAAC,CAAC"}
|
|
@@ -8,6 +8,6 @@ export interface CardProps extends BoxProps {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const Card: import("../../common").ElementComponent<"div", CardProps> & {
|
|
10
10
|
Heading: import("../../common").ElementComponent<"h3", import("./CardHeading").CardHeadingProps>;
|
|
11
|
-
Body: import("../../common").ElementComponent<"div", import("../../layout").
|
|
11
|
+
Body: import("../../common").ElementComponent<"div", import("../../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("../../layout").ColorStyleProps & import("../../layout").DepthStyleProps & import("../../layout").FlexItemStyleProps & import("../../layout").GridItemStyleProps & import("../../layout").LayoutStyleProps & import("../../layout").OtherStyleProps & import("../../layout").PositionStyleProps & import("../../layout").SpaceStyleProps & import("../../layout").TextStyleProps>;
|
|
12
12
|
};
|
|
13
13
|
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CardBody: import("../../common").ElementComponent<"div", import("../../layout").
|
|
1
|
+
export declare const CardBody: import("../../common").ElementComponent<"div", import("../../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("../../layout").ColorStyleProps & import("../../layout").DepthStyleProps & import("../../layout").FlexItemStyleProps & import("../../layout").GridItemStyleProps & import("../../layout").LayoutStyleProps & import("../../layout").OtherStyleProps & import("../../layout").PositionStyleProps & import("../../layout").SpaceStyleProps & import("../../layout").TextStyleProps>;
|
|
2
2
|
//# sourceMappingURL=CardBody.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardBody.d.ts","sourceRoot":"","sources":["../../../../card/lib/CardBody.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"CardBody.d.ts","sourceRoot":"","sources":["../../../../card/lib/CardBody.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,k0BASnB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Is an element focusable? This function performs various tests to see if the element in question
|
|
3
3
|
* can receive focus. Should skip disabled elements as they are not focusable.
|
|
4
4
|
*/
|
|
5
|
-
export declare const isFocusable: (element:
|
|
5
|
+
export declare const isFocusable: (element: Element) => boolean;
|
|
6
6
|
/**
|
|
7
7
|
* Get the first focusable element in a container.
|
|
8
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/elements.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,WAAW,YAAa,
|
|
1
|
+
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/elements.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,WAAW,YAAa,OAAO,KAAG,OAuB9C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,cAAe,WAAW,KAAG,WAAW,GAAG,IAW/E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,cAAe,WAAW,KAAG,WAAW,GAAG,IAW9E,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export var isFocusable = function (element) {
|
|
6
6
|
if (element.hasAttribute('disabled')) {
|
|
7
|
-
return
|
|
7
|
+
return false;
|
|
8
8
|
}
|
|
9
9
|
var nodeName = element.nodeName.toLowerCase();
|
|
10
10
|
var validInput = nodeName === 'input' && element.getAttribute('type') !== 'hidden';
|
|
@@ -28,7 +28,7 @@ export var getFirstFocusableElement = function (container) {
|
|
|
28
28
|
var elements = container.querySelectorAll('*');
|
|
29
29
|
for (var i = 0; i < elements.length; i++) {
|
|
30
30
|
var element = elements.item(i);
|
|
31
|
-
if (element && isFocusable(element)) {
|
|
31
|
+
if (element && isFocusable(element) && element.getAttribute('tabindex') !== '-1') {
|
|
32
32
|
return element;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -41,7 +41,7 @@ export var getLastFocusableElement = function (container) {
|
|
|
41
41
|
var elements = container.querySelectorAll('*');
|
|
42
42
|
for (var i = elements.length - 1; i >= 0; i--) {
|
|
43
43
|
var element = elements.item(i);
|
|
44
|
-
if (element && isFocusable(element)) {
|
|
44
|
+
if (element && isFocusable(element) && element.getAttribute('tabindex') !== '-1') {
|
|
45
45
|
return element;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -88,7 +88,7 @@ export declare const Dialog: import("../../common").ComponentM<DialogProps & Par
|
|
|
88
88
|
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
89
89
|
};
|
|
90
90
|
}> & {
|
|
91
|
-
Body: import("../../common").ElementComponentM<"div", import("../..").
|
|
91
|
+
Body: import("../../common").ElementComponentM<"div", import("../..").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("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").GridItemStyleProps & import("../..").LayoutStyleProps & import("../..").OtherStyleProps & import("../..").PositionStyleProps & import("../..").SpaceStyleProps & import("../..").TextStyleProps & React.HTMLAttributes<HTMLDivElement>, {
|
|
92
92
|
state: {
|
|
93
93
|
stackRef: React.RefObject<HTMLDivElement>;
|
|
94
94
|
targetRef: React.RefObject<HTMLButtonElement>;
|
|
@@ -39,7 +39,7 @@ export interface SystemIconStyles {
|
|
|
39
39
|
*/
|
|
40
40
|
fillHover?: string;
|
|
41
41
|
}
|
|
42
|
-
export interface SystemIconProps extends SystemIconStyles, Omit<IconProps, 'src' | 'color' | 'type' | 'background'> {
|
|
42
|
+
export interface SystemIconProps extends SystemIconStyles, Omit<IconProps, 'src' | 'color' | 'fill' | 'type' | 'background'> {
|
|
43
43
|
/**
|
|
44
44
|
* The icon to display from `@workday/canvas-system-icons-web`.
|
|
45
45
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SystemIcon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/SystemIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,gBAAgB,EAAkB,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAO,SAAS,EAAC,MAAM,QAAQ,CAAC;AAGvC,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,CAA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BAAgB,KAAG,SAmBpB,CAAC;AAEH,eAAO,MAAM,UAAU,kEA4CrB,CAAC"}
|
|
@@ -2,20 +2,24 @@ import { DeprecatedLayout } from './lib/Layout';
|
|
|
2
2
|
import { DeprecatedColumn } from './lib/Column';
|
|
3
3
|
export { DeprecatedLayout, DeprecatedColumn };
|
|
4
4
|
export * from './lib/Box';
|
|
5
|
+
export * from './lib/utils/background';
|
|
5
6
|
export * from './lib/utils/border';
|
|
6
7
|
export * from './lib/utils/color';
|
|
7
|
-
export { DepthStyleProps } from './lib/utils/depth';
|
|
8
|
+
export { DepthStyleProps, depthStyleFnConfigs } from './lib/utils/depth';
|
|
9
|
+
export * from './lib/utils/flex';
|
|
8
10
|
export * from './lib/utils/flexItem';
|
|
9
|
-
export * from './lib/utils/
|
|
11
|
+
export * from './lib/utils/grid';
|
|
12
|
+
export * from './lib/utils/gridItem';
|
|
10
13
|
export * from './lib/utils/layout';
|
|
14
|
+
export * from './lib/utils/other';
|
|
11
15
|
export * from './lib/utils/position';
|
|
12
|
-
export { SpaceStyleProps } from './lib/utils/space';
|
|
16
|
+
export { SpaceStyleProps, spaceStyleFnConfigs } from './lib/utils/space';
|
|
13
17
|
export * from './lib/utils/text';
|
|
14
18
|
export * from './lib/Flex';
|
|
15
19
|
export * from './lib/Grid';
|
|
16
20
|
export * from './lib/Stack';
|
|
17
21
|
export type { FlexStyleProps } from './lib/utils/flex';
|
|
18
22
|
export type { GridStyleProps } from './lib/utils/grid';
|
|
19
|
-
export type { GridItemStyleProps } from './lib/utils/gridItem';
|
|
23
|
+
export type { GridItemStyleProps, gridItemStyleFnConfigs } from './lib/utils/gridItem';
|
|
20
24
|
export type { StackSpacing, StackDirection, StackStyleProps } from './lib/utils/stack';
|
|
21
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAA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AAe,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/es6/layout/index.js
CHANGED
|
@@ -2,12 +2,18 @@ import { DeprecatedLayout } from './lib/Layout';
|
|
|
2
2
|
import { DeprecatedColumn } from './lib/Column';
|
|
3
3
|
export { DeprecatedLayout, DeprecatedColumn };
|
|
4
4
|
export * from './lib/Box';
|
|
5
|
+
export * from './lib/utils/background';
|
|
5
6
|
export * from './lib/utils/border';
|
|
6
7
|
export * from './lib/utils/color';
|
|
8
|
+
export { depthStyleFnConfigs } from './lib/utils/depth';
|
|
9
|
+
export * from './lib/utils/flex';
|
|
7
10
|
export * from './lib/utils/flexItem';
|
|
8
|
-
export * from './lib/utils/
|
|
11
|
+
export * from './lib/utils/grid';
|
|
12
|
+
export * from './lib/utils/gridItem';
|
|
9
13
|
export * from './lib/utils/layout';
|
|
14
|
+
export * from './lib/utils/other';
|
|
10
15
|
export * from './lib/utils/position';
|
|
16
|
+
export { spaceStyleFnConfigs } from './lib/utils/space';
|
|
11
17
|
export * from './lib/utils/text';
|
|
12
18
|
export * from './lib/Flex';
|
|
13
19
|
export * from './lib/Grid';
|