@noction/vue-bezier 1.0.5

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.
Files changed (46) hide show
  1. package/README.md +109 -0
  2. package/dist/Collapse/CollapseTransition.vue.d.ts +14 -0
  3. package/dist/Fade/FadeTransition.vue.d.ts +13 -0
  4. package/dist/Scale/ScaleTransition.vue.d.ts +26 -0
  5. package/dist/Slide/SlideXLeftTransition.vue.d.ts +22 -0
  6. package/dist/Slide/SlideXRightTransition.vue.d.ts +22 -0
  7. package/dist/Slide/SlideYDownTransition.vue.d.ts +22 -0
  8. package/dist/Slide/SlideYUpTransition.vue.d.ts +22 -0
  9. package/dist/Zoom/ZoomCenterTransition.vue.d.ts +13 -0
  10. package/dist/Zoom/ZoomUpTransition.vue.d.ts +22 -0
  11. package/dist/Zoom/ZoomXTransition.vue.d.ts +22 -0
  12. package/dist/Zoom/ZoomYTransition.vue.d.ts +22 -0
  13. package/dist/composable/buildComponentType.d.ts +3 -0
  14. package/dist/composable/buildEmits.d.ts +2 -0
  15. package/dist/composable/buildHooks.d.ts +7 -0
  16. package/dist/composable/buildProps.d.ts +48 -0
  17. package/dist/composable/buildTag.d.ts +2 -0
  18. package/dist/composable/index.d.ts +6 -0
  19. package/dist/index.d.ts +17 -0
  20. package/dist/style.css +1 -0
  21. package/dist/vue-bezier.mjs +456 -0
  22. package/dist/vue-bezier.umd.js +1 -0
  23. package/dist/web-types.json +156 -0
  24. package/package.json +63 -0
  25. package/src/components/Collapse/CollapseTransition.vue +122 -0
  26. package/src/components/Fade/FadeTransition.vue +52 -0
  27. package/src/components/Scale/ScaleTransition.vue +76 -0
  28. package/src/components/Slide/SlideXLeftTransition.vue +73 -0
  29. package/src/components/Slide/SlideXRightTransition.vue +73 -0
  30. package/src/components/Slide/SlideYDownTransition.vue +72 -0
  31. package/src/components/Slide/SlideYUpTransition.vue +74 -0
  32. package/src/components/Slide/move.scss +1 -0
  33. package/src/components/Zoom/ZoomCenterTransition.vue +63 -0
  34. package/src/components/Zoom/ZoomUpTransition.vue +75 -0
  35. package/src/components/Zoom/ZoomXTransition.vue +75 -0
  36. package/src/components/Zoom/ZoomYTransition.vue +78 -0
  37. package/src/components/Zoom/move.scss +1 -0
  38. package/src/composable/buildComponentType.ts +4 -0
  39. package/src/composable/buildEmits.ts +7 -0
  40. package/src/composable/buildHooks.ts +92 -0
  41. package/src/composable/buildProps.ts +52 -0
  42. package/src/composable/buildTag.ts +1 -0
  43. package/src/composable/index.ts +7 -0
  44. package/src/global-shim.d.ts +1 -0
  45. package/src/index.ts +62 -0
  46. package/src/vue-shim.d.ts +5 -0
package/README.md ADDED
@@ -0,0 +1,109 @@
1
+ # @noction/vue-bezier
2
+
3
+ [![NPM version](https://img.shields.io/npm/v/@noction/vue-bezier.svg?style=flat)](https://npmjs.com/package/@noction/vue-bezier)
4
+ [![NPM downloads](https://img.shields.io/npm/dm/@noction/vue-bezier.svg?style=flat)](https://npmjs.com/package/@noction/vue-bezier)
5
+ [![codecov](https://codecov.io/gh/50rayn/@noction/vue-bezier/branch/master/graph/badge.svg?token=IJ9ZDYJ65Z)](https://codecov.io/gh/50rayn/@noction/vue-bezier)
6
+ [![Featured on Openbase](https://badges.openbase.com/js/featured/@noction/vue-bezier.svg?token=hU9KYWV7h9YbmSVPtFbArzNxlWR8XfEc1pJhzSaLTp8=)](https://openbase.com/js/@noction/vue-bezier?utm_source=embedded&utm_medium=badge&utm_campaign=rate-badge)
7
+
8
+ ## [Demo](https://noction.github.io/vue-bezier)
9
+
10
+ ## Install :coffee:
11
+
12
+ ```bash
13
+ npm i -S @noction/vue-bezier
14
+ ```
15
+
16
+ ## Local usage :rocket:
17
+
18
+ ```vue
19
+ <template>
20
+ <fade-transition>
21
+ <div class="box" v-show="show">
22
+ <p>Fade transition</p>
23
+ </div>
24
+ </fade-transition>
25
+ </template>
26
+
27
+ <script>
28
+ import '@noction/vue-bezier/dist/style.css'
29
+ import { FadeTransition } from '@noction/vue-bezier'
30
+
31
+ export default {
32
+ components: {
33
+ FadeTransition
34
+ }
35
+ }
36
+ </script>
37
+ ```
38
+
39
+ ## Global usage
40
+ ```js
41
+ import '@noction/vue-bezier/dist/style.css'
42
+ import Transitions from '@noction/vue-bezier'
43
+ import { createApp } from 'vue'
44
+
45
+ const app = createApp(App)
46
+ app.use(Transitions)
47
+ ```
48
+
49
+ ## List of available transitions
50
+ - FadeTransition
51
+ - ZoomCenterTransition
52
+ - ZoomXTransition
53
+ - ZoomYTransition
54
+ - SlideXLeftTransition
55
+ - SlideXRightTransition
56
+ - SlideYUpTransition
57
+ - SlideYDownTransition
58
+ - ScaleTransition
59
+ - CollapseTransition
60
+
61
+ ## Props
62
+
63
+ | Prop | Type | Default | Description |
64
+ |:------------:|--------------------|:--------------------------------------------------------------------:|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
65
+ | **duration** | _Number_, _Object_ | `300` | Transition duration. Number for specifying the same duration for enter/leave transitions. <br> Object style `{enter: 300, leave: 300}` for specifying explicit durations for enter/leave. |
66
+ | **group** | _Boolean_ | `false` | Whether the component should be a `transition-group` component. |
67
+ | **tag** | _String_ | `'span'` | Transition tag, in case the component is a `transition-group.` |
68
+ | **origin** | _String_ | `''` | [Transform origin property](https://tympanus.net/codrops/css_reference/transform-origin/), can be specified with styles as well but it's shorter with this prop. |
69
+ | **styles** | _Object_ | `{ animationFillMode: 'both', animationTimingFunction: 'ease-out' }` | Element styles that are applied during transition. These styles are applied on `@beforeEnter` and `@beforeLeave` hooks. |
70
+
71
+ ## Group transitions
72
+ Each transition can be used as a `transition-group` by adding the `group` prop to one of the desired transitions.
73
+ ```html
74
+ <fade-transition group>
75
+ <!--keyed children here-->
76
+ </fade-transition>
77
+ ```
78
+ Gotchas/things to watch:
79
+ 1. Elements inside `group` transitions should have `display: inline-block` or must be placed in a flex context:
80
+ [Vue.js docs reference](https://vuejs.org/v2/guide/transitions.html#List-Move-Transitions)
81
+ 2. Each transition has a `move` class [move class docs](https://vuejs.org/v2/guide/transitions.html#List-Move-Transitions).
82
+ Unfortunately the duration for the move transition cannot be configured through props. By default each transition has a `move` class associated
83
+ with `.3s` transition duration:
84
+
85
+ - Zoom
86
+ ```css
87
+ .zoom-move { transition: transform .3s ease-out; }
88
+ ```
89
+ - Slide
90
+ ```css
91
+ .slide-move { transition: transform .3s ease-out; }
92
+ ```
93
+ - Scale
94
+ ```css
95
+ .scale-move { transition: transform .3s cubic-bezier(.25, .8, .50, 1); }
96
+ ```
97
+ - Fade
98
+ ```css
99
+ .fade-move { transition: transform .3s ease-out; }
100
+ ```
101
+ If you want to configure the duration, just redefine the class for the transition you use with the desired duration.
102
+
103
+ ## License
104
+
105
+ MIT &copy; [50rayn](https://github.com/50rayn)
106
+
107
+ ## Special thanks to
108
+
109
+ @cristijora (The UI for list transitions in the demo is inspired by [vue2-transitions](https://github.com/BinarCode/vue2-transitions) )
@@ -0,0 +1,14 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {
2
+ props: {
3
+ [x: string]: any;
4
+ };
5
+ emit: any;
6
+ componentType: any;
7
+ tag: any;
8
+ hooks: import("vue").BaseTransitionProps<import("vue").RendererElement>;
9
+ enterDuration: any;
10
+ leaveDuration: any;
11
+ transitionStyle: (duration: number) => string;
12
+ durationInSeconds: any;
13
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
14
+ export default _default;
@@ -0,0 +1,13 @@
1
+ declare const _default: {
2
+ setup(): {
3
+ props: {
4
+ [x: string]: any;
5
+ };
6
+ emit: any;
7
+ componentType: any;
8
+ tag: any;
9
+ hooks: any;
10
+ };
11
+ inheritAttrs: boolean;
12
+ };
13
+ export default _default;
@@ -0,0 +1,26 @@
1
+ export declare const customProps: {
2
+ origin: {
3
+ default: string;
4
+ type: StringConstructor;
5
+ };
6
+ styles: {
7
+ default: () => {
8
+ animationFillMode: string;
9
+ animationTimingFunction: string;
10
+ };
11
+ type: ObjectConstructor;
12
+ };
13
+ };
14
+ declare const _default: {
15
+ setup(): {
16
+ props: {
17
+ [x: string]: any;
18
+ };
19
+ emit: any;
20
+ componentType: any;
21
+ tag: any;
22
+ hooks: any;
23
+ };
24
+ inheritAttrs: boolean;
25
+ };
26
+ export default _default;
@@ -0,0 +1,22 @@
1
+ export declare const customProps: {
2
+ styles: {
3
+ default: () => {
4
+ animationFillMode: string;
5
+ animationTimingFunction: string;
6
+ };
7
+ type: ObjectConstructor;
8
+ };
9
+ };
10
+ declare const _default: {
11
+ setup(): {
12
+ props: {
13
+ [x: string]: any;
14
+ };
15
+ emit: any;
16
+ componentType: any;
17
+ tag: any;
18
+ hooks: any;
19
+ };
20
+ inheritAttrs: boolean;
21
+ };
22
+ export default _default;
@@ -0,0 +1,22 @@
1
+ export declare const customProps: {
2
+ styles: {
3
+ default: () => {
4
+ animationFillMode: string;
5
+ animationTimingFunction: string;
6
+ };
7
+ type: ObjectConstructor;
8
+ };
9
+ };
10
+ declare const _default: {
11
+ setup(): {
12
+ props: {
13
+ [x: string]: any;
14
+ };
15
+ emit: any;
16
+ componentType: any;
17
+ tag: any;
18
+ hooks: any;
19
+ };
20
+ inheritAttrs: boolean;
21
+ };
22
+ export default _default;
@@ -0,0 +1,22 @@
1
+ export declare const customProps: {
2
+ styles: {
3
+ default: () => {
4
+ animationFillMode: string;
5
+ animationTimingFunction: string;
6
+ };
7
+ type: ObjectConstructor;
8
+ };
9
+ };
10
+ declare const _default: {
11
+ setup(): {
12
+ props: {
13
+ [x: string]: any;
14
+ };
15
+ emit: any;
16
+ componentType: any;
17
+ tag: any;
18
+ hooks: any;
19
+ };
20
+ inheritAttrs: boolean;
21
+ };
22
+ export default _default;
@@ -0,0 +1,22 @@
1
+ export declare const customProps: {
2
+ styles: {
3
+ default: () => {
4
+ animationFillMode: string;
5
+ animationTimingFunction: string;
6
+ };
7
+ type: ObjectConstructor;
8
+ };
9
+ };
10
+ declare const _default: {
11
+ setup(): {
12
+ props: {
13
+ [x: string]: any;
14
+ };
15
+ emit: any;
16
+ componentType: any;
17
+ tag: any;
18
+ hooks: any;
19
+ };
20
+ inheritAttrs: boolean;
21
+ };
22
+ export default _default;
@@ -0,0 +1,13 @@
1
+ declare const _default: {
2
+ setup(): {
3
+ props: {
4
+ [x: string]: any;
5
+ };
6
+ emit: any;
7
+ componentType: any;
8
+ tag: any;
9
+ hooks: any;
10
+ };
11
+ inheritAttrs: boolean;
12
+ };
13
+ export default _default;
@@ -0,0 +1,22 @@
1
+ export declare const customProps: {
2
+ styles: {
3
+ default: () => {
4
+ animationFillMode: string;
5
+ animationTimingFunction: string;
6
+ };
7
+ type: ObjectConstructor;
8
+ };
9
+ };
10
+ declare const _default: {
11
+ setup(): {
12
+ props: {
13
+ [x: string]: any;
14
+ };
15
+ emit: any;
16
+ componentType: any;
17
+ tag: any;
18
+ hooks: any;
19
+ };
20
+ inheritAttrs: boolean;
21
+ };
22
+ export default _default;
@@ -0,0 +1,22 @@
1
+ export declare const customProps: {
2
+ styles: {
3
+ default: () => {
4
+ animationFillMode: string;
5
+ animationTimingFunction: string;
6
+ };
7
+ type: ObjectConstructor;
8
+ };
9
+ };
10
+ declare const _default: {
11
+ setup(): {
12
+ props: {
13
+ [x: string]: any;
14
+ };
15
+ emit: any;
16
+ componentType: any;
17
+ tag: any;
18
+ hooks: any;
19
+ };
20
+ inheritAttrs: boolean;
21
+ };
22
+ export default _default;
@@ -0,0 +1,22 @@
1
+ export declare const customProps: {
2
+ styles: {
3
+ default: () => {
4
+ animationFillMode: string;
5
+ animationTimingFunction: string;
6
+ };
7
+ type: ObjectConstructor;
8
+ };
9
+ };
10
+ declare const _default: {
11
+ setup(): {
12
+ props: {
13
+ [x: string]: any;
14
+ };
15
+ emit: any;
16
+ componentType: any;
17
+ tag: any;
18
+ hooks: any;
19
+ };
20
+ inheritAttrs: boolean;
21
+ };
22
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { Component } from 'vue';
2
+ declare const _default: (props: any) => Component;
3
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => string[];
2
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { BaseTransitionProps, RendererElement } from 'vue';
2
+ declare const leave: (props: any, el: RendererElement, done: () => void) => void;
3
+ declare const setStyles: (props: any, el: RendererElement) => void;
4
+ declare const setAbsolutePosition: (props: any, el: RendererElement) => void;
5
+ declare const _default: (props: any, emit: any) => BaseTransitionProps;
6
+ export default _default;
7
+ export { leave, setAbsolutePosition, setStyles };
@@ -0,0 +1,48 @@
1
+ declare const _default: (customProps?: Record<string, unknown>) => {
2
+ /**
3
+ * Transition delay. Number for specifying the same delay for enter/leave transitions
4
+ * Object style {enter: 300, leave: 300} for specifying explicit durations for enter/leave
5
+ */
6
+ delay: {
7
+ default: number;
8
+ type: (ObjectConstructor | NumberConstructor)[];
9
+ };
10
+ /**
11
+ * Transition duration. Number for specifying the same duration for enter/leave transitions
12
+ * Object style {enter: 300, leave: 300} for specifying explicit durations for enter/leave
13
+ */
14
+ duration: {
15
+ default: number;
16
+ type: (ObjectConstructor | NumberConstructor)[];
17
+ };
18
+ /**
19
+ * Whether the component should be a `transition-group` component.
20
+ */
21
+ group: BooleanConstructor;
22
+ /**
23
+ * Transform origin property https://tympanus.net/codrops/css_reference/transform-origin/.
24
+ * Can be specified with styles as well but it's shorter with this prop
25
+ */
26
+ origin: {
27
+ default: string;
28
+ type: StringConstructor;
29
+ };
30
+ /**
31
+ * Element styles that are applied during transition. These styles are applied on @beforeEnter and @beforeLeave hooks
32
+ */
33
+ styles: {
34
+ default: () => {
35
+ animationFillMode: string;
36
+ animationTimingFunction: string;
37
+ };
38
+ type: ObjectConstructor;
39
+ };
40
+ /**
41
+ * Transition tag, in case the component is a `transition-group`
42
+ */
43
+ tag: {
44
+ default: string;
45
+ type: StringConstructor;
46
+ };
47
+ };
48
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: (props: any) => any;
2
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import buildComponentType from './buildComponentType';
2
+ import buildEmits from './buildEmits';
3
+ import buildHooks from './buildHooks';
4
+ import buildProps from './buildProps';
5
+ import buildTag from './buildTag';
6
+ export { buildComponentType, buildEmits, buildHooks, buildProps, buildTag };
@@ -0,0 +1,17 @@
1
+ import PrivateCollapseTransition from './components/Collapse/CollapseTransition.vue';
2
+ import PrivateFadeTransition from './components/Fade/FadeTransition.vue';
3
+ import PrivateScaleTransition from './components/Scale/ScaleTransition.vue';
4
+ import PrivateSlideXLeftTransition from './components/Slide/SlideXLeftTransition.vue';
5
+ import PrivateSlideXRightTransition from './components/Slide/SlideXRightTransition.vue';
6
+ import PrivateSlideYDownTransition from './components/Slide/SlideYDownTransition.vue';
7
+ import PrivateSlideYUpTransition from './components/Slide/SlideYUpTransition.vue';
8
+ import PrivateZoomCenterTransition from './components/Zoom/ZoomCenterTransition.vue';
9
+ import PrivateZoomUpTransition from './components/Zoom/ZoomUpTransition.vue';
10
+ import PrivateZoomXTransition from './components/Zoom/ZoomXTransition.vue';
11
+ import PrivateZoomYTransition from './components/Zoom/ZoomYTransition.vue';
12
+ export { PrivateCollapseTransition as CollapseTransition, PrivateFadeTransition as FadeTransition, PrivateScaleTransition as ScaleTransition, PrivateSlideXLeftTransition as SlideXLeftTransition, PrivateSlideXRightTransition as SlideXRightTransition, PrivateSlideYDownTransition as SlideYDownTransition, PrivateSlideYUpTransition as SlideYUpTransition, PrivateZoomCenterTransition as ZoomCenterTransition, PrivateZoomUpTransition as ZoomUpTransition, PrivateZoomXTransition as ZoomXTransition, PrivateZoomYTransition as ZoomYTransition };
13
+ export declare function install(app: any): void;
14
+ declare const _default: {
15
+ install: typeof install;
16
+ };
17
+ export default _default;
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .collapse-move{transition:transform .3s ease-in-out}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-out{0%{opacity:1}to{opacity:0}}.fade-in{animation-name:fade-in}.fade-out{animation-name:fade-out}.fade-move{transition:transform .3s ease-out}@keyframes scale-in{0%{opacity:0;transform:scale(0)}to{opacity:1}}@keyframes scale-out{0%{opacity:1}to{opacity:0;transform:scale(0)}}.scale-in{animation-name:scale-in}.scale-out{animation-name:scale-out}.scale-move{transition:transform .3s cubic-bezier(.25,.8,.5,1)}@keyframes slide-x-left-in{0%{opacity:0;transform:translate(-15px)}to{opacity:1}}@keyframes slide-x-left-out{0%{opacity:1}to{opacity:0;transform:translate(-15px)}}.slide-x-left-in{animation-name:slide-x-left-in}.slide-x-left-out{animation-name:slide-x-left-out}@keyframes slide-x-right-in{0%{opacity:0;transform:translate(15px)}to{opacity:1}}@keyframes slide-x-right-out{0%{opacity:1}to{opacity:0;transform:translate(15px)}}.slide-x-right-in{animation-name:slide-x-right-in}.slide-x-right-out{animation-name:slide-x-right-out}@keyframes slide-y-down-in{0%{opacity:0;transform:translateY(15px)}to{opacity:1}}@keyframes slide-y-down-out{0%{opacity:1}to{opacity:0;transform:translateY(15px)}}.slide-y-down-in{animation-name:slide-y-down-in}.slide-y-down-out{animation-name:slide-y-down-out}.slide-move{transition:transform .3s}@keyframes slide-y-in{0%{opacity:0;transform:translateY(-15px)}to{opacity:1}}@keyframes slide-y-out{0%{opacity:1}to{opacity:0;transform:translateY(-15px)}}.slide-y-in{animation-name:slide-y-in}.slide-y-out{animation-name:slide-y-out}@keyframes zoom-in{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes zoom-out{0%{opacity:1}50%{opacity:0;transform:scale3d(.3,.3,.3)}to{opacity:0}}.zoom-in{animation-name:zoom-in}.zoom-out{animation-name:zoom-out}@keyframes zoom-in-up{0%{opacity:0;transform:scaleY(0);transform-origin:top center}50%{opacity:1}to{transform:scaleY(1)}}@keyframes zoom-out-up{0%{opacity:1}50%{transform:scaleY(0)}to{opacity:0}}.zoom-in-up{animation-name:zoom-in-up}.zoom-out-up{animation-name:zoom-out-up}@keyframes zoom-in-x{0%{opacity:0;transform:scaleX(0)}50%{opacity:1}}@keyframes zoom-out-x{0%{opacity:1}50%{opacity:0;transform:scaleX(0)}to{opacity:0}}.zoom-in-x{animation-name:zoom-in-x}.zoom-out-x{animation-name:zoom-out-x}.zoom-move{transition:transform .3s ease-out}@keyframes zoom-in-y{0%{opacity:0;transform:scaleY(0)}50%{opacity:1;transform:scaleY(1)}}@keyframes zoom-out-y{0%{opacity:1}50%{opacity:0;transform:scaleY(0)}to{opacity:0}}.zoom-in-y{animation-name:zoom-in-y}.zoom-out-y{animation-name:zoom-out-y}