@jobber/components 6.26.1 → 6.26.2-scotttla-c4cc76e.32
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/AtlantisPortalContent.d.ts +1 -0
- package/AtlantisPortalContent.js +17 -0
- package/Cluster.d.ts +1 -0
- package/Cluster.js +17 -0
- package/Container.d.ts +1 -0
- package/Container.js +17 -0
- package/ContentBlock.d.ts +1 -0
- package/ContentBlock.js +17 -0
- package/Cover.d.ts +1 -0
- package/Cover.js +17 -0
- package/Frame.d.ts +1 -0
- package/Frame.js +17 -0
- package/ResponsiveSwitcher.d.ts +1 -0
- package/ResponsiveSwitcher.js +17 -0
- package/SideKick.d.ts +1 -0
- package/SideKick.js +17 -0
- package/Stack.d.ts +1 -0
- package/Stack.js +17 -0
- package/Tiles.d.ts +1 -0
- package/Tiles.js +17 -0
- package/dist/AtlantisPortalContent/AtlantisPortalContent.d.ts +2 -0
- package/dist/AtlantisPortalContent/AtlantisPortalContent.types.d.ts +4 -0
- package/dist/AtlantisPortalContent/index.cjs +19 -0
- package/dist/AtlantisPortalContent/index.d.ts +2 -0
- package/dist/AtlantisPortalContent/index.mjs +13 -0
- package/dist/AtlantisPortalContent-cjs.js +11 -0
- package/dist/AtlantisPortalContent-es.js +9 -0
- package/dist/Banner/Banner.d.ts +7 -4
- package/dist/Banner-cjs.js +2 -2
- package/dist/Banner-es.js +2 -2
- package/dist/Box-cjs.js +1 -1
- package/dist/Box-es.js +1 -1
- package/dist/Button/Button.types.d.ts +27 -0
- package/dist/Button/ButtonInternals.d.ts +2 -2
- package/dist/Button/ButtonProvider.d.ts +1 -1
- package/dist/Button/index.cjs +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/index.mjs +1 -1
- package/dist/Button-cjs.js +14 -13
- package/dist/Button-es.js +14 -13
- package/dist/ButtonDismiss/ButtonDismiss.d.ts +1 -2
- package/dist/ButtonDismiss/index.d.ts +1 -1
- package/dist/Card/Card.d.ts +66 -7
- package/dist/Card/types.d.ts +10 -1
- package/dist/Card-cjs.js +59 -9
- package/dist/Card-es.js +59 -9
- package/dist/Chip-cjs.js +1 -1
- package/dist/Chip-es.js +1 -1
- package/dist/Cluster/Cluster.d.ts +2 -0
- package/dist/Cluster/index.cjs +16 -0
- package/dist/Cluster/index.d.ts +1 -0
- package/dist/Cluster/index.mjs +10 -0
- package/dist/Cluster/types.d.ts +21 -0
- package/dist/Cluster-cjs.js +50 -0
- package/dist/Cluster-es.js +48 -0
- package/dist/Container/Container.d.ts +5 -0
- package/dist/Container/index.cjs +9 -0
- package/dist/Container/index.d.ts +1 -0
- package/dist/Container/index.mjs +3 -0
- package/dist/Container/types.d.ts +11 -0
- package/dist/Container-cjs.js +17 -0
- package/dist/Container-es.js +15 -0
- package/dist/ContentBlock/ContentBlock.d.ts +2 -0
- package/dist/ContentBlock/index.cjs +15 -0
- package/dist/ContentBlock/index.d.ts +1 -0
- package/dist/ContentBlock/index.mjs +9 -0
- package/dist/ContentBlock/types.d.ts +21 -0
- package/dist/ContentBlock-cjs.js +40 -0
- package/dist/ContentBlock-es.js +38 -0
- package/dist/Cover/Cover.d.ts +8 -0
- package/dist/Cover/index.cjs +8 -0
- package/dist/Cover/index.d.ts +1 -0
- package/dist/Cover/index.mjs +2 -0
- package/dist/Cover/types.d.ts +7 -0
- package/dist/Cover-cjs.js +17 -0
- package/dist/Cover-es.js +15 -0
- package/dist/DataList/DataList.types.d.ts +8 -0
- package/dist/DataList-cjs.js +0 -3
- package/dist/DataList-es.js +0 -3
- package/dist/DataListSearch-cjs.js +4 -2
- package/dist/DataListSearch-es.js +4 -2
- package/dist/FormField/FormFieldTypes.d.ts +6 -0
- package/dist/FormField/hooks/useAtlantisFormField.d.ts +2 -2
- package/dist/FormField-cjs.js +12 -4
- package/dist/FormField-es.js +12 -4
- package/dist/Frame/Frame.d.ts +2 -0
- package/dist/Frame/index.cjs +8 -0
- package/dist/Frame/index.d.ts +2 -0
- package/dist/Frame/index.mjs +2 -0
- package/dist/Frame/types.d.ts +7 -0
- package/dist/Frame-cjs.js +14 -0
- package/dist/Frame-es.js +12 -0
- package/dist/Heading/Heading.d.ts +14 -2
- package/dist/Heading-cjs.js +2 -2
- package/dist/Heading-es.js +2 -2
- package/dist/InputDate/index.cjs +1 -1
- package/dist/InputDate/index.mjs +1 -1
- package/dist/InputEmail-cjs.js +1 -1
- package/dist/InputEmail-es.js +1 -1
- package/dist/InputNumber-cjs.js +1 -1
- package/dist/InputNumber-es.js +1 -1
- package/dist/InputPassword-cjs.js +1 -1
- package/dist/InputPassword-es.js +1 -1
- package/dist/InputPhoneNumber-cjs.js +2 -2
- package/dist/InputPhoneNumber-es.js +2 -2
- package/dist/InputText/index.cjs +1 -1
- package/dist/InputText/index.mjs +1 -1
- package/dist/InputTime-cjs.js +1 -1
- package/dist/InputTime-es.js +1 -1
- package/dist/Option-cjs.js +1 -1
- package/dist/Option-es.js +1 -1
- package/dist/Page/Page.d.ts +0 -1
- package/dist/Page-cjs.js +1 -1
- package/dist/Page-es.js +1 -1
- package/dist/Popover/Popover.d.ts +7 -45
- package/dist/Popover/Popover.types.d.ts +109 -0
- package/dist/Popover/PopoverContext.d.ts +11 -0
- package/dist/Popover/index.cjs +17 -4
- package/dist/Popover/index.d.ts +3 -0
- package/dist/Popover/index.mjs +16 -5
- package/dist/Popover/usePopover.d.ts +13 -0
- package/dist/Popover/usePopoverStyles.d.ts +5 -0
- package/dist/Popover-cjs.js +93 -38
- package/dist/Popover-es.js +93 -40
- package/dist/ResponsiveSwitcher/ResponsiveSwitcher.d.ts +2 -0
- package/dist/ResponsiveSwitcher/index.cjs +9 -0
- package/dist/ResponsiveSwitcher/index.d.ts +1 -0
- package/dist/ResponsiveSwitcher/index.mjs +3 -0
- package/dist/ResponsiveSwitcher/types.d.ts +10 -0
- package/dist/ResponsiveSwitcher-cjs.js +28 -0
- package/dist/ResponsiveSwitcher-es.js +26 -0
- package/dist/Select/Select.d.ts +1 -1
- package/dist/SideKick/SideKick.d.ts +2 -0
- package/dist/SideKick/index.cjs +10 -0
- package/dist/SideKick/index.d.ts +1 -0
- package/dist/SideKick/index.mjs +4 -0
- package/dist/SideKick/types.d.ts +14 -0
- package/dist/SideKick-cjs.js +34 -0
- package/dist/SideKick-es.js +32 -0
- package/dist/Stack/Stack.d.ts +2 -0
- package/dist/Stack/index.cjs +9 -0
- package/dist/Stack/index.d.ts +1 -0
- package/dist/Stack/index.mjs +3 -0
- package/dist/Stack/types.d.ts +12 -0
- package/dist/Stack-cjs.js +29 -0
- package/dist/Stack-es.js +27 -0
- package/dist/Text/Text.d.ts +14 -1
- package/dist/Text-cjs.js +2 -2
- package/dist/Text-es.js +2 -2
- package/dist/Tiles/Tiles.d.ts +2 -0
- package/dist/Tiles/index.cjs +8 -0
- package/dist/Tiles/index.d.ts +1 -0
- package/dist/Tiles/index.mjs +2 -0
- package/dist/Tiles/types.d.ts +8 -0
- package/dist/Tiles-cjs.js +26 -0
- package/dist/Tiles-es.js +24 -0
- package/dist/index.cjs +23 -1
- package/dist/index.d.mts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.mjs +13 -2
- package/dist/styles.css +423 -9
- package/dist/useDebounce-cjs.js +1 -1
- package/dist/useDebounce-es.js +1 -1
- package/dist/useScrollToActive-cjs.js +35 -14
- package/dist/useScrollToActive-es.js +35 -14
- package/dist/utils/meta/meta.json +17 -1
- package/dist/utils/useDebounce.d.ts +1 -1
- package/package.json +48 -4
- package/rollup.config.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/AtlantisPortalContent";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var AtlantisPortalContent = require("./dist/AtlantisPortalContent");
|
|
8
|
+
|
|
9
|
+
Object.keys(AtlantisPortalContent).forEach(function(key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function get() {
|
|
14
|
+
return AtlantisPortalContent[key];
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
});
|
package/Cluster.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/Cluster";
|
package/Cluster.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var Cluster = require("./dist/Cluster");
|
|
8
|
+
|
|
9
|
+
Object.keys(Cluster).forEach(function(key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function get() {
|
|
14
|
+
return Cluster[key];
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
});
|
package/Container.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/Container";
|
package/Container.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var Container = require("./dist/Container");
|
|
8
|
+
|
|
9
|
+
Object.keys(Container).forEach(function(key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function get() {
|
|
14
|
+
return Container[key];
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/ContentBlock";
|
package/ContentBlock.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var ContentBlock = require("./dist/ContentBlock");
|
|
8
|
+
|
|
9
|
+
Object.keys(ContentBlock).forEach(function(key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function get() {
|
|
14
|
+
return ContentBlock[key];
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
});
|
package/Cover.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/Cover";
|
package/Cover.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var Cover = require("./dist/Cover");
|
|
8
|
+
|
|
9
|
+
Object.keys(Cover).forEach(function(key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function get() {
|
|
14
|
+
return Cover[key];
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
});
|
package/Frame.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/Frame";
|
package/Frame.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var Frame = require("./dist/Frame");
|
|
8
|
+
|
|
9
|
+
Object.keys(Frame).forEach(function(key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function get() {
|
|
14
|
+
return Frame[key];
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/ResponsiveSwitcher";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var ResponsiveSwitcher = require("./dist/ResponsiveSwitcher");
|
|
8
|
+
|
|
9
|
+
Object.keys(ResponsiveSwitcher).forEach(function(key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function get() {
|
|
14
|
+
return ResponsiveSwitcher[key];
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
});
|
package/SideKick.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/SideKick";
|
package/SideKick.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var SideKick = require("./dist/SideKick");
|
|
8
|
+
|
|
9
|
+
Object.keys(SideKick).forEach(function(key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function get() {
|
|
14
|
+
return SideKick[key];
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
});
|
package/Stack.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/Stack";
|
package/Stack.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var Stack = require("./dist/Stack");
|
|
8
|
+
|
|
9
|
+
Object.keys(Stack).forEach(function(key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function get() {
|
|
14
|
+
return Stack[key];
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
});
|
package/Tiles.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/Tiles";
|
package/Tiles.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var Tiles = require("./dist/Tiles");
|
|
8
|
+
|
|
9
|
+
Object.keys(Tiles).forEach(function(key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function get() {
|
|
14
|
+
return Tiles[key];
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var AtlantisPortalContent = require('../AtlantisPortalContent-cjs.js');
|
|
4
|
+
require('react');
|
|
5
|
+
require('../AtlantisThemeContext-cjs.js');
|
|
6
|
+
require('@jobber/design');
|
|
7
|
+
require('../_commonjsHelpers-cjs.js');
|
|
8
|
+
require('../identity-cjs.js');
|
|
9
|
+
require('../isTypedArray-cjs.js');
|
|
10
|
+
require('../isObjectLike-cjs.js');
|
|
11
|
+
require('../_baseAssignValue-cjs.js');
|
|
12
|
+
require('../_baseFor-cjs.js');
|
|
13
|
+
require('../keysIn-cjs.js');
|
|
14
|
+
require('../_isIterateeCall-cjs.js');
|
|
15
|
+
require('../_setToString-cjs.js');
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
exports.AtlantisPortalContent = AtlantisPortalContent.AtlantisPortalContent;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { A as AtlantisPortalContent } from '../AtlantisPortalContent-es.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../AtlantisThemeContext-es.js';
|
|
4
|
+
import '@jobber/design';
|
|
5
|
+
import '../_commonjsHelpers-es.js';
|
|
6
|
+
import '../identity-es.js';
|
|
7
|
+
import '../isTypedArray-es.js';
|
|
8
|
+
import '../isObjectLike-es.js';
|
|
9
|
+
import '../_baseAssignValue-es.js';
|
|
10
|
+
import '../_baseFor-es.js';
|
|
11
|
+
import '../keysIn-es.js';
|
|
12
|
+
import '../_isIterateeCall-es.js';
|
|
13
|
+
import '../_setToString-es.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var AtlantisThemeContext = require('./AtlantisThemeContext-cjs.js');
|
|
5
|
+
|
|
6
|
+
function AtlantisPortalContent({ children, }) {
|
|
7
|
+
const { theme } = AtlantisThemeContext.useAtlantisTheme();
|
|
8
|
+
return (React.createElement(AtlantisThemeContext.AtlantisThemeContextProvider, { dangerouslyOverrideTheme: theme }, children));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
exports.AtlantisPortalContent = AtlantisPortalContent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { u as useAtlantisTheme, A as AtlantisThemeContextProvider } from './AtlantisThemeContext-es.js';
|
|
3
|
+
|
|
4
|
+
function AtlantisPortalContent({ children, }) {
|
|
5
|
+
const { theme } = useAtlantisTheme();
|
|
6
|
+
return (React__default.createElement(AtlantisThemeContextProvider, { dangerouslyOverrideTheme: theme }, children));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { AtlantisPortalContent as A };
|
package/dist/Banner/Banner.d.ts
CHANGED
|
@@ -4,23 +4,26 @@ import { BannerType } from "./Banner.types";
|
|
|
4
4
|
import { ButtonProps } from "../Button";
|
|
5
5
|
interface BannerProps {
|
|
6
6
|
readonly children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Sets the status-based theme of the Banner
|
|
9
|
+
*/
|
|
7
10
|
readonly type: BannerType;
|
|
8
11
|
/**
|
|
9
|
-
*
|
|
10
|
-
* 'type' is set to 'notice' we change the cta variation to 'learning'
|
|
12
|
+
* Accepts props for Button. Default action uses a 'subtle' Button
|
|
11
13
|
*/
|
|
12
14
|
readonly primaryAction?: ButtonProps;
|
|
13
15
|
/**
|
|
16
|
+
* Set to false to hide the dismiss button
|
|
14
17
|
* @default true
|
|
15
18
|
*/
|
|
16
19
|
readonly dismissible?: boolean;
|
|
17
20
|
/**
|
|
18
|
-
*
|
|
21
|
+
* Use to override the default status Icon
|
|
19
22
|
*/
|
|
20
23
|
readonly icon?: IconNames;
|
|
21
24
|
onDismiss?(): void;
|
|
22
25
|
/**
|
|
23
|
-
* When provided,
|
|
26
|
+
* When provided, Banner's visibility is controlled by this value
|
|
24
27
|
* @default undefined
|
|
25
28
|
*/
|
|
26
29
|
readonly controlledVisiblity?: boolean;
|
package/dist/Banner-cjs.js
CHANGED
|
@@ -51,11 +51,11 @@ function Banner({ children, type, primaryAction, dismissible = true, icon, onDis
|
|
|
51
51
|
function getBannerIcon(type) {
|
|
52
52
|
switch (type) {
|
|
53
53
|
case "notice":
|
|
54
|
-
return "
|
|
54
|
+
return "info";
|
|
55
55
|
case "success":
|
|
56
56
|
return "checkmark";
|
|
57
57
|
case "warning":
|
|
58
|
-
return "
|
|
58
|
+
return "warning";
|
|
59
59
|
case "error":
|
|
60
60
|
return "alert";
|
|
61
61
|
}
|
package/dist/Banner-es.js
CHANGED
|
@@ -49,11 +49,11 @@ function Banner({ children, type, primaryAction, dismissible = true, icon, onDis
|
|
|
49
49
|
function getBannerIcon(type) {
|
|
50
50
|
switch (type) {
|
|
51
51
|
case "notice":
|
|
52
|
-
return "
|
|
52
|
+
return "info";
|
|
53
53
|
case "success":
|
|
54
54
|
return "checkmark";
|
|
55
55
|
case "warning":
|
|
56
|
-
return "
|
|
56
|
+
return "warning";
|
|
57
57
|
case "error":
|
|
58
58
|
return "alert";
|
|
59
59
|
}
|
package/dist/Box-cjs.js
CHANGED
|
@@ -117,7 +117,7 @@ function getVars(size, basePrefix = "--box-padding") {
|
|
|
117
117
|
|
|
118
118
|
var styles = {"box":"_3hq7jJitEgs-","preserve-white-space":"oWJNe7O1DFI-","spinning":"wXEsL-y93kQ-"};
|
|
119
119
|
|
|
120
|
-
var gapStyles = {"gap-minuscule":"QJaShYW08G4-","gap-smallest":"_6Cm3NqSDt4Y-","gap-smaller":"_4HNb8yqqy34-","gap-small":"O-c4Zb8TOoE-","gap-base":"JdxCZSu6mUE-","gap-large":"-yIVkzs7exw-","gap-larger":"obuoQPiyBuc-","gap-largest":"VqE9QLxSDIE-","gap-extravagant":"_4jHngIdjuqo-","spinning":"a-aXE4DiSRI-"};
|
|
120
|
+
var gapStyles = {"gap-minuscule":"QJaShYW08G4-","gap-smallest":"_6Cm3NqSDt4Y-","gap-smaller":"_4HNb8yqqy34-","gap-small":"O-c4Zb8TOoE-","gap-slim":"-jtvRWsRRc4-","gap-base":"JdxCZSu6mUE-","gap-large":"-yIVkzs7exw-","gap-larger":"obuoQPiyBuc-","gap-largest":"VqE9QLxSDIE-","gap-extravagant":"_4jHngIdjuqo-","spinning":"a-aXE4DiSRI-"};
|
|
121
121
|
|
|
122
122
|
var radiusStyles = {"radius-small":"kCKg-JJTRO8-","radius-base":"_235nMwtuWSw-","radius-large":"_9ppkWehd4QA-","radius-larger":"CsG3cZAn6r0-","radius-circle":"WWKSAC2020Q-","spinning":"CiyryaHCYUs-"};
|
|
123
123
|
|
package/dist/Box-es.js
CHANGED
|
@@ -115,7 +115,7 @@ function getVars(size, basePrefix = "--box-padding") {
|
|
|
115
115
|
|
|
116
116
|
var styles = {"box":"_3hq7jJitEgs-","preserve-white-space":"oWJNe7O1DFI-","spinning":"wXEsL-y93kQ-"};
|
|
117
117
|
|
|
118
|
-
var gapStyles = {"gap-minuscule":"QJaShYW08G4-","gap-smallest":"_6Cm3NqSDt4Y-","gap-smaller":"_4HNb8yqqy34-","gap-small":"O-c4Zb8TOoE-","gap-base":"JdxCZSu6mUE-","gap-large":"-yIVkzs7exw-","gap-larger":"obuoQPiyBuc-","gap-largest":"VqE9QLxSDIE-","gap-extravagant":"_4jHngIdjuqo-","spinning":"a-aXE4DiSRI-"};
|
|
118
|
+
var gapStyles = {"gap-minuscule":"QJaShYW08G4-","gap-smallest":"_6Cm3NqSDt4Y-","gap-smaller":"_4HNb8yqqy34-","gap-small":"O-c4Zb8TOoE-","gap-slim":"-jtvRWsRRc4-","gap-base":"JdxCZSu6mUE-","gap-large":"-yIVkzs7exw-","gap-larger":"obuoQPiyBuc-","gap-largest":"VqE9QLxSDIE-","gap-extravagant":"_4jHngIdjuqo-","spinning":"a-aXE4DiSRI-"};
|
|
119
119
|
|
|
120
120
|
var radiusStyles = {"radius-small":"kCKg-JJTRO8-","radius-base":"_235nMwtuWSw-","radius-large":"_9ppkWehd4QA-","radius-larger":"CsG3cZAn6r0-","radius-circle":"WWKSAC2020Q-","spinning":"CiyryaHCYUs-"};
|
|
121
121
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { IconNames } from "@jobber/design";
|
|
2
2
|
import { LinkProps } from "react-router-dom";
|
|
3
3
|
import { XOR } from "ts-xor";
|
|
4
|
+
import { CSSProperties } from "react";
|
|
5
|
+
import { TypographyProps } from "../Typography/Typography";
|
|
6
|
+
import { IconProps } from "../Icon/Icon";
|
|
4
7
|
export type HTMLButtonType = "button" | "submit";
|
|
5
8
|
export type ButtonVariation = "work" | "learning" | "subtle" | "destructive";
|
|
6
9
|
export type ButtonSize = "small" | "base" | "large";
|
|
@@ -22,6 +25,30 @@ export interface ButtonFoundationProps {
|
|
|
22
25
|
readonly ariaLabel?: string;
|
|
23
26
|
onClick?(event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>): void;
|
|
24
27
|
onMouseDown?(event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>): void;
|
|
28
|
+
/**
|
|
29
|
+
* **Use at your own risk:** Custom class names for specific elements. This should only be used as a
|
|
30
|
+
* **last resort**. Using this may result in unexpected side effects.
|
|
31
|
+
* **Note:** If you are applying fill override to buttonIcon.path, you will need to add !important due
|
|
32
|
+
* to Button's children element css inheritance.
|
|
33
|
+
* More information in the [Customizing components Guide](https://atlantis.getjobber.com/guides/customizing-components).
|
|
34
|
+
*/
|
|
35
|
+
readonly UNSAFE_className?: {
|
|
36
|
+
container?: string;
|
|
37
|
+
buttonLabel?: TypographyProps["UNSAFE_className"];
|
|
38
|
+
buttonIcon?: IconProps["UNSAFE_className"];
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* **Use at your own risk:** Custom style for specific elements. This should only be used as a
|
|
42
|
+
* **last resort**. Using this may result in unexpected side effects.
|
|
43
|
+
* **Note:** If you are applying fill override to buttonIcon.path, you will need to add !important due
|
|
44
|
+
* to Button's children element css inheritance.
|
|
45
|
+
* More information in the [Customizing components Guide](https://atlantis.getjobber.com/guides/customizing-components).
|
|
46
|
+
*/
|
|
47
|
+
readonly UNSAFE_style?: {
|
|
48
|
+
container?: CSSProperties;
|
|
49
|
+
buttonLabel?: TypographyProps["UNSAFE_style"];
|
|
50
|
+
buttonIcon?: IconProps["UNSAFE_style"];
|
|
51
|
+
};
|
|
25
52
|
}
|
|
26
53
|
interface ButtonNonComposableProps extends ButtonFoundationProps {
|
|
27
54
|
readonly icon?: IconNames;
|
|
@@ -5,6 +5,6 @@ import { TypographyProps } from "../Typography";
|
|
|
5
5
|
* For backwards compatibility with the legacy button
|
|
6
6
|
* @deprecated Used composed solution instead
|
|
7
7
|
*/
|
|
8
|
-
export declare function ButtonContent({ label, icon, size, iconOnRight, }: Pick<ButtonProps, "label" | "icon" | "size" | "iconOnRight">): JSX.Element;
|
|
9
|
-
export declare function ButtonIcon({ size: sizeProp, ...props }: Pick<IconProps, "size" | "name" | "testID">): JSX.Element;
|
|
8
|
+
export declare function ButtonContent({ label, icon, size, iconOnRight, UNSAFE_className, UNSAFE_style, }: Pick<ButtonProps, "label" | "icon" | "size" | "iconOnRight" | "UNSAFE_className" | "UNSAFE_style">): JSX.Element;
|
|
9
|
+
export declare function ButtonIcon({ size: sizeProp, ...props }: Pick<IconProps, "size" | "name" | "testID" | "UNSAFE_className" | "UNSAFE_style">): JSX.Element;
|
|
10
10
|
export declare function ButtonLabel({ element, fontWeight, fontFamily, size: sizeProp, ...props }: Omit<TypographyProps, "textColor">): JSX.Element;
|
|
@@ -6,5 +6,5 @@ interface ButtonContextProps {
|
|
|
6
6
|
export declare function ButtonProvider({ children, size, }: PropsWithChildren<{
|
|
7
7
|
readonly size?: ButtonSize;
|
|
8
8
|
}>): JSX.Element;
|
|
9
|
-
export declare function
|
|
9
|
+
export declare function useButtonContext(): ButtonContextProps;
|
|
10
10
|
export {};
|
package/dist/Button/index.cjs
CHANGED
package/dist/Button/index.d.ts
CHANGED
package/dist/Button/index.mjs
CHANGED
package/dist/Button-cjs.js
CHANGED
|
@@ -15,12 +15,12 @@ const ButtonContext = React.createContext({
|
|
|
15
15
|
function ButtonProvider({ children, size = "base", }) {
|
|
16
16
|
return (React.createElement(ButtonContext.Provider, { value: { size } }, children));
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function useButtonContext() {
|
|
19
19
|
return React.useContext(ButtonContext);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
function useButtonStyles({ size: sizeProp, disabled, fullWidth, loading, variation = "work", type = "primary", }) {
|
|
23
|
-
const { size: contextSize } =
|
|
23
|
+
const { size: contextSize } = useButtonContext();
|
|
24
24
|
const size = sizeProp || contextSize;
|
|
25
25
|
const wrapper = classnames([styles.button, styles[size], styles[variation], styles[type]], {
|
|
26
26
|
[styles.disabled]: disabled,
|
|
@@ -39,11 +39,11 @@ function useButtonStyles({ size: sizeProp, disabled, fullWidth, loading, variati
|
|
|
39
39
|
* For backwards compatibility with the legacy button
|
|
40
40
|
* @deprecated Used composed solution instead
|
|
41
41
|
*/
|
|
42
|
-
function ButtonContent({ label, icon, size = "base", iconOnRight = false, }) {
|
|
42
|
+
function ButtonContent({ label, icon, size = "base", iconOnRight = false, UNSAFE_className, UNSAFE_style, }) {
|
|
43
43
|
return (React.createElement(React.Fragment, null,
|
|
44
|
-
icon && !iconOnRight && React.createElement(ButtonIcon, { name: icon, size: size }),
|
|
45
|
-
label && React.createElement(ButtonLabel, { size: size }, label),
|
|
46
|
-
icon && iconOnRight && React.createElement(ButtonIcon, { name: icon, size: size })));
|
|
44
|
+
icon && !iconOnRight && (React.createElement(ButtonIcon, { name: icon, size: size, UNSAFE_className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.buttonIcon, UNSAFE_style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.buttonIcon })),
|
|
45
|
+
label && (React.createElement(ButtonLabel, { size: size, UNSAFE_className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.buttonLabel, UNSAFE_style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.buttonLabel }, label)),
|
|
46
|
+
icon && iconOnRight && (React.createElement(ButtonIcon, { name: icon, size: size, UNSAFE_className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.buttonIcon, UNSAFE_style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.buttonIcon }))));
|
|
47
47
|
}
|
|
48
48
|
function getTypeSizes(size) {
|
|
49
49
|
switch (size) {
|
|
@@ -57,13 +57,13 @@ function getTypeSizes(size) {
|
|
|
57
57
|
}
|
|
58
58
|
function ButtonIcon(_a) {
|
|
59
59
|
var { size: sizeProp } = _a, props = tslib_es6.__rest(_a, ["size"]);
|
|
60
|
-
const { size: contextSize } =
|
|
60
|
+
const { size: contextSize } = useButtonContext();
|
|
61
61
|
const size = sizeProp || contextSize;
|
|
62
62
|
return React.createElement(Icon.Icon, Object.assign({}, props, { size: size }));
|
|
63
63
|
}
|
|
64
64
|
function ButtonLabel(_a) {
|
|
65
65
|
var { element = "span", fontWeight = "semiBold", fontFamily = "base", size: sizeProp } = _a, props = tslib_es6.__rest(_a, ["element", "fontWeight", "fontFamily", "size"]);
|
|
66
|
-
const { size: contextSize } =
|
|
66
|
+
const { size: contextSize } = useButtonContext();
|
|
67
67
|
const size = sizeProp || contextSize;
|
|
68
68
|
return (React.createElement(Typography.Typography, Object.assign({ element: element, fontWeight: fontWeight, fontFamily: fontFamily, size: getTypeSizes(size) }, props)));
|
|
69
69
|
}
|
|
@@ -74,12 +74,13 @@ function Button(props) {
|
|
|
74
74
|
React.createElement(ButtonWrapper, Object.assign({}, props))));
|
|
75
75
|
}
|
|
76
76
|
function ButtonWrapper(props) {
|
|
77
|
-
const { ariaControls, ariaHaspopup, ariaExpanded, ariaLabel, disabled = false, external, id, name, onClick, onMouseDown, role, value, submit, to, url, } = props;
|
|
77
|
+
const { ariaControls, ariaHaspopup, ariaExpanded, ariaLabel, disabled = false, external, id, name, onClick, onMouseDown, role, value, submit, to, url, UNSAFE_className = {}, UNSAFE_style = {}, children, } = props;
|
|
78
78
|
const { combined } = useButtonStyles(props);
|
|
79
79
|
const buttonType = submit ? "submit" : "button";
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
const buttonClassNames = classnames(combined, UNSAFE_className.container);
|
|
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 });
|
|
83
|
+
const buttonInternals = children || React.createElement(ButtonContent, Object.assign({}, props));
|
|
83
84
|
if (to) {
|
|
84
85
|
return (React.createElement(reactRouterDom.Link, Object.assign({}, tagProps, { to: to }), buttonInternals));
|
|
85
86
|
}
|
|
@@ -90,5 +91,5 @@ Button.Label = ButtonLabel;
|
|
|
90
91
|
Button.Icon = ButtonIcon;
|
|
91
92
|
|
|
92
93
|
exports.Button = Button;
|
|
93
|
-
exports.
|
|
94
|
+
exports.useButtonContext = useButtonContext;
|
|
94
95
|
exports.useButtonStyles = useButtonStyles;
|
package/dist/Button-es.js
CHANGED
|
@@ -13,12 +13,12 @@ const ButtonContext = createContext({
|
|
|
13
13
|
function ButtonProvider({ children, size = "base", }) {
|
|
14
14
|
return (React__default.createElement(ButtonContext.Provider, { value: { size } }, children));
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function useButtonContext() {
|
|
17
17
|
return useContext(ButtonContext);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
function useButtonStyles({ size: sizeProp, disabled, fullWidth, loading, variation = "work", type = "primary", }) {
|
|
21
|
-
const { size: contextSize } =
|
|
21
|
+
const { size: contextSize } = useButtonContext();
|
|
22
22
|
const size = sizeProp || contextSize;
|
|
23
23
|
const wrapper = classnames([styles.button, styles[size], styles[variation], styles[type]], {
|
|
24
24
|
[styles.disabled]: disabled,
|
|
@@ -37,11 +37,11 @@ function useButtonStyles({ size: sizeProp, disabled, fullWidth, loading, variati
|
|
|
37
37
|
* For backwards compatibility with the legacy button
|
|
38
38
|
* @deprecated Used composed solution instead
|
|
39
39
|
*/
|
|
40
|
-
function ButtonContent({ label, icon, size = "base", iconOnRight = false, }) {
|
|
40
|
+
function ButtonContent({ label, icon, size = "base", iconOnRight = false, UNSAFE_className, UNSAFE_style, }) {
|
|
41
41
|
return (React__default.createElement(React__default.Fragment, null,
|
|
42
|
-
icon && !iconOnRight && React__default.createElement(ButtonIcon, { name: icon, size: size }),
|
|
43
|
-
label && React__default.createElement(ButtonLabel, { size: size }, label),
|
|
44
|
-
icon && iconOnRight && React__default.createElement(ButtonIcon, { name: icon, size: size })));
|
|
42
|
+
icon && !iconOnRight && (React__default.createElement(ButtonIcon, { name: icon, size: size, UNSAFE_className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.buttonIcon, UNSAFE_style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.buttonIcon })),
|
|
43
|
+
label && (React__default.createElement(ButtonLabel, { size: size, UNSAFE_className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.buttonLabel, UNSAFE_style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.buttonLabel }, label)),
|
|
44
|
+
icon && iconOnRight && (React__default.createElement(ButtonIcon, { name: icon, size: size, UNSAFE_className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.buttonIcon, UNSAFE_style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.buttonIcon }))));
|
|
45
45
|
}
|
|
46
46
|
function getTypeSizes(size) {
|
|
47
47
|
switch (size) {
|
|
@@ -55,13 +55,13 @@ function getTypeSizes(size) {
|
|
|
55
55
|
}
|
|
56
56
|
function ButtonIcon(_a) {
|
|
57
57
|
var { size: sizeProp } = _a, props = __rest(_a, ["size"]);
|
|
58
|
-
const { size: contextSize } =
|
|
58
|
+
const { size: contextSize } = useButtonContext();
|
|
59
59
|
const size = sizeProp || contextSize;
|
|
60
60
|
return React__default.createElement(Icon, Object.assign({}, props, { size: size }));
|
|
61
61
|
}
|
|
62
62
|
function ButtonLabel(_a) {
|
|
63
63
|
var { element = "span", fontWeight = "semiBold", fontFamily = "base", size: sizeProp } = _a, props = __rest(_a, ["element", "fontWeight", "fontFamily", "size"]);
|
|
64
|
-
const { size: contextSize } =
|
|
64
|
+
const { size: contextSize } = useButtonContext();
|
|
65
65
|
const size = sizeProp || contextSize;
|
|
66
66
|
return (React__default.createElement(Typography, Object.assign({ element: element, fontWeight: fontWeight, fontFamily: fontFamily, size: getTypeSizes(size) }, props)));
|
|
67
67
|
}
|
|
@@ -72,12 +72,13 @@ function Button(props) {
|
|
|
72
72
|
React__default.createElement(ButtonWrapper, Object.assign({}, props))));
|
|
73
73
|
}
|
|
74
74
|
function ButtonWrapper(props) {
|
|
75
|
-
const { ariaControls, ariaHaspopup, ariaExpanded, ariaLabel, disabled = false, external, id, name, onClick, onMouseDown, role, value, submit, to, url, } = props;
|
|
75
|
+
const { ariaControls, ariaHaspopup, ariaExpanded, ariaLabel, disabled = false, external, id, name, onClick, onMouseDown, role, value, submit, to, url, UNSAFE_className = {}, UNSAFE_style = {}, children, } = props;
|
|
76
76
|
const { combined } = useButtonStyles(props);
|
|
77
77
|
const buttonType = submit ? "submit" : "button";
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
const buttonClassNames = classnames(combined, UNSAFE_className.container);
|
|
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 });
|
|
81
|
+
const buttonInternals = children || React__default.createElement(ButtonContent, Object.assign({}, props));
|
|
81
82
|
if (to) {
|
|
82
83
|
return (React__default.createElement(Link, Object.assign({}, tagProps, { to: to }), buttonInternals));
|
|
83
84
|
}
|
|
@@ -87,4 +88,4 @@ function ButtonWrapper(props) {
|
|
|
87
88
|
Button.Label = ButtonLabel;
|
|
88
89
|
Button.Icon = ButtonIcon;
|
|
89
90
|
|
|
90
|
-
export { Button as B,
|
|
91
|
+
export { Button as B, useButtonContext as a, useButtonStyles as u };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
interface ButtonDismissProps {
|
|
2
|
+
export interface ButtonDismissProps {
|
|
3
3
|
onClick?(event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>): void;
|
|
4
4
|
readonly ariaLabel: string;
|
|
5
5
|
}
|
|
6
6
|
export declare function ButtonDismiss({ onClick, ariaLabel }: ButtonDismissProps): JSX.Element;
|
|
7
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ButtonDismiss } from "./ButtonDismiss";
|
|
1
|
+
export { ButtonDismiss, type ButtonDismissProps } from "./ButtonDismiss";
|