@flux-ui/components 3.0.0-next.12 → 3.0.0-next.14
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/component/FluxDatePicker.vue.d.ts.map +1 -1
- package/dist/component/FluxTooltipProvider.vue.d.ts.map +1 -1
- package/dist/composable/index.d.ts +1 -0
- package/dist/composable/index.d.ts.map +1 -1
- package/dist/composable/useTooltipInjection.d.ts +2 -0
- package/dist/composable/useTooltipInjection.d.ts.map +1 -0
- package/dist/data/di.d.ts +4 -0
- package/dist/data/di.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1069 -1048
- package/dist/index.js.map +1 -1
- package/dist/util/createDialogRenderer.d.ts +1 -1
- package/dist/util/createDialogRenderer.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/component/FluxDatePicker.vue +5 -1
- package/src/component/FluxTooltipProvider.vue +7 -3
- package/src/composable/index.ts +1 -0
- package/src/composable/useTooltipInjection.ts +8 -0
- package/src/css/base.scss +1 -0
- package/src/css/component/Divider.module.scss +2 -2
- package/src/css/component/DropZone.module.scss +3 -2
- package/src/css/component/Icon.module.scss +1 -0
- package/src/css/component/Menu.module.scss +2 -2
- package/src/css/component/Overlay.module.scss +33 -5
- package/src/css/component/Pane.module.scss +2 -2
- package/src/css/component/Spinner.module.scss +1 -1
- package/src/css/component/Tab.module.scss +1 -1
- package/src/css/component/Table.module.scss +4 -4
- package/src/css/component/Tooltip.module.scss +1 -0
- package/src/css/variables.scss +81 -73
- package/src/data/di.ts +5 -0
- package/src/index.ts +1 -0
- package/src/util/createDialogRenderer.ts +26 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDialogRenderer.d.ts","sourceRoot":"","sources":["../../src/util/createDialogRenderer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"createDialogRenderer.d.ts","sourceRoot":"","sources":["../../src/util/createDialogRenderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,EAAS,MAAM,KAAK,CAAC;AAIjF,KAAK,IAAI,GAAG,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAC5C,KAAK,KAAK,GAAG;IACT,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,CAAC,OAAO,WAAW,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,GAAG,cAAc,CAiExI"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flux-ui/components",
|
|
3
3
|
"description": "A set of opiniated UI components.",
|
|
4
|
-
"version": "3.0.0-next.
|
|
4
|
+
"version": "3.0.0-next.14",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/basmilius",
|
|
@@ -51,26 +51,26 @@
|
|
|
51
51
|
"typings": "./dist/index.d.ts",
|
|
52
52
|
"sideEffects": false,
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@basmilius/utils": "^2.
|
|
55
|
-
"@flux-ui/internals": "3.0.0-next.
|
|
56
|
-
"@flux-ui/types": "3.0.0-next.
|
|
57
|
-
"@fortawesome/fontawesome-common-types": "^
|
|
54
|
+
"@basmilius/utils": "^2.5.2",
|
|
55
|
+
"@flux-ui/internals": "3.0.0-next.14",
|
|
56
|
+
"@flux-ui/types": "3.0.0-next.14",
|
|
57
|
+
"@fortawesome/fontawesome-common-types": "^7.0.0",
|
|
58
58
|
"clsx": "^2.1.1",
|
|
59
59
|
"imask": "^7.6.1",
|
|
60
60
|
"lodash-es": "^4.17.21",
|
|
61
|
-
"luxon": "^3.
|
|
62
|
-
"vue": "^3.5.
|
|
61
|
+
"luxon": "^3.7.1",
|
|
62
|
+
"vue": "^3.5.18"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@basmilius/vite-preset": "^2.
|
|
65
|
+
"@basmilius/vite-preset": "^2.5.2",
|
|
66
66
|
"@types/lodash-es": "^4.17.12",
|
|
67
67
|
"@types/luxon": "^3.6.2",
|
|
68
|
-
"@types/node": "^24.0
|
|
68
|
+
"@types/node": "^24.1.0",
|
|
69
69
|
"@vitejs/plugin-vue": "^6.0.0",
|
|
70
70
|
"pinia": "^3.0.3",
|
|
71
71
|
"sass-embedded": "^1.89.2",
|
|
72
72
|
"typescript": "^5.8.3",
|
|
73
|
-
"vite": "^7.0.
|
|
74
|
-
"vue-tsc": "^
|
|
73
|
+
"vite": "^7.0.5",
|
|
74
|
+
"vue-tsc": "^3.0.3"
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
import { useCalendar, useCalendarMonthSwitcher, useCalendarYearSwitcher } from '@flux-ui/internals';
|
|
132
132
|
import { clsx } from 'clsx';
|
|
133
133
|
import { DateTime } from 'luxon';
|
|
134
|
-
import { computed, ref, unref, useId } from 'vue';
|
|
134
|
+
import { computed, ref, unref, useId, watch } from 'vue';
|
|
135
135
|
import { useTranslate } from '$flux/composable/private';
|
|
136
136
|
import { FluxFadeTransition, FluxVerticalWindowTransition, FluxWindowTransition } from '$flux/transition';
|
|
137
137
|
import FluxSecondaryButton from './FluxSecondaryButton.vue';
|
|
@@ -198,6 +198,10 @@
|
|
|
198
198
|
}
|
|
199
199
|
});
|
|
200
200
|
|
|
201
|
+
watch(modelValue, () => {
|
|
202
|
+
setViewDate(getInitialDate());
|
|
203
|
+
});
|
|
204
|
+
|
|
201
205
|
function getInitialDate(): DateTime {
|
|
202
206
|
const value = unref(modelValue);
|
|
203
207
|
let date: DateTime;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { unrefTemplateElement } from '@flux-ui/internals';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
|
-
import { computed, defineComponent, h, ref, unref, watch } from 'vue';
|
|
5
|
-
import { useFluxStore } from '$flux/data';
|
|
4
|
+
import { computed, defineComponent, h, provide, ref, unref, watch } from 'vue';
|
|
5
|
+
import { FluxTooltipInjectionKey, useFluxStore } from '$flux/data';
|
|
6
6
|
import { FluxTooltipTransition } from '$flux/transition';
|
|
7
7
|
import $style from '$flux/css/component/Tooltip.module.scss';
|
|
8
8
|
|
|
@@ -60,7 +60,11 @@
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
provide(FluxTooltipInjectionKey, {
|
|
64
|
+
calculate
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
watch(content, () => requestAnimationFrame(calculate));
|
|
64
68
|
|
|
65
69
|
return () => h(FluxTooltipTransition, {}, {
|
|
66
70
|
default: () => {
|
package/src/composable/index.ts
CHANGED
|
@@ -7,3 +7,4 @@ export { default as useFilterInjection } from './useFilterInjection';
|
|
|
7
7
|
export { default as useFlyoutInjection } from './useFlyoutInjection';
|
|
8
8
|
export { default as useFormFieldInjection } from './useFormFieldInjection';
|
|
9
9
|
export { default as useTableInjection } from './useTableInjection';
|
|
10
|
+
export { default as useTooltipInjection } from './useTooltipInjection';
|
package/src/css/base.scss
CHANGED
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
--dz-height: calc(100% + 2px);
|
|
7
7
|
--dz-width: calc(100% + 2px);
|
|
8
8
|
|
|
9
|
-
position: relative;
|
|
10
|
-
|
|
11
9
|
&:has(.dropZoneContent > .avatar) {
|
|
12
10
|
--dz-inset: -3px;
|
|
13
11
|
--dz-radius: 999px;
|
|
@@ -22,6 +20,7 @@
|
|
|
22
20
|
}
|
|
23
21
|
|
|
24
22
|
.dropZone {
|
|
23
|
+
position: relative;
|
|
25
24
|
display: grid;
|
|
26
25
|
align-items: center;
|
|
27
26
|
gap: 15px 30px;
|
|
@@ -59,6 +58,8 @@
|
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
.dropZoneContent {
|
|
61
|
+
position: relative;
|
|
62
|
+
|
|
62
63
|
> :local(.avatar) {
|
|
63
64
|
display: block;
|
|
64
65
|
}
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
inset: 0;
|
|
5
5
|
height: 100dvh;
|
|
6
6
|
width: 100dvw;
|
|
7
|
-
background:
|
|
7
|
+
background: var(--overlay);
|
|
8
8
|
backdrop-filter: blur(3px) saturate(180%);
|
|
9
|
+
outline: 0;
|
|
9
10
|
z-index: 10000;
|
|
10
11
|
|
|
11
12
|
> .basePaneStructure {
|
|
@@ -25,10 +26,6 @@
|
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
[dark] .overlay {
|
|
29
|
-
background: rgb(0 0 0 / .6);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
29
|
.overlaySmall {
|
|
33
30
|
composes: overlay;
|
|
34
31
|
|
|
@@ -151,3 +148,34 @@
|
|
|
151
148
|
transform: translate3d(100%, 0, 0);
|
|
152
149
|
}
|
|
153
150
|
}
|
|
151
|
+
|
|
152
|
+
.overlay + .overlay {
|
|
153
|
+
background: transparent;
|
|
154
|
+
backdrop-filter: none;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.overlay > .basePaneStructure::after {
|
|
158
|
+
position: absolute;
|
|
159
|
+
display: block;
|
|
160
|
+
inset: 0;
|
|
161
|
+
content: '';
|
|
162
|
+
background: var(--overlay-secondary);
|
|
163
|
+
opacity: 0;
|
|
164
|
+
pointer-events: none;
|
|
165
|
+
transition: opacity 420ms var(--swift-out);
|
|
166
|
+
z-index: 1;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.overlay:has(+ .overlay) > .basePaneStructure {
|
|
170
|
+
transition: 420ms var(--swift-out);
|
|
171
|
+
transition-property: filter, scale;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.overlay:has(+ .overlay:not(.overlayTransitionLeaveActive)) > .pane {
|
|
175
|
+
filter: blur(3px);
|
|
176
|
+
scale: .95;
|
|
177
|
+
|
|
178
|
+
&::after {
|
|
179
|
+
opacity: 1;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
.tableCell {
|
|
42
42
|
height: 0;
|
|
43
43
|
padding: 0;
|
|
44
|
-
border: 0 solid var(--gray-
|
|
44
|
+
border: 0 solid var(--gray-2);
|
|
45
45
|
|
|
46
46
|
@-moz-document url-prefix() {
|
|
47
47
|
height: 100%;
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
.tableHeader {
|
|
59
59
|
composes: tableCell;
|
|
60
60
|
|
|
61
|
-
border-bottom: 2px solid var(--gray-
|
|
61
|
+
border-bottom: 2px solid var(--gray-2);
|
|
62
62
|
color: var(--foreground-prominent);
|
|
63
63
|
|
|
64
64
|
&.isShrinking {
|
|
@@ -81,13 +81,13 @@
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
tbody .tableRow:nth-child(even) .tableCell.isStriped {
|
|
84
|
-
background: oklch(from var(--gray-1) l c h / .
|
|
84
|
+
background: oklch(from var(--gray-1) l c h / .5);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
@media (hover: hover) {
|
|
88
88
|
tbody .tableRow:hover .tableCell.isHoverable,
|
|
89
89
|
tbody .tableRow:has(:focus-visible) .tableCell.isHoverable {
|
|
90
|
-
background:
|
|
90
|
+
background: var(--gray-1);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
package/src/css/variables.scss
CHANGED
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
@mixin color-light {
|
|
11
11
|
--gray-0: oklch(100% 0 270);
|
|
12
|
-
--gray-1: oklch(
|
|
13
|
-
--gray-2: oklch(
|
|
14
|
-
--gray-3: oklch(
|
|
15
|
-
--gray-4: oklch(
|
|
12
|
+
--gray-1: oklch(98% 0.005 270);
|
|
13
|
+
--gray-2: oklch(95% 0.008 270);
|
|
14
|
+
--gray-3: oklch(91% 0.012 270);
|
|
15
|
+
--gray-4: oklch(84% 0.015 270);
|
|
16
16
|
--gray-5: oklch(72% 0.03 270);
|
|
17
17
|
--gray-6: oklch(64% 0.035 270);
|
|
18
18
|
--gray-7: oklch(52% 0.04 270);
|
|
@@ -88,83 +88,83 @@
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
@mixin color-dark {
|
|
91
|
-
--gray-0: oklch(16% 0.01
|
|
92
|
-
--gray-1: oklch(19% 0.012
|
|
93
|
-
--gray-2: oklch(23% 0.015
|
|
94
|
-
--gray-3: oklch(27% 0.017
|
|
95
|
-
--gray-4: oklch(35% 0.02
|
|
96
|
-
--gray-5: oklch(43% 0.03
|
|
97
|
-
--gray-6: oklch(51% 0.035
|
|
98
|
-
--gray-7: oklch(63% 0.04
|
|
99
|
-
--gray-8: oklch(75% 0.04
|
|
100
|
-
--gray-9: oklch(83% 0.028
|
|
101
|
-
--gray-10: oklch(91% 0.028
|
|
102
|
-
--gray-11: oklch(99% 0.028
|
|
103
|
-
|
|
104
|
-
--primary-0: oklch(
|
|
105
|
-
--primary-1: oklch(
|
|
106
|
-
--primary-2: oklch(
|
|
107
|
-
--primary-3: oklch(
|
|
108
|
-
--primary-4: oklch(
|
|
109
|
-
--primary-5: oklch(
|
|
110
|
-
--primary-6: oklch(
|
|
111
|
-
--primary-7: oklch(
|
|
112
|
-
--primary-8: oklch(
|
|
113
|
-
--primary-9: oklch(
|
|
114
|
-
--primary-10: oklch(
|
|
115
|
-
--primary-11: oklch(
|
|
91
|
+
--gray-0: oklch(16% 0.01 270);
|
|
92
|
+
--gray-1: oklch(19% 0.012 270);
|
|
93
|
+
--gray-2: oklch(23% 0.015 270);
|
|
94
|
+
--gray-3: oklch(27% 0.017 270);
|
|
95
|
+
--gray-4: oklch(35% 0.02 270);
|
|
96
|
+
--gray-5: oklch(43% 0.03 270);
|
|
97
|
+
--gray-6: oklch(51% 0.035 270);
|
|
98
|
+
--gray-7: oklch(63% 0.04 270);
|
|
99
|
+
--gray-8: oklch(75% 0.04 270);
|
|
100
|
+
--gray-9: oklch(83% 0.028 270);
|
|
101
|
+
--gray-10: oklch(91% 0.028 270);
|
|
102
|
+
--gray-11: oklch(99% 0.028 270);
|
|
103
|
+
|
|
104
|
+
--primary-0: oklch(26.8% 0.012 264);
|
|
105
|
+
--primary-1: oklch(29.3% 0.025 264);
|
|
106
|
+
--primary-2: oklch(32.4% 0.038 264);
|
|
107
|
+
--primary-3: oklch(36.4% 0.052 264);
|
|
108
|
+
--primary-4: oklch(40.6% 0.068 264);
|
|
109
|
+
--primary-5: oklch(45.3% 0.085 264);
|
|
110
|
+
--primary-6: oklch(49.8% 0.102 264);
|
|
111
|
+
--primary-7: oklch(54.9% 0.118 264);
|
|
112
|
+
--primary-8: oklch(60.9% 0.134 264);
|
|
113
|
+
--primary-9: oklch(68.5% 0.148 264);
|
|
114
|
+
--primary-10: oklch(73.9% 0.158 264);
|
|
115
|
+
--primary-11: oklch(79.5% 0.165 264);
|
|
116
116
|
|
|
117
117
|
--danger-0: oklch(26.1% 0.007 346);
|
|
118
|
-
--danger-1: oklch(
|
|
119
|
-
--danger-2: oklch(
|
|
120
|
-
--danger-3: oklch(
|
|
121
|
-
--danger-4: oklch(
|
|
122
|
-
--danger-5: oklch(
|
|
123
|
-
--danger-6: oklch(
|
|
124
|
-
--danger-7: oklch(
|
|
125
|
-
--danger-8: oklch(
|
|
126
|
-
--danger-9: oklch(
|
|
127
|
-
--danger-10: oklch(
|
|
128
|
-
--danger-11: oklch(
|
|
118
|
+
--danger-1: oklch(29.3% 0.025 4);
|
|
119
|
+
--danger-2: oklch(32.4% 0.038 8);
|
|
120
|
+
--danger-3: oklch(36.4% 0.052 12);
|
|
121
|
+
--danger-4: oklch(40.6% 0.068 15);
|
|
122
|
+
--danger-5: oklch(45.3% 0.085 17);
|
|
123
|
+
--danger-6: oklch(49.8% 0.102 18);
|
|
124
|
+
--danger-7: oklch(54.9% 0.118 19);
|
|
125
|
+
--danger-8: oklch(60.9% 0.134 18);
|
|
126
|
+
--danger-9: oklch(68.5% 0.148 16);
|
|
127
|
+
--danger-10: oklch(73.9% 0.158 14);
|
|
128
|
+
--danger-11: oklch(79.5% 0.165 12);
|
|
129
129
|
|
|
130
130
|
--info-0: oklch(26.8% 0.012 264);
|
|
131
|
-
--info-1: oklch(
|
|
132
|
-
--info-2: oklch(
|
|
133
|
-
--info-3: oklch(
|
|
134
|
-
--info-4: oklch(40% 0.
|
|
135
|
-
--info-5: oklch(
|
|
136
|
-
--info-6: oklch(49% 0.
|
|
137
|
-
--info-7: oklch(
|
|
138
|
-
--info-8: oklch(
|
|
139
|
-
--info-9: oklch(
|
|
140
|
-
--info-10: oklch(
|
|
141
|
-
--info-11: oklch(
|
|
131
|
+
--info-1: oklch(29.3% 0.025 260);
|
|
132
|
+
--info-2: oklch(32.4% 0.038 258);
|
|
133
|
+
--info-3: oklch(36.4% 0.052 256);
|
|
134
|
+
--info-4: oklch(40.6% 0.068 254);
|
|
135
|
+
--info-5: oklch(45.3% 0.085 253);
|
|
136
|
+
--info-6: oklch(49.8% 0.102 252);
|
|
137
|
+
--info-7: oklch(54.9% 0.118 252);
|
|
138
|
+
--info-8: oklch(60.9% 0.134 253);
|
|
139
|
+
--info-9: oklch(68.5% 0.148 254);
|
|
140
|
+
--info-10: oklch(73.9% 0.158 254);
|
|
141
|
+
--info-11: oklch(79.5% 0.165 254);
|
|
142
142
|
|
|
143
143
|
--success-0: oklch(25.8% 0.017 156);
|
|
144
|
-
--success-1: oklch(
|
|
145
|
-
--success-2: oklch(
|
|
146
|
-
--success-3: oklch(36.
|
|
147
|
-
--success-4: oklch(
|
|
148
|
-
--success-5: oklch(
|
|
149
|
-
--success-6: oklch(
|
|
150
|
-
--success-7: oklch(
|
|
151
|
-
--success-8: oklch(
|
|
152
|
-
--success-9: oklch(68.
|
|
153
|
-
--success-10: oklch(73.9% 0.
|
|
154
|
-
--success-11: oklch(
|
|
144
|
+
--success-1: oklch(29.3% 0.025 155);
|
|
145
|
+
--success-2: oklch(32.4% 0.038 155);
|
|
146
|
+
--success-3: oklch(36.4% 0.052 155);
|
|
147
|
+
--success-4: oklch(40.6% 0.068 154);
|
|
148
|
+
--success-5: oklch(45.3% 0.085 153);
|
|
149
|
+
--success-6: oklch(49.8% 0.102 152);
|
|
150
|
+
--success-7: oklch(54.9% 0.118 151);
|
|
151
|
+
--success-8: oklch(60.9% 0.134 150);
|
|
152
|
+
--success-9: oklch(68.5% 0.148 149);
|
|
153
|
+
--success-10: oklch(73.9% 0.158 148);
|
|
154
|
+
--success-11: oklch(79.5% 0.165 147);
|
|
155
155
|
|
|
156
156
|
--warning-0: oklch(27% 0.022 88);
|
|
157
|
-
--warning-1: oklch(29.3% 0.029
|
|
158
|
-
--warning-2: oklch(32.4% 0.036
|
|
159
|
-
--warning-3: oklch(36.4% 0.046
|
|
160
|
-
--warning-4: oklch(40.6% 0.054
|
|
161
|
-
--warning-5: oklch(45.3% 0.064
|
|
162
|
-
--warning-6: oklch(49.8% 0.072
|
|
163
|
-
--warning-7: oklch(54.9% 0.083
|
|
164
|
-
--warning-8: oklch(60.9% 0.096
|
|
165
|
-
--warning-9: oklch(68.5% 0.112
|
|
166
|
-
--warning-10: oklch(73.9% 0.122
|
|
167
|
-
--warning-11: oklch(79.5% 0.132
|
|
157
|
+
--warning-1: oklch(29.3% 0.029 87);
|
|
158
|
+
--warning-2: oklch(32.4% 0.036 86);
|
|
159
|
+
--warning-3: oklch(36.4% 0.046 85);
|
|
160
|
+
--warning-4: oklch(40.6% 0.054 84);
|
|
161
|
+
--warning-5: oklch(45.3% 0.064 82);
|
|
162
|
+
--warning-6: oklch(49.8% 0.072 80);
|
|
163
|
+
--warning-7: oklch(54.9% 0.083 78);
|
|
164
|
+
--warning-8: oklch(60.9% 0.096 76);
|
|
165
|
+
--warning-9: oklch(68.5% 0.112 75);
|
|
166
|
+
--warning-10: oklch(73.9% 0.122 74);
|
|
167
|
+
--warning-11: oklch(79.5% 0.132 73);
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
@mixin defaults {
|
|
@@ -178,6 +178,14 @@
|
|
|
178
178
|
--foreground: var(--gray-8);
|
|
179
179
|
--foreground-prominent: var(--gray-10);
|
|
180
180
|
--foreground-secondary: var(--gray-5);
|
|
181
|
+
|
|
182
|
+
--overlay: oklch(from var(--gray-11) l c h / .6);
|
|
183
|
+
--overlay-secondary: oklch(from var(--gray-11) l c h / .4);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
@mixin defaults-dark {
|
|
187
|
+
--overlay: rgb(0 0 0 / .6);
|
|
188
|
+
--overlay-secondary: rgb(0 0 0 / .4);
|
|
181
189
|
}
|
|
182
190
|
|
|
183
191
|
@mixin shadow-light {
|
package/src/data/di.ts
CHANGED
|
@@ -7,6 +7,7 @@ export const FluxFlyoutInjectionKey: InjectionKey<FluxFlyoutInjection> = Symbol(
|
|
|
7
7
|
export const FluxFilterInjectionKey: InjectionKey<FluxFilterInjection> = Symbol();
|
|
8
8
|
export const FluxFormFieldInjectionKey: InjectionKey<FluxFormFieldInjection> = Symbol();
|
|
9
9
|
export const FluxTableInjectionKey: InjectionKey<FluxTableInjection> = Symbol();
|
|
10
|
+
export const FluxTooltipInjectionKey: InjectionKey<FluxTooltipInjection> = Symbol();
|
|
10
11
|
|
|
11
12
|
export type FluxExpandableGroupInjection = {
|
|
12
13
|
closeAll(): void;
|
|
@@ -40,3 +41,7 @@ export type FluxTableInjection = {
|
|
|
40
41
|
readonly isSeparated: boolean;
|
|
41
42
|
readonly isStriped: boolean;
|
|
42
43
|
};
|
|
44
|
+
|
|
45
|
+
export type FluxTooltipInjection = {
|
|
46
|
+
calculate(): void;
|
|
47
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { flattenVNodeTree } from '@flux-ui/internals';
|
|
2
|
-
import { Component,
|
|
3
|
-
import { Comment,
|
|
1
|
+
import { flattenVNodeTree, useFocusTrap } from '@flux-ui/internals';
|
|
2
|
+
import type { Component, RenderFunction, SetupContext, Slots, VNode } from 'vue';
|
|
3
|
+
import { Comment, getCurrentInstance, h, onUnmounted, ref, Teleport, watch } from 'vue';
|
|
4
4
|
import { registerDialog, useFluxStore } from '$flux/data';
|
|
5
5
|
|
|
6
6
|
type Emit = SetupContext<['close']>['emit'];
|
|
@@ -14,22 +14,32 @@ export default function (attrs: object, props: Props, emit: Emit, slots: Slots,
|
|
|
14
14
|
let unregister: Function | null = null;
|
|
15
15
|
let zIndex = 0;
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const dialogRef = ref<HTMLElement>();
|
|
18
|
+
|
|
19
|
+
useFocusTrap(dialogRef);
|
|
20
20
|
|
|
21
21
|
onUnmounted(() => {
|
|
22
|
-
window.removeEventListener('keydown', onKeyDown);
|
|
23
22
|
unregister?.();
|
|
24
23
|
});
|
|
25
24
|
|
|
25
|
+
watch(dialogRef, (dialog, _, onCleanup) => {
|
|
26
|
+
if (!dialog) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
dialog.addEventListener('keydown', onKeyDown, {passive: true});
|
|
31
|
+
dialog.focus();
|
|
32
|
+
|
|
33
|
+
onCleanup(() => {
|
|
34
|
+
dialog.removeEventListener('keydown', onKeyDown);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
26
38
|
function onKeyDown(evt: KeyboardEvent): void {
|
|
27
39
|
if (evt.key !== 'Escape' || !unregister || !props.isCloseable) {
|
|
28
40
|
return;
|
|
29
41
|
}
|
|
30
42
|
|
|
31
|
-
evt.preventDefault();
|
|
32
|
-
evt.stopPropagation();
|
|
33
43
|
emit('close');
|
|
34
44
|
}
|
|
35
45
|
|
|
@@ -38,7 +48,7 @@ export default function (attrs: object, props: Props, emit: Emit, slots: Slots,
|
|
|
38
48
|
|
|
39
49
|
const children = flattenVNodeTree(slots.default?.() ?? []);
|
|
40
50
|
const isVisible = children.length > 0 && children.some(child => child.type !== Comment);
|
|
41
|
-
|
|
51
|
+
let content: VNode | undefined;
|
|
42
52
|
|
|
43
53
|
if (isVisible) {
|
|
44
54
|
if (!unregister) {
|
|
@@ -46,17 +56,19 @@ export default function (attrs: object, props: Props, emit: Emit, slots: Slots,
|
|
|
46
56
|
zIndex = dialogCount + 1000;
|
|
47
57
|
}
|
|
48
58
|
|
|
49
|
-
content
|
|
59
|
+
content = h('div', {
|
|
50
60
|
key: props.viewKey,
|
|
61
|
+
ref: dialogRef,
|
|
51
62
|
class: className,
|
|
52
|
-
style: {zIndex}
|
|
53
|
-
|
|
63
|
+
style: {zIndex},
|
|
64
|
+
tabindex: 0
|
|
65
|
+
}, children);
|
|
54
66
|
} else {
|
|
55
67
|
unregister?.();
|
|
56
68
|
unregister = null;
|
|
57
69
|
}
|
|
58
70
|
|
|
59
|
-
return h(Teleport, {disabled: content
|
|
71
|
+
return h(Teleport, {defer: true, disabled: !content, to: instance?.appContext.app._container}, [
|
|
60
72
|
h(transition, attrs, {
|
|
61
73
|
default: () => content
|
|
62
74
|
})
|