@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
@@ -0,0 +1,135 @@
1
+ // A file or an image attached to a message or waiting in a composer: a tile
2
+ // with its `media` (the icon of the kind of file, a thumbnail), a `content`
3
+ // column with a `title` and a `description` (the kind, the size), `actions`
4
+ // such as open or download, and an optional `remove` button pinned to the
5
+ // top corner on the inline end, over the edge of the tile.
6
+ // `image` shows a picture whole, with the caption under it; `invalid` is an
7
+ // upload that failed; `loading` dims the media while a `vv-spinner` inside it
8
+ // turns. A row of them is a `vv-attachment-group`.
9
+ $vv-attachment: (
10
+ position: relative,
11
+ display: flex,
12
+ align-items: center,
13
+ gap: var(--spacing-8),
14
+ max-width: 17.5rem,
15
+ padding: var(--spacing-8),
16
+ border: var(--border) solid var(--color-surface-3),
17
+ border-radius: var(--rounded-lg),
18
+ background-color: var(--color-surface-1),
19
+ color: var(--color-word-2),
20
+ font-size: var(--text-12),
21
+ line-height: var(--leading-snug),
22
+ element: (
23
+ media: (
24
+ display: grid,
25
+ flex-shrink: 0,
26
+ place-items: center,
27
+ inline-size: var(--spacing-36),
28
+ block-size: var(--spacing-36),
29
+ overflow: hidden,
30
+ border-radius: var(--rounded-md),
31
+ background-color: var(--color-surface-2),
32
+ color: var(--color-word-3),
33
+ font-size: var(--text-16),
34
+ ),
35
+ // A thumbnail fills the media
36
+ picture: (
37
+ _alias: 'img',
38
+ inline-size: 100%,
39
+ block-size: 100%,
40
+ object-fit: cover,
41
+ ),
42
+ content: (
43
+ display: flex,
44
+ flex: 1,
45
+ flex-direction: column,
46
+ min-width: 0,
47
+ ),
48
+ title: (
49
+ overflow: hidden,
50
+ color: var(--color-word-1),
51
+ font-weight: var(--font-medium),
52
+ text-overflow: ellipsis,
53
+ white-space: nowrap,
54
+ ),
55
+ description: (
56
+ overflow: hidden,
57
+ color: var(--color-word-4),
58
+ font-variant-numeric: tabular-nums,
59
+ text-overflow: ellipsis,
60
+ white-space: nowrap,
61
+ ),
62
+ actions: (
63
+ display: flex,
64
+ flex-shrink: 0,
65
+ align-items: center,
66
+ gap: var(--spacing-2),
67
+ ),
68
+ // Half outside the tile on both axes, mirrored in a right to left
69
+ // page through `--direction`, read by a plain declaration
70
+ remove: (
71
+ position: absolute,
72
+ inset-block-start: 0,
73
+ inset-inline-end: 0,
74
+ display: grid,
75
+ place-items: center,
76
+ inline-size: var(--spacing-24),
77
+ block-size: var(--spacing-24),
78
+ border: var(--border) solid var(--color-surface-4),
79
+ border-radius: var(--rounded-full),
80
+ background-color: var(--color-surface),
81
+ box-shadow: var(--shadow-sm),
82
+ color: var(--color-word-2),
83
+ font-size: var(--text-12),
84
+ cursor: pointer,
85
+ [translate]: calc(50% * var(--direction, 1)) -50%,
86
+ state: (
87
+ hover: (
88
+ background-color: var(--color-surface-2),
89
+ ),
90
+ focus-visible: (
91
+ outline: var(--spacing-px) solid var(--color-brand),
92
+ outline-offset: var(--spacing-2),
93
+ ),
94
+ ),
95
+ ),
96
+ ),
97
+ modifier: (
98
+ image: (
99
+ flex-direction: column,
100
+ align-items: stretch,
101
+ gap: 0,
102
+ padding: 0,
103
+ element: (
104
+ media: (
105
+ inline-size: 100%,
106
+ block-size: auto,
107
+ // A number, not `7 / 5`, which Sass would read as a division
108
+ aspect-ratio: calc(7 / 5),
109
+ border-radius: var(--rounded-lg) var(--rounded-lg) 0 0,
110
+ ),
111
+ content: (
112
+ padding: var(--spacing-8),
113
+ ),
114
+ ),
115
+ ),
116
+ invalid: (
117
+ border-color: var(--color-danger),
118
+ element: (
119
+ description: (
120
+ color: var(--color-danger-readable),
121
+ ),
122
+ ),
123
+ ),
124
+ loading: (
125
+ element: (
126
+ media: (
127
+ color: var(--color-word-2),
128
+ ),
129
+ picture: (
130
+ opacity: var(--opacity-50),
131
+ ),
132
+ ),
133
+ ),
134
+ ),
135
+ ) !default;
@@ -1,7 +1,7 @@
1
1
  $vv-avatar: (
2
2
  background-color: var(--color-brand),
3
3
  border-radius: var(--rounded),
4
- color: var(--color-white),
4
+ color: var(--color-brand-contrast),
5
5
  display: inline-flex,
6
6
  position: relative,
7
7
  justify-content: center,
@@ -82,8 +82,10 @@ $vv-avatar: (
82
82
  width: var(--spacing-40),
83
83
  height: var(--spacing-40),
84
84
  ),
85
+ // Keeps the white it had before the block followed the brand
85
86
  transparent: (
86
87
  background-color: var(--color-transparent),
88
+ color: var(--color-white),
87
89
  ),
88
90
  surface: (
89
91
  background-color: var(--color-surface-2),
@@ -93,29 +95,37 @@ $vv-avatar: (
93
95
  danger: (
94
96
  background-color: var(--color-danger),
95
97
  border-color: var(--color-danger-lighten-3),
98
+ color: var(--color-danger-contrast),
96
99
  ),
97
100
  success: (
98
101
  background-color: var(--color-success),
99
102
  border-color: var(--color-success-lighten-3),
103
+ color: var(--color-success-contrast),
100
104
  ),
105
+ // Filled with the darkest shade, so the text is the contrast of that
106
+ // shade and not of the base color
101
107
  warning: (
102
108
  background-color: var(--color-warning-darken-5),
103
109
  border-color: var(--color-warning-darken-2),
110
+ color: var(--color-warning-darken-5-contrast),
104
111
  ),
105
112
  info: (
106
113
  background-color: var(--color-info-darken-5),
107
114
  border-color: var(--color-info-darken-2),
115
+ color: var(--color-info-darken-5-contrast),
108
116
  ),
109
117
  accent: (
110
118
  background-color: var(--color-accent),
111
119
  border-color: var(--color-accent-darken-3),
120
+ color: var(--color-accent-contrast),
112
121
  ),
113
122
  gray: (
114
123
  background-color: var(--color-gray-darken-1),
115
124
  border-color: var(--color-gray-lighten-2),
125
+ color: var(--color-white),
116
126
  ),
117
127
  ring: (
118
- color: var(--color-brand-darken-3),
128
+ color: var(--color-surface-brand-readable),
119
129
  background-color: var(--color-surface-brand),
120
130
  border-color: currentcolor,
121
131
  border-width: var(--border),
@@ -127,23 +137,23 @@ $vv-avatar: (
127
137
  ),
128
138
  danger: (
129
139
  background-color: var(--color-surface-danger),
130
- color: var(--color-danger),
140
+ color: var(--color-surface-danger-readable),
131
141
  ),
132
142
  success: (
133
143
  background-color: var(--color-surface-success),
134
- color: var(--color-success-darken-3),
144
+ color: var(--color-surface-success-readable),
135
145
  ),
136
146
  warning: (
137
147
  background-color: var(--color-surface-warning),
138
- color: var(--color-warning-darken-5),
148
+ color: var(--color-surface-warning-readable),
139
149
  ),
140
150
  info: (
141
151
  background-color: var(--color-surface-info),
142
- color: var(--color-info-darken-5),
152
+ color: var(--color-surface-info-readable),
143
153
  ),
144
154
  accent: (
145
155
  background-color: var(--color-surface-accent),
146
- color: var(--color-accent),
156
+ color: var(--color-surface-accent-readable),
147
157
  ),
148
158
  gray: (
149
159
  background-color: var(--color-surface-4),
@@ -4,7 +4,7 @@ $vv-badge: (
4
4
  border-width: 0,
5
5
  background-color: var(--color-brand),
6
6
  border-color: var(--color-brand),
7
- color: var(--color-white),
7
+ color: var(--color-brand-contrast),
8
8
  border-style: solid,
9
9
  border-radius: 0.5em,
10
10
  min-height: 2em,
@@ -96,42 +96,50 @@ $vv-badge: (
96
96
  ),
97
97
  danger: (
98
98
  background-color: var(--color-danger),
99
+ color: var(--color-danger-contrast),
99
100
  ),
100
101
  success: (
101
102
  background-color: var(--color-success),
103
+ color: var(--color-success-contrast),
102
104
  ),
105
+ // Filled with the darkest shade, so the text is the contrast of that
106
+ // shade and not of the base color
103
107
  warning: (
104
108
  background-color: var(--color-warning-darken-5),
109
+ color: var(--color-warning-darken-5-contrast),
105
110
  ),
106
111
  info: (
107
112
  background-color: var(--color-info-darken-5),
113
+ color: var(--color-info-darken-5-contrast),
108
114
  ),
109
115
  accent: (
110
116
  background-color: var(--color-accent),
117
+ color: var(--color-accent-contrast),
111
118
  ),
112
119
  gray: (
113
120
  background-color: var(--color-gray-darken-1),
121
+ color: var(--color-white),
114
122
  ),
115
123
  outline: (
116
124
  border-width: var(--border),
117
- color: var(--color-brand),
125
+ color: var(--color-brand-readable),
118
126
  border-color: currentcolor,
119
127
  background-color: transparent,
120
128
  modifier: (
121
129
  danger: (
122
- color: var(--color-danger),
130
+ color: var(--color-danger-readable),
123
131
  ),
124
132
  success: (
125
- color: var(--color-success),
133
+ color: var(--color-success-readable),
126
134
  ),
127
135
  warning: (
128
- color: var(--color-warning-darken-5),
136
+ color: var(--color-warning-readable),
129
137
  ),
130
138
  info: (
131
- color: var(--color-info-darken-5),
139
+ color: var(--color-info-readable),
132
140
  ),
133
141
  accent: (
134
- color: var(--color-accent),
142
+ color: var(--color-accent-readable),
135
143
  ),
136
144
  gray: (
137
145
  color: var(--color-gray-darken-1),
@@ -140,22 +148,22 @@ $vv-badge: (
140
148
  ),
141
149
  ghost: (
142
150
  background-color: transparent,
143
- color: var(--color-brand),
151
+ color: var(--color-brand-readable),
144
152
  modifier: (
145
153
  danger: (
146
- color: var(--color-danger),
154
+ color: var(--color-danger-readable),
147
155
  ),
148
156
  success: (
149
- color: var(--color-success),
157
+ color: var(--color-success-readable),
150
158
  ),
151
159
  warning: (
152
- color: var(--color-warning-darken-5),
160
+ color: var(--color-warning-readable),
153
161
  ),
154
162
  info: (
155
- color: var(--color-info-darken-5),
163
+ color: var(--color-info-readable),
156
164
  ),
157
165
  accent: (
158
- color: var(--color-accent),
166
+ color: var(--color-accent-readable),
159
167
  ),
160
168
  gray: (
161
169
  color: var(--color-gray-darken-1),
@@ -72,7 +72,7 @@ $vv-breadcrumb: (
72
72
  text-decoration: underline,
73
73
  ),
74
74
  active: (
75
- color: var(--color-brand-darken-2),
75
+ color: var(--color-brand-readable-strong),
76
76
  ),
77
77
  ),
78
78
  ),
@@ -0,0 +1,31 @@
1
+ // Consecutive bubbles of one speaker, stacked close and joined on the side of
2
+ // the speaker: every bubble after the first tightens its top corner there, so
3
+ // the first keeps a round top and the side of the speaker runs as one
4
+ // straight edge down to the tail of the last. `end` groups the bubbles of the
5
+ // one reading, whose bubbles take `vv-bubble--end` too. Load `vv-bubble`
6
+ // before this block when importing the two on their own: the joined corners
7
+ // have to come after the bubble's own radius.
8
+ $vv-bubble-group: (
9
+ display: flex,
10
+ flex-direction: column,
11
+ align-items: flex-start,
12
+ gap: var(--spacing-2),
13
+ max-width: 100%,
14
+ element: (
15
+ joined: (
16
+ _alias: '> :not(:first-child)',
17
+ border-start-start-radius: var(--rounded-sm),
18
+ ),
19
+ ),
20
+ modifier: (
21
+ end: (
22
+ align-items: flex-end,
23
+ element: (
24
+ joined: (
25
+ border-start-start-radius: var(--rounded-xl),
26
+ border-start-end-radius: var(--rounded-sm),
27
+ ),
28
+ ),
29
+ ),
30
+ ),
31
+ ) !default;
@@ -0,0 +1,69 @@
1
+ // The surface of a message. Its colours are tokens read with a fallback and
2
+ // never declared on the block, so a value set on the conversation reaches
3
+ // every bubble under it: `--bubble-background`, `--bubble-color` and
4
+ // `--bubble-border-color` for the other side, `--bubble-end-background`,
5
+ // `--bubble-end-color` and `--bubble-end-border-color` for the one reading.
6
+ // A product paints the bubbles of one side in its own colour with one
7
+ // declaration on the conversation. They are read by plain declarations, in
8
+ // brackets: a `var()` inside a generated custom property is resolved at the
9
+ // root, where a value set on a bubble or on its conversation does not reach.
10
+ // The corner on the side of the speaker is tighter, a tail at the last line.
11
+ // `reactions` hang over the bottom edge: `reacted` leaves room under the
12
+ // bubble for them.
13
+ $vv-bubble: (
14
+ position: relative,
15
+ max-width: 100%,
16
+ padding: var(--spacing-8) var(--spacing-12),
17
+ border-radius: var(--rounded-xl),
18
+ border-end-start-radius: var(--rounded-sm),
19
+ line-height: var(--leading-normal),
20
+ overflow-wrap: anywhere,
21
+ [border]: var(--border) solid var(--bubble-border-color, var(--color-surface-3)),
22
+ [background-color]: var(--bubble-background, var(--color-surface)),
23
+ [color]: var(--bubble-color, var(--color-word-2)),
24
+ element: (
25
+ reactions: (
26
+ position: absolute,
27
+ inset-block-end: 0,
28
+ inset-inline-end: var(--spacing-8),
29
+ translate: 0 50%,
30
+ display: inline-flex,
31
+ align-items: center,
32
+ gap: var(--spacing-2),
33
+ padding: var(--spacing-2) var(--spacing-6),
34
+ border: var(--border) solid var(--color-surface-3),
35
+ border-radius: var(--rounded-full),
36
+ background-color: var(--color-surface),
37
+ box-shadow: var(--shadow-sm),
38
+ color: var(--color-word-2),
39
+ font-size: var(--text-12),
40
+ line-height: var(--leading-none),
41
+ ),
42
+ ),
43
+ modifier: (
44
+ // The bubbles of the one reading: a filled surface, the tail on the
45
+ // inline end
46
+ end: (
47
+ [border-color]: var(--bubble-end-border-color, var(--color-surface-2)),
48
+ [background-color]: var(--bubble-end-background, var(--color-surface-2)),
49
+ [color]: var(--bubble-end-color, var(--color-word-1)),
50
+ border-end-start-radius: var(--rounded-xl),
51
+ border-end-end-radius: var(--rounded-sm),
52
+ element: (
53
+ reactions: (
54
+ inset-inline-end: auto,
55
+ inset-inline-start: var(--spacing-8),
56
+ ),
57
+ ),
58
+ ),
59
+ // No surface: an answer set as rich text across the row
60
+ plain: (
61
+ [border-color]: transparent,
62
+ [background-color]: transparent,
63
+ padding: 0,
64
+ ),
65
+ reacted: (
66
+ margin-block-end: var(--spacing-12),
67
+ ),
68
+ ),
69
+ ) !default;
@@ -8,13 +8,21 @@ $vv-button: (
8
8
  border-radius: var(--rounded),
9
9
  border-style: solid,
10
10
  border-color: var(--color-brand),
11
- color: var(--color-white),
11
+ color: var(--color-brand-contrast),
12
12
  font-family: var(--font-sans),
13
13
  font-weight: var(--font-semibold),
14
14
  gap: 1ch,
15
15
  padding-block: var(--spacing-7),
16
16
  padding-inline: var(--spacing-16),
17
- text-shadow: 0 1px 0 var(--color-gray-darken-5),
17
+ // The dark emboss suits light text only. The shadow above it is the cover
18
+ // of the fill, the fill itself where --color-brand-contrast turns dark and
19
+ // transparent otherwise, so it hides the emboss beneath dark text. Each
20
+ // state takes the contrast text and the cover of the shade it paints, so a
21
+ // color near the threshold turns its text white on the darker shades.
22
+ text-shadow: (
23
+ 0 1px 0 var(--color-brand-cover),
24
+ 0 1px 0 var(--color-gray-darken-5),
25
+ ),
18
26
  transition: var(--transition-all),
19
27
  will-change: all,
20
28
  min-width: 0,
@@ -27,15 +35,30 @@ $vv-button: (
27
35
  hover: (
28
36
  background: var(--color-brand-darken-1),
29
37
  border-color: var(--color-brand-darken-1),
38
+ color: var(--color-brand-darken-1-contrast),
30
39
  text-decoration: none,
40
+ text-shadow: (
41
+ 0 1px 0 var(--color-brand-darken-1-cover),
42
+ 0 1px 0 var(--color-gray-darken-5),
43
+ ),
31
44
  ),
32
45
  active: (
33
46
  background: var(--color-brand-darken-2),
34
47
  border-color: var(--color-brand-darken-2),
48
+ color: var(--color-brand-darken-2-contrast),
49
+ text-shadow: (
50
+ 0 1px 0 var(--color-brand-darken-2-cover),
51
+ 0 1px 0 var(--color-gray-darken-5),
52
+ ),
35
53
  ),
36
54
  pressed: (
37
55
  background: var(--color-brand-darken-2),
38
56
  border-color: var(--color-brand-darken-2),
57
+ color: var(--color-brand-darken-2-contrast),
58
+ text-shadow: (
59
+ 0 1px 0 var(--color-brand-darken-2-cover),
60
+ 0 1px 0 var(--color-gray-darken-5),
61
+ ),
39
62
  ),
40
63
  disabled: (
41
64
  opacity: var(--opacity-50),
@@ -77,6 +100,7 @@ $vv-button: (
77
100
  background: var(--color-gray-darken-3),
78
101
  border-color: var(--color-gray-darken-3),
79
102
  color: var(--color-white),
103
+ text-shadow: 0 1px 0 var(--color-gray-darken-5),
80
104
  state: (
81
105
  focus-visible: (
82
106
  outline: var(--spacing-px) solid var(--color-gray-darken-3),
@@ -119,7 +143,11 @@ $vv-button: (
119
143
  danger: (
120
144
  background: var(--color-danger),
121
145
  border-color: var(--color-danger),
122
- color: var(--color-white),
146
+ color: var(--color-danger-contrast),
147
+ text-shadow: (
148
+ 0 1px 0 var(--color-danger-cover),
149
+ 0 1px 0 var(--color-gray-darken-5),
150
+ ),
123
151
  state: (
124
152
  focus-visible: (
125
153
  outline: var(--spacing-px) solid var(--color-danger),
@@ -127,14 +155,29 @@ $vv-button: (
127
155
  hover: (
128
156
  background: var(--color-danger-darken-1),
129
157
  border-color: var(--color-danger-darken-1),
158
+ color: var(--color-danger-darken-1-contrast),
159
+ text-shadow: (
160
+ 0 1px 0 var(--color-danger-darken-1-cover),
161
+ 0 1px 0 var(--color-gray-darken-5),
162
+ ),
130
163
  ),
131
164
  active: (
132
165
  background: var(--color-danger-darken-2),
133
166
  border-color: var(--color-danger-darken-2),
167
+ color: var(--color-danger-darken-2-contrast),
168
+ text-shadow: (
169
+ 0 1px 0 var(--color-danger-darken-2-cover),
170
+ 0 1px 0 var(--color-gray-darken-5),
171
+ ),
134
172
  ),
135
173
  pressed: (
136
174
  background: var(--color-danger-darken-2),
137
175
  border-color: var(--color-danger-darken-2),
176
+ color: var(--color-danger-darken-2-contrast),
177
+ text-shadow: (
178
+ 0 1px 0 var(--color-danger-darken-2-cover),
179
+ 0 1px 0 var(--color-gray-darken-5),
180
+ ),
138
181
  ),
139
182
  ),
140
183
  ),
@@ -166,7 +209,7 @@ $vv-button: (
166
209
  background: transparent,
167
210
  border-width: var(--border-0),
168
211
  padding: 0,
169
- color: var(--color-brand-darken-1),
212
+ color: var(--color-brand-readable),
170
213
  font-weight: inherit,
171
214
  text-shadow: none,
172
215
  state: (
@@ -180,7 +223,7 @@ $vv-button: (
180
223
  text-underline-offset: var(--spacing-4),
181
224
  ),
182
225
  active: (
183
- color: var(--color-brand-darken-3),
226
+ color: var(--color-brand-readable-strong),
184
227
  ),
185
228
  ),
186
229
  element: (
@@ -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),
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
  ),