@design-system-rte/angular 0.4.4 → 0.5.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/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 +15 -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
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class RadioButtonComponent {
|
|
3
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
4
|
+
readonly groupName: import("@angular/core").InputSignal<string>;
|
|
5
|
+
readonly showLabel: import("@angular/core").InputSignal<boolean>;
|
|
6
|
+
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
7
|
+
readonly error: import("@angular/core").InputSignal<boolean>;
|
|
8
|
+
readonly readOnly: import("@angular/core").InputSignal<boolean>;
|
|
9
|
+
labelSize: number;
|
|
10
|
+
readonly isDisplayed: import("@angular/core").Signal<boolean>;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RadioButtonComponent, never>;
|
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RadioButtonComponent, "rte-radio-button", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "groupName": { "alias": "groupName"; "required": false; "isSignal": true; }; "showLabel": { "alias": "showLabel"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class RadioButtonGroupComponent {
|
|
3
|
+
readonly groupName: import("@angular/core").InputSignal<string>;
|
|
4
|
+
readonly items: import("@angular/core").InputSignal<string[]>;
|
|
5
|
+
readonly direction: import("@angular/core").InputSignal<string>;
|
|
6
|
+
readonly showItemsLabel: import("@angular/core").InputSignal<boolean>;
|
|
7
|
+
readonly groupTitle: import("@angular/core").InputSignal<string>;
|
|
8
|
+
readonly showGroupTitle: import("@angular/core").InputSignal<boolean>;
|
|
9
|
+
readonly groupHelpText: import("@angular/core").InputSignal<string>;
|
|
10
|
+
readonly showHelpText: import("@angular/core").InputSignal<boolean>;
|
|
11
|
+
readonly errorMessage: import("@angular/core").InputSignal<string>;
|
|
12
|
+
readonly error: import("@angular/core").InputSignal<boolean>;
|
|
13
|
+
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
14
|
+
readonly readOnly: import("@angular/core").InputSignal<boolean>;
|
|
15
|
+
readonly isDisplayed: import("@angular/core").Signal<boolean>;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RadioButtonGroupComponent, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RadioButtonGroupComponent, "rte-radio-button-group", never, { "groupName": { "alias": "groupName"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "direction": { "alias": "direction"; "required": false; "isSignal": true; }; "showItemsLabel": { "alias": "showItemsLabel"; "required": false; "isSignal": true; }; "groupTitle": { "alias": "groupTitle"; "required": false; "isSignal": true; }; "showGroupTitle": { "alias": "showGroupTitle"; "required": false; "isSignal": true; }; "groupHelpText": { "alias": "groupHelpText"; "required": false; "isSignal": true; }; "showHelpText": { "alias": "showHelpText"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@design-system-rte/angular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Angular components for the Design System RTE",
|
|
5
|
+
"license": "Apache-2.0",
|
|
5
6
|
"publishConfig": {
|
|
6
7
|
"access": "public"
|
|
7
8
|
},
|
|
@@ -14,8 +15,18 @@
|
|
|
14
15
|
"tslib": "^2.3.0"
|
|
15
16
|
},
|
|
16
17
|
"sideEffects": false,
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
"private": false,
|
|
19
|
+
"module": "fesm2022/design-system-rte-angular.mjs",
|
|
20
|
+
"typings": "index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
"./package.json": {
|
|
23
|
+
"default": "./package.json"
|
|
24
|
+
},
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./index.d.ts",
|
|
27
|
+
"esm2022": "./esm2022/design-system-rte-angular.mjs",
|
|
28
|
+
"esm": "./esm2022/design-system-rte-angular.mjs",
|
|
29
|
+
"default": "./fesm2022/design-system-rte-angular.mjs"
|
|
30
|
+
}
|
|
20
31
|
}
|
|
21
32
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# @design-system-rte/angular
|
|
2
|
-
|
|
3
|
-
## 0.4.4
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Bump to test changeset
|
|
8
|
-
|
|
9
|
-
## 0.4.3
|
|
10
|
-
|
|
11
|
-
### Patch Changes
|
|
12
|
-
|
|
13
|
-
- Bump version to test changeset
|
|
14
|
-
|
|
15
|
-
## 0.4.2
|
|
16
|
-
|
|
17
|
-
### Patch Changes
|
|
18
|
-
|
|
19
|
-
- Test of patch bump
|
|
20
|
-
|
|
21
|
-
## 0.4.1
|
|
22
|
-
|
|
23
|
-
### Patch Changes
|
|
24
|
-
|
|
25
|
-
- d6dd2fb: test changesets for Angular
|
package/ng-package.json
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<button
|
|
2
|
-
class="rte-button {{ variant() }} size-{{ size() }}"
|
|
3
|
-
[attr.aria-label]="ariaLabel()"
|
|
4
|
-
[attr.aria-labelledby]="ariaLabelledBy()"
|
|
5
|
-
[attr.type]="buttonType()"
|
|
6
|
-
[disabled]="disabled()"
|
|
7
|
-
(click)="onClick($event)"
|
|
8
|
-
>
|
|
9
|
-
<span class="rte-button-label">{{ label() }}</span>
|
|
10
|
-
</button>
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
@use '@design-system-rte/core/design-tokens/main.scss' as *;
|
|
2
|
-
|
|
3
|
-
.rte-button {
|
|
4
|
-
align-items: center;
|
|
5
|
-
cursor: pointer;
|
|
6
|
-
display: inline-flex;
|
|
7
|
-
flex-shrink: 0;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
|
|
10
|
-
&:focus-visible {
|
|
11
|
-
outline: 1px solid var(--border-brand-focused);
|
|
12
|
-
outline-offset: 4px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
&.size-s {
|
|
16
|
-
@include typography-button-s;
|
|
17
|
-
height: 24px;
|
|
18
|
-
border-radius: $radius-s;
|
|
19
|
-
padding: $positive-spacing_050 $positive-spacing_100;
|
|
20
|
-
|
|
21
|
-
.rte-button-label {
|
|
22
|
-
margin: 0 $positive-spacing_050;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&.size-m {
|
|
27
|
-
@include typography-button-m;
|
|
28
|
-
height: 32px;
|
|
29
|
-
border-radius: $radius-s;
|
|
30
|
-
padding: $positive-spacing_050 $positive-spacing_150;
|
|
31
|
-
|
|
32
|
-
.rte-button-label {
|
|
33
|
-
margin: 0 $positive-spacing_075;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&.size-l {
|
|
38
|
-
@include typography-button-l;
|
|
39
|
-
height: 40px;
|
|
40
|
-
border-radius: $radius-m;
|
|
41
|
-
padding: $positive-spacing_050 $positive-spacing_200;
|
|
42
|
-
|
|
43
|
-
.rte-button-label {
|
|
44
|
-
margin: 0 $positive-spacing_100;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&.primary {
|
|
49
|
-
border: var(--border-brand-default);
|
|
50
|
-
color: var(--content-primary-inverse);
|
|
51
|
-
background: var(--background-brand-default);
|
|
52
|
-
|
|
53
|
-
&:hover {
|
|
54
|
-
background: var(--background-brand-hover);
|
|
55
|
-
border: var(--background-brand-hover);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
&:active {
|
|
59
|
-
background: var(--background-brand-pressed);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&:disabled {
|
|
63
|
-
background: var(--background-disabled);
|
|
64
|
-
border: solid $width-xs var(--border-disabled);
|
|
65
|
-
color: var(--content-disabled);
|
|
66
|
-
box-shadow: none;
|
|
67
|
-
cursor: default;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
&.secondary {
|
|
72
|
-
background: var(--background-default);
|
|
73
|
-
border: solid $width-xs var(--border-brand-default);
|
|
74
|
-
color: var(--content-brand-default);
|
|
75
|
-
|
|
76
|
-
&:hover {
|
|
77
|
-
background: var(--background-brand-inverse-hover);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
&:active {
|
|
81
|
-
background: var(--background-brand-inverse-pressed);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
&:disabled {
|
|
85
|
-
background: var(--background-disabled);
|
|
86
|
-
border: solid $width-xs var(--border-disabled);
|
|
87
|
-
color: var(--content-disabled);
|
|
88
|
-
cursor: default;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
&.text {
|
|
93
|
-
background: transparent;
|
|
94
|
-
border: none;
|
|
95
|
-
color: var(--content-brand-default);
|
|
96
|
-
|
|
97
|
-
&:hover {
|
|
98
|
-
background: var(--background-brand-inverse-hover);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
&:active {
|
|
102
|
-
background: var(--background-brand-inverse-pressed);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
&:disabled {
|
|
106
|
-
background: var(--background-disabled);
|
|
107
|
-
color: var(--content-disabled);
|
|
108
|
-
cursor: default;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
&.transparent {
|
|
113
|
-
background: transparent;
|
|
114
|
-
border: none;
|
|
115
|
-
color: var(--content-brand-default);
|
|
116
|
-
|
|
117
|
-
&:hover {
|
|
118
|
-
color: var(--content-brand-hover);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
&:active {
|
|
122
|
-
color: var(--content-brand-press);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
&:disabled {
|
|
126
|
-
color: var(--content-disabled);
|
|
127
|
-
box-shadow: none;
|
|
128
|
-
cursor: default;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
&.danger {
|
|
133
|
-
background: var(--background-danger-default);
|
|
134
|
-
border: none;
|
|
135
|
-
color: var(--content-primary-inverse);
|
|
136
|
-
border-radius: $radius-m;
|
|
137
|
-
|
|
138
|
-
&:hover {
|
|
139
|
-
background: var(--background-danger-hover);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
&:active {
|
|
143
|
-
background: var(--background-danger-pressed);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
&:disabled {
|
|
147
|
-
background: var(--background-disabled);
|
|
148
|
-
border: var(--border-disabled);
|
|
149
|
-
color: var(--content-disabled);
|
|
150
|
-
box-shadow: none;
|
|
151
|
-
cursor: default;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from "@angular/core/testing";
|
|
2
|
-
|
|
3
|
-
import { ButtonComponent } from "./button.component";
|
|
4
|
-
|
|
5
|
-
describe("ButtonComponent", () => {
|
|
6
|
-
let component: ButtonComponent;
|
|
7
|
-
let fixture: ComponentFixture<ButtonComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
imports: [ButtonComponent],
|
|
12
|
-
}).compileComponents();
|
|
13
|
-
|
|
14
|
-
fixture = TestBed.createComponent(ButtonComponent);
|
|
15
|
-
component = fixture.componentInstance;
|
|
16
|
-
fixture.detectChanges();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it("should create", () => {
|
|
20
|
-
expect(component).toBeTruthy();
|
|
21
|
-
});
|
|
22
|
-
});
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { ENTER_KEY, TAB_KEY, SPACE_KEY } from "@design-system-rte/core/constants/keyboard.constants";
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/angular";
|
|
3
|
-
import { fn, userEvent, within, expect } from "@storybook/test";
|
|
4
|
-
|
|
5
|
-
import { ButtonComponent } from "./button.component";
|
|
6
|
-
|
|
7
|
-
const meta: Meta<ButtonComponent> = {
|
|
8
|
-
title: "Button",
|
|
9
|
-
component: ButtonComponent,
|
|
10
|
-
tags: ["autodocs"],
|
|
11
|
-
argTypes: {
|
|
12
|
-
variant: {
|
|
13
|
-
control: "select",
|
|
14
|
-
options: ["primary", "secondary", "text", "transparent", "danger"],
|
|
15
|
-
},
|
|
16
|
-
size: {
|
|
17
|
-
control: "select",
|
|
18
|
-
options: ["s", "m", "l"],
|
|
19
|
-
},
|
|
20
|
-
disabled: {
|
|
21
|
-
control: "boolean",
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
args: { click: fn() },
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export default meta;
|
|
28
|
-
type Story = StoryObj<ButtonComponent>;
|
|
29
|
-
|
|
30
|
-
const mockFn = fn();
|
|
31
|
-
|
|
32
|
-
export const Default: Story = {
|
|
33
|
-
args: {
|
|
34
|
-
variant: "primary",
|
|
35
|
-
label: "Button",
|
|
36
|
-
click: mockFn,
|
|
37
|
-
},
|
|
38
|
-
play: async ({ canvasElement }) => {
|
|
39
|
-
const canvas = within(canvasElement);
|
|
40
|
-
const button = canvas.getByRole("button");
|
|
41
|
-
await userEvent.click(button);
|
|
42
|
-
expect(mockFn).toHaveBeenCalled();
|
|
43
|
-
button.blur();
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const Sizing: Story = {
|
|
48
|
-
render: (args) => ({
|
|
49
|
-
props: args,
|
|
50
|
-
template: `
|
|
51
|
-
<div style="display: flex; gap: 8px;">
|
|
52
|
-
<rte-button
|
|
53
|
-
size="s"
|
|
54
|
-
label="Small"
|
|
55
|
-
variant="primary"
|
|
56
|
-
data-testid="small-button"
|
|
57
|
-
/>
|
|
58
|
-
<rte-button
|
|
59
|
-
size="m"
|
|
60
|
-
label="Medium"
|
|
61
|
-
variant="primary"
|
|
62
|
-
data-testid="medium-button"
|
|
63
|
-
/>
|
|
64
|
-
<rte-button
|
|
65
|
-
size="l"
|
|
66
|
-
label="Large"
|
|
67
|
-
variant="primary"
|
|
68
|
-
data-testid="large-button"
|
|
69
|
-
/>
|
|
70
|
-
</div>
|
|
71
|
-
`,
|
|
72
|
-
}),
|
|
73
|
-
play: async ({ canvasElement }) => {
|
|
74
|
-
const canvas = within(canvasElement);
|
|
75
|
-
const smallButton = canvas.getByTestId("small-button").getElementsByTagName("button")[0];
|
|
76
|
-
const mediumButton = canvas.getByTestId("medium-button").getElementsByTagName("button")[0];
|
|
77
|
-
const largeButton = canvas.getByTestId("large-button").getElementsByTagName("button")[0];
|
|
78
|
-
|
|
79
|
-
expect(smallButton.clientHeight).toBe(24);
|
|
80
|
-
expect(mediumButton.clientHeight).toBe(32);
|
|
81
|
-
expect(largeButton.clientHeight).toBe(40);
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export const KeyboardInteraction: Story = {
|
|
86
|
-
args: {
|
|
87
|
-
...Default.args,
|
|
88
|
-
},
|
|
89
|
-
play: async ({ canvasElement }) => {
|
|
90
|
-
const canvas = within(canvasElement);
|
|
91
|
-
const button = canvas.getByRole("button");
|
|
92
|
-
await userEvent.keyboard(TAB_KEY);
|
|
93
|
-
expect(button).toHaveFocus();
|
|
94
|
-
await userEvent.keyboard(ENTER_KEY);
|
|
95
|
-
await userEvent.keyboard(SPACE_KEY);
|
|
96
|
-
expect(mockFn).toHaveBeenCalledTimes(2);
|
|
97
|
-
button.blur();
|
|
98
|
-
},
|
|
99
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Component, input, output } from "@angular/core";
|
|
2
|
-
import { ButtonType } from "@design-system-rte/core/components/button/button.interface";
|
|
3
|
-
import { ButtonSize, ButtonVariant } from "@design-system-rte/core/components/button/common/common-button";
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: "rte-button",
|
|
7
|
-
imports: [],
|
|
8
|
-
standalone: true,
|
|
9
|
-
templateUrl: "./button.component.html",
|
|
10
|
-
styleUrl: "./button.component.scss",
|
|
11
|
-
})
|
|
12
|
-
export class ButtonComponent {
|
|
13
|
-
readonly label = input("");
|
|
14
|
-
readonly variant = input<ButtonVariant>("primary");
|
|
15
|
-
readonly size = input<ButtonSize>("m");
|
|
16
|
-
readonly disabled = input(false);
|
|
17
|
-
readonly icon = input<string>("");
|
|
18
|
-
readonly ariaLabel = input<string>("");
|
|
19
|
-
readonly ariaLabelledBy = input<string>("");
|
|
20
|
-
readonly buttonType = input<ButtonType>("button");
|
|
21
|
-
|
|
22
|
-
readonly click = output<void>();
|
|
23
|
-
|
|
24
|
-
onClick(event: MouseEvent | KeyboardEvent): void {
|
|
25
|
-
event.stopPropagation();
|
|
26
|
-
this.click.emit();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<div class="rte-checkbox-container">
|
|
2
|
-
<input
|
|
3
|
-
type="checkbox"
|
|
4
|
-
class="rte-checkbox"
|
|
5
|
-
[id]="id()"
|
|
6
|
-
[value]="value()"
|
|
7
|
-
[ngClass]="{'error': error(), 'read-only': readOnly()}"
|
|
8
|
-
[disabled]="disabled()"
|
|
9
|
-
[indeterminate]="indeterminate()"
|
|
10
|
-
[checked]="checked()"
|
|
11
|
-
(keydown)="onKeydown($event)"
|
|
12
|
-
/>
|
|
13
|
-
<rte-icon class="rte-checkbox-icons rte-checkbox-icon-selected" name="check-small" [size]="16"/>
|
|
14
|
-
<rte-icon class="rte-checkbox-icons rte-checkbox-icon-indeterminated" name="check-indeterminate" [size]="16" />
|
|
15
|
-
<div class="rte-checkbox-text-container">
|
|
16
|
-
<label
|
|
17
|
-
*ngIf="showLabel()"
|
|
18
|
-
class="rte-checkbox-label"
|
|
19
|
-
[for]="id()"
|
|
20
|
-
[ngClass]="{
|
|
21
|
-
'error': error(),
|
|
22
|
-
'read-only': readOnly(),
|
|
23
|
-
'disabled': disabled()
|
|
24
|
-
}"
|
|
25
|
-
>
|
|
26
|
-
{{ label() }}
|
|
27
|
-
</label>
|
|
28
|
-
<p class="rte-checkbox-description">{{ description() }}</p>
|
|
29
|
-
<p *ngIf="error() && errorMessage()" class="rte-checkbox-error">{{ errorMessage() }}</p>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
@use '@design-system-rte/core/design-tokens/main.scss' as *;
|
|
2
|
-
|
|
3
|
-
@mixin checked-indeterminate-style {
|
|
4
|
-
border: 1px solid var(--content-brand-default);
|
|
5
|
-
background: var(--background-brand-default);
|
|
6
|
-
|
|
7
|
-
&:hover {
|
|
8
|
-
&:not(:disabled):not(:active)::before {
|
|
9
|
-
opacity: $opacity-20;
|
|
10
|
-
background: var(--background-brand-default);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
&:disabled {
|
|
15
|
-
border: 1px solid var(--content-disabled);
|
|
16
|
-
background: var(--background-disabled);
|
|
17
|
-
|
|
18
|
-
~.rte-checkbox-icons {
|
|
19
|
-
color: var(--content-disabled);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&.error {
|
|
24
|
-
background: var(--background-danger-default);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.rte-checkbox-container {
|
|
29
|
-
display: flex;
|
|
30
|
-
gap: $positive-spacing-150;
|
|
31
|
-
|
|
32
|
-
.rte-checkbox {
|
|
33
|
-
appearance: none;
|
|
34
|
-
display: flex;
|
|
35
|
-
width: 16px;
|
|
36
|
-
height: 16px;
|
|
37
|
-
border-radius: $radius-xs;
|
|
38
|
-
border: 1px solid var(--content-tertiary);
|
|
39
|
-
opacity: $opacity-100;
|
|
40
|
-
background: var(--background-default);
|
|
41
|
-
align-items: center;
|
|
42
|
-
justify-content: center;
|
|
43
|
-
margin: $positive-spacing_050 0;
|
|
44
|
-
|
|
45
|
-
&::before {
|
|
46
|
-
content: '';
|
|
47
|
-
display: none;
|
|
48
|
-
position: absolute;
|
|
49
|
-
border-radius: $radius-pill;
|
|
50
|
-
background: var(--background-hover);
|
|
51
|
-
width: 32px;
|
|
52
|
-
height: 32px;
|
|
53
|
-
z-index: -1;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&:active::before {
|
|
57
|
-
opacity: $opacity-100;
|
|
58
|
-
transform: scale(0);
|
|
59
|
-
transition: transform 0s, opacity 0s;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&:focus-visible {
|
|
63
|
-
outline: 1px solid var(--border-brand-focused);
|
|
64
|
-
outline-offset: 4px;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&:hover {
|
|
68
|
-
cursor: pointer;
|
|
69
|
-
|
|
70
|
-
&:not(:disabled)::before {
|
|
71
|
-
display: inline-block;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
&:not(:disabled):not(:active)::before {
|
|
75
|
-
opacity: $opacity-50;
|
|
76
|
-
transition: transform 0.15s ease, opacity 0.3s ease;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
&:disabled {
|
|
81
|
-
cursor: default;
|
|
82
|
-
border: 1px solid var(--content-disabled);
|
|
83
|
-
background: var(--background-disabled);
|
|
84
|
-
|
|
85
|
-
~.rte-checkbox-text-container {
|
|
86
|
-
|
|
87
|
-
label,
|
|
88
|
-
.rte-checkbox-description {
|
|
89
|
-
color: var(--content-disabled);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
&:checked {
|
|
95
|
-
@include checked-indeterminate-style;
|
|
96
|
-
|
|
97
|
-
&:not(:indeterminate) {
|
|
98
|
-
~.rte-checkbox-icon-selected {
|
|
99
|
-
display: block;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
&:indeterminate {
|
|
105
|
-
@include checked-indeterminate-style;
|
|
106
|
-
|
|
107
|
-
~.rte-checkbox-icon-indeterminated {
|
|
108
|
-
display: block;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
&.read-only {
|
|
113
|
-
pointer-events: none;
|
|
114
|
-
cursor: default;
|
|
115
|
-
border: 1px solid var(--content-tertiary);
|
|
116
|
-
opacity: $opacity-100;
|
|
117
|
-
background: var(--background-disabled);
|
|
118
|
-
|
|
119
|
-
~.rte-checkbox-text-container {
|
|
120
|
-
|
|
121
|
-
label,
|
|
122
|
-
.checkbox-description {
|
|
123
|
-
color: var(--content-tertiary);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
~.rte-checkbox-icons {
|
|
128
|
-
color: var(--content-tertiary);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
&.error {
|
|
132
|
-
border: 1px solid var(--content-danger);
|
|
133
|
-
background: var(--background-disabled);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
&.error {
|
|
138
|
-
border: 1px solid var(--content-danger);
|
|
139
|
-
background: var(--background-default);
|
|
140
|
-
|
|
141
|
-
&:hover {
|
|
142
|
-
&:not(:disabled):not(:active)::before {
|
|
143
|
-
opacity: $opacity-20;
|
|
144
|
-
background: var(--background-danger-hover);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.rte-checkbox-text-container {
|
|
151
|
-
label {
|
|
152
|
-
@include typography-text-l;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.rte-checkbox-description {
|
|
156
|
-
@include typography-text-s;
|
|
157
|
-
margin: 0;
|
|
158
|
-
color: var(--content-tertiary);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.rte-checkbox-error {
|
|
162
|
-
@include typography-checkbox-error;
|
|
163
|
-
margin: 0;
|
|
164
|
-
color: var(--content-danger);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.rte-checkbox-icons {
|
|
169
|
-
display: none;
|
|
170
|
-
z-index: 1;
|
|
171
|
-
pointer-events: none;
|
|
172
|
-
transform: translateY(4px);
|
|
173
|
-
position: absolute;
|
|
174
|
-
color: white;
|
|
175
|
-
}
|
|
176
|
-
}
|