@flux-ui/dashboard 3.0.0-next.0 → 3.0.0-next.10

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.
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <aside :class="$style.dashboardMenu">
2
+ <aside :class="[$style.dashboardMenu, isMenuCollapsed && $style.dashboardMenuCollapsed]">
3
3
  <FluxDashboardTopBar>
4
4
  <slot name="top-bar-start"/>
5
5
 
@@ -25,11 +25,14 @@
25
25
  setup>
26
26
  import { FluxIcon, FluxSpacer } from '@flux-ui/components';
27
27
  import type { FluxIconName } from '@flux-ui/types';
28
+ import { useDashboardInjection } from '$fluxDashboard/composable';
28
29
  import FluxDashboardTopBar from './FluxDashboardTopBar.vue';
29
- import $style from '$fluxDashboard/css/component/Dashboard.module.scss';
30
+ import $style from '$fluxDashboard/css/component/DashboardPane.module.scss';
30
31
 
31
32
  defineProps<{
32
33
  readonly icon?: FluxIconName;
33
34
  readonly title: string;
34
35
  }>();
36
+
37
+ const {isMenuCollapsed} = useDashboardInjection();
35
38
  </script>
@@ -1,31 +1,44 @@
1
1
  <template>
2
- <div
3
- v-for="index of 2"
4
- :key="index"
5
- :class="isNavigationCollapsed ? $style.dashboardNavigationRoundingFixCollapsed : $style.dashboardNavigationRoundingFix"/>
6
-
7
2
  <nav
8
3
  v-bind="$attrs"
9
4
  :class="isNavigationCollapsed ? $style.dashboardNavigationCollapsed : $style.dashboardNavigation">
10
- <router-link
11
- v-if="slots.logo"
12
- :class="$style.dashboardNavigationLogo"
13
- :to="logoLocation || '/'">
14
- <slot
15
- name="logo"
16
- v-bind="{isNavigationCollapsed}"/>
17
- </router-link>
18
-
19
- <slot/>
5
+ <header :class="$style.dashboardNavigationHeader">
6
+ <FluxMenuItem
7
+ icon-leading="bars"
8
+ @click="isNavigationCollapsed = !isNavigationCollapsed"/>
9
+
10
+ <router-link
11
+ v-if="slots.logo"
12
+ :class="$style.dashboardNavigationLogo"
13
+ :to="logoLocation || '/'">
14
+ <slot
15
+ name="logo"
16
+ v-bind="{isNavigationCollapsed}"/>
17
+ </router-link>
18
+
19
+ <FluxMenuItem
20
+ icon-leading="ellipsis-h"
21
+ @click="isMenuCollapsed = !isMenuCollapsed"/>
22
+ </header>
23
+
24
+ <div
25
+ v-for="index of 2"
26
+ :key="index"
27
+ :class="$style.dashboardNavigationRoundingFix"/>
28
+
29
+ <main :class="$style.dashboardNavigationNav">
30
+ <slot/>
31
+ </main>
20
32
  </nav>
21
33
  </template>
22
34
 
23
35
  <script
24
36
  lang="ts"
25
37
  setup>
38
+ import { FluxMenuItem } from '@flux-ui/components';
26
39
  import type { FluxTo } from '@flux-ui/types';
27
40
  import { useDashboardInjection } from '$fluxDashboard/composable';
28
- import $style from '$fluxDashboard/css/component/Dashboard.module.scss';
41
+ import $style from '$fluxDashboard/css/component/DashboardNavigation.module.scss';
29
42
 
30
43
  defineOptions({
31
44
  inheritAttrs: false
@@ -40,5 +53,8 @@
40
53
  logo?(): any;
41
54
  }>();
42
55
 
43
- const {isNavigationCollapsed} = useDashboardInjection();
56
+ const {
57
+ isMenuCollapsed,
58
+ isNavigationCollapsed
59
+ } = useDashboardInjection();
44
60
  </script>
@@ -19,7 +19,7 @@
19
19
  setup>
20
20
  import { FluxSpacer } from '@flux-ui/components';
21
21
  import FluxDashboardTopBar from './FluxDashboardTopBar.vue';
22
- import $style from '$fluxDashboard/css/component/Dashboard.module.scss';
22
+ import $style from '$fluxDashboard/css/component/DashboardPane.module.scss';
23
23
 
24
24
  defineProps<{
25
25
  readonly title: string;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <header :class="$style.dashboardTopBar">
2
+ <header :class="[$style.dashboardTopBar, !isMenuCollapsed && $style.dashboardTopBarCollapsed]">
3
3
  <slot/>
4
4
  </header>
5
5
  </template>
@@ -7,5 +7,8 @@
7
7
  <script
8
8
  lang="ts"
9
9
  setup>
10
- import $style from '$fluxDashboard/css/component/Dashboard.module.scss';
10
+ import { useDashboardInjection } from '$fluxDashboard/composable';
11
+ import $style from '$fluxDashboard/css/component/DashboardTopBar.module.scss';
12
+
13
+ const {isMenuCollapsed} = useDashboardInjection();
11
14
  </script>
@@ -1,323 +1,68 @@
1
- .dashboard {
2
- --dashboard-navigation-background: rgb(var(--primary-11));
3
-
4
- display: grid;
5
- min-height: 100vh;
6
- grid-template-columns: auto minmax(0, 1fr);
7
- background: rgb(var(--gray-0));
8
-
9
- &:has(> .dashboardMenu) {
10
- grid-template-columns: auto 300px minmax(0, 1fr);
11
- }
12
-
13
- &:has(> .dashboardSide) {
14
- grid-template-columns: auto minmax(0, 1fr) 330px;
15
- }
1
+ @use '../../../../components/src/css/mixin';
16
2
 
17
- &:has(> .dashboardMenu):has(> .dashboardSide) {
18
- grid-template-columns: auto 300px minmax(0, 1fr) 330px;
19
- }
20
-
21
- .notice.isFluid + .dashboardContent:not(:has(> .table:first-child)) {
22
- padding-top: 30px;
23
- }
24
-
25
- .notice.isFluid + .dashboardContent > .table:first-child {
26
- border-top: 0;
27
- }
3
+ :root {
4
+ --dashboard-background: rgb(var(--gray-0));
5
+ --dashboard-duration: 360ms;
6
+ --dashboard-navigation-background: rgb(var(--primary-11));
7
+ --dashboard-navigation-foreground: rgb(var(--primary-0));
28
8
  }
29
9
 
30
- [dark] .dashboard {
10
+ [dark] {
31
11
  --dashboard-navigation-background: color-mix(in srgb, rgb(var(--gray-0)), black 50%);
32
12
  }
33
13
 
34
- .dashboardBody {
35
- position: relative;
36
- display: flex;
37
- flex-flow: column;
38
- flex-grow: 1;
39
- }
40
-
41
- .dashboardContent {
42
- display: flex;
43
- padding: 0 30px;
44
- flex-flow: column;
45
- flex-grow: 1;
46
-
47
- > :is(.calendar, .table) {
48
- margin-left: -30px;
49
- margin-right: -30px;
50
- height: calc(100dvh - 84px);
51
- flex-grow: 1;
52
- }
53
-
54
- > .calendar {
55
- border-left: 0;
56
- border-right: 0;
57
- border-radius: 0;
58
-
59
- .calendarActions {
60
- padding-left: 30px;
61
- padding-right: 30px;
62
- }
63
- }
64
-
65
- > .table {
66
- border-top: 1px solid rgb(var(--gray-3));
67
-
68
- .tableCell:first-child .tableCellContent {
69
- padding-left: 30px;
70
- }
71
-
72
- .tableCell:last-child .tableCellContent {
73
- padding-right: 30px;
74
- }
75
- }
76
- }
77
-
78
- .dashboardPane {
79
- position: sticky;
80
- top: 0;
81
- height: 100dvh;
82
- flex-shrink: 0;
83
- background: rgb(var(--gray-1));
84
- overflow: auto;
85
-
86
- .menuSubHeader {
87
- background: linear-gradient(to bottom, rgb(var(--gray-1)) 75%, transparent);
88
- }
89
-
90
- .dashboardTopBar {
91
- background: rgb(var(--gray-1) / .9);
92
- }
93
-
94
- .filter {
95
- --background: rgb(var(--gray-1));
96
-
97
- max-height: calc(100dvh - 84px);
98
- margin-top: -9px;
99
- padding: 9px 18px 18px;
100
- width: 100%;
101
-
102
- .filterHeader {
103
- margin-left: -18px;
104
- margin-right: -18px;
105
- padding-left: 18px;
106
- padding-right: 18px;
107
- }
108
-
109
- .menu {
110
- font-size: 14px;
111
- }
112
-
113
- .menuItemCommand {
114
- font-size: 12px;
115
- }
116
-
117
- .menuItemIcon {
118
- font-size: 16px;
119
- }
120
-
121
- .menu > :where(.divider, .separator) {
122
- margin-left: -18px;
123
- margin-right: -18px;
124
- }
125
- }
126
- }
127
-
128
- .dashboardMenu {
129
- composes: dashboardPane;
130
-
131
- border-right: 1px solid rgb(var(--gray-2));
132
- }
133
-
134
- .dashboardMenuBody {
135
- padding: 0 18px 30px;
14
+ body:has(.root > .dashboard) {
15
+ background: var(--dashboard-background);
136
16
  }
137
17
 
138
- .dashboardSide {
139
- composes: dashboardPane;
140
-
141
- border-left: 1px solid rgb(var(--gray-2));
18
+ .dashboard {
19
+ min-height: 100dvh;
142
20
  }
143
21
 
144
- .dashboardNavigation {
145
- position: sticky;
22
+ .dashboardMount {
146
23
  display: flex;
147
- top: 0;
148
- height: 100dvh;
149
- width: 300px;
150
- padding: 15px;
24
+ align-items: stretch;
151
25
  flex-flow: column;
152
- gap: 15px;
153
- background: var(--dashboard-navigation-background);
154
- transition: width 210ms var(--swift-out);
155
-
156
- .divider {
157
- margin: 3px 15px;
158
- }
159
-
160
- .dividerLine {
161
- background: rgb(var(--primary-10));
162
- }
163
-
164
- .menu {
165
- flex-grow: 1;
166
- }
167
-
168
- .menuItem {
169
- padding: 15px;
170
- color: rgb(var(--primary-0));
171
- overflow: hidden;
172
-
173
- @media (hover: hover) {
174
- &:hover {
175
- background: rgb(var(--primary-10));
176
- }
177
- }
178
-
179
- &:active {
180
- background: rgb(var(--primary-9));
181
- }
182
- }
183
-
184
- .menuItemHighlighted {
185
- background: rgb(var(--primary-10) / .5);
186
- }
187
-
188
- .menuItemIcon {
189
- color: rgb(var(--primary-0));
190
- font-size: 24px;
191
- }
26
+ }
192
27
 
193
- .menuItemLabel {
194
- transition: opacity 210ms var(--swift-out);
195
- white-space: nowrap;
196
- }
28
+ .isResizing, .isResizing * {
29
+ animation: none !important;
30
+ transition: none !important;
197
31
  }
198
32
 
199
- [dark] .dashboardNavigation {
200
- .dividerLine {
201
- background: rgb(var(--gray-2));
202
- }
33
+ @include mixin.breakpoint-up(lg) {
34
+ .dashboard {
35
+ display: grid;
36
+ grid-template-columns: auto minmax(0, 1fr) auto;
37
+ grid-template-rows: minmax(0, 1fr);
38
+ transition: padding-left var(--dashboard-duration) var(--swift-out);
203
39
 
204
- .menuItem {
205
- @media (hover: hover) {
206
- &:hover {
207
- background: rgb(var(--gray-2));
208
- }
40
+ &:has(> .dashboardNavigation) {
41
+ padding-left: 300px;
209
42
  }
210
43
 
211
- &:active {
212
- background: rgb(var(--gray-3));
44
+ &:has(> .dashboardNavigationCollapsed) {
45
+ padding-left: 84px;
213
46
  }
214
- }
215
-
216
- .menuItemHighlighted {
217
- background: rgb(var(--gray-1));
218
- }
219
- }
220
-
221
- .dashboardNavigationCollapsed {
222
- composes: dashboardNavigation;
223
-
224
- width: 84px;
225
47
 
226
- .menuItem {
227
- width: 54px;
228
- }
229
-
230
- .menuItemLabel {
231
- opacity: 0;
232
- }
233
- }
234
-
235
- .dashboardNavigationLogo {
236
- display: flex;
237
- height: 54px;
238
- width: 54px;
239
- align-items: center;
240
- justify-content: center;
241
-
242
- :is(svg) {
243
- max-height: 48px;
244
- max-width: 48px;
245
- width: 100%;
246
- }
247
- }
248
-
249
- .dashboardNavigationRoundingFix {
250
- position: fixed;
251
- display: block;
252
- left: 300px;
253
- height: var(--radius);
254
- width: var(--radius);
255
- content: '';
256
- background: var(--dashboard-navigation-background);
257
- transition: left 210ms var(--swift-out);
258
- z-index: 750;
259
-
260
- &::before {
261
- position: absolute;
262
- display: block;
263
- inset: 0;
264
- content: '';
265
- background: rgb(var(--gray-1));
266
- }
267
-
268
- &:first-of-type {
269
- top: 0;
270
-
271
- &::before {
272
- border-top-left-radius: var(--radius);
48
+ .dashboardMount {
49
+ grid-column: 2;
273
50
  }
274
- }
275
51
 
276
- &:not(:first-of-type) {
277
- bottom: 0;
52
+ .dashboardMenu {
53
+ grid-column: 1;
54
+ }
278
55
 
279
- &::before {
280
- border-bottom-left-radius: var(--radius);
56
+ .dashboardSide {
57
+ grid-column: 3;
281
58
  }
282
59
  }
283
60
  }
284
61
 
285
- .dashboardNavigationRoundingFixCollapsed {
286
- composes: dashboardNavigationRoundingFix;
287
-
288
- left: 84px;
289
- }
290
-
291
- .dashboard:not(:has(.dashboardMenu)) .dashboardNavigationRoundingFix::before {
292
- background: rgb(var(--gray-0));
293
- }
294
-
295
- .dashboardTopBar {
296
- position: sticky;
297
- display: flex;
298
- top: 0;
299
- height: 84px;
300
- padding-left: 30px;
301
- padding-right: 30px;
302
- align-items: center;
303
- flex-flow: row;
304
- gap: 15px;
305
- background: rgb(var(--gray-0) / .9);
306
- backdrop-filter: blur(10px) saturate(180%);
307
- z-index: 100;
308
-
309
- > h1 {
310
- font-size: 18px;
311
- overflow: hidden;
312
- text-overflow: ellipsis;
313
- white-space: nowrap;
314
- }
315
-
316
- > .icon {
317
- color: var(--foreground-prominent);
318
- }
319
-
320
- > .separator {
321
- height: 24px;
62
+ @include mixin.breakpoint-down(md) {
63
+ .dashboard {
64
+ display: flex;
65
+ padding-top: 84px;
66
+ flex-flow: column;
322
67
  }
323
68
  }
@@ -0,0 +1,48 @@
1
+ @use '../../../../components/src/css/mixin';
2
+
3
+ .notice + .dashboardContent {
4
+ padding-top: 30px;
5
+ }
6
+
7
+ .dashboardContent {
8
+ display: flex;
9
+ padding: 0 30px;
10
+ flex-flow: column;
11
+ flex-grow: 1;
12
+
13
+ > :is(.calendar, .table) {
14
+ margin-left: -30px;
15
+ margin-right: -30px;
16
+ height: calc(100dvh - 84px);
17
+ flex-grow: 1;
18
+ }
19
+
20
+ > .calendar {
21
+ border-left: 0;
22
+ border-right: 0;
23
+ border-radius: 0;
24
+
25
+ .calendarActions {
26
+ padding-left: 30px;
27
+ padding-right: 30px;
28
+ }
29
+ }
30
+
31
+ > .table {
32
+ border-top: 1px solid rgb(var(--gray-2));
33
+
34
+ .tableCell:first-child .tableCellContent {
35
+ padding-left: 30px;
36
+ }
37
+
38
+ .tableCell:last-child .tableCellContent {
39
+ padding-right: 30px;
40
+ }
41
+ }
42
+ }
43
+
44
+ @include mixin.breakpoint-down(md) {
45
+ .dashboardContentCollapsed {
46
+ display: none;
47
+ }
48
+ }