@aaamb/ngx-design-system 1.3.6 → 1.3.7
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/fesm2022/aaamb-ngx-design-system.mjs +4034 -0
- package/fesm2022/aaamb-ngx-design-system.mjs.map +1 -0
- package/package.json +14 -58
- package/styles/compiled.css +2 -0
- package/types/aaamb-ngx-design-system.d.ts +1136 -0
- package/.editorconfig +0 -17
- package/.nvmrc +0 -1
- package/.postcssrc.json +0 -5
- package/.storybook/main.ts +0 -20
- package/.storybook/preview.ts +0 -23
- package/.storybook/storybook.css +0 -1
- package/.storybook/tsconfig.json +0 -19
- package/.vscode/extensions.json +0 -4
- package/.vscode/launch.json +0 -20
- package/.vscode/tasks.json +0 -42
- package/CHANGELOG.md +0 -10
- package/LOCAL_DEVELOPMENT.md +0 -129
- package/angular.json +0 -74
- package/bitbucket-pipelines.yml +0 -41
- package/iac/bin/app.ts +0 -42
- package/iac/cdk.json +0 -82
- package/iac/lib/config/environments.ts +0 -19
- package/iac/lib/config/types.ts +0 -13
- package/iac/lib/stacks/certificate-stack.ts +0 -34
- package/iac/lib/stacks/frontend-stack.ts +0 -120
- package/iac/lib/stacks/index.ts +0 -2
- package/iac/package-lock.json +0 -726
- package/iac/package.json +0 -25
- package/iac/tsconfig.json +0 -24
- package/ng-package.json +0 -8
- package/src/components/button/button-green.stories.ts +0 -101
- package/src/components/button/button-text.stories.ts +0 -105
- package/src/components/button/button-white.stories.ts +0 -105
- package/src/components/button/button.component.stories.ts +0 -91
- package/src/components/button/button.component.ts +0 -93
- package/src/components/checkbox/checkbox.component.html +0 -30
- package/src/components/checkbox/checkbox.component.stories.ts +0 -183
- package/src/components/checkbox/checkbox.component.ts +0 -211
- package/src/components/datepicker-selector/datepicker-selector.component.html +0 -103
- package/src/components/datepicker-selector/datepicker-selector.component.stories.ts +0 -69
- package/src/components/datepicker-selector/datepicker-selector.component.ts +0 -287
- package/src/components/error-message/error-message.component.html +0 -3
- package/src/components/error-message/error-message.component.ts +0 -13
- package/src/components/filter-button/filter-button.component.html +0 -286
- package/src/components/filter-button/filter-button.component.stories.ts +0 -123
- package/src/components/filter-button/filter-button.component.ts +0 -582
- package/src/components/icon/icon.component.ts +0 -20
- package/src/components/icon/icon.html +0 -1333
- package/src/components/icon/icon.stories.ts +0 -49
- package/src/components/icon/icons-list.stories.ts +0 -42
- package/src/components/input/input.component.stories.ts +0 -101
- package/src/components/input/input.component.ts +0 -317
- package/src/components/input/input.html +0 -160
- package/src/components/input-datepicker/input-datepicker.component.ts +0 -356
- package/src/components/input-datepicker/input-datepicker.html +0 -69
- package/src/components/input-datepicker/input-datepicker.stories.ts +0 -99
- package/src/components/input-rangepicker/input-rangepicker.component.ts +0 -365
- package/src/components/input-rangepicker/input-rangepicker.html +0 -54
- package/src/components/input-rangepicker/input-rangepicker.stories.ts +0 -88
- package/src/components/input-weekpicker/input-weekpicker.component.ts +0 -417
- package/src/components/input-weekpicker/input-weekpicker.html +0 -54
- package/src/components/input-weekpicker/input-weekpicker.stories.ts +0 -103
- package/src/components/label/label.component.html +0 -20
- package/src/components/label/label.component.ts +0 -22
- package/src/components/modals/delicate-confirmation-modal/delicate-confirmation-modal.component.html +0 -32
- package/src/components/modals/delicate-confirmation-modal/delicate-confirmation-modal.component.stories.ts +0 -57
- package/src/components/modals/delicate-confirmation-modal/delicate-confirmation-modal.component.ts +0 -48
- package/src/components/modals/feedback-modal/feedback-modal.component.html +0 -118
- package/src/components/modals/feedback-modal/feedback-modal.component.stories.ts +0 -93
- package/src/components/modals/feedback-modal/feedback-modal.component.ts +0 -187
- package/src/components/modals/help-modal/help-modal.component.html +0 -32
- package/src/components/modals/help-modal/help-modal.component.stories.ts +0 -76
- package/src/components/modals/help-modal/help-modal.component.ts +0 -54
- package/src/components/modals/information-modal/information-modal.component.html +0 -24
- package/src/components/modals/information-modal/information-modal.component.stories.ts +0 -62
- package/src/components/modals/information-modal/information-modal.component.ts +0 -35
- package/src/components/modals/main-modal/main-modal.component.html +0 -85
- package/src/components/modals/main-modal/main-modal.component.stories.ts +0 -127
- package/src/components/modals/main-modal/main-modal.component.ts +0 -85
- package/src/components/modals/notification-modal/notification-modal.component.html +0 -22
- package/src/components/modals/notification-modal/notification-modal.component.stories.ts +0 -59
- package/src/components/modals/notification-modal/notification-modal.component.ts +0 -37
- package/src/components/selectors/multiple-selector/multiple-selector.component.html +0 -51
- package/src/components/selectors/multiple-selector/multiple-selector.component.stories.ts +0 -306
- package/src/components/selectors/multiple-selector/multiple-selector.component.ts +0 -308
- package/src/components/selectors/single-selector/single-selector.component.html +0 -46
- package/src/components/selectors/single-selector/single-selector.component.stories.ts +0 -294
- package/src/components/selectors/single-selector/single-selector.component.ts +0 -239
- package/src/components/side-nav/side-nav.component.stories.ts +0 -157
- package/src/components/side-nav/side-nav.component.ts +0 -306
- package/src/components/snackbar/snackbar.component.ts +0 -150
- package/src/components/snackbar/snackbar.html +0 -21
- package/src/components/snackbar/snackbar.stories.ts +0 -51
- package/src/components/state/state.component.ts +0 -30
- package/src/components/state/state.html +0 -13
- package/src/components/state/state.stories.ts +0 -74
- package/src/components/table/table.component.html +0 -441
- package/src/components/table/table.component.scss +0 -28
- package/src/components/table/table.component.stories.ts +0 -655
- package/src/components/table/table.component.ts +0 -475
- package/src/components/tabs/tabs.component.stories.ts +0 -114
- package/src/components/tabs/tabs.component.ts +0 -69
- package/src/core/types.ts +0 -486
- package/src/public-api.ts +0 -23
- package/tsconfig.json +0 -37
- package/tsconfig.lib.json +0 -17
- package/tsconfig.lib.prod.json +0 -9
- package/tsconfig.spec.json +0 -13
package/iac/package.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "design-system-cdk",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"build": "tsc",
|
|
7
|
-
"watch": "tsc -w",
|
|
8
|
-
"cdk": "cdk",
|
|
9
|
-
"synth": "cdk synth",
|
|
10
|
-
"diff": "cdk diff",
|
|
11
|
-
"deploy:cert": "cdk deploy design-system-cert-us-east-1 --context createCert=true",
|
|
12
|
-
"deploy:frontend": "cdk deploy design-system-frontend"
|
|
13
|
-
},
|
|
14
|
-
"devDependencies": {
|
|
15
|
-
"@types/node": "^20.14.15",
|
|
16
|
-
"aws-cdk": "^2.170.0",
|
|
17
|
-
"ts-node": "^10.9.2",
|
|
18
|
-
"typescript": "^5.6.2"
|
|
19
|
-
},
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"aws-cdk-lib": "^2.170.0",
|
|
22
|
-
"constructs": "^10.3.0",
|
|
23
|
-
"source-map-support": "^0.5.21"
|
|
24
|
-
}
|
|
25
|
-
}
|
package/iac/tsconfig.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"lib": ["es2022"],
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"strict": true,
|
|
8
|
-
"noImplicitAny": true,
|
|
9
|
-
"strictNullChecks": true,
|
|
10
|
-
"noImplicitThis": true,
|
|
11
|
-
"alwaysStrict": true,
|
|
12
|
-
"noUnusedLocals": false,
|
|
13
|
-
"noUnusedParameters": false,
|
|
14
|
-
"noImplicitReturns": true,
|
|
15
|
-
"noFallthroughCasesInSwitch": false,
|
|
16
|
-
"inlineSourceMap": true,
|
|
17
|
-
"inlineSources": true,
|
|
18
|
-
"experimentalDecorators": true,
|
|
19
|
-
"strictPropertyInitialization": false,
|
|
20
|
-
"typeRoots": ["./node_modules/@types"],
|
|
21
|
-
"types": ["node"]
|
|
22
|
-
},
|
|
23
|
-
"exclude": ["node_modules", "cdk.out"]
|
|
24
|
-
}
|
package/ng-package.json
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
-
import { ButtonComponent } from './button.component';
|
|
3
|
-
import { IconComponent } from '../icon/icon.component';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<ButtonComponent> = {
|
|
6
|
-
title: 'Components/Button/Green',
|
|
7
|
-
component: ButtonComponent,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default meta;
|
|
11
|
-
type Story = StoryObj<ButtonComponent>;
|
|
12
|
-
|
|
13
|
-
export const AllStates: Story = {
|
|
14
|
-
name: 'All States',
|
|
15
|
-
render: () => ({
|
|
16
|
-
moduleMetadata: {
|
|
17
|
-
imports: [IconComponent],
|
|
18
|
-
},
|
|
19
|
-
template: `
|
|
20
|
-
<style>
|
|
21
|
-
.force-hover-green { background-color: var(--color-green-hover) !important; }
|
|
22
|
-
.force-active-green { background-color: var(--color-green-active) !important; }
|
|
23
|
-
.force-hover-green-icon { background-color: var(--color-green-hover) !important; }
|
|
24
|
-
.force-active-green-icon { background-color: var(--color-green-active) !important; }
|
|
25
|
-
</style>
|
|
26
|
-
<div style="display: flex; flex-direction: column; gap: 32px; padding: 24px;">
|
|
27
|
-
<div>
|
|
28
|
-
<h3 style="margin: 0 0 16px 0">Primary</h3>
|
|
29
|
-
<div style="display: flex; gap: 24px; align-items: start;">
|
|
30
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
31
|
-
<span style="font-weight: 600;">Default</span>
|
|
32
|
-
<button ads-button variant="primary" color="green">Button</button>
|
|
33
|
-
</div>
|
|
34
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
35
|
-
<span style="font-weight: 600;">Hovered</span>
|
|
36
|
-
<button ads-button variant="primary" color="green" class="force-hover-green">Button</button>
|
|
37
|
-
</div>
|
|
38
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
39
|
-
<span style="font-weight: 600;">Pressed</span>
|
|
40
|
-
<button ads-button variant="primary" color="green" class="force-active-green">Button</button>
|
|
41
|
-
</div>
|
|
42
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
43
|
-
<span style="font-weight: 600;">Disabled</span>
|
|
44
|
-
<button ads-button variant="primary" color="green" [disabled]="true">Button</button>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
<div>
|
|
49
|
-
<h3 style="margin: 0 0 16px 0">Secondary</h3>
|
|
50
|
-
<div style="display: flex; gap: 24px; align-items: start;">
|
|
51
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
52
|
-
<span style="font-weight: 600;">Default</span>
|
|
53
|
-
<button ads-button variant="secondary" color="green">Button</button>
|
|
54
|
-
</div>
|
|
55
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
56
|
-
<span style="font-weight: 600;">Hovered</span>
|
|
57
|
-
<button ads-button variant="secondary" color="green" class="force-hover-green">Button</button>
|
|
58
|
-
</div>
|
|
59
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
60
|
-
<span style="font-weight: 600;">Pressed</span>
|
|
61
|
-
<button ads-button variant="secondary" color="green" class="force-active-green">Button</button>
|
|
62
|
-
</div>
|
|
63
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
64
|
-
<span style="font-weight: 600;">Disabled</span>
|
|
65
|
-
<button ads-button variant="secondary" color="green" [disabled]="true">Button</button>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
<div>
|
|
70
|
-
<h3 style="margin: 0 0 16px 0">Only Icon Button</h3>
|
|
71
|
-
<div style="display: flex; gap: 24px; align-items: start; flex-wrap: wrap;">
|
|
72
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
73
|
-
<span style="font-weight: 600;">Primary - Default</span>
|
|
74
|
-
<button ads-button variant="primary" color="green" [onlyIconButton]="true">
|
|
75
|
-
<ads-icon iconName="table" [size]="16"></ads-icon>
|
|
76
|
-
</button>
|
|
77
|
-
</div>
|
|
78
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
79
|
-
<span style="font-weight: 600;">Primary - Hovered</span>
|
|
80
|
-
<button ads-button variant="primary" color="green" [onlyIconButton]="true" class="force-hover-green-icon">
|
|
81
|
-
<ads-icon iconName="table" [size]="16"></ads-icon>
|
|
82
|
-
</button>
|
|
83
|
-
</div>
|
|
84
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
85
|
-
<span style="font-weight: 600;">Primary - Pressed</span>
|
|
86
|
-
<button ads-button variant="primary" color="green" [onlyIconButton]="true" class="force-active-green-icon">
|
|
87
|
-
<ads-icon iconName="table" [size]="16"></ads-icon>
|
|
88
|
-
</button>
|
|
89
|
-
</div>
|
|
90
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
91
|
-
<span style="font-weight: 600;">Primary - Disabled</span>
|
|
92
|
-
<button ads-button variant="primary" color="green" [onlyIconButton]="true" [disabled]="true">
|
|
93
|
-
<ads-icon iconName="table" [size]="16"></ads-icon>
|
|
94
|
-
</button>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
`,
|
|
100
|
-
}),
|
|
101
|
-
};
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
-
import { ButtonComponent } from './button.component';
|
|
3
|
-
import { IconComponent } from '../icon/icon.component';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<ButtonComponent> = {
|
|
6
|
-
title: 'Components/Button/Text',
|
|
7
|
-
component: ButtonComponent,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default meta;
|
|
11
|
-
type Story = StoryObj<ButtonComponent>;
|
|
12
|
-
|
|
13
|
-
export const AllStates: Story = {
|
|
14
|
-
name: 'All States',
|
|
15
|
-
render: () => ({
|
|
16
|
-
moduleMetadata: {
|
|
17
|
-
imports: [IconComponent],
|
|
18
|
-
},
|
|
19
|
-
template: `
|
|
20
|
-
<style>
|
|
21
|
-
.force-hover-text-primary { background-color: var(--color-white-base) !important; color: var(--color-white-hover-text) !important; }
|
|
22
|
-
.force-active-text-primary { background-color: var(--color-aqua-6) !important; color: var(--color-black-base) !important; }
|
|
23
|
-
.force-hover-text-secondary { background-color: var(--color-white-base) !important; color: var(--color-white-hover-text) !important; }
|
|
24
|
-
.force-active-text-secondary { background-color: var(--color-aqua-5) !important; color: var(--color-black-base) !important; }
|
|
25
|
-
.force-hover-text-icon-primary { background-color: var(--color-white-base) !important; color: var(--color-white-hover-text) !important; }
|
|
26
|
-
.force-active-text-icon-primary { background-color: var(--color-aqua-6) !important; color: var(--color-black-base) !important; }
|
|
27
|
-
.force-hover-text-icon-secondary { background-color: var(--color-white-base) !important; color: var(--color-white-hover-text) !important; }
|
|
28
|
-
.force-active-text-icon-secondary { background-color: var(--color-aqua-5) !important; color: var(--color-black-base) !important; }
|
|
29
|
-
</style>
|
|
30
|
-
<div style="display: flex; flex-direction: column; gap: 32px; padding: 24px;">
|
|
31
|
-
<div>
|
|
32
|
-
<h3 style="margin: 0 0 16px 0">Primary</h3>
|
|
33
|
-
<div style="display: flex; gap: 24px; align-items: start; flex-wrap: wrap;">
|
|
34
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
35
|
-
<span style="font-weight: 600;">Default</span>
|
|
36
|
-
<button ads-button variant="primary" color="text">Button</button>
|
|
37
|
-
</div>
|
|
38
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
39
|
-
<span style="font-weight: 600;">Hovered</span>
|
|
40
|
-
<button ads-button variant="primary" color="text" class="force-hover-text-primary">Button</button>
|
|
41
|
-
</div>
|
|
42
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
43
|
-
<span style="font-weight: 600;">Pressed</span>
|
|
44
|
-
<button ads-button variant="primary" color="text" class="force-active-text-primary">Button</button>
|
|
45
|
-
</div>
|
|
46
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
47
|
-
<span style="font-weight: 600;">Disabled</span>
|
|
48
|
-
<button ads-button variant="primary" color="text" [disabled]="true">Button</button>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
<div>
|
|
53
|
-
<h3 style="margin: 0 0 16px 0">Secondary</h3>
|
|
54
|
-
<div style="display: flex; gap: 24px; align-items: start; flex-wrap: wrap;">
|
|
55
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
56
|
-
<span style="font-weight: 600;">Default</span>
|
|
57
|
-
<button ads-button variant="secondary" color="text">Button</button>
|
|
58
|
-
</div>
|
|
59
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
60
|
-
<span style="font-weight: 600;">Hovered</span>
|
|
61
|
-
<button ads-button variant="secondary" color="text" class="force-hover-text-secondary">Button</button>
|
|
62
|
-
</div>
|
|
63
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
64
|
-
<span style="font-weight: 600;">Pressed</span>
|
|
65
|
-
<button ads-button variant="secondary" color="text" class="force-active-text-secondary">Button</button>
|
|
66
|
-
</div>
|
|
67
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
68
|
-
<span style="font-weight: 600;">Disabled</span>
|
|
69
|
-
<button ads-button variant="secondary" color="text" [disabled]="true">Button</button>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
<div>
|
|
74
|
-
<h3 style="margin: 0 0 16px 0">Only Icon Button</h3>
|
|
75
|
-
<div style="display: flex; gap: 24px; align-items: start; flex-wrap: wrap;">
|
|
76
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
77
|
-
<span style="font-weight: 600;">Primary - Default</span>
|
|
78
|
-
<button ads-button variant="primary" color="text" [onlyIconButton]="true">
|
|
79
|
-
<ads-icon iconName="table" [size]="16"></ads-icon>
|
|
80
|
-
</button>
|
|
81
|
-
</div>
|
|
82
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
83
|
-
<span style="font-weight: 600;">Primary - Hovered</span>
|
|
84
|
-
<button ads-button variant="primary" color="text" [onlyIconButton]="true" class="force-hover-text-icon-primary">
|
|
85
|
-
<ads-icon iconName="table" [size]="16"></ads-icon>
|
|
86
|
-
</button>
|
|
87
|
-
</div>
|
|
88
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
89
|
-
<span style="font-weight: 600;">Primary - Pressed</span>
|
|
90
|
-
<button ads-button variant="primary" color="text" [onlyIconButton]="true" class="force-active-text-icon-primary">
|
|
91
|
-
<ads-icon iconName="table" [size]="16"></ads-icon>
|
|
92
|
-
</button>
|
|
93
|
-
</div>
|
|
94
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
95
|
-
<span style="font-weight: 600;">Primary - Disabled</span>
|
|
96
|
-
<button ads-button variant="primary" color="text" [onlyIconButton]="true" [disabled]="true">
|
|
97
|
-
<ads-icon iconName="table" [size]="16"></ads-icon>
|
|
98
|
-
</button>
|
|
99
|
-
</div>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
103
|
-
`,
|
|
104
|
-
}),
|
|
105
|
-
};
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
-
import { ButtonComponent } from './button.component';
|
|
3
|
-
import { IconComponent } from '../icon/icon.component';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<ButtonComponent> = {
|
|
6
|
-
title: 'Components/Button/White',
|
|
7
|
-
component: ButtonComponent,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default meta;
|
|
11
|
-
type Story = StoryObj<ButtonComponent>;
|
|
12
|
-
|
|
13
|
-
export const AllStates: Story = {
|
|
14
|
-
name: 'All States',
|
|
15
|
-
render: () => ({
|
|
16
|
-
moduleMetadata: {
|
|
17
|
-
imports: [IconComponent],
|
|
18
|
-
},
|
|
19
|
-
template: `
|
|
20
|
-
<style>
|
|
21
|
-
.force-hover-white-primary { color: var(--color-white-hover-text) !important; }
|
|
22
|
-
.force-active-white-primary { background-color: var(--color-white-pressed) !important; }
|
|
23
|
-
.force-hover-white-secondary { background-color: var(--color-white-base) !important; }
|
|
24
|
-
.force-active-white-secondary { background-color: var(--color-white-secondary-pressed) !important; }
|
|
25
|
-
.force-hover-white-primary-icon { color: var(--color-white-hover-text) !important; }
|
|
26
|
-
.force-active-white-primary-icon { background-color: var(--color-white-pressed) !important; color: var(--color-green-base) !important; }
|
|
27
|
-
.force-hover-white-secondary-icon { background-color: var(--color-white-base) !important; color: var(--color-white-hover-text) !important; }
|
|
28
|
-
.force-active-white-secondary-icon { background-color: var(--color-white-secondary-pressed) !important; color: var(--color-green-base) !important; }
|
|
29
|
-
</style>
|
|
30
|
-
<div style="display: flex; flex-direction: column; gap: 32px; padding: 24px; background-color: #014744; border-radius: 8px;">
|
|
31
|
-
<div>
|
|
32
|
-
<h3 style="margin: 0 0 16px 0; color: white;">Primary</h3>
|
|
33
|
-
<div style="display: flex; gap: 24px; align-items: start;">
|
|
34
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
35
|
-
<span style="font-weight: 600; color: white;">Default</span>
|
|
36
|
-
<button ads-button variant="primary" color="white">Button</button>
|
|
37
|
-
</div>
|
|
38
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
39
|
-
<span style="font-weight: 600; color: white;">Hovered</span>
|
|
40
|
-
<button ads-button variant="primary" color="white" class="force-hover-white-primary">Button</button>
|
|
41
|
-
</div>
|
|
42
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
43
|
-
<span style="font-weight: 600; color: white;">Pressed</span>
|
|
44
|
-
<button ads-button variant="primary" color="white" class="force-active-white-primary">Button</button>
|
|
45
|
-
</div>
|
|
46
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
47
|
-
<span style="font-weight: 600; color: white;">Disabled</span>
|
|
48
|
-
<button ads-button variant="primary" color="white" [disabled]="true">Button</button>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
<div>
|
|
53
|
-
<h3 style="margin: 0 0 16px 0; color: white;">Secondary</h3>
|
|
54
|
-
<div style="display: flex; gap: 24px; align-items: start;">
|
|
55
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
56
|
-
<span style="font-weight: 600; color: white;">Default</span>
|
|
57
|
-
<button ads-button variant="secondary" color="white">Button</button>
|
|
58
|
-
</div>
|
|
59
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
60
|
-
<span style="font-weight: 600; color: white;">Hovered</span>
|
|
61
|
-
<button ads-button variant="secondary" color="white" class="force-hover-white-secondary">Button</button>
|
|
62
|
-
</div>
|
|
63
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
64
|
-
<span style="font-weight: 600; color: white;">Pressed</span>
|
|
65
|
-
<button ads-button variant="secondary" color="white" class="force-active-white-secondary">Button</button>
|
|
66
|
-
</div>
|
|
67
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
68
|
-
<span style="font-weight: 600; color: white;">Disabled</span>
|
|
69
|
-
<button ads-button variant="secondary" color="white" [disabled]="true">Button</button>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
<div>
|
|
74
|
-
<h3 style="margin: 0 0 16px 0; color: white;">Only Icon Button</h3>
|
|
75
|
-
<div style="display: flex; gap: 24px; align-items: start; flex-wrap: wrap;">
|
|
76
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
77
|
-
<span style="font-weight: 600; color: white;">Primary - Default</span>
|
|
78
|
-
<button ads-button variant="primary" color="white" [onlyIconButton]="true">
|
|
79
|
-
<ads-icon iconName="table" [size]="16"></ads-icon>
|
|
80
|
-
</button>
|
|
81
|
-
</div>
|
|
82
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
83
|
-
<span style="font-weight: 600; color: white;">Primary - Hovered</span>
|
|
84
|
-
<button ads-button variant="primary" color="white" [onlyIconButton]="true" class="force-hover-white-primary-icon">
|
|
85
|
-
<ads-icon iconName="table" [size]="16"></ads-icon>
|
|
86
|
-
</button>
|
|
87
|
-
</div>
|
|
88
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
89
|
-
<span style="font-weight: 600; color: white;">Primary - Pressed</span>
|
|
90
|
-
<button ads-button variant="primary" color="white" [onlyIconButton]="true" class="force-active-white-primary-icon">
|
|
91
|
-
<ads-icon iconName="table" [size]="16"></ads-icon>
|
|
92
|
-
</button>
|
|
93
|
-
</div>
|
|
94
|
-
<div style="display: flex; flex-direction: column; gap: 12px; align-items: start;">
|
|
95
|
-
<span style="font-weight: 600; color: white;">Primary - Disabled</span>
|
|
96
|
-
<button ads-button variant="primary" color="white" [onlyIconButton]="true" [disabled]="true">
|
|
97
|
-
<ads-icon iconName="table" [size]="16"></ads-icon>
|
|
98
|
-
</button>
|
|
99
|
-
</div>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
103
|
-
`,
|
|
104
|
-
}),
|
|
105
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
-
import { ButtonComponent } from './button.component';
|
|
3
|
-
import { ICONS } from '../../core/types';
|
|
4
|
-
import { IconComponent } from '../icon/icon.component';
|
|
5
|
-
import { AdsIconName } from '../../public-api';
|
|
6
|
-
|
|
7
|
-
type ButtonProps = ButtonComponent & {
|
|
8
|
-
disabled: boolean;
|
|
9
|
-
iconButton: '' | AdsIconName;
|
|
10
|
-
fullWidth: boolean;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const meta: Meta<ButtonProps> = {
|
|
14
|
-
title: 'Components/Button',
|
|
15
|
-
component: ButtonComponent,
|
|
16
|
-
argTypes: {
|
|
17
|
-
variant: {
|
|
18
|
-
control: 'select',
|
|
19
|
-
options: ['primary', 'secondary'],
|
|
20
|
-
},
|
|
21
|
-
color: {
|
|
22
|
-
control: 'select',
|
|
23
|
-
options: ['green', 'white', 'text'],
|
|
24
|
-
},
|
|
25
|
-
disabled: {
|
|
26
|
-
control: 'boolean',
|
|
27
|
-
},
|
|
28
|
-
iconButton: {
|
|
29
|
-
control: 'select',
|
|
30
|
-
options: [...Object.keys(ICONS)],
|
|
31
|
-
},
|
|
32
|
-
buttonType: {
|
|
33
|
-
control: 'select',
|
|
34
|
-
options: ['button', 'submit', 'reset'],
|
|
35
|
-
},
|
|
36
|
-
onlyIconButton: {
|
|
37
|
-
control: 'boolean',
|
|
38
|
-
},
|
|
39
|
-
iconColor: {
|
|
40
|
-
control: 'color',
|
|
41
|
-
},
|
|
42
|
-
fullWidth: {
|
|
43
|
-
control: 'boolean',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
render: (args) => ({
|
|
47
|
-
moduleMetadata: {
|
|
48
|
-
imports: [IconComponent],
|
|
49
|
-
},
|
|
50
|
-
props: args,
|
|
51
|
-
template: `<button ads-button [variant]="variant" [color]="color" [disabled]="disabled" [iconButton]="iconButton" [type]="buttonType" [onlyIconButton]="onlyIconButton" [iconColor]="iconColor" [fullWidth]="fullWidth">
|
|
52
|
-
@if (iconButton) {
|
|
53
|
-
<ads-icon [iconName]="iconButton" [size]="16"></ads-icon>
|
|
54
|
-
}
|
|
55
|
-
@if (!onlyIconButton) {
|
|
56
|
-
Button Text
|
|
57
|
-
}
|
|
58
|
-
</button>`,
|
|
59
|
-
}),
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export default meta;
|
|
63
|
-
type Story = StoryObj<ButtonProps>;
|
|
64
|
-
|
|
65
|
-
export const Playground: Story = {
|
|
66
|
-
args: {
|
|
67
|
-
variant: 'primary',
|
|
68
|
-
color: 'green',
|
|
69
|
-
disabled: false,
|
|
70
|
-
iconButton: 'table',
|
|
71
|
-
buttonType: 'button',
|
|
72
|
-
onlyIconButton: false,
|
|
73
|
-
iconColor: '',
|
|
74
|
-
fullWidth: false,
|
|
75
|
-
},
|
|
76
|
-
argTypes: {
|
|
77
|
-
disabled: {
|
|
78
|
-
control: 'boolean',
|
|
79
|
-
},
|
|
80
|
-
iconButton: {
|
|
81
|
-
control: 'select',
|
|
82
|
-
options: ['', ...Object.keys(ICONS)],
|
|
83
|
-
labels: {
|
|
84
|
-
'': 'None',
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
onlyIconButton: {
|
|
88
|
-
control: 'boolean',
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { Component, computed, input, output } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
AdsButtonVariant,
|
|
4
|
-
AdsButtonColor,
|
|
5
|
-
AdsButtonType,
|
|
6
|
-
} from '../../core/types';
|
|
7
|
-
|
|
8
|
-
const VARIANT_STRUCTURE: Record<AdsButtonVariant, string> = {
|
|
9
|
-
primary:
|
|
10
|
-
'font-poppins font-medium text-base leading-3 rounded-[44px] px-16 py-4',
|
|
11
|
-
secondary:
|
|
12
|
-
'font-poppins font-normal text-base leading-6 rounded-[5px] px-8 py-2',
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const onlyIconButtonStructure =
|
|
16
|
-
'p-2 rounded-[14px] border-0 h-[2.5rem] w-[2.5rem]';
|
|
17
|
-
|
|
18
|
-
const onlyIconButtonVariantColor: Record<AdsButtonColor, string> = {
|
|
19
|
-
green:
|
|
20
|
-
'bg-green-base text-neutral-light-text hover:bg-green-hover active:bg-green-active disabled:bg-neutral-disabled-bg disabled:text-neutral-disabled-text',
|
|
21
|
-
white:
|
|
22
|
-
'bg-white-base text-green-base hover:text-white-hover-text active:bg-white-pressed active:text-green-base disabled:bg-neutral-disabled-bg disabled:text-neutral-disabled-text',
|
|
23
|
-
text: 'bg-transparent text-black-base hover:text-white-hover-text hover:bg-white-base active:bg-aqua-6 active:text-black-base disabled:text-neutral-disabled-text',
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const VARIANT_COLOR: Record<
|
|
27
|
-
AdsButtonVariant,
|
|
28
|
-
Record<AdsButtonColor, string>
|
|
29
|
-
> = {
|
|
30
|
-
primary: {
|
|
31
|
-
green:
|
|
32
|
-
'border-0 bg-green-base text-neutral-light-text hover:bg-green-hover active:bg-green-active disabled:bg-neutral-disabled-bg disabled:text-neutral-disabled-text',
|
|
33
|
-
white:
|
|
34
|
-
'border-none bg-white-base text-green-base hover:text-white-hover-text active:bg-white-pressed active:text-green-base disabled:bg-neutral-disabled-bg disabled:text-neutral-disabled-text',
|
|
35
|
-
text: 'border-0 bg-transparent text-black-base hover:text-white-hover-text hover:bg-white-base active:bg-aqua-6 active:text-black-base disabled:text-neutral-disabled-text',
|
|
36
|
-
},
|
|
37
|
-
secondary: {
|
|
38
|
-
green:
|
|
39
|
-
'border-0 bg-green-base text-neutral-light-text hover:bg-green-hover active:bg-green-active disabled:bg-neutral-disabled-bg disabled:text-neutral-disabled-text',
|
|
40
|
-
white:
|
|
41
|
-
'border border-solid border-green-base bg-white-secondary-base text-green-base hover:text-white-hover-text hover:bg-white-base active:bg-aqua-5 active:text-green-base disabled:bg-neutral-disabled-bg disabled:text-neutral-disabled-text disabled:border-green-base',
|
|
42
|
-
text: 'border-0 bg-transparent text-black-base hover:text-white-hover-text hover:bg-white-base active:bg-aqua-5 active:text-black-base disabled:text-neutral-disabled-text',
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
@Component({
|
|
47
|
-
selector: 'button[ads-button]',
|
|
48
|
-
standalone: true,
|
|
49
|
-
host: {
|
|
50
|
-
'[class]': 'hostClasses()',
|
|
51
|
-
'[style.color]': 'resolvedIconColor()',
|
|
52
|
-
'[disabled]': 'disabled()',
|
|
53
|
-
'(click)': 'handleClick()',
|
|
54
|
-
},
|
|
55
|
-
template: `<ng-content />`,
|
|
56
|
-
})
|
|
57
|
-
export class ButtonComponent {
|
|
58
|
-
variant = input<AdsButtonVariant>('primary');
|
|
59
|
-
color = input<AdsButtonColor>('green');
|
|
60
|
-
buttonType = input<AdsButtonType>('button');
|
|
61
|
-
disabled = input<boolean>(false);
|
|
62
|
-
fullWidth = input<boolean>(false);
|
|
63
|
-
iconButton = input<string>('');
|
|
64
|
-
onlyIconButton = input<boolean>(false);
|
|
65
|
-
iconColor = input<string>('');
|
|
66
|
-
|
|
67
|
-
clicked = output<void>();
|
|
68
|
-
|
|
69
|
-
resolvedIconColor = computed(() => {
|
|
70
|
-
if (this.disabled() || !this.onlyIconButton()) {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return this.iconColor() || null;
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
hostClasses = computed(() => {
|
|
78
|
-
const iconGapClass = this.iconButton().trim().length > 0 ? 'gap-2' : '';
|
|
79
|
-
const fullWidthClass = this.fullWidth() ? 'w-full' : '';
|
|
80
|
-
|
|
81
|
-
if (!this.onlyIconButton()) {
|
|
82
|
-
return `inline-flex items-center justify-center cursor-pointer transition-colors select-none disabled:pointer-events-none disabled:cursor-not-allowed ${fullWidthClass} ${iconGapClass} ${VARIANT_STRUCTURE[this.variant()]} ${VARIANT_COLOR[this.variant()][this.color()]}`;
|
|
83
|
-
} else {
|
|
84
|
-
return `inline-flex items-center justify-center cursor-pointer transition-colors select-none disabled:pointer-events-none disabled:cursor-not-allowed ${onlyIconButtonStructure} ${onlyIconButtonVariantColor[this.color()]}`;
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
handleClick(): void {
|
|
89
|
-
if (!this.disabled()) {
|
|
90
|
-
this.clicked.emit();
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<div [class]="wrapperClasses()">
|
|
2
|
-
@if (label() && labelPosition() === 'left') {
|
|
3
|
-
<span [class]="labelClasses()">{{ label() }}</span>
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
<button
|
|
7
|
-
type="button"
|
|
8
|
-
[disabled]="isDisabled()"
|
|
9
|
-
[attr.role]="controlRole()"
|
|
10
|
-
[attr.aria-checked]="currentChecked()"
|
|
11
|
-
[class]="controlClasses()"
|
|
12
|
-
(click)="onControlClick()"
|
|
13
|
-
>
|
|
14
|
-
@if (appearance() === 'square' && currentChecked()) {
|
|
15
|
-
<ads-icon iconName="check" [size]="30" />
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
@if (appearance() === 'toggle') {
|
|
19
|
-
<span [class]="toggleThumbClasses()"></span>
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@if (appearance() === 'radio' && currentChecked()) {
|
|
23
|
-
<span [class]="radioDotClasses()"></span>
|
|
24
|
-
}
|
|
25
|
-
</button>
|
|
26
|
-
|
|
27
|
-
@if (label() && labelPosition() === 'right') {
|
|
28
|
-
<span [class]="labelClasses()">{{ label() }}</span>
|
|
29
|
-
}
|
|
30
|
-
</div>
|