@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.
@@ -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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/lozenge",
3
- "version": "13.4.1",
3
+ "version": "13.4.3",
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/"
@@ -34,15 +34,16 @@
34
34
  "title": "Lozenge",
35
35
  "id": "lozenge",
36
36
  "status": {
37
- "type": "alpha",
38
- "description": "This is an experiment under a feature flag. We may make frequent breaking changes with limited notice. We don't recommend using this without support from our team."
37
+ "type": "beta",
38
+ "description": "New and ready to use. We'll provide comms and support for any major changes."
39
39
  }
40
40
  },
41
41
  {
42
42
  "title": "Lozenge Dropdown Trigger",
43
43
  "id": "lozenge-dropdown-trigger",
44
44
  "status": {
45
- "type": "alpha"
45
+ "type": "beta",
46
+ "description": "New and ready to use. We'll provide comms and support for any major changes."
46
47
  }
47
48
  }
48
49
  ]
@@ -50,11 +51,13 @@
50
51
  },
51
52
  "dependencies": {
52
53
  "@atlaskit/analytics-next": "^11.1.0",
54
+ "@atlaskit/badge": "^18.4.0",
53
55
  "@atlaskit/css": "^0.19.0",
54
56
  "@atlaskit/ds-lib": "^5.3.0",
55
- "@atlaskit/icon": "^30.0.0",
57
+ "@atlaskit/icon": "^31.0.0",
56
58
  "@atlaskit/platform-feature-flags": "^1.1.0",
57
59
  "@atlaskit/primitives": "^18.0.0",
60
+ "@atlaskit/spinner": "^19.0.0",
58
61
  "@atlaskit/tokens": "^11.0.0",
59
62
  "@babel/runtime": "^7.0.0",
60
63
  "@compiled/react": "^0.18.6"
@@ -68,7 +71,7 @@
68
71
  "@af/visual-regression": "workspace:^",
69
72
  "@atlaskit/docs": "^11.3.0",
70
73
  "@atlaskit/dropdown-menu": "^16.4.0",
71
- "@atlaskit/heading": "^5.2.0",
74
+ "@atlaskit/heading": "^5.3.0",
72
75
  "@atlaskit/link": "^3.3.0",
73
76
  "@atlaskit/section-message": "^8.12.0",
74
77
  "@atlassian/feature-flags-test-utils": "^1.0.0",