@kushagradhawan/kookie-ui 0.1.108 → 0.1.109

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 (56) hide show
  1. package/components.css +72 -51
  2. package/dist/cjs/components/_internal/shell-bottom.d.ts +2 -0
  3. package/dist/cjs/components/_internal/shell-bottom.d.ts.map +1 -1
  4. package/dist/cjs/components/_internal/shell-bottom.js +1 -1
  5. package/dist/cjs/components/_internal/shell-bottom.js.map +3 -3
  6. package/dist/cjs/components/_internal/shell-inspector.d.ts +2 -0
  7. package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -1
  8. package/dist/cjs/components/_internal/shell-inspector.js +1 -1
  9. package/dist/cjs/components/_internal/shell-inspector.js.map +3 -3
  10. package/dist/cjs/components/_internal/shell-sidebar.d.ts +2 -0
  11. package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -1
  12. package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
  13. package/dist/cjs/components/_internal/shell-sidebar.js.map +3 -3
  14. package/dist/cjs/components/shell.context.d.ts +13 -0
  15. package/dist/cjs/components/shell.context.d.ts.map +1 -1
  16. package/dist/cjs/components/shell.context.js +1 -1
  17. package/dist/cjs/components/shell.context.js.map +3 -3
  18. package/dist/cjs/components/shell.d.ts +14 -6
  19. package/dist/cjs/components/shell.d.ts.map +1 -1
  20. package/dist/cjs/components/shell.js +1 -1
  21. package/dist/cjs/components/shell.js.map +3 -3
  22. package/dist/esm/components/_internal/shell-bottom.d.ts +2 -0
  23. package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -1
  24. package/dist/esm/components/_internal/shell-bottom.js +1 -1
  25. package/dist/esm/components/_internal/shell-bottom.js.map +3 -3
  26. package/dist/esm/components/_internal/shell-inspector.d.ts +2 -0
  27. package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
  28. package/dist/esm/components/_internal/shell-inspector.js +1 -1
  29. package/dist/esm/components/_internal/shell-inspector.js.map +3 -3
  30. package/dist/esm/components/_internal/shell-sidebar.d.ts +2 -0
  31. package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
  32. package/dist/esm/components/_internal/shell-sidebar.js +1 -1
  33. package/dist/esm/components/_internal/shell-sidebar.js.map +3 -3
  34. package/dist/esm/components/shell.context.d.ts +13 -0
  35. package/dist/esm/components/shell.context.d.ts.map +1 -1
  36. package/dist/esm/components/shell.context.js +1 -1
  37. package/dist/esm/components/shell.context.js.map +3 -3
  38. package/dist/esm/components/shell.d.ts +14 -6
  39. package/dist/esm/components/shell.d.ts.map +1 -1
  40. package/dist/esm/components/shell.js +1 -1
  41. package/dist/esm/components/shell.js.map +3 -3
  42. package/package.json +1 -1
  43. package/schemas/base-button.json +1 -1
  44. package/schemas/button.json +1 -1
  45. package/schemas/icon-button.json +1 -1
  46. package/schemas/index.json +6 -6
  47. package/schemas/toggle-button.json +1 -1
  48. package/schemas/toggle-icon-button.json +1 -1
  49. package/src/components/_internal/shell-bottom.tsx +15 -1
  50. package/src/components/_internal/shell-inspector.tsx +15 -1
  51. package/src/components/_internal/shell-sidebar.tsx +15 -1
  52. package/src/components/segmented-control.css +37 -37
  53. package/src/components/shell.context.tsx +14 -0
  54. package/src/components/shell.css +51 -28
  55. package/src/components/shell.tsx +150 -81
  56. package/styles.css +72 -51
package/components.css CHANGED
@@ -13249,7 +13249,7 @@
13249
13249
  color: var(--gray-a8);
13250
13250
  background-color: var(--gray-3);
13251
13251
  }
13252
- .rt-SegmentedControlRoot.rt-r-orientation-vertical {
13252
+ .rt-SegmentedControlRoot:where(.rt-r-orientation-vertical) {
13253
13253
  grid-auto-flow: row;
13254
13254
  grid-auto-columns: unset;
13255
13255
  grid-auto-rows: 1fr;
@@ -13257,7 +13257,7 @@
13257
13257
  min-height: -moz-max-content;
13258
13258
  min-height: max-content;
13259
13259
  }
13260
- .rt-SegmentedControlRoot.rt-r-orientation-vertical:has([data-icon-only]) {
13260
+ .rt-SegmentedControlRoot:where(.rt-r-orientation-vertical):has([data-icon-only]) {
13261
13261
  grid-auto-columns: unset;
13262
13262
  grid-auto-rows: minmax(var(--segmented-control-height), 1fr);
13263
13263
  }
@@ -13281,15 +13281,15 @@
13281
13281
  outline: var(--focus-outline-width) solid var(--focus-8);
13282
13282
  outline-offset: var(--focus-outline-offset-inset);
13283
13283
  }
13284
- .rt-r-orientation-vertical .rt-SegmentedControlItem {
13284
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlItem {
13285
13285
  flex-direction: column;
13286
13286
  }
13287
- .rt-r-orientation-vertical .rt-SegmentedControlItem:first-child {
13287
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlItem:first-child {
13288
13288
  border-top-left-radius: inherit;
13289
13289
  border-top-right-radius: inherit;
13290
13290
  border-bottom-left-radius: 0;
13291
13291
  }
13292
- .rt-r-orientation-vertical .rt-SegmentedControlItem:nth-last-child(2) {
13292
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlItem:nth-last-child(2) {
13293
13293
  border-bottom-left-radius: inherit;
13294
13294
  border-bottom-right-radius: inherit;
13295
13295
  border-top-right-radius: 0;
@@ -13353,7 +13353,7 @@
13353
13353
  :where(.rt-SegmentedControlRoot:has(:focus-visible)) .rt-SegmentedControlItemSeparator {
13354
13354
  transition-duration: 0ms;
13355
13355
  }
13356
- .rt-r-orientation-vertical .rt-SegmentedControlItemSeparator {
13356
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlItemSeparator {
13357
13357
  margin-left: calc(var(--space-1) * 0.75);
13358
13358
  margin-right: calc(var(--space-1) * 0.75);
13359
13359
  margin-top: calc(-1 * var(--border-width-standard) * 0.5);
@@ -13449,68 +13449,68 @@
13449
13449
  :where(.rt-SegmentedControlItem[data-state='on']:nth-child(10)) ~ .rt-SegmentedControlIndicator {
13450
13450
  transform: translateX(900%);
13451
13451
  }
13452
- .rt-r-orientation-vertical .rt-SegmentedControlIndicator {
13452
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlIndicator {
13453
13453
  width: 100%;
13454
13454
  height: unset;
13455
13455
  }
13456
- .rt-r-orientation-vertical .rt-SegmentedControlIndicator:nth-child(2) {
13456
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlIndicator:nth-child(2) {
13457
13457
  height: calc(100% / 1);
13458
13458
  }
13459
- .rt-r-orientation-vertical .rt-SegmentedControlIndicator:nth-child(3) {
13459
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlIndicator:nth-child(3) {
13460
13460
  height: calc(100% / 2);
13461
13461
  }
13462
- .rt-r-orientation-vertical .rt-SegmentedControlIndicator:nth-child(4) {
13462
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlIndicator:nth-child(4) {
13463
13463
  height: calc(100% / 3);
13464
13464
  }
13465
- .rt-r-orientation-vertical .rt-SegmentedControlIndicator:nth-child(5) {
13465
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlIndicator:nth-child(5) {
13466
13466
  height: calc(100% / 4);
13467
13467
  }
13468
- .rt-r-orientation-vertical .rt-SegmentedControlIndicator:nth-child(6) {
13468
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlIndicator:nth-child(6) {
13469
13469
  height: calc(100% / 5);
13470
13470
  }
13471
- .rt-r-orientation-vertical .rt-SegmentedControlIndicator:nth-child(7) {
13471
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlIndicator:nth-child(7) {
13472
13472
  height: calc(100% / 6);
13473
13473
  }
13474
- .rt-r-orientation-vertical .rt-SegmentedControlIndicator:nth-child(8) {
13474
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlIndicator:nth-child(8) {
13475
13475
  height: calc(100% / 7);
13476
13476
  }
13477
- .rt-r-orientation-vertical .rt-SegmentedControlIndicator:nth-child(9) {
13477
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlIndicator:nth-child(9) {
13478
13478
  height: calc(100% / 8);
13479
13479
  }
13480
- .rt-r-orientation-vertical .rt-SegmentedControlIndicator:nth-child(10) {
13480
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlIndicator:nth-child(10) {
13481
13481
  height: calc(100% / 9);
13482
13482
  }
13483
- .rt-r-orientation-vertical .rt-SegmentedControlIndicator:nth-child(11) {
13483
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlIndicator:nth-child(11) {
13484
13484
  height: calc(100% / 10);
13485
13485
  }
13486
- .rt-r-orientation-vertical .rt-SegmentedControlItem[data-state='on']:nth-child(1) ~ .rt-SegmentedControlIndicator {
13486
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlItem[data-state='on']:nth-child(1) ~ .rt-SegmentedControlIndicator {
13487
13487
  transform: translateY(0%);
13488
13488
  }
13489
- .rt-r-orientation-vertical .rt-SegmentedControlItem[data-state='on']:nth-child(2) ~ .rt-SegmentedControlIndicator {
13489
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlItem[data-state='on']:nth-child(2) ~ .rt-SegmentedControlIndicator {
13490
13490
  transform: translateY(100%);
13491
13491
  }
13492
- .rt-r-orientation-vertical .rt-SegmentedControlItem[data-state='on']:nth-child(3) ~ .rt-SegmentedControlIndicator {
13492
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlItem[data-state='on']:nth-child(3) ~ .rt-SegmentedControlIndicator {
13493
13493
  transform: translateY(200%);
13494
13494
  }
13495
- .rt-r-orientation-vertical .rt-SegmentedControlItem[data-state='on']:nth-child(4) ~ .rt-SegmentedControlIndicator {
13495
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlItem[data-state='on']:nth-child(4) ~ .rt-SegmentedControlIndicator {
13496
13496
  transform: translateY(300%);
13497
13497
  }
13498
- .rt-r-orientation-vertical .rt-SegmentedControlItem[data-state='on']:nth-child(5) ~ .rt-SegmentedControlIndicator {
13498
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlItem[data-state='on']:nth-child(5) ~ .rt-SegmentedControlIndicator {
13499
13499
  transform: translateY(400%);
13500
13500
  }
13501
- .rt-r-orientation-vertical .rt-SegmentedControlItem[data-state='on']:nth-child(6) ~ .rt-SegmentedControlIndicator {
13501
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlItem[data-state='on']:nth-child(6) ~ .rt-SegmentedControlIndicator {
13502
13502
  transform: translateY(500%);
13503
13503
  }
13504
- .rt-r-orientation-vertical .rt-SegmentedControlItem[data-state='on']:nth-child(7) ~ .rt-SegmentedControlIndicator {
13504
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlItem[data-state='on']:nth-child(7) ~ .rt-SegmentedControlIndicator {
13505
13505
  transform: translateY(600%);
13506
13506
  }
13507
- .rt-r-orientation-vertical .rt-SegmentedControlItem[data-state='on']:nth-child(8) ~ .rt-SegmentedControlIndicator {
13507
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlItem[data-state='on']:nth-child(8) ~ .rt-SegmentedControlIndicator {
13508
13508
  transform: translateY(700%);
13509
13509
  }
13510
- .rt-r-orientation-vertical .rt-SegmentedControlItem[data-state='on']:nth-child(9) ~ .rt-SegmentedControlIndicator {
13510
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlItem[data-state='on']:nth-child(9) ~ .rt-SegmentedControlIndicator {
13511
13511
  transform: translateY(800%);
13512
13512
  }
13513
- .rt-r-orientation-vertical .rt-SegmentedControlItem[data-state='on']:nth-child(10) ~ .rt-SegmentedControlIndicator {
13513
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlItem[data-state='on']:nth-child(10) ~ .rt-SegmentedControlIndicator {
13514
13514
  transform: translateY(900%);
13515
13515
  }
13516
13516
  .rt-SegmentedControlItemLabel,
@@ -14119,39 +14119,39 @@
14119
14119
  padding-left: 0;
14120
14120
  padding-right: 0;
14121
14121
  }
14122
- .rt-r-orientation-vertical .rt-SegmentedControlItem[data-icon-only] {
14122
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlItem[data-icon-only] {
14123
14123
  min-width: unset;
14124
14124
  min-height: var(--segmented-control-height);
14125
14125
  }
14126
- .rt-r-orientation-vertical .rt-SegmentedControlItem[data-icon-only] .rt-SegmentedControlItemLabel {
14126
+ :where(.rt-r-orientation-vertical) .rt-SegmentedControlItem[data-icon-only] .rt-SegmentedControlItemLabel {
14127
14127
  padding-top: 0;
14128
14128
  padding-bottom: 0;
14129
14129
  }
14130
- .rt-SegmentedControlRoot.rt-r-orientation-vertical.rt-r-size-1:has([data-icon-only]) {
14130
+ .rt-SegmentedControlRoot:where(.rt-r-orientation-vertical):where(.rt-r-size-1):has([data-icon-only]) {
14131
14131
  width: var(--space-5);
14132
14132
  }
14133
- .rt-SegmentedControlRoot.rt-r-orientation-vertical.rt-r-size-2:has([data-icon-only]) {
14133
+ .rt-SegmentedControlRoot:where(.rt-r-orientation-vertical):where(.rt-r-size-2):has([data-icon-only]) {
14134
14134
  width: var(--space-6);
14135
14135
  }
14136
- .rt-SegmentedControlRoot.rt-r-orientation-vertical.rt-r-size-3:has([data-icon-only]) {
14136
+ .rt-SegmentedControlRoot:where(.rt-r-orientation-vertical):where(.rt-r-size-3):has([data-icon-only]) {
14137
14137
  width: var(--space-7);
14138
14138
  }
14139
- .rt-SegmentedControlRoot.rt-r-orientation-vertical.rt-r-size-4:has([data-icon-only]) {
14139
+ .rt-SegmentedControlRoot:where(.rt-r-orientation-vertical):where(.rt-r-size-4):has([data-icon-only]) {
14140
14140
  width: var(--space-8);
14141
14141
  }
14142
- .rt-r-orientation-vertical.rt-r-size-1 .rt-SegmentedControlItemLabel {
14142
+ :where(.rt-r-orientation-vertical):where(.rt-r-size-1) .rt-SegmentedControlItemLabel {
14143
14143
  padding-top: var(--space-1);
14144
14144
  padding-bottom: var(--space-1);
14145
14145
  }
14146
- .rt-r-orientation-vertical.rt-r-size-2 .rt-SegmentedControlItemLabel {
14146
+ :where(.rt-r-orientation-vertical):where(.rt-r-size-2) .rt-SegmentedControlItemLabel {
14147
14147
  padding-top: var(--space-2);
14148
14148
  padding-bottom: var(--space-2);
14149
14149
  }
14150
- .rt-r-orientation-vertical.rt-r-size-3 .rt-SegmentedControlItemLabel {
14150
+ :where(.rt-r-orientation-vertical):where(.rt-r-size-3) .rt-SegmentedControlItemLabel {
14151
14151
  padding-top: var(--space-2);
14152
14152
  padding-bottom: var(--space-2);
14153
14153
  }
14154
- .rt-r-orientation-vertical.rt-r-size-4 .rt-SegmentedControlItemLabel {
14154
+ :where(.rt-r-orientation-vertical):where(.rt-r-size-4) .rt-SegmentedControlItemLabel {
14155
14155
  padding-top: var(--space-3);
14156
14156
  padding-bottom: var(--space-3);
14157
14157
  }
@@ -17248,9 +17248,6 @@
17248
17248
  .rt-ShellRail[data-mode='collapsed'] {
17249
17249
  width: 0px;
17250
17250
  transition-delay: var(--motion-duration-small);
17251
- position: absolute;
17252
- inset-block: 0;
17253
- inset-inline-start: 0;
17254
17251
  }
17255
17252
  .rt-ShellRailContent {
17256
17253
  display: flex;
@@ -17259,13 +17256,17 @@
17259
17256
  height: 100%;
17260
17257
  gap: var(--space-2);
17261
17258
  opacity: 0;
17259
+ pointer-events: none;
17262
17260
  transition: opacity var(--motion-duration-small) var(--motion-ease-standard) var(--motion-duration-small);
17263
17261
  }
17264
17262
  .rt-ShellRailContent[data-visible] {
17265
17263
  opacity: 1;
17264
+ pointer-events: auto;
17266
17265
  }
17267
17266
  .rt-ShellRail[data-mode='collapsed'] .rt-ShellRailContent {
17268
17267
  opacity: 0;
17268
+ width: 0;
17269
+ visibility: hidden;
17269
17270
  transition: opacity var(--motion-duration-small) var(--motion-ease-standard);
17270
17271
  }
17271
17272
  .rt-ShellPanel {
@@ -17283,9 +17284,6 @@
17283
17284
  .rt-ShellPanel:not([data-visible]) {
17284
17285
  width: 0px;
17285
17286
  transition-delay: var(--motion-duration-small);
17286
- position: absolute;
17287
- inset-block: 0;
17288
- inset-inline-start: var(--peek-rail-width, var(--rail-size, 64px));
17289
17287
  }
17290
17288
  .rt-ShellPanelContent {
17291
17289
  display: flex;
@@ -17294,13 +17292,17 @@
17294
17292
  height: 100%;
17295
17293
  overflow: hidden;
17296
17294
  opacity: 0;
17295
+ pointer-events: none;
17297
17296
  transition: opacity var(--motion-duration-small) var(--motion-ease-standard) var(--motion-duration-small);
17298
17297
  }
17299
17298
  .rt-ShellPanelContent[data-visible] {
17300
17299
  opacity: 1;
17300
+ pointer-events: auto;
17301
17301
  }
17302
17302
  .rt-ShellPanel:not([data-visible]) .rt-ShellPanelContent {
17303
17303
  opacity: 0;
17304
+ width: 0;
17305
+ visibility: hidden;
17304
17306
  transition: opacity var(--motion-duration-small) var(--motion-ease-standard);
17305
17307
  }
17306
17308
  .rt-ShellSidebar {
@@ -17323,11 +17325,6 @@
17323
17325
  }
17324
17326
  .rt-ShellSidebar[data-mode='collapsed'] {
17325
17327
  width: 0px;
17326
- position: absolute;
17327
- inset-block: 0;
17328
- inset-inline-start: 0;
17329
- flex-shrink: 0;
17330
- flex-basis: 0;
17331
17328
  transition-delay: var(--motion-duration-small);
17332
17329
  }
17333
17330
  .rt-ShellSidebarContent {
@@ -17337,6 +17334,7 @@
17337
17334
  height: 100%;
17338
17335
  overflow: hidden;
17339
17336
  opacity: 0;
17337
+ pointer-events: none;
17340
17338
  transition: opacity var(--motion-duration-small) var(--motion-ease-standard) var(--motion-duration-small);
17341
17339
  }
17342
17340
  .rt-ShellSidebar[data-mode='thin'] .rt-ShellResizer {
@@ -17344,6 +17342,7 @@
17344
17342
  }
17345
17343
  .rt-ShellSidebarContent[data-visible] {
17346
17344
  opacity: 1;
17345
+ pointer-events: auto;
17347
17346
  }
17348
17347
  .rt-ShellSidebarContent[data-phase='hiding'] {
17349
17348
  opacity: 0;
@@ -17358,6 +17357,8 @@
17358
17357
  }
17359
17358
  .rt-ShellSidebar[data-mode='collapsed'] .rt-ShellSidebarContent {
17360
17359
  opacity: 0;
17360
+ width: 0;
17361
+ visibility: hidden;
17361
17362
  transition: opacity var(--motion-duration-small) var(--motion-ease-standard);
17362
17363
  }
17363
17364
  .rt-ShellSidebar[data-presentation='stacked'] {
@@ -17408,13 +17409,17 @@
17408
17409
  height: 100%;
17409
17410
  overflow: hidden;
17410
17411
  opacity: 0;
17412
+ pointer-events: none;
17411
17413
  transition: opacity var(--motion-duration-small) var(--motion-ease-standard) var(--motion-duration-small);
17412
17414
  }
17413
17415
  .rt-ShellInspectorContent[data-visible] {
17414
17416
  opacity: 1;
17417
+ pointer-events: auto;
17415
17418
  }
17416
17419
  .rt-ShellInspector[data-mode='collapsed'] .rt-ShellInspectorContent {
17417
17420
  opacity: 0;
17421
+ width: 0;
17422
+ visibility: hidden;
17418
17423
  transition: opacity var(--motion-duration-small) var(--motion-ease-standard);
17419
17424
  }
17420
17425
  .rt-ShellBottom {
@@ -17431,9 +17436,6 @@
17431
17436
  }
17432
17437
  .rt-ShellBottom[data-mode='collapsed'] {
17433
17438
  height: 0px;
17434
- position: absolute;
17435
- inset-inline: 0;
17436
- inset-block-end: 0;
17437
17439
  transition-delay: var(--motion-duration-small);
17438
17440
  }
17439
17441
  .rt-ShellBottomContent {
@@ -17443,10 +17445,12 @@
17443
17445
  height: var(--bottom-size, 200px);
17444
17446
  overflow: hidden;
17445
17447
  opacity: 0;
17448
+ pointer-events: none;
17446
17449
  transition: opacity var(--motion-duration-small) var(--motion-ease-standard) var(--motion-duration-small);
17447
17450
  }
17448
17451
  .rt-ShellBottomContent[data-visible] {
17449
17452
  opacity: 1;
17453
+ pointer-events: auto;
17450
17454
  }
17451
17455
  .rt-ShellPanel[data-resizing],
17452
17456
  .rt-ShellSidebar[data-resizing],
@@ -17468,6 +17472,8 @@
17468
17472
  }
17469
17473
  .rt-ShellBottom[data-mode='collapsed'] .rt-ShellBottomContent {
17470
17474
  opacity: 0;
17475
+ height: 0;
17476
+ visibility: hidden;
17471
17477
  transition: opacity var(--motion-duration-small) var(--motion-ease-standard);
17472
17478
  }
17473
17479
  [data-presentation='overlay'] {
@@ -17628,6 +17634,21 @@
17628
17634
  .rt-ShellBottom[data-peek][data-mode='collapsed'] {
17629
17635
  height: var(--bottom-size, 200px);
17630
17636
  }
17637
+ .rt-ShellBody[data-has-inset] {
17638
+ background: var(--gray-2);
17639
+ }
17640
+ .rt-ShellLeft[data-inset],
17641
+ .rt-ShellSidebar[data-inset],
17642
+ .rt-ShellContent[data-inset],
17643
+ .rt-ShellInspector[data-inset],
17644
+ .rt-ShellBottom[data-inset] {
17645
+ --shell-inset-gap: var(--space-2);
17646
+ margin: var(--shell-inset-gap);
17647
+ border-radius: var(--radius-3);
17648
+ background: var(--color-background);
17649
+ box-shadow: var(--shadow-2);
17650
+ height: auto;
17651
+ }
17631
17652
  .rt-SliderRoot {
17632
17653
  --slider-thumb-width: var(--space-3);
17633
17654
  --slider-thumb-height: var(--space-2);
@@ -29,6 +29,8 @@ type BottomPublicProps = PaneBaseProps & (BottomControlledProps | BottomUncontro
29
29
  onSizeChange?: (size: number, meta: BottomSizeChangeMeta) => void;
30
30
  sizeUpdate?: 'throttle' | 'debounce';
31
31
  sizeUpdateMs?: number;
32
+ /** When true, adds margin and triggers gray backdrop on Shell. */
33
+ inset?: boolean;
32
34
  };
33
35
  type BottomComponent = React.ForwardRefExoticComponent<BottomPublicProps & React.RefAttributes<HTMLDivElement>> & {
34
36
  Handle: typeof BottomHandle;
@@ -1 +1 @@
1
- {"version":3,"file":"shell-bottom.d.ts","sourceRoot":"","sources":["../../../../src/components/_internal/shell-bottom.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EAAE,YAAY,EAAc,MAAM,oBAAoB,CAAC;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAyD,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAI1H,KAAK,oBAAoB,GAAG;IAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,YAAY,CAAA;CAAE,CAAC;AACzE,KAAK,qBAAqB,GAAG;IAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;IAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,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MAAM,EAAE,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAClE,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEJ,KAAK,eAAe,GAAG,KAAK,CAAC,yBAAyB,CAAC,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,GAAG;IAAE,MAAM,EAAE,OAAO,YAAY,CAAA;CAAE,CAAC;AAiBlJ,eAAO,MAAM,MAAM,EAsWb,eAAe,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var Se=Object.create;var C=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var Ce=Object.getOwnPropertyNames;var ge=Object.getPrototypeOf,ve=Object.prototype.hasOwnProperty;var Ee=(s,i)=>{for(var l in i)C(s,l,{get:i[l],enumerable:!0})},te=(s,i,l,P)=>{if(i&&typeof i=="object"||typeof i=="function")for(let d of Ce(i))!ve.call(s,d)&&d!==l&&C(s,d,{get:()=>i[d],enumerable:!(P=xe(i,d))||P.enumerable});return s};var $=(s,i,l)=>(l=s!=null?Se(ge(s)):{},te(i||!s||!s.__esModule?C(l,"default",{value:s,enumerable:!0}):l,s)),Oe=s=>te(C({},"__esModule",{value:!0}),s);var Ne={};Ee(Ne,{Bottom:()=>A});module.exports=Oe(Ne);var t=$(require("react")),oe=$(require("classnames")),L=$(require("../sheet.js")),ne=require("../visually-hidden.js"),re=require("../shell.context.js"),g=require("../shell.hooks.js"),se=require("./shell-resize.js"),b=require("./shell-handles.js"),we=require("../shell.types.js"),z=require("./shell-prop-helpers.js"),ie=require("../../helpers/normalize-to-px.js");const Te=["className","children","defaultOpen","open","onOpenChange","size","defaultSize","onSizeChange","sizeUpdate","sizeUpdateMs","style"],A=t.forwardRef((s,i)=>{const{className:l,presentation:P="fixed",defaultOpen:d,open:u,onOpenChange:y,expandedSize:v=200,minSize:c=100,maxSize:m=400,resizable:E=!1,collapsible:ae=!0,onExpand:j,onCollapse:F,onResize:O,onResizeStart:le,onResizeEnd:de,snapPoints:ue,snapTolerance:pe,collapseThreshold:ce,paneId:T,persistence:N,children:me,style:fe,size:q,defaultSize:K,onSizeChange:k,sizeUpdate:w,sizeUpdateMs:D=50}=s,be=(0,z.extractPaneDomProps)(s,Te),o=(0,re.useShell)(),V=(0,g.useResponsivePresentation)(P),B=V==="overlay",ye=V==="stacked",p=t.useRef(null),he=t.useCallback(e=>{p.current=e,typeof i=="function"?i(e):i&&(i.current=e)},[i]),Y=t.Children.toArray(me),G=Y.filter(e=>t.isValidElement(e)&&e.type===b.BottomHandle),J=Y.filter(e=>!(t.isValidElement(e)&&e.type===b.BottomHandle)),ze=t.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(u),[u]),Pe=t.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(d),[d]),Be=typeof u=="object"&&u!==null;(0,g.useResponsiveInitialState)({controlledValue:ze,defaultValue:Pe,currentValue:o.bottomMode,setValue:o.setBottomMode,breakpointReady:o.currentBreakpointReady,controlledIsResponsive:Be,onResponsiveChange:e=>y?.(e==="expanded",{reason:"responsive"}),onInit:e=>{typeof u>"u"&&y?.(e==="expanded",{reason:"init"})}});const f=t.useRef(null);t.useEffect(()=>()=>{f.current&&(clearTimeout(f.current),f.current=null)},[k,w,D]);const M=t.useMemo(()=>{const e=k,r=w,a=D??50;if(!e)return()=>{};if(r==="debounce")return(n,h)=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{e(n,h),f.current=null},a)};if(r==="throttle"){let n=0;return(h,Re)=>{const ee=Date.now();ee-n>=a&&(n=ee,e(h,Re))}}return(n,h)=>e(n,h)},[k,w,D]),R=t.useRef(null);t.useEffect(()=>{const e=typeof u<"u";if(R.current===null){R.current=e;return}R.current!==e&&(console.warn("Shell.Bottom: Switching between controlled and uncontrolled `open` is not supported."),R.current=e)},[u]);const Q=t.useRef(!1),H=t.useRef(null);t.useEffect(()=>{!Q.current&&typeof u>"u"&&d&&o.bottomMode==="expanded"&&(y?.(!0,{reason:"init"}),Q.current=!0),typeof u>"u"&&(H.current!==null&&H.current!==o.bottomMode&&y?.(o.bottomMode==="expanded",{reason:"toggle"}),H.current=o.bottomMode)},[o.bottomMode,u,d,y]);const W=t.useRef(j),X=t.useRef(F);t.useLayoutEffect(()=>{W.current=j,X.current=F});const S=t.useRef(null),Z=t.useRef(!1);t.useEffect(()=>{const e=o.bottomMode;if(!o.currentBreakpointReady){S.current=e;return}if(!Z.current){Z.current=!0,S.current=e;return}const r=S.current;r!==null&&r!==e&&(e==="expanded"?W.current?.():e==="collapsed"&&X.current?.(),S.current=e)},[o.bottomMode,o.currentBreakpointReady]);const U=o.bottomMode==="expanded",x=t.useMemo(()=>{if(!T||N)return N;const e=`kookie-ui:shell:bottom:${T}`;return{load:()=>{if(!(typeof window>"u"))try{const a=window.localStorage.getItem(e);return a?Number(a):void 0}catch{return}},save:a=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(a))}catch{}}}},[T,N]);t.useEffect(()=>{let e=!0;if(!E||!x?.load||B)return;const r=x.load(),a=n=>{!e||typeof n!="number"||!p.current||(p.current.style.setProperty("--bottom-size",`${n}px`),O?.(n))};return r instanceof Promise?r.then(a).catch(n=>{}):a(r),()=>{e=!1}},[E,x,O,B]);const Me=E&&!B&&U?t.createElement(se.PaneResizeContext.Provider,{value:{containerRef:p,cssVarName:"--bottom-size",minSize:c,maxSize:m,defaultSize:v,orientation:"horizontal",edge:"start",computeNext:(e,r,a)=>{const n=e-r;return a-n},onResize:O,onResizeStart:le,onResizeEnd:e=>{de?.(e),M(e,{reason:"resize"}),x?.save?.(e)},target:"bottom",collapsible:ae,snapPoints:ue,snapTolerance:pe??8,collapseThreshold:ce,requestCollapse:()=>o.setBottomMode("collapsed"),requestToggle:()=>o.togglePane("bottom")}},G.length>0?G.map((e,r)=>t.cloneElement(e,{key:e.key??r})):t.createElement(b.PaneHandle,null)):null,I=t.useCallback(e=>(0,ie.normalizeToPx)(e,"vertical"),[]);t.useEffect(()=>{if(p.current&&typeof q>"u"&&typeof K<"u"){const e=I(K);if(typeof e=="number"&&Number.isFinite(e)){const n=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof c=="number"?c:void 0)??e,e));p.current.style.setProperty("--bottom-size",`${n}px`),M(n,{reason:"init"})}}},[]);const _=q;if(t.useEffect(()=>{if(!p.current||typeof _>"u")return;const e=I(_);if(typeof e=="number"&&Number.isFinite(e)){const n=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof c=="number"?c:void 0)??e,e));p.current.style.setProperty("--bottom-size",`${n}px`),M(n,{reason:"controlled"})}},[_,c,m,I,M]),B){const e=o.bottomMode==="expanded";return t.createElement(L.Root,{open:e,onOpenChange:r=>o.setBottomMode(r?"expanded":"collapsed")},t.createElement(L.Content,{side:"bottom",style:{padding:0},height:{initial:`${v}px`}},t.createElement(ne.VisuallyHidden,null,t.createElement(L.Title,null,"Bottom panel")),J))}return t.createElement("div",{...be,ref:he,className:(0,oe.default)("rt-ShellBottom",l),"data-mode":o.bottomMode,"data-peek":o.peekTarget==="bottom"||void 0,"data-presentation":o.currentBreakpointReady?V:void 0,"data-open":o.currentBreakpointReady&&ye&&U||void 0,style:{...fe,"--bottom-size":`${v}px`,"--bottom-min-size":`${c}px`,"--bottom-max-size":`${m}px`}},t.createElement("div",{className:"rt-ShellBottomContent","data-visible":U||void 0},J),Me)});A.displayName="Shell.Bottom",A.Handle=b.BottomHandle;
1
+ "use strict";var Ce=Object.create;var g=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var Ee=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var Ne=(s,i)=>{for(var l in i)g(s,l,{get:i[l],enumerable:!0})},se=(s,i,l,P)=>{if(i&&typeof i=="object"||typeof i=="function")for(let d of Ee(i))!Te.call(s,d)&&d!==l&&g(s,d,{get:()=>i[d],enumerable:!(P=ve(i,d))||P.enumerable});return s};var A=(s,i,l)=>(l=s!=null?Ce(Oe(s)):{},se(i||!s||!s.__esModule?g(l,"default",{value:s,enumerable:!0}):l,s)),ke=s=>se(g({},"__esModule",{value:!0}),s);var De={};Ne(De,{Bottom:()=>F});module.exports=ke(De);var t=A(require("react")),ie=A(require("classnames")),j=A(require("../sheet.js")),ae=require("../visually-hidden.js"),C=require("../shell.context.js"),v=require("../shell.hooks.js"),le=require("./shell-resize.js"),b=require("./shell-handles.js"),He=require("../shell.types.js"),z=require("./shell-prop-helpers.js"),de=require("../../helpers/normalize-to-px.js");const we=["className","children","defaultOpen","open","onOpenChange","size","defaultSize","onSizeChange","sizeUpdate","sizeUpdateMs","style","inset"],F=t.forwardRef((s,i)=>{const{className:l,presentation:P="fixed",defaultOpen:d,open:u,onOpenChange:y,expandedSize:E=200,minSize:c=100,maxSize:m=400,resizable:O=!1,collapsible:ue=!0,onExpand:q,onCollapse:K,onResize:T,onResizeStart:pe,onResizeEnd:ce,snapPoints:me,snapTolerance:fe,collapseThreshold:be,paneId:N,persistence:k,children:ye,style:he,size:Y,defaultSize:G,onSizeChange:w,sizeUpdate:D,sizeUpdateMs:V=50,inset:H}=s,ze=(0,z.extractPaneDomProps)(s,we),o=(0,C.useShell)(),{registerInset:J,unregisterInset:Q}=(0,C.useInset)();t.useEffect(()=>{if(H)return J("bottom"),()=>Q("bottom")},[H,J,Q]);const I=(0,v.useResponsivePresentation)(P),B=I==="overlay",Pe=I==="stacked",p=t.useRef(null),Be=t.useCallback(e=>{p.current=e,typeof i=="function"?i(e):i&&(i.current=e)},[i]),W=t.Children.toArray(ye),X=W.filter(e=>t.isValidElement(e)&&e.type===b.BottomHandle),Z=W.filter(e=>!(t.isValidElement(e)&&e.type===b.BottomHandle)),Me=t.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(u),[u]),Re=t.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(d),[d]),Se=typeof u=="object"&&u!==null;(0,v.useResponsiveInitialState)({controlledValue:Me,defaultValue:Re,currentValue:o.bottomMode,setValue:o.setBottomMode,breakpointReady:o.currentBreakpointReady,controlledIsResponsive:Se,onResponsiveChange:e=>y?.(e==="expanded",{reason:"responsive"}),onInit:e=>{typeof u>"u"&&y?.(e==="expanded",{reason:"init"})}});const f=t.useRef(null);t.useEffect(()=>()=>{f.current&&(clearTimeout(f.current),f.current=null)},[w,D,V]);const M=t.useMemo(()=>{const e=w,r=D,a=V??50;if(!e)return()=>{};if(r==="debounce")return(n,h)=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{e(n,h),f.current=null},a)};if(r==="throttle"){let n=0;return(h,ge)=>{const re=Date.now();re-n>=a&&(n=re,e(h,ge))}}return(n,h)=>e(n,h)},[w,D,V]),R=t.useRef(null);t.useEffect(()=>{const e=typeof u<"u";if(R.current===null){R.current=e;return}R.current!==e&&(console.warn("Shell.Bottom: Switching between controlled and uncontrolled `open` is not supported."),R.current=e)},[u]);const ee=t.useRef(!1),U=t.useRef(null);t.useEffect(()=>{!ee.current&&typeof u>"u"&&d&&o.bottomMode==="expanded"&&(y?.(!0,{reason:"init"}),ee.current=!0),typeof u>"u"&&(U.current!==null&&U.current!==o.bottomMode&&y?.(o.bottomMode==="expanded",{reason:"toggle"}),U.current=o.bottomMode)},[o.bottomMode,u,d,y]);const te=t.useRef(q),oe=t.useRef(K);t.useLayoutEffect(()=>{te.current=q,oe.current=K});const S=t.useRef(null),ne=t.useRef(!1);t.useEffect(()=>{const e=o.bottomMode;if(!o.currentBreakpointReady){S.current=e;return}if(!ne.current){ne.current=!0,S.current=e;return}const r=S.current;r!==null&&r!==e&&(e==="expanded"?te.current?.():e==="collapsed"&&oe.current?.(),S.current=e)},[o.bottomMode,o.currentBreakpointReady]);const _=o.bottomMode==="expanded",x=t.useMemo(()=>{if(!N||k)return k;const e=`kookie-ui:shell:bottom:${N}`;return{load:()=>{if(!(typeof window>"u"))try{const a=window.localStorage.getItem(e);return a?Number(a):void 0}catch{return}},save:a=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(a))}catch{}}}},[N,k]);t.useEffect(()=>{let e=!0;if(!O||!x?.load||B)return;const r=x.load(),a=n=>{!e||typeof n!="number"||!p.current||(p.current.style.setProperty("--bottom-size",`${n}px`),T?.(n))};return r instanceof Promise?r.then(a).catch(n=>{}):a(r),()=>{e=!1}},[O,x,T,B]);const xe=O&&!B&&_?t.createElement(le.PaneResizeContext.Provider,{value:{containerRef:p,cssVarName:"--bottom-size",minSize:c,maxSize:m,defaultSize:E,orientation:"horizontal",edge:"start",computeNext:(e,r,a)=>{const n=e-r;return a-n},onResize:T,onResizeStart:pe,onResizeEnd:e=>{ce?.(e),M(e,{reason:"resize"}),x?.save?.(e)},target:"bottom",collapsible:ue,snapPoints:me,snapTolerance:fe??8,collapseThreshold:be,requestCollapse:()=>o.setBottomMode("collapsed"),requestToggle:()=>o.togglePane("bottom")}},X.length>0?X.map((e,r)=>t.cloneElement(e,{key:e.key??r})):t.createElement(b.PaneHandle,null)):null,$=t.useCallback(e=>(0,de.normalizeToPx)(e,"vertical"),[]);t.useEffect(()=>{if(p.current&&typeof Y>"u"&&typeof G<"u"){const e=$(G);if(typeof e=="number"&&Number.isFinite(e)){const n=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof c=="number"?c:void 0)??e,e));p.current.style.setProperty("--bottom-size",`${n}px`),M(n,{reason:"init"})}}},[]);const L=Y;if(t.useEffect(()=>{if(!p.current||typeof L>"u")return;const e=$(L);if(typeof e=="number"&&Number.isFinite(e)){const n=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof c=="number"?c:void 0)??e,e));p.current.style.setProperty("--bottom-size",`${n}px`),M(n,{reason:"controlled"})}},[L,c,m,$,M]),B){const e=o.bottomMode==="expanded";return t.createElement(j.Root,{open:e,onOpenChange:r=>o.setBottomMode(r?"expanded":"collapsed")},t.createElement(j.Content,{side:"bottom",style:{padding:0},height:{initial:`${E}px`}},t.createElement(ae.VisuallyHidden,null,t.createElement(j.Title,null,"Bottom panel")),Z))}return t.createElement("div",{...ze,ref:Be,className:(0,ie.default)("rt-ShellBottom",l),"data-mode":o.bottomMode,"data-peek":o.peekTarget==="bottom"||void 0,"data-presentation":o.currentBreakpointReady?I:void 0,"data-open":o.currentBreakpointReady&&Pe&&_||void 0,"data-inset":H||void 0,style:{...he,"--bottom-size":`${E}px`,"--bottom-min-size":`${c}px`,"--bottom-max-size":`${m}px`}},t.createElement("div",{className:"rt-ShellBottomContent","data-visible":_||void 0},Z),xe)});F.displayName="Shell.Bottom",F.Handle=b.BottomHandle;
2
2
  //# sourceMappingURL=shell-bottom.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/_internal/shell-bottom.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport * as Sheet from '../sheet.js';\nimport { VisuallyHidden } from '../visually-hidden.js';\nimport { useShell } from '../shell.context.js';\nimport { useResponsivePresentation, useResponsiveInitialState } from '../shell.hooks.js';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { BottomHandle, PaneHandle } from './shell-handles.js';\nimport { _BREAKPOINTS } from '../shell.types.js';\nimport type { Breakpoint, PaneMode, PaneSizePersistence, ResponsivePresentation, PaneBaseProps } from '../shell.types.js';\nimport { extractPaneDomProps, mapResponsiveBooleanToPaneMode } from './shell-prop-helpers.js';\nimport { normalizeToPx } from '../../helpers/normalize-to-px.js';\n\ntype BottomOpenChangeMeta = { reason: 'init' | 'toggle' | 'responsive' };\ntype BottomControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: BottomOpenChangeMeta) => void; defaultOpen?: never };\ntype BottomUncontrolledProps = { defaultOpen?: boolean; onOpenChange?: (open: boolean, meta: BottomOpenChangeMeta) => void; open?: never };\ntype BottomSizeControlledProps = { size: number | string; defaultSize?: never };\ntype BottomSizeUncontrolledProps = { defaultSize?: number | string; size?: never };\ntype BottomSizeChangeMeta = { reason: 'init' | 'resize' | 'controlled' };\ntype BottomPublicProps = PaneBaseProps &\n (BottomControlledProps | BottomUncontrolledProps) &\n (BottomSizeControlledProps | BottomSizeUncontrolledProps) & {\n onSizeChange?: (size: number, meta: BottomSizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n };\n\ntype BottomComponent = React.ForwardRefExoticComponent<BottomPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof BottomHandle };\n\nconst BOTTOM_DOM_PROP_KEYS = [\n 'className',\n 'children',\n 'defaultOpen',\n 'open',\n 'onOpenChange',\n 'size',\n 'defaultSize',\n 'onSizeChange',\n 'sizeUpdate',\n 'sizeUpdateMs',\n 'style',\n] as const satisfies readonly (keyof BottomPublicProps)[];\n\nexport const Bottom = React.forwardRef<HTMLDivElement, BottomPublicProps>((initialProps, ref) => {\n const {\n className,\n presentation = 'fixed',\n defaultOpen,\n open,\n onOpenChange,\n expandedSize = 200,\n minSize = 100,\n maxSize = 400,\n resizable = false,\n collapsible = true,\n onExpand,\n onCollapse,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n children,\n style,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n } = initialProps;\n const bottomDomProps = extractPaneDomProps(initialProps, BOTTOM_DOM_PROP_KEYS);\n const shell = useShell();\n const resolvedPresentation = useResponsivePresentation(presentation);\n const isOverlay = resolvedPresentation === 'overlay';\n const isStacked = resolvedPresentation === 'stacked';\n const localRef = React.useRef<HTMLDivElement | null>(null);\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n localRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [ref],\n );\n const childArray = React.Children.toArray(children) as React.ReactElement[];\n const handleChildren = childArray.filter((el: React.ReactElement) => React.isValidElement(el) && el.type === BottomHandle);\n const contentChildren = childArray.filter((el: React.ReactElement) => !(React.isValidElement(el) && el.type === BottomHandle));\n\n // Throttled/debounced emitter for onSizeChange\n const normalizedControlledOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(open), [open]);\n const normalizedDefaultOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(defaultOpen), [defaultOpen]);\n const openIsResponsive = typeof open === 'object' && open !== null;\n useResponsiveInitialState<PaneMode>({\n controlledValue: normalizedControlledOpen,\n defaultValue: normalizedDefaultOpen,\n currentValue: shell.bottomMode,\n setValue: shell.setBottomMode,\n breakpointReady: shell.currentBreakpointReady,\n controlledIsResponsive: openIsResponsive,\n onResponsiveChange: (next) => onOpenChange?.(next === 'expanded', { reason: 'responsive' }),\n onInit: (initial) => {\n if (typeof open === 'undefined') {\n onOpenChange?.(initial === 'expanded', { reason: 'init' });\n }\n },\n });\n\n // Ref for debounce cleanup\n const debounceTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n // Cleanup debounce timeout on unmount or when dependencies change\n React.useEffect(() => {\n return () => {\n if (debounceTimeoutRef.current) {\n clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = null;\n }\n };\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n // Throttled/debounced emitter for onSizeChange\n const emitSizeChange = React.useMemo(() => {\n const cb = onSizeChange as undefined | ((s: number, meta: BottomSizeChangeMeta) => void);\n const strategy = sizeUpdate as undefined | 'throttle' | 'debounce';\n const ms = sizeUpdateMs ?? 50;\n if (!cb) return () => {};\n if (strategy === 'debounce') {\n return (s: number, meta: BottomSizeChangeMeta) => {\n if (debounceTimeoutRef.current) clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = setTimeout(() => {\n cb(s, meta);\n debounceTimeoutRef.current = null;\n }, ms);\n };\n }\n if (strategy === 'throttle') {\n let last = 0;\n return (s: number, meta: BottomSizeChangeMeta) => {\n const now = Date.now();\n if (now - last >= ms) {\n last = now;\n cb(s, meta);\n }\n };\n }\n return (s: number, meta: BottomSizeChangeMeta) => cb(s, meta);\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n\n // Dev guards\n const wasControlledRef = React.useRef<boolean | null>(null);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof open !== 'undefined' && typeof defaultOpen !== 'undefined') {\n console.error('Shell.Bottom: Do not pass both `open` and `defaultOpen`. Choose one.');\n }\n if (typeof size !== 'undefined' && typeof defaultSize !== 'undefined') {\n console.error('Shell.Bottom: Do not pass both `size` and `defaultSize`. Choose one.');\n }\n }\n\n React.useEffect(() => {\n const isControlled = typeof open !== 'undefined';\n if (wasControlledRef.current === null) {\n wasControlledRef.current = isControlled;\n return;\n }\n if (wasControlledRef.current !== isControlled) {\n console.warn('Shell.Bottom: Switching between controlled and uncontrolled `open` is not supported.');\n wasControlledRef.current = isControlled;\n }\n }, [open]);\n\n const initNotifiedRef = React.useRef(false);\n const lastBottomModeRef = React.useRef<PaneMode | null>(null);\n React.useEffect(() => {\n if (!initNotifiedRef.current && typeof open === 'undefined' && defaultOpen && shell.bottomMode === 'expanded') {\n onOpenChange?.(true, { reason: 'init' });\n initNotifiedRef.current = true;\n }\n if (typeof open === 'undefined') {\n if (lastBottomModeRef.current !== null && lastBottomModeRef.current !== shell.bottomMode) {\n onOpenChange?.(shell.bottomMode === 'expanded', { reason: 'toggle' });\n }\n lastBottomModeRef.current = shell.bottomMode;\n }\n }, [shell.bottomMode, open, defaultOpen, onOpenChange]);\n\n // Track previous mode to only fire callbacks on actual user-initiated state transitions.\n // We wait for breakpointReady to ensure the initial state sync from useResponsiveInitialState\n // is complete before enabling callbacks. This avoids spurious callbacks during initialization.\n // Use callback refs to avoid re-running effect when inline callbacks change.\n const onExpandRef = React.useRef(onExpand);\n const onCollapseRef = React.useRef(onCollapse);\n React.useLayoutEffect(() => {\n onExpandRef.current = onExpand;\n onCollapseRef.current = onCollapse;\n });\n\n const prevBottomModeRef = React.useRef<PaneMode | null>(null);\n const hasInitializedRef = React.useRef(false);\n React.useEffect(() => {\n const currentMode = shell.bottomMode;\n\n // Wait for breakpoint to be ready before enabling callbacks\n if (!shell.currentBreakpointReady) {\n prevBottomModeRef.current = currentMode;\n return;\n }\n\n // Skip the first run after breakpoint is ready - this captures the post-sync state\n if (!hasInitializedRef.current) {\n hasInitializedRef.current = true;\n prevBottomModeRef.current = currentMode;\n return;\n }\n\n const prevMode = prevBottomModeRef.current;\n\n // Only fire on actual state transitions\n if (prevMode !== null && prevMode !== currentMode) {\n if (currentMode === 'expanded') {\n onExpandRef.current?.();\n } else if (currentMode === 'collapsed') {\n onCollapseRef.current?.();\n }\n prevBottomModeRef.current = currentMode;\n }\n }, [shell.bottomMode, shell.currentBreakpointReady]);\n\n const isExpanded = shell.bottomMode === 'expanded';\n\n const persistenceAdapter = React.useMemo(() => {\n if (!paneId || persistence) return persistence;\n const key = `kookie-ui:shell:bottom:${paneId}`;\n const adapter: PaneSizePersistence = {\n load: () => {\n if (typeof window === 'undefined') return undefined;\n try {\n const v = window.localStorage.getItem(key);\n return v ? Number(v) : undefined;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Bottom: failed to load persisted size', err);\n }\n return undefined;\n }\n },\n save: (size: number) => {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, String(size));\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Bottom: failed to save persisted size', err);\n }\n }\n },\n };\n return adapter;\n }, [paneId, persistence]);\n\n React.useEffect(() => {\n let mounted = true;\n if (!resizable || !persistenceAdapter?.load || isOverlay) return undefined;\n const loaded = persistenceAdapter.load();\n const applyLoaded = (value?: number) => {\n if (!mounted || typeof value !== 'number' || !localRef.current) return;\n localRef.current.style.setProperty('--bottom-size', `${value}px`);\n onResize?.(value);\n };\n if (loaded instanceof Promise) {\n loaded.then(applyLoaded).catch((err) => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Bottom: failed to load persisted size', err);\n }\n });\n } else {\n applyLoaded(loaded);\n }\n return () => {\n mounted = false;\n };\n }, [resizable, persistenceAdapter, onResize, isOverlay]);\n\n const handleEl =\n resizable && !isOverlay && isExpanded ? (\n <PaneResizeContext.Provider\n value={{\n containerRef: localRef,\n cssVarName: '--bottom-size',\n minSize,\n maxSize,\n defaultSize: expandedSize,\n orientation: 'horizontal',\n edge: 'start',\n computeNext: (client, startClient, startSize) => {\n const delta = client - startClient;\n return startSize - delta;\n },\n onResize,\n onResizeStart,\n onResizeEnd: (size) => {\n onResizeEnd?.(size);\n emitSizeChange(size, { reason: 'resize' });\n persistenceAdapter?.save?.(size);\n },\n target: 'bottom',\n collapsible,\n snapPoints,\n snapTolerance: snapTolerance ?? 8,\n collapseThreshold,\n requestCollapse: () => shell.setBottomMode('collapsed'),\n requestToggle: () => shell.togglePane('bottom'),\n }}\n >\n {handleChildren.length > 0 ? handleChildren.map((el, i) => React.cloneElement(el, { key: el.key ?? i })) : <PaneHandle />}\n </PaneResizeContext.Provider>\n ) : null;\n\n // Strip control/size props from DOM spread (moved above overlay return to keep hook order consistent)\n // Normalize CSS lengths to px helper\n const normalizeSizeToPx = React.useCallback((value: number | string | undefined) => normalizeToPx(value, 'vertical'), []);\n\n // Apply defaultSize on mount when uncontrolled (moved above overlay return)\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof size === 'undefined' && typeof defaultSize !== 'undefined') {\n const px = normalizeSizeToPx(defaultSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--bottom-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'init' });\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Controlled size sync (moved above overlay return)\n const controlledSize = size;\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof controlledSize === 'undefined') return;\n const px = normalizeSizeToPx(controlledSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--bottom-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'controlled' });\n }\n }, [controlledSize, minSize, maxSize, normalizeSizeToPx, emitSizeChange]);\n\n if (isOverlay) {\n const open = shell.bottomMode === 'expanded';\n return (\n <Sheet.Root open={open} onOpenChange={(o) => shell.setBottomMode(o ? 'expanded' : 'collapsed')}>\n <Sheet.Content side=\"bottom\" style={{ padding: 0 }} height={{ initial: `${expandedSize}px` }}>\n <VisuallyHidden>\n <Sheet.Title>Bottom panel</Sheet.Title>\n </VisuallyHidden>\n {contentChildren}\n </Sheet.Content>\n </Sheet.Root>\n );\n }\n\n return (\n <div\n {...bottomDomProps}\n ref={setRef}\n className={classNames('rt-ShellBottom', className)}\n data-mode={shell.bottomMode}\n data-peek={shell.peekTarget === 'bottom' || undefined}\n data-presentation={shell.currentBreakpointReady ? resolvedPresentation : undefined}\n data-open={(shell.currentBreakpointReady && isStacked && isExpanded) || undefined}\n style={{\n ...style,\n ['--bottom-size' as any]: `${expandedSize}px`,\n ['--bottom-min-size' as any]: `${minSize}px`,\n ['--bottom-max-size' as any]: `${maxSize}px`,\n }}\n >\n <div className=\"rt-ShellBottomContent\" data-visible={isExpanded || undefined}>\n {contentChildren}\n </div>\n {handleEl}\n </div>\n );\n}) as BottomComponent;\nBottom.displayName = 'Shell.Bottom';\nBottom.Handle = BottomHandle;\n"],
5
- "mappings": "ykBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,YAAAE,IAAA,eAAAC,GAAAH,IAAA,IAAAI,EAAuB,oBACvBC,GAAuB,yBACvBC,EAAuB,0BACvBC,GAA+B,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6B,GAAGC,CAAO,IAC1C,GAEArB,EAAA,cAAC,OAAI,UAAU,wBAAwB,eAAc6E,GAAc,QAChEzB,CACH,EACCkC,EACH,CAEJ,CAAC,EACDxF,EAAO,YAAc,eACrBA,EAAO,OAAS",
6
- "names": ["shell_bottom_exports", "__export", "Bottom", "__toCommonJS", "React", "import_classnames", "Sheet", "import_visually_hidden", "import_shell_context", "import_shell_hooks", "import_shell_resize", "import_shell_handles", "import_shell_types", "import_shell_prop_helpers", "import_normalize_to_px", "BOTTOM_DOM_PROP_KEYS", "initialProps", "ref", "className", "presentation", "defaultOpen", "open", "onOpenChange", "expandedSize", "minSize", "maxSize", "resizable", "collapsible", "onExpand", "onCollapse", "onResize", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "paneId", "persistence", "children", "style", "size", "defaultSize", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "bottomDomProps", "shell", "resolvedPresentation", "isOverlay", "isStacked", "localRef", "setRef", "node", "childArray", "handleChildren", "el", "contentChildren", "normalizedControlledOpen", "normalizedDefaultOpen", "openIsResponsive", "next", "initial", "debounceTimeoutRef", "emitSizeChange", "cb", "strategy", "ms", "s", "meta", "last", "now", "wasControlledRef", "isControlled", "initNotifiedRef", "lastBottomModeRef", "onExpandRef", "onCollapseRef", "prevBottomModeRef", "hasInitializedRef", "currentMode", "prevMode", "isExpanded", "persistenceAdapter", "key", "v", "mounted", "loaded", "applyLoaded", "value", "err", "handleEl", "client", "startClient", "startSize", "delta", "i", "normalizeSizeToPx", "px", "clamped", "controlledSize", "o", "classNames"]
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport * as Sheet from '../sheet.js';\nimport { VisuallyHidden } from '../visually-hidden.js';\nimport { useShell, useInset } from '../shell.context.js';\nimport { useResponsivePresentation, useResponsiveInitialState } from '../shell.hooks.js';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { BottomHandle, PaneHandle } from './shell-handles.js';\nimport { _BREAKPOINTS } from '../shell.types.js';\nimport type { Breakpoint, PaneMode, PaneSizePersistence, ResponsivePresentation, PaneBaseProps } from '../shell.types.js';\nimport { extractPaneDomProps, mapResponsiveBooleanToPaneMode } from './shell-prop-helpers.js';\nimport { normalizeToPx } from '../../helpers/normalize-to-px.js';\n\ntype BottomOpenChangeMeta = { reason: 'init' | 'toggle' | 'responsive' };\ntype BottomControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: BottomOpenChangeMeta) => void; defaultOpen?: never };\ntype BottomUncontrolledProps = { defaultOpen?: boolean; onOpenChange?: (open: boolean, meta: BottomOpenChangeMeta) => void; open?: never };\ntype BottomSizeControlledProps = { size: number | string; defaultSize?: never };\ntype BottomSizeUncontrolledProps = { defaultSize?: number | string; size?: never };\ntype BottomSizeChangeMeta = { reason: 'init' | 'resize' | 'controlled' };\ntype BottomPublicProps = PaneBaseProps &\n (BottomControlledProps | BottomUncontrolledProps) &\n (BottomSizeControlledProps | BottomSizeUncontrolledProps) & {\n onSizeChange?: (size: number, meta: BottomSizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /** When true, adds margin and triggers gray backdrop on Shell. */\n inset?: boolean;\n };\n\ntype BottomComponent = React.ForwardRefExoticComponent<BottomPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof BottomHandle };\n\nconst BOTTOM_DOM_PROP_KEYS = [\n 'className',\n 'children',\n 'defaultOpen',\n 'open',\n 'onOpenChange',\n 'size',\n 'defaultSize',\n 'onSizeChange',\n 'sizeUpdate',\n 'sizeUpdateMs',\n 'style',\n 'inset',\n] as const satisfies readonly (keyof BottomPublicProps)[];\n\nexport const Bottom = React.forwardRef<HTMLDivElement, BottomPublicProps>((initialProps, ref) => {\n const {\n className,\n presentation = 'fixed',\n defaultOpen,\n open,\n onOpenChange,\n expandedSize = 200,\n minSize = 100,\n maxSize = 400,\n resizable = false,\n collapsible = true,\n onExpand,\n onCollapse,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n children,\n style,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n inset,\n } = initialProps;\n const bottomDomProps = extractPaneDomProps(initialProps, BOTTOM_DOM_PROP_KEYS);\n const shell = useShell();\n const { registerInset, unregisterInset } = useInset();\n\n // Register/unregister inset\n React.useEffect(() => {\n if (inset) {\n registerInset('bottom');\n return () => unregisterInset('bottom');\n }\n }, [inset, registerInset, unregisterInset]);\n const resolvedPresentation = useResponsivePresentation(presentation);\n const isOverlay = resolvedPresentation === 'overlay';\n const isStacked = resolvedPresentation === 'stacked';\n const localRef = React.useRef<HTMLDivElement | null>(null);\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n localRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [ref],\n );\n const childArray = React.Children.toArray(children) as React.ReactElement[];\n const handleChildren = childArray.filter((el: React.ReactElement) => React.isValidElement(el) && el.type === BottomHandle);\n const contentChildren = childArray.filter((el: React.ReactElement) => !(React.isValidElement(el) && el.type === BottomHandle));\n\n // Throttled/debounced emitter for onSizeChange\n const normalizedControlledOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(open), [open]);\n const normalizedDefaultOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(defaultOpen), [defaultOpen]);\n const openIsResponsive = typeof open === 'object' && open !== null;\n useResponsiveInitialState<PaneMode>({\n controlledValue: normalizedControlledOpen,\n defaultValue: normalizedDefaultOpen,\n currentValue: shell.bottomMode,\n setValue: shell.setBottomMode,\n breakpointReady: shell.currentBreakpointReady,\n controlledIsResponsive: openIsResponsive,\n onResponsiveChange: (next) => onOpenChange?.(next === 'expanded', { reason: 'responsive' }),\n onInit: (initial) => {\n if (typeof open === 'undefined') {\n onOpenChange?.(initial === 'expanded', { reason: 'init' });\n }\n },\n });\n\n // Ref for debounce cleanup\n const debounceTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n // Cleanup debounce timeout on unmount or when dependencies change\n React.useEffect(() => {\n return () => {\n if (debounceTimeoutRef.current) {\n clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = null;\n }\n };\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n // Throttled/debounced emitter for onSizeChange\n const emitSizeChange = React.useMemo(() => {\n const cb = onSizeChange as undefined | ((s: number, meta: BottomSizeChangeMeta) => void);\n const strategy = sizeUpdate as undefined | 'throttle' | 'debounce';\n const ms = sizeUpdateMs ?? 50;\n if (!cb) return () => {};\n if (strategy === 'debounce') {\n return (s: number, meta: BottomSizeChangeMeta) => {\n if (debounceTimeoutRef.current) clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = setTimeout(() => {\n cb(s, meta);\n debounceTimeoutRef.current = null;\n }, ms);\n };\n }\n if (strategy === 'throttle') {\n let last = 0;\n return (s: number, meta: BottomSizeChangeMeta) => {\n const now = Date.now();\n if (now - last >= ms) {\n last = now;\n cb(s, meta);\n }\n };\n }\n return (s: number, meta: BottomSizeChangeMeta) => cb(s, meta);\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n\n // Dev guards\n const wasControlledRef = React.useRef<boolean | null>(null);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof open !== 'undefined' && typeof defaultOpen !== 'undefined') {\n console.error('Shell.Bottom: Do not pass both `open` and `defaultOpen`. Choose one.');\n }\n if (typeof size !== 'undefined' && typeof defaultSize !== 'undefined') {\n console.error('Shell.Bottom: Do not pass both `size` and `defaultSize`. Choose one.');\n }\n }\n\n React.useEffect(() => {\n const isControlled = typeof open !== 'undefined';\n if (wasControlledRef.current === null) {\n wasControlledRef.current = isControlled;\n return;\n }\n if (wasControlledRef.current !== isControlled) {\n console.warn('Shell.Bottom: Switching between controlled and uncontrolled `open` is not supported.');\n wasControlledRef.current = isControlled;\n }\n }, [open]);\n\n const initNotifiedRef = React.useRef(false);\n const lastBottomModeRef = React.useRef<PaneMode | null>(null);\n React.useEffect(() => {\n if (!initNotifiedRef.current && typeof open === 'undefined' && defaultOpen && shell.bottomMode === 'expanded') {\n onOpenChange?.(true, { reason: 'init' });\n initNotifiedRef.current = true;\n }\n if (typeof open === 'undefined') {\n if (lastBottomModeRef.current !== null && lastBottomModeRef.current !== shell.bottomMode) {\n onOpenChange?.(shell.bottomMode === 'expanded', { reason: 'toggle' });\n }\n lastBottomModeRef.current = shell.bottomMode;\n }\n }, [shell.bottomMode, open, defaultOpen, onOpenChange]);\n\n // Track previous mode to only fire callbacks on actual user-initiated state transitions.\n // We wait for breakpointReady to ensure the initial state sync from useResponsiveInitialState\n // is complete before enabling callbacks. This avoids spurious callbacks during initialization.\n // Use callback refs to avoid re-running effect when inline callbacks change.\n const onExpandRef = React.useRef(onExpand);\n const onCollapseRef = React.useRef(onCollapse);\n React.useLayoutEffect(() => {\n onExpandRef.current = onExpand;\n onCollapseRef.current = onCollapse;\n });\n\n const prevBottomModeRef = React.useRef<PaneMode | null>(null);\n const hasInitializedRef = React.useRef(false);\n React.useEffect(() => {\n const currentMode = shell.bottomMode;\n\n // Wait for breakpoint to be ready before enabling callbacks\n if (!shell.currentBreakpointReady) {\n prevBottomModeRef.current = currentMode;\n return;\n }\n\n // Skip the first run after breakpoint is ready - this captures the post-sync state\n if (!hasInitializedRef.current) {\n hasInitializedRef.current = true;\n prevBottomModeRef.current = currentMode;\n return;\n }\n\n const prevMode = prevBottomModeRef.current;\n\n // Only fire on actual state transitions\n if (prevMode !== null && prevMode !== currentMode) {\n if (currentMode === 'expanded') {\n onExpandRef.current?.();\n } else if (currentMode === 'collapsed') {\n onCollapseRef.current?.();\n }\n prevBottomModeRef.current = currentMode;\n }\n }, [shell.bottomMode, shell.currentBreakpointReady]);\n\n const isExpanded = shell.bottomMode === 'expanded';\n\n const persistenceAdapter = React.useMemo(() => {\n if (!paneId || persistence) return persistence;\n const key = `kookie-ui:shell:bottom:${paneId}`;\n const adapter: PaneSizePersistence = {\n load: () => {\n if (typeof window === 'undefined') return undefined;\n try {\n const v = window.localStorage.getItem(key);\n return v ? Number(v) : undefined;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Bottom: failed to load persisted size', err);\n }\n return undefined;\n }\n },\n save: (size: number) => {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, String(size));\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Bottom: failed to save persisted size', err);\n }\n }\n },\n };\n return adapter;\n }, [paneId, persistence]);\n\n React.useEffect(() => {\n let mounted = true;\n if (!resizable || !persistenceAdapter?.load || isOverlay) return undefined;\n const loaded = persistenceAdapter.load();\n const applyLoaded = (value?: number) => {\n if (!mounted || typeof value !== 'number' || !localRef.current) return;\n localRef.current.style.setProperty('--bottom-size', `${value}px`);\n onResize?.(value);\n };\n if (loaded instanceof Promise) {\n loaded.then(applyLoaded).catch((err) => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Bottom: failed to load persisted size', err);\n }\n });\n } else {\n applyLoaded(loaded);\n }\n return () => {\n mounted = false;\n };\n }, [resizable, persistenceAdapter, onResize, isOverlay]);\n\n const handleEl =\n resizable && !isOverlay && isExpanded ? (\n <PaneResizeContext.Provider\n value={{\n containerRef: localRef,\n cssVarName: '--bottom-size',\n minSize,\n maxSize,\n defaultSize: expandedSize,\n orientation: 'horizontal',\n edge: 'start',\n computeNext: (client, startClient, startSize) => {\n const delta = client - startClient;\n return startSize - delta;\n },\n onResize,\n onResizeStart,\n onResizeEnd: (size) => {\n onResizeEnd?.(size);\n emitSizeChange(size, { reason: 'resize' });\n persistenceAdapter?.save?.(size);\n },\n target: 'bottom',\n collapsible,\n snapPoints,\n snapTolerance: snapTolerance ?? 8,\n collapseThreshold,\n requestCollapse: () => shell.setBottomMode('collapsed'),\n requestToggle: () => shell.togglePane('bottom'),\n }}\n >\n {handleChildren.length > 0 ? handleChildren.map((el, i) => React.cloneElement(el, { key: el.key ?? i })) : <PaneHandle />}\n </PaneResizeContext.Provider>\n ) : null;\n\n // Strip control/size props from DOM spread (moved above overlay return to keep hook order consistent)\n // Normalize CSS lengths to px helper\n const normalizeSizeToPx = React.useCallback((value: number | string | undefined) => normalizeToPx(value, 'vertical'), []);\n\n // Apply defaultSize on mount when uncontrolled (moved above overlay return)\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof size === 'undefined' && typeof defaultSize !== 'undefined') {\n const px = normalizeSizeToPx(defaultSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--bottom-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'init' });\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Controlled size sync (moved above overlay return)\n const controlledSize = size;\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof controlledSize === 'undefined') return;\n const px = normalizeSizeToPx(controlledSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--bottom-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'controlled' });\n }\n }, [controlledSize, minSize, maxSize, normalizeSizeToPx, emitSizeChange]);\n\n if (isOverlay) {\n const open = shell.bottomMode === 'expanded';\n return (\n <Sheet.Root open={open} onOpenChange={(o) => shell.setBottomMode(o ? 'expanded' : 'collapsed')}>\n <Sheet.Content side=\"bottom\" style={{ padding: 0 }} height={{ initial: `${expandedSize}px` }}>\n <VisuallyHidden>\n <Sheet.Title>Bottom panel</Sheet.Title>\n </VisuallyHidden>\n {contentChildren}\n </Sheet.Content>\n </Sheet.Root>\n );\n }\n\n return (\n <div\n {...bottomDomProps}\n ref={setRef}\n className={classNames('rt-ShellBottom', className)}\n data-mode={shell.bottomMode}\n data-peek={shell.peekTarget === 'bottom' || undefined}\n data-presentation={shell.currentBreakpointReady ? resolvedPresentation : undefined}\n data-open={(shell.currentBreakpointReady && isStacked && isExpanded) || undefined}\n data-inset={inset || undefined}\n style={{\n ...style,\n ['--bottom-size' as any]: `${expandedSize}px`,\n ['--bottom-min-size' as any]: `${minSize}px`,\n ['--bottom-max-size' as any]: `${maxSize}px`,\n }}\n >\n <div className=\"rt-ShellBottomContent\" data-visible={isExpanded || undefined}>\n {contentChildren}\n </div>\n {handleEl}\n </div>\n );\n}) as BottomComponent;\nBottom.displayName = 'Shell.Bottom';\nBottom.Handle = BottomHandle;\n"],
5
+ "mappings": "ykBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,YAAAE,IAAA,eAAAC,GAAAH,IAAA,IAAAI,EAAuB,oBACvBC,GAAuB,yBACvBC,EAAuB,0BACvBC,GAA+B,iCAC/BC,EAAmC,+BACnCC,EAAqE,6BACrEC,GAAkC,6BAClCC,EAAyC,8BACzCC,GAA6B,6BAE7BC,EAAoE,mCACpEC,GAA8B,4CAoB9B,MAAMC,GAAuB,CAC3B,YACA,WACA,cACA,OACA,eACA,OACA,cACA,eACA,aACA,eACA,QACA,OACF,EAEab,EAASE,EAAM,WAA8C,CAACY,EAAcC,IAAQ,CAC/F,KAAM,CACJ,UAAAC,EACA,aAAAC,EAAe,QACf,YAAAC,EACA,KAAAC,EACA,aAAAC,EACA,aAAAC,EAAe,IACf,QAAAC,EAAU,IACV,QAAAC,EAAU,IACV,UAAAC,EAAY,GACZ,YAAAC,GAAc,GACd,SAAAC,EACA,WAAAC,EACA,SAAAC,EACA,cAAAC,GACA,YAAAC,GACA,WAAAC,GACA,cAAAC,GACA,kBAAAC,GACA,OAAAC,EACA,YAAAC,EACA,SAAAC,GACA,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4E,EAAIA,CAAE,CAAC,EAC/D/C,EAAS,QAAQ,MAAM,YAAY,gBAAiB,GAAGgD,CAAO,IAAI,EAClEnC,EAAemC,EAAS,CAAE,OAAQ,YAAa,CAAC,CAClD,CACF,EAAG,CAACC,EAAgB9E,EAASC,EAAS0E,EAAmBjC,CAAc,CAAC,EAEpEf,EAAW,CACb,MAAM9B,EAAO0B,EAAM,aAAe,WAClC,OACE3C,EAAA,cAACE,EAAM,KAAN,CAAW,KAAMe,EAAM,aAAekF,GAAMxD,EAAM,cAAcwD,EAAI,WAAa,WAAW,GAC3FnG,EAAA,cAACE,EAAM,QAAN,CAAc,KAAK,SAAS,MAAO,CAAE,QAAS,CAAE,EAAG,OAAQ,CAAE,QAAS,GAAGiB,CAAY,IAAK,GACzFnB,EAAA,cAAC,uBACCA,EAAA,cAACE,EAAM,MAAN,KAAY,cAAY,CAC3B,EACCqD,CACH,CACF,CAEJ,CAEA,OACEvD,EAAA,cAAC,OACE,GAAG0C,GACJ,IAAKQ,GACL,aAAW,GAAAkD,SAAW,iBAAkBtF,CAAS,EACjD,YAAW6B,EAAM,WACjB,YAAWA,EAAM,aAAe,UAAY,OAC5C,oBAAmBA,EAAM,uBAAyBG,EAAuB,OACzE,YAAYH,EAAM,wBAA0BK,IAAagC,GAAe,OACxE,aAAYvC,GAAS,OACrB,MAAO,CACL,GAAGN,GACF,gBAAyB,GAAGhB,CAAY,KACxC,oBAA6B,GAAGC,CAAO,KACvC,oBAA6B,GAAGC,CAAO,IAC1C,GAEArB,EAAA,cAAC,OAAI,UAAU,wBAAwB,eAAcgF,GAAc,QAChEzB,CACH,EACCkC,EACH,CAEJ,CAAC,EACD3F,EAAO,YAAc,eACrBA,EAAO,OAAS",
6
+ "names": ["shell_bottom_exports", "__export", "Bottom", "__toCommonJS", "React", "import_classnames", "Sheet", "import_visually_hidden", "import_shell_context", "import_shell_hooks", "import_shell_resize", "import_shell_handles", "import_shell_types", "import_shell_prop_helpers", "import_normalize_to_px", "BOTTOM_DOM_PROP_KEYS", "initialProps", "ref", "className", "presentation", "defaultOpen", "open", "onOpenChange", "expandedSize", "minSize", "maxSize", "resizable", "collapsible", "onExpand", "onCollapse", "onResize", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "paneId", "persistence", "children", "style", "size", "defaultSize", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "inset", "bottomDomProps", "shell", "registerInset", "unregisterInset", "resolvedPresentation", "isOverlay", "isStacked", "localRef", "setRef", "node", "childArray", "handleChildren", "el", "contentChildren", "normalizedControlledOpen", "normalizedDefaultOpen", "openIsResponsive", "next", "initial", "debounceTimeoutRef", "emitSizeChange", "cb", "strategy", "ms", "s", "meta", "last", "now", "wasControlledRef", "isControlled", "initNotifiedRef", "lastBottomModeRef", "onExpandRef", "onCollapseRef", "prevBottomModeRef", "hasInitializedRef", "currentMode", "prevMode", "isExpanded", "persistenceAdapter", "key", "v", "mounted", "loaded", "applyLoaded", "value", "err", "handleEl", "client", "startClient", "startSize", "delta", "i", "normalizeSizeToPx", "px", "clamped", "controlledSize", "o", "classNames"]
7
7
  }
@@ -29,6 +29,8 @@ type InspectorPublicProps = PaneBaseProps & (InspectorControlledProps | Inspecto
29
29
  onSizeChange?: (size: number, meta: InspectorSizeChangeMeta) => void;
30
30
  sizeUpdate?: 'throttle' | 'debounce';
31
31
  sizeUpdateMs?: number;
32
+ /** When true, adds margin and triggers gray backdrop on Shell. */
33
+ inset?: boolean;
32
34
  };
33
35
  type InspectorComponent = React.ForwardRefExoticComponent<InspectorPublicProps & React.RefAttributes<HTMLDivElement>> & {
34
36
  Handle: typeof InspectorHandle;
@@ -1 +1 @@
1
- {"version":3,"file":"shell-inspector.d.ts","sourceRoot":"","sources":["../../../../src/components/_internal/shell-inspector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EAAE,eAAe,EAAc,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK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,GAAG,YAAY,CAAA;CAAE,CAAC;AAC5E,KAAK,4BAA4B,GAAG;IAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AACnF,KAAK,8BAA8B,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AACtF,KAAK,oBAAoB,GAAG,aAAa,GACvC,CAAC,wBAAwB,GAAG,0BAA0B,CAAC,GACvD,CAAC,4BAA4B,GAAG,8BAA8B,CAAC,GAAG;IAChE,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACrE,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEJ,KAAK,kBAAkB,GAAG,KAAK,CAAC,yBAAyB,CAAC,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,GAAG;IAAE,MAAM,EAAE,OAAO,eAAe,CAAA;CAAE,CAAC;AAiB3J,eAAO,MAAM,SAAS,EAwWhB,kBAAkB,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var be=Object.create;var C=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var Ce=Object.getOwnPropertyNames;var ge=Object.getPrototypeOf,ve=Object.prototype.hasOwnProperty;var Ee=(s,i)=>{for(var l in i)C(s,l,{get:i[l],enumerable:!0})},ne=(s,i,l,R)=>{if(i&&typeof i=="object"||typeof i=="function")for(let c of Ce(i))!ve.call(s,c)&&c!==l&&C(s,c,{get:()=>i[c],enumerable:!(R=xe(i,c))||R.enumerable});return s};var $=(s,i,l)=>(l=s!=null?be(ge(s)):{},ne(i||!s||!s.__esModule?C(l,"default",{value:s,enumerable:!0}):l,s)),Oe=s=>ne(C({},"__esModule",{value:!0}),s);var Ne={};Ee(Ne,{Inspector:()=>A});module.exports=Oe(Ne);var n=$(require("react")),te=$(require("classnames")),L=$(require("../sheet.js")),oe=require("../visually-hidden.js"),re=require("../shell.context.js"),g=require("../shell.hooks.js"),se=require("./shell-resize.js"),h=require("./shell-handles.js"),we=require("../shell.types.js"),z=require("./shell-prop-helpers.js"),ie=require("../../helpers/normalize-to-px.js");const Te=["className","children","defaultOpen","open","onOpenChange","size","defaultSize","onSizeChange","sizeUpdate","sizeUpdateMs","style"],A=n.forwardRef((s,i)=>{const{className:l,presentation:R={initial:"overlay",lg:"fixed"},defaultOpen:c,open:p,onOpenChange:P,expandedSize:v=320,minSize:f=200,maxSize:m=500,resizable:E=!1,collapsible:ae=!0,onExpand:j,onCollapse:F,onResize:O,onResizeStart:le,onResizeEnd:ce,snapPoints:pe,snapTolerance:de,collapseThreshold:ue,paneId:T,persistence:N,children:fe,style:me,onSizeChange:k,sizeUpdate:w,sizeUpdateMs:D=50,size:q,defaultSize:K}=s,ye=(0,z.extractPaneDomProps)(s,Te),t=(0,re.useShell)(),V=(0,g.useResponsivePresentation)(R),I=V==="overlay",he=V==="stacked",d=n.useRef(null),Pe=n.useCallback(e=>{d.current=e,typeof i=="function"?i(e):i&&(i.current=e)},[i]),Y=n.Children.toArray(fe),G=Y.filter(e=>n.isValidElement(e)&&e.type===h.InspectorHandle),J=Y.filter(e=>!(n.isValidElement(e)&&e.type===h.InspectorHandle)),ze=n.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(p),[p]),Re=n.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(c),[c]),Ie=typeof p=="object"&&p!==null;(0,g.useResponsiveInitialState)({controlledValue:ze,defaultValue:Re,currentValue:t.inspectorMode,setValue:t.setInspectorMode,breakpointReady:t.currentBreakpointReady,controlledIsResponsive:Ie,onResponsiveChange:e=>P?.(e==="expanded",{reason:"responsive"}),onInit:e=>{typeof p>"u"&&P?.(e==="expanded",{reason:"init"})}});const y=n.useRef(null);n.useEffect(()=>()=>{y.current&&(clearTimeout(y.current),y.current=null)},[k,w,D]);const M=n.useMemo(()=>{const e=k,r=w,a=D??50;if(!e)return()=>{};if(r==="debounce")return(o,u)=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{e(o,u),y.current=null},a)};if(r==="throttle"){let o=0;return(u,Se)=>{const ee=Date.now();ee-o>=a&&(o=ee,e(u,Se))}}return(o,u)=>e(o,u)},[k,w,D]),S=n.useRef(null);n.useEffect(()=>{const e=typeof p<"u";if(S.current===null){S.current=e;return}S.current!==e&&(console.warn("Shell.Inspector: Switching between controlled and uncontrolled `open` is not supported."),S.current=e)},[p]);const Q=n.useRef(!1),B=n.useRef(null);n.useEffect(()=>{!Q.current&&typeof p>"u"&&c&&t.inspectorMode==="expanded"&&(P?.(!0,{reason:"init"}),Q.current=!0),typeof p>"u"&&(B.current!==null&&B.current!==t.inspectorMode&&P?.(t.inspectorMode==="expanded",{reason:"toggle"}),B.current=t.inspectorMode)},[t.inspectorMode,p,c,P]);const W=n.useRef(j),X=n.useRef(F);n.useLayoutEffect(()=>{W.current=j,X.current=F});const b=n.useRef(null),Z=n.useRef(!1);n.useEffect(()=>{const e=t.inspectorMode;if(!t.currentBreakpointReady){b.current=e;return}if(!Z.current){Z.current=!0,b.current=e;return}const r=b.current;r!==null&&r!==e&&(e==="expanded"?W.current?.():e==="collapsed"&&X.current?.(),b.current=e)},[t.inspectorMode,t.currentBreakpointReady]);const H=t.inspectorMode==="expanded",x=n.useMemo(()=>{if(!T||N)return N;const e=`kookie-ui:shell:inspector:${T}`;return{load:()=>{if(!(typeof window>"u"))try{const a=window.localStorage.getItem(e);return a?Number(a):void 0}catch{return}},save:a=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(a))}catch{}}}},[T,N]);n.useEffect(()=>{let e=!0;if(!E||!x?.load||I)return;const r=x.load(),a=o=>{!e||typeof o!="number"||!d.current||(d.current.style.setProperty("--inspector-size",`${o}px`),O?.(o))};return r instanceof Promise?r.then(a).catch(o=>{}):a(r),()=>{e=!1}},[E,x,O,I]);const Me=E&&!I&&H?n.createElement(se.PaneResizeContext.Provider,{value:{containerRef:d,cssVarName:"--inspector-size",minSize:f,maxSize:m,defaultSize:v,orientation:"vertical",edge:"start",computeNext:(e,r,a)=>{const o=getComputedStyle(d.current).direction==="rtl",u=e-r;return a+(o?u:-u)},onResize:O,onResizeStart:le,onResizeEnd:e=>{ce?.(e),M(e,{reason:"resize"}),x?.save?.(e)},target:"inspector",collapsible:ae,snapPoints:pe,snapTolerance:de??8,collapseThreshold:ue,requestCollapse:()=>t.setInspectorMode("collapsed"),requestToggle:()=>t.togglePane("inspector")}},G.length>0?G.map((e,r)=>n.cloneElement(e,{key:e.key??r})):n.createElement(h.PaneHandle,null)):null,U=n.useCallback(e=>(0,ie.normalizeToPx)(e,"horizontal"),[]);n.useEffect(()=>{if(d.current&&typeof q>"u"&&typeof K<"u"){const e=U(K);if(typeof e=="number"&&Number.isFinite(e)){const o=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof f=="number"?f:void 0)??e,e));d.current.style.setProperty("--inspector-size",`${o}px`),M(o,{reason:"init"})}}},[]);const _=q;if(n.useEffect(()=>{if(!d.current||typeof _>"u")return;const e=U(_);if(typeof e=="number"&&Number.isFinite(e)){const o=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof f=="number"?f:void 0)??e,e));d.current.style.setProperty("--inspector-size",`${o}px`),M(o,{reason:"controlled"})}},[_,f,m,U,M]),I){const e=t.inspectorMode==="expanded";return n.createElement(L.Root,{open:e,onOpenChange:r=>t.setInspectorMode(r?"expanded":"collapsed")},n.createElement(L.Content,{side:"end",style:{padding:0},width:{initial:`${v}px`}},n.createElement(oe.VisuallyHidden,null,n.createElement(L.Title,null,"Inspector")),J))}return n.createElement("div",{...ye,ref:Pe,className:(0,te.default)("rt-ShellInspector",l),"data-mode":t.inspectorMode,"data-peek":t.peekTarget==="inspector"||void 0,"data-presentation":t.currentBreakpointReady?V:void 0,"data-open":t.currentBreakpointReady&&he&&H||void 0,style:{...me,"--inspector-size":`${v}px`,"--inspector-min-size":`${f}px`,"--inspector-max-size":`${m}px`}},n.createElement("div",{className:"rt-ShellInspectorContent","data-visible":H||void 0},J),Me)});A.displayName="Shell.Inspector",A.Handle=h.InspectorHandle;
1
+ "use strict";var Ce=Object.create;var g=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var Ee=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var Ne=(s,i)=>{for(var l in i)g(s,l,{get:i[l],enumerable:!0})},se=(s,i,l,R)=>{if(i&&typeof i=="object"||typeof i=="function")for(let c of Ee(i))!Te.call(s,c)&&c!==l&&g(s,c,{get:()=>i[c],enumerable:!(R=ve(i,c))||R.enumerable});return s};var A=(s,i,l)=>(l=s!=null?Ce(Oe(s)):{},se(i||!s||!s.__esModule?g(l,"default",{value:s,enumerable:!0}):l,s)),ke=s=>se(g({},"__esModule",{value:!0}),s);var De={};Ne(De,{Inspector:()=>F});module.exports=ke(De);var n=A(require("react")),ie=A(require("classnames")),j=A(require("../sheet.js")),ae=require("../visually-hidden.js"),C=require("../shell.context.js"),v=require("../shell.hooks.js"),le=require("./shell-resize.js"),h=require("./shell-handles.js"),Be=require("../shell.types.js"),z=require("./shell-prop-helpers.js"),ce=require("../../helpers/normalize-to-px.js");const we=["className","children","defaultOpen","open","onOpenChange","size","defaultSize","onSizeChange","sizeUpdate","sizeUpdateMs","style","inset"],F=n.forwardRef((s,i)=>{const{className:l,presentation:R={initial:"overlay",lg:"fixed"},defaultOpen:c,open:p,onOpenChange:P,expandedSize:E=320,minSize:f=200,maxSize:m=500,resizable:O=!1,collapsible:pe=!0,onExpand:q,onCollapse:K,onResize:T,onResizeStart:de,onResizeEnd:ue,snapPoints:fe,snapTolerance:me,collapseThreshold:ye,paneId:N,persistence:k,children:he,style:Pe,onSizeChange:w,sizeUpdate:D,sizeUpdateMs:V=50,size:Y,defaultSize:G,inset:B}=s,ze=(0,z.extractPaneDomProps)(s,we),t=(0,C.useShell)(),{registerInset:J,unregisterInset:Q}=(0,C.useInset)();n.useEffect(()=>{if(B)return J("inspector"),()=>Q("inspector")},[B,J,Q]);const H=(0,v.useResponsivePresentation)(R),I=H==="overlay",Re=H==="stacked",d=n.useRef(null),Ie=n.useCallback(e=>{d.current=e,typeof i=="function"?i(e):i&&(i.current=e)},[i]),W=n.Children.toArray(he),X=W.filter(e=>n.isValidElement(e)&&e.type===h.InspectorHandle),Z=W.filter(e=>!(n.isValidElement(e)&&e.type===h.InspectorHandle)),be=n.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(p),[p]),Me=n.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(c),[c]),Se=typeof p=="object"&&p!==null;(0,v.useResponsiveInitialState)({controlledValue:be,defaultValue:Me,currentValue:t.inspectorMode,setValue:t.setInspectorMode,breakpointReady:t.currentBreakpointReady,controlledIsResponsive:Se,onResponsiveChange:e=>P?.(e==="expanded",{reason:"responsive"}),onInit:e=>{typeof p>"u"&&P?.(e==="expanded",{reason:"init"})}});const y=n.useRef(null);n.useEffect(()=>()=>{y.current&&(clearTimeout(y.current),y.current=null)},[w,D,V]);const b=n.useMemo(()=>{const e=w,r=D,a=V??50;if(!e)return()=>{};if(r==="debounce")return(o,u)=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{e(o,u),y.current=null},a)};if(r==="throttle"){let o=0;return(u,ge)=>{const re=Date.now();re-o>=a&&(o=re,e(u,ge))}}return(o,u)=>e(o,u)},[w,D,V]),M=n.useRef(null);n.useEffect(()=>{const e=typeof p<"u";if(M.current===null){M.current=e;return}M.current!==e&&(console.warn("Shell.Inspector: Switching between controlled and uncontrolled `open` is not supported."),M.current=e)},[p]);const ee=n.useRef(!1),U=n.useRef(null);n.useEffect(()=>{!ee.current&&typeof p>"u"&&c&&t.inspectorMode==="expanded"&&(P?.(!0,{reason:"init"}),ee.current=!0),typeof p>"u"&&(U.current!==null&&U.current!==t.inspectorMode&&P?.(t.inspectorMode==="expanded",{reason:"toggle"}),U.current=t.inspectorMode)},[t.inspectorMode,p,c,P]);const ne=n.useRef(q),te=n.useRef(K);n.useLayoutEffect(()=>{ne.current=q,te.current=K});const S=n.useRef(null),oe=n.useRef(!1);n.useEffect(()=>{const e=t.inspectorMode;if(!t.currentBreakpointReady){S.current=e;return}if(!oe.current){oe.current=!0,S.current=e;return}const r=S.current;r!==null&&r!==e&&(e==="expanded"?ne.current?.():e==="collapsed"&&te.current?.(),S.current=e)},[t.inspectorMode,t.currentBreakpointReady]);const _=t.inspectorMode==="expanded",x=n.useMemo(()=>{if(!N||k)return k;const e=`kookie-ui:shell:inspector:${N}`;return{load:()=>{if(!(typeof window>"u"))try{const a=window.localStorage.getItem(e);return a?Number(a):void 0}catch{return}},save:a=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(a))}catch{}}}},[N,k]);n.useEffect(()=>{let e=!0;if(!O||!x?.load||I)return;const r=x.load(),a=o=>{!e||typeof o!="number"||!d.current||(d.current.style.setProperty("--inspector-size",`${o}px`),T?.(o))};return r instanceof Promise?r.then(a).catch(o=>{}):a(r),()=>{e=!1}},[O,x,T,I]);const xe=O&&!I&&_?n.createElement(le.PaneResizeContext.Provider,{value:{containerRef:d,cssVarName:"--inspector-size",minSize:f,maxSize:m,defaultSize:E,orientation:"vertical",edge:"start",computeNext:(e,r,a)=>{const o=getComputedStyle(d.current).direction==="rtl",u=e-r;return a+(o?u:-u)},onResize:T,onResizeStart:de,onResizeEnd:e=>{ue?.(e),b(e,{reason:"resize"}),x?.save?.(e)},target:"inspector",collapsible:pe,snapPoints:fe,snapTolerance:me??8,collapseThreshold:ye,requestCollapse:()=>t.setInspectorMode("collapsed"),requestToggle:()=>t.togglePane("inspector")}},X.length>0?X.map((e,r)=>n.cloneElement(e,{key:e.key??r})):n.createElement(h.PaneHandle,null)):null,$=n.useCallback(e=>(0,ce.normalizeToPx)(e,"horizontal"),[]);n.useEffect(()=>{if(d.current&&typeof Y>"u"&&typeof G<"u"){const e=$(G);if(typeof e=="number"&&Number.isFinite(e)){const o=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof f=="number"?f:void 0)??e,e));d.current.style.setProperty("--inspector-size",`${o}px`),b(o,{reason:"init"})}}},[]);const L=Y;if(n.useEffect(()=>{if(!d.current||typeof L>"u")return;const e=$(L);if(typeof e=="number"&&Number.isFinite(e)){const o=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof f=="number"?f:void 0)??e,e));d.current.style.setProperty("--inspector-size",`${o}px`),b(o,{reason:"controlled"})}},[L,f,m,$,b]),I){const e=t.inspectorMode==="expanded";return n.createElement(j.Root,{open:e,onOpenChange:r=>t.setInspectorMode(r?"expanded":"collapsed")},n.createElement(j.Content,{side:"end",style:{padding:0},width:{initial:`${E}px`}},n.createElement(ae.VisuallyHidden,null,n.createElement(j.Title,null,"Inspector")),Z))}return n.createElement("div",{...ze,ref:Ie,className:(0,ie.default)("rt-ShellInspector",l),"data-mode":t.inspectorMode,"data-peek":t.peekTarget==="inspector"||void 0,"data-presentation":t.currentBreakpointReady?H:void 0,"data-open":t.currentBreakpointReady&&Re&&_||void 0,"data-inset":B||void 0,style:{...Pe,"--inspector-size":`${E}px`,"--inspector-min-size":`${f}px`,"--inspector-max-size":`${m}px`}},n.createElement("div",{className:"rt-ShellInspectorContent","data-visible":_||void 0},Z),xe)});F.displayName="Shell.Inspector",F.Handle=h.InspectorHandle;
2
2
  //# sourceMappingURL=shell-inspector.js.map