@sula-tech/webcomponents 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-7973b779.js → index-87eec792.js} +126 -5
- package/dist/cjs/index-87eec792.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{sula-avatar_3.cjs.entry.js → sula-avatar_9.cjs.entry.js} +652 -7
- 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 +7 -1
- package/dist/collection/components/sula-avatar/sula-avatar.css +1 -1
- package/dist/collection/components/sula-avatar/sula-avatar.stories.js +14 -17
- package/dist/collection/components/sula-avatar/sula-avatar.stories.js.map +1 -1
- 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-button/sula-button.stories.js +36 -9
- package/dist/collection/components/sula-button/sula-button.stories.js.map +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 +35 -14
- 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/model/sula-textfield.model.js +11 -0
- package/dist/collection/components/sula-textfield/model/sula-textfield.model.js.map +1 -0
- package/dist/collection/components/sula-textfield/sula-textfield.css +1 -0
- package/dist/collection/components/sula-textfield/sula-textfield.js +376 -0
- package/dist/collection/components/sula-textfield/sula-textfield.js.map +1 -0
- package/dist/collection/components/sula-textfield/sula-textfield.stories.js +148 -0
- package/dist/collection/components/sula-textfield/sula-textfield.stories.js.map +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/{p-81fcc74a.js → p-048c28d3.js} +4 -4
- package/dist/components/{p-81fcc74a.js.map → p-048c28d3.js.map} +1 -1
- package/dist/components/{p-d3ba6302.js → p-881c6b35.js} +114 -6
- package/dist/components/p-881c6b35.js.map +1 -0
- package/dist/components/sula-avatar.js +3 -3
- package/dist/components/sula-avatar.js.map +1 -1
- 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.d.ts +11 -0
- package/dist/components/sula-textfield.js +171 -0
- package/dist/components/sula-textfield.js.map +1 -0
- package/dist/esm/{index-9bf8f892.js → index-aa1c5f36.js} +126 -6
- package/dist/esm/index-aa1c5f36.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{sula-avatar_3.entry.js → sula-avatar_9.entry.js} +647 -8
- package/dist/esm/sula-avatar_9.entry.js.map +1 -0
- package/dist/esm/webcomponents.js +3 -3
- package/dist/types/components/sula-avatar/sula-avatar.stories.d.ts +0 -1
- 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-button/sula-button.stories.d.ts +2 -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-icon/sula-icon.stories.d.ts +5 -2
- 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/sula-textfield/model/sula-textfield.model.d.ts +8 -0
- package/dist/types/components/sula-textfield/sula-textfield.d.ts +74 -0
- package/dist/types/components/sula-textfield/sula-textfield.stories.d.ts +108 -0
- package/dist/types/components.d.ts +510 -0
- package/dist/webcomponents/{p-cca32e44.js → p-5a36af0f.js} +343 -220
- package/dist/webcomponents/p-5a36af0f.js.map +1 -0
- package/dist/webcomponents/{p-82d7a024.entry.js → p-89f57a33.entry.js} +917 -64
- package/dist/webcomponents/p-89f57a33.entry.js.map +1 -0
- package/dist/webcomponents/webcomponents.esm.js +68 -13
- package/dist/webcomponents/webcomponents.esm.js.map +1 -1
- package/package.json +21 -13
- package/readme.md +36 -18
- package/dist/cjs/index-7973b779.js.map +0 -1
- package/dist/cjs/sula-avatar_3.cjs.entry.js.map +0 -1
- package/dist/components/p-d3ba6302.js.map +0 -1
- package/dist/esm/index-9bf8f892.js.map +0 -1
- package/dist/esm/sula-avatar_3.entry.js.map +0 -1
- package/dist/webcomponents/p-82d7a024.entry.js.map +0 -1
- package/dist/webcomponents/p-cca32e44.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sula-badge.stories.js","sourceRoot":"","sources":["../../../src/components/sula-badge/sula-badge.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzF,eAAe;IACb,KAAK,EAAE,uBAAuB;IAC9B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,OAAO;YACrB,WAAW,EAAE,8BAA8B;YAC3C,IAAI,EAAE;gBACJ,QAAQ,EAAE,KAAK;aAChB;SACF;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,YAAY;YAC1B,WAAW,EAAE,8BAA8B;YAC3C,IAAI,EAAE;gBACJ,QAAQ,EAAE,KAAK;aAChB;SACF;QACD,MAAM,EAAE;YACN,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC;YACvC,YAAY,EAAE,eAAe,CAAC,OAAO;YACrC,WAAW,EAAE,cAAc;YAC3B,IAAI,EAAE;gBACJ,QAAQ,EAAE,KAAK;aAChB;SACF;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;YACrC,YAAY,EAAE,aAAa,CAAC,MAAM;YAClC,WAAW,EAAE,YAAY;YACzB,IAAI,EAAE;gBACJ,QAAQ,EAAE,KAAK;aAChB;SACF;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,OAAO,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AC,IAAI,GAAG;IAClB,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,eAAe,CAAC,OAAO;IAC/B,IAAI,EAAE,aAAa,CAAC,OAAO;IAC3B,IAAI,EAAE,aAAa,CAAC,IAAI;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3D,eAAe,CAAC,IAAI,GAAG;IACrB,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,eAAe,CAAC,KAAK;IAC7B,IAAI,EAAE,aAAa,CAAC,KAAK;IACzB,IAAI,EAAE,aAAa,CAAC,GAAG;CACxB,CAAC","sourcesContent":["import { SulaBadgeSize, SulaBadgeStatus, SulaBadgeType } from './model/sula-badge.model';\n\nexport default {\n title: 'Components/sula-badge',\n tags: ['autodocs'],\n argTypes: {\n text: {\n control: 'text',\n defaultValue: 'Badge',\n description: 'Badge text when is text type',\n type: {\n required: false,\n },\n },\n icon: {\n control: 'text',\n defaultValue: 'ph ph-bell',\n description: 'Badge icon when is Icon type',\n type: {\n required: false,\n },\n },\n status: {\n control: { type: 'select' },\n options: Object.values(SulaBadgeStatus),\n defaultValue: SulaBadgeStatus.Default,\n description: 'Badge status',\n type: {\n required: false,\n },\n },\n size: {\n control: { type: 'select' },\n options: Object.values(SulaBadgeSize),\n defaultValue: SulaBadgeSize.Medium,\n description: 'Badge size',\n type: {\n required: false,\n },\n },\n type: {\n control: { type: 'select' },\n options: Object.values(SulaBadgeType),\n defaultValue: SulaBadgeType.Text,\n description: 'Badge type',\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\n const el = document.createElement('sula-badge');\n\n if (args.text) el.setAttribute('text', args.text);\n if (args.icon) el.setAttribute('icon', args.icon);\n el.setAttribute('status', args.status);\n el.setAttribute('size', args.size);\n el.setAttribute('type', args.type);\n\n container.appendChild(el);\n\n return container;\n};\n\nconst TemplateWithAvatar = args => {\n const container = document.createElement('div');\n container.style.margin = '20px';\n\n const el = document.createElement('sula-badge');\n\n if (args.text) el.setAttribute('text', args.text);\n if (args.icon) el.setAttribute('icon', args.icon);\n el.setAttribute('status', args.status);\n el.setAttribute('size', args.size);\n el.setAttribute('type', args.type);\n\n // Adiciona avatar como conteúdo do slot\n const avatar = document.createElement('sula-avatar');\n avatar.setAttribute('image-url', 'https://i.pravatar.cc/300');\n avatar.setAttribute('size', 'medium');\n el.appendChild(avatar);\n\n container.appendChild(el);\n\n return container;\n};\n\nexport const Default = Template.bind({});\nDefault.args = {\n text: 'Badge',\n icon: '',\n status: SulaBadgeStatus.Default,\n size: SulaBadgeSize.Medium,\n type: SulaBadgeType.Text,\n};\n\nexport const DotBadge = Template.bind({});\nDotBadge.args = {\n text: '',\n icon: '',\n status: SulaBadgeStatus.Error,\n size: SulaBadgeSize.Small,\n type: SulaBadgeType.Dot,\n};\n\nexport const IconBadge = Template.bind({});\nIconBadge.args = {\n text: '',\n icon: 'ph ph-bell',\n status: SulaBadgeStatus.Info,\n size: SulaBadgeSize.Medium,\n type: SulaBadgeType.Icon,\n};\n\nexport const SuccessBadge = Template.bind({});\nSuccessBadge.args = {\n text: 'OK',\n icon: '',\n status: SulaBadgeStatus.Success,\n size: SulaBadgeSize.Medium,\n type: SulaBadgeType.Text,\n};\n\nexport const WarningBadge = Template.bind({});\nWarningBadge.args = {\n text: '!',\n icon: '',\n status: SulaBadgeStatus.Warning,\n size: SulaBadgeSize.Medium,\n type: SulaBadgeType.Text,\n};\n\nexport const LargeBadge = Template.bind({});\nLargeBadge.args = {\n text: '99+',\n icon: '',\n status: SulaBadgeStatus.Default,\n size: SulaBadgeSize.Large,\n type: SulaBadgeType.Text,\n};\n\nexport const DisplayBadge = Template.bind({});\nDisplayBadge.args = {\n text: '999',\n icon: '',\n status: SulaBadgeStatus.Default,\n size: SulaBadgeSize.Display,\n type: SulaBadgeType.Text,\n};\n\nexport const BadgeWithAvatar = TemplateWithAvatar.bind({});\nBadgeWithAvatar.args = {\n text: '',\n icon: '',\n status: SulaBadgeStatus.Error,\n size: SulaBadgeSize.Small,\n type: SulaBadgeType.Dot,\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{--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;display:block}button:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--color-feedback-informational)!important;outline:none!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:#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}.flex{display:flex}.h-24{height:1.5rem}.h-\[40px\]{height:40px}.h-\[56px\]{height:56px}.w-24{width:1.5rem}.min-w-\[120px\]{min-width:120px}.min-w-\[40px\]{min-width:40px}.min-w-\[56px\]{min-width:56px}.items-center{align-items:center}.justify-center{justify-content:center}.space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rounded-xs{border-radius:.5rem}.rounded-xxl{border-radius:18.75rem}.border{border-width:1px}.border-none{border-style:none}.border-brand-primary{border-color:var(--color-brand-primary)}.border-feedback-error{border-color:var(--color-feedback-error)}.border-negative-negative-1{border-color:var(--color-negative-negative-1)}.bg-brand-primary{background-color:var(--color-brand-primary)}.bg-feedback-error{background-color:var(--color-feedback-error)}.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-hover{background-color:var(--color-states-empty-bg-hover)}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.p-16{padding:1rem}.p-8{padding:.5rem}.px-16{padding-left:1rem;padding-right:1rem}.py-4{padding-bottom:.25rem;padding-top:.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.font-bold{font-weight:700}.text-brand-primary{color:var(--color-brand-primary)}.text-feedback-error{color:var(--color-feedback-error)}.text-icon-disabled{color:var(--color-icon-disabled)}.text-icon-primary{color:var(--color-icon-primary)}.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-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.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)}.hover\:bg-states-danger-hover:hover{background-color:var(--color-states-danger-hover)}.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)}.hover\:bg-states-primary-hover:hover{background-color:var(--color-states-primary-hover)}.focus\:bg-states-empty-bg-hover:focus{background-color:var(--color-states-empty-bg-hover)}.active\:bg-states-danger-pressed:active{background-color:var(--color-states-danger-pressed)}.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)}.active\:bg-states-primary-pressed:active{background-color:var(--color-states-primary-pressed)}.active\:bg-opacity-85:active{--tw-bg-opacity:0.85}.group:hover .group-hover\:bg-states-empty-bg-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}button: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:#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}.flex{display:flex}.h-24{height:1.5rem}.h-\[40px\]{height:40px}.h-\[56px\]{height:56px}.w-24{width:1.5rem}.min-w-\[120px\]{min-width:120px}.min-w-\[40px\]{min-width:40px}.min-w-\[56px\]{min-width:56px}.items-center{align-items:center}.justify-center{justify-content:center}.space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rounded-xs{border-radius:.5rem}.rounded-xxl{border-radius:18.75rem}.border{border-width:1px}.border-none{border-style:none}.border-brand-primary{border-color:var(--color-brand-primary)}.border-feedback-error{border-color:var(--color-feedback-error)}.border-negative-negative-1{border-color:var(--color-negative-negative-1)}.bg-brand-primary{background-color:var(--color-brand-primary)}.bg-feedback-error{background-color:var(--color-feedback-error)}.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-hover{background-color:var(--color-states-empty-bg-hover)}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.p-16{padding:1rem}.p-8{padding:.5rem}.px-16{padding-left:1rem;padding-right:1rem}.py-4{padding-bottom:.25rem;padding-top:.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.font-bold{font-weight:700}.text-brand-primary{color:var(--color-brand-primary)}.text-feedback-error{color:var(--color-feedback-error)}.text-icon-disabled{color:var(--color-icon-disabled)}.text-icon-primary{color:var(--color-icon-primary)}.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-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.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)}.hover\:bg-states-danger-hover:hover{background-color:var(--color-states-danger-hover)}.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)}.hover\:bg-states-primary-hover:hover{background-color:var(--color-states-primary-hover)}.focus\:bg-states-empty-bg-hover:focus{background-color:var(--color-states-empty-bg-hover)}.active\:bg-states-danger-pressed:active{background-color:var(--color-states-danger-pressed)}.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)}.active\:bg-states-primary-pressed:active{background-color:var(--color-states-primary-pressed)}.active\:bg-opacity-85:active{--tw-bg-opacity:0.85}.group:hover .group-hover\:bg-states-empty-bg-hover{background-color:var(--color-states-empty-bg-hover)}
|
|
@@ -127,7 +127,7 @@ export class SulaButton {
|
|
|
127
127
|
return null;
|
|
128
128
|
}
|
|
129
129
|
render() {
|
|
130
|
-
return (h(Host, { key: '
|
|
130
|
+
return (h(Host, { key: 'ea13a693900493e45523edff3350a052d4e62772' }, h("button", { key: 'c3d37cc6fec9348c2dfe8d0b518f0191d460bbe5', id: "button-container", class: this.getBaseButtonClass(), disabled: this.buttonDisabled, onClick: this.handleClick }, this.renderIconContent(), this.renderTextContent(), this.renderArrowIcon())));
|
|
131
131
|
}
|
|
132
132
|
static get is() { return "sula-button"; }
|
|
133
133
|
static get encapsulation() { return "shadow"; }
|
|
@@ -78,17 +78,22 @@ export default {
|
|
|
78
78
|
},
|
|
79
79
|
};
|
|
80
80
|
const Template = args => {
|
|
81
|
+
const container = document.createElement('div');
|
|
82
|
+
container.style.margin = '20px';
|
|
81
83
|
const el = document.createElement('sula-button');
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
el.
|
|
87
|
-
el.
|
|
88
|
-
el.
|
|
89
|
-
el.
|
|
84
|
+
if (args.text)
|
|
85
|
+
el.setAttribute('text', args.text);
|
|
86
|
+
if (args.icon)
|
|
87
|
+
el.setAttribute('icon', args.icon);
|
|
88
|
+
el.setAttribute('appearance', args.appearance);
|
|
89
|
+
el.setAttribute('type', args.type);
|
|
90
|
+
el.setAttribute('size', args.size);
|
|
91
|
+
el.setAttribute('status', args.status);
|
|
92
|
+
el.setAttribute('loading', args.loading.toString());
|
|
93
|
+
el.setAttribute('button-disabled', args.buttonDisabled.toString());
|
|
90
94
|
el.addEventListener('buttonClicked', args.buttonClicked);
|
|
91
|
-
|
|
95
|
+
container.appendChild(el);
|
|
96
|
+
return container;
|
|
92
97
|
};
|
|
93
98
|
export const Default = Template.bind({});
|
|
94
99
|
Default.args = {
|
|
@@ -178,4 +183,26 @@ DisabledButton.args = {
|
|
|
178
183
|
loading: false,
|
|
179
184
|
buttonDisabled: true,
|
|
180
185
|
};
|
|
186
|
+
export const LoadingButton = Template.bind({});
|
|
187
|
+
LoadingButton.args = {
|
|
188
|
+
text: 'Loading Button',
|
|
189
|
+
icon: '',
|
|
190
|
+
appearance: SulaButtonAppearance.Default,
|
|
191
|
+
type: SulaButtonType.Text,
|
|
192
|
+
size: SulaButtonSize.Default,
|
|
193
|
+
status: SulaButtonStatus.Primary,
|
|
194
|
+
loading: true,
|
|
195
|
+
buttonDisabled: false,
|
|
196
|
+
};
|
|
197
|
+
export const IconAndTextButton = Template.bind({});
|
|
198
|
+
IconAndTextButton.args = {
|
|
199
|
+
text: 'Icon and Text',
|
|
200
|
+
icon: 'ph ph-house',
|
|
201
|
+
appearance: SulaButtonAppearance.Default,
|
|
202
|
+
type: SulaButtonType.Text,
|
|
203
|
+
size: SulaButtonSize.Default,
|
|
204
|
+
status: SulaButtonStatus.Primary,
|
|
205
|
+
loading: false,
|
|
206
|
+
buttonDisabled: false,
|
|
207
|
+
};
|
|
181
208
|
//# sourceMappingURL=sula-button.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sula-button.stories.js","sourceRoot":"","sources":["../../../src/components/sula-button/sula-button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEnH,eAAe;IACb,KAAK,EAAE,wBAAwB;IAC/B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,aAAa;YAC3B,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE;gBACJ,QAAQ,EAAE,KAAK;aAChB;SACF;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,aAAa;YAC3B,WAAW,EAAE,+BAA+B;YAC5C,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,oBAAoB,CAAC;YAC5C,YAAY,EAAE,oBAAoB,CAAC,OAAO;YAC1C,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE;gB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AE,CAAC,CAAC;AAC9C,YAAY,CAAC,IAAI,GAAG;IAClB,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,oBAAoB,CAAC,OAAO;IACxC,IAAI,EAAE,cAAc,CAAC,IAAI;IACzB,IAAI,EAAE,cAAc,CAAC,OAAO;IAC5B,MAAM,EAAE,gBAAgB,CAAC,MAAM;IAC/B,OAAO,EAAE,KAAK;IACd,cAAc,EAAE,KAAK;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChD,cAAc,CAAC,IAAI,GAAG;IACpB,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,oBAAoB,CAAC,OAAO;IACxC,IAAI,EAAE,cAAc,CAAC,IAAI;IACzB,IAAI,EAAE,cAAc,CAAC,OAAO;IAC5B,MAAM,EAAE,gBAAgB,CAAC,QAAQ;IACjC,OAAO,EAAE,KAAK;IACd,cAAc,EAAE,KAAK;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChD,cAAc,CAAC,IAAI,GAAG;IACpB,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,oBAAoB,CAAC,OAAO;IACxC,IAAI,EAAE,cAAc,CAAC,IAAI;IACzB,IAAI,EAAE,cAAc,CAAC,OAAO;IAC5B,MAAM,EAAE,gBAAgB,CAAC,OAAO;IAChC,OAAO,EAAE,KAAK;IACd,cAAc,EAAE,IAAI;CACrB,CAAC","sourcesContent":["import { SulaButtonAppearance, SulaButtonSize, SulaButtonStatus, SulaButtonType } from './model/sula-button.model';\n\nexport default {\n title: 'Components/sula-button',\n tags: ['autodocs'],\n argTypes: {\n text: {\n control: 'text',\n defaultValue: 'Button Text',\n description: 'Button text when is text type',\n type: {\n required: false,\n },\n },\n icon: {\n control: 'text',\n defaultValue: 'ph ph-house',\n description: 'Button icon when is Icon type',\n type: {\n required: false,\n },\n },\n appearance: {\n control: { type: 'select' },\n options: Object.values(SulaButtonAppearance),\n defaultValue: SulaButtonAppearance.Default,\n description: 'Button appearance',\n type: {\n required: false,\n },\n },\n type: {\n control: { type: 'select' },\n options: Object.values(SulaButtonType),\n defaultValue: SulaButtonType.Text,\n description: 'Button type',\n type: {\n required: false,\n },\n },\n size: {\n control: { type: 'select' },\n options: Object.values(SulaButtonSize),\n defaultValue: SulaButtonSize.Default,\n description: 'Button size',\n type: {\n required: false,\n },\n },\n status: {\n control: { type: 'select' },\n options: Object.values(SulaButtonStatus),\n defaultValue: SulaButtonStatus.Primary,\n description: 'Button status',\n type: {\n required: false,\n },\n },\n loading: {\n control: 'boolean',\n defaultValue: false,\n description: 'Is button loading',\n type: {\n required: false,\n },\n },\n buttonDisabled: {\n control: 'boolean',\n defaultValue: false,\n description: 'Is button disabled',\n type: {\n required: false,\n },\n },\n buttonClicked: {\n action: 'buttonClicked',\n description: 'Evento emitido quando o botão é clicado',\n },\n },\n};\n\nconst Template = args => {\n const el = document.createElement('sula-button');\n\n el.text = args.text;\n el.icon = args.icon;\n el.appearance = args.appearance;\n el.type = args.type;\n el.size = args.size;\n el.status = args.status;\n el.loading = args.loading;\n el.buttonDisabled = args.buttonDisabled;\n\n el.addEventListener('buttonClicked', args.buttonClicked);\n\n return el;\n};\n\nexport const Default = Template.bind({});\nDefault.args = {\n text: 'Default Button',\n icon: '',\n appearance: SulaButtonAppearance.Default,\n type: SulaButtonType.Text,\n size: SulaButtonSize.Default,\n status: SulaButtonStatus.Primary,\n loading: false,\n buttonDisabled: false,\n};\n\nexport const IconButton = Template.bind({});\nIconButton.args = {\n text: '',\n icon: 'ph ph-house',\n appearance: SulaButtonAppearance.Default,\n type: SulaButtonType.Icon,\n size: SulaButtonSize.Default,\n status: SulaButtonStatus.Primary,\n loading: false,\n buttonDisabled: false,\n};\n\nexport const TextAppearance = Template.bind({});\nTextAppearance.args = {\n text: 'Text Button',\n icon: '',\n appearance: SulaButtonAppearance.Text,\n type: SulaButtonType.Text,\n size: SulaButtonSize.Default,\n status: SulaButtonStatus.Primary,\n loading: false,\n buttonDisabled: false,\n};\n\nexport const SecondaryButton = Template.bind({});\nSecondaryButton.args = {\n text: 'Secondary Button',\n icon: '',\n appearance: SulaButtonAppearance.Secondary,\n type: SulaButtonType.Text,\n size: SulaButtonSize.Default,\n status: SulaButtonStatus.Primary,\n loading: false,\n buttonDisabled: false,\n};\n\nexport const LargeButton = Template.bind({});\nLargeButton.args = {\n text: 'Large Button',\n icon: '',\n appearance: SulaButtonAppearance.Default,\n type: SulaButtonType.Text,\n size: SulaButtonSize.Large,\n status: SulaButtonStatus.Primary,\n loading: false,\n buttonDisabled: false,\n};\n\nexport const DangerButton = Template.bind({});\nDangerButton.args = {\n text: 'Danger Button',\n icon: '',\n appearance: SulaButtonAppearance.Default,\n type: SulaButtonType.Text,\n size: SulaButtonSize.Default,\n status: SulaButtonStatus.Danger,\n loading: false,\n buttonDisabled: false,\n};\n\nexport const NegativeButton = Template.bind({});\nNegativeButton.args = {\n text: 'Negative Button',\n icon: '',\n appearance: SulaButtonAppearance.Default,\n type: SulaButtonType.Text,\n size: SulaButtonSize.Default,\n status: SulaButtonStatus.Negative,\n loading: false,\n buttonDisabled: false,\n};\n\nexport const DisabledButton = Template.bind({});\nDisabledButton.args = {\n text: 'Disabled Button',\n icon: '',\n appearance: SulaButtonAppearance.Default,\n type: SulaButtonType.Text,\n size: SulaButtonSize.Default,\n status: SulaButtonStatus.Primary,\n loading: false,\n buttonDisabled: true,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"sula-button.stories.js","sourceRoot":"","sources":["../../../src/components/sula-button/sula-button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEnH,eAAe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,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACnD,iBAAiB,CAAC,IAAI,GAAG;IACvB,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,aAAa;IACnB,UAAU,EAAE,oBAAoB,CAAC,OAAO;IACxC,IAAI,EAAE,cAAc,CAAC,IAAI;IACzB,IAAI,EAAE,cAAc,CAAC,OAAO;IAC5B,MAAM,EAAE,gBAAgB,CAAC,OAAO;IAChC,OAAO,EAAE,KAAK;IACd,cAAc,EAAE,KAAK;CACtB,CAAC","sourcesContent":["import { SulaButtonAppearance, SulaButtonSize, SulaButtonStatus, SulaButtonType } from './model/sula-button.model';\n\nexport default {\n title: 'Components/sula-button',\n tags: ['autodocs'],\n argTypes: {\n text: {\n control: 'text',\n defaultValue: 'Button Text',\n description: 'Button text when is text type',\n type: {\n required: false,\n },\n },\n icon: {\n control: 'text',\n defaultValue: 'ph ph-house',\n description: 'Button icon when is Icon type',\n type: {\n required: false,\n },\n },\n appearance: {\n control: { type: 'select' },\n options: Object.values(SulaButtonAppearance),\n defaultValue: SulaButtonAppearance.Default,\n description: 'Button appearance',\n type: {\n required: false,\n },\n },\n type: {\n control: { type: 'select' },\n options: Object.values(SulaButtonType),\n defaultValue: SulaButtonType.Text,\n description: 'Button type',\n type: {\n required: false,\n },\n },\n size: {\n control: { type: 'select' },\n options: Object.values(SulaButtonSize),\n defaultValue: SulaButtonSize.Default,\n description: 'Button size',\n type: {\n required: false,\n },\n },\n status: {\n control: { type: 'select' },\n options: Object.values(SulaButtonStatus),\n defaultValue: SulaButtonStatus.Primary,\n description: 'Button status',\n type: {\n required: false,\n },\n },\n loading: {\n control: 'boolean',\n defaultValue: false,\n description: 'Is button loading',\n type: {\n required: false,\n },\n },\n buttonDisabled: {\n control: 'boolean',\n defaultValue: false,\n description: 'Is button disabled',\n type: {\n required: false,\n },\n },\n buttonClicked: {\n action: 'buttonClicked',\n description: 'Evento emitido quando o botão é clicado',\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-button');\n\n if (args.text) el.setAttribute('text', args.text);\n if (args.icon) el.setAttribute('icon', args.icon);\n el.setAttribute('appearance', args.appearance);\n el.setAttribute('type', args.type);\n el.setAttribute('size', args.size);\n el.setAttribute('status', args.status);\n el.setAttribute('loading', args.loading.toString());\n el.setAttribute('button-disabled', args.buttonDisabled.toString());\n\n el.addEventListener('buttonClicked', args.buttonClicked);\n\n container.appendChild(el);\n\n return container;\n};\n\nexport const Default = Template.bind({});\nDefault.args = {\n text: 'Default Button',\n icon: '',\n appearance: SulaButtonAppearance.Default,\n type: SulaButtonType.Text,\n size: SulaButtonSize.Default,\n status: SulaButtonStatus.Primary,\n loading: false,\n buttonDisabled: false,\n};\n\nexport const IconButton = Template.bind({});\nIconButton.args = {\n text: '',\n icon: 'ph ph-house',\n appearance: SulaButtonAppearance.Default,\n type: SulaButtonType.Icon,\n size: SulaButtonSize.Default,\n status: SulaButtonStatus.Primary,\n loading: false,\n buttonDisabled: false,\n};\n\nexport const TextAppearance = Template.bind({});\nTextAppearance.args = {\n text: 'Text Button',\n icon: '',\n appearance: SulaButtonAppearance.Text,\n type: SulaButtonType.Text,\n size: SulaButtonSize.Default,\n status: SulaButtonStatus.Primary,\n loading: false,\n buttonDisabled: false,\n};\n\nexport const SecondaryButton = Template.bind({});\nSecondaryButton.args = {\n text: 'Secondary Button',\n icon: '',\n appearance: SulaButtonAppearance.Secondary,\n type: SulaButtonType.Text,\n size: SulaButtonSize.Default,\n status: SulaButtonStatus.Primary,\n loading: false,\n buttonDisabled: false,\n};\n\nexport const LargeButton = Template.bind({});\nLargeButton.args = {\n text: 'Large Button',\n icon: '',\n appearance: SulaButtonAppearance.Default,\n type: SulaButtonType.Text,\n size: SulaButtonSize.Large,\n status: SulaButtonStatus.Primary,\n loading: false,\n buttonDisabled: false,\n};\n\nexport const DangerButton = Template.bind({});\nDangerButton.args = {\n text: 'Danger Button',\n icon: '',\n appearance: SulaButtonAppearance.Default,\n type: SulaButtonType.Text,\n size: SulaButtonSize.Default,\n status: SulaButtonStatus.Danger,\n loading: false,\n buttonDisabled: false,\n};\n\nexport const NegativeButton = Template.bind({});\nNegativeButton.args = {\n text: 'Negative Button',\n icon: '',\n appearance: SulaButtonAppearance.Default,\n type: SulaButtonType.Text,\n size: SulaButtonSize.Default,\n status: SulaButtonStatus.Negative,\n loading: false,\n buttonDisabled: false,\n};\n\nexport const DisabledButton = Template.bind({});\nDisabledButton.args = {\n text: 'Disabled Button',\n icon: '',\n appearance: SulaButtonAppearance.Default,\n type: SulaButtonType.Text,\n size: SulaButtonSize.Default,\n status: SulaButtonStatus.Primary,\n loading: false,\n buttonDisabled: true,\n};\n\nexport const LoadingButton = Template.bind({});\nLoadingButton.args = {\n text: 'Loading Button',\n icon: '',\n appearance: SulaButtonAppearance.Default,\n type: SulaButtonType.Text,\n size: SulaButtonSize.Default,\n status: SulaButtonStatus.Primary,\n loading: true,\n buttonDisabled: false,\n};\n\nexport const IconAndTextButton = Template.bind({});\nIconAndTextButton.args = {\n text: 'Icon and Text',\n icon: 'ph ph-house',\n appearance: SulaButtonAppearance.Default,\n type: SulaButtonType.Text,\n size: SulaButtonSize.Default,\n status: SulaButtonStatus.Primary,\n loading: false,\n buttonDisabled: false,\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sula-checkbox.model.js","sourceRoot":"","sources":["../../../../src/components/sula-checkbox/model/sula-checkbox.model.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,iCAAa,CAAA;AACf,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B","sourcesContent":["export enum SulaCheckboxType {\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}.block{display:block}.outline{outline-style:solid}:host{display:block}.checkbox-focus,.container-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:#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-\[27px\]{height:27px}.min-h-\[85px\]{min-height:85px}.w-\[27px\]{width:27px}.w-\[280px\]{width:280px}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.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}.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-md{border-radius:1.25rem}.rounded-xs{border-radius:.5rem}.border{border-width:1px}.border-brand-primary{border-color:var(--color-brand-primary)}.border-line-input{border-color:var(--color-line-input)}.border-states-bg-disabled{border-color:var(--color-states-bg-disabled)}.bg-brand-primary{background-color:var(--color-brand-primary)}.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-surface-body{background-color:var(--color-surface-body)}.bg-surface-on-body{background-color:var(--color-surface-on-body)}.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}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-bold{font-weight:700}.text-icon-disabled{color:var(--color-icon-disabled)}.text-negative-negative-1{color:var(--color-negative-negative-1)}.text-text-primary{color:var(--color-text-primary)}.text-text-secondary{color:var(--color-text-secondary)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.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,233 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { SulaCheckboxType } from "./model/sula-checkbox.model";
|
|
3
|
+
export class SulaCheckbox {
|
|
4
|
+
constructor() {
|
|
5
|
+
/**
|
|
6
|
+
* Checkbox type
|
|
7
|
+
*/
|
|
8
|
+
this.type = SulaCheckboxType.Default;
|
|
9
|
+
/**
|
|
10
|
+
* Is checbox disabled
|
|
11
|
+
*/
|
|
12
|
+
this.disabled = false;
|
|
13
|
+
/**
|
|
14
|
+
* Is checkbox checked
|
|
15
|
+
*/
|
|
16
|
+
this.checked = false;
|
|
17
|
+
this.isFocus = false;
|
|
18
|
+
this.toggle = () => {
|
|
19
|
+
if (!this.disabled) {
|
|
20
|
+
this.checked = !this.checked;
|
|
21
|
+
this.valueChanged.emit(this.checked);
|
|
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
|
+
getIconColor() {
|
|
38
|
+
if (this.disabled) {
|
|
39
|
+
return 'text-icon-disabled';
|
|
40
|
+
}
|
|
41
|
+
return 'text-negative-negative-1';
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
return (h(Host, { key: '56a8c43bf6e8cdd4a687f5730b86485522486ded' }, h("div", { key: '924f574fecc6e3a92cfc82cd63b9e8345afbe11a', class: {
|
|
45
|
+
'outline-none': true,
|
|
46
|
+
'flex items-center space-x-12': !!this.label && this.type === SulaCheckboxType.Default,
|
|
47
|
+
'flex items-center justify-between bg-surface-on-body rounded-md w-[280px] min-h-[85px] px-24 py-16': this.type === SulaCheckboxType.List,
|
|
48
|
+
'hover:bg-states-empty-bg-hover active:bg-states-empty-bg-pressed cursor-pointer': this.type === SulaCheckboxType.List && !this.disabled,
|
|
49
|
+
'container-focus': this.isFocus && this.type === SulaCheckboxType.List,
|
|
50
|
+
}, onFocus: this.handleFocus, onBlur: this.handleBlur, onClick: this.toggle, tabIndex: 0 }, this.type === SulaCheckboxType.List && (h("div", { key: '7b0ba9c45a7a6733fba4520e8fffe5e9cc1f775e', class: "flex flex-col flex-1 mr-16 overflow-hidden" }, !!this.label && h("label", { key: '61b673e866c72a33ab623f656fe882e3df4f04a3', class: "text-text-primary font-bold text-base cursor-pointer break-words" }, this.label), !!this.subTitle && h("span", { key: '3b3a40d2a4fd14b943722a13c06e2478d19337c9', class: "text-text-secondary text-base break-words" }, this.subTitle))), h("div", { key: '03b6d405c2b7aadd113f1314bc12c99103bc72ac', tabIndex: 0, class: {
|
|
51
|
+
'flex justify-center items-center rounded-xs w-[27px] h-[27px] border outline-none flex-shrink-0': true,
|
|
52
|
+
'checkbox-focus': this.isFocus && this.type === SulaCheckboxType.Default,
|
|
53
|
+
'cursor-pointer active:bg-states-empty-bg-pressed': !this.disabled,
|
|
54
|
+
'bg-states-bg-disabled border-states-bg-disabled': this.disabled,
|
|
55
|
+
'bg-brand-primary border-brand-primary': this.checked,
|
|
56
|
+
'bg-surface-body border-line-input': !this.checked,
|
|
57
|
+
}, onFocus: this.handleFocus, onBlur: this.handleBlur }, this.checked && (h("div", { key: 'ede285c57a75d7a12a4477b31b9c195cd42efca1', class: "flex justify-center items-center" }, h("sula-icon", { key: '5546613a4121659fadb2061e4701ab831dd3bbc6', icon: "ph-bold ph-check", customClass: `${this.getIconColor()} text-xl` })))), !!this.label && this.type === SulaCheckboxType.Default && h("label", { key: '5f1fa7508c159f4b486dad0d4392706e2ca704f1', class: "text-text-secondary text-base cursor-pointer break-words" }, this.label))));
|
|
58
|
+
}
|
|
59
|
+
static get is() { return "sula-checkbox"; }
|
|
60
|
+
static get encapsulation() { return "shadow"; }
|
|
61
|
+
static get originalStyleUrls() {
|
|
62
|
+
return {
|
|
63
|
+
"$": ["sula-checkbox.scss"]
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
static get styleUrls() {
|
|
67
|
+
return {
|
|
68
|
+
"$": ["sula-checkbox.css"]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
static get properties() {
|
|
72
|
+
return {
|
|
73
|
+
"type": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"mutable": true,
|
|
76
|
+
"complexType": {
|
|
77
|
+
"original": "SulaCheckboxType",
|
|
78
|
+
"resolved": "SulaCheckboxType.Default | SulaCheckboxType.List",
|
|
79
|
+
"references": {
|
|
80
|
+
"SulaCheckboxType": {
|
|
81
|
+
"location": "import",
|
|
82
|
+
"path": "./model/sula-checkbox.model",
|
|
83
|
+
"id": "src/components/sula-checkbox/model/sula-checkbox.model.ts::SulaCheckboxType"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"required": false,
|
|
88
|
+
"optional": false,
|
|
89
|
+
"docs": {
|
|
90
|
+
"tags": [],
|
|
91
|
+
"text": "Checkbox type"
|
|
92
|
+
},
|
|
93
|
+
"getter": false,
|
|
94
|
+
"setter": false,
|
|
95
|
+
"attribute": "type",
|
|
96
|
+
"reflect": false,
|
|
97
|
+
"defaultValue": "SulaCheckboxType.Default"
|
|
98
|
+
},
|
|
99
|
+
"label": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"mutable": true,
|
|
102
|
+
"complexType": {
|
|
103
|
+
"original": "string",
|
|
104
|
+
"resolved": "string",
|
|
105
|
+
"references": {}
|
|
106
|
+
},
|
|
107
|
+
"required": false,
|
|
108
|
+
"optional": true,
|
|
109
|
+
"docs": {
|
|
110
|
+
"tags": [],
|
|
111
|
+
"text": "Checkbox label"
|
|
112
|
+
},
|
|
113
|
+
"getter": false,
|
|
114
|
+
"setter": false,
|
|
115
|
+
"attribute": "label",
|
|
116
|
+
"reflect": false
|
|
117
|
+
},
|
|
118
|
+
"subTitle": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"mutable": true,
|
|
121
|
+
"complexType": {
|
|
122
|
+
"original": "string",
|
|
123
|
+
"resolved": "string",
|
|
124
|
+
"references": {}
|
|
125
|
+
},
|
|
126
|
+
"required": false,
|
|
127
|
+
"optional": true,
|
|
128
|
+
"docs": {
|
|
129
|
+
"tags": [],
|
|
130
|
+
"text": "Checkbox sub title (avaible when is `list` type)"
|
|
131
|
+
},
|
|
132
|
+
"getter": false,
|
|
133
|
+
"setter": false,
|
|
134
|
+
"attribute": "sub-title",
|
|
135
|
+
"reflect": false
|
|
136
|
+
},
|
|
137
|
+
"disabled": {
|
|
138
|
+
"type": "boolean",
|
|
139
|
+
"mutable": true,
|
|
140
|
+
"complexType": {
|
|
141
|
+
"original": "boolean",
|
|
142
|
+
"resolved": "boolean",
|
|
143
|
+
"references": {}
|
|
144
|
+
},
|
|
145
|
+
"required": false,
|
|
146
|
+
"optional": false,
|
|
147
|
+
"docs": {
|
|
148
|
+
"tags": [],
|
|
149
|
+
"text": "Is checbox disabled"
|
|
150
|
+
},
|
|
151
|
+
"getter": false,
|
|
152
|
+
"setter": false,
|
|
153
|
+
"attribute": "disabled",
|
|
154
|
+
"reflect": false,
|
|
155
|
+
"defaultValue": "false"
|
|
156
|
+
},
|
|
157
|
+
"checked": {
|
|
158
|
+
"type": "boolean",
|
|
159
|
+
"mutable": true,
|
|
160
|
+
"complexType": {
|
|
161
|
+
"original": "boolean",
|
|
162
|
+
"resolved": "boolean",
|
|
163
|
+
"references": {}
|
|
164
|
+
},
|
|
165
|
+
"required": false,
|
|
166
|
+
"optional": false,
|
|
167
|
+
"docs": {
|
|
168
|
+
"tags": [],
|
|
169
|
+
"text": "Is checkbox checked"
|
|
170
|
+
},
|
|
171
|
+
"getter": false,
|
|
172
|
+
"setter": false,
|
|
173
|
+
"attribute": "checked",
|
|
174
|
+
"reflect": false,
|
|
175
|
+
"defaultValue": "false"
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
static get states() {
|
|
180
|
+
return {
|
|
181
|
+
"isFocus": {}
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
static get events() {
|
|
185
|
+
return [{
|
|
186
|
+
"method": "valueChanged",
|
|
187
|
+
"name": "valueChanged",
|
|
188
|
+
"bubbles": true,
|
|
189
|
+
"cancelable": true,
|
|
190
|
+
"composed": true,
|
|
191
|
+
"docs": {
|
|
192
|
+
"tags": [],
|
|
193
|
+
"text": "Event emitted when checkbox value changes."
|
|
194
|
+
},
|
|
195
|
+
"complexType": {
|
|
196
|
+
"original": "boolean",
|
|
197
|
+
"resolved": "boolean",
|
|
198
|
+
"references": {}
|
|
199
|
+
}
|
|
200
|
+
}, {
|
|
201
|
+
"method": "focusedOn",
|
|
202
|
+
"name": "focusedOn",
|
|
203
|
+
"bubbles": true,
|
|
204
|
+
"cancelable": true,
|
|
205
|
+
"composed": true,
|
|
206
|
+
"docs": {
|
|
207
|
+
"tags": [],
|
|
208
|
+
"text": "Event emitted when checkbox is focused."
|
|
209
|
+
},
|
|
210
|
+
"complexType": {
|
|
211
|
+
"original": "void",
|
|
212
|
+
"resolved": "void",
|
|
213
|
+
"references": {}
|
|
214
|
+
}
|
|
215
|
+
}, {
|
|
216
|
+
"method": "focusedOut",
|
|
217
|
+
"name": "focusedOut",
|
|
218
|
+
"bubbles": true,
|
|
219
|
+
"cancelable": true,
|
|
220
|
+
"composed": true,
|
|
221
|
+
"docs": {
|
|
222
|
+
"tags": [],
|
|
223
|
+
"text": "Event emitted when checkbox is focused out."
|
|
224
|
+
},
|
|
225
|
+
"complexType": {
|
|
226
|
+
"original": "void",
|
|
227
|
+
"resolved": "void",
|
|
228
|
+
"references": {}
|
|
229
|
+
}
|
|
230
|
+
}];
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=sula-checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sula-checkbox.js","sourceRoot":"","sources":["../../../src/components/sula-checkbox/sula-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAO/D,MAAM,OAAO,YAAY;IALzB;QAME;;WAEG;QACsB,SAAI,GAAqB,gBAAgB,CAAC,OAAO,CAAC;QAY3E;;WAEG;QACsB,aAAQ,GAAY,KAAK,CAAC;QAEnD;;WAEG;QACsB,YAAO,GAAY,KAAK,CAAC;QAqBlD,YAAO,GAAY,KAAK,CAAC;QAEzB,WAAM,GAAG,GAAG,EAAE;YACZ,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACnB,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC7B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACvC,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,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AC,IAAI,CAAC,QAAQ;wBAClE,iDAAiD,EAAE,IAAI,CAAC,QAAQ;wBAChE,uCAAuC,EAAE,IAAI,CAAC,OAAO;wBACrD,mCAAmC,EAAE,CAAC,IAAI,CAAC,OAAO;qBACnD,EACD,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,UAAU,IAEtB,IAAI,CAAC,OAAO,IAAI,CACf,4DAAK,KAAK,EAAC,kCAAkC;oBAC3C,kEAAW,IAAI,EAAC,kBAAkB,EAAC,WAAW,EAAE,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,GAAc,CAC1F,CACP,CACG;gBACL,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,KAAK,gBAAgB,CAAC,OAAO,IAAI,8DAAO,KAAK,EAAC,0DAA0D,IAAE,IAAI,CAAC,KAAK,CAAS,CACnJ,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, Host, Prop, State, h } from '@stencil/core';\nimport { SulaCheckboxType } from './model/sula-checkbox.model';\n\n@Component({\n tag: 'sula-checkbox',\n styleUrl: 'sula-checkbox.scss',\n shadow: true,\n})\nexport class SulaCheckbox {\n /**\n * Checkbox type\n */\n @Prop({ mutable: true }) type: SulaCheckboxType = SulaCheckboxType.Default;\n\n /**\n * Checkbox label\n */\n @Prop({ mutable: true }) label?: string;\n\n /**\n * Checkbox sub title (avaible when is `list` type)\n */\n @Prop({ mutable: true }) subTitle?: string;\n\n /**\n * Is checbox disabled\n */\n @Prop({ mutable: true }) disabled: boolean = false;\n\n /**\n * Is checkbox checked\n */\n @Prop({ mutable: true }) checked: boolean = false;\n\n /**\n * Event emitted when checkbox value changes.\n */\n @Event()\n valueChanged: EventEmitter<boolean>;\n\n /**\n * Event emitted when checkbox is focused.\n */\n @Event()\n focusedOn: EventEmitter<void>;\n\n /**\n * Event emitted when checkbox is focused out.\n */\n @Event()\n focusedOut: EventEmitter<void>;\n\n @State()\n isFocus: boolean = false;\n\n toggle = () => {\n if (!this.disabled) {\n this.checked = !this.checked;\n this.valueChanged.emit(this.checked);\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 getIconColor() {\n if (this.disabled) {\n return 'text-icon-disabled';\n }\n\n return 'text-negative-negative-1';\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 === SulaCheckboxType.Default,\n 'flex items-center justify-between bg-surface-on-body rounded-md w-[280px] min-h-[85px] px-24 py-16': this.type === SulaCheckboxType.List,\n 'hover:bg-states-empty-bg-hover active:bg-states-empty-bg-pressed cursor-pointer': this.type === SulaCheckboxType.List && !this.disabled,\n 'container-focus': this.isFocus && this.type === SulaCheckboxType.List,\n }}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n onClick={this.toggle}\n tabIndex={0}\n >\n {this.type === SulaCheckboxType.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\n <div\n tabIndex={0}\n class={{\n 'flex justify-center items-center rounded-xs w-[27px] h-[27px] border outline-none flex-shrink-0': true,\n 'checkbox-focus': this.isFocus && this.type === SulaCheckboxType.Default,\n 'cursor-pointer active:bg-states-empty-bg-pressed': !this.disabled,\n 'bg-states-bg-disabled border-states-bg-disabled': this.disabled,\n 'bg-brand-primary border-brand-primary': this.checked,\n 'bg-surface-body border-line-input': !this.checked,\n }}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n >\n {this.checked && (\n <div class=\"flex justify-center items-center\">\n <sula-icon icon=\"ph-bold ph-check\" customClass={`${this.getIconColor()} text-xl`}></sula-icon>\n </div>\n )}\n </div>\n {!!this.label && this.type === SulaCheckboxType.Default && <label class=\"text-text-secondary text-base cursor-pointer break-words\">{this.label}</label>}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { SulaCheckboxType } from "./model/sula-checkbox.model";
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Components/sula-checkbox',
|
|
4
|
+
tags: ['autodocs'],
|
|
5
|
+
argTypes: {
|
|
6
|
+
type: {
|
|
7
|
+
control: { type: 'select' },
|
|
8
|
+
options: Object.values(SulaCheckboxType),
|
|
9
|
+
defaultValue: SulaCheckboxType.Default,
|
|
10
|
+
description: 'The checkbox type',
|
|
11
|
+
type: {
|
|
12
|
+
required: false,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
label: {
|
|
16
|
+
control: 'text',
|
|
17
|
+
defaultValue: 'Label',
|
|
18
|
+
description: 'The checkbox label',
|
|
19
|
+
type: {
|
|
20
|
+
required: false,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
subTitle: {
|
|
24
|
+
control: 'text',
|
|
25
|
+
defaultValue: '',
|
|
26
|
+
description: 'The checkbox subtitle (available when type is List)',
|
|
27
|
+
type: {
|
|
28
|
+
required: false,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
disabled: {
|
|
32
|
+
control: 'boolean',
|
|
33
|
+
defaultValue: false,
|
|
34
|
+
description: 'Whether the checkbox is disabled',
|
|
35
|
+
type: {
|
|
36
|
+
required: false,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
checked: {
|
|
40
|
+
control: 'boolean',
|
|
41
|
+
defaultValue: false,
|
|
42
|
+
description: 'Whether the checkbox is checked',
|
|
43
|
+
type: {
|
|
44
|
+
required: false,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
valueChanged: {
|
|
48
|
+
action: 'valueChanged',
|
|
49
|
+
description: 'Event emitted when checkbox value changes',
|
|
50
|
+
},
|
|
51
|
+
focusedOn: {
|
|
52
|
+
action: 'focusedOn',
|
|
53
|
+
description: 'Event emitted when checkbox is focused',
|
|
54
|
+
},
|
|
55
|
+
focusedOut: {
|
|
56
|
+
action: 'focusedOut',
|
|
57
|
+
description: 'Event emitted when checkbox 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-checkbox');
|
|
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('checked', args.checked.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: SulaCheckboxType.Default,
|
|
84
|
+
label: 'Aceitar termos e condições',
|
|
85
|
+
subTitle: '',
|
|
86
|
+
disabled: false,
|
|
87
|
+
checked: false,
|
|
88
|
+
};
|
|
89
|
+
export const DefaultChecked = Template.bind({});
|
|
90
|
+
DefaultChecked.args = Object.assign(Object.assign({}, Default.args), { checked: true });
|
|
91
|
+
export const DefaultDisabled = Template.bind({});
|
|
92
|
+
DefaultDisabled.args = Object.assign(Object.assign({}, Default.args), { disabled: true });
|
|
93
|
+
export const DefaultCheckedDisabled = Template.bind({});
|
|
94
|
+
DefaultCheckedDisabled.args = Object.assign(Object.assign({}, Default.args), { checked: 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: SulaCheckboxType.List,
|
|
100
|
+
label: 'Opção de lista',
|
|
101
|
+
subTitle: 'Descrição adicional para esta opção',
|
|
102
|
+
disabled: false,
|
|
103
|
+
checked: false,
|
|
104
|
+
};
|
|
105
|
+
export const ListChecked = Template.bind({});
|
|
106
|
+
ListChecked.args = Object.assign(Object.assign({}, List.args), { checked: true });
|
|
107
|
+
export const ListDisabled = Template.bind({});
|
|
108
|
+
ListDisabled.args = Object.assign(Object.assign({}, List.args), { disabled: true });
|
|
109
|
+
export const ListCheckedDisabled = Template.bind({});
|
|
110
|
+
ListCheckedDisabled.args = Object.assign(Object.assign({}, List.args), { checked: true, disabled: true });
|
|
111
|
+
export const ListWithoutSubtitle = Template.bind({});
|
|
112
|
+
ListWithoutSubtitle.args = Object.assign(Object.assign({}, List.args), { subTitle: '' });
|
|
113
|
+
//# sourceMappingURL=sula-checkbox.stories.js.map
|