@brickclay-org/ui 0.0.28 → 0.0.30

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/index.d.ts CHANGED
@@ -693,5 +693,82 @@ declare class BkSelect implements ControlValueAccessor {
693
693
  static ɵcmp: i0.ɵɵComponentDeclaration<BkSelect, "bk-select", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "bindLabel": { "alias": "bindLabel"; "required": false; "isSignal": true; }; "bindValue": { "alias": "bindValue"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "notFoundText": { "alias": "notFoundText"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "clearAllText": { "alias": "clearAllText"; "required": false; "isSignal": true; }; "iconAlt": { "alias": "iconAlt"; "required": false; }; "label": { "alias": "label"; "required": false; }; "required": { "alias": "required"; "required": false; }; "iconSrc": { "alias": "iconSrc"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "maxLabels": { "alias": "maxLabels"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "closeOnSelect": { "alias": "closeOnSelect"; "required": false; "isSignal": true; }; "dropdownPosition": { "alias": "dropdownPosition"; "required": false; "isSignal": true; }; "appendToBody": { "alias": "appendToBody"; "required": false; "isSignal": true; }; "compareWith": { "alias": "compareWith"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "open": "open"; "close": "close"; "focus": "focus"; "blur": "blur"; "search": "search"; "clear": "clear"; "change": "change"; "scrollToEnd": "scrollToEnd"; }, never, never, true, never>;
694
694
  }
695
695
 
696
- export { BkBadge, BkButton, BkButtonGroup, BkCheckbox, BkCustomCalendar, BkGrid, BkIconButton, BkPill, BkRadioButton, BkScheduledDatePicker, BkSelect, BkSpinner, BkTextarea, BkTimePicker, BkToggle, BrickclayIcons, BrickclayLib, CalendarManagerService, CalendarModule };
697
- export type { BadgeColor, BadgeSize, BadgeVariant, ButtonSize, ButtonVariant, CalendarRange, CalendarSelection, GroupItem, GroupMode, IconButtonSize, IconButtonVariant, PillColor, PillSize, PillVariant, ScheduledDateSelection, SortDirection, SpinnerSize, TableAction, TableColumn, TimeConfiguration };
696
+ type InputType = 'text' | 'email' | 'password' | 'number' | 'url' | 'tel';
697
+ type AutoComplete = 'on' | 'off' | 'name' | 'honorific-prefix' | 'given-name' | 'additional-name' | 'family-name' | 'honorific-suffix' | 'nickname' | 'email' | 'username' | 'new-password' | 'current-password' | 'organization-title' | 'organization' | 'street-address' | 'address-line1' | 'address-line2' | 'address-line3' | 'address-level4' | 'address-level3' | 'address-level2' | 'address-level1' | 'country' | 'country-name' | 'postal-code' | 'cc-name' | 'cc-given-name' | 'cc-additional-name' | 'cc-family-name' | 'cc-number' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-csc' | 'cc-type' | 'transaction-currency' | 'transaction-amount' | 'language' | 'bday' | 'bday-day' | 'bday-month' | 'bday-year' | 'sex' | 'tel' | 'tel-country-code' | 'tel-national' | 'tel-area-code' | 'tel-local' | 'tel-extension' | 'impp' | 'url' | 'photo';
698
+ interface CountryOption {
699
+ code: string;
700
+ name: string;
701
+ mask: string;
702
+ prefix: string;
703
+ placeholder: string;
704
+ }
705
+ declare class BkInput implements OnInit, OnDestroy, ControlValueAccessor {
706
+ id: string;
707
+ name: string;
708
+ mask: string | null;
709
+ autoComplete: AutoComplete;
710
+ label: string;
711
+ placeholder: string;
712
+ hint: string;
713
+ required: boolean;
714
+ type: InputType;
715
+ value: string;
716
+ hasError: boolean;
717
+ errorMessage: string;
718
+ disabled: boolean;
719
+ icon: boolean;
720
+ iconSrc?: string;
721
+ iconAlt: string;
722
+ phone: boolean;
723
+ countryCode: string;
724
+ countryOptions: CountryOption[];
725
+ selectedCountry: CountryOption;
726
+ searchLeft: boolean;
727
+ searchRight: boolean;
728
+ password: boolean;
729
+ pattern?: string | null;
730
+ max: number | null;
731
+ min: number | null;
732
+ step: number | null;
733
+ maxlength: number | null;
734
+ minlength: number | null;
735
+ dropdownRef?: ElementRef;
736
+ selectRef?: ElementRef;
737
+ inputField?: ElementRef<HTMLInputElement>;
738
+ isFocused: boolean;
739
+ inputValue: string;
740
+ isDropdownOpen: boolean;
741
+ showPassword: boolean;
742
+ input: EventEmitter<Event>;
743
+ change: EventEmitter<Event>;
744
+ focus: EventEmitter<Event>;
745
+ blur: EventEmitter<Event>;
746
+ get placeHolderText(): string;
747
+ get maskValue(): string;
748
+ get maskPrefixValue(): string;
749
+ private onChange;
750
+ private onTouched;
751
+ writeValue(value: any): void;
752
+ registerOnChange(fn: any): void;
753
+ registerOnTouched(fn: any): void;
754
+ setDisabledState(isDisabled: boolean): void;
755
+ private closeAllDropdownsHandler;
756
+ ngOnInit(): void;
757
+ ngOnDestroy(): void;
758
+ onDocumentClick(event: MouseEvent): void;
759
+ handleFocus(event: Event): void;
760
+ handleBlur(event: Event): void;
761
+ handleInput(event: Event): void;
762
+ handleChange(event: Event): void;
763
+ toggleDropdown(event?: Event): void;
764
+ selectCountry(country: CountryOption): void;
765
+ togglePasswordVisibility(event: Event): void;
766
+ get isFilled(): boolean;
767
+ get inputState(): 'default' | 'focused' | 'filled' | 'error' | 'disabled';
768
+ get currentInputType(): string;
769
+ static ɵfac: i0.ɵɵFactoryDeclaration<BkInput, never>;
770
+ static ɵcmp: i0.ɵɵComponentDeclaration<BkInput, "bk-input", never, { "id": { "alias": "id"; "required": false; }; "name": { "alias": "name"; "required": false; }; "mask": { "alias": "mask"; "required": false; }; "autoComplete": { "alias": "autoComplete"; "required": false; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "required": { "alias": "required"; "required": false; }; "type": { "alias": "type"; "required": false; }; "value": { "alias": "value"; "required": false; }; "hasError": { "alias": "hasError"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconSrc": { "alias": "iconSrc"; "required": false; }; "iconAlt": { "alias": "iconAlt"; "required": false; }; "phone": { "alias": "phone"; "required": false; }; "countryCode": { "alias": "countryCode"; "required": false; }; "countryOptions": { "alias": "countryOptions"; "required": false; }; "searchLeft": { "alias": "searchLeft"; "required": false; }; "searchRight": { "alias": "searchRight"; "required": false; }; "password": { "alias": "password"; "required": false; }; "pattern": { "alias": "pattern"; "required": false; }; "max": { "alias": "max"; "required": false; }; "min": { "alias": "min"; "required": false; }; "step": { "alias": "step"; "required": false; }; "maxlength": { "alias": "maxlength"; "required": false; }; "minlength": { "alias": "minlength"; "required": false; }; }, { "input": "input"; "change": "change"; "focus": "focus"; "blur": "blur"; }, never, never, true, never>;
771
+ }
772
+
773
+ export { BkBadge, BkButton, BkButtonGroup, BkCheckbox, BkCustomCalendar, BkGrid, BkIconButton, BkInput, BkPill, BkRadioButton, BkScheduledDatePicker, BkSelect, BkSpinner, BkTextarea, BkTimePicker, BkToggle, BrickclayIcons, BrickclayLib, CalendarManagerService, CalendarModule };
774
+ export type { AutoComplete, BadgeColor, BadgeSize, BadgeVariant, ButtonSize, ButtonVariant, CalendarRange, CalendarSelection, CountryOption, GroupItem, GroupMode, IconButtonSize, IconButtonVariant, InputType, PillColor, PillSize, PillVariant, ScheduledDateSelection, SortDirection, SpinnerSize, TableAction, TableColumn, TimeConfiguration };
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@brickclay-org/ui",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=17.0.0 <=21.0.0",
6
6
  "@angular/core": ">=17.0.0 <=21.0.0",
7
7
  "moment": "^2.29.0",
8
- "@angular/cdk": "^20.2.14"
8
+ "@angular/cdk": "^20.2.14",
9
+ "ngx-mask": "^20.0.3"
9
10
  },
10
11
  "dependencies": {
11
12
  "tslib": "^2.3.0"
@@ -0,0 +1,231 @@
1
+ /* Input container */
2
+ .input-container {
3
+ @apply flex flex-col gap-1.5;
4
+ }
5
+
6
+ /* Label */
7
+ .input-label {
8
+ @apply text-sm font-medium text-[#141414];
9
+ }
10
+
11
+ .input-label-required {
12
+ @apply text-[#E7000B] ml-0.5;
13
+ }
14
+
15
+ /* Input Wrapper */
16
+ .input-wrapper {
17
+ @apply relative;
18
+ }
19
+
20
+ /* Input field base styles */
21
+ .input-field {
22
+ @apply w-full py-2.5 px-3 text-sm border rounded-[4px] outline-none transition-all duration-200 bg-white;
23
+ height: 40px;
24
+ box-sizing: border-box;
25
+ }
26
+
27
+ /* Default/Initial State */
28
+ .input-field--default {
29
+ @apply border-[#E3E3E7] text-[#141414] placeholder:text-[#6B7080];
30
+ }
31
+
32
+ /* Focused/Active State */
33
+ .input-field--focused {
34
+ @apply border-[#6B7080] text-[#141414];
35
+ }
36
+
37
+ /* Filled State */
38
+ .input-field--filled {
39
+ @apply border-[#E3E3E7] text-[#141414] bg-white;
40
+ }
41
+
42
+ /* Error State */
43
+ .input-field--error {
44
+ @apply border-[#E7000B] text-[#141414];
45
+ }
46
+
47
+ /* Disabled State */
48
+ .input-field--disabled {
49
+ @apply border-[#E3E3E7] bg-[#F4F4F6] text-[#A1A3AE] cursor-not-allowed;
50
+ }
51
+
52
+ /* Icon Input Field - Add padding-left for icon space */
53
+ .input-field--icon {
54
+ @apply pl-[48px];
55
+ }
56
+
57
+ /* Phone Input Field - Add padding-left for selector space */
58
+ .input-field--phone {
59
+ @apply pl-[80px];
60
+ }
61
+
62
+ /* URL Input Field - Add padding-left for prefix space */
63
+ .input-field--url {
64
+ @apply pl-[72px];
65
+ }
66
+
67
+ /* Search Left - Add padding-left for search icon space */
68
+ .input-field--search-left {
69
+ @apply pl-[48px];
70
+ }
71
+
72
+ /* Search Right - Add padding-right for search icon space */
73
+ .input-field--search-right {
74
+ @apply pr-[48px];
75
+ }
76
+
77
+ /* Password - Add padding-right for password toggle icon space */
78
+ .input-field--password {
79
+ @apply pr-[48px];
80
+ }
81
+
82
+ /* When both icon and URL are present, adjust padding */
83
+ .input-field--icon.input-field--url {
84
+ @apply pl-[120px];
85
+ }
86
+
87
+ /* When phone and icon are present */
88
+ .input-field--phone.input-field--icon {
89
+ @apply pl-[128px];
90
+ }
91
+
92
+ /* Phone Country Selector - Absolute Positioned */
93
+ .input-phone-selector {
94
+ @apply absolute left-0 top-0 bottom-0 px-3 flex items-center gap-2 cursor-pointer border transition-colors duration-200;
95
+ border-top-left-radius: 4px;
96
+ border-bottom-left-radius: 4px;
97
+ }
98
+
99
+ .input-phone-selector-text {
100
+ @apply text-xs leading-[18px] text-[#A1A3AE] font-normal;
101
+ }
102
+
103
+ .input-phone-selector-arrow {
104
+ @apply w-4 h-4 transition-transform duration-200;
105
+ }
106
+
107
+ .input-phone-selector-arrow--open {
108
+ @apply rotate-180;
109
+ }
110
+
111
+ /* Phone Selector - State Specific Border Colors */
112
+ .input-phone-selector--default {
113
+ @apply bg-white border-[#E3E3E7];
114
+ }
115
+
116
+ .input-phone-selector--focused {
117
+ @apply bg-white border-[#6B7080];
118
+ }
119
+
120
+ .input-phone-selector--filled {
121
+ @apply bg-white border-[#E3E3E7];
122
+ }
123
+
124
+ .input-phone-selector--error {
125
+ @apply bg-white border-[#E7000B];
126
+ }
127
+
128
+ .input-phone-selector--disabled {
129
+ @apply bg-[#F4F4F6] border-[#E3E3E7] cursor-not-allowed;
130
+ }
131
+
132
+ .input-phone-selector--disabled .input-phone-selector-text {
133
+ @apply text-[#A1A3AE];
134
+ }
135
+
136
+ /* Phone Dropdown Menu */
137
+ .input-phone-dropdown {
138
+ @apply absolute left-0 top-full mt-1 w-[80px] bg-white border border-[#E3E3E7] rounded-[4px] shadow-lg z-50 max-h-48 overflow-y-auto;
139
+ }
140
+
141
+ .input-phone-dropdown-item {
142
+ @apply w-full px-5 py-2.5 text-center text-xs leading-[18px] text-[#6B7080] hover:bg-[#F9FAFA] transition-colors duration-200 border-none bg-transparent;
143
+ }
144
+
145
+ .input-phone-dropdown-item--active {
146
+ @apply bg-[#F9FAFA] text-[#141414];
147
+ }
148
+
149
+ /* Icon - Absolute Positioned Inside Input */
150
+ .input-icon {
151
+ @apply absolute left-3 top-1/2 -translate-y-1/2 w-6 h-6 pointer-events-none size-6;
152
+ }
153
+ /* When phone selector is present, adjust icon position */
154
+ .input-wrapper--phone .input-icon {
155
+ @apply left-[80px];
156
+ }
157
+
158
+ /* Search Icon - Absolute Positioned Inside Input */
159
+ .input-search-icon {
160
+ @apply absolute top-1/2 -translate-y-1/2 w-5 h-5 pointer-events-none;
161
+ }
162
+
163
+ /* Search Icon Left */
164
+ .input-search-icon--left {
165
+ @apply left-3;
166
+ }
167
+
168
+ /* Search Icon Right */
169
+ .input-search-icon--right {
170
+ @apply right-3;
171
+ }
172
+
173
+ /* Password Toggle Button */
174
+ .input-password-toggle {
175
+ @apply absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 p-0 border-0 bg-transparent cursor-pointer outline-none flex items-center justify-center;
176
+ }
177
+
178
+ .input-password-toggle:disabled {
179
+ @apply cursor-not-allowed opacity-50;
180
+ }
181
+
182
+ .input-password-toggle:hover:not(:disabled) {
183
+ @apply opacity-70;
184
+ }
185
+
186
+ /* Password Icon */
187
+ .input-password-icon {
188
+ @apply w-5 h-5 pointer-events-none;
189
+ }
190
+ /* URL Prefix - Absolute Positioned Inside Input */
191
+ .input-url-prefix {
192
+ @apply absolute left-0 top-0 bottom-0 py-2.5 px-3 text-sm text-[#6B7080] bg-white border flex items-center transition-colors duration-200 pointer-events-none;
193
+ border-top-left-radius: 4px;
194
+ border-bottom-left-radius: 4px;
195
+ }
196
+
197
+ /* When icon is present, adjust URL prefix position */
198
+ .input-wrapper--icon .input-url-prefix {
199
+ @apply left-[48px];
200
+ }
201
+
202
+ /* URL Prefix - State Specific Border Colors (matches input border) */
203
+ .input-url-prefix--default {
204
+ @apply border-[#E3E3E7];
205
+ }
206
+
207
+ .input-url-prefix--focused {
208
+ @apply border-[#6B7080];
209
+ }
210
+
211
+ .input-url-prefix--filled {
212
+ @apply border-[#E3E3E7];
213
+ }
214
+
215
+ .input-url-prefix--error {
216
+ @apply border-[#E7000B];
217
+ }
218
+
219
+ .input-url-prefix--disabled {
220
+ @apply bg-[#F4F4F6] text-[#A1A3AE] border-r-[#E3E3E7];
221
+ }
222
+
223
+ /* Hint text */
224
+ .input-hint {
225
+ @apply text-xs text-[#868997] font-normal;
226
+ }
227
+
228
+ /* Error message */
229
+ .input-error {
230
+ @apply text-xs text-[#E7000B] font-normal;
231
+ }
package/src/styles.css CHANGED
@@ -11,4 +11,5 @@
11
11
  @import './lib/textarea/textarea.css';
12
12
  @import './lib/grid/components/grid/grid.css';
13
13
  @import './lib/select/select.css';
14
+ @import './lib/input/input.css';
14
15