@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 +10 -0
- package/dist/Banner/Banner.d.ts +6 -1
- package/dist/Banner/components/BannerIcon/BannerIcon.d.ts +6 -0
- package/dist/Banner/components/BannerIcon/index.d.ts +1 -0
- package/dist/Banner/index.js +7 -2
- package/dist/DataList/DataList.d.ts +2 -0
- package/dist/DataList/DataList.stories.d.ts +5 -0
- package/package.json +2 -2
package/.eslintrc.js
ADDED
package/dist/Banner/Banner.d.ts
CHANGED
|
@@ -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 @@
|
|
|
1
|
+
export * from "./BannerIcon";
|
package/dist/Banner/index.js
CHANGED
|
@@ -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:
|
|
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
|
|
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 },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "4.
|
|
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": "
|
|
86
|
+
"gitHead": "f746f6aa17c2fb635790a7a652dc76e12a398643"
|
|
87
87
|
}
|