@sula-tech/webcomponents 0.8.0 → 0.9.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-Bbryl0vg.js → index-LR6yFDX7.js} +16 -2
- package/dist/cjs/index-LR6yFDX7.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{sula-avatar_18.cjs.entry.js → sula-avatar_19.cjs.entry.js} +368 -45
- package/dist/cjs/sula-avatar_19.cjs.entry.js.map +1 -0
- package/dist/cjs/webcomponents.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/sula-button/sula-button.css +1 -1
- package/dist/collection/components/sula-chip/sula-chip.css +1 -1
- package/dist/collection/components/sula-dropdown/sula-dropdown.css +1 -1
- package/dist/collection/components/sula-dropdown/sula-dropdown.js +74 -9
- package/dist/collection/components/sula-dropdown/sula-dropdown.js.map +1 -1
- package/dist/collection/components/sula-dropdown/sula-dropdown.stories.js +53 -0
- package/dist/collection/components/sula-dropdown/sula-dropdown.stories.js.map +1 -1
- package/dist/collection/components/sula-icon/sula-icon.css +1 -1
- package/dist/collection/components/sula-icon/sula-icon.js +1 -1
- package/dist/collection/components/sula-loader/sula-loader.css +1 -1
- package/dist/collection/components/sula-loader/sula-loader.js +1 -1
- package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.css +1 -1
- package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.js +33 -2
- package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.js.map +1 -1
- package/dist/collection/components/sula-modal/model/sula-modal.model.js +16 -0
- package/dist/collection/components/sula-modal/model/sula-modal.model.js.map +1 -0
- package/dist/collection/components/sula-modal/sula-modal.css +1 -0
- package/dist/collection/components/sula-modal/sula-modal.js +558 -0
- package/dist/collection/components/sula-modal/sula-modal.js.map +1 -0
- package/dist/collection/components/sula-modal/sula-modal.stories.js +193 -0
- package/dist/collection/components/sula-modal/sula-modal.stories.js.map +1 -0
- package/dist/collection/components/sula-progress-bar/sula-progress-bar.js +2 -2
- package/dist/collection/components/sula-radio-button/sula-radio-button.js +2 -2
- package/dist/collection/components/sula-search-bar/sula-search-bar.js +2 -2
- package/dist/collection/components/sula-switch/sula-switch.js +4 -4
- package/dist/collection/components/sula-tag/sula-tag.js +3 -3
- package/dist/collection/components/sula-textarea/sula-textarea.js +6 -6
- package/dist/collection/components/sula-textfield/sula-textfield.js +2 -2
- package/dist/collection/components/sula-tiles/sula-tiles.js +1 -1
- package/dist/collection/components/sula-timeline-list/sula-timeline-list.js +1 -1
- package/dist/components/index.js +19 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-BhxK9El6.js +231 -0
- package/dist/components/p-BhxK9El6.js.map +1 -0
- package/dist/components/{p-DrUsgtsv.js → p-CyIObO0v.js} +4 -4
- package/dist/components/{p-DrUsgtsv.js.map → p-CyIObO0v.js.map} +1 -1
- package/dist/components/{p-BNtk_d_S.js → p-DvWN7hVP.js} +14 -6
- package/dist/components/p-DvWN7hVP.js.map +1 -0
- package/dist/components/{p-BrY8WoEl.js → p-ff6chV3i.js} +4 -4
- package/dist/components/{p-BrY8WoEl.js.map → p-ff6chV3i.js.map} +1 -1
- package/dist/components/sula-avatar.js +1 -1
- package/dist/components/sula-badge.js +1 -1
- package/dist/components/sula-button.js +1 -226
- package/dist/components/sula-button.js.map +1 -1
- package/dist/components/sula-checkbox.js +1 -1
- package/dist/components/sula-chip.js +3 -3
- package/dist/components/sula-chip.js.map +1 -1
- package/dist/components/sula-dropdown.js +60 -14
- package/dist/components/sula-dropdown.js.map +1 -1
- package/dist/components/sula-icon.js +1 -1
- package/dist/components/sula-loader.js +1 -1
- package/dist/components/sula-menu-select-list.js +1 -1
- package/dist/components/sula-modal.d.ts +11 -0
- package/dist/components/sula-modal.js +332 -0
- package/dist/components/sula-modal.js.map +1 -0
- package/dist/components/sula-progress-bar.js +3 -3
- package/dist/components/sula-radio-button.js +2 -2
- package/dist/components/sula-search-bar.js +3 -3
- package/dist/components/sula-switch.js +4 -4
- package/dist/components/sula-tag.js +4 -4
- package/dist/components/sula-textarea.js +6 -6
- package/dist/components/sula-textfield.js +3 -3
- package/dist/components/sula-tiles.js +2 -2
- package/dist/components/sula-timeline-list.js +2 -2
- package/dist/esm/{index-or7qTZgT.js → index-CrFclBiX.js} +16 -2
- package/dist/esm/index-CrFclBiX.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{sula-avatar_18.entry.js → sula-avatar_19.entry.js} +368 -46
- package/dist/esm/sula-avatar_19.entry.js.map +1 -0
- package/dist/esm/webcomponents.js +3 -3
- package/dist/types/components/sula-dropdown/sula-dropdown.d.ts +11 -0
- package/dist/types/components/sula-dropdown/sula-dropdown.stories.d.ts +10 -0
- package/dist/types/components/sula-menu-select-list/sula-menu-select-list.d.ts +4 -0
- package/dist/types/components/sula-modal/model/sula-modal.model.d.ts +13 -0
- package/dist/types/components/sula-modal/sula-modal.d.ts +94 -0
- package/dist/types/components/sula-modal/sula-modal.stories.d.ts +83 -0
- package/dist/types/components.d.ts +170 -0
- package/dist/webcomponents/{p-or7qTZgT.js → p-CrFclBiX.js} +28 -16
- package/dist/webcomponents/p-CrFclBiX.js.map +1 -0
- package/dist/webcomponents/{p-bc1f174c.entry.js → p-e4fa59d5.entry.js} +658 -285
- package/dist/webcomponents/p-e4fa59d5.entry.js.map +1 -0
- package/dist/webcomponents/webcomponents.esm.js +41 -20
- package/package.json +2 -3
- package/dist/cjs/index-Bbryl0vg.js.map +0 -1
- package/dist/cjs/sula-avatar_18.cjs.entry.js.map +0 -1
- package/dist/components/p-BNtk_d_S.js.map +0 -1
- package/dist/esm/index-or7qTZgT.js.map +0 -1
- package/dist/esm/sula-avatar_18.entry.js.map +0 -1
- package/dist/webcomponents/p-bc1f174c.entry.js.map +0 -1
- package/dist/webcomponents/p-or7qTZgT.js.map +0 -1
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { SulaModalType, SulaModalSlotOverflow } from "./model/sula-modal.model";
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Components/sula-modal',
|
|
4
|
+
tags: ['autodocs'],
|
|
5
|
+
argTypes: {
|
|
6
|
+
opened: {
|
|
7
|
+
control: 'boolean',
|
|
8
|
+
description: 'Controla se a modal está aberta',
|
|
9
|
+
},
|
|
10
|
+
type: {
|
|
11
|
+
control: { type: 'select' },
|
|
12
|
+
options: Object.values(SulaModalType),
|
|
13
|
+
},
|
|
14
|
+
modalTitle: {
|
|
15
|
+
control: 'text',
|
|
16
|
+
description: 'Título da modal',
|
|
17
|
+
},
|
|
18
|
+
subTitle: {
|
|
19
|
+
control: 'text',
|
|
20
|
+
description: 'Subtítulo da modal',
|
|
21
|
+
},
|
|
22
|
+
headerIcon: {
|
|
23
|
+
control: 'text',
|
|
24
|
+
description: 'Ícone do header',
|
|
25
|
+
},
|
|
26
|
+
promoImage: {
|
|
27
|
+
control: 'text',
|
|
28
|
+
description: 'URL da imagem promocional (para modal promo)',
|
|
29
|
+
},
|
|
30
|
+
primaryButtonText: {
|
|
31
|
+
control: 'text',
|
|
32
|
+
description: 'Texto do botão primário',
|
|
33
|
+
},
|
|
34
|
+
secondaryButtonText: {
|
|
35
|
+
control: 'text',
|
|
36
|
+
description: 'Texto do botão secundário',
|
|
37
|
+
},
|
|
38
|
+
slotOverflow: {
|
|
39
|
+
control: { type: 'select' },
|
|
40
|
+
options: Object.values(SulaModalSlotOverflow),
|
|
41
|
+
},
|
|
42
|
+
blockBodyScroll: {
|
|
43
|
+
control: 'boolean',
|
|
44
|
+
description: 'Bloqueia o scroll do body',
|
|
45
|
+
},
|
|
46
|
+
closeOnClickOutside: {
|
|
47
|
+
control: 'boolean',
|
|
48
|
+
description: 'Fecha ao clicar fora',
|
|
49
|
+
},
|
|
50
|
+
modalClosed: {
|
|
51
|
+
action: 'modalClosed',
|
|
52
|
+
description: 'Evento emitido ao fechar a modal',
|
|
53
|
+
},
|
|
54
|
+
primaryButtonClicked: {
|
|
55
|
+
action: 'primaryButtonClicked',
|
|
56
|
+
description: 'Evento emitido ao clicar no botão primário',
|
|
57
|
+
},
|
|
58
|
+
secondaryButtonClicked: {
|
|
59
|
+
action: 'secondaryButtonClicked',
|
|
60
|
+
description: 'Evento emitido ao clicar no botão secundário',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
parameters: {
|
|
64
|
+
docs: {
|
|
65
|
+
description: {
|
|
66
|
+
component: `
|
|
67
|
+
O componente **Sula Modal** é utilizado para exibir conteúdos em destaque sobrepostos à interface principal.
|
|
68
|
+
### Características principais:
|
|
69
|
+
- Suporte a diferentes tipos de modal (alerta, custom, promo, side, etc)
|
|
70
|
+
- Título, subtítulo, ícone e imagem promocional
|
|
71
|
+
- Botões primário e secundário
|
|
72
|
+
- Controle de overflow e scroll
|
|
73
|
+
- Eventos de fechamento e clique nos botões
|
|
74
|
+
`,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
const Template = args => {
|
|
80
|
+
const container = document.createElement('div');
|
|
81
|
+
container.style.margin = '20px';
|
|
82
|
+
container.style.display = 'flex';
|
|
83
|
+
container.style.alignItems = 'center';
|
|
84
|
+
container.style.justifyContent = 'center';
|
|
85
|
+
container.style.minHeight = '80vh';
|
|
86
|
+
const el = document.createElement('sula-modal');
|
|
87
|
+
el.setAttribute('opened', args.opened ? 'true' : 'false');
|
|
88
|
+
el.setAttribute('type', args.type);
|
|
89
|
+
if (args.modalTitle)
|
|
90
|
+
el.setAttribute('modal-title', args.modalTitle);
|
|
91
|
+
if (args.subTitle)
|
|
92
|
+
el.setAttribute('sub-title', args.subTitle);
|
|
93
|
+
if (args.headerIcon)
|
|
94
|
+
el.setAttribute('header-icon', args.headerIcon);
|
|
95
|
+
if (args.promoImage)
|
|
96
|
+
el.setAttribute('promo-image', args.promoImage);
|
|
97
|
+
if (args.primaryButtonText)
|
|
98
|
+
el.setAttribute('primary-button-text', args.primaryButtonText);
|
|
99
|
+
if (args.secondaryButtonText)
|
|
100
|
+
el.setAttribute('secondary-button-text', args.secondaryButtonText);
|
|
101
|
+
el.setAttribute('slot-overflow', args.slotOverflow);
|
|
102
|
+
el.setAttribute('block-body-scroll', args.blockBodyScroll ? 'true' : 'false');
|
|
103
|
+
el.setAttribute('close-on-click-outside', args.closeOnClickOutside ? 'true' : 'false');
|
|
104
|
+
el.addEventListener('modalClosed', args.modalClosed);
|
|
105
|
+
el.addEventListener('primaryButtonClicked', args.primaryButtonClicked);
|
|
106
|
+
el.addEventListener('secondaryButtonClicked', args.secondaryButtonClicked);
|
|
107
|
+
// Conteúdo customizável para slot
|
|
108
|
+
if (args.slotContent) {
|
|
109
|
+
const slotDiv = document.createElement('div');
|
|
110
|
+
slotDiv.innerHTML = args.slotContent;
|
|
111
|
+
el.appendChild(slotDiv);
|
|
112
|
+
}
|
|
113
|
+
container.appendChild(el);
|
|
114
|
+
return container;
|
|
115
|
+
};
|
|
116
|
+
export const Playground = Template.bind({});
|
|
117
|
+
Playground.args = {
|
|
118
|
+
opened: true,
|
|
119
|
+
type: SulaModalType.Custom,
|
|
120
|
+
modalTitle: 'Título da Modal',
|
|
121
|
+
subTitle: 'Subtítulo explicativo',
|
|
122
|
+
headerIcon: 'ph ph-info',
|
|
123
|
+
primaryButtonText: 'Confirmar',
|
|
124
|
+
secondaryButtonText: 'Cancelar',
|
|
125
|
+
slotOverflow: SulaModalSlotOverflow.Auto,
|
|
126
|
+
blockBodyScroll: true,
|
|
127
|
+
closeOnClickOutside: true,
|
|
128
|
+
slotContent: '<p>Conteúdo customizável da modal.</p>',
|
|
129
|
+
};
|
|
130
|
+
export const AlertType = Template.bind({});
|
|
131
|
+
AlertType.args = Object.assign(Object.assign({}, Playground.args), { type: SulaModalType.Alert, modalTitle: 'Atenção', subTitle: 'Esta é uma modal de alerta.', headerIcon: 'ph ph-warning', primaryButtonText: 'OK', secondaryButtonText: '', slotContent: '' });
|
|
132
|
+
AlertType.parameters = {
|
|
133
|
+
docs: {
|
|
134
|
+
description: {
|
|
135
|
+
story: 'Modal do tipo alerta, com ícone e botão primário.',
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
export const PromoType = Template.bind({});
|
|
140
|
+
PromoType.args = Object.assign(Object.assign({}, Playground.args), { type: SulaModalType.Promo, promoImage: 'https://picsum.photos/600/800', modalTitle: 'Promoção Especial', subTitle: 'Aproveite esta oferta!', slotContent: '<p>Conteúdo promocional.</p>' });
|
|
141
|
+
PromoType.parameters = {
|
|
142
|
+
docs: {
|
|
143
|
+
description: {
|
|
144
|
+
story: 'Modal promocional com imagem e conteúdo customizável.',
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
export const SideType = Template.bind({});
|
|
149
|
+
SideType.args = Object.assign(Object.assign({}, Playground.args), { type: SulaModalType.Side, modalTitle: 'Menu Lateral', subTitle: '', slotContent: '<ul><li>Item 1</li><li>Item 2</li></ul>' });
|
|
150
|
+
SideType.parameters = {
|
|
151
|
+
docs: {
|
|
152
|
+
description: {
|
|
153
|
+
story: 'Modal lateral (side modal) para navegação ou menus.',
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
export const ListType = Template.bind({});
|
|
158
|
+
ListType.args = Object.assign(Object.assign({}, Playground.args), { type: SulaModalType.List, modalTitle: 'Lista de Itens', subTitle: 'Modal para exibir listas.', slotContent: '<ol><li>Primeiro item</li><li>Segundo item</li><li>Terceiro item</li></ol>' });
|
|
159
|
+
ListType.parameters = {
|
|
160
|
+
docs: {
|
|
161
|
+
description: {
|
|
162
|
+
story: 'Modal do tipo lista, ideal para exibir listas de itens.',
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
export const CustomFullType = Template.bind({});
|
|
167
|
+
CustomFullType.args = Object.assign(Object.assign({}, Playground.args), { type: SulaModalType.CustomFull, modalTitle: 'Modal Custom Full', subTitle: 'Modal customizada em tela cheia.', slotContent: '<div style="height:300px;display:flex;align-items:center;justify-content:center"><h2>Conteúdo Full</h2></div>' });
|
|
168
|
+
CustomFullType.parameters = {
|
|
169
|
+
docs: {
|
|
170
|
+
description: {
|
|
171
|
+
story: 'Modal customizada ocupando toda a tela.',
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
export const SpecialSideType = Template.bind({});
|
|
176
|
+
SpecialSideType.args = Object.assign(Object.assign({}, Playground.args), { type: SulaModalType.SpecialSide, modalTitle: 'Modal Lateral Especial', subTitle: 'Modal lateral com layout especial.', promoImage: 'https://picsum.photos/1920/1080', slotContent: '<div style="padding:24px"><h3>Conteúdo Especial</h3><p>Layout diferenciado para casos especiais.</p></div>' });
|
|
177
|
+
SpecialSideType.parameters = {
|
|
178
|
+
docs: {
|
|
179
|
+
description: {
|
|
180
|
+
story: 'Modal lateral especial para layouts diferenciados.',
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
export const WithCustomSlot = Template.bind({});
|
|
185
|
+
WithCustomSlot.args = Object.assign(Object.assign({}, Playground.args), { type: SulaModalType.Custom, slotContent: '<div style="padding:16px"><h3>Slot Customizado</h3><p>Qualquer conteúdo pode ser inserido aqui.</p></div>' });
|
|
186
|
+
WithCustomSlot.parameters = {
|
|
187
|
+
docs: {
|
|
188
|
+
description: {
|
|
189
|
+
story: 'Exemplo de modal custom com conteúdo via slot.',
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
//# sourceMappingURL=sula-modal.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sula-modal.stories.js","sourceRoot":"","sources":["../../../src/components/sula-modal/sula-modal.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEhF,eAAe;IACb,KAAK,EAAE,uBAAuB;IAC9B,IAAI,EAAE,CAAC,UAAU,CAAC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GAAG;IAC3B,IAAI,EAAE;QACJ,WAAW,EAAE;YACX,KAAK,EAAE,oDAAoD;SAC5D;KACF;CACF,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChD,cAAc,CAAC,IAAI,mCACd,UAAU,CAAC,IAAI,KAClB,IAAI,EAAE,aAAa,CAAC,MAAM,EAC1B,WAAW,EAAE,2GAA2G,GACzH,CAAC;AACF,cAAc,CAAC,UAAU,GAAG;IAC1B,IAAI,EAAE;QACJ,WAAW,EAAE;YACX,KAAK,EAAE,gDAAgD;SACxD;KACF;CACF,CAAC","sourcesContent":["import { SulaModalType, SulaModalSlotOverflow } from './model/sula-modal.model';\n\nexport default {\n title: 'Components/sula-modal',\n tags: ['autodocs'],\n argTypes: {\n opened: {\n control: 'boolean',\n description: 'Controla se a modal está aberta',\n },\n type: {\n control: { type: 'select' },\n options: Object.values(SulaModalType),\n },\n modalTitle: {\n control: 'text',\n description: 'Título da modal',\n },\n subTitle: {\n control: 'text',\n description: 'Subtítulo da modal',\n },\n headerIcon: {\n control: 'text',\n description: 'Ícone do header',\n },\n promoImage: {\n control: 'text',\n description: 'URL da imagem promocional (para modal promo)',\n },\n primaryButtonText: {\n control: 'text',\n description: 'Texto do botão primário',\n },\n secondaryButtonText: {\n control: 'text',\n description: 'Texto do botão secundário',\n },\n slotOverflow: {\n control: { type: 'select' },\n options: Object.values(SulaModalSlotOverflow),\n },\n blockBodyScroll: {\n control: 'boolean',\n description: 'Bloqueia o scroll do body',\n },\n closeOnClickOutside: {\n control: 'boolean',\n description: 'Fecha ao clicar fora',\n },\n modalClosed: {\n action: 'modalClosed',\n description: 'Evento emitido ao fechar a modal',\n },\n primaryButtonClicked: {\n action: 'primaryButtonClicked',\n description: 'Evento emitido ao clicar no botão primário',\n },\n secondaryButtonClicked: {\n action: 'secondaryButtonClicked',\n description: 'Evento emitido ao clicar no botão secundário',\n },\n },\n parameters: {\n docs: {\n description: {\n component: `\nO componente **Sula Modal** é utilizado para exibir conteúdos em destaque sobrepostos à interface principal.\n### Características principais:\n - Suporte a diferentes tipos de modal (alerta, custom, promo, side, etc)\n - Título, subtítulo, ícone e imagem promocional\n - Botões primário e secundário\n - Controle de overflow e scroll\n - Eventos de fechamento e clique nos botões\n\t\t\t\t`,\n },\n },\n },\n};\n\nconst Template = args => {\n const container = document.createElement('div');\n container.style.margin = '20px';\n container.style.display = 'flex';\n container.style.alignItems = 'center';\n container.style.justifyContent = 'center';\n container.style.minHeight = '80vh';\n const el = document.createElement('sula-modal');\n\n el.setAttribute('opened', args.opened ? 'true' : 'false');\n el.setAttribute('type', args.type);\n if (args.modalTitle) el.setAttribute('modal-title', args.modalTitle);\n if (args.subTitle) el.setAttribute('sub-title', args.subTitle);\n if (args.headerIcon) el.setAttribute('header-icon', args.headerIcon);\n if (args.promoImage) el.setAttribute('promo-image', args.promoImage);\n if (args.primaryButtonText) el.setAttribute('primary-button-text', args.primaryButtonText);\n if (args.secondaryButtonText) el.setAttribute('secondary-button-text', args.secondaryButtonText);\n el.setAttribute('slot-overflow', args.slotOverflow);\n el.setAttribute('block-body-scroll', args.blockBodyScroll ? 'true' : 'false');\n el.setAttribute('close-on-click-outside', args.closeOnClickOutside ? 'true' : 'false');\n\n el.addEventListener('modalClosed', args.modalClosed);\n el.addEventListener('primaryButtonClicked', args.primaryButtonClicked);\n el.addEventListener('secondaryButtonClicked', args.secondaryButtonClicked);\n\n // Conteúdo customizável para slot\n if (args.slotContent) {\n const slotDiv = document.createElement('div');\n slotDiv.innerHTML = args.slotContent;\n el.appendChild(slotDiv);\n }\n\n container.appendChild(el);\n return container;\n};\n\nexport const Playground = Template.bind({});\nPlayground.args = {\n opened: true,\n type: SulaModalType.Custom,\n modalTitle: 'Título da Modal',\n subTitle: 'Subtítulo explicativo',\n headerIcon: 'ph ph-info',\n primaryButtonText: 'Confirmar',\n secondaryButtonText: 'Cancelar',\n slotOverflow: SulaModalSlotOverflow.Auto,\n blockBodyScroll: true,\n closeOnClickOutside: true,\n slotContent: '<p>Conteúdo customizável da modal.</p>',\n};\nexport const AlertType = Template.bind({});\nAlertType.args = {\n ...Playground.args,\n type: SulaModalType.Alert,\n modalTitle: 'Atenção',\n subTitle: 'Esta é uma modal de alerta.',\n headerIcon: 'ph ph-warning',\n primaryButtonText: 'OK',\n secondaryButtonText: '',\n slotContent: '',\n};\nAlertType.parameters = {\n docs: {\n description: {\n story: 'Modal do tipo alerta, com ícone e botão primário.',\n },\n },\n};\nexport const PromoType = Template.bind({});\nPromoType.args = {\n ...Playground.args,\n type: SulaModalType.Promo,\n promoImage: 'https://picsum.photos/600/800',\n modalTitle: 'Promoção Especial',\n subTitle: 'Aproveite esta oferta!',\n slotContent: '<p>Conteúdo promocional.</p>',\n};\nPromoType.parameters = {\n docs: {\n description: {\n story: 'Modal promocional com imagem e conteúdo customizável.',\n },\n },\n};\nexport const SideType = Template.bind({});\nSideType.args = {\n ...Playground.args,\n type: SulaModalType.Side,\n modalTitle: 'Menu Lateral',\n subTitle: '',\n slotContent: '<ul><li>Item 1</li><li>Item 2</li></ul>',\n};\nSideType.parameters = {\n docs: {\n description: {\n story: 'Modal lateral (side modal) para navegação ou menus.',\n },\n },\n};\n\nexport const ListType = Template.bind({});\nListType.args = {\n ...Playground.args,\n type: SulaModalType.List,\n modalTitle: 'Lista de Itens',\n subTitle: 'Modal para exibir listas.',\n slotContent: '<ol><li>Primeiro item</li><li>Segundo item</li><li>Terceiro item</li></ol>',\n};\nListType.parameters = {\n docs: {\n description: {\n story: 'Modal do tipo lista, ideal para exibir listas de itens.',\n },\n },\n};\n\nexport const CustomFullType = Template.bind({});\nCustomFullType.args = {\n ...Playground.args,\n type: SulaModalType.CustomFull,\n modalTitle: 'Modal Custom Full',\n subTitle: 'Modal customizada em tela cheia.',\n slotContent: '<div style=\"height:300px;display:flex;align-items:center;justify-content:center\"><h2>Conteúdo Full</h2></div>',\n};\nCustomFullType.parameters = {\n docs: {\n description: {\n story: 'Modal customizada ocupando toda a tela.',\n },\n },\n};\n\nexport const SpecialSideType = Template.bind({});\nSpecialSideType.args = {\n ...Playground.args,\n type: SulaModalType.SpecialSide,\n modalTitle: 'Modal Lateral Especial',\n subTitle: 'Modal lateral com layout especial.',\n promoImage: 'https://picsum.photos/1920/1080',\n slotContent: '<div style=\"padding:24px\"><h3>Conteúdo Especial</h3><p>Layout diferenciado para casos especiais.</p></div>',\n};\nSpecialSideType.parameters = {\n docs: {\n description: {\n story: 'Modal lateral especial para layouts diferenciados.',\n },\n },\n};\nexport const WithCustomSlot = Template.bind({});\nWithCustomSlot.args = {\n ...Playground.args,\n type: SulaModalType.Custom,\n slotContent: '<div style=\"padding:16px\"><h3>Slot Customizado</h3><p>Qualquer conteúdo pode ser inserido aqui.</p></div>',\n};\nWithCustomSlot.parameters = {\n docs: {\n description: {\n story: 'Exemplo de modal custom com conteúdo via slot.',\n },\n },\n};\n"]}
|
|
@@ -53,10 +53,10 @@ export class SulaProgressBar {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
render() {
|
|
56
|
-
return (h(Host, { key: '
|
|
56
|
+
return (h(Host, { key: '5f7922714d99330253ee04dbfe197b8cffb60e33' }, h("div", { key: '5246d62bfcb514b5976d698bb07699e9df7ae864', class: "flex flex-col w-full space-y-8" }, h("div", { key: '5f46e226f9c515d0640bafb42bb882580254e747', class: "flex justify-between items-center" }, h("label", { key: 'f61b7f5a837961a03ea1e4e72d803831c40189c5', class: "text-sm text-text-secondary leading-[14px]" }, this.topLabel), this.getProgressBarStateElement()), h("div", { key: 'b8631511218ace18082299186507c924d34da696', style: { width: `${this.progress}%` }, class: {
|
|
57
57
|
'h-12 rounded-xxl': true,
|
|
58
58
|
[this.getProgressBarStyle()]: true,
|
|
59
|
-
} }), h("label", { key: '
|
|
59
|
+
} }), h("label", { key: '1d73f69f9868c2ae1be227d00c17b348021e1bb7', class: "text-sm text-text-secondary leading-[14px]" }, this.bottomLabel))));
|
|
60
60
|
}
|
|
61
61
|
static get is() { return "sula-progress-bar"; }
|
|
62
62
|
static get encapsulation() { return "shadow"; }
|
|
@@ -34,14 +34,14 @@ export class SulaRadioButton {
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
render() {
|
|
37
|
-
return (h(Host, { key: '
|
|
37
|
+
return (h(Host, { key: 'ec9162a63e7ef550bad0fac4f50201c545e36b7a' }, h("div", { key: '2acbb141714c47d79ef1517b25125d57d7773a43', class: { 'w-fit': true, 'flex items-center': !!this.label }, onClick: this.handleClick }, h("div", { key: 'fe8c9b23d3e43981e36d199e951128c07bfdef98', class: {
|
|
38
38
|
'min-w-[30px] min-h-[30px] rounded-full flex justify-center items-center outline-none': true,
|
|
39
39
|
'active:bg-states-empty-bg-pressed cursor-pointer': !this.disabled,
|
|
40
40
|
'bg-brand-primary': this.checked,
|
|
41
41
|
'border border-line-input': !this.checked,
|
|
42
42
|
'container-focus': this.radioIsFocus,
|
|
43
43
|
'bg-states-bg-disabled border-2 border-states-bg-disabled cursor-not-allowed': this.disabled,
|
|
44
|
-
}, tabIndex: 0, onFocus: this.handleFocus, onBlur: this.handleFocusOut }, this.checked && h("div", { key: '
|
|
44
|
+
}, tabIndex: 0, onFocus: this.handleFocus, onBlur: this.handleFocusOut }, this.checked && h("div", { key: 'e82a794f53e8771171008696a19c176594e36c29', class: "bg-transparent border-2 border-negative-negative-1 w-[18px] h-[18px] rounded-full" })), this.label && h("label", { key: '77844f1c95772931153a75298dc871f787e60dde', class: { 'ml-16 text-base text-text-primary': true, 'cursor-pointer': !this.disabled } }, this.label))));
|
|
45
45
|
}
|
|
46
46
|
static get is() { return "sula-radio-button"; }
|
|
47
47
|
static get encapsulation() { return "shadow"; }
|
|
@@ -43,11 +43,11 @@ export class SulaSearchBar {
|
|
|
43
43
|
return style[this.searchBarStyle];
|
|
44
44
|
}
|
|
45
45
|
render() {
|
|
46
|
-
return (h(Host, { key: '
|
|
46
|
+
return (h(Host, { key: '7ac3cb2028df077a2489a7343c7618f04976e211' }, h("div", { key: '720808c66eb0b5eeaaf38384e9c954ce2a2f42ff', class: {
|
|
47
47
|
'flex flex-row items-center space-x-12 px-16 rounded-xxl h-44 caret-brand-primary outline-none group': true,
|
|
48
48
|
[this.getStyleClass()]: true,
|
|
49
49
|
'search-bar-focus': this.isFocused,
|
|
50
|
-
}, tabIndex: 0, onFocus: this.handleInputFocus, onClick: this.handleInputFocus }, !this.isFocused && this.leftIcon && (h("div", { key: '
|
|
50
|
+
}, tabIndex: 0, onFocus: this.handleInputFocus, onClick: this.handleInputFocus }, !this.isFocused && this.leftIcon && (h("div", { key: '0d5668fc5b271feb3c7b5aea735652c2f2abdeb1', class: "flex justify-center items-center leading-6" }, h("sula-icon", { key: '0f61816afeef7db9f9c36fed903c87ea9d71edc5', icon: this.leftIcon, customClass: "text-2xl text-icon-primary group-hover:text-brand-primary" }))), h("input", { key: '27f2199404e9c197fb8d31cc8a8ab53c32f38c2e', ref: node => (this.inputElement = node), type: "text", class: "outline-none border-none w-full bg-transparent text-text-primary", placeholder: this.placeholder, onBlur: this.handleInputBlur, value: this.value, onInput: this.handleValueChanges }), this.rightIcon && (h("div", { key: 'c47335437563eb82df68215411f6add6f91c41a7', class: "flex justify-center items-center leading-6 cursor-pointer", onClick: this.handleRightIconClick, onMouseDown: e => e.preventDefault() }, h("sula-icon", { key: '83759286dee48cea835b9a16a970d4bc16c33f83', icon: this.rightIcon, customClass: "text-2xl text-icon-primary" }))))));
|
|
51
51
|
}
|
|
52
52
|
static get is() { return "sula-search-bar"; }
|
|
53
53
|
static get encapsulation() { return "shadow"; }
|
|
@@ -35,23 +35,23 @@ export class SulaSwitch {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
render() {
|
|
38
|
-
return (h(Host, { key: '
|
|
38
|
+
return (h(Host, { key: 'bbc4902ea0d731995e0c8600243018a171b65120' }, h("div", { key: 'b7e277261642fb9c909a8549dfe7a6295cb4dc01', class: {
|
|
39
39
|
'outline-none': true,
|
|
40
40
|
'flex items-center space-x-12': !!this.label && this.type === SulaSwitchType.Default,
|
|
41
41
|
'flex items-center justify-between bg-surface-on-body rounded-md w-[280px] min-h-[85px] px-24 py-16': this.type === SulaSwitchType.List,
|
|
42
42
|
'hover:bg-states-empty-bg-hover active:bg-states-empty-bg-pressed cursor-pointer': this.type === SulaSwitchType.List && !this.disabled,
|
|
43
43
|
'container-focus': this.isFocus && this.type === SulaSwitchType.List,
|
|
44
|
-
}, onFocus: this.handleFocus, onBlur: this.handleBlur, onClick: this.handleClick, tabIndex: 0 }, this.type === SulaSwitchType.List && (h("div", { key: '
|
|
44
|
+
}, onFocus: this.handleFocus, onBlur: this.handleBlur, onClick: this.handleClick, tabIndex: 0 }, this.type === SulaSwitchType.List && (h("div", { key: 'd15acc295e424576ab121dd5419465539ecfe440', class: "flex flex-col flex-1 mr-16 overflow-hidden" }, !!this.label && h("label", { key: '01e72df5708151314ff0155bcf7d9a7fafbd55e2', class: "text-text-primary font-bold text-base cursor-pointer break-words" }, this.label), !!this.subTitle && h("span", { key: 'c6871b59d4fe3094196bff0c78463910a2c900bd', class: "text-text-secondary text-base break-words" }, this.subTitle))), h("div", { key: 'ec2df308d747f232d71dc9d3dbd6fc99c25f85d8', class: {
|
|
45
45
|
'switch-container w-56 h-32 flex items-center rounded-xxl p-2 outline-none': true,
|
|
46
46
|
'switch-on bg-brand-primary justify-end': this.active,
|
|
47
47
|
'switch-off bg-neutral-neutral-3 justify-start': !this.active,
|
|
48
48
|
'cursor-not-allowed bg-states-bg-disabled': this.disabled,
|
|
49
49
|
'switch-focus': this.isFocus && this.type === SulaSwitchType.Default,
|
|
50
|
-
}, tabIndex: 0, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("div", { key: '
|
|
50
|
+
}, tabIndex: 0, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("div", { key: 'a10f04862c4257df7a1753d0569dc32e8c0cd099', class: {
|
|
51
51
|
'switch-thumb w-[28px] h-[28px] rounded-full flex justify-center items-center': true,
|
|
52
52
|
'bg-negative-negative-1': !this.disabled,
|
|
53
53
|
'bg-states-bg-disabled shadow-md': this.disabled,
|
|
54
|
-
} }, h("div", { key: '
|
|
54
|
+
} }, h("div", { key: '50c1173d038c8db02559aa6041bffc42a318964a', class: {
|
|
55
55
|
'switch-indicator rounded-full': true,
|
|
56
56
|
'switch-indicator-on w-12 h-12 bg-brand-primary': this.active,
|
|
57
57
|
'switch-indicator-off w-[10px] h-4 bg-neutral-neutral-4': !this.active,
|
|
@@ -72,14 +72,14 @@ export class SulaTag {
|
|
|
72
72
|
return iconStatusStyles[this.iconStatus];
|
|
73
73
|
}
|
|
74
74
|
render() {
|
|
75
|
-
return (h(Host, { key: '
|
|
75
|
+
return (h(Host, { key: 'ef5f2947ea5a21a8f924a6b5140ea9382c268ac4' }, h("div", { key: 'bd55eb96395012c1a3634d193e14069a88be1b2d', class: {
|
|
76
76
|
'flex items-center rounded-xxl w-fit': true,
|
|
77
77
|
[this.getSizeClass()]: true,
|
|
78
78
|
[this.getAppearanceClass()]: true,
|
|
79
|
-
} }, this.icon && (h("div", { key: '
|
|
79
|
+
} }, this.icon && (h("div", { key: '6c37c84e7a215d0bb8f29048c0e53f4f0fa7953e', class: {
|
|
80
80
|
'flex justify-center items-center mr-8 rounded-full leading-4 px-2 py-1': true,
|
|
81
81
|
[this.getIconStatusClass()]: true,
|
|
82
|
-
} }, h("sula-icon", { key: '
|
|
82
|
+
} }, h("sula-icon", { key: 'f5ce8b83627858d804b67b15372173a94d1d4695', icon: this.icon, "custom-class": "text-base text-negative-negative-1 leading-4" }))), h("span", { key: 'ca436796841e583b7e5d80278cd3d0d7138678f3', class: {
|
|
83
83
|
'text-base leading-4': true,
|
|
84
84
|
[this.getTextColorClass()]: true,
|
|
85
85
|
[this.getTextWeightClass()]: true,
|
|
@@ -124,32 +124,32 @@ export class SulaTextarea {
|
|
|
124
124
|
}
|
|
125
125
|
render() {
|
|
126
126
|
const containerHeight = this.rows * 24 + 48;
|
|
127
|
-
return (h(Host, { key: '
|
|
127
|
+
return (h(Host, { key: '2fcc7b99d23820764799bcf3eed0a7605c9d2f72', ref: node => (this.node = node) }, h("div", { key: '5b6fecfaef896755b1862cf8468fb31297169885' }, h("div", { key: 'ed641bb610135c66bd663bfa284f0d81e7e1738d', id: "textarea-container", class: {
|
|
128
128
|
'relative border rounded-sm px-16 py-12 outline-none caret-brand-primary': true,
|
|
129
129
|
'textarea-focus': this.textareaIsFocused && !this.disabled && this.status === SulaTextareaStatus.Default,
|
|
130
130
|
'textarea-error': this.status === SulaTextareaStatus.Error && !this.disabled,
|
|
131
131
|
'bg-states-bg-disabled border-line-general cursor-not-allowed': this.disabled,
|
|
132
132
|
'bg-surface-body border-line-input cursor-text': !this.disabled,
|
|
133
|
-
}, style: { height: `${containerHeight}px` }, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleTextareaClick }, h("label", { key: '
|
|
133
|
+
}, style: { height: `${containerHeight}px` }, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleTextareaClick }, h("label", { key: '69ad1cd86d7395ecdeb7a6aeac02273370a10fef', class: {
|
|
134
134
|
'text-base top-16 left-12 absolute transition-all duration-200 ease-in-out pointer-events-none z-10 w-[85%]': true,
|
|
135
135
|
'text-text-primary': !this.disabled && (this.isActive || this.status === SulaTextareaStatus.Default),
|
|
136
136
|
'text-text-disabled': this.disabled,
|
|
137
137
|
'bg-surface-body': !this.disabled && this.isActive,
|
|
138
|
-
}, ref: node => (this.labelElement = node) }, this.label), h("label", { key: '
|
|
138
|
+
}, ref: node => (this.labelElement = node) }, this.label), h("label", { key: '0352260db567f497becd5f8f347cf206aecb595b', class: {
|
|
139
139
|
'absolute font-bold transition-all duration-200 ease-in-out pointer-events-none z-10 active-label hidden from-down': true,
|
|
140
140
|
'text-sm top-12 left-16': this.isActive,
|
|
141
141
|
'text-text-primary': !this.disabled && (this.isActive || this.status === SulaTextareaStatus.Default),
|
|
142
142
|
'text-text-disabled': this.disabled,
|
|
143
143
|
'bg-surface-body': !this.disabled && this.isActive,
|
|
144
|
-
}, ref: node => (this.activeLabelElement = node) }, this.label), h("textarea", { key: '
|
|
144
|
+
}, ref: node => (this.activeLabelElement = node) }, this.label), h("textarea", { key: 'edeacd0e14078081c1d5986e60852b8ed5b6a6a6', ref: node => (this.textareaElement = node), placeholder: this.isActive ? this.placeholder : '', rows: this.rows, maxLength: this.maxLength, disabled: this.disabled, class: {
|
|
145
145
|
'w-full h-full outline-none text-base bg-transparent border-none resize-none': true,
|
|
146
146
|
'text-text-primary': !this.disabled,
|
|
147
147
|
'text-text-disabled cursor-not-allowed overflow-hidden': this.disabled,
|
|
148
|
-
}, style: { paddingTop: this.isActive ? `${this.labelPadding}px` : '0' }, onInput: this.handleTextareaChanges, onFocus: this.handleTextareaFocus, onBlur: this.handleBlur, value: this.textValue })), (this.helpText || this.maxLength) && (h("div", { key: '
|
|
148
|
+
}, style: { paddingTop: this.isActive ? `${this.labelPadding}px` : '0' }, onInput: this.handleTextareaChanges, onFocus: this.handleTextareaFocus, onBlur: this.handleBlur, value: this.textValue })), (this.helpText || this.maxLength) && (h("div", { key: 'f1036cde3cf5bbd60fba5938fc2054d12d110624', class: "flex justify-between items-center px-16 mt-4 text-sm" }, this.helpText && (h("div", { key: 'db55a3ae78e63964a9d26a8cd44a71874a500004', id: "textarea-help-text", class: {
|
|
149
149
|
'text-text-primary': this.status === SulaTextareaStatus.Default && !this.disabled,
|
|
150
150
|
'text-feedback-error': this.status === SulaTextareaStatus.Error && !this.disabled,
|
|
151
151
|
'text-text-disabled': this.disabled,
|
|
152
|
-
} }, this.helpText)), this.maxLength && (h("div", { key: '
|
|
152
|
+
} }, this.helpText)), this.maxLength && (h("div", { key: '4e73a6934d1b959c86fa2c9f4cfb5dadaf20e943', id: "max-length-container", class: {
|
|
153
153
|
'text-text-primary': this.status === SulaTextareaStatus.Default && !this.disabled,
|
|
154
154
|
'text-feedback-error': this.status === SulaTextareaStatus.Error && !this.disabled,
|
|
155
155
|
'text-text-disabled': this.disabled,
|
|
@@ -129,14 +129,14 @@ export class SulaTextfield {
|
|
|
129
129
|
return this.icon;
|
|
130
130
|
}
|
|
131
131
|
render() {
|
|
132
|
-
return (h(Host, { key: '
|
|
132
|
+
return (h(Host, { key: '7f3d6752bea3a556fa77a52513eabe0655d9234d', ref: node => (this.node = node) }, h("div", { key: 'cd9cbc06a0244161c06e770d87834ddd7311ada3' }, h("div", { key: 'b66f4f6f2a5cfdcbc212264d500d219b4deb335e', id: "button-container", class: {
|
|
133
133
|
'flex items-center border rounded-sm px-16 outline-none h-[72px] caret-brand-primary': true,
|
|
134
134
|
'flex-row justify-between': !!this.icon || this.type === SulaTextfieldType.Password,
|
|
135
135
|
'button-focus': this.inputIsFocused && !this.disabled && this.status === SulaTextfieldStatus.Default,
|
|
136
136
|
'button-error': this.status === SulaTextfieldStatus.Error && !this.disabled,
|
|
137
137
|
'bg-states-bg-disabled border-line-general cursor-not-allowed': this.disabled,
|
|
138
138
|
'bg-surface-body border-line-input cursor-pointer': !this.disabled,
|
|
139
|
-
}, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleInputClick }, !this.disabled && (h("div", { key: '
|
|
139
|
+
}, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleInputClick }, !this.disabled && (h("div", { key: '79eabd37134b96bbb5a315ca73d81d0c8be01ce4', class: { 'hidden flex-col w-full': true, 'pr-12': !!this.icon }, ref: node => (this.inputContainer = node) }, h("label", { key: 'd24af603a0e365d1482daea31b75fa8e86fd5e8a', class: "font-bold text-sm text-text-primary from-down" }, this.label), h("input", { key: 'aea523483b4a39f31b0d2c9506001d69c397da70', type: this.type, ref: node => (this.inputElement = node), placeholder: this.placeholder, class: "outline-none text-base text-text-primary bg-transparent", onInput: this.handleInputChanges, onFocus: this.handleInputFocus, value: this.textValue }))), h("div", { key: '2e3d9fbe37ba1dc5aceea8e8ce7e6152f740a955', id: "textfield-label", class: { 'text-base flex items-center': true, 'text-text-primary': !this.disabled, 'text-text-disabled': this.disabled }, ref: node => (this.labelElement = node) }, this.label), (!!this.icon || this.type === SulaTextfieldType.Password) && (h("div", { key: 'd6f5aacd486e093d64307117d8c6b0bfea460f49', class: "flex items-center justify-center", onClick: this.handleIconClick }, h("sula-icon", { key: 'cfc400df76f2c487a09b641c101543a3e2895bd1', icon: this.getInputIcon(), customClass: `text-2xl ${this.disabled ? 'text-icon-disabled' : 'text-icon-primary'}` })))), (this.helpText || this.maxLength) && !this.disabled && (h("div", { key: '8d450abc836ba702aeda16f4f6c1d379373ee698', class: "flex justify-between items-center px-16 mt-4 text-sm" }, this.helpText && (h("div", { key: 'e0d25ac6878865510a0afc793d81b07d8a016bb5', id: "textfield-help-text", class: { 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error } }, this.helpText)), this.maxLength && (h("div", { key: '6384a6d5468b03bef0ddf2e0345438efe1b5fd32', id: "max-length-container", class: { 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error } }, this.textValue ? this.textValue.length : 0, "/", this.maxLength)))))));
|
|
140
140
|
}
|
|
141
141
|
static get is() { return "sula-textfield"; }
|
|
142
142
|
static get encapsulation() { return "shadow"; }
|
|
@@ -121,7 +121,7 @@ export class SulaTiles {
|
|
|
121
121
|
return (h("div", { class: this.getTextContainerClasses() }, h("span", { class: this.getTextClasses(true), title: this.ellipsis ? this.text : undefined }, this.text), this.hasSubText && (h("span", { class: this.getTextClasses(false), title: this.ellipsis ? this.subText : undefined }, this.subText))));
|
|
122
122
|
}
|
|
123
123
|
render() {
|
|
124
|
-
return (h(Host, { key: '
|
|
124
|
+
return (h(Host, { key: '32ee3b19743f75052428014a010545e4a6c9098b' }, h("div", { key: '09384829c191d1ec6518e0ccbc3ac4c290e1e798', class: this.getContainerClasses(), tabIndex: this.getTabIndex(this.isSquare), onClick: this.handleClick }, this.renderIcon(), this.renderText())));
|
|
125
125
|
}
|
|
126
126
|
static get is() { return "sula-tiles"; }
|
|
127
127
|
static get encapsulation() { return "shadow"; }
|
|
@@ -37,7 +37,7 @@ export class SulaTimelineList {
|
|
|
37
37
|
return iconByStatus[status];
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
|
-
return (h(Host, { key: '
|
|
40
|
+
return (h(Host, { key: '61a3d229e04aa2935ef1d03fca3aa519aa21d13b' }, h("div", { key: 'cd8c1483e94ea8f8cf2e0c51e400528f83fcf9f5', class: "flex flex-col bg-surface-on-body px-24 py-32 w-fit rounded-md" }, this.sulaTimelineList.map((item, index) => {
|
|
41
41
|
const isLastItem = index === this.sulaTimelineList.length - 1;
|
|
42
42
|
return (h("div", { class: {
|
|
43
43
|
'relative timeline-item': true,
|
package/dist/components/index.js
CHANGED
|
@@ -748,10 +748,17 @@ var insertBefore = (parent, newNode, reference) => {
|
|
|
748
748
|
};
|
|
749
749
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
750
750
|
const hostElm = hostRef.$hostElement$;
|
|
751
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
751
752
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
752
753
|
const isHostElement = isHost(renderFnResults);
|
|
753
754
|
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
754
755
|
hostTagName = hostElm.tagName;
|
|
756
|
+
if (cmpMeta.$attrsToReflect$) {
|
|
757
|
+
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
758
|
+
cmpMeta.$attrsToReflect$.map(
|
|
759
|
+
([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
|
|
760
|
+
);
|
|
761
|
+
}
|
|
755
762
|
if (isInitialLoad && rootVnode.$attrs$) {
|
|
756
763
|
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
757
764
|
if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
|
|
@@ -1063,8 +1070,12 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1063
1070
|
/* @__PURE__ */ new Set([
|
|
1064
1071
|
...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
|
|
1065
1072
|
...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {
|
|
1073
|
+
var _a2;
|
|
1066
1074
|
const attrName = m[1] || propName;
|
|
1067
1075
|
attrNameToPropName.set(attrName, propName);
|
|
1076
|
+
if (m[0] & 512 /* ReflectAttr */) {
|
|
1077
|
+
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
1078
|
+
}
|
|
1068
1079
|
return attrName;
|
|
1069
1080
|
})
|
|
1070
1081
|
])
|
|
@@ -1179,6 +1190,9 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
1179
1190
|
{
|
|
1180
1191
|
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
1181
1192
|
}
|
|
1193
|
+
{
|
|
1194
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
1195
|
+
}
|
|
1182
1196
|
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
1183
1197
|
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
1184
1198
|
Object.assign(Cstr.prototype, {
|
|
@@ -1259,7 +1273,12 @@ var setPlatformOptions = (opts) => Object.assign(plt, opts);
|
|
|
1259
1273
|
|
|
1260
1274
|
// src/runtime/render.ts
|
|
1261
1275
|
function render(vnode, container) {
|
|
1276
|
+
const cmpMeta = {
|
|
1277
|
+
$flags$: 0,
|
|
1278
|
+
$tagName$: container.tagName
|
|
1279
|
+
};
|
|
1262
1280
|
const ref = {
|
|
1281
|
+
$cmpMeta$: cmpMeta,
|
|
1263
1282
|
$hostElement$: container
|
|
1264
1283
|
};
|
|
1265
1284
|
renderVdom(ref, vnode);
|