@gov-design-system-ce/components 0.0.26 → 0.0.28
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/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/gov-accordion-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-accordion-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-button.cjs.entry.js +1 -1
- package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js +8 -0
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-icon.cjs.entry.js +1 -1
- package/dist/cjs/gov-skeleton.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/gov-accordion/gov-accordion-item.js +1 -1
- package/dist/collection/components/gov-accordion/gov-accordion-item.js.map +1 -1
- package/dist/collection/components/gov-button/gov-button.css +15 -1
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +31 -0
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js.map +1 -1
- package/dist/collection/components/gov-icon/list.js +15 -1
- package/dist/collection/components/gov-icon/list.js.map +1 -1
- package/dist/collection/components/gov-loading/skeleton/gov-skeleton.js.map +1 -1
- package/dist/components/gov-accordion-item.js +2 -1
- package/dist/components/gov-accordion-item.js.map +1 -1
- package/dist/components/gov-accordion.js +1 -0
- package/dist/components/gov-accordion.js.map +1 -1
- package/dist/components/gov-alert.js +1 -0
- package/dist/components/gov-alert.js.map +1 -1
- package/dist/components/gov-app.js +1 -0
- package/dist/components/gov-app.js.map +1 -1
- package/dist/components/gov-attachments-item2.js +1 -0
- package/dist/components/gov-attachments-item2.js.map +1 -1
- package/dist/components/gov-attachments2.js +1 -0
- package/dist/components/gov-attachments2.js.map +1 -1
- package/dist/components/gov-backdrop2.js +1 -0
- package/dist/components/gov-backdrop2.js.map +1 -1
- package/dist/components/gov-badge2.js +1 -0
- package/dist/components/gov-badge2.js.map +1 -1
- package/dist/components/gov-breadcrumbs.js +1 -0
- package/dist/components/gov-breadcrumbs.js.map +1 -1
- package/dist/components/gov-button2.js +2 -1
- package/dist/components/gov-button2.js.map +1 -1
- package/dist/components/gov-card.js +1 -0
- package/dist/components/gov-card.js.map +1 -1
- package/dist/components/gov-container.js +1 -0
- package/dist/components/gov-container.js.map +1 -1
- package/dist/components/gov-cookiebar.js +1 -0
- package/dist/components/gov-cookiebar.js.map +1 -1
- package/dist/components/gov-empty.js +1 -0
- package/dist/components/gov-empty.js.map +1 -1
- package/dist/components/gov-error-code.js +1 -0
- package/dist/components/gov-error-code.js.map +1 -1
- package/dist/components/gov-form-autocomplete2.js +10 -0
- package/dist/components/gov-form-autocomplete2.js.map +1 -1
- package/dist/components/gov-form-checkbox.js +1 -0
- package/dist/components/gov-form-checkbox.js.map +1 -1
- package/dist/components/gov-form-control.js +1 -0
- package/dist/components/gov-form-control.js.map +1 -1
- package/dist/components/gov-form-file.js +1 -0
- package/dist/components/gov-form-file.js.map +1 -1
- package/dist/components/gov-form-group.js +1 -0
- package/dist/components/gov-form-group.js.map +1 -1
- package/dist/components/gov-form-input2.js +1 -0
- package/dist/components/gov-form-input2.js.map +1 -1
- package/dist/components/gov-form-label.js +1 -0
- package/dist/components/gov-form-label.js.map +1 -1
- package/dist/components/gov-form-message2.js +1 -0
- package/dist/components/gov-form-message2.js.map +1 -1
- package/dist/components/gov-form-multi-select.js +1 -0
- package/dist/components/gov-form-multi-select.js.map +1 -1
- package/dist/components/gov-form-password-power.js +1 -0
- package/dist/components/gov-form-password-power.js.map +1 -1
- package/dist/components/gov-form-radio.js +1 -0
- package/dist/components/gov-form-radio.js.map +1 -1
- package/dist/components/gov-form-search.js +1 -0
- package/dist/components/gov-form-search.js.map +1 -1
- package/dist/components/gov-form-select2.js +1 -0
- package/dist/components/gov-form-select2.js.map +1 -1
- package/dist/components/gov-form-switch.js +1 -0
- package/dist/components/gov-form-switch.js.map +1 -1
- package/dist/components/gov-grid-item.js +1 -0
- package/dist/components/gov-grid-item.js.map +1 -1
- package/dist/components/gov-grid.js +1 -0
- package/dist/components/gov-grid.js.map +1 -1
- package/dist/components/gov-icon2.js +2 -1
- package/dist/components/gov-icon2.js.map +1 -1
- package/dist/components/gov-layout-column.js +1 -0
- package/dist/components/gov-layout-column.js.map +1 -1
- package/dist/components/gov-layout.js +1 -0
- package/dist/components/gov-layout.js.map +1 -1
- package/dist/components/gov-loading.js +1 -0
- package/dist/components/gov-loading.js.map +1 -1
- package/dist/components/gov-message.js +1 -0
- package/dist/components/gov-message.js.map +1 -1
- package/dist/components/gov-modal.js +1 -0
- package/dist/components/gov-modal.js.map +1 -1
- package/dist/components/gov-nav-item.js +1 -0
- package/dist/components/gov-nav-item.js.map +1 -1
- package/dist/components/gov-nav.js +1 -0
- package/dist/components/gov-nav.js.map +1 -1
- package/dist/components/gov-pagination.js +1 -0
- package/dist/components/gov-pagination.js.map +1 -1
- package/dist/components/gov-prompt.js +1 -0
- package/dist/components/gov-prompt.js.map +1 -1
- package/dist/components/gov-side-nav-item.js +1 -0
- package/dist/components/gov-side-nav-item.js.map +1 -1
- package/dist/components/gov-side-nav.js +1 -0
- package/dist/components/gov-side-nav.js.map +1 -1
- package/dist/components/gov-skeleton.js +1 -0
- package/dist/components/gov-skeleton.js.map +1 -1
- package/dist/components/gov-spacer.js +1 -0
- package/dist/components/gov-spacer.js.map +1 -1
- package/dist/components/gov-statsbar-item.js +1 -0
- package/dist/components/gov-statsbar-item.js.map +1 -1
- package/dist/components/gov-statsbar.js +1 -0
- package/dist/components/gov-statsbar.js.map +1 -1
- package/dist/components/gov-stepper-item.js +1 -0
- package/dist/components/gov-stepper-item.js.map +1 -1
- package/dist/components/gov-stepper.js +1 -0
- package/dist/components/gov-stepper.js.map +1 -1
- package/dist/components/gov-tabs-item.js +1 -0
- package/dist/components/gov-tabs-item.js.map +1 -1
- package/dist/components/gov-tabs.js +1 -0
- package/dist/components/gov-tabs.js.map +1 -1
- package/dist/components/gov-tile.js +1 -0
- package/dist/components/gov-tile.js.map +1 -1
- package/dist/components/gov-tiles.js +1 -0
- package/dist/components/gov-tiles.js.map +1 -1
- package/dist/components/gov-toast.js +1 -0
- package/dist/components/gov-toast.js.map +1 -1
- package/dist/components/gov-tooltip-content.js +1 -0
- package/dist/components/gov-tooltip-content.js.map +1 -1
- package/dist/components/gov-tooltip.js +1 -0
- package/dist/components/gov-tooltip.js.map +1 -1
- package/dist/components/gov-wizzard-item.js +1 -0
- package/dist/components/gov-wizzard-item.js.map +1 -1
- package/dist/components/gov-wizzard.js +1 -0
- package/dist/components/gov-wizzard.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/p-005bfb42.entry.js.map +1 -1
- package/dist/core/{p-bec31703.entry.js → p-0e5d6b14.entry.js} +2 -2
- package/dist/core/p-0e5d6b14.entry.js.map +1 -0
- package/dist/core/{p-1ba7bd9f.entry.js → p-266c3826.entry.js} +2 -2
- package/dist/core/p-266c3826.entry.js.map +1 -0
- package/dist/core/{p-edcfb1f7.entry.js → p-5957ba08.entry.js} +2 -2
- package/dist/core/p-5957ba08.entry.js.map +1 -0
- package/dist/core/{p-c8796c7a.entry.js → p-fb5b0e18.entry.js} +2 -2
- package/dist/custom-elements/index.js +1 -1
- package/dist/custom-elements/index.js.map +1 -1
- package/dist/esm/core.js +1 -1
- package/dist/esm/gov-accordion-item.entry.js +1 -1
- package/dist/esm/gov-accordion-item.entry.js.map +1 -1
- package/dist/esm/gov-button.entry.js +1 -1
- package/dist/esm/gov-button.entry.js.map +1 -1
- package/dist/esm/gov-form-autocomplete.entry.js +8 -0
- package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
- package/dist/esm/gov-icon.entry.js +1 -1
- package/dist/esm/gov-skeleton.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/hydrate/index.js +11 -2
- package/dist/types/components/gov-form/autocomplete/gov-form-autocomplete.d.ts +4 -0
- package/dist/types/components.d.ts +4 -0
- package/package.json +1 -1
- package/dist/core/critical.css +0 -480
- package/dist/core/p-1ba7bd9f.entry.js.map +0 -1
- package/dist/core/p-bec31703.entry.js.map +0 -1
- package/dist/core/p-edcfb1f7.entry.js.map +0 -1
- package/dist/globals.d.ts +0 -2
- package/dist/types/types/typings.d.ts +0 -6
- /package/dist/core/{p-c8796c7a.entry.js.map → p-fb5b0e18.entry.js.map} +0 -0
package/dist/core/critical.css
DELETED
|
@@ -1,480 +0,0 @@
|
|
|
1
|
-
gov-breadcrumbs ul {
|
|
2
|
-
margin: 0;
|
|
3
|
-
padding: 0;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
/* stylelint-disable */
|
|
7
|
-
/* stylelint-enable */
|
|
8
|
-
/* stylelint-disable */
|
|
9
|
-
/* stylelint-enable */
|
|
10
|
-
/* stylelint-disable */
|
|
11
|
-
/* stylelint-enable */
|
|
12
|
-
/* stylelint-disable */
|
|
13
|
-
/* stylelint-enable */
|
|
14
|
-
/* [Core] - Buttons
|
|
15
|
-
------------------------------------------------------------------ */
|
|
16
|
-
/*
|
|
17
|
-
* Gets color from theme-colors or from palette-colors
|
|
18
|
-
*/
|
|
19
|
-
/*
|
|
20
|
-
* Converts hex value to rgb colors value
|
|
21
|
-
*/
|
|
22
|
-
/* stylelint-disable order/order */
|
|
23
|
-
/* stylelint-enable order/order */
|
|
24
|
-
/*
|
|
25
|
-
* Generates list of utility classes for margin, padding
|
|
26
|
-
*
|
|
27
|
-
* Make sure $list of definitions is sorted so that last item is defined last
|
|
28
|
-
* So largest views are mentioned last.
|
|
29
|
-
*/
|
|
30
|
-
/*
|
|
31
|
-
- Variables - Sizes
|
|
32
|
-
*/
|
|
33
|
-
/* "Constants" for general usage */
|
|
34
|
-
/*
|
|
35
|
-
- Variables - Layout
|
|
36
|
-
*/
|
|
37
|
-
/**
|
|
38
|
-
* Utilities - Offset
|
|
39
|
-
*/
|
|
40
|
-
/* stylelint-disable order/order */
|
|
41
|
-
/* stylelint-enable order/order */
|
|
42
|
-
/* stylelint-disable order/order */
|
|
43
|
-
/* stylelint-enable order/order */
|
|
44
|
-
/* stylelint-disable order/order */
|
|
45
|
-
/* stylelint-enable order/order */
|
|
46
|
-
/**
|
|
47
|
-
* Generates CSS3 var with default value
|
|
48
|
-
*/
|
|
49
|
-
/*
|
|
50
|
-
- Variables - General
|
|
51
|
-
*/
|
|
52
|
-
/*
|
|
53
|
-
- Variables - Typography
|
|
54
|
-
*/
|
|
55
|
-
/*
|
|
56
|
-
- Variables - Variants
|
|
57
|
-
*/
|
|
58
|
-
/*
|
|
59
|
-
- Variables - Container
|
|
60
|
-
*/
|
|
61
|
-
/*
|
|
62
|
-
- Variables - Sizes
|
|
63
|
-
*/
|
|
64
|
-
/* "Constants" for general usage */
|
|
65
|
-
/*
|
|
66
|
-
- Variables - Accordion
|
|
67
|
-
*/
|
|
68
|
-
/*
|
|
69
|
-
- Variables - Attachments
|
|
70
|
-
*/
|
|
71
|
-
/*
|
|
72
|
-
- Variables - Alert
|
|
73
|
-
*/
|
|
74
|
-
/*
|
|
75
|
-
- Variables - Backdrop
|
|
76
|
-
*/
|
|
77
|
-
/*
|
|
78
|
-
- Variables - Buttons (&& Badges)
|
|
79
|
-
*/
|
|
80
|
-
/*
|
|
81
|
-
- Variables - Breadcrumbs
|
|
82
|
-
*/
|
|
83
|
-
/*
|
|
84
|
-
- Variables - Classes
|
|
85
|
-
*/
|
|
86
|
-
/*
|
|
87
|
-
- Variables - Colors
|
|
88
|
-
*/
|
|
89
|
-
/*
|
|
90
|
-
- Variables - Cookiebar
|
|
91
|
-
*/
|
|
92
|
-
/*
|
|
93
|
-
- Variables - Card
|
|
94
|
-
*/
|
|
95
|
-
/*
|
|
96
|
-
- Variables - Message
|
|
97
|
-
*/
|
|
98
|
-
/*
|
|
99
|
-
- Variables - Empty
|
|
100
|
-
*/
|
|
101
|
-
/*
|
|
102
|
-
- Variables - Error code
|
|
103
|
-
*/
|
|
104
|
-
/*
|
|
105
|
-
- Variables - Grid
|
|
106
|
-
*/
|
|
107
|
-
/*
|
|
108
|
-
- Variables - Tiles
|
|
109
|
-
*/
|
|
110
|
-
/*
|
|
111
|
-
- Variables - Modal & Prompt
|
|
112
|
-
*/
|
|
113
|
-
/**
|
|
114
|
-
* Utilities - Offset
|
|
115
|
-
*/
|
|
116
|
-
/*
|
|
117
|
-
- Variables - shadows
|
|
118
|
-
*/
|
|
119
|
-
/* "Constants" for general usage */
|
|
120
|
-
/*
|
|
121
|
-
- Variables - Statsbar
|
|
122
|
-
*/
|
|
123
|
-
/*
|
|
124
|
-
- Variables - Tabs
|
|
125
|
-
*/
|
|
126
|
-
/*
|
|
127
|
-
- Variables - Tooltip
|
|
128
|
-
*/
|
|
129
|
-
/*
|
|
130
|
-
- Variables - Loading
|
|
131
|
-
*/
|
|
132
|
-
/*
|
|
133
|
-
- Variables - Forms
|
|
134
|
-
*/
|
|
135
|
-
/*
|
|
136
|
-
- Variables - Form Autocomplete
|
|
137
|
-
*/
|
|
138
|
-
/*
|
|
139
|
-
- Variables - Form Message
|
|
140
|
-
*/
|
|
141
|
-
/*
|
|
142
|
-
- Variables - Form label
|
|
143
|
-
*/
|
|
144
|
-
/*
|
|
145
|
-
- Variables - Form switch
|
|
146
|
-
*/
|
|
147
|
-
/*
|
|
148
|
-
- Variables - Form select
|
|
149
|
-
*/
|
|
150
|
-
/*
|
|
151
|
-
- Variables - Form input
|
|
152
|
-
*/
|
|
153
|
-
/*
|
|
154
|
-
- Variables - Form multiselect
|
|
155
|
-
*/
|
|
156
|
-
/*
|
|
157
|
-
- Variables - Form password power
|
|
158
|
-
*/
|
|
159
|
-
/*
|
|
160
|
-
- Variables - Form checkbox & radio
|
|
161
|
-
*/
|
|
162
|
-
/*
|
|
163
|
-
- Variables - Form group
|
|
164
|
-
*/
|
|
165
|
-
/*
|
|
166
|
-
- Variables - Form file
|
|
167
|
-
*/
|
|
168
|
-
/*
|
|
169
|
-
- Variables - Toast Message
|
|
170
|
-
*/
|
|
171
|
-
/*
|
|
172
|
-
- Variables - Wizzard
|
|
173
|
-
*/
|
|
174
|
-
/*
|
|
175
|
-
- Variables - Stepper
|
|
176
|
-
*/
|
|
177
|
-
/*
|
|
178
|
-
- Variables - Side nav
|
|
179
|
-
*/
|
|
180
|
-
/*
|
|
181
|
-
- Variables - Grid & Tile
|
|
182
|
-
*/
|
|
183
|
-
/*
|
|
184
|
-
- Variables - Pagination
|
|
185
|
-
*/
|
|
186
|
-
/*
|
|
187
|
-
- Variables - Nav
|
|
188
|
-
*/
|
|
189
|
-
/*
|
|
190
|
-
- Variables - Layout
|
|
191
|
-
*/
|
|
192
|
-
.gov-spin-animation,
|
|
193
|
-
.gov-pseudo-spin-animation::before {
|
|
194
|
-
animation: spin 4s linear infinite;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
@keyframes spin {
|
|
198
|
-
100% {
|
|
199
|
-
transform: rotate(360deg);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
@keyframes countdown {
|
|
203
|
-
to {
|
|
204
|
-
transform: scaleX(0);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
@keyframes progress {
|
|
208
|
-
0% {
|
|
209
|
-
background-position: -200px 0;
|
|
210
|
-
}
|
|
211
|
-
100% {
|
|
212
|
-
background-position: calc(200px + 100%) 0;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
@keyframes pulse {
|
|
216
|
-
0% {
|
|
217
|
-
opacity: 1;
|
|
218
|
-
}
|
|
219
|
-
50% {
|
|
220
|
-
opacity: 0.4;
|
|
221
|
-
}
|
|
222
|
-
100% {
|
|
223
|
-
opacity: 1;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
/*
|
|
227
|
-
- Variables - Accordion
|
|
228
|
-
*/
|
|
229
|
-
/*
|
|
230
|
-
- Variables - Buttons (&& Badges)
|
|
231
|
-
*/
|
|
232
|
-
/*
|
|
233
|
-
- Variables - Form input
|
|
234
|
-
*/
|
|
235
|
-
/*
|
|
236
|
-
- Variables - Form switch
|
|
237
|
-
*/
|
|
238
|
-
/*
|
|
239
|
-
- Variables - Form select
|
|
240
|
-
*/
|
|
241
|
-
/*
|
|
242
|
-
- Variables - Loading
|
|
243
|
-
*/
|
|
244
|
-
/*
|
|
245
|
-
- Variables - Message
|
|
246
|
-
*/
|
|
247
|
-
gov-accordion-item[size=xs] {
|
|
248
|
-
min-height: var(--gov-accordion-s-min-height, 3rem);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
gov-accordion-item[size=s] {
|
|
252
|
-
min-height: var(--gov-accordion-s-min-height, 3rem);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
gov-accordion-item[size=m] {
|
|
256
|
-
min-height: var(--gov-accordion-m-min-height, 4.5rem);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
gov-accordion-item[size=l] {
|
|
260
|
-
min-height: var(--gov-accordion-l-min-height, 5.5rem);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
gov-button[size=xs] {
|
|
264
|
-
min-height: var(--gov-button-xs-min-height, 1.5rem);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
gov-button[size=s] {
|
|
268
|
-
min-height: var(--gov-button-s-min-height, 2rem);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
gov-button[size=m] {
|
|
272
|
-
min-height: var(--gov-button-m-min-height, 2.5rem);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
gov-button[size=l] {
|
|
276
|
-
min-height: var(--gov-button-l-min-height, 3rem);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
gov-button[size=xl] {
|
|
280
|
-
min-height: var(--gov-button-xl-min-height, 3.5rem);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
gov-badge[size=xs] {
|
|
284
|
-
min-height: var(--gov-button-xs-min-height, 1.5rem);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
gov-badge[size=s] {
|
|
288
|
-
min-height: var(--gov-button-s-min-height, 2rem);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
gov-badge[size=m] {
|
|
292
|
-
min-height: var(--gov-button-m-min-height, 2.5rem);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
gov-badge[size=l] {
|
|
296
|
-
min-height: var(--gov-button-l-min-height, 3rem);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
gov-badge[size=xl] {
|
|
300
|
-
min-height: var(--gov-button-xl-min-height, 3.5rem);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
gov-form-input[size=m] {
|
|
304
|
-
min-height: var(--gov-form-input-core-m-height, 2.5rem);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
gov-form-input[size=l] {
|
|
308
|
-
min-height: var(--gov-form-input-core-l-height, 3rem);
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
gov-form-input[size=xl] {
|
|
312
|
-
min-height: var(--gov-form-input-core-xl-height, 3.5rem);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
gov-form-select[size=m] {
|
|
316
|
-
min-height: var(--gov-form-input-core-m-height, 2.5rem);
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
gov-form-select[size=l] {
|
|
320
|
-
min-height: var(--gov-form-input-core-l-height, 3rem);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
gov-form-select[size=xl] {
|
|
324
|
-
min-height: var(--gov-form-input-core-xl-height, 3.5rem);
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
gov-form-switch[size=xs] {
|
|
328
|
-
min-height: var(--gov-form-switch-xs-indicator-height, 1.25rem);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
gov-form-switch[size=s] {
|
|
332
|
-
min-height: var(--gov-form-switch-s-indicator-height, 1.375rem);
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
gov-form-switch[size=m] {
|
|
336
|
-
min-height: var(--gov-form-switch-m-indicator-height, 1.5rem);
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
gov-form-switch[size=l] {
|
|
340
|
-
min-height: var(--gov-form-switch-l-indicator-height, 2rem);
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
gov-breadcrumbs {
|
|
344
|
-
min-height: 1.5rem;
|
|
345
|
-
}
|
|
346
|
-
gov-breadcrumbs ul {
|
|
347
|
-
position: relative;
|
|
348
|
-
display: flex;
|
|
349
|
-
width: 100%;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
gov-skeleton {
|
|
353
|
-
min-height: var(--gov-skeleton-height, 20px);
|
|
354
|
-
}
|
|
355
|
-
gov-skeleton[shape=circle] {
|
|
356
|
-
min-height: var(--gov-skeleton-circle-size, 60px);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
gov-message {
|
|
360
|
-
min-height: var(--gov-message-box-min-height, 3rem);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
gov-form-file,
|
|
364
|
-
gov-form-multi-select,
|
|
365
|
-
gov-modal,
|
|
366
|
-
gov-pagination,
|
|
367
|
-
gov-prompt,
|
|
368
|
-
gov-tabs,
|
|
369
|
-
gov-alert,
|
|
370
|
-
gov-loading,
|
|
371
|
-
gov-side-nav-item,
|
|
372
|
-
gov-toast,
|
|
373
|
-
gov-accordion-item,
|
|
374
|
-
gov-card,
|
|
375
|
-
gov-form-checkbox,
|
|
376
|
-
gov-tile,
|
|
377
|
-
gov-wizzard-item,
|
|
378
|
-
gov-accordion,
|
|
379
|
-
gov-app,
|
|
380
|
-
gov-breadcrumbs,
|
|
381
|
-
gov-container,
|
|
382
|
-
gov-cookiebar,
|
|
383
|
-
gov-empty,
|
|
384
|
-
gov-error-code,
|
|
385
|
-
gov-form-control,
|
|
386
|
-
gov-form-group,
|
|
387
|
-
gov-form-label,
|
|
388
|
-
gov-form-password-power,
|
|
389
|
-
gov-form-radio,
|
|
390
|
-
gov-form-search,
|
|
391
|
-
gov-form-switch,
|
|
392
|
-
gov-grid,
|
|
393
|
-
gov-grid-item,
|
|
394
|
-
gov-layout,
|
|
395
|
-
gov-layout-column,
|
|
396
|
-
gov-message,
|
|
397
|
-
gov-nav,
|
|
398
|
-
gov-nav-item,
|
|
399
|
-
gov-side-nav,
|
|
400
|
-
gov-skeleton,
|
|
401
|
-
gov-spacer,
|
|
402
|
-
gov-statsbar,
|
|
403
|
-
gov-statsbar-item,
|
|
404
|
-
gov-stepper,
|
|
405
|
-
gov-stepper-item,
|
|
406
|
-
gov-tabs-item,
|
|
407
|
-
gov-tiles,
|
|
408
|
-
gov-tooltip,
|
|
409
|
-
gov-wizzard,
|
|
410
|
-
gov-attachments-item,
|
|
411
|
-
gov-form-autocomplete,
|
|
412
|
-
gov-attachments,
|
|
413
|
-
gov-form-message,
|
|
414
|
-
gov-form-input,
|
|
415
|
-
gov-form-select,
|
|
416
|
-
gov-badge,
|
|
417
|
-
gov-backdrop,
|
|
418
|
-
gov-icon,
|
|
419
|
-
gov-button {
|
|
420
|
-
visibility: hidden;
|
|
421
|
-
}
|
|
422
|
-
gov-form-file.hydrated,
|
|
423
|
-
gov-form-multi-select.hydrated,
|
|
424
|
-
gov-modal.hydrated,
|
|
425
|
-
gov-pagination.hydrated,
|
|
426
|
-
gov-prompt.hydrated,
|
|
427
|
-
gov-tabs.hydrated,
|
|
428
|
-
gov-alert.hydrated,
|
|
429
|
-
gov-loading.hydrated,
|
|
430
|
-
gov-side-nav-item.hydrated,
|
|
431
|
-
gov-toast.hydrated,
|
|
432
|
-
gov-accordion-item.hydrated,
|
|
433
|
-
gov-card.hydrated,
|
|
434
|
-
gov-form-checkbox.hydrated,
|
|
435
|
-
gov-tile.hydrated,
|
|
436
|
-
gov-wizzard-item.hydrated,
|
|
437
|
-
gov-accordion.hydrated,
|
|
438
|
-
gov-app.hydrated,
|
|
439
|
-
gov-breadcrumbs.hydrated,
|
|
440
|
-
gov-container.hydrated,
|
|
441
|
-
gov-cookiebar.hydrated,
|
|
442
|
-
gov-empty.hydrated,
|
|
443
|
-
gov-error-code.hydrated,
|
|
444
|
-
gov-form-control.hydrated,
|
|
445
|
-
gov-form-group.hydrated,
|
|
446
|
-
gov-form-label.hydrated,
|
|
447
|
-
gov-form-password-power.hydrated,
|
|
448
|
-
gov-form-radio.hydrated,
|
|
449
|
-
gov-form-search.hydrated,
|
|
450
|
-
gov-form-switch.hydrated,
|
|
451
|
-
gov-grid.hydrated,
|
|
452
|
-
gov-grid-item.hydrated,
|
|
453
|
-
gov-layout.hydrated,
|
|
454
|
-
gov-layout-column.hydrated,
|
|
455
|
-
gov-message.hydrated,
|
|
456
|
-
gov-nav.hydrated,
|
|
457
|
-
gov-nav-item.hydrated,
|
|
458
|
-
gov-side-nav.hydrated,
|
|
459
|
-
gov-skeleton.hydrated,
|
|
460
|
-
gov-spacer.hydrated,
|
|
461
|
-
gov-statsbar.hydrated,
|
|
462
|
-
gov-statsbar-item.hydrated,
|
|
463
|
-
gov-stepper.hydrated,
|
|
464
|
-
gov-stepper-item.hydrated,
|
|
465
|
-
gov-tabs-item.hydrated,
|
|
466
|
-
gov-tiles.hydrated,
|
|
467
|
-
gov-tooltip.hydrated,
|
|
468
|
-
gov-wizzard.hydrated,
|
|
469
|
-
gov-attachments-item.hydrated,
|
|
470
|
-
gov-form-autocomplete.hydrated,
|
|
471
|
-
gov-attachments.hydrated,
|
|
472
|
-
gov-form-message.hydrated,
|
|
473
|
-
gov-form-input.hydrated,
|
|
474
|
-
gov-form-select.hydrated,
|
|
475
|
-
gov-badge.hydrated,
|
|
476
|
-
gov-backdrop.hydrated,
|
|
477
|
-
gov-icon.hydrated,
|
|
478
|
-
gov-button.hydrated {
|
|
479
|
-
visibility: inherit;
|
|
480
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/core/src/utils/bool.utils.ts","../../../packages/core/src/components/gov-button/gov-button.scss?tag=gov-button","../../../packages/core/src/components/gov-button/gov-button.tsx"],"names":["toBool","value","indexOf","govButtonCss","Tags","GovButton","[object Object]","hostRef","this","h","govHost","host","newValue","validateProp","ButtonVariants","ButtonClass","root","Type","Sizes","NativeType","validateVariant","variant","validateType","type","validateSize","size","validateNativeType","nativeType","canValidateWcagOnRender","delay","validateWcag","classNames","prepareClasses","hasSlot","rootWithIcon","Tag","href","A","BUTTON","undefined","Host","hoverable","class","classes","inverse","ref","el","buttonRef","onClick","onClickHandler","bind","onFocus","onFocusHandler","onBlur","onBlurHandler","onMouseDown","isPressed","onMouseUp","disabled","id","identifier","target","download","hreflang","rel","name","tabindex","focusable","aria-activedescendant","wcagActiveDescendant","aria-describedby","aria-description","wcagDescription","aria-controls","wcagControls","aria-details","wcagDetails","aria-expanded","toBoolAttrIfDefined","wcagExpanded","aria-label","wcagLabel","aria-labelledby","wcagLabelledBy","aria-owns","wcagOwns","aria-haspopup","wcagHasPopup","aria-pressed","toBoolAttr","aria-disabled","aria-current","wcagCurrent","loading","e","stopPropagation","govClick","emit","component","originalEvent","govFocus","govBlur","focus","validateWcagRef","validateWcagLabel"],"mappings":"8bAAgBA,EAAOC,GACtB,UAAWA,IAAU,SAAU,CAC9B,MAAO,CAAC,OAAQ,OAAQ,OAAQ,KAAKC,QAAQD,MAAY,OACnD,UAAWA,IAAU,SAAU,CACrC,OAAOA,EAAQ,OACT,UAAWA,IAAU,UAAW,CACtC,OAAOA,MACD,CACN,OAAOA,EAAQ,KAAO,OCRxB,MAAME,EAAe,qjwECsBrB,IAAKC,GAAL,SAAKA,GACJA,EAAA,KAAA,IACAA,EAAA,UAAA,UAFD,CAAKA,IAAAA,EAAI,WASIC,EAAS,MAIrBC,YAAAC,wJAa2D,cAIN,sBAIhB,mBAID,wCASkB,sBAKN,0LAuCV,oYAwFjB,MArKpBC,KAAKC,EAAIC,EAAQF,KAAKG,MAkJvBL,gBAAgBM,GACfC,EAAaC,EAAgBF,EAAUG,EAAYC,MAIpDV,aAAaM,GACZC,EAAaI,EAAML,EAAU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AAK2D,UAAW,CACnBoC,EAAgB/F,KAAK6D,qBAAsB,wBAAyBtD,EAAYC,MAChFuF,EAAgB/F,KAAKkE,aAAc,gBAAiB3D,EAAYC,MAChEuF,EAAgB/F,KAAKoE,YAAa,eAAgB7D,EAAYC,MAC9DuF,EAAgB/F,KAAK6E,SAAU,YAAatE,EAAYC,MACxDuF,EAAgB/F,KAAK+E,aAAc,gBAAiBxE,EAAYC,MAChEwF,EAAkBhG,KAAKyE,UAAWzE,KAAK2E,eAAgBpE,EAAYC","sourcesContent":["export function toBool(value: any): boolean {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1'].indexOf(value) !== -1\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0\n\t} else if (typeof value === 'boolean') {\n\t\treturn value\n\t} else {\n\t\treturn value ? true : false\n\t}\n}\n","/*\n * Button\n */\n\n// Shared definitions - BUTTON & badge\n@import \"./gov-button-core.scss\";\n\n.gov-button {\n\t@extend %button-core;\n\tdisplay: inline-block;\n\t.element {\n\t\tborder-radius: #{$border-radius};\n\t\tfont-weight: 700 !important;\n\t}\n\n\t&[type=\"link\"] {\n\t\t.element {\n\t\t\tmin-height: inherit;\n\t\t\tpadding: 0 !important;\n\t\t\tline-height: inherit;\n\t\t\ttext-decoration: underline;\n\t\t\t@include hover() {\n\t\t\t\ttext-decoration: none;\n\t\t\t}\n\t\t}\n\t}\n\n\t// STATES\n\t&[loading=\"true\"],\n\t&[loading=\"1\"] {\n\t\t.element {\n\t\t\t> .gov-icon:not(.gov-spin-animation),\n\t\t\t> gov-icon:not(.gov-spin-animation) {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.gov-icon {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $button-sizes {\n\t\t// Loading state\n\t\t&[loading=\"0\"][size=\"#{$size}\"],\n\t\t&[loading=\"false\"][size=\"#{$size}\"],\n\t\t&[loading=\"\"][size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tpadding: get(\"padding-y\", $definitions) calc(((get(\"padding-x\", $definitions) * 3) + get(\"icon-size\", $definitions)) / 2);\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport {\n\tButtonSizesType,\n\tNativeTypesType,\n\tTypesType,\n\tButtonVariants,\n\tButtonVariantType,\n\tButtonClass,\n\tType,\n\tNativeType,\n\tButtonTargetType,\n} from \"./constants\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined, prepareClasses } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { toBool } from \"../../utils/bool.utils\"\nimport { Sizes } from \"../../core/constants/sizes\"\nimport { validateWcagLabel, validateWcagRef } from \"../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../helpers/Dom/win\"\nimport { delay } from \"../../utils/utils\"\nimport { ButtonEvent } from \"./gov-button.types\"\n\nenum Tags {\n\tA = \"a\",\n\tBUTTON = \"button\",\n}\n\n@Component({\n\ttag: \"gov-button\",\n\tstyleUrl: \"gov-button.scss\",\n})\nexport class GovButton {\n\tprivate h: GovHost\n\tprivate buttonRef?: HTMLButtonElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\n\t/**\n\t * Style variation of the button\n\t */\n\t@Prop({ reflect: true }) readonly variant?: ButtonVariantType\n\t/**\n\t * Button’s size\n\t */\n\t@Prop({ reflect: true }) readonly size?: ButtonSizesType = \"m\"\n\t/**\n\t * Button's type\n\t */\n\t@Prop({ reflect: true }) readonly type?: TypesType = \"solid\"\n\t/**\n\t * Expands the button to fill 100% of the container width\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Determine if component should have inversed colors to be used on dark background\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * The name of the button, which gets paired with the button's value when submitted as part of a form. Corresponds with the native HTML name attribute\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Makes the button component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies\n\t */\n\t@Prop({ reflect: true }) readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter\n\t * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\n\t */\n\t@Prop() readonly nativeType?: NativeTypesType = \"button\"\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href\n\t */\n\t@Prop() readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download\n\t */\n\t@Prop() readonly download: boolean\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-hreflang\n\t */\n\t@Prop() readonly hreflang: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-referrerpolicy\n\t */\n\t@Prop() readonly referrerpolicy: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-rel\n\t */\n\t@Prop() readonly rel: string\n\t/**\n\t * Indicates whether an asynchronous process is running\n\t */\n\t@Prop() readonly loading: string\n\t/**\n\t * Same as original parametr\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom button identifier\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Indicates the id of a related component’s visually focused element\n\t */\n\t@Prop({ attribute: \"wcag-active-descendant\" }) readonly wcagActiveDescendant: string\n\t/**\n\t * Use this property to add an aria-controls attribute to the button. Use the attribute to point to the unique id of the content that the button manages\n\t */\n\t@Prop({ attribute: \"wcag-controls\" }) readonly wcagControls: string\n\t/**\n\t * Indicates the id of a component that describes the button\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Aria description the button\n\t */\n\t@Prop({ attribute: \"wcag-description\" }) readonly wcagDescription: string\n\t/**\n\t * Details of the component\n\t */\n\t@Prop({ attribute: \"wcag-details\" }) readonly wcagDetails: string\n\t/**\n\t * If a button expands or collapses adjacent content, then use the ariaExpanded prop to add the aria-expanded attribute to the button\n\t * Set the value to convey the current expanded (true) or collapsed (false) state of the content\n\t */\n\t@Prop({ attribute: \"wcag-expanded\" }) readonly wcagExpanded: boolean\n\t/**\n\t * Adds accessible label for the button that is only shown for screen readers\n\t * Typically, this label text replaces the visible text on the button for users who use assistive technology\n\t */\n\t@Prop({ attribute: \"wcag-label\" }) readonly wcagLabel: string\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component owned by the button\n\t */\n\t@Prop({ attribute: \"wcag-owns\" }) readonly wcagOwns: string\n\t/**\n\t * \tUse this property to add an aria-haspopup attribute to a button, if you are using it as a menu button\n\t */\n\t@Prop({ attribute: \"wcag-has-popup\" }) readonly wcagHasPopup: string\n\t/**\n\t * Tells screen reader the element is pressed\n\t */\n\t@Prop({ attribute: \"wcag-pressed\" }) readonly wcagPressed: string\n\t/**\n\t * Indicates the current item within a container or set of related elements\n\t */\n\t@Prop({ attribute: \"wcag-current\" }) readonly wcagCurrent: string\n\t/**\n\t * Emitted when the button click\n\t */\n\t@Event({ eventName: \"gov-click\" }) govClick: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button has focus\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button loses focus\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<ButtonEvent>\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(ButtonVariants, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(Type, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"nativeType\")\n\tvalidateNativeType(newValue: string): void {\n\t\tvalidateProp(NativeType, newValue, ButtonClass.root)\n\t}\n\n\t@State() isPressed = false\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateType(this.type)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateNativeType(this.nativeType)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tget classNames(): string {\n\t\tconst { h } = this\n\n\t\treturn prepareClasses([ButtonClass.root, h.hasSlot(\"left-icon\") && ButtonClass.rootWithIcon, h.hasSlot(\"right-icon\") && ButtonClass.rootWithIcon])\n\t}\n\n\trender() {\n\t\tconst Tag = this.href ? Tags.A : Tags.BUTTON\n\t\tconst nativeType = Tag === Tags.A ? undefined : this.nativeType\n\n\t\treturn (\n\t\t\t<Host hoverable={true} size={this.size} variant={this.variant} class={this.h.classes(this.classNames)} type={this.type} inverse={this.inverse}>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\tref={el => (this.buttonRef = el as HTMLButtonElement)}\n\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\tonMouseDown={() => (this.isPressed = true)}\n\t\t\t\t\tonMouseUp={() => (this.isPressed = false)}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\tid={this.identifier}\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\tdownload={this.download}\n\t\t\t\t\threflang={this.hreflang}\n\t\t\t\t\trel={this.rel}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\ttype={nativeType}\n\t\t\t\t\ttabindex={this.focusable ? \"0\" : \"-1\"}\n\t\t\t\t\taria-activedescendant={this.wcagActiveDescendant}\n\t\t\t\t\taria-describedby={this.wcagActiveDescendant}\n\t\t\t\t\taria-description={this.wcagDescription}\n\t\t\t\t\taria-controls={this.wcagControls}\n\t\t\t\t\taria-details={this.wcagDetails}\n\t\t\t\t\taria-expanded={toBoolAttrIfDefined(this.wcagExpanded)}\n\t\t\t\t\taria-label={this.wcagLabel}\n\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\taria-haspopup={toBoolAttrIfDefined(this.wcagHasPopup)}\n\t\t\t\t\taria-pressed={toBoolAttr(this.isPressed)}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\taria-current={this.wcagCurrent}\n\t\t\t\t>\n\t\t\t\t\t{toBool(this.loading) && !this.h.hasSlot(\"right-icon\") &&\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\"></gov-icon>}\n\t\t\t\t\t{this.h.hasSlot(\"left-icon\") && <slot name=\"left-icon\"></slot>}\n\t\t\t\t\t<slot />\n\t\t\t\t\t{this.h.hasSlot(\"right-icon\") && <slot name=\"right-icon\"></slot>}\n\t\t\t\t\t{toBool(this.loading) && this.h.hasSlot(\"right-icon\") &&\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\"></gov-icon>}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent): void {\n\t\te.stopPropagation()\n\t\tif (this.disabled === false) {\n\t\t\tthis.govClick.emit({\n\t\t\t\tcomponent: ButtonClass.root,\n\t\t\t\toriginalEvent: e,\n\t\t\t\tref: this.host,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\t/**\n\t * Focus button element\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tthis.buttonRef.focus()\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tif (this.focusable) {\n\t\t\tvalidateWcagRef(this.wcagActiveDescendant, \"aria-activedescendant\", ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagControls, \"aria-controls\", ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagDetails, \"aria-details\", ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagOwns, \"aria-owns\", ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagHasPopup, \"aria-haspopup\", ButtonClass.root)\n\t\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, ButtonClass.root)\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/core/src/components/gov-form/autocomplete/gov-form-autocomplete.scss?tag=gov-form-autocomplete","../../../packages/core/src/components/gov-form/autocomplete/gov-form-autocomplete.tsx"],"names":["govFormAutocompleteCss","GovFormAutocomplete","[object Object]","hostRef","this","templateResolver","item","nameKey","listBoxId","createID","newValue","validateProp","FormAutocompleteVariants","FormAutocompleteClass","root","FormAutocompleteSizes","arrowCounter","moveToView","finally","list","length","delay","heightOfList","listRef","offsetHeight","selected","querySelector","offsetTop","scrollTo","top","behavior","Number","isInteger","minlength","String","value","processing","searchCallback","then","response","catch","validateVariant","variant","validateSize","size","h","Host","class","placeholder","name","disabled","readonly","autocomplete","required","invalid","role","maxlength","on-gov-input","throttle","onInputHandler","bind","on-gov-keyup","onKeyUpHandler","on-gov-keydown","onKeyDownHandler","on-gov-focus","onFocusHandler","on-gov-blur","onBlurHandler","wcagAutocomplete","wcagDescribedBy","wcagLabelledBy","wcagOwns","join","wcagExpanded","focused","ref","el","inputRef","slot","id","map","index","isSelected","innerHTML","aria-posinset","tabindex","aria-setsize","onClick","onSelectHandler","aria-selected","toBoolAttr","e","doSearch","stopPropagation","govFocus","emit","originalEvent","component","setTimeout","govBlur","target","govInput","has","govSelect","event","detail","keyCode","onArrowUp","onArrowDown","preventDefault","options","focus","clearValue","callback"],"mappings":"wVAAA,MAAMA,EAAyB,mrDCoBlBC,EAAmB,MAO/BC,YAAAC,6JAFQC,KAAAC,iBAAiFC,GAAQA,EAAKF,KAAKG,oBAU3D,qFAgBZ,iBAID,yCASE,uHAqBA,uJAmCf,yBACG,YACkB,GA9F1CH,KAAKI,UAAYC,EAAS,cAiG3BP,gBAAgBQ,GACfC,EAAaC,EAA0BF,EAAUG,EAAsBC,MAIxEZ,aAAaQ,GACZC,EAAaI,EAAuBL,EAAUG,EAAsBC,MAG7DZ,YACP,GAAIE,KAAKY,aAAe,EAAG,CAC1BZ,KAAKY,aAAeZ,KAAKY,aAAe,EACxCZ,KAAKa,aAAaC,WAIZhB,cACP,GAAIE,KAAKY,aAAeZ,KAAKe,KAAKC,OAAS,EAAG,CAC7ChB,KAAKY,aAAeZ,KAAKY,aAAe,EACxCZ,KAAKa,aAAaC,WAIZhB,yBACDmB,EAAM,KACZ,MA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B6G","sourcesContent":["$class: \".gov-form-autocomplete\";\n\n#{$class} {\n\t@include base();\n\t&__list {\n\t\t@include typography($font-size-s);\n\t\t@extend %reset-ul;\n\t\tposition: absolute;\n\t\ttop: 100%;\n\t\tright: 0;\n\t\tleft: 0;\n\t\tz-index: 5;\n\t\tmax-height: rem-calc(225);\n\t\tmargin-top: rem-calc(8);\n\t\tborder: $form-autocomplete-border;\n\t\tborder-radius: $border-radius;\n\t\tbackground: $form-autocomplete-bg;\n\t\toverflow-x: hidden;\n\t\toverflow-y: auto;\n\t\toverscroll-behavior: none;\n\t}\n\t&__list > &__item {\n\t\t@extend %reset-ul-li;\n\t\tpadding: rem-calc(12 8);\n\t\tcursor: pointer;\n\t}\n\n\t// STATES\n\t&__list:empty {\n\t\tdisplay: none;\n\t}\n\n\t// HOVERS\n\t&__item {\n\t\t@include parameter(\"aria-selected\") {\n\t\t\tbackground: $form-autocomplete-item-select-bg;\n\t\t}\n\t\t@include hover() {\n\t\t\tbackground: $form-autocomplete-item-hover-bg;\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport {\n\tFormAutocompleteClass,\n\tFormAutocompleteSizes,\n\tFormAutocompleteVariants,\n\tSizesType,\n\tVariantType,\n} from \"./constants\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { delay, has, throttle } from \"../../../utils/utils\"\nimport { FormAutocompleteEvent, GovFormAutocompleteItem } from \"./gov-form-autocomplete.types\"\nimport { toBoolAttr } from \"../../../helpers/Dom/template\"\nimport { Nullable } from \"../../../types/interfaces\"\nimport { FormInputEvent } from \"../input/gov-form-input.types\"\n\n@Component({\n\ttag: \"gov-form-autocomplete\",\n\tstyleUrl: \"gov-form-autocomplete.scss\",\n})\nexport class GovFormAutocomplete {\n\tprivate inputRef?: HTMLGovFormInputElement\n\tprivate listRef?: HTMLUListElement\n\tprivate readonly listBoxId: string\n\tprivate searchCallback: (value: string) => Promise<GovFormAutocompleteItem[]>\n\tprivate templateResolver: (item: GovFormAutocompleteItem, selected: boolean) => string = item => item[this.nameKey]\n\n\tconstructor() {\n\t\tthis.listBoxId = createID(\"GovListBox\")\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({ reflect: true, mutable: true }) value = \"\"\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop() readonly variant?: VariantType\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean\n\t/**\n\t * Input’s size.\n\t */\n\t@Prop() readonly size?: SizesType = \"m\"\n\t/**\n\t * Main key name in the object\n\t */\n\t@Prop() readonly nameKey: string = \"name\"\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the input component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean\n\t/**\n\t * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number = 2\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Same as original parameter\n\t * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-owns\n\t */\n\t@Prop({ attribute: \"wcag-owns\" }) readonly wcagOwns: string\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: \"gov-input\" }) govInput: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: \"gov-select\" }) govSelect: EventEmitter<FormAutocompleteEvent>\n\t@State() focused: boolean\n\t@State() processing = false\n\t@State() arrowCounter = -1\n\t@State() list: GovFormAutocompleteItem[] = []\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormAutocompleteVariants, newValue, FormAutocompleteClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormAutocompleteSizes, newValue, FormAutocompleteClass.root)\n\t}\n\n\tprivate onArrowUp() {\n\t\tif (this.arrowCounter > 0) {\n\t\t\tthis.arrowCounter = this.arrowCounter - 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate onArrowDown() {\n\t\tif (this.arrowCounter < this.list.length - 1) {\n\t\t\tthis.arrowCounter = this.arrowCounter + 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate async moveToView() {\n\t\tawait delay(200)\n\t\tconst heightOfList = this.listRef.offsetHeight\n\t\tconst selected = this.listRef.querySelector(\"li[aria-selected=\\\"true\\\"]\") as HTMLUListElement\n\t\tif (selected && heightOfList) {\n\t\t\tconst offsetTop = selected.offsetTop\n\t\t\tthis.listRef.scrollTo({ top: offsetTop, behavior: \"smooth\" })\n\t\t}\n\t}\n\n\tprivate doSearch() {\n\t\tif (Number.isInteger(this.minlength) && String(this.value).length <= this.minlength && this.minlength) {\n\t\t\tthis.list = []\n\t\t\tthis.arrowCounter = -1\n\t\t\tthis.processing = false\n\t\t\treturn\n\t\t}\n\t\tif (this.searchCallback) {\n\t\t\tthis.processing = true\n\t\t\tthis.searchCallback(this.value)\n\t\t\t\t.then(response => (this.list = response))\n\t\t\t\t.catch(() => (this.list = []))\n\t\t\t\t.finally(() => {\n\t\t\t\t\tthis.arrowCounter = -1\n\t\t\t\t\tthis.processing = false\n\t\t\t\t})\n\t\t}\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormAutocompleteClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t<gov-form-input\n\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\treadonly={this.readonly}\n\t\t\t\t\tautocomplete={false}\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\trequired={this.required}\n\t\t\t\t\tinvalid={this.invalid}\n\t\t\t\t\trole={\"searchbox\"}\n\t\t\t\t\tvalue={this.value}\n\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\ton-gov-input={throttle(this.onInputHandler.bind(this), 200)}\n\t\t\t\t\ton-gov-keyup={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\ton-gov-keydown={this.onKeyDownHandler.bind(this)}\n\t\t\t\t\ton-gov-focus={this.onFocusHandler.bind(this)}\n\t\t\t\t\ton-gov-blur={this.onBlurHandler.bind(this)}\n\t\t\t\t\twcagAutocomplete={\"list\"}\n\t\t\t\t\twcagDescribedBy={this.wcagDescribedBy}\n\t\t\t\t\twcagLabelledBy={this.wcagLabelledBy}\n\t\t\t\t\twcagOwns={[this.listBoxId, this.wcagOwns].join(\" \")}\n\t\t\t\t\twcagExpanded={this.list.length && this.focused}\n\t\t\t\t\tref={el => (this.inputRef = el as HTMLGovFormInputElement)}\n\t\t\t\t>\n\t\t\t\t\t<slot slot=\"right-icon\" name=\"right-icon\" />\n\t\t\t\t</gov-form-input>\n\t\t\t\t<ul class={FormAutocompleteClass.list}\n\t\t\t\t role={\"listbox\"}\n\t\t\t\t id={this.listBoxId}\n\t\t\t\t ref={el => (this.listRef = el as HTMLUListElement)}>\n\t\t\t\t\t{this.list.map((item, index) => {\n\t\t\t\t\t\tconst isSelected = this.arrowCounter === index\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\tclass={FormAutocompleteClass.item}\n\t\t\t\t\t\t\t\tinnerHTML={this.templateResolver(item, isSelected)}\n\t\t\t\t\t\t\t\trole={\"option\"}\n\t\t\t\t\t\t\t\taria-posinset={index}\n\t\t\t\t\t\t\t\ttabindex={isSelected ? 0 : -1}\n\t\t\t\t\t\t\t\taria-setsize={this.list.length}\n\t\t\t\t\t\t\t\tonClick={() => this.onSelectHandler(index)}\n\t\t\t\t\t\t\t\taria-selected={toBoolAttr(isSelected)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)\n\t\t\t\t\t})}\n\t\t\t\t</ul>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.arrowCounter = -1\n\t\tif ((this.value || this.minlength === 0) && this.searchCallback) {\n\t\t\tthis.doSearch()\n\t\t}\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tsetTimeout(() => (this.list = []), 200)\n\t\tthis.arrowCounter = -1\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: InputEvent) {\n\t\tthis.value = (e.target as HTMLGovFormInputElement).value\n\t\te.stopPropagation()\n\t\tthis.govInput.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t\tthis.doSearch()\n\t}\n\n\tprivate onSelectHandler(index = -1) {\n\t\tlet selected: Nullable<GovFormAutocompleteItem> = null\n\t\tif (index > -1) {\n\t\t\tselected = this.list[index]\n\t\t} else if (has(this.arrowCounter, this.list)) {\n\t\t\tselected = this.list[this.arrowCounter]\n\t\t}\n\t\tif (selected) {\n\t\t\tthis.govSelect.emit({\n\t\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\t\tvalue: this.value,\n\t\t\t\tselected: selected,\n\t\t\t})\n\t\t\tthis.list = []\n\t\t\tif (has(this.nameKey, selected) && typeof selected[this.nameKey] === \"string\") {\n\t\t\t\tthis.value = selected[this.nameKey]\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onKeyUpHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tif (event.keyCode === 38) this.onArrowUp()\n\t\telse if (event.keyCode === 40) this.onArrowDown()\n\t\telse if (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tthis.onSelectHandler()\n\t\t}\n\t}\n\n\tprivate onKeyDownHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tif (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t}\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.inputRef.focus(options)\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = \"\"\n\t\tthis.inputRef.value = \"\"\n\n\t\tawait this.inputRef.clearValue()\n\t}\n\n\t/**\n\t * Set a custom asynchronous function for the whisperer\n\t */\n\t@Method()\n\tasync setSearchCallback(callback: (value: string) => Promise<any>) {\n\t\tthis.searchCallback = callback\n\t}\n\n\t/**\n\t * Setting a custom whisper result template\n\t * @param callback\n\t */\n\t@Method()\n\tasync setTemplateResolver(callback: (item: GovFormAutocompleteItem) => string) {\n\t\tthis.templateResolver = callback\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/core/src/components/gov-accordion/gov-accordion-item.scss?tag=gov-accordion-item","../../../packages/core/src/components/gov-accordion/gov-accordion-item.tsx"],"names":["govAccordionItemCss","GovAccordionItem","[object Object]","hostRef","this","h","govHost","host","triggerId","createID","contentId","newValue","govErrorLog","AccordionItemClass","root","validTags","includes","validateProp","AccordionSizes","AccordionVariants","govChange","emit","open","isExpandedState","component","ref","isExpanded","getPropsFromParents","validateLabel","label","validateTriggerTag","triggerTag","validateSize","size","validateVariant","variant","accordion","getParent","AccordionClass","getAttribute","identifier","TriggerTag","Host","class","classes","no-border","noBorder","role","id","header","aria-expanded","booleanString","aria-controls","disabled","aria-disabled","toBoolAttrIfDefined","onClick","e","stopPropagation","toggle","finally","title","hasSlot","icon","name","annotation","annot","suffix","arrow","content","aria-hidden","hidden","aria-labelledby","emmitChange"],"mappings":"+VAAA,MAAMA,EAAsB,+yWCoBfC,EAAgB,MAK5BC,YAAAC,+FAYwD,qHAqBnB,sBAI8B,sBAID,mBAIH,MA5C9DC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KA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C,OAAMC,gBACjBC,EAAc5B,GAAgB6B,gBAC9B1C,EACf2C,SAAUjD,KAAKiD,SAAQC,gBACRC,EAAoBnD,KAAKiD,UACxCG,QAAUC,IACTA,EAAEC,kBACFtD,KAAKuD,SAASC,YAEfvD,EAACoC,EAAU,CAACE,MAAO9B,EAAmBgD,OACpCzD,KAAKC,EAAEyD,QAAQ,SACfzD,EAAA,OAAA,CAAMsC,MAAO9B,EAAmBkD,MAC/B1D,EAAA,OAAA,CAAM2D,KAAK,UAIb3D,EAAA,OAAA,CAAMsC,MAAO9B,EAAmBmD,MAC/B3D,EAAA,OAAA,CAAMsC,MAAO9B,EAAmBgB,OAAQA,GACvCzB,KAAK6D,YAAc5D,EAAA,OAAA,CAAMsC,MAAO9B,EAAmBqD,OAAQ9D,KAAK6D,aAGjE7D,KAAKC,EAAEyD,QAAQ,WACfzD,EAAA,OAAA,CAAMsC,MAAO9B,EAAmBsD,QAC/B9D,EAAA,OAAA,CAAM2D,KAAK,aAKd3D,EAAA,WAAA,CAAUsC,MAAO9B,EAAmBuD,MAAOJ,KAAK,kBAEjD3D,EAAA,MAAA,CACCsC,MAAO9B,EAAmBwD,QAC1BrB,GAAItC,EAAS4D,cACAnB,GAAe5B,GAC5BgD,QAAShD,EAAeiD,kBACPhE,GACjBH,EAAA,OAAA,QAUJH,aACCE,KAAKmB,gBAAkB,KACvBnB,KAAKqE,cAONvE,cACCE,KAAKmB,gBAAkB,MACvBnB,KAAKqE,cAONvE,eACCE,KAAKmB,iBAAmBnB,KAAKmB,gBAC7BnB,KAAKqE,cAONvE,qBACC,OAAOE,KAAKmB","sourcesContent":["/*\n * Accordion - Item\n */\n\n$class: \".gov-accordion-item\";\n\n#{$class} {\n\t@include base();\n\t&__header {\n\t\t@include button-core();\n\t\t@include focus-outline();\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: center;\n\t\twidth: 100%;\n\t\tborder-radius: 0;\n\t\ttext-align: left;\n\t\ttext-transform: none;\n\t\ttransition: background-color $t ease-in-out;\n\t\t&::before {\n\t\t\t@include pseudo();\n\t\t\tright: 0;\n\t\t\tbottom: -1px;\n\t\t\tleft: 0;\n\t\t\theight: 1px;\n\t\t}\n\n\t\t// STATES\n\t\t&:focus-visible {\n\t\t\t&::before {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t}\n\t\t@include parameter(\"aria-expanded\") {\n\t\t\t#{$class} {\n\t\t\t\t&__arrow {\n\t\t\t\t\ttransform: scale(-1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t&__arrow {\n\t\tflex: 0 0 auto;\n\t\talign-self: center;\n\t}\n\t&__icon {\n\t\tdisplay: inline-flex;\n\t\tvertical-align: middle;\n\t\tflex: 0 0 auto;\n\t}\n\t&__suffix {\n\t\tdisplay: inline-flex;\n\t\tvertical-align: middle;\n\t\tflex: 0 0 auto;\n\t\talign-self: start;\n\t\tmargin-left: auto;\n\t\tline-height: initial;\n\t}\n\t&__title {\n\t\t@include general;\n\t\tdisplay: flex;\n\t\tflex: 1 1 auto;\n\t\talign-items: flex-start;\n\t}\n\t&__name {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\t&__annot {\n\t\tcolor: color(\"secondary\");\n\t}\n\t&__content {\n\t\t@include reset-last-margin();\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $accordion-sizes {\n\t\t&[size=\"#{$size}\"],\n\t\t& #{$class}[size=\"#{$size}\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__header {\n\t\t\t\t\tgap: get(\"headline-gap\", $definitions);\n\t\t\t\t\tmin-height: get(\"min-height\", $definitions);\n\t\t\t\t\tpadding: get(\"padding-y\", $definitions) get(\"padding-x\", $definitions);\n\t\t\t\t}\n\t\t\t\t&__arrow {\n\t\t\t\t\twidth: get(\"icon-size\", $definitions);\n\t\t\t\t\theight: get(\"icon-size\", $definitions);\n\t\t\t\t}\n\t\t\t\t&__icon {\n\t\t\t\t\twidth: calc(get-font-size(get(\"font\", $definitions)) * 1.2);\n\t\t\t\t\theight: calc(get-font-size(get(\"font\", $definitions)) * 1.2);\n\t\t\t\t\ttransform: translateY(get(\"icon-position\", $definitions));\n\t\t\t\t}\n\t\t\t\t&__title {\n\t\t\t\t\t@include typography(get(\"font\", $definitions));\n\t\t\t\t\tgap: get(\"headline-gap\", $definitions);\n\t\t\t\t}\n\t\t\t\t&__annot {\n\t\t\t\t\t@include typography(get(\"font-annot\", $definitions));\n\t\t\t\t}\n\t\t\t\t&__content {\n\t\t\t\t\tpadding: get(\"padding-inner\", $definitions);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t@each $variant, $definitions in $accordion-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__header {\n\t\t\t\t\tbackground-color: get(\"background\", $definitions);\n\t\t\t\t\tcolor: get(\"color\", $definitions);\n\t\t\t\t\t&::before {\n\t\t\t\t\t\tbackground-color: get(\"separator\", $definitions);\n\t\t\t\t\t}\n\t\t\t\t\t@include hover() {\n\t\t\t\t\t\tbackground-color: get(\"background-hover\", $definitions);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// STATES\n\t\t\t@include parameter(\"disabled\") {\n\t\t\t\t#{$class} {\n\t\t\t\t\t&__header {\n\t\t\t\t\t\tcolor: get(\"disabled-color\", $definitions);\n\t\t\t\t\t\t@include hover() {\n\t\t\t\t\t\t\tbackground: transparent;\n\t\t\t\t\t\t\tcursor: not-allowed;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($until: md) {\n\t\t&__title {\n\t\t\tflex-wrap: wrap;\n\t\t}\n\t\t&__label {\n\t\t\tflex: 0 0 auto;\n\t\t}\n\t}\n}\n","import { Component, Element, h, Prop, State, Watch, Host, Method, Event, EventEmitter } from \"@stencil/core\"\nimport { govErrorLog } from \"../../helpers/Log/gov.log\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport {\n\tAccordionSizeType,\n\tAccordionSizes,\n\tAccordionItemClass,\n\tAccordionVariantType,\n\tAccordionVariants, AccordionClass,\n} from \"./constants\"\nimport { createID } from \"../../utils/string.utils\"\nimport { booleanString, toBoolAttrIfDefined } from \"../../helpers/Dom/template\"\nimport { AccordionItemEvent } from \"./gov-accordion.types\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\n\n@Component({\n\ttag: \"gov-accordion-item\",\n\tstyleUrl: \"gov-accordion-item.scss\",\n})\nexport class GovAccordionItem {\n\tprivate readonly triggerId: string\n\tprivate readonly contentId: string\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.triggerId = createID(\"GovAccordionItem\")\n\t\tthis.contentId = createID(\"GovAccordionContent\")\n\t}\n\n\t@Element() readonly host: HTMLGovAccordionItemElement\n\t@State() isExpandedState: boolean\n\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop({mutable: true}) variant?: AccordionVariantType = \"primary\"\n\t/**\n\t * Custom accordion item identifier. Otherwise, it will be generated\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Accordion’s size.\n\t */\n\t@Prop({mutable: true}) size?: AccordionSizeType\n\t/**\n\t * Item name of the accordion\n\t */\n\t@Prop() readonly label: string\n\t/**\n\t * Item annotation of the accordion\n\t */\n\t@Prop() readonly annotation: string\n\t/**\n\t * Makes the button component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Defines whether the accordion is open or closed by default\n\t */\n\t@Prop({ attribute: \"is-expanded\" }) readonly isExpanded: boolean = false\n\t/**\n\t * Used to change the HTML tag in the accordion trigger for correct semantic structure\n\t */\n\t@Prop({ attribute: \"trigger-tag\" }) readonly triggerTag: string = \"h3\"\n\t/**\n\t * To remove the main underline of an item\n\t */\n\t@Prop({ attribute: \"no-border\" }) readonly noBorder: boolean = false\n\t/**\n\t * Called when the accordion state changes\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<AccordionItemEvent>\n\n\t@Watch(\"label\")\n\tvalidateLabel(newValue: string): void {\n\t\tif (!newValue) {\n\t\t\tgovErrorLog(`[${AccordionItemClass.root}]: Parameter label is required.`)\n\t\t}\n\t}\n\n\t@Watch(\"triggerTag\")\n\tvalidateTriggerTag(newValue: string): void {\n\t\tconst validTags = [\"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"span\"]\n\t\tif (newValue) {\n\t\t\tif (!validTags.includes(newValue)) {\n\t\t\t\tgovErrorLog(`[${AccordionItemClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(AccordionSizes, newValue, AccordionItemClass.root)\n\t}\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(AccordionVariants, newValue, AccordionItemClass.root)\n\t}\n\n\tprivate emmitChange(): void {\n\t\tthis.govChange.emit({\n\t\t\topen: this.isExpandedState,\n\t\t\tcomponent: AccordionItemClass.root,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.isExpandedState = this.isExpanded\n\t\tthis.getPropsFromParents()\n\n\t\tthis.validateLabel(this.label)\n\t\tthis.validateTriggerTag(this.triggerTag)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateVariant(this.variant)\n\n\t}\n\n\tgetPropsFromParents() {\n\t\tconst accordion = this.h.getParent(AccordionClass.root)\n\t\tif(accordion) {\n\t\t\tthis.size = accordion.getAttribute('size') as AccordionSizeType\n\t\t\tthis.variant = accordion.getAttribute('variant') as AccordionVariantType\n\t\t}\n\t}\n\n\trender() {\n\t\tconst triggerId = this.identifier || this.triggerId\n\t\tconst contentId = this.contentId\n\t\tconst { isExpandedState, label } = this\n\t\tconst TriggerTag = this.triggerTag\n\n\t\treturn (\n\t\t\t<Host class={this.h.classes(AccordionItemClass.root)} no-border={this.noBorder} size={this.size} variant={this.variant} role=\"listitem\">\n\t\t\t\t<button\n\t\t\t\t\tid={triggerId}\n\t\t\t\t\tclass={AccordionItemClass.header}\n\t\t\t\t\taria-expanded={booleanString(isExpandedState)}\n\t\t\t\t\taria-controls={contentId}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\tonClick={(e: Event) => {\n\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\tthis.toggle().finally()\n\t\t\t\t\t}}>\n\t\t\t\t\t<TriggerTag class={AccordionItemClass.title}>\n\t\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t\t<span class={AccordionItemClass.icon}>\n\t\t\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t<span class={AccordionItemClass.name}>\n\t\t\t\t\t\t\t<span class={AccordionItemClass.label}>{label}</span>\n\t\t\t\t\t\t\t{this.annotation && <span class={AccordionItemClass.annot}>{this.annotation}</span>}\n\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t{this.h.hasSlot(\"suffix\") && (\n\t\t\t\t\t\t\t<span class={AccordionItemClass.suffix}>\n\t\t\t\t\t\t\t\t<slot name=\"suffix\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</TriggerTag>\n\n\t\t\t\t\t<gov-icon class={AccordionItemClass.arrow} name=\"chevron-down\"></gov-icon>\n\t\t\t\t</button>\n\t\t\t\t<div\n\t\t\t\t\tclass={AccordionItemClass.content}\n\t\t\t\t\tid={contentId}\n\t\t\t\t\taria-hidden={booleanString(!isExpandedState)}\n\t\t\t\t\thidden={!isExpandedState}\n\t\t\t\t\taria-labelledby={triggerId}>\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Opening the accordion\n\t */\n\t@Method()\n\tasync open(): Promise<void> {\n\t\tthis.isExpandedState = true\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Closing the accordion\n\t */\n\t@Method()\n\tasync close(): Promise<void> {\n\t\tthis.isExpandedState = false\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Accordion switch\n\t */\n\t@Method()\n\tasync toggle(): Promise<void> {\n\t\tthis.isExpandedState = !this.isExpandedState\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync currentState(): Promise<boolean> {\n\t\treturn this.isExpandedState\n\t}\n}\n"]}
|
package/dist/globals.d.ts
DELETED
|
File without changes
|