@atlaskit/lozenge 13.4.1 → 13.4.3

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.
@@ -1,4 +1,5 @@
1
1
  /* lozenge-dropdown-trigger.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
2
3
  import * as React from 'react';
3
4
  import { ax, ix } from "@compiled/react/runtime";
4
5
  import { forwardRef, memo } from 'react';
@@ -22,28 +23,35 @@ const LozengeDropdownTrigger = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
22
23
  appearance = 'neutral',
23
24
  spacing = 'default',
24
25
  iconBefore,
26
+ trailingMetric,
27
+ trailingMetricAppearance,
25
28
  isSelected = false,
29
+ isLoading = false,
26
30
  maxWidth = 200,
27
31
  onClick = __noop,
28
32
  style,
29
33
  analyticsContext,
30
34
  interactionName
31
35
  }, ref) => {
32
- return /*#__PURE__*/React.createElement(LozengeBase, {
33
- ref: ref,
34
- appearance: appearance,
35
- spacing: spacing,
36
- iconBefore: iconBefore,
37
- isSelected: isSelected,
38
- maxWidth: maxWidth
39
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
40
- ,
41
- style: style,
42
- testId: testId,
43
- onClick: onClick,
44
- analyticsContext: analyticsContext,
45
- interactionName: interactionName
46
- }, children);
36
+ const baseProps = {
37
+ appearance,
38
+ spacing,
39
+ iconBefore,
40
+ trailingMetric,
41
+ trailingMetricAppearance,
42
+ isSelected,
43
+ isLoading,
44
+ maxWidth,
45
+ style,
46
+ testId,
47
+ onClick,
48
+ analyticsContext,
49
+ interactionName,
50
+ children
51
+ };
52
+ return /*#__PURE__*/React.createElement(LozengeBase, _extends({
53
+ ref: ref
54
+ }, baseProps), children);
47
55
  }));
48
56
  LozengeDropdownTrigger.displayName = 'LozengeDropdownTrigger';
49
57
  export default LozengeDropdownTrigger;
@@ -18,18 +18,22 @@ const Lozenge = ({
18
18
  style,
19
19
  testId,
20
20
  children,
21
- iconBefore
21
+ iconBefore,
22
+ trailingMetric,
23
+ trailingMetricAppearance
22
24
  }) => {
23
- return /*#__PURE__*/React.createElement(LozengeBase, {
24
- appearance: appearance,
25
- spacing: spacing,
26
- iconBefore: iconBefore,
27
- maxWidth: maxWidth
28
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
29
- ,
30
- style: style,
31
- testId: testId
32
- }, children);
25
+ const baseProps = {
26
+ appearance,
27
+ spacing,
28
+ iconBefore,
29
+ trailingMetric,
30
+ trailingMetricAppearance,
31
+ maxWidth,
32
+ style,
33
+ testId,
34
+ children
35
+ };
36
+ return /*#__PURE__*/React.createElement(LozengeBase, baseProps, children);
33
37
  };
34
38
  Lozenge.displayName = 'Lozenge';
35
39
  export default Lozenge;
@@ -6,17 +6,15 @@
6
6
  ._zulp12x7{gap:var(--ds-space-075,6px)}
7
7
  ._zulp1b66{gap:var(--ds-space-050,4px)}
8
8
  ._189ee4h9{border-width:var(--ds-border-width,1px)}
9
- ._18zr1b66{padding-inline:var(--ds-space-050,4px)}
10
- ._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
11
9
  ._1dqonqa1{border-style:solid}
12
10
  ._1h6d1j28{border-color:transparent}
13
- ._1h6dzs9d{border-color:color-mix(in oklch,var(--border-color) 100%,var(--cm-border-color) var(--cm-border-value))!important}
14
- ._1rjc1b66{padding-block:var(--ds-space-050,4px)}
15
- ._1rjcv77o{padding-block:var(--ds-space-025,2px)}._111i1h4e{--icon-pressed-l-factor:0.7}
11
+ ._1h6dzs9d{border-color:color-mix(in oklch,var(--border-color) 100%,var(--cm-border-color) var(--cm-border-value))!important}._111i1h4e{--icon-pressed-l-factor:0.7}
16
12
  ._13muu67f{--cm-border-color:#fff}
13
+ ._152tze3t{inset-block-start:var(--ds-space-0,0)}
17
14
  ._168qx19p{--cm-icon-value:20%}
18
15
  ._18dicjiy{--border-hovered-l-factor:1.2}
19
16
  ._18m915vq{overflow-y:hidden}
17
+ ._1axm1bqy:active [data-lozenge-metric-wrapper]>span:first-of-type{background-color:var(--badge-background-color-pressed)}
20
18
  ._1b3i17hp{--icon-color:var(--ds-icon-accent-green,#22a06b)}
21
19
  ._1b3i1cv2{--icon-color:var(--ds-icon-subtlest,#6b6e76)}
22
20
  ._1b3i1diz{--icon-color:var(--ds-icon-accent-gray,#7d818a)}
@@ -33,12 +31,25 @@
33
31
  ._1b3iuq3u{--icon-color:var(--ds-icon-accent-purple,#af59e1)}
34
32
  ._1b3iv8hk{--icon-color:var(--ds-icon-accent-magenta,#cd519d)}
35
33
  ._1b3iyhbg{--icon-color:var(--ds-icon-information,#357de8)}
34
+ ._1bah1h6o{justify-content:center}
35
+ ._1bn814je{--badge-background-color:#b7b9be}
36
+ ._1bn85usi{--badge-background-color:var(--ds-background-discovery-subtler-pressed,#d8a0f7)}
37
+ ._1bn8ar1y{--badge-background-color:var(--ds-background-information-subtler-pressed,#8fb8f6)}
38
+ ._1bn8bkku{--badge-background-color:var(--ds-background-warning-subtler-pressed,#fbc828)}
39
+ ._1bn8d6jc{--badge-background-color:var(--ds-background-success-subtler-pressed,#b3df72)}
40
+ ._1bn8jkmi{--badge-background-color:var(--ds-background-danger-subtler-pressed,#fd9891)}
41
+ ._1bn8vuon{--badge-background-color:var(--ds-surface,#fff)}
36
42
  ._1bto1l2s{text-overflow:ellipsis}
37
43
  ._1cp21w66:hover>span:first-of-type>svg{color:color-mix(in oklch,var(--icon-color) 100%,var(--cm-icon-color) var(--cm-icon-hovered-value))}
44
+ ._1e02ze3t{inset-inline-start:var(--ds-space-0,0)}
38
45
  ._1e0c116y{display:inline-flex}
46
+ ._1e0c1txw{display:flex}
47
+ ._1ftrbpke [data-lozenge-metric-wrapper]>span:first-of-type{background-color:var(--badge-background-color)}
39
48
  ._1gqs1mvc:active>span:first-of-type>svg{color:color-mix(in oklch,var(--icon-color) 100%,var(--cm-icon-color) var(--cm-icon-pressed-value))}
40
49
  ._1iel6xdd{--icon-hovered-l-factor:0.8}
41
50
  ._1k671038{--border-l-factor:1.33}
51
+ ._1q511b66{padding-block-start:var(--ds-space-050,4px)}
52
+ ._1q51v77o{padding-block-start:var(--ds-space-025,2px)}
42
53
  ._1reo15vq{overflow-x:hidden}
43
54
  ._1tkeviql{min-height:2rem}
44
55
  ._1xe213kw>span:first-of-type>svg{color:oklch(from var(--icon-color) calc(l * var(--icon-pressed-l-factor)) c h)!important}
@@ -60,10 +71,18 @@
60
71
  ._3wu0v30g{--border-color:var(--ds-border-discovery,#af59e1)}
61
72
  ._3wu0vbh5{--border-color:var(--ds-border-information,#357de8)}
62
73
  ._46v5hwvj{--cm-icon-pressed-value:40%}
74
+ ._4ayg18vq{--badge-background-color-pressed:var(--ds-background-discovery-pressed,#e3bdfa)}
75
+ ._4ayg1c1j{--badge-background-color-pressed:var(--ds-background-information-pressed,#adcbfb)}
76
+ ._4ayg1fkg{--badge-background-color-pressed:#dddee1}
77
+ ._4ayg1r4b{--badge-background-color-pressed:var(--ds-background-danger-pressed,#ffb8b2)}
78
+ ._4ayg1wl5{--badge-background-color-pressed:var(--ds-background-success-pressed,#bde97c)}
79
+ ._4aygvuon{--badge-background-color-pressed:var(--ds-surface,#fff)}
80
+ ._4aygzr32{--badge-background-color-pressed:var(--ds-background-warning-pressed,#fbd779)}
63
81
  ._4cvr1h6o{align-items:center}
64
82
  ._4t3i1k92{height:1.25rem}
65
83
  ._4uq11yqs{--icon-l-factor:0.88}
66
- ._80omtlke{cursor:pointer}
84
+ ._85i51b66{padding-block-end:var(--ds-space-050,4px)}
85
+ ._85i5v77o{padding-block-end:var(--ds-space-025,2px)}
67
86
  ._bfhk10f4{background-color:var(--ds-background-warning-subtler,#fce4a6)}
68
87
  ._bfhk14j0{background-color:var(--ds-background-success-subtler,#d3f1a7)}
69
88
  ._bfhk165s{background-color:var(--ds-background-accent-orange-subtler,#fce4a6)}
@@ -81,12 +100,18 @@
81
100
  ._bfhkysee{background-color:var(--ds-background-accent-gray-subtlest,#f0f1f2)}
82
101
  ._bfhkz2ec{background-color:var(--ds-background-accent-lime-subtler,#d3f1a7)}
83
102
  ._bg3q9by0{--cm-border-pressed-value:10%}
103
+ ._bozg1b66{padding-inline-start:var(--ds-space-050,4px)}
104
+ ._bozgutpp{padding-inline-start:var(--ds-space-150,9pt)}
84
105
  ._fdt01r5k{--cm-icon-hovered-value:30%}
85
106
  ._hyog26zw{--border-pressed-l-factor:1.08}
86
107
  ._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
108
+ ._kqswh2mm{position:relative}
109
+ ._kqswstnw{position:absolute}
110
+ ._lcxvglyw{pointer-events:none}
87
111
  ._m71tr3uz{--cm-icon-color:#000}
88
112
  ._o5721q9c{white-space:nowrap}
89
113
  ._oe6mmko7{--cm-border-value:45%}
114
+ ._rjxpze3t{inset-inline-end:var(--ds-space-0,0)}
90
115
  ._syaz12v7{color:var(--ds-text-accent-teal-bolder,#164555)}
91
116
  ._syaz1blx{color:var(--ds-text-danger-bolder,#5d1f1a)}
92
117
  ._syaz1g72{color:var(--ds-text-discovery-bolder,#48245d)}
@@ -104,8 +129,14 @@
104
129
  ._syazhwvp{color:var(--ds-text-accent-red-bolder,#5d1f1a)}
105
130
  ._syazi7uo{color:var(--ds-text,#292a2e)}
106
131
  ._syazmgs1{color:var(--ds-text-warning-bolder,#693200)}
132
+ ._tzy4idpf{opacity:0}
133
+ ._u7coze3t{inset-block-end:var(--ds-space-0,0)}
107
134
  ._vchhusvi{box-sizing:border-box}
135
+ ._y4ti1b66{padding-inline-end:var(--ds-space-050,4px)}
136
+ ._y4ti303w{padding-inline-end:.0625rem}
137
+ ._y4tiutpp{padding-inline-end:var(--ds-space-150,9pt)}
108
138
  ._ylgq1r5k{--cm-border-hovered-value:30%}
139
+ [data-color-mode=dark] ._16burnys{--badge-background-color-pressed:#3d3f43}
109
140
  [data-color-mode=dark] ._189qkb7n{--icon-l-factor:1}
110
141
  [data-color-mode=dark] ._18mn783i{--icon-pressed-l-factor:1.37}
111
142
  [data-color-mode=dark] ._196p1btq{--icon-hovered-l-factor:1.15}
@@ -113,14 +144,11 @@
113
144
  [data-color-mode=dark] ._1t75u67f{--cm-icon-color:#fff}
114
145
  [data-color-mode=dark] ._aewt1n8h{--cm-icon-pressed-value:70%}
115
146
  [data-color-mode=dark] ._hg5mr3uz{--cm-border-color:#000}
147
+ [data-color-mode=dark] ._iymy8hz0{--badge-background-color:#4b4d51}
116
148
  [data-color-mode=dark] ._l0666xdd{--border-hovered-l-factor:0.8}
117
149
  [data-color-mode=dark] ._ockq1r5k{--cm-icon-hovered-value:30%}
118
150
  [data-color-mode=dark] ._pclnn8xv{--border-pressed-l-factor:0.9}
119
151
  [data-color-mode=dark] ._u8p61h4e{--border-l-factor:0.7}
120
- ._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
121
- ._1ah3v77o:focus-visible{outline-offset:var(--ds-space-025,2px)}
122
- ._mizu1v1w:focus-visible{outline-color:var(--ds-border-focused,#4688ec)}
123
- ._ra3xnqa1:focus-visible{outline-style:solid}
124
152
  ._4cvx7ddx:hover{border-color:color-mix(in oklch,var(--border-color) 100%,var(--cm-border-color) var(--cm-border-hovered-value))!important}
125
153
  ._irr315aw:hover{background-color:var(--ds-background-information-subtler-hovered,#adcbfb)}
126
154
  ._irr31axx:hover{background-color:var(--ds-background-accent-magenta-subtler-hovered,#fcb6e1)}
@@ -1,14 +1,17 @@
1
1
  /* lozenge-base.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
2
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
4
  import "./lozenge-base.compiled.css";
4
5
  import * as React from 'react';
5
6
  import { ax, ix } from "@compiled/react/runtime";
6
7
  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
8
  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; }
8
- import { forwardRef, Fragment, memo } from 'react';
9
+ import { forwardRef, memo } from 'react';
10
+ import Badge from '@atlaskit/badge';
9
11
  import { cx } from '@atlaskit/css';
10
12
  import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
11
13
  import Pressable from '@atlaskit/primitives/pressable';
14
+ import Spinner from '@atlaskit/spinner';
12
15
  import IconRenderer from './icon-renderer';
13
16
  import { getThemeStyles, resolveLozengeColor } from './utils';
14
17
  // Get the pressed background color for the selected lozenge dropdown trigger
@@ -31,12 +34,21 @@ var pressedBackgroundMapping = {
31
34
  'accent-gray': "var(--ds-background-accent-gray-subtlest-pressed, #B7B9BE)"
32
35
  };
33
36
  var styles = {
34
- container: "_2rko12b0 _1reo15vq _18m915vq _zulp1b66 _1rjcv77o _18zr1b66 _189ee4h9 _1dqonqa1 _1h6d1j28 _1e0c116y _4cvr1h6o _vchhusvi _4t3i1k92",
35
- containerSpacious: "_2rko1qi0 _zulp12x7 _1rjc1b66 _18zrutpp _1tkeviql",
36
- containerInteractive: "_80omtlke _mizu1v1w _1ah3v77o _ra3xnqa1 _128mdkaa",
37
+ container: "_2rko12b0 _1reo15vq _18m915vq _189ee4h9 _1dqonqa1 _1h6d1j28 _kqswh2mm _1e0c116y _4cvr1h6o _vchhusvi _4t3i1k92 _1q51v77o _85i5v77o _bozg1b66 _y4ti1b66",
38
+ containerSpacious: "_2rko1qi0 _1tkeviql _1q511b66 _85i51b66 _bozgutpp _y4tiutpp",
39
+ containerBadgePadding: "_y4ti303w",
37
40
  text: "_11c8wadc _1reo15vq _18m915vq _1bto1l2s _o5721q9c",
38
41
  textSpacious: "_11c8fhey _k48p1wq8",
39
42
  textSelected: "_syaz6x5g",
43
+ loadingOverlay: "_1reo15vq _18m915vq _1e0c1txw _kqswstnw _4cvr1h6o _1bah1h6o _u7coze3t _152tze3t _rjxpze3t _1e02ze3t _lcxvglyw",
44
+ metricBadgeWrapper: "_1e0c1txw",
45
+ 'metric.semantic.success': "_1bn8d6jc _4ayg1wl5",
46
+ 'metric.semantic.warning': "_1bn8bkku _4aygzr32",
47
+ 'metric.semantic.danger': "_1bn8jkmi _4ayg1r4b",
48
+ 'metric.semantic.information': "_1bn8ar1y _4ayg1c1j",
49
+ 'metric.semantic.neutral': "_1bn814je _4ayg1fkg _iymy8hz0 _16burnys",
50
+ 'metric.semantic.discovery': "_1bn85usi _4ayg18vq",
51
+ 'metric.inverse': "_1bn8vuon _4aygvuon",
40
52
  'semantic.success': "_1b3i4pcx _3wu01mps _bfhk14j0 _syaz1p1e",
41
53
  'semantic.warning': "_1b3iervl _3wu01xiv _bfhk10f4 _syazmgs1",
42
54
  'semantic.danger': "_1b3is4qr _3wu01bqt _bfhk18wg _syaz1blx",
@@ -71,7 +83,12 @@ var styles = {
71
83
  'interactive.accent.gray': "_irr3wejn _1di618ut",
72
84
  iconBorderFilter: "_1h6dzs9d _4uq11yqs _1k671038 _m71tr3uz _13muu67f _168qx19p _oe6mmko7 _189qkb7n _u8p61h4e _1t75u67f _hg5mr3uz _1f28f1ug _1xe213rw _1easxmrh _1r9r1ss3",
73
85
  iconBorderInteractiveFilter: "_1iel6xdd _111i1h4e _18dicjiy _hyog26zw _fdt01r5k _46v5hwvj _ylgq1r5k _bg3q9by0 _196p1btq _18mn783i _l0666xdd _pclnn8xv _ockq1r5k _aewt1n8h _4cvx7ddx _1cp21w66 _q4zt1csi _1gqs1mvc _75gv2l9f _1lh71sfd _ui3h1ct7 _11o31cha",
74
- containerSelected: "_1xe213kw"
86
+ containerSelected: "_1xe213kw",
87
+ content: "_zulp1b66 _1e0c116y _4cvr1h6o",
88
+ contentSpacious: "_zulp12x7",
89
+ loadingContent: "_tzy4idpf",
90
+ containerBadge: "_1ftrbpke",
91
+ containerBadgeInteractive: "_1axm1bqy"
75
92
  };
76
93
 
77
94
  /**
@@ -85,11 +102,15 @@ var LozengeBase = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref
85
102
  testId = _ref.testId,
86
103
  appearance = _ref.appearance,
87
104
  iconBefore = _ref.iconBefore,
105
+ trailingMetric = _ref.trailingMetric,
106
+ trailingMetricAppearance = _ref.trailingMetricAppearance,
88
107
  _ref$maxWidth = _ref.maxWidth,
89
108
  maxWidth = _ref$maxWidth === void 0 ? 200 : _ref$maxWidth,
90
109
  _ref$spacing = _ref.spacing,
91
110
  spacing = _ref$spacing === void 0 ? 'default' : _ref$spacing,
92
111
  isSelected = _ref.isSelected,
112
+ _ref$isLoading = _ref.isLoading,
113
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
93
114
  onClick = _ref.onClick,
94
115
  style = _ref.style,
95
116
  analyticsContext = _ref.analyticsContext,
@@ -105,11 +126,17 @@ var LozengeBase = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref
105
126
  var interactiveStyleKey = "interactive.".concat(category, ".").concat(key);
106
127
  var maxWidthValue = typeof maxWidth === 'string' ? maxWidth : "".concat(maxWidth, "px");
107
128
  var maxWidthIsPc = typeof maxWidth === 'string' && /%$/.test(maxWidth);
129
+ var resolvedTrailingMetricAppearance = trailingMetricAppearance ? trailingMetricAppearance === 'inverse' ? 'inverse' : resolveLozengeColor(trailingMetricAppearance) : resolvedColor;
130
+ var metricBadgeAppearance = resolvedTrailingMetricAppearance === 'inverse' ? 'inverse' : resolvedTrailingMetricAppearance != null && resolvedTrailingMetricAppearance.startsWith('accent-') ? 'neutral' : resolvedTrailingMetricAppearance !== null && resolvedTrailingMetricAppearance !== void 0 ? resolvedTrailingMetricAppearance : 'neutral';
131
+ var metricStyleKey = resolvedTrailingMetricAppearance === 'inverse' ? 'metric.inverse' : resolvedTrailingMetricAppearance != null && !resolvedTrailingMetricAppearance.startsWith('accent-') ? "metric.semantic.".concat(getThemeStyles(resolvedTrailingMetricAppearance).key) : 'metric.semantic.neutral';
108
132
  var commonStyleOverrides = {
109
133
  backgroundColor: style === null || style === void 0 ? void 0 : style.backgroundColor,
110
134
  maxWidth: maxWidthIsPc ? maxWidth : '100%'
111
135
  };
112
- var innerContent = /*#__PURE__*/React.createElement(Fragment, null, iconBefore && /*#__PURE__*/React.createElement(IconRenderer, {
136
+ var hasTrailingMetric = trailingMetric != null && trailingMetric !== '';
137
+ var innerContent = /*#__PURE__*/React.createElement("span", {
138
+ className: ax([styles.content, spacing === 'spacious' && styles.contentSpacious, isLoading && styles.loadingContent])
139
+ }, iconBefore && /*#__PURE__*/React.createElement(IconRenderer, {
113
140
  size: spacing === 'spacious' ? 'medium' : 'small',
114
141
  icon: iconBefore,
115
142
  color: resolvedColor,
@@ -121,34 +148,53 @@ var LozengeBase = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref
121
148
  },
122
149
  "data-testid": testId && "".concat(testId, "--text"),
123
150
  className: ax([styles.text, spacing === 'spacious' && styles.textSpacious])
124
- }, children), isInteractive && /*#__PURE__*/React.createElement(ChevronDownIcon, {
151
+ }, children), hasTrailingMetric && !resolvedColor.startsWith('accent-') && /*#__PURE__*/React.createElement("span", {
152
+ "data-lozenge-metric-wrapper": true,
153
+ "data-testid": testId && "".concat(testId, "--metric"),
154
+ className: ax([styles.metricBadgeWrapper])
155
+ }, /*#__PURE__*/React.createElement(Badge, {
156
+ appearance: metricBadgeAppearance
157
+ }, trailingMetric)), isInteractive && /*#__PURE__*/React.createElement(ChevronDownIcon, {
125
158
  label: "",
126
159
  size: "small",
127
160
  color: 'currentColor',
128
161
  testId: testId && "".concat(testId, "--chevron")
129
162
  }));
130
163
  if (isInteractive) {
131
- return /*#__PURE__*/React.createElement(Pressable, {
164
+ return /*#__PURE__*/React.createElement(Pressable, _extends({
132
165
  ref: ref,
133
- xcss: cx(styles.container, spacing === 'spacious' && styles.containerSpacious, !isSelected && styles.iconBorderFilter, styles.iconBorderInteractiveFilter, styles[colorStyleKey], styles[interactiveStyleKey], isSelected && styles.containerSelected),
134
- onClick: onClick,
166
+ xcss: cx(styles.container, spacing === 'spacious' && styles.containerSpacious, !isSelected && styles.iconBorderFilter, !isLoading && styles.iconBorderInteractiveFilter, styles[colorStyleKey], !isLoading && styles[interactiveStyleKey], isSelected && styles.containerSelected, hasTrailingMetric && styles.containerBadge, hasTrailingMetric && styles.containerBadgeInteractive, hasTrailingMetric && styles[metricStyleKey])
167
+ }, isLoading && {
168
+ 'aria-busy': true,
169
+ 'aria-disabled': true,
170
+ isDisabled: true
171
+ }, {
172
+ "aria-label": isLoading ? 'Loading' : undefined,
173
+ onClick: isLoading ? undefined : onClick,
135
174
  style: _objectSpread(_objectSpread({}, commonStyleOverrides), {}, {
136
175
  // Specified because Pressable has a default border:none which overrides the border specified on the container
137
176
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
138
177
  border: "solid ".concat("var(--ds-border-width, 1px)", " ", isSelected ? 'oklch(from var(--border-color) calc(l * var(--border-pressed-l-factor)) c h) !important' : 'transparent'),
139
- backgroundColor: isSelected ? pressedBackgroundMapping[resolvedColor] : undefined
178
+ backgroundColor: isSelected ? pressedBackgroundMapping[resolvedColor] : undefined,
179
+ cursor: isLoading ? 'progress' : 'pointer'
140
180
  }),
141
181
  testId: testId,
142
182
  analyticsContext: analyticsContext,
143
183
  interactionName: interactionName,
144
184
  componentName: "LozengeDropdownTrigger"
145
- }, innerContent);
185
+ }), innerContent, isLoading && /*#__PURE__*/React.createElement("span", {
186
+ className: ax([styles.loadingOverlay])
187
+ }, /*#__PURE__*/React.createElement(Spinner, {
188
+ size: spacing === 'spacious' ? 'small' : 'xsmall',
189
+ label: ", Loading",
190
+ testId: testId ? "".concat(testId, "--loading-spinner") : undefined
191
+ })));
146
192
  }
147
193
  return /*#__PURE__*/React.createElement("span", {
148
194
  ref: ref,
149
195
  style: commonStyleOverrides,
150
196
  "data-testid": testId,
151
- className: ax([styles.container, spacing === 'spacious' && styles.containerSpacious, styles[colorStyleKey], styles.iconBorderFilter])
197
+ className: ax([styles.container, spacing === 'spacious' && styles.containerSpacious, spacing !== 'spacious' && hasTrailingMetric && styles.containerBadgePadding, styles[colorStyleKey], hasTrailingMetric && styles[metricStyleKey], styles.iconBorderFilter, styles.containerBadge])
152
198
  }, innerContent);
153
199
  }));
154
200
  export default LozengeBase;
@@ -1,4 +1,5 @@
1
1
  /* lozenge-dropdown-trigger.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
2
3
  import * as React from 'react';
3
4
  import { ax, ix } from "@compiled/react/runtime";
4
5
  import { forwardRef, memo } from 'react';
@@ -24,8 +25,12 @@ var LozengeDropdownTrigger = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function
24
25
  _ref$spacing = _ref.spacing,
25
26
  spacing = _ref$spacing === void 0 ? 'default' : _ref$spacing,
26
27
  iconBefore = _ref.iconBefore,
28
+ trailingMetric = _ref.trailingMetric,
29
+ trailingMetricAppearance = _ref.trailingMetricAppearance,
27
30
  _ref$isSelected = _ref.isSelected,
28
31
  isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
32
+ _ref$isLoading = _ref.isLoading,
33
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
29
34
  _ref$maxWidth = _ref.maxWidth,
30
35
  maxWidth = _ref$maxWidth === void 0 ? 200 : _ref$maxWidth,
31
36
  _ref$onClick = _ref.onClick,
@@ -33,21 +38,25 @@ var LozengeDropdownTrigger = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function
33
38
  style = _ref.style,
34
39
  analyticsContext = _ref.analyticsContext,
35
40
  interactionName = _ref.interactionName;
36
- return /*#__PURE__*/React.createElement(LozengeBase, {
37
- ref: ref,
41
+ var baseProps = {
38
42
  appearance: appearance,
39
43
  spacing: spacing,
40
44
  iconBefore: iconBefore,
45
+ trailingMetric: trailingMetric,
46
+ trailingMetricAppearance: trailingMetricAppearance,
41
47
  isSelected: isSelected,
42
- maxWidth: maxWidth
43
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
44
- ,
48
+ isLoading: isLoading,
49
+ maxWidth: maxWidth,
45
50
  style: style,
46
51
  testId: testId,
47
52
  onClick: onClick,
48
53
  analyticsContext: analyticsContext,
49
- interactionName: interactionName
50
- }, children);
54
+ interactionName: interactionName,
55
+ children: children
56
+ };
57
+ return /*#__PURE__*/React.createElement(LozengeBase, _extends({
58
+ ref: ref
59
+ }, baseProps), children);
51
60
  }));
52
61
  LozengeDropdownTrigger.displayName = 'LozengeDropdownTrigger';
53
62
  export default LozengeDropdownTrigger;
@@ -21,17 +21,21 @@ var Lozenge = function Lozenge(_ref) {
21
21
  style = _ref.style,
22
22
  testId = _ref.testId,
23
23
  children = _ref.children,
24
- iconBefore = _ref.iconBefore;
25
- return /*#__PURE__*/React.createElement(LozengeBase, {
24
+ iconBefore = _ref.iconBefore,
25
+ trailingMetric = _ref.trailingMetric,
26
+ trailingMetricAppearance = _ref.trailingMetricAppearance;
27
+ var baseProps = {
26
28
  appearance: appearance,
27
29
  spacing: spacing,
28
30
  iconBefore: iconBefore,
29
- maxWidth: maxWidth
30
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
31
- ,
31
+ trailingMetric: trailingMetric,
32
+ trailingMetricAppearance: trailingMetricAppearance,
33
+ maxWidth: maxWidth,
32
34
  style: style,
33
- testId: testId
34
- }, children);
35
+ testId: testId,
36
+ children: children
37
+ };
38
+ return /*#__PURE__*/React.createElement(LozengeBase, baseProps, children);
35
39
  };
36
40
  Lozenge.displayName = 'Lozenge';
37
41
  export default Lozenge;
@@ -1,4 +1,4 @@
1
1
  export { default } from './lozenge';
2
2
  export type { ThemeAppearance, LozengeProps } from './lozenge';
3
3
  export { default as LozengeDropdownTrigger } from './new/lozenge-dropdown-trigger';
4
- export type { NewLozengeProps, LozengeColor as NewLozengeColor, LozengeDropdownTriggerProps, LozengeSpacing, } from './new/types';
4
+ export type { NewLozengeProps, LozengeColor as NewLozengeColor, LozengeDropdownTriggerProps, LozengeSpacing, SemanticColor, AccentColor, } from './new/types';
@@ -22,5 +22,5 @@ export interface IconRendererProps {
22
22
  * Icon renderer for lozenge components
23
23
  * Handles proper sizing and color theming for icons
24
24
  */
25
- export declare const IconRenderer: ({ icon: Icon, color, testId, size }: IconRendererProps) => React.JSX.Element;
25
+ export declare const IconRenderer: (props: IconRendererProps) => React.JSX.Element;
26
26
  export default IconRenderer;
@@ -1,12 +1,4 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { type Ref } from 'react';
6
- import { type LozengeDropdownTriggerProps, type NewLozengeProps } from './types';
7
- interface LozengeBaseProps extends NewLozengeProps, LozengeDropdownTriggerProps {
8
- ref?: Ref<HTMLElement | HTMLButtonElement>;
9
- }
1
+ import { type LozengeBaseProps } from './types';
10
2
  /**
11
3
  * __New Lozenge__
12
4
  *
@@ -22,12 +22,7 @@ export type IconProp = ComponentType<Omit<NewIconProps, 'spacing'>>;
22
22
  * Props for the NewLozenge component
23
23
  */
24
24
  export type LozengeSpacing = 'default' | 'spacious';
25
- export interface NewLozengeProps {
26
- /**
27
- * The appearance of the lozenge. Supports both legacy semantic appearances and new accent/semantic colors.
28
- * Legacy appearances (default, success, removed, inprogress, new, moved) are automatically mapped to the new semantic colors.
29
- */
30
- appearance?: ThemeAppearance | LozengeColor;
25
+ type NewLozengeBaseProps = {
31
26
  /**
32
27
  * Elements to be rendered inside the lozenge. This should ideally be just a word or two.
33
28
  */
@@ -62,15 +57,69 @@ export interface NewLozengeProps {
62
57
  * @deprecated This prop is deprecated and will be removed. Use Tag component for non-bold styles.
63
58
  */
64
59
  isBold?: boolean;
65
- }
60
+ };
61
+ type NewLozengeSemanticProps = NewLozengeBaseProps & {
62
+ /**
63
+ * The appearance of the lozenge. Supports legacy semantic appearances and new semantic colors.
64
+ */
65
+ appearance?: ThemeAppearance | SemanticColor;
66
+ /**
67
+ * Numeric metric displayed at the end of the lozenge as a badge.
68
+ */
69
+ trailingMetric?: string;
70
+ /**
71
+ * Overrides the appearance of the trailing metric badge.
72
+ *
73
+ * If not specified, the trailing metric badge inherits the lozenge appearance.
74
+ *
75
+ * This prop is not supported for accent lozenges.
76
+ */
77
+ trailingMetricAppearance?: ThemeAppearance | SemanticColor | 'inverse';
78
+ };
79
+ type NewLozengeAccentProps = NewLozengeBaseProps & {
80
+ /**
81
+ * Accent appearance values.
82
+ */
83
+ appearance: AccentColor;
84
+ /**
85
+ * Trailing metric is not supported for accent lozenges.
86
+ */
87
+ trailingMetric?: never;
88
+ /**
89
+ * Trailing metric appearance is not supported for accent lozenges.
90
+ */
91
+ trailingMetricAppearance?: never;
92
+ };
93
+ export type NewLozengeProps = NewLozengeSemanticProps | NewLozengeAccentProps;
94
+ /**
95
+ * Props for LozengeBase (internal). A single merged type so that Lozenge and
96
+ * LozengeDropdownTrigger can pass their props without union narrowing requiring
97
+ * appearance to match only one branch (AccentColor vs ThemeAppearance | SemanticColor).
98
+ * Must not intersect with LozengeDropdownTriggerProps (which extends NewLozengeProps union).
99
+ */
100
+ export type LozengeBaseProps = NewLozengeBaseProps & {
101
+ appearance?: ThemeAppearance | SemanticColor | AccentColor;
102
+ trailingMetric?: string;
103
+ trailingMetricAppearance?: ThemeAppearance | SemanticColor | 'inverse';
104
+ isSelected?: boolean;
105
+ isLoading?: boolean;
106
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>, analyticsEvent: UIAnalyticsEvent) => void;
107
+ analyticsContext?: Record<string, any>;
108
+ interactionName?: string;
109
+ };
66
110
  /**
67
111
  * Props for the LozengeDropdownTrigger component
68
112
  */
69
- export interface LozengeDropdownTriggerProps extends NewLozengeProps {
113
+ export type LozengeDropdownTriggerProps = NewLozengeProps & {
70
114
  /**
71
115
  * Whether the dropdown is currently selected/open.
72
116
  */
73
117
  isSelected?: boolean;
118
+ /**
119
+ * Whether the dropdown trigger is in a loading state.
120
+ * When true, a spinner is shown and the trigger becomes non-interactive.
121
+ */
122
+ isLoading?: boolean;
74
123
  /**
75
124
  * Callback fired when the trigger is clicked. The second argument provides an Atlaskit UI analytics event that can be fired to a listening channel. See the [analytics-next documentation](https://atlaskit.atlassian.com/packages/analytics/analytics-next) for more information.
76
125
  */
@@ -83,4 +132,5 @@ export interface LozengeDropdownTriggerProps extends NewLozengeProps {
83
132
  * An optional name used to identify events for React UFO (Unified Frontend Observability) press interactions. For more information, see [React UFO integration](https://go.atlassian.com/react-ufo-dst-integration).
84
133
  */
85
134
  interactionName?: string;
86
- }
135
+ };
136
+ export {};
@@ -1,4 +1,4 @@
1
1
  export { default } from './lozenge';
2
2
  export type { ThemeAppearance, LozengeProps } from './lozenge';
3
3
  export { default as LozengeDropdownTrigger } from './new/lozenge-dropdown-trigger';
4
- export type { NewLozengeProps, LozengeColor as NewLozengeColor, LozengeDropdownTriggerProps, LozengeSpacing, } from './new/types';
4
+ export type { NewLozengeProps, LozengeColor as NewLozengeColor, LozengeDropdownTriggerProps, LozengeSpacing, SemanticColor, AccentColor, } from './new/types';
@@ -22,5 +22,5 @@ export interface IconRendererProps {
22
22
  * Icon renderer for lozenge components
23
23
  * Handles proper sizing and color theming for icons
24
24
  */
25
- export declare const IconRenderer: ({ icon: Icon, color, testId, size }: IconRendererProps) => React.JSX.Element;
25
+ export declare const IconRenderer: (props: IconRendererProps) => React.JSX.Element;
26
26
  export default IconRenderer;
@@ -1,12 +1,4 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { type Ref } from 'react';
6
- import { type LozengeDropdownTriggerProps, type NewLozengeProps } from './types';
7
- interface LozengeBaseProps extends NewLozengeProps, LozengeDropdownTriggerProps {
8
- ref?: Ref<HTMLElement | HTMLButtonElement>;
9
- }
1
+ import { type LozengeBaseProps } from './types';
10
2
  /**
11
3
  * __New Lozenge__
12
4
  *