@stonecrop/utilities 0.2.23 → 0.2.25

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@stonecrop/utilities",
3
- "version": "0.2.23",
3
+ "version": "0.2.25",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "author": {
@@ -17,35 +17,36 @@
17
17
  },
18
18
  "exports": {
19
19
  ".": {
20
- "import": "./dist/utilities.js",
20
+ "import": {
21
+ "types": "./dist/utilities/src/index.d.ts",
22
+ "default": "./dist/utilities.js"
23
+ },
21
24
  "require": "./dist/utilities.umd.cjs"
22
25
  }
23
26
  },
24
- "main": "dist/utilities.js",
25
- "module": "dist/utilities.js",
26
- "umd": "dist/utilities.umd.cjs",
27
- "types": "src/index",
27
+ "typings": "./dist/utilities/src/index.d.ts",
28
28
  "files": [
29
29
  "dist/*",
30
30
  "src/*"
31
31
  ],
32
32
  "dependencies": {
33
- "vue": "^3.4.23"
33
+ "@vueuse/core": "^10.11.0",
34
+ "vue": "^3.4.31"
34
35
  },
35
36
  "devDependencies": {
36
- "@histoire/plugin-vue": "^0.17.17",
37
- "@typescript-eslint/eslint-plugin": "^7.6.0",
38
- "@typescript-eslint/parser": "^7.6.0",
39
- "@vitejs/plugin-vue": "^5.0.4",
40
- "@vueuse/core": "^10.9.0",
41
- "cypress": "^12.11.0",
37
+ "@microsoft/api-documenter": "^7.25.3",
38
+ "@rushstack/heft": "^0.66.18",
39
+ "@typescript-eslint/eslint-plugin": "^7.14.1",
40
+ "@typescript-eslint/parser": "^7.14.1",
41
+ "@vitejs/plugin-vue": "^5.0.5",
42
+ "cypress": "^13.11.0",
42
43
  "eslint": "^8.40.0",
43
44
  "eslint-config-prettier": "^8.8.0",
44
45
  "eslint-plugin-vue": "^9.11.1",
45
- "histoire": "^0.17.17",
46
- "typescript": "^5.4.5",
47
- "vite": "^5.2.9",
48
- "vue-router": "^4"
46
+ "typescript": "^5.5.2",
47
+ "vite": "^5.3.2",
48
+ "vue-router": "^4.4.0",
49
+ "stonecrop-rig": "0.2.22"
49
50
  },
50
51
  "publishConfig": {
51
52
  "access": "public"
@@ -54,13 +55,11 @@
54
55
  "node": ">=20.11.0"
55
56
  },
56
57
  "scripts": {
57
- "prepublish": "tsc -b && vite build",
58
- "build": "tsc -b && vite build",
58
+ "prepublish": "heft build && vite build && rushx docs",
59
+ "build": "heft build && vite build && rushx docs",
59
60
  "dev": "vite",
61
+ "docs": "api-documenter markdown -i temp -o ../docs/utilities",
60
62
  "lint": "eslint . --ext .ts,.vue",
61
- "preview": "vite preview",
62
- "story:build": "histoire build",
63
- "story:dev": "histoire dev",
64
- "story:preview": "histoire preview"
63
+ "preview": "vite preview"
65
64
  }
66
65
  }
@@ -1,8 +1,8 @@
1
1
  import { type WatchStopHandle, onBeforeUnmount, onMounted, ref, watch } from 'vue'
2
2
  import { useFocusWithin } from '@vueuse/core'
3
3
 
4
- import type { KeyboardNavigationOptions, KeypressHandlers } from 'types'
5
4
  import { useElementVisibility } from '@/composables/visibility'
5
+ import type { KeyboardNavigationOptions, KeypressHandlers } from '@/types'
6
6
 
7
7
  // helper functions
8
8
  const isVisible = (element: HTMLElement) => {
package/src/index.ts CHANGED
@@ -1,8 +1,13 @@
1
1
  import { App } from 'vue'
2
2
 
3
- import { defaultKeypressHandlers, useKeyboardNav } from './composables/keyboard'
4
- import type { KeypressHandlers } from '../types'
3
+ import { defaultKeypressHandlers, useKeyboardNav } from '@/composables/keyboard'
4
+ export type { KeypressHandlers, KeyboardNavigationOptions } from '@/types'
5
5
 
6
+ /**
7
+ * Install all utility components
8
+ * @param app - Vue app instance
9
+ * @public
10
+ */
6
11
  function install(app: App /* options */) {}
7
12
 
8
- export { KeypressHandlers, defaultKeypressHandlers, install, useKeyboardNav }
13
+ export { defaultKeypressHandlers, install, useKeyboardNav }
@@ -0,0 +1,18 @@
1
+ import { ComponentPublicInstance, Ref } from 'vue'
2
+
3
+ export type KeypressHandlers = {
4
+ [key: string]: (ev: KeyboardEvent) => any
5
+ }
6
+
7
+ export type KeyboardNavigationOptions = {
8
+ parent?: string | HTMLElement | Ref<HTMLElement>
9
+ selectors?:
10
+ | string
11
+ | HTMLElement
12
+ | HTMLElement[]
13
+ | ComponentPublicInstance[]
14
+ | Ref<HTMLElement>
15
+ | Ref<HTMLElement[]>
16
+ | Ref<ComponentPublicInstance[]>
17
+ handlers?: KeypressHandlers
18
+ }