@bitrise/bitkit-v2 0.3.462-beta.2927 → 0.3.463

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 (82) hide show
  1. package/AGENTS.md +1 -1
  2. package/dist/components/BitkitCombobox/BitkitCombobox.d.ts +3 -3
  3. package/dist/components/BitkitCombobox/BitkitCombobox.js +2 -6
  4. package/dist/components/BitkitCombobox/BitkitCombobox.js.map +1 -1
  5. package/dist/components/BitkitDefinitionTooltip/BitkitDefinitionTooltip.d.ts +12 -12
  6. package/dist/components/BitkitDefinitionTooltip/BitkitDefinitionTooltip.js +20 -22
  7. package/dist/components/BitkitDefinitionTooltip/BitkitDefinitionTooltip.js.map +1 -1
  8. package/dist/components/BitkitLabeledData/BitkitLabeledData.d.ts +3 -3
  9. package/dist/components/BitkitLabeledData/BitkitLabeledData.js +11 -2
  10. package/dist/components/BitkitLabeledData/BitkitLabeledData.js.map +1 -1
  11. package/dist/components/BitkitMultiselect/BitkitMultiselect.d.ts +3 -3
  12. package/dist/components/BitkitMultiselect/BitkitMultiselect.js +1 -4
  13. package/dist/components/BitkitMultiselect/BitkitMultiselect.js.map +1 -1
  14. package/dist/components/BitkitMultiselectMenu/BitkitMultiselectMenu.d.ts +3 -3
  15. package/dist/components/BitkitMultiselectMenu/BitkitMultiselectMenu.js.map +1 -1
  16. package/dist/components/BitkitSelect/BitkitSelect.d.ts +3 -3
  17. package/dist/components/BitkitSelect/BitkitSelect.js +1 -4
  18. package/dist/components/BitkitSelect/BitkitSelect.js.map +1 -1
  19. package/dist/components/BitkitSelectMenu/BitkitSelectMenu.d.ts +2 -7
  20. package/dist/components/BitkitSelectMenu/BitkitSelectMenu.js.map +1 -1
  21. package/dist/components/BitkitSelectMenu/SelectMenuShell.d.ts +3 -3
  22. package/dist/components/BitkitSelectMenu/SelectMenuShell.js +4 -22
  23. package/dist/components/BitkitSelectMenu/SelectMenuShell.js.map +1 -1
  24. package/dist/components/BitkitTable/BitkitDefinitionColumnHeader.d.ts +1 -1
  25. package/dist/components/BitkitTable/BitkitDefinitionColumnHeader.js +16 -19
  26. package/dist/components/BitkitTable/BitkitDefinitionColumnHeader.js.map +1 -1
  27. package/dist/components/BitkitToggletip/BitkitToggletip.d.ts +59 -0
  28. package/dist/components/BitkitToggletip/BitkitToggletip.js +107 -0
  29. package/dist/components/BitkitToggletip/BitkitToggletip.js.map +1 -0
  30. package/dist/components/BitkitTooltip/BitkitTooltip.d.ts +7 -23
  31. package/dist/components/BitkitTooltip/BitkitTooltip.js +14 -45
  32. package/dist/components/BitkitTooltip/BitkitTooltip.js.map +1 -1
  33. package/dist/components/BitkitTreeView/BitkitTreeView.js +4 -1
  34. package/dist/components/BitkitTreeView/BitkitTreeView.js.map +1 -1
  35. package/dist/components/index.d.ts +1 -2
  36. package/dist/main.js +2 -4
  37. package/dist/theme/common/TooltipAndToggletip.common.d.ts +90 -0
  38. package/dist/theme/common/TooltipAndToggletip.common.js +72 -0
  39. package/dist/theme/common/TooltipAndToggletip.common.js.map +1 -0
  40. package/dist/theme/slot-recipes/DatePickerSelect.recipe.d.ts +2 -14
  41. package/dist/theme/slot-recipes/Select.recipe.d.ts +5 -23
  42. package/dist/theme/slot-recipes/Select.recipe.js +3 -37
  43. package/dist/theme/slot-recipes/Select.recipe.js.map +1 -1
  44. package/dist/theme/slot-recipes/Toggletip.recipe.d.ts +60 -0
  45. package/dist/theme/slot-recipes/Toggletip.recipe.js +31 -0
  46. package/dist/theme/slot-recipes/Toggletip.recipe.js.map +1 -0
  47. package/dist/theme/slot-recipes/Tooltip.recipe.d.ts +34 -34
  48. package/dist/theme/slot-recipes/Tooltip.recipe.js +4 -61
  49. package/dist/theme/slot-recipes/Tooltip.recipe.js.map +1 -1
  50. package/dist/theme/slot-recipes/TreeView.recipe.js +9 -6
  51. package/dist/theme/slot-recipes/TreeView.recipe.js.map +1 -1
  52. package/dist/theme/slot-recipes/index.d.ts +96 -184
  53. package/dist/theme/slot-recipes/index.js +3 -3
  54. package/dist/theme/slot-recipes/index.js.map +1 -1
  55. package/package.json +1 -1
  56. package/dist/components/BitkitUISideNav/BitkitUISideNav.d.ts +0 -37
  57. package/dist/components/BitkitUISideNav/BitkitUISideNav.js +0 -167
  58. package/dist/components/BitkitUISideNav/BitkitUISideNav.js.map +0 -1
  59. package/dist/components/BitkitUISideNav/UISideNavBody.d.ts +0 -7
  60. package/dist/components/BitkitUISideNav/UISideNavBody.js +0 -20
  61. package/dist/components/BitkitUISideNav/UISideNavBody.js.map +0 -1
  62. package/dist/components/BitkitUISideNav/UISideNavContext.d.ts +0 -32
  63. package/dist/components/BitkitUISideNav/UISideNavContext.js +0 -28
  64. package/dist/components/BitkitUISideNav/UISideNavContext.js.map +0 -1
  65. package/dist/components/BitkitUISideNav/UISideNavFooter.d.ts +0 -16
  66. package/dist/components/BitkitUISideNav/UISideNavFooter.js +0 -28
  67. package/dist/components/BitkitUISideNav/UISideNavFooter.js.map +0 -1
  68. package/dist/components/BitkitUISideNav/UISideNavFooterHeading.d.ts +0 -12
  69. package/dist/components/BitkitUISideNav/UISideNavFooterHeading.js +0 -26
  70. package/dist/components/BitkitUISideNav/UISideNavFooterHeading.js.map +0 -1
  71. package/dist/components/BitkitUISideNav/UISideNavItem.d.ts +0 -26
  72. package/dist/components/BitkitUISideNav/UISideNavItem.js +0 -33
  73. package/dist/components/BitkitUISideNav/UISideNavItem.js.map +0 -1
  74. package/dist/components/BitkitUISideNav/UISideNavLink.d.ts +0 -30
  75. package/dist/components/BitkitUISideNav/UISideNavLink.js +0 -58
  76. package/dist/components/BitkitUISideNav/UISideNavLink.js.map +0 -1
  77. package/dist/components/BitkitUISideNav/UISideNavWorkspaceSelector.d.ts +0 -45
  78. package/dist/components/BitkitUISideNav/UISideNavWorkspaceSelector.js +0 -119
  79. package/dist/components/BitkitUISideNav/UISideNavWorkspaceSelector.js.map +0 -1
  80. package/dist/theme/slot-recipes/UISideNav.recipe.d.ts +0 -119
  81. package/dist/theme/slot-recipes/UISideNav.recipe.js +0 -416
  82. package/dist/theme/slot-recipes/UISideNav.recipe.js.map +0 -1
@@ -657,8 +657,8 @@ declare const slotRecipes: {
657
657
  textStyle: "body/md/semibold";
658
658
  };
659
659
  } | undefined;
660
- content?: {
661
- '--select-menu-list-max-height': `${number}rem`;
660
+ itemList?: {
661
+ maxHeight: `${number}rem`;
662
662
  } | undefined;
663
663
  itemLabel?: {
664
664
  textStyle: "body/md/regular";
@@ -670,18 +670,6 @@ declare const slotRecipes: {
670
670
  emptyState?: {
671
671
  paddingBlock: "8";
672
672
  } | undefined;
673
- errorState?: {
674
- paddingBlock: "4";
675
- } | undefined;
676
- errorLabel?: {
677
- textStyle: "body/md/regular";
678
- } | undefined;
679
- errorIcon?: {
680
- marginBlockStart: "4";
681
- } | undefined;
682
- errorTextBlock?: {
683
- paddingBlock: "2";
684
- } | undefined;
685
673
  action?: {
686
674
  minHeight: "40";
687
675
  paddingBlock: "8";
@@ -2154,7 +2142,7 @@ declare const slotRecipes: {
2154
2142
  };
2155
2143
  };
2156
2144
  }>;
2157
- select: import('@chakra-ui/react').SlotRecipeDefinition<"content" | "label" | "checkbox" | "list" | "avatar" | "emptyState" | "root" | "item" | "itemContent" | "itemIndicator" | "trigger" | "positioner" | "indicator" | "itemGroup" | "itemGroupLabel" | "itemText" | "valueText" | "action" | "clearTrigger" | "control" | "actionContainer" | "errorLabel" | "searchInputGroup" | "searchInput" | "searchClear" | "errorState" | "itemList" | "errorIcon" | "errorTextBlock" | "itemHelperText" | "itemLoading" | "itemLoadingLabel" | "itemLabel" | "indicatorGroup" | "checkmark" | "itemBadge" | "itemIcon" | "valueIcon", {
2145
+ select: import('@chakra-ui/react').SlotRecipeDefinition<"content" | "label" | "checkbox" | "list" | "avatar" | "emptyState" | "root" | "item" | "itemContent" | "itemIndicator" | "trigger" | "positioner" | "indicator" | "itemGroup" | "itemGroupLabel" | "itemText" | "valueText" | "action" | "clearTrigger" | "control" | "actionContainer" | "searchInputGroup" | "searchInput" | "searchClear" | "itemList" | "itemLoading" | "itemLoadingLabel" | "itemLabel" | "itemHelperText" | "indicatorGroup" | "checkmark" | "itemBadge" | "itemIcon" | "valueIcon", {
2158
2146
  hasStatusIcon: {
2159
2147
  true: {
2160
2148
  trigger: {
@@ -2195,8 +2183,8 @@ declare const slotRecipes: {
2195
2183
  textStyle: "body/lg/semibold";
2196
2184
  };
2197
2185
  };
2198
- content: {
2199
- '--select-menu-list-max-height': `${number}rem`;
2186
+ itemList: {
2187
+ maxHeight: `${number}rem`;
2200
2188
  };
2201
2189
  itemLabel: {
2202
2190
  textStyle: "body/lg/regular";
@@ -2208,12 +2196,6 @@ declare const slotRecipes: {
2208
2196
  emptyState: {
2209
2197
  paddingBlock: "12";
2210
2198
  };
2211
- errorState: {
2212
- paddingBlock: "8";
2213
- };
2214
- errorLabel: {
2215
- textStyle: "body/lg/regular";
2216
- };
2217
2199
  action: {
2218
2200
  minHeight: "48";
2219
2201
  paddingBlock: "12";
@@ -2260,8 +2242,8 @@ declare const slotRecipes: {
2260
2242
  textStyle: "body/md/semibold";
2261
2243
  };
2262
2244
  };
2263
- content: {
2264
- '--select-menu-list-max-height': `${number}rem`;
2245
+ itemList: {
2246
+ maxHeight: `${number}rem`;
2265
2247
  };
2266
2248
  itemLabel: {
2267
2249
  textStyle: "body/md/regular";
@@ -2273,18 +2255,6 @@ declare const slotRecipes: {
2273
2255
  emptyState: {
2274
2256
  paddingBlock: "8";
2275
2257
  };
2276
- errorState: {
2277
- paddingBlock: "4";
2278
- };
2279
- errorLabel: {
2280
- textStyle: "body/md/regular";
2281
- };
2282
- errorIcon: {
2283
- marginBlockStart: "4";
2284
- };
2285
- errorTextBlock: {
2286
- paddingBlock: "2";
2287
- };
2288
2258
  action: {
2289
2259
  minHeight: "40";
2290
2260
  paddingBlock: "8";
@@ -3216,57 +3186,112 @@ declare const slotRecipes: {
3216
3186
  };
3217
3187
  };
3218
3188
  }>;
3189
+ toggletip: import('@chakra-ui/react').SlotRecipeDefinition<"anchor" | "content" | "body" | "footer" | "header" | "title" | "trigger" | "arrow" | "arrowTip" | "positioner" | "closeTrigger" | "indicator" | "description", {
3190
+ readonly variant: {
3191
+ readonly dark: {
3192
+ readonly content: {
3193
+ readonly '--tooltip-bg': "colors.background/contrast";
3194
+ readonly color: "text/on-contrast";
3195
+ };
3196
+ };
3197
+ readonly light: {
3198
+ readonly content: {
3199
+ readonly '--tooltip-bg': "colors.background/tertiary";
3200
+ readonly color: "text/primary";
3201
+ };
3202
+ };
3203
+ };
3204
+ readonly paddingSize: {
3205
+ readonly sm: {
3206
+ readonly content: {
3207
+ readonly paddingInline: "8";
3208
+ readonly paddingBlock: "4";
3209
+ readonly borderRadius: "4";
3210
+ };
3211
+ };
3212
+ readonly md: {
3213
+ readonly content: {
3214
+ readonly paddingInline: "12";
3215
+ readonly paddingBlock: "8";
3216
+ readonly borderRadius: "8";
3217
+ };
3218
+ };
3219
+ readonly lg: {
3220
+ readonly content: {
3221
+ readonly padding: "16";
3222
+ readonly borderRadius: "8";
3223
+ };
3224
+ };
3225
+ };
3226
+ readonly textStyle: {
3227
+ readonly 'sm/regular': {
3228
+ readonly content: {
3229
+ readonly textStyle: "body/sm/regular";
3230
+ };
3231
+ };
3232
+ readonly 'sm/semibold': {
3233
+ readonly content: {
3234
+ readonly textStyle: "body/sm/semibold";
3235
+ };
3236
+ };
3237
+ readonly 'md/regular': {
3238
+ readonly content: {
3239
+ readonly textStyle: "body/md/regular";
3240
+ };
3241
+ };
3242
+ };
3243
+ }>;
3219
3244
  tooltip: import('@chakra-ui/react').SlotRecipeDefinition<"content" | "trigger" | "arrow" | "arrowTip" | "positioner", {
3220
- variant: {
3221
- dark: {
3222
- content: {
3223
- '--tooltip-bg': "colors.background/contrast";
3224
- color: "text/on-contrast";
3245
+ readonly variant: {
3246
+ readonly dark: {
3247
+ readonly content: {
3248
+ readonly '--tooltip-bg': "colors.background/contrast";
3249
+ readonly color: "text/on-contrast";
3225
3250
  };
3226
3251
  };
3227
- light: {
3228
- content: {
3229
- '--tooltip-bg': "colors.background/tertiary";
3230
- color: "text/primary";
3252
+ readonly light: {
3253
+ readonly content: {
3254
+ readonly '--tooltip-bg': "colors.background/tertiary";
3255
+ readonly color: "text/primary";
3231
3256
  };
3232
3257
  };
3233
3258
  };
3234
- paddingSize: {
3235
- sm: {
3236
- content: {
3237
- paddingInline: "8";
3238
- paddingBlock: "4";
3239
- borderRadius: "4";
3259
+ readonly paddingSize: {
3260
+ readonly sm: {
3261
+ readonly content: {
3262
+ readonly paddingInline: "8";
3263
+ readonly paddingBlock: "4";
3264
+ readonly borderRadius: "4";
3240
3265
  };
3241
3266
  };
3242
- md: {
3243
- content: {
3244
- paddingInline: "12";
3245
- paddingBlock: "8";
3246
- borderRadius: "8";
3267
+ readonly md: {
3268
+ readonly content: {
3269
+ readonly paddingInline: "12";
3270
+ readonly paddingBlock: "8";
3271
+ readonly borderRadius: "8";
3247
3272
  };
3248
3273
  };
3249
- lg: {
3250
- content: {
3251
- padding: "16";
3252
- borderRadius: "8";
3274
+ readonly lg: {
3275
+ readonly content: {
3276
+ readonly padding: "16";
3277
+ readonly borderRadius: "8";
3253
3278
  };
3254
3279
  };
3255
3280
  };
3256
- textStyle: {
3257
- 'sm/regular': {
3258
- content: {
3259
- textStyle: "body/sm/regular";
3281
+ readonly textStyle: {
3282
+ readonly 'sm/regular': {
3283
+ readonly content: {
3284
+ readonly textStyle: "body/sm/regular";
3260
3285
  };
3261
3286
  };
3262
- 'sm/semibold': {
3263
- content: {
3264
- textStyle: "body/sm/semibold";
3287
+ readonly 'sm/semibold': {
3288
+ readonly content: {
3289
+ readonly textStyle: "body/sm/semibold";
3265
3290
  };
3266
3291
  };
3267
- 'md/regular': {
3268
- content: {
3269
- textStyle: "body/md/regular";
3292
+ readonly 'md/regular': {
3293
+ readonly content: {
3294
+ readonly textStyle: "body/md/regular";
3270
3295
  };
3271
3296
  };
3272
3297
  };
@@ -3426,118 +3451,5 @@ declare const slotRecipes: {
3426
3451
  };
3427
3452
  };
3428
3453
  }>;
3429
- uiSideNav: import('@chakra-ui/react').SlotRecipeDefinition<"link" | "content" | "body" | "footer" | "closeButton" | "root" | "item" | "itemIndicator" | "positioner" | "itemLabel" | "itemIcon" | "backdrop" | "footerSeparator" | "footerHeading" | "linkIconBlock" | "linkTextBlock" | "linkIcon" | "linkStatusDot" | "linkLabel" | "linkSecondaryText" | "workspaceRoot" | "workspaceControl" | "workspace" | "workspaceTextBlock" | "workspaceChevron" | "workspaceMenu" | "workspaceLabel" | "workspaceValue", {
3430
- layout: {
3431
- rail: {
3432
- root: {
3433
- paddingBlockEnd: "12";
3434
- transition: "width 100ms ease-out";
3435
- transitionDelay: "50ms";
3436
- width: `${number}rem`;
3437
- _motionReduce: {
3438
- transition: "none";
3439
- };
3440
- '&[data-expanded]': {
3441
- transitionDelay: "100ms";
3442
- width: `${number}rem`;
3443
- };
3444
- };
3445
- workspace: {
3446
- paddingInline: "16";
3447
- minWidth: `${number}rem`;
3448
- };
3449
- workspaceControl: {
3450
- minWidth: `${number}rem`;
3451
- };
3452
- workspaceMenu: {
3453
- width: `${number}rem`;
3454
- };
3455
- body: {
3456
- overflowX: "hidden";
3457
- overflowY: "auto";
3458
- scrollbar: "hidden";
3459
- };
3460
- item: {
3461
- gap: "24";
3462
- paddingBlock: "16";
3463
- minWidth: `${number}rem`;
3464
- };
3465
- link: {
3466
- gap: "24";
3467
- minWidth: `${number}rem`;
3468
- };
3469
- footerSeparator: {
3470
- '[data-expanded] &': {
3471
- paddingInline: "16";
3472
- };
3473
- };
3474
- footerHeading: {
3475
- minWidth: `${number}rem`;
3476
- };
3477
- };
3478
- drawer: {
3479
- root: {
3480
- overflowX: "hidden";
3481
- overflowY: "auto";
3482
- width: "full";
3483
- };
3484
- workspaceRoot: {
3485
- background: "sys/ui/sidenav/bg";
3486
- insetBlockStart: number;
3487
- position: "sticky";
3488
- zIndex: number;
3489
- };
3490
- workspace: {
3491
- paddingBlock: "16";
3492
- paddingInlineEnd: "24";
3493
- paddingInlineStart: "16";
3494
- };
3495
- item: {
3496
- gap: "12";
3497
- paddingBlock: "16";
3498
- };
3499
- link: {
3500
- gap: "12";
3501
- };
3502
- footer: {
3503
- paddingBlockEnd: "16";
3504
- paddingBlockStart: "12";
3505
- position: "relative";
3506
- };
3507
- footerHeading: {
3508
- paddingBlockStart: "12";
3509
- '&[data-section]': {
3510
- marginBlockStart: "12";
3511
- paddingBlockStart: "24";
3512
- position: "relative";
3513
- _before: {
3514
- insetBlockStart: number;
3515
- insetInline: number;
3516
- position: "absolute";
3517
- background: "border/inverse";
3518
- content: "\"\"";
3519
- height: "1";
3520
- opacity: 0.2;
3521
- };
3522
- };
3523
- };
3524
- footerSeparator: {
3525
- insetBlockStart: number;
3526
- insetInline: number;
3527
- paddingBlock: number;
3528
- paddingInline: number;
3529
- position: "absolute";
3530
- };
3531
- workspaceMenu: {
3532
- maxHeight: "var(--available-height)";
3533
- '--select-menu-list-max-height': "none";
3534
- };
3535
- body: {
3536
- flex: "1 0 auto";
3537
- paddingBlock: "8";
3538
- };
3539
- };
3540
- };
3541
- }>;
3542
3454
  };
3543
3455
  export default slotRecipes;
@@ -1,6 +1,5 @@
1
1
  import avatarSlotRecipe from "./Avatar.recipe.js";
2
2
  import numberInputSlotRecipe from "./NumberInput.recipe.js";
3
- import uiSideNavSlotRecipe from "./UISideNav.recipe.js";
4
3
  import accordionSlotRecipe from "./Accordion.recipe.js";
5
4
  import actionBarSlotRecipe from "./ActionBar.recipe.js";
6
5
  import alertSlotRecipe from "./Alert.recipe.js";
@@ -59,6 +58,7 @@ import tagSlotRecipe from "./Tag.recipe.js";
59
58
  import tagsInputSlotRecipe from "./TagsInput.recipe.js";
60
59
  import textInputSlotRecipe from "./TextInput.recipe.js";
61
60
  import toastSlotRecipe from "./Toast.recipe.js";
61
+ import toggletipSlotRecipe from "./Toggletip.recipe.js";
62
62
  import tooltipSlotRecipe from "./Tooltip.recipe.js";
63
63
  import tourSlotRecipe from "./Tour.recipe.js";
64
64
  import treeViewSlotRecipe from "./TreeView.recipe.js";
@@ -124,10 +124,10 @@ var slotRecipes = {
124
124
  tagsInput: tagsInputSlotRecipe,
125
125
  textInput: textInputSlotRecipe,
126
126
  toast: toastSlotRecipe,
127
+ toggletip: toggletipSlotRecipe,
127
128
  tooltip: tooltipSlotRecipe,
128
129
  tour: tourSlotRecipe,
129
- treeView: treeViewSlotRecipe,
130
- uiSideNav: uiSideNavSlotRecipe
130
+ treeView: treeViewSlotRecipe
131
131
  };
132
132
  //#endregion
133
133
  export { slotRecipes as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../lib/theme/slot-recipes/index.ts"],"sourcesContent":["import accordionSlotRecipe from './Accordion.recipe.ts';\nimport actionBarSlotRecipe from './ActionBar.recipe.ts';\nimport alertSlotRecipe from './Alert.recipe.ts';\nimport avatarSlotRecipe from './Avatar.recipe.ts';\nimport breadcrumbSlotRecipe from './Breadcrumb.recipe.ts';\nimport cardSlotRecipe from './Card.recipe';\nimport checkboxSlotRecipe from './Checkbox.recipe';\nimport codeSnippetSlotRecipe from './CodeSnippet.recipe.ts';\nimport collapsibleSlotRecipe from './Collapsible.recipe.ts';\nimport comboboxSlotRecipe from './Combobox.recipe.ts';\nimport dataWidgetSlotRecipe from './DataWidget.recipe.ts';\nimport datePickerSlotRecipe from './DatePicker.recipe.ts';\nimport datePickerSelectSlotRecipe from './DatePickerSelect.recipe.ts';\nimport dialogSlotRecipe from './Dialog.recipe.ts';\nimport draggableCardSlotRecipe from './DraggableCard.recipe.ts';\nimport drawerSlotRecipe from './Drawer.recipe.ts';\nimport emptyStateSlotRecipe from './EmptyState.recipe';\nimport expandableCardSlotRecipe from './ExpandableCard.recipe.ts';\nimport fieldSlotRecipe from './Field.recipe';\nimport fieldsetSlotRecipe from './Fieldset.recipe.ts';\nimport fileUploadSlotRecipe from './FileUpload.recipe.ts';\nimport groupHeadingSlotRecipe from './GroupHeading.recipe.ts';\nimport imageCropperSlotRecipe from './ImageCropper.recipe.ts';\nimport inlineLoadingSlotRecipe from './InlineLoading.recipe.ts';\nimport labeledDataSlotRecipe from './LabeledData.recipe.ts';\nimport listSlotRecipe from './List.recipe.ts';\nimport markdownSlotRecipe from './Markdown.recipe.ts';\nimport markdownCardSlotRecipe from './MarkdownCard.recipe.ts';\nimport menuSlotRecipe from './Menu.recipe.ts';\nimport multiselectSlotRecipe from './Multiselect.recipe.ts';\nimport nativeSelectSlotRecipe from './NativeSelect.recipe.ts';\nimport noteCardSlotRecipe from './NoteCard.recipe.ts';\nimport numberInputSlotRecipe from './NumberInput.recipe';\nimport overflowContentSlotRecipe from './OverflowContent.recipe.ts';\nimport pageFooterSlotRecipe from './PageFooter.recipe.ts';\nimport pageHeaderSlotRecipe from './PageHeader.recipe.ts';\nimport pageSidebarSlotRecipe from './PageSidebar.recipe.ts';\nimport paginationSlotRecipe from './Pagination.recipe.ts';\nimport paginationLoadMoreSlotRecipe from './PaginationLoadMore.recipe.ts';\nimport popoverSlotRecipe from './Popover.recipe.ts';\nimport progressSlotRecipe from './Progress.recipe.ts';\nimport qrCodeSlotRecipe from './QrCode.recipe.ts';\nimport radioGroupSlotRecipe from './RadioGroup.recipe.ts';\nimport ribbonSlotRecipe from './Ribbon.recipe.ts';\nimport sectionHeadingSlotRecipe from './SectionHeading.recipe.ts';\nimport segmentGroupSlotRecipe from './SegmentGroup.recipe.ts';\nimport { selectSlotRecipe } from './Select.recipe.ts';\nimport settingsCardSlotRecipe from './SettingsCard.recipe.ts';\nimport splitButtonSlotRecipe from './SplitButton.recipe.ts';\nimport statSlotRecipe from './Stat.recipe.ts';\nimport stepCardSlotRecipe from './StepCard.recipe.ts';\nimport stepsSlotRecipe from './Steps.recipe.ts';\nimport switchSlotRecipe from './Switch.recipe';\nimport tableSlotRecipe from './Table.recipe.ts';\nimport tableCardSlotRecipe from './TableCard.recipe.ts';\nimport tabsSlotRecipe from './Tabs.recipe';\nimport tagSlotRecipe from './Tag.recipe.ts';\nimport tagsInputSlotRecipe from './TagsInput.recipe.ts';\nimport textInputSlotRecipe from './TextInput.recipe.ts';\nimport toastSlotRecipe from './Toast.recipe';\nimport tooltipSlotRecipe from './Tooltip.recipe';\nimport tourSlotRecipe from './Tour.recipe.ts';\nimport treeViewSlotRecipe from './TreeView.recipe.ts';\nimport uiSideNavSlotRecipe from './UISideNav.recipe.ts';\n\nconst slotRecipes = {\n accordion: accordionSlotRecipe,\n actionBar: actionBarSlotRecipe,\n alert: alertSlotRecipe,\n avatar: avatarSlotRecipe,\n breadcrumb: breadcrumbSlotRecipe,\n card: cardSlotRecipe,\n checkbox: checkboxSlotRecipe,\n codeSnippet: codeSnippetSlotRecipe,\n collapsible: collapsibleSlotRecipe,\n combobox: comboboxSlotRecipe,\n dataWidget: dataWidgetSlotRecipe,\n datePicker: datePickerSlotRecipe,\n datePickerSelect: datePickerSelectSlotRecipe,\n dialog: dialogSlotRecipe,\n draggableCard: draggableCardSlotRecipe,\n drawer: drawerSlotRecipe,\n emptyState: emptyStateSlotRecipe,\n expandableCard: expandableCardSlotRecipe,\n field: fieldSlotRecipe,\n groupHeading: groupHeadingSlotRecipe,\n fieldset: fieldsetSlotRecipe,\n fileUpload: fileUploadSlotRecipe,\n imageCropper: imageCropperSlotRecipe,\n inlineLoading: inlineLoadingSlotRecipe,\n list: listSlotRecipe,\n markdown: markdownSlotRecipe,\n markdownCard: markdownCardSlotRecipe,\n menu: menuSlotRecipe,\n multiselect: multiselectSlotRecipe,\n noteCard: noteCardSlotRecipe,\n nativeSelect: nativeSelectSlotRecipe,\n numberInput: numberInputSlotRecipe,\n overflowContent: overflowContentSlotRecipe,\n pageFooter: pageFooterSlotRecipe,\n pageHeader: pageHeaderSlotRecipe,\n pageSidebar: pageSidebarSlotRecipe,\n pagination: paginationSlotRecipe,\n paginationLoadMore: paginationLoadMoreSlotRecipe,\n popover: popoverSlotRecipe,\n progress: progressSlotRecipe,\n qrCode: qrCodeSlotRecipe,\n radioGroup: radioGroupSlotRecipe,\n ribbon: ribbonSlotRecipe,\n sectionHeading: sectionHeadingSlotRecipe,\n labeledData: labeledDataSlotRecipe,\n segmentGroup: segmentGroupSlotRecipe,\n select: selectSlotRecipe,\n settingsCard: settingsCardSlotRecipe,\n splitButton: splitButtonSlotRecipe,\n stat: statSlotRecipe,\n stepsCard: stepCardSlotRecipe,\n steps: stepsSlotRecipe,\n switch: switchSlotRecipe,\n table: tableSlotRecipe,\n tableCard: tableCardSlotRecipe,\n tabs: tabsSlotRecipe,\n tag: tagSlotRecipe,\n tagsInput: tagsInputSlotRecipe,\n textInput: textInputSlotRecipe,\n toast: toastSlotRecipe,\n tooltip: tooltipSlotRecipe,\n tour: tourSlotRecipe,\n treeView: treeViewSlotRecipe,\n uiSideNav: uiSideNavSlotRecipe,\n};\n\nexport default slotRecipes;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,IAAM,cAAc;CAClB,WAAW;CACX,WAAW;CACX,OAAO;CACP,QAAQ;CACR,YAAY;CACZ,MAAM;CACN,UAAU;CACV,aAAa;CACb,aAAa;CACb,UAAU;CACV,YAAY;CACZ,YAAY;CACZ,kBAAkB;CAClB,QAAQ;CACR,eAAe;CACf,QAAQ;CACR,YAAY;CACZ,gBAAgB;CAChB,OAAO;CACP,cAAc;CACd,UAAU;CACV,YAAY;CACZ,cAAc;CACd,eAAe;CACf,MAAM;CACN,UAAU;CACV,cAAc;CACd,MAAM;CACN,aAAa;CACb,UAAU;CACV,cAAc;CACd,aAAa;CACb,iBAAiB;CACjB,YAAY;CACZ,YAAY;CACZ,aAAa;CACb,YAAY;CACZ,oBAAoB;CACpB,SAAS;CACT,UAAU;CACV,QAAQ;CACR,YAAY;CACZ,QAAQ;CACR,gBAAgB;CAChB,aAAa;CACb,cAAc;CACd,QAAQ;CACR,cAAc;CACd,aAAa;CACb,MAAM;CACN,WAAW;CACX,OAAO;CACP,QAAQ;CACR,OAAO;CACP,WAAW;CACX,MAAM;CACN,KAAK;CACL,WAAW;CACX,WAAW;CACX,OAAO;CACP,SAAS;CACT,MAAM;CACN,UAAU;CACV,WAAW;AACb"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../lib/theme/slot-recipes/index.ts"],"sourcesContent":["import accordionSlotRecipe from './Accordion.recipe.ts';\nimport actionBarSlotRecipe from './ActionBar.recipe.ts';\nimport alertSlotRecipe from './Alert.recipe.ts';\nimport avatarSlotRecipe from './Avatar.recipe.ts';\nimport breadcrumbSlotRecipe from './Breadcrumb.recipe.ts';\nimport cardSlotRecipe from './Card.recipe';\nimport checkboxSlotRecipe from './Checkbox.recipe';\nimport codeSnippetSlotRecipe from './CodeSnippet.recipe.ts';\nimport collapsibleSlotRecipe from './Collapsible.recipe.ts';\nimport comboboxSlotRecipe from './Combobox.recipe.ts';\nimport dataWidgetSlotRecipe from './DataWidget.recipe.ts';\nimport datePickerSlotRecipe from './DatePicker.recipe.ts';\nimport datePickerSelectSlotRecipe from './DatePickerSelect.recipe.ts';\nimport dialogSlotRecipe from './Dialog.recipe.ts';\nimport draggableCardSlotRecipe from './DraggableCard.recipe.ts';\nimport drawerSlotRecipe from './Drawer.recipe.ts';\nimport emptyStateSlotRecipe from './EmptyState.recipe';\nimport expandableCardSlotRecipe from './ExpandableCard.recipe.ts';\nimport fieldSlotRecipe from './Field.recipe';\nimport fieldsetSlotRecipe from './Fieldset.recipe.ts';\nimport fileUploadSlotRecipe from './FileUpload.recipe.ts';\nimport groupHeadingSlotRecipe from './GroupHeading.recipe.ts';\nimport imageCropperSlotRecipe from './ImageCropper.recipe.ts';\nimport inlineLoadingSlotRecipe from './InlineLoading.recipe.ts';\nimport labeledDataSlotRecipe from './LabeledData.recipe.ts';\nimport listSlotRecipe from './List.recipe.ts';\nimport markdownSlotRecipe from './Markdown.recipe.ts';\nimport markdownCardSlotRecipe from './MarkdownCard.recipe.ts';\nimport menuSlotRecipe from './Menu.recipe.ts';\nimport multiselectSlotRecipe from './Multiselect.recipe.ts';\nimport nativeSelectSlotRecipe from './NativeSelect.recipe.ts';\nimport noteCardSlotRecipe from './NoteCard.recipe.ts';\nimport numberInputSlotRecipe from './NumberInput.recipe';\nimport overflowContentSlotRecipe from './OverflowContent.recipe.ts';\nimport pageFooterSlotRecipe from './PageFooter.recipe.ts';\nimport pageHeaderSlotRecipe from './PageHeader.recipe.ts';\nimport pageSidebarSlotRecipe from './PageSidebar.recipe.ts';\nimport paginationSlotRecipe from './Pagination.recipe.ts';\nimport paginationLoadMoreSlotRecipe from './PaginationLoadMore.recipe.ts';\nimport popoverSlotRecipe from './Popover.recipe.ts';\nimport progressSlotRecipe from './Progress.recipe.ts';\nimport qrCodeSlotRecipe from './QrCode.recipe.ts';\nimport radioGroupSlotRecipe from './RadioGroup.recipe.ts';\nimport ribbonSlotRecipe from './Ribbon.recipe.ts';\nimport sectionHeadingSlotRecipe from './SectionHeading.recipe.ts';\nimport segmentGroupSlotRecipe from './SegmentGroup.recipe.ts';\nimport { selectSlotRecipe } from './Select.recipe.ts';\nimport settingsCardSlotRecipe from './SettingsCard.recipe.ts';\nimport splitButtonSlotRecipe from './SplitButton.recipe.ts';\nimport statSlotRecipe from './Stat.recipe.ts';\nimport stepCardSlotRecipe from './StepCard.recipe.ts';\nimport stepsSlotRecipe from './Steps.recipe.ts';\nimport switchSlotRecipe from './Switch.recipe';\nimport tableSlotRecipe from './Table.recipe.ts';\nimport tableCardSlotRecipe from './TableCard.recipe.ts';\nimport tabsSlotRecipe from './Tabs.recipe';\nimport tagSlotRecipe from './Tag.recipe.ts';\nimport tagsInputSlotRecipe from './TagsInput.recipe.ts';\nimport textInputSlotRecipe from './TextInput.recipe.ts';\nimport toastSlotRecipe from './Toast.recipe';\nimport toggletipSlotRecipe from './Toggletip.recipe';\nimport tooltipSlotRecipe from './Tooltip.recipe';\nimport tourSlotRecipe from './Tour.recipe.ts';\nimport treeViewSlotRecipe from './TreeView.recipe.ts';\n\nconst slotRecipes = {\n accordion: accordionSlotRecipe,\n actionBar: actionBarSlotRecipe,\n alert: alertSlotRecipe,\n avatar: avatarSlotRecipe,\n breadcrumb: breadcrumbSlotRecipe,\n card: cardSlotRecipe,\n checkbox: checkboxSlotRecipe,\n codeSnippet: codeSnippetSlotRecipe,\n collapsible: collapsibleSlotRecipe,\n combobox: comboboxSlotRecipe,\n dataWidget: dataWidgetSlotRecipe,\n datePicker: datePickerSlotRecipe,\n datePickerSelect: datePickerSelectSlotRecipe,\n dialog: dialogSlotRecipe,\n draggableCard: draggableCardSlotRecipe,\n drawer: drawerSlotRecipe,\n emptyState: emptyStateSlotRecipe,\n expandableCard: expandableCardSlotRecipe,\n field: fieldSlotRecipe,\n groupHeading: groupHeadingSlotRecipe,\n fieldset: fieldsetSlotRecipe,\n fileUpload: fileUploadSlotRecipe,\n imageCropper: imageCropperSlotRecipe,\n inlineLoading: inlineLoadingSlotRecipe,\n list: listSlotRecipe,\n markdown: markdownSlotRecipe,\n markdownCard: markdownCardSlotRecipe,\n menu: menuSlotRecipe,\n multiselect: multiselectSlotRecipe,\n noteCard: noteCardSlotRecipe,\n nativeSelect: nativeSelectSlotRecipe,\n numberInput: numberInputSlotRecipe,\n overflowContent: overflowContentSlotRecipe,\n pageFooter: pageFooterSlotRecipe,\n pageHeader: pageHeaderSlotRecipe,\n pageSidebar: pageSidebarSlotRecipe,\n pagination: paginationSlotRecipe,\n paginationLoadMore: paginationLoadMoreSlotRecipe,\n popover: popoverSlotRecipe,\n progress: progressSlotRecipe,\n qrCode: qrCodeSlotRecipe,\n radioGroup: radioGroupSlotRecipe,\n ribbon: ribbonSlotRecipe,\n sectionHeading: sectionHeadingSlotRecipe,\n labeledData: labeledDataSlotRecipe,\n segmentGroup: segmentGroupSlotRecipe,\n select: selectSlotRecipe,\n settingsCard: settingsCardSlotRecipe,\n splitButton: splitButtonSlotRecipe,\n stat: statSlotRecipe,\n stepsCard: stepCardSlotRecipe,\n steps: stepsSlotRecipe,\n switch: switchSlotRecipe,\n table: tableSlotRecipe,\n tableCard: tableCardSlotRecipe,\n tabs: tabsSlotRecipe,\n tag: tagSlotRecipe,\n tagsInput: tagsInputSlotRecipe,\n textInput: textInputSlotRecipe,\n toast: toastSlotRecipe,\n toggletip: toggletipSlotRecipe,\n tooltip: tooltipSlotRecipe,\n tour: tourSlotRecipe,\n treeView: treeViewSlotRecipe,\n};\n\nexport default slotRecipes;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,IAAM,cAAc;CAClB,WAAW;CACX,WAAW;CACX,OAAO;CACP,QAAQ;CACR,YAAY;CACZ,MAAM;CACN,UAAU;CACV,aAAa;CACb,aAAa;CACb,UAAU;CACV,YAAY;CACZ,YAAY;CACZ,kBAAkB;CAClB,QAAQ;CACR,eAAe;CACf,QAAQ;CACR,YAAY;CACZ,gBAAgB;CAChB,OAAO;CACP,cAAc;CACd,UAAU;CACV,YAAY;CACZ,cAAc;CACd,eAAe;CACf,MAAM;CACN,UAAU;CACV,cAAc;CACd,MAAM;CACN,aAAa;CACb,UAAU;CACV,cAAc;CACd,aAAa;CACb,iBAAiB;CACjB,YAAY;CACZ,YAAY;CACZ,aAAa;CACb,YAAY;CACZ,oBAAoB;CACpB,SAAS;CACT,UAAU;CACV,QAAQ;CACR,YAAY;CACZ,QAAQ;CACR,gBAAgB;CAChB,aAAa;CACb,cAAc;CACd,QAAQ;CACR,cAAc;CACd,aAAa;CACb,MAAM;CACN,WAAW;CACX,OAAO;CACP,QAAQ;CACR,OAAO;CACP,WAAW;CACX,MAAM;CACN,KAAK;CACL,WAAW;CACX,WAAW;CACX,OAAO;CACP,WAAW;CACX,SAAS;CACT,MAAM;CACN,UAAU;AACZ"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit-v2",
3
3
  "private": false,
4
- "version": "0.3.462-beta.2927",
4
+ "version": "0.3.463",
5
5
  "description": "Bitrise Design System Components built with Chakra UI V3",
6
6
  "keywords": [
7
7
  "react",
@@ -1,37 +0,0 @@
1
- import { BoxProps } from '@chakra-ui/react/box';
2
- import { ReactNode } from 'react';
3
- export interface BitkitUISideNavProps extends Omit<BoxProps, 'children'> {
4
- children: ReactNode;
5
- /**
6
- * Forces the desktop rail open or shut, overriding the pointer and focus behaviour. Leave it
7
- * unset for the normal rail. Set it to `true` while something the rail does not know about is
8
- * anchored to it, such as a popover opened from the footer.
9
- */
10
- expanded?: boolean;
11
- /** Mobile drawer visibility. Controlled, because the header's menu button is what opens it. */
12
- open?: boolean;
13
- onOpenChange?: (open: boolean) => void;
14
- }
15
- export { uiSideNavRailWidth } from '../../theme/slot-recipes/UISideNav.recipe';
16
- export { type BitkitUISideNavBodyProps } from './UISideNavBody';
17
- export { type BitkitUISideNavFooterProps } from './UISideNavFooter';
18
- export { type BitkitUISideNavFooterHeadingProps } from './UISideNavFooterHeading';
19
- export { type BitkitUISideNavItemProps } from './UISideNavItem';
20
- export { type BitkitUISideNavLinkAsAnchorProps, type BitkitUISideNavLinkAsButtonProps, type BitkitUISideNavLinkProps, } from './UISideNavLink';
21
- export { type BitkitUISideNavWorkspaceProps, type BitkitUISideNavWorkspaceSelectorProps, } from './UISideNavWorkspaceSelector';
22
- declare const _default: import('react').ForwardRefExoticComponent<BitkitUISideNavProps & import('react').RefAttributes<HTMLElement>> & {
23
- Body: import('react').ForwardRefExoticComponent<import('./UISideNavBody').BitkitUISideNavBodyProps & import('react').RefAttributes<HTMLDivElement>>;
24
- Footer: import('react').ForwardRefExoticComponent<import('./UISideNavFooter').BitkitUISideNavFooterProps & import('react').RefAttributes<HTMLDivElement>>;
25
- FooterHeading: import('react').ForwardRefExoticComponent<import('./UISideNavFooterHeading').BitkitUISideNavFooterHeadingProps & import('react').RefAttributes<HTMLParagraphElement>>;
26
- Item: import('react').ForwardRefExoticComponent<import('./UISideNavItem').BitkitUISideNavItemProps & import('react').RefAttributes<HTMLAnchorElement>>;
27
- Link: import('react').ForwardRefExoticComponent<import('./UISideNavLink').BitkitUISideNavLinkProps & import('react').RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
28
- WorkspaceSelector: import('react').ForwardRefExoticComponent<Omit<import('@chakra-ui/react').SelectTriggerProps, "children" | "onChange"> & {
29
- children?: import('../BitkitSelectMenu/BitkitSelectMenuAction').BitkitSelectMenuActionChild;
30
- isLoading?: boolean;
31
- label?: string;
32
- onValueChange?: (value: string) => void;
33
- value?: string;
34
- workspaces: Array<import('./UISideNavWorkspaceSelector').BitkitUISideNavWorkspaceProps>;
35
- } & Omit<import('../BitkitSelectMenu/BitkitSelectMenu').BitkitSelectMenuSearchProps, "searchPlaceholder"> & import('../BitkitSelectMenu/BitkitSelectMenu').BitkitSelectMenuScrollProps & import('../BitkitSelectMenu/BitkitSelectMenu').BitkitSelectMenuEmptyStateProps & import('../BitkitSelectMenu/BitkitSelectMenu').BitkitSelectMenuErrorStateProps & import('react').RefAttributes<HTMLButtonElement>>;
36
- };
37
- export default _default;
@@ -1,167 +0,0 @@
1
- import { withSubComponents } from "../../utilities/withSubComponents.js";
2
- import BitkitCloseButton from "../BitkitCloseButton/BitkitCloseButton.js";
3
- import useResponsive from "../../hooks/useResponsive.js";
4
- import { UISideNavContextProvider } from "./UISideNavContext.js";
5
- import UISideNavBody from "./UISideNavBody.js";
6
- import UISideNavFooter from "./UISideNavFooter.js";
7
- import UISideNavFooterHeading from "./UISideNavFooterHeading.js";
8
- import UISideNavItem from "./UISideNavItem.js";
9
- import UISideNavLink from "./UISideNavLink.js";
10
- import UISideNavWorkspaceSelector from "./UISideNavWorkspaceSelector.js";
11
- import { uiSideNavRailWidth } from "../../theme/slot-recipes/UISideNav.recipe.js";
12
- import { Box } from "@chakra-ui/react/box";
13
- import { useSlotRecipe } from "@chakra-ui/react/styled-system";
14
- import { forwardRef, useEffect, useMemo, useRef, useState } from "react";
15
- import { jsx, jsxs } from "react/jsx-runtime";
16
- import { Portal } from "@chakra-ui/react/portal";
17
- import { mergeRefs } from "@chakra-ui/react";
18
- import { Drawer } from "@chakra-ui/react/drawer";
19
- //#region lib/components/BitkitUISideNav/BitkitUISideNav.tsx
20
- /**
21
- * The platform's primary navigation. It expects a workspace selector, a body of navigation
22
- * items, and an optional footer:
23
- *
24
- * ```tsx
25
- * <BitkitUISideNav open={open} onOpenChange={setOpen}>
26
- * <BitkitUISideNav.WorkspaceSelector
27
- * workspaces={workspaces}
28
- * value={workspace}
29
- * onValueChange={setWorkspace}
30
- * />
31
- * <BitkitUISideNav.Body>
32
- * <BitkitUISideNav.Item href="/dashboard" icon={IconDashboard} selectedIcon={IconDashboardFilled} selected>
33
- * Dashboard
34
- * </BitkitUISideNav.Item>
35
- * </BitkitUISideNav.Body>
36
- * <BitkitUISideNav.Footer>…</BitkitUISideNav.Footer>
37
- * </BitkitUISideNav>
38
- * ```
39
- *
40
- * On desktop it is a 72px rail that widens to 256px under the pointer and while anything inside
41
- * it holds keyboard focus. The rows are always laid out at the full width and clipped, so the
42
- * labels appear without any text reflowing. It will not collapse while the workspace menu is
43
- * open. There is no pin: the rail is the resting state.
44
- *
45
- * Below the `tablet` breakpoint it becomes an overlay drawer instead, opened by the header rather
46
- * than by hovering. Pass `open` and `onOpenChange`; they are ignored on desktop.
47
- *
48
- * It does not position itself. The consumer decides where it sits and how tall it is, which is
49
- * what lets a page slot it under a header of any height. The expanded rail overlays the page
50
- * rather than pushing it, so give it a `position` of your own and reserve 72px beside it.
51
- *
52
- * Descendants can read the current state with `useUISideNav()`.
53
- */
54
- var BitkitUISideNav = forwardRef((props, ref) => {
55
- const { children, css, expanded: expandedProp, onBlur, onFocus, onOpenChange, onPointerEnter, onPointerLeave, open = false, ...rest } = props;
56
- const { isMobile } = useResponsive();
57
- const [pointerInside, setPointerInside] = useState(false);
58
- const [focusInside, setFocusInside] = useState(false);
59
- const [menuOpen, setMenuOpen] = useState(false);
60
- const menuContainerRef = useRef(null);
61
- const navRef = useRef(null);
62
- const setNavRef = useMemo(() => mergeRefs(navRef, ref), [ref]);
63
- const styles = useSlotRecipe({ key: "uiSideNav" })({ layout: isMobile ? "drawer" : "rail" });
64
- const expanded = isMobile || (expandedProp ?? (pointerInside || focusInside || menuOpen));
65
- const tracksPointer = !isMobile && expandedProp === void 0;
66
- const isInsideNav = (event) => event.target instanceof Node && event.currentTarget.contains(event.target);
67
- const handleFocus = (event) => {
68
- onFocus?.(event);
69
- if (!tracksPointer || !isInsideNav(event)) return;
70
- if (!event.target.matches(":focus-visible")) return;
71
- setFocusInside(true);
72
- };
73
- const handleBlur = (event) => {
74
- onBlur?.(event);
75
- if (!tracksPointer || event.currentTarget.contains(event.relatedTarget)) return;
76
- setFocusInside(false);
77
- };
78
- const handlePointerEnter = (event) => {
79
- onPointerEnter?.(event);
80
- if (tracksPointer && isInsideNav(event)) setPointerInside(true);
81
- };
82
- const handlePointerLeave = (event) => {
83
- onPointerLeave?.(event);
84
- if (tracksPointer && isInsideNav(event)) setPointerInside(false);
85
- };
86
- useEffect(() => {
87
- if (!tracksPointer || !focusInside) return void 0;
88
- const syncFocusInside = () => {
89
- if (!navRef.current?.contains(document.activeElement)) setFocusInside(false);
90
- };
91
- document.addEventListener("focusin", syncFocusInside);
92
- return () => document.removeEventListener("focusin", syncFocusInside);
93
- }, [focusInside, tracksPointer]);
94
- useEffect(() => {
95
- if (!tracksPointer || !pointerInside) return void 0;
96
- const syncPointerInside = () => {
97
- if (!navRef.current?.matches(":hover")) setPointerInside(false);
98
- };
99
- document.addEventListener("pointerover", syncPointerInside);
100
- return () => document.removeEventListener("pointerover", syncPointerInside);
101
- }, [pointerInside, tracksPointer]);
102
- const nav = /* @__PURE__ */ jsx(Box, {
103
- ref: setNavRef,
104
- "aria-label": "Platform navigation",
105
- asChild: true,
106
- "data-expanded": expanded ? "" : void 0,
107
- ...rest,
108
- css: [styles.root, css],
109
- onBlur: handleBlur,
110
- onFocus: handleFocus,
111
- onPointerEnter: handlePointerEnter,
112
- onPointerLeave: handlePointerLeave,
113
- children: /* @__PURE__ */ jsx("nav", { children })
114
- });
115
- const context = useMemo(() => ({
116
- expanded,
117
- isMobile,
118
- menuContainerRef,
119
- setMenuOpen,
120
- styles
121
- }), [
122
- expanded,
123
- isMobile,
124
- styles
125
- ]);
126
- if (!isMobile) return /* @__PURE__ */ jsx(UISideNavContextProvider, {
127
- value: context,
128
- children: nav
129
- });
130
- return /* @__PURE__ */ jsx(UISideNavContextProvider, {
131
- value: context,
132
- children: /* @__PURE__ */ jsx(Drawer.Root, {
133
- onOpenChange: (details) => onOpenChange?.(details.open),
134
- open,
135
- children: /* @__PURE__ */ jsxs(Portal, { children: [/* @__PURE__ */ jsx(Drawer.Backdrop, { css: styles.backdrop }), /* @__PURE__ */ jsx(Drawer.Positioner, {
136
- css: styles.positioner,
137
- children: /* @__PURE__ */ jsxs(Drawer.Content, {
138
- ref: menuContainerRef,
139
- "aria-label": "Navigation",
140
- css: styles.content,
141
- children: [nav, /* @__PURE__ */ jsx(Box, {
142
- css: styles.closeButton,
143
- children: /* @__PURE__ */ jsx(BitkitCloseButton, {
144
- "aria-label": "Close navigation",
145
- colorVariant: "white",
146
- onClick: () => onOpenChange?.(false),
147
- size: "md"
148
- })
149
- })]
150
- })
151
- })] })
152
- })
153
- });
154
- });
155
- BitkitUISideNav.displayName = "BitkitUISideNav";
156
- var BitkitUISideNav_default = withSubComponents(BitkitUISideNav, {
157
- Body: UISideNavBody,
158
- Footer: UISideNavFooter,
159
- FooterHeading: UISideNavFooterHeading,
160
- Item: UISideNavItem,
161
- Link: UISideNavLink,
162
- WorkspaceSelector: UISideNavWorkspaceSelector
163
- });
164
- //#endregion
165
- export { BitkitUISideNav_default as default, uiSideNavRailWidth };
166
-
167
- //# sourceMappingURL=BitkitUISideNav.js.map