dasar-ui 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +19 -14
  2. package/fesm2022/dasar-ui.mjs +9664 -0
  3. package/fesm2022/dasar-ui.mjs.map +1 -0
  4. package/package.json +39 -42
  5. package/types/dasar-ui.d.ts +2114 -0
  6. package/.editorconfig +0 -17
  7. package/.nvmrc +0 -1
  8. package/.prettierrc +0 -12
  9. package/.vscode/extensions.json +0 -4
  10. package/.vscode/launch.json +0 -20
  11. package/.vscode/settings.json +0 -4
  12. package/.vscode/tasks.json +0 -42
  13. package/CHANGELOG.md +0 -18
  14. package/angular.json +0 -37
  15. package/projects/dasar-ui/README.md +0 -64
  16. package/projects/dasar-ui/ng-package.json +0 -10
  17. package/projects/dasar-ui/package.json +0 -27
  18. package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.html +0 -9
  19. package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.scss +0 -352
  20. package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.spec.ts +0 -21
  21. package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.ts +0 -154
  22. package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.html +0 -1
  23. package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.scss +0 -69
  24. package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.spec.ts +0 -21
  25. package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.ts +0 -30
  26. package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.html +0 -158
  27. package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.scss +0 -371
  28. package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.spec.ts +0 -21
  29. package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.ts +0 -458
  30. package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.html +0 -80
  31. package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.scss +0 -184
  32. package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.spec.ts +0 -21
  33. package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.ts +0 -294
  34. package/projects/dasar-ui/src/lib/components/dasar-chip/dasar-chip.html +0 -42
  35. package/projects/dasar-ui/src/lib/components/dasar-chip/dasar-chip.scss +0 -38
  36. package/projects/dasar-ui/src/lib/components/dasar-chip/dasar-chip.ts +0 -207
  37. package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.html +0 -102
  38. package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.scss +0 -301
  39. package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.spec.ts +0 -21
  40. package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.ts +0 -527
  41. package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.html +0 -1
  42. package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.registry.ts +0 -5089
  43. package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.scss +0 -24
  44. package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.spec.ts +0 -21
  45. package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.ts +0 -97
  46. package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.html +0 -54
  47. package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.scss +0 -281
  48. package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.spec.ts +0 -21
  49. package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.ts +0 -323
  50. package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.html +0 -63
  51. package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.scss +0 -195
  52. package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.spec.ts +0 -21
  53. package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.ts +0 -240
  54. package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.html +0 -90
  55. package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.scss +0 -358
  56. package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.spec.ts +0 -21
  57. package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.ts +0 -337
  58. package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.html +0 -98
  59. package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.scss +0 -51
  60. package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.spec.ts +0 -21
  61. package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.ts +0 -99
  62. package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.css +0 -0
  63. package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.html +0 -1
  64. package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.spec.ts +0 -21
  65. package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.ts +0 -9
  66. package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.html +0 -163
  67. package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.scss +0 -283
  68. package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.ts +0 -230
  69. package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.css +0 -0
  70. package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.html +0 -1
  71. package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.spec.ts +0 -21
  72. package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.ts +0 -9
  73. package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.html +0 -185
  74. package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.scss +0 -347
  75. package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.spec.ts +0 -21
  76. package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.ts +0 -497
  77. package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.css +0 -0
  78. package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.html +0 -1
  79. package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.spec.ts +0 -21
  80. package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.ts +0 -9
  81. package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.html +0 -162
  82. package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.scss +0 -283
  83. package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.spec.ts +0 -21
  84. package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.ts +0 -380
  85. package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.html +0 -41
  86. package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.scss +0 -126
  87. package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.spec.ts +0 -21
  88. package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.ts +0 -72
  89. package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.html +0 -43
  90. package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.scss +0 -189
  91. package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.spec.ts +0 -21
  92. package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.ts +0 -139
  93. package/projects/dasar-ui/src/lib/components/dasar-theme-provider/dasar-theme-provider.ts +0 -286
  94. package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.css +0 -0
  95. package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.html +0 -1
  96. package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.spec.ts +0 -21
  97. package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.ts +0 -9
  98. package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.css +0 -0
  99. package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.html +0 -1
  100. package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.spec.ts +0 -21
  101. package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.ts +0 -9
  102. package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.css +0 -0
  103. package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.html +0 -1
  104. package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.spec.ts +0 -21
  105. package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.ts +0 -9
  106. package/projects/dasar-ui/src/lib/models/theme.model.ts +0 -643
  107. package/projects/dasar-ui/src/lib/models/type.model.ts +0 -11
  108. package/projects/dasar-ui/src/lib/services/theme.service.ts +0 -643
  109. package/projects/dasar-ui/src/lib/styles/theme.ts +0 -70
  110. package/projects/dasar-ui/src/lib/utils/common.ts +0 -175
  111. package/projects/dasar-ui/src/public-api.ts +0 -23
  112. package/projects/dasar-ui/tsconfig.lib.json +0 -21
  113. package/projects/dasar-ui/tsconfig.lib.prod.json +0 -11
  114. package/projects/dasar-ui/tsconfig.spec.json +0 -11
  115. package/tsconfig.json +0 -37
  116. /package/{projects/dasar-ui/src/lib/styles → styles}/theme.scss +0 -0
@@ -1,24 +0,0 @@
1
- @use '../../styles/theme.scss' as *;
2
-
3
- :host {
4
- justify-content: center;
5
- vertical-align: middle;
6
- display: inline-flex;
7
- align-items: center;
8
- line-height: 0;
9
- }
10
- .dasar-icon {
11
- justify-content: center;
12
- display: inline-flex;
13
- align-items: center;
14
- line-height: 0;
15
- svg {
16
- display: block;
17
- flex-shrink: 0;
18
- }
19
- &.fluid {
20
- height: fit-content;
21
- width: fit-content;
22
- padding: none;
23
- }
24
- }
@@ -1,21 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { DasarIcon } from './dasar-icon';
3
-
4
- describe('DasarIcon', () => {
5
- let component: DasarIcon;
6
- let fixture: ComponentFixture<DasarIcon>;
7
-
8
- beforeEach(async () => {
9
- await TestBed.configureTestingModule({
10
- imports: [DasarIcon],
11
- }).compileComponents();
12
-
13
- fixture = TestBed.createComponent(DasarIcon);
14
- component = fixture.componentInstance;
15
- await fixture.whenStable();
16
- });
17
-
18
- it('should create', () => {
19
- expect(component).toBeTruthy();
20
- });
21
- });
@@ -1,97 +0,0 @@
1
- import {
2
- ViewEncapsulation,
3
- ChangeDetectorRef,
4
- booleanAttribute,
5
- HostBinding,
6
- Component,
7
- inject,
8
- OnInit,
9
- Input,
10
- } from '@angular/core';
11
- import { CommonModule } from '@angular/common';
12
- import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
13
-
14
- import { DASAR_THEME_PROVIDER } from '../dasar-theme-provider/dasar-theme-provider';
15
- import { DasarThemeService } from '../../services/theme.service';
16
- import { ScaleAttributeType } from '../../models/type.model';
17
- import { resolveThemeDefault } from '../../utils/common';
18
- import { ICON_REGISTRY } from './dasar-icon.registry';
19
-
20
- export type DasarIconSizeType = ScaleAttributeType | number;
21
-
22
- export interface DasarIconConfig {
23
- size?: DasarIconSizeType;
24
- stroke?: number;
25
- fluid?: boolean;
26
- color?: string;
27
- name?: string;
28
- }
29
-
30
- @Component({
31
- encapsulation: ViewEncapsulation.None,
32
- styleUrls: ['./dasar-icon.scss'],
33
- templateUrl: './dasar-icon.html',
34
- imports: [CommonModule],
35
- selector: 'dasar-icon',
36
- standalone: true,
37
- })
38
- export class DasarIcon implements OnInit {
39
- private themeProvider = inject(DASAR_THEME_PROVIDER, { optional: true });
40
- private themeService = inject(DasarThemeService, { optional: true });
41
- private readonly cdr = inject(ChangeDetectorRef);
42
- private sanitizer = inject(DomSanitizer);
43
-
44
- @Input({ transform: booleanAttribute }) fluid = resolveThemeDefault(
45
- 'icon',
46
- 'fluid',
47
- false,
48
- this.themeProvider,
49
- this.themeService,
50
- );
51
- @Input() size = resolveThemeDefault('icon', 'size', 'md', this.themeProvider, this.themeService);
52
- @Input() color = resolveThemeDefault(
53
- 'icon',
54
- 'color',
55
- 'currentColor',
56
- this.themeProvider,
57
- this.themeService,
58
- );
59
- @Input() stroke = resolveThemeDefault('icon', 'stroke', 2, this.themeProvider, this.themeService);
60
- @Input() name = resolveThemeDefault('icon', 'name', '', this.themeProvider, this.themeService);
61
-
62
- @HostBinding('class')
63
- get hostClasses(): string {
64
- return `dasar-icon size-${this.size}`;
65
- }
66
- get computedSize(): string | number {
67
- switch (this.size) {
68
- case 'md':
69
- return 24;
70
- case 'lg':
71
- return 32;
72
- case 'xl':
73
- return 40;
74
- default:
75
- return typeof this.size === 'number' ? this.size : 16; // sm and xs
76
- }
77
- }
78
- get svgContent(): SafeHtml {
79
- const registry = ICON_REGISTRY;
80
- const nodes = registry[this.name];
81
- if (!nodes) return '';
82
- const inner = nodes
83
- .map(([tag, attrs]) => {
84
- const attrsStr = Object.entries(attrs)
85
- .map(([k, v]) => `${k}="${v}"`)
86
- .join(' ');
87
- return `<${tag} ${attrsStr}/>`;
88
- })
89
- .join('');
90
-
91
- const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${this.computedSize}" height="${+this.computedSize - 4}" viewBox="0 0 24 24" fill="none" stroke="${this.color}" stroke-width="${this.stroke}" stroke-linecap="round" stroke-linejoin="round">${inner}</svg>`;
92
- return this.sanitizer.bypassSecurityTrustHtml(svg);
93
- }
94
- ngOnInit(): void {}
95
- }
96
-
97
- export const DasarIconComponent = [DasarIcon] as const;
@@ -1,54 +0,0 @@
1
- <div class="dasar-input-wrapper" [ngClass]="hostClass" [ngStyle]="hostStyle">
2
- @if (label || labelRight) {
3
- <div class="dasar-input-label-row">
4
- @if (label) {
5
- <label class="dasar-input-label">{{ label }}</label>
6
- }
7
- @if (labelRight || extraLabelSlot) {
8
- <div class="dasar-input-label-right">
9
- @if (extraLabelSlot) {
10
- <ng-content select="[extra-label-slot]"></ng-content>
11
- } @else {
12
- <span>{{ labelRight }}</span>
13
- }
14
- </div>
15
- }
16
- </div>
17
- }
18
- <div
19
- class="dasar-input-container appearance-{{ appearance }} size-{{ size }} radius-{{ radius }}"
20
- [class.hide-overflow]="hideOverflow"
21
- [class.full-width]="fullWidth"
22
- [class.disabled]="disabled"
23
- [class.fluid]="fluid"
24
- [class.error]="error"
25
- [ngClass]="containerClass"
26
- [ngStyle]="containerStyle"
27
- >
28
- <ng-content select="[prefix-slot]"></ng-content>
29
- <input
30
- [placeholder]="placeholder"
31
- [ngClass]="inputClass"
32
- [ngStyle]="inputStyle"
33
- [disabled]="disabled"
34
- [readonly]="readonly"
35
- [value]="value"
36
- [type]="type"
37
- (input)="onInput($event)"
38
- (blur)="onBlur()"
39
- class="dasar-input-native"
40
- />
41
- <ng-content select="[suffix-slot]"></ng-content>
42
- </div>
43
- @if (hint) {
44
- <div
45
- class="dasar-input-hint"
46
- [class.disabled]="disabled"
47
- [class.error]="error"
48
- [ngClass]="hintClass"
49
- [ngStyle]="hintStyle"
50
- >
51
- {{ hint }}
52
- </div>
53
- }
54
- </div>
@@ -1,281 +0,0 @@
1
- @use '../../styles/theme.scss' as *;
2
-
3
- .dasar-input {
4
- display: inline-flex;
5
- flex-direction: column;
6
- position: relative;
7
- width: fit-content;
8
-
9
- &.full-width {
10
- width: 100%;
11
- }
12
-
13
- &.disabled {
14
- cursor: not-allowed;
15
- }
16
- }
17
-
18
- .dasar-input-wrapper {
19
- display: flex;
20
- flex-direction: column;
21
- gap: var(--input-wrapper-gap, var(--space-1));
22
- position: relative;
23
- }
24
-
25
- .dasar-input-label-row {
26
- font-weight: var(--input-label-font-weight, var(--font-weight-medium));
27
- color: var(--input-label-color, var(--theme-text-primary-color));
28
- line-height: var(--line-height-tight);
29
- justify-content: space-between;
30
- align-items: center;
31
- display: flex;
32
-
33
- .dasar-input-label {
34
- font-size: var(--input-label-font-size, var(--font-size-md));
35
- }
36
-
37
- .dasar-input-label-right {
38
- color: var(--input-label-right-color, var(--theme-text-secondary-color));
39
- font-size: var(--input-label-right-font-size, var(--font-size-sm));
40
- font-weight: var(--font-weight-regular);
41
- display: inline-flex;
42
- align-items: center;
43
- gap: var(--space-1);
44
- }
45
- }
46
-
47
- .dasar-input-container {
48
- box-sizing: border-box;
49
- font-family: inherit;
50
- display: inline-flex;
51
- align-items: center;
52
- width: auto;
53
- gap: var(--input-gap, var(--space-base));
54
- color: var(--input-color, var(--theme-text-primary-color));
55
- border-radius: var(--input-radius-sm, var(--radius-sm));
56
-
57
- &.hide-overflow {
58
- overflow: hidden;
59
- }
60
-
61
- &.size-xs {
62
- padding: 0 var(--input-padding-horizontal-xs, var(--space-base));
63
- height: var(--input-height-xs, var(--space-6));
64
- font-size: var(--font-size-xs);
65
-
66
- &:has([prefix-slot]) {
67
- padding-left: 0;
68
- // .dasar-input-native {
69
- // padding-left: var(--input-padding-horizontal-xs, var(--space-base));
70
- // }
71
- }
72
-
73
- &:has([suffix-slot]) {
74
- padding-right: 0;
75
- // .dasar-input-native {
76
- // padding-right: var(--input-padding-horizontal-xs, var(--space-base));
77
- // }
78
- }
79
- }
80
-
81
- &.size-sm {
82
- padding: 0 var(--input-padding-horizontal-sm, var(--space-3));
83
- height: var(--input-height-sm, var(--space-8));
84
- font-size: var(--font-size-sm);
85
-
86
- &:has([prefix-slot]) {
87
- padding-left: 0;
88
- // .dasar-input-native {
89
- // padding-left: var(--input-padding-horizontal-sm, var(--space-3));
90
- // }
91
- }
92
-
93
- &:has([suffix-slot]) {
94
- padding-right: 0;
95
- // .dasar-input-native {
96
- // padding-right: var(--input-padding-horizontal-sm, var(--space-3));
97
- // }
98
- }
99
- }
100
-
101
- &.size-md {
102
- padding: 0 var(--input-padding-horizontal-md, var(--space-4));
103
- height: var(--input-height-md, var(--space-10));
104
- font-size: var(--font-size-base);
105
-
106
- &:has([prefix-slot]) {
107
- padding-left: 0;
108
- // .dasar-input-native {
109
- // padding-left: var(--input-padding-horizontal-md, var(--space-4));
110
- // }
111
- }
112
-
113
- &:has([suffix-slot]) {
114
- padding-right: 0;
115
- // .dasar-input-native {
116
- // padding-right: var(--input-padding-horizontal-md, var(--space-4));
117
- // }
118
- }
119
- }
120
-
121
- &.size-lg {
122
- padding: 0 var(--input-padding-horizontal-lg, var(--space-5));
123
- height: var(--input-height-lg, var(--space-12));
124
- font-size: var(--font-size-lg);
125
-
126
- &:has([prefix-slot]) {
127
- padding-left: 0;
128
- // .dasar-input-native {
129
- // padding-left: var(--input-padding-horizontal-lg, var(--space-5));
130
- // }
131
- }
132
-
133
- &:has([suffix-slot]) {
134
- padding-right: 0;
135
- // .dasar-input-native {
136
- // padding-right: var(--input-padding-horizontal-lg, var(--space-5));
137
- // }
138
- }
139
- }
140
-
141
- &.size-xl {
142
- padding: 0 var(--input-padding-horizontal-xl, var(--space-6));
143
- height: var(--input-height-xl, var(--space-16));
144
- font-size: var(--font-size-xl);
145
-
146
- &:has([prefix-slot]) {
147
- padding-left: 0;
148
- // .dasar-input-native {
149
- // padding-left: var(--input-padding-horizontal-xl, var(--space-6));
150
- // }
151
- }
152
-
153
- &:has([suffix-slot]) {
154
- padding-right: 0;
155
- // .dasar-input-native {
156
- // padding-right: var(--input-padding-horizontal-xl, var(--space-6));
157
- // }
158
- }
159
- }
160
-
161
- &.radius-none {
162
- border-radius: var(--input-radius-none, var(--radius-none));
163
- }
164
- &.radius-xs {
165
- border-radius: var(--input-radius-xs, var(--radius-xs));
166
- }
167
- &.radius-sm {
168
- border-radius: var(--input-radius-sm, var(--radius-sm));
169
- }
170
- &.radius-md {
171
- border-radius: var(--input-radius-md, var(--radius-md));
172
- }
173
- &.radius-lg {
174
- border-radius: var(--input-radius-lg, var(--radius-lg));
175
- }
176
- &.radius-xl {
177
- border-radius: var(--input-radius-xl, var(--radius-xl));
178
- }
179
- &.radius-full {
180
- border-radius: var(--input-radius-full, var(--radius-full));
181
- }
182
-
183
- &.appearance-outline {
184
- background-color: var(--input-outline-bg, transparent);
185
- border: 1px solid var(--input-outline-border, var(--theme-border-strong-color));
186
-
187
- &:hover:not(.disabled) {
188
- border-color: var(--input-outline-hover-border, var(--theme-primary-color));
189
- }
190
-
191
- &:focus-within {
192
- border-color: var(--input-outline-focus-border, var(--theme-primary-color));
193
- box-shadow: 0 0 0 3px var(--input-outline-focus-ring, var(--theme-primary-surface-color));
194
- }
195
- }
196
-
197
- &.appearance-filled {
198
- background-color: var(--input-filled-bg, var(--theme-bg-hover-color));
199
- border: 1px solid var(--input-filled-border, transparent);
200
-
201
- &:hover:not(.disabled) {
202
- background-color: var(--input-filled-hover-bg, var(--theme-border-subtle-color));
203
- }
204
-
205
- &:focus-within {
206
- background-color: var(--input-filled-focus-bg, var(--theme-bg-surface-color));
207
- border-color: var(--input-filled-focus-border, var(--theme-primary-color));
208
- box-shadow: 0 0 0 3px var(--input-filled-focus-ring, var(--theme-primary-surface-color));
209
- }
210
- }
211
-
212
- &.error {
213
- border-color: var(--input-error-border, var(--theme-danger-color)) !important;
214
-
215
- &:focus-within {
216
- box-shadow: 0 0 0 3px var(--input-error-focus-ring, var(--theme-danger-surface-color));
217
- }
218
- }
219
-
220
- &.disabled {
221
- background-color: var(--input-disabled-bg, var(--theme-bg-hover-color)) !important;
222
- border-color: var(--input-disabled-border, transparent) !important;
223
- cursor: not-allowed;
224
- opacity: var(--input-disabled-opacity, 0.6);
225
- pointer-events: none;
226
- }
227
-
228
- &.fluid {
229
- padding: 0;
230
- }
231
-
232
- &:has([suffix]) {
233
- padding-right: 0;
234
- }
235
-
236
- &:has([prefix]) {
237
- padding-left: 0;
238
- }
239
- }
240
-
241
- .dasar-input-native {
242
- flex: 1;
243
- width: 100%;
244
- border: none;
245
- outline: none;
246
- background: transparent;
247
- font-family: inherit;
248
- font-size: inherit;
249
- color: inherit;
250
- padding: 0;
251
-
252
- &::placeholder {
253
- color: var(--input-placeholder-color, var(--theme-text-secondary-color));
254
- }
255
-
256
- &:-webkit-autofill,
257
- &:-webkit-autofill:hover,
258
- &:-webkit-autofill:focus {
259
- -webkit-box-shadow: 0 0 0 30px var(--input-autofill-bg, var(--theme-bg-default-color)) inset !important;
260
- -webkit-text-fill-color: var(
261
- --input-autofill-color,
262
- var(--theme-text-primary-color)
263
- ) !important;
264
- }
265
- }
266
-
267
- .dasar-input-hint {
268
- font-size: var(--input-hint-font-size, var(--font-size-xs));
269
- color: var(--input-hint-color, var(--theme-text-secondary-color));
270
- line-height: var(--line-height-normal);
271
- margin-top: calc(var(--space-0-5) * -1);
272
-
273
- &.error {
274
- color: var(--input-hint-error-color, var(--theme-danger-color));
275
- }
276
-
277
- &.disabled {
278
- opacity: var(--input-disabled-opacity, 0.6);
279
- cursor: not-allowed;
280
- }
281
- }
@@ -1,21 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { DasarInput } from './dasar-input';
3
-
4
- describe('DasarInput', () => {
5
- let component: DasarInput;
6
- let fixture: ComponentFixture<DasarInput>;
7
-
8
- beforeEach(async () => {
9
- await TestBed.configureTestingModule({
10
- imports: [DasarInput],
11
- }).compileComponents();
12
-
13
- fixture = TestBed.createComponent(DasarInput);
14
- component = fixture.componentInstance;
15
- await fixture.whenStable();
16
- });
17
-
18
- it('should create', () => {
19
- expect(component).toBeTruthy();
20
- });
21
- });