@jobber/components 6.49.0 → 6.50.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.
@@ -79,7 +79,10 @@ function ButtonWrapper(props) {
79
79
  const buttonType = submit ? "submit" : "button";
80
80
  const buttonClassNames = classnames(combined, UNSAFE_className.container);
81
81
  const tagProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ className: buttonClassNames, disabled,
82
- id, style: UNSAFE_style.container }, (submit && { name, value })), (!disabled && { href: url })), (!disabled && { onClick: onClick })), (!disabled && { onMouseDown: onMouseDown })), (external && { target: "_blank" })), (url === undefined && to === undefined && { type: buttonType })), { "aria-controls": ariaControls, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, role: role });
82
+ id, style: UNSAFE_style.container }, (submit && { name, value })), (!disabled && { href: url })), (!disabled && { onClick: onClick })), (!disabled && { onMouseDown: onMouseDown })), (external && {
83
+ target: "_blank",
84
+ rel: "noopener noreferrer",
85
+ })), (url === undefined && to === undefined && { type: buttonType })), { "aria-controls": ariaControls, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, role: role });
83
86
  const buttonInternals = children || React.createElement(ButtonContent, Object.assign({}, props));
84
87
  if (to) {
85
88
  return (React.createElement(reactRouterDom.Link, Object.assign({}, tagProps, { to: to }), buttonInternals));
package/dist/Button-es.js CHANGED
@@ -77,7 +77,10 @@ function ButtonWrapper(props) {
77
77
  const buttonType = submit ? "submit" : "button";
78
78
  const buttonClassNames = classnames(combined, UNSAFE_className.container);
79
79
  const tagProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ className: buttonClassNames, disabled,
80
- id, style: UNSAFE_style.container }, (submit && { name, value })), (!disabled && { href: url })), (!disabled && { onClick: onClick })), (!disabled && { onMouseDown: onMouseDown })), (external && { target: "_blank" })), (url === undefined && to === undefined && { type: buttonType })), { "aria-controls": ariaControls, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, role: role });
80
+ id, style: UNSAFE_style.container }, (submit && { name, value })), (!disabled && { href: url })), (!disabled && { onClick: onClick })), (!disabled && { onMouseDown: onMouseDown })), (external && {
81
+ target: "_blank",
82
+ rel: "noopener noreferrer",
83
+ })), (url === undefined && to === undefined && { type: buttonType })), { "aria-controls": ariaControls, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, role: role });
81
84
  const buttonInternals = children || React__default.createElement(ButtonContent, Object.assign({}, props));
82
85
  if (to) {
83
86
  return (React__default.createElement(Link, Object.assign({}, tagProps, { to: to }), buttonInternals));
package/dist/Link-cjs.js CHANGED
@@ -5,7 +5,10 @@ var React = require('react');
5
5
  var styles = {"link":"_8oxipSwiMJQ-","spinning":"iU2hXJfEJ-E-"};
6
6
 
7
7
  function Link({ url, children, ariaLabel, ariaExpanded, external = false, }) {
8
- return (React.createElement("a", Object.assign({ href: url }, (external && { target: "_blank" }), (ariaLabel && { "aria-label": ariaLabel }), (ariaExpanded && { "aria-expanded": ariaExpanded }), { className: styles.link }), children));
8
+ return (React.createElement("a", Object.assign({ href: url }, (external && {
9
+ target: "_blank",
10
+ rel: "noopener noreferrer",
11
+ }), (ariaLabel && { "aria-label": ariaLabel }), (ariaExpanded && { "aria-expanded": ariaExpanded }), { className: styles.link }), children));
9
12
  }
10
13
 
11
14
  exports.Link = Link;
package/dist/Link-es.js CHANGED
@@ -3,7 +3,10 @@ import React__default from 'react';
3
3
  var styles = {"link":"_8oxipSwiMJQ-","spinning":"iU2hXJfEJ-E-"};
4
4
 
5
5
  function Link({ url, children, ariaLabel, ariaExpanded, external = false, }) {
6
- return (React__default.createElement("a", Object.assign({ href: url }, (external && { target: "_blank" }), (ariaLabel && { "aria-label": ariaLabel }), (ariaExpanded && { "aria-expanded": ariaExpanded }), { className: styles.link }), children));
6
+ return (React__default.createElement("a", Object.assign({ href: url }, (external && {
7
+ target: "_blank",
8
+ rel: "noopener noreferrer",
9
+ }), (ariaLabel && { "aria-label": ariaLabel }), (ariaExpanded && { "aria-expanded": ariaExpanded }), { className: styles.link }), children));
7
10
  }
8
11
 
9
12
  export { Link as L };
@@ -1,6 +1,12 @@
1
1
  import { PropsWithChildren } from "react";
2
2
  import { TypographyProps } from "../Typography";
3
+ type TextElement = Extract<TypographyProps["element"], "p" | "b" | "em" | "dd" | "dt" | "strong" | "span">;
3
4
  export interface TextProps {
5
+ /**
6
+ * The HTML element to render the text as.
7
+ * @default "p"
8
+ */
9
+ readonly element?: TextElement;
4
10
  readonly maxLines?: "single" | "small" | "base" | "large" | "larger" | "unlimited";
5
11
  readonly variation?: "default" | "subdued" | "success" | "error" | "warn" | "info" | "disabled";
6
12
  readonly align?: "start" | "center" | "end";
@@ -18,4 +24,5 @@ export interface TextProps {
18
24
  */
19
25
  readonly UNSAFE_style?: TypographyProps["UNSAFE_style"];
20
26
  }
21
- export declare function Text({ variation, size, align, children, maxLines, UNSAFE_className, UNSAFE_style, }: PropsWithChildren<TextProps>): JSX.Element;
27
+ export declare function Text({ variation, size, align, element, children, maxLines, UNSAFE_className, UNSAFE_style, }: PropsWithChildren<TextProps>): JSX.Element;
28
+ export {};
package/dist/Text-cjs.js CHANGED
@@ -3,7 +3,7 @@
3
3
  var React = require('react');
4
4
  var Typography = require('./Typography-cjs.js');
5
5
 
6
- function Text({ variation = "default", size = "base", align = "start", children, maxLines = "unlimited", UNSAFE_className, UNSAFE_style, }) {
6
+ function Text({ variation = "default", size = "base", align = "start", element = "p", children, maxLines = "unlimited", UNSAFE_className, UNSAFE_style, }) {
7
7
  const textColors = {
8
8
  default: "text",
9
9
  subdued: "textSecondary",
@@ -21,7 +21,7 @@ function Text({ variation = "default", size = "base", align = "start", children,
21
21
  larger: 16,
22
22
  unlimited: undefined,
23
23
  };
24
- return (React.createElement(Typography.Typography, { textColor: textColors[variation], size: size, numberOfLines: maxLineToNumber[maxLines], align: align, UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style }, children));
24
+ return (React.createElement(Typography.Typography, { element: element, textColor: textColors[variation], size: size, numberOfLines: maxLineToNumber[maxLines], align: align, UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style }, children));
25
25
  }
26
26
 
27
27
  exports.Text = Text;
package/dist/Text-es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import React__default from 'react';
2
2
  import { T as Typography } from './Typography-es.js';
3
3
 
4
- function Text({ variation = "default", size = "base", align = "start", children, maxLines = "unlimited", UNSAFE_className, UNSAFE_style, }) {
4
+ function Text({ variation = "default", size = "base", align = "start", element = "p", children, maxLines = "unlimited", UNSAFE_className, UNSAFE_style, }) {
5
5
  const textColors = {
6
6
  default: "text",
7
7
  subdued: "textSecondary",
@@ -19,7 +19,7 @@ function Text({ variation = "default", size = "base", align = "start", children,
19
19
  larger: 16,
20
20
  unlimited: undefined,
21
21
  };
22
- return (React__default.createElement(Typography, { textColor: textColors[variation], size: size, numberOfLines: maxLineToNumber[maxLines], align: align, UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style }, children));
22
+ return (React__default.createElement(Typography, { element: element, textColor: textColors[variation], size: size, numberOfLines: maxLineToNumber[maxLines], align: align, UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style }, children));
23
23
  }
24
24
 
25
25
  export { Text as T };