@vritti/quantum-ui 0.1.22 → 0.1.23

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 (65) hide show
  1. package/dist/Checkbox.js +2 -253
  2. package/dist/Checkbox.js.map +1 -1
  3. package/dist/Combination.js +3869 -0
  4. package/dist/Combination.js.map +1 -0
  5. package/dist/DataTable.d.ts +31 -0
  6. package/dist/DataTable.js +4989 -0
  7. package/dist/DataTable.js.map +1 -0
  8. package/dist/DatePicker.d.ts +68 -0
  9. package/dist/DatePicker.js +8229 -0
  10. package/dist/DatePicker.js.map +1 -0
  11. package/dist/Input.js +22 -0
  12. package/dist/Input.js.map +1 -0
  13. package/dist/Label.js +40 -0
  14. package/dist/Label.js.map +1 -0
  15. package/dist/Skeleton.d.ts +6 -0
  16. package/dist/Skeleton.js +18 -0
  17. package/dist/Skeleton.js.map +1 -0
  18. package/dist/TextField.js +2 -18
  19. package/dist/TextField.js.map +1 -1
  20. package/dist/assets/quantum-ui.css +22 -16
  21. package/dist/axios.d.ts +11 -6
  22. package/dist/axios.js +191 -147
  23. package/dist/axios.js.map +1 -1
  24. package/dist/check.js +15 -0
  25. package/dist/check.js.map +1 -0
  26. package/dist/components/Button.d.ts +7 -0
  27. package/dist/components/Card.d.ts +7 -0
  28. package/dist/components/Checkbox.d.ts +7 -0
  29. package/dist/components/DataTable.d.ts +9 -0
  30. package/dist/components/DataTable.js +2 -0
  31. package/dist/components/DataTable.js.map +1 -0
  32. package/dist/components/DatePicker.d.ts +9 -0
  33. package/dist/components/DatePicker.js +2 -0
  34. package/dist/components/DatePicker.js.map +1 -0
  35. package/dist/components/Form.d.ts +7 -0
  36. package/dist/components/OTPField.d.ts +7 -0
  37. package/dist/components/PasswordField.d.ts +7 -0
  38. package/dist/components/PhoneField.d.ts +7 -0
  39. package/dist/components/Progress.d.ts +7 -0
  40. package/dist/components/Skeleton.d.ts +9 -0
  41. package/dist/components/Skeleton.js +2 -0
  42. package/dist/components/Skeleton.js.map +1 -0
  43. package/dist/components/TextArea.d.ts +7 -0
  44. package/dist/components/TextField.d.ts +7 -0
  45. package/dist/components/ThemeToggle.d.ts +7 -0
  46. package/dist/components/Typography.d.ts +7 -0
  47. package/dist/field.js +1 -34
  48. package/dist/field.js.map +1 -1
  49. package/dist/index.d.ts +69 -38
  50. package/dist/index.js +8 -6
  51. package/dist/index.js.map +1 -1
  52. package/dist/index5.js +5 -2
  53. package/dist/index5.js.map +1 -1
  54. package/dist/index6.js +246 -0
  55. package/dist/index6.js.map +1 -0
  56. package/dist/shadcn/shadcnField.d.ts +7 -0
  57. package/dist/utils/axios.d.ts +21 -6
  58. package/dist/utils/axios.js +1 -1
  59. package/package.json +20 -6
  60. package/dist/AuthProvider.d.ts +0 -34
  61. package/dist/OnboardingProvider.js +0 -113
  62. package/dist/OnboardingProvider.js.map +0 -1
  63. package/dist/context/AuthProvider.d.ts +0 -2
  64. package/dist/context/AuthProvider.js +0 -2
  65. package/dist/context/AuthProvider.js.map +0 -1
package/dist/index6.js ADDED
@@ -0,0 +1,246 @@
1
+ import * as React from 'react';
2
+ import { u as useComposedRefs } from './index2.js';
3
+
4
+ // src/primitive.tsx
5
+ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
6
+ return function handleEvent(event) {
7
+ originalEventHandler?.(event);
8
+ if (checkForDefaultPrevented === false || !event.defaultPrevented) {
9
+ return ourEventHandler?.(event);
10
+ }
11
+ };
12
+ }
13
+
14
+ // packages/react/use-layout-effect/src/use-layout-effect.tsx
15
+ var useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {
16
+ };
17
+
18
+ // src/use-controllable-state.tsx
19
+ var useInsertionEffect = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
20
+ function useControllableState({
21
+ prop,
22
+ defaultProp,
23
+ onChange = () => {
24
+ },
25
+ caller
26
+ }) {
27
+ const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
28
+ defaultProp,
29
+ onChange
30
+ });
31
+ const isControlled = prop !== void 0;
32
+ const value = isControlled ? prop : uncontrolledProp;
33
+ {
34
+ const isControlledRef = React.useRef(prop !== void 0);
35
+ React.useEffect(() => {
36
+ const wasControlled = isControlledRef.current;
37
+ if (wasControlled !== isControlled) {
38
+ const from = wasControlled ? "controlled" : "uncontrolled";
39
+ const to = isControlled ? "controlled" : "uncontrolled";
40
+ console.warn(
41
+ `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
42
+ );
43
+ }
44
+ isControlledRef.current = isControlled;
45
+ }, [isControlled, caller]);
46
+ }
47
+ const setValue = React.useCallback(
48
+ (nextValue) => {
49
+ if (isControlled) {
50
+ const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
51
+ if (value2 !== prop) {
52
+ onChangeRef.current?.(value2);
53
+ }
54
+ } else {
55
+ setUncontrolledProp(nextValue);
56
+ }
57
+ },
58
+ [isControlled, prop, setUncontrolledProp, onChangeRef]
59
+ );
60
+ return [value, setValue];
61
+ }
62
+ function useUncontrolledState({
63
+ defaultProp,
64
+ onChange
65
+ }) {
66
+ const [value, setValue] = React.useState(defaultProp);
67
+ const prevValueRef = React.useRef(value);
68
+ const onChangeRef = React.useRef(onChange);
69
+ useInsertionEffect(() => {
70
+ onChangeRef.current = onChange;
71
+ }, [onChange]);
72
+ React.useEffect(() => {
73
+ if (prevValueRef.current !== value) {
74
+ onChangeRef.current?.(value);
75
+ prevValueRef.current = value;
76
+ }
77
+ }, [value, prevValueRef]);
78
+ return [value, setValue, onChangeRef];
79
+ }
80
+ function isFunction(value) {
81
+ return typeof value === "function";
82
+ }
83
+
84
+ // packages/react/use-size/src/use-size.tsx
85
+ function useSize(element) {
86
+ const [size, setSize] = React.useState(void 0);
87
+ useLayoutEffect2(() => {
88
+ if (element) {
89
+ setSize({ width: element.offsetWidth, height: element.offsetHeight });
90
+ const resizeObserver = new ResizeObserver((entries) => {
91
+ if (!Array.isArray(entries)) {
92
+ return;
93
+ }
94
+ if (!entries.length) {
95
+ return;
96
+ }
97
+ const entry = entries[0];
98
+ let width;
99
+ let height;
100
+ if ("borderBoxSize" in entry) {
101
+ const borderSizeEntry = entry["borderBoxSize"];
102
+ const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
103
+ width = borderSize["inlineSize"];
104
+ height = borderSize["blockSize"];
105
+ } else {
106
+ width = element.offsetWidth;
107
+ height = element.offsetHeight;
108
+ }
109
+ setSize({ width, height });
110
+ });
111
+ resizeObserver.observe(element, { box: "border-box" });
112
+ return () => resizeObserver.unobserve(element);
113
+ } else {
114
+ setSize(void 0);
115
+ }
116
+ }, [element]);
117
+ return size;
118
+ }
119
+
120
+ function useStateMachine(initialState, machine) {
121
+ return React.useReducer((state, event) => {
122
+ const nextState = machine[state][event];
123
+ return nextState ?? state;
124
+ }, initialState);
125
+ }
126
+
127
+ // src/presence.tsx
128
+ var Presence = (props) => {
129
+ const { present, children } = props;
130
+ const presence = usePresence(present);
131
+ const child = typeof children === "function" ? children({ present: presence.isPresent }) : React.Children.only(children);
132
+ const ref = useComposedRefs(presence.ref, getElementRef(child));
133
+ const forceMount = typeof children === "function";
134
+ return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;
135
+ };
136
+ Presence.displayName = "Presence";
137
+ function usePresence(present) {
138
+ const [node, setNode] = React.useState();
139
+ const stylesRef = React.useRef(null);
140
+ const prevPresentRef = React.useRef(present);
141
+ const prevAnimationNameRef = React.useRef("none");
142
+ const initialState = present ? "mounted" : "unmounted";
143
+ const [state, send] = useStateMachine(initialState, {
144
+ mounted: {
145
+ UNMOUNT: "unmounted",
146
+ ANIMATION_OUT: "unmountSuspended"
147
+ },
148
+ unmountSuspended: {
149
+ MOUNT: "mounted",
150
+ ANIMATION_END: "unmounted"
151
+ },
152
+ unmounted: {
153
+ MOUNT: "mounted"
154
+ }
155
+ });
156
+ React.useEffect(() => {
157
+ const currentAnimationName = getAnimationName(stylesRef.current);
158
+ prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
159
+ }, [state]);
160
+ useLayoutEffect2(() => {
161
+ const styles = stylesRef.current;
162
+ const wasPresent = prevPresentRef.current;
163
+ const hasPresentChanged = wasPresent !== present;
164
+ if (hasPresentChanged) {
165
+ const prevAnimationName = prevAnimationNameRef.current;
166
+ const currentAnimationName = getAnimationName(styles);
167
+ if (present) {
168
+ send("MOUNT");
169
+ } else if (currentAnimationName === "none" || styles?.display === "none") {
170
+ send("UNMOUNT");
171
+ } else {
172
+ const isAnimating = prevAnimationName !== currentAnimationName;
173
+ if (wasPresent && isAnimating) {
174
+ send("ANIMATION_OUT");
175
+ } else {
176
+ send("UNMOUNT");
177
+ }
178
+ }
179
+ prevPresentRef.current = present;
180
+ }
181
+ }, [present, send]);
182
+ useLayoutEffect2(() => {
183
+ if (node) {
184
+ let timeoutId;
185
+ const ownerWindow = node.ownerDocument.defaultView ?? window;
186
+ const handleAnimationEnd = (event) => {
187
+ const currentAnimationName = getAnimationName(stylesRef.current);
188
+ const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
189
+ if (event.target === node && isCurrentAnimation) {
190
+ send("ANIMATION_END");
191
+ if (!prevPresentRef.current) {
192
+ const currentFillMode = node.style.animationFillMode;
193
+ node.style.animationFillMode = "forwards";
194
+ timeoutId = ownerWindow.setTimeout(() => {
195
+ if (node.style.animationFillMode === "forwards") {
196
+ node.style.animationFillMode = currentFillMode;
197
+ }
198
+ });
199
+ }
200
+ }
201
+ };
202
+ const handleAnimationStart = (event) => {
203
+ if (event.target === node) {
204
+ prevAnimationNameRef.current = getAnimationName(stylesRef.current);
205
+ }
206
+ };
207
+ node.addEventListener("animationstart", handleAnimationStart);
208
+ node.addEventListener("animationcancel", handleAnimationEnd);
209
+ node.addEventListener("animationend", handleAnimationEnd);
210
+ return () => {
211
+ ownerWindow.clearTimeout(timeoutId);
212
+ node.removeEventListener("animationstart", handleAnimationStart);
213
+ node.removeEventListener("animationcancel", handleAnimationEnd);
214
+ node.removeEventListener("animationend", handleAnimationEnd);
215
+ };
216
+ } else {
217
+ send("ANIMATION_END");
218
+ }
219
+ }, [node, send]);
220
+ return {
221
+ isPresent: ["mounted", "unmountSuspended"].includes(state),
222
+ ref: React.useCallback((node2) => {
223
+ stylesRef.current = node2 ? getComputedStyle(node2) : null;
224
+ setNode(node2);
225
+ }, [])
226
+ };
227
+ }
228
+ function getAnimationName(styles) {
229
+ return styles?.animationName || "none";
230
+ }
231
+ function getElementRef(element) {
232
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
233
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
234
+ if (mayWarn) {
235
+ return element.ref;
236
+ }
237
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
238
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
239
+ if (mayWarn) {
240
+ return element.props.ref;
241
+ }
242
+ return element.props.ref || element.ref;
243
+ }
244
+
245
+ export { Presence as P, useSize as a, useLayoutEffect2 as b, composeEventHandlers as c, useControllableState as u };
246
+ //# sourceMappingURL=index6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index6.js","sources":["../node_modules/@radix-ui/primitive/dist/index.mjs","../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs","../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs","../node_modules/@radix-ui/react-use-size/dist/index.mjs","../node_modules/@radix-ui/react-presence/dist/index.mjs"],"sourcesContent":["// src/primitive.tsx\nvar canUseDOM = !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\nfunction composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {\n return function handleEvent(event) {\n originalEventHandler?.(event);\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\nfunction getOwnerWindow(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access window outside of the DOM\");\n }\n return element?.ownerDocument?.defaultView ?? window;\n}\nfunction getOwnerDocument(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access document outside of the DOM\");\n }\n return element?.ownerDocument ?? document;\n}\nfunction getActiveElement(node, activeDescendant = false) {\n const { activeElement } = getOwnerDocument(node);\n if (!activeElement?.nodeName) {\n return null;\n }\n if (isFrame(activeElement) && activeElement.contentDocument) {\n return getActiveElement(activeElement.contentDocument.body, activeDescendant);\n }\n if (activeDescendant) {\n const id = activeElement.getAttribute(\"aria-activedescendant\");\n if (id) {\n const element = getOwnerDocument(activeElement).getElementById(id);\n if (element) {\n return element;\n }\n }\n }\n return activeElement;\n}\nfunction isFrame(element) {\n return element.tagName === \"IFRAME\";\n}\nexport {\n canUseDOM,\n composeEventHandlers,\n getActiveElement,\n getOwnerDocument,\n getOwnerWindow,\n isFrame\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/use-layout-effect/src/use-layout-effect.tsx\nimport * as React from \"react\";\nvar useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {\n};\nexport {\n useLayoutEffect2 as useLayoutEffect\n};\n//# sourceMappingURL=index.mjs.map\n","// src/use-controllable-state.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nvar useInsertionEffect = React[\" useInsertionEffect \".trim().toString()] || useLayoutEffect;\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = () => {\n },\n caller\n}) {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange\n });\n const isControlled = prop !== void 0;\n const value = isControlled ? prop : uncontrolledProp;\n if (true) {\n const isControlledRef = React.useRef(prop !== void 0);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const setValue = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value2 !== prop) {\n onChangeRef.current?.(value2);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n return [value, setValue];\n}\nfunction useUncontrolledState({\n defaultProp,\n onChange\n}) {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n return [value, setValue, onChangeRef];\n}\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n\n// src/use-controllable-state-reducer.tsx\nimport * as React2 from \"react\";\nimport { useEffectEvent } from \"@radix-ui/react-use-effect-event\";\nvar SYNC_STATE = Symbol(\"RADIX:SYNC_STATE\");\nfunction useControllableStateReducer(reducer, userArgs, initialArg, init) {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== void 0;\n const onChange = useEffectEvent(onChangeProp);\n if (true) {\n const isControlledRef = React2.useRef(controlledState !== void 0);\n React2.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const args = [{ ...initialArg, state: defaultProp }];\n if (init) {\n args.push(init);\n }\n const [internalState, dispatch] = React2.useReducer(\n (state2, action) => {\n if (action.type === SYNC_STATE) {\n return { ...state2, state: action.state };\n }\n const next = reducer(state2, action);\n if (isControlled && !Object.is(next.state, state2.state)) {\n onChange(next.state);\n }\n return next;\n },\n ...args\n );\n const uncontrolledState = internalState.state;\n const prevValueRef = React2.useRef(uncontrolledState);\n React2.useEffect(() => {\n if (prevValueRef.current !== uncontrolledState) {\n prevValueRef.current = uncontrolledState;\n if (!isControlled) {\n onChange(uncontrolledState);\n }\n }\n }, [onChange, uncontrolledState, prevValueRef, isControlled]);\n const state = React2.useMemo(() => {\n const isControlled2 = controlledState !== void 0;\n if (isControlled2) {\n return { ...internalState, state: controlledState };\n }\n return internalState;\n }, [internalState, controlledState]);\n React2.useEffect(() => {\n if (isControlled && !Object.is(controlledState, internalState.state)) {\n dispatch({ type: SYNC_STATE, state: controlledState });\n }\n }, [controlledState, internalState.state, isControlled]);\n return [state, dispatch];\n}\nexport {\n useControllableState,\n useControllableStateReducer\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/use-size/src/use-size.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nfunction useSize(element) {\n const [size, setSize] = React.useState(void 0);\n useLayoutEffect(() => {\n if (element) {\n setSize({ width: element.offsetWidth, height: element.offsetHeight });\n const resizeObserver = new ResizeObserver((entries) => {\n if (!Array.isArray(entries)) {\n return;\n }\n if (!entries.length) {\n return;\n }\n const entry = entries[0];\n let width;\n let height;\n if (\"borderBoxSize\" in entry) {\n const borderSizeEntry = entry[\"borderBoxSize\"];\n const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;\n width = borderSize[\"inlineSize\"];\n height = borderSize[\"blockSize\"];\n } else {\n width = element.offsetWidth;\n height = element.offsetHeight;\n }\n setSize({ width, height });\n });\n resizeObserver.observe(element, { box: \"border-box\" });\n return () => resizeObserver.unobserve(element);\n } else {\n setSize(void 0);\n }\n }, [element]);\n return size;\n}\nexport {\n useSize\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// src/presence.tsx\nimport * as React2 from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\n\n// src/use-state-machine.tsx\nimport * as React from \"react\";\nfunction useStateMachine(initialState, machine) {\n return React.useReducer((state, event) => {\n const nextState = machine[state][event];\n return nextState ?? state;\n }, initialState);\n}\n\n// src/presence.tsx\nvar Presence = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n const child = typeof children === \"function\" ? children({ present: presence.isPresent }) : React2.Children.only(children);\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === \"function\";\n return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;\n};\nPresence.displayName = \"Presence\";\nfunction usePresence(present) {\n const [node, setNode] = React2.useState();\n const stylesRef = React2.useRef(null);\n const prevPresentRef = React2.useRef(present);\n const prevAnimationNameRef = React2.useRef(\"none\");\n const initialState = present ? \"mounted\" : \"unmounted\";\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: \"unmounted\",\n ANIMATION_OUT: \"unmountSuspended\"\n },\n unmountSuspended: {\n MOUNT: \"mounted\",\n ANIMATION_END: \"unmounted\"\n },\n unmounted: {\n MOUNT: \"mounted\"\n }\n });\n React2.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === \"mounted\" ? currentAnimationName : \"none\";\n }, [state]);\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n if (present) {\n send(\"MOUNT\");\n } else if (currentAnimationName === \"none\" || styles?.display === \"none\") {\n send(\"UNMOUNT\");\n } else {\n const isAnimating = prevAnimationName !== currentAnimationName;\n if (wasPresent && isAnimating) {\n send(\"ANIMATION_OUT\");\n } else {\n send(\"UNMOUNT\");\n }\n }\n prevPresentRef.current = present;\n }\n }, [present, send]);\n useLayoutEffect(() => {\n if (node) {\n let timeoutId;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n const handleAnimationEnd = (event) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));\n if (event.target === node && isCurrentAnimation) {\n send(\"ANIMATION_END\");\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = \"forwards\";\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === \"forwards\") {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event) => {\n if (event.target === node) {\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener(\"animationstart\", handleAnimationStart);\n node.addEventListener(\"animationcancel\", handleAnimationEnd);\n node.addEventListener(\"animationend\", handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener(\"animationstart\", handleAnimationStart);\n node.removeEventListener(\"animationcancel\", handleAnimationEnd);\n node.removeEventListener(\"animationend\", handleAnimationEnd);\n };\n } else {\n send(\"ANIMATION_END\");\n }\n }, [node, send]);\n return {\n isPresent: [\"mounted\", \"unmountSuspended\"].includes(state),\n ref: React2.useCallback((node2) => {\n stylesRef.current = node2 ? getComputedStyle(node2) : null;\n setNode(node2);\n }, [])\n };\n}\nfunction getAnimationName(styles) {\n return styles?.animationName || \"none\";\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nvar Root = Presence;\nexport {\n Presence,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useLayoutEffect","React2"],"mappings":";;;AAAA;AAEA,SAAS,oBAAoB,CAAC,oBAAoB,EAAE,eAAe,EAAE,EAAE,wBAAwB,GAAG,IAAI,EAAE,GAAG,EAAE,EAAE;AAC/G,EAAE,OAAO,SAAS,WAAW,CAAC,KAAK,EAAE;AACrC,IAAI,oBAAoB,GAAG,KAAK,CAAC;AACjC,IAAI,IAAI,wBAAwB,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE;AACvE,MAAM,OAAO,eAAe,GAAG,KAAK,CAAC;AACrC,IAAI;AACJ,EAAE,CAAC;AACH;;ACTA;AAEG,IAAC,gBAAgB,GAAG,UAAU,EAAE,QAAQ,GAAG,KAAK,CAAC,eAAe,GAAG,MAAM;AAC5E;;ACHA;AAGA,IAAI,kBAAkB,GAAG,KAAK,CAAC,sBAAsB,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAIA,gBAAe;AAC3F,SAAS,oBAAoB,CAAC;AAC9B,EAAE,IAAI;AACN,EAAE,WAAW;AACb,EAAE,QAAQ,GAAG,MAAM;AACnB,EAAE,CAAC;AACH,EAAE;AACF,CAAC,EAAE;AACH,EAAE,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,EAAE,WAAW,CAAC,GAAG,oBAAoB,CAAC;AACpF,IAAI,WAAW;AACf,IAAI;AACJ,GAAG,CAAC;AACJ,EAAE,MAAM,YAAY,GAAG,IAAI,KAAK,MAAM;AACtC,EAAE,MAAM,KAAK,GAAG,YAAY,GAAG,IAAI,GAAG,gBAAgB;AACtD,EAAY;AACZ,IAAI,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC;AACzD,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM;AAC1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AAwB,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,GAAG;AAC/D,EAAE,OAAO,GAAG,MAAM,IAAI,gBAAgB,IAAI,MAAM,IAAI,MAAM,CAAC,cAAc;AACzE,EAAE,IAAI,OAAO,EAAE;AACf,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG;AAC5B,EAAE;AACF,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG;AACzC;;;;","x_google_ignoreList":[0,1,2,3,4]}
@@ -1 +1,8 @@
1
1
  export {}
2
+
3
+
4
+ declare module 'axios' {
5
+ interface AxiosRequestConfig {
6
+ public?: boolean;
7
+ }
8
+ }
@@ -1,12 +1,27 @@
1
1
  import { AxiosInstance } from 'axios';
2
- export type TokenType = 'onboarding' | 'access' | 'refresh';
2
+ declare module 'axios' {
3
+ interface AxiosRequestConfig {
4
+ public?: boolean;
5
+ }
6
+ }
7
+ export declare const setToken: (token: string) => void;
8
+ export declare const getToken: () => string | null;
9
+ export declare const clearToken: () => void;
3
10
  export declare const setCsrfToken: (token: string) => void;
4
11
  export declare const getCsrfToken: () => string | null;
5
12
  export declare const clearCsrfToken: () => void;
6
- export declare const setToken: (type: TokenType, token: string) => void;
7
- export declare const getToken: (type: TokenType) => string | null;
8
- export declare const clearToken: (type: TokenType) => void;
9
- export declare const clearAllTokens: () => void;
13
+ export declare function recoverSession(): Promise<{
14
+ success: boolean;
15
+ expiresIn: number;
16
+ }>;
17
+ export declare function scheduleTokenRefresh(expiresIn: number): void;
18
+ export declare function cancelTokenRefresh(): void;
10
19
  export declare const axios: AxiosInstance;
11
20
  export default axios;
12
- //# sourceMappingURL=axios.d.ts.map
21
+ //# sourceMappingURL=axios.d.ts.map
22
+
23
+ declare module 'axios' {
24
+ interface AxiosRequestConfig {
25
+ public?: boolean;
26
+ }
27
+ }
@@ -1,2 +1,2 @@
1
- export { a as axios, f as clearAllTokens, j as clearCsrfToken, e as clearToken, a as default, i as getCsrfToken, b as getToken, h as setCsrfToken, s as setToken } from '../axios.js';
1
+ export { a as axios, i as cancelTokenRefresh, l as clearCsrfToken, e as clearToken, a as default, k as getCsrfToken, b as getToken, f as recoverSession, h as scheduleTokenRefresh, j as setCsrfToken, s as setToken } from '../axios.js';
2
2
  //# sourceMappingURL=axios.js.map
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
- "version": "0.1.22",
8
+ "version": "0.1.23",
9
9
  "type": "module",
10
10
  "sideEffects": false,
11
11
  "repository": {
@@ -84,6 +84,18 @@
84
84
  "types": "./dist/Form.d.ts",
85
85
  "import": "./dist/components/Form.js"
86
86
  },
87
+ "./DatePicker": {
88
+ "types": "./dist/DatePicker.d.ts",
89
+ "import": "./dist/components/DatePicker.js"
90
+ },
91
+ "./DataTable": {
92
+ "types": "./dist/DataTable.d.ts",
93
+ "import": "./dist/components/DataTable.js"
94
+ },
95
+ "./Skeleton": {
96
+ "types": "./dist/Skeleton.d.ts",
97
+ "import": "./dist/components/Skeleton.js"
98
+ },
87
99
  "./Field": {
88
100
  "types": "./dist/Field.d.ts",
89
101
  "import": "./dist/shadcn/shadcnField.js"
@@ -92,10 +104,6 @@
92
104
  "types": "./dist/axios.d.ts",
93
105
  "import": "./dist/utils/axios.js"
94
106
  },
95
- "./AuthProvider": {
96
- "types": "./dist/AuthProvider.d.ts",
97
- "import": "./dist/context/AuthProvider.js"
98
- },
99
107
  "./index.css": "./dist/assets/quantum-ui.css"
100
108
  },
101
109
  "files": [
@@ -149,20 +157,26 @@
149
157
  "dependencies": {
150
158
  "@hookform/resolvers": "^5.2.2",
151
159
  "@radix-ui/react-checkbox": "^1.3.3",
160
+ "@radix-ui/react-dialog": "^1.1.15",
161
+ "@radix-ui/react-dropdown-menu": "^2.1.15",
152
162
  "@radix-ui/react-label": "^2.1.7",
163
+ "@radix-ui/react-popover": "^1.1.15",
153
164
  "@radix-ui/react-progress": "^1.1.7",
154
165
  "@radix-ui/react-select": "^2.2.6",
155
166
  "@radix-ui/react-separator": "^1.1.8",
156
167
  "@radix-ui/react-slot": "^1.2.3",
168
+ "@radix-ui/react-tooltip": "^1.1.15",
157
169
  "@tailwindcss/vite": "^4.1.17",
158
170
  "axios": "^1.12.2",
159
171
  "class-variance-authority": "^0.7.1",
160
172
  "clsx": "^2.1.1",
161
173
  "input-otp": "^1.4.2",
162
174
  "lucide-react": "^0.544.0",
175
+ "react-day-picker": "^9.11.3",
163
176
  "react-hook-form": "^7.66.0",
164
177
  "react-phone-number-input": "^3.4.12",
165
178
  "tailwind-merge": "^3.3.1",
166
- "zod": "^4.1.12"
179
+ "zod": "^4.1.12",
180
+ "@tanstack/react-table": "^8.20.5"
167
181
  }
168
182
  }
@@ -1,34 +0,0 @@
1
- import { Context } from 'react';
2
- import { default as default_2 } from 'react';
3
-
4
- export declare const OnboardingContext: Context<OnboardingContextType | undefined>;
5
-
6
- export declare interface OnboardingContextType extends OnboardingData {
7
- onboardingToken: string | null;
8
- isLoading: boolean;
9
- error: string | null;
10
- }
11
-
12
- export declare interface OnboardingData {
13
- userId: string;
14
- email: string;
15
- firstName: string;
16
- lastName: string;
17
- currentStep: string;
18
- onboardingComplete: boolean;
19
- accountStatus: string;
20
- emailVerified: boolean;
21
- phoneVerified: boolean;
22
- }
23
-
24
- export declare const OnboardingProvider: default_2.FC<OnboardingProviderProps>;
25
-
26
- declare interface OnboardingProviderProps {
27
- children: default_2.ReactNode;
28
- onboardingToken?: string;
29
- onUnauthorized?: () => void;
30
- }
31
-
32
- export declare const useOnboarding: () => OnboardingContextType;
33
-
34
- export { }
@@ -1,113 +0,0 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { createContext, useContext, useState, useRef, useCallback, useEffect } from 'react';
3
- import { useNavigate } from 'react-router-dom';
4
- import { e as clearToken, a as axios, s as setToken } from './axios.js';
5
-
6
- const OnboardingContext = createContext(void 0);
7
- const useOnboarding = () => {
8
- const context = useContext(OnboardingContext);
9
- if (!context) {
10
- throw new Error("useOnboarding must be used within an OnboardingProvider");
11
- }
12
- return context;
13
- };
14
-
15
- const OnboardingProvider = ({
16
- children,
17
- onboardingToken: initialToken,
18
- onUnauthorized
19
- }) => {
20
- const [data, setData] = useState(null);
21
- const [isLoading, setIsLoading] = useState(true);
22
- const navigate = useNavigate();
23
- const isFetchingRef = useRef(false);
24
- const hasSetInitialTokenRef = useRef(false);
25
- const handleUnauthorized = useCallback(() => {
26
- clearToken("onboarding");
27
- if (onUnauthorized) {
28
- onUnauthorized();
29
- } else {
30
- navigate("/login", { replace: true });
31
- }
32
- }, [navigate, onUnauthorized]);
33
- const fetchOnboardingStatus = useCallback(async () => {
34
- if (isFetchingRef.current) return;
35
- isFetchingRef.current = true;
36
- try {
37
- const response = await axios.get("/onboarding/status");
38
- if (response.data.onboardingToken) {
39
- setToken("onboarding", response.data.onboardingToken);
40
- }
41
- setData({
42
- ...response.data,
43
- isLoading: false,
44
- error: null
45
- });
46
- } catch (err) {
47
- const axiosError = err;
48
- if (axiosError.response?.status === 401) {
49
- handleUnauthorized();
50
- } else {
51
- setData({
52
- onboardingToken: null,
53
- userId: "",
54
- email: "",
55
- firstName: "",
56
- lastName: "",
57
- currentStep: "",
58
- onboardingComplete: false,
59
- accountStatus: "",
60
- emailVerified: false,
61
- phoneVerified: false,
62
- isLoading: false,
63
- error: axiosError?.message || "Failed to fetch onboarding status"
64
- });
65
- }
66
- } finally {
67
- isFetchingRef.current = false;
68
- setIsLoading(false);
69
- }
70
- }, [handleUnauthorized]);
71
- useEffect(() => {
72
- if (initialToken && !hasSetInitialTokenRef.current) {
73
- hasSetInitialTokenRef.current = true;
74
- setToken("onboarding", initialToken);
75
- }
76
- }, [initialToken]);
77
- useEffect(() => {
78
- fetchOnboardingStatus();
79
- }, [fetchOnboardingStatus]);
80
- useEffect(() => {
81
- if (data?.onboardingToken) {
82
- setToken("onboarding", data.onboardingToken);
83
- }
84
- }, [data?.onboardingToken]);
85
- useEffect(() => {
86
- return () => {
87
- clearToken("onboarding");
88
- };
89
- }, []);
90
- if (isLoading) {
91
- return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs("div", { className: "text-center space-y-4", children: [
92
- /* @__PURE__ */ jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto" }),
93
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "Loading..." })
94
- ] }) });
95
- }
96
- return /* @__PURE__ */ jsx(OnboardingContext.Provider, { value: data || {
97
- onboardingToken: null,
98
- userId: "",
99
- email: "",
100
- firstName: "",
101
- lastName: "",
102
- currentStep: "",
103
- onboardingComplete: false,
104
- accountStatus: "",
105
- emailVerified: false,
106
- phoneVerified: false,
107
- isLoading: false,
108
- error: null
109
- }, children });
110
- };
111
-
112
- export { OnboardingContext as O, OnboardingProvider as a, useOnboarding as u };
113
- //# sourceMappingURL=OnboardingProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OnboardingProvider.js","sources":["../lib/context/OnboardingContext.tsx","../lib/context/OnboardingProvider.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nexport interface OnboardingData {\n userId: string;\n email: string;\n firstName: string;\n lastName: string;\n currentStep: string;\n onboardingComplete: boolean;\n accountStatus: string;\n emailVerified: boolean;\n phoneVerified: boolean;\n}\n\nexport interface OnboardingContextType extends OnboardingData {\n onboardingToken: string | null;\n isLoading: boolean;\n error: string | null;\n}\n\nexport const OnboardingContext = createContext<OnboardingContextType | undefined>(undefined);\n\nexport const useOnboarding = (): OnboardingContextType => {\n const context = useContext(OnboardingContext);\n if (!context) {\n throw new Error('useOnboarding must be used within an OnboardingProvider');\n }\n return context;\n};\n","import React, { useEffect, useState, useRef, useCallback } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { OnboardingContext, type OnboardingContextType, type OnboardingData } from './OnboardingContext';\nimport { axios, setToken, clearToken } from '../utils/axios';\nimport type { AxiosError } from 'axios';\n\n/**\n * Props for the OnboardingProvider component\n */\ninterface OnboardingProviderProps {\n /** React children to render within the provider */\n children: React.ReactNode;\n /** Optional initial onboarding token to set before fetching status */\n onboardingToken?: string;\n /** Optional callback to handle unauthorized (401) responses */\n onUnauthorized?: () => void;\n}\n\n/**\n * API response structure for onboarding status endpoint\n */\ninterface OnboardingStatusResponse extends OnboardingData {\n onboardingToken: string;\n}\n\n/**\n * OnboardingProvider manages the onboarding state and token lifecycle.\n *\n * This provider integrates with the centralized axios token management system:\n * - Sets onboarding tokens automatically when available\n * - Clears tokens on 401 errors or unmount\n * - All axios requests automatically include the Authorization header\n *\n * @example\n * ```tsx\n * // Basic usage (fetches onboarding status on mount)\n * <OnboardingProvider>\n * <App />\n * </OnboardingProvider>\n *\n * // With initial token\n * <OnboardingProvider onboardingToken={token}>\n * <App />\n * </OnboardingProvider>\n *\n * // With custom unauthorized handler\n * <OnboardingProvider onUnauthorized={() => router.push('/custom-login')}>\n * <App />\n * </OnboardingProvider>\n * ```\n */\nexport const OnboardingProvider: React.FC<OnboardingProviderProps> = ({\n children,\n onboardingToken: initialToken,\n onUnauthorized\n}) => {\n const [data, setData] = useState<OnboardingContextType | null>(null);\n const [isLoading, setIsLoading] = useState(true);\n const navigate = useNavigate();\n const isFetchingRef = useRef(false);\n const hasSetInitialTokenRef = useRef(false);\n\n /**\n * Handle unauthorized (401) responses\n */\n const handleUnauthorized = useCallback(() => {\n // Clear the onboarding token\n clearToken('onboarding');\n\n // Call custom handler if provided, otherwise navigate to login\n if (onUnauthorized) {\n onUnauthorized();\n } else {\n navigate('/login', { replace: true });\n }\n }, [navigate, onUnauthorized]);\n\n /**\n * Fetch onboarding status from the API\n */\n const fetchOnboardingStatus = useCallback(async () => {\n // Prevent multiple simultaneous calls\n if (isFetchingRef.current) return;\n\n isFetchingRef.current = true;\n try {\n const response = await axios.get<OnboardingStatusResponse>('/onboarding/status');\n\n // Set the new token if provided by the API\n if (response.data.onboardingToken) {\n setToken('onboarding', response.data.onboardingToken);\n }\n\n setData({\n ...response.data,\n isLoading: false,\n error: null,\n });\n } catch (err) {\n const axiosError = err as AxiosError;\n if (axiosError.response?.status === 401) {\n handleUnauthorized();\n } else {\n // Set error state for other failures (connection errors, etc)\n setData({\n onboardingToken: null,\n userId: '',\n email: '',\n firstName: '',\n lastName: '',\n currentStep: '',\n onboardingComplete: false,\n accountStatus: '',\n emailVerified: false,\n phoneVerified: false,\n isLoading: false,\n error: axiosError?.message || 'Failed to fetch onboarding status',\n });\n }\n } finally {\n isFetchingRef.current = false;\n setIsLoading(false);\n }\n }, [handleUnauthorized]);\n\n /**\n * Set initial token if provided via props\n * This runs before fetching status to ensure the token is available for the API call\n */\n useEffect(() => {\n if (initialToken && !hasSetInitialTokenRef.current) {\n hasSetInitialTokenRef.current = true;\n setToken('onboarding', initialToken);\n }\n }, [initialToken]);\n\n /**\n * Fetch onboarding status on mount\n */\n useEffect(() => {\n fetchOnboardingStatus();\n }, [fetchOnboardingStatus]);\n\n /**\n * Update token when data changes\n * This handles tokens returned from the API that might differ from the initial token\n */\n useEffect(() => {\n if (data?.onboardingToken) {\n setToken('onboarding', data.onboardingToken);\n }\n }, [data?.onboardingToken]);\n\n /**\n * Clean up token on unmount\n */\n useEffect(() => {\n return () => {\n // Clear onboarding token when provider unmounts\n clearToken('onboarding');\n };\n }, []);\n\n if (isLoading) {\n return (\n <div className='flex items-center justify-center min-h-screen'>\n <div className='text-center space-y-4'>\n <div className='animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto'></div>\n <p className='text-muted-foreground'>Loading...</p>\n </div>\n </div>\n );\n }\n\n return (\n <OnboardingContext.Provider value={data || {\n onboardingToken: null,\n userId: '',\n email: '',\n firstName: '',\n lastName: '',\n currentStep: '',\n onboardingComplete: false,\n accountStatus: '',\n emailVerified: false,\n phoneVerified: false,\n isLoading: false,\n error: null,\n }}>\n {children}\n </OnboardingContext.Provider>\n );\n};\n"],"names":[],"mappings":";;;;;AAoBO,MAAM,iBAAA,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 -1,2 +0,0 @@
1
- export * from './index'
2
- export {}
@@ -1,2 +0,0 @@
1
- export { O as OnboardingContext, a as OnboardingProvider, u as useOnboarding } from '../OnboardingProvider.js';
2
- //# sourceMappingURL=AuthProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuthProvider.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}