@workday/canvas-kit-docs 9.0.8 → 9.0.10

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.
@@ -117794,6 +117794,27 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
117794
117794
  "value": "bottom"
117795
117795
  }
117796
117796
  },
117797
+ {
117798
+ "kind": "property",
117799
+ "name": "fallbackPlacements",
117800
+ "required": false,
117801
+ "type": {
117802
+ "kind": "array",
117803
+ "value": {
117804
+ "kind": "symbol",
117805
+ "name": "Placement",
117806
+ "value": "Placement"
117807
+ }
117808
+ },
117809
+ "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.",
117810
+ "declarations": [
117811
+ {
117812
+ "name": "fallbackPlacements",
117813
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/PopupPopper.tsx"
117814
+ }
117815
+ ],
117816
+ "tags": {}
117817
+ },
117797
117818
  {
117798
117819
  "kind": "property",
117799
117820
  "name": "popperOptions",
@@ -118054,7 +118075,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
118054
118075
  "typeParameters": [
118055
118076
  {
118056
118077
  "kind": "symbol",
118057
- "name": "PopperJS.Instance",
118078
+ "name": "Instance",
118058
118079
  "value": "Instance"
118059
118080
  }
118060
118081
  ]
@@ -149275,6 +149296,27 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
149275
149296
  "value": "bottom"
149276
149297
  }
149277
149298
  },
149299
+ {
149300
+ "kind": "property",
149301
+ "name": "fallbackPlacements",
149302
+ "required": false,
149303
+ "type": {
149304
+ "kind": "array",
149305
+ "value": {
149306
+ "kind": "symbol",
149307
+ "name": "Placement",
149308
+ "value": "Placement"
149309
+ }
149310
+ },
149311
+ "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.",
149312
+ "declarations": [
149313
+ {
149314
+ "name": "fallbackPlacements",
149315
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
149316
+ }
149317
+ ],
149318
+ "tags": {}
149319
+ },
149278
149320
  {
149279
149321
  "kind": "property",
149280
149322
  "name": "onPlacementChange",
@@ -149376,7 +149418,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
149376
149418
  "typeParameters": [
149377
149419
  {
149378
149420
  "kind": "symbol",
149379
- "name": "PopperJS.Instance",
149421
+ "name": "Instance",
149380
149422
  "value": "Instance"
149381
149423
  }
149382
149424
  ]
@@ -178327,6 +178369,81 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
178327
178369
  }
178328
178370
  }
178329
178371
  },
178372
+ {
178373
+ "name": "Placement",
178374
+ "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/fallbackPlacements.ts",
178375
+ "description": "",
178376
+ "declarations": [
178377
+ {
178378
+ "name": "Placement",
178379
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/fallbackPlacements.ts"
178380
+ }
178381
+ ],
178382
+ "tags": {},
178383
+ "type": {
178384
+ "kind": "type",
178385
+ "typeParameters": [],
178386
+ "value": {
178387
+ "kind": "symbol",
178388
+ "name": "PopperJSPlacement",
178389
+ "value": "Placement"
178390
+ }
178391
+ }
178392
+ },
178393
+ {
178394
+ "name": "Options",
178395
+ "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/fallbackPlacements.ts",
178396
+ "description": "",
178397
+ "declarations": [
178398
+ {
178399
+ "name": "Options",
178400
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/fallbackPlacements.ts"
178401
+ }
178402
+ ],
178403
+ "tags": {},
178404
+ "type": {
178405
+ "kind": "object",
178406
+ "properties": [
178407
+ {
178408
+ "kind": "property",
178409
+ "name": "fallbackPlacements",
178410
+ "required": true,
178411
+ "type": {
178412
+ "kind": "array",
178413
+ "value": {
178414
+ "kind": "symbol",
178415
+ "name": "Placement",
178416
+ "value": "Placement"
178417
+ }
178418
+ },
178419
+ "description": "",
178420
+ "declarations": [
178421
+ {
178422
+ "name": "fallbackPlacements",
178423
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/fallbackPlacements.ts"
178424
+ }
178425
+ ],
178426
+ "tags": {}
178427
+ }
178428
+ ]
178429
+ }
178430
+ },
178431
+ {
178432
+ "name": "fallbackPlacementsModifier",
178433
+ "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/fallbackPlacements.ts",
178434
+ "description": "",
178435
+ "declarations": [
178436
+ {
178437
+ "name": "fallbackPlacementsModifier",
178438
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/fallbackPlacements.ts"
178439
+ }
178440
+ ],
178441
+ "tags": {},
178442
+ "type": {
178443
+ "kind": "symbol",
178444
+ "name": "name"
178445
+ }
178446
+ },
178330
178447
  {
178331
178448
  "name": "getTransformFromPlacement",
178332
178449
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/getTransformFromPlacement.ts",
@@ -181491,69 +181608,9 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
181491
181608
  "kind": "type",
181492
181609
  "typeParameters": [],
181493
181610
  "value": {
181494
- "kind": "union",
181495
- "value": [
181496
- {
181497
- "kind": "string",
181498
- "value": "auto"
181499
- },
181500
- {
181501
- "kind": "string",
181502
- "value": "left"
181503
- },
181504
- {
181505
- "kind": "string",
181506
- "value": "right"
181507
- },
181508
- {
181509
- "kind": "string",
181510
- "value": "top"
181511
- },
181512
- {
181513
- "kind": "string",
181514
- "value": "bottom"
181515
- },
181516
- {
181517
- "kind": "string",
181518
- "value": "auto-start"
181519
- },
181520
- {
181521
- "kind": "string",
181522
- "value": "auto-end"
181523
- },
181524
- {
181525
- "kind": "string",
181526
- "value": "top-start"
181527
- },
181528
- {
181529
- "kind": "string",
181530
- "value": "top-end"
181531
- },
181532
- {
181533
- "kind": "string",
181534
- "value": "bottom-start"
181535
- },
181536
- {
181537
- "kind": "string",
181538
- "value": "bottom-end"
181539
- },
181540
- {
181541
- "kind": "string",
181542
- "value": "right-start"
181543
- },
181544
- {
181545
- "kind": "string",
181546
- "value": "right-end"
181547
- },
181548
- {
181549
- "kind": "string",
181550
- "value": "left-start"
181551
- },
181552
- {
181553
- "kind": "string",
181554
- "value": "left-end"
181555
- }
181556
- ]
181611
+ "kind": "symbol",
181612
+ "name": "PopperJSPlacement",
181613
+ "value": "Placement"
181557
181614
  }
181558
181615
  }
181559
181616
  },
@@ -181573,11 +181630,31 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
181573
181630
  "typeParameters": [],
181574
181631
  "value": {
181575
181632
  "kind": "symbol",
181576
- "name": "PopperJS.Options",
181633
+ "name": "Options",
181577
181634
  "value": "Options"
181578
181635
  }
181579
181636
  }
181580
181637
  },
181638
+ {
181639
+ "name": "defaultFallbackPlacements",
181640
+ "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx",
181641
+ "description": "",
181642
+ "declarations": [
181643
+ {
181644
+ "name": "defaultFallbackPlacements",
181645
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
181646
+ }
181647
+ ],
181648
+ "tags": {},
181649
+ "type": {
181650
+ "kind": "array",
181651
+ "value": {
181652
+ "kind": "symbol",
181653
+ "name": "Placement",
181654
+ "value": "Placement"
181655
+ }
181656
+ }
181657
+ },
181581
181658
  {
181582
181659
  "name": "PopperProps",
181583
181660
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx",
@@ -181792,6 +181869,27 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
181792
181869
  "value": "bottom"
181793
181870
  }
181794
181871
  },
181872
+ {
181873
+ "kind": "property",
181874
+ "name": "fallbackPlacements",
181875
+ "required": false,
181876
+ "type": {
181877
+ "kind": "array",
181878
+ "value": {
181879
+ "kind": "symbol",
181880
+ "name": "Placement",
181881
+ "value": "Placement"
181882
+ }
181883
+ },
181884
+ "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.",
181885
+ "declarations": [
181886
+ {
181887
+ "name": "fallbackPlacements",
181888
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
181889
+ }
181890
+ ],
181891
+ "tags": {}
181892
+ },
181795
181893
  {
181796
181894
  "kind": "property",
181797
181895
  "name": "onPlacementChange",
@@ -181893,7 +181991,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
181893
181991
  "typeParameters": [
181894
181992
  {
181895
181993
  "kind": "symbol",
181896
- "name": "PopperJS.Instance",
181994
+ "name": "Instance",
181897
181995
  "value": "Instance"
181898
181996
  }
181899
181997
  ]
@@ -183366,6 +183464,27 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
183366
183464
  "value": "bottom"
183367
183465
  }
183368
183466
  },
183467
+ {
183468
+ "kind": "property",
183469
+ "name": "fallbackPlacements",
183470
+ "required": false,
183471
+ "type": {
183472
+ "kind": "array",
183473
+ "value": {
183474
+ "kind": "symbol",
183475
+ "name": "Placement",
183476
+ "value": "Placement"
183477
+ }
183478
+ },
183479
+ "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.",
183480
+ "declarations": [
183481
+ {
183482
+ "name": "fallbackPlacements",
183483
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/PopupPopper.tsx"
183484
+ }
183485
+ ],
183486
+ "tags": {}
183487
+ },
183369
183488
  {
183370
183489
  "kind": "property",
183371
183490
  "name": "popperOptions",
@@ -183626,7 +183745,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
183626
183745
  "typeParameters": [
183627
183746
  {
183628
183747
  "kind": "symbol",
183629
- "name": "PopperJS.Instance",
183748
+ "name": "Instance",
183630
183749
  "value": "Instance"
183631
183750
  }
183632
183751
  ]
@@ -193522,6 +193641,27 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
193522
193641
  "default": "bottom"
193523
193642
  }
193524
193643
  },
193644
+ {
193645
+ "kind": "property",
193646
+ "name": "fallbackPlacements",
193647
+ "required": false,
193648
+ "type": {
193649
+ "kind": "array",
193650
+ "value": {
193651
+ "kind": "symbol",
193652
+ "name": "Placement",
193653
+ "value": "Placement"
193654
+ }
193655
+ },
193656
+ "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.",
193657
+ "declarations": [
193658
+ {
193659
+ "name": "fallbackPlacements",
193660
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
193661
+ }
193662
+ ],
193663
+ "tags": {}
193664
+ },
193525
193665
  {
193526
193666
  "kind": "property",
193527
193667
  "name": "onPlacementChange",
@@ -193619,7 +193759,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
193619
193759
  "typeParameters": [
193620
193760
  {
193621
193761
  "kind": "symbol",
193622
- "name": "PopperJS.Instance",
193762
+ "name": "Instance",
193623
193763
  "value": "Instance"
193624
193764
  }
193625
193765
  ]
@@ -193853,6 +193993,27 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
193853
193993
  "value": "bottom"
193854
193994
  }
193855
193995
  },
193996
+ {
193997
+ "kind": "property",
193998
+ "name": "fallbackPlacements",
193999
+ "required": false,
194000
+ "type": {
194001
+ "kind": "array",
194002
+ "value": {
194003
+ "kind": "symbol",
194004
+ "name": "Placement",
194005
+ "value": "Placement"
194006
+ }
194007
+ },
194008
+ "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.",
194009
+ "declarations": [
194010
+ {
194011
+ "name": "fallbackPlacements",
194012
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/popup/lib/Popper.tsx"
194013
+ }
194014
+ ],
194015
+ "tags": {}
194016
+ },
193856
194017
  {
193857
194018
  "kind": "property",
193858
194019
  "name": "onPlacementChange",
@@ -193954,7 +194115,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
193954
194115
  "typeParameters": [
193955
194116
  {
193956
194117
  "kind": "symbol",
193957
- "name": "PopperJS.Instance",
194118
+ "name": "Instance",
193958
194119
  "value": "Instance"
193959
194120
  }
193960
194121
  ]
@@ -232057,6 +232218,27 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
232057
232218
  "kind": "string",
232058
232219
  "value": "top"
232059
232220
  }
232221
+ },
232222
+ {
232223
+ "kind": "property",
232224
+ "name": "fallbackPlacements",
232225
+ "required": false,
232226
+ "type": {
232227
+ "kind": "array",
232228
+ "value": {
232229
+ "kind": "symbol",
232230
+ "name": "Placement",
232231
+ "value": "Placement"
232232
+ }
232233
+ },
232234
+ "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.",
232235
+ "declarations": [
232236
+ {
232237
+ "name": "fallbackPlacements",
232238
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/tooltip/lib/OverflowTooltip.tsx"
232239
+ }
232240
+ ],
232241
+ "tags": {}
232060
232242
  }
232061
232243
  ]
232062
232244
  }
@@ -232159,6 +232341,27 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
232159
232341
  "value": "top"
232160
232342
  }
232161
232343
  },
232344
+ {
232345
+ "kind": "property",
232346
+ "name": "fallbackPlacements",
232347
+ "required": false,
232348
+ "type": {
232349
+ "kind": "array",
232350
+ "value": {
232351
+ "kind": "symbol",
232352
+ "name": "Placement",
232353
+ "value": "Placement"
232354
+ }
232355
+ },
232356
+ "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.",
232357
+ "declarations": [
232358
+ {
232359
+ "name": "fallbackPlacements",
232360
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/tooltip/lib/Tooltip.tsx"
232361
+ }
232362
+ ],
232363
+ "tags": {}
232364
+ },
232162
232365
  {
232163
232366
  "kind": "property",
232164
232367
  "name": "type",
@@ -1801,6 +1801,70 @@ module.exports = {specifications: [
1801
1801
  }
1802
1802
  ]
1803
1803
  },
1804
+ {
1805
+ "type": "file",
1806
+ "name": "Dialog.spec.ts",
1807
+ "children": [
1808
+ {
1809
+ "type": "describe",
1810
+ "name": "Popup",
1811
+ "children": [
1812
+ {
1813
+ "type": "describe",
1814
+ "name": "given the [Testing/Popups/Dialog, DialogWithFallbackPlacements] example is rendered",
1815
+ "children": [
1816
+ {
1817
+ "type": "describe",
1818
+ "name": "check the fallback placements",
1819
+ "children": [
1820
+ {
1821
+ "type": "describe",
1822
+ "name": "when the preferred placement is set to bottom",
1823
+ "children": [
1824
+ {
1825
+ "type": "it",
1826
+ "name": "should show the fallback placement: top"
1827
+ }
1828
+ ]
1829
+ },
1830
+ {
1831
+ "type": "describe",
1832
+ "name": "when the preferred placement is set to top",
1833
+ "children": [
1834
+ {
1835
+ "type": "it",
1836
+ "name": "should show the fallback placement: bottom"
1837
+ }
1838
+ ]
1839
+ },
1840
+ {
1841
+ "type": "describe",
1842
+ "name": "when the preferred placement is set to right",
1843
+ "children": [
1844
+ {
1845
+ "type": "it",
1846
+ "name": "should show the fallback placement: left"
1847
+ }
1848
+ ]
1849
+ },
1850
+ {
1851
+ "type": "describe",
1852
+ "name": "when the preferred placement is set to right",
1853
+ "children": [
1854
+ {
1855
+ "type": "it",
1856
+ "name": "should show the fallback placement: bottom"
1857
+ }
1858
+ ]
1859
+ }
1860
+ ]
1861
+ }
1862
+ ]
1863
+ }
1864
+ ]
1865
+ }
1866
+ ]
1867
+ },
1804
1868
  {
1805
1869
  "type": "file",
1806
1870
  "name": "ExpandableContainer.spec.ts",
@@ -2157,6 +2221,48 @@ module.exports = {specifications: [
2157
2221
  ]
2158
2222
  }
2159
2223
  ]
2224
+ },
2225
+ {
2226
+ "type": "describe",
2227
+ "name": "given the [Testing/Popups/Menu, MenuWithFallbackPlacements] example is rendered",
2228
+ "children": [
2229
+ {
2230
+ "type": "describe",
2231
+ "name": "check the fallback placements",
2232
+ "children": [
2233
+ {
2234
+ "type": "describe",
2235
+ "name": "when the preferred placement is set to top",
2236
+ "children": [
2237
+ {
2238
+ "type": "it",
2239
+ "name": "should show the fallback placement: bottom"
2240
+ }
2241
+ ]
2242
+ },
2243
+ {
2244
+ "type": "describe",
2245
+ "name": "when the preferred placement is set to right",
2246
+ "children": [
2247
+ {
2248
+ "type": "it",
2249
+ "name": "should show the fallback placement: left"
2250
+ }
2251
+ ]
2252
+ },
2253
+ {
2254
+ "type": "describe",
2255
+ "name": "when the preferred placement is set to right",
2256
+ "children": [
2257
+ {
2258
+ "type": "it",
2259
+ "name": "should show the fallback placement: bottom"
2260
+ }
2261
+ ]
2262
+ }
2263
+ ]
2264
+ }
2265
+ ]
2160
2266
  }
2161
2267
  ]
2162
2268
  }
@@ -3455,6 +3561,48 @@ module.exports = {specifications: [
3455
3561
  ]
3456
3562
  }
3457
3563
  ]
3564
+ },
3565
+ {
3566
+ "type": "describe",
3567
+ "name": "given the [Testing/Popups/Popup, PopupWithFallbackPlacements] example is rendered",
3568
+ "children": [
3569
+ {
3570
+ "type": "describe",
3571
+ "name": "check the fallback placements",
3572
+ "children": [
3573
+ {
3574
+ "type": "describe",
3575
+ "name": "when the preferred placement is set to top",
3576
+ "children": [
3577
+ {
3578
+ "type": "it",
3579
+ "name": "should show the fallback placement: bottom"
3580
+ }
3581
+ ]
3582
+ },
3583
+ {
3584
+ "type": "describe",
3585
+ "name": "when the preferred placement is set to right",
3586
+ "children": [
3587
+ {
3588
+ "type": "it",
3589
+ "name": "should show the fallback placement: left"
3590
+ }
3591
+ ]
3592
+ },
3593
+ {
3594
+ "type": "describe",
3595
+ "name": "when the preferred placement is set to right",
3596
+ "children": [
3597
+ {
3598
+ "type": "it",
3599
+ "name": "should show the fallback placement: bottom"
3600
+ }
3601
+ ]
3602
+ }
3603
+ ]
3604
+ }
3605
+ ]
3458
3606
  }
3459
3607
  ]
3460
3608
  }
@@ -7625,6 +7773,48 @@ module.exports = {specifications: [
7625
7773
  ]
7626
7774
  }
7627
7775
  ]
7776
+ },
7777
+ {
7778
+ "type": "describe",
7779
+ "name": "given the [Testing/Popups/Tooltip, TooltipWithFallbackPlacements] example is rendered",
7780
+ "children": [
7781
+ {
7782
+ "type": "describe",
7783
+ "name": "check the fallback placements",
7784
+ "children": [
7785
+ {
7786
+ "type": "describe",
7787
+ "name": "when the preferred placement is set to top",
7788
+ "children": [
7789
+ {
7790
+ "type": "it",
7791
+ "name": "should show the fallback placement: bottom"
7792
+ }
7793
+ ]
7794
+ },
7795
+ {
7796
+ "type": "describe",
7797
+ "name": "when the preferred placement is set to left",
7798
+ "children": [
7799
+ {
7800
+ "type": "it",
7801
+ "name": "should show the fallback placement: right"
7802
+ }
7803
+ ]
7804
+ },
7805
+ {
7806
+ "type": "describe",
7807
+ "name": "when the preferred placement is set to left",
7808
+ "children": [
7809
+ {
7810
+ "type": "it",
7811
+ "name": "should show the fallback placement: bottom"
7812
+ }
7813
+ ]
7814
+ }
7815
+ ]
7816
+ }
7817
+ ]
7628
7818
  }
7629
7819
  ]
7630
7820
  }
@@ -0,0 +1,9 @@
1
+ import Basic from './examples/MediaModal';
2
+
3
+
4
+ ## Media Modal example
5
+
6
+ These are modals that have an image or video as the primary content. The example can use a special
7
+ `MediaContainer` component that allows for media to take up more space in the Modal.
8
+
9
+ <ExampleCodeBlock code={Basic} />
@@ -0,0 +1,78 @@
1
+ import * as React from 'react';
2
+ import {Modal} from '@workday/canvas-kit-react/modal';
3
+ import {Box, BoxProps, Flex} from '@workday/canvas-kit-react/layout';
4
+ import {Text} from '@workday/canvas-kit-react/text';
5
+ import {PrimaryButton} from '@workday/canvas-kit-react/button';
6
+ import {spaceNumbers} from '@workday/canvas-kit-react/tokens';
7
+ import {createComponent} from '@workday/canvas-kit-react/common';
8
+
9
+ const MediaImage = createComponent('img')({
10
+ displayName: 'Media.Image',
11
+ Component: (elemProps: React.ImgHTMLAttributes<HTMLImageElement>, ref, Element) => {
12
+ const [loaded, setLoaded] = React.useState(false);
13
+
14
+ return (
15
+ <Box
16
+ as={Element}
17
+ ref={ref}
18
+ display="block"
19
+ backgroundColor="frenchVanilla200"
20
+ transition="opacity ease 200ms"
21
+ width="100%"
22
+ height={293}
23
+ style={{opacity: loaded ? 1 : 0}}
24
+ onLoad={() => setLoaded(true)}
25
+ {...elemProps}
26
+ />
27
+ );
28
+ },
29
+ });
30
+
31
+ const Media = createComponent('div')({
32
+ displayName: 'Media',
33
+ subComponents: {Image: MediaImage},
34
+ Component: ({children, ...elemProps}: BoxProps, ref, Element) => {
35
+ return (
36
+ <Box
37
+ as={Element}
38
+ ref={ref}
39
+ width={`calc(100% + ${spaceNumbers.l * 2}px)`}
40
+ marginLeft={`-${spaceNumbers.l}px`}
41
+ marginTop="m"
42
+ marginBottom="s"
43
+ {...elemProps}
44
+ >
45
+ {children}
46
+ </Box>
47
+ );
48
+ },
49
+ });
50
+
51
+ export default () => {
52
+ return (
53
+ <Modal>
54
+ <Modal.Target>Open Media Modal</Modal.Target>
55
+ <Modal.Overlay>
56
+ <Modal.Card>
57
+ <Modal.CloseIcon aria-label="Close" size="small" />
58
+ <Media>
59
+ <Media.Image
60
+ src="https://www.theuiaa.org/wp-content/uploads/2017/11/RTM19-banner-web.jpg"
61
+ alt="Sunrise in the mountains"
62
+ />
63
+ </Media>
64
+ <Modal.Heading>TED's Secret to Public Speaking</Modal.Heading>
65
+ <Modal.Body>
66
+ <Text as="p" marginTop={0} marginBottom="m">
67
+ The secret to great public speaking, according to former actor Martin Danielson, is as
68
+ simple as one, two, three.
69
+ </Text>
70
+ <Flex gap="s">
71
+ <Modal.CloseButton as={PrimaryButton}>Learn More</Modal.CloseButton>
72
+ </Flex>
73
+ </Modal.Body>
74
+ </Modal.Card>
75
+ </Modal.Overlay>
76
+ </Modal>
77
+ );
78
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "9.0.8",
3
+ "version": "9.0.10",
4
4
  "description": "Documentation components of Canvas Kit components",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -44,9 +44,9 @@
44
44
  "dependencies": {
45
45
  "@emotion/styled": "^11.6.0",
46
46
  "@storybook/csf": "0.0.1",
47
- "@workday/canvas-kit-labs-react": "^9.0.8",
48
- "@workday/canvas-kit-preview-react": "^9.0.8",
49
- "@workday/canvas-kit-react": "^9.0.8",
47
+ "@workday/canvas-kit-labs-react": "^9.0.10",
48
+ "@workday/canvas-kit-preview-react": "^9.0.10",
49
+ "@workday/canvas-kit-react": "^9.0.10",
50
50
  "@workday/canvas-system-icons-web": "^3.0.0",
51
51
  "markdown-to-jsx": "^6.10.3",
52
52
  "ts-node": "^10.9.1"
@@ -57,5 +57,5 @@
57
57
  "mkdirp": "^1.0.3",
58
58
  "typescript": "4.2"
59
59
  },
60
- "gitHead": "e0f80f6255d61eceeb79932d6a1bae3d9adeffdc"
60
+ "gitHead": "8fa72860c376f39967e95014afe43664f55d1683"
61
61
  }