@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
|
@@ -18,7 +18,7 @@ var patchBrowser = () => {
|
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(async (options) => {
|
|
20
20
|
await index.globalScripts();
|
|
21
|
-
return index.bootstrapLazy([["sula-
|
|
21
|
+
return index.bootstrapLazy([["sula-avatar_21.cjs",[[1,"sula-modal",{"opened":[1028],"blockBodyScroll":[1028,"block-body-scroll"],"closeOnClickOutside":[1028,"close-on-click-outside"],"type":[1],"headerIcon":[1,"header-icon"],"modalTitle":[1,"modal-title"],"promoImage":[1,"promo-image"],"subTitle":[1,"sub-title"],"primaryButtonText":[1,"primary-button-text"],"secondaryButtonText":[1,"secondary-button-text"],"slotOverflow":[1,"slot-overflow"],"isAnimating":[32],"shouldRender":[32]},null,{"opened":["handleOpenedChange"]}],[1,"sula-chip",{"text":[1025],"appearance":[1025],"disabled":[1028],"items":[1040],"isFocused":[32],"showItems":[32]},[[4,"click","handleDocumentClick"]]],[1,"sula-dropdown",{"label":[1025],"disabled":[1028],"items":[1040],"value":[1040],"searchable":[516],"selectedItem":[32],"showItems":[32],"isFocused":[32],"searchTerm":[32],"filteredItems":[32]},[[4,"click","handleDocumentClick"]],{"value":["handleValueChange"],"showItems":["handleShowItemsChange"]}],[1,"sula-avatar",{"size":[1],"imageUrl":[1,"image-url"],"text":[1],"icon":[1]}],[1,"sula-badge",{"status":[1025],"size":[1025],"type":[1025],"text":[1025],"icon":[1025],"hasSlotContent":[32]}],[1,"sula-breadcrumb",{"items":[1040]}],[1,"sula-checkbox",{"type":[1025],"label":[1025],"subTitle":[1025,"sub-title"],"disabled":[1028],"checked":[1028],"isFocus":[32]}],[1,"sula-progress-bar",{"appearance":[1025],"state":[1025],"topLabel":[1025,"top-label"],"bottomLabel":[1025,"bottom-label"],"progress":[1026],"showProgress":[1028,"show-progress"]},null,{"progress":["validateProgress"]}],[1,"sula-search-bar",{"value":[1025],"searchBarStyle":[1025,"search-bar-style"],"placeholder":[1025],"leftIcon":[1025,"left-icon"],"rightIcon":[1025,"right-icon"],"isFocused":[32],"textValue":[32]}],[1,"sula-segmented-control",{"items":[1040],"type":[1025],"size":[1025],"color":[1025]}],[1,"sula-tag",{"label":[1025],"icon":[1025],"iconStatus":[1025,"icon-status"],"size":[1025],"appearance":[1025],"fontWeight":[1025,"font-weight"]}],[1,"sula-textfield",{"value":[1025],"type":[1],"status":[1025],"label":[1],"placeholder":[1],"disabled":[1028],"helpText":[1,"help-text"],"maxLength":[2,"max-length"],"icon":[1],"maskPattern":[1,"mask-pattern"],"inputIsOpen":[32],"textValue":[32],"showPassword":[32],"inputIsFocused":[32]},[[4,"click","handleClick"]],{"value":["watchValueHandler"]}],[1,"sula-tiles",{"type":[1],"size":[1],"ellipsis":[4],"icon":[1],"text":[1],"subText":[1,"sub-text"],"disabled":[4]}],[1,"sula-timeline-list",{"sulaTimelineList":[1040,"sula-timeline-list"]}],[1,"sula-radio-button",{"checked":[1028],"label":[1025],"disabled":[1028],"radioIsFocus":[32]}],[1,"sula-switch",{"type":[1025],"active":[1028],"disabled":[1028],"label":[1025],"subTitle":[1025,"sub-title"],"isFocus":[32]}],[1,"sula-textarea",{"value":[1025],"status":[1025],"label":[1],"placeholder":[1],"disabled":[1028],"helpText":[1,"help-text"],"maxLength":[2,"max-length"],"rows":[2],"isActive":[32],"textValue":[32],"textareaIsFocused":[32],"labelPadding":[32]},[[4,"click","handleClick"]],{"value":["watchValueHandler"]}],[1,"sula-button",{"text":[1025],"icon":[1025],"leftIcon":[1025,"left-icon"],"rightIcon":[1025,"right-icon"],"appearance":[1025],"type":[1025],"size":[1025],"status":[1025],"loading":[1028],"buttonDisabled":[1028,"button-disabled"],"fullWidth":[1028,"full-width"]}],[1,"sula-loader",{"size":[1],"animationInstance":[32]}],[1,"sula-menu-select-list",{"items":[1040],"fullWidth":[4,"full-width"],"selectedValue":[16,"selected-value"]}],[0,"sula-icon",{"icon":[1],"customClass":[1,"custom-class"]}]]]], options);
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
exports.setNonce = index.setNonce;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"entries": [
|
|
3
3
|
"components/sula-avatar/sula-avatar.js",
|
|
4
4
|
"components/sula-badge/sula-badge.js",
|
|
5
|
+
"components/sula-breadcrumb/sula-breadcrumb.js",
|
|
5
6
|
"components/sula-button/sula-button.js",
|
|
6
7
|
"components/sula-checkbox/sula-checkbox.js",
|
|
7
8
|
"components/sula-chip/sula-chip.js",
|
|
@@ -13,6 +14,7 @@
|
|
|
13
14
|
"components/sula-progress-bar/sula-progress-bar.js",
|
|
14
15
|
"components/sula-radio-button/sula-radio-button.js",
|
|
15
16
|
"components/sula-search-bar/sula-search-bar.js",
|
|
17
|
+
"components/sula-segmented-control/sula-segmented-control.js",
|
|
16
18
|
"components/sula-switch/sula-switch.js",
|
|
17
19
|
"components/sula-tag/sula-tag.js",
|
|
18
20
|
"components/sula-textarea/sula-textarea.js",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sula-breadcrumb.model.js","sourceRoot":"","sources":["../../../../src/components/sula-breadcrumb/model/sula-breadcrumb.model.ts"],"names":[],"mappings":"","sourcesContent":["export interface SulaMenuBreadcrumb {\n id?: string | number;\n title: string;\n path?: string;\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,: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-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--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;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: ;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-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--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;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! 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}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class SulaBreadcrumb {
|
|
3
|
+
constructor() {
|
|
4
|
+
/**
|
|
5
|
+
* Breadcrumb items list
|
|
6
|
+
*/
|
|
7
|
+
this.items = [];
|
|
8
|
+
}
|
|
9
|
+
handleItemClick(item, isActive) {
|
|
10
|
+
if (isActive || !item.path)
|
|
11
|
+
return;
|
|
12
|
+
this.breadcrumbItemClicked.emit(item);
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
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) => {
|
|
16
|
+
const isActive = index === this.items.length - 1;
|
|
17
|
+
const hasPath = !!item.path && !isActive;
|
|
18
|
+
return (h("li", { class: "flex items-center" }, h("a", { class: {
|
|
19
|
+
'text-paragraph-medium-bold align-middle transition-colors duration-200': true,
|
|
20
|
+
'tracking-[-0.01em]': true,
|
|
21
|
+
'no-underline': true,
|
|
22
|
+
'text-text-secondary cursor-default': !isActive,
|
|
23
|
+
'text-brand-primary cursor-default': isActive,
|
|
24
|
+
'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,
|
|
25
|
+
'active:text-text-secondary active:underline active:decoration-solid active:decoration-1 active:decoration-skip-ink-auto': hasPath && !isActive,
|
|
26
|
+
}, href: hasPath ? item.path : undefined, "aria-current": isActive ? 'page' : undefined, onClick: e => {
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
this.handleItemClick(item, isActive);
|
|
29
|
+
} }, 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" })))));
|
|
30
|
+
})))));
|
|
31
|
+
}
|
|
32
|
+
static get is() { return "sula-breadcrumb"; }
|
|
33
|
+
static get encapsulation() { return "shadow"; }
|
|
34
|
+
static get originalStyleUrls() {
|
|
35
|
+
return {
|
|
36
|
+
"$": ["sula-breadcrumb.scss"]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
static get styleUrls() {
|
|
40
|
+
return {
|
|
41
|
+
"$": ["sula-breadcrumb.css"]
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
static get properties() {
|
|
45
|
+
return {
|
|
46
|
+
"items": {
|
|
47
|
+
"type": "unknown",
|
|
48
|
+
"attribute": "items",
|
|
49
|
+
"mutable": true,
|
|
50
|
+
"complexType": {
|
|
51
|
+
"original": "SulaMenuBreadcrumb[]",
|
|
52
|
+
"resolved": "SulaMenuBreadcrumb[]",
|
|
53
|
+
"references": {
|
|
54
|
+
"SulaMenuBreadcrumb": {
|
|
55
|
+
"location": "import",
|
|
56
|
+
"path": "./model/sula-breadcrumb.model",
|
|
57
|
+
"id": "src/components/sula-breadcrumb/model/sula-breadcrumb.model.ts::SulaMenuBreadcrumb"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"required": false,
|
|
62
|
+
"optional": false,
|
|
63
|
+
"docs": {
|
|
64
|
+
"tags": [],
|
|
65
|
+
"text": "Breadcrumb items list"
|
|
66
|
+
},
|
|
67
|
+
"getter": false,
|
|
68
|
+
"setter": false,
|
|
69
|
+
"defaultValue": "[]"
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
static get events() {
|
|
74
|
+
return [{
|
|
75
|
+
"method": "breadcrumbItemClicked",
|
|
76
|
+
"name": "breadcrumbItemClicked",
|
|
77
|
+
"bubbles": true,
|
|
78
|
+
"cancelable": true,
|
|
79
|
+
"composed": true,
|
|
80
|
+
"docs": {
|
|
81
|
+
"tags": [],
|
|
82
|
+
"text": "Event emitted when a breadcrumb item is clicked"
|
|
83
|
+
},
|
|
84
|
+
"complexType": {
|
|
85
|
+
"original": "SulaMenuBreadcrumb",
|
|
86
|
+
"resolved": "SulaMenuBreadcrumb",
|
|
87
|
+
"references": {
|
|
88
|
+
"SulaMenuBreadcrumb": {
|
|
89
|
+
"location": "import",
|
|
90
|
+
"path": "./model/sula-breadcrumb.model",
|
|
91
|
+
"id": "src/components/sula-breadcrumb/model/sula-breadcrumb.model.ts::SulaMenuBreadcrumb"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=sula-breadcrumb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sula-breadcrumb.js","sourceRoot":"","sources":["../../../src/components/sula-breadcrumb/sula-breadcrumb.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAQ9E,MAAM,OAAO,cAAc;IAL3B;QAME;;WAEG;QAEH,UAAK,GAAyB,EAAE,CAAC;KAyDlC;IAjDS,eAAe,CAAC,IAAwB,EAAE,QAAiB;QACjE,IAAI,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,OAAO;QACnC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,4DAAK,KAAK,EAAC,mBAAmB,gBAAY,YAAY;gBACpD,2DAAI,KAAK,EAAC,mBAAmB,IAC1B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;oBAC9B,MAAM,QAAQ,GAAG,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;oBACjD,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC;oBAEzC,OAAO,CACL,UAAI,KAAK,EAAC,mBAAmB;wBAC3B,SACE,KAAK,EAAE;gCACL,wEAAwE,EAAE,IAAI;gCAC9E,oBAAoB,EAAE,IAAI;gCAC1B,cAAc,EAAE,IAAI;gCACpB,oCAAoC,EAAE,CAAC,QAAQ;gCAC/C,mCAAmC,EAAE,QAAQ;gCAC7C,0MAA0M,EAAE,OAAO;gCACnN,yHAAyH,EAAE,OAAO,IAAI,CAAC,QAAQ;6BAChJ,EACD,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,kBACvB,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC3C,OAAO,EAAE,CAAC,CAAC,EAAE;gCACX,CAAC,CAAC,cAAc,EAAE,CAAC;gCACnB,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;4BACvC,CAAC,IAEA,IAAI,CAAC,KAAK,CACT;wBAEH,CAAC,QAAQ,IAAI,CACZ,YAAM,KAAK,EAAC,gCAAgC;4BAC1C,iBAAW,IAAI,EAAC,wBAAwB,EAAC,WAAW,EAAC,wEAAwE,GAAa,CACrI,CACR,CACE,CACN,CAAC;gBACJ,CAAC,CAAC,CACC,CACD,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
title: 'Components/sula-breadcrumb',
|
|
3
|
+
tags: ['autodocs'],
|
|
4
|
+
argTypes: {
|
|
5
|
+
items: {
|
|
6
|
+
control: 'object',
|
|
7
|
+
description: 'Array de itens do breadcrumb com label e link',
|
|
8
|
+
table: {
|
|
9
|
+
type: { summary: 'Array<{id?: string | number, label: string, link?: string}>' },
|
|
10
|
+
defaultValue: { summary: '[]' },
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
breadcrumbItemClicked: {
|
|
14
|
+
action: 'breadcrumbItemClicked',
|
|
15
|
+
description: 'Evento emitido quando um item do breadcrumb é clicado',
|
|
16
|
+
table: {
|
|
17
|
+
type: { summary: 'CustomEvent<SulaMenuBreadcrumb>' },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
parameters: {
|
|
22
|
+
docs: {
|
|
23
|
+
description: {
|
|
24
|
+
component: `
|
|
25
|
+
O componente **Sula Breadcrumb** é utilizado para navegação hierárquica, mostrando a localização
|
|
26
|
+
atual do usuário dentro da estrutura do site ou aplicação.
|
|
27
|
+
|
|
28
|
+
### Características principais:
|
|
29
|
+
- Navegação hierárquica clara
|
|
30
|
+
- Separador usando ícone ph-caret-right
|
|
31
|
+
- Suporte a links e itens não clicáveis
|
|
32
|
+
- Último item sempre aparece em laranja (cor primária) e em negrito
|
|
33
|
+
- Estados: hover, pressed e focused
|
|
34
|
+
`,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
const Template = args => {
|
|
40
|
+
const container = document.createElement('div');
|
|
41
|
+
container.style.margin = '20px';
|
|
42
|
+
container.style.padding = '20px';
|
|
43
|
+
const el = document.createElement('sula-breadcrumb');
|
|
44
|
+
// Define os items como propriedade
|
|
45
|
+
if (args.items && args.items.length > 0) {
|
|
46
|
+
el.items = args.items.map(item => ({
|
|
47
|
+
id: item.id,
|
|
48
|
+
title: item.label,
|
|
49
|
+
path: item.link,
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
// Event listener
|
|
53
|
+
el.addEventListener('breadcrumbItemClicked', e => {
|
|
54
|
+
console.log('Breadcrumb item clicked:', e.detail);
|
|
55
|
+
args.breadcrumbItemClicked(e);
|
|
56
|
+
});
|
|
57
|
+
container.appendChild(el);
|
|
58
|
+
return container;
|
|
59
|
+
};
|
|
60
|
+
export const Playground = Template.bind({});
|
|
61
|
+
Playground.args = {
|
|
62
|
+
items: [
|
|
63
|
+
{ label: 'Home', link: '/' },
|
|
64
|
+
{ label: 'Produtos', link: '/produtos' },
|
|
65
|
+
{ label: 'Categoria', link: '/produtos/categoria' },
|
|
66
|
+
{ label: 'Item Atual' },
|
|
67
|
+
],
|
|
68
|
+
};
|
|
69
|
+
export const ShortPath = Template.bind({});
|
|
70
|
+
ShortPath.args = {
|
|
71
|
+
items: [
|
|
72
|
+
{ label: 'Home', link: '/' },
|
|
73
|
+
{ label: 'Página Atual' },
|
|
74
|
+
],
|
|
75
|
+
};
|
|
76
|
+
ShortPath.parameters = {
|
|
77
|
+
docs: {
|
|
78
|
+
description: {
|
|
79
|
+
story: 'Breadcrumb com apenas dois níveis.',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
export const LongPath = Template.bind({});
|
|
84
|
+
LongPath.args = {
|
|
85
|
+
items: [
|
|
86
|
+
{ label: 'Home', link: '/' },
|
|
87
|
+
{ label: 'Departamento', link: '/departamento' },
|
|
88
|
+
{ label: 'Seção', link: '/departamento/secao' },
|
|
89
|
+
{ label: 'Categoria', link: '/departamento/secao/categoria' },
|
|
90
|
+
{ label: 'Subcategoria', link: '/departamento/secao/categoria/subcategoria' },
|
|
91
|
+
{ label: 'Item Final' },
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
LongPath.parameters = {
|
|
95
|
+
docs: {
|
|
96
|
+
description: {
|
|
97
|
+
story: 'Breadcrumb com múltiplos níveis de navegação.',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
export const WithoutLinks = Template.bind({});
|
|
102
|
+
WithoutLinks.args = {
|
|
103
|
+
items: [
|
|
104
|
+
{ label: 'Início' },
|
|
105
|
+
{ label: 'Configurações' },
|
|
106
|
+
{ label: 'Perfil' },
|
|
107
|
+
],
|
|
108
|
+
};
|
|
109
|
+
WithoutLinks.parameters = {
|
|
110
|
+
docs: {
|
|
111
|
+
description: {
|
|
112
|
+
story: 'Breadcrumb sem links, apenas para visualização da hierarquia.',
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=sula-breadcrumb.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sula-breadcrumb.stories.js","sourceRoot":"","sources":["../../../src/components/sula-breadcrumb/sula-breadcrumb.stories.tsx"],"names":[],"mappings":"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","sourcesContent":["export default {\n title: 'Components/sula-breadcrumb',\n tags: ['autodocs'],\n argTypes: {\n items: {\n control: 'object',\n description: 'Array de itens do breadcrumb com label e link',\n table: {\n type: { summary: 'Array<{id?: string | number, label: string, link?: string}>' },\n defaultValue: { summary: '[]' },\n },\n },\n breadcrumbItemClicked: {\n action: 'breadcrumbItemClicked',\n description: 'Evento emitido quando um item do breadcrumb é clicado',\n table: {\n type: { summary: 'CustomEvent<SulaMenuBreadcrumb>' },\n },\n },\n },\n parameters: {\n docs: {\n description: {\n component: `\nO componente **Sula Breadcrumb** é utilizado para navegação hierárquica, mostrando a localização \natual do usuário dentro da estrutura do site ou aplicação.\n\n### Características principais:\n- Navegação hierárquica clara\n- Separador usando ícone ph-caret-right\n- Suporte a links e itens não clicáveis\n- Último item sempre aparece em laranja (cor primária) e em negrito\n- Estados: hover, pressed e focused\n `,\n },\n },\n },\n};\n\nconst Template = args => {\n const container = document.createElement('div');\n container.style.margin = '20px';\n container.style.padding = '20px';\n\n const el = document.createElement('sula-breadcrumb');\n\n // Define os items como propriedade\n if (args.items && args.items.length > 0) {\n el.items = args.items.map(item => ({\n id: item.id,\n title: item.label,\n path: item.link,\n }));\n }\n\n // Event listener\n el.addEventListener('breadcrumbItemClicked', e => {\n console.log('Breadcrumb item clicked:', e.detail);\n args.breadcrumbItemClicked(e);\n });\n\n container.appendChild(el);\n return container;\n};\n\nexport const Playground = Template.bind({});\nPlayground.args = {\n items: [\n { label: 'Home', link: '/' },\n { label: 'Produtos', link: '/produtos' },\n { label: 'Categoria', link: '/produtos/categoria' },\n { label: 'Item Atual' },\n ],\n};\n\nexport const ShortPath = Template.bind({});\nShortPath.args = {\n items: [\n { label: 'Home', link: '/' },\n { label: 'Página Atual' },\n ],\n};\nShortPath.parameters = {\n docs: {\n description: {\n story: 'Breadcrumb com apenas dois níveis.',\n },\n },\n};\n\nexport const LongPath = Template.bind({});\nLongPath.args = {\n items: [\n { label: 'Home', link: '/' },\n { label: 'Departamento', link: '/departamento' },\n { label: 'Seção', link: '/departamento/secao' },\n { label: 'Categoria', link: '/departamento/secao/categoria' },\n { label: 'Subcategoria', link: '/departamento/secao/categoria/subcategoria' },\n { label: 'Item Final' },\n ],\n};\nLongPath.parameters = {\n docs: {\n description: {\n story: 'Breadcrumb com múltiplos níveis de navegação.',\n },\n },\n};\n\nexport const WithoutLinks = Template.bind({});\nWithoutLinks.args = {\n items: [\n { label: 'Início' },\n { label: 'Configurações' },\n { label: 'Perfil' },\n ],\n};\nWithoutLinks.parameters = {\n docs: {\n description: {\n story: 'Breadcrumb sem links, apenas para visualização da hierarquia.',\n },\n },\n};\n"]}
|
|
@@ -153,7 +153,7 @@ export class SulaButton {
|
|
|
153
153
|
return SulaLoaderSize.Medium;
|
|
154
154
|
}
|
|
155
155
|
render() {
|
|
156
|
-
return (h(Host, { key: '
|
|
156
|
+
return (h(Host, { key: '1c1409076f20518df6a3a722d40f3ea80ca66f76' }, h("button", { key: '418ecd2a69e07eeccd8f9f42951ef4e7739e10d9', id: "button-container", class: this.getBaseButtonClass(), disabled: this.buttonDisabled || this.loading, onClick: this.handleClick }, this.loading && (h("div", { key: 'b3e1dce8d48638856806552e2dc1cd4d135673f6' }, h("sula-loader", { key: 'af9ea685849daf30b45518c6f13b71b9e9e48509', size: this.getLoadingSize() }))), !this.loading && (h("div", { key: 'f865dbf7286efb931c89b4fc366c2b2410b82516', class: "flex w-full justify-center items-center" }, this.leftIcon && h("sula-icon", { key: '24ced9ecfd42c590f884226ffb0d135164febeed', icon: this.leftIcon, customClass: "text-lg mr-8" }), this.renderIconContent(), this.renderTextContent(), this.renderArrowIcon(), this.rightIcon && h("sula-icon", { key: 'def421acb1a2d3e66fd0556e20ba9ddb7f2789e3', icon: this.rightIcon, customClass: "text-lg ml-8" }))))));
|
|
157
157
|
}
|
|
158
158
|
static get is() { return "sula-button"; }
|
|
159
159
|
static get encapsulation() { return "shadow"; }
|
|
@@ -41,20 +41,20 @@ export class SulaCheckbox {
|
|
|
41
41
|
return 'text-negative-negative-1';
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
|
-
return (h(Host, { key: '
|
|
44
|
+
return (h(Host, { key: '0fd61b767c3596d432c165dd46ff8d51809322d7' }, h("div", { key: '125d5c775a4555bbad19515a062bb0613a09509c', class: {
|
|
45
45
|
'outline-none': true,
|
|
46
46
|
'flex items-center space-x-12': !!this.label && this.type === SulaCheckboxType.Default,
|
|
47
47
|
'flex items-center justify-between bg-surface-on-body rounded-md w-[280px] min-h-[85px] px-24 py-16': this.type === SulaCheckboxType.List,
|
|
48
48
|
'hover:bg-states-empty-bg-hover active:bg-states-empty-bg-pressed cursor-pointer': this.type === SulaCheckboxType.List && !this.disabled,
|
|
49
49
|
'container-focus': this.isFocus && this.type === SulaCheckboxType.List,
|
|
50
|
-
}, onFocus: this.handleFocus, onBlur: this.handleBlur, onClick: this.toggle, tabIndex: 0 }, this.type === SulaCheckboxType.List && (h("div", { key: '
|
|
50
|
+
}, 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: {
|
|
51
51
|
'flex justify-center items-center rounded-xs w-[27px] h-[27px] border outline-none flex-shrink-0': true,
|
|
52
52
|
'checkbox-focus': this.isFocus && this.type === SulaCheckboxType.Default,
|
|
53
53
|
'cursor-pointer active:bg-states-empty-bg-pressed': !this.disabled,
|
|
54
54
|
'bg-states-bg-disabled border-states-bg-disabled': this.disabled,
|
|
55
55
|
'bg-brand-primary border-brand-primary': this.checked,
|
|
56
56
|
'bg-surface-body border-line-input': !this.checked,
|
|
57
|
-
}, onFocus: this.handleFocus, onBlur: this.handleBlur }, this.checked && (h("div", { key: '
|
|
57
|
+
}, 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))));
|
|
58
58
|
}
|
|
59
59
|
static get is() { return "sula-checkbox"; }
|
|
60
60
|
static get encapsulation() { return "shadow"; }
|
|
@@ -63,7 +63,7 @@ export class SulaChip {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
render() {
|
|
66
|
-
return (h(Host, { key: '
|
|
66
|
+
return (h(Host, { key: 'fef73e8259b1203365b11cdbc5748b210ee4f727', ref: node => (this.node = node) }, h("div", { key: 'a252f13f43cfe38ef75f1d223efa8e4711520b57', class: "w-fit relative" }, h("div", { key: '44cdcb1f228243f3405ef1a06ae165da7916331c', class: {
|
|
67
67
|
'flex justify-center items-center px-16 py-2 rounded-xxl min-h-40 w-fit outline-none': true,
|
|
68
68
|
'bg-surface-on-body hover:bg-states-empty-bg-hover active:bg-states-empty-bg-pressed': this.appearance === SulaChipAppearance.Default && !this.disabled,
|
|
69
69
|
'bg-negative-negative-1 hover:bg-states-negative-hover active:bg-states-negative-pressed': this.appearance === SulaChipAppearance.Negative && !this.disabled,
|
|
@@ -71,12 +71,12 @@ export class SulaChip {
|
|
|
71
71
|
'cursor-pointer': !this.disabled,
|
|
72
72
|
'border border-line-input chip-opened': !this.disabled && this.showItems,
|
|
73
73
|
'chip-focus': this.isFocused,
|
|
74
|
-
}, tabIndex: 0, onClick: this.handleClick, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("span", { key: '
|
|
74
|
+
}, tabIndex: 0, onClick: this.handleClick, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("span", { key: 'b550a1edb64bf3e3ae6f0ad4d01f02b74df2ca65', class: {
|
|
75
75
|
'text-base font-bold leading-4': true,
|
|
76
76
|
'text-text-primary': this.appearance === SulaChipAppearance.Default && !this.disabled,
|
|
77
77
|
'text-negative-negative-2': this.appearance === SulaChipAppearance.Negative && !this.disabled,
|
|
78
78
|
'text-text-disabled': this.disabled,
|
|
79
|
-
} }, this.text), this.items.length > 0 && (h("div", { key: '
|
|
79
|
+
} }, 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 }))))));
|
|
80
80
|
}
|
|
81
81
|
static get is() { return "sula-chip"; }
|
|
82
82
|
static get encapsulation() { return "shadow"; }
|
|
@@ -94,12 +94,12 @@ export class SulaDropdown {
|
|
|
94
94
|
}
|
|
95
95
|
render() {
|
|
96
96
|
var _a;
|
|
97
|
-
return (h(Host, { key: '
|
|
97
|
+
return (h(Host, { key: 'c0731dd4a3330060b4ecdcb0b2c3b466c99e661b', ref: node => (this.node = node) }, h("div", { key: 'bfa63d3d6b5ff252e58f2481e7ac6375a12c5231', class: {
|
|
98
98
|
'flex justify-between items-center border border-line-input h-[72px] px-16 rounded-xl relative': true,
|
|
99
99
|
'bg-surface-body cursor-pointer': !this.disabled,
|
|
100
100
|
'bg-states-bg-disabled': this.disabled,
|
|
101
101
|
'dropdown-focus': this.isFocused,
|
|
102
|
-
}, onClick: this.handleClick, tabIndex: 0, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("div", { key: '
|
|
102
|
+
}, 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: {
|
|
103
103
|
'text-base leading-4': !this.selectedItem && !(this.searchable && this.showItems),
|
|
104
104
|
'text-sm leading-4 font-bold': !!this.selectedItem || (this.searchable && this.showItems),
|
|
105
105
|
'text-text-primary': !this.disabled,
|
|
@@ -108,7 +108,7 @@ export class SulaDropdown {
|
|
|
108
108
|
'text-base leading-4 pt-4': true,
|
|
109
109
|
'text-text-primary': !this.disabled,
|
|
110
110
|
'text-text-disabled': this.disabled,
|
|
111
|
-
} }, this.selectedItem.title)))), h("div", { key: '
|
|
111
|
+
} }, 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" }, (() => {
|
|
112
112
|
const itemsToShow = this.searchable && this.searchTerm.trim() ? this.filteredItems : this.items;
|
|
113
113
|
const showNoResults = this.searchable && this.searchTerm.trim() && itemsToShow.length === 0;
|
|
114
114
|
if (showNoResults) {
|