@workday/canvas-kit-docs 15.0.0-alpha.1287-next.0 → 15.0.0-alpha.1293-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.
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleCodeBlock.d.ts","sourceRoot":"","sources":["../../../lib/ExampleCodeBlock.tsx"],"names":[],"mappings":"AAkEA,eAAO,MAAM,gBAAgB,aAAY,GAAG,4CAiH3C,CAAC"}
1
+ {"version":3,"file":"ExampleCodeBlock.d.ts","sourceRoot":"","sources":["../../../lib/ExampleCodeBlock.tsx"],"names":[],"mappings":"AAmEA,eAAO,MAAM,gBAAgB,aAAY,GAAG,4CAkH3C,CAAC"}
@@ -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',
@@ -110,7 +111,7 @@ export const ExampleCodeBlock = ({ code }) => {
110
111
  openFile: 'src/Demo.tsx',
111
112
  });
112
113
  };
113
- return (_jsxs("div", { ...cardStencil({ opened: isCodeDisplayed }), children: [_jsx(Card, { "data-part": "example-block", className: "sb-unstyled", children: _jsx(Card.Body, { children: _jsxs(CanvasProvider, { className: defaultBranding, 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, { className: defaultBranding, children: [code && (_jsx("div", { ref: textInput, children: _jsx(SyntaxHighlighter, { className: "sb-unstyled", language: "jsx", style: vscDarkPlus, customStyle: {
114
+ return (_jsxs("div", { ...cardStencil({ opened: isCodeDisplayed }), children: [_jsx(Card, { "data-part": "example-block", className: "sb-unstyled", children: _jsx(Card.Body, { cs: { overflow: 'auto' }, children: _jsxs(CanvasProvider, { className: defaultBranding, 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, { className: defaultBranding, children: [code && (_jsx("div", { ref: textInput, children: _jsx(SyntaxHighlighter, { className: "sb-unstyled", language: "jsx", style: vscDarkPlus, customStyle: {
114
115
  fontSize: cssVar(system.fontSize.subtext.large),
115
116
  lineHeight: cssVar(system.lineHeight.subtext.large),
116
117
  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": "14.0.10",
22
- "@workday/canvas-kit-preview-react": "14.0.10",
23
- "@workday/canvas-kit-react": "14.0.10",
24
- "@workday/canvas-kit-react-fonts": "^14.0.10",
25
- "@workday/canvas-kit-styling": "14.0.10",
21
+ "@workday/canvas-kit-labs-react": "14.0.13",
22
+ "@workday/canvas-kit-preview-react": "14.0.13",
23
+ "@workday/canvas-kit-react": "14.0.13",
24
+ "@workday/canvas-kit-react-fonts": "^14.0.13",
25
+ "@workday/canvas-kit-styling": "14.0.13",
26
26
  "@workday/canvas-system-icons-web": "3.0.36",
27
27
  "@workday/canvas-tokens-web": "3.1.2"
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": "14.0.10",
22
- "@workday/canvas-kit-preview-react": "14.0.10",
23
- "@workday/canvas-kit-react": "14.0.10",
24
- "@workday/canvas-kit-react-fonts": "^14.0.10",
25
- "@workday/canvas-kit-styling": "14.0.10",
21
+ "@workday/canvas-kit-labs-react": "14.0.13",
22
+ "@workday/canvas-kit-preview-react": "14.0.13",
23
+ "@workday/canvas-kit-react": "14.0.13",
24
+ "@workday/canvas-kit-react-fonts": "^14.0.13",
25
+ "@workday/canvas-kit-styling": "14.0.13",
26
26
  "@workday/canvas-system-icons-web": "3.0.36",
27
27
  "@workday/canvas-tokens-web": "3.1.2"
28
28
  },
@@ -210,10 +210,6 @@ The Popup component automatically handles right-to-left rendering.
210
210
 
211
211
  {' '}
212
212
 
213
- <SymbolDoc name="useAlwaysCloseOnOutsideClick" fileName="/react/" />
214
-
215
- {' '}
216
-
217
213
  <SymbolDoc name="useCloseOnTargetHidden" fileName="/react/" />
218
214
 
219
215
  {' '}
@@ -26,6 +26,7 @@ const cardStencil = createStencil({
26
26
  boxShadow: system.depth[1],
27
27
  borderRadius: system.shape.x1,
28
28
  position: 'relative',
29
+ overflow: 'auto', // This allows for the entire ExampleCodeBlock to scroll on smaller viewports
29
30
  },
30
31
  '[data-part="code-block"]': {
31
32
  display: 'none',
@@ -123,7 +124,8 @@ export const ExampleCodeBlock = ({code}: any) => {
123
124
  return (
124
125
  <div {...cardStencil({opened: isCodeDisplayed})}>
125
126
  <Card data-part="example-block" className="sb-unstyled">
126
- <Card.Body>
127
+ {/* This allows for the div to scroll on smaller viewports while not allowing the components to overflow over the container */}
128
+ <Card.Body cs={{overflow: 'auto'}}>
127
129
  <CanvasProvider className={defaultBranding}>
128
130
  {React.createElement(code)}
129
131
  {code && (
@@ -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": "15.0.0-alpha.1287-next.0",
3
+ "version": "15.0.0-alpha.1293-next.0",
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": "^15.0.0-alpha.1287-next.0",
49
- "@workday/canvas-kit-preview-react": "^15.0.0-alpha.1287-next.0",
50
- "@workday/canvas-kit-react": "^15.0.0-alpha.1287-next.0",
51
- "@workday/canvas-kit-styling": "^15.0.0-alpha.1287-next.0",
48
+ "@workday/canvas-kit-labs-react": "^15.0.0-alpha.1293-next.0",
49
+ "@workday/canvas-kit-preview-react": "^15.0.0-alpha.1293-next.0",
50
+ "@workday/canvas-kit-react": "^15.0.0-alpha.1293-next.0",
51
+ "@workday/canvas-kit-styling": "^15.0.0-alpha.1293-next.0",
52
52
  "@workday/canvas-system-icons-web": "^3.0.36",
53
53
  "@workday/canvas-tokens-web": "^3.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": "ff2e4b3c7152235ef0f3d6d8f8a1244312657c11"
64
+ "gitHead": "3af12af1258fa5f8a09c702f9bb322b5a1f0653d"
65
65
  }