@design-system-rte/angular 0.4.4 → 0.4.5
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/esm2022/design-system-rte-angular.mjs +5 -0
- package/esm2022/lib/components/button/button.component.mjs +26 -0
- package/esm2022/lib/components/checkbox/checkbox.component.mjs +35 -0
- package/esm2022/lib/components/checkbox-group/checkbox-group.component.mjs +29 -0
- package/esm2022/lib/components/grid/col/col.directive.mjs +41 -0
- package/esm2022/lib/components/grid/grid.directive.mjs +30 -0
- package/esm2022/lib/components/icon/icon-map.mjs +303 -0
- package/esm2022/lib/components/icon/icon.component.mjs +39 -0
- package/esm2022/lib/components/icon/icon.service.mjs +33 -0
- package/esm2022/lib/components/link/link.component.mjs +20 -0
- package/esm2022/lib/components/radio-button/radio-button.component.mjs +24 -0
- package/esm2022/lib/components/radio-button-group/radio-button-group.component.mjs +29 -0
- package/esm2022/public-api.mjs +10 -0
- package/fesm2022/design-system-rte-angular.mjs +583 -0
- package/fesm2022/design-system-rte-angular.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/button/button.component.d.ts +17 -0
- package/lib/components/checkbox/checkbox.component.d.ts +18 -0
- package/lib/components/checkbox-group/checkbox-group.component.d.ts +18 -0
- package/lib/components/grid/col/col.directive.d.ts +14 -0
- package/lib/components/grid/grid.directive.d.ts +10 -0
- package/lib/components/icon/icon-map.d.ts +301 -0
- package/lib/components/icon/icon.component.d.ts +21 -0
- package/lib/components/icon/icon.service.d.ts +11 -0
- package/lib/components/link/link.component.d.ts +9 -0
- package/lib/components/radio-button/radio-button.component.d.ts +13 -0
- package/lib/components/radio-button-group/radio-button-group.component.d.ts +18 -0
- package/package.json +14 -4
- package/CHANGELOG.md +0 -25
- package/ng-package.json +0 -10
- package/src/lib/components/button/button.component.html +0 -10
- package/src/lib/components/button/button.component.scss +0 -154
- package/src/lib/components/button/button.component.spec.ts +0 -22
- package/src/lib/components/button/button.component.stories.ts +0 -99
- package/src/lib/components/button/button.component.ts +0 -28
- package/src/lib/components/checkbox/checkbox.component.html +0 -31
- package/src/lib/components/checkbox/checkbox.component.scss +0 -176
- package/src/lib/components/checkbox/checkbox.component.stories.ts +0 -126
- package/src/lib/components/checkbox/checkbox.component.ts +0 -34
- package/src/lib/components/checkbox-group/checkbox-group.component.html +0 -46
- package/src/lib/components/checkbox-group/checkbox-group.component.scss +0 -82
- package/src/lib/components/checkbox-group/checkbox-group.component.stories.ts +0 -121
- package/src/lib/components/checkbox-group/checkbox-group.component.ts +0 -28
- package/src/lib/components/grid/col/col.directive.ts +0 -35
- package/src/lib/components/grid/grid.directive.stories.ts +0 -150
- package/src/lib/components/grid/grid.directive.ts +0 -22
- package/src/lib/components/icon/icon-map.ts +0 -305
- package/src/lib/components/icon/icon.component.html +0 -1
- package/src/lib/components/icon/icon.component.scss +0 -3
- package/src/lib/components/icon/icon.component.ts +0 -58
- package/src/lib/components/icon/icon.service.ts +0 -33
- package/src/lib/components/icon/icon.stories.ts +0 -84
- package/src/lib/components/icon-button/icon-button.component.html +0 -16
- package/src/lib/components/icon-button/icon-button.component.scss +0 -165
- package/src/lib/components/icon-button/icon-button.component.ts +0 -40
- package/src/lib/components/icon-button/icon-button.stories.ts +0 -200
- package/src/lib/components/icon-button-toggle/icon-button-toggle.component.html +0 -12
- package/src/lib/components/icon-button-toggle/icon-button-toggle.component.ts +0 -36
- package/src/lib/components/icon-button-toggle/icon-button-toggle.stories.ts +0 -197
- package/src/lib/components/link/link.component.html +0 -6
- package/src/lib/components/link/link.component.scss +0 -108
- package/src/lib/components/link/link.component.stories.ts +0 -61
- package/src/lib/components/link/link.component.ts +0 -18
- package/src/lib/components/radio-button/radio-button.component.html +0 -24
- package/src/lib/components/radio-button/radio-button.component.scss +0 -135
- package/src/lib/components/radio-button/radio-button.component.stories.ts +0 -76
- package/src/lib/components/radio-button/radio-button.component.ts +0 -22
- package/src/lib/components/radio-button-group/radio-button-group.component.html +0 -45
- package/src/lib/components/radio-button-group/radio-button-group.component.scss +0 -82
- package/src/lib/components/radio-button-group/radio-button-group.component.stories.ts +0 -121
- package/src/lib/components/radio-button-group/radio-button-group.component.ts +0 -28
- package/src/lib/components/split-button/split-button.component.html +0 -56
- package/src/lib/components/split-button/split-button.component.scss +0 -288
- package/src/lib/components/split-button/split-button.component.stories.ts +0 -227
- package/src/lib/components/split-button/split-button.component.ts +0 -55
- package/src/lib/components/tooltip/tooltip.component.html +0 -7
- package/src/lib/components/tooltip/tooltip.component.scss +0 -116
- package/src/lib/components/tooltip/tooltip.component.ts +0 -16
- package/src/lib/components/tooltip/tooltip.directive.stories.ts +0 -218
- package/src/lib/components/tooltip/tooltip.directive.ts +0 -187
- package/tsconfig.lib.json +0 -20
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
- /package/{src/public-api.ts → public-api.d.ts} +0 -0
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<div *ngIf="isDisplayed()" class="rte-radio-button-container">
|
|
2
|
-
<input
|
|
3
|
-
type="radio"
|
|
4
|
-
class="rte-radio-button"
|
|
5
|
-
[id]="label()"
|
|
6
|
-
[value]="label()"
|
|
7
|
-
[size]="labelSize"
|
|
8
|
-
[name]="groupName()"
|
|
9
|
-
[ngClass]="{'error': error(), 'read-only': readOnly()}"
|
|
10
|
-
[disabled]="disabled()"
|
|
11
|
-
/>
|
|
12
|
-
<label
|
|
13
|
-
*ngIf="showLabel()"
|
|
14
|
-
class="rte-radio-button-label"
|
|
15
|
-
[for]="label()"
|
|
16
|
-
[ngClass]="{
|
|
17
|
-
'error': error(),
|
|
18
|
-
'read-only': readOnly(),
|
|
19
|
-
'disabled': disabled()
|
|
20
|
-
}"
|
|
21
|
-
>
|
|
22
|
-
{{ label() }}
|
|
23
|
-
</label>
|
|
24
|
-
</div>
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
@use '@design-system-rte/core/design-tokens/main.scss' as *;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
.rte-radio-button-container {
|
|
5
|
-
display: flex;
|
|
6
|
-
padding-right: $positive-spacing_050;
|
|
7
|
-
align-items: center;
|
|
8
|
-
gap: $positive-spacing_150;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.rte-radio-button {
|
|
12
|
-
appearance: none;
|
|
13
|
-
display: flex;
|
|
14
|
-
width: 16px;
|
|
15
|
-
height: 16px;
|
|
16
|
-
padding: $positive-spacing_0;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
align-items: center;
|
|
19
|
-
border-radius: $radius-pill;
|
|
20
|
-
border: $width-xs solid var(--content-tertiary);
|
|
21
|
-
background: var(--background-default);
|
|
22
|
-
position: relative;
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
transition: box-shadow 0.3s ease-in-out;
|
|
25
|
-
margin: 0;
|
|
26
|
-
|
|
27
|
-
&::before {
|
|
28
|
-
content: '';
|
|
29
|
-
width: 10px;
|
|
30
|
-
height: 10px;
|
|
31
|
-
border-radius: $radius-pill;
|
|
32
|
-
background: var(--content-brand-default);
|
|
33
|
-
opacity: $opacity-0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&::after {
|
|
37
|
-
content: '';
|
|
38
|
-
width: calc(100% + 8px);
|
|
39
|
-
height: calc(100% + 8px);
|
|
40
|
-
border-radius: $radius-s;
|
|
41
|
-
border: $width-xs solid var(--content-primary);
|
|
42
|
-
position: absolute;
|
|
43
|
-
z-index: -1;
|
|
44
|
-
opacity: $opacity-0;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&.error {
|
|
48
|
-
border: $width-xs solid var(--content-danger);
|
|
49
|
-
transition: box-shadow 0.3s ease-in-out;
|
|
50
|
-
|
|
51
|
-
&:checked {
|
|
52
|
-
border: $width-xs solid var(--content-danger);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
&::before {
|
|
56
|
-
background: var(--content-danger);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
&:hover {
|
|
60
|
-
transition: box-shadow 0.15s ease-in-out;
|
|
61
|
-
@include hover-box-shadow(var(--background-hover-opacity-50));
|
|
62
|
-
|
|
63
|
-
&:checked {
|
|
64
|
-
@include hover-box-shadow(var(--background-danger-hover-opacity-20));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
&.read-only {
|
|
70
|
-
pointer-events: none;
|
|
71
|
-
cursor: default;
|
|
72
|
-
|
|
73
|
-
&::before {
|
|
74
|
-
background: var(--content-tertiary);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
&:checked {
|
|
78
|
-
border: $width-xs solid var(--content-tertiary);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
&.error {
|
|
82
|
-
border: $width-xs solid var(--content-danger);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&:focus-visible {
|
|
87
|
-
outline: none;
|
|
88
|
-
|
|
89
|
-
&::after {
|
|
90
|
-
opacity: $opacity-100;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
&:checked {
|
|
95
|
-
border: $width-xs solid var(--content-brand-default);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
&:checked::before {
|
|
99
|
-
opacity: $opacity-100;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
&:hover {
|
|
103
|
-
@include hover-box-shadow(var(--background-hover-opacity-50));
|
|
104
|
-
|
|
105
|
-
&:checked {
|
|
106
|
-
@include hover-box-shadow(var(--background-brand-hover-opacity-20));
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
&:disabled {
|
|
111
|
-
pointer-events: none;
|
|
112
|
-
background: var(--background-disabled);
|
|
113
|
-
border: $width-xs solid var(--content-disabled);
|
|
114
|
-
cursor: not-allowed;
|
|
115
|
-
|
|
116
|
-
&::before {
|
|
117
|
-
background: var(--content-disabled);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.rte-radio-button-label {
|
|
123
|
-
@include typography-radio-button-l;
|
|
124
|
-
|
|
125
|
-
&.read-only {
|
|
126
|
-
pointer-events: none;
|
|
127
|
-
cursor: default;
|
|
128
|
-
color: var(--content-tertiary);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
&.disabled {
|
|
132
|
-
pointer-events: none;
|
|
133
|
-
color: var(--content-disabled);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/angular";
|
|
2
|
-
import { userEvent, within, expect } from "@storybook/test";
|
|
3
|
-
|
|
4
|
-
import { RadioButtonComponent } from "./radio-button.component";
|
|
5
|
-
|
|
6
|
-
const meta: Meta<RadioButtonComponent> = {
|
|
7
|
-
title: "RadioButton",
|
|
8
|
-
component: RadioButtonComponent,
|
|
9
|
-
tags: ["autodocs"],
|
|
10
|
-
argTypes: {
|
|
11
|
-
label: {
|
|
12
|
-
control: "text",
|
|
13
|
-
defaultValue: "Radio Button",
|
|
14
|
-
},
|
|
15
|
-
groupName: {
|
|
16
|
-
control: "text",
|
|
17
|
-
defaultValue: "radio-group",
|
|
18
|
-
},
|
|
19
|
-
showLabel: {
|
|
20
|
-
control: "boolean",
|
|
21
|
-
defaultValue: true,
|
|
22
|
-
},
|
|
23
|
-
disabled: {
|
|
24
|
-
control: "boolean",
|
|
25
|
-
defaultValue: false,
|
|
26
|
-
},
|
|
27
|
-
error: {
|
|
28
|
-
control: "boolean",
|
|
29
|
-
defaultValue: false,
|
|
30
|
-
},
|
|
31
|
-
readOnly: {
|
|
32
|
-
control: "boolean",
|
|
33
|
-
defaultValue: false,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
export default meta;
|
|
38
|
-
type Story = StoryObj<RadioButtonComponent>;
|
|
39
|
-
|
|
40
|
-
export const Default: Story = {
|
|
41
|
-
args: {
|
|
42
|
-
label: "Radio Button",
|
|
43
|
-
groupName: "radio-group",
|
|
44
|
-
showLabel: true,
|
|
45
|
-
disabled: false,
|
|
46
|
-
error: false,
|
|
47
|
-
readOnly: false,
|
|
48
|
-
},
|
|
49
|
-
play: async ({ canvasElement }) => {
|
|
50
|
-
const canvas = within(canvasElement);
|
|
51
|
-
const radioButton = canvas.getByRole("radio");
|
|
52
|
-
await userEvent.click(radioButton);
|
|
53
|
-
expect(radioButton).toBeChecked();
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const Disabled: Story = {
|
|
58
|
-
args: {
|
|
59
|
-
...Default.args,
|
|
60
|
-
disabled: true,
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export const Error: Story = {
|
|
65
|
-
args: {
|
|
66
|
-
...Default.args,
|
|
67
|
-
error: true,
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const ReadOnly: Story = {
|
|
72
|
-
args: {
|
|
73
|
-
...Default.args,
|
|
74
|
-
readOnly: true,
|
|
75
|
-
},
|
|
76
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from "@angular/common";
|
|
2
|
-
import { Component, computed, input } from "@angular/core";
|
|
3
|
-
import { labelSize } from "@design-system-rte/core/components/radio-button/radio-button.constants";
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: "rte-radio-button",
|
|
7
|
-
imports: [CommonModule],
|
|
8
|
-
standalone: true,
|
|
9
|
-
templateUrl: "./radio-button.component.html",
|
|
10
|
-
styleUrl: "./radio-button.component.scss",
|
|
11
|
-
})
|
|
12
|
-
export class RadioButtonComponent {
|
|
13
|
-
readonly label = input("");
|
|
14
|
-
readonly groupName = input("");
|
|
15
|
-
readonly showLabel = input(true);
|
|
16
|
-
readonly disabled = input(false);
|
|
17
|
-
readonly error = input(false);
|
|
18
|
-
readonly readOnly = input(false);
|
|
19
|
-
labelSize = labelSize;
|
|
20
|
-
|
|
21
|
-
readonly isDisplayed = computed(() => !(this.disabled() && this.error()));
|
|
22
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<div
|
|
2
|
-
*ngIf="isDisplayed()"
|
|
3
|
-
class="radio-button-group-container">
|
|
4
|
-
<div
|
|
5
|
-
class="radio-button-group-header"
|
|
6
|
-
[ngClass]="{
|
|
7
|
-
'disabled': disabled(),
|
|
8
|
-
'error': error(),
|
|
9
|
-
'read-only': readOnly(),
|
|
10
|
-
}">
|
|
11
|
-
<h3
|
|
12
|
-
*ngIf="showGroupTitle()"
|
|
13
|
-
class="group-title"
|
|
14
|
-
>
|
|
15
|
-
{{ groupTitle() }}
|
|
16
|
-
</h3>
|
|
17
|
-
<p
|
|
18
|
-
*ngIf="showHelpText()"
|
|
19
|
-
class="group-help-text"
|
|
20
|
-
>
|
|
21
|
-
{{ groupHelpText() }}
|
|
22
|
-
|
|
23
|
-
</p>
|
|
24
|
-
<p
|
|
25
|
-
*ngIf="error()"
|
|
26
|
-
class="group-error-message"
|
|
27
|
-
>
|
|
28
|
-
{{ errorMessage() }}
|
|
29
|
-
</p>
|
|
30
|
-
</div>
|
|
31
|
-
<div class="radio-button-group"
|
|
32
|
-
[ngClass]="{'horizontal': direction() === 'horizontal', 'vertical': direction() === 'vertical'}">
|
|
33
|
-
<ng-container
|
|
34
|
-
*ngFor="let item of items()">
|
|
35
|
-
<rte-radio-button
|
|
36
|
-
[label]="item"
|
|
37
|
-
[groupName]="groupName()"
|
|
38
|
-
[showLabel]="showItemsLabel()"
|
|
39
|
-
[disabled]="disabled()"
|
|
40
|
-
[error]="error()"
|
|
41
|
-
[readOnly]="readOnly()"
|
|
42
|
-
/>
|
|
43
|
-
</ng-container>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
@use '@design-system-rte/core/design-tokens/main.scss' as *;
|
|
2
|
-
|
|
3
|
-
.radio-button-group-container {
|
|
4
|
-
display: flex;
|
|
5
|
-
padding: $positive-spacing_0;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
justify-content: center;
|
|
8
|
-
align-items: flex-start;
|
|
9
|
-
gap: $positive-spacing_100;
|
|
10
|
-
|
|
11
|
-
.radio-button-group-header {
|
|
12
|
-
|
|
13
|
-
.group-title {
|
|
14
|
-
@include typography-heading-s;
|
|
15
|
-
align-self: stretch;
|
|
16
|
-
margin: $positive-spacing_0;
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.group-help-text {
|
|
21
|
-
@include typography-text-m;
|
|
22
|
-
color: var(--content-tertiary);
|
|
23
|
-
align-self: stretch;
|
|
24
|
-
margin: $positive-spacing_0;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.group-error-message {
|
|
28
|
-
@include typography-text-m-bold;
|
|
29
|
-
color: var(--content-danger);
|
|
30
|
-
align-self: stretch;
|
|
31
|
-
margin: $positive-spacing_0;
|
|
32
|
-
margin-top: $positive-spacing_050;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&.error {
|
|
36
|
-
.group-title {
|
|
37
|
-
color: var(--content-danger);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&.read-only {
|
|
42
|
-
.group-title {
|
|
43
|
-
color: var(--content-tertiary);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.error {
|
|
47
|
-
.group-title {
|
|
48
|
-
color: var(--content-danger);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
&.disabled {
|
|
54
|
-
|
|
55
|
-
pointer-events: none;
|
|
56
|
-
|
|
57
|
-
.group-title {
|
|
58
|
-
color: var(--content-disabled);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.group-help-text {
|
|
62
|
-
color: var(--content-disabled);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
.radio-button-group {
|
|
71
|
-
display: flex;
|
|
72
|
-
flex-direction: row;
|
|
73
|
-
padding: $positive-spacing_0;
|
|
74
|
-
align-items: flex-start;
|
|
75
|
-
gap: $positive-spacing_300;
|
|
76
|
-
|
|
77
|
-
&.vertical {
|
|
78
|
-
flex-direction: column;
|
|
79
|
-
gap: $positive-spacing_100;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/angular";
|
|
2
|
-
import { userEvent, within, expect } from "@storybook/test";
|
|
3
|
-
|
|
4
|
-
import { RadioButtonGroupComponent } from "./radio-button-group.component";
|
|
5
|
-
|
|
6
|
-
const meta: Meta<RadioButtonGroupComponent> = {
|
|
7
|
-
title: "RadioButtonGroup",
|
|
8
|
-
component: RadioButtonGroupComponent,
|
|
9
|
-
tags: ["autodocs"],
|
|
10
|
-
argTypes: {
|
|
11
|
-
groupName: {
|
|
12
|
-
control: "text",
|
|
13
|
-
defaultValue: "group1",
|
|
14
|
-
},
|
|
15
|
-
items: {
|
|
16
|
-
control: "object",
|
|
17
|
-
defaultValue: ["Option 1", "Option 2", "Option 3"],
|
|
18
|
-
},
|
|
19
|
-
direction: {
|
|
20
|
-
control: "select",
|
|
21
|
-
options: ["horizontal", "vertical"],
|
|
22
|
-
defaultValue: "horizontal",
|
|
23
|
-
},
|
|
24
|
-
showItemsLabel: {
|
|
25
|
-
control: "boolean",
|
|
26
|
-
defaultValue: true,
|
|
27
|
-
},
|
|
28
|
-
groupTitle: {
|
|
29
|
-
control: "text",
|
|
30
|
-
defaultValue: "Radio Button Group Title",
|
|
31
|
-
},
|
|
32
|
-
showGroupTitle: {
|
|
33
|
-
control: "boolean",
|
|
34
|
-
defaultValue: true,
|
|
35
|
-
},
|
|
36
|
-
groupHelpText: {
|
|
37
|
-
control: "text",
|
|
38
|
-
defaultValue: "This is a help text for the radio button group.",
|
|
39
|
-
},
|
|
40
|
-
showHelpText: {
|
|
41
|
-
control: "boolean",
|
|
42
|
-
defaultValue: true,
|
|
43
|
-
},
|
|
44
|
-
errorMessage: {
|
|
45
|
-
control: "text",
|
|
46
|
-
defaultValue: "This is an error message. Please select an option.",
|
|
47
|
-
},
|
|
48
|
-
error: {
|
|
49
|
-
control: "boolean",
|
|
50
|
-
defaultValue: false,
|
|
51
|
-
},
|
|
52
|
-
disabled: {
|
|
53
|
-
control: "boolean",
|
|
54
|
-
defaultValue: false,
|
|
55
|
-
},
|
|
56
|
-
readOnly: {
|
|
57
|
-
control: "boolean",
|
|
58
|
-
defaultValue: false,
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
export default meta;
|
|
63
|
-
type Story = StoryObj<RadioButtonGroupComponent>;
|
|
64
|
-
|
|
65
|
-
export const Default: Story = {
|
|
66
|
-
args: {
|
|
67
|
-
groupName: "group1",
|
|
68
|
-
items: ["Option 1", "Option 2", "Option 3"],
|
|
69
|
-
direction: "horizontal",
|
|
70
|
-
showItemsLabel: true,
|
|
71
|
-
groupTitle: "Radio Button Group Title",
|
|
72
|
-
showGroupTitle: true,
|
|
73
|
-
groupHelpText: "This is a help text for the radio button group.",
|
|
74
|
-
showHelpText: true,
|
|
75
|
-
errorMessage: "This is an error message. Please select an option.",
|
|
76
|
-
error: false,
|
|
77
|
-
disabled: false,
|
|
78
|
-
readOnly: false,
|
|
79
|
-
},
|
|
80
|
-
play: async ({ canvasElement }) => {
|
|
81
|
-
const canvas = within(canvasElement);
|
|
82
|
-
const radioButton = canvas.getByLabelText("Option 1");
|
|
83
|
-
await userEvent.click(radioButton);
|
|
84
|
-
expect(radioButton).toBeChecked();
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export const Disabled: Story = {
|
|
89
|
-
args: {
|
|
90
|
-
...Default.args,
|
|
91
|
-
disabled: true,
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
export const Error: Story = {
|
|
96
|
-
args: {
|
|
97
|
-
...Default.args,
|
|
98
|
-
error: true,
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export const ReadOnly: Story = {
|
|
103
|
-
args: {
|
|
104
|
-
...Default.args,
|
|
105
|
-
readOnly: true,
|
|
106
|
-
},
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export const Vertical: Story = {
|
|
110
|
-
args: {
|
|
111
|
-
...Default.args,
|
|
112
|
-
direction: "vertical",
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
export const Horizontal: Story = {
|
|
117
|
-
args: {
|
|
118
|
-
...Default.args,
|
|
119
|
-
direction: "horizontal",
|
|
120
|
-
},
|
|
121
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from "@angular/common";
|
|
2
|
-
import { Component, computed, input } from "@angular/core";
|
|
3
|
-
|
|
4
|
-
import { RadioButtonComponent } from "../radio-button/radio-button.component";
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: "rte-radio-button-group",
|
|
8
|
-
imports: [CommonModule, RadioButtonComponent],
|
|
9
|
-
standalone: true,
|
|
10
|
-
templateUrl: "./radio-button-group.component.html",
|
|
11
|
-
styleUrl: "./radio-button-group.component.scss",
|
|
12
|
-
})
|
|
13
|
-
export class RadioButtonGroupComponent {
|
|
14
|
-
readonly groupName = input("");
|
|
15
|
-
readonly items = input<string[]>([]);
|
|
16
|
-
readonly direction = input("horizontal");
|
|
17
|
-
readonly showItemsLabel = input(true);
|
|
18
|
-
readonly groupTitle = input("");
|
|
19
|
-
readonly showGroupTitle = input(false);
|
|
20
|
-
readonly groupHelpText = input("");
|
|
21
|
-
readonly showHelpText = input(false);
|
|
22
|
-
readonly errorMessage = input("");
|
|
23
|
-
readonly error = input(false);
|
|
24
|
-
readonly disabled = input(false);
|
|
25
|
-
readonly readOnly = input(false);
|
|
26
|
-
|
|
27
|
-
readonly isDisplayed = computed(() => !(this.disabled() && this.error()));
|
|
28
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
<div
|
|
2
|
-
class="split-button-container size-{{ size() }} {{appearance()}}"
|
|
3
|
-
[ngClass]="{'compact-spacing': compactSpacing()}"
|
|
4
|
-
>
|
|
5
|
-
<button
|
|
6
|
-
class="split-button-left size-{{ size() }}"
|
|
7
|
-
data-testid="Main action button"
|
|
8
|
-
type="button"
|
|
9
|
-
[disabled]="disabled()"
|
|
10
|
-
>
|
|
11
|
-
<rte-icon
|
|
12
|
-
*ngIf="icon()"
|
|
13
|
-
[name]="icon()!"
|
|
14
|
-
[size]="splitButtonLeftIconSize()"
|
|
15
|
-
/>
|
|
16
|
-
<p class="split-button-label size-{{ size() }}">
|
|
17
|
-
{{label()}}
|
|
18
|
-
</p>
|
|
19
|
-
</button>
|
|
20
|
-
|
|
21
|
-
<div
|
|
22
|
-
class="split-button-divider"
|
|
23
|
-
[ngClass]="{'disabled': disabled()}"
|
|
24
|
-
></div>
|
|
25
|
-
|
|
26
|
-
<div class="split-button-right-container">
|
|
27
|
-
<button
|
|
28
|
-
class="split-button-right size-{{ size() }}"
|
|
29
|
-
data-testid="Menu button"
|
|
30
|
-
type="button"
|
|
31
|
-
aria-haspopup="menu"
|
|
32
|
-
[attr.aria-expanded]="isOpen()"
|
|
33
|
-
[attr.aria-label]="ariaLabelRight()"
|
|
34
|
-
[attr.data-selected]="selected()"
|
|
35
|
-
[disabled]="disabled()"
|
|
36
|
-
(click)="isOpen.set(true)"
|
|
37
|
-
(mouseenter)="isOpen.set(true)"
|
|
38
|
-
(mouseleave)="isOpen.set(false)"
|
|
39
|
-
(keydown)="handleKeyDownOnRightButton($event)"
|
|
40
|
-
>
|
|
41
|
-
<div class="split-button-right-icon-container">
|
|
42
|
-
<rte-icon name="arrow-chevron-down"[size]="splitButtonRightIconSize()"/>
|
|
43
|
-
</div>
|
|
44
|
-
</button>
|
|
45
|
-
|
|
46
|
-
<div
|
|
47
|
-
class="split-button-dropdown position-{{ position() }}"
|
|
48
|
-
role="menu"
|
|
49
|
-
data-testid="Menu container"
|
|
50
|
-
[style.visibility]="isOpen() ? 'visible' : 'hidden'"
|
|
51
|
-
(keydown)="handleKeyDownOnMenu($event)"
|
|
52
|
-
>
|
|
53
|
-
<ng-content/>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|