@abgov/react-components 4.0.0-alpha.107 → 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 +504 -59
- package/react-components.umd.js +502 -57
package/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "@abgov/web-components";
|
|
2
2
|
export type { GoAIconType } from "./lib/icon/icon";
|
|
3
3
|
export type { GoABadgeType } from "./lib/badge/badge";
|
|
4
|
+
export * from "./lib/accordion/accordion";
|
|
4
5
|
export * from "./lib/app-header/app-header";
|
|
5
6
|
export * from "./lib/badge/badge";
|
|
6
7
|
export * from "./lib/block/block";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { FC, ReactNode } from "react";
|
|
2
|
+
import { Margins } from "../../common/styling";
|
|
3
|
+
declare type HeadingSize = "small" | "medium";
|
|
4
|
+
interface WCProps extends Margins {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
headingSize?: HeadingSize;
|
|
7
|
+
heading: string;
|
|
8
|
+
secondaryText?: string;
|
|
9
|
+
headingContent?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare global {
|
|
12
|
+
namespace JSX {
|
|
13
|
+
interface IntrinsicElements {
|
|
14
|
+
"goa-accordion": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
interface Props extends Margins {
|
|
19
|
+
open?: boolean;
|
|
20
|
+
headingSize?: HeadingSize;
|
|
21
|
+
secondaryText?: string;
|
|
22
|
+
heading: string;
|
|
23
|
+
headingContent?: ReactNode;
|
|
24
|
+
testid?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const GoAAccordion: FC<Props>;
|
|
27
|
+
export default GoAAccordion;
|
package/package.json
CHANGED
package/react-components.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useRef, useEffect } from 'react';
|
|
3
3
|
import { parseISO, format } from 'date-fns';
|
|
4
4
|
|
|
@@ -1024,6 +1024,476 @@ if (typeof HTMLElement === 'function') {
|
|
|
1024
1024
|
|
|
1025
1025
|
};
|
|
1026
1026
|
}
|
|
1027
|
+
|
|
1028
|
+
function calculateMargin(mt, mr, mb, ml) {
|
|
1029
|
+
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(" ");
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
function injectCss(el, rootSelector, css, media) {
|
|
1033
|
+
const style = document.createElement("style");
|
|
1034
|
+
|
|
1035
|
+
const _css = Object.entries(css).map(entry => `${entry[0]}: ${entry[1]};`).join(" ");
|
|
1036
|
+
|
|
1037
|
+
if (media) {
|
|
1038
|
+
style.innerHTML = `@media (${media}) { ${rootSelector} {${_css}} }`;
|
|
1039
|
+
} else {
|
|
1040
|
+
style.innerHTML = `${rootSelector} {${_css}}`;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
el.appendChild(style);
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
function toBoolean(value) {
|
|
1047
|
+
if (value === "false") {
|
|
1048
|
+
return false;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
if (value === "") {
|
|
1052
|
+
return true;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
return !!value;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
function fromBoolean(value) {
|
|
1059
|
+
return value ? "true" : "false";
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
function validateRequired(componentName, props) {
|
|
1063
|
+
Object.entries(props).forEach(prop => {
|
|
1064
|
+
if (!prop[1]) {
|
|
1065
|
+
console.warn(`${componentName}: ${prop[0]} is required`);
|
|
1066
|
+
}
|
|
1067
|
+
});
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
function typeValidator(message, values, required = false) {
|
|
1071
|
+
const validator = value => {
|
|
1072
|
+
if (!required && !value) {
|
|
1073
|
+
return;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
if (!values.includes(value)) {
|
|
1077
|
+
console.error(`[${value}] is an invalid ${message.toLowerCase()}`);
|
|
1078
|
+
}
|
|
1079
|
+
};
|
|
1080
|
+
|
|
1081
|
+
return [values, validator];
|
|
1082
|
+
}
|
|
1083
|
+
/* libs/web-components/src/components/accordion/Accordion.svelte generated by Svelte v3.51.0 */
|
|
1084
|
+
|
|
1085
|
+
|
|
1086
|
+
function create_fragment$H(ctx) {
|
|
1087
|
+
let div3;
|
|
1088
|
+
let details;
|
|
1089
|
+
let summary;
|
|
1090
|
+
let goa_icon;
|
|
1091
|
+
let goa_icon_fillcolor_value;
|
|
1092
|
+
let t0;
|
|
1093
|
+
let div1;
|
|
1094
|
+
let span0;
|
|
1095
|
+
let t1;
|
|
1096
|
+
let span0_class_value;
|
|
1097
|
+
let span0_data_testid_value;
|
|
1098
|
+
let t2;
|
|
1099
|
+
let span1;
|
|
1100
|
+
let t3;
|
|
1101
|
+
let t4;
|
|
1102
|
+
let div0;
|
|
1103
|
+
let summary_class_value;
|
|
1104
|
+
let t5;
|
|
1105
|
+
let div2;
|
|
1106
|
+
let div3_style_value;
|
|
1107
|
+
let mounted;
|
|
1108
|
+
let dispose;
|
|
1109
|
+
return {
|
|
1110
|
+
c() {
|
|
1111
|
+
div3 = element("div");
|
|
1112
|
+
details = element("details");
|
|
1113
|
+
summary = element("summary");
|
|
1114
|
+
goa_icon = element("goa-icon");
|
|
1115
|
+
t0 = space();
|
|
1116
|
+
div1 = element("div");
|
|
1117
|
+
span0 = element("span");
|
|
1118
|
+
t1 = text(
|
|
1119
|
+
/*heading*/
|
|
1120
|
+
ctx[0]);
|
|
1121
|
+
t2 = space();
|
|
1122
|
+
span1 = element("span");
|
|
1123
|
+
t3 = text(
|
|
1124
|
+
/*secondarytext*/
|
|
1125
|
+
ctx[1]);
|
|
1126
|
+
t4 = space();
|
|
1127
|
+
div0 = element("div");
|
|
1128
|
+
div0.innerHTML = `<slot name="headingcontent"></slot>`;
|
|
1129
|
+
t5 = space();
|
|
1130
|
+
div2 = element("div");
|
|
1131
|
+
div2.innerHTML = `<slot></slot>`;
|
|
1132
|
+
this.c = noop;
|
|
1133
|
+
set_custom_element_data(goa_icon, "type", "chevron-forward");
|
|
1134
|
+
set_custom_element_data(goa_icon, "fillcolor", goa_icon_fillcolor_value =
|
|
1135
|
+
/*_hovering*/
|
|
1136
|
+
ctx[8] ? "var(--goa-color-interactive-hover)" : "var(--goa-color-interactive-default)");
|
|
1137
|
+
attr(span0, "class", span0_class_value = "heading heading-" +
|
|
1138
|
+
/*headingsize*/
|
|
1139
|
+
ctx[2]);
|
|
1140
|
+
attr(span0, "data-testid", span0_data_testid_value = `${
|
|
1141
|
+
/*testid*/
|
|
1142
|
+
ctx[3]}-heading`);
|
|
1143
|
+
attr(span1, "class", "secondary-text");
|
|
1144
|
+
attr(div0, "class", "heading-content");
|
|
1145
|
+
attr(div1, "class", "title");
|
|
1146
|
+
attr(summary, "class", summary_class_value = `container-${
|
|
1147
|
+
/*headingsize*/
|
|
1148
|
+
ctx[2]}`);
|
|
1149
|
+
attr(div2, "class", "content");
|
|
1150
|
+
details.open =
|
|
1151
|
+
/*isOpen*/
|
|
1152
|
+
ctx[9];
|
|
1153
|
+
attr(div3, "style", div3_style_value = calculateMargin(
|
|
1154
|
+
/*mt*/
|
|
1155
|
+
ctx[4],
|
|
1156
|
+
/*mr*/
|
|
1157
|
+
ctx[5],
|
|
1158
|
+
/*mb*/
|
|
1159
|
+
ctx[6],
|
|
1160
|
+
/*ml*/
|
|
1161
|
+
ctx[7]));
|
|
1162
|
+
attr(div3, "class", `
|
|
1163
|
+
goa-accordion
|
|
1164
|
+
`);
|
|
1165
|
+
attr(div3, "data-testid",
|
|
1166
|
+
/*testid*/
|
|
1167
|
+
ctx[3]);
|
|
1168
|
+
},
|
|
1169
|
+
|
|
1170
|
+
m(target, anchor) {
|
|
1171
|
+
insert(target, div3, anchor);
|
|
1172
|
+
append(div3, details);
|
|
1173
|
+
append(details, summary);
|
|
1174
|
+
append(summary, goa_icon);
|
|
1175
|
+
append(summary, t0);
|
|
1176
|
+
append(summary, div1);
|
|
1177
|
+
append(div1, span0);
|
|
1178
|
+
append(span0, t1);
|
|
1179
|
+
append(div1, t2);
|
|
1180
|
+
append(div1, span1);
|
|
1181
|
+
append(span1, t3);
|
|
1182
|
+
append(div1, t4);
|
|
1183
|
+
append(div1, div0);
|
|
1184
|
+
append(details, t5);
|
|
1185
|
+
append(details, div2);
|
|
1186
|
+
|
|
1187
|
+
if (!mounted) {
|
|
1188
|
+
dispose = [listen(summary, "mouseover",
|
|
1189
|
+
/*mouseover_handler*/
|
|
1190
|
+
ctx[11]), listen(summary, "mouseout",
|
|
1191
|
+
/*mouseout_handler*/
|
|
1192
|
+
ctx[12]), listen(summary, "focus",
|
|
1193
|
+
/*focus_handler*/
|
|
1194
|
+
ctx[13]), listen(summary, "blur",
|
|
1195
|
+
/*blur_handler*/
|
|
1196
|
+
ctx[14])];
|
|
1197
|
+
mounted = true;
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1200
|
+
|
|
1201
|
+
p(ctx, [dirty]) {
|
|
1202
|
+
if (dirty &
|
|
1203
|
+
/*_hovering*/
|
|
1204
|
+
256 && goa_icon_fillcolor_value !== (goa_icon_fillcolor_value =
|
|
1205
|
+
/*_hovering*/
|
|
1206
|
+
ctx[8] ? "var(--goa-color-interactive-hover)" : "var(--goa-color-interactive-default)")) {
|
|
1207
|
+
set_custom_element_data(goa_icon, "fillcolor", goa_icon_fillcolor_value);
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
if (dirty &
|
|
1211
|
+
/*heading*/
|
|
1212
|
+
1) set_data(t1,
|
|
1213
|
+
/*heading*/
|
|
1214
|
+
ctx[0]);
|
|
1215
|
+
|
|
1216
|
+
if (dirty &
|
|
1217
|
+
/*headingsize*/
|
|
1218
|
+
4 && span0_class_value !== (span0_class_value = "heading heading-" +
|
|
1219
|
+
/*headingsize*/
|
|
1220
|
+
ctx[2])) {
|
|
1221
|
+
attr(span0, "class", span0_class_value);
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
if (dirty &
|
|
1225
|
+
/*testid*/
|
|
1226
|
+
8 && span0_data_testid_value !== (span0_data_testid_value = `${
|
|
1227
|
+
/*testid*/
|
|
1228
|
+
ctx[3]}-heading`)) {
|
|
1229
|
+
attr(span0, "data-testid", span0_data_testid_value);
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
if (dirty &
|
|
1233
|
+
/*secondarytext*/
|
|
1234
|
+
2) set_data(t3,
|
|
1235
|
+
/*secondarytext*/
|
|
1236
|
+
ctx[1]);
|
|
1237
|
+
|
|
1238
|
+
if (dirty &
|
|
1239
|
+
/*headingsize*/
|
|
1240
|
+
4 && summary_class_value !== (summary_class_value = `container-${
|
|
1241
|
+
/*headingsize*/
|
|
1242
|
+
ctx[2]}`)) {
|
|
1243
|
+
attr(summary, "class", summary_class_value);
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
if (dirty &
|
|
1247
|
+
/*isOpen*/
|
|
1248
|
+
512) {
|
|
1249
|
+
details.open =
|
|
1250
|
+
/*isOpen*/
|
|
1251
|
+
ctx[9];
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
if (dirty &
|
|
1255
|
+
/*mt, mr, mb, ml*/
|
|
1256
|
+
240 && div3_style_value !== (div3_style_value = calculateMargin(
|
|
1257
|
+
/*mt*/
|
|
1258
|
+
ctx[4],
|
|
1259
|
+
/*mr*/
|
|
1260
|
+
ctx[5],
|
|
1261
|
+
/*mb*/
|
|
1262
|
+
ctx[6],
|
|
1263
|
+
/*ml*/
|
|
1264
|
+
ctx[7]))) {
|
|
1265
|
+
attr(div3, "style", div3_style_value);
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
if (dirty &
|
|
1269
|
+
/*testid*/
|
|
1270
|
+
8) {
|
|
1271
|
+
attr(div3, "data-testid",
|
|
1272
|
+
/*testid*/
|
|
1273
|
+
ctx[3]);
|
|
1274
|
+
}
|
|
1275
|
+
},
|
|
1276
|
+
|
|
1277
|
+
i: noop,
|
|
1278
|
+
o: noop,
|
|
1279
|
+
|
|
1280
|
+
d(detaching) {
|
|
1281
|
+
if (detaching) detach(div3);
|
|
1282
|
+
mounted = false;
|
|
1283
|
+
run_all(dispose);
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
};
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
function instance$B($$self, $$props, $$invalidate) {
|
|
1290
|
+
let isOpen;
|
|
1291
|
+
const [HeadingSizes, validateHeadingSize] = typeValidator("Accordion heading size", ["small", "medium"]);
|
|
1292
|
+
let {
|
|
1293
|
+
open = "false"
|
|
1294
|
+
} = $$props;
|
|
1295
|
+
let {
|
|
1296
|
+
heading = ""
|
|
1297
|
+
} = $$props;
|
|
1298
|
+
let {
|
|
1299
|
+
secondarytext = ""
|
|
1300
|
+
} = $$props;
|
|
1301
|
+
let {
|
|
1302
|
+
headingsize = "small"
|
|
1303
|
+
} = $$props;
|
|
1304
|
+
let {
|
|
1305
|
+
testid = ""
|
|
1306
|
+
} = $$props;
|
|
1307
|
+
let {
|
|
1308
|
+
mt = null
|
|
1309
|
+
} = $$props;
|
|
1310
|
+
let {
|
|
1311
|
+
mr = null
|
|
1312
|
+
} = $$props;
|
|
1313
|
+
let {
|
|
1314
|
+
mb = "xs"
|
|
1315
|
+
} = $$props;
|
|
1316
|
+
let {
|
|
1317
|
+
ml = null
|
|
1318
|
+
} = $$props;
|
|
1319
|
+
let _hovering = false;
|
|
1320
|
+
onMount(() => {
|
|
1321
|
+
validateRequired("GoAAccordion", {
|
|
1322
|
+
heading
|
|
1323
|
+
});
|
|
1324
|
+
validateHeadingSize(headingsize);
|
|
1325
|
+
});
|
|
1326
|
+
|
|
1327
|
+
const mouseover_handler = () => $$invalidate(8, _hovering = true);
|
|
1328
|
+
|
|
1329
|
+
const mouseout_handler = () => $$invalidate(8, _hovering = false);
|
|
1330
|
+
|
|
1331
|
+
const focus_handler = () => $$invalidate(8, _hovering = false);
|
|
1332
|
+
|
|
1333
|
+
const blur_handler = () => $$invalidate(8, _hovering = false);
|
|
1334
|
+
|
|
1335
|
+
$$self.$$set = $$props => {
|
|
1336
|
+
if ('open' in $$props) $$invalidate(10, open = $$props.open);
|
|
1337
|
+
if ('heading' in $$props) $$invalidate(0, heading = $$props.heading);
|
|
1338
|
+
if ('secondarytext' in $$props) $$invalidate(1, secondarytext = $$props.secondarytext);
|
|
1339
|
+
if ('headingsize' in $$props) $$invalidate(2, headingsize = $$props.headingsize);
|
|
1340
|
+
if ('testid' in $$props) $$invalidate(3, testid = $$props.testid);
|
|
1341
|
+
if ('mt' in $$props) $$invalidate(4, mt = $$props.mt);
|
|
1342
|
+
if ('mr' in $$props) $$invalidate(5, mr = $$props.mr);
|
|
1343
|
+
if ('mb' in $$props) $$invalidate(6, mb = $$props.mb);
|
|
1344
|
+
if ('ml' in $$props) $$invalidate(7, ml = $$props.ml);
|
|
1345
|
+
};
|
|
1346
|
+
|
|
1347
|
+
$$self.$$.update = () => {
|
|
1348
|
+
if ($$self.$$.dirty &
|
|
1349
|
+
/*open*/
|
|
1350
|
+
1024) {
|
|
1351
|
+
$$invalidate(9, isOpen = toBoolean(open));
|
|
1352
|
+
}
|
|
1353
|
+
};
|
|
1354
|
+
|
|
1355
|
+
return [heading, secondarytext, headingsize, testid, mt, mr, mb, ml, _hovering, isOpen, open, mouseover_handler, mouseout_handler, focus_handler, blur_handler];
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
class Accordion extends SvelteElement {
|
|
1359
|
+
constructor(options) {
|
|
1360
|
+
super();
|
|
1361
|
+
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
|
|
1362
|
+
}.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>`;
|
|
1363
|
+
init(this, {
|
|
1364
|
+
target: this.shadowRoot,
|
|
1365
|
+
props: attribute_to_object(this.attributes),
|
|
1366
|
+
customElement: true
|
|
1367
|
+
}, instance$B, create_fragment$H, safe_not_equal, {
|
|
1368
|
+
open: 10,
|
|
1369
|
+
heading: 0,
|
|
1370
|
+
secondarytext: 1,
|
|
1371
|
+
headingsize: 2,
|
|
1372
|
+
testid: 3,
|
|
1373
|
+
mt: 4,
|
|
1374
|
+
mr: 5,
|
|
1375
|
+
mb: 6,
|
|
1376
|
+
ml: 7
|
|
1377
|
+
}, null);
|
|
1378
|
+
|
|
1379
|
+
if (options) {
|
|
1380
|
+
if (options.target) {
|
|
1381
|
+
insert(options.target, this, options.anchor);
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
if (options.props) {
|
|
1385
|
+
this.$set(options.props);
|
|
1386
|
+
flush();
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
static get observedAttributes() {
|
|
1392
|
+
return ["open", "heading", "secondarytext", "headingsize", "testid", "mt", "mr", "mb", "ml"];
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
get open() {
|
|
1396
|
+
return this.$$.ctx[10];
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
set open(open) {
|
|
1400
|
+
this.$$set({
|
|
1401
|
+
open
|
|
1402
|
+
});
|
|
1403
|
+
flush();
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
get heading() {
|
|
1407
|
+
return this.$$.ctx[0];
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
set heading(heading) {
|
|
1411
|
+
this.$$set({
|
|
1412
|
+
heading
|
|
1413
|
+
});
|
|
1414
|
+
flush();
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
get secondarytext() {
|
|
1418
|
+
return this.$$.ctx[1];
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
set secondarytext(secondarytext) {
|
|
1422
|
+
this.$$set({
|
|
1423
|
+
secondarytext
|
|
1424
|
+
});
|
|
1425
|
+
flush();
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
get headingsize() {
|
|
1429
|
+
return this.$$.ctx[2];
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
set headingsize(headingsize) {
|
|
1433
|
+
this.$$set({
|
|
1434
|
+
headingsize
|
|
1435
|
+
});
|
|
1436
|
+
flush();
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
get testid() {
|
|
1440
|
+
return this.$$.ctx[3];
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
set testid(testid) {
|
|
1444
|
+
this.$$set({
|
|
1445
|
+
testid
|
|
1446
|
+
});
|
|
1447
|
+
flush();
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
get mt() {
|
|
1451
|
+
return this.$$.ctx[4];
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
set mt(mt) {
|
|
1455
|
+
this.$$set({
|
|
1456
|
+
mt
|
|
1457
|
+
});
|
|
1458
|
+
flush();
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
get mr() {
|
|
1462
|
+
return this.$$.ctx[5];
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
set mr(mr) {
|
|
1466
|
+
this.$$set({
|
|
1467
|
+
mr
|
|
1468
|
+
});
|
|
1469
|
+
flush();
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
get mb() {
|
|
1473
|
+
return this.$$.ctx[6];
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
set mb(mb) {
|
|
1477
|
+
this.$$set({
|
|
1478
|
+
mb
|
|
1479
|
+
});
|
|
1480
|
+
flush();
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
get ml() {
|
|
1484
|
+
return this.$$.ctx[7];
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
set ml(ml) {
|
|
1488
|
+
this.$$set({
|
|
1489
|
+
ml
|
|
1490
|
+
});
|
|
1491
|
+
flush();
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
customElements.define("goa-accordion", Accordion);
|
|
1027
1497
|
/* libs/web-components/src/components/app-header/AppHeader.svelte generated by Svelte v3.51.0 */
|
|
1028
1498
|
|
|
1029
1499
|
function create_else_block$4(ctx) {
|
|
@@ -1336,65 +1806,8 @@ class AppHeader extends SvelteElement {
|
|
|
1336
1806
|
}
|
|
1337
1807
|
|
|
1338
1808
|
customElements.define("goa-app-header", AppHeader);
|
|
1339
|
-
|
|
1340
|
-
function calculateMargin(mt, mr, mb, ml) {
|
|
1341
|
-
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(" ");
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
function injectCss(el, rootSelector, css, media) {
|
|
1345
|
-
const style = document.createElement("style");
|
|
1346
|
-
|
|
1347
|
-
const _css = Object.entries(css).map(entry => `${entry[0]}: ${entry[1]};`).join(" ");
|
|
1348
|
-
|
|
1349
|
-
if (media) {
|
|
1350
|
-
style.innerHTML = `@media (${media}) { ${rootSelector} {${_css}} }`;
|
|
1351
|
-
} else {
|
|
1352
|
-
style.innerHTML = `${rootSelector} {${_css}}`;
|
|
1353
|
-
}
|
|
1354
|
-
|
|
1355
|
-
el.appendChild(style);
|
|
1356
|
-
}
|
|
1357
|
-
|
|
1358
|
-
function toBoolean(value) {
|
|
1359
|
-
if (value === "false") {
|
|
1360
|
-
return false;
|
|
1361
|
-
}
|
|
1362
|
-
|
|
1363
|
-
if (value === "") {
|
|
1364
|
-
return true;
|
|
1365
|
-
}
|
|
1366
|
-
|
|
1367
|
-
return !!value;
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
function fromBoolean(value) {
|
|
1371
|
-
return value ? "true" : "false";
|
|
1372
|
-
}
|
|
1373
|
-
|
|
1374
|
-
function validateRequired(componentName, props) {
|
|
1375
|
-
Object.entries(props).forEach(prop => {
|
|
1376
|
-
if (!prop[1]) {
|
|
1377
|
-
console.warn(`${componentName}: ${prop[0]} is required`);
|
|
1378
|
-
}
|
|
1379
|
-
});
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1382
|
-
function typeValidator(message, values, required = false) {
|
|
1383
|
-
const validator = value => {
|
|
1384
|
-
if (!required && !value) {
|
|
1385
|
-
return;
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
|
-
if (!values.includes(value)) {
|
|
1389
|
-
console.error(`[${value}] is an invalid ${message.toLowerCase()}`);
|
|
1390
|
-
}
|
|
1391
|
-
};
|
|
1392
|
-
|
|
1393
|
-
return [values, validator];
|
|
1394
|
-
}
|
|
1395
1809
|
/* libs/web-components/src/components/badge/Badge.svelte generated by Svelte v3.51.0 */
|
|
1396
1810
|
|
|
1397
|
-
|
|
1398
1811
|
function create_else_block$3(ctx) {
|
|
1399
1812
|
let div;
|
|
1400
1813
|
return {
|
|
@@ -16741,6 +17154,38 @@ class Pagination extends SvelteElement {
|
|
|
16741
17154
|
|
|
16742
17155
|
customElements.define("goa-pagination", Pagination);
|
|
16743
17156
|
|
|
17157
|
+
const GoAAccordion = ({
|
|
17158
|
+
open,
|
|
17159
|
+
heading,
|
|
17160
|
+
headingSize,
|
|
17161
|
+
secondaryText,
|
|
17162
|
+
headingContent,
|
|
17163
|
+
testid,
|
|
17164
|
+
children,
|
|
17165
|
+
mt,
|
|
17166
|
+
mr,
|
|
17167
|
+
mb,
|
|
17168
|
+
ml
|
|
17169
|
+
}) => {
|
|
17170
|
+
return jsxs("goa-accordion", Object.assign({
|
|
17171
|
+
open: open,
|
|
17172
|
+
headingSize: headingSize,
|
|
17173
|
+
heading: heading,
|
|
17174
|
+
secondaryText: secondaryText,
|
|
17175
|
+
"data-testid": testid,
|
|
17176
|
+
mt: mt,
|
|
17177
|
+
mr: mr,
|
|
17178
|
+
mb: mb,
|
|
17179
|
+
ml: ml
|
|
17180
|
+
}, {
|
|
17181
|
+
children: [children, headingContent && jsx("div", Object.assign({
|
|
17182
|
+
slot: "headingcontent"
|
|
17183
|
+
}, {
|
|
17184
|
+
children: headingContent
|
|
17185
|
+
}), void 0)]
|
|
17186
|
+
}), void 0);
|
|
17187
|
+
};
|
|
17188
|
+
|
|
16744
17189
|
const GoAAppHeader = ({
|
|
16745
17190
|
heading,
|
|
16746
17191
|
url,
|
|
@@ -18015,4 +18460,4 @@ function GoATwoColumnLayout(props) {
|
|
|
18015
18460
|
}), void 0);
|
|
18016
18461
|
}
|
|
18017
18462
|
|
|
18018
|
-
export { GoAAppFooter, GoAAppFooterMetaSection, GoAAppFooterNavSection, GoAAppHeader, GoABadge, GoABlock, GoAButton, GoAButtonGroup, GoACallout, GoACheckbox, GoAChip, GoACircularProgress, GoAContainer, GoADivider, GoADropdown, GoADropdownItem, GoADropdownOption, GoAEmergencyBadge, GoAFormItem, GoAGrid, GoAHeroBanner, GoAHeroBannerActions, GoAIcon, GoAIconButton, GoAImportantBadge, GoAInfoBadge, GoAInput, GoAInputDate, GoAInputDateTime, GoAInputEmail, GoAInputFile, GoAInputMonth, GoAInputNumber, GoAInputPassword, GoAInputRange, GoAInputSearch, GoAInputTel, GoAInputText, GoAInputTime, GoAInputUrl, GoAMicrositeHeader, GoAModal, GoANotification, GoAOneColumnLayout, GoAPageBlock, GoAPagination, GoARadioGroup, GoARadioItem, GoASkeleton, GoASpacer, GoASpinner, GoASuccessBadge, GoATable, GoATextArea, GoATwoColumnLayout };
|
|
18463
|
+
export { GoAAccordion, GoAAppFooter, GoAAppFooterMetaSection, GoAAppFooterNavSection, GoAAppHeader, GoABadge, GoABlock, GoAButton, GoAButtonGroup, GoACallout, GoACheckbox, GoAChip, GoACircularProgress, GoAContainer, GoADivider, GoADropdown, GoADropdownItem, GoADropdownOption, GoAEmergencyBadge, GoAFormItem, GoAGrid, GoAHeroBanner, GoAHeroBannerActions, GoAIcon, GoAIconButton, GoAImportantBadge, GoAInfoBadge, GoAInput, GoAInputDate, GoAInputDateTime, GoAInputEmail, GoAInputFile, GoAInputMonth, GoAInputNumber, GoAInputPassword, GoAInputRange, GoAInputSearch, GoAInputTel, GoAInputText, GoAInputTime, GoAInputUrl, GoAMicrositeHeader, GoAModal, GoANotification, GoAOneColumnLayout, GoAPageBlock, GoAPagination, GoARadioGroup, GoARadioItem, GoASkeleton, GoASpacer, GoASpinner, GoASuccessBadge, GoATable, GoATextArea, GoATwoColumnLayout };
|
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 {
|
|
@@ -16827,6 +17240,37 @@
|
|
|
16827
17240
|
return t;
|
|
16828
17241
|
}
|
|
16829
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
|
+
|
|
16830
17274
|
var GoAAppHeader = function GoAAppHeader(_a) {
|
|
16831
17275
|
var heading = _a.heading,
|
|
16832
17276
|
url = _a.url,
|
|
@@ -18053,6 +18497,7 @@
|
|
|
18053
18497
|
}), void 0);
|
|
18054
18498
|
}
|
|
18055
18499
|
|
|
18500
|
+
exports.GoAAccordion = GoAAccordion;
|
|
18056
18501
|
exports.GoAAppFooter = GoAAppFooter;
|
|
18057
18502
|
exports.GoAAppFooterMetaSection = GoAAppFooterMetaSection;
|
|
18058
18503
|
exports.GoAAppFooterNavSection = GoAAppFooterNavSection;
|