@workday/canvas-kit-docs 13.0.0-alpha.998-next.0 → 13.0.1
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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
|
|
2
|
+
import ListOfUploadedFiles from './examples/Tooltips/ListOfUploadedFiles';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
# Accessible Tooltip Examples
|
|
6
|
+
|
|
7
|
+
## Using descriptive tooltips for repeated text buttons
|
|
8
|
+
|
|
9
|
+
In this example, the "Delete" buttons are used repeatedly to reference the multiple files that have
|
|
10
|
+
been uploaded to the web app. The text buttons already have an accessible name (a.k.a. label)
|
|
11
|
+
derived from the button's inner text. The `describe` tooltip can be useful for providing more
|
|
12
|
+
in-context description for both low vision sighted users and screen reader users without overriding
|
|
13
|
+
the button name "Delete".
|
|
14
|
+
|
|
15
|
+
<ExampleCodeBlock code={ListOfUploadedFiles} />
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {DeleteButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {Heading, Text} from '@workday/canvas-kit-react/text';
|
|
6
|
+
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
|
|
7
|
+
import {trashIcon} from '@workday/canvas-system-icons-web';
|
|
8
|
+
|
|
9
|
+
const files = ['Cover Letter.docx', 'Resume.docx', 'Portfolio.pptx', 'Portrait.png'];
|
|
10
|
+
|
|
11
|
+
const listStyles = {
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
width: '35rem',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const deleteBtnStyle = {
|
|
17
|
+
marginLeft: 'auto',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default () => {
|
|
21
|
+
return (
|
|
22
|
+
<>
|
|
23
|
+
<Heading size="medium">Uploaded Files:</Heading>
|
|
24
|
+
<Flex as="ul" gap="1rem" flexDirection="column">
|
|
25
|
+
{files.map(i => (
|
|
26
|
+
<Flex as="li" style={listStyles}>
|
|
27
|
+
<Text>{i}</Text>
|
|
28
|
+
<Tooltip type="description" title={i}>
|
|
29
|
+
<DeleteButton icon={trashIcon} style={deleteBtnStyle}>
|
|
30
|
+
Delete
|
|
31
|
+
</DeleteButton>
|
|
32
|
+
</Tooltip>
|
|
33
|
+
</Flex>
|
|
34
|
+
))}
|
|
35
|
+
</Flex>
|
|
36
|
+
</>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
@@ -5,7 +5,24 @@ import WithOverlay from './examples/SidePanelWithOverlay';
|
|
|
5
5
|
|
|
6
6
|
# Canvas Kit Examples
|
|
7
7
|
|
|
8
|
-
## Side Panel
|
|
8
|
+
## Side Panel As Navigation
|
|
9
|
+
|
|
10
|
+
This example demonstrates SidePanel as a navigation system that can be reduced into a "compact view"
|
|
11
|
+
to save horizontal space on screen. It combines semantic HTML nested list markup with Canvas Kit's
|
|
12
|
+
`<Expandable>` component to create an accordion. When in compact view, the Canvas Kit `<Menu>`
|
|
13
|
+
component is used to create the fly-out menus. Both of these components are implemented according to
|
|
14
|
+
the [W3C ARIA Authoring Practices Guide](https://www.w3.org/WAI/ARIA/apg/patterns/) to provide a
|
|
15
|
+
wide range of support for accessibility.
|
|
16
|
+
|
|
17
|
+
- The `<SidePanel>` uses the `as` prop to render with a semantic HTML `<nav>` element
|
|
18
|
+
- The SidePanel's heading element with the `labelProps` must remain in the DOM even while the
|
|
19
|
+
component is in compact view, else the `aria-labelledby` reference for the toggle button will
|
|
20
|
+
become invalid. The `hidden` attribute is conditionally set on the heading based on the `expanded`
|
|
21
|
+
state of the SidePanel provided by the `useSidePanel` hook.
|
|
22
|
+
- The semantic HTML nested list markup helps support non-visual screen reader users understand the
|
|
23
|
+
nested hierarchy of the elements inside the expandable containers
|
|
24
|
+
- In the compact view, the `<Tooltip>` component is used to provide an accessible name to the icon
|
|
25
|
+
button menu targets
|
|
9
26
|
|
|
10
27
|
<ExampleCodeBlock code={WithNavigation} />
|
|
11
28
|
|
|
@@ -1,130 +1,168 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {Expandable} from '@workday/canvas-kit-labs-react/expandable';
|
|
2
|
+
import {base, system} from '@workday/canvas-tokens-web';
|
|
3
|
+
import {SidePanel, useSidePanel} from '@workday/canvas-kit-preview-react/side-panel';
|
|
4
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {Heading, Subtext, Text} from '@workday/canvas-kit-react/text';
|
|
6
|
+
import {Expandable} from '@workday/canvas-kit-react/expandable';
|
|
8
7
|
import {SystemIcon} from '@workday/canvas-kit-react/icon';
|
|
9
|
-
import {
|
|
8
|
+
import {Hyperlink, TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
9
|
+
import {Menu} from '@workday/canvas-kit-react/menu';
|
|
10
|
+
import {birthdayIcon, checkIcon, ribbonIcon} from '@workday/canvas-system-icons-web';
|
|
11
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
12
|
+
import {Tooltip} from '../../../../tooltip';
|
|
10
13
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
borderRadius: 0,
|
|
18
|
-
':hover': {
|
|
19
|
-
backgroundColor: colors.soap500,
|
|
14
|
+
const data = {
|
|
15
|
+
bestsellers: {
|
|
16
|
+
icon: ribbonIcon,
|
|
17
|
+
title: 'Best Sellers',
|
|
18
|
+
subtitle: 'Award winning sweet treats',
|
|
19
|
+
items: ['Mango Coco Sago', 'Matcha Creme Pie', 'Key Lime Cheesecake', 'Tiramisu'],
|
|
20
20
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
backgroundColor: colors.soap500,
|
|
21
|
+
cakes: {
|
|
22
|
+
icon: birthdayIcon,
|
|
23
|
+
title: 'Custom Cakes',
|
|
24
|
+
subtitle: 'To celebrate your life milestones',
|
|
25
|
+
items: ['Anniversary', 'Birthday', 'Graduation', 'Wedding'],
|
|
27
26
|
},
|
|
28
|
-
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const stylesOverride = {
|
|
30
|
+
navContainer: createStyles({
|
|
31
|
+
height: px2rem(800),
|
|
32
|
+
positio: 'relative',
|
|
33
|
+
backgroundColor: base.frenchVanilla100,
|
|
34
|
+
}),
|
|
35
|
+
accordionContainer: createStyles({
|
|
36
|
+
flexDirection: 'column',
|
|
37
|
+
rowGap: system.space.zero,
|
|
38
|
+
paddingInlineStart: system.space.zero,
|
|
39
|
+
}),
|
|
40
|
+
accordionIcon: createStyles({
|
|
41
|
+
verticalAlign: 'middle',
|
|
42
|
+
padding: system.space.x1,
|
|
43
|
+
}),
|
|
44
|
+
accordionSubText: createStyles({
|
|
45
|
+
margin: system.space.zero,
|
|
46
|
+
}),
|
|
47
|
+
listContainer: createStyles({
|
|
48
|
+
listStyle: 'none',
|
|
49
|
+
padding: system.space.x4,
|
|
50
|
+
paddingTop: system.space.x16,
|
|
51
|
+
flexDirection: 'column',
|
|
52
|
+
}),
|
|
53
|
+
links: createStyles({
|
|
54
|
+
textDecoration: 'none',
|
|
55
|
+
padding: system.space.x4,
|
|
56
|
+
}),
|
|
57
|
+
linkCheck: createStyles({
|
|
58
|
+
marginLeft: 'auto',
|
|
59
|
+
}),
|
|
60
|
+
flyOut: createStyles({
|
|
61
|
+
marginTop: '8rem',
|
|
62
|
+
}),
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const Accordion = ({config}) => {
|
|
66
|
+
const [currentPage, setCurrentPage] = React.useState('');
|
|
29
67
|
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
{value: 'Wedding', linkValue: 'WeddingCakes'},
|
|
35
|
-
];
|
|
68
|
+
const handleClick = e => {
|
|
69
|
+
e.preventDefault();
|
|
70
|
+
setCurrentPage(e.target.textContent);
|
|
71
|
+
};
|
|
36
72
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
73
|
+
return (
|
|
74
|
+
<Expandable>
|
|
75
|
+
<Expandable.Target>
|
|
76
|
+
<SystemIcon cs={stylesOverride.accordionIcon} icon={config.icon} />
|
|
77
|
+
<Expandable.Title>
|
|
78
|
+
{config.title}
|
|
79
|
+
<Subtext size="medium" cs={stylesOverride.accordionSubText}>
|
|
80
|
+
{config.subtitle}
|
|
81
|
+
</Subtext>
|
|
82
|
+
</Expandable.Title>
|
|
83
|
+
<Expandable.Icon iconPosition="end" />
|
|
84
|
+
</Expandable.Target>
|
|
85
|
+
<Expandable.Content as="ul" cs={stylesOverride.listContainer}>
|
|
86
|
+
{config.items.map(i => {
|
|
87
|
+
return (
|
|
88
|
+
<li key={i}>
|
|
89
|
+
<Flex
|
|
90
|
+
as="a"
|
|
91
|
+
href="#"
|
|
92
|
+
aria-current={i === currentPage ? 'true' : undefined}
|
|
93
|
+
className={stylesOverride.links}
|
|
94
|
+
onClick={handleClick}
|
|
95
|
+
>
|
|
96
|
+
{i}
|
|
97
|
+
{i === currentPage && <SystemIcon icon={checkIcon} cs={stylesOverride.linkCheck} />}
|
|
98
|
+
</Flex>
|
|
99
|
+
</li>
|
|
100
|
+
);
|
|
101
|
+
})}
|
|
102
|
+
</Expandable.Content>
|
|
103
|
+
</Expandable>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
43
106
|
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
107
|
+
const IconButtonMenu = ({config}) => {
|
|
108
|
+
return (
|
|
109
|
+
<Menu>
|
|
110
|
+
<Tooltip title={config.title} placement="right">
|
|
111
|
+
<Menu.Target as={TertiaryButton}>
|
|
112
|
+
<SystemIcon icon={config.icon} />
|
|
113
|
+
</Menu.Target>
|
|
114
|
+
</Tooltip>
|
|
115
|
+
<Menu.Popper placement="right">
|
|
116
|
+
<Menu.Card cs={stylesOverride.flyOut}>
|
|
117
|
+
<Menu.List>
|
|
118
|
+
{config.items.map(i => (
|
|
119
|
+
<Menu.Item>{i}</Menu.Item>
|
|
120
|
+
))}
|
|
121
|
+
</Menu.List>
|
|
122
|
+
</Menu.Card>
|
|
123
|
+
</Menu.Popper>
|
|
124
|
+
</Menu>
|
|
125
|
+
);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const CompactView = () => {
|
|
129
|
+
return (
|
|
130
|
+
<Flex as="ul" cs={stylesOverride.listContainer}>
|
|
131
|
+
<Flex.Item as="li">
|
|
132
|
+
<IconButtonMenu config={data.bestsellers} />
|
|
133
|
+
</Flex.Item>
|
|
134
|
+
<Flex.Item as="li">
|
|
135
|
+
<IconButtonMenu config={data.cakes} />
|
|
136
|
+
</Flex.Item>
|
|
137
|
+
</Flex>
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const ExpandedView = () => {
|
|
142
|
+
return (
|
|
143
|
+
<Flex as="ul" cs={stylesOverride.accordionContainer}>
|
|
144
|
+
<Flex.Item as="li">
|
|
145
|
+
<Accordion config={data.bestsellers} />
|
|
146
|
+
</Flex.Item>
|
|
147
|
+
<Flex.Item as="li">
|
|
148
|
+
<Accordion config={data.cakes} />
|
|
149
|
+
</Flex.Item>
|
|
150
|
+
</Flex>
|
|
151
|
+
);
|
|
152
|
+
};
|
|
50
153
|
|
|
51
154
|
export default () => {
|
|
155
|
+
const {expanded, panelProps, labelProps, controlProps} = useSidePanel();
|
|
156
|
+
|
|
52
157
|
return (
|
|
53
|
-
<Flex
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<BodyText size="small" fontWeight="bold" color="blackpepper300" marginY="zero">
|
|
62
|
-
Bestsellers
|
|
63
|
-
</BodyText>
|
|
64
|
-
<Subtext size="medium" color="blackpepper300" marginY="zero">
|
|
65
|
-
Award winning sweet treats
|
|
66
|
-
</Subtext>
|
|
67
|
-
</Expandable.Title>
|
|
68
|
-
<Expandable.Icon iconPosition="end" />
|
|
69
|
-
</StyledExpandable>
|
|
70
|
-
<Expandable.Content paddingY="zero" paddingX="zero" as="ul">
|
|
71
|
-
{bestsellers.map(item => {
|
|
72
|
-
return (
|
|
73
|
-
<li>
|
|
74
|
-
<StyledLink
|
|
75
|
-
size="large"
|
|
76
|
-
display="flex"
|
|
77
|
-
textDecoration="none"
|
|
78
|
-
paddingLeft="xxl"
|
|
79
|
-
paddingTop="xxs"
|
|
80
|
-
paddingBottom="zero"
|
|
81
|
-
href={item.linkValue}
|
|
82
|
-
>
|
|
83
|
-
{item.value}
|
|
84
|
-
</StyledLink>
|
|
85
|
-
</li>
|
|
86
|
-
);
|
|
87
|
-
})}
|
|
88
|
-
</Expandable.Content>
|
|
89
|
-
</Expandable>
|
|
90
|
-
</Flex.Item>
|
|
91
|
-
<Flex.Item as="li" listStyle="none">
|
|
92
|
-
<Expandable padding="zero">
|
|
93
|
-
<StyledExpandable paddingTop="m" paddingBottom="xxs" paddingX="m" textAlign="center">
|
|
94
|
-
<SystemIcon icon={birthdayIcon} paddingRight="s" />
|
|
95
|
-
<Expandable.Title padding="zero">
|
|
96
|
-
<BodyText size="small" fontWeight="bold" color="blackpepper300" marginY="zero">
|
|
97
|
-
Custom Cakes
|
|
98
|
-
</BodyText>
|
|
99
|
-
<Subtext size="medium" color="blackpepper300" marginY="zero">
|
|
100
|
-
To celebrate your life milestones
|
|
101
|
-
</Subtext>
|
|
102
|
-
</Expandable.Title>
|
|
103
|
-
<Expandable.Icon iconPosition="end" />
|
|
104
|
-
</StyledExpandable>
|
|
105
|
-
<Expandable.Content paddingY="zero" paddingX="zero" as="ul">
|
|
106
|
-
{cakes.map(item => {
|
|
107
|
-
return (
|
|
108
|
-
<li>
|
|
109
|
-
<StyledLink
|
|
110
|
-
size="large"
|
|
111
|
-
display="flex"
|
|
112
|
-
textDecoration="none"
|
|
113
|
-
paddingLeft="xxl"
|
|
114
|
-
paddingTop="xxs"
|
|
115
|
-
paddingBottom="zero"
|
|
116
|
-
href={item.linkValue}
|
|
117
|
-
>
|
|
118
|
-
{item.value}
|
|
119
|
-
</StyledLink>
|
|
120
|
-
</li>
|
|
121
|
-
);
|
|
122
|
-
})}
|
|
123
|
-
</Expandable.Content>
|
|
124
|
-
</Expandable>
|
|
125
|
-
</Flex.Item>
|
|
126
|
-
</Flex>
|
|
127
|
-
</StyledPanel>
|
|
158
|
+
<Flex cs={stylesOverride.navContainer}>
|
|
159
|
+
<SidePanel as="nav" {...panelProps}>
|
|
160
|
+
<Heading size="small" {...labelProps} hidden={!expanded ? true : undefined}>
|
|
161
|
+
Cake or Death Bakery
|
|
162
|
+
</Heading>
|
|
163
|
+
<SidePanel.ToggleButton {...controlProps} />
|
|
164
|
+
{expanded ? <ExpandedView /> : <CompactView />}
|
|
165
|
+
</SidePanel>
|
|
128
166
|
</Flex>
|
|
129
167
|
);
|
|
130
168
|
};
|
|
@@ -1,28 +1,46 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {styled} from '@workday/canvas-kit-react/common';
|
|
3
|
-
import {depth} from '@workday/canvas-kit-react/tokens';
|
|
4
2
|
import {SidePanel, useSidePanel} from '@workday/canvas-kit-preview-react/side-panel';
|
|
5
3
|
import {Flex, Box} from '@workday/canvas-kit-react/layout';
|
|
6
|
-
import {
|
|
4
|
+
import {Heading} from '@workday/canvas-kit-react/text';
|
|
5
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
6
|
+
import {system, base} from '@workday/canvas-tokens-web';
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const stylesOverride = {
|
|
9
|
+
panelContainer: createStyles({
|
|
10
|
+
height: px2rem(320),
|
|
11
|
+
backgroundColor: base.soap100,
|
|
12
|
+
position: 'relative',
|
|
13
|
+
}),
|
|
14
|
+
panelContent: createStyles({
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
paddingY: system.space.x4,
|
|
17
|
+
paddingX: system.space.x4,
|
|
18
|
+
}),
|
|
19
|
+
panel: createStyles({
|
|
20
|
+
zIndex: 1,
|
|
21
|
+
}),
|
|
22
|
+
overlay: createStyles({
|
|
23
|
+
position: 'absolute',
|
|
24
|
+
background: system.color.bg.overlay,
|
|
25
|
+
height: '100%',
|
|
26
|
+
width: '100%',
|
|
27
|
+
}),
|
|
28
|
+
};
|
|
12
29
|
|
|
13
30
|
export default () => {
|
|
14
|
-
const {labelProps} = useSidePanel();
|
|
31
|
+
const {expanded, panelProps, labelProps, controlProps} = useSidePanel();
|
|
15
32
|
|
|
16
33
|
return (
|
|
17
|
-
<Flex
|
|
18
|
-
<
|
|
19
|
-
<Flex
|
|
20
|
-
<
|
|
34
|
+
<Flex cs={stylesOverride.panelContainer}>
|
|
35
|
+
<SidePanel className={stylesOverride.panel} {...panelProps} variant="alternate">
|
|
36
|
+
<Flex cs={stylesOverride.panelContainer}>
|
|
37
|
+
<Heading size="small" {...labelProps} hidden={!expanded ? true : undefined}>
|
|
21
38
|
Alternate Panel
|
|
22
|
-
</
|
|
39
|
+
</Heading>
|
|
40
|
+
<SidePanel.ToggleButton {...controlProps} />
|
|
23
41
|
</Flex>
|
|
24
|
-
</
|
|
25
|
-
<Box
|
|
42
|
+
</SidePanel>
|
|
43
|
+
{expanded && <Box cs={stylesOverride.overlay} />}
|
|
26
44
|
</Flex>
|
|
27
45
|
);
|
|
28
46
|
};
|
|
@@ -45,7 +45,7 @@ const SelectableRow = createComponent('tr')({
|
|
|
45
45
|
<Checkbox checked={rowData.checked} onChange={onSelect} />
|
|
46
46
|
</Tooltip>
|
|
47
47
|
</Table.Cell>
|
|
48
|
-
<Table.Cell cs={tableCellStyles} scope="row">
|
|
48
|
+
<Table.Cell as="th" cs={tableCellStyles} scope="row">
|
|
49
49
|
{rowData.name}
|
|
50
50
|
</Table.Cell>
|
|
51
51
|
<Table.Cell cs={tableCellStyles}>{rowData.amount}</Table.Cell>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
3
2
|
import {createStyles} from '@workday/canvas-kit-styling';
|
|
4
3
|
import {system} from '@workday/canvas-tokens-web';
|
|
@@ -12,7 +11,7 @@ const containerStyles = createStyles({
|
|
|
12
11
|
|
|
13
12
|
export default () => (
|
|
14
13
|
<div className={containerStyles}>
|
|
15
|
-
<Avatar onClick={handleAvatarButtonClick} />
|
|
16
|
-
<Avatar as="div" />
|
|
14
|
+
<Avatar altText="Avatar" onClick={handleAvatarButtonClick} />
|
|
15
|
+
<Avatar altText="Avatar" as="div" />
|
|
17
16
|
</div>
|
|
18
17
|
);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
3
2
|
import {createStyles} from '@workday/canvas-kit-styling';
|
|
4
3
|
import {system} from '@workday/canvas-tokens-web';
|
|
@@ -14,8 +13,8 @@ const containerStyles = createStyles({
|
|
|
14
13
|
|
|
15
14
|
export default () => (
|
|
16
15
|
<div className={containerStyles}>
|
|
17
|
-
<Avatar variant="dark" onClick={handleAvatarButtonClick} />
|
|
18
|
-
<Avatar onClick={handleAvatarButtonClick} />
|
|
19
|
-
<Avatar url={testAvatar} onClick={handleAvatarButtonClick} />
|
|
16
|
+
<Avatar altText="Avatar" variant="dark" onClick={handleAvatarButtonClick} />
|
|
17
|
+
<Avatar altText="Avatar" onClick={handleAvatarButtonClick} />
|
|
18
|
+
<Avatar altText="Avatar" url={testAvatar} onClick={handleAvatarButtonClick} />
|
|
20
19
|
</div>
|
|
21
20
|
);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
3
2
|
import {createStencil, createStyles} from '@workday/canvas-kit-styling';
|
|
4
3
|
import {base, system} from '@workday/canvas-tokens-web';
|
|
@@ -29,7 +28,7 @@ const containerStyles = createStyles({
|
|
|
29
28
|
|
|
30
29
|
export default () => (
|
|
31
30
|
<div className={containerStyles}>
|
|
32
|
-
<Avatar as="div" {...customBlueAvatarStencil()} />
|
|
33
|
-
<Avatar as="div" {...customGreenAvatarStencil()} />
|
|
31
|
+
<Avatar altText="Avatar" as="div" {...customBlueAvatarStencil()} />
|
|
32
|
+
<Avatar altText="Avatar" as="div" {...customGreenAvatarStencil()} />
|
|
34
33
|
</div>
|
|
35
34
|
);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
3
2
|
// @ts-ignore: Cannot find module error
|
|
4
3
|
import testAvatar from './test-avatar.png';
|
|
@@ -14,13 +13,13 @@ const containerStyles = createStyles({
|
|
|
14
13
|
export default () => (
|
|
15
14
|
<div className={containerStyles}>
|
|
16
15
|
<h3>Working Images</h3>
|
|
17
|
-
<Avatar size="extraExtraLarge" as="div" url={testAvatar} />
|
|
18
|
-
<Avatar size="extraLarge" as="div" url={testAvatar} />
|
|
19
|
-
<Avatar size="large" as="div" url={testAvatar} />
|
|
20
|
-
<Avatar size="medium" as="div" url={testAvatar} />
|
|
21
|
-
<Avatar size="small" as="div" url={testAvatar} />
|
|
22
|
-
<Avatar size="extraSmall" as="div" url={testAvatar} />
|
|
16
|
+
<Avatar altText="Avatar" size="extraExtraLarge" as="div" url={testAvatar} />
|
|
17
|
+
<Avatar altText="Avatar" size="extraLarge" as="div" url={testAvatar} />
|
|
18
|
+
<Avatar altText="Avatar" size="large" as="div" url={testAvatar} />
|
|
19
|
+
<Avatar altText="Avatar" size="medium" as="div" url={testAvatar} />
|
|
20
|
+
<Avatar altText="Avatar" size="small" as="div" url={testAvatar} />
|
|
21
|
+
<Avatar altText="Avatar" size="extraSmall" as="div" url={testAvatar} />
|
|
23
22
|
<h3>Broken Image</h3>
|
|
24
|
-
<Avatar url="/fake/path/to/image.png" as="div" />
|
|
23
|
+
<Avatar altText="Avatar" url="/fake/path/to/image.png" as="div" />
|
|
25
24
|
</div>
|
|
26
25
|
);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
3
2
|
// @ts-ignore: Cannot find module error
|
|
4
3
|
import testAvatar from './test-avatar.png';
|
|
@@ -7,7 +6,13 @@ export default () => (
|
|
|
7
6
|
<div className="story">
|
|
8
7
|
{Array.from({length: 5}, (v, index) => (
|
|
9
8
|
<>
|
|
10
|
-
<Avatar
|
|
9
|
+
<Avatar
|
|
10
|
+
altText="Avatar"
|
|
11
|
+
key={index}
|
|
12
|
+
as="div"
|
|
13
|
+
size="medium"
|
|
14
|
+
url={testAvatar + '?v=' + index}
|
|
15
|
+
/>
|
|
11
16
|
<br />
|
|
12
17
|
</>
|
|
13
18
|
))}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
3
2
|
import {px2rem} from '@workday/canvas-kit-styling';
|
|
4
3
|
|
|
@@ -7,9 +6,10 @@ export default () => (
|
|
|
7
6
|
<h3>Original Rectangle Image</h3>
|
|
8
7
|
<img alt="" src="https://picsum.photos/id/237/300/200" />
|
|
9
8
|
<h3>Object fit on a Rectangle Image</h3>
|
|
10
|
-
<Avatar as="div" url="https://picsum.photos/id/237/300/200" />
|
|
9
|
+
<Avatar altText="Avatar" as="div" url="https://picsum.photos/id/237/300/200" />
|
|
11
10
|
<h3>Object fit on a Rectangle Image using Dynamic Size</h3>
|
|
12
11
|
<Avatar
|
|
12
|
+
altText="Avatar"
|
|
13
13
|
as="div"
|
|
14
14
|
size={px2rem(200)}
|
|
15
15
|
url="https://picsum.photos/id/237/300/200"
|
|
@@ -18,8 +18,13 @@ export default () => (
|
|
|
18
18
|
<h3>Original Square Image</h3>
|
|
19
19
|
<img alt="" src="https://picsum.photos/id/237/300/300" />
|
|
20
20
|
<h3>Object fit on a Square Image</h3>
|
|
21
|
-
<Avatar as="div" url="https://picsum.photos/id/237/300/300" />
|
|
21
|
+
<Avatar altText="Avatar" as="div" url="https://picsum.photos/id/237/300/300" />
|
|
22
22
|
<h3>Object fit on a Square Image using Dynamic Size</h3>
|
|
23
|
-
<Avatar
|
|
23
|
+
<Avatar
|
|
24
|
+
altText="Avatar"
|
|
25
|
+
as="div"
|
|
26
|
+
size={px2rem(200)}
|
|
27
|
+
url="https://picsum.photos/id/237/300/300"
|
|
28
|
+
/>
|
|
24
29
|
</div>
|
|
25
30
|
);
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
3
2
|
import {px2rem} from '@workday/canvas-kit-styling';
|
|
4
3
|
|
|
5
4
|
export default () => (
|
|
6
5
|
<div className="story">
|
|
7
6
|
<h3>Extra-Extra Large</h3>
|
|
8
|
-
<Avatar as="div" size="extraExtraLarge" />
|
|
7
|
+
<Avatar altText="Avatar" as="div" size="extraExtraLarge" />
|
|
9
8
|
<h3>Extra Large</h3>
|
|
10
|
-
<Avatar as="div" size="extraLarge" />
|
|
9
|
+
<Avatar altText="Avatar" as="div" size="extraLarge" />
|
|
11
10
|
<h3>Large</h3>
|
|
12
|
-
<Avatar as="div" size="large" />
|
|
11
|
+
<Avatar altText="Avatar" as="div" size="large" />
|
|
13
12
|
<h3>Medium</h3>
|
|
14
|
-
<Avatar as="div" size="medium" />
|
|
13
|
+
<Avatar altText="Avatar" as="div" size="medium" />
|
|
15
14
|
<h3>Small</h3>
|
|
16
|
-
<Avatar as="div" size="small" />
|
|
15
|
+
<Avatar altText="Avatar" as="div" size="small" />
|
|
17
16
|
<h3>Extra Small</h3>
|
|
18
|
-
<Avatar as="div" size="extraSmall" />
|
|
17
|
+
<Avatar altText="Avatar" as="div" size="extraSmall" />
|
|
19
18
|
<h3>30px</h3>
|
|
20
|
-
<Avatar as="div" size={px2rem(30)} />
|
|
19
|
+
<Avatar altText="Avatar" as="div" size={px2rem(30)} />
|
|
21
20
|
<h3>40px</h3>
|
|
22
|
-
<Avatar as="div" size={px2rem(40)} />
|
|
21
|
+
<Avatar altText="Avatar" as="div" size={px2rem(40)} />
|
|
23
22
|
<h3>3rem</h3>
|
|
24
|
-
<Avatar as="div" size="3rem" />
|
|
23
|
+
<Avatar altText="Avatar" as="div" size="3rem" />
|
|
25
24
|
<h3>4rem</h3>
|
|
26
|
-
<Avatar as="div" size="4rem" />
|
|
25
|
+
<Avatar altText="Avatar" as="div" size="4rem" />
|
|
27
26
|
</div>
|
|
28
27
|
);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
3
2
|
|
|
4
3
|
export default () => (
|
|
5
4
|
<div className="story">
|
|
6
5
|
<h3>Light</h3>
|
|
7
|
-
<Avatar as="div" size="medium" />
|
|
6
|
+
<Avatar altText="Avatar" as="div" size="medium" />
|
|
8
7
|
<h3>Dark</h3>
|
|
9
|
-
<Avatar as="div" size="medium" variant="dark" />
|
|
8
|
+
<Avatar altText="Avatar" as="div" size="medium" variant="dark" />
|
|
10
9
|
</div>
|
|
11
10
|
);
|