composite-select 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/commitlint.config.js +3 -0
- package/composition/composite-select/CompositeManager.js +43 -0
- package/composition/composite-select/composite-select.js +199 -0
- package/composition/composite-select/debounce.js +10 -0
- package/composition/composite-select/helpers.js +96 -0
- package/composition/composite-select/react.js +189 -0
- package/composition/container/ContainerManager.js +76 -0
- package/composition/img/ai.png +0 -0
- package/composition/img/chatgpt.png +0 -0
- package/composition/img/claude.png +0 -0
- package/composition/img/gemini.png +0 -0
- package/composition/img/gmail.png +0 -0
- package/composition/img/google_calendar.png +0 -0
- package/composition/img/google_drive.png +0 -0
- package/composition/img/google_keep.png +0 -0
- package/composition/img/img.json +5 -0
- package/composition/img/perplexity.png +0 -0
- package/composition/img/t3chat.png +0 -0
- package/composition/img/timeanddate.png +0 -0
- package/composition/img/tools.png +0 -0
- package/composition/img/youtube.png +0 -0
- package/composition/options-section/OptionsSectionManager.css +263 -0
- package/composition/options-section/OptionsSectionManager.js +486 -0
- package/composition/options-section/options-section.js +245 -0
- package/composition/options-section/react.js +90 -0
- package/composition/selected-section/SelectedSectionManager.css +214 -0
- package/composition/selected-section/SelectedSectionManager.js +336 -0
- package/composition/selected-section/react.js +91 -0
- package/composition/selected-section/selected-section.js +207 -0
- package/composition/unbind/clickOutside.js +17 -0
- package/diff/coreBundle.patch +13 -0
- package/diff/recorderApp.patch +13 -0
- package/dist/cjs/Module.cjs +15 -0
- package/dist/cjs/composite-select/CompositeManager.js +43 -0
- package/dist/cjs/composite-select/composite-select.js +199 -0
- package/dist/cjs/composite-select/debounce.js +10 -0
- package/dist/cjs/composite-select/helpers.js +96 -0
- package/dist/cjs/composite-select/react.js +189 -0
- package/dist/cjs/container/ContainerManager.js +76 -0
- package/dist/cjs/createSubscriber.cjs +48 -0
- package/dist/cjs/options-section/OptionsSectionManager.js +486 -0
- package/dist/cjs/options-section/options-section.js +245 -0
- package/dist/cjs/options-section/react.js +90 -0
- package/dist/cjs/selected-section/SelectedSectionManager.js +336 -0
- package/dist/cjs/selected-section/react.js +91 -0
- package/dist/cjs/selected-section/selected-section.js +207 -0
- package/dist/cjs/types.cjs +1 -0
- package/dist/cjs/unbind/clickOutside.js +17 -0
- package/dist/esm/Module.js +15 -0
- package/dist/esm/composite-select/CompositeManager.js +43 -0
- package/dist/esm/composite-select/composite-select.js +199 -0
- package/dist/esm/composite-select/debounce.js +10 -0
- package/dist/esm/composite-select/helpers.js +96 -0
- package/dist/esm/composite-select/react.js +189 -0
- package/dist/esm/container/ContainerManager.js +76 -0
- package/dist/esm/createSubscriber.js +48 -0
- package/dist/esm/options-section/OptionsSectionManager.js +486 -0
- package/dist/esm/options-section/options-section.js +245 -0
- package/dist/esm/options-section/react.js +90 -0
- package/dist/esm/selected-section/SelectedSectionManager.js +336 -0
- package/dist/esm/selected-section/react.js +91 -0
- package/dist/esm/selected-section/selected-section.js +207 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/unbind/clickOutside.js +17 -0
- package/dist/types/Module.d.ts +15 -0
- package/dist/types/composite-select/CompositeManager.d.ts +21 -0
- package/dist/types/composite-select/ContainerManager.html.d.ts +1 -0
- package/dist/types/composite-select/composite-select.d.ts +26 -0
- package/dist/types/composite-select/composite-select.html.d.ts +1 -0
- package/dist/types/composite-select/debounce.d.ts +1 -0
- package/dist/types/composite-select/helpers.d.ts +38 -0
- package/dist/types/composite-select/namesSource.d.ts +4 -0
- package/dist/types/composite-select/react.d.ts +61 -0
- package/dist/types/composite-select/urlManager.d.ts +49 -0
- package/dist/types/composite-select/urlManagerWc.d.ts +44 -0
- package/dist/types/container/ContainerManager.d.ts +33 -0
- package/dist/types/createSubscriber.d.ts +26 -0
- package/dist/types/options-section/OptionsSectionManager.d.ts +117 -0
- package/dist/types/options-section/OptionsSectionManager.html.d.ts +1 -0
- package/dist/types/options-section/OptionsSectionManagerWebComponent.attributes.html.d.ts +1 -0
- package/dist/types/options-section/OptionsSectionManagerWebComponent.html.d.ts +1 -0
- package/dist/types/options-section/OptionsSectionManagerWebComponent.nocssrequest.html.d.ts +1 -0
- package/dist/types/options-section/options-section.d.ts +67 -0
- package/dist/types/options-section/react.d.ts +27 -0
- package/dist/types/options-section/urlManager.d.ts +28 -0
- package/dist/types/selected-section/SelectedSectionManager.d.ts +89 -0
- package/dist/types/selected-section/SelectedSectionManager.html.d.ts +1 -0
- package/dist/types/selected-section/SelectedSectionManager.templates.html.d.ts +1 -0
- package/dist/types/selected-section/SelectedSectionManagerWebComponent.attributes.html.d.ts +1 -0
- package/dist/types/selected-section/SelectedSectionManagerWebComponent.html.d.ts +1 -0
- package/dist/types/selected-section/SelectedSectionManagerWebComponent.nocssrequest.html.d.ts +1 -0
- package/dist/types/selected-section/react.d.ts +32 -0
- package/dist/types/selected-section/selected-section.d.ts +54 -0
- package/dist/types/selected-section/urlManager.d.ts +25 -0
- package/dist/types/types.d.ts +9 -0
- package/dist/types/unbind/clickOutside.d.ts +1 -0
- package/floating-label-pattern.css +502 -0
- package/js/CenterAndHeightResizer.js +263 -0
- package/js/CenterResizer.js +190 -0
- package/madooei.tar.gz +0 -0
- package/package.json +28 -0
- package/release.config.js +3 -0
- package/test/lib.d.ts +6 -0
- package/test/lib.js +30 -0
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--gcp-css-primary: #1a73e8;
|
|
3
|
+
--gcp-css-error: #d93025;
|
|
4
|
+
--gcp-css-border: #99999b;
|
|
5
|
+
--gcp-css-text: #3c4043;
|
|
6
|
+
--gcp-css-gray-text: #5f6368;
|
|
7
|
+
--gcp-css-bg: #ffffff;
|
|
8
|
+
--gcp-css-font-size: 16px;
|
|
9
|
+
--gcp-css-small-font-size: 12px;
|
|
10
|
+
--gcp-css-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
g(Google Sans font)
|
|
15
|
+
<weight>: Use a value from 400 to 700
|
|
16
|
+
<uniquifier>: Use a unique and descriptive class name
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/*
|
|
20
|
+
@import url("https://fonts.googleapis.com/css2?family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&display=swap");
|
|
21
|
+
:root {
|
|
22
|
+
font-family: "Google Sans", sans-serif;
|
|
23
|
+
font-optical-sizing: auto;
|
|
24
|
+
font-style: normal;
|
|
25
|
+
font-variation-settings: "GRAD" 0;
|
|
26
|
+
}
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
.gcp-css :is(a),
|
|
30
|
+
.gcp-css:is(a) {
|
|
31
|
+
color: rgb(12, 103, 223);
|
|
32
|
+
border-bottom: 1px solid currentColor;
|
|
33
|
+
text-decoration: none;
|
|
34
|
+
&[target="_blank"] {
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
gap: 4px;
|
|
38
|
+
&::after {
|
|
39
|
+
content: "";
|
|
40
|
+
display: inline-block;
|
|
41
|
+
width: 14px;
|
|
42
|
+
height: 14px;
|
|
43
|
+
background-color: currentColor;
|
|
44
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z'/%3E%3C/svg%3E")
|
|
45
|
+
no-repeat center;
|
|
46
|
+
mask-size: contain;
|
|
47
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z'/%3E%3C/svg%3E")
|
|
48
|
+
no-repeat center;
|
|
49
|
+
-webkit-mask-size: contain;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
.gcp-css :is(h2),
|
|
54
|
+
.gcp-css:is(h2) {
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
margin-bottom: 5px;
|
|
57
|
+
font-weight: 500;
|
|
58
|
+
color: #202124d4;
|
|
59
|
+
}
|
|
60
|
+
.gcp-css :is(p),
|
|
61
|
+
.gcp-css:is(p) {
|
|
62
|
+
font-size: 14px;
|
|
63
|
+
margin-bottom: 10px;
|
|
64
|
+
font-weight: 400;
|
|
65
|
+
margin-top: 0;
|
|
66
|
+
line-height: 18px;
|
|
67
|
+
color: rgb(32 33 36 / 77%);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* -------------------------------------------------------------
|
|
71
|
+
BUTTONS
|
|
72
|
+
------------------------------------------------------------- */
|
|
73
|
+
.gcp-css :is(input[type="submit"], input[type="button"], button),
|
|
74
|
+
.gcp-css:is(input[type="submit"], input[type="button"], button) {
|
|
75
|
+
font-family: inherit;
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
font-weight: normal;
|
|
78
|
+
/* height: 36px; */
|
|
79
|
+
padding: 0 12px;
|
|
80
|
+
border-radius: 4px;
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
transition:
|
|
83
|
+
background-color var(--gcp-css-transition),
|
|
84
|
+
box-shadow var(--gcp-css-transition);
|
|
85
|
+
display: inline-flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
border: 1px solid transparent;
|
|
89
|
+
outline: none;
|
|
90
|
+
box-sizing: border-box;
|
|
91
|
+
background-color: var(--gcp-css-primary);
|
|
92
|
+
color: #fff;
|
|
93
|
+
line-height: 30px;
|
|
94
|
+
|
|
95
|
+
&:hover {
|
|
96
|
+
background-color: #1765cc;
|
|
97
|
+
box-shadow:
|
|
98
|
+
0 1px 2px 0 rgba(66, 133, 244, 0.3),
|
|
99
|
+
0 1px 3px 1px rgba(66, 133, 244, 0.15);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&:active {
|
|
103
|
+
box-shadow:
|
|
104
|
+
0 1px 2px 0 rgba(60, 64, 67, 0.3),
|
|
105
|
+
0 2px 6px 2px rgba(60, 64, 67, 0.15);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&:focus-visible {
|
|
109
|
+
outline: 2px solid var(--gcp-css-primary);
|
|
110
|
+
outline-offset: 2px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&:disabled {
|
|
114
|
+
opacity: 0.6;
|
|
115
|
+
cursor: not-allowed;
|
|
116
|
+
pointer-events: none;
|
|
117
|
+
box-shadow: none;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&.white {
|
|
121
|
+
background-color: transparent;
|
|
122
|
+
color: var(--gcp-css-primary);
|
|
123
|
+
border-color: transparent;
|
|
124
|
+
|
|
125
|
+
box-shadow: none;
|
|
126
|
+
|
|
127
|
+
&:hover {
|
|
128
|
+
background-color: rgba(26, 115, 232, 0.04);
|
|
129
|
+
border-color: transparent;
|
|
130
|
+
box-shadow: none;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&:active {
|
|
134
|
+
background-color: rgba(26, 115, 232, 0.12);
|
|
135
|
+
box-shadow: none;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&:focus-visible {
|
|
139
|
+
outline-offset: 0;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* -------------------------------------------------------------
|
|
145
|
+
GENERIC LAYOUT & HELPERS
|
|
146
|
+
------------------------------------------------------------- */
|
|
147
|
+
.helper-text {
|
|
148
|
+
color: var(--gcp-css-gray-text);
|
|
149
|
+
font-size: var(--gcp-css-small-font-size);
|
|
150
|
+
padding-top: 6px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.input-wrapper > .error {
|
|
154
|
+
grid-row: 2;
|
|
155
|
+
display: none;
|
|
156
|
+
align-items: center;
|
|
157
|
+
padding-top: 6px;
|
|
158
|
+
color: var(--gcp-css-error);
|
|
159
|
+
font-size: var(--gcp-css-small-font-size);
|
|
160
|
+
opacity: 0;
|
|
161
|
+
transition: opacity var(--gcp-css-transition);
|
|
162
|
+
line-height: var(--gcp-css-font-size);
|
|
163
|
+
z-index: 1;
|
|
164
|
+
|
|
165
|
+
&::before {
|
|
166
|
+
content: "";
|
|
167
|
+
display: inline-block;
|
|
168
|
+
width: 18px;
|
|
169
|
+
height: 18px;
|
|
170
|
+
background-color: currentColor;
|
|
171
|
+
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M9 2a7 7 0 100 14A7 7 0 009 2m-1 8V5h2v5zm0 3v-2h2v2z'/%3E%3C/svg%3E");
|
|
172
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M9 2a7 7 0 100 14A7 7 0 009 2m-1 8V5h2v5zm0 3v-2h2v2z'/%3E%3C/svg%3E");
|
|
173
|
+
-webkit-mask-repeat: no-repeat;
|
|
174
|
+
mask-repeat: no-repeat;
|
|
175
|
+
-webkit-mask-size: contain;
|
|
176
|
+
mask-size: contain;
|
|
177
|
+
flex-shrink: 0;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.gcp-css [data-error],
|
|
182
|
+
.gcp-css[data-error] {
|
|
183
|
+
/* .helper-text {
|
|
184
|
+
display: none;
|
|
185
|
+
} */
|
|
186
|
+
|
|
187
|
+
.error {
|
|
188
|
+
display: flex;
|
|
189
|
+
opacity: 1;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.gcp-css .hide-helper,
|
|
194
|
+
.gcp-css.hide-helper {
|
|
195
|
+
.helper-text {
|
|
196
|
+
display: none;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* -------------------------------------------------------------
|
|
201
|
+
STANDARD FLOATING LABELS (Inputs, Textareas)
|
|
202
|
+
------------------------------------------------------------- */
|
|
203
|
+
.gcp-css .input-wrapper,
|
|
204
|
+
.gcp-css.input-wrapper {
|
|
205
|
+
position: relative;
|
|
206
|
+
display: grid;
|
|
207
|
+
margin-bottom: 19px;
|
|
208
|
+
&::after {
|
|
209
|
+
content: "";
|
|
210
|
+
grid-area: 1 / 1;
|
|
211
|
+
border-radius: 4px;
|
|
212
|
+
box-shadow: 0 0 0 1px var(--gcp-css-border);
|
|
213
|
+
transition: box-shadow var(--gcp-css-transition);
|
|
214
|
+
pointer-events: none;
|
|
215
|
+
box-sizing: border-box;
|
|
216
|
+
z-index: 0;
|
|
217
|
+
background-color: white;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
&:focus-within::after {
|
|
221
|
+
box-shadow: 0 0 0 2px var(--gcp-css-primary);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
&:focus-within label {
|
|
225
|
+
color: var(--gcp-css-primary);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
&[data-error]::after {
|
|
229
|
+
box-shadow: 0 0 0 1px var(--gcp-css-error);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
&[data-error] label {
|
|
233
|
+
color: var(--gcp-css-error);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
&[data-error]:focus-within::after {
|
|
237
|
+
box-shadow: 0 0 0 2px var(--gcp-css-error);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
&[data-error]:focus-within label {
|
|
241
|
+
color: var(--gcp-css-error);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
&:has(:disabled) {
|
|
245
|
+
opacity: 0.6;
|
|
246
|
+
cursor: not-allowed;
|
|
247
|
+
& * {
|
|
248
|
+
cursor: not-allowed;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
label {
|
|
253
|
+
grid-area: 1 / 1;
|
|
254
|
+
align-self: start;
|
|
255
|
+
justify-self: start;
|
|
256
|
+
margin-left: 7px;
|
|
257
|
+
margin-top: 9px; /* Perfectly centers in 32px field */
|
|
258
|
+
font-size: var(--gcp-css-font-size);
|
|
259
|
+
line-height: 1;
|
|
260
|
+
color: var(--gcp-css-gray-text);
|
|
261
|
+
pointer-events: none;
|
|
262
|
+
transition:
|
|
263
|
+
transform var(--gcp-css-transition),
|
|
264
|
+
font-size var(--gcp-css-transition),
|
|
265
|
+
color var(--gcp-css-transition),
|
|
266
|
+
margin-top var(--gcp-css-transition);
|
|
267
|
+
background: var(--gcp-css-bg);
|
|
268
|
+
padding: 0 4px;
|
|
269
|
+
z-index: 3;
|
|
270
|
+
transform: translateY(0);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
input,
|
|
274
|
+
textarea,
|
|
275
|
+
select {
|
|
276
|
+
grid-area: 1 / 1;
|
|
277
|
+
width: 100%;
|
|
278
|
+
border: none;
|
|
279
|
+
background: transparent;
|
|
280
|
+
padding: 8px 12px;
|
|
281
|
+
font-size: var(--gcp-css-font-size);
|
|
282
|
+
font-family: inherit;
|
|
283
|
+
outline: none;
|
|
284
|
+
box-sizing: border-box;
|
|
285
|
+
z-index: 2;
|
|
286
|
+
position: relative;
|
|
287
|
+
appearance: none; /* For select arrow */
|
|
288
|
+
|
|
289
|
+
&::placeholder {
|
|
290
|
+
color: transparent;
|
|
291
|
+
transition: color var(--gcp-css-transition);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
&:focus::placeholder {
|
|
295
|
+
color: var(--gcp-css-gray-text);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/* Float if input has text or is focused */
|
|
299
|
+
&:is(input, textarea):is(:not(:placeholder-shown), :focus) + label,
|
|
300
|
+
/* Float if select has a real value chosen (not the placeholder) */
|
|
301
|
+
&:is(select):has(option:not([value=""]):checked) + label {
|
|
302
|
+
margin-top: 0;
|
|
303
|
+
transform: translateY(-50%);
|
|
304
|
+
font-size: var(--gcp-css-small-font-size);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
select {
|
|
309
|
+
padding-right: 30px;
|
|
310
|
+
cursor: pointer;
|
|
311
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235f6368'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
|
|
312
|
+
background-repeat: no-repeat;
|
|
313
|
+
background-position: right 8px center;
|
|
314
|
+
background-size: 20px;
|
|
315
|
+
|
|
316
|
+
&:focus {
|
|
317
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231a73e8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
:where([data-error]) &,
|
|
321
|
+
:where(.input-wrapper[data-error]) & {
|
|
322
|
+
color: var(--gcp-css-error);
|
|
323
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23d93025'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
textarea {
|
|
328
|
+
resize: vertical;
|
|
329
|
+
font-family: inherit;
|
|
330
|
+
|
|
331
|
+
& + label {
|
|
332
|
+
align-self: start;
|
|
333
|
+
margin-top: 8px;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
& [data-error],
|
|
338
|
+
&[data-error] {
|
|
339
|
+
input,
|
|
340
|
+
textarea,
|
|
341
|
+
select {
|
|
342
|
+
color: var(--gcp-css-error);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/* -------------------------------------------------------------
|
|
348
|
+
CHECKBOX & RADIO PATTERNS
|
|
349
|
+
------------------------------------------------------------- */
|
|
350
|
+
.gcp-css :is(.checkbox-wrapper, .radio-wrapper),
|
|
351
|
+
.gcp-css:is(.checkbox-wrapper, .radio-wrapper) {
|
|
352
|
+
position: relative;
|
|
353
|
+
display: grid;
|
|
354
|
+
margin-bottom: 19px;
|
|
355
|
+
.helper-text {
|
|
356
|
+
padding-top: 0;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.checkbox-row,
|
|
360
|
+
.radio-row {
|
|
361
|
+
grid-row: 1; /* Match normal input cell */
|
|
362
|
+
display: flex;
|
|
363
|
+
align-items: flex-start;
|
|
364
|
+
gap: 12px;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.content-cell {
|
|
368
|
+
display: flex;
|
|
369
|
+
flex-direction: column;
|
|
370
|
+
gap: 4px;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
label {
|
|
374
|
+
grid-area: auto;
|
|
375
|
+
align-self: auto;
|
|
376
|
+
justify-self: auto;
|
|
377
|
+
margin-left: 0;
|
|
378
|
+
pointer-events: auto;
|
|
379
|
+
background: transparent;
|
|
380
|
+
padding: 0;
|
|
381
|
+
font-size: var(--gcp-css-font-size);
|
|
382
|
+
color: var(--gcp-css-text);
|
|
383
|
+
cursor: pointer;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
& [data-error],
|
|
387
|
+
&[data-error] {
|
|
388
|
+
label {
|
|
389
|
+
color: var(--gcp-css-error);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
&:focus-within label {
|
|
393
|
+
color: var(--gcp-css-error);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
input:is([type="checkbox"], [type="radio"]) {
|
|
397
|
+
border-color: var(--gcp-css-error) !important;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
input:is([type="checkbox"], [type="radio"]) {
|
|
402
|
+
grid-area: auto;
|
|
403
|
+
appearance: none;
|
|
404
|
+
background-color: transparent;
|
|
405
|
+
margin: 0;
|
|
406
|
+
padding: 0;
|
|
407
|
+
width: 18px;
|
|
408
|
+
height: 18px;
|
|
409
|
+
border: 2px solid var(--gcp-css-gray-text);
|
|
410
|
+
border-radius: 2px;
|
|
411
|
+
display: grid;
|
|
412
|
+
place-content: center;
|
|
413
|
+
cursor: pointer;
|
|
414
|
+
flex-shrink: 0;
|
|
415
|
+
position: relative;
|
|
416
|
+
top: 2px; /* align element slightly down with font baseline */
|
|
417
|
+
transition: all 0.2s;
|
|
418
|
+
|
|
419
|
+
&:focus-visible {
|
|
420
|
+
outline: 2px solid var(--gcp-css-primary);
|
|
421
|
+
outline-offset: 2px;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
& .checkbox-wrapper,
|
|
426
|
+
&.checkbox-wrapper {
|
|
427
|
+
position: relative;
|
|
428
|
+
display: grid;
|
|
429
|
+
margin-bottom: 19px;
|
|
430
|
+
input[type="checkbox"] {
|
|
431
|
+
&::before {
|
|
432
|
+
content: "";
|
|
433
|
+
width: 5px;
|
|
434
|
+
height: 10px;
|
|
435
|
+
border-right: 2px solid white;
|
|
436
|
+
border-bottom: 2px solid white;
|
|
437
|
+
transform: translateY(-1px) rotate(45deg) scale(0);
|
|
438
|
+
transition: 120ms transform ease-in-out;
|
|
439
|
+
transform-origin: center;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
& :checked,
|
|
443
|
+
&:checked {
|
|
444
|
+
background-color: var(--gcp-css-primary);
|
|
445
|
+
border-color: var(--gcp-css-primary);
|
|
446
|
+
|
|
447
|
+
&::before {
|
|
448
|
+
transform: translateY(-1px) rotate(45deg) scale(1);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
& .radio-wrapper,
|
|
455
|
+
&.radio-wrapper {
|
|
456
|
+
position: relative;
|
|
457
|
+
display: grid;
|
|
458
|
+
margin-bottom: 19px;
|
|
459
|
+
input[type="radio"] {
|
|
460
|
+
border-radius: 50%; /* Force circle for radio */
|
|
461
|
+
|
|
462
|
+
&::before {
|
|
463
|
+
content: "";
|
|
464
|
+
width: 10px;
|
|
465
|
+
height: 10px;
|
|
466
|
+
border-radius: 50%;
|
|
467
|
+
transform: scale(0);
|
|
468
|
+
transition: 120ms transform ease-in-out;
|
|
469
|
+
background-color: var(--gcp-css-primary);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
&:checked {
|
|
473
|
+
border-color: var(--gcp-css-primary);
|
|
474
|
+
|
|
475
|
+
&::before {
|
|
476
|
+
transform: scale(1);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
& [data-error],
|
|
482
|
+
&[data-error] {
|
|
483
|
+
input[type="radio"] {
|
|
484
|
+
border-color: var(--gcp-css-error);
|
|
485
|
+
&::before {
|
|
486
|
+
background-color: var(--gcp-css-error);
|
|
487
|
+
}
|
|
488
|
+
&:checked {
|
|
489
|
+
border-color: var(--gcp-css-error);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
&:has(:disabled) {
|
|
496
|
+
opacity: 0.6;
|
|
497
|
+
cursor: not-allowed;
|
|
498
|
+
& * {
|
|
499
|
+
cursor: not-allowed;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|