@volverjs/style 0.1.28 → 0.1.30-beta.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.
Files changed (158) hide show
  1. package/design-tokens.json +503 -7
  2. package/dist/base.css +1 -1
  3. package/dist/components/vv-alert.css +1 -1
  4. package/dist/components/vv-attachment-group.css +1 -0
  5. package/dist/components/vv-attachment.css +1 -0
  6. package/dist/components/vv-avatar.css +1 -1
  7. package/dist/components/vv-badge.css +1 -1
  8. package/dist/components/vv-breadcrumb.css +1 -1
  9. package/dist/components/vv-bubble-group.css +1 -0
  10. package/dist/components/vv-bubble.css +1 -0
  11. package/dist/components/vv-button.css +1 -1
  12. package/dist/components/vv-calendar.css +1 -0
  13. package/dist/components/vv-checkbox-group.css +1 -1
  14. package/dist/components/vv-checkbox.css +1 -1
  15. package/dist/components/vv-command.css +1 -0
  16. package/dist/components/vv-dialog.css +1 -1
  17. package/dist/components/vv-dropdown-action.css +1 -1
  18. package/dist/components/vv-dropdown-option.css +1 -1
  19. package/dist/components/vv-empty.css +1 -0
  20. package/dist/components/vv-field.css +1 -0
  21. package/dist/components/vv-input-file.css +1 -1
  22. package/dist/components/vv-input-otp.css +1 -0
  23. package/dist/components/vv-input-range.css +1 -1
  24. package/dist/components/vv-input-text.css +1 -1
  25. package/dist/components/vv-item-group.css +1 -0
  26. package/dist/components/vv-item.css +1 -0
  27. package/dist/components/vv-kbd-group.css +1 -0
  28. package/dist/components/vv-kbd.css +1 -0
  29. package/dist/components/vv-marker.css +1 -0
  30. package/dist/components/vv-message-scroller.css +1 -0
  31. package/dist/components/vv-message.css +1 -0
  32. package/dist/components/vv-nav.css +1 -1
  33. package/dist/components/vv-pagination.css +1 -0
  34. package/dist/components/vv-popover.css +1 -0
  35. package/dist/components/vv-progress.css +1 -1
  36. package/dist/components/vv-prose.css +1 -0
  37. package/dist/components/vv-questionnaire.css +1 -0
  38. package/dist/components/vv-radio-group.css +1 -1
  39. package/dist/components/vv-radio.css +1 -1
  40. package/dist/components/vv-select.css +1 -1
  41. package/dist/components/vv-separator.css +1 -0
  42. package/dist/components/vv-sidebar.css +1 -0
  43. package/dist/components/vv-spinner.css +1 -0
  44. package/dist/components/vv-table.css +1 -1
  45. package/dist/components/vv-text.css +1 -1
  46. package/dist/components/vv-textarea.css +1 -1
  47. package/dist/components.css +1 -1
  48. package/dist/export.css +1 -1
  49. package/dist/props/colors.css +1 -1
  50. package/dist/props/input.css +1 -1
  51. package/dist/props.css +1 -1
  52. package/dist/themes/dark/components.css +1 -1
  53. package/dist/themes/dark/props.css +1 -1
  54. package/dist/themes/dark/volver.css +1 -1
  55. package/dist/utilities/colors.css +1 -1
  56. package/dist/utilities/layout.css +1 -1
  57. package/dist/utilities.css +1 -1
  58. package/dist/volver.css +1 -1
  59. package/package.json +49 -1
  60. package/src/_config.scss +23 -0
  61. package/src/_preflight.scss +14 -2
  62. package/src/components/index.scss +28 -0
  63. package/src/components/vv-attachment-group.scss +17 -0
  64. package/src/components/vv-attachment.scss +17 -0
  65. package/src/components/vv-bubble-group.scss +17 -0
  66. package/src/components/vv-bubble.scss +17 -0
  67. package/src/components/vv-calendar.scss +25 -0
  68. package/src/components/vv-command.scss +17 -0
  69. package/src/components/vv-empty.scss +17 -0
  70. package/src/components/vv-field.scss +25 -0
  71. package/src/components/vv-input-otp.scss +17 -0
  72. package/src/components/vv-item-group.scss +17 -0
  73. package/src/components/vv-item.scss +39 -0
  74. package/src/components/vv-kbd-group.scss +17 -0
  75. package/src/components/vv-kbd.scss +17 -0
  76. package/src/components/vv-marker.scss +17 -0
  77. package/src/components/vv-message-scroller.scss +24 -0
  78. package/src/components/vv-message.scss +25 -0
  79. package/src/components/vv-pagination.scss +17 -0
  80. package/src/components/vv-popover.scss +17 -0
  81. package/src/components/vv-prose.scss +17 -0
  82. package/src/components/vv-questionnaire.scss +28 -0
  83. package/src/components/vv-separator.scss +17 -0
  84. package/src/components/vv-sidebar.scss +17 -0
  85. package/src/components/vv-spinner.scss +27 -0
  86. package/src/presets/_outlined-fields.scss +346 -0
  87. package/src/props/colors.scss +6 -0
  88. package/src/props/index.scss +4 -1
  89. package/src/props/media.scss +21 -6
  90. package/src/settings/_colors.scss +161 -61
  91. package/src/settings/_index.scss +26 -0
  92. package/src/settings/_input.scss +9 -0
  93. package/src/settings/components/_choice.scss +104 -0
  94. package/src/settings/components/_vv-alert.scss +37 -12
  95. package/src/settings/components/_vv-attachment-group.scss +10 -0
  96. package/src/settings/components/_vv-attachment.scss +135 -0
  97. package/src/settings/components/_vv-avatar.scss +17 -7
  98. package/src/settings/components/_vv-badge.scss +21 -13
  99. package/src/settings/components/_vv-breadcrumb.scss +1 -1
  100. package/src/settings/components/_vv-bubble-group.scss +31 -0
  101. package/src/settings/components/_vv-bubble.scss +69 -0
  102. package/src/settings/components/_vv-button.scss +48 -5
  103. package/src/settings/components/_vv-calendar.scss +102 -0
  104. package/src/settings/components/_vv-checkbox-group.scss +33 -2
  105. package/src/settings/components/_vv-checkbox.scss +7 -2
  106. package/src/settings/components/_vv-command.scss +99 -0
  107. package/src/settings/components/_vv-dialog.scss +129 -26
  108. package/src/settings/components/_vv-dropdown-action.scss +2 -1
  109. package/src/settings/components/_vv-dropdown-option.scss +3 -3
  110. package/src/settings/components/_vv-empty.scss +71 -0
  111. package/src/settings/components/_vv-field.scss +111 -0
  112. package/src/settings/components/_vv-input-file.scss +6 -6
  113. package/src/settings/components/_vv-input-otp.scss +55 -0
  114. package/src/settings/components/_vv-input-range.scss +2 -2
  115. package/src/settings/components/_vv-input-text.scss +6 -6
  116. package/src/settings/components/_vv-item-group.scss +68 -0
  117. package/src/settings/components/_vv-item.scss +201 -0
  118. package/src/settings/components/_vv-kbd-group.scss +9 -0
  119. package/src/settings/components/_vv-kbd.scss +20 -0
  120. package/src/settings/components/_vv-marker.scss +32 -0
  121. package/src/settings/components/_vv-message-scroller.scss +65 -0
  122. package/src/settings/components/_vv-message.scss +95 -0
  123. package/src/settings/components/_vv-nav.scss +7 -3
  124. package/src/settings/components/_vv-pagination.scss +78 -0
  125. package/src/settings/components/_vv-popover.scss +53 -0
  126. package/src/settings/components/_vv-progress.scss +4 -4
  127. package/src/settings/components/_vv-prose.scss +274 -0
  128. package/src/settings/components/_vv-questionnaire.scss +77 -0
  129. package/src/settings/components/_vv-radio.scss +6 -2
  130. package/src/settings/components/_vv-select.scss +5 -5
  131. package/src/settings/components/_vv-separator.scss +79 -0
  132. package/src/settings/components/_vv-sidebar.scss +91 -0
  133. package/src/settings/components/_vv-spinner.scss +26 -0
  134. package/src/settings/components/_vv-table.scss +63 -0
  135. package/src/settings/components/_vv-text.scss +2 -2
  136. package/src/settings/components/_vv-textarea.scss +6 -6
  137. package/src/themes/dark/components/_vv-checkbox.scss +27 -0
  138. package/src/themes/dark/components/_vv-radio.scss +27 -0
  139. package/src/themes/dark/components/index.scss +2 -0
  140. package/src/themes/dark/props/_colors.scss +6 -0
  141. package/src/themes/dark/settings/_colors.scss +97 -32
  142. package/src/themes/dark/settings/_index.scss +2 -0
  143. package/src/themes/dark/settings/components/_choice.scss +15 -0
  144. package/src/themes/dark/settings/components/_vv-alert.scss +6 -48
  145. package/src/themes/dark/settings/components/_vv-avatar.scss +1 -16
  146. package/src/themes/dark/settings/components/_vv-badge.scss +1 -32
  147. package/src/themes/dark/settings/components/_vv-button.scss +0 -8
  148. package/src/themes/dark/settings/components/_vv-checkbox.scss +7 -0
  149. package/src/themes/dark/settings/components/_vv-dropdown-action.scss +2 -3
  150. package/src/themes/dark/settings/components/_vv-dropdown-option.scss +2 -19
  151. package/src/themes/dark/settings/components/_vv-nav.scss +2 -15
  152. package/src/themes/dark/settings/components/_vv-radio.scss +7 -0
  153. package/src/tools/_functions.scss +430 -2
  154. package/src/tools/mixin-modules/_bem.scss +5 -39
  155. package/src/tools/mixin-modules/_states.scss +77 -0
  156. package/src/tools/mixin-modules/_theme.scss +135 -121
  157. package/src/utilities/colors.scss +49 -4
  158. package/src/utilities/layout.scss +25 -0
@@ -1,3 +1,5 @@
1
+ @use 'choice' as *;
2
+
1
3
  $vv-checkbox: (
2
4
  display: inline-flex,
3
5
  flex-wrap: wrap,
@@ -82,6 +84,8 @@ $vv-checkbox: (
82
84
  ),
83
85
  ),
84
86
  modifier: (
87
+ segment: $choice-segment,
88
+ card: $choice-card,
85
89
  readonly: (
86
90
  opacity: var(--opacity-100),
87
91
  cursor: default,
@@ -135,6 +139,7 @@ $vv-checkbox: (
135
139
  after: (
136
140
  [translate]:
137
141
  calc(100% * var(--direction, 1)),
142
+ background: var(--color-brand-contrast),
138
143
  ),
139
144
  ),
140
145
  ),
@@ -145,14 +150,14 @@ $vv-checkbox: (
145
150
  valid: (
146
151
  element: (
147
152
  hint: (
148
- color: var(--input-valid-color),
153
+ color: var(--input-valid-text-color),
149
154
  ),
150
155
  ),
151
156
  ),
152
157
  invalid: (
153
158
  element: (
154
159
  hint: (
155
- color: var(--input-invalid-color),
160
+ color: var(--input-invalid-text-color),
156
161
  ),
157
162
  ),
158
163
  ),
@@ -0,0 +1,99 @@
1
+ // A command palette: a search field over a list of commands grouped under
2
+ // headings, inline in a page or inside a `vv-dialog`. The field is the
3
+ // `combobox` and the list the `listbox`, each group a `role="group"` labelled
4
+ // by its `heading`; the option the keyboard is on carries
5
+ // `aria-selected="true"`, which the block reads. A shortcut at the end of an
6
+ // option is a `vv-kbd`.
7
+ $vv-command: (
8
+ display: flex,
9
+ flex-direction: column,
10
+ min-width: 0,
11
+ overflow: hidden,
12
+ border: var(--border) solid var(--color-surface-3),
13
+ border-radius: var(--rounded-lg),
14
+ background-color: var(--color-surface),
15
+ color: var(--color-word-2),
16
+ font-size: var(--text-14),
17
+ element: (
18
+ search: (
19
+ display: flex,
20
+ align-items: center,
21
+ gap: var(--spacing-8),
22
+ padding-inline: var(--spacing-12),
23
+ border-bottom: var(--border) solid var(--color-surface-3),
24
+ color: var(--color-word-3),
25
+ transition: border-color var(--duration-150) var(--ease-out),
26
+ // The field has no ring of its own: the divider under it takes
27
+ // the focus colour, like the search of a dropdown
28
+ state: (
29
+ focus-within: (
30
+ border-bottom-color: var(--color-brand),
31
+ ),
32
+ ),
33
+ ),
34
+ input: (
35
+ flex: 1,
36
+ min-width: 0,
37
+ min-height: var(--spacing-44),
38
+ color: var(--color-word-1),
39
+ [font]: inherit,
40
+ pseudo: (
41
+ placeholder: (
42
+ color: var(--input-placeholder-color),
43
+ ),
44
+ ),
45
+ ),
46
+ list: (
47
+ max-height: 20rem,
48
+ margin: 0,
49
+ padding: var(--spacing-4),
50
+ overflow-y: auto,
51
+ list-style: none,
52
+ scrollbar-width: thin,
53
+ ),
54
+ heading: (
55
+ padding: var(--spacing-8) var(--spacing-8) var(--spacing-4),
56
+ color: var(--color-word-3),
57
+ font-size: var(--text-12),
58
+ font-weight: var(--font-semibold),
59
+ ),
60
+ option: (
61
+ display: flex,
62
+ align-items: center,
63
+ gap: var(--spacing-8),
64
+ padding: var(--spacing-8),
65
+ border-radius: var(--rounded-md),
66
+ cursor: pointer,
67
+ state: (
68
+ hover: (
69
+ background-color: var(--color-surface-1),
70
+ ),
71
+ // Declared after the hover: the option the keyboard is on
72
+ // keeps its surface under the pointer
73
+ selected: (
74
+ background-color: var(--color-surface-2),
75
+ color: var(--color-word),
76
+ ),
77
+ // A `li` can only be `aria-disabled`, which the hover suffix does
78
+ // not exclude: the option answers no pointer instead
79
+ disabled: (
80
+ opacity: var(--opacity-30),
81
+ cursor: not-allowed,
82
+ pointer-events: none,
83
+ ),
84
+ ),
85
+ ),
86
+ shortcut: (
87
+ display: inline-flex,
88
+ align-items: center,
89
+ gap: 0.25em,
90
+ margin-inline-start: auto,
91
+ color: var(--color-word-4),
92
+ ),
93
+ empty: (
94
+ padding: var(--spacing-lg) var(--spacing-12),
95
+ color: var(--color-word-3),
96
+ text-align: center,
97
+ ),
98
+ ),
99
+ ) !default;
@@ -1,3 +1,40 @@
1
+ @use 'sass:map';
2
+
3
+ // The sections of every drawer. Flat header and footer: on a panel that
4
+ // spans a side of the viewport the filled bands read as heavy. The footer
5
+ // keeps its divider because the content above it scrolls.
6
+ $-drawer-sections: (
7
+ header: (
8
+ font-weight: var(--font-bold),
9
+ background: var(--color-transparent),
10
+ border-bottom: 0,
11
+ ),
12
+ // Without the divider the header padding already spaces the title from
13
+ // the first field, so drop the duplicate.
14
+ content: (
15
+ padding-top: 0,
16
+ ),
17
+ footer: (
18
+ background: var(--color-transparent),
19
+ ),
20
+ );
21
+
22
+ // A panel along an inline side: full height, full width below sm
23
+ $-drawer-inline-elements: map.merge(
24
+ (
25
+ wrapper: (
26
+ width: 100%,
27
+ max-height: 100dvh,
28
+ border-radius: var(--rounded-none),
29
+ breakpoint: (
30
+ up-sm: (
31
+ width: min(75dvw, 32rem),
32
+ ),
33
+ ),
34
+ ),
35
+ ),
36
+ $-drawer-sections
37
+ );
1
38
  $vv-dialog: (
2
39
  display: flex,
3
40
  user-select: text,
@@ -163,6 +200,60 @@ $vv-dialog: (
163
200
  ),
164
201
  ),
165
202
  ),
203
+ slide-inline-start: (
204
+ active: (
205
+ transition: var(--transition-opacity),
206
+ element: (
207
+ wrapper: (
208
+ transition: var(--transition-transform),
209
+ ),
210
+ ),
211
+ ),
212
+ inert: (
213
+ opacity: var(--opacity-0),
214
+ element: (
215
+ wrapper: (
216
+ [translate]: calc(-100% * var(--direction, 1)),
217
+ ),
218
+ ),
219
+ ),
220
+ ),
221
+ slide-block-start: (
222
+ active: (
223
+ transition: var(--transition-opacity),
224
+ element: (
225
+ wrapper: (
226
+ transition: var(--transition-transform),
227
+ ),
228
+ ),
229
+ ),
230
+ inert: (
231
+ opacity: var(--opacity-0),
232
+ element: (
233
+ wrapper: (
234
+ translate: 0 -100%,
235
+ ),
236
+ ),
237
+ ),
238
+ ),
239
+ slide-block-end: (
240
+ active: (
241
+ transition: var(--transition-opacity),
242
+ element: (
243
+ wrapper: (
244
+ transition: var(--transition-transform),
245
+ ),
246
+ ),
247
+ ),
248
+ inert: (
249
+ opacity: var(--opacity-0),
250
+ element: (
251
+ wrapper: (
252
+ translate: 0 100%,
253
+ ),
254
+ ),
255
+ ),
256
+ ),
166
257
  ),
167
258
  modifier: (
168
259
  small: (
@@ -190,33 +281,45 @@ $vv-dialog: (
190
281
  padding: 0,
191
282
  align-items: stretch,
192
283
  justify-content: flex-end,
193
- element: (
194
- wrapper: (
195
- width: 100%,
196
- max-height: 100dvh,
197
- border-radius: var(--rounded-none),
198
- breakpoint: (
199
- up-sm: (
200
- width: min(75dvw, 32rem),
201
- ),
284
+ element: $-drawer-inline-elements,
285
+ ),
286
+ // The same panel on the inline start, with slide-inline-start
287
+ drawer-start: (
288
+ padding: 0,
289
+ align-items: stretch,
290
+ justify-content: flex-start,
291
+ element: $-drawer-inline-elements,
292
+ ),
293
+ // A sheet across the top, with slide-block-start: full width, as tall
294
+ // as its content up to the 90% of the viewport every dialog stops at
295
+ drawer-top: (
296
+ padding: 0,
297
+ align-items: flex-start,
298
+ justify-content: stretch,
299
+ element: map.merge(
300
+ $-drawer-sections,
301
+ (
302
+ wrapper: (
303
+ width: 100%,
304
+ border-radius: 0 0 var(--rounded-lg) var(--rounded-lg),
202
305
  ),
203
- ),
204
- // Flat header and footer: on a full height panel the filled
205
- // bands read as heavy. The footer keeps its divider because
206
- // the content above it scrolls.
207
- header: (
208
- font-weight: var(--font-bold),
209
- background: var(--color-transparent),
210
- border-bottom: 0,
211
- ),
212
- // Without the divider the header padding already spaces the
213
- // title from the first field, so drop the duplicate.
214
- content: (
215
- padding-top: 0,
216
- ),
217
- footer: (
218
- background: var(--color-transparent),
219
- ),
306
+ )
307
+ ),
308
+ ),
309
+ // The bottom sheet of a phone, with slide-block-end: full width, as
310
+ // tall as its content up to 90% of the viewport, rounded on top
311
+ drawer-bottom: (
312
+ padding: 0,
313
+ align-items: flex-end,
314
+ justify-content: stretch,
315
+ element: map.merge(
316
+ $-drawer-sections,
317
+ (
318
+ wrapper: (
319
+ width: 100%,
320
+ border-radius: var(--rounded-lg) var(--rounded-lg) 0 0,
321
+ ),
322
+ )
220
323
  ),
221
324
  ),
222
325
  ),
@@ -5,7 +5,7 @@ $vv-dropdown-action: (
5
5
  gap: var(--spacing-sm),
6
6
  align-items: center,
7
7
  padding: var(--spacing-sm),
8
- color: var(--color-brand),
8
+ color: var(--color-brand-readable),
9
9
  cursor: pointer,
10
10
  state: (
11
11
  disabled: (
@@ -14,6 +14,7 @@ $vv-dropdown-action: (
14
14
  ),
15
15
  hover: (
16
16
  background-color: var(--color-surface-brand),
17
+ color: var(--color-surface-brand-readable),
17
18
  ),
18
19
  focus-visible: (
19
20
  outline: var(--spacing-px) solid var(--color-brand),
@@ -16,7 +16,7 @@ $vv-dropdown-option: (
16
16
  ),
17
17
  focus-visible: (
18
18
  background-color: var(--color-surface-success),
19
- color: var(--color-success-darken-1),
19
+ color: var(--color-surface-success-readable),
20
20
  element: (
21
21
  hint: (
22
22
  opacity: var(--opacity-100),
@@ -26,7 +26,7 @@ $vv-dropdown-option: (
26
26
  selected: (
27
27
  font-weight: var(--font-bold),
28
28
  background-color: var(--color-surface-brand),
29
- color: var(--color-brand-darken-1),
29
+ color: var(--color-surface-brand-readable),
30
30
  ),
31
31
  ),
32
32
  modifier: (
@@ -34,7 +34,7 @@ $vv-dropdown-option: (
34
34
  state: (
35
35
  focus-visible: (
36
36
  background-color: var(--color-surface-danger),
37
- color: var(--color-danger),
37
+ color: var(--color-surface-danger-readable),
38
38
  ),
39
39
  ),
40
40
  ),
@@ -0,0 +1,71 @@
1
+ // "There is nothing here yet": what a list, a table or a page shows in place
2
+ // of its content, with an optional way out (create, import, clear the filters).
3
+ // The message is quiet on purpose: `word-3` for the block, `word-1` for the
4
+ // title alone, no colour of state.
5
+ $vv-empty: (
6
+ display: flex,
7
+ flex-direction: column,
8
+ align-items: center,
9
+ justify-content: center,
10
+ gap: var(--spacing-sm),
11
+ padding: var(--spacing-xl) var(--spacing-lg),
12
+ color: var(--color-word-3),
13
+ text-align: center,
14
+ element: (
15
+ // An icon or an illustration. The font size sets the icon, which
16
+ // measures `1em` the way Iconify emits it
17
+ media: (
18
+ display: flex,
19
+ align-items: center,
20
+ justify-content: center,
21
+ margin-block-end: var(--spacing-xs),
22
+ color: var(--color-word-4),
23
+ font-size: var(--text-32),
24
+ line-height: var(--leading-none),
25
+ ),
26
+ title: (
27
+ margin: var(--spacing-0),
28
+ color: var(--color-word-1),
29
+ font-size: var(--text-16),
30
+ font-weight: var(--font-semibold),
31
+ line-height: var(--leading-snug),
32
+ ),
33
+ description: (
34
+ max-inline-size: 60ch,
35
+ margin: var(--spacing-0),
36
+ font-size: var(--text-14),
37
+ line-height: var(--leading-normal),
38
+ text-wrap: pretty,
39
+ ),
40
+ actions: (
41
+ display: flex,
42
+ flex-wrap: wrap,
43
+ justify-content: center,
44
+ gap: var(--spacing-sm),
45
+ margin-block-start: var(--spacing-xs),
46
+ ),
47
+ ),
48
+ modifier: (
49
+ // Inside a list, a table or a card, where the frame is already there
50
+ // and a page sized empty state would push the rest away
51
+ compact: (
52
+ gap: var(--spacing-xs),
53
+ padding: var(--spacing-lg) var(--spacing-12),
54
+ element: (
55
+ media: (
56
+ margin-block-end: var(--spacing-0),
57
+ font-size: var(--text-24),
58
+ ),
59
+ title: (
60
+ font-size: var(--text-14),
61
+ ),
62
+ ),
63
+ ),
64
+ // A dashed frame, for an area that is waiting to be filled: a drop
65
+ // zone, a board with no card yet
66
+ bordered: (
67
+ border: var(--border) dashed var(--color-surface-4),
68
+ border-radius: var(--rounded-lg),
69
+ ),
70
+ ),
71
+ ) !default;
@@ -0,0 +1,111 @@
1
+ @use 'sass:map';
2
+ @use 'vv-input-text' as *;
3
+
4
+ // The shell of a field around a control the library does not draw: a code
5
+ // editor, a contenteditable prompt, a button that opens a picker, a switch
6
+ // that has to sit in a form with the rhythm of the other fields. Label, box,
7
+ // hint, states and the `valid`, `invalid` and `loading` modifiers are the
8
+ // ones of `vv-input-text`, read from its map, so the two stay one field; what
9
+ // is new is what goes inside the box:
10
+ // - `control`: the control itself, which takes the padding of a field and
11
+ // lets the box draw hover, focus and disabled;
12
+ // - `before` and `after`: an icon, a unit or a button inline with the
13
+ // control, on either side of it;
14
+ // - `toolbar`: a row of buttons under the control, inside the box, the way a
15
+ // message composer puts its actions under the text.
16
+ // The copy is taken when this map is loaded: a later override of
17
+ // `$vv-input-text` does not reach it, `$vv-field` is overridden on its own.
18
+
19
+ $-text: $vv-input-text;
20
+ $vv-field: (
21
+ display: var(--input-display),
22
+ flex: var(--input-flex),
23
+ flex-direction: var(--input-flex-direction),
24
+ margin-bottom: var(--input-gap),
25
+ font-size: var(--input-font-size),
26
+ line-height: var(--input-line-height),
27
+ min-width: var(--input-min-width),
28
+ element: (
29
+ label: map.get($-text, 'element', 'label'),
30
+ // The box wraps, so a toolbar takes a row of its own under the control
31
+ wrapper: map.merge(
32
+ map.get($-text, 'element', 'wrapper'),
33
+ (
34
+ flex-wrap: wrap,
35
+ )
36
+ ),
37
+ // No `display` of its own: a flex item is blockified anyway, and a
38
+ // switch used as the control keeps the `inline-flex` of its block
39
+ control: (
40
+ flex: 1,
41
+ min-width: 0,
42
+ min-height: var(--input-min-height),
43
+ margin: 0,
44
+ border: 0,
45
+ outline: none,
46
+ background: none,
47
+ color: var(--input-color),
48
+ line-height: var(--leading-normal),
49
+ // Plain declarations: the spacing tokens are overridden on the
50
+ // block by the modifiers of a field, see `vv-input-text`
51
+ [padding-block]: var(--input-spacing-top) var(--input-spacing-bottom),
52
+ [padding-inline]: var(--input-spacing-left) var(--input-spacing-right),
53
+ [font]: inherit,
54
+ pseudo: (
55
+ placeholder: (
56
+ color: var(--input-placeholder-color),
57
+ ),
58
+ ),
59
+ state: (
60
+ disabled: (
61
+ cursor: not-allowed,
62
+ ),
63
+ ),
64
+ ),
65
+ // Named after `input-before` and `input-after` of `vv-input-text`: the
66
+ // padding goes on the outer side only, since the control already
67
+ // spaces the inner one
68
+ before: (
69
+ display: flex,
70
+ flex-shrink: 0,
71
+ align-items: center,
72
+ gap: var(--spacing-4),
73
+ color: var(--input-placeholder-color),
74
+ [padding-inline-start]: var(--input-spacing-left),
75
+ ),
76
+ after: (
77
+ display: flex,
78
+ flex-shrink: 0,
79
+ align-items: center,
80
+ gap: var(--spacing-4),
81
+ color: var(--input-placeholder-color),
82
+ [padding-inline-end]: var(--input-spacing-right),
83
+ ),
84
+ toolbar: (
85
+ display: flex,
86
+ flex-basis: 100%,
87
+ flex-wrap: wrap,
88
+ align-items: center,
89
+ gap: var(--spacing-4),
90
+ [padding-inline]: var(--input-spacing-left) var(--input-spacing-right),
91
+ [padding-bottom]: var(--input-spacing-bottom),
92
+ ),
93
+ hint: map.get($-text, 'element', 'hint'),
94
+ ),
95
+ modifier: (
96
+ valid: (
97
+ element: (
98
+ wrapper: map.get($-text, 'modifier', 'valid', 'element', 'wrapper'),
99
+ hint: map.get($-text, 'modifier', 'valid', 'element', 'hint'),
100
+ ),
101
+ ),
102
+ invalid: (
103
+ element: (
104
+ wrapper: map.get($-text, 'modifier', 'invalid', 'element', 'wrapper'),
105
+ hint: map.get($-text, 'modifier', 'invalid', 'element', 'hint'),
106
+ ),
107
+ ),
108
+ loading: map.get($-text, 'modifier', 'loading'),
109
+ ),
110
+ state: map.get($-text, 'state'),
111
+ ) !default;
@@ -336,13 +336,13 @@ $vv-input-file: (
336
336
  ),
337
337
  ),
338
338
  hint: (
339
- color: var(--input-valid-color),
339
+ color: var(--input-valid-text-color),
340
340
  ),
341
341
  limit: (
342
- color: var(--input-valid-color),
342
+ color: var(--input-valid-text-color),
343
343
  ),
344
344
  icon-after: (
345
- color: var(--input-valid-color),
345
+ color: var(--input-valid-text-color),
346
346
  ),
347
347
  drop-area: (
348
348
  pseudo: (
@@ -364,13 +364,13 @@ $vv-input-file: (
364
364
  ),
365
365
  ),
366
366
  hint: (
367
- color: var(--input-invalid-color),
367
+ color: var(--input-invalid-text-color),
368
368
  ),
369
369
  limit: (
370
- color: var(--input-invalid-color),
370
+ color: var(--input-invalid-text-color),
371
371
  ),
372
372
  icon-after: (
373
- color: var(--input-invalid-color),
373
+ color: var(--input-invalid-text-color),
374
374
  ),
375
375
  drop-area: (
376
376
  pseudo: (
@@ -0,0 +1,55 @@
1
+ // A one-time code typed one character per slot: `slot` inputs side by side,
2
+ // optionally split into groups by a `separator`. Each slot is a text input of
3
+ // one character; moving the focus between them is behaviour and belongs to
4
+ // the script. The slots take the surface and the text of the fields of the
5
+ // library, a border so each reads as a box, and the focus of the library.
6
+ $vv-input-otp: (
7
+ display: inline-flex,
8
+ align-items: center,
9
+ gap: var(--spacing-8),
10
+ element: (
11
+ group: (
12
+ display: inline-flex,
13
+ gap: var(--spacing-6),
14
+ ),
15
+ slot: (
16
+ inline-size: 2.5em,
17
+ block-size: 3em,
18
+ border: var(--border) solid var(--color-surface-4),
19
+ border-radius: var(--rounded-md),
20
+ background-color: var(--input-background-color),
21
+ color: var(--input-color),
22
+ font-size: var(--text-20),
23
+ font-variant-numeric: tabular-nums,
24
+ text-align: center,
25
+ caret-color: var(--color-brand),
26
+ transition: border-color var(--duration-150) var(--ease-out),
27
+ state: (
28
+ hover: (
29
+ border-color: var(--color-surface-5),
30
+ ),
31
+ focus-visible: (
32
+ border-color: var(--color-brand),
33
+ outline: var(--spacing-px) solid var(--color-brand),
34
+ outline-offset: 0,
35
+ ),
36
+ disabled: (
37
+ opacity: var(--opacity-50),
38
+ cursor: not-allowed,
39
+ ),
40
+ ),
41
+ ),
42
+ separator: (
43
+ color: var(--color-word-4),
44
+ ),
45
+ ),
46
+ modifier: (
47
+ invalid: (
48
+ element: (
49
+ slot: (
50
+ border-color: var(--input-invalid-color),
51
+ ),
52
+ ),
53
+ ),
54
+ ),
55
+ ) !default;
@@ -155,7 +155,7 @@ $vv-input-range: (
155
155
  --input-range-accent-color: var(--input-valid-color),
156
156
  element: (
157
157
  hint: (
158
- color: var(--input-valid-color),
158
+ color: var(--input-valid-text-color),
159
159
  ),
160
160
  value: (
161
161
  border-color: var(--input-valid-color),
@@ -166,7 +166,7 @@ $vv-input-range: (
166
166
  --input-range-accent-color: var(--input-invalid-color),
167
167
  element: (
168
168
  hint: (
169
- color: var(--input-invalid-color),
169
+ color: var(--input-invalid-text-color),
170
170
  ),
171
171
  value: (
172
172
  border-color: var(--input-invalid-color),
@@ -252,13 +252,13 @@ $vv-input-text: (
252
252
  ),
253
253
  ),
254
254
  hint: (
255
- color: var(--input-valid-color),
255
+ color: var(--input-valid-text-color),
256
256
  ),
257
257
  limit: (
258
- color: var(--input-valid-color),
258
+ color: var(--input-valid-text-color),
259
259
  ),
260
260
  icon-after: (
261
- color: var(--input-valid-color),
261
+ color: var(--input-valid-text-color),
262
262
  ),
263
263
  ),
264
264
  ),
@@ -273,13 +273,13 @@ $vv-input-text: (
273
273
  ),
274
274
  ),
275
275
  hint: (
276
- color: var(--input-invalid-color),
276
+ color: var(--input-invalid-text-color),
277
277
  ),
278
278
  limit: (
279
- color: var(--input-invalid-color),
279
+ color: var(--input-invalid-text-color),
280
280
  ),
281
281
  icon-after: (
282
- color: var(--input-invalid-color),
282
+ color: var(--input-invalid-text-color),
283
283
  ),
284
284
  ),
285
285
  ),