valtech-components 2.0.14 → 2.0.15

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.
Files changed (62) hide show
  1. package/ng-package.json +9 -0
  2. package/package.json +6 -14
  3. package/src/lib/assets/fonts/Khula-Bold.ttf +0 -0
  4. package/src/lib/assets/fonts/Khula-ExtraBold.ttf +0 -0
  5. package/src/lib/assets/fonts/Khula-Light.ttf +0 -0
  6. package/src/lib/assets/fonts/Khula-Regular.ttf +0 -0
  7. package/src/lib/assets/fonts/Khula-SemiBold.ttf +0 -0
  8. package/src/lib/assets/fonts/OFL.txt +93 -0
  9. package/src/lib/components/atoms/button/button.component.scss +5 -0
  10. package/src/lib/components/atoms/button/button.component.ts +54 -0
  11. package/src/lib/components/atoms/button/factory.ts +378 -0
  12. package/src/lib/components/atoms/button/types.ts +24 -0
  13. package/src/lib/components/types.ts +84 -0
  14. package/src/lib/services/download.service.ts +58 -0
  15. package/src/lib/services/lang-provider/components/lang-settings.ts +14 -0
  16. package/src/lib/services/lang-provider/components/theme-settings.ts +16 -0
  17. package/src/lib/services/lang-provider/content.ts +15 -0
  18. package/src/lib/services/lang-provider/lang-provider.service.ts +38 -0
  19. package/src/lib/services/lang-provider/types.ts +25 -0
  20. package/src/lib/services/local-storage.service.ts +18 -0
  21. package/src/lib/services/theme.service.ts +102 -0
  22. package/{lib/services/types.d.ts → src/lib/services/types.ts} +3 -1
  23. package/src/lib/shared/constants/storage.ts +2 -0
  24. package/src/lib/shared/utils/dom.ts +20 -0
  25. package/{public-api.d.ts → src/public-api.ts} +11 -0
  26. package/tsconfig.lib.json +14 -0
  27. package/tsconfig.lib.prod.json +10 -0
  28. package/tsconfig.spec.json +14 -0
  29. package/esm2022/lib/components/atoms/button/button.component.mjs +0 -69
  30. package/esm2022/lib/components/atoms/button/factory.mjs +0 -217
  31. package/esm2022/lib/components/atoms/button/types.mjs +0 -2
  32. package/esm2022/lib/components/types.mjs +0 -29
  33. package/esm2022/lib/services/download.service.mjs +0 -63
  34. package/esm2022/lib/services/lang-provider/components/lang-settings.mjs +0 -13
  35. package/esm2022/lib/services/lang-provider/components/theme-settings.mjs +0 -15
  36. package/esm2022/lib/services/lang-provider/content.mjs +0 -8
  37. package/esm2022/lib/services/lang-provider/lang-provider.service.mjs +0 -39
  38. package/esm2022/lib/services/lang-provider/types.mjs +0 -14
  39. package/esm2022/lib/services/local-storage.service.mjs +0 -16
  40. package/esm2022/lib/services/theme.service.mjs +0 -97
  41. package/esm2022/lib/services/types.mjs +0 -3
  42. package/esm2022/lib/shared/constants/storage.mjs +0 -3
  43. package/esm2022/lib/shared/utils/dom.mjs +0 -17
  44. package/esm2022/public-api.mjs +0 -18
  45. package/esm2022/valtech-components.mjs +0 -5
  46. package/fesm2022/valtech-components.mjs +0 -565
  47. package/fesm2022/valtech-components.mjs.map +0 -1
  48. package/index.d.ts +0 -5
  49. package/lib/components/atoms/button/button.component.d.ts +0 -20
  50. package/lib/components/atoms/button/factory.d.ts +0 -71
  51. package/lib/components/atoms/button/types.d.ts +0 -22
  52. package/lib/components/types.d.ts +0 -78
  53. package/lib/services/download.service.d.ts +0 -8
  54. package/lib/services/lang-provider/components/lang-settings.d.ts +0 -3
  55. package/lib/services/lang-provider/components/theme-settings.d.ts +0 -3
  56. package/lib/services/lang-provider/content.d.ts +0 -6
  57. package/lib/services/lang-provider/lang-provider.service.d.ts +0 -17
  58. package/lib/services/lang-provider/types.d.ts +0 -15
  59. package/lib/services/local-storage.service.d.ts +0 -6
  60. package/lib/services/theme.service.d.ts +0 -27
  61. package/lib/shared/constants/storage.d.ts +0 -2
  62. package/lib/shared/utils/dom.d.ts +0 -3
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/valtech-components",
4
+ "lib": {
5
+ "entryFile": "src/public-api.ts",
6
+ "styleIncludePaths": ["src/lib/assets/fonts"]
7
+ },
8
+ "assets": ["src/lib/components/styles", "src/lib/assets/fonts", "./styles"]
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "2.0.14",
3
+ "version": "2.0.15",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.0.0",
6
6
  "@angular/core": "^18.0.0",
@@ -10,17 +10,9 @@
10
10
  "tslib": "^2.3.0"
11
11
  },
12
12
  "sideEffects": false,
13
- "module": "fesm2022/valtech-components.mjs",
14
- "typings": "index.d.ts",
15
- "exports": {
16
- "./package.json": {
17
- "default": "./package.json"
18
- },
19
- ".": {
20
- "types": "./index.d.ts",
21
- "esm2022": "./esm2022/valtech-components.mjs",
22
- "esm": "./esm2022/valtech-components.mjs",
23
- "default": "./fesm2022/valtech-components.mjs"
24
- }
13
+ "devDependencies": {
14
+ "@ionic/angular": "^8.0.0",
15
+ "prettier": "^3.3.3",
16
+ "prettier-plugin-organize-imports": "^4.1.0"
25
17
  }
26
- }
18
+ }
@@ -0,0 +1,93 @@
1
+ Copyright (c) 2014, Erin McLaughlin (hello@erinmclaughlin.com). Digitized data copyright 2010, Google Corporation.
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://openfontlicense.org
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,5 @@
1
+ @import '../../styles/variables.scss';
2
+
3
+ ion-button {
4
+ font-family: var(--ion-default-font), Arial, sans-serif;
5
+ }
@@ -0,0 +1,54 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { Component, EventEmitter, Input, Output } from '@angular/core';
3
+ import { IonButton, IonIcon, IonSpinner, IonText } from '@ionic/angular/standalone';
4
+ import { DownloadService } from '../../../services/download.service';
5
+ import { ComponentStates } from '../../types';
6
+ import { ButtonMetadata } from './types';
7
+
8
+ @Component({
9
+ selector: 'val-button',
10
+ standalone: true,
11
+ imports: [CommonModule, IonButton, IonIcon, IonSpinner, IonText],
12
+ template: `
13
+ <ion-button
14
+ [type]="props.type"
15
+ [color]="props.color"
16
+ [expand]="props.expand"
17
+ [fill]="props.fill"
18
+ [size]="props.size"
19
+ [href]="props.href"
20
+ [target]="props.target"
21
+ [shape]="props.shape"
22
+ (click)="clickHandler()"
23
+ [disabled]="props.state === states.DISABLED"
24
+ >
25
+ <ion-icon *ngIf="props.icon" [slot]="props.icon.slot" [name]="props.icon.name"></ion-icon>
26
+ <ion-spinner *ngIf="props.state === states.WORKING" name="circular"></ion-spinner>
27
+ <ion-text *ngIf="props.state !== states.WORKING">{{ props.text }}</ion-text>
28
+ </ion-button>
29
+ `,
30
+ styleUrl: './button.component.scss',
31
+ })
32
+ export class ButtonComponent {
33
+ states = ComponentStates;
34
+
35
+ @Input()
36
+ props!: ButtonMetadata;
37
+
38
+ @Output()
39
+ onClick = new EventEmitter<string>();
40
+
41
+ constructor(private download: DownloadService) {}
42
+
43
+ ngOnInit() {}
44
+
45
+ clickHandler() {
46
+ if (this.props.download) {
47
+ this.download.downloadLinkFromBrowser(this.props.download);
48
+ }
49
+ if (this.props.state === this.states.DISABLED) {
50
+ return;
51
+ }
52
+ this.onClick.emit(this.props.token);
53
+ }
54
+ }
@@ -0,0 +1,378 @@
1
+ import { ButtonMetadata, IconMetada } from './types';
2
+
3
+ export const Icon = (name: string, slot: 'start' | 'end'): IconMetada => {
4
+ return {
5
+ name,
6
+ slot,
7
+ };
8
+ };
9
+
10
+ /* name convention: COLOR FILL SIZE [optionals: SHAPE EXPAND ICON HREF/DOWNLOAD] TYPE */
11
+
12
+ export const BaseDefault = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
13
+ return {
14
+ color: 'primary',
15
+ state: 'ENABLED',
16
+ text,
17
+ size: 'default',
18
+ type,
19
+ };
20
+ };
21
+
22
+ export const ClearDefault = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
23
+ return { ...BaseDefault(text, type), fill: 'clear' };
24
+ };
25
+
26
+ export const ClearDefaultRound = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
27
+ return { ...ClearDefault(text, type), shape: 'round' };
28
+ };
29
+
30
+ export const SolidDefault = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
31
+ return { ...BaseDefault(text, type), fill: 'solid' };
32
+ };
33
+
34
+ export const SolidDefaultRound = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
35
+ return { ...SolidDefault(text, type), shape: 'round' };
36
+ };
37
+
38
+ export const OutlineDefault = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
39
+ return { ...BaseDefault(text, type), fill: 'outline' };
40
+ };
41
+
42
+ export const OutlineDefaultRound = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
43
+ return { ...OutlineDefault(text, type), shape: 'round' };
44
+ };
45
+
46
+ export const ClearDefaultFull = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
47
+ return { ...ClearDefault(text, type), expand: 'full' };
48
+ };
49
+
50
+ export const ClearDefaultRoundFull = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
51
+ return { ...ClearDefaultRound(text, type), expand: 'full' };
52
+ };
53
+
54
+ export const ClearDefaultBlock = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
55
+ return { ...ClearDefault(text, type), expand: 'block' };
56
+ };
57
+
58
+ export const ClearDefaultRoundBlock = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
59
+ return { ...ClearDefaultRound(text, type), expand: 'block' };
60
+ };
61
+
62
+ export const SolidDefaultFull = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
63
+ return { ...SolidDefault(text, type), expand: 'full' };
64
+ };
65
+
66
+ export const SolidDefaultRoundFull = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
67
+ return { ...SolidDefaultRound(text, type), expand: 'full' };
68
+ };
69
+
70
+ export const SolidDefaultBlock = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
71
+ return { ...SolidDefault(text, type), expand: 'block' };
72
+ };
73
+
74
+ export const SolidDefaultRoundBlock = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
75
+ return { ...SolidDefaultRound(text, type), expand: 'block' };
76
+ };
77
+
78
+ export const OutlineDefaultFull = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
79
+ return { ...OutlineDefault(text, type), expand: 'full' };
80
+ };
81
+
82
+ export const OutlineDefaultRoundFull = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
83
+ return { ...OutlineDefaultRound(text, type), expand: 'full' };
84
+ };
85
+
86
+ export const OutlineDefaultBlock = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
87
+ return { ...OutlineDefault(text, type), expand: 'block' };
88
+ };
89
+
90
+ export const OutlineDefaultRoundBlock = (text: string, type: 'button' | 'submit' | 'reset'): ButtonMetadata => {
91
+ return { ...OutlineDefaultRound(text, type), expand: 'block' };
92
+ };
93
+
94
+ export const SolidDefaultButton = (text: string): ButtonMetadata => {
95
+ return SolidDefault(text, 'button');
96
+ };
97
+
98
+ export const SolidSmallButton = (text: string): ButtonMetadata => {
99
+ return { ...SolidDefault(text, 'button'), size: 'small' };
100
+ };
101
+
102
+ export const SolidLargeButton = (text: string): ButtonMetadata => {
103
+ return { ...SolidDefault(text, 'button'), size: 'large' };
104
+ };
105
+
106
+ export const SolidDefaultRoundButton = (text: string): ButtonMetadata => {
107
+ return SolidDefaultRound(text, 'button');
108
+ };
109
+
110
+ export const SolidSmallRoundButton = (text: string): ButtonMetadata => {
111
+ return { ...SolidDefaultRound(text, 'button'), size: 'small' };
112
+ };
113
+
114
+ export const SolidLargeRoundButton = (text: string): ButtonMetadata => {
115
+ return { ...SolidDefaultRound(text, 'button'), size: 'large' };
116
+ };
117
+
118
+ export const SolidFullButton = (text: string): ButtonMetadata => {
119
+ return SolidDefaultFull(text, 'button');
120
+ };
121
+
122
+ export const SolidBlockButton = (text: string): ButtonMetadata => {
123
+ return SolidDefaultBlock(text, 'button');
124
+ };
125
+
126
+ /** PRIMARY */
127
+
128
+ export const PrimarySolidDefaultRoundButton = (text: string): ButtonMetadata => {
129
+ return { ...SolidDefaultRoundButton(text), color: 'primary' };
130
+ };
131
+
132
+ export const PrimarySolidDefaultRoundIconButton = (text: string, icon: IconMetada): ButtonMetadata => {
133
+ return { ...PrimarySolidDefaultRoundButton(text), icon };
134
+ };
135
+
136
+ export const PrimarySolidDefaultRoundHrefButton = (
137
+ text: string,
138
+ href: string,
139
+ target: '_blank' | '_self' | '_parent' | '_top',
140
+ ): ButtonMetadata => {
141
+ return { ...PrimarySolidDefaultRoundButton(text), href, target };
142
+ };
143
+
144
+ export const PrimarySolidDefaultRoundIconHrefButton = (
145
+ text: string,
146
+ icon: IconMetada,
147
+ href: string,
148
+ target: '_blank' | '_self' | '_parent' | '_top',
149
+ ): ButtonMetadata => {
150
+ return { ...PrimarySolidDefaultRoundIconButton(text, icon), href, target };
151
+ };
152
+
153
+ export const PrimarySolidSmallRoundButton = (text: string): ButtonMetadata => {
154
+ return { ...SolidSmallRoundButton(text), color: 'primary' };
155
+ };
156
+
157
+ export const PrimarySolidSmallRoundIconButton = (text: string, icon: IconMetada): ButtonMetadata => {
158
+ return { ...PrimarySolidSmallRoundButton(text), icon };
159
+ };
160
+
161
+ export const PrimarySolidSmallRoundHrefButton = (
162
+ text: string,
163
+ href: string,
164
+ target: '_blank' | '_self' | '_parent' | '_top',
165
+ ): ButtonMetadata => {
166
+ return { ...PrimarySolidSmallRoundButton(text), href, target };
167
+ };
168
+
169
+ export const PrimarySolidSmallRoundIconHrefButton = (
170
+ text: string,
171
+ icon: IconMetada,
172
+ href: string,
173
+ target: '_blank' | '_self' | '_parent' | '_top',
174
+ ): ButtonMetadata => {
175
+ return { ...PrimarySolidSmallRoundIconButton(text, icon), href, target };
176
+ };
177
+
178
+ export const PrimarySolidLargeRoundButton = (text: string): ButtonMetadata => {
179
+ return { ...SolidLargeRoundButton(text), color: 'primary' };
180
+ };
181
+
182
+ export const PrimarySolidLargeRoundIconButton = (text: string, icon: IconMetada): ButtonMetadata => {
183
+ return { ...PrimarySolidLargeRoundButton(text), icon };
184
+ };
185
+
186
+ export const PrimarySolidLargeRoundHrefButton = (
187
+ text: string,
188
+ href: string,
189
+ target: '_blank' | '_self' | '_parent' | '_top',
190
+ ): ButtonMetadata => {
191
+ return { ...PrimarySolidLargeRoundButton(text), href, target };
192
+ };
193
+
194
+ export const PrimarySolidLargeRoundIconHrefButton = (
195
+ text: string,
196
+ icon: IconMetada,
197
+ href: string,
198
+ target: '_blank' | '_self' | '_parent' | '_top',
199
+ ): ButtonMetadata => {
200
+ return { ...PrimarySolidLargeRoundIconButton(text, icon), href, target };
201
+ };
202
+
203
+ export const PrimarySolidBlockButton = (text: string): ButtonMetadata => {
204
+ return { ...SolidBlockButton(text), color: 'primary' };
205
+ };
206
+
207
+ export const PrimarySolidBlockIconButton = (text: string, icon: IconMetada): ButtonMetadata => {
208
+ return { ...PrimarySolidBlockButton(text), icon };
209
+ };
210
+
211
+ export const PrimarySolidBlockHrefButton = (
212
+ text: string,
213
+ href: string,
214
+ target: '_blank' | '_self' | '_parent' | '_top',
215
+ ): ButtonMetadata => {
216
+ return { ...PrimarySolidBlockButton(text), href, target };
217
+ };
218
+
219
+ export const PrimarySolidBlockIconHrefButton = (
220
+ text: string,
221
+ icon: IconMetada,
222
+ href: string,
223
+ target: '_blank' | '_self' | '_parent' | '_top',
224
+ ): ButtonMetadata => {
225
+ return { ...PrimarySolidBlockIconButton(text, icon), href, target };
226
+ };
227
+
228
+ export const PrimarySolidFullButton = (text: string): ButtonMetadata => {
229
+ return { ...SolidFullButton(text), color: 'primary' };
230
+ };
231
+
232
+ export const PrimarySolidFullIconButton = (text: string, icon: IconMetada): ButtonMetadata => {
233
+ return { ...PrimarySolidFullButton(text), icon };
234
+ };
235
+
236
+ export const PrimarySolidFullHrefButton = (
237
+ text: string,
238
+ href: string,
239
+ target: '_blank' | '_self' | '_parent' | '_top',
240
+ ): ButtonMetadata => {
241
+ return { ...PrimarySolidFullButton(text), href, target };
242
+ };
243
+
244
+ export const PrimarySolidFullIconHrefButton = (
245
+ text: string,
246
+ icon: IconMetada,
247
+ href: string,
248
+ target: '_blank' | '_self' | '_parent' | '_top',
249
+ ): ButtonMetadata => {
250
+ return { ...PrimarySolidFullIconButton(text, icon), href, target };
251
+ };
252
+
253
+ /** SECONDARY */
254
+
255
+ export const SecondarySolidDefaultRoundButton = (text: string): ButtonMetadata => {
256
+ return { ...SolidDefaultRoundButton(text), color: 'secondary' };
257
+ };
258
+
259
+ export const SecondarySolidDefaultRoundIconButton = (text: string, icon: IconMetada): ButtonMetadata => {
260
+ return { ...SecondarySolidDefaultRoundButton(text), icon };
261
+ };
262
+
263
+ export const SecondarySolidDefaultRoundHrefButton = (
264
+ text: string,
265
+ href: string,
266
+ target: '_blank' | '_self' | '_parent' | '_top',
267
+ ): ButtonMetadata => {
268
+ return { ...SecondarySolidDefaultRoundButton(text), href, target };
269
+ };
270
+
271
+ export const SecondarySolidDefaultRoundIconHrefButton = (
272
+ text: string,
273
+ icon: IconMetada,
274
+ href: string,
275
+ target: '_blank' | '_self' | '_parent' | '_top',
276
+ ): ButtonMetadata => {
277
+ return { ...SecondarySolidDefaultRoundIconButton(text, icon), href, target };
278
+ };
279
+
280
+ export const SecondarySolidSmallRoundButton = (text: string): ButtonMetadata => {
281
+ return { ...SolidSmallRoundButton(text), color: 'secondary' };
282
+ };
283
+
284
+ export const SecondarySolidSmallRoundIconButton = (text: string, icon: IconMetada): ButtonMetadata => {
285
+ return { ...SecondarySolidSmallRoundButton(text), icon };
286
+ };
287
+
288
+ export const SecondarySolidSmallRoundHrefButton = (
289
+ text: string,
290
+ href: string,
291
+ target: '_blank' | '_self' | '_parent' | '_top',
292
+ ): ButtonMetadata => {
293
+ return { ...SecondarySolidSmallRoundButton(text), href, target };
294
+ };
295
+
296
+ export const SecondarySolidSmallRoundIconHrefButton = (
297
+ text: string,
298
+ icon: IconMetada,
299
+ href: string,
300
+ target: '_blank' | '_self' | '_parent' | '_top',
301
+ ): ButtonMetadata => {
302
+ return { ...SecondarySolidSmallRoundIconButton(text, icon), href, target };
303
+ };
304
+
305
+ export const SecondarySolidLargeRoundButton = (text: string): ButtonMetadata => {
306
+ return { ...SolidLargeRoundButton(text), color: 'secondary' };
307
+ };
308
+
309
+ export const SecondarySolidLargeRoundIconButton = (text: string, icon: IconMetada): ButtonMetadata => {
310
+ return { ...SecondarySolidLargeRoundButton(text), icon };
311
+ };
312
+
313
+ export const SecondarySolidLargeRoundHrefButton = (
314
+ text: string,
315
+ href: string,
316
+ target: '_blank' | '_self' | '_parent' | '_top',
317
+ ): ButtonMetadata => {
318
+ return { ...SecondarySolidLargeRoundButton(text), href, target };
319
+ };
320
+
321
+ export const SecondarySolidLargeRoundIconHrefButton = (
322
+ text: string,
323
+ icon: IconMetada,
324
+ href: string,
325
+ target: '_blank' | '_self' | '_parent' | '_top',
326
+ ): ButtonMetadata => {
327
+ return { ...SecondarySolidLargeRoundIconButton(text, icon), href, target };
328
+ };
329
+
330
+ export const SecondarySolidFullButton = (text: string): ButtonMetadata => {
331
+ return { ...SolidFullButton(text), color: 'secondary' };
332
+ };
333
+
334
+ export const SecondarySolidFullIconButton = (text: string, icon: IconMetada): ButtonMetadata => {
335
+ return { ...SecondarySolidFullButton(text), icon };
336
+ };
337
+
338
+ export const SecondarySolidFullHrefButton = (
339
+ text: string,
340
+ href: string,
341
+ target: '_blank' | '_self' | '_parent' | '_top',
342
+ ): ButtonMetadata => {
343
+ return { ...SecondarySolidFullButton(text), href, target };
344
+ };
345
+
346
+ export const SecondarySolidFullIconHrefButton = (
347
+ text: string,
348
+ icon: IconMetada,
349
+ href: string,
350
+ target: '_blank' | '_self' | '_parent' | '_top',
351
+ ): ButtonMetadata => {
352
+ return { ...SecondarySolidFullIconButton(text, icon), href, target };
353
+ };
354
+
355
+ export const SecondarySolidBlockButton = (text: string): ButtonMetadata => {
356
+ return { ...SolidBlockButton(text), color: 'secondary' };
357
+ };
358
+
359
+ export const SecondarySolidBlockIconButton = (text: string, icon: IconMetada): ButtonMetadata => {
360
+ return { ...SecondarySolidBlockButton(text), icon };
361
+ };
362
+
363
+ export const SecondarySolidBlockHrefButton = (
364
+ text: string,
365
+ href: string,
366
+ target: '_blank' | '_self' | '_parent' | '_top',
367
+ ): ButtonMetadata => {
368
+ return { ...SecondarySolidBlockButton(text), href, target };
369
+ };
370
+
371
+ export const SecondarySolidBlockIconHrefButton = (
372
+ text: string,
373
+ icon: IconMetada,
374
+ href: string,
375
+ target: '_blank' | '_self' | '_parent' | '_top',
376
+ ): ButtonMetadata => {
377
+ return { ...SecondarySolidBlockIconButton(text, icon), href, target };
378
+ };
@@ -0,0 +1,24 @@
1
+ import { Color } from '@ionic/core';
2
+ import { ActionType, ComponentState } from '../../types';
3
+
4
+ export interface IconMetada {
5
+ name: string;
6
+ slot: 'start' | 'end';
7
+ }
8
+
9
+ export interface ButtonMetadata {
10
+ actionType?: ActionType;
11
+ expand?: 'full' | 'block';
12
+ href?: string;
13
+ target?: '_blank' | '_self' | '_parent' | '_top';
14
+ download?: string;
15
+ color: Color;
16
+ state: ComponentState;
17
+ text: string;
18
+ icon?: IconMetada;
19
+ shape?: 'round';
20
+ size?: 'small' | 'default' | 'large';
21
+ fill?: 'clear' | 'outline' | 'solid' | 'default';
22
+ type: 'button' | 'submit' | 'reset';
23
+ token?: string;
24
+ }