@workday/canvas-kit-docs 15.0.0-alpha.0060-next.0 → 15.0.0-alpha.0074-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.
Files changed (28) hide show
  1. package/dist/es6/lib/docs.js +90 -2575
  2. package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +5 -5
  3. package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +5 -5
  4. package/dist/mdx/14.0-UPGRADE-GUIDE.mdx +4 -4
  5. package/dist/mdx/15.0-UPGRADE-GUIDE.mdx +39 -2
  6. package/dist/mdx/CODEMODS.mdx +2 -2
  7. package/dist/mdx/react/action-bar/ActionBar.mdx +3 -3
  8. package/dist/mdx/react/button/button/Button.mdx +6 -7
  9. package/dist/mdx/react/expandable/Expandable.mdx +49 -2
  10. package/dist/mdx/react/expandable/examples/HoistedModel.tsx +24 -17
  11. package/dist/mdx/react/menu/Menu.mdx +63 -26
  12. package/dist/mdx/react/menu/examples/SelectableMenu.tsx +13 -2
  13. package/package.json +6 -6
  14. package/dist/mdx/labs-react/combobox/Combobox.mdx +0 -68
  15. package/dist/mdx/labs-react/combobox/examples/Basic.tsx +0 -88
  16. package/dist/mdx/labs-react/combobox/examples/DisabledItem.tsx +0 -88
  17. package/dist/mdx/labs-react/combobox/examples/GroupOfResult.tsx +0 -88
  18. package/dist/mdx/labs-react/combobox/examples/Grow.tsx +0 -88
  19. package/dist/mdx/labs-react/combobox/examples/NoClearButton.tsx +0 -88
  20. package/dist/mdx/labs-react/combobox/examples/RTL.tsx +0 -90
  21. package/dist/mdx/labs-react/search-form/SearchForm.mdx +0 -92
  22. package/dist/mdx/labs-react/search-form/examples/Basic.tsx +0 -63
  23. package/dist/mdx/labs-react/search-form/examples/Collapsed.tsx +0 -64
  24. package/dist/mdx/labs-react/search-form/examples/CustomStyles.tsx +0 -91
  25. package/dist/mdx/labs-react/search-form/examples/CustomTheme.tsx +0 -73
  26. package/dist/mdx/labs-react/search-form/examples/Grow.tsx +0 -64
  27. package/dist/mdx/labs-react/search-form/examples/RTL.tsx +0 -66
  28. package/dist/mdx/labs-react/search-form/examples/Theming.tsx +0 -66
@@ -1,64 +0,0 @@
1
- import * as React from 'react';
2
- import {StyledMenuItem} from '@workday/canvas-kit-react/menu';
3
- import {SearchForm} from '@workday/canvas-kit-labs-react/search-form';
4
- import {Flex} from '@workday/canvas-kit-react/layout';
5
-
6
- const initialWineList = [
7
- 'Beaujolais',
8
- 'Bordeaux',
9
- 'Cabernet Sauvignon',
10
- 'Champagne',
11
- 'Chardonnay',
12
- 'Chianti',
13
- 'Malbec',
14
- 'Merlot',
15
- 'Pinot Grigio',
16
- 'Pinot Gris',
17
- 'Pinot Noir',
18
- 'Primitivo',
19
- 'Prosecco',
20
- 'Riesling',
21
- 'Rioja',
22
- 'Rosé',
23
- 'Sauvignon Blanc',
24
- 'Syrah',
25
- 'Zinfandel',
26
- ];
27
-
28
- export default () => {
29
- const [wineList, setWineList] = React.useState(initialWineList);
30
- // Tracking the input value for onSubmit
31
- const [searchInput, setSearchInput] = React.useState('');
32
- const menuItems = wineList.map(wine => <StyledMenuItem key={wine}>{wine}</StyledMenuItem>);
33
-
34
- const filterMenuItems = e => {
35
- setSearchInput(e.target.value);
36
- const formattedValue = e.target.value.toLowerCase();
37
-
38
- // Reset the list if the input is cleared
39
- if (!formattedValue.length) {
40
- setWineList(initialWineList);
41
- } else {
42
- const filteredItems = initialWineList.filter(wine =>
43
- wine.toLowerCase().includes(formattedValue)
44
- );
45
- setWineList(filteredItems);
46
- }
47
- };
48
-
49
- const handleSubmit = () => {
50
- // We don't need to prevent the default event because SearchForm handles that internally
51
- console.log(`Searching for: ${searchInput}`);
52
- };
53
-
54
- return (
55
- <Flex minHeight={200} alignItems="flex-start" padding="xs">
56
- <SearchForm
57
- autocompleteItems={menuItems}
58
- onInputChange={filterMenuItems}
59
- onSubmit={handleSubmit}
60
- isCollapsed
61
- />
62
- </Flex>
63
- );
64
- };
@@ -1,91 +0,0 @@
1
- import * as React from 'react';
2
- import {StyledMenuItem} from '@workday/canvas-kit-react/menu';
3
- import {SearchForm, searchFormStencil} from '@workday/canvas-kit-labs-react/search-form';
4
- import {Flex} from '@workday/canvas-kit-react/layout';
5
- import {createStencil} from '@workday/canvas-kit-styling';
6
- import {system} from '@workday/canvas-tokens-web';
7
- import {systemIconStencil} from '@workday/canvas-kit-react/icon';
8
-
9
- const initialWineList = [
10
- 'Beaujolais',
11
- 'Bordeaux',
12
- 'Cabernet Sauvignon',
13
- 'Champagne',
14
- 'Chardonnay',
15
- 'Chianti',
16
- 'Malbec',
17
- 'Merlot',
18
- 'Pinot Grigio',
19
- 'Pinot Gris',
20
- 'Pinot Noir',
21
- 'Primitivo',
22
- 'Prosecco',
23
- 'Riesling',
24
- 'Rioja',
25
- 'Rosé',
26
- 'Sauvignon Blanc',
27
- 'Syrah',
28
- 'Zinfandel',
29
- ];
30
-
31
- const customSearchFormStencil = createStencil({
32
- extends: searchFormStencil,
33
- base: ({submitSearchIconPart}) => ({
34
- [searchFormStencil.vars.background]: 'black',
35
- [searchFormStencil.vars.backgroundHover]: system.color.bg.muted.strong,
36
- [searchFormStencil.vars.color]: system.color.text.inverse,
37
- [searchFormStencil.vars.placeholderColor]: system.color.bg.alt.softer,
38
- [submitSearchIconPart]: {
39
- [systemIconStencil.vars.color]: system.color.fg.inverse,
40
- },
41
- [`& [data-part="combobox-reset-button"]`]: {
42
- [systemIconStencil.vars.color]: system.color.fg.inverse,
43
- },
44
- '&:focus-within': {
45
- [submitSearchIconPart]: {
46
- [systemIconStencil.vars.color]: system.color.fg.default,
47
- },
48
- [`& [data-part="combobox-reset-button"]`]: {
49
- [systemIconStencil.vars.color]: system.color.fg.default,
50
- },
51
- },
52
- }),
53
- });
54
-
55
- export default () => {
56
- const [wineList, setWineList] = React.useState(initialWineList);
57
- // Tracking the input value for onSubmit
58
- const [searchInput, setSearchInput] = React.useState('');
59
- const menuItems = wineList.map(wine => <StyledMenuItem key={wine}>{wine}</StyledMenuItem>);
60
-
61
- const filterMenuItems = e => {
62
- setSearchInput(e.target.value);
63
- const formattedValue = e.target.value.toLowerCase();
64
-
65
- // Reset the list if the input is cleared
66
- if (!formattedValue.length) {
67
- setWineList(initialWineList);
68
- } else {
69
- const filteredItems = initialWineList.filter(wine =>
70
- wine.toLowerCase().includes(formattedValue)
71
- );
72
- setWineList(filteredItems);
73
- }
74
- };
75
-
76
- const handleSubmit = () => {
77
- // We don't need to prevent the default event because SearchForm handles that internally
78
- console.log(`Searching for: ${searchInput}`);
79
- };
80
-
81
- return (
82
- <Flex minHeight={200} alignItems="flex-start" padding="xs">
83
- <SearchForm
84
- cs={customSearchFormStencil()}
85
- autocompleteItems={menuItems}
86
- onInputChange={filterMenuItems}
87
- onSubmit={handleSubmit}
88
- />
89
- </Flex>
90
- );
91
- };
@@ -1,73 +0,0 @@
1
- import * as React from 'react';
2
- import {StyledMenuItem} from '@workday/canvas-kit-react/menu';
3
- import {SearchForm, SearchThemeAttributes} from '@workday/canvas-kit-labs-react/search-form';
4
- import {Flex} from '@workday/canvas-kit-react/layout';
5
-
6
- const initialWineList = [
7
- 'Beaujolais',
8
- 'Bordeaux',
9
- 'Cabernet Sauvignon',
10
- 'Champagne',
11
- 'Chardonnay',
12
- 'Chianti',
13
- 'Malbec',
14
- 'Merlot',
15
- 'Pinot Grigio',
16
- 'Pinot Gris',
17
- 'Pinot Noir',
18
- 'Primitivo',
19
- 'Prosecco',
20
- 'Riesling',
21
- 'Rioja',
22
- 'Rosé',
23
- 'Sauvignon Blanc',
24
- 'Syrah',
25
- 'Zinfandel',
26
- ];
27
-
28
- export default () => {
29
- const [wineList, setWineList] = React.useState(initialWineList);
30
- // Tracking the input value for onSubmit
31
- const [searchInput, setSearchInput] = React.useState('');
32
- const menuItems = wineList.map(wine => <StyledMenuItem key={wine}>{wine}</StyledMenuItem>);
33
-
34
- const filterMenuItems = e => {
35
- setSearchInput(e.target.value);
36
- const formattedValue = e.target.value.toLowerCase();
37
-
38
- // Reset the list if the input is cleared
39
- if (!formattedValue.length) {
40
- setWineList(initialWineList);
41
- } else {
42
- const filteredItems = initialWineList.filter(wine =>
43
- wine.toLowerCase().includes(formattedValue)
44
- );
45
- setWineList(filteredItems);
46
- }
47
- };
48
-
49
- const handleSubmit = () => {
50
- // We don't need to prevent the default event because SearchForm handles that internally
51
- console.log(`Searching for: ${searchInput}`);
52
- };
53
-
54
- const customTheme = {
55
- background: '#a31b12',
56
- backgroundFocus: '#fff',
57
- placeholderColor: '#fff',
58
- placeholderColorFocus: '#333333',
59
- } as SearchThemeAttributes;
60
-
61
- return (
62
- <Flex minHeight={200} alignItems="flex-start">
63
- <Flex padding="xs" backgroundColor="cinnamon500" flex={1} flexBasis="auto">
64
- <SearchForm
65
- searchTheme={customTheme}
66
- autocompleteItems={menuItems}
67
- onInputChange={filterMenuItems}
68
- onSubmit={handleSubmit}
69
- />
70
- </Flex>
71
- </Flex>
72
- );
73
- };
@@ -1,64 +0,0 @@
1
- import * as React from 'react';
2
- import {StyledMenuItem} from '@workday/canvas-kit-react/menu';
3
- import {SearchForm} from '@workday/canvas-kit-labs-react/search-form';
4
- import {Flex} from '@workday/canvas-kit-react/layout';
5
-
6
- const initialWineList = [
7
- 'Beaujolais',
8
- 'Bordeaux',
9
- 'Cabernet Sauvignon',
10
- 'Champagne',
11
- 'Chardonnay',
12
- 'Chianti',
13
- 'Malbec',
14
- 'Merlot',
15
- 'Pinot Grigio',
16
- 'Pinot Gris',
17
- 'Pinot Noir',
18
- 'Primitivo',
19
- 'Prosecco',
20
- 'Riesling',
21
- 'Rioja',
22
- 'Rosé',
23
- 'Sauvignon Blanc',
24
- 'Syrah',
25
- 'Zinfandel',
26
- ];
27
-
28
- export default () => {
29
- const [wineList, setWineList] = React.useState(initialWineList);
30
- // Tracking the input value for onSubmit
31
- const [searchInput, setSearchInput] = React.useState('');
32
- const menuItems = wineList.map(wine => <StyledMenuItem key={wine}>{wine}</StyledMenuItem>);
33
-
34
- const filterMenuItems = e => {
35
- setSearchInput(e.target.value);
36
- const formattedValue = e.target.value.toLowerCase();
37
-
38
- // Reset the list if the input is cleared
39
- if (!formattedValue.length) {
40
- setWineList(initialWineList);
41
- } else {
42
- const filteredItems = initialWineList.filter(wine =>
43
- wine.toLowerCase().includes(formattedValue)
44
- );
45
- setWineList(filteredItems);
46
- }
47
- };
48
-
49
- const handleSubmit = () => {
50
- // We don't need to prevent the default event because SearchForm handles that internally
51
- console.log(`Searching for: ${searchInput}`);
52
- };
53
-
54
- return (
55
- <Flex minHeight={200} alignItems="flex-start" padding="xs">
56
- <SearchForm
57
- autocompleteItems={menuItems}
58
- grow
59
- onInputChange={filterMenuItems}
60
- onSubmit={handleSubmit}
61
- />
62
- </Flex>
63
- );
64
- };
@@ -1,66 +0,0 @@
1
- import * as React from 'react';
2
- import {StyledMenuItem} from '@workday/canvas-kit-react/menu';
3
- import {SearchForm} from '@workday/canvas-kit-labs-react/search-form';
4
- import {Flex} from '@workday/canvas-kit-react/layout';
5
- import {CanvasProvider} from '@workday/canvas-kit-react/common';
6
-
7
- const initialWineList = [
8
- 'Beaujolais',
9
- 'Bordeaux',
10
- 'Cabernet Sauvignon',
11
- 'Champagne',
12
- 'Chardonnay',
13
- 'Chianti',
14
- 'Malbec',
15
- 'Merlot',
16
- 'Pinot Grigio',
17
- 'Pinot Gris',
18
- 'Pinot Noir',
19
- 'Primitivo',
20
- 'Prosecco',
21
- 'Riesling',
22
- 'Rioja',
23
- 'Rosé',
24
- 'Sauvignon Blanc',
25
- 'Syrah',
26
- 'Zinfandel',
27
- ];
28
-
29
- export default () => {
30
- const [wineList, setWineList] = React.useState(initialWineList);
31
- // Tracking the input value for onSubmit
32
- const [searchInput, setSearchInput] = React.useState('');
33
- const menuItems = wineList.map(wine => <StyledMenuItem key={wine}>{wine}</StyledMenuItem>);
34
-
35
- const filterMenuItems = e => {
36
- setSearchInput(e.target.value);
37
- const formattedValue = e.target.value.toLowerCase();
38
-
39
- // Reset the list if the input is cleared
40
- if (!formattedValue.length) {
41
- setWineList(initialWineList);
42
- } else {
43
- const filteredItems = initialWineList.filter(wine =>
44
- wine.toLowerCase().includes(formattedValue)
45
- );
46
- setWineList(filteredItems);
47
- }
48
- };
49
-
50
- const handleSubmit = () => {
51
- // We don't need to prevent the default event because SearchForm handles that internally
52
- console.log(`Searching for: ${searchInput}`);
53
- };
54
-
55
- return (
56
- <CanvasProvider dir="rtl">
57
- <Flex minHeight={200} alignItems="flex-start" padding="xs">
58
- <SearchForm
59
- autocompleteItems={menuItems}
60
- onInputChange={filterMenuItems}
61
- onSubmit={handleSubmit}
62
- />
63
- </Flex>
64
- </CanvasProvider>
65
- );
66
- };
@@ -1,66 +0,0 @@
1
- import * as React from 'react';
2
- import {StyledMenuItem} from '@workday/canvas-kit-react/menu';
3
- import {SearchForm, SearchTheme} from '@workday/canvas-kit-labs-react/search-form';
4
- import {Flex} from '@workday/canvas-kit-react/layout';
5
-
6
- const initialWineList = [
7
- 'Beaujolais',
8
- 'Bordeaux',
9
- 'Cabernet Sauvignon',
10
- 'Champagne',
11
- 'Chardonnay',
12
- 'Chianti',
13
- 'Malbec',
14
- 'Merlot',
15
- 'Pinot Grigio',
16
- 'Pinot Gris',
17
- 'Pinot Noir',
18
- 'Primitivo',
19
- 'Prosecco',
20
- 'Riesling',
21
- 'Rioja',
22
- 'Rosé',
23
- 'Sauvignon Blanc',
24
- 'Syrah',
25
- 'Zinfandel',
26
- ];
27
-
28
- export default () => {
29
- const [wineList, setWineList] = React.useState(initialWineList);
30
- // Tracking the input value for onSubmit
31
- const [searchInput, setSearchInput] = React.useState('');
32
- const menuItems = wineList.map(wine => <StyledMenuItem key={wine}>{wine}</StyledMenuItem>);
33
-
34
- const filterMenuItems = e => {
35
- setSearchInput(e.target.value);
36
- const formattedValue = e.target.value.toLowerCase();
37
-
38
- // Reset the list if the input is cleared
39
- if (!formattedValue.length) {
40
- setWineList(initialWineList);
41
- } else {
42
- const filteredItems = initialWineList.filter(wine =>
43
- wine.toLowerCase().includes(formattedValue)
44
- );
45
- setWineList(filteredItems);
46
- }
47
- };
48
-
49
- const handleSubmit = () => {
50
- // We don't need to prevent the default event because SearchForm handles that internally
51
- console.log(`Searching for: ${searchInput}`);
52
- };
53
-
54
- return (
55
- <Flex minHeight={200} alignItems="flex-start">
56
- <Flex padding="xs" backgroundColor="blueberry500" flex={1} flexBasis="auto">
57
- <SearchForm
58
- searchTheme={SearchTheme.Dark}
59
- autocompleteItems={menuItems}
60
- onInputChange={filterMenuItems}
61
- onSubmit={handleSubmit}
62
- />
63
- </Flex>
64
- </Flex>
65
- );
66
- };