@bitrise/bitkit-v2 0.3.393 → 0.3.395

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 (95) hide show
  1. package/AGENTS.md +10 -9
  2. package/dist/components/BitkitDialog/BitkitDialog.d.ts +8 -2
  3. package/dist/components/BitkitDialog/BitkitDialog.js +6 -3
  4. package/dist/components/BitkitDialog/BitkitDialog.js.map +1 -1
  5. package/dist/components/BitkitDialog/BitkitFormDialog.d.ts +2 -1
  6. package/dist/components/BitkitDialog/BitkitFormDialog.js +6 -3
  7. package/dist/components/BitkitDialog/BitkitFormDialog.js.map +1 -1
  8. package/dist/components/BitkitDialog/{BitkitStepperDialog.d.ts → BitkitStepsDialog.d.ts} +17 -10
  9. package/dist/components/BitkitDialog/{BitkitStepperDialog.js → BitkitStepsDialog.js} +27 -16
  10. package/dist/components/BitkitDialog/BitkitStepsDialog.js.map +1 -0
  11. package/dist/components/BitkitDialog/{BitkitStepperDialogStep.d.ts → BitkitStepsDialogStep.d.ts} +5 -5
  12. package/dist/components/BitkitDialog/{BitkitStepperDialogStep.js → BitkitStepsDialogStep.js} +6 -6
  13. package/dist/components/BitkitDialog/BitkitStepsDialogStep.js.map +1 -0
  14. package/dist/components/BitkitDialog/DialogInner.d.ts +6 -5
  15. package/dist/components/BitkitDialog/DialogInner.js +9 -6
  16. package/dist/components/BitkitDialog/DialogInner.js.map +1 -1
  17. package/dist/components/BitkitDialog/DialogShell.d.ts +7 -4
  18. package/dist/components/BitkitDialog/DialogShell.js +6 -4
  19. package/dist/components/BitkitDialog/DialogShell.js.map +1 -1
  20. package/dist/components/BitkitDialog/{StepperContext.d.ts → StepsDialogContext.d.ts} +3 -3
  21. package/dist/components/BitkitDialog/StepsDialogContext.js +11 -0
  22. package/dist/components/BitkitDialog/StepsDialogContext.js.map +1 -0
  23. package/dist/components/index.d.ts +2 -2
  24. package/dist/icons/IconCopilot.d.ts +8 -0
  25. package/dist/icons/IconCopilot.js +31 -0
  26. package/dist/icons/IconCopilot.js.map +1 -0
  27. package/dist/icons/IconCursor.d.ts +8 -0
  28. package/dist/icons/IconCursor.js +31 -0
  29. package/dist/icons/IconCursor.js.map +1 -0
  30. package/dist/icons/IconKiroColor.d.ts +9 -0
  31. package/dist/icons/IconKiroColor.js +31 -0
  32. package/dist/icons/IconKiroColor.js.map +1 -0
  33. package/dist/icons/IconMcp.d.ts +8 -0
  34. package/dist/icons/IconMcp.js +31 -0
  35. package/dist/icons/IconMcp.js.map +1 -0
  36. package/dist/icons/IconTabPlus.d.ts +8 -0
  37. package/dist/icons/IconTabPlus.js +31 -0
  38. package/dist/icons/IconTabPlus.js.map +1 -0
  39. package/dist/icons/IconTerminalFilled.d.ts +8 -0
  40. package/dist/icons/IconTerminalFilled.js +31 -0
  41. package/dist/icons/IconTerminalFilled.js.map +1 -0
  42. package/dist/icons/IconVsCode.d.ts +8 -0
  43. package/dist/icons/IconVsCode.js +31 -0
  44. package/dist/icons/IconVsCode.js.map +1 -0
  45. package/dist/icons/IconWindsurf.d.ts +8 -0
  46. package/dist/icons/IconWindsurf.js +31 -0
  47. package/dist/icons/IconWindsurf.js.map +1 -0
  48. package/dist/icons/index.d.ts +8 -0
  49. package/dist/main.js +11 -3
  50. package/dist/svgs/16x16/icon-copilot-16.js +25 -0
  51. package/dist/svgs/16x16/icon-copilot-16.js.map +1 -0
  52. package/dist/svgs/16x16/icon-cursor-16.js +23 -0
  53. package/dist/svgs/16x16/icon-cursor-16.js.map +1 -0
  54. package/dist/svgs/16x16/icon-kiro-color-16.js +31 -0
  55. package/dist/svgs/16x16/icon-kiro-color-16.js.map +1 -0
  56. package/dist/svgs/16x16/icon-mcp-16.js +21 -0
  57. package/dist/svgs/16x16/icon-mcp-16.js.map +1 -0
  58. package/dist/svgs/16x16/icon-more-horizontal-16.js +1 -1
  59. package/dist/svgs/16x16/icon-more-horizontal-16.js.map +1 -1
  60. package/dist/svgs/16x16/icon-more-vertical-16.js +1 -1
  61. package/dist/svgs/16x16/icon-more-vertical-16.js.map +1 -1
  62. package/dist/svgs/16x16/icon-tab-plus-16.js +21 -0
  63. package/dist/svgs/16x16/icon-tab-plus-16.js.map +1 -0
  64. package/dist/svgs/16x16/icon-terminal-filled-16.js +25 -0
  65. package/dist/svgs/16x16/icon-terminal-filled-16.js.map +1 -0
  66. package/dist/svgs/16x16/icon-vs-code-16.js +23 -0
  67. package/dist/svgs/16x16/icon-vs-code-16.js.map +1 -0
  68. package/dist/svgs/16x16/icon-windsurf-16.js +21 -0
  69. package/dist/svgs/16x16/icon-windsurf-16.js.map +1 -0
  70. package/dist/svgs/24x24/icon-copilot-24.js +25 -0
  71. package/dist/svgs/24x24/icon-copilot-24.js.map +1 -0
  72. package/dist/svgs/24x24/icon-cursor-24.js +23 -0
  73. package/dist/svgs/24x24/icon-cursor-24.js.map +1 -0
  74. package/dist/svgs/24x24/icon-kiro-color-24.js +31 -0
  75. package/dist/svgs/24x24/icon-kiro-color-24.js.map +1 -0
  76. package/dist/svgs/24x24/icon-mcp-24.js +21 -0
  77. package/dist/svgs/24x24/icon-mcp-24.js.map +1 -0
  78. package/dist/svgs/24x24/icon-more-horizontal-24.js +1 -1
  79. package/dist/svgs/24x24/icon-more-horizontal-24.js.map +1 -1
  80. package/dist/svgs/24x24/icon-more-vertical-24.js +1 -1
  81. package/dist/svgs/24x24/icon-more-vertical-24.js.map +1 -1
  82. package/dist/svgs/24x24/icon-tab-plus-24.js +21 -0
  83. package/dist/svgs/24x24/icon-tab-plus-24.js.map +1 -0
  84. package/dist/svgs/24x24/icon-terminal-filled-24.js +25 -0
  85. package/dist/svgs/24x24/icon-terminal-filled-24.js.map +1 -0
  86. package/dist/svgs/24x24/icon-vs-code-24.js +23 -0
  87. package/dist/svgs/24x24/icon-vs-code-24.js.map +1 -0
  88. package/dist/svgs/24x24/icon-windsurf-24.js +21 -0
  89. package/dist/svgs/24x24/icon-windsurf-24.js.map +1 -0
  90. package/docs/v1-to-v2-migration-guide.md +27 -3
  91. package/package.json +1 -1
  92. package/dist/components/BitkitDialog/BitkitStepperDialog.js.map +0 -1
  93. package/dist/components/BitkitDialog/BitkitStepperDialogStep.js.map +0 -1
  94. package/dist/components/BitkitDialog/StepperContext.js +0 -11
  95. package/dist/components/BitkitDialog/StepperContext.js.map +0 -1
package/AGENTS.md CHANGED
@@ -138,22 +138,23 @@ Bitkit components use consistent prop names across the library:
138
138
  - **Three dialog components, one shell** — pick by intent, never reach for low-level dialog primitives (there are none exported):
139
139
  - `BitkitDialog` — header (title + close) + body (`children`) + footer. The body is the dialog's `children`. The footer is two slot props: `footerButtons` (action buttons, auto-wrapped in the standard right-aligned row — no manual wrapper) and `footerContent` (arbitrary content rendered raw, e.g. an inline `BitkitAlert`). Both can be combined (content first, then buttons); omit both for a passive dialog with no footer.
140
140
  - `BitkitFormDialog` — same API as `BitkitDialog`, but the whole content is a `<form>`, so a `type="submit"` button in `footerButtons` submits natively. On top of the shared dialog props it takes `onSubmit` (correctly typed as `FormEvent<HTMLFormElement>`) and `noValidate`, and nothing else off the native `<form>`.
141
- - `BitkitStepperDialog` — a multi-step dialog. Pass `BitkitStepperDialog.Step` children (each with `label` for the steps header, `title`/`description` for the step body). It owns the step state and auto-renders the steps header; wire footer navigation via the `useStepperDialog()` hook (`{ step, setStep, next, prev, goTo, isFirst, isLast, totalSteps }`) from a component rendered in the footer slot. Controlled via `step`/`onStepChange`, or uncontrolled via `defaultStep`.
141
+ - `BitkitStepsDialog` — a multi-step dialog. Pass `BitkitStepsDialog.Step` children (each with `label` for the steps header, `title`/`description` for the step body). It owns the step state and auto-renders the steps header; build the step navigation with the `useStepsDialog()` hook (`{ step, setStep, next, prev, goTo, isFirst, isLast, totalSteps }`) and pass it as `footerButtons`, which the dialog lays out with the leading action opposite the step navigation. `footerContent` still renders raw above it. Controlled via `step`/`onStepChange`, or uncontrolled via `defaultStep`.
142
142
  - All three expose `.ActionTrigger` (a thin re-export of Chakra's `Dialog.ActionTrigger`): wrap a footer button in it to close the dialog on click — the default way to dismiss a trigger-based (uncontrolled) dialog without wiring `open` state.
143
143
  ```tsx
144
144
  <BitkitDialog footerButtons={<><Button variant="secondary">Cancel</Button><Button variant="primary">Save</Button></>} open={open} onOpenChange={…} title="Title">Body</BitkitDialog>
145
145
  <BitkitFormDialog onSubmit={handleSubmit} open={open} onOpenChange={…} title="Edit" footerButtons={<Button type="submit">Save</Button>}>…fields…</BitkitFormDialog>
146
- <BitkitStepperDialog footerContent={<StepperNav />} title="Wizard" trigger={<Button>Open</Button>}>
147
- <BitkitStepperDialog.Step label="Account" title="Create account">…</BitkitStepperDialog.Step>
148
- <BitkitStepperDialog.Step label="Confirm" title="Confirm">…</BitkitStepperDialog.Step>
149
- </BitkitStepperDialog>
146
+ <BitkitStepsDialog footerButtons={<StepsNav />} title="Wizard" trigger={<Button>Open</Button>}>
147
+ <BitkitStepsDialog.Step label="Account" title="Create account">…</BitkitStepsDialog.Step>
148
+ <BitkitStepsDialog.Step label="Confirm" title="Confirm">…</BitkitStepsDialog.Step>
149
+ </BitkitStepsDialog>
150
150
  ```
151
- For closing on click, use controlled `open`/`onOpenChange`, or wrap a button in `BitkitDialog.ActionTrigger` (and the `BitkitFormDialog.ActionTrigger` / `BitkitStepperDialog.ActionTrigger` equivalents). For a fully custom dialog, compose raw Chakra `Dialog.*` atoms directly.
151
+ For closing on click, use controlled `open`/`onOpenChange`, or wrap a button in `BitkitDialog.ActionTrigger` (and the `BitkitFormDialog.ActionTrigger` / `BitkitStepsDialog.ActionTrigger` equivalents). For a fully custom dialog, compose raw Chakra `Dialog.*` atoms directly.
152
152
 
153
153
  All three forward `data-*` attributes to the element carrying `role="dialog"` (`data-testid`, `data-clarity-unmask`), and nothing else — style props, `className` and `id` don't pass through.
154
- - **Dialog non-dismissible + post-close callback** — works on all three: pass `closable={false}` to make the dialog fully non-dismissible (the close button is rendered but disabled, ESC is blocked, outside clicks are ignored — the only way out is an explicit footer action). Pass `onExitComplete` to run code after the close animation finishes (navigation, focus restoration, cleanup):
154
+ - **Dialog non-dismissible + post-close callback** — works on all three: pass `dismissible={false}` to remove every route out that skips a decision (no close button, ESC blocked, outside clicks ignored — the only way out is an explicit footer action). Outside clicks never dismiss a Bitkit dialog, `dismissible` or not. While a footer action is in flight, pass `state="loading"` on the dialog next to the button's own `state="loading"`: the close button stays in place but goes disabled, ESC is blocked, and the dialog gets `aria-busy`. Pass `onExitComplete` to run code after the close animation finishes (navigation, focus restoration, cleanup):
155
155
  ```tsx
156
- <BitkitDialog closable={false} open={open} onOpenChange={…} title="Action required">…</BitkitDialog>
156
+ <BitkitDialog dismissible={false} open={open} onOpenChange={…} title="Action required">…</BitkitDialog>
157
+ <BitkitDialog state={isSaving ? 'loading' : undefined} open={open} onOpenChange={…} title="Save changes">…</BitkitDialog>
157
158
  <BitkitDialog open={open} onExitComplete={() => navigate('/next')} onOpenChange={…} title="…">…</BitkitDialog>
158
159
  ```
159
160
 
@@ -227,7 +228,7 @@ Bitkit components use consistent prop names across the library:
227
228
  This holds for form fields (`BitkitTextInput`, `BitkitSelect`, `BitkitNativeSelect`, `BitkitCombobox`, etc.), buttons (`BitkitButton`, `BitkitIconButton`, etc.), and most other components — they all forward Chakra style props through to the rendered root element.
228
229
 
229
230
  **Exceptions** — a few component groups intentionally own their own layout and don't accept arbitrary style props from outside:
230
- - Page-level overlays: `BitkitDialog`, `BitkitFormDialog`, `BitkitStepperDialog`, `BitkitDrawer`, `BitkitCalendar`, `BitkitTour` — they own their layout; where it's configurable at all, it's through their own props (`size`, `maxHeight`, …), not style props from outside.
231
+ - Page-level overlays: `BitkitDialog`, `BitkitFormDialog`, `BitkitStepsDialog`, `BitkitDrawer`, `BitkitCalendar`, `BitkitTour` — they own their layout; where it's configurable at all, it's through their own props (`size`, `maxHeight`, …), not style props from outside.
231
232
  - Floating positioned components: `BitkitTooltip`, `BitkitLabelTooltip`, `BitkitDefinitionTooltip`, `BitkitOverflowTooltip`, `BitkitToast`, `BitkitActionMenu`, `BitkitSelectMenu`, `BitkitMultiselectMenu` — their layout is positioned automatically; pass styling via the component's own props instead of a wrapper.
232
233
 
233
234
  > **For everything else, if a style prop doesn't take effect on a Bitkit component, that's a bug in the component, not a styling task.** Stop, tell the user something looks off in Bitkit so they can flag it to the Bitkit team — don't quietly add a `<Box>` workaround. Each silent workaround hides a regression and bakes the wrapper pattern into the codebase.
@@ -4,7 +4,8 @@ import { BitkitDataAttributes } from '../../utilities/dataAttributes';
4
4
  import { DialogShellProps } from './DialogShell';
5
5
  export type BitkitDialogProps = {
6
6
  children?: ReactNode;
7
- closable?: boolean;
7
+ /** Set to `false` to remove every dismiss route that skips a decision: no close button, no ESC. */
8
+ dismissible?: boolean;
8
9
  footerButtons?: ReactNode;
9
10
  footerContent?: ReactNode;
10
11
  headerLabel?: string;
@@ -20,12 +21,17 @@ export type BitkitDialogProps = {
20
21
  scrollBehavior?: 'inside' | 'outside';
21
22
  showScrollGradient?: boolean;
22
23
  size?: 'sm' | 'md' | 'lg' | 'full';
24
+ /**
25
+ * `loading` locks the dialog while a background action runs: the close button stays in place but
26
+ * disabled, and ESC is blocked. Use it alongside the footer button's own `state="loading"`.
27
+ */
28
+ state?: 'loading';
23
29
  title: ReactNode;
24
30
  trigger?: ReactNode;
25
31
  variant?: 'overflowContent';
26
32
  } & BitkitDataAttributes;
27
33
  declare const _default: {
28
- ({ children, closable, footerButtons, footerContent, headerLabel, initialFocusEl, maxHeight, onExitComplete, onOpenChange, open, preventScroll, scrollBehavior, showScrollGradient, size, title, trigger, variant, ...dataAttributes }: BitkitDialogProps): import("react").JSX.Element;
34
+ ({ children, dismissible, footerButtons, footerContent, headerLabel, initialFocusEl, maxHeight, onExitComplete, onOpenChange, open, preventScroll, scrollBehavior, showScrollGradient, size, state, title, trigger, variant, ...dataAttributes }: BitkitDialogProps): import("react").JSX.Element;
29
35
  displayName: string;
30
36
  } & {
31
37
  ActionTrigger: import('react').ForwardRefExoticComponent<Dialog.ActionTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -4,8 +4,8 @@ import DialogShell from "./DialogShell.js";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import { Dialog } from "@chakra-ui/react/dialog";
6
6
  //#region lib/components/BitkitDialog/BitkitDialog.tsx
7
- var BitkitDialog = ({ children, closable = true, footerButtons, footerContent, headerLabel, initialFocusEl, maxHeight, onExitComplete, onOpenChange, open, preventScroll, scrollBehavior, showScrollGradient, size, title, trigger, variant, ...dataAttributes }) => /* @__PURE__ */ jsx(DialogShell, {
8
- closable,
7
+ var BitkitDialog = ({ children, dismissible = true, footerButtons, footerContent, headerLabel, initialFocusEl, maxHeight, onExitComplete, onOpenChange, open, preventScroll, scrollBehavior, showScrollGradient, size, state, title, trigger, variant, ...dataAttributes }) => /* @__PURE__ */ jsx(DialogShell, {
8
+ dismissible,
9
9
  initialFocusEl,
10
10
  onExitComplete,
11
11
  onOpenChange,
@@ -13,18 +13,21 @@ var BitkitDialog = ({ children, closable = true, footerButtons, footerContent, h
13
13
  preventScroll,
14
14
  scrollBehavior,
15
15
  size,
16
+ state,
16
17
  trigger,
17
18
  variant,
18
19
  children: /* @__PURE__ */ jsx(Dialog.Content, {
20
+ "aria-busy": state === "loading" || void 0,
19
21
  maxHeight,
20
22
  ...dataAttributes,
21
23
  children: /* @__PURE__ */ jsx(DialogInner, {
22
- closable,
24
+ dismissible,
23
25
  footerButtons,
24
26
  footerContent,
25
27
  headerLabel,
26
28
  scrollBehavior,
27
29
  showScrollGradient,
30
+ state,
28
31
  title,
29
32
  variant,
30
33
  children
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitDialog.js","names":[],"sources":["../../../lib/components/BitkitDialog/BitkitDialog.tsx"],"sourcesContent":["import { Dialog } from '@chakra-ui/react/dialog';\nimport { type ReactNode } from 'react';\n\nimport { type BitkitDataAttributes } from '../../utilities/dataAttributes';\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport DialogInner from './DialogInner';\nimport DialogShell, { type DialogShellProps } from './DialogShell';\n\nexport type BitkitDialogProps = {\n children?: ReactNode;\n closable?: boolean;\n footerButtons?: ReactNode;\n footerContent?: ReactNode;\n headerLabel?: string;\n /** Element to focus when the dialog opens, instead of the first focusable one. */\n initialFocusEl?: DialogShellProps['initialFocusEl'];\n maxHeight?: string;\n onExitComplete?: () => void;\n onOpenChange?: (details: { open: boolean }) => void;\n open?: boolean;\n preventScroll?: boolean;\n scrollBehavior?: 'inside' | 'outside';\n showScrollGradient?: boolean;\n size?: 'sm' | 'md' | 'lg' | 'full';\n title: ReactNode;\n trigger?: ReactNode;\n variant?: 'overflowContent';\n // Data attributes are forwarded to the element carrying `role=\"dialog\"`, and nothing else is —\n // style props, `className` and `id` don't pass through.\n} & BitkitDataAttributes;\n\nconst BitkitDialog = ({\n children,\n closable = true,\n footerButtons,\n footerContent,\n headerLabel,\n initialFocusEl,\n maxHeight,\n onExitComplete,\n onOpenChange,\n open,\n preventScroll,\n scrollBehavior,\n showScrollGradient,\n size,\n title,\n trigger,\n variant,\n ...dataAttributes\n}: BitkitDialogProps) => (\n <DialogShell\n closable={closable}\n initialFocusEl={initialFocusEl}\n onExitComplete={onExitComplete}\n onOpenChange={onOpenChange}\n open={open}\n preventScroll={preventScroll}\n scrollBehavior={scrollBehavior}\n size={size}\n trigger={trigger}\n variant={variant}\n >\n <Dialog.Content maxHeight={maxHeight} {...dataAttributes}>\n <DialogInner\n closable={closable}\n footerButtons={footerButtons}\n footerContent={footerContent}\n headerLabel={headerLabel}\n scrollBehavior={scrollBehavior}\n showScrollGradient={showScrollGradient}\n title={title}\n variant={variant}\n >\n {children}\n </DialogInner>\n </Dialog.Content>\n </DialogShell>\n);\n\nBitkitDialog.displayName = 'BitkitDialog';\n\nexport default withSubComponents(BitkitDialog, { ActionTrigger: Dialog.ActionTrigger });\n"],"mappings":";;;;;;AA+BA,IAAM,gBAAgB,EACpB,UACA,WAAW,MACX,eACA,eACA,aACA,gBACA,WACA,gBACA,cACA,MACA,eACA,gBACA,oBACA,MACA,OACA,SACA,SACA,GAAG,qBAEH,oBAAC,aAAD;CACY;CACM;CACA;CACF;CACR;CACS;CACC;CACV;CACG;CACA;CAET,UAAA,oBAAC,OAAO,SAAR;EAA2B;EAAW,GAAI;EACxC,UAAA,oBAAC,aAAD;GACY;GACK;GACA;GACF;GACG;GACI;GACb;GACE;GAER;EACU,CAAA;CACC,CAAA;AACL,CAAA;AAGf,aAAa,cAAc;AAE3B,IAAA,uBAAe,kBAAkB,cAAc,EAAE,eAAe,OAAO,cAAc,CAAC"}
1
+ {"version":3,"file":"BitkitDialog.js","names":[],"sources":["../../../lib/components/BitkitDialog/BitkitDialog.tsx"],"sourcesContent":["import { Dialog } from '@chakra-ui/react/dialog';\nimport { type ReactNode } from 'react';\n\nimport { type BitkitDataAttributes } from '../../utilities/dataAttributes';\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport DialogInner from './DialogInner';\nimport DialogShell, { type DialogShellProps } from './DialogShell';\n\nexport type BitkitDialogProps = {\n children?: ReactNode;\n /** Set to `false` to remove every dismiss route that skips a decision: no close button, no ESC. */\n dismissible?: boolean;\n footerButtons?: ReactNode;\n footerContent?: ReactNode;\n headerLabel?: string;\n /** Element to focus when the dialog opens, instead of the first focusable one. */\n initialFocusEl?: DialogShellProps['initialFocusEl'];\n maxHeight?: string;\n onExitComplete?: () => void;\n onOpenChange?: (details: { open: boolean }) => void;\n open?: boolean;\n preventScroll?: boolean;\n scrollBehavior?: 'inside' | 'outside';\n showScrollGradient?: boolean;\n size?: 'sm' | 'md' | 'lg' | 'full';\n /**\n * `loading` locks the dialog while a background action runs: the close button stays in place but\n * disabled, and ESC is blocked. Use it alongside the footer button's own `state=\"loading\"`.\n */\n state?: 'loading';\n title: ReactNode;\n trigger?: ReactNode;\n variant?: 'overflowContent';\n // Data attributes are forwarded to the element carrying `role=\"dialog\"`, and nothing else is —\n // style props, `className` and `id` don't pass through.\n} & BitkitDataAttributes;\n\nconst BitkitDialog = ({\n children,\n dismissible = true,\n footerButtons,\n footerContent,\n headerLabel,\n initialFocusEl,\n maxHeight,\n onExitComplete,\n onOpenChange,\n open,\n preventScroll,\n scrollBehavior,\n showScrollGradient,\n size,\n state,\n title,\n trigger,\n variant,\n ...dataAttributes\n}: BitkitDialogProps) => (\n <DialogShell\n dismissible={dismissible}\n initialFocusEl={initialFocusEl}\n onExitComplete={onExitComplete}\n onOpenChange={onOpenChange}\n open={open}\n preventScroll={preventScroll}\n scrollBehavior={scrollBehavior}\n size={size}\n state={state}\n trigger={trigger}\n variant={variant}\n >\n <Dialog.Content aria-busy={state === 'loading' || undefined} maxHeight={maxHeight} {...dataAttributes}>\n <DialogInner\n dismissible={dismissible}\n footerButtons={footerButtons}\n footerContent={footerContent}\n headerLabel={headerLabel}\n scrollBehavior={scrollBehavior}\n showScrollGradient={showScrollGradient}\n state={state}\n title={title}\n variant={variant}\n >\n {children}\n </DialogInner>\n </Dialog.Content>\n </DialogShell>\n);\n\nBitkitDialog.displayName = 'BitkitDialog';\n\nexport default withSubComponents(BitkitDialog, { ActionTrigger: Dialog.ActionTrigger });\n"],"mappings":";;;;;;AAqCA,IAAM,gBAAgB,EACpB,UACA,cAAc,MACd,eACA,eACA,aACA,gBACA,WACA,gBACA,cACA,MACA,eACA,gBACA,oBACA,MACA,OACA,OACA,SACA,SACA,GAAG,qBAEH,oBAAC,aAAD;CACe;CACG;CACA;CACF;CACR;CACS;CACC;CACV;CACC;CACE;CACA;CAET,UAAA,oBAAC,OAAO,SAAR;EAAgB,aAAW,UAAU,aAAa,KAAA;EAAsB;EAAW,GAAI;EACrF,UAAA,oBAAC,aAAD;GACe;GACE;GACA;GACF;GACG;GACI;GACb;GACA;GACE;GAER;EACU,CAAA;CACC,CAAA;AACL,CAAA;AAGf,aAAa,cAAc;AAE3B,IAAA,uBAAe,kBAAkB,cAAc,EAAE,eAAe,OAAO,cAAc,CAAC"}
@@ -8,7 +8,7 @@ export type BitkitFormDialogProps = BitkitDialogProps & {
8
8
  };
9
9
  declare const _default: import('react').ForwardRefExoticComponent<{
10
10
  children?: import('react').ReactNode;
11
- closable?: boolean;
11
+ dismissible?: boolean;
12
12
  footerButtons?: import('react').ReactNode;
13
13
  footerContent?: import('react').ReactNode;
14
14
  headerLabel?: string;
@@ -23,6 +23,7 @@ declare const _default: import('react').ForwardRefExoticComponent<{
23
23
  scrollBehavior?: "inside" | "outside";
24
24
  showScrollGradient?: boolean;
25
25
  size?: "sm" | "md" | "lg" | "full";
26
+ state?: "loading";
26
27
  title: import('react').ReactNode;
27
28
  trigger?: import('react').ReactNode;
28
29
  variant?: "overflowContent";
@@ -12,9 +12,9 @@ import { Dialog } from "@chakra-ui/react/dialog";
12
12
  * `onSubmit` and `noValidate` — no Chakra style props, no `className`, no `id`.
13
13
  */
14
14
  var BitkitFormDialog = forwardRef((props, ref) => {
15
- const { children, closable = true, footerButtons, footerContent, headerLabel, initialFocusEl, maxHeight, noValidate, onExitComplete, onOpenChange, onSubmit, open, preventScroll, scrollBehavior, showScrollGradient, size, title, trigger, variant, ...dataAttributes } = props;
15
+ const { children, dismissible = true, footerButtons, footerContent, headerLabel, initialFocusEl, maxHeight, noValidate, onExitComplete, onOpenChange, onSubmit, open, preventScroll, scrollBehavior, showScrollGradient, size, state, title, trigger, variant, ...dataAttributes } = props;
16
16
  return /* @__PURE__ */ jsx(DialogShell, {
17
- closable,
17
+ dismissible,
18
18
  initialFocusEl,
19
19
  onExitComplete,
20
20
  onOpenChange,
@@ -22,9 +22,11 @@ var BitkitFormDialog = forwardRef((props, ref) => {
22
22
  preventScroll,
23
23
  scrollBehavior,
24
24
  size,
25
+ state,
25
26
  trigger,
26
27
  variant,
27
28
  children: /* @__PURE__ */ jsx(Dialog.Content, {
29
+ "aria-busy": state === "loading" || void 0,
28
30
  asChild: true,
29
31
  maxHeight,
30
32
  ...dataAttributes,
@@ -33,12 +35,13 @@ var BitkitFormDialog = forwardRef((props, ref) => {
33
35
  noValidate,
34
36
  onSubmit,
35
37
  children: /* @__PURE__ */ jsx(DialogInner, {
36
- closable,
38
+ dismissible,
37
39
  footerButtons,
38
40
  footerContent,
39
41
  headerLabel,
40
42
  scrollBehavior,
41
43
  showScrollGradient,
44
+ state,
42
45
  title,
43
46
  variant,
44
47
  children
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitFormDialog.js","names":[],"sources":["../../../lib/components/BitkitDialog/BitkitFormDialog.tsx"],"sourcesContent":["import { Dialog } from '@chakra-ui/react/dialog';\nimport { chakra } from '@chakra-ui/react/styled-system';\nimport { type FormEventHandler, forwardRef } from 'react';\n\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport { type BitkitDialogProps } from './BitkitDialog';\nimport DialogInner from './DialogInner';\nimport DialogShell from './DialogShell';\n\nexport type BitkitFormDialogProps = BitkitDialogProps & {\n /** Skips the browser's native constraint validation on submit. */\n noValidate?: boolean;\n onSubmit?: FormEventHandler<HTMLFormElement>;\n};\n\n/**\n * A dialog whose entire content is a `<form>`, so a `type=\"submit\"` button in the footer submits\n * natively. Like the other dialog overlays it owns its own layout, so the form surface is just\n * `onSubmit` and `noValidate` — no Chakra style props, no `className`, no `id`.\n */\nconst BitkitFormDialog = forwardRef<HTMLFormElement, BitkitFormDialogProps>((props, ref) => {\n const {\n children,\n closable = true,\n footerButtons,\n footerContent,\n headerLabel,\n initialFocusEl,\n maxHeight,\n noValidate,\n onExitComplete,\n onOpenChange,\n onSubmit,\n open,\n preventScroll,\n scrollBehavior,\n showScrollGradient,\n size,\n title,\n trigger,\n variant,\n ...dataAttributes\n } = props;\n\n return (\n <DialogShell\n closable={closable}\n initialFocusEl={initialFocusEl}\n onExitComplete={onExitComplete}\n onOpenChange={onOpenChange}\n open={open}\n preventScroll={preventScroll}\n scrollBehavior={scrollBehavior}\n size={size}\n trigger={trigger}\n variant={variant}\n >\n <Dialog.Content asChild maxHeight={maxHeight} {...dataAttributes}>\n <chakra.form ref={ref} noValidate={noValidate} onSubmit={onSubmit}>\n <DialogInner\n closable={closable}\n footerButtons={footerButtons}\n footerContent={footerContent}\n headerLabel={headerLabel}\n scrollBehavior={scrollBehavior}\n showScrollGradient={showScrollGradient}\n title={title}\n variant={variant}\n >\n {children}\n </DialogInner>\n </chakra.form>\n </Dialog.Content>\n </DialogShell>\n );\n});\n\nBitkitFormDialog.displayName = 'BitkitFormDialog';\n\nexport default withSubComponents(BitkitFormDialog, { ActionTrigger: Dialog.ActionTrigger });\n"],"mappings":";;;;;;;;;;;;;AAoBA,IAAM,mBAAmB,YAAoD,OAAO,QAAQ;CAC1F,MAAM,EACJ,UACA,WAAW,MACX,eACA,eACA,aACA,gBACA,WACA,YACA,gBACA,cACA,UACA,MACA,eACA,gBACA,oBACA,MACA,OACA,SACA,SACA,GAAG,mBACD;CAEJ,OACE,oBAAC,aAAD;EACY;EACM;EACA;EACF;EACR;EACS;EACC;EACV;EACG;EACA;EAET,UAAA,oBAAC,OAAO,SAAR;GAAgB,SAAA;GAAmB;GAAW,GAAI;GAChD,UAAA,oBAAC,OAAO,MAAR;IAAkB;IAAiB;IAAsB;IACvD,UAAA,oBAAC,aAAD;KACY;KACK;KACA;KACF;KACG;KACI;KACb;KACE;KAER;IACU,CAAA;GACF,CAAA;EACC,CAAA;CACL,CAAA;AAEjB,CAAC;AAED,iBAAiB,cAAc;AAE/B,IAAA,2BAAe,kBAAkB,kBAAkB,EAAE,eAAe,OAAO,cAAc,CAAC"}
1
+ {"version":3,"file":"BitkitFormDialog.js","names":[],"sources":["../../../lib/components/BitkitDialog/BitkitFormDialog.tsx"],"sourcesContent":["import { Dialog } from '@chakra-ui/react/dialog';\nimport { chakra } from '@chakra-ui/react/styled-system';\nimport { type FormEventHandler, forwardRef } from 'react';\n\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport { type BitkitDialogProps } from './BitkitDialog';\nimport DialogInner from './DialogInner';\nimport DialogShell from './DialogShell';\n\nexport type BitkitFormDialogProps = BitkitDialogProps & {\n /** Skips the browser's native constraint validation on submit. */\n noValidate?: boolean;\n onSubmit?: FormEventHandler<HTMLFormElement>;\n};\n\n/**\n * A dialog whose entire content is a `<form>`, so a `type=\"submit\"` button in the footer submits\n * natively. Like the other dialog overlays it owns its own layout, so the form surface is just\n * `onSubmit` and `noValidate` — no Chakra style props, no `className`, no `id`.\n */\nconst BitkitFormDialog = forwardRef<HTMLFormElement, BitkitFormDialogProps>((props, ref) => {\n const {\n children,\n dismissible = true,\n footerButtons,\n footerContent,\n headerLabel,\n initialFocusEl,\n maxHeight,\n noValidate,\n onExitComplete,\n onOpenChange,\n onSubmit,\n open,\n preventScroll,\n scrollBehavior,\n showScrollGradient,\n size,\n state,\n title,\n trigger,\n variant,\n ...dataAttributes\n } = props;\n\n return (\n <DialogShell\n dismissible={dismissible}\n initialFocusEl={initialFocusEl}\n onExitComplete={onExitComplete}\n onOpenChange={onOpenChange}\n open={open}\n preventScroll={preventScroll}\n scrollBehavior={scrollBehavior}\n size={size}\n state={state}\n trigger={trigger}\n variant={variant}\n >\n <Dialog.Content aria-busy={state === 'loading' || undefined} asChild maxHeight={maxHeight} {...dataAttributes}>\n <chakra.form ref={ref} noValidate={noValidate} onSubmit={onSubmit}>\n <DialogInner\n dismissible={dismissible}\n footerButtons={footerButtons}\n footerContent={footerContent}\n headerLabel={headerLabel}\n scrollBehavior={scrollBehavior}\n showScrollGradient={showScrollGradient}\n state={state}\n title={title}\n variant={variant}\n >\n {children}\n </DialogInner>\n </chakra.form>\n </Dialog.Content>\n </DialogShell>\n );\n});\n\nBitkitFormDialog.displayName = 'BitkitFormDialog';\n\nexport default withSubComponents(BitkitFormDialog, { ActionTrigger: Dialog.ActionTrigger });\n"],"mappings":";;;;;;;;;;;;;AAoBA,IAAM,mBAAmB,YAAoD,OAAO,QAAQ;CAC1F,MAAM,EACJ,UACA,cAAc,MACd,eACA,eACA,aACA,gBACA,WACA,YACA,gBACA,cACA,UACA,MACA,eACA,gBACA,oBACA,MACA,OACA,OACA,SACA,SACA,GAAG,mBACD;CAEJ,OACE,oBAAC,aAAD;EACe;EACG;EACA;EACF;EACR;EACS;EACC;EACV;EACC;EACE;EACA;EAET,UAAA,oBAAC,OAAO,SAAR;GAAgB,aAAW,UAAU,aAAa,KAAA;GAAW,SAAA;GAAmB;GAAW,GAAI;GAC7F,UAAA,oBAAC,OAAO,MAAR;IAAkB;IAAiB;IAAsB;IACvD,UAAA,oBAAC,aAAD;KACe;KACE;KACA;KACF;KACG;KACI;KACb;KACA;KACE;KAER;IACU,CAAA;GACF,CAAA;EACC,CAAA;CACL,CAAA;AAEjB,CAAC;AAED,iBAAiB,cAAc;AAE/B,IAAA,2BAAe,kBAAkB,kBAAkB,EAAE,eAAe,OAAO,cAAc,CAAC"}
@@ -1,22 +1,24 @@
1
1
  import { Dialog } from '@chakra-ui/react/dialog';
2
2
  import { ReactNode } from 'react';
3
3
  import { BitkitDataAttributes } from '../../utilities/dataAttributes';
4
- import { BitkitStepperDialogStepProps } from './BitkitStepperDialogStep';
4
+ import { BitkitStepsDialogStepProps } from './BitkitStepsDialogStep';
5
5
  import { DialogShellProps } from './DialogShell';
6
- export { useStepperDialog } from './StepperContext';
7
- export type BitkitStepperDialogProps = {
8
- /** `BitkitStepperDialog.Step` children, one per step. */
6
+ export { useStepsDialog } from './StepsDialogContext';
7
+ export type BitkitStepsDialogProps = {
8
+ /** `BitkitStepsDialog.Step` children, one per step. */
9
9
  children: ReactNode;
10
- closable?: boolean;
11
10
  /** Initial step when uncontrolled. Resets to this when the dialog closes. */
12
11
  defaultStep?: number;
12
+ /** Set to `false` to remove every dismiss route that skips a decision: no close button, no ESC. */
13
+ dismissible?: boolean;
13
14
  /** Element to focus when the dialog opens, instead of the first focusable one. */
14
15
  initialFocusEl?: DialogShellProps['initialFocusEl'];
15
16
  /**
16
- * Footer content rendered raw. Stepper footers are space-between (Cancel left, Prev/Next right),
17
- * so build the nav row here with `useStepperDialog()` — there is no `footerButtons` slot, which
18
- * would force right-alignment.
17
+ * The step navigation, built with `useStepsDialog()`. Pass the buttons themselves: the dialog lays
18
+ * them out the way the design asks for, leading action on the left, the step navigation opposite.
19
19
  */
20
+ footerButtons?: ReactNode;
21
+ /** Arbitrary content rendered raw inside the footer, above `footerButtons` (e.g. a `BitkitAlert`). */
20
22
  footerContent?: ReactNode;
21
23
  headerLabel?: string;
22
24
  maxHeight?: string;
@@ -31,6 +33,11 @@ export type BitkitStepperDialogProps = {
31
33
  scrollBehavior?: 'inside' | 'outside';
32
34
  showScrollGradient?: boolean;
33
35
  size?: 'sm' | 'md' | 'lg' | 'full';
36
+ /**
37
+ * `loading` locks the dialog while a background action runs: the close button stays in place but
38
+ * disabled, and ESC is blocked. Use it alongside the footer button's own `state="loading"`.
39
+ */
40
+ state?: 'loading';
34
41
  /** Controlled active step. Omit for uncontrolled (see `defaultStep`). */
35
42
  step?: number;
36
43
  title: ReactNode;
@@ -38,12 +45,12 @@ export type BitkitStepperDialogProps = {
38
45
  variant?: 'overflowContent';
39
46
  } & BitkitDataAttributes;
40
47
  declare const _default: {
41
- ({ children, closable, defaultStep, initialFocusEl, footerContent, headerLabel, maxHeight, onExitComplete, onOpenChange, onStepChange, open, preventScroll, scrollBehavior, showScrollGradient, size, step: stepProp, title, trigger, variant, ...dataAttributes }: BitkitStepperDialogProps): import("react").JSX.Element;
48
+ ({ children, defaultStep, dismissible, initialFocusEl, footerButtons, footerContent, headerLabel, maxHeight, onExitComplete, onOpenChange, onStepChange, open, preventScroll, scrollBehavior, showScrollGradient, size, state, step: stepProp, title, trigger, variant, ...dataAttributes }: BitkitStepsDialogProps): import("react").JSX.Element;
42
49
  displayName: string;
43
50
  } & {
44
51
  ActionTrigger: import('react').ForwardRefExoticComponent<Dialog.ActionTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
45
52
  Step: {
46
- ({ children, description, title }: BitkitStepperDialogStepProps): import("react").JSX.Element;
53
+ ({ children, description, title }: BitkitStepsDialogStepProps): import("react").JSX.Element;
47
54
  displayName: string;
48
55
  };
49
56
  };
@@ -3,22 +3,23 @@ import { flattenChildren } from "../../utilities/flattenChildren.js";
3
3
  import DialogInner from "./DialogInner.js";
4
4
  import DialogShell from "./DialogShell.js";
5
5
  import BitkitSteps_default from "../BitkitSteps/BitkitSteps.js";
6
- import BitkitStepperDialogStep from "./BitkitStepperDialogStep.js";
7
- import { StepperDialogProvider, useStepperDialog } from "./StepperContext.js";
6
+ import BitkitStepsDialogStep from "./BitkitStepsDialogStep.js";
7
+ import { StepsDialogProvider, useStepsDialog } from "./StepsDialogContext.js";
8
+ import { Box } from "@chakra-ui/react/box";
8
9
  import { useCallback, useMemo, useState } from "react";
9
10
  import { jsx } from "react/jsx-runtime";
10
11
  import { Dialog } from "@chakra-ui/react/dialog";
11
- //#region lib/components/BitkitDialog/BitkitStepperDialog.tsx
12
+ //#region lib/components/BitkitDialog/BitkitStepsDialog.tsx
12
13
  /**
13
- * A dialog that walks through a sequence of `BitkitStepperDialog.Step` children. It owns the step
14
- * state, auto-renders the steps header, and shows only the active step's body. Footer navigation is
15
- * wired by the consumer through the `useStepperDialog()` hook.
14
+ * A dialog that walks through a sequence of `BitkitStepsDialog.Step` children. It owns the step
15
+ * state, auto-renders the steps header, and shows only the active step's body. The consumer builds
16
+ * the step navigation with the `useStepsDialog()` hook and passes it in as `footerButtons`.
16
17
  */
17
- var BitkitStepperDialog = ({ children, closable = true, defaultStep = 0, initialFocusEl, footerContent, headerLabel, maxHeight, onExitComplete, onOpenChange, onStepChange, open, preventScroll, scrollBehavior, showScrollGradient, size, step: stepProp, title, trigger, variant, ...dataAttributes }) => {
18
+ var BitkitStepsDialog = ({ children, defaultStep = 0, dismissible = true, initialFocusEl, footerButtons, footerContent, headerLabel, maxHeight, onExitComplete, onOpenChange, onStepChange, open, preventScroll, scrollBehavior, showScrollGradient, size, state, step: stepProp, title, trigger, variant, ...dataAttributes }) => {
18
19
  const [internalStep, setInternalStep] = useState(defaultStep);
19
20
  const isControlled = stepProp !== void 0;
20
21
  const rawStep = (isControlled ? stepProp : internalStep) ?? 0;
21
- const steps = flattenChildren(children).filter((child) => child.type === BitkitStepperDialogStep);
22
+ const steps = flattenChildren(children).filter((child) => child.type === BitkitStepsDialogStep);
22
23
  const totalSteps = steps.length;
23
24
  const step = Math.max(0, Math.min(rawStep, Math.max(0, totalSteps - 1)));
24
25
  const setStep = useCallback((next) => {
@@ -48,14 +49,20 @@ var BitkitStepperDialog = ({ children, closable = true, defaultStep = 0, initial
48
49
  if (!details.open && !isControlled) setInternalStep(defaultStep);
49
50
  onOpenChange?.(details);
50
51
  };
52
+ const footerNav = footerButtons && /* @__PURE__ */ jsx(Box, {
53
+ display: "flex",
54
+ justifyContent: "space-between",
55
+ width: "100%",
56
+ children: footerButtons
57
+ });
51
58
  const stepsHeader = /* @__PURE__ */ jsx(BitkitSteps_default, {
52
59
  step,
53
60
  children: steps.map((child, index) => /* @__PURE__ */ jsx(BitkitSteps_default.Item, { label: child.props.label }, index))
54
61
  });
55
- return /* @__PURE__ */ jsx(StepperDialogProvider, {
62
+ return /* @__PURE__ */ jsx(StepsDialogProvider, {
56
63
  value: ctx,
57
64
  children: /* @__PURE__ */ jsx(DialogShell, {
58
- closable,
65
+ dismissible,
59
66
  initialFocusEl,
60
67
  onExitComplete,
61
68
  onOpenChange: handleOpenChange,
@@ -63,18 +70,22 @@ var BitkitStepperDialog = ({ children, closable = true, defaultStep = 0, initial
63
70
  preventScroll,
64
71
  scrollBehavior,
65
72
  size,
73
+ state,
66
74
  trigger,
67
75
  variant,
68
76
  children: /* @__PURE__ */ jsx(Dialog.Content, {
77
+ "aria-busy": state === "loading" || void 0,
69
78
  maxHeight,
70
79
  ...dataAttributes,
71
80
  children: /* @__PURE__ */ jsx(DialogInner, {
72
- closable,
81
+ dismissible,
82
+ footerButtons: footerNav,
73
83
  footerContent,
74
84
  headerExtra: stepsHeader,
75
85
  headerLabel,
76
86
  scrollBehavior,
77
87
  showScrollGradient,
88
+ state,
78
89
  title,
79
90
  variant,
80
91
  children: steps[step]
@@ -83,12 +94,12 @@ var BitkitStepperDialog = ({ children, closable = true, defaultStep = 0, initial
83
94
  })
84
95
  });
85
96
  };
86
- BitkitStepperDialog.displayName = "BitkitStepperDialog";
87
- var BitkitStepperDialog_default = withSubComponents(BitkitStepperDialog, {
97
+ BitkitStepsDialog.displayName = "BitkitStepsDialog";
98
+ var BitkitStepsDialog_default = withSubComponents(BitkitStepsDialog, {
88
99
  ActionTrigger: Dialog.ActionTrigger,
89
- Step: BitkitStepperDialogStep
100
+ Step: BitkitStepsDialogStep
90
101
  });
91
102
  //#endregion
92
- export { BitkitStepperDialog_default as default, useStepperDialog };
103
+ export { BitkitStepsDialog_default as default, useStepsDialog };
93
104
 
94
- //# sourceMappingURL=BitkitStepperDialog.js.map
105
+ //# sourceMappingURL=BitkitStepsDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BitkitStepsDialog.js","names":[],"sources":["../../../lib/components/BitkitDialog/BitkitStepsDialog.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Dialog } from '@chakra-ui/react/dialog';\nimport { type ReactElement, type ReactNode, useCallback, useMemo, useState } from 'react';\n\nimport { type BitkitDataAttributes } from '../../utilities/dataAttributes';\nimport { flattenChildren } from '../../utilities/flattenChildren';\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport BitkitSteps from '../BitkitSteps/BitkitSteps';\nimport BitkitStepsDialogStep, { type BitkitStepsDialogStepProps } from './BitkitStepsDialogStep';\nimport DialogInner from './DialogInner';\nimport DialogShell, { type DialogShellProps } from './DialogShell';\nimport { StepsDialogProvider } from './StepsDialogContext';\n\nexport { useStepsDialog } from './StepsDialogContext';\n\nexport type BitkitStepsDialogProps = {\n /** `BitkitStepsDialog.Step` children, one per step. */\n children: ReactNode;\n /** Initial step when uncontrolled. Resets to this when the dialog closes. */\n defaultStep?: number;\n /** Set to `false` to remove every dismiss route that skips a decision: no close button, no ESC. */\n dismissible?: boolean;\n /** Element to focus when the dialog opens, instead of the first focusable one. */\n initialFocusEl?: DialogShellProps['initialFocusEl'];\n /**\n * The step navigation, built with `useStepsDialog()`. Pass the buttons themselves: the dialog lays\n * them out the way the design asks for, leading action on the left, the step navigation opposite.\n */\n footerButtons?: ReactNode;\n /** Arbitrary content rendered raw inside the footer, above `footerButtons` (e.g. a `BitkitAlert`). */\n footerContent?: ReactNode;\n headerLabel?: string;\n maxHeight?: string;\n onExitComplete?: () => void;\n onOpenChange?: (details: { open: boolean }) => void;\n /** Called whenever the active step changes (controlled or uncontrolled). */\n onStepChange?: (step: number) => void;\n open?: boolean;\n preventScroll?: boolean;\n scrollBehavior?: 'inside' | 'outside';\n showScrollGradient?: boolean;\n size?: 'sm' | 'md' | 'lg' | 'full';\n /**\n * `loading` locks the dialog while a background action runs: the close button stays in place but\n * disabled, and ESC is blocked. Use it alongside the footer button's own `state=\"loading\"`.\n */\n state?: 'loading';\n /** Controlled active step. Omit for uncontrolled (see `defaultStep`). */\n step?: number;\n title: ReactNode;\n trigger?: ReactNode;\n variant?: 'overflowContent';\n // Data attributes are forwarded to the element carrying `role=\"dialog\"`, and nothing else is —\n // style props, `className` and `id` don't pass through.\n} & BitkitDataAttributes;\n\n/**\n * A dialog that walks through a sequence of `BitkitStepsDialog.Step` children. It owns the step\n * state, auto-renders the steps header, and shows only the active step's body. The consumer builds\n * the step navigation with the `useStepsDialog()` hook and passes it in as `footerButtons`.\n */\nconst BitkitStepsDialog = ({\n children,\n defaultStep = 0,\n dismissible = true,\n initialFocusEl,\n footerButtons,\n footerContent,\n headerLabel,\n maxHeight,\n onExitComplete,\n onOpenChange,\n onStepChange,\n open,\n preventScroll,\n scrollBehavior,\n showScrollGradient,\n size,\n state,\n step: stepProp,\n title,\n trigger,\n variant,\n ...dataAttributes\n}: BitkitStepsDialogProps) => {\n const [internalStep, setInternalStep] = useState(defaultStep);\n const isControlled = stepProp !== undefined;\n const rawStep = (isControlled ? stepProp : internalStep) ?? 0;\n const steps = flattenChildren(children).filter(\n (child): child is ReactElement<BitkitStepsDialogStepProps> => child.type === BitkitStepsDialogStep,\n );\n const totalSteps = steps.length;\n const step = Math.max(0, Math.min(rawStep, Math.max(0, totalSteps - 1)));\n\n const setStep = useCallback(\n (next: number) => {\n const clamped = Math.max(0, Math.min(next, totalSteps - 1));\n if (!isControlled) setInternalStep(clamped);\n onStepChange?.(clamped);\n },\n [isControlled, onStepChange, totalSteps],\n );\n\n const ctx = useMemo(\n () => ({\n goTo: setStep,\n isFirst: step === 0,\n isLast: step === totalSteps - 1,\n next: () => setStep(step + 1),\n prev: () => setStep(step - 1),\n setStep,\n step,\n totalSteps,\n }),\n [setStep, step, totalSteps],\n );\n\n const handleOpenChange = (details: { open: boolean }) => {\n if (!details.open && !isControlled) setInternalStep(defaultStep);\n onOpenChange?.(details);\n };\n\n // The design splits this row: the leading action sits opposite the step navigation. Laying it out\n // here rather than in `DialogInner` keeps the shared action block right-aligned for every other\n // dialog, and keeps the split off every call site.\n const footerNav = footerButtons && (\n <Box display=\"flex\" justifyContent=\"space-between\" width=\"100%\">\n {footerButtons}\n </Box>\n );\n\n const stepsHeader = (\n <BitkitSteps step={step}>\n {steps.map((child, index) => (\n <BitkitSteps.Item key={index} label={child.props.label} />\n ))}\n </BitkitSteps>\n );\n\n return (\n <StepsDialogProvider value={ctx}>\n <DialogShell\n dismissible={dismissible}\n initialFocusEl={initialFocusEl}\n onExitComplete={onExitComplete}\n onOpenChange={handleOpenChange}\n open={open}\n preventScroll={preventScroll}\n scrollBehavior={scrollBehavior}\n size={size}\n state={state}\n trigger={trigger}\n variant={variant}\n >\n <Dialog.Content aria-busy={state === 'loading' || undefined} maxHeight={maxHeight} {...dataAttributes}>\n <DialogInner\n dismissible={dismissible}\n footerButtons={footerNav}\n footerContent={footerContent}\n headerExtra={stepsHeader}\n headerLabel={headerLabel}\n scrollBehavior={scrollBehavior}\n showScrollGradient={showScrollGradient}\n state={state}\n title={title}\n variant={variant}\n >\n {steps[step]}\n </DialogInner>\n </Dialog.Content>\n </DialogShell>\n </StepsDialogProvider>\n );\n};\n\nBitkitStepsDialog.displayName = 'BitkitStepsDialog';\n\nexport default withSubComponents(BitkitStepsDialog, {\n ActionTrigger: Dialog.ActionTrigger,\n Step: BitkitStepsDialogStep,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AA6DA,IAAM,qBAAqB,EACzB,UACA,cAAc,GACd,cAAc,MACd,gBACA,eACA,eACA,aACA,WACA,gBACA,cACA,cACA,MACA,eACA,gBACA,oBACA,MACA,OACA,MAAM,UACN,OACA,SACA,SACA,GAAG,qBACyB;CAC5B,MAAM,CAAC,cAAc,mBAAmB,SAAS,WAAW;CAC5D,MAAM,eAAe,aAAa,KAAA;CAClC,MAAM,WAAW,eAAe,WAAW,iBAAiB;CAC5D,MAAM,QAAQ,gBAAgB,QAAQ,CAAC,CAAC,QACrC,UAA6D,MAAM,SAAS,qBAC/E;CACA,MAAM,aAAa,MAAM;CACzB,MAAM,OAAO,KAAK,IAAI,GAAG,KAAK,IAAI,SAAS,KAAK,IAAI,GAAG,aAAa,CAAC,CAAC,CAAC;CAEvE,MAAM,UAAU,aACb,SAAiB;EAChB,MAAM,UAAU,KAAK,IAAI,GAAG,KAAK,IAAI,MAAM,aAAa,CAAC,CAAC;EAC1D,IAAI,CAAC,cAAc,gBAAgB,OAAO;EAC1C,eAAe,OAAO;CACxB,GACA;EAAC;EAAc;EAAc;CAAU,CACzC;CAEA,MAAM,MAAM,eACH;EACL,MAAM;EACN,SAAS,SAAS;EAClB,QAAQ,SAAS,aAAa;EAC9B,YAAY,QAAQ,OAAO,CAAC;EAC5B,YAAY,QAAQ,OAAO,CAAC;EAC5B;EACA;EACA;CACF,IACA;EAAC;EAAS;EAAM;CAAU,CAC5B;CAEA,MAAM,oBAAoB,YAA+B;EACvD,IAAI,CAAC,QAAQ,QAAQ,CAAC,cAAc,gBAAgB,WAAW;EAC/D,eAAe,OAAO;CACxB;CAKA,MAAM,YAAY,iBAChB,oBAAC,KAAD;EAAK,SAAQ;EAAO,gBAAe;EAAgB,OAAM;EACtD,UAAA;CACE,CAAA;CAGP,MAAM,cACJ,oBAAC,qBAAD;EAAmB;EAChB,UAAA,MAAM,KAAK,OAAO,UACjB,oBAAC,oBAAY,MAAb,EAA8B,OAAO,MAAM,MAAM,MAAQ,GAAlC,KAAkC,CAC1D;CACU,CAAA;CAGf,OACE,oBAAC,qBAAD;EAAqB,OAAO;EAC1B,UAAA,oBAAC,aAAD;GACe;GACG;GACA;GAChB,cAAc;GACR;GACS;GACC;GACV;GACC;GACE;GACA;GAET,UAAA,oBAAC,OAAO,SAAR;IAAgB,aAAW,UAAU,aAAa,KAAA;IAAsB;IAAW,GAAI;IACrF,UAAA,oBAAC,aAAD;KACe;KACb,eAAe;KACA;KACf,aAAa;KACA;KACG;KACI;KACb;KACA;KACE;KAER,UAAA,MAAM;IACI,CAAA;GACC,CAAA;EACL,CAAA;CACM,CAAA;AAEzB;AAEA,kBAAkB,cAAc;AAEhC,IAAA,4BAAe,kBAAkB,mBAAmB;CAClD,eAAe,OAAO;CACtB,MAAM;AACR,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- export interface BitkitStepperDialogStepProps {
2
+ export interface BitkitStepsDialogStepProps {
3
3
  /** Body content for this step. */
4
4
  children?: ReactNode;
5
5
  /** Optional subtitle shown under the step's body title. */
@@ -10,11 +10,11 @@ export interface BitkitStepperDialogStepProps {
10
10
  title: string;
11
11
  }
12
12
  /**
13
- * A single step of a {@link BitkitStepperDialog}. Renders its `title`/`description` typography
13
+ * A single step of a {@link BitkitStepsDialog}. Renders its `title`/`description` typography
14
14
  * followed by `children`. The parent only mounts the active step, so this never self-gates.
15
15
  */
16
- declare const BitkitStepperDialogStep: {
17
- ({ children, description, title }: BitkitStepperDialogStepProps): import("react").JSX.Element;
16
+ declare const BitkitStepsDialogStep: {
17
+ ({ children, description, title }: BitkitStepsDialogStepProps): import("react").JSX.Element;
18
18
  displayName: string;
19
19
  };
20
- export default BitkitStepperDialogStep;
20
+ export default BitkitStepsDialogStep;
@@ -1,12 +1,12 @@
1
1
  import { chakra } from "@chakra-ui/react/styled-system";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useDialogStyles } from "@chakra-ui/react/dialog";
4
- //#region lib/components/BitkitDialog/BitkitStepperDialogStep.tsx
4
+ //#region lib/components/BitkitDialog/BitkitStepsDialogStep.tsx
5
5
  /**
6
- * A single step of a {@link BitkitStepperDialog}. Renders its `title`/`description` typography
6
+ * A single step of a {@link BitkitStepsDialog}. Renders its `title`/`description` typography
7
7
  * followed by `children`. The parent only mounts the active step, so this never self-gates.
8
8
  */
9
- var BitkitStepperDialogStep = ({ children, description, title }) => {
9
+ var BitkitStepsDialogStep = ({ children, description, title }) => {
10
10
  const styles = useDialogStyles();
11
11
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(chakra.div, {
12
12
  css: styles.stepTitleGroup,
@@ -19,8 +19,8 @@ var BitkitStepperDialogStep = ({ children, description, title }) => {
19
19
  })]
20
20
  }), children] });
21
21
  };
22
- BitkitStepperDialogStep.displayName = "BitkitStepperDialogStep";
22
+ BitkitStepsDialogStep.displayName = "BitkitStepsDialogStep";
23
23
  //#endregion
24
- export { BitkitStepperDialogStep as default };
24
+ export { BitkitStepsDialogStep as default };
25
25
 
26
- //# sourceMappingURL=BitkitStepperDialogStep.js.map
26
+ //# sourceMappingURL=BitkitStepsDialogStep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BitkitStepsDialogStep.js","names":[],"sources":["../../../lib/components/BitkitDialog/BitkitStepsDialogStep.tsx"],"sourcesContent":["import { useDialogStyles } from '@chakra-ui/react/dialog';\nimport { chakra } from '@chakra-ui/react/styled-system';\nimport { type ReactNode } from 'react';\n\nexport interface BitkitStepsDialogStepProps {\n /** Body content for this step. */\n children?: ReactNode;\n /** Optional subtitle shown under the step's body title. */\n description?: string;\n /** Short label shown in the steps header. */\n label: string;\n /** Heading shown at the top of the step's body. */\n title: string;\n}\n\n/**\n * A single step of a {@link BitkitStepsDialog}. Renders its `title`/`description` typography\n * followed by `children`. The parent only mounts the active step, so this never self-gates.\n */\nconst BitkitStepsDialogStep = ({ children, description, title }: BitkitStepsDialogStepProps) => {\n const styles = useDialogStyles();\n\n return (\n <>\n <chakra.div css={styles.stepTitleGroup}>\n <chakra.p css={styles.stepTitle}>{title}</chakra.p>\n {description && <chakra.p css={styles.stepDescription}>{description}</chakra.p>}\n </chakra.div>\n {children}\n </>\n );\n};\n\nBitkitStepsDialogStep.displayName = 'BitkitStepsDialogStep';\n\nexport default BitkitStepsDialogStep;\n"],"mappings":";;;;;;;;AAmBA,IAAM,yBAAyB,EAAE,UAAU,aAAa,YAAwC;CAC9F,MAAM,SAAS,gBAAgB;CAE/B,OACE,qBAAA,UAAA,EAAA,UAAA,CACE,qBAAC,OAAO,KAAR;EAAY,KAAK,OAAO;EAAxB,UAAA,CACE,oBAAC,OAAO,GAAR;GAAU,KAAK,OAAO;GAAY,UAAA;EAAgB,CAAA,GACjD,eAAe,oBAAC,OAAO,GAAR;GAAU,KAAK,OAAO;GAAkB,UAAA;EAAsB,CAAA,CACpE;CACX,CAAA,GAAA,QACD,EAAA,CAAA;AAEN;AAEA,sBAAsB,cAAc"}
@@ -2,24 +2,25 @@ import { ReactNode } from 'react';
2
2
  export interface DialogInnerProps {
3
3
  /** Body content. */
4
4
  children?: ReactNode;
5
- closable?: boolean;
5
+ dismissible?: boolean;
6
6
  /** Action buttons, auto-wrapped in the standard right-aligned button row inside the footer. */
7
7
  footerButtons?: ReactNode;
8
8
  /** Arbitrary content rendered raw inside the footer, before any `footerButtons`. */
9
9
  footerContent?: ReactNode;
10
- /** Extra header content below the title (e.g. the stepper's steps header). */
10
+ /** Extra header content below the title (e.g. the steps dialog's steps header). */
11
11
  headerExtra?: ReactNode;
12
12
  headerLabel?: string;
13
13
  scrollBehavior?: 'inside' | 'outside';
14
14
  showScrollGradient?: boolean;
15
+ state?: 'loading';
15
16
  title: ReactNode;
16
17
  variant?: 'overflowContent';
17
18
  }
18
19
  /**
19
20
  * Header + body + footer rendered inside a `Dialog.Content`. Shared by every Bitkit dialog
20
21
  * flavour. Footer rules: `footerContent` renders raw; `footerButtons` is auto-wrapped in the
21
- * standard right-aligned button row; both render in the same `Dialog.Footer` (content first); if
22
- * neither is set, no footer renders.
22
+ * standard right-aligned button row, which carries the design's 24px gap above the actions; both
23
+ * render in the same `Dialog.Footer` (content first); if neither is set, no footer renders.
23
24
  */
24
- declare const DialogInner: ({ children, closable, footerButtons, footerContent, headerExtra, headerLabel, scrollBehavior: scrollBehaviorProp, showScrollGradient, title, variant, }: DialogInnerProps) => import("react").JSX.Element;
25
+ declare const DialogInner: ({ children, dismissible, footerButtons, footerContent, headerExtra, headerLabel, scrollBehavior: scrollBehaviorProp, showScrollGradient, state, title, variant, }: DialogInnerProps) => import("react").JSX.Element;
25
26
  export default DialogInner;
@@ -10,10 +10,10 @@ var PORTAL_DISABLED = { disablePortal: true };
10
10
  /**
11
11
  * Header + body + footer rendered inside a `Dialog.Content`. Shared by every Bitkit dialog
12
12
  * flavour. Footer rules: `footerContent` renders raw; `footerButtons` is auto-wrapped in the
13
- * standard right-aligned button row; both render in the same `Dialog.Footer` (content first); if
14
- * neither is set, no footer renders.
13
+ * standard right-aligned button row, which carries the design's 24px gap above the actions; both
14
+ * render in the same `Dialog.Footer` (content first); if neither is set, no footer renders.
15
15
  */
16
- var DialogInner = ({ children, closable = true, footerButtons, footerContent, headerExtra, headerLabel, scrollBehavior: scrollBehaviorProp, showScrollGradient = true, title, variant }) => {
16
+ var DialogInner = ({ children, dismissible = true, footerButtons, footerContent, headerExtra, headerLabel, scrollBehavior: scrollBehaviorProp, showScrollGradient = true, state, title, variant }) => {
17
17
  const scrollBehavior = resolveScrollBehavior(variant, scrollBehaviorProp) ?? "outside";
18
18
  const styles = useDialogStyles();
19
19
  const hasFooter = !!footerContent || !!footerButtons;
@@ -33,16 +33,19 @@ var DialogInner = ({ children, closable = true, footerButtons, footerContent, he
33
33
  children: [headerLabel && /* @__PURE__ */ jsx(chakra.p, {
34
34
  css: styles.label,
35
35
  children: headerLabel
36
- }), /* @__PURE__ */ jsx(Dialog.Title, { children: title })]
36
+ }), /* @__PURE__ */ jsx(Dialog.Title, {
37
+ paddingInlineEnd: dismissible ? void 0 : "0",
38
+ children: title
39
+ })]
37
40
  }),
38
41
  !!headerExtra && /* @__PURE__ */ jsx(Box, {
39
42
  css: styles.stepHeader,
40
43
  children: headerExtra
41
44
  }),
42
- /* @__PURE__ */ jsx(Dialog.CloseTrigger, {
45
+ dismissible && /* @__PURE__ */ jsx(Dialog.CloseTrigger, {
43
46
  asChild: true,
44
47
  children: /* @__PURE__ */ jsx(BitkitCloseButton, {
45
- disabled: !closable,
48
+ disabled: state === "loading",
46
49
  size: variant === "overflowContent" ? "xs" : "md",
47
50
  type: "button"
48
51
  })
@@ -1 +1 @@
1
- {"version":3,"file":"DialogInner.js","names":[],"sources":["../../../lib/components/BitkitDialog/DialogInner.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Dialog, useDialogStyles } from '@chakra-ui/react/dialog';\nimport { chakra } from '@chakra-ui/react/styled-system';\nimport { type ReactNode } from 'react';\n\nimport BitkitPortalContext from '../../utilities/BitkitPortalContext';\nimport BitkitCloseButton from '../BitkitCloseButton/BitkitCloseButton';\nimport DialogBody, { DialogBodyContext, resolveScrollBehavior } from './DialogBodyContext';\n\nconst PORTAL_DISABLED = { disablePortal: true };\n\nexport interface DialogInnerProps {\n /** Body content. */\n children?: ReactNode;\n closable?: boolean;\n /** Action buttons, auto-wrapped in the standard right-aligned button row inside the footer. */\n footerButtons?: ReactNode;\n /** Arbitrary content rendered raw inside the footer, before any `footerButtons`. */\n footerContent?: ReactNode;\n /** Extra header content below the title (e.g. the stepper's steps header). */\n headerExtra?: ReactNode;\n headerLabel?: string;\n scrollBehavior?: 'inside' | 'outside';\n showScrollGradient?: boolean;\n title: ReactNode;\n variant?: 'overflowContent';\n}\n\n/**\n * Header + body + footer rendered inside a `Dialog.Content`. Shared by every Bitkit dialog\n * flavour. Footer rules: `footerContent` renders raw; `footerButtons` is auto-wrapped in the\n * standard right-aligned button row; both render in the same `Dialog.Footer` (content first); if\n * neither is set, no footer renders.\n */\nconst DialogInner = ({\n children,\n closable = true,\n footerButtons,\n footerContent,\n headerExtra,\n headerLabel,\n scrollBehavior: scrollBehaviorProp,\n showScrollGradient = true,\n title,\n variant,\n}: DialogInnerProps) => {\n const scrollBehavior = resolveScrollBehavior(variant, scrollBehaviorProp) ?? 'outside';\n const styles = useDialogStyles();\n const hasFooter = !!footerContent || !!footerButtons;\n\n return (\n <BitkitPortalContext.Provider value={PORTAL_DISABLED}>\n <DialogBodyContext.Provider value={{ scrollBehavior, showScrollGradient }}>\n <Dialog.Header>\n <Box display=\"flex\" flexDirection=\"column\" gap=\"4\">\n {headerLabel && <chakra.p css={styles.label}>{headerLabel}</chakra.p>}\n <Dialog.Title>{title}</Dialog.Title>\n </Box>\n {!!headerExtra && <Box css={styles.stepHeader}>{headerExtra}</Box>}\n <Dialog.CloseTrigger asChild>\n <BitkitCloseButton disabled={!closable} size={variant === 'overflowContent' ? 'xs' : 'md'} type=\"button\" />\n </Dialog.CloseTrigger>\n </Dialog.Header>\n <DialogBody>{children}</DialogBody>\n {hasFooter && (\n <Dialog.Footer>\n {footerContent}\n {footerButtons && (\n <Box display=\"flex\" gap=\"16\" justifyContent=\"flex-end\" paddingBlockStart=\"24\">\n {footerButtons}\n </Box>\n )}\n </Dialog.Footer>\n )}\n </DialogBodyContext.Provider>\n </BitkitPortalContext.Provider>\n );\n};\n\nexport default DialogInner;\n"],"mappings":";;;;;;;;AASA,IAAM,kBAAkB,EAAE,eAAe,KAAK;;;;;;;AAyB9C,IAAM,eAAe,EACnB,UACA,WAAW,MACX,eACA,eACA,aACA,aACA,gBAAgB,oBAChB,qBAAqB,MACrB,OACA,cACsB;CACtB,MAAM,iBAAiB,sBAAsB,SAAS,kBAAkB,KAAK;CAC7E,MAAM,SAAS,gBAAgB;CAC/B,MAAM,YAAY,CAAC,CAAC,iBAAiB,CAAC,CAAC;CAEvC,OACE,oBAAC,oBAAoB,UAArB;EAA8B,OAAO;EACnC,UAAA,qBAAC,kBAAkB,UAAnB;GAA4B,OAAO;IAAE;IAAgB;GAAmB;GAAxE,UAAA;IACE,qBAAC,OAAO,QAAR,EAAA,UAAA;KACE,qBAAC,KAAD;MAAK,SAAQ;MAAO,eAAc;MAAS,KAAI;MAA/C,UAAA,CACG,eAAe,oBAAC,OAAO,GAAR;OAAU,KAAK,OAAO;OAAQ,UAAA;MAAsB,CAAA,GACpE,oBAAC,OAAO,OAAR,EAAA,UAAe,MAAoB,CAAA,CAChC;;KACJ,CAAC,CAAC,eAAe,oBAAC,KAAD;MAAK,KAAK,OAAO;MAAa,UAAA;KAAiB,CAAA;KACjE,oBAAC,OAAO,cAAR;MAAqB,SAAA;MACnB,UAAA,oBAAC,mBAAD;OAAmB,UAAU,CAAC;OAAU,MAAM,YAAY,oBAAoB,OAAO;OAAM,MAAK;MAAU,CAAA;KACvF,CAAA;IACR,EAAA,CAAA;IACf,oBAAC,YAAD,EAAa,SAAqB,CAAA;IACjC,aACC,qBAAC,OAAO,QAAR,EAAA,UAAA,CACG,eACA,iBACC,oBAAC,KAAD;KAAK,SAAQ;KAAO,KAAI;KAAK,gBAAe;KAAW,mBAAkB;KACtE,UAAA;IACE,CAAA,CAEM,EAAA,CAAA;GAES;;CACA,CAAA;AAElC"}
1
+ {"version":3,"file":"DialogInner.js","names":[],"sources":["../../../lib/components/BitkitDialog/DialogInner.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Dialog, useDialogStyles } from '@chakra-ui/react/dialog';\nimport { chakra } from '@chakra-ui/react/styled-system';\nimport { type ReactNode } from 'react';\n\nimport BitkitPortalContext from '../../utilities/BitkitPortalContext';\nimport BitkitCloseButton from '../BitkitCloseButton/BitkitCloseButton';\nimport DialogBody, { DialogBodyContext, resolveScrollBehavior } from './DialogBodyContext';\n\nconst PORTAL_DISABLED = { disablePortal: true };\n\nexport interface DialogInnerProps {\n /** Body content. */\n children?: ReactNode;\n dismissible?: boolean;\n /** Action buttons, auto-wrapped in the standard right-aligned button row inside the footer. */\n footerButtons?: ReactNode;\n /** Arbitrary content rendered raw inside the footer, before any `footerButtons`. */\n footerContent?: ReactNode;\n /** Extra header content below the title (e.g. the steps dialog's steps header). */\n headerExtra?: ReactNode;\n headerLabel?: string;\n scrollBehavior?: 'inside' | 'outside';\n showScrollGradient?: boolean;\n state?: 'loading';\n title: ReactNode;\n variant?: 'overflowContent';\n}\n\n/**\n * Header + body + footer rendered inside a `Dialog.Content`. Shared by every Bitkit dialog\n * flavour. Footer rules: `footerContent` renders raw; `footerButtons` is auto-wrapped in the\n * standard right-aligned button row, which carries the design's 24px gap above the actions; both\n * render in the same `Dialog.Footer` (content first); if neither is set, no footer renders.\n */\nconst DialogInner = ({\n children,\n dismissible = true,\n footerButtons,\n footerContent,\n headerExtra,\n headerLabel,\n scrollBehavior: scrollBehaviorProp,\n showScrollGradient = true,\n state,\n title,\n variant,\n}: DialogInnerProps) => {\n const scrollBehavior = resolveScrollBehavior(variant, scrollBehaviorProp) ?? 'outside';\n const styles = useDialogStyles();\n const hasFooter = !!footerContent || !!footerButtons;\n\n return (\n <BitkitPortalContext.Provider value={PORTAL_DISABLED}>\n <DialogBodyContext.Provider value={{ scrollBehavior, showScrollGradient }}>\n <Dialog.Header>\n <Box display=\"flex\" flexDirection=\"column\" gap=\"4\">\n {headerLabel && <chakra.p css={styles.label}>{headerLabel}</chakra.p>}\n <Dialog.Title paddingInlineEnd={dismissible ? undefined : '0'}>{title}</Dialog.Title>\n </Box>\n {!!headerExtra && <Box css={styles.stepHeader}>{headerExtra}</Box>}\n {dismissible && (\n <Dialog.CloseTrigger asChild>\n <BitkitCloseButton\n disabled={state === 'loading'}\n size={variant === 'overflowContent' ? 'xs' : 'md'}\n type=\"button\"\n />\n </Dialog.CloseTrigger>\n )}\n </Dialog.Header>\n <DialogBody>{children}</DialogBody>\n {hasFooter && (\n <Dialog.Footer>\n {footerContent}\n {footerButtons && (\n <Box display=\"flex\" gap=\"16\" justifyContent=\"flex-end\" paddingBlockStart=\"24\">\n {footerButtons}\n </Box>\n )}\n </Dialog.Footer>\n )}\n </DialogBodyContext.Provider>\n </BitkitPortalContext.Provider>\n );\n};\n\nexport default DialogInner;\n"],"mappings":";;;;;;;;AASA,IAAM,kBAAkB,EAAE,eAAe,KAAK;;;;;;;AA0B9C,IAAM,eAAe,EACnB,UACA,cAAc,MACd,eACA,eACA,aACA,aACA,gBAAgB,oBAChB,qBAAqB,MACrB,OACA,OACA,cACsB;CACtB,MAAM,iBAAiB,sBAAsB,SAAS,kBAAkB,KAAK;CAC7E,MAAM,SAAS,gBAAgB;CAC/B,MAAM,YAAY,CAAC,CAAC,iBAAiB,CAAC,CAAC;CAEvC,OACE,oBAAC,oBAAoB,UAArB;EAA8B,OAAO;EACnC,UAAA,qBAAC,kBAAkB,UAAnB;GAA4B,OAAO;IAAE;IAAgB;GAAmB;GAAxE,UAAA;IACE,qBAAC,OAAO,QAAR,EAAA,UAAA;KACE,qBAAC,KAAD;MAAK,SAAQ;MAAO,eAAc;MAAS,KAAI;MAA/C,UAAA,CACG,eAAe,oBAAC,OAAO,GAAR;OAAU,KAAK,OAAO;OAAQ,UAAA;MAAsB,CAAA,GACpE,oBAAC,OAAO,OAAR;OAAc,kBAAkB,cAAc,KAAA,IAAY;OAAM,UAAA;MAAoB,CAAA,CACjF;;KACJ,CAAC,CAAC,eAAe,oBAAC,KAAD;MAAK,KAAK,OAAO;MAAa,UAAA;KAAiB,CAAA;KAChE,eACC,oBAAC,OAAO,cAAR;MAAqB,SAAA;MACnB,UAAA,oBAAC,mBAAD;OACE,UAAU,UAAU;OACpB,MAAM,YAAY,oBAAoB,OAAO;OAC7C,MAAK;MACN,CAAA;KACkB,CAAA;IAEV,EAAA,CAAA;IACf,oBAAC,YAAD,EAAa,SAAqB,CAAA;IACjC,aACC,qBAAC,OAAO,QAAR,EAAA,UAAA,CACG,eACA,iBACC,oBAAC,KAAD;KAAK,SAAQ;KAAO,KAAI;KAAK,gBAAe;KAAW,mBAAkB;KACtE,UAAA;IACE,CAAA,CAEM,EAAA,CAAA;GAES;;CACA,CAAA;AAElC"}
@@ -3,7 +3,7 @@ import { ComponentProps, ReactNode } from 'react';
3
3
  export interface DialogShellProps {
4
4
  /** The `Dialog.Content` element (rendered inside the positioner). */
5
5
  children: ReactNode;
6
- closable?: boolean;
6
+ dismissible?: boolean;
7
7
  /** Element to focus when the dialog opens, instead of the first focusable one. */
8
8
  initialFocusEl?: ComponentProps<typeof Dialog.Root>['initialFocusEl'];
9
9
  onExitComplete?: () => void;
@@ -14,16 +14,19 @@ export interface DialogShellProps {
14
14
  preventScroll?: boolean;
15
15
  scrollBehavior?: 'inside' | 'outside';
16
16
  size?: 'sm' | 'md' | 'lg' | 'full';
17
+ state?: 'loading';
17
18
  trigger?: ReactNode;
18
19
  variant?: 'overflowContent';
19
20
  }
20
21
  /**
21
22
  * Shared overlay shell for every Bitkit dialog flavour: `Dialog.Root` + optional trigger + portal +
22
- * backdrop + positioner. Dismiss policy is derived from `closable` for ESC/close-trigger; outside
23
- * clicks are always ignored (`closeOnInteractOutside={false}`). Note that `closable` does not reach
23
+ * backdrop + positioner. `dismissible={false}` removes every route out that skips a decision: the
24
+ * close button is not rendered (see `DialogInner`) and ESC is blocked. `state="loading"` blocks the
25
+ * same routes for as long as it is set, but keeps the close button in place, disabled. Outside clicks never dismiss a
26
+ * Bitkit dialog either way (`closeOnInteractOutside={false}`). Note that `dismissible` does not reach
24
27
  * `ActionTrigger` -- a footer button wired to it closes the dialog either way, so a caller that has
25
28
  * to block every route out disables that button itself.
26
29
  * The caller passes the `Dialog.Content` (or a `Dialog.Content asChild` wrapper) as children.
27
30
  **/
28
- declare const DialogShell: ({ children, closable, initialFocusEl, onExitComplete, onOpenChange, open, preventScroll, scrollBehavior: scrollBehaviorProp, size, trigger, variant, }: DialogShellProps) => import("react").JSX.Element;
31
+ declare const DialogShell: ({ children, dismissible, initialFocusEl, onExitComplete, onOpenChange, open, preventScroll, scrollBehavior: scrollBehaviorProp, size, state, trigger, variant, }: DialogShellProps) => import("react").JSX.Element;
29
32
  export default DialogShell;
@@ -5,16 +5,18 @@ import { Dialog } from "@chakra-ui/react/dialog";
5
5
  //#region lib/components/BitkitDialog/DialogShell.tsx
6
6
  /**
7
7
  * Shared overlay shell for every Bitkit dialog flavour: `Dialog.Root` + optional trigger + portal +
8
- * backdrop + positioner. Dismiss policy is derived from `closable` for ESC/close-trigger; outside
9
- * clicks are always ignored (`closeOnInteractOutside={false}`). Note that `closable` does not reach
8
+ * backdrop + positioner. `dismissible={false}` removes every route out that skips a decision: the
9
+ * close button is not rendered (see `DialogInner`) and ESC is blocked. `state="loading"` blocks the
10
+ * same routes for as long as it is set, but keeps the close button in place, disabled. Outside clicks never dismiss a
11
+ * Bitkit dialog either way (`closeOnInteractOutside={false}`). Note that `dismissible` does not reach
10
12
  * `ActionTrigger` -- a footer button wired to it closes the dialog either way, so a caller that has
11
13
  * to block every route out disables that button itself.
12
14
  * The caller passes the `Dialog.Content` (or a `Dialog.Content asChild` wrapper) as children.
13
15
  **/
14
- var DialogShell = ({ children, closable = true, initialFocusEl, onExitComplete, onOpenChange, open, preventScroll = true, scrollBehavior: scrollBehaviorProp, size, trigger, variant }) => {
16
+ var DialogShell = ({ children, dismissible = true, initialFocusEl, onExitComplete, onOpenChange, open, preventScroll = true, scrollBehavior: scrollBehaviorProp, size, state, trigger, variant }) => {
15
17
  const scrollBehavior = resolveScrollBehavior(variant, scrollBehaviorProp);
16
18
  return /* @__PURE__ */ jsxs(Dialog.Root, {
17
- closeOnEscape: closable,
19
+ closeOnEscape: dismissible && state !== "loading",
18
20
  closeOnInteractOutside: false,
19
21
  initialFocusEl,
20
22
  onExitComplete,