@sfgov/fillout 0.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/README.md ADDED
@@ -0,0 +1,133 @@
1
+ # Fillout theme for SF.gov
2
+
3
+ This is a Fillout theme for SF.gov.
4
+
5
+ > [!WARNING]
6
+ > The CSS generated by this package may be applied and behave in subtly
7
+ > different ways from CSS injected by Fillout's own JavaScript. **Always test
8
+ > your changes in the dev theme** or [disable live reload](#disable-live-reload)
9
+ > on the dev server before "deploying" new CSS to the shared theme.
10
+
11
+ ## CSS pipeline
12
+
13
+ The theme CSS is built from [src/theme/sfgov.css](./src/theme/sfgov.css). We use
14
+ [postcss] to [inline][postcss-import] `@import` rules, process
15
+ [nested][postcss-nested] declarations, add a [header][postcss-header] that
16
+ includes the version, and [minify][cssnano] the output so that it's both small
17
+ and discourages editing by hand.
18
+
19
+ The [variables.css](./src/theme/variables.css) file is hand-rolled but will
20
+ eventually be either generated in or imported from the design system package.
21
+
22
+ ### Building the CSS
23
+
24
+ ```sh
25
+ npm run build:css
26
+ ```
27
+
28
+ This will output the minified CSS to `dist/theme-sfgov.css`, which will be
29
+ included when the package is published on npm.
30
+
31
+ ## Publish the package
32
+
33
+ Publishing the package on npm is as simple as:
34
+
35
+ 1. `npm version <version>` to set the `version` field in `package.json`
36
+ 2. `npm publish`
37
+
38
+ You'll need to be authenticated to publish. CI-based publishing should use
39
+ [trusted publishing] mechanisms, e.g. with [GitHub
40
+ Actions](https://docs.npmjs.com/trusted-publishers#for-github-actions).
41
+
42
+ ### Get the published URL
43
+
44
+ You can build a link to the published CSS hosted on [jsDelivr] from this URL
45
+ template:
46
+
47
+ ```url
48
+ https://cdn.jsdelivr.net/npm/@sfgov/fillout@VERSION/dist/theme-sfgov.css
49
+ ^^^^^^^
50
+ ```
51
+
52
+ Load that URL up in your browser (or with `curl`), copy its contents, then paste them into the Fillout theme's [custom CSS text box](https://www.fillout.com/help/custom-css#how-to-add-a-custom-css).
53
+
54
+ ## Dev server
55
+
56
+ The dev server dramatically reduces the effort and time to test CSS changes. Run it with:
57
+
58
+ ```sh
59
+ npm run dev
60
+ ```
61
+
62
+ This will start the dev server on port `8000` by default. The server proxies
63
+ every Fillout request to `https://digital.forms.sf.gov` and modifies some of the
64
+ HTML and JavaScript on the fly to replace a form's custom CSS with ours.
65
+
66
+ ### Live reload
67
+
68
+ The dev server offers live-reload-_like_ experience: It replaces the form's
69
+ custom CSS with whatever is built locally during the initial load, and then
70
+ injects [src/live-reload.js](./src/live-reload.js) into form pages.
71
+ The script then polls a JSON endpoint exposed by the proxy server to determine
72
+ if:
73
+
74
+ 1. The server code itself has been changed, in which case the page is reloaded;
75
+ or
76
+ 2. The CSS has changed, in which case the new CSS is fetched and swapped out
77
+ without a page reload.
78
+
79
+ > [!NOTE]
80
+ > The "versioning" logic and CSS hot-swapping are not perfect. If your styles
81
+ > aren't being applied, try reloading the page manually and/or [disable live
82
+ > reload](#disable-live-reload) altogether.
83
+
84
+ ### Disable live reload
85
+
86
+ To disable live reload, set `LIVE_RELOAD=0` (or `false` or `no`) before you
87
+ start the dev server, i.e.
88
+
89
+ ```sh
90
+ LIVE_RELOAD=false npm run dev
91
+ ```
92
+
93
+ ### Enable the proxy cache
94
+
95
+ Sometimes it's useful to inspect the CSS and JavaScript that Fillout uses. While
96
+ you can do this in browser dev tools, it's way easier to just set `STASH=true`
97
+ before running the dev server then looking at the files in the `.stash/`
98
+ directory with your favorite text editor or IDE:
99
+
100
+ ```sh
101
+ STASH=true npm run dev
102
+ ```
103
+
104
+ The paths of the files in the stash directory correspond to the URIs, so a
105
+ request for the [kitchen sink form][] (`GET /t/v4exrkajutus`) will write the HTML
106
+ response in `./stash/t/v4exrkajutus` along with all of the Next.js-bundled CSS
107
+ and JS dependencies in `./stash/_next/`.
108
+
109
+ ### Test on other Fillout domains
110
+
111
+ By default, the server proxies `digital.forms.sf.gov`. If you need to proxy a
112
+ different domain like `forms.fillout.com` (Fillout's default), just set
113
+ `PROXY_DOMAIN` accordingly:
114
+
115
+ ```sh
116
+ PROXY_DOMAIN=forms.fillout.com npm run dev
117
+ ```
118
+
119
+ ### Testing forms
120
+
121
+ To view a Fillout form with the local CSS, replace the
122
+ `https://digital.forms.sf.gov` prefix of the URL with `http://localhost:$PORT`
123
+ (e.g. `http://localhost:8000`). For instance, to view the [kitchen sink form],
124
+ visit [localhost:8000/t/v4exrkajutus](http://localhost:8000/t/v4exrkajutus).
125
+
126
+ [kitchen sink form]: https://digital.forms.sf.gov/t/v4exrkajutus
127
+ [postcss]: https://postcss.org/
128
+ [postcss-import]: https://www.npmjs.com/package/postcss-import
129
+ [postcss-nested]: https://www.npmjs.com/package/postcss-nested
130
+ [postcss-header]: https://www.npmjs.com/package/postcss-header
131
+ [cssnano]: https://cssnano.github.io/cssnano/
132
+ [trusted publishing]: https://docs.npmjs.com/trusted-publishers
133
+ [jsdelivr]: https://www.jsdelivr.com/
@@ -0,0 +1,485 @@
1
+ /*! @sfgov/fillout@0.0.1 */
2
+
3
+ * {
4
+ --sf-colors-white: #fcfcfc;
5
+ --sf-colors-black: #0b0c0c;
6
+ --sf-colors-primary10: #f3f8fe;
7
+ --sf-colors-primary50: #e9f1fe;
8
+ --sf-colors-primary100: #dfebfd;
9
+ --sf-colors-primary200: #afccf7;
10
+ --sf-colors-primary300: #83aceb;
11
+ --sf-colors-primary400: #5a8dd9;
12
+ --sf-colors-primary500: #2a60af;
13
+ --sf-colors-primary600: #1b519e;
14
+ --sf-colors-primary700: #043578;
15
+ --sf-colors-primary800: #001d4e;
16
+ --sf-colors-primary900: #000925;
17
+ --sf-colors-secondary10: #f2f9fa;
18
+ --sf-colors-secondary50: #e6f4f5;
19
+ --sf-colors-secondary100: #daeff0;
20
+ --sf-colors-secondary200: #a2d5d8;
21
+ --sf-colors-secondary300: #6ababf;
22
+ --sf-colors-secondary400: #2b9ea5;
23
+ --sf-colors-secondary500: #008189;
24
+ --sf-colors-secondary600: #00646c;
25
+ --sf-colors-secondary700: #00464e;
26
+ --sf-colors-secondary800: #002a30;
27
+ --sf-colors-secondary900: #001013;
28
+ --sf-colors-accent10: #fff5f0;
29
+ --sf-colors-accent50: #feede3;
30
+ --sf-colors-accent100: #fde4d7;
31
+ --sf-colors-accent200: #f6bc9b;
32
+ --sf-colors-accent300: #e79362;
33
+ --sf-colors-accent400: #d26d28;
34
+ --sf-colors-accent500: #b64a00;
35
+ --sf-colors-accent600: #942a00;
36
+ --sf-colors-accent700: #6f0f00;
37
+ --sf-colors-accent800: #470000;
38
+ --sf-colors-accent900: #200000;
39
+ --sf-colors-information10: #f2f8ff;
40
+ --sf-colors-information50: #e5f1ff;
41
+ --sf-colors-information100: #daebff;
42
+ --sf-colors-information200: #a3ccff;
43
+ --sf-colors-information300: #6faaff;
44
+ --sf-colors-information400: #4088fd;
45
+ --sf-colors-information500: #1066e5;
46
+ --sf-colors-information600: #0046c2;
47
+ --sf-colors-information700: #002996;
48
+ --sf-colors-information800: #001264;
49
+ --sf-colors-information900: #000331;
50
+ --sf-colors-informationSource: #1168e8;
51
+ --sf-colors-success10: #f3faf0;
52
+ --sf-colors-success50: #e8f5e2;
53
+ --sf-colors-success100: #def1d6;
54
+ --sf-colors-success200: #aed998;
55
+ --sf-colors-success300: #80bf5b;
56
+ --sf-colors-success400: #55a30f;
57
+ --sf-colors-success500: #2d8600;
58
+ --sf-colors-success600: #026800;
59
+ --sf-colors-success700: #004a00;
60
+ --sf-colors-success800: #002c00;
61
+ --sf-colors-success900: #001100;
62
+ --sf-colors-warning100: #f7e7d3;
63
+ --sf-colors-warning200: #e8c492;
64
+ --sf-colors-warning300: #d69f50;
65
+ --sf-colors-warning400: #bf7d00;
66
+ --sf-colors-warning500: #a35d00;
67
+ --sf-colors-warning600: #843f00;
68
+ --sf-colors-warning700: #612600;
69
+ --sf-colors-warning800: #3e1200;
70
+ --sf-colors-warning900: #1b0400;
71
+ --sf-colors-danger10: #fff4f1;
72
+ --sf-colors-danger50: #ffeae5;
73
+ --sf-colors-danger100: #ffe0d9;
74
+ --sf-colors-danger200: #ffb0a2;
75
+ --sf-colors-danger300: #ff7f6e;
76
+ --sf-colors-danger400: #ec4e3e;
77
+ --sf-colors-danger500: #d0110b;
78
+ --sf-colors-danger600: #ac0000;
79
+ --sf-colors-danger700: #810000;
80
+ --sf-colors-danger800: #550000;
81
+ --sf-colors-danger900: #280000;
82
+ --sf-colors-dangerSource: #d81c14;
83
+ --sf-colors-neutral10: #f7f8f8;
84
+ --sf-colors-neutral50: #eff0f0;
85
+ --sf-colors-neutral100: #e9eaea;
86
+ --sf-colors-neutral200: #c9caca;
87
+ --sf-colors-neutral300: #aaabab;
88
+ --sf-colors-neutral400: #8b8d8d;
89
+ --sf-colors-neutral500: #6e7070;
90
+ --sf-colors-neutral600: #535454;
91
+ --sf-colors-neutral700: #383939;
92
+ --sf-colors-neutral800: #202121;
93
+ --sf-colors-neutral900: #0b0b0b;
94
+
95
+ --sf-colors-link: var(--sf-colors-primary500);
96
+ --sf-colors-input-bg: white;
97
+ --sf-colors-input-border: var(--sf-colors-neutral200);
98
+
99
+ --sf-fontWeight-light: 300;
100
+ --sf-fontWeight-normal: 400;
101
+ --sf-fontWeight-medium: 500;
102
+ --sf-fontWeight-semibold: 600;
103
+ --sf-fontWeight-bold: 700;
104
+ --sf-fontWeight-extrabold: 800;
105
+ --sf-fontWeight-boldChinese: 500;
106
+
107
+ --sf-fontFamily-sans: "Roboto Flex", sans-serif;
108
+ --sf-fontFamily-slab: "Roboto Slab", serif;
109
+
110
+ --sf-font-body: var(--sf-fontWeight-normal) 16px/24px var(--sf-fontFamily-sans);
111
+ --sf-font-small: 14px/24px var(--sf-fontFamily-sans);
112
+ --sf-font-label-xs: var(--sf-fontWeight-normal) 14px/20px var(--sf-fontFamily-sans);
113
+ --sf-font-label-sm: var(--sf-fontWeight-normal) 16px/24px var(--sf-fontFamily-sans);
114
+ --sf-font-label-md: var(--sf-fontWeight-normal) 20px/28px var(--sf-fontFamily-sans);
115
+ --sf-font-label-md-button: var(--sf-fontWeight-bold) 20px/28px var(--sf-fontFamily-sans);
116
+ --sf-font-heading-xs: var(--sf-fontWeight-light) 14px/20px var(--sf-fontFamily-sans);
117
+ --sf-font-heading-sm: var(--sf-fontWeight-extrabold) 16px/24px var(--sf-fontFamily-sans);
118
+ --sf-font-heading-md: var(--sf-fontWeight-bold) 20px/28px var(--sf-fontFamily-sans);
119
+ --sf-font-heading-lg: var(--sf-fontWeight-medium) 24px/32px var(--sf-fontFamily-sans);
120
+ --sf-font-heading-xl: var(--sf-fontWeight-semibold) 32px/44px var(--sf-fontFamily-slab);
121
+ --sf-font-heading-xxl: var(--sf-fontWeight-medium) 40px/52px var(--sf-fontFamily-slab);
122
+ --sf-font-display-lg: var(--sf-fontWeight-normal) 24px/32px var(--sf-fontFamily-sans);
123
+ --sf-font-display-xxxl: var(--sf-fontWeight-semibold) 46px/56px var(--sf-fontFamily-slab);
124
+ --sf-font-button: var(--sf-font-label-xs);
125
+ }
126
+
127
+ /* Fillout variables */
128
+ * {
129
+ --radio-size: 40px;
130
+ --radio-dot-size: 22px;
131
+ --theme-input-bg-color: white;
132
+ --theme-primary-color: var(--sf-colors-primary500);
133
+ }
134
+
135
+ /* style reset */
136
+ * {
137
+ font: var(--sf-font-body);
138
+ }
139
+
140
+ /* Alerts/Banners */
141
+ .fillout-field-alert {
142
+ --alert-text: var(--sf-colors-black);
143
+ }
144
+ /**
145
+ * The quill class only applies in the Fillout editor; it seems like the best
146
+ * way to distinguish between the thing we want to style and the
147
+ * editor-specific thing with a border.
148
+ */
149
+ .fillout-field-alert .rounded-lg:not(.quill) {
150
+ background-color: var(--alert-bg);
151
+ border-radius: 0;
152
+ border-style: solid;
153
+ border-width: 0 0 0 8px;
154
+ border-color: var(--alert-border);
155
+ padding: 28px;
156
+ padding-left: 20px;
157
+ }
158
+ .fillout-field-alert .rounded-lg:not(.quill) svg {
159
+ color: var(--alert-border, var(--alert-text));
160
+ }
161
+ .fillout-field-alert .rounded-lg:not(.quill) a {
162
+ color: var(--alert-link, var(--sf-colors-link));
163
+ }
164
+ .fillout-field-alert .border-blue-400 {
165
+ --alert-border: var(--sf-colors-information600);
166
+ --alert-bg: var(--sf-colors-information50);
167
+ }
168
+ .fillout-field-alert .border-red-400,
169
+ .fillout-field-alert .border-yellow-400 {
170
+ --alert-border: var(--sf-colors-danger600);
171
+ --alert-bg: var(--sf-colors-danger50);
172
+ --alert-link: var(--sf-colors-danger800);
173
+ }
174
+ .fillout-field-alert .border-green-400 {
175
+ --alert-border: var(--sf-colors-success600);
176
+ --alert-bg: var(--sf-colors-success50);
177
+ --alert-link: var(--sf-colors-success800);
178
+ }
179
+ /* position the icon left of the content */
180
+ .fillout-field-alert .flex.items-center {
181
+ align-items: flex-start;
182
+ }
183
+ .fillout-field-alert .flex.items-center .flex-col {
184
+ flex-direction: row;
185
+ }
186
+ /* alert title */
187
+ .fillout-field-alert .ql-editor strong {
188
+ color: var(--alert-text);
189
+ }
190
+ /* alert text */
191
+ .fillout-field-alert .ql-editor p {
192
+ color: var(--sf-colors-black);
193
+ background-color: transparent;
194
+ }
195
+
196
+ /************************************
197
+ Buttons
198
+ ************************************/
199
+
200
+ .fillout-field-button div {
201
+ text-align: center;
202
+ font-family: "Roboto Flex", sans-serif;
203
+ font-style: normal;
204
+ font: var(--sf-font-button) !important;
205
+ }
206
+
207
+ /* next/primary button */
208
+
209
+ .fillout-field-button button {
210
+ height: 40px;
211
+ padding: 15px 16px;
212
+ border-radius: 4px;
213
+ border: 1px solid var(--sf-colors-primary600);
214
+ background-color: var(--sf-colors-primary600);
215
+ box-shadow: none;
216
+ color: var(--sf-colors-white);
217
+ font: var(--sf-font-button) !important;
218
+ }
219
+
220
+ .fillout-field-button button:hover {
221
+ border-color: var(--sf-colors-primary800);
222
+ background-color: var(--sf-colors-primary800);
223
+ }
224
+
225
+ .fillout-field-button button:focus {
226
+ outline: 3px solid var(--sf-colors-primary500);
227
+ box-shadow: none;
228
+ }
229
+
230
+ /* back/secondary button */
231
+ .fillout-back-button button {
232
+ border-radius: 4px;
233
+ border: 1px solid var(--sf-colors-primary100);
234
+ background-color: var(--sf-colors-primary100);
235
+ color: var(--sf-colors-primary900);
236
+ }
237
+ .fillout-back-button button:hover {
238
+ border: 1px solid var(--sf-colors-primary200);
239
+ background-color: var(--sf-colors-primary200);
240
+ }
241
+
242
+ /* button spacing */
243
+ .fillout-field-button > .flex {
244
+ justify-content: space-between !important;
245
+ flex-direction: row !important;
246
+ }
247
+ .fillout-field-button > .flex div {
248
+ margin: 0 !important;
249
+ }
250
+ .fillout-field-button > .flex .w-full {
251
+ width: auto !important;
252
+ }
253
+
254
+ /* radio button vertical spacing */
255
+ div[role="radiogroup"] > .gap-y-2 {
256
+ gap: 16px;
257
+ }
258
+
259
+ /**
260
+ absolute
261
+ radio-outer-circle
262
+ w-[var(--radio-size,16px)]
263
+ h-[var(--radio-size,16px)]
264
+ rounded-full
265
+ border-[var(--theme-primary-color)]
266
+ border-2 bg-[var(--theme-input-bg-color)]
267
+ transition-opacity
268
+ opacity-0
269
+ group-data-[state=checked]/radio:opacity-100
270
+ group-focus-visible/radio:[box-shadow:0_0_4px_2px_color-mix(in_srgb,var(--theme-focus-color)_70%,transparent)] group-focus-within/radio:[box-shadow:0_0_4px_2px_color-mix(in_srgb,var(--theme-focus-color)_70%,transparent)]
271
+ */
272
+ .radio-outer-circle:first-child {
273
+ background-color: white !important;
274
+ opacity: 1 !important;
275
+ /* don't transition opacity */
276
+ transition: none !important;
277
+ border-color: var(--sf-colors-input-border) !important;
278
+ }
279
+
280
+ .radio-outer-circle:nth-child(2) {
281
+ /* don't transition focus ring (border) color */
282
+ transition: none !important;
283
+ }
284
+
285
+ .radio-inner-circle {
286
+ /* don't transition focus circle size */
287
+ transition: none !important;
288
+ }
289
+
290
+ /* Checkboxes */
291
+
292
+ .animate-check {
293
+ /* don't animate checkboxes */
294
+ animation-duration: 0ms;
295
+ }
296
+
297
+ .fillout-field-checkbox button,
298
+ .fillout-field-checkbox button > svg,
299
+ .fillout-field-checkboxes button,
300
+ .fillout-field-checkboxes button > svg {
301
+ height: 40px;
302
+ width: 40px;
303
+ }
304
+
305
+ .fillout-field-checkbox button[aria-checked="true"],
306
+ .fillout-field-checkboxes button[aria-checked="true"] {
307
+ background-color: #386ebf;
308
+ }
309
+
310
+ .fillout-field-checkboxes fieldset {
311
+ gap: 16px;
312
+ }
313
+
314
+ /**
315
+ * Adjust the color of the hovered star. Note that this element is added and
316
+ * removed from the DOM dynamically rather than styled with Tailwind.
317
+ */
318
+
319
+ .fillout-field-star-rating button:hover .absolute:last-of-type svg {
320
+ color: var(--sf-colors-primary400) !important;
321
+ }
322
+
323
+ /* Dropdown/select */
324
+ .react-select__indicator {
325
+ color: var(--sf-colors-black);
326
+ }
327
+
328
+ /* .react-select__indicator-separator {
329
+ visibility: hidden;
330
+ } */
331
+
332
+ /* Error messages */
333
+ .fillout-error-validation-message {
334
+ color: var(--sf-colors-danger600);
335
+ font: var(--sf-font-heading-xs) !important;
336
+ }
337
+
338
+ /* Navigation/progress bar */
339
+ nav .group .step-name {
340
+ color: var(--sf-colors-black) !important;
341
+ }
342
+
343
+ /* Spacing */
344
+ #question-alignment-container.h-full {
345
+ height: fit-content;
346
+ }
347
+
348
+ /************************************
349
+ Switch
350
+ ************************************/
351
+ .fillout-field-switch .ant-switch:focus {
352
+ outline: 3px solid var(--sf-colors-primary500);
353
+ outline-offset: 4px;
354
+ transition: none;
355
+ }
356
+
357
+ /* Typography */
358
+
359
+ .fillout-field-text h1,
360
+ .fillout-field-text h2 {
361
+ color: var(--sf-colors-black);
362
+ font: var(--sf-font-display-xxxl) !important;
363
+ font-style: normal;
364
+ margin: 0;
365
+ }
366
+
367
+ .fillout-field-paragraph * {
368
+ font: var(--sf-font-body);
369
+ }
370
+
371
+ .fillout-field-paragraph h1 {
372
+ font: var(--sf-font-heading-xxl);
373
+ }
374
+
375
+ .fillout-field-paragraph h2 {
376
+ font: var(--sf-font-heading-xl);
377
+ }
378
+
379
+ .fillout-field-paragraph h3 {
380
+ font: var(--sf-font-heading-lg);
381
+ }
382
+
383
+ .fillout-field-paragraph h4 {
384
+ font: var(--sf-font-heading-md);
385
+ }
386
+
387
+ .fillout-field-paragraph h5 {
388
+ font: var(--sf-font-heading-sm);
389
+ }
390
+
391
+ .fillout-field-paragraph h6 {
392
+ font: var(--sf-font-heading-xs);
393
+ }
394
+
395
+ .fillout-field-container input[type],
396
+ .fillout-field-container input[placeholder],
397
+ .fillout-field-container label[type],
398
+ .fillout-field-container span[placeholder],
399
+ .fillout-field-container textarea[placeholder],
400
+ .fillout-field-checkboxes label,
401
+ .fillout-field-label p,
402
+ .react-select__value-container .react-select__single-value {
403
+ color: var(--sf-colors-black) !important;
404
+ }
405
+
406
+ .fillout-field-label p {
407
+ font: var(--sf-font-label-md) !important;
408
+ }
409
+
410
+ .fillout-field-address label {
411
+ font: var(--sf-font-label-sm) !important;
412
+ }
413
+
414
+ .fillout-field-multiple-choice label, .fillout-field-checkboxes label {
415
+ display: block;
416
+ font: var(--sf-font-label-md) !important;
417
+ }
418
+
419
+ .fillout-field-multiple-choice label {
420
+ padding-left: 8px;
421
+ }
422
+
423
+ .fillout-field-checkbox .ml-2 {
424
+ margin-left: 0 !important;
425
+ }
426
+
427
+ .fillout-field-checkbox p {
428
+ font: var(--sf-font-label-md) !important;
429
+ padding-left: 4px;
430
+ }
431
+ .fillout-field-checkboxes label {
432
+ padding-left: 4px;
433
+ }
434
+ .fillout-field-checkboxes label,
435
+ .fillout-field-checkboxes label div {
436
+ font: var(--sf-font-label-md) !important;
437
+ }
438
+
439
+ .fillout-caption {
440
+ color: var(--sf-colors-neutral600);
441
+ }
442
+
443
+ .fillout-caption p {
444
+ font: var(--sf-font-label-sm) !important;
445
+ }
446
+
447
+ input::placeholder {
448
+ color: var(--sf-colors-neutral600);
449
+ }
450
+
451
+ a {
452
+ color: var(--sf-colors-primary500);
453
+ }
454
+
455
+ .fillout-required-asterisk,
456
+ p::after {
457
+ color: var(--sf-colors-danger600);
458
+ }
459
+
460
+ /* File upload */
461
+ .filepond--drop-label {
462
+ padding: 16px;
463
+ }
464
+
465
+ /* Section collapse */
466
+ /* Accordion styles */
467
+ .fillout-field-section-collapse > .w-full:first-child {
468
+ color: var(--sf-colors-link) !important;
469
+ font: var(--sf-font-label-md-button) !important;
470
+ background-color: transparent !important;
471
+ border-bottom: 1px solid var(--sf-colors-neutral300);
472
+ border-radius: 0;
473
+ padding: 0 0 12px 0 !important;
474
+ }
475
+ .fillout-field-section-collapse > .w-full:first-child span {
476
+ font: inherit !important;
477
+ }
478
+ .fillout-field-section-collapse > .w-full:first-child svg {
479
+ color: var(--sf-colors-link) !important;
480
+ }
481
+
482
+ /* Divider */
483
+ .fillout-field-divider .border-t {
484
+ border-top: 1px solid var(--sf-colors-neutral300) !important;
485
+ }
@@ -0,0 +1,231 @@
1
+ /*! @sfgov/fillout@0.0.1 */
2
+ /* Alerts/Banners */
3
+ .fillout-field-alert .border-blue-400 {
4
+ border: 1px solid #0046c2;
5
+ border-radius: 0px;
6
+ background-color: #e5f1ff;
7
+ padding: 28px;
8
+ }
9
+ /* alert icon */
10
+ .fillout-field-alert .text-blue-400 {
11
+ color: #0046c2;
12
+ }
13
+ /* alert inner container */
14
+ .fillout-field-alert .flex.items-center {
15
+ align-items: flex-start;
16
+ }
17
+ .fillout-field-alert .flex.items-center .flex-col {
18
+ flex-direction: row;
19
+ }
20
+ /* alert title */
21
+ .fillout-field-alert .ql-editor strong {
22
+ color: #0046c2;
23
+ background-color: #e5f1ff;
24
+ }
25
+ /* alert text */
26
+ .fillout-field-alert .ql-editor p {
27
+ color: #0b0c0c;
28
+ background-color: inherit;
29
+ }
30
+
31
+ /* Buttons */
32
+
33
+ .fillout-field-button div {
34
+ text-align: center;
35
+ font-family: "Roboto Flex", sans-serif;
36
+ font-size: 14px;
37
+ font-style: normal;
38
+ font-weight: 500;
39
+ line-height: 20px;
40
+ }
41
+
42
+ /* next/primary button */
43
+
44
+ .fillout-field-button button {
45
+ height: 40px;
46
+ padding: 15px 16px;
47
+ border-radius: 4px;
48
+ border: 1px solid #1b519e;
49
+ background-color: red !important; /* #1b519e; */
50
+ box-shadow: none;
51
+ color: #fcfcfc;
52
+
53
+ font-size: 16px;
54
+ font-weight: 400;
55
+ line-height: 24px;
56
+ }
57
+
58
+ .fillout-field-button button:hover {
59
+ border-color: #001d4e;
60
+ background-color: #001d4e;
61
+ }
62
+
63
+ .fillout-field-button button:focus {
64
+ outline: 3px solid #2a60af;
65
+ box-shadow: none;
66
+ }
67
+
68
+ /* button spacing */
69
+
70
+ .fillout-field-button > .flex {
71
+ justify-content: space-between !important;
72
+ flex-direction: row !important;
73
+ }
74
+
75
+ .fillout-field-button > .flex div {
76
+ margin: 0 !important;
77
+ }
78
+
79
+ .fillout-field-button > .flex .w-full {
80
+ width: auto !important;
81
+ }
82
+
83
+ /* back/secondary button */
84
+
85
+ .fillout-field-button .fillout-back-button button {
86
+ border-radius: 4px;
87
+ border: 1px solid #dfebfd;
88
+ background-color: #dfebfd;
89
+ color: #000925;
90
+ }
91
+
92
+ .fillout-field-button .fillout-back-button button:hover {
93
+ border: 1px solid #afccf7;
94
+ background-color: #afccf7;
95
+ }
96
+
97
+
98
+ /************************************
99
+ Checkboxes
100
+ ************************************/
101
+ .fillout-field-checkbox button,
102
+ .fillout-field-checkbox button > svg,
103
+ .fillout-field-checkboxes button,
104
+ .fillout-field-checkboxes button > svg {
105
+ height: 40px;
106
+ width: 40px;
107
+ }
108
+
109
+ .fillout-field-checkbox button[aria-checked="true"],
110
+ .fillout-field-checkboxes button[aria-checked="true"] {
111
+ background-color: #386ebf;
112
+ }
113
+
114
+ .fillout-field-checkboxes fieldset {
115
+ gap: 16px;
116
+ }
117
+
118
+ /* Dropdown/select */
119
+ .react-select__indicator {
120
+ color: #0b0c0c;
121
+ }
122
+
123
+ /* Error messages */
124
+ .fillout-error-validation-message {
125
+ color: #ac0000;
126
+ font-size: 14px;
127
+ font-weight: 400;
128
+ line-height: 20px;
129
+ }
130
+
131
+ /* Navigation/progress bar */
132
+ nav .group .step-name {
133
+ color: #0b0c0c !important;
134
+ }
135
+
136
+ /* Multiple choice */
137
+ .fillout-field-multiple-choice span > span.rounded-full {
138
+ height: 40px;
139
+ width: 40px;
140
+ }
141
+ .fillout-field-multiple-choice span > span.rounded-full div {
142
+ height: 22px;
143
+ width: 22px;
144
+ color: #386ebf;
145
+ }
146
+ .fillout-field-multiple-choice [role="radiogroup"] {
147
+ gap: 16px;
148
+ }
149
+
150
+ /* Spacing */
151
+ #question-alignment-container.h-full {
152
+ height: fit-content;
153
+ }
154
+ #question-alignment-container > :not(:last-child) {
155
+ --tw-space-y-reverse: 0;
156
+ margin-block-start: calc(
157
+ calc(var(--spacing) * 40) * var(--tw-space-y-reverse)
158
+ );
159
+ margin-block-end: calc(
160
+ calc(var(--spacing) * 40) * calc(1 - var(--tw-space-y-reverse))
161
+ );
162
+ }
163
+
164
+ /* Switch */
165
+ .fillout-field-switch .ant-switch:focus {
166
+ outline: 3px solid #2a60af;
167
+ outline-offset: 4px;
168
+ transition: none;
169
+ }
170
+
171
+ /************************************
172
+ Text
173
+
174
+ Note:
175
+ Roboto Slab isn't available/is being buggy in custom Fillout CSS, so we
176
+ made it the default text and targeted everything else to be Roboto Flex.
177
+ ************************************/
178
+
179
+ .fillout-field-text h1, .fillout-field-text h2 {
180
+ font-family: "Roboto Slab", sans-serif;
181
+ font-style: normal;
182
+ color: #0b0c0c;
183
+ padding-bottom: 20px;
184
+ font-weight: 600;
185
+ font-size: 46px;
186
+ line-height: 56px;
187
+ }
188
+
189
+ div,
190
+ span,
191
+ p {
192
+ font-family: "Roboto Flex", sans-serif;
193
+ font-style: normal;
194
+ }
195
+
196
+ .fillout-field-paragraph p {
197
+ font-size: 16px;
198
+ font-weight: 400;
199
+ line-height: 24px;
200
+ }
201
+
202
+ .fillout-field-label p {
203
+ color: #0b0c0c;
204
+ font-size: 20px;
205
+ line-height: 28px;
206
+ }
207
+
208
+ .fillout-field-container input[type],
209
+ .fillout-field-container input[placeholder],
210
+ .fillout-field-container label[type],
211
+ .fillout-field-container span[placeholder],
212
+ .fillout-field-container textarea[placeholder],
213
+ .fillout-field-multiple-choice [role="radio"] div,
214
+ .fillout-field-checkboxes label div,
215
+ .react-select__value-container .react-select__single-value {
216
+ color: #0b0c0c !important;
217
+ }
218
+
219
+ .fillout-caption,
220
+ input::placeholder {
221
+ color: #535454;
222
+ }
223
+
224
+ a {
225
+ color: #2a60af;
226
+ }
227
+
228
+ .fillout-required-asterisk,
229
+ p::after {
230
+ color: #ac0000;
231
+ }
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@sfgov/fillout",
3
+ "version": "0.0.1",
4
+ "private": false,
5
+ "scripts": {
6
+ "dev": "npx nodemon -w scripts/server.ts -w src -e ts --exec scripts/server.ts",
7
+ "build:css": "postcss src/theme/sfgov.css -o dist/theme-sfgov.css",
8
+ "prepublish": "npm run build:css"
9
+ },
10
+ "files": [
11
+ "dist/",
12
+ "README.md"
13
+ ],
14
+ "devDependencies": {
15
+ "@types/cheerio": "^0.22.35",
16
+ "@types/express": "^5.0.6",
17
+ "@types/express-http-proxy": "^1.6.7",
18
+ "@types/morgan": "^1.9.10",
19
+ "@types/postcss-css-variables": "^0.18.3",
20
+ "@types/postcss-header": "^2.0.4",
21
+ "@types/postcss-import": "^14.0.3",
22
+ "autoprefixer": "^10.5.4",
23
+ "cheerio": "^1.2.0",
24
+ "cssnano": "^8.0.2",
25
+ "express": "^5.2.1",
26
+ "express-http-proxy": "^2.1.2",
27
+ "morgan": "^1.11.0",
28
+ "nodemon": "^3.1.14",
29
+ "postcss": "^8.5.23",
30
+ "postcss-cli": "^11.0.1",
31
+ "postcss-css-variables": "^0.19.0",
32
+ "postcss-header": "^3.0.3",
33
+ "postcss-import": "^16.1.1",
34
+ "postcss-load-config": "^6.0.1",
35
+ "postcss-nested": "^7.0.2"
36
+ }
37
+ }