@workday/canvas-kit-labs-react 7.0.0-alpha.0-next.6 → 7.0.0-alpha.79-next.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/combobox/README.md +1 -1
  2. package/combobox/lib/Combobox.tsx +7 -11
  3. package/common/index.ts +0 -8
  4. package/dist/commonjs/combobox/lib/Combobox.d.ts +3 -4
  5. package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -1
  6. package/dist/commonjs/combobox/lib/Combobox.js +4 -7
  7. package/dist/commonjs/common/index.d.ts +0 -8
  8. package/dist/commonjs/common/index.d.ts.map +1 -1
  9. package/dist/commonjs/common/index.js +0 -1
  10. package/dist/commonjs/drawer/lib/DrawerHeader.js +2 -2
  11. package/dist/commonjs/index.d.ts +0 -1
  12. package/dist/commonjs/index.d.ts.map +1 -1
  13. package/dist/commonjs/index.js +0 -1
  14. package/dist/commonjs/search-form/lib/SearchForm.d.ts +7 -2
  15. package/dist/commonjs/search-form/lib/SearchForm.d.ts.map +1 -1
  16. package/dist/commonjs/search-form/lib/SearchForm.js +16 -22
  17. package/dist/es6/combobox/lib/Combobox.d.ts +3 -4
  18. package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -1
  19. package/dist/es6/combobox/lib/Combobox.js +5 -8
  20. package/dist/es6/common/index.d.ts +0 -8
  21. package/dist/es6/common/index.d.ts.map +1 -1
  22. package/dist/es6/common/index.js +0 -1
  23. package/dist/es6/drawer/lib/DrawerHeader.js +3 -3
  24. package/dist/es6/index.d.ts +0 -1
  25. package/dist/es6/index.d.ts.map +1 -1
  26. package/dist/es6/index.js +0 -1
  27. package/dist/es6/search-form/lib/SearchForm.d.ts +7 -2
  28. package/dist/es6/search-form/lib/SearchForm.d.ts.map +1 -1
  29. package/dist/es6/search-form/lib/SearchForm.js +17 -23
  30. package/drawer/lib/DrawerHeader.tsx +3 -3
  31. package/index.ts +0 -1
  32. package/package.json +4 -6
  33. package/search-form/lib/SearchForm.tsx +25 -37
  34. package/ts3.5/dist/commonjs/combobox/lib/Combobox.d.ts +3 -4
  35. package/ts3.5/dist/commonjs/common/index.d.ts +0 -8
  36. package/ts3.5/dist/commonjs/index.d.ts +0 -1
  37. package/ts3.5/dist/commonjs/search-form/lib/SearchForm.d.ts +7 -2
  38. package/ts3.5/dist/es6/combobox/lib/Combobox.d.ts +3 -4
  39. package/ts3.5/dist/es6/common/index.d.ts +0 -8
  40. package/ts3.5/dist/es6/index.d.ts +0 -1
  41. package/ts3.5/dist/es6/search-form/lib/SearchForm.d.ts +7 -2
  42. package/common/lib/Box.tsx +0 -92
  43. package/common/lib/utils/border.ts +0 -263
  44. package/common/lib/utils/color.ts +0 -62
  45. package/common/lib/utils/depth.ts +0 -37
  46. package/common/lib/utils/flexItem.ts +0 -56
  47. package/common/lib/utils/layout.ts +0 -77
  48. package/common/lib/utils/other.ts +0 -20
  49. package/common/lib/utils/position.ts +0 -96
  50. package/common/lib/utils/space.ts +0 -207
  51. package/common/lib/utils/types.ts +0 -105
  52. package/dist/commonjs/common/lib/Box.d.ts +0 -31
  53. package/dist/commonjs/common/lib/Box.d.ts.map +0 -1
  54. package/dist/commonjs/common/lib/Box.js +0 -99
  55. package/dist/commonjs/common/lib/utils/border.d.ts +0 -103
  56. package/dist/commonjs/common/lib/utils/border.d.ts.map +0 -1
  57. package/dist/commonjs/common/lib/utils/border.js +0 -153
  58. package/dist/commonjs/common/lib/utils/color.d.ts +0 -26
  59. package/dist/commonjs/common/lib/utils/color.d.ts.map +0 -1
  60. package/dist/commonjs/common/lib/utils/color.js +0 -57
  61. package/dist/commonjs/common/lib/utils/depth.d.ts +0 -22
  62. package/dist/commonjs/common/lib/utils/depth.d.ts.map +0 -1
  63. package/dist/commonjs/common/lib/utils/depth.js +0 -29
  64. package/dist/commonjs/common/lib/utils/flexItem.d.ts +0 -33
  65. package/dist/commonjs/common/lib/utils/flexItem.d.ts.map +0 -1
  66. package/dist/commonjs/common/lib/utils/flexItem.js +0 -39
  67. package/dist/commonjs/common/lib/utils/layout.d.ts +0 -43
  68. package/dist/commonjs/common/lib/utils/layout.d.ts.map +0 -1
  69. package/dist/commonjs/common/lib/utils/layout.js +0 -43
  70. package/dist/commonjs/common/lib/utils/other.d.ts +0 -5
  71. package/dist/commonjs/common/lib/utils/other.d.ts.map +0 -1
  72. package/dist/commonjs/common/lib/utils/other.js +0 -19
  73. package/dist/commonjs/common/lib/utils/position.d.ts +0 -41
  74. package/dist/commonjs/common/lib/utils/position.d.ts.map +0 -1
  75. package/dist/commonjs/common/lib/utils/position.js +0 -78
  76. package/dist/commonjs/common/lib/utils/space.d.ts +0 -64
  77. package/dist/commonjs/common/lib/utils/space.d.ts.map +0 -1
  78. package/dist/commonjs/common/lib/utils/space.js +0 -161
  79. package/dist/commonjs/common/lib/utils/types.d.ts +0 -14
  80. package/dist/commonjs/common/lib/utils/types.d.ts.map +0 -1
  81. package/dist/commonjs/common/lib/utils/types.js +0 -2
  82. package/dist/commonjs/layout/index.d.ts +0 -5
  83. package/dist/commonjs/layout/index.d.ts.map +0 -1
  84. package/dist/commonjs/layout/index.js +0 -14
  85. package/dist/commonjs/layout/lib/Flex.d.ts +0 -26
  86. package/dist/commonjs/layout/lib/Flex.d.ts.map +0 -1
  87. package/dist/commonjs/layout/lib/Flex.js +0 -83
  88. package/dist/commonjs/layout/lib/Stack.d.ts +0 -27
  89. package/dist/commonjs/layout/lib/Stack.d.ts.map +0 -1
  90. package/dist/commonjs/layout/lib/Stack.js +0 -99
  91. package/dist/commonjs/layout/lib/utils/flex.d.ts +0 -36
  92. package/dist/commonjs/layout/lib/utils/flex.d.ts.map +0 -1
  93. package/dist/commonjs/layout/lib/utils/flex.js +0 -38
  94. package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +0 -3
  95. package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts.map +0 -1
  96. package/dist/commonjs/layout/lib/utils/getValidChildren.js +0 -29
  97. package/dist/commonjs/layout/lib/utils/stack.d.ts +0 -26
  98. package/dist/commonjs/layout/lib/utils/stack.d.ts.map +0 -1
  99. package/dist/commonjs/layout/lib/utils/stack.js +0 -55
  100. package/dist/commonjs/layout/lib/utils/types.d.ts +0 -8
  101. package/dist/commonjs/layout/lib/utils/types.d.ts.map +0 -1
  102. package/dist/commonjs/layout/lib/utils/types.js +0 -2
  103. package/dist/es6/common/lib/Box.d.ts +0 -31
  104. package/dist/es6/common/lib/Box.d.ts.map +0 -1
  105. package/dist/es6/common/lib/Box.js +0 -74
  106. package/dist/es6/common/lib/utils/border.d.ts +0 -103
  107. package/dist/es6/common/lib/utils/border.d.ts.map +0 -1
  108. package/dist/es6/common/lib/utils/border.js +0 -149
  109. package/dist/es6/common/lib/utils/color.d.ts +0 -26
  110. package/dist/es6/common/lib/utils/color.d.ts.map +0 -1
  111. package/dist/es6/common/lib/utils/color.js +0 -53
  112. package/dist/es6/common/lib/utils/depth.d.ts +0 -22
  113. package/dist/es6/common/lib/utils/depth.d.ts.map +0 -1
  114. package/dist/es6/common/lib/utils/depth.js +0 -25
  115. package/dist/es6/common/lib/utils/flexItem.d.ts +0 -33
  116. package/dist/es6/common/lib/utils/flexItem.d.ts.map +0 -1
  117. package/dist/es6/common/lib/utils/flexItem.js +0 -35
  118. package/dist/es6/common/lib/utils/layout.d.ts +0 -43
  119. package/dist/es6/common/lib/utils/layout.d.ts.map +0 -1
  120. package/dist/es6/common/lib/utils/layout.js +0 -39
  121. package/dist/es6/common/lib/utils/other.d.ts +0 -5
  122. package/dist/es6/common/lib/utils/other.d.ts.map +0 -1
  123. package/dist/es6/common/lib/utils/other.js +0 -15
  124. package/dist/es6/common/lib/utils/position.d.ts +0 -41
  125. package/dist/es6/common/lib/utils/position.d.ts.map +0 -1
  126. package/dist/es6/common/lib/utils/position.js +0 -74
  127. package/dist/es6/common/lib/utils/space.d.ts +0 -64
  128. package/dist/es6/common/lib/utils/space.d.ts.map +0 -1
  129. package/dist/es6/common/lib/utils/space.js +0 -157
  130. package/dist/es6/common/lib/utils/types.d.ts +0 -14
  131. package/dist/es6/common/lib/utils/types.d.ts.map +0 -1
  132. package/dist/es6/common/lib/utils/types.js +0 -1
  133. package/dist/es6/layout/index.d.ts +0 -5
  134. package/dist/es6/layout/index.d.ts.map +0 -1
  135. package/dist/es6/layout/index.js +0 -2
  136. package/dist/es6/layout/lib/Flex.d.ts +0 -26
  137. package/dist/es6/layout/lib/Flex.d.ts.map +0 -1
  138. package/dist/es6/layout/lib/Flex.js +0 -58
  139. package/dist/es6/layout/lib/Stack.d.ts +0 -27
  140. package/dist/es6/layout/lib/Stack.d.ts.map +0 -1
  141. package/dist/es6/layout/lib/Stack.js +0 -74
  142. package/dist/es6/layout/lib/utils/flex.d.ts +0 -36
  143. package/dist/es6/layout/lib/utils/flex.d.ts.map +0 -1
  144. package/dist/es6/layout/lib/utils/flex.js +0 -34
  145. package/dist/es6/layout/lib/utils/getValidChildren.d.ts +0 -3
  146. package/dist/es6/layout/lib/utils/getValidChildren.d.ts.map +0 -1
  147. package/dist/es6/layout/lib/utils/getValidChildren.js +0 -6
  148. package/dist/es6/layout/lib/utils/stack.d.ts +0 -26
  149. package/dist/es6/layout/lib/utils/stack.d.ts.map +0 -1
  150. package/dist/es6/layout/lib/utils/stack.js +0 -51
  151. package/dist/es6/layout/lib/utils/types.d.ts +0 -8
  152. package/dist/es6/layout/lib/utils/types.d.ts.map +0 -1
  153. package/dist/es6/layout/lib/utils/types.js +0 -1
  154. package/layout/LICENSE +0 -52
  155. package/layout/README.md +0 -16
  156. package/layout/index.ts +0 -4
  157. package/layout/lib/Flex.tsx +0 -47
  158. package/layout/lib/Stack.tsx +0 -95
  159. package/layout/lib/utils/flex.ts +0 -65
  160. package/layout/lib/utils/getValidChildren.ts +0 -7
  161. package/layout/lib/utils/stack.ts +0 -78
  162. package/layout/lib/utils/types.ts +0 -45
  163. package/layout/package.json +0 -5
  164. package/ts3.5/dist/commonjs/common/lib/Box.d.ts +0 -31
  165. package/ts3.5/dist/commonjs/common/lib/utils/border.d.ts +0 -103
  166. package/ts3.5/dist/commonjs/common/lib/utils/color.d.ts +0 -26
  167. package/ts3.5/dist/commonjs/common/lib/utils/depth.d.ts +0 -22
  168. package/ts3.5/dist/commonjs/common/lib/utils/flexItem.d.ts +0 -33
  169. package/ts3.5/dist/commonjs/common/lib/utils/layout.d.ts +0 -43
  170. package/ts3.5/dist/commonjs/common/lib/utils/other.d.ts +0 -5
  171. package/ts3.5/dist/commonjs/common/lib/utils/position.d.ts +0 -41
  172. package/ts3.5/dist/commonjs/common/lib/utils/space.d.ts +0 -64
  173. package/ts3.5/dist/commonjs/common/lib/utils/types.d.ts +0 -14
  174. package/ts3.5/dist/commonjs/layout/index.d.ts +0 -5
  175. package/ts3.5/dist/commonjs/layout/lib/Flex.d.ts +0 -26
  176. package/ts3.5/dist/commonjs/layout/lib/Stack.d.ts +0 -27
  177. package/ts3.5/dist/commonjs/layout/lib/utils/flex.d.ts +0 -36
  178. package/ts3.5/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +0 -3
  179. package/ts3.5/dist/commonjs/layout/lib/utils/stack.d.ts +0 -26
  180. package/ts3.5/dist/commonjs/layout/lib/utils/types.d.ts +0 -8
  181. package/ts3.5/dist/es6/common/lib/Box.d.ts +0 -31
  182. package/ts3.5/dist/es6/common/lib/utils/border.d.ts +0 -103
  183. package/ts3.5/dist/es6/common/lib/utils/color.d.ts +0 -26
  184. package/ts3.5/dist/es6/common/lib/utils/depth.d.ts +0 -22
  185. package/ts3.5/dist/es6/common/lib/utils/flexItem.d.ts +0 -33
  186. package/ts3.5/dist/es6/common/lib/utils/layout.d.ts +0 -43
  187. package/ts3.5/dist/es6/common/lib/utils/other.d.ts +0 -5
  188. package/ts3.5/dist/es6/common/lib/utils/position.d.ts +0 -41
  189. package/ts3.5/dist/es6/common/lib/utils/space.d.ts +0 -64
  190. package/ts3.5/dist/es6/common/lib/utils/types.d.ts +0 -14
  191. package/ts3.5/dist/es6/layout/index.d.ts +0 -5
  192. package/ts3.5/dist/es6/layout/lib/Flex.d.ts +0 -26
  193. package/ts3.5/dist/es6/layout/lib/Stack.d.ts +0 -27
  194. package/ts3.5/dist/es6/layout/lib/utils/flex.d.ts +0 -36
  195. package/ts3.5/dist/es6/layout/lib/utils/getValidChildren.d.ts +0 -3
  196. package/ts3.5/dist/es6/layout/lib/utils/stack.d.ts +0 -26
  197. package/ts3.5/dist/es6/layout/lib/utils/types.d.ts +0 -8
@@ -1,65 +0,0 @@
1
- import {
2
- PropertyAlignItems,
3
- PropertyAlignContent,
4
- PropertyJustifyItems,
5
- PropertyJustifyContent,
6
- PropertyFlexWrap,
7
- PropertyFlexDirection,
8
- } from './types';
9
-
10
- /** style props to for flexbox container properties */
11
- export type FlexStyleProps = {
12
- /** sets `align-items` property */
13
- alignItems?: PropertyAlignItems;
14
- /** sets `align-content` property */
15
- alignContent?: PropertyAlignContent;
16
- /**
17
- * sets `display` property
18
- * @default 'flex'
19
- * */
20
- display?: 'flex' | 'inline-flex';
21
- /** sets `justify-items` property */
22
- justifyItems?: PropertyJustifyItems;
23
- /** sets `justify-content` property */
24
- justifyContent?: PropertyJustifyContent;
25
- /** sets `flex-wrap` property */
26
- flexWrap?: PropertyFlexWrap;
27
- /** sets `flex-direction` property */
28
- flexDirection?: PropertyFlexDirection;
29
- };
30
-
31
- const flexProps = {
32
- alignContent: 'alignContent',
33
- alignItems: 'alignItems',
34
- display: 'display',
35
- flexDirection: 'flexDirection',
36
- flexWrap: 'flexWrap',
37
- justifyContent: 'justifyContent',
38
- justifyItems: 'justifyItems',
39
- };
40
-
41
- /**
42
- * A style prop function that takes component props and returns flexbox styles.
43
- * If no `FlexStyleProps` are found, it returns an empty object.
44
- *
45
- * @example
46
- * // You'll most likely use `flex` with low-level, styled components
47
- * const FlexExample = () => (
48
- * <Flex justifyContent="center" alignItems="center">
49
- * Hello, flex!
50
- * </Flex>
51
- * );
52
- *
53
- */
54
- export function flex<P extends FlexStyleProps>(props: P) {
55
- const styles = {};
56
- for (const key in props) {
57
- if (key in flexProps) {
58
- const attr = flexProps[key as keyof FlexStyleProps];
59
- const value = props[key];
60
- // @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
61
- styles[attr] = value;
62
- }
63
- }
64
- return styles;
65
- }
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
-
3
- export function getValidChildren(children: React.ReactNode) {
4
- return React.Children.toArray(children).filter(child =>
5
- React.isValidElement(child)
6
- ) as React.ReactElement[];
7
- }
@@ -1,78 +0,0 @@
1
- import {
2
- ContentDirection,
3
- PartialEmotionCanvasTheme,
4
- useTheme,
5
- } from '@workday/canvas-kit-react/common';
6
- import {space as spaceTokens, CanvasSpaceKeys} from '@workday/canvas-kit-react/tokens';
7
-
8
- export type StackDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
9
-
10
- const selector = '& > *:not(style) ~ *:not(style)';
11
-
12
- export type StackSpacing = CanvasSpaceKeys | number | (string & {});
13
-
14
- export type StackStyleProps = {
15
- /** sets space values between child elements (bidirectional support) */
16
- spacing: StackSpacing;
17
- /**
18
- * sets the direction for the stack
19
- * @default "row"
20
- * */
21
- flexDirection?: StackDirection;
22
- /**
23
- * when `true` wraps each child element in a `Stack.Item`
24
- * @default false
25
- * */
26
- shouldWrapChildren?: boolean;
27
- };
28
-
29
- const column = (value: StackSpacing) => ({
30
- marginTop: spaceTokens[value as CanvasSpaceKeys] || value,
31
- });
32
-
33
- const columnReverse = (value: StackSpacing) => ({
34
- marginBottom: spaceTokens[value as CanvasSpaceKeys] || value,
35
- });
36
-
37
- const row = (value: StackSpacing, isRTL = false) => {
38
- const attr = isRTL ? 'marginRight' : 'marginLeft';
39
- return {
40
- [attr]: spaceTokens[value as CanvasSpaceKeys] || value,
41
- };
42
- };
43
-
44
- const rowReverse = (value: StackSpacing, isRTL = false) => {
45
- const attr = isRTL ? 'marginLeft' : 'marginRight';
46
- return {
47
- [attr]: spaceTokens[value as CanvasSpaceKeys] || value,
48
- };
49
- };
50
-
51
- const stackDirectionProps = {
52
- column,
53
- 'column-reverse': columnReverse,
54
- row,
55
- 'row-reverse': rowReverse,
56
- };
57
-
58
- export function stack<P extends StackStyleProps & {theme?: PartialEmotionCanvasTheme}>(props: P) {
59
- let styles = {};
60
- const {flexDirection = 'row', spacing} = props;
61
- if (flexDirection === 'column' || flexDirection === 'column-reverse') {
62
- const stackFn = stackDirectionProps[flexDirection];
63
- styles = stackFn(spacing);
64
- }
65
-
66
- if (flexDirection === 'row' || flexDirection === 'row-reverse') {
67
- // stack 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
- const {canvas} = useTheme(props.theme);
70
- const stackFn = stackDirectionProps[flexDirection];
71
- const isRTL = canvas.direction === ContentDirection.RTL;
72
- styles = stackFn(spacing, isRTL);
73
- }
74
-
75
- return {
76
- [selector]: styles,
77
- };
78
- }
@@ -1,45 +0,0 @@
1
- import {Globals, SelfPosition, ContentDistribution, ContentPosition} from 'csstype';
2
-
3
- // We're temporarily creating these types from csstype
4
- // to improve type completion until we move to csstype v3.
5
-
6
- // Flex
7
- export type PropertyAlignItems =
8
- | Globals
9
- | SelfPosition
10
- | 'baseline'
11
- | 'normal'
12
- | 'stretch'
13
- | (string & {});
14
-
15
- export type PropertyAlignContent =
16
- | Globals
17
- | ContentDistribution
18
- | ContentPosition
19
- | 'baseline'
20
- | 'normal'
21
- | (string & {});
22
-
23
- export type PropertyJustifyItems =
24
- | Globals
25
- | SelfPosition
26
- | 'baseline'
27
- | 'left'
28
- | 'legacy'
29
- | 'normal'
30
- | 'right'
31
- | 'stretch'
32
- | (string & {});
33
-
34
- export type PropertyJustifyContent =
35
- | Globals
36
- | ContentDistribution
37
- | ContentPosition
38
- | 'left'
39
- | 'normal'
40
- | 'right'
41
- | (string & {});
42
-
43
- export type PropertyFlexWrap = Globals | 'nowrap' | 'wrap' | 'wrap-reverse';
44
-
45
- export type PropertyFlexDirection = Globals | 'column' | 'column-reverse' | 'row' | 'row-reverse';
@@ -1,5 +0,0 @@
1
- {
2
- "main": "../dist/commonjs/layout",
3
- "module": "../dist/es6/layout",
4
- "sideEffects": false
5
- }
@@ -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,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,26 +0,0 @@
1
- import { colors as colorTokens, CanvasColor } from '@workday/canvas-kit-react/tokens';
2
- export declare type ColorTokens = typeof colorTokens;
3
- /** style props to for color properties */
4
- export declare type ColorStyleProps = {
5
- /** sets `background` property */
6
- background?: CanvasColor | (string & {});
7
- /** sets `background-color` property */
8
- backgroundColor?: CanvasColor | (string & {});
9
- /** sets `background-image` property */
10
- backgroundImage?: string;
11
- /** sets `color` property */
12
- color?: CanvasColor | (string & {});
13
- };
14
- /**
15
- * A style prop function that takes components props and returns color styles from canvas token values.
16
- * If no `ColorStyleProps` are found, it returns an empty object.
17
- *
18
- * @example
19
- * // You'll most likely use `color` with low-level, styled components
20
- * const BoxExample = () => (
21
- * <Box backgroundColor="blueberry500" color="frenchVanilla100">Hello, colors!</Box>
22
- * );
23
- *
24
- */
25
- export declare function color<P extends ColorStyleProps>(props: P): {};
26
- //# sourceMappingURL=color.d.ts.map
@@ -1,22 +0,0 @@
1
- import { depth as depthTokens } from '@workday/canvas-kit-react/tokens';
2
- export declare type DepthTokens = typeof depthTokens;
3
- export declare type DepthTokenKeys = keyof DepthTokens;
4
- export declare type DepthTokenValues = DepthTokens[keyof DepthTokens];
5
- /** style props to for depth styles */
6
- export declare type DepthStyleProps = {
7
- /** sets depth styles (box-shadow & border) */
8
- depth?: DepthTokenKeys;
9
- };
10
- /**
11
- * A style prop function that takes components props and returns depth styles from canvas token values.
12
- * If no `DepthStyleProps` are found, it returns an empty object.
13
- *
14
- * @example
15
- * // You'll mostly likely use `depth` with low-level, styled components
16
- * const BoxExample = () => (
17
- * <Box depth={3}>Hello, box shadows!</Box>
18
- * );
19
- *
20
- */
21
- export declare function depth<P extends DepthStyleProps>(props: P): DepthTokenValues;
22
- //# sourceMappingURL=depth.d.ts.map
@@ -1,33 +0,0 @@
1
- import { PropertyJustifySelf, PropertyAlignSelf, PropertyOrder } from './types';
2
- /** style props to for flexbox item properties */
3
- export declare type FlexItemStyleProps = {
4
- /** sets `flex` property */
5
- flex?: number | string;
6
- /** sets `flex-grow` property */
7
- flexGrow?: number | string;
8
- /** sets `flex-shrink` property */
9
- flexShrink?: number | string;
10
- /** sets `flex-basis` property */
11
- flexBasis?: number | string;
12
- /** sets `justify-self` property */
13
- justifySelf?: PropertyJustifySelf;
14
- /** sets `align-self` property */
15
- alignSelf?: PropertyAlignSelf;
16
- /** sets `order` property */
17
- order?: PropertyOrder;
18
- };
19
- /**
20
- * A style prop function that takes component props and returns flexbox item styles.
21
- * If no `FlexItemStyleProps` are found, it returns an empty object.
22
- *
23
- * @example
24
- * // You'll most likely use `flexItem` with low-level, styled components
25
- * const FlexItemExample = () => (
26
- * <Box flex={1} flexBasis="auto" alignSelf={center}>
27
- * Hello, flex item!
28
- * </Box>
29
- * );
30
- *
31
- */
32
- export declare function flexItem<P extends FlexItemStyleProps>(props: P): {};
33
- //# sourceMappingURL=flexItem.d.ts.map
@@ -1,43 +0,0 @@
1
- import { PropertyDisplay, PropertyListStyle, PropertyOverflow, PropertyOverflowX, PropertyOverflowY, PropertyVerticalAlign } from './types';
2
- /** style props to for layout properties */
3
- export declare type LayoutStyleProps = {
4
- /** sets `display` property */
5
- display?: PropertyDisplay;
6
- /** sets `height` property */
7
- height?: number | string;
8
- /** sets `list-style property */
9
- listStyle?: PropertyListStyle;
10
- /** sets `max-height` property */
11
- maxHeight?: number | string;
12
- /** sets `max-width` property */
13
- maxWidth?: number | string;
14
- /** sets `min-height` property */
15
- minHeight?: number | string;
16
- /** sets `min-width` property */
17
- minWidth?: number | string;
18
- /** sets `overflow` property */
19
- overflow?: PropertyOverflow;
20
- /** sets `overflow-x` property */
21
- overflowX?: PropertyOverflowX;
22
- /** sets `overflow-y` property */
23
- overflowY?: PropertyOverflowY;
24
- /** sets `vertical-align` property */
25
- verticalAlign?: PropertyVerticalAlign;
26
- /** sets `width` property */
27
- width?: number | string;
28
- };
29
- /**
30
- * A style prop function that takes components props and returns layout styles.
31
- * If no `LayoutStyleProps` are found, it returns an empty object.
32
- *
33
- * @example
34
- * // You'll most likely use `layout` with low-level, styled components
35
- * const BoxExample = () => (
36
- * <Box display="inline-block" height="50%">
37
- * Hello, positions!
38
- * </Box>
39
- * );
40
- *
41
- */
42
- export declare function layout<P extends LayoutStyleProps>(props: P): {};
43
- //# sourceMappingURL=layout.d.ts.map
@@ -1,5 +0,0 @@
1
- export declare type OtherStyleProps = {
2
- animation?: string;
3
- };
4
- export declare function other<P extends OtherStyleProps>(props: P): {};
5
- //# sourceMappingURL=other.d.ts.map
@@ -1,41 +0,0 @@
1
- import { PartialEmotionCanvasTheme } from '@workday/canvas-kit-react/common';
2
- import { PropertyPosition, PropertyZIndex } from './types';
3
- /** style props to for standard position properties */
4
- export declare type PositionStandardProps = {
5
- /** sets `position` property */
6
- position?: PropertyPosition;
7
- /** sets `zIndex` property */
8
- zIndex?: PropertyZIndex;
9
- /** sets `top` property */
10
- top?: number | string;
11
- /** sets `right` property (no bidirectional support) */
12
- right?: number | string;
13
- /** sets `bottom` property */
14
- bottom?: number | string;
15
- /** sets `left` property (no bidirectional support) */
16
- left?: number | string;
17
- };
18
- export declare type PositionLogicalProps = {
19
- /** sets `left` property (bidirectional support) */
20
- insetInlineStart?: number | string;
21
- /** sets `right` property (bidirectional support) */
22
- insetInlineEnd?: number | string;
23
- };
24
- export declare type PositionStyleProps = PositionStandardProps & PositionLogicalProps;
25
- /**
26
- * A style prop function that takes components props and returns position styles.
27
- * If no `PositionProps` are found, it returns an empty object.
28
- *
29
- * @example
30
- * // You'll most likely use `position` with low-level, styled components
31
- * const BoxExample = () => (
32
- * <Box position="absolute" top="50%">
33
- * Hello, positions!
34
- * </Box>
35
- * );
36
- *
37
- */
38
- export declare function position<P extends PositionStyleProps & {
39
- theme?: PartialEmotionCanvasTheme;
40
- }>(props: P): {};
41
- //# sourceMappingURL=position.d.ts.map
@@ -1,64 +0,0 @@
1
- import { PartialEmotionCanvasTheme } from '@workday/canvas-kit-react/common';
2
- import { CanvasSpaceKeys } from '@workday/canvas-kit-react/tokens';
3
- declare type SpacePropValues = CanvasSpaceKeys | number | (string & {});
4
- /** These props automatically adjust for bidirectionality (LTR & RTL) */
5
- export declare type SpaceLogicalProps = {
6
- /** sets margin-left property (bidirectional support) */
7
- marginInlineStart?: SpacePropValues;
8
- /** sets margin-right property (bidirectional support) */
9
- marginInlineEnd?: SpacePropValues;
10
- /** sets padding-left property (bidirectional support) */
11
- paddingInlineStart?: SpacePropValues;
12
- /** sets padding-right property (bidirectional support) */
13
- paddingInlineEnd?: SpacePropValues;
14
- };
15
- /** These props do not adjust for bidirectionality (LTR & RTL) */
16
- export declare type SpaceStandardProps = {
17
- /** sets margin property */
18
- margin?: SpacePropValues;
19
- /** sets margin-left and margin-right properties */
20
- marginX?: SpacePropValues;
21
- /** sets margin-top and margin-bottom properties */
22
- marginY?: SpacePropValues;
23
- /** sets margin-top property */
24
- marginTop?: SpacePropValues;
25
- /** sets margin-right property (no bidirectional support) */
26
- marginRight?: SpacePropValues;
27
- /** sets margin-bottom property */
28
- marginBottom?: SpacePropValues;
29
- /** sets margin-left property (no bidirectional support) */
30
- marginLeft?: SpacePropValues;
31
- /** sets padding property */
32
- padding?: SpacePropValues;
33
- /** sets padding-left and margin-right properties */
34
- paddingX?: SpacePropValues;
35
- /** sets padding-top and padding-bottom properties */
36
- paddingY?: SpacePropValues;
37
- /** sets padding-top property */
38
- paddingTop?: SpacePropValues;
39
- /** sets padding-right property (no bidirectional support) */
40
- paddingRight?: SpacePropValues;
41
- /** sets padding-bottom */
42
- paddingBottom?: SpacePropValues;
43
- /** sets padding-left property (no bidirectional support) */
44
- paddingLeft?: SpacePropValues;
45
- };
46
- export declare type SpaceStyleProps = SpaceStandardProps & SpaceLogicalProps;
47
- /**
48
- * A style prop function that takes component props and returns space styles.
49
- * If no `SpaceStyleProps` are found, it returns an empty object.
50
- *
51
- * @example
52
- * // You'll most likely use `space` with low-level, styled components
53
- * const BoxExample = () => (
54
- * <Box padding="xs" margin="m">
55
- * Hello, space!
56
- * </Box>
57
- * );
58
- *
59
- */
60
- export declare function space<P extends SpaceStyleProps & {
61
- theme?: PartialEmotionCanvasTheme;
62
- }>(props: P): {};
63
- export {};
64
- //# sourceMappingURL=space.d.ts.map
@@ -1,14 +0,0 @@
1
- import { Globals, GlobalsNumber, SelfPosition, DisplayOutside, DisplayInside, DisplayInternal, DisplayLegacy, LineStyle } from 'csstype';
2
- export declare type PropertyBorder = Globals | LineStyle | (string & {});
3
- export declare type PropertyJustifySelf = Globals | SelfPosition | 'auto' | 'baseline' | 'left' | 'normal' | 'right' | 'stretch' | (string & {});
4
- export declare type PropertyAlignSelf = Globals | SelfPosition | 'auto' | 'baseline' | 'normal' | 'stretch' | (string & {});
5
- export declare type PropertyOrder = GlobalsNumber;
6
- export declare type PropertyDisplay = Globals | DisplayOutside | DisplayInside | DisplayInternal | DisplayLegacy | 'contents' | 'list-item' | 'none' | (string & {});
7
- export declare type PropertyListStyle = Globals | 'inside' | 'none' | 'outside' | (string & {});
8
- export declare type PropertyOverflow = Globals | '-moz-hidden-unscrollable' | 'auto' | 'clip' | 'hidden' | 'scroll' | 'visible' | (string & {});
9
- export declare type PropertyOverflowX = Globals | '-moz-hidden-unscrollable' | 'auto' | 'clip' | 'hidden' | 'scroll' | 'visible';
10
- export declare type PropertyOverflowY = Globals | '-moz-hidden-unscrollable' | 'auto' | 'clip' | 'hidden' | 'scroll' | 'visible';
11
- export declare type PropertyVerticalAlign = Globals | 'baseline' | 'bottom' | 'middle' | 'sub' | 'super' | 'text-bottom' | 'text-top' | 'top' | (string & {});
12
- export declare type PropertyPosition = Globals | '-webkit-sticky' | 'absolute' | 'fixed' | 'relative' | 'static' | 'sticky';
13
- export declare type PropertyZIndex = GlobalsNumber | 'auto';
14
- //# sourceMappingURL=types.d.ts.map
@@ -1,5 +0,0 @@
1
- export * from './lib/Flex';
2
- export * from './lib/Stack';
3
- export { FlexStyleProps } from './lib/utils/flex';
4
- export { StackSpacing, StackDirection, StackStyleProps } from './lib/utils/stack';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1,26 +0,0 @@
1
- import { BoxProps } from '@workday/canvas-kit-labs-react/common';
2
- import { FlexStyleProps } from './utils/flex';
3
- export declare type FlexProps = BoxProps & FlexStyleProps;
4
- /**
5
- * `Flex` is a low-level layout component that provides a common, ergonomic API for applying CSS flexbox styles.
6
- * It is highly flexible, and can be used on its own or to build other components.
7
- * `Flex` is built on top of `Box` and has access to all `BoxProps`.
8
- *
9
- * @example
10
- * import { Flex, FlexProps } from '@workday/canvas-kit-labs-react/layout';
11
- *
12
- * interface CardProps extends FlexProps {
13
- * // card-specific props
14
- * }
15
- *
16
- * // `Card`'s default values are set using `FlexProps`
17
- * const Card = (props: CardProps) => (
18
- * <Flex flexDirection="column" alignItems="flex-start" depth={2} space="m" {...props}>
19
- * <h1>Hello, Card!</h1>
20
- * <p>This card uses flexbox to set its layout.</p>
21
- * </Flex>
22
- * );
23
- *
24
- */
25
- export declare const Flex: import("@workday/canvas-kit-react/common").ElementComponent<"div", import("../../common/lib/utils/border").BorderShorthandStyleProps & import("../../common/lib/utils/border").BorderColorStyleProps & import("../../common/lib/utils/border").BorderRadiusStyleProps & import("../../common/lib/utils/border").BorderLineStyleProps & import("../../common/lib/utils/border").BorderWidthStyleProps & import("../../common/lib/utils/border").BorderLogicalStyleProps & import("../../common").ColorStyleProps & import("../../common").DepthStyleProps & import("../../common").FlexItemStyleProps & import("../../common").LayoutStyleProps & import("../../common/lib/utils/other").OtherStyleProps & import("../../common/lib/utils/position").PositionStandardProps & import("../../common/lib/utils/position").PositionLogicalProps & import("../../common/lib/utils/space").SpaceStandardProps & import("../../common/lib/utils/space").SpaceLogicalProps & FlexStyleProps>;
26
- //# sourceMappingURL=Flex.d.ts.map