@sula-tech/webcomponents 0.9.2 → 0.11.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_19.cjs.entry.js → sula-avatar_21.cjs.entry.js} +155 -39
- package/dist/cjs/sula-avatar_21.cjs.entry.js.map +1 -0
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/sula-breadcrumb/model/sula-breadcrumb.model.js +2 -0
- package/dist/collection/components/sula-breadcrumb/model/sula-breadcrumb.model.js.map +1 -0
- package/dist/collection/components/sula-breadcrumb/sula-breadcrumb.css +1 -0
- package/dist/collection/components/sula-breadcrumb/sula-breadcrumb.js +98 -0
- package/dist/collection/components/sula-breadcrumb/sula-breadcrumb.js.map +1 -0
- package/dist/collection/components/sula-breadcrumb/sula-breadcrumb.stories.js +116 -0
- package/dist/collection/components/sula-breadcrumb/sula-breadcrumb.stories.js.map +1 -0
- package/dist/collection/components/sula-button/sula-button.js +1 -1
- package/dist/collection/components/sula-checkbox/sula-checkbox.js +3 -3
- package/dist/collection/components/sula-chip/sula-chip.js +3 -3
- package/dist/collection/components/sula-dropdown/sula-dropdown.js +3 -3
- package/dist/collection/components/sula-icon/sula-icon.css +1 -1
- package/dist/collection/components/sula-icon/sula-icon.js +1 -1
- package/dist/collection/components/sula-loader/sula-loader.js +1 -1
- package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.js +1 -1
- package/dist/collection/components/sula-progress-bar/sula-progress-bar.js +2 -2
- package/dist/collection/components/sula-radio-button/sula-radio-button.js +2 -2
- package/dist/collection/components/sula-search-bar/sula-search-bar.js +2 -2
- package/dist/collection/components/sula-segmented-control/model/sula-segmented-control.model.js +16 -0
- package/dist/collection/components/sula-segmented-control/model/sula-segmented-control.model.js.map +1 -0
- package/dist/collection/components/sula-segmented-control/sula-segmented-control.css +1 -0
- package/dist/collection/components/sula-segmented-control/sula-segmented-control.js +241 -0
- package/dist/collection/components/sula-segmented-control/sula-segmented-control.js.map +1 -0
- package/dist/collection/components/sula-segmented-control/sula-segmented-control.stories.js +352 -0
- package/dist/collection/components/sula-segmented-control/sula-segmented-control.stories.js.map +1 -0
- package/dist/collection/components/sula-switch/sula-switch.js +4 -4
- package/dist/collection/components/sula-tag/sula-tag.js +3 -3
- package/dist/collection/components/sula-textarea/sula-textarea.js +6 -6
- package/dist/collection/components/sula-textfield/sula-textfield.js +2 -2
- package/dist/collection/components/sula-tiles/sula-tiles.js +1 -1
- package/dist/collection/components/sula-timeline-list/sula-timeline-list.js +1 -1
- package/dist/collection/testing/e2e-setup.js +47 -0
- package/dist/collection/testing/e2e-setup.js.map +1 -0
- package/dist/components/{p-Bgqd8BiV.js → p-CD0__3qt.js} +5 -5
- package/dist/components/{p-Bgqd8BiV.js.map → p-CD0__3qt.js.map} +1 -1
- package/dist/components/{p-QU2wuzIe.js → p-CFhhi4NQ.js} +3 -3
- package/dist/components/{p-QU2wuzIe.js.map → p-CFhhi4NQ.js.map} +1 -1
- package/dist/components/{p-BUnU7bjf.js → p-CkPiwCwQ.js} +3 -3
- package/dist/components/{p-BUnU7bjf.js.map → p-CkPiwCwQ.js.map} +1 -1
- package/dist/components/{p-Uq6L0wCA.js → p-DO7voMbe.js} +4 -4
- package/dist/components/{p-Uq6L0wCA.js.map → p-DO7voMbe.js.map} +1 -1
- package/dist/components/sula-avatar.js +1 -1
- package/dist/components/sula-badge.js +1 -1
- package/dist/components/sula-breadcrumb.d.ts +11 -0
- package/dist/components/sula-breadcrumb.js +70 -0
- package/dist/components/sula-breadcrumb.js.map +1 -0
- package/dist/components/sula-button.js +1 -1
- package/dist/components/sula-checkbox.js +4 -4
- package/dist/components/sula-chip.js +5 -5
- package/dist/components/sula-dropdown.js +5 -5
- package/dist/components/sula-icon.js +1 -1
- package/dist/components/sula-loader.js +1 -1
- package/dist/components/sula-menu-select-list.js +1 -1
- package/dist/components/sula-modal.js +3 -3
- package/dist/components/sula-progress-bar.js +3 -3
- package/dist/components/sula-radio-button.js +2 -2
- package/dist/components/sula-search-bar.js +3 -3
- package/dist/components/sula-segmented-control.d.ts +11 -0
- package/dist/components/sula-segmented-control.js +113 -0
- package/dist/components/sula-segmented-control.js.map +1 -0
- package/dist/components/sula-switch.js +4 -4
- package/dist/components/sula-tag.js +4 -4
- package/dist/components/sula-textarea.js +6 -6
- package/dist/components/sula-textfield.js +3 -3
- package/dist/components/sula-tiles.js +2 -2
- package/dist/components/sula-timeline-list.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{sula-avatar_19.entry.js → sula-avatar_21.entry.js} +154 -40
- package/dist/esm/sula-avatar_21.entry.js.map +1 -0
- package/dist/esm/webcomponents.js +1 -1
- package/dist/types/components/sula-breadcrumb/model/sula-breadcrumb.model.d.ts +5 -0
- package/dist/types/components/sula-breadcrumb/sula-breadcrumb.d.ts +14 -0
- package/dist/types/components/sula-breadcrumb/sula-breadcrumb.stories.d.ts +39 -0
- package/dist/types/components/sula-segmented-control/model/sula-segmented-control.model.d.ts +19 -0
- package/dist/types/components/sula-segmented-control/sula-segmented-control.d.ts +37 -0
- package/dist/types/components/sula-segmented-control/sula-segmented-control.stories.d.ts +136 -0
- package/dist/types/components.d.ts +128 -0
- package/dist/types/testing/e2e-setup.d.ts +1 -0
- package/dist/webcomponents/{p-9f81911a.entry.js → p-491c4d76.entry.js} +388 -228
- package/dist/webcomponents/p-491c4d76.entry.js.map +1 -0
- package/dist/webcomponents/webcomponents.esm.js +8 -1
- package/package.json +5 -2
- package/dist/cjs/sula-avatar_19.cjs.entry.js.map +0 -1
- package/dist/esm/sula-avatar_19.entry.js.map +0 -1
- package/dist/webcomponents/p-9f81911a.entry.js.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SulaBreadcrumb extends Components.SulaBreadcrumb, HTMLElement {}
|
|
4
|
+
export const SulaBreadcrumb: {
|
|
5
|
+
prototype: SulaBreadcrumb;
|
|
6
|
+
new (): SulaBreadcrumb;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
+
import { d as defineCustomElement$2 } from './p-DO7voMbe.js';
|
|
3
|
+
|
|
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
|
+
|
|
6
|
+
const SulaBreadcrumb$1 = /*@__PURE__*/ proxyCustomElement(class SulaBreadcrumb extends H {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
this.breadcrumbItemClicked = createEvent(this, "breadcrumbItemClicked");
|
|
12
|
+
/**
|
|
13
|
+
* Breadcrumb items list
|
|
14
|
+
*/
|
|
15
|
+
this.items = [];
|
|
16
|
+
}
|
|
17
|
+
handleItemClick(item, isActive) {
|
|
18
|
+
if (isActive || !item.path)
|
|
19
|
+
return;
|
|
20
|
+
this.breadcrumbItemClicked.emit(item);
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return (h(Host, { key: '4441eb43f2910be34a47b72e7089a00128bdb2fc' }, h("nav", { key: '6b0af3636a82d15581b949b42cf4193bf2b12e4c', class: "flex items-center", "aria-label": "Breadcrumb" }, h("ol", { key: '14941d47b8e9e69627fa2a3c756f631c621a5882', class: "flex items-center" }, this.items.map((item, index) => {
|
|
24
|
+
const isActive = index === this.items.length - 1;
|
|
25
|
+
const hasPath = !!item.path && !isActive;
|
|
26
|
+
return (h("li", { class: "flex items-center" }, h("a", { class: {
|
|
27
|
+
'text-paragraph-medium-bold align-middle transition-colors duration-200': true,
|
|
28
|
+
'tracking-[-0.01em]': true,
|
|
29
|
+
'no-underline': true,
|
|
30
|
+
'text-text-secondary cursor-default': !isActive,
|
|
31
|
+
'text-brand-primary cursor-default': isActive,
|
|
32
|
+
'cursor-pointer hover:text-text-primary hover:underline hover:decoration-solid hover:decoration-1 focus:outline focus:outline-2 focus:outline-feedback-informational focus:outline-offset-2 focus:rounded': hasPath,
|
|
33
|
+
'active:text-text-secondary active:underline active:decoration-solid active:decoration-1 active:decoration-skip-ink-auto': hasPath && !isActive,
|
|
34
|
+
}, href: hasPath ? item.path : undefined, "aria-current": isActive ? 'page' : undefined, onClick: e => {
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
this.handleItemClick(item, isActive);
|
|
37
|
+
} }, item.title), !isActive && (h("span", { class: "inline-flex items-center px-12" }, h("sula-icon", { icon: "ph-bold ph-caret-right", customClass: "text-brand-primary w-[9px] h-[5.25px] flex items-center justify-center" })))));
|
|
38
|
+
})))));
|
|
39
|
+
}
|
|
40
|
+
static get style() { return sulaBreadcrumbCss; }
|
|
41
|
+
}, [1, "sula-breadcrumb", {
|
|
42
|
+
"items": [1040]
|
|
43
|
+
}]);
|
|
44
|
+
function defineCustomElement$1() {
|
|
45
|
+
if (typeof customElements === "undefined") {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const components = ["sula-breadcrumb", "sula-icon"];
|
|
49
|
+
components.forEach(tagName => { switch (tagName) {
|
|
50
|
+
case "sula-breadcrumb":
|
|
51
|
+
if (!customElements.get(tagName)) {
|
|
52
|
+
customElements.define(tagName, SulaBreadcrumb$1);
|
|
53
|
+
}
|
|
54
|
+
break;
|
|
55
|
+
case "sula-icon":
|
|
56
|
+
if (!customElements.get(tagName)) {
|
|
57
|
+
defineCustomElement$2();
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
} });
|
|
61
|
+
}
|
|
62
|
+
defineCustomElement$1();
|
|
63
|
+
|
|
64
|
+
const SulaBreadcrumb = SulaBreadcrumb$1;
|
|
65
|
+
const defineCustomElement = defineCustomElement$1;
|
|
66
|
+
|
|
67
|
+
export { SulaBreadcrumb, defineCustomElement };
|
|
68
|
+
//# sourceMappingURL=sula-breadcrumb.js.map
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=sula-breadcrumb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"sula-breadcrumb.js","mappings":";;;AAAA,MAAM,iBAAiB,GAAG,orVAAorV;;MCQjsVA,gBAAc,iBAAAC,kBAAA,CAAA,MAAA,cAAA,SAAAC,CAAA,CAAA;AAL3B,IAAA,WAAA,GAAA;;;;;AAME;;AAEG;AAEH,QAAA,IAAK,CAAA,KAAA,GAAyB,EAAE;AAyDjC;IAjDS,eAAe,CAAC,IAAwB,EAAE,QAAiB,EAAA;AACjE,QAAA,IAAI,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE;AAC5B,QAAA,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC;;IAGvC,MAAM,GAAA;QACJ,QACE,EAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACH,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,mBAAmB,EAAA,YAAA,EAAY,YAAY,EAAA,EACpD,CAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAI,KAAK,EAAC,mBAAmB,EAAA,EAC1B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,KAAI;YAC9B,MAAM,QAAQ,GAAG,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;YAChD,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ;AAExC,YAAA,QACE,CAAA,CAAA,IAAA,EAAA,EAAI,KAAK,EAAC,mBAAmB,EAAA,EAC3B,CAAA,CAAA,GAAA,EAAA,EACE,KAAK,EAAE;AACL,oBAAA,wEAAwE,EAAE,IAAI;AAC9E,oBAAA,oBAAoB,EAAE,IAAI;AAC1B,oBAAA,cAAc,EAAE,IAAI;oBACpB,oCAAoC,EAAE,CAAC,QAAQ;AAC/C,oBAAA,mCAAmC,EAAE,QAAQ;AAC7C,oBAAA,0MAA0M,EAAE,OAAO;AACnN,oBAAA,yHAAyH,EAAE,OAAO,IAAI,CAAC,QAAQ;AAChJ,iBAAA,EACD,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC,IAAI,GAAG,SAAS,EAAA,cAAA,EACvB,QAAQ,GAAG,MAAM,GAAG,SAAS,EAC3C,OAAO,EAAE,CAAC,IAAG;oBACX,CAAC,CAAC,cAAc,EAAE;AAClB,oBAAA,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC;AACtC,iBAAC,EAEA,EAAA,IAAI,CAAC,KAAK,CACT,EAEH,CAAC,QAAQ,KACR,CAAM,CAAA,MAAA,EAAA,EAAA,KAAK,EAAC,gCAAgC,EAAA,EAC1C,CAAA,CAAA,WAAA,EAAA,EAAW,IAAI,EAAC,wBAAwB,EAAC,WAAW,EAAC,wEAAwE,EAAA,CAAa,CACrI,CACR,CACE;AAET,SAAC,CAAC,CACC,CACD,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SulaBreadcrumb","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/sula-breadcrumb/sula-breadcrumb.scss?tag=sula-breadcrumb&encapsulation=shadow","src/components/sula-breadcrumb/sula-breadcrumb.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport { SulaMenuBreadcrumb } from './model/sula-breadcrumb.model';\n\n@Component({\n tag: 'sula-breadcrumb',\n styleUrl: 'sula-breadcrumb.scss',\n shadow: true,\n})\nexport class SulaBreadcrumb {\n /**\n * Breadcrumb items list\n */\n @Prop({ mutable: true })\n items: SulaMenuBreadcrumb[] = [];\n\n /**\n * Event emitted when a breadcrumb item is clicked\n */\n @Event()\n breadcrumbItemClicked: EventEmitter<SulaMenuBreadcrumb>;\n\n private handleItemClick(item: SulaMenuBreadcrumb, isActive: boolean) {\n if (isActive || !item.path) return;\n this.breadcrumbItemClicked.emit(item);\n }\n\n render() {\n return (\n <Host>\n <nav class=\"flex items-center\" aria-label=\"Breadcrumb\">\n <ol class=\"flex items-center\">\n {this.items.map((item, index) => {\n const isActive = index === this.items.length - 1;\n const hasPath = !!item.path && !isActive;\n\n return (\n <li class=\"flex items-center\">\n <a\n class={{\n 'text-paragraph-medium-bold align-middle transition-colors duration-200': true,\n 'tracking-[-0.01em]': true,\n 'no-underline': true,\n 'text-text-secondary cursor-default': !isActive,\n 'text-brand-primary cursor-default': isActive,\n 'cursor-pointer hover:text-text-primary hover:underline hover:decoration-solid hover:decoration-1 focus:outline focus:outline-2 focus:outline-feedback-informational focus:outline-offset-2 focus:rounded': hasPath,\n 'active:text-text-secondary active:underline active:decoration-solid active:decoration-1 active:decoration-skip-ink-auto': hasPath && !isActive,\n }}\n href={hasPath ? item.path : undefined}\n aria-current={isActive ? 'page' : undefined}\n onClick={e => {\n e.preventDefault();\n this.handleItemClick(item, isActive);\n }}\n >\n {item.title}\n </a>\n\n {!isActive && (\n <span class=\"inline-flex items-center px-12\">\n <sula-icon icon=\"ph-bold ph-caret-right\" customClass=\"text-brand-primary w-[9px] h-[5.25px] flex items-center justify-center\"></sula-icon>\n </span>\n )}\n </li>\n );\n })}\n </ol>\n </nav>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -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-DO7voMbe.js';
|
|
3
3
|
|
|
4
4
|
var SulaCheckboxType;
|
|
5
5
|
(function (SulaCheckboxType) {
|
|
@@ -56,20 +56,20 @@ const SulaCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class SulaCheckbox exten
|
|
|
56
56
|
return 'text-negative-negative-1';
|
|
57
57
|
}
|
|
58
58
|
render() {
|
|
59
|
-
return (h(Host, { key: '
|
|
59
|
+
return (h(Host, { key: '0fd61b767c3596d432c165dd46ff8d51809322d7' }, h("div", { key: '125d5c775a4555bbad19515a062bb0613a09509c', class: {
|
|
60
60
|
'outline-none': true,
|
|
61
61
|
'flex items-center space-x-12': !!this.label && this.type === SulaCheckboxType.Default,
|
|
62
62
|
'flex items-center justify-between bg-surface-on-body rounded-md w-[280px] min-h-[85px] px-24 py-16': this.type === SulaCheckboxType.List,
|
|
63
63
|
'hover:bg-states-empty-bg-hover active:bg-states-empty-bg-pressed cursor-pointer': this.type === SulaCheckboxType.List && !this.disabled,
|
|
64
64
|
'container-focus': this.isFocus && this.type === SulaCheckboxType.List,
|
|
65
|
-
}, onFocus: this.handleFocus, onBlur: this.handleBlur, onClick: this.toggle, tabIndex: 0 }, this.type === SulaCheckboxType.List && (h("div", { key: '
|
|
65
|
+
}, onFocus: this.handleFocus, onBlur: this.handleBlur, onClick: this.toggle, tabIndex: 0 }, this.type === SulaCheckboxType.List && (h("div", { key: '0be2b402e083e38e2142574498a33f7cdf3f612a', class: "flex flex-col flex-1 mr-16 overflow-hidden" }, !!this.label && h("label", { key: 'c03f67836a92c3d9a556316fd56691e2dc14efc5', class: "text-text-primary font-bold text-base cursor-pointer break-words" }, this.label), !!this.subTitle && h("span", { key: 'b66906e1cad21d9bf9db411806c9e9f2ffb663f6', class: "text-text-secondary text-base break-words" }, this.subTitle))), h("div", { key: '79fe97660d576e181ef8505c44a0f0f0865df3dc', tabIndex: 0, class: {
|
|
66
66
|
'flex justify-center items-center rounded-xs w-[27px] h-[27px] border outline-none flex-shrink-0': true,
|
|
67
67
|
'checkbox-focus': this.isFocus && this.type === SulaCheckboxType.Default,
|
|
68
68
|
'cursor-pointer active:bg-states-empty-bg-pressed': !this.disabled,
|
|
69
69
|
'bg-states-bg-disabled border-states-bg-disabled': this.disabled,
|
|
70
70
|
'bg-brand-primary border-brand-primary': this.checked,
|
|
71
71
|
'bg-surface-body border-line-input': !this.checked,
|
|
72
|
-
}, onFocus: this.handleFocus, onBlur: this.handleBlur }, this.checked && (h("div", { key: '
|
|
72
|
+
}, onFocus: this.handleFocus, onBlur: this.handleBlur }, this.checked && (h("div", { key: '660a8055e046769e99ff0aad2f0456fa7cbfbd3d', class: "flex justify-center items-center" }, h("sula-icon", { key: 'd38c416debc187f68d8a2f5a3eb2646917661c31', icon: "ph-bold ph-check", customClass: `${this.getIconColor()} text-xl` })))), !!this.label && this.type === SulaCheckboxType.Default && h("label", { key: '3e916f2afef3b9fa5ccd2ed77a7d7283056fade4', class: "text-text-secondary text-base cursor-pointer break-words" }, this.label))));
|
|
73
73
|
}
|
|
74
74
|
static get style() { return sulaCheckboxCss; }
|
|
75
75
|
}, [1, "sula-checkbox", {
|
|
@@ -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$3 } from './p-
|
|
3
|
-
import { d as defineCustomElement$2 } from './p-
|
|
2
|
+
import { d as defineCustomElement$3 } from './p-DO7voMbe.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './p-CFhhi4NQ.js';
|
|
4
4
|
|
|
5
5
|
var SulaChipAppearance;
|
|
6
6
|
(function (SulaChipAppearance) {
|
|
@@ -78,7 +78,7 @@ const SulaChip$1 = /*@__PURE__*/ proxyCustomElement(class SulaChip extends H {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
render() {
|
|
81
|
-
return (h(Host, { key: '
|
|
81
|
+
return (h(Host, { key: 'fef73e8259b1203365b11cdbc5748b210ee4f727', ref: node => (this.node = node) }, h("div", { key: 'a252f13f43cfe38ef75f1d223efa8e4711520b57', class: "w-fit relative" }, h("div", { key: '44cdcb1f228243f3405ef1a06ae165da7916331c', class: {
|
|
82
82
|
'flex justify-center items-center px-16 py-2 rounded-xxl min-h-40 w-fit outline-none': true,
|
|
83
83
|
'bg-surface-on-body hover:bg-states-empty-bg-hover active:bg-states-empty-bg-pressed': this.appearance === SulaChipAppearance.Default && !this.disabled,
|
|
84
84
|
'bg-negative-negative-1 hover:bg-states-negative-hover active:bg-states-negative-pressed': this.appearance === SulaChipAppearance.Negative && !this.disabled,
|
|
@@ -86,12 +86,12 @@ const SulaChip$1 = /*@__PURE__*/ proxyCustomElement(class SulaChip extends H {
|
|
|
86
86
|
'cursor-pointer': !this.disabled,
|
|
87
87
|
'border border-line-input chip-opened': !this.disabled && this.showItems,
|
|
88
88
|
'chip-focus': this.isFocused,
|
|
89
|
-
}, tabIndex: 0, onClick: this.handleClick, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("span", { key: '
|
|
89
|
+
}, tabIndex: 0, onClick: this.handleClick, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("span", { key: 'b550a1edb64bf3e3ae6f0ad4d01f02b74df2ca65', class: {
|
|
90
90
|
'text-base font-bold leading-4': true,
|
|
91
91
|
'text-text-primary': this.appearance === SulaChipAppearance.Default && !this.disabled,
|
|
92
92
|
'text-negative-negative-2': this.appearance === SulaChipAppearance.Negative && !this.disabled,
|
|
93
93
|
'text-text-disabled': this.disabled,
|
|
94
|
-
} }, this.text), this.items.length > 0 && (h("div", { key: '
|
|
94
|
+
} }, this.text), this.items.length > 0 && (h("div", { key: 'e45f34046adab666419785c0555204441d75e975', class: "flex items-center justify-center ml-8 leading-4" }, h("sula-icon", { key: '09e76f0b49f8b65e525f7bec19171dc1c146bee5', icon: `ph-bold ph-caret-${this.showItems ? 'up' : 'down'}`, customClass: this.getIconClass() })))), this.showItems && (h("div", { key: 'dd3e05d2d747a9f2969b1867d5e883c3d2c5c517', class: "absolute z-50 top-40 left-0" }, h("sula-menu-select-list", { key: '517da1a8d2d994e507b478e77a85910818d32d20', items: this.items, onItemSelected: this.handleItemSelected }))))));
|
|
95
95
|
}
|
|
96
96
|
static get style() { return sulaChipCss; }
|
|
97
97
|
}, [1, "sula-chip", {
|
|
@@ -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$3 } from './p-
|
|
3
|
-
import { d as defineCustomElement$2 } from './p-
|
|
2
|
+
import { d as defineCustomElement$3 } from './p-DO7voMbe.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './p-CFhhi4NQ.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}.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}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.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)}.placeholder\\:text-text-secondary::placeholder{color:var(--color-text-secondary)}.max-h-\\[260px\\]{max-height:260px}.overflow-auto{overflow:auto}.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)}";
|
|
6
6
|
|
|
@@ -106,12 +106,12 @@ const SulaDropdown$1 = /*@__PURE__*/ proxyCustomElement(class SulaDropdown exten
|
|
|
106
106
|
}
|
|
107
107
|
render() {
|
|
108
108
|
var _a;
|
|
109
|
-
return (h(Host, { key: '
|
|
109
|
+
return (h(Host, { key: 'c0731dd4a3330060b4ecdcb0b2c3b466c99e661b', ref: node => (this.node = node) }, h("div", { key: 'bfa63d3d6b5ff252e58f2481e7ac6375a12c5231', class: {
|
|
110
110
|
'flex justify-between items-center border border-line-input h-[72px] px-16 rounded-xl relative': true,
|
|
111
111
|
'bg-surface-body cursor-pointer': !this.disabled,
|
|
112
112
|
'bg-states-bg-disabled': this.disabled,
|
|
113
113
|
'dropdown-focus': this.isFocused,
|
|
114
|
-
}, onClick: this.handleClick, tabIndex: 0, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("div", { key: '
|
|
114
|
+
}, onClick: this.handleClick, tabIndex: 0, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("div", { key: '39fdd29d16d7fe521d177e5399f3ab513e4f2c55', class: "flex flex-col w-full" }, h("label", { key: '850a0be8c1e4e6b4b7fa89c390de5252bcd9b191', class: {
|
|
115
115
|
'text-base leading-4': !this.selectedItem && !(this.searchable && this.showItems),
|
|
116
116
|
'text-sm leading-4 font-bold': !!this.selectedItem || (this.searchable && this.showItems),
|
|
117
117
|
'text-text-primary': !this.disabled,
|
|
@@ -120,7 +120,7 @@ const SulaDropdown$1 = /*@__PURE__*/ proxyCustomElement(class SulaDropdown exten
|
|
|
120
120
|
'text-base leading-4 pt-4': true,
|
|
121
121
|
'text-text-primary': !this.disabled,
|
|
122
122
|
'text-text-disabled': this.disabled,
|
|
123
|
-
} }, this.selectedItem.title)))), h("div", { key: '
|
|
123
|
+
} }, this.selectedItem.title)))), h("div", { key: '490e4f5be9292edb122f47710b1eb13ce9e1ee13', class: "flex items-center justify-center ml-8 leading-6 text-2xl" }, h("sula-icon", { key: '435f60270144e4b3df3ff7b782585413e4320e68', icon: `ph ph-caret-${this.showItems ? 'up' : 'down'}`, customClass: `${this.getIconClass()} text-2xl` })), this.showItems && (h("div", { key: 'e1fdb4dba1881fd9798bfd4690402e36ddddfe6e', class: "absolute z-50 top-[72px] left-0 w-full" }, (() => {
|
|
124
124
|
const itemsToShow = this.searchable && this.searchTerm.trim() ? this.filteredItems : this.items;
|
|
125
125
|
const showNoResults = this.searchable && this.searchTerm.trim() && itemsToShow.length === 0;
|
|
126
126
|
if (showNoResults) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SulaMenuSelectList$1, d as defineCustomElement$1 } from './p-
|
|
1
|
+
import { S as SulaMenuSelectList$1, d as defineCustomElement$1 } from './p-CFhhi4NQ.js';
|
|
2
2
|
|
|
3
3
|
const SulaMenuSelectList = SulaMenuSelectList$1;
|
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
4
|
-
import { d as defineCustomElement$2 } from './p-
|
|
2
|
+
import { d as defineCustomElement$4, a as SulaButtonAppearance } from './p-CD0__3qt.js';
|
|
3
|
+
import { d as defineCustomElement$3 } from './p-DO7voMbe.js';
|
|
4
|
+
import { d as defineCustomElement$2 } from './p-CkPiwCwQ.js';
|
|
5
5
|
|
|
6
6
|
var SulaModalType;
|
|
7
7
|
(function (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-DO7voMbe.js';
|
|
3
3
|
|
|
4
4
|
var SulaProgressBarAppearance;
|
|
5
5
|
(function (SulaProgressBarAppearance) {
|
|
@@ -74,10 +74,10 @@ const SulaProgressBar$1 = /*@__PURE__*/ proxyCustomElement(class SulaProgressBar
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
render() {
|
|
77
|
-
return (h(Host, { key: '
|
|
77
|
+
return (h(Host, { key: 'd584c2e2c020ec016a426650fa48fcd843f0c523' }, h("div", { key: 'f2b4e9940cde1280934377ad3db3bab063a5d28d', class: "flex flex-col w-full space-y-8" }, h("div", { key: '8b597aa608fdb404d98f2cbf8022efb539bf999d', class: "flex justify-between items-center" }, h("label", { key: '73763e3827e31b967310142c65b67a0587691711', class: "text-sm text-text-secondary leading-[14px]" }, this.topLabel), this.getProgressBarStateElement()), h("div", { key: 'd240b3850e4dfccea231fbdda5bd8366c8c0cc05', style: { width: `${this.progress}%` }, class: {
|
|
78
78
|
'h-12 rounded-xxl': true,
|
|
79
79
|
[this.getProgressBarStyle()]: true,
|
|
80
|
-
} }), h("label", { key: '
|
|
80
|
+
} }), h("label", { key: 'ffe21db4a0c39f1272370acc780b2d3ba061cd53', class: "text-sm text-text-secondary leading-[14px]" }, this.bottomLabel))));
|
|
81
81
|
}
|
|
82
82
|
static get watchers() { return {
|
|
83
83
|
"progress": ["validateProgress"]
|
|
@@ -43,14 +43,14 @@ const SulaRadioButton$1 = /*@__PURE__*/ proxyCustomElement(class SulaRadioButton
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
render() {
|
|
46
|
-
return (h(Host, { key: '
|
|
46
|
+
return (h(Host, { key: '5427806e9da1752271b0b4be480ab0a2039a8ee0' }, h("div", { key: '0f6a35b1263d47bd28aa54dd895976abe8d48159', class: { 'w-fit': true, 'flex items-center': !!this.label }, onClick: this.handleClick }, h("div", { key: 'cf61f1205714408193621f4c8455adecf2798dcb', class: {
|
|
47
47
|
'min-w-[30px] min-h-[30px] rounded-full flex justify-center items-center outline-none': true,
|
|
48
48
|
'active:bg-states-empty-bg-pressed cursor-pointer': !this.disabled,
|
|
49
49
|
'bg-brand-primary': this.checked,
|
|
50
50
|
'border border-line-input': !this.checked,
|
|
51
51
|
'container-focus': this.radioIsFocus,
|
|
52
52
|
'bg-states-bg-disabled border-2 border-states-bg-disabled cursor-not-allowed': this.disabled,
|
|
53
|
-
}, tabIndex: 0, onFocus: this.handleFocus, onBlur: this.handleFocusOut }, this.checked && h("div", { key: '
|
|
53
|
+
}, tabIndex: 0, onFocus: this.handleFocus, onBlur: this.handleFocusOut }, this.checked && h("div", { key: 'e8c87ab372235aac8ce7258d1a91081b63a519eb', class: "bg-transparent border-2 border-negative-negative-1 w-[18px] h-[18px] rounded-full" })), this.label && h("label", { key: 'b7fdb7bdf9e8aaa5e5049cac408b24e912a4399a', class: { 'ml-16 text-base text-text-primary': true, 'cursor-pointer': !this.disabled } }, this.label))));
|
|
54
54
|
}
|
|
55
55
|
static get style() { return sulaRadioButtonCss; }
|
|
56
56
|
}, [1, "sula-radio-button", {
|
|
@@ -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-DO7voMbe.js';
|
|
3
3
|
|
|
4
4
|
var SulaSearchBarStyle;
|
|
5
5
|
(function (SulaSearchBarStyle) {
|
|
@@ -59,11 +59,11 @@ const SulaSearchBar$1 = /*@__PURE__*/ proxyCustomElement(class SulaSearchBar ext
|
|
|
59
59
|
return style[this.searchBarStyle];
|
|
60
60
|
}
|
|
61
61
|
render() {
|
|
62
|
-
return (h(Host, { key: '
|
|
62
|
+
return (h(Host, { key: 'e5d8f7608d743e75d2071dde601f3bbb295cc415' }, h("div", { key: '84e01e17c71129cce09372b1a76ed486ce3d168b', class: {
|
|
63
63
|
'flex flex-row items-center space-x-12 px-16 rounded-xxl h-44 caret-brand-primary outline-none group': true,
|
|
64
64
|
[this.getStyleClass()]: true,
|
|
65
65
|
'search-bar-focus': this.isFocused,
|
|
66
|
-
}, tabIndex: 0, onFocus: this.handleInputFocus, onClick: this.handleInputFocus }, !this.isFocused && this.leftIcon && (h("div", { key: '
|
|
66
|
+
}, tabIndex: 0, onFocus: this.handleInputFocus, onClick: this.handleInputFocus }, !this.isFocused && this.leftIcon && (h("div", { key: 'f8f61d01078eea0273ca1eabdea401f841a7931a', class: "flex justify-center items-center leading-6" }, h("sula-icon", { key: '6567a11f541d140dac9303607371c7e2f8b04f96', icon: this.leftIcon, customClass: "text-2xl text-icon-primary group-hover:text-brand-primary" }))), h("input", { key: '69dc721e94529cb2f6c22baa9fd917754d7e0dff', ref: node => (this.inputElement = node), type: "text", class: "outline-none border-none w-full bg-transparent text-text-primary", placeholder: this.placeholder, onBlur: this.handleInputBlur, value: this.value, onInput: this.handleValueChanges }), this.rightIcon && (h("div", { key: '5b3b9aca94cf85dcef78605738e05900838efcf6', class: "flex justify-center items-center leading-6 cursor-pointer", onClick: this.handleRightIconClick, onMouseDown: e => e.preventDefault() }, h("sula-icon", { key: '04a65741683ccf50852e3015c085ffc5714bb0f6', icon: this.rightIcon, customClass: "text-2xl text-icon-primary" }))))));
|
|
67
67
|
}
|
|
68
68
|
static get style() { return sulaSearchBarCss; }
|
|
69
69
|
}, [1, "sula-search-bar", {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SulaSegmentedControl extends Components.SulaSegmentedControl, HTMLElement {}
|
|
4
|
+
export const SulaSegmentedControl: {
|
|
5
|
+
prototype: SulaSegmentedControl;
|
|
6
|
+
new (): SulaSegmentedControl;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
+
import { d as defineCustomElement$2 } from './p-DO7voMbe.js';
|
|
3
|
+
|
|
4
|
+
var SulaSegmentedControlType;
|
|
5
|
+
(function (SulaSegmentedControlType) {
|
|
6
|
+
SulaSegmentedControlType["Icon"] = "icon";
|
|
7
|
+
SulaSegmentedControlType["Text"] = "text";
|
|
8
|
+
})(SulaSegmentedControlType || (SulaSegmentedControlType = {}));
|
|
9
|
+
var SulaSegmentedControlSize;
|
|
10
|
+
(function (SulaSegmentedControlSize) {
|
|
11
|
+
SulaSegmentedControlSize["Small"] = "small";
|
|
12
|
+
SulaSegmentedControlSize["Default"] = "default";
|
|
13
|
+
})(SulaSegmentedControlSize || (SulaSegmentedControlSize = {}));
|
|
14
|
+
var SulaSegmentedControlColor;
|
|
15
|
+
(function (SulaSegmentedControlColor) {
|
|
16
|
+
SulaSegmentedControlColor["White"] = "white";
|
|
17
|
+
SulaSegmentedControlColor["Gray"] = "gray";
|
|
18
|
+
})(SulaSegmentedControlColor || (SulaSegmentedControlColor = {}));
|
|
19
|
+
|
|
20
|
+
const sulaSegmentedControlCss = "*,: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}.ml-4{margin-left:.25rem}.flex{display:flex}.w-fit{width:fit-content}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.items-center{align-items:center}.justify-center{justify-content:center}.rounded-3xl{border-radius:1.5rem}.rounded-xxl{border-radius:18.75rem}.bg-box-shadow-body{background-color:var(--color-box-shadow-body)}.bg-brand-primary{background-color:var(--color-brand-primary)}.bg-opacity-body{background-color:var(--color-opacity-body)}.bg-opacity-on-body{background-color:var(--color-opacity-on-body)}.p-2{padding:.125rem}.px-16{padding-left:1rem;padding-right:1rem}.px-20{padding-left:1.25rem;padding-right:1.25rem}.py-12{padding-bottom:.75rem;padding-top:.75rem}.py-8{padding-bottom:.5rem;padding-top:.5rem}.text-base{font-size:1rem;line-height:1.5rem}.text-label-medium-bold{font-size:1rem;font-weight:700;letter-spacing:0;line-height:20px}.text-paragraph-medium-regular{font-size:1rem;font-weight:400;letter-spacing:0;line-height:24px}.text-xl{font-size:1.25rem;line-height:1.75rem}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.text-brand-primary{color:var(--color-brand-primary)}.text-icon-primary{color:var(--color-icon-primary)}.text-negative-negative-1{color:var(--color-negative-negative-1)}.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)}.backdrop-blur-\\[20px\\]{--tw-backdrop-blur:blur(20px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\\:bg-box-shadow-body:hover{background-color:var(--color-box-shadow-body)}";
|
|
21
|
+
|
|
22
|
+
const SulaSegmentedControl$1 = /*@__PURE__*/ proxyCustomElement(class SulaSegmentedControl extends H {
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
this.__registerHost();
|
|
26
|
+
this.__attachShadow();
|
|
27
|
+
this.itemClicked = createEvent(this, "itemClicked");
|
|
28
|
+
this.itemHovered = createEvent(this, "itemHovered");
|
|
29
|
+
this.itemBlur = createEvent(this, "itemBlur");
|
|
30
|
+
/**
|
|
31
|
+
* Items for the segmented control.
|
|
32
|
+
*/
|
|
33
|
+
this.items = [];
|
|
34
|
+
/**
|
|
35
|
+
* Segmented control type.
|
|
36
|
+
*/
|
|
37
|
+
this.type = SulaSegmentedControlType.Text;
|
|
38
|
+
/**
|
|
39
|
+
* Segmented control size.
|
|
40
|
+
*/
|
|
41
|
+
this.size = SulaSegmentedControlSize.Default;
|
|
42
|
+
/**
|
|
43
|
+
* Segmented control color.
|
|
44
|
+
*/
|
|
45
|
+
this.color = SulaSegmentedControlColor.White;
|
|
46
|
+
}
|
|
47
|
+
handleItemClick(selectedItem) {
|
|
48
|
+
this.items = this.items.map(item => (Object.assign(Object.assign({}, item), { selected: item.value === selectedItem.value })));
|
|
49
|
+
this.itemClicked.emit(Object.assign(Object.assign({}, selectedItem), { selected: true }));
|
|
50
|
+
}
|
|
51
|
+
handleItemHover(hoveredItem) {
|
|
52
|
+
this.itemHovered.emit(hoveredItem);
|
|
53
|
+
}
|
|
54
|
+
handleItemBlur(blurredItem) {
|
|
55
|
+
this.itemBlur.emit(blurredItem);
|
|
56
|
+
}
|
|
57
|
+
getCaretIconClass(item) {
|
|
58
|
+
if (this.type === SulaSegmentedControlType.Icon) {
|
|
59
|
+
return item.selected ? 'text-negative-negative-1' : 'text-icon-primary';
|
|
60
|
+
}
|
|
61
|
+
return item.selected ? 'text-brand-primary' : 'text-text-primary';
|
|
62
|
+
}
|
|
63
|
+
render() {
|
|
64
|
+
return (h(Host, { key: '047229bea44614f1b7570d405d342c1924e7f368' }, h("div", { key: '14df0e4cf5316c609a5961c7b5a9e2adf75efdda', class: {
|
|
65
|
+
'flex flex-row items-center rounded-xxl p-2 w-fit backdrop-blur-[20px]': true,
|
|
66
|
+
'bg-opacity-on-body': this.color === SulaSegmentedControlColor.Gray,
|
|
67
|
+
'bg-opacity-body': this.color === SulaSegmentedControlColor.White,
|
|
68
|
+
} }, this.items.map(item => (h("div", { class: {
|
|
69
|
+
'rounded-3xl flex justify-center items-center cursor-pointer transition': true,
|
|
70
|
+
'py-12 px-20': this.size === SulaSegmentedControlSize.Default,
|
|
71
|
+
'py-8 px-16': this.size === SulaSegmentedControlSize.Small,
|
|
72
|
+
'bg-box-shadow-body': this.type === SulaSegmentedControlType.Text && item.selected,
|
|
73
|
+
'bg-brand-primary': this.type === SulaSegmentedControlType.Icon && item.selected,
|
|
74
|
+
'hover:bg-box-shadow-body': !item.selected,
|
|
75
|
+
}, onClick: () => this.handleItemClick(item), onMouseEnter: () => this.handleItemHover(item), onMouseLeave: () => this.handleItemBlur(item) }, this.type === SulaSegmentedControlType.Text ? (h("span", { class: {
|
|
76
|
+
'text-brand-primary text-label-medium-bold leading-5': item.selected,
|
|
77
|
+
'text-text-secondary text-paragraph-medium-regular leading-5': !item.selected,
|
|
78
|
+
} }, item.label)) : (h("sula-icon", { class: "flex items-center justify-center", icon: item.icon, customClass: `${item.selected ? 'text-negative-negative-1' : 'text-icon-primary'} text-xl leading-4` })), item.addChevron && h("sula-icon", { class: "ml-4 flex", icon: "ph-bold ph-caret-down", customClass: `${this.getCaretIconClass(item)} text-base leading-4` })))))));
|
|
79
|
+
}
|
|
80
|
+
static get style() { return sulaSegmentedControlCss; }
|
|
81
|
+
}, [1, "sula-segmented-control", {
|
|
82
|
+
"items": [1040],
|
|
83
|
+
"type": [1025],
|
|
84
|
+
"size": [1025],
|
|
85
|
+
"color": [1025]
|
|
86
|
+
}]);
|
|
87
|
+
function defineCustomElement$1() {
|
|
88
|
+
if (typeof customElements === "undefined") {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const components = ["sula-segmented-control", "sula-icon"];
|
|
92
|
+
components.forEach(tagName => { switch (tagName) {
|
|
93
|
+
case "sula-segmented-control":
|
|
94
|
+
if (!customElements.get(tagName)) {
|
|
95
|
+
customElements.define(tagName, SulaSegmentedControl$1);
|
|
96
|
+
}
|
|
97
|
+
break;
|
|
98
|
+
case "sula-icon":
|
|
99
|
+
if (!customElements.get(tagName)) {
|
|
100
|
+
defineCustomElement$2();
|
|
101
|
+
}
|
|
102
|
+
break;
|
|
103
|
+
} });
|
|
104
|
+
}
|
|
105
|
+
defineCustomElement$1();
|
|
106
|
+
|
|
107
|
+
const SulaSegmentedControl = SulaSegmentedControl$1;
|
|
108
|
+
const defineCustomElement = defineCustomElement$1;
|
|
109
|
+
|
|
110
|
+
export { SulaSegmentedControl, defineCustomElement };
|
|
111
|
+
//# sourceMappingURL=sula-segmented-control.js.map
|
|
112
|
+
|
|
113
|
+
//# sourceMappingURL=sula-segmented-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"sula-segmented-control.js","mappings":";;;AAAA,IAAY,wBAGX;AAHD,CAAA,UAAY,wBAAwB,EAAA;AAClC,IAAA,wBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,wBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EAHW,wBAAwB,KAAxB,wBAAwB,GAGnC,EAAA,CAAA,CAAA;AAED,IAAY,wBAGX;AAHD,CAAA,UAAY,wBAAwB,EAAA;AAClC,IAAA,wBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,wBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACrB,CAAC,EAHW,wBAAwB,KAAxB,wBAAwB,GAGnC,EAAA,CAAA,CAAA;AAED,IAAY,yBAGX;AAHD,CAAA,UAAY,yBAAyB,EAAA;AACnC,IAAA,yBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,yBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EAHW,yBAAyB,KAAzB,yBAAyB,GAGpC,EAAA,CAAA,CAAA;;ACbD,MAAM,uBAAuB,GAAG,sxWAAsxW;;MCQzyWA,sBAAoB,iBAAAC,kBAAA,CAAA,MAAA,oBAAA,SAAAC,CAAA,CAAA;AALjC,IAAA,WAAA,GAAA;;;;;;;AAME;;AAEG;AAEH,QAAA,IAAK,CAAA,KAAA,GAAiC,EAAE;AAExC;;AAEG;AAEH,QAAA,IAAA,CAAA,IAAI,GAA6B,wBAAwB,CAAC,IAAI;AAE9D;;AAEG;AAEH,QAAA,IAAA,CAAA,IAAI,GAA6B,wBAAwB,CAAC,OAAO;AAEjE;;AAEG;AAEH,QAAA,IAAA,CAAA,KAAK,GAA8B,yBAAyB,CAAC,KAAK;AA2FnE;AAvEC,IAAA,eAAe,CAAC,YAAwC,EAAA;AACtD,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,KAC3B,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,IAAI,CACP,EAAA,EAAA,QAAQ,EAAE,IAAI,CAAC,KAAK,KAAK,YAAY,CAAC,KAAK,EAC3C,CAAA,CAAA,CAAC;QAEH,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAM,YAAY,CAAA,EAAA,EAAE,QAAQ,EAAE,IAAI,EAAA,CAAA,CAAG;;AAG5D,IAAA,eAAe,CAAC,WAAuC,EAAA;AACrD,QAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC;;AAGpC,IAAA,cAAc,CAAC,WAAuC,EAAA;AACpD,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC;;AAGjC,IAAA,iBAAiB,CAAC,IAAgC,EAAA;QAChD,IAAI,IAAI,CAAC,IAAI,KAAK,wBAAwB,CAAC,IAAI,EAAE;YAC/C,OAAO,IAAI,CAAC,QAAQ,GAAG,0BAA0B,GAAG,mBAAmB;;QAEzE,OAAO,IAAI,CAAC,QAAQ,GAAG,oBAAoB,GAAG,mBAAmB;;IAGnE,MAAM,GAAA;QACJ,QACE,EAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACH,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,KAAK,EAAE;AACL,gBAAA,uEAAuE,EAAE,IAAI;AAC7E,gBAAA,oBAAoB,EAAE,IAAI,CAAC,KAAK,KAAK,yBAAyB,CAAC,IAAI;AACnE,gBAAA,iBAAiB,EAAE,IAAI,CAAC,KAAK,KAAK,yBAAyB,CAAC,KAAK;AAClE,aAAA,EAAA,EAEA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,KAClB,CAAA,CAAA,KAAA,EAAA,EACE,KAAK,EAAE;AACL,gBAAA,wEAAwE,EAAE,IAAI;AAC9E,gBAAA,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,wBAAwB,CAAC,OAAO;AAC7D,gBAAA,YAAY,EAAE,IAAI,CAAC,IAAI,KAAK,wBAAwB,CAAC,KAAK;gBAC1D,oBAAoB,EAAE,IAAI,CAAC,IAAI,KAAK,wBAAwB,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ;gBAClF,kBAAkB,EAAE,IAAI,CAAC,IAAI,KAAK,wBAAwB,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ;AAChF,gBAAA,0BAA0B,EAAE,CAAC,IAAI,CAAC,QAAQ;aAC3C,EACD,OAAO,EAAE,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EACzC,YAAY,EAAE,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAC9C,YAAY,EAAE,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAA,EAE5C,IAAI,CAAC,IAAI,KAAK,wBAAwB,CAAC,IAAI,IAC1C,CACE,CAAA,MAAA,EAAA,EAAA,KAAK,EAAE;gBACL,qDAAqD,EAAE,IAAI,CAAC,QAAQ;AACpE,gBAAA,6DAA6D,EAAE,CAAC,IAAI,CAAC,QAAQ;AAC9E,aAAA,EAAA,EAEA,IAAI,CAAC,KAAK,CACN,KAEP,CAAA,CAAA,WAAA,EAAA,EACE,KAAK,EAAC,kCAAkC,EACxC,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,WAAW,EAAE,CAAA,EAAG,IAAI,CAAC,QAAQ,GAAG,0BAA0B,GAAG,mBAAmB,CAAoB,kBAAA,CAAA,GACzF,CACd,EACA,IAAI,CAAC,UAAU,IAAI,CAAA,CAAA,WAAA,EAAA,EAAW,KAAK,EAAC,WAAW,EAAC,IAAI,EAAC,uBAAuB,EAAC,WAAW,EAAE,CAAG,EAAA,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAsB,oBAAA,CAAA,EAAc,CAAA,CAC1J,CACP,CAAC,CACE,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SulaSegmentedControl","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/sula-segmented-control/model/sula-segmented-control.model.ts","src/components/sula-segmented-control/sula-segmented-control.scss?tag=sula-segmented-control&encapsulation=shadow","src/components/sula-segmented-control/sula-segmented-control.tsx"],"sourcesContent":["export enum SulaSegmentedControlType {\n Icon = 'icon',\n Text = 'text',\n}\n\nexport enum SulaSegmentedControlSize {\n Small = 'small',\n Default = 'default',\n}\n\nexport enum SulaSegmentedControlColor {\n White = 'white',\n Gray = 'gray',\n}\n\nexport interface SulaSegmentedControlOption {\n label?: string;\n addChevron?: boolean;\n value: string | number;\n icon?: string;\n selected?: boolean;\n}\n",":host {\n display: block;\n}\n","import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport { SulaSegmentedControlColor, SulaSegmentedControlOption, SulaSegmentedControlSize, SulaSegmentedControlType } from './model/sula-segmented-control.model';\n\n@Component({\n tag: 'sula-segmented-control',\n styleUrl: 'sula-segmented-control.scss',\n shadow: true,\n})\nexport class SulaSegmentedControl {\n /**\n * Items for the segmented control.\n */\n @Prop({ mutable: true })\n items: SulaSegmentedControlOption[] = [];\n\n /**\n * Segmented control type.\n */\n @Prop({ mutable: true })\n type: SulaSegmentedControlType = SulaSegmentedControlType.Text;\n\n /**\n * Segmented control size.\n */\n @Prop({ mutable: true })\n size: SulaSegmentedControlSize = SulaSegmentedControlSize.Default;\n\n /**\n * Segmented control color.\n */\n @Prop({ mutable: true })\n color: SulaSegmentedControlColor = SulaSegmentedControlColor.White;\n\n /**\n * Emitted when an item is clicked.\n */\n @Event()\n itemClicked: EventEmitter<SulaSegmentedControlOption>;\n\n /**\n * Emitted when an item is hovered.\n */\n @Event()\n itemHovered: EventEmitter<SulaSegmentedControlOption>;\n\n /**\n * Emitted when an item is blurred.\n */\n @Event()\n itemBlur: EventEmitter<SulaSegmentedControlOption>;\n\n handleItemClick(selectedItem: SulaSegmentedControlOption) {\n this.items = this.items.map(item => ({\n ...item,\n selected: item.value === selectedItem.value,\n }));\n\n this.itemClicked.emit({ ...selectedItem, selected: true });\n }\n\n handleItemHover(hoveredItem: SulaSegmentedControlOption) {\n this.itemHovered.emit(hoveredItem);\n }\n\n handleItemBlur(blurredItem: SulaSegmentedControlOption) {\n this.itemBlur.emit(blurredItem);\n }\n\n getCaretIconClass(item: SulaSegmentedControlOption) {\n if (this.type === SulaSegmentedControlType.Icon) {\n return item.selected ? 'text-negative-negative-1' : 'text-icon-primary';\n }\n return item.selected ? 'text-brand-primary' : 'text-text-primary';\n }\n\n render() {\n return (\n <Host>\n <div\n class={{\n 'flex flex-row items-center rounded-xxl p-2 w-fit backdrop-blur-[20px]': true,\n 'bg-opacity-on-body': this.color === SulaSegmentedControlColor.Gray,\n 'bg-opacity-body': this.color === SulaSegmentedControlColor.White,\n }}\n >\n {this.items.map(item => (\n <div\n class={{\n 'rounded-3xl flex justify-center items-center cursor-pointer transition': true,\n 'py-12 px-20': this.size === SulaSegmentedControlSize.Default,\n 'py-8 px-16': this.size === SulaSegmentedControlSize.Small,\n 'bg-box-shadow-body': this.type === SulaSegmentedControlType.Text && item.selected,\n 'bg-brand-primary': this.type === SulaSegmentedControlType.Icon && item.selected,\n 'hover:bg-box-shadow-body': !item.selected,\n }}\n onClick={() => this.handleItemClick(item)}\n onMouseEnter={() => this.handleItemHover(item)}\n onMouseLeave={() => this.handleItemBlur(item)}\n >\n {this.type === SulaSegmentedControlType.Text ? (\n <span\n class={{\n 'text-brand-primary text-label-medium-bold leading-5': item.selected,\n 'text-text-secondary text-paragraph-medium-regular leading-5': !item.selected,\n }}\n >\n {item.label}\n </span>\n ) : (\n <sula-icon\n class=\"flex items-center justify-center\"\n icon={item.icon}\n customClass={`${item.selected ? 'text-negative-negative-1' : 'text-icon-primary'} text-xl leading-4`}\n ></sula-icon>\n )}\n {item.addChevron && <sula-icon class=\"ml-4 flex\" icon=\"ph-bold ph-caret-down\" customClass={`${this.getCaretIconClass(item)} text-base leading-4`}></sula-icon>}\n </div>\n ))}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -49,23 +49,23 @@ const SulaSwitch$1 = /*@__PURE__*/ proxyCustomElement(class SulaSwitch extends H
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
render() {
|
|
52
|
-
return (h(Host, { key: '
|
|
52
|
+
return (h(Host, { key: '5147ccb90d8e6a9b3de3eaa1ceefb3dd4e655f37' }, h("div", { key: 'ebae10c01afe26b23afcbaa86bab531fe56e617f', class: {
|
|
53
53
|
'outline-none': true,
|
|
54
54
|
'flex items-center space-x-12': !!this.label && this.type === SulaSwitchType.Default,
|
|
55
55
|
'flex items-center justify-between bg-surface-on-body rounded-md w-[280px] min-h-[85px] px-24 py-16': this.type === SulaSwitchType.List,
|
|
56
56
|
'hover:bg-states-empty-bg-hover active:bg-states-empty-bg-pressed cursor-pointer': this.type === SulaSwitchType.List && !this.disabled,
|
|
57
57
|
'container-focus': this.isFocus && this.type === SulaSwitchType.List,
|
|
58
|
-
}, onFocus: this.handleFocus, onBlur: this.handleBlur, onClick: this.handleClick, tabIndex: 0 }, this.type === SulaSwitchType.List && (h("div", { key: '
|
|
58
|
+
}, onFocus: this.handleFocus, onBlur: this.handleBlur, onClick: this.handleClick, tabIndex: 0 }, this.type === SulaSwitchType.List && (h("div", { key: '6e3132438518dee7a1337db52a204387d2828ec3', class: "flex flex-col flex-1 mr-16 overflow-hidden" }, !!this.label && h("label", { key: '830b2c235cc07efb236f6a86d90dd7d62b3b776a', class: "text-text-primary font-bold text-base cursor-pointer break-words" }, this.label), !!this.subTitle && h("span", { key: 'd085e4e303aad5b75d275d894f03b0e9ea201a47', class: "text-text-secondary text-base break-words" }, this.subTitle))), h("div", { key: 'ff6f20db45aa6c0050b233ff541f8973cd5f4244', class: {
|
|
59
59
|
'switch-container w-56 h-32 flex items-center rounded-xxl p-2 outline-none': true,
|
|
60
60
|
'switch-on bg-brand-primary justify-end': this.active,
|
|
61
61
|
'switch-off bg-neutral-neutral-3 justify-start': !this.active,
|
|
62
62
|
'cursor-not-allowed bg-states-bg-disabled': this.disabled,
|
|
63
63
|
'switch-focus': this.isFocus && this.type === SulaSwitchType.Default,
|
|
64
|
-
}, tabIndex: 0, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("div", { key: '
|
|
64
|
+
}, tabIndex: 0, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("div", { key: 'e43cca2e88a20a524201ed0d785a8ba81ed8a4f7', class: {
|
|
65
65
|
'switch-thumb w-[28px] h-[28px] rounded-full flex justify-center items-center': true,
|
|
66
66
|
'bg-negative-negative-1': !this.disabled,
|
|
67
67
|
'bg-states-bg-disabled shadow-md': this.disabled,
|
|
68
|
-
} }, h("div", { key: '
|
|
68
|
+
} }, h("div", { key: '248043d5d4e7e53718563cc722937644362c47bf', class: {
|
|
69
69
|
'switch-indicator rounded-full': true,
|
|
70
70
|
'switch-indicator-on w-12 h-12 bg-brand-primary': this.active,
|
|
71
71
|
'switch-indicator-off w-[10px] h-4 bg-neutral-neutral-4': !this.active,
|