@jobber/components 4.25.1 → 4.26.1

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/.eslintrc.js ADDED
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ rules: {
3
+ "import/no-internal-modules": [
4
+ "error",
5
+ {
6
+ allow: ["**"],
7
+ },
8
+ ],
9
+ },
10
+ };
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from "react";
2
+ import { IconNames } from "@jobber/design";
2
3
  import { ButtonProps } from "../Button";
3
4
  export type BannerType = "notice" | "success" | "warning" | "error";
4
5
  interface BannerProps {
@@ -13,7 +14,11 @@ interface BannerProps {
13
14
  * @default true
14
15
  */
15
16
  readonly dismissible?: boolean;
17
+ /**
18
+ * Adds an icon to the left of the banner content
19
+ */
20
+ readonly icon?: IconNames;
16
21
  onDismiss?(): void;
17
22
  }
18
- export declare function Banner({ children, type, primaryAction, dismissible, onDismiss, }: BannerProps): JSX.Element;
23
+ export declare function Banner({ children, type, primaryAction, dismissible, icon, onDismiss, }: BannerProps): JSX.Element;
19
24
  export {};
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { IconNames } from "@jobber/design";
3
+ export interface BannerIconProps {
4
+ icon: IconNames;
5
+ }
6
+ export declare function BannerIcon({ icon }: BannerIconProps): JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./BannerIcon";
@@ -18,7 +18,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
18
18
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
19
19
  var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
20
20
 
21
- var css_248z$1 = ".meuT8gYQPJU- {\n display: -ms-flexbox;\n display: flex;\n position: relative;\n box-shadow: 0px calc(16px / 16) calc(16px / 4) 0px\n rgba(0, 0, 0, 0.1),\n 0px calc(16px / 4) 12px 0px rgba(0, 0, 0, 0.05);\n box-shadow: var(--shadow-base);\n padding: calc(16px * 1);\n padding: var(--space-base);\n color: rgb(66, 78, 86);\n color: var(--color-text);\n background-color: rgb(244, 244, 244);\n background-color: var(--color-surface--background);\n gap: calc(16px / 2);\n gap: var(--space-small);\n -ms-flex-align: center;\n align-items: center;\n}\n\n.y4BapyZr-fo- > a {\n color: rgb(66, 78, 86);\n color: var(--color-text);\n}\n\n.y4BapyZr-fo- > a:hover {\n color: rgb(1, 41, 57);\n color: var(--color-blue);\n}\n\n._6v1woNSLEvc- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n gap: calc(16px / 2);\n gap: var(--space-small);\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n -ms-flex-pack: justify;\n justify-content: space-between;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n.y4BapyZr-fo- {\n -ms-flex-item-align: center;\n align-self: center;\n}\n\n._6v1woNSLEvc- > *:last-child {\n margin-bottom: 0;\n}\n\n.bocgLmEhcTU- .y4BapyZr-fo- {\n -ms-flex: 1;\n flex: 1;\n}\n\n.rtNjEzmABX4- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n\n.lunQ5SOfyLg- {\n margin: calc((16px / 8) * -1) 0;\n margin: calc(calc(16px / 8) * -1) 0;\n margin: calc(var(--space-smallest) * -1) 0;\n padding: calc(16px / 8);\n padding: var(--space-smallest);\n border: none;\n background-color: transparent;\n cursor: pointer;\n -webkit-appearance: none;\n appearance: none;\n -ms-flex: 0;\n flex: 0;\n -ms-flex-item-align: start;\n align-self: flex-start;\n}\n\n.lunQ5SOfyLg-:hover {\n background: rgba(0, 0, 0, 0.025);\n}\n\n.lunQ5SOfyLg-:focus {\n box-shadow: 0px 0px calc(16px / 4) calc(16px / 8)\n rgb(231, 213, 87);\n box-shadow: var(--shadow-focus);\n outline: none;\n background: rgba(0, 0, 0, 0.05);\n}\n";
21
+ var css_248z$1 = ".meuT8gYQPJU- {\n display: -ms-flexbox;\n display: flex;\n position: relative;\n box-shadow: 0px calc(16px / 16) calc(16px / 4) 0px\n rgba(0, 0, 0, 0.1),\n 0px calc(16px / 4) 12px 0px rgba(0, 0, 0, 0.05);\n box-shadow: var(--shadow-base);\n padding: calc(16px * 1);\n padding: var(--space-base);\n color: rgb(66, 78, 86);\n color: var(--color-text);\n background-color: rgb(244, 244, 244);\n background-color: var(--color-surface--background);\n gap: calc(16px / 2);\n gap: var(--space-small);\n -ms-flex-align: center;\n align-items: center;\n}\n\n.y4BapyZr-fo- > a {\n color: rgb(66, 78, 86);\n color: var(--color-text);\n}\n\n.y4BapyZr-fo- > a:hover {\n color: rgb(1, 41, 57);\n color: var(--color-blue);\n}\n\n._6v1woNSLEvc- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n gap: calc(16px / 2);\n gap: var(--space-small);\n -ms-flex-wrap: nowrap;\n flex-wrap: nowrap;\n -ms-flex-pack: justify;\n justify-content: space-between;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n@media (max-width: 489.98px) {\n\n._6v1woNSLEvc- {\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n}\n }\n\n@media (--small-screens-and-below) {\n\n._6v1woNSLEvc- {\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n}\n }\n\n.y4BapyZr-fo- {\n -ms-flex: 1;\n flex: 1;\n -ms-flex-item-align: center;\n align-self: center;\n}\n\n._6v1woNSLEvc- > *:last-child {\n margin-bottom: 0;\n}\n\n.bocgLmEhcTU- .y4BapyZr-fo- {\n -ms-flex: 1;\n flex: 1;\n}\n\n.rtNjEzmABX4- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n\n@media (max-width: 489.98px) {\n\n.rtNjEzmABX4- {\n width: 100%;\n margin-top: calc(16px / 2);\n margin-top: var(--space-small);\n}\n }\n\n@media (--small-screens-and-below) {\n\n.rtNjEzmABX4- {\n width: 100%;\n margin-top: calc(16px / 2);\n margin-top: var(--space-small);\n}\n }\n\n.lunQ5SOfyLg- {\n margin: calc((16px / 8) * -1) 0;\n margin: calc(calc(16px / 8) * -1) 0;\n margin: calc(var(--space-smallest) * -1) 0;\n padding: calc(16px / 8);\n padding: var(--space-smallest);\n border: none;\n background-color: transparent;\n cursor: pointer;\n -webkit-appearance: none;\n appearance: none;\n -ms-flex: 0;\n flex: 0;\n -ms-flex-item-align: start;\n align-self: flex-start;\n}\n\n.lunQ5SOfyLg-:hover {\n background: rgba(0, 0, 0, 0.025);\n}\n\n.lunQ5SOfyLg-:focus {\n box-shadow: 0px 0px calc(16px / 4) calc(16px / 8)\n rgb(231, 213, 87);\n box-shadow: var(--shadow-focus);\n outline: none;\n background: rgba(0, 0, 0, 0.05);\n}\n";
22
22
  var styles = {"banner":"meuT8gYQPJU-","bannerChildren":"y4BapyZr-fo-","bannerContent":"_6v1woNSLEvc-","medium":"bocgLmEhcTU-","bannerAction":"rtNjEzmABX4-","closeButton":"lunQ5SOfyLg-"};
23
23
  styleInject_es.styleInject(css_248z$1);
24
24
 
@@ -26,7 +26,11 @@ var css_248z = ".wWW-2T7rCV0- {\n background-color: rgb(226, 241, 250);\n back
26
26
  var types = {"notice":"wWW-2T7rCV0-","success":"_7h8FUHIkVjg-","warning":"d5fXcE1L0lc-","error":"oYaw-T3c0IU-"};
27
27
  styleInject_es.styleInject(css_248z);
28
28
 
29
- function Banner({ children, type, primaryAction, dismissible = true, onDismiss, }) {
29
+ function BannerIcon({ icon }) {
30
+ return React__default["default"].createElement(Icon.Icon, { name: icon, color: "greyBlueDark" });
31
+ }
32
+
33
+ function Banner({ children, type, primaryAction, dismissible = true, icon, onDismiss, }) {
30
34
  const [showBanner, setShowBanner] = React.useState(true);
31
35
  const bannerWidths = {
32
36
  small: 320,
@@ -53,6 +57,7 @@ function Banner({ children, type, primaryAction, dismissible = true, onDismiss,
53
57
  });
54
58
  return (React__default["default"].createElement(React__default["default"].Fragment, null, showBanner && (React__default["default"].createElement("div", { className: bannerClassNames, ref: bannerRef, role: type === "error" ? "alert" : "status" },
55
59
  React__default["default"].createElement("div", { className: styles.bannerContent },
60
+ icon && React__default["default"].createElement(BannerIcon, { icon: icon }),
56
61
  React__default["default"].createElement("div", { className: styles.bannerChildren },
57
62
  React__default["default"].createElement(BannerChildren, null, children)),
58
63
  primaryAction && (React__default["default"].createElement("div", { className: styles.bannerAction },
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function DataList(): JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ComponentMeta, ComponentStory } from "@storybook/react";
2
+ import { DataList } from "./DataList";
3
+ declare const _default: ComponentMeta<typeof DataList>;
4
+ export default _default;
5
+ export declare const Basic: ComponentStory<typeof DataList>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "4.25.1",
3
+ "version": "4.26.1",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -83,5 +83,5 @@
83
83
  "> 1%",
84
84
  "IE 10"
85
85
  ],
86
- "gitHead": "a7f25a47c7b128c308f582d83238805f6606b401"
86
+ "gitHead": "f746f6aa17c2fb635790a7a652dc76e12a398643"
87
87
  }