@glueforms/react 0.1.0 → 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.
@@ -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
+ }
@@ -1,4 +1,4 @@
1
- export const VERSION = "0.1.0";
1
+ export const VERSION = "0.2.0";
2
2
  const registryKey = Symbol.for("glueforms.public.date-fields.ownership");
3
3
  export function acquire(root, kind, create) {
4
4
  const document = root?.nodeType === 9 ? root : root?.ownerDocument;