@lumx/react 4.2.1-alpha.1 → 4.2.1-alpha.10
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 +1 -2
- package/index.d.ts +145 -73
- package/index.js +11 -12
- package/index.js.map +1 -1
- package/package.json +3 -3
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
|
|
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,
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
|
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
|
|
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,10 @@ 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 GenericProps$2, ButtonProps$1 {
|
|
631
|
+
}
|
|
596
632
|
/**
|
|
597
633
|
* Button component.
|
|
598
634
|
*
|
|
@@ -602,7 +638,7 @@ declare const DEFAULT_PROPS: Partial<ButtonProps>;
|
|
|
602
638
|
*/
|
|
603
639
|
declare const Button: Comp<ButtonProps, HTMLButtonElement | HTMLAnchorElement>;
|
|
604
640
|
|
|
605
|
-
interface IconButtonProps$1 extends
|
|
641
|
+
interface IconButtonProps$1 extends BaseButtonProps {
|
|
606
642
|
/**
|
|
607
643
|
* Icon (SVG path).
|
|
608
644
|
* If `image` is also set, `image` will be used instead.
|
|
@@ -618,9 +654,13 @@ interface IconButtonProps$1 extends /* @vue-ignore */ BaseButtonProps {
|
|
|
618
654
|
* If you really don't want an aria-label, you can set an empty label (this is not recommended).
|
|
619
655
|
*/
|
|
620
656
|
label: string;
|
|
657
|
+
/**
|
|
658
|
+
* optional text to be displayed as the title of the HTML element
|
|
659
|
+
*/
|
|
660
|
+
title?: string;
|
|
621
661
|
}
|
|
622
662
|
|
|
623
|
-
interface IconButtonProps extends IconButtonProps$1 {
|
|
663
|
+
interface IconButtonProps extends GenericProps$2, IconButtonProps$1 {
|
|
624
664
|
/**
|
|
625
665
|
* Props to pass to the tooltip.
|
|
626
666
|
* If undefined or if tooltipProps.label is undefined, the label prop will be used as tooltip label.
|
|
@@ -641,13 +681,17 @@ declare const IconButton: Comp<IconButtonProps, HTMLButtonElement>;
|
|
|
641
681
|
/**
|
|
642
682
|
* Defines the props of the component
|
|
643
683
|
*/
|
|
644
|
-
interface ButtonGroupProps extends
|
|
684
|
+
interface ButtonGroupProps$1 extends HasClassName {
|
|
645
685
|
/**
|
|
646
686
|
* Children
|
|
647
687
|
*/
|
|
648
688
|
children?: JSXElement;
|
|
689
|
+
/** reference to the root element */
|
|
690
|
+
ref?: CommonRef;
|
|
649
691
|
}
|
|
650
692
|
|
|
693
|
+
interface ButtonGroupProps extends ButtonGroupProps$1, GenericProps$1 {
|
|
694
|
+
}
|
|
651
695
|
/**
|
|
652
696
|
* ButtonGroup component.
|
|
653
697
|
*
|
|
@@ -1202,7 +1246,54 @@ interface ExpansionPanelProps extends GenericProps$1, HasCloseMode, HasTheme$1 {
|
|
|
1202
1246
|
*/
|
|
1203
1247
|
declare const ExpansionPanel: Comp<ExpansionPanelProps, HTMLDivElement>;
|
|
1204
1248
|
|
|
1205
|
-
|
|
1249
|
+
/**
|
|
1250
|
+
* Defines the props of the component.
|
|
1251
|
+
*/
|
|
1252
|
+
interface TextProps$1 extends HasClassName {
|
|
1253
|
+
/**
|
|
1254
|
+
* Color variant.
|
|
1255
|
+
*/
|
|
1256
|
+
color?: ColorWithVariants;
|
|
1257
|
+
/**
|
|
1258
|
+
* Lightened or darkened variant of the selected color.
|
|
1259
|
+
*/
|
|
1260
|
+
colorVariant?: ColorVariant;
|
|
1261
|
+
/**
|
|
1262
|
+
* Typography variant.
|
|
1263
|
+
*/
|
|
1264
|
+
typography?: Typography;
|
|
1265
|
+
/**
|
|
1266
|
+
* Custom component to render the text.
|
|
1267
|
+
*/
|
|
1268
|
+
as: TextElement;
|
|
1269
|
+
/**
|
|
1270
|
+
* Control whether the text should truncate or not.
|
|
1271
|
+
* Setting as `true` will make the text truncate on a single line.
|
|
1272
|
+
* Setting as `{ lines: number }` will make the text truncate on a multiple lines.
|
|
1273
|
+
*/
|
|
1274
|
+
truncate?: boolean | {
|
|
1275
|
+
lines: number;
|
|
1276
|
+
};
|
|
1277
|
+
/**
|
|
1278
|
+
* Prevents text to wrap on multiple lines
|
|
1279
|
+
* (automatically activated when single line text truncate is activated).
|
|
1280
|
+
*/
|
|
1281
|
+
noWrap?: boolean;
|
|
1282
|
+
/**
|
|
1283
|
+
* WhiteSpace variant
|
|
1284
|
+
* Ignored when `noWrap` is set to true
|
|
1285
|
+
* Ignored when `truncate` is set to true or lines: 1
|
|
1286
|
+
* */
|
|
1287
|
+
whiteSpace?: WhiteSpace;
|
|
1288
|
+
/**
|
|
1289
|
+
* Children
|
|
1290
|
+
*/
|
|
1291
|
+
children?: JSXElement;
|
|
1292
|
+
/** list of styles to apply */
|
|
1293
|
+
style?: CSSProperties;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
interface FlagProps$1 extends HasClassName, HasTheme {
|
|
1206
1297
|
/** Color of the component. */
|
|
1207
1298
|
color?: ColorPalette;
|
|
1208
1299
|
/** Icon to use before the label. */
|
|
@@ -1211,9 +1302,13 @@ interface FlagProps$1 extends GenericProps, HasTheme {
|
|
|
1211
1302
|
children: JSXElement;
|
|
1212
1303
|
/** Enable text truncate on overflow */
|
|
1213
1304
|
truncate?: boolean;
|
|
1305
|
+
/** ref to the root element */
|
|
1306
|
+
ref?: CommonRef;
|
|
1307
|
+
/** Text component to use for rendering the label */
|
|
1308
|
+
Text: (props: TextProps$1) => any;
|
|
1214
1309
|
}
|
|
1215
1310
|
|
|
1216
|
-
interface FlagProps extends Omit<FlagProps$1, 'children'> {
|
|
1311
|
+
interface FlagProps extends GenericProps$2, Omit<FlagProps$1, 'children' | 'Text'> {
|
|
1217
1312
|
label: React.ReactNode;
|
|
1218
1313
|
}
|
|
1219
1314
|
/**
|
|
@@ -1234,7 +1329,7 @@ type FlexHorizontalAlignment = HorizontalAlignment | SpaceAlignment;
|
|
|
1234
1329
|
/**
|
|
1235
1330
|
* Defines the props of the component.
|
|
1236
1331
|
*/
|
|
1237
|
-
interface FlexBoxProps$1 extends
|
|
1332
|
+
interface FlexBoxProps$1 extends HasClassName {
|
|
1238
1333
|
/** Children elements. */
|
|
1239
1334
|
children?: JSXElement;
|
|
1240
1335
|
/** Whether the "content filling space" is enabled or not. */
|
|
@@ -1258,7 +1353,7 @@ interface FlexBoxProps$1 extends GenericProps {
|
|
|
1258
1353
|
/**
|
|
1259
1354
|
* Defines the props of the component.
|
|
1260
1355
|
*/
|
|
1261
|
-
interface FlexBoxProps extends FlexBoxProps$1 {
|
|
1356
|
+
interface FlexBoxProps extends FlexBoxProps$1, GenericProps$1 {
|
|
1262
1357
|
/** Customize the root element. */
|
|
1263
1358
|
as?: React__default.ElementType;
|
|
1264
1359
|
}
|
|
@@ -1375,58 +1470,15 @@ declare const GenericBlock: GenericBlock;
|
|
|
1375
1470
|
/**
|
|
1376
1471
|
* Defines the props of the component.
|
|
1377
1472
|
*/
|
|
1378
|
-
interface
|
|
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> {
|
|
1473
|
+
interface HeadingProps$1 extends Partial<TextProps$1> {
|
|
1424
1474
|
/**
|
|
1425
1475
|
* Display a specific heading level instead of the one provided by parent context provider.
|
|
1426
1476
|
*/
|
|
1427
1477
|
as?: HeadingElement;
|
|
1428
1478
|
}
|
|
1429
1479
|
|
|
1480
|
+
interface HeadingProps extends HeadingProps$1, GenericProps$1 {
|
|
1481
|
+
}
|
|
1430
1482
|
/**
|
|
1431
1483
|
* Renders a heading component.
|
|
1432
1484
|
* Extends the `Text` Component with the heading level automatically computed based on
|
|
@@ -1533,7 +1585,7 @@ type IconSizes = (typeof ICON_SIZES)[number];
|
|
|
1533
1585
|
/**
|
|
1534
1586
|
* Defines the props of the component.
|
|
1535
1587
|
*/
|
|
1536
|
-
interface IconProps extends
|
|
1588
|
+
interface IconProps$1 extends HasClassName, HasTheme {
|
|
1537
1589
|
/** Color variant. */
|
|
1538
1590
|
color?: ColorWithVariants;
|
|
1539
1591
|
/** Lightened or darkened variant of the selected icon color. */
|
|
@@ -1551,8 +1603,12 @@ interface IconProps extends GenericProps, HasTheme {
|
|
|
1551
1603
|
alt?: string;
|
|
1552
1604
|
/** Vertical alignment of the icon (only applies for icons nested in Text/Heading). */
|
|
1553
1605
|
verticalAlign?: null | 'middle';
|
|
1606
|
+
/** reference to the root element */
|
|
1607
|
+
ref?: CommonRef;
|
|
1554
1608
|
}
|
|
1555
1609
|
|
|
1610
|
+
interface IconProps extends IconProps$1, GenericProps$1 {
|
|
1611
|
+
}
|
|
1556
1612
|
/**
|
|
1557
1613
|
* Icon component.
|
|
1558
1614
|
*
|
|
@@ -1821,13 +1877,17 @@ declare const InlineList: Comp<InlineListProps, HTMLElement>;
|
|
|
1821
1877
|
/**
|
|
1822
1878
|
* Defines the props of the component.
|
|
1823
1879
|
*/
|
|
1824
|
-
interface InputHelperProps extends
|
|
1880
|
+
interface InputHelperProps$1 extends HasClassName, HasTheme {
|
|
1825
1881
|
/** Helper content. */
|
|
1826
1882
|
children: JSXElement;
|
|
1827
1883
|
/** Helper variant. */
|
|
1828
1884
|
kind?: Kind;
|
|
1885
|
+
/** ref to the root element `p` */
|
|
1886
|
+
ref?: CommonRef;
|
|
1829
1887
|
}
|
|
1830
1888
|
|
|
1889
|
+
interface InputHelperProps extends InputHelperProps$1, GenericProps$3 {
|
|
1890
|
+
}
|
|
1831
1891
|
/**
|
|
1832
1892
|
* InputHelper component.
|
|
1833
1893
|
*
|
|
@@ -1837,7 +1897,7 @@ interface InputHelperProps extends GenericProps, HasTheme {
|
|
|
1837
1897
|
*/
|
|
1838
1898
|
declare const InputHelper: Comp<InputHelperProps, HTMLParagraphElement>;
|
|
1839
1899
|
|
|
1840
|
-
interface InputLabelProps extends
|
|
1900
|
+
interface InputLabelProps$1 extends HasClassName, HasTheme {
|
|
1841
1901
|
/** Typography variant. */
|
|
1842
1902
|
typography?: Typography;
|
|
1843
1903
|
/** Label content. */
|
|
@@ -1846,8 +1906,12 @@ interface InputLabelProps extends GenericProps, HasTheme {
|
|
|
1846
1906
|
htmlFor: string;
|
|
1847
1907
|
/** Whether the component is required or not. */
|
|
1848
1908
|
isRequired?: boolean;
|
|
1909
|
+
/** ref to the root element */
|
|
1910
|
+
ref?: CommonRef;
|
|
1849
1911
|
}
|
|
1850
1912
|
|
|
1913
|
+
interface InputLabelProps extends InputLabelProps$1, GenericProps$2 {
|
|
1914
|
+
}
|
|
1851
1915
|
/**
|
|
1852
1916
|
* InputLabel component.
|
|
1853
1917
|
*
|
|
@@ -1860,7 +1924,7 @@ declare const InputLabel: Comp<InputLabelProps, HTMLLabelElement>;
|
|
|
1860
1924
|
/**
|
|
1861
1925
|
* Defines the props of the component.
|
|
1862
1926
|
*/
|
|
1863
|
-
interface LightboxProps extends GenericProps$1, HasTheme$1, Pick<AriaAttributes, 'aria-label' | 'aria-labelledby'> {
|
|
1927
|
+
interface LightboxProps extends GenericProps$1, HasTheme$1, Pick<AriaAttributes$1, 'aria-label' | 'aria-labelledby'> {
|
|
1864
1928
|
/** Props to pass to the close button (minus those already set by the Lightbox props). */
|
|
1865
1929
|
closeButtonProps?: Pick<IconButtonProps, 'label'> & Omit<IconButtonProps, 'label' | 'onClick' | 'icon' | 'emphasis' | 'color'>;
|
|
1866
1930
|
/** Whether the component is open or not. */
|
|
@@ -2075,7 +2139,7 @@ declare const ListSubheader: Comp<ListSubheaderProps, HTMLLIElement>;
|
|
|
2075
2139
|
/**
|
|
2076
2140
|
* Defines the props of the component.
|
|
2077
2141
|
*/
|
|
2078
|
-
interface MessageProps extends
|
|
2142
|
+
interface MessageProps$1 extends HasClassName {
|
|
2079
2143
|
/** Content. */
|
|
2080
2144
|
children?: JSXElement;
|
|
2081
2145
|
/** Whether the message has a background or not. */
|
|
@@ -2084,6 +2148,8 @@ interface MessageProps extends GenericProps {
|
|
|
2084
2148
|
kind?: Kind;
|
|
2085
2149
|
/** Message custom icon SVG path. */
|
|
2086
2150
|
icon?: string;
|
|
2151
|
+
/** Reference to the message container element. */
|
|
2152
|
+
ref?: CommonRef;
|
|
2087
2153
|
/**
|
|
2088
2154
|
* Displays a close button.
|
|
2089
2155
|
*
|
|
@@ -2097,6 +2163,10 @@ interface MessageProps extends GenericProps {
|
|
|
2097
2163
|
};
|
|
2098
2164
|
}
|
|
2099
2165
|
|
|
2166
|
+
interface MessageProps extends Omit<MessageProps$1, 'children' | 'ref'> {
|
|
2167
|
+
/** Content. */
|
|
2168
|
+
children?: React.ReactNode;
|
|
2169
|
+
}
|
|
2100
2170
|
/**
|
|
2101
2171
|
* Message component.
|
|
2102
2172
|
*
|
|
@@ -3166,6 +3236,8 @@ interface TabPanelProps extends GenericProps$1 {
|
|
|
3166
3236
|
*/
|
|
3167
3237
|
declare const TabPanel: Comp<TabPanelProps, HTMLDivElement>;
|
|
3168
3238
|
|
|
3239
|
+
interface TextProps extends TextProps$1, GenericProps$1 {
|
|
3240
|
+
}
|
|
3169
3241
|
/**
|
|
3170
3242
|
* Text component.
|
|
3171
3243
|
*
|
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 =
|
|
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: !!
|
|
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
|
|
7862
|
-
const targetTransitionName = setupViewTransitionName(viewTransitionName
|
|
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
|