@workday/canvas-kit-docs 13.0.0-alpha.950-next.0 → 13.0.0-alpha.996-next.0
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/dist/es6/index.d.ts +0 -1
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +0 -1
- package/dist/es6/lib/docs.js +2058 -189
- package/dist/es6/mdx/versionsTable.d.ts.map +1 -1
- package/dist/es6/mdx/versionsTable.js +4 -0
- package/dist/es6/mdx/welcomePage.js +1 -1
- package/dist/mdx/10.0-UPGRADE-GUIDE.mdx +1 -1
- package/dist/mdx/11.0-UPGRADE-GUIDE.mdx +6 -6
- package/dist/mdx/12.0-UPGRADE-GUIDE.mdx +6 -6
- package/dist/mdx/CONTRIBUTING.mdx +1 -1
- package/dist/mdx/CREATING_COMPOUND_COMPONENTS.mdx +31 -0
- package/dist/mdx/preview-react/InformationHighlight/InformationHighlight.mdx +109 -0
- package/dist/mdx/preview-react/InformationHighlight/examples/Basic.tsx +18 -0
- package/dist/mdx/preview-react/InformationHighlight/examples/Body.tsx +13 -0
- package/dist/mdx/preview-react/InformationHighlight/examples/Caution.tsx +27 -0
- package/dist/mdx/preview-react/InformationHighlight/examples/Critical.tsx +33 -0
- package/dist/mdx/preview-react/InformationHighlight/examples/CustomIconCritical.tsx +28 -0
- package/dist/mdx/preview-react/InformationHighlight/examples/Heading.tsx +11 -0
- package/dist/mdx/preview-react/InformationHighlight/examples/Informational.tsx +27 -0
- package/dist/mdx/preview-react/InformationHighlight/examples/RTL.tsx +42 -0
- package/dist/mdx/preview-react/radio/Radio.mdx +2 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Alert.tsx +1 -1
- package/dist/mdx/preview-react/status-indicator/StatusIndicator.mdx +2 -2
- package/dist/mdx/react/_examples/GlobalHeader.mdx +36 -0
- package/dist/mdx/react/_examples/mdx/CompoundComponent.mdx +2 -2
- package/dist/mdx/react/_examples/mdx/Headers.mdx +26 -0
- package/dist/mdx/react/_examples/mdx/examples/GlobalHeader.tsx +267 -37
- package/dist/mdx/react/badge/CountBadge.mdx +2 -2
- package/dist/mdx/react/breadcrumbs/examples/Overflow.tsx +13 -4
- package/dist/mdx/react/button/button/Button.mdx +5 -5
- package/dist/mdx/react/card/card.mdx +2 -2
- package/dist/mdx/react/checkbox/Checkbox.mdx +5 -5
- package/dist/mdx/react/combobox/Combobox.mdx +2 -2
- package/dist/mdx/react/form-field/FormField.mdx +2 -2
- package/dist/mdx/react/modal/examples/IframeTest.tsx +4 -1
- package/dist/mdx/react/popup/examples/PopupWithFallbackPlacements.tsx +102 -53
- package/dist/mdx/react/select/Select.mdx +6 -6
- package/dist/mdx/react/switch/Switch.mdx +5 -5
- package/dist/mdx/react/table/Table.mdx +2 -2
- package/dist/mdx/react/text/BodyText.mdx +2 -2
- package/dist/mdx/react/text/Heading.mdx +2 -2
- package/dist/mdx/react/text/Subtext.mdx +2 -2
- package/dist/mdx/react/text/Text.mdx +2 -2
- package/dist/mdx/react/text/Title.mdx +2 -2
- package/dist/mdx/react/tokens/Tokens.mdx +2 -1
- package/dist/mdx/welcome.mdx +3 -3
- package/index.ts +0 -1
- package/package.json +7 -7
- package/dist/es6/lib/InformationHighlight/Base.d.ts +0 -5
- package/dist/es6/lib/InformationHighlight/Base.d.ts.map +0 -1
- package/dist/es6/lib/InformationHighlight/Base.js +0 -9
- package/dist/es6/lib/InformationHighlight/Body.d.ts +0 -2
- package/dist/es6/lib/InformationHighlight/Body.d.ts.map +0 -1
- package/dist/es6/lib/InformationHighlight/Body.js +0 -18
- package/dist/es6/lib/InformationHighlight/Heading.d.ts +0 -2
- package/dist/es6/lib/InformationHighlight/Heading.d.ts.map +0 -1
- package/dist/es6/lib/InformationHighlight/Heading.js +0 -17
- package/dist/es6/lib/InformationHighlight/Icon.d.ts +0 -13
- package/dist/es6/lib/InformationHighlight/Icon.d.ts.map +0 -1
- package/dist/es6/lib/InformationHighlight/Icon.js +0 -44
- package/dist/es6/lib/InformationHighlight/Link.d.ts +0 -2
- package/dist/es6/lib/InformationHighlight/Link.d.ts.map +0 -1
- package/dist/es6/lib/InformationHighlight/Link.js +0 -18
- package/dist/es6/lib/InformationHighlight/index.d.ts +0 -25
- package/dist/es6/lib/InformationHighlight/index.d.ts.map +0 -1
- package/dist/es6/lib/InformationHighlight/index.js +0 -44
- package/dist/es6/lib/InformationHighlight/modelHook.d.ts +0 -19
- package/dist/es6/lib/InformationHighlight/modelHook.d.ts.map +0 -1
- package/dist/es6/lib/InformationHighlight/modelHook.js +0 -13
- package/lib/InformationHighlight/Base.tsx +0 -12
- package/lib/InformationHighlight/Body.tsx +0 -21
- package/lib/InformationHighlight/Heading.tsx +0 -20
- package/lib/InformationHighlight/Icon.tsx +0 -65
- package/lib/InformationHighlight/Link.tsx +0 -20
- package/lib/InformationHighlight/index.tsx +0 -62
- package/lib/InformationHighlight/modelHook.ts +0 -16
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {PopperController} from '../../../../../utils/storybook';
|
|
3
2
|
import {DeleteButton} from '@workday/canvas-kit-react/button';
|
|
4
3
|
import {
|
|
5
4
|
Popup,
|
|
@@ -8,14 +7,12 @@ import {
|
|
|
8
7
|
useCloseOnOutsideClick,
|
|
9
8
|
useInitialFocus,
|
|
10
9
|
useReturnFocus,
|
|
11
|
-
Placement,
|
|
12
10
|
} from '@workday/canvas-kit-react/popup';
|
|
13
|
-
import {
|
|
11
|
+
import {Flex, Grid} from '@workday/canvas-kit-react/layout';
|
|
12
|
+
import {createStyles, calc} from '@workday/canvas-kit-styling';
|
|
13
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
14
14
|
|
|
15
15
|
export default () => {
|
|
16
|
-
const [placement, setPlacement] = React.useState<Placement>('top');
|
|
17
|
-
const [marginLeftBtn, setMarginLeftBtn] = React.useState(0);
|
|
18
|
-
const [marginRightBtn, setMarginRightBtn] = React.useState(0);
|
|
19
16
|
const model = usePopupModel();
|
|
20
17
|
|
|
21
18
|
useCloseOnOutsideClick(model);
|
|
@@ -27,56 +24,108 @@ export default () => {
|
|
|
27
24
|
console.log('Delete Item');
|
|
28
25
|
};
|
|
29
26
|
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
setMarginLeftBtn(marginLeftBtn);
|
|
36
|
-
};
|
|
27
|
+
const grid = createStyles({
|
|
28
|
+
gridTemplateAreas: "'topButton topButton''leftButton rightButton''bottomButton bottomButton'",
|
|
29
|
+
height: calc.subtract('100vh', system.space.x16),
|
|
30
|
+
width: calc.subtract('100vw', system.space.x20),
|
|
31
|
+
});
|
|
37
32
|
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
const topButton = createStyles({
|
|
34
|
+
gridArea: 'topButton',
|
|
35
|
+
justifySelf: 'center',
|
|
36
|
+
});
|
|
37
|
+
const rightButton = createStyles({
|
|
38
|
+
gridArea: 'rightButton',
|
|
39
|
+
justifySelf: 'right',
|
|
40
|
+
alignSelf: 'center',
|
|
41
|
+
});
|
|
42
|
+
const bottomButton = createStyles({
|
|
43
|
+
gridArea: 'bottomButton',
|
|
44
|
+
justifySelf: 'center',
|
|
45
|
+
alignSelf: 'end',
|
|
46
|
+
});
|
|
47
|
+
const leftButton = createStyles({
|
|
48
|
+
gridArea: 'leftButton',
|
|
49
|
+
justifySelf: 'left',
|
|
50
|
+
alignSelf: 'center',
|
|
51
|
+
});
|
|
41
52
|
|
|
42
53
|
return (
|
|
43
|
-
<div
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
54
|
+
<div data-testid="scroll-area-fallback-placement">
|
|
55
|
+
<Grid cs={grid}>
|
|
56
|
+
<Popup>
|
|
57
|
+
<Popup.Target cs={topButton} as={DeleteButton}>
|
|
58
|
+
Placement Top
|
|
59
|
+
</Popup.Target>
|
|
60
|
+
<Popup.Popper placement="top">
|
|
61
|
+
<Popup.Card width={400}>
|
|
62
|
+
<Popup.CloseIcon aria-label="Close" />
|
|
63
|
+
<Popup.Heading paddingTop="m">This is Popup heading</Popup.Heading>
|
|
64
|
+
<Popup.Body>Are you sure you'd like to delete the item titled 'My Item'?</Popup.Body>
|
|
65
|
+
<Flex gap="s" padding="xxs" marginTop="xxs">
|
|
66
|
+
<Popup.CloseButton as={DeleteButton} onClick={handleDelete}>
|
|
67
|
+
Delete
|
|
68
|
+
</Popup.CloseButton>
|
|
69
|
+
<Popup.CloseButton>Cancel</Popup.CloseButton>
|
|
70
|
+
</Flex>
|
|
71
|
+
</Popup.Card>
|
|
72
|
+
</Popup.Popper>
|
|
73
|
+
</Popup>
|
|
74
|
+
<Popup>
|
|
75
|
+
<Popup.Target cs={leftButton} as={DeleteButton}>
|
|
76
|
+
Placement Left
|
|
77
|
+
</Popup.Target>
|
|
78
|
+
<Popup.Popper placement="left">
|
|
79
|
+
<Popup.Card width={400}>
|
|
80
|
+
<Popup.CloseIcon aria-label="Close" />
|
|
81
|
+
<Popup.Heading paddingTop="m">This is Popup heading</Popup.Heading>
|
|
82
|
+
<Popup.Body>Are you sure you'd like to delete the item titled 'My Item'?</Popup.Body>
|
|
83
|
+
<Flex gap="s" padding="xxs" marginTop="xxs">
|
|
84
|
+
<Popup.CloseButton as={DeleteButton} onClick={handleDelete}>
|
|
85
|
+
Delete
|
|
86
|
+
</Popup.CloseButton>
|
|
87
|
+
<Popup.CloseButton>Cancel</Popup.CloseButton>
|
|
88
|
+
</Flex>
|
|
89
|
+
</Popup.Card>
|
|
90
|
+
</Popup.Popper>
|
|
91
|
+
</Popup>
|
|
92
|
+
<Popup>
|
|
93
|
+
<Popup.Target cs={rightButton} as={DeleteButton}>
|
|
94
|
+
Placement Right
|
|
95
|
+
</Popup.Target>
|
|
96
|
+
<Popup.Popper placement="right">
|
|
97
|
+
<Popup.Card width={400}>
|
|
98
|
+
<Popup.CloseIcon aria-label="Close" />
|
|
99
|
+
<Popup.Heading paddingTop="m">This is Popup heading</Popup.Heading>
|
|
100
|
+
<Popup.Body>Are you sure you'd like to delete the item titled 'My Item'?</Popup.Body>
|
|
101
|
+
<Flex gap="s" padding="xxs" marginTop="xxs">
|
|
102
|
+
<Popup.CloseButton as={DeleteButton} onClick={handleDelete}>
|
|
103
|
+
Delete
|
|
104
|
+
</Popup.CloseButton>
|
|
105
|
+
<Popup.CloseButton>Cancel</Popup.CloseButton>
|
|
106
|
+
</Flex>
|
|
107
|
+
</Popup.Card>
|
|
108
|
+
</Popup.Popper>
|
|
109
|
+
</Popup>
|
|
110
|
+
<Popup>
|
|
111
|
+
<Popup.Target cs={bottomButton} as={DeleteButton}>
|
|
112
|
+
Placement Bottom
|
|
113
|
+
</Popup.Target>
|
|
114
|
+
<Popup.Popper placement="bottom">
|
|
115
|
+
<Popup.Card width={400}>
|
|
116
|
+
<Popup.CloseIcon aria-label="Close" />
|
|
117
|
+
<Popup.Heading paddingTop="m">This is Popup heading</Popup.Heading>
|
|
118
|
+
<Popup.Body>Are you sure you'd like to delete the item titled 'My Item'?</Popup.Body>
|
|
119
|
+
<Flex gap="s" padding="xxs" marginTop="xxs">
|
|
120
|
+
<Popup.CloseButton as={DeleteButton} onClick={handleDelete}>
|
|
121
|
+
Delete
|
|
122
|
+
</Popup.CloseButton>
|
|
123
|
+
<Popup.CloseButton>Cancel</Popup.CloseButton>
|
|
124
|
+
</Flex>
|
|
125
|
+
</Popup.Card>
|
|
126
|
+
</Popup.Popper>
|
|
127
|
+
</Popup>
|
|
128
|
+
</Grid>
|
|
80
129
|
</div>
|
|
81
130
|
);
|
|
82
131
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
ExampleCodeBlock,
|
|
3
|
+
InformationHighlight,
|
|
4
|
+
SymbolDoc,
|
|
5
|
+
Specifications,
|
|
6
6
|
} from '@workday/canvas-kit-docs';
|
|
7
7
|
import Alert from './examples/Alert';
|
|
8
8
|
import Basic from './examples/Basic';
|
|
@@ -20,7 +20,7 @@ import HoistedModel from './examples/HoistedModel';
|
|
|
20
20
|
import RefForwarding from './examples/RefForwarding';
|
|
21
21
|
import FetchingDynamicItems from './examples/FetchingDynamicItems';
|
|
22
22
|
import Placeholder from './examples/Placeholder';
|
|
23
|
-
import InitialSelectedItem from './examples/InitialSelectedItem';import {Table} from '@workday/canvas-kit-react/table';
|
|
23
|
+
import InitialSelectedItem from './examples/InitialSelectedItem';import { Table } from '@workday/canvas-kit-react/table';
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
# Canvas Kit Select
|
|
@@ -305,7 +305,7 @@ prop as well as the `value` DOM property and will update the model accordingly.
|
|
|
305
305
|
|
|
306
306
|
Select and its subcomponents support custom styling via the `cs` prop. For more information, check
|
|
307
307
|
our
|
|
308
|
-
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--
|
|
308
|
+
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--docs).
|
|
309
309
|
|
|
310
310
|
## Component API
|
|
311
311
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
ExampleCodeBlock,
|
|
3
|
+
SymbolDoc,
|
|
4
|
+
Specifications,
|
|
5
|
+
InformationHighlight,
|
|
6
6
|
} from '@workday/canvas-kit-docs';
|
|
7
7
|
import Alert from './examples/Alert';
|
|
8
8
|
import Basic from './examples/Basic';
|
|
@@ -73,7 +73,7 @@ The `error` prop may be applied directly to the Switch with a value of `Switch.E
|
|
|
73
73
|
### Custom Styles
|
|
74
74
|
|
|
75
75
|
Switch supports custom styling via the `cs` prop. For more information, check our
|
|
76
|
-
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--
|
|
76
|
+
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--docs).
|
|
77
77
|
|
|
78
78
|
## Component API
|
|
79
79
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
1
|
+
import { ExampleCodeBlock, SymbolDoc } from '@workday/canvas-kit-docs';
|
|
2
2
|
import Basic from './examples/Basic';
|
|
3
3
|
import BasicWithHeading from './examples/BasicWithHeading';
|
|
4
4
|
import FixedColumn from './examples/FixedColumn';
|
|
@@ -62,7 +62,7 @@ You can also find several advanced Table examples in our Storybook Examples sect
|
|
|
62
62
|
|
|
63
63
|
Table and its subcomponents support custom styling via the `cs` prop. For more information, check
|
|
64
64
|
our
|
|
65
|
-
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--
|
|
65
|
+
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--docs).
|
|
66
66
|
|
|
67
67
|
## Component API
|
|
68
68
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
1
|
+
import { ExampleCodeBlock, SymbolDoc } from '@workday/canvas-kit-docs';
|
|
2
2
|
import Basic from './examples/BodyText/Basic';
|
|
3
3
|
|
|
4
4
|
# Canvas Kit Body Text
|
|
@@ -29,7 +29,7 @@ You may override the rendered element using the `as` prop.
|
|
|
29
29
|
### Custom Styles
|
|
30
30
|
|
|
31
31
|
Body Text supports custom styling via the `cs` prop. For more information, check our
|
|
32
|
-
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--
|
|
32
|
+
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--docs).
|
|
33
33
|
|
|
34
34
|
## Component API
|
|
35
35
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';import Basic from './examples/Heading/Basic';
|
|
1
|
+
import { ExampleCodeBlock, SymbolDoc } from '@workday/canvas-kit-docs';import Basic from './examples/Heading/Basic';
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
# Canvas Kit Heading
|
|
@@ -29,7 +29,7 @@ according to the [Canvas type hierarchy](/tokens/type/#type-styles).
|
|
|
29
29
|
### Custom Styles
|
|
30
30
|
|
|
31
31
|
Heading supports custom styling via the `cs` prop. For more information, check our
|
|
32
|
-
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--
|
|
32
|
+
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--docs).
|
|
33
33
|
|
|
34
34
|
## Component API
|
|
35
35
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
1
|
+
import { ExampleCodeBlock, SymbolDoc } from '@workday/canvas-kit-docs';
|
|
2
2
|
import Basic from './examples/Subtext/Basic';
|
|
3
3
|
|
|
4
4
|
# Canvas Kit Subtext
|
|
@@ -29,7 +29,7 @@ You may override the rendered element using the `as` prop.
|
|
|
29
29
|
### Custom Styles
|
|
30
30
|
|
|
31
31
|
Subtext supports custom styling via the `cs` prop. For more information, check our
|
|
32
|
-
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--
|
|
32
|
+
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--docs).
|
|
33
33
|
|
|
34
34
|
## Component API
|
|
35
35
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
1
|
+
import { ExampleCodeBlock, SymbolDoc } from '@workday/canvas-kit-docs';
|
|
2
2
|
import Basic from './examples/Text/Basic';
|
|
3
3
|
import TypeLevel from './examples/Text/TypeLevel';
|
|
4
4
|
import Variant from './examples/Text/Variant';
|
|
@@ -44,7 +44,7 @@ understanding of the text being rendered.
|
|
|
44
44
|
### Custom Styles
|
|
45
45
|
|
|
46
46
|
Text supports custom styling via the `cs` prop. For more information, check our
|
|
47
|
-
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--
|
|
47
|
+
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--docs).
|
|
48
48
|
|
|
49
49
|
## Component API
|
|
50
50
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
1
|
+
import { ExampleCodeBlock, SymbolDoc } from '@workday/canvas-kit-docs';
|
|
2
2
|
import Basic from './examples/Title/Basic';
|
|
3
3
|
|
|
4
4
|
# Canvas Kit Title
|
|
@@ -29,7 +29,7 @@ You may override the rendered element using the `as` prop.
|
|
|
29
29
|
### Custom Styles
|
|
30
30
|
|
|
31
31
|
Title supports custom styling via the `cs` prop. For more information, check our
|
|
32
|
-
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--
|
|
32
|
+
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--docs).
|
|
33
33
|
|
|
34
34
|
## Component API
|
|
35
35
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {ExampleCodeBlock
|
|
1
|
+
import {ExampleCodeBlock} from '@workday/canvas-kit-docs';
|
|
2
|
+
import {InformationHighlight} from '@workday/canvas-kit-preview-react/InformationHighlight';import {BorderRadius, Space, Depth, Colors, Type} from './examples/Tokens';
|
|
2
3
|
import Overview from './examples/Overview';
|
|
3
4
|
|
|
4
5
|
|
package/dist/mdx/welcome.mdx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Readme from '../../../README.md';
|
|
2
2
|
import Markdown from '../../../utils/storybook/Markdown.tsx';
|
|
3
|
-
import {WelcomePage} from './welcomePage';
|
|
4
|
-
import {InstallBlock} from './installBlock';
|
|
5
|
-
import {version} from '../../../lerna.json';
|
|
3
|
+
import { WelcomePage } from './welcomePage';
|
|
4
|
+
import { InstallBlock } from './installBlock';
|
|
5
|
+
import { version } from '../../../lerna.json';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
<WelcomePage />
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "13.0.0-alpha.
|
|
3
|
+
"version": "13.0.0-alpha.996-next.0",
|
|
4
4
|
"description": "Documentation components of Canvas Kit components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"build:docs": "node ./utils/build-docs.js",
|
|
28
28
|
"build:rebuild": "npm-run-all clean build",
|
|
29
29
|
"build:specs": "node ./utils/build-specifications.js",
|
|
30
|
-
"build": "npm-run-all
|
|
30
|
+
"build": "npm-run-all build:es6 build:mdx build:specs build:docs",
|
|
31
31
|
"depcheck": "node ../../utils/check-dependencies-exist.js",
|
|
32
32
|
"typecheck:src": "tsc -p . --noEmit --incremental false"
|
|
33
33
|
},
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@emotion/styled": "^11.6.0",
|
|
46
46
|
"@storybook/csf": "0.0.1",
|
|
47
|
-
"@workday/canvas-kit-labs-react": "^13.0.0-alpha.
|
|
48
|
-
"@workday/canvas-kit-preview-react": "^13.0.0-alpha.
|
|
49
|
-
"@workday/canvas-kit-react": "^13.0.0-alpha.
|
|
50
|
-
"@workday/canvas-kit-styling": "^13.0.0-alpha.
|
|
47
|
+
"@workday/canvas-kit-labs-react": "^13.0.0-alpha.996-next.0",
|
|
48
|
+
"@workday/canvas-kit-preview-react": "^13.0.0-alpha.996-next.0",
|
|
49
|
+
"@workday/canvas-kit-react": "^13.0.0-alpha.996-next.0",
|
|
50
|
+
"@workday/canvas-kit-styling": "^13.0.0-alpha.996-next.0",
|
|
51
51
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
52
52
|
"@workday/canvas-tokens-web": "^2.0.1",
|
|
53
53
|
"markdown-to-jsx": "^7.2.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"mkdirp": "^1.0.3",
|
|
61
61
|
"typescript": "5.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "340f917ae60082f246c1ac4201408bf32fa4741f"
|
|
64
64
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Base.d.ts","sourceRoot":"","sources":["../../../../lib/InformationHighlight/Base.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,OAAO,EAAe,MAAM,6BAA6B,CAAC;AAElE,MAAM,WAAW,SAAU,SAAQ,OAAO;CAAG;AAE7C,eAAO,MAAM,IAAI,+EAKf,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { handleCsProp } from '@workday/canvas-kit-styling';
|
|
4
|
-
export const Base = createComponent('div')({
|
|
5
|
-
displayName: 'Base',
|
|
6
|
-
Component: (props, ref, Element) => {
|
|
7
|
-
return React.createElement(Element, { ref: ref, ...handleCsProp(props) });
|
|
8
|
-
},
|
|
9
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Body.d.ts","sourceRoot":"","sources":["../../../../lib/InformationHighlight/Body.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,IAAI,2EAKf,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { createStyles } from '@workday/canvas-kit-styling';
|
|
4
|
-
import { base, system } from '@workday/canvas-tokens-web';
|
|
5
|
-
import { Base } from './Base';
|
|
6
|
-
const bodyStyles = createStyles({
|
|
7
|
-
...system.type.subtext.large,
|
|
8
|
-
color: base.blackPepper300,
|
|
9
|
-
gridColumn: '2',
|
|
10
|
-
fontWeight: 400,
|
|
11
|
-
margin: 0,
|
|
12
|
-
});
|
|
13
|
-
export const Body = createComponent('p')({
|
|
14
|
-
displayName: 'Body',
|
|
15
|
-
Component: (props, ref, Element) => {
|
|
16
|
-
return React.createElement(Base, { as: Element, ref: ref, cs: bodyStyles, ...props });
|
|
17
|
-
},
|
|
18
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../../lib/InformationHighlight/Heading.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,OAAO,6EAKlB,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { createStyles } from '@workday/canvas-kit-styling';
|
|
4
|
-
import { base, system } from '@workday/canvas-tokens-web';
|
|
5
|
-
import { Base } from './Base';
|
|
6
|
-
const headingStyles = createStyles({
|
|
7
|
-
...system.type.body.small,
|
|
8
|
-
color: base.blackPepper400,
|
|
9
|
-
gridColumn: '2',
|
|
10
|
-
fontWeight: 700, // should use system.fontWeight.bold
|
|
11
|
-
});
|
|
12
|
-
export const Heading = createComponent('div')({
|
|
13
|
-
displayName: 'Heading',
|
|
14
|
-
Component: (props, ref, Element) => {
|
|
15
|
-
return React.createElement(Base, { as: Element, ref: ref, cs: headingStyles, ...props });
|
|
16
|
-
},
|
|
17
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SystemIconProps } from '@workday/canvas-kit-react/icon';
|
|
2
|
-
type Variant = 'emphasis' | 'caution' | 'attention';
|
|
3
|
-
export interface IconProps extends SystemIconProps {
|
|
4
|
-
variant: Variant;
|
|
5
|
-
}
|
|
6
|
-
export declare const Icon: import("@workday/canvas-kit-react/common").ElementComponentM<"span", IconProps, {
|
|
7
|
-
state: {
|
|
8
|
-
variant: import("./modelHook").Variant;
|
|
9
|
-
};
|
|
10
|
-
events: {};
|
|
11
|
-
}>;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=Icon.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../lib/InformationHighlight/Icon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAY3E,KAAK,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,CAAC;AA6BpD,MAAM,WAAW,SAAU,SAAQ,eAAe;IAChD,OAAO,EAAE,OAAO,CAAC;CAClB;AAQD,eAAO,MAAM,IAAI;;;;;EAYf,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { SystemIcon } from '@workday/canvas-kit-react/icon';
|
|
3
|
-
import { createSubcomponent } from '@workday/canvas-kit-react/common';
|
|
4
|
-
import { cssVar } from '@workday/canvas-kit-styling';
|
|
5
|
-
import { infoIcon, exclamationCircleIcon, exclamationTriangleIcon, } from '@workday/canvas-system-icons-web';
|
|
6
|
-
import { base } from '@workday/canvas-tokens-web';
|
|
7
|
-
import { useInformationHighlightModel } from './modelHook';
|
|
8
|
-
const iconStyles = {
|
|
9
|
-
emphasis: {
|
|
10
|
-
accent: cssVar(base.blueberry400),
|
|
11
|
-
fill: cssVar(base.blueberry400),
|
|
12
|
-
background: 'none',
|
|
13
|
-
accentHover: cssVar(base.blueberry400),
|
|
14
|
-
fillHover: cssVar(base.blueberry400),
|
|
15
|
-
backgroundHover: 'none',
|
|
16
|
-
},
|
|
17
|
-
caution: {
|
|
18
|
-
accent: cssVar(base.blackPepper400),
|
|
19
|
-
fill: cssVar(base.blackPepper400),
|
|
20
|
-
background: 'none',
|
|
21
|
-
accentHover: cssVar(base.blackPepper400),
|
|
22
|
-
fillHover: cssVar(base.blackPepper400),
|
|
23
|
-
backgroundHover: 'none',
|
|
24
|
-
},
|
|
25
|
-
attention: {
|
|
26
|
-
accent: cssVar(base.cinnamon500),
|
|
27
|
-
fill: cssVar(base.cinnamon500),
|
|
28
|
-
background: 'none',
|
|
29
|
-
accentHover: cssVar(base.cinnamon500),
|
|
30
|
-
fillHover: cssVar(base.cinnamon500),
|
|
31
|
-
backgroundHover: 'none',
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
const defaultIcons = {
|
|
35
|
-
emphasis: infoIcon,
|
|
36
|
-
caution: exclamationTriangleIcon,
|
|
37
|
-
attention: exclamationCircleIcon,
|
|
38
|
-
};
|
|
39
|
-
export const Icon = createSubcomponent('span')({
|
|
40
|
-
displayName: 'Icon',
|
|
41
|
-
modelHook: useInformationHighlightModel,
|
|
42
|
-
})(({ icon, ...props }, Element, model) => {
|
|
43
|
-
return (React.createElement(SystemIcon, { as: Element, icon: icon ? icon : defaultIcons[model.state.variant], ...iconStyles[model.state.variant], ...props }));
|
|
44
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../../lib/InformationHighlight/Link.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,IAAI,6EAKf,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ExternalHyperlink } from '@workday/canvas-kit-react/button';
|
|
3
|
-
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
4
|
-
import { createStyles, cssVar } from '@workday/canvas-kit-styling';
|
|
5
|
-
import { base, system } from '@workday/canvas-tokens-web';
|
|
6
|
-
const linkStyles = createStyles({
|
|
7
|
-
...system.type.subtext.large,
|
|
8
|
-
gridColumn: '2',
|
|
9
|
-
justifySelf: 'start',
|
|
10
|
-
color: `${cssVar(base.blueberry500)} !important`,
|
|
11
|
-
fontWeight: 500, // should use system.fontWeight.bold
|
|
12
|
-
});
|
|
13
|
-
export const Link = createComponent('div')({
|
|
14
|
-
displayName: 'Link',
|
|
15
|
-
Component: (props, ref, Element) => {
|
|
16
|
-
return React.createElement(ExternalHyperlink, { as: Element, ref: ref, className: linkStyles, ...props });
|
|
17
|
-
},
|
|
18
|
-
});
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { BaseProps } from './Base';
|
|
2
|
-
type Variant = 'emphasis' | 'caution' | 'attention';
|
|
3
|
-
interface InformationHighlightProps extends BaseProps {
|
|
4
|
-
variant?: Variant;
|
|
5
|
-
}
|
|
6
|
-
export declare const InformationHighlight: import("@workday/canvas-kit-react/common").ElementComponentM<"section", InformationHighlightProps & Partial<{
|
|
7
|
-
variant: import("./modelHook").Variant;
|
|
8
|
-
}> & {} & {}, {
|
|
9
|
-
state: {
|
|
10
|
-
variant: import("./modelHook").Variant;
|
|
11
|
-
};
|
|
12
|
-
events: {};
|
|
13
|
-
}> & {
|
|
14
|
-
Icon: import("@workday/canvas-kit-react/common").ElementComponentM<"span", import("./Icon").IconProps, {
|
|
15
|
-
state: {
|
|
16
|
-
variant: import("./modelHook").Variant;
|
|
17
|
-
};
|
|
18
|
-
events: {};
|
|
19
|
-
}>;
|
|
20
|
-
Heading: import("@workday/canvas-kit-react/common").ElementComponent<"div", unknown>;
|
|
21
|
-
Body: import("@workday/canvas-kit-react/common").ElementComponent<"p", unknown>;
|
|
22
|
-
Link: import("@workday/canvas-kit-react/common").ElementComponent<"div", unknown>;
|
|
23
|
-
};
|
|
24
|
-
export {};
|
|
25
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/InformationHighlight/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAO,SAAS,EAAC,MAAM,QAAQ,CAAC;AAOvC,KAAK,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,CAAC;AAEpD,UAAU,yBAA0B,SAAQ,SAAS;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA4BD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;CAiB/B,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { createContainer } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { createModifiers, createStyles, cssVar } from '@workday/canvas-kit-styling';
|
|
4
|
-
import { base, system } from '@workday/canvas-tokens-web';
|
|
5
|
-
import { Base } from './Base';
|
|
6
|
-
import { Heading } from './Heading';
|
|
7
|
-
import { Body } from './Body';
|
|
8
|
-
import { Icon } from './Icon';
|
|
9
|
-
import { Link } from './Link';
|
|
10
|
-
import { useInformationHighlightModel } from './modelHook';
|
|
11
|
-
const containerStyles = createStyles({
|
|
12
|
-
backgroundColor: base.soap100,
|
|
13
|
-
display: 'grid',
|
|
14
|
-
gridTemplateColumns: 'min-content',
|
|
15
|
-
columnGap: system.space.x4,
|
|
16
|
-
rowGap: system.space.x2,
|
|
17
|
-
padding: system.space.x4,
|
|
18
|
-
borderRadius: system.shape.x1,
|
|
19
|
-
});
|
|
20
|
-
const containerModifiers = createModifiers({
|
|
21
|
-
variant: {
|
|
22
|
-
emphasis: createStyles({
|
|
23
|
-
borderInlineStart: `solid ${cssVar(system.space.x1)} ${cssVar(base.blueberry400)}`,
|
|
24
|
-
}),
|
|
25
|
-
caution: createStyles({
|
|
26
|
-
borderInlineStart: `solid ${cssVar(system.space.x1)} ${cssVar(base.cantaloupe400)}`,
|
|
27
|
-
}),
|
|
28
|
-
attention: createStyles({
|
|
29
|
-
borderInlineStart: `solid ${cssVar(system.space.x1)} ${cssVar(base.cinnamon500)}`,
|
|
30
|
-
}),
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
export const InformationHighlight = createContainer('section')({
|
|
34
|
-
displayName: 'InformationHighlight',
|
|
35
|
-
modelHook: useInformationHighlightModel,
|
|
36
|
-
subComponents: {
|
|
37
|
-
Icon: Icon,
|
|
38
|
-
Heading: Heading,
|
|
39
|
-
Body: Body,
|
|
40
|
-
Link: Link,
|
|
41
|
-
},
|
|
42
|
-
})((props, Element, model) => {
|
|
43
|
-
return (React.createElement(Base, { as: Element, cs: [containerStyles, containerModifiers({ variant: model.state.variant })], ...props }));
|
|
44
|
-
});
|