@sula-tech/webcomponents 0.7.3 → 0.7.5
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/dist/cjs/sula-avatar_18.cjs.entry.js +12 -8
- package/dist/cjs/sula-avatar_18.cjs.entry.js.map +1 -1
- package/dist/collection/components/sula-textarea/sula-textarea.js +8 -6
- package/dist/collection/components/sula-textarea/sula-textarea.js.map +1 -1
- package/dist/collection/components/sula-textfield/sula-textfield.js +4 -2
- package/dist/collection/components/sula-textfield/sula-textfield.js.map +1 -1
- package/dist/components/sula-textarea.js +8 -6
- package/dist/components/sula-textarea.js.map +1 -1
- package/dist/components/sula-textfield.js +4 -2
- package/dist/components/sula-textfield.js.map +1 -1
- package/dist/esm/sula-avatar_18.entry.js +12 -8
- package/dist/esm/sula-avatar_18.entry.js.map +1 -1
- package/dist/webcomponents/{p-43b2dde5.entry.js → p-e86b2271.entry.js} +24 -22
- package/dist/webcomponents/{p-43b2dde5.entry.js.map → p-e86b2271.entry.js.map} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
|
@@ -28239,6 +28239,8 @@ const SulaTextarea = class {
|
|
|
28239
28239
|
this.changeElementsStyle();
|
|
28240
28240
|
}
|
|
28241
28241
|
changeElementsStyle() {
|
|
28242
|
+
if (!this.labelElement || !this.activeLabelElement)
|
|
28243
|
+
return;
|
|
28242
28244
|
this.activeLabelElement.style.display = this.isActive ? 'flex' : 'none';
|
|
28243
28245
|
this.labelElement.style.display = this.isActive ? 'none' : 'block';
|
|
28244
28246
|
if (!this.isActive) {
|
|
@@ -28247,34 +28249,34 @@ const SulaTextarea = class {
|
|
|
28247
28249
|
}
|
|
28248
28250
|
render() {
|
|
28249
28251
|
const containerHeight = this.rows * 24 + 48;
|
|
28250
|
-
return (h$1(Host, { key: '
|
|
28252
|
+
return (h$1(Host, { key: '1ec5c0b8f04ea2f32d48301334d2c717327d0b17', ref: node => (this.node = node) }, h$1("div", { key: 'be0e209759746014407a3dc9aa553faea5b4f7f9' }, h$1("div", { key: '238be270fa3cfdbdd0f4a5cda9d99deeb7c9667d', id: "textarea-container", class: {
|
|
28251
28253
|
'relative border rounded-sm px-16 py-12 outline-none caret-brand-primary': true,
|
|
28252
28254
|
'textarea-focus': this.textareaIsFocused && !this.disabled && this.status === SulaTextareaStatus.Default,
|
|
28253
28255
|
'textarea-error': this.status === SulaTextareaStatus.Error && !this.disabled,
|
|
28254
28256
|
'bg-states-bg-disabled border-line-general cursor-not-allowed': this.disabled,
|
|
28255
28257
|
'bg-surface-body border-line-input cursor-text': !this.disabled,
|
|
28256
|
-
}, style: { height: `${containerHeight}px` }, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleTextareaClick }, h$1("label", { key: '
|
|
28258
|
+
}, style: { height: `${containerHeight}px` }, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleTextareaClick }, h$1("label", { key: '66812b881d9396ff093cac598e6c64a54e1cdbad', class: {
|
|
28257
28259
|
'text-base top-16 left-12 absolute transition-all duration-200 ease-in-out pointer-events-none z-10 w-[85%]': true,
|
|
28258
28260
|
'text-text-primary': !this.disabled && (this.isActive || this.status === SulaTextareaStatus.Default),
|
|
28259
28261
|
'text-text-disabled': this.disabled,
|
|
28260
28262
|
'bg-surface-body': !this.disabled && this.isActive,
|
|
28261
|
-
}, ref: node => (this.labelElement = node) }, this.label), h$1("label", { key: '
|
|
28263
|
+
}, ref: node => (this.labelElement = node) }, this.label), h$1("label", { key: 'e0b2a3f1d35b7bd047b6324464772697d565076d', class: {
|
|
28262
28264
|
'absolute font-bold transition-all duration-200 ease-in-out pointer-events-none z-10 active-label hidden from-down': true,
|
|
28263
28265
|
'text-sm top-12 left-16': this.isActive,
|
|
28264
28266
|
'text-text-primary': !this.disabled && (this.isActive || this.status === SulaTextareaStatus.Default),
|
|
28265
28267
|
'text-text-disabled': this.disabled,
|
|
28266
28268
|
'bg-surface-body': !this.disabled && this.isActive,
|
|
28267
|
-
}, ref: node => (this.activeLabelElement = node) }, this.label), h$1("textarea", { key: '
|
|
28269
|
+
}, ref: node => (this.activeLabelElement = node) }, this.label), h$1("textarea", { key: '77603b5c3bfb9430e5a41f0b219c5f0597f4ab92', ref: node => (this.textareaElement = node), placeholder: this.isActive ? this.placeholder : '', rows: this.rows, maxLength: this.maxLength, disabled: this.disabled, class: {
|
|
28268
28270
|
'w-full h-full outline-none text-base bg-transparent border-none resize-none': true,
|
|
28269
28271
|
'pt-6': this.isActive,
|
|
28270
28272
|
'pt-0': !this.isActive,
|
|
28271
28273
|
'text-text-primary': !this.disabled,
|
|
28272
28274
|
'text-text-disabled cursor-not-allowed overflow-hidden': this.disabled,
|
|
28273
|
-
}, onInput: this.handleTextareaChanges, onFocus: this.handleTextareaFocus, onBlur: this.handleBlur, value: this.textValue })), (this.helpText || this.maxLength) && (h$1("div", { key: '
|
|
28275
|
+
}, onInput: this.handleTextareaChanges, onFocus: this.handleTextareaFocus, onBlur: this.handleBlur, value: this.textValue })), (this.helpText || this.maxLength) && (h$1("div", { key: 'ed5e9397e617eb07241dc26fed75d35f0abd16fd', class: "flex justify-between items-center px-16 mt-4 text-sm" }, this.helpText && (h$1("div", { key: '3ee82fca291f045dcee3c2c29da6ac625ee42d44', id: "textarea-help-text", class: {
|
|
28274
28276
|
'text-text-primary': this.status === SulaTextareaStatus.Default && !this.disabled,
|
|
28275
28277
|
'text-feedback-error': this.status === SulaTextareaStatus.Error && !this.disabled,
|
|
28276
28278
|
'text-text-disabled': this.disabled,
|
|
28277
|
-
} }, this.helpText)), this.maxLength && (h$1("div", { key: '
|
|
28279
|
+
} }, this.helpText)), this.maxLength && (h$1("div", { key: 'd4a3503ef45089512b85cf2cb28c32f655f9b17c', id: "max-length-container", class: {
|
|
28278
28280
|
'text-text-primary': this.status === SulaTextareaStatus.Default && !this.disabled,
|
|
28279
28281
|
'text-feedback-error': this.status === SulaTextareaStatus.Error && !this.disabled,
|
|
28280
28282
|
'text-text-disabled': this.disabled,
|
|
@@ -28396,6 +28398,8 @@ const SulaTextfield = class {
|
|
|
28396
28398
|
this.inputElement.focus();
|
|
28397
28399
|
}
|
|
28398
28400
|
changeElementsStyle() {
|
|
28401
|
+
if (!this.inputContainer || !this.labelElement)
|
|
28402
|
+
return;
|
|
28399
28403
|
this.inputContainer.style.display = this.inputIsOpen ? 'flex' : 'none';
|
|
28400
28404
|
this.labelElement.style.display = this.inputIsOpen ? 'none' : 'block';
|
|
28401
28405
|
if (!this.inputIsOpen) {
|
|
@@ -28420,14 +28424,14 @@ const SulaTextfield = class {
|
|
|
28420
28424
|
return this.icon;
|
|
28421
28425
|
}
|
|
28422
28426
|
render() {
|
|
28423
|
-
return (h$1(Host, { key: '
|
|
28427
|
+
return (h$1(Host, { key: 'db19982329c8a6aa8989b3a68ef61a7453ee4a99', ref: node => (this.node = node) }, h$1("div", { key: 'daf060b490b07b535cb414b11c3c75f307f127aa' }, h$1("div", { key: '1d84aec41f352537a124311c076eceec3271832a', id: "button-container", class: {
|
|
28424
28428
|
'flex items-center border rounded-sm px-16 outline-none h-[72px] caret-brand-primary': true,
|
|
28425
28429
|
'flex-row justify-between': !!this.icon || this.type === SulaTextfieldType.Password,
|
|
28426
28430
|
'button-focus': this.inputIsFocused && !this.disabled && this.status === SulaTextfieldStatus.Default,
|
|
28427
28431
|
'button-error': this.status === SulaTextfieldStatus.Error && !this.disabled,
|
|
28428
28432
|
'bg-states-bg-disabled border-line-general cursor-not-allowed': this.disabled,
|
|
28429
28433
|
'bg-surface-body border-line-input cursor-pointer': !this.disabled,
|
|
28430
|
-
}, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleInputClick }, !this.disabled && (h$1("div", { key: '
|
|
28434
|
+
}, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleInputClick }, !this.disabled && (h$1("div", { key: '6ec4a250e1bcd8f053b2dba7e6e6fe6842c1b9bf', class: { 'hidden flex-col w-full': true, 'pr-12': !!this.icon }, ref: node => (this.inputContainer = node) }, h$1("label", { key: '001ef2edc750497dc82a65341f98289fd8d28c6d', class: "font-bold text-sm text-text-primary from-down" }, this.label), h$1("input", { key: '96c0725c63ed92ddbc164f8efcdc003707eb0115', type: this.type, ref: node => (this.inputElement = node), placeholder: this.placeholder, class: "outline-none text-base text-text-primary bg-transparent", onInput: this.handleInputChanges, onFocus: this.handleInputFocus, value: this.textValue }))), h$1("div", { key: 'f65cd97f9ddcadcc07789d8d3dc9421e82e31d78', id: "textfield-label", class: { 'text-base flex items-center': true, 'text-text-primary': !this.disabled, 'text-text-disabled': this.disabled }, ref: node => (this.labelElement = node) }, this.label), (!!this.icon || this.type === SulaTextfieldType.Password) && (h$1("div", { key: '27596e159d5bcdd52f587350fa7ed619d5a6346e', class: "flex items-center justify-center", onClick: this.handleIconClick }, h$1("sula-icon", { key: '2fb87a5df61f3ed9f50f404ca8ff2988c71d10a7', icon: this.getInputIcon(), customClass: `text-2xl ${this.disabled ? 'text-icon-disabled' : 'text-icon-primary'}` })))), (this.helpText || this.maxLength) && !this.disabled && (h$1("div", { key: 'd54b53d64879e9a454a72c7e6726c8b0f5905baa', class: "flex justify-between items-center px-16 mt-4 text-sm" }, this.helpText && (h$1("div", { key: '7ded73f462e82f41b8766e4654cd47fabf3b3a40', id: "textfield-help-text", class: { 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error } }, this.helpText)), this.maxLength && (h$1("div", { key: 'c62b62d8b8c99a775a31092479f1e4d8f581908c', id: "max-length-container", class: { 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error } }, this.textValue ? this.textValue.length : 0, "/", this.maxLength)))))));
|
|
28431
28435
|
}
|
|
28432
28436
|
static get watchers() { return {
|
|
28433
28437
|
"value": ["watchValueHandler"]
|