@sula-tech/webcomponents 0.11.0 → 0.11.2

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.
Files changed (79) hide show
  1. package/dist/cjs/{index-LR6yFDX7.js → index-C19aFtyq.js} +5 -2
  2. package/dist/cjs/index-C19aFtyq.js.map +1 -0
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/sula-avatar_21.cjs.entry.js +73 -26
  5. package/dist/cjs/sula-avatar_21.cjs.entry.js.map +1 -1
  6. package/dist/cjs/webcomponents.cjs.js +2 -2
  7. package/dist/collection/components/sula-chip/sula-chip.css +1 -1
  8. package/dist/collection/components/sula-chip/sula-chip.js +33 -7
  9. package/dist/collection/components/sula-chip/sula-chip.js.map +1 -1
  10. package/dist/collection/components/sula-chip/sula-chip.stories.js +22 -0
  11. package/dist/collection/components/sula-chip/sula-chip.stories.js.map +1 -1
  12. package/dist/collection/components/sula-dropdown/sula-dropdown.css +1 -1
  13. package/dist/collection/components/sula-dropdown/sula-dropdown.js +62 -7
  14. package/dist/collection/components/sula-dropdown/sula-dropdown.js.map +1 -1
  15. package/dist/collection/components/sula-dropdown/sula-dropdown.stories.js +94 -0
  16. package/dist/collection/components/sula-dropdown/sula-dropdown.stories.js.map +1 -1
  17. package/dist/collection/components/sula-icon/sula-icon.css +1 -1
  18. package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.css +1 -1
  19. package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.js +28 -2
  20. package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.js.map +1 -1
  21. package/dist/collection/components/sula-switch/sula-switch.css +1 -1
  22. package/dist/collection/components/sula-switch/sula-switch.js +35 -5
  23. package/dist/collection/components/sula-switch/sula-switch.js.map +1 -1
  24. package/dist/collection/components/sula-switch/sula-switch.stories.js +22 -0
  25. package/dist/collection/components/sula-switch/sula-switch.stories.js.map +1 -1
  26. package/dist/components/index.js +3 -0
  27. package/dist/components/index.js.map +1 -1
  28. package/dist/components/{p-CD0__3qt.js → p-BlyFOqde.js} +3 -3
  29. package/dist/components/{p-CD0__3qt.js.map → p-BlyFOqde.js.map} +1 -1
  30. package/dist/components/{p-CFhhi4NQ.js → p-DksR9NcR.js} +12 -5
  31. package/dist/components/p-DksR9NcR.js.map +1 -0
  32. package/dist/components/{p-DO7voMbe.js → p-tr2oA4pB.js} +3 -3
  33. package/dist/components/{p-DO7voMbe.js.map → p-tr2oA4pB.js.map} +1 -1
  34. package/dist/components/sula-avatar.js +1 -1
  35. package/dist/components/sula-badge.js +1 -1
  36. package/dist/components/sula-breadcrumb.js +1 -1
  37. package/dist/components/sula-button.js +1 -1
  38. package/dist/components/sula-checkbox.js +1 -1
  39. package/dist/components/sula-chip.js +17 -10
  40. package/dist/components/sula-chip.js.map +1 -1
  41. package/dist/components/sula-dropdown.js +41 -11
  42. package/dist/components/sula-dropdown.js.map +1 -1
  43. package/dist/components/sula-icon.js +1 -1
  44. package/dist/components/sula-menu-select-list.js +1 -1
  45. package/dist/components/sula-modal.js +2 -2
  46. package/dist/components/sula-progress-bar.js +1 -1
  47. package/dist/components/sula-search-bar.js +1 -1
  48. package/dist/components/sula-segmented-control.js +1 -1
  49. package/dist/components/sula-switch.js +14 -6
  50. package/dist/components/sula-switch.js.map +1 -1
  51. package/dist/components/sula-tag.js +1 -1
  52. package/dist/components/sula-textfield.js +1 -1
  53. package/dist/components/sula-tiles.js +1 -1
  54. package/dist/components/sula-timeline-list.js +1 -1
  55. package/dist/esm/{index-CrFclBiX.js → index-CwIBTB8E.js} +5 -2
  56. package/dist/esm/index-CwIBTB8E.js.map +1 -0
  57. package/dist/esm/loader.js +3 -3
  58. package/dist/esm/sula-avatar_21.entry.js +73 -26
  59. package/dist/esm/sula-avatar_21.entry.js.map +1 -1
  60. package/dist/esm/webcomponents.js +3 -3
  61. package/dist/types/components/sula-chip/sula-chip.d.ts +4 -0
  62. package/dist/types/components/sula-chip/sula-chip.stories.d.ts +9 -0
  63. package/dist/types/components/sula-dropdown/sula-dropdown.d.ts +7 -0
  64. package/dist/types/components/sula-dropdown/sula-dropdown.stories.d.ts +9 -0
  65. package/dist/types/components/sula-menu-select-list/sula-menu-select-list.d.ts +4 -0
  66. package/dist/types/components/sula-switch/sula-switch.d.ts +5 -0
  67. package/dist/types/components/sula-switch/sula-switch.stories.d.ts +10 -0
  68. package/dist/types/components.d.ts +40 -0
  69. package/dist/webcomponents/{p-491c4d76.entry.js → p-1b6e77dc.entry.js} +85 -41
  70. package/dist/webcomponents/p-1b6e77dc.entry.js.map +1 -0
  71. package/dist/webcomponents/{p-CrFclBiX.js → p-CwIBTB8E.js} +5 -2
  72. package/dist/webcomponents/p-CwIBTB8E.js.map +1 -0
  73. package/dist/webcomponents/webcomponents.esm.js +10 -5
  74. package/package.json +1 -1
  75. package/dist/cjs/index-LR6yFDX7.js.map +0 -1
  76. package/dist/components/p-CFhhi4NQ.js.map +0 -1
  77. package/dist/esm/index-CrFclBiX.js.map +0 -1
  78. package/dist/webcomponents/p-491c4d76.entry.js.map +0 -1
  79. package/dist/webcomponents/p-CrFclBiX.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-LR6yFDX7.js');
3
+ var index = require('./index-C19aFtyq.js');
4
4
 
5
5
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
6
6
  /*
@@ -18,7 +18,7 @@ var patchBrowser = () => {
18
18
 
19
19
  patchBrowser().then(async (options) => {
20
20
  await index.globalScripts();
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);
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],"selected":[1028],"isFocused":[32],"showItems":[32]},[[4,"click","handleDocumentClick"]]],[1,"sula-dropdown",{"label":[1025],"disabled":[1028],"items":[1040],"value":[1040],"searchable":[516],"menuMaxHeight":[2,"menu-max-height"],"selectedItem":[32],"showItems":[32],"isFocused":[32],"searchTerm":[32],"filteredItems":[32],"openUpward":[32]},[[4,"click","handleDocumentClick"],[9,"resize","handleWindowResize"]],{"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"],"responsive":[4],"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"],"maxHeight":[2,"max-height"],"selectedValue":[16,"selected-value"]}],[0,"sula-icon",{"icon":[1],"customClass":[1,"custom-class"]}]]]], options);
22
22
  });
23
23
 
24
24
  exports.setNonce = index.setNonce;
@@ -1 +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}.outline{outline-style:solid}:host{display:block}.chip-focus{outline:2px solid var(--color-feedback-informational)!important;outline-offset:2px!important}.chip-opened{box-shadow:0 0 0 2px hsla(0,0%,8%,.102)}: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-40{top:2.5rem}.z-50{z-index:50}.ml-8{margin-left:.5rem}.flex{display:flex}.min-h-40{min-height:2.5rem}.w-fit{width:fit-content}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.rounded-xxl{border-radius:18.75rem}.border{border-width:1px}.border-line-input{border-color:var(--color-line-input)}.bg-negative-negative-1{background-color:var(--color-negative-negative-1)}.bg-states-bg-disabled{background-color:var(--color-states-bg-disabled)}.bg-states-empty-bg-pressed{background-color:var(--color-states-empty-bg-pressed)}.bg-states-negative-pressed{background-color:var(--color-states-negative-pressed)}.bg-surface-on-body{background-color:var(--color-surface-on-body)}.px-16{padding-left:1rem;padding-right:1rem}.py-2{padding-bottom:.125rem;padding-top:.125rem}.text-base{font-size:1rem;line-height:1.5rem}.font-bold{font-weight:700}.leading-4{line-height:1rem}.text-negative-negative-2{color:var(--color-negative-negative-2)}.text-text-disabled{color:var(--color-text-disabled)}.text-text-primary{color:var(--color-text-primary)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.hover\:bg-states-empty-bg-hover:hover{background-color:var(--color-states-empty-bg-hover)}.hover\:bg-states-negative-hover:hover{background-color:var(--color-states-negative-hover)}.active\:bg-states-empty-bg-pressed:active{background-color:var(--color-states-empty-bg-pressed)}.active\:bg-states-negative-pressed:active{background-color:var(--color-states-negative-pressed)}.max-h-\[260px\]{max-height:260px}.w-full{width:100%}.overflow-auto{overflow:auto}.rounded-sm{border-radius:.75rem}.border-line-general{border-color:var(--color-line-general)}.bg-surface-body{background-color:var(--color-surface-body)}.px-24{padding-left:1.5rem;padding-right:1.5rem}.py-12{padding-bottom:.75rem;padding-top:.75rem}.py-16{padding-bottom:1rem;padding-top:1rem}.text-text-brand{color:var(--color-text-brand)}
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}.outline{outline-style:solid}:host{display:block}.chip-focus{outline:2px solid var(--color-feedback-informational)!important;outline-offset:2px!important}.chip-opened{box-shadow:0 0 0 2px hsla(0,0%,8%,.102)}: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-40{top:2.5rem}.z-50{z-index:50}.ml-8{margin-left:.5rem}.flex{display:flex}.min-h-40{min-height:2.5rem}.w-fit{width:fit-content}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.rounded-xxl{border-radius:18.75rem}.border{border-width:1px}.border-line-input{border-color:var(--color-line-input)}.bg-brand-primary{background-color:var(--color-brand-primary)}.bg-negative-negative-1{background-color:var(--color-negative-negative-1)}.bg-states-bg-disabled{background-color:var(--color-states-bg-disabled)}.bg-states-empty-bg-pressed{background-color:var(--color-states-empty-bg-pressed)}.bg-states-negative-pressed{background-color:var(--color-states-negative-pressed)}.bg-surface-on-body{background-color:var(--color-surface-on-body)}.px-16{padding-left:1rem;padding-right:1rem}.py-2{padding-bottom:.125rem;padding-top:.125rem}.text-base{font-size:1rem;line-height:1.5rem}.font-bold{font-weight:700}.leading-4{line-height:1rem}.text-negative-negative-1{color:var(--color-negative-negative-1)}.text-negative-negative-2{color:var(--color-negative-negative-2)}.text-text-disabled{color:var(--color-text-disabled)}.text-text-primary{color:var(--color-text-primary)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.hover\:bg-states-empty-bg-hover:hover{background-color:var(--color-states-empty-bg-hover)}.hover\:bg-states-negative-hover:hover{background-color:var(--color-states-negative-hover)}.active\:bg-states-empty-bg-pressed:active{background-color:var(--color-states-empty-bg-pressed)}.active\:bg-states-negative-pressed:active{background-color:var(--color-states-negative-pressed)}.w-full{width:100%}.overflow-auto{overflow:auto}.rounded-sm{border-radius:.75rem}.border-line-general{border-color:var(--color-line-general)}.bg-surface-body{background-color:var(--color-surface-body)}.px-24{padding-left:1.5rem;padding-right:1.5rem}.py-12{padding-bottom:.75rem;padding-top:.75rem}.py-16{padding-bottom:1rem;padding-top:1rem}.text-text-brand{color:var(--color-text-brand)}
@@ -18,6 +18,10 @@ export class SulaChip {
18
18
  * Items for list
19
19
  */
20
20
  this.items = [];
21
+ /**
22
+ * Chip is selected
23
+ */
24
+ this.selected = false;
21
25
  this.isFocused = false;
22
26
  this.showItems = false;
23
27
  this.handleFocus = () => {
@@ -63,20 +67,22 @@ export class SulaChip {
63
67
  }
64
68
  }
65
69
  render() {
66
- return (h(Host, { key: 'fef73e8259b1203365b11cdbc5748b210ee4f727', ref: node => (this.node = node) }, h("div", { key: 'a252f13f43cfe38ef75f1d223efa8e4711520b57', class: "w-fit relative" }, h("div", { key: '44cdcb1f228243f3405ef1a06ae165da7916331c', class: {
70
+ return (h(Host, { key: '4ce6ddbbacc4244deb57208be164f388476f96b6', ref: node => (this.node = node) }, h("div", { key: '09f9a30a050938dae1a783de76367bd0bd96f50c', class: "w-fit relative" }, h("div", { key: '53d65bf23d328ee7c5893097e2a31ab36ef2e97c', class: {
67
71
  'flex justify-center items-center px-16 py-2 rounded-xxl min-h-40 w-fit outline-none': true,
68
- 'bg-surface-on-body hover:bg-states-empty-bg-hover active:bg-states-empty-bg-pressed': this.appearance === SulaChipAppearance.Default && !this.disabled,
69
- 'bg-negative-negative-1 hover:bg-states-negative-hover active:bg-states-negative-pressed': this.appearance === SulaChipAppearance.Negative && !this.disabled,
72
+ 'bg-surface-on-body hover:bg-states-empty-bg-hover active:bg-states-empty-bg-pressed': this.appearance === SulaChipAppearance.Default && !this.disabled && !this.selected,
73
+ 'bg-brand-primary': this.selected && !this.disabled,
74
+ 'bg-negative-negative-1 hover:bg-states-negative-hover active:bg-states-negative-pressed': this.appearance === SulaChipAppearance.Negative && !this.disabled && !this.selected,
70
75
  'bg-states-bg-disabled cursor-not-allowed': this.disabled,
71
76
  'cursor-pointer': !this.disabled,
72
77
  'border border-line-input chip-opened': !this.disabled && this.showItems,
73
78
  'chip-focus': this.isFocused,
74
- }, tabIndex: 0, onClick: this.handleClick, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("span", { key: 'b550a1edb64bf3e3ae6f0ad4d01f02b74df2ca65', class: {
79
+ }, tabIndex: 0, onClick: this.handleClick, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("span", { key: 'ab94ad10eef369aca2dc62fb41345a3bd25ac15c', class: {
75
80
  'text-base font-bold leading-4': true,
76
- 'text-text-primary': this.appearance === SulaChipAppearance.Default && !this.disabled,
77
- 'text-negative-negative-2': this.appearance === SulaChipAppearance.Negative && !this.disabled,
81
+ 'text-text-primary': this.appearance === SulaChipAppearance.Default && !this.disabled && !this.selected,
82
+ 'text-negative-negative-2': this.appearance === SulaChipAppearance.Negative && !this.disabled && !this.selected,
83
+ 'text-negative-negative-1': this.selected && !this.disabled,
78
84
  'text-text-disabled': this.disabled,
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 }))))));
85
+ } }, this.text), this.items.length > 0 && (h("div", { key: '71e7f0156e20c26c0d7ff382fbcebd64cfee9c2d', class: "flex items-center justify-center ml-8 leading-4" }, h("sula-icon", { key: '5f2ae8918360c3272f747321db7c6f18439a365f', icon: `ph-bold ph-caret-${this.showItems ? 'up' : 'down'}`, customClass: this.getIconClass() })))), this.showItems && (h("div", { key: 'ac7f4d93375825d1a8fb8e1b065dabc71978ee29', class: "absolute z-50 top-40 left-0" }, h("sula-menu-select-list", { key: '21a55a038bae34507667610e5c2288a8467a3345', items: this.items, onItemSelected: this.handleItemSelected }))))));
80
86
  }
81
87
  static get is() { return "sula-chip"; }
82
88
  static get encapsulation() { return "shadow"; }
@@ -182,6 +188,26 @@ export class SulaChip {
182
188
  "getter": false,
183
189
  "setter": false,
184
190
  "defaultValue": "[]"
191
+ },
192
+ "selected": {
193
+ "type": "boolean",
194
+ "attribute": "selected",
195
+ "mutable": true,
196
+ "complexType": {
197
+ "original": "boolean",
198
+ "resolved": "boolean",
199
+ "references": {}
200
+ },
201
+ "required": false,
202
+ "optional": false,
203
+ "docs": {
204
+ "tags": [],
205
+ "text": "Chip is selected"
206
+ },
207
+ "getter": false,
208
+ "setter": false,
209
+ "reflect": false,
210
+ "defaultValue": "false"
185
211
  }
186
212
  };
187
213
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sula-chip.js","sourceRoot":"","sources":["../../../src/components/sula-chip/sula-chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAQ7D,MAAM,OAAO,QAAQ;IALrB;QAME;;WAEG;QAEH,SAAI,GAAW,EAAE,CAAC;QAElB;;WAEG;QAEH,eAAU,GAAuB,kBAAkB,CAAC,OAAO,CAAC;QAE5D;;WAEG;QAEH,aAAQ,GAAY,KAAK,CAAC;QAE1B;;WAEG;QAEH,UAAK,GAAuB,EAAE,CAAC;QAe/B,cAAS,GAAG,KAAK,CAAC;QAGlB,cAAS,GAAG,KAAK,CAAC;QAelB,gBAAW,GAAG,GAAG,EAAE;YACjB,IAAI,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAC1B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACxB,CAAC,CAAC;QAEF,eAAU,GAAG,GAAG,EAAE;YAChB,IAAI,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAC1B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACzB,CAAC,CAAC;QAEF,gBAAW,GAAG,GAAG,EAAE;YACj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,kBAAkB,GAA0B,CACvG,CACP,CACG,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, Host, Listen, Prop, State, h } from '@stencil/core';\nimport { SulaMenuListItem } from '../sula-menu-select-list/model/sula-menu-select-list.model';\nimport { SulaChipAppearance } from './model/sula-chip.model';\nimport { SulaMenuSelectListCustomEvent } from '../../components';\n\n@Component({\n tag: 'sula-chip',\n styleUrl: 'sula-chip.scss',\n shadow: true,\n})\nexport class SulaChip {\n /**\n * Chip text\n */\n @Prop({ mutable: true })\n text: string = '';\n\n /**\n * Chip appearance\n */\n @Prop({ mutable: true })\n appearance: SulaChipAppearance = SulaChipAppearance.Default;\n\n /**\n * Chip is disabled\n */\n @Prop({ mutable: true })\n disabled: boolean = false;\n\n /**\n * Items for list\n */\n @Prop({ mutable: true })\n items: SulaMenuListItem[] = [];\n\n /**\n * Event emitted when chip is clicked\n */\n @Event()\n itemClicked: EventEmitter<void>;\n\n /**\n * Event emitted when item is selected\n */\n @Event()\n menuItemSelected: EventEmitter<SulaMenuListItem>;\n\n @State()\n isFocused = false;\n\n @State()\n showItems = false;\n\n node?: HTMLElement;\n\n @Listen('click', { target: 'document' })\n handleDocumentClick(event: Event) {\n if (!this.node) return;\n\n const clickInside = this.node.contains(event.target as Node);\n\n if (!clickInside) {\n this.showItems = false;\n }\n }\n\n handleFocus = () => {\n if (this.disabled) return;\n this.isFocused = true;\n };\n\n handleBlur = () => {\n if (this.disabled) return;\n this.isFocused = false;\n };\n\n handleClick = () => {\n if (this.disabled) return;\n\n this.itemClicked.emit();\n\n if (this.items.length > 0) {\n this.showItems = !this.showItems;\n this.isFocused = false;\n }\n };\n\n handleItemSelected = (item: SulaMenuSelectListCustomEvent<SulaMenuListItem>) => {\n this.menuItemSelected.emit(item.detail);\n this.showItems = false;\n };\n\n getIconClass() {\n if (this.disabled) return 'text-text-disabled';\n\n if (this.appearance === SulaChipAppearance.Default) {\n return 'text-text-primary';\n } else {\n return 'text-negative-negative-2';\n }\n }\n\n render() {\n return (\n <Host ref={node => (this.node = node)}>\n <div class=\"w-fit relative\">\n <div\n class={{\n 'flex justify-center items-center px-16 py-2 rounded-xxl min-h-40 w-fit outline-none': true,\n 'bg-surface-on-body hover:bg-states-empty-bg-hover active:bg-states-empty-bg-pressed': this.appearance === SulaChipAppearance.Default && !this.disabled,\n 'bg-negative-negative-1 hover:bg-states-negative-hover active:bg-states-negative-pressed': this.appearance === SulaChipAppearance.Negative && !this.disabled,\n 'bg-states-bg-disabled cursor-not-allowed': this.disabled,\n 'cursor-pointer': !this.disabled,\n 'border border-line-input chip-opened': !this.disabled && this.showItems,\n 'chip-focus': this.isFocused,\n }}\n tabIndex={0}\n onClick={this.handleClick}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n >\n <span\n class={{\n 'text-base font-bold leading-4': true,\n 'text-text-primary': this.appearance === SulaChipAppearance.Default && !this.disabled,\n 'text-negative-negative-2': this.appearance === SulaChipAppearance.Negative && !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.text}\n </span>\n\n {this.items.length > 0 && (\n <div class=\"flex items-center justify-center ml-8 leading-4\">\n <sula-icon icon={`ph-bold ph-caret-${this.showItems ? 'up' : 'down'}`} customClass={this.getIconClass()}></sula-icon>\n </div>\n )}\n </div>\n {this.showItems && (\n <div class=\"absolute z-50 top-40 left-0\">\n <sula-menu-select-list items={this.items} onItemSelected={this.handleItemSelected}></sula-menu-select-list>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"sula-chip.js","sourceRoot":"","sources":["../../../src/components/sula-chip/sula-chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,S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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, Host, Listen, Prop, State, h } from '@stencil/core';\nimport { SulaMenuListItem } from '../sula-menu-select-list/model/sula-menu-select-list.model';\nimport { SulaChipAppearance } from './model/sula-chip.model';\nimport { SulaMenuSelectListCustomEvent } from '../../components';\n\n@Component({\n tag: 'sula-chip',\n styleUrl: 'sula-chip.scss',\n shadow: true,\n})\nexport class SulaChip {\n /**\n * Chip text\n */\n @Prop({ mutable: true })\n text: string = '';\n\n /**\n * Chip appearance\n */\n @Prop({ mutable: true })\n appearance: SulaChipAppearance = SulaChipAppearance.Default;\n\n /**\n * Chip is disabled\n */\n @Prop({ mutable: true })\n disabled: boolean = false;\n\n /**\n * Items for list\n */\n @Prop({ mutable: true })\n items: SulaMenuListItem[] = [];\n\n /**\n * Chip is selected\n */\n @Prop({ mutable: true })\n selected: boolean = false;\n\n /**\n * Event emitted when chip is clicked\n */\n @Event()\n itemClicked: EventEmitter<void>;\n\n /**\n * Event emitted when item is selected\n */\n @Event()\n menuItemSelected: EventEmitter<SulaMenuListItem>;\n\n @State()\n isFocused = false;\n\n @State()\n showItems = false;\n\n node?: HTMLElement;\n\n @Listen('click', { target: 'document' })\n handleDocumentClick(event: Event) {\n if (!this.node) return;\n\n const clickInside = this.node.contains(event.target as Node);\n\n if (!clickInside) {\n this.showItems = false;\n }\n }\n\n handleFocus = () => {\n if (this.disabled) return;\n this.isFocused = true;\n };\n\n handleBlur = () => {\n if (this.disabled) return;\n this.isFocused = false;\n };\n\n handleClick = () => {\n if (this.disabled) return;\n\n this.itemClicked.emit();\n\n if (this.items.length > 0) {\n this.showItems = !this.showItems;\n this.isFocused = false;\n }\n };\n\n handleItemSelected = (item: SulaMenuSelectListCustomEvent<SulaMenuListItem>) => {\n this.menuItemSelected.emit(item.detail);\n this.showItems = false;\n };\n\n getIconClass() {\n if (this.disabled) return 'text-text-disabled';\n\n if (this.appearance === SulaChipAppearance.Default) {\n return 'text-text-primary';\n } else {\n return 'text-negative-negative-2';\n }\n }\n\n render() {\n return (\n <Host ref={node => (this.node = node)}>\n <div class=\"w-fit relative\">\n <div\n class={{\n 'flex justify-center items-center px-16 py-2 rounded-xxl min-h-40 w-fit outline-none': true,\n 'bg-surface-on-body hover:bg-states-empty-bg-hover active:bg-states-empty-bg-pressed':\n this.appearance === SulaChipAppearance.Default && !this.disabled && !this.selected,\n 'bg-brand-primary': this.selected && !this.disabled,\n 'bg-negative-negative-1 hover:bg-states-negative-hover active:bg-states-negative-pressed':\n this.appearance === SulaChipAppearance.Negative && !this.disabled && !this.selected,\n 'bg-states-bg-disabled cursor-not-allowed': this.disabled,\n 'cursor-pointer': !this.disabled,\n 'border border-line-input chip-opened': !this.disabled && this.showItems,\n 'chip-focus': this.isFocused,\n }}\n tabIndex={0}\n onClick={this.handleClick}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n >\n <span\n class={{\n 'text-base font-bold leading-4': true,\n 'text-text-primary': this.appearance === SulaChipAppearance.Default && !this.disabled && !this.selected,\n 'text-negative-negative-2': this.appearance === SulaChipAppearance.Negative && !this.disabled && !this.selected,\n 'text-negative-negative-1': this.selected && !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.text}\n </span>\n\n {this.items.length > 0 && (\n <div class=\"flex items-center justify-center ml-8 leading-4\">\n <sula-icon icon={`ph-bold ph-caret-${this.showItems ? 'up' : 'down'}`} customClass={this.getIconClass()}></sula-icon>\n </div>\n )}\n </div>\n {this.showItems && (\n <div class=\"absolute z-50 top-40 left-0\">\n <sula-menu-select-list items={this.items} onItemSelected={this.handleItemSelected}></sula-menu-select-list>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -28,6 +28,14 @@ export default {
28
28
  required: false,
29
29
  },
30
30
  },
31
+ selected: {
32
+ control: 'boolean',
33
+ defaultValue: false,
34
+ description: 'Is chip selected',
35
+ type: {
36
+ required: false,
37
+ },
38
+ },
31
39
  items: {
32
40
  control: 'object',
33
41
  defaultValue: [],
@@ -61,6 +69,8 @@ const Template = args => {
61
69
  el.setAttribute('text', args.text);
62
70
  el.setAttribute('appearance', args.appearance);
63
71
  el.setAttribute('disabled', args.disabled.toString());
72
+ if (args.selected)
73
+ el.setAttribute('selected', args.selected.toString());
64
74
  if (args.items && args.items.length > 0) {
65
75
  el.items = args.items;
66
76
  }
@@ -88,6 +98,15 @@ DisabledChip.args = {
88
98
  text: 'Disabled Chip',
89
99
  appearance: SulaChipAppearance.Default,
90
100
  disabled: true,
101
+ selected: false,
102
+ items: [],
103
+ };
104
+ export const SelectedChip = Template.bind({});
105
+ SelectedChip.args = {
106
+ text: 'Selected Chip',
107
+ appearance: SulaChipAppearance.Default,
108
+ disabled: false,
109
+ selected: true,
91
110
  items: [],
92
111
  };
93
112
  export const ChipWithDropdown = Template.bind({});
@@ -95,6 +114,7 @@ ChipWithDropdown.args = {
95
114
  text: 'Chip with Options',
96
115
  appearance: SulaChipAppearance.Default,
97
116
  disabled: false,
117
+ selected: false,
98
118
  items: [
99
119
  { id: '1', title: 'Option 1' },
100
120
  { id: '2', title: 'Option 2' },
@@ -106,6 +126,7 @@ NegativeChipWithDropdown.args = {
106
126
  text: 'Negative with Options',
107
127
  appearance: SulaChipAppearance.Negative,
108
128
  disabled: false,
129
+ selected: false,
109
130
  items: [
110
131
  { id: '1', title: 'Remove Item 1' },
111
132
  { id: '2', title: 'Remove Item 2' },
@@ -117,6 +138,7 @@ DisabledChipWithItems.args = {
117
138
  text: 'Disabled with Items',
118
139
  appearance: SulaChipAppearance.Default,
119
140
  disabled: true,
141
+ selected: false,
120
142
  items: [
121
143
  { id: '1', title: 'Option 1' },
122
144
  { id: '2', title: 'Option 2' },
@@ -1 +1 @@
1
- {"version":3,"file":"sula-chip.stories.js","sourceRoot":"","sources":["../../../src/components/sula-chip/sula-chip.stories.tsx"],"names":[],"m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E,kBAAkB,CAAC,OAAO;IACtC,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACL,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE;QAC9B,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE;KAC/B;CACF,CAAC","sourcesContent":["import { SulaChipAppearance } from './model/sula-chip.model';\n\nexport default {\n title: 'Components/sula-chip',\n tags: ['autodocs'],\n argTypes: {\n text: {\n control: 'text',\n defaultValue: 'Chip Text',\n description: 'Chip text',\n type: {\n required: false,\n },\n },\n appearance: {\n control: { type: 'select' },\n options: Object.values(SulaChipAppearance),\n defaultValue: SulaChipAppearance.Default,\n description: 'Chip appearance',\n type: {\n required: false,\n },\n },\n disabled: {\n control: 'boolean',\n defaultValue: false,\n description: 'Is chip disabled',\n type: {\n required: false,\n },\n },\n items: {\n control: 'object',\n defaultValue: [],\n description: 'Items for dropdown list',\n type: {\n required: false,\n },\n },\n itemClicked: {\n action: 'itemClicked',\n description: 'Evento emitido quando o chip é clicado',\n },\n itemSelected: {\n action: 'itemSelected',\n description: 'Evento emitido quando um item é selecionado',\n },\n },\n parameters: {\n docs: {\n description: {\n component: 'O componente Chip Sula Design System é utilizado como filtro, substituí botões pequenos e deve ser usado dentro de componentes de lista. ',\n },\n },\n },\n};\n\nconst Template = args => {\n const container = document.createElement('div');\n container.style.margin = '20px';\n\n const el = document.createElement('sula-chip');\n\n if (args.text) el.setAttribute('text', args.text);\n el.setAttribute('appearance', args.appearance);\n el.setAttribute('disabled', args.disabled.toString());\n\n if (args.items && args.items.length > 0) {\n el.items = args.items;\n }\n\n el.addEventListener('itemClicked', args.itemClicked);\n el.addEventListener('itemSelected', args.itemSelected);\n\n container.appendChild(el);\n\n return container;\n};\n\nexport const Default = Template.bind({});\nDefault.args = {\n text: 'Default Chip',\n appearance: SulaChipAppearance.Default,\n disabled: false,\n items: [],\n};\n\nexport const NegativeAppearance = Template.bind({});\nNegativeAppearance.args = {\n text: 'Negative Chip',\n appearance: SulaChipAppearance.Negative,\n disabled: false,\n items: [],\n};\n\nexport const DisabledChip = Template.bind({});\nDisabledChip.args = {\n text: 'Disabled Chip',\n appearance: SulaChipAppearance.Default,\n disabled: true,\n items: [],\n};\n\nexport const ChipWithDropdown = Template.bind({});\nChipWithDropdown.args = {\n text: 'Chip with Options',\n appearance: SulaChipAppearance.Default,\n disabled: false,\n items: [\n { id: '1', title: 'Option 1' },\n { id: '2', title: 'Option 2' },\n { id: '3', title: 'Option 3' },\n ],\n};\n\nexport const NegativeChipWithDropdown = Template.bind({});\nNegativeChipWithDropdown.args = {\n text: 'Negative with Options',\n appearance: SulaChipAppearance.Negative,\n disabled: false,\n items: [\n { id: '1', title: 'Remove Item 1' },\n { id: '2', title: 'Remove Item 2' },\n { id: '3', title: 'Remove Item 3' },\n ],\n};\n\nexport const DisabledChipWithItems = Template.bind({});\nDisabledChipWithItems.args = {\n text: 'Disabled with Items',\n appearance: SulaChipAppearance.Default,\n disabled: true,\n items: [\n { id: '1', title: 'Option 1' },\n { id: '2', title: 'Option 2' },\n ],\n};\n"]}
1
+ {"version":3,"file":"sula-chip.stories.js","sourceRoot":"","sources":["../../../src/components/sula-chip/sula-chip.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,eAAe;IACb,KAAK,EAAE,sBAAsB;IAC7B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,WAAW;YACzB,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE;gBACJ,QAAQ,EAAE,KAAK;aAChB;SACF;QACD,UAAU,EAAE;YACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC;YAC1C,YAAY,EAAE,kBAAkB,CAAC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M,CAAC,MAAM,qBAAqB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvD,qBAAqB,CAAC,IAAI,GAAG;IAC3B,IAAI,EAAE,qBAAqB;IAC3B,UAAU,EAAE,kBAAkB,CAAC,OAAO;IACtC,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE;QACL,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE;QAC9B,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE;KAC/B;CACF,CAAC","sourcesContent":["import { SulaChipAppearance } from './model/sula-chip.model';\n\nexport default {\n title: 'Components/sula-chip',\n tags: ['autodocs'],\n argTypes: {\n text: {\n control: 'text',\n defaultValue: 'Chip Text',\n description: 'Chip text',\n type: {\n required: false,\n },\n },\n appearance: {\n control: { type: 'select' },\n options: Object.values(SulaChipAppearance),\n defaultValue: SulaChipAppearance.Default,\n description: 'Chip appearance',\n type: {\n required: false,\n },\n },\n disabled: {\n control: 'boolean',\n defaultValue: false,\n description: 'Is chip disabled',\n type: {\n required: false,\n },\n },\n selected: {\n control: 'boolean',\n defaultValue: false,\n description: 'Is chip selected',\n type: {\n required: false,\n },\n },\n items: {\n control: 'object',\n defaultValue: [],\n description: 'Items for dropdown list',\n type: {\n required: false,\n },\n },\n itemClicked: {\n action: 'itemClicked',\n description: 'Evento emitido quando o chip é clicado',\n },\n itemSelected: {\n action: 'itemSelected',\n description: 'Evento emitido quando um item é selecionado',\n },\n },\n parameters: {\n docs: {\n description: {\n component: 'O componente Chip Sula Design System é utilizado como filtro, substituí botões pequenos e deve ser usado dentro de componentes de lista. ',\n },\n },\n },\n};\n\nconst Template = args => {\n const container = document.createElement('div');\n container.style.margin = '20px';\n\n const el = document.createElement('sula-chip');\n\n if (args.text) el.setAttribute('text', args.text);\n el.setAttribute('appearance', args.appearance);\n el.setAttribute('disabled', args.disabled.toString());\n if (args.selected) el.setAttribute('selected', args.selected.toString());\n\n if (args.items && args.items.length > 0) {\n el.items = args.items;\n }\n\n el.addEventListener('itemClicked', args.itemClicked);\n el.addEventListener('itemSelected', args.itemSelected);\n\n container.appendChild(el);\n\n return container;\n};\n\nexport const Default = Template.bind({});\nDefault.args = {\n text: 'Default Chip',\n appearance: SulaChipAppearance.Default,\n disabled: false,\n items: [],\n};\n\nexport const NegativeAppearance = Template.bind({});\nNegativeAppearance.args = {\n text: 'Negative Chip',\n appearance: SulaChipAppearance.Negative,\n disabled: false,\n items: [],\n};\n\nexport const DisabledChip = Template.bind({});\nDisabledChip.args = {\n text: 'Disabled Chip',\n appearance: SulaChipAppearance.Default,\n disabled: true,\n selected: false,\n items: [],\n};\n\nexport const SelectedChip = Template.bind({});\nSelectedChip.args = {\n text: 'Selected Chip',\n appearance: SulaChipAppearance.Default,\n disabled: false,\n selected: true,\n items: [],\n};\n\nexport const ChipWithDropdown = Template.bind({});\nChipWithDropdown.args = {\n text: 'Chip with Options',\n appearance: SulaChipAppearance.Default,\n disabled: false,\n selected: false,\n items: [\n { id: '1', title: 'Option 1' },\n { id: '2', title: 'Option 2' },\n { id: '3', title: 'Option 3' },\n ],\n};\n\nexport const NegativeChipWithDropdown = Template.bind({});\nNegativeChipWithDropdown.args = {\n text: 'Negative with Options',\n appearance: SulaChipAppearance.Negative,\n disabled: false,\n selected: false,\n items: [\n { id: '1', title: 'Remove Item 1' },\n { id: '2', title: 'Remove Item 2' },\n { id: '3', title: 'Remove Item 3' },\n ],\n};\n\nexport const DisabledChipWithItems = Template.bind({});\nDisabledChipWithItems.args = {\n text: 'Disabled with Items',\n appearance: SulaChipAppearance.Default,\n disabled: true,\n selected: false,\n items: [\n { id: '1', title: 'Option 1' },\n { id: '2', title: 'Option 2' },\n ],\n};\n"]}
@@ -1 +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}.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)}
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}.outline{outline-style:solid}:host{display:block}.dropdown-focus{outline:2px solid var(--color-feedback-informational)!important;outline-offset:2px!important}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#012b15;--color-red-50:#fef6f6;--color-red-100:#fde8e8;--color-red-200:#fad1d1;--color-red-300:#f7abab;--color-red-400:#f17474;--color-red-500:#c80505;--color-red-600:#b30404;--color-red-700:#9f0404;--color-red-800:#860303;--color-red-900:#6d0303;--color-red-950:#330d00;--color-yellow-50:#fdf4e7;--color-yellow-100:#fcedd9;--color-yellow-200:#fae0bd;--color-yellow-300:#f6c788;--color-yellow-400:#f3b159;--color-yellow-500:#ef9928;--color-yellow-600:#e49226;--color-yellow-700:#d17e10;--color-yellow-800:#b46d0e;--color-yellow-900:#93590b;--color-yellow-950:#402705;--color-orange-50:#fef4f1;--color-orange-100:#fde8e2;--color-orange-200:#fbd2c6;--color-orange-300:#f8b4a0;--color-orange-400:#f58e70;--color-orange-500:#f05223;--color-orange-600:#ea4210;--color-orange-700:#d23b0e;--color-orange-800:#b5330c;--color-orange-900:#942a0a;--color-orange-950:#401204;--color-blue-50:#ecf0f9;--color-blue-100:#dde3f4;--color-blue-200:#b2c2e5;--color-blue-300:#7994d2;--color-blue-400:#4066bf;--color-blue-500:#001e64;--color-blue-600:#001c5c;--color-blue-700:#00174c;--color-blue-800:#00123d;--color-blue-900:#000f33;--color-blue-950:#000d2b;--color-ambar-50:#fff6eb;--color-ambar-100:#ffefdc;--color-ambar-200:#fedfb9;--color-ambar-300:#fdca8b;--color-ambar-400:#fdb359;--color-ambar-500:#fc9c26;--color-ambar-600:#ec8403;--color-ambar-700:#d87803;--color-ambar-800:#ba6803;--color-ambar-900:#975402;--color-ambar-950:#402301;--color-gray-50:#fff;--color-gray-100:#f3f4f4;--color-gray-200:#e5e6e6;--color-gray-300:#bfc0c0;--color-gray-400:#acaeae;--color-gray-500:#949595;--color-gray-600:#737575;--color-gray-700:#6c6e6e;--color-gray-800:#313333;--color-gray-900:#272929;--color-gray-950:#191d1d;--color-white-opacity-50:#ffffff0d;--color-white-opacity-100:#ffffff1a;--color-white-opacity-200:#ffffff26;--color-white-opacity-300:#ffffff45;--color-white-opacity-400:#ffffff5c;--color-white-opacity-500:#ffffff80;--color-white-opacity-600:#ffffff8c;--color-white-opacity-700:#ffffffa3;--color-white-opacity-800:#ffffffba;--color-white-opacity-900:#fffc;--color-white-opacity-950:#ffffffe8;--color-ciano-50:#f1f6fe;--color-ciano-100:#dfeafc;--color-ciano-200:#c3d9f9;--color-ciano-300:#90b9f4;--color-ciano-400:#5d98ee;--color-ciano-500:#1769e0;--color-ciano-600:#155fcb;--color-ciano-700:#1355b4;--color-ciano-800:#104899;--color-ciano-900:#0d3b7d;--color-ciano-950:#071e40;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:rgba(25,29,29,.02);--color-black-opacity-100:rgba(25,29,29,.05);--color-black-opacity-200:rgba(25,29,29,.11);--color-black-opacity-300:rgba(25,29,29,.28);--color-black-opacity-400:rgba(25,29,29,.36);--color-black-opacity-500:rgba(25,29,29,.44);--color-black-opacity-600:rgba(25,29,29,.62);--color-black-opacity-700:rgba(25,29,29,.64);--color-black-opacity-800:rgba(25,29,29,.72);--color-black-opacity-900:rgba(25,29,29,.8);--color-black-opacity-950:rgba(25,29,29,.96);--color-shadow-opacity-50:rgba(0,0,0,.04);--color-shadow-opacity-100:rgba(0,0,0,.06);--color-shadow-opacity-200:rgba(0,0,0,.12);--color-shadow-opacity-300:rgba(0,0,0,.2);--color-shadow-opacity-400:rgba(0,0,0,.32);--color-shadow-opacity-500:rgba(0,0,0,.5);--color-shadow-opacity-600:rgba(0,0,0,.55);--color-shadow-opacity-700:rgba(0,0,0,.64);--color-shadow-opacity-800:rgba(0,0,0,.73);--color-shadow-opacity-900:rgba(0,0,0,.8);--color-shadow-opacity-950:rgba(0,0,0,.91);--color-feedback-success:#04843f;--color-feedback-error:#c80505;--color-feedback-informational:#1355b4;--color-feedback-alert:#ef9928;--color-brand-primary:#f05223;--color-brand-secondary:#001c5c;--color-brand-tertiary-1:#1769e0;--color-brand-tertiary-2:#fc9c26;--color-surface-body:#fff;--color-surface-on-body:#f3f4f4;--color-surface-on-body-blue:#e7f0f4;--color-surface-on-body-brand:#fff6eb;--color-surface-on-body-feedback-success:#e6f4ed;--color-surface-on-body-feedback-error:#fde8e8;--color-surface-on-body-feedback-alert:#fdf4e7;--color-surface-on-body-feedback-info:#dfeafc;--color-text-brand:#f05223;--color-text-primary:#313333;--color-text-secondary:#6c6e6e;--color-text-disabled:#949595;--color-text-link:#1355b4;--color-states-empty-bg-hover:rgba(25,29,29,.05);--color-states-empty-bg-pressed:rgba(25,29,29,.11);--color-states-bg-disabled:rgba(25,29,29,.02);--color-states-bg-focus:#1355b4;--color-states-primary-hover:#ea4210;--color-states-primary-pressed:#d23b0e;--color-states-danger-hover:#b30404;--color-states-danger-pressed:#9f0404;--color-states-negative-hover:#e5e6e6;--color-states-negative-pressed:#bfc0c0;--color-icon-primary:#6c6e6e;--color-icon-secondary:#fff;--color-icon-tertiary:#b30404;--color-icon-disabled:#acaeae;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f3f4f4;--color-neutral-neutral-3:#acaeae;--color-neutral-neutral-4:#949595;--color-neutral-neutral-5:#737575;--color-neutral-neutral-6:#6c6e6e;--color-neutral-neutral-7:#313333;--color-neutral-neutral-8:#272929;--color-negative-negative-1:#fff;--color-negative-negative-2:#313333;--color-opacity-body:#fffc;--color-opacity-on-body:rgba(25,29,29,.02);--color-opacity-overlay:rgba(25,29,29,.62);--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949595;--color-line-general-strong:#bfc0c0;--color-line-general:#e5e6e6;--color-line-hair:rgba(25,29,29,.05);--color-box-shadow-body:#fff;--color-box-shadow-shadow-color-1:rgba(0,0,0,.04);--color-box-shadow-shadow-color-2:rgba(0,0,0,.06)}.static{position:static}.absolute{position:absolute}.relative{position:relative}.bottom-\[72px\]{bottom:72px}.left-0{left:0}.top-\[72px\]{top:72px}.z-50{z-index:50}.m-0{margin:0}.ml-8{margin-left:.5rem}.flex{display:flex}.h-\[72px\]{height:72px}.w-full{width:100%}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.rounded-sm,.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-none{border-style:none}.border-line-general{border-color:var(--color-line-general)}.border-line-input{border-color:var(--color-line-input)}.bg-states-bg-disabled{background-color:var(--color-states-bg-disabled)}.bg-surface-body{background-color:var(--color-surface-body)}.bg-transparent{background-color:transparent}.p-0{padding:0}.px-16{padding-left:1rem;padding-right:1rem}.px-24{padding-left:1.5rem;padding-right:1.5rem}.py-16{padding-bottom:1rem;padding-top:1rem}.pt-4{padding-top:.25rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.leading-4{line-height:1rem}.leading-6{line-height:1.5rem}.text-icon-disabled{color:var(--color-icon-disabled)}.text-text-disabled{color:var(--color-text-disabled)}.text-text-primary{color:var(--color-text-primary)}.text-text-secondary{color:var(--color-text-secondary)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.placeholder\:text-text-secondary::placeholder{color:var(--color-text-secondary)}.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)}
@@ -9,10 +9,15 @@ export class SulaDropdown {
9
9
  * Items for list
10
10
  */
11
11
  this.items = [];
12
+ /**
13
+ * Maximum height for dropdown menu in pixels
14
+ */
15
+ this.menuMaxHeight = 260;
12
16
  this.showItems = false;
13
17
  this.isFocused = false;
14
18
  this.searchTerm = '';
15
19
  this.filteredItems = [];
20
+ this.openUpward = false;
16
21
  this.handleClick = () => {
17
22
  if (this.disabled)
18
23
  return;
@@ -77,14 +82,33 @@ export class SulaDropdown {
77
82
  this.showItems = false;
78
83
  }
79
84
  }
85
+ handleWindowResize() {
86
+ if (this.showItems) {
87
+ this.calculateMenuPosition();
88
+ }
89
+ }
90
+ calculateMenuPosition() {
91
+ if (!this.node)
92
+ return;
93
+ const rect = this.node.getBoundingClientRect();
94
+ const viewportHeight = window.innerHeight;
95
+ const spaceBelow = viewportHeight - rect.bottom;
96
+ const spaceAbove = rect.top;
97
+ const buffer = 60;
98
+ const requiredSpace = this.menuMaxHeight + buffer;
99
+ this.openUpward = spaceBelow < requiredSpace && (spaceAbove > requiredSpace || spaceAbove > spaceBelow);
100
+ }
80
101
  componentWillLoad() {
81
102
  if (this.value) {
82
103
  this.selectedItem = this.value;
83
104
  }
84
105
  }
85
106
  componentDidRender() {
86
- if (this.showItems && this.searchable && this.searchInputRef) {
87
- this.searchInputRef.focus();
107
+ if (this.showItems) {
108
+ this.calculateMenuPosition();
109
+ if (this.searchable && this.searchInputRef) {
110
+ this.searchInputRef.focus();
111
+ }
88
112
  }
89
113
  }
90
114
  getIconClass() {
@@ -94,12 +118,12 @@ export class SulaDropdown {
94
118
  }
95
119
  render() {
96
120
  var _a;
97
- return (h(Host, { key: 'c0731dd4a3330060b4ecdcb0b2c3b466c99e661b', ref: node => (this.node = node) }, h("div", { key: 'bfa63d3d6b5ff252e58f2481e7ac6375a12c5231', class: {
121
+ return (h(Host, { key: '146e6a1dc2c2639618a3ae0d046e14aaebb62801', ref: node => (this.node = node) }, h("div", { key: '978cf1c558165eaf6e37e90216c4bfaef2fa9b66', class: {
98
122
  'flex justify-between items-center border border-line-input h-[72px] px-16 rounded-xl relative': true,
99
123
  'bg-surface-body cursor-pointer': !this.disabled,
100
124
  'bg-states-bg-disabled': this.disabled,
101
125
  'dropdown-focus': this.isFocused,
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: {
126
+ }, onClick: this.handleClick, tabIndex: 0, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("div", { key: '8bbbba5ab876307a16bccbc91de25769ef0e4221', class: "flex flex-col w-full" }, h("label", { key: '1964385da87ff7db0a36374c18e95fb569278dff', class: {
103
127
  'text-base leading-4': !this.selectedItem && !(this.searchable && this.showItems),
104
128
  'text-sm leading-4 font-bold': !!this.selectedItem || (this.searchable && this.showItems),
105
129
  'text-text-primary': !this.disabled,
@@ -108,13 +132,17 @@ export class SulaDropdown {
108
132
  'text-base leading-4 pt-4': true,
109
133
  'text-text-primary': !this.disabled,
110
134
  'text-text-disabled': this.disabled,
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" }, (() => {
135
+ } }, this.selectedItem.title)))), h("div", { key: 'e1dddd3b7123149a0fb08309614affc77003d2d2', class: "flex items-center justify-center ml-8 leading-6 text-2xl" }, h("sula-icon", { key: 'e9d5bf513fe342629801c25b95bd9ef2ee7fac50', icon: `ph ph-caret-${this.showItems ? 'up' : 'down'}`, customClass: `${this.getIconClass()} text-2xl` })), this.showItems && (h("div", { key: '0e79ca32925f98ace35f2c2d3892d2b8c46e5104', class: {
136
+ 'absolute z-50 left-0 w-full transition-all duration-200 ease-in-out': true,
137
+ 'bottom-[72px]': this.openUpward,
138
+ 'top-[72px]': !this.openUpward,
139
+ } }, (() => {
112
140
  const itemsToShow = this.searchable && this.searchTerm.trim() ? this.filteredItems : this.items;
113
141
  const showNoResults = this.searchable && this.searchTerm.trim() && itemsToShow.length === 0;
114
142
  if (showNoResults) {
115
143
  return (h("div", { class: "bg-surface-body border border-line-general rounded-sm py-16 px-24 text-base text-text-secondary" }, "Nenhum resultado encontrado"));
116
144
  }
117
- return (h("sula-menu-select-list", { items: itemsToShow, fullWidth: true, selectedValue: this.selectedItem, onItemSelected: this.handleItemSelected }));
145
+ return (h("sula-menu-select-list", { items: itemsToShow, fullWidth: true, maxHeight: this.menuMaxHeight, selectedValue: this.selectedItem, onItemSelected: this.handleItemSelected }));
118
146
  })())))));
119
147
  }
120
148
  static get is() { return "sula-dropdown"; }
@@ -237,6 +265,26 @@ export class SulaDropdown {
237
265
  "getter": false,
238
266
  "setter": false,
239
267
  "reflect": true
268
+ },
269
+ "menuMaxHeight": {
270
+ "type": "number",
271
+ "attribute": "menu-max-height",
272
+ "mutable": false,
273
+ "complexType": {
274
+ "original": "number",
275
+ "resolved": "number",
276
+ "references": {}
277
+ },
278
+ "required": false,
279
+ "optional": false,
280
+ "docs": {
281
+ "tags": [],
282
+ "text": "Maximum height for dropdown menu in pixels"
283
+ },
284
+ "getter": false,
285
+ "setter": false,
286
+ "reflect": false,
287
+ "defaultValue": "260"
240
288
  }
241
289
  };
242
290
  }
@@ -246,7 +294,8 @@ export class SulaDropdown {
246
294
  "showItems": {},
247
295
  "isFocused": {},
248
296
  "searchTerm": {},
249
- "filteredItems": {}
297
+ "filteredItems": {},
298
+ "openUpward": {}
250
299
  };
251
300
  }
252
301
  static get events() {
@@ -334,6 +383,12 @@ export class SulaDropdown {
334
383
  "target": "document",
335
384
  "capture": false,
336
385
  "passive": false
386
+ }, {
387
+ "name": "resize",
388
+ "method": "handleWindowResize",
389
+ "target": "window",
390
+ "capture": false,
391
+ "passive": true
337
392
  }];
338
393
  }
339
394
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sula-dropdown.js","sourceRoot":"","sources":["../../../src/components/sula-dropdown/sula-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAQpG,MAAM,OAAO,YAAY;IALzB;QAYE;;WAEG;QAEH,aAAQ,GAAY,KAAK,CAAC;QAE1B;;WAEG;QAEH,UAAK,GAAuB,EAAE,CAAC;QA0C/B,cAAS,GAAG,KAAK,CAAC;QAGlB,cAAS,GAAG,KAAK,CAAC;QAGlB,eAAU,GAAW,EAAE,CAAC;QAGxB,kBAAa,GAAuB,EAAE,CAAC;QA4CvC,gBAAW,GAAG,GAAG,EAAE;YACjB,IAAI,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAE1B,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;YAE5B,IAAI,IAAI,CA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E,IAAI,EACf,aAAa,EAAE,IAAI,CAAC,YAAY,EAChC,cAAc,EAAE,IAAI,CAAC,kBAAkB,GAChB,CAC1B,CAAC;gBACJ,CAAC,CAAC,EAAE,CACA,CACP,CACG,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { SulaMenuListItem, SulaMenuSelectListCustomEvent } from '../../components';\n\n@Component({\n tag: 'sula-dropdown',\n styleUrl: 'sula-dropdown.scss',\n shadow: true,\n})\nexport class SulaDropdown {\n /**\n * Dropdown label\n */\n @Prop({ mutable: true })\n label: string;\n\n /**\n * Dropdown is disabled\n */\n @Prop({ mutable: true })\n disabled: boolean = false;\n\n /**\n * Items for list\n */\n @Prop({ mutable: true })\n items: SulaMenuListItem[] = [];\n\n /**\n * Value for dropdown\n */\n @Prop({ mutable: true })\n value?: SulaMenuListItem;\n\n /**\n * Enable search/filter functionality in dropdown\n */\n @Prop({ reflect: true })\n searchable?: boolean;\n\n /**\n * Event emitted when dropdown is clicked\n */\n @Event()\n dropdownClicked: EventEmitter<void>;\n\n /**\n * Event emitted when dropdown is focused\n */\n @Event()\n dropdownFocused: EventEmitter<void>;\n\n /**\n * Event emitted when dropdown is focused out\n */\n @Event()\n dropdownFocusedOut: EventEmitter<void>;\n\n /**\n * Event emitted when item is selected\n */\n @Event()\n menuItemSelected: EventEmitter<SulaMenuListItem>;\n\n @State()\n selectedItem?: SulaMenuListItem;\n\n @State()\n showItems = false;\n\n @State()\n isFocused = false;\n\n @State()\n searchTerm: string = '';\n\n @State()\n filteredItems: SulaMenuListItem[] = [];\n\n node?: HTMLElement;\n searchInputRef?: HTMLInputElement;\n\n @Watch('value')\n handleValueChange() {\n if (this.value) {\n this.selectedItem = this.value;\n }\n }\n\n @Watch('showItems')\n handleShowItemsChange(newValue: boolean) {\n if (!newValue) {\n this.searchTerm = '';\n this.filteredItems = [];\n }\n }\n\n @Listen('click', { target: 'document' })\n handleDocumentClick(event: Event) {\n if (!this.node) return;\n\n const path = event.composedPath();\n const clickInside = path.some(el => el === this.node);\n\n if (!clickInside) {\n this.showItems = false;\n }\n }\n\n componentWillLoad() {\n if (this.value) {\n this.selectedItem = this.value;\n }\n }\n\n componentDidRender() {\n if (this.showItems && this.searchable && this.searchInputRef) {\n this.searchInputRef.focus();\n }\n }\n\n handleClick = () => {\n if (this.disabled) return;\n\n this.dropdownClicked.emit();\n\n if (this.items.length > 0) {\n this.showItems = !this.showItems;\n }\n\n if (this.searchable && this.showItems && this.searchInputRef) {\n this.searchInputRef.focus();\n }\n };\n\n handleItemSelected = (item: SulaMenuSelectListCustomEvent<SulaMenuListItem>) => {\n this.selectedItem = item.detail;\n this.searchTerm = '';\n this.menuItemSelected.emit(item.detail);\n\n setTimeout(() => {\n this.showItems = false;\n }, 0);\n };\n\n filterItems = () => {\n if (!this.searchTerm.trim()) {\n return this.items;\n }\n const term = this.searchTerm.toLowerCase();\n return this.items.filter(item => item.title.toLowerCase().includes(term));\n };\n\n handleSearchInput = (event: Event) => {\n const target = event.target as HTMLInputElement;\n this.searchTerm = target.value;\n this.filteredItems = this.filterItems();\n };\n\n getIconClass() {\n if (this.disabled) return 'text-icon-disabled';\n\n return 'text-text-primary';\n }\n\n handleFocus = () => {\n if (this.disabled) return;\n\n this.isFocused = true;\n this.dropdownFocused.emit();\n };\n\n handleBlur = () => {\n if (this.disabled) return;\n\n this.isFocused = false;\n this.dropdownFocusedOut.emit();\n };\n\n render() {\n return (\n <Host ref={node => (this.node = node)}>\n <div\n class={{\n 'flex justify-between items-center border border-line-input h-[72px] px-16 rounded-xl relative': true,\n 'bg-surface-body cursor-pointer': !this.disabled,\n 'bg-states-bg-disabled': this.disabled,\n 'dropdown-focus': this.isFocused,\n }}\n onClick={this.handleClick}\n tabIndex={0}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n >\n <div class=\"flex flex-col w-full\">\n <label\n class={{\n 'text-base leading-4': !this.selectedItem && !(this.searchable && this.showItems),\n 'text-sm leading-4 font-bold': !!this.selectedItem || (this.searchable && this.showItems),\n 'text-text-primary': !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.label}\n </label>\n\n {this.searchable && this.showItems ? (\n <input\n ref={el => (this.searchInputRef = el)}\n type=\"text\"\n value={this.searchTerm}\n onInput={this.handleSearchInput}\n placeholder={this.selectedItem?.title || ''}\n class=\"w-full text-base text-text-primary bg-transparent border-none outline-none placeholder:text-text-secondary p-0 m-0 leading-4 pt-4\"\n />\n ) : (\n !!this.selectedItem && (\n <span\n class={{\n 'text-base leading-4 pt-4': true,\n 'text-text-primary': !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.selectedItem.title}\n </span>\n )\n )}\n </div>\n <div class=\"flex items-center justify-center ml-8 leading-6 text-2xl\">\n <sula-icon icon={`ph ph-caret-${this.showItems ? 'up' : 'down'}`} customClass={`${this.getIconClass()} text-2xl`}></sula-icon>\n </div>\n\n {this.showItems && (\n <div class=\"absolute z-50 top-[72px] left-0 w-full\">\n {(() => {\n const itemsToShow = this.searchable && this.searchTerm.trim() ? this.filteredItems : this.items;\n const showNoResults = this.searchable && this.searchTerm.trim() && itemsToShow.length === 0;\n\n if (showNoResults) {\n return (\n <div class=\"bg-surface-body border border-line-general rounded-sm py-16 px-24 text-base text-text-secondary\">\n Nenhum resultado encontrado\n </div>\n );\n }\n\n return (\n <sula-menu-select-list\n items={itemsToShow}\n fullWidth={true}\n selectedValue={this.selectedItem}\n onItemSelected={this.handleItemSelected}\n ></sula-menu-select-list>\n );\n })()}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AAC,IAAI,CAAC,KAAK,CAAC;oBAChG,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC;oBAE5F,IAAI,aAAa,EAAE,CAAC;wBAClB,OAAO,CACL,WAAK,KAAK,EAAC,iGAAiG,kCAEtG,CACP,CAAC;oBACJ,CAAC;oBAED,OAAO,CACL,6BACE,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,IAAI,EACf,SAAS,EAAE,IAAI,CAAC,aAAa,EAC7B,aAAa,EAAE,IAAI,CAAC,YAAY,EAChC,cAAc,EAAE,IAAI,CAAC,kBAAkB,GAChB,CAC1B,CAAC;gBACJ,CAAC,CAAC,EAAE,CACA,CACP,CACG,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { SulaMenuListItem, SulaMenuSelectListCustomEvent } from '../../components';\n\n@Component({\n tag: 'sula-dropdown',\n styleUrl: 'sula-dropdown.scss',\n shadow: true,\n})\nexport class SulaDropdown {\n /**\n * Dropdown label\n */\n @Prop({ mutable: true })\n label: string;\n\n /**\n * Dropdown is disabled\n */\n @Prop({ mutable: true })\n disabled: boolean = false;\n\n /**\n * Items for list\n */\n @Prop({ mutable: true })\n items: SulaMenuListItem[] = [];\n\n /**\n * Value for dropdown\n */\n @Prop({ mutable: true })\n value?: SulaMenuListItem;\n\n /**\n * Enable search/filter functionality in dropdown\n */\n @Prop({ reflect: true })\n searchable?: boolean;\n\n /**\n * Maximum height for dropdown menu in pixels\n */\n @Prop()\n menuMaxHeight: number = 260;\n\n /**\n * Event emitted when dropdown is clicked\n */\n @Event()\n dropdownClicked: EventEmitter<void>;\n\n /**\n * Event emitted when dropdown is focused\n */\n @Event()\n dropdownFocused: EventEmitter<void>;\n\n /**\n * Event emitted when dropdown is focused out\n */\n @Event()\n dropdownFocusedOut: EventEmitter<void>;\n\n /**\n * Event emitted when item is selected\n */\n @Event()\n menuItemSelected: EventEmitter<SulaMenuListItem>;\n\n @State()\n selectedItem?: SulaMenuListItem;\n\n @State()\n showItems = false;\n\n @State()\n isFocused = false;\n\n @State()\n searchTerm: string = '';\n\n @State()\n filteredItems: SulaMenuListItem[] = [];\n\n @State()\n openUpward: boolean = false;\n\n node?: HTMLElement;\n searchInputRef?: HTMLInputElement;\n\n @Watch('value')\n handleValueChange() {\n if (this.value) {\n this.selectedItem = this.value;\n }\n }\n\n @Watch('showItems')\n handleShowItemsChange(newValue: boolean) {\n if (!newValue) {\n this.searchTerm = '';\n this.filteredItems = [];\n }\n }\n\n @Listen('click', { target: 'document' })\n handleDocumentClick(event: Event) {\n if (!this.node) return;\n\n const path = event.composedPath();\n const clickInside = path.some(el => el === this.node);\n\n if (!clickInside) {\n this.showItems = false;\n }\n }\n\n @Listen('resize', { target: 'window' })\n handleWindowResize() {\n if (this.showItems) {\n this.calculateMenuPosition();\n }\n }\n\n calculateMenuPosition() {\n if (!this.node) return;\n\n const rect = this.node.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const spaceBelow = viewportHeight - rect.bottom;\n const spaceAbove = rect.top;\n const buffer = 60; \n const requiredSpace = this.menuMaxHeight + buffer;\n\n this.openUpward = spaceBelow < requiredSpace && (spaceAbove > requiredSpace || spaceAbove > spaceBelow);\n }\n\n componentWillLoad() {\n if (this.value) {\n this.selectedItem = this.value;\n }\n }\n\n componentDidRender() {\n if (this.showItems) {\n this.calculateMenuPosition();\n \n if (this.searchable && this.searchInputRef) {\n this.searchInputRef.focus();\n }\n }\n }\n\n handleClick = () => {\n if (this.disabled) return;\n\n this.dropdownClicked.emit();\n\n if (this.items.length > 0) {\n this.showItems = !this.showItems;\n }\n\n if (this.searchable && this.showItems && this.searchInputRef) {\n this.searchInputRef.focus();\n }\n };\n\n handleItemSelected = (item: SulaMenuSelectListCustomEvent<SulaMenuListItem>) => {\n this.selectedItem = item.detail;\n this.searchTerm = '';\n this.menuItemSelected.emit(item.detail);\n\n setTimeout(() => {\n this.showItems = false;\n }, 0);\n };\n\n filterItems = () => {\n if (!this.searchTerm.trim()) {\n return this.items;\n }\n const term = this.searchTerm.toLowerCase();\n return this.items.filter(item => item.title.toLowerCase().includes(term));\n };\n\n handleSearchInput = (event: Event) => {\n const target = event.target as HTMLInputElement;\n this.searchTerm = target.value;\n this.filteredItems = this.filterItems();\n };\n\n getIconClass() {\n if (this.disabled) return 'text-icon-disabled';\n\n return 'text-text-primary';\n }\n\n handleFocus = () => {\n if (this.disabled) return;\n\n this.isFocused = true;\n this.dropdownFocused.emit();\n };\n\n handleBlur = () => {\n if (this.disabled) return;\n\n this.isFocused = false;\n this.dropdownFocusedOut.emit();\n };\n\n render() {\n return (\n <Host ref={node => (this.node = node)}>\n <div\n class={{\n 'flex justify-between items-center border border-line-input h-[72px] px-16 rounded-xl relative': true,\n 'bg-surface-body cursor-pointer': !this.disabled,\n 'bg-states-bg-disabled': this.disabled,\n 'dropdown-focus': this.isFocused,\n }}\n onClick={this.handleClick}\n tabIndex={0}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n >\n <div class=\"flex flex-col w-full\">\n <label\n class={{\n 'text-base leading-4': !this.selectedItem && !(this.searchable && this.showItems),\n 'text-sm leading-4 font-bold': !!this.selectedItem || (this.searchable && this.showItems),\n 'text-text-primary': !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.label}\n </label>\n\n {this.searchable && this.showItems ? (\n <input\n ref={el => (this.searchInputRef = el)}\n type=\"text\"\n value={this.searchTerm}\n onInput={this.handleSearchInput}\n placeholder={this.selectedItem?.title || ''}\n class=\"w-full text-base text-text-primary bg-transparent border-none outline-none placeholder:text-text-secondary p-0 m-0 leading-4 pt-4\"\n />\n ) : (\n !!this.selectedItem && (\n <span\n class={{\n 'text-base leading-4 pt-4': true,\n 'text-text-primary': !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.selectedItem.title}\n </span>\n )\n )}\n </div>\n <div class=\"flex items-center justify-center ml-8 leading-6 text-2xl\">\n <sula-icon icon={`ph ph-caret-${this.showItems ? 'up' : 'down'}`} customClass={`${this.getIconClass()} text-2xl`}></sula-icon>\n </div>\n\n {this.showItems && (\n <div class={{\n 'absolute z-50 left-0 w-full transition-all duration-200 ease-in-out': true,\n 'bottom-[72px]': this.openUpward,\n 'top-[72px]': !this.openUpward,\n }}>\n {(() => {\n const itemsToShow = this.searchable && this.searchTerm.trim() ? this.filteredItems : this.items;\n const showNoResults = this.searchable && this.searchTerm.trim() && itemsToShow.length === 0;\n\n if (showNoResults) {\n return (\n <div class=\"bg-surface-body border border-line-general rounded-sm py-16 px-24 text-base text-text-secondary\">\n Nenhum resultado encontrado\n </div>\n );\n }\n\n return (\n <sula-menu-select-list\n items={itemsToShow}\n fullWidth={true}\n maxHeight={this.menuMaxHeight}\n selectedValue={this.selectedItem}\n onItemSelected={this.handleItemSelected}\n ></sula-menu-select-list>\n );\n })()}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}