@atlaskit/date-label 0.1.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 +1 -0
- package/LICENSE.md +11 -0
- package/README.md +128 -0
- package/constellation/date-label-dropdown-trigger/code.mdx +13 -0
- package/constellation/date-label-dropdown-trigger/examples.mdx +48 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-anatomy-dark.png +0 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-anatomy-light.png +0 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-do-1-dark.png +0 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-do-1-light.png +0 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-do-2-dark.png +0 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-do-2-light.png +0 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-do-3-dark.png +0 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-do-3-light.png +0 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-do-4-dark.png +0 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-do-4-light.png +0 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-dont-1-dark.png +0 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-dont-1-light.png +0 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-dont-2-dark.png +0 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-dont-2-light.png +0 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-dont-3-dark.png +0 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-dont-3-light.png +0 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-dont-4-dark.png +0 -0
- package/constellation/date-label-dropdown-trigger/images/datelabel-dropdown-dont-4-light.png +0 -0
- package/constellation/date-label-dropdown-trigger/usage.mdx +176 -0
- package/constellation/index/examples.mdx +66 -0
- package/constellation/index/images/date-label-anatomy-dark.png +0 -0
- package/constellation/index/images/date-label-anatomy-light.png +0 -0
- package/constellation/index/images/date-label-do-1-dark.png +0 -0
- package/constellation/index/images/date-label-do-1-light.png +0 -0
- package/constellation/index/images/date-label-do-2-dark.png +0 -0
- package/constellation/index/images/date-label-do-2-light.png +0 -0
- package/constellation/index/images/date-label-do-3-dark.png +0 -0
- package/constellation/index/images/date-label-do-3-light.png +0 -0
- package/constellation/index/images/date-label-do-4-dark.png +0 -0
- package/constellation/index/images/date-label-do-4-light.png +0 -0
- package/constellation/index/images/date-label-dont-1-dark.png +0 -0
- package/constellation/index/images/date-label-dont-1-light.png +0 -0
- package/constellation/index/images/date-label-dont-2-dark.png +0 -0
- package/constellation/index/images/date-label-dont-2-light.png +0 -0
- package/constellation/index/images/date-label-dont-3-dark.png +0 -0
- package/constellation/index/images/date-label-dont-3-light.png +0 -0
- package/constellation/index/images/date-label-dont-4-dark.png +0 -0
- package/constellation/index/images/date-label-dont-4-light.png +0 -0
- package/constellation/index/props.mdx +14 -0
- package/constellation/index/usage.mdx +176 -0
- package/date-label/package.json +17 -0
- package/date-label-dropdown-trigger/package.json +17 -0
- package/dist/cjs/entry-points/date-label-dropdown-trigger.js +13 -0
- package/dist/cjs/entry-points/date-label.js +20 -0
- package/dist/cjs/entry-points/types.js +1 -0
- package/dist/cjs/ui/date-label/constants.js +7 -0
- package/dist/cjs/ui/date-label/index.compiled.css +30 -0
- package/dist/cjs/ui/date-label/index.js +90 -0
- package/dist/cjs/ui/date-label/types.js +1 -0
- package/dist/cjs/ui/date-label-dropdown-trigger/index.compiled.css +62 -0
- package/dist/cjs/ui/date-label-dropdown-trigger/index.js +140 -0
- package/dist/cjs/ui/date-label-dropdown-trigger/types.js +1 -0
- package/dist/es2019/entry-points/date-label-dropdown-trigger.js +1 -0
- package/dist/es2019/entry-points/date-label.js +2 -0
- package/dist/es2019/entry-points/types.js +0 -0
- package/dist/es2019/ui/date-label/constants.js +1 -0
- package/dist/es2019/ui/date-label/index.compiled.css +30 -0
- package/dist/es2019/ui/date-label/index.js +78 -0
- package/dist/es2019/ui/date-label/types.js +0 -0
- package/dist/es2019/ui/date-label-dropdown-trigger/index.compiled.css +62 -0
- package/dist/es2019/ui/date-label-dropdown-trigger/index.js +126 -0
- package/dist/es2019/ui/date-label-dropdown-trigger/types.js +0 -0
- package/dist/esm/entry-points/date-label-dropdown-trigger.js +1 -0
- package/dist/esm/entry-points/date-label.js +2 -0
- package/dist/esm/entry-points/types.js +0 -0
- package/dist/esm/ui/date-label/constants.js +1 -0
- package/dist/esm/ui/date-label/index.compiled.css +30 -0
- package/dist/esm/ui/date-label/index.js +81 -0
- package/dist/esm/ui/date-label/types.js +0 -0
- package/dist/esm/ui/date-label-dropdown-trigger/index.compiled.css +62 -0
- package/dist/esm/ui/date-label-dropdown-trigger/index.js +131 -0
- package/dist/esm/ui/date-label-dropdown-trigger/types.js +0 -0
- package/dist/types/entry-points/date-label-dropdown-trigger.d.ts +2 -0
- package/dist/types/entry-points/date-label.d.ts +4 -0
- package/dist/types/entry-points/types.d.ts +2 -0
- package/dist/types/ui/date-label/constants.d.ts +1 -0
- package/dist/types/ui/date-label/index.d.ts +16 -0
- package/dist/types/ui/date-label/types.d.ts +60 -0
- package/dist/types/ui/date-label-dropdown-trigger/index.d.ts +20 -0
- package/dist/types/ui/date-label-dropdown-trigger/types.d.ts +95 -0
- package/dist/types-ts4.5/entry-points/date-label-dropdown-trigger.d.ts +2 -0
- package/dist/types-ts4.5/entry-points/date-label.d.ts +4 -0
- package/dist/types-ts4.5/entry-points/types.d.ts +2 -0
- package/dist/types-ts4.5/ui/date-label/constants.d.ts +1 -0
- package/dist/types-ts4.5/ui/date-label/index.d.ts +16 -0
- package/dist/types-ts4.5/ui/date-label/types.d.ts +60 -0
- package/dist/types-ts4.5/ui/date-label-dropdown-trigger/index.d.ts +20 -0
- package/dist/types-ts4.5/ui/date-label-dropdown-trigger/types.d.ts +95 -0
- package/package.json +103 -0
- package/types/package.json +17 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @atlaskit/date-label
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Copyright 2023 Atlassian Pty Ltd
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
|
|
4
|
+
compliance with the License. You may obtain a copy of the License at
|
|
5
|
+
|
|
6
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
|
|
8
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is
|
|
9
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
10
|
+
implied. See the License for the specific language governing permissions and limitations under the
|
|
11
|
+
License.
|
package/README.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# DateLabel
|
|
2
|
+
|
|
3
|
+
A Date label is a non-interactive label that displays a date and optionally, visually communicates
|
|
4
|
+
its status.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
yarn add @atlaskit/date-label
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
### DateLabel
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import DateLabel from '@atlaskit/date-label';
|
|
18
|
+
// or via entry-point:
|
|
19
|
+
import DateLabel from '@atlaskit/date-label/date-label';
|
|
20
|
+
|
|
21
|
+
// Neutral (default)
|
|
22
|
+
<DateLabel label="29 Jul 2026" />
|
|
23
|
+
|
|
24
|
+
// Warning — for upcoming/near-due dates
|
|
25
|
+
<DateLabel label="29 Jul 2026" appearance="warning" />
|
|
26
|
+
|
|
27
|
+
// Danger — for overdue dates
|
|
28
|
+
<DateLabel label="29 Jul 2026" appearance="danger" />
|
|
29
|
+
|
|
30
|
+
// Without icon
|
|
31
|
+
<DateLabel label="29 Jul 2026" hasIconBefore={false} />
|
|
32
|
+
|
|
33
|
+
// Spacious — 32px height, body font size
|
|
34
|
+
<DateLabel label="29 Jul 2026" isSpacious />
|
|
35
|
+
|
|
36
|
+
// Custom max width
|
|
37
|
+
<DateLabel label="29 Jul 2026" maxWidth={120} />
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### DateLabelDropdownTrigger
|
|
41
|
+
|
|
42
|
+
Date label dropdown trigger is an interactive date label that opens a menu for date selection.
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { DateLabelDropdownTrigger } from '@atlaskit/date-label';
|
|
46
|
+
// or via entry-point:
|
|
47
|
+
import { DateLabelDropdownTrigger } from '@atlaskit/date-label/date-label-dropdown-trigger';
|
|
48
|
+
|
|
49
|
+
<DateLabelDropdownTrigger
|
|
50
|
+
label="29 Jul 2026"
|
|
51
|
+
appearance="neutral"
|
|
52
|
+
onClick={() => setOpen(true)}
|
|
53
|
+
aria-expanded={isOpen}
|
|
54
|
+
aria-haspopup="dialog"
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
// Spacious variant
|
|
58
|
+
<DateLabelDropdownTrigger label="29 Jul 2026" isSpacious />
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Importing types
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
import type { DateLabelProps, DateLabelAppearance } from '@atlaskit/date-label';
|
|
65
|
+
import type {
|
|
66
|
+
DateLabelDropdownTriggerProps,
|
|
67
|
+
DateLabelDropdownTriggerAppearance,
|
|
68
|
+
} from '@atlaskit/date-label';
|
|
69
|
+
|
|
70
|
+
// or via the types entry-point:
|
|
71
|
+
import type {
|
|
72
|
+
DateLabelAppearance,
|
|
73
|
+
DateLabelDropdownTriggerAppearance,
|
|
74
|
+
} from '@atlaskit/date-label/types';
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Appearances
|
|
78
|
+
|
|
79
|
+
| Appearance | Border colour | Text colour | Icon |
|
|
80
|
+
| ---------- | --------------------------------- | -------------------- | ------------------ |
|
|
81
|
+
| `neutral` | `color.border.accent.gray.subtle` | `color.text` | CalendarIcon |
|
|
82
|
+
| `warning` | `color.border.warning.subtle` | `color.text.warning` | ClockIcon |
|
|
83
|
+
| `danger` | `color.border.danger.subtle` | `color.text.danger` | WarningOutlineIcon |
|
|
84
|
+
|
|
85
|
+
## Entry-points
|
|
86
|
+
|
|
87
|
+
| Entry-point | Exports |
|
|
88
|
+
| -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
89
|
+
| `@atlaskit/date-label` | `DateLabel` (default), `DateLabelDropdownTrigger`, all types |
|
|
90
|
+
| `@atlaskit/date-label/date-label` | `DateLabel` (default), `DateLabelProps`, `DateLabelAppearance` |
|
|
91
|
+
| `@atlaskit/date-label/date-label-dropdown-trigger` | `DateLabelDropdownTrigger` (default), `DateLabelDropdownTriggerProps`, `DateLabelDropdownTriggerAppearance` |
|
|
92
|
+
| `@atlaskit/date-label/types` | All exported types |
|
|
93
|
+
|
|
94
|
+
## Props
|
|
95
|
+
|
|
96
|
+
### DateLabel
|
|
97
|
+
|
|
98
|
+
| Prop | Type | Default | Description |
|
|
99
|
+
| --------------- | --------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
100
|
+
| `label` | `string` | required | The text to display |
|
|
101
|
+
| `appearance` | `DateLabelAppearance` | `'neutral'` | Controls border, text, and icon colour |
|
|
102
|
+
| `hasIconBefore` | `boolean` | `true` | Shows a contextual icon before the label |
|
|
103
|
+
| `iconLabel` | `string` | — | Accessible label for the icon. Defaults to `'Date'`, `'Warning'`, `'Danger'` per appearance. Pass `''` to make decorative. |
|
|
104
|
+
| `isSpacious` | `boolean` | `false` | Increases height to 32px and uses body font |
|
|
105
|
+
| `maxWidth` | `number \| string` | `180` | Max width in px (number) or any CSS value (string) |
|
|
106
|
+
| `testId` | `string` | — | `data-testid` for automated tests |
|
|
107
|
+
|
|
108
|
+
### DateLabelDropdownTrigger
|
|
109
|
+
|
|
110
|
+
| Prop | Type | Default | Description |
|
|
111
|
+
| --------------- | -------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
112
|
+
| `label` | `string` | required | The text to display |
|
|
113
|
+
| `appearance` | `DateLabelDropdownTriggerAppearance` | `'neutral'` | Controls border, text, and icon colour |
|
|
114
|
+
| `hasIconBefore` | `boolean` | `true` | Shows a contextual icon before the label |
|
|
115
|
+
| `iconLabel` | `string` | — | Accessible label for the icon. Defaults to `'Date'`, `'Warning'`, `'Danger'` per appearance. Pass `''` to make decorative. |
|
|
116
|
+
| `isLoading` | `boolean` | `false` | Shows a loading spinner overlay and disables interaction |
|
|
117
|
+
| `isSelected` | `boolean` | `false` | Applies selected background and text colour |
|
|
118
|
+
| `isSpacious` | `boolean` | `false` | Increases height to 32px and uses body font |
|
|
119
|
+
| `maxWidth` | `number \| string` | `200` | Max width in px (number) or any CSS value (string) |
|
|
120
|
+
| `onClick` | `MouseEventHandler<HTMLButtonElement>` | — | Click handler |
|
|
121
|
+
| `aria-controls` | `string` | — | ID of the controlled popup element |
|
|
122
|
+
| `aria-expanded` | `boolean` | — | Whether the popup is open |
|
|
123
|
+
| `aria-haspopup` | `boolean \| 'dialog'` | — | Type of popup this triggers |
|
|
124
|
+
| `aria-label` | `string` | — | Accessible label (falls back to `label` text) |
|
|
125
|
+
| `testId` | `string` | — | `data-testid` for automated tests |
|
|
126
|
+
|
|
127
|
+
Detailed docs and example usage can be found
|
|
128
|
+
[here](https://atlaskit.atlassian.com/packages/design-system/date-label).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 1
|
|
3
|
+
title: Date label dropdown trigger
|
|
4
|
+
description: Date label dropdown trigger is an interactive date label that opens a dropdown for date selection.
|
|
5
|
+
props:
|
|
6
|
+
packageName: '@atlaskit/date-label'
|
|
7
|
+
exports:
|
|
8
|
+
- DateLabelDropdownTriggerProps
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
<TSMorphProps packageName="@atlaskit/date-label" exportName="DateLabelDropdownTriggerProps" />
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 0
|
|
3
|
+
title: Date label dropdown trigger
|
|
4
|
+
description:
|
|
5
|
+
Date label dropdown trigger is an interactive date label that opens a dropdown for date selection.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
import DateLabelDropdownTriggerExample from '../../examples/constellation/date-label-dropdown-trigger';
|
|
9
|
+
import DateLabelDropdownTriggerSpacious from '../../examples/constellation/date-label-dropdown-trigger-spacious';
|
|
10
|
+
import DateLabelDropdownTriggerSelected from '../../examples/constellation/date-label-dropdown-trigger-selected';
|
|
11
|
+
import DateLabelDropdownTriggerLoading from '../../examples/constellation/date-label-dropdown-trigger-loading';
|
|
12
|
+
import DateLabelDropdownTriggerNoIcon from '../../examples/constellation/date-label-dropdown-trigger-no-icon';
|
|
13
|
+
|
|
14
|
+
## Basic
|
|
15
|
+
|
|
16
|
+
Use `DateLabelDropdownTrigger` when the date label should open a picker or menu. It renders as a
|
|
17
|
+
`<button>` with hover, pressed, and focus-ring states, and a chevron icon on the right to signal
|
|
18
|
+
interactivity.
|
|
19
|
+
|
|
20
|
+
<Example Component={DateLabelDropdownTriggerExample} packageName="@atlaskit/date-label" />
|
|
21
|
+
|
|
22
|
+
## Spacious
|
|
23
|
+
|
|
24
|
+
Use `isSpacious` for more spacious layouts such as forms or detail views. This increases the height
|
|
25
|
+
to 32px and uses the body font size.
|
|
26
|
+
|
|
27
|
+
<Example Component={DateLabelDropdownTriggerSpacious} packageName="@atlaskit/date-label" />
|
|
28
|
+
|
|
29
|
+
## Selected
|
|
30
|
+
|
|
31
|
+
Use `isSelected` to indicate that the dropdown is currently open. This applies a pressed background
|
|
32
|
+
to the trigger. Pair with `aria-expanded` to communicate the open state to assistive technology.
|
|
33
|
+
|
|
34
|
+
<Example Component={DateLabelDropdownTriggerSelected} packageName="@atlaskit/date-label" />
|
|
35
|
+
|
|
36
|
+
## Loading
|
|
37
|
+
|
|
38
|
+
Use `isLoading` to indicate that an async operation is in progress, such as saving a date selection.
|
|
39
|
+
When loading, the chevron is replaced with a spinner, clicks are suppressed, and `aria-busy` is set
|
|
40
|
+
on the button.
|
|
41
|
+
|
|
42
|
+
<Example Component={DateLabelDropdownTriggerLoading} packageName="@atlaskit/date-label" />
|
|
43
|
+
|
|
44
|
+
## Without icon
|
|
45
|
+
|
|
46
|
+
Set `hasIconBefore={false}` to hide the leading contextual icon.
|
|
47
|
+
|
|
48
|
+
<Example Component={DateLabelDropdownTriggerNoIcon} packageName="@atlaskit/date-label" />
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 2
|
|
3
|
+
title: Date label dropdown trigger
|
|
4
|
+
description:
|
|
5
|
+
Date label dropdown trigger is an interactive date label that opens a dropdown for date selection.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
import Image from '@atlaskit/image';
|
|
9
|
+
|
|
10
|
+
import dateLabelDropdownAnatomyLight from './images/datelabel-dropdown-anatomy-light.png';
|
|
11
|
+
import dateLabelDropdownAnatomyDark from './images/datelabel-dropdown-anatomy-dark.png';
|
|
12
|
+
import dateLabelDropdownDo1Light from './images/datelabel-dropdown-do-1-light.png';
|
|
13
|
+
import dateLabelDropdownDo1Dark from './images/datelabel-dropdown-do-1-dark.png';
|
|
14
|
+
import dateLabelDropdownDont1Light from './images/datelabel-dropdown-dont-1-light.png';
|
|
15
|
+
import dateLabelDropdownDont1Dark from './images/datelabel-dropdown-dont-1-dark.png';
|
|
16
|
+
import dateLabelDropdownDo2Light from './images/datelabel-dropdown-do-2-light.png';
|
|
17
|
+
import dateLabelDropdownDo2Dark from './images/datelabel-dropdown-do-2-dark.png';
|
|
18
|
+
import dateLabelDropdownDont2Light from './images/datelabel-dropdown-dont-2-light.png';
|
|
19
|
+
import dateLabelDropdownDont2Dark from './images/datelabel-dropdown-dont-2-dark.png';
|
|
20
|
+
import dateLabelDropdownDo3Light from './images/datelabel-dropdown-do-3-light.png';
|
|
21
|
+
import dateLabelDropdownDo3Dark from './images/datelabel-dropdown-do-3-dark.png';
|
|
22
|
+
import dateLabelDropdownDont3Light from './images/datelabel-dropdown-dont-3-light.png';
|
|
23
|
+
import dateLabelDropdownDont3Dark from './images/datelabel-dropdown-dont-3-dark.png';
|
|
24
|
+
import dateLabelDropdownDo4Light from './images/datelabel-dropdown-do-4-light.png';
|
|
25
|
+
import dateLabelDropdownDo4Dark from './images/datelabel-dropdown-do-4-dark.png';
|
|
26
|
+
import dateLabelDropdownDont4Light from './images/datelabel-dropdown-dont-4-light.png';
|
|
27
|
+
import dateLabelDropdownDont4Dark from './images/datelabel-dropdown-dont-4-dark.png';
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
Date label dropdown trigger displays dates and provides a trigger to open a dropdown for date
|
|
32
|
+
selection. They differ from date labels in that they contain interactivity to trigger a dropdown,
|
|
33
|
+
making it ideal for workflows that require date picking.
|
|
34
|
+
|
|
35
|
+
## Parts
|
|
36
|
+
|
|
37
|
+
<Image
|
|
38
|
+
src={dateLabelDropdownAnatomyLight}
|
|
39
|
+
srcDark={dateLabelDropdownAnatomyDark}
|
|
40
|
+
alt="The anatomy of the date label dropdown trigger component, showing three parts: an optional icon, a label, and a dropdown chevron icon"
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
1. **Label:** Text displaying the date.
|
|
44
|
+
2. **Icon (optional):** An icon that corresponds to the appearance. Each appearance has a designated
|
|
45
|
+
icon that displays automatically when enabled.
|
|
46
|
+
3. **Dropdown icon:** Indicates that this date label can be selected to open a dropdown.
|
|
47
|
+
|
|
48
|
+
## Best practices
|
|
49
|
+
|
|
50
|
+
### Use date label dropdown trigger for date selection
|
|
51
|
+
|
|
52
|
+
Date label dropdown trigger should only open a dropdown to allow for switching between dates.
|
|
53
|
+
|
|
54
|
+
<DoDontGrid>
|
|
55
|
+
<DoDont
|
|
56
|
+
type="do"
|
|
57
|
+
image={{
|
|
58
|
+
url: dateLabelDropdownDo1Light,
|
|
59
|
+
urlDarkMode: dateLabelDropdownDo1Dark,
|
|
60
|
+
alt: 'Use date label dropdown trigger to open a dropdown for date selection.',
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
Use date label dropdown trigger to open a dropdown for date selection.
|
|
64
|
+
</DoDont>
|
|
65
|
+
<DoDont
|
|
66
|
+
type="dont"
|
|
67
|
+
image={{
|
|
68
|
+
url: dateLabelDropdownDont1Light,
|
|
69
|
+
urlDarkMode: dateLabelDropdownDont1Dark,
|
|
70
|
+
alt: "Don't use date label dropdown trigger to open menus unrelated to date selection.",
|
|
71
|
+
}}
|
|
72
|
+
>
|
|
73
|
+
Don't use date label dropdown trigger to open menus unrelated to date selection.
|
|
74
|
+
</DoDont>
|
|
75
|
+
</DoDontGrid>
|
|
76
|
+
|
|
77
|
+
### Use the spacing property appropriately
|
|
78
|
+
|
|
79
|
+
Use the spacing prop to adjust the date label dropdown trigger so its size aligns with surrounding
|
|
80
|
+
elements, such as when it appears alongside other buttons.
|
|
81
|
+
|
|
82
|
+
<DoDontGrid>
|
|
83
|
+
<DoDont
|
|
84
|
+
type="do"
|
|
85
|
+
image={{
|
|
86
|
+
url: dateLabelDropdownDo2Light,
|
|
87
|
+
urlDarkMode: dateLabelDropdownDo2Dark,
|
|
88
|
+
alt: 'Use the spacious variant when the date label dropdown trigger appears alongside other buttons.',
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
Use the spacious variant when the date label dropdown trigger appears alongside other buttons.
|
|
92
|
+
</DoDont>
|
|
93
|
+
<DoDont
|
|
94
|
+
type="dont"
|
|
95
|
+
image={{
|
|
96
|
+
url: dateLabelDropdownDont2Light,
|
|
97
|
+
urlDarkMode: dateLabelDropdownDont2Dark,
|
|
98
|
+
alt: "Don't use the default size alongside larger interactive elements.",
|
|
99
|
+
}}
|
|
100
|
+
>
|
|
101
|
+
Don't use the default size alongside larger interactive elements.
|
|
102
|
+
</DoDont>
|
|
103
|
+
</DoDontGrid>
|
|
104
|
+
|
|
105
|
+
### Use date time picker for date entry in forms
|
|
106
|
+
|
|
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.
|
|
109
|
+
|
|
110
|
+
<DoDontGrid>
|
|
111
|
+
<DoDont
|
|
112
|
+
type="do"
|
|
113
|
+
image={{
|
|
114
|
+
url: dateLabelDropdownDo3Light,
|
|
115
|
+
urlDarkMode: dateLabelDropdownDo3Dark,
|
|
116
|
+
alt: 'Use date label dropdown trigger alongside other labels in structured UI contexts.',
|
|
117
|
+
}}
|
|
118
|
+
>
|
|
119
|
+
Use date label dropdown trigger alongside other labels in structured UI contexts.
|
|
120
|
+
</DoDont>
|
|
121
|
+
<DoDont
|
|
122
|
+
type="dont"
|
|
123
|
+
image={{
|
|
124
|
+
url: dateLabelDropdownDont3Light,
|
|
125
|
+
urlDarkMode: dateLabelDropdownDont3Dark,
|
|
126
|
+
alt: "Don't use date label dropdown trigger as a form input for date entry.",
|
|
127
|
+
}}
|
|
128
|
+
>
|
|
129
|
+
Don't use date label dropdown trigger as a form input for date entry.
|
|
130
|
+
</DoDont>
|
|
131
|
+
</DoDontGrid>
|
|
132
|
+
|
|
133
|
+
## Accessibility
|
|
134
|
+
|
|
135
|
+
### Use icons that carry appropriate meaning for semantic states
|
|
136
|
+
|
|
137
|
+
Date labels come with designated icons for each of its semantic states. These icons are essential
|
|
138
|
+
for accessibility. Without them, users must rely solely on color to distinguish states, which may
|
|
139
|
+
not be perceivable to everyone.
|
|
140
|
+
|
|
141
|
+
<DoDontGrid>
|
|
142
|
+
<DoDont
|
|
143
|
+
type="do"
|
|
144
|
+
image={{
|
|
145
|
+
url: dateLabelDropdownDo4Light,
|
|
146
|
+
urlDarkMode: dateLabelDropdownDo4Dark,
|
|
147
|
+
alt: 'Use the assigned icons for semantic appearances like an overdue date.',
|
|
148
|
+
}}
|
|
149
|
+
>
|
|
150
|
+
Use the assigned icons for semantic appearances like an overdue date.
|
|
151
|
+
</DoDont>
|
|
152
|
+
<DoDont
|
|
153
|
+
type="dont"
|
|
154
|
+
image={{
|
|
155
|
+
url: dateLabelDropdownDont4Light,
|
|
156
|
+
urlDarkMode: dateLabelDropdownDont4Dark,
|
|
157
|
+
alt: "Don't remove icons for semantic appearances or use icons that don't carry appropriate meaning.",
|
|
158
|
+
}}
|
|
159
|
+
>
|
|
160
|
+
Don't remove icons for semantic appearances or use icons that don't carry appropriate meaning.
|
|
161
|
+
</DoDont>
|
|
162
|
+
</DoDontGrid>
|
|
163
|
+
|
|
164
|
+
## Data Center apps
|
|
165
|
+
|
|
166
|
+
For all new features, we recommend using Atlassian Design System and other
|
|
167
|
+
[Atlaskit components](https://atlaskit.atlassian.com/). For existing code, you can continue to use
|
|
168
|
+
[Atlassian User Interface (AUI)](https://aui.atlassian.com/).
|
|
169
|
+
|
|
170
|
+
## Related
|
|
171
|
+
|
|
172
|
+
- For status information, use a [lozenge](/components/lozenge/lozenge).
|
|
173
|
+
- For lozenges requiring dropdown interactivity, use
|
|
174
|
+
[lozenge dropdown trigger](/components/lozenge/lozenge-dropdown-trigger).
|
|
175
|
+
- For counts or tallies, use a [badge](/components/badge/badge).
|
|
176
|
+
- To visually label content such as categories and attributes, use a [tag](/components/tag/tag).
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Date label
|
|
3
|
+
description:
|
|
4
|
+
Date label is a non-interactive label that displays a date and optionally, visually communicates
|
|
5
|
+
its status.
|
|
6
|
+
order: 0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
import DateLabelNeutral from '../../examples/constellation/date-label-neutral';
|
|
10
|
+
import DateLabelWarning from '../../examples/constellation/date-label-warning';
|
|
11
|
+
import DateLabelDanger from '../../examples/constellation/date-label-danger';
|
|
12
|
+
import DateLabelNoIcon from '../../examples/constellation/date-label-no-icon';
|
|
13
|
+
import DateLabelMaxWidth from '../../examples/constellation/date-label-max-width';
|
|
14
|
+
import DateLabelSpacious from '../../examples/constellation/date-label-spacious';
|
|
15
|
+
|
|
16
|
+
## Appearance
|
|
17
|
+
|
|
18
|
+
Date labels use three appearances to communicate the status of a date at a glance.
|
|
19
|
+
|
|
20
|
+
### Neutral
|
|
21
|
+
|
|
22
|
+
Use `neutral` for standard dates with no urgency. For example, a future date that is well within the
|
|
23
|
+
deadline.
|
|
24
|
+
|
|
25
|
+
<Example Component={DateLabelNeutral} packageName="@atlaskit/date-label" />
|
|
26
|
+
|
|
27
|
+
### Warning
|
|
28
|
+
|
|
29
|
+
Use `warning` for dates that are approaching and require attention. For example, a due date that is
|
|
30
|
+
coming up soon.
|
|
31
|
+
|
|
32
|
+
<Example Component={DateLabelWarning} packageName="@atlaskit/date-label" />
|
|
33
|
+
|
|
34
|
+
### Danger
|
|
35
|
+
|
|
36
|
+
Use `danger` for dates that are overdue or past the deadline.
|
|
37
|
+
|
|
38
|
+
<Example Component={DateLabelDanger} packageName="@atlaskit/date-label" />
|
|
39
|
+
|
|
40
|
+
## Icon
|
|
41
|
+
|
|
42
|
+
By default, each appearance shows a contextual icon before the label:
|
|
43
|
+
|
|
44
|
+
- `neutral` → calendar icon
|
|
45
|
+
- `warning` → clock icon
|
|
46
|
+
- `danger` → warning icon
|
|
47
|
+
|
|
48
|
+
Set `hasIconBefore={false}` to hide the icon.
|
|
49
|
+
|
|
50
|
+
<Example Component={DateLabelNoIcon} packageName="@atlaskit/date-label" />
|
|
51
|
+
|
|
52
|
+
## Spacious
|
|
53
|
+
|
|
54
|
+
Use `isSpacious` for more spacious layouts such as forms or detail views. This increases the height
|
|
55
|
+
to 32px, uses `radius.medium` for the border radius, and switches the label to the body font size.
|
|
56
|
+
|
|
57
|
+
<Example Component={DateLabelSpacious} packageName="@atlaskit/date-label" />
|
|
58
|
+
|
|
59
|
+
## Max width
|
|
60
|
+
|
|
61
|
+
When the label text exceeds the maximum width it will be truncated with an ellipsis. The default
|
|
62
|
+
maximum width is `180px`. Use the `maxWidth` prop to customise this.
|
|
63
|
+
|
|
64
|
+
Avoid truncation wherever possible by using concise date strings.
|
|
65
|
+
|
|
66
|
+
<Example Component={DateLabelMaxWidth} packageName="@atlaskit/date-label" />
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Date label
|
|
3
|
+
description:
|
|
4
|
+
Date label is a non-interactive label that displays a date and optionally, visually communicates
|
|
5
|
+
its status.
|
|
6
|
+
props:
|
|
7
|
+
packageName: '@atlaskit/date-label'
|
|
8
|
+
exports:
|
|
9
|
+
- DateLabelProps
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Props
|
|
13
|
+
|
|
14
|
+
<TSMorphProps exportName="DateLabelProps" packageName="@atlaskit/date-label" />
|