@norges-domstoler/dds-components 0.0.0-dev-20260720090111 → 0.0.0-dev-20260720132029
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/index.cjs +166 -150
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +3 -3
- package/dist/index.d.cts +577 -1537
- package/dist/index.d.mts +577 -1536
- package/dist/index.mjs +163 -150
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -513,9 +513,6 @@ const combineHandlers = (handler1, handler2) => {
|
|
|
513
513
|
function cn(...classNames) {
|
|
514
514
|
return classNames.filter(Boolean).join(" ") || void 0;
|
|
515
515
|
}
|
|
516
|
-
function convertCamelToHyphen(value) {
|
|
517
|
-
return value.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/([a-z])([0-9])/g, "$1-$2").toLowerCase();
|
|
518
|
-
}
|
|
519
516
|
/**
|
|
520
517
|
* Returnener verdien hvis den er truthy.
|
|
521
518
|
* Ellers returnerer `undefined`.
|
|
@@ -4059,6 +4056,78 @@ const Accordion = ({ isInitiallyExpanded = false, isExpanded, onChange, id, chil
|
|
|
4059
4056
|
};
|
|
4060
4057
|
Accordion.displayName = "Accordion";
|
|
4061
4058
|
//#endregion
|
|
4059
|
+
//#region src/components/Accordion/AccordionHeader.tsx
|
|
4060
|
+
const AccordionHeader = ({ children, className, style, htmlProps, typographyType = "heading-medium", bold, ...rest }) => {
|
|
4061
|
+
const { isExpanded, headerProps } = useAccordionContext();
|
|
4062
|
+
const { id, ...restHeaderProps } = headerProps ?? {};
|
|
4063
|
+
const iconState = isExpanded ? "up" : "down";
|
|
4064
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
|
|
4065
|
+
as: StylelessButton,
|
|
4066
|
+
padding: "x1 x1.5 x1 x1",
|
|
4067
|
+
...getBaseHTMLProps(id, cn(className, Accordion_module_default["header-button"], AccordionBase_module_default["header-button"], _key1), style, htmlProps, rest),
|
|
4068
|
+
...restHeaderProps,
|
|
4069
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4070
|
+
className: cn(AccordionBase_module_default.header__content, typographyStyles_module_default[typographyType], bold && typographyStyles_module_default.bold),
|
|
4071
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
4072
|
+
icon: AnimatedChevronUpDownIcon,
|
|
4073
|
+
iconSize: "component",
|
|
4074
|
+
className: Accordion_module_default.chevron,
|
|
4075
|
+
iconState
|
|
4076
|
+
}), children]
|
|
4077
|
+
})
|
|
4078
|
+
});
|
|
4079
|
+
};
|
|
4080
|
+
AccordionHeader.displayName = "AccordionHeader";
|
|
4081
|
+
//#endregion
|
|
4082
|
+
//#region src/components/Accordion/AccordionBody.tsx
|
|
4083
|
+
const AccordionBody = ({ children, className, style, htmlProps, ...rest }) => {
|
|
4084
|
+
const { bodyContentRef, bodyProps } = useAccordionContext();
|
|
4085
|
+
const { className: bodyContextCn, id, height, ...restBodyProps } = bodyProps ?? {};
|
|
4086
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
|
|
4087
|
+
height: `${height}px`,
|
|
4088
|
+
...getBaseHTMLProps(id, cn(className, bodyContextCn), style, htmlProps, rest),
|
|
4089
|
+
...restBodyProps,
|
|
4090
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
|
|
4091
|
+
ref: bodyContentRef,
|
|
4092
|
+
padding: "x0.5 x1.5 x2 x1",
|
|
4093
|
+
children
|
|
4094
|
+
})
|
|
4095
|
+
});
|
|
4096
|
+
};
|
|
4097
|
+
AccordionBody.displayName = "AccordionBody";
|
|
4098
|
+
//#endregion
|
|
4099
|
+
//#region src/components/BackLink/BackLink.module.css
|
|
4100
|
+
var BackLink_module_default = { "icon": "dds-BackLink-module__icon" };
|
|
4101
|
+
//#endregion
|
|
4102
|
+
//#region src/components/BackLink/BackLink.tsx
|
|
4103
|
+
const BackLink = ({ label, ref, as = "a", ...rest }) => {
|
|
4104
|
+
const { t } = useTranslation();
|
|
4105
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
|
|
4106
|
+
ref,
|
|
4107
|
+
"aria-label": t(texts$29.goBack),
|
|
4108
|
+
className: typographyStyles_module_default["body-short-medium"],
|
|
4109
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
4110
|
+
as,
|
|
4111
|
+
className: cn(typographyStyles_module_default.a, _key1),
|
|
4112
|
+
rel: "noopener noreferer",
|
|
4113
|
+
...rest,
|
|
4114
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
4115
|
+
icon: ArrowLeftIcon,
|
|
4116
|
+
iconSize: "component",
|
|
4117
|
+
className: cn(BackLink_module_default.icon)
|
|
4118
|
+
}), label]
|
|
4119
|
+
})
|
|
4120
|
+
});
|
|
4121
|
+
};
|
|
4122
|
+
BackLink.displayName = "BackLink";
|
|
4123
|
+
const texts$29 = createTexts({ goBack: {
|
|
4124
|
+
nb: "Gå tilbake",
|
|
4125
|
+
no: "Gå tilbake",
|
|
4126
|
+
nn: "Gå tilbake",
|
|
4127
|
+
en: "Go back",
|
|
4128
|
+
se: "Mana ruovttoluotta"
|
|
4129
|
+
} });
|
|
4130
|
+
//#endregion
|
|
4062
4131
|
//#region src/components/Typography/Typography/TextOverflowEllipsis/TextOverflowEllipsis.module.css
|
|
4063
4132
|
var TextOverflowEllipsis_module_default = {
|
|
4064
4133
|
"wrapper": "dds-TextOverflowEllipsis-module__wrapper",
|
|
@@ -4083,28 +4152,42 @@ function TextOverflowEllipsisInner({ className, ...rest }) {
|
|
|
4083
4152
|
var Typography_module_default = { "container": "dds-Typography-module__container" };
|
|
4084
4153
|
//#endregion
|
|
4085
4154
|
//#region src/components/Typography/Typography/Typography.types.ts
|
|
4155
|
+
const TG_BODY_SHORT_TYPES = [
|
|
4156
|
+
"body-short-xsmall",
|
|
4157
|
+
"body-short-small",
|
|
4158
|
+
"body-short-medium",
|
|
4159
|
+
"body-short-large"
|
|
4160
|
+
];
|
|
4161
|
+
const TG_BODY_LONG_TYPES = [
|
|
4162
|
+
"body-long-xsmall",
|
|
4163
|
+
"body-long-small",
|
|
4164
|
+
"body-long-medium",
|
|
4165
|
+
"body-long-large"
|
|
4166
|
+
];
|
|
4167
|
+
const TG_BODY_TYPES = [...TG_BODY_SHORT_TYPES, ...TG_BODY_LONG_TYPES];
|
|
4168
|
+
const TG_LEAD_TYPES = ["lead-medium"];
|
|
4086
4169
|
const TG_HEADING_TYPES = [
|
|
4087
|
-
"
|
|
4088
|
-
"
|
|
4089
|
-
"
|
|
4090
|
-
"
|
|
4091
|
-
"
|
|
4092
|
-
"
|
|
4093
|
-
"
|
|
4170
|
+
"heading-xxsmall",
|
|
4171
|
+
"heading-xsmall",
|
|
4172
|
+
"heading-small",
|
|
4173
|
+
"heading-medium",
|
|
4174
|
+
"heading-large",
|
|
4175
|
+
"heading-xlarge",
|
|
4176
|
+
"heading-xxlarge"
|
|
4094
4177
|
];
|
|
4095
4178
|
//#endregion
|
|
4096
4179
|
//#region src/components/Typography/Typography/Typography.utils.ts
|
|
4097
4180
|
const getElementType = (element) => {
|
|
4098
4181
|
switch (element) {
|
|
4099
4182
|
case "a": return "a";
|
|
4100
|
-
case "
|
|
4101
|
-
case "
|
|
4102
|
-
case "
|
|
4103
|
-
case "
|
|
4104
|
-
case "
|
|
4105
|
-
case "
|
|
4106
|
-
case "
|
|
4107
|
-
case "
|
|
4183
|
+
case "heading-xxsmall": return "h6";
|
|
4184
|
+
case "heading-xsmall": return "h5";
|
|
4185
|
+
case "heading-small": return "h4";
|
|
4186
|
+
case "heading-medium": return "h3";
|
|
4187
|
+
case "heading-large": return "h2";
|
|
4188
|
+
case "heading-xlarge":
|
|
4189
|
+
case "heading-xxlarge": return "h1";
|
|
4190
|
+
case "label-medium": return "label";
|
|
4108
4191
|
default: return "p";
|
|
4109
4192
|
}
|
|
4110
4193
|
};
|
|
@@ -4173,9 +4256,6 @@ const inlineElements = [
|
|
|
4173
4256
|
"wbr"
|
|
4174
4257
|
];
|
|
4175
4258
|
const isInlineElement = (as) => inlineElements.indexOf(as) !== -1;
|
|
4176
|
-
function getTypographyCn(value) {
|
|
4177
|
-
return convertCamelToHyphen(value);
|
|
4178
|
-
}
|
|
4179
4259
|
const getColorCn = (color) => {
|
|
4180
4260
|
if (!isTextColor(color)) return null;
|
|
4181
4261
|
const [prefix] = color.split("-", 1);
|
|
@@ -4185,13 +4265,12 @@ const getColorCn = (color) => {
|
|
|
4185
4265
|
//#region src/components/Typography/Typography/Typography.tsx
|
|
4186
4266
|
const isAnchorProps = (props) => props.typographyType === "a";
|
|
4187
4267
|
const Typography = (props) => {
|
|
4188
|
-
const { typographyType = "
|
|
4268
|
+
const { typographyType = "body-long-medium", as: propAs, children, bold, underline, italic, style, id, withMargins, color, className, htmlProps = {}, ...rest } = props;
|
|
4189
4269
|
const as = propAs ? propAs : getElementType(typographyType);
|
|
4190
|
-
const typographyCn = getTypographyCn(typographyType);
|
|
4191
4270
|
let relProp;
|
|
4192
4271
|
if (isAnchorProps(props)) relProp = as === "a" ? "noopener noreferer" : void 0;
|
|
4193
4272
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
|
|
4194
|
-
...getBaseHTMLProps(id, cn(className, getColorCn(color), Typography_module_default.container, typographyStyles_module_default[
|
|
4273
|
+
...getBaseHTMLProps(id, cn(className, getColorCn(color), Typography_module_default.container, typographyStyles_module_default[typographyType], withMargins && typographyStyles_module_default[`${typographyType}--margins`], isLegend(as) && typographyStyles_module_default.legend, isCaption(as) && typographyStyles_module_default.caption, isCaption(as) && withMargins && typographyStyles_module_default["caption--withMargins"], bold && typographyStyles_module_default.bold, underline && typographyStyles_module_default.underline, italic && typographyStyles_module_default.italic, as === "a" && "dds-focus-module__focusable"), {
|
|
4195
4274
|
...style,
|
|
4196
4275
|
color: color && !isTextColor(color) ? getTextColor(color) : void 0
|
|
4197
4276
|
}, htmlProps, rest),
|
|
@@ -4206,7 +4285,7 @@ Typography.displayName = "Typography";
|
|
|
4206
4285
|
const Caption = ({ id, className, style, htmlProps, children, ...rest }) => {
|
|
4207
4286
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
4208
4287
|
...getBaseHTMLProps(id, className, style, htmlProps, rest),
|
|
4209
|
-
typographyType: "
|
|
4288
|
+
typographyType: "heading-large",
|
|
4210
4289
|
as: "caption",
|
|
4211
4290
|
children
|
|
4212
4291
|
});
|
|
@@ -4217,13 +4296,13 @@ Caption.displayName = "Caption";
|
|
|
4217
4296
|
const getHeadingElement = (level) => `h${level}`;
|
|
4218
4297
|
const getDefaultTypographyType = (h) => {
|
|
4219
4298
|
switch (h) {
|
|
4220
|
-
case "h1": return "
|
|
4221
|
-
case "h2": return "
|
|
4222
|
-
case "h3": return "
|
|
4223
|
-
case "h4": return "
|
|
4224
|
-
case "h5": return "
|
|
4225
|
-
case "h6": return "
|
|
4226
|
-
default: return "
|
|
4299
|
+
case "h1": return "heading-xlarge";
|
|
4300
|
+
case "h2": return "heading-large";
|
|
4301
|
+
case "h3": return "heading-medium";
|
|
4302
|
+
case "h4": return "heading-small";
|
|
4303
|
+
case "h5": return "heading-xsmall";
|
|
4304
|
+
case "h6": return "heading-xxsmall";
|
|
4305
|
+
default: return "heading-xlarge";
|
|
4227
4306
|
}
|
|
4228
4307
|
};
|
|
4229
4308
|
const Heading = ({ id, className, style, htmlProps, children, typographyType, level, withMargins, withMarginsOverInput, ...rest }) => {
|
|
@@ -4258,25 +4337,25 @@ const Label = ({ showRequiredStyling, readOnly, id, className, style, htmlProps,
|
|
|
4258
4337
|
] });
|
|
4259
4338
|
const labelProps = { ...getBaseHTMLProps(id, cn(className, readOnly && Label_module_default["read-only"]), style, htmlProps, rest) };
|
|
4260
4339
|
return afterLabelContent ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Typography, {
|
|
4261
|
-
typographyType: "
|
|
4340
|
+
typographyType: "label-medium",
|
|
4262
4341
|
as: "div",
|
|
4263
4342
|
withMargins: rest.withMargins,
|
|
4264
4343
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
4265
4344
|
...labelProps,
|
|
4266
|
-
typographyType: "
|
|
4345
|
+
typographyType: "label-medium",
|
|
4267
4346
|
withMargins: false,
|
|
4268
4347
|
children: content
|
|
4269
4348
|
}), afterLabelContent]
|
|
4270
4349
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
4271
4350
|
...labelProps,
|
|
4272
|
-
typographyType: "
|
|
4351
|
+
typographyType: "label-medium",
|
|
4273
4352
|
children: content
|
|
4274
4353
|
});
|
|
4275
4354
|
};
|
|
4276
4355
|
Label.displayName = "Label";
|
|
4277
4356
|
//#endregion
|
|
4278
4357
|
//#region src/components/Typography/Legend/Legend.tsx
|
|
4279
|
-
const Legend = ({ id, className, style, htmlProps, typographyType = "
|
|
4358
|
+
const Legend = ({ id, className, style, htmlProps, typographyType = "heading-large", withMarginsOverInput, withMargins, ...rest }) => {
|
|
4280
4359
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
4281
4360
|
...getBaseHTMLProps(id, cn(className, withMarginsOverInput && typographyStyles_module_default["legend--margins-over-input"]), style, htmlProps, rest),
|
|
4282
4361
|
as: "legend",
|
|
@@ -4292,7 +4371,7 @@ const Link = ({ id, className, htmlProps, children, typographyType, withMargins,
|
|
|
4292
4371
|
const aProps = as === "a" || propIsAnchor ? { rel: "noopener noreferrer" } : {};
|
|
4293
4372
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ElementAs, {
|
|
4294
4373
|
as,
|
|
4295
|
-
...getBaseHTMLProps(id, cn(className, typographyStyles_module_default.a, withIconStyling && typographyStyles_module_default["a--with-icon"], withVisited && typographyStyles_module_default["a--visited"], typographyType && typographyStyles_module_default[
|
|
4374
|
+
...getBaseHTMLProps(id, cn(className, typographyStyles_module_default.a, withIconStyling && typographyStyles_module_default["a--with-icon"], withVisited && typographyStyles_module_default["a--visited"], typographyType && typographyStyles_module_default[typographyType], typographyType && withMargins && typographyStyles_module_default[`${typographyType}--margins`], _key1, getColorCn(color)), {
|
|
4296
4375
|
...style,
|
|
4297
4376
|
color: color && !isTextColor(color) ? getTextColor(color) : void 0
|
|
4298
4377
|
}, htmlProps, rest),
|
|
@@ -4301,9 +4380,8 @@ const Link = ({ id, className, htmlProps, children, typographyType, withMargins,
|
|
|
4301
4380
|
});
|
|
4302
4381
|
};
|
|
4303
4382
|
Link.displayName = "Link";
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
const Paragraph = ({ id, className, style, htmlProps, children, typographyType = "bodyLongMedium", ...rest }) => {
|
|
4383
|
+
[...TG_BODY_TYPES, ...TG_LEAD_TYPES];
|
|
4384
|
+
const Paragraph = ({ id, className, style, htmlProps, children, typographyType = "body-long-medium", ...rest }) => {
|
|
4307
4385
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
4308
4386
|
...getBaseHTMLProps(id, className, style, htmlProps, rest),
|
|
4309
4387
|
typographyType,
|
|
@@ -4312,78 +4390,6 @@ const Paragraph = ({ id, className, style, htmlProps, children, typographyType =
|
|
|
4312
4390
|
};
|
|
4313
4391
|
Paragraph.displayName = "Paragraph";
|
|
4314
4392
|
//#endregion
|
|
4315
|
-
//#region src/components/Accordion/AccordionHeader.tsx
|
|
4316
|
-
const AccordionHeader = ({ children, className, style, htmlProps, typographyType = "headingMedium", bold, ...rest }) => {
|
|
4317
|
-
const { isExpanded, headerProps } = useAccordionContext();
|
|
4318
|
-
const { id, ...restHeaderProps } = headerProps ?? {};
|
|
4319
|
-
const iconState = isExpanded ? "up" : "down";
|
|
4320
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
|
|
4321
|
-
as: StylelessButton,
|
|
4322
|
-
padding: "x1 x1.5 x1 x1",
|
|
4323
|
-
...getBaseHTMLProps(id, cn(className, Accordion_module_default["header-button"], AccordionBase_module_default["header-button"], _key1), style, htmlProps, rest),
|
|
4324
|
-
...restHeaderProps,
|
|
4325
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4326
|
-
className: cn(AccordionBase_module_default.header__content, typographyStyles_module_default[getTypographyCn(typographyType)], bold && typographyStyles_module_default.bold),
|
|
4327
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
4328
|
-
icon: AnimatedChevronUpDownIcon,
|
|
4329
|
-
iconSize: "component",
|
|
4330
|
-
className: Accordion_module_default.chevron,
|
|
4331
|
-
iconState
|
|
4332
|
-
}), children]
|
|
4333
|
-
})
|
|
4334
|
-
});
|
|
4335
|
-
};
|
|
4336
|
-
AccordionHeader.displayName = "AccordionHeader";
|
|
4337
|
-
//#endregion
|
|
4338
|
-
//#region src/components/Accordion/AccordionBody.tsx
|
|
4339
|
-
const AccordionBody = ({ children, className, style, htmlProps, ...rest }) => {
|
|
4340
|
-
const { bodyContentRef, bodyProps } = useAccordionContext();
|
|
4341
|
-
const { className: bodyContextCn, id, height, ...restBodyProps } = bodyProps ?? {};
|
|
4342
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
|
|
4343
|
-
height: `${height}px`,
|
|
4344
|
-
...getBaseHTMLProps(id, cn(className, bodyContextCn), style, htmlProps, rest),
|
|
4345
|
-
...restBodyProps,
|
|
4346
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
|
|
4347
|
-
ref: bodyContentRef,
|
|
4348
|
-
padding: "x0.5 x1.5 x2 x1",
|
|
4349
|
-
children
|
|
4350
|
-
})
|
|
4351
|
-
});
|
|
4352
|
-
};
|
|
4353
|
-
AccordionBody.displayName = "AccordionBody";
|
|
4354
|
-
//#endregion
|
|
4355
|
-
//#region src/components/BackLink/BackLink.module.css
|
|
4356
|
-
var BackLink_module_default = { "icon": "dds-BackLink-module__icon" };
|
|
4357
|
-
//#endregion
|
|
4358
|
-
//#region src/components/BackLink/BackLink.tsx
|
|
4359
|
-
const BackLink = ({ label, ref, as = "a", ...rest }) => {
|
|
4360
|
-
const { t } = useTranslation();
|
|
4361
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
|
|
4362
|
-
ref,
|
|
4363
|
-
"aria-label": t(texts$29.goBack),
|
|
4364
|
-
className: typographyStyles_module_default["body-short-medium"],
|
|
4365
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
4366
|
-
as,
|
|
4367
|
-
className: cn(typographyStyles_module_default.a, _key1),
|
|
4368
|
-
rel: "noopener noreferer",
|
|
4369
|
-
...rest,
|
|
4370
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
4371
|
-
icon: ArrowLeftIcon,
|
|
4372
|
-
iconSize: "component",
|
|
4373
|
-
className: cn(BackLink_module_default.icon)
|
|
4374
|
-
}), label]
|
|
4375
|
-
})
|
|
4376
|
-
});
|
|
4377
|
-
};
|
|
4378
|
-
BackLink.displayName = "BackLink";
|
|
4379
|
-
const texts$29 = createTexts({ goBack: {
|
|
4380
|
-
nb: "Gå tilbake",
|
|
4381
|
-
no: "Gå tilbake",
|
|
4382
|
-
nn: "Gå tilbake",
|
|
4383
|
-
en: "Go back",
|
|
4384
|
-
se: "Mana ruovttoluotta"
|
|
4385
|
-
} });
|
|
4386
|
-
//#endregion
|
|
4387
4393
|
//#region src/components/Breadcrumbs/Breadcrumb.tsx
|
|
4388
4394
|
const isAnchorTypographyProps = (props) => {
|
|
4389
4395
|
return props.href != void 0;
|
|
@@ -5020,7 +5026,7 @@ const CardExpandable = ({ isInitiallyExpanded = false, isExpanded, onChange, id,
|
|
|
5020
5026
|
CardExpandable.displayName = "CardExpandable";
|
|
5021
5027
|
//#endregion
|
|
5022
5028
|
//#region src/components/Card/CardExpandable/CardExpandableHeader.tsx
|
|
5023
|
-
const CardExpandableHeader = ({ children, className, style, htmlProps, padding, typographyType = "
|
|
5029
|
+
const CardExpandableHeader = ({ children, className, style, htmlProps, padding, typographyType = "heading-large", bold, ...rest }) => {
|
|
5024
5030
|
const { isExpanded, headerProps } = useAccordionContext();
|
|
5025
5031
|
const containerStyleVariables = { ["--dds-card-accordion-header-container-padding"]: padding ?? "var(--dds-spacing-x1) var(--dds-spacing-x0-75) var(--dds-spacing-x1) var(--dds-spacing-x1-5)" };
|
|
5026
5032
|
const { id, ...restHeaderProps } = headerProps ?? {};
|
|
@@ -5031,9 +5037,9 @@ const CardExpandableHeader = ({ children, className, style, htmlProps, padding,
|
|
|
5031
5037
|
type: "button",
|
|
5032
5038
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5033
5039
|
style: containerStyleVariables,
|
|
5034
|
-
className: cn(CardExpandable_module_default["header-container"], typographyStyles_module_default[
|
|
5040
|
+
className: cn(CardExpandable_module_default["header-container"], typographyStyles_module_default[typographyType], bold && typographyStyles_module_default.bold),
|
|
5035
5041
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5036
|
-
className: (AccordionBase_module_default.header__content, CardExpandable_module_default.header__content),
|
|
5042
|
+
className: cn(AccordionBase_module_default.header__content, CardExpandable_module_default.header__content),
|
|
5037
5043
|
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
5038
5044
|
icon: AnimatedChevronUpDownIcon,
|
|
5039
5045
|
className: CardExpandable_module_default["header-container__chevron"],
|
|
@@ -5102,7 +5108,7 @@ const Label$1 = ({ disabled, hasText, controlType, className, ...rest }) => {
|
|
|
5102
5108
|
const renderGroupLabel = ({ id, showRequiredStyling, readOnly, label }) => {
|
|
5103
5109
|
if (!!label) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Typography, {
|
|
5104
5110
|
as: "span",
|
|
5105
|
-
typographyType: "
|
|
5111
|
+
typographyType: "label-medium",
|
|
5106
5112
|
id,
|
|
5107
5113
|
className: readOnly ? Label_module_default["read-only"] : void 0,
|
|
5108
5114
|
withMargins: true,
|
|
@@ -5123,7 +5129,7 @@ const renderGroupLabel = ({ id, showRequiredStyling, readOnly, label }) => {
|
|
|
5123
5129
|
//#region src/components/SelectionControl/SelectionControl.utils.tsx
|
|
5124
5130
|
const selectionControlTypographyProps = {
|
|
5125
5131
|
color: "inherit",
|
|
5126
|
-
typographyType: "
|
|
5132
|
+
typographyType: "body-short-medium",
|
|
5127
5133
|
as: "span"
|
|
5128
5134
|
};
|
|
5129
5135
|
//#endregion
|
|
@@ -5214,7 +5220,7 @@ const InputMessage = ({ messageType, id, className, style, htmlProps, children,
|
|
|
5214
5220
|
...commonProps,
|
|
5215
5221
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
5216
5222
|
...tgCommonProps,
|
|
5217
|
-
typographyType: "
|
|
5223
|
+
typographyType: "body-short-xsmall",
|
|
5218
5224
|
color: "text-subtle"
|
|
5219
5225
|
})
|
|
5220
5226
|
});
|
|
@@ -5585,11 +5591,11 @@ function CookieBannerCheckbox({ headerText, description, id, className, style, h
|
|
|
5585
5591
|
gap: "x0.5",
|
|
5586
5592
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
5587
5593
|
as: "span",
|
|
5588
|
-
typographyType: "
|
|
5594
|
+
typographyType: "heading-small",
|
|
5589
5595
|
children: headerText
|
|
5590
5596
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
5591
5597
|
as: "span",
|
|
5592
|
-
typographyType: "
|
|
5598
|
+
typographyType: "body-long-small",
|
|
5593
5599
|
children: description
|
|
5594
5600
|
})]
|
|
5595
5601
|
})
|
|
@@ -5607,7 +5613,7 @@ function CookieBanner({ headerText, description, buttons, checkboxes, id, classN
|
|
|
5607
5613
|
const headingId = headerText && (id ?? `cookie-banner-${generatedId}-heading`);
|
|
5608
5614
|
const heading = headerText ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
|
|
5609
5615
|
level: 2,
|
|
5610
|
-
typographyType: "
|
|
5616
|
+
typographyType: "heading-medium",
|
|
5611
5617
|
id: headingId,
|
|
5612
5618
|
children: headerText
|
|
5613
5619
|
}) : "";
|
|
@@ -6105,7 +6111,7 @@ function Calendar(props) {
|
|
|
6105
6111
|
}),
|
|
6106
6112
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
|
|
6107
6113
|
level: 2,
|
|
6108
|
-
typographyType: "
|
|
6114
|
+
typographyType: "heading-xsmall",
|
|
6109
6115
|
className: DateInput_module_default.calendar__header__month,
|
|
6110
6116
|
children: title
|
|
6111
6117
|
}),
|
|
@@ -6839,7 +6845,7 @@ const Drawer = ({ children, header, placement = "right", parentElement, size = "
|
|
|
6839
6845
|
id: headerId,
|
|
6840
6846
|
children: typeof header === "string" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
|
|
6841
6847
|
level: 2,
|
|
6842
|
-
typographyType: "
|
|
6848
|
+
typographyType: "heading-large",
|
|
6843
6849
|
children: header
|
|
6844
6850
|
}) : header
|
|
6845
6851
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
@@ -6932,7 +6938,7 @@ function EmptyContent({ headerText, children, headerHeadingLevel = 2, ...rest })
|
|
|
6932
6938
|
className: typographyStyles_module_default["text-color--medium"],
|
|
6933
6939
|
children: [headerText && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
|
|
6934
6940
|
level: headerHeadingLevel,
|
|
6935
|
-
typographyType: "
|
|
6941
|
+
typographyType: "heading-medium",
|
|
6936
6942
|
children: headerText
|
|
6937
6943
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
6938
6944
|
as: "div",
|
|
@@ -6960,7 +6966,7 @@ var List_module_default = {
|
|
|
6960
6966
|
const List = ({ listType = "unordered", typographyType = "inherit", children, id, className, style, htmlProps, ...rest }) => {
|
|
6961
6967
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(listType === "ordered" ? "ol" : "ul", {
|
|
6962
6968
|
...getBaseHTMLProps(id, className, style, htmlProps, rest),
|
|
6963
|
-
className: cn(List_module_default.list, List_module_default[`list--${listType}`], typographyType === "inherit" ? List_module_default["list--inherit"] : typographyStyles_module_default[
|
|
6969
|
+
className: cn(List_module_default.list, List_module_default[`list--${listType}`], typographyType === "inherit" ? List_module_default["list--inherit"] : typographyStyles_module_default[typographyType]),
|
|
6964
6970
|
children
|
|
6965
6971
|
});
|
|
6966
6972
|
};
|
|
@@ -6978,11 +6984,11 @@ const ErrorSummary = ({ heading: pHeading, className, style, children, id, htmlP
|
|
|
6978
6984
|
const { t } = useTranslation();
|
|
6979
6985
|
const heading = typeof pHeading === "string" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
|
|
6980
6986
|
level: 2,
|
|
6981
|
-
typographyType: "
|
|
6987
|
+
typographyType: "heading-small",
|
|
6982
6988
|
children: pHeading
|
|
6983
6989
|
}) : pHeading ? pHeading : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
|
|
6984
6990
|
level: 2,
|
|
6985
|
-
typographyType: "
|
|
6991
|
+
typographyType: "heading-small",
|
|
6986
6992
|
children: t(texts$20.toProceedCorrectErrors)
|
|
6987
6993
|
});
|
|
6988
6994
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Paper, {
|
|
@@ -7088,7 +7094,7 @@ function CharCounter(props) {
|
|
|
7088
7094
|
id: id ?? `${generatedId}-characterCounter`,
|
|
7089
7095
|
className: CharCounter_module_default.container,
|
|
7090
7096
|
as: "div",
|
|
7091
|
-
typographyType: "
|
|
7097
|
+
typographyType: "body-short-xsmall",
|
|
7092
7098
|
color: "text-subtle",
|
|
7093
7099
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
7094
7100
|
"aria-hidden": true,
|
|
@@ -7742,9 +7748,8 @@ const useFileUploader = (props) => {
|
|
|
7742
7748
|
});
|
|
7743
7749
|
const { files: stateFiles } = state;
|
|
7744
7750
|
(0, react.useEffect)(() => {
|
|
7745
|
-
if (isControlled)
|
|
7746
|
-
|
|
7747
|
-
payload: value.map((file) => {
|
|
7751
|
+
if (isControlled) {
|
|
7752
|
+
const files = value.map((file) => {
|
|
7748
7753
|
if (file instanceof File) {
|
|
7749
7754
|
const accepted = isFileAccepted(file, accept);
|
|
7750
7755
|
return {
|
|
@@ -7758,8 +7763,12 @@ const useFileUploader = (props) => {
|
|
|
7758
7763
|
name: file.name,
|
|
7759
7764
|
errors: []
|
|
7760
7765
|
};
|
|
7761
|
-
})
|
|
7762
|
-
|
|
7766
|
+
});
|
|
7767
|
+
dispatch({
|
|
7768
|
+
type: "onSetFiles",
|
|
7769
|
+
payload: files
|
|
7770
|
+
});
|
|
7771
|
+
}
|
|
7763
7772
|
}, [
|
|
7764
7773
|
value,
|
|
7765
7774
|
isControlled,
|
|
@@ -7802,10 +7811,11 @@ const useFileUploader = (props) => {
|
|
|
7802
7811
|
name: file.name,
|
|
7803
7812
|
errors: isFileAccepted(file, accept) ? [] : [t(texts$13.invalidFileType)]
|
|
7804
7813
|
})).concat(stateFiles);
|
|
7805
|
-
|
|
7814
|
+
const mergedFiles = [...stateFiles.filter((f) => f.url).map((f) => ({
|
|
7806
7815
|
name: f.name,
|
|
7807
7816
|
url: f.url
|
|
7808
|
-
})), ...newFiles.filter((f) => f.file).map((f) => f.file)]
|
|
7817
|
+
})), ...newFiles.filter((f) => f.file).map((f) => f.file)];
|
|
7818
|
+
onChange(mergedFiles);
|
|
7809
7819
|
if (!isControlled) dispatch({
|
|
7810
7820
|
type: "onSetFiles",
|
|
7811
7821
|
payload: newFiles
|
|
@@ -7829,10 +7839,11 @@ const useFileUploader = (props) => {
|
|
|
7829
7839
|
const removeFile = (0, react.useCallback)((file) => {
|
|
7830
7840
|
const newFiles = [...stateFiles];
|
|
7831
7841
|
newFiles.splice(stateFiles.indexOf(file), 1);
|
|
7832
|
-
|
|
7842
|
+
const mergedFiles = [...newFiles.filter((f) => f.url).map((f) => ({
|
|
7833
7843
|
name: f.name,
|
|
7834
7844
|
url: f.url
|
|
7835
|
-
})), ...newFiles.filter((f) => f.file).map((f) => f.file)]
|
|
7845
|
+
})), ...newFiles.filter((f) => f.file).map((f) => f.file)];
|
|
7846
|
+
onChange(mergedFiles);
|
|
7836
7847
|
if (!isControlled) dispatch({
|
|
7837
7848
|
type: "onRemoveFile",
|
|
7838
7849
|
payload: newFiles
|
|
@@ -8104,7 +8115,7 @@ const Footer = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime
|
|
|
8104
8115
|
//#region src/components/Footer/FooterListHeader.tsx
|
|
8105
8116
|
const FooterListHeader = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
|
|
8106
8117
|
level: 2,
|
|
8107
|
-
typographyType: "
|
|
8118
|
+
typographyType: "heading-small",
|
|
8108
8119
|
...props
|
|
8109
8120
|
});
|
|
8110
8121
|
//#endregion
|
|
@@ -8657,7 +8668,7 @@ const InternalHeader = (props) => {
|
|
|
8657
8668
|
...getBaseHTMLProps(id, cn(className, InternalHeader_module_default.bar, !!navigation && InternalHeader_module_default["bar--with-nav"]), style, htmlProps, rest),
|
|
8658
8669
|
children: [
|
|
8659
8670
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
8660
|
-
typographyType: "
|
|
8671
|
+
typographyType: "heading-small",
|
|
8661
8672
|
bold: true,
|
|
8662
8673
|
as: "span",
|
|
8663
8674
|
children: applicationHref ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
@@ -8668,7 +8679,7 @@ const InternalHeader = (props) => {
|
|
|
8668
8679
|
}) : applicationName
|
|
8669
8680
|
}),
|
|
8670
8681
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
8671
|
-
typographyType: "
|
|
8682
|
+
typographyType: "body-short-medium",
|
|
8672
8683
|
as: "span",
|
|
8673
8684
|
children: applicationDesc
|
|
8674
8685
|
}),
|
|
@@ -8881,7 +8892,7 @@ const Modal = ({ isOpen = false, parentElement, children, header, onClose, id, t
|
|
|
8881
8892
|
id: headerId,
|
|
8882
8893
|
children: typeof header === "string" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
|
|
8883
8894
|
level: 2,
|
|
8884
|
-
typographyType: "
|
|
8895
|
+
typographyType: "heading-large",
|
|
8885
8896
|
children: header
|
|
8886
8897
|
}) : header
|
|
8887
8898
|
}), onClose && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
@@ -9019,7 +9030,7 @@ const NewsPopover = ({ id, className, style, htmlProps, header, news, defaultAct
|
|
|
9019
9030
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
|
|
9020
9031
|
id: headerId,
|
|
9021
9032
|
level: 2,
|
|
9022
|
-
typographyType: "
|
|
9033
|
+
typographyType: "heading-small",
|
|
9023
9034
|
children: header
|
|
9024
9035
|
})
|
|
9025
9036
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
@@ -9543,7 +9554,8 @@ const NativeSelect = ({ ref, id, children, componentSize = "medium", label, mult
|
|
|
9543
9554
|
const selectRef = (0, react.useRef)(null);
|
|
9544
9555
|
const [hasValue, setHasValue] = (0, react.useState)(false);
|
|
9545
9556
|
(0, react.useEffect)(() => {
|
|
9546
|
-
|
|
9557
|
+
const selectedIndex = selectRef.current?.selectedIndex ?? -1;
|
|
9558
|
+
setHasValue(selectedIndex !== 0);
|
|
9547
9559
|
}, []);
|
|
9548
9560
|
(0, react.useEffect)(() => {
|
|
9549
9561
|
if (clearable) {
|
|
@@ -9839,7 +9851,7 @@ const Pagination = ({ itemsAmount, defaultItemsPerPage = 10, defaultActivePage =
|
|
|
9839
9851
|
componentSize: "small",
|
|
9840
9852
|
"aria-label": t(texts$8.itemsPerPage)
|
|
9841
9853
|
}), withCounter && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Paragraph, {
|
|
9842
|
-
typographyType: "
|
|
9854
|
+
typographyType: "body-short-medium",
|
|
9843
9855
|
children: t(texts$8.showsAmountOfTotalItems(activePageFirstItem, activePageLastItem, itemsAmount))
|
|
9844
9856
|
})]
|
|
9845
9857
|
}), navigation]
|
|
@@ -11409,7 +11421,7 @@ const Popover = ({ id, header, withCloseButton = true, onBlur, children, placeme
|
|
|
11409
11421
|
className: Popover_module_default.header,
|
|
11410
11422
|
children: typeof header === "string" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
|
|
11411
11423
|
level: 2,
|
|
11412
|
-
typographyType: "
|
|
11424
|
+
typographyType: "heading-medium",
|
|
11413
11425
|
children: header
|
|
11414
11426
|
}) : header
|
|
11415
11427
|
}),
|
|
@@ -11575,7 +11587,7 @@ const ProgressTrackerItem = (props) => {
|
|
|
11575
11587
|
children: stepNumberContent
|
|
11576
11588
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
11577
11589
|
as: "div",
|
|
11578
|
-
typographyType: "
|
|
11590
|
+
typographyType: "body-short-medium",
|
|
11579
11591
|
className: cn(ProgressTracker_module_default["item-text"], typographyStyles_module_default["a--nested__child"], isInactiveLink && ProgressTracker_module_default["item-text--inactive-link"]),
|
|
11580
11592
|
color: getTextColor(),
|
|
11581
11593
|
children
|
|
@@ -11854,7 +11866,8 @@ const Search$1 = ({ componentSize = "medium", buttonProps, showIcon = true, name
|
|
|
11854
11866
|
onChange?.(e);
|
|
11855
11867
|
};
|
|
11856
11868
|
const clearInput = () => {
|
|
11857
|
-
|
|
11869
|
+
const clearChangeEvent = createClearChangeEvent(uniqueId);
|
|
11870
|
+
handleChange(clearChangeEvent);
|
|
11858
11871
|
};
|
|
11859
11872
|
const { label: buttonLabel, onClick, ...otherButtonProps } = buttonProps ?? {};
|
|
11860
11873
|
const hasSuggestions = !!context.suggestions;
|
|
@@ -12060,7 +12073,7 @@ const SkipToContent = ({ text = "Til hovedinnhold", top = 0, id, className, html
|
|
|
12060
12073
|
...rest,
|
|
12061
12074
|
...htmlProps,
|
|
12062
12075
|
id,
|
|
12063
|
-
typographyType: "
|
|
12076
|
+
typographyType: "body-short-medium",
|
|
12064
12077
|
children: text
|
|
12065
12078
|
})
|
|
12066
12079
|
});
|
|
@@ -12856,7 +12869,7 @@ const ToggleBar = (props) => {
|
|
|
12856
12869
|
children: [label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
12857
12870
|
id: labelId,
|
|
12858
12871
|
as: "span",
|
|
12859
|
-
typographyType: "
|
|
12872
|
+
typographyType: "label-medium",
|
|
12860
12873
|
children: label
|
|
12861
12874
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Grid, {
|
|
12862
12875
|
defaultPageLayout: false,
|
|
@@ -13273,7 +13286,11 @@ exports.StylelessOList = StylelessOList;
|
|
|
13273
13286
|
exports.SunIcon = SunIcon;
|
|
13274
13287
|
exports.SupportIcon = SupportIcon;
|
|
13275
13288
|
exports.SyncIcon = SyncIcon;
|
|
13289
|
+
exports.TG_BODY_LONG_TYPES = TG_BODY_LONG_TYPES;
|
|
13290
|
+
exports.TG_BODY_SHORT_TYPES = TG_BODY_SHORT_TYPES;
|
|
13291
|
+
exports.TG_BODY_TYPES = TG_BODY_TYPES;
|
|
13276
13292
|
exports.TG_HEADING_TYPES = TG_HEADING_TYPES;
|
|
13293
|
+
exports.TG_LEAD_TYPES = TG_LEAD_TYPES;
|
|
13277
13294
|
exports.Tab = Tab;
|
|
13278
13295
|
exports.TabList = TabList;
|
|
13279
13296
|
exports.TabPanel = TabPanel;
|
|
@@ -13335,7 +13352,6 @@ exports.focusVisibleTransitionValue = focusVisibleTransitionValue;
|
|
|
13335
13352
|
exports.getBaseHTMLProps = getBaseHTMLProps;
|
|
13336
13353
|
exports.getColorCn = getColorCn;
|
|
13337
13354
|
exports.getElementType = getElementType;
|
|
13338
|
-
exports.getTypographyCn = getTypographyCn;
|
|
13339
13355
|
exports.handleElementWithBackdropMount = handleElementWithBackdropMount;
|
|
13340
13356
|
exports.handleElementWithBackdropUnmount = handleElementWithBackdropUnmount;
|
|
13341
13357
|
exports.hideInput = hideInput;
|