@atlaskit/date-label 0.1.0 → 1.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 +26 -0
- package/constellation/date-label-dropdown-trigger/code.mdx +2 -1
- package/date-label/package.json +1 -8
- package/date-label-dropdown-trigger/package.json +1 -8
- 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 +7 -15
- 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,27 @@
|
|
|
1
1
|
# @atlaskit/date-label
|
|
2
|
+
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
|
|
8
|
+
Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
|
|
9
|
+
|
|
10
|
+
Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
|
|
11
|
+
|
|
12
|
+
Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
|
|
13
|
+
|
|
14
|
+
```diff
|
|
15
|
+
- "typesVersions": {
|
|
16
|
+
- ">=4.5 <4.9": {
|
|
17
|
+
- "*": [
|
|
18
|
+
- "dist/types-ts4.5/*",
|
|
19
|
+
- "dist/types-ts4.5/index.d.ts"
|
|
20
|
+
- ]
|
|
21
|
+
- }
|
|
22
|
+
- },
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- 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:
|
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
|
}
|
|
@@ -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
|
@@ -21,24 +21,16 @@
|
|
|
21
21
|
"module": "dist/esm/entry-points/date-label.js",
|
|
22
22
|
"module:es2019": "dist/es2019/entry-points/date-label.js",
|
|
23
23
|
"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
24
|
"sideEffects": [
|
|
33
25
|
"*.compiled.css"
|
|
34
26
|
],
|
|
35
27
|
"atlaskit:src": "src/entry-points/date-label.tsx",
|
|
36
28
|
"dependencies": {
|
|
37
|
-
"@atlaskit/css": "^0.
|
|
38
|
-
"@atlaskit/icon": "^
|
|
39
|
-
"@atlaskit/icon-lab": "^
|
|
40
|
-
"@atlaskit/spinner": "^
|
|
41
|
-
"@atlaskit/tokens": "^
|
|
29
|
+
"@atlaskit/css": "^1.0.0",
|
|
30
|
+
"@atlaskit/icon": "^36.0.0",
|
|
31
|
+
"@atlaskit/icon-lab": "^7.0.0",
|
|
32
|
+
"@atlaskit/spinner": "^20.0.0",
|
|
33
|
+
"@atlaskit/tokens": "^14.0.0",
|
|
42
34
|
"@babel/runtime": "^7.0.0",
|
|
43
35
|
"@compiled/react": "^0.20.0"
|
|
44
36
|
},
|
|
@@ -48,7 +40,7 @@
|
|
|
48
40
|
"devDependencies": {
|
|
49
41
|
"@af/integration-testing": "workspace:^",
|
|
50
42
|
"@af/visual-regression": "workspace:^",
|
|
51
|
-
"@atlaskit/primitives": "^
|
|
43
|
+
"@atlaskit/primitives": "^20.0.0",
|
|
52
44
|
"@atlaskit/ssr": "workspace:^",
|
|
53
45
|
"@testing-library/react": "^16.3.0",
|
|
54
46
|
"react": "^19.0.0",
|
|
@@ -93,7 +85,7 @@
|
|
|
93
85
|
}
|
|
94
86
|
},
|
|
95
87
|
"name": "@atlaskit/date-label",
|
|
96
|
-
"version": "
|
|
88
|
+
"version": "1.0.0",
|
|
97
89
|
"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
90
|
"author": "Atlassian Pty Ltd",
|
|
99
91
|
"license": "Apache-2.0",
|
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
|
-
}
|