@bonniernews/dn-design-system-web 35.0.0 → 37.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/list-item/README.md +8 -7
- package/components/list-item/list-item-types.ts +35 -18
- 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/package.json +1 -1
- package/preact/components/list-item/list-item-types.d.ts +18 -15
- package/preact/components/list-item/list-item.js +78 -131
- 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/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
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,42 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## [37.0.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@36.0.0...@bonniernews/dn-design-system-web@37.0.0) (2026-01-12)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* **web:** list-item attribute fixes, delete radiobuttonlistitem (#1979)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **web:** list-item attribute fixes, delete radiobuttonlistitem ([#1979](https://github.com/BonnierNews/dn-design-system/issues/1979)) ([fb000aa](https://github.com/BonnierNews/dn-design-system/commit/fb000aac84482931403515fb8166d3c77a982a4f))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Maintenance
|
|
20
|
+
|
|
21
|
+
* **web:** update playwright version to 1.55.1 ([#1980](https://github.com/BonnierNews/dn-design-system/issues/1980)) ([37fe4bb](https://github.com/BonnierNews/dn-design-system/commit/37fe4bb5f96e0d302982d2c0d0409b9c7f7b833b))
|
|
22
|
+
* **web:** upgrade storybook to 8.6.15 ([#1981](https://github.com/BonnierNews/dn-design-system/issues/1981)) ([8a90524](https://github.com/BonnierNews/dn-design-system/commit/8a9052448e9927bfea338428b6186380060e825e))
|
|
23
|
+
|
|
24
|
+
## [36.0.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@35.0.0...@bonniernews/dn-design-system-web@36.0.0) (2026-01-08)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### ⚠ BREAKING CHANGES
|
|
28
|
+
|
|
29
|
+
* **web:** We renamed the radio button component to make it clear that it takes a list of radio buttons. It is now Radio Button Group
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* **web:** radio button renamed to radio button group ([#1977](https://github.com/BonnierNews/dn-design-system/issues/1977)) ([89e83c6](https://github.com/BonnierNews/dn-design-system/commit/89e83c636225652660c486045015c216b203deac))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Maintenance
|
|
37
|
+
|
|
38
|
+
* **app:** script for dynamicColorsIOS ([#1969](https://github.com/BonnierNews/dn-design-system/issues/1969)) ([78b4ab7](https://github.com/BonnierNews/dn-design-system/commit/78b4ab740578ce030e87adc2e43bfdb1d6c2ea22))
|
|
39
|
+
* **foundations:** fix token check security ([#1976](https://github.com/BonnierNews/dn-design-system/issues/1976)) ([600dc63](https://github.com/BonnierNews/dn-design-system/commit/600dc63f0bb818628a160f5b9ee9036d080e4a76))
|
|
40
|
+
* prerelease packages ([ada232c](https://github.com/BonnierNews/dn-design-system/commit/ada232cbd6791991d499944d21ec5a5e3c15c66e))
|
|
41
|
+
* **web:** fix build script security ([#1975](https://github.com/BonnierNews/dn-design-system/issues/1975)) ([9a3bf7d](https://github.com/BonnierNews/dn-design-system/commit/9a3bf7d2735ebfb73e39efc614327f50a6163ded))
|
|
42
|
+
|
|
7
43
|
## [35.0.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@34.2.2...@bonniernews/dn-design-system-web@35.0.0) (2025-12-10)
|
|
8
44
|
|
|
9
45
|
|
|
@@ -21,32 +21,32 @@ dsListItem(listElements);
|
|
|
21
21
|
|
|
22
22
|
| Name | Description | Default |
|
|
23
23
|
|:--- | :--- | :--- |
|
|
24
|
-
| listItemType\* | "standard", "toggle", "image", "accordion", "checkbox", "
|
|
24
|
+
| listItemType\* | "standard", "toggle", "image", "accordion", "checkbox", "switch" | \- |
|
|
25
25
|
| title | string | \- |
|
|
26
26
|
| subtitle | string | \- |
|
|
27
27
|
| meta | string | \- |
|
|
28
28
|
| border | boolean | \- |
|
|
29
29
|
| fontWeight | "bold", "regular", "semibold" | \- |
|
|
30
30
|
| attributes | { \[key: string\]: string; } | \- |
|
|
31
|
+
| linkAttributes | Applies to the left element: anchor<br />{ \[key: string\]: string; } | \- |
|
|
32
|
+
| disabled | boolean | \- |
|
|
31
33
|
| forcePx | boolean | \- |
|
|
32
34
|
| classNames | string | \- |
|
|
33
35
|
| leadingIcon | "search", "link", "add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "autoplay" | \- |
|
|
34
36
|
| accordionContent | any | \- |
|
|
35
37
|
| name | string | "ds-list-item" |
|
|
36
|
-
| href | string | \- |
|
|
37
|
-
| disabled | boolean | \- |
|
|
38
|
+
| href | Links entire list item<br />string | \- |
|
|
38
39
|
| checked | boolean | \- |
|
|
39
40
|
| stripLabel | boolean | \- |
|
|
41
|
+
| interactiveElementAttributes | Applied to the right element: checkbox or button ('toggle')<br />{ \[key: string\]: string; } | \- |
|
|
42
|
+
| interactiveElementClassNames | string | \- |
|
|
40
43
|
| mediaHtml\* | string | \- |
|
|
41
44
|
| trailingIcon | "search", "link", "add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "autoplay" | \- |
|
|
42
|
-
| selected | boolean | \- |
|
|
43
|
-
| id | string | "ds-list-item" |
|
|
44
|
-
| value | string | \- |
|
|
45
45
|
| showMeta | boolean | \- |
|
|
46
46
|
| metaOn | string | \- |
|
|
47
47
|
| metaOff | string | \- |
|
|
48
48
|
| componentClassName | string | \- |
|
|
49
|
-
| titleHref | string | \- |
|
|
49
|
+
| titleHref | Only links title<br />string | \- |
|
|
50
50
|
| toggleText\* | string | \- |
|
|
51
51
|
| toggleSelectedText\* | string | \- |
|
|
52
52
|
| selectedText\* | string | \- |
|
|
@@ -57,6 +57,7 @@ dsListItem(listElements);
|
|
|
57
57
|
| size | "sm", "lg", "md", "xl" | \- |
|
|
58
58
|
| loading | boolean | \- |
|
|
59
59
|
| isIconButton | boolean | \- |
|
|
60
|
+
| selected | boolean | \- |
|
|
60
61
|
| selectedIconName | "search", "link", "add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "autoplay" | \- |
|
|
61
62
|
| mobileFullWidth | Button will only full width on mobile<br />boolean | \- |
|
|
62
63
|
|
|
@@ -3,7 +3,6 @@ import { ComponentChildren } from 'preact'
|
|
|
3
3
|
import type { DsIcon } from '@bonniernews/dn-design-system-web/types-lib/ds-icon.d.ts'
|
|
4
4
|
|
|
5
5
|
import { ButtonToggleStandardProps } from '../button/button-types'
|
|
6
|
-
import { ButtonProps } from '../radio-button/radio-button'
|
|
7
6
|
import { SwitchInnerProps } from '../switch/switch'
|
|
8
7
|
|
|
9
8
|
export interface ListItemSharedProps {
|
|
@@ -14,25 +13,28 @@ export interface ListItemSharedProps {
|
|
|
14
13
|
fontWeight?: 'regular' | 'semibold' | 'bold'
|
|
15
14
|
attributes?: { [key: string]: string }
|
|
16
15
|
children?: ComponentChildren
|
|
16
|
+
/** Applies to the left element: anchor */
|
|
17
|
+
linkAttributes?: { [key: string]: string }
|
|
18
|
+
disabled?: boolean
|
|
17
19
|
forcePx?: boolean
|
|
18
20
|
classNames?: string
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
export interface ListItemBaseProps extends ListItemSharedProps {
|
|
22
|
-
listItemType: 'accordion' | 'checkbox' | '
|
|
23
|
-
|
|
24
|
+
listItemType: 'accordion' | 'checkbox' | 'switch' | 'image' | 'standard' | 'toggle'
|
|
25
|
+
/** Links entire list item */
|
|
24
26
|
href?: string
|
|
25
27
|
leadingIcon?: DsIcon
|
|
26
28
|
trailingIcon?: DsIcon
|
|
27
29
|
mediaHtml?: string
|
|
28
30
|
name?: string
|
|
29
|
-
id?: string
|
|
30
|
-
value?: string
|
|
31
31
|
accordionContent?: any
|
|
32
32
|
checked?: boolean
|
|
33
33
|
selected?: boolean
|
|
34
34
|
stripLabel?: boolean
|
|
35
|
-
|
|
35
|
+
/** Applied to the right element: checkbox or button ('toggle') */
|
|
36
|
+
interactiveElementAttributes?: { [key: string]: string }
|
|
37
|
+
interactiveElementClassNames?: string
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
export interface AccordionListItemProps
|
|
@@ -41,18 +43,21 @@ export interface AccordionListItemProps
|
|
|
41
43
|
|
|
42
44
|
export interface CheckboxListItemProps
|
|
43
45
|
extends ListItemSharedProps,
|
|
44
|
-
Pick<
|
|
46
|
+
Pick<
|
|
47
|
+
ListItemBaseProps,
|
|
48
|
+
| 'href'
|
|
49
|
+
| 'name'
|
|
50
|
+
| 'checked'
|
|
51
|
+
| 'stripLabel'
|
|
52
|
+
| 'disabled'
|
|
53
|
+
| 'interactiveElementAttributes'
|
|
54
|
+
| 'interactiveElementClassNames'
|
|
55
|
+
> {}
|
|
45
56
|
|
|
46
57
|
export interface ImageListItemProps extends ListItemSharedProps, Pick<ListItemBaseProps, 'href' | 'trailingIcon'> {
|
|
47
58
|
mediaHtml: string
|
|
48
59
|
}
|
|
49
60
|
|
|
50
|
-
export interface RadioListItemProps
|
|
51
|
-
extends ListItemSharedProps,
|
|
52
|
-
Pick<ListItemBaseProps, 'href' | 'name' | 'id' | 'selected' | 'stripLabel' | 'value' | 'disabled'> {
|
|
53
|
-
selected: boolean
|
|
54
|
-
}
|
|
55
|
-
|
|
56
61
|
export interface StandardListItemProps
|
|
57
62
|
extends ListItemSharedProps,
|
|
58
63
|
Pick<ListItemBaseProps, 'href' | 'leadingIcon' | 'trailingIcon'> {}
|
|
@@ -60,7 +65,15 @@ export interface StandardListItemProps
|
|
|
60
65
|
export interface SwitchListItemProps
|
|
61
66
|
extends ListItemSharedProps,
|
|
62
67
|
SwitchInnerProps,
|
|
63
|
-
Pick<
|
|
68
|
+
Pick<
|
|
69
|
+
ListItemBaseProps,
|
|
70
|
+
| 'leadingIcon'
|
|
71
|
+
| 'disabled'
|
|
72
|
+
| 'checked'
|
|
73
|
+
| 'stripLabel'
|
|
74
|
+
| 'interactiveElementAttributes'
|
|
75
|
+
| 'interactiveElementClassNames'
|
|
76
|
+
> {
|
|
64
77
|
name: string
|
|
65
78
|
}
|
|
66
79
|
|
|
@@ -69,6 +82,7 @@ export interface ToggleListItemProps
|
|
|
69
82
|
ButtonToggleStandardProps,
|
|
70
83
|
Pick<ListItemBaseProps, 'title' | 'subtitle' | 'disabled' | 'selected'> {
|
|
71
84
|
name: string
|
|
85
|
+
/** Only links title */
|
|
72
86
|
titleHref?: string
|
|
73
87
|
toggleText: string
|
|
74
88
|
toggleSelectedText: string
|
|
@@ -78,7 +92,6 @@ export type ListItemProps =
|
|
|
78
92
|
| ({ listItemType: 'accordion' } & AccordionListItemProps)
|
|
79
93
|
| ({ listItemType: 'checkbox' } & CheckboxListItemProps)
|
|
80
94
|
| ({ listItemType: 'image' } & ImageListItemProps)
|
|
81
|
-
| ({ listItemType: 'radio' } & RadioListItemProps)
|
|
82
95
|
| ({ listItemType: 'standard' } & StandardListItemProps)
|
|
83
96
|
| ({ listItemType: 'switch' } & SwitchListItemProps)
|
|
84
97
|
| ({ listItemType: 'toggle' } & ToggleListItemProps)
|
|
@@ -91,12 +104,12 @@ export interface InnerListItemProps
|
|
|
91
104
|
| 'href'
|
|
92
105
|
| 'accordionContent'
|
|
93
106
|
| 'name'
|
|
94
|
-
| 'id'
|
|
95
107
|
| 'checked'
|
|
96
108
|
| 'selected'
|
|
97
|
-
| 'value'
|
|
98
109
|
| 'forcePx'
|
|
99
110
|
| 'disabled'
|
|
111
|
+
| 'interactiveElementAttributes'
|
|
112
|
+
| 'interactiveElementClassNames'
|
|
100
113
|
>,
|
|
101
114
|
Pick<ButtonToggleStandardProps, 'variant'> {
|
|
102
115
|
componentClassName: string
|
|
@@ -104,6 +117,10 @@ export interface InnerListItemProps
|
|
|
104
117
|
toggleSelectedText?: string
|
|
105
118
|
}
|
|
106
119
|
|
|
107
|
-
export type TitleProps = Pick<
|
|
120
|
+
export type TitleProps = Pick<
|
|
121
|
+
ListItemBaseProps,
|
|
122
|
+
'title' | 'subtitle' | 'fontWeight' | 'disabled' | 'attributes' | 'linkAttributes'
|
|
123
|
+
> & {
|
|
108
124
|
componentClassName: string
|
|
125
|
+
titleHref?: string
|
|
109
126
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{% from '@bonniernews/dn-design-system-web/components/icon-sprite/icon-sprite.njk' import IconUse %}
|
|
2
2
|
{% from '@bonniernews/dn-design-system-web/components/switch/switch.njk' import Switch %}
|
|
3
3
|
{% from '@bonniernews/dn-design-system-web/components/checkbox/checkbox.njk' import Checkbox %}
|
|
4
|
-
{% from '@bonniernews/dn-design-system-web/components/radio-button/radio-button.njk' import RadioButton %}
|
|
5
4
|
{% from '@bonniernews/dn-design-system-web/components/button-toggle/button-toggle.njk' import ButtonToggle %}
|
|
6
5
|
{% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
|
|
7
6
|
|
|
@@ -99,19 +98,6 @@
|
|
|
99
98
|
{% endset %}
|
|
100
99
|
{{ caller() if caller }}
|
|
101
100
|
</label>
|
|
102
|
-
{% elif element == 'radio' %}
|
|
103
|
-
<label class="{{ classes }}" for="{{ params.id }}" {{- attributes | safe }}>
|
|
104
|
-
{% set iconLeftSvg %}
|
|
105
|
-
{{ RadioButton({
|
|
106
|
-
name: params.name,
|
|
107
|
-
condensed: true,
|
|
108
|
-
disabled: params.disabled,
|
|
109
|
-
forcePx: params.forcePx,
|
|
110
|
-
buttons: [{ id: params.id, checked: params.selected, attributes: params.elementAttributes, classNames: params.elementClassNames }]
|
|
111
|
-
})}}
|
|
112
|
-
{% endset %}
|
|
113
|
-
{{ caller() if caller }}
|
|
114
|
-
</label>
|
|
115
101
|
{% elif element == 'switch' %}
|
|
116
102
|
<label class="{{ classes }}" for="{{ params.name }}" {{- attributes | safe }} >
|
|
117
103
|
{% set iconRightSvg %}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@use "../icon-sprite/icon-sprite.scss";
|
|
3
3
|
@use "../checkbox/checkbox.scss" as *;
|
|
4
4
|
@use "../switch/switch.scss" as *;
|
|
5
|
-
@use "../radio-button/radio-button.scss" as *;
|
|
5
|
+
@use "../radio-button-group/radio-button-group.scss" as *;
|
|
6
6
|
@use "../button-toggle/button-toggle.scss" as *;
|
|
7
7
|
|
|
8
8
|
$ds-list-item__icon-size: 24px;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
RadioButtonGroup
|
|
2
|
+
================
|
|
3
3
|
|
|
4
|
-
* GitHub: [BonnierNews/dn-design-system/web/src/components/radio-button](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/radio-button)
|
|
5
|
-
* Storybook: [
|
|
4
|
+
* GitHub: [BonnierNews/dn-design-system/web/src/components/radio-button-group](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/radio-button-group)
|
|
5
|
+
* Storybook: [RadioButtonGroup](https://designsystem.dn.se/?path=/docs/basic-form-radiobuttongroup--docs)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
This component is used to render a group of radio buttons.
|
|
8
|
+
|
|
9
|
+
The component will not include styling by itself. Make sure to include the right styles for the component. See example below: `@use '@bonniernews/dn-design-system-web/components/radio-button-group/radio-button-group.scss`
|
|
8
10
|
|
|
9
11
|
| Name | Description | Default |
|
|
10
12
|
|:--- | :--- | :--- |
|
|
11
|
-
| buttons\* |
|
|
12
|
-
| id\* | string | \- |
|
|
13
|
+
| buttons\* | RadioButtonProps\[\] | \- |
|
|
13
14
|
| name | string | \- |
|
|
14
15
|
| error | boolean | \- |
|
|
15
16
|
| errorMessage | string | \- |
|
|
@@ -22,12 +23,18 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
22
23
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
23
24
|
|
|
24
25
|
```jsx
|
|
25
|
-
<
|
|
26
|
+
<RadioButtonGroup
|
|
26
27
|
buttons={[
|
|
27
28
|
{
|
|
28
|
-
id: '
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
id: 'my_radio_name1',
|
|
30
|
+
label: 'My radio 1',
|
|
31
|
+
selected: true,
|
|
32
|
+
value: 'my_radio_value1'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: 'my_radio_name2',
|
|
36
|
+
label: 'My radio 2',
|
|
37
|
+
value: 'my_radio_value2'
|
|
31
38
|
}
|
|
32
39
|
]}
|
|
33
40
|
name="my_radio_name"
|
package/components/{radio-button/radio-button.scss → radio-button-group/radio-button-group.scss}
RENAMED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
$ds-radio-btn__icon-size: 24px;
|
|
6
6
|
|
|
7
|
-
.ds-radio-btn {
|
|
7
|
+
.ds-radio-btn-group {
|
|
8
8
|
display: inline-flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
align-items: flex-start;
|
|
@@ -112,7 +112,7 @@ $ds-radio-btn__icon-size: 24px;
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
.ds-radio-btn input:disabled + .ds-radio-btn__inner {
|
|
115
|
+
.ds-radio-btn-group input:disabled + .ds-radio-btn__inner {
|
|
116
116
|
cursor: not-allowed;
|
|
117
117
|
.ds-radio-btn__icon {
|
|
118
118
|
color: $ds-color-text-primary-disabled;
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ComponentChildren } from 'preact';
|
|
2
2
|
import type { DsIcon } from '@bonniernews/dn-design-system-web/types-lib/ds-icon.d.ts';
|
|
3
3
|
import { ButtonToggleStandardProps } from '../button/button-types';
|
|
4
|
-
import { ButtonProps } from '../radio-button/radio-button';
|
|
5
4
|
import { SwitchInnerProps } from '../switch/switch';
|
|
6
5
|
export interface ListItemSharedProps {
|
|
7
6
|
title?: string;
|
|
@@ -13,42 +12,47 @@ export interface ListItemSharedProps {
|
|
|
13
12
|
[key: string]: string;
|
|
14
13
|
};
|
|
15
14
|
children?: ComponentChildren;
|
|
15
|
+
/** Applies to the left element: anchor */
|
|
16
|
+
linkAttributes?: {
|
|
17
|
+
[key: string]: string;
|
|
18
|
+
};
|
|
19
|
+
disabled?: boolean;
|
|
16
20
|
forcePx?: boolean;
|
|
17
21
|
classNames?: string;
|
|
18
22
|
}
|
|
19
23
|
export interface ListItemBaseProps extends ListItemSharedProps {
|
|
20
|
-
listItemType: 'accordion' | 'checkbox' | '
|
|
21
|
-
|
|
24
|
+
listItemType: 'accordion' | 'checkbox' | 'switch' | 'image' | 'standard' | 'toggle';
|
|
25
|
+
/** Links entire list item */
|
|
22
26
|
href?: string;
|
|
23
27
|
leadingIcon?: DsIcon;
|
|
24
28
|
trailingIcon?: DsIcon;
|
|
25
29
|
mediaHtml?: string;
|
|
26
30
|
name?: string;
|
|
27
|
-
id?: string;
|
|
28
|
-
value?: string;
|
|
29
31
|
accordionContent?: any;
|
|
30
32
|
checked?: boolean;
|
|
31
33
|
selected?: boolean;
|
|
32
34
|
stripLabel?: boolean;
|
|
33
|
-
|
|
35
|
+
/** Applied to the right element: checkbox or button ('toggle') */
|
|
36
|
+
interactiveElementAttributes?: {
|
|
37
|
+
[key: string]: string;
|
|
38
|
+
};
|
|
39
|
+
interactiveElementClassNames?: string;
|
|
34
40
|
}
|
|
35
41
|
export interface AccordionListItemProps extends ListItemSharedProps, Pick<ListItemBaseProps, 'accordionContent' | 'leadingIcon'> {
|
|
36
42
|
}
|
|
37
|
-
export interface CheckboxListItemProps extends ListItemSharedProps, Pick<ListItemBaseProps, 'href' | 'name' | 'checked' | 'stripLabel' | 'disabled'> {
|
|
43
|
+
export interface CheckboxListItemProps extends ListItemSharedProps, Pick<ListItemBaseProps, 'href' | 'name' | 'checked' | 'stripLabel' | 'disabled' | 'interactiveElementAttributes' | 'interactiveElementClassNames'> {
|
|
38
44
|
}
|
|
39
45
|
export interface ImageListItemProps extends ListItemSharedProps, Pick<ListItemBaseProps, 'href' | 'trailingIcon'> {
|
|
40
46
|
mediaHtml: string;
|
|
41
47
|
}
|
|
42
|
-
export interface RadioListItemProps extends ListItemSharedProps, Pick<ListItemBaseProps, 'href' | 'name' | 'id' | 'selected' | 'stripLabel' | 'value' | 'disabled'> {
|
|
43
|
-
selected: boolean;
|
|
44
|
-
}
|
|
45
48
|
export interface StandardListItemProps extends ListItemSharedProps, Pick<ListItemBaseProps, 'href' | 'leadingIcon' | 'trailingIcon'> {
|
|
46
49
|
}
|
|
47
|
-
export interface SwitchListItemProps extends ListItemSharedProps, SwitchInnerProps, Pick<ListItemBaseProps, 'leadingIcon' | 'disabled' | 'checked' | 'stripLabel' | '
|
|
50
|
+
export interface SwitchListItemProps extends ListItemSharedProps, SwitchInnerProps, Pick<ListItemBaseProps, 'leadingIcon' | 'disabled' | 'checked' | 'stripLabel' | 'interactiveElementAttributes' | 'interactiveElementClassNames'> {
|
|
48
51
|
name: string;
|
|
49
52
|
}
|
|
50
53
|
export interface ToggleListItemProps extends ListItemSharedProps, ButtonToggleStandardProps, Pick<ListItemBaseProps, 'title' | 'subtitle' | 'disabled' | 'selected'> {
|
|
51
54
|
name: string;
|
|
55
|
+
/** Only links title */
|
|
52
56
|
titleHref?: string;
|
|
53
57
|
toggleText: string;
|
|
54
58
|
toggleSelectedText: string;
|
|
@@ -60,19 +64,18 @@ export type ListItemProps = ({
|
|
|
60
64
|
} & CheckboxListItemProps) | ({
|
|
61
65
|
listItemType: 'image';
|
|
62
66
|
} & ImageListItemProps) | ({
|
|
63
|
-
listItemType: 'radio';
|
|
64
|
-
} & RadioListItemProps) | ({
|
|
65
67
|
listItemType: 'standard';
|
|
66
68
|
} & StandardListItemProps) | ({
|
|
67
69
|
listItemType: 'switch';
|
|
68
70
|
} & SwitchListItemProps) | ({
|
|
69
71
|
listItemType: 'toggle';
|
|
70
72
|
} & ToggleListItemProps);
|
|
71
|
-
export interface InnerListItemProps extends ListItemSharedProps, Pick<ListItemBaseProps, 'listItemType' | 'href' | 'accordionContent' | 'name' | '
|
|
73
|
+
export interface InnerListItemProps extends ListItemSharedProps, Pick<ListItemBaseProps, 'listItemType' | 'href' | 'accordionContent' | 'name' | 'checked' | 'selected' | 'forcePx' | 'disabled' | 'interactiveElementAttributes' | 'interactiveElementClassNames'>, Pick<ButtonToggleStandardProps, 'variant'> {
|
|
72
74
|
componentClassName: string;
|
|
73
75
|
toggleText?: string;
|
|
74
76
|
toggleSelectedText?: string;
|
|
75
77
|
}
|
|
76
|
-
export type TitleProps = Pick<ListItemBaseProps, 'title' | 'subtitle' | 'fontWeight' | 'attributes'> & {
|
|
78
|
+
export type TitleProps = Pick<ListItemBaseProps, 'title' | 'subtitle' | 'fontWeight' | 'disabled' | 'attributes' | 'linkAttributes'> & {
|
|
77
79
|
componentClassName: string;
|
|
80
|
+
titleHref?: string;
|
|
78
81
|
};
|