@workday/canvas-kit-docs 13.0.0-alpha.998-next.0 → 13.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/ExampleCodeBlock.d.ts +1 -2
- package/dist/es6/lib/ExampleCodeBlock.d.ts.map +1 -1
- package/dist/es6/lib/ExampleCodeBlock.js +53 -28
- package/dist/es6/lib/MDXElements.d.ts +1 -2
- package/dist/es6/lib/MDXElements.d.ts.map +1 -1
- package/dist/es6/lib/MDXElements.js +6 -6
- package/dist/es6/lib/MoreTooltip.d.ts +1 -1
- package/dist/es6/lib/MoreTooltip.d.ts.map +1 -1
- package/dist/es6/lib/MoreTooltip.js +11 -12
- package/dist/es6/lib/Specifications.d.ts +1 -2
- package/dist/es6/lib/Specifications.d.ts.map +1 -1
- package/dist/es6/lib/Specifications.js +3 -20
- package/dist/es6/lib/StylePropsTable.d.ts +1 -2
- package/dist/es6/lib/StylePropsTable.d.ts.map +1 -1
- package/dist/es6/lib/StylePropsTable.js +6 -16
- package/dist/es6/lib/Table.d.ts.map +1 -1
- package/dist/es6/lib/Table.js +7 -7
- package/dist/es6/lib/Value.d.ts +3 -3
- package/dist/es6/lib/Value.d.ts.map +1 -1
- package/dist/es6/lib/Value.js +16 -51
- package/dist/es6/lib/docs.js +270155 -169429
- package/dist/es6/lib/stackblitzFiles/.eslintrc.cjs.txt +15 -0
- package/dist/es6/lib/stackblitzFiles/App.d.ts +2 -0
- package/dist/es6/lib/stackblitzFiles/App.d.ts.map +1 -0
- package/dist/es6/lib/stackblitzFiles/App.js +17 -0
- package/dist/es6/lib/stackblitzFiles/App.tsx +33 -0
- package/dist/es6/lib/stackblitzFiles/Demo.d.ts +2 -0
- package/dist/es6/lib/stackblitzFiles/Demo.d.ts.map +1 -0
- package/dist/es6/lib/stackblitzFiles/Demo.js +2 -0
- package/dist/es6/lib/stackblitzFiles/Demo.tsx +1 -0
- package/dist/es6/lib/stackblitzFiles/index.html +13 -0
- package/dist/es6/lib/stackblitzFiles/main.d.ts +4 -0
- package/dist/es6/lib/stackblitzFiles/main.d.ts.map +1 -0
- package/dist/es6/lib/stackblitzFiles/main.js +25 -0
- package/dist/es6/lib/stackblitzFiles/main.tsx +27 -0
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.d.ts +2 -0
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.d.ts.map +1 -0
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +42 -0
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +42 -0
- package/dist/es6/lib/stackblitzFiles/tsconfig.json +26 -0
- package/dist/es6/lib/stackblitzFiles/tsconfig.node.json +12 -0
- package/dist/es6/lib/stackblitzFiles/vite-env.d.ts +1 -0
- package/dist/es6/lib/stackblitzFiles/vite.config.d.ts +4 -0
- package/dist/es6/lib/stackblitzFiles/vite.config.d.ts.map +1 -0
- package/dist/es6/lib/stackblitzFiles/vite.config.js +7 -0
- package/dist/es6/lib/stackblitzFiles/vite.config.ts +10 -0
- package/dist/es6/lib/widgetUtils.d.ts +5 -5
- package/dist/es6/lib/widgetUtils.d.ts.map +1 -1
- package/dist/es6/lib/widgetUtils.js +25 -54
- package/dist/es6/lib/widgets/array.js +2 -4
- package/dist/es6/lib/widgets/callExpression.js +2 -14
- package/dist/es6/lib/widgets/canvasColor.js +2 -2
- package/dist/es6/lib/widgets/component.js +2 -4
- package/dist/es6/lib/widgets/conditional.js +2 -12
- package/dist/es6/lib/widgets/enhancedComponent.js +15 -67
- package/dist/es6/lib/widgets/external.js +2 -4
- package/dist/es6/lib/widgets/function.js +7 -26
- package/dist/es6/lib/widgets/intersection.js +2 -3
- package/dist/es6/lib/widgets/model.js +3 -19
- package/dist/es6/lib/widgets/object.js +2 -2
- package/dist/es6/lib/widgets/parenthesis.js +2 -5
- package/dist/es6/lib/widgets/primitives.js +9 -27
- package/dist/es6/lib/widgets/qualifiedName.js +2 -5
- package/dist/es6/lib/widgets/symbol.js +2 -2
- package/dist/es6/lib/widgets/tuple.js +2 -5
- package/dist/es6/lib/widgets/typeParameter.js +2 -13
- package/dist/es6/lib/widgets/union.js +4 -10
- package/dist/es6/mdx/installBlock.d.ts +1 -2
- package/dist/es6/mdx/installBlock.d.ts.map +1 -1
- package/dist/es6/mdx/installBlock.js +2 -6
- package/dist/es6/mdx/style-props/examples/Background.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Background.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Background.js +2 -5
- package/dist/es6/mdx/style-props/examples/Border.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Border.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Border.js +2 -5
- package/dist/es6/mdx/style-props/examples/Color.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Color.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Color.js +2 -5
- package/dist/es6/mdx/style-props/examples/Depth.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Depth.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Depth.js +2 -5
- package/dist/es6/mdx/style-props/examples/Flex.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Flex.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Flex.js +2 -14
- package/dist/es6/mdx/style-props/examples/FlexItem.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/FlexItem.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/FlexItem.js +2 -13
- package/dist/es6/mdx/style-props/examples/Grid.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Grid.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Grid.js +2 -6
- package/dist/es6/mdx/style-props/examples/GridItem.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/GridItem.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/GridItem.js +2 -6
- package/dist/es6/mdx/style-props/examples/Layout.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Layout.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Layout.js +2 -5
- package/dist/es6/mdx/style-props/examples/Other.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Other.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Other.js +2 -5
- package/dist/es6/mdx/style-props/examples/Position.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Position.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Position.js +2 -5
- package/dist/es6/mdx/style-props/examples/Space.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Space.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Space.js +2 -8
- package/dist/es6/mdx/style-props/examples/Text.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Text.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Text.js +2 -5
- package/dist/es6/mdx/versionsTable.d.ts +1 -2
- package/dist/es6/mdx/versionsTable.d.ts.map +1 -1
- package/dist/es6/mdx/versionsTable.js +23 -49
- package/dist/es6/mdx/welcomePage.d.ts +1 -2
- package/dist/es6/mdx/welcomePage.d.ts.map +1 -1
- package/dist/es6/mdx/welcomePage.js +37 -49
- package/dist/mdx/12.0-UPGRADE-GUIDE.mdx +1 -1
- package/dist/mdx/13.0-UPGRADE-GUIDE.mdx +454 -0
- package/dist/mdx/CODEMODS.mdx +58 -0
- package/dist/mdx/CONTRIBUTING.mdx +8 -0
- package/dist/mdx/TESTING.mdx +34 -0
- package/dist/mdx/preview-react/_examples/mdx/{Forms.mdx → FormLibraryExample.mdx} +0 -2
- package/dist/mdx/preview-react/{InformationHighlight → information-highlight}/examples/Basic.tsx +1 -1
- package/dist/mdx/preview-react/{InformationHighlight → information-highlight}/examples/Body.tsx +1 -1
- package/dist/mdx/preview-react/{InformationHighlight → information-highlight}/examples/Caution.tsx +1 -2
- package/dist/mdx/preview-react/{InformationHighlight → information-highlight}/examples/Critical.tsx +5 -12
- package/dist/mdx/preview-react/{InformationHighlight → information-highlight}/examples/CustomIconCritical.tsx +1 -1
- package/dist/mdx/preview-react/{InformationHighlight → information-highlight}/examples/Heading.tsx +1 -1
- package/dist/mdx/preview-react/information-highlight/examples/Informational.tsx +55 -0
- package/dist/mdx/preview-react/{InformationHighlight → information-highlight}/examples/RTL.tsx +1 -1
- package/dist/mdx/preview-react/loading-sparkles/examples/Basic.tsx +2 -2
- package/dist/mdx/preview-react/multi-select/examples/Basic.tsx +1 -1
- package/dist/mdx/preview-react/multi-select/examples/Complex.tsx +1 -1
- package/dist/mdx/preview-react/multi-select/examples/Controlled.tsx +1 -1
- package/dist/mdx/preview-react/multi-select/examples/Icons.tsx +1 -1
- package/dist/mdx/preview-react/multi-select/examples/Searching.tsx +1 -1
- package/dist/mdx/preview-react/pill/Pill.mdx +18 -9
- package/dist/mdx/preview-react/pill/examples/Basic.tsx +14 -8
- package/dist/mdx/preview-react/pill/examples/CustomStyles.tsx +45 -0
- package/dist/mdx/preview-react/pill/examples/WithAvatar.tsx +16 -10
- package/dist/mdx/preview-react/pill/examples/WithCount.tsx +12 -6
- package/dist/mdx/preview-react/pill/examples/WithList.tsx +15 -5
- package/dist/mdx/preview-react/pill/examples/WithReadOnly.tsx +8 -5
- package/dist/mdx/preview-react/pill/examples/WithRemovable.tsx +23 -11
- package/dist/mdx/preview-react/segmented-control/examples/Disabled.tsx +0 -1
- package/dist/mdx/preview-react/segmented-control/examples/RTL.tsx +0 -1
- package/dist/mdx/preview-react/segmented-control/examples/Vertical.tsx +0 -1
- package/dist/mdx/preview-react/select/examples/Left Label/DefaultWithCustomOptionsLeft.tsx +1 -1
- package/dist/mdx/preview-react/select/examples/Left Label/DefaultWithSimpleOptionsLeft.tsx +1 -1
- package/dist/mdx/preview-react/select/examples/Top Label/Alert.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Default.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/DefaultWithCustomOptions.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/DefaultWithSimpleOptions.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Disabled.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Error.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Grow.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Scrollable.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/storiesData.tsx +0 -1
- package/dist/mdx/preview-react/side-panel/SidePanel.mdx +28 -3
- package/dist/mdx/preview-react/side-panel/examples/AlwaysOpen.tsx +36 -17
- package/dist/mdx/preview-react/side-panel/examples/Basic.tsx +40 -34
- package/dist/mdx/preview-react/side-panel/examples/ExternalControl.tsx +47 -23
- package/dist/mdx/preview-react/side-panel/examples/HiddenName.tsx +24 -5
- package/dist/mdx/preview-react/side-panel/examples/OnExpandedChange.tsx +22 -6
- package/dist/mdx/preview-react/side-panel/examples/OnStateTransition.tsx +24 -9
- package/dist/mdx/preview-react/side-panel/examples/RightOrigin.tsx +39 -40
- package/dist/mdx/preview-react/side-panel/examples/Variant.tsx +36 -36
- package/dist/mdx/preview-react/text-area/examples/Alert.tsx +1 -4
- package/dist/mdx/preview-react/text-input/examples/Alert.tsx +1 -4
- package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +1 -4
- package/dist/mdx/react/_examples/Tooltips.mdx +15 -0
- package/dist/mdx/react/_examples/examples/Tooltips/ListOfUploadedFiles.tsx +38 -0
- package/dist/mdx/react/_examples/mdx/SidePanel.mdx +18 -1
- package/dist/mdx/react/_examples/mdx/examples/GlobalHeader.tsx +1 -1
- package/dist/mdx/react/_examples/mdx/examples/SidePanelWithNavigation.tsx +154 -116
- package/dist/mdx/react/_examples/mdx/examples/SidePanelWithOverlay.tsx +33 -15
- package/dist/mdx/react/_examples/mdx/examples/Table/WithSelectableRows.tsx +1 -1
- package/dist/mdx/react/action-bar/examples/Basic.tsx +0 -1
- package/dist/mdx/react/action-bar/examples/DeleteAction.tsx +0 -2
- package/dist/mdx/react/action-bar/examples/Icons.tsx +0 -2
- package/dist/mdx/react/avatar/avatar/examples/Basic.tsx +2 -3
- package/dist/mdx/react/avatar/avatar/examples/Button.tsx +3 -4
- package/dist/mdx/react/avatar/avatar/examples/CustomStyles.tsx +2 -3
- package/dist/mdx/react/avatar/avatar/examples/Image.tsx +7 -8
- package/dist/mdx/react/avatar/avatar/examples/LazyLoad.tsx +7 -2
- package/dist/mdx/react/avatar/avatar/examples/ObjectFit.tsx +9 -4
- package/dist/mdx/react/avatar/avatar/examples/Size.tsx +10 -11
- package/dist/mdx/react/avatar/avatar/examples/Variant.tsx +2 -3
- package/dist/mdx/react/banner/examples/Error.tsx +0 -2
- package/dist/mdx/react/banner/examples/Sticky.tsx +0 -1
- package/dist/mdx/react/banner/examples/StickyAnimation.tsx +42 -26
- package/dist/mdx/react/breadcrumbs/examples/Basic.tsx +0 -1
- package/dist/mdx/react/button/button/Button.mdx +5 -1
- package/dist/mdx/react/button/button/examples/CustomStyles.tsx +1 -3
- package/dist/mdx/react/button/button/examples/Delete.tsx +0 -2
- package/dist/mdx/react/button/button/examples/ExternalHyperlink.tsx +3 -3
- package/dist/mdx/react/button/button/examples/ExternalHyperlinkInverse.tsx +5 -1
- package/dist/mdx/react/button/button/examples/Hyperlink.tsx +0 -2
- package/dist/mdx/react/button/button/examples/Primary.tsx +0 -2
- package/dist/mdx/react/button/button/examples/ThemeOverrides.tsx +14 -17
- package/dist/mdx/react/collection/mdx/examples/MultiSelection.tsx +2 -1
- package/dist/mdx/react/collection/mdx/examples/Selection.tsx +2 -1
- package/dist/mdx/react/color-picker/color-preview/examples/Basic.tsx +0 -1
- package/dist/mdx/react/dialog/examples/DialogWithFallbackPlacements.tsx +0 -1
- package/dist/mdx/{labs-react → react}/expandable/Expandable.mdx +2 -2
- package/dist/mdx/{labs-react → react}/expandable/examples/Avatar.tsx +5 -7
- package/dist/mdx/{labs-react → react}/expandable/examples/Depth.tsx +1 -4
- package/dist/mdx/{labs-react → react}/expandable/examples/EndIcon.tsx +1 -3
- package/dist/mdx/{labs-react → react}/expandable/examples/HoistedModel.tsx +1 -1
- package/dist/mdx/{labs-react → react}/expandable/examples/LongTitle.tsx +2 -4
- package/dist/mdx/{labs-react → react}/expandable/examples/RTL.tsx +1 -3
- package/dist/mdx/{labs-react → react}/expandable/examples/StartIcon.tsx +1 -3
- package/dist/mdx/react/menu/Menu.mdx +34 -0
- package/dist/mdx/react/menu/examples/Grouping.tsx +32 -0
- package/dist/mdx/react/menu/examples/Icons.tsx +1 -1
- package/dist/mdx/react/menu/examples/Nested.tsx +49 -0
- package/dist/mdx/react/menu/examples/NestedDynamic.tsx +105 -0
- package/dist/mdx/react/modal/examples/Basic.tsx +0 -2
- package/dist/mdx/react/modal/examples/IframeTest.tsx +0 -1
- package/dist/mdx/react/modal/examples/ModalWithPopup.tsx +0 -1
- package/dist/mdx/react/modal/examples/StackedModals.tsx +0 -1
- package/dist/mdx/react/pagination/examples/CustomRange.tsx +0 -1
- package/dist/mdx/react/pagination/examples/GoToForm.tsx +0 -1
- package/dist/mdx/react/pagination/examples/JumpControls.tsx +0 -1
- package/dist/mdx/react/popup/examples/Basic.tsx +0 -2
- package/dist/mdx/react/popup/examples/CloseOnTargetHiddenTest.tsx +0 -1
- package/dist/mdx/react/popup/examples/ComboboxWithinPopup.tsx +0 -1
- package/dist/mdx/react/popup/examples/MultiplePopups.tsx +0 -2
- package/dist/mdx/react/popup/examples/PopupWithFallbackPlacements.tsx +0 -1
- package/dist/mdx/react/popup/examples/PopupWithNonHidablePopup.tsx +0 -1
- package/dist/mdx/react/popup/examples/ReturnFocusTest.tsx +8 -6
- package/dist/mdx/react/popup/examples/TooltipReturnFocus.tsx +0 -1
- package/dist/mdx/react/select/examples/Basic.tsx +1 -0
- package/dist/mdx/react/select/examples/MenuHeight.tsx +0 -1
- package/dist/mdx/react/table/Table.mdx +14 -1
- package/dist/mdx/react/table/examples/BaseHtmlTable.tsx +46 -0
- package/dist/mdx/react/tabs/examples/Basic.tsx +0 -1
- package/dist/mdx/react/tabs/examples/DisabledTab.tsx +0 -1
- package/dist/mdx/react/tabs/examples/DynamicTabs.tsx +3 -2
- package/dist/mdx/react/tabs/examples/NamedTabs.tsx +0 -1
- package/dist/mdx/react/tabs/examples/RightToLeft.tsx +0 -1
- package/dist/mdx/react/text-input/examples/Basic.tsx +0 -3
- package/dist/mdx/react/toast/examples/Basic.tsx +0 -2
- package/dist/mdx/react/toast/examples/ToastAlert.tsx +0 -2
- package/dist/mdx/react/toast/examples/ToastDialog.tsx +0 -2
- package/dist/mdx/react/tokens/Tokens.mdx +1 -1
- package/dist/mdx/react/tooltip/Tooltip.mdx +31 -1
- package/dist/mdx/react/tooltip/examples/Default.tsx +0 -2
- package/dist/mdx/react/tooltip/examples/DescribeType.tsx +0 -2
- package/dist/mdx/react/tooltip/examples/DescriptionType.tsx +20 -0
- package/dist/mdx/react/tooltip/examples/Muted.tsx +0 -2
- package/dist/mdx/react/tooltip/examples/Placements.tsx +14 -11
- package/dist/mdx/style-props/examples/Background.tsx +2 -3
- package/dist/mdx/style-props/examples/Border.tsx +2 -3
- package/dist/mdx/style-props/examples/Color.tsx +2 -3
- package/dist/mdx/style-props/examples/Depth.tsx +2 -3
- package/dist/mdx/style-props/examples/Flex.tsx +0 -1
- package/dist/mdx/style-props/examples/FlexItem.tsx +0 -1
- package/dist/mdx/style-props/examples/Grid.tsx +0 -1
- package/dist/mdx/style-props/examples/GridItem.tsx +0 -1
- package/dist/mdx/style-props/examples/Layout.tsx +0 -1
- package/dist/mdx/style-props/examples/Other.tsx +0 -1
- package/dist/mdx/style-props/examples/Position.tsx +2 -3
- package/dist/mdx/style-props/examples/Space.tsx +2 -3
- package/dist/mdx/style-props/examples/Text.tsx +0 -1
- package/lib/ExampleCodeBlock.tsx +57 -19
- package/lib/MDXElements.tsx +3 -3
- package/lib/StylePropsTable.tsx +1 -2
- package/lib/Table.tsx +0 -1
- package/lib/stackblitzFiles/.eslintrc.cjs.txt +15 -0
- package/lib/stackblitzFiles/App.tsx +33 -0
- package/lib/stackblitzFiles/Demo.tsx +1 -0
- package/lib/stackblitzFiles/index.html +13 -0
- package/lib/stackblitzFiles/main.tsx +27 -0
- package/lib/stackblitzFiles/packageJSONFile.ts +42 -0
- package/lib/stackblitzFiles/tsconfig.json +26 -0
- package/lib/stackblitzFiles/tsconfig.node.json +12 -0
- package/lib/stackblitzFiles/types/custom-imports.d.ts +13 -0
- package/lib/stackblitzFiles/vite-env.d.ts +1 -0
- package/lib/stackblitzFiles/vite.config.ts +10 -0
- package/lib/widgets/array.tsx +0 -2
- package/lib/widgets/canvasColor.tsx +0 -2
- package/lib/widgets/component.tsx +0 -2
- package/lib/widgets/conditional.tsx +0 -2
- package/lib/widgets/enhancedComponent.tsx +1 -1
- package/lib/widgets/external.tsx +3 -2
- package/lib/widgets/model.tsx +0 -2
- package/lib/widgets/parenthesis.tsx +0 -2
- package/lib/widgets/primitives.tsx +1 -5
- package/lib/widgets/qualifiedName.tsx +0 -2
- package/lib/widgets/symbol.tsx +0 -2
- package/lib/widgets/tuple.tsx +0 -2
- package/lib/widgets/typeParameter.tsx +0 -2
- package/package.json +8 -7
- package/dist/mdx/preview-react/InformationHighlight/examples/Informational.tsx +0 -27
- /package/dist/mdx/preview-react/{InformationHighlight → information-highlight}/InformationHighlight.mdx +0 -0
- /package/dist/mdx/{labs-react → react}/expandable/examples/test-avatar.png +0 -0
|
@@ -1,35 +1,54 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {styled} from '@workday/canvas-kit-react/common';
|
|
3
|
-
import {space} from '@workday/canvas-kit-react/tokens';
|
|
4
2
|
import {AccentIcon} from '@workday/canvas-kit-react/icon';
|
|
5
3
|
import {rocketIcon} from '@workday/canvas-accent-icons-web';
|
|
6
4
|
import {SidePanel, useSidePanel} from '@workday/canvas-kit-preview-react/side-panel';
|
|
7
5
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
8
|
-
import {Text} from '@workday/canvas-kit-react/text';
|
|
6
|
+
import {Heading, Text} from '@workday/canvas-kit-react/text';
|
|
7
|
+
import {base, system} from '@workday/canvas-tokens-web';
|
|
8
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const stylesOverride = {
|
|
11
|
+
accentIcon: createStyles({
|
|
12
|
+
marginRight: system.space.x4,
|
|
13
|
+
}),
|
|
14
|
+
pageContainer: createStyles({
|
|
15
|
+
gap: system.space.x4,
|
|
16
|
+
height: px2rem(320),
|
|
17
|
+
}),
|
|
18
|
+
panelContainer: createStyles({
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
paddingY: system.space.x4,
|
|
21
|
+
paddingX: system.space.x4,
|
|
22
|
+
}),
|
|
23
|
+
panelHeading: createStyles({
|
|
24
|
+
color: base.licorice500,
|
|
25
|
+
}),
|
|
26
|
+
mainContent: createStyles({
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
justifyContent: 'center',
|
|
29
|
+
flexBasis: 'auto',
|
|
30
|
+
flex: 1,
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
13
33
|
|
|
14
34
|
export default () => {
|
|
15
35
|
const {panelProps, labelProps} = useSidePanel();
|
|
16
36
|
|
|
17
37
|
return (
|
|
18
|
-
<Flex
|
|
38
|
+
<Flex cs={stylesOverride.pageContainer}>
|
|
19
39
|
<SidePanel {...panelProps}>
|
|
20
|
-
<Flex
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
as="h3"
|
|
24
|
-
typeLevel="body.large"
|
|
25
|
-
color="licorice500"
|
|
26
|
-
fontWeight="bold"
|
|
27
|
-
{...labelProps}
|
|
28
|
-
>
|
|
40
|
+
<Flex cs={stylesOverride.panelContainer}>
|
|
41
|
+
<AccentIcon icon={rocketIcon} cs={stylesOverride.accentIcon} />
|
|
42
|
+
<Heading size="small" cs={stylesOverride.panelHeading} {...labelProps}>
|
|
29
43
|
Tasks Panel
|
|
30
|
-
</
|
|
44
|
+
</Heading>
|
|
31
45
|
</Flex>
|
|
32
46
|
</SidePanel>
|
|
47
|
+
<Flex as="main" cs={stylesOverride.mainContent}>
|
|
48
|
+
<Text as="p" typeLevel="body.large">
|
|
49
|
+
This is the main content section.
|
|
50
|
+
</Text>
|
|
51
|
+
</Flex>
|
|
33
52
|
</Flex>
|
|
34
53
|
);
|
|
35
54
|
};
|
|
@@ -6,54 +6,60 @@ import {
|
|
|
6
6
|
SidePanelTransitionStates,
|
|
7
7
|
} from '@workday/canvas-kit-preview-react/side-panel';
|
|
8
8
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
9
|
-
import {Text} from '@workday/canvas-kit-react/text';
|
|
9
|
+
import {Heading, Text} from '@workday/canvas-kit-react/text';
|
|
10
10
|
import {CanvasProvider} from '@workday/canvas-kit-react/common';
|
|
11
11
|
import {AccentIcon} from '@workday/canvas-kit-react/icon';
|
|
12
12
|
import {rocketIcon} from '@workday/canvas-accent-icons-web';
|
|
13
|
-
// local helper hook for setting content direction;
|
|
14
13
|
import {useDirection} from './useDirection';
|
|
14
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
15
|
+
import {system, base} from '@workday/canvas-tokens-web';
|
|
16
|
+
|
|
17
|
+
const stylesOverride = {
|
|
18
|
+
viewPortContainer: createStyles({
|
|
19
|
+
height: px2rem(320),
|
|
20
|
+
}),
|
|
21
|
+
panel: createStyles({
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
paddingY: system.space.x4,
|
|
24
|
+
paddingX: system.space.x4,
|
|
25
|
+
}),
|
|
26
|
+
accentIcon: createStyles({
|
|
27
|
+
marginInlineEnd: system.space.x4,
|
|
28
|
+
}),
|
|
29
|
+
mainContent: createStyles({
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
justifyContent: 'center',
|
|
32
|
+
flexDirection: 'column',
|
|
33
|
+
flex: 1,
|
|
34
|
+
flexBasis: 'auto',
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
15
37
|
|
|
16
38
|
export default () => {
|
|
17
39
|
const {direction, toggleDirection} = useDirection();
|
|
18
40
|
const {expanded, panelProps, labelProps, controlProps} = useSidePanel();
|
|
19
|
-
const [panelState, setPanelState] = React.useState<SidePanelTransitionStates>(
|
|
20
|
-
expanded ? 'expanded' : 'collapsed'
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
const expandedContent = (
|
|
24
|
-
<Flex alignItems="center" paddingY="s" paddingX="s">
|
|
25
|
-
<Flex marginInlineEnd="s">
|
|
26
|
-
<AccentIcon icon={rocketIcon} />
|
|
27
|
-
</Flex>
|
|
28
|
-
<Text as="h3" typeLevel="body.large" color="licorice500" fontWeight="bold" {...labelProps}>
|
|
29
|
-
Tasks Panel
|
|
30
|
-
</Text>
|
|
31
|
-
</Flex>
|
|
32
|
-
);
|
|
33
41
|
|
|
34
42
|
return (
|
|
35
43
|
<CanvasProvider theme={{canvas: {direction}}}>
|
|
36
|
-
<Flex
|
|
37
|
-
<SidePanel {...panelProps}
|
|
44
|
+
<Flex cs={stylesOverride.viewPortContainer}>
|
|
45
|
+
<SidePanel {...panelProps}>
|
|
38
46
|
<SidePanel.ToggleButton {...controlProps} />
|
|
39
|
-
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
<Flex cs={stylesOverride.panel}>
|
|
48
|
+
{expanded && (
|
|
49
|
+
<Flex cs={stylesOverride.accentIcon}>
|
|
50
|
+
<AccentIcon icon={rocketIcon} />
|
|
51
|
+
</Flex>
|
|
52
|
+
)}
|
|
53
|
+
<Heading size="small" {...labelProps} hidden={!expanded ? true : undefined}>
|
|
43
54
|
Tasks Panel
|
|
44
|
-
</
|
|
45
|
-
|
|
55
|
+
</Heading>
|
|
56
|
+
</Flex>
|
|
46
57
|
</SidePanel>
|
|
47
|
-
<Flex
|
|
48
|
-
as="
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
flex={1}
|
|
53
|
-
flexBasis="auto"
|
|
54
|
-
>
|
|
55
|
-
<p>Toggle the content direction</p>
|
|
56
|
-
<SecondaryButton onClick={toggleDirection} role="button">
|
|
58
|
+
<Flex as="main" cs={stylesOverride.mainContent}>
|
|
59
|
+
<Text as="p" typeLevel="body.large">
|
|
60
|
+
Toggle the content direction
|
|
61
|
+
</Text>
|
|
62
|
+
<SecondaryButton onClick={toggleDirection}>
|
|
57
63
|
Set to {direction === 'ltr' ? 'Right-to-Left' : 'Left-to-Right'}
|
|
58
64
|
</SecondaryButton>
|
|
59
65
|
</Flex>
|
|
@@ -5,9 +5,45 @@ import {
|
|
|
5
5
|
SidePanelTransitionStates,
|
|
6
6
|
} from '@workday/canvas-kit-preview-react/side-panel';
|
|
7
7
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
8
|
-
import {Text} from '@workday/canvas-kit-react/text';
|
|
8
|
+
import {Heading, Text} from '@workday/canvas-kit-react/text';
|
|
9
9
|
import {SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
10
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
11
|
+
import {base, system} from '@workday/canvas-tokens-web';
|
|
10
12
|
|
|
13
|
+
const stylesOverride = {
|
|
14
|
+
viewport: createStyles({
|
|
15
|
+
height: px2rem(320),
|
|
16
|
+
}),
|
|
17
|
+
panel: createStyles({
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
paddingY: system.space.x4,
|
|
20
|
+
paddingX: system.space.x4,
|
|
21
|
+
}),
|
|
22
|
+
panelHeading: createStyles({
|
|
23
|
+
color: base.licorice500,
|
|
24
|
+
}),
|
|
25
|
+
main: createStyles({
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
justifyContent: 'center',
|
|
28
|
+
flexDirection: 'column',
|
|
29
|
+
flex: 1,
|
|
30
|
+
flexBasis: 'auto',
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/*
|
|
35
|
+
* NOTE TO DEV:
|
|
36
|
+
* Spreading the `controlProps` onto an external control creates serious accessibility issues.
|
|
37
|
+
* - `aria-labelledby` id reference is invalid when the SidePanel is collapsed
|
|
38
|
+
* - `aria-labelledby` will change the name of "Toggle Side Panel" button to "Tasks Panel"
|
|
39
|
+
* - `aria-expanded` won't make sense to screen reader users when the expanded SidePanel content isn't following the control
|
|
40
|
+
* - `aria-controls` is unsupported by screen readers and will not allow users to navigate to the controlled content
|
|
41
|
+
*
|
|
42
|
+
* SOLUTION:
|
|
43
|
+
* - Pass the `controlProps` click handler function down to the external control component.
|
|
44
|
+
* - Add a toggle state to Button components with `aria-pressed` for screen readers,
|
|
45
|
+
* - OR use a similar toggle input like Checkbox or Switch.
|
|
46
|
+
*/
|
|
11
47
|
export default () => {
|
|
12
48
|
const {expanded, panelProps, labelProps, controlProps} = useSidePanel({initialExpanded: false});
|
|
13
49
|
const [panelState, setPanelState] = React.useState<SidePanelTransitionStates>(
|
|
@@ -15,9 +51,8 @@ export default () => {
|
|
|
15
51
|
);
|
|
16
52
|
|
|
17
53
|
return (
|
|
18
|
-
<Flex
|
|
54
|
+
<Flex cs={stylesOverride.viewport}>
|
|
19
55
|
<SidePanel
|
|
20
|
-
as="aside"
|
|
21
56
|
{...panelProps}
|
|
22
57
|
onExpandedChange={expanded => {
|
|
23
58
|
console.log(`expanded prop is: ${expanded ? 'true' : 'false'}`);
|
|
@@ -25,30 +60,19 @@ export default () => {
|
|
|
25
60
|
onStateTransition={setPanelState}
|
|
26
61
|
>
|
|
27
62
|
{panelState === 'expanded' && (
|
|
28
|
-
<Flex
|
|
29
|
-
<
|
|
30
|
-
as="h3"
|
|
31
|
-
typeLevel="body.large"
|
|
32
|
-
color="licorice500"
|
|
33
|
-
fontWeight="bold"
|
|
34
|
-
{...labelProps}
|
|
35
|
-
>
|
|
63
|
+
<Flex cs={stylesOverride.panel}>
|
|
64
|
+
<Heading size="small" cs={stylesOverride.panelHeading} {...labelProps}>
|
|
36
65
|
Tasks Panel
|
|
37
|
-
</
|
|
66
|
+
</Heading>
|
|
38
67
|
</Flex>
|
|
39
68
|
)}
|
|
40
69
|
</SidePanel>
|
|
41
|
-
<Flex
|
|
42
|
-
as="
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
flexBasis="auto"
|
|
48
|
-
>
|
|
49
|
-
<p>Control the panel externally</p>
|
|
50
|
-
<SecondaryButton {...controlProps} role="button">
|
|
51
|
-
Toggle Side Panel
|
|
70
|
+
<Flex as="main" cs={stylesOverride.main}>
|
|
71
|
+
<Text as="p" typeLevel="body.large">
|
|
72
|
+
Control the panel externally
|
|
73
|
+
</Text>
|
|
74
|
+
<SecondaryButton onClick={controlProps.onClick} aria-pressed={expanded}>
|
|
75
|
+
Show Side Panel
|
|
52
76
|
</SecondaryButton>
|
|
53
77
|
</Flex>
|
|
54
78
|
</Flex>
|
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import {SidePanel, useSidePanel} from '@workday/canvas-kit-preview-react/side-panel';
|
|
3
3
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
4
|
+
import {AccessibleHide} from '@workday/canvas-kit-react/common';
|
|
5
|
+
import {Text} from '@workday/canvas-kit-react/text';
|
|
6
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
7
|
+
|
|
8
|
+
const stylesOverride = {
|
|
9
|
+
viewport: createStyles({
|
|
10
|
+
height: px2rem(320),
|
|
11
|
+
}),
|
|
12
|
+
main: createStyles({
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
justifyContent: 'center',
|
|
15
|
+
flexDirection: 'column',
|
|
16
|
+
flex: 1,
|
|
17
|
+
flexBasis: 'auto',
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
4
20
|
|
|
5
21
|
export default () => {
|
|
6
22
|
const {panelProps, labelProps, controlProps} = useSidePanel();
|
|
23
|
+
|
|
7
24
|
return (
|
|
8
|
-
<Flex
|
|
25
|
+
<Flex cs={stylesOverride.viewport}>
|
|
9
26
|
<SidePanel
|
|
10
|
-
as="aside"
|
|
11
27
|
{...panelProps}
|
|
12
28
|
onExpandedChange={expanded => {
|
|
13
29
|
console.log(`expanded prop is: ${expanded ? 'true' : 'false'}`);
|
|
@@ -17,10 +33,13 @@ export default () => {
|
|
|
17
33
|
}}
|
|
18
34
|
>
|
|
19
35
|
<SidePanel.ToggleButton {...controlProps} />
|
|
20
|
-
<
|
|
21
|
-
Side Panel with a hidden label
|
|
22
|
-
</span>
|
|
36
|
+
<AccessibleHide {...labelProps}>Hidden Title</AccessibleHide>
|
|
23
37
|
</SidePanel>
|
|
38
|
+
<Flex as="main" cs={stylesOverride.main}>
|
|
39
|
+
<Text as="p" typeLevel="body.large">
|
|
40
|
+
Side Panel with a hidden title text.
|
|
41
|
+
</Text>
|
|
42
|
+
</Flex>
|
|
24
43
|
</Flex>
|
|
25
44
|
);
|
|
26
45
|
};
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
3
3
|
import {SidePanel, useSidePanel} from '@workday/canvas-kit-preview-react/side-panel';
|
|
4
|
+
import {Text} from '@workday/canvas-kit-react/text';
|
|
5
|
+
import {AccessibleHide} from '@workday/canvas-kit-react/common';
|
|
6
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
7
|
+
|
|
8
|
+
const stylesOverride = {
|
|
9
|
+
viewport: createStyles({
|
|
10
|
+
height: px2rem(320),
|
|
11
|
+
}),
|
|
12
|
+
main: createStyles({
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
justifyContent: 'center',
|
|
15
|
+
flexDirection: 'column',
|
|
16
|
+
flex: 1,
|
|
17
|
+
flexBasis: 'auto',
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
4
20
|
|
|
5
21
|
export default () => {
|
|
6
22
|
const {expanded, panelProps, labelProps, controlProps} = useSidePanel();
|
|
@@ -10,15 +26,15 @@ export default () => {
|
|
|
10
26
|
};
|
|
11
27
|
|
|
12
28
|
return (
|
|
13
|
-
<Flex
|
|
29
|
+
<Flex cs={stylesOverride.viewport}>
|
|
14
30
|
<SidePanel {...panelProps} onExpandedChange={handleExpandedChange}>
|
|
15
31
|
<SidePanel.ToggleButton {...controlProps} />
|
|
16
|
-
<
|
|
17
|
-
custom side panel
|
|
18
|
-
</span>
|
|
32
|
+
<AccessibleHide {...labelProps}>Hidden Title</AccessibleHide>
|
|
19
33
|
</SidePanel>
|
|
20
|
-
<Flex as="main"
|
|
21
|
-
<p
|
|
34
|
+
<Flex as="main" cs={stylesOverride.main}>
|
|
35
|
+
<Text as="p" typeLevel="body.large">
|
|
36
|
+
Side panel is {expanded ? 'expanded' : 'collapsed'}.
|
|
37
|
+
</Text>
|
|
22
38
|
</Flex>
|
|
23
39
|
</Flex>
|
|
24
40
|
);
|
|
@@ -5,27 +5,42 @@ import {
|
|
|
5
5
|
useSidePanel,
|
|
6
6
|
SidePanelTransitionStates,
|
|
7
7
|
} from '@workday/canvas-kit-preview-react/side-panel';
|
|
8
|
+
import {AccessibleHide} from '@workday/canvas-kit-react/common';
|
|
9
|
+
import {Text} from '@workday/canvas-kit-react/text';
|
|
10
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
11
|
+
|
|
12
|
+
const stylesOverride = {
|
|
13
|
+
viewport: createStyles({
|
|
14
|
+
height: px2rem(320),
|
|
15
|
+
}),
|
|
16
|
+
main: createStyles({
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
justifyContent: 'center',
|
|
19
|
+
flexDirection: 'column',
|
|
20
|
+
flex: 1,
|
|
21
|
+
flexBasis: 'auto',
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
8
24
|
|
|
9
25
|
export default () => {
|
|
10
26
|
const {panelProps, labelProps, controlProps} = useSidePanel();
|
|
11
|
-
const [transitionState, setTransitionState] =
|
|
12
|
-
'expanded'
|
|
13
|
-
);
|
|
27
|
+
const [transitionState, setTransitionState] =
|
|
28
|
+
React.useState<SidePanelTransitionStates>('expanded');
|
|
14
29
|
|
|
15
30
|
const handleStateTransition = (transition: SidePanelTransitionStates) => {
|
|
16
31
|
setTransitionState(transition);
|
|
17
32
|
};
|
|
18
33
|
|
|
19
34
|
return (
|
|
20
|
-
<Flex
|
|
35
|
+
<Flex cs={stylesOverride.viewport}>
|
|
21
36
|
<SidePanel {...panelProps} onStateTransition={handleStateTransition}>
|
|
22
37
|
<SidePanel.ToggleButton {...controlProps} />
|
|
23
|
-
<
|
|
24
|
-
custom side panel
|
|
25
|
-
</span>
|
|
38
|
+
<AccessibleHide {...labelProps}>Hidden Title</AccessibleHide>
|
|
26
39
|
</SidePanel>
|
|
27
|
-
<Flex as="main"
|
|
28
|
-
<p
|
|
40
|
+
<Flex as="main" cs={stylesOverride.main}>
|
|
41
|
+
<Text as="p" typeLevel="body.large">
|
|
42
|
+
Side panel is {transitionState}.
|
|
43
|
+
</Text>
|
|
29
44
|
</Flex>
|
|
30
45
|
</Flex>
|
|
31
46
|
);
|
|
@@ -1,45 +1,49 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import {SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
3
|
-
import {
|
|
4
|
-
SidePanel,
|
|
5
|
-
useSidePanel,
|
|
6
|
-
SidePanelTransitionStates,
|
|
7
|
-
} from '@workday/canvas-kit-preview-react/side-panel';
|
|
3
|
+
import {SidePanel, useSidePanel} from '@workday/canvas-kit-preview-react/side-panel';
|
|
8
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
9
|
-
import {Text} from '@workday/canvas-kit-react/text';
|
|
10
|
-
import {CanvasProvider
|
|
5
|
+
import {Heading, Text} from '@workday/canvas-kit-react/text';
|
|
6
|
+
import {CanvasProvider} from '@workday/canvas-kit-react/common';
|
|
7
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
8
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
9
|
+
|
|
11
10
|
// local helper hook for setting content direction;
|
|
12
11
|
import {useDirection} from './useDirection';
|
|
13
12
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const stylesOverride = {
|
|
14
|
+
viewport: createStyles({
|
|
15
|
+
height: px2rem(320),
|
|
16
|
+
}),
|
|
17
|
+
panelContainer: createStyles({
|
|
18
|
+
marginLeft: 'auto',
|
|
19
|
+
}),
|
|
20
|
+
panel: createStyles({
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
justifyContent: 'flex-end',
|
|
23
|
+
paddingY: system.space.x4,
|
|
24
|
+
paddingX: system.space.x4,
|
|
25
|
+
}),
|
|
26
|
+
main: createStyles({
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
justifyContent: 'center',
|
|
29
|
+
flexDirection: 'column',
|
|
30
|
+
flex: 1,
|
|
31
|
+
flexBasis: 'auto',
|
|
32
|
+
}),
|
|
33
|
+
};
|
|
17
34
|
|
|
18
35
|
const RightPanel = () => {
|
|
19
36
|
const {expanded, panelProps, labelProps, controlProps} = useSidePanel();
|
|
20
|
-
const [panelState, setPanelState] = React.useState<SidePanelTransitionStates>(
|
|
21
|
-
expanded ? 'expanded' : 'collapsed'
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
const expandedContent = (
|
|
25
|
-
<Flex alignItems="center" justifyContent="flex-end" paddingY="s" paddingX="s">
|
|
26
|
-
<Text as="h3" typeLevel="body.large" color="licorice500" fontWeight="bold" {...labelProps}>
|
|
27
|
-
Tasks Panel
|
|
28
|
-
</Text>
|
|
29
|
-
</Flex>
|
|
30
|
-
);
|
|
31
37
|
|
|
32
38
|
return (
|
|
33
|
-
<
|
|
39
|
+
<SidePanel {...panelProps} origin="right" className={stylesOverride.panelContainer}>
|
|
34
40
|
<SidePanel.ToggleButton {...controlProps} />
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
) : (
|
|
38
|
-
<Text hidden {...labelProps}>
|
|
41
|
+
<Flex cs={stylesOverride.panel}>
|
|
42
|
+
<Heading size="small" hidden={!expanded ? true : undefined} {...labelProps}>
|
|
39
43
|
Tasks Panel
|
|
40
|
-
</
|
|
41
|
-
|
|
42
|
-
</
|
|
44
|
+
</Heading>
|
|
45
|
+
</Flex>
|
|
46
|
+
</SidePanel>
|
|
43
47
|
);
|
|
44
48
|
};
|
|
45
49
|
|
|
@@ -48,17 +52,12 @@ export default () => {
|
|
|
48
52
|
|
|
49
53
|
return (
|
|
50
54
|
<CanvasProvider theme={{canvas: {direction}}}>
|
|
51
|
-
<Flex
|
|
52
|
-
<Flex
|
|
53
|
-
as="
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
flex={1}
|
|
58
|
-
flexBasis="auto"
|
|
59
|
-
>
|
|
60
|
-
<p>Toggle the content direction</p>
|
|
61
|
-
<SecondaryButton onClick={toggleDirection} role="button">
|
|
55
|
+
<Flex cs={stylesOverride.viewport}>
|
|
56
|
+
<Flex as="main" cs={stylesOverride.main}>
|
|
57
|
+
<Text as="p" typeLevel="body.large">
|
|
58
|
+
Toggle the content direction
|
|
59
|
+
</Text>
|
|
60
|
+
<SecondaryButton onClick={toggleDirection}>
|
|
62
61
|
Set to {direction === 'ltr' ? 'Right-to-Left' : 'Left-to-Right'}
|
|
63
62
|
</SecondaryButton>
|
|
64
63
|
</Flex>
|
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import {SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
3
|
-
import {
|
|
4
|
-
SidePanel,
|
|
5
|
-
useSidePanel,
|
|
6
|
-
SidePanelTransitionStates,
|
|
7
|
-
} from '@workday/canvas-kit-preview-react/side-panel';
|
|
3
|
+
import {SidePanel, useSidePanel} from '@workday/canvas-kit-preview-react/side-panel';
|
|
8
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
9
|
-
import {Text} from '@workday/canvas-kit-react/text';
|
|
5
|
+
import {Heading, Text} from '@workday/canvas-kit-react/text';
|
|
10
6
|
import {CanvasProvider} from '@workday/canvas-kit-react/common';
|
|
7
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
8
|
+
import {base, system} from '@workday/canvas-tokens-web';
|
|
9
|
+
|
|
11
10
|
// local helper hook for setting content direction;
|
|
12
11
|
import {useDirection} from './useDirection';
|
|
13
12
|
|
|
13
|
+
const stylesOverride = {
|
|
14
|
+
viewport: createStyles({
|
|
15
|
+
height: px2rem(320),
|
|
16
|
+
backgroundColor: base.soap100,
|
|
17
|
+
}),
|
|
18
|
+
panel: createStyles({
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
paddingY: system.space.x4,
|
|
21
|
+
paddingX: system.space.x4,
|
|
22
|
+
}),
|
|
23
|
+
main: createStyles({
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
justifyContent: 'center',
|
|
26
|
+
flexDirection: 'column',
|
|
27
|
+
flex: 1,
|
|
28
|
+
flexBasis: 'auto',
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
|
|
14
32
|
export default () => {
|
|
15
33
|
const {direction, toggleDirection} = useDirection();
|
|
16
34
|
const {expanded, panelProps, labelProps, controlProps} = useSidePanel();
|
|
17
|
-
const [panelState, setPanelState] = React.useState<SidePanelTransitionStates>(
|
|
18
|
-
expanded ? 'expanded' : 'collapsed'
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
const expandedContent = (
|
|
22
|
-
<Flex alignItems="center" paddingY="s" paddingX="s">
|
|
23
|
-
<Text as="h3" typeLevel="body.large" color="licorice500" fontWeight="bold" {...labelProps}>
|
|
24
|
-
Alternate Panel
|
|
25
|
-
</Text>
|
|
26
|
-
</Flex>
|
|
27
|
-
);
|
|
28
35
|
|
|
29
36
|
return (
|
|
30
37
|
<CanvasProvider theme={{canvas: {direction}}}>
|
|
31
|
-
<Flex
|
|
32
|
-
<SidePanel {...panelProps}
|
|
38
|
+
<Flex cs={stylesOverride.viewport}>
|
|
39
|
+
<SidePanel {...panelProps} variant="alternate">
|
|
33
40
|
<SidePanel.ToggleButton {...controlProps} />
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</Text>
|
|
40
|
-
)}
|
|
41
|
+
<Flex cs={stylesOverride.panel}>
|
|
42
|
+
<Heading size="small" hidden={!expanded ? true : undefined} {...labelProps}>
|
|
43
|
+
Alternate Panel
|
|
44
|
+
</Heading>
|
|
45
|
+
</Flex>
|
|
41
46
|
</SidePanel>
|
|
42
|
-
<Flex
|
|
43
|
-
as="
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
flex={1}
|
|
48
|
-
flexBasis="auto"
|
|
49
|
-
>
|
|
50
|
-
<p>Toggle the content direction</p>
|
|
51
|
-
<SecondaryButton onClick={toggleDirection} role="button">
|
|
47
|
+
<Flex as="main" cs={stylesOverride.main}>
|
|
48
|
+
<Text as="p" typeLevel="body.large">
|
|
49
|
+
Toggle the content direction
|
|
50
|
+
</Text>
|
|
51
|
+
<SecondaryButton onClick={toggleDirection}>
|
|
52
52
|
Set to {direction === 'ltr' ? 'Right-to-Left' : 'Left-to-Right'}
|
|
53
53
|
</SecondaryButton>
|
|
54
54
|
</Flex>
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/** @jsxRuntime classic */
|
|
2
|
-
/** @jsx jsx */
|
|
3
|
-
import {jsx} from '@emotion/react';
|
|
4
1
|
import React from 'react';
|
|
5
2
|
import {TextArea} from '@workday/canvas-kit-preview-react/text-area';
|
|
6
3
|
import {useThemedRing} from '@workday/canvas-kit-react/common';
|
|
@@ -28,7 +25,7 @@ export default () => {
|
|
|
28
25
|
return (
|
|
29
26
|
<TextArea orientation="vertical">
|
|
30
27
|
<TextArea.Label>Add a comment</TextArea.Label>
|
|
31
|
-
<TextArea.Field
|
|
28
|
+
<TextArea.Field cs={alertStyles} onChange={handleChange} value={value} />
|
|
32
29
|
<TextArea.Hint paddingTop={space.xxs}>
|
|
33
30
|
<strong>Character Limit: </strong>
|
|
34
31
|
<Text color={hintColor}>{10 - value.length} Left</Text>
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/** @jsxRuntime classic */
|
|
2
|
-
/** @jsx jsx */
|
|
3
|
-
import {jsx} from '@emotion/react';
|
|
4
1
|
import React from 'react';
|
|
5
2
|
import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
|
|
6
3
|
import {useThemedRing} from '@workday/canvas-kit-react/common';
|
|
@@ -20,7 +17,7 @@ export default () => {
|
|
|
20
17
|
return (
|
|
21
18
|
<TextInput orientation="vertical">
|
|
22
19
|
<TextInput.Label>Password</TextInput.Label>
|
|
23
|
-
<TextInput.Field
|
|
20
|
+
<TextInput.Field cs={alertStyles} onChange={handleChange} value={value} type="password" />
|
|
24
21
|
<TextInput.Hint paddingTop={space.xxs}>
|
|
25
22
|
<strong>Password Strength: </strong>
|
|
26
23
|
{value.length < 3 ? (
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/** @jsxRuntime classic */
|
|
2
|
-
/** @jsx jsx */
|
|
3
|
-
import {jsx} from '@emotion/react';
|
|
4
1
|
import React from 'react';
|
|
5
2
|
import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
|
|
6
3
|
import {
|
|
@@ -43,7 +40,7 @@ const AlertInput = () => {
|
|
|
43
40
|
return (
|
|
44
41
|
<TextInput orientation="vertical">
|
|
45
42
|
<TextInput.Label>Email</TextInput.Label>
|
|
46
|
-
<TextInput.Field
|
|
43
|
+
<TextInput.Field cs={alertStyles} onChange={handleChange} value={value} />
|
|
47
44
|
<TextInput.Hint paddingTop={space.xxs}>Please enter a valid email.</TextInput.Hint>
|
|
48
45
|
</TextInput>
|
|
49
46
|
);
|