@workday/canvas-kit-docs 16.0.0-alpha.0499-next.0 → 16.0.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/lib/docs.js +2801 -17
- package/dist/es6/lib/specs.js +1549 -615
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +5 -5
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +5 -5
- package/dist/es6/utils/parseSpecFile.d.ts.map +1 -1
- package/dist/es6/utils/parseSpecFile.js +27 -6
- package/dist/mdx/16.0-UPGRADE-GUIDE.mdx +148 -3
- package/dist/mdx/react/common/mdx/Theming.mdx +75 -431
- package/dist/mdx/react/common/mdx/examples/SimplifiedSanaSetup.tsx +35 -0
- package/dist/mdx/react/common/mdx/examples/ThemingBrandScope.tsx +29 -0
- package/package.json +6 -6
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/CommentBoxWithCharLimit.d.ts +0 -2
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/CommentBoxWithCharLimit.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/CommentBoxWithCharLimit.js +0 -31
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/FilterListWithLiveStatus.d.ts +0 -2
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/FilterListWithLiveStatus.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/FilterListWithLiveStatus.js +0 -43
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/HiddenLiveRegion.d.ts +0 -2
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/HiddenLiveRegion.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/HiddenLiveRegion.js +0 -27
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/IconButtonsWithLiveBadges.d.ts +0 -2
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/IconButtonsWithLiveBadges.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/IconButtonsWithLiveBadges.js +0 -56
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/TextInputWithLiveError.d.ts +0 -2
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/TextInputWithLiveError.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/TextInputWithLiveError.js +0 -19
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/VisibleLiveRegion.d.ts +0 -2
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/VisibleLiveRegion.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/VisibleLiveRegion.js +0 -35
- package/dist/es6/mdx/accessibility/examples/GlobalHeader.d.ts +0 -8
- package/dist/es6/mdx/accessibility/examples/GlobalHeader.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/GlobalHeader.js +0 -149
- package/dist/es6/mdx/accessibility/examples/PageStructure/BreadcrumbNavRegion.d.ts +0 -2
- package/dist/es6/mdx/accessibility/examples/PageStructure/BreadcrumbNavRegion.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/PageStructure/BreadcrumbNavRegion.js +0 -12
- package/dist/es6/mdx/accessibility/examples/PageStructure/FullPageDemo.d.ts +0 -2
- package/dist/es6/mdx/accessibility/examples/PageStructure/FullPageDemo.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/PageStructure/FullPageDemo.js +0 -46
- package/dist/es6/mdx/accessibility/examples/PageStructure/LandmarkRegions.d.ts +0 -2
- package/dist/es6/mdx/accessibility/examples/PageStructure/LandmarkRegions.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/PageStructure/LandmarkRegions.js +0 -28
- package/dist/es6/mdx/accessibility/examples/Popups/InlinePopupNoPortal.d.ts +0 -2
- package/dist/es6/mdx/accessibility/examples/Popups/InlinePopupNoPortal.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/Popups/InlinePopupNoPortal.js +0 -62
- package/dist/es6/mdx/accessibility/examples/Popups/InlinePortalPopup.d.ts +0 -7
- package/dist/es6/mdx/accessibility/examples/Popups/InlinePortalPopup.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/Popups/InlinePortalPopup.js +0 -65
- package/dist/es6/mdx/accessibility/examples/Popups/PopupAriaOwns.d.ts +0 -7
- package/dist/es6/mdx/accessibility/examples/Popups/PopupAriaOwns.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/Popups/PopupAriaOwns.js +0 -46
- package/dist/es6/mdx/accessibility/examples/SidePanelWithNavigation.d.ts +0 -3
- package/dist/es6/mdx/accessibility/examples/SidePanelWithNavigation.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/SidePanelWithNavigation.js +0 -100
- package/dist/es6/mdx/accessibility/examples/SidePanelWithOverlay.d.ts +0 -2
- package/dist/es6/mdx/accessibility/examples/SidePanelWithOverlay.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/SidePanelWithOverlay.js +0 -30
- package/dist/es6/mdx/accessibility/examples/Table/WithColumnHeaderFilters.d.ts +0 -2
- package/dist/es6/mdx/accessibility/examples/Table/WithColumnHeaderFilters.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/Table/WithColumnHeaderFilters.js +0 -101
- package/dist/es6/mdx/accessibility/examples/Table/WithExpandableRows.d.ts +0 -2
- package/dist/es6/mdx/accessibility/examples/Table/WithExpandableRows.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/Table/WithExpandableRows.js +0 -115
- package/dist/es6/mdx/accessibility/examples/Table/WithFormFields.d.ts +0 -2
- package/dist/es6/mdx/accessibility/examples/Table/WithFormFields.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/Table/WithFormFields.js +0 -79
- package/dist/es6/mdx/accessibility/examples/Table/WithSelectableRows.d.ts +0 -2
- package/dist/es6/mdx/accessibility/examples/Table/WithSelectableRows.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/Table/WithSelectableRows.js +0 -89
- package/dist/es6/mdx/accessibility/examples/Table/WithSortableColumnHeaders.d.ts +0 -2
- package/dist/es6/mdx/accessibility/examples/Table/WithSortableColumnHeaders.d.ts.map +0 -1
- package/dist/es6/mdx/accessibility/examples/Table/WithSortableColumnHeaders.js +0 -114
- package/dist/es6/mdx/installBlock.d.ts +0 -6
- package/dist/es6/mdx/installBlock.d.ts.map +0 -1
- package/dist/es6/mdx/installBlock.js +0 -35
- package/dist/es6/mdx/style-props/examples/Background.d.ts +0 -2
- package/dist/es6/mdx/style-props/examples/Background.d.ts.map +0 -1
- package/dist/es6/mdx/style-props/examples/Background.js +0 -13
- package/dist/es6/mdx/style-props/examples/Border.d.ts +0 -2
- package/dist/es6/mdx/style-props/examples/Border.d.ts.map +0 -1
- package/dist/es6/mdx/style-props/examples/Border.js +0 -11
- package/dist/es6/mdx/style-props/examples/Color.d.ts +0 -2
- package/dist/es6/mdx/style-props/examples/Color.d.ts.map +0 -1
- package/dist/es6/mdx/style-props/examples/Color.js +0 -10
- package/dist/es6/mdx/style-props/examples/Depth.d.ts +0 -2
- package/dist/es6/mdx/style-props/examples/Depth.d.ts.map +0 -1
- package/dist/es6/mdx/style-props/examples/Depth.js +0 -11
- package/dist/es6/mdx/style-props/examples/Flex.d.ts +0 -2
- package/dist/es6/mdx/style-props/examples/Flex.d.ts.map +0 -1
- package/dist/es6/mdx/style-props/examples/Flex.js +0 -9
- package/dist/es6/mdx/style-props/examples/FlexItem.d.ts +0 -2
- package/dist/es6/mdx/style-props/examples/FlexItem.d.ts.map +0 -1
- package/dist/es6/mdx/style-props/examples/FlexItem.js +0 -9
- package/dist/es6/mdx/style-props/examples/Grid.d.ts +0 -2
- package/dist/es6/mdx/style-props/examples/Grid.d.ts.map +0 -1
- package/dist/es6/mdx/style-props/examples/Grid.js +0 -7
- package/dist/es6/mdx/style-props/examples/GridItem.d.ts +0 -2
- package/dist/es6/mdx/style-props/examples/GridItem.d.ts.map +0 -1
- package/dist/es6/mdx/style-props/examples/GridItem.js +0 -7
- package/dist/es6/mdx/style-props/examples/Layout.d.ts +0 -2
- package/dist/es6/mdx/style-props/examples/Layout.d.ts.map +0 -1
- package/dist/es6/mdx/style-props/examples/Layout.js +0 -10
- package/dist/es6/mdx/style-props/examples/Other.d.ts +0 -2
- package/dist/es6/mdx/style-props/examples/Other.d.ts.map +0 -1
- package/dist/es6/mdx/style-props/examples/Other.js +0 -11
- package/dist/es6/mdx/style-props/examples/Position.d.ts +0 -2
- package/dist/es6/mdx/style-props/examples/Position.d.ts.map +0 -1
- package/dist/es6/mdx/style-props/examples/Position.js +0 -12
- package/dist/es6/mdx/style-props/examples/Space.d.ts +0 -2
- package/dist/es6/mdx/style-props/examples/Space.d.ts.map +0 -1
- package/dist/es6/mdx/style-props/examples/Space.js +0 -9
- package/dist/es6/mdx/style-props/examples/Text.d.ts +0 -2
- package/dist/es6/mdx/style-props/examples/Text.d.ts.map +0 -1
- package/dist/es6/mdx/style-props/examples/Text.js +0 -3
- package/dist/es6/mdx/tokens/StorybookInformationHighlight/index.d.ts +0 -2
- package/dist/es6/mdx/tokens/StorybookInformationHighlight/index.d.ts.map +0 -1
- package/dist/es6/mdx/tokens/StorybookInformationHighlight/index.js +0 -6
- package/dist/es6/mdx/versionsTable.d.ts +0 -2
- package/dist/es6/mdx/versionsTable.d.ts.map +0 -1
- package/dist/es6/mdx/versionsTable.js +0 -60
- package/dist/es6/mdx/welcomePage.d.ts +0 -2
- package/dist/es6/mdx/welcomePage.d.ts.map +0 -1
- package/dist/es6/mdx/welcomePage.js +0 -57
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Checkbox } from '@workday/canvas-kit-react/checkbox';
|
|
4
|
-
import { createComponent, generateUniqueId } from '@workday/canvas-kit-react/common';
|
|
5
|
-
import { Table } from '@workday/canvas-kit-react/table';
|
|
6
|
-
import { Heading } from '@workday/canvas-kit-react/text';
|
|
7
|
-
import { Tooltip } from '@workday/canvas-kit-react/tooltip';
|
|
8
|
-
import { createStencil, createStyles } from '@workday/canvas-kit-styling';
|
|
9
|
-
import { system } from '@workday/canvas-tokens-web';
|
|
10
|
-
const selectableRowStencil = createStencil({
|
|
11
|
-
base: {
|
|
12
|
-
gridTemplateColumns: '3.5rem repeat(2, 1fr)',
|
|
13
|
-
transition: 'background-color 200ms',
|
|
14
|
-
},
|
|
15
|
-
modifiers: {
|
|
16
|
-
isSelected: {
|
|
17
|
-
true: {
|
|
18
|
-
backgroundColor: system.color.brand.surface.primary.default,
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
const tableHeaderStyles = createStyles({
|
|
24
|
-
backgroundColor: system.color.surface.alt.default,
|
|
25
|
-
});
|
|
26
|
-
const tableCellStyles = createStyles({
|
|
27
|
-
backgroundColor: 'transparent',
|
|
28
|
-
});
|
|
29
|
-
const SelectableRow = createComponent('tr')({
|
|
30
|
-
displayName: 'SelectableRow',
|
|
31
|
-
Component: ({ onSelect, rowData }) => {
|
|
32
|
-
return (_jsxs(Table.Row, { cs: selectableRowStencil({ isSelected: rowData.checked }), children: [_jsx(Table.Cell, { cs: tableCellStyles, children: _jsx(Tooltip, { title: rowData.name, children: _jsx(Checkbox, { checked: rowData.checked, onChange: onSelect }) }) }), _jsx(Table.Header, { cs: tableCellStyles, scope: "row", children: rowData.name }), _jsx(Table.Cell, { cs: tableCellStyles, children: rowData.amount })] }));
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
const pizzaToppingData = [
|
|
36
|
-
{ name: 'Pepperoni', amount: '2.5 oz.', checked: false },
|
|
37
|
-
{ name: 'Mozzarella', amount: '5 oz.', checked: false },
|
|
38
|
-
{ name: 'Basil', amount: '10 Leaves', checked: false },
|
|
39
|
-
{ name: 'Roasted Red Peppers', amount: '3 oz.', checked: false },
|
|
40
|
-
{ name: 'Mushrooms', amount: '2 oz.', checked: false },
|
|
41
|
-
];
|
|
42
|
-
const headingID = generateUniqueId();
|
|
43
|
-
export const SelectableRows = () => {
|
|
44
|
-
const [selectAllState, setSelectAllState] = React.useState('unchecked');
|
|
45
|
-
const [toppings, setToppings] = React.useState(pizzaToppingData);
|
|
46
|
-
const handleToppingChange = (name) => {
|
|
47
|
-
// Toggle the selected item's checked state and update state
|
|
48
|
-
const updatedToppings = toppings.map(topping => {
|
|
49
|
-
if (topping.name === name) {
|
|
50
|
-
return { ...topping, checked: !topping.checked };
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
return topping;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
setToppings(updatedToppings);
|
|
57
|
-
// Update the Select All checkbox state
|
|
58
|
-
const selectedToppings = updatedToppings.filter(topping => topping.checked === true);
|
|
59
|
-
// If no toppings are selected, set the Select All checkbox to 'unchecked'
|
|
60
|
-
if (selectedToppings.length === 0) {
|
|
61
|
-
setSelectAllState('unchecked');
|
|
62
|
-
// If all toppings are selected, set the Select All checkbox to 'checked'
|
|
63
|
-
}
|
|
64
|
-
else if (selectedToppings.length === updatedToppings.length) {
|
|
65
|
-
setSelectAllState('checked');
|
|
66
|
-
// Otherwise, set the Select All checkbox to 'indeterminate'
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
setSelectAllState('indeterminate');
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
const handleSelectAll = () => {
|
|
73
|
-
// If the Select All checkbox is in a checked or indeterminate state,
|
|
74
|
-
// update it to 'unchecked', and uncheck all topping checkboxes
|
|
75
|
-
if (selectAllState === 'checked' || selectAllState === 'indeterminate') {
|
|
76
|
-
setSelectAllState('unchecked');
|
|
77
|
-
const updatedToppingData = toppings.map(topping => ({ ...topping, checked: false }));
|
|
78
|
-
setToppings(updatedToppingData);
|
|
79
|
-
}
|
|
80
|
-
// If the Select All checkbox is in an unchecked state,
|
|
81
|
-
// update it to 'checked', and check all topping checkboxes
|
|
82
|
-
if (selectAllState === 'unchecked') {
|
|
83
|
-
setSelectAllState('checked');
|
|
84
|
-
const updatedToppingData = toppings.map(topping => ({ ...topping, checked: true }));
|
|
85
|
-
setToppings(updatedToppingData);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
return (_jsxs(_Fragment, { children: [_jsx(Heading, { as: "h3", id: headingID, size: "small", children: "Select your pizza toppings" }), _jsxs(Table, { "aria-labelledby": headingID, children: [_jsxs(Table.Row, { gridTemplateColumns: "3.5rem repeat(2, 1fr)", children: [_jsx(Table.Cell, { cs: tableHeaderStyles, children: _jsx(Tooltip, { title: "Select All", children: _jsx(Checkbox, { checked: selectAllState === 'checked', indeterminate: selectAllState === 'indeterminate', onChange: handleSelectAll }) }) }), _jsx(Table.Header, { scope: "col", cs: tableHeaderStyles, children: "Toppings" }), _jsx(Table.Header, { scope: "col", cs: tableHeaderStyles, children: "Amount" })] }), _jsx(Table.Body, { children: toppings.map(rowData => (_jsx(SelectableRow, { rowData: rowData, onSelect: () => handleToppingChange(rowData.name) }, rowData.name))) })] })] }));
|
|
89
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WithSortableColumnHeaders.d.ts","sourceRoot":"","sources":["../../../../../../mdx/accessibility/examples/Table/WithSortableColumnHeaders.tsx"],"names":[],"mappings":"AAwJA,eAAO,MAAM,qBAAqB,+CA4DjC,CAAC"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { TertiaryButton } from '@workday/canvas-kit-react/button';
|
|
4
|
-
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
5
|
-
import { Table } from '@workday/canvas-kit-react/table';
|
|
6
|
-
import { Text } from '@workday/canvas-kit-react/text';
|
|
7
|
-
import { Tooltip } from '@workday/canvas-kit-react/tooltip';
|
|
8
|
-
import { createStyles } from '@workday/canvas-kit-styling';
|
|
9
|
-
import { arrowDownSmallIcon, arrowUpSmallIcon } from '@workday/canvas-system-icons-web';
|
|
10
|
-
import { system } from '@workday/canvas-tokens-web';
|
|
11
|
-
const countryData = [
|
|
12
|
-
{ country: 'Australia', capital: 'Canberra', population: 25690000 },
|
|
13
|
-
{ country: 'Bahamas', capital: 'Nassau', population: 407906 },
|
|
14
|
-
{ country: 'Canada', capital: 'Ottawa', population: 38250000 },
|
|
15
|
-
{ country: 'Fiji', capital: 'Suva', population: 924610 },
|
|
16
|
-
{ country: 'Ghana', capital: 'Accra', population: 32830000 },
|
|
17
|
-
{ country: 'Hong Kong', capital: 'City of Victoria', population: 7413000 },
|
|
18
|
-
{ country: 'India', capital: 'New Delhi', population: 1408000000 },
|
|
19
|
-
{ country: 'Ireland', capital: 'Dublin', population: 5033000 },
|
|
20
|
-
{ country: 'Jamaica', capital: 'Kingston', population: 2828000 },
|
|
21
|
-
{ country: 'Kenya', capital: 'Nairobi', population: 53010000 },
|
|
22
|
-
{ country: 'Micronesia', capital: 'Palikir', population: 113131 },
|
|
23
|
-
{ country: 'New Zealand', capital: 'Wellington', population: 5123000 },
|
|
24
|
-
{ country: 'Philippines', capital: 'Manila', population: 113900000 },
|
|
25
|
-
{ country: 'Puerto Rico', capital: 'San Juan', population: 3264000 },
|
|
26
|
-
{ country: 'Samoa', capital: 'Apia', population: 218764 },
|
|
27
|
-
{ country: 'Singapore', capital: 'Singapore', population: 5454000 },
|
|
28
|
-
{ country: 'Tanzania', capital: 'Dodoma', population: 63590000 },
|
|
29
|
-
{ country: 'United Kingdom', capital: 'London', population: 67330000 },
|
|
30
|
-
{ country: 'United States', capital: 'Washington, D.C.', population: 331900000 },
|
|
31
|
-
{ country: 'Zimbabwe', capital: 'Harare', population: 15990000 },
|
|
32
|
-
];
|
|
33
|
-
const initialHeaderRowState = {
|
|
34
|
-
column1SortDirection: 'ascending',
|
|
35
|
-
column2SortDirection: 'none',
|
|
36
|
-
column3SortDirection: 'none',
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Given the current sort order, return the next sort order
|
|
40
|
-
*/
|
|
41
|
-
function getNextSortOrder(sortOrder) {
|
|
42
|
-
return sortOrder === 'ascending' ? 'descending' : 'ascending';
|
|
43
|
-
}
|
|
44
|
-
function headerRowReducer(state, action) {
|
|
45
|
-
switch (action.column) {
|
|
46
|
-
case 'Country':
|
|
47
|
-
if (state.column1SortDirection === 'ascending') {
|
|
48
|
-
action.payload.sort((a, b) => b.country.localeCompare(a.country));
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
action.payload.sort((a, b) => a.country.localeCompare(b.country));
|
|
52
|
-
}
|
|
53
|
-
return {
|
|
54
|
-
...initialHeaderRowState,
|
|
55
|
-
column1SortDirection: getNextSortOrder(state.column1SortDirection),
|
|
56
|
-
};
|
|
57
|
-
case 'Capital':
|
|
58
|
-
if (state.column2SortDirection === 'ascending') {
|
|
59
|
-
action.payload.sort((a, b) => b.capital.localeCompare(a.capital));
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
action.payload.sort((a, b) => a.capital.localeCompare(b.capital));
|
|
63
|
-
}
|
|
64
|
-
return {
|
|
65
|
-
...initialHeaderRowState,
|
|
66
|
-
column2SortDirection: getNextSortOrder(state.column2SortDirection),
|
|
67
|
-
};
|
|
68
|
-
case 'Population':
|
|
69
|
-
if (state.column3SortDirection === 'ascending') {
|
|
70
|
-
action.payload.sort((a, b) => b.population - a.population);
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
action.payload.sort((a, b) => a.population - b.population);
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
...initialHeaderRowState,
|
|
77
|
-
column3SortDirection: getNextSortOrder(state.column3SortDirection),
|
|
78
|
-
};
|
|
79
|
-
default:
|
|
80
|
-
return initialHeaderRowState;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
const getSortIcon = (sortOrder) => {
|
|
84
|
-
if (sortOrder === 'ascending') {
|
|
85
|
-
return arrowUpSmallIcon;
|
|
86
|
-
}
|
|
87
|
-
else if (sortOrder === 'descending') {
|
|
88
|
-
return arrowDownSmallIcon;
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
return undefined;
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
const SortableColumnHeader = createComponent('th')({
|
|
95
|
-
displayName: 'SortableColumnHeader',
|
|
96
|
-
Component: ({ label, sortOrder, onSortAction, children, ...elemProps }, ref) => {
|
|
97
|
-
return (_jsx(Table.Header, { ref: ref, scope: "col", "aria-sort": sortOrder, ...elemProps, children: _jsx(Tooltip, { type: "description", title: `Sort ${getNextSortOrder(sortOrder)}`, children: _jsx(TertiaryButton, { icon: getSortIcon(sortOrder), iconPosition: "end", onClick: () => onSortAction(label), children: children }) }) }));
|
|
98
|
-
},
|
|
99
|
-
});
|
|
100
|
-
const textStyles = createStyles({
|
|
101
|
-
paddingInlineStart: system.padding.sm,
|
|
102
|
-
});
|
|
103
|
-
export const SortableColumnHeaders = () => {
|
|
104
|
-
const [headerRowState, headerRowDispatch] = React.useReducer(headerRowReducer, initialHeaderRowState);
|
|
105
|
-
function sortColumnHandler(columnName) {
|
|
106
|
-
headerRowDispatch({
|
|
107
|
-
column: columnName,
|
|
108
|
-
payload: countryData,
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
return (_jsxs(Table, { cs: { maxHeight: '40rem' }, children: [_jsx(Table.Caption, { children: "Population Listed by Country (2021)" }), _jsx(Table.Head, { children: _jsxs(Table.Row, { children: [_jsx(SortableColumnHeader, { label: "Country", sortOrder: headerRowState.column1SortDirection, onSortAction: sortColumnHandler, children: "Country" }), _jsx(SortableColumnHeader, { label: "Capital", sortOrder: headerRowState.column2SortDirection, onSortAction: sortColumnHandler, children: "Capital" }), _jsx(SortableColumnHeader, { label: "Population", sortOrder: headerRowState.column3SortDirection, onSortAction: sortColumnHandler, children: "Population" })] }) }), _jsx(Table.Body, { children: countryData.map(item => {
|
|
112
|
-
return (_jsxs(Table.Row, { children: [_jsx(Table.Header, { scope: "row", children: _jsx(Text, { cs: textStyles, children: item.country }) }), _jsx(Table.Cell, { children: _jsx(Text, { cs: textStyles, children: item.capital }) }), _jsx(Table.Cell, { children: _jsx(Text, { cs: textStyles, children: item.population.toLocaleString() }) })] }, item.country));
|
|
113
|
-
}) })] }));
|
|
114
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"installBlock.d.ts","sourceRoot":"","sources":["../../../mdx/installBlock.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAoBD,eAAO,MAAM,YAAY,6BAA4B,iBAAiB,4CAuBrE,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { PrimaryButton } from '@workday/canvas-kit-react/button';
|
|
4
|
-
import { Flex } from '@workday/canvas-kit-react/layout';
|
|
5
|
-
import { createStyles } from '@workday/canvas-kit-styling';
|
|
6
|
-
import { system } from '@workday/canvas-tokens-web';
|
|
7
|
-
const blockStyles = createStyles({
|
|
8
|
-
padding: system.padding.xs,
|
|
9
|
-
backgroundColor: system.color.surface.contrast.default,
|
|
10
|
-
borderRadius: system.shape.md,
|
|
11
|
-
justifyContent: 'space-between',
|
|
12
|
-
alignItems: 'center',
|
|
13
|
-
flexWrap: 'wrap',
|
|
14
|
-
});
|
|
15
|
-
const codeCommandStyles = createStyles({
|
|
16
|
-
color: system.color.fg.info.default,
|
|
17
|
-
marginInlineEnd: system.gap.sm,
|
|
18
|
-
});
|
|
19
|
-
const codePackageStyles = createStyles({
|
|
20
|
-
color: system.color.fg.inverse,
|
|
21
|
-
});
|
|
22
|
-
export const InstallBlock = ({ command, packageName }) => {
|
|
23
|
-
const commandRef = React.useRef(null);
|
|
24
|
-
const [copied, setCopied] = React.useState(false);
|
|
25
|
-
React.useEffect(() => {
|
|
26
|
-
setTimeout(() => setCopied(false), 600);
|
|
27
|
-
}, [copied]);
|
|
28
|
-
const handleCopy = () => {
|
|
29
|
-
setCopied(true);
|
|
30
|
-
if (commandRef.current) {
|
|
31
|
-
navigator.clipboard.writeText(commandRef.current.innerText);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
return (_jsxs(Flex, { cs: blockStyles, children: [_jsxs("pre", { ref: commandRef, children: [_jsx("span", { className: codeCommandStyles, children: command }), _jsx("span", { className: codePackageStyles, children: packageName })] }), _jsx(PrimaryButton, { variant: "inverse", onClick: handleCopy, size: "small", children: copied ? 'Copied' : 'Copy' })] }));
|
|
35
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Background.d.ts","sourceRoot":"","sources":["../../../../../mdx/style-props/examples/Background.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,+CActB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box } from '@workday/canvas-kit-react/layout';
|
|
3
|
-
const baseStyles = {
|
|
4
|
-
color: 'blackPepper500',
|
|
5
|
-
display: 'inline-block',
|
|
6
|
-
margin: 'xxs',
|
|
7
|
-
minHeight: 'xl',
|
|
8
|
-
minWidth: '8rem',
|
|
9
|
-
padding: 'xs',
|
|
10
|
-
};
|
|
11
|
-
export const Background = () => {
|
|
12
|
-
return (_jsxs("div", { children: [_jsx(Box, { backgroundColor: "cinnamon300", ...baseStyles, children: "Cinnamon 300" }), _jsx(Box, { backgroundColor: "sourLemon300", ...baseStyles, children: "Sour Lemon 300" }), _jsx(Box, { backgroundColor: "blueberry300", ...baseStyles, children: "Blueberry 300" })] }));
|
|
13
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Border.d.ts","sourceRoot":"","sources":["../../../../../mdx/style-props/examples/Border.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,MAAM,+CAYlB,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box } from '@workday/canvas-kit-react/layout';
|
|
3
|
-
const baseStyles = {
|
|
4
|
-
color: 'blackPepper300',
|
|
5
|
-
display: 'inline-block',
|
|
6
|
-
margin: 'xxs',
|
|
7
|
-
minHeight: 'xl',
|
|
8
|
-
minWidth: '8rem',
|
|
9
|
-
padding: 'xs',
|
|
10
|
-
};
|
|
11
|
-
export const Border = () => (_jsxs("div", { children: [_jsx(Box, { borderRadius: "m", border: "solid 4px", borderColor: "cinnamon300", ...baseStyles, children: "Cinnamon 300" }), _jsx(Box, { borderRadius: "m", border: "solid 4px", borderColor: "sourLemon300", ...baseStyles, children: "Sour Lemon 300" }), _jsx(Box, { borderRadius: "m", border: "solid 4px", borderColor: "blueberry300", ...baseStyles, children: "Blueberry 300" })] }));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../../../../mdx/style-props/examples/Color.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,KAAK,+CAYjB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box } from '@workday/canvas-kit-react/layout';
|
|
3
|
-
const baseStyles = {
|
|
4
|
-
display: 'inline-block',
|
|
5
|
-
margin: 'xxs',
|
|
6
|
-
minHeight: 'xl',
|
|
7
|
-
minWidth: '8rem',
|
|
8
|
-
padding: 'xs',
|
|
9
|
-
};
|
|
10
|
-
export const Color = () => (_jsxs("div", { children: [_jsx(Box, { backgroundColor: "cinnamon300", color: "blackPepper500", ...baseStyles, children: "Cinnamon 300" }), _jsx(Box, { backgroundColor: "sourLemon300", color: "blackPepper500", ...baseStyles, children: "Sour Lemon 300" }), _jsx(Box, { backgroundColor: "blueberry300", color: "blackPepper500", ...baseStyles, children: "Blueberry 300" })] }));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Depth.d.ts","sourceRoot":"","sources":["../../../../../mdx/style-props/examples/Depth.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,KAAK,+CAYjB,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box } from '@workday/canvas-kit-react/layout';
|
|
3
|
-
const baseStyles = {
|
|
4
|
-
color: 'blackPepper500',
|
|
5
|
-
display: 'inline-block',
|
|
6
|
-
margin: 'xxs',
|
|
7
|
-
minHeight: 'xl',
|
|
8
|
-
minWidth: '8rem',
|
|
9
|
-
padding: 'xs',
|
|
10
|
-
};
|
|
11
|
-
export const Depth = () => (_jsxs("div", { children: [_jsx(Box, { backgroundColor: "cinnamon300", depth: 1, ...baseStyles, children: "Depth 1" }), _jsx(Box, { backgroundColor: "sourLemon300", depth: 2, ...baseStyles, children: "Depth 2" }), _jsx(Box, { backgroundColor: "blueberry300", depth: 3, ...baseStyles, children: "Depth 3" })] }));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../../../mdx/style-props/examples/Flex.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,WAAW,+CAoCvB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Flex } from '@workday/canvas-kit-react/layout';
|
|
3
|
-
const baseStyles = {
|
|
4
|
-
color: 'blackPepper500',
|
|
5
|
-
minHeight: 'xl',
|
|
6
|
-
minWidth: '2rem',
|
|
7
|
-
padding: 'xs',
|
|
8
|
-
};
|
|
9
|
-
export const FlexExample = () => (_jsxs(Flex, { columnGap: "xs", children: [_jsxs(Flex, { flexDirection: "column", rowGap: "xs", flex: 1, children: [_jsx(Flex.Item, { backgroundColor: "cinnamon300", textAlign: "center", ...baseStyles, children: "1" }), _jsx(Flex.Item, { backgroundColor: "sourLemon300", textAlign: "center", ...baseStyles, children: "1" }), _jsx(Flex.Item, { backgroundColor: "blueberry300", textAlign: "center", ...baseStyles, children: "1" })] }), _jsxs(Flex, { flexDirection: "column", rowGap: "xs", flex: 2, children: [_jsx(Flex.Item, { backgroundColor: "cinnamon300", textAlign: "center", ...baseStyles, children: "2" }), _jsx(Flex.Item, { backgroundColor: "sourLemon300", textAlign: "center", ...baseStyles, children: "2" }), _jsx(Flex.Item, { backgroundColor: "blueberry300", textAlign: "center", ...baseStyles, children: "2" })] }), _jsxs(Flex, { flexDirection: "column", rowGap: "xs", flex: 1, children: [_jsx(Flex.Item, { backgroundColor: "cinnamon300", textAlign: "center", ...baseStyles, children: "1" }), _jsx(Flex.Item, { backgroundColor: "sourLemon300", textAlign: "center", ...baseStyles, children: "1" }), _jsx(Flex.Item, { backgroundColor: "blueberry300", textAlign: "center", ...baseStyles, children: "1" })] })] }));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FlexItem.d.ts","sourceRoot":"","sources":["../../../../../mdx/style-props/examples/FlexItem.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,QAAQ,+CAiCpB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Flex } from '@workday/canvas-kit-react/layout';
|
|
3
|
-
const baseStyles = {
|
|
4
|
-
color: 'blackPepper500',
|
|
5
|
-
minHeight: 'xl',
|
|
6
|
-
minWidth: '2rem',
|
|
7
|
-
padding: 'xs',
|
|
8
|
-
};
|
|
9
|
-
export const FlexItem = () => (_jsxs(Flex, { flexDirection: "column", rowGap: "xs", children: [_jsxs(Flex, { columnGap: "xs", children: [_jsx(Flex.Item, { backgroundColor: "cinnamon300", flex: 1, textAlign: "center", ...baseStyles, children: "1" }), _jsx(Flex.Item, { backgroundColor: "sourLemon300", flex: 2, textAlign: "center", ...baseStyles, children: "2" }), _jsx(Flex.Item, { backgroundColor: "blueberry300", flex: 1, textAlign: "center", ...baseStyles, children: "1" })] }), _jsxs(Flex, { columnGap: "xs", children: [_jsx(Flex.Item, { backgroundColor: "cinnamon300", flex: 2, textAlign: "center", ...baseStyles, children: "2" }), _jsx(Flex.Item, { backgroundColor: "sourLemon300", flex: 1, textAlign: "center", ...baseStyles, children: "1" }), _jsx(Flex.Item, { backgroundColor: "blueberry300", flex: 2, textAlign: "center", ...baseStyles, children: "2" })] }), _jsxs(Flex, { columnGap: "xs", children: [_jsx(Flex.Item, { backgroundColor: "cinnamon300", flex: 1, textAlign: "center", ...baseStyles, children: "1" }), _jsx(Flex.Item, { backgroundColor: "blueberry300", flex: 1, textAlign: "center", ...baseStyles, children: "1" })] })] }));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../../../mdx/style-props/examples/Grid.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,+CAYvB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Grid } from '@workday/canvas-kit-react/layout';
|
|
3
|
-
const baseStyles = {
|
|
4
|
-
color: 'blackPepper500',
|
|
5
|
-
padding: 'xs',
|
|
6
|
-
};
|
|
7
|
-
export const GridExample = () => (_jsxs(Grid, { gridGap: "xs", gridTemplateAreas: "'head head' 'nav main' 'nav foot'", gridTemplateColumns: "1fr 3fr", gridTemplateRows: "2.5rem minmax(10rem, auto) 2.5rem", children: [_jsx(Grid.Item, { gridArea: "head", backgroundColor: "cinnamon300", ...baseStyles }), _jsx(Grid.Item, { gridArea: "nav", backgroundColor: "sourLemon300", ...baseStyles }), _jsx(Grid.Item, { gridArea: "main", backgroundColor: "blueberry300", ...baseStyles }), _jsx(Grid.Item, { gridArea: "foot", backgroundColor: "cinnamon300", ...baseStyles })] }));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GridItem.d.ts","sourceRoot":"","sources":["../../../../../mdx/style-props/examples/GridItem.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,QAAQ,+CAWpB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Grid } from '@workday/canvas-kit-react/layout';
|
|
3
|
-
const baseStyles = {
|
|
4
|
-
color: 'blackPepper500',
|
|
5
|
-
padding: 'xs',
|
|
6
|
-
};
|
|
7
|
-
export const GridItem = () => (_jsxs(Grid, { gridGap: "xs", gridTemplateColumns: "1fr 3fr", gridTemplateRows: "2.5rem minmax(10rem, auto) 2.5rem", children: [_jsx(Grid.Item, { gridColumn: "1 / 3", gridRow: "1", backgroundColor: "cinnamon300", ...baseStyles }), _jsx(Grid.Item, { gridColumn: "1", gridRow: "2 / 4", backgroundColor: "sourLemon300", ...baseStyles }), _jsx(Grid.Item, { gridColumn: "2", gridRow: "2", backgroundColor: "blueberry300", ...baseStyles }), _jsx(Grid.Item, { gridColumn: "2", gridRow: "3", backgroundColor: "cinnamon300", ...baseStyles })] }));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../../mdx/style-props/examples/Layout.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,MAAM,+CA8BlB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Flex } from '@workday/canvas-kit-react/layout';
|
|
3
|
-
const baseStyles = {
|
|
4
|
-
color: 'blackPepper500',
|
|
5
|
-
margin: 'xxs',
|
|
6
|
-
padding: 'xs',
|
|
7
|
-
justifyContent: 'center',
|
|
8
|
-
alignItems: 'flex-start',
|
|
9
|
-
};
|
|
10
|
-
export const Layout = () => (_jsxs(Flex, { alignItems: "flex-end", children: [_jsx(Flex, { backgroundColor: "cinnamon300", display: "inline-flex", height: "xl", width: "xxxl", ...baseStyles, children: "40 x 80" }), _jsx(Flex, { backgroundColor: "sourLemon300", display: "inline-flex", height: "xxl", width: "xxxl", ...baseStyles, children: "64 x 80" }), _jsx(Flex, { backgroundColor: "blueberry300", display: "inline-flex", height: "xxxl", width: "xxxl", ...baseStyles, children: "80 x 80" })] }));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Other.d.ts","sourceRoot":"","sources":["../../../../../mdx/style-props/examples/Other.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,KAAK,+CA8BjB,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box } from '@workday/canvas-kit-react/layout';
|
|
3
|
-
import { colors } from '@workday/canvas-kit-react/tokens';
|
|
4
|
-
const baseStyles = {
|
|
5
|
-
color: 'blackPepper500',
|
|
6
|
-
display: 'inline-block',
|
|
7
|
-
margin: 'xxs',
|
|
8
|
-
minHeight: 'xl',
|
|
9
|
-
padding: 'xs',
|
|
10
|
-
};
|
|
11
|
-
export const Other = () => (_jsxs(Box, { children: [_jsx(Box, { backgroundColor: "cinnamon300", cursor: "grab", outline: `2px dashed ${colors.cinnamon300}`, outlineOffset: "2px", ...baseStyles, children: "Cursor Grab" }), _jsx(Box, { backgroundColor: "sourLemon300", cursor: "text", outline: `2px dashed ${colors.sourLemon300}`, outlineOffset: "2px", ...baseStyles, children: "Cursor Text" }), _jsx(Box, { backgroundColor: "blueberry300", cursor: "wait", outline: `2px dashed ${colors.blueberry300}`, outlineOffset: "2px", ...baseStyles, children: "Cursor Wait" })] }));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Position.d.ts","sourceRoot":"","sources":["../../../../../mdx/style-props/examples/Position.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,QAAQ,+CAsCpB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box } from '@workday/canvas-kit-react/layout';
|
|
3
|
-
const baseStyles = {
|
|
4
|
-
color: 'blackPepper500',
|
|
5
|
-
margin: 'xxs',
|
|
6
|
-
height: 'xl',
|
|
7
|
-
width: '8rem',
|
|
8
|
-
padding: 'xs',
|
|
9
|
-
};
|
|
10
|
-
export const Position = () => {
|
|
11
|
-
return (_jsxs("div", { children: [_jsx(Box, { backgroundColor: "cinnamon300", left: 0, position: "absolute", top: "calc(50% - 20px)", zIndex: 1, textAlign: "center", ...baseStyles, children: "Left" }), _jsx(Box, { backgroundColor: "sourLemon300", left: `calc(50% - 4rem)`, position: "absolute", top: "calc(50% - 20px)", zIndex: 2, textAlign: "center", ...baseStyles, children: "Center" }), _jsx(Box, { backgroundColor: "blueberry300", position: "absolute", right: 0, top: "calc(50% - 20px)", zIndex: 3, textAlign: "center", ...baseStyles, children: "Right" })] }));
|
|
12
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Space.d.ts","sourceRoot":"","sources":["../../../../../mdx/style-props/examples/Space.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,KAAK,+CAkBjB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box } from '@workday/canvas-kit-react/layout';
|
|
3
|
-
const baseStyles = {
|
|
4
|
-
border: 'dotted 2px',
|
|
5
|
-
color: 'blackPepper500',
|
|
6
|
-
display: 'inline-block',
|
|
7
|
-
verticalAlign: 'bottom',
|
|
8
|
-
};
|
|
9
|
-
export const Space = () => (_jsxs("div", { children: [_jsx(Box, { backgroundColor: "cinnamon300", margin: "xxs", padding: "s", textAlign: "center", ...baseStyles, children: _jsx(Box, { border: "dotted 2px", borderColor: "blackPepper500", children: "Small" }) }), _jsx(Box, { backgroundColor: "sourLemon300", margin: "xxs", padding: "m", textAlign: "center", ...baseStyles, children: _jsx(Box, { border: "dotted 2px", borderColor: "blackPepper500", children: "Medium" }) }), _jsx(Box, { backgroundColor: "blueberry300", margin: "xxs", padding: "l", textAlign: "center", ...baseStyles, children: _jsx(Box, { border: "dotted 2px", borderColor: "blackPepper500", children: "Large" }) })] }));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../../mdx/style-props/examples/Text.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,+CAYhB,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box } from '@workday/canvas-kit-react/layout';
|
|
3
|
-
export const Text = () => (_jsxs(Box, { padding: "m", border: "solid 4px", borderColor: "blueberry300", color: "blackPepper500", children: [_jsx(Box, { as: "h3", fontSize: "large", fontWeight: "bold", margin: "zero", children: "The Elements of Typographic Style" }), _jsx(Box, { as: "p", fontSize: "medium", fontStyle: "italic", children: "\"Typography is the craft of endowing human language with a durable visual form.\"" }), _jsx(Box, { as: "span", fontSize: "small", fontWeight: "bold", color: "licorice300", children: "\u2015 Robert Bringhurst" })] }));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../mdx/tokens/StorybookInformationHighlight/index.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,6BAA6B,2EAQvC,GAAG,4CAWL,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ExternalHyperlink } from '@workday/canvas-kit-react/button';
|
|
3
|
-
import { InformationHighlight } from '@workday/canvas-kit-react/information-highlight';
|
|
4
|
-
export const StorybookInformationHighlight = ({ variant, emphasis, title, description, link, linkText, isExternal, }) => {
|
|
5
|
-
return (_jsxs(InformationHighlight, { className: "sb-unstyled", variant: variant, emphasis: emphasis, children: [_jsx(InformationHighlight.Icon, {}), _jsx(InformationHighlight.Heading, { children: title }), _jsx(InformationHighlight.Body, { children: description }), _jsx(InformationHighlight.Link, { as: isExternal && ExternalHyperlink, href: link, children: linkText })] }));
|
|
6
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"versionsTable.d.ts","sourceRoot":"","sources":["../../../mdx/versionsTable.tsx"],"names":[],"mappings":"AA+CA,eAAO,MAAM,YAAY,+CAoDxB,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { StatusIndicator, } from '@workday/canvas-kit-preview-react/status-indicator';
|
|
4
|
-
import { Table } from '@workday/canvas-kit-react/table';
|
|
5
|
-
// @ts-ignore: Cannot find module error
|
|
6
|
-
import { version } from '../../../lerna.json';
|
|
7
|
-
const statusIndicators = {
|
|
8
|
-
stable: {
|
|
9
|
-
variant: 'blue',
|
|
10
|
-
label: 'Stable',
|
|
11
|
-
},
|
|
12
|
-
support: {
|
|
13
|
-
variant: 'green',
|
|
14
|
-
label: 'Support',
|
|
15
|
-
},
|
|
16
|
-
deprecated: {
|
|
17
|
-
variant: 'red',
|
|
18
|
-
label: 'No Longer Supported',
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
function getVersionStatusIndicator(versionNumber) {
|
|
22
|
-
// version from lerna is a string, so we need to do modify into a number
|
|
23
|
-
const currentMajorVersion = Number(version.split('.')[0]);
|
|
24
|
-
const modifiedVersionNumber = typeof versionNumber === 'string' ? Number(versionNumber.split('.')[0]) : versionNumber;
|
|
25
|
-
// if this is the current version
|
|
26
|
-
if (modifiedVersionNumber === currentMajorVersion) {
|
|
27
|
-
return statusIndicators.stable;
|
|
28
|
-
}
|
|
29
|
-
else if (modifiedVersionNumber === currentMajorVersion - 1) {
|
|
30
|
-
return statusIndicators.support;
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
return statusIndicators.deprecated;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export const VersionTable = () => {
|
|
37
|
-
const [versions, setVersions] = React.useState([]);
|
|
38
|
-
const minVersion = 6;
|
|
39
|
-
const currentMajorVersion = Number(version === null || version === void 0 ? void 0 : version.split('.')[0]);
|
|
40
|
-
React.useEffect(() => {
|
|
41
|
-
const arr = [];
|
|
42
|
-
for (let i = minVersion; i <= currentMajorVersion; i++) {
|
|
43
|
-
arr.push({
|
|
44
|
-
versionNumber: i,
|
|
45
|
-
versionUrl: i === currentMajorVersion
|
|
46
|
-
? 'https://canvas.workday.com/'
|
|
47
|
-
: `https://canvas.workday.com/v${i}/`,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
setVersions(arr);
|
|
51
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
52
|
-
}, []);
|
|
53
|
-
return (_jsxs(Table, { children: [_jsx(Table.Head, { children: _jsxs(Table.Row, { children: [_jsx(Table.Header, { scope: "col", children: "Version" }), _jsx(Table.Header, { scope: "col", children: "Documentation" }), _jsx(Table.Header, { scope: "col", children: "Status" })] }) }), _jsx(Table.Body, { children: versions
|
|
54
|
-
.slice()
|
|
55
|
-
.reverse()
|
|
56
|
-
.map(item => {
|
|
57
|
-
const { label, variant } = getVersionStatusIndicator(item.versionNumber);
|
|
58
|
-
return (_jsxs(Table.Row, { children: [_jsxs(Table.Cell, { children: ["v", item.versionNumber] }), _jsx(Table.Cell, { children: _jsx("a", { href: item.versionUrl, target: "_blank", rel: "noreferrer", children: "Documentation" }) }), _jsx(Table.Cell, { children: _jsx(StatusIndicator, { variant: variant, children: _jsx(StatusIndicator.Label, { children: label }) }) })] }));
|
|
59
|
-
}) })] }));
|
|
60
|
-
};
|