@workday/canvas-kit-docs 14.0.0-alpha.1227-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.
- package/dist/es6/lib/docs.js +44 -312
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +5 -5
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +5 -5
- package/dist/mdx/14.0-UPGRADE-GUIDE.mdx +58 -3
- package/dist/mdx/preview-react/text-input/examples/ThemedError.tsx +4 -3
- package/package.json +6 -6
package/dist/es6/lib/docs.js
CHANGED
|
@@ -363542,327 +363542,19 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
363542
363542
|
}
|
|
363543
363543
|
},
|
|
363544
363544
|
{
|
|
363545
|
-
"name": "
|
|
363545
|
+
"name": "TabsMenuPopperProps",
|
|
363546
363546
|
"fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/tabs/lib/TabsMenuPopper.tsx",
|
|
363547
363547
|
"description": "",
|
|
363548
363548
|
"declarations": [
|
|
363549
363549
|
{
|
|
363550
|
-
"name": "
|
|
363550
|
+
"name": "TabsMenuPopperProps",
|
|
363551
363551
|
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/tabs/lib/TabsMenuPopper.tsx"
|
|
363552
363552
|
}
|
|
363553
363553
|
],
|
|
363554
363554
|
"tags": {},
|
|
363555
363555
|
"type": {
|
|
363556
|
-
"kind": "
|
|
363557
|
-
"
|
|
363558
|
-
{
|
|
363559
|
-
"kind": "property",
|
|
363560
|
-
"name": "anchorElement",
|
|
363561
|
-
"required": false,
|
|
363562
|
-
"type": {
|
|
363563
|
-
"kind": "union",
|
|
363564
|
-
"value": [
|
|
363565
|
-
{
|
|
363566
|
-
"kind": "symbol",
|
|
363567
|
-
"name": "React.RefObject",
|
|
363568
|
-
"typeParameters": [
|
|
363569
|
-
{
|
|
363570
|
-
"kind": "external",
|
|
363571
|
-
"name": "Element",
|
|
363572
|
-
"url": "https://developer.mozilla.org/en-US/docs/Web/API/element"
|
|
363573
|
-
}
|
|
363574
|
-
],
|
|
363575
|
-
"value": "RefObject<T>"
|
|
363576
|
-
},
|
|
363577
|
-
{
|
|
363578
|
-
"kind": "external",
|
|
363579
|
-
"name": "Element",
|
|
363580
|
-
"url": "https://developer.mozilla.org/en-US/docs/Web/API/element"
|
|
363581
|
-
},
|
|
363582
|
-
{
|
|
363583
|
-
"kind": "primitive",
|
|
363584
|
-
"value": "null"
|
|
363585
|
-
}
|
|
363586
|
-
]
|
|
363587
|
-
},
|
|
363588
|
-
"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.",
|
|
363589
|
-
"declarations": [
|
|
363590
|
-
{
|
|
363591
|
-
"name": "anchorElement",
|
|
363592
|
-
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
|
|
363593
|
-
}
|
|
363594
|
-
],
|
|
363595
|
-
"tags": {}
|
|
363596
|
-
},
|
|
363597
|
-
{
|
|
363598
|
-
"kind": "property",
|
|
363599
|
-
"name": "children",
|
|
363600
|
-
"required": true,
|
|
363601
|
-
"type": {
|
|
363602
|
-
"kind": "union",
|
|
363603
|
-
"value": [
|
|
363604
|
-
{
|
|
363605
|
-
"kind": "parenthesis",
|
|
363606
|
-
"value": {
|
|
363607
|
-
"kind": "function",
|
|
363608
|
-
"parameters": [
|
|
363609
|
-
{
|
|
363610
|
-
"kind": "parameter",
|
|
363611
|
-
"name": "props",
|
|
363612
|
-
"type": {
|
|
363613
|
-
"kind": "object",
|
|
363614
|
-
"properties": [
|
|
363615
|
-
{
|
|
363616
|
-
"kind": "property",
|
|
363617
|
-
"name": "placement",
|
|
363618
|
-
"required": true,
|
|
363619
|
-
"type": {
|
|
363620
|
-
"kind": "symbol",
|
|
363621
|
-
"name": "Placement",
|
|
363622
|
-
"value": "Placement"
|
|
363623
|
-
},
|
|
363624
|
-
"description": "",
|
|
363625
|
-
"declarations": [
|
|
363626
|
-
{
|
|
363627
|
-
"name": "placement",
|
|
363628
|
-
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
|
|
363629
|
-
}
|
|
363630
|
-
],
|
|
363631
|
-
"tags": {}
|
|
363632
|
-
}
|
|
363633
|
-
]
|
|
363634
|
-
},
|
|
363635
|
-
"required": true,
|
|
363636
|
-
"rest": false,
|
|
363637
|
-
"description": "",
|
|
363638
|
-
"declarations": [
|
|
363639
|
-
{
|
|
363640
|
-
"name": "props",
|
|
363641
|
-
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
|
|
363642
|
-
}
|
|
363643
|
-
],
|
|
363644
|
-
"tags": {}
|
|
363645
|
-
}
|
|
363646
|
-
],
|
|
363647
|
-
"members": [],
|
|
363648
|
-
"returnType": {
|
|
363649
|
-
"kind": "external",
|
|
363650
|
-
"name": "ReactNode",
|
|
363651
|
-
"url": "https://reactjs.org/docs/rendering-elements.html"
|
|
363652
|
-
}
|
|
363653
|
-
}
|
|
363654
|
-
},
|
|
363655
|
-
{
|
|
363656
|
-
"kind": "external",
|
|
363657
|
-
"name": "ReactNode",
|
|
363658
|
-
"url": "https://reactjs.org/docs/rendering-elements.html"
|
|
363659
|
-
}
|
|
363660
|
-
]
|
|
363661
|
-
},
|
|
363662
|
-
"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`.",
|
|
363663
|
-
"declarations": [
|
|
363664
|
-
{
|
|
363665
|
-
"name": "children",
|
|
363666
|
-
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
|
|
363667
|
-
}
|
|
363668
|
-
],
|
|
363669
|
-
"tags": {}
|
|
363670
|
-
},
|
|
363671
|
-
{
|
|
363672
|
-
"kind": "property",
|
|
363673
|
-
"name": "getAnchorClientRect",
|
|
363674
|
-
"required": false,
|
|
363675
|
-
"type": {
|
|
363676
|
-
"kind": "function",
|
|
363677
|
-
"parameters": [],
|
|
363678
|
-
"members": [],
|
|
363679
|
-
"returnType": {
|
|
363680
|
-
"kind": "symbol",
|
|
363681
|
-
"name": "DOMRect",
|
|
363682
|
-
"value": "DOMRect"
|
|
363683
|
-
}
|
|
363684
|
-
},
|
|
363685
|
-
"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`.",
|
|
363686
|
-
"declarations": [
|
|
363687
|
-
{
|
|
363688
|
-
"name": "getAnchorClientRect",
|
|
363689
|
-
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
|
|
363690
|
-
}
|
|
363691
|
-
],
|
|
363692
|
-
"tags": {}
|
|
363693
|
-
},
|
|
363694
|
-
{
|
|
363695
|
-
"kind": "property",
|
|
363696
|
-
"name": "open",
|
|
363697
|
-
"required": false,
|
|
363698
|
-
"type": {
|
|
363699
|
-
"kind": "primitive",
|
|
363700
|
-
"value": "boolean"
|
|
363701
|
-
},
|
|
363702
|
-
"description": "Determines if `Popper` content should be rendered. The content only exists in the DOM when\n`open` is `true`",
|
|
363703
|
-
"declarations": [
|
|
363704
|
-
{
|
|
363705
|
-
"name": "open",
|
|
363706
|
-
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
|
|
363707
|
-
}
|
|
363708
|
-
],
|
|
363709
|
-
"tags": {
|
|
363710
|
-
"default": "true"
|
|
363711
|
-
}
|
|
363712
|
-
},
|
|
363713
|
-
{
|
|
363714
|
-
"kind": "property",
|
|
363715
|
-
"name": "placement",
|
|
363716
|
-
"required": false,
|
|
363717
|
-
"type": {
|
|
363718
|
-
"kind": "symbol",
|
|
363719
|
-
"name": "Placement",
|
|
363720
|
-
"value": "Placement"
|
|
363721
|
-
},
|
|
363722
|
-
"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`.",
|
|
363723
|
-
"declarations": [
|
|
363724
|
-
{
|
|
363725
|
-
"name": "placement",
|
|
363726
|
-
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
|
|
363727
|
-
}
|
|
363728
|
-
],
|
|
363729
|
-
"tags": {
|
|
363730
|
-
"default": "bottom"
|
|
363731
|
-
}
|
|
363732
|
-
},
|
|
363733
|
-
{
|
|
363734
|
-
"kind": "property",
|
|
363735
|
-
"name": "fallbackPlacements",
|
|
363736
|
-
"required": false,
|
|
363737
|
-
"type": {
|
|
363738
|
-
"kind": "array",
|
|
363739
|
-
"value": {
|
|
363740
|
-
"kind": "symbol",
|
|
363741
|
-
"name": "Placement",
|
|
363742
|
-
"value": "Placement"
|
|
363743
|
-
}
|
|
363744
|
-
},
|
|
363745
|
-
"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.",
|
|
363746
|
-
"declarations": [
|
|
363747
|
-
{
|
|
363748
|
-
"name": "fallbackPlacements",
|
|
363749
|
-
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
|
|
363750
|
-
}
|
|
363751
|
-
],
|
|
363752
|
-
"tags": {}
|
|
363753
|
-
},
|
|
363754
|
-
{
|
|
363755
|
-
"kind": "property",
|
|
363756
|
-
"name": "onPlacementChange",
|
|
363757
|
-
"required": false,
|
|
363758
|
-
"type": {
|
|
363759
|
-
"kind": "function",
|
|
363760
|
-
"parameters": [
|
|
363761
|
-
{
|
|
363762
|
-
"kind": "parameter",
|
|
363763
|
-
"name": "placement",
|
|
363764
|
-
"type": {
|
|
363765
|
-
"kind": "symbol",
|
|
363766
|
-
"name": "Placement",
|
|
363767
|
-
"value": "Placement"
|
|
363768
|
-
},
|
|
363769
|
-
"required": true,
|
|
363770
|
-
"rest": false,
|
|
363771
|
-
"description": "",
|
|
363772
|
-
"declarations": [
|
|
363773
|
-
{
|
|
363774
|
-
"name": "placement",
|
|
363775
|
-
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
|
|
363776
|
-
}
|
|
363777
|
-
],
|
|
363778
|
-
"tags": {}
|
|
363779
|
-
}
|
|
363780
|
-
],
|
|
363781
|
-
"members": [],
|
|
363782
|
-
"returnType": {
|
|
363783
|
-
"kind": "primitive",
|
|
363784
|
-
"value": "void"
|
|
363785
|
-
}
|
|
363786
|
-
},
|
|
363787
|
-
"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.",
|
|
363788
|
-
"declarations": [
|
|
363789
|
-
{
|
|
363790
|
-
"name": "onPlacementChange",
|
|
363791
|
-
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
|
|
363792
|
-
}
|
|
363793
|
-
],
|
|
363794
|
-
"tags": {}
|
|
363795
|
-
},
|
|
363796
|
-
{
|
|
363797
|
-
"kind": "property",
|
|
363798
|
-
"name": "popperOptions",
|
|
363799
|
-
"required": false,
|
|
363800
|
-
"type": {
|
|
363801
|
-
"kind": "symbol",
|
|
363802
|
-
"name": "Partial",
|
|
363803
|
-
"typeParameters": [
|
|
363804
|
-
{
|
|
363805
|
-
"kind": "external",
|
|
363806
|
-
"name": "PopperOptions",
|
|
363807
|
-
"url": "https://popper.js.org/docs/v2/constructors/#options"
|
|
363808
|
-
}
|
|
363809
|
-
],
|
|
363810
|
-
"value": "Partial<T>"
|
|
363811
|
-
},
|
|
363812
|
-
"description": "The additional options passed to the Popper's `popper.js` instance.",
|
|
363813
|
-
"declarations": [
|
|
363814
|
-
{
|
|
363815
|
-
"name": "popperOptions",
|
|
363816
|
-
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
|
|
363817
|
-
}
|
|
363818
|
-
],
|
|
363819
|
-
"tags": {}
|
|
363820
|
-
},
|
|
363821
|
-
{
|
|
363822
|
-
"kind": "property",
|
|
363823
|
-
"name": "portal",
|
|
363824
|
-
"required": false,
|
|
363825
|
-
"type": {
|
|
363826
|
-
"kind": "primitive",
|
|
363827
|
-
"value": "boolean"
|
|
363828
|
-
},
|
|
363829
|
-
"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`",
|
|
363830
|
-
"declarations": [
|
|
363831
|
-
{
|
|
363832
|
-
"name": "portal",
|
|
363833
|
-
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
|
|
363834
|
-
}
|
|
363835
|
-
],
|
|
363836
|
-
"tags": {
|
|
363837
|
-
"default": "true"
|
|
363838
|
-
}
|
|
363839
|
-
},
|
|
363840
|
-
{
|
|
363841
|
-
"kind": "property",
|
|
363842
|
-
"name": "popperInstanceRef",
|
|
363843
|
-
"required": false,
|
|
363844
|
-
"type": {
|
|
363845
|
-
"kind": "external",
|
|
363846
|
-
"name": "Ref",
|
|
363847
|
-
"url": "https://reactjs.org/docs/refs-and-the-dom.html",
|
|
363848
|
-
"typeParameters": [
|
|
363849
|
-
{
|
|
363850
|
-
"kind": "symbol",
|
|
363851
|
-
"name": "Instance",
|
|
363852
|
-
"value": "Instance"
|
|
363853
|
-
}
|
|
363854
|
-
]
|
|
363855
|
-
},
|
|
363856
|
-
"description": "Reference to the PopperJS instance. Useful for making direct method calls on the popper\ninstance like `update`.",
|
|
363857
|
-
"declarations": [
|
|
363858
|
-
{
|
|
363859
|
-
"name": "popperInstanceRef",
|
|
363860
|
-
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
|
|
363861
|
-
}
|
|
363862
|
-
],
|
|
363863
|
-
"tags": {}
|
|
363864
|
-
}
|
|
363865
|
-
]
|
|
363556
|
+
"kind": "alias",
|
|
363557
|
+
"name": "TabsMenuPopper"
|
|
363866
363558
|
}
|
|
363867
363559
|
},
|
|
363868
363560
|
{
|
|
@@ -418461,6 +418153,46 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
418461
418153
|
}
|
|
418462
418154
|
}
|
|
418463
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
|
+
},
|
|
418464
418196
|
{
|
|
418465
418197
|
"name": "wrapProperty",
|
|
418466
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.
|
|
22
|
-
"@workday/canvas-kit-preview-react": "13.2.
|
|
23
|
-
"@workday/canvas-kit-react": "13.2.
|
|
24
|
-
"@workday/canvas-kit-react-fonts": "^13.2.
|
|
25
|
-
"@workday/canvas-kit-styling": "13.2.
|
|
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.
|
|
22
|
-
"@workday/canvas-kit-preview-react": "13.2.
|
|
23
|
-
"@workday/canvas-kit-react": "13.2.
|
|
24
|
-
"@workday/canvas-kit-react-fonts": "^13.2.
|
|
25
|
-
"@workday/canvas-kit-styling": "13.2.
|
|
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
|
-
|
|
105
|
+
### Canvas Provider 🚨
|
|
105
106
|
|
|
106
|
-
-
|
|
107
|
-
|
|
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
|
|
|
@@ -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(
|
|
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(
|
|
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.
|
|
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.
|
|
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.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": "
|
|
64
|
+
"gitHead": "9058e7f2709a2212664672616bf6c8222f3e6eba"
|
|
65
65
|
}
|