@nimbus-ds/patterns 1.35.1-rc.1 → 1.35.1-rc.11
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 +137 -0
- package/dist/BottomSheet/index.js +2 -0
- package/dist/CHANGELOG.md +12 -0
- package/dist/components-props.json +1 -0
- package/dist/index.d.ts +135 -0
- 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,132 @@ 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 = string;
|
|
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 (its
|
|
197
|
+
* portal is appended to document.body, so later-opened overlays paint on
|
|
198
|
+
* top of earlier ones) rather than a z-index, so it stacks correctly
|
|
199
|
+
* against Popover and other BottomSheet instances. Only set this to force
|
|
200
|
+
* a specific stacking order against something outside Nimbus's own
|
|
201
|
+
* z-index-less convention.
|
|
202
|
+
*/
|
|
203
|
+
zIndex?: number;
|
|
204
|
+
}
|
|
205
|
+
export type BottomSheetProps = BottomSheetProperties & {
|
|
206
|
+
/**
|
|
207
|
+
* Root element where the portal should be mounted. When provided and not
|
|
208
|
+
* null, the portal renders inside this element; otherwise it renders into
|
|
209
|
+
* document.body. Useful to scope the sheet within a container (e.g.,
|
|
210
|
+
* AppShell.Chat).
|
|
211
|
+
*/
|
|
212
|
+
root?: HTMLElement | null;
|
|
213
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "color">;
|
|
214
|
+
export interface BottomSheetHeaderProperties {
|
|
215
|
+
/**
|
|
216
|
+
* The content of the sheet header. Accepts any node (title, actions, icons).
|
|
217
|
+
* @TJS-type React.ReactNode
|
|
218
|
+
*/
|
|
219
|
+
children?: ReactNode;
|
|
220
|
+
/**
|
|
221
|
+
* The padding around the header content area.
|
|
222
|
+
* @default base
|
|
223
|
+
*/
|
|
224
|
+
padding?: BottomSheetPadding;
|
|
225
|
+
}
|
|
226
|
+
export type BottomSheetHeaderProps = BottomSheetHeaderProperties & Omit<HTMLAttributes<HTMLElement>, "color">;
|
|
227
|
+
export interface BottomSheetBodyProperties {
|
|
228
|
+
/**
|
|
229
|
+
* The scrollable content of the sheet.
|
|
230
|
+
* @TJS-type React.ReactNode
|
|
231
|
+
*/
|
|
232
|
+
children: ReactNode;
|
|
233
|
+
/**
|
|
234
|
+
* The padding around the body content area.
|
|
235
|
+
* @default base
|
|
236
|
+
*/
|
|
237
|
+
padding?: BottomSheetPadding;
|
|
238
|
+
}
|
|
239
|
+
export type BottomSheetBodyProps = BottomSheetBodyProperties & Omit<HTMLAttributes<HTMLElement>, "color">;
|
|
240
|
+
export interface BottomSheetFooterProperties {
|
|
241
|
+
/**
|
|
242
|
+
* The content of the sheet footer.
|
|
243
|
+
* @TJS-type React.ReactNode
|
|
244
|
+
*/
|
|
245
|
+
children: ReactNode;
|
|
246
|
+
/**
|
|
247
|
+
* The padding around the footer content area.
|
|
248
|
+
* @default base
|
|
249
|
+
*/
|
|
250
|
+
padding?: BottomSheetPadding;
|
|
251
|
+
}
|
|
252
|
+
export type BottomSheetFooterProps = BottomSheetFooterProperties & Omit<HTMLAttributes<HTMLElement>, "color">;
|
|
253
|
+
declare const BottomSheetBody: React.FC<BottomSheetBodyProps>;
|
|
254
|
+
declare const BottomSheetFooter: React.FC<BottomSheetFooterProps>;
|
|
255
|
+
declare const BottomSheetHeader: React.FC<BottomSheetHeaderProps>;
|
|
256
|
+
declare const BottomSheetBase: React.FC<BottomSheetProps>;
|
|
257
|
+
export declare const BottomSheet: typeof BottomSheetBase & {
|
|
258
|
+
Header: typeof BottomSheetHeader;
|
|
259
|
+
Body: typeof BottomSheetBody;
|
|
260
|
+
Footer: typeof BottomSheetFooter;
|
|
261
|
+
};
|
|
127
262
|
export interface CalloutCardProperties {
|
|
128
263
|
/**
|
|
129
264
|
* CalloutCard color.
|