@jobber/components 6.88.0 → 6.90.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.
@@ -4,10 +4,12 @@ interface ClickableCardProps {
4
4
  onClick(event: React.MouseEvent<HTMLElement>): void;
5
5
  readonly className: string;
6
6
  readonly children: ReactNode | ReactNode[];
7
+ readonly UNSAFE_className?: string;
8
+ readonly UNSAFE_style?: React.CSSProperties;
7
9
  }
8
10
  /**
9
11
  * This is only intended to be used in the Card component.
10
12
  * Please use `<Card onClick={onClick} />` component instead.
11
13
  */
12
- export declare function CardClickable({ className, onClick, children, }: ClickableCardProps): React.JSX.Element;
14
+ export declare function CardClickable({ className, onClick, children, UNSAFE_style, }: ClickableCardProps): React.JSX.Element;
13
15
  export {};
@@ -4,4 +4,4 @@ import type { CardProps } from "./types";
4
4
  * Intended to be used in the Card component.
5
5
  * Use `<Card header={header} />` component instead.
6
6
  */
7
- export declare function CardHeader({ title, header, }: Pick<CardProps, "title" | "header">): React.JSX.Element;
7
+ export declare function CardHeader({ title, header, UNSAFE_className, UNSAFE_style, }: Pick<CardProps, "title" | "header" | "UNSAFE_className" | "UNSAFE_style">): React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { ReactElement, ReactNode } from "react";
1
+ import type { CSSProperties, ReactElement, ReactNode } from "react";
2
2
  import type colors from "./cardcolors.module.css";
3
3
  import { type ButtonProps } from "../Button";
4
4
  import { type MenuProps } from "../Menu";
@@ -31,6 +31,24 @@ export interface CardProps {
31
31
  */
32
32
  readonly header?: string | HeaderActionProps | ReactElement;
33
33
  readonly elevation?: elevationProp;
34
+ /**
35
+ * **Use at your own risk:** Custom class names for specific elements. This should only be used as a
36
+ * **last resort**. Using this may result in unexpected side effects.
37
+ * More information in the [Customizing components Guide](https://atlantis.getjobber.com/guides/customizing-components).
38
+ */
39
+ readonly UNSAFE_className?: {
40
+ container?: string;
41
+ header?: string;
42
+ };
43
+ /**
44
+ * **Use at your own risk:** Custom style for specific elements. This should only be used as a
45
+ * **last resort**. Using this may result in unexpected side effects.
46
+ * More information in the [Customizing components Guide](https://atlantis.getjobber.com/guides/customizing-components).
47
+ */
48
+ readonly UNSAFE_style?: {
49
+ container?: CSSProperties;
50
+ header?: CSSProperties;
51
+ };
34
52
  }
35
53
  export interface CardHeaderProps {
36
54
  readonly children: ReactNode;
package/dist/Card-cjs.js CHANGED
@@ -18,9 +18,9 @@ const SPACEBAR_KEY = " ";
18
18
  * This is only intended to be used in the Card component.
19
19
  * Please use `<Card onClick={onClick} />` component instead.
20
20
  */
21
- function CardClickable({ className, onClick, children, }) {
21
+ function CardClickable({ className, onClick, children, UNSAFE_style = {}, }) {
22
22
  const cardRef = React.useRef();
23
- return (React.createElement("div", { ref: cardRef, "data-testid": "clickable-card", className: className, onClick: onClick, onKeyUp: handleKeyup, onKeyDown: handleKeyDown, role: "button", tabIndex: 0 }, children));
23
+ return (React.createElement("div", { ref: cardRef, "data-testid": "clickable-card", className: className, style: UNSAFE_style, onClick: onClick, onKeyUp: handleKeyup, onKeyDown: handleKeyDown, role: "button", tabIndex: 0 }, children));
24
24
  function isCardFocused() {
25
25
  return document.activeElement === cardRef.current;
26
26
  }
@@ -43,7 +43,7 @@ function CardClickable({ className, onClick, children, }) {
43
43
  * Intended to be used in the Card component.
44
44
  * Use `<Card header={header} />` component instead.
45
45
  */
46
- function CardHeader({ title, header, }) {
46
+ function CardHeader({ title, header, UNSAFE_className = {}, UNSAFE_style = {}, }) {
47
47
  const heading = title || header;
48
48
  if (React.isValidElement(heading))
49
49
  return React.createElement(React.Fragment, null, heading);
@@ -51,7 +51,7 @@ function CardHeader({ title, header, }) {
51
51
  const titleString = typeof heading === "string"
52
52
  ? heading
53
53
  : heading.title;
54
- return (React.createElement("div", { className: styles.header },
54
+ return (React.createElement("div", { className: classnames(styles.header, UNSAFE_className.header), style: UNSAFE_style.header },
55
55
  titleString && React.createElement(Heading.Heading, { level: 2 }, titleString),
56
56
  typeof heading === "object" &&
57
57
  renderHeaderAction(heading === null || heading === void 0 ? void 0 : heading.action)));
@@ -107,30 +107,31 @@ function CardHeaderCompoundComponent({ children }) {
107
107
  function CardBodyCompoundComponent({ children }) {
108
108
  return React.createElement(React.Fragment, null, children);
109
109
  }
110
- function renderCardContent(children, title, header) {
110
+ function renderCardContent(children, title, header, UNSAFE_className, UNSAFE_style) {
111
111
  return (React.createElement(React.Fragment, null,
112
- React.createElement(CardHeader, { title: title, header: header }),
112
+ React.createElement(CardHeader, { title: title, header: header, UNSAFE_className: { header: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.header }, UNSAFE_style: { header: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.header } }),
113
113
  children));
114
114
  }
115
- function renderCardWrapper(className, content, onClick, url, external) {
115
+ function renderCardWrapper(className, content, onClick, url, external, UNSAFE_className, UNSAFE_style) {
116
+ const combinedClassName = classnames(className, UNSAFE_className);
116
117
  if (onClick) {
117
- return (React.createElement(CardClickable, { className: className, onClick: onClick }, content));
118
+ return (React.createElement(CardClickable, { className: combinedClassName, onClick: onClick, UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style }, content));
118
119
  }
119
120
  if (url) {
120
- return (React.createElement("a", Object.assign({ className: className, href: url }, (external && { target: "_blank", rel: "noopener noreferrer" })), content));
121
+ return (React.createElement("a", Object.assign({ className: combinedClassName, href: url, style: UNSAFE_style }, (external && { target: "_blank", rel: "noopener noreferrer" })), content));
121
122
  }
122
- return React.createElement("div", { className: className }, content);
123
+ return (React.createElement("div", { className: combinedClassName, style: UNSAFE_style }, content));
123
124
  }
124
125
  function Card(props) {
125
- const { accent, header, children, title, elevation = "none", onClick, url, external, } = props;
126
+ const { accent, header, children, title, elevation = "none", onClick, url, external, UNSAFE_className = {}, UNSAFE_style = {}, } = props;
126
127
  const className = classnames(styles.card, accent && styles.accent, (url || onClick) && styles.clickable, accent && colors[accent], elevation !== "none" && elevations[`${elevation}Elevation`]);
127
128
  const isUsingCompoundPattern = React.Children.toArray(children).some(child => React.isValidElement(child) &&
128
129
  (child.type === CardHeaderCompoundComponent ||
129
130
  child.type === CardBodyCompoundComponent));
130
131
  const content = isUsingCompoundPattern
131
132
  ? children
132
- : renderCardContent(children, title, header);
133
- return renderCardWrapper(className, content, onClick, url, external);
133
+ : renderCardContent(children, title, header, UNSAFE_className, UNSAFE_style);
134
+ return renderCardWrapper(className, content, onClick, url, external, UNSAFE_className.container, UNSAFE_style.container);
134
135
  }
135
136
  Card.Header = CardHeaderCompoundComponent;
136
137
  Card.Body = CardBodyCompoundComponent;
package/dist/Card-es.js CHANGED
@@ -16,9 +16,9 @@ const SPACEBAR_KEY = " ";
16
16
  * This is only intended to be used in the Card component.
17
17
  * Please use `<Card onClick={onClick} />` component instead.
18
18
  */
19
- function CardClickable({ className, onClick, children, }) {
19
+ function CardClickable({ className, onClick, children, UNSAFE_style = {}, }) {
20
20
  const cardRef = useRef();
21
- return (React__default.createElement("div", { ref: cardRef, "data-testid": "clickable-card", className: className, onClick: onClick, onKeyUp: handleKeyup, onKeyDown: handleKeyDown, role: "button", tabIndex: 0 }, children));
21
+ return (React__default.createElement("div", { ref: cardRef, "data-testid": "clickable-card", className: className, style: UNSAFE_style, onClick: onClick, onKeyUp: handleKeyup, onKeyDown: handleKeyDown, role: "button", tabIndex: 0 }, children));
22
22
  function isCardFocused() {
23
23
  return document.activeElement === cardRef.current;
24
24
  }
@@ -41,7 +41,7 @@ function CardClickable({ className, onClick, children, }) {
41
41
  * Intended to be used in the Card component.
42
42
  * Use `<Card header={header} />` component instead.
43
43
  */
44
- function CardHeader({ title, header, }) {
44
+ function CardHeader({ title, header, UNSAFE_className = {}, UNSAFE_style = {}, }) {
45
45
  const heading = title || header;
46
46
  if (React__default.isValidElement(heading))
47
47
  return React__default.createElement(React__default.Fragment, null, heading);
@@ -49,7 +49,7 @@ function CardHeader({ title, header, }) {
49
49
  const titleString = typeof heading === "string"
50
50
  ? heading
51
51
  : heading.title;
52
- return (React__default.createElement("div", { className: styles.header },
52
+ return (React__default.createElement("div", { className: classnames(styles.header, UNSAFE_className.header), style: UNSAFE_style.header },
53
53
  titleString && React__default.createElement(Heading, { level: 2 }, titleString),
54
54
  typeof heading === "object" &&
55
55
  renderHeaderAction(heading === null || heading === void 0 ? void 0 : heading.action)));
@@ -105,30 +105,31 @@ function CardHeaderCompoundComponent({ children }) {
105
105
  function CardBodyCompoundComponent({ children }) {
106
106
  return React__default.createElement(React__default.Fragment, null, children);
107
107
  }
108
- function renderCardContent(children, title, header) {
108
+ function renderCardContent(children, title, header, UNSAFE_className, UNSAFE_style) {
109
109
  return (React__default.createElement(React__default.Fragment, null,
110
- React__default.createElement(CardHeader, { title: title, header: header }),
110
+ React__default.createElement(CardHeader, { title: title, header: header, UNSAFE_className: { header: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.header }, UNSAFE_style: { header: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.header } }),
111
111
  children));
112
112
  }
113
- function renderCardWrapper(className, content, onClick, url, external) {
113
+ function renderCardWrapper(className, content, onClick, url, external, UNSAFE_className, UNSAFE_style) {
114
+ const combinedClassName = classnames(className, UNSAFE_className);
114
115
  if (onClick) {
115
- return (React__default.createElement(CardClickable, { className: className, onClick: onClick }, content));
116
+ return (React__default.createElement(CardClickable, { className: combinedClassName, onClick: onClick, UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style }, content));
116
117
  }
117
118
  if (url) {
118
- return (React__default.createElement("a", Object.assign({ className: className, href: url }, (external && { target: "_blank", rel: "noopener noreferrer" })), content));
119
+ return (React__default.createElement("a", Object.assign({ className: combinedClassName, href: url, style: UNSAFE_style }, (external && { target: "_blank", rel: "noopener noreferrer" })), content));
119
120
  }
120
- return React__default.createElement("div", { className: className }, content);
121
+ return (React__default.createElement("div", { className: combinedClassName, style: UNSAFE_style }, content));
121
122
  }
122
123
  function Card(props) {
123
- const { accent, header, children, title, elevation = "none", onClick, url, external, } = props;
124
+ const { accent, header, children, title, elevation = "none", onClick, url, external, UNSAFE_className = {}, UNSAFE_style = {}, } = props;
124
125
  const className = classnames(styles.card, accent && styles.accent, (url || onClick) && styles.clickable, accent && colors[accent], elevation !== "none" && elevations[`${elevation}Elevation`]);
125
126
  const isUsingCompoundPattern = React__default.Children.toArray(children).some(child => React__default.isValidElement(child) &&
126
127
  (child.type === CardHeaderCompoundComponent ||
127
128
  child.type === CardBodyCompoundComponent));
128
129
  const content = isUsingCompoundPattern
129
130
  ? children
130
- : renderCardContent(children, title, header);
131
- return renderCardWrapper(className, content, onClick, url, external);
131
+ : renderCardContent(children, title, header, UNSAFE_className, UNSAFE_style);
132
+ return renderCardWrapper(className, content, onClick, url, external, UNSAFE_className.container, UNSAFE_style.container);
132
133
  }
133
134
  Card.Header = CardHeaderCompoundComponent;
134
135
  Card.Body = CardBodyCompoundComponent;
@@ -6,7 +6,7 @@ interface InlineLabelProps {
6
6
  * The size of the label
7
7
  * @default base
8
8
  */
9
- readonly size?: "base" | "large" | "larger";
9
+ readonly size?: "small" | "base" | "large" | "larger";
10
10
  /**
11
11
  * The color of the label
12
12
  * @default "greyBlue"
@@ -4,11 +4,12 @@ var React = require('react');
4
4
  var classnames = require('classnames');
5
5
  var Typography = require('./Typography-cjs.js');
6
6
 
7
- var styles = {"inlineLabel":"M01SZy5EYFg-","base":"_0L5DuoQQ0N0-","large":"QKOUUH9-Fho-","larger":"GdJFaAMVrfU-","greyBlue":"_1KuDugNaT-o-","red":"bHju-S5Uytc-","orange":"hk1-OlPzFpM-","green":"ekQbbiBSxKk-","success":"YBvJuPW-YEI-","blue":"_5X5w6s0pPdw-","inactive":"lju-nyF9vX0-","navy":"nMlCD9k-Meg-","task":"HVMpHULM2PU-","yellow":"hOJmavXturw-","warning":"kfXKagw-wdE-","lime":"ZrdNg5b18oY-","purple":"df-Q7pKd2iI-","invoice":"WE3Qy5JUsN4-","pink":"-Wiy2k-i7tQ-","quote":"NoDP1qZvkds-","teal":"gc8t5abqWH4-","yellowGreen":"SeLhnnpqK70-","job":"L9FK1YwwCB8-","blueDark":"PZdC-xYFPok-","lightBlue":"_3JD9CXbxRQ8-","informative":"R-kgbH6qPZU-","indigo":"_6juDApQlcS0-","request":"MGcsvmjHlow-","spinning":"dre73387JG8-"};
7
+ var styles = {"inlineLabel":"M01SZy5EYFg-","small":"_8nqeeAapUQU-","base":"_0L5DuoQQ0N0-","large":"QKOUUH9-Fho-","larger":"GdJFaAMVrfU-","greyBlue":"_1KuDugNaT-o-","red":"bHju-S5Uytc-","orange":"hk1-OlPzFpM-","green":"ekQbbiBSxKk-","success":"YBvJuPW-YEI-","blue":"_5X5w6s0pPdw-","inactive":"lju-nyF9vX0-","navy":"nMlCD9k-Meg-","task":"HVMpHULM2PU-","yellow":"hOJmavXturw-","warning":"kfXKagw-wdE-","lime":"ZrdNg5b18oY-","purple":"df-Q7pKd2iI-","invoice":"WE3Qy5JUsN4-","pink":"-Wiy2k-i7tQ-","quote":"NoDP1qZvkds-","teal":"gc8t5abqWH4-","yellowGreen":"SeLhnnpqK70-","job":"L9FK1YwwCB8-","blueDark":"PZdC-xYFPok-","lightBlue":"_3JD9CXbxRQ8-","informative":"R-kgbH6qPZU-","indigo":"_6juDApQlcS0-","request":"MGcsvmjHlow-","spinning":"dre73387JG8-"};
8
8
 
9
9
  function InlineLabel({ size = "base", color = "greyBlue", children, }) {
10
10
  const className = classnames(styles.inlineLabel, styles[size], styles[color]);
11
11
  const sizeMapper = {
12
+ small: "smaller",
12
13
  base: "small",
13
14
  large: "large",
14
15
  larger: "large",
@@ -2,11 +2,12 @@ import React__default from 'react';
2
2
  import classnames from 'classnames';
3
3
  import { T as Typography } from './Typography-es.js';
4
4
 
5
- var styles = {"inlineLabel":"M01SZy5EYFg-","base":"_0L5DuoQQ0N0-","large":"QKOUUH9-Fho-","larger":"GdJFaAMVrfU-","greyBlue":"_1KuDugNaT-o-","red":"bHju-S5Uytc-","orange":"hk1-OlPzFpM-","green":"ekQbbiBSxKk-","success":"YBvJuPW-YEI-","blue":"_5X5w6s0pPdw-","inactive":"lju-nyF9vX0-","navy":"nMlCD9k-Meg-","task":"HVMpHULM2PU-","yellow":"hOJmavXturw-","warning":"kfXKagw-wdE-","lime":"ZrdNg5b18oY-","purple":"df-Q7pKd2iI-","invoice":"WE3Qy5JUsN4-","pink":"-Wiy2k-i7tQ-","quote":"NoDP1qZvkds-","teal":"gc8t5abqWH4-","yellowGreen":"SeLhnnpqK70-","job":"L9FK1YwwCB8-","blueDark":"PZdC-xYFPok-","lightBlue":"_3JD9CXbxRQ8-","informative":"R-kgbH6qPZU-","indigo":"_6juDApQlcS0-","request":"MGcsvmjHlow-","spinning":"dre73387JG8-"};
5
+ var styles = {"inlineLabel":"M01SZy5EYFg-","small":"_8nqeeAapUQU-","base":"_0L5DuoQQ0N0-","large":"QKOUUH9-Fho-","larger":"GdJFaAMVrfU-","greyBlue":"_1KuDugNaT-o-","red":"bHju-S5Uytc-","orange":"hk1-OlPzFpM-","green":"ekQbbiBSxKk-","success":"YBvJuPW-YEI-","blue":"_5X5w6s0pPdw-","inactive":"lju-nyF9vX0-","navy":"nMlCD9k-Meg-","task":"HVMpHULM2PU-","yellow":"hOJmavXturw-","warning":"kfXKagw-wdE-","lime":"ZrdNg5b18oY-","purple":"df-Q7pKd2iI-","invoice":"WE3Qy5JUsN4-","pink":"-Wiy2k-i7tQ-","quote":"NoDP1qZvkds-","teal":"gc8t5abqWH4-","yellowGreen":"SeLhnnpqK70-","job":"L9FK1YwwCB8-","blueDark":"PZdC-xYFPok-","lightBlue":"_3JD9CXbxRQ8-","informative":"R-kgbH6qPZU-","indigo":"_6juDApQlcS0-","request":"MGcsvmjHlow-","spinning":"dre73387JG8-"};
6
6
 
7
7
  function InlineLabel({ size = "base", color = "greyBlue", children, }) {
8
8
  const className = classnames(styles.inlineLabel, styles[size], styles[color]);
9
9
  const sizeMapper = {
10
+ small: "smaller",
10
11
  base: "small",
11
12
  large: "large",
12
13
  larger: "large",
package/dist/styles.css CHANGED
@@ -4415,7 +4415,9 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
4415
4415
  }
4416
4416
 
4417
4417
  .W-9SMjhEMpI- {
4418
- display: inline-block;
4418
+ display: -ms-inline-flexbox;
4419
+ display: inline-flex;
4420
+ max-width: 100%;
4419
4421
  }
4420
4422
 
4421
4423
  :root {
@@ -5252,6 +5254,13 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
5252
5254
  display: inline-flex;
5253
5255
  }
5254
5256
 
5257
+ ._8nqeeAapUQU- {
5258
+ padding: calc(2px) calc(8px);
5259
+ padding: calc(var(--space-smallest)) calc(var(--space-small));
5260
+ border-radius: 16px;
5261
+ border-radius: var(--radius-large);
5262
+ }
5263
+
5255
5264
  ._0L5DuoQQ0N0- {
5256
5265
  padding: calc(4px * 1.5) calc(8px * 1.25);
5257
5266
  padding: calc(var(--space-smaller) * 1.5) calc(var(--space-small) * 1.25);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "6.88.0",
3
+ "version": "6.90.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -543,5 +543,5 @@
543
543
  "> 1%",
544
544
  "IE 10"
545
545
  ],
546
- "gitHead": "b315d894eb1d6f8ea122c880c0338234c860404a"
546
+ "gitHead": "829339495fcb97802380dc109df4c67106963812"
547
547
  }