@atlaskit/date-label 0.1.0 → 1.0.1
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 +32 -0
- package/constellation/date-label-dropdown-trigger/code.mdx +2 -1
- package/constellation/date-label-dropdown-trigger/usage.mdx +13 -13
- package/date-label/package.json +1 -8
- package/date-label-dropdown-trigger/package.json +1 -8
- package/date-label.docs.tsx +85 -0
- package/dist/types/entry-points/date-label-dropdown-trigger.d.ts +1 -1
- package/dist/types/entry-points/date-label.d.ts +1 -1
- package/dist/types/entry-points/types.d.ts +1 -1
- package/package.json +14 -22
- package/types/package.json +1 -8
- package/dist/types-ts4.5/entry-points/date-label-dropdown-trigger.d.ts +0 -2
- package/dist/types-ts4.5/entry-points/date-label.d.ts +0 -4
- package/dist/types-ts4.5/entry-points/types.d.ts +0 -2
- package/dist/types-ts4.5/ui/date-label/constants.d.ts +0 -1
- package/dist/types-ts4.5/ui/date-label/index.d.ts +0 -16
- package/dist/types-ts4.5/ui/date-label/types.d.ts +0 -60
- package/dist/types-ts4.5/ui/date-label-dropdown-trigger/index.d.ts +0 -20
- package/dist/types-ts4.5/ui/date-label-dropdown-trigger/types.d.ts +0 -95
package/CHANGELOG.md
CHANGED
|
@@ -1 +1,33 @@
|
|
|
1
1
|
# @atlaskit/date-label
|
|
2
|
+
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 1.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
|
|
14
|
+
Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
|
|
15
|
+
|
|
16
|
+
Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
|
|
17
|
+
|
|
18
|
+
Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
|
|
19
|
+
|
|
20
|
+
```diff
|
|
21
|
+
- "typesVersions": {
|
|
22
|
+
- ">=4.5 <4.9": {
|
|
23
|
+
- "*": [
|
|
24
|
+
- "dist/types-ts4.5/*",
|
|
25
|
+
- "dist/types-ts4.5/index.d.ts"
|
|
26
|
+
- ]
|
|
27
|
+
- }
|
|
28
|
+
- },
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Updated dependencies
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
order: 1
|
|
3
3
|
title: Date label dropdown trigger
|
|
4
|
-
description:
|
|
4
|
+
description:
|
|
5
|
+
Date label dropdown trigger is an interactive date label that opens a dropdown for date selection.
|
|
5
6
|
props:
|
|
6
7
|
packageName: '@atlaskit/date-label'
|
|
7
8
|
exports:
|
|
@@ -57,20 +57,20 @@ Date label dropdown trigger should only open a dropdown to allow for switching b
|
|
|
57
57
|
image={{
|
|
58
58
|
url: dateLabelDropdownDo1Light,
|
|
59
59
|
urlDarkMode: dateLabelDropdownDo1Dark,
|
|
60
|
-
alt: 'Use
|
|
60
|
+
alt: 'Use to enable date selection.',
|
|
61
61
|
}}
|
|
62
62
|
>
|
|
63
|
-
Use
|
|
63
|
+
Use to enable date selection.
|
|
64
64
|
</DoDont>
|
|
65
65
|
<DoDont
|
|
66
66
|
type="dont"
|
|
67
67
|
image={{
|
|
68
68
|
url: dateLabelDropdownDont1Light,
|
|
69
69
|
urlDarkMode: dateLabelDropdownDont1Dark,
|
|
70
|
-
alt: "Don't use
|
|
70
|
+
alt: "Don't use to communicate other information, such as more information about the date.",
|
|
71
71
|
}}
|
|
72
72
|
>
|
|
73
|
-
Don't use
|
|
73
|
+
Don't use to communicate other information, such as more information about the date.
|
|
74
74
|
</DoDont>
|
|
75
75
|
</DoDontGrid>
|
|
76
76
|
|
|
@@ -85,27 +85,27 @@ elements, such as when it appears alongside other buttons.
|
|
|
85
85
|
image={{
|
|
86
86
|
url: dateLabelDropdownDo2Light,
|
|
87
87
|
urlDarkMode: dateLabelDropdownDo2Dark,
|
|
88
|
-
alt: 'Use
|
|
88
|
+
alt: 'Use a spacious date label dropdown trigger alongside other buttons.',
|
|
89
89
|
}}
|
|
90
90
|
>
|
|
91
|
-
Use
|
|
91
|
+
Use a spacious date label dropdown trigger alongside other buttons.
|
|
92
92
|
</DoDont>
|
|
93
93
|
<DoDont
|
|
94
94
|
type="dont"
|
|
95
95
|
image={{
|
|
96
96
|
url: dateLabelDropdownDont2Light,
|
|
97
97
|
urlDarkMode: dateLabelDropdownDont2Dark,
|
|
98
|
-
alt: "Don't use
|
|
98
|
+
alt: "Don't use a default date label dropdown trigger alongside other buttons.",
|
|
99
99
|
}}
|
|
100
100
|
>
|
|
101
|
-
Don't use
|
|
101
|
+
Don't use a default date label dropdown trigger alongside other buttons.
|
|
102
102
|
</DoDont>
|
|
103
103
|
</DoDontGrid>
|
|
104
104
|
|
|
105
105
|
### Use date time picker for date entry in forms
|
|
106
106
|
|
|
107
107
|
Date label dropdown trigger is designed to sit alongside other labels like lozenge and tag. It is
|
|
108
|
-
not a form input. For date entry in forms, use a date time picker.
|
|
108
|
+
not a form input. For date entry in forms, use a [date time picker](/components/datetime-picker).
|
|
109
109
|
|
|
110
110
|
<DoDontGrid>
|
|
111
111
|
<DoDont
|
|
@@ -113,20 +113,20 @@ not a form input. For date entry in forms, use a date time picker.
|
|
|
113
113
|
image={{
|
|
114
114
|
url: dateLabelDropdownDo3Light,
|
|
115
115
|
urlDarkMode: dateLabelDropdownDo3Dark,
|
|
116
|
-
alt: 'Use date label dropdown trigger alongside other labels in
|
|
116
|
+
alt: 'Use date label dropdown trigger to display dates alongside other labels in a view.',
|
|
117
117
|
}}
|
|
118
118
|
>
|
|
119
|
-
Use date label dropdown trigger alongside other labels in
|
|
119
|
+
Use date label dropdown trigger to display dates alongside other labels in a view.
|
|
120
120
|
</DoDont>
|
|
121
121
|
<DoDont
|
|
122
122
|
type="dont"
|
|
123
123
|
image={{
|
|
124
124
|
url: dateLabelDropdownDont3Light,
|
|
125
125
|
urlDarkMode: dateLabelDropdownDont3Dark,
|
|
126
|
-
alt: "Don't use date label dropdown trigger
|
|
126
|
+
alt: "Don't use date label dropdown trigger for date entry in forms.",
|
|
127
127
|
}}
|
|
128
128
|
>
|
|
129
|
-
Don't use date label dropdown trigger
|
|
129
|
+
Don't use date label dropdown trigger for date entry in forms.
|
|
130
130
|
</DoDont>
|
|
131
131
|
</DoDontGrid>
|
|
132
132
|
|
package/date-label/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/date-label.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/date-label.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/date-label.d.ts"
|
|
17
10
|
}
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/date-label-dropdown-trigger.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/date-label-dropdown-trigger.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/date-label-dropdown-trigger.d.ts"
|
|
17
10
|
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
|
|
3
|
+
import type { StructuredContentSource } from '@atlassian/structured-docs-types/types';
|
|
4
|
+
|
|
5
|
+
const documentation: StructuredContentSource = {
|
|
6
|
+
components: [
|
|
7
|
+
{
|
|
8
|
+
name: 'DateLabel',
|
|
9
|
+
description:
|
|
10
|
+
'A date label displays a date as a label, with an optional appearance to communicate a meaningful condition such as a due or overdue date.',
|
|
11
|
+
status: 'open-beta',
|
|
12
|
+
import: {
|
|
13
|
+
name: 'DateLabel',
|
|
14
|
+
package: '@atlaskit/date-label',
|
|
15
|
+
type: 'default',
|
|
16
|
+
packagePath: path.resolve(__dirname),
|
|
17
|
+
packageJson: require('./package.json'),
|
|
18
|
+
},
|
|
19
|
+
usageGuidelines: [
|
|
20
|
+
'Use to display a date as a label on an object (for example a due date), not for entering or selecting a date.',
|
|
21
|
+
'Use the appearance to communicate a meaningful condition: neutral by default, warning for approaching dates, and danger for overdue or critical dates.',
|
|
22
|
+
'A leading icon is shown by default and is appearance-driven (calendar, warning, or danger). Set `hasIconBefore={false}` to hide it.',
|
|
23
|
+
'Use spacious sizing when the date label is displayed alongside buttons.',
|
|
24
|
+
'For entering or selecting a date in a form, use DatePicker from @atlaskit/datetime-picker instead.',
|
|
25
|
+
],
|
|
26
|
+
contentGuidelines: [
|
|
27
|
+
'Keep the date format concise and consistent with the surrounding experience.',
|
|
28
|
+
'Pair the appearance with a label that makes the condition clear; do not rely on color alone.',
|
|
29
|
+
'Use a single date value per label.',
|
|
30
|
+
],
|
|
31
|
+
accessibilityGuidelines: [
|
|
32
|
+
'Do not rely on color alone to convey a date’s condition; ensure the date text is meaningful on its own.',
|
|
33
|
+
'Ensure sufficient color contrast for the date text across all appearances.',
|
|
34
|
+
'Provide clear, descriptive text for screen readers.',
|
|
35
|
+
],
|
|
36
|
+
examples: [
|
|
37
|
+
{
|
|
38
|
+
name: 'Date label',
|
|
39
|
+
description: 'Basic date label example',
|
|
40
|
+
source: path.resolve(__dirname, './examples/0-basic.tsx'),
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
keywords: ['date', 'label', 'date label', 'due date', 'overdue', 'lozenge'],
|
|
44
|
+
categories: ['status-indicators'],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'DateLabelDropdownTrigger',
|
|
48
|
+
description:
|
|
49
|
+
'Date label dropdown trigger displays a date as a label and enables changing the date through a menu or popup.',
|
|
50
|
+
status: 'open-beta',
|
|
51
|
+
import: {
|
|
52
|
+
name: 'DateLabelDropdownTrigger',
|
|
53
|
+
package: '@atlaskit/date-label',
|
|
54
|
+
type: 'named',
|
|
55
|
+
packagePath: path.resolve(__dirname),
|
|
56
|
+
packageJson: require('./package.json'),
|
|
57
|
+
},
|
|
58
|
+
usageGuidelines: [
|
|
59
|
+
'Use to enable date selection—only open a dropdown or popup to allow changing the date.',
|
|
60
|
+
'Use spacious sizing when displayed alongside buttons.',
|
|
61
|
+
'Do not use to communicate other information about the date; use DateLabel instead.',
|
|
62
|
+
'Do not use for date entry in forms; use DatePicker from @atlaskit/datetime-picker instead.',
|
|
63
|
+
],
|
|
64
|
+
contentGuidelines: [
|
|
65
|
+
'Keep the date format concise and consistent with the surrounding experience.',
|
|
66
|
+
'Do not rely on color alone; pair the appearance with clear date text.',
|
|
67
|
+
],
|
|
68
|
+
accessibilityGuidelines: [
|
|
69
|
+
'Do not rely on color alone to convey a date’s condition; ensure the date text is meaningful on its own.',
|
|
70
|
+
'Ensure the trigger is operable by keyboard and exposes an accessible name.',
|
|
71
|
+
],
|
|
72
|
+
examples: [
|
|
73
|
+
{
|
|
74
|
+
name: 'Date label dropdown trigger',
|
|
75
|
+
description: 'DateLabelDropdownTrigger example',
|
|
76
|
+
source: path.resolve(__dirname, './examples/4-dropdown-trigger.tsx'),
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
keywords: ['date', 'label', 'dropdown', 'trigger', 'date label', 'menu', 'interactive'],
|
|
80
|
+
categories: ['status-indicators'],
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export default documentation;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { DateLabelDropdownTriggerProps, DateLabelDropdownTriggerAppearance } from '../ui/date-label-dropdown-trigger/types';
|
|
1
|
+
export type { DateLabelDropdownTriggerProps, DateLabelDropdownTriggerAppearance, } from '../ui/date-label-dropdown-trigger/types';
|
|
2
2
|
export { default } from '../ui/date-label-dropdown-trigger';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { DateLabelProps, DateLabelAppearance } from '../ui/date-label/types';
|
|
2
2
|
export { default } from '../ui/date-label';
|
|
3
|
-
export type { DateLabelDropdownTriggerProps, DateLabelDropdownTriggerAppearance } from '../ui/date-label-dropdown-trigger/types';
|
|
3
|
+
export type { DateLabelDropdownTriggerProps, DateLabelDropdownTriggerAppearance, } from '../ui/date-label-dropdown-trigger/types';
|
|
4
4
|
export { default as DateLabelDropdownTrigger } from '../ui/date-label-dropdown-trigger';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type { DateLabelProps, DateLabelAppearance } from '../ui/date-label/types';
|
|
2
|
-
export type { DateLabelDropdownTriggerProps, DateLabelDropdownTriggerAppearance } from '../ui/date-label-dropdown-trigger/types';
|
|
2
|
+
export type { DateLabelDropdownTriggerProps, DateLabelDropdownTriggerAppearance, } from '../ui/date-label-dropdown-trigger/types';
|
package/package.json
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
+
"name": "@atlaskit/date-label",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Date label is a non-interactive label that displays a date and optionally, visually communicates its status.",
|
|
5
|
+
"author": "Atlassian Pty Ltd",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"registry": "https://registry.npmjs.org/"
|
|
9
|
+
},
|
|
2
10
|
"atlassian": {
|
|
3
11
|
"team": "Design System Team",
|
|
4
12
|
"website": {
|
|
@@ -21,24 +29,16 @@
|
|
|
21
29
|
"module": "dist/esm/entry-points/date-label.js",
|
|
22
30
|
"module:es2019": "dist/es2019/entry-points/date-label.js",
|
|
23
31
|
"types": "dist/types/entry-points/date-label.d.ts",
|
|
24
|
-
"typesVersions": {
|
|
25
|
-
">=4.5 <5.9": {
|
|
26
|
-
"*": [
|
|
27
|
-
"dist/types-ts4.5/*",
|
|
28
|
-
"dist/types-ts4.5/entry-points/date-label.d.ts"
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
32
|
"sideEffects": [
|
|
33
33
|
"*.compiled.css"
|
|
34
34
|
],
|
|
35
35
|
"atlaskit:src": "src/entry-points/date-label.tsx",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@atlaskit/css": "^0.
|
|
38
|
-
"@atlaskit/icon": "^
|
|
39
|
-
"@atlaskit/icon-lab": "^
|
|
40
|
-
"@atlaskit/spinner": "^
|
|
41
|
-
"@atlaskit/tokens": "^
|
|
37
|
+
"@atlaskit/css": "^1.0.0",
|
|
38
|
+
"@atlaskit/icon": "^36.0.0",
|
|
39
|
+
"@atlaskit/icon-lab": "^7.1.0",
|
|
40
|
+
"@atlaskit/spinner": "^20.0.0",
|
|
41
|
+
"@atlaskit/tokens": "^15.0.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0",
|
|
43
43
|
"@compiled/react": "^0.20.0"
|
|
44
44
|
},
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@af/integration-testing": "workspace:^",
|
|
50
50
|
"@af/visual-regression": "workspace:^",
|
|
51
|
-
"@atlaskit/primitives": "^
|
|
51
|
+
"@atlaskit/primitives": "^20.0.0",
|
|
52
52
|
"@atlaskit/ssr": "workspace:^",
|
|
53
53
|
"@testing-library/react": "^16.3.0",
|
|
54
54
|
"react": "^19.0.0",
|
|
@@ -91,13 +91,5 @@
|
|
|
91
91
|
"import-no-extraneous-disable-for-examples-and-docs"
|
|
92
92
|
]
|
|
93
93
|
}
|
|
94
|
-
},
|
|
95
|
-
"name": "@atlaskit/date-label",
|
|
96
|
-
"version": "0.1.0",
|
|
97
|
-
"description": "A Date label is a label that displays a date and optionally, visually communicates its status. And a Date label dropdown trigger is an interactive date label that opens a dropdown for date selection.",
|
|
98
|
-
"author": "Atlassian Pty Ltd",
|
|
99
|
-
"license": "Apache-2.0",
|
|
100
|
-
"publishConfig": {
|
|
101
|
-
"registry": "https://registry.npmjs.org/"
|
|
102
94
|
}
|
|
103
95
|
}
|
package/types/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/types.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/types.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/types.d.ts"
|
|
17
10
|
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export type { DateLabelProps, DateLabelAppearance } from '../ui/date-label/types';
|
|
2
|
-
export { default } from '../ui/date-label';
|
|
3
|
-
export type { DateLabelDropdownTriggerProps, DateLabelDropdownTriggerAppearance } from '../ui/date-label-dropdown-trigger/types';
|
|
4
|
-
export { default as DateLabelDropdownTrigger } from '../ui/date-label-dropdown-trigger';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const DATE_LABEL_TEST_ID = "date-label";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import type { DateLabelProps } from './types';
|
|
6
|
-
/**
|
|
7
|
-
* __DateLabel__
|
|
8
|
-
*
|
|
9
|
-
* A date label is a compact label to display dates for quick recognition.
|
|
10
|
-
* It supports three appearances: `neutral`, `warning`, and `danger`.
|
|
11
|
-
*
|
|
12
|
-
* - [Examples](https://atlassian.design/components/date-label/examples)
|
|
13
|
-
* - [Code](https://atlassian.design/components/date-label/code)
|
|
14
|
-
* - [Usage](https://atlassian.design/components/date-label/usage)
|
|
15
|
-
*/
|
|
16
|
-
export default function DateLabel({ label, appearance, hasIconBefore, maxWidth, isSpacious, iconLabel, testId, }: DateLabelProps): JSX.Element;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
export type DateLabelAppearance = 'neutral' | 'warning' | 'danger';
|
|
2
|
-
export interface DateLabelProps {
|
|
3
|
-
/**
|
|
4
|
-
* The text content to display inside the date label.
|
|
5
|
-
*/
|
|
6
|
-
label: string;
|
|
7
|
-
/**
|
|
8
|
-
* Controls the visual style of the date label.
|
|
9
|
-
* - `neutral` — default grey border style
|
|
10
|
-
* - `warning` — orange border, used for upcoming/near-due dates
|
|
11
|
-
* - `danger` — red border, used for overdue dates
|
|
12
|
-
*
|
|
13
|
-
* @default 'neutral'
|
|
14
|
-
*/
|
|
15
|
-
appearance?: DateLabelAppearance;
|
|
16
|
-
/**
|
|
17
|
-
* When `true`, an icon is displayed before the label text.
|
|
18
|
-
* The icon shown depends on the `appearance`:
|
|
19
|
-
* - `neutral` → CalendarIcon
|
|
20
|
-
* - `warning` → ClockIcon
|
|
21
|
-
* - `danger` → WarningOutlineIcon
|
|
22
|
-
*
|
|
23
|
-
* @default true
|
|
24
|
-
*/
|
|
25
|
-
hasIconBefore?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* The accessible label for the icon. This is passed to the icon's `label` prop
|
|
28
|
-
* and is read by screen readers to convey the icon's meaning.
|
|
29
|
-
*
|
|
30
|
-
* Defaults to a contextual string based on the `appearance`:
|
|
31
|
-
* - `neutral` → `'Calendar'`
|
|
32
|
-
* - `warning` → `'Warning'`
|
|
33
|
-
* - `danger` → `'Danger'`
|
|
34
|
-
*
|
|
35
|
-
* Set to `''` to mark the icon as decorative (when the label text alone is sufficient).
|
|
36
|
-
*/
|
|
37
|
-
iconLabel?: string;
|
|
38
|
-
/**
|
|
39
|
-
* The maximum width of the date label. Accepts a number (treated as px) or
|
|
40
|
-
* a string (e.g. `'50%'`). When the label text exceeds this width it will be
|
|
41
|
-
* truncated with an ellipsis.
|
|
42
|
-
*
|
|
43
|
-
* @default 180
|
|
44
|
-
*/
|
|
45
|
-
maxWidth?: number | string;
|
|
46
|
-
/**
|
|
47
|
-
* When `true`, increases the padding and height of the date label for use in
|
|
48
|
-
* more spacious layouts (e.g. forms or detail views). Sets the height to 32px
|
|
49
|
-
* and increases horizontal padding.
|
|
50
|
-
*
|
|
51
|
-
* @default false
|
|
52
|
-
*/
|
|
53
|
-
isSpacious?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* A `testId` prop is provided for specified elements, which is a unique
|
|
56
|
-
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
57
|
-
* serving as a hook for automated tests.
|
|
58
|
-
*/
|
|
59
|
-
testId?: string;
|
|
60
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import type { DateLabelDropdownTriggerProps } from './types';
|
|
6
|
-
/**
|
|
7
|
-
* __DateLabelDropdownTrigger__
|
|
8
|
-
*
|
|
9
|
-
* An interactive date label that acts as a dropdown trigger.
|
|
10
|
-
* Renders as a `<button>` with hover, pressed, selected, and focus ring states,
|
|
11
|
-
* and a chevron icon on the right to signal interactivity.
|
|
12
|
-
*
|
|
13
|
-
* Supports all three appearances (`neutral`, `warning`, `danger`),
|
|
14
|
-
* the `isSpacious` variant, and `isSelected` for open/active dropdown state.
|
|
15
|
-
*
|
|
16
|
-
* - [Examples](https://atlassian.design/components/date-label/examples)
|
|
17
|
-
* - [Code](https://atlassian.design/components/date-label/code)
|
|
18
|
-
* - [Usage](https://atlassian.design/components/date-label/usage)
|
|
19
|
-
*/
|
|
20
|
-
export default function DateLabelDropdownTrigger({ label, appearance, hasIconBefore, isSpacious, isSelected, isLoading, maxWidth, iconLabel, onClick, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-haspopup': ariaHaspopup, 'aria-label': ariaLabel, testId, }: DateLabelDropdownTriggerProps): JSX.Element;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
export type DateLabelDropdownTriggerAppearance = 'neutral' | 'warning' | 'danger';
|
|
2
|
-
export interface DateLabelDropdownTriggerProps {
|
|
3
|
-
/**
|
|
4
|
-
* The text content to display inside the trigger (e.g. a formatted date string).
|
|
5
|
-
*/
|
|
6
|
-
label: string;
|
|
7
|
-
/**
|
|
8
|
-
* Controls the visual style of the trigger.
|
|
9
|
-
* - `neutral` — default grey border style
|
|
10
|
-
* - `warning` — orange border, used for upcoming/near-due dates
|
|
11
|
-
* - `danger` — red border, used for overdue dates
|
|
12
|
-
*
|
|
13
|
-
* @default 'neutral'
|
|
14
|
-
*/
|
|
15
|
-
appearance?: DateLabelDropdownTriggerAppearance;
|
|
16
|
-
/**
|
|
17
|
-
* When `true`, an icon is displayed before the label text.
|
|
18
|
-
* The icon shown depends on the `appearance`:
|
|
19
|
-
* - `neutral` → CalendarIcon
|
|
20
|
-
* - `warning` → ClockIcon
|
|
21
|
-
* - `danger` → WarningOutlineIcon
|
|
22
|
-
*
|
|
23
|
-
* @default true
|
|
24
|
-
*/
|
|
25
|
-
hasIconBefore?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* When `true`, a spinner replaces the chevron icon and the trigger becomes non-interactive,
|
|
28
|
-
* indicating that an async operation is in progress (for example, saving a date selection).
|
|
29
|
-
*
|
|
30
|
-
* @default false
|
|
31
|
-
*/
|
|
32
|
-
isLoading?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* The accessible label for the leading icon. This is passed to the icon's `label` prop
|
|
35
|
-
* and is read by screen readers to convey the icon's meaning.
|
|
36
|
-
*
|
|
37
|
-
* Defaults to a contextual string based on the `appearance`:
|
|
38
|
-
* - `neutral` → `'Calendar'`
|
|
39
|
-
* - `warning` → `'Warning'`
|
|
40
|
-
* - `danger` → `'Danger'`
|
|
41
|
-
*
|
|
42
|
-
* Set to `''` to mark the icon as decorative (when the label text alone is sufficient).
|
|
43
|
-
*/
|
|
44
|
-
iconLabel?: string;
|
|
45
|
-
/**
|
|
46
|
-
* When `true`, increases the padding and height of the trigger to 32px
|
|
47
|
-
* and uses the body font size for more spacious layouts.
|
|
48
|
-
*
|
|
49
|
-
* @default false
|
|
50
|
-
*/
|
|
51
|
-
isSpacious?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* The maximum width of the trigger. Accepts a number (treated as px) or
|
|
54
|
-
* a string (e.g. `'50%'`). Label text exceeding this width is truncated with an ellipsis.
|
|
55
|
-
*
|
|
56
|
-
* @default 200
|
|
57
|
-
*/
|
|
58
|
-
maxWidth?: number | string;
|
|
59
|
-
/**
|
|
60
|
-
* When `true`, renders the trigger in a selected/active state using the pressed
|
|
61
|
-
* background colour for the current appearance. Use this when the associated
|
|
62
|
-
* dropdown is open or the date has been chosen.
|
|
63
|
-
*
|
|
64
|
-
* @default false
|
|
65
|
-
*/
|
|
66
|
-
isSelected?: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* Callback fired when the trigger button is clicked.
|
|
69
|
-
*/
|
|
70
|
-
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
71
|
-
/**
|
|
72
|
-
* Identifies the popup element that this trigger controls.
|
|
73
|
-
* Should match the `id` of the popup content for screen readers.
|
|
74
|
-
*/
|
|
75
|
-
'aria-controls'?: string;
|
|
76
|
-
/**
|
|
77
|
-
* Announces to assistive technology whether the popup is currently open.
|
|
78
|
-
*/
|
|
79
|
-
'aria-expanded'?: boolean;
|
|
80
|
-
/**
|
|
81
|
-
* Informs assistive technology that this element triggers a popup.
|
|
82
|
-
*/
|
|
83
|
-
'aria-haspopup'?: boolean | 'dialog';
|
|
84
|
-
/**
|
|
85
|
-
* Defines a string value that labels the trigger element for assistive technology.
|
|
86
|
-
* If not provided, the `label` text is used as the accessible name.
|
|
87
|
-
*/
|
|
88
|
-
'aria-label'?: string;
|
|
89
|
-
/**
|
|
90
|
-
* A `testId` prop is provided for specified elements, which is a unique
|
|
91
|
-
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
92
|
-
* serving as a hook for automated tests.
|
|
93
|
-
*/
|
|
94
|
-
testId?: string;
|
|
95
|
-
}
|