@lumx/react 4.2.1-alpha.13 → 4.2.1-alpha.14

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/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as _lumx_core_js_types from '@lumx/core/js/types';
4
4
  import { GenericProps, 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, InputHTMLAttributes, RefObject, CSSProperties, ImgHTMLAttributes, AriaAttributes as AriaAttributes$1, SetStateAction, Key, ElementType, ComponentProps } from 'react';
7
+ import React__default, { Ref, ReactElement, ReactNode, SyntheticEvent, MouseEventHandler, KeyboardEventHandler, AriaAttributes, InputHTMLAttributes, RefObject, CSSProperties, ImgHTMLAttributes, SetStateAction, Key, ElementType, ComponentProps } from 'react';
8
8
 
9
9
  /** LumX Component Type. */
10
10
  type Comp<P, T = HTMLElement> = {
@@ -527,23 +527,6 @@ interface HasAriaDisabled {
527
527
  'aria-disabled'?: Booleanish;
528
528
  }
529
529
 
530
- interface AriaAttributes {
531
- /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
532
- 'aria-expanded'?: Booleanish | undefined;
533
- /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
534
- 'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | undefined;
535
- /**
536
- * Defines a string value that labels the current element.
537
- * @see aria-labelledby.
538
- */
539
- 'aria-label'?: string | undefined;
540
- /**
541
- * Indicates the current "pressed" state of toggle buttons.
542
- * @see aria-checked @see aria-selected.
543
- */
544
- 'aria-pressed'?: boolean | 'false' | 'mixed' | 'true' | undefined;
545
- }
546
-
547
530
  type BaseClickableProps = {
548
531
  children?: JSXElement;
549
532
  isDisabled?: boolean;
@@ -557,7 +540,7 @@ type BaseClickableProps = {
557
540
  * Button size definition.
558
541
  */
559
542
  type ButtonSize = Extract<Size, 's' | 'm'>;
560
- interface BaseButtonProps extends AriaAttributes, HasClassName, HasTheme, HasAriaDisabled, BaseClickableProps {
543
+ interface BaseButtonProps extends Pick<AriaAttributes, 'aria-expanded' | 'aria-haspopup' | 'aria-pressed' | 'aria-label'>, HasClassName, HasTheme, HasAriaDisabled, BaseClickableProps {
561
544
  /** Color variant. */
562
545
  color?: ColorPalette;
563
546
  /** Emphasis variant. */
@@ -602,7 +585,7 @@ declare const ButtonEmphasis: {
602
585
  /**
603
586
  * Defines the props of the component.
604
587
  */
605
- interface ButtonProps$1 extends BaseButtonProps {
588
+ interface ButtonProps$1 extends /* @vue-ignore */ BaseButtonProps {
606
589
  /** Left icon (SVG path). */
607
590
  leftIcon?: string;
608
591
  /** Right icon (SVG path). */
@@ -625,7 +608,7 @@ declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
625
608
  */
626
609
  declare const DEFAULT_PROPS: Partial<ButtonProps$1>;
627
610
 
628
- interface ButtonProps extends ButtonProps$1, GenericProps {
611
+ interface ButtonProps extends GenericProps, ButtonProps$1 {
629
612
  }
630
613
  /**
631
614
  * Button component.
@@ -634,9 +617,9 @@ interface ButtonProps extends ButtonProps$1, GenericProps {
634
617
  * @param ref Component ref.
635
618
  * @return React element.
636
619
  */
637
- declare const Button: Comp<ButtonProps, HTMLButtonElement | HTMLAnchorElement>;
620
+ declare const Button: Comp<ButtonProps, HTMLAnchorElement | HTMLButtonElement>;
638
621
 
639
- interface IconButtonProps$1 extends BaseButtonProps {
622
+ interface IconButtonProps$1 extends /* @vue-ignore */ BaseButtonProps {
640
623
  /**
641
624
  * Icon (SVG path).
642
625
  * If `image` is also set, `image` will be used instead.
@@ -652,13 +635,9 @@ interface IconButtonProps$1 extends BaseButtonProps {
652
635
  * If you really don't want an aria-label, you can set an empty label (this is not recommended).
653
636
  */
654
637
  label: string;
655
- /**
656
- * optional text to be displayed as the title of the HTML element
657
- */
658
- title?: string;
659
638
  }
660
639
 
661
- interface IconButtonProps extends GenericProps, Omit<IconButtonProps$1, 'children'> {
640
+ interface IconButtonProps extends GenericProps, IconButtonProps$1 {
662
641
  /**
663
642
  * Props to pass to the tooltip.
664
643
  * If undefined or if tooltipProps.label is undefined, the label prop will be used as tooltip label.
@@ -688,7 +667,7 @@ interface ButtonGroupProps$1 extends HasClassName {
688
667
  ref?: CommonRef;
689
668
  }
690
669
 
691
- interface ButtonGroupProps extends ButtonGroupProps$1, GenericProps {
670
+ interface ButtonGroupProps extends GenericProps, ButtonGroupProps$1 {
692
671
  }
693
672
  /**
694
673
  * ButtonGroup component.
@@ -1244,53 +1223,6 @@ interface ExpansionPanelProps extends GenericProps, HasCloseMode, HasTheme$1 {
1244
1223
  */
1245
1224
  declare const ExpansionPanel: Comp<ExpansionPanelProps, HTMLDivElement>;
1246
1225
 
1247
- /**
1248
- * Defines the props of the component.
1249
- */
1250
- interface TextProps$1 extends HasClassName {
1251
- /**
1252
- * Color variant.
1253
- */
1254
- color?: ColorWithVariants;
1255
- /**
1256
- * Lightened or darkened variant of the selected color.
1257
- */
1258
- colorVariant?: ColorVariant;
1259
- /**
1260
- * Typography variant.
1261
- */
1262
- typography?: Typography;
1263
- /**
1264
- * Custom component to render the text.
1265
- */
1266
- as: TextElement;
1267
- /**
1268
- * Control whether the text should truncate or not.
1269
- * Setting as `true` will make the text truncate on a single line.
1270
- * Setting as `{ lines: number }` will make the text truncate on a multiple lines.
1271
- */
1272
- truncate?: boolean | {
1273
- lines: number;
1274
- };
1275
- /**
1276
- * Prevents text to wrap on multiple lines
1277
- * (automatically activated when single line text truncate is activated).
1278
- */
1279
- noWrap?: boolean;
1280
- /**
1281
- * WhiteSpace variant
1282
- * Ignored when `noWrap` is set to true
1283
- * Ignored when `truncate` is set to true or lines: 1
1284
- * */
1285
- whiteSpace?: WhiteSpace;
1286
- /**
1287
- * Children
1288
- */
1289
- children?: JSXElement;
1290
- /** list of styles to apply */
1291
- style?: CSSProperties;
1292
- }
1293
-
1294
1226
  interface FlagProps$1 extends HasClassName, HasTheme {
1295
1227
  /** Color of the component. */
1296
1228
  color?: ColorPalette;
@@ -1302,11 +1234,9 @@ interface FlagProps$1 extends HasClassName, HasTheme {
1302
1234
  truncate?: boolean;
1303
1235
  /** ref to the root element */
1304
1236
  ref?: CommonRef;
1305
- /** Text component to use for rendering the label */
1306
- Text: (props: TextProps$1) => any;
1307
1237
  }
1308
1238
 
1309
- interface FlagProps extends GenericProps, Omit<FlagProps$1, 'children' | 'Text'> {
1239
+ interface FlagProps extends GenericProps, Omit<FlagProps$1, 'children'> {
1310
1240
  /** Text label of the flag. */
1311
1241
  label: React.ReactNode;
1312
1242
  }
@@ -1352,7 +1282,7 @@ interface FlexBoxProps$1 extends HasClassName {
1352
1282
  /**
1353
1283
  * Defines the props of the component.
1354
1284
  */
1355
- interface FlexBoxProps extends FlexBoxProps$1, GenericProps {
1285
+ interface FlexBoxProps extends GenericProps, FlexBoxProps$1 {
1356
1286
  /** Customize the root element. */
1357
1287
  as?: React__default.ElementType;
1358
1288
  }
@@ -1466,6 +1396,53 @@ interface GenericBlock extends BaseGenericBlock {
1466
1396
  }
1467
1397
  declare const GenericBlock: GenericBlock;
1468
1398
 
1399
+ /**
1400
+ * Defines the props of the component.
1401
+ */
1402
+ interface TextProps$1 extends HasClassName {
1403
+ /**
1404
+ * Color variant.
1405
+ */
1406
+ color?: ColorWithVariants;
1407
+ /**
1408
+ * Lightened or darkened variant of the selected color.
1409
+ */
1410
+ colorVariant?: ColorVariant;
1411
+ /**
1412
+ * Typography variant.
1413
+ */
1414
+ typography?: Typography;
1415
+ /**
1416
+ * Custom component to render the text.
1417
+ */
1418
+ as: TextElement;
1419
+ /**
1420
+ * Control whether the text should truncate or not.
1421
+ * Setting as `true` will make the text truncate on a single line.
1422
+ * Setting as `{ lines: number }` will make the text truncate on a multiple lines.
1423
+ */
1424
+ truncate?: boolean | {
1425
+ lines: number;
1426
+ };
1427
+ /**
1428
+ * Prevents text to wrap on multiple lines
1429
+ * (automatically activated when single line text truncate is activated).
1430
+ */
1431
+ noWrap?: boolean;
1432
+ /**
1433
+ * WhiteSpace variant
1434
+ * Ignored when `noWrap` is set to true
1435
+ * Ignored when `truncate` is set to true or lines: 1
1436
+ * */
1437
+ whiteSpace?: WhiteSpace;
1438
+ /**
1439
+ * Children
1440
+ */
1441
+ children?: JSXElement;
1442
+ /** list of styles to apply */
1443
+ style?: CSSProperties;
1444
+ }
1445
+
1469
1446
  /**
1470
1447
  * Defines the props of the component.
1471
1448
  */
@@ -1476,7 +1453,7 @@ interface HeadingProps$1 extends Partial<TextProps$1> {
1476
1453
  as?: HeadingElement;
1477
1454
  }
1478
1455
 
1479
- interface HeadingProps extends HeadingProps$1, GenericProps {
1456
+ interface HeadingProps extends GenericProps, HeadingProps$1 {
1480
1457
  }
1481
1458
  /**
1482
1459
  * Renders a heading component.
@@ -1923,7 +1900,7 @@ declare const InputLabel: Comp<InputLabelProps, HTMLLabelElement>;
1923
1900
  /**
1924
1901
  * Defines the props of the component.
1925
1902
  */
1926
- interface LightboxProps extends GenericProps, HasTheme$1, Pick<AriaAttributes$1, 'aria-label' | 'aria-labelledby'> {
1903
+ interface LightboxProps extends GenericProps, HasTheme$1, Pick<AriaAttributes, 'aria-label' | 'aria-labelledby'> {
1927
1904
  /** Props to pass to the close button (minus those already set by the Lightbox props). */
1928
1905
  closeButtonProps?: Pick<IconButtonProps, 'label'> & Omit<IconButtonProps, 'label' | 'onClick' | 'icon' | 'emphasis' | 'color'>;
1929
1906
  /** Whether the component is open or not. */
@@ -1989,7 +1966,7 @@ interface LinkProps extends GenericProps, HasAriaDisabled$1 {
1989
1966
  * @param ref Component ref.
1990
1967
  * @return React element.
1991
1968
  */
1992
- declare const Link: Comp<LinkProps, HTMLButtonElement | HTMLAnchorElement>;
1969
+ declare const Link: Comp<LinkProps, HTMLAnchorElement | HTMLButtonElement>;
1993
1970
 
1994
1971
  /**
1995
1972
  * Defines the props of the component.
@@ -2156,13 +2133,13 @@ interface MessageProps$1 extends HasClassName {
2156
2133
  */
2157
2134
  closeButtonProps?: {
2158
2135
  /** The callback called when the button is clicked */
2159
- onClick: (event: any) => void;
2136
+ onClick: () => void;
2160
2137
  /** The label of the close button. */
2161
2138
  label: string;
2162
2139
  };
2163
2140
  }
2164
2141
 
2165
- interface MessageProps extends Omit<MessageProps$1, 'children' | 'ref'> {
2142
+ interface MessageProps extends GenericProps, Omit<MessageProps$1, 'children' | 'ref'> {
2166
2143
  /** Content. */
2167
2144
  children?: React.ReactNode;
2168
2145
  }
@@ -2246,9 +2223,9 @@ interface NotificationProps extends GenericProps, HasTheme$1 {
2246
2223
  /** Z-axis position. */
2247
2224
  zIndex?: number;
2248
2225
  /** On action button click callback. */
2249
- onActionClick?(event: any): void | null;
2226
+ onActionClick?(): void;
2250
2227
  /** On click callback. */
2251
- onClick?(event: any): void | null;
2228
+ onClick?(): void;
2252
2229
  /** Whether the notification should be rendered into a DOM node that exists outside the DOM hierarchy of the parent component. */
2253
2230
  usePortal?: boolean;
2254
2231
  }
package/index.js CHANGED
@@ -6449,7 +6449,10 @@ const {
6449
6449
  * @param props Component props.
6450
6450
  * @return JSX element.
6451
6451
  */
6452
- const Flag$1 = props => {
6452
+ const Flag$1 = (props, nestedComponents) => {
6453
+ const {
6454
+ Text
6455
+ } = nestedComponents || {};
6453
6456
  const {
6454
6457
  children,
6455
6458
  icon,
@@ -6457,7 +6460,6 @@ const Flag$1 = props => {
6457
6460
  className,
6458
6461
  theme,
6459
6462
  truncate,
6460
- Text,
6461
6463
  ...forwardedProps
6462
6464
  } = props;
6463
6465
  const flagColor = color || (theme === Theme.light ? ColorPalette.dark : ColorPalette.light);
@@ -6474,7 +6476,7 @@ const Flag$1 = props => {
6474
6476
  className: element$B('icon')
6475
6477
  }), /*#__PURE__*/jsx(Text, {
6476
6478
  as: "span",
6477
- truncate: !!truncate,
6479
+ truncate: !!props.truncate,
6478
6480
  typography: "overline",
6479
6481
  className: element$B('label'),
6480
6482
  children: children
@@ -6495,7 +6497,8 @@ const Flag = forwardRef((props, ref) => {
6495
6497
  ...props,
6496
6498
  theme: props.theme || defaultTheme,
6497
6499
  ref,
6498
- children: props.label,
6500
+ children: props.label
6501
+ }, {
6499
6502
  Text
6500
6503
  });
6501
6504
  });
@@ -9298,7 +9301,7 @@ const Notification = forwardRef((props, ref) => {
9298
9301
  const hasAction = Boolean(onActionClick) && Boolean(actionLabel);
9299
9302
  const handleCallback = evt => {
9300
9303
  if (isFunction(onActionClick)) {
9301
- onActionClick(evt);
9304
+ onActionClick();
9302
9305
  }
9303
9306
  evt.stopPropagation();
9304
9307
  };