@ansh-ui/vue 0.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.
Files changed (109) hide show
  1. package/LICENSE +21 -0
  2. package/dist/chunk-2VSROZ2N.js +1281 -0
  3. package/dist/chunk-2VSROZ2N.js.map +1 -0
  4. package/dist/chunk-5BQEZYG6.cjs +1294 -0
  5. package/dist/chunk-5BQEZYG6.cjs.map +1 -0
  6. package/dist/chunk-6732H4BQ.cjs +28 -0
  7. package/dist/chunk-6732H4BQ.cjs.map +1 -0
  8. package/dist/chunk-6ABPGOJP.js +722 -0
  9. package/dist/chunk-6ABPGOJP.js.map +1 -0
  10. package/dist/chunk-6XJOB6LE.js +62 -0
  11. package/dist/chunk-6XJOB6LE.js.map +1 -0
  12. package/dist/chunk-774WBLDR.cjs +24 -0
  13. package/dist/chunk-774WBLDR.cjs.map +1 -0
  14. package/dist/chunk-B6OXKW5Q.js +567 -0
  15. package/dist/chunk-B6OXKW5Q.js.map +1 -0
  16. package/dist/chunk-DMPNT3MY.cjs +64 -0
  17. package/dist/chunk-DMPNT3MY.cjs.map +1 -0
  18. package/dist/chunk-EISHOEB6.cjs +158 -0
  19. package/dist/chunk-EISHOEB6.cjs.map +1 -0
  20. package/dist/chunk-EVO23GUS.js +223 -0
  21. package/dist/chunk-EVO23GUS.js.map +1 -0
  22. package/dist/chunk-FVKLCGA4.js +1035 -0
  23. package/dist/chunk-FVKLCGA4.js.map +1 -0
  24. package/dist/chunk-IOXGBPOV.cjs +3681 -0
  25. package/dist/chunk-IOXGBPOV.cjs.map +1 -0
  26. package/dist/chunk-J2LA4GRP.cjs +1051 -0
  27. package/dist/chunk-J2LA4GRP.cjs.map +1 -0
  28. package/dist/chunk-JQ4YLXXM.cjs +580 -0
  29. package/dist/chunk-JQ4YLXXM.cjs.map +1 -0
  30. package/dist/chunk-KCA7RNJ4.cjs +781 -0
  31. package/dist/chunk-KCA7RNJ4.cjs.map +1 -0
  32. package/dist/chunk-NJDDNO4C.js +23 -0
  33. package/dist/chunk-NJDDNO4C.js.map +1 -0
  34. package/dist/chunk-OAQ7MDYX.js +22 -0
  35. package/dist/chunk-OAQ7MDYX.js.map +1 -0
  36. package/dist/chunk-PP6OYURM.cjs +238 -0
  37. package/dist/chunk-PP6OYURM.cjs.map +1 -0
  38. package/dist/chunk-SHX2JGID.cjs +269 -0
  39. package/dist/chunk-SHX2JGID.cjs.map +1 -0
  40. package/dist/chunk-SOYRICHU.js +3645 -0
  41. package/dist/chunk-SOYRICHU.js.map +1 -0
  42. package/dist/chunk-T425FIC7.js +773 -0
  43. package/dist/chunk-T425FIC7.js.map +1 -0
  44. package/dist/chunk-TMG3M6TK.js +152 -0
  45. package/dist/chunk-TMG3M6TK.js.map +1 -0
  46. package/dist/chunk-XLLSS464.cjs +286 -0
  47. package/dist/chunk-XLLSS464.cjs.map +1 -0
  48. package/dist/chunk-XZ5ZFLZM.js +280 -0
  49. package/dist/chunk-XZ5ZFLZM.js.map +1 -0
  50. package/dist/chunk-Z7XOFKM4.cjs +733 -0
  51. package/dist/chunk-Z7XOFKM4.cjs.map +1 -0
  52. package/dist/chunk-ZGMXOMCB.js +266 -0
  53. package/dist/chunk-ZGMXOMCB.js.map +1 -0
  54. package/dist/data.cjs +70 -0
  55. package/dist/data.cjs.map +1 -0
  56. package/dist/data.d.cts +963 -0
  57. package/dist/data.d.ts +963 -0
  58. package/dist/data.js +5 -0
  59. package/dist/data.js.map +1 -0
  60. package/dist/form.cjs +151 -0
  61. package/dist/form.cjs.map +1 -0
  62. package/dist/form.d.cts +2639 -0
  63. package/dist/form.d.ts +2639 -0
  64. package/dist/form.js +6 -0
  65. package/dist/form.js.map +1 -0
  66. package/dist/index.cjs +1158 -0
  67. package/dist/index.cjs.map +1 -0
  68. package/dist/index.d.cts +439 -0
  69. package/dist/index.d.ts +439 -0
  70. package/dist/index.js +547 -0
  71. package/dist/index.js.map +1 -0
  72. package/dist/layout.cjs +67 -0
  73. package/dist/layout.cjs.map +1 -0
  74. package/dist/layout.d.cts +729 -0
  75. package/dist/layout.d.ts +729 -0
  76. package/dist/layout.js +6 -0
  77. package/dist/layout.js.map +1 -0
  78. package/dist/motion.cjs +50 -0
  79. package/dist/motion.cjs.map +1 -0
  80. package/dist/motion.d.cts +681 -0
  81. package/dist/motion.d.ts +681 -0
  82. package/dist/motion.js +5 -0
  83. package/dist/motion.js.map +1 -0
  84. package/dist/navigation.cjs +48 -0
  85. package/dist/navigation.cjs.map +1 -0
  86. package/dist/navigation.d.cts +515 -0
  87. package/dist/navigation.d.ts +515 -0
  88. package/dist/navigation.js +7 -0
  89. package/dist/navigation.js.map +1 -0
  90. package/dist/overlay.cjs +61 -0
  91. package/dist/overlay.cjs.map +1 -0
  92. package/dist/overlay.d.cts +772 -0
  93. package/dist/overlay.d.ts +772 -0
  94. package/dist/overlay.js +8 -0
  95. package/dist/overlay.js.map +1 -0
  96. package/dist/position-Cn7qP1pn.d.cts +50 -0
  97. package/dist/position-Cn7qP1pn.d.ts +50 -0
  98. package/dist/primitives.cjs +129 -0
  99. package/dist/primitives.cjs.map +1 -0
  100. package/dist/primitives.d.cts +300 -0
  101. package/dist/primitives.d.ts +300 -0
  102. package/dist/primitives.js +8 -0
  103. package/dist/primitives.js.map +1 -0
  104. package/dist/sidebar-CQqEmpid.d.cts +124 -0
  105. package/dist/sidebar-CTZ-Ckko.d.ts +124 -0
  106. package/dist/styles.css +5593 -0
  107. package/dist/utils-IKPG3zcC.d.cts +46 -0
  108. package/dist/utils-IKPG3zcC.d.ts +46 -0
  109. package/package.json +91 -0
@@ -0,0 +1,46 @@
1
+ import { VNodeChild, Ref, ComputedRef } from 'vue';
2
+
3
+ /**
4
+ * A ref that is only ever read, never written, by the primitive that accepts it.
5
+ *
6
+ * `useControllableState` returns a `ComputedRef` — read-only by design, so a component can't
7
+ * accidentally mutate state that might be owned by a parent. Every primitive below (`useDismiss`,
8
+ * `useFocusTrap`, `usePresence`, …) only ever reads its `open`/`active` argument, so it accepts
9
+ * either. Typing those parameters as plain `Ref<T>` would reject a `ComputedRef<T>` at the call
10
+ * site — TypeScript treats `{ readonly value: T }` as not assignable to `{ value: T }` — which would
11
+ * force every overlay component to unwrap and re-wrap its own open state for no behavioural reason.
12
+ */
13
+ type ReadonlyRef<T> = Ref<T> | ComputedRef<T>;
14
+ /**
15
+ * A prop that accepts a string, a VNode tree, or a render function — for `label`, `description`,
16
+ * `error` and similar content props across the form and overlay components.
17
+ *
18
+ * Vue's own `VNodeChild` type does not include a bare function, so `PropType<VNodeChild>` narrows
19
+ * `typeof x === 'function'` to `never` and the call site fails to typecheck. Accepting a function
20
+ * here is what lets a caller pass reactive, computed content (`:label="() => \`\${count} items\`"`)
21
+ * without wrapping it in a render-prop-shaped slot.
22
+ */
23
+ type SlotContent = VNodeChild | (() => VNodeChild);
24
+ /**
25
+ * Resolve a {@link SlotContent} prop to a renderable value.
26
+ *
27
+ * Pass the result to `h()` wrapped in an array — `h('p', {}, [resolveSlotContent(x)])`, not
28
+ * `h('p', {}, resolveSlotContent(x))`. The bare (non-array) children overload of `h()` doesn't
29
+ * accept a value that includes `null` in its type, which every `SlotContent` does.
30
+ */
31
+ declare function resolveSlotContent(value: SlotContent | undefined): VNodeChild;
32
+ /** Join class names, dropping falsy entries. The whole of `clsx` that this library actually uses. */
33
+ declare function cx(...parts: Array<string | false | null | undefined>): string;
34
+ /**
35
+ * A stable id, unique per component instance.
36
+ *
37
+ * Vue 3.5 ships a built-in `useId()` solving exactly this; the peer range here is `^3.4.0`, so this
38
+ * exists for the versions before that. `getCurrentInstance().uid` is used rather than a random
39
+ * value because it is **deterministic**: Vue assigns uids in creation order, and a matching
40
+ * server/client tree creates its components in the same order on both sides, so the id a control
41
+ * renders with during SSR is the id it hydrates with. A random or counter-reset-per-request value
42
+ * would mismatch and force a client re-render of every id-bearing attribute.
43
+ */
44
+ declare function useId(prefix?: string): string;
45
+
46
+ export { type ReadonlyRef as R, type SlotContent as S, cx as c, resolveSlotContent as r, useId as u };
@@ -0,0 +1,46 @@
1
+ import { VNodeChild, Ref, ComputedRef } from 'vue';
2
+
3
+ /**
4
+ * A ref that is only ever read, never written, by the primitive that accepts it.
5
+ *
6
+ * `useControllableState` returns a `ComputedRef` — read-only by design, so a component can't
7
+ * accidentally mutate state that might be owned by a parent. Every primitive below (`useDismiss`,
8
+ * `useFocusTrap`, `usePresence`, …) only ever reads its `open`/`active` argument, so it accepts
9
+ * either. Typing those parameters as plain `Ref<T>` would reject a `ComputedRef<T>` at the call
10
+ * site — TypeScript treats `{ readonly value: T }` as not assignable to `{ value: T }` — which would
11
+ * force every overlay component to unwrap and re-wrap its own open state for no behavioural reason.
12
+ */
13
+ type ReadonlyRef<T> = Ref<T> | ComputedRef<T>;
14
+ /**
15
+ * A prop that accepts a string, a VNode tree, or a render function — for `label`, `description`,
16
+ * `error` and similar content props across the form and overlay components.
17
+ *
18
+ * Vue's own `VNodeChild` type does not include a bare function, so `PropType<VNodeChild>` narrows
19
+ * `typeof x === 'function'` to `never` and the call site fails to typecheck. Accepting a function
20
+ * here is what lets a caller pass reactive, computed content (`:label="() => \`\${count} items\`"`)
21
+ * without wrapping it in a render-prop-shaped slot.
22
+ */
23
+ type SlotContent = VNodeChild | (() => VNodeChild);
24
+ /**
25
+ * Resolve a {@link SlotContent} prop to a renderable value.
26
+ *
27
+ * Pass the result to `h()` wrapped in an array — `h('p', {}, [resolveSlotContent(x)])`, not
28
+ * `h('p', {}, resolveSlotContent(x))`. The bare (non-array) children overload of `h()` doesn't
29
+ * accept a value that includes `null` in its type, which every `SlotContent` does.
30
+ */
31
+ declare function resolveSlotContent(value: SlotContent | undefined): VNodeChild;
32
+ /** Join class names, dropping falsy entries. The whole of `clsx` that this library actually uses. */
33
+ declare function cx(...parts: Array<string | false | null | undefined>): string;
34
+ /**
35
+ * A stable id, unique per component instance.
36
+ *
37
+ * Vue 3.5 ships a built-in `useId()` solving exactly this; the peer range here is `^3.4.0`, so this
38
+ * exists for the versions before that. `getCurrentInstance().uid` is used rather than a random
39
+ * value because it is **deterministic**: Vue assigns uids in creation order, and a matching
40
+ * server/client tree creates its components in the same order on both sides, so the id a control
41
+ * renders with during SSR is the id it hydrates with. A random or counter-reset-per-request value
42
+ * would mismatch and force a client re-render of every id-bearing attribute.
43
+ */
44
+ declare function useId(prefix?: string): string;
45
+
46
+ export { type ReadonlyRef as R, type SlotContent as S, cx as c, resolveSlotContent as r, useId as u };
package/package.json ADDED
@@ -0,0 +1,91 @@
1
+ {
2
+ "name": "@ansh-ui/vue",
3
+ "version": "0.2.0",
4
+ "description": "Ansh for Vue 3 and Nuxt — premium animated components and motion composables.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": [
8
+ "**/*.css"
9
+ ],
10
+ "keywords": [
11
+ "vue",
12
+ "vue3",
13
+ "nuxt",
14
+ "animation",
15
+ "motion",
16
+ "components",
17
+ "ui",
18
+ "canvas"
19
+ ],
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/jithin003/ui-library.git",
23
+ "directory": "packages/vue"
24
+ },
25
+ "homepage": "https://github.com/jithin003/ui-library",
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "main": "./dist/index.cjs",
30
+ "module": "./dist/index.js",
31
+ "types": "./dist/index.d.ts",
32
+ "exports": {
33
+ ".": {
34
+ "types": "./dist/index.d.ts",
35
+ "import": "./dist/index.js",
36
+ "require": "./dist/index.cjs"
37
+ },
38
+ "./primitives": {
39
+ "types": "./dist/primitives.d.ts",
40
+ "import": "./dist/primitives.js",
41
+ "require": "./dist/primitives.cjs"
42
+ },
43
+ "./layout": {
44
+ "types": "./dist/layout.d.ts",
45
+ "import": "./dist/layout.js",
46
+ "require": "./dist/layout.cjs"
47
+ },
48
+ "./form": {
49
+ "types": "./dist/form.d.ts",
50
+ "import": "./dist/form.js",
51
+ "require": "./dist/form.cjs"
52
+ },
53
+ "./overlay": {
54
+ "types": "./dist/overlay.d.ts",
55
+ "import": "./dist/overlay.js",
56
+ "require": "./dist/overlay.cjs"
57
+ },
58
+ "./data": {
59
+ "types": "./dist/data.d.ts",
60
+ "import": "./dist/data.js",
61
+ "require": "./dist/data.cjs"
62
+ },
63
+ "./navigation": {
64
+ "types": "./dist/navigation.d.ts",
65
+ "import": "./dist/navigation.js",
66
+ "require": "./dist/navigation.cjs"
67
+ },
68
+ "./motion": {
69
+ "types": "./dist/motion.d.ts",
70
+ "import": "./dist/motion.js",
71
+ "require": "./dist/motion.cjs"
72
+ },
73
+ "./styles.css": "./dist/styles.css",
74
+ "./package.json": "./package.json"
75
+ },
76
+ "dependencies": {
77
+ "@ansh-ui/core": "0.2.0",
78
+ "@ansh-ui/tokens": "0.2.0"
79
+ },
80
+ "peerDependencies": {
81
+ "vue": "^3.4.0"
82
+ },
83
+ "publishConfig": {
84
+ "access": "public"
85
+ },
86
+ "scripts": {
87
+ "build": "tsup && node ./scripts/build-css.mjs",
88
+ "dev": "tsup --watch",
89
+ "typecheck": "tsc -p tsconfig.json --noEmit"
90
+ }
91
+ }