@pelatform/ui 1.6.0 → 2.1.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 (126) hide show
  1. package/README.md +360 -5
  2. package/dist/animation.d.ts +6 -379
  3. package/dist/animation.js +2 -1750
  4. package/dist/base.d.ts +1 -651
  5. package/dist/base.js +2 -5554
  6. package/dist/components.d.ts +1 -2944
  7. package/dist/components.js +2 -2719
  8. package/dist/css/color/gray.css +105 -0
  9. package/dist/css/color/neutral.css +105 -0
  10. package/dist/css/color/slate.css +105 -0
  11. package/dist/css/color/stone.css +105 -0
  12. package/dist/css/color/zinc.css +105 -0
  13. package/dist/css/styles/style-lyra.css +1335 -0
  14. package/dist/css/styles/style-maia.css +1360 -0
  15. package/dist/css/styles/style-mira.css +1362 -0
  16. package/dist/css/styles/style-nova.css +1360 -0
  17. package/dist/css/styles/style-vega.css +1356 -0
  18. package/dist/hooks.d.ts +1 -1172
  19. package/dist/hooks.js +2 -664
  20. package/dist/index.d.ts +1 -318
  21. package/dist/index.js +3 -229
  22. package/dist/radix.d.ts +1 -0
  23. package/dist/radix.js +4 -0
  24. package/dist/style.css +2 -0
  25. package/package.json +82 -136
  26. package/LICENSE +0 -21
  27. package/css/components/apexcharts.css +0 -101
  28. package/css/components/book.css +0 -19
  29. package/css/components/extra.css +0 -12
  30. package/css/components/image-input.css +0 -51
  31. package/css/components/leaflet.css +0 -25
  32. package/css/components/patterns.css +0 -34
  33. package/css/components/rating.css +0 -89
  34. package/css/components/scrollable.css +0 -118
  35. package/css/components/theme-transition.css +0 -51
  36. package/css/theme.css +0 -238
  37. package/dist/animation.cjs +0 -1752
  38. package/dist/animation.d.cts +0 -379
  39. package/dist/aria.cjs +0 -139
  40. package/dist/aria.d.cts +0 -31
  41. package/dist/aria.d.ts +0 -31
  42. package/dist/aria.js +0 -139
  43. package/dist/badge-BtI4BMea.d.cts +0 -33
  44. package/dist/badge-BtI4BMea.d.ts +0 -33
  45. package/dist/base.cjs +0 -5556
  46. package/dist/base.d.cts +0 -651
  47. package/dist/chunk-3N75YA6Q.cjs +0 -60
  48. package/dist/chunk-7472NIIL.cjs +0 -40
  49. package/dist/chunk-BXUKTDPN.cjs +0 -576
  50. package/dist/chunk-CD2BCCQU.js +0 -180
  51. package/dist/chunk-CJXIPSTG.cjs +0 -10
  52. package/dist/chunk-CTHRAJQZ.js +0 -1522
  53. package/dist/chunk-D373YKDA.js +0 -196
  54. package/dist/chunk-EZW5GNS4.js +0 -6
  55. package/dist/chunk-HILACSFA.cjs +0 -1522
  56. package/dist/chunk-HR3R6KKM.js +0 -40
  57. package/dist/chunk-HW52LCWN.js +0 -22
  58. package/dist/chunk-I46SELBA.cjs +0 -22
  59. package/dist/chunk-J4JGE3U5.cjs +0 -180
  60. package/dist/chunk-RQHJBTEU.js +0 -10
  61. package/dist/chunk-SK6SSJHC.js +0 -9
  62. package/dist/chunk-T74DBLYY.js +0 -60
  63. package/dist/chunk-TB6DU23O.js +0 -576
  64. package/dist/chunk-UP53DCYH.cjs +0 -6
  65. package/dist/chunk-ZBO5IAMA.cjs +0 -196
  66. package/dist/chunk-ZDR3OZ7Z.cjs +0 -9
  67. package/dist/colors-CUDWvz1g.d.cts +0 -42
  68. package/dist/colors-CUDWvz1g.d.ts +0 -42
  69. package/dist/components-CidsRcc3.d.cts +0 -46
  70. package/dist/components-CidsRcc3.d.ts +0 -46
  71. package/dist/components.cjs +0 -2721
  72. package/dist/components.d.cts +0 -2944
  73. package/dist/default.cjs +0 -8931
  74. package/dist/default.d.cts +0 -1322
  75. package/dist/default.d.ts +0 -1322
  76. package/dist/default.js +0 -8931
  77. package/dist/hooks.cjs +0 -666
  78. package/dist/hooks.d.cts +0 -1172
  79. package/dist/index.cjs +0 -230
  80. package/dist/index.d.cts +0 -318
  81. package/dist/input-AwYIskrX.d.cts +0 -22
  82. package/dist/input-AwYIskrX.d.ts +0 -22
  83. package/dist/menu-GmSRfRGB.d.cts +0 -43
  84. package/dist/menu-GmSRfRGB.d.ts +0 -43
  85. package/dist/metafile-cjs.json +0 -1
  86. package/dist/metafile-esm.json +0 -1
  87. package/dist/re-export/cva.cjs +0 -6
  88. package/dist/re-export/cva.d.cts +0 -10
  89. package/dist/re-export/cva.d.ts +0 -10
  90. package/dist/re-export/cva.js +0 -6
  91. package/dist/re-export/motion.cjs +0 -2
  92. package/dist/re-export/motion.d.cts +0 -1
  93. package/dist/re-export/motion.d.ts +0 -1
  94. package/dist/re-export/motion.js +0 -2
  95. package/dist/re-export/next-themes.cjs +0 -2
  96. package/dist/re-export/next-themes.d.cts +0 -1
  97. package/dist/re-export/next-themes.d.ts +0 -1
  98. package/dist/re-export/next-themes.js +0 -2
  99. package/dist/re-export/react-day-picker.cjs +0 -2
  100. package/dist/re-export/react-day-picker.d.cts +0 -1
  101. package/dist/re-export/react-day-picker.d.ts +0 -1
  102. package/dist/re-export/react-day-picker.js +0 -2
  103. package/dist/re-export/react-hook-form.cjs +0 -2
  104. package/dist/re-export/react-hook-form.d.cts +0 -1
  105. package/dist/re-export/react-hook-form.d.ts +0 -1
  106. package/dist/re-export/react-hook-form.js +0 -2
  107. package/dist/re-export/resolver.cjs +0 -2
  108. package/dist/re-export/resolver.d.cts +0 -1
  109. package/dist/re-export/resolver.d.ts +0 -1
  110. package/dist/re-export/resolver.js +0 -2
  111. package/dist/re-export/sonner.cjs +0 -2
  112. package/dist/re-export/sonner.d.cts +0 -1
  113. package/dist/re-export/sonner.d.ts +0 -1
  114. package/dist/re-export/sonner.js +0 -2
  115. package/dist/re-export/tanstack-query.cjs +0 -2
  116. package/dist/re-export/tanstack-query.d.cts +0 -1
  117. package/dist/re-export/tanstack-query.d.ts +0 -1
  118. package/dist/re-export/tanstack-query.js +0 -2
  119. package/dist/re-export/tanstack-table.cjs +0 -2
  120. package/dist/re-export/tanstack-table.d.cts +0 -1
  121. package/dist/re-export/tanstack-table.d.ts +0 -1
  122. package/dist/re-export/tanstack-table.js +0 -2
  123. package/dist/re-export/zod.cjs +0 -2
  124. package/dist/re-export/zod.d.cts +0 -1
  125. package/dist/re-export/zod.d.ts +0 -1
  126. package/dist/re-export/zod.js +0 -2
@@ -1,180 +0,0 @@
1
- import {
2
- META_THEME_COLORS,
3
- THEME_MODES
4
- } from "./chunk-HW52LCWN.js";
5
-
6
- // src/hooks/use-meta-color.ts
7
- import * as React from "react";
8
- import { useTheme } from "next-themes";
9
- function useMetaColor(defaultColors) {
10
- const { resolvedTheme } = useTheme();
11
- const isSystemDarkMode = React.useCallback(() => {
12
- if (typeof window === "undefined") return false;
13
- return window.matchMedia("(prefers-color-scheme: dark)").matches;
14
- }, []);
15
- const getEffectiveTheme = React.useCallback(
16
- (theme) => {
17
- if (theme === THEME_MODES.SYSTEM) {
18
- return isSystemDarkMode() ? THEME_MODES.DARK : THEME_MODES.LIGHT;
19
- }
20
- return theme;
21
- },
22
- [isSystemDarkMode]
23
- );
24
- const metaColor = React.useMemo(() => {
25
- const colorsToUse = defaultColors ?? META_THEME_COLORS;
26
- const effectiveTheme = getEffectiveTheme(resolvedTheme);
27
- if (effectiveTheme === THEME_MODES.DARK) {
28
- return colorsToUse[THEME_MODES.DARK];
29
- } else if (effectiveTheme === THEME_MODES.LIGHT) {
30
- return colorsToUse[THEME_MODES.LIGHT];
31
- }
32
- return colorsToUse[THEME_MODES.LIGHT];
33
- }, [resolvedTheme, defaultColors, getEffectiveTheme]);
34
- const setMetaColor = React.useCallback((color) => {
35
- const metaTag = document.querySelector('meta[name="theme-color"]');
36
- if (metaTag) {
37
- metaTag.setAttribute("content", color);
38
- } else {
39
- const newMetaTag = document.createElement("meta");
40
- newMetaTag.name = "theme-color";
41
- newMetaTag.content = color;
42
- document.head.appendChild(newMetaTag);
43
- }
44
- }, []);
45
- return {
46
- /** Current meta theme color based on resolved theme */
47
- metaColor,
48
- /** Function to manually set meta theme color */
49
- setMetaColor
50
- };
51
- }
52
-
53
- // src/hooks/use-recaptcha-v2.ts
54
- import { useCallback as useCallback2, useEffect, useRef } from "react";
55
- var RECAPTCHA_SCRIPT_ID = "recaptcha-v2-script";
56
- var scriptLoadPromise = null;
57
- function loadRecaptchaScript() {
58
- if (scriptLoadPromise) return scriptLoadPromise;
59
- scriptLoadPromise = new Promise((resolve) => {
60
- if (document.getElementById(RECAPTCHA_SCRIPT_ID) && window.grecaptcha) {
61
- resolve();
62
- return;
63
- }
64
- window.onRecaptchaLoaded = () => {
65
- resolve();
66
- };
67
- const script = document.createElement("script");
68
- script.id = RECAPTCHA_SCRIPT_ID;
69
- script.src = `https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoaded&render=explicit`;
70
- script.async = true;
71
- script.defer = true;
72
- script.onerror = () => {
73
- console.error("Failed to load reCAPTCHA script");
74
- scriptLoadPromise = null;
75
- };
76
- document.head.appendChild(script);
77
- });
78
- return scriptLoadPromise;
79
- }
80
- function useRecaptchaV2(siteKey) {
81
- const widgetId = useRef(null);
82
- const containerRef = useRef(null);
83
- const isRendered = useRef(false);
84
- const isInitializing = useRef(false);
85
- const initializeRecaptcha = useCallback2(async () => {
86
- if (isInitializing.current) return;
87
- if (!containerRef.current || !siteKey) return;
88
- isInitializing.current = true;
89
- try {
90
- if (widgetId.current !== null) {
91
- const grecaptcha2 = window.grecaptcha;
92
- if (grecaptcha2) {
93
- try {
94
- grecaptcha2.reset(widgetId.current);
95
- } catch (error) {
96
- console.error("Error resetting reCAPTCHA:", error);
97
- }
98
- }
99
- widgetId.current = null;
100
- isRendered.current = false;
101
- }
102
- await loadRecaptchaScript();
103
- const grecaptcha = window.grecaptcha;
104
- if (!grecaptcha) {
105
- throw new Error("reCAPTCHA failed to load");
106
- }
107
- await new Promise((resolve) => {
108
- grecaptcha.ready(() => resolve());
109
- });
110
- if (containerRef.current && !isRendered.current) {
111
- widgetId.current = grecaptcha.render(containerRef.current, {
112
- sitekey: siteKey,
113
- size: "normal",
114
- // Can be 'normal', 'compact', or 'invisible'
115
- theme: "light"
116
- // Can be 'light' or 'dark'
117
- });
118
- isRendered.current = true;
119
- }
120
- } catch (error) {
121
- console.error("Error initializing reCAPTCHA:", error);
122
- } finally {
123
- isInitializing.current = false;
124
- }
125
- }, [siteKey]);
126
- useEffect(() => {
127
- if (containerRef.current) {
128
- initializeRecaptcha();
129
- }
130
- return () => {
131
- if (widgetId.current !== null) {
132
- const grecaptcha = window.grecaptcha;
133
- if (grecaptcha) {
134
- try {
135
- grecaptcha.reset(widgetId.current);
136
- } catch (error) {
137
- console.error("Error resetting reCAPTCHA on cleanup:", error);
138
- }
139
- }
140
- widgetId.current = null;
141
- isRendered.current = false;
142
- }
143
- };
144
- }, [initializeRecaptcha]);
145
- const getToken = () => {
146
- const grecaptcha = window.grecaptcha;
147
- if (!grecaptcha || widgetId.current === null) {
148
- throw new Error("reCAPTCHA not initialized");
149
- }
150
- const token = grecaptcha.getResponse(widgetId.current);
151
- if (!token) {
152
- throw new Error("reCAPTCHA not completed");
153
- }
154
- return token;
155
- };
156
- const resetCaptcha = () => {
157
- const grecaptcha = window.grecaptcha;
158
- if (!grecaptcha || widgetId.current === null) return;
159
- try {
160
- grecaptcha.reset(widgetId.current);
161
- } catch (error) {
162
- console.error("Error resetting reCAPTCHA:", error);
163
- }
164
- };
165
- return {
166
- /** Ref to attach to the container div where reCAPTCHA will be rendered */
167
- containerRef,
168
- /** Function to get the reCAPTCHA response token */
169
- getToken,
170
- /** Function to reset the reCAPTCHA widget */
171
- resetCaptcha,
172
- /** Function to manually initialize reCAPTCHA (usually not needed) */
173
- initializeRecaptcha
174
- };
175
- }
176
-
177
- export {
178
- useMetaColor,
179
- useRecaptchaV2
180
- };
@@ -1,10 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/lib/utils.ts
2
- var _clsx = require('clsx');
3
- var _tailwindmerge = require('tailwind-merge');
4
- function cn(...inputs) {
5
- return _tailwindmerge.twMerge.call(void 0, _clsx.clsx.call(void 0, inputs));
6
- }
7
-
8
-
9
-
10
- exports.cn = cn;