@atlaskit/lozenge 13.4.1 → 13.4.2
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 +10 -0
- package/dist/cjs/new/lozenge-base.compiled.css +38 -10
- package/dist/cjs/new/lozenge-base.js +58 -12
- package/dist/cjs/new/lozenge-dropdown-trigger.js +16 -7
- package/dist/cjs/new/lozenge.js +11 -7
- package/dist/es2019/new/lozenge-base.compiled.css +38 -10
- package/dist/es2019/new/lozenge-base.js +59 -13
- package/dist/es2019/new/lozenge-dropdown-trigger.js +23 -15
- package/dist/es2019/new/lozenge.js +15 -11
- package/dist/esm/new/lozenge-base.compiled.css +38 -10
- package/dist/esm/new/lozenge-base.js +59 -13
- package/dist/esm/new/lozenge-dropdown-trigger.js +16 -7
- package/dist/esm/new/lozenge.js +11 -7
- package/dist/types/index.d.ts +1 -1
- package/dist/types/new/lozenge-base.d.ts +4 -4
- package/dist/types/new/lozenge.d.ts +1 -1
- package/dist/types/new/types.d.ts +59 -9
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/new/lozenge-base.d.ts +4 -4
- package/dist/types-ts4.5/new/lozenge.d.ts +1 -1
- package/dist/types-ts4.5/new/types.d.ts +59 -9
- package/package.json +4 -2
|
@@ -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
|
-
|
|
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
|
|
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.
|
|
3
|
+
"version": "13.4.2",
|
|
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/"
|
|
@@ -50,11 +50,13 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
53
|
+
"@atlaskit/badge": "^18.4.0",
|
|
53
54
|
"@atlaskit/css": "^0.19.0",
|
|
54
55
|
"@atlaskit/ds-lib": "^5.3.0",
|
|
55
56
|
"@atlaskit/icon": "^30.0.0",
|
|
56
57
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
57
58
|
"@atlaskit/primitives": "^18.0.0",
|
|
59
|
+
"@atlaskit/spinner": "^19.0.0",
|
|
58
60
|
"@atlaskit/tokens": "^11.0.0",
|
|
59
61
|
"@babel/runtime": "^7.0.0",
|
|
60
62
|
"@compiled/react": "^0.18.6"
|
|
@@ -68,7 +70,7 @@
|
|
|
68
70
|
"@af/visual-regression": "workspace:^",
|
|
69
71
|
"@atlaskit/docs": "^11.3.0",
|
|
70
72
|
"@atlaskit/dropdown-menu": "^16.4.0",
|
|
71
|
-
"@atlaskit/heading": "^5.
|
|
73
|
+
"@atlaskit/heading": "^5.3.0",
|
|
72
74
|
"@atlaskit/link": "^3.3.0",
|
|
73
75
|
"@atlaskit/section-message": "^8.12.0",
|
|
74
76
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|