@atlaskit/smart-card 46.0.2 → 46.1.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.
Files changed (30) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/__tests__/informational-vr-tests/__snapshots__/pre-auth-value-proposition-modal/with-image--light-mode.png +2 -2
  3. package/dist/cjs/__tests__/informational-vr-tests/__snapshots__/pre-auth-value-proposition-modal/with-image-default-name--light-mode.png +3 -0
  4. package/dist/cjs/utils/analytics/analytics.js +1 -1
  5. package/dist/cjs/view/LinkUrl/index.js +1 -1
  6. package/dist/cjs/view/PreAuthValuePropositionModal/IllustrationPane.compiled.css +8 -9
  7. package/dist/cjs/view/PreAuthValuePropositionModal/IllustrationPane.js +11 -9
  8. package/dist/cjs/view/PreAuthValuePropositionModal/assets/graphics-with-grid-no-provider-icons-2x.png +0 -0
  9. package/dist/cjs/view/PreAuthValuePropositionModal/index.compiled.css +2 -0
  10. package/dist/cjs/view/PreAuthValuePropositionModal/index.js +24 -4
  11. package/dist/es2019/__tests__/informational-vr-tests/__snapshots__/pre-auth-value-proposition-modal/with-image--light-mode.png +2 -2
  12. package/dist/es2019/__tests__/informational-vr-tests/__snapshots__/pre-auth-value-proposition-modal/with-image-default-name--light-mode.png +3 -0
  13. package/dist/es2019/utils/analytics/analytics.js +1 -1
  14. package/dist/es2019/view/LinkUrl/index.js +1 -1
  15. package/dist/es2019/view/PreAuthValuePropositionModal/IllustrationPane.compiled.css +8 -9
  16. package/dist/es2019/view/PreAuthValuePropositionModal/IllustrationPane.js +11 -9
  17. package/dist/es2019/view/PreAuthValuePropositionModal/assets/graphics-with-grid-no-provider-icons-2x.png +0 -0
  18. package/dist/es2019/view/PreAuthValuePropositionModal/index.compiled.css +2 -0
  19. package/dist/es2019/view/PreAuthValuePropositionModal/index.js +22 -4
  20. package/dist/esm/__tests__/informational-vr-tests/__snapshots__/pre-auth-value-proposition-modal/with-image--light-mode.png +2 -2
  21. package/dist/esm/__tests__/informational-vr-tests/__snapshots__/pre-auth-value-proposition-modal/with-image-default-name--light-mode.png +3 -0
  22. package/dist/esm/utils/analytics/analytics.js +1 -1
  23. package/dist/esm/view/LinkUrl/index.js +1 -1
  24. package/dist/esm/view/PreAuthValuePropositionModal/IllustrationPane.compiled.css +8 -9
  25. package/dist/esm/view/PreAuthValuePropositionModal/IllustrationPane.js +11 -9
  26. package/dist/esm/view/PreAuthValuePropositionModal/assets/graphics-with-grid-no-provider-icons-2x.png +0 -0
  27. package/dist/esm/view/PreAuthValuePropositionModal/index.compiled.css +2 -0
  28. package/dist/esm/view/PreAuthValuePropositionModal/index.js +24 -4
  29. package/dist/types/view/PreAuthValuePropositionModal/index.d.ts +3 -1
  30. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 46.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`067939baaaeb9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/067939baaaeb9) -
8
+ Fix the pre-auth value proposition modal in the `platform_sl_3p_preauth_value_modal` experiment
9
+ treatments behind `platform_sl_3p_preauth_value_modal_killswitch`:
10
+ - Allow titles to wrap in both treatment variants. Preserve the image variant's default height
11
+ while allowing taller text to reveal more of the centered illustration, keeping provider icons
12
+ aligned.
13
+ - Truncate long provider names in the Connect button so the Close button remains fully visible.
14
+ - Prevent editor floating toolbars from appearing above the modal using the existing `overlayOpen`
15
+ user intent, without layout effects that warn during server rendering.
16
+
17
+ In `@atlaskit/smart-card/pre-auth-value-proposition-modal`, `PreAuthValuePropositionModalProps`
18
+ adds optional `onOpenChange` to notify hosts when the modal opens, closes, or unmounts.
19
+ `@atlaskit/editor-plugin-card` adds an optional `UserIntentPlugin` integration and declares its
20
+ package dependency.
21
+
22
+ ## 46.0.3
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies
27
+
3
28
  ## 46.0.2
4
29
 
5
30
  ### Patch Changes
@@ -1,3 +1,3 @@
1
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ded63043b0e672f2cd8a3f3c005736b62312f9afce2973d8876e281f39e70e7b
3
- size 62949
2
+ oid sha256:83ce22822b9a52b5e3df12c749a8dab5751bdd68cb58d05d0110daa93a3a6f80
3
+ size 76948
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:382dad1d27b59639007ba4c8ddd8e2c8fa5dc7b8e7c173cd0a6e1009d9d56297
3
+ size 63551
@@ -25,7 +25,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
25
25
  var context = exports.context = {
26
26
  componentName: 'smart-cards',
27
27
  packageName: "@atlaskit/smart-card" || '',
28
- packageVersion: "46.0.1" || ''
28
+ packageVersion: "46.0.3" || ''
29
29
  };
30
30
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
31
31
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -19,7 +19,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
19
19
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
20
20
  var PACKAGE_DATA = {
21
21
  packageName: "@atlaskit/smart-card",
22
- packageVersion: "46.0.1",
22
+ packageVersion: "46.0.3",
23
23
  componentName: 'linkUrl'
24
24
  };
25
25
  var LinkUrl = function LinkUrl(_ref) {
@@ -1,14 +1,13 @@
1
- ._154i18e8{top:53px}
2
- ._154i1rp4{top:215px}
3
- ._154intd2{top:184px}
4
- ._154invl5{top:355px}
1
+ ._154i12aa{top:290px}
2
+ ._154i1qr7{top:8pc}
3
+ ._154i1ssb{top:50%}
4
+ ._154i96e4{top:259px}
5
+ ._154iudc3{top:430px}
5
6
  ._18m915vq{overflow-y:hidden}
6
- ._1bah1h6o{justify-content:center}
7
7
  ._1bsb1kdj{width:25pc}
8
8
  ._1bsb1ylp{width:40px}
9
9
  ._1bsbl52n{width:17px}
10
10
  ._1bsbo7ao{width:15px}
11
- ._1e0c1txw{display:flex}
12
11
  ._1e0c1ule{display:block}
13
12
  ._1ein1kw7{border-end-end-radius:inherit}
14
13
  ._1ltv1uvc{left:107px}
@@ -17,14 +16,14 @@
17
16
  ._1ltvvbgk{left:4pc}
18
17
  ._1o9zidpf{flex-shrink:0}
19
18
  ._1reo15vq{overflow-x:hidden}
20
- ._4cvr1h6o{align-items:center}
21
- ._4t3i1osq{height:100%}
19
+ ._1tkekbql{min-height:450px}
20
+ ._4t3i1ogm{height:600px}
22
21
  ._4t3i1ylp{height:40px}
23
- ._4t3ikbql{height:450px}
24
22
  ._4t3il52n{height:17px}
25
23
  ._4t3io7ao{height:15px}
26
24
  ._5fbc1kw7{border-start-end-radius:inherit}
27
25
  ._kqswh2mm{position:relative}
28
26
  ._kqswstnw{position:absolute}
29
27
  ._t9ec1b7d{transform:rotate(-3.18deg)}
28
+ ._t9ec1i34{transform:translateY(-50%)}
30
29
  ._t9ec751h{transform:rotate(3.37deg)}
@@ -14,29 +14,31 @@ var _graphicsWithGridNoProviderIcons2x = _interopRequireDefault(require("./asset
14
14
  // Asset imports require an explicit extension for TypeScript and ESLint resolution.
15
15
  // oxlint-disable-next-line import/extensions
16
16
  var styles = {
17
- illustration: "_1e0c1ule _4t3ikbql _1bsb1kdj",
18
- illustrationLayer: "_1reo15vq _18m915vq _1ein1kw7 _5fbc1kw7 _4t3ikbql _kqswh2mm _1bsb1kdj",
19
- rightPane: "_1reo15vq _18m915vq _4cvr1h6o _1ein1kw7 _5fbc1kw7 _1e0c1txw _1o9zidpf _4t3i1osq _1bah1h6o _1bsb1kdj"
17
+ illustration: "_1e0c1ule _4t3i1ogm _1bsb1kdj",
18
+ illustrationGroup: "_4t3i1ogm _kqswstnw _154i1ssb _t9ec1i34 _1bsb1kdj",
19
+ rightPane: "_1reo15vq _18m915vq _1ein1kw7 _5fbc1kw7 _1o9zidpf _1tkekbql _kqswh2mm _1bsb1kdj"
20
20
  };
21
21
 
22
22
  // Pixel offsets and rotations are from the Figma illustration, not space tokens.
23
+ // Offsets are relative to the illustration's own top-left corner (illustrationGroup), not to
24
+ // `rightPane`, so they stay correct however much of `rightPane`'s height is visible.
23
25
  var illustrationIconStyles = {
24
- footer: "_4t3io7ao _1ltv1uvc _kqswstnw _154invl5 _t9ec1b7d _1bsbo7ao",
25
- searchFirst: "_4t3il52n _1ltv5rga _kqswstnw _154intd2 _t9ec751h _1bsbl52n",
26
- searchSecond: "_4t3il52n _1ltvs0l4 _kqswstnw _154i1rp4 _t9ec751h _1bsbl52n",
27
- top: "_1reo15vq _18m915vq _4t3i1ylp _1ltvvbgk _kqswstnw _154i18e8 _1bsb1ylp"
26
+ footer: "_4t3io7ao _1ltv1uvc _kqswstnw _154iudc3 _t9ec1b7d _1bsbo7ao",
27
+ searchFirst: "_4t3il52n _1ltv5rga _kqswstnw _154i96e4 _t9ec751h _1bsbl52n",
28
+ searchSecond: "_4t3il52n _1ltvs0l4 _kqswstnw _154i12aa _t9ec751h _1bsbl52n",
29
+ top: "_1reo15vq _18m915vq _4t3i1ylp _1ltvvbgk _kqswstnw _154i1qr7 _1bsb1ylp"
28
30
  };
29
31
  var IllustrationPane = function IllustrationPane(_ref) {
30
32
  var renderProviderIcon = _ref.renderProviderIcon;
31
33
  return /*#__PURE__*/_react.default.createElement(_box.Box, {
32
34
  xcss: styles.rightPane
33
35
  }, /*#__PURE__*/_react.default.createElement(_box.Box, {
34
- xcss: styles.illustrationLayer
36
+ xcss: styles.illustrationGroup
35
37
  }, /*#__PURE__*/_react.default.createElement("img", {
36
38
  alt: "",
37
39
  "aria-hidden": "true",
38
40
  "data-testid": "pre-auth-value-proposition-modal-illustration",
39
- height: 450,
41
+ height: 600,
40
42
  src: _graphicsWithGridNoProviderIcons2x.default,
41
43
  srcSet: "".concat(_graphicsWithGridNoProviderIcons2x.default, " 2x"),
42
44
  width: 400,
@@ -7,7 +7,9 @@
7
7
  ._1bsbnklw{width:20pc}
8
8
  ._1e0c1txw{display:flex}
9
9
  ._1o9zidpf{flex-shrink:0}
10
+ ._1o9zkb7n{flex-shrink:1}
10
11
  ._1reo15vq{overflow-x:hidden}
12
+ ._1ul9idpf{min-width:0}
11
13
  ._2lx21bp4{flex-direction:column}
12
14
  ._4cvr1fhb{align-items:stretch}
13
15
  ._4cvr1h6o{align-items:center}
@@ -77,8 +77,10 @@ var styles = {
77
77
  bodyCopy: "_1bsbnklw",
78
78
  content: "_zulp1ejb _1e0c1txw _2lx21bp4 _4t3i1osq _n3td1jfw _19bv1jfw _u5f31jfw _ca0q1jfw",
79
79
  copyColumn: "_zulppxbi _1e0c1txw _2lx21bp4 _16jlkb7n",
80
- leftPane: "_1e0c1txw _2lx21bp4 _1o9zidpf _4t3i1osq _1bsb1kdj",
80
+ leftPane: "_1e0c1txw _2lx21bp4 _1o9zidpf _1bsb1kdj",
81
81
  providerIcon: "_4cvr1h6o _1e0c1txw _1o9zidpf",
82
+ primaryButton: "_1o9zkb7n _1ul9idpf",
83
+ secondaryButton: "_1o9zidpf",
82
84
  splitLayout: "_2rko1kw7 _1reo15vq _18m915vq _4cvr1fhb _1e0c1txw _4t3i1osq"
83
85
  };
84
86
  var bold = function bold(chunks) {
@@ -112,7 +114,7 @@ var ModalCopy = function ModalCopy(_ref) {
112
114
  }, providerIcon && /*#__PURE__*/_react.default.createElement(_box.Box, {
113
115
  xcss: styles.providerIcon
114
116
  }, providerIcon), /*#__PURE__*/_react.default.createElement(_modalTitle.default, {
115
- isMultiline: false
117
+ isMultiline: true
116
118
  }, /*#__PURE__*/_react.default.createElement(_heading.default, {
117
119
  as: "span",
118
120
  color: "color.text",
@@ -161,23 +163,29 @@ var ModalCopy = function ModalCopy(_ref) {
161
163
  }))), /*#__PURE__*/_react.default.createElement(_flex.Flex, {
162
164
  gap: "space.075",
163
165
  justifyContent: "start"
166
+ }, /*#__PURE__*/_react.default.createElement(_box.Box, {
167
+ xcss: styles.primaryButton
164
168
  }, /*#__PURE__*/_react.default.createElement(_button.default, {
165
169
  appearance: "primary",
166
170
  onClick: onConnect,
167
171
  autoFocus: true,
172
+ shouldFitContainer: true,
168
173
  spacing: "default"
169
174
  }, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, (0, _extends2.default)({}, messages.connect, {
170
175
  values: {
171
176
  providerName: providerName
172
177
  }
173
- }))), /*#__PURE__*/_react.default.createElement(_button.default, {
178
+ })))), /*#__PURE__*/_react.default.createElement(_box.Box, {
179
+ xcss: styles.secondaryButton
180
+ }, /*#__PURE__*/_react.default.createElement(_button.default, {
174
181
  appearance: "subtle",
175
182
  onClick: onClose
176
- }, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, messages.close)))));
183
+ }, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, messages.close))))));
177
184
  };
178
185
  var PreAuthValuePropositionModalContent = function PreAuthValuePropositionModalContent(_ref2) {
179
186
  var _provider$iconLabel;
180
187
  var onFinished = _ref2.onFinished,
188
+ onOpenChange = _ref2.onOpenChange,
181
189
  url = _ref2.url;
182
190
  var _useSmartLink = (0, _useSmartLink2.useSmartLink)(SMART_LINK_MODAL_ID, url, 'inline'),
183
191
  actions = _useSmartLink.actions,
@@ -198,6 +206,16 @@ var PreAuthValuePropositionModalContent = function PreAuthValuePropositionModalC
198
206
  return (0, _extractSmartLinkProvider.extractSmartLinkProvider)(state.details);
199
207
  }, [state.details]);
200
208
  var providerName = provider === null || provider === void 0 ? void 0 : provider.text;
209
+ var isVisible = isOpen && Boolean(providerName);
210
+ (0, _react.useEffect)(function () {
211
+ if (!isVisible) {
212
+ return;
213
+ }
214
+ onOpenChange === null || onOpenChange === void 0 || onOpenChange(true);
215
+ return function () {
216
+ return onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false);
217
+ };
218
+ }, [isVisible, onOpenChange]);
201
219
  var providerIconUrl = typeof (provider === null || provider === void 0 ? void 0 : provider.icon) === 'string' ? provider.icon : undefined;
202
220
  var renderProviderIcon = function renderProviderIcon(size, testId, label) {
203
221
  if (providerIconUrl) {
@@ -291,6 +309,7 @@ var PreAuthValuePropositionModalContent = function PreAuthValuePropositionModalC
291
309
  };
292
310
  var PreAuthValuePropositionModal = exports.PreAuthValuePropositionModal = function PreAuthValuePropositionModal(_ref3) {
293
311
  var onFinished = _ref3.onFinished,
312
+ onOpenChange = _ref3.onOpenChange,
294
313
  url = _ref3.url;
295
314
  return /*#__PURE__*/_react.default.createElement(_SmartLinkAnalyticsContext.SmartLinkAnalyticsContext, {
296
315
  display: "inline",
@@ -299,6 +318,7 @@ var PreAuthValuePropositionModal = exports.PreAuthValuePropositionModal = functi
299
318
  url: url
300
319
  }, /*#__PURE__*/_react.default.createElement(PreAuthValuePropositionModalContent, {
301
320
  onFinished: onFinished,
321
+ onOpenChange: onOpenChange,
302
322
  url: url
303
323
  }));
304
324
  };
@@ -1,3 +1,3 @@
1
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ded63043b0e672f2cd8a3f3c005736b62312f9afce2973d8876e281f39e70e7b
3
- size 62949
2
+ oid sha256:83ce22822b9a52b5e3df12c749a8dab5751bdd68cb58d05d0110daa93a3a6f80
3
+ size 76948
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:382dad1d27b59639007ba4c8ddd8e2c8fa5dc7b8e7c173cd0a6e1009d9d56297
3
+ size 63551
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
4
4
  export const context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card" || '',
7
- packageVersion: "46.0.1" || ''
7
+ packageVersion: "46.0.3" || ''
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
9
9
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
10
10
  const PACKAGE_DATA = {
11
11
  packageName: "@atlaskit/smart-card",
12
- packageVersion: "46.0.1",
12
+ packageVersion: "46.0.3",
13
13
  componentName: 'linkUrl'
14
14
  };
15
15
  const LinkUrl = ({
@@ -1,14 +1,13 @@
1
- ._154i18e8{top:53px}
2
- ._154i1rp4{top:215px}
3
- ._154intd2{top:184px}
4
- ._154invl5{top:355px}
1
+ ._154i12aa{top:290px}
2
+ ._154i1qr7{top:8pc}
3
+ ._154i1ssb{top:50%}
4
+ ._154i96e4{top:259px}
5
+ ._154iudc3{top:430px}
5
6
  ._18m915vq{overflow-y:hidden}
6
- ._1bah1h6o{justify-content:center}
7
7
  ._1bsb1kdj{width:25pc}
8
8
  ._1bsb1ylp{width:40px}
9
9
  ._1bsbl52n{width:17px}
10
10
  ._1bsbo7ao{width:15px}
11
- ._1e0c1txw{display:flex}
12
11
  ._1e0c1ule{display:block}
13
12
  ._1ein1kw7{border-end-end-radius:inherit}
14
13
  ._1ltv1uvc{left:107px}
@@ -17,14 +16,14 @@
17
16
  ._1ltvvbgk{left:4pc}
18
17
  ._1o9zidpf{flex-shrink:0}
19
18
  ._1reo15vq{overflow-x:hidden}
20
- ._4cvr1h6o{align-items:center}
21
- ._4t3i1osq{height:100%}
19
+ ._1tkekbql{min-height:450px}
20
+ ._4t3i1ogm{height:600px}
22
21
  ._4t3i1ylp{height:40px}
23
- ._4t3ikbql{height:450px}
24
22
  ._4t3il52n{height:17px}
25
23
  ._4t3io7ao{height:15px}
26
24
  ._5fbc1kw7{border-start-end-radius:inherit}
27
25
  ._kqswh2mm{position:relative}
28
26
  ._kqswstnw{position:absolute}
29
27
  ._t9ec1b7d{transform:rotate(-3.18deg)}
28
+ ._t9ec1i34{transform:translateY(-50%)}
30
29
  ._t9ec751h{transform:rotate(3.37deg)}
@@ -8,29 +8,31 @@ import { Box } from '@atlaskit/primitives/compiled/box';
8
8
  // oxlint-disable-next-line import/extensions
9
9
  import illustrationWithoutProviderIcons from './assets/graphics-with-grid-no-provider-icons-2x.png';
10
10
  const styles = {
11
- illustration: "_1e0c1ule _4t3ikbql _1bsb1kdj",
12
- illustrationLayer: "_1reo15vq _18m915vq _1ein1kw7 _5fbc1kw7 _4t3ikbql _kqswh2mm _1bsb1kdj",
13
- rightPane: "_1reo15vq _18m915vq _4cvr1h6o _1ein1kw7 _5fbc1kw7 _1e0c1txw _1o9zidpf _4t3i1osq _1bah1h6o _1bsb1kdj"
11
+ illustration: "_1e0c1ule _4t3i1ogm _1bsb1kdj",
12
+ illustrationGroup: "_4t3i1ogm _kqswstnw _154i1ssb _t9ec1i34 _1bsb1kdj",
13
+ rightPane: "_1reo15vq _18m915vq _1ein1kw7 _5fbc1kw7 _1o9zidpf _1tkekbql _kqswh2mm _1bsb1kdj"
14
14
  };
15
15
 
16
16
  // Pixel offsets and rotations are from the Figma illustration, not space tokens.
17
+ // Offsets are relative to the illustration's own top-left corner (illustrationGroup), not to
18
+ // `rightPane`, so they stay correct however much of `rightPane`'s height is visible.
17
19
  const illustrationIconStyles = {
18
- footer: "_4t3io7ao _1ltv1uvc _kqswstnw _154invl5 _t9ec1b7d _1bsbo7ao",
19
- searchFirst: "_4t3il52n _1ltv5rga _kqswstnw _154intd2 _t9ec751h _1bsbl52n",
20
- searchSecond: "_4t3il52n _1ltvs0l4 _kqswstnw _154i1rp4 _t9ec751h _1bsbl52n",
21
- top: "_1reo15vq _18m915vq _4t3i1ylp _1ltvvbgk _kqswstnw _154i18e8 _1bsb1ylp"
20
+ footer: "_4t3io7ao _1ltv1uvc _kqswstnw _154iudc3 _t9ec1b7d _1bsbo7ao",
21
+ searchFirst: "_4t3il52n _1ltv5rga _kqswstnw _154i96e4 _t9ec751h _1bsbl52n",
22
+ searchSecond: "_4t3il52n _1ltvs0l4 _kqswstnw _154i12aa _t9ec751h _1bsbl52n",
23
+ top: "_1reo15vq _18m915vq _4t3i1ylp _1ltvvbgk _kqswstnw _154i1qr7 _1bsb1ylp"
22
24
  };
23
25
  const IllustrationPane = ({
24
26
  renderProviderIcon
25
27
  }) => /*#__PURE__*/React.createElement(Box, {
26
28
  xcss: styles.rightPane
27
29
  }, /*#__PURE__*/React.createElement(Box, {
28
- xcss: styles.illustrationLayer
30
+ xcss: styles.illustrationGroup
29
31
  }, /*#__PURE__*/React.createElement("img", {
30
32
  alt: "",
31
33
  "aria-hidden": "true",
32
34
  "data-testid": "pre-auth-value-proposition-modal-illustration",
33
- height: 450,
35
+ height: 600,
34
36
  src: illustrationWithoutProviderIcons,
35
37
  srcSet: `${illustrationWithoutProviderIcons} 2x`,
36
38
  width: 400,
@@ -7,7 +7,9 @@
7
7
  ._1bsbnklw{width:20pc}
8
8
  ._1e0c1txw{display:flex}
9
9
  ._1o9zidpf{flex-shrink:0}
10
+ ._1o9zkb7n{flex-shrink:1}
10
11
  ._1reo15vq{overflow-x:hidden}
12
+ ._1ul9idpf{min-width:0}
11
13
  ._2lx21bp4{flex-direction:column}
12
14
  ._4cvr1fhb{align-items:stretch}
13
15
  ._4cvr1h6o{align-items:center}
@@ -63,8 +63,10 @@ const styles = {
63
63
  bodyCopy: "_1bsbnklw",
64
64
  content: "_zulp1ejb _1e0c1txw _2lx21bp4 _4t3i1osq _n3td1jfw _19bv1jfw _u5f31jfw _ca0q1jfw",
65
65
  copyColumn: "_zulppxbi _1e0c1txw _2lx21bp4 _16jlkb7n",
66
- leftPane: "_1e0c1txw _2lx21bp4 _1o9zidpf _4t3i1osq _1bsb1kdj",
66
+ leftPane: "_1e0c1txw _2lx21bp4 _1o9zidpf _1bsb1kdj",
67
67
  providerIcon: "_4cvr1h6o _1e0c1txw _1o9zidpf",
68
+ primaryButton: "_1o9zkb7n _1ul9idpf",
69
+ secondaryButton: "_1o9zidpf",
68
70
  splitLayout: "_2rko1kw7 _1reo15vq _18m915vq _4cvr1fhb _1e0c1txw _4t3i1osq"
69
71
  };
70
72
  const bold = chunks => /*#__PURE__*/React.createElement(Text, {
@@ -95,7 +97,7 @@ const ModalCopy = ({
95
97
  }, providerIcon && /*#__PURE__*/React.createElement(Box, {
96
98
  xcss: styles.providerIcon
97
99
  }, providerIcon), /*#__PURE__*/React.createElement(ModalTitle, {
98
- isMultiline: false
100
+ isMultiline: true
99
101
  }, /*#__PURE__*/React.createElement(Heading, {
100
102
  as: "span",
101
103
  color: "color.text",
@@ -144,22 +146,28 @@ const ModalCopy = ({
144
146
  }))), /*#__PURE__*/React.createElement(Flex, {
145
147
  gap: "space.075",
146
148
  justifyContent: "start"
149
+ }, /*#__PURE__*/React.createElement(Box, {
150
+ xcss: styles.primaryButton
147
151
  }, /*#__PURE__*/React.createElement(Button, {
148
152
  appearance: "primary",
149
153
  onClick: onConnect,
150
154
  autoFocus: true,
155
+ shouldFitContainer: true,
151
156
  spacing: "default"
152
157
  }, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect, {
153
158
  values: {
154
159
  providerName
155
160
  }
156
- }))), /*#__PURE__*/React.createElement(Button, {
161
+ })))), /*#__PURE__*/React.createElement(Box, {
162
+ xcss: styles.secondaryButton
163
+ }, /*#__PURE__*/React.createElement(Button, {
157
164
  appearance: "subtle",
158
165
  onClick: onClose
159
- }, /*#__PURE__*/React.createElement(FormattedMessage, messages.close)))));
166
+ }, /*#__PURE__*/React.createElement(FormattedMessage, messages.close))))));
160
167
  };
161
168
  const PreAuthValuePropositionModalContent = ({
162
169
  onFinished,
170
+ onOpenChange,
163
171
  url
164
172
  }) => {
165
173
  var _provider$iconLabel;
@@ -176,6 +184,14 @@ const PreAuthValuePropositionModalContent = ({
176
184
  const modalOpenTimeRef = useRef(Date.now());
177
185
  const provider = useMemo(() => extractSmartLinkProvider(state.details), [state.details]);
178
186
  const providerName = provider === null || provider === void 0 ? void 0 : provider.text;
187
+ const isVisible = isOpen && Boolean(providerName);
188
+ useEffect(() => {
189
+ if (!isVisible) {
190
+ return;
191
+ }
192
+ onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(true);
193
+ return () => onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false);
194
+ }, [isVisible, onOpenChange]);
179
195
  const providerIconUrl = typeof (provider === null || provider === void 0 ? void 0 : provider.icon) === 'string' ? provider.icon : undefined;
180
196
  const renderProviderIcon = (size, testId, label) => {
181
197
  if (providerIconUrl) {
@@ -270,6 +286,7 @@ const PreAuthValuePropositionModalContent = ({
270
286
  };
271
287
  export const PreAuthValuePropositionModal = ({
272
288
  onFinished,
289
+ onOpenChange,
273
290
  url
274
291
  }) => /*#__PURE__*/React.createElement(SmartLinkAnalyticsContext, {
275
292
  display: "inline",
@@ -278,5 +295,6 @@ export const PreAuthValuePropositionModal = ({
278
295
  url: url
279
296
  }, /*#__PURE__*/React.createElement(PreAuthValuePropositionModalContent, {
280
297
  onFinished: onFinished,
298
+ onOpenChange: onOpenChange,
281
299
  url: url
282
300
  }));
@@ -1,3 +1,3 @@
1
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ded63043b0e672f2cd8a3f3c005736b62312f9afce2973d8876e281f39e70e7b
3
- size 62949
2
+ oid sha256:83ce22822b9a52b5e3df12c749a8dab5751bdd68cb58d05d0110daa93a3a6f80
3
+ size 76948
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:382dad1d27b59639007ba4c8ddd8e2c8fa5dc7b8e7c173cd0a6e1009d9d56297
3
+ size 63551
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
4
4
  export var context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card" || '',
7
- packageVersion: "46.0.1" || ''
7
+ packageVersion: "46.0.3" || ''
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
12
12
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
13
13
  var PACKAGE_DATA = {
14
14
  packageName: "@atlaskit/smart-card",
15
- packageVersion: "46.0.1",
15
+ packageVersion: "46.0.3",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  var LinkUrl = function LinkUrl(_ref) {
@@ -1,14 +1,13 @@
1
- ._154i18e8{top:53px}
2
- ._154i1rp4{top:215px}
3
- ._154intd2{top:184px}
4
- ._154invl5{top:355px}
1
+ ._154i12aa{top:290px}
2
+ ._154i1qr7{top:8pc}
3
+ ._154i1ssb{top:50%}
4
+ ._154i96e4{top:259px}
5
+ ._154iudc3{top:430px}
5
6
  ._18m915vq{overflow-y:hidden}
6
- ._1bah1h6o{justify-content:center}
7
7
  ._1bsb1kdj{width:25pc}
8
8
  ._1bsb1ylp{width:40px}
9
9
  ._1bsbl52n{width:17px}
10
10
  ._1bsbo7ao{width:15px}
11
- ._1e0c1txw{display:flex}
12
11
  ._1e0c1ule{display:block}
13
12
  ._1ein1kw7{border-end-end-radius:inherit}
14
13
  ._1ltv1uvc{left:107px}
@@ -17,14 +16,14 @@
17
16
  ._1ltvvbgk{left:4pc}
18
17
  ._1o9zidpf{flex-shrink:0}
19
18
  ._1reo15vq{overflow-x:hidden}
20
- ._4cvr1h6o{align-items:center}
21
- ._4t3i1osq{height:100%}
19
+ ._1tkekbql{min-height:450px}
20
+ ._4t3i1ogm{height:600px}
22
21
  ._4t3i1ylp{height:40px}
23
- ._4t3ikbql{height:450px}
24
22
  ._4t3il52n{height:17px}
25
23
  ._4t3io7ao{height:15px}
26
24
  ._5fbc1kw7{border-start-end-radius:inherit}
27
25
  ._kqswh2mm{position:relative}
28
26
  ._kqswstnw{position:absolute}
29
27
  ._t9ec1b7d{transform:rotate(-3.18deg)}
28
+ ._t9ec1i34{transform:translateY(-50%)}
30
29
  ._t9ec751h{transform:rotate(3.37deg)}
@@ -8,29 +8,31 @@ import { Box } from '@atlaskit/primitives/compiled/box';
8
8
  // oxlint-disable-next-line import/extensions
9
9
  import illustrationWithoutProviderIcons from './assets/graphics-with-grid-no-provider-icons-2x.png';
10
10
  var styles = {
11
- illustration: "_1e0c1ule _4t3ikbql _1bsb1kdj",
12
- illustrationLayer: "_1reo15vq _18m915vq _1ein1kw7 _5fbc1kw7 _4t3ikbql _kqswh2mm _1bsb1kdj",
13
- rightPane: "_1reo15vq _18m915vq _4cvr1h6o _1ein1kw7 _5fbc1kw7 _1e0c1txw _1o9zidpf _4t3i1osq _1bah1h6o _1bsb1kdj"
11
+ illustration: "_1e0c1ule _4t3i1ogm _1bsb1kdj",
12
+ illustrationGroup: "_4t3i1ogm _kqswstnw _154i1ssb _t9ec1i34 _1bsb1kdj",
13
+ rightPane: "_1reo15vq _18m915vq _1ein1kw7 _5fbc1kw7 _1o9zidpf _1tkekbql _kqswh2mm _1bsb1kdj"
14
14
  };
15
15
 
16
16
  // Pixel offsets and rotations are from the Figma illustration, not space tokens.
17
+ // Offsets are relative to the illustration's own top-left corner (illustrationGroup), not to
18
+ // `rightPane`, so they stay correct however much of `rightPane`'s height is visible.
17
19
  var illustrationIconStyles = {
18
- footer: "_4t3io7ao _1ltv1uvc _kqswstnw _154invl5 _t9ec1b7d _1bsbo7ao",
19
- searchFirst: "_4t3il52n _1ltv5rga _kqswstnw _154intd2 _t9ec751h _1bsbl52n",
20
- searchSecond: "_4t3il52n _1ltvs0l4 _kqswstnw _154i1rp4 _t9ec751h _1bsbl52n",
21
- top: "_1reo15vq _18m915vq _4t3i1ylp _1ltvvbgk _kqswstnw _154i18e8 _1bsb1ylp"
20
+ footer: "_4t3io7ao _1ltv1uvc _kqswstnw _154iudc3 _t9ec1b7d _1bsbo7ao",
21
+ searchFirst: "_4t3il52n _1ltv5rga _kqswstnw _154i96e4 _t9ec751h _1bsbl52n",
22
+ searchSecond: "_4t3il52n _1ltvs0l4 _kqswstnw _154i12aa _t9ec751h _1bsbl52n",
23
+ top: "_1reo15vq _18m915vq _4t3i1ylp _1ltvvbgk _kqswstnw _154i1qr7 _1bsb1ylp"
22
24
  };
23
25
  var IllustrationPane = function IllustrationPane(_ref) {
24
26
  var renderProviderIcon = _ref.renderProviderIcon;
25
27
  return /*#__PURE__*/React.createElement(Box, {
26
28
  xcss: styles.rightPane
27
29
  }, /*#__PURE__*/React.createElement(Box, {
28
- xcss: styles.illustrationLayer
30
+ xcss: styles.illustrationGroup
29
31
  }, /*#__PURE__*/React.createElement("img", {
30
32
  alt: "",
31
33
  "aria-hidden": "true",
32
34
  "data-testid": "pre-auth-value-proposition-modal-illustration",
33
- height: 450,
35
+ height: 600,
34
36
  src: illustrationWithoutProviderIcons,
35
37
  srcSet: "".concat(illustrationWithoutProviderIcons, " 2x"),
36
38
  width: 400,
@@ -7,7 +7,9 @@
7
7
  ._1bsbnklw{width:20pc}
8
8
  ._1e0c1txw{display:flex}
9
9
  ._1o9zidpf{flex-shrink:0}
10
+ ._1o9zkb7n{flex-shrink:1}
10
11
  ._1reo15vq{overflow-x:hidden}
12
+ ._1ul9idpf{min-width:0}
11
13
  ._2lx21bp4{flex-direction:column}
12
14
  ._4cvr1fhb{align-items:stretch}
13
15
  ._4cvr1h6o{align-items:center}
@@ -66,8 +66,10 @@ var styles = {
66
66
  bodyCopy: "_1bsbnklw",
67
67
  content: "_zulp1ejb _1e0c1txw _2lx21bp4 _4t3i1osq _n3td1jfw _19bv1jfw _u5f31jfw _ca0q1jfw",
68
68
  copyColumn: "_zulppxbi _1e0c1txw _2lx21bp4 _16jlkb7n",
69
- leftPane: "_1e0c1txw _2lx21bp4 _1o9zidpf _4t3i1osq _1bsb1kdj",
69
+ leftPane: "_1e0c1txw _2lx21bp4 _1o9zidpf _1bsb1kdj",
70
70
  providerIcon: "_4cvr1h6o _1e0c1txw _1o9zidpf",
71
+ primaryButton: "_1o9zkb7n _1ul9idpf",
72
+ secondaryButton: "_1o9zidpf",
71
73
  splitLayout: "_2rko1kw7 _1reo15vq _18m915vq _4cvr1fhb _1e0c1txw _4t3i1osq"
72
74
  };
73
75
  var bold = function bold(chunks) {
@@ -101,7 +103,7 @@ var ModalCopy = function ModalCopy(_ref) {
101
103
  }, providerIcon && /*#__PURE__*/React.createElement(Box, {
102
104
  xcss: styles.providerIcon
103
105
  }, providerIcon), /*#__PURE__*/React.createElement(ModalTitle, {
104
- isMultiline: false
106
+ isMultiline: true
105
107
  }, /*#__PURE__*/React.createElement(Heading, {
106
108
  as: "span",
107
109
  color: "color.text",
@@ -150,23 +152,29 @@ var ModalCopy = function ModalCopy(_ref) {
150
152
  }))), /*#__PURE__*/React.createElement(Flex, {
151
153
  gap: "space.075",
152
154
  justifyContent: "start"
155
+ }, /*#__PURE__*/React.createElement(Box, {
156
+ xcss: styles.primaryButton
153
157
  }, /*#__PURE__*/React.createElement(Button, {
154
158
  appearance: "primary",
155
159
  onClick: onConnect,
156
160
  autoFocus: true,
161
+ shouldFitContainer: true,
157
162
  spacing: "default"
158
163
  }, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect, {
159
164
  values: {
160
165
  providerName: providerName
161
166
  }
162
- }))), /*#__PURE__*/React.createElement(Button, {
167
+ })))), /*#__PURE__*/React.createElement(Box, {
168
+ xcss: styles.secondaryButton
169
+ }, /*#__PURE__*/React.createElement(Button, {
163
170
  appearance: "subtle",
164
171
  onClick: onClose
165
- }, /*#__PURE__*/React.createElement(FormattedMessage, messages.close)))));
172
+ }, /*#__PURE__*/React.createElement(FormattedMessage, messages.close))))));
166
173
  };
167
174
  var PreAuthValuePropositionModalContent = function PreAuthValuePropositionModalContent(_ref2) {
168
175
  var _provider$iconLabel;
169
176
  var onFinished = _ref2.onFinished,
177
+ onOpenChange = _ref2.onOpenChange,
170
178
  url = _ref2.url;
171
179
  var _useSmartLink = useSmartLink(SMART_LINK_MODAL_ID, url, 'inline'),
172
180
  actions = _useSmartLink.actions,
@@ -187,6 +195,16 @@ var PreAuthValuePropositionModalContent = function PreAuthValuePropositionModalC
187
195
  return extractSmartLinkProvider(state.details);
188
196
  }, [state.details]);
189
197
  var providerName = provider === null || provider === void 0 ? void 0 : provider.text;
198
+ var isVisible = isOpen && Boolean(providerName);
199
+ useEffect(function () {
200
+ if (!isVisible) {
201
+ return;
202
+ }
203
+ onOpenChange === null || onOpenChange === void 0 || onOpenChange(true);
204
+ return function () {
205
+ return onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false);
206
+ };
207
+ }, [isVisible, onOpenChange]);
190
208
  var providerIconUrl = typeof (provider === null || provider === void 0 ? void 0 : provider.icon) === 'string' ? provider.icon : undefined;
191
209
  var renderProviderIcon = function renderProviderIcon(size, testId, label) {
192
210
  if (providerIconUrl) {
@@ -280,6 +298,7 @@ var PreAuthValuePropositionModalContent = function PreAuthValuePropositionModalC
280
298
  };
281
299
  export var PreAuthValuePropositionModal = function PreAuthValuePropositionModal(_ref3) {
282
300
  var onFinished = _ref3.onFinished,
301
+ onOpenChange = _ref3.onOpenChange,
283
302
  url = _ref3.url;
284
303
  return /*#__PURE__*/React.createElement(SmartLinkAnalyticsContext, {
285
304
  display: "inline",
@@ -288,6 +307,7 @@ export var PreAuthValuePropositionModal = function PreAuthValuePropositionModal(
288
307
  url: url
289
308
  }, /*#__PURE__*/React.createElement(PreAuthValuePropositionModalContent, {
290
309
  onFinished: onFinished,
310
+ onOpenChange: onOpenChange,
291
311
  url: url
292
312
  }));
293
313
  };
@@ -1,5 +1,7 @@
1
1
  export type PreAuthValuePropositionModalProps = {
2
2
  onFinished: () => void;
3
+ /** Called when the modal becomes visible, and with false on close or unmount. */
4
+ onOpenChange?: (isOpen: boolean) => void;
3
5
  url: string;
4
6
  };
5
- export declare const PreAuthValuePropositionModal: ({ onFinished, url, }: PreAuthValuePropositionModalProps) => JSX.Element;
7
+ export declare const PreAuthValuePropositionModal: ({ onFinished, onOpenChange, url, }: PreAuthValuePropositionModalProps) => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "46.0.2",
3
+ "version": "46.1.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -59,7 +59,7 @@
59
59
  "@atlaskit/heading": "^8.0.0",
60
60
  "@atlaskit/icon": "^38.0.0",
61
61
  "@atlaskit/icon-file-type": "^8.3.0",
62
- "@atlaskit/icon-lab": "^7.9.0",
62
+ "@atlaskit/icon-lab": "^7.10.0",
63
63
  "@atlaskit/image": "^5.2.0",
64
64
  "@atlaskit/json-ld-types": "^2.0.0",
65
65
  "@atlaskit/link": "^5.1.0",
@@ -83,7 +83,7 @@
83
83
  "@atlaskit/primitives": "^22.5.0",
84
84
  "@atlaskit/react-compiler-gating": "^0.2.0",
85
85
  "@atlaskit/react-ufo": "^8.0.0",
86
- "@atlaskit/rovo-triggers": "^11.3.0",
86
+ "@atlaskit/rovo-triggers": "^11.5.0",
87
87
  "@atlaskit/section-message": "^10.2.0",
88
88
  "@atlaskit/select": "^23.1.0",
89
89
  "@atlaskit/spinner": "^20.4.0",
@@ -93,7 +93,7 @@
93
93
  "@atlaskit/textfield": "^10.2.0",
94
94
  "@atlaskit/theme": "^28.2.0",
95
95
  "@atlaskit/tile": "^5.0.0",
96
- "@atlaskit/tmp-editor-statsig": "^207.0.0",
96
+ "@atlaskit/tmp-editor-statsig": "^208.0.0",
97
97
  "@atlaskit/tokens": "^20.0.0",
98
98
  "@atlaskit/tooltip": "^24.3.0",
99
99
  "@atlaskit/ufo": "^2.0.0",