@atlaskit/flag 16.2.0 → 17.0.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 (48) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/cjs/auto-dismiss-flag.js +1 -1
  3. package/dist/cjs/constants.js +2 -6
  4. package/dist/cjs/flag-actions.compiled.css +17 -0
  5. package/dist/cjs/flag-actions.js +31 -57
  6. package/dist/cjs/flag-group.compiled.css +17 -0
  7. package/dist/cjs/flag-group.js +26 -78
  8. package/dist/cjs/flag.compiled.css +21 -0
  9. package/dist/cjs/flag.js +48 -76
  10. package/dist/cjs/internal/dismiss-button.compiled.css +15 -0
  11. package/dist/cjs/internal/dismiss-button.js +17 -18
  12. package/dist/cjs/internal/expander.compiled.css +2 -0
  13. package/dist/cjs/internal/expander.js +19 -15
  14. package/dist/es2019/auto-dismiss-flag.js +1 -1
  15. package/dist/es2019/constants.js +1 -5
  16. package/dist/es2019/flag-actions.compiled.css +17 -0
  17. package/dist/es2019/flag-actions.js +18 -57
  18. package/dist/es2019/flag-group.compiled.css +17 -0
  19. package/dist/es2019/flag-group.js +24 -78
  20. package/dist/es2019/flag.compiled.css +21 -0
  21. package/dist/es2019/flag.js +40 -75
  22. package/dist/es2019/internal/dismiss-button.compiled.css +15 -0
  23. package/dist/es2019/internal/dismiss-button.js +16 -17
  24. package/dist/es2019/internal/expander.compiled.css +2 -0
  25. package/dist/es2019/internal/expander.js +11 -10
  26. package/dist/esm/auto-dismiss-flag.js +1 -1
  27. package/dist/esm/constants.js +1 -5
  28. package/dist/esm/flag-actions.compiled.css +17 -0
  29. package/dist/esm/flag-actions.js +29 -55
  30. package/dist/esm/flag-group.compiled.css +17 -0
  31. package/dist/esm/flag-group.js +24 -78
  32. package/dist/esm/flag.compiled.css +21 -0
  33. package/dist/esm/flag.js +43 -77
  34. package/dist/esm/internal/dismiss-button.compiled.css +15 -0
  35. package/dist/esm/internal/dismiss-button.js +16 -17
  36. package/dist/esm/internal/expander.compiled.css +2 -0
  37. package/dist/esm/internal/expander.js +11 -10
  38. package/dist/types/constants.d.ts +0 -4
  39. package/dist/types/flag-group.d.ts +2 -3
  40. package/dist/types/internal/dismiss-button.d.ts +2 -2
  41. package/dist/types/internal/expander.d.ts +2 -2
  42. package/dist/types/theme.d.ts +1 -1
  43. package/dist/types-ts4.5/constants.d.ts +0 -4
  44. package/dist/types-ts4.5/flag-group.d.ts +2 -3
  45. package/dist/types-ts4.5/internal/dismiss-button.d.ts +2 -2
  46. package/dist/types-ts4.5/internal/expander.d.ts +2 -2
  47. package/dist/types-ts4.5/theme.d.ts +1 -1
  48. package/package.json +16 -15
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @atlaskit/flag
2
2
 
3
+ ## 17.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#124832](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/124832)
8
+ [`aa446a240d0bd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aa446a240d0bd) -
9
+ Migrated from `@emotion/react` to `@compiled/react` in order to improve performance, align with
10
+ the rest of the Atlaskit techstack, and support React 18 Streaming SSR.
11
+
12
+ Please note, in order to use this version of `@atlaskit/flag`, you will need to ensure that your
13
+ bundler is configured to handle `.css` imports correctly. Most bundlers come with built-in support
14
+ for `.css` imports, so you may not need to do anything. If you are using a different bundler,
15
+ please refer to the documentation for that bundler to understand how to handle `.css` imports.
16
+
17
+ For more information on the migration, please refer to
18
+ [RFC-73 Migrating our components to Compiled CSS-in-JS](https://community.developer.atlassian.com/t/rfc-73-migrating-our-components-to-compiled-css-in-js/85953).
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+
24
+ ## 16.2.1
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies
29
+
3
30
  ## 16.2.0
4
31
 
5
32
  ### Minor Changes
@@ -15,7 +15,7 @@ var _flagGroup = require("./flag-group");
15
15
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
17
  var packageName = "@atlaskit/flag";
18
- var packageVersion = "16.2.0";
18
+ var packageVersion = "17.0.0";
19
19
  var AUTO_DISMISS_SECONDS = exports.AUTO_DISMISS_SECONDS = 8;
20
20
 
21
21
  /**
@@ -3,9 +3,5 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.VAR_COLOR = exports.VAR_BG_COLOR_HOVER = exports.VAR_BG_COLOR_ACTIVE = exports.VAR_BG_COLOR = exports.DEFAULT_APPEARANCE = void 0;
7
- var DEFAULT_APPEARANCE = exports.DEFAULT_APPEARANCE = 'normal';
8
- var VAR_COLOR = exports.VAR_COLOR = '--color';
9
- var VAR_BG_COLOR = exports.VAR_BG_COLOR = '--bg-color';
10
- var VAR_BG_COLOR_HOVER = exports.VAR_BG_COLOR_HOVER = '--bg-color-hover';
11
- var VAR_BG_COLOR_ACTIVE = exports.VAR_BG_COLOR_ACTIVE = '--bg-color-active';
6
+ exports.DEFAULT_APPEARANCE = void 0;
7
+ var DEFAULT_APPEARANCE = exports.DEFAULT_APPEARANCE = 'normal';
@@ -0,0 +1,17 @@
1
+
2
+ ._nup91zz4._nup91zz4, a._u4iq1zz4._u4iq1zz4{background:var(--bg-color)}
3
+ ._12r21wq8._12r21wq8, a._il101wq8._il101wq8{font-weight:var(--ds-font-weight-medium,500)}
4
+ ._1bk69tn6._1bk69tn6, a._1wy69tn6._1wy69tn6{padding-inline-end:var(--_zkfc5e)}
5
+ ._1dltgrf3._1dltgrf3, a._h03xgrf3._h03xgrf3{padding-top:0!important}
6
+ ._1g4l107e._1g4l107e, a._y8dn107e._y8dn107e{transform:translateX(-2px)}
7
+ ._1ku2grf3._1ku2grf3, a._1v8mgrf3._1v8mgrf3{padding-block-end:0!important}
8
+ ._1w901pkf._1w901pkf, a._qkwg1pkf._qkwg1pkf{color:var(--color)!important}
9
+ ._1yxxgrf3._1yxxgrf3, a._z7cdgrf3._z7cdgrf3{padding-left:0!important}
10
+ ._b3g39tn6._b3g39tn6, a._eqps9tn6._eqps9tn6{padding-inline-start:var(--_zkfc5e)}
11
+ ._fjwrgrf3._fjwrgrf3, a._cwkngrf3._cwkngrf3{padding-bottom:0!important}
12
+ ._gbuigrf3._gbuigrf3, a._1dwvgrf3._1dwvgrf3{padding-block-start:0!important}
13
+ ._w8sqgrf3._w8sqgrf3, a._1iysgrf3._1iysgrf3{padding-right:0!important}
14
+ ._u1mb14jz._u1mb14jz:hover{background-color:var(--bg-color-hover)}._10fu17w4._10fu17w4:active{background-color:var(--bg-color-active)}
15
+ ._17rj8stv._17rj8stv:active, ._1p6m8stv._1p6m8stv:hover, a._5kwq8stv._5kwq8stv:active, a._1pd88stv._1pd88stv:hover{text-decoration-line:underline}
16
+ ._1iqunqa1._1iqunqa1:active, ._1ejunqa1._1ejunqa1:hover, a._b6ztnqa1._b6ztnqa1:active, a._1rsgnqa1._1rsgnqa1:hover{text-decoration-style:solid}
17
+ ._ow071r31._ow071r31:active, ._1p6b1r31._1p6b1r31:hover, a._8dbm1r31._8dbm1r31:active, a._77mc1r31._77mc1r31:hover{text-decoration-color:currentColor}
@@ -1,63 +1,27 @@
1
+ /* flag-actions.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
6
  Object.defineProperty(exports, "__esModule", {
5
7
  value: true
6
8
  });
7
9
  exports.default = void 0;
10
+ require("./flag-actions.compiled.css");
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _runtime = require("@compiled/react/runtime");
8
13
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _react = require("@emotion/react");
10
14
  var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
11
- var _inline = _interopRequireDefault(require("@atlaskit/primitives/inline"));
15
+ var _compiled = require("@atlaskit/primitives/compiled");
12
16
  var _constants = require("./constants");
13
17
  var _theme = require("./theme");
14
- /* eslint-disable @atlaskit/design-system/no-nested-styles */
15
- /**
16
- * @jsxRuntime classic
17
- * @jsx jsx
18
- */
19
-
20
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
21
-
22
- var buttonStyles = (0, _react.css)({
23
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
24
- '&&, a&&': {
25
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
26
- padding: "0 ".concat("var(--ds-space-100, 8px)", " !important"),
27
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
28
- background: "var(".concat(_constants.VAR_BG_COLOR, ")"),
29
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
30
- color: "var(".concat(_constants.VAR_COLOR, ") !important"),
31
- fontWeight: "var(--ds-font-weight-medium, 500)"
32
- },
33
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
34
- '&&:hover, &&:active, a&&:hover, a&&:active': {
35
- textDecoration: 'underline'
36
- },
37
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
38
- '&&:hover': {
39
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
40
- backgroundColor: "var(".concat(_constants.VAR_BG_COLOR_HOVER, ")")
41
- },
42
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
43
- '&&:active': {
44
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
45
- backgroundColor: "var(".concat(_constants.VAR_BG_COLOR_ACTIVE, ")")
46
- }
47
- });
48
- var appearanceNormalButtonStyles = (0, _react.css)({
49
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
50
- '&&, a&&': {
51
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
52
- padding: '0 !important'
53
- }
54
- });
55
- var appearanceNormalActionsContainerStyles = (0, _react.css)({
56
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
57
- '&&, a&&': {
58
- transform: 'translateX(-2px)'
59
- }
60
- });
18
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
19
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
21
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable @atlaskit/design-system/no-nested-styles */
22
+ var buttonStyles = null;
23
+ var appearanceNormalButtonStyles = null;
24
+ var appearanceNormalActionsContainerStyles = null;
61
25
  var FlagActions = function FlagActions(props) {
62
26
  var _props$appearance = props.appearance,
63
27
  appearance = _props$appearance === void 0 ? _constants.DEFAULT_APPEARANCE : _props$appearance,
@@ -69,16 +33,16 @@ var FlagActions = function FlagActions(props) {
69
33
  return null;
70
34
  }
71
35
  var isBold = appearance !== _constants.DEFAULT_APPEARANCE;
72
- return (0, _react.jsx)("span", {
73
- css: !isBold && appearanceNormalActionsContainerStyles
74
- }, (0, _react.jsx)(_inline.default, {
36
+ return /*#__PURE__*/React.createElement("span", {
37
+ className: (0, _runtime.ax)([!isBold && "_1g4l107e _y8dn107e"])
38
+ }, /*#__PURE__*/React.createElement(_compiled.Inline, {
75
39
  space: "space.100",
76
40
  shouldWrap: true,
77
41
  alignBlock: "center",
78
42
  separator: isBold ? undefined : '·',
79
43
  testId: testId && "".concat(testId, "-actions")
80
44
  }, actions.map(function (action, index) {
81
- return (0, _react.jsx)(_customThemeButton.default, {
45
+ return /*#__PURE__*/React.createElement(_customThemeButton.default, {
82
46
  onClick: action.onClick,
83
47
  href: action.href,
84
48
  target: action.target,
@@ -87,10 +51,20 @@ var FlagActions = function FlagActions(props) {
87
51
  spacing: "compact",
88
52
  testId: action.testId,
89
53
  key: index,
90
- style: (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants.VAR_COLOR, _theme.actionTextColor[appearance]), _constants.VAR_BG_COLOR, _theme.actionBackgroundColor[appearance].default), _constants.VAR_BG_COLOR_HOVER, _theme.actionBackgroundColor[appearance].pressed), _constants.VAR_BG_COLOR_ACTIVE, _theme.actionBackgroundColor[appearance].active)
91
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
92
- ,
93
- css: [buttonStyles, appearance === _constants.DEFAULT_APPEARANCE && appearanceNormalButtonStyles]
54
+ className: (0, _runtime.ax)(["_nup91zz4 _u4iq1zz4 _1w901pkf _qkwg1pkf _12r21wq8 _il101wq8 _1ku2grf3 _1v8mgrf3 _gbuigrf3 _1dwvgrf3 _1bk69tn6 _1wy69tn6 _b3g39tn6 _eqps9tn6 _ow071r31 _1p6b1r31 _8dbm1r31 _77mc1r31 _17rj8stv _1p6m8stv _5kwq8stv _1pd88stv _1iqunqa1 _1ejunqa1 _b6ztnqa1 _1rsgnqa1 _u1mb14jz _10fu17w4", appearance === _constants.DEFAULT_APPEARANCE && "_1dltgrf3 _h03xgrf3 _w8sqgrf3 _1iysgrf3 _fjwrgrf3 _cwkngrf3 _1yxxgrf3 _z7cdgrf3"]),
55
+ style: _objectSpread(_objectSpread({}, {
56
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
57
+ '--color': _theme.actionTextColor[appearance],
58
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
59
+ '--bg-color': _theme.actionBackgroundColor[appearance].default,
60
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
61
+ '--bg-color-hover': _theme.actionBackgroundColor[appearance].pressed,
62
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
63
+ '--bg-color-active': _theme.actionBackgroundColor[appearance].active
64
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
65
+ }), {}, {
66
+ "--_zkfc5e": (0, _runtime.ix)("var(--ds-space-100, 8px)".concat(" !important"))
67
+ })
94
68
  }, action.content);
95
69
  })));
96
70
  };
@@ -0,0 +1,17 @@
1
+
2
+ ._v5641b8g{transition:transform .35s ease-in-out}
3
+ ._v564glyw{transition:none}._12a7luct._12a7luct+*{transition-duration:175ms}
4
+ ._1bsb1kdj{width:25pc}
5
+ ._1e021epz{inset-inline-start:var(--ds-space-1000,5pc)}
6
+ ._1pbyegat{z-index:4}
7
+ ._1pbyqfx8{z-index:5}
8
+ ._1pbyxejw{z-index:flag}
9
+ ._3um015vq{visibility:hidden}
10
+ ._5sag5cps{animation-duration:0ms}
11
+ ._kqsw1n9t{position:fixed}
12
+ ._kqswstnw{position:absolute}
13
+ ._t9ec1hw2{transform:translateX(0) translateY(100%) translateY(1pc)}
14
+ ._t9ec1ygq{transform:translate(0,0)}
15
+ ._u7coidpf{inset-block-end:0}
16
+ ._u7cooahv{inset-block-end:var(--ds-space-600,3pc)}
17
+ @media (max-width:560px){._1eqkauwl{width:100vw}._1iafidpf{inset-block-end:0}._il0widpf{inset-inline-start:0}}
@@ -1,30 +1,27 @@
1
+ /* flag-group.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ var _typeof3 = require("@babel/runtime/helpers/typeof");
4
6
  Object.defineProperty(exports, "__esModule", {
5
7
  value: true
6
8
  });
7
9
  exports.flagWidth = exports.default = exports.FlagGroupContext = void 0;
8
10
  exports.useFlagGroup = useFlagGroup;
11
+ require("./flag-group.compiled.css");
12
+ var _react = _interopRequireWildcard(require("react"));
13
+ var React = _react;
14
+ var _runtime = require("@compiled/react/runtime");
9
15
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
10
- var _react = require("react");
11
- var _react2 = require("@emotion/react");
12
16
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
13
17
  var _motion = require("@atlaskit/motion");
14
18
  var _portal = _interopRequireDefault(require("@atlaskit/portal"));
15
19
  var _constants = require("@atlaskit/theme/constants");
16
20
  var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
17
- /**
18
- * @jsxRuntime classic
19
- * @jsx jsx
20
- */
21
-
22
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
23
-
21
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
22
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
23
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
25
-
26
- var gridSize = (0, _constants.gridSize)();
27
- var flagWidth = exports.flagWidth = gridSize * 50;
24
+ var flagWidth = exports.flagWidth = 400;
28
25
  var defaultFlagGroupContext = {
29
26
  onDismissed: _noop.default,
30
27
  isDismissAllowed: false
@@ -40,65 +37,18 @@ function useFlagGroup() {
40
37
 
41
38
  // transition: none is set on first-of-type to prevent a bug in Firefox
42
39
  // that causes a broken transition
43
- var baseStyles = (0, _react2.css)({
44
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
45
- width: flagWidth,
46
- position: 'absolute',
47
- insetBlockEnd: 0,
48
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
49
- transition: "transform ".concat(_motion.durations.medium, "ms ease-in-out"),
50
- // TODO: Use new breakpoints
51
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
52
- '@media (max-width: 560px)': {
53
- width: '100vw'
54
- },
55
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
56
- ':first-of-type': {
57
- transform: "translate(0,0)",
58
- transition: 'none'
59
- },
60
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
61
- ':nth-of-type(n + 2)': {
62
- animationDuration: '0ms',
63
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
64
- transform: "translateX(0) translateY(100%) translateY(".concat(2 * gridSize, "px)")
65
- },
66
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
67
- ':nth-of-type(1)': {
68
- zIndex: 5
69
- },
70
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
71
- ':nth-of-type(2)': {
72
- zIndex: 4
73
- },
74
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
75
- '&:nth-of-type(n + 4)': {
76
- visibility: 'hidden'
77
- }
78
- });
40
+ var groupStyles = {
41
+ root: "_v5641b8g _1bsb1kdj _kqswstnw _u7coidpf _1eqkauwl",
42
+ first: "_v564glyw _t9ec1ygq _1pbyqfx8",
43
+ second: "_1pbyegat",
44
+ nth: "_5sag5cps _t9ec1hw2",
45
+ hidden: "_3um015vq"
46
+ };
79
47
 
80
48
  // Transform needed to push up while 1st flag is leaving
81
49
  // Exiting time should match the exiting time of motion so is halved
82
- var dismissAllowedStyles = (0, _react2.css)({
83
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
84
- '&& + *': {
85
- transform: "translate(0, 0)",
86
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
87
- transitionDuration: "".concat(_motion.exitingDurations.medium, "ms")
88
- }
89
- });
90
- var flagGroupContainerStyles = (0, _react2.css)({
91
- position: 'fixed',
92
- zIndex: 'flag',
93
- insetBlockEnd: "var(--ds-space-600, 48px)",
94
- insetInlineStart: "var(--ds-space-1000, 80px)",
95
- // TODO: Use new breakpoints
96
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
97
- '@media (max-width: 560px)': {
98
- insetBlockEnd: 0,
99
- insetInlineStart: 0
100
- }
101
- });
50
+ var dismissAllowedStyles = null;
51
+ var flagGroupContainerStyles = null;
102
52
 
103
53
  /**
104
54
  * __Flag group__
@@ -129,7 +79,7 @@ var FlagGroup = function FlagGroup(props) {
129
79
  var renderChildren = function renderChildren() {
130
80
  return children && (0, _typeof2.default)(children) === 'object' ? _react.Children.map(children, function (flag, index) {
131
81
  var isDismissAllowed = index === 0;
132
- return (0, _react2.jsx)(_motion.SlideIn, {
82
+ return /*#__PURE__*/React.createElement(_motion.SlideIn, {
133
83
  enterFrom: "left",
134
84
  fade: "inout",
135
85
  duration: "medium",
@@ -137,13 +87,11 @@ var FlagGroup = function FlagGroup(props) {
137
87
  }, function (_ref) {
138
88
  var className = _ref.className,
139
89
  ref = _ref.ref;
140
- return (0, _react2.jsx)("div", {
141
- css: [baseStyles, isDismissAllowed && dismissAllowedStyles]
90
+ return /*#__PURE__*/React.createElement("div", {
142
91
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
143
- ,
144
- className: className,
92
+ className: (0, _runtime.ax)([groupStyles.root, index === 0 && groupStyles.first, index === 1 && groupStyles.second, index >= 1 && groupStyles.nth, index >= 2 && groupStyles.hidden, isDismissAllowed && "_12a7luct", className]),
145
93
  ref: ref
146
- }, (0, _react2.jsx)(FlagGroupContext.Provider, {
94
+ }, /*#__PURE__*/React.createElement(FlagGroupContext.Provider, {
147
95
  value:
148
96
  // Only the first flag should be able to be dismissed.
149
97
  isDismissAllowed ? dismissFlagContext : defaultFlagGroupContext
@@ -151,13 +99,13 @@ var FlagGroup = function FlagGroup(props) {
151
99
  });
152
100
  }) : false;
153
101
  };
154
- var flags = (0, _react2.jsx)("div", {
102
+ var flags = /*#__PURE__*/React.createElement("div", {
155
103
  id: id,
156
- css: flagGroupContainerStyles
157
- }, hasFlags ? (0, _react2.jsx)(_visuallyHidden.default, null, (0, _react2.jsx)(LabelTag, null, label)) : null, (0, _react2.jsx)(_motion.ExitingPersistence, {
104
+ className: (0, _runtime.ax)(["_kqsw1n9t _1pbyxejw _u7cooahv _1e021epz _1iafidpf _il0widpf"])
105
+ }, hasFlags ? /*#__PURE__*/React.createElement(_visuallyHidden.default, null, /*#__PURE__*/React.createElement(LabelTag, null, label)) : null, /*#__PURE__*/React.createElement(_motion.ExitingPersistence, {
158
106
  appear: false
159
107
  }, renderChildren()));
160
- return shouldRenderToParent ? flags : (0, _react2.jsx)(_portal.default, {
108
+ return shouldRenderToParent ? flags : /*#__PURE__*/React.createElement(_portal.default, {
161
109
  zIndex: _constants.layers.flag()
162
110
  }, flags);
163
111
  };
@@ -0,0 +1,21 @@
1
+
2
+ ._2rkosqtm{border-radius:var(--ds-border-radius-100,3px)}
3
+ ._v5641hdc{transition:gap .3s}
4
+ ._v564z97a{transition:background-color .2s}._16jlkb7n{flex-grow:1}
5
+ ._16qs8sq4{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #091e423f,0 0 1px #091e424f)}
6
+ ._18m915vq{overflow-y:hidden}
7
+ ._18m91wug{overflow-y:auto}
8
+ ._1bah1h6o{justify-content:center}
9
+ ._1bsb1osq{width:100%}
10
+ ._1e0c1txw{display:flex}
11
+ ._1i4qfg65{overflow-wrap:anywhere}
12
+ ._1o9zidpf{flex-shrink:0}
13
+ ._1pbyni7l{z-index:600}
14
+ ._1reo15vq{overflow-x:hidden}
15
+ ._1reo1wug{overflow-x:auto}
16
+ ._1tke1tcg{min-height:24px}
17
+ ._1ul91tcg{min-width:24px}
18
+ ._4cvr1h6o{align-items:center}
19
+ ._4cvrv2br{align-items:start}
20
+ ._c71l53f4{max-height:75pt}
21
+ ._syaz16r9{color:var(--_11v68d2)}
package/dist/cjs/flag.js CHANGED
@@ -1,78 +1,49 @@
1
+ /* flag.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
6
  Object.defineProperty(exports, "__esModule", {
5
7
  value: true
6
8
  });
7
9
  exports.default = void 0;
10
+ require("./flag.compiled.css");
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var React = _react;
13
+ var _runtime = require("@compiled/react/runtime");
8
14
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
16
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
- var _react = require("react");
12
- var _react2 = require("@emotion/react");
13
17
  var _usePlatformLeafEventHandler = require("@atlaskit/analytics-next/usePlatformLeafEventHandler");
14
18
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
15
19
  var _heading = _interopRequireDefault(require("@atlaskit/heading"));
16
20
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
- var _primitives = require("@atlaskit/primitives");
21
+ var _compiled = require("@atlaskit/primitives/compiled");
18
22
  var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
19
23
  var _constants = require("./constants");
20
24
  var _flagActions = _interopRequireDefault(require("./flag-actions"));
21
25
  var _flagGroup = require("./flag-group");
22
26
  var _internal = require("./internal");
23
27
  var _theme = require("./theme");
28
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
29
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
30
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
25
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
26
- * @jsxRuntime classic
27
- * @jsx jsx
28
- */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
31
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
32
+ var styles = {
33
+ overflowWrap: "_1i4qfg65",
34
+ flag: "_2rkosqtm _1reo15vq _18m915vq _v564z97a _16qs8sq4 _1pbyni7l _1bsb1osq"
35
+ };
29
36
  var CSS_VAR_ICON_COLOR = '--flag-icon-color';
30
-
31
- // For cases where a single word is longer than the container (e.g. filenames)
32
- var overflowWrapStyles = (0, _primitives.xcss)({
33
- overflowWrap: 'anywhere'
34
- });
35
- var descriptionStyles = (0, _react2.css)({
36
- maxHeight: 100,
37
- // height is defined as 5 lines maximum by design
38
- overflow: 'auto',
39
- overflowWrap: 'anywhere' // For cases where a single word is longer than the container (e.g. filenames)
40
- });
41
- var oldIconWrapperStyles = (0, _react2.css)({
42
- display: 'flex',
43
- alignItems: 'start',
44
- flexShrink: 0,
45
- color: "var(".concat(CSS_VAR_ICON_COLOR, ")")
46
- });
47
- var iconWrapperStyles = (0, _react2.css)({
48
- display: 'flex',
49
- minWidth: '24px',
50
- minHeight: '24px',
51
- alignItems: 'center',
52
- justifyContent: 'center',
53
- flexShrink: 0,
54
- color: "var(".concat(CSS_VAR_ICON_COLOR, ")")
55
- });
56
- var flagStyles = (0, _primitives.xcss)({
57
- boxShadow: 'elevation.shadow.overlay',
58
- borderRadius: 'border.radius.100',
59
- overflow: 'hidden',
60
- zIndex: 'flag',
61
- width: '100%',
62
- transition: 'background-color 200ms'
63
- });
64
- var flagWrapperStyles = (0, _react2.css)({
65
- width: '100%'
66
- });
37
+ var descriptionStyles = null;
38
+ var oldIconWrapperStyles = null;
39
+ var iconWrapperStyles = null;
40
+ var flagWrapperStyles = null;
67
41
  var analyticsAttributes = {
68
42
  componentName: 'flag',
69
43
  packageName: "@atlaskit/flag",
70
- packageVersion: "16.2.0"
44
+ packageVersion: "17.0.0"
71
45
  };
72
- var transitionStyles = (0, _react2.css)({
73
- flexGrow: 1,
74
- transition: "gap 0.3s"
75
- });
46
+ var transitionStyles = null;
76
47
 
77
48
  /**
78
49
  * __Flag__
@@ -174,62 +145,63 @@ var Flag = function Flag(props) {
174
145
  var isDismissable = isBold || isDismissAllowed;
175
146
  var shouldRenderGap = !isBold && (description || actions.length) || isExpanded;
176
147
  // when delayAnnouncement is available we will use a hidden content for announcement
177
- var delayedAnnouncement = delayAnnouncement ? (0, _react2.jsx)(_visuallyHidden.default, null, title, description) : undefined;
178
- return (0, _react2.jsx)("div", (0, _extends2.default)({
148
+ var delayedAnnouncement = delayAnnouncement ? /*#__PURE__*/React.createElement(_visuallyHidden.default, null, title, description) : undefined;
149
+ return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
179
150
  role: "alert",
180
- css: flagWrapperStyles,
181
151
  "data-testid": testId
182
- }, autoDismissProps), (0, _react2.jsx)(_primitives.Box, {
183
- backgroundColor: _theme.flagBackgroundColor[appearance],
152
+ }, autoDismissProps, {
153
+ className: (0, _runtime.ax)(["_1bsb1osq"])
154
+ }), /*#__PURE__*/React.createElement(_compiled.Box, {
184
155
  padding: "space.200",
185
- xcss: flagStyles
186
- }, (0, _react2.jsx)(_primitives.Inline, {
156
+ backgroundColor: _theme.flagBackgroundColor[appearance],
157
+ xcss: styles.flag
158
+ }, /*#__PURE__*/React.createElement(_compiled.Inline, {
187
159
  alignBlock: (0, _platformFeatureFlags.fg)('platform_ads_component_no_icon_spacing_support') ? 'start' : 'stretch',
188
160
  space: "space.200"
189
- }, (0, _react2.jsx)("div", {
190
- css: (0, _platformFeatureFlags.fg)('platform_ads_component_no_icon_spacing_support') ? iconWrapperStyles : oldIconWrapperStyles
191
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
192
- ,
193
- style: (0, _defineProperty2.default)({}, CSS_VAR_ICON_COLOR, iconColor),
194
- "data-testid": testId && "".concat(testId, "-icon-container")
195
- }, icon || (iconGlyph && (0, _platformFeatureFlags.fg)('platform_ads_component_no_icon_spacing_support') ? iconGlyph : null)), (0, _react2.jsx)("span", {
196
- css: transitionStyles
197
- }, (0, _react2.jsx)(_primitives.Stack, {
161
+ }, /*#__PURE__*/React.createElement("div", {
162
+ "data-testid": testId && "".concat(testId, "-icon-container"),
163
+ className: (0, _runtime.ax)([(0, _platformFeatureFlags.fg)('platform_ads_component_no_icon_spacing_support') ? "_1e0c1txw _1ul91tcg _1tke1tcg _4cvr1h6o _1bah1h6o _1o9zidpf _syaz16r9" : "_1e0c1txw _4cvrv2br _1o9zidpf _syaz16r9"]),
164
+ style: _objectSpread(_objectSpread({}, (0, _defineProperty2.default)({}, CSS_VAR_ICON_COLOR, iconColor)), {}, {
165
+ "--_11v68d2": (0, _runtime.ix)("var(".concat(CSS_VAR_ICON_COLOR, ")"))
166
+ })
167
+ }, icon || (iconGlyph && (0, _platformFeatureFlags.fg)('platform_ads_component_no_icon_spacing_support') ? iconGlyph : null)), /*#__PURE__*/React.createElement("span", {
168
+ className: (0, _runtime.ax)(["_v5641hdc _16jlkb7n"])
169
+ }, /*#__PURE__*/React.createElement(_compiled.Stack, {
198
170
  space: shouldRenderGap ? 'space.100' : 'space.0' // Gap exists even when not expanded due to Expander internals always being in the DOM
199
- }, isDelayToAnnounce && delayedAnnouncement, (0, _react2.jsx)(_primitives.Inline, {
171
+ }, isDelayToAnnounce && delayedAnnouncement, /*#__PURE__*/React.createElement(_compiled.Inline, {
200
172
  alignBlock: "stretch",
201
173
  space: "space.100",
202
174
  spread: "space-between"
203
- }, (0, _react2.jsx)(_primitives.Box, {
175
+ }, /*#__PURE__*/React.createElement(_compiled.Box, {
204
176
  paddingBlockStart: "space.050",
205
177
  paddingBlockEnd: "space.025",
206
- xcss: overflowWrapStyles
207
- }, (0, _react2.jsx)(_heading.default, {
178
+ xcss: styles.overflowWrap
179
+ }, /*#__PURE__*/React.createElement(_heading.default, {
208
180
  as: "h".concat(headingLevel),
209
181
  size: "xsmall",
210
182
  color: textColor
211
- }, (0, _react2.jsx)("span", {
183
+ }, /*#__PURE__*/React.createElement("span", {
212
184
  /* if isDelayToAnnounce is true, we will hide the content form screen reader to avoid duplicate announcement */
213
185
  "aria-hidden": isDelayToAnnounce
214
- }, title))), isDismissable ? !(isBold && !description && !actions.length) && (0, _react2.jsx)(_internal.DismissButton, {
186
+ }, title))), isDismissable ? !(isBold && !description && !actions.length) && /*#__PURE__*/React.createElement(_internal.DismissButton, {
215
187
  testId: testId,
216
188
  appearance: appearance,
217
189
  isBold: isBold,
218
190
  isExpanded: isExpanded,
219
191
  onClick: isBold ? toggleExpand : buttonActionCallback
220
- }) : null), (0, _react2.jsx)(_internal.Expander, {
192
+ }) : null), /*#__PURE__*/React.createElement(_internal.Expander, {
221
193
  isExpanded: !isBold || isExpanded,
222
194
  testId: testId
223
- }, description && (0, _react2.jsx)("div", {
195
+ }, description && /*#__PURE__*/React.createElement("div", {
224
196
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
225
197
  style: {
226
198
  color: _theme.flagTextColorToken[appearance]
227
199
  },
228
- css: descriptionStyles,
229
200
  "data-testid": testId && "".concat(testId, "-description")
230
201
  /* if isDelayToAnnounce is true, we will hide the content form screen reader to avoid duplicate announcement */,
231
- "aria-hidden": isDelayToAnnounce
232
- }, description), (0, _react2.jsx)(_flagActions.default, {
202
+ "aria-hidden": isDelayToAnnounce,
203
+ className: (0, _runtime.ax)(["_1reo1wug _18m91wug _c71l53f4 _1i4qfg65"])
204
+ }, description), /*#__PURE__*/React.createElement(_flagActions.default, {
233
205
  actions: actions,
234
206
  appearance: appearance,
235
207
  linkComponent: linkComponent,
@@ -0,0 +1,15 @@
1
+
2
+ ._1dqoglyw{border-style:none}._16jlidpf{flex-grow:0}
3
+ ._19bvze3t{padding-left:var(--ds-space-0,0)}
4
+ ._1bah1h6o{justify-content:center}
5
+ ._1bsb1tcg{width:24px}
6
+ ._1e0c1txw{display:flex}
7
+ ._1o9zidpf{flex-shrink:0}
8
+ ._4cvr1h6o{align-items:center}
9
+ ._4t3i1tcg{height:24px}
10
+ ._80omtlke{cursor:pointer}
11
+ ._ca0qze3t{padding-top:var(--ds-space-0,0)}
12
+ ._i0dl1wug{flex-basis:auto}
13
+ ._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
14
+ ._o5721q9c{white-space:nowrap}
15
+ ._u5f3ze3t{padding-right:var(--ds-space-0,0)}