@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleCodeBlock.d.ts","sourceRoot":"","sources":["../../../lib/ExampleCodeBlock.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExampleCodeBlock.d.ts","sourceRoot":"","sources":["../../../lib/ExampleCodeBlock.tsx"],"names":[],"mappings":"AAiEA,eAAO,MAAM,gBAAgB,aAAY,GAAG,4CA0G3C,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
|
|
3
4
|
import { TertiaryButton } from '@workday/canvas-kit-react/button';
|
|
@@ -6,7 +7,17 @@ import { calc, createStencil, cssVar, px2rem } from '@workday/canvas-kit-styling
|
|
|
6
7
|
import { system } from '@workday/canvas-tokens-web';
|
|
7
8
|
import { vscDarkPlus } from 'react-syntax-highlighter/dist/cjs/styles/prism';
|
|
8
9
|
import { checkCircleIcon, copyIcon } from '@workday/canvas-system-icons-web';
|
|
9
|
-
import { Tooltip } from '@workday/canvas-kit-react';
|
|
10
|
+
import { Tooltip } from '@workday/canvas-kit-react/tooltip';
|
|
11
|
+
import sdk from '@stackblitz/sdk';
|
|
12
|
+
import tsconfigFile from '!!raw-loader!./stackblitzFiles/tsconfig.json';
|
|
13
|
+
import { packageJSONFile } from './stackblitzFiles/packageJSONFile';
|
|
14
|
+
import indexHTMLFile from '!!raw-loader!./stackblitzFiles/index.html';
|
|
15
|
+
import mainFile from '!!raw-loader!./stackblitzFiles/main.tsx';
|
|
16
|
+
import viteConfigFile from '!!raw-loader!./stackblitzFiles/vite.config.ts';
|
|
17
|
+
import eslintrc from '!!raw-loader!./stackblitzFiles/.eslintrc.cjs.txt';
|
|
18
|
+
import tsconfigNodeFile from '!!raw-loader!./stackblitzFiles/tsconfig.node.json';
|
|
19
|
+
import appFile from '!!raw-loader!./stackblitzFiles/App.tsx';
|
|
20
|
+
import viteEnvFile from '!!raw-loader!./stackblitzFiles/vite-env.d.ts';
|
|
10
21
|
const cardStencil = createStencil({
|
|
11
22
|
base: {
|
|
12
23
|
'[data-part="example-block"]': {
|
|
@@ -19,10 +30,12 @@ const cardStencil = createStencil({
|
|
|
19
30
|
boxShadow: system.depth[1],
|
|
20
31
|
borderRadius: system.shape.x1,
|
|
21
32
|
},
|
|
22
|
-
'[data-part="code-toggle-btn"]': {
|
|
33
|
+
'[data-part="code-toggle-stackblitz-btn-container"]': {
|
|
23
34
|
position: 'absolute',
|
|
24
35
|
right: calc.negate(px2rem(1)),
|
|
25
36
|
bottom: calc.negate(px2rem(1)),
|
|
37
|
+
display: 'flex',
|
|
38
|
+
gap: system.space.x2,
|
|
26
39
|
},
|
|
27
40
|
'[data-part="copy-btn"]': {
|
|
28
41
|
position: 'absolute',
|
|
@@ -64,30 +77,42 @@ export const ExampleCodeBlock = ({ code }) => {
|
|
|
64
77
|
// @ts-ignore
|
|
65
78
|
navigator.clipboard.writeText(textInput.current.textContent);
|
|
66
79
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
80
|
+
/**
|
|
81
|
+
* `code` returns our examples. We need to rewrite them so that they export `Demo`.
|
|
82
|
+
*/
|
|
83
|
+
const handleExampleRewrite = (code) => {
|
|
84
|
+
return code
|
|
85
|
+
.replace(/\bexport\s+const\s+(\w+)\s*=/, `export const Demo =`)
|
|
86
|
+
.replace(/export default/, 'export const Demo =');
|
|
87
|
+
};
|
|
88
|
+
const openProjectInStackblitz = () => {
|
|
89
|
+
sdk.openProject({
|
|
90
|
+
files: {
|
|
91
|
+
'src/Demo.tsx': handleExampleRewrite(code.__RAW__),
|
|
92
|
+
'src/vite-env-d.ts': viteEnvFile,
|
|
93
|
+
'src/App.tsx': appFile,
|
|
94
|
+
'tsconfig.node.json': tsconfigNodeFile,
|
|
95
|
+
'.eslintrc.js': eslintrc,
|
|
96
|
+
'vite.config.ts': viteConfigFile,
|
|
97
|
+
'src/main.tsx': mainFile,
|
|
98
|
+
'index.html': indexHTMLFile,
|
|
99
|
+
'tsconfig.json': tsconfigFile,
|
|
100
|
+
'package.json': packageJSONFile,
|
|
101
|
+
},
|
|
102
|
+
template: 'node',
|
|
103
|
+
title: `Demo`,
|
|
104
|
+
description: `This is a Canvas Kit Demo. Edit and play around!`,
|
|
105
|
+
},
|
|
106
|
+
// Options
|
|
107
|
+
{
|
|
108
|
+
newWindow: true,
|
|
109
|
+
openFile: 'src/Demo.tsx',
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
return (_jsxs("div", { ...cardStencil({ opened: isCodeDisplayed }), children: [_jsx(Card, { "data-part": "example-block", className: "sb-unstyled", children: _jsxs(Card.Body, { children: [React.createElement(code), code && (_jsxs("div", { "data-part": "code-toggle-stackblitz-btn-container", children: [_jsx(TertiaryButton, { size: "extraSmall", onClick: () => openProjectInStackblitz(), children: "\u26A1\uFE0F Edit in Stackblitz" }), _jsx(TertiaryButton, { size: "extraSmall", onClick: () => setCodeDisplayed(!isCodeDisplayed), children: !isCodeDisplayed ? 'Show Code' : 'Hide Code' })] }))] }) }), _jsx(Card, { "data-part": "code-block", padding: 0, children: _jsxs(Card.Body, { cs: { position: 'relative' }, children: [code && (_jsx("div", { ref: textInput, children: _jsx(SyntaxHighlighter, { className: "sb-unstyled", language: "jsx", style: vscDarkPlus, customStyle: {
|
|
113
|
+
fontSize: cssVar(system.fontSize.subtext.large),
|
|
114
|
+
lineHeight: cssVar(system.lineHeight.subtext.large),
|
|
115
|
+
margin: '0',
|
|
116
|
+
padding: `${cssVar(system.space.x8)} ${cssVar(system.space.x10)}`,
|
|
117
|
+
}, children: code.__RAW__ }) })), _jsx(Tooltip, { title: copied ? 'Copied!' : 'Copy Source Code', children: _jsx(TertiaryButton, { "aria-label": "Copy Code", size: "large", "data-part": "copy-btn", variant: "inverse", iconPosition: "end", icon: copied ? checkCircleIcon : copyIcon, onClick: onCopy }) })] }) })] }));
|
|
93
118
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
/**
|
|
3
2
|
* Special component that taps into @mdx-js/react components that are used by both Storybook and the
|
|
4
3
|
* Canvas Site. This means our docs can use the same components used in our MDX files without
|
|
@@ -10,5 +9,5 @@ export declare const MDX: import("@workday/canvas-kit-react").ElementComponent<"
|
|
|
10
9
|
*/
|
|
11
10
|
export declare const MdxJSToJSX: (props: {
|
|
12
11
|
children: string;
|
|
13
|
-
}) =>
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
//# sourceMappingURL=MDXElements.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MDXElements.d.ts","sourceRoot":"","sources":["../../../lib/MDXElements.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MDXElements.d.ts","sourceRoot":"","sources":["../../../lib/MDXElements.tsx"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,eAAO,MAAM,GAAG,sEAMd,CAAC;AAwDH;;GAEG;AACH,eAAO,MAAM,UAAU,UAAW;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC,4CAQnD,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
//@ts-ignore
|
|
2
3
|
import { useMDXComponents } from '@mdx-js/react';
|
|
3
4
|
import React from 'react';
|
|
@@ -21,14 +22,13 @@ export const MDX = createComponent('div')({
|
|
|
21
22
|
*/
|
|
22
23
|
const Button = (props) => {
|
|
23
24
|
const components = useMDXComponents();
|
|
24
|
-
if (props['data-symbol'] !== undefined) {
|
|
25
|
-
return (
|
|
26
|
-
React.createElement(SymbolDialog, { value: {
|
|
25
|
+
if (props['data-symbol'] !== undefined && props.children) {
|
|
26
|
+
return (_jsx("code", { children: _jsx(SymbolDialog, { value: {
|
|
27
27
|
kind: 'symbol',
|
|
28
28
|
name: props.children[0],
|
|
29
29
|
displayName: props['data-symbol'],
|
|
30
30
|
value: props.children[0],
|
|
31
|
-
} })));
|
|
31
|
+
} }) }));
|
|
32
32
|
}
|
|
33
33
|
return React.createElement(components['button'] || 'button', props, props.children);
|
|
34
34
|
};
|
|
@@ -37,7 +37,7 @@ const Button = (props) => {
|
|
|
37
37
|
* processing. This allows us to convert {@link SymbolName Link Text} to a `<SymbolDialog>`!
|
|
38
38
|
*/
|
|
39
39
|
function convertLinkToSymbolLinks(input) {
|
|
40
|
-
return input.replace(/{@link ([a-z0-9.]+)( [a-z0-9.]+)?}/gi, (
|
|
40
|
+
return input.replace(/{@link ([a-z0-9.]+)( [a-z0-9.]+)?}/gi, (_substr, symbol, text = '') => `<button data-symbol="${text.trim()}" className="token symbol">${symbol}</button>`);
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Replace all heading levels in the JSDoc to start at the same heading level as `startingLevel`.
|
|
@@ -57,5 +57,5 @@ function rewriteHeadingLevels(input, startingLevel) {
|
|
|
57
57
|
export const MdxJSToJSX = (props) => {
|
|
58
58
|
const components = useMDXComponents();
|
|
59
59
|
const headingLevel = React.useContext(HeadingLevelContext);
|
|
60
|
-
return (
|
|
60
|
+
return (_jsx(MarkdownToJSX, { options: { overrides: { ...components, button: Button }, forceBlock: true }, children: rewriteHeadingLevels(convertLinkToSymbolLinks(props.children), headingLevel) }));
|
|
61
61
|
};
|
|
@@ -16,5 +16,5 @@ export interface MoreTooltipProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
16
16
|
*/
|
|
17
17
|
placement?: Placement;
|
|
18
18
|
}
|
|
19
|
-
export declare const MoreTooltip: ({ placement, children, title, ...elemProps }: MoreTooltipProps) =>
|
|
19
|
+
export declare const MoreTooltip: ({ placement, children, title, ...elemProps }: MoreTooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
//# sourceMappingURL=MoreTooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoreTooltip.d.ts","sourceRoot":"","sources":["../../../lib/MoreTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA4B,SAAS,EAAS,MAAM,iCAAiC,CAAC;AAS7F,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5E;;;;;;;OAOG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AA0BD,eAAO,MAAM,WAAW,iDAKrB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"MoreTooltip.d.ts","sourceRoot":"","sources":["../../../lib/MoreTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA4B,SAAS,EAAS,MAAM,iCAAiC,CAAC;AAS7F,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5E;;;;;;;OAOG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AA0BD,eAAO,MAAM,WAAW,iDAKrB,gBAAgB,4CAwClB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { getTransformFromPlacement, Popper } from '@workday/canvas-kit-react/popup';
|
|
3
4
|
import { mergeCallback } from '@workday/canvas-kit-react/common';
|
|
@@ -41,16 +42,14 @@ export const MoreTooltip = ({ placement = 'top', children, title, ...elemProps }
|
|
|
41
42
|
targetProps.onFocus(event);
|
|
42
43
|
}
|
|
43
44
|
};
|
|
44
|
-
return (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return (React.createElement(TooltipContainer, { transformOrigin: transformOrigin, ...tooltipProps, ...elemProps }, titleText));
|
|
55
|
-
})));
|
|
45
|
+
return (_jsxs(React.Fragment, { children: [React.cloneElement(children, {
|
|
46
|
+
...targetProps,
|
|
47
|
+
onMouseEnter,
|
|
48
|
+
onFocus,
|
|
49
|
+
'aria-label': undefined,
|
|
50
|
+
...mergeCallbacks({ ...targetProps, onMouseEnter, onFocus }, children.props),
|
|
51
|
+
}), _jsx(Popper, { placement: placement, ...popperProps, children: ({ placement }) => {
|
|
52
|
+
const transformOrigin = getTransformFromPlacement(placement);
|
|
53
|
+
return (_jsx(TooltipContainer, { transformOrigin: transformOrigin, ...tooltipProps, ...elemProps, children: titleText }));
|
|
54
|
+
} })] }));
|
|
56
55
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export interface SpecificationsProps {
|
|
3
2
|
file: string;
|
|
4
3
|
name?: string;
|
|
5
4
|
}
|
|
6
|
-
export declare const Specifications: ({ file, name }: SpecificationsProps) =>
|
|
5
|
+
export declare const Specifications: ({ file, name }: SpecificationsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
6
|
//# sourceMappingURL=Specifications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Specifications.d.ts","sourceRoot":"","sources":["../../../lib/Specifications.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Specifications.d.ts","sourceRoot":"","sources":["../../../lib/Specifications.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA8CD,eAAO,MAAM,cAAc,mBAAkB,mBAAmB,mDAqF/D,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
/* eslint-disable no-param-reassign */
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { toId } from '@storybook/csf';
|
|
@@ -56,25 +57,7 @@ export const Specifications = ({ file, name }) => {
|
|
|
56
57
|
return input;
|
|
57
58
|
}
|
|
58
59
|
const [, first, kind, name, last] = matches;
|
|
59
|
-
return (
|
|
60
|
-
first.replace(/given /i, ''),
|
|
61
|
-
React.createElement(Hyperlink, { href: `${storybookBaseUrl}?path=/story/${toId(kind, name.replace('DefaultStory', 'Default Story'))}` }, name.replace('DefaultStory', 'Default')),
|
|
62
|
-
last));
|
|
60
|
+
return (_jsxs(_Fragment, { children: [first.replace(/given /i, ''), _jsx(Hyperlink, { href: `${storybookBaseUrl}?path=/story/${toId(kind, name.replace('DefaultStory', 'Default Story'))}`, children: name.replace('DefaultStory', 'Default') }), last] }));
|
|
63
61
|
};
|
|
64
|
-
return block.type === 'describe' ? (
|
|
65
|
-
React.createElement(Table, null,
|
|
66
|
-
React.createElement(Table.Head, null,
|
|
67
|
-
React.createElement(Table.Row, null,
|
|
68
|
-
React.createElement(Table.Header, null, "Given"),
|
|
69
|
-
React.createElement(Table.Header, null, "When"),
|
|
70
|
-
React.createElement(Table.Header, null, "Then"))),
|
|
71
|
-
React.createElement(Table.Body, null, block.children.reduce(createTableRows, []).map((row, index) => (React.createElement(Table.Row, { key: index },
|
|
72
|
-
React.createElement(Table.Cell, null, renderGiven(row.given[0])),
|
|
73
|
-
React.createElement(Table.Cell, null,
|
|
74
|
-
React.createElement("ul", null, row.when.map((item, index) => (React.createElement("li", { key: index }, (index !== 0 ? 'AND THEN ' : '') + item.replace(/[tw]hen /i, '')))))),
|
|
75
|
-
React.createElement(Table.Cell, null,
|
|
76
|
-
React.createElement("ul", null, row.then.map((item, index) => (React.createElement("li", { key: index }, (item.indexOf('should') === 0 ? 'it ' : '') + item)))))))))),
|
|
77
|
-
"Source:",
|
|
78
|
-
' ',
|
|
79
|
-
React.createElement(Hyperlink, { href: `${githubUrl}blob/${githubBranch}/cypress/integration/${file}` }, file))) : null;
|
|
62
|
+
return block.type === 'describe' ? (_jsxs(_Fragment, { children: [_jsxs(Table, { children: [_jsx(Table.Head, { children: _jsxs(Table.Row, { children: [_jsx(Table.Header, { children: "Given" }), _jsx(Table.Header, { children: "When" }), _jsx(Table.Header, { children: "Then" })] }) }), _jsx(Table.Body, { children: block.children.reduce(createTableRows, []).map((row, index) => (_jsxs(Table.Row, { children: [_jsx(Table.Cell, { children: renderGiven(row.given[0]) }), _jsx(Table.Cell, { children: _jsx("ul", { children: row.when.map((item, index) => (_jsx("li", { children: (index !== 0 ? 'AND THEN ' : '') + item.replace(/[tw]hen /i, '') }, index))) }) }), _jsx(Table.Cell, { children: _jsx("ul", { children: row.then.map((item, index) => (_jsx("li", { children: (item.indexOf('should') === 0 ? 'it ' : '') + item }, index))) }) })] }, index))) })] }), "Source:", ' ', _jsx(Hyperlink, { href: `${githubUrl}blob/${githubBranch}/cypress/integration/${file}`, children: file })] })) : null;
|
|
80
63
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
type StyleProp = {
|
|
3
2
|
name: string;
|
|
4
3
|
properties: string[];
|
|
@@ -7,6 +6,6 @@ type StyleProp = {
|
|
|
7
6
|
interface StylePropsTableProps {
|
|
8
7
|
styleProps?: StyleProp[];
|
|
9
8
|
}
|
|
10
|
-
export declare const StylePropsTable: ({ styleProps }: StylePropsTableProps) =>
|
|
9
|
+
export declare const StylePropsTable: ({ styleProps }: StylePropsTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
export {};
|
|
12
11
|
//# sourceMappingURL=StylePropsTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StylePropsTable.d.ts","sourceRoot":"","sources":["../../../lib/StylePropsTable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StylePropsTable.d.ts","sourceRoot":"","sources":["../../../lib/StylePropsTable.tsx"],"names":[],"mappings":"AAIA,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,UAAU,oBAAoB;IAC5B,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;CAC1B;AAMD,eAAO,MAAM,eAAe,mBAAuB,oBAAoB,4CAoCtE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '@workday/canvas-kit-react/layout';
|
|
3
3
|
import { ExternalHyperlink } from '@workday/canvas-kit-react';
|
|
4
4
|
import { Table } from './Table';
|
|
@@ -7,19 +7,9 @@ const camelToKebabCase = (name) => {
|
|
|
7
7
|
};
|
|
8
8
|
export const StylePropsTable = ({ styleProps = [] }) => {
|
|
9
9
|
const sortedStyleProps = styleProps.sort((a, b) => a.name.localeCompare(b.name));
|
|
10
|
-
return (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
React.createElement(Table.Header, null, "System"))),
|
|
16
|
-
React.createElement(Table.Body, null, sortedStyleProps.map((styleProp, index) => (React.createElement(Table.Row, { key: index },
|
|
17
|
-
React.createElement(Table.Data, { fontFamily: "monospace" }, styleProp.name),
|
|
18
|
-
React.createElement(Table.Data, null, styleProp.properties.map((property, i) => {
|
|
19
|
-
const formattedName = camelToKebabCase(property);
|
|
20
|
-
const mdnUrl = `https://developer.mozilla.org/en-US/docs/Web/CSS/${formattedName}`;
|
|
21
|
-
return (React.createElement(Box, { display: "inline-block", marginInlineEnd: "xxxs" },
|
|
22
|
-
React.createElement(ExternalHyperlink, { href: mdnUrl, key: i }, formattedName)));
|
|
23
|
-
})),
|
|
24
|
-
React.createElement(Table.Data, { fontFamily: "monospace" }, styleProp.system === 'none' ? '---' : styleProp.system)))))));
|
|
10
|
+
return (_jsxs(Table, { children: [_jsx(Table.Head, { children: _jsxs(Table.Row, { children: [_jsx(Table.Header, { children: "Prop" }), _jsx(Table.Header, { children: "CSS Properties" }), _jsx(Table.Header, { children: "System" })] }) }), _jsx(Table.Body, { children: sortedStyleProps.map((styleProp, index) => (_jsxs(Table.Row, { children: [_jsx(Table.Data, { fontFamily: "monospace", children: styleProp.name }), _jsx(Table.Data, { children: styleProp.properties.map((property, i) => {
|
|
11
|
+
const formattedName = camelToKebabCase(property);
|
|
12
|
+
const mdnUrl = `https://developer.mozilla.org/en-US/docs/Web/CSS/${formattedName}`;
|
|
13
|
+
return (_jsx(Box, { display: "inline-block", marginInlineEnd: "xxxs", children: _jsx(ExternalHyperlink, { href: mdnUrl, iconLabel: "Open link in new window", children: formattedName }, i) }));
|
|
14
|
+
}) }), _jsx(Table.Data, { fontFamily: "monospace", children: styleProp.system === 'none' ? '---' : styleProp.system })] }, index))) })] }));
|
|
25
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../lib/Table.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../lib/Table.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,SAAS,EAAC,MAAM,gCAAgC,CAAC;AA+D/D,eAAO,MAAM,KAAK;;;;;;CAqBhB,CAAC"}
|
package/dist/es6/lib/Table.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { Box } from '@workday/canvas-kit-react/layout';
|
|
4
4
|
import { Text } from '@workday/canvas-kit-react/text';
|
|
@@ -6,22 +6,22 @@ import styled from '@emotion/styled';
|
|
|
6
6
|
import { type } from '@workday/canvas-kit-react/tokens';
|
|
7
7
|
const TableHead = createComponent('thead')({
|
|
8
8
|
Component: (props, ref, Element) => {
|
|
9
|
-
return
|
|
9
|
+
return _jsx(Box, { as: Element, ref: ref, ...props });
|
|
10
10
|
},
|
|
11
11
|
});
|
|
12
12
|
const TableBody = createComponent('tbody')({
|
|
13
13
|
Component: (props, ref, Element) => {
|
|
14
|
-
return
|
|
14
|
+
return _jsx(Box, { as: Element, ref: ref, ...props });
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
17
|
const TableRow = createComponent('tr')({
|
|
18
18
|
Component: (props, ref, Element) => {
|
|
19
|
-
return (
|
|
19
|
+
return (_jsx(Box, { as: Element, ref: ref, borderBottom: "solid 1px", borderBottomColor: "soap400", ...props }));
|
|
20
20
|
},
|
|
21
21
|
});
|
|
22
22
|
const TableHeader = createComponent('th')({
|
|
23
23
|
Component: (props, ref, Element) => {
|
|
24
|
-
return (
|
|
24
|
+
return (_jsx(Text, { as: Element, ref: ref, fontWeight: "medium", paddingX: "xxs", paddingY: "s", textAlign: "start", typeLevel: "subtext.large", ...props }));
|
|
25
25
|
},
|
|
26
26
|
});
|
|
27
27
|
const StyledText = styled(Text)({
|
|
@@ -31,13 +31,13 @@ const StyledText = styled(Text)({
|
|
|
31
31
|
});
|
|
32
32
|
const TableData = createComponent('td')({
|
|
33
33
|
Component: (props, ref, Element) => {
|
|
34
|
-
return (
|
|
34
|
+
return (_jsx(StyledText, { as: Element, ref: ref, paddingX: "xxs", paddingY: "s", textAlign: "start", typeLevel: "subtext.large", ...props }));
|
|
35
35
|
},
|
|
36
36
|
});
|
|
37
37
|
export const Table = createComponent('table')({
|
|
38
38
|
displayName: 'Table',
|
|
39
39
|
Component: (props, ref, Element) => {
|
|
40
|
-
return (
|
|
40
|
+
return (_jsx(Box, { as: Element, ref: ref, borderCollapse: "collapse", width: "100%", ...props, marginBottom: "s" }));
|
|
41
41
|
},
|
|
42
42
|
subComponents: {
|
|
43
43
|
Head: TableHead,
|
package/dist/es6/lib/Value.d.ts
CHANGED
|
@@ -12,13 +12,13 @@ export interface ValueProps<T extends {
|
|
|
12
12
|
}
|
|
13
13
|
export declare const Value: <T extends {
|
|
14
14
|
kind: string;
|
|
15
|
-
} = types.Value>(props: ValueProps<T>) =>
|
|
15
|
+
} = types.Value>(props: ValueProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export declare const PropertiesInline: ({ properties }: {
|
|
17
17
|
properties: types.ObjectProperty[];
|
|
18
|
-
}) =>
|
|
18
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export declare const PropertiesTable: ({ properties, showDefault, showRequired, }: {
|
|
20
20
|
properties: types.ObjectProperty[];
|
|
21
21
|
showDefault?: boolean | undefined;
|
|
22
22
|
showRequired?: boolean | undefined;
|
|
23
|
-
}) =>
|
|
23
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
//# sourceMappingURL=Value.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Value.d.ts","sourceRoot":"","sources":["../../../lib/Value.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAC;AAS5C,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,EACrD,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EACd,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAC9B,IAAI,CAGN;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAAG,KAAK,CAAC,KAAK;IAChE,KAAK,EAAE,CAAC,CAAC;IACT,GAAG,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAC9B,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,eAAO,MAAM,KAAK;UAAqB,MAAM;
|
|
1
|
+
{"version":3,"file":"Value.d.ts","sourceRoot":"","sources":["../../../lib/Value.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAC;AAS5C,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,EACrD,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EACd,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAC9B,IAAI,CAGN;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAAG,KAAK,CAAC,KAAK;IAChE,KAAK,EAAE,CAAC,CAAC;IACT,GAAG,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAC9B,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,eAAO,MAAM,KAAK;UAAqB,MAAM;iFAW5C,CAAC;AAEF,eAAO,MAAM,gBAAgB;gBAA+B,MAAM,cAAc,EAAE;6CAgDjF,CAAC;AAgEF,eAAO,MAAM,eAAe;gBAKd,MAAM,cAAc,EAAE;;;6CAyBnC,CAAC"}
|
package/dist/es6/lib/Value.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { Tooltip } from '@workday/canvas-kit-react/tooltip';
|
|
3
4
|
import { Text } from '@workday/canvas-kit-react/text';
|
|
@@ -16,37 +17,21 @@ export const Value = (props) => {
|
|
|
16
17
|
if (widgets[props.value.kind]) {
|
|
17
18
|
return React.createElement(widgets[props.value.kind], props);
|
|
18
19
|
}
|
|
19
|
-
return (
|
|
20
|
-
"unknown ",
|
|
21
|
-
JSON.stringify(props.value, null, ' ').replace(/\n/g, '\n' + indent(level))));
|
|
20
|
+
return (_jsxs("span", { className: "token unknown", style: { whiteSpace: 'pre-wrap' }, children: ["unknown ", JSON.stringify(props.value, null, ' ').replace(/\n/g, '\n' + indent(level))] }));
|
|
22
21
|
};
|
|
23
22
|
export const PropertiesInline = ({ properties }) => {
|
|
24
23
|
if (properties.length === 0) {
|
|
25
|
-
return
|
|
24
|
+
return _jsx("span", { className: "token punctuation", children: "{}" });
|
|
26
25
|
}
|
|
27
26
|
const level = React.useContext(IndentLevelContext);
|
|
28
|
-
return (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
cursor: 'pointer',
|
|
37
|
-
textDecoration: p.tags.deprecated ? 'line-through' : 'underline',
|
|
38
|
-
textDecorationStyle: 'dotted',
|
|
39
|
-
color: p.tags.deprecated ? colors.cinnamon600 : colors.plum600,
|
|
40
|
-
} }, p.name))) : (React.createElement("span", { className: "token property" }, p.name)),
|
|
41
|
-
React.createElement("span", { className: "token punctuation" }, ":"),
|
|
42
|
-
"\u00A0",
|
|
43
|
-
React.createElement(IndentLevelContext.Provider, { value: level + 1 },
|
|
44
|
-
React.createElement(Value, { value: p.type })),
|
|
45
|
-
React.createElement("span", { className: "token punctuation" }, ";")));
|
|
46
|
-
}),
|
|
47
|
-
React.createElement("br", null),
|
|
48
|
-
indent(level),
|
|
49
|
-
React.createElement("span", { className: "token punctuation" }, "}")));
|
|
27
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { className: "token punctuation", children: "{" }), properties.map((p, index) => {
|
|
28
|
+
return (_jsxs(React.Fragment, { children: [_jsx("br", {}), indent(level + 1), p.description || p.tags.deprecated ? (_jsx(DescriptionTooltip, { type: "describe", style: { maxWidth: '50em' }, title: _jsx(MdxJSToJSX, { children: p.description || p.tags.deprecated }), children: _jsx("span", { className: "token property", style: {
|
|
29
|
+
cursor: 'pointer',
|
|
30
|
+
textDecoration: p.tags.deprecated ? 'line-through' : 'underline',
|
|
31
|
+
textDecorationStyle: 'dotted',
|
|
32
|
+
color: p.tags.deprecated ? colors.cinnamon600 : colors.plum600,
|
|
33
|
+
}, children: p.name }) })) : (_jsx("span", { className: "token property", children: p.name })), _jsx("span", { className: "token punctuation", children: ":" }), "\u00A0", _jsx(IndentLevelContext.Provider, { value: level + 1, children: _jsx(Value, { value: p.type }) }), _jsx("span", { className: "token punctuation", children: ";" })] }, index));
|
|
34
|
+
}), _jsx("br", {}), indent(level), _jsx("span", { className: "token punctuation", children: "}" })] }));
|
|
50
35
|
};
|
|
51
36
|
function getTableRows(properties, showDefault = true, showRequired = false, level, index) {
|
|
52
37
|
return properties.flatMap((property, i) => {
|
|
@@ -55,37 +40,17 @@ function getTableRows(properties, showDefault = true, showRequired = false, leve
|
|
|
55
40
|
return [];
|
|
56
41
|
}
|
|
57
42
|
const title = (_b = (_a = property.declarations) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.filePath;
|
|
58
|
-
const propName = (
|
|
59
|
-
indent(level),
|
|
60
|
-
level > 0 && '\u2514\u00A0',
|
|
61
|
-
property.name,
|
|
62
|
-
showRequired && property.required ? React.createElement(Text, { color: "chiliMango600" }, "*") : ''));
|
|
43
|
+
const propName = (_jsxs(Text, { as: "code", whiteSpace: 'nowrap !important', children: [indent(level), level > 0 && '\u2514\u00A0', property.name, showRequired && property.required ? _jsx(Text, { color: "chiliMango600", children: "*" }) : ''] }));
|
|
63
44
|
return [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
React.createElement(Table.Data, null,
|
|
67
|
-
React.createElement("code", null, React.createElement(RenderContext.Provider, { value: "inline" },
|
|
68
|
-
React.createElement(Value, { value: property.type })))),
|
|
69
|
-
React.createElement(Table.Data, null,
|
|
70
|
-
React.createElement(MdxJSToJSX, null, property.description || '')),
|
|
71
|
-
showDefault ? (React.createElement(Table.Data, null, property.defaultValue ? (property.defaultValue.kind === 'primitive' &&
|
|
72
|
-
property.defaultValue.value === 'undefined' ? null : (React.createElement("code", null,
|
|
73
|
-
React.createElement(Value, { value: property.defaultValue })))) : null)) : null),
|
|
45
|
+
_jsxs(Table.Row, { children: [_jsx(Table.Data, { color: "plum600", children: title ? (_jsx(Tooltip, { type: "describe", title: title, children: propName })) : (propName) }), _jsx(Table.Data, { children: _jsx("code", { children: _jsx(RenderContext.Provider, { value: "inline", children: _jsx(Value, { value: property.type }) }) }) }), _jsx(Table.Data, { children: _jsx(MdxJSToJSX, { children: property.description || '' }) }), showDefault ? (_jsx(Table.Data, { children: property.defaultValue ? (property.defaultValue.kind === 'primitive' &&
|
|
46
|
+
property.defaultValue.value === 'undefined' ? null : (_jsx("code", { children: _jsx(Value, { value: property.defaultValue }) }))) : null })) : null] }, index + i),
|
|
74
47
|
];
|
|
75
48
|
});
|
|
76
49
|
}
|
|
77
50
|
export const PropertiesTable = ({ properties, showDefault = true, showRequired = false, }) => {
|
|
78
51
|
if (properties.length === 0) {
|
|
79
|
-
return
|
|
52
|
+
return _jsx("span", { className: "token punctuation", children: "{}" });
|
|
80
53
|
}
|
|
81
54
|
const tableBody = getTableRows(properties, showDefault, showRequired, 0, 0);
|
|
82
|
-
return (
|
|
83
|
-
React.createElement(Table, null,
|
|
84
|
-
React.createElement(Table.Head, null,
|
|
85
|
-
React.createElement(Table.Row, null,
|
|
86
|
-
React.createElement(Table.Header, null, "Name"),
|
|
87
|
-
React.createElement(Table.Header, null, "Type"),
|
|
88
|
-
React.createElement(Table.Header, null, "Description"),
|
|
89
|
-
showDefault ? React.createElement(Table.Header, null, "Default") : null)),
|
|
90
|
-
React.createElement(Table.Body, null, tableBody))));
|
|
55
|
+
return (_jsx(IndentLevelContext.Provider, { value: 0, children: _jsxs(Table, { children: [_jsx(Table.Head, { children: _jsxs(Table.Row, { children: [_jsx(Table.Header, { children: "Name" }), _jsx(Table.Header, { children: "Type" }), _jsx(Table.Header, { children: "Description" }), showDefault ? _jsx(Table.Header, { children: "Default" }) : null] }) }), _jsx(Table.Body, { children: tableBody })] }) }));
|
|
91
56
|
};
|