@abgov/react-components 4.0.0-alpha.106 → 4.0.0-alpha.108
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/index.d.ts +1 -0
- package/lib/accordion/accordion.d.ts +27 -0
- package/package.json +1 -1
- package/react-components.esm.js +523 -76
- package/react-components.umd.js +521 -74
package/react-components.umd.js
CHANGED
|
@@ -1065,6 +1065,476 @@
|
|
|
1065
1065
|
|
|
1066
1066
|
};
|
|
1067
1067
|
}
|
|
1068
|
+
|
|
1069
|
+
function calculateMargin(mt, mr, mb, ml) {
|
|
1070
|
+
return [mt && `margin-top:var(--goa-space-${mt});`, mr && `margin-right:var(--goa-space-${mr});`, mb && `margin-bottom:var(--goa-space-${mb});`, ml && `margin-left:var(--goa-space-${ml});`].join(" ");
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
function injectCss(el, rootSelector, css, media) {
|
|
1074
|
+
const style = document.createElement("style");
|
|
1075
|
+
|
|
1076
|
+
const _css = Object.entries(css).map(entry => `${entry[0]}: ${entry[1]};`).join(" ");
|
|
1077
|
+
|
|
1078
|
+
if (media) {
|
|
1079
|
+
style.innerHTML = `@media (${media}) { ${rootSelector} {${_css}} }`;
|
|
1080
|
+
} else {
|
|
1081
|
+
style.innerHTML = `${rootSelector} {${_css}}`;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
el.appendChild(style);
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
function toBoolean(value) {
|
|
1088
|
+
if (value === "false") {
|
|
1089
|
+
return false;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
if (value === "") {
|
|
1093
|
+
return true;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
return !!value;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
function fromBoolean(value) {
|
|
1100
|
+
return value ? "true" : "false";
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
function validateRequired(componentName, props) {
|
|
1104
|
+
Object.entries(props).forEach(prop => {
|
|
1105
|
+
if (!prop[1]) {
|
|
1106
|
+
console.warn(`${componentName}: ${prop[0]} is required`);
|
|
1107
|
+
}
|
|
1108
|
+
});
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
function typeValidator(message, values, required = false) {
|
|
1112
|
+
const validator = value => {
|
|
1113
|
+
if (!required && !value) {
|
|
1114
|
+
return;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
if (!values.includes(value)) {
|
|
1118
|
+
console.error(`[${value}] is an invalid ${message.toLowerCase()}`);
|
|
1119
|
+
}
|
|
1120
|
+
};
|
|
1121
|
+
|
|
1122
|
+
return [values, validator];
|
|
1123
|
+
}
|
|
1124
|
+
/* libs/web-components/src/components/accordion/Accordion.svelte generated by Svelte v3.51.0 */
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
function create_fragment$H(ctx) {
|
|
1128
|
+
let div3;
|
|
1129
|
+
let details;
|
|
1130
|
+
let summary;
|
|
1131
|
+
let goa_icon;
|
|
1132
|
+
let goa_icon_fillcolor_value;
|
|
1133
|
+
let t0;
|
|
1134
|
+
let div1;
|
|
1135
|
+
let span0;
|
|
1136
|
+
let t1;
|
|
1137
|
+
let span0_class_value;
|
|
1138
|
+
let span0_data_testid_value;
|
|
1139
|
+
let t2;
|
|
1140
|
+
let span1;
|
|
1141
|
+
let t3;
|
|
1142
|
+
let t4;
|
|
1143
|
+
let div0;
|
|
1144
|
+
let summary_class_value;
|
|
1145
|
+
let t5;
|
|
1146
|
+
let div2;
|
|
1147
|
+
let div3_style_value;
|
|
1148
|
+
let mounted;
|
|
1149
|
+
let dispose;
|
|
1150
|
+
return {
|
|
1151
|
+
c() {
|
|
1152
|
+
div3 = element("div");
|
|
1153
|
+
details = element("details");
|
|
1154
|
+
summary = element("summary");
|
|
1155
|
+
goa_icon = element("goa-icon");
|
|
1156
|
+
t0 = space();
|
|
1157
|
+
div1 = element("div");
|
|
1158
|
+
span0 = element("span");
|
|
1159
|
+
t1 = text(
|
|
1160
|
+
/*heading*/
|
|
1161
|
+
ctx[0]);
|
|
1162
|
+
t2 = space();
|
|
1163
|
+
span1 = element("span");
|
|
1164
|
+
t3 = text(
|
|
1165
|
+
/*secondarytext*/
|
|
1166
|
+
ctx[1]);
|
|
1167
|
+
t4 = space();
|
|
1168
|
+
div0 = element("div");
|
|
1169
|
+
div0.innerHTML = `<slot name="headingcontent"></slot>`;
|
|
1170
|
+
t5 = space();
|
|
1171
|
+
div2 = element("div");
|
|
1172
|
+
div2.innerHTML = `<slot></slot>`;
|
|
1173
|
+
this.c = noop;
|
|
1174
|
+
set_custom_element_data(goa_icon, "type", "chevron-forward");
|
|
1175
|
+
set_custom_element_data(goa_icon, "fillcolor", goa_icon_fillcolor_value =
|
|
1176
|
+
/*_hovering*/
|
|
1177
|
+
ctx[8] ? "var(--goa-color-interactive-hover)" : "var(--goa-color-interactive-default)");
|
|
1178
|
+
attr(span0, "class", span0_class_value = "heading heading-" +
|
|
1179
|
+
/*headingsize*/
|
|
1180
|
+
ctx[2]);
|
|
1181
|
+
attr(span0, "data-testid", span0_data_testid_value = `${
|
|
1182
|
+
/*testid*/
|
|
1183
|
+
ctx[3]}-heading`);
|
|
1184
|
+
attr(span1, "class", "secondary-text");
|
|
1185
|
+
attr(div0, "class", "heading-content");
|
|
1186
|
+
attr(div1, "class", "title");
|
|
1187
|
+
attr(summary, "class", summary_class_value = `container-${
|
|
1188
|
+
/*headingsize*/
|
|
1189
|
+
ctx[2]}`);
|
|
1190
|
+
attr(div2, "class", "content");
|
|
1191
|
+
details.open =
|
|
1192
|
+
/*isOpen*/
|
|
1193
|
+
ctx[9];
|
|
1194
|
+
attr(div3, "style", div3_style_value = calculateMargin(
|
|
1195
|
+
/*mt*/
|
|
1196
|
+
ctx[4],
|
|
1197
|
+
/*mr*/
|
|
1198
|
+
ctx[5],
|
|
1199
|
+
/*mb*/
|
|
1200
|
+
ctx[6],
|
|
1201
|
+
/*ml*/
|
|
1202
|
+
ctx[7]));
|
|
1203
|
+
attr(div3, "class", `
|
|
1204
|
+
goa-accordion
|
|
1205
|
+
`);
|
|
1206
|
+
attr(div3, "data-testid",
|
|
1207
|
+
/*testid*/
|
|
1208
|
+
ctx[3]);
|
|
1209
|
+
},
|
|
1210
|
+
|
|
1211
|
+
m(target, anchor) {
|
|
1212
|
+
insert(target, div3, anchor);
|
|
1213
|
+
append(div3, details);
|
|
1214
|
+
append(details, summary);
|
|
1215
|
+
append(summary, goa_icon);
|
|
1216
|
+
append(summary, t0);
|
|
1217
|
+
append(summary, div1);
|
|
1218
|
+
append(div1, span0);
|
|
1219
|
+
append(span0, t1);
|
|
1220
|
+
append(div1, t2);
|
|
1221
|
+
append(div1, span1);
|
|
1222
|
+
append(span1, t3);
|
|
1223
|
+
append(div1, t4);
|
|
1224
|
+
append(div1, div0);
|
|
1225
|
+
append(details, t5);
|
|
1226
|
+
append(details, div2);
|
|
1227
|
+
|
|
1228
|
+
if (!mounted) {
|
|
1229
|
+
dispose = [listen(summary, "mouseover",
|
|
1230
|
+
/*mouseover_handler*/
|
|
1231
|
+
ctx[11]), listen(summary, "mouseout",
|
|
1232
|
+
/*mouseout_handler*/
|
|
1233
|
+
ctx[12]), listen(summary, "focus",
|
|
1234
|
+
/*focus_handler*/
|
|
1235
|
+
ctx[13]), listen(summary, "blur",
|
|
1236
|
+
/*blur_handler*/
|
|
1237
|
+
ctx[14])];
|
|
1238
|
+
mounted = true;
|
|
1239
|
+
}
|
|
1240
|
+
},
|
|
1241
|
+
|
|
1242
|
+
p(ctx, [dirty]) {
|
|
1243
|
+
if (dirty &
|
|
1244
|
+
/*_hovering*/
|
|
1245
|
+
256 && goa_icon_fillcolor_value !== (goa_icon_fillcolor_value =
|
|
1246
|
+
/*_hovering*/
|
|
1247
|
+
ctx[8] ? "var(--goa-color-interactive-hover)" : "var(--goa-color-interactive-default)")) {
|
|
1248
|
+
set_custom_element_data(goa_icon, "fillcolor", goa_icon_fillcolor_value);
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
if (dirty &
|
|
1252
|
+
/*heading*/
|
|
1253
|
+
1) set_data(t1,
|
|
1254
|
+
/*heading*/
|
|
1255
|
+
ctx[0]);
|
|
1256
|
+
|
|
1257
|
+
if (dirty &
|
|
1258
|
+
/*headingsize*/
|
|
1259
|
+
4 && span0_class_value !== (span0_class_value = "heading heading-" +
|
|
1260
|
+
/*headingsize*/
|
|
1261
|
+
ctx[2])) {
|
|
1262
|
+
attr(span0, "class", span0_class_value);
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
if (dirty &
|
|
1266
|
+
/*testid*/
|
|
1267
|
+
8 && span0_data_testid_value !== (span0_data_testid_value = `${
|
|
1268
|
+
/*testid*/
|
|
1269
|
+
ctx[3]}-heading`)) {
|
|
1270
|
+
attr(span0, "data-testid", span0_data_testid_value);
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
if (dirty &
|
|
1274
|
+
/*secondarytext*/
|
|
1275
|
+
2) set_data(t3,
|
|
1276
|
+
/*secondarytext*/
|
|
1277
|
+
ctx[1]);
|
|
1278
|
+
|
|
1279
|
+
if (dirty &
|
|
1280
|
+
/*headingsize*/
|
|
1281
|
+
4 && summary_class_value !== (summary_class_value = `container-${
|
|
1282
|
+
/*headingsize*/
|
|
1283
|
+
ctx[2]}`)) {
|
|
1284
|
+
attr(summary, "class", summary_class_value);
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
if (dirty &
|
|
1288
|
+
/*isOpen*/
|
|
1289
|
+
512) {
|
|
1290
|
+
details.open =
|
|
1291
|
+
/*isOpen*/
|
|
1292
|
+
ctx[9];
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
if (dirty &
|
|
1296
|
+
/*mt, mr, mb, ml*/
|
|
1297
|
+
240 && div3_style_value !== (div3_style_value = calculateMargin(
|
|
1298
|
+
/*mt*/
|
|
1299
|
+
ctx[4],
|
|
1300
|
+
/*mr*/
|
|
1301
|
+
ctx[5],
|
|
1302
|
+
/*mb*/
|
|
1303
|
+
ctx[6],
|
|
1304
|
+
/*ml*/
|
|
1305
|
+
ctx[7]))) {
|
|
1306
|
+
attr(div3, "style", div3_style_value);
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
if (dirty &
|
|
1310
|
+
/*testid*/
|
|
1311
|
+
8) {
|
|
1312
|
+
attr(div3, "data-testid",
|
|
1313
|
+
/*testid*/
|
|
1314
|
+
ctx[3]);
|
|
1315
|
+
}
|
|
1316
|
+
},
|
|
1317
|
+
|
|
1318
|
+
i: noop,
|
|
1319
|
+
o: noop,
|
|
1320
|
+
|
|
1321
|
+
d(detaching) {
|
|
1322
|
+
if (detaching) detach(div3);
|
|
1323
|
+
mounted = false;
|
|
1324
|
+
run_all(dispose);
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
};
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
function instance$B($$self, $$props, $$invalidate) {
|
|
1331
|
+
let isOpen;
|
|
1332
|
+
const [HeadingSizes, validateHeadingSize] = typeValidator("Accordion heading size", ["small", "medium"]);
|
|
1333
|
+
let {
|
|
1334
|
+
open = "false"
|
|
1335
|
+
} = $$props;
|
|
1336
|
+
let {
|
|
1337
|
+
heading = ""
|
|
1338
|
+
} = $$props;
|
|
1339
|
+
let {
|
|
1340
|
+
secondarytext = ""
|
|
1341
|
+
} = $$props;
|
|
1342
|
+
let {
|
|
1343
|
+
headingsize = "small"
|
|
1344
|
+
} = $$props;
|
|
1345
|
+
let {
|
|
1346
|
+
testid = ""
|
|
1347
|
+
} = $$props;
|
|
1348
|
+
let {
|
|
1349
|
+
mt = null
|
|
1350
|
+
} = $$props;
|
|
1351
|
+
let {
|
|
1352
|
+
mr = null
|
|
1353
|
+
} = $$props;
|
|
1354
|
+
let {
|
|
1355
|
+
mb = "xs"
|
|
1356
|
+
} = $$props;
|
|
1357
|
+
let {
|
|
1358
|
+
ml = null
|
|
1359
|
+
} = $$props;
|
|
1360
|
+
let _hovering = false;
|
|
1361
|
+
onMount(() => {
|
|
1362
|
+
validateRequired("GoAAccordion", {
|
|
1363
|
+
heading
|
|
1364
|
+
});
|
|
1365
|
+
validateHeadingSize(headingsize);
|
|
1366
|
+
});
|
|
1367
|
+
|
|
1368
|
+
const mouseover_handler = () => $$invalidate(8, _hovering = true);
|
|
1369
|
+
|
|
1370
|
+
const mouseout_handler = () => $$invalidate(8, _hovering = false);
|
|
1371
|
+
|
|
1372
|
+
const focus_handler = () => $$invalidate(8, _hovering = false);
|
|
1373
|
+
|
|
1374
|
+
const blur_handler = () => $$invalidate(8, _hovering = false);
|
|
1375
|
+
|
|
1376
|
+
$$self.$$set = $$props => {
|
|
1377
|
+
if ('open' in $$props) $$invalidate(10, open = $$props.open);
|
|
1378
|
+
if ('heading' in $$props) $$invalidate(0, heading = $$props.heading);
|
|
1379
|
+
if ('secondarytext' in $$props) $$invalidate(1, secondarytext = $$props.secondarytext);
|
|
1380
|
+
if ('headingsize' in $$props) $$invalidate(2, headingsize = $$props.headingsize);
|
|
1381
|
+
if ('testid' in $$props) $$invalidate(3, testid = $$props.testid);
|
|
1382
|
+
if ('mt' in $$props) $$invalidate(4, mt = $$props.mt);
|
|
1383
|
+
if ('mr' in $$props) $$invalidate(5, mr = $$props.mr);
|
|
1384
|
+
if ('mb' in $$props) $$invalidate(6, mb = $$props.mb);
|
|
1385
|
+
if ('ml' in $$props) $$invalidate(7, ml = $$props.ml);
|
|
1386
|
+
};
|
|
1387
|
+
|
|
1388
|
+
$$self.$$.update = () => {
|
|
1389
|
+
if ($$self.$$.dirty &
|
|
1390
|
+
/*open*/
|
|
1391
|
+
1024) {
|
|
1392
|
+
$$invalidate(9, isOpen = toBoolean(open));
|
|
1393
|
+
}
|
|
1394
|
+
};
|
|
1395
|
+
|
|
1396
|
+
return [heading, secondarytext, headingsize, testid, mt, mr, mb, ml, _hovering, isOpen, open, mouseover_handler, mouseout_handler, focus_handler, blur_handler];
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
class Accordion extends SvelteElement {
|
|
1400
|
+
constructor(options) {
|
|
1401
|
+
super();
|
|
1402
|
+
this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--goa-font-family-sans);font-size:var(--goa-font-size-4)}.goa-accordion,.goa-accordion *{box-sizing:border-box}summary{min-height:3.5rem;border-width:var(--goa-border-width-s);border-style:solid;border-radius:var(--goa-border-radius-m);background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200);color:var(--goa-color-text-default);;;padding:0.875rem 1rem 0 0;cursor:pointer;list-style:none;display:flex;align-items:flex-start;position:relative}summary.container-medium{min-height:4rem}summary::marker,summary::-webkit-details-marker{display:none}summary .title{display:flex;align-items:center;flex:1}.title span{padding-bottom:var(--goa-space-3xs, 0)}summary .heading{font:var(--goa-typography-heading-s);padding-right:1rem}summary .secondary-text{font:var(--goa-typography-body-s);line-height:1.5rem;padding-right:1rem}summary .heading-content{flex:1
|
|
1403
|
+
}.content{border-bottom:var(--goa-border-width-s) solid var(--goa-color-greyscale-200);border-left:var(--goa-border-width-s) solid var(--goa-color-greyscale-200);border-right:var(--goa-border-width-s) solid var(--goa-color-greyscale-200);border-bottom-left-radius:var(--goa-border-radius-m);border-bottom-right-radius:var(--goa-border-radius-m);padding:1.5rem;padding-left:3.5rem;padding-right:2rem}summary goa-icon{padding:0.125rem 1rem}summary.container-medium goa-icon{padding:0.375rem 1rem}details[open] goa-icon{transform:rotate(90deg)}details[open] summary{border-bottom-left-radius:var(--goa-border-radius-none);border-bottom-right-radius:var(--goa-border-radius-none)}summary:hover{background-color:var(--goa-color-greyscale-200)}summary:focus,summary:active{background-color:var(--goa-color-greyscale-100);outline:none}summary:active::before,summary:focus::before{content:"";position:absolute;top:-1px;right:-1px;bottom:-1px;left:-1px;border:var(--goa-border-width-l) solid var(--goa-color-interactive-focus);border-radius:4px}summary .heading.heading-medium{line-height:2rem;font:var(--goa-typography-heading-m)}@media(max-width: 640px){summary{align-items:flex-start}summary .title{flex-direction:column;align-items:flex-start}}</style>`;
|
|
1404
|
+
init(this, {
|
|
1405
|
+
target: this.shadowRoot,
|
|
1406
|
+
props: attribute_to_object(this.attributes),
|
|
1407
|
+
customElement: true
|
|
1408
|
+
}, instance$B, create_fragment$H, safe_not_equal, {
|
|
1409
|
+
open: 10,
|
|
1410
|
+
heading: 0,
|
|
1411
|
+
secondarytext: 1,
|
|
1412
|
+
headingsize: 2,
|
|
1413
|
+
testid: 3,
|
|
1414
|
+
mt: 4,
|
|
1415
|
+
mr: 5,
|
|
1416
|
+
mb: 6,
|
|
1417
|
+
ml: 7
|
|
1418
|
+
}, null);
|
|
1419
|
+
|
|
1420
|
+
if (options) {
|
|
1421
|
+
if (options.target) {
|
|
1422
|
+
insert(options.target, this, options.anchor);
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
if (options.props) {
|
|
1426
|
+
this.$set(options.props);
|
|
1427
|
+
flush();
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
static get observedAttributes() {
|
|
1433
|
+
return ["open", "heading", "secondarytext", "headingsize", "testid", "mt", "mr", "mb", "ml"];
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
get open() {
|
|
1437
|
+
return this.$$.ctx[10];
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
set open(open) {
|
|
1441
|
+
this.$$set({
|
|
1442
|
+
open
|
|
1443
|
+
});
|
|
1444
|
+
flush();
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
get heading() {
|
|
1448
|
+
return this.$$.ctx[0];
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
set heading(heading) {
|
|
1452
|
+
this.$$set({
|
|
1453
|
+
heading
|
|
1454
|
+
});
|
|
1455
|
+
flush();
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
get secondarytext() {
|
|
1459
|
+
return this.$$.ctx[1];
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
set secondarytext(secondarytext) {
|
|
1463
|
+
this.$$set({
|
|
1464
|
+
secondarytext
|
|
1465
|
+
});
|
|
1466
|
+
flush();
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
get headingsize() {
|
|
1470
|
+
return this.$$.ctx[2];
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
set headingsize(headingsize) {
|
|
1474
|
+
this.$$set({
|
|
1475
|
+
headingsize
|
|
1476
|
+
});
|
|
1477
|
+
flush();
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
get testid() {
|
|
1481
|
+
return this.$$.ctx[3];
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
set testid(testid) {
|
|
1485
|
+
this.$$set({
|
|
1486
|
+
testid
|
|
1487
|
+
});
|
|
1488
|
+
flush();
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
get mt() {
|
|
1492
|
+
return this.$$.ctx[4];
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
set mt(mt) {
|
|
1496
|
+
this.$$set({
|
|
1497
|
+
mt
|
|
1498
|
+
});
|
|
1499
|
+
flush();
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
get mr() {
|
|
1503
|
+
return this.$$.ctx[5];
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
set mr(mr) {
|
|
1507
|
+
this.$$set({
|
|
1508
|
+
mr
|
|
1509
|
+
});
|
|
1510
|
+
flush();
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
get mb() {
|
|
1514
|
+
return this.$$.ctx[6];
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
set mb(mb) {
|
|
1518
|
+
this.$$set({
|
|
1519
|
+
mb
|
|
1520
|
+
});
|
|
1521
|
+
flush();
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
get ml() {
|
|
1525
|
+
return this.$$.ctx[7];
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
set ml(ml) {
|
|
1529
|
+
this.$$set({
|
|
1530
|
+
ml
|
|
1531
|
+
});
|
|
1532
|
+
flush();
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
customElements.define("goa-accordion", Accordion);
|
|
1068
1538
|
/* libs/web-components/src/components/app-header/AppHeader.svelte generated by Svelte v3.51.0 */
|
|
1069
1539
|
|
|
1070
1540
|
function create_else_block$4(ctx) {
|
|
@@ -1377,65 +1847,8 @@
|
|
|
1377
1847
|
}
|
|
1378
1848
|
|
|
1379
1849
|
customElements.define("goa-app-header", AppHeader);
|
|
1380
|
-
|
|
1381
|
-
function calculateMargin(mt, mr, mb, ml) {
|
|
1382
|
-
return [mt && `margin-top:var(--goa-space-${mt});`, mr && `margin-right:var(--goa-space-${mr});`, mb && `margin-bottom:var(--goa-space-${mb});`, ml && `margin-left:var(--goa-space-${ml});`].join(" ");
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1385
|
-
function injectCss(el, rootSelector, css, media) {
|
|
1386
|
-
const style = document.createElement("style");
|
|
1387
|
-
|
|
1388
|
-
const _css = Object.entries(css).map(entry => `${entry[0]}: ${entry[1]};`).join(" ");
|
|
1389
|
-
|
|
1390
|
-
if (media) {
|
|
1391
|
-
style.innerHTML = `@media (${media}) { ${rootSelector} {${_css}} }`;
|
|
1392
|
-
} else {
|
|
1393
|
-
style.innerHTML = `${rootSelector} {${_css}}`;
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
|
-
el.appendChild(style);
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
function toBoolean(value) {
|
|
1400
|
-
if (value === "false") {
|
|
1401
|
-
return false;
|
|
1402
|
-
}
|
|
1403
|
-
|
|
1404
|
-
if (value === "") {
|
|
1405
|
-
return true;
|
|
1406
|
-
}
|
|
1407
|
-
|
|
1408
|
-
return !!value;
|
|
1409
|
-
}
|
|
1410
|
-
|
|
1411
|
-
function fromBoolean(value) {
|
|
1412
|
-
return value ? "true" : "false";
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
function validateRequired(componentName, props) {
|
|
1416
|
-
Object.entries(props).forEach(prop => {
|
|
1417
|
-
if (!prop[1]) {
|
|
1418
|
-
console.warn(`${componentName}: ${prop[0]} is required`);
|
|
1419
|
-
}
|
|
1420
|
-
});
|
|
1421
|
-
}
|
|
1422
|
-
|
|
1423
|
-
function typeValidator(message, values, required = false) {
|
|
1424
|
-
const validator = value => {
|
|
1425
|
-
if (!required && !value) {
|
|
1426
|
-
return;
|
|
1427
|
-
}
|
|
1428
|
-
|
|
1429
|
-
if (!values.includes(value)) {
|
|
1430
|
-
console.error(`[${value}] is an invalid ${message.toLowerCase()}`);
|
|
1431
|
-
}
|
|
1432
|
-
};
|
|
1433
|
-
|
|
1434
|
-
return [values, validator];
|
|
1435
|
-
}
|
|
1436
1850
|
/* libs/web-components/src/components/badge/Badge.svelte generated by Svelte v3.51.0 */
|
|
1437
1851
|
|
|
1438
|
-
|
|
1439
1852
|
function create_else_block$3(ctx) {
|
|
1440
1853
|
let div;
|
|
1441
1854
|
return {
|
|
@@ -7782,8 +8195,6 @@
|
|
|
7782
8195
|
}
|
|
7783
8196
|
|
|
7784
8197
|
function create_fragment$n(ctx) {
|
|
7785
|
-
var _ctx$;
|
|
7786
|
-
|
|
7787
8198
|
let div5;
|
|
7788
8199
|
let div4;
|
|
7789
8200
|
let div0;
|
|
@@ -7799,11 +8210,11 @@
|
|
|
7799
8210
|
let div5_style_value;
|
|
7800
8211
|
let if_block =
|
|
7801
8212
|
/*navLinks*/
|
|
7802
|
-
|
|
8213
|
+
ctx[2] &&
|
|
8214
|
+
/*navLinks*/
|
|
8215
|
+
ctx[2].length > 0 && create_if_block$a();
|
|
7803
8216
|
return {
|
|
7804
8217
|
c() {
|
|
7805
|
-
var _ctx$2, _ctx$3;
|
|
7806
|
-
|
|
7807
8218
|
div5 = element("div");
|
|
7808
8219
|
div4 = element("div");
|
|
7809
8220
|
div0 = element("div");
|
|
@@ -7832,11 +8243,15 @@
|
|
|
7832
8243
|
attr(div2, "class", "abgov");
|
|
7833
8244
|
toggle_class(div2, "with-meta-links",
|
|
7834
8245
|
/*metaLinks*/
|
|
7835
|
-
|
|
8246
|
+
ctx[3] &&
|
|
8247
|
+
/*metaLinks*/
|
|
8248
|
+
ctx[3].length > 0);
|
|
7836
8249
|
attr(div3, "class", "meta-section");
|
|
7837
8250
|
toggle_class(div3, "with-meta-links",
|
|
7838
8251
|
/*metaLinks*/
|
|
7839
|
-
|
|
8252
|
+
ctx[3] &&
|
|
8253
|
+
/*metaLinks*/
|
|
8254
|
+
ctx[3].length > 0);
|
|
7840
8255
|
attr(div4, "class", "content");
|
|
7841
8256
|
attr(div5, "class", "app-footer");
|
|
7842
8257
|
attr(div5, "style", div5_style_value = `--max-content-width: ${
|
|
@@ -7864,11 +8279,11 @@
|
|
|
7864
8279
|
},
|
|
7865
8280
|
|
|
7866
8281
|
p(ctx, [dirty]) {
|
|
7867
|
-
var _ctx$4;
|
|
7868
|
-
|
|
7869
8282
|
if (
|
|
7870
8283
|
/*navLinks*/
|
|
7871
|
-
|
|
8284
|
+
ctx[2] &&
|
|
8285
|
+
/*navLinks*/
|
|
8286
|
+
ctx[2].length > 0) {
|
|
7872
8287
|
if (if_block) ;else {
|
|
7873
8288
|
if_block = create_if_block$a();
|
|
7874
8289
|
if_block.c();
|
|
@@ -7882,21 +8297,21 @@
|
|
|
7882
8297
|
if (dirty &
|
|
7883
8298
|
/*metaLinks*/
|
|
7884
8299
|
8) {
|
|
7885
|
-
var _ctx$5;
|
|
7886
|
-
|
|
7887
8300
|
toggle_class(div2, "with-meta-links",
|
|
7888
8301
|
/*metaLinks*/
|
|
7889
|
-
|
|
8302
|
+
ctx[3] &&
|
|
8303
|
+
/*metaLinks*/
|
|
8304
|
+
ctx[3].length > 0);
|
|
7890
8305
|
}
|
|
7891
8306
|
|
|
7892
8307
|
if (dirty &
|
|
7893
8308
|
/*metaLinks*/
|
|
7894
8309
|
8) {
|
|
7895
|
-
var _ctx$6;
|
|
7896
|
-
|
|
7897
8310
|
toggle_class(div3, "with-meta-links",
|
|
7898
8311
|
/*metaLinks*/
|
|
7899
|
-
|
|
8312
|
+
ctx[3] &&
|
|
8313
|
+
/*metaLinks*/
|
|
8314
|
+
ctx[3].length > 0);
|
|
7900
8315
|
}
|
|
7901
8316
|
|
|
7902
8317
|
if (dirty &
|
|
@@ -11156,7 +11571,7 @@
|
|
|
11156
11571
|
class Input extends SvelteElement {
|
|
11157
11572
|
constructor(options) {
|
|
11158
11573
|
super();
|
|
11159
|
-
this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box}.container{position:relative;width:100%;display:inline-block}@media(min-width: 640px){.container{width:var(--width)}}.goa-input,.goa-input *{box-sizing:border-box;line-height:normal}.goa-input{box-sizing:border-box;outline:none;transition:box-shadow 0.1s ease-in;border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);display:inline-flex;align-items:stretch;vertical-align:middle;min-width:100%;background-color:var(--color-white)}.goa-input:hover{border-color:var(--goa-color-interactive-hover)}.goa-input:active,.goa-input:focus,.goa-input:focus-within{box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}.goa-input.type--range{border:none}.goa-input.type--range:active,.goa-input.type--range:focus,.goa-input.type--range:focus-within{box-shadow:none}.goa-input-leading-icon{margin-left:0.5rem}.goa-input-trailing-icon{margin-right:0.5rem}input{display:inline-block;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);padding:var(--goa-space-xs);line-height:calc(40px - calc(var(--goa-space-xs) * 2));background-color:transparent;width:100%;flex:1 1 auto;font-family:var(--goa-font-family-sans)}input[readonly]{cursor:pointer}.goa-input-leading-icon+input{padding-left:0.5rem}input,input:focus,input:hover,input:active{outline:none;border:none}.goa-input--disabled,.goa-input--disabled:hover,.goa-input--disabled:active,.goa-input--disabled:focus{background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200);cursor:default;box-shadow:none}.goa-input--disabled input,.goa-input--disabled input:hover,.goa-input--disabled input:active,.goa-input--disabled input:focus{color:var(--goa-color-text-secondary)}.goa-input--disabled input:hover{cursor:default !important}.prefix,.suffix,.leading-content ::slotted(div),.trailing-content ::slotted(div){background-color:var(--goa-color-greyscale-100);padding:0 0.75rem;display:flex;align-items:center}.leading-content ::slotted(div),.trailing-content ::slotted(div){padding:0.5rem 0.75rem}.prefix,.leading-content ::slotted(div){border-top-left-radius:var(--goa-border-radius-m);border-bottom-left-radius:var(--goa-border-radius-m);border-right:1px solid var(--goa-color-greyscale-700)}.suffix,.trailing-content ::slotted(div){border-top-right-radius:var(--goa-border-radius-m);border-bottom-right-radius:var(--goa-border-radius-m);border-left:1px solid var(--goa-color-greyscale-700)}.goa-input--disabled .prefix,.goa-input--disabled .leading-content ::slotted(div){border-right:1px solid var(--goa-color-greyscale-200)}.goa-input--disabled .suffix,.goa-input--disabled .trailing-content ::slotted(div){border-left:1px solid var(--goa-color-greyscale-200)}input.input--goa{display:block;border:none;flex:1 1 auto}.variant--bare{border:none}.variant--bare:focus,.variant--bare:active,.variant--bare:focus-within{box-shadow:none}.error:hover,.error:focus,.error{border:2px solid var(--goa-color-interactive-error)}input[type="search" i]:enabled:read-write:-webkit-any(:focus, :hover)::-webkit-search-cancel-button{position:relative;right:var(--search-icon-offset);cursor:pointer;-webkit-appearance:none;height:1.2rem;width:1.2rem;background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="%23333" d="M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z"/></svg>')
|
|
11574
|
+
this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box}.container{position:relative;width:100%;display:inline-block}@media(min-width: 640px){.container{width:var(--width)}}.goa-input,.goa-input *{box-sizing:border-box;line-height:normal}.goa-input{box-sizing:border-box;outline:none;transition:box-shadow 0.1s ease-in;border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);display:inline-flex;align-items:stretch;vertical-align:middle;min-width:100%;background-color:var(--goa-color-greyscale-white)}.goa-input:hover{border-color:var(--goa-color-interactive-hover)}.goa-input:active,.goa-input:focus,.goa-input:focus-within{box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}.goa-input.type--range{border:none}.goa-input.type--range:active,.goa-input.type--range:focus,.goa-input.type--range:focus-within{box-shadow:none}.goa-input-leading-icon{margin-left:0.5rem}.goa-input-trailing-icon{margin-right:0.5rem}input{display:inline-block;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);padding:var(--goa-space-xs);line-height:calc(40px - calc(var(--goa-space-xs) * 2));background-color:transparent;width:100%;flex:1 1 auto;font-family:var(--goa-font-family-sans)}input[readonly]{cursor:pointer}.goa-input-leading-icon+input{padding-left:0.5rem}input,input:focus,input:hover,input:active{outline:none;border:none}.goa-input--disabled,.goa-input--disabled:hover,.goa-input--disabled:active,.goa-input--disabled:focus{background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200);cursor:default;box-shadow:none}.goa-input--disabled input,.goa-input--disabled input:hover,.goa-input--disabled input:active,.goa-input--disabled input:focus{color:var(--goa-color-text-secondary)}.goa-input--disabled input:hover{cursor:default !important}.prefix,.suffix,.leading-content ::slotted(div),.trailing-content ::slotted(div){background-color:var(--goa-color-greyscale-100);padding:0 0.75rem;display:flex;align-items:center}.leading-content ::slotted(div),.trailing-content ::slotted(div){padding:0.5rem 0.75rem}.prefix,.leading-content ::slotted(div){border-top-left-radius:var(--goa-border-radius-m);border-bottom-left-radius:var(--goa-border-radius-m);border-right:1px solid var(--goa-color-greyscale-700)}.suffix,.trailing-content ::slotted(div){border-top-right-radius:var(--goa-border-radius-m);border-bottom-right-radius:var(--goa-border-radius-m);border-left:1px solid var(--goa-color-greyscale-700)}.goa-input--disabled .prefix,.goa-input--disabled .leading-content ::slotted(div){border-right:1px solid var(--goa-color-greyscale-200)}.goa-input--disabled .suffix,.goa-input--disabled .trailing-content ::slotted(div){border-left:1px solid var(--goa-color-greyscale-200)}input.input--goa{display:block;border:none;flex:1 1 auto}.variant--bare{border:none}.variant--bare:focus,.variant--bare:active,.variant--bare:focus-within{box-shadow:none}.error:hover,.error:focus,.error{border:2px solid var(--goa-color-interactive-error)}input[type="search" i]:enabled:read-write:-webkit-any(:focus, :hover)::-webkit-search-cancel-button{position:relative;right:var(--search-icon-offset);cursor:pointer;-webkit-appearance:none;height:1.2rem;width:1.2rem;background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="%23333" d="M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z"/></svg>')
|
|
11160
11575
|
center center no-repeat}</style>`;
|
|
11161
11576
|
init(this, {
|
|
11162
11577
|
target: this.shadowRoot,
|
|
@@ -16825,6 +17240,37 @@
|
|
|
16825
17240
|
return t;
|
|
16826
17241
|
}
|
|
16827
17242
|
|
|
17243
|
+
var GoAAccordion = function GoAAccordion(_a) {
|
|
17244
|
+
var open = _a.open,
|
|
17245
|
+
heading = _a.heading,
|
|
17246
|
+
headingSize = _a.headingSize,
|
|
17247
|
+
secondaryText = _a.secondaryText,
|
|
17248
|
+
headingContent = _a.headingContent,
|
|
17249
|
+
testid = _a.testid,
|
|
17250
|
+
children = _a.children,
|
|
17251
|
+
mt = _a.mt,
|
|
17252
|
+
mr = _a.mr,
|
|
17253
|
+
mb = _a.mb,
|
|
17254
|
+
ml = _a.ml;
|
|
17255
|
+
return jsxRuntime.jsxs("goa-accordion", __assign({
|
|
17256
|
+
open: open,
|
|
17257
|
+
headingSize: headingSize,
|
|
17258
|
+
heading: heading,
|
|
17259
|
+
secondaryText: secondaryText,
|
|
17260
|
+
"data-testid": testid,
|
|
17261
|
+
mt: mt,
|
|
17262
|
+
mr: mr,
|
|
17263
|
+
mb: mb,
|
|
17264
|
+
ml: ml
|
|
17265
|
+
}, {
|
|
17266
|
+
children: [children, headingContent && jsxRuntime.jsx("div", __assign({
|
|
17267
|
+
slot: "headingcontent"
|
|
17268
|
+
}, {
|
|
17269
|
+
children: headingContent
|
|
17270
|
+
}), void 0)]
|
|
17271
|
+
}), void 0);
|
|
17272
|
+
};
|
|
17273
|
+
|
|
16828
17274
|
var GoAAppHeader = function GoAAppHeader(_a) {
|
|
16829
17275
|
var heading = _a.heading,
|
|
16830
17276
|
url = _a.url,
|
|
@@ -18051,6 +18497,7 @@
|
|
|
18051
18497
|
}), void 0);
|
|
18052
18498
|
}
|
|
18053
18499
|
|
|
18500
|
+
exports.GoAAccordion = GoAAccordion;
|
|
18054
18501
|
exports.GoAAppFooter = GoAAppFooter;
|
|
18055
18502
|
exports.GoAAppFooterMetaSection = GoAAppFooterMetaSection;
|
|
18056
18503
|
exports.GoAAppFooterNavSection = GoAAppFooterNavSection;
|