@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 ADDED
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ ## 0.2.0
4
+
5
+ - Add optional `form.css` with complete form and calendar styles.
6
+ - Add CSS variables for typography, colors, borders and spacing.
7
+ - Preserve the calendar-only `styles.css` entry.
8
+
9
+ ## 0.1.0
10
+
11
+ Initial release with civil date limits, accessible calendar selection and explicit styles.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 GlueForms contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,111 @@
1
- # Temporary Holding Version
1
+ # @glueforms/react
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Open-source library for building and styling React forms. Compose native inputs, labels, selects, textareas and submit buttons with `form.css`, and use `DateField` when you need a date picker or expanded calendar. Customize colors, fonts, borders and spacing with CSS variables.
4
+
5
+ Pair it with [GlueForms](https://glueforms.com/form-api), the form backend for collecting submissions by email and in an inbox.
6
+
7
+ Use it for contact forms, quote requests, feedback and appointment requests in React applications. React 18.3 and 19 are supported. The library keeps ordinary HTML form submission and works with server rendering.
8
+
9
+ [Form backend](https://glueforms.com) · [Form API](https://glueforms.com/form-api) · [Connection guide](https://glueforms.com/docs/connect) · [React form templates](https://glueforms.com/templates/react)
10
+
11
+ ## Quick start
12
+
13
+ Install version 0.2.0 in your React app:
14
+
15
+ ```sh
16
+ npm install @glueforms/react@0.2.0
17
+ ```
18
+
19
+ Replace `YOUR_FORM_URL` with your receiving endpoint:
20
+
21
+ ```tsx
22
+ import { DateField } from '@glueforms/react';
23
+ import '@glueforms/react/form.css';
24
+
25
+ export function VisitForm() {
26
+ return (
27
+ <form className="gf-form" action="YOUR_FORM_URL" method="POST">
28
+ <h1>Request a visit</h1>
29
+ <div className="gf-field">
30
+ <label htmlFor="email">Your email</label>
31
+ <input id="email" name="replyto" type="email" required />
32
+ </div>
33
+ <div className="gf-field">
34
+ <label htmlFor="date">Preferred date</label>
35
+ <DateField id="date" name="date" appearance="calendar"
36
+ datePolicy="tomorrow" required />
37
+ </div>
38
+ <div className="gf-field">
39
+ <label htmlFor="time">Preferred time</label>
40
+ <input id="time" name="time" type="time" step="60" />
41
+ </div>
42
+ <button type="submit">Send request</button>
43
+ </form>
44
+ );
45
+ }
46
+ ```
47
+
48
+ `appearance` defaults to `native`. `datePolicy` accepts `any`, `today` or `tomorrow`. Dates use the visitor's local day and submit as `YYYY-MM-DD`. Standard input attributes and the forwarded ref apply to the native date input. Keep the calendar's label separate with `htmlFor` and `id`.
49
+
50
+ ## Customize the form
51
+
52
+ Add variables to your site's stylesheet. Use `:root` for all forms or `.gf-form` for one form:
53
+
54
+ ```css
55
+ .gf-form {
56
+ --gf-font-family: Georgia, serif;
57
+ --gf-font-size: 16px;
58
+ --gf-text: #172033;
59
+ --gf-background: #fff;
60
+ --gf-primary: #1649b8;
61
+ --gf-primary-text: #fff;
62
+ --gf-border: #b7c1d3;
63
+ --gf-radius: 12px;
64
+ --gf-gap: 24px;
65
+ --gf-padding: 24px;
66
+ }
67
+ ```
68
+
69
+ `form.css` includes calendar styles. Choose `styles.css` instead if you only want the calendar styled. Neither stylesheet resets the page body or changes unrelated forms.
70
+
71
+ ## Receive submissions with GlueForms
72
+
73
+ [GlueForms](https://glueforms.com) is a form backend for HTML forms, React apps and static websites. It receives submissions, sends email notifications and keeps messages in an inbox, so you can collect responses without building your own backend.
74
+
75
+ Use the [form API](https://glueforms.com/form-api) for contact forms, quote requests, feedback and other website forms. Keep your website and design, and send named fields to your form's submission URL with a normal POST request.
76
+
77
+ 1. Create a [GlueForms account](https://glueforms.com) and verify your email.
78
+ 2. Choose **Connect a form I already have** to set up a form, or select an existing one from **Forms**.
79
+ 3. Copy its submission URL into `YOUR_FORM_URL` in the example. Send a test, then check **Messages**.
80
+
81
+ The [connection guide](https://glueforms.com/docs/connect) covers setup, email notifications and testing. The open-source library handles presentation in the browser. The hosted GlueForms service handles receiving and storing submissions. You can also use the library with your own form endpoint.
82
+
83
+ ### Templates, integrations and AI tools
84
+
85
+ - Start with [HTML form templates](https://glueforms.com/templates) or [React form templates](https://glueforms.com/templates/react).
86
+ - Create [hosted forms](https://glueforms.com/hosted-forms) to collect responses through a shareable link without a website.
87
+ - Connect [integrations](https://glueforms.com/docs/integrations) such as Google Sheets, Slack, Notion and webhooks with Pro.
88
+ - Use the scoped [private API](https://glueforms.com/docs/private-api) or authorize an AI assistant through [MCP](https://glueforms.com/docs/mcp) with Pro to work with forms and messages.
89
+ - Browse the [AI-readable documentation index](https://glueforms.com/llms.txt) for product guides and integration references.
90
+
91
+ ## Control the selected date
92
+
93
+ Use `defaultValue` for an uncontrolled input. Use `value` and `onValueChange` when React state owns the date:
94
+
95
+ ```tsx
96
+ const [date, setDate] = useState('');
97
+ <DateField aria-label="Visit date" appearance="calendar"
98
+ value={date} onValueChange={setDate} />
99
+ ```
100
+
101
+ Import `useState` from React and place this code inside your component. The second callback argument is `input`, `selection`, `clear` or `constraint`. `onChange` handles native typing only. Calendar actions use `onValueChange`, and a controlled value waits for its owner to update it.
102
+
103
+ Server rendering produces a native input. Calendar enhancement starts after hydration. The component supports StrictMode cleanup and normal form reset. Do not mix it with the core package's document-wide auto initialization.
104
+
105
+ ## Develop
106
+
107
+ Use Node.js 24 and npm. Run `npm ci`, `npm test` and `npm pack`. Tests build the package first. Sources are in `react/src/` and `shared/`. React is a peer dependency and is not bundled.
108
+
109
+ ## License
110
+
111
+ The library is MIT licensed. This license applies to the package, not the hosted GlueForms service. See [LICENSE](LICENSE) and [third-party notices](THIRD-PARTY-NOTICES.txt) for Lucide and Feather icon attribution.
@@ -0,0 +1,43 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2026 Lucide Icons and Contributors
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
+
17
+ ---
18
+
19
+ The following Lucide icons are derived from the Feather project:
20
+
21
+ airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
22
+
23
+ The MIT License (MIT) (for the icons listed above)
24
+
25
+ Copyright (c) 2013-present Cole Bemis
26
+
27
+ Permission is hereby granted, free of charge, to any person obtaining a copy
28
+ of this software and associated documentation files (the "Software"), to deal
29
+ in the Software without restriction, including without limitation the rights
30
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
31
+ copies of the Software, and to permit persons to whom the Software is
32
+ furnished to do so, subject to the following conditions:
33
+
34
+ The above copyright notice and this permission notice shall be included in all
35
+ copies or substantial portions of the Software.
36
+
37
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
38
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
39
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
40
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
41
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
42
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
43
+ SOFTWARE.
package/dist/form.css ADDED
@@ -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
+ }
@@ -0,0 +1,17 @@
1
+ import type * as React from "react";
2
+ export type DatePolicy = "any" | "today" | "tomorrow";
3
+ export type ValueChangeReason = "input" | "selection" | "clear" | "constraint";
4
+ export type DateFieldProps = Omit<
5
+ React.InputHTMLAttributes<HTMLInputElement>,
6
+ "type" | "children" | "value" | "defaultValue" | "onChange"
7
+ > & {
8
+ appearance?: "native" | "calendar";
9
+ datePolicy?: DatePolicy;
10
+ value?: string;
11
+ defaultValue?: string;
12
+ onChange?: React.ChangeEventHandler<HTMLInputElement>;
13
+ onValueChange?: (value: string, reason: ValueChangeReason) => void;
14
+ };
15
+ export declare const DateField: React.ForwardRefExoticComponent<
16
+ DateFieldProps & React.RefAttributes<HTMLInputElement>
17
+ >;