@vuetify/v0 0.1.6 → 0.1.8

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 (162) hide show
  1. package/README.md +0 -1
  2. package/dist/{adapter-Bjs_Nx_J.mjs → adapter-B4zE-hA5.mjs} +5 -8
  3. package/dist/adapter-CqP9Z4JU.d.mts +1087 -0
  4. package/dist/{adapter-CLs-OrSN.d.mts → adapter-DIx4Rntl.d.mts} +5 -48
  5. package/dist/adapters-BjeDmKc6.mjs +1 -0
  6. package/dist/adapters-Bv5aRv3l.mjs +1 -0
  7. package/dist/adapters-C66XaKkw.mjs +1 -0
  8. package/dist/adapters-DkVblyML.mjs +1 -0
  9. package/dist/adapters-uJLWGQJl.mjs +1 -0
  10. package/dist/browser/index.js +2380 -1080
  11. package/dist/components/index.d.mts +2 -20
  12. package/dist/components/index.mjs +34 -39
  13. package/dist/{components-GiQh_RfQ.mjs → components-BbxKYAXs.mjs} +1129 -392
  14. package/dist/composables/index.d.mts +18 -17
  15. package/dist/composables/index.mjs +34 -37
  16. package/dist/{consola-DiUk9j3y.d.mts → consola-BVzYzeLH.d.mts} +1 -1
  17. package/dist/{consola-GBy8XRuL.mjs → consola-Ceox8BWi.mjs} +1 -2
  18. package/dist/constants/index.d.mts +1 -1
  19. package/dist/constants/index.mjs +3 -5
  20. package/dist/{createDataTable-lSofI5rU.mjs → createDataTable-DZouEhvH.mjs} +9 -11
  21. package/dist/{createGroup-CCb7Zfyw.mjs → createGroup-BpJFi41X.mjs} +5 -8
  22. package/dist/{createPagination-lagznd8i.mjs → createPagination-Bu8vE0JW.mjs} +3 -5
  23. package/dist/{createSelection-Zo4RQpYe.mjs → createSelection-8MX0OHXR.mjs} +9 -12
  24. package/dist/{createSingle-BH9wNDrS.mjs → createSingle-CbuOBb-E.mjs} +3 -5
  25. package/dist/{createTokens-Cu1efg9Z.mjs → createTokens-CXlT0Vc6.mjs} +25 -27
  26. package/dist/{createTrinity-Cii8-B2r.mjs → createTrinity-C_c8eedz.mjs} +10 -13
  27. package/dist/data-table/adapters/client/index.d.mts +1 -2
  28. package/dist/data-table/adapters/client/index.mjs +7 -9
  29. package/dist/data-table/adapters/index.d.mts +4 -4
  30. package/dist/data-table/adapters/index.mjs +10 -12
  31. package/dist/data-table/adapters/server/index.d.mts +1 -2
  32. package/dist/data-table/adapters/server/index.mjs +5 -7
  33. package/dist/data-table/adapters/virtual/index.d.mts +1 -2
  34. package/dist/data-table/adapters/virtual/index.mjs +7 -9
  35. package/dist/data-table/index.d.mts +5 -6
  36. package/dist/data-table/index.mjs +22 -25
  37. package/dist/date/index.d.mts +1 -3
  38. package/dist/date/index.mjs +3932 -3943
  39. package/dist/features/adapters/flagsmith/index.d.mts +2 -4
  40. package/dist/features/adapters/flagsmith/index.mjs +2 -3
  41. package/dist/features/adapters/launchdarkly/index.d.mts +1 -3
  42. package/dist/features/adapters/launchdarkly/index.mjs +2 -3
  43. package/dist/features/adapters/posthog/index.d.mts +1 -3
  44. package/dist/features/adapters/posthog/index.mjs +3 -4
  45. package/dist/features/index.d.mts +2 -16
  46. package/dist/features/index.mjs +13 -18
  47. package/dist/{flagsmith-CHmpPGR7.mjs → flagsmith-CrWUeIhT.mjs} +1 -2
  48. package/dist/{globals-D6FBsWDI.mjs → globals-ClSU6mqC.mjs} +2 -3
  49. package/dist/{htmlElements-d8iBCGpO.mjs → htmlElements-DcYtv0hg.mjs} +7 -10
  50. package/dist/{index-De0SQt1w.d.mts → index-63-0oJS8.d.mts} +381 -981
  51. package/dist/{index-DlUIZN-F.d.mts → index-B5NU2uB7.d.mts} +2754 -1642
  52. package/dist/index-CeNfBYuo.d.mts +46 -0
  53. package/dist/{index-DIK84tM4.d.mts → index-CmCMrlt3.d.mts} +3 -3
  54. package/dist/index-CxW4itj1.d.mts +858 -0
  55. package/dist/{index-BFBN5Zl3.d.mts → index-Dor6eAEc.d.mts} +0 -1
  56. package/dist/{index-UNwEBkQT.d.mts → index-MHkcqY_y.d.mts} +1 -2
  57. package/dist/{index-BuOz3Rgm.d.mts → index-dJKXAO5D.d.mts} +1 -2
  58. package/dist/index.d.mts +22 -20
  59. package/dist/index.mjs +38 -40
  60. package/dist/json/attributes.json +252 -0
  61. package/dist/json/importMap.json +60 -0
  62. package/dist/json/tags.json +128 -0
  63. package/dist/json/web-types.json +1023 -228
  64. package/dist/{launchdarkly-W8t8ZANX.mjs → launchdarkly-jF2KZGoH.mjs} +1 -2
  65. package/dist/locale/adapters/index.d.mts +1 -2
  66. package/dist/locale/adapters/index.mjs +4 -6
  67. package/dist/locale/adapters/v0/index.d.mts +1 -2
  68. package/dist/locale/adapters/v0/index.mjs +3 -5
  69. package/dist/locale/index.d.mts +2 -16
  70. package/dist/locale/index.mjs +14 -17
  71. package/dist/logger/adapters/consola/index.d.mts +1 -2
  72. package/dist/logger/adapters/consola/index.mjs +2 -3
  73. package/dist/logger/adapters/index.d.mts +4 -4
  74. package/dist/logger/adapters/index.mjs +6 -8
  75. package/dist/logger/adapters/pino/index.d.mts +1 -2
  76. package/dist/logger/adapters/pino/index.mjs +3 -5
  77. package/dist/logger/adapters/v0/index.d.mts +1 -2
  78. package/dist/logger/adapters/v0/index.mjs +3 -5
  79. package/dist/logger/index.d.mts +5 -16
  80. package/dist/logger/index.mjs +8 -10
  81. package/dist/{memory-BsZGbGnG.mjs → memory-XCMtkld1.mjs} +1 -2
  82. package/dist/palettes/ant/generate/index.d.mts +9 -0
  83. package/dist/palettes/ant/generate/index.mjs +98 -0
  84. package/dist/palettes/ant/index.d.mts +6 -0
  85. package/dist/palettes/ant/index.mjs +149 -0
  86. package/dist/palettes/index.d.mts +12 -0
  87. package/dist/palettes/index.mjs +1 -0
  88. package/dist/palettes/leonardo/generate/index.d.mts +10 -0
  89. package/dist/palettes/leonardo/generate/index.mjs +120 -0
  90. package/dist/palettes/material/generate/index.d.mts +10 -0
  91. package/dist/palettes/material/generate/index.mjs +103 -0
  92. package/dist/palettes/material/index.d.mts +6 -0
  93. package/dist/palettes/material/index.mjs +173 -0
  94. package/dist/palettes/md1/index.d.mts +6 -0
  95. package/dist/palettes/md1/index.mjs +261 -0
  96. package/dist/palettes/md2/index.d.mts +6 -0
  97. package/dist/palettes/md2/index.mjs +297 -0
  98. package/dist/palettes/radix/index.d.mts +6 -0
  99. package/dist/palettes/radix/index.mjs +439 -0
  100. package/dist/palettes/tailwind/index.d.mts +6 -0
  101. package/dist/palettes/tailwind/index.mjs +291 -0
  102. package/dist/permissions/adapters/index.d.mts +2 -17
  103. package/dist/permissions/adapters/index.mjs +4 -6
  104. package/dist/permissions/adapters/v0/index.d.mts +1 -17
  105. package/dist/permissions/adapters/v0/index.mjs +3 -5
  106. package/dist/permissions/index.d.mts +1 -16
  107. package/dist/permissions/index.mjs +12 -15
  108. package/dist/{pino-BD5PCzAF.mjs → pino-B7tJ3m18.mjs} +2 -4
  109. package/dist/{pino-p-jDkNQd.d.mts → pino-Bzighnkd.d.mts} +1 -2
  110. package/dist/{posthog-BxaG8sYi.mjs → posthog-BE7-t7cV.mjs} +2 -4
  111. package/dist/rules/index.d.mts +2 -0
  112. package/dist/rules/index.mjs +15 -0
  113. package/dist/{server-DgOdFYMU.mjs → server-CZ6ahbEH.mjs} +2 -4
  114. package/dist/{server-CGAeOGPC.d.mts → server-Ch9J86tb.d.mts} +1 -2
  115. package/dist/storage/adapters/index.d.mts +2 -2
  116. package/dist/storage/adapters/index.mjs +2 -3
  117. package/dist/storage/adapters/memory/index.d.mts +1 -1
  118. package/dist/storage/adapters/memory/index.mjs +2 -3
  119. package/dist/storage/index.d.mts +3 -16
  120. package/dist/storage/index.mjs +33 -37
  121. package/dist/theme/adapters/index.d.mts +1 -16
  122. package/dist/theme/adapters/index.mjs +4 -6
  123. package/dist/theme/adapters/v0/index.d.mts +1 -16
  124. package/dist/theme/adapters/v0/index.mjs +3 -5
  125. package/dist/theme/index.d.mts +1 -16
  126. package/dist/theme/index.mjs +13 -16
  127. package/dist/{toArray-BBZH-G2X.mjs → toArray-VdROPpy-.mjs} +2 -4
  128. package/dist/types/index.d.mts +1 -1
  129. package/dist/types/index.mjs +1 -1
  130. package/dist/{useClickOutside-Bm_3mbcT.mjs → useClickOutside-W0Sur1rC.mjs} +671 -211
  131. package/dist/{useFeatures-BS4mit8z.mjs → useFeatures-CUicSI-E.mjs} +5 -8
  132. package/dist/{useLocale-DJJmg-wv.mjs → useLocale-cQlPxbpV.mjs} +14 -12
  133. package/dist/{useLogger-C8G5jgNk.mjs → useLogger-DY1Hbcy1.mjs} +13 -16
  134. package/dist/{usePermissions-C5Mkotol.mjs → usePermissions-BSW59R4q.mjs} +5 -7
  135. package/dist/useRules-BbA6_gvs.mjs +144 -0
  136. package/dist/{useTheme-BBnASLr3.mjs → useTheme-Bdx2Lj5c.mjs} +11 -13
  137. package/dist/utilities/index.d.mts +1 -2
  138. package/dist/utilities/index.mjs +426 -4
  139. package/dist/{v0-BOxb3nD1.d.mts → v0-1xxC39wf.d.mts} +1 -2
  140. package/dist/{v0-DzvhDU1W.mjs → v0-2G2476h-.mjs} +3 -6
  141. package/dist/{v0-DtO_ICXr.mjs → v0-B1QQGE4O.mjs} +2 -5
  142. package/dist/{v0-lua6ffdk.mjs → v0-BFseIsBi.mjs} +3 -5
  143. package/dist/{v0-Bh8d1j_p.d.mts → v0-BZINNGoC.d.mts} +2 -2
  144. package/dist/{v0-DHMoZ7dS.d.mts → v0-CAKa6tzG.d.mts} +1 -1
  145. package/dist/{v0-BWBSVkew.mjs → v0-CHBrvw49.mjs} +3 -5
  146. package/dist/{v0-CVr15VcY.d.mts → v0-CdUL2eOn.d.mts} +1 -2
  147. package/dist/{v0-CWUF_HqP.mjs → v0-YAqbXudL.mjs} +3 -5
  148. package/dist/{virtual-CVb9hRUU.d.mts → virtual-DwBiFA25.d.mts} +1 -2
  149. package/dist/{virtual-BEOqkQvm.mjs → virtual-eDNVH1fz.mjs} +3 -5
  150. package/package.json +40 -11
  151. package/dist/adapter-DcwxFryd.d.mts +0 -97
  152. package/dist/adapters-BGJKsBrw.mjs +0 -1
  153. package/dist/adapters-BQ-Lr3PW.mjs +0 -1
  154. package/dist/adapters-DEXpW9If.mjs +0 -1
  155. package/dist/adapters-Q9WaOsJp.mjs +0 -1
  156. package/dist/adapters-SSDVth5e.mjs +0 -1
  157. package/dist/constants-B8pMSkcW.mjs +0 -1
  158. package/dist/utilities-CcJtp9Gx.mjs +0 -429
  159. /package/dist/{adapter-CJIj5ySf.d.mts → adapter-JTFG3Jn8.d.mts} +0 -0
  160. /package/dist/{index-Bv1VN_j5.d.mts → index-B5ZDDkXv.d.mts} +0 -0
  161. /package/dist/{index-BDTbJClL.d.mts → index-NsE5nARK.d.mts} +0 -0
  162. /package/dist/{memory-DVjquu_v.d.mts → memory-BTtRdnNn.d.mts} +0 -0
package/package.json CHANGED
@@ -1,10 +1,8 @@
1
1
  {
2
2
  "name": "@vuetify/v0",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Vuetify0",
5
5
  "license": "MIT",
6
- "main": "./dist/index.mjs",
7
- "module": "./dist/index.mjs",
8
6
  "types": "./dist/index.d.mts",
9
7
  "type": "module",
10
8
  "files": [
@@ -17,13 +15,16 @@
17
15
  "directory": "packages/0"
18
16
  },
19
17
  "peerDependencies": {
20
- "flagsmith": "^10.0.0",
18
+ "@adobe/leonardo-contrast-colors": ">=1.0.0",
19
+ "@ant-design/colors": ">=7.0.0",
20
+ "@flagsmith/flagsmith": "^11.0.0",
21
+ "@material/material-color-utilities": ">=0.3.0",
21
22
  "launchdarkly-js-client-sdk": "^3.0.0",
22
23
  "posthog-js": "^1.0.0",
23
24
  "vue": ">=3.5.0"
24
25
  },
25
26
  "peerDependenciesMeta": {
26
- "flagsmith": {
27
+ "@flagsmith/flagsmith": {
27
28
  "optional": true
28
29
  },
29
30
  "launchdarkly-js-client-sdk": {
@@ -31,19 +32,32 @@
31
32
  },
32
33
  "posthog-js": {
33
34
  "optional": true
35
+ },
36
+ "@material/material-color-utilities": {
37
+ "optional": true
38
+ },
39
+ "@ant-design/colors": {
40
+ "optional": true
41
+ },
42
+ "@adobe/leonardo-contrast-colors": {
43
+ "optional": true
34
44
  }
35
45
  },
36
46
  "devDependencies": {
47
+ "@adobe/leonardo-contrast-colors": "^1.0.0",
48
+ "@ant-design/colors": "^8.0.0",
49
+ "@flagsmith/flagsmith": "^11.0.0",
50
+ "@material/material-color-utilities": "^0.4.0",
51
+ "@vue/compiler-dom": "^3.5.30",
37
52
  "@vue/test-utils": "^2.4.6",
38
- "flagsmith": "^10.0.0",
39
53
  "launchdarkly-js-client-sdk": "^3.9.0",
40
- "posthog-js": "1.310.1",
41
- "tsdown": "^0.16.8",
54
+ "posthog-js": "^1.360.1",
55
+ "tsdown": "^0.21.2",
42
56
  "tsx": "4.21.0",
43
57
  "typescript": "5.9.3",
44
- "unplugin-vue": "^7.1.0",
45
- "vue": "3.5.24",
46
- "vue-component-meta": "^3.2.2"
58
+ "unplugin-vue": "^7.1.1",
59
+ "vue": "3.5.30",
60
+ "vue-component-meta": "^3.2.5"
47
61
  },
48
62
  "imports": {
49
63
  "#v0/*": {
@@ -74,9 +88,20 @@
74
88
  "./logger/adapters/consola": "./dist/logger/adapters/consola/index.mjs",
75
89
  "./logger/adapters/pino": "./dist/logger/adapters/pino/index.mjs",
76
90
  "./logger/adapters/v0": "./dist/logger/adapters/v0/index.mjs",
91
+ "./palettes": "./dist/palettes/index.mjs",
92
+ "./palettes/ant": "./dist/palettes/ant/index.mjs",
93
+ "./palettes/ant/generate": "./dist/palettes/ant/generate/index.mjs",
94
+ "./palettes/leonardo/generate": "./dist/palettes/leonardo/generate/index.mjs",
95
+ "./palettes/material": "./dist/palettes/material/index.mjs",
96
+ "./palettes/material/generate": "./dist/palettes/material/generate/index.mjs",
97
+ "./palettes/md1": "./dist/palettes/md1/index.mjs",
98
+ "./palettes/md2": "./dist/palettes/md2/index.mjs",
99
+ "./palettes/radix": "./dist/palettes/radix/index.mjs",
100
+ "./palettes/tailwind": "./dist/palettes/tailwind/index.mjs",
77
101
  "./permissions": "./dist/permissions/index.mjs",
78
102
  "./permissions/adapters": "./dist/permissions/adapters/index.mjs",
79
103
  "./permissions/adapters/v0": "./dist/permissions/adapters/v0/index.mjs",
104
+ "./rules": "./dist/rules/index.mjs",
80
105
  "./storage": "./dist/storage/index.mjs",
81
106
  "./storage/adapters": "./dist/storage/adapters/index.mjs",
82
107
  "./storage/adapters/memory": "./dist/storage/adapters/memory/index.mjs",
@@ -91,6 +116,10 @@
91
116
  "optionalDependencies": {
92
117
  "@js-temporal/polyfill": "0.5.1"
93
118
  },
119
+ "inlinedDependencies": {
120
+ "jsbi": "4.3.2",
121
+ "@js-temporal/polyfill": "0.5.1"
122
+ },
94
123
  "scripts": {
95
124
  "build": "tsdown && pnpm generate:web-types",
96
125
  "generate:web-types": "tsx scripts/generate-web-types.ts",
@@ -1,97 +0,0 @@
1
- import { Temporal } from "@js-temporal/polyfill";
2
-
3
- //#region src/composables/useDate/adapters/adapter.d.ts
4
-
5
- interface DateAdapter<T = Temporal.PlainDateTime> {
6
- /** Current locale for formatting */
7
- locale?: string;
8
- /** Create a date from various input types */
9
- date: (value?: unknown) => T | null;
10
- /** Convert to JavaScript Date object */
11
- toJsDate: (value: T) => Date;
12
- /** Parse ISO 8601 string */
13
- parseISO: (date: string) => T;
14
- /** Convert to ISO 8601 string */
15
- toISO: (date: T) => string;
16
- /** Parse date string with custom format */
17
- parse: (value: string, format: string) => T | null;
18
- /** Check if value is a valid date (type predicate for narrowing) */
19
- isValid: (date: unknown) => date is T;
20
- /** Check if value is null (type predicate for narrowing) */
21
- isNull: (value: T | null) => value is null;
22
- /** Get current locale code */
23
- getCurrentLocaleCode: () => string;
24
- /** Check if current locale uses 12-hour cycle */
25
- is12HourCycleInCurrentLocale: () => boolean;
26
- /** Format date using preset format key */
27
- format: (date: T, formatString: string) => string;
28
- /** Format date using custom format string */
29
- formatByString: (date: T, formatString: string) => string;
30
- /** Get helper text for format string (e.g., "mm/dd/yyyy") */
31
- getFormatHelperText: (format: string) => string;
32
- /** Format number according to locale */
33
- formatNumber: (numberToFormat: string) => string;
34
- /** Get meridiem text (AM/PM) for locale */
35
- getMeridiemText: (ampm: 'am' | 'pm') => string;
36
- startOfDay: (date: T) => T;
37
- endOfDay: (date: T) => T;
38
- /** @param firstDayOfWeek - 0=Sunday, 1=Monday, etc. */
39
- startOfWeek: (date: T, firstDayOfWeek?: number) => T;
40
- /** @param firstDayOfWeek - 0=Sunday, 1=Monday, etc. */
41
- endOfWeek: (date: T, firstDayOfWeek?: number) => T;
42
- startOfMonth: (date: T) => T;
43
- endOfMonth: (date: T) => T;
44
- startOfYear: (date: T) => T;
45
- endOfYear: (date: T) => T;
46
- addSeconds: (date: T, amount: number) => T;
47
- addMinutes: (date: T, amount: number) => T;
48
- addHours: (date: T, amount: number) => T;
49
- addDays: (date: T, amount: number) => T;
50
- addWeeks: (date: T, amount: number) => T;
51
- addMonths: (date: T, amount: number) => T;
52
- addYears: (date: T, amount: number) => T;
53
- isAfter: (date: T, comparing: T) => boolean;
54
- isAfterDay: (date: T, comparing: T) => boolean;
55
- isAfterMonth: (date: T, comparing: T) => boolean;
56
- isAfterYear: (date: T, comparing: T) => boolean;
57
- isBefore: (date: T, comparing: T) => boolean;
58
- isBeforeDay: (date: T, comparing: T) => boolean;
59
- isBeforeMonth: (date: T, comparing: T) => boolean;
60
- isBeforeYear: (date: T, comparing: T) => boolean;
61
- isEqual: (date: T, comparing: T) => boolean;
62
- isSameDay: (date: T, comparing: T) => boolean;
63
- isSameMonth: (date: T, comparing: T) => boolean;
64
- isSameYear: (date: T, comparing: T) => boolean;
65
- isSameHour: (date: T, comparing: T) => boolean;
66
- isWithinRange: (date: T, range: [T, T]) => boolean;
67
- getYear: (date: T) => number;
68
- getMonth: (date: T) => number;
69
- getDate: (date: T) => number;
70
- getHours: (date: T) => number;
71
- getMinutes: (date: T) => number;
72
- getSeconds: (date: T) => number;
73
- /** @param comparing - Can be T or ISO string */
74
- getDiff: (date: T, comparing: T | string, unit?: string) => number;
75
- /** @param minimalDays - Minimum days in first week for it to count as week 1 */
76
- getWeek: (date: T, firstDayOfWeek?: number, minimalDays?: number) => number;
77
- /** Get number of days in the month */
78
- getDaysInMonth: (date: T) => number;
79
- setYear: (date: T, year: number) => T;
80
- setMonth: (date: T, month: number) => T;
81
- setDate: (date: T, day: number) => T;
82
- setHours: (date: T, hours: number) => T;
83
- setMinutes: (date: T, minutes: number) => T;
84
- setSeconds: (date: T, seconds: number) => T;
85
- getWeekdays: (firstDayOfWeek?: number, weekdayFormat?: 'long' | 'short' | 'narrow') => string[];
86
- getWeekArray: (date: T, firstDayOfWeek?: number) => T[][];
87
- /** Get array of months in a year (12 dates, one for each month) */
88
- getMonthArray: (date: T) => T[];
89
- /** Get array of years between start and end dates */
90
- getYearRange: (start: T, end: T) => T[];
91
- getNextMonth: (date: T) => T;
92
- getPreviousMonth: (date: T) => T;
93
- /** Merge date from one value with time from another */
94
- mergeDateAndTime: (date: T, time: T) => T;
95
- }
96
- //#endregion
97
- export { DateAdapter as t };
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1,429 +0,0 @@
1
- import { t as IN_BROWSER } from "./globals-D6FBsWDI.mjs";
2
- import * as Vue from "vue";
3
- import { useId } from "vue";
4
-
5
- //#region src/utilities/instance.ts
6
- /**
7
- * Vue 3.6+ exposes `currentInstance` for Vapor mode compatibility.
8
- * `getCurrentInstance()` returns null in Vapor components by design,
9
- * so we access `currentInstance` directly when available.
10
- *
11
- * Uses dynamic key to avoid bundler static analysis warnings.
12
- *
13
- * @see https://github.com/orgs/vuejs/discussions/13629
14
- * @internal
15
- */
16
- const INSTANCE_KEY = "currentInstance";
17
- function getInstanceCompat() {
18
- const vueExports = Vue;
19
- if (INSTANCE_KEY in vueExports) return vueExports[INSTANCE_KEY];
20
- return Vue.getCurrentInstance();
21
- }
22
- function instanceExists() {
23
- return !/* @__PURE__ */ isNull(getInstanceCompat());
24
- }
25
- function instanceName() {
26
- return getInstanceCompat()?.type?.name;
27
- }
28
-
29
- //#endregion
30
- //#region src/utilities/helpers.ts
31
- /**
32
- * @module utilities/helpers
33
- *
34
- * @remarks
35
- * Collection of utility functions for type checking, object manipulation,
36
- * and common transformations. All exports are tree-shakeable.
37
- */
38
- /**
39
- * Checks if a value is a function
40
- *
41
- * @param item The value to check
42
- * @returns True if the value is a function
43
- *
44
- * @example
45
- * ```ts
46
- * isFunction(() => {}) // true
47
- * isFunction('string') // false
48
- * ```
49
- */
50
- /* @__NO_SIDE_EFFECTS__ */
51
- function isFunction(item) {
52
- return typeof item === "function";
53
- }
54
- /**
55
- * Checks if a value is a string
56
- *
57
- * @param item The value to check
58
- * @returns True if the value is a string
59
- *
60
- * @example
61
- * ```ts
62
- * isString('hello') // true
63
- * isString(123) // false
64
- * ```
65
- */
66
- /* @__NO_SIDE_EFFECTS__ */
67
- function isString(item) {
68
- return typeof item === "string";
69
- }
70
- /**
71
- * Checks if a value is a number
72
- *
73
- * @param item The value to check
74
- * @returns True if the value is a number (including NaN)
75
- *
76
- * @example
77
- * ```ts
78
- * isNumber(123) // true
79
- * isNumber(NaN) // true
80
- * isNumber('123') // false
81
- * ```
82
- *
83
- * @see {@link isNaN} to check for NaN specifically
84
- */
85
- /* @__NO_SIDE_EFFECTS__ */
86
- function isNumber(item) {
87
- return typeof item === "number";
88
- }
89
- /**
90
- * Checks if a value is a boolean
91
- *
92
- * @param item The value to check
93
- * @returns True if the value is a boolean
94
- *
95
- * @example
96
- * ```ts
97
- * isBoolean(true) // true
98
- * isBoolean(false) // true
99
- * isBoolean(0) // false
100
- * ```
101
- */
102
- /* @__NO_SIDE_EFFECTS__ */
103
- function isBoolean(item) {
104
- return typeof item === "boolean";
105
- }
106
- /**
107
- * Checks if a value is a plain object (excludes null and arrays)
108
- *
109
- * @param item The value to check
110
- * @returns True if the value is a plain object
111
- *
112
- * @remarks
113
- * Returns false for null and arrays, even though `typeof null === 'object'`
114
- * and `typeof [] === 'object'` in JavaScript.
115
- *
116
- * @example
117
- * ```ts
118
- * isObject({}) // true
119
- * isObject({ a: 1 }) // true
120
- * isObject(null) // false
121
- * isObject([]) // false
122
- * ```
123
- *
124
- * @see {@link isArray} to check for arrays
125
- * @see {@link isNull} to check for null
126
- */
127
- /* @__NO_SIDE_EFFECTS__ */
128
- function isObject(item) {
129
- return typeof item === "object" && item !== null && !Array.isArray(item);
130
- }
131
- /**
132
- * Checks if a value is an array
133
- *
134
- * @param item The value to check
135
- * @returns True if the value is an array
136
- *
137
- * @example
138
- * ```ts
139
- * isArray([]) // true
140
- * isArray([1, 2, 3]) // true
141
- * isArray('string') // false
142
- * ```
143
- */
144
- /* @__NO_SIDE_EFFECTS__ */
145
- function isArray(item) {
146
- return Array.isArray(item);
147
- }
148
- /**
149
- * Checks if a value is a DOM Element
150
- *
151
- * @param item The value to check
152
- * @returns True if the value is a DOM Element
153
- *
154
- * @example
155
- * ```ts
156
- * isElement(document.body) // true
157
- * isElement('string') // false
158
- * isElement(null) // false
159
- * ```
160
- */
161
- /* @__NO_SIDE_EFFECTS__ */
162
- function isElement(item) {
163
- return item instanceof Element;
164
- }
165
- /**
166
- * Checks if a value is null
167
- *
168
- * @param item The value to check
169
- * @returns True if the value is null
170
- *
171
- * @example
172
- * ```ts
173
- * isNull(null) // true
174
- * isNull(undefined) // false
175
- * ```
176
- *
177
- * @see {@link isUndefined} to check for undefined
178
- * @see {@link isNullOrUndefined} to check for either
179
- */
180
- /* @__NO_SIDE_EFFECTS__ */
181
- function isNull(item) {
182
- return item === null;
183
- }
184
- /**
185
- * Checks if a value is null or undefined
186
- *
187
- * @param item The value to check
188
- * @returns True if the value is null or undefined
189
- *
190
- * @remarks
191
- * Uses loose equality (`== null`) which matches both null and undefined.
192
- *
193
- * @example
194
- * ```ts
195
- * isNullOrUndefined(null) // true
196
- * isNullOrUndefined(undefined) // true
197
- * isNullOrUndefined(0) // false
198
- * isNullOrUndefined('') // false
199
- * ```
200
- *
201
- * @see {@link isNull} to check for null only
202
- * @see {@link isUndefined} to check for undefined only
203
- */
204
- /* @__NO_SIDE_EFFECTS__ */
205
- function isNullOrUndefined(item) {
206
- return item == null;
207
- }
208
- /**
209
- * Checks if a value is undefined
210
- *
211
- * @param item The value to check
212
- * @returns True if the value is undefined
213
- *
214
- * @example
215
- * ```ts
216
- * isUndefined(undefined) // true
217
- * isUndefined(null) // false
218
- * ```
219
- *
220
- * @see {@link isNull} to check for null
221
- * @see {@link isNullOrUndefined} to check for either
222
- */
223
- /* @__NO_SIDE_EFFECTS__ */
224
- function isUndefined(item) {
225
- return item === void 0;
226
- }
227
- /**
228
- * Checks if a value is a primitive (string, number, or boolean)
229
- *
230
- * @param item The value to check
231
- * @returns True if the value is a string, number, or boolean
232
- *
233
- * @example
234
- * ```ts
235
- * isPrimitive('hello') // true
236
- * isPrimitive(123) // true
237
- * isPrimitive(true) // true
238
- * isPrimitive({}) // false
239
- * isPrimitive(null) // false
240
- * ```
241
- */
242
- /* @__NO_SIDE_EFFECTS__ */
243
- function isPrimitive(item) {
244
- return typeof item === "string" || typeof item === "number" || typeof item === "boolean";
245
- }
246
- /**
247
- * Checks if a value is a symbol
248
- *
249
- * @param item The value to check
250
- * @returns True if the value is a symbol
251
- *
252
- * @example
253
- * ```ts
254
- * isSymbol(Symbol('test')) // true
255
- * isSymbol('symbol') // false
256
- * ```
257
- */
258
- /* @__NO_SIDE_EFFECTS__ */
259
- function isSymbol(item) {
260
- return typeof item === "symbol";
261
- }
262
- /**
263
- * Checks if a value is NaN (Not a Number)
264
- *
265
- * @param item The value to check
266
- * @returns True if the value is NaN
267
- *
268
- * @remarks
269
- * Uses `Number.isNaN()` which only returns true for the actual NaN value,
270
- * unlike the global `isNaN()` which coerces the argument to a number first.
271
- *
272
- * @example
273
- * ```ts
274
- * isNaN(NaN) // true
275
- * isNaN(123) // false
276
- * isNaN('hello') // false (unlike global isNaN)
277
- * isNaN(undefined) // false (unlike global isNaN)
278
- * ```
279
- *
280
- * @see {@link isNumber} to check if a value is a number type
281
- */
282
- /* @__NO_SIDE_EFFECTS__ */
283
- function isNaN(item) {
284
- return /* @__PURE__ */ isNumber(item) && Number.isNaN(item);
285
- }
286
- /**
287
- * Deeply merges source objects into a target object
288
- *
289
- * @param target The target object to merge into (will be mutated)
290
- * @param sources One or more source objects to merge from
291
- * @returns The mutated target object
292
- *
293
- * @remarks
294
- * - Mutates the target object in place
295
- * - Nested objects are recursively merged
296
- * - Arrays are replaced, not merged
297
- * - Primitives from sources overwrite target values
298
- *
299
- * @example
300
- * ```ts
301
- * const target = { a: 1, b: { c: 2 } }
302
- * mergeDeep(target, { b: { d: 3 } })
303
- * // target is now { a: 1, b: { c: 2, d: 3 } }
304
- *
305
- * // Multiple sources
306
- * mergeDeep({}, { a: 1 }, { b: 2 }) // { a: 1, b: 2 }
307
- *
308
- * // Arrays are replaced
309
- * mergeDeep({ arr: [1, 2] }, { arr: [3] }) // { arr: [3] }
310
- * ```
311
- */
312
- const UNSAFE_KEYS = new Set([
313
- "__proto__",
314
- "constructor",
315
- "prototype"
316
- ]);
317
- /* @__NO_SIDE_EFFECTS__ */
318
- function mergeDeep(target, ...sources) {
319
- if (sources.length === 0) return target;
320
- const source = sources.shift();
321
- if (/* @__PURE__ */ isObject(target) && /* @__PURE__ */ isObject(source)) for (const key in source) {
322
- if (UNSAFE_KEYS.has(key)) continue;
323
- if (!Object.prototype.hasOwnProperty.call(source, key)) continue;
324
- const sourceValue = source[key];
325
- const targetValue = target[key];
326
- if (/* @__PURE__ */ isObject(sourceValue)) {
327
- if (!/* @__PURE__ */ isObject(targetValue)) Object.assign(target, { [key]: {} });
328
- target[key];
329
- } else Object.assign(target, { [key]: sourceValue });
330
- }
331
- return /* @__PURE__ */ mergeDeep(target, ...sources);
332
- }
333
- let idCounter = 0;
334
- /**
335
- * Generates a unique ID, using Vue's useId when in component context
336
- *
337
- * @returns A unique string ID
338
- *
339
- * @remarks
340
- * - In component setup/lifecycle: Uses Vue's `useId()` for SSR-safe hydration
341
- * - Outside components: Falls back to sequential counter (`v0-0`, `v0-1`, ...)
342
- * - Vapor mode compatible
343
- *
344
- * @example
345
- * ```ts
346
- * // In component setup - SSR safe
347
- * const id = useId() // 'v:0', 'v:1', etc. (Vue's format)
348
- *
349
- * // Outside component - counter fallback
350
- * const id = useId() // 'v0-0', 'v0-1', etc.
351
- * ```
352
- */
353
- /* @__NO_SIDE_EFFECTS__ */
354
- function useId$1() {
355
- if (instanceExists()) return useId();
356
- if (!/* @__PURE__ */ isUndefined(process.env.NODE_ENV !== "production") && process.env.NODE_ENV !== "production" && !IN_BROWSER) console.warn("[v0 warn] useId() called outside component context during SSR. Provide explicit ID to avoid hydration mismatch.");
357
- return `v0-${idCounter++}`;
358
- }
359
- /**
360
- * Clamps a value between a minimum and maximum
361
- *
362
- * @param value The value to clamp
363
- * @param min The minimum value (default: 0)
364
- * @param max The maximum value (default: 1)
365
- * @returns The clamped value
366
- *
367
- * @example
368
- * ```ts
369
- * clamp(5, 0, 10) // 5
370
- * clamp(-5, 0, 10) // 0
371
- * clamp(15, 0, 10) // 10
372
- * ```
373
- */
374
- /* @__NO_SIDE_EFFECTS__ */
375
- function clamp(value, min = 0, max = 1) {
376
- return Math.max(min, Math.min(max, value));
377
- }
378
- /**
379
- * Creates an array of sequential numbers
380
- *
381
- * @param length The length of the array to create
382
- * @param start The starting index (default: 0)
383
- * @returns An array of sequential numbers
384
- *
385
- * @example
386
- * ```ts
387
- * range(3) // [0, 1, 2]
388
- * range(3, 1) // [1, 2, 3]
389
- * range(5, 10) // [10, 11, 12, 13, 14]
390
- * range(0) // []
391
- * ```
392
- */
393
- /* @__NO_SIDE_EFFECTS__ */
394
- function range(length, start = 0) {
395
- return Array.from({ length }, (_, index) => start + index);
396
- }
397
- /**
398
- * Debounces a function call by the specified delay
399
- *
400
- * @param fn The function to debounce
401
- * @param delay The delay in milliseconds
402
- * @returns A debounced function with clear and immediate methods
403
- *
404
- * @example
405
- * ```ts
406
- * const debouncedFn = debounce(() => console.log('called'), 500)
407
- * debouncedFn() // Will call after 500ms
408
- * debouncedFn.clear() // Cancel pending call
409
- * debouncedFn.immediate() // Call immediately
410
- * ```
411
- */
412
- function debounce(fn, delay) {
413
- let timeoutId;
414
- function debounced(...args) {
415
- if (!/* @__PURE__ */ isUndefined(timeoutId)) clearTimeout(timeoutId);
416
- timeoutId = setTimeout(() => fn(...args), delay);
417
- }
418
- debounced.clear = () => {
419
- if (!/* @__PURE__ */ isUndefined(timeoutId)) clearTimeout(timeoutId);
420
- };
421
- debounced.immediate = (...args) => {
422
- debounced.clear();
423
- fn(...args);
424
- };
425
- return debounced;
426
- }
427
-
428
- //#endregion
429
- export { range as _, isElement as a, instanceName as b, isNull as c, isObject as d, isPrimitive as f, mergeDeep as g, isUndefined as h, isBoolean as i, isNullOrUndefined as l, isSymbol as m, debounce as n, isFunction as o, isString as p, isArray as r, isNaN as s, clamp as t, isNumber as u, useId$1 as v, instanceExists as y };