@atlaskit/lozenge 12.2.5 → 13.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/lozenge
2
2
 
3
+ ## 13.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#157573](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/157573)
8
+ [`e9334c37a9e16`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e9334c37a9e16) -
9
+ Removes Emotion variant of the Lozenge and replaces contents with styles from Compiled CSS.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 12.2.5
4
16
 
5
17
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -4,24 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
- var _compiled = _interopRequireDefault(require("./compiled"));
11
- var _Lozenge = _interopRequireDefault(require("./Lozenge"));
12
- /**
13
- * __Lozenge__
14
- *
15
- * A lozenge is a visual indicator used to highlight an item's status for quick recognition.
16
- *
17
- * - [Examples](https://atlassian.design/components/lozenge/examples)
18
- * - [Code](https://atlassian.design/components/lozenge/code)
19
- * - [Usage](https://atlassian.design/components/lozenge/usage)
20
- */
21
- var Lozenge = /*#__PURE__*/_react.default.memo(function (props) {
22
- return (0, _platformFeatureFlags.fg)('platform_dst_lozenge_fg') ? /*#__PURE__*/_react.default.createElement(_compiled.default, props) : /*#__PURE__*/_react.default.createElement(_Lozenge.default, props);
7
+ Object.defineProperty(exports, "default", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _lozenge.default;
11
+ }
23
12
  });
24
-
25
- // NOTE: Remove this and just directly `export { default } from '…';` when tidying `platform_dst_lozenge_fg`
26
- Lozenge.displayName = 'Lozenge';
27
- var _default = exports.default = Lozenge;
13
+ var _lozenge = _interopRequireDefault(require("./lozenge"));
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* lozenge.tsx generated by @compiled/babel-plugin v0.36.1 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- require("./index.compiled.css");
9
+ require("./lozenge.compiled.css");
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
  var React = _react;
12
12
  var _runtime = require("@compiled/react/runtime");
@@ -1,18 +1 @@
1
- import React from 'react';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
- import CompiledLozenge from './compiled';
4
- import EmotionLozenge from './Lozenge';
5
- /**
6
- * __Lozenge__
7
- *
8
- * A lozenge is a visual indicator used to highlight an item's status for quick recognition.
9
- *
10
- * - [Examples](https://atlassian.design/components/lozenge/examples)
11
- * - [Code](https://atlassian.design/components/lozenge/code)
12
- * - [Usage](https://atlassian.design/components/lozenge/usage)
13
- */
14
- const Lozenge = /*#__PURE__*/React.memo(props => fg('platform_dst_lozenge_fg') ? /*#__PURE__*/React.createElement(CompiledLozenge, props) : /*#__PURE__*/React.createElement(EmotionLozenge, props));
15
-
16
- // NOTE: Remove this and just directly `export { default } from '…';` when tidying `platform_dst_lozenge_fg`
17
- Lozenge.displayName = 'Lozenge';
18
- export default Lozenge;
1
+ export { default } from './lozenge';
@@ -1,5 +1,5 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
- import "./index.compiled.css";
1
+ /* lozenge.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./lozenge.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { memo, useMemo } from 'react';
package/dist/esm/index.js CHANGED
@@ -1,20 +1 @@
1
- import React from 'react';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
- import CompiledLozenge from './compiled';
4
- import EmotionLozenge from './Lozenge';
5
- /**
6
- * __Lozenge__
7
- *
8
- * A lozenge is a visual indicator used to highlight an item's status for quick recognition.
9
- *
10
- * - [Examples](https://atlassian.design/components/lozenge/examples)
11
- * - [Code](https://atlassian.design/components/lozenge/code)
12
- * - [Usage](https://atlassian.design/components/lozenge/usage)
13
- */
14
- var Lozenge = /*#__PURE__*/React.memo(function (props) {
15
- return fg('platform_dst_lozenge_fg') ? /*#__PURE__*/React.createElement(CompiledLozenge, props) : /*#__PURE__*/React.createElement(EmotionLozenge, props);
16
- });
17
-
18
- // NOTE: Remove this and just directly `export { default } from '…';` when tidying `platform_dst_lozenge_fg`
19
- Lozenge.displayName = 'Lozenge';
20
- export default Lozenge;
1
+ export { default } from './lozenge';
@@ -1,5 +1,5 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
- import "./index.compiled.css";
1
+ /* lozenge.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./lozenge.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { memo, useMemo } from 'react';
@@ -1,14 +1,2 @@
1
- import EmotionLozenge from './Lozenge';
2
- export type { ThemeAppearance } from './Lozenge';
3
- export type { LozengeProps } from './Lozenge';
4
- /**
5
- * __Lozenge__
6
- *
7
- * A lozenge is a visual indicator used to highlight an item's status for quick recognition.
8
- *
9
- * - [Examples](https://atlassian.design/components/lozenge/examples)
10
- * - [Code](https://atlassian.design/components/lozenge/code)
11
- * - [Usage](https://atlassian.design/components/lozenge/usage)
12
- */
13
- declare const Lozenge: typeof EmotionLozenge;
14
- export default Lozenge;
1
+ export { default } from './lozenge';
2
+ export type { ThemeAppearance, LozengeProps } from './lozenge';
@@ -1,14 +1,2 @@
1
- import EmotionLozenge from './Lozenge';
2
- export type { ThemeAppearance } from './Lozenge';
3
- export type { LozengeProps } from './Lozenge';
4
- /**
5
- * __Lozenge__
6
- *
7
- * A lozenge is a visual indicator used to highlight an item's status for quick recognition.
8
- *
9
- * - [Examples](https://atlassian.design/components/lozenge/examples)
10
- * - [Code](https://atlassian.design/components/lozenge/code)
11
- * - [Usage](https://atlassian.design/components/lozenge/usage)
12
- */
13
- declare const Lozenge: typeof EmotionLozenge;
14
- export default Lozenge;
1
+ export { default } from './lozenge';
2
+ export type { ThemeAppearance, LozengeProps } from './lozenge';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/lozenge",
3
- "version": "12.2.5",
3
+ "version": "13.0.0",
4
4
  "description": "A lozenge is a visual indicator used to highlight an item's status for quick recognition.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -25,8 +25,7 @@
25
25
  ],
26
26
  "atlaskit:src": "src/index.tsx",
27
27
  "af:exports": {
28
- ".": "./src/index.tsx",
29
- "./compiled": "./src/compiled/index.tsx"
28
+ ".": "./src/index.tsx"
30
29
  },
31
30
  "atlassian": {
32
31
  "team": "Design System Team",
@@ -44,8 +43,7 @@
44
43
  "@atlaskit/theme": "^18.0.0",
45
44
  "@atlaskit/tokens": "^5.0.0",
46
45
  "@babel/runtime": "^7.0.0",
47
- "@compiled/react": "^0.18.3",
48
- "@emotion/react": "^11.7.1"
46
+ "@compiled/react": "^0.18.3"
49
47
  },
50
48
  "peerDependencies": {
51
49
  "react": "^18.2.0"
@@ -75,8 +73,7 @@
75
73
  "dom-events": "use-bind-event-listener",
76
74
  "design-system": "v1",
77
75
  "styling": [
78
- "static",
79
- "emotion"
76
+ "static"
80
77
  ],
81
78
  "ui-components": [
82
79
  "primitives",
@@ -99,9 +96,6 @@
99
96
  },
100
97
  "platform-lozenge-custom-letterspacing": {
101
98
  "type": "boolean"
102
- },
103
- "platform_dst_lozenge_fg": {
104
- "type": "boolean"
105
99
  }
106
100
  },
107
101
  "homepage": "https://atlassian.design/components/lozenge/"
@@ -1,17 +0,0 @@
1
- {
2
- "name": "@atlaskit/lozenge/compiled",
3
- "main": "../dist/cjs/compiled/index.js",
4
- "module": "../dist/esm/compiled/index.js",
5
- "module:es2019": "../dist/es2019/compiled/index.js",
6
- "sideEffects": [
7
- "**/*.compiled.css"
8
- ],
9
- "types": "../dist/types/compiled/index.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.4": {
12
- "*": [
13
- "../dist/types-ts4.5/compiled/index.d.ts"
14
- ]
15
- }
16
- }
17
- }
@@ -1,275 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _react2 = require("@emotion/react");
9
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
- var _primitives = require("@atlaskit/primitives");
11
- /**
12
- * @jsxRuntime classic
13
- * @jsx jsx
14
- */
15
-
16
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
17
-
18
- var baseStylesOld = (0, _primitives.xcss)({
19
- display: 'inline-flex',
20
- borderRadius: 'border.radius',
21
- blockSize: 'min-content',
22
- position: 'static',
23
- overflow: 'hidden'
24
- });
25
- var styles = {
26
- container: (0, _react2.css)({
27
- display: 'inline-flex',
28
- boxSizing: 'border-box',
29
- position: 'static',
30
- blockSize: 'min-content',
31
- borderRadius: '3px',
32
- overflow: 'hidden',
33
- paddingInline: "var(--ds-space-050, 4px)"
34
- }),
35
- containerSubtle: (0, _react2.css)({
36
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
37
- outlineOffset: -1
38
- }),
39
- background: {
40
- bold: {
41
- default: (0, _react2.css)({
42
- backgroundColor: '#DDDEE1'
43
- }),
44
- inprogress: (0, _react2.css)({
45
- backgroundColor: '#8FB8F6'
46
- }),
47
- moved: (0, _react2.css)({
48
- backgroundColor: '#F9C84E'
49
- }),
50
- new: (0, _react2.css)({
51
- backgroundColor: '#D8A0F7'
52
- }),
53
- removed: (0, _react2.css)({
54
- backgroundColor: '#FD9891'
55
- }),
56
- success: (0, _react2.css)({
57
- backgroundColor: '#B3DF72'
58
- })
59
- },
60
- subtle: {
61
- default: (0, _react2.css)({
62
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
63
- }),
64
- inprogress: (0, _react2.css)({
65
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
66
- }),
67
- moved: (0, _react2.css)({
68
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
69
- }),
70
- new: (0, _react2.css)({
71
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
72
- }),
73
- removed: (0, _react2.css)({
74
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
75
- }),
76
- success: (0, _react2.css)({
77
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
78
- })
79
- }
80
- },
81
- border: {
82
- subtle: {
83
- default: (0, _react2.css)({
84
- border: "1px solid #B7B9BE"
85
- }),
86
- inprogress: (0, _react2.css)({
87
- border: "1px solid #669DF1"
88
- }),
89
- moved: (0, _react2.css)({
90
- border: "1px solid #FCA700"
91
- }),
92
- new: (0, _react2.css)({
93
- border: "1px solid #C97CF4"
94
- }),
95
- removed: (0, _react2.css)({
96
- border: "1px solid #F87168"
97
- }),
98
- success: (0, _react2.css)({
99
- border: "1px solid #94C748"
100
- })
101
- }
102
- },
103
- outline: {
104
- subtle: {
105
- default: (0, _react2.css)({
106
- outline: "1px solid #B7B9BE"
107
- }),
108
- inprogress: (0, _react2.css)({
109
- outline: "1px solid #669DF1"
110
- }),
111
- moved: (0, _react2.css)({
112
- outline: "1px solid #FCA700"
113
- }),
114
- new: (0, _react2.css)({
115
- outline: "1px solid #C97CF4"
116
- }),
117
- removed: (0, _react2.css)({
118
- outline: "1px solid #F87168"
119
- }),
120
- success: (0, _react2.css)({
121
- outline: "1px solid #94C748"
122
- })
123
- }
124
- },
125
- text: {
126
- subtle: (0, _react2.css)({
127
- color: "var(--ds-text, #172B4D)"
128
- }),
129
- bold: (0, _react2.css)({
130
- color: '#292A2E'
131
- })
132
- }
133
- };
134
- var textStyles = (0, _react2.css)({
135
- fontFamily: "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
136
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
137
- fontSize: '11px',
138
- fontStyle: 'normal',
139
- fontWeight: "var(--ds-font-weight-bold, 700)",
140
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
141
- lineHeight: '16px',
142
- overflow: 'hidden',
143
- textOverflow: 'ellipsis',
144
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
145
- textTransform: 'uppercase',
146
- whiteSpace: 'nowrap'
147
- });
148
- var customLetterspacingStyles = (0, _react2.css)({
149
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
150
- letterSpacing: 0.165
151
- });
152
- /**
153
- * __Lozenge__
154
- *
155
- * A lozenge is a visual indicator used to highlight an item's status for quick recognition.
156
- *
157
- * - [Examples](https://atlassian.design/components/lozenge/examples)
158
- * - [Code](https://atlassian.design/components/lozenge/code)
159
- * - [Usage](https://atlassian.design/components/lozenge/usage)
160
- */
161
- var Lozenge = /*#__PURE__*/(0, _react.memo)(function (_ref) {
162
- var children = _ref.children,
163
- testId = _ref.testId,
164
- _ref$isBold = _ref.isBold,
165
- isBold = _ref$isBold === void 0 ? false : _ref$isBold,
166
- _ref$appearance = _ref.appearance,
167
- appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance,
168
- _ref$maxWidth = _ref.maxWidth,
169
- maxWidth = _ref$maxWidth === void 0 ? 200 : _ref$maxWidth,
170
- style = _ref.style;
171
- var appearanceStyle = isBold ? 'bold' : 'subtle';
172
- var appearanceType = appearance in styles.background[appearanceStyle] ? appearance : 'default';
173
- var maxWidthValue = typeof maxWidth === 'string' ? maxWidth : "".concat(maxWidth, "px");
174
- var maxWidthIsPc = typeof maxWidth === 'string' && /%$/.test(maxWidth);
175
- if ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh')) {
176
- return (0, _react2.jsx)("span", {
177
- style: {
178
- backgroundColor: style === null || style === void 0 ? void 0 : style.backgroundColor,
179
- maxWidth: maxWidthIsPc ? maxWidth : '100%'
180
- },
181
- css: [styles.container, styles.background[appearanceStyle][appearanceType], appearanceStyle === 'subtle' && !(0, _platformFeatureFlags.fg)('visual-refresh_drop_5') && styles.border.subtle[appearanceType], appearanceStyle === 'subtle' && (0, _platformFeatureFlags.fg)('visual-refresh_drop_5') && styles.outline.subtle[appearanceType], appearanceStyle === 'subtle' && (0, _platformFeatureFlags.fg)('visual-refresh_drop_5') && styles.containerSubtle],
182
- "data-testid": testId
183
- }, (0, _react2.jsx)("span", {
184
- css: [textStyles, (0, _platformFeatureFlags.fg)('platform-lozenge-custom-letterspacing') && customLetterspacingStyles, styles.text[appearanceStyle]],
185
- style: {
186
- color: style === null || style === void 0 ? void 0 : style.color,
187
- // to negate paddingInline specified on Box above
188
- maxWidth: maxWidthIsPc ? '100%' : "calc(".concat(maxWidthValue, " - ", "var(--ds-space-100, 8px)", ")")
189
- },
190
- "data-testid": testId && "".concat(testId, "--text")
191
- }, children));
192
- }
193
- var appearanceTypeOld = appearance in backgroundColorsOld[appearanceStyle] ? appearance : 'default';
194
- return (0, _react2.jsx)(_primitives.Box, {
195
- as: "span",
196
- backgroundColor: backgroundColorsOld[appearanceStyle][appearanceTypeOld],
197
- style: {
198
- backgroundColor: style === null || style === void 0 ? void 0 : style.backgroundColor,
199
- maxWidth: maxWidthIsPc ? maxWidth : '100%'
200
- },
201
- paddingInline: "space.050",
202
- xcss: baseStylesOld,
203
- testId: testId
204
- }, (0, _react2.jsx)("span", {
205
- css: [textStyles, (0, _platformFeatureFlags.fg)('platform-lozenge-custom-letterspacing') && customLetterspacingStyles, textColorsOld[appearanceStyle][appearanceType]],
206
- style: {
207
- color: style === null || style === void 0 ? void 0 : style.color,
208
- // to negate paddingInline specified on Box above
209
- maxWidth: maxWidthIsPc ? '100%' : "calc(".concat(maxWidthValue, " - ", "var(--ds-space-100, 8px)", ")")
210
- },
211
- "data-testid": testId && "".concat(testId, "--text")
212
- }, children));
213
- });
214
- Lozenge.displayName = 'Lozenge';
215
- var _default = exports.default = Lozenge;
216
- var backgroundColorsOld = {
217
- bold: {
218
- default: 'color.background.neutral.bold',
219
- inprogress: 'color.background.information.bold',
220
- moved: 'color.background.warning.bold',
221
- new: 'color.background.discovery.bold',
222
- removed: 'color.background.danger.bold',
223
- success: 'color.background.success.bold'
224
- },
225
- subtle: {
226
- default: 'color.background.neutral',
227
- inprogress: 'color.background.information',
228
- moved: 'color.background.warning',
229
- new: 'color.background.discovery',
230
- removed: 'color.background.danger',
231
- success: 'color.background.success'
232
- }
233
- };
234
- var textColorsOld = {
235
- bold: {
236
- default: (0, _react2.css)({
237
- color: "var(--ds-text-inverse, #FFFFFF)"
238
- }),
239
- inprogress: (0, _react2.css)({
240
- color: "var(--ds-text-inverse, #FFFFFF)"
241
- }),
242
- moved: (0, _react2.css)({
243
- color: "var(--ds-text-warning-inverse, #172B4D)"
244
- }),
245
- new: (0, _react2.css)({
246
- color: "var(--ds-text-inverse, #FFFFFF)"
247
- }),
248
- removed: (0, _react2.css)({
249
- color: "var(--ds-text-inverse, #FFFFFF)"
250
- }),
251
- success: (0, _react2.css)({
252
- color: "var(--ds-text-inverse, #FFFFFF)"
253
- })
254
- },
255
- subtle: {
256
- default: (0, _react2.css)({
257
- color: "var(--ds-text-subtle, #42526E)"
258
- }),
259
- inprogress: (0, _react2.css)({
260
- color: "var(--ds-text-information, #0052CC)"
261
- }),
262
- moved: (0, _react2.css)({
263
- color: "var(--ds-text-warning, #974F0C)"
264
- }),
265
- new: (0, _react2.css)({
266
- color: "var(--ds-text-discovery, #403294)"
267
- }),
268
- removed: (0, _react2.css)({
269
- color: "var(--ds-text-danger, #DE350B)"
270
- }),
271
- success: (0, _react2.css)({
272
- color: "var(--ds-text-success, #006644)"
273
- })
274
- }
275
- };
@@ -1,266 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { memo } from 'react';
6
-
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { css, jsx } from '@emotion/react';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
- import { Box, xcss } from '@atlaskit/primitives';
11
- const baseStylesOld = xcss({
12
- display: 'inline-flex',
13
- borderRadius: 'border.radius',
14
- blockSize: 'min-content',
15
- position: 'static',
16
- overflow: 'hidden'
17
- });
18
- const styles = {
19
- container: css({
20
- display: 'inline-flex',
21
- boxSizing: 'border-box',
22
- position: 'static',
23
- blockSize: 'min-content',
24
- borderRadius: '3px',
25
- overflow: 'hidden',
26
- paddingInline: "var(--ds-space-050, 4px)"
27
- }),
28
- containerSubtle: css({
29
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
30
- outlineOffset: -1
31
- }),
32
- background: {
33
- bold: {
34
- default: css({
35
- backgroundColor: '#DDDEE1'
36
- }),
37
- inprogress: css({
38
- backgroundColor: '#8FB8F6'
39
- }),
40
- moved: css({
41
- backgroundColor: '#F9C84E'
42
- }),
43
- new: css({
44
- backgroundColor: '#D8A0F7'
45
- }),
46
- removed: css({
47
- backgroundColor: '#FD9891'
48
- }),
49
- success: css({
50
- backgroundColor: '#B3DF72'
51
- })
52
- },
53
- subtle: {
54
- default: css({
55
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
56
- }),
57
- inprogress: css({
58
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
59
- }),
60
- moved: css({
61
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
62
- }),
63
- new: css({
64
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
65
- }),
66
- removed: css({
67
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
68
- }),
69
- success: css({
70
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
71
- })
72
- }
73
- },
74
- border: {
75
- subtle: {
76
- default: css({
77
- border: `1px solid #B7B9BE`
78
- }),
79
- inprogress: css({
80
- border: `1px solid #669DF1`
81
- }),
82
- moved: css({
83
- border: `1px solid #FCA700`
84
- }),
85
- new: css({
86
- border: `1px solid #C97CF4`
87
- }),
88
- removed: css({
89
- border: `1px solid #F87168`
90
- }),
91
- success: css({
92
- border: `1px solid #94C748`
93
- })
94
- }
95
- },
96
- outline: {
97
- subtle: {
98
- default: css({
99
- outline: `1px solid #B7B9BE`
100
- }),
101
- inprogress: css({
102
- outline: `1px solid #669DF1`
103
- }),
104
- moved: css({
105
- outline: `1px solid #FCA700`
106
- }),
107
- new: css({
108
- outline: `1px solid #C97CF4`
109
- }),
110
- removed: css({
111
- outline: `1px solid #F87168`
112
- }),
113
- success: css({
114
- outline: `1px solid #94C748`
115
- })
116
- }
117
- },
118
- text: {
119
- subtle: css({
120
- color: "var(--ds-text, #172B4D)"
121
- }),
122
- bold: css({
123
- color: '#292A2E'
124
- })
125
- }
126
- };
127
- const textStyles = css({
128
- fontFamily: "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
129
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
130
- fontSize: '11px',
131
- fontStyle: 'normal',
132
- fontWeight: "var(--ds-font-weight-bold, 700)",
133
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
134
- lineHeight: '16px',
135
- overflow: 'hidden',
136
- textOverflow: 'ellipsis',
137
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
138
- textTransform: 'uppercase',
139
- whiteSpace: 'nowrap'
140
- });
141
- const customLetterspacingStyles = css({
142
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
143
- letterSpacing: 0.165
144
- });
145
- /**
146
- * __Lozenge__
147
- *
148
- * A lozenge is a visual indicator used to highlight an item's status for quick recognition.
149
- *
150
- * - [Examples](https://atlassian.design/components/lozenge/examples)
151
- * - [Code](https://atlassian.design/components/lozenge/code)
152
- * - [Usage](https://atlassian.design/components/lozenge/usage)
153
- */
154
- const Lozenge = /*#__PURE__*/memo(({
155
- children,
156
- testId,
157
- isBold = false,
158
- appearance = 'default',
159
- maxWidth = 200,
160
- style
161
- }) => {
162
- const appearanceStyle = isBold ? 'bold' : 'subtle';
163
- const appearanceType = appearance in styles.background[appearanceStyle] ? appearance : 'default';
164
- const maxWidthValue = typeof maxWidth === 'string' ? maxWidth : `${maxWidth}px`;
165
- const maxWidthIsPc = typeof maxWidth === 'string' && /%$/.test(maxWidth);
166
- if (fg('platform-component-visual-refresh')) {
167
- return jsx("span", {
168
- style: {
169
- backgroundColor: style === null || style === void 0 ? void 0 : style.backgroundColor,
170
- maxWidth: maxWidthIsPc ? maxWidth : '100%'
171
- },
172
- css: [styles.container, styles.background[appearanceStyle][appearanceType], appearanceStyle === 'subtle' && !fg('visual-refresh_drop_5') && styles.border.subtle[appearanceType], appearanceStyle === 'subtle' && fg('visual-refresh_drop_5') && styles.outline.subtle[appearanceType], appearanceStyle === 'subtle' && fg('visual-refresh_drop_5') && styles.containerSubtle],
173
- "data-testid": testId
174
- }, jsx("span", {
175
- css: [textStyles, fg('platform-lozenge-custom-letterspacing') && customLetterspacingStyles, styles.text[appearanceStyle]],
176
- style: {
177
- color: style === null || style === void 0 ? void 0 : style.color,
178
- // to negate paddingInline specified on Box above
179
- maxWidth: maxWidthIsPc ? '100%' : `calc(${maxWidthValue} - ${"var(--ds-space-100, 8px)"})`
180
- },
181
- "data-testid": testId && `${testId}--text`
182
- }, children));
183
- }
184
- const appearanceTypeOld = appearance in backgroundColorsOld[appearanceStyle] ? appearance : 'default';
185
- return jsx(Box, {
186
- as: "span",
187
- backgroundColor: backgroundColorsOld[appearanceStyle][appearanceTypeOld],
188
- style: {
189
- backgroundColor: style === null || style === void 0 ? void 0 : style.backgroundColor,
190
- maxWidth: maxWidthIsPc ? maxWidth : '100%'
191
- },
192
- paddingInline: "space.050",
193
- xcss: baseStylesOld,
194
- testId: testId
195
- }, jsx("span", {
196
- css: [textStyles, fg('platform-lozenge-custom-letterspacing') && customLetterspacingStyles, textColorsOld[appearanceStyle][appearanceType]],
197
- style: {
198
- color: style === null || style === void 0 ? void 0 : style.color,
199
- // to negate paddingInline specified on Box above
200
- maxWidth: maxWidthIsPc ? '100%' : `calc(${maxWidthValue} - ${"var(--ds-space-100, 8px)"})`
201
- },
202
- "data-testid": testId && `${testId}--text`
203
- }, children));
204
- });
205
- Lozenge.displayName = 'Lozenge';
206
- export default Lozenge;
207
- const backgroundColorsOld = {
208
- bold: {
209
- default: 'color.background.neutral.bold',
210
- inprogress: 'color.background.information.bold',
211
- moved: 'color.background.warning.bold',
212
- new: 'color.background.discovery.bold',
213
- removed: 'color.background.danger.bold',
214
- success: 'color.background.success.bold'
215
- },
216
- subtle: {
217
- default: 'color.background.neutral',
218
- inprogress: 'color.background.information',
219
- moved: 'color.background.warning',
220
- new: 'color.background.discovery',
221
- removed: 'color.background.danger',
222
- success: 'color.background.success'
223
- }
224
- };
225
- const textColorsOld = {
226
- bold: {
227
- default: css({
228
- color: "var(--ds-text-inverse, #FFFFFF)"
229
- }),
230
- inprogress: css({
231
- color: "var(--ds-text-inverse, #FFFFFF)"
232
- }),
233
- moved: css({
234
- color: "var(--ds-text-warning-inverse, #172B4D)"
235
- }),
236
- new: css({
237
- color: "var(--ds-text-inverse, #FFFFFF)"
238
- }),
239
- removed: css({
240
- color: "var(--ds-text-inverse, #FFFFFF)"
241
- }),
242
- success: css({
243
- color: "var(--ds-text-inverse, #FFFFFF)"
244
- })
245
- },
246
- subtle: {
247
- default: css({
248
- color: "var(--ds-text-subtle, #42526E)"
249
- }),
250
- inprogress: css({
251
- color: "var(--ds-text-information, #0052CC)"
252
- }),
253
- moved: css({
254
- color: "var(--ds-text-warning, #974F0C)"
255
- }),
256
- new: css({
257
- color: "var(--ds-text-discovery, #403294)"
258
- }),
259
- removed: css({
260
- color: "var(--ds-text-danger, #DE350B)"
261
- }),
262
- success: css({
263
- color: "var(--ds-text-success, #006644)"
264
- })
265
- }
266
- };
@@ -1,268 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { memo } from 'react';
6
-
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { css, jsx } from '@emotion/react';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
- import { Box, xcss } from '@atlaskit/primitives';
11
- var baseStylesOld = xcss({
12
- display: 'inline-flex',
13
- borderRadius: 'border.radius',
14
- blockSize: 'min-content',
15
- position: 'static',
16
- overflow: 'hidden'
17
- });
18
- var styles = {
19
- container: css({
20
- display: 'inline-flex',
21
- boxSizing: 'border-box',
22
- position: 'static',
23
- blockSize: 'min-content',
24
- borderRadius: '3px',
25
- overflow: 'hidden',
26
- paddingInline: "var(--ds-space-050, 4px)"
27
- }),
28
- containerSubtle: css({
29
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
30
- outlineOffset: -1
31
- }),
32
- background: {
33
- bold: {
34
- default: css({
35
- backgroundColor: '#DDDEE1'
36
- }),
37
- inprogress: css({
38
- backgroundColor: '#8FB8F6'
39
- }),
40
- moved: css({
41
- backgroundColor: '#F9C84E'
42
- }),
43
- new: css({
44
- backgroundColor: '#D8A0F7'
45
- }),
46
- removed: css({
47
- backgroundColor: '#FD9891'
48
- }),
49
- success: css({
50
- backgroundColor: '#B3DF72'
51
- })
52
- },
53
- subtle: {
54
- default: css({
55
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
56
- }),
57
- inprogress: css({
58
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
59
- }),
60
- moved: css({
61
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
62
- }),
63
- new: css({
64
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
65
- }),
66
- removed: css({
67
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
68
- }),
69
- success: css({
70
- backgroundColor: "var(--ds-background-neutral-subtle, #00000000)"
71
- })
72
- }
73
- },
74
- border: {
75
- subtle: {
76
- default: css({
77
- border: "1px solid #B7B9BE"
78
- }),
79
- inprogress: css({
80
- border: "1px solid #669DF1"
81
- }),
82
- moved: css({
83
- border: "1px solid #FCA700"
84
- }),
85
- new: css({
86
- border: "1px solid #C97CF4"
87
- }),
88
- removed: css({
89
- border: "1px solid #F87168"
90
- }),
91
- success: css({
92
- border: "1px solid #94C748"
93
- })
94
- }
95
- },
96
- outline: {
97
- subtle: {
98
- default: css({
99
- outline: "1px solid #B7B9BE"
100
- }),
101
- inprogress: css({
102
- outline: "1px solid #669DF1"
103
- }),
104
- moved: css({
105
- outline: "1px solid #FCA700"
106
- }),
107
- new: css({
108
- outline: "1px solid #C97CF4"
109
- }),
110
- removed: css({
111
- outline: "1px solid #F87168"
112
- }),
113
- success: css({
114
- outline: "1px solid #94C748"
115
- })
116
- }
117
- },
118
- text: {
119
- subtle: css({
120
- color: "var(--ds-text, #172B4D)"
121
- }),
122
- bold: css({
123
- color: '#292A2E'
124
- })
125
- }
126
- };
127
- var textStyles = css({
128
- fontFamily: "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
129
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
130
- fontSize: '11px',
131
- fontStyle: 'normal',
132
- fontWeight: "var(--ds-font-weight-bold, 700)",
133
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
134
- lineHeight: '16px',
135
- overflow: 'hidden',
136
- textOverflow: 'ellipsis',
137
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
138
- textTransform: 'uppercase',
139
- whiteSpace: 'nowrap'
140
- });
141
- var customLetterspacingStyles = css({
142
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
143
- letterSpacing: 0.165
144
- });
145
- /**
146
- * __Lozenge__
147
- *
148
- * A lozenge is a visual indicator used to highlight an item's status for quick recognition.
149
- *
150
- * - [Examples](https://atlassian.design/components/lozenge/examples)
151
- * - [Code](https://atlassian.design/components/lozenge/code)
152
- * - [Usage](https://atlassian.design/components/lozenge/usage)
153
- */
154
- var Lozenge = /*#__PURE__*/memo(function (_ref) {
155
- var children = _ref.children,
156
- testId = _ref.testId,
157
- _ref$isBold = _ref.isBold,
158
- isBold = _ref$isBold === void 0 ? false : _ref$isBold,
159
- _ref$appearance = _ref.appearance,
160
- appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance,
161
- _ref$maxWidth = _ref.maxWidth,
162
- maxWidth = _ref$maxWidth === void 0 ? 200 : _ref$maxWidth,
163
- style = _ref.style;
164
- var appearanceStyle = isBold ? 'bold' : 'subtle';
165
- var appearanceType = appearance in styles.background[appearanceStyle] ? appearance : 'default';
166
- var maxWidthValue = typeof maxWidth === 'string' ? maxWidth : "".concat(maxWidth, "px");
167
- var maxWidthIsPc = typeof maxWidth === 'string' && /%$/.test(maxWidth);
168
- if (fg('platform-component-visual-refresh')) {
169
- return jsx("span", {
170
- style: {
171
- backgroundColor: style === null || style === void 0 ? void 0 : style.backgroundColor,
172
- maxWidth: maxWidthIsPc ? maxWidth : '100%'
173
- },
174
- css: [styles.container, styles.background[appearanceStyle][appearanceType], appearanceStyle === 'subtle' && !fg('visual-refresh_drop_5') && styles.border.subtle[appearanceType], appearanceStyle === 'subtle' && fg('visual-refresh_drop_5') && styles.outline.subtle[appearanceType], appearanceStyle === 'subtle' && fg('visual-refresh_drop_5') && styles.containerSubtle],
175
- "data-testid": testId
176
- }, jsx("span", {
177
- css: [textStyles, fg('platform-lozenge-custom-letterspacing') && customLetterspacingStyles, styles.text[appearanceStyle]],
178
- style: {
179
- color: style === null || style === void 0 ? void 0 : style.color,
180
- // to negate paddingInline specified on Box above
181
- maxWidth: maxWidthIsPc ? '100%' : "calc(".concat(maxWidthValue, " - ", "var(--ds-space-100, 8px)", ")")
182
- },
183
- "data-testid": testId && "".concat(testId, "--text")
184
- }, children));
185
- }
186
- var appearanceTypeOld = appearance in backgroundColorsOld[appearanceStyle] ? appearance : 'default';
187
- return jsx(Box, {
188
- as: "span",
189
- backgroundColor: backgroundColorsOld[appearanceStyle][appearanceTypeOld],
190
- style: {
191
- backgroundColor: style === null || style === void 0 ? void 0 : style.backgroundColor,
192
- maxWidth: maxWidthIsPc ? maxWidth : '100%'
193
- },
194
- paddingInline: "space.050",
195
- xcss: baseStylesOld,
196
- testId: testId
197
- }, jsx("span", {
198
- css: [textStyles, fg('platform-lozenge-custom-letterspacing') && customLetterspacingStyles, textColorsOld[appearanceStyle][appearanceType]],
199
- style: {
200
- color: style === null || style === void 0 ? void 0 : style.color,
201
- // to negate paddingInline specified on Box above
202
- maxWidth: maxWidthIsPc ? '100%' : "calc(".concat(maxWidthValue, " - ", "var(--ds-space-100, 8px)", ")")
203
- },
204
- "data-testid": testId && "".concat(testId, "--text")
205
- }, children));
206
- });
207
- Lozenge.displayName = 'Lozenge';
208
- export default Lozenge;
209
- var backgroundColorsOld = {
210
- bold: {
211
- default: 'color.background.neutral.bold',
212
- inprogress: 'color.background.information.bold',
213
- moved: 'color.background.warning.bold',
214
- new: 'color.background.discovery.bold',
215
- removed: 'color.background.danger.bold',
216
- success: 'color.background.success.bold'
217
- },
218
- subtle: {
219
- default: 'color.background.neutral',
220
- inprogress: 'color.background.information',
221
- moved: 'color.background.warning',
222
- new: 'color.background.discovery',
223
- removed: 'color.background.danger',
224
- success: 'color.background.success'
225
- }
226
- };
227
- var textColorsOld = {
228
- bold: {
229
- default: css({
230
- color: "var(--ds-text-inverse, #FFFFFF)"
231
- }),
232
- inprogress: css({
233
- color: "var(--ds-text-inverse, #FFFFFF)"
234
- }),
235
- moved: css({
236
- color: "var(--ds-text-warning-inverse, #172B4D)"
237
- }),
238
- new: css({
239
- color: "var(--ds-text-inverse, #FFFFFF)"
240
- }),
241
- removed: css({
242
- color: "var(--ds-text-inverse, #FFFFFF)"
243
- }),
244
- success: css({
245
- color: "var(--ds-text-inverse, #FFFFFF)"
246
- })
247
- },
248
- subtle: {
249
- default: css({
250
- color: "var(--ds-text-subtle, #42526E)"
251
- }),
252
- inprogress: css({
253
- color: "var(--ds-text-information, #0052CC)"
254
- }),
255
- moved: css({
256
- color: "var(--ds-text-warning, #974F0C)"
257
- }),
258
- new: css({
259
- color: "var(--ds-text-discovery, #403294)"
260
- }),
261
- removed: css({
262
- color: "var(--ds-text-danger, #DE350B)"
263
- }),
264
- success: css({
265
- color: "var(--ds-text-success, #006644)"
266
- })
267
- }
268
- };
@@ -1,46 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { type CSSProperties, type ReactNode } from 'react';
6
- import { jsx } from '@emotion/react';
7
- export type ThemeAppearance = 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'success';
8
- export interface LozengeProps {
9
- /**
10
- * The appearance type.
11
- */
12
- appearance?: ThemeAppearance;
13
- /**
14
- * Elements to be rendered inside the lozenge. This should ideally be just a word or two.
15
- */
16
- children?: ReactNode;
17
- /**
18
- * Determines whether to apply the bold style or not.
19
- */
20
- isBold?: boolean;
21
- /**
22
- * max-width of lozenge container. Default to 200px.
23
- */
24
- maxWidth?: number | string;
25
- /**
26
- * Style customization to apply to the badge. Only `backgroundColor` and `color` are supported.
27
- */
28
- style?: Pick<CSSProperties, 'backgroundColor' | 'color'>;
29
- /**
30
- * A `testId` prop is provided for specified elements, which is a unique
31
- * string that appears as a data attribute `data-testid` in the rendered code,
32
- * serving as a hook for automated tests
33
- */
34
- testId?: string;
35
- }
36
- /**
37
- * __Lozenge__
38
- *
39
- * A lozenge is a visual indicator used to highlight an item's status for quick recognition.
40
- *
41
- * - [Examples](https://atlassian.design/components/lozenge/examples)
42
- * - [Code](https://atlassian.design/components/lozenge/code)
43
- * - [Usage](https://atlassian.design/components/lozenge/usage)
44
- */
45
- declare const Lozenge: import("react").MemoExoticComponent<({ children, testId, isBold, appearance, maxWidth, style, }: LozengeProps) => jsx.JSX.Element>;
46
- export default Lozenge;
@@ -1,46 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { type CSSProperties, type ReactNode } from 'react';
6
- import { jsx } from '@emotion/react';
7
- export type ThemeAppearance = 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'success';
8
- export interface LozengeProps {
9
- /**
10
- * The appearance type.
11
- */
12
- appearance?: ThemeAppearance;
13
- /**
14
- * Elements to be rendered inside the lozenge. This should ideally be just a word or two.
15
- */
16
- children?: ReactNode;
17
- /**
18
- * Determines whether to apply the bold style or not.
19
- */
20
- isBold?: boolean;
21
- /**
22
- * max-width of lozenge container. Default to 200px.
23
- */
24
- maxWidth?: number | string;
25
- /**
26
- * Style customization to apply to the badge. Only `backgroundColor` and `color` are supported.
27
- */
28
- style?: Pick<CSSProperties, 'backgroundColor' | 'color'>;
29
- /**
30
- * A `testId` prop is provided for specified elements, which is a unique
31
- * string that appears as a data attribute `data-testid` in the rendered code,
32
- * serving as a hook for automated tests
33
- */
34
- testId?: string;
35
- }
36
- /**
37
- * __Lozenge__
38
- *
39
- * A lozenge is a visual indicator used to highlight an item's status for quick recognition.
40
- *
41
- * - [Examples](https://atlassian.design/components/lozenge/examples)
42
- * - [Code](https://atlassian.design/components/lozenge/code)
43
- * - [Usage](https://atlassian.design/components/lozenge/usage)
44
- */
45
- declare const Lozenge: import("react").MemoExoticComponent<({ children, testId, isBold, appearance, maxWidth, style, }: LozengeProps) => jsx.JSX.Element>;
46
- export default Lozenge;