@nimbus-ds/patterns 1.36.0-rc.9 → 1.38.0

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/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,191 @@ 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" (edge-to-edge, covering the full viewport height).
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
+ * Accessible name (`aria-label`) for the drag grabber. Override for
196
+ * non-English locales, since the built-in default is English-only.
197
+ * @default "Drag to resize or dismiss"
198
+ */
199
+ grabberLabel?: string;
200
+ /**
201
+ * Explicit z-index for the sheet layer. Omitted by default: like Nimbus's
202
+ * own Sidebar/Modal/Popover, the sheet relies on DOM mount order rather
203
+ * than a z-index. Its portal mounts into the nearest Nimbus
204
+ * <ThemeProvider>'s own wrapper element (the same container
205
+ * Sidebar/Modal/Popover portal into), falling back to document.body only
206
+ * when no ThemeProvider is present. In both cases, later-mounted siblings
207
+ * paint on top of earlier ones as long as neither sets a z-index, so this
208
+ * keeps the sheet correctly stacked against Popover and other BottomSheet
209
+ * instances. Only set this to force a specific stacking order against
210
+ * something outside that convention.
211
+ */
212
+ zIndex?: number;
213
+ }
214
+ /**
215
+ * Public props for `BottomSheet`. Combines `BottomSheetProperties` (the
216
+ * sheet's own behavior — visibility, snap points, dismissal, stacking) with
217
+ * `root` and every native `div` attribute except `color`.
218
+ */
219
+ export type BottomSheetProps = BottomSheetProperties & {
220
+ /**
221
+ * Root element where the portal should be mounted. When provided and not
222
+ * null, the portal renders inside this element. Otherwise it renders into
223
+ * the nearest Nimbus <ThemeProvider>'s own wrapper element (same as
224
+ * Sidebar/Modal/Popover), so it inherits the active theme's CSS custom
225
+ * properties and stacks correctly against them; it falls back to
226
+ * document.body only when no ThemeProvider is present. Useful to scope the
227
+ * sheet within a container (e.g., AppShell.Chat).
228
+ */
229
+ root?: HTMLElement | null;
230
+ } & Omit<HTMLAttributes<HTMLDivElement>, "color">;
231
+ export interface BottomSheetHeaderProperties {
232
+ /**
233
+ * The content of the sheet header. Accepts any node (title, actions, icons).
234
+ * @TJS-type React.ReactNode
235
+ */
236
+ children?: ReactNode;
237
+ /**
238
+ * The padding around the header content area.
239
+ * @default base
240
+ */
241
+ padding?: BottomSheetPadding;
242
+ }
243
+ /**
244
+ * Public props for `BottomSheet.Header`. Combines `BottomSheetHeaderProperties`
245
+ * with every native element attribute except `color` (same reason as
246
+ * `BottomSheetProps`: it conflicts with Box's own color-token sprinkle).
247
+ */
248
+ export type BottomSheetHeaderProps = BottomSheetHeaderProperties & Omit<HTMLAttributes<HTMLElement>, "color">;
249
+ export interface BottomSheetBodyProperties {
250
+ /**
251
+ * The scrollable content of the sheet.
252
+ * @TJS-type React.ReactNode
253
+ */
254
+ children: ReactNode;
255
+ /**
256
+ * The padding around the body content area.
257
+ * @default base
258
+ */
259
+ padding?: BottomSheetPadding;
260
+ }
261
+ /**
262
+ * Public props for `BottomSheet.Body`. Combines `BottomSheetBodyProperties`
263
+ * (`children` is required, unlike `Header`'s) with every native element
264
+ * attribute except `color`.
265
+ */
266
+ export type BottomSheetBodyProps = BottomSheetBodyProperties & Omit<HTMLAttributes<HTMLElement>, "color">;
267
+ export interface BottomSheetFooterProperties {
268
+ /**
269
+ * The content of the sheet footer.
270
+ * @TJS-type React.ReactNode
271
+ */
272
+ children: ReactNode;
273
+ /**
274
+ * The padding around the footer content area.
275
+ * @default base
276
+ */
277
+ padding?: BottomSheetPadding;
278
+ }
279
+ /**
280
+ * Public props for `BottomSheet.Footer`. Combines `BottomSheetFooterProperties`
281
+ * (`children` is required, same as `Body`) with every native element
282
+ * attribute except `color`. `BottomSheet.Footer` itself is optional to
283
+ * render at all — omitting it entirely is how a sheet renders without a
284
+ * footer region.
285
+ */
286
+ export type BottomSheetFooterProps = BottomSheetFooterProperties & Omit<HTMLAttributes<HTMLElement>, "color">;
287
+ /**
288
+ * The composable subcomponents attached to `BottomSheet`
289
+ * (`BottomSheet.Header`, `BottomSheet.Body`, `BottomSheet.Footer`), used to
290
+ * compose the sheet's `children`.
291
+ */
292
+ export interface BottomSheetComponents {
293
+ /** Chrome region above the body; the drag grabber is pinned above it. */
294
+ Header: FC<BottomSheetHeaderProps>;
295
+ /** The scrollable content region. */
296
+ Body: FC<BottomSheetBodyProps>;
297
+ /** Optional chrome region below the body (e.g. action buttons). */
298
+ Footer: FC<BottomSheetFooterProps>;
299
+ }
300
+ declare const BottomSheetBase: React.FC<BottomSheetProps>;
301
+ /**
302
+ * A mobile-first modal sheet that slides up from the bottom edge, with
303
+ * configurable snap points and a pointer-driven drag gesture to resize
304
+ * between them or dismiss by dragging down.
305
+ *
306
+ * Controlled via `open`/`onRemove`, the same contract as `Sidebar`: the
307
+ * component never changes its own visibility, it only requests to close (via
308
+ * overlay press, Escape, or a downward dismiss gesture) — the consumer sets
309
+ * `open` to `false` in response.
310
+ *
311
+ * Compose with `BottomSheet.Header` (optional), `BottomSheet.Body`
312
+ * (required), and `BottomSheet.Footer` (optional) as `children`.
313
+ *
314
+ * Behaves as a modal: renders as `role="dialog"`/`aria-modal="true"`, dims
315
+ * and blocks the background, traps focus while open, and restores it to the
316
+ * previously focused element on close. Automatically labels the dialog via
317
+ * `aria-labelledby` pointing at `BottomSheet.Header` when one is present;
318
+ * pass an explicit `aria-label`/`aria-labelledby` to override that.
319
+ */
320
+ export declare const BottomSheet: typeof BottomSheetBase & BottomSheetComponents;
127
321
  export interface CalloutCardProperties {
128
322
  /**
129
323
  * CalloutCard color.
@@ -725,12 +919,7 @@ export interface MenuProperties {
725
919
  }
726
920
  export type MenuProps = MenuProperties & Omit<HTMLAttributes<HTMLElement>, "color">;
727
921
  export declare const Menu: React.FC<MenuProps> & MenuComponents;
728
- export interface NavTabsItemProperties {
729
- /**
730
- * Icon element to be rendered inside the button.
731
- * @TJS-type React.ReactNode
732
- */
733
- icon: ReactNode;
922
+ export interface NavTabsItemBaseProperties {
734
923
  /**
735
924
  * Controls whether the button is active or not.
736
925
  */
@@ -749,7 +938,30 @@ export interface NavTabsItemProperties {
749
938
  */
750
939
  ariaLabel: string;
751
940
  }
752
- export type NavTabsItemProps = NavTabsItemProperties & Omit<BoxProperties, "onClick"> & Omit<HTMLAttributes<HTMLElement>, "color">;
941
+ export interface NavTabsItemNeutralProperties extends NavTabsItemBaseProperties {
942
+ /**
943
+ * Visual variant of the button.
944
+ * "ai-generative" renders a fixed AI icon with a gradient border and does not accept a custom `icon`.
945
+ * @default "neutral"
946
+ */
947
+ appearance?: "neutral";
948
+ /**
949
+ * Icon element to be rendered inside the button.
950
+ * @TJS-type React.ReactNode
951
+ */
952
+ icon: ReactNode;
953
+ }
954
+ export interface NavTabsItemAIGenerativeProperties extends Omit<NavTabsItemBaseProperties, "active"> {
955
+ /**
956
+ * Visual variant of the button.
957
+ * "ai-generative" renders a fixed AI icon with a gradient border and does not accept a custom `icon`.
958
+ */
959
+ appearance: "ai-generative";
960
+ icon?: never;
961
+ active?: never;
962
+ }
963
+ export type NavTabsItemVariantProperties = NavTabsItemNeutralProperties | NavTabsItemAIGenerativeProperties;
964
+ export type NavTabsItemProps = NavTabsItemVariantProperties & Omit<BoxProperties, "onClick"> & Omit<HTMLAttributes<HTMLElement>, "color">;
753
965
  declare const NavTabsItem: React.FC<NavTabsItemProps>;
754
966
  export interface NavTabsComponents {
755
967
  Item: typeof NavTabsItem;
@@ -1136,82 +1348,28 @@ export type InitialScreenProps = InitialScreenProperties & Omit<BoxProps, "width
1136
1348
  */
1137
1349
  export declare const InitialScreen: React.FC<InitialScreenProps> & InitialScreenComponents;
1138
1350
  export interface PlanDisplayCardProperties {
1139
- /**
1140
- * Renders the card with the Plans 2.0 gradient background (primary-surface → neutral-background).
1141
- * Ignored when `ribbonLabel` is provided.
1142
- */
1143
- gradient?: boolean;
1144
- /**
1145
- * Label shown in a ribbon on top of the card (e.g. "Más escogido"). When provided, the card
1146
- * is rendered with the featured style (primary ribbon + 2px primary border, no shadow),
1147
- * taking precedence over `gradient`.
1148
- * @TJS-type React.ReactNode
1149
- */
1150
- ribbonLabel?: ReactNode;
1351
+ highlighted?: boolean;
1151
1352
  }
1152
1353
  export type PlanDisplayCardProps = PropsWithChildren<PlanDisplayCardProperties> & Omit<BoxProps, "borderColor" | "borderRadius" | "borderStyle" | "borderWidth" | "boxShadow">;
1153
1354
  declare const PlanDisplayCard: React.FC<PlanDisplayCardProps>;
1154
1355
  export type PlanDisplayCardHeaderProperties = {
1155
1356
  subtitle: string;
1156
1357
  title: ReactNode;
1157
- /**
1158
- * Optional slot rendered to the right of the subtitle (e.g. a `<Tag>` like "Plan actual").
1159
- * When provided, the subtitle row is laid out with space between the subtitle and the tag.
1160
- * @TJS-type React.ReactNode
1161
- */
1162
- tag?: ReactNode;
1163
1358
  };
1164
1359
  export type PlanDisplayCardHeaderProps = PropsWithChildren<PlanDisplayCardHeaderProperties>;
1165
1360
  declare const PlanDisplayCardHeader: React.FC<PlanDisplayCardHeaderProps>;
1166
1361
  export type PlanDisplayCardContentProperties = PropsWithChildren;
1167
1362
  declare const PlanDisplayCardContent: React.FC<PlanDisplayCardContentProperties>;
1168
- export type PlanDisplayCardFooterProperties = PropsWithChildren<{
1169
- /**
1170
- * Optional leading icon for an add-on style footer row (e.g. a point-of-sale icon next to a link).
1171
- * When provided, the footer renders the icon and children side by side.
1172
- * @TJS-type React.ReactNode
1173
- */
1174
- icon?: ReactNode;
1175
- }>;
1363
+ export type PlanDisplayCardFooterProperties = PropsWithChildren;
1176
1364
  declare const PlanDisplayCardFooter: React.FC<PlanDisplayCardFooterProperties>;
1177
1365
  export type PlanDisplayCardSpacingProps = Omit<BoxProps, "children" | "borderTopWidth" | "borderColor" | "borderStyle" | "my">;
1178
1366
  declare const PlanDisplayCardSpacing: React.FC<PlanDisplayCardSpacingProps>;
1179
1367
  export type PlanDisplayBulletProperties = {
1180
1368
  icon: ReactNode;
1181
1369
  disabled?: boolean;
1182
- /**
1183
- * Optional slot rendered inline after the bullet text (e.g. a `<Tag>` like "Nuevo").
1184
- * @TJS-type React.ReactNode
1185
- */
1186
- badge?: ReactNode;
1187
1370
  };
1188
1371
  export type PlanDisplayBulletProps = PropsWithChildren<PlanDisplayBulletProperties>;
1189
1372
  declare const PlanDisplayBullet: React.FC<PlanDisplayBulletProps>;
1190
- export type PlanDisplayCardPriceProperties = {
1191
- /**
1192
- * The current price of the plan (e.g. "$999"). Rendered as the main, prominent value.
1193
- * @TJS-type React.ReactNode
1194
- */
1195
- price: ReactNode;
1196
- /**
1197
- * Optional previous price, rendered with a line-through next to the current price.
1198
- * @TJS-type React.ReactNode
1199
- */
1200
- previousPrice?: ReactNode;
1201
- /**
1202
- * Optional billing period suffix (e.g. "/mes") rendered next to the price.
1203
- * @TJS-type React.ReactNode
1204
- */
1205
- period?: ReactNode;
1206
- /**
1207
- * Optional annual note rendered below the price (e.g. "R$696/año. Economiza R$132.").
1208
- * Accepts a ReactNode so it can mix colors (e.g. an emphasized savings span).
1209
- * @TJS-type React.ReactNode
1210
- */
1211
- annualNote?: ReactNode;
1212
- };
1213
- export type PlanDisplayCardPriceProps = PlanDisplayCardPriceProperties;
1214
- declare const PlanDisplayCardPrice: React.FC<PlanDisplayCardPriceProps>;
1215
1373
  /**
1216
1374
  * Interface representing the internal components used in the PlanDisplay.
1217
1375
  */
@@ -1226,10 +1384,6 @@ export interface PlanDisplayComponents {
1226
1384
  * an optional children where additional information can be displayed.
1227
1385
  */
1228
1386
  Header: typeof PlanDisplayCardHeader;
1229
- /**
1230
- * The price component of the plan display card. It renders the current price and optionally a previous price (with line-through), a billing period suffix and an annual note.
1231
- */
1232
- Price: typeof PlanDisplayCardPrice;
1233
1387
  /**
1234
1388
  * The content component of the plan display card. This component is used to display the main content of the plan, such as the plan bullet points.
1235
1389
  */