@workday/canvas-kit-react 8.0.0-alpha.208-next.1 → 8.0.0-alpha.222-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/lib/theming/index.ts +1 -1
- package/common/lib/theming/styled.ts +6 -3
- package/common/lib/utils/elements.ts +4 -4
- package/common/lib/utils/index.ts +0 -1
- 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/theming/index.d.ts +1 -1
- package/dist/commonjs/common/lib/theming/index.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/styled.d.ts +2 -0
- package/dist/commonjs/common/lib/theming/styled.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/styled.js +1 -2
- 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/common/lib/utils/index.d.ts +0 -1
- package/dist/commonjs/common/lib/utils/index.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/index.js +0 -1
- 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/index.d.ts +1 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +1 -0
- 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 +72 -7
- package/dist/commonjs/tabs/lib/TabsItem.d.ts +1 -1
- package/dist/commonjs/testing/index.d.ts +5 -0
- package/dist/commonjs/testing/index.d.ts.map +1 -0
- package/dist/commonjs/testing/index.js +16 -0
- package/dist/commonjs/testing/lib/ComponentStatesTable.d.ts +26 -0
- package/dist/commonjs/testing/lib/ComponentStatesTable.d.ts.map +1 -0
- package/dist/commonjs/testing/lib/ComponentStatesTable.js +48 -0
- package/dist/commonjs/testing/lib/StaticStates.d.ts +7 -0
- package/dist/commonjs/testing/lib/StaticStates.d.ts.map +1 -0
- package/dist/commonjs/{common/lib/utils → testing/lib}/StaticStates.js +1 -1
- package/dist/commonjs/testing/lib/permutateProps.d.ts +5 -0
- package/dist/commonjs/testing/lib/permutateProps.d.ts.map +1 -0
- package/dist/commonjs/testing/lib/permutateProps.js +47 -0
- package/dist/commonjs/testing/lib/propTypes.d.ts +15 -0
- package/dist/commonjs/testing/lib/propTypes.d.ts.map +1 -0
- package/dist/commonjs/testing/lib/propTypes.js +2 -0
- 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/theming/index.d.ts +1 -1
- package/dist/es6/common/lib/theming/index.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/styled.d.ts +2 -0
- package/dist/es6/common/lib/theming/styled.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/styled.js +1 -2
- 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/common/lib/utils/index.d.ts +0 -1
- package/dist/es6/common/lib/utils/index.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/index.js +0 -1
- 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/index.d.ts +1 -0
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +1 -0
- 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 +73 -8
- package/dist/es6/tabs/lib/TabsItem.d.ts +1 -1
- package/dist/es6/testing/index.d.ts +5 -0
- package/dist/es6/testing/index.d.ts.map +1 -0
- package/dist/es6/testing/index.js +4 -0
- package/dist/es6/testing/lib/ComponentStatesTable.d.ts +26 -0
- package/dist/es6/testing/lib/ComponentStatesTable.d.ts.map +1 -0
- package/dist/es6/testing/lib/ComponentStatesTable.js +41 -0
- package/dist/es6/testing/lib/StaticStates.d.ts +7 -0
- package/dist/es6/testing/lib/StaticStates.d.ts.map +1 -0
- package/dist/es6/{common/lib/utils → testing/lib}/StaticStates.js +1 -1
- package/dist/es6/testing/lib/permutateProps.d.ts +5 -0
- package/dist/es6/testing/lib/permutateProps.d.ts.map +1 -0
- package/dist/es6/testing/lib/permutateProps.js +43 -0
- package/dist/es6/testing/lib/propTypes.d.ts +15 -0
- package/dist/es6/testing/lib/propTypes.d.ts.map +1 -0
- package/dist/es6/testing/lib/propTypes.js +1 -0
- 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/index.ts +1 -0
- 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 +83 -9
- package/testing/LICENSE +52 -0
- package/testing/README.md +6 -0
- package/testing/index.ts +4 -0
- package/testing/lib/ComponentStatesTable.tsx +80 -0
- package/{common/lib/utils → testing/lib}/StaticStates.tsx +5 -4
- package/testing/lib/permutateProps.ts +47 -0
- package/testing/lib/propTypes.ts +15 -0
- package/testing/package.json +6 -0
- package/tokens/lib/colors.types.ts +4 -7
- package/dist/commonjs/common/lib/utils/StaticStates.d.ts +0 -8
- package/dist/commonjs/common/lib/utils/StaticStates.d.ts.map +0 -1
- 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/common/lib/utils/StaticStates.d.ts +0 -8
- package/dist/es6/common/lib/utils/StaticStates.d.ts.map +0 -1
- 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,103 +0,0 @@
|
|
|
1
|
-
import { CanvasBorderRadiusKeys, CanvasColor } from '@workday/canvas-kit-react/tokens';
|
|
2
|
-
import { PartialEmotionCanvasTheme } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { Property } from 'csstype';
|
|
4
|
-
/** style props to set the border properties */
|
|
5
|
-
export declare type BorderShorthandStyleProps = {
|
|
6
|
-
/** sets `border` property */
|
|
7
|
-
border?: string;
|
|
8
|
-
/** sets `border-top` property */
|
|
9
|
-
borderTop?: string;
|
|
10
|
-
/** sets `border-right` property (no bidirectional support) */
|
|
11
|
-
borderRight?: string;
|
|
12
|
-
/** sets `border-bottom` property */
|
|
13
|
-
borderBottom?: string;
|
|
14
|
-
/** sets `border-left` property (no bidirectional support) */
|
|
15
|
-
borderLeft?: string;
|
|
16
|
-
};
|
|
17
|
-
/** style props to set the border color properties */
|
|
18
|
-
export declare type BorderColorStyleProps = {
|
|
19
|
-
/** sets `border-color` property */
|
|
20
|
-
borderColor?: CanvasColor | (string & {});
|
|
21
|
-
/** sets `border-top-color` property */
|
|
22
|
-
borderTopColor?: CanvasColor | (string & {});
|
|
23
|
-
/** sets `border-right-color` property (no bidirectional support) */
|
|
24
|
-
borderRightColor?: CanvasColor | (string & {});
|
|
25
|
-
/** sets `border-bottom-color` property */
|
|
26
|
-
borderBottomColor?: CanvasColor | (string & {});
|
|
27
|
-
/** sets `border-left-color` property (no bidirectional support) */
|
|
28
|
-
borderLeftColor?: CanvasColor | (string & {});
|
|
29
|
-
};
|
|
30
|
-
/** style props to set the border radius properties */
|
|
31
|
-
export declare type BorderRadiusStyleProps = {
|
|
32
|
-
/** sets `border-radius` property */
|
|
33
|
-
borderRadius?: CanvasBorderRadiusKeys | number | (string & {});
|
|
34
|
-
/** sets `border-top-left-radius` property */
|
|
35
|
-
borderTopLeftRadius?: CanvasBorderRadiusKeys | number | (string & {});
|
|
36
|
-
/** sets `border-top-right-radius` property */
|
|
37
|
-
borderTopRightRadius?: CanvasBorderRadiusKeys | number | (string & {});
|
|
38
|
-
/** sets `border-bottom-left-radius` property */
|
|
39
|
-
borderBottomLeftRadius?: CanvasBorderRadiusKeys | number | (string & {});
|
|
40
|
-
/** sets `border-bottom-right-radius` property */
|
|
41
|
-
borderBottomRightRadius?: CanvasBorderRadiusKeys | number | (string & {});
|
|
42
|
-
};
|
|
43
|
-
/** style props to set the border style properties */
|
|
44
|
-
export declare type BorderLineStyleProps = {
|
|
45
|
-
/** sets `border-style` property */
|
|
46
|
-
borderStyle?: Property.Border;
|
|
47
|
-
/** sets `border-top-style` property */
|
|
48
|
-
borderTopStyle?: Property.Border;
|
|
49
|
-
/** sets `border-right-style` property (no bidirectional support) */
|
|
50
|
-
borderRightStyle?: Property.Border;
|
|
51
|
-
/** sets `border-bottom-style` property */
|
|
52
|
-
borderBottomStyle?: Property.Border;
|
|
53
|
-
/** sets `border-left-style` property (no bidirectional support) */
|
|
54
|
-
borderLeftStyle?: Property.Border;
|
|
55
|
-
};
|
|
56
|
-
/** style props to set the border width properties */
|
|
57
|
-
export declare type BorderWidthStyleProps = {
|
|
58
|
-
/** sets `border-width` property */
|
|
59
|
-
borderWidth?: string | number;
|
|
60
|
-
/** sets `border-top-width` property */
|
|
61
|
-
borderTopWidth?: string | number;
|
|
62
|
-
/** sets `border-right-width` property (no bidirectional support) */
|
|
63
|
-
borderRightWidth?: string | number;
|
|
64
|
-
/** sets `border-bottom-width` property */
|
|
65
|
-
borderBottomWidth?: string | number;
|
|
66
|
-
/** sets `border-left-width` property (no bidirectional support) */
|
|
67
|
-
borderLeftWidth?: string | number;
|
|
68
|
-
};
|
|
69
|
-
export declare type BorderLogicalStyleProps = {
|
|
70
|
-
/** sets `border-left` property (bidirectional support) */
|
|
71
|
-
borderInlineStart?: string;
|
|
72
|
-
/** sets `border-left-color` property (bidirectional support) */
|
|
73
|
-
borderInlineStartColor?: CanvasColor | (string & {});
|
|
74
|
-
/** sets `border-left-style` property (bidirectional support) */
|
|
75
|
-
borderInlineStartStyle?: Property.Border;
|
|
76
|
-
/** sets `border-left-width` property (bidirectional support) */
|
|
77
|
-
borderInlineStartWidth?: string | number;
|
|
78
|
-
/** sets `border-right` property (bidirectional support) */
|
|
79
|
-
borderInlineEnd?: string;
|
|
80
|
-
/** sets `border-right-color` property (bidirectional support) */
|
|
81
|
-
borderInlineEndColor?: CanvasColor | (string & {});
|
|
82
|
-
/** sets `border-right-style` property (bidirectional support) */
|
|
83
|
-
borderInlineEndStyle?: Property.Border;
|
|
84
|
-
/** sets `border-right-width` property (bidirectional support) */
|
|
85
|
-
borderInlineEndWidth?: string | number;
|
|
86
|
-
};
|
|
87
|
-
/** a collection style props for border properties */
|
|
88
|
-
export declare type BorderStyleProps = BorderShorthandStyleProps & BorderColorStyleProps & BorderRadiusStyleProps & BorderLineStyleProps & BorderWidthStyleProps & BorderLogicalStyleProps;
|
|
89
|
-
/**
|
|
90
|
-
* A style prop function that takes components props and returns border styles. Some props, such as borderRadius and borderColor, are connected to our design tokens.
|
|
91
|
-
* If no `BorderStyleProps` are found, it returns an empty object.
|
|
92
|
-
*
|
|
93
|
-
* @example
|
|
94
|
-
* // You'll most likely use `border` with low-level, styled components
|
|
95
|
-
* const BoxExample = () => (
|
|
96
|
-
* <Box border={`solid 1px #333333 ${colors.blackPepper400}`}>Hello, border styles!</Box>
|
|
97
|
-
* );
|
|
98
|
-
*
|
|
99
|
-
*/
|
|
100
|
-
export declare function border<P extends BorderStyleProps & {
|
|
101
|
-
theme?: PartialEmotionCanvasTheme;
|
|
102
|
-
}>(props: P): {};
|
|
103
|
-
//# sourceMappingURL=border.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"border.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/border.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,EAEtB,WAAW,EACZ,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAEL,yBAAyB,EAE1B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,+CAA+C;AAC/C,oBAAY,yBAAyB,GAAG;IACtC,6BAA6B;IAC7B,MAAM,CAAC,EAAE,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AAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACnD,iEAAiE;IACjE,oBAAoB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;IACvC,iEAAiE;IACjE,oBAAoB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxC,CAAC;AAEF,qDAAqD;AACrD,oBAAY,gBAAgB,GAAG,yBAAyB,GACtD,qBAAqB,GACrB,sBAAsB,GACtB,oBAAoB,GACpB,qBAAqB,GACrB,uBAAuB,CAAC;AA4D1B;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,gBAAgB,GAAG;IAAC,KAAK,CAAC,EAAE,yBAAyB,CAAA;CAAC,EAAE,KAAK,EAAE,CAAC,MAkFhG"}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.border = void 0;
|
|
4
|
-
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
5
|
-
var common_1 = require("@workday/canvas-kit-react/common");
|
|
6
|
-
// border logical prop handlers
|
|
7
|
-
var borderInlineStart = function (isRTL) { return (isRTL ? 'borderRight' : 'borderLeft'); };
|
|
8
|
-
var borderInlineEnd = function (isRTL) { return (isRTL ? 'borderLeft' : 'borderRight'); };
|
|
9
|
-
var borderInlineStartColor = function (isRTL) { return (isRTL ? 'borderRightColor' : 'borderLeftColor'); };
|
|
10
|
-
var borderInlineEndColor = function (isRTL) { return (isRTL ? 'borderLeftColor' : 'borderRightColor'); };
|
|
11
|
-
var borderInlineStartStyle = function (isRTL) { return (isRTL ? 'borderRightStyle' : 'borderLeftStyle'); };
|
|
12
|
-
var borderInlineEndStyle = function (isRTL) { return (isRTL ? 'borderLeftStyle' : 'borderRightStyle'); };
|
|
13
|
-
var borderInlineStartWidth = function (isRTL) { return (isRTL ? 'borderRightWidth' : 'borderLeftWidth'); };
|
|
14
|
-
var borderInlineEndWidth = function (isRTL) { return (isRTL ? 'borderLeftWidth' : 'borderRightWidth'); };
|
|
15
|
-
var borderShorthandProps = {
|
|
16
|
-
border: 'border',
|
|
17
|
-
borderTop: 'borderTop',
|
|
18
|
-
borderRight: 'borderRight',
|
|
19
|
-
borderBottom: 'borderBottom',
|
|
20
|
-
borderLeft: 'borderLeft',
|
|
21
|
-
borderInlineStart: borderInlineStart,
|
|
22
|
-
borderInlineEnd: borderInlineEnd,
|
|
23
|
-
};
|
|
24
|
-
var borderColors = {
|
|
25
|
-
borderColor: 'borderColor',
|
|
26
|
-
borderTopColor: 'borderTopColor',
|
|
27
|
-
borderRightColor: 'borderRightColor',
|
|
28
|
-
borderBottomColor: 'borderBottomColor',
|
|
29
|
-
borderLeftColor: 'borderLeftColor',
|
|
30
|
-
borderInlineStartColor: borderInlineStartColor,
|
|
31
|
-
borderInlineEndColor: borderInlineEndColor,
|
|
32
|
-
};
|
|
33
|
-
var borderRadii = {
|
|
34
|
-
borderRadius: 'borderRadius',
|
|
35
|
-
borderTopLeftRadius: 'borderTopLeftRadius',
|
|
36
|
-
borderTopRightRadius: 'borderTopRightRadius',
|
|
37
|
-
borderBottomLeftRadius: 'borderBottomLeftRadius',
|
|
38
|
-
borderBottomRightRadius: 'borderBottomRightRadius',
|
|
39
|
-
};
|
|
40
|
-
var borderStyles = {
|
|
41
|
-
borderStyle: 'borderStyle',
|
|
42
|
-
borderTopStyle: 'borderTopStyle',
|
|
43
|
-
borderRightStyle: 'borderRightStyle',
|
|
44
|
-
borderBottomStyle: 'borderBottomStyle',
|
|
45
|
-
borderLeftStyle: 'borderLeftStyle',
|
|
46
|
-
borderInlineStartStyle: borderInlineStartStyle,
|
|
47
|
-
borderInlineEndStyle: borderInlineEndStyle,
|
|
48
|
-
};
|
|
49
|
-
var borderWidths = {
|
|
50
|
-
borderWidth: 'borderWidth',
|
|
51
|
-
borderTopWidth: 'borderTopWidth',
|
|
52
|
-
borderRightWidth: 'borderRightWidth',
|
|
53
|
-
borderBottomWidth: 'borderBottomWidth',
|
|
54
|
-
borderLeftWidth: 'borderLeftWidth',
|
|
55
|
-
borderInlineStartWidth: borderInlineStartWidth,
|
|
56
|
-
borderInlineEndWidth: borderInlineEndWidth,
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* A style prop function that takes components props and returns border styles. Some props, such as borderRadius and borderColor, are connected to our design tokens.
|
|
60
|
-
* If no `BorderStyleProps` are found, it returns an empty object.
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* // You'll most likely use `border` with low-level, styled components
|
|
64
|
-
* const BoxExample = () => (
|
|
65
|
-
* <Box border={`solid 1px #333333 ${colors.blackPepper400}`}>Hello, border styles!</Box>
|
|
66
|
-
* );
|
|
67
|
-
*
|
|
68
|
-
*/
|
|
69
|
-
function border(props) {
|
|
70
|
-
// border will always be used within the context of a component, but eslint doesn't know that
|
|
71
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
72
|
-
var canvas = common_1.useTheme(props.theme).canvas;
|
|
73
|
-
var isRTL = canvas.direction === common_1.ContentDirection.RTL;
|
|
74
|
-
var styles = {};
|
|
75
|
-
for (var key in props) {
|
|
76
|
-
if (props.hasOwnProperty(key)) {
|
|
77
|
-
if (key in borderShorthandProps) {
|
|
78
|
-
var value = props[key];
|
|
79
|
-
var attr = void 0;
|
|
80
|
-
if (key === 'borderInlineStart') {
|
|
81
|
-
attr = borderInlineStart(isRTL);
|
|
82
|
-
}
|
|
83
|
-
else if (key === 'borderInlineEnd') {
|
|
84
|
-
attr = borderInlineEnd(isRTL);
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
attr = borderShorthandProps[key];
|
|
88
|
-
}
|
|
89
|
-
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
90
|
-
styles[attr] = value;
|
|
91
|
-
continue;
|
|
92
|
-
}
|
|
93
|
-
if (key in borderColors) {
|
|
94
|
-
var propValue = props[key];
|
|
95
|
-
var value = tokens_1.colors[propValue] || propValue;
|
|
96
|
-
var attr = void 0;
|
|
97
|
-
if (key === 'borderInlineStartColor') {
|
|
98
|
-
attr = borderInlineStartColor(isRTL);
|
|
99
|
-
}
|
|
100
|
-
else if (key === 'borderInlineEndColor') {
|
|
101
|
-
attr = borderInlineEndColor(isRTL);
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
attr = borderColors[key];
|
|
105
|
-
}
|
|
106
|
-
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
107
|
-
styles[attr] = value;
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
if (key in borderRadii) {
|
|
111
|
-
var propValue = props[key];
|
|
112
|
-
var value = tokens_1.borderRadius[propValue] || propValue;
|
|
113
|
-
var attr = borderRadii[key];
|
|
114
|
-
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
115
|
-
styles[attr] = value;
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
if (key in borderStyles) {
|
|
119
|
-
var value = props[key];
|
|
120
|
-
var attr = void 0;
|
|
121
|
-
if (key === 'borderInlineStartStyle') {
|
|
122
|
-
attr = borderInlineStartStyle(isRTL);
|
|
123
|
-
}
|
|
124
|
-
else if (key === 'borderInlineEndStyle') {
|
|
125
|
-
attr = borderInlineEndStyle(isRTL);
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
attr = borderStyles[key];
|
|
129
|
-
}
|
|
130
|
-
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
131
|
-
styles[attr] = value;
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
if (key in borderWidths) {
|
|
135
|
-
var value = props[key];
|
|
136
|
-
var attr = void 0;
|
|
137
|
-
if (key === 'borderInlineStartWidth') {
|
|
138
|
-
attr = borderInlineStartWidth(isRTL);
|
|
139
|
-
}
|
|
140
|
-
else if (key === 'borderInlineEndWidth') {
|
|
141
|
-
attr = borderInlineEndWidth(isRTL);
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
attr = borderWidths[key];
|
|
145
|
-
}
|
|
146
|
-
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
147
|
-
styles[attr] = value;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return styles;
|
|
152
|
-
}
|
|
153
|
-
exports.border = border;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Property } from 'csstype';
|
|
2
|
-
import { CanvasTypeProperties } from '@workday/canvas-kit-react/tokens';
|
|
3
|
-
export declare type FontFamilyTokens = keyof CanvasTypeProperties['fontFamilies'];
|
|
4
|
-
export declare type FontSizeTokens = keyof CanvasTypeProperties['fontSizes'];
|
|
5
|
-
export declare type FontWeightTokens = keyof CanvasTypeProperties['fontWeights'];
|
|
6
|
-
/** style props to for color properties */
|
|
7
|
-
export declare type FontStyleProps = {
|
|
8
|
-
/** sets `font-family` property */
|
|
9
|
-
fontFamily?: Property.FontFamily | FontFamilyTokens;
|
|
10
|
-
/** sets `font-size` property */
|
|
11
|
-
fontSize?: Property.FontSize | FontSizeTokens;
|
|
12
|
-
/** sets `font-style` property */
|
|
13
|
-
fontStyle?: Property.FontStyle;
|
|
14
|
-
/** sets `font-weight` property */
|
|
15
|
-
fontWeight?: Property.FontWeight | FontWeightTokens;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* A style prop function that takes components props and returns font styles from canvas token values.
|
|
19
|
-
* If no `FontStyleProps` are found, it returns an empty object.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* // You'll most likely use `font` with low-level, styled components
|
|
23
|
-
* const BoxExample = () => (
|
|
24
|
-
* <Box fontFamily="monospace" fontWeight="medium">Hello, fonts!</Box>
|
|
25
|
-
* );
|
|
26
|
-
*
|
|
27
|
-
*/
|
|
28
|
-
export declare function font<P extends FontStyleProps>(props: P): {};
|
|
29
|
-
//# sourceMappingURL=font.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"font.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/font.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AACjC,OAAO,EAAO,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AAE5E,oBAAY,gBAAgB,GAAG,MAAM,oBAAoB,CAAC,cAAc,CAAC,CAAC;AAC1E,oBAAY,cAAc,GAAG,MAAM,oBAAoB,CAAC,WAAW,CAAC,CAAC;AACrE,oBAAY,gBAAgB,GAAG,MAAM,oBAAoB,CAAC,aAAa,CAAC,CAAC;AAGzE,0CAA0C;AAC1C,oBAAY,cAAc,GAAG;IAC3B,kCAAkC;IAClC,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,GAAG,gBAAgB,CAAC;IACpD,gCAAgC;IAChC,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,GAAG,cAAc,CAAC;IAC9C,iCAAiC;IACjC,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC/B,kCAAkC;IAClC,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,GAAG,gBAAgB,CAAC;CACrD,CAAC;AAyBF;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,cAAc,EAAE,KAAK,EAAE,CAAC,MAYtD"}
|
|
@@ -1,57 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.font = void 0;
|
|
15
|
-
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
16
|
-
var getFontFamily = function (value) { return ({
|
|
17
|
-
fontFamily: tokens_1.type.properties.fontFamilies[value] || value,
|
|
18
|
-
}); };
|
|
19
|
-
var getFontSize = function (value) { return ({
|
|
20
|
-
fontSize: tokens_1.type.properties.fontSizes[value] || value,
|
|
21
|
-
}); };
|
|
22
|
-
var getFontStyle = function (value) { return ({
|
|
23
|
-
fontStyle: value,
|
|
24
|
-
}); };
|
|
25
|
-
var getFontWeight = function (value) { return ({
|
|
26
|
-
fontWeight: tokens_1.type.properties.fontWeights[value] || value,
|
|
27
|
-
}); };
|
|
28
|
-
var fontProps = {
|
|
29
|
-
fontFamily: getFontFamily,
|
|
30
|
-
fontSize: getFontSize,
|
|
31
|
-
fontWeight: getFontWeight,
|
|
32
|
-
fontStyle: getFontStyle,
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* A style prop function that takes components props and returns font styles from canvas token values.
|
|
36
|
-
* If no `FontStyleProps` are found, it returns an empty object.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* // You'll most likely use `font` with low-level, styled components
|
|
40
|
-
* const BoxExample = () => (
|
|
41
|
-
* <Box fontFamily="monospace" fontWeight="medium">Hello, fonts!</Box>
|
|
42
|
-
* );
|
|
43
|
-
*
|
|
44
|
-
*/
|
|
45
|
-
function font(props) {
|
|
46
|
-
var styles = {};
|
|
47
|
-
for (var key in props) {
|
|
48
|
-
if (key in fontProps) {
|
|
49
|
-
var value = props[key];
|
|
50
|
-
var fontFn = fontProps[key];
|
|
51
|
-
var style = fontFn(value);
|
|
52
|
-
styles = __assign(__assign({}, styles), style);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return styles;
|
|
56
|
-
}
|
|
57
|
-
exports.font = font;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { PartialEmotionCanvasTheme } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { CSSProperties } from '@workday/canvas-kit-react/tokens';
|
|
4
|
-
export declare const convertToStaticStates: (obj?: CSSProperties | undefined) => CSSProperties | undefined;
|
|
5
|
-
export declare const StaticStates: React.FC<React.PropsWithChildren<{
|
|
6
|
-
theme?: PartialEmotionCanvasTheme;
|
|
7
|
-
} & React.HTMLAttributes<HTMLElement>>>;
|
|
8
|
-
//# sourceMappingURL=StaticStates.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StaticStates.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/StaticStates.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIL,yBAAyB,EAC1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAE/D,eAAO,MAAM,qBAAqB,uCAA0B,aAAa,GAAG,SAoB3E,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CACzD;IAAC,KAAK,CAAC,EAAE,yBAAyB,CAAA;CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CACxE,CASA,CAAC"}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { CanvasBorderRadiusKeys, CanvasColor } from '@workday/canvas-kit-react/tokens';
|
|
2
|
-
import { PartialEmotionCanvasTheme } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { Property } from 'csstype';
|
|
4
|
-
/** style props to set the border properties */
|
|
5
|
-
export declare type BorderShorthandStyleProps = {
|
|
6
|
-
/** sets `border` property */
|
|
7
|
-
border?: string;
|
|
8
|
-
/** sets `border-top` property */
|
|
9
|
-
borderTop?: string;
|
|
10
|
-
/** sets `border-right` property (no bidirectional support) */
|
|
11
|
-
borderRight?: string;
|
|
12
|
-
/** sets `border-bottom` property */
|
|
13
|
-
borderBottom?: string;
|
|
14
|
-
/** sets `border-left` property (no bidirectional support) */
|
|
15
|
-
borderLeft?: string;
|
|
16
|
-
};
|
|
17
|
-
/** style props to set the border color properties */
|
|
18
|
-
export declare type BorderColorStyleProps = {
|
|
19
|
-
/** sets `border-color` property */
|
|
20
|
-
borderColor?: CanvasColor | (string & {});
|
|
21
|
-
/** sets `border-top-color` property */
|
|
22
|
-
borderTopColor?: CanvasColor | (string & {});
|
|
23
|
-
/** sets `border-right-color` property (no bidirectional support) */
|
|
24
|
-
borderRightColor?: CanvasColor | (string & {});
|
|
25
|
-
/** sets `border-bottom-color` property */
|
|
26
|
-
borderBottomColor?: CanvasColor | (string & {});
|
|
27
|
-
/** sets `border-left-color` property (no bidirectional support) */
|
|
28
|
-
borderLeftColor?: CanvasColor | (string & {});
|
|
29
|
-
};
|
|
30
|
-
/** style props to set the border radius properties */
|
|
31
|
-
export declare type BorderRadiusStyleProps = {
|
|
32
|
-
/** sets `border-radius` property */
|
|
33
|
-
borderRadius?: CanvasBorderRadiusKeys | number | (string & {});
|
|
34
|
-
/** sets `border-top-left-radius` property */
|
|
35
|
-
borderTopLeftRadius?: CanvasBorderRadiusKeys | number | (string & {});
|
|
36
|
-
/** sets `border-top-right-radius` property */
|
|
37
|
-
borderTopRightRadius?: CanvasBorderRadiusKeys | number | (string & {});
|
|
38
|
-
/** sets `border-bottom-left-radius` property */
|
|
39
|
-
borderBottomLeftRadius?: CanvasBorderRadiusKeys | number | (string & {});
|
|
40
|
-
/** sets `border-bottom-right-radius` property */
|
|
41
|
-
borderBottomRightRadius?: CanvasBorderRadiusKeys | number | (string & {});
|
|
42
|
-
};
|
|
43
|
-
/** style props to set the border style properties */
|
|
44
|
-
export declare type BorderLineStyleProps = {
|
|
45
|
-
/** sets `border-style` property */
|
|
46
|
-
borderStyle?: Property.Border;
|
|
47
|
-
/** sets `border-top-style` property */
|
|
48
|
-
borderTopStyle?: Property.Border;
|
|
49
|
-
/** sets `border-right-style` property (no bidirectional support) */
|
|
50
|
-
borderRightStyle?: Property.Border;
|
|
51
|
-
/** sets `border-bottom-style` property */
|
|
52
|
-
borderBottomStyle?: Property.Border;
|
|
53
|
-
/** sets `border-left-style` property (no bidirectional support) */
|
|
54
|
-
borderLeftStyle?: Property.Border;
|
|
55
|
-
};
|
|
56
|
-
/** style props to set the border width properties */
|
|
57
|
-
export declare type BorderWidthStyleProps = {
|
|
58
|
-
/** sets `border-width` property */
|
|
59
|
-
borderWidth?: string | number;
|
|
60
|
-
/** sets `border-top-width` property */
|
|
61
|
-
borderTopWidth?: string | number;
|
|
62
|
-
/** sets `border-right-width` property (no bidirectional support) */
|
|
63
|
-
borderRightWidth?: string | number;
|
|
64
|
-
/** sets `border-bottom-width` property */
|
|
65
|
-
borderBottomWidth?: string | number;
|
|
66
|
-
/** sets `border-left-width` property (no bidirectional support) */
|
|
67
|
-
borderLeftWidth?: string | number;
|
|
68
|
-
};
|
|
69
|
-
export declare type BorderLogicalStyleProps = {
|
|
70
|
-
/** sets `border-left` property (bidirectional support) */
|
|
71
|
-
borderInlineStart?: string;
|
|
72
|
-
/** sets `border-left-color` property (bidirectional support) */
|
|
73
|
-
borderInlineStartColor?: CanvasColor | (string & {});
|
|
74
|
-
/** sets `border-left-style` property (bidirectional support) */
|
|
75
|
-
borderInlineStartStyle?: Property.Border;
|
|
76
|
-
/** sets `border-left-width` property (bidirectional support) */
|
|
77
|
-
borderInlineStartWidth?: string | number;
|
|
78
|
-
/** sets `border-right` property (bidirectional support) */
|
|
79
|
-
borderInlineEnd?: string;
|
|
80
|
-
/** sets `border-right-color` property (bidirectional support) */
|
|
81
|
-
borderInlineEndColor?: CanvasColor | (string & {});
|
|
82
|
-
/** sets `border-right-style` property (bidirectional support) */
|
|
83
|
-
borderInlineEndStyle?: Property.Border;
|
|
84
|
-
/** sets `border-right-width` property (bidirectional support) */
|
|
85
|
-
borderInlineEndWidth?: string | number;
|
|
86
|
-
};
|
|
87
|
-
/** a collection style props for border properties */
|
|
88
|
-
export declare type BorderStyleProps = BorderShorthandStyleProps & BorderColorStyleProps & BorderRadiusStyleProps & BorderLineStyleProps & BorderWidthStyleProps & BorderLogicalStyleProps;
|
|
89
|
-
/**
|
|
90
|
-
* A style prop function that takes components props and returns border styles. Some props, such as borderRadius and borderColor, are connected to our design tokens.
|
|
91
|
-
* If no `BorderStyleProps` are found, it returns an empty object.
|
|
92
|
-
*
|
|
93
|
-
* @example
|
|
94
|
-
* // You'll most likely use `border` with low-level, styled components
|
|
95
|
-
* const BoxExample = () => (
|
|
96
|
-
* <Box border={`solid 1px #333333 ${colors.blackPepper400}`}>Hello, border styles!</Box>
|
|
97
|
-
* );
|
|
98
|
-
*
|
|
99
|
-
*/
|
|
100
|
-
export declare function border<P extends BorderStyleProps & {
|
|
101
|
-
theme?: PartialEmotionCanvasTheme;
|
|
102
|
-
}>(props: P): {};
|
|
103
|
-
//# sourceMappingURL=border.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"border.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/border.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,EAEtB,WAAW,EACZ,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAEL,yBAAyB,EAE1B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,+CAA+C;AAC/C,oBAAY,yBAAyB,GAAG;IACtC,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,qD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AAqB,GACrB,sBAAsB,GACtB,oBAAoB,GACpB,qBAAqB,GACrB,uBAAuB,CAAC;AA4D1B;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,gBAAgB,GAAG;IAAC,KAAK,CAAC,EAAE,yBAAyB,CAAA;CAAC,EAAE,KAAK,EAAE,CAAC,MAkFhG"}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { borderRadius as borderRadiusTokens, colors as colorTokens, } from '@workday/canvas-kit-react/tokens';
|
|
2
|
-
import { ContentDirection, useTheme, } from '@workday/canvas-kit-react/common';
|
|
3
|
-
// border logical prop handlers
|
|
4
|
-
var borderInlineStart = function (isRTL) { return (isRTL ? 'borderRight' : 'borderLeft'); };
|
|
5
|
-
var borderInlineEnd = function (isRTL) { return (isRTL ? 'borderLeft' : 'borderRight'); };
|
|
6
|
-
var borderInlineStartColor = function (isRTL) { return (isRTL ? 'borderRightColor' : 'borderLeftColor'); };
|
|
7
|
-
var borderInlineEndColor = function (isRTL) { return (isRTL ? 'borderLeftColor' : 'borderRightColor'); };
|
|
8
|
-
var borderInlineStartStyle = function (isRTL) { return (isRTL ? 'borderRightStyle' : 'borderLeftStyle'); };
|
|
9
|
-
var borderInlineEndStyle = function (isRTL) { return (isRTL ? 'borderLeftStyle' : 'borderRightStyle'); };
|
|
10
|
-
var borderInlineStartWidth = function (isRTL) { return (isRTL ? 'borderRightWidth' : 'borderLeftWidth'); };
|
|
11
|
-
var borderInlineEndWidth = function (isRTL) { return (isRTL ? 'borderLeftWidth' : 'borderRightWidth'); };
|
|
12
|
-
var borderShorthandProps = {
|
|
13
|
-
border: 'border',
|
|
14
|
-
borderTop: 'borderTop',
|
|
15
|
-
borderRight: 'borderRight',
|
|
16
|
-
borderBottom: 'borderBottom',
|
|
17
|
-
borderLeft: 'borderLeft',
|
|
18
|
-
borderInlineStart: borderInlineStart,
|
|
19
|
-
borderInlineEnd: borderInlineEnd,
|
|
20
|
-
};
|
|
21
|
-
var borderColors = {
|
|
22
|
-
borderColor: 'borderColor',
|
|
23
|
-
borderTopColor: 'borderTopColor',
|
|
24
|
-
borderRightColor: 'borderRightColor',
|
|
25
|
-
borderBottomColor: 'borderBottomColor',
|
|
26
|
-
borderLeftColor: 'borderLeftColor',
|
|
27
|
-
borderInlineStartColor: borderInlineStartColor,
|
|
28
|
-
borderInlineEndColor: borderInlineEndColor,
|
|
29
|
-
};
|
|
30
|
-
var borderRadii = {
|
|
31
|
-
borderRadius: 'borderRadius',
|
|
32
|
-
borderTopLeftRadius: 'borderTopLeftRadius',
|
|
33
|
-
borderTopRightRadius: 'borderTopRightRadius',
|
|
34
|
-
borderBottomLeftRadius: 'borderBottomLeftRadius',
|
|
35
|
-
borderBottomRightRadius: 'borderBottomRightRadius',
|
|
36
|
-
};
|
|
37
|
-
var borderStyles = {
|
|
38
|
-
borderStyle: 'borderStyle',
|
|
39
|
-
borderTopStyle: 'borderTopStyle',
|
|
40
|
-
borderRightStyle: 'borderRightStyle',
|
|
41
|
-
borderBottomStyle: 'borderBottomStyle',
|
|
42
|
-
borderLeftStyle: 'borderLeftStyle',
|
|
43
|
-
borderInlineStartStyle: borderInlineStartStyle,
|
|
44
|
-
borderInlineEndStyle: borderInlineEndStyle,
|
|
45
|
-
};
|
|
46
|
-
var borderWidths = {
|
|
47
|
-
borderWidth: 'borderWidth',
|
|
48
|
-
borderTopWidth: 'borderTopWidth',
|
|
49
|
-
borderRightWidth: 'borderRightWidth',
|
|
50
|
-
borderBottomWidth: 'borderBottomWidth',
|
|
51
|
-
borderLeftWidth: 'borderLeftWidth',
|
|
52
|
-
borderInlineStartWidth: borderInlineStartWidth,
|
|
53
|
-
borderInlineEndWidth: borderInlineEndWidth,
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* A style prop function that takes components props and returns border styles. Some props, such as borderRadius and borderColor, are connected to our design tokens.
|
|
57
|
-
* If no `BorderStyleProps` are found, it returns an empty object.
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* // You'll most likely use `border` with low-level, styled components
|
|
61
|
-
* const BoxExample = () => (
|
|
62
|
-
* <Box border={`solid 1px #333333 ${colors.blackPepper400}`}>Hello, border styles!</Box>
|
|
63
|
-
* );
|
|
64
|
-
*
|
|
65
|
-
*/
|
|
66
|
-
export function border(props) {
|
|
67
|
-
// border will always be used within the context of a component, but eslint doesn't know that
|
|
68
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
69
|
-
var canvas = useTheme(props.theme).canvas;
|
|
70
|
-
var isRTL = canvas.direction === ContentDirection.RTL;
|
|
71
|
-
var styles = {};
|
|
72
|
-
for (var key in props) {
|
|
73
|
-
if (props.hasOwnProperty(key)) {
|
|
74
|
-
if (key in borderShorthandProps) {
|
|
75
|
-
var value = props[key];
|
|
76
|
-
var attr = void 0;
|
|
77
|
-
if (key === 'borderInlineStart') {
|
|
78
|
-
attr = borderInlineStart(isRTL);
|
|
79
|
-
}
|
|
80
|
-
else if (key === 'borderInlineEnd') {
|
|
81
|
-
attr = borderInlineEnd(isRTL);
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
attr = borderShorthandProps[key];
|
|
85
|
-
}
|
|
86
|
-
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
87
|
-
styles[attr] = value;
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
if (key in borderColors) {
|
|
91
|
-
var propValue = props[key];
|
|
92
|
-
var value = colorTokens[propValue] || propValue;
|
|
93
|
-
var attr = void 0;
|
|
94
|
-
if (key === 'borderInlineStartColor') {
|
|
95
|
-
attr = borderInlineStartColor(isRTL);
|
|
96
|
-
}
|
|
97
|
-
else if (key === 'borderInlineEndColor') {
|
|
98
|
-
attr = borderInlineEndColor(isRTL);
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
attr = borderColors[key];
|
|
102
|
-
}
|
|
103
|
-
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
104
|
-
styles[attr] = value;
|
|
105
|
-
continue;
|
|
106
|
-
}
|
|
107
|
-
if (key in borderRadii) {
|
|
108
|
-
var propValue = props[key];
|
|
109
|
-
var value = borderRadiusTokens[propValue] || propValue;
|
|
110
|
-
var attr = borderRadii[key];
|
|
111
|
-
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
112
|
-
styles[attr] = value;
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
if (key in borderStyles) {
|
|
116
|
-
var value = props[key];
|
|
117
|
-
var attr = void 0;
|
|
118
|
-
if (key === 'borderInlineStartStyle') {
|
|
119
|
-
attr = borderInlineStartStyle(isRTL);
|
|
120
|
-
}
|
|
121
|
-
else if (key === 'borderInlineEndStyle') {
|
|
122
|
-
attr = borderInlineEndStyle(isRTL);
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
attr = borderStyles[key];
|
|
126
|
-
}
|
|
127
|
-
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
128
|
-
styles[attr] = value;
|
|
129
|
-
continue;
|
|
130
|
-
}
|
|
131
|
-
if (key in borderWidths) {
|
|
132
|
-
var value = props[key];
|
|
133
|
-
var attr = void 0;
|
|
134
|
-
if (key === 'borderInlineStartWidth') {
|
|
135
|
-
attr = borderInlineStartWidth(isRTL);
|
|
136
|
-
}
|
|
137
|
-
else if (key === 'borderInlineEndWidth') {
|
|
138
|
-
attr = borderInlineEndWidth(isRTL);
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
attr = borderWidths[key];
|
|
142
|
-
}
|
|
143
|
-
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
144
|
-
styles[attr] = value;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return styles;
|
|
149
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Property } from 'csstype';
|
|
2
|
-
import { CanvasTypeProperties } from '@workday/canvas-kit-react/tokens';
|
|
3
|
-
export declare type FontFamilyTokens = keyof CanvasTypeProperties['fontFamilies'];
|
|
4
|
-
export declare type FontSizeTokens = keyof CanvasTypeProperties['fontSizes'];
|
|
5
|
-
export declare type FontWeightTokens = keyof CanvasTypeProperties['fontWeights'];
|
|
6
|
-
/** style props to for color properties */
|
|
7
|
-
export declare type FontStyleProps = {
|
|
8
|
-
/** sets `font-family` property */
|
|
9
|
-
fontFamily?: Property.FontFamily | FontFamilyTokens;
|
|
10
|
-
/** sets `font-size` property */
|
|
11
|
-
fontSize?: Property.FontSize | FontSizeTokens;
|
|
12
|
-
/** sets `font-style` property */
|
|
13
|
-
fontStyle?: Property.FontStyle;
|
|
14
|
-
/** sets `font-weight` property */
|
|
15
|
-
fontWeight?: Property.FontWeight | FontWeightTokens;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* A style prop function that takes components props and returns font styles from canvas token values.
|
|
19
|
-
* If no `FontStyleProps` are found, it returns an empty object.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* // You'll most likely use `font` with low-level, styled components
|
|
23
|
-
* const BoxExample = () => (
|
|
24
|
-
* <Box fontFamily="monospace" fontWeight="medium">Hello, fonts!</Box>
|
|
25
|
-
* );
|
|
26
|
-
*
|
|
27
|
-
*/
|
|
28
|
-
export declare function font<P extends FontStyleProps>(props: P): {};
|
|
29
|
-
//# sourceMappingURL=font.d.ts.map
|