@luanlu/mk-motion 1.1.0 → 1.2.1

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 (131) hide show
  1. package/package.json +14 -2
  2. package/src/a11y/focus-trap.ts +64 -0
  3. package/src/a11y/keyboard.ts +43 -0
  4. package/src/components/alert/alert.css +111 -0
  5. package/src/components/alert/alert.ts +107 -0
  6. package/src/components/avatar/avatar.css +112 -0
  7. package/src/components/avatar/avatar.ts +175 -0
  8. package/src/components/breadcrumb/breadcrumb.css +31 -0
  9. package/src/components/breadcrumb/breadcrumb.ts +71 -0
  10. package/src/components/button/button.css +108 -0
  11. package/src/components/button/button.ts +140 -0
  12. package/src/components/card/card.css +52 -0
  13. package/src/components/card/card.ts +87 -0
  14. package/src/components/collapse/collapse.css +76 -0
  15. package/src/components/collapse/collapse.ts +168 -0
  16. package/src/components/dialog/dialog.css +78 -0
  17. package/src/components/dialog/dialog.ts +164 -0
  18. package/src/components/drawer/drawer.css +73 -0
  19. package/src/components/drawer/drawer.ts +131 -0
  20. package/src/components/empty/empty.css +36 -0
  21. package/src/components/empty/empty.ts +85 -0
  22. package/src/components/form/checkbox.css +56 -0
  23. package/src/components/form/checkbox.ts +119 -0
  24. package/src/components/form/radio.css +57 -0
  25. package/src/components/form/radio.ts +153 -0
  26. package/src/components/form/select.css +91 -0
  27. package/src/components/form/select.ts +174 -0
  28. package/src/components/form/slider.css +56 -0
  29. package/src/components/form/slider.ts +148 -0
  30. package/src/components/input/input.css +92 -0
  31. package/src/components/input/input.ts +162 -0
  32. package/src/components/layout/divider.css +32 -0
  33. package/src/components/layout/divider.ts +42 -0
  34. package/src/components/layout/row.css +64 -0
  35. package/src/components/layout/row.ts +57 -0
  36. package/src/components/layout/space.css +14 -0
  37. package/src/components/layout/space.ts +48 -0
  38. package/src/components/loading/loading.css +37 -0
  39. package/src/components/loading/loading.ts +46 -0
  40. package/src/components/menu/menu.css +121 -0
  41. package/src/components/menu/menu.ts +187 -0
  42. package/src/components/message/message.css +64 -0
  43. package/src/components/message/message.ts +96 -0
  44. package/src/components/popover/popover.css +73 -0
  45. package/src/components/popover/popover.ts +279 -0
  46. package/src/components/progress/progress.css +112 -0
  47. package/src/components/progress/progress.ts +171 -0
  48. package/src/components/steps/steps.css +127 -0
  49. package/src/components/steps/steps.ts +102 -0
  50. package/src/components/styles/components.css +28 -0
  51. package/src/components/styles/reset.css +24 -0
  52. package/src/components/styles/tokens.css +248 -0
  53. package/src/components/styles/variables.css +24 -0
  54. package/src/components/switch/switch.css +53 -0
  55. package/src/components/switch/switch.ts +103 -0
  56. package/src/components/table/table.css +192 -0
  57. package/src/components/table/table.ts +370 -0
  58. package/src/components/tabs/tabs.css +138 -0
  59. package/src/components/tabs/tabs.ts +211 -0
  60. package/src/components/tag/tag.css +123 -0
  61. package/src/components/tag/tag.ts +112 -0
  62. package/src/components/tooltip/tooltip.css +66 -0
  63. package/src/components/tooltip/tooltip.ts +185 -0
  64. package/src/core/animator.ts +124 -0
  65. package/src/core/timeline.ts +128 -0
  66. package/src/core/utils.ts +47 -0
  67. package/src/effects/glitch.ts +99 -0
  68. package/src/effects/particle.ts +134 -0
  69. package/src/effects/text-split.ts +95 -0
  70. package/src/effects/wave-text.ts +88 -0
  71. package/src/gesture/draggable.ts +130 -0
  72. package/src/gesture/spring.ts +152 -0
  73. package/src/index.ts +162 -0
  74. package/src/interactive/coverflow.ts +100 -0
  75. package/src/interactive/cursor-trail.ts +113 -0
  76. package/src/interactive/flip-card.ts +114 -0
  77. package/src/interactive/magnetic.ts +121 -0
  78. package/src/micro/hover-lift.ts +94 -0
  79. package/src/micro/ripple.ts +130 -0
  80. package/src/motion/component-motion.ts +177 -0
  81. package/src/nuxt/module.ts +46 -0
  82. package/src/presets/index.ts +69 -0
  83. package/src/scroll/scroll-trigger.ts +104 -0
  84. package/src/styles/animations.css +135 -0
  85. package/src/styles/element-plus.css +174 -0
  86. package/src/text/count-up.ts +108 -0
  87. package/src/text/typewriter.ts +109 -0
  88. package/src/theme/dark.css +19 -0
  89. package/src/theme/light.css +19 -0
  90. package/src/theme/theme.ts +65 -0
  91. package/src/transitions/blur-reveal.ts +92 -0
  92. package/src/transitions/collapse.ts +112 -0
  93. package/src/transitions/lazy-image.ts +87 -0
  94. package/src/transitions/list.ts +75 -0
  95. package/src/transitions/loading.ts +95 -0
  96. package/src/transitions/parallax.ts +60 -0
  97. package/src/transitions/shimmer.ts +105 -0
  98. package/src/transitions/toast.ts +151 -0
  99. package/src/types.d.ts +4 -0
  100. package/src/vite/plugin.ts +45 -0
  101. package/src/vue/button.ts +28 -9
  102. package/src/vue/card.ts +28 -8
  103. package/src/vue/composables/index.ts +4 -0
  104. package/src/vue/composables/useLoading.ts +12 -0
  105. package/src/vue/composables/useMessage.ts +16 -0
  106. package/src/vue/composables/useMotion.ts +19 -0
  107. package/src/vue/composables/useTheme.ts +12 -0
  108. package/src/vue/dialog.ts +69 -17
  109. package/src/vue/index.ts +4 -21
  110. package/src/vue/input.ts +35 -11
  111. package/src/vue/slider.ts +22 -4
  112. package/src/vue/switch.ts +16 -9
  113. package/src/vue/alert.ts +0 -32
  114. package/src/vue/avatar.ts +0 -34
  115. package/src/vue/breadcrumb.ts +0 -32
  116. package/src/vue/checkbox.ts +0 -32
  117. package/src/vue/collapse.ts +0 -33
  118. package/src/vue/divider.ts +0 -32
  119. package/src/vue/drawer.ts +0 -33
  120. package/src/vue/empty.ts +0 -33
  121. package/src/vue/menu.ts +0 -33
  122. package/src/vue/popover.ts +0 -34
  123. package/src/vue/progress.ts +0 -33
  124. package/src/vue/row.ts +0 -32
  125. package/src/vue/select.ts +0 -33
  126. package/src/vue/space.ts +0 -32
  127. package/src/vue/steps.ts +0 -33
  128. package/src/vue/table.ts +0 -33
  129. package/src/vue/tabs.ts +0 -33
  130. package/src/vue/tag.ts +0 -33
  131. package/src/vue/tooltip.ts +0 -34
package/src/vue/row.ts DELETED
@@ -1,32 +0,0 @@
1
- import { defineComponent, h, ref, onMounted, onUnmounted, watch } from 'vue'
2
- import { createRow } from '../components/layout/row.js'
3
- import type { RowOptions } from '../components/layout/row.js'
4
-
5
- export const MkRow = defineComponent({
6
- name: 'MkRow',
7
- props: {
8
-
9
-
10
- },
11
-
12
- setup(props, { emit, slots }) {
13
- const container = ref<HTMLDivElement>()
14
- let instance: ReturnType<typeof createRow> | null = null
15
-
16
- const create = () => {
17
- if (!container.value) return
18
- instance?.destroy()
19
- instance = createRow(container.value, {
20
-
21
-
22
-
23
- })
24
- }
25
-
26
- onMounted(create)
27
-
28
- onUnmounted(() => instance?.destroy())
29
-
30
- return () => h('div', { ref: container })
31
- },
32
- })
package/src/vue/select.ts DELETED
@@ -1,33 +0,0 @@
1
- import { defineComponent, h, ref, onMounted, onUnmounted, watch } from 'vue'
2
- import { createSelect } from '../components/form/select.js'
3
- import type { SelectOptions } from '../components/form/select.js'
4
-
5
- export const MkSelect = defineComponent({
6
- name: 'MkSelect',
7
- props: {
8
-
9
-
10
- },
11
-
12
- setup(props, { emit, slots }) {
13
- const container = ref<HTMLDivElement>()
14
- let instance: ReturnType<typeof createSelect> | null = null
15
-
16
- const create = () => {
17
- if (!container.value) return
18
- instance?.destroy()
19
- instance = createSelect(container.value, {
20
-
21
-
22
-
23
- })
24
- }
25
-
26
- onMounted(create)
27
-
28
- watch(() => props.value, (v) => instance?.setValue(v))
29
- onUnmounted(() => instance?.destroy())
30
-
31
- return () => h('div', { ref: container })
32
- },
33
- })
package/src/vue/space.ts DELETED
@@ -1,32 +0,0 @@
1
- import { defineComponent, h, ref, onMounted, onUnmounted, watch } from 'vue'
2
- import { createSpace } from '../components/layout/space.js'
3
- import type { SpaceOptions } from '../components/layout/space.js'
4
-
5
- export const MkSpace = defineComponent({
6
- name: 'MkSpace',
7
- props: {
8
-
9
-
10
- },
11
-
12
- setup(props, { emit, slots }) {
13
- const container = ref<HTMLDivElement>()
14
- let instance: ReturnType<typeof createSpace> | null = null
15
-
16
- const create = () => {
17
- if (!container.value) return
18
- instance?.destroy()
19
- instance = createSpace(container.value, {
20
-
21
-
22
-
23
- })
24
- }
25
-
26
- onMounted(create)
27
-
28
- onUnmounted(() => instance?.destroy())
29
-
30
- return () => h('div', { ref: container })
31
- },
32
- })
package/src/vue/steps.ts DELETED
@@ -1,33 +0,0 @@
1
- import { defineComponent, h, ref, onMounted, onUnmounted, watch } from 'vue'
2
- import { createSteps } from '../components/steps/steps.js'
3
- import type { StepsOptions } from '../components/steps/steps.js'
4
-
5
- export const MkSteps = defineComponent({
6
- name: 'MkSteps',
7
- props: {
8
-
9
-
10
- },
11
-
12
- setup(props, { emit, slots }) {
13
- const container = ref<HTMLDivElement>()
14
- let instance: ReturnType<typeof createSteps> | null = null
15
-
16
- const create = () => {
17
- if (!container.value) return
18
- instance?.destroy()
19
- instance = createSteps(container.value, {
20
-
21
-
22
-
23
- })
24
- }
25
-
26
- onMounted(create)
27
-
28
- watch(() => props.current, (v) => instance?.setCurrent(v))
29
- onUnmounted(() => instance?.destroy())
30
-
31
- return () => h('div', { ref: container })
32
- },
33
- })
package/src/vue/table.ts DELETED
@@ -1,33 +0,0 @@
1
- import { defineComponent, h, ref, onMounted, onUnmounted, watch } from 'vue'
2
- import { createTable } from '../components/table/table.js'
3
- import type { TableOptions } from '../components/table/table.js'
4
-
5
- export const MkTable = defineComponent({
6
- name: 'MkTable',
7
- props: {
8
-
9
-
10
- },
11
-
12
- setup(props, { emit, slots }) {
13
- const container = ref<HTMLDivElement>()
14
- let instance: ReturnType<typeof createTable> | null = null
15
-
16
- const create = () => {
17
- if (!container.value) return
18
- instance?.destroy()
19
- instance = createTable(container.value, {
20
-
21
-
22
-
23
- })
24
- }
25
-
26
- onMounted(create)
27
-
28
- watch(() => props.data, (v) => instance?.setData(v))
29
- onUnmounted(() => instance?.destroy())
30
-
31
- return () => h('div', { ref: container })
32
- },
33
- })
package/src/vue/tabs.ts DELETED
@@ -1,33 +0,0 @@
1
- import { defineComponent, h, ref, onMounted, onUnmounted, watch } from 'vue'
2
- import { createTabs } from '../components/tabs/tabs.js'
3
- import type { TabsOptions } from '../components/tabs/tabs.js'
4
-
5
- export const MkTabs = defineComponent({
6
- name: 'MkTabs',
7
- props: {
8
-
9
-
10
- },
11
-
12
- setup(props, { emit, slots }) {
13
- const container = ref<HTMLDivElement>()
14
- let instance: ReturnType<typeof createTabs> | null = null
15
-
16
- const create = () => {
17
- if (!container.value) return
18
- instance?.destroy()
19
- instance = createTabs(container.value, {
20
-
21
-
22
-
23
- })
24
- }
25
-
26
- onMounted(create)
27
-
28
- watch(() => props.active, (v) => instance?.setActive(v))
29
- onUnmounted(() => instance?.destroy())
30
-
31
- return () => h('div', { ref: container })
32
- },
33
- })
package/src/vue/tag.ts DELETED
@@ -1,33 +0,0 @@
1
- import { defineComponent, h, ref, onMounted, onUnmounted, watch } from 'vue'
2
- import { createTag } from '../components/tag/tag.js'
3
- import type { TagOptions } from '../components/tag/tag.js'
4
-
5
- export const MkTag = defineComponent({
6
- name: 'MkTag',
7
- props: {
8
-
9
-
10
- },
11
-
12
- setup(props, { emit, slots }) {
13
- const container = ref<HTMLDivElement>()
14
- let instance: ReturnType<typeof createTag> | null = null
15
-
16
- const create = () => {
17
- if (!container.value) return
18
- instance?.destroy()
19
- instance = createTag(container.value, {
20
-
21
-
22
-
23
- })
24
- }
25
-
26
- onMounted(create)
27
-
28
- watch(() => props.text, (v) => instance?.setText(v))
29
- onUnmounted(() => instance?.destroy())
30
-
31
- return () => h('div', { ref: container })
32
- },
33
- })
@@ -1,34 +0,0 @@
1
- import { defineComponent, h, ref, onMounted, onUnmounted, watch } from 'vue'
2
- import { createTooltip } from '../components/tooltip/tooltip.js'
3
- import type { TooltipOptions } from '../components/tooltip/tooltip.js'
4
-
5
- export const MkTooltip = defineComponent({
6
- name: 'MkTooltip',
7
- props: {
8
-
9
-
10
- },
11
-
12
- setup(props, { emit, slots }) {
13
- const container = ref<HTMLDivElement>()
14
- let instance: ReturnType<typeof createTooltip> | null = null
15
-
16
- const create = () => {
17
- if (!container.value) return
18
- instance?.destroy()
19
- instance = createTooltip(container.value, {
20
-
21
-
22
-
23
- })
24
- }
25
-
26
- onMounted(create)
27
-
28
- watch(() => props.tooltipContent, (v) => instance?.setTooltipContent(v))
29
- watch(() => props.timeout, (v) => instance?.setTimeout(v))
30
- onUnmounted(() => instance?.destroy())
31
-
32
- return () => h('div', { ref: container })
33
- },
34
- })