@workday/canvas-kit-docs 14.0.0-alpha.1225-next.0 → 14.0.0-alpha.1229-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.
@@ -68336,9 +68336,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
68336
68336
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/status-indicator/lib/StatusIndicator.tsx"
68337
68337
  }
68338
68338
  ],
68339
- "tags": {
68340
- "deprecated": "This is being deprecated and will be removed in a future release."
68341
- }
68339
+ "tags": {}
68342
68340
  }
68343
68341
  ]
68344
68342
  },
@@ -68351,8 +68349,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
68351
68349
  }
68352
68350
  ],
68353
68351
  "tags": {
68354
- "default": "'low'",
68355
- "deprecated": "This is being deprecated and will be removed in a future release. `high` is being removed"
68352
+ "default": "'low'"
68356
68353
  }
68357
68354
  },
68358
68355
  {
@@ -363545,327 +363542,19 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
363545
363542
  }
363546
363543
  },
363547
363544
  {
363548
- "name": "MenuPopperProps",
363545
+ "name": "TabsMenuPopperProps",
363549
363546
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/tabs/lib/TabsMenuPopper.tsx",
363550
363547
  "description": "",
363551
363548
  "declarations": [
363552
363549
  {
363553
- "name": "MenuPopperProps",
363550
+ "name": "TabsMenuPopperProps",
363554
363551
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/tabs/lib/TabsMenuPopper.tsx"
363555
363552
  }
363556
363553
  ],
363557
363554
  "tags": {},
363558
363555
  "type": {
363559
- "kind": "object",
363560
- "properties": [
363561
- {
363562
- "kind": "property",
363563
- "name": "anchorElement",
363564
- "required": false,
363565
- "type": {
363566
- "kind": "union",
363567
- "value": [
363568
- {
363569
- "kind": "symbol",
363570
- "name": "React.RefObject",
363571
- "typeParameters": [
363572
- {
363573
- "kind": "external",
363574
- "name": "Element",
363575
- "url": "https://developer.mozilla.org/en-US/docs/Web/API/element"
363576
- }
363577
- ],
363578
- "value": "RefObject<T>"
363579
- },
363580
- {
363581
- "kind": "external",
363582
- "name": "Element",
363583
- "url": "https://developer.mozilla.org/en-US/docs/Web/API/element"
363584
- },
363585
- {
363586
- "kind": "primitive",
363587
- "value": "null"
363588
- }
363589
- ]
363590
- },
363591
- "description": "The reference element used to position the Popper. Popper content will try to follow the\n`anchorElement` if it moves and will reposition itself if there is no longer room in the\nwindow.",
363592
- "declarations": [
363593
- {
363594
- "name": "anchorElement",
363595
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
363596
- }
363597
- ],
363598
- "tags": {}
363599
- },
363600
- {
363601
- "kind": "property",
363602
- "name": "children",
363603
- "required": true,
363604
- "type": {
363605
- "kind": "union",
363606
- "value": [
363607
- {
363608
- "kind": "parenthesis",
363609
- "value": {
363610
- "kind": "function",
363611
- "parameters": [
363612
- {
363613
- "kind": "parameter",
363614
- "name": "props",
363615
- "type": {
363616
- "kind": "object",
363617
- "properties": [
363618
- {
363619
- "kind": "property",
363620
- "name": "placement",
363621
- "required": true,
363622
- "type": {
363623
- "kind": "symbol",
363624
- "name": "Placement",
363625
- "value": "Placement"
363626
- },
363627
- "description": "",
363628
- "declarations": [
363629
- {
363630
- "name": "placement",
363631
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
363632
- }
363633
- ],
363634
- "tags": {}
363635
- }
363636
- ]
363637
- },
363638
- "required": true,
363639
- "rest": false,
363640
- "description": "",
363641
- "declarations": [
363642
- {
363643
- "name": "props",
363644
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
363645
- }
363646
- ],
363647
- "tags": {}
363648
- }
363649
- ],
363650
- "members": [],
363651
- "returnType": {
363652
- "kind": "external",
363653
- "name": "ReactNode",
363654
- "url": "https://reactjs.org/docs/rendering-elements.html"
363655
- }
363656
- }
363657
- },
363658
- {
363659
- "kind": "external",
363660
- "name": "ReactNode",
363661
- "url": "https://reactjs.org/docs/rendering-elements.html"
363662
- }
363663
- ]
363664
- },
363665
- "description": "The content of the Popper. If a function is provided, it will be treated as a Render Prop and\npass the `placement` chosen by PopperJS. This `placement` value is useful if your popup needs\nto animate and that animation depends on the direction of the content in relation to the\n`anchorElement`.",
363666
- "declarations": [
363667
- {
363668
- "name": "children",
363669
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
363670
- }
363671
- ],
363672
- "tags": {}
363673
- },
363674
- {
363675
- "kind": "property",
363676
- "name": "getAnchorClientRect",
363677
- "required": false,
363678
- "type": {
363679
- "kind": "function",
363680
- "parameters": [],
363681
- "members": [],
363682
- "returnType": {
363683
- "kind": "symbol",
363684
- "name": "DOMRect",
363685
- "value": "DOMRect"
363686
- }
363687
- },
363688
- "description": "When provided, this optional callback will be used to determine positioning for the Popper element\ninstead of calling `getBoundingClientRect` on the `anchorElement` prop. Use this when you need\ncomplete control over positioning. When this prop is specified, it is safe to pass `null` into the\n`anchorElement` prop. If `null` is passed into the `anchorElement` prop, an `owner` will not be\nprovided for the `PopupStack`.",
363689
- "declarations": [
363690
- {
363691
- "name": "getAnchorClientRect",
363692
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
363693
- }
363694
- ],
363695
- "tags": {}
363696
- },
363697
- {
363698
- "kind": "property",
363699
- "name": "open",
363700
- "required": false,
363701
- "type": {
363702
- "kind": "primitive",
363703
- "value": "boolean"
363704
- },
363705
- "description": "Determines if `Popper` content should be rendered. The content only exists in the DOM when\n`open` is `true`",
363706
- "declarations": [
363707
- {
363708
- "name": "open",
363709
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
363710
- }
363711
- ],
363712
- "tags": {
363713
- "default": "true"
363714
- }
363715
- },
363716
- {
363717
- "kind": "property",
363718
- "name": "placement",
363719
- "required": false,
363720
- "type": {
363721
- "kind": "symbol",
363722
- "name": "Placement",
363723
- "value": "Placement"
363724
- },
363725
- "description": "The placement of the `Popper` contents relative to the `anchorElement`. Accepts `auto`, `top`,\n`right`, `bottom`, or `left`. Each placement can also be modified using any of the following\nvariations: `-start` or `-end`.",
363726
- "declarations": [
363727
- {
363728
- "name": "placement",
363729
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
363730
- }
363731
- ],
363732
- "tags": {
363733
- "default": "bottom"
363734
- }
363735
- },
363736
- {
363737
- "kind": "property",
363738
- "name": "fallbackPlacements",
363739
- "required": false,
363740
- "type": {
363741
- "kind": "array",
363742
- "value": {
363743
- "kind": "symbol",
363744
- "name": "Placement",
363745
- "value": "Placement"
363746
- }
363747
- },
363748
- "description": "Define fallback placements by providing a list of {@link Placement} in array (in order of preference).\nThe default preference is following the order of `top`, `right`, `bottom`, and `left`. Once the initial\nand opposite placements are not available, the fallback placements will be in use. Use an empty array to\ndisable the fallback placements.",
363749
- "declarations": [
363750
- {
363751
- "name": "fallbackPlacements",
363752
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
363753
- }
363754
- ],
363755
- "tags": {}
363756
- },
363757
- {
363758
- "kind": "property",
363759
- "name": "onPlacementChange",
363760
- "required": false,
363761
- "type": {
363762
- "kind": "function",
363763
- "parameters": [
363764
- {
363765
- "kind": "parameter",
363766
- "name": "placement",
363767
- "type": {
363768
- "kind": "symbol",
363769
- "name": "Placement",
363770
- "value": "Placement"
363771
- },
363772
- "required": true,
363773
- "rest": false,
363774
- "description": "",
363775
- "declarations": [
363776
- {
363777
- "name": "placement",
363778
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
363779
- }
363780
- ],
363781
- "tags": {}
363782
- }
363783
- ],
363784
- "members": [],
363785
- "returnType": {
363786
- "kind": "primitive",
363787
- "value": "void"
363788
- }
363789
- },
363790
- "description": "A callback function that will be called whenever PopperJS chooses a placement that is different\nfrom the provided `placement` preference. If a `placement` preference doesn't fit, PopperJS\nwill choose a new one and call this callback.",
363791
- "declarations": [
363792
- {
363793
- "name": "onPlacementChange",
363794
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
363795
- }
363796
- ],
363797
- "tags": {}
363798
- },
363799
- {
363800
- "kind": "property",
363801
- "name": "popperOptions",
363802
- "required": false,
363803
- "type": {
363804
- "kind": "symbol",
363805
- "name": "Partial",
363806
- "typeParameters": [
363807
- {
363808
- "kind": "external",
363809
- "name": "PopperOptions",
363810
- "url": "https://popper.js.org/docs/v2/constructors/#options"
363811
- }
363812
- ],
363813
- "value": "Partial<T>"
363814
- },
363815
- "description": "The additional options passed to the Popper's `popper.js` instance.",
363816
- "declarations": [
363817
- {
363818
- "name": "popperOptions",
363819
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
363820
- }
363821
- ],
363822
- "tags": {}
363823
- },
363824
- {
363825
- "kind": "property",
363826
- "name": "portal",
363827
- "required": false,
363828
- "type": {
363829
- "kind": "primitive",
363830
- "value": "boolean"
363831
- },
363832
- "description": "If false, render the Popper within the\nDOM hierarchy of its parent. A non-portal Popper will constrained by the parent container\noverflows. If you set this to `false`, you may experience issues where you content gets cut off\nby scrollbars or `overflow: hidden`",
363833
- "declarations": [
363834
- {
363835
- "name": "portal",
363836
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
363837
- }
363838
- ],
363839
- "tags": {
363840
- "default": "true"
363841
- }
363842
- },
363843
- {
363844
- "kind": "property",
363845
- "name": "popperInstanceRef",
363846
- "required": false,
363847
- "type": {
363848
- "kind": "external",
363849
- "name": "Ref",
363850
- "url": "https://reactjs.org/docs/refs-and-the-dom.html",
363851
- "typeParameters": [
363852
- {
363853
- "kind": "symbol",
363854
- "name": "Instance",
363855
- "value": "Instance"
363856
- }
363857
- ]
363858
- },
363859
- "description": "Reference to the PopperJS instance. Useful for making direct method calls on the popper\ninstance like `update`.",
363860
- "declarations": [
363861
- {
363862
- "name": "popperInstanceRef",
363863
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
363864
- }
363865
- ],
363866
- "tags": {}
363867
- }
363868
- ]
363556
+ "kind": "alias",
363557
+ "name": "TabsMenuPopper"
363869
363558
  }
363870
363559
  },
363871
363560
  {
@@ -418464,6 +418153,46 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
418464
418153
  }
418465
418154
  }
418466
418155
  },
418156
+ {
418157
+ "name": "maybeWrapCSSVariables",
418158
+ "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/lib/cs.ts",
418159
+ "description": "Wrap all unwrapped CSS Variables. For example, `{padding: '--foo'}` will be replaced with\n`{padding: 'var(--foo)'}`. It also works on variables in the middle of the property. Takes any\nstring and returns a string with CSS variables wrapped if necessary.\n\n```ts\nmaybeWrapCSSVariables('1rem'); // 1rem\nmaybeWrapCSSVariables('--foo'); // var(--foo)\nmaybeWrapCSSVariables('var(--foo)'); // var(--foo)\nmaybeWrapCSSVariables('calc(--foo)'); // calc(var(--foo))\n```",
418160
+ "declarations": [
418161
+ {
418162
+ "name": "maybeWrapCSSVariables",
418163
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/lib/cs.ts"
418164
+ }
418165
+ ],
418166
+ "tags": {},
418167
+ "type": {
418168
+ "kind": "function",
418169
+ "parameters": [
418170
+ {
418171
+ "kind": "parameter",
418172
+ "name": "input",
418173
+ "type": {
418174
+ "kind": "primitive",
418175
+ "value": "string"
418176
+ },
418177
+ "required": true,
418178
+ "rest": false,
418179
+ "description": "",
418180
+ "declarations": [
418181
+ {
418182
+ "name": "input",
418183
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/lib/cs.ts"
418184
+ }
418185
+ ],
418186
+ "tags": {}
418187
+ }
418188
+ ],
418189
+ "members": [],
418190
+ "returnType": {
418191
+ "kind": "primitive",
418192
+ "value": "string"
418193
+ }
418194
+ }
418195
+ },
418467
418196
  {
418468
418197
  "name": "wrapProperty",
418469
418198
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/lib/cs.ts",
@@ -18,11 +18,11 @@ export const packageJSONFile = `{
18
18
  "@emotion/react": "11.11.4",
19
19
  "@types/react": "18.2.60",
20
20
  "@types/react-dom": "18.2.19",
21
- "@workday/canvas-kit-labs-react": "13.2.23",
22
- "@workday/canvas-kit-preview-react": "13.2.23",
23
- "@workday/canvas-kit-react": "13.2.23",
24
- "@workday/canvas-kit-react-fonts": "^13.2.23",
25
- "@workday/canvas-kit-styling": "13.2.23",
21
+ "@workday/canvas-kit-labs-react": "13.2.24",
22
+ "@workday/canvas-kit-preview-react": "13.2.24",
23
+ "@workday/canvas-kit-react": "13.2.24",
24
+ "@workday/canvas-kit-react-fonts": "^13.2.24",
25
+ "@workday/canvas-kit-styling": "13.2.24",
26
26
  "@workday/canvas-system-icons-web": "3.0.22",
27
27
  "@workday/canvas-tokens-web": "2.0.0"
28
28
  },
@@ -18,11 +18,11 @@ export const packageJSONFile = `{
18
18
  "@emotion/react": "11.11.4",
19
19
  "@types/react": "18.2.60",
20
20
  "@types/react-dom": "18.2.19",
21
- "@workday/canvas-kit-labs-react": "13.2.23",
22
- "@workday/canvas-kit-preview-react": "13.2.23",
23
- "@workday/canvas-kit-react": "13.2.23",
24
- "@workday/canvas-kit-react-fonts": "^13.2.23",
25
- "@workday/canvas-kit-styling": "13.2.23",
21
+ "@workday/canvas-kit-labs-react": "13.2.24",
22
+ "@workday/canvas-kit-preview-react": "13.2.24",
23
+ "@workday/canvas-kit-react": "13.2.24",
24
+ "@workday/canvas-kit-react-fonts": "^13.2.24",
25
+ "@workday/canvas-kit-styling": "13.2.24",
26
26
  "@workday/canvas-system-icons-web": "3.0.22",
27
27
  "@workday/canvas-tokens-web": "2.0.0"
28
28
  },
@@ -9,6 +9,7 @@ any questions.
9
9
  - [Codemod](#codemod)
10
10
  - [Instructions](#instructions)
11
11
  - [Theming](#theming)
12
+ - [Canvas Provider](#canvas-provider-)
12
13
  - [Component Updates](#component-updates)
13
14
  - [Avatar in Preview](#avatar-in-preview)
14
15
  - [Branding Changes](#branding-changes)
@@ -101,10 +102,64 @@ yarn remove @workday/canvas-kit-codemod
101
102
 
102
103
  ## Theming
103
104
 
104
- **PR:** [#3394](https://github.com/Workday/canvas-kit/pull/3394)
105
+ ### Canvas Provider 🚨
105
106
 
106
- - `CanvasThemePalette` has been updated to include a `lighter` color.
107
- - `CanvasTheme` has been updated to include a `lighter` color.
107
+ **PRs:** [#3407](https://github.com/Workday/canvas-kit/pull/3407), [#3394](https://github.com/Workday/canvas-kit/pull/3394)
108
+
109
+ - `CanvasThemePalette` and `CanvasTheme` type have been updated to include a `lighter` property.
110
+ - `CanvasProvider` `theme` prop has been updated to include a `lighter` color for each palette.
111
+
112
+ #### Breaking Changes
113
+
114
+ Canvas Provider has been updated to **remove** default branding colors to ensure proper cascading of our CSS variables. Instead of generating a palette and shifting the brightness and darkness with `chroma.js`, we use `oklch` to generate the palette colors.
115
+
116
+ **Before in v13**
117
+ In v13, the `useTheme` hook would call `createCanvasTheme` which generated a palette given a `main` color via `chroma.js`.
118
+
119
+ ```tsx
120
+ <CanvasProvider theme={{canvas: {palette: {primary: {main: 'purple'}}}}}>
121
+ <App/>
122
+ </CanvasProvider>
123
+ ```
124
+
125
+ **After in v14**
126
+ We use `oklch` to generate the palette colors. The color shifting will be different. If you want more control over the colors, we suggest providing the full palette object.
127
+
128
+ ```tsx
129
+ <CanvasProvider theme={
130
+ {canvas: {
131
+ palette: {
132
+ primary: {
133
+ lightest: base.blue25,
134
+ light: base.blue200,
135
+ main: base.blue600,
136
+ dark: base.blue700,
137
+ darkest: base.blue800,
138
+ contrast: base.neutral0,
139
+ },
140
+ },
141
+ }}}>
142
+ <App/>
143
+ </CanvasProvider>
144
+ ```
145
+
146
+ **Or**
147
+
148
+ ```tsx
149
+ <CanvasProvider theme={{canvas: {palette: {primary: {main: cssVar(base.blue600)}}}}}>
150
+ <App/>
151
+ </CanvasProvider>
152
+ ```
153
+
154
+ > **Note:** The way `chroma.js` and `oklch` generate colors **is different**. While we work on a better algorithm to determine hue, chroma and lightness and color shifting that best represents an accessible palette, **you may see color discrepancies**. If you want to continue using the old way of generating a color palette with `chroma.js`, you can use `createCanvasTheme`.
155
+
156
+ ```tsx
157
+ <CanvasProvider theme={{canvas: createCanvasTheme({palette: {primary: {main: cssVar(base.blue600)}}})}}>
158
+ <App/>
159
+ </CanvasProvider>
160
+ ```
161
+
162
+ The reason for this change is to ensure that the CSS variables properly cascade to all components. Before in v13, the `CanvasProvider` would add the brand tokens under a class name, creating a higher specificity.
108
163
 
109
164
  ## Component Updates
110
165
 
@@ -420,8 +475,7 @@ const customTheme = {
420
475
 
421
476
  **PR:** [#3287](https://github.com/Workday/canvas-kit/pull/3287)
422
477
 
423
- Preview `StatusIndicator` is a rounder and more vibrant base emphasis (`low`). The `emphasis` prop
424
- is now deprecated and the `high` emphasis will be removed in a later version.
478
+ Preview `StatusIndicator` is a rounder and more vibrant base emphasis (`low`).
425
479
 
426
480
  Variant names of the preview `StatusIndicator` have been updated by the following mapping:
427
481
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
3
3
  import {CanvasProvider, PartialEmotionCanvasTheme} from '@workday/canvas-kit-react/common';
4
- import {system} from '@workday/canvas-tokens-web';
4
+ import {system, base} from '@workday/canvas-tokens-web';
5
5
  import {cssVar} from '@workday/canvas-kit-styling';
6
6
 
7
7
  export default () => {
@@ -15,11 +15,12 @@ export default () => {
15
15
  canvas: {
16
16
  palette: {
17
17
  error: {
18
- lightest: cssVar(system.color.static.amber.softer),
18
+ lightest: cssVar(base.purple100),
19
+ main: cssVar(base.purple600),
19
20
  },
20
21
  common: {
21
22
  focusOutline: cssVar(system.color.static.green.default),
22
- errorInner: cssVar(system.color.static.amber.stronger),
23
+ errorInner: cssVar(base.purple600),
23
24
  },
24
25
  },
25
26
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "14.0.0-alpha.1225-next.0",
3
+ "version": "14.0.0-alpha.1229-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.1225-next.0",
49
- "@workday/canvas-kit-preview-react": "^14.0.0-alpha.1225-next.0",
50
- "@workday/canvas-kit-react": "^14.0.0-alpha.1225-next.0",
51
- "@workday/canvas-kit-styling": "^14.0.0-alpha.1225-next.0",
48
+ "@workday/canvas-kit-labs-react": "^14.0.0-alpha.1229-next.0",
49
+ "@workday/canvas-kit-preview-react": "^14.0.0-alpha.1229-next.0",
50
+ "@workday/canvas-kit-react": "^14.0.0-alpha.1229-next.0",
51
+ "@workday/canvas-kit-styling": "^14.0.0-alpha.1229-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": "521a212f0bb4fa645b980f065086277464445490"
64
+ "gitHead": "9058e7f2709a2212664672616bf6c8222f3e6eba"
65
65
  }