@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
@@ -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)}
@@ -1,22 +1,16 @@
1
- import React, { memo } from 'react';
1
+ /* dismiss-button.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./dismiss-button.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import { memo } from 'react';
2
6
  import CloseIcon from '@atlaskit/icon/core/migration/close--cross';
3
7
  import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down--hipchat-chevron-down';
4
8
  import ChevronUpIcon from '@atlaskit/icon/utility/migration/chevron-up--hipchat-chevron-up';
5
- import { Pressable, xcss } from '@atlaskit/primitives';
9
+ import { Pressable } from '@atlaskit/primitives/compiled';
6
10
  import { flagTextColorToken } from '../theme';
7
- const buttonStyles = xcss({
8
- display: 'flex',
9
- width: '24px',
10
- height: '24px',
11
- padding: 'space.0',
12
- alignItems: 'center',
13
- justifyContent: 'center',
14
- flex: '0 0 auto',
15
- background: 'none',
16
- borderStyle: 'none',
17
- cursor: 'pointer',
18
- whiteSpace: 'nowrap'
19
- });
11
+ const styles = {
12
+ button: "_16jlidpf _1o9zidpf _i0dl1wug _1dqoglyw _1e0c1txw _1bsb1tcg _4t3i1tcg _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _4cvr1h6o _1bah1h6o _80omtlke _o5721q9c"
13
+ };
20
14
  const DismissButtonComponent = ({
21
15
  appearance,
22
16
  onClick,
@@ -35,8 +29,13 @@ const DismissButtonComponent = ({
35
29
  buttonTestId = testId && `${testId}-toggle`;
36
30
  }
37
31
  return /*#__PURE__*/React.createElement(Pressable, {
38
- xcss: buttonStyles,
39
- onClick: onClick,
32
+ xcss: styles.button,
33
+ onClick: onClick
34
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
35
+ ,
36
+ style: {
37
+ background: 'none'
38
+ },
40
39
  "aria-expanded": isBold ? isExpanded : undefined,
41
40
  testId: buttonTestId,
42
41
  "aria-label": buttonLabel
@@ -0,0 +1,2 @@
1
+
2
+ ._v5641xzp{transition:max-height .3s}._1bsb1osq{width:100%}
@@ -1,13 +1,14 @@
1
+ /* expander.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import { xcss, Stack, Box } from '@atlaskit/primitives';
3
+ import "./expander.compiled.css";
4
+ import * as React from 'react';
5
+ import { ax, ix } from "@compiled/react/runtime";
4
6
  import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
5
- const expanderStyles = xcss({
6
- width: '100%'
7
- });
8
- const containerStyles = xcss({
9
- transition: `max-height 0.3s`
10
- });
7
+ import { Box, Stack } from '@atlaskit/primitives/compiled';
8
+ const styles = {
9
+ expander: "_1bsb1osq",
10
+ container: "_v5641xzp"
11
+ };
11
12
  const Expander = ({
12
13
  children,
13
14
  isExpanded,
@@ -18,7 +19,7 @@ const Expander = ({
18
19
  // the the reveal because we don't know the height of the content.
19
20
 
20
21
  return /*#__PURE__*/React.createElement(Box, {
21
- xcss: containerStyles,
22
+ xcss: styles.expander,
22
23
  style: {
23
24
  maxHeight: isExpanded ? 150 : 0,
24
25
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
@@ -31,7 +32,7 @@ const Expander = ({
31
32
  }, /*#__PURE__*/React.createElement(ExitingPersistence, {
32
33
  appear: true
33
34
  }, isExpanded && /*#__PURE__*/React.createElement(FadeIn, null, props => /*#__PURE__*/React.createElement(Box, _extends({
34
- xcss: expanderStyles
35
+ xcss: styles.container
35
36
  }, props), /*#__PURE__*/React.createElement(Stack, {
36
37
  space: "space.100"
37
38
  }, children)))));
@@ -5,7 +5,7 @@ import noop from '@atlaskit/ds-lib/noop';
5
5
  import Flag from './flag';
6
6
  import { useFlagGroup } from './flag-group';
7
7
  var packageName = "@atlaskit/flag";
8
- var packageVersion = "16.2.0";
8
+ var packageVersion = "17.0.0";
9
9
  export var AUTO_DISMISS_SECONDS = 8;
10
10
 
11
11
  /**
@@ -1,5 +1 @@
1
- export var DEFAULT_APPEARANCE = 'normal';
2
- export var VAR_COLOR = '--color';
3
- export var VAR_BG_COLOR = '--bg-color';
4
- export var VAR_BG_COLOR_HOVER = '--bg-color-hover';
5
- export var VAR_BG_COLOR_ACTIVE = '--bg-color-active';
1
+ export var 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,55 +1,19 @@
1
+ /* flag-actions.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import "./flag-actions.compiled.css";
4
+ import * as React from 'react';
5
+ import { ax, ix } from "@compiled/react/runtime";
6
+ 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; }
7
+ 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) { _defineProperty(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; }
2
8
  /* eslint-disable @atlaskit/design-system/no-nested-styles */
3
- /**
4
- * @jsxRuntime classic
5
- * @jsx jsx
6
- */
7
9
 
8
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
- import { css, jsx } from '@emotion/react';
10
10
  import Button from '@atlaskit/button/custom-theme-button';
11
- import Inline from '@atlaskit/primitives/inline';
12
- import { DEFAULT_APPEARANCE, VAR_BG_COLOR, VAR_BG_COLOR_ACTIVE, VAR_BG_COLOR_HOVER, VAR_COLOR } from './constants';
11
+ import { Inline } from '@atlaskit/primitives/compiled';
12
+ import { DEFAULT_APPEARANCE } from './constants';
13
13
  import { actionBackgroundColor, actionTextColor } from './theme';
14
- var buttonStyles = css({
15
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
16
- '&&, a&&': {
17
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
18
- padding: "0 ".concat("var(--ds-space-100, 8px)", " !important"),
19
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
20
- background: "var(".concat(VAR_BG_COLOR, ")"),
21
- // 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
22
- color: "var(".concat(VAR_COLOR, ") !important"),
23
- fontWeight: "var(--ds-font-weight-medium, 500)"
24
- },
25
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
26
- '&&:hover, &&:active, a&&:hover, a&&:active': {
27
- textDecoration: 'underline'
28
- },
29
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
30
- '&&:hover': {
31
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
32
- backgroundColor: "var(".concat(VAR_BG_COLOR_HOVER, ")")
33
- },
34
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
35
- '&&:active': {
36
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
37
- backgroundColor: "var(".concat(VAR_BG_COLOR_ACTIVE, ")")
38
- }
39
- });
40
- var appearanceNormalButtonStyles = css({
41
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
42
- '&&, a&&': {
43
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
44
- padding: '0 !important'
45
- }
46
- });
47
- var appearanceNormalActionsContainerStyles = css({
48
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
49
- '&&, a&&': {
50
- transform: 'translateX(-2px)'
51
- }
52
- });
14
+ var buttonStyles = null;
15
+ var appearanceNormalButtonStyles = null;
16
+ var appearanceNormalActionsContainerStyles = null;
53
17
  var FlagActions = function FlagActions(props) {
54
18
  var _props$appearance = props.appearance,
55
19
  appearance = _props$appearance === void 0 ? DEFAULT_APPEARANCE : _props$appearance,
@@ -61,16 +25,16 @@ var FlagActions = function FlagActions(props) {
61
25
  return null;
62
26
  }
63
27
  var isBold = appearance !== DEFAULT_APPEARANCE;
64
- return jsx("span", {
65
- css: !isBold && appearanceNormalActionsContainerStyles
66
- }, jsx(Inline, {
28
+ return /*#__PURE__*/React.createElement("span", {
29
+ className: ax([!isBold && "_1g4l107e _y8dn107e"])
30
+ }, /*#__PURE__*/React.createElement(Inline, {
67
31
  space: "space.100",
68
32
  shouldWrap: true,
69
33
  alignBlock: "center",
70
34
  separator: isBold ? undefined : '·',
71
35
  testId: testId && "".concat(testId, "-actions")
72
36
  }, actions.map(function (action, index) {
73
- return jsx(Button, {
37
+ return /*#__PURE__*/React.createElement(Button, {
74
38
  onClick: action.onClick,
75
39
  href: action.href,
76
40
  target: action.target,
@@ -79,10 +43,20 @@ var FlagActions = function FlagActions(props) {
79
43
  spacing: "compact",
80
44
  testId: action.testId,
81
45
  key: index,
82
- style: _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, VAR_COLOR, actionTextColor[appearance]), VAR_BG_COLOR, actionBackgroundColor[appearance].default), VAR_BG_COLOR_HOVER, actionBackgroundColor[appearance].pressed), VAR_BG_COLOR_ACTIVE, actionBackgroundColor[appearance].active)
83
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
84
- ,
85
- css: [buttonStyles, appearance === DEFAULT_APPEARANCE && appearanceNormalButtonStyles]
46
+ className: 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 === DEFAULT_APPEARANCE && "_1dltgrf3 _h03xgrf3 _w8sqgrf3 _1iysgrf3 _fjwrgrf3 _cwkngrf3 _1yxxgrf3 _z7cdgrf3"]),
47
+ style: _objectSpread(_objectSpread({}, {
48
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
49
+ '--color': actionTextColor[appearance],
50
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
51
+ '--bg-color': actionBackgroundColor[appearance].default,
52
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
53
+ '--bg-color-hover': actionBackgroundColor[appearance].pressed,
54
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
55
+ '--bg-color-active': actionBackgroundColor[appearance].active
56
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
57
+ }), {}, {
58
+ "--_zkfc5e": ix("var(--ds-space-100, 8px)".concat(" !important"))
59
+ })
86
60
  }, action.content);
87
61
  })));
88
62
  };
@@ -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,21 +1,16 @@
1
+ /* flag-group.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _typeof from "@babel/runtime/helpers/typeof";
2
- /**
3
- * @jsxRuntime classic
4
- * @jsx jsx
5
- */
6
-
3
+ import "./flag-group.compiled.css";
4
+ import * as React from 'react';
5
+ import { ax, ix } from "@compiled/react/runtime";
7
6
  import { Children, createContext, useContext, useMemo } from 'react';
8
-
9
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
- import { css, jsx } from '@emotion/react';
11
7
  import noop from '@atlaskit/ds-lib/noop';
12
- import { durations, exitingDurations, ExitingPersistence, SlideIn } from '@atlaskit/motion';
8
+ import { ExitingPersistence, SlideIn } from '@atlaskit/motion';
13
9
  import Portal from '@atlaskit/portal';
14
10
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
15
- import { gridSize as getGridSize, layers } from '@atlaskit/theme/constants';
11
+ import { layers } from '@atlaskit/theme/constants';
16
12
  import VisuallyHidden from '@atlaskit/visually-hidden';
17
- var gridSize = getGridSize();
18
- export var flagWidth = gridSize * 50;
13
+ export var flagWidth = 400;
19
14
  var defaultFlagGroupContext = {
20
15
  onDismissed: noop,
21
16
  isDismissAllowed: false
@@ -31,65 +26,18 @@ export function useFlagGroup() {
31
26
 
32
27
  // transition: none is set on first-of-type to prevent a bug in Firefox
33
28
  // that causes a broken transition
34
- var baseStyles = css({
35
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
36
- width: flagWidth,
37
- position: 'absolute',
38
- insetBlockEnd: 0,
39
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
40
- transition: "transform ".concat(durations.medium, "ms ease-in-out"),
41
- // TODO: Use new breakpoints
42
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
43
- '@media (max-width: 560px)': {
44
- width: '100vw'
45
- },
46
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
47
- ':first-of-type': {
48
- transform: "translate(0,0)",
49
- transition: 'none'
50
- },
51
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
52
- ':nth-of-type(n + 2)': {
53
- animationDuration: '0ms',
54
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
55
- transform: "translateX(0) translateY(100%) translateY(".concat(2 * gridSize, "px)")
56
- },
57
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
58
- ':nth-of-type(1)': {
59
- zIndex: 5
60
- },
61
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
62
- ':nth-of-type(2)': {
63
- zIndex: 4
64
- },
65
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
66
- '&:nth-of-type(n + 4)': {
67
- visibility: 'hidden'
68
- }
69
- });
29
+ var groupStyles = {
30
+ root: "_v5641b8g _1bsb1kdj _kqswstnw _u7coidpf _1eqkauwl",
31
+ first: "_v564glyw _t9ec1ygq _1pbyqfx8",
32
+ second: "_1pbyegat",
33
+ nth: "_5sag5cps _t9ec1hw2",
34
+ hidden: "_3um015vq"
35
+ };
70
36
 
71
37
  // Transform needed to push up while 1st flag is leaving
72
38
  // Exiting time should match the exiting time of motion so is halved
73
- var dismissAllowedStyles = css({
74
- // 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
75
- '&& + *': {
76
- transform: "translate(0, 0)",
77
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
78
- transitionDuration: "".concat(exitingDurations.medium, "ms")
79
- }
80
- });
81
- var flagGroupContainerStyles = css({
82
- position: 'fixed',
83
- zIndex: 'flag',
84
- insetBlockEnd: "var(--ds-space-600, 48px)",
85
- insetInlineStart: "var(--ds-space-1000, 80px)",
86
- // TODO: Use new breakpoints
87
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
88
- '@media (max-width: 560px)': {
89
- insetBlockEnd: 0,
90
- insetInlineStart: 0
91
- }
92
- });
39
+ var dismissAllowedStyles = null;
40
+ var flagGroupContainerStyles = null;
93
41
 
94
42
  /**
95
43
  * __Flag group__
@@ -120,7 +68,7 @@ var FlagGroup = function FlagGroup(props) {
120
68
  var renderChildren = function renderChildren() {
121
69
  return children && _typeof(children) === 'object' ? Children.map(children, function (flag, index) {
122
70
  var isDismissAllowed = index === 0;
123
- return jsx(SlideIn, {
71
+ return /*#__PURE__*/React.createElement(SlideIn, {
124
72
  enterFrom: "left",
125
73
  fade: "inout",
126
74
  duration: "medium",
@@ -128,13 +76,11 @@ var FlagGroup = function FlagGroup(props) {
128
76
  }, function (_ref) {
129
77
  var className = _ref.className,
130
78
  ref = _ref.ref;
131
- return jsx("div", {
132
- css: [baseStyles, isDismissAllowed && dismissAllowedStyles]
79
+ return /*#__PURE__*/React.createElement("div", {
133
80
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
134
- ,
135
- className: className,
81
+ className: ax([groupStyles.root, index === 0 && groupStyles.first, index === 1 && groupStyles.second, index >= 1 && groupStyles.nth, index >= 2 && groupStyles.hidden, isDismissAllowed && "_12a7luct", className]),
136
82
  ref: ref
137
- }, jsx(FlagGroupContext.Provider, {
83
+ }, /*#__PURE__*/React.createElement(FlagGroupContext.Provider, {
138
84
  value:
139
85
  // Only the first flag should be able to be dismissed.
140
86
  isDismissAllowed ? dismissFlagContext : defaultFlagGroupContext
@@ -142,13 +88,13 @@ var FlagGroup = function FlagGroup(props) {
142
88
  });
143
89
  }) : false;
144
90
  };
145
- var flags = jsx("div", {
91
+ var flags = /*#__PURE__*/React.createElement("div", {
146
92
  id: id,
147
- css: flagGroupContainerStyles
148
- }, hasFlags ? jsx(VisuallyHidden, null, jsx(LabelTag, null, label)) : null, jsx(ExitingPersistence, {
93
+ className: ax(["_kqsw1n9t _1pbyxejw _u7cooahv _1e021epz _1iafidpf _il0widpf"])
94
+ }, hasFlags ? /*#__PURE__*/React.createElement(VisuallyHidden, null, /*#__PURE__*/React.createElement(LabelTag, null, label)) : null, /*#__PURE__*/React.createElement(ExitingPersistence, {
149
95
  appear: false
150
96
  }, renderChildren()));
151
- return shouldRenderToParent ? flags : jsx(Portal, {
97
+ return shouldRenderToParent ? flags : /*#__PURE__*/React.createElement(Portal, {
152
98
  zIndex: layers.flag()
153
99
  }, flags);
154
100
  };
@@ -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/esm/flag.js CHANGED
@@ -1,74 +1,39 @@
1
+ /* flag.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
4
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
+ import "./flag.compiled.css";
6
+ import * as React from 'react';
7
+ import { ax, ix } from "@compiled/react/runtime";
4
8
  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; }
5
9
  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) { _defineProperty(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; }
6
- /**
7
- * @jsxRuntime classic
8
- * @jsx jsx
9
- */
10
10
  import { useCallback, useEffect, useState } from 'react';
11
-
12
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
13
- import { css, jsx } from '@emotion/react';
14
11
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
15
12
  import noop from '@atlaskit/ds-lib/noop';
16
13
  import Heading from '@atlaskit/heading';
17
14
  import { fg } from '@atlaskit/platform-feature-flags';
18
- import { Box, Inline, Stack, xcss } from '@atlaskit/primitives';
15
+ import { Box, Inline, Stack } from '@atlaskit/primitives/compiled';
19
16
  import VisuallyHidden from '@atlaskit/visually-hidden';
20
17
  import { DEFAULT_APPEARANCE } from './constants';
21
18
  import Actions from './flag-actions';
22
19
  import { useFlagGroup } from './flag-group';
23
20
  import { DismissButton, Expander } from './internal';
24
21
  import { flagBackgroundColor, flagIconColor, flagIconGlyph, flagTextColor, flagTextColorToken } from './theme';
22
+ var styles = {
23
+ overflowWrap: "_1i4qfg65",
24
+ flag: "_2rkosqtm _1reo15vq _18m915vq _v564z97a _16qs8sq4 _1pbyni7l _1bsb1osq"
25
+ };
25
26
  var CSS_VAR_ICON_COLOR = '--flag-icon-color';
26
-
27
- // For cases where a single word is longer than the container (e.g. filenames)
28
- var overflowWrapStyles = xcss({
29
- overflowWrap: 'anywhere'
30
- });
31
- var descriptionStyles = css({
32
- maxHeight: 100,
33
- // height is defined as 5 lines maximum by design
34
- overflow: 'auto',
35
- overflowWrap: 'anywhere' // For cases where a single word is longer than the container (e.g. filenames)
36
- });
37
- var oldIconWrapperStyles = css({
38
- display: 'flex',
39
- alignItems: 'start',
40
- flexShrink: 0,
41
- color: "var(".concat(CSS_VAR_ICON_COLOR, ")")
42
- });
43
- var iconWrapperStyles = css({
44
- display: 'flex',
45
- minWidth: '24px',
46
- minHeight: '24px',
47
- alignItems: 'center',
48
- justifyContent: 'center',
49
- flexShrink: 0,
50
- color: "var(".concat(CSS_VAR_ICON_COLOR, ")")
51
- });
52
- var flagStyles = xcss({
53
- boxShadow: 'elevation.shadow.overlay',
54
- borderRadius: 'border.radius.100',
55
- overflow: 'hidden',
56
- zIndex: 'flag',
57
- width: '100%',
58
- transition: 'background-color 200ms'
59
- });
60
- var flagWrapperStyles = css({
61
- width: '100%'
62
- });
27
+ var descriptionStyles = null;
28
+ var oldIconWrapperStyles = null;
29
+ var iconWrapperStyles = null;
30
+ var flagWrapperStyles = null;
63
31
  var analyticsAttributes = {
64
32
  componentName: 'flag',
65
33
  packageName: "@atlaskit/flag",
66
- packageVersion: "16.2.0"
34
+ packageVersion: "17.0.0"
67
35
  };
68
- var transitionStyles = css({
69
- flexGrow: 1,
70
- transition: "gap 0.3s"
71
- });
36
+ var transitionStyles = null;
72
37
 
73
38
  /**
74
39
  * __Flag__
@@ -170,62 +135,63 @@ var Flag = function Flag(props) {
170
135
  var isDismissable = isBold || isDismissAllowed;
171
136
  var shouldRenderGap = !isBold && (description || actions.length) || isExpanded;
172
137
  // when delayAnnouncement is available we will use a hidden content for announcement
173
- var delayedAnnouncement = delayAnnouncement ? jsx(VisuallyHidden, null, title, description) : undefined;
174
- return jsx("div", _extends({
138
+ var delayedAnnouncement = delayAnnouncement ? /*#__PURE__*/React.createElement(VisuallyHidden, null, title, description) : undefined;
139
+ return /*#__PURE__*/React.createElement("div", _extends({
175
140
  role: "alert",
176
- css: flagWrapperStyles,
177
141
  "data-testid": testId
178
- }, autoDismissProps), jsx(Box, {
179
- backgroundColor: flagBackgroundColor[appearance],
142
+ }, autoDismissProps, {
143
+ className: ax(["_1bsb1osq"])
144
+ }), /*#__PURE__*/React.createElement(Box, {
180
145
  padding: "space.200",
181
- xcss: flagStyles
182
- }, jsx(Inline, {
146
+ backgroundColor: flagBackgroundColor[appearance],
147
+ xcss: styles.flag
148
+ }, /*#__PURE__*/React.createElement(Inline, {
183
149
  alignBlock: fg('platform_ads_component_no_icon_spacing_support') ? 'start' : 'stretch',
184
150
  space: "space.200"
185
- }, jsx("div", {
186
- css: fg('platform_ads_component_no_icon_spacing_support') ? iconWrapperStyles : oldIconWrapperStyles
187
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
188
- ,
189
- style: _defineProperty({}, CSS_VAR_ICON_COLOR, iconColor),
190
- "data-testid": testId && "".concat(testId, "-icon-container")
191
- }, icon || (iconGlyph && fg('platform_ads_component_no_icon_spacing_support') ? iconGlyph : null)), jsx("span", {
192
- css: transitionStyles
193
- }, jsx(Stack, {
151
+ }, /*#__PURE__*/React.createElement("div", {
152
+ "data-testid": testId && "".concat(testId, "-icon-container"),
153
+ className: ax([fg('platform_ads_component_no_icon_spacing_support') ? "_1e0c1txw _1ul91tcg _1tke1tcg _4cvr1h6o _1bah1h6o _1o9zidpf _syaz16r9" : "_1e0c1txw _4cvrv2br _1o9zidpf _syaz16r9"]),
154
+ style: _objectSpread(_objectSpread({}, _defineProperty({}, CSS_VAR_ICON_COLOR, iconColor)), {}, {
155
+ "--_11v68d2": ix("var(".concat(CSS_VAR_ICON_COLOR, ")"))
156
+ })
157
+ }, icon || (iconGlyph && fg('platform_ads_component_no_icon_spacing_support') ? iconGlyph : null)), /*#__PURE__*/React.createElement("span", {
158
+ className: ax(["_v5641hdc _16jlkb7n"])
159
+ }, /*#__PURE__*/React.createElement(Stack, {
194
160
  space: shouldRenderGap ? 'space.100' : 'space.0' // Gap exists even when not expanded due to Expander internals always being in the DOM
195
- }, isDelayToAnnounce && delayedAnnouncement, jsx(Inline, {
161
+ }, isDelayToAnnounce && delayedAnnouncement, /*#__PURE__*/React.createElement(Inline, {
196
162
  alignBlock: "stretch",
197
163
  space: "space.100",
198
164
  spread: "space-between"
199
- }, jsx(Box, {
165
+ }, /*#__PURE__*/React.createElement(Box, {
200
166
  paddingBlockStart: "space.050",
201
167
  paddingBlockEnd: "space.025",
202
- xcss: overflowWrapStyles
203
- }, jsx(Heading, {
168
+ xcss: styles.overflowWrap
169
+ }, /*#__PURE__*/React.createElement(Heading, {
204
170
  as: "h".concat(headingLevel),
205
171
  size: "xsmall",
206
172
  color: textColor
207
- }, jsx("span", {
173
+ }, /*#__PURE__*/React.createElement("span", {
208
174
  /* if isDelayToAnnounce is true, we will hide the content form screen reader to avoid duplicate announcement */
209
175
  "aria-hidden": isDelayToAnnounce
210
- }, title))), isDismissable ? !(isBold && !description && !actions.length) && jsx(DismissButton, {
176
+ }, title))), isDismissable ? !(isBold && !description && !actions.length) && /*#__PURE__*/React.createElement(DismissButton, {
211
177
  testId: testId,
212
178
  appearance: appearance,
213
179
  isBold: isBold,
214
180
  isExpanded: isExpanded,
215
181
  onClick: isBold ? toggleExpand : buttonActionCallback
216
- }) : null), jsx(Expander, {
182
+ }) : null), /*#__PURE__*/React.createElement(Expander, {
217
183
  isExpanded: !isBold || isExpanded,
218
184
  testId: testId
219
- }, description && jsx("div", {
185
+ }, description && /*#__PURE__*/React.createElement("div", {
220
186
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
221
187
  style: {
222
188
  color: flagTextColorToken[appearance]
223
189
  },
224
- css: descriptionStyles,
225
190
  "data-testid": testId && "".concat(testId, "-description")
226
191
  /* if isDelayToAnnounce is true, we will hide the content form screen reader to avoid duplicate announcement */,
227
- "aria-hidden": isDelayToAnnounce
228
- }, description), jsx(Actions, {
192
+ "aria-hidden": isDelayToAnnounce,
193
+ className: ax(["_1reo1wug _18m91wug _c71l53f4 _1i4qfg65"])
194
+ }, description), /*#__PURE__*/React.createElement(Actions, {
229
195
  actions: actions,
230
196
  appearance: appearance,
231
197
  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)}