@sula-tech/webcomponents 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-3eac14f6.js → index-87eec792.js} +26 -3
- package/dist/cjs/index-87eec792.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{sula-avatar_4.cjs.entry.js → sula-avatar_9.cjs.entry.js} +526 -9
- package/dist/cjs/sula-avatar_9.cjs.entry.js.map +1 -0
- package/dist/cjs/webcomponents.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +5 -0
- package/dist/collection/components/sula-badge/model/sula-badge.model.js +23 -0
- package/dist/collection/components/sula-badge/model/sula-badge.model.js.map +1 -0
- package/dist/collection/components/sula-badge/sula-badge.css +1 -0
- package/dist/collection/components/sula-badge/sula-badge.js +230 -0
- package/dist/collection/components/sula-badge/sula-badge.js.map +1 -0
- package/dist/collection/components/sula-badge/sula-badge.stories.js +148 -0
- package/dist/collection/components/sula-badge/sula-badge.stories.js.map +1 -0
- package/dist/collection/components/sula-button/sula-button.css +1 -1
- package/dist/collection/components/sula-button/sula-button.js +1 -1
- package/dist/collection/components/sula-checkbox/model/sula-checkbox.model.js +6 -0
- package/dist/collection/components/sula-checkbox/model/sula-checkbox.model.js.map +1 -0
- package/dist/collection/components/sula-checkbox/sula-checkbox.css +1 -0
- package/dist/collection/components/sula-checkbox/sula-checkbox.js +233 -0
- package/dist/collection/components/sula-checkbox/sula-checkbox.js.map +1 -0
- package/dist/collection/components/sula-checkbox/sula-checkbox.stories.js +113 -0
- package/dist/collection/components/sula-checkbox/sula-checkbox.stories.js.map +1 -0
- package/dist/collection/components/sula-icon/sula-icon.css +1 -1
- package/dist/collection/components/sula-icon/sula-icon.js +1 -1
- package/dist/collection/components/sula-icon/sula-icon.stories.js +1 -1
- package/dist/collection/components/sula-icon/sula-icon.stories.js.map +1 -1
- package/dist/collection/components/sula-switch/model/sula-switch.model.js +6 -0
- package/dist/collection/components/sula-switch/model/sula-switch.model.js.map +1 -0
- package/dist/collection/components/sula-switch/sula-switch.css +1 -0
- package/dist/collection/components/sula-switch/sula-switch.js +235 -0
- package/dist/collection/components/sula-switch/sula-switch.js.map +1 -0
- package/dist/collection/components/sula-switch/sula-switch.stories.js +111 -0
- package/dist/collection/components/sula-switch/sula-switch.stories.js.map +1 -0
- package/dist/collection/components/sula-tag/model/sula-tag.model.js +28 -0
- package/dist/collection/components/sula-tag/model/sula-tag.model.js.map +1 -0
- package/dist/collection/components/sula-tag/sula-tag.css +1 -0
- package/dist/collection/components/sula-tag/sula-tag.js +249 -0
- package/dist/collection/components/sula-tag/sula-tag.js.map +1 -0
- package/dist/collection/components/sula-tag/sula-tag.stories.js +201 -0
- package/dist/collection/components/sula-tag/sula-tag.stories.js.map +1 -0
- package/dist/collection/components/sula-textarea/model/sula-textarea.model.js +6 -0
- package/dist/collection/components/sula-textarea/model/sula-textarea.model.js.map +1 -0
- package/dist/collection/components/sula-textarea/sula-textarea.css +1 -0
- package/dist/collection/components/sula-textarea/sula-textarea.js +358 -0
- package/dist/collection/components/sula-textarea/sula-textarea.js.map +1 -0
- package/dist/collection/components/sula-textarea/sula-textarea.stories.js +138 -0
- package/dist/collection/components/sula-textarea/sula-textarea.stories.js.map +1 -0
- package/dist/collection/components/sula-textfield/sula-textfield.css +1 -1
- package/dist/collection/components/sula-textfield/sula-textfield.js +2 -2
- package/dist/collection/components/sula-textfield/sula-textfield.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-a07ff261.js → p-2d5f97d1.js} +4 -4
- package/dist/components/{p-a07ff261.js.map → p-2d5f97d1.js.map} +1 -1
- package/dist/components/{p-ca146b16.js → p-881c6b35.js} +25 -3
- package/dist/components/p-881c6b35.js.map +1 -0
- package/dist/components/sula-avatar.js +2 -2
- package/dist/components/sula-badge.d.ts +11 -0
- package/dist/components/sula-badge.js +154 -0
- package/dist/components/sula-badge.js.map +1 -0
- package/dist/components/sula-button.js +4 -4
- package/dist/components/sula-button.js.map +1 -1
- package/dist/components/sula-checkbox.d.ts +11 -0
- package/dist/components/sula-checkbox.js +109 -0
- package/dist/components/sula-checkbox.js.map +1 -0
- package/dist/components/sula-icon.js +1 -1
- package/dist/components/sula-switch.d.ts +11 -0
- package/dist/components/sula-switch.js +105 -0
- package/dist/components/sula-switch.js.map +1 -0
- package/dist/components/sula-tag.d.ts +11 -0
- package/dist/components/sula-tag.js +157 -0
- package/dist/components/sula-tag.js.map +1 -0
- package/dist/components/sula-textarea.d.ts +11 -0
- package/dist/components/sula-textarea.js +166 -0
- package/dist/components/sula-textarea.js.map +1 -0
- package/dist/components/sula-textfield.js +5 -5
- package/dist/components/sula-textfield.js.map +1 -1
- package/dist/esm/{index-1dc4ae53.js → index-aa1c5f36.js} +26 -4
- package/dist/esm/index-aa1c5f36.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{sula-avatar_4.entry.js → sula-avatar_9.entry.js} +522 -10
- package/dist/esm/sula-avatar_9.entry.js.map +1 -0
- package/dist/esm/webcomponents.js +3 -3
- package/dist/types/components/sula-badge/model/sula-badge.model.d.ts +19 -0
- package/dist/types/components/sula-badge/sula-badge.d.ts +33 -0
- package/dist/types/components/sula-badge/sula-badge.stories.d.ts +65 -0
- package/dist/types/components/sula-checkbox/model/sula-checkbox.model.d.ts +4 -0
- package/dist/types/components/sula-checkbox/sula-checkbox.d.ts +42 -0
- package/dist/types/components/sula-checkbox/sula-checkbox.stories.d.ts +73 -0
- package/dist/types/components/sula-switch/model/sula-switch.model.d.ts +4 -0
- package/dist/types/components/sula-switch/sula-switch.d.ts +41 -0
- package/dist/types/components/sula-switch/sula-switch.stories.d.ts +72 -0
- package/dist/types/components/sula-tag/model/sula-tag.model.d.ts +23 -0
- package/dist/types/components/sula-tag/sula-tag.d.ts +33 -0
- package/dist/types/components/sula-tag/sula-tag.stories.d.ts +82 -0
- package/dist/types/components/sula-textarea/model/sula-textarea.model.d.ts +4 -0
- package/dist/types/components/sula-textarea/sula-textarea.d.ts +65 -0
- package/dist/types/components/sula-textarea/sula-textarea.stories.d.ts +98 -0
- package/dist/types/components.d.ts +394 -0
- package/dist/webcomponents/{p-77709b3c.entry.js → p-1c8457aa.entry.js} +761 -100
- package/dist/webcomponents/p-1c8457aa.entry.js.map +1 -0
- package/dist/webcomponents/{p-fbee9d79.js → p-5a36af0f.js} +272 -250
- package/dist/{esm/index-1dc4ae53.js.map → webcomponents/p-5a36af0f.js.map} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +44 -3
- package/dist/webcomponents/webcomponents.esm.js.map +1 -1
- package/package.json +2 -2
- package/readme.md +36 -18
- package/dist/cjs/index-3eac14f6.js.map +0 -1
- package/dist/cjs/sula-avatar_4.cjs.entry.js.map +0 -1
- package/dist/components/p-ca146b16.js.map +0 -1
- package/dist/esm/sula-avatar_4.entry.js.map +0 -1
- package/dist/webcomponents/p-77709b3c.entry.js.map +0 -1
- package/dist/webcomponents/p-fbee9d79.js.map +0 -1
|
@@ -7,7 +7,7 @@ export class SulaIcon {
|
|
|
7
7
|
this.customClass = '';
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: '278e98706a62d329cc62298eff75a89e52854647' }, h("i", { key: '9c12043ef6d1cf007281f560117a1e8355b559fe', class: `${this.icon} ${this.customClass} sula-icon` })));
|
|
11
11
|
}
|
|
12
12
|
static get is() { return "sula-icon"; }
|
|
13
13
|
static get originalStyleUrls() {
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
const Template = args => {
|
|
24
24
|
const container = document.createElement('div');
|
|
25
25
|
container.style.margin = '20px';
|
|
26
|
-
container.style.fontSize = '24px';
|
|
26
|
+
container.style.fontSize = '24px';
|
|
27
27
|
const el = document.createElement('sula-icon');
|
|
28
28
|
el.setAttribute('icon', args.icon);
|
|
29
29
|
if (args.customClass)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sula-icon.stories.js","sourceRoot":"","sources":["../../../src/components/sula-icon/sula-icon.stories.tsx"],"names":[],"mappings":"AAAA,eAAe;IACb,KAAK,EAAE,sBAAsB;IAC7B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,aAAa;YAC3B,WAAW,EAAE,gBAAgB;YAC7B,IAAI,EAAE;gBACJ,QAAQ,EAAE,IAAI;aACf;SACF;QACD,WAAW,EAAE;YACX,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,EAAE;YAChB,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE;gBACJ,QAAQ,EAAE,KAAK;aAChB;SACF;KACF;CACF,CAAC;AAEF,MAAM,QAAQ,GAAG,IAAI,CAAC,EAAE;IACtB,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAChD,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IAChC,SAAS,CAAC,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC
|
|
1
|
+
{"version":3,"file":"sula-icon.stories.js","sourceRoot":"","sources":["../../../src/components/sula-icon/sula-icon.stories.tsx"],"names":[],"mappings":"AAAA,eAAe;IACb,KAAK,EAAE,sBAAsB;IAC7B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,aAAa;YAC3B,WAAW,EAAE,gBAAgB;YAC7B,IAAI,EAAE;gBACJ,QAAQ,EAAE,IAAI;aACf;SACF;QACD,WAAW,EAAE;YACX,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,EAAE;YAChB,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE;gBACJ,QAAQ,EAAE,KAAK;aAChB;SACF;KACF;CACF,CAAC;AAEF,MAAM,QAAQ,GAAG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C,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,UAAU,CAAC,IAAI,GAAG;IAChB,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,EAAE;CAChB,CAAC","sourcesContent":["export default {\n title: 'Components/sula-icon',\n tags: ['autodocs'],\n argTypes: {\n icon: {\n control: 'text',\n defaultValue: 'ph ph-house',\n description: 'The icon name.',\n type: {\n required: true,\n },\n },\n customClass: {\n control: 'text',\n defaultValue: '',\n description: 'Custom class to be applied to the icon.',\n type: {\n required: false,\n },\n },\n },\n};\n\nconst Template = args => {\n const container = document.createElement('div');\n container.style.margin = '20px';\n container.style.fontSize = '24px';\n\n const el = document.createElement('sula-icon');\n\n el.setAttribute('icon', args.icon);\n if (args.customClass) el.setAttribute('custom-class', args.customClass);\n\n container.appendChild(el);\n\n return container;\n};\n\nexport const Default = Template.bind({});\nDefault.args = {\n icon: 'ph ph-house',\n customClass: '',\n};\n\nexport const WithCustomClass = Template.bind({});\nWithCustomClass.args = {\n icon: 'ph ph-user',\n customClass: 'custom-icon-class',\n};\n\nexport const ArrowIcon = Template.bind({});\nArrowIcon.args = {\n icon: 'ph ph-arrow-right',\n customClass: '',\n};\n\nexport const CalendarIcon = Template.bind({});\nCalendarIcon.args = {\n icon: 'ph ph-calendar',\n customClass: '',\n};\n\nexport const SearchIcon = Template.bind({});\nSearchIcon.args = {\n icon: 'ph ph-magnifying-glass',\n customClass: '',\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sula-switch.model.js","sourceRoot":"","sources":["../../../../src/components/sula-switch/model/sula-switch.model.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;AACf,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB","sourcesContent":["export enum SulaSwitchType {\n Default = 'default',\n List = 'list',\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: ;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.relative{position:relative}.block{display:block}.hidden{display:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.outline{outline-style:solid}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter}.ease-in-out,.transition{transition-timing-function:cubic-bezier(.4,0,.2,1)}:host{display:block}.container-focus,.switch-focus{outline:2px solid var(--color-feedback-informational)!important;outline-offset:2px!important}.switch-container{cursor:pointer;overflow:hidden;position:relative;transition:background-color .3s ease-in-out}.switch-thumb{position:relative;transition:transform .3s ease-in-out}.switch-on .switch-thumb{animation:slideFromLeft .3s ease-in-out forwards}.switch-off .switch-thumb{animation:slideFromRight .3s ease-in-out forwards}.switch-indicator{transition:width .3s ease-in-out,height .3s ease-in-out,background-color .3s ease-in-out}.switch-indicator-on{animation:growIndicator .3s ease-in-out forwards}.switch-indicator-off{animation:shrinkIndicator .3s ease-in-out forwards}@keyframes slideFromLeft{0%{opacity:0;transform:translateX(-100%)}50%{opacity:.7}to{opacity:1;transform:translateX(0)}}@keyframes slideFromRight{0%{opacity:0;transform:translateX(100%)}50%{opacity:.7}to{opacity:1;transform:translateX(0)}}@keyframes growIndicator{0%{height:4px;opacity:.5;width:10px}to{height:12px;opacity:1;width:12px}}@keyframes shrinkIndicator{0%{height:12px;opacity:.5;width:12px}to{height:4px;opacity:1;width:10px}}: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:#02361a;--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:#500202;--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:#683f08;--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:#691e07;--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:#6a3b01;--color-gray-50:#fff;--color-gray-100:#f4f4f4;--color-gray-200:#e6e6e6;--color-gray-300:#c3c3c3;--color-gray-400:#b9b9b9;--color-gray-500:#949494;--color-gray-600:#737373;--color-gray-700:#5c5c5c;--color-gray-800:#323232;--color-gray-900:#292929;--color-gray-950:#141414;--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:#0a2e61;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:#14141405;--color-black-opacity-100:#1414141a;--color-black-opacity-200:#14141426;--color-black-opacity-300:#14141445;--color-black-opacity-400:#1414145c;--color-black-opacity-500:#14141480;--color-black-opacity-600:#1414148c;--color-black-opacity-700:#141414a3;--color-black-opacity-800:#141414ba;--color-black-opacity-900:#141414cc;--color-black-opacity-950:#141414e8;--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:#f4f4f4;--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:#323232;--color-text-secondary:#5c5c5c;--color-text-disabled:#949494;--color-text-link:#1355b4;--color-states-empty-bg-hover:#1414141a;--color-states-empty-bg-pressed:#14141426;--color-states-bg-disabled:#14141405;--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:#e6e6e6;--color-states-negative-pressed:#c3c3c3;--color-icon-primary:#5c5c5c;--color-icon-secondary:#fff;--color-icon-disabled:#b9b9b9;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f4f4f4;--color-neutral-neutral-3:#b9b9b9;--color-neutral-neutral-4:#949494;--color-neutral-neutral-5:#737373;--color-neutral-neutral-6:#5c5c5c;--color-neutral-neutral-7:#323232;--color-neutral-neutral-8:#292929;--color-negative-negative-1:#fff;--color-negative-negative-2:#323232;--color-opacity-body:#fffc;--color-opacity-on-body:#14141405;--color-opacity-overlay:#1414148c;--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949494;--color-line-general-strong:#c3c3c3;--color-line-general:#e6e6e6}.static{position:static}.mr-16{margin-right:1rem}.flex{display:flex}.h-12{height:.75rem}.h-32{height:2rem}.h-4{height:.25rem}.h-\[28px\]{height:28px}.min-h-\[85px\]{min-height:85px}.w-12{width:.75rem}.w-56{width:3.5rem}.w-\[10px\]{width:10px}.w-\[280px\]{width:280px}.w-\[28px\]{width:28px}.flex-1{flex:1 1 0%}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.75rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.75rem*var(--tw-space-x-reverse))}.overflow-hidden{overflow:hidden}.break-words{overflow-wrap:break-word}.rounded-full{border-radius:9999px}.rounded-md{border-radius:1.25rem}.rounded-xxl{border-radius:18.75rem}.bg-brand-primary{background-color:var(--color-brand-primary)}.bg-negative-negative-1{background-color:var(--color-negative-negative-1)}.bg-neutral-neutral-3{background-color:var(--color-neutral-neutral-3)}.bg-neutral-neutral-4{background-color:var(--color-neutral-neutral-4)}.bg-states-bg-disabled{background-color:var(--color-states-bg-disabled)}.bg-surface-on-body{background-color:var(--color-surface-on-body)}.p-2{padding:.125rem}.px-24{padding-left:1.5rem;padding-right:1.5rem}.py-16{padding-bottom:1rem;padding-top:1rem}.text-base{font-size:1rem;line-height:1.5rem}.font-bold{font-weight:700}.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)}.shadow,.shadow-md{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 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)}.active\:bg-states-empty-bg-pressed:active{background-color:var(--color-states-empty-bg-pressed)}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { SulaSwitchType } from "./model/sula-switch.model";
|
|
3
|
+
export class SulaSwitch {
|
|
4
|
+
constructor() {
|
|
5
|
+
/**
|
|
6
|
+
* Switch type
|
|
7
|
+
*/
|
|
8
|
+
this.type = SulaSwitchType.Default;
|
|
9
|
+
/**
|
|
10
|
+
* Is switch active
|
|
11
|
+
*/
|
|
12
|
+
this.active = false;
|
|
13
|
+
/**
|
|
14
|
+
* Is switch disabled
|
|
15
|
+
*/
|
|
16
|
+
this.disabled = false;
|
|
17
|
+
this.isFocus = false;
|
|
18
|
+
this.handleClick = () => {
|
|
19
|
+
if (!this.disabled) {
|
|
20
|
+
this.active = !this.active;
|
|
21
|
+
this.valueChanged.emit(this.active);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
this.handleFocus = () => {
|
|
25
|
+
if (!this.disabled) {
|
|
26
|
+
this.isFocus = true;
|
|
27
|
+
this.focusedOn.emit();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
this.handleBlur = () => {
|
|
31
|
+
if (!this.disabled) {
|
|
32
|
+
this.focusedOut.emit();
|
|
33
|
+
this.isFocus = false;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
return (h(Host, { key: '5fba5bf4066f179cd147357f6a80d7c1513723e9' }, h("div", { key: '359784f411172191cd1454095d287e5c6df4a725', class: {
|
|
39
|
+
'outline-none': true,
|
|
40
|
+
'flex items-center space-x-12': !!this.label && this.type === SulaSwitchType.Default,
|
|
41
|
+
'flex items-center justify-between bg-surface-on-body rounded-md w-[280px] min-h-[85px] px-24 py-16': this.type === SulaSwitchType.List,
|
|
42
|
+
'hover:bg-states-empty-bg-hover active:bg-states-empty-bg-pressed cursor-pointer': this.type === SulaSwitchType.List && !this.disabled,
|
|
43
|
+
'container-focus': this.isFocus && this.type === SulaSwitchType.List,
|
|
44
|
+
}, onFocus: this.handleFocus, onBlur: this.handleBlur, onClick: this.handleClick, tabIndex: 0 }, this.type === SulaSwitchType.List && (h("div", { key: '7d9a24510c3a53f36770d3e082b426a3b146bf2b', class: "flex flex-col flex-1 mr-16 overflow-hidden" }, !!this.label && h("label", { key: 'f07f3ac2185d7fd2620dd4b81cdb84308432a5f0', class: "text-text-primary font-bold text-base cursor-pointer break-words" }, this.label), !!this.subTitle && h("span", { key: '06e91e4e9d30ffd8d5f401d0a3cc38d5ade9e86a', class: "text-text-secondary text-base break-words" }, this.subTitle))), h("div", { key: '540ec3811c7a16d4ff7d6aa00b22b4cd81efb3ce', class: {
|
|
45
|
+
'switch-container w-56 h-32 flex items-center rounded-xxl p-2 outline-none': true,
|
|
46
|
+
'switch-on bg-brand-primary justify-end': this.active,
|
|
47
|
+
'switch-off bg-neutral-neutral-3 justify-start': !this.active,
|
|
48
|
+
'cursor-not-allowed bg-states-bg-disabled': this.disabled,
|
|
49
|
+
'switch-focus': this.isFocus && this.type === SulaSwitchType.Default,
|
|
50
|
+
}, tabIndex: 0, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("div", { key: '72643cf70fed83ce49b2528db7d4b516d1b1cb38', class: {
|
|
51
|
+
'switch-thumb w-[28px] h-[28px] rounded-full flex justify-center items-center': true,
|
|
52
|
+
'bg-negative-negative-1': !this.disabled,
|
|
53
|
+
'bg-states-bg-disabled shadow-md': this.disabled,
|
|
54
|
+
} }, h("div", { key: 'c891324c8cdb8532f7ed7224c7d9419f2e2f3dc1', class: {
|
|
55
|
+
'switch-indicator rounded-full': true,
|
|
56
|
+
'switch-indicator-on w-12 h-12 bg-brand-primary': this.active,
|
|
57
|
+
'switch-indicator-off w-[10px] h-4 bg-neutral-neutral-4': !this.active,
|
|
58
|
+
'shadow-sm bg-states-bg-disabled': this.disabled,
|
|
59
|
+
} }))))));
|
|
60
|
+
}
|
|
61
|
+
static get is() { return "sula-switch"; }
|
|
62
|
+
static get encapsulation() { return "shadow"; }
|
|
63
|
+
static get originalStyleUrls() {
|
|
64
|
+
return {
|
|
65
|
+
"$": ["sula-switch.scss"]
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
static get styleUrls() {
|
|
69
|
+
return {
|
|
70
|
+
"$": ["sula-switch.css"]
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
static get properties() {
|
|
74
|
+
return {
|
|
75
|
+
"type": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"mutable": true,
|
|
78
|
+
"complexType": {
|
|
79
|
+
"original": "SulaSwitchType",
|
|
80
|
+
"resolved": "SulaSwitchType.Default | SulaSwitchType.List",
|
|
81
|
+
"references": {
|
|
82
|
+
"SulaSwitchType": {
|
|
83
|
+
"location": "import",
|
|
84
|
+
"path": "./model/sula-switch.model",
|
|
85
|
+
"id": "src/components/sula-switch/model/sula-switch.model.ts::SulaSwitchType"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"required": false,
|
|
90
|
+
"optional": false,
|
|
91
|
+
"docs": {
|
|
92
|
+
"tags": [],
|
|
93
|
+
"text": "Switch type"
|
|
94
|
+
},
|
|
95
|
+
"getter": false,
|
|
96
|
+
"setter": false,
|
|
97
|
+
"attribute": "type",
|
|
98
|
+
"reflect": false,
|
|
99
|
+
"defaultValue": "SulaSwitchType.Default"
|
|
100
|
+
},
|
|
101
|
+
"active": {
|
|
102
|
+
"type": "boolean",
|
|
103
|
+
"mutable": true,
|
|
104
|
+
"complexType": {
|
|
105
|
+
"original": "boolean",
|
|
106
|
+
"resolved": "boolean",
|
|
107
|
+
"references": {}
|
|
108
|
+
},
|
|
109
|
+
"required": false,
|
|
110
|
+
"optional": false,
|
|
111
|
+
"docs": {
|
|
112
|
+
"tags": [],
|
|
113
|
+
"text": "Is switch active"
|
|
114
|
+
},
|
|
115
|
+
"getter": false,
|
|
116
|
+
"setter": false,
|
|
117
|
+
"attribute": "active",
|
|
118
|
+
"reflect": false,
|
|
119
|
+
"defaultValue": "false"
|
|
120
|
+
},
|
|
121
|
+
"disabled": {
|
|
122
|
+
"type": "boolean",
|
|
123
|
+
"mutable": true,
|
|
124
|
+
"complexType": {
|
|
125
|
+
"original": "boolean",
|
|
126
|
+
"resolved": "boolean",
|
|
127
|
+
"references": {}
|
|
128
|
+
},
|
|
129
|
+
"required": false,
|
|
130
|
+
"optional": false,
|
|
131
|
+
"docs": {
|
|
132
|
+
"tags": [],
|
|
133
|
+
"text": "Is switch disabled"
|
|
134
|
+
},
|
|
135
|
+
"getter": false,
|
|
136
|
+
"setter": false,
|
|
137
|
+
"attribute": "disabled",
|
|
138
|
+
"reflect": false,
|
|
139
|
+
"defaultValue": "false"
|
|
140
|
+
},
|
|
141
|
+
"label": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"mutable": true,
|
|
144
|
+
"complexType": {
|
|
145
|
+
"original": "string",
|
|
146
|
+
"resolved": "string",
|
|
147
|
+
"references": {}
|
|
148
|
+
},
|
|
149
|
+
"required": false,
|
|
150
|
+
"optional": true,
|
|
151
|
+
"docs": {
|
|
152
|
+
"tags": [],
|
|
153
|
+
"text": "Switch label"
|
|
154
|
+
},
|
|
155
|
+
"getter": false,
|
|
156
|
+
"setter": false,
|
|
157
|
+
"attribute": "label",
|
|
158
|
+
"reflect": false
|
|
159
|
+
},
|
|
160
|
+
"subTitle": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"mutable": true,
|
|
163
|
+
"complexType": {
|
|
164
|
+
"original": "string",
|
|
165
|
+
"resolved": "string",
|
|
166
|
+
"references": {}
|
|
167
|
+
},
|
|
168
|
+
"required": false,
|
|
169
|
+
"optional": true,
|
|
170
|
+
"docs": {
|
|
171
|
+
"tags": [],
|
|
172
|
+
"text": "Switch sub title (avaible when is `list` type)"
|
|
173
|
+
},
|
|
174
|
+
"getter": false,
|
|
175
|
+
"setter": false,
|
|
176
|
+
"attribute": "sub-title",
|
|
177
|
+
"reflect": false
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
static get states() {
|
|
182
|
+
return {
|
|
183
|
+
"isFocus": {}
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
static get events() {
|
|
187
|
+
return [{
|
|
188
|
+
"method": "valueChanged",
|
|
189
|
+
"name": "valueChanged",
|
|
190
|
+
"bubbles": true,
|
|
191
|
+
"cancelable": true,
|
|
192
|
+
"composed": true,
|
|
193
|
+
"docs": {
|
|
194
|
+
"tags": [],
|
|
195
|
+
"text": "Event emitted when switch value changes."
|
|
196
|
+
},
|
|
197
|
+
"complexType": {
|
|
198
|
+
"original": "boolean",
|
|
199
|
+
"resolved": "boolean",
|
|
200
|
+
"references": {}
|
|
201
|
+
}
|
|
202
|
+
}, {
|
|
203
|
+
"method": "focusedOn",
|
|
204
|
+
"name": "focusedOn",
|
|
205
|
+
"bubbles": true,
|
|
206
|
+
"cancelable": true,
|
|
207
|
+
"composed": true,
|
|
208
|
+
"docs": {
|
|
209
|
+
"tags": [],
|
|
210
|
+
"text": "Event emitted when switch is focused."
|
|
211
|
+
},
|
|
212
|
+
"complexType": {
|
|
213
|
+
"original": "void",
|
|
214
|
+
"resolved": "void",
|
|
215
|
+
"references": {}
|
|
216
|
+
}
|
|
217
|
+
}, {
|
|
218
|
+
"method": "focusedOut",
|
|
219
|
+
"name": "focusedOut",
|
|
220
|
+
"bubbles": true,
|
|
221
|
+
"cancelable": true,
|
|
222
|
+
"composed": true,
|
|
223
|
+
"docs": {
|
|
224
|
+
"tags": [],
|
|
225
|
+
"text": "Event emitted when switch is focused out."
|
|
226
|
+
},
|
|
227
|
+
"complexType": {
|
|
228
|
+
"original": "void",
|
|
229
|
+
"resolved": "void",
|
|
230
|
+
"references": {}
|
|
231
|
+
}
|
|
232
|
+
}];
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
//# sourceMappingURL=sula-switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sula-switch.js","sourceRoot":"","sources":["../../../src/components/sula-switch/sula-switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAO3D,MAAM,OAAO,UAAU;IALvB;QAME;;WAEG;QACsB,SAAI,GAAmB,cAAc,CAAC,OAAO,CAAC;QAEvE;;WAEG;QACsB,WAAM,GAAY,KAAK,CAAC;QAEjD;;WAEG;QACsB,aAAQ,GAAY,KAAK,CAAC;QA+BnD,YAAO,GAAY,KAAK,CAAC;QAEzB,gBAAW,GAAG,GAAG,EAAE;YACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACnB,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;gBAC3B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtC,CAAC;QACH,CAAC,CAAC;QAEF,gBAAW,GAAG,GAAG,EAAE;YACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACnB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;gBACpB,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;YACxB,CAAC;QACH,CAAC,CAAC;QAEF,eAAU,GAAG,GAAG,EAAE;YAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACnB,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;gBACvB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACvB,CAAC;QACH,CAAC,CAAC;KAyDH;IA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,CAAC,UAAU;oBAEvB,4DACE,KAAK,EAAE;4BACL,8EAA8E,EAAE,IAAI;4BACpF,wBAAwB,EAAE,CAAC,IAAI,CAAC,QAAQ;4BACxC,iCAAiC,EAAE,IAAI,CAAC,QAAQ;yBACjD;wBAED,4DACE,KAAK,EAAE;gCACL,+BAA+B,EAAE,IAAI;gCACrC,gDAAgD,EAAE,IAAI,CAAC,MAAM;gCAC7D,wDAAwD,EAAE,CAAC,IAAI,CAAC,MAAM;gCACtE,iCAAiC,EAAE,IAAI,CAAC,QAAQ;6BACjD,GACI,CACH,CACF,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, Host, Prop, State, h } from '@stencil/core';\nimport { SulaSwitchType } from './model/sula-switch.model';\n\n@Component({\n tag: 'sula-switch',\n styleUrl: 'sula-switch.scss',\n shadow: true,\n})\nexport class SulaSwitch {\n /**\n * Switch type\n */\n @Prop({ mutable: true }) type: SulaSwitchType = SulaSwitchType.Default;\n\n /**\n * Is switch active\n */\n @Prop({ mutable: true }) active: boolean = false;\n\n /**\n * Is switch disabled\n */\n @Prop({ mutable: true }) disabled: boolean = false;\n\n /**\n * Switch label\n */\n @Prop({ mutable: true }) label?: string;\n\n /**\n * Switch sub title (avaible when is `list` type)\n */\n @Prop({ mutable: true }) subTitle?: string;\n\n /**\n * Event emitted when switch value changes.\n */\n @Event()\n valueChanged: EventEmitter<boolean>;\n\n /**\n * Event emitted when switch is focused.\n */\n @Event()\n focusedOn: EventEmitter<void>;\n\n /**\n * Event emitted when switch is focused out.\n */\n @Event()\n focusedOut: EventEmitter<void>;\n\n @State()\n isFocus: boolean = false;\n\n handleClick = () => {\n if (!this.disabled) {\n this.active = !this.active;\n this.valueChanged.emit(this.active);\n }\n };\n\n handleFocus = () => {\n if (!this.disabled) {\n this.isFocus = true;\n this.focusedOn.emit();\n }\n };\n\n handleBlur = () => {\n if (!this.disabled) {\n this.focusedOut.emit();\n this.isFocus = false;\n }\n };\n\n render() {\n return (\n <Host>\n <div\n class={{\n 'outline-none': true,\n 'flex items-center space-x-12': !!this.label && this.type === SulaSwitchType.Default,\n 'flex items-center justify-between bg-surface-on-body rounded-md w-[280px] min-h-[85px] px-24 py-16': this.type === SulaSwitchType.List,\n 'hover:bg-states-empty-bg-hover active:bg-states-empty-bg-pressed cursor-pointer': this.type === SulaSwitchType.List && !this.disabled,\n 'container-focus': this.isFocus && this.type === SulaSwitchType.List,\n }}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n onClick={this.handleClick}\n tabIndex={0}\n >\n {this.type === SulaSwitchType.List && (\n <div class=\"flex flex-col flex-1 mr-16 overflow-hidden\">\n {!!this.label && <label class=\"text-text-primary font-bold text-base cursor-pointer break-words\">{this.label}</label>}\n {!!this.subTitle && <span class=\"text-text-secondary text-base break-words\">{this.subTitle}</span>}\n </div>\n )}\n <div\n class={{\n 'switch-container w-56 h-32 flex items-center rounded-xxl p-2 outline-none': true,\n 'switch-on bg-brand-primary justify-end': this.active,\n 'switch-off bg-neutral-neutral-3 justify-start': !this.active,\n 'cursor-not-allowed bg-states-bg-disabled': this.disabled,\n 'switch-focus': this.isFocus && this.type === SulaSwitchType.Default,\n }}\n tabIndex={0}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n >\n <div\n class={{\n 'switch-thumb w-[28px] h-[28px] rounded-full flex justify-center items-center': true,\n 'bg-negative-negative-1': !this.disabled,\n 'bg-states-bg-disabled shadow-md': this.disabled,\n }}\n >\n <div\n class={{\n 'switch-indicator rounded-full': true,\n 'switch-indicator-on w-12 h-12 bg-brand-primary': this.active,\n 'switch-indicator-off w-[10px] h-4 bg-neutral-neutral-4': !this.active,\n 'shadow-sm bg-states-bg-disabled': this.disabled,\n }}\n ></div>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { SulaSwitchType } from "./model/sula-switch.model";
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Components/sula-switch',
|
|
4
|
+
tags: ['autodocs'],
|
|
5
|
+
argTypes: {
|
|
6
|
+
type: {
|
|
7
|
+
control: { type: 'select' },
|
|
8
|
+
options: Object.values(SulaSwitchType),
|
|
9
|
+
defaultValue: SulaSwitchType.Default,
|
|
10
|
+
description: 'The switch type',
|
|
11
|
+
type: {
|
|
12
|
+
required: false,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
active: {
|
|
16
|
+
control: 'boolean',
|
|
17
|
+
defaultValue: false,
|
|
18
|
+
description: 'Whether the switch is active',
|
|
19
|
+
type: {
|
|
20
|
+
required: false,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
control: 'boolean',
|
|
25
|
+
defaultValue: false,
|
|
26
|
+
description: 'Whether the switch is disabled',
|
|
27
|
+
type: {
|
|
28
|
+
required: false,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
label: {
|
|
32
|
+
control: 'text',
|
|
33
|
+
defaultValue: 'Label',
|
|
34
|
+
description: 'The switch label',
|
|
35
|
+
type: {
|
|
36
|
+
required: false,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
subTitle: {
|
|
40
|
+
control: 'text',
|
|
41
|
+
defaultValue: '',
|
|
42
|
+
description: 'The switch subtitle (available when type is List)',
|
|
43
|
+
type: {
|
|
44
|
+
required: false,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
valueChanged: {
|
|
48
|
+
action: 'valueChanged',
|
|
49
|
+
description: 'Event emitted when switch value changes',
|
|
50
|
+
},
|
|
51
|
+
focusedOn: {
|
|
52
|
+
action: 'focusedOn',
|
|
53
|
+
description: 'Event emitted when switch is focused',
|
|
54
|
+
},
|
|
55
|
+
focusedOut: {
|
|
56
|
+
action: 'focusedOut',
|
|
57
|
+
description: 'Event emitted when switch loses focus',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
const Template = args => {
|
|
62
|
+
const container = document.createElement('div');
|
|
63
|
+
container.style.margin = '20px';
|
|
64
|
+
container.style.display = 'flex';
|
|
65
|
+
container.style.flexDirection = 'column';
|
|
66
|
+
container.style.gap = '20px';
|
|
67
|
+
const el = document.createElement('sula-switch');
|
|
68
|
+
el.setAttribute('type', args.type);
|
|
69
|
+
if (args.label)
|
|
70
|
+
el.setAttribute('label', args.label);
|
|
71
|
+
if (args.subTitle)
|
|
72
|
+
el.setAttribute('sub-title', args.subTitle);
|
|
73
|
+
el.setAttribute('disabled', args.disabled.toString());
|
|
74
|
+
el.setAttribute('active', args.active.toString());
|
|
75
|
+
el.addEventListener('valueChanged', args.valueChanged);
|
|
76
|
+
el.addEventListener('focusedOn', args.focusedOn);
|
|
77
|
+
el.addEventListener('focusedOut', args.focusedOut);
|
|
78
|
+
container.appendChild(el);
|
|
79
|
+
return container;
|
|
80
|
+
};
|
|
81
|
+
export const Default = Template.bind({});
|
|
82
|
+
Default.args = {
|
|
83
|
+
type: SulaSwitchType.Default,
|
|
84
|
+
label: 'Ativar notificações',
|
|
85
|
+
subTitle: '',
|
|
86
|
+
disabled: false,
|
|
87
|
+
active: false,
|
|
88
|
+
};
|
|
89
|
+
export const DefaultActive = Template.bind({});
|
|
90
|
+
DefaultActive.args = Object.assign(Object.assign({}, Default.args), { active: true });
|
|
91
|
+
export const DefaultDisabled = Template.bind({});
|
|
92
|
+
DefaultDisabled.args = Object.assign(Object.assign({}, Default.args), { disabled: true });
|
|
93
|
+
export const DefaultActiveDisabled = Template.bind({});
|
|
94
|
+
DefaultActiveDisabled.args = Object.assign(Object.assign({}, Default.args), { active: true, disabled: true });
|
|
95
|
+
export const DefaultWithoutLabel = Template.bind({});
|
|
96
|
+
DefaultWithoutLabel.args = Object.assign(Object.assign({}, Default.args), { label: '' });
|
|
97
|
+
export const List = Template.bind({});
|
|
98
|
+
List.args = {
|
|
99
|
+
type: SulaSwitchType.List,
|
|
100
|
+
label: 'Modo escuro',
|
|
101
|
+
subTitle: 'Alterar para tema escuro da aplicação',
|
|
102
|
+
disabled: false,
|
|
103
|
+
active: false,
|
|
104
|
+
};
|
|
105
|
+
export const ListActive = Template.bind({});
|
|
106
|
+
ListActive.args = Object.assign(Object.assign({}, List.args), { active: true });
|
|
107
|
+
export const ListDisabled = Template.bind({});
|
|
108
|
+
ListDisabled.args = Object.assign(Object.assign({}, List.args), { disabled: true });
|
|
109
|
+
export const ListActiveDisabled = Template.bind({});
|
|
110
|
+
ListActiveDisabled.args = Object.assign(Object.assign({}, List.args), { active: true, disabled: true });
|
|
111
|
+
//# sourceMappingURL=sula-switch.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sula-switch.stories.js","sourceRoot":"","sources":["../../../src/components/sula-switch/sula-switch.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,eAAe;IACb,KAAK,EAAE,wBAAwB;IAC/B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;YACtC,YAAY,EAAE,cAAc,CAAC,OAAO;YACpC,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE;gBACJ,QAAQ,EAAE,KAAK;aAChB;SACF;QACD,MAAM,EAAE;YACN,OAAO,EAAE,SAAS;YAClB,YAAY,EAAE,KAAK;YACnB,WAAW,EAAE,8BAA8B;YAC3C,IAAI,EAAE;gBACJ,QAAQ,EAAE,KAAK;aAChB;SACF;QAC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,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvD,qBAAqB,CAAC,IAAI,mCACrB,OAAO,CAAC,IAAI,KACf,MAAM,EAAE,IAAI,EACZ,QAAQ,EAAE,IAAI,GACf,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACrD,mBAAmB,CAAC,IAAI,mCACnB,OAAO,CAAC,IAAI,KACf,KAAK,EAAE,EAAE,GACV,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtC,IAAI,CAAC,IAAI,GAAG;IACV,IAAI,EAAE,cAAc,CAAC,IAAI;IACzB,KAAK,EAAE,aAAa;IACpB,QAAQ,EAAE,uCAAuC;IACjD,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,KAAK;CACd,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,UAAU,CAAC,IAAI,mCACV,IAAI,CAAC,IAAI,KACZ,MAAM,EAAE,IAAI,GACb,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC9C,YAAY,CAAC,IAAI,mCACZ,IAAI,CAAC,IAAI,KACZ,QAAQ,EAAE,IAAI,GACf,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpD,kBAAkB,CAAC,IAAI,mCAClB,IAAI,CAAC,IAAI,KACZ,MAAM,EAAE,IAAI,EACZ,QAAQ,EAAE,IAAI,GACf,CAAC","sourcesContent":["import { SulaSwitchType } from './model/sula-switch.model';\n\nexport default {\n title: 'Components/sula-switch',\n tags: ['autodocs'],\n argTypes: {\n type: {\n control: { type: 'select' },\n options: Object.values(SulaSwitchType),\n defaultValue: SulaSwitchType.Default,\n description: 'The switch type',\n type: {\n required: false,\n },\n },\n active: {\n control: 'boolean',\n defaultValue: false,\n description: 'Whether the switch is active',\n type: {\n required: false,\n },\n },\n disabled: {\n control: 'boolean',\n defaultValue: false,\n description: 'Whether the switch is disabled',\n type: {\n required: false,\n },\n },\n label: {\n control: 'text',\n defaultValue: 'Label',\n description: 'The switch label',\n type: {\n required: false,\n },\n },\n subTitle: {\n control: 'text',\n defaultValue: '',\n description: 'The switch subtitle (available when type is List)',\n type: {\n required: false,\n },\n },\n valueChanged: {\n action: 'valueChanged',\n description: 'Event emitted when switch value changes',\n },\n focusedOn: {\n action: 'focusedOn',\n description: 'Event emitted when switch is focused',\n },\n focusedOut: {\n action: 'focusedOut',\n description: 'Event emitted when switch loses focus',\n },\n },\n};\n\nconst Template = args => {\n const container = document.createElement('div');\n container.style.margin = '20px';\n container.style.display = 'flex';\n container.style.flexDirection = 'column';\n container.style.gap = '20px';\n\n const el = document.createElement('sula-switch');\n\n el.setAttribute('type', args.type);\n if (args.label) el.setAttribute('label', args.label);\n if (args.subTitle) el.setAttribute('sub-title', args.subTitle);\n el.setAttribute('disabled', args.disabled.toString());\n el.setAttribute('active', args.active.toString());\n\n el.addEventListener('valueChanged', args.valueChanged);\n el.addEventListener('focusedOn', args.focusedOn);\n el.addEventListener('focusedOut', args.focusedOut);\n\n container.appendChild(el);\n\n return container;\n};\n\nexport const Default = Template.bind({});\nDefault.args = {\n type: SulaSwitchType.Default,\n label: 'Ativar notificações',\n subTitle: '',\n disabled: false,\n active: false,\n};\n\nexport const DefaultActive = Template.bind({});\nDefaultActive.args = {\n ...Default.args,\n active: true,\n};\n\nexport const DefaultDisabled = Template.bind({});\nDefaultDisabled.args = {\n ...Default.args,\n disabled: true,\n};\n\nexport const DefaultActiveDisabled = Template.bind({});\nDefaultActiveDisabled.args = {\n ...Default.args,\n active: true,\n disabled: true,\n};\n\nexport const DefaultWithoutLabel = Template.bind({});\nDefaultWithoutLabel.args = {\n ...Default.args,\n label: '',\n};\n\nexport const List = Template.bind({});\nList.args = {\n type: SulaSwitchType.List,\n label: 'Modo escuro',\n subTitle: 'Alterar para tema escuro da aplicação',\n disabled: false,\n active: false,\n};\n\nexport const ListActive = Template.bind({});\nListActive.args = {\n ...List.args,\n active: true,\n};\n\nexport const ListDisabled = Template.bind({});\nListDisabled.args = {\n ...List.args,\n disabled: true,\n};\n\nexport const ListActiveDisabled = Template.bind({});\nListActiveDisabled.args = {\n ...List.args,\n active: true,\n disabled: true,\n};\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export var SulaTagSize;
|
|
2
|
+
(function (SulaTagSize) {
|
|
3
|
+
SulaTagSize["Small"] = "small";
|
|
4
|
+
SulaTagSize["Default"] = "default";
|
|
5
|
+
})(SulaTagSize || (SulaTagSize = {}));
|
|
6
|
+
export var SulaTagIconStatus;
|
|
7
|
+
(function (SulaTagIconStatus) {
|
|
8
|
+
SulaTagIconStatus["Success"] = "success";
|
|
9
|
+
SulaTagIconStatus["Warning"] = "warning";
|
|
10
|
+
SulaTagIconStatus["Error"] = "error";
|
|
11
|
+
SulaTagIconStatus["Info"] = "info";
|
|
12
|
+
})(SulaTagIconStatus || (SulaTagIconStatus = {}));
|
|
13
|
+
export var SulaTagAppearance;
|
|
14
|
+
(function (SulaTagAppearance) {
|
|
15
|
+
SulaTagAppearance["Brand"] = "brand";
|
|
16
|
+
SulaTagAppearance["Bordered"] = "bordered";
|
|
17
|
+
SulaTagAppearance["LightBlue"] = "light-blue";
|
|
18
|
+
SulaTagAppearance["LightBrand"] = "light-brand";
|
|
19
|
+
SulaTagAppearance["Negative"] = "negative";
|
|
20
|
+
SulaTagAppearance["OpacityGrey"] = "opacity-grey";
|
|
21
|
+
SulaTagAppearance["OpacityWhite"] = "opacity-white";
|
|
22
|
+
})(SulaTagAppearance || (SulaTagAppearance = {}));
|
|
23
|
+
export var SulaTagFontWeight;
|
|
24
|
+
(function (SulaTagFontWeight) {
|
|
25
|
+
SulaTagFontWeight["Normal"] = "normal";
|
|
26
|
+
SulaTagFontWeight["Bold"] = "bold";
|
|
27
|
+
})(SulaTagFontWeight || (SulaTagFontWeight = {}));
|
|
28
|
+
//# sourceMappingURL=sula-tag.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sula-tag.model.js","sourceRoot":"","sources":["../../../../src/components/sula-tag/model/sula-tag.model.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,kCAAmB,CAAA;AACrB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAED,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,wCAAmB,CAAA;IACnB,oCAAe,CAAA;IACf,kCAAa,CAAA;AACf,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAED,MAAM,CAAN,IAAY,iBAQX;AARD,WAAY,iBAAiB;IAC3B,oCAAe,CAAA;IACf,0CAAqB,CAAA;IACrB,6CAAwB,CAAA;IACxB,+CAA0B,CAAA;IAC1B,0CAAqB,CAAA;IACrB,iDAA4B,CAAA;IAC5B,mDAA8B,CAAA;AAChC,CAAC,EARW,iBAAiB,KAAjB,iBAAiB,QAQ5B;AAED,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,kCAAa,CAAA;AACf,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B","sourcesContent":["export enum SulaTagSize {\n Small = 'small',\n Default = 'default',\n}\n\nexport enum SulaTagIconStatus {\n Success = 'success',\n Warning = 'warning',\n Error = 'error',\n Info = 'info',\n}\n\nexport enum SulaTagAppearance {\n Brand = 'brand',\n Bordered = 'bordered',\n LightBlue = 'light-blue', \n LightBrand = 'light-brand',\n Negative = 'negative',\n OpacityGrey = 'opacity-grey',\n OpacityWhite = 'opacity-white',\n}\n\nexport enum SulaTagFontWeight {\n Normal = 'normal',\n Bold = 'bold',\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: ;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{display:block}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#02361a;--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:#500202;--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:#683f08;--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:#691e07;--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:#6a3b01;--color-gray-50:#fff;--color-gray-100:#f4f4f4;--color-gray-200:#e6e6e6;--color-gray-300:#c3c3c3;--color-gray-400:#b9b9b9;--color-gray-500:#949494;--color-gray-600:#737373;--color-gray-700:#5c5c5c;--color-gray-800:#323232;--color-gray-900:#292929;--color-gray-950:#141414;--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:#0a2e61;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:#14141405;--color-black-opacity-100:#1414141a;--color-black-opacity-200:#14141426;--color-black-opacity-300:#14141445;--color-black-opacity-400:#1414145c;--color-black-opacity-500:#14141480;--color-black-opacity-600:#1414148c;--color-black-opacity-700:#141414a3;--color-black-opacity-800:#141414ba;--color-black-opacity-900:#141414cc;--color-black-opacity-950:#141414e8;--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:#f4f4f4;--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:#323232;--color-text-secondary:#5c5c5c;--color-text-disabled:#949494;--color-text-link:#1355b4;--color-states-empty-bg-hover:#1414141a;--color-states-empty-bg-pressed:#14141426;--color-states-bg-disabled:#14141405;--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:#e6e6e6;--color-states-negative-pressed:#c3c3c3;--color-icon-primary:#5c5c5c;--color-icon-secondary:#fff;--color-icon-disabled:#b9b9b9;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f4f4f4;--color-neutral-neutral-3:#b9b9b9;--color-neutral-neutral-4:#949494;--color-neutral-neutral-5:#737373;--color-neutral-neutral-6:#5c5c5c;--color-neutral-neutral-7:#323232;--color-neutral-neutral-8:#292929;--color-negative-negative-1:#fff;--color-negative-negative-2:#323232;--color-opacity-body:#fffc;--color-opacity-on-body:#14141405;--color-opacity-overlay:#1414148c;--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949494;--color-line-general-strong:#c3c3c3;--color-line-general:#e6e6e6}.static{position:static}.mr-8{margin-right:.5rem}.flex{display:flex}.w-fit{width:fit-content}.items-center{align-items:center}.justify-center{justify-content:center}.rounded-full{border-radius:9999px}.rounded-xxl{border-radius:18.75rem}.border{border-width:1px}.border-line-general{border-color:var(--color-line-general)}.bg-brand-primary{background-color:var(--color-brand-primary)}.bg-feedback-alert{background-color:var(--color-feedback-alert)}.bg-feedback-error{background-color:var(--color-feedback-error)}.bg-feedback-informational{background-color:var(--color-feedback-informational)}.bg-feedback-success{background-color:var(--color-feedback-success)}.bg-negative-negative-1{background-color:var(--color-negative-negative-1)}.bg-opacity-body{background-color:var(--color-opacity-body)}.bg-opacity-on-body{background-color:var(--color-opacity-on-body)}.bg-surface-on-body-blue{background-color:var(--color-surface-on-body-blue)}.bg-surface-on-body-brand{background-color:var(--color-surface-on-body-brand)}.bg-transparent{background-color:transparent}.px-12{padding-left:.75rem;padding-right:.75rem}.px-2{padding-left:.125rem;padding-right:.125rem}.px-8{padding-left:.5rem;padding-right:.5rem}.py-1{padding-bottom:.0625rem;padding-top:.0625rem}.py-4{padding-bottom:.25rem;padding-top:.25rem}.py-8{padding-bottom:.5rem;padding-top:.5rem}.text-base{font-size:1rem;line-height:1.5rem}.font-bold{font-weight:700}.font-normal{font-weight:400}.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-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)}
|