@flux-ui/application 3.0.0-next.61 → 3.0.0-next.63

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/index.css CHANGED
@@ -8,11 +8,6 @@
8
8
  --application-top-height: 66px;
9
9
  }
10
10
 
11
- [dark] {
12
- --application-menu-surface: color-mix(in srgb, var(--gray-25), black 25%);
13
- --application-menu-surface-stroke: var(--gray-100);
14
- }
15
-
16
11
  .application {
17
12
  position: relative;
18
13
  display: flex;
@@ -43,7 +38,7 @@
43
38
  height: 100dvh;
44
39
  padding: 0;
45
40
  border: 0;
46
- background: rgb(from var(--gray-200) r g b/0.5);
41
+ background: var(--overlay);
47
42
  backdrop-filter: blur(3px) saturate(180%);
48
43
  transition: var(--application-duration) var(--swift-out);
49
44
  transition-property: background, backdrop-filter, opacity;
@@ -74,6 +69,10 @@
74
69
  overflow: hidden;
75
70
  overscroll-behavior: contain;
76
71
  }
72
+ }
73
+ html[data-application-resizing] .application,
74
+ html[data-application-resizing] .application-menu-backdrop {
75
+ transition: none;
77
76
  }.application-content {
78
77
  position: relative;
79
78
  display: flex;
@@ -269,48 +268,6 @@
269
268
  overflow-y: auto;
270
269
  }
271
270
 
272
- .application-menu-page-indicator {
273
- display: flex;
274
- flex-flow: row nowrap;
275
- gap: 6px;
276
- justify-content: center;
277
- align-items: center;
278
- padding: 9px 12px;
279
- background: var(--application-menu-surface);
280
- z-index: 1;
281
- }
282
-
283
- .application-menu-page-indicator-dot {
284
- height: 6px;
285
- width: 6px;
286
- padding: 0;
287
- cursor: pointer;
288
- background: transparent;
289
- border: 1.5px solid var(--application-menu-surface-stroke);
290
- border-radius: 50%;
291
- transition: 200ms var(--swift-out);
292
- transition-property: background, border-color, transform;
293
- }
294
- @media (hover: hover) {
295
- .application-menu-page-indicator-dot:hover {
296
- border-color: var(--foreground-secondary);
297
- transform: scale(1.2);
298
- }
299
- }
300
- .application-menu-page-indicator-dot {
301
- outline: 2px solid rgb(from var(--primary-600) r g b/0);
302
- outline-offset: 0;
303
- }
304
- .application-menu-page-indicator-dot:focus-visible {
305
- outline-color: var(--primary-600);
306
- outline-offset: 0;
307
- }
308
-
309
- .application-menu-page-indicator-dot-active {
310
- background: var(--foreground-prominent);
311
- border-color: var(--foreground-prominent);
312
- }
313
-
314
271
  .application-menu-panel-enter-active,
315
272
  .application-menu-panel-enter-from,
316
273
  .application-menu-panel-leave-active,
@@ -580,6 +537,16 @@
580
537
  .application-menu[data-collapsed] {
581
538
  translate: -100% 0;
582
539
  }
540
+ }
541
+ html[data-application-resizing] .application-menu,
542
+ html[data-application-resizing] .application-menu-footer,
543
+ html[data-application-resizing] .application-menu-footer::before,
544
+ html[data-application-resizing] .application-menu-header,
545
+ html[data-application-resizing] .application-menu-track,
546
+ html[data-application-resizing] .application-menu .menu-item-label,
547
+ html[data-application-resizing] .application-menu-context-pill-content strong,
548
+ html[data-application-resizing] .application-menu-context-pill-content span {
549
+ transition: none;
583
550
  }.application-section {
584
551
  display: flex;
585
552
  flex-flow: column;
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Fragment, TransitionGroup, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, customRef, defineComponent, h, inject, markRaw, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onUnmounted, openBlock, provide, ref, renderList, renderSlot, shallowRef, toDisplayString, toRef, unref, useSlots, watch, withCtx, withDirectives } from "vue";
2
+ import { FluxFadeTransition, FluxFlyout, FluxIcon, FluxMenu, FluxMenuItem, FluxPane, FluxRouteTransition, FluxSecondaryButton, FluxSpacer, FluxTabBar, useBreakpoints } from "@flux-ui/components";
2
3
  import { DateTime } from "luxon";
3
4
  import { RouterView, matchedRouteKey, useRoute, viewDepthKey } from "vue-router";
4
- import { FluxFadeTransition, FluxFlyout, FluxIcon, FluxMenu, FluxMenuItem, FluxPane, FluxRouteTransition, FluxSecondaryButton, FluxSpacer, FluxTabBar } from "@flux-ui/components";
5
- //#region ../../node_modules/.bun/@basmilius+utils@3.24.0/node_modules/@basmilius/utils/dist/index.mjs
5
+ //#region ../../node_modules/.bun/@basmilius+utils@3.25.0/node_modules/@basmilius/utils/dist/index.mjs
6
6
  function x$1(e) {
7
7
  let t = {};
8
8
  do {
@@ -3103,7 +3103,7 @@ useMode(definition$2);
3103
3103
  useMode(definition$1);
3104
3104
  useMode(definition);
3105
3105
  //#endregion
3106
- //#region ../../node_modules/.bun/@basmilius+http-client@3.24.0+96a7401e32316653/node_modules/@basmilius/http-client/dist/index.mjs
3106
+ //#region ../../node_modules/.bun/@basmilius+http-client@3.25.0+96a7401e32316653/node_modules/@basmilius/http-client/dist/index.mjs
3107
3107
  function c(e) {
3108
3108
  return class extends e {
3109
3109
  constructor(...e) {
@@ -3404,7 +3404,7 @@ X = Y = B([c], X);
3404
3404
  converter(`oklch`);
3405
3405
  RegExp(`[a-z]`), RegExp(`[A-Z]`), RegExp(`[0-9]`), RegExp(`[!"#$%&'()*+,-./:;<=>?@[\\\\\\]^_\`{|}~]`);
3406
3406
  //#endregion
3407
- //#region ../internals/dist/composable-Cp0PgZry.js
3407
+ //#region ../internals/dist/composable-DaZozn_3.js
3408
3408
  function D(e, t, n, r = { passive: !0 }) {
3409
3409
  watch(e, (e, i, a) => {
3410
3410
  e && (e.addEventListener(t, n, r), a(() => e.removeEventListener(t, n)));
@@ -3533,12 +3533,32 @@ var FluxApplication_default = /* @__PURE__ */ defineComponent({
3533
3533
  }
3534
3534
  },
3535
3535
  setup(__props) {
3536
- const route = useRoute_default();
3537
- const matchedMenuRoutes = useNamedRoutes_default(toRef(() => __props.contextMenuName));
3536
+ let resizeTimer;
3538
3537
  const isMenuCollapsed = k("application-menu-collapsed", true);
3538
+ const matchedMenuRoutes = useNamedRoutes_default(toRef(() => __props.contextMenuName));
3539
+ const route = useRoute_default();
3540
+ const { lg, xl } = useBreakpoints();
3541
+ const contextStack = shallowRef([]);
3539
3542
  const layout = ref("default");
3540
- const totalLevels = computed(() => 1 + matchedMenuRoutes.value.length);
3541
3543
  const viewIndex = ref(0);
3544
+ const activeContext = computed(() => contextStack.value.at(-1));
3545
+ const contexts = computed(() => contextStack.value);
3546
+ const totalLevels = computed(() => 1 + matchedMenuRoutes.value.length);
3547
+ onMounted(() => {
3548
+ if (typeof window === "undefined") return;
3549
+ window.addEventListener("resize", onResize, { passive: true });
3550
+ });
3551
+ onUnmounted(() => {
3552
+ if (typeof window !== "undefined") window.removeEventListener("resize", onResize);
3553
+ if (resizeTimer !== void 0) {
3554
+ clearTimeout(resizeTimer);
3555
+ resizeTimer = void 0;
3556
+ }
3557
+ if (typeof document !== "undefined") {
3558
+ delete document.documentElement.dataset.applicationMenuOpen;
3559
+ delete document.documentElement.dataset.applicationResizing;
3560
+ }
3561
+ });
3542
3562
  function clampViewIndex(target) {
3543
3563
  if (target < 0) return 0;
3544
3564
  const max = totalLevels.value - 1;
@@ -3560,15 +3580,34 @@ var FluxApplication_default = /* @__PURE__ */ defineComponent({
3560
3580
  function goToChild() {
3561
3581
  viewIndex.value = clampViewIndex(viewIndex.value + 1);
3562
3582
  }
3563
- const contextStack = shallowRef([]);
3564
- const contexts = computed(() => contextStack.value);
3565
- const activeContext = computed(() => contextStack.value.at(-1));
3583
+ function onResize() {
3584
+ if (typeof document === "undefined") return;
3585
+ document.documentElement.dataset.applicationResizing = "";
3586
+ if (resizeTimer !== void 0) clearTimeout(resizeTimer);
3587
+ resizeTimer = setTimeout(() => {
3588
+ delete document.documentElement.dataset.applicationResizing;
3589
+ resizeTimer = void 0;
3590
+ }, 150);
3591
+ }
3566
3592
  function pushContext(info) {
3567
3593
  contextStack.value = [...contextStack.value, info];
3568
3594
  }
3569
3595
  function removeContext(id) {
3570
3596
  contextStack.value = contextStack.value.filter((entry) => entry.id !== id);
3571
3597
  }
3598
+ watch(() => route.fullPath, () => {
3599
+ viewIndex.value = totalLevels.value - 1;
3600
+ if (!lg.value && !xl.value) isMenuCollapsed.value = true;
3601
+ });
3602
+ watch(totalLevels, (next) => {
3603
+ viewIndex.value = clampViewIndex(viewIndex.value);
3604
+ if (viewIndex.value === 0 && next > 1) viewIndex.value = next - 1;
3605
+ }, { immediate: true });
3606
+ watch(isMenuCollapsed, (collapsed) => {
3607
+ if (typeof document === "undefined") return;
3608
+ if (collapsed) delete document.documentElement.dataset.applicationMenuOpen;
3609
+ else document.documentElement.dataset.applicationMenuOpen = "";
3610
+ }, { immediate: true });
3572
3611
  provide(FluxApplicationInjectionKey, {
3573
3612
  activeContext,
3574
3613
  contexts,
@@ -3585,21 +3624,6 @@ var FluxApplication_default = /* @__PURE__ */ defineComponent({
3585
3624
  pushContext,
3586
3625
  removeContext
3587
3626
  });
3588
- watch(() => route.fullPath, () => {
3589
- viewIndex.value = totalLevels.value - 1;
3590
- });
3591
- watch(totalLevels, (next) => {
3592
- viewIndex.value = clampViewIndex(viewIndex.value);
3593
- if (viewIndex.value === 0 && next > 1) viewIndex.value = next - 1;
3594
- }, { immediate: true });
3595
- watch(isMenuCollapsed, (collapsed) => {
3596
- if (typeof document === "undefined") return;
3597
- if (collapsed) delete document.documentElement.dataset.applicationMenuOpen;
3598
- else document.documentElement.dataset.applicationMenuOpen = "";
3599
- }, { immediate: true });
3600
- onUnmounted(() => {
3601
- if (typeof document !== "undefined") delete document.documentElement.dataset.applicationMenuOpen;
3602
- });
3603
3627
  return (_ctx, _cache) => {
3604
3628
  return openBlock(), createElementBlock("div", { class: normalizeClass(unref(Application_module_default).application) }, [
3605
3629
  renderSlot(_ctx.$slots, "menu"),
@@ -3768,9 +3792,6 @@ var ApplicationMenu_module_default = {
3768
3792
  applicationMenuPanel: `application-menu-panel`,
3769
3793
  applicationMenuStage: `application-menu-stage`,
3770
3794
  applicationMenuTrack: `application-menu-track`,
3771
- applicationMenuPageIndicator: `application-menu-page-indicator`,
3772
- applicationMenuPageIndicatorDot: `application-menu-page-indicator-dot`,
3773
- applicationMenuPageIndicatorDotActive: `application-menu-page-indicator-dot-active`,
3774
3795
  applicationMenuPanelEnterActive: `application-menu-panel-enter-active`,
3775
3796
  applicationMenuPanelEnterFrom: `application-menu-panel-enter-from`,
3776
3797
  applicationMenuPanelLeaveActive: `application-menu-panel-leave-active`,