asksuite-citrus 2.0.0-beta.4 → 2.0.0-beta.6
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/lib/components/autocomplete/autocomplete.component.mjs +2 -2
- package/esm2022/lib/components/avatar/avatar.component.mjs +2 -2
- package/esm2022/lib/components/box/box.component.mjs +2 -2
- package/esm2022/lib/components/button/button.component.mjs +2 -2
- package/esm2022/lib/components/character-counter/character-counter.component.mjs +2 -2
- package/esm2022/lib/components/checkbox/checkbox.component.mjs +2 -2
- package/esm2022/lib/components/chips/chips.component.mjs +2 -2
- package/esm2022/lib/components/date-picker/date-picker-calendar/date-picker-calendar.component.mjs +2 -2
- package/esm2022/lib/components/date-picker/date-picker.component.mjs +2 -2
- package/esm2022/lib/components/dropdown-container/dropdown-container.component.mjs +2 -2
- package/esm2022/lib/components/input/input.component.mjs +2 -2
- package/esm2022/lib/components/modal/confirmation-modal/confirmation-modal.component.mjs +13 -9
- package/esm2022/lib/components/modal/modal.component.mjs +2 -2
- package/esm2022/lib/components/pagination/pagination.component.mjs +2 -2
- package/esm2022/lib/components/phone-ddi/phone-ddi.component.mjs +2 -2
- package/esm2022/lib/components/richtext-toolbox/richtext-toolbox.component.mjs +2 -2
- package/esm2022/lib/components/richtext-url-prompt/richtext-url-prompt.component.mjs +2 -2
- package/esm2022/lib/components/select/select.component.mjs +2 -2
- package/esm2022/lib/components/table/table.component.mjs +2 -2
- package/esm2022/lib/components/toast/toast.component.mjs +2 -2
- package/esm2022/lib/directives/button/ask-base-button.directive.mjs +17 -4
- package/esm2022/lib/services/modal/modal.config.mjs +2 -2
- package/esm2022/lib/services/modal/modal.service.mjs +19 -14
- package/fesm2022/asksuite-citrus.mjs +70 -50
- package/fesm2022/asksuite-citrus.mjs.map +1 -1
- package/lib/components/modal/confirmation-modal/confirmation-modal.component.d.ts +11 -1
- package/lib/directives/button/ask-base-button.directive.d.ts +9 -3
- package/lib/services/modal/modal.config.d.ts +2 -1
- package/lib/services/modal/modal.service.d.ts +5 -5
- package/package.json +1 -1
- package/styles/button.scss +65 -16
- package/styles/modal.scss +0 -1
@@ -1,4 +1,5 @@
|
|
1
|
-
import {
|
1
|
+
import { ButtonAppearance, ButtonColor } from '../../../directives/button/ask-base-button.directive';
|
2
|
+
import { ModalRef } from '../../../services/modal';
|
2
3
|
import * as i0 from "@angular/core";
|
3
4
|
export declare class ConfirmationModalComponent {
|
4
5
|
protected modalRef: ModalRef;
|
@@ -6,6 +7,7 @@ export declare class ConfirmationModalComponent {
|
|
6
7
|
protected text: string;
|
7
8
|
protected confirmButtonText: string | undefined;
|
8
9
|
protected cancelButtonText: string | undefined;
|
10
|
+
protected buttons: ButtonConfig[];
|
9
11
|
constructor(modalRef: ModalRef, data: AskModalConfirmData);
|
10
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmationModalComponent, never>;
|
11
13
|
static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmationModalComponent, "lib-confirmation-modal", never, {}, {}, never, never, false, never>;
|
@@ -13,6 +15,14 @@ export declare class ConfirmationModalComponent {
|
|
13
15
|
export interface AskModalConfirmData {
|
14
16
|
title: string;
|
15
17
|
text: string;
|
18
|
+
buttons?: ButtonConfig[];
|
16
19
|
confirmButtonText?: string;
|
17
20
|
cancelButtonText?: string;
|
18
21
|
}
|
22
|
+
type ButtonConfig = {
|
23
|
+
text: string;
|
24
|
+
appearance?: ButtonAppearance;
|
25
|
+
color: ButtonColor;
|
26
|
+
value: string;
|
27
|
+
};
|
28
|
+
export {};
|
@@ -1,11 +1,17 @@
|
|
1
|
-
import { ElementRef, OnChanges, SimpleChanges } from
|
1
|
+
import { ElementRef, OnChanges, SimpleChanges } from '@angular/core';
|
2
2
|
import * as i0 from "@angular/core";
|
3
3
|
export declare abstract class AskBaseButtonDirective implements OnChanges {
|
4
4
|
private el;
|
5
|
-
color:
|
5
|
+
color: ButtonColor;
|
6
|
+
size: ButtonSize;
|
6
7
|
protected constructor(el: ElementRef, className: string);
|
7
8
|
ngOnChanges(changes: SimpleChanges): void;
|
8
9
|
private updateColor;
|
10
|
+
private updateSize;
|
9
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<AskBaseButtonDirective, never>;
|
10
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AskBaseButtonDirective, never, never, { "color": { "alias": "color"; "required": false; }; }, {}, never, never, false, never>;
|
12
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AskBaseButtonDirective, never, never, { "color": { "alias": "color"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, {}, never, never, false, never>;
|
11
13
|
}
|
14
|
+
type ButtonSize = 'x-large' | 'large' | 'default' | 'medium' | 'small' | 'mini';
|
15
|
+
export type ButtonAppearance = 'outline' | 'text' | 'default';
|
16
|
+
export type ButtonColor = 'primary' | 'secondary' | 'danger';
|
17
|
+
export {};
|
@@ -1,9 +1,10 @@
|
|
1
|
-
import { InjectionToken } from
|
1
|
+
import { InjectionToken } from '@angular/core';
|
2
2
|
export type ModalConfig = {
|
3
3
|
hasBackdrop?: boolean;
|
4
4
|
onScroll?: 'close' | 'keep';
|
5
5
|
data?: any;
|
6
6
|
fullscreen?: boolean;
|
7
|
+
maxWidth?: number;
|
7
8
|
};
|
8
9
|
export declare const ASK_MODAL_CONFIG: InjectionToken<ModalConfig>;
|
9
10
|
export declare const ASK_MODAL_DATA: InjectionToken<any>;
|
@@ -1,9 +1,9 @@
|
|
1
|
+
import { Overlay } from '@angular/cdk/overlay';
|
1
2
|
import { Injector } from '@angular/core';
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import { AskModalConfirmData } from "../../components/modal/confirmation-modal/confirmation-modal.component";
|
3
|
+
import { AskModalConfirmData } from '../../components/modal/confirmation-modal/confirmation-modal.component';
|
4
|
+
import { ComponentType } from '../../components/modal/modal.component';
|
5
|
+
import { ModalRef } from './modal-ref';
|
6
|
+
import { ModalConfig } from './modal.config';
|
7
7
|
import * as i0 from "@angular/core";
|
8
8
|
export declare class ModalService {
|
9
9
|
private overlay;
|
package/package.json
CHANGED
package/styles/button.scss
CHANGED
@@ -1,23 +1,47 @@
|
|
1
1
|
@import "./tokens";
|
2
2
|
|
3
3
|
@mixin baseButton {
|
4
|
-
|
4
|
+
display: flex;
|
5
|
+
flex-direction: row;
|
6
|
+
align-items: center;
|
7
|
+
justify-content: center;
|
8
|
+
gap: 4px;
|
9
|
+
padding: 16px 24px;
|
5
10
|
border-radius: $radii-sm;
|
6
11
|
border: none;
|
7
12
|
outline: none;
|
8
|
-
height: 48px;
|
9
13
|
font-size: $font-md;
|
10
14
|
transition: background-color .1s, box-shadow .1s;
|
11
15
|
cursor: pointer;
|
12
16
|
font-weight: $font-weight-medium;
|
13
17
|
color: var(--grey-500);
|
18
|
+
|
19
|
+
&.-x-large {
|
20
|
+
padding: 24px 32px;
|
21
|
+
}
|
22
|
+
|
23
|
+
&.-large {
|
24
|
+
padding: 20px 28px;
|
25
|
+
}
|
26
|
+
|
27
|
+
&.-medium {
|
28
|
+
padding: 12px 20px;
|
29
|
+
}
|
30
|
+
|
31
|
+
&.-small {
|
32
|
+
padding: 8px 16px;
|
33
|
+
}
|
34
|
+
|
35
|
+
&.-mini {
|
36
|
+
padding: 4px 8px;
|
37
|
+
}
|
14
38
|
}
|
15
39
|
|
16
40
|
.ask-button {
|
17
41
|
@include baseButton;
|
18
42
|
background: white;
|
19
43
|
|
20
|
-
&:not(.-primary, .-secondary) {
|
44
|
+
&:not(.-primary, .-secondary, .-danger) {
|
21
45
|
box-shadow: 0 1px 2px 0 rgba(42, 48, 66, 0.16);
|
22
46
|
}
|
23
47
|
|
@@ -36,16 +60,24 @@
|
|
36
60
|
background-color: rgba(#fff,.8);
|
37
61
|
}
|
38
62
|
|
39
|
-
|
40
|
-
|
41
|
-
|
63
|
+
&.-danger:active:not(:disabled) {
|
64
|
+
background-color: rgba($error-red,.8);
|
65
|
+
}
|
66
|
+
|
67
|
+
&.-danger {
|
68
|
+
background: $error-red;
|
69
|
+
color: white;
|
42
70
|
}
|
43
71
|
|
44
|
-
// types
|
45
72
|
&.-primary {
|
46
73
|
background: $asksuite-orange;
|
47
74
|
color: white;
|
48
75
|
}
|
76
|
+
|
77
|
+
&:disabled {
|
78
|
+
cursor: not-allowed;
|
79
|
+
background-color: $grey-300;
|
80
|
+
}
|
49
81
|
}
|
50
82
|
|
51
83
|
.ask-text-button {
|
@@ -57,18 +89,27 @@
|
|
57
89
|
text-decoration: none;
|
58
90
|
background: $grey-50;
|
59
91
|
}
|
60
|
-
&:disabled {
|
61
|
-
cursor: not-allowed;
|
62
|
-
color: $grey-300;
|
63
|
-
}
|
64
92
|
|
65
93
|
&.-primary {
|
66
|
-
|
94
|
+
color: var(--asksuite-orange);
|
67
95
|
}
|
68
96
|
|
69
97
|
&.-secondary {
|
70
98
|
color: $grey-500;
|
71
99
|
}
|
100
|
+
|
101
|
+
&.-danger {
|
102
|
+
color: $error-red;
|
103
|
+
}
|
104
|
+
|
105
|
+
&.-danger:active:not(:disabled) {
|
106
|
+
background-color: rgba($error-red, .1);
|
107
|
+
}
|
108
|
+
|
109
|
+
&:disabled {
|
110
|
+
cursor: not-allowed;
|
111
|
+
color: $grey-300;
|
112
|
+
}
|
72
113
|
}
|
73
114
|
|
74
115
|
.ask-stroked-button {
|
@@ -86,18 +127,26 @@
|
|
86
127
|
color: $grey-500;
|
87
128
|
}
|
88
129
|
|
89
|
-
|
90
|
-
|
91
|
-
border-color: $
|
92
|
-
color: $grey-300;
|
130
|
+
&.-danger {
|
131
|
+
color: $error-red;
|
132
|
+
border-color: $error-red;
|
93
133
|
}
|
94
134
|
|
95
135
|
&.-primary:active:not(:disabled) {
|
96
136
|
background-color: rgba($asksuite-orange, .1);
|
97
137
|
}
|
98
138
|
|
139
|
+
&.-danger:active:not(:disabled) {
|
140
|
+
background-color: rgba($error-red, .1);
|
141
|
+
}
|
142
|
+
|
99
143
|
&.-secondary:active:not(:disabled) {
|
100
144
|
background-color: rgba($grey-300, .8);
|
101
145
|
}
|
102
146
|
|
147
|
+
&:disabled {
|
148
|
+
cursor: not-allowed;
|
149
|
+
border-color: $grey-300;
|
150
|
+
color: $grey-300;
|
151
|
+
}
|
103
152
|
}
|