@workday/canvas-kit-react 8.0.0-alpha.145-next.1 → 8.0.0-alpha.153-next.5
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/banner/lib/Banner.tsx +3 -6
- package/card/lib/CardBody.tsx +3 -6
- package/card/lib/CardHeading.tsx +13 -10
- package/checkbox/index.ts +0 -1
- package/checkbox/lib/Checkbox.tsx +9 -24
- package/color-picker/index.ts +0 -1
- package/common/lib/utils/useModalityType.ts +13 -13
- package/dist/commonjs/banner/lib/Banner.d.ts.map +1 -1
- package/dist/commonjs/banner/lib/Banner.js +2 -4
- package/dist/commonjs/card/lib/Card.d.ts +1 -1
- package/dist/commonjs/card/lib/CardBody.d.ts +1 -1
- package/dist/commonjs/card/lib/CardBody.d.ts.map +1 -1
- package/dist/commonjs/card/lib/CardBody.js +1 -6
- package/dist/commonjs/card/lib/CardHeading.d.ts.map +1 -1
- package/dist/commonjs/card/lib/CardHeading.js +2 -10
- package/dist/commonjs/checkbox/index.d.ts.map +1 -1
- package/dist/commonjs/checkbox/lib/Checkbox.d.ts.map +1 -1
- package/dist/commonjs/checkbox/lib/Checkbox.js +2 -13
- package/dist/commonjs/color-picker/index.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/useModalityType.js +13 -13
- package/dist/commonjs/dialog/lib/Dialog.d.ts +1 -1
- package/dist/commonjs/form-field/index.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/Hint.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/Hint.js +5 -13
- 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 +4 -0
- package/dist/commonjs/layout/index.d.ts.map +1 -1
- package/dist/commonjs/layout/index.js +3 -0
- package/dist/commonjs/layout/lib/Box.d.ts +4 -2
- package/dist/commonjs/layout/lib/Box.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Box.js +27 -3
- package/dist/commonjs/layout/lib/Flex.d.ts +1 -1
- package/dist/commonjs/layout/lib/Flex.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Grid.d.ts +52 -0
- package/dist/commonjs/layout/lib/Grid.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/Grid.js +117 -0
- package/dist/commonjs/layout/lib/Stack.d.ts +4 -4
- package/dist/commonjs/layout/lib/Stack.js +4 -4
- package/dist/commonjs/layout/lib/utils/color.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/color.js +1 -0
- package/dist/commonjs/layout/lib/utils/font.d.ts +29 -0
- package/dist/commonjs/layout/lib/utils/font.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/font.js +57 -0
- package/dist/commonjs/layout/lib/utils/grid.d.ts +58 -0
- package/dist/commonjs/layout/lib/utils/grid.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/grid.js +49 -0
- package/dist/commonjs/layout/lib/utils/gridItem.d.ts +39 -0
- package/dist/commonjs/layout/lib/utils/gridItem.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/gridItem.js +43 -0
- package/dist/commonjs/layout/lib/utils/text.d.ts +35 -0
- package/dist/commonjs/layout/lib/utils/text.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/text.js +48 -0
- package/dist/commonjs/modal/lib/Modal.d.ts +1 -1
- package/dist/commonjs/modal/lib/ModalCard.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/ModalCard.js +15 -1
- package/dist/commonjs/modal/lib/ModalOverlay.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/ModalOverlay.js +26 -16
- package/dist/commonjs/modal/lib/hooks/useCloseOnOverlayClick.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/hooks/useCloseOnOverlayClick.js +3 -1
- package/dist/commonjs/pagination/lib/Pagination/AdditionalDetails.d.ts.map +1 -1
- package/dist/commonjs/pagination/lib/Pagination/AdditionalDetails.js +5 -4
- package/dist/commonjs/pagination/lib/Pagination/GoTo/Label.d.ts.map +1 -1
- package/dist/commonjs/pagination/lib/Pagination/GoTo/Label.js +2 -4
- 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/PopupCard.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/PopupCard.js +18 -10
- package/dist/commonjs/radio/lib/Radio.d.ts.map +1 -1
- package/dist/commonjs/radio/lib/Radio.js +2 -13
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanel.js +2 -2
- package/dist/commonjs/tabs/lib/TabsItem.d.ts +1 -1
- package/dist/commonjs/text/index.d.ts +4 -0
- package/dist/commonjs/text/index.d.ts.map +1 -0
- package/dist/commonjs/text/index.js +15 -0
- package/dist/commonjs/text/lib/LabelText.d.ts +8 -0
- package/dist/commonjs/text/lib/LabelText.d.ts.map +1 -0
- package/dist/commonjs/text/lib/LabelText.js +51 -0
- package/dist/commonjs/text/lib/Text.d.ts +14 -0
- package/dist/commonjs/text/lib/Text.d.ts.map +1 -0
- package/dist/commonjs/text/lib/Text.js +90 -0
- package/dist/commonjs/text/lib/TypeLevelComponents.d.ts +13 -0
- package/dist/commonjs/text/lib/TypeLevelComponents.d.ts.map +1 -0
- package/dist/commonjs/text/lib/TypeLevelComponents.js +79 -0
- package/dist/commonjs/text-input/index.d.ts.map +1 -1
- package/dist/es6/banner/lib/Banner.d.ts.map +1 -1
- package/dist/es6/banner/lib/Banner.js +2 -4
- 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/card/lib/CardBody.js +1 -3
- package/dist/es6/card/lib/CardHeading.d.ts.map +1 -1
- package/dist/es6/card/lib/CardHeading.js +2 -7
- package/dist/es6/checkbox/index.d.ts.map +1 -1
- package/dist/es6/checkbox/lib/Checkbox.d.ts.map +1 -1
- package/dist/es6/checkbox/lib/Checkbox.js +3 -14
- package/dist/es6/color-picker/index.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/useModalityType.js +13 -13
- package/dist/es6/dialog/lib/Dialog.d.ts +1 -1
- package/dist/es6/form-field/index.d.ts.map +1 -1
- package/dist/es6/form-field/lib/Hint.d.ts.map +1 -1
- package/dist/es6/form-field/lib/Hint.js +6 -14
- 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 +4 -0
- package/dist/es6/layout/index.d.ts.map +1 -1
- package/dist/es6/layout/index.js +3 -0
- package/dist/es6/layout/lib/Box.d.ts +4 -2
- package/dist/es6/layout/lib/Box.d.ts.map +1 -1
- package/dist/es6/layout/lib/Box.js +27 -3
- package/dist/es6/layout/lib/Flex.d.ts +1 -1
- package/dist/es6/layout/lib/Flex.d.ts.map +1 -1
- package/dist/es6/layout/lib/Grid.d.ts +52 -0
- package/dist/es6/layout/lib/Grid.d.ts.map +1 -0
- package/dist/es6/layout/lib/Grid.js +92 -0
- package/dist/es6/layout/lib/Stack.d.ts +4 -4
- package/dist/es6/layout/lib/Stack.js +4 -4
- package/dist/es6/layout/lib/utils/color.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/color.js +2 -1
- package/dist/es6/layout/lib/utils/font.d.ts +29 -0
- package/dist/es6/layout/lib/utils/font.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/font.js +53 -0
- package/dist/es6/layout/lib/utils/grid.d.ts +58 -0
- package/dist/es6/layout/lib/utils/grid.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/grid.js +45 -0
- package/dist/es6/layout/lib/utils/gridItem.d.ts +39 -0
- package/dist/es6/layout/lib/utils/gridItem.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/gridItem.js +39 -0
- package/dist/es6/layout/lib/utils/text.d.ts +35 -0
- package/dist/es6/layout/lib/utils/text.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/text.js +44 -0
- package/dist/es6/modal/lib/Modal.d.ts +1 -1
- package/dist/es6/modal/lib/ModalCard.d.ts.map +1 -1
- package/dist/es6/modal/lib/ModalCard.js +16 -2
- package/dist/es6/modal/lib/ModalOverlay.d.ts.map +1 -1
- package/dist/es6/modal/lib/ModalOverlay.js +26 -16
- package/dist/es6/modal/lib/hooks/useCloseOnOverlayClick.d.ts.map +1 -1
- package/dist/es6/modal/lib/hooks/useCloseOnOverlayClick.js +4 -2
- package/dist/es6/pagination/lib/Pagination/AdditionalDetails.d.ts.map +1 -1
- package/dist/es6/pagination/lib/Pagination/AdditionalDetails.js +6 -5
- package/dist/es6/pagination/lib/Pagination/GoTo/Label.d.ts.map +1 -1
- package/dist/es6/pagination/lib/Pagination/GoTo/Label.js +2 -4
- 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/PopupCard.d.ts.map +1 -1
- package/dist/es6/popup/lib/PopupCard.js +18 -10
- package/dist/es6/radio/lib/Radio.d.ts.map +1 -1
- package/dist/es6/radio/lib/Radio.js +3 -14
- package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanel.js +3 -3
- package/dist/es6/tabs/lib/TabsItem.d.ts +1 -1
- package/dist/es6/text/index.d.ts +4 -0
- package/dist/es6/text/index.d.ts.map +1 -0
- package/dist/es6/text/index.js +3 -0
- package/dist/es6/text/lib/LabelText.d.ts +8 -0
- package/dist/es6/text/lib/LabelText.d.ts.map +1 -0
- package/dist/es6/text/lib/LabelText.js +29 -0
- package/dist/es6/text/lib/Text.d.ts +14 -0
- package/dist/es6/text/lib/Text.d.ts.map +1 -0
- package/dist/es6/text/lib/Text.js +68 -0
- package/dist/es6/text/lib/TypeLevelComponents.d.ts +13 -0
- package/dist/es6/text/lib/TypeLevelComponents.d.ts.map +1 -0
- package/dist/es6/text/lib/TypeLevelComponents.js +57 -0
- package/dist/es6/text-input/index.d.ts.map +1 -1
- package/form-field/index.ts +0 -1
- package/form-field/lib/Hint.tsx +8 -19
- package/index.ts +1 -0
- package/layout/index.ts +4 -0
- package/layout/lib/Box.tsx +34 -4
- package/layout/lib/Grid.tsx +88 -0
- package/layout/lib/Stack.tsx +4 -4
- package/layout/lib/utils/color.ts +7 -2
- package/layout/lib/utils/font.ts +67 -0
- package/layout/lib/utils/grid.ts +93 -0
- package/layout/lib/utils/gridItem.ts +68 -0
- package/layout/lib/utils/text.ts +57 -0
- package/modal/lib/ModalCard.tsx +17 -4
- package/modal/lib/ModalOverlay.tsx +11 -8
- package/modal/lib/hooks/useCloseOnOverlayClick.ts +4 -2
- package/package.json +5 -5
- package/pagination/lib/Pagination/AdditionalDetails.tsx +7 -8
- package/pagination/lib/Pagination/GoTo/Label.tsx +3 -11
- package/popup/lib/PopupCard.tsx +9 -1
- package/radio/lib/Radio.tsx +9 -24
- package/side-panel/lib/SidePanel.tsx +7 -7
- package/text/LICENSE +52 -0
- package/text/README.md +5 -0
- package/text/index.ts +3 -0
- package/text/lib/LabelText.tsx +25 -0
- package/text/lib/Text.tsx +66 -0
- package/text/lib/TypeLevelComponents.tsx +43 -0
- package/text/package.json +6 -0
- package/text-input/index.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Flex.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;AASlD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Flex.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAElD,oBAAY,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;AASlD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,IAAI,4qBASf,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { BoxProps } from './Box';
|
|
2
|
+
import { GridStyleProps } from './utils/grid';
|
|
3
|
+
import { GridItemStyleProps } from './utils/gridItem';
|
|
4
|
+
export declare type GridProps = BoxProps & GridStyleProps;
|
|
5
|
+
export declare type GridItemProps = BoxProps & GridItemStyleProps;
|
|
6
|
+
/**
|
|
7
|
+
* `Grid` is a two-dimensional layout system for the web. It lets you lay content out in rows and columns.
|
|
8
|
+
* It is highly flexible, and can be used on its own or to build other components.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```
|
|
12
|
+
* import { Grid } from '@workday/canvas-kit-react/layout';
|
|
13
|
+
* `Grid` is built on top of `Box` and has access to all `BoxProps`.
|
|
14
|
+
*
|
|
15
|
+
* interface CardProps extends GridProps {
|
|
16
|
+
* // card-specific props
|
|
17
|
+
* }
|
|
18
|
+
*
|
|
19
|
+
* // `Card`'s default values are set using `GridProps`
|
|
20
|
+
* const Card = (props: CardProps) => (
|
|
21
|
+
* <Grid gridAutoFlow="row" alignItems="start" depth={1} space="m" {...props}>
|
|
22
|
+
* <h1>Hello, Card!</h1>
|
|
23
|
+
* <p>This card uses grid to set its layout.</p>
|
|
24
|
+
* </Grid>
|
|
25
|
+
* );
|
|
26
|
+
*```
|
|
27
|
+
*/
|
|
28
|
+
export declare const Grid: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").FontStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps & import("..").TextStyleProps & GridStyleProps> & {
|
|
29
|
+
/**
|
|
30
|
+
* `<Grid.Item />` is the child specific sub-component to `<Grid/>`. `<Grid.Item />` gets child specific props, whereas `<Grid./>` gets parent container props.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```
|
|
34
|
+
* import { Grid } from '@workday/canvas-kit-react/layout';
|
|
35
|
+
* `Grid` is built on top of `Box` so `<Grid.Item />` gets all `BoxProps` as well.
|
|
36
|
+
*
|
|
37
|
+
* interface CardProps extends GridItemStyleProps {
|
|
38
|
+
* // card-specific props
|
|
39
|
+
* }
|
|
40
|
+
*
|
|
41
|
+
* // `Card`'s default values are set using `GridItemStyleProps`
|
|
42
|
+
* const Card = (props: CardProps) => (
|
|
43
|
+
* <Grid.Item gridRowStart="1" gridArea="Card" {...props}>
|
|
44
|
+
* <h1>Hello, Card!</h1>
|
|
45
|
+
* <p>This card uses grid child specific props to set its layout.</p>
|
|
46
|
+
* </Grid.Item>
|
|
47
|
+
* );
|
|
48
|
+
*```
|
|
49
|
+
*/
|
|
50
|
+
Item: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").FontStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps & import("..").TextStyleProps & GridItemStyleProps>;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=Grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Grid.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,cAAc,EAAC,MAAM,cAAc,CAAC;AAClD,OAAO,EAAW,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAE9D,oBAAY,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;AAClD,oBAAY,aAAa,GAAG,QAAQ,GAAG,kBAAkB,CAAC;AAsB1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,IAAI;IAUb;;;;;;;;;;;;;;;;;;;;OAoBG;;CAIL,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import * as React from 'react';
|
|
24
|
+
import styled from '@emotion/styled';
|
|
25
|
+
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
26
|
+
import { Box } from './Box';
|
|
27
|
+
import { grid } from './utils/grid';
|
|
28
|
+
import { gridItem } from './utils/gridItem';
|
|
29
|
+
var StyledGrid = styled(Box)({
|
|
30
|
+
display: 'grid',
|
|
31
|
+
}, grid);
|
|
32
|
+
var StyledGridItem = styled(Box)(gridItem);
|
|
33
|
+
var GridItem = createComponent('div')({
|
|
34
|
+
displayName: 'Grid.Item',
|
|
35
|
+
Component: function (_a, ref, Element) {
|
|
36
|
+
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
37
|
+
return (React.createElement(StyledGridItem, __assign({ as: Element, ref: ref }, elemProps), children));
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* `Grid` is a two-dimensional layout system for the web. It lets you lay content out in rows and columns.
|
|
42
|
+
* It is highly flexible, and can be used on its own or to build other components.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```
|
|
46
|
+
* import { Grid } from '@workday/canvas-kit-react/layout';
|
|
47
|
+
* `Grid` is built on top of `Box` and has access to all `BoxProps`.
|
|
48
|
+
*
|
|
49
|
+
* interface CardProps extends GridProps {
|
|
50
|
+
* // card-specific props
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* // `Card`'s default values are set using `GridProps`
|
|
54
|
+
* const Card = (props: CardProps) => (
|
|
55
|
+
* <Grid gridAutoFlow="row" alignItems="start" depth={1} space="m" {...props}>
|
|
56
|
+
* <h1>Hello, Card!</h1>
|
|
57
|
+
* <p>This card uses grid to set its layout.</p>
|
|
58
|
+
* </Grid>
|
|
59
|
+
* );
|
|
60
|
+
*```
|
|
61
|
+
*/
|
|
62
|
+
export var Grid = createComponent('div')({
|
|
63
|
+
displayName: 'Grid',
|
|
64
|
+
Component: function (_a, ref, Element) {
|
|
65
|
+
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
66
|
+
return (React.createElement(StyledGrid, __assign({ as: Element, ref: ref }, elemProps), children));
|
|
67
|
+
},
|
|
68
|
+
subComponents: {
|
|
69
|
+
/**
|
|
70
|
+
* `<Grid.Item />` is the child specific sub-component to `<Grid/>`. `<Grid.Item />` gets child specific props, whereas `<Grid./>` gets parent container props.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```
|
|
74
|
+
* import { Grid } from '@workday/canvas-kit-react/layout';
|
|
75
|
+
* `Grid` is built on top of `Box` so `<Grid.Item />` gets all `BoxProps` as well.
|
|
76
|
+
*
|
|
77
|
+
* interface CardProps extends GridItemStyleProps {
|
|
78
|
+
* // card-specific props
|
|
79
|
+
* }
|
|
80
|
+
*
|
|
81
|
+
* // `Card`'s default values are set using `GridItemStyleProps`
|
|
82
|
+
* const Card = (props: CardProps) => (
|
|
83
|
+
* <Grid.Item gridRowStart="1" gridArea="Card" {...props}>
|
|
84
|
+
* <h1>Hello, Card!</h1>
|
|
85
|
+
* <p>This card uses grid child specific props to set its layout.</p>
|
|
86
|
+
* </Grid.Item>
|
|
87
|
+
* );
|
|
88
|
+
*```
|
|
89
|
+
*/
|
|
90
|
+
Item: GridItem,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FlexProps } from './Flex';
|
|
2
2
|
import { StackStyleProps } from './utils/stack';
|
|
3
3
|
export declare type StackProps = FlexProps & StackStyleProps;
|
|
4
|
-
export declare const Stack: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps & import("..").FlexStyleProps & StackStyleProps> & {
|
|
5
|
-
Item: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps>;
|
|
4
|
+
export declare const Stack: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").FontStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps & import("..").TextStyleProps & import("..").FlexStyleProps & StackStyleProps> & {
|
|
5
|
+
Item: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").FontStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps & import("..").TextStyleProps>;
|
|
6
6
|
};
|
|
7
7
|
export interface HStackProps extends StackProps {
|
|
8
8
|
/**
|
|
@@ -12,7 +12,7 @@ export interface HStackProps extends StackProps {
|
|
|
12
12
|
flexDirection?: 'row' | 'row-reverse';
|
|
13
13
|
}
|
|
14
14
|
export declare const HStack: import("../../common").ElementComponent<"div", HStackProps> & {
|
|
15
|
-
Item: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps>;
|
|
15
|
+
Item: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").FontStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps & import("..").TextStyleProps>;
|
|
16
16
|
};
|
|
17
17
|
export interface VStackProps extends StackProps {
|
|
18
18
|
/**
|
|
@@ -22,6 +22,6 @@ export interface VStackProps extends StackProps {
|
|
|
22
22
|
flexDirection?: 'column' | 'column-reverse';
|
|
23
23
|
}
|
|
24
24
|
export declare const VStack: import("../../common").ElementComponent<"div", VStackProps> & {
|
|
25
|
-
Item: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps>;
|
|
25
|
+
Item: import("../../common").ElementComponent<"div", import("..").BorderShorthandStyleProps & import("..").BorderColorStyleProps & import("..").BorderRadiusStyleProps & import("..").BorderLineStyleProps & import("..").BorderWidthStyleProps & import("..").BorderLogicalStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").FontStyleProps & import("..").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("..").PositionStandardProps & import("..").PositionLogicalProps & import("./utils/space").SpaceStandardProps & import("./utils/space").SpaceLogicalProps & import("..").TextStyleProps>;
|
|
26
26
|
};
|
|
27
27
|
//# sourceMappingURL=Stack.d.ts.map
|
|
@@ -55,8 +55,8 @@ export var Stack = createComponent('div')({
|
|
|
55
55
|
export var HStack = createComponent('div')({
|
|
56
56
|
displayName: 'HStack',
|
|
57
57
|
Component: function (_a, ref, Element) {
|
|
58
|
-
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
59
|
-
return (React.createElement(Stack, __assign({ as: Element, ref: ref, flexDirection:
|
|
58
|
+
var children = _a.children, _b = _a.flexDirection, flexDirection = _b === void 0 ? 'row' : _b, elemProps = __rest(_a, ["children", "flexDirection"]);
|
|
59
|
+
return (React.createElement(Stack, __assign({ as: Element, ref: ref, flexDirection: flexDirection }, elemProps), children));
|
|
60
60
|
},
|
|
61
61
|
subComponents: {
|
|
62
62
|
Item: StackItem,
|
|
@@ -65,8 +65,8 @@ export var HStack = createComponent('div')({
|
|
|
65
65
|
export var VStack = createComponent('div')({
|
|
66
66
|
displayName: 'VStack',
|
|
67
67
|
Component: function (_a, ref, Element) {
|
|
68
|
-
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
69
|
-
return (React.createElement(Stack, __assign({ as: Element, ref: ref, flexDirection:
|
|
68
|
+
var children = _a.children, _b = _a.flexDirection, flexDirection = _b === void 0 ? 'column' : _b, elemProps = __rest(_a, ["children", "flexDirection"]);
|
|
69
|
+
return (React.createElement(Stack, __assign({ as: Element, ref: ref, flexDirection: flexDirection }, elemProps), children));
|
|
70
70
|
},
|
|
71
71
|
subComponents: {
|
|
72
72
|
Item: StackItem,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/color.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/color.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,IAAI,WAAW,EACrB,WAAW,EAEZ,MAAM,kCAAkC,CAAC;AAE1C,oBAAY,WAAW,GAAG,OAAO,WAAW,CAAC;AAE7C,0CAA0C;AAC1C,oBAAY,eAAe,GAAG;IAC5B,iCAAiC;IACjC,UAAU,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACzC,uCAAuC;IACvC,eAAe,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC9C,uCAAuC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;CACrC,CAAC;AAyBF;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,eAAe,EAAE,KAAK,EAAE,CAAC,MAWxD"}
|
|
@@ -9,7 +9,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
// type changes no need
|
|
13
|
+
import { colors as colorTokens, } from '@workday/canvas-kit-react/tokens';
|
|
13
14
|
var getBackground = function (value) { return ({
|
|
14
15
|
background: colorTokens[value] || value,
|
|
15
16
|
}); };
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { type } from '@workday/canvas-kit-react/tokens';
|
|
13
|
+
var getFontFamily = function (value) { return ({
|
|
14
|
+
fontFamily: type.properties.fontFamilies[value] || value,
|
|
15
|
+
}); };
|
|
16
|
+
var getFontSize = function (value) { return ({
|
|
17
|
+
fontSize: type.properties.fontSizes[value] || value,
|
|
18
|
+
}); };
|
|
19
|
+
var getFontStyle = function (value) { return ({
|
|
20
|
+
fontStyle: value,
|
|
21
|
+
}); };
|
|
22
|
+
var getFontWeight = function (value) { return ({
|
|
23
|
+
fontWeight: type.properties.fontWeights[value] || value,
|
|
24
|
+
}); };
|
|
25
|
+
var fontProps = {
|
|
26
|
+
fontFamily: getFontFamily,
|
|
27
|
+
fontSize: getFontSize,
|
|
28
|
+
fontWeight: getFontWeight,
|
|
29
|
+
fontStyle: getFontStyle,
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A style prop function that takes components props and returns font styles from canvas token values.
|
|
33
|
+
* If no `FontStyleProps` are found, it returns an empty object.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* // You'll most likely use `font` with low-level, styled components
|
|
37
|
+
* const BoxExample = () => (
|
|
38
|
+
* <Box fontFamily="monospace" fontWeight="medium">Hello, fonts!</Box>
|
|
39
|
+
* );
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
export function font(props) {
|
|
43
|
+
var styles = {};
|
|
44
|
+
for (var key in props) {
|
|
45
|
+
if (key in fontProps) {
|
|
46
|
+
var value = props[key];
|
|
47
|
+
var fontFn = fontProps[key];
|
|
48
|
+
var style = fontFn(value);
|
|
49
|
+
styles = __assign(__assign({}, styles), style);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return styles;
|
|
53
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Property } from 'csstype';
|
|
2
|
+
/** style props to for grid container properties */
|
|
3
|
+
export declare type GridStyleProps = {
|
|
4
|
+
/** sets `align-items` property */
|
|
5
|
+
alignItems?: Property.AlignItems;
|
|
6
|
+
/** sets `align-content` property */
|
|
7
|
+
alignContent?: Property.AlignContent;
|
|
8
|
+
/**
|
|
9
|
+
* sets `display` property
|
|
10
|
+
* @default 'grid'
|
|
11
|
+
* */
|
|
12
|
+
display?: 'grid' | 'inline-grid';
|
|
13
|
+
/** sets `justify-items` property */
|
|
14
|
+
justifyItems?: Property.JustifyItems;
|
|
15
|
+
/** sets `justify-content` property */
|
|
16
|
+
justifyContent?: Property.JustifyContent;
|
|
17
|
+
/** sets `grid-template` property */
|
|
18
|
+
gridTemplate?: Property.GridTemplate;
|
|
19
|
+
/** sets `grid-template-area` property */
|
|
20
|
+
gridTemplateAreas?: Property.GridTemplateAreas;
|
|
21
|
+
/** sets `grid-template-columns` property */
|
|
22
|
+
gridTemplateColumns?: Property.GridTemplateColumns;
|
|
23
|
+
/** sets `grid-template-rows` property */
|
|
24
|
+
gridTemplateRows?: Property.GridTemplateRows;
|
|
25
|
+
/** sets `gap` property */
|
|
26
|
+
gridGap?: Property.GridGap;
|
|
27
|
+
/** sets `column-gap` property */
|
|
28
|
+
gridColumnGap?: Property.GridColumnGap;
|
|
29
|
+
/** sets `row-gap` property */
|
|
30
|
+
gridRowGap?: Property.GridRowGap;
|
|
31
|
+
/** sets `place-items` property */
|
|
32
|
+
gridPlaceItems?: Property.PlaceItems;
|
|
33
|
+
/** sets `grid-auto-columns` property */
|
|
34
|
+
gridAutoColumns?: Property.GridAutoColumns;
|
|
35
|
+
/** sets `grid-auto-rows` property */
|
|
36
|
+
gridAutoRows?: Property.GridAutoRows;
|
|
37
|
+
/** sets `grid-area` property */
|
|
38
|
+
gridArea?: Property.GridArea;
|
|
39
|
+
/** sets `grid-auto-flow` property */
|
|
40
|
+
gridAutoFlow?: Property.GridAutoFlow;
|
|
41
|
+
/** sets `grid` property */
|
|
42
|
+
grid?: Property.Grid;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* A style prop function that takes component props and returns grid styles.
|
|
46
|
+
* If no `GridStyleProps` are found, it returns an empty object.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* // You'll most likely use `grid` with low-level, styled components
|
|
50
|
+
* const GridExample = () => (
|
|
51
|
+
* <Grid gridAutoFlow="row" justifyContent="center" alignItems="center">
|
|
52
|
+
* Hello, Grid!
|
|
53
|
+
* </Grid>
|
|
54
|
+
* );
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
export declare function grid<P extends GridStyleProps>(props: P): {};
|
|
58
|
+
//# sourceMappingURL=grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,mDAAmD;AACnD,oBAAY,cAAc,GAAG;IAC3B,kCAAkC;IAClC,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,oCAAoC;IACpC,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC;;;SAGK;IACL,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IACjC,oCAAoC;IACpC,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC,sCAAsC;IACtC,cAAc,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC;IAGzC,oCAAoC;IACpC,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC,yCAAyC;IACzC,iBAAiB,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC;IAC/C,4CAA4C;IAC5C,mBAAmB,CAAC,EAAE,QAAQ,CAAC,mBAAmB,CAAC;IACnD,yCAAyC;IACzC,gBAAgB,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAC7C,0BAA0B;IAC1B,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC;IAC3B,iCAAiC;IACjC,aAAa,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC;IACvC,8BAA8B;IAC9B,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,kCAAkC;IAClC,cAAc,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACrC,wCAAwC;IACxC,eAAe,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC;IAC3C,qCAAqC;IACrC,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC,gCAAgC;IAChC,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAC7B,qCAAqC;IACrC,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC,2BAA2B;IAC3B,IAAI,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC;CACtB,CAAC;AAuBF;;;;;;;;;;;;GAYG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,cAAc,EAAE,KAAK,EAAE,CAAC,MAWtD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var gridProps = {
|
|
2
|
+
alignContent: 'alignContent',
|
|
3
|
+
alignItems: 'alignItems',
|
|
4
|
+
display: 'display',
|
|
5
|
+
justifyContent: 'justifyContent',
|
|
6
|
+
justifyItems: 'justifyItems',
|
|
7
|
+
gridTemplateAreas: 'gridTemplateAreas',
|
|
8
|
+
gridTemplate: 'gridTemplate',
|
|
9
|
+
gridTemplateColumns: 'gridTemplateColumns',
|
|
10
|
+
gridTemplateRows: 'gridTemplateRows',
|
|
11
|
+
gridGap: 'gridGap',
|
|
12
|
+
gridColumnGap: 'gridColumnGap',
|
|
13
|
+
gridRowGap: 'gridRowGap',
|
|
14
|
+
gridPlaceItems: 'gridPlaceItems',
|
|
15
|
+
gridAutoColumns: 'gridAutoColumns',
|
|
16
|
+
gridAutoRows: 'gridAutoRows',
|
|
17
|
+
gridAutoFlow: 'gridAutoFlow',
|
|
18
|
+
gridArea: 'gridArea',
|
|
19
|
+
grid: 'grid',
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A style prop function that takes component props and returns grid styles.
|
|
23
|
+
* If no `GridStyleProps` are found, it returns an empty object.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // You'll most likely use `grid` with low-level, styled components
|
|
27
|
+
* const GridExample = () => (
|
|
28
|
+
* <Grid gridAutoFlow="row" justifyContent="center" alignItems="center">
|
|
29
|
+
* Hello, Grid!
|
|
30
|
+
* </Grid>
|
|
31
|
+
* );
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
export function grid(props) {
|
|
35
|
+
var styles = {};
|
|
36
|
+
for (var key in props) {
|
|
37
|
+
if (key in gridProps) {
|
|
38
|
+
var attr = gridProps[key];
|
|
39
|
+
var value = props[key];
|
|
40
|
+
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
41
|
+
styles[attr] = value;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return styles;
|
|
45
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Property } from 'csstype';
|
|
2
|
+
/** style props to for grid item properties */
|
|
3
|
+
export declare type GridItemStyleProps = {
|
|
4
|
+
/** sets `grid-column-start` property */
|
|
5
|
+
gridColumnStart?: Property.GridColumnStart;
|
|
6
|
+
/** sets `grid-column-end` property */
|
|
7
|
+
gridColumnEnd?: Property.GridColumnEnd;
|
|
8
|
+
/** sets `grid-row-start` property */
|
|
9
|
+
gridRowStart?: Property.GridRowStart;
|
|
10
|
+
/** sets `grid-row-end` property */
|
|
11
|
+
gridRowEnd?: Property.GridRowEnd;
|
|
12
|
+
/** sets `grid-column` property */
|
|
13
|
+
gridColumn?: Property.GridColumn;
|
|
14
|
+
/** sets `grid-row` property */
|
|
15
|
+
gridRow?: Property.GridRow;
|
|
16
|
+
/** sets `grid-area` property */
|
|
17
|
+
gridArea?: Property.GridArea;
|
|
18
|
+
/** sets `justify-self` property */
|
|
19
|
+
justifySelf?: Property.JustifySelf;
|
|
20
|
+
/** sets `align-self` property */
|
|
21
|
+
alignSelf?: Property.AlignSelf;
|
|
22
|
+
/** sets `place-self` property */
|
|
23
|
+
placeSelf?: Property.PlaceSelf;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A style prop function that takes component props and returns grid styles.
|
|
27
|
+
* If no `GridItemStyleProps` are found, it returns an empty object.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* // You'll most likely use `grid item` with low-level, styled components
|
|
31
|
+
* const GridItemExample = () => (
|
|
32
|
+
* <Grid.Item gridRowStart="1" justifySelf="center" gridArea="Card">
|
|
33
|
+
* Hello, Grid Item!
|
|
34
|
+
* </Grid.Item>
|
|
35
|
+
* );
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
export declare function gridItem<P extends GridItemStyleProps>(props: P): {};
|
|
39
|
+
//# sourceMappingURL=gridItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gridItem.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/gridItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,8CAA8C;AAC9C,oBAAY,kBAAkB,GAAG;IAE/B,wCAAwC;IACxC,eAAe,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC;IAC3C,sCAAsC;IACtC,aAAa,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC;IACvC,qCAAqC;IACrC,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC,mCAAmC;IACnC,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,kCAAkC;IAClC,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,+BAA+B;IAC/B,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC;IAC3B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAC7B,mCAAmC;IACnC,WAAW,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC;IACnC,iCAAiC;IACjC,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC/B,iCAAiC;IACjC,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;CAChC,CAAC;AAiBF;;;;;;;;;;;;GAYG;AAEH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,kBAAkB,EAAE,KAAK,EAAE,CAAC,MAW9D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** style props to for grid item properties */
|
|
2
|
+
var gridItemProps = {
|
|
3
|
+
//Child Props
|
|
4
|
+
gridColumnStart: 'gridColumnStart',
|
|
5
|
+
gridColumnEnd: 'gridColumnEnd',
|
|
6
|
+
gridRowStart: 'gridRowStart',
|
|
7
|
+
gridRowEnd: 'gridRowEnd',
|
|
8
|
+
gridColumn: 'gridColumn',
|
|
9
|
+
gridRow: 'gridRow',
|
|
10
|
+
gridArea: 'gridArea',
|
|
11
|
+
justifySelf: 'justifySelf',
|
|
12
|
+
alignSelf: 'alignSelf',
|
|
13
|
+
placeSelf: 'placeSelf',
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A style prop function that takes component props and returns grid styles.
|
|
17
|
+
* If no `GridItemStyleProps` are found, it returns an empty object.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // You'll most likely use `grid item` with low-level, styled components
|
|
21
|
+
* const GridItemExample = () => (
|
|
22
|
+
* <Grid.Item gridRowStart="1" justifySelf="center" gridArea="Card">
|
|
23
|
+
* Hello, Grid Item!
|
|
24
|
+
* </Grid.Item>
|
|
25
|
+
* );
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export function gridItem(props) {
|
|
29
|
+
var styles = {};
|
|
30
|
+
for (var key in props) {
|
|
31
|
+
if (key in gridItemProps) {
|
|
32
|
+
var attr = gridItemProps[key];
|
|
33
|
+
var value = props[key];
|
|
34
|
+
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
35
|
+
styles[attr] = value;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return styles;
|
|
39
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Property } from 'csstype';
|
|
2
|
+
/** style props to for text properties */
|
|
3
|
+
export declare type TextStyleProps = {
|
|
4
|
+
/** sets `line-height` property */
|
|
5
|
+
lineHeight?: Property.LineHeight;
|
|
6
|
+
/** sets `letter-spacing` property */
|
|
7
|
+
letterSpacing?: Property.LetterSpacing;
|
|
8
|
+
/** sets `text-align` property */
|
|
9
|
+
textAlign?: Property.TextAlign;
|
|
10
|
+
/** sets `text-decoration` property */
|
|
11
|
+
textDecoration?: Property.TextDecoration;
|
|
12
|
+
/** sets `text-overflow` property */
|
|
13
|
+
textOverflow?: Property.TextOverflow;
|
|
14
|
+
/** sets `text-transform` property */
|
|
15
|
+
textTransform?: Property.TextTransform;
|
|
16
|
+
/** sets `text-shadow` property */
|
|
17
|
+
textShadow?: Property.TextShadow;
|
|
18
|
+
/** sets `white-space` property */
|
|
19
|
+
whiteSpace?: Property.WhiteSpace;
|
|
20
|
+
/** sets `word-break` property */
|
|
21
|
+
wordBreak?: Property.WordBreak;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* A style prop function that takes components props and returns text styles.
|
|
25
|
+
* If no `TextStyleProps` are found, it returns an empty object.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // You'll most likely use `text-align` with low-level, styled components
|
|
29
|
+
* const BoxExample = () => (
|
|
30
|
+
* <Box textAlign="center">Hello, alignment!</Box>
|
|
31
|
+
* );
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
export declare function text<P extends TextStyleProps>(props: P): {};
|
|
35
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,yCAAyC;AACzC,oBAAY,cAAc,GAAG;IAC3B,kCAAkC;IAClC,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,qCAAqC;IACrC,aAAa,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC;IACvC,iCAAiC;IACjC,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC/B,sCAAsC;IACtC,cAAc,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC;IACzC,oCAAoC;IACpC,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC,qCAAqC;IACrC,aAAa,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC;IACvC,kCAAkC;IAClC,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,kCAAkC;IAClC,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,iCAAiC;IACjC,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;CAChC,CAAC;AAcF;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,cAAc,EAAE,KAAK,EAAE,CAAC,MAStD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var textProps = [
|
|
13
|
+
'lineHeight',
|
|
14
|
+
'letterSpacing',
|
|
15
|
+
'textAlign',
|
|
16
|
+
'textDecoration',
|
|
17
|
+
'textOverflow',
|
|
18
|
+
'textTransform',
|
|
19
|
+
'textShadow',
|
|
20
|
+
'whiteSpace',
|
|
21
|
+
'wordBreak',
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* A style prop function that takes components props and returns text styles.
|
|
25
|
+
* If no `TextStyleProps` are found, it returns an empty object.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // You'll most likely use `text-align` with low-level, styled components
|
|
29
|
+
* const BoxExample = () => (
|
|
30
|
+
* <Box textAlign="center">Hello, alignment!</Box>
|
|
31
|
+
* );
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
export function text(props) {
|
|
35
|
+
var _a;
|
|
36
|
+
var styles = {};
|
|
37
|
+
for (var key in props) {
|
|
38
|
+
if (textProps.includes(key)) {
|
|
39
|
+
var value = props[key];
|
|
40
|
+
styles = __assign(__assign({}, styles), (_a = {}, _a[key] = value, _a));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return styles;
|
|
44
|
+
}
|
|
@@ -99,7 +99,7 @@ export declare const Modal: import("../../common").ComponentM<import("../../dial
|
|
|
99
99
|
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
100
100
|
};
|
|
101
101
|
}> & {
|
|
102
|
-
Body: import("../../common").ElementComponentM<"div", import("../..").BorderShorthandStyleProps & import("../..").BorderColorStyleProps & import("../..").BorderRadiusStyleProps & import("../..").BorderLineStyleProps & import("../..").BorderWidthStyleProps & import("../..").BorderLogicalStyleProps & import("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").LayoutStyleProps & import("../../layout/lib/utils/other").OtherStyleProps & import("../..").PositionStandardProps & import("../..").PositionLogicalProps & import("../../layout/lib/utils/space").SpaceStandardProps & import("../../layout/lib/utils/space").SpaceLogicalProps & React.HTMLAttributes<HTMLDivElement>, {
|
|
102
|
+
Body: import("../../common").ElementComponentM<"div", import("../..").BorderShorthandStyleProps & import("../..").BorderColorStyleProps & import("../..").BorderRadiusStyleProps & import("../..").BorderLineStyleProps & import("../..").BorderWidthStyleProps & import("../..").BorderLogicalStyleProps & import("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").FontStyleProps & import("../..").LayoutStyleProps & import("../../layout/lib/utils/other").OtherStyleProps & import("../..").PositionStandardProps & import("../..").PositionLogicalProps & import("../../layout/lib/utils/space").SpaceStandardProps & import("../../layout/lib/utils/space").SpaceLogicalProps & import("../..").TextStyleProps & React.HTMLAttributes<HTMLDivElement>, {
|
|
103
103
|
state: {
|
|
104
104
|
stackRef: React.RefObject<HTMLDivElement>;
|
|
105
105
|
targetRef: React.RefObject<HTMLButtonElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalCard.d.ts","sourceRoot":"","sources":["../../../../modal/lib/ModalCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,
|
|
1
|
+
{"version":3,"file":"ModalCard.d.ts","sourceRoot":"","sources":["../../../../modal/lib/ModalCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AAItD,MAAM,WAAW,cAAe,SAAQ,YAAY,CAAC,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC;CAAG;AAWjF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;EAMpB,CAAC"}
|