@gestio/gds 0.0.1

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 (71) hide show
  1. package/README.md +72 -0
  2. package/bundles/gestio-gds.umd.js +962 -0
  3. package/bundles/gestio-gds.umd.js.map +1 -0
  4. package/bundles/gestio-gds.umd.min.js +16 -0
  5. package/bundles/gestio-gds.umd.min.js.map +1 -0
  6. package/esm2015/gestio-gds.js +5 -0
  7. package/esm2015/lib/gds-button/gds-button.component.js +20 -0
  8. package/esm2015/lib/gds-button/gds-button.module.js +15 -0
  9. package/esm2015/lib/gds-input/gds-input.component.js +68 -0
  10. package/esm2015/lib/gds-input/gds-input.module.js +15 -0
  11. package/esm2015/lib/gds-label/gds-label.component.js +36 -0
  12. package/esm2015/lib/gds-label/gds-label.module.js +15 -0
  13. package/esm2015/lib/gds-selectbox/gds-selectbox.component.js +175 -0
  14. package/esm2015/lib/gds-selectbox/gds-selectbox.module.js +16 -0
  15. package/esm2015/lib/gds-textbox/gds-textbox.component.js +94 -0
  16. package/esm2015/lib/gds-textbox/gds-textbox.module.js +16 -0
  17. package/esm2015/lib/gds.component.js +19 -0
  18. package/esm2015/lib/gds.module.js +27 -0
  19. package/esm2015/lib/tokens/colors.js +201 -0
  20. package/esm2015/lib/tokens/typography.js +31 -0
  21. package/esm2015/public-api.js +18 -0
  22. package/esm5/gestio-gds.js +5 -0
  23. package/esm5/lib/gds-button/gds-button.component.js +21 -0
  24. package/esm5/lib/gds-button/gds-button.module.js +18 -0
  25. package/esm5/lib/gds-input/gds-input.component.js +69 -0
  26. package/esm5/lib/gds-input/gds-input.module.js +18 -0
  27. package/esm5/lib/gds-label/gds-label.component.js +37 -0
  28. package/esm5/lib/gds-label/gds-label.module.js +18 -0
  29. package/esm5/lib/gds-selectbox/gds-selectbox.component.js +180 -0
  30. package/esm5/lib/gds-selectbox/gds-selectbox.module.js +19 -0
  31. package/esm5/lib/gds-textbox/gds-textbox.component.js +96 -0
  32. package/esm5/lib/gds-textbox/gds-textbox.module.js +19 -0
  33. package/esm5/lib/gds.component.js +17 -0
  34. package/esm5/lib/gds.module.js +30 -0
  35. package/esm5/lib/tokens/colors.js +185 -0
  36. package/esm5/lib/tokens/typography.js +31 -0
  37. package/esm5/public-api.js +18 -0
  38. package/fesm2015/gestio-gds.js +704 -0
  39. package/fesm2015/gestio-gds.js.map +1 -0
  40. package/fesm5/gestio-gds.js +713 -0
  41. package/fesm5/gestio-gds.js.map +1 -0
  42. package/gestio-gds.d.ts +4 -0
  43. package/gestio-gds.metadata.json +1 -0
  44. package/lib/gds-button/gds-button.component.d.ts +6 -0
  45. package/lib/gds-button/gds-button.module.d.ts +2 -0
  46. package/lib/gds-input/gds-input.component.d.ts +17 -0
  47. package/lib/gds-input/gds-input.module.d.ts +2 -0
  48. package/lib/gds-label/gds-label.component.d.ts +8 -0
  49. package/lib/gds-label/gds-label.module.d.ts +2 -0
  50. package/lib/gds-selectbox/gds-selectbox.component.d.ts +40 -0
  51. package/lib/gds-selectbox/gds-selectbox.module.d.ts +2 -0
  52. package/lib/gds-textbox/gds-textbox.component.d.ts +23 -0
  53. package/lib/gds-textbox/gds-textbox.module.d.ts +2 -0
  54. package/lib/gds.component.d.ts +5 -0
  55. package/lib/gds.module.d.ts +2 -0
  56. package/lib/tokens/colors.d.ts +17 -0
  57. package/lib/tokens/typography.d.ts +21 -0
  58. package/package.json +21 -0
  59. package/public-api.d.ts +14 -0
  60. package/src/lib/styles/tokens/colors.css +170 -0
  61. package/src/lib/styles/tokens/elevation.css +13 -0
  62. package/src/lib/styles/tokens/index.css +6 -0
  63. package/src/lib/styles/tokens/radius.css +0 -0
  64. package/src/lib/styles/tokens/semantic/colors.css +35 -0
  65. package/src/lib/styles/tokens/spacing.css +0 -0
  66. package/src/lib/styles/tokens/typography.css +115 -0
  67. package/src/lib/styles/utilities/line-counter.scss +29 -0
  68. package/src/lib/styles.scss +5 -0
  69. package/src/lib/tokens/colors.ts +216 -0
  70. package/src/lib/tokens/elevation.ts +13 -0
  71. package/src/lib/tokens/typography.ts +33 -0
@@ -0,0 +1,713 @@
1
+ import { __decorate, __spread } from 'tslib';
2
+ import { Input, Component, NgModule, EventEmitter, Output, ChangeDetectionStrategy, forwardRef, ElementRef, ChangeDetectorRef, HostListener } from '@angular/core';
3
+ import { CommonModule } from '@angular/common';
4
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
5
+
6
+ var GdsButtonComponent = /** @class */ (function () {
7
+ function GdsButtonComponent() {
8
+ this.variant = 'primary';
9
+ }
10
+ GdsButtonComponent.prototype.ngOnInit = function () { };
11
+ __decorate([
12
+ Input()
13
+ ], GdsButtonComponent.prototype, "variant", void 0);
14
+ GdsButtonComponent = __decorate([
15
+ Component({
16
+ selector: 'gds-button',
17
+ template: "<button class=\"gds-button\" [ngClass]=\"variant\">\n <ng-content></ng-content>\n</button>\n",
18
+ styles: ["", ".gds-button{padding:10px 16px;border-radius:8px;border:none;font-family:var(--gds-font-primary,Inter);font-weight:600;cursor:pointer}.gds-button.primary{background:var(--gds-primary);color:#fff}.gds-button.secondary{background:var(--gds-secondary);color:#fff}.gds-button.tertiary{background:var(--gds-tertiary);color:#fff}"]
19
+ })
20
+ ], GdsButtonComponent);
21
+ return GdsButtonComponent;
22
+ }());
23
+
24
+ var GdsButtonModule = /** @class */ (function () {
25
+ function GdsButtonModule() {
26
+ }
27
+ GdsButtonModule = __decorate([
28
+ NgModule({
29
+ declarations: [GdsButtonComponent],
30
+ imports: [CommonModule],
31
+ exports: [GdsButtonComponent],
32
+ })
33
+ ], GdsButtonModule);
34
+ return GdsButtonModule;
35
+ }());
36
+
37
+ var GdsInputComponent = /** @class */ (function () {
38
+ function GdsInputComponent() {
39
+ this.id = '';
40
+ this.placeholder = '';
41
+ this.type = 'text';
42
+ this.size = 'md';
43
+ this.disabled = false;
44
+ this.invalid = false;
45
+ this.value = '';
46
+ this.input = new EventEmitter();
47
+ this.focus = new EventEmitter();
48
+ this.blur = new EventEmitter();
49
+ this.isFocused = false;
50
+ }
51
+ GdsInputComponent.prototype.onInput = function (event) {
52
+ this.input.emit(event);
53
+ };
54
+ GdsInputComponent.prototype.onFocus = function () {
55
+ this.isFocused = true;
56
+ this.focus.emit();
57
+ };
58
+ GdsInputComponent.prototype.onBlur = function () {
59
+ this.isFocused = false;
60
+ this.blur.emit();
61
+ };
62
+ __decorate([
63
+ Input()
64
+ ], GdsInputComponent.prototype, "id", void 0);
65
+ __decorate([
66
+ Input()
67
+ ], GdsInputComponent.prototype, "placeholder", void 0);
68
+ __decorate([
69
+ Input()
70
+ ], GdsInputComponent.prototype, "type", void 0);
71
+ __decorate([
72
+ Input()
73
+ ], GdsInputComponent.prototype, "size", void 0);
74
+ __decorate([
75
+ Input()
76
+ ], GdsInputComponent.prototype, "disabled", void 0);
77
+ __decorate([
78
+ Input()
79
+ ], GdsInputComponent.prototype, "invalid", void 0);
80
+ __decorate([
81
+ Input()
82
+ ], GdsInputComponent.prototype, "value", void 0);
83
+ __decorate([
84
+ Output()
85
+ ], GdsInputComponent.prototype, "input", void 0);
86
+ __decorate([
87
+ Output()
88
+ ], GdsInputComponent.prototype, "focus", void 0);
89
+ __decorate([
90
+ Output()
91
+ ], GdsInputComponent.prototype, "blur", void 0);
92
+ GdsInputComponent = __decorate([
93
+ Component({
94
+ selector: 'gds-input',
95
+ template: "<div\n class=\"gds-input-container\"\n [class.gds-input--invalid]=\"invalid\"\n [class.gds-input--disabled]=\"disabled\"\n [class.gds-input--focused]=\"isFocused\"\n [class.gds-input--sm]=\"size === 'sm'\"\n [class.gds-input--md]=\"size === 'md'\"\n [class.gds-input--lg]=\"size === 'lg'\"\n>\n <input\n [id]=\"id\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [value]=\"value\"\n class=\"gds-input\"\n [attr.aria-invalid]=\"invalid\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n</div>\n",
96
+ changeDetection: ChangeDetectionStrategy.OnPush,
97
+ styles: [".gds-input-container{display:flex;flex-direction:column;width:100%}.gds-input-container.gds-input--invalid .gds-input{border-color:var(--danger)}.gds-input-container.gds-input--invalid .gds-input:focus{border-color:var(--danger);box-shadow:0 0 0 3px rgba(216,44,13,.1)}.gds-input-container.gds-input--disabled .gds-input{opacity:.6;cursor:not-allowed;background-color:var(--bg-disabled)}.gds-input-container.gds-input--focused .gds-input{border-color:var(--primary);box-shadow:0 0 0 3px rgba(28,103,244,.1)}.gds-input-container.gds-input--focused.gds-input--invalid .gds-input{border-color:var(--danger);box-shadow:0 0 0 3px rgba(216,44,13,.1)}.gds-input-container.gds-input--sm .gds-input{height:32px;padding:0 12px;font-size:14px}.gds-input-container.gds-input--md .gds-input{height:40px;padding:0 12px;font-size:14px}.gds-input-container.gds-input--lg .gds-input{height:48px;padding:0 12px;font-size:14px}.gds-input{width:100%;border:1px solid var(--gds-neutral-300);border-radius:6px;height:40px;padding:0 12px;font-size:14px;line-height:1;color:var(--text-foreground);background-color:var(--bg-surface);transition:.2s;box-sizing:border-box;font-family:inherit}.gds-input::-moz-placeholder{color:var(--text-foreground);opacity:.5}.gds-input::placeholder{color:var(--text-foreground);opacity:.5}.gds-input:hover:not(:disabled){border-color:var(--gds-neutral-400)}.gds-input:focus{outline:0;border-color:var(--primary);box-shadow:0 0 0 3px rgba(28,103,244,.1)}.gds-input:disabled{opacity:.6;cursor:not-allowed;background-color:var(--bg-disabled)}"]
98
+ })
99
+ ], GdsInputComponent);
100
+ return GdsInputComponent;
101
+ }());
102
+
103
+ var GdsInputModule = /** @class */ (function () {
104
+ function GdsInputModule() {
105
+ }
106
+ GdsInputModule = __decorate([
107
+ NgModule({
108
+ declarations: [GdsInputComponent],
109
+ imports: [CommonModule],
110
+ exports: [GdsInputComponent],
111
+ })
112
+ ], GdsInputModule);
113
+ return GdsInputModule;
114
+ }());
115
+
116
+ var GdsLabelComponent = /** @class */ (function () {
117
+ function GdsLabelComponent() {
118
+ this.required = false;
119
+ this.error = false;
120
+ this.disabled = false;
121
+ this.size = 'md';
122
+ }
123
+ GdsLabelComponent.prototype.ngOnInit = function () { };
124
+ __decorate([
125
+ Input()
126
+ ], GdsLabelComponent.prototype, "for", void 0);
127
+ __decorate([
128
+ Input()
129
+ ], GdsLabelComponent.prototype, "required", void 0);
130
+ __decorate([
131
+ Input()
132
+ ], GdsLabelComponent.prototype, "error", void 0);
133
+ __decorate([
134
+ Input()
135
+ ], GdsLabelComponent.prototype, "disabled", void 0);
136
+ __decorate([
137
+ Input()
138
+ ], GdsLabelComponent.prototype, "size", void 0);
139
+ GdsLabelComponent = __decorate([
140
+ Component({
141
+ selector: 'gds-label',
142
+ template: "<label\n class=\"gds-label\"\n [class.gds-label--disabled]=\"disabled\"\n [class.gds-label--sm]=\"size === 'sm'\"\n [class.gds-label--md]=\"size === 'md'\"\n [class.gds-label--lg]=\"size === 'lg'\"\n [class.gds-label--error]=\"error || required\"\n [attr.for]=\"for\"\n>\n <ng-content></ng-content>\n\n <span *ngIf=\"required\" class=\"gds-label__required\">*</span>\n</label>\n",
143
+ changeDetection: ChangeDetectionStrategy.OnPush,
144
+ styles: [".gds-label{display:inline-flex;align-items:center;gap:4px;font-weight:var(--font-weight-medium);font-size:.875rem;line-height:calc(1.25 / .875);color:var(--gds-neutral-400);cursor:pointer}.gds-label__required{color:var(--gds-red-500);font-size:.875em}.gds-label--error{color:var(--gds-red-500)}.gds-label--disabled{opacity:.6;cursor:not-allowed}.gds-label--sm{font-size:.75rem;line-height:calc(1.25 / .75)}.gds-label--md{font-size:.875rem;line-height:calc(1.25 / .875)}.gds-label--lg{font-size:1rem;line-height:1.25}"]
145
+ })
146
+ ], GdsLabelComponent);
147
+ return GdsLabelComponent;
148
+ }());
149
+
150
+ var GdsLabelModule = /** @class */ (function () {
151
+ function GdsLabelModule() {
152
+ }
153
+ GdsLabelModule = __decorate([
154
+ NgModule({
155
+ declarations: [GdsLabelComponent],
156
+ imports: [CommonModule],
157
+ exports: [GdsLabelComponent],
158
+ })
159
+ ], GdsLabelModule);
160
+ return GdsLabelModule;
161
+ }());
162
+
163
+ var GdsTextboxComponent = /** @class */ (function () {
164
+ function GdsTextboxComponent() {
165
+ this.label = '';
166
+ this.placeholder = '';
167
+ this.required = false;
168
+ this.disabled = false;
169
+ this.error = false;
170
+ this.errorMessage = '';
171
+ this.helperText = '';
172
+ this.type = 'text';
173
+ this.id = "gds-textbox-" + Math.random().toString(36).substr(2, 9);
174
+ this.size = 'md';
175
+ this.value = '';
176
+ this.isFocused = false;
177
+ this.onChange = function (value) { };
178
+ this.onTouched = function () { };
179
+ }
180
+ GdsTextboxComponent_1 = GdsTextboxComponent;
181
+ GdsTextboxComponent.prototype.onInput = function (event) {
182
+ var target = event.target;
183
+ this.value = target.value;
184
+ this.onChange(this.value);
185
+ };
186
+ GdsTextboxComponent.prototype.onFocus = function () {
187
+ this.isFocused = true;
188
+ };
189
+ GdsTextboxComponent.prototype.onBlur = function () {
190
+ this.isFocused = false;
191
+ this.onTouched();
192
+ };
193
+ // ControlValueAccessor implementation
194
+ GdsTextboxComponent.prototype.writeValue = function (value) {
195
+ this.value = value || '';
196
+ };
197
+ GdsTextboxComponent.prototype.registerOnChange = function (fn) {
198
+ this.onChange = fn;
199
+ };
200
+ GdsTextboxComponent.prototype.registerOnTouched = function (fn) {
201
+ this.onTouched = fn;
202
+ };
203
+ GdsTextboxComponent.prototype.setDisabledState = function (isDisabled) {
204
+ this.disabled = isDisabled;
205
+ };
206
+ var GdsTextboxComponent_1;
207
+ __decorate([
208
+ Input()
209
+ ], GdsTextboxComponent.prototype, "label", void 0);
210
+ __decorate([
211
+ Input()
212
+ ], GdsTextboxComponent.prototype, "placeholder", void 0);
213
+ __decorate([
214
+ Input()
215
+ ], GdsTextboxComponent.prototype, "required", void 0);
216
+ __decorate([
217
+ Input()
218
+ ], GdsTextboxComponent.prototype, "disabled", void 0);
219
+ __decorate([
220
+ Input()
221
+ ], GdsTextboxComponent.prototype, "error", void 0);
222
+ __decorate([
223
+ Input()
224
+ ], GdsTextboxComponent.prototype, "errorMessage", void 0);
225
+ __decorate([
226
+ Input()
227
+ ], GdsTextboxComponent.prototype, "helperText", void 0);
228
+ __decorate([
229
+ Input()
230
+ ], GdsTextboxComponent.prototype, "type", void 0);
231
+ __decorate([
232
+ Input()
233
+ ], GdsTextboxComponent.prototype, "id", void 0);
234
+ __decorate([
235
+ Input()
236
+ ], GdsTextboxComponent.prototype, "size", void 0);
237
+ GdsTextboxComponent = GdsTextboxComponent_1 = __decorate([
238
+ Component({
239
+ selector: 'gds-textbox',
240
+ template: "<div class=\"gds-textbox\">\n <!-- Label -->\n <gds-label\n [for]=\"id\"\n [size]=\"size\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [error]=\"error\"\n *ngIf=\"label\"\n >\n {{ label }}\n </gds-label>\n\n <!-- Input Field -->\n <gds-input\n [id]=\"id\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [invalid]=\"error\"\n [size]=\"size\"\n [value]=\"value\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n ></gds-input>\n\n <div\n *ngIf=\"helperText || errorMessage\"\n [id]=\"id + '-description'\"\n class=\"gds-textbox__description\"\n [class.gds-textbox__description--error]=\"error && errorMessage\"\n >\n {{ error && errorMessage ? errorMessage : helperText }}\n </div>\n</div>\n",
241
+ changeDetection: ChangeDetectionStrategy.OnPush,
242
+ providers: [
243
+ {
244
+ provide: NG_VALUE_ACCESSOR,
245
+ useExisting: forwardRef(function () { return GdsTextboxComponent_1; }),
246
+ multi: true,
247
+ },
248
+ ],
249
+ styles: [".gds-textbox{display:flex;flex-direction:column;width:100%;gap:4px}.gds-textbox__description{font-size:.75rem;color:var(--gds-neutral-400)}.gds-textbox__description--error{color:var(--gds-red-500)}.gds-textbox__error-icon{margin-right:4px;color:var(--gds-red-500)}"]
250
+ })
251
+ ], GdsTextboxComponent);
252
+ return GdsTextboxComponent;
253
+ }());
254
+
255
+ var GdsTextboxModule = /** @class */ (function () {
256
+ function GdsTextboxModule() {
257
+ }
258
+ GdsTextboxModule = __decorate([
259
+ NgModule({
260
+ declarations: [GdsTextboxComponent],
261
+ imports: [CommonModule, GdsLabelModule, GdsInputModule],
262
+ exports: [GdsTextboxComponent],
263
+ })
264
+ ], GdsTextboxModule);
265
+ return GdsTextboxModule;
266
+ }());
267
+
268
+ var GdsSelectboxComponent = /** @class */ (function () {
269
+ function GdsSelectboxComponent(elementRef, cdr) {
270
+ this.elementRef = elementRef;
271
+ this.cdr = cdr;
272
+ this.label = '';
273
+ this.placeholder = 'Selecione...';
274
+ this.required = false;
275
+ this.disabled = false;
276
+ this.error = false;
277
+ this.errorMessage = '';
278
+ this.helperText = '';
279
+ this.id = "gds-selectbox-" + Math.random().toString(36).substr(2, 9);
280
+ this.size = 'md';
281
+ this.options = [];
282
+ this.searchTerm = '';
283
+ this.selectedValue = null;
284
+ this.isOpen = false;
285
+ this.isFocused = false;
286
+ this.filteredOptions = [];
287
+ this.onChange = function (value) { };
288
+ this.onTouched = function () { };
289
+ }
290
+ GdsSelectboxComponent_1 = GdsSelectboxComponent;
291
+ GdsSelectboxComponent.prototype.ngOnInit = function () {
292
+ this.filteredOptions = __spread(this.options);
293
+ };
294
+ GdsSelectboxComponent.prototype.onSearchInput = function (event) {
295
+ var target = event.target;
296
+ this.searchTerm = target.value;
297
+ this.filterOptions();
298
+ };
299
+ GdsSelectboxComponent.prototype.filterOptions = function () {
300
+ if (!this.searchTerm) {
301
+ this.filteredOptions = __spread(this.options);
302
+ }
303
+ else {
304
+ var term_1 = this.searchTerm.toLowerCase();
305
+ this.filteredOptions = this.options.filter(function (option) {
306
+ return option.display.toLowerCase().includes(term_1);
307
+ });
308
+ }
309
+ this.cdr.markForCheck();
310
+ };
311
+ GdsSelectboxComponent.prototype.toggleDropdown = function () {
312
+ if (!this.disabled) {
313
+ this.isOpen = !this.isOpen;
314
+ if (this.isOpen) {
315
+ this.filterOptions();
316
+ }
317
+ this.cdr.markForCheck();
318
+ }
319
+ };
320
+ GdsSelectboxComponent.prototype.clearSelection = function () {
321
+ this.selectedValue = null;
322
+ this.searchTerm = '';
323
+ this.isOpen = false;
324
+ this.onChange(null);
325
+ this.cdr.markForCheck();
326
+ };
327
+ GdsSelectboxComponent.prototype.selectOption = function (option) {
328
+ this.selectedValue = option.value;
329
+ this.searchTerm = option.display;
330
+ this.isOpen = false;
331
+ this.onChange(this.selectedValue);
332
+ this.cdr.markForCheck();
333
+ };
334
+ GdsSelectboxComponent.prototype.onFocus = function () {
335
+ this.isFocused = true;
336
+ this.isOpen = true;
337
+ this.cdr.markForCheck();
338
+ };
339
+ GdsSelectboxComponent.prototype.onBlur = function () {
340
+ var _this = this;
341
+ setTimeout(function () {
342
+ _this.isFocused = false;
343
+ _this.isOpen = false;
344
+ _this.onTouched();
345
+ // Restaura o display da opção selecionada se o searchTerm não corresponder
346
+ if (_this.selectedValue !== null) {
347
+ var selected = _this.options.find(function (opt) { return opt.value === _this.selectedValue; });
348
+ if (selected) {
349
+ _this.searchTerm = selected.display;
350
+ }
351
+ }
352
+ else {
353
+ _this.searchTerm = '';
354
+ }
355
+ _this.cdr.markForCheck();
356
+ }, 200);
357
+ };
358
+ GdsSelectboxComponent.prototype.onClickOutside = function (event) {
359
+ if (!this.elementRef.nativeElement.contains(event.target)) {
360
+ this.isOpen = false;
361
+ this.cdr.markForCheck();
362
+ }
363
+ };
364
+ // ControlValueAccessor implementation
365
+ GdsSelectboxComponent.prototype.writeValue = function (value) {
366
+ this.selectedValue = value;
367
+ if (value !== null && value !== undefined) {
368
+ var selected = this.options.find(function (opt) { return opt.value === value; });
369
+ if (selected) {
370
+ this.searchTerm = selected.display;
371
+ }
372
+ }
373
+ else {
374
+ this.searchTerm = '';
375
+ }
376
+ this.cdr.markForCheck();
377
+ };
378
+ GdsSelectboxComponent.prototype.registerOnChange = function (fn) {
379
+ this.onChange = fn;
380
+ };
381
+ GdsSelectboxComponent.prototype.registerOnTouched = function (fn) {
382
+ this.onTouched = fn;
383
+ };
384
+ GdsSelectboxComponent.prototype.setDisabledState = function (isDisabled) {
385
+ this.disabled = isDisabled;
386
+ this.cdr.markForCheck();
387
+ };
388
+ var GdsSelectboxComponent_1;
389
+ GdsSelectboxComponent.ctorParameters = function () { return [
390
+ { type: ElementRef },
391
+ { type: ChangeDetectorRef }
392
+ ]; };
393
+ __decorate([
394
+ Input()
395
+ ], GdsSelectboxComponent.prototype, "label", void 0);
396
+ __decorate([
397
+ Input()
398
+ ], GdsSelectboxComponent.prototype, "placeholder", void 0);
399
+ __decorate([
400
+ Input()
401
+ ], GdsSelectboxComponent.prototype, "required", void 0);
402
+ __decorate([
403
+ Input()
404
+ ], GdsSelectboxComponent.prototype, "disabled", void 0);
405
+ __decorate([
406
+ Input()
407
+ ], GdsSelectboxComponent.prototype, "error", void 0);
408
+ __decorate([
409
+ Input()
410
+ ], GdsSelectboxComponent.prototype, "errorMessage", void 0);
411
+ __decorate([
412
+ Input()
413
+ ], GdsSelectboxComponent.prototype, "helperText", void 0);
414
+ __decorate([
415
+ Input()
416
+ ], GdsSelectboxComponent.prototype, "id", void 0);
417
+ __decorate([
418
+ Input()
419
+ ], GdsSelectboxComponent.prototype, "size", void 0);
420
+ __decorate([
421
+ Input()
422
+ ], GdsSelectboxComponent.prototype, "options", void 0);
423
+ __decorate([
424
+ HostListener('document:click', ['$event'])
425
+ ], GdsSelectboxComponent.prototype, "onClickOutside", null);
426
+ GdsSelectboxComponent = GdsSelectboxComponent_1 = __decorate([
427
+ Component({
428
+ selector: 'gds-selectbox',
429
+ template: "<div class=\"gds-selectbox\">\n <!-- Label -->\n <gds-label\n [for]=\"id\"\n [size]=\"size\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [error]=\"error\"\n *ngIf=\"label\"\n >\n {{ label }}\n </gds-label>\n\n <!-- Select Input -->\n <div\n class=\"gds-selectbox__control\"\n [class.gds-selectbox__control--open]=\"isOpen\"\n [class.gds-selectbox__control--error]=\"error\"\n [class.gds-selectbox__control--disabled]=\"disabled\"\n [class.gds-selectbox__control--sm]=\"size === 'sm'\"\n [class.gds-selectbox__control--md]=\"size === 'md'\"\n [class.gds-selectbox__control--lg]=\"size === 'lg'\"\n >\n <input\n [id]=\"id\"\n type=\"text\"\n class=\"gds-selectbox__input\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [value]=\"searchTerm\"\n (input)=\"onSearchInput($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n autocomplete=\"off\"\n />\n <button\n type=\"button\"\n class=\"gds-selectbox__clear\"\n *ngIf=\"selectedValue !== null && !disabled\"\n (click)=\"clearSelection()\"\n tabindex=\"-1\"\n title=\"Limpar sele\u00E7\u00E3o\"\n >\n <svg\n class=\"gds-selectbox__clear-icon\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"8\" cy=\"8\" r=\"7\" stroke=\"currentColor\" stroke-width=\"1.5\" />\n <path\n d=\"M10.5 5.5L5.5 10.5M5.5 5.5L10.5 10.5\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"gds-selectbox__toggle\"\n [disabled]=\"disabled\"\n (click)=\"toggleDropdown()\"\n tabindex=\"-1\"\n >\n <svg\n class=\"gds-selectbox__icon\"\n [class.gds-selectbox__icon--open]=\"isOpen\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M5 7.5L10 12.5L15 7.5\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </div>\n\n <!-- Dropdown -->\n <div class=\"gds-selectbox__dropdown\" *ngIf=\"isOpen\">\n <div class=\"gds-selectbox__options\">\n <div\n *ngFor=\"let option of filteredOptions\"\n class=\"gds-selectbox__option\"\n [class.gds-selectbox__option--selected]=\"option.value === selectedValue\"\n (click)=\"selectOption(option)\"\n >\n {{ option.display }}\n </div>\n <div\n *ngIf=\"filteredOptions.length === 0\"\n class=\"gds-selectbox__option gds-selectbox__option--empty\"\n >\n Nenhum resultado encontrado\n </div>\n </div>\n </div>\n\n <!-- Helper Text / Error Message -->\n <div\n *ngIf=\"helperText || errorMessage\"\n [id]=\"id + '-description'\"\n class=\"gds-selectbox__description\"\n [class.gds-selectbox__description--error]=\"error && errorMessage\"\n >\n {{ error && errorMessage ? errorMessage : helperText }}\n </div>\n</div>\n",
430
+ changeDetection: ChangeDetectionStrategy.OnPush,
431
+ providers: [
432
+ {
433
+ provide: NG_VALUE_ACCESSOR,
434
+ useExisting: forwardRef(function () { return GdsSelectboxComponent_1; }),
435
+ multi: true,
436
+ },
437
+ ],
438
+ styles: [".gds-selectbox{position:relative;width:100%;display:flex;flex-direction:column;gap:4px}.gds-selectbox__control{position:relative;display:flex;align-items:center;background-color:var(--bg-surface);border:1px solid var(--gds-neutral-300);border-radius:6px;transition:.2s}.gds-selectbox__control:hover:not(.gds-selectbox__control--disabled){border-color:var(--gds-neutral-400)}.gds-selectbox__control--open,.gds-selectbox__control:focus-within{border-color:var(--primary);box-shadow:0 0 0 3px rgba(28,103,244,.1)}.gds-selectbox__control--error{border-color:var(--danger)}.gds-selectbox__control--error:focus-within{box-shadow:0 0 0 3px rgba(216,44,13,.1)}.gds-selectbox__control--disabled{background-color:var(--bg-disabled);cursor:not-allowed;opacity:.6}.gds-selectbox__control--sm{height:32px}.gds-selectbox__control--md{height:40px}.gds-selectbox__control--lg{height:48px}.gds-selectbox__input{flex:1;border:none;outline:0;background:0 0;padding:0 12px;font-size:14px;color:var(--text-foreground);font-family:inherit}.gds-selectbox__input::-moz-placeholder{color:var(--text-foreground)}.gds-selectbox__input::placeholder{color:var(--text-foreground)}.gds-selectbox__input:disabled{cursor:not-allowed}.gds-selectbox__clear{display:flex;align-items:center;justify-content:center;padding:0 4px;border:none;background:0 0;cursor:pointer;color:var(--text-foreground);opacity:.7;transition:color .2s}.gds-selectbox__clear:hover{opacity:1}.gds-selectbox__clear-icon{width:16px;height:16px}.gds-selectbox__toggle{display:flex;align-items:center;justify-content:center;padding:0 8px;border:none;background:0 0;cursor:pointer;color:var(--text-foreground);transition:color .2s}.gds-selectbox__toggle:hover:not(:disabled){color:var(--text-foreground)}.gds-selectbox__toggle:disabled{cursor:not-allowed}.gds-selectbox__icon{transition:transform .2s}.gds-selectbox__icon--open{transform:rotate(180deg)}.gds-selectbox__dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:1000;background-color:var(--bg-surface);border:1px solid var(--gds-neutral-300);border-radius:6px;box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);max-height:300px;overflow:hidden}.gds-selectbox__options{max-height:300px;overflow-y:auto}.gds-selectbox__option{padding:10px 12px;cursor:pointer;font-size:14px;color:var(--text-foreground);transition:background-color .15s}.gds-selectbox__option:hover{background-color:var(--bg-muted)}.gds-selectbox__option--selected{background-color:var(--gds-brand-100);color:var(--primary);font-weight:500}.gds-selectbox__option--selected:hover{background-color:var(--gds-brand-200)}.gds-selectbox__option--empty{color:var(--text-muted);cursor:default;font-style:italic}.gds-selectbox__option--empty:hover{background-color:transparent}.gds-selectbox__description{margin-top:6px;font-size:12px;color:var(--text-muted)}.gds-selectbox__description--error{color:var(--danger)}"]
439
+ })
440
+ ], GdsSelectboxComponent);
441
+ return GdsSelectboxComponent;
442
+ }());
443
+
444
+ var GdsSelectboxModule = /** @class */ (function () {
445
+ function GdsSelectboxModule() {
446
+ }
447
+ GdsSelectboxModule = __decorate([
448
+ NgModule({
449
+ declarations: [GdsSelectboxComponent],
450
+ imports: [CommonModule, GdsLabelModule],
451
+ exports: [GdsSelectboxComponent],
452
+ })
453
+ ], GdsSelectboxModule);
454
+ return GdsSelectboxModule;
455
+ }());
456
+
457
+ var GdsComponent = /** @class */ (function () {
458
+ function GdsComponent() {
459
+ }
460
+ GdsComponent.prototype.ngOnInit = function () {
461
+ };
462
+ GdsComponent = __decorate([
463
+ Component({
464
+ selector: 'lib-gds',
465
+ template: "\n <p>\n gds works!\n </p>\n "
466
+ })
467
+ ], GdsComponent);
468
+ return GdsComponent;
469
+ }());
470
+
471
+ var GdsModule = /** @class */ (function () {
472
+ function GdsModule() {
473
+ }
474
+ GdsModule = __decorate([
475
+ NgModule({
476
+ declarations: [GdsComponent],
477
+ imports: [
478
+ CommonModule,
479
+ GdsButtonModule,
480
+ GdsInputModule,
481
+ GdsLabelModule,
482
+ GdsTextboxModule,
483
+ GdsSelectboxModule,
484
+ ],
485
+ exports: [GdsComponent],
486
+ })
487
+ ], GdsModule);
488
+ return GdsModule;
489
+ }());
490
+
491
+ // BASE COLORS
492
+ var BASE_COLORS = ['gestio-dark', 'gestio-light'];
493
+ // PRIMARY COLORS
494
+ var PRIMARY_COLORS = [
495
+ 'primary',
496
+ 'gestio-primary',
497
+ 'gestio-primary-hover',
498
+ ];
499
+ // SECONDARY COLORS
500
+ var SECONDARY_COLORS = ['gestio-secondary'];
501
+ // TERTIARY COLORS
502
+ var TERTIARY_COLORS = ['gestio-tertiary'];
503
+ // BRAND COLORS
504
+ var BRAND_COLORS = [
505
+ 'gestio-brand-25',
506
+ 'gestio-brand-50',
507
+ 'gestio-brand-100',
508
+ 'gestio-brand-200',
509
+ 'gestio-brand-300',
510
+ 'gestio-brand-400',
511
+ 'gestio-brand-500',
512
+ 'gestio-brand-600',
513
+ 'gestio-brand-700',
514
+ 'gestio-brand-800',
515
+ 'gestio-brand-900',
516
+ ];
517
+ // NEUTRAL COLORS
518
+ var NEUTRAL_COLORS = [
519
+ 'gestio-neutral-25',
520
+ 'gestio-neutral-50',
521
+ 'gestio-neutral-100',
522
+ 'gestio-neutral-200',
523
+ 'gestio-neutral-300',
524
+ 'gestio-neutral-400',
525
+ 'gestio-neutral-500',
526
+ 'gestio-neutral-600',
527
+ 'gestio-neutral-700',
528
+ 'gestio-neutral-800',
529
+ 'gestio-neutral-900',
530
+ 'gestio-neutral-1000',
531
+ ];
532
+ // GREEN COLORS
533
+ var GREEN_COLORS = [
534
+ 'gestio-green-25',
535
+ 'gestio-green-50',
536
+ 'gestio-green-100',
537
+ 'gestio-green-200',
538
+ 'gestio-green-300',
539
+ 'gestio-green-400',
540
+ 'gestio-green-500',
541
+ 'gestio-green-600',
542
+ 'gestio-green-700',
543
+ 'gestio-green-800',
544
+ 'gestio-green-900',
545
+ ];
546
+ // RED COLORS
547
+ var RED_COLORS = [
548
+ 'gestio-red-25',
549
+ 'gestio-red-50',
550
+ 'gestio-red-100',
551
+ 'gestio-red-200',
552
+ 'gestio-red-300',
553
+ 'gestio-red-400',
554
+ 'gestio-red-500',
555
+ 'gestio-red-600',
556
+ 'gestio-red-700',
557
+ 'gestio-red-800',
558
+ 'gestio-red-900',
559
+ ];
560
+ // BLUE COLORS
561
+ var BLUE_COLORS = [
562
+ 'gestio-blue-25',
563
+ 'gestio-blue-50',
564
+ 'gestio-blue-100',
565
+ 'gestio-blue-200',
566
+ 'gestio-blue-300',
567
+ 'gestio-blue-400',
568
+ 'gestio-blue-500',
569
+ 'gestio-blue-600',
570
+ 'gestio-blue-700',
571
+ 'gestio-blue-800',
572
+ 'gestio-blue-900',
573
+ ];
574
+ // AMBER COLORS
575
+ var AMBER_COLORS = [
576
+ 'gestio-amber-25',
577
+ 'gestio-amber-50',
578
+ 'gestio-amber-100',
579
+ 'gestio-amber-200',
580
+ 'gestio-amber-300',
581
+ 'gestio-amber-400',
582
+ 'gestio-amber-500',
583
+ 'gestio-amber-600',
584
+ 'gestio-amber-700',
585
+ 'gestio-amber-800',
586
+ 'gestio-amber-900',
587
+ ];
588
+ // TEAL COLORS
589
+ var TEAL_COLORS = [
590
+ 'gestio-teal-25',
591
+ 'gestio-teal-50',
592
+ 'gestio-teal-100',
593
+ 'gestio-teal-200',
594
+ 'gestio-teal-300',
595
+ 'gestio-teal-400',
596
+ 'gestio-teal-500',
597
+ 'gestio-teal-600',
598
+ 'gestio-teal-700',
599
+ 'gestio-teal-800',
600
+ 'gestio-teal-900',
601
+ ];
602
+ // PURPLE COLORS
603
+ var PURPLE_COLORS = [
604
+ 'gestio-purple-25',
605
+ 'gestio-purple-50',
606
+ 'gestio-purple-100',
607
+ 'gestio-purple-200',
608
+ 'gestio-purple-300',
609
+ 'gestio-purple-400',
610
+ 'gestio-purple-500',
611
+ 'gestio-purple-600',
612
+ 'gestio-purple-700',
613
+ 'gestio-purple-800',
614
+ 'gestio-purple-900',
615
+ ];
616
+ // EMERALD COLORS
617
+ var EMERALD_COLORS = [
618
+ 'gestio-emerald-25',
619
+ 'gestio-emerald-50',
620
+ 'gestio-emerald-100',
621
+ 'gestio-emerald-200',
622
+ 'gestio-emerald-300',
623
+ 'gestio-emerald-400',
624
+ 'gestio-emerald-500',
625
+ 'gestio-emerald-600',
626
+ 'gestio-emerald-700',
627
+ 'gestio-emerald-800',
628
+ 'gestio-emerald-900',
629
+ ];
630
+ // MAGENTA COLORS
631
+ var MAGENTA_COLORS = [
632
+ 'gestio-magenta-25',
633
+ 'gestio-magenta-50',
634
+ 'gestio-magenta-100',
635
+ 'gestio-magenta-200',
636
+ 'gestio-magenta-300',
637
+ 'gestio-magenta-400',
638
+ 'gestio-magenta-500',
639
+ 'gestio-magenta-600',
640
+ 'gestio-magenta-700',
641
+ 'gestio-magenta-800',
642
+ 'gestio-magenta-900',
643
+ ];
644
+ // YELLOW COLORS
645
+ var YELLOW_COLORS = [
646
+ 'gestio-yellow-25',
647
+ 'gestio-yellow-50',
648
+ 'gestio-yellow-100',
649
+ 'gestio-yellow-200',
650
+ 'gestio-yellow-300',
651
+ 'gestio-yellow-400',
652
+ 'gestio-yellow-500',
653
+ 'gestio-yellow-600',
654
+ 'gestio-yellow-700',
655
+ 'gestio-yellow-800',
656
+ 'gestio-yellow-900',
657
+ ];
658
+ // LIME COLORS
659
+ var LIME_COLORS = [
660
+ 'gestio-lime-25',
661
+ 'gestio-lime-50',
662
+ 'gestio-lime-100',
663
+ 'gestio-lime-200',
664
+ 'gestio-lime-300',
665
+ 'gestio-lime-400',
666
+ 'gestio-lime-500',
667
+ 'gestio-lime-600',
668
+ 'gestio-lime-700',
669
+ 'gestio-lime-800',
670
+ 'gestio-lime-900',
671
+ ];
672
+ // ALL COLORS
673
+ var ALL_COLORS = __spread(BASE_COLORS, PRIMARY_COLORS, SECONDARY_COLORS, TERTIARY_COLORS, BRAND_COLORS, NEUTRAL_COLORS, GREEN_COLORS, RED_COLORS, BLUE_COLORS, AMBER_COLORS, TEAL_COLORS, PURPLE_COLORS, EMERALD_COLORS, MAGENTA_COLORS, YELLOW_COLORS, LIME_COLORS);
674
+
675
+ var TYPOGRAPHY_TOKENS = [
676
+ 'gds-heading-3xl',
677
+ 'gds-heading-2xl',
678
+ 'gds-heading-xl',
679
+ 'gds-heading-lg',
680
+ 'gds-heading-md',
681
+ 'gds-heading-sm',
682
+ 'gds-heading-xs',
683
+ 'gds-subheading',
684
+ ];
685
+ var TYPOGRAPHY_DESCRIPTIONS = {
686
+ 'gds-heading-3xl': 'Largest heading for hero sections and major page titles',
687
+ 'gds-heading-2xl': 'Secondary large heading for section dividers',
688
+ 'gds-heading-xl': 'Large heading for important content blocks',
689
+ 'gds-heading-lg': 'Medium heading for subsections',
690
+ 'gds-heading-md': 'Standard heading for content areas',
691
+ 'gds-heading-sm': 'Small heading for cards and components',
692
+ 'gds-heading-xs': 'Smallest heading for micro components',
693
+ 'gds-subheading': 'Supporting text for headings and descriptions',
694
+ };
695
+ var TYPOGRAPHY_EXAMPLES = {
696
+ 'gds-heading-3xl': 'Design System',
697
+ 'gds-heading-2xl': 'Foundation',
698
+ 'gds-heading-xl': 'Typography',
699
+ 'gds-heading-lg': 'Heading Large',
700
+ 'gds-heading-md': 'Heading Medium',
701
+ 'gds-heading-sm': 'Heading Small',
702
+ 'gds-heading-xs': 'Heading XS',
703
+ 'gds-subheading': 'Supporting text that provides additional context and helps establish hierarchy',
704
+ };
705
+
706
+ // Components / Modules
707
+
708
+ /**
709
+ * Generated bundle index. Do not edit.
710
+ */
711
+
712
+ export { ALL_COLORS, AMBER_COLORS, BASE_COLORS, BLUE_COLORS, BRAND_COLORS, EMERALD_COLORS, GREEN_COLORS, GdsButtonComponent, GdsButtonModule, GdsComponent, GdsInputComponent, GdsInputModule, GdsLabelComponent, GdsLabelModule, GdsModule, GdsSelectboxComponent, GdsSelectboxModule, GdsTextboxComponent, GdsTextboxModule, LIME_COLORS, MAGENTA_COLORS, NEUTRAL_COLORS, PRIMARY_COLORS, PURPLE_COLORS, RED_COLORS, SECONDARY_COLORS, TEAL_COLORS, TERTIARY_COLORS, TYPOGRAPHY_DESCRIPTIONS, TYPOGRAPHY_EXAMPLES, TYPOGRAPHY_TOKENS, YELLOW_COLORS };
713
+ //# sourceMappingURL=gestio-gds.js.map