@lumx/react 4.2.1-alpha.1 → 4.2.1-alpha.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/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # LumApps Design System (LumX)
2
2
 
3
3
  The first official LumApps Design System for [React][react] applications.
4
- _LumX_ will help you design your applications faster and more easily. You will be able to use LumX with either the LumApps design styleguides or the [Google Material Design specifications][material].
4
+ _LumX_ will help you design your applications faster and more easily. You will be able to use LumX with the LumApps design styleguides.
5
5
 
6
6
  ## Quick start
7
7
 
@@ -31,6 +31,5 @@ Please refer to our [contributing guidelines](CONTRIBUTING.md).
31
31
  Code and documentation copyright 2019 LumApps. Code released under the [MIT license](LICENSE.md).
32
32
 
33
33
  [react]: https://react.org/
34
- [material]: http://www.google.com/design/spec/material-design/introduction.html
35
34
  [react-release]: https://www.npmjs.com/package/@lumx/react
36
35
  [webpack]: https://webpack.js.org/
package/index.d.ts CHANGED
@@ -1,16 +1,18 @@
1
- import { Kind as Kind$1, HorizontalAlignment as HorizontalAlignment$1, Size as Size$1, ColorPalette as ColorPalette$1, Orientation as Orientation$1, Alignment as Alignment$1, AspectRatio, ColorWithVariants as ColorWithVariants$1, ColorVariant as ColorVariant$1, Typography as Typography$1, Emphasis as Emphasis$1, GlobalSize, TypographyInterface as TypographyInterface$1, Theme as Theme$1 } from '@lumx/core/js/constants';
1
+ import { Kind as Kind$1, HorizontalAlignment as HorizontalAlignment$1, Size as Size$1, ColorPalette as ColorPalette$1, GenericProps as GenericProps$2, Orientation as Orientation$1, Alignment as Alignment$1, AspectRatio, ColorWithVariants as ColorWithVariants$1, ColorVariant as ColorVariant$1, Typography as Typography$1, Emphasis as Emphasis$1, GlobalSize, TypographyInterface as TypographyInterface$1, Theme as Theme$1 } from '@lumx/core/js/constants';
2
2
  export * from '@lumx/core/js/constants';
3
3
  import * as _lumx_core_js_types from '@lumx/core/js/types';
4
4
  import { GenericProps as GenericProps$1, HasTheme as HasTheme$1, ValueOf, HasAriaDisabled as HasAriaDisabled$1, HasCloseMode, Falsy, HasClassName as HasClassName$1, HeadingElement as HeadingElement$1, HasRequiredLinkHref, HasAriaLabelOrLabelledBy } from '@lumx/core/js/types';
5
5
  export * from '@lumx/core/js/types';
6
6
  import * as React$1 from 'react';
7
- import React__default, { Ref, ReactElement, ReactNode, SyntheticEvent, MouseEventHandler, KeyboardEventHandler, AriaAttributes, InputHTMLAttributes, RefObject, ImgHTMLAttributes, CSSProperties, SetStateAction, Key, ElementType, ComponentProps } from 'react';
7
+ import React__default, { Ref, ReactElement, ReactNode, SyntheticEvent, MouseEventHandler, KeyboardEventHandler, InputHTMLAttributes, RefObject, CSSProperties, ImgHTMLAttributes, AriaAttributes as AriaAttributes$1, SetStateAction, Key, ElementType, ComponentProps } from 'react';
8
+ import { GenericProps } from '@lumx/core/js/types/GenericProps';
9
+ import { GenericProps as GenericProps$3 } from '@lumx/core/js/utils/disabledState';
8
10
 
9
11
  /** LumX Component Type. */
10
12
  type Comp<P, T = HTMLElement> = {
11
13
  (props: P & {
12
14
  ref?: Ref<T>;
13
- }): ReactElement | null;
15
+ } & GenericProps): ReactElement | null;
14
16
  /** React component type. */
15
17
  readonly $$typeof: symbol;
16
18
  /** Component default props. */
@@ -499,16 +501,12 @@ interface HasTheme {
499
501
  }
500
502
 
501
503
  /**
502
- * Define a generic props types.
504
+ * Framework-agnostic type for renderable content.
505
+ * Vue components should cast VNode[] from slots to this type.
506
+ *
507
+ * Note: Uses type-only import to avoid runtime dependencies.
503
508
  */
504
- interface GenericProps extends HasClassName {
505
- /**
506
- * Any prop (particularly any supported prop for a HTML element).
507
- */
508
- [propName: string]: any;
509
- }
510
-
511
- type JSXElement = boolean | number | string | React__default.JSX.Element | React__default.ReactNode | Iterable<JSXElement> | undefined | null;
509
+ type JSXElement = React__default.ReactNode;
512
510
 
513
511
  /** Union type of all heading elements */
514
512
  type HeadingElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
@@ -522,6 +520,8 @@ type KebabCase<S> = S extends `${infer C}${infer T}` ? T extends Uncapitalize<T>
522
520
  /** Transform the component name into the lumx class name. */
523
521
  type LumxClassName<TComponentName extends string> = `lumx-${KebabCase<TComponentName>}`;
524
522
 
523
+ type CommonRef = any;
524
+
525
525
  type Booleanish = boolean | 'true' | 'false';
526
526
 
527
527
  interface HasAriaDisabled {
@@ -529,11 +529,37 @@ interface HasAriaDisabled {
529
529
  'aria-disabled'?: Booleanish;
530
530
  }
531
531
 
532
+ interface AriaAttributes {
533
+ /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
534
+ 'aria-expanded'?: Booleanish | undefined;
535
+ /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
536
+ 'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | undefined;
537
+ /**
538
+ * Defines a string value that labels the current element.
539
+ * @see aria-labelledby.
540
+ */
541
+ 'aria-label'?: string | undefined;
542
+ /**
543
+ * Indicates the current "pressed" state of toggle buttons.
544
+ * @see aria-checked @see aria-selected.
545
+ */
546
+ 'aria-pressed'?: boolean | 'false' | 'mixed' | 'true' | undefined;
547
+ }
548
+
549
+ interface BaseClickableProps {
550
+ children?: JSXElement;
551
+ isDisabled?: boolean;
552
+ disabled?: boolean;
553
+ 'aria-disabled'?: Booleanish;
554
+ onClick?: (event?: any) => void;
555
+ ref?: CommonRef;
556
+ }
557
+
532
558
  /**
533
559
  * Button size definition.
534
560
  */
535
561
  type ButtonSize = Extract<Size, 's' | 'm'>;
536
- interface BaseButtonProps extends GenericProps, Pick<AriaAttributes, 'aria-expanded' | 'aria-haspopup' | 'aria-pressed' | 'aria-label'>, HasTheme, HasAriaDisabled {
562
+ interface BaseButtonProps extends AriaAttributes, HasClassName, HasTheme, HasAriaDisabled, BaseClickableProps {
537
563
  /** Color variant. */
538
564
  color?: ColorPalette;
539
565
  /** Emphasis variant. */
@@ -556,6 +582,14 @@ interface BaseButtonProps extends GenericProps, Pick<AriaAttributes, 'aria-expan
556
582
  type?: 'submit' | 'reset' | 'button' | undefined;
557
583
  /** Custom component for the link (can be used to inject router Link). */
558
584
  linkAs?: 'a' | any;
585
+ /** whether the button is dispalyed in full width or not */
586
+ fullWidth?: boolean;
587
+ /** whether the button is currently active or not */
588
+ isActive?: boolean;
589
+ /** whether the button is currently focused or not */
590
+ isFocused?: boolean;
591
+ /** whether the button is currently focused or not */
592
+ isHovered?: boolean;
559
593
  }
560
594
 
561
595
  /**
@@ -570,7 +604,7 @@ declare const ButtonEmphasis: {
570
604
  /**
571
605
  * Defines the props of the component.
572
606
  */
573
- interface ButtonProps extends /* @vue-ignore */ BaseButtonProps {
607
+ interface ButtonProps$1 extends BaseButtonProps {
574
608
  /** Left icon (SVG path). */
575
609
  leftIcon?: string;
576
610
  /** Right icon (SVG path). */
@@ -591,8 +625,14 @@ declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
591
625
  /**
592
626
  * Component default props.
593
627
  */
594
- declare const DEFAULT_PROPS: Partial<ButtonProps>;
628
+ declare const DEFAULT_PROPS: Partial<ButtonProps$1>;
595
629
 
630
+ interface ButtonProps extends ButtonProps$1 {
631
+ /**
632
+ * Any prop (particularly any supported prop for a HTML element).
633
+ */
634
+ [propName: string]: any;
635
+ }
596
636
  /**
597
637
  * Button component.
598
638
  *
@@ -602,7 +642,7 @@ declare const DEFAULT_PROPS: Partial<ButtonProps>;
602
642
  */
603
643
  declare const Button: Comp<ButtonProps, HTMLButtonElement | HTMLAnchorElement>;
604
644
 
605
- interface IconButtonProps$1 extends /* @vue-ignore */ BaseButtonProps {
645
+ interface IconButtonProps$1 extends BaseButtonProps {
606
646
  /**
607
647
  * Icon (SVG path).
608
648
  * If `image` is also set, `image` will be used instead.
@@ -618,9 +658,17 @@ interface IconButtonProps$1 extends /* @vue-ignore */ BaseButtonProps {
618
658
  * If you really don't want an aria-label, you can set an empty label (this is not recommended).
619
659
  */
620
660
  label: string;
661
+ /**
662
+ * optional text to be displayed as the title of the HTML element
663
+ */
664
+ title?: string;
621
665
  }
622
666
 
623
667
  interface IconButtonProps extends IconButtonProps$1 {
668
+ /**
669
+ * Any prop (particularly any supported prop for a HTML element).
670
+ */
671
+ [propName: string]: any;
624
672
  /**
625
673
  * Props to pass to the tooltip.
626
674
  * If undefined or if tooltipProps.label is undefined, the label prop will be used as tooltip label.
@@ -641,13 +689,17 @@ declare const IconButton: Comp<IconButtonProps, HTMLButtonElement>;
641
689
  /**
642
690
  * Defines the props of the component
643
691
  */
644
- interface ButtonGroupProps extends GenericProps {
692
+ interface ButtonGroupProps$1 extends HasClassName {
645
693
  /**
646
694
  * Children
647
695
  */
648
696
  children?: JSXElement;
697
+ /** reference to the root element */
698
+ ref?: CommonRef;
649
699
  }
650
700
 
701
+ interface ButtonGroupProps extends ButtonGroupProps$1, GenericProps$1 {
702
+ }
651
703
  /**
652
704
  * ButtonGroup component.
653
705
  *
@@ -1202,7 +1254,54 @@ interface ExpansionPanelProps extends GenericProps$1, HasCloseMode, HasTheme$1 {
1202
1254
  */
1203
1255
  declare const ExpansionPanel: Comp<ExpansionPanelProps, HTMLDivElement>;
1204
1256
 
1205
- interface FlagProps$1 extends GenericProps, HasTheme {
1257
+ /**
1258
+ * Defines the props of the component.
1259
+ */
1260
+ interface TextProps$1 extends HasClassName {
1261
+ /**
1262
+ * Color variant.
1263
+ */
1264
+ color?: ColorWithVariants;
1265
+ /**
1266
+ * Lightened or darkened variant of the selected color.
1267
+ */
1268
+ colorVariant?: ColorVariant;
1269
+ /**
1270
+ * Typography variant.
1271
+ */
1272
+ typography?: Typography;
1273
+ /**
1274
+ * Custom component to render the text.
1275
+ */
1276
+ as: TextElement;
1277
+ /**
1278
+ * Control whether the text should truncate or not.
1279
+ * Setting as `true` will make the text truncate on a single line.
1280
+ * Setting as `{ lines: number }` will make the text truncate on a multiple lines.
1281
+ */
1282
+ truncate?: boolean | {
1283
+ lines: number;
1284
+ };
1285
+ /**
1286
+ * Prevents text to wrap on multiple lines
1287
+ * (automatically activated when single line text truncate is activated).
1288
+ */
1289
+ noWrap?: boolean;
1290
+ /**
1291
+ * WhiteSpace variant
1292
+ * Ignored when `noWrap` is set to true
1293
+ * Ignored when `truncate` is set to true or lines: 1
1294
+ * */
1295
+ whiteSpace?: WhiteSpace;
1296
+ /**
1297
+ * Children
1298
+ */
1299
+ children?: JSXElement;
1300
+ /** list of styles to apply */
1301
+ style?: CSSProperties;
1302
+ }
1303
+
1304
+ interface FlagProps$1 extends HasClassName, HasTheme {
1206
1305
  /** Color of the component. */
1207
1306
  color?: ColorPalette;
1208
1307
  /** Icon to use before the label. */
@@ -1211,9 +1310,13 @@ interface FlagProps$1 extends GenericProps, HasTheme {
1211
1310
  children: JSXElement;
1212
1311
  /** Enable text truncate on overflow */
1213
1312
  truncate?: boolean;
1313
+ /** ref to the root element */
1314
+ ref?: CommonRef;
1315
+ /** Text component to use for rendering the label */
1316
+ Text: (props: TextProps$1) => any;
1214
1317
  }
1215
1318
 
1216
- interface FlagProps extends Omit<FlagProps$1, 'children'> {
1319
+ interface FlagProps extends GenericProps$2, Omit<FlagProps$1, 'children' | 'Text'> {
1217
1320
  label: React.ReactNode;
1218
1321
  }
1219
1322
  /**
@@ -1234,7 +1337,7 @@ type FlexHorizontalAlignment = HorizontalAlignment | SpaceAlignment;
1234
1337
  /**
1235
1338
  * Defines the props of the component.
1236
1339
  */
1237
- interface FlexBoxProps$1 extends GenericProps {
1340
+ interface FlexBoxProps$1 extends HasClassName {
1238
1341
  /** Children elements. */
1239
1342
  children?: JSXElement;
1240
1343
  /** Whether the "content filling space" is enabled or not. */
@@ -1258,7 +1361,7 @@ interface FlexBoxProps$1 extends GenericProps {
1258
1361
  /**
1259
1362
  * Defines the props of the component.
1260
1363
  */
1261
- interface FlexBoxProps extends FlexBoxProps$1 {
1364
+ interface FlexBoxProps extends FlexBoxProps$1, GenericProps$1 {
1262
1365
  /** Customize the root element. */
1263
1366
  as?: React__default.ElementType;
1264
1367
  }
@@ -1375,58 +1478,15 @@ declare const GenericBlock: GenericBlock;
1375
1478
  /**
1376
1479
  * Defines the props of the component.
1377
1480
  */
1378
- interface TextProps extends GenericProps {
1379
- /**
1380
- * Color variant.
1381
- */
1382
- color?: ColorWithVariants;
1383
- /**
1384
- * Lightened or darkened variant of the selected color.
1385
- */
1386
- colorVariant?: ColorVariant;
1387
- /**
1388
- * Typography variant.
1389
- */
1390
- typography?: Typography;
1391
- /**
1392
- * Custom component to render the text.
1393
- */
1394
- as: TextElement;
1395
- /**
1396
- * Control whether the text should truncate or not.
1397
- * Setting as `true` will make the text truncate on a single line.
1398
- * Setting as `{ lines: number }` will make the text truncate on a multiple lines.
1399
- */
1400
- truncate?: boolean | {
1401
- lines: number;
1402
- };
1403
- /**
1404
- * Prevents text to wrap on multiple lines
1405
- * (automatically activated when single line text truncate is activated).
1406
- */
1407
- noWrap?: boolean;
1408
- /**
1409
- * WhiteSpace variant
1410
- * Ignored when `noWrap` is set to true
1411
- * Ignored when `truncate` is set to true or lines: 1
1412
- * */
1413
- whiteSpace?: WhiteSpace;
1414
- /**
1415
- * Children
1416
- */
1417
- children?: JSXElement;
1418
- }
1419
-
1420
- /**
1421
- * Defines the props of the component.
1422
- */
1423
- interface HeadingProps extends Partial<TextProps> {
1481
+ interface HeadingProps$1 extends Partial<TextProps$1> {
1424
1482
  /**
1425
1483
  * Display a specific heading level instead of the one provided by parent context provider.
1426
1484
  */
1427
1485
  as?: HeadingElement;
1428
1486
  }
1429
1487
 
1488
+ interface HeadingProps extends HeadingProps$1, GenericProps$1 {
1489
+ }
1430
1490
  /**
1431
1491
  * Renders a heading component.
1432
1492
  * Extends the `Text` Component with the heading level automatically computed based on
@@ -1533,7 +1593,7 @@ type IconSizes = (typeof ICON_SIZES)[number];
1533
1593
  /**
1534
1594
  * Defines the props of the component.
1535
1595
  */
1536
- interface IconProps extends GenericProps, HasTheme {
1596
+ interface IconProps$1 extends HasClassName, HasTheme {
1537
1597
  /** Color variant. */
1538
1598
  color?: ColorWithVariants;
1539
1599
  /** Lightened or darkened variant of the selected icon color. */
@@ -1551,8 +1611,12 @@ interface IconProps extends GenericProps, HasTheme {
1551
1611
  alt?: string;
1552
1612
  /** Vertical alignment of the icon (only applies for icons nested in Text/Heading). */
1553
1613
  verticalAlign?: null | 'middle';
1614
+ /** reference to the root element */
1615
+ ref?: CommonRef;
1554
1616
  }
1555
1617
 
1618
+ interface IconProps extends IconProps$1, GenericProps$1 {
1619
+ }
1556
1620
  /**
1557
1621
  * Icon component.
1558
1622
  *
@@ -1821,13 +1885,17 @@ declare const InlineList: Comp<InlineListProps, HTMLElement>;
1821
1885
  /**
1822
1886
  * Defines the props of the component.
1823
1887
  */
1824
- interface InputHelperProps extends GenericProps, HasTheme {
1888
+ interface InputHelperProps$1 extends HasClassName, HasTheme {
1825
1889
  /** Helper content. */
1826
1890
  children: JSXElement;
1827
1891
  /** Helper variant. */
1828
1892
  kind?: Kind;
1893
+ /** ref to the root element `p` */
1894
+ ref?: CommonRef;
1829
1895
  }
1830
1896
 
1897
+ interface InputHelperProps extends InputHelperProps$1, GenericProps$3 {
1898
+ }
1831
1899
  /**
1832
1900
  * InputHelper component.
1833
1901
  *
@@ -1837,7 +1905,7 @@ interface InputHelperProps extends GenericProps, HasTheme {
1837
1905
  */
1838
1906
  declare const InputHelper: Comp<InputHelperProps, HTMLParagraphElement>;
1839
1907
 
1840
- interface InputLabelProps extends GenericProps, HasTheme {
1908
+ interface InputLabelProps$1 extends HasClassName, HasTheme {
1841
1909
  /** Typography variant. */
1842
1910
  typography?: Typography;
1843
1911
  /** Label content. */
@@ -1846,8 +1914,12 @@ interface InputLabelProps extends GenericProps, HasTheme {
1846
1914
  htmlFor: string;
1847
1915
  /** Whether the component is required or not. */
1848
1916
  isRequired?: boolean;
1917
+ /** ref to the root element */
1918
+ ref?: CommonRef;
1849
1919
  }
1850
1920
 
1921
+ interface InputLabelProps extends InputLabelProps$1, GenericProps$2 {
1922
+ }
1851
1923
  /**
1852
1924
  * InputLabel component.
1853
1925
  *
@@ -1860,7 +1932,7 @@ declare const InputLabel: Comp<InputLabelProps, HTMLLabelElement>;
1860
1932
  /**
1861
1933
  * Defines the props of the component.
1862
1934
  */
1863
- interface LightboxProps extends GenericProps$1, HasTheme$1, Pick<AriaAttributes, 'aria-label' | 'aria-labelledby'> {
1935
+ interface LightboxProps extends GenericProps$1, HasTheme$1, Pick<AriaAttributes$1, 'aria-label' | 'aria-labelledby'> {
1864
1936
  /** Props to pass to the close button (minus those already set by the Lightbox props). */
1865
1937
  closeButtonProps?: Pick<IconButtonProps, 'label'> & Omit<IconButtonProps, 'label' | 'onClick' | 'icon' | 'emphasis' | 'color'>;
1866
1938
  /** Whether the component is open or not. */
@@ -2075,7 +2147,7 @@ declare const ListSubheader: Comp<ListSubheaderProps, HTMLLIElement>;
2075
2147
  /**
2076
2148
  * Defines the props of the component.
2077
2149
  */
2078
- interface MessageProps extends GenericProps {
2150
+ interface MessageProps$1 extends HasClassName {
2079
2151
  /** Content. */
2080
2152
  children?: JSXElement;
2081
2153
  /** Whether the message has a background or not. */
@@ -2084,6 +2156,8 @@ interface MessageProps extends GenericProps {
2084
2156
  kind?: Kind;
2085
2157
  /** Message custom icon SVG path. */
2086
2158
  icon?: string;
2159
+ /** Reference to the message container element. */
2160
+ ref?: CommonRef;
2087
2161
  /**
2088
2162
  * Displays a close button.
2089
2163
  *
@@ -2097,6 +2171,10 @@ interface MessageProps extends GenericProps {
2097
2171
  };
2098
2172
  }
2099
2173
 
2174
+ interface MessageProps extends Omit<MessageProps$1, 'children' | 'ref'> {
2175
+ /** Content. */
2176
+ children?: React.ReactNode;
2177
+ }
2100
2178
  /**
2101
2179
  * Message component.
2102
2180
  *
@@ -3166,6 +3244,8 @@ interface TabPanelProps extends GenericProps$1 {
3166
3244
  */
3167
3245
  declare const TabPanel: Comp<TabPanelProps, HTMLDivElement>;
3168
3246
 
3247
+ interface TextProps extends TextProps$1, GenericProps$1 {
3248
+ }
3169
3249
  /**
3170
3250
  * Text component.
3171
3251
  *
package/index.js CHANGED
@@ -1018,9 +1018,9 @@ const RawClickable$1 = props => {
1018
1018
  };
1019
1019
  }
1020
1020
  return /*#__PURE__*/jsx(Component, {
1021
- "aria-disabled": isAnyDisabled || undefined,
1022
1021
  ...forwardedProps,
1023
1022
  ...clickableProps,
1023
+ "aria-disabled": isAnyDisabled || undefined,
1024
1024
  onClick: event => {
1025
1025
  if (isAnyDisabled) {
1026
1026
  event.stopPropagation();
@@ -6449,10 +6449,7 @@ const {
6449
6449
  * @param props Component props.
6450
6450
  * @return JSX element.
6451
6451
  */
6452
- const Flag$1 = (props, nestedComponents) => {
6453
- const {
6454
- Text
6455
- } = nestedComponents || {};
6452
+ const Flag$1 = props => {
6456
6453
  const {
6457
6454
  children,
6458
6455
  icon,
@@ -6460,6 +6457,7 @@ const Flag$1 = (props, nestedComponents) => {
6460
6457
  className,
6461
6458
  theme,
6462
6459
  truncate,
6460
+ Text,
6463
6461
  ...forwardedProps
6464
6462
  } = props;
6465
6463
  const flagColor = color || (theme === Theme.light ? ColorPalette.dark : ColorPalette.light);
@@ -6476,7 +6474,7 @@ const Flag$1 = (props, nestedComponents) => {
6476
6474
  className: element$B('icon')
6477
6475
  }), /*#__PURE__*/jsx(Text, {
6478
6476
  as: "span",
6479
- truncate: !!props.truncate,
6477
+ truncate: !!truncate,
6480
6478
  typography: "overline",
6481
6479
  className: element$B('label'),
6482
6480
  children: children
@@ -6497,8 +6495,7 @@ const Flag = forwardRef((props, ref) => {
6497
6495
  ...props,
6498
6496
  theme: props.theme || defaultTheme,
6499
6497
  ref,
6500
- children: props.label
6501
- }, {
6498
+ children: props.label,
6502
6499
  Text
6503
6500
  });
6504
6501
  });
@@ -7823,7 +7820,7 @@ function setupViewTransitionName(elementRef, name) {
7823
7820
  return {
7824
7821
  set() {
7825
7822
  const element = unref(elementRef);
7826
- if (!element) return;
7823
+ if (!element || !name) return;
7827
7824
  originalName = element.style.viewTransitionName;
7828
7825
  element.style.viewTransitionName = name;
7829
7826
  },
@@ -7851,15 +7848,15 @@ async function startViewTransition({
7851
7848
  const {
7852
7849
  flushSync
7853
7850
  } = ReactDOM;
7854
- if (prefersReducedMotion || !start || !flushSync || !viewTransitionName?.source || !viewTransitionName?.target) {
7851
+ if (prefersReducedMotion || !start || !flushSync || viewTransitionName && (!viewTransitionName?.source || !viewTransitionName?.target)) {
7855
7852
  // Skip, apply changes without a transition
7856
7853
  changes();
7857
7854
  return;
7858
7855
  }
7859
7856
 
7860
7857
  // Setup set/unset transition name on source & target
7861
- const sourceTransitionName = setupViewTransitionName(viewTransitionName.source, viewTransitionName.name);
7862
- const targetTransitionName = setupViewTransitionName(viewTransitionName.target, viewTransitionName.name);
7858
+ const sourceTransitionName = setupViewTransitionName(viewTransitionName?.source, viewTransitionName?.name);
7859
+ const targetTransitionName = setupViewTransitionName(viewTransitionName?.target, viewTransitionName?.name);
7863
7860
  sourceTransitionName.set();
7864
7861
 
7865
7862
  // Start view transition, apply changes & flush to DOM
@@ -8851,6 +8848,7 @@ const Message$1 = props => {
8851
8848
  kind,
8852
8849
  icon: customIcon,
8853
8850
  closeButtonProps,
8851
+ ref,
8854
8852
  ...forwardedProps
8855
8853
  } = props;
8856
8854
  const {
@@ -8864,6 +8862,7 @@ const Message$1 = props => {
8864
8862
  const isCloseButtonDisplayed = hasBackground && kind === 'info' && onClick && closeButtonLabel;
8865
8863
  return /*#__PURE__*/jsxs("div", {
8866
8864
  ...forwardedProps,
8865
+ ref: ref,
8867
8866
  className: classnames(className, block$B({
8868
8867
  [`color-${color}`]: Boolean(color),
8869
8868
  'has-background': hasBackground