@workday/canvas-kit-docs 14.0.0-alpha.1223-next.0 → 14.0.0-alpha.1225-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es6/lib/ExampleCodeBlock.d.ts.map +1 -1
- package/dist/es6/lib/ExampleCodeBlock.js +7 -6
- package/dist/es6/lib/docs.js +0 -1412
- package/dist/mdx/14.0-UPGRADE-GUIDE.mdx +33 -2
- package/dist/mdx/preview-react/pill/Pill.mdx +2 -2
- package/dist/mdx/preview-react/pill/examples/WithReadOnly.tsx +1 -1
- package/lib/ExampleCodeBlock.tsx +45 -37
- package/package.json +6 -6
|
@@ -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":"AAkEA,eAAO,MAAM,gBAAgB,aAAY,GAAG,4CAiH3C,CAAC"}
|
|
@@ -18,6 +18,7 @@ import eslintrc from '!!raw-loader!./stackblitzFiles/.eslintrc.cjs.txt';
|
|
|
18
18
|
import tsconfigNodeFile from '!!raw-loader!./stackblitzFiles/tsconfig.node.json';
|
|
19
19
|
import appFile from '!!raw-loader!./stackblitzFiles/App.tsx';
|
|
20
20
|
import viteEnvFile from '!!raw-loader!./stackblitzFiles/vite-env.d.ts';
|
|
21
|
+
import { CanvasProvider, defaultCanvasTheme } from '@workday/canvas-kit-react/common';
|
|
21
22
|
const cardStencil = createStencil({
|
|
22
23
|
base: {
|
|
23
24
|
'[data-part="example-block"]': {
|
|
@@ -109,10 +110,10 @@ export const ExampleCodeBlock = ({ code }) => {
|
|
|
109
110
|
openFile: 'src/Demo.tsx',
|
|
110
111
|
});
|
|
111
112
|
};
|
|
112
|
-
return (_jsxs("div", { ...cardStencil({ opened: isCodeDisplayed }), children: [_jsx(Card, { "data-part": "example-block", className: "sb-unstyled", children:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
return (_jsxs("div", { ...cardStencil({ opened: isCodeDisplayed }), children: [_jsx(Card, { "data-part": "example-block", className: "sb-unstyled", children: _jsx(Card.Body, { children: _jsxs(CanvasProvider, { theme: { canvas: defaultCanvasTheme }, 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: _jsx(Card.Body, { cs: { position: 'relative' }, children: _jsxs(CanvasProvider, { theme: { canvas: defaultCanvasTheme }, children: [code && (_jsx("div", { ref: textInput, children: _jsx(SyntaxHighlighter, { className: "sb-unstyled", language: "jsx", style: vscDarkPlus, customStyle: {
|
|
114
|
+
fontSize: cssVar(system.fontSize.subtext.large),
|
|
115
|
+
lineHeight: cssVar(system.lineHeight.subtext.large),
|
|
116
|
+
margin: '0',
|
|
117
|
+
padding: `${cssVar(system.space.x8)} ${cssVar(system.space.x10)}`,
|
|
118
|
+
}, 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 }) })] }) }) })] }));
|
|
118
119
|
};
|