@flux-ui/components 3.0.0-next.14 → 3.0.0-next.16

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 +1 @@
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"}
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;AAKjF,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;AAIF,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.14",
4
+ "version": "3.0.0-next.16",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/basmilius",
@@ -51,9 +51,9 @@
51
51
  "typings": "./dist/index.d.ts",
52
52
  "sideEffects": false,
53
53
  "dependencies": {
54
- "@basmilius/utils": "^2.5.2",
55
- "@flux-ui/internals": "3.0.0-next.14",
56
- "@flux-ui/types": "3.0.0-next.14",
54
+ "@basmilius/utils": "^2.5.4",
55
+ "@flux-ui/internals": "3.0.0-next.16",
56
+ "@flux-ui/types": "3.0.0-next.16",
57
57
  "@fortawesome/fontawesome-common-types": "^7.0.0",
58
58
  "clsx": "^2.1.1",
59
59
  "imask": "^7.6.1",
@@ -62,15 +62,15 @@
62
62
  "vue": "^3.5.18"
63
63
  },
64
64
  "devDependencies": {
65
- "@basmilius/vite-preset": "^2.5.2",
65
+ "@basmilius/vite-preset": "^2.5.4",
66
66
  "@types/lodash-es": "^4.17.12",
67
67
  "@types/luxon": "^3.6.2",
68
68
  "@types/node": "^24.1.0",
69
- "@vitejs/plugin-vue": "^6.0.0",
69
+ "@vitejs/plugin-vue": "^6.0.1",
70
70
  "pinia": "^3.0.3",
71
71
  "sass-embedded": "^1.89.2",
72
72
  "typescript": "^5.8.3",
73
- "vite": "^7.0.5",
74
- "vue-tsc": "^3.0.3"
73
+ "vite": "^7.0.6",
74
+ "vue-tsc": "^3.0.4"
75
75
  }
76
76
  }
@@ -14,6 +14,7 @@
14
14
  [$style.menuItemSelected]: isSelectable && isSelected
15
15
  }"
16
16
  :aria-checked="isSelectable ? isSelected : undefined"
17
+ :tabindex="tabindex"
17
18
  @click="$emit('click', $event)">
18
19
  <template
19
20
  v-if="isSelectable && (!iconLeading || isSelected)"
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <div :class="$style.overlayProvider">
3
+ <div :class="$style.overlayShade"/>
4
+ </div>
5
+
6
+ <FluxOverlay size="medium">
7
+ <FluxAlert
8
+ v-for="alert of alerts"
9
+ :key="alert.id"
10
+ :alert="alert"/>
11
+ </FluxOverlay>
12
+
13
+ <FluxOverlay size="medium">
14
+ <FluxConfirm
15
+ v-for="confirm of confirms"
16
+ :key="confirm.id"
17
+ :confirm="confirm"/>
18
+ </FluxOverlay>
19
+
20
+ <FluxOverlay size="medium">
21
+ <FluxPrompt
22
+ v-for="prompt of prompts"
23
+ :key="prompt.id"
24
+ :prompt="prompt"/>
25
+ </FluxOverlay>
26
+ </template>
27
+
28
+ <script
29
+ lang="ts"
30
+ setup>
31
+ import { useFluxStore } from '$flux/data';
32
+ import FluxAlert from './FluxAlert.vue';
33
+ import FluxConfirm from './FluxConfirm.vue';
34
+ import FluxOverlay from './FluxOverlay.vue';
35
+ import FluxPrompt from './FluxPrompt.vue';
36
+ import $style from '$flux/css/component/Overlay.module.scss';
37
+
38
+ const {alerts, confirms, prompts} = useFluxStore();
39
+ </script>
@@ -6,27 +6,7 @@
6
6
  <slot/>
7
7
  </div>
8
8
 
9
- <FluxOverlay size="medium">
10
- <FluxAlert
11
- v-for="alert of alerts"
12
- :key="alert.id"
13
- :alert="alert"/>
14
- </FluxOverlay>
15
-
16
- <FluxOverlay size="medium">
17
- <FluxConfirm
18
- v-for="confirm of confirms"
19
- :key="confirm.id"
20
- :confirm="confirm"/>
21
- </FluxOverlay>
22
-
23
- <FluxOverlay size="medium">
24
- <FluxPrompt
25
- v-for="prompt of prompts"
26
- :key="prompt.id"
27
- :prompt="prompt"/>
28
- </FluxOverlay>
29
-
9
+ <FluxOverlayProvider/>
30
10
  <FluxSnackbarProvider/>
31
11
  <FluxTooltipProvider/>
32
12
  </template>
@@ -36,10 +16,7 @@
36
16
  setup>
37
17
  import { watch } from 'vue';
38
18
  import { useFluxStore } from '$flux/data';
39
- import FluxAlert from './FluxAlert.vue';
40
- import FluxConfirm from './FluxConfirm.vue';
41
- import FluxPrompt from './FluxPrompt.vue';
42
- import FluxOverlay from './FluxOverlay.vue';
19
+ import FluxOverlayProvider from './FluxOverlayProvider.vue';
43
20
  import FluxSnackbarProvider from './FluxSnackbarProvider.vue';
44
21
  import FluxTooltipProvider from './FluxTooltipProvider.vue';
45
22
  import $style from '$flux/css/component/Root.module.scss';
@@ -52,7 +29,7 @@
52
29
  default(): any;
53
30
  }>();
54
31
 
55
- const {alerts, confirms, inertMain, prompts} = useFluxStore();
32
+ const {inertMain} = useFluxStore();
56
33
 
57
34
  watch(inertMain, (inert, _, onCleanup): void => {
58
35
  if (!inert) {
@@ -84,6 +84,7 @@ export { default as FluxMenuTitle } from './FluxMenuTitle.vue';
84
84
  export { default as FluxNotice } from './FluxNotice.vue';
85
85
  export { default as FluxNoticeStack } from './FluxNoticeStack.vue';
86
86
  export { default as FluxOverlay } from './FluxOverlay.vue';
87
+ export { default as FluxOverlayProvider } from './FluxOverlayProvider.vue';
87
88
  export { default as FluxPagination } from './FluxPagination.vue';
88
89
  export { default as FluxPaginationBar } from './FluxPaginationBar.vue';
89
90
  export { default as FluxPane } from './FluxPane.vue';
@@ -459,7 +459,7 @@
459
459
  }
460
460
 
461
461
  .formSelectPopup {
462
- composes: basePaneStructure from './base/Pane.module.scss';
462
+ composes: basePane from './base/Pane.module.scss';
463
463
 
464
464
  position: fixed;
465
465
  display: block;
@@ -1,13 +1,37 @@
1
- .overlay {
1
+ .overlayView {
2
2
  position: fixed;
3
- display: flex;
4
3
  inset: 0;
5
4
  height: 100dvh;
6
5
  width: 100dvw;
6
+ }
7
+
8
+ .overlayProvider {
9
+ composes: overlayView;
10
+
11
+ pointer-events: none;
12
+ z-index: 10000;
13
+ }
14
+
15
+ .overlayShade {
16
+ composes: overlayView;
17
+
7
18
  background: var(--overlay);
8
19
  backdrop-filter: blur(3px) saturate(180%);
20
+ pointer-events: none;
21
+ transition: opacity 600ms var(--swift-out);
22
+ }
23
+
24
+ .overlayProvider:not(:has(.overlay:not(.overlayTransitionLeaveActive))) .overlayShade {
25
+ opacity: 0;
26
+ }
27
+
28
+ .overlay {
29
+ position: fixed;
30
+ display: flex;
31
+ inset: 0;
32
+ height: 100dvh;
33
+ width: 100dvw;
9
34
  outline: 0;
10
- z-index: 10000;
11
35
 
12
36
  > .basePaneStructure {
13
37
  display: flex;
@@ -17,12 +41,39 @@
17
41
  flex-flow: column nowrap;
18
42
  box-shadow: var(--shadow-lg);
19
43
  overflow: auto;
44
+ transition: 420ms var(--swift-out);
45
+ transition-property: filter, scale;
20
46
 
21
47
  .paneFooter {
22
48
  position: sticky;
23
49
  bottom: 0;
24
50
  margin-top: auto;
25
51
  }
52
+
53
+ &::after {
54
+ position: absolute;
55
+ display: block;
56
+ inset: 0;
57
+ content: '';
58
+ background: var(--overlay-secondary);
59
+ opacity: 0;
60
+ pointer-events: none;
61
+ transition: opacity 420ms var(--swift-out);
62
+ z-index: 1;
63
+ }
64
+ }
65
+
66
+ &.isCurrent > .basePaneStructure {
67
+ pointer-events: auto;
68
+ }
69
+
70
+ &:not(.isCurrent) > .basePaneStructure {
71
+ filter: blur(3px);
72
+ scale: .95;
73
+
74
+ &::after {
75
+ opacity: 1;
76
+ }
26
77
  }
27
78
  }
28
79
 
@@ -148,34 +199,3 @@
148
199
  transform: translate3d(100%, 0, 0);
149
200
  }
150
201
  }
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
- }
package/src/data/store.ts CHANGED
@@ -20,7 +20,7 @@ export type FluxStore = FluxState & {
20
20
  addPrompt(spec: Omit<FluxPromptObject, 'id'>): number;
21
21
  addSnackbar(spec: Omit<FluxSnackbarObject, 'id'>): number;
22
22
  addTooltip(spec: Omit<FluxTooltipObject, 'id'>): number;
23
- registerDialog(): VoidFunction;
23
+ registerDialog(): [number, VoidFunction];
24
24
  removeAlert(id: number): void;
25
25
  removeConfirm(id: number): void;
26
26
  removePrompt(id: number): void;
@@ -104,9 +104,11 @@ export function addTooltip(spec: Omit<FluxTooltipObject, 'id'>): number {
104
104
  return id;
105
105
  }
106
106
 
107
- export function registerDialog(): VoidFunction {
108
- ++state.dialogCount;
109
- return () => --state.dialogCount;
107
+ export function registerDialog(): [number, VoidFunction] {
108
+ return [
109
+ ++state.dialogCount,
110
+ () => --state.dialogCount
111
+ ];
110
112
  }
111
113
 
112
114
  export function removeAlert(id: number): void {
@@ -1,7 +1,8 @@
1
1
  import { flattenVNodeTree, useFocusTrap } from '@flux-ui/internals';
2
2
  import type { Component, RenderFunction, SetupContext, Slots, VNode } from 'vue';
3
- import { Comment, getCurrentInstance, h, onUnmounted, ref, Teleport, watch } from 'vue';
3
+ import { Comment, h, onUnmounted, ref, Teleport, watch } from 'vue';
4
4
  import { registerDialog, useFluxStore } from '$flux/data';
5
+ import $style from '$flux/css/component/Overlay.module.scss';
5
6
 
6
7
  type Emit = SetupContext<['close']>['emit'];
7
8
  type Props = {
@@ -9,8 +10,9 @@ type Props = {
9
10
  readonly viewKey?: string;
10
11
  };
11
12
 
13
+ const TARGET_SELECTOR = `.${$style.overlayProvider.replaceAll(' ', '.')}`;
14
+
12
15
  export default function (attrs: object, props: Props, emit: Emit, slots: Slots, className: string, transition: Component): RenderFunction {
13
- const instance = getCurrentInstance();
14
16
  let unregister: Function | null = null;
15
17
  let zIndex = 0;
16
18
 
@@ -52,15 +54,16 @@ export default function (attrs: object, props: Props, emit: Emit, slots: Slots,
52
54
 
53
55
  if (isVisible) {
54
56
  if (!unregister) {
55
- unregister = registerDialog();
56
- zIndex = dialogCount + 1000;
57
+ [zIndex, unregister] = registerDialog();
57
58
  }
58
59
 
59
60
  content = h('div', {
60
61
  key: props.viewKey,
61
62
  ref: dialogRef,
62
- class: className,
63
- style: {zIndex},
63
+ class: [className, zIndex === dialogCount && $style.isCurrent],
64
+ style: {
65
+ zIndex: zIndex + 1000
66
+ },
64
67
  tabindex: 0
65
68
  }, children);
66
69
  } else {
@@ -68,7 +71,7 @@ export default function (attrs: object, props: Props, emit: Emit, slots: Slots,
68
71
  unregister = null;
69
72
  }
70
73
 
71
- return h(Teleport, {defer: true, disabled: !content, to: instance?.appContext.app._container}, [
74
+ return h(Teleport, {defer: true, disabled: !content, to: TARGET_SELECTOR}, [
72
75
  h(transition, attrs, {
73
76
  default: () => content
74
77
  })