@nexxtmove/ui 0.1.70 → 0.1.72

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nexxtmove/ui",
3
3
  "type": "module",
4
- "version": "0.1.70",
4
+ "version": "0.1.72",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { ref, computed, onMounted, onUnmounted } from 'vue'
2
+ import { ref, computed, watch, nextTick, onMounted, onUnmounted } from 'vue'
3
3
  import { useFloating, autoUpdate, flip, shift, offset, size } from '@floating-ui/vue'
4
4
  import type { Placement } from '@floating-ui/vue'
5
5
 
@@ -25,6 +25,9 @@ const emit = defineEmits<{
25
25
  const isOpen = ref(false)
26
26
  // Keeps the positioning container alive while the leave transition plays.
27
27
  const isLeaving = ref(false)
28
+ // Tracks whether floating-ui has computed the position *for the current open cycle*.
29
+ // Reset on every open() so the Transition always sees false→true and plays the enter animation.
30
+ const isReady = ref(false)
28
31
  const triggerRef = ref<HTMLElement | null>(null)
29
32
  const floatingRef = ref<HTMLElement | null>(null)
30
33
 
@@ -58,9 +61,16 @@ const {
58
61
  transform: false,
59
62
  })
60
63
 
61
- const open = () => {
64
+ const open = async () => {
65
+ isReady.value = false
62
66
  isOpen.value = true
63
67
  emit('open')
68
+ // Wait for Vue to render the v-if with isReady=false before setting it true.
69
+ // This guarantees the Transition always sees false→true and plays the enter animation,
70
+ // even when isPositioned is already true from a previous open cycle.
71
+ await nextTick()
72
+ if (isPositioned.value) isReady.value = true
73
+ // If not yet positioned, the watcher below will set isReady once it resolves.
64
74
  }
65
75
 
66
76
  const close = () => {
@@ -120,6 +130,10 @@ const transitionClasses = computed(() => {
120
130
  }
121
131
  })
122
132
 
133
+ watch(isPositioned, (val) => {
134
+ if (val && isOpen.value) isReady.value = true
135
+ })
136
+
123
137
  defineExpose({ isOpen, open, close, toggle, triggerRef, floatingRef })
124
138
 
125
139
  onMounted(() => {
@@ -152,7 +166,7 @@ onUnmounted(() => {
152
166
  originates from the trigger — never from the page origin.
153
167
  -->
154
168
  <Transition v-bind="transitionClasses" @after-leave="isLeaving = false">
155
- <div v-if="isOpen && isPositioned">
169
+ <div v-if="isOpen && isReady">
156
170
  <slot name="content" :is-open="isOpen" :close="close" :toggle="toggle" />
157
171
  </div>
158
172
  </Transition>
@@ -97,6 +97,24 @@
97
97
  }
98
98
  }
99
99
 
100
+ .button-warning {
101
+ @apply bg-button-bg-warning-default text-button-text-warning-default;
102
+ &:hover {
103
+ @media (hover: hover) {
104
+ @apply bg-button-bg-warning-hover;
105
+ }
106
+ }
107
+ &:focus-visible {
108
+ @apply bg-button-bg-warning-focussed outline-button-border-warning-focussed outline outline-solid;
109
+ }
110
+ &:active {
111
+ @apply bg-button-bg-warning-selected;
112
+ }
113
+ &:disabled {
114
+ @apply bg-button-bg-warning-disabled text-button-text-warning-disabled;
115
+ }
116
+ }
117
+
100
118
  .progress-bar {
101
119
  @apply border-progress-bar-border border border-solid;
102
120
  }
@@ -133,6 +133,11 @@
133
133
  --color-button-bg-danger-focussed: var(--color-brick-500);
134
134
  --color-button-bg-danger-selected: var(--color-brick-700);
135
135
  --color-button-bg-danger-disabled: var(--color-brick-100);
136
+ --color-button-bg-warning-default: var(--color-orange-500);
137
+ --color-button-bg-warning-hover: var(--color-orange-600);
138
+ --color-button-bg-warning-focussed: var(--color-orange-500);
139
+ --color-button-bg-warning-selected: var(--color-orange-700);
140
+ --color-button-bg-warning-disabled: var(--color-orange-100);
136
141
  --color-button-text-primary-default: var(--color-white);
137
142
  --color-button-text-primary-disabled: var(--color-gray-600);
138
143
  --color-button-text-secondary-default: var(--color-gray-950);
@@ -146,6 +151,8 @@
146
151
  --color-button-text-success-disabled: var(--color-gray-100);
147
152
  --color-button-text-danger-default: var(--color-white);
148
153
  --color-button-text-danger-disabled: var(--color-gray-100);
154
+ --color-button-text-warning-default: var(--color-white);
155
+ --color-button-text-warning-disabled: var(--color-gray-600);
149
156
  --color-button-border-primary-focussed: var(--color-cornflower-blue-100);
150
157
  --color-button-border-secondary-focussed: var(--color-cornflower-blue-100);
151
158
  --color-button-border-secondary-hover: var(--color-cornflower-blue-700);
@@ -155,6 +162,7 @@
155
162
  --color-button-border-link-focussed: var(--color-cornflower-blue-100);
156
163
  --color-button-border-success-focussed: var(--color-green-100);
157
164
  --color-button-border-danger-focussed: var(--color-brick-100);
165
+ --color-button-border-warning-focussed: var(--color-orange-100);
158
166
  --color-progress-bar-bg-progress: var(--color-cornflower-blue-500);
159
167
  --color-progress-bar-bg-bar: var(--color-gray-50);
160
168
  --color-progress-bar-border: var(--color-gray-200);