w-design-system 0.0.34 → 0.0.36
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/components/Paginate/index.d.ts +2 -1
- package/dist/components/Paginate/index.d.ts.map +1 -1
- package/dist/components/Paginate/index.js +8 -8
- package/dist/components/Paginate/index.js.map +1 -1
- package/dist/components/Paginate/stories.d.ts +1 -0
- package/dist/components/Paginate/stories.d.ts.map +1 -1
- package/dist/components/Paginate/stories.js +7 -2
- package/dist/components/Paginate/stories.js.map +1 -1
- package/dist/components/Paginate/styles.d.ts.map +1 -1
- package/dist/components/Paginate/styles.js +5 -38
- package/dist/components/Paginate/styles.js.map +1 -1
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +5 -5
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/stories.js +1 -0
- package/dist/components/Select/stories.js.map +1 -1
- package/dist/components/Sidebar/SidebarGroup/index.js +2 -2
- package/dist/components/Sidebar/SidebarGroup/index.js.map +1 -1
- package/dist/components/Sidebar/SidebarGroup/styles.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarGroup/styles.js +4 -6
- package/dist/components/Sidebar/SidebarGroup/styles.js.map +1 -1
- package/dist/components/Sidebar/SidebarItem/index.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarItem/index.js +8 -5
- package/dist/components/Sidebar/SidebarItem/index.js.map +1 -1
- package/dist/components/Sidebar/SidebarItem/styles.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarItem/styles.js +3 -1
- package/dist/components/Sidebar/SidebarItem/styles.js.map +1 -1
- package/dist/components/Sidebar/SidebarLogo/index.d.ts +2 -1
- package/dist/components/Sidebar/SidebarLogo/index.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarLogo/index.js +2 -2
- package/dist/components/Sidebar/SidebarLogo/index.js.map +1 -1
- package/dist/components/Sidebar/SidebarLogo/styles.d.ts +1 -0
- package/dist/components/Sidebar/SidebarLogo/styles.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarLogo/styles.js +3 -2
- package/dist/components/Sidebar/SidebarLogo/styles.js.map +1 -1
- package/dist/components/Sidebar/index.d.ts +2 -1
- package/dist/components/Sidebar/index.d.ts.map +1 -1
- package/dist/components/Sidebar/index.js +4 -3
- package/dist/components/Sidebar/index.js.map +1 -1
- package/dist/components/Sidebar/stories.d.ts.map +1 -1
- package/dist/components/Sidebar/stories.js +61 -3
- package/dist/components/Sidebar/stories.js.map +1 -1
- package/dist/components/Sidebar/styles.d.ts +1 -0
- package/dist/components/Sidebar/styles.d.ts.map +1 -1
- package/dist/components/Sidebar/styles.js +1 -2
- package/dist/components/Sidebar/styles.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Paginate/index.tsx +10 -6
- package/src/components/Paginate/stories.tsx +9 -3
- package/src/components/Paginate/styles.ts +5 -38
- package/src/components/Select/index.tsx +5 -3
- package/src/components/Select/stories.tsx +1 -1
- package/src/components/Sidebar/SidebarGroup/index.tsx +3 -3
- package/src/components/Sidebar/SidebarGroup/styles.ts +4 -6
- package/src/components/Sidebar/SidebarItem/index.tsx +15 -11
- package/src/components/Sidebar/SidebarItem/styles.ts +3 -1
- package/src/components/Sidebar/SidebarLogo/index.tsx +3 -2
- package/src/components/Sidebar/SidebarLogo/styles.ts +4 -2
- package/src/components/Sidebar/index.tsx +5 -3
- package/src/components/Sidebar/stories.tsx +88 -30
- package/src/components/Sidebar/styles.ts +2 -2
|
@@ -7,8 +7,65 @@ import { dashboardSVG } from '../../assets/icon'
|
|
|
7
7
|
const meta: Meta<typeof Sidebar> = {
|
|
8
8
|
title: 'Components/Sidebar',
|
|
9
9
|
tags: ['autodocs'],
|
|
10
|
-
|
|
11
10
|
component: Sidebar,
|
|
11
|
+
argTypes: {
|
|
12
|
+
layout: {
|
|
13
|
+
control: 'object',
|
|
14
|
+
description: 'Array of sidebar layout',
|
|
15
|
+
},
|
|
16
|
+
currentItemId: {
|
|
17
|
+
control: 'text',
|
|
18
|
+
description: 'Current item id',
|
|
19
|
+
},
|
|
20
|
+
currentGroupId: {
|
|
21
|
+
control: 'text',
|
|
22
|
+
description: 'Current group id',
|
|
23
|
+
},
|
|
24
|
+
setLink: {
|
|
25
|
+
action: 'setLink',
|
|
26
|
+
description: 'Function to set link',
|
|
27
|
+
},
|
|
28
|
+
items: {
|
|
29
|
+
control: 'object',
|
|
30
|
+
description: 'Items data',
|
|
31
|
+
},
|
|
32
|
+
groups: {
|
|
33
|
+
control: 'object',
|
|
34
|
+
description: 'Groups data',
|
|
35
|
+
},
|
|
36
|
+
logoUrl: {
|
|
37
|
+
control: 'text',
|
|
38
|
+
description: 'Logo url',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
args: {
|
|
42
|
+
layout: [
|
|
43
|
+
{
|
|
44
|
+
type: 'item',
|
|
45
|
+
id: 'DASHBOARD',
|
|
46
|
+
},
|
|
47
|
+
{ type: 'group', id: 'group1' },
|
|
48
|
+
],
|
|
49
|
+
currentItemId: 'DASHBOARD',
|
|
50
|
+
currentGroupId: 'DASHBOARD',
|
|
51
|
+
items: {
|
|
52
|
+
DASHBOARD: {
|
|
53
|
+
menuTitle: 'Dashboard',
|
|
54
|
+
icon: dashboardSVG,
|
|
55
|
+
link: '/dashboard',
|
|
56
|
+
disabled: true,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
groups: {
|
|
60
|
+
group1: {
|
|
61
|
+
name: 'Group 1',
|
|
62
|
+
icon: dashboardSVG,
|
|
63
|
+
itemIds: ['DASHBOARD'],
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
logoUrl: '',
|
|
67
|
+
baseColor: '',
|
|
68
|
+
},
|
|
12
69
|
} satisfies Meta<typeof Sidebar>
|
|
13
70
|
|
|
14
71
|
export default meta
|
|
@@ -16,36 +73,37 @@ export default meta
|
|
|
16
73
|
type Story = StoryObj<typeof Sidebar>
|
|
17
74
|
|
|
18
75
|
export const Playground: Story = {
|
|
19
|
-
render:
|
|
76
|
+
render: args => {
|
|
20
77
|
return (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
78
|
+
<Sidebar
|
|
79
|
+
{...args}
|
|
80
|
+
layout={[
|
|
81
|
+
{
|
|
82
|
+
type: 'item',
|
|
83
|
+
id: 'DASHBOARD',
|
|
84
|
+
},
|
|
85
|
+
{ type: 'group', id: 'group1' },
|
|
86
|
+
]}
|
|
87
|
+
items={{
|
|
88
|
+
DASHBOARD: {
|
|
89
|
+
menuTitle: 'Dashboard',
|
|
90
|
+
icon: dashboardSVG,
|
|
91
|
+
link: '/dashboard',
|
|
92
|
+
disabled: false,
|
|
93
|
+
},
|
|
94
|
+
}}
|
|
95
|
+
currentItemId={''}
|
|
96
|
+
currentGroupId={''}
|
|
97
|
+
setLink={action('setLink')}
|
|
98
|
+
groups={{
|
|
99
|
+
group1: {
|
|
100
|
+
name: 'Group 1',
|
|
101
|
+
icon: dashboardSVG,
|
|
102
|
+
itemIds: ['DASHBOARD'],
|
|
103
|
+
},
|
|
104
|
+
}}
|
|
105
|
+
logoUrl={''}
|
|
106
|
+
/>
|
|
49
107
|
)
|
|
50
108
|
},
|
|
51
109
|
}
|
|
@@ -3,6 +3,7 @@ import { theme } from '../Themes'
|
|
|
3
3
|
|
|
4
4
|
interface SidebarContainerProps {
|
|
5
5
|
sidebarOpen: boolean
|
|
6
|
+
baseColor?: string
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
export const SidebarContainer = styled.div<SidebarContainerProps>`
|
|
@@ -12,13 +13,12 @@ export const SidebarContainer = styled.div<SidebarContainerProps>`
|
|
|
12
13
|
position: relative;
|
|
13
14
|
box-sizing: border-box;
|
|
14
15
|
color: white;
|
|
15
|
-
background: ${theme.colors.cyan50};
|
|
16
16
|
height: 100vh;
|
|
17
17
|
height: 100dvh;
|
|
18
18
|
padding: 16px 16px 0 16px;
|
|
19
19
|
width: min-content;
|
|
20
20
|
border-radius: ${({ sidebarOpen }) => sidebarOpen && '0 60px 0px 0;'};
|
|
21
|
-
|
|
21
|
+
background: ${({ baseColor }) => baseColor || theme.colors.cyan50};
|
|
22
22
|
/* Mantenha o estilo do container ao passar o mouse */
|
|
23
23
|
&:hover {
|
|
24
24
|
&::-webkit-scrollbar {
|