@workday/canvas-kit-docs 13.2.36 → 13.2.37

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleCodeBlock.d.ts","sourceRoot":"","sources":["../../../lib/ExampleCodeBlock.tsx"],"names":[],"mappings":"AAiEA,eAAO,MAAM,gBAAgB,aAAY,GAAG,4CA0G3C,CAAC"}
1
+ {"version":3,"file":"ExampleCodeBlock.d.ts","sourceRoot":"","sources":["../../../lib/ExampleCodeBlock.tsx"],"names":[],"mappings":"AAkEA,eAAO,MAAM,gBAAgB,aAAY,GAAG,4CA2G3C,CAAC"}
@@ -24,6 +24,7 @@ const cardStencil = createStencil({
24
24
  boxShadow: system.depth[1],
25
25
  borderRadius: system.shape.x1,
26
26
  position: 'relative',
27
+ overflow: 'auto', // This allows for the entire ExampleCodeBlock to scroll on smaller viewports
27
28
  },
28
29
  '[data-part="code-block"]': {
29
30
  display: 'none',
@@ -109,7 +110,7 @@ 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: _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
+ return (_jsxs("div", { ...cardStencil({ opened: isCodeDisplayed }), children: [_jsx(Card, { "data-part": "example-block", className: "sb-unstyled", children: _jsxs(Card.Body, { cs: { overflow: 'auto' }, 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
114
  fontSize: cssVar(system.fontSize.subtext.large),
114
115
  lineHeight: cssVar(system.lineHeight.subtext.large),
115
116
  margin: '0',
@@ -1 +1 @@
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
+ {"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,4CAYnD,CAAC"}
@@ -3,7 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useMDXComponents } from '@mdx-js/react';
4
4
  import React from 'react';
5
5
  import MarkdownToJSX from 'markdown-to-jsx';
6
- import { createComponent } from '@workday/canvas-kit-react';
6
+ import { Box, createComponent } from '@workday/canvas-kit-react';
7
7
  import { HeadingLevelContext, SymbolDialog } from './widgetUtils';
8
8
  /**
9
9
  * Special component that taps into @mdx-js/react components that are used by both Storybook and the
@@ -57,5 +57,8 @@ function rewriteHeadingLevels(input, startingLevel) {
57
57
  export const MdxJSToJSX = (props) => {
58
58
  const components = useMDXComponents();
59
59
  const headingLevel = React.useContext(HeadingLevelContext);
60
- return (_jsx(MarkdownToJSX, { options: { overrides: { ...components, button: Button }, forceBlock: true }, children: rewriteHeadingLevels(convertLinkToSymbolLinks(props.children), headingLevel) }));
60
+ return (
61
+ // This fixes the `pre` element inside of the `<Table.Cell/>` element.
62
+ // This prevents the code block from going outside the width of the `<Table.Cell/>` element.
63
+ _jsx(Box, { cs: { minWidth: '0' }, children: _jsx(MarkdownToJSX, { options: { overrides: { ...components, button: Button }, forceBlock: true }, children: rewriteHeadingLevels(convertLinkToSymbolLinks(props.children), headingLevel) }) }));
61
64
  };
@@ -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;AAU5C,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;AAoEF,eAAO,MAAM,eAAe;gBAKd,MAAM,cAAc,EAAE;;;6CAyBnC,CAAC"}
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;AAW5C,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;AAoEF,eAAO,MAAM,eAAe;gBAKd,MAAM,cAAc,EAAE;;;6CAyBnC,CAAC"}
@@ -3,11 +3,12 @@ import React from 'react';
3
3
  import { Tooltip } from '@workday/canvas-kit-react/tooltip';
4
4
  import { Text } from '@workday/canvas-kit-react/text';
5
5
  import { MdxJSToJSX } from './MDXElements';
6
- import { Table } from './Table';
6
+ import { Table } from '@workday/canvas-kit-react';
7
7
  import { capitalize, IndentLevelContext, RenderContext, indent } from './widgetUtils';
8
8
  import { DescriptionTooltip } from './DescriptionTooltip';
9
9
  import { colors } from '@workday/canvas-kit-react/tokens';
10
10
  import { createStyles } from '@workday/canvas-kit-styling';
11
+ import { Flex } from '@workday/canvas-kit-react';
11
12
  const widgets = {};
12
13
  export function registerWidget(key, widget) {
13
14
  widget.displayName = `${capitalize(key)}Widget`;
@@ -43,7 +44,7 @@ function getTableRows(properties, showDefault = true, showRequired = false, leve
43
44
  const title = (_b = (_a = property.declarations) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.filePath;
44
45
  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: "*" }) : ''] }));
45
46
  return [
46
- _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' &&
47
+ _jsxs(Table.Row, { children: [_jsx(Table.Cell, { color: "plum600", children: title ? (_jsx(Tooltip, { type: "describe", title: title, children: propName })) : (propName) }), _jsx(Table.Cell, { children: _jsx(Flex, { as: "code", cs: { flexWrap: 'wrap' }, children: _jsx(RenderContext.Provider, { value: "inline", children: _jsx(Value, { value: property.type }) }) }) }), _jsx(Table.Cell, { children: _jsx(MdxJSToJSX, { children: property.description || '' }) }), showDefault ? (_jsx(Table.Cell, { children: property.defaultValue ? (property.defaultValue.kind === 'primitive' &&
47
48
  property.defaultValue.value === 'undefined' ? null : (_jsx("code", { children: _jsx(Value, { value: property.defaultValue }) }))) : null })) : null] }, index + i),
48
49
  ];
49
50
  });
@@ -18,11 +18,11 @@ export const packageJSONFile = `{
18
18
  "@emotion/react": "11.11.4",
19
19
  "@types/react": "18.2.60",
20
20
  "@types/react-dom": "18.2.19",
21
- "@workday/canvas-kit-labs-react": "13.2.36",
22
- "@workday/canvas-kit-preview-react": "13.2.36",
23
- "@workday/canvas-kit-react": "13.2.36",
24
- "@workday/canvas-kit-react-fonts": "^13.2.36",
25
- "@workday/canvas-kit-styling": "13.2.36",
21
+ "@workday/canvas-kit-labs-react": "13.2.37",
22
+ "@workday/canvas-kit-preview-react": "13.2.37",
23
+ "@workday/canvas-kit-react": "13.2.37",
24
+ "@workday/canvas-kit-react-fonts": "^13.2.37",
25
+ "@workday/canvas-kit-styling": "13.2.37",
26
26
  "@workday/canvas-system-icons-web": "3.0.22",
27
27
  "@workday/canvas-tokens-web": "2.0.0"
28
28
  },
@@ -18,11 +18,11 @@ export const packageJSONFile = `{
18
18
  "@emotion/react": "11.11.4",
19
19
  "@types/react": "18.2.60",
20
20
  "@types/react-dom": "18.2.19",
21
- "@workday/canvas-kit-labs-react": "13.2.36",
22
- "@workday/canvas-kit-preview-react": "13.2.36",
23
- "@workday/canvas-kit-react": "13.2.36",
24
- "@workday/canvas-kit-react-fonts": "^13.2.36",
25
- "@workday/canvas-kit-styling": "13.2.36",
21
+ "@workday/canvas-kit-labs-react": "13.2.37",
22
+ "@workday/canvas-kit-preview-react": "13.2.37",
23
+ "@workday/canvas-kit-react": "13.2.37",
24
+ "@workday/canvas-kit-react-fonts": "^13.2.37",
25
+ "@workday/canvas-kit-styling": "13.2.37",
26
26
  "@workday/canvas-system-icons-web": "3.0.22",
27
27
  "@workday/canvas-tokens-web": "2.0.0"
28
28
  },
@@ -25,6 +25,7 @@ const cardStencil = createStencil({
25
25
  boxShadow: system.depth[1],
26
26
  borderRadius: system.shape.x1,
27
27
  position: 'relative',
28
+ overflow: 'auto', // This allows for the entire ExampleCodeBlock to scroll on smaller viewports
28
29
  },
29
30
  '[data-part="code-block"]': {
30
31
  display: 'none',
@@ -122,7 +123,8 @@ export const ExampleCodeBlock = ({code}: any) => {
122
123
  return (
123
124
  <div {...cardStencil({opened: isCodeDisplayed})}>
124
125
  <Card data-part="example-block" className="sb-unstyled">
125
- <Card.Body>
126
+ {/* This allows for the div to scroll on smaller viewports while not allowing the components to overflow over the container */}
127
+ <Card.Body cs={{overflow: 'auto'}}>
126
128
  {React.createElement(code)}
127
129
  {code && (
128
130
  <div data-part="code-toggle-stackblitz-btn-container">
@@ -3,7 +3,7 @@ import {useMDXComponents} from '@mdx-js/react';
3
3
  import React from 'react';
4
4
  import MarkdownToJSX from 'markdown-to-jsx';
5
5
 
6
- import {createComponent} from '@workday/canvas-kit-react';
6
+ import {Box, createComponent} from '@workday/canvas-kit-react';
7
7
  import {HeadingLevelContext, SymbolDialog} from './widgetUtils';
8
8
 
9
9
  /**
@@ -80,8 +80,12 @@ export const MdxJSToJSX = (props: {children: string}) => {
80
80
  const components = useMDXComponents();
81
81
  const headingLevel = React.useContext(HeadingLevelContext);
82
82
  return (
83
- <MarkdownToJSX options={{overrides: {...components, button: Button}, forceBlock: true}}>
84
- {rewriteHeadingLevels(convertLinkToSymbolLinks(props.children), headingLevel)}
85
- </MarkdownToJSX>
83
+ // This fixes the `pre` element inside of the `<Table.Cell/>` element.
84
+ // This prevents the code block from going outside the width of the `<Table.Cell/>` element.
85
+ <Box cs={{minWidth: '0'}}>
86
+ <MarkdownToJSX options={{overrides: {...components, button: Button}, forceBlock: true}}>
87
+ {rewriteHeadingLevels(convertLinkToSymbolLinks(props.children), headingLevel)}
88
+ </MarkdownToJSX>
89
+ </Box>
86
90
  );
87
91
  };
package/lib/Value.tsx CHANGED
@@ -5,11 +5,12 @@ import {Text} from '@workday/canvas-kit-react/text';
5
5
 
6
6
  import * as types from '../docgen/docTypes';
7
7
  import {MdxJSToJSX} from './MDXElements';
8
- import {Table} from './Table';
8
+ import {Table} from '@workday/canvas-kit-react';
9
9
  import {capitalize, IndentLevelContext, RenderContext, indent} from './widgetUtils';
10
10
  import {DescriptionTooltip} from './DescriptionTooltip';
11
11
  import {colors} from '@workday/canvas-kit-react/tokens';
12
12
  import {createStyles} from '@workday/canvas-kit-styling';
13
+ import {Flex} from '@workday/canvas-kit-react';
13
14
 
14
15
  const widgets: Record<string, React.FC<ValueProps>> = {};
15
16
 
@@ -113,7 +114,7 @@ function getTableRows(
113
114
  );
114
115
  return [
115
116
  <Table.Row key={index + i}>
116
- <Table.Data color="plum600">
117
+ <Table.Cell color="plum600">
117
118
  {/* Use a tooltip to help with debugging where the type sources are coming from */}
118
119
  {title ? (
119
120
  <Tooltip type="describe" title={title}>
@@ -122,21 +123,21 @@ function getTableRows(
122
123
  ) : (
123
124
  propName
124
125
  )}
125
- </Table.Data>
126
- <Table.Data>
127
- <code>
126
+ </Table.Cell>
127
+ <Table.Cell>
128
+ <Flex as="code" cs={{flexWrap: 'wrap'}}>
128
129
  {
129
130
  <RenderContext.Provider value="inline">
130
131
  <Value value={property.type} />
131
132
  </RenderContext.Provider>
132
133
  }
133
- </code>
134
- </Table.Data>
135
- <Table.Data>
134
+ </Flex>
135
+ </Table.Cell>
136
+ <Table.Cell>
136
137
  <MdxJSToJSX>{property.description || ''}</MdxJSToJSX>
137
- </Table.Data>
138
+ </Table.Cell>
138
139
  {showDefault ? (
139
- <Table.Data>
140
+ <Table.Cell>
140
141
  {property.defaultValue ? (
141
142
  property.defaultValue.kind === 'primitive' &&
142
143
  property.defaultValue.value === 'undefined' ? null : (
@@ -145,7 +146,7 @@ function getTableRows(
145
146
  </code>
146
147
  )
147
148
  ) : null}
148
- </Table.Data>
149
+ </Table.Cell>
149
150
  ) : null}
150
151
  </Table.Row>,
151
152
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "13.2.36",
3
+ "version": "13.2.37",
4
4
  "description": "Documentation components of Canvas Kit components",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -45,10 +45,10 @@
45
45
  "@emotion/styled": "^11.6.0",
46
46
  "@stackblitz/sdk": "^1.11.0",
47
47
  "@storybook/csf": "0.0.1",
48
- "@workday/canvas-kit-labs-react": "^13.2.36",
49
- "@workday/canvas-kit-preview-react": "^13.2.36",
50
- "@workday/canvas-kit-react": "^13.2.36",
51
- "@workday/canvas-kit-styling": "^13.2.36",
48
+ "@workday/canvas-kit-labs-react": "^13.2.37",
49
+ "@workday/canvas-kit-preview-react": "^13.2.37",
50
+ "@workday/canvas-kit-react": "^13.2.37",
51
+ "@workday/canvas-kit-styling": "^13.2.37",
52
52
  "@workday/canvas-system-icons-web": "^3.0.35",
53
53
  "@workday/canvas-tokens-web": "^2.1.1",
54
54
  "markdown-to-jsx": "^7.2.0",
@@ -61,5 +61,5 @@
61
61
  "mkdirp": "^1.0.3",
62
62
  "typescript": "5.0"
63
63
  },
64
- "gitHead": "0e412c1952429e7da528711f821fc87765557050"
64
+ "gitHead": "a4a3787b04495d4c96c3a2beccd8ee571d9e792d"
65
65
  }