@volverjs/style 0.1.29 → 0.1.30

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 +64 -16
  60. package/src/_config.scss +23 -0
  61. package/src/_preflight.scss +14 -2
  62. package/src/base.scss +1 -1
  63. package/src/components/index.scss +28 -0
  64. package/src/components/vv-attachment-group.scss +17 -0
  65. package/src/components/vv-attachment.scss +17 -0
  66. package/src/components/vv-bubble-group.scss +17 -0
  67. package/src/components/vv-bubble.scss +17 -0
  68. package/src/components/vv-calendar.scss +25 -0
  69. package/src/components/vv-command.scss +17 -0
  70. package/src/components/vv-empty.scss +17 -0
  71. package/src/components/vv-field.scss +25 -0
  72. package/src/components/vv-input-otp.scss +17 -0
  73. package/src/components/vv-item-group.scss +17 -0
  74. package/src/components/vv-item.scss +39 -0
  75. package/src/components/vv-kbd-group.scss +17 -0
  76. package/src/components/vv-kbd.scss +17 -0
  77. package/src/components/vv-marker.scss +17 -0
  78. package/src/components/vv-message-scroller.scss +24 -0
  79. package/src/components/vv-message.scss +25 -0
  80. package/src/components/vv-pagination.scss +17 -0
  81. package/src/components/vv-popover.scss +17 -0
  82. package/src/components/vv-prose.scss +17 -0
  83. package/src/components/vv-questionnaire.scss +28 -0
  84. package/src/components/vv-separator.scss +17 -0
  85. package/src/components/vv-sidebar.scss +17 -0
  86. package/src/components/vv-spinner.scss +27 -0
  87. package/src/presets/_outlined-fields.scss +346 -0
  88. package/src/props/colors.scss +6 -0
  89. package/src/settings/_colors.scss +161 -61
  90. package/src/settings/_index.scss +26 -0
  91. package/src/settings/_input.scss +11 -2
  92. package/src/settings/components/_choice.scss +104 -0
  93. package/src/settings/components/_vv-alert.scss +37 -12
  94. package/src/settings/components/_vv-attachment-group.scss +10 -0
  95. package/src/settings/components/_vv-attachment.scss +135 -0
  96. package/src/settings/components/_vv-avatar.scss +19 -9
  97. package/src/settings/components/_vv-badge.scss +47 -14
  98. package/src/settings/components/_vv-breadcrumb.scss +1 -1
  99. package/src/settings/components/_vv-bubble-group.scss +31 -0
  100. package/src/settings/components/_vv-bubble.scss +69 -0
  101. package/src/settings/components/_vv-button.scss +55 -13
  102. package/src/settings/components/_vv-calendar.scss +102 -0
  103. package/src/settings/components/_vv-checkbox-group.scss +33 -2
  104. package/src/settings/components/_vv-checkbox.scss +8 -3
  105. package/src/settings/components/_vv-command.scss +99 -0
  106. package/src/settings/components/_vv-dialog.scss +129 -26
  107. package/src/settings/components/_vv-dropdown-action.scss +3 -2
  108. package/src/settings/components/_vv-dropdown-option.scss +3 -3
  109. package/src/settings/components/_vv-empty.scss +71 -0
  110. package/src/settings/components/_vv-field.scss +111 -0
  111. package/src/settings/components/_vv-input-file.scss +8 -8
  112. package/src/settings/components/_vv-input-otp.scss +55 -0
  113. package/src/settings/components/_vv-input-range.scss +3 -3
  114. package/src/settings/components/_vv-input-text.scss +7 -7
  115. package/src/settings/components/_vv-item-group.scss +68 -0
  116. package/src/settings/components/_vv-item.scss +201 -0
  117. package/src/settings/components/_vv-kbd-group.scss +9 -0
  118. package/src/settings/components/_vv-kbd.scss +20 -0
  119. package/src/settings/components/_vv-marker.scss +32 -0
  120. package/src/settings/components/_vv-message-scroller.scss +65 -0
  121. package/src/settings/components/_vv-message.scss +95 -0
  122. package/src/settings/components/_vv-nav.scss +7 -3
  123. package/src/settings/components/_vv-pagination.scss +78 -0
  124. package/src/settings/components/_vv-popover.scss +53 -0
  125. package/src/settings/components/_vv-progress.scss +4 -4
  126. package/src/settings/components/_vv-prose.scss +274 -0
  127. package/src/settings/components/_vv-questionnaire.scss +77 -0
  128. package/src/settings/components/_vv-radio.scss +7 -3
  129. package/src/settings/components/_vv-select.scss +6 -6
  130. package/src/settings/components/_vv-separator.scss +79 -0
  131. package/src/settings/components/_vv-sidebar.scss +91 -0
  132. package/src/settings/components/_vv-spinner.scss +26 -0
  133. package/src/settings/components/_vv-table.scss +63 -0
  134. package/src/settings/components/_vv-text.scss +3 -3
  135. package/src/settings/components/_vv-textarea.scss +7 -7
  136. package/src/themes/dark/components/_vv-checkbox.scss +27 -0
  137. package/src/themes/dark/components/_vv-radio.scss +27 -0
  138. package/src/themes/dark/components/index.scss +2 -0
  139. package/src/themes/dark/props/_colors.scss +6 -0
  140. package/src/themes/dark/settings/_colors.scss +97 -32
  141. package/src/themes/dark/settings/_index.scss +2 -0
  142. package/src/themes/dark/settings/_input.scss +4 -8
  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 -15
  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
@@ -0,0 +1,102 @@
1
+ // A month to pick a date or a range from: a `header` with the `title` of the
2
+ // month between two `nav` buttons, and a `grid`, a table whose `weekday`
3
+ // headers sit over the `day` buttons of the month. The keyboard moves across
4
+ // the grid with a roving tabindex: one day is `tabindex="0"`, the others
5
+ // `tabindex="-1"`, which the shared `focus-visible` state leaves out, so the
6
+ // ring of a day is a rule on the entry (`src/components/vv-calendar.scss`). What a day is comes from
7
+ // its markup: the chosen day, or each end of a range, is `aria-pressed="true"`
8
+ // on its button, today is `aria-current="date"`, a day that cannot be chosen
9
+ // is `disabled`, and the days between the two ends of a range are cells with
10
+ // `aria-selected="true"`. Days of the months around are left out, or written
11
+ // as disabled buttons. A date picker is this block in a `vv-popover` next to
12
+ // a field.
13
+ $vv-calendar: (
14
+ display: inline-flex,
15
+ flex-direction: column,
16
+ gap: var(--spacing-8),
17
+ color: var(--color-word-2),
18
+ font-size: var(--text-14),
19
+ element: (
20
+ header: (
21
+ display: flex,
22
+ align-items: center,
23
+ justify-content: space-between,
24
+ gap: var(--spacing-8),
25
+ ),
26
+ title: (
27
+ color: var(--color-word-1),
28
+ font-weight: var(--font-semibold),
29
+ ),
30
+ nav: (
31
+ display: inline-grid,
32
+ place-items: center,
33
+ inline-size: 2em,
34
+ block-size: 2em,
35
+ border-radius: var(--rounded),
36
+ color: var(--color-word-3),
37
+ cursor: pointer,
38
+ state: (
39
+ hover: (
40
+ background-color: var(--color-surface-2),
41
+ color: var(--color-word),
42
+ ),
43
+ focus-visible: (
44
+ outline: var(--spacing-px) solid var(--color-brand-graphic),
45
+ outline-offset: var(--spacing-2),
46
+ ),
47
+ ),
48
+ ),
49
+ grid: (
50
+ _alias: 'table',
51
+ border-collapse: collapse,
52
+ ),
53
+ weekday: (
54
+ _alias: 'th',
55
+ padding-block-end: var(--spacing-4),
56
+ color: var(--color-word-4),
57
+ font-size: var(--text-12),
58
+ font-weight: var(--font-normal),
59
+ text-align: center,
60
+ ),
61
+ cell: (
62
+ _alias: 'td',
63
+ padding: var(--spacing-1) 0,
64
+ text-align: center,
65
+ state: (
66
+ // The band between the two ends of a range
67
+ selected: (
68
+ background-color: var(--color-surface-2),
69
+ ),
70
+ ),
71
+ ),
72
+ day: (
73
+ display: inline-grid,
74
+ place-items: center,
75
+ inline-size: 2.25em,
76
+ block-size: 2.25em,
77
+ border-radius: var(--rounded-full),
78
+ font-variant-numeric: tabular-nums,
79
+ cursor: pointer,
80
+ state: (
81
+ // One step deeper than the band of a range, so it shows there
82
+ hover: (
83
+ background-color: var(--color-surface-3),
84
+ ),
85
+ current-date: (
86
+ font-weight: var(--font-semibold),
87
+ box-shadow: inset 0 0 0 var(--spacing-px) var(--color-word-4),
88
+ ),
89
+ // After the hover and today: the chosen day keeps its fill
90
+ pressed: (
91
+ background-color: var(--color-word),
92
+ color: var(--color-surface),
93
+ font-weight: var(--font-semibold),
94
+ ),
95
+ disabled: (
96
+ opacity: var(--opacity-30),
97
+ cursor: not-allowed,
98
+ ),
99
+ ),
100
+ ),
101
+ ),
102
+ ) !default;
@@ -46,17 +46,48 @@ $vv-checkbox-group: (
46
46
  ),
47
47
  ),
48
48
  ),
49
+ // A segmented control: one recessed track the height of a field,
50
+ // the options side by side inside it, the chosen one raised (the
51
+ // `segment` modifier of the radio or the checkbox). For a choice
52
+ // between a few short named states. `vv-radio-group` shares this map,
53
+ // so a radio group takes the same modifiers. The options carry no
54
+ // margin here, so the wrapper takes the one they would have left under
55
+ // the last row, which the negative top margin of the hint expects.
56
+ segmented: (
57
+ element: (
58
+ wrapper: (
59
+ margin-bottom: var(--input-gap),
60
+ flex-direction: row,
61
+ flex-wrap: nowrap,
62
+ gap: var(--spacing-2),
63
+ padding: var(--spacing-4),
64
+ border-radius: var(--rounded-lg),
65
+ background-color: var(--color-surface-2),
66
+ ),
67
+ ),
68
+ ),
69
+ // A row of choice cards (the `card` modifier of the radio or the
70
+ // checkbox), which wraps when a card would fall under its floor
71
+ cards: (
72
+ element: (
73
+ wrapper: (
74
+ margin-bottom: var(--input-gap),
75
+ flex-direction: row,
76
+ gap: var(--spacing-8),
77
+ ),
78
+ ),
79
+ ),
49
80
  valid: (
50
81
  element: (
51
82
  hint: (
52
- color: var(--input-valid-color),
83
+ color: var(--input-valid-text-color),
53
84
  ),
54
85
  ),
55
86
  ),
56
87
  invalid: (
57
88
  element: (
58
89
  hint: (
59
- color: var(--input-invalid-color),
90
+ color: var(--input-invalid-text-color),
60
91
  ),
61
92
  ),
62
93
  ),
@@ -1,3 +1,5 @@
1
+ @use 'choice' as *;
2
+
1
3
  $vv-checkbox: (
2
4
  display: inline-flex,
3
5
  flex-wrap: wrap,
@@ -49,7 +51,7 @@ $vv-checkbox: (
49
51
  background-image: var(--bg-minus),
50
52
  ),
51
53
  focus-visible: (
52
- outline: var(--spacing-px) solid var(--color-brand),
54
+ outline: var(--spacing-px) solid var(--color-brand-graphic),
53
55
  outline-offset: var(--spacing-2),
54
56
  ),
55
57
  ),
@@ -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-graphic),
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,9 +14,10 @@ $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
- outline: var(--spacing-px) solid var(--color-brand),
20
+ outline: var(--spacing-px) solid var(--color-brand-graphic),
20
21
  outline-offset: calc(var(--spacing-px) * -1),
21
22
  ),
22
23
  pressed: (
@@ -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;