@bonniernews/dn-design-system-web 34.2.2 → 36.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/components/disclaimer/disclaimer.scss +1 -1
- package/components/list-item/list-item-types.ts +2 -2
- package/components/list-item/list-item.njk +0 -14
- package/components/list-item/list-item.scss +1 -1
- package/components/{radio-button → radio-button-group}/README.md +18 -11
- package/components/{radio-button/radio-button.scss → radio-button-group/radio-button-group.scss} +2 -2
- package/components/teaser-native/teaser-native.scss +2 -2
- package/foundations/variables/colorsCssVariables.scss +32 -11
- package/foundations/variables/colorsDnDark.scss +32 -11
- package/foundations/variables/colorsDnLight.scss +32 -11
- package/foundations/variables/shadowsDnDark.scss +6 -6
- package/foundations/variables/shadowsDnLight.scss +6 -6
- package/foundations/variables/shadowsList.scss +1 -1
- package/foundations/variables/typographyList.scss +5 -0
- package/foundations/variables/typographyScreenExtraLarge.scss +35 -0
- package/foundations/variables/typographyScreenLarge.scss +35 -0
- package/foundations/variables/typographyScreenSmall.scss +35 -0
- package/package.json +1 -1
- package/preact/components/icon-with-wrapper/icon-with-wrapper.js +32 -11
- package/preact/components/icon-with-wrapper/icon-with-wrapper.js.map +2 -2
- package/preact/components/list-item/list-item-types.d.ts +2 -2
- package/preact/components/list-item/list-item.js +57 -57
- package/preact/components/list-item/list-item.js.map +4 -4
- package/preact/components/{radio-button/radio-button.d.ts → radio-button-group/radio-button-group.d.ts} +9 -8
- package/preact/components/{radio-button/radio-button.js → radio-button-group/radio-button-group.js} +12 -12
- package/preact/components/radio-button-group/radio-button-group.js.map +7 -0
- package/types-lib/ds-color.d.ts +32 -11
- package/variables/colors-css-variables.json +32 -11
- package/variables/colors-dark-mode.json +32 -11
- package/variables/colors-light-mode.json +32 -11
- package/variables/shadows-list.json +1 -1
- package/variables/typography-list.json +5 -0
- package/components/radio-button/README-njk.md +0 -49
- package/components/radio-button/radio-button.njk +0 -47
- package/preact/components/radio-button/radio-button.js.map +0 -7
|
@@ -264,54 +264,8 @@ var CheckboxIcons = ({ componentClassName }) => {
|
|
|
264
264
|
};
|
|
265
265
|
var checkbox_default = Checkbox;
|
|
266
266
|
|
|
267
|
-
// ../src/components/radio-button/radio-button.tsx
|
|
268
|
-
import { Fragment as Fragment2 } from "preact";
|
|
269
|
-
import { jsx as jsx8, jsxs as jsxs5 } from "preact/jsx-runtime";
|
|
270
|
-
var RadioButton = ({
|
|
271
|
-
buttons,
|
|
272
|
-
error,
|
|
273
|
-
name,
|
|
274
|
-
errorMessage,
|
|
275
|
-
required,
|
|
276
|
-
stripLabel,
|
|
277
|
-
disabled,
|
|
278
|
-
forcePx,
|
|
279
|
-
classNames
|
|
280
|
-
}) => {
|
|
281
|
-
const componentClassName = "ds-radio-btn";
|
|
282
|
-
const wrapperClasses = formatClassString([componentClassName, forcePx && "ds-force-px", classNames]);
|
|
283
|
-
return /* @__PURE__ */ jsx8(form_field_default, { error, errorMessage, wrapperClasses, children: buttons?.map((button) => {
|
|
284
|
-
const { id, selected, value, label, attributes } = button;
|
|
285
|
-
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
286
|
-
/* @__PURE__ */ jsx8(
|
|
287
|
-
"input",
|
|
288
|
-
{
|
|
289
|
-
type: "radio",
|
|
290
|
-
id,
|
|
291
|
-
name,
|
|
292
|
-
defaultChecked: selected,
|
|
293
|
-
disabled,
|
|
294
|
-
required,
|
|
295
|
-
value,
|
|
296
|
-
...attributes
|
|
297
|
-
}
|
|
298
|
-
),
|
|
299
|
-
stripLabel ? /* @__PURE__ */ jsx8("div", { className: `${componentClassName}__inner`, children: /* @__PURE__ */ jsx8(RadioButtonIcons, { componentClassName }) }) : /* @__PURE__ */ jsxs5("label", { className: `${componentClassName}__inner`, htmlFor: id, children: [
|
|
300
|
-
/* @__PURE__ */ jsx8(RadioButtonIcons, { componentClassName }),
|
|
301
|
-
label && /* @__PURE__ */ jsx8("span", { className: `${componentClassName}__text`, children: label })
|
|
302
|
-
] })
|
|
303
|
-
] }, id);
|
|
304
|
-
}) });
|
|
305
|
-
};
|
|
306
|
-
var RadioButtonIcons = ({ componentClassName }) => {
|
|
307
|
-
return /* @__PURE__ */ jsxs5("span", { className: `${componentClassName}__icon`, children: [
|
|
308
|
-
/* @__PURE__ */ jsx8(IconUse, { iconName: "radio_button_unchecked" }),
|
|
309
|
-
/* @__PURE__ */ jsx8(IconUse, { iconName: "radio_button_checked" })
|
|
310
|
-
] });
|
|
311
|
-
};
|
|
312
|
-
|
|
313
267
|
// ../src/components/switch/switch.tsx
|
|
314
|
-
import { Fragment as
|
|
268
|
+
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs5 } from "preact/jsx-runtime";
|
|
315
269
|
var Switch = ({
|
|
316
270
|
name = "ds-switch",
|
|
317
271
|
checked,
|
|
@@ -326,8 +280,8 @@ var Switch = ({
|
|
|
326
280
|
}) => {
|
|
327
281
|
const componentClassName = "ds-switch";
|
|
328
282
|
const classes = formatClassString([componentClassName, forcePx && "ds-force-px", classNames]);
|
|
329
|
-
return /* @__PURE__ */
|
|
330
|
-
/* @__PURE__ */
|
|
283
|
+
return /* @__PURE__ */ jsxs5("div", { className: classes, children: [
|
|
284
|
+
/* @__PURE__ */ jsx8(
|
|
331
285
|
"input",
|
|
332
286
|
{
|
|
333
287
|
type: "checkbox",
|
|
@@ -339,7 +293,7 @@ var Switch = ({
|
|
|
339
293
|
...attributes
|
|
340
294
|
}
|
|
341
295
|
),
|
|
342
|
-
stripLabel ? /* @__PURE__ */
|
|
296
|
+
stripLabel ? /* @__PURE__ */ jsx8("div", { className: `${componentClassName}__inner`, children: /* @__PURE__ */ jsx8(
|
|
343
297
|
SwitchInner,
|
|
344
298
|
{
|
|
345
299
|
...{
|
|
@@ -349,7 +303,7 @@ var Switch = ({
|
|
|
349
303
|
componentClassName
|
|
350
304
|
}
|
|
351
305
|
}
|
|
352
|
-
) }) : /* @__PURE__ */
|
|
306
|
+
) }) : /* @__PURE__ */ jsx8("label", { className: `${componentClassName}__inner`, tabIndex: 0, htmlFor: name, children: /* @__PURE__ */ jsx8(
|
|
353
307
|
SwitchInner,
|
|
354
308
|
{
|
|
355
309
|
...{
|
|
@@ -363,12 +317,58 @@ var Switch = ({
|
|
|
363
317
|
] });
|
|
364
318
|
};
|
|
365
319
|
var SwitchInner = ({ showMeta, metaOn, metaOff, componentClassName }) => {
|
|
366
|
-
return /* @__PURE__ */
|
|
367
|
-
showMeta && /* @__PURE__ */
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
-
/* @__PURE__ */
|
|
320
|
+
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
321
|
+
showMeta && /* @__PURE__ */ jsxs5("div", { className: `${componentClassName}__meta`, children: [
|
|
322
|
+
/* @__PURE__ */ jsx8("span", { className: `${componentClassName}__meta-on`, children: metaOn }),
|
|
323
|
+
/* @__PURE__ */ jsx8("span", { className: `${componentClassName}__meta-off`, children: metaOff })
|
|
370
324
|
] }),
|
|
371
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ jsx8("span", { className: `${componentClassName}__box`, children: /* @__PURE__ */ jsx8("span", { className: `${componentClassName}__knob` }) })
|
|
326
|
+
] });
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
// ../src/components/radio-button-group/radio-button-group.tsx
|
|
330
|
+
import { Fragment as Fragment3 } from "preact";
|
|
331
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "preact/jsx-runtime";
|
|
332
|
+
var RadioButtonGroup = ({
|
|
333
|
+
buttons,
|
|
334
|
+
error,
|
|
335
|
+
name,
|
|
336
|
+
errorMessage,
|
|
337
|
+
required,
|
|
338
|
+
stripLabel,
|
|
339
|
+
disabled,
|
|
340
|
+
forcePx,
|
|
341
|
+
classNames
|
|
342
|
+
}) => {
|
|
343
|
+
const radioButtonClassName = "ds-radio-btn";
|
|
344
|
+
const wrapperClasses = formatClassString(["ds-radio-btn-group", forcePx && "ds-force-px", classNames]);
|
|
345
|
+
return /* @__PURE__ */ jsx9(form_field_default, { error, errorMessage, wrapperClasses, children: buttons?.map((button) => {
|
|
346
|
+
const { id, selected, value, label, attributes } = button;
|
|
347
|
+
return /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
348
|
+
/* @__PURE__ */ jsx9(
|
|
349
|
+
"input",
|
|
350
|
+
{
|
|
351
|
+
type: "radio",
|
|
352
|
+
id,
|
|
353
|
+
name,
|
|
354
|
+
defaultChecked: selected,
|
|
355
|
+
disabled,
|
|
356
|
+
required,
|
|
357
|
+
value,
|
|
358
|
+
...attributes
|
|
359
|
+
}
|
|
360
|
+
),
|
|
361
|
+
stripLabel ? /* @__PURE__ */ jsx9("div", { className: `${radioButtonClassName}__inner`, children: /* @__PURE__ */ jsx9(RadioButtonIcons, { radioButtonClassName }) }) : /* @__PURE__ */ jsxs6("label", { className: `${radioButtonClassName}__inner`, htmlFor: id, children: [
|
|
362
|
+
/* @__PURE__ */ jsx9(RadioButtonIcons, { radioButtonClassName }),
|
|
363
|
+
label && /* @__PURE__ */ jsx9("span", { className: `${radioButtonClassName}__text`, children: label })
|
|
364
|
+
] })
|
|
365
|
+
] }, id);
|
|
366
|
+
}) });
|
|
367
|
+
};
|
|
368
|
+
var RadioButtonIcons = ({ radioButtonClassName }) => {
|
|
369
|
+
return /* @__PURE__ */ jsxs6("span", { className: `${radioButtonClassName}__icon`, children: [
|
|
370
|
+
/* @__PURE__ */ jsx9(IconUse, { iconName: "radio_button_unchecked" }),
|
|
371
|
+
/* @__PURE__ */ jsx9(IconUse, { iconName: "radio_button_checked" })
|
|
372
372
|
] });
|
|
373
373
|
};
|
|
374
374
|
|
|
@@ -473,7 +473,7 @@ var ListItemInner = ({
|
|
|
473
473
|
case "radio":
|
|
474
474
|
return /* @__PURE__ */ jsxs7("label", { className: classes, htmlFor: id, ...attributes, children: [
|
|
475
475
|
/* @__PURE__ */ jsx10(ListItemIconWrapper, { placement: "left", componentClassName, children: /* @__PURE__ */ jsx10(
|
|
476
|
-
|
|
476
|
+
RadioButtonGroup,
|
|
477
477
|
{
|
|
478
478
|
...{
|
|
479
479
|
id,
|