@workday/canvas-kit-labs-react 7.0.0-alpha.0-next.5 → 7.0.0-alpha.78-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/combobox/README.md +1 -1
- package/combobox/lib/Combobox.tsx +6 -10
- package/common/index.ts +0 -8
- package/dist/commonjs/combobox/lib/Combobox.d.ts +3 -4
- package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/Combobox.js +3 -6
- package/dist/commonjs/common/index.d.ts +0 -8
- package/dist/commonjs/common/index.d.ts.map +1 -1
- package/dist/commonjs/common/index.js +0 -1
- package/dist/commonjs/drawer/lib/DrawerHeader.js +2 -2
- package/dist/commonjs/index.d.ts +0 -2
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +0 -2
- package/dist/commonjs/search-form/lib/SearchForm.d.ts +7 -2
- package/dist/commonjs/search-form/lib/SearchForm.d.ts.map +1 -1
- package/dist/commonjs/search-form/lib/SearchForm.js +16 -22
- package/dist/es6/combobox/lib/Combobox.d.ts +3 -4
- package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/es6/combobox/lib/Combobox.js +4 -7
- package/dist/es6/common/index.d.ts +0 -8
- package/dist/es6/common/index.d.ts.map +1 -1
- package/dist/es6/common/index.js +0 -1
- package/dist/es6/drawer/lib/DrawerHeader.js +3 -3
- package/dist/es6/index.d.ts +0 -2
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +0 -2
- package/dist/es6/search-form/lib/SearchForm.d.ts +7 -2
- package/dist/es6/search-form/lib/SearchForm.d.ts.map +1 -1
- package/dist/es6/search-form/lib/SearchForm.js +17 -23
- package/drawer/lib/DrawerHeader.tsx +3 -3
- package/index.ts +0 -2
- package/package.json +4 -6
- package/search-form/lib/SearchForm.tsx +25 -37
- package/ts3.5/dist/commonjs/combobox/lib/Combobox.d.ts +3 -4
- package/ts3.5/dist/commonjs/common/index.d.ts +0 -8
- package/ts3.5/dist/commonjs/index.d.ts +0 -2
- package/ts3.5/dist/commonjs/search-form/lib/SearchForm.d.ts +7 -2
- package/ts3.5/dist/es6/combobox/lib/Combobox.d.ts +3 -4
- package/ts3.5/dist/es6/common/index.d.ts +0 -8
- package/ts3.5/dist/es6/index.d.ts +0 -2
- package/ts3.5/dist/es6/search-form/lib/SearchForm.d.ts +7 -2
- package/common/lib/Box.tsx +0 -92
- package/common/lib/utils/border.ts +0 -263
- package/common/lib/utils/color.ts +0 -62
- package/common/lib/utils/depth.ts +0 -37
- package/common/lib/utils/flexItem.ts +0 -56
- package/common/lib/utils/layout.ts +0 -77
- package/common/lib/utils/other.ts +0 -20
- package/common/lib/utils/position.ts +0 -96
- package/common/lib/utils/space.ts +0 -207
- package/common/lib/utils/types.ts +0 -105
- package/dist/commonjs/common/lib/Box.d.ts +0 -31
- package/dist/commonjs/common/lib/Box.d.ts.map +0 -1
- package/dist/commonjs/common/lib/Box.js +0 -99
- package/dist/commonjs/common/lib/utils/border.d.ts +0 -103
- package/dist/commonjs/common/lib/utils/border.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/border.js +0 -153
- package/dist/commonjs/common/lib/utils/color.d.ts +0 -26
- package/dist/commonjs/common/lib/utils/color.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/color.js +0 -57
- package/dist/commonjs/common/lib/utils/depth.d.ts +0 -22
- package/dist/commonjs/common/lib/utils/depth.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/depth.js +0 -29
- package/dist/commonjs/common/lib/utils/flexItem.d.ts +0 -33
- package/dist/commonjs/common/lib/utils/flexItem.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/flexItem.js +0 -39
- package/dist/commonjs/common/lib/utils/layout.d.ts +0 -43
- package/dist/commonjs/common/lib/utils/layout.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/layout.js +0 -43
- package/dist/commonjs/common/lib/utils/other.d.ts +0 -5
- package/dist/commonjs/common/lib/utils/other.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/other.js +0 -19
- package/dist/commonjs/common/lib/utils/position.d.ts +0 -41
- package/dist/commonjs/common/lib/utils/position.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/position.js +0 -78
- package/dist/commonjs/common/lib/utils/space.d.ts +0 -64
- package/dist/commonjs/common/lib/utils/space.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/space.js +0 -161
- package/dist/commonjs/common/lib/utils/types.d.ts +0 -14
- package/dist/commonjs/common/lib/utils/types.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/types.js +0 -2
- package/dist/commonjs/header/index.d.ts +0 -9
- package/dist/commonjs/header/index.d.ts.map +0 -1
- package/dist/commonjs/header/index.js +0 -24
- package/dist/commonjs/header/lib/GlobalHeader.d.ts +0 -38
- package/dist/commonjs/header/lib/GlobalHeader.d.ts.map +0 -1
- package/dist/commonjs/header/lib/GlobalHeader.js +0 -86
- package/dist/commonjs/header/lib/Header.d.ts +0 -76
- package/dist/commonjs/header/lib/Header.d.ts.map +0 -1
- package/dist/commonjs/header/lib/Header.js +0 -333
- package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +0 -30
- package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts.map +0 -1
- package/dist/commonjs/header/lib/parts/DubLogoTitle.js +0 -118
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +0 -31
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts.map +0 -1
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.js +0 -137
- package/dist/commonjs/header/lib/parts/index.d.ts +0 -3
- package/dist/commonjs/header/lib/parts/index.d.ts.map +0 -1
- package/dist/commonjs/header/lib/parts/index.js +0 -7
- package/dist/commonjs/header/lib/shared/themes.d.ts +0 -43
- package/dist/commonjs/header/lib/shared/themes.d.ts.map +0 -1
- package/dist/commonjs/header/lib/shared/themes.js +0 -63
- package/dist/commonjs/header/lib/shared/types.d.ts +0 -15
- package/dist/commonjs/header/lib/shared/types.d.ts.map +0 -1
- package/dist/commonjs/header/lib/shared/types.js +0 -20
- package/dist/commonjs/layout/index.d.ts +0 -5
- package/dist/commonjs/layout/index.d.ts.map +0 -1
- package/dist/commonjs/layout/index.js +0 -14
- package/dist/commonjs/layout/lib/Flex.d.ts +0 -26
- package/dist/commonjs/layout/lib/Flex.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/Flex.js +0 -83
- package/dist/commonjs/layout/lib/Stack.d.ts +0 -27
- package/dist/commonjs/layout/lib/Stack.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/Stack.js +0 -99
- package/dist/commonjs/layout/lib/utils/flex.d.ts +0 -36
- package/dist/commonjs/layout/lib/utils/flex.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/flex.js +0 -38
- package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +0 -3
- package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/getValidChildren.js +0 -29
- package/dist/commonjs/layout/lib/utils/stack.d.ts +0 -26
- package/dist/commonjs/layout/lib/utils/stack.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/stack.js +0 -55
- package/dist/commonjs/layout/lib/utils/types.d.ts +0 -8
- package/dist/commonjs/layout/lib/utils/types.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/types.js +0 -2
- package/dist/es6/common/lib/Box.d.ts +0 -31
- package/dist/es6/common/lib/Box.d.ts.map +0 -1
- package/dist/es6/common/lib/Box.js +0 -74
- package/dist/es6/common/lib/utils/border.d.ts +0 -103
- package/dist/es6/common/lib/utils/border.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/border.js +0 -149
- package/dist/es6/common/lib/utils/color.d.ts +0 -26
- package/dist/es6/common/lib/utils/color.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/color.js +0 -53
- package/dist/es6/common/lib/utils/depth.d.ts +0 -22
- package/dist/es6/common/lib/utils/depth.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/depth.js +0 -25
- package/dist/es6/common/lib/utils/flexItem.d.ts +0 -33
- package/dist/es6/common/lib/utils/flexItem.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/flexItem.js +0 -35
- package/dist/es6/common/lib/utils/layout.d.ts +0 -43
- package/dist/es6/common/lib/utils/layout.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/layout.js +0 -39
- package/dist/es6/common/lib/utils/other.d.ts +0 -5
- package/dist/es6/common/lib/utils/other.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/other.js +0 -15
- package/dist/es6/common/lib/utils/position.d.ts +0 -41
- package/dist/es6/common/lib/utils/position.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/position.js +0 -74
- package/dist/es6/common/lib/utils/space.d.ts +0 -64
- package/dist/es6/common/lib/utils/space.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/space.js +0 -157
- package/dist/es6/common/lib/utils/types.d.ts +0 -14
- package/dist/es6/common/lib/utils/types.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/types.js +0 -1
- package/dist/es6/header/index.d.ts +0 -9
- package/dist/es6/header/index.d.ts.map +0 -1
- package/dist/es6/header/index.js +0 -8
- package/dist/es6/header/lib/GlobalHeader.d.ts +0 -38
- package/dist/es6/header/lib/GlobalHeader.d.ts.map +0 -1
- package/dist/es6/header/lib/GlobalHeader.js +0 -62
- package/dist/es6/header/lib/Header.d.ts +0 -76
- package/dist/es6/header/lib/Header.d.ts.map +0 -1
- package/dist/es6/header/lib/Header.js +0 -309
- package/dist/es6/header/lib/parts/DubLogoTitle.d.ts +0 -30
- package/dist/es6/header/lib/parts/DubLogoTitle.d.ts.map +0 -1
- package/dist/es6/header/lib/parts/DubLogoTitle.js +0 -93
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +0 -31
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts.map +0 -1
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.js +0 -112
- package/dist/es6/header/lib/parts/index.d.ts +0 -3
- package/dist/es6/header/lib/parts/index.d.ts.map +0 -1
- package/dist/es6/header/lib/parts/index.js +0 -2
- package/dist/es6/header/lib/shared/themes.d.ts +0 -43
- package/dist/es6/header/lib/shared/themes.d.ts.map +0 -1
- package/dist/es6/header/lib/shared/themes.js +0 -57
- package/dist/es6/header/lib/shared/types.d.ts +0 -15
- package/dist/es6/header/lib/shared/types.d.ts.map +0 -1
- package/dist/es6/header/lib/shared/types.js +0 -17
- package/dist/es6/layout/index.d.ts +0 -5
- package/dist/es6/layout/index.d.ts.map +0 -1
- package/dist/es6/layout/index.js +0 -2
- package/dist/es6/layout/lib/Flex.d.ts +0 -26
- package/dist/es6/layout/lib/Flex.d.ts.map +0 -1
- package/dist/es6/layout/lib/Flex.js +0 -58
- package/dist/es6/layout/lib/Stack.d.ts +0 -27
- package/dist/es6/layout/lib/Stack.d.ts.map +0 -1
- package/dist/es6/layout/lib/Stack.js +0 -74
- package/dist/es6/layout/lib/utils/flex.d.ts +0 -36
- package/dist/es6/layout/lib/utils/flex.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/flex.js +0 -34
- package/dist/es6/layout/lib/utils/getValidChildren.d.ts +0 -3
- package/dist/es6/layout/lib/utils/getValidChildren.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/getValidChildren.js +0 -6
- package/dist/es6/layout/lib/utils/stack.d.ts +0 -26
- package/dist/es6/layout/lib/utils/stack.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/stack.js +0 -51
- package/dist/es6/layout/lib/utils/types.d.ts +0 -8
- package/dist/es6/layout/lib/utils/types.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/types.js +0 -1
- package/header/LICENSE +0 -51
- package/header/README.md +0 -359
- package/header/index.ts +0 -9
- package/header/lib/GlobalHeader.tsx +0 -73
- package/header/lib/Header.tsx +0 -429
- package/header/lib/parts/DubLogoTitle.tsx +0 -99
- package/header/lib/parts/WorkdayLogoTitle.tsx +0 -120
- package/header/lib/parts/index.ts +0 -2
- package/header/lib/shared/themes.tsx +0 -97
- package/header/lib/shared/types.tsx +0 -16
- package/header/package.json +0 -5
- package/layout/LICENSE +0 -52
- package/layout/README.md +0 -16
- package/layout/index.ts +0 -4
- package/layout/lib/Flex.tsx +0 -47
- package/layout/lib/Stack.tsx +0 -95
- package/layout/lib/utils/flex.ts +0 -65
- package/layout/lib/utils/getValidChildren.ts +0 -7
- package/layout/lib/utils/stack.ts +0 -78
- package/layout/lib/utils/types.ts +0 -45
- package/layout/package.json +0 -5
- package/ts3.5/dist/commonjs/common/lib/Box.d.ts +0 -31
- package/ts3.5/dist/commonjs/common/lib/utils/border.d.ts +0 -103
- package/ts3.5/dist/commonjs/common/lib/utils/color.d.ts +0 -26
- package/ts3.5/dist/commonjs/common/lib/utils/depth.d.ts +0 -22
- package/ts3.5/dist/commonjs/common/lib/utils/flexItem.d.ts +0 -33
- package/ts3.5/dist/commonjs/common/lib/utils/layout.d.ts +0 -43
- package/ts3.5/dist/commonjs/common/lib/utils/other.d.ts +0 -5
- package/ts3.5/dist/commonjs/common/lib/utils/position.d.ts +0 -41
- package/ts3.5/dist/commonjs/common/lib/utils/space.d.ts +0 -64
- package/ts3.5/dist/commonjs/common/lib/utils/types.d.ts +0 -14
- package/ts3.5/dist/commonjs/header/index.d.ts +0 -9
- package/ts3.5/dist/commonjs/header/lib/GlobalHeader.d.ts +0 -38
- package/ts3.5/dist/commonjs/header/lib/Header.d.ts +0 -76
- package/ts3.5/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +0 -30
- package/ts3.5/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +0 -31
- package/ts3.5/dist/commonjs/header/lib/parts/index.d.ts +0 -3
- package/ts3.5/dist/commonjs/header/lib/shared/themes.d.ts +0 -43
- package/ts3.5/dist/commonjs/header/lib/shared/types.d.ts +0 -15
- package/ts3.5/dist/commonjs/layout/index.d.ts +0 -5
- package/ts3.5/dist/commonjs/layout/lib/Flex.d.ts +0 -26
- package/ts3.5/dist/commonjs/layout/lib/Stack.d.ts +0 -27
- package/ts3.5/dist/commonjs/layout/lib/utils/flex.d.ts +0 -36
- package/ts3.5/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +0 -3
- package/ts3.5/dist/commonjs/layout/lib/utils/stack.d.ts +0 -26
- package/ts3.5/dist/commonjs/layout/lib/utils/types.d.ts +0 -8
- package/ts3.5/dist/es6/common/lib/Box.d.ts +0 -31
- package/ts3.5/dist/es6/common/lib/utils/border.d.ts +0 -103
- package/ts3.5/dist/es6/common/lib/utils/color.d.ts +0 -26
- package/ts3.5/dist/es6/common/lib/utils/depth.d.ts +0 -22
- package/ts3.5/dist/es6/common/lib/utils/flexItem.d.ts +0 -33
- package/ts3.5/dist/es6/common/lib/utils/layout.d.ts +0 -43
- package/ts3.5/dist/es6/common/lib/utils/other.d.ts +0 -5
- package/ts3.5/dist/es6/common/lib/utils/position.d.ts +0 -41
- package/ts3.5/dist/es6/common/lib/utils/space.d.ts +0 -64
- package/ts3.5/dist/es6/common/lib/utils/types.d.ts +0 -14
- package/ts3.5/dist/es6/header/index.d.ts +0 -9
- package/ts3.5/dist/es6/header/lib/GlobalHeader.d.ts +0 -38
- package/ts3.5/dist/es6/header/lib/Header.d.ts +0 -76
- package/ts3.5/dist/es6/header/lib/parts/DubLogoTitle.d.ts +0 -30
- package/ts3.5/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +0 -31
- package/ts3.5/dist/es6/header/lib/parts/index.d.ts +0 -3
- package/ts3.5/dist/es6/header/lib/shared/themes.d.ts +0 -43
- package/ts3.5/dist/es6/header/lib/shared/types.d.ts +0 -15
- package/ts3.5/dist/es6/layout/index.d.ts +0 -5
- package/ts3.5/dist/es6/layout/lib/Flex.d.ts +0 -26
- package/ts3.5/dist/es6/layout/lib/Stack.d.ts +0 -27
- package/ts3.5/dist/es6/layout/lib/utils/flex.d.ts +0 -36
- package/ts3.5/dist/es6/layout/lib/utils/getValidChildren.d.ts +0 -3
- package/ts3.5/dist/es6/layout/lib/utils/stack.d.ts +0 -26
- package/ts3.5/dist/es6/layout/lib/utils/types.d.ts +0 -8
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ContentDirection,
|
|
3
|
-
PartialEmotionCanvasTheme,
|
|
4
|
-
useTheme,
|
|
5
|
-
} from '@workday/canvas-kit-react/common';
|
|
6
|
-
import {space as spaceTokens, CanvasSpace, CanvasSpaceKeys} from '@workday/canvas-kit-react/tokens';
|
|
7
|
-
|
|
8
|
-
type SpacePropValues = CanvasSpaceKeys | number | (string & {});
|
|
9
|
-
|
|
10
|
-
/** These props automatically adjust for bidirectionality (LTR & RTL) */
|
|
11
|
-
export type SpaceLogicalProps = {
|
|
12
|
-
/** sets margin-left property (bidirectional support) */
|
|
13
|
-
marginInlineStart?: SpacePropValues;
|
|
14
|
-
/** sets margin-right property (bidirectional support) */
|
|
15
|
-
marginInlineEnd?: SpacePropValues;
|
|
16
|
-
/** sets padding-left property (bidirectional support) */
|
|
17
|
-
paddingInlineStart?: SpacePropValues;
|
|
18
|
-
/** sets padding-right property (bidirectional support) */
|
|
19
|
-
paddingInlineEnd?: SpacePropValues;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/** These props do not adjust for bidirectionality (LTR & RTL) */
|
|
23
|
-
export type SpaceStandardProps = {
|
|
24
|
-
/** sets margin property */
|
|
25
|
-
margin?: SpacePropValues;
|
|
26
|
-
/** sets margin-left and margin-right properties */
|
|
27
|
-
marginX?: SpacePropValues;
|
|
28
|
-
/** sets margin-top and margin-bottom properties */
|
|
29
|
-
marginY?: SpacePropValues;
|
|
30
|
-
/** sets margin-top property */
|
|
31
|
-
marginTop?: SpacePropValues;
|
|
32
|
-
/** sets margin-right property (no bidirectional support) */
|
|
33
|
-
marginRight?: SpacePropValues;
|
|
34
|
-
/** sets margin-bottom property */
|
|
35
|
-
marginBottom?: SpacePropValues;
|
|
36
|
-
/** sets margin-left property (no bidirectional support) */
|
|
37
|
-
marginLeft?: SpacePropValues;
|
|
38
|
-
/** sets padding property */
|
|
39
|
-
padding?: SpacePropValues;
|
|
40
|
-
/** sets padding-left and margin-right properties */
|
|
41
|
-
paddingX?: SpacePropValues;
|
|
42
|
-
/** sets padding-top and padding-bottom properties */
|
|
43
|
-
paddingY?: SpacePropValues;
|
|
44
|
-
/** sets padding-top property */
|
|
45
|
-
paddingTop?: SpacePropValues;
|
|
46
|
-
/** sets padding-right property (no bidirectional support) */
|
|
47
|
-
paddingRight?: SpacePropValues;
|
|
48
|
-
/** sets padding-bottom */
|
|
49
|
-
paddingBottom?: SpacePropValues;
|
|
50
|
-
/** sets padding-left property (no bidirectional support) */
|
|
51
|
-
paddingLeft?: SpacePropValues;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export type SpaceStyleProps = SpaceStandardProps & SpaceLogicalProps;
|
|
55
|
-
|
|
56
|
-
const margin = (value: SpacePropValues) => {
|
|
57
|
-
return {margin: spaceTokens[value as keyof CanvasSpace] || value};
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const marginX = (value: SpacePropValues) => {
|
|
61
|
-
return {
|
|
62
|
-
marginLeft: spaceTokens[value as CanvasSpaceKeys] || value,
|
|
63
|
-
marginRight: spaceTokens[value as CanvasSpaceKeys] || value,
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const marginY = (value: SpacePropValues) => {
|
|
68
|
-
return {
|
|
69
|
-
marginTop: spaceTokens[value as CanvasSpaceKeys] || value,
|
|
70
|
-
marginBottom: spaceTokens[value as CanvasSpaceKeys] || value,
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const marginTop = (value: SpacePropValues) => {
|
|
75
|
-
return {
|
|
76
|
-
marginTop: spaceTokens[value as CanvasSpaceKeys] || value,
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const marginRight = (value: SpacePropValues, isRTL = false) => {
|
|
81
|
-
const attr = isRTL ? 'marginLeft' : 'marginRight';
|
|
82
|
-
return {
|
|
83
|
-
[attr]: spaceTokens[value as CanvasSpaceKeys] || value,
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const marginBottom = (value: SpacePropValues) => {
|
|
88
|
-
return {
|
|
89
|
-
marginBottom: spaceTokens[value as CanvasSpaceKeys] || value,
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const marginLeft = (value: SpacePropValues, isRTL = false) => {
|
|
94
|
-
const attr = isRTL ? 'marginRight' : 'marginLeft';
|
|
95
|
-
return {
|
|
96
|
-
[attr]: spaceTokens[value as CanvasSpaceKeys] || value,
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const padding = (value: SpacePropValues) => {
|
|
101
|
-
return {
|
|
102
|
-
padding: spaceTokens[value as CanvasSpaceKeys] || value,
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
const paddingX = (value: SpacePropValues) => {
|
|
107
|
-
return {
|
|
108
|
-
paddingLeft: spaceTokens[value as CanvasSpaceKeys] || value,
|
|
109
|
-
paddingRight: spaceTokens[value as CanvasSpaceKeys] || value,
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
const paddingY = (value: SpacePropValues) => {
|
|
114
|
-
return {
|
|
115
|
-
paddingTop: spaceTokens[value as CanvasSpaceKeys] || value,
|
|
116
|
-
paddingBottom: spaceTokens[value as CanvasSpaceKeys] || value,
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
const paddingTop = (value: SpacePropValues) => {
|
|
121
|
-
return {
|
|
122
|
-
paddingTop: spaceTokens[value as CanvasSpaceKeys] || value,
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
const paddingRight = (value: SpacePropValues, isRTL = false) => {
|
|
127
|
-
const attr = isRTL ? 'paddingLeft' : 'paddingRight';
|
|
128
|
-
return {
|
|
129
|
-
[attr]: spaceTokens[value as CanvasSpaceKeys] || value,
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
const paddingBottom = (value: SpacePropValues) => {
|
|
134
|
-
return {
|
|
135
|
-
paddingBottom: spaceTokens[value as CanvasSpaceKeys] || value,
|
|
136
|
-
};
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
const paddingLeft = (value: SpacePropValues, isRTL = false) => {
|
|
140
|
-
const attr = isRTL ? 'paddingRight' : 'paddingLeft';
|
|
141
|
-
return {
|
|
142
|
-
[attr]: spaceTokens[value as CanvasSpaceKeys] || value,
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
const logicalSpaceStyleProps = {
|
|
147
|
-
marginInlineStart: marginLeft,
|
|
148
|
-
marginInlineEnd: marginRight,
|
|
149
|
-
paddingInlineStart: paddingLeft,
|
|
150
|
-
paddingInlineEnd: paddingRight,
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
const standardSpaceStyleProps = {
|
|
154
|
-
margin,
|
|
155
|
-
marginX,
|
|
156
|
-
marginY,
|
|
157
|
-
marginTop,
|
|
158
|
-
marginRight,
|
|
159
|
-
marginBottom,
|
|
160
|
-
marginLeft,
|
|
161
|
-
padding,
|
|
162
|
-
paddingX,
|
|
163
|
-
paddingY,
|
|
164
|
-
paddingTop,
|
|
165
|
-
paddingRight,
|
|
166
|
-
paddingBottom,
|
|
167
|
-
paddingLeft,
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* A style prop function that takes component props and returns space styles.
|
|
172
|
-
* If no `SpaceStyleProps` are found, it returns an empty object.
|
|
173
|
-
*
|
|
174
|
-
* @example
|
|
175
|
-
* // You'll most likely use `space` with low-level, styled components
|
|
176
|
-
* const BoxExample = () => (
|
|
177
|
-
* <Box padding="xs" margin="m">
|
|
178
|
-
* Hello, space!
|
|
179
|
-
* </Box>
|
|
180
|
-
* );
|
|
181
|
-
*
|
|
182
|
-
*/
|
|
183
|
-
export function space<P extends SpaceStyleProps & {theme?: PartialEmotionCanvasTheme}>(props: P) {
|
|
184
|
-
// space will always be used within the context of a component, but eslint doesn't know that
|
|
185
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
186
|
-
const {canvas} = useTheme(props.theme);
|
|
187
|
-
let styles = {};
|
|
188
|
-
for (const key in props) {
|
|
189
|
-
if (props.hasOwnProperty(key)) {
|
|
190
|
-
if (key in standardSpaceStyleProps) {
|
|
191
|
-
const value = props[key as keyof SpaceStandardProps] as SpacePropValues;
|
|
192
|
-
const spaceFn = standardSpaceStyleProps[key as keyof SpaceStandardProps];
|
|
193
|
-
const style = spaceFn(value);
|
|
194
|
-
styles = {...styles, ...style};
|
|
195
|
-
continue;
|
|
196
|
-
}
|
|
197
|
-
if (key in logicalSpaceStyleProps) {
|
|
198
|
-
const value = props[key as keyof SpaceLogicalProps] as SpacePropValues;
|
|
199
|
-
const spaceFn = logicalSpaceStyleProps[key as keyof SpaceLogicalProps];
|
|
200
|
-
const isRTL = canvas.direction === ContentDirection.RTL;
|
|
201
|
-
const style = spaceFn(value, isRTL);
|
|
202
|
-
styles = {...styles, ...style};
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
return styles;
|
|
207
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Globals,
|
|
3
|
-
GlobalsNumber,
|
|
4
|
-
SelfPosition,
|
|
5
|
-
DisplayOutside,
|
|
6
|
-
DisplayInside,
|
|
7
|
-
DisplayInternal,
|
|
8
|
-
DisplayLegacy,
|
|
9
|
-
LineStyle,
|
|
10
|
-
} from 'csstype';
|
|
11
|
-
|
|
12
|
-
// We're temporarily creating these types from csstype
|
|
13
|
-
// to improve type completion until we move to csstype v3.
|
|
14
|
-
|
|
15
|
-
// Border
|
|
16
|
-
export type PropertyBorder = Globals | LineStyle | (string & {});
|
|
17
|
-
|
|
18
|
-
// Flex Item
|
|
19
|
-
export type PropertyJustifySelf =
|
|
20
|
-
| Globals
|
|
21
|
-
| SelfPosition
|
|
22
|
-
| 'auto'
|
|
23
|
-
| 'baseline'
|
|
24
|
-
| 'left'
|
|
25
|
-
| 'normal'
|
|
26
|
-
| 'right'
|
|
27
|
-
| 'stretch'
|
|
28
|
-
| (string & {});
|
|
29
|
-
|
|
30
|
-
export type PropertyAlignSelf =
|
|
31
|
-
| Globals
|
|
32
|
-
| SelfPosition
|
|
33
|
-
| 'auto'
|
|
34
|
-
| 'baseline'
|
|
35
|
-
| 'normal'
|
|
36
|
-
| 'stretch'
|
|
37
|
-
| (string & {});
|
|
38
|
-
|
|
39
|
-
export type PropertyOrder = GlobalsNumber;
|
|
40
|
-
|
|
41
|
-
// Layout
|
|
42
|
-
export type PropertyDisplay =
|
|
43
|
-
| Globals
|
|
44
|
-
| DisplayOutside
|
|
45
|
-
| DisplayInside
|
|
46
|
-
| DisplayInternal
|
|
47
|
-
| DisplayLegacy
|
|
48
|
-
| 'contents'
|
|
49
|
-
| 'list-item'
|
|
50
|
-
| 'none'
|
|
51
|
-
| (string & {});
|
|
52
|
-
|
|
53
|
-
export type PropertyListStyle = Globals | 'inside' | 'none' | 'outside' | (string & {});
|
|
54
|
-
|
|
55
|
-
export type PropertyOverflow =
|
|
56
|
-
| Globals
|
|
57
|
-
| '-moz-hidden-unscrollable'
|
|
58
|
-
| 'auto'
|
|
59
|
-
| 'clip'
|
|
60
|
-
| 'hidden'
|
|
61
|
-
| 'scroll'
|
|
62
|
-
| 'visible'
|
|
63
|
-
| (string & {});
|
|
64
|
-
|
|
65
|
-
export type PropertyOverflowX =
|
|
66
|
-
| Globals
|
|
67
|
-
| '-moz-hidden-unscrollable'
|
|
68
|
-
| 'auto'
|
|
69
|
-
| 'clip'
|
|
70
|
-
| 'hidden'
|
|
71
|
-
| 'scroll'
|
|
72
|
-
| 'visible';
|
|
73
|
-
|
|
74
|
-
export type PropertyOverflowY =
|
|
75
|
-
| Globals
|
|
76
|
-
| '-moz-hidden-unscrollable'
|
|
77
|
-
| 'auto'
|
|
78
|
-
| 'clip'
|
|
79
|
-
| 'hidden'
|
|
80
|
-
| 'scroll'
|
|
81
|
-
| 'visible';
|
|
82
|
-
|
|
83
|
-
export type PropertyVerticalAlign =
|
|
84
|
-
| Globals
|
|
85
|
-
| 'baseline'
|
|
86
|
-
| 'bottom'
|
|
87
|
-
| 'middle'
|
|
88
|
-
| 'sub'
|
|
89
|
-
| 'super'
|
|
90
|
-
| 'text-bottom'
|
|
91
|
-
| 'text-top'
|
|
92
|
-
| 'top'
|
|
93
|
-
| (string & {});
|
|
94
|
-
|
|
95
|
-
// Position
|
|
96
|
-
export type PropertyPosition =
|
|
97
|
-
| Globals
|
|
98
|
-
| '-webkit-sticky'
|
|
99
|
-
| 'absolute'
|
|
100
|
-
| 'fixed'
|
|
101
|
-
| 'relative'
|
|
102
|
-
| 'static'
|
|
103
|
-
| 'sticky';
|
|
104
|
-
|
|
105
|
-
export type PropertyZIndex = GlobalsNumber | 'auto';
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { BorderStyleProps } from './utils/border';
|
|
3
|
-
import { ColorStyleProps } from './utils/color';
|
|
4
|
-
import { DepthStyleProps } from './utils/depth';
|
|
5
|
-
import { FlexItemStyleProps } from './utils/flexItem';
|
|
6
|
-
import { LayoutStyleProps } from './utils/layout';
|
|
7
|
-
import { OtherStyleProps } from './utils/other';
|
|
8
|
-
import { PositionStyleProps } from './utils/position';
|
|
9
|
-
import { SpaceStyleProps } from './utils/space';
|
|
10
|
-
export declare type BoxProps = BorderStyleProps & ColorStyleProps & DepthStyleProps & FlexItemStyleProps & LayoutStyleProps & OtherStyleProps & PositionStyleProps & SpaceStyleProps & {
|
|
11
|
-
children?: React.ReactNode;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* `Box` is a primitive component that provides a common, ergonomic API around Canvas design tokens.
|
|
15
|
-
* It is highly flexible, and its primary purpose is to build other components.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* import { Box, BoxProps } from '@workday/canvas-kit-labs-react/common';
|
|
19
|
-
*
|
|
20
|
-
* interface CardProps extends BoxProps {
|
|
21
|
-
* // card-specific props
|
|
22
|
-
* }
|
|
23
|
-
*
|
|
24
|
-
* // `Card`'s default values are set using `BoxProps`
|
|
25
|
-
* const Card = (props: CardProps) => (
|
|
26
|
-
* <Box depth={2} padding="m" borderRadius="l" {...props}>Hello, Card!</Box>
|
|
27
|
-
* );
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
export declare const Box: import("@workday/canvas-kit-react/common").ElementComponent<"div", import("./utils/border").BorderShorthandStyleProps & import("./utils/border").BorderColorStyleProps & import("./utils/border").BorderRadiusStyleProps & import("./utils/border").BorderLineStyleProps & import("./utils/border").BorderWidthStyleProps & import("./utils/border").BorderLogicalStyleProps & ColorStyleProps & DepthStyleProps & FlexItemStyleProps & LayoutStyleProps & OtherStyleProps & import("./utils/position").PositionStandardProps & import("./utils/position").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps>;
|
|
31
|
-
//# sourceMappingURL=Box.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../common/lib/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAS,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAW,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAS,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAW,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAQ,eAAe,EAAC,MAAM,eAAe,CAAC;AAErD,oBAAY,QAAQ,GAAG,gBAAgB,GACrC,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,eAAe,GAAG;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAqCJ;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,GAAG,2oBAad,CAAC"}
|
|
@@ -1,99 +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
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
-
if (mod && mod.__esModule) return mod;
|
|
27
|
-
var result = {};
|
|
28
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
-
__setModuleDefault(result, mod);
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
33
|
-
var t = {};
|
|
34
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
35
|
-
t[p] = s[p];
|
|
36
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
38
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
39
|
-
t[p[i]] = s[p[i]];
|
|
40
|
-
}
|
|
41
|
-
return t;
|
|
42
|
-
};
|
|
43
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
44
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
45
|
-
};
|
|
46
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
-
exports.Box = void 0;
|
|
48
|
-
var React = __importStar(require("react"));
|
|
49
|
-
var styled_1 = __importDefault(require("@emotion/styled"));
|
|
50
|
-
var is_prop_valid_1 = __importDefault(require("@emotion/is-prop-valid"));
|
|
51
|
-
var common_1 = require("@workday/canvas-kit-react/common");
|
|
52
|
-
// style props
|
|
53
|
-
var border_1 = require("./utils/border");
|
|
54
|
-
var color_1 = require("./utils/color");
|
|
55
|
-
var depth_1 = require("./utils/depth");
|
|
56
|
-
var flexItem_1 = require("./utils/flexItem");
|
|
57
|
-
var layout_1 = require("./utils/layout");
|
|
58
|
-
var other_1 = require("./utils/other");
|
|
59
|
-
var position_1 = require("./utils/position");
|
|
60
|
-
var space_1 = require("./utils/space");
|
|
61
|
-
var omittedProps = ['display', 'color', 'height', 'overflow', 'width', 'border', 'background'];
|
|
62
|
-
var shouldForwardProp = function (prop) {
|
|
63
|
-
return is_prop_valid_1.default(prop) && !omittedProps.includes(prop);
|
|
64
|
-
};
|
|
65
|
-
// Meant to be used with elements. The `shouldForwardProps` will remove all style props
|
|
66
|
-
var StyledBoxElement = styled_1.default('div', { shouldForwardProp: shouldForwardProp })({
|
|
67
|
-
boxSizing: 'border-box',
|
|
68
|
-
}, border_1.border, color_1.color, depth_1.depth, flexItem_1.flexItem, layout_1.layout, position_1.position, space_1.space);
|
|
69
|
-
// Meant to be used with components. There is no `shouldForwardProps` - all props will be forwarded to the component
|
|
70
|
-
var StyledBoxComponent = styled_1.default('div')({
|
|
71
|
-
boxSizing: 'border-box',
|
|
72
|
-
}, border_1.border, color_1.color, depth_1.depth, flexItem_1.flexItem, layout_1.layout, other_1.other, position_1.position, space_1.space);
|
|
73
|
-
/**
|
|
74
|
-
* `Box` is a primitive component that provides a common, ergonomic API around Canvas design tokens.
|
|
75
|
-
* It is highly flexible, and its primary purpose is to build other components.
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* import { Box, BoxProps } from '@workday/canvas-kit-labs-react/common';
|
|
79
|
-
*
|
|
80
|
-
* interface CardProps extends BoxProps {
|
|
81
|
-
* // card-specific props
|
|
82
|
-
* }
|
|
83
|
-
*
|
|
84
|
-
* // `Card`'s default values are set using `BoxProps`
|
|
85
|
-
* const Card = (props: CardProps) => (
|
|
86
|
-
* <Box depth={2} padding="m" borderRadius="l" {...props}>Hello, Card!</Box>
|
|
87
|
-
* );
|
|
88
|
-
*
|
|
89
|
-
*/
|
|
90
|
-
exports.Box = common_1.createComponent('div')({
|
|
91
|
-
displayName: 'Box',
|
|
92
|
-
Component: function (_a, ref, Element) {
|
|
93
|
-
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
94
|
-
var BoxComponent = common_1.useConstant(function () {
|
|
95
|
-
return typeof Element === 'string' ? StyledBoxElement : StyledBoxComponent;
|
|
96
|
-
});
|
|
97
|
-
return (React.createElement(BoxComponent, __assign({ as: Element, ref: ref }, elemProps), children));
|
|
98
|
-
},
|
|
99
|
-
});
|
|
@@ -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 { PropertyBorder } from './types';
|
|
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?: PropertyBorder;
|
|
47
|
-
/** sets `border-top-style` property */
|
|
48
|
-
borderTopStyle?: PropertyBorder;
|
|
49
|
-
/** sets `border-right-style` property (no bidirectional support) */
|
|
50
|
-
borderRightStyle?: PropertyBorder;
|
|
51
|
-
/** sets `border-bottom-style` property */
|
|
52
|
-
borderBottomStyle?: PropertyBorder;
|
|
53
|
-
/** sets `border-left-style` property (no bidirectional support) */
|
|
54
|
-
borderLeftStyle?: PropertyBorder;
|
|
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?: PropertyBorder;
|
|
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?: PropertyBorder;
|
|
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":["../../../../../common/lib/utils/border.ts"],"names":[],"m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