@orbe-agro/client-core 5.6.123 → 5.6.124
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/@ecme/assets/styles/app.css +15 -0
- package/dist/@ecme/assets/styles/tailwind/index.css +15 -0
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalMenuContent.js +31 -6
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalMenuContent.js.map +1 -1
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalMenuContent.stories.js +234 -0
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalMenuContent.stories.js.map +1 -0
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalSingleMenuItem.js +18 -40
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalSingleMenuItem.js.map +1 -1
- package/dist/@ecme/components/ui/Button/Button.stories.js +17 -0
- package/dist/@ecme/components/ui/Button/Button.stories.js.map +1 -0
- package/dist/@types/@ecme/components/template/VerticalMenuContent/VerticalMenuContent.d.ts +3 -3
- package/dist/@types/@ecme/components/template/VerticalMenuContent/VerticalMenuContent.d.ts.map +1 -1
- package/dist/@types/@ecme/components/template/VerticalMenuContent/VerticalSingleMenuItem.d.ts +3 -3
- package/dist/@types/@ecme/components/template/VerticalMenuContent/VerticalSingleMenuItem.d.ts.map +1 -1
- package/dist/@types/@ecme/components/ui/Button/Button.stories.d.ts +9 -0
- package/dist/@types/@ecme/components/ui/Button/Button.stories.d.ts.map +1 -0
- package/dist/base/assets/styles/init.css +15 -0
- package/lib/@ecme/components/template/VerticalMenuContent/VerticalMenuContent.stories.tsx +244 -0
- package/lib/@ecme/components/template/VerticalMenuContent/VerticalMenuContent.tsx +203 -172
- package/lib/@ecme/components/template/VerticalMenuContent/VerticalSingleMenuItem.tsx +135 -157
- package/lib/@ecme/components/ui/Button/Button.stories.tsx +22 -0
- package/package.json +9 -1
package/dist/@types/@ecme/components/template/VerticalMenuContent/VerticalSingleMenuItem.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CommonProps } from
|
|
2
|
-
import type { Direction } from
|
|
3
|
-
import type { NavigationTree } from
|
|
1
|
+
import type { CommonProps } from '@/@types/common';
|
|
2
|
+
import type { Direction } from '@/@types/theme';
|
|
3
|
+
import type { NavigationTree } from '@/@types/navigation';
|
|
4
4
|
type LinkRenderer = (nav: NavigationTree, children: React.ReactNode) => React.ReactNode;
|
|
5
5
|
interface CollapsedItemProps extends CommonProps {
|
|
6
6
|
nav: NavigationTree;
|
package/dist/@types/@ecme/components/template/VerticalMenuContent/VerticalSingleMenuItem.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerticalSingleMenuItem.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/components/template/VerticalMenuContent/VerticalSingleMenuItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VerticalSingleMenuItem.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/components/template/VerticalMenuContent/VerticalSingleMenuItem.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAIzD,KAAK,YAAY,GAAG,CAChB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,KACxB,KAAK,CAAC,SAAS,CAAA;AAEpB,UAAU,kBAAmB,SAAQ,WAAW;IAC5C,GAAG,EAAE,cAAc,CAAA;IACnB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IAC1E,CAAC,EAAE,CACC,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAClD,MAAM,CAAA;IACX,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACxB;AAED,UAAU,gBAAgB;IACtB,GAAG,EAAE,cAAc,CAAA;IACnB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IAC1E,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,CAAC,EAAE,CACC,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAClD,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,YAAY,CAAC,EAAE,YAAY,CAAA;CAC9B;AAED,UAAU,qBAAsB,SAAQ,kBAAkB,EAAE,gBAAgB;CAAG;AAyE/E,QAAA,MAAM,sBAAsB,GAAI,OAAO,qBAAqB,4CAoC3D,CAAA;AACD,eAAe,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: (props: import("./Button").ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export default meta;
|
|
7
|
+
type TStory = StoryObj<typeof meta>;
|
|
8
|
+
export declare const Sandbox: TStory;
|
|
9
|
+
//# sourceMappingURL=Button.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/components/ui/Button/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAK3D,QAAA,MAAM,IAAI;;;CAGqB,CAAA;AAG/B,eAAe,IAAI,CAAA;AAGnB,KAAK,MAAM,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAEnC,eAAO,MAAM,OAAO,EAAE,MAKrB,CAAA"}
|
|
@@ -4493,6 +4493,9 @@ hr:is(.dark *){
|
|
|
4493
4493
|
.-left-2{
|
|
4494
4494
|
left: -0.5rem;
|
|
4495
4495
|
}
|
|
4496
|
+
.-left-3{
|
|
4497
|
+
left: -0.75rem;
|
|
4498
|
+
}
|
|
4496
4499
|
.-right-2{
|
|
4497
4500
|
right: -0.5rem;
|
|
4498
4501
|
}
|
|
@@ -4553,6 +4556,9 @@ hr:is(.dark *){
|
|
|
4553
4556
|
.z-10{
|
|
4554
4557
|
z-index: 10;
|
|
4555
4558
|
}
|
|
4559
|
+
.z-20{
|
|
4560
|
+
z-index: 20;
|
|
4561
|
+
}
|
|
4556
4562
|
.z-30{
|
|
4557
4563
|
z-index: 30;
|
|
4558
4564
|
}
|
|
@@ -5269,6 +5275,9 @@ hr:is(.dark *){
|
|
|
5269
5275
|
.min-w-\[330px\]{
|
|
5270
5276
|
min-width: 330px;
|
|
5271
5277
|
}
|
|
5278
|
+
.min-w-\[calc\(100\%\+1\.5rem\)\]{
|
|
5279
|
+
min-width: calc(100% + 1.5rem);
|
|
5280
|
+
}
|
|
5272
5281
|
.min-w-full{
|
|
5273
5282
|
min-width: 100%;
|
|
5274
5283
|
}
|
|
@@ -7101,6 +7110,9 @@ hr:is(.dark *){
|
|
|
7101
7110
|
.active\:bg-gray-100:active{
|
|
7102
7111
|
background-color: var(--gray-100);
|
|
7103
7112
|
}
|
|
7113
|
+
.group\/item:hover .group-hover\/item\:block{
|
|
7114
|
+
display: block;
|
|
7115
|
+
}
|
|
7104
7116
|
.group:hover .group-hover\:block{
|
|
7105
7117
|
display: block;
|
|
7106
7118
|
}
|
|
@@ -7145,6 +7157,9 @@ hr:is(.dark *){
|
|
|
7145
7157
|
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
|
|
7146
7158
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
7147
7159
|
}
|
|
7160
|
+
.group\/item:focus-visible .group-focus-visible\/item\:block{
|
|
7161
|
+
display: block;
|
|
7162
|
+
}
|
|
7148
7163
|
.group.active .group-\[\.active\]\:bg-white{
|
|
7149
7164
|
--tw-bg-opacity: 1;
|
|
7150
7165
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { BrowserRouter } from 'react-router-dom'
|
|
3
|
+
import VerticalMenuContent from './VerticalMenuContent'
|
|
4
|
+
import type { NavigationTree } from '@/@types/navigation'
|
|
5
|
+
import {
|
|
6
|
+
NAV_ITEM_TYPE_COLLAPSE,
|
|
7
|
+
NAV_ITEM_TYPE_ITEM,
|
|
8
|
+
} from '@/constants/navigation.constant'
|
|
9
|
+
|
|
10
|
+
const mockNavigationTree: NavigationTree[] = [
|
|
11
|
+
{
|
|
12
|
+
key: 'inicio',
|
|
13
|
+
path: '/inicio',
|
|
14
|
+
title: 'Início',
|
|
15
|
+
translateKey: 'nav.inicio',
|
|
16
|
+
icon: '',
|
|
17
|
+
type: NAV_ITEM_TYPE_ITEM,
|
|
18
|
+
authority: ['/inicio'],
|
|
19
|
+
subMenu: [],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
key: 'cadastros',
|
|
23
|
+
path: '',
|
|
24
|
+
title: 'Cadastros',
|
|
25
|
+
translateKey: 'nav.cadastros',
|
|
26
|
+
icon: '',
|
|
27
|
+
type: NAV_ITEM_TYPE_COLLAPSE,
|
|
28
|
+
authority: ['/cadastros'],
|
|
29
|
+
subMenu: [
|
|
30
|
+
{
|
|
31
|
+
key: 'clientes',
|
|
32
|
+
path: '/cadastros/clientes',
|
|
33
|
+
title: 'Clientes',
|
|
34
|
+
translateKey: 'nav.clientes',
|
|
35
|
+
icon: '',
|
|
36
|
+
type: NAV_ITEM_TYPE_ITEM,
|
|
37
|
+
authority: ['/cadastros/clientes'],
|
|
38
|
+
subMenu: [],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: 'fornecedores',
|
|
42
|
+
path: '/cadastros/fornecedores',
|
|
43
|
+
title: 'Fornecedores',
|
|
44
|
+
translateKey: 'nav.fornecedores',
|
|
45
|
+
icon: '',
|
|
46
|
+
type: NAV_ITEM_TYPE_ITEM,
|
|
47
|
+
authority: ['/cadastros/fornecedores'],
|
|
48
|
+
subMenu: [],
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
key: 'relatorios',
|
|
54
|
+
path: '/relatorios',
|
|
55
|
+
title: 'Relatórios',
|
|
56
|
+
translateKey: 'nav.relatorios',
|
|
57
|
+
icon: 'ChartBarIcon',
|
|
58
|
+
type: NAV_ITEM_TYPE_ITEM,
|
|
59
|
+
authority: ['/relatorios'],
|
|
60
|
+
subMenu: [],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
key: 'configuracoes',
|
|
64
|
+
path: '',
|
|
65
|
+
title: 'Configurações',
|
|
66
|
+
translateKey: 'nav.configuracoes',
|
|
67
|
+
icon: '',
|
|
68
|
+
type: NAV_ITEM_TYPE_COLLAPSE,
|
|
69
|
+
authority: ['/configuracoes'],
|
|
70
|
+
subMenu: [
|
|
71
|
+
{
|
|
72
|
+
key: 'perfil',
|
|
73
|
+
path: '/configuracoes/perfil',
|
|
74
|
+
title: 'Perfil',
|
|
75
|
+
translateKey: 'nav.perfil',
|
|
76
|
+
icon: '',
|
|
77
|
+
type: NAV_ITEM_TYPE_ITEM,
|
|
78
|
+
authority: ['/configuracoes/perfil'],
|
|
79
|
+
subMenu: [],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
key: 'integracoes',
|
|
83
|
+
path: '',
|
|
84
|
+
title: 'Integrações',
|
|
85
|
+
translateKey: 'nav.integracoes',
|
|
86
|
+
icon: '',
|
|
87
|
+
type: NAV_ITEM_TYPE_COLLAPSE,
|
|
88
|
+
authority: ['/configuracoes/integracoes'],
|
|
89
|
+
subMenu: [
|
|
90
|
+
{
|
|
91
|
+
key: 'webhooks',
|
|
92
|
+
path: '/configuracoes/integracoes/webhooks',
|
|
93
|
+
title: 'Webhooks',
|
|
94
|
+
translateKey: 'nav.webhooks',
|
|
95
|
+
icon: 'WebhookIcon',
|
|
96
|
+
type: NAV_ITEM_TYPE_ITEM,
|
|
97
|
+
authority: ['/configuracoes/integracoes/webhooks'],
|
|
98
|
+
subMenu: [],
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
key: 'lorem.ipsum',
|
|
102
|
+
path: '/configuracoes/integracoes/lorem-ipsum',
|
|
103
|
+
title: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
|
|
104
|
+
translateKey: 'nav.loremIpsum',
|
|
105
|
+
icon: 'LoremIpsumIcon',
|
|
106
|
+
type: NAV_ITEM_TYPE_ITEM,
|
|
107
|
+
authority: ['/configuracoes/integracoes/lorem-ipsum'],
|
|
108
|
+
subMenu: [],
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
]
|
|
115
|
+
|
|
116
|
+
const allUserAuthority = [
|
|
117
|
+
'/inicio',
|
|
118
|
+
'/cadastros/clientes',
|
|
119
|
+
'/cadastros/fornecedores',
|
|
120
|
+
'/relatorios',
|
|
121
|
+
'/configuracoes/perfil',
|
|
122
|
+
'/configuracoes/integracoes/webhooks',
|
|
123
|
+
'/configuracoes/integracoes/lorem-ipsum',
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
const meta = {
|
|
127
|
+
title: '@ecme/Template/VerticalMenuContent',
|
|
128
|
+
component: VerticalMenuContent,
|
|
129
|
+
parameters: {
|
|
130
|
+
layout: 'padded',
|
|
131
|
+
},
|
|
132
|
+
tags: ['autodocs'],
|
|
133
|
+
decorators: [
|
|
134
|
+
(Story) => (
|
|
135
|
+
<BrowserRouter>
|
|
136
|
+
<Story />
|
|
137
|
+
</BrowserRouter>
|
|
138
|
+
),
|
|
139
|
+
],
|
|
140
|
+
argTypes: {
|
|
141
|
+
collapsed: {
|
|
142
|
+
control: 'boolean',
|
|
143
|
+
},
|
|
144
|
+
direction: {
|
|
145
|
+
control: { type: 'select' },
|
|
146
|
+
options: ['ltr', 'rtl'],
|
|
147
|
+
},
|
|
148
|
+
routeKey: {
|
|
149
|
+
control: 'text',
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
} satisfies Meta<typeof VerticalMenuContent>
|
|
153
|
+
|
|
154
|
+
export default meta
|
|
155
|
+
type TStory = StoryObj<typeof meta>
|
|
156
|
+
|
|
157
|
+
export const Default: TStory = {
|
|
158
|
+
args: {
|
|
159
|
+
collapsed: false,
|
|
160
|
+
routeKey: '/inicio',
|
|
161
|
+
navigationTree: mockNavigationTree,
|
|
162
|
+
userAuthority: allUserAuthority,
|
|
163
|
+
direction: 'ltr',
|
|
164
|
+
translationSetup: true,
|
|
165
|
+
},
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export const Collapsed: TStory = {
|
|
169
|
+
args: {
|
|
170
|
+
collapsed: true,
|
|
171
|
+
routeKey: '/cadastros/clientes',
|
|
172
|
+
navigationTree: mockNavigationTree,
|
|
173
|
+
userAuthority: allUserAuthority,
|
|
174
|
+
direction: 'ltr',
|
|
175
|
+
translationSetup: true,
|
|
176
|
+
},
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export const WithExpandedMenu: TStory = {
|
|
180
|
+
args: {
|
|
181
|
+
collapsed: false,
|
|
182
|
+
routeKey: '/configuracoes/integracoes/webhooks',
|
|
183
|
+
navigationTree: mockNavigationTree,
|
|
184
|
+
userAuthority: allUserAuthority,
|
|
185
|
+
direction: 'ltr',
|
|
186
|
+
translationSetup: true,
|
|
187
|
+
},
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export const LimitedAuthority: TStory = {
|
|
191
|
+
args: {
|
|
192
|
+
collapsed: false,
|
|
193
|
+
routeKey: '/inicio',
|
|
194
|
+
navigationTree: mockNavigationTree,
|
|
195
|
+
userAuthority: ['/inicio', '/relatorios'],
|
|
196
|
+
direction: 'ltr',
|
|
197
|
+
translationSetup: true,
|
|
198
|
+
},
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export const RTLDirection: TStory = {
|
|
202
|
+
args: {
|
|
203
|
+
collapsed: false,
|
|
204
|
+
routeKey: '/inicio',
|
|
205
|
+
navigationTree: mockNavigationTree,
|
|
206
|
+
userAuthority: allUserAuthority,
|
|
207
|
+
direction: 'rtl',
|
|
208
|
+
translationSetup: true,
|
|
209
|
+
},
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export const MinimalNavigation: TStory = {
|
|
213
|
+
args: {
|
|
214
|
+
collapsed: false,
|
|
215
|
+
routeKey: '/inicio',
|
|
216
|
+
navigationTree: [
|
|
217
|
+
{
|
|
218
|
+
key: 'inicio',
|
|
219
|
+
path: '/inicio',
|
|
220
|
+
title: 'Início',
|
|
221
|
+
translateKey: 'nav.inicio',
|
|
222
|
+
icon: '',
|
|
223
|
+
type: NAV_ITEM_TYPE_ITEM,
|
|
224
|
+
authority: ['/inicio'],
|
|
225
|
+
subMenu: [],
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
userAuthority: ['/inicio'],
|
|
229
|
+
direction: 'ltr',
|
|
230
|
+
translationSetup: true,
|
|
231
|
+
},
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export const WithMenuClick: TStory = {
|
|
235
|
+
args: {
|
|
236
|
+
collapsed: false,
|
|
237
|
+
routeKey: '/inicio',
|
|
238
|
+
navigationTree: mockNavigationTree,
|
|
239
|
+
userAuthority: allUserAuthority,
|
|
240
|
+
direction: 'ltr',
|
|
241
|
+
translationSetup: true,
|
|
242
|
+
onMenuItemClick: () => alert('Menu item clicked!'),
|
|
243
|
+
},
|
|
244
|
+
}
|