@workday/canvas-kit-docs 14.0.0-alpha.1253-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.
@@ -9,9 +9,10 @@ any questions.
9
9
  v14.0 Introduces Workday's new brand direction which includes a new color palette and with it, some
10
10
  styling updates to our components.
11
11
 
12
- - For a list of visual changes, please view our v14 visual changes doc [here](https://workday.github.io/canvas-kit/?path=/docs/guides-upgrade-guides-v14-0-visual-changes--docs).
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 the latest to ensure proper branding.
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
 
@@ -20,6 +21,7 @@ styling updates to our components.
20
21
  - [Tokens](#tokens)
21
22
  - [Caution Naming](#caution-naming)
22
23
  - [Theming](#theming)
24
+ - [New Documentation](#new-documentation)
23
25
  - [Canvas Provider](#canvas-provider-)
24
26
  - [Component Updates](#component-updates)
25
27
  - [Avatar (Preview)](#avatar-preview)
@@ -33,6 +35,7 @@ styling updates to our components.
33
35
  - [Pill (Preview)](#pill-preview)
34
36
  - [Search Form (Labs)](#searchform-)
35
37
  - [Status Indicator (Preview)](#status-indicator-preview-)
38
+ - [Icons](#icons)
36
39
  - [Deprecations](#deprecations)
37
40
  - [Avatar (Main)](#avatar-in-main)
38
41
  - [Combobox (Labs)](#combobox-labs)
@@ -41,6 +44,7 @@ styling updates to our components.
41
44
  - [Segmented Control (Main)](#segmented-control-main)
42
45
  - [Side Panel (Main)](#side-panel-main)
43
46
  - [Tokens](#tokens)
47
+ - [useIsRTL](#useisrtl)
44
48
  - [Removals](#removals)
45
49
  - [Deprecated Buttons](#deprecated-buttons)
46
50
  - [Input Provider](#input-provider)
@@ -118,8 +122,8 @@ yarn remove @workday/canvas-kit-codemod
118
122
  ## Tokens
119
123
 
120
124
  Canvas Kit v14 now uses `@workday/canvas-tokens-web` v3, which introduces new color palettes and
121
- deprecates the old "fruity" color names (for example, use `red` instead of `cinnamon`, `blue` instead
122
- 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
123
127
  `@workday/canvas-tokens-web` v3, as using older versions will not match the new brand guidelines or
124
128
  color system. Although this dependency upgrade is not required, we've offered migration guides and
125
129
  codemods separately from the v14 upgrade so that teams can upgrade when they can.
@@ -144,7 +148,8 @@ Follow these guides to migrate:
144
148
  To better align with the brand refresh, Alert and Warning states are being renamed to Caution for
145
149
  better semantics.
146
150
 
147
- This change mostly affects how you pass an error state to our input components. In most cases, our input components should be used with our `FormField` component to ensure correct accessibility.
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.
148
153
 
149
154
  **Before in v13**
150
155
 
@@ -170,7 +175,8 @@ This change mostly affects how you pass an error state to our input components.
170
175
  </FormField>
171
176
  ```
172
177
 
173
- If you are using the error type either from our `Common` package or the one exposed from the component, the naming has also changed.
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.
174
180
 
175
181
  **Before in v13**
176
182
 
@@ -207,6 +213,10 @@ someFunction(ErrorType.Caution);
207
213
 
208
214
  ## Theming
209
215
 
216
+ ### New Documentation
217
+
218
+ We've **significantly** improved our theming documentation. Please consult our new [Canvas Kit Theming Guide](/get-started/for-developers/theming/overview/).
219
+
210
220
  ### Canvas Provider 🚨
211
221
 
212
222
  **PRs:** [#3407](https://github.com/Workday/canvas-kit/pull/3407),
@@ -221,11 +231,9 @@ Canvas Provider has been updated to **remove** default branding colors to ensure
221
231
  our CSS variables. Instead of generating a palette and shifting the brightness and darkness with
222
232
  `chroma.js`, we use `oklch` to generate the palette colors.
223
233
 
224
- Prior to v14, the `CanvasProvider` created a cascade barrier, re definding brand CSS variables under a class, creating a higher specificity. This made it difficult to override brand tokens in certain scenarios. v14 Removes that barrier.
225
- For more information on what is a cascade barrier, please [view our theming docs here](https://github.com/Workday/canvas-kit/issues). For a mode detailed overview of the changes in v14, please view our [v14 Upgrade Guide](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs#what-is-a-cascade-barrier).
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.
226
235
 
227
- **Before in v13**
228
- 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
229
237
  palette given a `main` color via `chroma.js`.
230
238
 
231
239
  ```tsx
@@ -283,7 +291,16 @@ The reason for this change is to ensure that the CSS variables properly cascade
283
291
  Before in v13, the `CanvasProvider` would add the brand tokens under a class name, creating a higher
284
292
  specificity.
285
293
 
286
- For a thorough guide on theming, please view our theming docs [here](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs).
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.
287
304
 
288
305
  ## Component Updates
289
306
 
@@ -345,11 +362,12 @@ revolve around the use of our new brand colors. For a better guide on what has c
345
362
  tokens, please view the Tokens v3.0.0
346
363
  [Upgrade Guide](https://workday.github.io/canvas-tokens/?path=/docs/guides-upgrade-guides-v3-overview--docs).
347
364
 
348
- > **Note:** If you want a visual diff of the changes, please view the [Visual Changes](https://workday.github.io/canvas-kit/?path=/docs/guides-upgrade-guides-v14-0-visual-changes--docs) guide.
349
365
 
350
- The following components have been updated:
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**):
367
+
351
368
 
352
- - `Breadcrumbs` [#3270](https://github.com/Workday/canvas-kit/pull/3270),[#3447](https://github.com/Workday/canvas-kit/pull/3447)
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:
369
387
 
370
388
  **Breaking Changes**
371
389
 
372
- - The `TertiaryButton` component no longer supports the `isThemable` prop. To customize the appearance
373
- of `TertiaryButton`, use the `cs` prop for custom styles or the `colors` prop for palette-based
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 that
405
- aligns with our new brand's emphasis on simplicity and clarity. This is a **visual breaking change**
406
- that may affect your application's visual hierarchy. If your design requires shadow you can add it
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
- and themable buttons like `PrimaryButton`, `SecondaryButton` or `TertiaryButton`.
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 `:focus-visible`
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 Canvas Kit packages should
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 our CSS variables
913
- and ensures the correct styling of our components. Make sure to upgrade to the latest version of
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 change from `chroma.js` to `oklch` color generation. Consider providing explicit color values in your theme configuration.
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 run as the codemod's formatting may not match your project conventions.
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
- Components in the Preview package are mostly stable but may still receive breaking changes before being promoted to Main.
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
- Components in the Labs package are experimental and may receive significant changes or be removed entirely.
985
+
986
+ Components in the Labs package are experimental and may receive significant changes or be removed
987
+ entirely.
@@ -22,7 +22,7 @@ import textInputImage from './images/v14-text-input.png';
22
22
 
23
23
  # Canvas Kit 14.0 Visual Changes
24
24
 
25
- This guide contains an overview of the changes in Canvas Kit v14. If you have any issues, feel free to report them [here](https://github.com/Workday/canvas-kit/issues). For a mode detailed overview of the changes in v14, please view our [v14 Upgrade Guide](https://workday.github.io/canvas-kit/?path=/docs/guides-upgrade-guides-v14-0-overview--docs).
25
+ This guide contains an overview of the changes in Canvas Kit v14. If you have any issues, feel free to report them [here](https://github.com/Workday/canvas-kit/issues). For a mode detailed overview of the changes in v14, please view our [v14 Upgrade Guide](/help/upgrade-guides/canvas-v14-upgrade-guide/).
26
26
 
27
27
  <Graphic src={{url: avatarImage}} />
28
28
  <Graphic src={{url: breadcrumbsImage}} />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "14.0.0-alpha.1253-next.0",
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.1253-next.0",
49
- "@workday/canvas-kit-preview-react": "^14.0.0-alpha.1253-next.0",
50
- "@workday/canvas-kit-react": "^14.0.0-alpha.1253-next.0",
51
- "@workday/canvas-kit-styling": "^14.0.0-alpha.1253-next.0",
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": "7b01743972e4f21990fe36d90fa5938f25c57410"
64
+ "gitHead": "c9c268e7ad9537d58be91036c75c3ec66b586877"
65
65
  }