material-inspired-component-library 5.0.0 → 6.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/README.md +15 -1
- package/components/alert/index.scss +4 -4
- package/components/appbar/index.scss +3 -2
- package/components/badge/index.scss +2 -2
- package/components/bottomsheet/index.scss +6 -5
- package/components/button/README.md +9 -1
- package/components/button/index.scss +20 -20
- package/components/button/index.ts +21 -37
- package/components/card/index.scss +10 -9
- package/components/checkbox/index.scss +11 -11
- package/components/datepicker/README.md +146 -0
- package/components/datepicker/index.scss +436 -0
- package/components/datepicker/index.ts +701 -0
- package/components/dialog/README.md +6 -6
- package/components/dialog/index.scss +23 -17
- package/components/divider/index.scss +2 -0
- package/components/iconbutton/README.md +10 -1
- package/components/iconbutton/index.scss +18 -17
- package/components/iconbutton/index.ts +21 -37
- package/components/list/index.scss +10 -10
- package/components/menu/index.scss +2 -1
- package/components/navigationrail/index.scss +10 -9
- package/components/radio/README.md +0 -1
- package/components/radio/index.scss +11 -11
- package/components/select/index.scss +2 -1
- package/components/sidesheet/index.scss +3 -1
- package/components/slider/index.scss +7 -7
- package/components/stepper/index.scss +5 -4
- package/components/switch/README.md +0 -1
- package/components/switch/index.scss +21 -21
- package/components/textfield/index.scss +6 -5
- package/components/textfield/index.ts +63 -6
- package/components/timepicker/README.md +8 -9
- package/components/timepicker/index.scss +9 -8
- package/components/timepicker/index.ts +17 -17
- package/dist/alert.css +1 -1
- package/dist/appbar.css +1 -1
- package/dist/badge.css +1 -1
- package/dist/bottomsheet.css +1 -1
- package/dist/button.css +1 -1
- package/dist/card.css +1 -1
- package/dist/checkbox.css +1 -1
- package/dist/components/button/index.d.ts +2 -1
- package/dist/components/datepicker/index.d.ts +6 -0
- package/dist/components/iconbutton/index.d.ts +2 -1
- package/dist/datepicker.css +1 -0
- package/dist/datepicker.js +1 -0
- package/dist/dialog.css +1 -1
- package/dist/divider.css +1 -1
- package/dist/foundations.css +1 -0
- package/dist/foundations.js +1 -0
- package/dist/iconbutton.css +1 -1
- package/dist/layout.css +1 -1
- package/dist/list.css +1 -1
- package/dist/menu.css +1 -1
- package/dist/micl.css +1 -1
- package/dist/micl.js +1 -1
- package/dist/navigationrail.css +1 -1
- package/dist/radio.css +1 -1
- package/dist/scrollbar.css +1 -0
- package/dist/scrollbar.js +1 -0
- package/dist/select.css +1 -1
- package/dist/sidesheet.css +1 -1
- package/dist/slider.css +1 -1
- package/dist/stepper.css +1 -1
- package/dist/switch.css +1 -1
- package/dist/textfield.css +1 -1
- package/dist/timepicker.css +1 -1
- package/docs/accordion.html +3 -1
- package/docs/alert.html +3 -1
- package/docs/bottomsheet.html +6 -4
- package/docs/button.html +19 -17
- package/docs/card.html +3 -1
- package/docs/checkbox.html +3 -1
- package/docs/datepicker.html +275 -0
- package/docs/dialog.html +24 -10
- package/docs/divider.html +3 -1
- package/docs/docs.js +65 -1
- package/docs/iconbutton.html +9 -9
- package/docs/index.html +6 -3
- package/docs/list.html +3 -1
- package/docs/menu.html +3 -1
- package/docs/micl.css +1 -1
- package/docs/micl.js +1 -1
- package/docs/navigationrail.html +5 -3
- package/docs/radio.html +3 -1
- package/docs/select.html +3 -1
- package/docs/sidesheet.html +6 -4
- package/docs/slider.html +1 -1
- package/docs/stepper.html +3 -1
- package/docs/switch.html +3 -1
- package/docs/textfield.html +3 -1
- package/docs/themes/gray/dark-hc.css +51 -0
- package/docs/themes/gray/dark-mc.css +51 -0
- package/docs/themes/gray/dark.css +51 -0
- package/docs/themes/gray/light-hc.css +51 -0
- package/docs/themes/gray/light-mc.css +51 -0
- package/docs/themes/gray/light.css +51 -0
- package/docs/themes/gray/theme.css +306 -0
- package/docs/themes/greenery/dark-hc.css +51 -0
- package/docs/themes/greenery/dark-mc.css +51 -0
- package/docs/themes/greenery/dark.css +51 -0
- package/docs/themes/greenery/light-hc.css +51 -0
- package/docs/themes/greenery/light-mc.css +51 -0
- package/docs/themes/greenery/light.css +51 -0
- package/docs/themes/greenery/theme.css +306 -0
- package/docs/themes/hermana/dark-hc.css +51 -0
- package/docs/themes/hermana/dark-mc.css +51 -0
- package/docs/themes/hermana/dark.css +51 -0
- package/docs/themes/hermana/light-hc.css +51 -0
- package/docs/themes/hermana/light-mc.css +51 -0
- package/docs/themes/hermana/light.css +51 -0
- package/docs/themes/hermana/theme.css +306 -0
- package/docs/themes/illuminating/dark-hc.css +51 -0
- package/docs/themes/illuminating/dark-mc.css +51 -0
- package/docs/themes/illuminating/dark.css +51 -0
- package/docs/themes/illuminating/light-hc.css +51 -0
- package/docs/themes/illuminating/light-mc.css +51 -0
- package/docs/themes/illuminating/light.css +51 -0
- package/docs/themes/illuminating/theme.css +306 -0
- package/docs/themes/magenta/dark-hc.css +51 -0
- package/docs/themes/magenta/dark-mc.css +51 -0
- package/docs/themes/magenta/dark.css +51 -0
- package/docs/themes/magenta/light-hc.css +51 -0
- package/docs/themes/magenta/light-mc.css +51 -0
- package/docs/themes/magenta/light.css +51 -0
- package/docs/themes/magenta/theme.css +306 -0
- package/docs/themes/mocha/dark-hc.css +51 -0
- package/docs/themes/mocha/dark-mc.css +51 -0
- package/docs/themes/mocha/dark.css +51 -0
- package/docs/themes/mocha/light-hc.css +51 -0
- package/docs/themes/mocha/light-mc.css +51 -0
- package/docs/themes/mocha/light.css +51 -0
- package/docs/themes/mocha/theme.css +306 -0
- package/docs/themes/peri/dark-hc.css +51 -0
- package/docs/themes/peri/dark-mc.css +51 -0
- package/docs/themes/peri/dark.css +51 -0
- package/docs/themes/peri/light-hc.css +51 -0
- package/docs/themes/peri/light-mc.css +51 -0
- package/docs/themes/peri/light.css +51 -0
- package/docs/themes/peri/theme.css +306 -0
- package/docs/timepicker.html +5 -3
- package/foundations/index.scss +102 -0
- package/foundations/layout/index.scss +0 -52
- package/foundations/scrollbar/index.scss +46 -0
- package/intl.d.ts +9 -0
- package/micl.ts +18 -8
- package/package.json +2 -1
- package/styles/README.md +17 -8
- package/styles/motion.scss +3 -0
- package/styles/shapes.scss +23 -18
- package/styles/statelayer.scss +4 -0
- package/styles/typography.scss +2 -2
- package/styles.scss +3 -26
- package/themes/gray/dark-hc.css +51 -0
- package/themes/gray/dark-mc.css +51 -0
- package/themes/gray/dark.css +51 -0
- package/themes/gray/light-hc.css +51 -0
- package/themes/gray/light-mc.css +51 -0
- package/themes/gray/light.css +51 -0
- package/themes/gray/theme.css +306 -0
- package/themes/greenery/dark-hc.css +51 -0
- package/themes/greenery/dark-mc.css +51 -0
- package/themes/greenery/dark.css +51 -0
- package/themes/greenery/light-hc.css +51 -0
- package/themes/greenery/light-mc.css +51 -0
- package/themes/greenery/light.css +51 -0
- package/themes/greenery/theme.css +306 -0
- package/themes/hermana/dark-hc.css +51 -0
- package/themes/hermana/dark-mc.css +51 -0
- package/themes/hermana/dark.css +51 -0
- package/themes/hermana/light-hc.css +51 -0
- package/themes/hermana/light-mc.css +51 -0
- package/themes/hermana/light.css +51 -0
- package/themes/hermana/theme.css +306 -0
- package/themes/illuminating/dark-hc.css +51 -0
- package/themes/illuminating/dark-mc.css +51 -0
- package/themes/illuminating/dark.css +51 -0
- package/themes/illuminating/light-hc.css +51 -0
- package/themes/illuminating/light-mc.css +51 -0
- package/themes/illuminating/light.css +51 -0
- package/themes/illuminating/theme.css +306 -0
- package/themes/magenta/dark-hc.css +51 -0
- package/themes/magenta/dark-mc.css +51 -0
- package/themes/magenta/dark.css +51 -0
- package/themes/magenta/light-hc.css +51 -0
- package/themes/magenta/light-mc.css +51 -0
- package/themes/magenta/light.css +51 -0
- package/themes/magenta/theme.css +306 -0
- package/themes/mocha/dark-hc.css +51 -0
- package/themes/mocha/dark-mc.css +51 -0
- package/themes/mocha/dark.css +51 -0
- package/themes/mocha/light-hc.css +51 -0
- package/themes/mocha/light-mc.css +51 -0
- package/themes/mocha/light.css +51 -0
- package/themes/mocha/theme.css +306 -0
- package/themes/peri/dark-hc.css +51 -0
- package/themes/peri/dark-mc.css +51 -0
- package/themes/peri/dark.css +51 -0
- package/themes/peri/light-hc.css +51 -0
- package/themes/peri/light-mc.css +51 -0
- package/themes/peri/light.css +51 -0
- package/themes/peri/theme.css +306 -0
- package/tsconfig.json +2 -2
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Date picker
|
|
2
|
+
This component implements the [Material Design 3 Expressive Date picker](https://m3.material.io/components/date-pickers/overview) design. It allows users to select a date using either a text input or a calendar interface.
|
|
3
|
+
|
|
4
|
+
## Basic Usage
|
|
5
|
+
|
|
6
|
+
### HTML
|
|
7
|
+
The Date Picker component is an extension of the [**Dialog** component](../dialog/README.md). To create a basic date picker, use a `<dialog>` element with both `micl-dialog` and `micl-datepicker` classes.
|
|
8
|
+
|
|
9
|
+
```HTML
|
|
10
|
+
<dialog id="mydatepicker" class="micl-dialog micl-datepicker" closedby="closerequest" aria-labelledby="mytitle">
|
|
11
|
+
<form method="dialog">
|
|
12
|
+
<div class="micl-dialog__headline">
|
|
13
|
+
<h2 id="mytitle">Enter date</h2>
|
|
14
|
+
<span class="micl-dialog__supporting-text">Select date</span>
|
|
15
|
+
<button type="button" class="micl-datepicker__inputmode micl-iconbutton-standard-s material-symbols-outlined" data-miclalt="calendar_today">edit</button>
|
|
16
|
+
<hr class="micl-divider">
|
|
17
|
+
<div class="micl-datepicker__month-selector">
|
|
18
|
+
<button type="button" class="micl-datepicker__previous micl-iconbutton-standard-xs material-symbols-outlined" aria-label="Previous month">chevron_left</button>
|
|
19
|
+
<button type="button" class="micl-datepicker__month micl-button-text-xs">
|
|
20
|
+
<span class="micl-button__icon material-symbols-outlined" aria-hidden="true">arrow_drop_down</span>
|
|
21
|
+
</button>
|
|
22
|
+
<button type="button" class="micl-datepicker__next micl-iconbutton-standard-xs material-symbols-outlined" aria-label="Next month">chevron_right</button>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="micl-datepicker__year-selector">
|
|
25
|
+
<button type="button" class="micl-datepicker__previous micl-iconbutton-standard-xs material-symbols-outlined" aria-label="Previous year">chevron_left</button>
|
|
26
|
+
<button type="button" class="micl-datepicker__year micl-button-text-xs">
|
|
27
|
+
<span class="micl-button__icon material-symbols-outlined" aria-hidden="true">arrow_drop_down</span>
|
|
28
|
+
</button>
|
|
29
|
+
<button type="button" class="micl-datepicker__next micl-iconbutton-standard-xs material-symbols-outlined" aria-label="Next year">chevron_right</button>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div class="micl-dialog__content">
|
|
34
|
+
<div class="micl-datepicker__calendars"></div>
|
|
35
|
+
<div class="micl-datepicker__years"></div>
|
|
36
|
+
<div class="micl-datepicker__months"></div>
|
|
37
|
+
<div class="micl-datepicker__input micl-textfield-outlined">
|
|
38
|
+
<label for="mydate">Date</label>
|
|
39
|
+
<input type="text" id="mydate">
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div class="micl-dialog__actions">
|
|
44
|
+
<button class="micl-button-text-s" value="">Cancel</button>
|
|
45
|
+
<button class="micl-button-text-s" value="OK">OK</button>
|
|
46
|
+
</div>
|
|
47
|
+
</form>
|
|
48
|
+
</dialog>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### CSS
|
|
52
|
+
Import both the date picker and the dialog styles into your project:
|
|
53
|
+
|
|
54
|
+
```CSS
|
|
55
|
+
@use "material-inspired-component-library/dist/dialog";
|
|
56
|
+
@use "material-inspired-component-library/dist/datepicker";
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Or import all MICL styles:
|
|
60
|
+
```CSS
|
|
61
|
+
@use "material-inspired-component-library/styles";
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### JavaScript
|
|
65
|
+
This component requires JavaScript to function:
|
|
66
|
+
|
|
67
|
+
```JavaScript
|
|
68
|
+
import micl from "material-inspired-component-library/dist/micl";
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
This will initialize any Date picker component, including those that will be added to the DOM later on.
|
|
72
|
+
|
|
73
|
+
### Live Demo
|
|
74
|
+
A live example of the [Date picker component](https://henkpb.github.io/micl/datepicker.html) is available to interact with.
|
|
75
|
+
|
|
76
|
+
## Variants
|
|
77
|
+
Because the Date picker component relies on the Dialog component, it utilizes the same utility classes for content structure. Refer to the [Dialog component documentation](../dialog/README.md) for structural details.
|
|
78
|
+
|
|
79
|
+
### Date Picker Structure
|
|
80
|
+
For the picker to function, the `micl-dialog__content` area **must** contain the `<div class="micl-datepicker__calendars">` container. This holds the month-based calendars.
|
|
81
|
+
|
|
82
|
+
Additionally, the content area may contain:
|
|
83
|
+
|
|
84
|
+
- A container for selecting a year: `<div class="micl-datepicker__years">`
|
|
85
|
+
|
|
86
|
+
- A container for selecting a month: `<div class="micl-datepicker__months">`
|
|
87
|
+
|
|
88
|
+
- A [Text field component](../textfield/README.md) with the `micl-datepicker__input` class for manual date entry.
|
|
89
|
+
|
|
90
|
+
The `micl-dialog__headline` area may contain:
|
|
91
|
+
|
|
92
|
+
- **Title**: A heading element (e.g., `<h2>`) to display the selected date.
|
|
93
|
+
|
|
94
|
+
- **Supporting label**: A text element with the class `micl-dialog__supporting-text`.
|
|
95
|
+
|
|
96
|
+
- **Month selector**: A container with three [Icon button components](../iconbutton/README.md):
|
|
97
|
+
- `micl-datepicker__month`: Opens the month selection container.
|
|
98
|
+
- `micl-datepicker__previous`: Navigates to the previous month.
|
|
99
|
+
- `micl-datepicker__next`: Navigates to the next month.
|
|
100
|
+
|
|
101
|
+
- **Year selector**: A container with three [Icon button components](../iconbutton/README.md):
|
|
102
|
+
- `micl-datepicker__year`: Opens the year selection container.
|
|
103
|
+
- `micl-datepicker__previous`: Navigates to the previous year.
|
|
104
|
+
- `micl-datepicker__next`: Navigates to the next year.
|
|
105
|
+
|
|
106
|
+
Any item not required for your implementation may be omitted.
|
|
107
|
+
|
|
108
|
+
#### Input Mode Switching
|
|
109
|
+
To allow users to toggle between the calendar view and the manual date input, add an icon button to the `micl-dialog__headline` area:
|
|
110
|
+
|
|
111
|
+
- Class: `micl-datepicker__inputmode`
|
|
112
|
+
- Data Attribute: `data-miclalt="calendar_today"` (defines the icon to show when toggled).
|
|
113
|
+
|
|
114
|
+
### Integration
|
|
115
|
+
You can trigger the Date picker component from standard input fields or buttons.
|
|
116
|
+
|
|
117
|
+
#### Connecting to an Input Field
|
|
118
|
+
To replace the browser's native date picker, add the `data-datepicker` attribute to an `<input>` element. The value of this attribute must match the `id` of your Date picker dialog.
|
|
119
|
+
|
|
120
|
+
```HTML
|
|
121
|
+
<input type="date" data-datepicker="mydatepicker" value="2025-12-02">
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
- **Behavior**: Clicking the input opens the picker initialized with the input's current value.
|
|
125
|
+
- **Reusability**: Multiple input fields can target the same Date picker component ID. The picker will automatically update to reflect the date of the specific input field engaged by the user.
|
|
126
|
+
|
|
127
|
+
**Docked Positioning** By default, the Date picker opens in the center of the screen. To anchor it to the input field, use the `micl-dialog--docked` class and CSS Anchor positioning.
|
|
128
|
+
|
|
129
|
+
```HTML
|
|
130
|
+
<dialog id="mydatepicker" class="micl-dialog micl-dialog--docked micl-datepicker" style="position-anchor:--myanchor">
|
|
131
|
+
|
|
132
|
+
<div class="micl-textfield-outlined" style="anchor-name:--myanchor">
|
|
133
|
+
<label for="mytextfield">Start date</label>
|
|
134
|
+
<input type="date" id="mytextfield" data-datepicker="mydatepicker">
|
|
135
|
+
</div>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
#### Connecting to a Button
|
|
139
|
+
You can trigger the picker from a button using the standard `popovertarget` attribute.
|
|
140
|
+
|
|
141
|
+
```HTML
|
|
142
|
+
<button type="button" class="micl-button-text-m" popovertarget="mydatepicker" value="2026-01-23">23.01.2026</button>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
- **Behavior**: The Date picker reads from and writes to the button's value attribute.
|
|
146
|
+
- **Formatting**: The component automatically updates the button's text content with the selected date, formatted according to the user's locale.
|
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright © 2025 Hermana AS
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
// in the Software without restriction, including without limitation the rights
|
|
7
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
// furnished to do so, subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
// copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
// SOFTWARE.
|
|
21
|
+
|
|
22
|
+
@use '../../foundations';
|
|
23
|
+
@use '../../styles/motion';
|
|
24
|
+
@use '../../styles/shapes';
|
|
25
|
+
@use '../../styles/statelayer';
|
|
26
|
+
@use '../../styles/typography';
|
|
27
|
+
|
|
28
|
+
:root {
|
|
29
|
+
--md-comp-date-picker-docked-container-width: 360px;
|
|
30
|
+
--md-comp-date-picker-modal-container-width: 360px;
|
|
31
|
+
--md-comp-date-input-modal-container-width: 328px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
%view-transition-base {
|
|
35
|
+
block-size: fit-content;
|
|
36
|
+
opacity: 1;
|
|
37
|
+
transition-duration: var(--md-comp-date-picker-motion-spatial-duration);
|
|
38
|
+
|
|
39
|
+
&.micl-datepicker__view-hidden {
|
|
40
|
+
block-size: 0;
|
|
41
|
+
opacity: 0;
|
|
42
|
+
transition-property: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:not(.micl-datepicker__view-hidden) {
|
|
46
|
+
transition-behavior: allow-discrete;
|
|
47
|
+
transition-property: opacity, display, block-size;
|
|
48
|
+
transition-timing-function: linear;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
dialog.micl-dialog.micl-datepicker {
|
|
53
|
+
--md-comp-date-picker-motion-spatial: #{motion.$md-sys-motion-expressive-fast-effects};
|
|
54
|
+
--md-comp-date-picker-motion-spatial-duration: #{motion.$md-sys-motion-expressive-default-spatial-duration};
|
|
55
|
+
--md-comp-date-picker-motion-duration: #{motion.$md-sys-motion-expressive-default-effects-duration};
|
|
56
|
+
--md-comp-date-picker-motion-duration-reverse: #{motion.$md-sys-motion-expressive-fast-effects-duration};
|
|
57
|
+
--md-comp-date-picker-button-motion-duration: #{motion.$md-sys-motion-expressive-fast-spatial-duration};
|
|
58
|
+
|
|
59
|
+
inline-size: var(--md-comp-date-picker-modal-container-width, 360px);
|
|
60
|
+
|
|
61
|
+
&:has(.micl-datepicker__input:not(.micl-datepicker__view-hidden)) {
|
|
62
|
+
inline-size: var(--md-comp-date-input-modal-container-width, 328px);
|
|
63
|
+
|
|
64
|
+
.micl-divider {
|
|
65
|
+
margin-block: 9.5px;
|
|
66
|
+
}
|
|
67
|
+
.micl-dialog__content {
|
|
68
|
+
min-block-size: 85px;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
form {
|
|
73
|
+
background-color: inherit;
|
|
74
|
+
}
|
|
75
|
+
.micl-dialog__headline {
|
|
76
|
+
display: grid;
|
|
77
|
+
gap: 0;
|
|
78
|
+
grid-template-columns: max-content 1fr var(--md-sys-target-size, 48px);
|
|
79
|
+
grid-template-areas:
|
|
80
|
+
"datepicker-supporting datepicker-supporting datepicker-supporting"
|
|
81
|
+
"datepicker-close datepicker-action datepicker-action"
|
|
82
|
+
"datepicker-close datepicker-headline datepicker-mode"
|
|
83
|
+
"datepicker-divider datepicker-divider datepicker-divider"
|
|
84
|
+
"datepicker-year-selector datepicker-year-selector datepicker-month-selector";
|
|
85
|
+
padding-inline-end: 12px;
|
|
86
|
+
padding-block: 16px 4px;
|
|
87
|
+
|
|
88
|
+
h1, h2, h3, h4, h5, h6, .micl-heading {
|
|
89
|
+
@include typography.headline-large;
|
|
90
|
+
|
|
91
|
+
grid-area: datepicker-headline;
|
|
92
|
+
margin-block-start: 36px;
|
|
93
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
94
|
+
}
|
|
95
|
+
.micl-dialog__supporting-text {
|
|
96
|
+
@include typography.label-large;
|
|
97
|
+
|
|
98
|
+
grid-area: datepicker-supporting;
|
|
99
|
+
}
|
|
100
|
+
.micl-datepicker__inputmode {
|
|
101
|
+
grid-area: datepicker-mode;
|
|
102
|
+
align-self: flex-end;
|
|
103
|
+
justify-self: center;
|
|
104
|
+
}
|
|
105
|
+
.micl-divider {
|
|
106
|
+
grid-area: datepicker-divider;
|
|
107
|
+
inline-size: calc(100% + 36px);
|
|
108
|
+
margin-block-start: 11.5px;
|
|
109
|
+
margin-inline: -24px;
|
|
110
|
+
}
|
|
111
|
+
.micl-datepicker__month-selector,
|
|
112
|
+
.micl-datepicker__year-selector {
|
|
113
|
+
display: grid;
|
|
114
|
+
grid-template-rows: var(--md-sys-target-size, 48px);
|
|
115
|
+
align-items: center;
|
|
116
|
+
|
|
117
|
+
&.micl-datepicker__view-hidden {
|
|
118
|
+
display: none;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
.micl-datepicker__month-selector {
|
|
122
|
+
grid-area: datepicker-month-selector;
|
|
123
|
+
grid-template-areas: "datepicker-month-previous datepicker-month-next";
|
|
124
|
+
grid-template-columns: var(--md-sys-target-size, 48px) var(--md-sys-target-size, 48px);
|
|
125
|
+
justify-items: flex-end;
|
|
126
|
+
justify-content: flex-end;
|
|
127
|
+
|
|
128
|
+
.micl-datepicker__previous {
|
|
129
|
+
grid-area: datepicker-month-previous;
|
|
130
|
+
}
|
|
131
|
+
.micl-datepicker__next {
|
|
132
|
+
grid-area: datepicker-month-next;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
.micl-datepicker__year-selector {
|
|
136
|
+
grid-area: datepicker-year-selector;
|
|
137
|
+
grid-template-areas: "datepicker-year";
|
|
138
|
+
grid-template-columns: 1fr;
|
|
139
|
+
justify-items: flex-start;
|
|
140
|
+
margin-inline-start: -8px;
|
|
141
|
+
|
|
142
|
+
.micl-datepicker__previous {
|
|
143
|
+
display: none;
|
|
144
|
+
grid-area: datepicker-year-previous;
|
|
145
|
+
}
|
|
146
|
+
.micl-datepicker__next {
|
|
147
|
+
display: none;
|
|
148
|
+
grid-area: datepicker-year-next;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
.micl-datepicker__month {
|
|
152
|
+
display: none;
|
|
153
|
+
grid-area: datepicker-month;
|
|
154
|
+
margin-inline: -12px auto;
|
|
155
|
+
}
|
|
156
|
+
.micl-datepicker__year {
|
|
157
|
+
grid-area: datepicker-year;
|
|
158
|
+
}
|
|
159
|
+
.micl-datepicker__month:not(:disabled),
|
|
160
|
+
.micl-datepicker__year:not(:disabled) {
|
|
161
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.micl-dialog__content {
|
|
166
|
+
display: grid;
|
|
167
|
+
grid-template-areas: "datepicker-view";
|
|
168
|
+
position: relative;
|
|
169
|
+
inline-size: 100%;
|
|
170
|
+
max-block-size: 336px;
|
|
171
|
+
min-block-size: 330px;
|
|
172
|
+
padding-inline: 0;
|
|
173
|
+
overflow: hidden auto;
|
|
174
|
+
transition: min-block-size var(--md-comp-date-picker-motion-spatial-duration) var(--md-comp-date-picker-motion-spatial);
|
|
175
|
+
|
|
176
|
+
.micl-datepicker__calendars {
|
|
177
|
+
display: flex;
|
|
178
|
+
grid-area: datepicker-view;
|
|
179
|
+
position: absolute;
|
|
180
|
+
inset-block-start: 0;
|
|
181
|
+
inset-inline-start: 0;
|
|
182
|
+
block-size: 100%;
|
|
183
|
+
inline-size: 200%;
|
|
184
|
+
opacity: 1;
|
|
185
|
+
overflow: hidden;
|
|
186
|
+
transform: translateX(0);
|
|
187
|
+
transition:
|
|
188
|
+
transform var(--md-comp-date-picker-motion-spatial-duration) var(--md-comp-date-picker-motion-spatial),
|
|
189
|
+
opacity var(--md-comp-date-picker-motion-duration-reverse) linear,
|
|
190
|
+
block-size var(--md-comp-date-picker-motion-duration-reverse) linear allow-discrete,
|
|
191
|
+
display var(--md-comp-date-picker-motion-duration-reverse) linear allow-discrete;
|
|
192
|
+
|
|
193
|
+
&.micl-datepicker__view-hidden {
|
|
194
|
+
block-size: 0%;
|
|
195
|
+
opacity: 0;
|
|
196
|
+
transition-property: none;
|
|
197
|
+
}
|
|
198
|
+
&.micl-startleft,
|
|
199
|
+
&.micl-moveright {
|
|
200
|
+
transform: translateX(0%);
|
|
201
|
+
}
|
|
202
|
+
&.micl-startright,
|
|
203
|
+
&.micl-moveleft {
|
|
204
|
+
transform: translateX(-50%);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.micl-datepicker__calendar {
|
|
208
|
+
flex-shrink: 0;
|
|
209
|
+
block-size: 100%;
|
|
210
|
+
inline-size: 50%;
|
|
211
|
+
|
|
212
|
+
.micl-datepicker__calendar-inner {
|
|
213
|
+
@include typography.body-large;
|
|
214
|
+
|
|
215
|
+
box-sizing: border-box;
|
|
216
|
+
display: grid;
|
|
217
|
+
grid-template-columns: repeat(7, var(--md-sys-target-size, 48px));
|
|
218
|
+
grid-template-rows: 40px repeat(6, var(--md-sys-target-size, 48px));
|
|
219
|
+
block-size: 100%;
|
|
220
|
+
inline-size: 100%;
|
|
221
|
+
padding-inline: 12px;
|
|
222
|
+
|
|
223
|
+
span, time {
|
|
224
|
+
box-sizing: border-box;
|
|
225
|
+
display: inline-flex;
|
|
226
|
+
justify-content: center;
|
|
227
|
+
border: none;
|
|
228
|
+
color: var(--md-sys-color-on-surface);
|
|
229
|
+
-webkit-tap-highlight-color: transparent;
|
|
230
|
+
}
|
|
231
|
+
time {
|
|
232
|
+
--statelayer-color: var(--md-sys-color-on-surface-variant);
|
|
233
|
+
--statelayer-opacity: 0%;
|
|
234
|
+
|
|
235
|
+
align-items: center;
|
|
236
|
+
border: 4px solid transparent;
|
|
237
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
238
|
+
background-image: linear-gradient(rgb(from var(--statelayer-color) r g b / var(--statelayer-opacity)));
|
|
239
|
+
background-repeat: no-repeat;
|
|
240
|
+
background-size: 100%;
|
|
241
|
+
background-clip: content-box;
|
|
242
|
+
transition: --statelayer-opacity var(--md-comp-date-picker-button-motion-duration) linear;
|
|
243
|
+
|
|
244
|
+
&.micl-datepicker__today {
|
|
245
|
+
outline: 1px solid var(--md-sys-color-primary);
|
|
246
|
+
outline-offset: -5px;
|
|
247
|
+
color: var(--md-sys-color-primary);
|
|
248
|
+
|
|
249
|
+
&:hover,
|
|
250
|
+
&:focus-visible,
|
|
251
|
+
&:active {
|
|
252
|
+
--statelayer-color: var(--md-sys-color-primary);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
&.micl-datepicker__selected {
|
|
256
|
+
background-color: var(--md-sys-color-primary);
|
|
257
|
+
color: var(--md-sys-color-on-primary);
|
|
258
|
+
|
|
259
|
+
&:hover,
|
|
260
|
+
&:focus-visible,
|
|
261
|
+
&:active {
|
|
262
|
+
--statelayer-color: var(--md-sys-color-on-primary);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
&.micl-datepicker__outside {
|
|
266
|
+
color: rgb(from var(--md-sys-color-on-surface) r g b / var(--md-sys-state-disabled-state-layer-opacity, 38%));
|
|
267
|
+
}
|
|
268
|
+
&:not(.micl-datepicker__outside) {
|
|
269
|
+
cursor: pointer;
|
|
270
|
+
}
|
|
271
|
+
&:hover {
|
|
272
|
+
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
|
|
273
|
+
}
|
|
274
|
+
&:focus-visible {
|
|
275
|
+
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
|
|
276
|
+
}
|
|
277
|
+
&:active {
|
|
278
|
+
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
.micl-datepicker__months,
|
|
285
|
+
.micl-datepicker__years,
|
|
286
|
+
.micl-datepicker__input {
|
|
287
|
+
grid-area: datepicker-view;
|
|
288
|
+
@extend %view-transition-base;
|
|
289
|
+
}
|
|
290
|
+
.micl-datepicker__months {
|
|
291
|
+
overflow-y: hidden;
|
|
292
|
+
|
|
293
|
+
.micl-datepicker__months-inner {
|
|
294
|
+
block-size: auto;
|
|
295
|
+
inline-size: 100%;
|
|
296
|
+
}
|
|
297
|
+
label {
|
|
298
|
+
@include typography.body-large;
|
|
299
|
+
|
|
300
|
+
display: flex;
|
|
301
|
+
align-items: center;
|
|
302
|
+
block-size: var(--md-sys-target-size, 48px);
|
|
303
|
+
gap: 8px;
|
|
304
|
+
padding-inline-start: 16px;
|
|
305
|
+
color: var(--md-sys-color-on-surface);
|
|
306
|
+
cursor: pointer;
|
|
307
|
+
|
|
308
|
+
input[type=radio] {
|
|
309
|
+
appearance: none;
|
|
310
|
+
margin: 0;
|
|
311
|
+
}
|
|
312
|
+
span {
|
|
313
|
+
visibility: hidden;
|
|
314
|
+
color: var(--md-sys-color-on-surface);
|
|
315
|
+
}
|
|
316
|
+
&:has(input:checked) {
|
|
317
|
+
background-color: var(--md-sys-color-surface-variant);
|
|
318
|
+
|
|
319
|
+
span {
|
|
320
|
+
visibility: visible;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
.micl-datepicker__years {
|
|
326
|
+
overflow-y: hidden;
|
|
327
|
+
|
|
328
|
+
.micl-datepicker__years-inner {
|
|
329
|
+
display: flex;
|
|
330
|
+
flex-wrap: wrap;
|
|
331
|
+
justify-content: center;
|
|
332
|
+
block-size: auto;
|
|
333
|
+
inline-size: 100%;
|
|
334
|
+
}
|
|
335
|
+
label {
|
|
336
|
+
--statelayer-color: var(--md-sys-color-on-surface-variant);
|
|
337
|
+
--statelayer-opacity: 0%;
|
|
338
|
+
|
|
339
|
+
@include typography.body-large;
|
|
340
|
+
|
|
341
|
+
display: inline-flex;
|
|
342
|
+
align-items: center;
|
|
343
|
+
justify-content: center;
|
|
344
|
+
block-size: 36px;
|
|
345
|
+
inline-size: 72px;
|
|
346
|
+
margin: 8px;
|
|
347
|
+
border: calc((var(--md-sys-target-size, 48px) - 36px) / 2) solid transparent;
|
|
348
|
+
border-radius: calc(var(--md-sys-target-size, 48px) / 2);
|
|
349
|
+
background-image: linear-gradient(rgb(from var(--statelayer-color) r g b / var(--statelayer-opacity)));
|
|
350
|
+
background-repeat: no-repeat;
|
|
351
|
+
background-size: 100%;
|
|
352
|
+
background-clip: content-box;
|
|
353
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
354
|
+
cursor: pointer;
|
|
355
|
+
transition: --statelayer-opacity var(--md-comp-date-picker-button-motion-duration) linear;
|
|
356
|
+
|
|
357
|
+
&:hover {
|
|
358
|
+
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
|
|
359
|
+
}
|
|
360
|
+
&:focus-visible {
|
|
361
|
+
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
|
|
362
|
+
}
|
|
363
|
+
&:active {
|
|
364
|
+
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
|
|
365
|
+
}
|
|
366
|
+
&:has(input:checked) {
|
|
367
|
+
color: var(--md-sys-color-on-primary);
|
|
368
|
+
background-color: var(--md-sys-color-primary);
|
|
369
|
+
|
|
370
|
+
&:hover,
|
|
371
|
+
&:focus-visible,
|
|
372
|
+
&:active {
|
|
373
|
+
--statelayer-color: var(--md-sys-color-on-primary);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
input[type=radio] {
|
|
378
|
+
appearance: none;
|
|
379
|
+
margin: 0;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
.micl-datepicker__input {
|
|
384
|
+
padding-inline: 16px;
|
|
385
|
+
margin-block-end: 16px;
|
|
386
|
+
|
|
387
|
+
&.micl-datepicker__view-hidden,
|
|
388
|
+
input[type=date]::-webkit-calendar-picker-indicator,
|
|
389
|
+
input[type=date]::-webkit-inner-spin-button {
|
|
390
|
+
display: none;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.micl-dialog__actions {
|
|
396
|
+
padding: 8px 12px 12px 12px;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
&.micl-dialog--docked {
|
|
400
|
+
inline-size: var(--md-comp-date-picker-docked-container-width, 360px);
|
|
401
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
402
|
+
|
|
403
|
+
.micl-dialog__headline {
|
|
404
|
+
grid-template-areas: "datepicker-month-selector datepicker-year-selector";
|
|
405
|
+
grid-template-columns: 1fr 1fr;
|
|
406
|
+
padding: 8px 12px 18px 12px;
|
|
407
|
+
|
|
408
|
+
h1, h2, h3, h4, h5, h6, .micl-heading,
|
|
409
|
+
.micl-dialog__supporting-text,
|
|
410
|
+
.micl-datepicker__inputmode {
|
|
411
|
+
display: none;
|
|
412
|
+
}
|
|
413
|
+
.micl-datepicker__month-selector {
|
|
414
|
+
grid-template-areas: "datepicker-month-previous datepicker-month datepicker-month-next";
|
|
415
|
+
grid-template-columns: var(--md-sys-target-size, 48px) 1fr var(--md-sys-target-size, 48px);
|
|
416
|
+
|
|
417
|
+
.micl-datepicker__month {
|
|
418
|
+
display: inline-flex;
|
|
419
|
+
margin-inline: 0;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
.micl-datepicker__year-selector {
|
|
423
|
+
grid-template-areas: "datepicker-year-previous datepicker-year datepicker-year-next";
|
|
424
|
+
grid-template-columns: var(--md-sys-target-size, 48px) 1fr var(--md-sys-target-size, 48px);
|
|
425
|
+
|
|
426
|
+
.micl-datepicker__previous,
|
|
427
|
+
.micl-datepicker__next {
|
|
428
|
+
display: block;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
.micl-dialog__actions > button {
|
|
433
|
+
margin-block: -2px;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|