@altafusion/fugue-ui 0.6.1 → 0.6.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @altafusion/fugue-ui
2
2
 
3
+ ## 0.6.3
4
+
5
+ ### Patch Changes
6
+
7
+ - @altafusion/fugue-nuxt-ui@0.6.3
8
+
9
+ ## 0.6.2
10
+
11
+ ### Patch Changes
12
+
13
+ - daa45b0: Fix the dev tools drawer showing the page through it, and put the dev tools above everything on the site.
14
+
15
+ - The drawer surface was `bg-muted`, which a theme may make translucent (fugue-theme's black canvas sets `--ui-bg-muted` to `rgb(255 255 255 / 0.05)`), so photo tiles, their buttons and other docks showed through its text. It is now painted over a solid `--ui-bg` base.
16
+ - A drag that ends over the open drawer no longer drops onto a tile behind it, and dragging across it starts no drawer gesture.
17
+ - Stacking is explicit and lives in one place (CSS variables in `devtools-panel.css`): site docks 40, site overlays 50, dev tools dock 70, drawer 75, tooltips and menus 80. The scattered `z-50` and `z-[60]` are gone.
18
+ - `FloatingDock` gets a `zIndex` prop (default `40`, applied to the wrapper). The dev tools dock passes its own.
19
+ - The drawer and the dock's bar are `#1e1e77` in dark mode (solid, so the theme cannot make them translucent). Both are restyled with Nuxt UI's `ui` convention: `<DevToolsPanel :ui="{ bar, panel }" />`. `FloatingDock` gets the same: `ui: { bar, panel }`, merged over its defaults.
20
+ - @altafusion/fugue-nuxt-ui@0.6.2
21
+
3
22
  ## 0.6.1
4
23
 
5
24
  ### Patch Changes
package/README.md CHANGED
@@ -44,6 +44,8 @@ A small bar fixed to the bottom of the page. The user drags it left and right by
44
44
  | `align` | which end of the dock's box the bar sits at: `start`, `center` (default) or `end`. With `end` and `defaultPercent` `100` the bar's right end meets the page margin |
45
45
  | `margin` | distance in px from each page edge at 0 and 100 percent; default `8` |
46
46
  | `bottomClass` | Tailwind class for the distance from the bottom edge; default `bottom-20`. Pass a literal class that exists in your app's source, such as `bottom-4` |
47
+ | `zIndex` | stacking level of the whole dock, a number or any CSS value such as `var(--my-layer)`; default `40`, above page content and sticky bars and below Nuxt UI modals and overlays (50). Raise it only for chrome that must outrank them (the dev tools dock uses 70) |
48
+ | `ui` | `{ bar, panel }`: classes merged over the defaults (Nuxt UI's `ui` convention), so yours win. `bar` is the pill with the grip and the label button, `panel` the box above it. Use it to restyle an editing-controls dock, say `:ui="{ bar: 'bg-elevated' }"` |
47
49
  | `v-model:open` | whether the panel is showing (or, with no slot, what the button toggles) |
48
50
 
49
51
  Pieces: `components/FloatingDock.vue`, `composables/useDraggableDock.ts` (VueUse `useDraggable` turned into one saved percentage, plus the keys), and `lib/floating-dock-position.ts` (pure position math, unit tested).
@@ -54,6 +56,7 @@ Design choices worth keeping:
54
56
  - **Only the grip drags.** The label button only toggles the panel. Handlers sit on a plain element around the grip button because forwarding pointer events through `UButton` was unreliable.
55
57
  - **One fixed width** (`w-56`) open or closed; the bar is centred in it and the panel is a separate box above it.
56
58
  - **Teleported to `body`**, so no transformed ancestor becomes the fixed reference.
59
+ - **The `zIndex` is on the wrapper** (inline style, since it is a value rather than a literal class), so the bar and its panel always stack together. Studio only rewrites `left`, so it leaves it alone.
57
60
 
58
61
  ### Nuxt Studio moves fixed elements
59
62
 
@@ -1,4 +1,7 @@
1
1
  <script setup lang="ts">
2
+ import type { FloatingDockUi } from './floatingDock.shared'
3
+ import { floatingDockClasses } from './floatingDock.shared'
4
+
2
5
  defineOptions({ name: 'FloatingDock' })
3
6
 
4
7
  /**
@@ -16,6 +19,8 @@ const {
16
19
  bottomClass = 'bottom-20',
17
20
  align = 'center',
18
21
  margin = 8,
22
+ zIndex = 40,
23
+ ui,
19
24
  } = defineProps<{
20
25
  /** localStorage key the bar's position is remembered under. */
21
26
  storageKey: string
@@ -29,8 +34,17 @@ const {
29
34
  align?: 'start' | 'center' | 'end'
30
35
  /** Distance in px from each page edge at the extremes (0 and 100 percent). */
31
36
  margin?: number
37
+ /**
38
+ * Stacking level of the whole dock (a number, or any CSS value such as `var(--my-layer)`). The default 40 puts it above page
39
+ * content and sticky bars and below Nuxt UI's modals and overlays (50). Raise it only for chrome that must outrank them.
40
+ */
41
+ zIndex?: number | string
42
+ /** Classes for the `bar` and the `panel`, merged over the defaults (Nuxt UI's `ui` convention). */
43
+ ui?: FloatingDockUi
32
44
  }>()
33
45
 
46
+ const classes = computed(() => floatingDockClasses(ui))
47
+
34
48
  const open = defineModel<boolean>('open', { default: false })
35
49
 
36
50
  const dock = useTemplateRef<HTMLElement>('dock')
@@ -50,7 +64,8 @@ const { dragging, dockStyle, onKeydown } = useDraggableDock(dock, grip, area, {
50
64
  -->
51
65
  <div
52
66
  ref="area"
53
- class="pointer-events-none fixed inset-0 z-40"
67
+ class="pointer-events-none fixed inset-0"
68
+ :style="{ zIndex }"
54
69
  >
55
70
  <div
56
71
  ref="dock"
@@ -60,15 +75,14 @@ const { dragging, dockStyle, onKeydown } = useDraggableDock(dock, grip, area, {
60
75
  >
61
76
  <div
62
77
  v-if="open && $slots.default"
63
- class="pointer-events-auto rounded-xl border border-primary/40 bg-default px-4 py-3 shadow-lg"
78
+ :class="classes.panel"
64
79
  role="group"
65
80
  :aria-label="label"
66
81
  >
67
82
  <slot />
68
83
  </div>
69
84
  <div
70
- class="pointer-events-auto flex w-fit items-center rounded-full border border-primary/40 bg-default p-0.5 shadow-lg"
71
- :class="{ 'self-start': align === 'start', 'self-center': align === 'center', 'self-end': align === 'end' }"
85
+ :class="[classes.bar, { 'self-start': align === 'start', 'self-center': align === 'center', 'self-end': align === 'end' }]"
72
86
  >
73
87
  <!-- The drag handle is a plain element: pointer events bubble up to it from the button, and no component has to forward them. -->
74
88
  <div
@@ -0,0 +1,20 @@
1
+ import type { ClassNameValue } from 'tailwind-merge'
2
+ import { twMerge } from 'tailwind-merge'
3
+
4
+ /** Classes a site can add to or override on a {@link FloatingDock}, as Nuxt UI's `ui` prop does: later classes win over the defaults. */
5
+ export interface FloatingDockUi {
6
+ /** The rounded bar with the grip and the label button. */
7
+ bar?: ClassNameValue
8
+ /** The box above the bar that holds the default slot (shown while open). */
9
+ panel?: ClassNameValue
10
+ }
11
+
12
+ export const FLOATING_DOCK_BAR_CLASS = 'pointer-events-auto flex w-fit items-center rounded-full border border-primary/40 bg-default p-0.5 shadow-lg'
13
+ export const FLOATING_DOCK_PANEL_CLASS = 'pointer-events-auto rounded-xl border border-primary/40 bg-default px-4 py-3 shadow-lg'
14
+
15
+ export function floatingDockClasses(ui?: FloatingDockUi) {
16
+ return {
17
+ bar: twMerge(FLOATING_DOCK_BAR_CLASS, ui?.bar),
18
+ panel: twMerge(FLOATING_DOCK_PANEL_CLASS, ui?.panel),
19
+ }
20
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@altafusion/fugue-ui",
3
3
  "type": "module",
4
- "version": "0.6.1",
4
+ "version": "0.6.3",
5
5
  "description": "Generic Vue UI primitives on Nuxt UI — reusable across Altafusion apps",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/altafusion/fugue/tree/main/packages-fugue/fugue-ui#readme",
@@ -27,13 +27,13 @@
27
27
  "vue": "^3.5.0"
28
28
  },
29
29
  "dependencies": {
30
- "@altafusion/fugue-nuxt-ui": "0.6.1",
30
+ "@altafusion/fugue-nuxt-ui": "0.6.3",
31
31
  "@vueuse/core": "^14.4.0",
32
32
  "tailwind-merge": "^3.7.1"
33
33
  },
34
34
  "devDependencies": {
35
- "@altafusion/eslint-config": "0.6.1",
36
- "@altafusion/nuxt-base": "0.6.1",
35
+ "@altafusion/eslint-config": "0.6.3",
36
+ "@altafusion/nuxt-base": "0.6.3",
37
37
  "@nuxt/ui": "^4.13.1",
38
38
  "@types/node": "^26.6.11",
39
39
  "eslint": "^10.15.0",