@workday/canvas-kit-docs 14.0.0-alpha.1147-next.0 → 14.0.0-alpha.1148-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 +320 -0
- package/dist/mdx/14.0-UPGRADE-GUIDE.mdx +94 -2
- package/dist/mdx/react/card/card.mdx +20 -1
- package/dist/mdx/react/card/examples/Borderless.tsx +23 -0
- package/dist/mdx/react/card/examples/Filled.tsx +14 -0
- package/dist/mdx/react/card/examples/Stencils.tsx +2 -1
- package/dist/mdx/react/modal/examples/Basic.tsx +1 -1
- package/dist/mdx/react/modal/examples/BodyOverflow.tsx +1 -1
- package/dist/mdx/react/modal/examples/CustomFocus.tsx +1 -1
- package/dist/mdx/react/modal/examples/FormModal.tsx +1 -1
- package/dist/mdx/react/modal/examples/FullOverflow.tsx +1 -1
- package/dist/mdx/react/modal/examples/ReturnFocus.tsx +1 -1
- package/dist/mdx/react/modal/examples/WithoutCloseIcon.tsx +1 -1
- package/dist/mdx/react/popup/examples/Basic.tsx +1 -1
- package/dist/mdx/react/popup/examples/FocusRedirect.tsx +1 -1
- package/dist/mdx/react/popup/examples/FocusTrap.tsx +1 -1
- package/dist/mdx/react/popup/examples/InitialFocus.tsx +1 -1
- package/dist/mdx/react/popup/examples/NestedPopups.tsx +2 -2
- package/dist/mdx/react/popup/examples/PopupWithFallbackPlacements.tsx +4 -4
- package/dist/mdx/react/popup/examples/RTL.tsx +1 -1
- package/dist/mdx/react/tooltip/examples/Placements.tsx +1 -0
- package/package.json +6 -6
package/dist/es6/lib/docs.js
CHANGED
|
@@ -9532,6 +9532,38 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
9532
9532
|
],
|
|
9533
9533
|
"tags": {}
|
|
9534
9534
|
},
|
|
9535
|
+
{
|
|
9536
|
+
"kind": "property",
|
|
9537
|
+
"name": "variant",
|
|
9538
|
+
"required": false,
|
|
9539
|
+
"type": {
|
|
9540
|
+
"kind": "union",
|
|
9541
|
+
"value": [
|
|
9542
|
+
{
|
|
9543
|
+
"kind": "string",
|
|
9544
|
+
"value": "borderless"
|
|
9545
|
+
},
|
|
9546
|
+
{
|
|
9547
|
+
"kind": "string",
|
|
9548
|
+
"value": "filled"
|
|
9549
|
+
}
|
|
9550
|
+
]
|
|
9551
|
+
},
|
|
9552
|
+
"description": "The variant of the Card. Can be `default`, `borderless` or `filled`.",
|
|
9553
|
+
"declarations": [
|
|
9554
|
+
{
|
|
9555
|
+
"name": "variant",
|
|
9556
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/card/lib/Card.tsx"
|
|
9557
|
+
}
|
|
9558
|
+
],
|
|
9559
|
+
"tags": {
|
|
9560
|
+
"default": "'default'"
|
|
9561
|
+
},
|
|
9562
|
+
"defaultValue": {
|
|
9563
|
+
"kind": "string",
|
|
9564
|
+
"value": "default"
|
|
9565
|
+
}
|
|
9566
|
+
},
|
|
9535
9567
|
{
|
|
9536
9568
|
"kind": "property",
|
|
9537
9569
|
"name": "cs",
|
|
@@ -89803,6 +89835,38 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
89803
89835
|
],
|
|
89804
89836
|
"tags": {}
|
|
89805
89837
|
},
|
|
89838
|
+
{
|
|
89839
|
+
"kind": "property",
|
|
89840
|
+
"name": "variant",
|
|
89841
|
+
"required": false,
|
|
89842
|
+
"type": {
|
|
89843
|
+
"kind": "union",
|
|
89844
|
+
"value": [
|
|
89845
|
+
{
|
|
89846
|
+
"kind": "string",
|
|
89847
|
+
"value": "borderless"
|
|
89848
|
+
},
|
|
89849
|
+
{
|
|
89850
|
+
"kind": "string",
|
|
89851
|
+
"value": "filled"
|
|
89852
|
+
}
|
|
89853
|
+
]
|
|
89854
|
+
},
|
|
89855
|
+
"description": "The variant of the Card. Can be `default`, `borderless` or `filled`.",
|
|
89856
|
+
"declarations": [
|
|
89857
|
+
{
|
|
89858
|
+
"name": "variant",
|
|
89859
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/card/lib/Card.tsx"
|
|
89860
|
+
}
|
|
89861
|
+
],
|
|
89862
|
+
"tags": {
|
|
89863
|
+
"default": "'default'"
|
|
89864
|
+
},
|
|
89865
|
+
"defaultValue": {
|
|
89866
|
+
"kind": "string",
|
|
89867
|
+
"value": "default"
|
|
89868
|
+
}
|
|
89869
|
+
},
|
|
89806
89870
|
{
|
|
89807
89871
|
"kind": "property",
|
|
89808
89872
|
"name": "background",
|
|
@@ -119157,6 +119221,38 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
119157
119221
|
],
|
|
119158
119222
|
"tags": {}
|
|
119159
119223
|
},
|
|
119224
|
+
{
|
|
119225
|
+
"kind": "property",
|
|
119226
|
+
"name": "variant",
|
|
119227
|
+
"required": false,
|
|
119228
|
+
"type": {
|
|
119229
|
+
"kind": "union",
|
|
119230
|
+
"value": [
|
|
119231
|
+
{
|
|
119232
|
+
"kind": "string",
|
|
119233
|
+
"value": "borderless"
|
|
119234
|
+
},
|
|
119235
|
+
{
|
|
119236
|
+
"kind": "string",
|
|
119237
|
+
"value": "filled"
|
|
119238
|
+
}
|
|
119239
|
+
]
|
|
119240
|
+
},
|
|
119241
|
+
"description": "The variant of the Card. Can be `default`, `borderless` or `filled`.",
|
|
119242
|
+
"declarations": [
|
|
119243
|
+
{
|
|
119244
|
+
"name": "variant",
|
|
119245
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/card/lib/Card.tsx"
|
|
119246
|
+
}
|
|
119247
|
+
],
|
|
119248
|
+
"tags": {
|
|
119249
|
+
"default": "'default'"
|
|
119250
|
+
},
|
|
119251
|
+
"defaultValue": {
|
|
119252
|
+
"kind": "string",
|
|
119253
|
+
"value": "default"
|
|
119254
|
+
}
|
|
119255
|
+
},
|
|
119160
119256
|
{
|
|
119161
119257
|
"kind": "property",
|
|
119162
119258
|
"name": "cs",
|
|
@@ -172032,6 +172128,38 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
172032
172128
|
],
|
|
172033
172129
|
"tags": {}
|
|
172034
172130
|
},
|
|
172131
|
+
{
|
|
172132
|
+
"kind": "property",
|
|
172133
|
+
"name": "variant",
|
|
172134
|
+
"required": false,
|
|
172135
|
+
"type": {
|
|
172136
|
+
"kind": "union",
|
|
172137
|
+
"value": [
|
|
172138
|
+
{
|
|
172139
|
+
"kind": "string",
|
|
172140
|
+
"value": "borderless"
|
|
172141
|
+
},
|
|
172142
|
+
{
|
|
172143
|
+
"kind": "string",
|
|
172144
|
+
"value": "filled"
|
|
172145
|
+
}
|
|
172146
|
+
]
|
|
172147
|
+
},
|
|
172148
|
+
"description": "The variant of the Card. Can be `default`, `borderless` or `filled`.",
|
|
172149
|
+
"declarations": [
|
|
172150
|
+
{
|
|
172151
|
+
"name": "variant",
|
|
172152
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/card/lib/Card.tsx"
|
|
172153
|
+
}
|
|
172154
|
+
],
|
|
172155
|
+
"tags": {
|
|
172156
|
+
"default": "'default'"
|
|
172157
|
+
},
|
|
172158
|
+
"defaultValue": {
|
|
172159
|
+
"kind": "string",
|
|
172160
|
+
"value": "default"
|
|
172161
|
+
}
|
|
172162
|
+
},
|
|
172035
172163
|
{
|
|
172036
172164
|
"kind": "property",
|
|
172037
172165
|
"name": "cs",
|
|
@@ -202715,6 +202843,38 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
202715
202843
|
],
|
|
202716
202844
|
"tags": {}
|
|
202717
202845
|
},
|
|
202846
|
+
{
|
|
202847
|
+
"kind": "property",
|
|
202848
|
+
"name": "variant",
|
|
202849
|
+
"required": false,
|
|
202850
|
+
"type": {
|
|
202851
|
+
"kind": "union",
|
|
202852
|
+
"value": [
|
|
202853
|
+
{
|
|
202854
|
+
"kind": "string",
|
|
202855
|
+
"value": "borderless"
|
|
202856
|
+
},
|
|
202857
|
+
{
|
|
202858
|
+
"kind": "string",
|
|
202859
|
+
"value": "filled"
|
|
202860
|
+
}
|
|
202861
|
+
]
|
|
202862
|
+
},
|
|
202863
|
+
"description": "The variant of the Card. Can be `default`, `borderless` or `filled`.",
|
|
202864
|
+
"declarations": [
|
|
202865
|
+
{
|
|
202866
|
+
"name": "variant",
|
|
202867
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/card/lib/Card.tsx"
|
|
202868
|
+
}
|
|
202869
|
+
],
|
|
202870
|
+
"tags": {
|
|
202871
|
+
"default": "'default'"
|
|
202872
|
+
},
|
|
202873
|
+
"defaultValue": {
|
|
202874
|
+
"kind": "string",
|
|
202875
|
+
"value": "default"
|
|
202876
|
+
}
|
|
202877
|
+
},
|
|
202718
202878
|
{
|
|
202719
202879
|
"kind": "property",
|
|
202720
202880
|
"name": "cs",
|
|
@@ -252467,6 +252627,38 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
252467
252627
|
],
|
|
252468
252628
|
"tags": {}
|
|
252469
252629
|
},
|
|
252630
|
+
{
|
|
252631
|
+
"kind": "property",
|
|
252632
|
+
"name": "variant",
|
|
252633
|
+
"required": false,
|
|
252634
|
+
"type": {
|
|
252635
|
+
"kind": "union",
|
|
252636
|
+
"value": [
|
|
252637
|
+
{
|
|
252638
|
+
"kind": "string",
|
|
252639
|
+
"value": "borderless"
|
|
252640
|
+
},
|
|
252641
|
+
{
|
|
252642
|
+
"kind": "string",
|
|
252643
|
+
"value": "filled"
|
|
252644
|
+
}
|
|
252645
|
+
]
|
|
252646
|
+
},
|
|
252647
|
+
"description": "The variant of the Card. Can be `default`, `borderless` or `filled`.",
|
|
252648
|
+
"declarations": [
|
|
252649
|
+
{
|
|
252650
|
+
"name": "variant",
|
|
252651
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/card/lib/Card.tsx"
|
|
252652
|
+
}
|
|
252653
|
+
],
|
|
252654
|
+
"tags": {
|
|
252655
|
+
"default": "'default'"
|
|
252656
|
+
},
|
|
252657
|
+
"defaultValue": {
|
|
252658
|
+
"kind": "string",
|
|
252659
|
+
"value": "default"
|
|
252660
|
+
}
|
|
252661
|
+
},
|
|
252470
252662
|
{
|
|
252471
252663
|
"kind": "property",
|
|
252472
252664
|
"name": "cs",
|
|
@@ -284648,6 +284840,38 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
284648
284840
|
],
|
|
284649
284841
|
"tags": {}
|
|
284650
284842
|
},
|
|
284843
|
+
{
|
|
284844
|
+
"kind": "property",
|
|
284845
|
+
"name": "variant",
|
|
284846
|
+
"required": false,
|
|
284847
|
+
"type": {
|
|
284848
|
+
"kind": "union",
|
|
284849
|
+
"value": [
|
|
284850
|
+
{
|
|
284851
|
+
"kind": "string",
|
|
284852
|
+
"value": "borderless"
|
|
284853
|
+
},
|
|
284854
|
+
{
|
|
284855
|
+
"kind": "string",
|
|
284856
|
+
"value": "filled"
|
|
284857
|
+
}
|
|
284858
|
+
]
|
|
284859
|
+
},
|
|
284860
|
+
"description": "The variant of the Card. Can be `default`, `borderless` or `filled`.",
|
|
284861
|
+
"declarations": [
|
|
284862
|
+
{
|
|
284863
|
+
"name": "variant",
|
|
284864
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/card/lib/Card.tsx"
|
|
284865
|
+
}
|
|
284866
|
+
],
|
|
284867
|
+
"tags": {
|
|
284868
|
+
"default": "'default'"
|
|
284869
|
+
},
|
|
284870
|
+
"defaultValue": {
|
|
284871
|
+
"kind": "string",
|
|
284872
|
+
"value": "default"
|
|
284873
|
+
}
|
|
284874
|
+
},
|
|
284651
284875
|
{
|
|
284652
284876
|
"kind": "property",
|
|
284653
284877
|
"name": "cs",
|
|
@@ -315869,6 +316093,38 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
315869
316093
|
],
|
|
315870
316094
|
"tags": {}
|
|
315871
316095
|
},
|
|
316096
|
+
{
|
|
316097
|
+
"kind": "property",
|
|
316098
|
+
"name": "variant",
|
|
316099
|
+
"required": false,
|
|
316100
|
+
"type": {
|
|
316101
|
+
"kind": "union",
|
|
316102
|
+
"value": [
|
|
316103
|
+
{
|
|
316104
|
+
"kind": "string",
|
|
316105
|
+
"value": "borderless"
|
|
316106
|
+
},
|
|
316107
|
+
{
|
|
316108
|
+
"kind": "string",
|
|
316109
|
+
"value": "filled"
|
|
316110
|
+
}
|
|
316111
|
+
]
|
|
316112
|
+
},
|
|
316113
|
+
"description": "The variant of the Card. Can be `default`, `borderless` or `filled`.",
|
|
316114
|
+
"declarations": [
|
|
316115
|
+
{
|
|
316116
|
+
"name": "variant",
|
|
316117
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/card/lib/Card.tsx"
|
|
316118
|
+
}
|
|
316119
|
+
],
|
|
316120
|
+
"tags": {
|
|
316121
|
+
"default": "'default'"
|
|
316122
|
+
},
|
|
316123
|
+
"defaultValue": {
|
|
316124
|
+
"kind": "string",
|
|
316125
|
+
"value": "default"
|
|
316126
|
+
}
|
|
316127
|
+
},
|
|
315872
316128
|
{
|
|
315873
316129
|
"kind": "property",
|
|
315874
316130
|
"name": "cs",
|
|
@@ -335002,6 +335258,38 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
335002
335258
|
"componentType": "subcomponent",
|
|
335003
335259
|
"elemPropsHook": "useSelectCard",
|
|
335004
335260
|
"props": [
|
|
335261
|
+
{
|
|
335262
|
+
"kind": "property",
|
|
335263
|
+
"name": "variant",
|
|
335264
|
+
"required": false,
|
|
335265
|
+
"type": {
|
|
335266
|
+
"kind": "union",
|
|
335267
|
+
"value": [
|
|
335268
|
+
{
|
|
335269
|
+
"kind": "string",
|
|
335270
|
+
"value": "borderless"
|
|
335271
|
+
},
|
|
335272
|
+
{
|
|
335273
|
+
"kind": "string",
|
|
335274
|
+
"value": "filled"
|
|
335275
|
+
}
|
|
335276
|
+
]
|
|
335277
|
+
},
|
|
335278
|
+
"description": "The variant of the Card. Can be `default`, `borderless` or `filled`.",
|
|
335279
|
+
"declarations": [
|
|
335280
|
+
{
|
|
335281
|
+
"name": "variant",
|
|
335282
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/card/lib/Card.tsx"
|
|
335283
|
+
}
|
|
335284
|
+
],
|
|
335285
|
+
"tags": {
|
|
335286
|
+
"default": "'default'"
|
|
335287
|
+
},
|
|
335288
|
+
"defaultValue": {
|
|
335289
|
+
"kind": "string",
|
|
335290
|
+
"value": "default"
|
|
335291
|
+
}
|
|
335292
|
+
},
|
|
335005
335293
|
{
|
|
335006
335294
|
"kind": "property",
|
|
335007
335295
|
"name": "cs",
|
|
@@ -390571,6 +390859,38 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
390571
390859
|
"componentType": "container",
|
|
390572
390860
|
"displayName": "Toast",
|
|
390573
390861
|
"props": [
|
|
390862
|
+
{
|
|
390863
|
+
"kind": "property",
|
|
390864
|
+
"name": "variant",
|
|
390865
|
+
"required": false,
|
|
390866
|
+
"type": {
|
|
390867
|
+
"kind": "union",
|
|
390868
|
+
"value": [
|
|
390869
|
+
{
|
|
390870
|
+
"kind": "string",
|
|
390871
|
+
"value": "borderless"
|
|
390872
|
+
},
|
|
390873
|
+
{
|
|
390874
|
+
"kind": "string",
|
|
390875
|
+
"value": "filled"
|
|
390876
|
+
}
|
|
390877
|
+
]
|
|
390878
|
+
},
|
|
390879
|
+
"description": "The variant of the Card. Can be `default`, `borderless` or `filled`.",
|
|
390880
|
+
"declarations": [
|
|
390881
|
+
{
|
|
390882
|
+
"name": "variant",
|
|
390883
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/card/lib/Card.tsx"
|
|
390884
|
+
}
|
|
390885
|
+
],
|
|
390886
|
+
"tags": {
|
|
390887
|
+
"default": "'default'"
|
|
390888
|
+
},
|
|
390889
|
+
"defaultValue": {
|
|
390890
|
+
"kind": "string",
|
|
390891
|
+
"value": "default"
|
|
390892
|
+
}
|
|
390893
|
+
},
|
|
390574
390894
|
{
|
|
390575
390895
|
"kind": "property",
|
|
390576
390896
|
"name": "cs",
|
|
@@ -10,6 +10,7 @@ any questions.
|
|
|
10
10
|
- [Instructions](#instructions)
|
|
11
11
|
- [Component Updates](#component-updates)
|
|
12
12
|
- [Styling API and CSS Tokens](#styling-api-and-css-tokens)
|
|
13
|
+
- [Card](#card)
|
|
13
14
|
- [SearchForm](#search-form)
|
|
14
15
|
- [Troubleshooting](#troubleshooting)
|
|
15
16
|
- [Glossary](#glossary)
|
|
@@ -78,7 +79,9 @@ yarn remove @workday/canvas-kit-codemod
|
|
|
78
79
|
> after executing the codemod, as its resulting formatting (spacing, quotes, etc.) may not match
|
|
79
80
|
> your project conventions.
|
|
80
81
|
|
|
81
|
-
##
|
|
82
|
+
## Component Updates
|
|
83
|
+
|
|
84
|
+
### Styling API and Canvas Tokens 💅
|
|
82
85
|
|
|
83
86
|
Several components have been refactored to use our Canvas tokens and styling API. The React
|
|
84
87
|
interface has not changed, but Canvas Tokens are now used for dynamic properties.
|
|
@@ -98,7 +101,96 @@ The following components have been updated:
|
|
|
98
101
|
- `ToolbarDropdownButton` [#3293](https://github.com/Workday/canvas-kit/pull/3293)
|
|
99
102
|
- `ToolbarIconButton` [#3293](https://github.com/Workday/canvas-kit/pull/3293)
|
|
100
103
|
|
|
101
|
-
|
|
104
|
+
### Card 🚨
|
|
105
|
+
|
|
106
|
+
**PR:** [#3350](https://github.com/Workday/canvas-kit/pull/3350)
|
|
107
|
+
|
|
108
|
+
We've rebranded the `Card` component to align with our new brand directions and provide better
|
|
109
|
+
visual hierarchy and more flexible styling options. The following changes have been made:
|
|
110
|
+
|
|
111
|
+
#### Default Card No Longer Has Shadow
|
|
112
|
+
|
|
113
|
+
The default `Card` variant no longer includes a shadow, creating a cleaner, flatter appearance that
|
|
114
|
+
aligns with our new brand's emphasis on simplicity and clarity. This is a **visual breaking change**
|
|
115
|
+
that may affect your application's visual hierarchy. If your design requires shadow you can added
|
|
116
|
+
through `cs` prop.
|
|
117
|
+
|
|
118
|
+
**Before in v13**
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
<Card>
|
|
122
|
+
<Card.Heading>Card Title</Card.Heading>
|
|
123
|
+
<Card.Body>Card content with shadow</Card.Body>
|
|
124
|
+
</Card>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**After in v14**
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
<Card cs={{boxShadow: system.depth[1]}}>
|
|
131
|
+
<Card.Heading>Card Title</Card.Heading>
|
|
132
|
+
<Card.Body>Card content with shadow</Card.Body>
|
|
133
|
+
</Card>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
#### New Card Variants
|
|
137
|
+
|
|
138
|
+
We've added two new variants to provide more styling flexibility:
|
|
139
|
+
|
|
140
|
+
- **`borderless`**: Use this variant when placing cards on colored backgrounds where you want the
|
|
141
|
+
card to blend seamlessly without borders or shadows.
|
|
142
|
+
- **`filled`**: Use this variant when you need a card with a grayish background to create visual
|
|
143
|
+
separation from the page background.
|
|
144
|
+
|
|
145
|
+
The `variant` prop is optional - if no variant is specified, the card will use the default styling.
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
// Default card (no variant prop needed)
|
|
149
|
+
<Card>
|
|
150
|
+
<Card.Heading>Default Card</Card.Heading>
|
|
151
|
+
<Card.Body>Default styling with borders, no shadow</Card.Body>
|
|
152
|
+
</Card>
|
|
153
|
+
|
|
154
|
+
// Borderless variant for colored backgrounds
|
|
155
|
+
<Card variant="borderless">
|
|
156
|
+
<Card.Heading>Card on Colored Background</Card.Heading>
|
|
157
|
+
<Card.Body>Content blends with background</Card.Body>
|
|
158
|
+
</Card>
|
|
159
|
+
|
|
160
|
+
// Filled variant with grayish background
|
|
161
|
+
<Card variant="filled">
|
|
162
|
+
<Card.Heading>Card with grayish Background</Card.Heading>
|
|
163
|
+
<Card.Body>Content with visual separation</Card.Body>
|
|
164
|
+
</Card>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
#### Gap Instead of Margins
|
|
168
|
+
|
|
169
|
+
We've replaced the individual margins on `Card.Heading` and `Card.Body` with a `gap` prop on the
|
|
170
|
+
card container. The card now uses `display: flex` with `flex-direction: column` by default, and the
|
|
171
|
+
`gap` prop provides consistent spacing between all direct children. This provides more consistent
|
|
172
|
+
spacing and better control over the layout. This is a **visual breaking change** that may affect the
|
|
173
|
+
spacing between card elements.
|
|
174
|
+
|
|
175
|
+
**Before in v13**
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
<Card>
|
|
179
|
+
<Card.Heading marginBlock="zero">Title</Card.Heading>
|
|
180
|
+
<Card.Body marginBlock="zero">Card without any spacing</Card.Body>
|
|
181
|
+
</Card>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**After in v14**
|
|
185
|
+
|
|
186
|
+
```tsx
|
|
187
|
+
<Card cs={{gap: system.space.zero}}>
|
|
188
|
+
<Card.Heading>Title</Card.Heading>
|
|
189
|
+
<Card.Body>Card without any spacing</Card.Body>
|
|
190
|
+
</Card>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Search Form 🚨
|
|
102
194
|
|
|
103
195
|
**PR:** [#3303](https://github.com/Workday/canvas-kit/pull/3303)
|
|
104
196
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
2
2
|
import Basic from './examples/Basic';
|
|
3
|
+
import Borderless from './examples/Borderless';
|
|
4
|
+
import Filled from './examples/Filled';
|
|
3
5
|
import WithCustomStyles from './examples/CustomStyles';
|
|
4
6
|
import WithStencils from './examples/Stencils';
|
|
5
7
|
|
|
@@ -27,6 +29,23 @@ yarn add @workday/canvas-kit-react
|
|
|
27
29
|
|
|
28
30
|
<ExampleCodeBlock code={Basic} />
|
|
29
31
|
|
|
32
|
+
### Borderless Example
|
|
33
|
+
|
|
34
|
+
The `borderless` variant removes the border from the Card, creating a cleaner appearance while
|
|
35
|
+
maintaining the same internal spacing and structure.
|
|
36
|
+
Use this variant when placing cards on colored backgrounds where you want the
|
|
37
|
+
card to blend seamlessly without borders or shadows.
|
|
38
|
+
|
|
39
|
+
<ExampleCodeBlock code={Borderless} />
|
|
40
|
+
|
|
41
|
+
### Filled Example
|
|
42
|
+
|
|
43
|
+
The `filled` variant adds a background color to the Card, creating a more prominent appearance while
|
|
44
|
+
maintaining the same internal spacing and structure. Use this variant when you need a card with a grayish background to create visual
|
|
45
|
+
separation from the page background.
|
|
46
|
+
|
|
47
|
+
<ExampleCodeBlock code={Filled} />
|
|
48
|
+
|
|
30
49
|
### Custom Styles
|
|
31
50
|
|
|
32
51
|
Card and its subcomponents support custom styling via the `cs` prop. For more information, check our
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Card} from '@workday/canvas-kit-react/card';
|
|
3
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
4
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
5
|
+
|
|
6
|
+
const styles = createStyles({
|
|
7
|
+
background: system.color.bg.alt.softer,
|
|
8
|
+
padding: system.space.x4,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export default () => {
|
|
12
|
+
return (
|
|
13
|
+
<div className={styles}>
|
|
14
|
+
<Card variant="borderless">
|
|
15
|
+
<Card.Heading>Canvas Supreme</Card.Heading>
|
|
16
|
+
<Card.Body>
|
|
17
|
+
Our house special supreme pizza includes pepperoni, sausage, bell peppers, mushrooms,
|
|
18
|
+
onions, and oregano.
|
|
19
|
+
</Card.Body>
|
|
20
|
+
</Card>
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Card} from '@workday/canvas-kit-react/card';
|
|
3
|
+
|
|
4
|
+
export default () => {
|
|
5
|
+
return (
|
|
6
|
+
<Card variant="filled">
|
|
7
|
+
<Card.Heading>Canvas Supreme</Card.Heading>
|
|
8
|
+
<Card.Body>
|
|
9
|
+
Our house special supreme pizza includes pepperoni, sausage, bell peppers, mushrooms,
|
|
10
|
+
onions, and oregano.
|
|
11
|
+
</Card.Body>
|
|
12
|
+
</Card>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
@@ -11,6 +11,8 @@ const menuCardStencil = createStencil({
|
|
|
11
11
|
flexDirection: 'column',
|
|
12
12
|
padding: system.space.zero,
|
|
13
13
|
maxWidth: px2rem(320),
|
|
14
|
+
boxShadow: system.depth[1],
|
|
15
|
+
overflow: 'hidden',
|
|
14
16
|
},
|
|
15
17
|
});
|
|
16
18
|
|
|
@@ -22,7 +24,6 @@ const menuCardHeroStencil = createStencil({
|
|
|
22
24
|
aspectRatio: '1',
|
|
23
25
|
maxHeight: px2rem(80),
|
|
24
26
|
padding: system.space.x2,
|
|
25
|
-
borderRadius: `${system.shape.x2} ${system.shape.x2} 0 0`,
|
|
26
27
|
},
|
|
27
28
|
});
|
|
28
29
|
|
|
@@ -24,7 +24,7 @@ export default () => {
|
|
|
24
24
|
software and associated documentation files (the "Software").
|
|
25
25
|
</Box>
|
|
26
26
|
</Modal.Body>
|
|
27
|
-
<Flex gap="s" padding="xxs"
|
|
27
|
+
<Flex gap="s" padding="xxs">
|
|
28
28
|
<Modal.CloseButton as={PrimaryButton} onClick={handleAcknowledge}>
|
|
29
29
|
Acknowledge
|
|
30
30
|
</Modal.CloseButton>
|
|
@@ -81,7 +81,7 @@ export default () => {
|
|
|
81
81
|
ut aliquam purus sit.
|
|
82
82
|
</p>
|
|
83
83
|
</Modal.Body>
|
|
84
|
-
<Flex gap="s" padding="xxs"
|
|
84
|
+
<Flex gap="s" padding="xxs">
|
|
85
85
|
<Modal.CloseButton as={PrimaryButton} onClick={handleAcknowledge}>
|
|
86
86
|
Acknowledge
|
|
87
87
|
</Modal.CloseButton>
|
|
@@ -41,7 +41,7 @@ export default () => {
|
|
|
41
41
|
<FormField.Input as={TextInput} name="last" />
|
|
42
42
|
</FormField>
|
|
43
43
|
</Modal.Body>
|
|
44
|
-
<Flex gap="s" padding="xxs"
|
|
44
|
+
<Flex gap="s" padding="xxs">
|
|
45
45
|
<Modal.CloseButton>Cancel</Modal.CloseButton>
|
|
46
46
|
<PrimaryButton type="submit">Submit</PrimaryButton>
|
|
47
47
|
</Flex>
|
|
@@ -81,7 +81,7 @@ export default () => {
|
|
|
81
81
|
ut aliquam purus sit.
|
|
82
82
|
</p>
|
|
83
83
|
</Modal.Body>
|
|
84
|
-
<Flex gap="s" padding="xxs"
|
|
84
|
+
<Flex gap="s" padding="xxs">
|
|
85
85
|
<Modal.CloseButton as={PrimaryButton} onClick={handleAcknowledge}>
|
|
86
86
|
Acknowledge
|
|
87
87
|
</Modal.CloseButton>
|
|
@@ -50,7 +50,7 @@ export default () => {
|
|
|
50
50
|
Are you sure you want to delete the item?
|
|
51
51
|
</Box>
|
|
52
52
|
</Modal.Body>
|
|
53
|
-
<Flex gap="s" padding="xxs"
|
|
53
|
+
<Flex gap="s" padding="xxs">
|
|
54
54
|
<Modal.CloseButton as={DeleteButton} onClick={handleDelete}>
|
|
55
55
|
Delete
|
|
56
56
|
</Modal.CloseButton>
|
|
@@ -41,7 +41,7 @@ export default () => {
|
|
|
41
41
|
Are you sure you want to delete the item?
|
|
42
42
|
</Box>
|
|
43
43
|
</Modal.Body>
|
|
44
|
-
<Flex gap="s" padding="xxs"
|
|
44
|
+
<Flex gap="s" padding="xxs">
|
|
45
45
|
<Modal.CloseButton ref={cancelBtnRef}>Cancel</Modal.CloseButton>
|
|
46
46
|
<Modal.CloseButton as={DeleteButton} onClick={handleDelete}>
|
|
47
47
|
Delete
|
|
@@ -33,7 +33,7 @@ export default () => {
|
|
|
33
33
|
Are you sure you'd like to delete the item titled 'My Item'?
|
|
34
34
|
</Box>
|
|
35
35
|
</Popup.Body>
|
|
36
|
-
<Flex gap="s" padding="xxs"
|
|
36
|
+
<Flex gap="s" padding="xxs">
|
|
37
37
|
<Popup.CloseButton as={DeleteButton} onClick={handleDelete}>
|
|
38
38
|
Delete
|
|
39
39
|
</Popup.CloseButton>
|
|
@@ -47,7 +47,7 @@ export default () => {
|
|
|
47
47
|
Are you sure you'd like to delete the item titled 'My Item'?
|
|
48
48
|
</Box>
|
|
49
49
|
</Popup.Body>
|
|
50
|
-
<Flex gap="s" padding="xxs"
|
|
50
|
+
<Flex gap="s" padding="xxs">
|
|
51
51
|
<Popup.CloseButton as={DeleteButton} onClick={handleDelete}>
|
|
52
52
|
Delete
|
|
53
53
|
</Popup.CloseButton>
|
|
@@ -47,7 +47,7 @@ export default () => {
|
|
|
47
47
|
Are you sure you'd like to delete the item titled 'My Item'?
|
|
48
48
|
</Box>
|
|
49
49
|
</Popup.Body>
|
|
50
|
-
<Flex gap="s" padding="xxs"
|
|
50
|
+
<Flex gap="s" padding="xxs">
|
|
51
51
|
<Popup.CloseButton as={DeleteButton} onClick={handleDelete}>
|
|
52
52
|
Delete
|
|
53
53
|
</Popup.CloseButton>
|
|
@@ -33,7 +33,7 @@ export default () => {
|
|
|
33
33
|
Your message has been sent!
|
|
34
34
|
</Box>
|
|
35
35
|
</Popup.Body>
|
|
36
|
-
<Flex gap="s" padding="xxs"
|
|
36
|
+
<Flex gap="s" padding="xxs">
|
|
37
37
|
<Popup.CloseButton ref={initialFocusRef} aria-describedby="popup-message">
|
|
38
38
|
OK
|
|
39
39
|
</Popup.CloseButton>
|
|
@@ -38,7 +38,7 @@ export default () => {
|
|
|
38
38
|
<Popup.Body>
|
|
39
39
|
<p style={{marginTop: 0, marginBottom: 0}}>Contents of Popup 1</p>
|
|
40
40
|
</Popup.Body>
|
|
41
|
-
<Flex gap="s" padding="xxs"
|
|
41
|
+
<Flex gap="s" padding="xxs">
|
|
42
42
|
<Popup model={popup2}>
|
|
43
43
|
<Popup.Target>Open Popup 2</Popup.Target>
|
|
44
44
|
<Popup.Popper>
|
|
@@ -47,7 +47,7 @@ export default () => {
|
|
|
47
47
|
<Popup.Body>
|
|
48
48
|
<p style={{marginTop: 0, marginBottom: 0}}>Contents of Popup 2</p>
|
|
49
49
|
</Popup.Body>
|
|
50
|
-
<Flex gap="s" padding="xxs"
|
|
50
|
+
<Flex gap="s" padding="xxs">
|
|
51
51
|
<Popup.CloseButton as={Popup.CloseButton} model={popup1}>
|
|
52
52
|
Close Both (as)
|
|
53
53
|
</Popup.CloseButton>
|
|
@@ -61,7 +61,7 @@ export default () => {
|
|
|
61
61
|
<Popup.CloseIcon aria-label="Close" />
|
|
62
62
|
<Popup.Heading paddingTop="m">This is Popup heading</Popup.Heading>
|
|
63
63
|
<Popup.Body>Are you sure you'd like to delete the item titled 'My Item'?</Popup.Body>
|
|
64
|
-
<Flex gap="s" padding="xxs"
|
|
64
|
+
<Flex gap="s" padding="xxs">
|
|
65
65
|
<Popup.CloseButton as={DeleteButton} onClick={handleDelete}>
|
|
66
66
|
Delete
|
|
67
67
|
</Popup.CloseButton>
|
|
@@ -79,7 +79,7 @@ export default () => {
|
|
|
79
79
|
<Popup.CloseIcon aria-label="Close" />
|
|
80
80
|
<Popup.Heading paddingTop="m">This is Popup heading</Popup.Heading>
|
|
81
81
|
<Popup.Body>Are you sure you'd like to delete the item titled 'My Item'?</Popup.Body>
|
|
82
|
-
<Flex gap="s" padding="xxs"
|
|
82
|
+
<Flex gap="s" padding="xxs">
|
|
83
83
|
<Popup.CloseButton as={DeleteButton} onClick={handleDelete}>
|
|
84
84
|
Delete
|
|
85
85
|
</Popup.CloseButton>
|
|
@@ -97,7 +97,7 @@ export default () => {
|
|
|
97
97
|
<Popup.CloseIcon aria-label="Close" />
|
|
98
98
|
<Popup.Heading paddingTop="m">This is Popup heading</Popup.Heading>
|
|
99
99
|
<Popup.Body>Are you sure you'd like to delete the item titled 'My Item'?</Popup.Body>
|
|
100
|
-
<Flex gap="s" padding="xxs"
|
|
100
|
+
<Flex gap="s" padding="xxs">
|
|
101
101
|
<Popup.CloseButton as={DeleteButton} onClick={handleDelete}>
|
|
102
102
|
Delete
|
|
103
103
|
</Popup.CloseButton>
|
|
@@ -115,7 +115,7 @@ export default () => {
|
|
|
115
115
|
<Popup.CloseIcon aria-label="Close" />
|
|
116
116
|
<Popup.Heading paddingTop="m">This is Popup heading</Popup.Heading>
|
|
117
117
|
<Popup.Body>Are you sure you'd like to delete the item titled 'My Item'?</Popup.Body>
|
|
118
|
-
<Flex gap="s" padding="xxs"
|
|
118
|
+
<Flex gap="s" padding="xxs">
|
|
119
119
|
<Popup.CloseButton as={DeleteButton} onClick={handleDelete}>
|
|
120
120
|
Delete
|
|
121
121
|
</Popup.CloseButton>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "14.0.0-alpha.
|
|
3
|
+
"version": "14.0.0-alpha.1148-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": "^14.0.0-alpha.
|
|
49
|
-
"@workday/canvas-kit-preview-react": "^14.0.0-alpha.
|
|
50
|
-
"@workday/canvas-kit-react": "^14.0.0-alpha.
|
|
51
|
-
"@workday/canvas-kit-styling": "^14.0.0-alpha.
|
|
48
|
+
"@workday/canvas-kit-labs-react": "^14.0.0-alpha.1148-next.0",
|
|
49
|
+
"@workday/canvas-kit-preview-react": "^14.0.0-alpha.1148-next.0",
|
|
50
|
+
"@workday/canvas-kit-react": "^14.0.0-alpha.1148-next.0",
|
|
51
|
+
"@workday/canvas-kit-styling": "^14.0.0-alpha.1148-next.0",
|
|
52
52
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
53
53
|
"@workday/canvas-tokens-web": "3.0.0-alpha.5",
|
|
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": "17badcb6f4a0ecd0faa19e2d8fd7fa6241aa9393"
|
|
65
65
|
}
|