@vaadin/date-picker 25.0.0-alpha10 → 25.0.0-alpha12

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.
Files changed (33) hide show
  1. package/package.json +12 -15
  2. package/src/styles/vaadin-date-picker-base-styles.js +1 -1
  3. package/src/styles/vaadin-date-picker-overlay-content-base-styles.js +1 -1
  4. package/src/styles/vaadin-date-picker-year-base-styles.js +1 -1
  5. package/src/styles/vaadin-month-calendar-base-styles.js +1 -1
  6. package/src/vaadin-date-picker-mixin.js +1 -1
  7. package/src/vaadin-date-picker-overlay-content.js +1 -1
  8. package/src/vaadin-date-picker-overlay.js +2 -2
  9. package/src/vaadin-date-picker-year.js +1 -1
  10. package/src/vaadin-date-picker.d.ts +0 -5
  11. package/src/vaadin-date-picker.js +3 -7
  12. package/src/vaadin-month-calendar.js +1 -1
  13. package/vaadin-date-picker.js +1 -1
  14. package/web-types.json +2 -2
  15. package/web-types.lit.json +2 -2
  16. package/src/styles/vaadin-date-picker-core-styles.d.ts +0 -8
  17. package/src/styles/vaadin-date-picker-core-styles.js +0 -21
  18. package/src/styles/vaadin-date-picker-overlay-content-core-styles.js +0 -54
  19. package/src/styles/vaadin-date-picker-overlay-core-styles.js +0 -23
  20. package/src/styles/vaadin-date-picker-year-core-styles.js +0 -13
  21. package/src/styles/vaadin-month-calendar-core-styles.js +0 -64
  22. package/theme/lumo/vaadin-date-picker-overlay-content-styles.d.ts +0 -7
  23. package/theme/lumo/vaadin-date-picker-overlay-content-styles.js +0 -137
  24. package/theme/lumo/vaadin-date-picker-overlay-styles.d.ts +0 -2
  25. package/theme/lumo/vaadin-date-picker-overlay-styles.js +0 -54
  26. package/theme/lumo/vaadin-date-picker-styles.d.ts +0 -2
  27. package/theme/lumo/vaadin-date-picker-styles.js +0 -30
  28. package/theme/lumo/vaadin-date-picker-year-styles.d.ts +0 -1
  29. package/theme/lumo/vaadin-date-picker-year-styles.js +0 -32
  30. package/theme/lumo/vaadin-date-picker.d.ts +0 -5
  31. package/theme/lumo/vaadin-date-picker.js +0 -5
  32. package/theme/lumo/vaadin-month-calendar-styles.d.ts +0 -5
  33. package/theme/lumo/vaadin-month-calendar-styles.js +0 -158
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/date-picker",
3
- "version": "25.0.0-alpha10",
3
+ "version": "25.0.0-alpha12",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,9 +21,6 @@
21
21
  "type": "module",
22
22
  "files": [
23
23
  "src",
24
- "!src/styles/*-base-styles.d.ts",
25
- "!src/styles/*-base-styles.js",
26
- "theme",
27
24
  "vaadin-*.d.ts",
28
25
  "vaadin-*.js",
29
26
  "web-types.json",
@@ -37,25 +34,25 @@
37
34
  ],
38
35
  "dependencies": {
39
36
  "@open-wc/dedupe-mixin": "^1.3.0",
40
- "@vaadin/a11y-base": "25.0.0-alpha10",
41
- "@vaadin/button": "25.0.0-alpha10",
42
- "@vaadin/component-base": "25.0.0-alpha10",
43
- "@vaadin/field-base": "25.0.0-alpha10",
44
- "@vaadin/input-container": "25.0.0-alpha10",
45
- "@vaadin/overlay": "25.0.0-alpha10",
46
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha10",
47
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha10",
37
+ "@vaadin/a11y-base": "25.0.0-alpha12",
38
+ "@vaadin/button": "25.0.0-alpha12",
39
+ "@vaadin/component-base": "25.0.0-alpha12",
40
+ "@vaadin/field-base": "25.0.0-alpha12",
41
+ "@vaadin/input-container": "25.0.0-alpha12",
42
+ "@vaadin/overlay": "25.0.0-alpha12",
43
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha12",
48
44
  "lit": "^3.0.0"
49
45
  },
50
46
  "devDependencies": {
51
- "@vaadin/chai-plugins": "25.0.0-alpha10",
52
- "@vaadin/test-runner-commands": "25.0.0-alpha10",
47
+ "@vaadin/chai-plugins": "25.0.0-alpha12",
48
+ "@vaadin/test-runner-commands": "25.0.0-alpha12",
53
49
  "@vaadin/testing-helpers": "^2.0.0",
50
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha12",
54
51
  "sinon": "^18.0.0"
55
52
  },
56
53
  "web-types": [
57
54
  "web-types.json",
58
55
  "web-types.lit.json"
59
56
  ],
60
- "gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
57
+ "gitHead": "e75527348f9ba7c363d068c868b9f030c15b84a1"
61
58
  }
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import '@vaadin/component-base/src/style-props.js';
6
+ import '@vaadin/component-base/src/styles/style-props.js';
7
7
  import { css } from 'lit';
8
8
 
9
9
  export const datePickerStyles = css`
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import '@vaadin/component-base/src/style-props.js';
6
+ import '@vaadin/component-base/src/styles/style-props.js';
7
7
  import { css } from 'lit';
8
8
 
9
9
  export const overlayContentStyles = css`
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import '@vaadin/component-base/src/style-props.js';
6
+ import '@vaadin/component-base/src/styles/style-props.js';
7
7
  import { css } from 'lit';
8
8
 
9
9
  export const datePickerYearStyles = css`
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import '@vaadin/component-base/src/style-props.js';
6
+ import '@vaadin/component-base/src/styles/style-props.js';
7
7
  import { css } from 'lit';
8
8
 
9
9
  export const monthCalendarStyles = css`
@@ -1033,7 +1033,7 @@ export const DatePickerMixin = (subclass) =>
1033
1033
  */
1034
1034
  _onClick(event) {
1035
1035
  // Ignore click events bubbling from the overlay
1036
- if (event.composedPath().includes(this._overlayContent)) {
1036
+ if (event.composedPath().includes(this._overlayElement)) {
1037
1037
  return;
1038
1038
  }
1039
1039
 
@@ -14,7 +14,7 @@ import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
14
14
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
15
15
  import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
16
16
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
17
- import { overlayContentStyles } from './styles/vaadin-date-picker-overlay-content-core-styles.js';
17
+ import { overlayContentStyles } from './styles/vaadin-date-picker-overlay-content-base-styles.js';
18
18
  import { DatePickerOverlayContentMixin } from './vaadin-date-picker-overlay-content-mixin.js';
19
19
 
20
20
  /**
@@ -7,10 +7,10 @@ import { html, LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
9
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
- import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-core-styles.js';
10
+ import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-base-styles.js';
11
11
  import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
12
12
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
13
- import { datePickerOverlayStyles } from './styles/vaadin-date-picker-overlay-core-styles.js';
13
+ import { datePickerOverlayStyles } from './styles/vaadin-date-picker-overlay-base-styles.js';
14
14
  import { DatePickerOverlayMixin } from './vaadin-date-picker-overlay-mixin.js';
15
15
 
16
16
  /**
@@ -8,7 +8,7 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9
9
  import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
10
10
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
- import { datePickerYearStyles } from './styles/vaadin-date-picker-year-core-styles.js';
11
+ import { datePickerYearStyles } from './styles/vaadin-date-picker-year-base-styles.js';
12
12
 
13
13
  /**
14
14
  * An element used internally by `<vaadin-date-picker>`. Not intended to be used separately.
@@ -102,13 +102,11 @@ export interface DatePickerEventMap extends HTMLElementEventMap, DatePickerCusto
102
102
  * In addition to `<vaadin-date-picker>` itself, the following internal
103
103
  * components are themable:
104
104
  *
105
- * - `<vaadin-date-picker-overlay>` - has the same API as [`<vaadin-overlay>`](#/elements/vaadin-overlay).
106
105
  * - `<vaadin-date-picker-overlay-content>`
107
106
  * - `<vaadin-date-picker-month-scroller>`
108
107
  * - `<vaadin-date-picker-year-scroller>`
109
108
  * - `<vaadin-date-picker-year>`
110
109
  * - `<vaadin-month-calendar>`
111
- * - [`<vaadin-input-container>`](#/elements/vaadin-input-container) - an internal element wrapping the input.
112
110
  *
113
111
  * In order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:
114
112
  *
@@ -149,9 +147,6 @@ export interface DatePickerEventMap extends HTMLElementEventMap, DatePickerCusto
149
147
  * `year-number` | Year number
150
148
  * `year-separator` | Year separator
151
149
  *
152
- * Note: the `theme` attribute value set on `<vaadin-date-picker>` is
153
- * propagated to the internal components listed above.
154
- *
155
150
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
156
151
  *
157
152
  * ### Change events
@@ -18,7 +18,7 @@ import { LabelledInputController } from '@vaadin/field-base/src/labelled-input-c
18
18
  import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
19
19
  import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
20
20
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
21
- import { datePickerStyles } from './styles/vaadin-date-picker-core-styles.js';
21
+ import { datePickerStyles } from './styles/vaadin-date-picker-base-styles.js';
22
22
  import { DatePickerMixin } from './vaadin-date-picker-mixin.js';
23
23
 
24
24
  /**
@@ -66,13 +66,11 @@ import { DatePickerMixin } from './vaadin-date-picker-mixin.js';
66
66
  * In addition to `<vaadin-date-picker>` itself, the following internal
67
67
  * components are themable:
68
68
  *
69
- * - `<vaadin-date-picker-overlay>` - has the same API as [`<vaadin-overlay>`](#/elements/vaadin-overlay).
70
69
  * - `<vaadin-date-picker-overlay-content>`
71
70
  * - `<vaadin-date-picker-month-scroller>`
72
71
  * - `<vaadin-date-picker-year-scroller>`
73
72
  * - `<vaadin-date-picker-year>`
74
73
  * - `<vaadin-month-calendar>`
75
- * - [`<vaadin-input-container>`](#/elements/vaadin-input-container) - an internal element wrapping the input.
76
74
  *
77
75
  * In order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:
78
76
  *
@@ -113,9 +111,6 @@ import { DatePickerMixin } from './vaadin-date-picker-mixin.js';
113
111
  * `year-number` | Year number
114
112
  * `year-separator` | Year separator
115
113
  *
116
- * Note: the `theme` attribute value set on `<vaadin-date-picker>` is
117
- * propagated to the internal components listed above.
118
- *
119
114
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
120
115
  *
121
116
  * ### Change events
@@ -276,7 +271,8 @@ class DatePicker extends DatePickerMixin(
276
271
  /** @private */
277
272
  _onVaadinOverlayClose(e) {
278
273
  // Prevent closing the overlay on label element click
279
- if (e.detail.sourceEvent && e.detail.sourceEvent.composedPath().includes(this)) {
274
+ const event = e.detail.sourceEvent;
275
+ if (event && event.composedPath().includes(this) && !event.composedPath().includes(this._overlayElement)) {
280
276
  e.preventDefault();
281
277
  }
282
278
  }
@@ -8,7 +8,7 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9
9
  import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
10
10
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
- import { monthCalendarStyles } from './styles/vaadin-month-calendar-core-styles.js';
11
+ import { monthCalendarStyles } from './styles/vaadin-month-calendar-base-styles.js';
12
12
  import { MonthCalendarMixin } from './vaadin-month-calendar-mixin.js';
13
13
 
14
14
  /**
@@ -1,2 +1,2 @@
1
- import './theme/lumo/vaadin-date-picker.js';
1
+ import './src/vaadin-date-picker.js';
2
2
  export * from './src/vaadin-date-picker.js';
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/date-picker",
4
- "version": "25.0.0-alpha10",
4
+ "version": "25.0.0-alpha12",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-date-picker",
11
- "description": "`<vaadin-date-picker>` is an input field that allows to enter a date by typing or by selecting from a calendar overlay.\n\n```html\n<vaadin-date-picker label=\"Birthday\"></vaadin-date-picker>\n```\n```js\ndatePicker.value = '2016-03-02';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-date-picker>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n-----------------|--------------------\n`toggle-button` | Toggle button\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description\n---------------|----------------------------------------------\n`opened` | Set when the date selector overlay is opened\n`week-numbers` | Set when week numbers are shown in the calendar\n\n### Internal components\n\nIn addition to `<vaadin-date-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-date-picker-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-overlay).\n- `<vaadin-date-picker-overlay-content>`\n- `<vaadin-date-picker-month-scroller>`\n- `<vaadin-date-picker-year-scroller>`\n- `<vaadin-date-picker-year>`\n- `<vaadin-month-calendar>`\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Toolbar with slotted buttons\n\nThe following state attributes are available on the `<vaadin-date-picker-overlay-content>` element:\n\nAttribute | Description\n----------------|-------------------------------------------------\n`desktop` | Set when the overlay content is in desktop mode\n`fullscreen` | Set when the overlay content is in fullscreen mode\n`years-visible` | Set when the year scroller is visible in fullscreen mode\n\nIn order to style the month calendar, use `<vaadin-month-calendar>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`month-header` | Month title\n`weekdays` | Weekday container\n`weekday` | Weekday element\n`week-numbers` | Week numbers container\n`week-number` | Week number element\n`date` | Date element\n`disabled` | Disabled date element\n`focused` | Focused date element\n`selected` | Selected date element\n`today` | Date element corresponding to the current day\n`past` | Date element corresponding to the date in the past\n`future` | Date element corresponding to the date in the future\n\nIn order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`year-number` | Year number\n`year-separator` | Year separator\n\nNote: the `theme` attribute value set on `<vaadin-date-picker>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | unparsable-change",
11
+ "description": "`<vaadin-date-picker>` is an input field that allows to enter a date by typing or by selecting from a calendar overlay.\n\n```html\n<vaadin-date-picker label=\"Birthday\"></vaadin-date-picker>\n```\n```js\ndatePicker.value = '2016-03-02';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-date-picker>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha12/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n-----------------|--------------------\n`toggle-button` | Toggle button\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description\n---------------|----------------------------------------------\n`opened` | Set when the date selector overlay is opened\n`week-numbers` | Set when week numbers are shown in the calendar\n\n### Internal components\n\nIn addition to `<vaadin-date-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-date-picker-overlay-content>`\n- `<vaadin-date-picker-month-scroller>`\n- `<vaadin-date-picker-year-scroller>`\n- `<vaadin-date-picker-year>`\n- `<vaadin-month-calendar>`\n\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Toolbar with slotted buttons\n\nThe following state attributes are available on the `<vaadin-date-picker-overlay-content>` element:\n\nAttribute | Description\n----------------|-------------------------------------------------\n`desktop` | Set when the overlay content is in desktop mode\n`fullscreen` | Set when the overlay content is in fullscreen mode\n`years-visible` | Set when the year scroller is visible in fullscreen mode\n\nIn order to style the month calendar, use `<vaadin-month-calendar>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`month-header` | Month title\n`weekdays` | Weekday container\n`weekday` | Weekday element\n`week-numbers` | Week numbers container\n`week-number` | Week number element\n`date` | Date element\n`disabled` | Disabled date element\n`focused` | Focused date element\n`selected` | Selected date element\n`today` | Date element corresponding to the current day\n`past` | Date element corresponding to the date in the past\n`future` | Date element corresponding to the date in the future\n\nIn order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`year-number` | Year number\n`year-separator` | Year separator\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | unparsable-change",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "disabled",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/date-picker",
4
- "version": "25.0.0-alpha10",
4
+ "version": "25.0.0-alpha12",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -16,7 +16,7 @@
16
16
  "elements": [
17
17
  {
18
18
  "name": "vaadin-date-picker",
19
- "description": "`<vaadin-date-picker>` is an input field that allows to enter a date by typing or by selecting from a calendar overlay.\n\n```html\n<vaadin-date-picker label=\"Birthday\"></vaadin-date-picker>\n```\n```js\ndatePicker.value = '2016-03-02';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-date-picker>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n-----------------|--------------------\n`toggle-button` | Toggle button\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description\n---------------|----------------------------------------------\n`opened` | Set when the date selector overlay is opened\n`week-numbers` | Set when week numbers are shown in the calendar\n\n### Internal components\n\nIn addition to `<vaadin-date-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-date-picker-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-overlay).\n- `<vaadin-date-picker-overlay-content>`\n- `<vaadin-date-picker-month-scroller>`\n- `<vaadin-date-picker-year-scroller>`\n- `<vaadin-date-picker-year>`\n- `<vaadin-month-calendar>`\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Toolbar with slotted buttons\n\nThe following state attributes are available on the `<vaadin-date-picker-overlay-content>` element:\n\nAttribute | Description\n----------------|-------------------------------------------------\n`desktop` | Set when the overlay content is in desktop mode\n`fullscreen` | Set when the overlay content is in fullscreen mode\n`years-visible` | Set when the year scroller is visible in fullscreen mode\n\nIn order to style the month calendar, use `<vaadin-month-calendar>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`month-header` | Month title\n`weekdays` | Weekday container\n`weekday` | Weekday element\n`week-numbers` | Week numbers container\n`week-number` | Week number element\n`date` | Date element\n`disabled` | Disabled date element\n`focused` | Focused date element\n`selected` | Selected date element\n`today` | Date element corresponding to the current day\n`past` | Date element corresponding to the date in the past\n`future` | Date element corresponding to the date in the future\n\nIn order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`year-number` | Year number\n`year-separator` | Year separator\n\nNote: the `theme` attribute value set on `<vaadin-date-picker>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | unparsable-change",
19
+ "description": "`<vaadin-date-picker>` is an input field that allows to enter a date by typing or by selecting from a calendar overlay.\n\n```html\n<vaadin-date-picker label=\"Birthday\"></vaadin-date-picker>\n```\n```js\ndatePicker.value = '2016-03-02';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-date-picker>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha12/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n-----------------|--------------------\n`toggle-button` | Toggle button\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description\n---------------|----------------------------------------------\n`opened` | Set when the date selector overlay is opened\n`week-numbers` | Set when week numbers are shown in the calendar\n\n### Internal components\n\nIn addition to `<vaadin-date-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-date-picker-overlay-content>`\n- `<vaadin-date-picker-month-scroller>`\n- `<vaadin-date-picker-year-scroller>`\n- `<vaadin-date-picker-year>`\n- `<vaadin-month-calendar>`\n\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Toolbar with slotted buttons\n\nThe following state attributes are available on the `<vaadin-date-picker-overlay-content>` element:\n\nAttribute | Description\n----------------|-------------------------------------------------\n`desktop` | Set when the overlay content is in desktop mode\n`fullscreen` | Set when the overlay content is in fullscreen mode\n`years-visible` | Set when the year scroller is visible in fullscreen mode\n\nIn order to style the month calendar, use `<vaadin-month-calendar>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`month-header` | Month title\n`weekdays` | Weekday container\n`weekday` | Weekday element\n`week-numbers` | Week numbers container\n`week-number` | Week number element\n`date` | Date element\n`disabled` | Disabled date element\n`focused` | Focused date element\n`selected` | Selected date element\n`today` | Date element corresponding to the current day\n`past` | Date element corresponding to the date in the past\n`future` | Date element corresponding to the date in the future\n\nIn order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`year-number` | Year number\n`year-separator` | Year separator\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | unparsable-change",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
@@ -1,8 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import type { CSSResult } from 'lit';
7
-
8
- export const datePickerStyles: CSSResult;
@@ -1,21 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { css } from 'lit';
7
-
8
- export const datePickerStyles = css`
9
- :host([opened]) {
10
- pointer-events: auto;
11
- }
12
-
13
- :host([dir='rtl']) [part='input-field'] {
14
- direction: ltr;
15
- }
16
-
17
- :host([dir='rtl']) [part='input-field'] ::slotted(input)::placeholder {
18
- direction: rtl;
19
- text-align: left;
20
- }
21
- `;
@@ -1,54 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { css } from 'lit';
7
-
8
- export const overlayContentStyles = css`
9
- :host {
10
- display: grid;
11
- grid-template-areas:
12
- 'header header'
13
- 'months years'
14
- 'toolbar years';
15
- grid-template-columns: minmax(0, 1fr) 0;
16
- height: 100%;
17
- outline: none;
18
- }
19
-
20
- :host([desktop]) {
21
- grid-template-columns: minmax(0, 1fr) auto;
22
- }
23
-
24
- :host([fullscreen][years-visible]) {
25
- grid-template-columns: minmax(0, 1fr) auto;
26
- }
27
-
28
- [hidden] {
29
- display: none !important;
30
- }
31
-
32
- [part='years-toggle-button'] {
33
- display: flex;
34
- }
35
-
36
- ::slotted([slot='years']) {
37
- visibility: hidden;
38
- }
39
-
40
- :host([desktop]) ::slotted([slot='years']),
41
- :host([years-visible]) ::slotted([slot='years']) {
42
- visibility: visible;
43
- }
44
-
45
- [part='toolbar'] {
46
- display: flex;
47
- grid-area: toolbar;
48
- justify-content: space-between;
49
- }
50
-
51
- :host([fullscreen]) [part='toolbar'] {
52
- grid-area: header;
53
- }
54
- `;
@@ -1,23 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { css } from 'lit';
7
-
8
- export const datePickerOverlayStyles = css`
9
- [part='overlay'] {
10
- display: flex;
11
- flex: auto;
12
- }
13
-
14
- [part~='content'] {
15
- flex: auto;
16
- }
17
-
18
- @media (forced-colors: active) {
19
- [part='overlay'] {
20
- outline: 3px solid;
21
- }
22
- }
23
- `;
@@ -1,13 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { css } from 'lit';
7
-
8
- export const datePickerYearStyles = css`
9
- :host {
10
- display: block;
11
- height: 100%;
12
- }
13
- `;
@@ -1,64 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { css } from 'lit';
7
-
8
- export const monthCalendarStyles = css`
9
- :host {
10
- display: block;
11
- }
12
-
13
- #monthGrid {
14
- width: 100%;
15
- border-collapse: collapse;
16
- }
17
-
18
- #days-container tr,
19
- #weekdays-container tr {
20
- display: flex;
21
- }
22
-
23
- [part~='date'] {
24
- outline: none;
25
- }
26
-
27
- [part~='disabled'] {
28
- pointer-events: none;
29
- }
30
-
31
- [part='week-number'][hidden],
32
- [part='weekday'][hidden] {
33
- display: none;
34
- }
35
-
36
- [part='weekday'],
37
- [part~='date'] {
38
- width: calc(100% / 7);
39
- padding: 0;
40
- font-weight: normal;
41
- }
42
-
43
- [part='weekday']:empty,
44
- [part='week-number'] {
45
- width: 12.5%;
46
- flex-shrink: 0;
47
- padding: 0;
48
- }
49
-
50
- :host([week-numbers]) [part='weekday']:not(:empty),
51
- :host([week-numbers]) [part~='date'] {
52
- width: 12.5%;
53
- }
54
-
55
- @media (forced-colors: active) {
56
- [part~='date'][part~='focused'] {
57
- outline: 1px solid;
58
- }
59
-
60
- [part~='date'][part~='selected'] {
61
- outline: 3px solid;
62
- }
63
- }
64
- `;
@@ -1,7 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/color.js';
2
- import '@vaadin/vaadin-lumo-styles/sizing.js';
3
- import '@vaadin/vaadin-lumo-styles/spacing.js';
4
- import '@vaadin/vaadin-lumo-styles/style.js';
5
- import '@vaadin/vaadin-lumo-styles/typography.js';
6
- import '@vaadin/button/theme/lumo/vaadin-button-styles.js';
7
- import './vaadin-date-picker-year-styles.js';
@@ -1,137 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/color.js';
2
- import '@vaadin/vaadin-lumo-styles/sizing.js';
3
- import '@vaadin/vaadin-lumo-styles/spacing.js';
4
- import '@vaadin/vaadin-lumo-styles/style.js';
5
- import '@vaadin/vaadin-lumo-styles/typography.js';
6
- import '@vaadin/button/theme/lumo/vaadin-button-styles.js';
7
- import './vaadin-date-picker-year-styles.js';
8
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
9
-
10
- registerStyles(
11
- 'vaadin-date-picker-overlay-content',
12
- css`
13
- :host {
14
- position: relative;
15
- /* Background for the year scroller, placed here as we are using a mask image on the actual years part */
16
- background-image: linear-gradient(var(--lumo-shade-5pct), var(--lumo-shade-5pct));
17
- background-size: 57px 100%;
18
- background-position: top right;
19
- background-repeat: no-repeat;
20
- cursor: default;
21
- }
22
-
23
- :host([dir='rtl']) {
24
- background-position: top left;
25
- }
26
-
27
- ::slotted([slot='months']) {
28
- /* Month calendar height:
29
- header height + margin-bottom
30
- + weekdays height + margin-bottom
31
- + date cell heights
32
- + small margin between month calendars
33
- */
34
- /* prettier-ignore */
35
- --vaadin-infinite-scroller-item-height:
36
- calc(
37
- var(--lumo-font-size-l) + var(--lumo-space-m)
38
- + var(--lumo-font-size-xs) + var(--lumo-space-s)
39
- + var(--lumo-size-m) * 6
40
- + var(--lumo-space-s)
41
- );
42
- --vaadin-infinite-scroller-buffer-offset: 10%;
43
- mask-image: linear-gradient(transparent, #000 10%, #000 85%, transparent);
44
- position: relative;
45
- }
46
-
47
- ::slotted([slot='years']) {
48
- /* TODO get rid of fixed magic number */
49
- --vaadin-infinite-scroller-buffer-width: 57px;
50
- width: 57px;
51
- font-size: var(--lumo-font-size-s);
52
- box-shadow: inset 2px 0 4px 0 var(--lumo-shade-5pct);
53
- mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
54
- cursor: var(--lumo-clickable-cursor);
55
- }
56
-
57
- :host([dir='rtl']) ::slotted([slot='years']) {
58
- box-shadow: inset -2px 0 4px 0 var(--lumo-shade-5pct);
59
- }
60
-
61
- ::slotted([slot='years']:hover) {
62
- --_lumo-date-picker-year-opacity: 1;
63
- }
64
-
65
- /* Year scroller position indicator */
66
- ::slotted([slot='years'])::before {
67
- border: none;
68
- width: 1em;
69
- height: 1em;
70
- background-color: var(--lumo-base-color);
71
- background-image: linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));
72
- transform: translate(-75%, -50%) rotate(45deg);
73
- border-top-right-radius: var(--lumo-border-radius-s);
74
- box-shadow: 2px -2px 6px 0 var(--lumo-shade-5pct);
75
- z-index: 1;
76
- }
77
-
78
- :host([dir='rtl']) ::slotted([slot='years'])::before {
79
- right: 0;
80
- transform: translate(75%, -50%) rotate(45deg);
81
- }
82
-
83
- [part='toolbar'] {
84
- padding: var(--lumo-space-s);
85
- border-bottom-left-radius: var(--lumo-border-radius-l);
86
- }
87
-
88
- [part='toolbar'] ::slotted(vaadin-button) {
89
- margin: 0;
90
- }
91
-
92
- /* Narrow viewport mode (fullscreen) */
93
-
94
- :host([fullscreen]) [part='toolbar'] {
95
- background-color: var(--lumo-base-color);
96
- margin-inline-end: 57px;
97
- }
98
-
99
- /* Very narrow screen (year scroller initially hidden) */
100
-
101
- [part='years-toggle-button'] {
102
- display: flex;
103
- align-items: center;
104
- height: var(--lumo-size-m);
105
- padding: 0 0.5em;
106
- border-radius: var(--lumo-border-radius-m);
107
- color: var(--lumo-primary-text-color);
108
- font-weight: 500;
109
- -webkit-font-smoothing: antialiased;
110
- -moz-osx-font-smoothing: grayscale;
111
- }
112
-
113
- :host([years-visible]) [part='years-toggle-button'] {
114
- background-color: var(--lumo-primary-color);
115
- color: var(--lumo-primary-contrast-color);
116
- }
117
-
118
- /* TODO magic number (same as used for media-query in vaadin-date-picker-overlay-content) */
119
- @media screen and (max-width: 374px) {
120
- :host {
121
- background-image: none;
122
- }
123
-
124
- :host([fullscreen]) [part='toolbar'] {
125
- margin-inline-end: 0;
126
- }
127
-
128
- /* TODO make date-picker adapt to the width of the years part */
129
- ::slotted([slot='years']) {
130
- --vaadin-infinite-scroller-buffer-width: 50px;
131
- width: 50px;
132
- background-color: var(--lumo-shade-5pct);
133
- }
134
- }
135
- `,
136
- { moduleId: 'lumo-date-picker-overlay-content' },
137
- );
@@ -1,2 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/sizing.js';
2
- import '@vaadin/vaadin-lumo-styles/spacing.js';
@@ -1,54 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/sizing.js';
2
- import '@vaadin/vaadin-lumo-styles/spacing.js';
3
- import { menuOverlay } from '@vaadin/vaadin-lumo-styles/mixins/menu-overlay.js';
4
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
5
-
6
- const datePickerOverlay = css`
7
- [part='overlay'] {
8
- /*
9
- Width:
10
- date cell widths
11
- + month calendar side padding
12
- + year scroller width
13
- */
14
- /* prettier-ignore */
15
- width:
16
- calc(
17
- var(--lumo-size-m) * 7
18
- + var(--lumo-space-xs) * 2
19
- + 57px
20
- );
21
- height: 100%;
22
- max-height: calc(var(--lumo-size-m) * 14);
23
- overflow: hidden;
24
- -webkit-tap-highlight-color: transparent;
25
- flex-direction: column;
26
- }
27
-
28
- [part='content'] {
29
- padding: 0;
30
- height: 100%;
31
- overflow: hidden;
32
- mask-image: none;
33
- }
34
-
35
- :host([top-aligned]) [part~='overlay'] {
36
- margin-top: var(--lumo-space-xs);
37
- }
38
-
39
- :host([bottom-aligned]) [part~='overlay'] {
40
- margin-bottom: var(--lumo-space-xs);
41
- }
42
-
43
- @media (max-width: 450px), (max-height: 450px) {
44
- [part='overlay'] {
45
- width: 100vw;
46
- height: 70vh;
47
- max-height: 70vh;
48
- }
49
- }
50
- `;
51
-
52
- registerStyles('vaadin-date-picker-overlay', [menuOverlay, datePickerOverlay], {
53
- moduleId: 'lumo-date-picker-overlay',
54
- });
@@ -1,2 +0,0 @@
1
- import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
2
- import '@vaadin/vaadin-lumo-styles/font-icons.js';
@@ -1,30 +0,0 @@
1
- import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
2
- import '@vaadin/vaadin-lumo-styles/font-icons.js';
3
- import { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';
4
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
5
-
6
- const datePicker = css`
7
- [part='toggle-button']::before {
8
- content: var(--lumo-icons-calendar);
9
- }
10
-
11
- [part='clear-button']::before {
12
- content: var(--lumo-icons-cross);
13
- }
14
-
15
- @media (max-width: 450px), (max-height: 450px) {
16
- [part='overlay-content'] {
17
- height: 70vh;
18
- }
19
- }
20
-
21
- :host([dir='rtl']) [part='input-field'] ::slotted(input) {
22
- --_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent, #000 1.25em);
23
- }
24
-
25
- :host([dir='rtl']) [part='input-field'] ::slotted(input:placeholder-shown) {
26
- --_lumo-text-field-overflow-mask-image: none;
27
- }
28
- `;
29
-
30
- registerStyles('vaadin-date-picker', [inputFieldShared, datePicker], { moduleId: 'lumo-date-picker' });
@@ -1 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/color.js';
@@ -1,32 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/color.js';
2
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
3
-
4
- registerStyles(
5
- 'vaadin-date-picker-year',
6
- css`
7
- :host([current]) [part='year-number'] {
8
- color: var(--lumo-primary-text-color);
9
- }
10
-
11
- :host(:not([current])) [part='year-number'],
12
- [part='year-separator'] {
13
- opacity: var(--_lumo-date-picker-year-opacity, 0.7);
14
- transition: 0.2s opacity;
15
- }
16
-
17
- [part='year-number'],
18
- [part='year-separator'] {
19
- display: flex;
20
- align-items: center;
21
- justify-content: center;
22
- height: 50%;
23
- transform: translateY(-50%);
24
- }
25
-
26
- [part='year-separator']::after {
27
- color: var(--lumo-disabled-text-color);
28
- content: '\\2022';
29
- }
30
- `,
31
- { moduleId: 'lumo-date-picker-year' },
32
- );
@@ -1,5 +0,0 @@
1
- import './vaadin-date-picker-overlay-styles.js';
2
- import './vaadin-date-picker-overlay-content-styles.js';
3
- import './vaadin-month-calendar-styles.js';
4
- import './vaadin-date-picker-styles.js';
5
- import '../../src/vaadin-date-picker.js';
@@ -1,5 +0,0 @@
1
- import './vaadin-date-picker-overlay-styles.js';
2
- import './vaadin-date-picker-overlay-content-styles.js';
3
- import './vaadin-month-calendar-styles.js';
4
- import './vaadin-date-picker-styles.js';
5
- import '../../src/vaadin-date-picker.js';
@@ -1,5 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/color.js';
2
- import '@vaadin/vaadin-lumo-styles/sizing.js';
3
- import '@vaadin/vaadin-lumo-styles/spacing.js';
4
- import '@vaadin/vaadin-lumo-styles/style.js';
5
- import '@vaadin/vaadin-lumo-styles/typography.js';
@@ -1,158 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/color.js';
2
- import '@vaadin/vaadin-lumo-styles/sizing.js';
3
- import '@vaadin/vaadin-lumo-styles/spacing.js';
4
- import '@vaadin/vaadin-lumo-styles/style.js';
5
- import '@vaadin/vaadin-lumo-styles/typography.js';
6
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
7
-
8
- registerStyles(
9
- 'vaadin-month-calendar',
10
- css`
11
- :host {
12
- -webkit-user-select: none;
13
- -webkit-tap-highlight-color: transparent;
14
- user-select: none;
15
- font-size: var(--lumo-font-size-m);
16
- color: var(--lumo-body-text-color);
17
- text-align: center;
18
- padding: 0 var(--lumo-space-xs);
19
- --_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
20
- --_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
21
- --_selection-color: var(--vaadin-selection-color, var(--lumo-primary-color));
22
- --_selection-color-text: var(--vaadin-selection-color-text, var(--lumo-primary-text-color));
23
- }
24
-
25
- /* Month header */
26
-
27
- [part='month-header'] {
28
- color: var(--lumo-header-text-color);
29
- font-size: var(--lumo-font-size-l);
30
- line-height: 1;
31
- font-weight: 500;
32
- margin-bottom: var(--lumo-space-m);
33
- }
34
-
35
- /* Week days and numbers */
36
-
37
- [part='weekdays'],
38
- [part='weekday'],
39
- [part='week-number'] {
40
- font-size: var(--lumo-font-size-xxs);
41
- line-height: 1;
42
- color: var(--lumo-secondary-text-color);
43
- }
44
-
45
- [part='weekdays'] {
46
- margin-bottom: var(--lumo-space-s);
47
- }
48
-
49
- [part='weekday']:empty,
50
- [part='week-number'] {
51
- width: var(--lumo-size-xs);
52
- }
53
-
54
- /* Date and week number cells */
55
-
56
- [part~='date'],
57
- [part='week-number'] {
58
- box-sizing: border-box;
59
- display: inline-flex;
60
- align-items: center;
61
- justify-content: center;
62
- height: var(--lumo-size-m);
63
- position: relative;
64
- }
65
-
66
- [part~='date'] {
67
- transition: color 0.1s;
68
- }
69
-
70
- [part~='date']:not(:empty) {
71
- cursor: var(--lumo-clickable-cursor);
72
- }
73
-
74
- :host([week-numbers]) [part='weekday']:not(:empty),
75
- :host([week-numbers]) [part~='date'] {
76
- width: calc((100% - var(--lumo-size-xs)) / 7);
77
- }
78
-
79
- /* Today date */
80
-
81
- [part~='date'][part~='today'] {
82
- color: var(--_selection-color-text);
83
- }
84
-
85
- /* Focused date */
86
-
87
- [part~='date']::before {
88
- content: '';
89
- position: absolute;
90
- z-index: -1;
91
- top: 50%;
92
- left: 50%;
93
- transform: translate(-50%, -50%);
94
- min-width: 2em;
95
- min-height: 2em;
96
- width: 80%;
97
- height: 80%;
98
- max-height: 100%;
99
- max-width: 100%;
100
- border-radius: var(--lumo-border-radius-m);
101
- }
102
-
103
- [part~='date'][part~='focused']::before {
104
- box-shadow:
105
- 0 0 0 1px var(--lumo-base-color),
106
- 0 0 0 calc(var(--_focus-ring-width) + 1px) var(--_focus-ring-color);
107
- }
108
-
109
- :host(:not([focused])) [part~='date'][part~='focused']::before {
110
- animation: vaadin-date-picker-month-calendar-focus-date 1.4s infinite;
111
- }
112
-
113
- @keyframes vaadin-date-picker-month-calendar-focus-date {
114
- 50% {
115
- box-shadow:
116
- 0 0 0 1px var(--lumo-base-color),
117
- 0 0 0 calc(var(--_focus-ring-width) + 1px) transparent;
118
- }
119
- }
120
-
121
- [part~='date']:not(:empty):not([part~='disabled']):not([part~='selected']):hover::before {
122
- background-color: var(--lumo-primary-color-10pct);
123
- }
124
-
125
- [part~='date'][part~='selected'] {
126
- color: var(--lumo-primary-contrast-color);
127
- }
128
-
129
- [part~='date'][part~='selected']::before {
130
- background-color: var(--_selection-color);
131
- }
132
-
133
- [part~='date'][part~='disabled'] {
134
- color: var(--lumo-disabled-text-color);
135
- }
136
-
137
- @media (pointer: coarse) {
138
- [part~='date']:hover:not([part~='selected'])::before,
139
- :host(:not([focus-ring])) [part~='focused']:not([part~='selected'])::before {
140
- display: none;
141
- }
142
-
143
- [part~='date']:not(:empty):not([part~='disabled']):active::before {
144
- display: block;
145
- }
146
-
147
- :host(:not([focus-ring])) [part~='date'][part~='selected']::before {
148
- box-shadow: none;
149
- }
150
- }
151
- /* Disabled */
152
-
153
- :host([disabled]) * {
154
- color: var(--lumo-disabled-text-color) !important;
155
- }
156
- `,
157
- { moduleId: 'lumo-month-calendar' },
158
- );