@astryxdesign/lab 0.4.3-canary.b3dd679 → 0.4.3-canary.dc90488

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.
Files changed (45) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +0 -3
  4. package/dist/lab.css +0 -22
  5. package/package.json +3 -3
  6. package/src/index.ts +0 -9
  7. package/dist/BottomSheet/BottomSheet.d.ts +0 -65
  8. package/dist/BottomSheet/BottomSheet.d.ts.map +0 -1
  9. package/dist/BottomSheet/BottomSheet.js +0 -376
  10. package/dist/BottomSheet/BottomSheetPanel.d.ts +0 -57
  11. package/dist/BottomSheet/BottomSheetPanel.d.ts.map +0 -1
  12. package/dist/BottomSheet/BottomSheetPanel.js +0 -394
  13. package/dist/BottomSheet/BottomSheetSwitcher.d.ts +0 -60
  14. package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +0 -1
  15. package/dist/BottomSheet/BottomSheetSwitcher.js +0 -408
  16. package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts +0 -21
  17. package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts.map +0 -1
  18. package/dist/BottomSheet/BottomSheetSwitcherContext.js +0 -13
  19. package/dist/BottomSheet/index.d.ts +0 -11
  20. package/dist/BottomSheet/index.d.ts.map +0 -1
  21. package/dist/BottomSheet/index.js +0 -12
  22. package/dist/BottomSheet/snapOffsets.d.ts +0 -72
  23. package/dist/BottomSheet/snapOffsets.d.ts.map +0 -1
  24. package/dist/BottomSheet/snapOffsets.js +0 -130
  25. package/dist/BottomSheet/useMobileKeyboard.d.ts +0 -25
  26. package/dist/BottomSheet/useMobileKeyboard.d.ts.map +0 -1
  27. package/dist/BottomSheet/useMobileKeyboard.js +0 -384
  28. package/dist/BottomSheet/useSheetGestures.d.ts +0 -157
  29. package/dist/BottomSheet/useSheetGestures.d.ts.map +0 -1
  30. package/dist/BottomSheet/useSheetGestures.js +0 -764
  31. package/src/BottomSheet/BottomSheet.doc.mjs +0 -266
  32. package/src/BottomSheet/BottomSheet.test.tsx +0 -1734
  33. package/src/BottomSheet/BottomSheet.tsx +0 -539
  34. package/src/BottomSheet/BottomSheetPanel.test.tsx +0 -240
  35. package/src/BottomSheet/BottomSheetPanel.tsx +0 -545
  36. package/src/BottomSheet/BottomSheetSwitcher.doc.mjs +0 -107
  37. package/src/BottomSheet/BottomSheetSwitcher.test.tsx +0 -850
  38. package/src/BottomSheet/BottomSheetSwitcher.tsx +0 -634
  39. package/src/BottomSheet/BottomSheetSwitcherContext.ts +0 -51
  40. package/src/BottomSheet/index.ts +0 -15
  41. package/src/BottomSheet/snapOffsets.test.ts +0 -187
  42. package/src/BottomSheet/snapOffsets.ts +0 -159
  43. package/src/BottomSheet/useMobileKeyboard.ts +0 -566
  44. package/src/BottomSheet/useSheetGestures.test.ts +0 -615
  45. package/src/BottomSheet/useSheetGestures.ts +0 -1170
package/dist/index.d.ts CHANGED
@@ -16,7 +16,6 @@ export { TransferList, TransferListSelector, transferListVars, type TransferList
16
16
  export { ChatReasoning, type ChatReasoningProps, } from './ChatReasoning/ChatReasoning';
17
17
  export * from './Chat';
18
18
  export { Drawer, type DrawerProps } from './Drawer';
19
- export { BottomSheet, type BottomSheetHeight, type BottomSheetProps, BottomSheetSwitcher, type BottomSheetSwitcherProps, } from './BottomSheet';
20
19
  export { Tour, type TourProps, TourStep, type TourStepProps, useTour, type UseTourReturn, type TourDismissSource, } from './Tour';
21
20
  export { Stat, type StatProps, type StatDelta, type StatDeltaDirection, type StatDeltaSentiment, type StatSize, } from './Stat';
22
21
  export * from './Schedule';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH,OAAO,EAAC,UAAU,EAAE,KAAK,eAAe,EAAC,MAAM,cAAc,CAAC;AAC9D,OAAO,EACL,QAAQ,EACR,aAAa,EACb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W,EACX,KAAK,gBAAgB,EACrB,aAAa,EACb,eAAe,EACf,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,SAAS,EACT,KAAK,cAAc,EACnB,UAAU,EACV,KAAK,eAAe,EACpB,UAAU,EACV,KAAK,eAAe,EACpB,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,EACL,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,OAAO,EACZ,KAAK,cAAc,GACpB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,SAAS,EACT,KAAK,cAAc,EACnB,WAAW,EACX,KAAK,gBAAgB,EACrB,kBAAkB,EAClB,KAAK,uBAAuB,GAC7B,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,EACrB,UAAU,EACV,KAAK,eAAe,EACpB,UAAU,EACV,KAAK,eAAe,EACpB,WAAW,EACX,KAAK,gBAAgB,EACrB,SAAS,EACT,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,UAAU,CAAC;AAIlB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AAGnC,cAAc,aAAa,CAAC;AAG5B,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH,OAAO,EAAC,UAAU,EAAE,KAAK,eAAe,EAAC,MAAM,cAAc,CAAC;AAC9D,OAAO,EACL,QAAQ,EACR,aAAa,EACb,uBAA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KAAK,eAAe,EACpB,UAAU,EACV,KAAK,eAAe,EACpB,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,EACL,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,OAAO,EACZ,KAAK,cAAc,GACpB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,SAAS,EACT,KAAK,cAAc,EACnB,WAAW,EACX,KAAK,gBAAgB,EACrB,kBAAkB,EAClB,KAAK,uBAAuB,GAC7B,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,EACrB,UAAU,EACV,KAAK,eAAe,EACpB,UAAU,EACV,KAAK,eAAe,EACpB,WAAW,EACX,KAAK,gBAAgB,EACrB,SAAS,EACT,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,UAAU,CAAC;AAIlB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AAGnC,cAAc,aAAa,CAAC;AAG5B,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -29,9 +29,6 @@ export * from "./Chat/index.js";
29
29
  // Drawer — experimental overlay panel
30
30
  export { Drawer } from "./Drawer/index.js";
31
31
 
32
- // BottomSheet — mobile touch sheet on a native modal <dialog>
33
- export { BottomSheet, BottomSheetSwitcher } from "./BottomSheet/index.js";
34
-
35
32
  // Tour — guided product-tour / NUX walkthrough (facebook/astryx#4239)
36
33
  export { Tour, TourStep, useTour } from "./Tour/index.js";
37
34
 
package/dist/lab.css CHANGED
@@ -129,7 +129,6 @@
129
129
  .xb3r6kr:not(#\#):not(#\#){overflow:hidden}
130
130
  .x1rea2x4:not(#\#):not(#\#){overflow:visible}
131
131
  .xish69e:not(#\#):not(#\#){overscroll-behavior:contain}
132
- .x8du1vd:not(#\#):not(#\#){overscroll-behavior:none}
133
132
  .xt970qd:not(#\#):not(#\#){padding-block:0}
134
133
  .xsplgde:not(#\#):not(#\#){padding-block:1px}
135
134
  .x13f7esw:not(#\#):not(#\#){padding-block:var(--spacing-0-5)}
@@ -253,8 +252,6 @@
253
252
  .x1j92z86:not(#\#):not(#\#):not(#\#){border-inline-start-color:var(--color-border)}
254
253
  .x1t7ytsu:not(#\#):not(#\#):not(#\#){border-inline-start-style:solid}
255
254
  .xgbv0en:not(#\#):not(#\#):not(#\#){border-inline-start-width:var(--border-width)}
256
- .x7hs6f1:not(#\#):not(#\#):not(#\#){border-start-end-radius:var(--radius-container)}
257
- .x81l70g:not(#\#):not(#\#):not(#\#){border-start-start-radius:var(--radius-container)}
258
255
  .x18oyj42:not(#\#):not(#\#):not(#\#){box-shadow:0 0 0 1px var(--color-accent)}
259
256
  .xefcaua:not(#\#):not(#\#):not(#\#){box-shadow:0 0 0 2px var(--color-background-surface),0 0 0 4px var(--color-accent),0 0 0 9999px var(--color-overlay)}
260
257
  .xr5mita:not(#\#):not(#\#):not(#\#){box-shadow:0 0 0 2px var(--color-background-surface),0 0 0 4px var(--color-accent)}
@@ -434,7 +431,6 @@
434
431
  .xixxii4:not(#\#):not(#\#):not(#\#){position:fixed}
435
432
  .x1n2onr6:not(#\#):not(#\#):not(#\#){position:relative}
436
433
  .xxs79tx:not(#\#):not(#\#):not(#\#){row-gap:0}
437
- .xrw9175:not(#\#):not(#\#):not(#\#){scroll-padding-block-end:48px}
438
434
  .x185mbhu:not(#\#):not(#\#):not(#\#){scrollbar-gutter:stable}
439
435
  .x1597r2g:not(#\#):not(#\#):not(#\#){scrollbar-width:thin}
440
436
  .x1owpc8m:not(#\#):not(#\#):not(#\#){stroke-linecap:round}
@@ -478,7 +474,6 @@
478
474
  .xxnu56j:not(#\#):not(#\#):not(#\#){transition-property:stroke-dashoffset}
479
475
  .x1gfj591:not(#\#):not(#\#):not(#\#){transition-property:top,left,width,height}
480
476
  .x1yw18vd:not(#\#):not(#\#):not(#\#){transition-property:transform,max-width,display}
481
- .xwcsmn1:not(#\#):not(#\#):not(#\#){transition-property:transform,opacity}
482
477
  .x9lcvmn:not(#\#):not(#\#):not(#\#){transition-timing-function:ease-out}
483
478
  .xlr8y92:not(#\#):not(#\#):not(#\#){transition-timing-function:var(--ease-standard)}
484
479
  .x87ps6o:not(#\#):not(#\#):not(#\#){user-select:none}
@@ -489,12 +484,10 @@
489
484
  .xuxw1ft:not(#\#):not(#\#):not(#\#){white-space:nowrap}
490
485
  .x126k92a:not(#\#):not(#\#):not(#\#){white-space:pre-wrap}
491
486
  .x1sdyfia:not(#\#):not(#\#):not(#\#){white-space:pre}
492
- .x1q1rmc8:not(#\#):not(#\#):not(#\#){will-change:transform,opacity}
493
487
  .x1so62im:not(#\#):not(#\#):not(#\#){will-change:transform}
494
488
  .x1lldw8n:not(#\#):not(#\#):not(#\#){word-break:normal}
495
489
  .x98t3bc:not(#\#):not(#\#):not(#\#){writing-mode:vertical-rl}
496
490
  .x1vjfegm:not(#\#):not(#\#):not(#\#){z-index:1}
497
- .xfo81ep:not(#\#):not(#\#):not(#\#){z-index:1000}
498
491
  .x1355qak:not(#\#):not(#\#):not(#\#){z-index:20}
499
492
  .xr3buco:not(#\#):not(#\#):not(#\#){z-index:var(--x-zIndex)}
500
493
  .x1rmeqbc.x1rmeqbc:where(.x1fcdk97:first-child *):not(#\#):not(#\#):not(#\#){visibility:hidden}
@@ -541,7 +534,6 @@
541
534
  .x1ey2m1c:not(#\#):not(#\#):not(#\#):not(#\#){bottom:0}
542
535
  .xdd4er5:not(#\#):not(#\#):not(#\#):not(#\#){bottom:auto}
543
536
  .x1hmuevu:not(#\#):not(#\#):not(#\#):not(#\#){bottom:var(--spacing-3)}
544
- .x5yr21d:not(#\#):not(#\#):not(#\#):not(#\#){height:100%}
545
537
  .xtdtrs8:not(#\#):not(#\#):not(#\#):not(#\#){height:100dvh}
546
538
  .x170jfvy:not(#\#):not(#\#):not(#\#):not(#\#){height:10px}
547
539
  .x1v9usgg:not(#\#):not(#\#):not(#\#):not(#\#){height:14px}
@@ -553,16 +545,12 @@
553
545
  .x1ycjhwn:not(#\#):not(#\#):not(#\#):not(#\#){height:5px}
554
546
  .x1d9x2de:not(#\#):not(#\#):not(#\#):not(#\#){height:640px}
555
547
  .xt7dq6l:not(#\#):not(#\#):not(#\#):not(#\#){height:auto}
556
- .x1tpcejd:not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--_sheet-budget) + 48px)}
557
- .xg7h5cd:not(#\#):not(#\#):not(#\#):not(#\#){height:fit-content}
558
548
  .xhigkf7:not(#\#):not(#\#):not(#\#):not(#\#){height:var(--icon-size)}
559
549
  .x11c6zpc:not(#\#):not(#\#):not(#\#):not(#\#){height:var(--spacing-1)}
560
- .x1k15mir:not(#\#):not(#\#):not(#\#):not(#\#){height:var(--spacing-12)}
561
550
  .x6b6gus:not(#\#):not(#\#):not(#\#):not(#\#){height:var(--spacing-4)}
562
551
  .x1grt7ep:not(#\#):not(#\#):not(#\#):not(#\#){height:var(--spacing-5)}
563
552
  .x16ye13r:not(#\#):not(#\#):not(#\#):not(#\#){height:var(--x-height)}
564
553
  .x1unci72:not(#\#):not(#\#):not(#\#):not(#\#){left:var(--spacing-4)}
565
- .x1if0o47:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:-48px}
566
554
  .xlstkdb:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:var(--spacing-0-5)}
567
555
  .x1p37lm5:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:var(--spacing-2)}
568
556
  .x160xvyo:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:calc(var(--spacing-1) * -1)}
@@ -570,14 +558,12 @@
570
558
  .xtbrsbv:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:var(--spacing-2)}
571
559
  .x1vhfslr:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:var(--x-marginBlockStart)}
572
560
  .x12ajvvl:not(#\#):not(#\#):not(#\#):not(#\#){max-height:calc(100vh - 32px)}
573
- .x14bu9tk:not(#\#):not(#\#):not(#\#):not(#\#){max-height:calc(92dvh + 48px)}
574
561
  .xedcshv:not(#\#):not(#\#):not(#\#):not(#\#){max-height:inherit}
575
562
  .x7ab17h:not(#\#):not(#\#):not(#\#):not(#\#){max-height:none}
576
563
  .x9rxgia:not(#\#):not(#\#):not(#\#):not(#\#){max-height:var(--transfer-list-panel-max-block-size)}
577
564
  .x1jols5v:not(#\#):not(#\#):not(#\#):not(#\#){max-height:var(--x-maxHeight)}
578
565
  .x1va8c73:not(#\#):not(#\#):not(#\#):not(#\#){max-width:320px}
579
566
  .x1k2d6hx:not(#\#):not(#\#):not(#\#):not(#\#){max-width:44px}
580
- .x11gisft:not(#\#):not(#\#):not(#\#):not(#\#){max-width:640px}
581
567
  .x1x1rfll:not(#\#):not(#\#):not(#\#):not(#\#){max-width:none}
582
568
  .xf68679:not(#\#):not(#\#):not(#\#):not(#\#){max-width:var(--x-maxWidth)}
583
569
  .x2lwn1j:not(#\#):not(#\#):not(#\#):not(#\#){min-height:0}
@@ -596,9 +582,7 @@
596
582
  .xw2csxc:not(#\#):not(#\#):not(#\#):not(#\#){overflow-x:auto}
597
583
  .x6ikm8r:not(#\#):not(#\#):not(#\#):not(#\#){overflow-x:hidden}
598
584
  .x1odjw0f:not(#\#):not(#\#):not(#\#):not(#\#){overflow-y:auto}
599
- .x18d9i69:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:0}
600
585
  .x1j85h84:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:1px}
601
- .x1wkw6tp:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:calc(env(safe-area-inset-bottom,0px) + 48px)}
602
586
  .xy143xn:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:var(--spacing-1)}
603
587
  .xpgmcrp:not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--icon-block-offset)}
604
588
  .xbx876j:not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--spacing-0-5)}
@@ -620,7 +604,6 @@
620
604
  .x1td3qas:not(#\#):not(#\#):not(#\#):not(#\#){width:32px}
621
605
  .x1ftt334:not(#\#):not(#\#):not(#\#):not(#\#){width:5px}
622
606
  .x1oai4fc:not(#\#):not(#\#):not(#\#):not(#\#){width:var(--icon-size)}
623
- .x1m747yf:not(#\#):not(#\#):not(#\#):not(#\#){width:var(--size-element-lg)}
624
607
  .xx9zwd3:not(#\#):not(#\#):not(#\#):not(#\#){width:var(--spacing-1)}
625
608
  .x12xnipv:not(#\#):not(#\#):not(#\#):not(#\#){width:var(--spacing-4)}
626
609
  .xfyiiit:not(#\#):not(#\#):not(#\#):not(#\#){width:var(--spacing-5)}
@@ -654,19 +637,15 @@
654
637
  .xnixb3f:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{background-color:var(--color-overlay)}
655
638
  .x1cpjm7i:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{content:""}
656
639
  .x1s928wv:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{content:""}
657
- .xhkezso:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{display:block}
658
640
  .xxxjk75:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{inset-inline-start:-1px}
659
641
  .xh7j7mt:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{inset-inline-start:-6px}
660
642
  .xph5o2a:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{opacity:0}
661
643
  .xb3n6bw:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{opacity:1}
662
- .xni466t:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{opacity:var(--_sheet-scrim-opacity,1)}
663
644
  .x2q1x1w:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{pointer-events:none}
664
645
  .xkk1bqk:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{pointer-events:none}
665
646
  .x1hmns74:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{position:absolute}
666
647
  .x1j6awrg:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{position:absolute}
667
- .x142juwg:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{transition-behavior:allow-discrete}
668
648
  .xft5bk6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{transition-duration:var(--duration-medium)}
669
- .xc0dz0a:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{transition-property:opacity,display}
670
649
  .x167zut7:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{transition-property:opacity}
671
650
  .x15h3t91:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{transition-timing-function:var(--ease-standard)}
672
651
  .x1jg531d:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{z-index:2}
@@ -679,7 +658,6 @@
679
658
  .x1mprab4:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{bottom:calc(-1 * var(--spacing-0-5))}
680
659
  .x17zp9gg:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{height:10px}
681
660
  .x1bymyaz:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{height:10px}
682
- .xu6fald:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{height:var(--_sheet-keyboard-inset,0px)}
683
661
  .x1a9plwg:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{height:var(--spacing-0-5)}
684
662
  .xiiru4q:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{height:var(--spacing-0-5)}
685
663
  .x1mpa3hi:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{top:-6px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/lab",
3
- "version": "0.4.3-canary.b3dd679",
3
+ "version": "0.4.3-canary.dc90488",
4
4
  "description": "Experimental Astryx components — published to npm only under the @canary dist-tag for early testing; never released as a stable (latest) version.",
5
5
  "author": "Meta Open Source",
6
6
  "license": "MIT",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@stylexjs/stylex": ">=0.10.0",
48
- "@astryxdesign/core": "0.4.3-canary.b3dd679",
48
+ "@astryxdesign/core": "0.4.3-canary.dc90488",
49
49
  "react": ">=19.0.0",
50
50
  "react-dom": ">=19.0.0"
51
51
  },
@@ -55,7 +55,7 @@
55
55
  "d3-shape": "^3.2.0"
56
56
  },
57
57
  "devDependencies": {
58
- "@astryxdesign/cli": "0.4.3-canary.b3dd679",
58
+ "@astryxdesign/cli": "0.4.3-canary.dc90488",
59
59
  "@types/d3-array": "^3.2.2",
60
60
  "@types/d3-scale": "^4.0.9",
61
61
  "@types/d3-shape": "^3.1.8",
package/src/index.ts CHANGED
@@ -45,15 +45,6 @@ export * from './Chat';
45
45
  // Drawer — experimental overlay panel
46
46
  export {Drawer, type DrawerProps} from './Drawer';
47
47
 
48
- // BottomSheet — mobile touch sheet on a native modal <dialog>
49
- export {
50
- BottomSheet,
51
- type BottomSheetHeight,
52
- type BottomSheetProps,
53
- BottomSheetSwitcher,
54
- type BottomSheetSwitcherProps,
55
- } from './BottomSheet';
56
-
57
48
  // Tour — guided product-tour / NUX walkthrough (facebook/astryx#4239)
58
49
  export {
59
50
  Tour,
@@ -1,65 +0,0 @@
1
- /**
2
- * @file BottomSheet.tsx
3
- * @input Uses React, StyleX, core hooks/utils, BottomSheetPanel, BottomSheetSwitcherContext
4
- * @output Exports BottomSheet component and BottomSheetProps
5
- * @position Public BottomSheet router plus private standalone/switcher hosts
6
- *
7
- * BottomSheet selects one of two focused hosts. A standalone host owns its
8
- * native dialog lifecycle; a switcher item participates in the parent's shared
9
- * dialog and transition state machine. Both render the same BottomSheetPanel,
10
- * which owns sheet presentation, gestures, mobile-keyboard accommodation, and
11
- * motion completion.
12
- *
13
- * SYNC: When modified, update these files to stay in sync:
14
- * - /packages/lab/src/BottomSheet/BottomSheetPanel.tsx
15
- * - /packages/lab/src/BottomSheet/BottomSheet.doc.mjs
16
- * - /packages/lab/src/BottomSheet/BottomSheet.test.tsx
17
- * - /packages/lab/src/BottomSheet/BottomSheetSwitcher.tsx
18
- * - /packages/lab/src/BottomSheet/BottomSheetSwitcher.test.tsx
19
- * - /apps/storybook/stories/BottomSheet.stories.tsx
20
- */
21
- import { type ReactNode } from 'react';
22
- import type { BaseProps } from '@astryxdesign/core';
23
- import type { DialogPurpose } from '@astryxdesign/core/Dialog';
24
- export type { BottomSheetHeight } from './BottomSheetPanel';
25
- import type { BottomSheetHeight } from './BottomSheetPanel';
26
- interface BottomSheetSharedProps extends BaseProps<HTMLDivElement> {
27
- /** Ref forwarded to the visual sheet panel <div>. */
28
- ref?: React.Ref<HTMLDivElement>;
29
- /** Accessible label for the sheet. */
30
- label: string;
31
- /** Sheet content, rendered below the grab handle in a scrollable area. */
32
- children: ReactNode;
33
- /** Height budget or custom CSS length. Only fully expanded Tall is keyboard-aware. @default 'capped' */
34
- height?: BottomSheetHeight | number | string;
35
- /**
36
- * Configures implicit dismissal behavior, matching Dialog.
37
- * - required: Blocks swipe, scrim click, and Escape
38
- * - form: Blocks swipe and scrim click, allows Escape
39
- * - info: Allows swipe, scrim click, and Escape
40
- * @default 'info'
41
- */
42
- purpose?: DialogPurpose;
43
- }
44
- interface StandaloneBottomSheetProps extends BottomSheetSharedProps {
45
- isOpen: boolean;
46
- onOpenChange: (isOpen: boolean) => void;
47
- hasScrim?: boolean;
48
- sheetId?: never;
49
- }
50
- interface SwitcherBottomSheetProps extends BottomSheetSharedProps {
51
- sheetId: string;
52
- isOpen?: never;
53
- onOpenChange?: never;
54
- hasScrim?: never;
55
- }
56
- export type BottomSheetProps = StandaloneBottomSheetProps | SwitcherBottomSheetProps;
57
- /**
58
- * A mobile touch sheet that either owns a native dialog or participates in a
59
- * BottomSheetSwitcher shared dialog when given a sheetId inside that context.
60
- */
61
- export declare function BottomSheet(props: BottomSheetProps): import("react").JSX.Element;
62
- export declare namespace BottomSheet {
63
- var displayName: string;
64
- }
65
- //# sourceMappingURL=BottomSheet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAC;AAkB7D,YAAY,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AA2D1D,UAAU,sBAAuB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAChE,qDAAqD;IACrD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IAEd,0EAA0E;IAC1E,QAAQ,EAAE,SAAS,CAAC;IAEpB,wGAAwG;IACxG,MAAM,CAAC,EAAE,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;IAE7C;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,UAAU,0BAA2B,SAAQ,sBAAsB;IACjE,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AAED,UAAU,wBAAyB,SAAQ,sBAAsB;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AAED,MAAM,MAAM,gBAAgB,GAC1B,0BAA0B,GAAG,wBAAwB,CAAC;AA+VxD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BA6BlD;yBA7Be,WAAW"}
@@ -1,376 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- 'use client';
4
-
5
- /**
6
- * @file BottomSheet.tsx
7
- * @input Uses React, StyleX, core hooks/utils, BottomSheetPanel, BottomSheetSwitcherContext
8
- * @output Exports BottomSheet component and BottomSheetProps
9
- * @position Public BottomSheet router plus private standalone/switcher hosts
10
- *
11
- * BottomSheet selects one of two focused hosts. A standalone host owns its
12
- * native dialog lifecycle; a switcher item participates in the parent's shared
13
- * dialog and transition state machine. Both render the same BottomSheetPanel,
14
- * which owns sheet presentation, gestures, mobile-keyboard accommodation, and
15
- * motion completion.
16
- *
17
- * SYNC: When modified, update these files to stay in sync:
18
- * - /packages/lab/src/BottomSheet/BottomSheetPanel.tsx
19
- * - /packages/lab/src/BottomSheet/BottomSheet.doc.mjs
20
- * - /packages/lab/src/BottomSheet/BottomSheet.test.tsx
21
- * - /packages/lab/src/BottomSheet/BottomSheetSwitcher.tsx
22
- * - /packages/lab/src/BottomSheet/BottomSheetSwitcher.test.tsx
23
- * - /apps/storybook/stories/BottomSheet.stories.tsx
24
- */
25
- import { useCallback, useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';
26
- import * as stylex from '@stylexjs/stylex';
27
- import '@astryxdesign/core/theme/tokens.stylex';
28
- import { colorVars, durationVars, easeVars } from '@astryxdesign/core/theme/tokens.stylex';
29
- import { useDevWarning, useScrollLock } from '@astryxdesign/core/hooks';
30
- import { BottomSheetPanel } from "./BottomSheetPanel.js";
31
- import { BottomSheetSwitcherContext } from "./BottomSheetSwitcherContext.js";
32
- import { jsx as _jsx } from "react/jsx-runtime";
33
- function panelStateForSwitcherPhase(phase, alignmentOffset) {
34
- switch (phase) {
35
- case 'active':
36
- return {
37
- kind: 'open',
38
- entering: false
39
- };
40
- case 'entering':
41
- return {
42
- kind: 'open',
43
- entering: true
44
- };
45
- case 'covered':
46
- case 'aligning':
47
- case 'fading':
48
- return {
49
- kind: 'retained',
50
- motion: phase,
51
- alignmentOffset
52
- };
53
- case 'exiting':
54
- return {
55
- kind: 'exiting'
56
- };
57
- case 'hidden':
58
- return {
59
- kind: 'hidden'
60
- };
61
- }
62
- }
63
- function focusPanel(panel, isModal) {
64
- const activeElement = document.activeElement;
65
- if (activeElement != null && panel?.contains(activeElement)) {
66
- return;
67
- }
68
- const autofocus = panel?.querySelector('[data-autofocus]');
69
- if (autofocus != null) {
70
- autofocus.focus();
71
- } else if (isModal) {
72
- panel?.focus();
73
- }
74
- }
75
- function StandaloneBottomSheet({
76
- ref,
77
- isOpen,
78
- onOpenChange,
79
- label,
80
- children,
81
- height = 'capped',
82
- hasScrim = true,
83
- purpose = 'info',
84
- xstyle,
85
- ...props
86
- }) {
87
- const dialogRef = useRef(null);
88
- const panelRef = useRef(null);
89
- const triggerRef = useRef(null);
90
- const [isPresented, setIsPresented] = useState(isOpen);
91
- const shouldPresent = isOpen || isPresented;
92
- const panelState = isOpen ? {
93
- kind: 'open',
94
- entering: false
95
- } : isPresented ? {
96
- kind: 'exiting'
97
- } : {
98
- kind: 'hidden'
99
- };
100
- const dismissOnEscape = useCallback(() => {
101
- if (purpose !== 'required') {
102
- onOpenChange(false);
103
- }
104
- }, [onOpenChange, purpose]);
105
- const dismissOnLightInteraction = useCallback(() => {
106
- if (purpose === 'info') {
107
- onOpenChange(false);
108
- }
109
- }, [onOpenChange, purpose]);
110
- const handlePanelElementChange = useCallback(element => {
111
- panelRef.current = element;
112
- }, []);
113
- const handleScrimOpacity = useCallback(opacity => {
114
- dialogRef.current?.style.setProperty('--_sheet-scrim-opacity', String(opacity));
115
- }, []);
116
- useEffect(() => {
117
- const dialog = dialogRef.current;
118
- if (dialog == null || !isOpen) {
119
- return;
120
- }
121
- setIsPresented(true);
122
- dialog.style.setProperty('--_sheet-scrim-opacity', '1');
123
- const wasOpen = dialog.open;
124
- if (!wasOpen) {
125
- if (hasScrim) {
126
- triggerRef.current = document.activeElement;
127
- dialog.showModal();
128
- } else {
129
- dialog.show();
130
- }
131
- focusPanel(panelRef.current, hasScrim);
132
- }
133
- }, [hasScrim, isOpen]);
134
- useEffect(() => {
135
- if (!isOpen && isPresented && hasScrim) {
136
- handleScrimOpacity(0);
137
- }
138
- }, [handleScrimOpacity, hasScrim, isOpen, isPresented]);
139
- const handleMotionComplete = useCallback(motion => {
140
- if (motion !== 'exiting' || isOpen) {
141
- return;
142
- }
143
- const dialog = dialogRef.current;
144
- if (dialog?.open) {
145
- dialog.close();
146
- }
147
- setIsPresented(false);
148
- triggerRef.current?.focus();
149
- triggerRef.current = null;
150
- }, [isOpen]);
151
- useScrollLock(shouldPresent && hasScrim);
152
- useDevWarning('BottomSheet', 'requires a non-empty `label` for an accessible name; the open sheet ' + 'has no built-in heading to derive one from.', isOpen && !label);
153
- const handleCancel = useCallback(event => {
154
- event.preventDefault();
155
- dismissOnEscape();
156
- }, [dismissOnEscape]);
157
- const handleKeyDown = useCallback(event => {
158
- if (event.key === 'Escape') {
159
- event.preventDefault();
160
- dismissOnEscape();
161
- }
162
- }, [dismissOnEscape]);
163
- const handleClick = useCallback(event => {
164
- if (hasScrim && event.target === event.currentTarget) {
165
- dismissOnLightInteraction();
166
- }
167
- }, [dismissOnLightInteraction, hasScrim]);
168
- return /*#__PURE__*/_jsx("dialog", {
169
- ...{
170
- 0: {
171
- className: "xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1s85apg x1a2a7pz"
172
- },
173
- 4: {
174
- className: "xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1a2a7pz x1lliihq"
175
- },
176
- 2: {
177
- className: "xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1s85apg x1a2a7pz xnixb3f xni466t xxiuuzi xc0dz0a xft5bk6 x15h3t91 x142juwg x1viac0w"
178
- },
179
- 6: {
180
- className: "xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1a2a7pz x1lliihq xnixb3f xni466t xxiuuzi xc0dz0a xft5bk6 x15h3t91 x142juwg x1viac0w"
181
- },
182
- 1: {
183
- className: "xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1s85apg x1a2a7pz x47corl xfo81ep xh8yej3 x5yr21d"
184
- },
185
- 5: {
186
- className: "xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1a2a7pz x1lliihq x47corl xfo81ep xh8yej3 x5yr21d"
187
- },
188
- 3: {
189
- className: "xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1s85apg x1a2a7pz xnixb3f xni466t xxiuuzi xc0dz0a xft5bk6 x15h3t91 x142juwg x1viac0w x47corl xfo81ep xh8yej3 x5yr21d"
190
- },
191
- 7: {
192
- className: "xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xjbqb8w x1rea2x4 x1a2a7pz x1lliihq xnixb3f xni466t xxiuuzi xc0dz0a xft5bk6 x15h3t91 x142juwg x1viac0w x47corl xfo81ep xh8yej3 x5yr21d"
193
- }
194
- }[!!shouldPresent << 2 | !!hasScrim << 1 | !!!hasScrim << 0],
195
- ref: dialogRef,
196
- "aria-label": label,
197
- "aria-hidden": !isOpen && isPresented ? 'true' : undefined,
198
- "aria-modal": hasScrim && isOpen ? 'true' : undefined,
199
- role: purpose === 'required' ? 'alertdialog' : undefined,
200
- inert: !isOpen && isPresented ? true : undefined,
201
- onCancel: handleCancel,
202
- onClick: handleClick,
203
- onKeyDown: handleKeyDown,
204
- children: /*#__PURE__*/_jsx("div", {
205
- ...{
206
- className: "x10l6tqk x17y0mx6 x1ey2m1c x78zum5 xl56j7k x47corl"
207
- },
208
- children: /*#__PURE__*/_jsx(BottomSheetPanel, {
209
- ...props,
210
- ref: ref,
211
- state: panelState,
212
- height: height,
213
- canSwipeDismiss: purpose === 'info',
214
- xstyle: xstyle,
215
- onDismiss: dismissOnLightInteraction,
216
- onScrimOpacity: handleScrimOpacity,
217
- onElementChange: handlePanelElementChange,
218
- onMotionComplete: handleMotionComplete,
219
- children: children
220
- })
221
- })
222
- });
223
- }
224
- function SwitcherBottomSheetItem({
225
- switcher,
226
- ref,
227
- sheetId,
228
- label,
229
- children,
230
- height = 'capped',
231
- purpose = 'info',
232
- xstyle,
233
- ...props
234
- }) {
235
- const {
236
- activeSheet,
237
- hasScrim,
238
- onActiveSheetChange,
239
- getSheetPhase,
240
- getSheetAlignmentOffset,
241
- registerSheetElement,
242
- registerSheetLabel,
243
- registerSheetPurpose,
244
- onSheetEnterStart,
245
- onSheetTransitionComplete,
246
- onSheetScrimOpacityChange
247
- } = switcher;
248
- const hasValidSheetId = typeof sheetId === 'string' && sheetId.length > 0;
249
- const phase = hasValidSheetId ? getSheetPhase(sheetId) : 'hidden';
250
- const alignmentOffset = hasValidSheetId ? getSheetAlignmentOffset(sheetId) : 0;
251
- const panelState = panelStateForSwitcherPhase(phase, alignmentOffset);
252
- const isInteractive = phase === 'active' || phase === 'entering';
253
- const isInactive = phase === 'covered' || phase === 'aligning' || phase === 'fading' || phase === 'exiting';
254
- const isPresented = phase !== 'hidden';
255
- const isTopSheet = phase === 'active' || phase === 'entering';
256
- const panelRef = useRef(null);
257
- const previousPhaseRef = useRef(phase);
258
- const previousPhase = previousPhaseRef.current;
259
- const hasPresentedRef = useRef(false);
260
- useLayoutEffect(() => {
261
- previousPhaseRef.current = phase;
262
- }, [phase]);
263
- const dismissOnSwipe = useCallback(() => {
264
- if (purpose === 'info' && hasValidSheetId && activeSheet === sheetId) {
265
- onActiveSheetChange(null);
266
- }
267
- }, [activeSheet, hasValidSheetId, onActiveSheetChange, purpose, sheetId]);
268
- const handlePanelElementChange = useCallback(element => {
269
- panelRef.current = element;
270
- if (hasValidSheetId) {
271
- registerSheetElement(sheetId, element);
272
- }
273
- }, [hasValidSheetId, registerSheetElement, sheetId]);
274
- const handleMotionStart = useCallback(motion => {
275
- if (motion === 'entering' && hasValidSheetId) {
276
- onSheetEnterStart(sheetId);
277
- }
278
- }, [hasValidSheetId, onSheetEnterStart, sheetId]);
279
- const handleMotionComplete = useCallback(motion => {
280
- if (hasValidSheetId) {
281
- onSheetTransitionComplete({
282
- sheetId,
283
- phase: motion
284
- });
285
- }
286
- }, [hasValidSheetId, onSheetTransitionComplete, sheetId]);
287
- const handleScrimOpacity = useCallback(opacity => {
288
- if (hasValidSheetId) {
289
- onSheetScrimOpacityChange(sheetId, opacity);
290
- }
291
- }, [hasValidSheetId, onSheetScrimOpacityChange, sheetId]);
292
- useLayoutEffect(() => {
293
- if (!hasValidSheetId) {
294
- return;
295
- }
296
- registerSheetLabel(sheetId, label);
297
- return () => registerSheetLabel(sheetId, null);
298
- }, [hasValidSheetId, label, registerSheetLabel, sheetId]);
299
- useLayoutEffect(() => {
300
- if (!hasValidSheetId) {
301
- return;
302
- }
303
- registerSheetPurpose(sheetId, purpose);
304
- return () => registerSheetPurpose(sheetId, null);
305
- }, [hasValidSheetId, purpose, registerSheetPurpose, sheetId]);
306
- useEffect(() => {
307
- if (isInteractive) {
308
- const wasInteractive = previousPhase === 'active' || previousPhase === 'entering';
309
- if (!hasPresentedRef.current || !wasInteractive) {
310
- focusPanel(panelRef.current, hasScrim);
311
- }
312
- hasPresentedRef.current = true;
313
- } else if (phase === 'hidden') {
314
- hasPresentedRef.current = false;
315
- }
316
- }, [hasScrim, isInteractive, phase, previousPhase]);
317
- useDevWarning('BottomSheet', 'requires a non-empty `label` for an accessible name; the open sheet ' + 'has no built-in heading to derive one from.', isInteractive && !label);
318
- return /*#__PURE__*/_jsx("div", {
319
- ...{
320
- 0: {
321
- className: "x10l6tqk x17y0mx6 x1ey2m1c x78zum5 xl56j7k x47corl"
322
- },
323
- 2: {
324
- className: "x10l6tqk x17y0mx6 x1ey2m1c xl56j7k x47corl x1s85apg"
325
- },
326
- 1: {
327
- className: "x10l6tqk x17y0mx6 x1ey2m1c x78zum5 xl56j7k x47corl x1vjfegm"
328
- },
329
- 3: {
330
- className: "x10l6tqk x17y0mx6 x1ey2m1c xl56j7k x47corl x1s85apg x1vjfegm"
331
- }
332
- }[!!!isPresented << 1 | !!isTopSheet << 0],
333
- hidden: !isPresented,
334
- "aria-hidden": isInactive ? 'true' : undefined,
335
- inert: isInactive ? true : undefined,
336
- children: /*#__PURE__*/_jsx(BottomSheetPanel, {
337
- ...props,
338
- ref: ref,
339
- state: panelState,
340
- height: height,
341
- canSwipeDismiss: purpose === 'info',
342
- xstyle: xstyle,
343
- onDismiss: dismissOnSwipe,
344
- onScrimOpacity: handleScrimOpacity,
345
- onElementChange: handlePanelElementChange,
346
- onMotionStart: handleMotionStart,
347
- onMotionComplete: handleMotionComplete,
348
- children: /*#__PURE__*/_jsx(BottomSheetSwitcherContext.Provider, {
349
- value: null,
350
- children: children
351
- })
352
- })
353
- });
354
- }
355
-
356
- /**
357
- * A mobile touch sheet that either owns a native dialog or participates in a
358
- * BottomSheetSwitcher shared dialog when given a sheetId inside that context.
359
- */
360
- export function BottomSheet(props) {
361
- const switcher = useContext(BottomSheetSwitcherContext);
362
- const runtimeSheetId = props.sheetId;
363
- const hasValidSheetId = typeof runtimeSheetId === 'string' && runtimeSheetId.length > 0;
364
- useDevWarning('BottomSheet', 'requires a non-empty `sheetId` when nested in ' + 'BottomSheetSwitcher; standalone `isOpen` / `onOpenChange` props are ' + 'ignored there.', switcher != null && !hasValidSheetId);
365
- useDevWarning('BottomSheet', '`sheetId` only works inside BottomSheetSwitcher. Use `isOpen` and ' + '`onOpenChange` for a standalone sheet.', switcher == null && runtimeSheetId != null);
366
- if (switcher != null) {
367
- return /*#__PURE__*/_jsx(SwitcherBottomSheetItem, {
368
- ...props,
369
- switcher: switcher
370
- });
371
- }
372
- return /*#__PURE__*/_jsx(StandaloneBottomSheet, {
373
- ...props
374
- });
375
- }
376
- BottomSheet.displayName = 'BottomSheet';