@workday/canvas-kit-docs 14.2.2 → 14.2.3
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/docs.js +5 -5
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +5 -5
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +5 -5
- package/dist/mdx/10.0-UPGRADE-GUIDE.mdx +1 -1
- package/dist/mdx/5.0-UPGRADE-GUIDE.mdx +3 -3
- package/dist/mdx/7.0-UPGRADE-GUIDE.mdx +4 -4
- package/dist/mdx/8.0-UPGRADE-GUIDE.mdx +5 -5
- package/dist/mdx/9.0-UPGRADE-GUIDE.mdx +2 -2
- package/dist/mdx/CONTRIBUTING.mdx +4 -4
- package/dist/mdx/CREATING_COMPOUND_COMPONENTS.mdx +1 -1
- package/dist/mdx/preview-react/multi-select/MultiSelect.mdx +3 -3
- package/dist/mdx/preview-react/segmented-control/SegmentedControl.mdx +2 -2
- package/dist/mdx/preview-react/status-indicator/StatusIndicator.mdx +1 -1
- package/dist/mdx/react/action-bar/ActionBar.mdx +1 -1
- package/dist/mdx/react/banner/Banner.mdx +1 -1
- package/dist/mdx/react/breadcrumbs/Breadcrumbs.mdx +1 -1
- package/dist/mdx/react/card/card.mdx +1 -1
- package/dist/mdx/react/common/mdx/CompoundComponentUtilities.mdx +1 -1
- package/dist/mdx/react/layout/Box.mdx +12 -12
- package/dist/mdx/react/layout/Flex.mdx +3 -3
- package/dist/mdx/react/layout/Grid.mdx +3 -3
- package/dist/mdx/react/pagination/pagination.mdx +4 -4
- package/dist/mdx/react/popup/Popup.mdx +1 -1
- package/dist/mdx/react/select/Select.mdx +4 -4
- package/dist/mdx/react/tabs/Tabs.mdx +2 -2
- package/dist/mdx/react/text/Text.mdx +1 -1
- package/dist/mdx/react/toast/toast.mdx +1 -1
- package/package.json +6 -6
package/dist/es6/lib/docs.js
CHANGED
|
@@ -67558,7 +67558,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
67558
67558
|
{
|
|
67559
67559
|
"name": "SegmentedControl",
|
|
67560
67560
|
"fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/segmented-control/lib/SegmentedControl.tsx",
|
|
67561
|
-
"description": "`SegmentedControl` is a container component that is responsible for creating a\n{@link SegmentedControlModel } and sharing it with its subcomponents using React context. It does\nnot represent a real element.\n\n```tsx\n<SegmentedControl items={[]}>{Child components}</SegmentedControl>\n```\n\nAlternatively, you may pass in a model using the [hoisted model\npattern](/
|
|
67561
|
+
"description": "`SegmentedControl` is a container component that is responsible for creating a\n{@link SegmentedControlModel } and sharing it with its subcomponents using React context. It does\nnot represent a real element.\n\n```tsx\n<SegmentedControl items={[]}>{Child components}</SegmentedControl>\n```\n\nAlternatively, you may pass in a model using the [hoisted model\npattern](/get-started/for-developers/documentation/compound-components/#configuring-a-model).\n\n```tsx\nconst model = useSegmentedControlModel({\n items: [],\n});\n\n<SegmentedControl model={model}>{Child components}</SegmentedControl>;\n```",
|
|
67562
67562
|
"declarations": [
|
|
67563
67563
|
{
|
|
67564
67564
|
"name": "SegmentedControl",
|
|
@@ -371345,7 +371345,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
371345
371345
|
{
|
|
371346
371346
|
"name": "Tabs",
|
|
371347
371347
|
"fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/tabs/lib/Tabs.tsx",
|
|
371348
|
-
"description": "`Tabs` is a container component that is responsible for creating a {@link TabsModel } and sharing\nit with its subcomponents using React context. It does not represent a real element.\n\n```tsx\n<Tabs onSelect={data => console.log('Selected tab', data.id)}>\n {child components}\n</Tabs>\n```\n\nAlternatively, you may pass in a model using the hoisted model pattern.\n\n```tsx\nconst model = useTabsModel({\n onSelect(data) {\n console.log('Activated Tab', data.id);\n },\n});\n\n<Tabs model={model}>{child components}</Tabs>\n```\n\nSee [Configuring a\nModel](/
|
|
371348
|
+
"description": "`Tabs` is a container component that is responsible for creating a {@link TabsModel } and sharing\nit with its subcomponents using React context. It does not represent a real element.\n\n```tsx\n<Tabs onSelect={data => console.log('Selected tab', data.id)}>\n {child components}\n</Tabs>\n```\n\nAlternatively, you may pass in a model using the hoisted model pattern.\n\n```tsx\nconst model = useTabsModel({\n onSelect(data) {\n console.log('Activated Tab', data.id);\n },\n});\n\n<Tabs model={model}>{child components}</Tabs>\n```\n\nSee [Configuring a\nModel](/get-started/for-developers/documentation/compound-components/#configuring-a-model) for\nmore information on model configuration.",
|
|
371349
371349
|
"declarations": [
|
|
371350
371350
|
{
|
|
371351
371351
|
"name": "Tabs",
|
|
@@ -384745,7 +384745,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
384745
384745
|
{
|
|
384746
384746
|
"name": "useTabsModel",
|
|
384747
384747
|
"fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/tabs/lib/useTabsModel.tsx",
|
|
384748
|
-
"description": "The TabsModel extends the [Collection\nSystem](/
|
|
384748
|
+
"description": "The TabsModel extends the [Collection\nSystem](/get-started/for-developers/guides/collection-api/). Tabs have tab items and\npanels. Tabs can be overflowed if there isn't enough room to render and will overflow to a\n{@link MenuModel } sub-model.\n\n```tsx\nconst model = useTabsModel({\n onSelect(data) {\n console.log('Selected Tab', data)\n }\n})\n\n<Tabs model={model}>{Tabs child components}</Tabs>\n```",
|
|
384749
384749
|
"declarations": [
|
|
384750
384750
|
{
|
|
384751
384751
|
"name": "useTabsModel",
|
|
@@ -385277,7 +385277,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
385277
385277
|
{
|
|
385278
385278
|
"name": "TabsModel",
|
|
385279
385279
|
"fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/tabs/lib/useTabsModel.tsx",
|
|
385280
|
-
"description": "The TabsModel extends the [Collection\nSystem](/
|
|
385280
|
+
"description": "The TabsModel extends the [Collection\nSystem](/get-started/for-developers/guides/collection-api/). Tabs have tab items and\npanels. Tabs can be overflowed if there isn't enough room to render and will overflow to a\n{@link MenuModel } sub-model.\n\n```tsx\nconst model = useTabsModel({\n onSelect(data) {\n console.log('Selected Tab', data)\n }\n})\n\n<Tabs model={model}>{Tabs child components}</Tabs>\n```",
|
|
385281
385281
|
"declarations": [
|
|
385282
385282
|
{
|
|
385283
385283
|
"name": "useTabsModel",
|
|
@@ -387631,7 +387631,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
387631
387631
|
{
|
|
387632
387632
|
"name": "TabsModelConfig",
|
|
387633
387633
|
"fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/tabs/lib/useTabsModel.tsx",
|
|
387634
|
-
"description": "The TabsModel extends the [Collection\nSystem](/
|
|
387634
|
+
"description": "The TabsModel extends the [Collection\nSystem](/get-started/for-developers/guides/collection-api/). Tabs have tab items and\npanels. Tabs can be overflowed if there isn't enough room to render and will overflow to a\n{@link MenuModel } sub-model.\n\n```tsx\nconst model = useTabsModel({\n onSelect(data) {\n console.log('Selected Tab', data)\n }\n})\n\n<Tabs model={model}>{Tabs child components}</Tabs>\n```",
|
|
387635
387635
|
"declarations": [
|
|
387636
387636
|
{
|
|
387637
387637
|
"name": "useTabsModel",
|
|
@@ -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.2.
|
|
22
|
-
"@workday/canvas-kit-preview-react": "14.2.
|
|
23
|
-
"@workday/canvas-kit-react": "14.2.
|
|
24
|
-
"@workday/canvas-kit-react-fonts": "^14.2.
|
|
25
|
-
"@workday/canvas-kit-styling": "14.2.
|
|
21
|
+
"@workday/canvas-kit-labs-react": "14.2.3",
|
|
22
|
+
"@workday/canvas-kit-preview-react": "14.2.3",
|
|
23
|
+
"@workday/canvas-kit-react": "14.2.3",
|
|
24
|
+
"@workday/canvas-kit-react-fonts": "^14.2.3",
|
|
25
|
+
"@workday/canvas-kit-styling": "14.2.3",
|
|
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.2.
|
|
22
|
-
"@workday/canvas-kit-preview-react": "14.2.
|
|
23
|
-
"@workday/canvas-kit-react": "14.2.
|
|
24
|
-
"@workday/canvas-kit-react-fonts": "^14.2.
|
|
25
|
-
"@workday/canvas-kit-styling": "14.2.
|
|
21
|
+
"@workday/canvas-kit-labs-react": "14.2.3",
|
|
22
|
+
"@workday/canvas-kit-preview-react": "14.2.3",
|
|
23
|
+
"@workday/canvas-kit-react": "14.2.3",
|
|
24
|
+
"@workday/canvas-kit-react-fonts": "^14.2.3",
|
|
25
|
+
"@workday/canvas-kit-styling": "14.2.3",
|
|
26
26
|
"@workday/canvas-system-icons-web": "3.0.36",
|
|
27
27
|
"@workday/canvas-tokens-web": "3.1.2"
|
|
28
28
|
},
|
|
@@ -255,7 +255,7 @@ the target and popup to `4px`.
|
|
|
255
255
|
**PR:** [#2309](https://github.com/Workday/canvas-kit/pull/2309)
|
|
256
256
|
|
|
257
257
|
We've converted `Select` into a
|
|
258
|
-
[compound component](/
|
|
258
|
+
[compound component](/get-started/for-developers/documentation/compound-components/) which provides
|
|
259
259
|
a flexible API and access to its internals via its subcomponents.
|
|
260
260
|
|
|
261
261
|
```tsx
|
|
@@ -867,7 +867,7 @@ interface MyButtonProps extends ExtractProps<> {
|
|
|
867
867
|
|
|
868
868
|
### Card
|
|
869
869
|
|
|
870
|
-
Card is now a [compound component](/
|
|
870
|
+
Card is now a [compound component](/get-started/for-developers/documentation/compound-components/)
|
|
871
871
|
composed of a `Card.Body` and an optional `Card.Heading`. This allows direct access to the heading
|
|
872
872
|
and body elements.
|
|
873
873
|
|
|
@@ -1058,7 +1058,7 @@ There is no codemod for this change.
|
|
|
1058
1058
|
### Popups
|
|
1059
1059
|
|
|
1060
1060
|
Popup has transitioned to a
|
|
1061
|
-
[compound component](/
|
|
1061
|
+
[compound component](/get-started/for-developers/documentation/compound-components/), along with all
|
|
1062
1062
|
Popup-based behavior hooks. What was a `Popup` in v4 is now a `Popup.Card` in v5. The target button
|
|
1063
1063
|
and `Popper` components have also been converted to subcomponents of `Popup`.
|
|
1064
1064
|
|
|
@@ -1394,7 +1394,7 @@ const MyPopup = () => {
|
|
|
1394
1394
|
### Modal
|
|
1395
1395
|
|
|
1396
1396
|
Modal has transitioned to a
|
|
1397
|
-
[compound component](/
|
|
1397
|
+
[compound component](/get-started/for-developers/documentation/compound-components/). What was
|
|
1398
1398
|
`Modal` in v4 is now `Modal.Card` in v5.
|
|
1399
1399
|
|
|
1400
1400
|
#### v4
|
|
@@ -513,7 +513,7 @@ creating `ActionBar.List` subcomponent and replacing all `ActionBar` children to
|
|
|
513
513
|
|
|
514
514
|
### Banner
|
|
515
515
|
|
|
516
|
-
Banner is now a [compound component](/
|
|
516
|
+
Banner is now a [compound component](/get-started/for-developers/documentation/compound-components/)
|
|
517
517
|
composed of `Banner.Icon`, `Banner.Label`, and `Banner.ActionText`. This allows direct access to the
|
|
518
518
|
icon, label, and text elements.
|
|
519
519
|
|
|
@@ -532,7 +532,7 @@ icon, label, and text elements.
|
|
|
532
532
|
🤖 The codemod will rewrite your JSX to match the new API.
|
|
533
533
|
|
|
534
534
|
Like all compound components, `Banner` is written using the
|
|
535
|
-
[createComponent](/
|
|
535
|
+
[createComponent](/get-started/for-developers/documentation/creating-compound-components/#disclosurecontent-component)
|
|
536
536
|
utility from our
|
|
537
537
|
[common](https://github.com/Workday/canvas-kit/blob/ff77c5bd83e41c3ab2b9c55e41a8b7c1fde33a1b/modules/react/common/lib/utils/components.ts#L167)
|
|
538
538
|
module; it supports [ref forwarding](https://reactjs.org/docs/forwarding-refs.html) and using the
|
|
@@ -741,7 +741,7 @@ buttons or other buttons that aren't supported by our standard button components
|
|
|
741
741
|
|
|
742
742
|
We've updated `AccentIcon`, `AppletIcon`, `Graphic`, `Icon`, `Svg`, `SystemIcon`, and
|
|
743
743
|
`SystemIconCircle` to use the
|
|
744
|
-
[createComponent](/
|
|
744
|
+
[createComponent](/get-started/for-developers/documentation/creating-compound-components/#disclosurecontent-component)
|
|
745
745
|
utility from our
|
|
746
746
|
[common](https://github.com/Workday/canvas-kit/blob/ff77c5bd83e41c3ab2b9c55e41a8b7c1fde33a1b/modules/react/common/lib/utils/components.ts#L167)
|
|
747
747
|
module; they now support [ref forwarding](https://reactjs.org/docs/forwarding-refs.html) and using
|
|
@@ -915,7 +915,7 @@ codemod.
|
|
|
915
915
|
### Segmented Control
|
|
916
916
|
|
|
917
917
|
`SegmentedControl` is now a
|
|
918
|
-
[compound component](/
|
|
918
|
+
[compound component](/get-started/for-developers/documentation/compound-components/).
|
|
919
919
|
|
|
920
920
|
Given the [removal of `IconButton`](#removal-of-icon-button) in v7, you'll now need to use
|
|
921
921
|
`SegmentedControl.Button` instead.
|
|
@@ -191,7 +191,7 @@ const Example = styled('div')(
|
|
|
191
191
|
### Responsive Styles
|
|
192
192
|
|
|
193
193
|
We've added a set of
|
|
194
|
-
[responsive utilities](/
|
|
194
|
+
[responsive utilities](/get-started/for-developers/guides/responsive-styling/) to facilitate
|
|
195
195
|
container-based and viewport-based responsive styling:
|
|
196
196
|
|
|
197
197
|
- **useResponsiveContainerStyles**: A hook that allows developers to create container-based
|
|
@@ -253,7 +253,7 @@ return (
|
|
|
253
253
|
We've added a new `@workday/canvas-kit-react/testing` slash import to house our testing utilities
|
|
254
254
|
and components. You may find them useful for testing the different visual states of your components.
|
|
255
255
|
|
|
256
|
-
View the [Testing](/
|
|
256
|
+
View the [Testing](/get-started/for-developers/documentation/testing#visual-tests) documentation for more information. The example below
|
|
257
257
|
creates a visual states table of our `DeleteButton`. Each row renders a different size of
|
|
258
258
|
`DeleteButton` with each column representing different combinations of the `disabled`, `hover`, and
|
|
259
259
|
`active` states.
|
|
@@ -365,7 +365,7 @@ text with built-in support for our Canvas type tokens.
|
|
|
365
365
|
We've added a new version of
|
|
366
366
|
[`SegmentedControl`](https://workday.github.io/canvas-kit/?path=/docs/preview-segmented-control-react--basic)
|
|
367
367
|
which has been redesigned as a
|
|
368
|
-
[compound component](/
|
|
368
|
+
[compound component](/get-started/for-developers/documentation/compound-components/) to the Preview
|
|
369
369
|
package. `SegmentedControl` represents a linear group of multiple buttons allowing the selection of
|
|
370
370
|
a specific value and is best used for switching between different views of the same content.
|
|
371
371
|
|
|
@@ -417,7 +417,7 @@ You may still use `SegmentedControl` in the Main package, but note that it will
|
|
|
417
417
|
We've added a new version of
|
|
418
418
|
[`StatusIndicator`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator-react--basic)
|
|
419
419
|
which has been redesigned as a
|
|
420
|
-
[compound component](/
|
|
420
|
+
[compound component](/get-started/for-developers/documentation/compound-components/) to the Preview
|
|
421
421
|
package. `StatusIndicator` is best used for helping the user quickly identify the status of a task,
|
|
422
422
|
action, or page element.
|
|
423
423
|
|
|
@@ -671,7 +671,7 @@ const StyledBox = styled(Box)({
|
|
|
671
671
|
### Breadcrumbs
|
|
672
672
|
|
|
673
673
|
`Breadcrumbs` has been promoted to the Main package. It now uses the list system from our
|
|
674
|
-
[Collection API](/
|
|
674
|
+
[Collection API](/get-started/for-developers/guides/collection-api/) which provides new
|
|
675
675
|
overflow behavior based on container width.
|
|
676
676
|
|
|
677
677
|
The following code-moddable changes have been made to the `Breadcrumbs` API (see below for
|
|
@@ -98,7 +98,7 @@ finished.
|
|
|
98
98
|
### Table
|
|
99
99
|
|
|
100
100
|
We've introduced a new `Table`
|
|
101
|
-
[compound component](/
|
|
101
|
+
[compound component](/get-started/for-developers/documentation/compound-components/) to the Preview
|
|
102
102
|
package. `Table` is a compound component that is used to present information in a two-dimensional
|
|
103
103
|
[table](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table) comprised of rows and
|
|
104
104
|
columns of cells containing data.
|
|
@@ -374,7 +374,7 @@ previously in [Main](#main) (for reference, see
|
|
|
374
374
|
[`Toast`](https://d2krrudi3mmzzw.cloudfront.net/v8/?path=/docs/components-popups-toast--error) in
|
|
375
375
|
[Main](#main) from v8).
|
|
376
376
|
|
|
377
|
-
`Toast` is a [compound component](/
|
|
377
|
+
`Toast` is a [compound component](/get-started/for-developers/documentation/compound-components/)
|
|
378
378
|
which provides a flexible API and access to its internals via its subcomponents. It supports a new
|
|
379
379
|
`mode` prop which applies the proper accessibility features to the component based on the desired
|
|
380
380
|
mode: `status`, `alert`, or `dialog`.
|
|
@@ -148,7 +148,7 @@ dependencies, then it's required.
|
|
|
148
148
|
Canvas Kit uses [Jest](https://jestjs.io/) and
|
|
149
149
|
[React Testing Library](https://testing-library.com/docs/react-testing-library/intro) to unit test
|
|
150
150
|
our React components. For more information about our testing strategy and how we write unit tests,
|
|
151
|
-
visit our [Testing Readme](/
|
|
151
|
+
visit our [Testing Readme](/get-started/for-developers/documentation/testing/).
|
|
152
152
|
|
|
153
153
|
Canvas Kit uses [Cypress](https://cypress.io) for UI tests. For info on why we chose Cypress, visit
|
|
154
154
|
[Why Cypress?](https://github.com/Workday/canvas-kit/tree/master/cypress/WHY_CYPRESS.md) For more
|
|
@@ -188,9 +188,9 @@ Upon commit, [lint-staged](https://github.com/okonet/lint-staged) will run your
|
|
|
188
188
|
|
|
189
189
|
If creating a React module, a new compound component will be created. To find out more about
|
|
190
190
|
Compound Components, refer to
|
|
191
|
-
[Compound Components](/
|
|
191
|
+
[Compound Components](/get-started/for-developers/documentation/compound-components/). To find out
|
|
192
192
|
more about creating Compound Components, refer to
|
|
193
|
-
[Creating Compound Components](/
|
|
193
|
+
[Creating Compound Components](/get-started/for-developers/documentation/creating-compound-components/).
|
|
194
194
|
|
|
195
195
|
### Exporting a Module
|
|
196
196
|
|
|
@@ -214,7 +214,7 @@ This will start the unit tests.
|
|
|
214
214
|
### Code Style Guide
|
|
215
215
|
|
|
216
216
|
Refer to the
|
|
217
|
-
[API & Pattern Guidelines](/
|
|
217
|
+
[API & Pattern Guidelines](/get-started/for-developers/documentation/api-pattern-guidelines/).
|
|
218
218
|
|
|
219
219
|
Rules are enforced using [ESLint](https://eslint.org) and code formatting is provided through
|
|
220
220
|
[Prettier](https://prettier.io).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Building a Compound Component
|
|
2
2
|
|
|
3
3
|
Refer to the
|
|
4
|
-
[Compound Component documentation](/
|
|
4
|
+
[Compound Component documentation](/get-started/for-developers/documentation/compound-components/)
|
|
5
5
|
document to learn about what a compound component is.
|
|
6
6
|
|
|
7
7
|
This document will go through building a simplified Disclosure component to help solidify the
|
|
@@ -30,11 +30,11 @@ yarn add @workday/canvas-kit-preview-react
|
|
|
30
30
|
### Basic Example
|
|
31
31
|
|
|
32
32
|
`MultiSelect` supports a
|
|
33
|
-
[dynamic API](/
|
|
33
|
+
[dynamic API](/get-started/for-developers/guides/collection-api/#dynamic-items) where you
|
|
34
34
|
pass an array of items via the `items` prop and provide a render function to display the items. The
|
|
35
35
|
items may be provided as an
|
|
36
|
-
[array of strings](/
|
|
37
|
-
[array of objects](/
|
|
36
|
+
[array of strings](/get-started/for-developers/guides/collection-api/#array-of-strings) or an
|
|
37
|
+
[array of objects](/get-started/for-developers/guides/collection-api/#array-of-objects).
|
|
38
38
|
|
|
39
39
|
`MultiSelect` should be used in tandem with [Form Field](/components/inputs/form-field/) where the
|
|
40
40
|
`MultiSelect` wraps the `FormField` element and the `FormField` element wraps the children of
|
|
@@ -12,7 +12,7 @@ import Dynamic from './examples/Dynamic';
|
|
|
12
12
|
# Canvas Kit Segmented Control
|
|
13
13
|
|
|
14
14
|
Segmented Control is a
|
|
15
|
-
[compound component](/
|
|
15
|
+
[compound component](/get-started/for-developers/documentation/compound-components/) that represents
|
|
16
16
|
a linear group of multiple buttons allowing the selection of a specific value.
|
|
17
17
|
|
|
18
18
|
[> Workday Design Reference](https://design.workday.com/components/buttons/segmented-control)
|
|
@@ -124,7 +124,7 @@ Set the `disabled` prop of `SegmentedControl` to disable the entire component in
|
|
|
124
124
|
### Dynamic Items
|
|
125
125
|
|
|
126
126
|
`SegmentedControl` supports a
|
|
127
|
-
[dynamic API](/
|
|
127
|
+
[dynamic API](/get-started/for-developers/guides/collection-api/#dynamic-items) where instead
|
|
128
128
|
of statically providing the JSX for each `SegmentedControl.Item`, you pass an array of `items` in
|
|
129
129
|
the `model` state and provide a render function to display the items.
|
|
130
130
|
|
|
@@ -51,7 +51,7 @@ We **strongly** discourage using text in a `StatusIndicator` which will cause it
|
|
|
51
51
|
maximum width of `200px`. In situations where this cannot be avoided and text must be overflowed, we
|
|
52
52
|
suggest wrapping `StatusIndicator` in an `OverflowTooltip` and applying `tabIndex={0}` to it so the
|
|
53
53
|
overflowed text is accessible via keyboard and mouse. You may also override the default `maxWidth`
|
|
54
|
-
of `StatusIndicator` via [style props](/
|
|
54
|
+
of `StatusIndicator` via [style props](/get-started/for-developers/documentation/style-props/).
|
|
55
55
|
|
|
56
56
|
<ExampleCodeBlock code={Overflow} />
|
|
57
57
|
|
|
@@ -7,7 +7,7 @@ import OverflowActionBarCustomButtonCount from './examples/OverflowActionBarCust
|
|
|
7
7
|
|
|
8
8
|
# Canvas Kit Action Bar
|
|
9
9
|
|
|
10
|
-
Action Bar is a [compound component](/
|
|
10
|
+
Action Bar is a [compound component](/get-started/for-developers/documentation/compound-components/)
|
|
11
11
|
that contains primary and secondary actions related to a page or task.
|
|
12
12
|
|
|
13
13
|
[> Workday Design Reference](https://design.workday.com/components/buttons/action-bar)
|
|
@@ -13,7 +13,7 @@ import StickyRTL from './examples/StickyRTL';
|
|
|
13
13
|
|
|
14
14
|
# Canvas Kit Banner
|
|
15
15
|
|
|
16
|
-
`Banner` is a [compound component](/
|
|
16
|
+
`Banner` is a [compound component](/get-started/for-developers/documentation/compound-components/)
|
|
17
17
|
used surface important information and feedback to the user about a task, action, or state.
|
|
18
18
|
|
|
19
19
|
[> Workday Design Reference](https://design.workday.com/components/indicators/banners)
|
|
@@ -8,7 +8,7 @@ import LinkTruncation from './examples/LinkTruncation';
|
|
|
8
8
|
# Canvas Kit Breadcrumbs
|
|
9
9
|
|
|
10
10
|
Breadcrumbs is a
|
|
11
|
-
[compound component](/
|
|
11
|
+
[compound component](/get-started/for-developers/documentation/compound-components/) that allows
|
|
12
12
|
users to keep track and maintain awareness of their location as they navigate through pages,
|
|
13
13
|
folders, files, etc.
|
|
14
14
|
|
|
@@ -9,7 +9,7 @@ import WithStencils from './examples/Stencils';
|
|
|
9
9
|
# Canvas Kit Card
|
|
10
10
|
|
|
11
11
|
A Card is a preview that serves as an entry point to more detailed information. Card is a
|
|
12
|
-
presentational [compound component](/
|
|
12
|
+
presentational [compound component](/get-started/for-developers/documentation/compound-components/)
|
|
13
13
|
used as a building block for other components such as [Popup](/components/popups/popup/) and
|
|
14
14
|
[Modal](/components/popups/modal/).
|
|
15
15
|
|
|
@@ -10,7 +10,7 @@ import CreateComponent from './examples/CreateComponent';
|
|
|
10
10
|
# Compound Component Utilities
|
|
11
11
|
|
|
12
12
|
The following utilities are used to create and compose
|
|
13
|
-
[compound components](/
|
|
13
|
+
[compound components](/get-started/for-developers/documentation/compound-components/).
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
@@ -31,18 +31,18 @@ supports all `BoxProps` such as `padding`, it also supports semantic anchor elem
|
|
|
31
31
|
|
|
32
32
|
### Style Props
|
|
33
33
|
|
|
34
|
-
`Box` exposes [style props](/
|
|
34
|
+
`Box` exposes [style props](/get-started/for-developers/documentation/style-props/) that allow you
|
|
35
35
|
to modify styles in an ergonomic way across components. To learn more about individual sets of `Box`
|
|
36
36
|
style props, consult the lists below.
|
|
37
37
|
|
|
38
|
-
- [Background Style Props](/
|
|
39
|
-
- [Border Style Props](/
|
|
40
|
-
- [Color Style Props](/
|
|
41
|
-
- [Depth Style Props](/
|
|
42
|
-
- [Flex Item Style Props](/
|
|
43
|
-
- [Grid Item Style Props](/
|
|
44
|
-
- [Layout Style Props](/
|
|
45
|
-
- [Other Style Props](/
|
|
46
|
-
- [Position Style Props](/
|
|
47
|
-
- [Space Style Props](/
|
|
48
|
-
- [Text Style Props](/
|
|
38
|
+
- [Background Style Props](/get-started/for-developers/documentation/style-props/#background)
|
|
39
|
+
- [Border Style Props](/get-started/for-developers/documentation/style-props/#border)
|
|
40
|
+
- [Color Style Props](/get-started/for-developers/documentation/style-props/#color)
|
|
41
|
+
- [Depth Style Props](/get-started/for-developers/documentation/style-props/#depth)
|
|
42
|
+
- [Flex Item Style Props](/get-started/for-developers/documentation/style-props/#flex-item)
|
|
43
|
+
- [Grid Item Style Props](/get-started/for-developers/documentation/style-props/#grid-item)
|
|
44
|
+
- [Layout Style Props](/get-started/for-developers/documentation/style-props/#layout)
|
|
45
|
+
- [Other Style Props](/get-started/for-developers/documentation/style-props/#other)
|
|
46
|
+
- [Position Style Props](/get-started/for-developers/documentation/style-props/#position)
|
|
47
|
+
- [Space Style Props](/get-started/for-developers/documentation/style-props/#space)
|
|
48
|
+
- [Text Style Props](/get-started/for-developers/documentation/style-props/#text)
|
|
@@ -52,13 +52,13 @@ building layouts.
|
|
|
52
52
|
#### Props
|
|
53
53
|
|
|
54
54
|
`Flex` exposes
|
|
55
|
-
[flex container style props](/
|
|
55
|
+
[flex container style props](/get-started/for-developers/documentation/style-props/#flex) and `Box`
|
|
56
56
|
style props.
|
|
57
57
|
|
|
58
58
|
### Flex.Item
|
|
59
59
|
|
|
60
60
|
`Flex.Item` is a subcomponent of `Flex`. It is a `Box` component under the hood and exposes
|
|
61
|
-
[flex item style props](/
|
|
61
|
+
[flex item style props](/get-started/for-developers/documentation/style-props/#flex-item) that map
|
|
62
62
|
to CSS Flexbox Item properties. This provides greater control over how child components render in
|
|
63
63
|
your layout.
|
|
64
64
|
|
|
@@ -73,5 +73,5 @@ your layout.
|
|
|
73
73
|
#### Props
|
|
74
74
|
|
|
75
75
|
`Flex.Item` exposes
|
|
76
|
-
[flex item style props](/
|
|
76
|
+
[flex item style props](/get-started/for-developers/documentation/style-props/#flex-item) and `Box`
|
|
77
77
|
style props.
|
|
@@ -9,7 +9,7 @@ import GridLayoutInteractive from './examples/Grid/GridLayoutInteractive';
|
|
|
9
9
|
two-dimensional layouts (rows and columns) with
|
|
10
10
|
[CSS Grid](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Grids).
|
|
11
11
|
|
|
12
|
-
Please refer to our [layout examples](/examples
|
|
12
|
+
Please refer to our [layout examples](/examples-layouts--docs) for more examples of how to implement
|
|
13
13
|
different layouts using `Grid`.
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
@@ -96,13 +96,13 @@ layouts.
|
|
|
96
96
|
#### Props
|
|
97
97
|
|
|
98
98
|
`Grid` exposes
|
|
99
|
-
[grid container style props](/
|
|
99
|
+
[grid container style props](/get-started/for-developers/documentation/style-props/#grid) and `Box`
|
|
100
100
|
style props.
|
|
101
101
|
|
|
102
102
|
### Grid.Item
|
|
103
103
|
|
|
104
104
|
`Grid.Item` is a subcomponent of `Grid`. It is a `Box` component under the hood and exposes
|
|
105
|
-
[grid item style props](/
|
|
105
|
+
[grid item style props](/get-started/for-developers/documentation/style-props/#grid) that map to CSS
|
|
106
106
|
Grid Item properties. This provides greater control over how child components render in your layout.
|
|
107
107
|
|
|
108
108
|
```tsx
|
|
@@ -10,7 +10,7 @@ import RTL from './examples/RTL';
|
|
|
10
10
|
# Canvas Kit Pagination
|
|
11
11
|
|
|
12
12
|
`Pagination` is a
|
|
13
|
-
[compound component](/
|
|
13
|
+
[compound component](/get-started/for-developers/documentation/compound-components/) that allows
|
|
14
14
|
users to navigate between pages in a range.
|
|
15
15
|
|
|
16
16
|
[> Workday Design Reference](https://design.workday.com/components/navigation/pagination)
|
|
@@ -46,7 +46,7 @@ readers.
|
|
|
46
46
|
By default, `Pagination` will create and use its own [model](#model) internally. Alternatively, you
|
|
47
47
|
may configure your own model with `usePaginationModel` and pass it to `Pagination` via the `model`
|
|
48
48
|
prop. This pattern is referred to as
|
|
49
|
-
[hoisting the model](/
|
|
49
|
+
[hoisting the model](/get-started/for-developers/documentation/compound-components/#configuring-a-model)
|
|
50
50
|
and provides direct access to its `state` and `events` outside of the `Pagination` component.
|
|
51
51
|
|
|
52
52
|
In this example, we set up external observation of the model state and create an external button to
|
|
@@ -94,7 +94,7 @@ You can use `useResizeObserver` to accomplish this as in the example below.
|
|
|
94
94
|
## Model
|
|
95
95
|
|
|
96
96
|
If `Pagination` was stripped of all its markup, attributes, and styling, what would remain is the
|
|
97
|
-
[model](/
|
|
97
|
+
[model](/get-started/for-developers/documentation/compound-components/#models). The model is an
|
|
98
98
|
object composed of two parts: `state` which describes the current snapshot in time of the component
|
|
99
99
|
and `events` which describes events that can be sent to the model.
|
|
100
100
|
|
|
@@ -135,7 +135,7 @@ export const CustomPagination = () => {
|
|
|
135
135
|
Alternatively, if you need direct access to the model's `state` and `events` outside of the
|
|
136
136
|
`Pagination` component, you may configure your own model with `usePaginationModel` and pass it to
|
|
137
137
|
`Pagination` via a pattern called
|
|
138
|
-
[hoisting the model](/
|
|
138
|
+
[hoisting the model](/get-started/for-developers/documentation/compound-components/#configuring-a-model).
|
|
139
139
|
|
|
140
140
|
```tsx
|
|
141
141
|
const model = usePaginationModel({
|
|
@@ -44,7 +44,7 @@ yarn add @workday/canvas-kit-react
|
|
|
44
44
|
## Usage
|
|
45
45
|
|
|
46
46
|
The `Popup` component is a generic
|
|
47
|
-
[Compound Component](/
|
|
47
|
+
[Compound Component](/get-started/for-developers/documentation/compound-components/) that is used to
|
|
48
48
|
build popup UIs that are not already covered by Canvas Kit.
|
|
49
49
|
|
|
50
50
|
### Basic Example
|
|
@@ -40,11 +40,11 @@ yarn add @workday/canvas-kit-react
|
|
|
40
40
|
### Basic Example
|
|
41
41
|
|
|
42
42
|
`Select` supports a
|
|
43
|
-
[dynamic API](/
|
|
43
|
+
[dynamic API](/get-started/for-developers/guides/collection-api/#dynamic-items) where you
|
|
44
44
|
pass an array of items via the `items` prop and provide a render function to display the items. The
|
|
45
45
|
items may be provided as an
|
|
46
|
-
[array of strings](/
|
|
47
|
-
[array of objects](/
|
|
46
|
+
[array of strings](/get-started/for-developers/guides/collection-api/#array-of-strings) or an
|
|
47
|
+
[array of objects](/get-started/for-developers/guides/collection-api/#array-of-objects).
|
|
48
48
|
|
|
49
49
|
`Select` should be used in tandem with [Form Field](/components/inputs/form-field/) where the
|
|
50
50
|
`Select` wraps the `FormField` element and the `FormField` element wraps the children of `Select` to
|
|
@@ -74,7 +74,7 @@ value of the `Select`.
|
|
|
74
74
|
By default, `Select` will create and use its own model internally. Alternatively, you may configure
|
|
75
75
|
your own model with `useSelectModel` and pass it to `Select` via the `model` prop. This pattern is
|
|
76
76
|
referred to as
|
|
77
|
-
[hoisting the model](/
|
|
77
|
+
[hoisting the model](/get-started/for-developers/documentation/compound-components/#configuring-a-model)
|
|
78
78
|
and provides direct access to its `state` and `events` outside of the `Select` component.
|
|
79
79
|
|
|
80
80
|
In this example, we set up external observation of the model state and create an external button to
|
|
@@ -12,7 +12,7 @@ import DynamicTabs from './examples/DynamicTabs';
|
|
|
12
12
|
|
|
13
13
|
# Canvas Kit Tabs
|
|
14
14
|
|
|
15
|
-
`Tabs` is a [compound component](/
|
|
15
|
+
`Tabs` is a [compound component](/get-started/for-developers/documentation/compound-components/)
|
|
16
16
|
that allows users to navigate between related views of content while remaining in context of the
|
|
17
17
|
page.
|
|
18
18
|
|
|
@@ -57,7 +57,7 @@ should render.
|
|
|
57
57
|
By default, `Tabs` will create and use its own [model](#model) internally. Alternatively, you may
|
|
58
58
|
configure your own model with `useTabsModel` and pass it to `Tabs` via the `model` prop. This
|
|
59
59
|
pattern is referred to as
|
|
60
|
-
[hoisting the model](/
|
|
60
|
+
[hoisting the model](/get-started/for-developers/documentation/compound-components/#configuring-a-model)
|
|
61
61
|
and provides direct access to its `state` and `events` outside of the `Tabs` component.
|
|
62
62
|
|
|
63
63
|
In this example, we set up external observation of the model state and create an external button to
|
|
@@ -19,7 +19,7 @@ yarn add @workday/canvas-kit-react
|
|
|
19
19
|
### Basic Example
|
|
20
20
|
|
|
21
21
|
`Text` is built on top of [`Box`](/components/layout/box/) and supports a multitude of
|
|
22
|
-
[style props](/
|
|
22
|
+
[style props](/get-started/for-developers/documentation/style-props/) including spacing props such
|
|
23
23
|
as `margin` and `padding`, as well as text styling props such as `fontSize` and `fontWeight`.
|
|
24
24
|
|
|
25
25
|
`Text` renders a `<span>` element by default. You may override the rendered element using the `as`
|
|
@@ -9,7 +9,7 @@ import RTL from './examples/RTL';
|
|
|
9
9
|
|
|
10
10
|
# Canvas Kit Toast
|
|
11
11
|
|
|
12
|
-
`Toast` is a [compound component](/
|
|
12
|
+
`Toast` is a [compound component](/get-started/for-developers/documentation/compound-components/)
|
|
13
13
|
that contains updates or messages about the status of an application's process.
|
|
14
14
|
|
|
15
15
|
## Installation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "14.2.
|
|
3
|
+
"version": "14.2.3",
|
|
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": "^14.2.
|
|
49
|
-
"@workday/canvas-kit-preview-react": "^14.2.
|
|
50
|
-
"@workday/canvas-kit-react": "^14.2.
|
|
51
|
-
"@workday/canvas-kit-styling": "^14.2.
|
|
48
|
+
"@workday/canvas-kit-labs-react": "^14.2.3",
|
|
49
|
+
"@workday/canvas-kit-preview-react": "^14.2.3",
|
|
50
|
+
"@workday/canvas-kit-react": "^14.2.3",
|
|
51
|
+
"@workday/canvas-kit-styling": "^14.2.3",
|
|
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": "
|
|
64
|
+
"gitHead": "f397e48d3a320c73932e9d5d8dec6c0256c6ed8b"
|
|
65
65
|
}
|