@glueforms/react 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.md +110 -2
- package/THIRD-PARTY-NOTICES.txt +43 -0
- package/dist/form.css +495 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +650 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +256 -0
- package/package.json +63 -4
- package/source/index.d.ts +17 -0
- package/source/index.jsx +557 -0
- package/source/shared/dates.js +225 -0
- package/source/shared/form.css +495 -0
- package/source/shared/native.js +17 -0
- package/source/shared/ownership.js +50 -0
- package/source/shared/styles.css +256 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
export const copy = {
|
|
2
|
+
en: [
|
|
3
|
+
"Previous month",
|
|
4
|
+
"Next month",
|
|
5
|
+
"Previous year",
|
|
6
|
+
"Next year",
|
|
7
|
+
"Clear",
|
|
8
|
+
"Any date",
|
|
9
|
+
"Today and future dates",
|
|
10
|
+
"From tomorrow",
|
|
11
|
+
"No date selected",
|
|
12
|
+
"Selected: ",
|
|
13
|
+
"The previous date is no longer available and has been cleared. Choose another date.",
|
|
14
|
+
"Choose a date",
|
|
15
|
+
],
|
|
16
|
+
es: [
|
|
17
|
+
"Mes anterior",
|
|
18
|
+
"Mes siguiente",
|
|
19
|
+
"Año anterior",
|
|
20
|
+
"Año siguiente",
|
|
21
|
+
"Borrar",
|
|
22
|
+
"Cualquier fecha",
|
|
23
|
+
"Hoy y fechas futuras",
|
|
24
|
+
"A partir de mañana",
|
|
25
|
+
"Aún no has elegido una fecha",
|
|
26
|
+
"Seleccionado: ",
|
|
27
|
+
"La fecha anterior ya no está permitida y se ha borrado. Elige otra fecha.",
|
|
28
|
+
"Elige una fecha",
|
|
29
|
+
],
|
|
30
|
+
de: [
|
|
31
|
+
"Vorheriger Monat",
|
|
32
|
+
"Nächster Monat",
|
|
33
|
+
"Vorheriges Jahr",
|
|
34
|
+
"Nächstes Jahr",
|
|
35
|
+
"Löschen",
|
|
36
|
+
"Beliebiges Datum",
|
|
37
|
+
"Heute und zukünftige Daten",
|
|
38
|
+
"Ab morgen",
|
|
39
|
+
"Kein Datum ausgewählt",
|
|
40
|
+
"Ausgewählt: ",
|
|
41
|
+
"Das bisherige Datum ist nicht mehr verfügbar und wurde gelöscht. Wähle ein anderes Datum.",
|
|
42
|
+
"Datum auswählen",
|
|
43
|
+
],
|
|
44
|
+
pt: [
|
|
45
|
+
"Mês anterior",
|
|
46
|
+
"Mês seguinte",
|
|
47
|
+
"Ano anterior",
|
|
48
|
+
"Ano seguinte",
|
|
49
|
+
"Limpar",
|
|
50
|
+
"Qualquer data",
|
|
51
|
+
"Hoje e datas futuras",
|
|
52
|
+
"A partir de amanhã",
|
|
53
|
+
"Nenhuma data selecionada",
|
|
54
|
+
"Selecionado: ",
|
|
55
|
+
"A data anterior já não está disponível e foi apagada. Escolha outra data.",
|
|
56
|
+
"Escolha uma data",
|
|
57
|
+
],
|
|
58
|
+
it: [
|
|
59
|
+
"Mese precedente",
|
|
60
|
+
"Mese successivo",
|
|
61
|
+
"Anno precedente",
|
|
62
|
+
"Anno successivo",
|
|
63
|
+
"Cancella",
|
|
64
|
+
"Qualsiasi data",
|
|
65
|
+
"Oggi e date future",
|
|
66
|
+
"Da domani",
|
|
67
|
+
"Nessuna data selezionata",
|
|
68
|
+
"Selezionato: ",
|
|
69
|
+
"La data precedente non è più disponibile ed è stata cancellata. Scegli un’altra data.",
|
|
70
|
+
"Scegli una data",
|
|
71
|
+
],
|
|
72
|
+
fr: [
|
|
73
|
+
"Mois précédent",
|
|
74
|
+
"Mois suivant",
|
|
75
|
+
"Année précédente",
|
|
76
|
+
"Année suivante",
|
|
77
|
+
"Effacer",
|
|
78
|
+
"Toutes les dates",
|
|
79
|
+
"Aujourd’hui et dates futures",
|
|
80
|
+
"À partir de demain",
|
|
81
|
+
"Aucune date sélectionnée",
|
|
82
|
+
"Sélection : ",
|
|
83
|
+
"La date précédente n’est plus disponible et a été effacée. Choisissez une autre date.",
|
|
84
|
+
"Choisir une date",
|
|
85
|
+
],
|
|
86
|
+
};
|
|
87
|
+
export function civil(year, month, day) {
|
|
88
|
+
const date = new Date(2000, 0, 1, 12);
|
|
89
|
+
date.setFullYear(year, month, day);
|
|
90
|
+
return date;
|
|
91
|
+
}
|
|
92
|
+
export function iso(date) {
|
|
93
|
+
return (
|
|
94
|
+
String(date.getFullYear()).padStart(4, "0") +
|
|
95
|
+
"-" +
|
|
96
|
+
String(date.getMonth() + 1).padStart(2, "0") +
|
|
97
|
+
"-" +
|
|
98
|
+
String(date.getDate()).padStart(2, "0")
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
export function parse(value) {
|
|
102
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(value || "")) return null;
|
|
103
|
+
const [year, month, day] = value.split("-").map(Number);
|
|
104
|
+
if (year < 1 || year > 9999) return null;
|
|
105
|
+
const date = civil(year, month - 1, day);
|
|
106
|
+
return iso(date) === value ? date : null;
|
|
107
|
+
}
|
|
108
|
+
export function today() {
|
|
109
|
+
const n = new Date();
|
|
110
|
+
return civil(n.getFullYear(), n.getMonth(), n.getDate());
|
|
111
|
+
}
|
|
112
|
+
export function bounds(min, max, policy, day = today()) {
|
|
113
|
+
let lower = parse(min) ? min : "";
|
|
114
|
+
const upper = parse(max) ? max : "";
|
|
115
|
+
if (policy === "today" || policy === "tomorrow") {
|
|
116
|
+
const relative = iso(
|
|
117
|
+
civil(
|
|
118
|
+
day.getFullYear(),
|
|
119
|
+
day.getMonth(),
|
|
120
|
+
day.getDate() + (policy === "tomorrow" ? 1 : 0),
|
|
121
|
+
),
|
|
122
|
+
);
|
|
123
|
+
if (relative > lower) lower = relative;
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
min: lower,
|
|
127
|
+
max: upper,
|
|
128
|
+
empty: lower.length > 10 || !!(lower && upper && lower > upper),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
export function inBounds(value, range) {
|
|
132
|
+
return (
|
|
133
|
+
!range.empty &&
|
|
134
|
+
!!parse(value) &&
|
|
135
|
+
(!range.min || value >= range.min) &&
|
|
136
|
+
(!range.max || value <= range.max)
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
export function bounded(value, range) {
|
|
140
|
+
if (range.min && value < range.min) value = range.min;
|
|
141
|
+
if (range.max && value > range.max) value = range.max;
|
|
142
|
+
return inBounds(value, range) ? value : "";
|
|
143
|
+
}
|
|
144
|
+
export function monthDate(date, offset) {
|
|
145
|
+
const first = civil(date.getFullYear(), date.getMonth() + offset, 1);
|
|
146
|
+
return civil(
|
|
147
|
+
first.getFullYear(),
|
|
148
|
+
first.getMonth(),
|
|
149
|
+
Math.min(
|
|
150
|
+
date.getDate(),
|
|
151
|
+
civil(first.getFullYear(), first.getMonth() + 1, 0).getDate(),
|
|
152
|
+
),
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
export function canNavigate(display, offset, range) {
|
|
156
|
+
const next = monthDate(display, offset);
|
|
157
|
+
return (
|
|
158
|
+
next.getFullYear() >= 1 &&
|
|
159
|
+
next.getFullYear() <= 9999 &&
|
|
160
|
+
(!range.min ||
|
|
161
|
+
iso(civil(next.getFullYear(), next.getMonth() + 1, 0)) >= range.min) &&
|
|
162
|
+
(!range.max ||
|
|
163
|
+
iso(civil(next.getFullYear(), next.getMonth(), 1)) <= range.max)
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
export function monthValues(display) {
|
|
167
|
+
const first = civil(display.getFullYear(), display.getMonth(), 1);
|
|
168
|
+
const offset = (first.getDay() + 6) % 7;
|
|
169
|
+
const count =
|
|
170
|
+
Math.ceil(
|
|
171
|
+
(offset + civil(first.getFullYear(), first.getMonth() + 1, 0).getDate()) /
|
|
172
|
+
7,
|
|
173
|
+
) * 7;
|
|
174
|
+
return Array.from({ length: count }, (_, i) =>
|
|
175
|
+
iso(civil(first.getFullYear(), first.getMonth(), 1 - offset + i)),
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
export function keyDate(value, key, shift) {
|
|
179
|
+
const date = parse(value);
|
|
180
|
+
if (!date) return null;
|
|
181
|
+
if (key === "PageUp" || key === "PageDown")
|
|
182
|
+
return monthDate(date, (key === "PageUp" ? -1 : 1) * (shift ? 12 : 1));
|
|
183
|
+
const day = (date.getDay() + 6) % 7;
|
|
184
|
+
const delta = {
|
|
185
|
+
ArrowLeft: -1,
|
|
186
|
+
ArrowRight: 1,
|
|
187
|
+
ArrowUp: -7,
|
|
188
|
+
ArrowDown: 7,
|
|
189
|
+
Home: -day,
|
|
190
|
+
End: 6 - day,
|
|
191
|
+
}[key];
|
|
192
|
+
return delta === undefined
|
|
193
|
+
? null
|
|
194
|
+
: civil(date.getFullYear(), date.getMonth(), date.getDate() + delta);
|
|
195
|
+
}
|
|
196
|
+
export function language(value) {
|
|
197
|
+
const lang = String(value || "en")
|
|
198
|
+
.toLowerCase()
|
|
199
|
+
.split("-")[0];
|
|
200
|
+
return copy[lang] ? lang : "en";
|
|
201
|
+
}
|
|
202
|
+
export function formats(locale) {
|
|
203
|
+
return {
|
|
204
|
+
month: new Intl.DateTimeFormat(locale, { month: "long", year: "numeric" }),
|
|
205
|
+
full: new Intl.DateTimeFormat(locale, {
|
|
206
|
+
weekday: "long",
|
|
207
|
+
day: "numeric",
|
|
208
|
+
month: "long",
|
|
209
|
+
year: "numeric",
|
|
210
|
+
}),
|
|
211
|
+
date: new Intl.DateTimeFormat(locale, {
|
|
212
|
+
day: "numeric",
|
|
213
|
+
month: "long",
|
|
214
|
+
year: "numeric",
|
|
215
|
+
}),
|
|
216
|
+
shortWeekday: new Intl.DateTimeFormat(locale, { weekday: "short" }),
|
|
217
|
+
fullWeekday: new Intl.DateTimeFormat(locale, { weekday: "long" }),
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
export const navigation = [
|
|
221
|
+
[-12, 2, "m11 18-6-6 6-6m8 12-6-6 6-6"],
|
|
222
|
+
[-1, 0, "m15 18-6-6 6-6"],
|
|
223
|
+
[1, 1, "m9 18 6-6-6-6"],
|
|
224
|
+
[12, 3, "m5 18 6-6-6-6m8 12 6-6-6-6"],
|
|
225
|
+
];
|
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
/* Optional complete form presentation. Defaults remain inheritable via fallbacks. */
|
|
2
|
+
:where(.gf-form, .gf-form *) {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
}
|
|
5
|
+
:where(.gf-form) {
|
|
6
|
+
display: grid;
|
|
7
|
+
gap: var(--gf-gap, 20px);
|
|
8
|
+
width: 100%;
|
|
9
|
+
max-width: 560px;
|
|
10
|
+
margin: 0 auto;
|
|
11
|
+
padding: var(--gf-padding, 32px);
|
|
12
|
+
color: var(--gf-text, #111216);
|
|
13
|
+
background: var(--gf-background, #fff);
|
|
14
|
+
font-family: var(--gf-font-family, system-ui, sans-serif);
|
|
15
|
+
font-size: var(--gf-font-size, 14px);
|
|
16
|
+
line-height: 1.5;
|
|
17
|
+
}
|
|
18
|
+
:where(.gf-form h1, .gf-form h2) {
|
|
19
|
+
margin: 0 0 8px;
|
|
20
|
+
font-size: 1.857142857em;
|
|
21
|
+
font-weight: 600;
|
|
22
|
+
letter-spacing: -0.04em;
|
|
23
|
+
line-height: 1.2;
|
|
24
|
+
}
|
|
25
|
+
:where(.gf-form h3, .gf-form h4, .gf-form p) {
|
|
26
|
+
margin: 0;
|
|
27
|
+
}
|
|
28
|
+
:where(.gf-form .gf-field) {
|
|
29
|
+
display: grid;
|
|
30
|
+
gap: 7px;
|
|
31
|
+
min-width: 0;
|
|
32
|
+
}
|
|
33
|
+
:where(.gf-form label, .gf-form legend) {
|
|
34
|
+
display: block;
|
|
35
|
+
font-weight: 500;
|
|
36
|
+
}
|
|
37
|
+
:where(.gf-form input, .gf-form textarea, .gf-form select, .gf-form button) {
|
|
38
|
+
font: inherit;
|
|
39
|
+
}
|
|
40
|
+
:where(
|
|
41
|
+
.gf-form
|
|
42
|
+
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(
|
|
43
|
+
[type="submit"]
|
|
44
|
+
):not([type="button"]):not([type="reset"]),
|
|
45
|
+
.gf-form textarea,
|
|
46
|
+
.gf-form select
|
|
47
|
+
) {
|
|
48
|
+
width: 100%;
|
|
49
|
+
min-width: 0;
|
|
50
|
+
border: 1px solid var(--gf-border, #d8d9e1);
|
|
51
|
+
border-radius: var(--gf-radius, 8px);
|
|
52
|
+
background: var(--gf-background, #fff);
|
|
53
|
+
color: var(--gf-text, #111216);
|
|
54
|
+
padding: 11px 12px;
|
|
55
|
+
}
|
|
56
|
+
:where(.gf-form textarea) {
|
|
57
|
+
min-height: 112px;
|
|
58
|
+
resize: vertical;
|
|
59
|
+
}
|
|
60
|
+
:where(.gf-form input[type="checkbox"], .gf-form input[type="radio"]) {
|
|
61
|
+
width: auto;
|
|
62
|
+
margin-right: 8px;
|
|
63
|
+
accent-color: var(--gf-primary, #2541e8);
|
|
64
|
+
}
|
|
65
|
+
:where(
|
|
66
|
+
.gf-form button[type="submit"],
|
|
67
|
+
.gf-form button:not([type]),
|
|
68
|
+
.gf-form input[type="submit"]
|
|
69
|
+
) {
|
|
70
|
+
border: 0;
|
|
71
|
+
border-radius: var(--gf-radius, 8px);
|
|
72
|
+
padding: 12px 18px;
|
|
73
|
+
background: var(--gf-primary, #2541e8);
|
|
74
|
+
color: var(--gf-primary-text, #fff);
|
|
75
|
+
font-weight: 500;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
}
|
|
78
|
+
:where(.gf-form fieldset) {
|
|
79
|
+
display: grid;
|
|
80
|
+
gap: 8px;
|
|
81
|
+
min-width: 0;
|
|
82
|
+
border: 0;
|
|
83
|
+
padding: 0;
|
|
84
|
+
margin: 0;
|
|
85
|
+
}
|
|
86
|
+
:where(.gf-form small) {
|
|
87
|
+
color: #6b6c77;
|
|
88
|
+
font-size: 0.857142857em;
|
|
89
|
+
}
|
|
90
|
+
:where(.gf-form :disabled) {
|
|
91
|
+
opacity: 0.6;
|
|
92
|
+
cursor: default;
|
|
93
|
+
}
|
|
94
|
+
:where(.gf-form :focus-visible) {
|
|
95
|
+
outline: 2px solid var(--gf-primary, #2541e8);
|
|
96
|
+
outline-offset: 3px;
|
|
97
|
+
}
|
|
98
|
+
:where(.gf-form .gf-choice-field) {
|
|
99
|
+
display: grid;
|
|
100
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
101
|
+
align-items: start;
|
|
102
|
+
gap: 8px;
|
|
103
|
+
}
|
|
104
|
+
:where(.gf-form .gf-choice-field > input) {
|
|
105
|
+
grid-column: 1;
|
|
106
|
+
grid-row: 1;
|
|
107
|
+
width: 16px;
|
|
108
|
+
height: 16px;
|
|
109
|
+
margin: 3px 0 0;
|
|
110
|
+
padding: 0;
|
|
111
|
+
}
|
|
112
|
+
:where(.gf-form .gf-choice-field > label) {
|
|
113
|
+
grid-column: 2;
|
|
114
|
+
grid-row: 1;
|
|
115
|
+
min-width: 0;
|
|
116
|
+
overflow-wrap: anywhere;
|
|
117
|
+
}
|
|
118
|
+
:where(.gf-form .gf-select-wrap) {
|
|
119
|
+
display: grid;
|
|
120
|
+
grid-template-columns: minmax(0, 1fr);
|
|
121
|
+
align-items: center;
|
|
122
|
+
min-width: 0;
|
|
123
|
+
}
|
|
124
|
+
:where(.gf-form .gf-select-wrap > select) {
|
|
125
|
+
grid-column: 1;
|
|
126
|
+
grid-row: 1;
|
|
127
|
+
appearance: none;
|
|
128
|
+
padding-right: 44px;
|
|
129
|
+
}
|
|
130
|
+
:where(.gf-form .gf-select-wrap > svg) {
|
|
131
|
+
grid-column: 1;
|
|
132
|
+
grid-row: 1;
|
|
133
|
+
justify-self: end;
|
|
134
|
+
width: 18px;
|
|
135
|
+
height: 18px;
|
|
136
|
+
margin-right: 16px;
|
|
137
|
+
pointer-events: none;
|
|
138
|
+
}
|
|
139
|
+
:where(.gf-form .gf-required-indicator) {
|
|
140
|
+
color: #6b6c77;
|
|
141
|
+
font-weight: 400;
|
|
142
|
+
margin-left: 3px;
|
|
143
|
+
}
|
|
144
|
+
:where(.gf-form .gf-react-choices) {
|
|
145
|
+
display: grid;
|
|
146
|
+
grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
|
|
147
|
+
gap: 10px;
|
|
148
|
+
}
|
|
149
|
+
:where(.gf-form .gf-react-choice) {
|
|
150
|
+
display: flex;
|
|
151
|
+
align-items: center;
|
|
152
|
+
gap: 8px;
|
|
153
|
+
padding: 12px;
|
|
154
|
+
border: 1px solid var(--gf-border, #d8d9e1);
|
|
155
|
+
border-radius: var(--gf-radius, 8px);
|
|
156
|
+
cursor: pointer;
|
|
157
|
+
}
|
|
158
|
+
:where(.gf-form .gf-react-choice input) {
|
|
159
|
+
flex-shrink: 0;
|
|
160
|
+
margin: 0;
|
|
161
|
+
}
|
|
162
|
+
:where(.gf-form input[type="file"]) {
|
|
163
|
+
max-width: 100%;
|
|
164
|
+
}
|
|
165
|
+
:where(.gf-form altcha-widget) {
|
|
166
|
+
display: block;
|
|
167
|
+
min-width: 0;
|
|
168
|
+
}
|
|
169
|
+
@media (max-width: 480px) {
|
|
170
|
+
:where(.gf-form) {
|
|
171
|
+
padding: var(--gf-padding, 20px);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
.gf-calendar {
|
|
175
|
+
box-sizing: border-box;
|
|
176
|
+
min-width: 0;
|
|
177
|
+
width: 100%;
|
|
178
|
+
margin-top: 8px;
|
|
179
|
+
padding: 17px 19px 13px;
|
|
180
|
+
border: 1px solid var(--gf-calendar-border, #dfe3ed);
|
|
181
|
+
border-radius: var(--gf-calendar-radius, 11px);
|
|
182
|
+
background: var(--gf-calendar-background, #fff);
|
|
183
|
+
color: var(--gf-calendar-text, #343a4b);
|
|
184
|
+
font: inherit;
|
|
185
|
+
font-weight: 400;
|
|
186
|
+
line-height: 1.5;
|
|
187
|
+
}
|
|
188
|
+
.gf-calendar * {
|
|
189
|
+
box-sizing: border-box;
|
|
190
|
+
}
|
|
191
|
+
.gf-calendar-header {
|
|
192
|
+
display: flex;
|
|
193
|
+
align-items: center;
|
|
194
|
+
justify-content: space-between;
|
|
195
|
+
gap: 8px;
|
|
196
|
+
margin-bottom: 16px;
|
|
197
|
+
}
|
|
198
|
+
.gf-calendar-month {
|
|
199
|
+
font-size: 14px;
|
|
200
|
+
font-weight: 600;
|
|
201
|
+
text-align: center;
|
|
202
|
+
text-transform: capitalize;
|
|
203
|
+
letter-spacing: -0.025em;
|
|
204
|
+
}
|
|
205
|
+
.gf-calendar-nav {
|
|
206
|
+
display: flex;
|
|
207
|
+
gap: 3px;
|
|
208
|
+
flex-shrink: 0;
|
|
209
|
+
}
|
|
210
|
+
.gf-calendar .gf-calendar-nav-button {
|
|
211
|
+
display: flex;
|
|
212
|
+
align-items: center;
|
|
213
|
+
justify-content: center;
|
|
214
|
+
width: 29px;
|
|
215
|
+
height: 29px;
|
|
216
|
+
min-height: 0;
|
|
217
|
+
padding: 0;
|
|
218
|
+
border: 1px solid #e3e5ec;
|
|
219
|
+
border-radius: 6px;
|
|
220
|
+
background: var(--gf-calendar-background, #fff);
|
|
221
|
+
color: #5d6478;
|
|
222
|
+
cursor: pointer;
|
|
223
|
+
}
|
|
224
|
+
.gf-calendar-nav-button svg {
|
|
225
|
+
width: 15px;
|
|
226
|
+
height: 15px;
|
|
227
|
+
}
|
|
228
|
+
.gf-calendar .gf-calendar-nav-button:hover:not(:disabled) {
|
|
229
|
+
background: #f1f4ff;
|
|
230
|
+
color: var(--gf-calendar-accent, #2541e8);
|
|
231
|
+
border-color: #bac8ff;
|
|
232
|
+
}
|
|
233
|
+
.gf-calendar-grid,
|
|
234
|
+
.gf-calendar-days {
|
|
235
|
+
display: grid;
|
|
236
|
+
gap: 5px;
|
|
237
|
+
}
|
|
238
|
+
.gf-calendar-row {
|
|
239
|
+
display: grid;
|
|
240
|
+
grid-template-columns: repeat(7, minmax(0, 1fr));
|
|
241
|
+
gap: 5px;
|
|
242
|
+
}
|
|
243
|
+
.gf-calendar-weekday {
|
|
244
|
+
overflow: hidden;
|
|
245
|
+
text-overflow: clip;
|
|
246
|
+
text-align: center;
|
|
247
|
+
font-size: 11px;
|
|
248
|
+
font-weight: 500;
|
|
249
|
+
line-height: 26px;
|
|
250
|
+
color: var(--gf-calendar-muted, #686e7e);
|
|
251
|
+
}
|
|
252
|
+
.gf-calendar-cell {
|
|
253
|
+
display: flex;
|
|
254
|
+
justify-content: center;
|
|
255
|
+
min-width: 0;
|
|
256
|
+
}
|
|
257
|
+
.gf-calendar .gf-calendar-day {
|
|
258
|
+
position: relative;
|
|
259
|
+
width: 100%;
|
|
260
|
+
max-width: 42px;
|
|
261
|
+
min-height: 38px;
|
|
262
|
+
padding: 0;
|
|
263
|
+
border: 1px solid transparent;
|
|
264
|
+
border-radius: 7px;
|
|
265
|
+
background: var(--gf-calendar-background, #fff);
|
|
266
|
+
color: var(--gf-calendar-text, #343a4b);
|
|
267
|
+
font: inherit;
|
|
268
|
+
font-size: 13px;
|
|
269
|
+
font-weight: 450;
|
|
270
|
+
font-variant-numeric: tabular-nums;
|
|
271
|
+
cursor: pointer;
|
|
272
|
+
}
|
|
273
|
+
.gf-calendar .gf-calendar-day:hover:not(:disabled) {
|
|
274
|
+
background: #edf2ff;
|
|
275
|
+
border-color: #cdd8ff;
|
|
276
|
+
color: var(--gf-calendar-accent, #2541e8);
|
|
277
|
+
}
|
|
278
|
+
.gf-calendar .gf-calendar-day[data-outside="true"] {
|
|
279
|
+
color: #81899b;
|
|
280
|
+
}
|
|
281
|
+
.gf-calendar
|
|
282
|
+
.gf-calendar-day[aria-current="date"]:not([aria-pressed="true"]):after {
|
|
283
|
+
content: "";
|
|
284
|
+
position: absolute;
|
|
285
|
+
bottom: 3px;
|
|
286
|
+
left: calc(50% - 1.5px);
|
|
287
|
+
height: 3px;
|
|
288
|
+
width: 3px;
|
|
289
|
+
border-radius: 50%;
|
|
290
|
+
background: var(--gf-calendar-accent, #2541e8);
|
|
291
|
+
}
|
|
292
|
+
.gf-calendar .gf-calendar-day[aria-pressed="true"] {
|
|
293
|
+
background: var(--gf-calendar-accent, #2541e8);
|
|
294
|
+
border-color: var(--gf-calendar-accent, #2541e8);
|
|
295
|
+
color: var(--gf-calendar-accent-text, #fff);
|
|
296
|
+
font-weight: 600;
|
|
297
|
+
box-shadow: 0 2px 5px #2541e822;
|
|
298
|
+
}
|
|
299
|
+
.gf-calendar .gf-calendar-day:disabled,
|
|
300
|
+
.gf-calendar .gf-calendar-nav-button:disabled {
|
|
301
|
+
opacity: 1;
|
|
302
|
+
color: #b1b7c5;
|
|
303
|
+
background: #f8f9fb;
|
|
304
|
+
cursor: default;
|
|
305
|
+
}
|
|
306
|
+
.gf-calendar .gf-calendar-day:disabled {
|
|
307
|
+
background: transparent;
|
|
308
|
+
}
|
|
309
|
+
.gf-calendar .gf-calendar-day[aria-pressed="true"]:disabled {
|
|
310
|
+
background: #e8ebf3;
|
|
311
|
+
color: #697086;
|
|
312
|
+
border-color: #e8ebf3;
|
|
313
|
+
box-shadow: none;
|
|
314
|
+
}
|
|
315
|
+
.gf-calendar-footer {
|
|
316
|
+
display: flex;
|
|
317
|
+
align-items: center;
|
|
318
|
+
justify-content: space-between;
|
|
319
|
+
gap: 10px;
|
|
320
|
+
border-top: 1px solid #edf0f5;
|
|
321
|
+
padding-top: 12px;
|
|
322
|
+
margin-top: 12px;
|
|
323
|
+
}
|
|
324
|
+
.gf-calendar-policy {
|
|
325
|
+
color: var(--gf-calendar-muted, #686e7e);
|
|
326
|
+
font-size: 11px;
|
|
327
|
+
}
|
|
328
|
+
.gf-calendar .gf-calendar-clear {
|
|
329
|
+
min-height: 0;
|
|
330
|
+
padding: 3px;
|
|
331
|
+
border: 0;
|
|
332
|
+
border-radius: 4px;
|
|
333
|
+
background: none;
|
|
334
|
+
color: var(--gf-calendar-accent, #2541e8);
|
|
335
|
+
font: inherit;
|
|
336
|
+
font-size: 12px;
|
|
337
|
+
cursor: pointer;
|
|
338
|
+
}
|
|
339
|
+
.gf-calendar .gf-calendar-clear:disabled {
|
|
340
|
+
color: #9298a7;
|
|
341
|
+
cursor: default;
|
|
342
|
+
}
|
|
343
|
+
.gf-calendar-selection {
|
|
344
|
+
min-height: 35px;
|
|
345
|
+
margin: 11px 0 0;
|
|
346
|
+
padding: 9px 11px;
|
|
347
|
+
border-radius: 6px;
|
|
348
|
+
background: #f5f7fc;
|
|
349
|
+
color: #606a80;
|
|
350
|
+
font-size: 12px;
|
|
351
|
+
overflow-wrap: anywhere;
|
|
352
|
+
}
|
|
353
|
+
.gf-calendar-selection[data-selected="true"] {
|
|
354
|
+
background: #eef3ff;
|
|
355
|
+
color: var(--gf-calendar-accent, #2541e8);
|
|
356
|
+
}
|
|
357
|
+
.gf-calendar button:focus-visible {
|
|
358
|
+
outline: 2px solid var(--gf-calendar-accent, #2541e8);
|
|
359
|
+
outline-offset: 3px;
|
|
360
|
+
z-index: 1;
|
|
361
|
+
}
|
|
362
|
+
.gf-calendar-sr-only {
|
|
363
|
+
position: absolute;
|
|
364
|
+
width: 1px;
|
|
365
|
+
height: 1px;
|
|
366
|
+
padding: 0;
|
|
367
|
+
margin: -1px;
|
|
368
|
+
overflow: hidden;
|
|
369
|
+
clip: rect(0, 0, 0, 0);
|
|
370
|
+
white-space: nowrap;
|
|
371
|
+
border: 0;
|
|
372
|
+
}
|
|
373
|
+
@media (max-width: 420px) {
|
|
374
|
+
.gf-calendar {
|
|
375
|
+
padding: 14px 10px 12px;
|
|
376
|
+
}
|
|
377
|
+
.gf-calendar-row {
|
|
378
|
+
gap: 3px;
|
|
379
|
+
}
|
|
380
|
+
.gf-calendar-month {
|
|
381
|
+
font-size: 12px;
|
|
382
|
+
}
|
|
383
|
+
.gf-calendar-nav {
|
|
384
|
+
gap: 2px;
|
|
385
|
+
}
|
|
386
|
+
.gf-calendar .gf-calendar-nav-button {
|
|
387
|
+
width: 25px;
|
|
388
|
+
height: 28px;
|
|
389
|
+
}
|
|
390
|
+
.gf-calendar .gf-calendar-day {
|
|
391
|
+
min-height: 35px;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/* Keep the form primary color on the selected day, not every calendar button. */
|
|
396
|
+
.gf-primary-color .gf-calendar .gf-calendar-day:not([aria-pressed="true"]),
|
|
397
|
+
.gf-primary-color .gf-calendar .gf-calendar-nav-button,
|
|
398
|
+
.gf-primary-color .gf-calendar .gf-calendar-clear {
|
|
399
|
+
background-color: #ffffff !important;
|
|
400
|
+
border-color: #e3e5ec !important;
|
|
401
|
+
color: var(--gf-calendar-text, #343a4b) !important;
|
|
402
|
+
}
|
|
403
|
+
.gf-primary-color
|
|
404
|
+
.gf-calendar
|
|
405
|
+
.gf-calendar-day:not([aria-pressed="true"]):hover:not(:disabled),
|
|
406
|
+
.gf-primary-color .gf-calendar .gf-calendar-nav-button:hover:not(:disabled),
|
|
407
|
+
.gf-primary-color .gf-calendar .gf-calendar-clear:hover:not(:disabled) {
|
|
408
|
+
background-color: #f1f3f6 !important;
|
|
409
|
+
border-color: #697086 !important;
|
|
410
|
+
}
|
|
411
|
+
.gf-primary-color .gf-calendar .gf-calendar-day[aria-pressed="true"] {
|
|
412
|
+
box-shadow: none;
|
|
413
|
+
}
|
|
414
|
+
.gf-primary-color .gf-calendar .gf-calendar-day:disabled,
|
|
415
|
+
.gf-primary-color .gf-calendar .gf-calendar-nav-button:disabled,
|
|
416
|
+
.gf-primary-color .gf-calendar .gf-calendar-clear:disabled {
|
|
417
|
+
background-color: #f8f9fb !important;
|
|
418
|
+
border-color: #e3e5ec !important;
|
|
419
|
+
color: #9298a7 !important;
|
|
420
|
+
}
|
|
421
|
+
.gf-primary-color
|
|
422
|
+
.gf-calendar
|
|
423
|
+
.gf-calendar-day[aria-current="date"]:not([aria-pressed="true"]):after {
|
|
424
|
+
background: currentColor;
|
|
425
|
+
}
|
|
426
|
+
.gf-primary-color .gf-calendar .gf-calendar-selection[data-selected="true"] {
|
|
427
|
+
background: #f1f3f6;
|
|
428
|
+
color: var(--gf-calendar-text, #343a4b);
|
|
429
|
+
}
|
|
430
|
+
/* Form tokens are fallbacks, so inherited calendar-specific tokens keep priority. */
|
|
431
|
+
:where(.gf-form) .gf-calendar {
|
|
432
|
+
border-color: var(--gf-calendar-border, var(--gf-border, #dfe3ed));
|
|
433
|
+
border-radius: var(--gf-calendar-radius, var(--gf-radius, 11px));
|
|
434
|
+
background: var(--gf-calendar-background, var(--gf-background, #fff));
|
|
435
|
+
color: var(--gf-calendar-text, var(--gf-text, #343a4b));
|
|
436
|
+
}
|
|
437
|
+
:where(.gf-form) .gf-calendar .gf-calendar-day {
|
|
438
|
+
background: var(--gf-calendar-background, var(--gf-background, #fff));
|
|
439
|
+
color: var(--gf-calendar-text, var(--gf-text, #343a4b));
|
|
440
|
+
font-size: 0.928571429em;
|
|
441
|
+
}
|
|
442
|
+
:where(.gf-form) .gf-calendar .gf-calendar-day:hover:not(:disabled),
|
|
443
|
+
:where(.gf-form) .gf-calendar .gf-calendar-nav-button:hover:not(:disabled),
|
|
444
|
+
:where(.gf-form) .gf-calendar .gf-calendar-clear,
|
|
445
|
+
:where(.gf-form) .gf-calendar-selection[data-selected="true"] {
|
|
446
|
+
color: var(--gf-calendar-accent, var(--gf-primary, #2541e8));
|
|
447
|
+
}
|
|
448
|
+
:where(.gf-form)
|
|
449
|
+
.gf-calendar
|
|
450
|
+
.gf-calendar-day[aria-current="date"]:not([aria-pressed="true"]):after {
|
|
451
|
+
background: var(--gf-calendar-accent, var(--gf-primary, #2541e8));
|
|
452
|
+
}
|
|
453
|
+
:where(.gf-form) .gf-calendar .gf-calendar-day[aria-pressed="true"] {
|
|
454
|
+
background: var(--gf-calendar-accent, var(--gf-primary, #2541e8));
|
|
455
|
+
border-color: var(--gf-calendar-accent, var(--gf-primary, #2541e8));
|
|
456
|
+
color: var(--gf-calendar-accent-text, var(--gf-primary-text, #fff));
|
|
457
|
+
}
|
|
458
|
+
:where(.gf-form) .gf-calendar button:focus-visible {
|
|
459
|
+
outline-color: var(--gf-calendar-accent, var(--gf-primary, #2541e8));
|
|
460
|
+
}
|
|
461
|
+
:where(.gf-form) .gf-calendar-month {
|
|
462
|
+
font-size: 1em;
|
|
463
|
+
}
|
|
464
|
+
:where(.gf-form) .gf-calendar-weekday,
|
|
465
|
+
:where(.gf-form) .gf-calendar-policy {
|
|
466
|
+
font-size: 0.785714286em;
|
|
467
|
+
}
|
|
468
|
+
:where(.gf-form) .gf-calendar .gf-calendar-clear,
|
|
469
|
+
:where(.gf-form) .gf-calendar-selection {
|
|
470
|
+
font-size: 0.857142857em;
|
|
471
|
+
}
|
|
472
|
+
@media (max-width: 420px) {
|
|
473
|
+
:where(.gf-form) .gf-calendar-month {
|
|
474
|
+
font-size: 0.857142857em;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
:where(.gf-form) .gf-calendar .gf-calendar-day {
|
|
478
|
+
border-radius: var(--gf-radius, 7px);
|
|
479
|
+
}
|
|
480
|
+
:where(.gf-form) .gf-calendar .gf-calendar-nav-button {
|
|
481
|
+
border-radius: var(--gf-radius, 6px);
|
|
482
|
+
border-color: var(--gf-calendar-border, var(--gf-border, #e3e5ec));
|
|
483
|
+
background: var(--gf-calendar-background, var(--gf-background, #fff));
|
|
484
|
+
color: var(--gf-calendar-text, var(--gf-text, #5d6478));
|
|
485
|
+
}
|
|
486
|
+
:where(.gf-form) .gf-calendar .gf-calendar-clear {
|
|
487
|
+
border-radius: var(--gf-radius, 4px);
|
|
488
|
+
}
|
|
489
|
+
:where(.gf-form)
|
|
490
|
+
.gf-calendar
|
|
491
|
+
.gf-calendar-day[aria-pressed="true"]:hover:not(:disabled) {
|
|
492
|
+
background: var(--gf-calendar-accent, var(--gf-primary, #2541e8));
|
|
493
|
+
border-color: var(--gf-calendar-accent, var(--gf-primary, #2541e8));
|
|
494
|
+
color: var(--gf-calendar-accent-text, var(--gf-primary-text, #fff));
|
|
495
|
+
}
|