@globalbrain/sefirot 3.1.0 → 3.2.0

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.
@@ -86,7 +86,7 @@ function emitBlur() {
86
86
  autocomplete="off"
87
87
  :value="inputValue"
88
88
  :disabled="disabled"
89
- v-on="disabled || inputEvents"
89
+ v-on="disabled ? {} : inputEvents"
90
90
  @blur="emitBlur"
91
91
  >
92
92
  </DatePicker>
@@ -0,0 +1,56 @@
1
+ <script setup lang="ts">
2
+ import { useIntersectionObserver } from '@vueuse/core'
3
+ import { ref } from 'vue'
4
+
5
+ export interface Props {
6
+ as?: string
7
+ x?: string
8
+ y?: string
9
+ opacity?: string | number
10
+ duration?: string
11
+ delay?: string
12
+ once?: boolean
13
+ }
14
+
15
+ const props = withDefaults(defineProps<Props>(), {
16
+ as: 'div',
17
+ x: '0',
18
+ y: '0',
19
+ opacity: 1,
20
+ duration: '0.75s',
21
+ delay: '0s',
22
+ once: true
23
+ })
24
+
25
+ const target = ref<HTMLElement | null>(null)
26
+ const on = ref(false)
27
+
28
+ const { stop } = useIntersectionObserver(target, ([{ isIntersecting }]) => {
29
+ on.value = isIntersecting
30
+ if (on.value && props.once) {
31
+ stop()
32
+ }
33
+ })
34
+ </script>
35
+
36
+ <template>
37
+ <component :is="as" class="SM" :class="{ on }" ref="target">
38
+ <slot :on="on" />
39
+ </component>
40
+ </template>
41
+
42
+ <style scoped lang="postcss">
43
+ .SM {
44
+ position: relative;
45
+ opacity: v-bind(opacity);
46
+ transform: translate(v-bind(x), v-bind(y));
47
+ transition: opacity, transform;
48
+ transition-duration: v-bind(duration);
49
+ transition-delay: v-bind(delay);
50
+ }
51
+
52
+ .SM.on {
53
+ opacity: 1;
54
+ transform: translate(0, 0);
55
+ }
56
+ </style>
@@ -0,0 +1,13 @@
1
+ <script setup lang="ts">
2
+ import SM, { type Props } from './SM.vue'
3
+
4
+ withDefaults(defineProps<Props>(), {
5
+ opacity: 0
6
+ })
7
+ </script>
8
+
9
+ <template>
10
+ <SM class="SMFade" v-bind="$props" v-slot="{ on }">
11
+ <slot :on="on" />
12
+ </SM>
13
+ </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@globalbrain/sefirot",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "packageManager": "pnpm@8.8.0",
5
5
  "description": "Vue Components for Global Brain Design System.",
6
6
  "author": "Kia Ishii <ka.ishii@globalbrains.com>",