@workday/canvas-kit-docs 6.0.0-alpha.0-next.33 → 6.0.0-alpha.0-next.39
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/commonjs/lib/specs.js +224 -2
- package/dist/es6/lib/specs.js +224 -2
- package/dist/mdx/5.0-MIGRATION-GUIDE.mdx +81 -7
- package/dist/mdx/6.0-MIGRATION-GUIDE.mdx +18 -12
- package/dist/mdx/7.0-MIGRATION-GUIDE.mdx +33 -0
- package/dist/mdx/preview-react/form-field/FormField.mdx +27 -0
- package/dist/mdx/preview-react/form-field/examples/Custom.tsx +57 -0
- package/dist/mdx/preview-react/text-area/TextArea.mdx +122 -0
- package/dist/mdx/preview-react/text-area/examples/Alert.tsx +31 -0
- package/dist/mdx/preview-react/text-area/examples/Basic.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/Disabled.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/Error.tsx +40 -0
- package/dist/mdx/preview-react/text-area/examples/Grow.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/HiddenLabel.tsx +20 -0
- package/dist/mdx/preview-react/text-area/examples/LabelPositionHorizontal.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/LabelPositionVertical.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/Placeholder.tsx +21 -0
- package/dist/mdx/preview-react/text-area/examples/RefForwarding.tsx +28 -0
- package/dist/mdx/preview-react/text-area/examples/Required.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/ResizeConstraints.tsx +22 -0
- package/dist/mdx/{labs-react → preview-react}/text-input/TextInput.mdx +40 -18
- package/dist/mdx/preview-react/text-input/examples/Alert.tsx +40 -0
- package/dist/mdx/{labs-react/text-input/examples/HiddenLabel.tsx → preview-react/text-input/examples/Basic.tsx} +3 -3
- package/dist/mdx/preview-react/text-input/examples/Disabled.tsx +17 -0
- package/dist/mdx/{labs-react → preview-react}/text-input/examples/Error.tsx +6 -9
- package/dist/mdx/preview-react/text-input/examples/Grow.tsx +17 -0
- package/dist/mdx/preview-react/text-input/examples/HiddenLabel.tsx +20 -0
- package/dist/mdx/preview-react/text-input/examples/LabelPositionHorizontal.tsx +17 -0
- package/dist/mdx/preview-react/text-input/examples/LabelPositionVertical.tsx +17 -0
- package/dist/mdx/{labs-react → preview-react}/text-input/examples/LoginForm.tsx +10 -5
- package/dist/mdx/preview-react/text-input/examples/Password.tsx +17 -0
- package/dist/mdx/preview-react/text-input/examples/Placeholder.tsx +17 -0
- package/dist/mdx/{labs-react → preview-react}/text-input/examples/RefForwarding.tsx +7 -6
- package/dist/mdx/preview-react/text-input/examples/Required.tsx +17 -0
- package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +46 -0
- package/dist/mdx/{labs-react → preview-react}/text-input/examples/ThemedError.tsx +8 -11
- package/dist/mdx/react/_examples/GlobalHeader.mdx +9 -0
- package/dist/mdx/react/_examples/PageHeader.mdx +8 -0
- package/dist/mdx/react/_examples/examples/GlobalHeader.tsx +66 -0
- package/dist/mdx/react/_examples/examples/PageHeader.tsx +63 -0
- package/dist/mdx/react/banner/Banner.mdx +203 -19
- package/dist/mdx/react/banner/PropTables.splitprops.tsx +39 -0
- package/dist/mdx/react/banner/examples/ActionText.tsx +8 -1
- package/dist/mdx/react/banner/examples/Basic.tsx +8 -1
- package/dist/mdx/react/banner/examples/Error.tsx +8 -1
- package/dist/mdx/react/banner/examples/RefForwarding.tsx +25 -0
- package/dist/mdx/react/banner/examples/Sticky.tsx +15 -7
- package/dist/mdx/react/banner/examples/StickyAnimation.tsx +62 -0
- package/dist/mdx/react/banner/examples/StickyRTL.tsx +38 -0
- package/dist/mdx/react/banner/examples/ThemedAlert.tsx +28 -0
- package/dist/mdx/react/banner/examples/ThemedError.tsx +29 -0
- package/dist/mdx/react/button/button/examples/Primary.tsx +4 -3
- package/dist/mdx/react/loading-animation/LoadingAnimation.mdx +5 -0
- package/dist/mdx/react/loading-animation/examples/RTL.tsx +16 -0
- package/dist/mdx/react/tabs/examples/DynamicTabs.tsx +50 -34
- package/dist/mdx/react/tooltip/Tooltip.mdx +8 -0
- package/dist/mdx/react/tooltip/examples/DelayedTooltip.tsx +16 -0
- package/package.json +5 -4
- package/dist/mdx/labs-react/text-input/examples/Alert.tsx +0 -46
- package/dist/mdx/labs-react/text-input/examples/Basic.tsx +0 -20
- package/dist/mdx/labs-react/text-input/examples/Disabled.tsx +0 -20
- package/dist/mdx/labs-react/text-input/examples/Grow.tsx +0 -20
- package/dist/mdx/labs-react/text-input/examples/LabelPosition.tsx +0 -20
- package/dist/mdx/labs-react/text-input/examples/Password.tsx +0 -20
- package/dist/mdx/labs-react/text-input/examples/Placeholder.tsx +0 -20
- package/dist/mdx/labs-react/text-input/examples/Required.tsx +0 -20
- package/dist/mdx/labs-react/text-input/examples/ThemedAlert.tsx +0 -51
|
@@ -41,6 +41,62 @@ module.exports = {specifications: [
|
|
|
41
41
|
}
|
|
42
42
|
]
|
|
43
43
|
},
|
|
44
|
+
{
|
|
45
|
+
"type": "file",
|
|
46
|
+
"name": "Banner.spec.ts",
|
|
47
|
+
"children": [
|
|
48
|
+
{
|
|
49
|
+
"type": "describe",
|
|
50
|
+
"name": "Banner",
|
|
51
|
+
"children": [
|
|
52
|
+
{
|
|
53
|
+
"type": "describe",
|
|
54
|
+
"name": "given the [Components/Indicators/Banner/React, Error] story is rendered",
|
|
55
|
+
"children": [
|
|
56
|
+
{
|
|
57
|
+
"type": "it",
|
|
58
|
+
"name": "should pass axe checks"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"type": "it",
|
|
62
|
+
"name": "should have an element with a role of \"button\""
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"type": "it",
|
|
66
|
+
"name": "should have an \"aria-labelledby\" that matches the action"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"type": "it",
|
|
70
|
+
"name": "should have an \"aria-describedby\" that matches the label"
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"type": "describe",
|
|
76
|
+
"name": "given the [Components/Indicators/Banner/React, Sticky] story is rendered",
|
|
77
|
+
"children": [
|
|
78
|
+
{
|
|
79
|
+
"type": "it",
|
|
80
|
+
"name": "should pass axe checks"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"type": "it",
|
|
84
|
+
"name": "should have an element with a role of \"button\""
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"type": "it",
|
|
88
|
+
"name": "should have an \"aria-labelledby\" that matches the action"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"type": "it",
|
|
92
|
+
"name": "should have an \"aria-describedby\" that matches the label"
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
44
100
|
{
|
|
45
101
|
"type": "file",
|
|
46
102
|
"name": "Breadcrumbs.spec.ts",
|
|
@@ -5185,6 +5241,22 @@ module.exports = {specifications: [
|
|
|
5185
5241
|
"type": "it",
|
|
5186
5242
|
"name": "should not show the \"More\" button"
|
|
5187
5243
|
},
|
|
5244
|
+
{
|
|
5245
|
+
"type": "describe",
|
|
5246
|
+
"name": "when the \"First Tab\" is focused",
|
|
5247
|
+
"children": [
|
|
5248
|
+
{
|
|
5249
|
+
"type": "describe",
|
|
5250
|
+
"name": "when the Tab key is pressed",
|
|
5251
|
+
"children": [
|
|
5252
|
+
{
|
|
5253
|
+
"type": "it",
|
|
5254
|
+
"name": "should focus on the tab panel"
|
|
5255
|
+
}
|
|
5256
|
+
]
|
|
5257
|
+
}
|
|
5258
|
+
]
|
|
5259
|
+
},
|
|
5188
5260
|
{
|
|
5189
5261
|
"type": "describe",
|
|
5190
5262
|
"name": "when tab list container is only 500px wide",
|
|
@@ -5197,6 +5269,22 @@ module.exports = {specifications: [
|
|
|
5197
5269
|
"type": "it",
|
|
5198
5270
|
"name": "should show the \"More\" button"
|
|
5199
5271
|
},
|
|
5272
|
+
{
|
|
5273
|
+
"type": "describe",
|
|
5274
|
+
"name": "when the \"First Tab\" is focused",
|
|
5275
|
+
"children": [
|
|
5276
|
+
{
|
|
5277
|
+
"type": "describe",
|
|
5278
|
+
"name": "when the Tab key is pressed",
|
|
5279
|
+
"children": [
|
|
5280
|
+
{
|
|
5281
|
+
"type": "it",
|
|
5282
|
+
"name": "should focus on the \"More\" button"
|
|
5283
|
+
}
|
|
5284
|
+
]
|
|
5285
|
+
}
|
|
5286
|
+
]
|
|
5287
|
+
},
|
|
5200
5288
|
{
|
|
5201
5289
|
"type": "describe",
|
|
5202
5290
|
"name": "when the \"More\" button is clicked",
|
|
@@ -5363,6 +5451,140 @@ module.exports = {specifications: [
|
|
|
5363
5451
|
}
|
|
5364
5452
|
]
|
|
5365
5453
|
},
|
|
5454
|
+
{
|
|
5455
|
+
"type": "file",
|
|
5456
|
+
"name": "TextAreaPreview.spec.ts",
|
|
5457
|
+
"children": [
|
|
5458
|
+
{
|
|
5459
|
+
"type": "describe",
|
|
5460
|
+
"name": "Text Area",
|
|
5461
|
+
"children": [
|
|
5462
|
+
{
|
|
5463
|
+
"type": "describe",
|
|
5464
|
+
"name": "given the 'Basic' story is rendered",
|
|
5465
|
+
"children": [
|
|
5466
|
+
{
|
|
5467
|
+
"type": "it",
|
|
5468
|
+
"name": "should not have any axe errors"
|
|
5469
|
+
},
|
|
5470
|
+
{
|
|
5471
|
+
"type": "describe",
|
|
5472
|
+
"name": "when clicked",
|
|
5473
|
+
"children": [
|
|
5474
|
+
{
|
|
5475
|
+
"type": "it",
|
|
5476
|
+
"name": "should be focused"
|
|
5477
|
+
}
|
|
5478
|
+
]
|
|
5479
|
+
},
|
|
5480
|
+
{
|
|
5481
|
+
"type": "describe",
|
|
5482
|
+
"name": "when text is entered",
|
|
5483
|
+
"children": [
|
|
5484
|
+
{
|
|
5485
|
+
"type": "it",
|
|
5486
|
+
"name": "should reflect the text typed"
|
|
5487
|
+
}
|
|
5488
|
+
]
|
|
5489
|
+
}
|
|
5490
|
+
]
|
|
5491
|
+
},
|
|
5492
|
+
{
|
|
5493
|
+
"type": "describe",
|
|
5494
|
+
"name": "given the 'Alert' story is rendered",
|
|
5495
|
+
"children": [
|
|
5496
|
+
{
|
|
5497
|
+
"type": "it",
|
|
5498
|
+
"name": "should not have any axe errors"
|
|
5499
|
+
},
|
|
5500
|
+
{
|
|
5501
|
+
"type": "describe",
|
|
5502
|
+
"name": "when clicked",
|
|
5503
|
+
"children": [
|
|
5504
|
+
{
|
|
5505
|
+
"type": "it",
|
|
5506
|
+
"name": "should be focused"
|
|
5507
|
+
}
|
|
5508
|
+
]
|
|
5509
|
+
},
|
|
5510
|
+
{
|
|
5511
|
+
"type": "describe",
|
|
5512
|
+
"name": "when text is entered",
|
|
5513
|
+
"children": [
|
|
5514
|
+
{
|
|
5515
|
+
"type": "it",
|
|
5516
|
+
"name": "should reflect the text typed"
|
|
5517
|
+
}
|
|
5518
|
+
]
|
|
5519
|
+
}
|
|
5520
|
+
]
|
|
5521
|
+
},
|
|
5522
|
+
{
|
|
5523
|
+
"type": "describe",
|
|
5524
|
+
"name": "given the 'Error' story is rendered",
|
|
5525
|
+
"children": [
|
|
5526
|
+
{
|
|
5527
|
+
"type": "it",
|
|
5528
|
+
"name": "should not have any axe errors"
|
|
5529
|
+
},
|
|
5530
|
+
{
|
|
5531
|
+
"type": "describe",
|
|
5532
|
+
"name": "when clicked",
|
|
5533
|
+
"children": [
|
|
5534
|
+
{
|
|
5535
|
+
"type": "it",
|
|
5536
|
+
"name": "should be focused"
|
|
5537
|
+
}
|
|
5538
|
+
]
|
|
5539
|
+
},
|
|
5540
|
+
{
|
|
5541
|
+
"type": "describe",
|
|
5542
|
+
"name": "when text is entered",
|
|
5543
|
+
"children": [
|
|
5544
|
+
{
|
|
5545
|
+
"type": "it",
|
|
5546
|
+
"name": "should reflect the text typed"
|
|
5547
|
+
}
|
|
5548
|
+
]
|
|
5549
|
+
}
|
|
5550
|
+
]
|
|
5551
|
+
},
|
|
5552
|
+
{
|
|
5553
|
+
"type": "describe",
|
|
5554
|
+
"name": "given the 'Disabled' story is rendered",
|
|
5555
|
+
"children": [
|
|
5556
|
+
{
|
|
5557
|
+
"type": "it",
|
|
5558
|
+
"name": "should not have any axe errors"
|
|
5559
|
+
},
|
|
5560
|
+
{
|
|
5561
|
+
"type": "it",
|
|
5562
|
+
"name": "should be disabled"
|
|
5563
|
+
}
|
|
5564
|
+
]
|
|
5565
|
+
},
|
|
5566
|
+
{
|
|
5567
|
+
"type": "describe",
|
|
5568
|
+
"name": "given the 'Placeholder' story is rendered",
|
|
5569
|
+
"children": [
|
|
5570
|
+
{
|
|
5571
|
+
"type": "it",
|
|
5572
|
+
"name": "should not have any axe errors"
|
|
5573
|
+
},
|
|
5574
|
+
{
|
|
5575
|
+
"type": "it",
|
|
5576
|
+
"name": "should render a placeholder text"
|
|
5577
|
+
},
|
|
5578
|
+
{
|
|
5579
|
+
"type": "it",
|
|
5580
|
+
"name": "should reflect the text typed"
|
|
5581
|
+
}
|
|
5582
|
+
]
|
|
5583
|
+
}
|
|
5584
|
+
]
|
|
5585
|
+
}
|
|
5586
|
+
]
|
|
5587
|
+
},
|
|
5366
5588
|
{
|
|
5367
5589
|
"type": "file",
|
|
5368
5590
|
"name": "TextInput.spec.ts",
|
|
@@ -5499,11 +5721,11 @@ module.exports = {specifications: [
|
|
|
5499
5721
|
},
|
|
5500
5722
|
{
|
|
5501
5723
|
"type": "file",
|
|
5502
|
-
"name": "
|
|
5724
|
+
"name": "TextInputPreview.spec.ts",
|
|
5503
5725
|
"children": [
|
|
5504
5726
|
{
|
|
5505
5727
|
"type": "describe",
|
|
5506
|
-
"name": "
|
|
5728
|
+
"name": "Text Input",
|
|
5507
5729
|
"children": [
|
|
5508
5730
|
{
|
|
5509
5731
|
"type": "describe",
|
package/dist/es6/lib/specs.js
CHANGED
|
@@ -41,6 +41,62 @@ module.exports = {specifications: [
|
|
|
41
41
|
}
|
|
42
42
|
]
|
|
43
43
|
},
|
|
44
|
+
{
|
|
45
|
+
"type": "file",
|
|
46
|
+
"name": "Banner.spec.ts",
|
|
47
|
+
"children": [
|
|
48
|
+
{
|
|
49
|
+
"type": "describe",
|
|
50
|
+
"name": "Banner",
|
|
51
|
+
"children": [
|
|
52
|
+
{
|
|
53
|
+
"type": "describe",
|
|
54
|
+
"name": "given the [Components/Indicators/Banner/React, Error] story is rendered",
|
|
55
|
+
"children": [
|
|
56
|
+
{
|
|
57
|
+
"type": "it",
|
|
58
|
+
"name": "should pass axe checks"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"type": "it",
|
|
62
|
+
"name": "should have an element with a role of \"button\""
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"type": "it",
|
|
66
|
+
"name": "should have an \"aria-labelledby\" that matches the action"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"type": "it",
|
|
70
|
+
"name": "should have an \"aria-describedby\" that matches the label"
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"type": "describe",
|
|
76
|
+
"name": "given the [Components/Indicators/Banner/React, Sticky] story is rendered",
|
|
77
|
+
"children": [
|
|
78
|
+
{
|
|
79
|
+
"type": "it",
|
|
80
|
+
"name": "should pass axe checks"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"type": "it",
|
|
84
|
+
"name": "should have an element with a role of \"button\""
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"type": "it",
|
|
88
|
+
"name": "should have an \"aria-labelledby\" that matches the action"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"type": "it",
|
|
92
|
+
"name": "should have an \"aria-describedby\" that matches the label"
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
44
100
|
{
|
|
45
101
|
"type": "file",
|
|
46
102
|
"name": "Breadcrumbs.spec.ts",
|
|
@@ -5185,6 +5241,22 @@ module.exports = {specifications: [
|
|
|
5185
5241
|
"type": "it",
|
|
5186
5242
|
"name": "should not show the \"More\" button"
|
|
5187
5243
|
},
|
|
5244
|
+
{
|
|
5245
|
+
"type": "describe",
|
|
5246
|
+
"name": "when the \"First Tab\" is focused",
|
|
5247
|
+
"children": [
|
|
5248
|
+
{
|
|
5249
|
+
"type": "describe",
|
|
5250
|
+
"name": "when the Tab key is pressed",
|
|
5251
|
+
"children": [
|
|
5252
|
+
{
|
|
5253
|
+
"type": "it",
|
|
5254
|
+
"name": "should focus on the tab panel"
|
|
5255
|
+
}
|
|
5256
|
+
]
|
|
5257
|
+
}
|
|
5258
|
+
]
|
|
5259
|
+
},
|
|
5188
5260
|
{
|
|
5189
5261
|
"type": "describe",
|
|
5190
5262
|
"name": "when tab list container is only 500px wide",
|
|
@@ -5197,6 +5269,22 @@ module.exports = {specifications: [
|
|
|
5197
5269
|
"type": "it",
|
|
5198
5270
|
"name": "should show the \"More\" button"
|
|
5199
5271
|
},
|
|
5272
|
+
{
|
|
5273
|
+
"type": "describe",
|
|
5274
|
+
"name": "when the \"First Tab\" is focused",
|
|
5275
|
+
"children": [
|
|
5276
|
+
{
|
|
5277
|
+
"type": "describe",
|
|
5278
|
+
"name": "when the Tab key is pressed",
|
|
5279
|
+
"children": [
|
|
5280
|
+
{
|
|
5281
|
+
"type": "it",
|
|
5282
|
+
"name": "should focus on the \"More\" button"
|
|
5283
|
+
}
|
|
5284
|
+
]
|
|
5285
|
+
}
|
|
5286
|
+
]
|
|
5287
|
+
},
|
|
5200
5288
|
{
|
|
5201
5289
|
"type": "describe",
|
|
5202
5290
|
"name": "when the \"More\" button is clicked",
|
|
@@ -5363,6 +5451,140 @@ module.exports = {specifications: [
|
|
|
5363
5451
|
}
|
|
5364
5452
|
]
|
|
5365
5453
|
},
|
|
5454
|
+
{
|
|
5455
|
+
"type": "file",
|
|
5456
|
+
"name": "TextAreaPreview.spec.ts",
|
|
5457
|
+
"children": [
|
|
5458
|
+
{
|
|
5459
|
+
"type": "describe",
|
|
5460
|
+
"name": "Text Area",
|
|
5461
|
+
"children": [
|
|
5462
|
+
{
|
|
5463
|
+
"type": "describe",
|
|
5464
|
+
"name": "given the 'Basic' story is rendered",
|
|
5465
|
+
"children": [
|
|
5466
|
+
{
|
|
5467
|
+
"type": "it",
|
|
5468
|
+
"name": "should not have any axe errors"
|
|
5469
|
+
},
|
|
5470
|
+
{
|
|
5471
|
+
"type": "describe",
|
|
5472
|
+
"name": "when clicked",
|
|
5473
|
+
"children": [
|
|
5474
|
+
{
|
|
5475
|
+
"type": "it",
|
|
5476
|
+
"name": "should be focused"
|
|
5477
|
+
}
|
|
5478
|
+
]
|
|
5479
|
+
},
|
|
5480
|
+
{
|
|
5481
|
+
"type": "describe",
|
|
5482
|
+
"name": "when text is entered",
|
|
5483
|
+
"children": [
|
|
5484
|
+
{
|
|
5485
|
+
"type": "it",
|
|
5486
|
+
"name": "should reflect the text typed"
|
|
5487
|
+
}
|
|
5488
|
+
]
|
|
5489
|
+
}
|
|
5490
|
+
]
|
|
5491
|
+
},
|
|
5492
|
+
{
|
|
5493
|
+
"type": "describe",
|
|
5494
|
+
"name": "given the 'Alert' story is rendered",
|
|
5495
|
+
"children": [
|
|
5496
|
+
{
|
|
5497
|
+
"type": "it",
|
|
5498
|
+
"name": "should not have any axe errors"
|
|
5499
|
+
},
|
|
5500
|
+
{
|
|
5501
|
+
"type": "describe",
|
|
5502
|
+
"name": "when clicked",
|
|
5503
|
+
"children": [
|
|
5504
|
+
{
|
|
5505
|
+
"type": "it",
|
|
5506
|
+
"name": "should be focused"
|
|
5507
|
+
}
|
|
5508
|
+
]
|
|
5509
|
+
},
|
|
5510
|
+
{
|
|
5511
|
+
"type": "describe",
|
|
5512
|
+
"name": "when text is entered",
|
|
5513
|
+
"children": [
|
|
5514
|
+
{
|
|
5515
|
+
"type": "it",
|
|
5516
|
+
"name": "should reflect the text typed"
|
|
5517
|
+
}
|
|
5518
|
+
]
|
|
5519
|
+
}
|
|
5520
|
+
]
|
|
5521
|
+
},
|
|
5522
|
+
{
|
|
5523
|
+
"type": "describe",
|
|
5524
|
+
"name": "given the 'Error' story is rendered",
|
|
5525
|
+
"children": [
|
|
5526
|
+
{
|
|
5527
|
+
"type": "it",
|
|
5528
|
+
"name": "should not have any axe errors"
|
|
5529
|
+
},
|
|
5530
|
+
{
|
|
5531
|
+
"type": "describe",
|
|
5532
|
+
"name": "when clicked",
|
|
5533
|
+
"children": [
|
|
5534
|
+
{
|
|
5535
|
+
"type": "it",
|
|
5536
|
+
"name": "should be focused"
|
|
5537
|
+
}
|
|
5538
|
+
]
|
|
5539
|
+
},
|
|
5540
|
+
{
|
|
5541
|
+
"type": "describe",
|
|
5542
|
+
"name": "when text is entered",
|
|
5543
|
+
"children": [
|
|
5544
|
+
{
|
|
5545
|
+
"type": "it",
|
|
5546
|
+
"name": "should reflect the text typed"
|
|
5547
|
+
}
|
|
5548
|
+
]
|
|
5549
|
+
}
|
|
5550
|
+
]
|
|
5551
|
+
},
|
|
5552
|
+
{
|
|
5553
|
+
"type": "describe",
|
|
5554
|
+
"name": "given the 'Disabled' story is rendered",
|
|
5555
|
+
"children": [
|
|
5556
|
+
{
|
|
5557
|
+
"type": "it",
|
|
5558
|
+
"name": "should not have any axe errors"
|
|
5559
|
+
},
|
|
5560
|
+
{
|
|
5561
|
+
"type": "it",
|
|
5562
|
+
"name": "should be disabled"
|
|
5563
|
+
}
|
|
5564
|
+
]
|
|
5565
|
+
},
|
|
5566
|
+
{
|
|
5567
|
+
"type": "describe",
|
|
5568
|
+
"name": "given the 'Placeholder' story is rendered",
|
|
5569
|
+
"children": [
|
|
5570
|
+
{
|
|
5571
|
+
"type": "it",
|
|
5572
|
+
"name": "should not have any axe errors"
|
|
5573
|
+
},
|
|
5574
|
+
{
|
|
5575
|
+
"type": "it",
|
|
5576
|
+
"name": "should render a placeholder text"
|
|
5577
|
+
},
|
|
5578
|
+
{
|
|
5579
|
+
"type": "it",
|
|
5580
|
+
"name": "should reflect the text typed"
|
|
5581
|
+
}
|
|
5582
|
+
]
|
|
5583
|
+
}
|
|
5584
|
+
]
|
|
5585
|
+
}
|
|
5586
|
+
]
|
|
5587
|
+
},
|
|
5366
5588
|
{
|
|
5367
5589
|
"type": "file",
|
|
5368
5590
|
"name": "TextInput.spec.ts",
|
|
@@ -5499,11 +5721,11 @@ module.exports = {specifications: [
|
|
|
5499
5721
|
},
|
|
5500
5722
|
{
|
|
5501
5723
|
"type": "file",
|
|
5502
|
-
"name": "
|
|
5724
|
+
"name": "TextInputPreview.spec.ts",
|
|
5503
5725
|
"children": [
|
|
5504
5726
|
{
|
|
5505
5727
|
"type": "describe",
|
|
5506
|
-
"name": "
|
|
5728
|
+
"name": "Text Input",
|
|
5507
5729
|
"children": [
|
|
5508
5730
|
{
|
|
5509
5731
|
"type": "describe",
|
|
@@ -10,6 +10,7 @@ any questions about the update.
|
|
|
10
10
|
- [Canvas Kit Preview](#canvas-kit-preview)
|
|
11
11
|
- [Type Deprecations and Hierarchy Updates](#type-deprecations-and-hierarchy-updates)
|
|
12
12
|
- [Canvas Kit CSS Maintenance Mode](#canvas-kit-css-maintenance-mode)
|
|
13
|
+
- [Prop Interfaces](#prop-interfaces)
|
|
13
14
|
- [Component Changes](#component-changes)
|
|
14
15
|
- [Component Promotions](#component-promotions)
|
|
15
16
|
- [Core](#core)
|
|
@@ -423,6 +424,59 @@ provide more focused support and to dedicate our efforts to making bigger and be
|
|
|
423
424
|
our most used components: Canvas Kit React. If you have questions or concerns, please
|
|
424
425
|
[let us know](https://github.com/Workday/canvas-kit/issues/new?labels=&template=question.md).
|
|
425
426
|
|
|
427
|
+
### Prop Interfaces
|
|
428
|
+
|
|
429
|
+
Many components were updated to be polymorphic using the `createComponent` utility function. Most
|
|
430
|
+
components in Canvas Kit extend from an HTML interface and spread extra props onto the HTML element.
|
|
431
|
+
Since these components are now polymorphic, the exported props no longer extend from an HTML
|
|
432
|
+
interface since the HTML interface is now determined by an optional `as` prop. It is common to wrap
|
|
433
|
+
Canvas Kit components with your own component and extend from the Canvas Kit component's prop
|
|
434
|
+
interface. To support this use-case in addition to polymorphic prop interfaces, `ExtractProp` was
|
|
435
|
+
introduced. `ExtractProp` understands these polymorphic components and will return the base props in
|
|
436
|
+
addition to the HTML interface. There is an optional second argument that can override the default
|
|
437
|
+
HTML interface if your wrapper component uses the `as`.
|
|
438
|
+
|
|
439
|
+
```tsx
|
|
440
|
+
// v4
|
|
441
|
+
import {TextInput, TextInputProps} from '@workday/canvas-kit-react-text-input';
|
|
442
|
+
|
|
443
|
+
const FancyTextInput: React.FC<TextInputProps> = props => <TextInput {...props} />;
|
|
444
|
+
|
|
445
|
+
// v5
|
|
446
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
447
|
+
import {ExtractProps} from '@workday/canvas-kit-react/common';
|
|
448
|
+
|
|
449
|
+
const FancyTextInput: React.FC<ExtractProps<typeof TextInput>> = props => {};
|
|
450
|
+
|
|
451
|
+
// v5 via createComponent
|
|
452
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
453
|
+
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
454
|
+
|
|
455
|
+
const FancyTextInput = createComponent(TextInput)({
|
|
456
|
+
displayName: 'FancyTextInput',
|
|
457
|
+
Component((props) => <TextInput {...props} />)
|
|
458
|
+
})
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
Components that made this change:
|
|
462
|
+
|
|
463
|
+
- Button
|
|
464
|
+
- IconButton
|
|
465
|
+
- Card
|
|
466
|
+
- Hyperlink
|
|
467
|
+
- Select
|
|
468
|
+
- TextArea
|
|
469
|
+
- TextInput
|
|
470
|
+
- Checkbox
|
|
471
|
+
- Radio
|
|
472
|
+
- ColorInput
|
|
473
|
+
- ColorPreview
|
|
474
|
+
- Modal
|
|
475
|
+
- Popup
|
|
476
|
+
- Skeleton
|
|
477
|
+
- Tabs
|
|
478
|
+
- Toast
|
|
479
|
+
|
|
426
480
|
## Component Changes
|
|
427
481
|
|
|
428
482
|
### Component Promotions
|
|
@@ -799,20 +853,25 @@ Button prop interface and accesses properties like `onClick`, you'll need to pro
|
|
|
799
853
|
attribute yourself in order to avoid TypeScript issues (this doesn't affect runtime). This is not
|
|
800
854
|
code-moddable since intent cannot be pre-determined.
|
|
801
855
|
|
|
856
|
+
#### Props
|
|
857
|
+
|
|
858
|
+
The exported props no longer extend from the `HTMLButtonElement` interface. Use
|
|
859
|
+
[ExtractProps](#prop-interfaces) instead.
|
|
860
|
+
|
|
802
861
|
```tsx
|
|
803
862
|
interface MyButtonProps extends ButtonProps {}
|
|
804
863
|
|
|
805
864
|
// onClick no longer exists in `ButtonProps`, so TypeScript will complain about onClick not
|
|
806
865
|
// existing in `MyButtonProps` (`onClick` does exist as a prop on `<Button>`, however)
|
|
807
866
|
const MyButton = ({children, onClick}: MyButtonProps) => (
|
|
808
|
-
<
|
|
867
|
+
<SecondaryButton onClick={onClick}>{children}</SecondaryButton>
|
|
809
868
|
);
|
|
810
869
|
|
|
811
870
|
// After
|
|
812
|
-
interface MyButtonProps extends
|
|
871
|
+
interface MyButtonProps extends ExtractProps<typeof SecondaryButton> {}
|
|
813
872
|
|
|
814
873
|
// After (alternate fix)
|
|
815
|
-
interface MyButtonProps extends
|
|
874
|
+
interface MyButtonProps extends ExtractProps<> {
|
|
816
875
|
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
817
876
|
}
|
|
818
877
|
```
|
|
@@ -881,6 +940,21 @@ const props = {
|
|
|
881
940
|
import {Card} from './Card' // where `Card` is a re-exported Canvas Kit `Card`
|
|
882
941
|
```
|
|
883
942
|
|
|
943
|
+
#### Props
|
|
944
|
+
|
|
945
|
+
The exported props no longer extend from the `HTMLDivElement` interface. Use
|
|
946
|
+
[ExtractProps](#prop-interfaces) instead.
|
|
947
|
+
|
|
948
|
+
```tsx
|
|
949
|
+
// NOT handled by the codemod
|
|
950
|
+
|
|
951
|
+
// v4
|
|
952
|
+
interface MyCard extends CardProps {}
|
|
953
|
+
|
|
954
|
+
// v5
|
|
955
|
+
interface MyCard extends ExtractProps<typeof Card>
|
|
956
|
+
```
|
|
957
|
+
|
|
884
958
|
---
|
|
885
959
|
|
|
886
960
|
### Inputs
|
|
@@ -924,14 +998,14 @@ element that `inputRef` was applied to previously. Select and Select (Preview) d
|
|
|
924
998
|
`inputRef` in v4, but now support `ref` in v5. See each component's documentation for information on
|
|
925
999
|
which element `ref` is forwarded to for that particular component.
|
|
926
1000
|
|
|
1001
|
+
#### Props
|
|
1002
|
+
|
|
927
1003
|
Input component prop interfaces no longer extend directly from their underlying element interface
|
|
928
1004
|
(e.g. `TextInputProps` no longer extends from `React.InputHTMLAttributes<HTMLInputElement>`).
|
|
929
1005
|
`createComponent` returns a component that determines the element interface via the `as` prop. This
|
|
930
1006
|
is why input component props no longer contain an element interface directly. If you extend from an
|
|
931
1007
|
input component prop interface, or have code that uses an input component prop interface and
|
|
932
|
-
accesses properties like `onClick`, you'll need to
|
|
933
|
-
avoid TypeScript issues (this doesn't affect runtime). This is not code-moddable since intent cannot
|
|
934
|
-
be pre-determined.
|
|
1008
|
+
accesses properties like `onClick`, you'll need to use [ExtractProps](#prop-interfaces) instead.
|
|
935
1009
|
|
|
936
1010
|
```tsx
|
|
937
1011
|
interface MyTextInputProps extends TextInputProps {}
|
|
@@ -941,7 +1015,7 @@ interface MyTextInputProps extends TextInputProps {}
|
|
|
941
1015
|
const MyTextInput = ({onClick}: MyTextInputProps) => <TextInput onClick={onClick} />;
|
|
942
1016
|
|
|
943
1017
|
// Fix
|
|
944
|
-
interface MyTextInputProps extends
|
|
1018
|
+
interface MyTextInputProps extends ExtractProps<typeof TextInput> {}
|
|
945
1019
|
|
|
946
1020
|
// Alternate fix
|
|
947
1021
|
interface MyTextInputProps extends TextInputProps {
|