@jobber/components 6.120.3 → 6.121.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.
@@ -18,6 +18,10 @@ require('@jobber/design');
18
18
  require('../Typography-cjs.js');
19
19
  require('../Text-cjs.js');
20
20
  require('../Heading-cjs.js');
21
+ require('../Tooltip-cjs.js');
22
+ require('../floating-ui.react-cjs.js');
23
+ require('../floating-ui.react-dom-cjs.js');
24
+ require('react/jsx-runtime');
21
25
  require('../AtlantisThemeContext-cjs.js');
22
26
  require('../identity-cjs.js');
23
27
  require('../isTypedArray-cjs.js');
@@ -35,9 +39,6 @@ require('../Content-cjs.js');
35
39
  require('../ProgressBar-cjs.js');
36
40
  require('../ConfirmationModal-cjs.js');
37
41
  require('../Modal/index.cjs');
38
- require('../floating-ui.react-cjs.js');
39
- require('../floating-ui.react-dom-cjs.js');
40
- require('react/jsx-runtime');
41
42
  require('../AtlantisPortalContent-cjs.js');
42
43
  require('../Markdown-cjs.js');
43
44
  require('../Emphasis-cjs.js');
@@ -16,6 +16,10 @@ import '@jobber/design';
16
16
  import '../Typography-es.js';
17
17
  import '../Text-es.js';
18
18
  import '../Heading-es.js';
19
+ import '../Tooltip-es.js';
20
+ import '../floating-ui.react-es.js';
21
+ import '../floating-ui.react-dom-es.js';
22
+ import 'react/jsx-runtime';
19
23
  import '../AtlantisThemeContext-es.js';
20
24
  import '../identity-es.js';
21
25
  import '../isTypedArray-es.js';
@@ -33,9 +37,6 @@ import '../Content-es.js';
33
37
  import '../ProgressBar-es.js';
34
38
  import '../ConfirmationModal-es.js';
35
39
  import '../Modal/index.mjs';
36
- import '../floating-ui.react-es.js';
37
- import '../floating-ui.react-dom-es.js';
38
- import 'react/jsx-runtime';
39
40
  import '../AtlantisPortalContent-es.js';
40
41
  import '../Markdown-es.js';
41
42
  import '../Emphasis-es.js';
@@ -17,10 +17,21 @@ declare function LightBoxOverlay({ className }: {
17
17
  readonly className?: string;
18
18
  }): React.JSX.Element;
19
19
  /**
20
- * Top bar showing the current image counter (`1/3`) and a close button.
21
- * Styled for dark backgrounds.
20
+ * Top bar showing an open-in-new-tab action, the current image counter (`1/3`),
21
+ * and a close button. Styled for dark backgrounds.
22
22
  */
23
23
  declare function LightBoxToolbar(): React.JSX.Element;
24
+ /**
25
+ * Opens the current image in a new browser tab. Included in the default
26
+ * `LightBox.Toolbar`. Returns `null` if the current image has no `url`.
27
+ */
28
+ declare function LightBoxOpenInNewTabAction({ ariaLabel, }: {
29
+ /**
30
+ * Accessible label for the action, also used as the tooltip message.
31
+ * @default "Open image in new tab"
32
+ */
33
+ readonly ariaLabel?: string;
34
+ }): React.JSX.Element | null;
24
35
  /**
25
36
  * The animated hero image with swipe-to-navigate and slide animation.
26
37
  *
@@ -112,6 +123,7 @@ declare namespace LightBox {
112
123
  var Background: typeof LightBoxBackground;
113
124
  var Overlay: typeof LightBoxOverlay;
114
125
  var Toolbar: typeof LightBoxToolbar;
126
+ var OpenInNewTabAction: typeof LightBoxOpenInNewTabAction;
115
127
  var Slides: typeof LightBoxSlides;
116
128
  var Navigation: typeof LightBoxNavigation;
117
129
  var Caption: typeof LightBoxCaption;
@@ -17,6 +17,10 @@ require('@jobber/design');
17
17
  require('../Typography-cjs.js');
18
18
  require('../Text-cjs.js');
19
19
  require('../Heading-cjs.js');
20
+ require('../Tooltip-cjs.js');
21
+ require('../floating-ui.react-cjs.js');
22
+ require('../floating-ui.react-dom-cjs.js');
23
+ require('react/jsx-runtime');
20
24
  require('../AtlantisThemeContext-cjs.js');
21
25
  require('../identity-cjs.js');
22
26
  require('../isTypedArray-cjs.js');
@@ -15,6 +15,10 @@ import '@jobber/design';
15
15
  import '../Typography-es.js';
16
16
  import '../Text-es.js';
17
17
  import '../Heading-es.js';
18
+ import '../Tooltip-es.js';
19
+ import '../floating-ui.react-es.js';
20
+ import '../floating-ui.react-dom-es.js';
21
+ import 'react/jsx-runtime';
18
22
  import '../AtlantisThemeContext-es.js';
19
23
  import '../identity-es.js';
20
24
  import '../isTypedArray-es.js';
@@ -10,9 +10,10 @@ var ButtonDismiss = require('./ButtonDismiss-cjs.js');
10
10
  var Text = require('./Text-cjs.js');
11
11
  var Button = require('./Button-cjs.js');
12
12
  var Heading = require('./Heading-cjs.js');
13
+ var Tooltip = require('./Tooltip-cjs.js');
13
14
  var AtlantisThemeContext = require('./AtlantisThemeContext-cjs.js');
14
15
 
15
- var styles = {"backgroundImage":"i9Tw1T65W-k-","next":"Q8amcRaTGf0-","prev":"W9FVb24yJrk-","buttonHidden":"nsN0TPWsBXI-","buttonVisible":"dkLYp7AD2jE-","lightboxWrapper":"_5p2iAj4JfoE-","toolbar":"rMK4cKdOxFw-","closeButton":"_0m6vb11DgiA-","slideNumber":"kCc68gGuTgg-","image":"yYFVVScosfQ-","imageArea":"UskuwLHR6fg-","captionWrapper":"OGjhge-r-U4-","title":"tZU2g-NYdIs-","blurOverlay":"GKIdLTmvcvQ-","thumbnailBar":"_3TfQLQEE3GQ-","thumbnailImage":"eBMzUOlcfQ4-","thumbnail":"eapm2zruLn8-","selected":"PeLn2u-QB0k-","spinning":"_8tDoqjgfLcw-"};
16
+ var styles = {"backgroundImage":"i9Tw1T65W-k-","next":"Q8amcRaTGf0-","prev":"W9FVb24yJrk-","buttonHidden":"nsN0TPWsBXI-","buttonVisible":"dkLYp7AD2jE-","lightboxWrapper":"_5p2iAj4JfoE-","toolbar":"rMK4cKdOxFw-","closeButton":"_0m6vb11DgiA-","slideNumber":"kCc68gGuTgg-","leftAction":"_3DY1o57MHxg-","image":"yYFVVScosfQ-","imageArea":"UskuwLHR6fg-","captionWrapper":"OGjhge-r-U4-","title":"tZU2g-NYdIs-","blurOverlay":"GKIdLTmvcvQ-","thumbnailBar":"_3TfQLQEE3GQ-","thumbnailImage":"eBMzUOlcfQ4-","thumbnail":"eapm2zruLn8-","selected":"PeLn2u-QB0k-","spinning":"_8tDoqjgfLcw-"};
16
17
 
17
18
  // A little bit more than the transition's duration
18
19
  // We're doing this to prevent a bug from framer-motion
@@ -212,18 +213,32 @@ function LightBoxOverlay({ className }) {
212
213
  return (React.createElement("div", { className: classnames(styles.blurOverlay, className), onClick: handleRequestClose }));
213
214
  }
214
215
  /**
215
- * Top bar showing the current image counter (`1/3`) and a close button.
216
- * Styled for dark backgrounds.
216
+ * Top bar showing an open-in-new-tab action, the current image counter (`1/3`),
217
+ * and a close button. Styled for dark backgrounds.
217
218
  */
218
219
  function LightBoxToolbar() {
219
220
  const { images, currentImageIndex, handleRequestClose } = useLightBoxContext();
220
221
  return (React.createElement(AtlantisThemeContext.AtlantisThemeContextProvider, { dangerouslyOverrideTheme: "dark" },
221
222
  React.createElement("div", { className: styles.toolbar },
223
+ React.createElement(LightBoxOpenInNewTabAction, null),
222
224
  React.createElement("div", { className: styles.slideNumber },
223
225
  React.createElement(Text.Text, null, `${currentImageIndex + 1}/${images.length}`)),
224
226
  React.createElement("div", { className: styles.closeButton },
225
227
  React.createElement(ButtonDismiss.ButtonDismiss, { ariaLabel: "Close", onClick: handleRequestClose })))));
226
228
  }
229
+ /**
230
+ * Opens the current image in a new browser tab. Included in the default
231
+ * `LightBox.Toolbar`. Returns `null` if the current image has no `url`.
232
+ */
233
+ function LightBoxOpenInNewTabAction({ ariaLabel = "Open image in new tab", }) {
234
+ const { images, currentImageIndex } = useLightBoxContext();
235
+ const currentImage = images[currentImageIndex];
236
+ if (!(currentImage === null || currentImage === void 0 ? void 0 : currentImage.url))
237
+ return null;
238
+ return (React.createElement("div", { className: styles.leftAction },
239
+ React.createElement(Tooltip.Tooltip, { message: ariaLabel },
240
+ React.createElement(Button.Button, { size: "small", variation: "subtle", type: "secondary", icon: "export", ariaLabel: ariaLabel, url: currentImage.url, external: true }))));
241
+ }
227
242
  /**
228
243
  * The animated hero image with swipe-to-navigate and slide animation.
229
244
  *
@@ -347,6 +362,7 @@ LightBox.Content = LightBoxContent;
347
362
  LightBox.Background = LightBoxBackground;
348
363
  LightBox.Overlay = LightBoxOverlay;
349
364
  LightBox.Toolbar = LightBoxToolbar;
365
+ LightBox.OpenInNewTabAction = LightBoxOpenInNewTabAction;
350
366
  LightBox.Slides = LightBoxSlides;
351
367
  LightBox.Navigation = LightBoxNavigation;
352
368
  LightBox.Caption = LightBoxCaption;
@@ -8,9 +8,10 @@ import { B as ButtonDismiss } from './ButtonDismiss-es.js';
8
8
  import { T as Text } from './Text-es.js';
9
9
  import { B as Button } from './Button-es.js';
10
10
  import { H as Heading } from './Heading-es.js';
11
+ import { T as Tooltip } from './Tooltip-es.js';
11
12
  import { A as AtlantisThemeContextProvider } from './AtlantisThemeContext-es.js';
12
13
 
13
- var styles = {"backgroundImage":"i9Tw1T65W-k-","next":"Q8amcRaTGf0-","prev":"W9FVb24yJrk-","buttonHidden":"nsN0TPWsBXI-","buttonVisible":"dkLYp7AD2jE-","lightboxWrapper":"_5p2iAj4JfoE-","toolbar":"rMK4cKdOxFw-","closeButton":"_0m6vb11DgiA-","slideNumber":"kCc68gGuTgg-","image":"yYFVVScosfQ-","imageArea":"UskuwLHR6fg-","captionWrapper":"OGjhge-r-U4-","title":"tZU2g-NYdIs-","blurOverlay":"GKIdLTmvcvQ-","thumbnailBar":"_3TfQLQEE3GQ-","thumbnailImage":"eBMzUOlcfQ4-","thumbnail":"eapm2zruLn8-","selected":"PeLn2u-QB0k-","spinning":"_8tDoqjgfLcw-"};
14
+ var styles = {"backgroundImage":"i9Tw1T65W-k-","next":"Q8amcRaTGf0-","prev":"W9FVb24yJrk-","buttonHidden":"nsN0TPWsBXI-","buttonVisible":"dkLYp7AD2jE-","lightboxWrapper":"_5p2iAj4JfoE-","toolbar":"rMK4cKdOxFw-","closeButton":"_0m6vb11DgiA-","slideNumber":"kCc68gGuTgg-","leftAction":"_3DY1o57MHxg-","image":"yYFVVScosfQ-","imageArea":"UskuwLHR6fg-","captionWrapper":"OGjhge-r-U4-","title":"tZU2g-NYdIs-","blurOverlay":"GKIdLTmvcvQ-","thumbnailBar":"_3TfQLQEE3GQ-","thumbnailImage":"eBMzUOlcfQ4-","thumbnail":"eapm2zruLn8-","selected":"PeLn2u-QB0k-","spinning":"_8tDoqjgfLcw-"};
14
15
 
15
16
  // A little bit more than the transition's duration
16
17
  // We're doing this to prevent a bug from framer-motion
@@ -210,18 +211,32 @@ function LightBoxOverlay({ className }) {
210
211
  return (React__default.createElement("div", { className: classnames(styles.blurOverlay, className), onClick: handleRequestClose }));
211
212
  }
212
213
  /**
213
- * Top bar showing the current image counter (`1/3`) and a close button.
214
- * Styled for dark backgrounds.
214
+ * Top bar showing an open-in-new-tab action, the current image counter (`1/3`),
215
+ * and a close button. Styled for dark backgrounds.
215
216
  */
216
217
  function LightBoxToolbar() {
217
218
  const { images, currentImageIndex, handleRequestClose } = useLightBoxContext();
218
219
  return (React__default.createElement(AtlantisThemeContextProvider, { dangerouslyOverrideTheme: "dark" },
219
220
  React__default.createElement("div", { className: styles.toolbar },
221
+ React__default.createElement(LightBoxOpenInNewTabAction, null),
220
222
  React__default.createElement("div", { className: styles.slideNumber },
221
223
  React__default.createElement(Text, null, `${currentImageIndex + 1}/${images.length}`)),
222
224
  React__default.createElement("div", { className: styles.closeButton },
223
225
  React__default.createElement(ButtonDismiss, { ariaLabel: "Close", onClick: handleRequestClose })))));
224
226
  }
227
+ /**
228
+ * Opens the current image in a new browser tab. Included in the default
229
+ * `LightBox.Toolbar`. Returns `null` if the current image has no `url`.
230
+ */
231
+ function LightBoxOpenInNewTabAction({ ariaLabel = "Open image in new tab", }) {
232
+ const { images, currentImageIndex } = useLightBoxContext();
233
+ const currentImage = images[currentImageIndex];
234
+ if (!(currentImage === null || currentImage === void 0 ? void 0 : currentImage.url))
235
+ return null;
236
+ return (React__default.createElement("div", { className: styles.leftAction },
237
+ React__default.createElement(Tooltip, { message: ariaLabel },
238
+ React__default.createElement(Button, { size: "small", variation: "subtle", type: "secondary", icon: "export", ariaLabel: ariaLabel, url: currentImage.url, external: true }))));
239
+ }
225
240
  /**
226
241
  * The animated hero image with swipe-to-navigate and slide animation.
227
242
  *
@@ -345,6 +360,7 @@ LightBox.Content = LightBoxContent;
345
360
  LightBox.Background = LightBoxBackground;
346
361
  LightBox.Overlay = LightBoxOverlay;
347
362
  LightBox.Toolbar = LightBoxToolbar;
363
+ LightBox.OpenInNewTabAction = LightBoxOpenInNewTabAction;
348
364
  LightBox.Slides = LightBoxSlides;
349
365
  LightBox.Navigation = LightBoxNavigation;
350
366
  LightBox.Caption = LightBoxCaption;
package/dist/styles.css CHANGED
@@ -8971,6 +8971,10 @@ html.atlantisLightBoxActive {
8971
8971
  grid-column: 2;
8972
8972
  justify-self: center;
8973
8973
  }
8974
+ ._3DY1o57MHxg- {
8975
+ grid-column: 1;
8976
+ justify-self: start;
8977
+ }
8974
8978
  .yYFVVScosfQ- {
8975
8979
  position: absolute;
8976
8980
  width: 100%;
@@ -139,6 +139,7 @@
139
139
  "LightBox.Caption",
140
140
  "LightBox.Content",
141
141
  "LightBox.Navigation",
142
+ "LightBox.OpenInNewTabAction",
142
143
  "LightBox.Overlay",
143
144
  "LightBox.Provider",
144
145
  "LightBox.Slides",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "6.120.3",
3
+ "version": "6.121.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -385,6 +385,16 @@
385
385
  "import": "./dist/Select/index.mjs",
386
386
  "require": "./dist/Select/index.cjs"
387
387
  },
388
+ "./SideDrawer": {
389
+ "types": "./dist/SideDrawer/index.d.ts",
390
+ "import": "./dist/SideDrawer/index.mjs",
391
+ "require": "./dist/SideDrawer/index.cjs"
392
+ },
393
+ "./SegmentedControl": {
394
+ "types": "./dist/SegmentedControl/index.d.ts",
395
+ "import": "./dist/SegmentedControl/index.mjs",
396
+ "require": "./dist/SegmentedControl/index.cjs"
397
+ },
388
398
  "./SideKick": {
389
399
  "types": "./dist/SideKick/index.d.ts",
390
400
  "import": "./dist/SideKick/index.mjs",
@@ -552,5 +562,5 @@
552
562
  "> 1%",
553
563
  "IE 10"
554
564
  ],
555
- "gitHead": "4b2d7ea4c8a4478d533c4213b14193d3ab106fc0"
565
+ "gitHead": "9305629cc1a6d8f32d9e4ef9e0d08df12fb92e89"
556
566
  }
package/rollup.config.mjs CHANGED
@@ -53,7 +53,7 @@ export default {
53
53
  plugins: [
54
54
  nodePolyfills(),
55
55
  nodeResolve(),
56
- multiInput.default(),
56
+ multiInput.default({ glob: { ignore: ["src/**/docs/index.ts"] } }),
57
57
  typescript({
58
58
  tsconfig: "./tsconfig.rollup.json",
59
59
  declarationDir: "dist",