@workday/canvas-kit-docs 12.0.0-alpha.903-next.0 → 12.0.0-alpha.906-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/docs.js
CHANGED
|
@@ -127583,7 +127583,6 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
127583
127583
|
"type": {
|
|
127584
127584
|
"kind": "enhancedComponent",
|
|
127585
127585
|
"componentType": "subcomponent",
|
|
127586
|
-
"elemPropsHook": "useFormFieldLabel",
|
|
127587
127586
|
"displayName": "FormFieldGroup.Label",
|
|
127588
127587
|
"props": [
|
|
127589
127588
|
{
|
|
@@ -130558,6 +130557,27 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
130558
130557
|
"tags": {},
|
|
130559
130558
|
"declarations": []
|
|
130560
130559
|
},
|
|
130560
|
+
{
|
|
130561
|
+
"kind": "property",
|
|
130562
|
+
"name": "aria-labelledby",
|
|
130563
|
+
"required": true,
|
|
130564
|
+
"type": {
|
|
130565
|
+
"kind": "union",
|
|
130566
|
+
"value": [
|
|
130567
|
+
{
|
|
130568
|
+
"kind": "primitive",
|
|
130569
|
+
"value": "string"
|
|
130570
|
+
},
|
|
130571
|
+
{
|
|
130572
|
+
"kind": "primitive",
|
|
130573
|
+
"value": "undefined"
|
|
130574
|
+
}
|
|
130575
|
+
]
|
|
130576
|
+
},
|
|
130577
|
+
"description": "",
|
|
130578
|
+
"tags": {},
|
|
130579
|
+
"declarations": []
|
|
130580
|
+
},
|
|
130561
130581
|
{
|
|
130562
130582
|
"kind": "property",
|
|
130563
130583
|
"name": "id",
|
|
@@ -130678,6 +130698,18 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
130678
130698
|
"description": "",
|
|
130679
130699
|
"tags": {},
|
|
130680
130700
|
"declarations": []
|
|
130701
|
+
},
|
|
130702
|
+
{
|
|
130703
|
+
"kind": "property",
|
|
130704
|
+
"name": "id",
|
|
130705
|
+
"required": true,
|
|
130706
|
+
"type": {
|
|
130707
|
+
"kind": "primitive",
|
|
130708
|
+
"value": "string"
|
|
130709
|
+
},
|
|
130710
|
+
"description": "",
|
|
130711
|
+
"tags": {},
|
|
130712
|
+
"declarations": []
|
|
130681
130713
|
}
|
|
130682
130714
|
]
|
|
130683
130715
|
}
|
|
@@ -130781,7 +130813,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
130781
130813
|
"name": "orientation",
|
|
130782
130814
|
"defaultValue": {
|
|
130783
130815
|
"kind": "string",
|
|
130784
|
-
"value": ""
|
|
130816
|
+
"value": "vertical"
|
|
130785
130817
|
},
|
|
130786
130818
|
"type": {
|
|
130787
130819
|
"kind": "union",
|
|
@@ -131031,7 +131063,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
131031
131063
|
"name": "orientation",
|
|
131032
131064
|
"defaultValue": {
|
|
131033
131065
|
"kind": "string",
|
|
131034
|
-
"value": ""
|
|
131066
|
+
"value": "vertical"
|
|
131035
131067
|
},
|
|
131036
131068
|
"type": {
|
|
131037
131069
|
"kind": "union",
|
|
@@ -274244,6 +274276,10 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
274244
274276
|
{
|
|
274245
274277
|
"kind": "typeParameter",
|
|
274246
274278
|
"name": "M",
|
|
274279
|
+
"defaultValue": {
|
|
274280
|
+
"kind": "object",
|
|
274281
|
+
"properties": []
|
|
274282
|
+
},
|
|
274247
274283
|
"constraint": {
|
|
274248
274284
|
"kind": "symbol",
|
|
274249
274285
|
"name": "StencilModifierConfig",
|
|
@@ -274255,17 +274291,21 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
274255
274291
|
],
|
|
274256
274292
|
"value": "StencilModifierConfig<V, E>"
|
|
274257
274293
|
},
|
|
274258
|
-
"required":
|
|
274294
|
+
"required": false
|
|
274259
274295
|
},
|
|
274260
274296
|
{
|
|
274261
274297
|
"kind": "typeParameter",
|
|
274262
274298
|
"name": "V",
|
|
274299
|
+
"defaultValue": {
|
|
274300
|
+
"kind": "object",
|
|
274301
|
+
"properties": []
|
|
274302
|
+
},
|
|
274263
274303
|
"constraint": {
|
|
274264
274304
|
"kind": "symbol",
|
|
274265
274305
|
"name": "DefaultedVarsShape",
|
|
274266
274306
|
"value": "DefaultedVarsShape"
|
|
274267
274307
|
},
|
|
274268
|
-
"required":
|
|
274308
|
+
"required": false
|
|
274269
274309
|
},
|
|
274270
274310
|
{
|
|
274271
274311
|
"kind": "typeParameter",
|
|
@@ -274590,6 +274630,10 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
274590
274630
|
{
|
|
274591
274631
|
"kind": "typeParameter",
|
|
274592
274632
|
"name": "M",
|
|
274633
|
+
"defaultValue": {
|
|
274634
|
+
"kind": "object",
|
|
274635
|
+
"properties": []
|
|
274636
|
+
},
|
|
274593
274637
|
"constraint": {
|
|
274594
274638
|
"kind": "symbol",
|
|
274595
274639
|
"name": "StencilModifierConfig",
|
|
@@ -274605,17 +274649,21 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
274605
274649
|
],
|
|
274606
274650
|
"value": "StencilModifierConfig<V, E>"
|
|
274607
274651
|
},
|
|
274608
|
-
"required":
|
|
274652
|
+
"required": false
|
|
274609
274653
|
},
|
|
274610
274654
|
{
|
|
274611
274655
|
"kind": "typeParameter",
|
|
274612
274656
|
"name": "V",
|
|
274657
|
+
"defaultValue": {
|
|
274658
|
+
"kind": "object",
|
|
274659
|
+
"properties": []
|
|
274660
|
+
},
|
|
274613
274661
|
"constraint": {
|
|
274614
274662
|
"kind": "symbol",
|
|
274615
274663
|
"name": "DefaultedVarsShape",
|
|
274616
274664
|
"value": "DefaultedVarsShape"
|
|
274617
274665
|
},
|
|
274618
|
-
"required":
|
|
274666
|
+
"required": false
|
|
274619
274667
|
},
|
|
274620
274668
|
{
|
|
274621
274669
|
"kind": "typeParameter",
|
|
@@ -34,8 +34,8 @@ const myButtonStencil = createStencil({
|
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
const MyCustomButton = createComponent('button')({
|
|
37
|
-
Component: ({children, ...elemProps}: PrimaryButtonProps, ref, Element) => (
|
|
38
|
-
<PrimaryButton as={Element} ref={ref} {
|
|
37
|
+
Component: ({children, cs, ...elemProps}: PrimaryButtonProps, ref, Element) => (
|
|
38
|
+
<PrimaryButton as={Element} ref={ref} cs={[myButtonStencil(), cs]} {...elemProps}>
|
|
39
39
|
{children}
|
|
40
40
|
</PrimaryButton>
|
|
41
41
|
),
|
|
@@ -24,6 +24,6 @@ export default () => (
|
|
|
24
24
|
<PrimaryButton icon={caretDownIcon} iconPosition="end">
|
|
25
25
|
Primary
|
|
26
26
|
</PrimaryButton>
|
|
27
|
-
<PrimaryButton aria-label="
|
|
27
|
+
<PrimaryButton aria-label="Related Actions" icon={relatedActionsVerticalIcon} />
|
|
28
28
|
</Flex>
|
|
29
29
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
1
|
+
import {ExampleCodeBlock, Specifications, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
2
2
|
import Basic from './examples/Basic';
|
|
3
3
|
import Alert from './examples/Alert';
|
|
4
4
|
import Error from './examples/Error';
|
|
@@ -27,6 +27,43 @@ by passing in `TextInput`, `Select`, `RadioGroup` and other form elements to `Fo
|
|
|
27
27
|
yarn add @workday/canvas-kit-react
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
## Accessibility
|
|
31
|
+
|
|
32
|
+
The `FormField` adds a `for` attribute to the `FormField.Label` (`<label>` element) element that
|
|
33
|
+
matches the `id` attribute of the `FormField.Input` which is usually a `input` element. This both
|
|
34
|
+
labels the input for screen readers and other assitive technology as well as will focus on the input
|
|
35
|
+
when the user clicks on the label. If your form field input component is more complicated, the
|
|
36
|
+
`FormField` will also add an `id` to the `FormField.Label` and an `aria-labelledby` to the
|
|
37
|
+
`FormField.Input` component. You can then forward the `aria-labelledby` to whatever elements you
|
|
38
|
+
need for the proper accessibility.
|
|
39
|
+
|
|
40
|
+
For example, the DOM will look something like this:
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<div>
|
|
44
|
+
<label id="label-abc" for="input-abc">First Name</label>
|
|
45
|
+
<input id="input-abc" aria-labelledby="label-abc" />
|
|
46
|
+
</div>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Some components, like `MultiSelect`, have an additional `role=listbox` element that also needs to
|
|
50
|
+
link to the `label` element. The resulting DOM will look something like:
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<div>
|
|
54
|
+
<label id="label-abc" for="input-abc">States you've lived in</label>
|
|
55
|
+
<input id="input-abc" aria-labelledby="label-abc" role="combobox" ... />
|
|
56
|
+
<ul role="listbox" aria-labelledby="label-abc">
|
|
57
|
+
<li>Texas</li>
|
|
58
|
+
<li>California</li>
|
|
59
|
+
</ul>
|
|
60
|
+
</div>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The `MultiSelect` component gets the `aria-labelledby` from the `FormField.Input` and forwards it to
|
|
64
|
+
both the `input[role=combobox]` element and the `ul[role=listbox]` element so the screen reader
|
|
65
|
+
knows the label for both is "States you've lived in".
|
|
66
|
+
|
|
30
67
|
## Usage
|
|
31
68
|
|
|
32
69
|
### Basic
|
|
@@ -161,4 +198,8 @@ check our
|
|
|
161
198
|
|
|
162
199
|
## Component API
|
|
163
200
|
|
|
164
|
-
<SymbolDoc name="FormField" fileName="/preview-react/" />
|
|
201
|
+
<SymbolDoc name="FormField" fileName="/preview-react/" />
|
|
202
|
+
|
|
203
|
+
## Specifications
|
|
204
|
+
|
|
205
|
+
<Specifications file="FormField.spec.tsx" name="FormField" />
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "12.0.0-alpha.
|
|
3
|
+
"version": "12.0.0-alpha.906-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",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@emotion/styled": "^11.6.0",
|
|
46
46
|
"@storybook/csf": "0.0.1",
|
|
47
|
-
"@workday/canvas-kit-labs-react": "^12.0.0-alpha.
|
|
48
|
-
"@workday/canvas-kit-preview-react": "^12.0.0-alpha.
|
|
49
|
-
"@workday/canvas-kit-react": "^12.0.0-alpha.
|
|
50
|
-
"@workday/canvas-kit-styling": "^12.0.0-alpha.
|
|
47
|
+
"@workday/canvas-kit-labs-react": "^12.0.0-alpha.906-next.0",
|
|
48
|
+
"@workday/canvas-kit-preview-react": "^12.0.0-alpha.906-next.0",
|
|
49
|
+
"@workday/canvas-kit-react": "^12.0.0-alpha.906-next.0",
|
|
50
|
+
"@workday/canvas-kit-styling": "^12.0.0-alpha.906-next.0",
|
|
51
51
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
52
52
|
"@workday/canvas-tokens-web": "^2.0.1",
|
|
53
53
|
"markdown-to-jsx": "^7.2.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"mkdirp": "^1.0.3",
|
|
61
61
|
"typescript": "4.9"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "b796b56840b04395e0b4f4d643cad66be4103936"
|
|
64
64
|
}
|