@sula-tech/webcomponents 0.14.0 → 0.15.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.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{sula-avatar_21.cjs.entry.js → sula-avatar_22.cjs.entry.js} +1932 -19
- package/dist/{esm/sula-avatar_21.entry.js.map → cjs/sula-avatar_22.cjs.entry.js.map} +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/sula-avatar/sula-avatar.css +1 -1
- package/dist/collection/components/sula-dropdown/sula-dropdown.js +39 -17
- package/dist/collection/components/sula-dropdown/sula-dropdown.js.map +1 -1
- package/dist/collection/components/sula-dropdown/sula-dropdown.stories.js +16 -1
- package/dist/collection/components/sula-dropdown/sula-dropdown.stories.js.map +1 -1
- package/dist/collection/components/sula-icon/sula-icon.css +1 -1
- package/dist/collection/components/sula-tooltip/model/sula-tooltip.model.js +13 -0
- package/dist/collection/components/sula-tooltip/model/sula-tooltip.model.js.map +1 -0
- package/dist/collection/components/sula-tooltip/sula-tooltip.css +1 -0
- package/dist/collection/components/sula-tooltip/sula-tooltip.js +218 -0
- package/dist/collection/components/sula-tooltip/sula-tooltip.js.map +1 -0
- package/dist/collection/components/sula-tooltip/sula-tooltip.stories.js +179 -0
- package/dist/collection/components/sula-tooltip/sula-tooltip.stories.js.map +1 -0
- package/dist/components/{p-tr2oA4pB.js → p-BESq0oqe.js} +3 -3
- package/dist/components/{p-tr2oA4pB.js.map → p-BESq0oqe.js.map} +1 -1
- package/dist/components/{p-BlyFOqde.js → p-BznR9x_k.js} +3 -3
- package/dist/components/{p-BlyFOqde.js.map → p-BznR9x_k.js.map} +1 -1
- package/dist/components/sula-avatar.js +2 -2
- package/dist/components/sula-badge.js +1 -1
- package/dist/components/sula-breadcrumb.js +1 -1
- package/dist/components/sula-button.js +1 -1
- package/dist/components/sula-checkbox.js +1 -1
- package/dist/components/sula-chip.js +1 -1
- package/dist/components/sula-dropdown.js +21 -18
- package/dist/components/sula-dropdown.js.map +1 -1
- package/dist/components/sula-icon.js +1 -1
- package/dist/components/sula-modal.js +2 -2
- package/dist/components/sula-progress-bar.js +1 -1
- package/dist/components/sula-search-bar.js +1 -1
- package/dist/components/sula-segmented-control.js +1 -1
- package/dist/components/sula-tag.js +1 -1
- package/dist/components/sula-textfield.js +1 -1
- package/dist/components/sula-tiles.js +1 -1
- package/dist/components/sula-timeline-list.js +1 -1
- package/dist/components/sula-tooltip.d.ts +11 -0
- package/dist/components/sula-tooltip.js +1946 -0
- package/dist/components/sula-tooltip.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{sula-avatar_21.entry.js → sula-avatar_22.entry.js} +1932 -20
- package/dist/esm/sula-avatar_22.entry.js.map +1 -0
- package/dist/esm/webcomponents.js +1 -1
- package/dist/types/components/sula-dropdown/sula-dropdown.d.ts +5 -2
- package/dist/types/components/sula-dropdown/sula-dropdown.stories.d.ts +8 -0
- package/dist/types/components/sula-tooltip/model/sula-tooltip.model.d.ts +10 -0
- package/dist/types/components/sula-tooltip/sula-tooltip.d.ts +40 -0
- package/dist/types/components/sula-tooltip/sula-tooltip.stories.d.ts +105 -0
- package/dist/types/components.d.ts +63 -0
- package/dist/webcomponents/{p-01cb6887.entry.js → p-6dc2ae91.entry.js} +1906 -186
- package/dist/webcomponents/p-6dc2ae91.entry.js.map +1 -0
- package/dist/webcomponents/webcomponents.esm.js +9 -3
- package/package.json +2 -1
- package/dist/cjs/sula-avatar_21.cjs.entry.js.map +0 -1
- package/dist/webcomponents/p-01cb6887.entry.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
2
|
import { d as defineCustomElement$1, a as SulaLoaderSize } from './p-CkPiwCwQ.js';
|
|
3
|
-
import { d as defineCustomElement$2 } from './p-
|
|
3
|
+
import { d as defineCustomElement$2 } from './p-BESq0oqe.js';
|
|
4
4
|
|
|
5
5
|
var SulaButtonAppearance;
|
|
6
6
|
(function (SulaButtonAppearance) {
|
|
@@ -226,6 +226,6 @@ function defineCustomElement() {
|
|
|
226
226
|
defineCustomElement();
|
|
227
227
|
|
|
228
228
|
export { SulaButton as S, SulaButtonAppearance as a, defineCustomElement as d };
|
|
229
|
-
//# sourceMappingURL=p-
|
|
229
|
+
//# sourceMappingURL=p-BznR9x_k.js.map
|
|
230
230
|
|
|
231
|
-
//# sourceMappingURL=p-
|
|
231
|
+
//# sourceMappingURL=p-BznR9x_k.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-BlyFOqde.js","mappings":";;;;IAAY;AAAZ,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,oBAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,oBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,GAI/B,EAAA,CAAA,CAAA;AAED,IAAY,cAIX;AAJD,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,cAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,cAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACb,CAAC,EAJW,cAAc,KAAd,cAAc,GAIzB,EAAA,CAAA,CAAA;AAED,IAAY,gBAIX;AAJD,CAAA,UAAY,gBAAgB,EAAA;AAC1B,IAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,gBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,gBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACvB,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,GAI3B,EAAA,CAAA,CAAA;AAED,IA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CAAA,EAAW,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAC,cAAc,EAAa,CAAA,EACxF,IAAI,CAAC,iBAAiB,EAAE,EACxB,IAAI,CAAC,iBAAiB,EAAE,EACxB,IAAI,CAAC,eAAe,EAAE,EACtB,IAAI,CAAC,SAAS,IAAI,kEAAW,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,WAAW,EAAC,cAAc,EAAa,CAAA,CACvF,CACP,CACM,CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/sula-button/model/sula-button.model.ts","src/components/sula-button/sula-button.scss?tag=sula-button&encapsulation=shadow","src/components/sula-button/sula-button.tsx"],"sourcesContent":["export enum SulaButtonAppearance {\n Default = 'default',\n Secondary = 'secondary',\n Text = 'text',\n}\n\nexport enum SulaButtonSize {\n Large = 'large',\n Default = 'default',\n Cta = 'cta',\n}\n\nexport enum SulaButtonStatus {\n Primary = 'primary',\n Danger = 'danger',\n Negative = 'negative',\n}\n\nexport enum SulaButtonType {\n Icon = 'icon',\n Text = 'text',\n}\n",":host {\n display: block;\n}\n\nbutton {\n &:focus {\n outline: 2px solid var(--color-feedback-informational) !important;\n outline-offset: 2px !important;\n }\n}\n","import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport { SulaButtonAppearance, SulaButtonSize, SulaButtonStatus, SulaButtonType } from './model/sula-button.model';\nimport { SulaLoaderSize } from '../sula-loader/model/sula-loader.model';\n\n@Component({\n tag: 'sula-button',\n styleUrl: 'sula-button.scss',\n shadow: true,\n})\nexport class SulaButton {\n /**\n * Button text when is text type\n */\n @Prop({ mutable: true }) text: string;\n\n /**\n * Button icon when is Icon type\n */\n @Prop({ mutable: true }) icon: string;\n\n /**\n * Button left icon\n */\n @Prop({ mutable: true }) leftIcon: string;\n\n /**\n * Button right icon\n */\n @Prop({ mutable: true }) rightIcon: string;\n\n /**\n * Button appearance\n */\n @Prop({ mutable: true }) appearance: SulaButtonAppearance = SulaButtonAppearance.Default;\n\n /**\n * Button type\n */\n @Prop({ mutable: true }) type: SulaButtonType = SulaButtonType.Text;\n\n /**\n * Button size\n */\n @Prop({ mutable: true }) size: SulaButtonSize = SulaButtonSize.Default;\n\n /**\n * Button status\n */\n @Prop({ mutable: true }) status: SulaButtonStatus = SulaButtonStatus.Primary;\n\n /**\n * Is button loading\n */\n @Prop({ mutable: true }) loading: boolean = false;\n\n /**\n * Is button disabled\n */\n @Prop({ mutable: true }) buttonDisabled: boolean = false;\n\n /**\n * If true, button will take the full width of its container\n */\n @Prop({ mutable: true, attribute: 'full-width' }) fullWidth: boolean = false;\n\n /**\n * Event emitted when button is clicked.\n * @note If button is disabled event won't be emitted\n */\n @Event()\n buttonClicked: EventEmitter<void>;\n\n private getAppearanceClass() {\n if (this.loading) return;\n const appearanceStyles = {\n [SulaButtonAppearance.Default]: this.getDefaultButtonStyles(),\n [SulaButtonAppearance.Secondary]: `border ${this.getSecondaryButtonStyles()}`,\n [SulaButtonAppearance.Text]: `flex items-center space-x-8 ${this.getTextButtonStyles()}`,\n };\n\n return appearanceStyles[this.appearance];\n }\n\n private getButtonDisabledClass() {\n return this.appearance === SulaButtonAppearance.Text ? 'text-text-disabled' : 'bg-states-bg-disabled text-text-disabled border-none';\n }\n\n private getDefaultButtonStyles() {\n if (this.buttonDisabled) {\n return this.getButtonDisabledClass();\n }\n\n const statusStyles = {\n [SulaButtonStatus.Primary]: 'bg-brand-primary text-white hover:bg-states-primary-hover active:bg-states-primary-pressed',\n [SulaButtonStatus.Danger]: 'bg-feedback-error text-white hover:bg-states-danger-hover active:bg-opacity-85 active:bg-states-danger-pressed',\n [SulaButtonStatus.Negative]: 'bg-negative-negative-1 text-negative-negative-2 hover:bg-states-negative-hover active:bg-states-negative-pressed',\n };\n\n return statusStyles[this.status];\n }\n\n private getSecondaryButtonStyles() {\n if (this.buttonDisabled) {\n return this.getButtonDisabledClass();\n }\n\n const statusStyles = {\n [SulaButtonStatus.Primary]: 'border-brand-primary text-brand-primary hover:bg-states-empty-bg-hover bg-white active:bg-states-empty-bg-pressed',\n [SulaButtonStatus.Danger]: 'border-feedback-error text-feedback-error hover:bg-states-empty-bg-hover bg-white active:bg-states-empty-bg-pressed',\n [SulaButtonStatus.Negative]: 'border-negative-negative-1 text-negative-negative-1 bg-transparent hover:bg-states-empty-bg-hover active:bg-states-empty-bg-pressed',\n };\n\n return statusStyles[this.status];\n }\n\n private getTextButtonStyles() {\n if (this.buttonDisabled) {\n return this.getButtonDisabledClass();\n }\n\n const statusStyles = {\n [SulaButtonStatus.Primary]: 'text-brand-primary',\n [SulaButtonStatus.Danger]: 'text-feedback-error',\n [SulaButtonStatus.Negative]: 'text-negative-negative-1',\n };\n\n return statusStyles[this.status];\n }\n\n private getTextTypeSizeClass() {\n const sizeClasses = {\n [SulaButtonSize.Default]: 'py-4 h-[40px]',\n [SulaButtonSize.Large]: 'py-4 h-[56px]',\n };\n\n return sizeClasses[this.size];\n }\n\n private getButtonSizeByTypeClass() {\n if (this.loading) {\n if (this.type === SulaButtonType.Icon) {\n return {\n 'w-[40px] h-[40px] p-8': this.size === SulaButtonSize.Default,\n 'w-[56px] h-[56px] p-16': this.size === SulaButtonSize.Large,\n };\n }\n\n return {\n 'w-[56px] h-[44px]': this.size === SulaButtonSize.Default,\n 'w-[64px] h-[56px]': this.size === SulaButtonSize.Large,\n };\n }\n if (this.type === SulaButtonType.Text) {\n return this.appearance === SulaButtonAppearance.Text\n ? { [this.getTextTypeSizeClass()]: true }\n : {\n ['px-16 py-4 min-w-[120px] h-[40px]']: this.size === SulaButtonSize.Default,\n ['px-16 py-4 min-w-[120px] h-[56px]']: this.size === SulaButtonSize.Large,\n };\n }\n\n return {\n 'flex justify-center items-center': true,\n ['p-8 h-[40px] min-w-[40px]']: this.size === SulaButtonSize.Default,\n ['p-16 py-4 min-w-[56px] h-[56px]']: this.size === SulaButtonSize.Large,\n };\n }\n\n private getArrowIconContainerClass() {\n return {\n 'flex items-center justify-center w-24 h-24 rounded-xxl': true,\n 'group-hover:bg-states-empty-bg-hover': !this.buttonDisabled && this.type === SulaButtonType.Text,\n 'text-icon-primary': !this.buttonDisabled,\n 'text-icon-disabled': this.buttonDisabled,\n };\n }\n\n private getBaseButtonClass() {\n return {\n [this.getAppearanceClass()]: true,\n ...this.getButtonSizeByTypeClass(),\n 'rounded-xxl': this.appearance !== SulaButtonAppearance.Text,\n 'rounded-xs focus:bg-states-empty-bg-hover': this.appearance === SulaButtonAppearance.Text,\n 'font-bold text-base group': true,\n 'disabled': this.buttonDisabled,\n 'bg-states-empty-bg-pressed flex justify-center items-center': this.loading,\n 'w-full': this.fullWidth,\n };\n }\n\n private renderIconContent() {\n if (this.type === SulaButtonType.Icon) {\n return <sula-icon id=\"button-icon\" icon={this.icon} customClass=\"text-2xl\" class=\"flex leading-6\"></sula-icon>;\n }\n return null;\n }\n\n private renderTextContent() {\n if (this.text && this.type === SulaButtonType.Text) {\n return <div id=\"button-text\">{this.text}</div>;\n }\n return null;\n }\n\n private renderArrowIcon() {\n if (this.appearance === SulaButtonAppearance.Text) {\n return (\n <div class={this.getArrowIconContainerClass()}>\n <sula-icon icon=\"ph-bold ph-caret-right\" customClass=\"text-lg\"></sula-icon>\n </div>\n );\n }\n return null;\n }\n\n getLoadingSize() {\n if (this.type === SulaButtonType.Icon || this.size === SulaButtonSize.Default) {\n return SulaLoaderSize.Small;\n }\n\n return SulaLoaderSize.Medium;\n }\n\n handleClick = () => {\n if (!this.buttonDisabled && !this.loading) {\n this.buttonClicked.emit();\n }\n };\n\n render() {\n return (\n <Host>\n <button id=\"button-container\" class={this.getBaseButtonClass()} disabled={this.buttonDisabled || this.loading} onClick={this.handleClick}>\n {this.loading && (\n <div>\n <sula-loader size={this.getLoadingSize()}></sula-loader>\n </div>\n )}\n {!this.loading && (\n <div class=\"flex w-full justify-center items-center\">\n {this.leftIcon && <sula-icon icon={this.leftIcon} customClass=\"text-lg mr-8\"></sula-icon>}\n {this.renderIconContent()}\n {this.renderTextContent()}\n {this.renderArrowIcon()}\n {this.rightIcon && <sula-icon icon={this.rightIcon} customClass=\"text-lg ml-8\"></sula-icon>}\n </div>\n )}\n </button>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-BznR9x_k.js","mappings":";;;;IAAY;AAAZ,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,oBAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,oBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,GAI/B,EAAA,CAAA,CAAA;AAED,IAAY,cAIX;AAJD,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,cAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,cAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACb,CAAC,EAJW,cAAc,KAAd,cAAc,GAIzB,EAAA,CAAA,CAAA;AAED,IAAY,gBAIX;AAJD,CAAA,UAAY,gBAAgB,EAAA;AAC1B,IAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,gBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,gBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACvB,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,GAI3B,EAAA,CAAA,CAAA;AAED,IAAY,cAGX;AAHD,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,cAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EAHW,cAAc,KAAd,cAAc,GAGzB,EAAA,CAAA,CAAA;;ACrBD,MAAM,aAAa,GAAG,kzhBA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I,CAAC,SAAS,EAAE,WAAW,EAAC,cAAc,EAAa,CAAA,CACvF,CACP,CACM,CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/sula-button/model/sula-button.model.ts","src/components/sula-button/sula-button.scss?tag=sula-button&encapsulation=shadow","src/components/sula-button/sula-button.tsx"],"sourcesContent":["export enum SulaButtonAppearance {\n Default = 'default',\n Secondary = 'secondary',\n Text = 'text',\n}\n\nexport enum SulaButtonSize {\n Large = 'large',\n Default = 'default',\n Cta = 'cta',\n}\n\nexport enum SulaButtonStatus {\n Primary = 'primary',\n Danger = 'danger',\n Negative = 'negative',\n}\n\nexport enum SulaButtonType {\n Icon = 'icon',\n Text = 'text',\n}\n",":host {\n display: block;\n}\n\nbutton {\n &:focus {\n outline: 2px solid var(--color-feedback-informational) !important;\n outline-offset: 2px !important;\n }\n}\n","import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport { SulaButtonAppearance, SulaButtonSize, SulaButtonStatus, SulaButtonType } from './model/sula-button.model';\nimport { SulaLoaderSize } from '../sula-loader/model/sula-loader.model';\n\n@Component({\n tag: 'sula-button',\n styleUrl: 'sula-button.scss',\n shadow: true,\n})\nexport class SulaButton {\n /**\n * Button text when is text type\n */\n @Prop({ mutable: true }) text: string;\n\n /**\n * Button icon when is Icon type\n */\n @Prop({ mutable: true }) icon: string;\n\n /**\n * Button left icon\n */\n @Prop({ mutable: true }) leftIcon: string;\n\n /**\n * Button right icon\n */\n @Prop({ mutable: true }) rightIcon: string;\n\n /**\n * Button appearance\n */\n @Prop({ mutable: true }) appearance: SulaButtonAppearance = SulaButtonAppearance.Default;\n\n /**\n * Button type\n */\n @Prop({ mutable: true }) type: SulaButtonType = SulaButtonType.Text;\n\n /**\n * Button size\n */\n @Prop({ mutable: true }) size: SulaButtonSize = SulaButtonSize.Default;\n\n /**\n * Button status\n */\n @Prop({ mutable: true }) status: SulaButtonStatus = SulaButtonStatus.Primary;\n\n /**\n * Is button loading\n */\n @Prop({ mutable: true }) loading: boolean = false;\n\n /**\n * Is button disabled\n */\n @Prop({ mutable: true }) buttonDisabled: boolean = false;\n\n /**\n * If true, button will take the full width of its container\n */\n @Prop({ mutable: true, attribute: 'full-width' }) fullWidth: boolean = false;\n\n /**\n * Event emitted when button is clicked.\n * @note If button is disabled event won't be emitted\n */\n @Event()\n buttonClicked: EventEmitter<void>;\n\n private getAppearanceClass() {\n if (this.loading) return;\n const appearanceStyles = {\n [SulaButtonAppearance.Default]: this.getDefaultButtonStyles(),\n [SulaButtonAppearance.Secondary]: `border ${this.getSecondaryButtonStyles()}`,\n [SulaButtonAppearance.Text]: `flex items-center space-x-8 ${this.getTextButtonStyles()}`,\n };\n\n return appearanceStyles[this.appearance];\n }\n\n private getButtonDisabledClass() {\n return this.appearance === SulaButtonAppearance.Text ? 'text-text-disabled' : 'bg-states-bg-disabled text-text-disabled border-none';\n }\n\n private getDefaultButtonStyles() {\n if (this.buttonDisabled) {\n return this.getButtonDisabledClass();\n }\n\n const statusStyles = {\n [SulaButtonStatus.Primary]: 'bg-brand-primary text-white hover:bg-states-primary-hover active:bg-states-primary-pressed',\n [SulaButtonStatus.Danger]: 'bg-feedback-error text-white hover:bg-states-danger-hover active:bg-opacity-85 active:bg-states-danger-pressed',\n [SulaButtonStatus.Negative]: 'bg-negative-negative-1 text-negative-negative-2 hover:bg-states-negative-hover active:bg-states-negative-pressed',\n };\n\n return statusStyles[this.status];\n }\n\n private getSecondaryButtonStyles() {\n if (this.buttonDisabled) {\n return this.getButtonDisabledClass();\n }\n\n const statusStyles = {\n [SulaButtonStatus.Primary]: 'border-brand-primary text-brand-primary hover:bg-states-empty-bg-hover bg-white active:bg-states-empty-bg-pressed',\n [SulaButtonStatus.Danger]: 'border-feedback-error text-feedback-error hover:bg-states-empty-bg-hover bg-white active:bg-states-empty-bg-pressed',\n [SulaButtonStatus.Negative]: 'border-negative-negative-1 text-negative-negative-1 bg-transparent hover:bg-states-empty-bg-hover active:bg-states-empty-bg-pressed',\n };\n\n return statusStyles[this.status];\n }\n\n private getTextButtonStyles() {\n if (this.buttonDisabled) {\n return this.getButtonDisabledClass();\n }\n\n const statusStyles = {\n [SulaButtonStatus.Primary]: 'text-brand-primary',\n [SulaButtonStatus.Danger]: 'text-feedback-error',\n [SulaButtonStatus.Negative]: 'text-negative-negative-1',\n };\n\n return statusStyles[this.status];\n }\n\n private getTextTypeSizeClass() {\n const sizeClasses = {\n [SulaButtonSize.Default]: 'py-4 h-[40px]',\n [SulaButtonSize.Large]: 'py-4 h-[56px]',\n };\n\n return sizeClasses[this.size];\n }\n\n private getButtonSizeByTypeClass() {\n if (this.loading) {\n if (this.type === SulaButtonType.Icon) {\n return {\n 'w-[40px] h-[40px] p-8': this.size === SulaButtonSize.Default,\n 'w-[56px] h-[56px] p-16': this.size === SulaButtonSize.Large,\n };\n }\n\n return {\n 'w-[56px] h-[44px]': this.size === SulaButtonSize.Default,\n 'w-[64px] h-[56px]': this.size === SulaButtonSize.Large,\n };\n }\n if (this.type === SulaButtonType.Text) {\n return this.appearance === SulaButtonAppearance.Text\n ? { [this.getTextTypeSizeClass()]: true }\n : {\n ['px-16 py-4 min-w-[120px] h-[40px]']: this.size === SulaButtonSize.Default,\n ['px-16 py-4 min-w-[120px] h-[56px]']: this.size === SulaButtonSize.Large,\n };\n }\n\n return {\n 'flex justify-center items-center': true,\n ['p-8 h-[40px] min-w-[40px]']: this.size === SulaButtonSize.Default,\n ['p-16 py-4 min-w-[56px] h-[56px]']: this.size === SulaButtonSize.Large,\n };\n }\n\n private getArrowIconContainerClass() {\n return {\n 'flex items-center justify-center w-24 h-24 rounded-xxl': true,\n 'group-hover:bg-states-empty-bg-hover': !this.buttonDisabled && this.type === SulaButtonType.Text,\n 'text-icon-primary': !this.buttonDisabled,\n 'text-icon-disabled': this.buttonDisabled,\n };\n }\n\n private getBaseButtonClass() {\n return {\n [this.getAppearanceClass()]: true,\n ...this.getButtonSizeByTypeClass(),\n 'rounded-xxl': this.appearance !== SulaButtonAppearance.Text,\n 'rounded-xs focus:bg-states-empty-bg-hover': this.appearance === SulaButtonAppearance.Text,\n 'font-bold text-base group': true,\n 'disabled': this.buttonDisabled,\n 'bg-states-empty-bg-pressed flex justify-center items-center': this.loading,\n 'w-full': this.fullWidth,\n };\n }\n\n private renderIconContent() {\n if (this.type === SulaButtonType.Icon) {\n return <sula-icon id=\"button-icon\" icon={this.icon} customClass=\"text-2xl\" class=\"flex leading-6\"></sula-icon>;\n }\n return null;\n }\n\n private renderTextContent() {\n if (this.text && this.type === SulaButtonType.Text) {\n return <div id=\"button-text\">{this.text}</div>;\n }\n return null;\n }\n\n private renderArrowIcon() {\n if (this.appearance === SulaButtonAppearance.Text) {\n return (\n <div class={this.getArrowIconContainerClass()}>\n <sula-icon icon=\"ph-bold ph-caret-right\" customClass=\"text-lg\"></sula-icon>\n </div>\n );\n }\n return null;\n }\n\n getLoadingSize() {\n if (this.type === SulaButtonType.Icon || this.size === SulaButtonSize.Default) {\n return SulaLoaderSize.Small;\n }\n\n return SulaLoaderSize.Medium;\n }\n\n handleClick = () => {\n if (!this.buttonDisabled && !this.loading) {\n this.buttonClicked.emit();\n }\n };\n\n render() {\n return (\n <Host>\n <button id=\"button-container\" class={this.getBaseButtonClass()} disabled={this.buttonDisabled || this.loading} onClick={this.handleClick}>\n {this.loading && (\n <div>\n <sula-loader size={this.getLoadingSize()}></sula-loader>\n </div>\n )}\n {!this.loading && (\n <div class=\"flex w-full justify-center items-center\">\n {this.leftIcon && <sula-icon icon={this.leftIcon} customClass=\"text-lg mr-8\"></sula-icon>}\n {this.renderIconContent()}\n {this.renderTextContent()}\n {this.renderArrowIcon()}\n {this.rightIcon && <sula-icon icon={this.rightIcon} customClass=\"text-lg ml-8\"></sula-icon>}\n </div>\n )}\n </button>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
-
import { d as defineCustomElement$2 } from './p-
|
|
2
|
+
import { d as defineCustomElement$2 } from './p-BESq0oqe.js';
|
|
3
3
|
|
|
4
4
|
var SulaAvatarSize;
|
|
5
5
|
(function (SulaAvatarSize) {
|
|
@@ -9,7 +9,7 @@ var SulaAvatarSize;
|
|
|
9
9
|
SulaAvatarSize["Display"] = "display";
|
|
10
10
|
})(SulaAvatarSize || (SulaAvatarSize = {}));
|
|
11
11
|
|
|
12
|
-
const sulaAvatarCss = "*,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{display:block}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#012b15;--color-red-50:#fef6f6;--color-red-100:#fde8e8;--color-red-200:#fad1d1;--color-red-300:#f7abab;--color-red-400:#f17474;--color-red-500:#c80505;--color-red-600:#b30404;--color-red-700:#9f0404;--color-red-800:#860303;--color-red-900:#6d0303;--color-red-950:#330d00;--color-yellow-50:#fdf4e7;--color-yellow-100:#fcedd9;--color-yellow-200:#fae0bd;--color-yellow-300:#f6c788;--color-yellow-400:#f3b159;--color-yellow-500:#ef9928;--color-yellow-600:#e49226;--color-yellow-700:#d17e10;--color-yellow-800:#b46d0e;--color-yellow-900:#93590b;--color-yellow-950:#402705;--color-orange-50:#fef4f1;--color-orange-100:#fde8e2;--color-orange-200:#fbd2c6;--color-orange-300:#f8b4a0;--color-orange-400:#f58e70;--color-orange-500:#f05223;--color-orange-600:#ea4210;--color-orange-700:#d23b0e;--color-orange-800:#b5330c;--color-orange-900:#942a0a;--color-orange-950:#401204;--color-blue-50:#ecf0f9;--color-blue-100:#dde3f4;--color-blue-200:#b2c2e5;--color-blue-300:#7994d2;--color-blue-400:#4066bf;--color-blue-500:#001e64;--color-blue-600:#001c5c;--color-blue-700:#00174c;--color-blue-800:#00123d;--color-blue-900:#000f33;--color-blue-950:#000d2b;--color-ambar-50:#fff6eb;--color-ambar-100:#ffefdc;--color-ambar-200:#fedfb9;--color-ambar-300:#fdca8b;--color-ambar-400:#fdb359;--color-ambar-500:#fc9c26;--color-ambar-600:#ec8403;--color-ambar-700:#d87803;--color-ambar-800:#ba6803;--color-ambar-900:#975402;--color-ambar-950:#402301;--color-gray-50:#fff;--color-gray-100:#f3f4f4;--color-gray-200:#e5e6e6;--color-gray-300:#bfc0c0;--color-gray-400:#acaeae;--color-gray-500:#949595;--color-gray-600:#737575;--color-gray-700:#6c6e6e;--color-gray-800:#313333;--color-gray-900:#272929;--color-gray-950:#191d1d;--color-white-opacity-50:#ffffff0d;--color-white-opacity-100:#ffffff1a;--color-white-opacity-200:#ffffff26;--color-white-opacity-300:#ffffff45;--color-white-opacity-400:#ffffff5c;--color-white-opacity-500:#ffffff80;--color-white-opacity-600:#ffffff8c;--color-white-opacity-700:#ffffffa3;--color-white-opacity-800:#ffffffba;--color-white-opacity-900:#fffc;--color-white-opacity-950:#ffffffe8;--color-ciano-50:#f1f6fe;--color-ciano-100:#dfeafc;--color-ciano-200:#c3d9f9;--color-ciano-300:#90b9f4;--color-ciano-400:#5d98ee;--color-ciano-500:#1769e0;--color-ciano-600:#155fcb;--color-ciano-700:#1355b4;--color-ciano-800:#104899;--color-ciano-900:#0d3b7d;--color-ciano-950:#071e40;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:rgba(25,29,29,.02);--color-black-opacity-100:rgba(25,29,29,.05);--color-black-opacity-200:rgba(25,29,29,.11);--color-black-opacity-300:rgba(25,29,29,.28);--color-black-opacity-400:rgba(25,29,29,.36);--color-black-opacity-500:rgba(25,29,29,.44);--color-black-opacity-600:rgba(25,29,29,.62);--color-black-opacity-700:rgba(25,29,29,.64);--color-black-opacity-800:rgba(25,29,29,.72);--color-black-opacity-900:rgba(25,29,29,.8);--color-black-opacity-950:rgba(25,29,29,.96);--color-shadow-opacity-50:rgba(0,0,0,.04);--color-shadow-opacity-100:rgba(0,0,0,.06);--color-shadow-opacity-200:rgba(0,0,0,.12);--color-shadow-opacity-300:rgba(0,0,0,.2);--color-shadow-opacity-400:rgba(0,0,0,.32);--color-shadow-opacity-500:rgba(0,0,0,.5);--color-shadow-opacity-600:rgba(0,0,0,.55);--color-shadow-opacity-700:rgba(0,0,0,.64);--color-shadow-opacity-800:rgba(0,0,0,.73);--color-shadow-opacity-900:rgba(0,0,0,.8);--color-shadow-opacity-950:rgba(0,0,0,.91);--color-feedback-success:#04843f;--color-feedback-error:#c80505;--color-feedback-informational:#1355b4;--color-feedback-alert:#ef9928;--color-brand-primary:#f05223;--color-brand-secondary:#001c5c;--color-brand-tertiary-1:#1769e0;--color-brand-tertiary-2:#fc9c26;--color-surface-body:#fff;--color-surface-on-body:#f3f4f4;--color-surface-on-body-blue:#e7f0f4;--color-surface-on-body-brand:#fff6eb;--color-surface-on-body-feedback-success:#e6f4ed;--color-surface-on-body-feedback-error:#fde8e8;--color-surface-on-body-feedback-alert:#fdf4e7;--color-surface-on-body-feedback-info:#dfeafc;--color-text-brand:#f05223;--color-text-primary:#313333;--color-text-secondary:#6c6e6e;--color-text-disabled:#949595;--color-text-link:#1355b4;--color-states-empty-bg-hover:rgba(25,29,29,.05);--color-states-empty-bg-pressed:rgba(25,29,29,.11);--color-states-bg-disabled:rgba(25,29,29,.02);--color-states-bg-focus:#1355b4;--color-states-primary-hover:#ea4210;--color-states-primary-pressed:#d23b0e;--color-states-danger-hover:#b30404;--color-states-danger-pressed:#9f0404;--color-states-negative-hover:#e5e6e6;--color-states-negative-pressed:#bfc0c0;--color-icon-primary:#6c6e6e;--color-icon-secondary:#fff;--color-icon-tertiary:#b30404;--color-icon-disabled:#acaeae;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f3f4f4;--color-neutral-neutral-3:#acaeae;--color-neutral-neutral-4:#949595;--color-neutral-neutral-5:#737575;--color-neutral-neutral-6:#6c6e6e;--color-neutral-neutral-7:#313333;--color-neutral-neutral-8:#272929;--color-negative-negative-1:#fff;--color-negative-negative-2:#313333;--color-opacity-body:#fffc;--color-opacity-on-body:rgba(25,29,29,.02);--color-opacity-overlay:rgba(25,29,29,.62);--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949595;--color-line-general-strong:#bfc0c0;--color-line-general:#e5e6e6;--color-line-hair:rgba(25,29,29,.05);--color-box-shadow-body:#fff;--color-box-shadow-shadow-color-1:rgba(0,0,0,.04);--color-box-shadow-shadow-color-2:rgba(0,0,0,.06)}.
|
|
12
|
+
const sulaAvatarCss = "*,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{display:block}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#012b15;--color-red-50:#fef6f6;--color-red-100:#fde8e8;--color-red-200:#fad1d1;--color-red-300:#f7abab;--color-red-400:#f17474;--color-red-500:#c80505;--color-red-600:#b30404;--color-red-700:#9f0404;--color-red-800:#860303;--color-red-900:#6d0303;--color-red-950:#330d00;--color-yellow-50:#fdf4e7;--color-yellow-100:#fcedd9;--color-yellow-200:#fae0bd;--color-yellow-300:#f6c788;--color-yellow-400:#f3b159;--color-yellow-500:#ef9928;--color-yellow-600:#e49226;--color-yellow-700:#d17e10;--color-yellow-800:#b46d0e;--color-yellow-900:#93590b;--color-yellow-950:#402705;--color-orange-50:#fef4f1;--color-orange-100:#fde8e2;--color-orange-200:#fbd2c6;--color-orange-300:#f8b4a0;--color-orange-400:#f58e70;--color-orange-500:#f05223;--color-orange-600:#ea4210;--color-orange-700:#d23b0e;--color-orange-800:#b5330c;--color-orange-900:#942a0a;--color-orange-950:#401204;--color-blue-50:#ecf0f9;--color-blue-100:#dde3f4;--color-blue-200:#b2c2e5;--color-blue-300:#7994d2;--color-blue-400:#4066bf;--color-blue-500:#001e64;--color-blue-600:#001c5c;--color-blue-700:#00174c;--color-blue-800:#00123d;--color-blue-900:#000f33;--color-blue-950:#000d2b;--color-ambar-50:#fff6eb;--color-ambar-100:#ffefdc;--color-ambar-200:#fedfb9;--color-ambar-300:#fdca8b;--color-ambar-400:#fdb359;--color-ambar-500:#fc9c26;--color-ambar-600:#ec8403;--color-ambar-700:#d87803;--color-ambar-800:#ba6803;--color-ambar-900:#975402;--color-ambar-950:#402301;--color-gray-50:#fff;--color-gray-100:#f3f4f4;--color-gray-200:#e5e6e6;--color-gray-300:#bfc0c0;--color-gray-400:#acaeae;--color-gray-500:#949595;--color-gray-600:#737575;--color-gray-700:#6c6e6e;--color-gray-800:#313333;--color-gray-900:#272929;--color-gray-950:#191d1d;--color-white-opacity-50:#ffffff0d;--color-white-opacity-100:#ffffff1a;--color-white-opacity-200:#ffffff26;--color-white-opacity-300:#ffffff45;--color-white-opacity-400:#ffffff5c;--color-white-opacity-500:#ffffff80;--color-white-opacity-600:#ffffff8c;--color-white-opacity-700:#ffffffa3;--color-white-opacity-800:#ffffffba;--color-white-opacity-900:#fffc;--color-white-opacity-950:#ffffffe8;--color-ciano-50:#f1f6fe;--color-ciano-100:#dfeafc;--color-ciano-200:#c3d9f9;--color-ciano-300:#90b9f4;--color-ciano-400:#5d98ee;--color-ciano-500:#1769e0;--color-ciano-600:#155fcb;--color-ciano-700:#1355b4;--color-ciano-800:#104899;--color-ciano-900:#0d3b7d;--color-ciano-950:#071e40;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:rgba(25,29,29,.02);--color-black-opacity-100:rgba(25,29,29,.05);--color-black-opacity-200:rgba(25,29,29,.11);--color-black-opacity-300:rgba(25,29,29,.28);--color-black-opacity-400:rgba(25,29,29,.36);--color-black-opacity-500:rgba(25,29,29,.44);--color-black-opacity-600:rgba(25,29,29,.62);--color-black-opacity-700:rgba(25,29,29,.64);--color-black-opacity-800:rgba(25,29,29,.72);--color-black-opacity-900:rgba(25,29,29,.8);--color-black-opacity-950:rgba(25,29,29,.96);--color-shadow-opacity-50:rgba(0,0,0,.04);--color-shadow-opacity-100:rgba(0,0,0,.06);--color-shadow-opacity-200:rgba(0,0,0,.12);--color-shadow-opacity-300:rgba(0,0,0,.2);--color-shadow-opacity-400:rgba(0,0,0,.32);--color-shadow-opacity-500:rgba(0,0,0,.5);--color-shadow-opacity-600:rgba(0,0,0,.55);--color-shadow-opacity-700:rgba(0,0,0,.64);--color-shadow-opacity-800:rgba(0,0,0,.73);--color-shadow-opacity-900:rgba(0,0,0,.8);--color-shadow-opacity-950:rgba(0,0,0,.91);--color-feedback-success:#04843f;--color-feedback-error:#c80505;--color-feedback-informational:#1355b4;--color-feedback-alert:#ef9928;--color-brand-primary:#f05223;--color-brand-secondary:#001c5c;--color-brand-tertiary-1:#1769e0;--color-brand-tertiary-2:#fc9c26;--color-surface-body:#fff;--color-surface-on-body:#f3f4f4;--color-surface-on-body-blue:#e7f0f4;--color-surface-on-body-brand:#fff6eb;--color-surface-on-body-feedback-success:#e6f4ed;--color-surface-on-body-feedback-error:#fde8e8;--color-surface-on-body-feedback-alert:#fdf4e7;--color-surface-on-body-feedback-info:#dfeafc;--color-text-brand:#f05223;--color-text-primary:#313333;--color-text-secondary:#6c6e6e;--color-text-disabled:#949595;--color-text-link:#1355b4;--color-states-empty-bg-hover:rgba(25,29,29,.05);--color-states-empty-bg-pressed:rgba(25,29,29,.11);--color-states-bg-disabled:rgba(25,29,29,.02);--color-states-bg-focus:#1355b4;--color-states-primary-hover:#ea4210;--color-states-primary-pressed:#d23b0e;--color-states-danger-hover:#b30404;--color-states-danger-pressed:#9f0404;--color-states-negative-hover:#e5e6e6;--color-states-negative-pressed:#bfc0c0;--color-icon-primary:#6c6e6e;--color-icon-secondary:#fff;--color-icon-tertiary:#b30404;--color-icon-disabled:#acaeae;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f3f4f4;--color-neutral-neutral-3:#acaeae;--color-neutral-neutral-4:#949595;--color-neutral-neutral-5:#737575;--color-neutral-neutral-6:#6c6e6e;--color-neutral-neutral-7:#313333;--color-neutral-neutral-8:#272929;--color-negative-negative-1:#fff;--color-negative-negative-2:#313333;--color-opacity-body:#fffc;--color-opacity-on-body:rgba(25,29,29,.02);--color-opacity-overlay:rgba(25,29,29,.62);--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949595;--color-line-general-strong:#bfc0c0;--color-line-general:#e5e6e6;--color-line-hair:rgba(25,29,29,.05);--color-box-shadow-body:#fff;--color-box-shadow-shadow-color-1:rgba(0,0,0,.04);--color-box-shadow-shadow-color-2:rgba(0,0,0,.06)}.flex{display:flex}.h-\\[240px\\]{height:240px}.h-\\[44px\\]{height:44px}.h-\\[56px\\]{height:56px}.h-\\[96px\\]{height:96px}.w-\\[240px\\]{width:240px}.w-\\[44px\\]{width:44px}.w-\\[56px\\]{width:56px}.w-\\[96px\\]{width:96px}.items-center{align-items:center}.justify-center{justify-content:center}.rounded-full{border-radius:9999px}.rounded-xxl{border-radius:18.75rem}.bg-surface-on-body{background-color:var(--color-surface-on-body)}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-5xl{font-size:3rem;line-height:1}.font-bold{font-weight:700}.text-text-primary{color:var(--color-text-primary)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.static{position:static}";
|
|
13
13
|
|
|
14
14
|
const SulaAvatar$1 = /*@__PURE__*/ proxyCustomElement(class SulaAvatar extends H {
|
|
15
15
|
constructor() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
-
import { d as defineCustomElement$2 } from './p-
|
|
2
|
+
import { d as defineCustomElement$2 } from './p-BESq0oqe.js';
|
|
3
3
|
|
|
4
4
|
const sulaBreadcrumbCss = "*,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{display:block}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#012b15;--color-red-50:#fef6f6;--color-red-100:#fde8e8;--color-red-200:#fad1d1;--color-red-300:#f7abab;--color-red-400:#f17474;--color-red-500:#c80505;--color-red-600:#b30404;--color-red-700:#9f0404;--color-red-800:#860303;--color-red-900:#6d0303;--color-red-950:#330d00;--color-yellow-50:#fdf4e7;--color-yellow-100:#fcedd9;--color-yellow-200:#fae0bd;--color-yellow-300:#f6c788;--color-yellow-400:#f3b159;--color-yellow-500:#ef9928;--color-yellow-600:#e49226;--color-yellow-700:#d17e10;--color-yellow-800:#b46d0e;--color-yellow-900:#93590b;--color-yellow-950:#402705;--color-orange-50:#fef4f1;--color-orange-100:#fde8e2;--color-orange-200:#fbd2c6;--color-orange-300:#f8b4a0;--color-orange-400:#f58e70;--color-orange-500:#f05223;--color-orange-600:#ea4210;--color-orange-700:#d23b0e;--color-orange-800:#b5330c;--color-orange-900:#942a0a;--color-orange-950:#401204;--color-blue-50:#ecf0f9;--color-blue-100:#dde3f4;--color-blue-200:#b2c2e5;--color-blue-300:#7994d2;--color-blue-400:#4066bf;--color-blue-500:#001e64;--color-blue-600:#001c5c;--color-blue-700:#00174c;--color-blue-800:#00123d;--color-blue-900:#000f33;--color-blue-950:#000d2b;--color-ambar-50:#fff6eb;--color-ambar-100:#ffefdc;--color-ambar-200:#fedfb9;--color-ambar-300:#fdca8b;--color-ambar-400:#fdb359;--color-ambar-500:#fc9c26;--color-ambar-600:#ec8403;--color-ambar-700:#d87803;--color-ambar-800:#ba6803;--color-ambar-900:#975402;--color-ambar-950:#402301;--color-gray-50:#fff;--color-gray-100:#f3f4f4;--color-gray-200:#e5e6e6;--color-gray-300:#bfc0c0;--color-gray-400:#acaeae;--color-gray-500:#949595;--color-gray-600:#737575;--color-gray-700:#6c6e6e;--color-gray-800:#313333;--color-gray-900:#272929;--color-gray-950:#191d1d;--color-white-opacity-50:#ffffff0d;--color-white-opacity-100:#ffffff1a;--color-white-opacity-200:#ffffff26;--color-white-opacity-300:#ffffff45;--color-white-opacity-400:#ffffff5c;--color-white-opacity-500:#ffffff80;--color-white-opacity-600:#ffffff8c;--color-white-opacity-700:#ffffffa3;--color-white-opacity-800:#ffffffba;--color-white-opacity-900:#fffc;--color-white-opacity-950:#ffffffe8;--color-ciano-50:#f1f6fe;--color-ciano-100:#dfeafc;--color-ciano-200:#c3d9f9;--color-ciano-300:#90b9f4;--color-ciano-400:#5d98ee;--color-ciano-500:#1769e0;--color-ciano-600:#155fcb;--color-ciano-700:#1355b4;--color-ciano-800:#104899;--color-ciano-900:#0d3b7d;--color-ciano-950:#071e40;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:rgba(25,29,29,.02);--color-black-opacity-100:rgba(25,29,29,.05);--color-black-opacity-200:rgba(25,29,29,.11);--color-black-opacity-300:rgba(25,29,29,.28);--color-black-opacity-400:rgba(25,29,29,.36);--color-black-opacity-500:rgba(25,29,29,.44);--color-black-opacity-600:rgba(25,29,29,.62);--color-black-opacity-700:rgba(25,29,29,.64);--color-black-opacity-800:rgba(25,29,29,.72);--color-black-opacity-900:rgba(25,29,29,.8);--color-black-opacity-950:rgba(25,29,29,.96);--color-shadow-opacity-50:rgba(0,0,0,.04);--color-shadow-opacity-100:rgba(0,0,0,.06);--color-shadow-opacity-200:rgba(0,0,0,.12);--color-shadow-opacity-300:rgba(0,0,0,.2);--color-shadow-opacity-400:rgba(0,0,0,.32);--color-shadow-opacity-500:rgba(0,0,0,.5);--color-shadow-opacity-600:rgba(0,0,0,.55);--color-shadow-opacity-700:rgba(0,0,0,.64);--color-shadow-opacity-800:rgba(0,0,0,.73);--color-shadow-opacity-900:rgba(0,0,0,.8);--color-shadow-opacity-950:rgba(0,0,0,.91);--color-feedback-success:#04843f;--color-feedback-error:#c80505;--color-feedback-informational:#1355b4;--color-feedback-alert:#ef9928;--color-brand-primary:#f05223;--color-brand-secondary:#001c5c;--color-brand-tertiary-1:#1769e0;--color-brand-tertiary-2:#fc9c26;--color-surface-body:#fff;--color-surface-on-body:#f3f4f4;--color-surface-on-body-blue:#e7f0f4;--color-surface-on-body-brand:#fff6eb;--color-surface-on-body-feedback-success:#e6f4ed;--color-surface-on-body-feedback-error:#fde8e8;--color-surface-on-body-feedback-alert:#fdf4e7;--color-surface-on-body-feedback-info:#dfeafc;--color-text-brand:#f05223;--color-text-primary:#313333;--color-text-secondary:#6c6e6e;--color-text-disabled:#949595;--color-text-link:#1355b4;--color-states-empty-bg-hover:rgba(25,29,29,.05);--color-states-empty-bg-pressed:rgba(25,29,29,.11);--color-states-bg-disabled:rgba(25,29,29,.02);--color-states-bg-focus:#1355b4;--color-states-primary-hover:#ea4210;--color-states-primary-pressed:#d23b0e;--color-states-danger-hover:#b30404;--color-states-danger-pressed:#9f0404;--color-states-negative-hover:#e5e6e6;--color-states-negative-pressed:#bfc0c0;--color-icon-primary:#6c6e6e;--color-icon-secondary:#fff;--color-icon-tertiary:#b30404;--color-icon-disabled:#acaeae;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f3f4f4;--color-neutral-neutral-3:#acaeae;--color-neutral-neutral-4:#949595;--color-neutral-neutral-5:#737575;--color-neutral-neutral-6:#6c6e6e;--color-neutral-neutral-7:#313333;--color-neutral-neutral-8:#272929;--color-negative-negative-1:#fff;--color-negative-negative-2:#313333;--color-opacity-body:#fffc;--color-opacity-on-body:rgba(25,29,29,.02);--color-opacity-overlay:rgba(25,29,29,.62);--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949595;--color-line-general-strong:#bfc0c0;--color-line-general:#e5e6e6;--color-line-hair:rgba(25,29,29,.05);--color-box-shadow-body:#fff;--color-box-shadow-shadow-color-1:rgba(0,0,0,.04);--color-box-shadow-shadow-color-2:rgba(0,0,0,.06)}.static{position:static}.flex{display:flex}.inline-flex{display:inline-flex}.h-\\[5\\.25px\\]{height:5.25px}.w-\\[9px\\]{width:9px}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.rounded{border-radius:.25rem}.px-12{padding-left:.75rem;padding-right:.75rem}.align-middle{vertical-align:middle}.text-paragraph-medium-bold{font-size:1rem;font-weight:700;letter-spacing:0;line-height:24px}.tracking-\\[-0\\.01em\\]{letter-spacing:-.01em}.text-brand-primary{color:var(--color-brand-primary)}.text-text-secondary{color:var(--color-text-secondary)}.no-underline{text-decoration-line:none}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.hover\\:text-text-primary:hover{color:var(--color-text-primary)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:decoration-solid:hover{text-decoration-style:solid}.hover\\:decoration-1:hover{text-decoration-thickness:1px}.focus\\:rounded:focus{border-radius:.25rem}.focus\\:outline:focus{outline-style:solid}.focus\\:outline-2:focus{outline-width:2px}.focus\\:outline-offset-2:focus{outline-offset:2px}.focus\\:outline-feedback-informational:focus{outline-color:var(--color-feedback-informational)}.active\\:text-text-secondary:active{color:var(--color-text-secondary)}.active\\:underline:active{text-decoration-line:underline}.active\\:decoration-solid:active{text-decoration-style:solid}.active\\:decoration-1:active{text-decoration-thickness:1px}";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
-
import { d as defineCustomElement$2 } from './p-
|
|
2
|
+
import { d as defineCustomElement$2 } from './p-BESq0oqe.js';
|
|
3
3
|
|
|
4
4
|
var SulaCheckboxType;
|
|
5
5
|
(function (SulaCheckboxType) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
-
import { d as defineCustomElement$3 } from './p-
|
|
2
|
+
import { d as defineCustomElement$3 } from './p-BESq0oqe.js';
|
|
3
3
|
import { d as defineCustomElement$2 } from './p-DksR9NcR.js';
|
|
4
4
|
|
|
5
5
|
var SulaChipAppearance;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
-
import { d as defineCustomElement$3 } from './p-
|
|
2
|
+
import { d as defineCustomElement$3 } from './p-BESq0oqe.js';
|
|
3
3
|
import { d as defineCustomElement$2 } from './p-DksR9NcR.js';
|
|
4
4
|
|
|
5
5
|
const sulaDropdownCss = "*,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}.outline{outline-style:solid}:host{display:block}.dropdown-focus{outline:2px solid var(--color-feedback-informational)!important;outline-offset:2px!important}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#012b15;--color-red-50:#fef6f6;--color-red-100:#fde8e8;--color-red-200:#fad1d1;--color-red-300:#f7abab;--color-red-400:#f17474;--color-red-500:#c80505;--color-red-600:#b30404;--color-red-700:#9f0404;--color-red-800:#860303;--color-red-900:#6d0303;--color-red-950:#330d00;--color-yellow-50:#fdf4e7;--color-yellow-100:#fcedd9;--color-yellow-200:#fae0bd;--color-yellow-300:#f6c788;--color-yellow-400:#f3b159;--color-yellow-500:#ef9928;--color-yellow-600:#e49226;--color-yellow-700:#d17e10;--color-yellow-800:#b46d0e;--color-yellow-900:#93590b;--color-yellow-950:#402705;--color-orange-50:#fef4f1;--color-orange-100:#fde8e2;--color-orange-200:#fbd2c6;--color-orange-300:#f8b4a0;--color-orange-400:#f58e70;--color-orange-500:#f05223;--color-orange-600:#ea4210;--color-orange-700:#d23b0e;--color-orange-800:#b5330c;--color-orange-900:#942a0a;--color-orange-950:#401204;--color-blue-50:#ecf0f9;--color-blue-100:#dde3f4;--color-blue-200:#b2c2e5;--color-blue-300:#7994d2;--color-blue-400:#4066bf;--color-blue-500:#001e64;--color-blue-600:#001c5c;--color-blue-700:#00174c;--color-blue-800:#00123d;--color-blue-900:#000f33;--color-blue-950:#000d2b;--color-ambar-50:#fff6eb;--color-ambar-100:#ffefdc;--color-ambar-200:#fedfb9;--color-ambar-300:#fdca8b;--color-ambar-400:#fdb359;--color-ambar-500:#fc9c26;--color-ambar-600:#ec8403;--color-ambar-700:#d87803;--color-ambar-800:#ba6803;--color-ambar-900:#975402;--color-ambar-950:#402301;--color-gray-50:#fff;--color-gray-100:#f3f4f4;--color-gray-200:#e5e6e6;--color-gray-300:#bfc0c0;--color-gray-400:#acaeae;--color-gray-500:#949595;--color-gray-600:#737575;--color-gray-700:#6c6e6e;--color-gray-800:#313333;--color-gray-900:#272929;--color-gray-950:#191d1d;--color-white-opacity-50:#ffffff0d;--color-white-opacity-100:#ffffff1a;--color-white-opacity-200:#ffffff26;--color-white-opacity-300:#ffffff45;--color-white-opacity-400:#ffffff5c;--color-white-opacity-500:#ffffff80;--color-white-opacity-600:#ffffff8c;--color-white-opacity-700:#ffffffa3;--color-white-opacity-800:#ffffffba;--color-white-opacity-900:#fffc;--color-white-opacity-950:#ffffffe8;--color-ciano-50:#f1f6fe;--color-ciano-100:#dfeafc;--color-ciano-200:#c3d9f9;--color-ciano-300:#90b9f4;--color-ciano-400:#5d98ee;--color-ciano-500:#1769e0;--color-ciano-600:#155fcb;--color-ciano-700:#1355b4;--color-ciano-800:#104899;--color-ciano-900:#0d3b7d;--color-ciano-950:#071e40;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:rgba(25,29,29,.02);--color-black-opacity-100:rgba(25,29,29,.05);--color-black-opacity-200:rgba(25,29,29,.11);--color-black-opacity-300:rgba(25,29,29,.28);--color-black-opacity-400:rgba(25,29,29,.36);--color-black-opacity-500:rgba(25,29,29,.44);--color-black-opacity-600:rgba(25,29,29,.62);--color-black-opacity-700:rgba(25,29,29,.64);--color-black-opacity-800:rgba(25,29,29,.72);--color-black-opacity-900:rgba(25,29,29,.8);--color-black-opacity-950:rgba(25,29,29,.96);--color-shadow-opacity-50:rgba(0,0,0,.04);--color-shadow-opacity-100:rgba(0,0,0,.06);--color-shadow-opacity-200:rgba(0,0,0,.12);--color-shadow-opacity-300:rgba(0,0,0,.2);--color-shadow-opacity-400:rgba(0,0,0,.32);--color-shadow-opacity-500:rgba(0,0,0,.5);--color-shadow-opacity-600:rgba(0,0,0,.55);--color-shadow-opacity-700:rgba(0,0,0,.64);--color-shadow-opacity-800:rgba(0,0,0,.73);--color-shadow-opacity-900:rgba(0,0,0,.8);--color-shadow-opacity-950:rgba(0,0,0,.91);--color-feedback-success:#04843f;--color-feedback-error:#c80505;--color-feedback-informational:#1355b4;--color-feedback-alert:#ef9928;--color-brand-primary:#f05223;--color-brand-secondary:#001c5c;--color-brand-tertiary-1:#1769e0;--color-brand-tertiary-2:#fc9c26;--color-surface-body:#fff;--color-surface-on-body:#f3f4f4;--color-surface-on-body-blue:#e7f0f4;--color-surface-on-body-brand:#fff6eb;--color-surface-on-body-feedback-success:#e6f4ed;--color-surface-on-body-feedback-error:#fde8e8;--color-surface-on-body-feedback-alert:#fdf4e7;--color-surface-on-body-feedback-info:#dfeafc;--color-text-brand:#f05223;--color-text-primary:#313333;--color-text-secondary:#6c6e6e;--color-text-disabled:#949595;--color-text-link:#1355b4;--color-states-empty-bg-hover:rgba(25,29,29,.05);--color-states-empty-bg-pressed:rgba(25,29,29,.11);--color-states-bg-disabled:rgba(25,29,29,.02);--color-states-bg-focus:#1355b4;--color-states-primary-hover:#ea4210;--color-states-primary-pressed:#d23b0e;--color-states-danger-hover:#b30404;--color-states-danger-pressed:#9f0404;--color-states-negative-hover:#e5e6e6;--color-states-negative-pressed:#bfc0c0;--color-icon-primary:#6c6e6e;--color-icon-secondary:#fff;--color-icon-tertiary:#b30404;--color-icon-disabled:#acaeae;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f3f4f4;--color-neutral-neutral-3:#acaeae;--color-neutral-neutral-4:#949595;--color-neutral-neutral-5:#737575;--color-neutral-neutral-6:#6c6e6e;--color-neutral-neutral-7:#313333;--color-neutral-neutral-8:#272929;--color-negative-negative-1:#fff;--color-negative-negative-2:#313333;--color-opacity-body:#fffc;--color-opacity-on-body:rgba(25,29,29,.02);--color-opacity-overlay:rgba(25,29,29,.62);--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949595;--color-line-general-strong:#bfc0c0;--color-line-general:#e5e6e6;--color-line-hair:rgba(25,29,29,.05);--color-box-shadow-body:#fff;--color-box-shadow-shadow-color-1:rgba(0,0,0,.04);--color-box-shadow-shadow-color-2:rgba(0,0,0,.06)}.static{position:static}.absolute{position:absolute}.relative{position:relative}.bottom-\\[72px\\]{bottom:72px}.left-0{left:0}.top-\\[72px\\]{top:72px}.z-50{z-index:50}.m-0{margin:0}.ml-8{margin-left:.5rem}.flex{display:flex}.h-\\[72px\\]{height:72px}.w-full{width:100%}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.overflow-auto{overflow:auto}.rounded-sm,.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-none{border-style:none}.border-line-general{border-color:var(--color-line-general)}.border-line-input{border-color:var(--color-line-input)}.bg-states-bg-disabled{background-color:var(--color-states-bg-disabled)}.bg-surface-body{background-color:var(--color-surface-body)}.bg-transparent{background-color:transparent}.p-0{padding:0}.px-16{padding-left:1rem;padding-right:1rem}.px-24{padding-left:1.5rem;padding-right:1.5rem}.py-16{padding-bottom:1rem;padding-top:1rem}.pt-4{padding-top:.25rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.leading-4{line-height:1rem}.leading-6{line-height:1.5rem}.text-icon-disabled{color:var(--color-icon-disabled)}.text-text-disabled{color:var(--color-text-disabled)}.text-text-primary{color:var(--color-text-primary)}.text-text-secondary{color:var(--color-text-secondary)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.placeholder\\:text-text-secondary::placeholder{color:var(--color-text-secondary)}.rounded-sm{border-radius:.75rem}.py-12{padding-bottom:.75rem;padding-top:.75rem}.text-text-brand{color:var(--color-text-brand)}.hover\\:bg-states-empty-bg-hover:hover{background-color:var(--color-states-empty-bg-hover)}";
|
|
@@ -33,7 +33,10 @@ const SulaDropdown$1 = /*@__PURE__*/ proxyCustomElement(class SulaDropdown exten
|
|
|
33
33
|
* Close dropdown when an item is selected or content is clicked
|
|
34
34
|
*/
|
|
35
35
|
this.closeOnSelect = true;
|
|
36
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Show or hide dropdown content
|
|
38
|
+
*/
|
|
39
|
+
this.showContent = false;
|
|
37
40
|
this.isFocused = false;
|
|
38
41
|
this.searchTerm = '';
|
|
39
42
|
this.filteredItems = [];
|
|
@@ -43,9 +46,9 @@ const SulaDropdown$1 = /*@__PURE__*/ proxyCustomElement(class SulaDropdown exten
|
|
|
43
46
|
return;
|
|
44
47
|
this.dropdownClicked.emit();
|
|
45
48
|
if (this.customContent || this.items.length > 0) {
|
|
46
|
-
this.
|
|
49
|
+
this.showContent = !this.showContent;
|
|
47
50
|
}
|
|
48
|
-
if (this.searchable && this.
|
|
51
|
+
if (this.searchable && this.showContent && this.searchInputRef) {
|
|
49
52
|
this.searchInputRef.focus();
|
|
50
53
|
}
|
|
51
54
|
};
|
|
@@ -55,7 +58,7 @@ const SulaDropdown$1 = /*@__PURE__*/ proxyCustomElement(class SulaDropdown exten
|
|
|
55
58
|
this.menuItemSelected.emit(item.detail);
|
|
56
59
|
if (this.closeOnSelect) {
|
|
57
60
|
setTimeout(() => {
|
|
58
|
-
this.
|
|
61
|
+
this.showContent = false;
|
|
59
62
|
}, 0);
|
|
60
63
|
}
|
|
61
64
|
};
|
|
@@ -89,7 +92,7 @@ const SulaDropdown$1 = /*@__PURE__*/ proxyCustomElement(class SulaDropdown exten
|
|
|
89
92
|
this.selectedItem = this.value;
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
|
-
|
|
95
|
+
handleShowContentChange(newValue) {
|
|
93
96
|
if (!newValue) {
|
|
94
97
|
this.searchTerm = '';
|
|
95
98
|
this.filteredItems = [];
|
|
@@ -101,11 +104,11 @@ const SulaDropdown$1 = /*@__PURE__*/ proxyCustomElement(class SulaDropdown exten
|
|
|
101
104
|
const path = event.composedPath();
|
|
102
105
|
const clickInside = path.some(el => el === this.node);
|
|
103
106
|
if (!clickInside) {
|
|
104
|
-
this.
|
|
107
|
+
this.showContent = false;
|
|
105
108
|
}
|
|
106
109
|
}
|
|
107
110
|
handleWindowResize() {
|
|
108
|
-
if (this.
|
|
111
|
+
if (this.showContent) {
|
|
109
112
|
this.calculateMenuPosition();
|
|
110
113
|
}
|
|
111
114
|
}
|
|
@@ -126,7 +129,7 @@ const SulaDropdown$1 = /*@__PURE__*/ proxyCustomElement(class SulaDropdown exten
|
|
|
126
129
|
}
|
|
127
130
|
}
|
|
128
131
|
componentDidRender() {
|
|
129
|
-
if (this.
|
|
132
|
+
if (this.showContent) {
|
|
130
133
|
this.calculateMenuPosition();
|
|
131
134
|
if (this.searchable && this.searchInputRef) {
|
|
132
135
|
this.searchInputRef.focus();
|
|
@@ -140,21 +143,21 @@ const SulaDropdown$1 = /*@__PURE__*/ proxyCustomElement(class SulaDropdown exten
|
|
|
140
143
|
}
|
|
141
144
|
render() {
|
|
142
145
|
var _a;
|
|
143
|
-
return (h(Host, { key: '
|
|
146
|
+
return (h(Host, { key: '812029af9121bf2f6b10b426b93dc0095796d66d', ref: node => (this.node = node) }, h("div", { key: '24e4b075470cd3ac8311374d0eebbc9d62bc248e', class: {
|
|
144
147
|
'flex justify-between items-center border border-line-input h-[72px] px-16 rounded-xl relative': true,
|
|
145
148
|
'bg-surface-body cursor-pointer': !this.disabled,
|
|
146
149
|
'bg-states-bg-disabled': this.disabled,
|
|
147
150
|
'dropdown-focus': this.isFocused,
|
|
148
|
-
}, onClick: this.handleClick, tabIndex: 0, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("div", { key: '
|
|
149
|
-
'text-base leading-4': !this.selectedItem && !(this.searchable && this.
|
|
150
|
-
'text-sm leading-4 font-bold': !!this.selectedItem || (this.searchable && this.
|
|
151
|
+
}, onClick: this.handleClick, tabIndex: 0, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("div", { key: '10bb402bb063b83a66996c3b21e345045779fea6', class: "flex flex-col w-full" }, h("label", { key: '9e6013e76bd927d9cf50bccfe542205b2db5ad3c', class: {
|
|
152
|
+
'text-base leading-4': !this.selectedItem && !(this.searchable && this.showContent),
|
|
153
|
+
'text-sm leading-4 font-bold': !!this.selectedItem || (this.searchable && this.showContent),
|
|
151
154
|
'text-text-primary': !this.disabled,
|
|
152
155
|
'text-text-disabled': this.disabled,
|
|
153
|
-
} }, this.label), this.searchable && this.
|
|
156
|
+
} }, this.label), this.searchable && this.showContent ? (h("input", { ref: el => (this.searchInputRef = el), type: "text", value: this.searchTerm, onInput: this.handleSearchInput, placeholder: ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.title) || '', class: "w-full text-base text-text-primary bg-transparent border-none outline-none placeholder:text-text-secondary p-0 m-0 leading-4 pt-4" })) : (!!this.selectedItem && (h("span", { class: {
|
|
154
157
|
'text-base leading-4 pt-4': true,
|
|
155
158
|
'text-text-primary': !this.disabled,
|
|
156
159
|
'text-text-disabled': this.disabled,
|
|
157
|
-
} }, this.selectedItem.title)))), h("div", { key: '
|
|
160
|
+
} }, this.selectedItem.title)))), h("div", { key: '9c570fe666a9e400882728dd6cc7375efc6fd9c3', class: "flex items-center justify-center ml-8 leading-6 text-2xl" }, h("sula-icon", { key: 'c33165aec78c9d227a645d5a5390caa5f5580e48', icon: `ph ph-caret-${this.showContent ? 'up' : 'down'}`, customClass: `${this.getIconClass()} text-2xl` })), this.showContent && (h("div", { key: 'a5f4c9c26cfc64bb39300474e8efb52174b538ab', class: {
|
|
158
161
|
'absolute z-50 left-0 w-full transition-all duration-200 ease-in-out': true,
|
|
159
162
|
'bottom-[72px]': this.openUpward,
|
|
160
163
|
'top-[72px]': !this.openUpward,
|
|
@@ -169,7 +172,7 @@ const SulaDropdown$1 = /*@__PURE__*/ proxyCustomElement(class SulaDropdown exten
|
|
|
169
172
|
}
|
|
170
173
|
static get watchers() { return {
|
|
171
174
|
"value": ["handleValueChange"],
|
|
172
|
-
"
|
|
175
|
+
"showContent": ["handleShowContentChange"]
|
|
173
176
|
}; }
|
|
174
177
|
static get style() { return sulaDropdownCss; }
|
|
175
178
|
}, [1, "sula-dropdown", {
|
|
@@ -182,15 +185,15 @@ const SulaDropdown$1 = /*@__PURE__*/ proxyCustomElement(class SulaDropdown exten
|
|
|
182
185
|
"contentMaxHeight": [2, "content-max-height"],
|
|
183
186
|
"customContent": [516, "custom-content"],
|
|
184
187
|
"closeOnSelect": [4, "close-on-select"],
|
|
188
|
+
"showContent": [1540, "show-content"],
|
|
185
189
|
"selectedItem": [32],
|
|
186
|
-
"showItems": [32],
|
|
187
190
|
"isFocused": [32],
|
|
188
191
|
"searchTerm": [32],
|
|
189
192
|
"filteredItems": [32],
|
|
190
193
|
"openUpward": [32]
|
|
191
194
|
}, [[4, "click", "handleDocumentClick"], [9, "resize", "handleWindowResize"]], {
|
|
192
195
|
"value": ["handleValueChange"],
|
|
193
|
-
"
|
|
196
|
+
"showContent": ["handle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AAC,aAAa,EAC7B,aAAa,EAAE,IAAI,CAAC,YAAY,EAChC,cAAc,EAAE,IAAI,CAAC,kBAAkB,EAAA,CAChB;AAE7B,SAAC,GAAG,CACA,CACP,CACG,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SulaDropdown","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/sula-dropdown/sula-dropdown.scss?tag=sula-dropdown&encapsulation=shadow","src/components/sula-dropdown/sula-dropdown.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.dropdown-focus {\n outline: 2px solid var(--color-feedback-informational) !important;\n outline-offset: 2px !important;\n}\n","import { Component, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { SulaMenuListItem, SulaMenuSelectListCustomEvent } from '../../components';\n\n@Component({\n tag: 'sula-dropdown',\n styleUrl: 'sula-dropdown.scss',\n shadow: true,\n})\nexport class SulaDropdown {\n /**\n * Dropdown label\n */\n @Prop({ mutable: true })\n label: string;\n\n /**\n * Dropdown is disabled\n */\n @Prop({ mutable: true })\n disabled: boolean = false;\n\n /**\n * Items for list\n */\n @Prop({ mutable: true })\n items: SulaMenuListItem[] = [];\n\n /**\n * Value for dropdown\n */\n @Prop({ mutable: true })\n value?: SulaMenuListItem;\n\n /**\n * Enable search/filter functionality in dropdown\n */\n @Prop({ reflect: true })\n searchable?: boolean;\n\n /**\n * Maximum height for dropdown menu in pixels\n */\n @Prop()\n menuMaxHeight: number = 260;\n\n /**\n * Maximum height for custom content area in pixels\n */\n @Prop()\n contentMaxHeight: number = 260;\n\n /**\n * Enable custom content via slot instead of items list\n */\n @Prop({ reflect: true })\n customContent?: boolean;\n\n /**\n * Close dropdown when an item is selected or content is clicked\n */\n @Prop()\n closeOnSelect: boolean = true;\n\n /**\n * Event emitted when dropdown is clicked\n */\n @Event()\n dropdownClicked: EventEmitter<void>;\n\n /**\n * Event emitted when dropdown is focused\n */\n @Event()\n dropdownFocused: EventEmitter<void>;\n\n /**\n * Event emitted when dropdown is focused out\n */\n @Event()\n dropdownFocusedOut: EventEmitter<void>;\n\n /**\n * Event emitted when item is selected\n */\n @Event()\n menuItemSelected: EventEmitter<SulaMenuListItem>;\n\n @State()\n selectedItem?: SulaMenuListItem;\n\n @State()\n showItems = false;\n\n @State()\n isFocused = false;\n\n @State()\n searchTerm: string = '';\n\n @State()\n filteredItems: SulaMenuListItem[] = [];\n\n @State()\n openUpward: boolean = false;\n\n node?: HTMLElement;\n searchInputRef?: HTMLInputElement;\n\n @Watch('value')\n handleValueChange() {\n if (this.value) {\n this.selectedItem = this.value;\n }\n }\n\n @Watch('showItems')\n handleShowItemsChange(newValue: boolean) {\n if (!newValue) {\n this.searchTerm = '';\n this.filteredItems = [];\n }\n }\n\n @Listen('click', { target: 'document' })\n handleDocumentClick(event: Event) {\n if (!this.node) return;\n\n const path = event.composedPath();\n const clickInside = path.some(el => el === this.node);\n\n if (!clickInside) {\n this.showItems = false;\n }\n }\n\n @Listen('resize', { target: 'window' })\n handleWindowResize() {\n if (this.showItems) {\n this.calculateMenuPosition();\n }\n }\n\n calculateMenuPosition() {\n if (!this.node) return;\n\n const rect = this.node.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const spaceBelow = viewportHeight - rect.bottom;\n const spaceAbove = rect.top;\n const buffer = 60; \n const requiredSpace = (this.customContent ? this.contentMaxHeight : this.menuMaxHeight) + buffer;\n\n this.openUpward = spaceBelow < requiredSpace && (spaceAbove > requiredSpace || spaceAbove > spaceBelow);\n }\n\n componentWillLoad() {\n if (this.value) {\n this.selectedItem = this.value;\n }\n }\n\n componentDidRender() {\n if (this.showItems) {\n this.calculateMenuPosition();\n \n if (this.searchable && this.searchInputRef) {\n this.searchInputRef.focus();\n }\n }\n }\n\n handleClick = () => {\n if (this.disabled) return;\n\n this.dropdownClicked.emit();\n\n if (this.customContent || this.items.length > 0) {\n this.showItems = !this.showItems;\n }\n\n if (this.searchable && this.showItems && this.searchInputRef) {\n this.searchInputRef.focus();\n }\n };\n\n handleItemSelected = (item: SulaMenuSelectListCustomEvent<SulaMenuListItem>) => {\n this.selectedItem = item.detail;\n this.searchTerm = '';\n this.menuItemSelected.emit(item.detail);\n\n if (this.closeOnSelect) {\n setTimeout(() => {\n this.showItems = false;\n }, 0);\n }\n };\n\n filterItems = () => {\n if (!this.searchTerm.trim()) {\n return this.items;\n }\n const term = this.searchTerm.toLowerCase();\n return this.items.filter(item => item.title.toLowerCase().includes(term));\n };\n\n handleSearchInput = (event: Event) => {\n const target = event.target as HTMLInputElement;\n this.searchTerm = target.value;\n this.filteredItems = this.filterItems();\n };\n\n getIconClass() {\n if (this.disabled) return 'text-icon-disabled';\n\n return 'text-text-primary';\n }\n\n handleFocus = () => {\n if (this.disabled) return;\n\n this.isFocused = true;\n this.dropdownFocused.emit();\n };\n\n handleBlur = () => {\n if (this.disabled) return;\n\n this.isFocused = false;\n this.dropdownFocusedOut.emit();\n };\n\n render() {\n return (\n <Host ref={node => (this.node = node)}>\n <div\n class={{\n 'flex justify-between items-center border border-line-input h-[72px] px-16 rounded-xl relative': true,\n 'bg-surface-body cursor-pointer': !this.disabled,\n 'bg-states-bg-disabled': this.disabled,\n 'dropdown-focus': this.isFocused,\n }}\n onClick={this.handleClick}\n tabIndex={0}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n >\n <div class=\"flex flex-col w-full\">\n <label\n class={{\n 'text-base leading-4': !this.selectedItem && !(this.searchable && this.showItems),\n 'text-sm leading-4 font-bold': !!this.selectedItem || (this.searchable && this.showItems),\n 'text-text-primary': !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.label}\n </label>\n\n {this.searchable && this.showItems ? (\n <input\n ref={el => (this.searchInputRef = el)}\n type=\"text\"\n value={this.searchTerm}\n onInput={this.handleSearchInput}\n placeholder={this.selectedItem?.title || ''}\n class=\"w-full text-base text-text-primary bg-transparent border-none outline-none placeholder:text-text-secondary p-0 m-0 leading-4 pt-4\"\n />\n ) : (\n !!this.selectedItem && (\n <span\n class={{\n 'text-base leading-4 pt-4': true,\n 'text-text-primary': !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.selectedItem.title}\n </span>\n )\n )}\n </div>\n <div class=\"flex items-center justify-center ml-8 leading-6 text-2xl\">\n <sula-icon icon={`ph ph-caret-${this.showItems ? 'up' : 'down'}`} customClass={`${this.getIconClass()} text-2xl`}></sula-icon>\n </div>\n\n {this.showItems && (\n <div\n class={{\n 'absolute z-50 left-0 w-full transition-all duration-200 ease-in-out': true,\n 'bottom-[72px]': this.openUpward,\n 'top-[72px]': !this.openUpward,\n }}\n onClick={!this.closeOnSelect ? (e: Event) => e.stopPropagation() : undefined}\n >\n {this.customContent ? (\n <div class=\"bg-surface-body border border-line-general rounded-sm overflow-auto\" style={{ maxHeight: `${this.contentMaxHeight}px` }}>\n <slot></slot>\n </div>\n ) : (() => {\n const itemsToShow = this.searchable && this.searchTerm.trim() ? this.filteredItems : this.items;\n const showNoResults = this.searchable && this.searchTerm.trim() && itemsToShow.length === 0;\n\n if (showNoResults) {\n return (\n <div class=\"bg-surface-body border border-line-general rounded-sm py-16 px-24 text-base text-text-secondary\">\n Nenhum resultado encontrado\n </div>\n );\n }\n\n return (\n <sula-menu-select-list\n items={itemsToShow}\n fullWidth={true}\n maxHeight={this.menuMaxHeight}\n selectedValue={this.selectedItem}\n onItemSelected={this.handleItemSelected}\n ></sula-menu-select-list>\n );\n })()}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"sula-dropdown.js","mappings":";;;;AAAA,MAAM,eAAe,GAAG,o6WAAo6W;;MCQ/6WA,cAAY,iBAAAC,kBAAA,CAAA,MAAA,YAAA,SAAAC,CAAA,CAAA;AALzB,IAAA,WAAA,GAAA;;;;;;;;AAYE;;AAEG;AAEH,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAEzB;;AAEG;AAEH,QAAA,IAAK,CAA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,CAAC,UAAU;AAC/B,aAAA,EACD,OAAO,EAAE,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAQ,KAAK,CAAC,CAAC,eAAe,EAAE,GAAG,SAAS,IAE3E,IAAI,CAAC,aAAa,IACjB,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,qEAAqE,EAAC,KAAK,EAAE,EAAE,SAAS,EAAE,CAAG,EAAA,IAAI,CAAC,gBAAgB,CAAA,EAAA,CAAI,EAAE,EAAA,EACjI,CAAA,CAAA,MAAA,EAAA,IAAA,CAAa,CACT,IACJ,CAAC,MAAK;YACR,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK;AAC/F,YAAA,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAE3F,IAAI,aAAa,EAAE;AACjB,gBAAA,QACE,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,iGAAiG,EAAA,EAAA,6BAAA,CAEtG;;AAIV,YAAA,QACE,CAAA,CAAA,uBAAA,EAAA,EACE,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,IAAI,EACf,SAAS,EAAE,IAAI,CAAC,aAAa,EAC7B,aAAa,EAAE,IAAI,CAAC,YAAY,EAChC,cAAc,EAAE,IAAI,CAAC,kBAAkB,EAAA,CAChB;AAE7B,SAAC,GAAG,CACA,CACP,CACG,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SulaDropdown","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/sula-dropdown/sula-dropdown.scss?tag=sula-dropdown&encapsulation=shadow","src/components/sula-dropdown/sula-dropdown.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.dropdown-focus {\n outline: 2px solid var(--color-feedback-informational) !important;\n outline-offset: 2px !important;\n}\n","import { Component, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { SulaMenuListItem, SulaMenuSelectListCustomEvent } from '../../components';\n\n@Component({\n tag: 'sula-dropdown',\n styleUrl: 'sula-dropdown.scss',\n shadow: true,\n})\nexport class SulaDropdown {\n /**\n * Dropdown label\n */\n @Prop({ mutable: true })\n label: string;\n\n /**\n * Dropdown is disabled\n */\n @Prop({ mutable: true })\n disabled: boolean = false;\n\n /**\n * Items for list\n */\n @Prop({ mutable: true })\n items: SulaMenuListItem[] = [];\n\n /**\n * Value for dropdown\n */\n @Prop({ mutable: true })\n value?: SulaMenuListItem;\n\n /**\n * Enable search/filter functionality in dropdown\n */\n @Prop({ reflect: true })\n searchable?: boolean;\n\n /**\n * Maximum height for dropdown menu in pixels\n */\n @Prop()\n menuMaxHeight: number = 260;\n\n /**\n * Maximum height for custom content area in pixels\n */\n @Prop()\n contentMaxHeight: number = 260;\n\n /**\n * Enable custom content via slot instead of items list\n */\n @Prop({ reflect: true })\n customContent?: boolean;\n\n /**\n * Close dropdown when an item is selected or content is clicked\n */\n @Prop()\n closeOnSelect: boolean = true;\n\n /**\n * Show or hide dropdown content\n */\n @Prop({ mutable: true, reflect: true })\n showContent = false;\n \n /**\n * Event emitted when dropdown is clicked\n */\n @Event()\n dropdownClicked: EventEmitter<void>;\n\n /**\n * Event emitted when dropdown is focused\n */\n @Event()\n dropdownFocused: EventEmitter<void>;\n\n /**\n * Event emitted when dropdown is focused out\n */\n @Event()\n dropdownFocusedOut: EventEmitter<void>;\n\n /**\n * Event emitted when item is selected\n */\n @Event()\n menuItemSelected: EventEmitter<SulaMenuListItem>;\n\n @State()\n selectedItem?: SulaMenuListItem;\n\n @State()\n isFocused = false;\n\n @State()\n searchTerm: string = '';\n\n @State()\n filteredItems: SulaMenuListItem[] = [];\n\n @State()\n openUpward: boolean = false;\n\n node?: HTMLElement;\n searchInputRef?: HTMLInputElement;\n\n @Watch('value')\n handleValueChange() {\n if (this.value) {\n this.selectedItem = this.value;\n }\n }\n\n @Watch('showContent')\n handleShowContentChange(newValue: boolean) {\n if (!newValue) {\n this.searchTerm = '';\n this.filteredItems = [];\n }\n }\n\n @Listen('click', { target: 'document' })\n handleDocumentClick(event: Event) {\n if (!this.node) return;\n\n const path = event.composedPath();\n const clickInside = path.some(el => el === this.node);\n\n if (!clickInside) {\n this.showContent = false;\n }\n }\n\n @Listen('resize', { target: 'window' })\n handleWindowResize() {\n if (this.showContent) {\n this.calculateMenuPosition();\n }\n }\n\n calculateMenuPosition() {\n if (!this.node) return;\n\n const rect = this.node.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const spaceBelow = viewportHeight - rect.bottom;\n const spaceAbove = rect.top;\n const buffer = 60; \n const requiredSpace = (this.customContent ? this.contentMaxHeight : this.menuMaxHeight) + buffer;\n\n this.openUpward = spaceBelow < requiredSpace && (spaceAbove > requiredSpace || spaceAbove > spaceBelow);\n }\n\n componentWillLoad() {\n if (this.value) {\n this.selectedItem = this.value;\n }\n }\n\n componentDidRender() {\n if (this.showContent) {\n this.calculateMenuPosition();\n \n if (this.searchable && this.searchInputRef) {\n this.searchInputRef.focus();\n }\n }\n }\n\n handleClick = () => {\n if (this.disabled) return;\n\n this.dropdownClicked.emit();\n\n if (this.customContent || this.items.length > 0) {\n this.showContent = !this.showContent;\n }\n\n if (this.searchable && this.showContent && this.searchInputRef) {\n this.searchInputRef.focus();\n }\n };\n\n handleItemSelected = (item: SulaMenuSelectListCustomEvent<SulaMenuListItem>) => {\n this.selectedItem = item.detail;\n this.searchTerm = '';\n this.menuItemSelected.emit(item.detail);\n\n if (this.closeOnSelect) {\n setTimeout(() => {\n this.showContent = false;\n }, 0);\n }\n };\n\n filterItems = () => {\n if (!this.searchTerm.trim()) {\n return this.items;\n }\n const term = this.searchTerm.toLowerCase();\n return this.items.filter(item => item.title.toLowerCase().includes(term));\n };\n\n handleSearchInput = (event: Event) => {\n const target = event.target as HTMLInputElement;\n this.searchTerm = target.value;\n this.filteredItems = this.filterItems();\n };\n\n getIconClass() {\n if (this.disabled) return 'text-icon-disabled';\n\n return 'text-text-primary';\n }\n\n handleFocus = () => {\n if (this.disabled) return;\n\n this.isFocused = true;\n this.dropdownFocused.emit();\n };\n\n handleBlur = () => {\n if (this.disabled) return;\n\n this.isFocused = false;\n this.dropdownFocusedOut.emit();\n };\n\n render() {\n return (\n <Host ref={node => (this.node = node)}>\n <div\n class={{\n 'flex justify-between items-center border border-line-input h-[72px] px-16 rounded-xl relative': true,\n 'bg-surface-body cursor-pointer': !this.disabled,\n 'bg-states-bg-disabled': this.disabled,\n 'dropdown-focus': this.isFocused,\n }}\n onClick={this.handleClick}\n tabIndex={0}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n >\n <div class=\"flex flex-col w-full\">\n <label\n class={{\n 'text-base leading-4': !this.selectedItem && !(this.searchable && this.showContent),\n 'text-sm leading-4 font-bold': !!this.selectedItem || (this.searchable && this.showContent),\n 'text-text-primary': !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.label}\n </label>\n\n {this.searchable && this.showContent ? (\n <input\n ref={el => (this.searchInputRef = el)}\n type=\"text\"\n value={this.searchTerm}\n onInput={this.handleSearchInput}\n placeholder={this.selectedItem?.title || ''}\n class=\"w-full text-base text-text-primary bg-transparent border-none outline-none placeholder:text-text-secondary p-0 m-0 leading-4 pt-4\"\n />\n ) : (\n !!this.selectedItem && (\n <span\n class={{\n 'text-base leading-4 pt-4': true,\n 'text-text-primary': !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.selectedItem.title}\n </span>\n )\n )}\n </div>\n <div class=\"flex items-center justify-center ml-8 leading-6 text-2xl\">\n <sula-icon icon={`ph ph-caret-${this.showContent ? 'up' : 'down'}`} customClass={`${this.getIconClass()} text-2xl`}></sula-icon>\n </div>\n\n {this.showContent && (\n <div\n class={{\n 'absolute z-50 left-0 w-full transition-all duration-200 ease-in-out': true,\n 'bottom-[72px]': this.openUpward,\n 'top-[72px]': !this.openUpward,\n }}\n onClick={!this.closeOnSelect ? (e: Event) => e.stopPropagation() : undefined}\n >\n {this.customContent ? (\n <div class=\"bg-surface-body border border-line-general rounded-sm overflow-auto\" style={{ maxHeight: `${this.contentMaxHeight}px` }}>\n <slot></slot>\n </div>\n ) : (() => {\n const itemsToShow = this.searchable && this.searchTerm.trim() ? this.filteredItems : this.items;\n const showNoResults = this.searchable && this.searchTerm.trim() && itemsToShow.length === 0;\n\n if (showNoResults) {\n return (\n <div class=\"bg-surface-body border border-line-general rounded-sm py-16 px-24 text-base text-text-secondary\">\n Nenhum resultado encontrado\n </div>\n );\n }\n\n return (\n <sula-menu-select-list\n items={itemsToShow}\n fullWidth={true}\n maxHeight={this.menuMaxHeight}\n selectedValue={this.selectedItem}\n onItemSelected={this.handleItemSelected}\n ></sula-menu-select-list>\n );\n })()}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
-
import { d as defineCustomElement$4, a as SulaButtonAppearance } from './p-
|
|
3
|
-
import { d as defineCustomElement$3 } from './p-
|
|
2
|
+
import { d as defineCustomElement$4, a as SulaButtonAppearance } from './p-BznR9x_k.js';
|
|
3
|
+
import { d as defineCustomElement$3 } from './p-BESq0oqe.js';
|
|
4
4
|
import { d as defineCustomElement$2 } from './p-CkPiwCwQ.js';
|
|
5
5
|
|
|
6
6
|
var SulaModalType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
-
import { d as defineCustomElement$2 } from './p-
|
|
2
|
+
import { d as defineCustomElement$2 } from './p-BESq0oqe.js';
|
|
3
3
|
|
|
4
4
|
var SulaProgressBarAppearance;
|
|
5
5
|
(function (SulaProgressBarAppearance) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
-
import { d as defineCustomElement$2 } from './p-
|
|
2
|
+
import { d as defineCustomElement$2 } from './p-BESq0oqe.js';
|
|
3
3
|
|
|
4
4
|
var SulaSearchBarStyle;
|
|
5
5
|
(function (SulaSearchBarStyle) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
-
import { d as defineCustomElement$2 } from './p-
|
|
2
|
+
import { d as defineCustomElement$2 } from './p-BESq0oqe.js';
|
|
3
3
|
|
|
4
4
|
var SulaSegmentedControlType;
|
|
5
5
|
(function (SulaSegmentedControlType) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
2
|
import { g as getDefaultExportFromCjs } from './p-B85MJLTf.js';
|
|
3
|
-
import { d as defineCustomElement$2 } from './p-
|
|
3
|
+
import { d as defineCustomElement$2 } from './p-BESq0oqe.js';
|
|
4
4
|
|
|
5
5
|
var SulaTextfieldType;
|
|
6
6
|
(function (SulaTextfieldType) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
-
import { d as defineCustomElement$2 } from './p-
|
|
2
|
+
import { d as defineCustomElement$2 } from './p-BESq0oqe.js';
|
|
3
3
|
|
|
4
4
|
var SulaTimelineListItemIconStatus;
|
|
5
5
|
(function (SulaTimelineListItemIconStatus) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SulaTooltip extends Components.SulaTooltip, HTMLElement {}
|
|
4
|
+
export const SulaTooltip: {
|
|
5
|
+
prototype: SulaTooltip;
|
|
6
|
+
new (): SulaTooltip;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|