@nimbus-ds/patterns 1.35.1-rc.2 → 1.35.1-rc.20
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.
- package/CHANGELOG.md +12 -0
- package/dist/AppShell/index.d.ts +9 -0
- package/dist/AppShell/index.js +1 -1
- package/dist/BottomSheet/index.d.ts +184 -0
- package/dist/BottomSheet/index.js +2 -0
- package/dist/CHANGELOG.md +12 -0
- package/dist/EmptyApp/index.js +1 -1
- package/dist/Menu/index.d.ts +1 -1
- package/dist/Menu/index.js +1 -1
- package/dist/MenuButton/index.d.ts +1 -1
- package/dist/MenuButton/index.js +1 -1
- package/dist/ProductUpdates/index.js +1 -1
- package/dist/components-props.json +1 -0
- package/dist/index.d.ts +183 -1
- package/dist/index.js +1 -1
- package/package.json +5 -1
package/dist/index.d.ts
CHANGED
|
@@ -38,8 +38,17 @@ export interface AppShellChatProperties {
|
|
|
38
38
|
* The overlay auto-detects the parent bounds (respecting menu and header).
|
|
39
39
|
*/
|
|
40
40
|
expanded?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Width of the chat panel in collapsed (non-expanded) mode.
|
|
43
|
+
* Accepts any valid CSS length value (e.g. "300px", "25vw") or a responsive
|
|
44
|
+
* object keyed by breakpoint (e.g. `{ xs: "300px", xxl: "378px" }`).
|
|
45
|
+
* Useful for consumer-controlled resize interactions such as a drag handle.
|
|
46
|
+
* When omitted, defaults to the responsive `{ xs: "300px", xxl: "378px" }`.
|
|
47
|
+
*/
|
|
48
|
+
collapsedWidth?: NonNullable<BoxProps["maxWidth"]>;
|
|
41
49
|
}
|
|
42
50
|
export type AppShellChatProps = AppShellChatProperties & Omit<BoxProps, "position">;
|
|
51
|
+
export declare const APPSHELL_CHAT_DEFAULT_WIDTH = "360px";
|
|
43
52
|
declare const AppShellChat: React.FC<AppShellChatProps>;
|
|
44
53
|
export interface AppShellComponents {
|
|
45
54
|
Header: typeof AppShellHeader;
|
|
@@ -124,6 +133,179 @@ export type AppShellMenuContextValue = {
|
|
|
124
133
|
* @throws If `enforce=true` and used without a provider.
|
|
125
134
|
*/
|
|
126
135
|
export declare const useAppShellMenuContext: (enforce?: boolean) => AppShellMenuContextValue;
|
|
136
|
+
export type BottomSheetPadding = "none" | "base";
|
|
137
|
+
/**
|
|
138
|
+
* A snap point expressed as a viewport-height percentage (e.g. "60%") or the
|
|
139
|
+
* keyword "full" (which stops just below the status bar, not full-bleed).
|
|
140
|
+
*/
|
|
141
|
+
export type BottomSheetSnapPoint = `${number}%` | "full";
|
|
142
|
+
/**
|
|
143
|
+
* Predicate variant of `closeOnOutsidePress`: receives the DOM event and
|
|
144
|
+
* returns `true` to allow closing, `false` to ignore the press.
|
|
145
|
+
*/
|
|
146
|
+
export type CloseOnOutsidePress = (event: PointerEvent | MouseEvent) => boolean;
|
|
147
|
+
export interface BottomSheetProperties {
|
|
148
|
+
/**
|
|
149
|
+
* Determines if the bottom sheet is shown or not.
|
|
150
|
+
* @default false
|
|
151
|
+
*/
|
|
152
|
+
open?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Callback fired when the component requests to be closed (overlay press,
|
|
155
|
+
* close control, Escape, or a downward dismiss gesture).
|
|
156
|
+
* () => void;
|
|
157
|
+
*/
|
|
158
|
+
onRemove?: () => void;
|
|
159
|
+
/**
|
|
160
|
+
* Ordered list of heights the sheet can snap to. Each entry is a
|
|
161
|
+
* viewport-height percentage (e.g. "60%") or the keyword "full".
|
|
162
|
+
* @default ["60%", "90%", "full"]
|
|
163
|
+
*/
|
|
164
|
+
snapPoints?: BottomSheetSnapPoint[];
|
|
165
|
+
/**
|
|
166
|
+
* Index within `snapPoints` used as the initial snap point.
|
|
167
|
+
* @default 0
|
|
168
|
+
*/
|
|
169
|
+
defaultSnap?: number;
|
|
170
|
+
/**
|
|
171
|
+
* Content of the sheet. Compose with BottomSheet.Header, BottomSheet.Body
|
|
172
|
+
* and BottomSheet.Footer.
|
|
173
|
+
* @TJS-type React.ReactNode
|
|
174
|
+
*/
|
|
175
|
+
children?: ReactNode;
|
|
176
|
+
/**
|
|
177
|
+
* Controls whether pressing outside should close the sheet.
|
|
178
|
+
* - boolean: enable/disable dismissal on outside press
|
|
179
|
+
* - function: receive the DOM event and return true to allow closing
|
|
180
|
+
* @default true
|
|
181
|
+
*/
|
|
182
|
+
closeOnOutsidePress?: boolean | CloseOnOutsidePress;
|
|
183
|
+
/**
|
|
184
|
+
* The attribute name to ignore when checking for outside presses, so
|
|
185
|
+
* portaled Popover/Modal content does not close the sheet.
|
|
186
|
+
* @default "data-nimbus-outside-press-ignore"
|
|
187
|
+
*/
|
|
188
|
+
ignoreAttributeName?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Determines if background scroll is locked while the sheet is open.
|
|
191
|
+
* @default true
|
|
192
|
+
*/
|
|
193
|
+
needRemoveScroll?: boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Explicit z-index for the sheet layer. Omitted by default: like Nimbus's
|
|
196
|
+
* own Sidebar/Modal/Popover, the sheet relies on DOM mount order rather
|
|
197
|
+
* than a z-index. Its portal mounts into the nearest Nimbus
|
|
198
|
+
* <ThemeProvider>'s own wrapper element (the same container
|
|
199
|
+
* Sidebar/Modal/Popover portal into), falling back to document.body only
|
|
200
|
+
* when no ThemeProvider is present. In both cases, later-mounted siblings
|
|
201
|
+
* paint on top of earlier ones as long as neither sets a z-index, so this
|
|
202
|
+
* keeps the sheet correctly stacked against Popover and other BottomSheet
|
|
203
|
+
* instances. Only set this to force a specific stacking order against
|
|
204
|
+
* something outside that convention.
|
|
205
|
+
*/
|
|
206
|
+
zIndex?: number;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Public props for `BottomSheet`. Combines `BottomSheetProperties` (the
|
|
210
|
+
* sheet's own behavior — visibility, snap points, dismissal, stacking) with
|
|
211
|
+
* `root` and every native `div` attribute except `color`.
|
|
212
|
+
*/
|
|
213
|
+
export type BottomSheetProps = BottomSheetProperties & {
|
|
214
|
+
/**
|
|
215
|
+
* Root element where the portal should be mounted. When provided and not
|
|
216
|
+
* null, the portal renders inside this element. Otherwise it renders into
|
|
217
|
+
* the nearest Nimbus <ThemeProvider>'s own wrapper element (same as
|
|
218
|
+
* Sidebar/Modal/Popover), so it inherits the active theme's CSS custom
|
|
219
|
+
* properties and stacks correctly against them; it falls back to
|
|
220
|
+
* document.body only when no ThemeProvider is present. Useful to scope the
|
|
221
|
+
* sheet within a container (e.g., AppShell.Chat).
|
|
222
|
+
*/
|
|
223
|
+
root?: HTMLElement | null;
|
|
224
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "color">;
|
|
225
|
+
export interface BottomSheetHeaderProperties {
|
|
226
|
+
/**
|
|
227
|
+
* The content of the sheet header. Accepts any node (title, actions, icons).
|
|
228
|
+
* @TJS-type React.ReactNode
|
|
229
|
+
*/
|
|
230
|
+
children?: ReactNode;
|
|
231
|
+
/**
|
|
232
|
+
* The padding around the header content area.
|
|
233
|
+
* @default base
|
|
234
|
+
*/
|
|
235
|
+
padding?: BottomSheetPadding;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Public props for `BottomSheet.Header`. Combines `BottomSheetHeaderProperties`
|
|
239
|
+
* with every native element attribute except `color` (same reason as
|
|
240
|
+
* `BottomSheetProps`: it conflicts with Box's own color-token sprinkle).
|
|
241
|
+
*/
|
|
242
|
+
export type BottomSheetHeaderProps = BottomSheetHeaderProperties & Omit<HTMLAttributes<HTMLElement>, "color">;
|
|
243
|
+
export interface BottomSheetBodyProperties {
|
|
244
|
+
/**
|
|
245
|
+
* The scrollable content of the sheet.
|
|
246
|
+
* @TJS-type React.ReactNode
|
|
247
|
+
*/
|
|
248
|
+
children: ReactNode;
|
|
249
|
+
/**
|
|
250
|
+
* The padding around the body content area.
|
|
251
|
+
* @default base
|
|
252
|
+
*/
|
|
253
|
+
padding?: BottomSheetPadding;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Public props for `BottomSheet.Body`. Combines `BottomSheetBodyProperties`
|
|
257
|
+
* (`children` is required, unlike `Header`'s) with every native element
|
|
258
|
+
* attribute except `color`.
|
|
259
|
+
*/
|
|
260
|
+
export type BottomSheetBodyProps = BottomSheetBodyProperties & Omit<HTMLAttributes<HTMLElement>, "color">;
|
|
261
|
+
export interface BottomSheetFooterProperties {
|
|
262
|
+
/**
|
|
263
|
+
* The content of the sheet footer.
|
|
264
|
+
* @TJS-type React.ReactNode
|
|
265
|
+
*/
|
|
266
|
+
children: ReactNode;
|
|
267
|
+
/**
|
|
268
|
+
* The padding around the footer content area.
|
|
269
|
+
* @default base
|
|
270
|
+
*/
|
|
271
|
+
padding?: BottomSheetPadding;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Public props for `BottomSheet.Footer`. Combines `BottomSheetFooterProperties`
|
|
275
|
+
* (`children` is required, same as `Body`) with every native element
|
|
276
|
+
* attribute except `color`. `BottomSheet.Footer` itself is optional to
|
|
277
|
+
* render at all — omitting it entirely is how a sheet renders without a
|
|
278
|
+
* footer region.
|
|
279
|
+
*/
|
|
280
|
+
export type BottomSheetFooterProps = BottomSheetFooterProperties & Omit<HTMLAttributes<HTMLElement>, "color">;
|
|
281
|
+
declare const BottomSheetBody: React.FC<BottomSheetBodyProps>;
|
|
282
|
+
declare const BottomSheetFooter: React.FC<BottomSheetFooterProps>;
|
|
283
|
+
declare const BottomSheetHeader: React.FC<BottomSheetHeaderProps>;
|
|
284
|
+
declare const BottomSheetBase: React.FC<BottomSheetProps>;
|
|
285
|
+
/**
|
|
286
|
+
* A mobile-first modal sheet that slides up from the bottom edge, with
|
|
287
|
+
* configurable snap points and a pointer-driven drag gesture to resize
|
|
288
|
+
* between them or dismiss by dragging down.
|
|
289
|
+
*
|
|
290
|
+
* Controlled via `open`/`onRemove`, the same contract as `Sidebar`: the
|
|
291
|
+
* component never changes its own visibility, it only requests to close (via
|
|
292
|
+
* overlay press, Escape, or a downward dismiss gesture) — the consumer sets
|
|
293
|
+
* `open` to `false` in response.
|
|
294
|
+
*
|
|
295
|
+
* Compose with `BottomSheet.Header` (optional), `BottomSheet.Body`
|
|
296
|
+
* (required), and `BottomSheet.Footer` (optional) as `children`.
|
|
297
|
+
*
|
|
298
|
+
* Behaves as a modal: renders as `role="dialog"`/`aria-modal="true"`, dims
|
|
299
|
+
* and blocks the background, traps focus while open, and restores it to the
|
|
300
|
+
* previously focused element on close. Automatically labels the dialog via
|
|
301
|
+
* `aria-labelledby` pointing at `BottomSheet.Header` when one is present;
|
|
302
|
+
* pass an explicit `aria-label`/`aria-labelledby` to override that.
|
|
303
|
+
*/
|
|
304
|
+
export declare const BottomSheet: typeof BottomSheetBase & {
|
|
305
|
+
Header: typeof BottomSheetHeader;
|
|
306
|
+
Body: typeof BottomSheetBody;
|
|
307
|
+
Footer: typeof BottomSheetFooter;
|
|
308
|
+
};
|
|
127
309
|
export interface CalloutCardProperties {
|
|
128
310
|
/**
|
|
129
311
|
* CalloutCard color.
|
|
@@ -615,7 +797,7 @@ export interface MenuButtonAccordionProperties {
|
|
|
615
797
|
expanded?: boolean;
|
|
616
798
|
}
|
|
617
799
|
export type MenuButtonAccordionBaseProps = MenuButtonAccordionProperties & {
|
|
618
|
-
menuButton: Omit<MenuButtonProps, "expanded" | "
|
|
800
|
+
menuButton: Omit<MenuButtonProps, "expanded" | "tooltipText">;
|
|
619
801
|
} & Omit<HTMLAttributes<HTMLElement>, "color">;
|
|
620
802
|
declare const MenuButtonAccordion: PolymorphicForwardRefComponent<"button" | "a", MenuButtonAccordionBaseProps>;
|
|
621
803
|
export interface MenuButtonComponents {
|