@rededor/cura 1.6.1-alpha.9 → 1.7.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/assets/assets/icons/iconset-default-list.ts +1 -1
- package/dist/assets/assets/icons/iconset-default-tmp.svg +4 -0
- package/dist/assets/assets/icons/iconset-default.svg +1 -1
- package/dist/cjs/{app-globals-28c6f5c4.js → app-globals-6d5b51b6.js} +2 -2
- package/dist/cjs/{app-globals-28c6f5c4.js.map → app-globals-6d5b51b6.js.map} +1 -1
- package/dist/cjs/{cura-accordion_18.cjs.entry.js → cura-accordion_20.cjs.entry.js} +147 -7
- package/dist/cjs/cura-accordion_20.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-display.cjs.entry.js +1 -1
- package/dist/cjs/cura-icons-view.cjs.entry.js +1 -1
- package/dist/cjs/cura-icons-view.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-modal.cjs.entry.js +3 -3
- package/dist/cjs/cura-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-tabs-button.cjs.entry.js +106 -0
- package/dist/cjs/cura-tabs-button.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-tabs-transparent.cjs.entry.js +105 -0
- package/dist/cjs/cura-tabs-transparent.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-tabs.definitions-b8955ad4.js +12 -0
- package/dist/cjs/cura-tabs.definitions-b8955ad4.js.map +1 -0
- package/dist/cjs/{cura-theme-module-f1e4a309.js → cura-theme-module-09bb63a4.js} +32 -1
- package/dist/cjs/cura-theme-module-09bb63a4.js.map +1 -0
- package/dist/cjs/cura.cjs.js +3 -3
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/api/theme-presets/theme-perinatal-temporary.js +32 -0
- package/dist/collection/api/theme-presets/theme-perinatal-temporary.js.map +1 -0
- package/dist/collection/api/theme-presets/theme-presets.js +2 -0
- package/dist/collection/api/theme-presets/theme-presets.js.map +1 -1
- package/dist/collection/assets/icons/iconset-default-list.js +1 -1
- package/dist/collection/assets/icons/iconset-default-list.js.map +1 -1
- package/dist/collection/assets/icons/iconset-default-tmp.svg +4 -0
- package/dist/collection/assets/icons/iconset-default.svg +1 -1
- package/dist/collection/assets-raw/icons/default/vaccine.svg +3 -0
- package/dist/collection/collection-manifest.json +4 -0
- package/dist/collection/components/cura-modal/cura-modal.css +1 -1
- package/dist/collection/components/cura-modal/cura-modal.js +2 -2
- package/dist/collection/components/cura-modal/cura-modal.js.map +1 -1
- package/dist/collection/components/forms/cura-input-text/cura-input-text.js +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.css +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.js +22 -3
- package/dist/collection/components/forms/cura-select/cura-select.js.map +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.stories.js +12 -0
- package/dist/collection/components/forms/cura-select/cura-select.stories.js.map +1 -1
- package/dist/collection/components/tabs/cura-tabs/cura-tabs.css +170 -0
- package/dist/collection/components/tabs/cura-tabs/cura-tabs.js +263 -0
- package/dist/collection/components/tabs/cura-tabs/cura-tabs.js.map +1 -0
- package/dist/collection/components/tabs/cura-tabs/cura-tabs.stories.js +89 -0
- package/dist/collection/components/tabs/cura-tabs/cura-tabs.stories.js.map +1 -0
- package/dist/collection/components/tabs/cura-tabs-button/cura-tabs-button.css +176 -0
- package/dist/collection/components/tabs/cura-tabs-button/cura-tabs-button.js +259 -0
- package/dist/collection/components/tabs/cura-tabs-button/cura-tabs-button.js.map +1 -0
- package/dist/collection/components/tabs/cura-tabs-button/cura-tabs-button.stories.js +96 -0
- package/dist/collection/components/tabs/cura-tabs-button/cura-tabs-button.stories.js.map +1 -0
- package/dist/collection/components/tabs/cura-tabs-group/cura-tabs-group.css +25 -0
- package/dist/collection/components/tabs/cura-tabs-group/cura-tabs-group.js +133 -0
- package/dist/collection/components/tabs/cura-tabs-group/cura-tabs-group.js.map +1 -0
- package/dist/collection/components/tabs/cura-tabs-group/cura-tabs-group.stories.js +65 -0
- package/dist/collection/components/tabs/cura-tabs-group/cura-tabs-group.stories.js.map +1 -0
- package/dist/collection/components/tabs/cura-tabs-transparent/cura-tabs-transparent.css +168 -0
- package/dist/collection/components/tabs/cura-tabs-transparent/cura-tabs-transparent.js +258 -0
- package/dist/collection/components/tabs/cura-tabs-transparent/cura-tabs-transparent.js.map +1 -0
- package/dist/collection/components/tabs/cura-tabs-transparent/cura-tabs-transparent.stories.js +89 -0
- package/dist/collection/components/tabs/cura-tabs-transparent/cura-tabs-transparent.stories.js.map +1 -0
- package/dist/collection/components/tabs/cura-tabs.definitions.js +7 -0
- package/dist/collection/components/tabs/cura-tabs.definitions.js.map +1 -0
- package/dist/collection/components/text/cura-display/cura-display.js +1 -1
- package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
- package/dist/components/cura-display.js +1 -1
- package/dist/components/cura-heading2.js +1 -1
- package/dist/components/cura-icons-view.js +1 -1
- package/dist/components/cura-icons-view.js.map +1 -1
- package/dist/components/cura-modal.js +3 -3
- package/dist/components/cura-modal.js.map +1 -1
- package/dist/components/cura-paragraph2.js +1 -1
- package/dist/components/cura-select2.js +6 -4
- package/dist/components/cura-select2.js.map +1 -1
- package/dist/components/cura-tabs-button.d.ts +11 -0
- package/dist/components/cura-tabs-button.js +150 -0
- package/dist/components/cura-tabs-button.js.map +1 -0
- package/dist/components/cura-tabs-group.d.ts +11 -0
- package/dist/components/cura-tabs-group.js +64 -0
- package/dist/components/cura-tabs-group.js.map +1 -0
- package/dist/components/cura-tabs-transparent.d.ts +11 -0
- package/dist/components/cura-tabs-transparent.js +143 -0
- package/dist/components/cura-tabs-transparent.js.map +1 -0
- package/dist/components/cura-tabs.d.ts +11 -0
- package/dist/components/cura-tabs.definitions.js +10 -0
- package/dist/components/cura-tabs.definitions.js.map +1 -0
- package/dist/components/cura-tabs.js +148 -0
- package/dist/components/cura-tabs.js.map +1 -0
- package/dist/components/index.js +39 -0
- package/dist/components/index.js.map +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/cura.esm.js.map +1 -1
- package/dist/cura/index.esm.js +1 -1
- package/dist/cura/p-1ef21ae9.entry.js +2 -0
- package/dist/cura/p-1ef21ae9.entry.js.map +1 -0
- package/dist/cura/p-53c18ed4.js +2 -0
- package/dist/cura/p-53c18ed4.js.map +1 -0
- package/dist/cura/p-5c6f9593.entry.js +2 -0
- package/dist/cura/p-5c6f9593.entry.js.map +1 -0
- package/dist/cura/{p-0c25333f.js → p-6cbd49dd.js} +2 -2
- package/dist/cura/{p-0c25333f.js.map → p-6cbd49dd.js.map} +1 -1
- package/dist/cura/p-7e2d1229.entry.js +2 -0
- package/dist/cura/p-7e2d1229.entry.js.map +1 -0
- package/dist/cura/{p-ac01bec2.entry.js → p-8aade007.entry.js} +2 -2
- package/dist/cura/p-9f460031.js +2 -0
- package/dist/cura/p-9f460031.js.map +1 -0
- package/dist/cura/p-b4ee956b.entry.js +2 -0
- package/dist/cura/p-b4ee956b.entry.js.map +1 -0
- package/dist/cura/p-b6ff8ac1.entry.js +2 -0
- package/dist/cura/p-b6ff8ac1.entry.js.map +1 -0
- package/dist/esm/{app-globals-ca1945d1.js → app-globals-c2abb41c.js} +2 -2
- package/dist/esm/{app-globals-ca1945d1.js.map → app-globals-c2abb41c.js.map} +1 -1
- package/dist/esm/{cura-accordion_18.entry.js → cura-accordion_20.entry.js} +146 -8
- package/dist/esm/cura-accordion_20.entry.js.map +1 -0
- package/dist/esm/cura-display.entry.js +1 -1
- package/dist/esm/cura-icons-view.entry.js +1 -1
- package/dist/esm/cura-icons-view.entry.js.map +1 -1
- package/dist/esm/cura-modal.entry.js +3 -3
- package/dist/esm/cura-modal.entry.js.map +1 -1
- package/dist/esm/cura-tabs-button.entry.js +102 -0
- package/dist/esm/cura-tabs-button.entry.js.map +1 -0
- package/dist/esm/cura-tabs-transparent.entry.js +101 -0
- package/dist/esm/cura-tabs-transparent.entry.js.map +1 -0
- package/dist/esm/cura-tabs.definitions-a017126e.js +10 -0
- package/dist/esm/cura-tabs.definitions-a017126e.js.map +1 -0
- package/dist/esm/{cura-theme-module-0fa5ee0b.js → cura-theme-module-bf286f68.js} +32 -1
- package/dist/esm/cura-theme-module-bf286f68.js.map +1 -0
- package/dist/esm/cura.js +3 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/types/api/theme-presets/theme-perinatal-temporary.d.ts +43 -0
- package/dist/types/api/theme-presets/theme-presets.d.ts +43 -0
- package/dist/types/components/forms/cura-select/cura-select.d.ts +6 -0
- package/dist/types/components/forms/cura-select/cura-select.stories.d.ts +11 -0
- package/dist/types/components/tabs/cura-tabs/cura-tabs.d.ts +30 -0
- package/dist/types/components/tabs/cura-tabs/cura-tabs.stories.d.ts +99 -0
- package/dist/types/components/tabs/cura-tabs-button/cura-tabs-button.d.ts +29 -0
- package/dist/types/components/tabs/cura-tabs-button/cura-tabs-button.stories.d.ts +99 -0
- package/dist/types/components/tabs/cura-tabs-group/cura-tabs-group.d.ts +18 -0
- package/dist/types/components/tabs/cura-tabs-group/cura-tabs-group.stories.d.ts +57 -0
- package/dist/types/components/tabs/cura-tabs-transparent/cura-tabs-transparent.d.ts +29 -0
- package/dist/types/components/tabs/cura-tabs-transparent/cura-tabs-transparent.stories.d.ts +99 -0
- package/dist/types/components/tabs/cura-tabs.definitions.d.ts +6 -0
- package/dist/types/components.d.ts +172 -0
- package/package.json +2 -2
- package/dist/cjs/cura-accordion_18.cjs.entry.js.map +0 -1
- package/dist/cjs/cura-theme-module-f1e4a309.js.map +0 -1
- package/dist/cura/p-07817634.entry.js +0 -2
- package/dist/cura/p-07817634.entry.js.map +0 -1
- package/dist/cura/p-9fce5ec5.entry.js +0 -2
- package/dist/cura/p-9fce5ec5.entry.js.map +0 -1
- package/dist/cura/p-b5d8a26b.entry.js +0 -2
- package/dist/cura/p-b5d8a26b.entry.js.map +0 -1
- package/dist/cura/p-bf8e2037.js +0 -2
- package/dist/cura/p-bf8e2037.js.map +0 -1
- package/dist/esm/cura-accordion_18.entry.js.map +0 -1
- package/dist/esm/cura-theme-module-0fa5ee0b.js.map +0 -1
- /package/dist/cura/{p-ac01bec2.entry.js.map → p-8aade007.entry.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cura-tabs-button.stories.js","sourceRoot":"","sources":["../../../../src/components/tabs/cura-tabs-button/cura-tabs-button.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,SAAS,MAAM,4CAA4C,CAAC;AAEnE,MAAM,oBAAoB,GAAG,CAAC,IAAS,EAAE,EAAE,CAAC;;aAE/B,IAAI,CAAC,IAAI;kBACJ,IAAI,CAAC,QAAQ;gBACf,IAAI,CAAC,OAAO;iBACX,IAAI,CAAC,QAAQ;iBACb,IAAI,CAAC,QAAQ;aACjB,IAAI,CAAC,IAAI;mBACH,IAAI,CAAC,SAAS;;;;CAIhC,CAAC;AAEF,eAAe;IACb,KAAK,EAAE,8BAA8B;IACrC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM,EAAE,CAAC,EAAW,EAAE,EAAE;YAAV,IAAI,cAAT,EAAW,CAAF;QAChB,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IACD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;YACf,WAAW,EACT,qNAAqN;YACvN,KAAK,EAAE;gBACL,QAAQ,EAAE,YAAY;aACvB;SACF;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,OAAO,EAAE,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC;YAC3B,WAAW,EAAE,4CAA4C;YACzD,KAAK,EAAE;gBACL,QAAQ,EAAE,YAAY;aACvB;SACF;QACD,OAAO,EAAE;YACP,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,2CAA2C;YACxD,KAAK,EAAE;gBACL,QAAQ,EAAE,YAAY;gBACtB,YAAY,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;aAC/B;SACF;QACD,QAAQ,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,mCAAmC,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;QAClJ,QAAQ,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,oCAAoC,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;QACnJ,IAAI,EAAE;YACJ,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC;YACrC,WAAW,EAAE,+BAA+B;YAC5C,KAAK,EAAE;gBACL,QAAQ,EAAE,YAAY;gBACtB,YAAY,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;aACnC;SACF;QACD,SAAS,EAAE;YACT,OAAO,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;YACjC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;YAC1B,WAAW,EAAE,uBAAuB;YACpC,KAAK,EAAE;gBACL,QAAQ,EAAE,YAAY;gBACtB,YAAY,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;aACnC;SACF;QACD,SAAS,EAAE;YACT,MAAM,EAAE,WAAW;YACnB,WAAW,EAAE,6DAA6D;YAC1E,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE;SAC9B;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,YAAY;QACtB,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,OAAO;QACb,SAAS,EAAE,OAAO;KACnB;CACF,CAAC","sourcesContent":["import iconNames from '../../../assets/icons/iconset-default-list';\n\nconst renderCuraTabsButton = (args: any) => `\n <cura-tabs-button\n name=${args.name}\n icon-name=${args.iconName}\n counter=${args.counter}\n selected=${args.selected}\n disabled=${args.disabled}\n size=${args.size}\n color-mode=${args.colorMode}\n >\n Label\n </cura-tabs-button>\n`;\n\nexport default {\n title: 'Componentes/Tabs/Tabs Button',\n tags: ['autodocs'],\n render: ({ ...args }) => {\n return renderCuraTabsButton(args);\n },\n argTypes: {\n name: {\n control: 'text',\n description:\n 'Define o identificador único do tabs. Obrigatório definir um \"name\" distinto para cada cura-tabs-button quando utilizado dentro de um tabs-group, garantindo o controle correto do estado e a seleção da aba ativa.',\n table: {\n category: 'Properties',\n },\n },\n iconName: {\n control: { type: 'select' },\n options: ['', ...iconNames],\n description: 'Define o nome do ícone exibido do iconset.',\n table: {\n category: 'Properties',\n },\n },\n counter: {\n control: 'number',\n description: 'Define o número exibido no badge counter.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '1' },\n },\n },\n selected: { control: 'boolean', description: 'Define se a aba está selecionada.', table: { category: 'State', defaultValue: { summary: false } } },\n disabled: { control: 'boolean', description: 'Define se a aba está desabilitada.', table: { category: 'State', defaultValue: { summary: false } } },\n size: {\n control: 'select',\n options: ['small', 'medium', 'large'],\n description: 'Define o tamanho do elemento.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'large' },\n },\n },\n colorMode: {\n control: { type: 'inline-radio' },\n options: ['light', 'dark'],\n description: 'Define a cor de tema.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'light' },\n },\n },\n tabSelect: {\n action: 'tabSelect',\n description: 'Evento disparado ao clicar na aba. Retorna o \"name\" da aba.',\n table: { category: 'Events' },\n },\n },\n};\n\nexport const CuraTabs = {\n args: {\n name: 'tab1',\n iconName: 'infoCircle',\n counter: 1,\n selected: false,\n disabled: false,\n size: 'large',\n colorMode: 'light',\n },\n};\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: var(--gap);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
:host(.border-bottom) {
|
|
7
|
+
position: relative;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host(.border-bottom)::after {
|
|
11
|
+
content: "";
|
|
12
|
+
position: absolute;
|
|
13
|
+
bottom: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
right: 0;
|
|
16
|
+
height: 1px;
|
|
17
|
+
background: var(--border-color);
|
|
18
|
+
z-index: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
::slotted(cura-tabs),
|
|
22
|
+
::slotted(cura-tabs-transparent) {
|
|
23
|
+
position: relative;
|
|
24
|
+
z-index: 1;
|
|
25
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class CuraTabsGroup {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.gap = 0;
|
|
5
|
+
this.borderBottom = true;
|
|
6
|
+
this.colorMode = 'light';
|
|
7
|
+
this.styles = {};
|
|
8
|
+
}
|
|
9
|
+
handleTabSelect(ev) {
|
|
10
|
+
this.updateSelectedTab(ev.detail.name);
|
|
11
|
+
}
|
|
12
|
+
updateSelectedTab(value) {
|
|
13
|
+
const tabs = this.host.querySelectorAll('cura-tabs, cura-tabs-transparent, cura-tabs-button');
|
|
14
|
+
tabs.forEach((tab) => {
|
|
15
|
+
tab.selected = tab.name === value;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
getClasses() {
|
|
19
|
+
return {
|
|
20
|
+
'border-bottom': this.borderBottom,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
connectedCallback() {
|
|
24
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--border-color': window.CuraAPI.theme.colors.getColor(this.colorMode === 'light' ? 'neutral-base' : 'primary-base'), '--gap': `${this.gap}px` });
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
return (h(Host, { key: 'fb6a6ae52fd5bdfb8c3978a75f26be87479ccafa', role: "tablist", style: this.styles, class: this.getClasses() }, h("slot", { key: 'afca97b27c8359f8236331257e4db41f1332e071' })));
|
|
28
|
+
}
|
|
29
|
+
static get is() { return "cura-tabs-group"; }
|
|
30
|
+
static get encapsulation() { return "shadow"; }
|
|
31
|
+
static get originalStyleUrls() {
|
|
32
|
+
return {
|
|
33
|
+
"$": ["cura-tabs-group.scss"]
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
static get styleUrls() {
|
|
37
|
+
return {
|
|
38
|
+
"$": ["cura-tabs-group.css"]
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
static get properties() {
|
|
42
|
+
return {
|
|
43
|
+
"gap": {
|
|
44
|
+
"type": "number",
|
|
45
|
+
"mutable": false,
|
|
46
|
+
"complexType": {
|
|
47
|
+
"original": "number",
|
|
48
|
+
"resolved": "number",
|
|
49
|
+
"references": {}
|
|
50
|
+
},
|
|
51
|
+
"required": false,
|
|
52
|
+
"optional": false,
|
|
53
|
+
"docs": {
|
|
54
|
+
"tags": [],
|
|
55
|
+
"text": ""
|
|
56
|
+
},
|
|
57
|
+
"attribute": "gap",
|
|
58
|
+
"reflect": true,
|
|
59
|
+
"defaultValue": "0"
|
|
60
|
+
},
|
|
61
|
+
"borderBottom": {
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"mutable": true,
|
|
64
|
+
"complexType": {
|
|
65
|
+
"original": "boolean",
|
|
66
|
+
"resolved": "boolean",
|
|
67
|
+
"references": {}
|
|
68
|
+
},
|
|
69
|
+
"required": false,
|
|
70
|
+
"optional": false,
|
|
71
|
+
"docs": {
|
|
72
|
+
"tags": [],
|
|
73
|
+
"text": ""
|
|
74
|
+
},
|
|
75
|
+
"attribute": "border-bottom",
|
|
76
|
+
"reflect": true,
|
|
77
|
+
"defaultValue": "true"
|
|
78
|
+
},
|
|
79
|
+
"colorMode": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"mutable": true,
|
|
82
|
+
"complexType": {
|
|
83
|
+
"original": "'dark' | 'light'",
|
|
84
|
+
"resolved": "\"dark\" | \"light\"",
|
|
85
|
+
"references": {}
|
|
86
|
+
},
|
|
87
|
+
"required": false,
|
|
88
|
+
"optional": false,
|
|
89
|
+
"docs": {
|
|
90
|
+
"tags": [],
|
|
91
|
+
"text": ""
|
|
92
|
+
},
|
|
93
|
+
"attribute": "color-mode",
|
|
94
|
+
"reflect": true,
|
|
95
|
+
"defaultValue": "'light'"
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
static get states() {
|
|
100
|
+
return {
|
|
101
|
+
"styles": {}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
static get events() {
|
|
105
|
+
return [{
|
|
106
|
+
"method": "tabChange",
|
|
107
|
+
"name": "tabChange",
|
|
108
|
+
"bubbles": true,
|
|
109
|
+
"cancelable": true,
|
|
110
|
+
"composed": true,
|
|
111
|
+
"docs": {
|
|
112
|
+
"tags": [],
|
|
113
|
+
"text": ""
|
|
114
|
+
},
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "string",
|
|
117
|
+
"resolved": "string",
|
|
118
|
+
"references": {}
|
|
119
|
+
}
|
|
120
|
+
}];
|
|
121
|
+
}
|
|
122
|
+
static get elementRef() { return "host"; }
|
|
123
|
+
static get listeners() {
|
|
124
|
+
return [{
|
|
125
|
+
"name": "tabSelect",
|
|
126
|
+
"method": "handleTabSelect",
|
|
127
|
+
"target": undefined,
|
|
128
|
+
"capture": false,
|
|
129
|
+
"passive": false
|
|
130
|
+
}];
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=cura-tabs-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cura-tabs-group.js","sourceRoot":"","sources":["../../../../src/components/tabs/cura-tabs-group/cura-tabs-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOtG,MAAM,OAAO,aAAa;;mBACe,CAAC;4BACwB,IAAI;yBACE,OAAO;sBAEnC,EAAE;;IAO5C,eAAe,CAAC,EAAiC;QAC/C,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,iBAAiB,CAAC,KAAa;QAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,oDAAoD,CAAC,CAAC;QAE9F,IAAI,CAAC,OAAO,CAAC,CAAC,GAAwB,EAAE,EAAE;YACxC,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,UAAU;QACR,OAAO;YACL,eAAe,EAAE,IAAI,CAAC,YAAY;SACnC,CAAC;IACJ,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,MAAM,mCACN,IAAI,CAAC,MAAM,KACd,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,EACpH,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,GACzB,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,IAAI,EAAC,SAAS,EAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE;YAC/D,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, Host, Listen, Prop, State, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-tabs-group',\n styleUrl: 'cura-tabs-group.scss',\n shadow: true,\n})\nexport class CuraTabsGroup {\n @Prop({ reflect: true }) gap: number = 0;\n @Prop({ reflect: true, mutable: true }) borderBottom: boolean = true;\n @Prop({ reflect: true, mutable: true }) colorMode: 'dark' | 'light' = 'light';\n\n @State() styles: Record<string, string> = {};\n\n @Element() host: HTMLElement;\n\n @Event() tabChange: EventEmitter<string>;\n\n @Listen('tabSelect')\n handleTabSelect(ev: CustomEvent<{ name: string }>) {\n this.updateSelectedTab(ev.detail.name);\n }\n\n updateSelectedTab(value: string) {\n const tabs = this.host.querySelectorAll('cura-tabs, cura-tabs-transparent, cura-tabs-button');\n\n tabs.forEach((tab: HTMLCuraTabsElement) => {\n tab.selected = tab.name === value;\n });\n }\n\n getClasses() {\n return {\n 'border-bottom': this.borderBottom,\n };\n }\n\n connectedCallback() {\n this.styles = {\n ...this.styles,\n '--border-color': window.CuraAPI.theme.colors.getColor(this.colorMode === 'light' ? 'neutral-base' : 'primary-base'),\n '--gap': `${this.gap}px`,\n };\n }\n\n render() {\n return (\n <Host role=\"tablist\" style={this.styles} class={this.getClasses()}>\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s)
|
|
4
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
const renderCuraTabsGroup = (args) => `
|
|
14
|
+
<cura-tabs-group
|
|
15
|
+
gap=${args.gap}
|
|
16
|
+
border-bottom=${args.borderBottom}
|
|
17
|
+
color-mode=${args.colorMode}
|
|
18
|
+
>
|
|
19
|
+
<cura-tabs name="tab1" icon-name="infoCircle" border-bottom="false" selected>Label</cura-tabs>
|
|
20
|
+
<cura-tabs name="tab2" icon-name="infoCircle" border-bottom="false">Label</cura-tabs>
|
|
21
|
+
<cura-tabs name="tab3" icon-name="infoCircle" border-bottom="false">Label</cura-tabs>
|
|
22
|
+
<cura-tabs name="tab4" icon-name="infoCircle" border-bottom="false" disabled>Label</cura-tabs>
|
|
23
|
+
</cura-tabs-group>
|
|
24
|
+
`;
|
|
25
|
+
export default {
|
|
26
|
+
title: 'Componentes/Tabs/Tabs Group',
|
|
27
|
+
tags: ['autodocs'],
|
|
28
|
+
render: (_a) => {
|
|
29
|
+
var args = __rest(_a, []);
|
|
30
|
+
return renderCuraTabsGroup(args);
|
|
31
|
+
},
|
|
32
|
+
argTypes: {
|
|
33
|
+
gap: {
|
|
34
|
+
control: 'number',
|
|
35
|
+
description: 'Define o espaçamento (gap) entre as abas. Valor em pixels.',
|
|
36
|
+
table: {
|
|
37
|
+
category: 'Properties',
|
|
38
|
+
defaultValue: { summary: '0px' },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
borderBottom: { control: 'boolean', description: 'Define se a borda inferior é exibida.', table: { category: 'Properties', defaultValue: { summary: 'true' } } },
|
|
42
|
+
colorMode: {
|
|
43
|
+
control: { type: 'inline-radio' },
|
|
44
|
+
options: ['light', 'dark'],
|
|
45
|
+
description: 'Define a cor de tema.',
|
|
46
|
+
table: {
|
|
47
|
+
category: 'Properties',
|
|
48
|
+
defaultValue: { summary: 'light' },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
tabChange: {
|
|
52
|
+
action: 'tabChange',
|
|
53
|
+
description: 'Evento disparado ao clicar em uma aba. Retorna o "name" da aba clicada.',
|
|
54
|
+
table: { category: 'Events' },
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
export const CuraTabs = {
|
|
59
|
+
args: {
|
|
60
|
+
gap: 0,
|
|
61
|
+
borderBottom: true,
|
|
62
|
+
colorMode: 'light',
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=cura-tabs-group.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cura-tabs-group.stories.js","sourceRoot":"","sources":["../../../../src/components/tabs/cura-tabs-group/cura-tabs-group.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,MAAM,mBAAmB,GAAG,CAAC,IAAS,EAAE,EAAE,CAAC;;YAE/B,IAAI,CAAC,GAAG;sBACE,IAAI,CAAC,YAAY;mBACpB,IAAI,CAAC,SAAS;;;;;;;CAOhC,CAAC;AAEF,eAAe;IACb,KAAK,EAAE,6BAA6B;IACpC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM,EAAE,CAAC,EAAW,EAAE,EAAE;YAAV,IAAI,cAAT,EAAW,CAAF;QAChB,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IACD,QAAQ,EAAE;QACR,GAAG,EAAE;YACH,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,4DAA4D;YACzE,KAAK,EAAE;gBACL,QAAQ,EAAE,YAAY;gBACtB,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;aACjC;SACF;QACD,YAAY,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,uCAAuC,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;QAChK,SAAS,EAAE;YACT,OAAO,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;YACjC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;YAC1B,WAAW,EAAE,uBAAuB;YACpC,KAAK,EAAE;gBACL,QAAQ,EAAE,YAAY;gBACtB,YAAY,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;aACnC;SACF;QACD,SAAS,EAAE;YACT,MAAM,EAAE,WAAW;YACnB,WAAW,EAAE,yEAAyE;YACtF,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE;SAC9B;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE;QACJ,GAAG,EAAE,CAAC;QACN,YAAY,EAAE,IAAI;QAClB,SAAS,EAAE,OAAO;KACnB;CACF,CAAC","sourcesContent":["const renderCuraTabsGroup = (args: any) => `\n <cura-tabs-group\n gap=${args.gap}\n border-bottom=${args.borderBottom}\n color-mode=${args.colorMode}\n >\n <cura-tabs name=\"tab1\" icon-name=\"infoCircle\" border-bottom=\"false\" selected>Label</cura-tabs>\n <cura-tabs name=\"tab2\" icon-name=\"infoCircle\" border-bottom=\"false\">Label</cura-tabs>\n <cura-tabs name=\"tab3\" icon-name=\"infoCircle\" border-bottom=\"false\">Label</cura-tabs>\n <cura-tabs name=\"tab4\" icon-name=\"infoCircle\" border-bottom=\"false\" disabled>Label</cura-tabs>\n </cura-tabs-group>\n`;\n\nexport default {\n title: 'Componentes/Tabs/Tabs Group',\n tags: ['autodocs'],\n render: ({ ...args }) => {\n return renderCuraTabsGroup(args);\n },\n argTypes: {\n gap: {\n control: 'number',\n description: 'Define o espaçamento (gap) entre as abas. Valor em pixels.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '0px' },\n },\n },\n borderBottom: { control: 'boolean', description: 'Define se a borda inferior é exibida.', table: { category: 'Properties', defaultValue: { summary: 'true' } } },\n colorMode: {\n control: { type: 'inline-radio' },\n options: ['light', 'dark'],\n description: 'Define a cor de tema.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'light' },\n },\n },\n tabChange: {\n action: 'tabChange',\n description: 'Evento disparado ao clicar em uma aba. Retorna o \"name\" da aba clicada.',\n table: { category: 'Events' },\n },\n },\n};\n\nexport const CuraTabs = {\n args: {\n gap: 0,\n borderBottom: true,\n colorMode: 'light',\n },\n};\n"]}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global Spacing Definitions.
|
|
3
|
+
* Required CSS Properties from Cura:
|
|
4
|
+
* --cura-spacing-base
|
|
5
|
+
*/
|
|
6
|
+
/* None: 0px */
|
|
7
|
+
/* Tiny default: 4px */
|
|
8
|
+
/* Mini default: 8px */
|
|
9
|
+
/* XXXS default: 12px */
|
|
10
|
+
/* XXS default: 16px */
|
|
11
|
+
/* XS default: 20px */
|
|
12
|
+
/* S default: 20px */
|
|
13
|
+
/* M default: 32px */
|
|
14
|
+
/* L default: 40px */
|
|
15
|
+
/* XL default: 48px */
|
|
16
|
+
/* XXL default: 64px */
|
|
17
|
+
/* XXXL default: 72px */
|
|
18
|
+
/* Huge default: 96px */
|
|
19
|
+
/**
|
|
20
|
+
* Global Button Definitions.
|
|
21
|
+
* Required CSS Properties:
|
|
22
|
+
* --font-size
|
|
23
|
+
* --base-spacing
|
|
24
|
+
* --font-family
|
|
25
|
+
* --font-weight-medium
|
|
26
|
+
* --text-align
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Spacing sass vars
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Global Spacing Definitions.
|
|
33
|
+
* Required CSS Properties from Cura:
|
|
34
|
+
* --cura-spacing-base
|
|
35
|
+
*/
|
|
36
|
+
/* None: 0px */
|
|
37
|
+
/* Tiny default: 4px */
|
|
38
|
+
/* Mini default: 8px */
|
|
39
|
+
/* XXXS default: 12px */
|
|
40
|
+
/* XXS default: 16px */
|
|
41
|
+
/* XS default: 20px */
|
|
42
|
+
/* S default: 20px */
|
|
43
|
+
/* M default: 32px */
|
|
44
|
+
/* L default: 40px */
|
|
45
|
+
/* XL default: 48px */
|
|
46
|
+
/* XXL default: 64px */
|
|
47
|
+
/* XXXL default: 72px */
|
|
48
|
+
/* Huge default: 96px */
|
|
49
|
+
/**
|
|
50
|
+
* Buttons Host element definitions.
|
|
51
|
+
* Use: @include button-host() { ... }
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* Buttons base definitions.
|
|
55
|
+
* Use: @include button-element() { ... }
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* Button sizes definitions.
|
|
59
|
+
* Use: @include button-sizes() { ... }
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* Button container definitions.
|
|
63
|
+
* Use: @include button-container() { ... }
|
|
64
|
+
*/
|
|
65
|
+
/**
|
|
66
|
+
* Button label definitions.
|
|
67
|
+
* Use: @include button-label() { ... }
|
|
68
|
+
*/
|
|
69
|
+
/**
|
|
70
|
+
* Button shadow definitions.
|
|
71
|
+
* Use: @include button-label() { ... }
|
|
72
|
+
*/
|
|
73
|
+
/**
|
|
74
|
+
* Button disabled state definitions
|
|
75
|
+
* Use: @include button-disabled() { ... }
|
|
76
|
+
*/
|
|
77
|
+
/**
|
|
78
|
+
* Button selected state definitions
|
|
79
|
+
* Use: @include button-selected() { ... }
|
|
80
|
+
*/
|
|
81
|
+
/**
|
|
82
|
+
* Button loading state definitions
|
|
83
|
+
* Use: @include button-loading() { ... }
|
|
84
|
+
*/
|
|
85
|
+
/**
|
|
86
|
+
* Button icon definitions
|
|
87
|
+
* Use: @include button-icon() { ... }
|
|
88
|
+
*/
|
|
89
|
+
/**
|
|
90
|
+
* Button icon only behavior definitions
|
|
91
|
+
* Use: @include button-icon-only-behavior() { ... }
|
|
92
|
+
*/
|
|
93
|
+
:host button,
|
|
94
|
+
:host a {
|
|
95
|
+
outline: none;
|
|
96
|
+
box-shadow: none;
|
|
97
|
+
box-sizing: border-box;
|
|
98
|
+
display: flex;
|
|
99
|
+
width: 100%;
|
|
100
|
+
align-items: center;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
text-decoration: none !important;
|
|
103
|
+
font-size: var(--font-size);
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
transition: background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;
|
|
106
|
+
border-radius: var(--border-radius);
|
|
107
|
+
position: relative;
|
|
108
|
+
background-color: transparent;
|
|
109
|
+
box-sizing: border-box;
|
|
110
|
+
border: none;
|
|
111
|
+
min-width: 120px;
|
|
112
|
+
width: fit-content;
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
}
|
|
117
|
+
:host button:focus,
|
|
118
|
+
:host a:focus {
|
|
119
|
+
outline: 2px solid #6EA8FF;
|
|
120
|
+
}
|
|
121
|
+
:host button.border-bottom,
|
|
122
|
+
:host a.border-bottom {
|
|
123
|
+
border-bottom: 1px solid var(--border-bottom-color);
|
|
124
|
+
}
|
|
125
|
+
:host button.small,
|
|
126
|
+
:host a.small {
|
|
127
|
+
padding: calc(var(--cura-spacing-base) * 2px) calc(var(--cura-spacing-base) * 2px);
|
|
128
|
+
}
|
|
129
|
+
:host button.medium,
|
|
130
|
+
:host a.medium {
|
|
131
|
+
padding: calc(var(--cura-spacing-base) * 3px) calc(var(--cura-spacing-base) * 3px);
|
|
132
|
+
}
|
|
133
|
+
:host button.large,
|
|
134
|
+
:host a.large {
|
|
135
|
+
padding: calc(var(--cura-spacing-base) * 3px) calc(var(--cura-spacing-base) * 4px);
|
|
136
|
+
}
|
|
137
|
+
:host button:not(.selected),
|
|
138
|
+
:host a:not(.selected) {
|
|
139
|
+
border-color: var(--border-color);
|
|
140
|
+
}
|
|
141
|
+
:host button:focus,
|
|
142
|
+
:host a:focus {
|
|
143
|
+
border-color: var(--primary-light);
|
|
144
|
+
}
|
|
145
|
+
:host button:not(.disabled, .selected):hover,
|
|
146
|
+
:host a:not(.disabled, .selected):hover {
|
|
147
|
+
background-color: var(--background-color-hover);
|
|
148
|
+
}
|
|
149
|
+
:host button:not(.disabled, .selected):hover.dark,
|
|
150
|
+
:host a:not(.disabled, .selected):hover.dark {
|
|
151
|
+
border-color: var(--neutral-purewhite);
|
|
152
|
+
}
|
|
153
|
+
:host button cura-icon,
|
|
154
|
+
:host a cura-icon {
|
|
155
|
+
margin-right: calc(var(--cura-spacing-base) * 2px);
|
|
156
|
+
}
|
|
157
|
+
:host button.selected,
|
|
158
|
+
:host a.selected {
|
|
159
|
+
cursor: pointer;
|
|
160
|
+
}
|
|
161
|
+
:host button.selected:not(.disabled),
|
|
162
|
+
:host a.selected:not(.disabled) {
|
|
163
|
+
border-bottom: 1px solid var(--border-bottom-color-selected);
|
|
164
|
+
}
|
|
165
|
+
:host button.disabled,
|
|
166
|
+
:host a.disabled {
|
|
167
|
+
cursor: not-allowed;
|
|
168
|
+
}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { labelSizes } from "../cura-tabs.definitions";
|
|
3
|
+
export class CuraTabsTransparent {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.name = undefined;
|
|
6
|
+
this.iconName = undefined;
|
|
7
|
+
this.selected = false;
|
|
8
|
+
this.disabled = false;
|
|
9
|
+
this.borderBottom = true;
|
|
10
|
+
this.size = 'large';
|
|
11
|
+
this.colorMode = 'light';
|
|
12
|
+
this.hovered = false;
|
|
13
|
+
this.styles = {};
|
|
14
|
+
}
|
|
15
|
+
setColors() {
|
|
16
|
+
const colors = [
|
|
17
|
+
{
|
|
18
|
+
name: '--border-bottom-color',
|
|
19
|
+
theme: this.colorMode === 'light' ? 'neutral-base' : 'primary',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: '--border-bottom-color-selected',
|
|
23
|
+
theme: this.colorMode === 'light' ? 'primary-dark' : 'primary-lighter',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
colors.forEach(c => {
|
|
27
|
+
if (c.theme)
|
|
28
|
+
this.styles[c.name] = window.CuraAPI.theme.colors.getColor(c.theme);
|
|
29
|
+
});
|
|
30
|
+
this.styles = Object.assign({}, this.styles);
|
|
31
|
+
}
|
|
32
|
+
computeContentColor() {
|
|
33
|
+
if (this.disabled)
|
|
34
|
+
return 'neutral-dark';
|
|
35
|
+
if (this.colorMode === 'dark') {
|
|
36
|
+
if (this.hovered && !this.selected) {
|
|
37
|
+
return 'neutral-purewhite';
|
|
38
|
+
}
|
|
39
|
+
return this.selected ? 'primary-lighter' : 'neutral-purewhite';
|
|
40
|
+
}
|
|
41
|
+
if (this.hovered && !this.selected) {
|
|
42
|
+
return 'primary-dark';
|
|
43
|
+
}
|
|
44
|
+
return this.selected ? 'primary-base' : 'neutral-black';
|
|
45
|
+
}
|
|
46
|
+
getIcon() {
|
|
47
|
+
if (!this.iconName)
|
|
48
|
+
return '';
|
|
49
|
+
const iconSize = this.size === 'large' ? 20 : 16;
|
|
50
|
+
const iconColor = this.computeContentColor();
|
|
51
|
+
return h("cura-icon", { name: this.iconName, size: iconSize, color: iconColor });
|
|
52
|
+
}
|
|
53
|
+
getClasses() {
|
|
54
|
+
return {
|
|
55
|
+
[this.size]: true,
|
|
56
|
+
[this.colorMode]: true,
|
|
57
|
+
'selected': this.selected,
|
|
58
|
+
'disabled': this.disabled,
|
|
59
|
+
'border-bottom': this.borderBottom,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
connectedCallback() {
|
|
63
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--primary-dark': window.CuraAPI.theme.colors.getColor('primary-dark'), '--neutral-purewhite': window.CuraAPI.theme.colors.getColor('neutral-purewhite'), '--base-spacing': window.CuraAPI.theme.spacing.getSpacing() });
|
|
64
|
+
this.setColors();
|
|
65
|
+
}
|
|
66
|
+
handleMouseEnter() {
|
|
67
|
+
if (this.disabled)
|
|
68
|
+
return;
|
|
69
|
+
this.hovered = true;
|
|
70
|
+
}
|
|
71
|
+
handleMouseLeave() {
|
|
72
|
+
this.hovered = false;
|
|
73
|
+
}
|
|
74
|
+
handleClick(e) {
|
|
75
|
+
if (this.disabled) {
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
this.selected = !this.selected;
|
|
80
|
+
this.tabSelect.emit({ name: this.name });
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
const labelSize = labelSizes[this.size] || labelSizes['default'];
|
|
84
|
+
const labelColor = this.computeContentColor();
|
|
85
|
+
return (h(Host, { key: 'd3c9e277a079381def09397dc922d697aa99d70a', role: "button", "aria-pressed": this.selected, "aria-disabled": this.disabled }, h("button", { key: 'ab4cac9782f48c367c4ada4e303f9422971dc38e', class: this.getClasses(), style: this.styles, onClick: e => this.handleClick(e), disabled: this.disabled, onMouseEnter: this.handleMouseEnter.bind(this), onMouseLeave: this.handleMouseLeave.bind(this) }, this.getIcon(), h("cura-label", { key: 'c6567bdf7b80efc3380a8a93bf52de966e1caa7d', size: labelSize, color: labelColor, lineHeight: "0", marginBlock: "0" }, h("slot", { key: '93c392107790a2c0e3499e5b7bd742219203a980' })))));
|
|
86
|
+
}
|
|
87
|
+
static get is() { return "cura-tabs-transparent"; }
|
|
88
|
+
static get encapsulation() { return "shadow"; }
|
|
89
|
+
static get originalStyleUrls() {
|
|
90
|
+
return {
|
|
91
|
+
"$": ["cura-tabs-transparent.scss"]
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
static get styleUrls() {
|
|
95
|
+
return {
|
|
96
|
+
"$": ["cura-tabs-transparent.css"]
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
static get properties() {
|
|
100
|
+
return {
|
|
101
|
+
"name": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"mutable": false,
|
|
104
|
+
"complexType": {
|
|
105
|
+
"original": "string",
|
|
106
|
+
"resolved": "string",
|
|
107
|
+
"references": {}
|
|
108
|
+
},
|
|
109
|
+
"required": false,
|
|
110
|
+
"optional": false,
|
|
111
|
+
"docs": {
|
|
112
|
+
"tags": [],
|
|
113
|
+
"text": ""
|
|
114
|
+
},
|
|
115
|
+
"attribute": "name",
|
|
116
|
+
"reflect": true
|
|
117
|
+
},
|
|
118
|
+
"iconName": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"mutable": false,
|
|
121
|
+
"complexType": {
|
|
122
|
+
"original": "string",
|
|
123
|
+
"resolved": "string",
|
|
124
|
+
"references": {}
|
|
125
|
+
},
|
|
126
|
+
"required": false,
|
|
127
|
+
"optional": false,
|
|
128
|
+
"docs": {
|
|
129
|
+
"tags": [],
|
|
130
|
+
"text": ""
|
|
131
|
+
},
|
|
132
|
+
"attribute": "icon-name",
|
|
133
|
+
"reflect": true
|
|
134
|
+
},
|
|
135
|
+
"selected": {
|
|
136
|
+
"type": "boolean",
|
|
137
|
+
"mutable": true,
|
|
138
|
+
"complexType": {
|
|
139
|
+
"original": "boolean",
|
|
140
|
+
"resolved": "boolean",
|
|
141
|
+
"references": {}
|
|
142
|
+
},
|
|
143
|
+
"required": false,
|
|
144
|
+
"optional": false,
|
|
145
|
+
"docs": {
|
|
146
|
+
"tags": [],
|
|
147
|
+
"text": ""
|
|
148
|
+
},
|
|
149
|
+
"attribute": "selected",
|
|
150
|
+
"reflect": true,
|
|
151
|
+
"defaultValue": "false"
|
|
152
|
+
},
|
|
153
|
+
"disabled": {
|
|
154
|
+
"type": "boolean",
|
|
155
|
+
"mutable": true,
|
|
156
|
+
"complexType": {
|
|
157
|
+
"original": "boolean",
|
|
158
|
+
"resolved": "boolean",
|
|
159
|
+
"references": {}
|
|
160
|
+
},
|
|
161
|
+
"required": false,
|
|
162
|
+
"optional": false,
|
|
163
|
+
"docs": {
|
|
164
|
+
"tags": [],
|
|
165
|
+
"text": ""
|
|
166
|
+
},
|
|
167
|
+
"attribute": "disabled",
|
|
168
|
+
"reflect": true,
|
|
169
|
+
"defaultValue": "false"
|
|
170
|
+
},
|
|
171
|
+
"borderBottom": {
|
|
172
|
+
"type": "boolean",
|
|
173
|
+
"mutable": true,
|
|
174
|
+
"complexType": {
|
|
175
|
+
"original": "boolean",
|
|
176
|
+
"resolved": "boolean",
|
|
177
|
+
"references": {}
|
|
178
|
+
},
|
|
179
|
+
"required": false,
|
|
180
|
+
"optional": false,
|
|
181
|
+
"docs": {
|
|
182
|
+
"tags": [],
|
|
183
|
+
"text": ""
|
|
184
|
+
},
|
|
185
|
+
"attribute": "border-bottom",
|
|
186
|
+
"reflect": true,
|
|
187
|
+
"defaultValue": "true"
|
|
188
|
+
},
|
|
189
|
+
"size": {
|
|
190
|
+
"type": "string",
|
|
191
|
+
"mutable": false,
|
|
192
|
+
"complexType": {
|
|
193
|
+
"original": "'small' | 'medium' | 'large'",
|
|
194
|
+
"resolved": "\"large\" | \"medium\" | \"small\"",
|
|
195
|
+
"references": {}
|
|
196
|
+
},
|
|
197
|
+
"required": false,
|
|
198
|
+
"optional": false,
|
|
199
|
+
"docs": {
|
|
200
|
+
"tags": [],
|
|
201
|
+
"text": ""
|
|
202
|
+
},
|
|
203
|
+
"attribute": "size",
|
|
204
|
+
"reflect": true,
|
|
205
|
+
"defaultValue": "'large'"
|
|
206
|
+
},
|
|
207
|
+
"colorMode": {
|
|
208
|
+
"type": "string",
|
|
209
|
+
"mutable": true,
|
|
210
|
+
"complexType": {
|
|
211
|
+
"original": "'dark' | 'light'",
|
|
212
|
+
"resolved": "\"dark\" | \"light\"",
|
|
213
|
+
"references": {}
|
|
214
|
+
},
|
|
215
|
+
"required": false,
|
|
216
|
+
"optional": false,
|
|
217
|
+
"docs": {
|
|
218
|
+
"tags": [],
|
|
219
|
+
"text": ""
|
|
220
|
+
},
|
|
221
|
+
"attribute": "color-mode",
|
|
222
|
+
"reflect": true,
|
|
223
|
+
"defaultValue": "'light'"
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
static get states() {
|
|
228
|
+
return {
|
|
229
|
+
"hovered": {},
|
|
230
|
+
"styles": {}
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
static get events() {
|
|
234
|
+
return [{
|
|
235
|
+
"method": "tabSelect",
|
|
236
|
+
"name": "tabSelect",
|
|
237
|
+
"bubbles": true,
|
|
238
|
+
"cancelable": true,
|
|
239
|
+
"composed": true,
|
|
240
|
+
"docs": {
|
|
241
|
+
"tags": [],
|
|
242
|
+
"text": ""
|
|
243
|
+
},
|
|
244
|
+
"complexType": {
|
|
245
|
+
"original": "{ name: string }",
|
|
246
|
+
"resolved": "{ name: string; }",
|
|
247
|
+
"references": {}
|
|
248
|
+
}
|
|
249
|
+
}];
|
|
250
|
+
}
|
|
251
|
+
static get watchers() {
|
|
252
|
+
return [{
|
|
253
|
+
"propName": "colorMode",
|
|
254
|
+
"methodName": "setColors"
|
|
255
|
+
}];
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=cura-tabs-transparent.js.map
|