@simplybusiness/mobius-datepicker 9.1.4 → 10.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@simplybusiness/mobius-datepicker",
3
3
  "license": "UNLICENSED",
4
- "version": "9.1.4",
4
+ "version": "10.0.1",
5
5
  "description": "Mobius date picker component",
6
6
  "repository": {
7
7
  "type": "git",
@@ -63,7 +63,7 @@
63
63
  "@eslint/compat": "^2.0.2",
64
64
  "@eslint/eslintrc": "^3.3.4",
65
65
  "@eslint/js": "^9.39.3",
66
- "@simplybusiness/build-scripts": "^2.0.3",
66
+ "@simplybusiness/build-scripts": "^3.0.0",
67
67
  "@simplybusiness/eslint-config": "^2.0.4",
68
68
  "@testing-library/dom": "^10.4.1",
69
69
  "@testing-library/jest-dom": "6.9.1",
@@ -97,7 +97,7 @@
97
97
  },
98
98
  "dependencies": {
99
99
  "@simplybusiness/icons": "^5.0.3",
100
- "@simplybusiness/mobius": "^9.3.4",
100
+ "@simplybusiness/mobius": "^10.1.0",
101
101
  "@simplybusiness/mobius-hooks": "^0.1.1",
102
102
  "classnames": "^2.5.1",
103
103
  "date-fns": "^4.1.0",
@@ -1,195 +1,197 @@
1
- .mobius-date-picker__container {
2
- position: relative;
1
+ @layer atoms {
2
+ .mobius-date-picker__container {
3
+ position: relative;
4
+
5
+ &:not(.--is-touch-device) {
6
+ /* Hide default calendar icon */
7
+ & .mobius-text-field__input::-webkit-calendar-picker-indicator {
8
+ display: none;
9
+ }
10
+ }
3
11
 
4
- &:not(.--is-touch-device) {
5
- /* Hide default calendar icon */
6
- & .mobius-text-field__input::-webkit-calendar-picker-indicator {
7
- display: none;
12
+ &.--is-touch-device {
13
+ /* Fix date input height on touch devices */
14
+ & .mobius-text-field__input {
15
+ min-height: 52px;
16
+ }
8
17
  }
9
18
  }
10
19
 
11
- &.--is-touch-device {
12
- /* Fix date input height on touch devices */
13
- & .mobius-text-field__input {
14
- min-height: 52px;
20
+ .mobius-date-picker {
21
+ &.mobius-text-field__input {
22
+ line-height: 1;
15
23
  }
16
24
  }
17
- }
18
25
 
19
- .mobius-date-picker {
20
- &.mobius-text-field__input {
21
- line-height: 1;
22
- }
23
- }
26
+ .mobius-date-picker__field-button {
27
+ min-width: var(--size-xxl);
28
+ transition: none;
29
+ border-top-left-radius: 0;
30
+ border-top-right-radius: var(--input-border-radius);
31
+ border-bottom-left-radius: 0;
32
+ border-bottom-right-radius: var(--input-border-radius);
33
+
34
+ &:hover:not(.--is-disabled):not(&.--is-valid):not(&.--is-invalid),
35
+ &:focus-visible:not(.--is-disabled):not(&.--is-valid):not(&.--is-invalid) {
36
+ background-color: var(--color-primary-hover);
37
+ }
24
38
 
25
- .mobius-date-picker__field-button {
26
- min-width: var(--size-xxl);
27
- transition: none;
28
- border-top-left-radius: 0;
29
- border-top-right-radius: var(--input-border-radius);
30
- border-bottom-left-radius: 0;
31
- border-bottom-right-radius: var(--input-border-radius);
32
-
33
- &:hover:not(.--is-disabled):not(&.--is-valid):not(&.--is-invalid),
34
- &:focus-visible:not(.--is-disabled):not(&.--is-valid):not(&.--is-invalid) {
35
- background-color: var(--color-primary-hover);
39
+ &.--is-invalid:not(.--is-disabled) {
40
+ background-color: var(--color-error);
41
+ border-color: var(--color-error);
42
+ }
36
43
  }
37
44
 
38
- &.--is-invalid:not(.--is-disabled) {
39
- background-color: var(--color-error);
40
- border-color: var(--color-error);
45
+ .mobius-date-picker__modal {
46
+ position: absolute;
47
+ margin-top: 14px;
48
+ display: none;
49
+ font-family: var(--font-family);
50
+ min-width: 280px;
51
+ background-color: var(--color-background-light);
52
+ border: var(--border-default);
53
+ border-radius: var(--input-border-radius);
54
+ box-shadow:
55
+ 0 1px 1px hsl(0deg 0% 0% / 0.075),
56
+ 0 2px 2px hsl(0deg 0% 0% / 0.075),
57
+ 0 4px 4px hsl(0deg 0% 0% / 0.075),
58
+ 0 8px 8px hsl(0deg 0% 0% / 0.075),
59
+ 0 16px 16px hsl(0deg 0% 0% / 0.075);
60
+
61
+ &.--is-open {
62
+ display: inline-block;
63
+ z-index: 2;
64
+ }
41
65
  }
42
- }
43
66
 
44
- .mobius-date-picker__modal {
45
- position: absolute;
46
- margin-top: 14px;
47
- display: none;
48
- font-family: var(--font-family);
49
- min-width: 280px;
50
- background-color: var(--color-background-light);
51
- border: var(--border-default);
52
- border-radius: var(--input-border-radius);
53
- box-shadow:
54
- 0 1px 1px hsl(0deg 0% 0% / 0.075),
55
- 0 2px 2px hsl(0deg 0% 0% / 0.075),
56
- 0 4px 4px hsl(0deg 0% 0% / 0.075),
57
- 0 8px 8px hsl(0deg 0% 0% / 0.075),
58
- 0 16px 16px hsl(0deg 0% 0% / 0.075);
59
-
60
- &.--is-open {
61
- display: inline-block;
62
- z-index: 2;
67
+ .mobius-date-picker__months {
68
+ position: relative;
63
69
  }
64
- }
65
70
 
66
- .mobius-date-picker__months {
67
- position: relative;
68
- }
69
-
70
- .mobius-date-picker__nav {
71
- width: 100%;
72
- display: flex;
73
- justify-content: space-between;
74
- }
75
-
76
- .mobius-date-picker__nav-button {
77
- appearance: none;
78
- cursor: pointer;
79
- border: none;
80
- color: var(--color-primary);
81
- background-color: transparent;
82
- margin: var(--size-xs);
83
- padding: 0;
84
-
85
- & .mobius-icon {
86
- padding: var(--size-xxs) 6px;
87
- border: var(--border-default);
88
- border-radius: 50%;
71
+ .mobius-date-picker__nav {
72
+ width: 100%;
73
+ display: flex;
74
+ justify-content: space-between;
89
75
  }
90
76
 
91
- &:hover {
92
- color: var(--color-primary-hover);
77
+ .mobius-date-picker__nav-button {
78
+ appearance: none;
79
+ cursor: pointer;
80
+ border: none;
81
+ color: var(--color-primary);
82
+ background-color: transparent;
83
+ margin: var(--size-xs);
84
+ padding: 0;
93
85
 
94
86
  & .mobius-icon {
95
- border-color: var(--color-primary-hover);
87
+ padding: var(--size-xxs) 6px;
88
+ border: var(--border-default);
89
+ border-radius: 50%;
96
90
  }
97
- }
98
91
 
99
- &:focus-visible {
100
- outline: none;
92
+ &:hover {
93
+ color: var(--color-primary-hover);
101
94
 
102
- & .mobius-icon {
103
- box-shadow: var(--box-shadow-default);
95
+ & .mobius-icon {
96
+ border-color: var(--color-primary-hover);
97
+ }
98
+ }
99
+
100
+ &:focus-visible {
101
+ outline: none;
102
+
103
+ & .mobius-icon {
104
+ box-shadow: var(--box-shadow-default);
105
+ }
104
106
  }
105
107
  }
106
- }
107
108
 
108
- .mobius-date-picker__caption {
109
- min-height: 43px;
110
- display: flex;
111
- align-items: center;
112
- justify-content: center;
113
- position: absolute;
114
- top: 0;
115
- left: calc(var(--size-lg) + var(--size-xs));
116
- right: calc(var(--size-lg) + var(--size-xs));
117
- margin: 0 var(--size-xs);
118
- }
109
+ .mobius-date-picker__caption {
110
+ min-height: 43px;
111
+ display: flex;
112
+ align-items: center;
113
+ justify-content: center;
114
+ position: absolute;
115
+ top: 0;
116
+ left: calc(var(--size-lg) + var(--size-xs));
117
+ right: calc(var(--size-lg) + var(--size-xs));
118
+ margin: 0 var(--size-xs);
119
+ }
119
120
 
120
- .mobius-date-picker__caption-label {
121
- font-weight: normal;
122
- font-size: var(--font-size-lead);
123
- color: var(--color-primary);
124
- text-transform: uppercase;
125
- margin: 0;
126
- }
121
+ .mobius-date-picker__caption-label {
122
+ font-weight: normal;
123
+ font-size: var(--font-size-lead);
124
+ color: var(--color-primary);
125
+ text-transform: uppercase;
126
+ margin: 0;
127
+ }
127
128
 
128
- .mobius-date-picker__month-grid {
129
- width: 100%;
130
- overflow: hidden;
131
- border-collapse: collapse;
132
- border-spacing: 0;
133
- border-bottom-left-radius: var(--input-border-radius);
134
- border-bottom-right-radius: var(--input-border-radius);
135
- }
129
+ .mobius-date-picker__month-grid {
130
+ width: 100%;
131
+ overflow: hidden;
132
+ border-collapse: collapse;
133
+ border-spacing: 0;
134
+ border-bottom-left-radius: var(--input-border-radius);
135
+ border-bottom-right-radius: var(--input-border-radius);
136
+ }
136
137
 
137
- .mobius-date-picker__weekday {
138
- color: var(--color-text-medium);
139
- font-size: var(--font-size-small-print);
140
- padding: var(--size-xs) var(--size-xxs);
141
- }
138
+ .mobius-date-picker__weekday {
139
+ color: var(--color-text-medium);
140
+ font-size: var(--font-size-small-print);
141
+ padding: var(--size-xs) var(--size-xxs);
142
+ }
142
143
 
143
- .mobius-date-picker__day-button {
144
- display: flex;
145
- justify-content: center;
146
- place-items: center;
147
- width: var(--date-picker-day-size);
148
- height: var(--date-picker-day-size);
149
- font-family: var(--font-family);
150
- font-size: var(--font-size-3);
151
- color: var(--color-text);
152
- border: none;
153
- cursor: pointer;
154
- }
144
+ .mobius-date-picker__day-button {
145
+ display: flex;
146
+ justify-content: center;
147
+ place-items: center;
148
+ width: var(--date-picker-day-size);
149
+ height: var(--date-picker-day-size);
150
+ font-family: var(--font-family);
151
+ font-size: var(--font-size-3);
152
+ color: var(--color-text);
153
+ border: none;
154
+ cursor: pointer;
155
+ }
155
156
 
156
- .mobius-date-picker__day {
157
- &.--is-focused {
158
- & .mobius-date-picker__day-button {
159
- border-radius: var(--radius-1);
160
- outline: solid var(--size-focus-ring) var(--color-focus);
157
+ .mobius-date-picker__day {
158
+ &.--is-focused {
159
+ & .mobius-date-picker__day-button {
160
+ border-radius: var(--radius-1);
161
+ outline: solid var(--size-focus-ring) var(--color-focus);
162
+ }
161
163
  }
162
- }
163
164
 
164
- &.--is-selected {
165
- & .mobius-date-picker__day-button {
166
- background-color: var(--color-primary);
167
- color: var(--color-text-inverted);
168
- border-radius: var(--radius-1);
165
+ &.--is-selected {
166
+ & .mobius-date-picker__day-button {
167
+ background-color: var(--color-primary);
168
+ color: var(--color-text-inverted);
169
+ border-radius: var(--radius-1);
170
+ }
169
171
  }
170
- }
171
172
 
172
- /* Unavailable day */
173
- &.--is-outside,
174
- &.--is-disabled {
175
- & .mobius-date-picker__day-button {
176
- opacity: 0.3;
177
- cursor: not-allowed;
173
+ /* Unavailable day */
174
+ &.--is-outside,
175
+ &.--is-disabled {
176
+ & .mobius-date-picker__day-button {
177
+ opacity: 0.3;
178
+ cursor: not-allowed;
179
+ }
178
180
  }
179
- }
180
181
 
181
- /* Default state (not outside, disabled, or selected) */
182
- &:not(&.--is-outside):not(&.--is-disabled):not(&.--is-selected) {
183
- & .mobius-date-picker__day-button {
184
- background-color: var(--color-background);
182
+ /* Default state (not outside, disabled, or selected) */
183
+ &:not(&.--is-outside):not(&.--is-disabled):not(&.--is-selected) {
184
+ & .mobius-date-picker__day-button {
185
+ background-color: var(--color-background);
186
+ }
185
187
  }
186
188
  }
187
- }
188
189
 
189
- /* Placeholder */
190
- input[type="date"]::-webkit-datetime-edit-text,
191
- input[type="date"]::-webkit-datetime-edit-month-field,
192
- input[type="date"]::-webkit-datetime-edit-day-field,
193
- input[type="date"]::-webkit-datetime-edit-year-field {
194
- color: var(--color-text);
195
- }
190
+ /* Placeholder */
191
+ input[type="date"]::-webkit-datetime-edit-text,
192
+ input[type="date"]::-webkit-datetime-edit-month-field,
193
+ input[type="date"]::-webkit-datetime-edit-day-field,
194
+ input[type="date"]::-webkit-datetime-edit-year-field {
195
+ color: var(--color-text);
196
+ }
197
+ }