ngx-opalbytes-components 1.20.0 → 1.21.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/cli/cao-comp.cjs +272 -2
- package/package.json +1 -1
- package/src/lib/shared/components/autocomplete/autocomplete.stories.ts +133 -0
- package/src/lib/shared/components/base-button/base-button.stories.ts +102 -0
- package/src/lib/shared/components/base-icon/base-icon.stories.ts +56 -0
- package/src/lib/shared/components/base-input/base-input.stories.ts +137 -0
- package/src/lib/shared/components/base-time-range/base-time-range.stories.ts +54 -0
- package/src/lib/shared/components/base-toggle/base-toggle.stories.ts +63 -0
- package/src/lib/shared/components/card/card.stories.ts +114 -0
- package/src/lib/shared/components/date-picker/date-picker.stories.ts +91 -0
- package/src/lib/shared/components/drop-down/drop-down.stories.ts +90 -0
- package/src/lib/shared/components/footer/footer.stories.ts +51 -0
- package/src/lib/shared/components/kpi/kpi.stories.ts +65 -0
- package/src/lib/shared/components/links-button/links-button.stories.ts +75 -0
- package/src/lib/shared/components/paginator/paginator.stories.ts +56 -0
- package/src/lib/shared/components/stepper/stepper.stories.ts +77 -0
- package/src/lib/shared/components/tab-group/tab-group.stories.ts +102 -0
- package/src/lib/shared/components/tab-panel/tab-panel.stories.ts +54 -0
- package/src/lib/shared/components/time-picker/time-picker.stories.ts +66 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/angular-vite';
|
|
2
|
+
import { fn } from 'storybook/test';
|
|
3
|
+
|
|
4
|
+
import { CaoBaseInput } from './base-input';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<CaoBaseInput> = {
|
|
7
|
+
title: 'Componentes/Base Input',
|
|
8
|
+
component: CaoBaseInput,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
type: {
|
|
12
|
+
control: 'select',
|
|
13
|
+
options: ['text', 'textarea', 'number', 'password', 'date'],
|
|
14
|
+
},
|
|
15
|
+
placeholder: { control: 'text' },
|
|
16
|
+
inputClass: { control: 'text' },
|
|
17
|
+
value: { control: 'text' },
|
|
18
|
+
errorMessage: { control: 'text' },
|
|
19
|
+
isDisabled: { control: 'boolean' },
|
|
20
|
+
maxLength: { control: { type: 'number', min: 1 } },
|
|
21
|
+
searchMode: { control: 'boolean' },
|
|
22
|
+
showBorder: { control: 'boolean' },
|
|
23
|
+
isLucideIcon: { control: 'boolean' },
|
|
24
|
+
iconColor: { control: 'color' },
|
|
25
|
+
mask: { control: 'text' },
|
|
26
|
+
tooltip: { control: 'text' },
|
|
27
|
+
dataCy: { control: 'text' },
|
|
28
|
+
textareaRows: { control: 'text' },
|
|
29
|
+
decimalMarker: { control: 'select', options: ['.', ','] },
|
|
30
|
+
thousandSeparator: { control: 'text' },
|
|
31
|
+
allowNegativeNumbers: { control: 'boolean' },
|
|
32
|
+
separatorLimit: { control: 'text' },
|
|
33
|
+
},
|
|
34
|
+
args: {
|
|
35
|
+
valueChange: fn(),
|
|
36
|
+
searchClick: fn(),
|
|
37
|
+
inputChange: fn(),
|
|
38
|
+
placeholder: 'Digite algo...',
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default meta;
|
|
43
|
+
type Story = StoryObj<CaoBaseInput>;
|
|
44
|
+
|
|
45
|
+
export const Padrao: Story = {
|
|
46
|
+
args: {
|
|
47
|
+
placeholder: 'Digite seu nome',
|
|
48
|
+
type: 'text',
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const ComLeadingIcon: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
placeholder: 'Buscar usuário',
|
|
55
|
+
type: 'text',
|
|
56
|
+
leadingIcon: 'Search',
|
|
57
|
+
isLucideIcon: true,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const ComTrailingIcon: Story = {
|
|
62
|
+
args: {
|
|
63
|
+
placeholder: 'Buscar usuário',
|
|
64
|
+
type: 'text',
|
|
65
|
+
trailingIcon: 'ChevronDown',
|
|
66
|
+
isLucideIcon: true,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const ComAmbosIcones: Story = {
|
|
71
|
+
args: {
|
|
72
|
+
placeholder: 'Valor monetário',
|
|
73
|
+
type: 'text',
|
|
74
|
+
leadingIcon: 'DollarSign',
|
|
75
|
+
trailingIcon: 'X',
|
|
76
|
+
isLucideIcon: true,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const PadraoComIconeSVG: Story = {
|
|
81
|
+
args: {
|
|
82
|
+
placeholder: 'Buscar',
|
|
83
|
+
type: 'text',
|
|
84
|
+
leadingIcon: 'https://lucide.dev/icons/search.svg',
|
|
85
|
+
isLucideIcon: false,
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const AreaDeTexto: Story = {
|
|
90
|
+
args: {
|
|
91
|
+
placeholder: 'Descreva o problema...',
|
|
92
|
+
type: 'textarea',
|
|
93
|
+
textareaRows: '4',
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const Senha: Story = {
|
|
98
|
+
args: {
|
|
99
|
+
placeholder: 'Digite sua senha',
|
|
100
|
+
type: 'password',
|
|
101
|
+
trailingIcon: 'Eye',
|
|
102
|
+
isLucideIcon: true,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const ModoSearch: Story = {
|
|
107
|
+
args: {
|
|
108
|
+
placeholder: 'Pesquisar itens...',
|
|
109
|
+
type: 'text',
|
|
110
|
+
searchMode: true,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export const Desabilitado: Story = {
|
|
115
|
+
args: {
|
|
116
|
+
placeholder: 'Campo desabilitado',
|
|
117
|
+
type: 'text',
|
|
118
|
+
isDisabled: true,
|
|
119
|
+
value: 'Valor bloqueado',
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const ComErro: Story = {
|
|
124
|
+
args: {
|
|
125
|
+
placeholder: 'Digite seu e-mail',
|
|
126
|
+
type: 'text',
|
|
127
|
+
errorMessage: 'E-mail obrigatório',
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export const ComMascara: Story = {
|
|
132
|
+
args: {
|
|
133
|
+
placeholder: '00.000.000/0000-00',
|
|
134
|
+
type: 'text',
|
|
135
|
+
mask: '00.000.000/0000-00',
|
|
136
|
+
},
|
|
137
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/angular-vite';
|
|
2
|
+
import { fn } from 'storybook/test';
|
|
3
|
+
|
|
4
|
+
import { BaseTimeRange } from './base-time-range';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<BaseTimeRange> = {
|
|
7
|
+
title: 'Componentes/Base Time Range',
|
|
8
|
+
component: BaseTimeRange,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
label: { control: 'text' },
|
|
12
|
+
dataCy: { control: 'text' },
|
|
13
|
+
controlName: { control: 'text' },
|
|
14
|
+
},
|
|
15
|
+
args: {
|
|
16
|
+
rangeSelected: fn(),
|
|
17
|
+
label: 'Período',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryObj<BaseTimeRange>;
|
|
23
|
+
|
|
24
|
+
export const Padrao: Story = {
|
|
25
|
+
args: {
|
|
26
|
+
label: 'Período de análise',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const ComMinimoEMaximo: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
label: 'Período de análise',
|
|
33
|
+
minDate: new Date(2026, 0, 1),
|
|
34
|
+
maxDate: new Date(2026, 11, 31),
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const ComInicioEFinal: Story = {
|
|
39
|
+
args: {
|
|
40
|
+
label: 'Período de análise',
|
|
41
|
+
startDate: new Date(2026, 2, 1),
|
|
42
|
+
finalDate: new Date(2026, 2, 15),
|
|
43
|
+
minDate: new Date(2026, 0, 1),
|
|
44
|
+
maxDate: new Date(2026, 11, 31),
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const ComDataCy: Story = {
|
|
49
|
+
args: {
|
|
50
|
+
label: 'Período de análise',
|
|
51
|
+
dataCy: 'time-range-analise',
|
|
52
|
+
controlName: 'periodo',
|
|
53
|
+
},
|
|
54
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/angular-vite';
|
|
2
|
+
import { fn } from 'storybook/test';
|
|
3
|
+
|
|
4
|
+
import { CaoBaseToggleComponent } from './base-toggle.component';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<CaoBaseToggleComponent> = {
|
|
7
|
+
title: 'Componentes/Base Toggle',
|
|
8
|
+
component: CaoBaseToggleComponent,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
isChecked: { control: 'boolean' },
|
|
12
|
+
checkedTextPlaceholder: { control: 'text' },
|
|
13
|
+
uncheckedTextPlaceholder: { control: 'text' },
|
|
14
|
+
isDisabled: { control: 'boolean' },
|
|
15
|
+
placeholder: { control: 'text' },
|
|
16
|
+
errorMessage: { control: 'text' },
|
|
17
|
+
},
|
|
18
|
+
args: {
|
|
19
|
+
statusChanged: fn(),
|
|
20
|
+
valueChange: fn(),
|
|
21
|
+
searchClick: fn(),
|
|
22
|
+
inputChange: fn(),
|
|
23
|
+
checkedTextPlaceholder: 'Ligado',
|
|
24
|
+
uncheckedTextPlaceholder: 'Desligado',
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
type Story = StoryObj<CaoBaseToggleComponent>;
|
|
30
|
+
|
|
31
|
+
export const Padrao: Story = {
|
|
32
|
+
args: {
|
|
33
|
+
isChecked: false,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Ativado: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
isChecked: true,
|
|
40
|
+
checkedTextPlaceholder: 'Módulo',
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const Desabilitado: Story = {
|
|
45
|
+
args: {
|
|
46
|
+
isChecked: true,
|
|
47
|
+
isDisabled: true,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const DesabilitadoSemChecagem: Story = {
|
|
52
|
+
args: {
|
|
53
|
+
isChecked: false,
|
|
54
|
+
isDisabled: true,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const ComPlaceholderPersonalizado: Story = {
|
|
59
|
+
args: {
|
|
60
|
+
isChecked: false,
|
|
61
|
+
uncheckedTextPlaceholder: 'Notificações push',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/angular-vite';
|
|
2
|
+
import { fn } from 'storybook/test';
|
|
3
|
+
|
|
4
|
+
import { CaoCardComponent, ICaoCardBadge, ICaoCardMeta } from './card.component';
|
|
5
|
+
|
|
6
|
+
const cardMeta: ICaoCardMeta[] = [
|
|
7
|
+
{ icon: 'https://lucide.dev/icons/eye.svg', label: 'Visualizações' },
|
|
8
|
+
{ icon: 'https://lucide.dev/icons/clock.svg', label: 'Última atualização' },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
const cardBadge: ICaoCardBadge = {
|
|
12
|
+
label: 'Novo',
|
|
13
|
+
color: 'text-white',
|
|
14
|
+
borderColor: 'border-green-600',
|
|
15
|
+
bg: '#22c55e',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const meta: Meta<CaoCardComponent> = {
|
|
19
|
+
title: 'Componentes/Card',
|
|
20
|
+
component: CaoCardComponent,
|
|
21
|
+
tags: ['autodocs'],
|
|
22
|
+
argTypes: {
|
|
23
|
+
variant: { control: 'select', options: ['horizontal', 'square'] },
|
|
24
|
+
title: { control: 'text' },
|
|
25
|
+
subtitle: { control: 'text' },
|
|
26
|
+
detail: { control: 'text' },
|
|
27
|
+
detailColor: { control: 'text' },
|
|
28
|
+
icon: { control: 'text' },
|
|
29
|
+
bgColor: { control: 'text' },
|
|
30
|
+
borderColor: { control: 'text' },
|
|
31
|
+
selected: { control: 'boolean' },
|
|
32
|
+
clickable: { control: 'boolean' },
|
|
33
|
+
cardClick: { action: 'cardClicked' },
|
|
34
|
+
},
|
|
35
|
+
args: {
|
|
36
|
+
cardClick: fn(),
|
|
37
|
+
title: 'Projeto Renova',
|
|
38
|
+
subtitle: 'Monitoramento de qualidade',
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default meta;
|
|
43
|
+
type Story = StoryObj<CaoCardComponent>;
|
|
44
|
+
|
|
45
|
+
export const Horizontal: Story = {
|
|
46
|
+
args: {
|
|
47
|
+
variant: 'horizontal',
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const HorizontalComIcone: Story = {
|
|
52
|
+
args: {
|
|
53
|
+
variant: 'horizontal',
|
|
54
|
+
icon: 'https://lucide.dev/icons/image.svg',
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const HorizontalComAvatar: Story = {
|
|
59
|
+
args: {
|
|
60
|
+
variant: 'horizontal',
|
|
61
|
+
avatar: { initials: 'OP', color: 'bg-indigo-500' },
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const HorizontalComDetalhe: Story = {
|
|
66
|
+
args: {
|
|
67
|
+
variant: 'horizontal',
|
|
68
|
+
detail: 'Detalhe adicional do card',
|
|
69
|
+
detailColor: 'text-amber-600',
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const ComBadge: Story = {
|
|
74
|
+
args: {
|
|
75
|
+
variant: 'horizontal',
|
|
76
|
+
badge: cardBadge,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const ComMeta: Story = {
|
|
81
|
+
args: {
|
|
82
|
+
variant: 'horizontal',
|
|
83
|
+
meta: cardMeta,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const Clicavel: Story = {
|
|
88
|
+
args: {
|
|
89
|
+
variant: 'horizontal',
|
|
90
|
+
clickable: true,
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const Selecionado: Story = {
|
|
95
|
+
args: {
|
|
96
|
+
variant: 'horizontal',
|
|
97
|
+
selected: true,
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const Quadrado: Story = {
|
|
102
|
+
args: {
|
|
103
|
+
variant: 'square',
|
|
104
|
+
title: 'KPIs',
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const QuadradoComIcone: Story = {
|
|
109
|
+
args: {
|
|
110
|
+
variant: 'square',
|
|
111
|
+
title: 'Análises',
|
|
112
|
+
icon: 'https://lucide.dev/icons/image.svg',
|
|
113
|
+
},
|
|
114
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/angular-vite';
|
|
2
|
+
import { fn } from 'storybook/test';
|
|
3
|
+
|
|
4
|
+
import { CaoDatePicker } from './date-picker';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<CaoDatePicker> = {
|
|
7
|
+
title: 'Componentes/Date Picker',
|
|
8
|
+
component: CaoDatePicker,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
placeholder: { control: 'text' },
|
|
12
|
+
inputClass: { control: 'text' },
|
|
13
|
+
errorMessage: { control: 'text' },
|
|
14
|
+
isDisabled: { control: 'boolean' },
|
|
15
|
+
searchMode: { control: 'boolean' },
|
|
16
|
+
showBorder: { control: 'boolean' },
|
|
17
|
+
isLucideIcon: { control: 'boolean' },
|
|
18
|
+
iconColor: { control: 'color' },
|
|
19
|
+
tooltip: { control: 'text' },
|
|
20
|
+
dataCy: { control: 'text' },
|
|
21
|
+
dateHint: { control: 'text' },
|
|
22
|
+
controlName: { control: 'text' },
|
|
23
|
+
openOnFocus: { control: 'boolean' },
|
|
24
|
+
minDate: { control: 'date' },
|
|
25
|
+
maxDate: { control: 'date' },
|
|
26
|
+
},
|
|
27
|
+
args: {
|
|
28
|
+
valueChange: fn(),
|
|
29
|
+
searchClick: fn(),
|
|
30
|
+
inputChange: fn(),
|
|
31
|
+
leadingIconClick: fn(),
|
|
32
|
+
trailingIconClick: fn(),
|
|
33
|
+
placeholder: 'Data de nascimento',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default meta;
|
|
38
|
+
type Story = StoryObj<CaoDatePicker>;
|
|
39
|
+
|
|
40
|
+
export const Padrao: Story = {
|
|
41
|
+
args: {
|
|
42
|
+
placeholder: 'Selecione uma data',
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const ComLeadingIcon: Story = {
|
|
47
|
+
args: {
|
|
48
|
+
placeholder: 'Selecione uma data',
|
|
49
|
+
leadingIcon: 'Calendar',
|
|
50
|
+
isLucideIcon: true,
|
|
51
|
+
iconColor: '#3b82f6',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const ComTrailingIcon: Story = {
|
|
56
|
+
args: {
|
|
57
|
+
placeholder: 'Selecione uma data',
|
|
58
|
+
trailingIcon: 'X',
|
|
59
|
+
isLucideIcon: true,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const ComDataMinimaEMaxima: Story = {
|
|
64
|
+
args: {
|
|
65
|
+
placeholder: 'Selecione uma data',
|
|
66
|
+
minDate: new Date(2026, 0, 1),
|
|
67
|
+
maxDate: new Date(2026, 11, 31),
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const ComDica: Story = {
|
|
72
|
+
args: {
|
|
73
|
+
placeholder: 'Selecione uma data',
|
|
74
|
+
dateHint: 'DD/MM/AAAA',
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const Desabilitado: Story = {
|
|
79
|
+
args: {
|
|
80
|
+
placeholder: 'Selecione uma data',
|
|
81
|
+
isDisabled: true,
|
|
82
|
+
value: new Date(2026, 0, 15),
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const ComErro: Story = {
|
|
87
|
+
args: {
|
|
88
|
+
placeholder: 'Selecione uma data',
|
|
89
|
+
errorMessage: 'Data obrigatória',
|
|
90
|
+
},
|
|
91
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/angular-vite';
|
|
2
|
+
import { fn } from 'storybook/test';
|
|
3
|
+
|
|
4
|
+
import { CaoDropDownComponent, ICaoDropDownOption } from './drop-down';
|
|
5
|
+
|
|
6
|
+
const defaultOptions: ICaoDropDownOption[] = [
|
|
7
|
+
{ id: 1, nome: 'Ativo' },
|
|
8
|
+
{ id: 2, nome: 'Inativo' },
|
|
9
|
+
{ id: 3, nome: 'Pendente' },
|
|
10
|
+
{ id: 4, nome: 'Suspenso' },
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
const optionsWithIcons: ICaoDropDownOption[] = [
|
|
14
|
+
{ id: 1, nome: 'Ativo', icon: 'check_circle' },
|
|
15
|
+
{ id: 2, nome: 'Inativo', icon: 'cancel' },
|
|
16
|
+
{ id: 3, nome: 'Pendente', icon: 'schedule' },
|
|
17
|
+
{ id: 4, nome: 'Suspenso', icon: 'block' },
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
const meta: Meta<CaoDropDownComponent> = {
|
|
21
|
+
title: 'Componentes/Drop Down',
|
|
22
|
+
component: CaoDropDownComponent,
|
|
23
|
+
tags: ['autodocs'],
|
|
24
|
+
argTypes: {
|
|
25
|
+
textHeader: { control: 'text' },
|
|
26
|
+
options: { control: 'object' },
|
|
27
|
+
dropDownClass: { control: 'text' },
|
|
28
|
+
isDisabled: { control: 'boolean' },
|
|
29
|
+
tooltip: { control: 'text' },
|
|
30
|
+
dropDirectionInput: { control: 'select', options: ['up', 'down'] },
|
|
31
|
+
dataCy: { control: 'text' },
|
|
32
|
+
ariaLabel: { control: 'text' },
|
|
33
|
+
ariaLabelledBy: { control: 'text' },
|
|
34
|
+
listAriaLabel: { control: 'text' },
|
|
35
|
+
},
|
|
36
|
+
args: {
|
|
37
|
+
itemSelected: fn(),
|
|
38
|
+
textHeader: 'SELECIONE UM ITEM',
|
|
39
|
+
options: defaultOptions,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default meta;
|
|
44
|
+
type Story = StoryObj<CaoDropDownComponent>;
|
|
45
|
+
|
|
46
|
+
export const Padrao: Story = {
|
|
47
|
+
args: {
|
|
48
|
+
textHeader: 'Selecione um status',
|
|
49
|
+
options: defaultOptions,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const ComIcones: Story = {
|
|
54
|
+
args: {
|
|
55
|
+
textHeader: 'Selecione um status',
|
|
56
|
+
options: optionsWithIcons,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const Desabilitado: Story = {
|
|
61
|
+
args: {
|
|
62
|
+
textHeader: 'Selecione um status',
|
|
63
|
+
options: defaultOptions,
|
|
64
|
+
isDisabled: true,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const AberturaParaCima: Story = {
|
|
69
|
+
args: {
|
|
70
|
+
textHeader: 'Selecione um status',
|
|
71
|
+
options: defaultOptions,
|
|
72
|
+
dropDirectionInput: 'up',
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const ComTooltip: Story = {
|
|
77
|
+
args: {
|
|
78
|
+
textHeader: 'Selecione um status',
|
|
79
|
+
options: defaultOptions,
|
|
80
|
+
tooltip: 'Escolha um dos status disponíveis',
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const ClassePersonalizada: Story = {
|
|
85
|
+
args: {
|
|
86
|
+
textHeader: 'Selecione um status',
|
|
87
|
+
options: defaultOptions,
|
|
88
|
+
dropDownClass: 'dropdown-secundary',
|
|
89
|
+
},
|
|
90
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/angular-vite';
|
|
2
|
+
|
|
3
|
+
import { Footer } from './footer';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<Footer> = {
|
|
6
|
+
title: 'Componentes/Footer',
|
|
7
|
+
component: Footer,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
argTypes: {
|
|
10
|
+
currentRoute: { control: 'text' },
|
|
11
|
+
footerText: { control: 'text' },
|
|
12
|
+
isFixed: { control: 'boolean' },
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
footerText: 'Opalbytes',
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
20
|
+
type Story = StoryObj<Footer>;
|
|
21
|
+
|
|
22
|
+
export const Padrao: Story = {
|
|
23
|
+
args: {
|
|
24
|
+
footerText: 'Opalbytes',
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const Fixo: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
footerText: 'Opalbytes',
|
|
31
|
+
isFixed: true,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const ComRota: Story = {
|
|
36
|
+
args: {
|
|
37
|
+
footerText: 'Opalbytes',
|
|
38
|
+
currentRoute: '/dashboard',
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const ComConteudo: Story = {
|
|
43
|
+
render: (args) => ({
|
|
44
|
+
template: `
|
|
45
|
+
<cao-footer [currentRoute]="currentRoute" [footerText]="footerText" [isFixed]="isFixed">
|
|
46
|
+
<div>Links úteis: <a href="#">Termos</a> | <a href="#">Privacidade</a></div>
|
|
47
|
+
</cao-footer>
|
|
48
|
+
`,
|
|
49
|
+
props: args,
|
|
50
|
+
}),
|
|
51
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/angular-vite';
|
|
2
|
+
|
|
3
|
+
import { CaoKpi, ICaoKPI } from './kpi';
|
|
4
|
+
|
|
5
|
+
const defaultKpi: ICaoKPI = {
|
|
6
|
+
title: 'Faturamento',
|
|
7
|
+
value: 'R$ 128.450,00',
|
|
8
|
+
textColor: '#111827',
|
|
9
|
+
borderColor: '#e5e7eb',
|
|
10
|
+
icon: {
|
|
11
|
+
src: 'https://lucide.dev/icons/trending-up.svg',
|
|
12
|
+
alt: 'ícone de tendência',
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const meta: Meta<CaoKpi> = {
|
|
17
|
+
title: 'Componentes/KPI',
|
|
18
|
+
component: CaoKpi,
|
|
19
|
+
tags: ['autodocs'],
|
|
20
|
+
argTypes: {
|
|
21
|
+
kpiData: { control: 'object' },
|
|
22
|
+
},
|
|
23
|
+
args: {
|
|
24
|
+
kpiData: defaultKpi,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
type Story = StoryObj<CaoKpi>;
|
|
30
|
+
|
|
31
|
+
export const Padrao: Story = {
|
|
32
|
+
args: {
|
|
33
|
+
kpiData: defaultKpi,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Sucesso: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
kpiData: {
|
|
40
|
+
title: 'Meta de vendas',
|
|
41
|
+
value: '87%',
|
|
42
|
+
textColor: '#16a34a',
|
|
43
|
+
borderColor: '#16a34a',
|
|
44
|
+
icon: {
|
|
45
|
+
src: 'https://lucide.dev/icons/check-circle.svg',
|
|
46
|
+
alt: 'ícone de sucesso',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const Alerta: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
kpiData: {
|
|
55
|
+
title: 'Pedidos pendentes',
|
|
56
|
+
value: '32',
|
|
57
|
+
textColor: '#dc2626',
|
|
58
|
+
borderColor: '#dc2626',
|
|
59
|
+
icon: {
|
|
60
|
+
src: 'https://lucide.dev/icons/alert-triangle.svg',
|
|
61
|
+
alt: 'ícone de alerta',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
};
|