@lumx/react 4.3.2-alpha.1 → 4.3.2-alpha.2

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/CONTRIBUTING.md CHANGED
@@ -41,6 +41,18 @@ Before opening a Pull Request, please see the Submission Guidelines below.
41
41
  You can request a new feature by submitting an issue to our [GitHub Repository](https://github.com/lumapps/design-system/issues).
42
42
  If you would like to implement a new feature then consider what kind of change it is, discuss it with us before hand in your issue, so that we can better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project.
43
43
 
44
+ ## <a name="create-a-new-react-component-"></a> Want to create a new React Component?
45
+
46
+ The first step to create a new React component is to run:
47
+
48
+ ```
49
+ yarn scaffold
50
+ ```
51
+
52
+ This script will generate a TSX file for the component code, a TSX file for the component tests and an MDX file to demo this component.
53
+
54
+ To export your component into the `@lumx/react` NPM package, you also have to make sure to update the `src/index.tsx` file.
55
+
44
56
  ## <a name="submission-guidelines"></a> Submission guidelines
45
57
 
46
58
  ### Submitting an issue
package/index.d.ts CHANGED
@@ -294,6 +294,32 @@ interface AvatarProps extends GenericProps, HasTheme$1 {
294
294
  */
295
295
  declare const Avatar: Comp<AvatarProps, HTMLDivElement>;
296
296
 
297
+ /**
298
+ * Defines the props of the component.
299
+ */
300
+ interface BadgeProps extends GenericProps {
301
+ /** Badge content. */
302
+ children?: ReactNode;
303
+ /** Color variant. */
304
+ color?: ColorPalette$1;
305
+ }
306
+ /**
307
+ * Badge component.
308
+ *
309
+ * @param props Component props.
310
+ * @param ref Component ref.
311
+ * @return React element.
312
+ */
313
+ declare const Badge: Comp<BadgeProps, HTMLDivElement>;
314
+
315
+ interface BadgeWrapperProps extends GenericProps {
316
+ /** Badge. */
317
+ badge: ReactElement;
318
+ /** Node to display the badge on */
319
+ children: ReactNode;
320
+ }
321
+ declare const BadgeWrapper: Comp<BadgeWrapperProps, HTMLDivElement>;
322
+
297
323
  /**
298
324
  * Alignments.
299
325
  */
@@ -541,51 +567,6 @@ interface HasDisabled {
541
567
  disabled?: boolean;
542
568
  }
543
569
 
544
- /**
545
- * Defines the props of the component.
546
- */
547
- interface BadgeProps$1 extends HasClassName {
548
- /** Badge content. */
549
- children?: JSXElement;
550
- /** Color variant. */
551
- color?: ColorPalette;
552
- /** reference to the root element */
553
- ref?: CommonRef;
554
- }
555
-
556
- /**
557
- * Defines the props of the component.
558
- */
559
- interface BadgeProps extends Omit<BadgeProps$1, 'children'>, GenericProps {
560
- /** Badge content. */
561
- children?: ReactNode;
562
- }
563
- /**
564
- * Badge component.
565
- *
566
- * @param props Component props.
567
- * @param ref Component ref.
568
- * @return React element.
569
- */
570
- declare const Badge: Comp<BadgeProps, HTMLDivElement>;
571
-
572
- interface BadgeWrapperProps$1 extends HasClassName {
573
- /** Badge element to display */
574
- badge?: JSXElement;
575
- /** Content to wrap with badge */
576
- children?: JSXElement;
577
- /** Ref forwarding */
578
- ref?: CommonRef;
579
- }
580
-
581
- interface BadgeWrapperProps extends GenericProps, Omit<BadgeWrapperProps$1, 'children' | 'badge'> {
582
- /** Badge element to display */
583
- badge: ReactElement;
584
- /** Content to wrap with badge */
585
- children: ReactNode;
586
- }
587
- declare const BadgeWrapper: Comp<BadgeWrapperProps, HTMLDivElement>;
588
-
589
570
  interface BaseClickableProps extends HasDisabled, HasAriaDisabled {
590
571
  children?: JSXElement;
591
572
  onClick?: (event?: any) => void;
@@ -2059,37 +2040,55 @@ interface LightboxProps extends GenericProps, HasTheme$1, Pick<AriaAttributes, '
2059
2040
  */
2060
2041
  declare const Lightbox: Comp<LightboxProps, HTMLDivElement>;
2061
2042
 
2062
- type HTMLAnchorProps = React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
2063
2043
  /**
2064
2044
  * Defines the props of the component.
2065
2045
  */
2066
- interface LinkProps extends GenericProps, HasAriaDisabled$1 {
2046
+ interface LinkProps$1 extends HasTheme, HasClassName, HasAriaDisabled, HasDisabled {
2047
+ /** Link label content. */
2048
+ label?: JSXElement;
2067
2049
  /** Color variant. */
2068
2050
  color?: ColorWithVariants$1;
2069
2051
  /** Lightened or darkened variant of the selected icon color. */
2070
2052
  colorVariant?: ColorVariant$1;
2071
2053
  /** Link href. */
2072
- href?: HTMLAnchorProps['href'];
2073
- /** Whether the component is disabled or not. */
2074
- isDisabled?: boolean;
2054
+ href?: string;
2075
2055
  /**
2076
2056
  * Left icon (SVG path).
2077
- * @deprecated Instead, simply nest `<Icon />` in the children
2057
+ * @deprecated Instead, simply nest `<Icon />` in the label
2078
2058
  */
2079
2059
  leftIcon?: string;
2080
- /** Custom react component for the link (can be used to inject react router Link). */
2081
- linkAs?: 'a' | any;
2060
+ /** Element type or custom component for the link. */
2061
+ as?: string | any;
2082
2062
  /**
2083
2063
  * Right icon (SVG path).
2084
- * @deprecated Instead, simply nest `<Icon />` in the children
2064
+ * @deprecated Instead, simply nest `<Icon />` in the label
2085
2065
  */
2086
2066
  rightIcon?: string;
2087
2067
  /** Link target. */
2068
+ target?: string;
2069
+ /** Typography variant. */
2070
+ typography?: string;
2071
+ /** Click handler. */
2072
+ onClick?: (event: any) => void;
2073
+ /** Reference to the root element. */
2074
+ ref?: CommonRef;
2075
+ }
2076
+
2077
+ type HTMLAnchorProps = React__default.DetailedHTMLProps<React__default.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
2078
+ /**
2079
+ * Defines the props of the component.
2080
+ */
2081
+ interface LinkProps extends GenericProps, Omit<LinkProps$1, 'label'> {
2082
+ /** Link href. */
2083
+ href?: HTMLAnchorProps['href'];
2084
+ /** Custom react component for the link (can be used to inject react router Link). */
2085
+ linkAs?: 'a' | any;
2086
+ /** Link target. */
2088
2087
  target?: HTMLAnchorProps['target'];
2089
2088
  /** Typography variant. */
2090
2089
  typography?: Typography$1;
2091
2090
  /** Children */
2092
- children?: React.ReactNode;
2091
+ children?: React__default.ReactNode;
2093
2092
  }
2094
2093
  /**
2095
2094
  * Link component.