@zvoove/unity-ui 2.45.1 → 2.47.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.
@@ -206,17 +206,18 @@ declare type AxisVariant = 'X' | 'Y';
206
206
 
207
207
  export declare type BackgroundColors = 'background' | 'outline' | 'outline-variant' | 'outline-low' | 'primary' | 'primary-hover' | 'primary-active' | 'secondary' | 'tertiary' | 'primary-container' | 'secondary-container' | 'tertiary-container' | 'tertiary-container-hover' | 'tertiary-container-active' | 'primary-fixed' | 'primary-fixed-dim' | 'secondary-fixed' | 'secondary-fixed-dim' | 'tertiary-fixed' | 'tertiary-fixed-dim' | 'surface' | 'surface-bright' | 'surface-dim' | 'surface-variant' | 'surface-container-lowest' | 'surface-container-low' | 'surface-container' | 'surface-container-high' | 'surface-container-highest' | 'error' | 'error-container' | 'warning' | 'dark-warning' | 'warning-container' | 'inverse-surface' | 'inverse-on-surface' | 'inverse-primary' | 'scrim' | 'yellow' | 'dark-yellow' | 'yellow-container' | 'green' | 'dark-green' | 'green-container' | 'pink' | 'dark-pink' | 'pink-container' | 'steel-blue' | 'dark-steel-blue' | 'steel-blue-container' | 'container-neutral' | 'container-neutral-hover' | 'code-surface' | 'code-surface-variant';
208
208
 
209
- export declare const Badge: ({ children, variant, content, dot, }: BadgeProps) => JSX.Element;
209
+ export declare const Badge: ({ children, variant, content, dot, inline, visible, }: BadgeProps) => JSX.Element;
210
210
 
211
211
  export declare interface BadgeProps {
212
212
  /**
213
- * The children of the button.
213
+ * The element the badge is attached to. Not required when `inline` is
214
+ * true, since the badge can then render entirely on its own.
214
215
  */
215
- children: ReactNode;
216
+ children?: ReactNode;
216
217
  /**
217
218
  * The variant of the component
218
219
  */
219
- variant?: 'primary' | 'secondary';
220
+ variant?: 'primary' | 'secondary' | 'negative';
220
221
  /**
221
222
  * The content of the badge. If undefined, the badge will be hidden.
222
223
  */
@@ -225,6 +226,21 @@ export declare interface BadgeProps {
225
226
  * The dot prop changes a badge into a small dot
226
227
  */
227
228
  dot?: boolean;
229
+ /**
230
+ * Render the badge in normal document flow next to `children`, instead of
231
+ * absolutely positioned over its top-right corner. Use this for a
232
+ * standalone count that isn't attached to an icon or avatar — for example,
233
+ * as trailing content next to a navigation item's label.
234
+ * @default false
235
+ */
236
+ inline?: boolean;
237
+ /**
238
+ * Whether the badge pill is shown. Unlike omitting `content`, the pill
239
+ * stays mounted and fades out via opacity instead of disappearing
240
+ * instantly — use this when toggling visibility should animate.
241
+ * @default true
242
+ */
243
+ visible?: boolean;
228
244
  }
229
245
 
230
246
  export declare const Breadcrumbs: <T extends default_2.ElementType = "a">({ items, linkComponent: LinkComponent, homeIcon, }: BreadcrumbsProps<T>) => JSX.Element;
@@ -263,7 +279,7 @@ declare const BREAKPOINTS: {
263
279
  };
264
280
 
265
281
  export declare const Button: {
266
- <T extends React.ElementType = "button">({ children, variant, hideLabel, as, icon, linkComponent, size, isLoading, ...props }: ButtonProps<T> & {
282
+ <T extends React.ElementType = "button">({ children, variant, hideLabel, as, icon, linkComponent, size, isLoading, contrast, ...props }: ButtonProps<T> & {
267
283
  ref?: ForwardedRef<T>;
268
284
  }): JSX.Element;
269
285
  displayName: string;
@@ -295,7 +311,18 @@ export declare type ButtonProps<T extends React.ElementType = 'button'> = UnionA
295
311
  * The variant is used
296
312
  * to change the visual communication.
297
313
  */
298
- variant?: ResponsiveType<'text' | 'textSecondary' | 'filled' | 'outlined' | 'elevated' | 'tonal' | 'linkPrimary' | 'linkSecondary' | 'positive' | 'negative'>;
314
+ variant?: ResponsiveType<'text' | 'textSecondary' | 'filled' | 'outlined' | 'elevated' | 'tonal' | 'linkPrimary' | 'linkSecondary' | 'positive' | 'negative' | 'warning' | 'neutral' | 'white' | 'subtle' | 'outlinedPositive' | 'outlinedNegative' | 'outlinedWarning' | 'outlinedNeutral' | 'outlinedSubtle' | 'linkPositive' | 'linkNegative' | 'linkWarning' | 'linkWhite' | 'textPositive' | 'textNegative' | 'textWarning' | 'textWhite' | 'textSubtle'>;
315
+ /**
316
+ * Uses the container-tier color of the status `variant` instead of the
317
+ * vivid one — lighter in light mode, darker in dark mode. Use this to keep
318
+ * the button legible when it sits on a background from the same color
319
+ * family (e.g. an action button inside a matching colored `InfoBox`). <br />
320
+ * Only affects the status variants (`positive`, `negative`, `warning`,
321
+ * `neutral`, `subtle` and their `outlined*`/`link*`/`text*` counterparts) —
322
+ * ignored otherwise.
323
+ * @default false
324
+ */
325
+ contrast?: boolean;
299
326
  /**
300
327
  * The component to render the button as. <br />
301
328
  * This is useful if you want to use a different component for the button like a `Link` component from **Next.js** or **React Router**.
@@ -1289,6 +1316,65 @@ export declare interface DividerProps {
1289
1316
  color?: BackgroundColors;
1290
1317
  }
1291
1318
 
1319
+ export declare const EmptyState: {
1320
+ ({ type, title, supportingText, icon, actions, }: EmptyStateProps): JSX.Element;
1321
+ displayName: string;
1322
+ };
1323
+
1324
+ export declare interface EmptyStateAction {
1325
+ /**
1326
+ * The label shown in the action button.
1327
+ */
1328
+ label: string;
1329
+ /**
1330
+ * The callback fired when the action button is clicked.
1331
+ */
1332
+ onClick?: () => void;
1333
+ /**
1334
+ * The Button visual variant.
1335
+ * @default 'outlined' for all actions except the last, which defaults to 'filled'
1336
+ */
1337
+ variant?: EmptyStateActionVariant;
1338
+ }
1339
+
1340
+ export declare type EmptyStateActionVariant = NonNullable<ButtonProps['variant']>;
1341
+
1342
+ export declare interface EmptyStateProps {
1343
+ /**
1344
+ * The content preset to display.
1345
+ */
1346
+ type: EmptyStateType;
1347
+ /**
1348
+ * The heading. Pass `false` to hide it, or a custom string/node to
1349
+ * override the preset's default text.
1350
+ * @default true (shows the preset's default title)
1351
+ */
1352
+ title?: ReactNode;
1353
+ /**
1354
+ * The supporting text. Pass `false` to hide it, or a custom string/node to
1355
+ * override the preset's default text.
1356
+ * @default true (shows the preset's default supporting text)
1357
+ */
1358
+ supportingText?: ReactNode;
1359
+ /**
1360
+ * The featured icon. Pass `false` to hide it, a semantic icon name to swap
1361
+ * the glyph while keeping the preset's default color and size, or a
1362
+ * partial `IconProps` object to override any combination of name, color,
1363
+ * size, weight, or featured — any field left out falls back to the
1364
+ * preset's default.
1365
+ * @default true (shows the preset's default icon)
1366
+ */
1367
+ icon?: boolean | CommonIconNames | Partial<IconProps>;
1368
+ /**
1369
+ * The action buttons. Pass `false` to hide them, or an array of actions to
1370
+ * fully replace the preset's default buttons, including click handlers.
1371
+ * @default true (shows the preset's default actions)
1372
+ */
1373
+ actions?: boolean | EmptyStateAction[];
1374
+ }
1375
+
1376
+ export declare type EmptyStateType = 'noResults' | 'noDataYet' | 'error' | 'noSelection' | 'locked';
1377
+
1292
1378
  export declare const Expandable: {
1293
1379
  <T extends React.ElementType = "div">({ children, isOpen, as: Component, ...props }: ExpandableProps<T>): JSX.Element;
1294
1380
  displayName: string;
@@ -2249,7 +2335,7 @@ export declare interface ImageVisualizerProps {
2249
2335
  }
2250
2336
 
2251
2337
  export declare const InfoBox: {
2252
- ({ message, title, variant, icon, elevated, borderRadius, actions, showCloseButton, onClose, }: InfoBoxProps): JSX.Element;
2338
+ ({ message, title, variant, icon, elevated, borderRadius, leftBorder, actions, showCloseButton, onClose, }: InfoBoxProps): JSX.Element;
2253
2339
  displayName: string;
2254
2340
  };
2255
2341
 
@@ -2299,9 +2385,15 @@ export declare interface InfoBoxProps {
2299
2385
  elevated?: boolean;
2300
2386
  /**
2301
2387
  * The border radius of the InfoBox.
2302
- * @default 'sm'
2388
+ * @default 'rounded'
2303
2389
  */
2304
- borderRadius?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
2390
+ borderRadius?: 'none' | 'rounded';
2391
+ /**
2392
+ * Whether to display a 4px left border. The border color follows the
2393
+ * `variant`.
2394
+ * @default false
2395
+ */
2396
+ leftBorder?: boolean;
2305
2397
  /**
2306
2398
  * Optional action buttons displayed beside the message when they fit in this
2307
2399
  * container, or on the next line when they do not.
@@ -2390,6 +2482,28 @@ export declare type ListMenuItem<T extends React.ElementType = 'a'> = {
2390
2482
  * @default 'always'
2391
2483
  */
2392
2484
  endContentVisibility?: 'always' | 'hover';
2485
+ /**
2486
+ * A count (or other short content) shown as a badge attached to this item.
2487
+ * Renders inline next to the label when the menu is open, and relocates to
2488
+ * overlay the item's icon when the menu is closed (icon-only rail). Has no
2489
+ * effect if the item has no `icon` and the menu is closed.
2490
+ */
2491
+ badge?: React.ReactNode;
2492
+ /**
2493
+ * Background/foreground color of `badge`.
2494
+ * @default 'negative'
2495
+ */
2496
+ badgeVariant?: BadgeProps['variant'];
2497
+ /**
2498
+ * Shows a small release/status tag next to this item's label (e.g.
2499
+ * "Beta", "Alpha", "v1.2", "dev") — freely set its text and color via
2500
+ * `label`/`color`/`variant`, the same options `Tag` itself accepts. When
2501
+ * the menu is closed (icon-only rail), the same tag renders as a small
2502
+ * overlay on the item's icon so its text stays visible instead of
2503
+ * disappearing. If `badge` is also set, `badge` takes the icon-corner
2504
+ * slot and the tag overlay is skipped — its label still shows when open.
2505
+ */
2506
+ tag?: ListMenuItemTag;
2393
2507
  /**
2394
2508
  * Renders a spacer instead of a menu item.
2395
2509
  * @default false
@@ -2397,6 +2511,12 @@ export declare type ListMenuItem<T extends React.ElementType = 'a'> = {
2397
2511
  isSpacer?: boolean;
2398
2512
  } & Omit<React.ComponentPropsWithoutRef<T>, 'children'>;
2399
2513
 
2514
+ /**
2515
+ * Freely label and color a release/status tag on an item — same options as
2516
+ * `Tag` itself (e.g. `{ label: 'v1.2', color: 'steel-blue' }`).
2517
+ */
2518
+ declare type ListMenuItemTag = Pick<TagProps, 'label' | 'color' | 'variant'>;
2519
+
2400
2520
  export declare type ListMenuProps<T extends React.ElementType = 'a'> = {
2401
2521
  /**
2402
2522
  * Either a flat list of menu items (default) **or** an array of sections
@@ -3231,12 +3351,18 @@ export declare interface ScrollableAreaProps {
3231
3351
  children: ReactNode;
3232
3352
  /**
3233
3353
  * Height of the scrollable area. When omitted, the area fills its parent
3234
- * (`size-full`, or `h-full` if only `width` is set).
3354
+ * (`size-full`, or `h-full` if only `width` is set). If the parent has no
3355
+ * definite height for that percentage to resolve against (e.g. inside a
3356
+ * flex/grid layout), the rendered parent height is measured and applied
3357
+ * directly instead.
3235
3358
  */
3236
3359
  height?: ResponsiveType<number | string>;
3237
3360
  /**
3238
3361
  * Width of the scrollable area. When omitted, the area fills its parent
3239
- * (`size-full`, or `w-full` if only `height` is set).
3362
+ * (`size-full`, or `w-full` if only `height` is set). If the parent has no
3363
+ * definite width for that percentage to resolve against (e.g. inside a
3364
+ * flex/grid layout), the rendered parent width is measured and applied
3365
+ * directly instead.
3240
3366
  */
3241
3367
  width?: ResponsiveType<number | string>;
3242
3368
  /**
@@ -4117,8 +4243,9 @@ export declare interface TableProps<T extends readonly TableColumnProps[] = read
4117
4243
  */
4118
4244
  footer?: React.ReactNode;
4119
4245
  /**
4120
- * The background color of the table header.
4121
- * @default false
4246
+ * The background color of the table header, matching the background used
4247
+ * by section rows.
4248
+ * @default true
4122
4249
  */
4123
4250
  headerBackgroundColor?: boolean;
4124
4251
  /**
@@ -4273,7 +4400,14 @@ export declare type TabStepperItem<T extends React.ElementType = 'button'> = {
4273
4400
  * @default The item's position in the list
4274
4401
  */
4275
4402
  stepNumber?: number;
4276
- } & Omit<React.ComponentPropsWithoutRef<T>, 'children' | 'id' | 'onClick' | 'title'>;
4403
+ /**
4404
+ * Whether the step is disabled. A disabled step can't be selected by click
4405
+ * or keyboard and is skipped by arrow-key navigation. Use this to block
4406
+ * upcoming steps until earlier ones are complete.
4407
+ * @default false
4408
+ */
4409
+ disabled?: boolean;
4410
+ } & Omit<React.ComponentPropsWithoutRef<T>, 'children' | 'id' | 'onClick' | 'title' | 'disabled'>;
4277
4411
 
4278
4412
  export declare type TabStepperItemsAlignment = 'left' | 'center' | 'right' | 'spread';
4279
4413
 
@@ -4421,6 +4555,13 @@ export declare interface TextareaProps extends Omit<React.TextareaHTMLAttributes
4421
4555
  * The actions to display below the textarea.
4422
4556
  */
4423
4557
  actions?: React.ReactNode;
4558
+ /**
4559
+ * Shows a moving multi-color gradient border instead of the plain one, as
4560
+ * an "AI is working" affordance (e.g. while a response is streaming into
4561
+ * the field). Has no effect while `error` is true.
4562
+ * @default false
4563
+ */
4564
+ aiActive?: boolean;
4424
4565
  }
4425
4566
 
4426
4567
  export declare const TextField: ForwardRefExoticComponent<TextFieldProps & RefAttributes<HTMLInputElement>>;
@@ -4502,7 +4643,7 @@ export declare interface TextFieldProps extends React.InputHTMLAttributes<HTMLIn
4502
4643
  onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
4503
4644
  }
4504
4645
 
4505
- export declare const Tooltip: ({ children, content, placement, disabled, }: TooltipProps) => JSX.Element;
4646
+ export declare const Tooltip: ({ children, content, placement, disabled, fitToContent, isOpen: isOpenProp, }: TooltipProps) => JSX.Element;
4506
4647
 
4507
4648
  export declare interface TooltipProps {
4508
4649
  /**
@@ -4517,12 +4658,23 @@ export declare interface TooltipProps {
4517
4658
  * The position of the tooltip relative to its trigger
4518
4659
  */
4519
4660
  placement?: 'top' | 'bottom' | 'left' | 'right';
4661
+ /**
4662
+ * Shrink the trigger wrapper to fit the trigger's own content, instead of
4663
+ * stretching to fill its container's width. Enable this when the default
4664
+ * full-width wrapper doesn't fit the surrounding layout (for example, a
4665
+ * flex row where it shouldn't claim the whole row).
4666
+ * @default false
4667
+ */
4668
+ fitToContent?: ResponsiveType<boolean>;
4520
4669
  /**
4521
4670
  * Whether the tooltip should be disabled
4522
4671
  */
4523
4672
  disabled?: boolean;
4524
4673
  /**
4525
- * Whether the tooltip should be open
4674
+ * Controls the tooltip's visibility externally instead of the default
4675
+ * hover behavior. When set (even to `false`), hover/mouse-leave no longer
4676
+ * toggle the tooltip — the caller is fully responsible for its visibility.
4677
+ * `disabled` still takes precedence and forces the tooltip closed.
4526
4678
  */
4527
4679
  isOpen?: boolean;
4528
4680
  }