@indielayer/ui 1.0.9 → 1.0.10

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 (98) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +2 -2
  3. package/{lib/nuxt.js → exports/nuxt.mjs} +1 -1
  4. package/{src/exports → exports}/nuxt.plugin.js +1 -1
  5. package/lib/components/alert/Alert.vue.d.ts +11 -2
  6. package/lib/components/avatar/Avatar.vue.d.ts +9 -2
  7. package/lib/components/badge/Badge.vue.d.ts +10 -2
  8. package/lib/components/breadcrumbs/Breadcrumbs.vue.d.ts +2 -2
  9. package/lib/components/button/Button.vue.d.ts +9 -2
  10. package/lib/components/button/ButtonGroup.vue.d.ts +9 -2
  11. package/lib/components/card/Card.vue.d.ts +8 -1
  12. package/lib/components/checkbox/Checkbox.vue.d.ts +12 -4
  13. package/lib/components/collapse/Collapse.vue.d.ts +15 -1
  14. package/lib/components/container/Container.vue.d.ts +8 -1
  15. package/lib/components/divider/Divider.vue.d.ts +1 -1
  16. package/lib/components/drawer/Drawer.vue.d.ts +11 -2
  17. package/lib/components/form/Form.vue.d.ts +10 -3
  18. package/lib/components/helpers/InputError.d.ts +2 -2
  19. package/lib/components/icon/Icon.vue.d.ts +1 -1
  20. package/lib/components/image/Image.vue.d.ts +1 -1
  21. package/lib/components/input/Input.vue.d.ts +4 -4
  22. package/lib/components/link/Link.vue.d.ts +8 -1
  23. package/lib/components/menu/Menu.vue.d.ts +1 -1
  24. package/lib/components/menu/MenuItem.vue.d.ts +11 -2
  25. package/lib/components/modal/Modal.vue.d.ts +11 -1
  26. package/lib/components/notifications/Notifications.vue.d.ts +13 -6
  27. package/lib/components/pagination/Pagination.vue.d.ts +1 -1
  28. package/lib/components/pagination/PaginationItem.vue.d.ts +1 -1
  29. package/lib/components/popover/Popover.vue.d.ts +11 -3
  30. package/lib/components/popover/PopoverContainer.vue.d.ts +8 -1
  31. package/lib/components/progress/Progress.theme.d.ts +3 -1
  32. package/lib/components/progress/Progress.vue.d.ts +2 -2
  33. package/lib/components/radio/Radio.vue.d.ts +11 -4
  34. package/lib/components/scroll/Scroll.vue.d.ts +8 -1
  35. package/lib/components/select/Select.vue.d.ts +11 -4
  36. package/lib/components/skeleton/Skeleton.vue.d.ts +1 -1
  37. package/lib/components/slider/Slider.vue.d.ts +16 -4
  38. package/lib/components/spacer/Spacer.d.ts +1 -1
  39. package/lib/components/spinner/Spinner.vue.d.ts +1 -1
  40. package/lib/components/tab/Tab.vue.d.ts +14 -1
  41. package/lib/components/tab/TabGroup.vue.d.ts +8 -1
  42. package/lib/components/table/Table.vue.d.ts +12 -5
  43. package/lib/components/table/TableBody.d.ts +1 -1
  44. package/lib/components/table/TableCell.vue.d.ts +8 -1
  45. package/lib/components/table/TableHead.d.ts +1 -1
  46. package/lib/components/table/TableHeader.vue.d.ts +10 -3
  47. package/lib/components/table/TableRow.vue.d.ts +8 -1
  48. package/lib/components/tag/Tag.vue.d.ts +9 -2
  49. package/lib/components/textarea/Textarea.vue.d.ts +3 -3
  50. package/lib/components/toggle/Toggle.vue.d.ts +4 -4
  51. package/lib/components/tooltip/Tooltip.vue.d.ts +9 -1
  52. package/lib/composables/colors.d.ts +4 -3
  53. package/lib/composables/common.d.ts +1 -1
  54. package/lib/composables/css.d.ts +1 -1
  55. package/lib/composables/notifications.d.ts +1 -1
  56. package/lib/composables/theme.d.ts +1 -1
  57. package/lib/create.d.ts +1 -1
  58. package/lib/index.cjs.js +1 -1
  59. package/lib/index.es.js +3959 -5956
  60. package/lib/version.d.ts +1 -1
  61. package/package.json +51 -51
  62. package/src/components/alert/Alert.vue +2 -1
  63. package/src/components/avatar/Avatar.vue +2 -1
  64. package/src/components/breadcrumbs/Breadcrumbs.vue +7 -7
  65. package/src/components/button/Button.theme.ts +5 -11
  66. package/src/components/button/Button.vue +2 -1
  67. package/src/components/button/ButtonGroup.vue +4 -4
  68. package/src/components/checkbox/Checkbox.vue +1 -1
  69. package/src/components/collapse/Collapse.vue +12 -12
  70. package/src/components/drawer/Drawer.vue +24 -24
  71. package/src/components/form/Form.vue +8 -9
  72. package/src/components/input/Input.vue +2 -2
  73. package/src/components/link/Link.vue +4 -1
  74. package/src/components/menu/MenuItem.vue +11 -6
  75. package/src/components/modal/Modal.vue +1 -1
  76. package/src/components/notifications/Notifications.vue +16 -16
  77. package/src/components/popover/Popover.vue +31 -27
  78. package/src/components/radio/Radio.vue +3 -2
  79. package/src/components/scroll/Scroll.vue +23 -16
  80. package/src/components/select/Select.vue +3 -4
  81. package/src/components/table/Table.vue +6 -6
  82. package/src/components/table/TableCell.vue +2 -2
  83. package/src/components/table/TableHeader.vue +2 -2
  84. package/src/components/table/TableRow.vue +1 -1
  85. package/src/components/textarea/Textarea.vue +0 -0
  86. package/src/composables/colors-utils.ts +3 -268
  87. package/src/composables/colors.ts +16 -14
  88. package/src/composables/css.ts +4 -4
  89. package/src/composables/inputtable.ts +4 -4
  90. package/src/composables/interactive.ts +2 -2
  91. package/src/composables/theme.ts +6 -6
  92. package/src/create.ts +5 -5
  93. package/src/version.ts +1 -1
  94. package/volar.d.ts +1 -3
  95. package/lib/nuxt.plugin.js +0 -8
  96. package/src/exports/nuxt.js +0 -33
  97. package/src/exports/tailwind.preset.js +0 -55
  98. /package/{lib → exports}/tailwind.preset.js +0 -0
package/lib/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "1.0.9";
1
+ declare const _default: "1.0.10";
2
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indielayer/ui",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Indielayer UI Components with Tailwind CSS build for Vue 3",
5
5
  "author": {
6
6
  "name": "João Teixeira",
@@ -21,74 +21,60 @@
21
21
  "lib",
22
22
  "src",
23
23
  "*.d.ts",
24
+ "exports",
24
25
  "README.md"
25
26
  ],
26
27
  "main": "lib/index.cjs.js",
27
28
  "module": "lib/index.es.js",
28
- "typings": "lib/index.d.ts",
29
+ "types": "lib/index.d.ts",
29
30
  "exports": {
30
31
  ".": {
31
32
  "import": "./lib/index.es.js",
32
- "require": "./lib/index.cjs.js"
33
+ "require": "./lib/index.cjs.js",
34
+ "types": "./lib/index.d.ts"
33
35
  },
34
- "./nuxt": "./lib/nuxt.js",
35
- "./style": "./lib/style.css",
36
- "./styles": "./lib/style.css",
37
- "./nuxt.plugin": "./lib/nuxt.plugin.js",
38
- "./nuxt.plugin.js": "./lib/nuxt.plugin.js",
39
- "./tailwind.preset": "./lib/tailwind.preset.js",
40
- "./tailwind.preset.js": "./lib/tailwind.preset.js"
36
+ "./nuxt": "./exports/nuxt.mjs",
37
+ "./nuxt.plugin": "./exports/nuxt.plugin.js",
38
+ "./nuxt.plugin.js": "./exports/nuxt.plugin.js",
39
+ "./tailwind.preset": "./exports/tailwind.preset.js",
40
+ "./tailwind.preset.js": "./exports/tailwind.preset.js"
41
41
  },
42
42
  "sideEffects": false,
43
- "scripts": {
44
- "dev": "vite build --watch",
45
- "dev2": "pnpm build-only && chokidar \"./src/**\" -c \"pnpm build-only\"",
46
- "build": "pnpm generate && vite build",
47
- "build-prod": "pnpm build && pnpm gen-types",
48
- "build-only": "vite build",
49
- "generate": "pnpm gen-version",
50
- "gen-types": "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.vitest.json --composite false",
51
- "gen-version": "node .scripts/gen-version.js",
52
- "test": "pnpm test:unit",
53
- "test:unit": "vitest --environment jsdom",
54
- "test:e2e": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress open'",
55
- "test:e2e:ci": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress run'",
56
- "typecheck": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
57
- "prepublish": "pnpm build-prod"
58
- },
59
43
  "peerDependencies": {
60
44
  "tailwindcss": "^3.0.0",
61
45
  "vue": "^3.0.0"
62
46
  },
63
47
  "devDependencies": {
64
- "@cypress/vite-dev-server": "^2.2.2",
65
- "@cypress/vue": "^3.1.1",
66
- "@rushstack/eslint-patch": "^1.1.3",
67
- "@types/jsdom": "^16.2.14",
68
- "@types/node": "^17.0.30",
69
- "@types/ramda": "^0.28.15",
70
- "@vitejs/plugin-vue": "^2.3.1",
71
- "@vitejs/plugin-vue-jsx": "^1.3.10",
72
- "@vue/test-utils": "^2.0.0-rc.20",
73
- "@vue/tsconfig": "^0.1.3",
74
- "@vueuse/core": "^8.4.2",
48
+ "@cypress/vite-dev-server": "^5.0.5",
49
+ "@cypress/vue": "^5.0.5",
50
+ "@indielayer/stylelint-config": "^1.0.0",
51
+ "@rushstack/eslint-patch": "^1.3.2",
52
+ "@tsconfig/node18": "^2.0.1",
53
+ "@types/jsdom": "^21.1.1",
54
+ "@types/node": "^18.16.18",
55
+ "@types/ramda": "^0.29.2",
56
+ "@vitejs/plugin-vue": "^4.2.3",
57
+ "@vitejs/plugin-vue-jsx": "^3.0.1",
58
+ "@vue/test-utils": "^2.4.0",
59
+ "@vue/tsconfig": "^0.4.0",
60
+ "@vueuse/core": "^10.2.0",
75
61
  "autoprefixer": "^10.4.0",
76
62
  "c8": "^7.12.0",
77
- "chokidar-cli": "^3.0.0",
78
63
  "clean-css": "^5.3.0",
79
- "cypress": "^9.6.0",
80
- "eslint": "^8.16.0",
81
- "eslint-plugin-cypress": "^2.12.1",
82
- "jsdom": "^19.0.0",
64
+ "cypress": "^12.16.0",
65
+ "eslint": "^8.43.0",
66
+ "eslint-plugin-cypress": "^2.13.3",
67
+ "jsdom": "^22.1.0",
83
68
  "postcss": "^8.4.4",
84
- "ramda": "^0.28.0",
69
+ "ramda": "^0.29.0",
85
70
  "start-server-and-test": "^1.14.0",
86
- "tailwindcss": "^3.0.0",
87
- "typescript": "~4.6.3",
88
- "vite": "^2.9.5",
89
- "vitest": "^0.9.3",
90
- "vue": "^3.2.33",
91
- "vue-tsc": "^0.34.15"
71
+ "stylelint": "^14.16.1",
72
+ "tailwindcss": "^3.3.2",
73
+ "typescript": "^5.2.2",
74
+ "vite": "^4.3.9",
75
+ "vitest": "^0.32.2",
76
+ "vue": "^3.3.4",
77
+ "vue-tsc": "^1.8.2"
92
78
  },
93
79
  "browserslist": [
94
80
  "> 1%",
@@ -107,5 +93,19 @@
107
93
  "publishConfig": {
108
94
  "access": "public"
109
95
  },
110
- "gitHead": "a0f4604dcfefeb75b4b1119b54181efe6a6aa855"
111
- }
96
+ "scripts": {
97
+ "dev": "pnpm generate && vite build --watch",
98
+ "build": "pnpm generate && vite build",
99
+ "build:prod": "pnpm build && pnpm gen-types",
100
+ "build:only": "vite build",
101
+ "generate": "pnpm gen-version",
102
+ "gen-types": "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.vitest.json --composite false",
103
+ "gen-version": "node .scripts/gen-version.js",
104
+ "test": "pnpm test:unit",
105
+ "test:unit": "vitest --environment jsdom",
106
+ "test:e2e": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress open'",
107
+ "test:e2e:ci": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress run'",
108
+ "typecheck": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
109
+ "stylelint": "stylelint \"**/*.{css,vue,postcss,scss,sass}\" --ignore-path .gitignore"
110
+ }
111
+ }
@@ -79,7 +79,8 @@ const { styles, classes, className } = useTheme('alert', theme, props)
79
79
  box-shadow: 0 0 #000, 0 0 #000, 0 10px 15px -3px var(--x-alert-glow), 0 4px 6px -4px var(--x-alert-glow);
80
80
  }
81
81
 
82
- :global(.dark) &, &:global(.dark) {
82
+ :global(.dark) &,
83
+ &:global(.dark) {
83
84
  color: var(--x-alert-dark-text, var(--x-alert-text));
84
85
  background-color: var(--x-alert-dark-bg, var(--x-alert-bg));
85
86
  border-color: var(--x-alert-dark-border, var(--x-alert-border));
@@ -92,7 +92,8 @@ const { styles, classes, className } = useTheme('avatar', theme, props, { source
92
92
  background-color: var(--x-avatar-bg);
93
93
  border-color: var(--x-avatar-border);
94
94
 
95
- :global(.dark) &, &:global(.dark) {
95
+ :global(.dark) &,
96
+ &:global(.dark) {
96
97
  color: var(--x-avatar-dark-text, var(--x-avatar-text));
97
98
  background-color: var(--x-avatar-dark-bg, var(--x-avatar-bg));
98
99
  border-color: var(--x-avatar-dark-border, var(--x-avatar-border));
@@ -14,13 +14,13 @@ import XLink from '../../components/link/Link.vue'
14
14
  import theme from './Breadcrumbs.theme'
15
15
 
16
16
  export type BreadcrumbItem = {
17
- label: string,
18
- to?: string | object,
19
- href?: string,
20
- color?: string,
21
- icon?: string,
22
- shadow?: boolean,
23
- underline?: boolean
17
+ label: string;
18
+ to?: string | object;
19
+ href?: string;
20
+ color?: string;
21
+ icon?: string;
22
+ shadow?: boolean;
23
+ underline?: boolean;
24
24
  }
25
25
 
26
26
  const props = defineProps({
@@ -70,10 +70,8 @@ export default {
70
70
  },
71
71
  }))
72
72
  }
73
- }
74
-
75
- // light
76
- else if (isLight) {
73
+ } else if (isLight) {
74
+ // light
77
75
  if (!props.outlined || props.disabled) vars.push(css.get('border', 'transparent'))
78
76
 
79
77
  if (props.disabled) {
@@ -103,10 +101,8 @@ export default {
103
101
  },
104
102
  }))
105
103
  }
106
- }
107
-
108
- // ghost
109
- else if (props.ghost) {
104
+ } else if (props.ghost) {
105
+ // ghost
110
106
  if (!props.outlined) vars.push(css.get('border', 'transparent'))
111
107
 
112
108
  if (props.color) {
@@ -162,9 +158,7 @@ export default {
162
158
  }
163
159
  }
164
160
  }
165
- }
166
-
167
- else {
161
+ } else {
168
162
  // outlined
169
163
  if (props.outlined) {
170
164
  if (props.disabled) {
@@ -150,7 +150,8 @@ defineExpose({ focus, blur })
150
150
  border-color: var(--x-button-border-active, var(--x-button-border));
151
151
  }
152
152
 
153
- :global(.dark) &, &:global(.dark) {
153
+ :global(.dark) &,
154
+ &:global(.dark) {
154
155
  color: var(--x-button-dark-text, var(--x-button-text));
155
156
  background-color: var(--x-button-dark-bg, var(--x-button-bg));
156
157
  border-color: var(--x-button-dark-border, var(--x-button-border));
@@ -53,21 +53,21 @@ const { className, classes, styles } = useTheme('button-group', theme, props)
53
53
  .button-group {
54
54
  &:not(&--rounded) {
55
55
  > :first-child {
56
- @apply rounded-l-md
56
+ @apply rounded-l-md;
57
57
  }
58
58
 
59
59
  > :last-child {
60
- @apply rounded-r-md
60
+ @apply rounded-r-md;
61
61
  }
62
62
  }
63
63
 
64
64
  &--rounded {
65
65
  > :first-of-type {
66
- @apply rounded-l-full
66
+ @apply rounded-l-full;
67
67
  }
68
68
 
69
69
  > :last-child {
70
- @apply rounded-r-full
70
+ @apply rounded-r-full;
71
71
  }
72
72
  }
73
73
  }
@@ -112,7 +112,7 @@ defineExpose({ focus, blur, toggle, reset, validate, setError })
112
112
  <style lang="postcss" module>
113
113
  .checkbox {
114
114
  &--glow {
115
- box-shadow: 0 0 #000, 0 0 #000, 0 10px 15px -3px var(--x-checkbox-glow),0 4px 6px -4px var(--x-checkbox-glow);
115
+ box-shadow: 0 0 #000, 0 0 #000, 0 10px 15px -3px var(--x-checkbox-glow), 0 4px 6px -4px var(--x-checkbox-glow);
116
116
  }
117
117
  }
118
118
  </style>
@@ -32,48 +32,48 @@ watch(() => props.expanded, () => {
32
32
  collapsed.value = !props.expanded
33
33
  })
34
34
 
35
- function onBeforeEnter(el: HTMLElement) {
36
- if (animated.value) el.style.height = '0px'
35
+ function onBeforeEnter(el: Element) {
36
+ if (animated.value) (el as HTMLElement).style.height = '0px'
37
37
  }
38
38
 
39
- function onEnter(el: HTMLElement, done: ()=> void) {
39
+ function onEnter(el: Element, done: () => void) {
40
40
  if (!animated.value) done()
41
41
  else {
42
42
  el.addEventListener('transitionend', done)
43
43
  setTimeout(() => {
44
- el.style.height = `${el.scrollHeight}px`
44
+ (el as HTMLElement).style.height = `${el.scrollHeight}px`
45
45
  }, 1)
46
46
  }
47
47
  }
48
48
 
49
- function onAfterEnter(el: HTMLElement) {
49
+ function onAfterEnter(el: Element) {
50
50
  if (!animated.value) {
51
51
  animated.value = true
52
52
  } else {
53
- el.style.removeProperty('height')
53
+ (el as HTMLElement).style.removeProperty('height')
54
54
  }
55
55
  }
56
56
 
57
- function onBeforeLeave(el: HTMLElement) {
57
+ function onBeforeLeave(el: Element) {
58
58
  if (!animated.value) return
59
- el.style.height = `${el.scrollHeight}px`
59
+ (el as HTMLElement).style.height = `${el.scrollHeight}px`
60
60
  }
61
61
 
62
- function onLeave(el: HTMLElement ,done: ()=> void) {
62
+ function onLeave(el: Element, done: () => void) {
63
63
  if (!animated.value) done()
64
64
  else {
65
65
  el.addEventListener('transitionend', done)
66
66
  setTimeout(() => {
67
- el.style.height = '0px'
67
+ (el as HTMLElement).style.height = '0px'
68
68
  }, 1)
69
69
  }
70
70
  }
71
71
 
72
- function onAfterLeave(el: HTMLElement) {
72
+ function onAfterLeave(el: Element) {
73
73
  if (!animated.value) {
74
74
  animated.value = true
75
75
  } else {
76
- el.style.removeProperty('height')
76
+ (el as HTMLElement).style.removeProperty('height')
77
77
  }
78
78
  }
79
79
 
@@ -7,7 +7,7 @@ export default {
7
7
 
8
8
  <script setup lang="ts">
9
9
  import { computed, onMounted, ref, watch, watchEffect, type PropType } from 'vue'
10
- import { breakpointsTailwind, SwipeDirection, useBreakpoints, useEventListener, useSwipe, type Breakpoints } from '@vueuse/core'
10
+ import { breakpointsTailwind, useBreakpoints, useEventListener, useSwipe, type Breakpoints, type UseSwipeDirection } from '@vueuse/core'
11
11
  import { useTheme } from '../../composables/theme'
12
12
 
13
13
  import XScroll from '../../components/scroll/Scroll.vue'
@@ -86,20 +86,20 @@ const { lengthX, lengthY } = useSwipe(drawerRef, {
86
86
  // left.value = '0'
87
87
  // }
88
88
  // },
89
- // onSwipeEnd(e: TouchEvent, direction: SwipeDirection) {
89
+ // onSwipeEnd(e: TouchEvent, direction: UseSwipeDirection) {
90
90
  // if (lengthX.value < 0 && props.width && (Math.abs(lengthX.value) / props.width) >= 0.5) {
91
91
  // left.value = '100%'
92
92
  // } else {
93
93
  // left.value = '0'
94
94
  // }
95
95
  // },
96
- onSwipeEnd(e: TouchEvent, direction: SwipeDirection) {
96
+ onSwipeEnd(e: TouchEvent, direction: UseSwipeDirection) {
97
97
  if (detached.value) {
98
98
  if (
99
- (props.position === 'left' && direction === 'LEFT') ||
100
- (props.position === 'right' && direction === 'RIGHT') ||
101
- (props.position === 'top' && direction === 'UP') ||
102
- (props.position === 'bottom' && direction === 'DOWN')
99
+ (props.position === 'left' && direction === 'left') ||
100
+ (props.position === 'right' && direction === 'right') ||
101
+ (props.position === 'top' && direction === 'up') ||
102
+ (props.position === 'bottom' && direction === 'down')
103
103
  ) close()
104
104
  }
105
105
  },
@@ -129,15 +129,15 @@ const autoClasses = computed(() => {
129
129
  return c
130
130
  })
131
131
 
132
- function onBeforeEnter(el: HTMLElement) {
132
+ function onBeforeEnter(el: Element) {
133
133
  el.classList.add('inset-0')
134
- if (props.position === 'top') el.style.top = `-${props.height}px`
135
- else if (props.position === 'bottom') el.style.bottom = `-${props.height}px`
136
- else if (props.position === 'left') el.style.left = `-${props.width}px`
137
- else if (props.position === 'right') el.style.right = `-${props.width}px`
134
+ if (props.position === 'top') (el as HTMLElement).style.top = `-${props.height}px`
135
+ else if (props.position === 'bottom') (el as HTMLElement).style.bottom = `-${props.height}px`
136
+ else if (props.position === 'left') (el as HTMLElement).style.left = `-${props.width}px`
137
+ else if (props.position === 'right') (el as HTMLElement).style.right = `-${props.width}px`
138
138
  }
139
139
 
140
- function onEnter(el: HTMLElement, done: ()=> void) {
140
+ function onEnter(el: Element, done: () => void) {
141
141
  if (!detached.value) {
142
142
  done()
143
143
 
@@ -146,27 +146,27 @@ function onEnter(el: HTMLElement, done: ()=> void) {
146
146
  el.addEventListener('transitionend', done)
147
147
  setTimeout(() => {
148
148
  if (props.backdrop) el.classList.add('bg-gray-500/30')
149
- if (props.position === 'top') el.style.top = '0'
150
- else if (props.position === 'bottom') el.style.bottom = '0'
151
- else if (props.position === 'left') el.style.left = '0'
152
- else if (props.position === 'right') el.style.right = '0'
149
+ if (props.position === 'top') (el as HTMLElement).style.top = '0'
150
+ else if (props.position === 'bottom') (el as HTMLElement).style.bottom = '0'
151
+ else if (props.position === 'left') (el as HTMLElement).style.left = '0'
152
+ else if (props.position === 'right') (el as HTMLElement).style.right = '0'
153
153
  }, 1)
154
154
  }
155
155
 
156
- function onBeforeLeave(el: HTMLElement) {}
156
+ function onBeforeLeave(el: Element) {}
157
157
 
158
- function onLeave(el: HTMLElement, done: ()=> void) {
158
+ function onLeave(el: Element, done: () => void) {
159
159
  el.addEventListener('transitionend', done)
160
160
  setTimeout(() => {
161
161
  if (props.backdrop) el.classList.remove('bg-gray-500/30')
162
- if (props.position === 'top') el.style.top = `-${props.height}px`
163
- else if (props.position === 'bottom') el.style.bottom = `-${props.height}px`
164
- else if (props.position === 'left') el.style.left = `-${props.width}px`
165
- else if (props.position === 'right') el.style.right = `-${props.width}px`
162
+ if (props.position === 'top') (el as HTMLElement).style.top = `-${props.height}px`
163
+ else if (props.position === 'bottom') (el as HTMLElement).style.bottom = `-${props.height}px`
164
+ else if (props.position === 'left') (el as HTMLElement).style.left = `-${props.width}px`
165
+ else if (props.position === 'right') (el as HTMLElement).style.right = `-${props.width}px`
166
166
  }, 1)
167
167
  }
168
168
 
169
- function onAfterLeave(el: HTMLElement, done: ()=> void) {
169
+ function onAfterLeave(el: Element) {
170
170
  el.classList.remove('inset-0')
171
171
  }
172
172
 
@@ -13,15 +13,15 @@ import { useTheme } from '../../composables/theme'
13
13
  import theme from './Form.theme'
14
14
 
15
15
  export type FormError = {
16
- field: string
17
- msg: string
16
+ field: string;
17
+ msg: string;
18
18
  }
19
19
 
20
20
  export type Form = {
21
- name: string,
22
- focus: ()=> void,
23
- validate: ()=> boolean,
24
- setError: (val: string)=> void,
21
+ name: string;
22
+ focus: () => void;
23
+ validate: () => boolean;
24
+ setError: (val: string) => void;
25
25
  }
26
26
 
27
27
  const props = defineProps({
@@ -45,15 +45,14 @@ const emit = defineEmits(['submit'])
45
45
  const inputs: Form[] = []
46
46
 
47
47
  provide(injectFormKey, {
48
- registerInput: (name: string, focus: ()=> void, validate: ()=> boolean, setError: (val: string)=> void) => {
48
+ registerInput: (name: string, focus: () => void, validate: () => boolean, setError: (val: string) => void) => {
49
49
  const exists = inputs.find((i) => i.name === name)
50
50
 
51
51
  if (exists) {
52
52
  exists.focus = focus
53
53
  exists.validate = validate
54
54
  exists.setError = setError
55
- }
56
- else inputs.push({ name, focus, validate, setError })
55
+ } else inputs.push({ name, focus, validate, setError })
57
56
  },
58
57
  unregisterInput: (name: string) => {
59
58
  const index = inputs.findIndex((i) => i.name === name)
@@ -60,11 +60,11 @@ function onChange(e: Event) {
60
60
  const value = Number(target.value)
61
61
 
62
62
  if (typeof props.min !== 'undefined') {
63
- if (value < props.min) target.value = props.min.toString()
63
+ if (value < Number(props.min)) target.value = props.min.toString()
64
64
  }
65
65
 
66
66
  if (typeof props.max !== 'undefined') {
67
- if (value > props.max) target.value = props.max.toString()
67
+ if (value > Number(props.max)) target.value = props.max.toString()
68
68
  }
69
69
  }
70
70
  }
@@ -62,12 +62,14 @@ const { styles, classes, className } = useTheme('link', theme, props)
62
62
 
63
63
  &--shadow {
64
64
  box-shadow: inset 0 -0.315em 0 0 var(--x-link-shadow);
65
+
65
66
  &:hover {
66
67
  box-shadow: inset 0 -1.325em 0 0 var(--x-link-shadow);
67
68
  }
68
69
  }
69
70
 
70
- :global(.dark) &, &:global(.dark) {
71
+ :global(.dark) &,
72
+ &:global(.dark) {
71
73
  color: var(--x-link-dark-text);
72
74
 
73
75
  &:hover {
@@ -76,6 +78,7 @@ const { styles, classes, className } = useTheme('link', theme, props)
76
78
 
77
79
  &--shadow {
78
80
  box-shadow: inset 0 -0.315em 0 0 var(--x-link-dark-shadow);
81
+
79
82
  &:hover {
80
83
  box-shadow: inset 0 -1.325em 0 0 var(--x-link-dark-shadow);
81
84
  }
@@ -29,7 +29,7 @@ const props = defineProps({
29
29
  },
30
30
  onClick: Function,
31
31
  inactive: Boolean,
32
- value: [Number,String],
32
+ value: [Number, String],
33
33
  to: String,
34
34
  exact: Boolean,
35
35
  href: String,
@@ -155,12 +155,13 @@ const { styles, classes, className } = useTheme('menu-item', theme, computedProp
155
155
  </template>
156
156
 
157
157
  <style lang="postcss" module scoped>
158
- .menu-item, .menu-item.x-link {
158
+ .menu-item,
159
+ .menu-item.x-link {
159
160
  color: var(--x-menu-item-text);
160
161
  background-color: var(--x-menu-item-bg);
161
162
 
162
- &:before {
163
- content: '';
163
+ &::before {
164
+ content: "";
164
165
  position: absolute;
165
166
  left: -1px;
166
167
  height: 100%;
@@ -173,9 +174,11 @@ const { styles, classes, className } = useTheme('menu-item', theme, computedProp
173
174
  background-color: var(--x-menu-item-bg-hover, var(--x-menu-item-bg));
174
175
  }
175
176
 
176
- :global(.dark) &, &:global(.dark) {
177
+ :global(.dark) &,
178
+ &:global(.dark) {
177
179
  color: var(--x-menu-item-dark-text);
178
180
  background: var(--x-menu-item-dark-bg);
181
+
179
182
  &:hover {
180
183
  color: var(--x-menu-item-dark-text-hover, var(--x-menu-item-dark-text));
181
184
  background-color: var(--x-menu-item-dark-bg-hover, var(--x-menu-item-dark-bg));
@@ -184,8 +187,10 @@ const { styles, classes, className } = useTheme('menu-item', theme, computedProp
184
187
  }
185
188
 
186
189
  :global(.x-menu-inner) {
190
+ /* stylelint-disable-next-line no-descending-specificity */
187
191
  .menu-item {
188
- &:hover:before, &--active:before {
192
+ &:hover::before,
193
+ &--active::before {
189
194
  background-color: var(--x-menu-item-border-hover);
190
195
  }
191
196
  }
@@ -29,7 +29,7 @@ const value = ref(props.modelValue)
29
29
  const visible = ref(false)
30
30
  const modalRef = ref<HTMLElement | null>(null)
31
31
 
32
- let stopClickOutside: undefined | (()=> void) = undefined
32
+ let stopClickOutside: undefined | (() => void) = undefined
33
33
 
34
34
  watch(value, (val) => {
35
35
  if (stopClickOutside) {
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  const validators = {
3
- align: ['left','right'],
4
- position: ['bottom','top'],
3
+ align: ['left', 'right'],
4
+ position: ['bottom', 'top'],
5
5
  }
6
6
 
7
7
  export default {
@@ -26,22 +26,22 @@ import theme from './Notifications.theme'
26
26
  export type NotificationAlign = 'left' | 'right'
27
27
  export type NotificationPosition = 'bottom' | 'top'
28
28
  export type NotificationAction = {
29
- onClick: ()=> void,
30
- label: string,
31
- color?: string
29
+ onClick: () => void;
30
+ label: string;
31
+ color?: string;
32
32
  }
33
33
  export type NotificationEvent = {
34
- id?: number,
35
- icon?: string,
36
- action?: NotificationAction,
37
- iconColor?: string,
38
- title?: string,
39
- style?: string,
40
- message?: string,
41
- timeout?: number,
42
- removable?: boolean,
43
- align?: NotificationAlign,
44
- position?: NotificationPosition
34
+ id?: number;
35
+ icon?: string;
36
+ action?: NotificationAction;
37
+ iconColor?: string;
38
+ title?: string;
39
+ style?: string;
40
+ message?: string;
41
+ timeout?: number;
42
+ removable?: boolean;
43
+ align?: NotificationAlign;
44
+ position?: NotificationPosition;
45
45
  }
46
46
 
47
47
  const props = defineProps({