@workday/canvas-kit-docs 14.0.0-alpha.1254-next.0 → 14.0.0-alpha.1255-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 +1621 -506
- package/dist/mdx/14.0-UPGRADE-GUIDE.mdx +89 -35
- package/package.json +6 -6
|
@@ -11,7 +11,8 @@ styling updates to our components.
|
|
|
11
11
|
|
|
12
12
|
**Please consult our [v14 Visual Changes](/help/upgrade-guides/canvas-v14-upgrade-guide/#tab=visual-changes) page for a visual reference of what's changed.**
|
|
13
13
|
|
|
14
|
-
> **Note:** While v14 does not require an upgrade to our v3 tokens, we strongly advise to upgrade to
|
|
14
|
+
> **Note:** While v14 does not require an upgrade to our v3 tokens, we strongly advise to upgrade to
|
|
15
|
+
> the latest to ensure proper branding.
|
|
15
16
|
|
|
16
17
|
## Table of contents
|
|
17
18
|
|
|
@@ -34,6 +35,7 @@ styling updates to our components.
|
|
|
34
35
|
- [Pill (Preview)](#pill-preview)
|
|
35
36
|
- [Search Form (Labs)](#searchform-)
|
|
36
37
|
- [Status Indicator (Preview)](#status-indicator-preview-)
|
|
38
|
+
- [Icons](#icons)
|
|
37
39
|
- [Deprecations](#deprecations)
|
|
38
40
|
- [Avatar (Main)](#avatar-in-main)
|
|
39
41
|
- [Combobox (Labs)](#combobox-labs)
|
|
@@ -42,6 +44,7 @@ styling updates to our components.
|
|
|
42
44
|
- [Segmented Control (Main)](#segmented-control-main)
|
|
43
45
|
- [Side Panel (Main)](#side-panel-main)
|
|
44
46
|
- [Tokens](#tokens)
|
|
47
|
+
- [useIsRTL](#useisrtl)
|
|
45
48
|
- [Removals](#removals)
|
|
46
49
|
- [Deprecated Buttons](#deprecated-buttons)
|
|
47
50
|
- [Input Provider](#input-provider)
|
|
@@ -119,8 +122,8 @@ yarn remove @workday/canvas-kit-codemod
|
|
|
119
122
|
## Tokens
|
|
120
123
|
|
|
121
124
|
Canvas Kit v14 now uses `@workday/canvas-tokens-web` v3, which introduces new color palettes and
|
|
122
|
-
deprecates the old "fruity" color names (for example, use `red` instead of `cinnamon`, `blue`
|
|
123
|
-
of `blueberry`, and `green` instead of `greenApple`). We strongly recommend upgrading to
|
|
125
|
+
deprecates the old "fruity" color names (for example, use `red` instead of `cinnamon`, `blue`
|
|
126
|
+
instead of `blueberry`, and `green` instead of `greenApple`). We strongly recommend upgrading to
|
|
124
127
|
`@workday/canvas-tokens-web` v3, as using older versions will not match the new brand guidelines or
|
|
125
128
|
color system. Although this dependency upgrade is not required, we've offered migration guides and
|
|
126
129
|
codemods separately from the v14 upgrade so that teams can upgrade when they can.
|
|
@@ -145,7 +148,8 @@ Follow these guides to migrate:
|
|
|
145
148
|
To better align with the brand refresh, Alert and Warning states are being renamed to Caution for
|
|
146
149
|
better semantics.
|
|
147
150
|
|
|
148
|
-
This change mostly affects how you pass an error state to our input components. In most cases, our
|
|
151
|
+
This change mostly affects how you pass an error state to our input components. In most cases, our
|
|
152
|
+
input components should be used with our `FormField` component to ensure correct accessibility.
|
|
149
153
|
|
|
150
154
|
**Before in v13**
|
|
151
155
|
|
|
@@ -171,7 +175,8 @@ This change mostly affects how you pass an error state to our input components.
|
|
|
171
175
|
</FormField>
|
|
172
176
|
```
|
|
173
177
|
|
|
174
|
-
If you are using the error type either from our `Common` package or the one exposed from the
|
|
178
|
+
If you are using the error type either from our `Common` package or the one exposed from the
|
|
179
|
+
component, the naming has also changed.
|
|
175
180
|
|
|
176
181
|
**Before in v13**
|
|
177
182
|
|
|
@@ -228,8 +233,7 @@ our CSS variables. Instead of generating a palette and shifting the brightness a
|
|
|
228
233
|
|
|
229
234
|
Prior to v14, `CanvasProvider` created a [cascade barrier](/get-started/for-developers/theming/overview/#what-is-a-cascade-barrier), which redefined brand CSS variables under a class and created a higher specificity. This made it difficult to override brand tokens in certain scenarios. v14 removes that barrier.
|
|
230
235
|
|
|
231
|
-
**Before in v13**
|
|
232
|
-
In v13, the `useTheme` hook would call `createCanvasTheme` which generated a
|
|
236
|
+
**Before in v13** In v13, the `useTheme` hook would call `createCanvasTheme` which generated a
|
|
233
237
|
palette given a `main` color via `chroma.js`.
|
|
234
238
|
|
|
235
239
|
```tsx
|
|
@@ -287,6 +291,17 @@ The reason for this change is to ensure that the CSS variables properly cascade
|
|
|
287
291
|
Before in v13, the `CanvasProvider` would add the brand tokens under a class name, creating a higher
|
|
288
292
|
specificity.
|
|
289
293
|
|
|
294
|
+
|
|
295
|
+
### useIsRTL
|
|
296
|
+
|
|
297
|
+
**PR:** [#3480](https://github.com/Workday/canvas-kit/pull/3477)
|
|
298
|
+
|
|
299
|
+
The `useIsRTL` hook has been deprecated. Please use
|
|
300
|
+
[CSS logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties)
|
|
301
|
+
for styling, `isElementRTL` for event handlers, and `shouldMirrorInRTL` for icons. If you need
|
|
302
|
+
`useIsRTL` for any other reason, please file a issue. See the [Icons](#icons) section for more
|
|
303
|
+
details on the new `shouldMirrorInRTL` prop.
|
|
304
|
+
|
|
290
305
|
## Component Updates
|
|
291
306
|
|
|
292
307
|
### Avatar (Preview)
|
|
@@ -347,9 +362,12 @@ revolve around the use of our new brand colors. For a better guide on what has c
|
|
|
347
362
|
tokens, please view the Tokens v3.0.0
|
|
348
363
|
[Upgrade Guide](https://workday.github.io/canvas-tokens/?path=/docs/guides-upgrade-guides-v3-overview--docs).
|
|
349
364
|
|
|
365
|
+
|
|
350
366
|
The following components have been updated (**see [v14 Visual Changes](/help/upgrade-guides/canvas-v14-upgrade-guide/#tab=visual-changes) for a visual reference of the updates**):
|
|
351
367
|
|
|
352
|
-
|
|
368
|
+
|
|
369
|
+
- `Breadcrumbs`
|
|
370
|
+
[#3270](https://github.com/Workday/canvas-kit/pull/3270),[#3447](https://github.com/Workday/canvas-kit/pull/3447)
|
|
353
371
|
- `Buttons` [#3394](https://github.com/Workday/canvas-kit/pull/3394)
|
|
354
372
|
- `ColorPicker` (Main) [#3307](https://github.com/Workday/canvas-kit/pull/3307)
|
|
355
373
|
- `ColorPicker` (preview) [#3307](https://github.com/Workday/canvas-kit/pull/3307)
|
|
@@ -369,9 +387,9 @@ The following components have been updated (**see [v14 Visual Changes](/help/upg
|
|
|
369
387
|
|
|
370
388
|
**Breaking Changes**
|
|
371
389
|
|
|
372
|
-
- The `TertiaryButton` component no longer supports the `isThemable` prop. To customize the
|
|
373
|
-
of `TertiaryButton`, use the `cs` prop for custom styles or the `colors` prop for
|
|
374
|
-
color overrides.
|
|
390
|
+
- The `TertiaryButton` component no longer supports the `isThemable` prop. To customize the
|
|
391
|
+
appearance of `TertiaryButton`, use the `cs` prop for custom styles or the `colors` prop for
|
|
392
|
+
palette-based color overrides.
|
|
375
393
|
- The shape of `TertiaryButton` has changed to have rounded corners, aligning with other buttons and
|
|
376
394
|
our new brand direction.
|
|
377
395
|
|
|
@@ -401,10 +419,10 @@ visual hierarchy and more flexible styling options. The following changes have b
|
|
|
401
419
|
|
|
402
420
|
#### Default Card No Longer Has a Box Shadow
|
|
403
421
|
|
|
404
|
-
The default `Card` variant no longer includes a box shadow, creating a cleaner, flatter appearance
|
|
405
|
-
aligns with our new brand's emphasis on simplicity and clarity. This is a **visual breaking
|
|
406
|
-
that may affect your application's visual hierarchy. If your design requires shadow you can
|
|
407
|
-
through the `cs` prop.
|
|
422
|
+
The default `Card` variant no longer includes a box shadow, creating a cleaner, flatter appearance
|
|
423
|
+
that aligns with our new brand's emphasis on simplicity and clarity. This is a **visual breaking
|
|
424
|
+
change** that may affect your application's visual hierarchy. If your design requires shadow you can
|
|
425
|
+
add it through the `cs` prop.
|
|
408
426
|
|
|
409
427
|
**Before in v13**
|
|
410
428
|
|
|
@@ -415,8 +433,7 @@ through the `cs` prop.
|
|
|
415
433
|
</Card>
|
|
416
434
|
```
|
|
417
435
|
|
|
418
|
-
**After in v14**
|
|
419
|
-
Only do this if you need a shadow. Otherwise, adhere to the default styling.
|
|
436
|
+
**After in v14** Only do this if you need a shadow. Otherwise, adhere to the default styling.
|
|
420
437
|
|
|
421
438
|
```tsx
|
|
422
439
|
import {system} from '@workday/canvas-tokens-web';
|
|
@@ -604,7 +621,7 @@ const customTheme = {
|
|
|
604
621
|
placeholderColor: colors.frenchVanilla100,
|
|
605
622
|
placeholderColorFocus: colors.blackPepper400,
|
|
606
623
|
boxShadow: ['10px 5px 5px red', '60px -16px teal'],
|
|
607
|
-
boxShadowFocus: ['10px 5px 5px red', '60px -16px teal']
|
|
624
|
+
boxShadowFocus: ['10px 5px 5px red', '60px -16px teal'],
|
|
608
625
|
} as SearchThemeAttributes;
|
|
609
626
|
|
|
610
627
|
<SearchForm
|
|
@@ -612,7 +629,7 @@ const customTheme = {
|
|
|
612
629
|
autocompleteItems={menuItems}
|
|
613
630
|
onInputChange={filterMenuItems}
|
|
614
631
|
onSubmit={handleSubmit}
|
|
615
|
-
|
|
632
|
+
/>;
|
|
616
633
|
```
|
|
617
634
|
|
|
618
635
|
**After in v14**
|
|
@@ -632,7 +649,7 @@ const customTheme = {
|
|
|
632
649
|
autocompleteItems={menuItems}
|
|
633
650
|
onInputChange={filterMenuItems}
|
|
634
651
|
onSubmit={handleSubmit}
|
|
635
|
-
|
|
652
|
+
/>;
|
|
636
653
|
```
|
|
637
654
|
|
|
638
655
|
- `SearchTheme` enum type has been updated to have string values `light`, `dark` and `transparent`.
|
|
@@ -677,6 +694,34 @@ deprecated. Use `StatusIndicatorProps['variant']` instead.
|
|
|
677
694
|
<StatusIndicator variant="neutral" />
|
|
678
695
|
```
|
|
679
696
|
|
|
697
|
+
### Icons
|
|
698
|
+
|
|
699
|
+
**PR:** [#3477](https://github.com/Workday/canvas-kit/pull/3477)
|
|
700
|
+
|
|
701
|
+
`shouldMirrorInRTL` has been added to `Icon` components (`SVG`, `SystemIcon`, `AccentIcon`,
|
|
702
|
+
`AppletIcon`, `SystemIconCircle`, `AIIngressButton`, `BaseButton.Icon`, `Button`,
|
|
703
|
+
`ToolbarDropdownButton`, `ToolbarIconButton`, `ButtonLabelIcon`, `PrimaryButton`, `SecondaryButton`,
|
|
704
|
+
and `TertiaryButton`). This is used to mirror the icon when the content direction is `rtl`. This is
|
|
705
|
+
meant to replace `useIsRTL` combined with the `shouldMirror` prop. Instead of getting the content
|
|
706
|
+
direction from JavaScript and passing to components, you can now pass `shouldMirrorInRTL={true}` to
|
|
707
|
+
the component which will mirror the icon only when the content direction is `rtl`.
|
|
708
|
+
|
|
709
|
+
**Before in v13**
|
|
710
|
+
|
|
711
|
+
```tsx
|
|
712
|
+
<IconComponent shouldMirror={useIsRTL()} />
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
**After in v14**
|
|
716
|
+
|
|
717
|
+
```tsx
|
|
718
|
+
<IconComponent shouldMirrorInRTL />
|
|
719
|
+
```
|
|
720
|
+
|
|
721
|
+
You can still use `shouldMirror` if you intend to always mirror an icon. This is less ideal because
|
|
722
|
+
you cannot use `shouldMirror` and `shouldMirrorInRTL` together. The icon will be mirrored regardless
|
|
723
|
+
of content direction if both props are used.
|
|
724
|
+
|
|
680
725
|
## Deprecations
|
|
681
726
|
|
|
682
727
|
We add the [@deprecated](https://jsdoc.app/tags-deprecated.html) JSDoc tag to code we plan to remove
|
|
@@ -708,7 +753,7 @@ import { Avatar } from '@workday/canvas-kit-react/avatar';
|
|
|
708
753
|
import {Avatar} from '@workday/canvas-kit-preview-react/avatar';
|
|
709
754
|
// name is used as a fallback if the image url is broken or still loading
|
|
710
755
|
// variant defines the color of the Avatar
|
|
711
|
-
<Avatar name="John Doe" size="extraExtraLarge" variant="teal" url={yourImageUrl}
|
|
756
|
+
<Avatar name="John Doe" size="extraExtraLarge" variant="teal" url={yourImageUrl} />;
|
|
712
757
|
```
|
|
713
758
|
|
|
714
759
|
If you need to render a `button` element use the `BaseAvatar` component.
|
|
@@ -724,7 +769,7 @@ import {BaseAvatar} from '@workday/canvas-kit-preview-react/avatar';
|
|
|
724
769
|
onClick={() => console.log('Avatar clicked')}
|
|
725
770
|
>
|
|
726
771
|
<BaseAvatar.Name name="John Doe" />
|
|
727
|
-
</BaseAvatar
|
|
772
|
+
</BaseAvatar>;
|
|
728
773
|
```
|
|
729
774
|
|
|
730
775
|
### Combobox (Labs)
|
|
@@ -785,8 +830,8 @@ system supported this for quite some time, but with the advancement in theming,
|
|
|
785
830
|
and our flexibility, it is time for us to finally remove this component. This component has served
|
|
786
831
|
as a reminder of how far we've come and we're thankful for this change.
|
|
787
832
|
|
|
788
|
-
Although unlikely, if you were using `DeprecatedButton` please use our flexible
|
|
789
|
-
|
|
833
|
+
Although unlikely, if you were using `DeprecatedButton` please use our flexible and themable buttons
|
|
834
|
+
like `PrimaryButton`, `SecondaryButton` or `TertiaryButton`.
|
|
790
835
|
|
|
791
836
|
### Input Provider
|
|
792
837
|
|
|
@@ -798,8 +843,8 @@ browser heuristics to determine when an element should receive visual focus styl
|
|
|
798
843
|
information, please view the
|
|
799
844
|
[MDN docs on `:focus-visible`](https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible).
|
|
800
845
|
|
|
801
|
-
If you are trying to apply focus styles to our components, we strongly advise using the
|
|
802
|
-
pseudo selector.
|
|
846
|
+
If you are trying to apply focus styles to our components, we strongly advise using the
|
|
847
|
+
`:focus-visible` pseudo selector.
|
|
803
848
|
|
|
804
849
|
```tsx
|
|
805
850
|
import {createStyles} from '@workday/canvas-kit-styling'
|
|
@@ -901,22 +946,26 @@ import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
|
901
946
|
|
|
902
947
|
### Common Issues
|
|
903
948
|
|
|
904
|
-
- **Dependency Conflicts**: When upgrading to the latest major version of Canvas Kit, all related
|
|
905
|
-
be updated at the same time:
|
|
949
|
+
- **Dependency Conflicts**: When upgrading to the latest major version of Canvas Kit, all related
|
|
950
|
+
Canvas Kit packages should be updated at the same time:
|
|
951
|
+
|
|
906
952
|
- `"@workday/canvas-kit-react": "^13.5.6"` → `"@workday/canvas-kit-react": "^14.0.0"`
|
|
907
953
|
- `"@workday/canvas-kit-styling": "^13.5.6"` → `"@workday/canvas-kit-styling": "^14.0.0"`
|
|
908
954
|
- `"@workday/canvas-kit-preview-react": "^13.5.6"` →
|
|
909
955
|
`"@workday/canvas-kit-preview-react": "^14.0.0"`
|
|
910
956
|
- `"@workday/canvas-kit-labs-react": "^13.5.6"` → `"@workday/canvas-kit-labs-react": "^14.0.0"`
|
|
911
957
|
|
|
912
|
-
- **Token Issues**: Our components rely on the `@workday/canvas-tokens-web` package which provides
|
|
913
|
-
and ensures the correct styling of our components. Make sure to upgrade to the
|
|
914
|
-
Canvas Tokens Web and install it correctly. For more information,
|
|
958
|
+
- **Token Issues**: Our components rely on the `@workday/canvas-tokens-web` package which provides
|
|
959
|
+
our CSS variables and ensures the correct styling of our components. Make sure to upgrade to the
|
|
960
|
+
latest version of Canvas Tokens Web and install it correctly. For more information,
|
|
915
961
|
[view our docs](https://workday.github.io/canvas-tokens/?path=/docs/docs-getting-started--docs).
|
|
916
962
|
|
|
917
|
-
- **Color Discrepancies**: If you notice visual differences after upgrading, this may be due to the
|
|
963
|
+
- **Color Discrepancies**: If you notice visual differences after upgrading, this may be due to the
|
|
964
|
+
change from `chroma.js` to `oklch` color generation. Consider providing explicit color values in
|
|
965
|
+
your theme configuration.
|
|
918
966
|
|
|
919
|
-
- **Build Errors**: If you encounter build errors after running the codemod, ensure your linter is
|
|
967
|
+
- **Build Errors**: If you encounter build errors after running the codemod, ensure your linter is
|
|
968
|
+
run as the codemod's formatting may not match your project conventions.
|
|
920
969
|
|
|
921
970
|
## Glossary
|
|
922
971
|
|
|
@@ -924,10 +973,15 @@ For an overview of the different packages we provide, please view our docs
|
|
|
924
973
|
[here](https://workday.github.io/canvas-kit/?path=/docs/guides-packages--docs).
|
|
925
974
|
|
|
926
975
|
### Main
|
|
976
|
+
|
|
927
977
|
Components in the Main package are stable and ready for production use.
|
|
928
978
|
|
|
929
979
|
### Preview
|
|
930
|
-
|
|
980
|
+
|
|
981
|
+
Components in the Preview package are mostly stable but may still receive breaking changes before
|
|
982
|
+
being promoted to Main.
|
|
931
983
|
|
|
932
984
|
### Labs
|
|
933
|
-
|
|
985
|
+
|
|
986
|
+
Components in the Labs package are experimental and may receive significant changes or be removed
|
|
987
|
+
entirely.
|
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.1255-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.1255-next.0",
|
|
49
|
+
"@workday/canvas-kit-preview-react": "^14.0.0-alpha.1255-next.0",
|
|
50
|
+
"@workday/canvas-kit-react": "^14.0.0-alpha.1255-next.0",
|
|
51
|
+
"@workday/canvas-kit-styling": "^14.0.0-alpha.1255-next.0",
|
|
52
52
|
"@workday/canvas-system-icons-web": "^3.0.35",
|
|
53
53
|
"@workday/canvas-tokens-web": "3.0.0-alpha.12",
|
|
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": "c9c268e7ad9537d58be91036c75c3ec66b586877"
|
|
65
65
|
}
|