@sula-tech/webcomponents 0.9.2 → 0.11.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/loader.cjs.js +1 -1
- package/dist/cjs/{sula-avatar_19.cjs.entry.js → sula-avatar_21.cjs.entry.js} +155 -39
- package/dist/cjs/sula-avatar_21.cjs.entry.js.map +1 -0
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/sula-breadcrumb/model/sula-breadcrumb.model.js +2 -0
- package/dist/collection/components/sula-breadcrumb/model/sula-breadcrumb.model.js.map +1 -0
- package/dist/collection/components/sula-breadcrumb/sula-breadcrumb.css +1 -0
- package/dist/collection/components/sula-breadcrumb/sula-breadcrumb.js +98 -0
- package/dist/collection/components/sula-breadcrumb/sula-breadcrumb.js.map +1 -0
- package/dist/collection/components/sula-breadcrumb/sula-breadcrumb.stories.js +116 -0
- package/dist/collection/components/sula-breadcrumb/sula-breadcrumb.stories.js.map +1 -0
- package/dist/collection/components/sula-button/sula-button.js +1 -1
- package/dist/collection/components/sula-checkbox/sula-checkbox.js +3 -3
- package/dist/collection/components/sula-chip/sula-chip.js +3 -3
- package/dist/collection/components/sula-dropdown/sula-dropdown.js +3 -3
- 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.js +1 -1
- package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.js +1 -1
- 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-segmented-control/model/sula-segmented-control.model.js +16 -0
- package/dist/collection/components/sula-segmented-control/model/sula-segmented-control.model.js.map +1 -0
- package/dist/collection/components/sula-segmented-control/sula-segmented-control.css +1 -0
- package/dist/collection/components/sula-segmented-control/sula-segmented-control.js +241 -0
- package/dist/collection/components/sula-segmented-control/sula-segmented-control.js.map +1 -0
- package/dist/collection/components/sula-segmented-control/sula-segmented-control.stories.js +352 -0
- package/dist/collection/components/sula-segmented-control/sula-segmented-control.stories.js.map +1 -0
- 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/collection/testing/e2e-setup.js +47 -0
- package/dist/collection/testing/e2e-setup.js.map +1 -0
- package/dist/components/{p-Bgqd8BiV.js → p-CD0__3qt.js} +5 -5
- package/dist/components/{p-Bgqd8BiV.js.map → p-CD0__3qt.js.map} +1 -1
- package/dist/components/{p-QU2wuzIe.js → p-CFhhi4NQ.js} +3 -3
- package/dist/components/{p-QU2wuzIe.js.map → p-CFhhi4NQ.js.map} +1 -1
- package/dist/components/{p-BUnU7bjf.js → p-CkPiwCwQ.js} +3 -3
- package/dist/components/{p-BUnU7bjf.js.map → p-CkPiwCwQ.js.map} +1 -1
- package/dist/components/{p-Uq6L0wCA.js → p-DO7voMbe.js} +4 -4
- package/dist/components/{p-Uq6L0wCA.js.map → p-DO7voMbe.js.map} +1 -1
- package/dist/components/sula-avatar.js +1 -1
- package/dist/components/sula-badge.js +1 -1
- package/dist/components/sula-breadcrumb.d.ts +11 -0
- package/dist/components/sula-breadcrumb.js +70 -0
- package/dist/components/sula-breadcrumb.js.map +1 -0
- package/dist/components/sula-button.js +1 -1
- package/dist/components/sula-checkbox.js +4 -4
- package/dist/components/sula-chip.js +5 -5
- package/dist/components/sula-dropdown.js +5 -5
- 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.js +3 -3
- 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-segmented-control.d.ts +11 -0
- package/dist/components/sula-segmented-control.js +113 -0
- package/dist/components/sula-segmented-control.js.map +1 -0
- 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/loader.js +1 -1
- package/dist/esm/{sula-avatar_19.entry.js → sula-avatar_21.entry.js} +154 -40
- package/dist/esm/sula-avatar_21.entry.js.map +1 -0
- package/dist/esm/webcomponents.js +1 -1
- package/dist/types/components/sula-breadcrumb/model/sula-breadcrumb.model.d.ts +5 -0
- package/dist/types/components/sula-breadcrumb/sula-breadcrumb.d.ts +14 -0
- package/dist/types/components/sula-breadcrumb/sula-breadcrumb.stories.d.ts +39 -0
- package/dist/types/components/sula-segmented-control/model/sula-segmented-control.model.d.ts +19 -0
- package/dist/types/components/sula-segmented-control/sula-segmented-control.d.ts +37 -0
- package/dist/types/components/sula-segmented-control/sula-segmented-control.stories.d.ts +136 -0
- package/dist/types/components.d.ts +128 -0
- package/dist/types/testing/e2e-setup.d.ts +1 -0
- package/dist/webcomponents/{p-9f81911a.entry.js → p-491c4d76.entry.js} +388 -228
- package/dist/webcomponents/p-491c4d76.entry.js.map +1 -0
- package/dist/webcomponents/webcomponents.esm.js +8 -1
- package/package.json +5 -2
- package/dist/cjs/sula-avatar_19.cjs.entry.js.map +0 -1
- package/dist/esm/sula-avatar_19.entry.js.map +0 -1
- package/dist/webcomponents/p-9f81911a.entry.js.map +0 -1
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { SulaSegmentedControlColor, SulaSegmentedControlSize, SulaSegmentedControlType } from "./model/sula-segmented-control.model";
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Components/sula-segmented-control',
|
|
4
|
+
tags: ['autodocs'],
|
|
5
|
+
argTypes: {
|
|
6
|
+
items: {
|
|
7
|
+
control: 'object',
|
|
8
|
+
description: 'Array de opções para o controle segmentado',
|
|
9
|
+
table: {
|
|
10
|
+
type: { summary: 'SulaSegmentedControlOption[]' },
|
|
11
|
+
defaultValue: { summary: '[]' },
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
type: {
|
|
15
|
+
control: { type: 'select' },
|
|
16
|
+
options: Object.values(SulaSegmentedControlType),
|
|
17
|
+
description: 'Tipo do controle segmentado (texto ou ícone)',
|
|
18
|
+
table: {
|
|
19
|
+
type: { summary: 'SulaSegmentedControlType' },
|
|
20
|
+
defaultValue: { summary: 'SulaSegmentedControlType.Text' },
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
size: {
|
|
24
|
+
control: { type: 'select' },
|
|
25
|
+
options: Object.values(SulaSegmentedControlSize),
|
|
26
|
+
description: 'Tamanho do controle segmentado',
|
|
27
|
+
table: {
|
|
28
|
+
type: { summary: 'SulaSegmentedControlSize' },
|
|
29
|
+
defaultValue: { summary: 'SulaSegmentedControlSize.Default' },
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
color: {
|
|
33
|
+
control: { type: 'select' },
|
|
34
|
+
options: Object.values(SulaSegmentedControlColor),
|
|
35
|
+
description: 'Cor de fundo do controle segmentado',
|
|
36
|
+
table: {
|
|
37
|
+
type: { summary: 'SulaSegmentedControlColor' },
|
|
38
|
+
defaultValue: { summary: 'SulaSegmentedControlColor.White' },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
itemClicked: {
|
|
42
|
+
action: 'itemClicked',
|
|
43
|
+
description: 'Evento emitido quando um item é clicado',
|
|
44
|
+
table: {
|
|
45
|
+
type: { summary: 'CustomEvent<SulaSegmentedControlOption>' },
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
itemHovered: {
|
|
49
|
+
action: 'itemHovered',
|
|
50
|
+
description: 'Evento emitido quando um item recebe hover',
|
|
51
|
+
table: {
|
|
52
|
+
type: { summary: 'CustomEvent<SulaSegmentedControlOption>' },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
itemBlur: {
|
|
56
|
+
action: 'itemBlur',
|
|
57
|
+
description: 'Evento emitido quando um item perde o foco',
|
|
58
|
+
table: {
|
|
59
|
+
type: { summary: 'CustomEvent<SulaSegmentedControlOption>' },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
parameters: {
|
|
64
|
+
docs: {
|
|
65
|
+
description: {
|
|
66
|
+
component: `
|
|
67
|
+
O componente **Sula Segmented Control** é utilizado para permitir que os usuários escolham entre
|
|
68
|
+
múltiplas opções mutuamente exclusivas. É ideal para navegação entre visualizações ou filtros.
|
|
69
|
+
|
|
70
|
+
### Características principais:
|
|
71
|
+
- Suporte a diferentes tipos (Texto e Ícone)
|
|
72
|
+
- Diferentes tamanhos (Default e Small)
|
|
73
|
+
- Cores de fundo personalizáveis (White e Gray)
|
|
74
|
+
- Suporte a chevron adicional nas opções
|
|
75
|
+
- Eventos de clique, hover e blur
|
|
76
|
+
`,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
const Template = args => {
|
|
82
|
+
const container = document.createElement('div');
|
|
83
|
+
container.style.margin = '20px';
|
|
84
|
+
container.style.display = 'flex';
|
|
85
|
+
container.style.alignItems = 'center';
|
|
86
|
+
container.style.justifyContent = 'center';
|
|
87
|
+
container.style.minHeight = '80px';
|
|
88
|
+
if (args.color === SulaSegmentedControlColor.White) {
|
|
89
|
+
container.style.backgroundColor = '#f5f5f5';
|
|
90
|
+
container.style.padding = '20px';
|
|
91
|
+
container.style.borderRadius = '8px';
|
|
92
|
+
}
|
|
93
|
+
const el = document.createElement('sula-segmented-control');
|
|
94
|
+
el.items = args.items;
|
|
95
|
+
el.setAttribute('type', args.type);
|
|
96
|
+
el.setAttribute('size', args.size);
|
|
97
|
+
el.setAttribute('color', args.color);
|
|
98
|
+
el.addEventListener('itemClicked', args.itemClicked);
|
|
99
|
+
el.addEventListener('itemHovered', args.itemHovered);
|
|
100
|
+
el.addEventListener('itemBlur', args.itemBlur);
|
|
101
|
+
container.appendChild(el);
|
|
102
|
+
return container;
|
|
103
|
+
};
|
|
104
|
+
export const Playground = Template.bind({});
|
|
105
|
+
Playground.args = {
|
|
106
|
+
items: [
|
|
107
|
+
{ label: 'Opção 1', value: '1', selected: true },
|
|
108
|
+
{ label: 'Opção 2', value: '2' },
|
|
109
|
+
{ label: 'Opção 3', value: '3' },
|
|
110
|
+
],
|
|
111
|
+
type: SulaSegmentedControlType.Text,
|
|
112
|
+
size: SulaSegmentedControlSize.Default,
|
|
113
|
+
color: SulaSegmentedControlColor.White,
|
|
114
|
+
};
|
|
115
|
+
export const TextType = Template.bind({});
|
|
116
|
+
TextType.args = {
|
|
117
|
+
items: [
|
|
118
|
+
{ label: 'Todos', value: 'all', selected: true },
|
|
119
|
+
{ label: 'Ativos', value: 'active' },
|
|
120
|
+
{ label: 'Inativos', value: 'inactive' },
|
|
121
|
+
],
|
|
122
|
+
type: SulaSegmentedControlType.Text,
|
|
123
|
+
size: SulaSegmentedControlSize.Default,
|
|
124
|
+
color: SulaSegmentedControlColor.White,
|
|
125
|
+
};
|
|
126
|
+
TextType.parameters = {
|
|
127
|
+
docs: {
|
|
128
|
+
description: {
|
|
129
|
+
story: 'Controle segmentado com texto.',
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
export const IconType = Template.bind({});
|
|
134
|
+
IconType.args = {
|
|
135
|
+
items: [
|
|
136
|
+
{ icon: 'ph ph-house', value: 'home', selected: true },
|
|
137
|
+
{ icon: 'ph ph-user', value: 'user' },
|
|
138
|
+
{ icon: 'ph ph-gear', value: 'settings' },
|
|
139
|
+
],
|
|
140
|
+
type: SulaSegmentedControlType.Icon,
|
|
141
|
+
size: SulaSegmentedControlSize.Default,
|
|
142
|
+
color: SulaSegmentedControlColor.White,
|
|
143
|
+
};
|
|
144
|
+
IconType.parameters = {
|
|
145
|
+
docs: {
|
|
146
|
+
description: {
|
|
147
|
+
story: 'Controle segmentado com ícones.',
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
export const WithChevron = Template.bind({});
|
|
152
|
+
WithChevron.args = {
|
|
153
|
+
items: [
|
|
154
|
+
{ label: 'Filtro 1', value: '1', addChevron: true, selected: true },
|
|
155
|
+
{ label: 'Filtro 2', value: '2', addChevron: true },
|
|
156
|
+
{ label: 'Filtro 3', value: '3', addChevron: true },
|
|
157
|
+
],
|
|
158
|
+
type: SulaSegmentedControlType.Text,
|
|
159
|
+
size: SulaSegmentedControlSize.Default,
|
|
160
|
+
color: SulaSegmentedControlColor.White,
|
|
161
|
+
};
|
|
162
|
+
WithChevron.parameters = {
|
|
163
|
+
docs: {
|
|
164
|
+
description: {
|
|
165
|
+
story: 'Controle segmentado com chevron nas opções.',
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
export const SmallSize = Template.bind({});
|
|
170
|
+
SmallSize.args = {
|
|
171
|
+
items: [
|
|
172
|
+
{ label: 'Pequeno 1', value: '1', selected: true },
|
|
173
|
+
{ label: 'Pequeno 2', value: '2' },
|
|
174
|
+
{ label: 'Pequeno 3', value: '3' },
|
|
175
|
+
],
|
|
176
|
+
type: SulaSegmentedControlType.Text,
|
|
177
|
+
size: SulaSegmentedControlSize.Small,
|
|
178
|
+
color: SulaSegmentedControlColor.White,
|
|
179
|
+
};
|
|
180
|
+
SmallSize.parameters = {
|
|
181
|
+
docs: {
|
|
182
|
+
description: {
|
|
183
|
+
story: 'Controle segmentado em tamanho pequeno.',
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
export const Sizes = () => {
|
|
188
|
+
const container = document.createElement('div');
|
|
189
|
+
container.style.display = 'flex';
|
|
190
|
+
container.style.flexDirection = 'column';
|
|
191
|
+
container.style.gap = '16px';
|
|
192
|
+
container.style.alignItems = 'center';
|
|
193
|
+
container.style.padding = '20px';
|
|
194
|
+
container.style.backgroundColor = '#f5f5f5';
|
|
195
|
+
container.style.borderRadius = '8px';
|
|
196
|
+
const defaultControl = document.createElement('sula-segmented-control');
|
|
197
|
+
defaultControl.items = [
|
|
198
|
+
{ label: 'Default 1', value: '1', selected: true },
|
|
199
|
+
{ label: 'Default 2', value: '2' },
|
|
200
|
+
{ label: 'Default 3', value: '3' },
|
|
201
|
+
];
|
|
202
|
+
defaultControl.setAttribute('size', SulaSegmentedControlSize.Default);
|
|
203
|
+
const smallControl = document.createElement('sula-segmented-control');
|
|
204
|
+
smallControl.items = [
|
|
205
|
+
{ label: 'Small 1', value: '1', selected: true },
|
|
206
|
+
{ label: 'Small 2', value: '2' },
|
|
207
|
+
{ label: 'Small 3', value: '3' },
|
|
208
|
+
];
|
|
209
|
+
smallControl.setAttribute('size', SulaSegmentedControlSize.Small);
|
|
210
|
+
container.appendChild(defaultControl);
|
|
211
|
+
container.appendChild(smallControl);
|
|
212
|
+
return container;
|
|
213
|
+
};
|
|
214
|
+
Sizes.parameters = {
|
|
215
|
+
docs: {
|
|
216
|
+
description: {
|
|
217
|
+
story: 'Comparação entre os diferentes tamanhos disponíveis.',
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
};
|
|
221
|
+
export const GrayBackground = Template.bind({});
|
|
222
|
+
GrayBackground.args = {
|
|
223
|
+
items: [
|
|
224
|
+
{ label: 'Opção 1', value: '1', selected: true },
|
|
225
|
+
{ label: 'Opção 2', value: '2' },
|
|
226
|
+
{ label: 'Opção 3', value: '3' },
|
|
227
|
+
],
|
|
228
|
+
type: SulaSegmentedControlType.Text,
|
|
229
|
+
size: SulaSegmentedControlSize.Default,
|
|
230
|
+
color: SulaSegmentedControlColor.Gray,
|
|
231
|
+
};
|
|
232
|
+
GrayBackground.parameters = {
|
|
233
|
+
docs: {
|
|
234
|
+
description: {
|
|
235
|
+
story: 'Controle segmentado com fundo cinza.',
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
export const ColorVariations = () => {
|
|
240
|
+
const container = document.createElement('div');
|
|
241
|
+
container.style.display = 'flex';
|
|
242
|
+
container.style.flexDirection = 'column';
|
|
243
|
+
container.style.gap = '16px';
|
|
244
|
+
container.style.alignItems = 'center';
|
|
245
|
+
container.style.padding = '20px';
|
|
246
|
+
container.style.backgroundColor = '#f5f5f5';
|
|
247
|
+
container.style.borderRadius = '8px';
|
|
248
|
+
const whiteControl = document.createElement('sula-segmented-control');
|
|
249
|
+
whiteControl.items = [
|
|
250
|
+
{ label: 'White 1', value: '1', selected: true },
|
|
251
|
+
{ label: 'White 2', value: '2' },
|
|
252
|
+
{ label: 'White 3', value: '3' },
|
|
253
|
+
];
|
|
254
|
+
whiteControl.setAttribute('color', SulaSegmentedControlColor.White);
|
|
255
|
+
const grayControl = document.createElement('sula-segmented-control');
|
|
256
|
+
grayControl.items = [
|
|
257
|
+
{ label: 'Gray 1', value: '1', selected: true },
|
|
258
|
+
{ label: 'Gray 2', value: '2' },
|
|
259
|
+
{ label: 'Gray 3', value: '3' },
|
|
260
|
+
];
|
|
261
|
+
grayControl.setAttribute('color', SulaSegmentedControlColor.Gray);
|
|
262
|
+
container.appendChild(whiteControl);
|
|
263
|
+
container.appendChild(grayControl);
|
|
264
|
+
return container;
|
|
265
|
+
};
|
|
266
|
+
ColorVariations.parameters = {
|
|
267
|
+
docs: {
|
|
268
|
+
description: {
|
|
269
|
+
story: 'Diferentes cores de fundo disponíveis.',
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
};
|
|
273
|
+
export const ManyOptions = Template.bind({});
|
|
274
|
+
ManyOptions.args = {
|
|
275
|
+
items: [
|
|
276
|
+
{ label: 'Janeiro', value: '1', selected: true },
|
|
277
|
+
{ label: 'Fevereiro', value: '2' },
|
|
278
|
+
{ label: 'Março', value: '3' },
|
|
279
|
+
{ label: 'Abril', value: '4' },
|
|
280
|
+
{ label: 'Maio', value: '5' },
|
|
281
|
+
],
|
|
282
|
+
type: SulaSegmentedControlType.Text,
|
|
283
|
+
size: SulaSegmentedControlSize.Default,
|
|
284
|
+
color: SulaSegmentedControlColor.White,
|
|
285
|
+
};
|
|
286
|
+
ManyOptions.parameters = {
|
|
287
|
+
docs: {
|
|
288
|
+
description: {
|
|
289
|
+
story: 'Controle segmentado com múltiplas opções.',
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
};
|
|
293
|
+
export const AllVariations = () => {
|
|
294
|
+
const container = document.createElement('div');
|
|
295
|
+
container.style.display = 'grid';
|
|
296
|
+
container.style.gridTemplateColumns = 'repeat(auto-fit, minmax(300px, 1fr))';
|
|
297
|
+
container.style.gap = '24px';
|
|
298
|
+
container.style.padding = '20px';
|
|
299
|
+
container.style.backgroundColor = '#f5f5f5';
|
|
300
|
+
container.style.borderRadius = '8px';
|
|
301
|
+
const variations = [
|
|
302
|
+
{
|
|
303
|
+
items: [
|
|
304
|
+
{ label: 'Text White', value: '1', selected: true },
|
|
305
|
+
{ label: 'Opção 2', value: '2' },
|
|
306
|
+
],
|
|
307
|
+
type: SulaSegmentedControlType.Text,
|
|
308
|
+
color: SulaSegmentedControlColor.White,
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
items: [
|
|
312
|
+
{ label: 'Text Gray', value: '1', selected: true },
|
|
313
|
+
{ label: 'Opção 2', value: '2' },
|
|
314
|
+
],
|
|
315
|
+
type: SulaSegmentedControlType.Text,
|
|
316
|
+
color: SulaSegmentedControlColor.Gray,
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
items: [
|
|
320
|
+
{ icon: 'ph ph-house', value: '1', selected: true },
|
|
321
|
+
{ icon: 'ph ph-user', value: '2' },
|
|
322
|
+
],
|
|
323
|
+
type: SulaSegmentedControlType.Icon,
|
|
324
|
+
color: SulaSegmentedControlColor.White,
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
items: [
|
|
328
|
+
{ icon: 'ph ph-house', value: '1', selected: true },
|
|
329
|
+
{ icon: 'ph ph-user', value: '2' },
|
|
330
|
+
],
|
|
331
|
+
type: SulaSegmentedControlType.Icon,
|
|
332
|
+
color: SulaSegmentedControlColor.Gray,
|
|
333
|
+
},
|
|
334
|
+
];
|
|
335
|
+
variations.forEach(variation => {
|
|
336
|
+
const control = document.createElement('sula-segmented-control');
|
|
337
|
+
control.items = variation.items;
|
|
338
|
+
control.setAttribute('type', variation.type);
|
|
339
|
+
control.setAttribute('color', variation.color);
|
|
340
|
+
control.setAttribute('size', SulaSegmentedControlSize.Default);
|
|
341
|
+
container.appendChild(control);
|
|
342
|
+
});
|
|
343
|
+
return container;
|
|
344
|
+
};
|
|
345
|
+
AllVariations.parameters = {
|
|
346
|
+
docs: {
|
|
347
|
+
description: {
|
|
348
|
+
story: 'Visão geral de todas as combinações de tipo e cor.',
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
};
|
|
352
|
+
//# sourceMappingURL=sula-segmented-control.stories.js.map
|
package/dist/collection/components/sula-segmented-control/sula-segmented-control.stories.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sula-segmented-control.stories.js","sourceRoot":"","sources":["../../../src/components/sula-segmented-control/sula-segmented-control.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAErI,eAAe;IACb,KAAK,EAAE,mCAAmC;IAC1C,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,4CAA4C;YACzD,KAAK,EAAE;gBACL,IAAI,EAAE,EAAE,OAAO,EAAE,8BAA8B,EAAE;gBACjD,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,E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;YACD,IAAI,EAAE,wBAAwB,CAAC,IAAI;YACnC,KAAK,EAAE,yBAAyB,CAAC,KAAK;SACvC;QACD;YACE,KAAK,EAAE;gBACL,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE;gBACnD,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,EAAE;aACnC;YACD,IAAI,EAAE,wBAAwB,CAAC,IAAI;YACnC,KAAK,EAAE,yBAAyB,CAAC,IAAI;SACtC;KACF,CAAC;IAEF,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;QAC7B,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,wBAAwB,CAAC,CAAC;QACjE,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC;QAChC,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;QAC/C,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAC/D,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AACF,aAAa,CAAC,UAAU,GAAG;IACzB,IAAI,EAAE;QACJ,WAAW,EAAE;YACX,KAAK,EAAE,oDAAoD;SAC5D;KACF;CACF,CAAC","sourcesContent":["import { SulaSegmentedControlColor, SulaSegmentedControlSize, SulaSegmentedControlType } from './model/sula-segmented-control.model';\n\nexport default {\n title: 'Components/sula-segmented-control',\n tags: ['autodocs'],\n argTypes: {\n items: {\n control: 'object',\n description: 'Array de opções para o controle segmentado',\n table: {\n type: { summary: 'SulaSegmentedControlOption[]' },\n defaultValue: { summary: '[]' },\n },\n },\n type: {\n control: { type: 'select' },\n options: Object.values(SulaSegmentedControlType),\n description: 'Tipo do controle segmentado (texto ou ícone)',\n table: {\n type: { summary: 'SulaSegmentedControlType' },\n defaultValue: { summary: 'SulaSegmentedControlType.Text' },\n },\n },\n size: {\n control: { type: 'select' },\n options: Object.values(SulaSegmentedControlSize),\n description: 'Tamanho do controle segmentado',\n table: {\n type: { summary: 'SulaSegmentedControlSize' },\n defaultValue: { summary: 'SulaSegmentedControlSize.Default' },\n },\n },\n color: {\n control: { type: 'select' },\n options: Object.values(SulaSegmentedControlColor),\n description: 'Cor de fundo do controle segmentado',\n table: {\n type: { summary: 'SulaSegmentedControlColor' },\n defaultValue: { summary: 'SulaSegmentedControlColor.White' },\n },\n },\n itemClicked: {\n action: 'itemClicked',\n description: 'Evento emitido quando um item é clicado',\n table: {\n type: { summary: 'CustomEvent<SulaSegmentedControlOption>' },\n },\n },\n itemHovered: {\n action: 'itemHovered',\n description: 'Evento emitido quando um item recebe hover',\n table: {\n type: { summary: 'CustomEvent<SulaSegmentedControlOption>' },\n },\n },\n itemBlur: {\n action: 'itemBlur',\n description: 'Evento emitido quando um item perde o foco',\n table: {\n type: { summary: 'CustomEvent<SulaSegmentedControlOption>' },\n },\n },\n },\n parameters: {\n docs: {\n description: {\n component: `\nO componente **Sula Segmented Control** é utilizado para permitir que os usuários escolham entre\nmúltiplas opções mutuamente exclusivas. É ideal para navegação entre visualizações ou filtros.\n\n### Características principais:\n- Suporte a diferentes tipos (Texto e Ícone)\n- Diferentes tamanhos (Default e Small)\n- Cores de fundo personalizáveis (White e Gray)\n- Suporte a chevron adicional nas opções\n- Eventos de clique, hover e blur\n `,\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 = '80px';\n\n if (args.color === SulaSegmentedControlColor.White) {\n container.style.backgroundColor = '#f5f5f5';\n container.style.padding = '20px';\n container.style.borderRadius = '8px';\n }\n\n const el = document.createElement('sula-segmented-control');\n\n el.items = args.items;\n el.setAttribute('type', args.type);\n el.setAttribute('size', args.size);\n el.setAttribute('color', args.color);\n\n el.addEventListener('itemClicked', args.itemClicked);\n el.addEventListener('itemHovered', args.itemHovered);\n el.addEventListener('itemBlur', args.itemBlur);\n\n container.appendChild(el);\n return container;\n};\n\nexport const Playground = Template.bind({});\nPlayground.args = {\n items: [\n { label: 'Opção 1', value: '1', selected: true },\n { label: 'Opção 2', value: '2' },\n { label: 'Opção 3', value: '3' },\n ],\n type: SulaSegmentedControlType.Text,\n size: SulaSegmentedControlSize.Default,\n color: SulaSegmentedControlColor.White,\n};\n\nexport const TextType = Template.bind({});\nTextType.args = {\n items: [\n { label: 'Todos', value: 'all', selected: true },\n { label: 'Ativos', value: 'active' },\n { label: 'Inativos', value: 'inactive' },\n ],\n type: SulaSegmentedControlType.Text,\n size: SulaSegmentedControlSize.Default,\n color: SulaSegmentedControlColor.White,\n};\nTextType.parameters = {\n docs: {\n description: {\n story: 'Controle segmentado com texto.',\n },\n },\n};\n\nexport const IconType = Template.bind({});\nIconType.args = {\n items: [\n { icon: 'ph ph-house', value: 'home', selected: true },\n { icon: 'ph ph-user', value: 'user' },\n { icon: 'ph ph-gear', value: 'settings' },\n ],\n type: SulaSegmentedControlType.Icon,\n size: SulaSegmentedControlSize.Default,\n color: SulaSegmentedControlColor.White,\n};\nIconType.parameters = {\n docs: {\n description: {\n story: 'Controle segmentado com ícones.',\n },\n },\n};\n\nexport const WithChevron = Template.bind({});\nWithChevron.args = {\n items: [\n { label: 'Filtro 1', value: '1', addChevron: true, selected: true },\n { label: 'Filtro 2', value: '2', addChevron: true },\n { label: 'Filtro 3', value: '3', addChevron: true },\n ],\n type: SulaSegmentedControlType.Text,\n size: SulaSegmentedControlSize.Default,\n color: SulaSegmentedControlColor.White,\n};\nWithChevron.parameters = {\n docs: {\n description: {\n story: 'Controle segmentado com chevron nas opções.',\n },\n },\n};\n\nexport const SmallSize = Template.bind({});\nSmallSize.args = {\n items: [\n { label: 'Pequeno 1', value: '1', selected: true },\n { label: 'Pequeno 2', value: '2' },\n { label: 'Pequeno 3', value: '3' },\n ],\n type: SulaSegmentedControlType.Text,\n size: SulaSegmentedControlSize.Small,\n color: SulaSegmentedControlColor.White,\n};\nSmallSize.parameters = {\n docs: {\n description: {\n story: 'Controle segmentado em tamanho pequeno.',\n },\n },\n};\n\nexport const Sizes = () => {\n const container = document.createElement('div');\n container.style.display = 'flex';\n container.style.flexDirection = 'column';\n container.style.gap = '16px';\n container.style.alignItems = 'center';\n container.style.padding = '20px';\n container.style.backgroundColor = '#f5f5f5';\n container.style.borderRadius = '8px';\n\n const defaultControl = document.createElement('sula-segmented-control');\n defaultControl.items = [\n { label: 'Default 1', value: '1', selected: true },\n { label: 'Default 2', value: '2' },\n { label: 'Default 3', value: '3' },\n ];\n defaultControl.setAttribute('size', SulaSegmentedControlSize.Default);\n\n const smallControl = document.createElement('sula-segmented-control');\n smallControl.items = [\n { label: 'Small 1', value: '1', selected: true },\n { label: 'Small 2', value: '2' },\n { label: 'Small 3', value: '3' },\n ];\n smallControl.setAttribute('size', SulaSegmentedControlSize.Small);\n\n container.appendChild(defaultControl);\n container.appendChild(smallControl);\n\n return container;\n};\nSizes.parameters = {\n docs: {\n description: {\n story: 'Comparação entre os diferentes tamanhos disponíveis.',\n },\n },\n};\n\nexport const GrayBackground = Template.bind({});\nGrayBackground.args = {\n items: [\n { label: 'Opção 1', value: '1', selected: true },\n { label: 'Opção 2', value: '2' },\n { label: 'Opção 3', value: '3' },\n ],\n type: SulaSegmentedControlType.Text,\n size: SulaSegmentedControlSize.Default,\n color: SulaSegmentedControlColor.Gray,\n};\nGrayBackground.parameters = {\n docs: {\n description: {\n story: 'Controle segmentado com fundo cinza.',\n },\n },\n};\n\nexport const ColorVariations = () => {\n const container = document.createElement('div');\n container.style.display = 'flex';\n container.style.flexDirection = 'column';\n container.style.gap = '16px';\n container.style.alignItems = 'center';\n container.style.padding = '20px';\n container.style.backgroundColor = '#f5f5f5';\n container.style.borderRadius = '8px';\n\n const whiteControl = document.createElement('sula-segmented-control');\n whiteControl.items = [\n { label: 'White 1', value: '1', selected: true },\n { label: 'White 2', value: '2' },\n { label: 'White 3', value: '3' },\n ];\n whiteControl.setAttribute('color', SulaSegmentedControlColor.White);\n\n const grayControl = document.createElement('sula-segmented-control');\n grayControl.items = [\n { label: 'Gray 1', value: '1', selected: true },\n { label: 'Gray 2', value: '2' },\n { label: 'Gray 3', value: '3' },\n ];\n grayControl.setAttribute('color', SulaSegmentedControlColor.Gray);\n\n container.appendChild(whiteControl);\n container.appendChild(grayControl);\n\n return container;\n};\nColorVariations.parameters = {\n docs: {\n description: {\n story: 'Diferentes cores de fundo disponíveis.',\n },\n },\n};\n\nexport const ManyOptions = Template.bind({});\nManyOptions.args = {\n items: [\n { label: 'Janeiro', value: '1', selected: true },\n { label: 'Fevereiro', value: '2' },\n { label: 'Março', value: '3' },\n { label: 'Abril', value: '4' },\n { label: 'Maio', value: '5' },\n ],\n type: SulaSegmentedControlType.Text,\n size: SulaSegmentedControlSize.Default,\n color: SulaSegmentedControlColor.White,\n};\nManyOptions.parameters = {\n docs: {\n description: {\n story: 'Controle segmentado com múltiplas opções.',\n },\n },\n};\n\nexport const AllVariations = () => {\n const container = document.createElement('div');\n container.style.display = 'grid';\n container.style.gridTemplateColumns = 'repeat(auto-fit, minmax(300px, 1fr))';\n container.style.gap = '24px';\n container.style.padding = '20px';\n container.style.backgroundColor = '#f5f5f5';\n container.style.borderRadius = '8px';\n\n const variations = [\n {\n items: [\n { label: 'Text White', value: '1', selected: true },\n { label: 'Opção 2', value: '2' },\n ],\n type: SulaSegmentedControlType.Text,\n color: SulaSegmentedControlColor.White,\n },\n {\n items: [\n { label: 'Text Gray', value: '1', selected: true },\n { label: 'Opção 2', value: '2' },\n ],\n type: SulaSegmentedControlType.Text,\n color: SulaSegmentedControlColor.Gray,\n },\n {\n items: [\n { icon: 'ph ph-house', value: '1', selected: true },\n { icon: 'ph ph-user', value: '2' },\n ],\n type: SulaSegmentedControlType.Icon,\n color: SulaSegmentedControlColor.White,\n },\n {\n items: [\n { icon: 'ph ph-house', value: '1', selected: true },\n { icon: 'ph ph-user', value: '2' },\n ],\n type: SulaSegmentedControlType.Icon,\n color: SulaSegmentedControlColor.Gray,\n },\n ];\n\n variations.forEach(variation => {\n const control = document.createElement('sula-segmented-control');\n control.items = variation.items;\n control.setAttribute('type', variation.type);\n control.setAttribute('color', variation.color);\n control.setAttribute('size', SulaSegmentedControlSize.Default);\n container.appendChild(control);\n });\n\n return container;\n};\nAllVariations.parameters = {\n docs: {\n description: {\n story: 'Visão geral de todas as combinações de tipo e cor.',\n },\n },\n};\n"]}
|
|
@@ -35,23 +35,23 @@ export class SulaSwitch {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
render() {
|
|
38
|
-
return (h(Host, { key: '
|
|
38
|
+
return (h(Host, { key: '5147ccb90d8e6a9b3de3eaa1ceefb3dd4e655f37' }, h("div", { key: 'ebae10c01afe26b23afcbaa86bab531fe56e617f', 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: '6e3132438518dee7a1337db52a204387d2828ec3', class: "flex flex-col flex-1 mr-16 overflow-hidden" }, !!this.label && h("label", { key: '830b2c235cc07efb236f6a86d90dd7d62b3b776a', class: "text-text-primary font-bold text-base cursor-pointer break-words" }, this.label), !!this.subTitle && h("span", { key: 'd085e4e303aad5b75d275d894f03b0e9ea201a47', class: "text-text-secondary text-base break-words" }, this.subTitle))), h("div", { key: 'ff6f20db45aa6c0050b233ff541f8973cd5f4244', 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: 'e43cca2e88a20a524201ed0d785a8ba81ed8a4f7', 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: '248043d5d4e7e53718563cc722937644362c47bf', 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: '7adccbc8b3035550420d5e0eac1d46f68052526d' }, h("div", { key: '65526b32c1e2db8888d70b79732526e7b0e20812', 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: '3808e66f0596f2e2f73520bfccb7504f4b20b6cf', 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: '88a00ebd5e3692d72f832d6fe5a1db74cb608334', icon: this.icon, "custom-class": "text-base text-negative-negative-1 leading-4" }))), h("span", { key: 'a8bfa714580e86bbc9972320a6ae9f9820076f5b', 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: 'f920e3734338d888531522bf9140c8d3982e2f69', ref: node => (this.node = node) }, h("div", { key: '2afeec5069358b61d7e5b26cb9aac627dd76f845' }, h("div", { key: '79273334d739ddf9d9be0ed536497764fa877ffc', 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: '10b0a9b82f07d8c9b8267d49f3c2d32e3c508bd8', 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: 'e3bed9dc020446dceb4149a667b60af5dc55bff3', 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: '1ba336d4bcf9c276b69b65c8165edc1b30a2490b', 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: '359a206d17995cec9bdbd3c9832de597827e1d0f', class: "flex justify-between items-center px-16 mt-4 text-sm" }, this.helpText && (h("div", { key: '64e46f682c87605bd793d0fffe0f74eea16931c3', 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: '761b430f847ea583d720570320f7fdbed53a5d6f', 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: '40a7bb18169b3d8970b45c694c1893ff9f64bbab', ref: node => (this.node = node) }, h("div", { key: '6777fa4dd7436443969d0c0e1142be8c4eb284e7' }, h("div", { key: 'd3d7789d4d36d65adedf1ad6b6e62c8957ebb680', 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: '956eadf48754f760e062d83663e32c47fcff1337', class: { 'hidden flex-col w-full': true, 'pr-12': !!this.icon }, ref: node => (this.inputContainer = node) }, h("label", { key: '99e202b916e25409144476a9c57fe75e0753f4ff', class: "font-bold text-sm text-text-primary from-down" }, this.label), h("input", { key: '1bac9e8fff8f951ca2dd2fcbc60b5efe97757254', 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: 'cb1626373a04dda96120a28bb982b72db41e3b4e', 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: '09050fd2dc99bc07a73565804a5332bddfa2883c', class: "flex items-center justify-center", onClick: this.handleIconClick }, h("sula-icon", { key: '120077ac071a88964d824f66117eb9b4a97ca93c', icon: this.getInputIcon(), customClass: `text-2xl ${this.disabled ? 'text-icon-disabled' : 'text-icon-primary'}` })))), (this.helpText || this.maxLength) && !this.disabled && (h("div", { key: 'e1cf2bd5e34d00125807f12d853c0630e1061434', class: "flex justify-between items-center px-16 mt-4 text-sm" }, this.helpText && (h("div", { key: 'fd485e6cd34d4a90df9f15e33359e5ed02c4bf82', 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: '70b2df0825f91a40db9e2e111c83947e8df6c7e9', 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: '77ee1e56a324ab1971d9e81288222087363bb4b6' }, h("div", { key: '88acc4015fcf2cbe96ad300b17428b6e06d713e1', 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: '7dc177fdc19ba097bd9cf686036817c883f25051' }, h("div", { key: '265a172c85656bdbd04ab2517f50b7fe5d558f82', 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,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const pages = [];
|
|
2
|
+
const globalAny = global;
|
|
3
|
+
const originalNewTestPage = globalAny.__NEW_TEST_PAGE__;
|
|
4
|
+
if (typeof originalNewTestPage === 'function') {
|
|
5
|
+
globalAny.__NEW_TEST_PAGE__ = async (...args) => {
|
|
6
|
+
const page = await originalNewTestPage(...args);
|
|
7
|
+
pages.push(page);
|
|
8
|
+
return page;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
afterEach(async () => {
|
|
12
|
+
const pagesToClose = [];
|
|
13
|
+
const keepAlivePages = [];
|
|
14
|
+
for (const page of pages) {
|
|
15
|
+
if (page.__keepAlive) {
|
|
16
|
+
keepAlivePages.push(page);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
pagesToClose.push(page);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
pages.length = 0;
|
|
23
|
+
pages.push(...keepAlivePages);
|
|
24
|
+
const closePromises = pagesToClose
|
|
25
|
+
.filter(page => page && typeof page.close === 'function')
|
|
26
|
+
.map(page => page.close().catch(() => {
|
|
27
|
+
// Ignore errors when the page is already closed.
|
|
28
|
+
}));
|
|
29
|
+
if (closePromises.length > 0) {
|
|
30
|
+
await Promise.all(closePromises);
|
|
31
|
+
}
|
|
32
|
+
// Clear stale element/event handles on keep-alive pages after each test.
|
|
33
|
+
for (const page of keepAlivePages) {
|
|
34
|
+
const pageAny = page;
|
|
35
|
+
if (Array.isArray(pageAny._e2eElements)) {
|
|
36
|
+
pageAny._e2eElements.length = 0;
|
|
37
|
+
}
|
|
38
|
+
if (pageAny._e2eEvents instanceof Map) {
|
|
39
|
+
pageAny._e2eEvents.clear();
|
|
40
|
+
}
|
|
41
|
+
if (typeof pageAny._e2eEventIds === 'number') {
|
|
42
|
+
pageAny._e2eEventIds = 0;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=e2e-setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2e-setup.js","sourceRoot":"","sources":["../../src/testing/e2e-setup.ts"],"names":[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AAC,CAAC;IACnC,CAAC;IAED,yEAAyE;IACzE,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,IAAW,CAAC;QAC5B,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;YACxC,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;QAClC,CAAC;QACD,IAAI,OAAO,CAAC,UAAU,YAAY,GAAG,EAAE,CAAC;YACtC,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QAC7B,CAAC;QACD,IAAI,OAAO,OAAO,CAAC,YAAY,KAAK,QAAQ,EAAE,CAAC;YAC7C,OAAO,CAAC,YAAY,GAAG,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;AACH,CAAC,CAAC,CAAC","sourcesContent":["import type { E2EPage } from '@stencil/core/testing';\n\nconst pages: E2EPage[] = [];\nconst globalAny = global as typeof global & { __NEW_TEST_PAGE__?: (...args: unknown[]) => Promise<E2EPage> };\nconst originalNewTestPage = globalAny.__NEW_TEST_PAGE__;\n\nif (typeof originalNewTestPage === 'function') {\n globalAny.__NEW_TEST_PAGE__ = async (...args: unknown[]) => {\n const page = await originalNewTestPage(...args);\n pages.push(page);\n return page;\n };\n}\n\nafterEach(async () => {\n const pagesToClose: E2EPage[] = [];\n const keepAlivePages: E2EPage[] = [];\n\n for (const page of pages) {\n if ((page as any).__keepAlive) {\n keepAlivePages.push(page);\n } else {\n pagesToClose.push(page);\n }\n }\n\n pages.length = 0;\n pages.push(...keepAlivePages);\n\n const closePromises = pagesToClose\n .filter(page => page && typeof page.close === 'function')\n .map(page =>\n page.close().catch(() => {\n // Ignore errors when the page is already closed.\n }),\n );\n\n if (closePromises.length > 0) {\n await Promise.all(closePromises);\n }\n\n // Clear stale element/event handles on keep-alive pages after each test.\n for (const page of keepAlivePages) {\n const pageAny = page as any;\n if (Array.isArray(pageAny._e2eElements)) {\n pageAny._e2eElements.length = 0;\n }\n if (pageAny._e2eEvents instanceof Map) {\n pageAny._e2eEvents.clear();\n }\n if (typeof pageAny._e2eEventIds === 'number') {\n pageAny._e2eEventIds = 0;\n }\n }\n});\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
-
import { d as defineCustomElement$1, a as SulaLoaderSize } from './p-
|
|
3
|
-
import { d as defineCustomElement$2 } from './p-
|
|
2
|
+
import { d as defineCustomElement$1, a as SulaLoaderSize } from './p-CkPiwCwQ.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './p-DO7voMbe.js';
|
|
4
4
|
|
|
5
5
|
var SulaButtonAppearance;
|
|
6
6
|
(function (SulaButtonAppearance) {
|
|
@@ -184,7 +184,7 @@ const SulaButton = /*@__PURE__*/ proxyCustomElement(class SulaButton extends H {
|
|
|
184
184
|
return SulaLoaderSize.Medium;
|
|
185
185
|
}
|
|
186
186
|
render() {
|
|
187
|
-
return (h(Host, { key: '
|
|
187
|
+
return (h(Host, { key: '1c1409076f20518df6a3a722d40f3ea80ca66f76' }, h("button", { key: '418ecd2a69e07eeccd8f9f42951ef4e7739e10d9', id: "button-container", class: this.getBaseButtonClass(), disabled: this.buttonDisabled || this.loading, onClick: this.handleClick }, this.loading && (h("div", { key: 'b3e1dce8d48638856806552e2dc1cd4d135673f6' }, h("sula-loader", { key: 'af9ea685849daf30b45518c6f13b71b9e9e48509', size: this.getLoadingSize() }))), !this.loading && (h("div", { key: 'f865dbf7286efb931c89b4fc366c2b2410b82516', class: "flex w-full justify-center items-center" }, this.leftIcon && h("sula-icon", { key: '24ced9ecfd42c590f884226ffb0d135164febeed', icon: this.leftIcon, customClass: "text-lg mr-8" }), this.renderIconContent(), this.renderTextContent(), this.renderArrowIcon(), this.rightIcon && h("sula-icon", { key: 'def421acb1a2d3e66fd0556e20ba9ddb7f2789e3', icon: this.rightIcon, customClass: "text-lg ml-8" }))))));
|
|
188
188
|
}
|
|
189
189
|
static get style() { return sulaButtonCss; }
|
|
190
190
|
}, [1, "sula-button", {
|
|
@@ -226,6 +226,6 @@ function defineCustomElement() {
|
|
|
226
226
|
defineCustomElement();
|
|
227
227
|
|
|
228
228
|
export { SulaButton as S, SulaButtonAppearance as a, defineCustomElement as d };
|
|
229
|
-
//# sourceMappingURL=p-
|
|
229
|
+
//# sourceMappingURL=p-CD0__3qt.js.map
|
|
230
230
|
|
|
231
|
-
//# sourceMappingURL=p-
|
|
231
|
+
//# sourceMappingURL=p-CD0__3qt.js.map
|