@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.
Files changed (169) hide show
  1. package/AtlantisPortalContent.d.ts +1 -0
  2. package/AtlantisPortalContent.js +17 -0
  3. package/Cluster.d.ts +1 -0
  4. package/Cluster.js +17 -0
  5. package/Container.d.ts +1 -0
  6. package/Container.js +17 -0
  7. package/ContentBlock.d.ts +1 -0
  8. package/ContentBlock.js +17 -0
  9. package/Cover.d.ts +1 -0
  10. package/Cover.js +17 -0
  11. package/Frame.d.ts +1 -0
  12. package/Frame.js +17 -0
  13. package/ResponsiveSwitcher.d.ts +1 -0
  14. package/ResponsiveSwitcher.js +17 -0
  15. package/SideKick.d.ts +1 -0
  16. package/SideKick.js +17 -0
  17. package/Stack.d.ts +1 -0
  18. package/Stack.js +17 -0
  19. package/Tiles.d.ts +1 -0
  20. package/Tiles.js +17 -0
  21. package/dist/AtlantisPortalContent/AtlantisPortalContent.d.ts +2 -0
  22. package/dist/AtlantisPortalContent/AtlantisPortalContent.types.d.ts +4 -0
  23. package/dist/AtlantisPortalContent/index.cjs +19 -0
  24. package/dist/AtlantisPortalContent/index.d.ts +2 -0
  25. package/dist/AtlantisPortalContent/index.mjs +13 -0
  26. package/dist/AtlantisPortalContent-cjs.js +11 -0
  27. package/dist/AtlantisPortalContent-es.js +9 -0
  28. package/dist/Banner/Banner.d.ts +7 -4
  29. package/dist/Banner-cjs.js +2 -2
  30. package/dist/Banner-es.js +2 -2
  31. package/dist/Box-cjs.js +1 -1
  32. package/dist/Box-es.js +1 -1
  33. package/dist/Button/Button.types.d.ts +27 -0
  34. package/dist/Button/ButtonInternals.d.ts +2 -2
  35. package/dist/Button/ButtonProvider.d.ts +1 -1
  36. package/dist/Button/index.cjs +1 -1
  37. package/dist/Button/index.d.ts +1 -1
  38. package/dist/Button/index.mjs +1 -1
  39. package/dist/Button-cjs.js +14 -13
  40. package/dist/Button-es.js +14 -13
  41. package/dist/ButtonDismiss/ButtonDismiss.d.ts +1 -2
  42. package/dist/ButtonDismiss/index.d.ts +1 -1
  43. package/dist/Card/Card.d.ts +66 -7
  44. package/dist/Card/types.d.ts +10 -1
  45. package/dist/Card-cjs.js +59 -9
  46. package/dist/Card-es.js +59 -9
  47. package/dist/Chip-cjs.js +1 -1
  48. package/dist/Chip-es.js +1 -1
  49. package/dist/Cluster/Cluster.d.ts +2 -0
  50. package/dist/Cluster/index.cjs +16 -0
  51. package/dist/Cluster/index.d.ts +1 -0
  52. package/dist/Cluster/index.mjs +10 -0
  53. package/dist/Cluster/types.d.ts +21 -0
  54. package/dist/Cluster-cjs.js +50 -0
  55. package/dist/Cluster-es.js +48 -0
  56. package/dist/Container/Container.d.ts +5 -0
  57. package/dist/Container/index.cjs +9 -0
  58. package/dist/Container/index.d.ts +1 -0
  59. package/dist/Container/index.mjs +3 -0
  60. package/dist/Container/types.d.ts +11 -0
  61. package/dist/Container-cjs.js +17 -0
  62. package/dist/Container-es.js +15 -0
  63. package/dist/ContentBlock/ContentBlock.d.ts +2 -0
  64. package/dist/ContentBlock/index.cjs +15 -0
  65. package/dist/ContentBlock/index.d.ts +1 -0
  66. package/dist/ContentBlock/index.mjs +9 -0
  67. package/dist/ContentBlock/types.d.ts +21 -0
  68. package/dist/ContentBlock-cjs.js +40 -0
  69. package/dist/ContentBlock-es.js +38 -0
  70. package/dist/Cover/Cover.d.ts +8 -0
  71. package/dist/Cover/index.cjs +8 -0
  72. package/dist/Cover/index.d.ts +1 -0
  73. package/dist/Cover/index.mjs +2 -0
  74. package/dist/Cover/types.d.ts +7 -0
  75. package/dist/Cover-cjs.js +17 -0
  76. package/dist/Cover-es.js +15 -0
  77. package/dist/DataList/DataList.types.d.ts +8 -0
  78. package/dist/DataList-cjs.js +0 -3
  79. package/dist/DataList-es.js +0 -3
  80. package/dist/DataListSearch-cjs.js +4 -2
  81. package/dist/DataListSearch-es.js +4 -2
  82. package/dist/FormField/FormFieldTypes.d.ts +6 -0
  83. package/dist/FormField/hooks/useAtlantisFormField.d.ts +2 -2
  84. package/dist/FormField-cjs.js +12 -4
  85. package/dist/FormField-es.js +12 -4
  86. package/dist/Frame/Frame.d.ts +2 -0
  87. package/dist/Frame/index.cjs +8 -0
  88. package/dist/Frame/index.d.ts +2 -0
  89. package/dist/Frame/index.mjs +2 -0
  90. package/dist/Frame/types.d.ts +7 -0
  91. package/dist/Frame-cjs.js +14 -0
  92. package/dist/Frame-es.js +12 -0
  93. package/dist/Heading/Heading.d.ts +14 -2
  94. package/dist/Heading-cjs.js +2 -2
  95. package/dist/Heading-es.js +2 -2
  96. package/dist/InputDate/index.cjs +1 -1
  97. package/dist/InputDate/index.mjs +1 -1
  98. package/dist/InputEmail-cjs.js +1 -1
  99. package/dist/InputEmail-es.js +1 -1
  100. package/dist/InputNumber-cjs.js +1 -1
  101. package/dist/InputNumber-es.js +1 -1
  102. package/dist/InputPassword-cjs.js +1 -1
  103. package/dist/InputPassword-es.js +1 -1
  104. package/dist/InputPhoneNumber-cjs.js +2 -2
  105. package/dist/InputPhoneNumber-es.js +2 -2
  106. package/dist/InputText/index.cjs +1 -1
  107. package/dist/InputText/index.mjs +1 -1
  108. package/dist/InputTime-cjs.js +1 -1
  109. package/dist/InputTime-es.js +1 -1
  110. package/dist/Option-cjs.js +1 -1
  111. package/dist/Option-es.js +1 -1
  112. package/dist/Page/Page.d.ts +0 -1
  113. package/dist/Page-cjs.js +1 -1
  114. package/dist/Page-es.js +1 -1
  115. package/dist/Popover/Popover.d.ts +7 -45
  116. package/dist/Popover/Popover.types.d.ts +109 -0
  117. package/dist/Popover/PopoverContext.d.ts +11 -0
  118. package/dist/Popover/index.cjs +17 -4
  119. package/dist/Popover/index.d.ts +3 -0
  120. package/dist/Popover/index.mjs +16 -5
  121. package/dist/Popover/usePopover.d.ts +13 -0
  122. package/dist/Popover/usePopoverStyles.d.ts +5 -0
  123. package/dist/Popover-cjs.js +93 -38
  124. package/dist/Popover-es.js +93 -40
  125. package/dist/ResponsiveSwitcher/ResponsiveSwitcher.d.ts +2 -0
  126. package/dist/ResponsiveSwitcher/index.cjs +9 -0
  127. package/dist/ResponsiveSwitcher/index.d.ts +1 -0
  128. package/dist/ResponsiveSwitcher/index.mjs +3 -0
  129. package/dist/ResponsiveSwitcher/types.d.ts +10 -0
  130. package/dist/ResponsiveSwitcher-cjs.js +28 -0
  131. package/dist/ResponsiveSwitcher-es.js +26 -0
  132. package/dist/Select/Select.d.ts +1 -1
  133. package/dist/SideKick/SideKick.d.ts +2 -0
  134. package/dist/SideKick/index.cjs +10 -0
  135. package/dist/SideKick/index.d.ts +1 -0
  136. package/dist/SideKick/index.mjs +4 -0
  137. package/dist/SideKick/types.d.ts +14 -0
  138. package/dist/SideKick-cjs.js +34 -0
  139. package/dist/SideKick-es.js +32 -0
  140. package/dist/Stack/Stack.d.ts +2 -0
  141. package/dist/Stack/index.cjs +9 -0
  142. package/dist/Stack/index.d.ts +1 -0
  143. package/dist/Stack/index.mjs +3 -0
  144. package/dist/Stack/types.d.ts +12 -0
  145. package/dist/Stack-cjs.js +29 -0
  146. package/dist/Stack-es.js +27 -0
  147. package/dist/Text/Text.d.ts +14 -1
  148. package/dist/Text-cjs.js +2 -2
  149. package/dist/Text-es.js +2 -2
  150. package/dist/Tiles/Tiles.d.ts +2 -0
  151. package/dist/Tiles/index.cjs +8 -0
  152. package/dist/Tiles/index.d.ts +1 -0
  153. package/dist/Tiles/index.mjs +2 -0
  154. package/dist/Tiles/types.d.ts +8 -0
  155. package/dist/Tiles-cjs.js +26 -0
  156. package/dist/Tiles-es.js +24 -0
  157. package/dist/index.cjs +23 -1
  158. package/dist/index.d.mts +9 -0
  159. package/dist/index.d.ts +9 -0
  160. package/dist/index.mjs +13 -2
  161. package/dist/styles.css +423 -9
  162. package/dist/useDebounce-cjs.js +1 -1
  163. package/dist/useDebounce-es.js +1 -1
  164. package/dist/useScrollToActive-cjs.js +35 -14
  165. package/dist/useScrollToActive-es.js +35 -14
  166. package/dist/utils/meta/meta.json +17 -1
  167. package/dist/utils/useDebounce.d.ts +1 -1
  168. package/package.json +48 -4
  169. 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";
@@ -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,2 @@
1
+ import { AtlantisPortalContentProps } from "./AtlantisPortalContent.types";
2
+ export declare function AtlantisPortalContent({ children, }: AtlantisPortalContentProps): JSX.Element;
@@ -0,0 +1,4 @@
1
+ export interface AtlantisPortalContentProps {
2
+ /** The content that will be rendered inside a portal. */
3
+ readonly children: React.ReactNode;
4
+ }
@@ -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,2 @@
1
+ export { AtlantisPortalContent } from "./AtlantisPortalContent";
2
+ export type { AtlantisPortalContentProps } from "./AtlantisPortalContent.types";
@@ -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 };
@@ -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
- * The default cta variation should be a 'work' variation. If the banner
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
- * Adds an icon to the left of the banner content
21
+ * Use to override the default status Icon
19
22
  */
20
23
  readonly icon?: IconNames;
21
24
  onDismiss?(): void;
22
25
  /**
23
- * When provided, the banner's visibility is controlled by this value.
26
+ * When provided, Banner's visibility is controlled by this value
24
27
  * @default undefined
25
28
  */
26
29
  readonly controlledVisiblity?: boolean;
@@ -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 "starburst";
54
+ return "info";
55
55
  case "success":
56
56
  return "checkmark";
57
57
  case "warning":
58
- return "help";
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 "starburst";
52
+ return "info";
53
53
  case "success":
54
54
  return "checkmark";
55
55
  case "warning":
56
- return "help";
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 useButton(): ButtonContextProps;
9
+ export declare function useButtonContext(): ButtonContextProps;
10
10
  export {};
@@ -12,5 +12,5 @@ require('../Typography-cjs.js');
12
12
 
13
13
 
14
14
  exports.Button = Button.Button;
15
- exports.useButton = Button.useButton;
15
+ exports.useButtonContext = Button.useButtonContext;
16
16
  exports.useButtonStyles = Button.useButtonStyles;
@@ -1,4 +1,4 @@
1
1
  export { Button } from "./Button";
2
2
  export * from "./Button.types";
3
3
  export { useButtonStyles, UseButtonStylesProps } from "./useButtonStyles";
4
- export { useButton } from "./ButtonProvider";
4
+ export { useButtonContext } from "./ButtonProvider";
@@ -1,4 +1,4 @@
1
- export { B as Button, a as useButton, u as useButtonStyles } from '../Button-es.js';
1
+ export { B as Button, a as useButtonContext, u as useButtonStyles } from '../Button-es.js';
2
2
  import 'react';
3
3
  import 'react-router-dom';
4
4
  import 'classnames';
@@ -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 useButton() {
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 } = useButton();
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 } = useButton();
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 } = useButton();
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 tagProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ className: combined, disabled,
81
- id }, (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
- const buttonInternals = props.children || React.createElement(ButtonContent, Object.assign({}, props));
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.useButton = useButton;
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 useButton() {
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 } = useButton();
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 } = useButton();
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 } = useButton();
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 tagProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ className: combined, disabled,
79
- id }, (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
- const buttonInternals = props.children || React__default.createElement(ButtonContent, Object.assign({}, props));
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, useButton as a, useButtonStyles as u };
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";