@workday/canvas-kit-docs 16.2.3 → 16.2.5

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.
@@ -238101,7 +238101,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
238101
238101
  "value": "DOMRect"
238102
238102
  }
238103
238103
  },
238104
- "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`.",
238104
+ "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`. If an `anchorElement` is also provided, Popper listens to its\nscroll containers and uses it for clipping, so the Popper still updates when it scrolls.",
238105
238105
  "declarations": [
238106
238106
  {
238107
238107
  "name": "getAnchorClientRect",
@@ -271462,7 +271462,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
271462
271462
  "value": "DOMRect"
271463
271463
  }
271464
271464
  },
271465
- "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`.",
271465
+ "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`. If an `anchorElement` is also provided, Popper listens to its\nscroll containers and uses it for clipping, so the Popper still updates when it scrolls.",
271466
271466
  "declarations": [
271467
271467
  {
271468
271468
  "name": "getAnchorClientRect",
@@ -336715,6 +336715,31 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
336715
336715
  "name": "usePopupPopper"
336716
336716
  }
336717
336717
  },
336718
+ {
336719
+ "name": "menuPopperOffset",
336720
+ "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/menu/lib/MenuPopper.tsx",
336721
+ "description": "The `[skidding, distance]` offset every menu popper sits at relative to its anchor.",
336722
+ "declarations": [
336723
+ {
336724
+ "name": "menuPopperOffset",
336725
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/menu/lib/MenuPopper.tsx"
336726
+ }
336727
+ ],
336728
+ "tags": {},
336729
+ "type": {
336730
+ "kind": "tuple",
336731
+ "value": [
336732
+ {
336733
+ "kind": "primitive",
336734
+ "value": "number"
336735
+ },
336736
+ {
336737
+ "kind": "primitive",
336738
+ "value": "number"
336739
+ }
336740
+ ]
336741
+ }
336742
+ },
336718
336743
  {
336719
336744
  "name": "defaultMenuPopperOptions",
336720
336745
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/menu/lib/MenuPopper.tsx",
@@ -336773,11 +336798,17 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
336773
336798
  "parameters": [],
336774
336799
  "members": [],
336775
336800
  "returnType": {
336776
- "kind": "array",
336777
- "value": {
336778
- "kind": "primitive",
336779
- "value": "number"
336780
- }
336801
+ "kind": "union",
336802
+ "value": [
336803
+ {
336804
+ "kind": "primitive",
336805
+ "value": "number"
336806
+ },
336807
+ {
336808
+ "kind": "primitive",
336809
+ "value": "number"
336810
+ }
336811
+ ]
336781
336812
  }
336782
336813
  },
336783
336814
  "type": {
@@ -336785,11 +336816,17 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
336785
336816
  "parameters": [],
336786
336817
  "members": [],
336787
336818
  "returnType": {
336788
- "kind": "array",
336789
- "value": {
336790
- "kind": "primitive",
336791
- "value": "number"
336792
- }
336819
+ "kind": "union",
336820
+ "value": [
336821
+ {
336822
+ "kind": "primitive",
336823
+ "value": "number"
336824
+ },
336825
+ {
336826
+ "kind": "primitive",
336827
+ "value": "number"
336828
+ }
336829
+ ]
336793
336830
  }
336794
336831
  },
336795
336832
  "required": true,
@@ -336815,11 +336852,17 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
336815
336852
  "parameters": [],
336816
336853
  "members": [],
336817
336854
  "returnType": {
336818
- "kind": "array",
336819
- "value": {
336820
- "kind": "primitive",
336821
- "value": "number"
336822
- }
336855
+ "kind": "union",
336856
+ "value": [
336857
+ {
336858
+ "kind": "primitive",
336859
+ "value": "number"
336860
+ },
336861
+ {
336862
+ "kind": "primitive",
336863
+ "value": "number"
336864
+ }
336865
+ ]
336823
336866
  }
336824
336867
  },
336825
336868
  "type": {
@@ -336827,11 +336870,17 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
336827
336870
  "parameters": [],
336828
336871
  "members": [],
336829
336872
  "returnType": {
336830
- "kind": "array",
336831
- "value": {
336832
- "kind": "primitive",
336833
- "value": "number"
336834
- }
336873
+ "kind": "union",
336874
+ "value": [
336875
+ {
336876
+ "kind": "primitive",
336877
+ "value": "number"
336878
+ },
336879
+ {
336880
+ "kind": "primitive",
336881
+ "value": "number"
336882
+ }
336883
+ ]
336835
336884
  }
336836
336885
  },
336837
336886
  "required": true,
@@ -336893,11 +336942,17 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
336893
336942
  "parameters": [],
336894
336943
  "members": [],
336895
336944
  "returnType": {
336896
- "kind": "array",
336897
- "value": {
336898
- "kind": "primitive",
336899
- "value": "number"
336900
- }
336945
+ "kind": "tuple",
336946
+ "value": [
336947
+ {
336948
+ "kind": "primitive",
336949
+ "value": "number"
336950
+ },
336951
+ {
336952
+ "kind": "primitive",
336953
+ "value": "number"
336954
+ }
336955
+ ]
336901
336956
  }
336902
336957
  },
336903
336958
  "description": "",
@@ -337069,7 +337124,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
337069
337124
  "value": "DOMRect"
337070
337125
  }
337071
337126
  },
337072
- "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`.",
337127
+ "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`. If an `anchorElement` is also provided, Popper listens to its\nscroll containers and uses it for clipping, so the Popper still updates when it scrolls.",
337073
337128
  "declarations": [
337074
337129
  {
337075
337130
  "name": "getAnchorClientRect",
@@ -338006,7 +338061,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
338006
338061
  "value": "DOMRect"
338007
338062
  }
338008
338063
  },
338009
- "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`.",
338064
+ "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`. If an `anchorElement` is also provided, Popper listens to its\nscroll containers and uses it for clipping, so the Popper still updates when it scrolls.",
338010
338065
  "declarations": [
338011
338066
  {
338012
338067
  "name": "getAnchorClientRect",
@@ -388034,7 +388089,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
388034
388089
  "value": "DOMRect"
388035
388090
  }
388036
388091
  },
388037
- "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`.",
388092
+ "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`. If an `anchorElement` is also provided, Popper listens to its\nscroll containers and uses it for clipping, so the Popper still updates when it scrolls.",
388038
388093
  "declarations": [
388039
388094
  {
388040
388095
  "name": "getAnchorClientRect",
@@ -393498,7 +393553,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
393498
393553
  "value": "DOMRect"
393499
393554
  }
393500
393555
  },
393501
- "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`.",
393556
+ "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`. If an `anchorElement` is also provided, Popper listens to its\nscroll containers and uses it for clipping, so the Popper still updates when it scrolls.",
393502
393557
  "declarations": [
393503
393558
  {
393504
393559
  "name": "getAnchorClientRect",
@@ -454265,7 +454320,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
454265
454320
  "value": "DOMRect"
454266
454321
  }
454267
454322
  },
454268
- "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`.",
454323
+ "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`. If an `anchorElement` is also provided, Popper listens to its\nscroll containers and uses it for clipping, so the Popper still updates when it scrolls.",
454269
454324
  "declarations": [
454270
454325
  {
454271
454326
  "name": "getAnchorClientRect",
@@ -5969,6 +5969,282 @@ module.exports = {specifications: [
5969
5969
  }
5970
5970
  ]
5971
5971
  },
5972
+ {
5973
+ "type": "file",
5974
+ "name": "SubmenuPlacement",
5975
+ "children": [
5976
+ {
5977
+ "type": "describe",
5978
+ "name": "Submenu placement",
5979
+ "children": [
5980
+ {
5981
+ "type": "describe",
5982
+ "name": "given a scrollable ltr menu at the start edge",
5983
+ "children": [
5984
+ {
5985
+ "type": "it",
5986
+ "name": "should pass axe checks"
5987
+ },
5988
+ {
5989
+ "type": "it",
5990
+ "name": "should open beside the parent on the right"
5991
+ },
5992
+ {
5993
+ "type": "describe",
5994
+ "name": "when the parent menu is scrolled",
5995
+ "children": [
5996
+ {
5997
+ "type": "it",
5998
+ "name": "should remain beside the parent without covering it"
5999
+ }
6000
+ ]
6001
+ }
6002
+ ]
6003
+ },
6004
+ {
6005
+ "type": "describe",
6006
+ "name": "given a scrollable ltr menu at the end edge",
6007
+ "children": [
6008
+ {
6009
+ "type": "it",
6010
+ "name": "should pass axe checks"
6011
+ },
6012
+ {
6013
+ "type": "it",
6014
+ "name": "should open beside the parent on the left"
6015
+ },
6016
+ {
6017
+ "type": "describe",
6018
+ "name": "when the parent menu is scrolled",
6019
+ "children": [
6020
+ {
6021
+ "type": "it",
6022
+ "name": "should remain beside the parent without covering it"
6023
+ }
6024
+ ]
6025
+ }
6026
+ ]
6027
+ },
6028
+ {
6029
+ "type": "describe",
6030
+ "name": "given a scrollable rtl menu at the start edge",
6031
+ "children": [
6032
+ {
6033
+ "type": "it",
6034
+ "name": "should pass axe checks"
6035
+ },
6036
+ {
6037
+ "type": "it",
6038
+ "name": "should open beside the parent on the left"
6039
+ },
6040
+ {
6041
+ "type": "describe",
6042
+ "name": "when the parent menu is scrolled",
6043
+ "children": [
6044
+ {
6045
+ "type": "it",
6046
+ "name": "should remain beside the parent without covering it"
6047
+ }
6048
+ ]
6049
+ }
6050
+ ]
6051
+ },
6052
+ {
6053
+ "type": "describe",
6054
+ "name": "given a scrollable rtl menu at the end edge",
6055
+ "children": [
6056
+ {
6057
+ "type": "it",
6058
+ "name": "should pass axe checks"
6059
+ },
6060
+ {
6061
+ "type": "it",
6062
+ "name": "should open beside the parent on the right"
6063
+ },
6064
+ {
6065
+ "type": "describe",
6066
+ "name": "when the parent menu is scrolled",
6067
+ "children": [
6068
+ {
6069
+ "type": "it",
6070
+ "name": "should remain beside the parent without covering it"
6071
+ }
6072
+ ]
6073
+ }
6074
+ ]
6075
+ },
6076
+ {
6077
+ "type": "describe",
6078
+ "name": "given an explicit submenu placement",
6079
+ "children": [
6080
+ {
6081
+ "type": "it",
6082
+ "name": "should preserve the custom placement"
6083
+ },
6084
+ {
6085
+ "type": "it",
6086
+ "name": "should pass axe checks"
6087
+ }
6088
+ ]
6089
+ },
6090
+ {
6091
+ "type": "describe",
6092
+ "name": "given an empty fallback list at the right edge",
6093
+ "children": [
6094
+ {
6095
+ "type": "it",
6096
+ "name": "should still allow the opposite placement"
6097
+ },
6098
+ {
6099
+ "type": "it",
6100
+ "name": "should pass axe checks"
6101
+ }
6102
+ ]
6103
+ },
6104
+ {
6105
+ "type": "describe",
6106
+ "name": "given custom Popper options",
6107
+ "children": [
6108
+ {
6109
+ "type": "it",
6110
+ "name": "should preserve the custom offset from the parent menu"
6111
+ },
6112
+ {
6113
+ "type": "it",
6114
+ "name": "should pass axe checks"
6115
+ }
6116
+ ]
6117
+ },
6118
+ {
6119
+ "type": "describe",
6120
+ "name": "given a ltr viewport too narrow for either side",
6121
+ "children": [
6122
+ {
6123
+ "type": "it",
6124
+ "name": "should pass axe checks"
6125
+ },
6126
+ {
6127
+ "type": "it",
6128
+ "name": "should fall back below the parent"
6129
+ },
6130
+ {
6131
+ "type": "it",
6132
+ "name": "should align with the parent's left edge"
6133
+ },
6134
+ {
6135
+ "type": "it",
6136
+ "name": "should stay inside the viewport horizontally"
6137
+ }
6138
+ ]
6139
+ },
6140
+ {
6141
+ "type": "describe",
6142
+ "name": "given a rtl viewport too narrow for either side",
6143
+ "children": [
6144
+ {
6145
+ "type": "it",
6146
+ "name": "should pass axe checks"
6147
+ },
6148
+ {
6149
+ "type": "it",
6150
+ "name": "should fall back below the parent"
6151
+ },
6152
+ {
6153
+ "type": "it",
6154
+ "name": "should align with the parent's right edge"
6155
+ },
6156
+ {
6157
+ "type": "it",
6158
+ "name": "should stay inside the viewport horizontally"
6159
+ }
6160
+ ]
6161
+ },
6162
+ {
6163
+ "type": "describe",
6164
+ "name": "given a parent menu near the bottom of a narrow viewport",
6165
+ "children": [
6166
+ {
6167
+ "type": "it",
6168
+ "name": "should pass axe checks"
6169
+ },
6170
+ {
6171
+ "type": "it",
6172
+ "name": "should fall back above the parent"
6173
+ }
6174
+ ]
6175
+ },
6176
+ {
6177
+ "type": "describe",
6178
+ "name": "given a 320x568 viewport too short to clear the parent",
6179
+ "children": [
6180
+ {
6181
+ "type": "it",
6182
+ "name": "should pass axe checks"
6183
+ },
6184
+ {
6185
+ "type": "it",
6186
+ "name": "should use bottom-start"
6187
+ },
6188
+ {
6189
+ "type": "it",
6190
+ "name": "should stay inside the viewport"
6191
+ },
6192
+ {
6193
+ "type": "describe",
6194
+ "name": "when the parent menu is then scrolled",
6195
+ "children": [
6196
+ {
6197
+ "type": "it",
6198
+ "name": "should keep its placement"
6199
+ },
6200
+ {
6201
+ "type": "it",
6202
+ "name": "should stay inside the viewport"
6203
+ },
6204
+ {
6205
+ "type": "it",
6206
+ "name": "should not move while the parent keeps scrolling"
6207
+ }
6208
+ ]
6209
+ }
6210
+ ]
6211
+ },
6212
+ {
6213
+ "type": "describe",
6214
+ "name": "given a 360x568 viewport too short to clear the parent",
6215
+ "children": [
6216
+ {
6217
+ "type": "it",
6218
+ "name": "should pass axe checks"
6219
+ },
6220
+ {
6221
+ "type": "it",
6222
+ "name": "should use right-start"
6223
+ },
6224
+ {
6225
+ "type": "it",
6226
+ "name": "should stay inside the viewport"
6227
+ },
6228
+ {
6229
+ "type": "describe",
6230
+ "name": "when the parent menu is then scrolled",
6231
+ "children": [
6232
+ {
6233
+ "type": "it",
6234
+ "name": "should keep its placement"
6235
+ },
6236
+ {
6237
+ "type": "it",
6238
+ "name": "should stay inside the viewport"
6239
+ }
6240
+ ]
6241
+ }
6242
+ ]
6243
+ }
6244
+ ]
6245
+ }
6246
+ ]
6247
+ },
5972
6248
  {
5973
6249
  "type": "file",
5974
6250
  "name": "Switch",
@@ -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": "16.2.3",
22
- "@workday/canvas-kit-preview-react": "16.2.3",
23
- "@workday/canvas-kit-react": "16.2.3",
24
- "@workday/canvas-kit-react-fonts": "^16.2.3",
25
- "@workday/canvas-kit-styling": "16.2.3",
21
+ "@workday/canvas-kit-labs-react": "16.2.5",
22
+ "@workday/canvas-kit-preview-react": "16.2.5",
23
+ "@workday/canvas-kit-react": "16.2.5",
24
+ "@workday/canvas-kit-react-fonts": "^16.2.5",
25
+ "@workday/canvas-kit-styling": "16.2.5",
26
26
  "@workday/canvas-system-icons-web": "^5.0.3",
27
27
  "@workday/canvas-expressive-icons-web": "1.0.1",
28
28
  "@workday/canvas-tokens-web": "4.4.0-beta.11"
@@ -19,11 +19,11 @@ export const packageJSONFile = `{
19
19
  "@emotion/react": "11.11.4",
20
20
  "@types/react": "18.2.60",
21
21
  "@types/react-dom": "18.2.19",
22
- "@workday/canvas-kit-labs-react": "16.2.3",
23
- "@workday/canvas-kit-preview-react": "16.2.3",
24
- "@workday/canvas-kit-react": "16.2.3",
25
- "@workday/canvas-kit-react-fonts": "^16.2.3",
26
- "@workday/canvas-kit-styling": "16.2.3",
22
+ "@workday/canvas-kit-labs-react": "16.2.5",
23
+ "@workday/canvas-kit-preview-react": "16.2.5",
24
+ "@workday/canvas-kit-react": "16.2.5",
25
+ "@workday/canvas-kit-react-fonts": "^16.2.5",
26
+ "@workday/canvas-kit-styling": "16.2.5",
27
27
  "@workday/canvas-system-icons-web": "^5.0.3",
28
28
  "@workday/canvas-expressive-icons-web": "1.0.1",
29
29
  "@workday/canvas-tokens-web": "4.4.0-beta.11"
@@ -0,0 +1,69 @@
1
+ import {CanvasProvider} from '@workday/canvas-kit-react/common';
2
+ import {Flex} from '@workday/canvas-kit-react/layout';
3
+ import {Menu, menuCardStencil} from '@workday/canvas-kit-react/menu';
4
+ import {PopperProps} from '@workday/canvas-kit-react/popup';
5
+ import {createStencil, createStyles, px2rem} from '@workday/canvas-kit-styling';
6
+
7
+ const containerStencil = createStencil({
8
+ base: {},
9
+ modifiers: {
10
+ atEnd: {true: {justifyContent: 'flex-end'}},
11
+ alignBottom: {true: {position: 'fixed', bottom: 0, left: 0, right: 0}},
12
+ },
13
+ });
14
+
15
+ // A fixed height makes the parent list scroll independently of the page.
16
+ const cardStyles = createStyles({[menuCardStencil.vars.maxHeight]: px2rem(280)});
17
+ // Short enough that a Sana submenu cannot fit below the target when the menu is pinned to the
18
+ // bottom of the viewport, so placement falls back above the parent.
19
+ const bottomEdgeCardStyles = createStyles({[menuCardStencil.vars.maxHeight]: px2rem(160)});
20
+
21
+ export default ({
22
+ dir = 'ltr',
23
+ atEnd = false,
24
+ alignBottom = false,
25
+ submenuPopperProps,
26
+ }: {
27
+ dir?: 'ltr' | 'rtl';
28
+ atEnd?: boolean;
29
+ alignBottom?: boolean;
30
+ submenuPopperProps?: Pick<PopperProps, 'placement' | 'fallbackPlacements' | 'popperOptions'>;
31
+ }) => (
32
+ <CanvasProvider dir={dir}>
33
+ <Flex cs={containerStencil({atEnd, alignBottom})}>
34
+ <Menu>
35
+ <Menu.Target>Open Menu</Menu.Target>
36
+ <Menu.Popper>
37
+ <Menu.Card
38
+ cs={alignBottom ? bottomEdgeCardStyles : cardStyles}
39
+ data-testid="scrollable-menu"
40
+ >
41
+ <Menu.List>
42
+ <Menu.Item data-id="first">First Item</Menu.Item>
43
+ <Menu.Item data-id="second">Second Item</Menu.Item>
44
+ <Menu.Submenu>
45
+ <Menu.Submenu.TargetItem data-id="submenu">More Items</Menu.Submenu.TargetItem>
46
+ <Menu.Submenu.Popper {...submenuPopperProps}>
47
+ <Menu.Submenu.Card>
48
+ <Menu.Submenu.List data-testid="submenu">
49
+ {Array.from({length: 6}, (_, index) => (
50
+ <Menu.Submenu.Item key={index} data-id={`sub-${index}`}>
51
+ Additional Menu Item {index + 1}
52
+ </Menu.Submenu.Item>
53
+ ))}
54
+ </Menu.Submenu.List>
55
+ </Menu.Submenu.Card>
56
+ </Menu.Submenu.Popper>
57
+ </Menu.Submenu>
58
+ {Array.from({length: 15}, (_, index) => (
59
+ <Menu.Item key={index} data-id={`item-${index}`}>
60
+ Item {index + 1}
61
+ </Menu.Item>
62
+ ))}
63
+ </Menu.List>
64
+ </Menu.Card>
65
+ </Menu.Popper>
66
+ </Menu>
67
+ </Flex>
68
+ </CanvasProvider>
69
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "16.2.3",
3
+ "version": "16.2.5",
4
4
  "description": "Documentation components of Canvas Kit components",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -47,10 +47,10 @@
47
47
  "@stackblitz/sdk": "^1.11.0",
48
48
  "@storybook/csf": "0.0.1",
49
49
  "@workday/canvas-expressive-icons-web": "1.0.2",
50
- "@workday/canvas-kit-labs-react": "^16.2.3",
51
- "@workday/canvas-kit-preview-react": "^16.2.3",
52
- "@workday/canvas-kit-react": "^16.2.3",
53
- "@workday/canvas-kit-styling": "^16.2.3",
50
+ "@workday/canvas-kit-labs-react": "^16.2.5",
51
+ "@workday/canvas-kit-preview-react": "^16.2.5",
52
+ "@workday/canvas-kit-react": "^16.2.5",
53
+ "@workday/canvas-kit-styling": "^16.2.5",
54
54
  "@workday/canvas-system-icons-web": "^5.0.3",
55
55
  "@workday/canvas-tokens-web": "^4.4.0",
56
56
  "markdown-to-jsx": "^7.2.0",
@@ -63,5 +63,5 @@
63
63
  "mkdirp": "^1.0.3",
64
64
  "typescript": "5.0"
65
65
  },
66
- "gitHead": "dd5a27ab062642ac115722808e063150f7866115"
66
+ "gitHead": "e5b96bcbbd1f827623f9e75b13699b74b4ac03dd"
67
67
  }