@classytic/fluid 0.4.1 → 0.5.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 (51) hide show
  1. package/README.md +21 -1
  2. package/dist/client/calendar.d.mts +1 -2
  3. package/dist/client/calendar.mjs +4 -4
  4. package/dist/client/color-picker.d.mts +94 -0
  5. package/dist/client/color-picker.mjs +392 -0
  6. package/dist/client/core.d.mts +243 -557
  7. package/dist/client/core.mjs +351 -1462
  8. package/dist/client/error.d.mts +41 -41
  9. package/dist/client/error.mjs +35 -35
  10. package/dist/client/gallery.d.mts +175 -0
  11. package/dist/client/gallery.mjs +546 -0
  12. package/dist/client/hooks.d.mts +57 -39
  13. package/dist/client/hooks.mjs +29 -7
  14. package/dist/client/spreadsheet.d.mts +30 -27
  15. package/dist/client/spreadsheet.mjs +80 -80
  16. package/dist/client/table.d.mts +66 -33
  17. package/dist/client/table.mjs +87 -54
  18. package/dist/client/theme.mjs +1 -1
  19. package/dist/command.d.mts +6 -4
  20. package/dist/command.mjs +3 -3
  21. package/dist/compact.d.mts +97 -95
  22. package/dist/compact.mjs +336 -322
  23. package/dist/dashboard.d.mts +614 -422
  24. package/dist/dashboard.mjs +1051 -762
  25. package/dist/{dropdown-wrapper-B86u9Fri.mjs → dropdown-wrapper-B9nRDUlz.mjs} +25 -35
  26. package/dist/forms.d.mts +1037 -972
  27. package/dist/forms.mjs +2849 -2721
  28. package/dist/index.d.mts +218 -152
  29. package/dist/index.mjs +357 -264
  30. package/dist/layouts.d.mts +94 -94
  31. package/dist/layouts.mjs +115 -110
  32. package/dist/phone-input-B9_XPNvv.mjs +429 -0
  33. package/dist/phone-input-CLH_UjQZ.d.mts +31 -0
  34. package/dist/{search-context-DR7DBs7S.mjs → search-context-1g3ZmOvx.mjs} +1 -1
  35. package/dist/search.d.mts +168 -164
  36. package/dist/search.mjs +305 -301
  37. package/dist/{sheet-wrapper-C13Y-Q6w.mjs → sheet-wrapper-B2uxookb.mjs} +1 -1
  38. package/dist/timeline-Bgu1mIe9.d.mts +373 -0
  39. package/dist/timeline-HJtWf4Op.mjs +804 -0
  40. package/dist/{use-base-search-BGgWnWaF.d.mts → use-base-search-DFC4QKYU.d.mts} +1 -1
  41. package/dist/{use-media-query-BnVNIKT4.mjs → use-media-query-ChLfFChU.mjs} +6 -7
  42. package/package.json +10 -2
  43. /package/dist/{api-pagination-CJ0vR_w6.d.mts → api-pagination-C30ser2L.d.mts} +0 -0
  44. /package/dist/{filter-utils-DqMmy_v-.mjs → filter-utils-BGIvtq1R.mjs} +0 -0
  45. /package/dist/{filter-utils-IZ0GtuPo.d.mts → filter-utils-DOFTBWm1.d.mts} +0 -0
  46. /package/dist/{use-debounce-xmZucz5e.mjs → use-debounce-BNoNiEon.mjs} +0 -0
  47. /package/dist/{use-keyboard-shortcut-Bl6YM5Q7.mjs → use-keyboard-shortcut-C_Vk-36P.mjs} +0 -0
  48. /package/dist/{use-keyboard-shortcut-_mRCh3QO.d.mts → use-keyboard-shortcut-Q4CSPzSI.d.mts} +0 -0
  49. /package/dist/{use-mobile-BX3SQVo2.mjs → use-mobile-CnEmFiQx.mjs} +0 -0
  50. /package/dist/{use-scroll-detection-CsgsQYvy.mjs → use-scroll-detection-BKfqkmEC.mjs} +0 -0
  51. /package/dist/{utils-CDue7cEt.d.mts → utils-rqvYP1by.d.mts} +0 -0
@@ -1,7 +1,47 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
1
  import { ComponentType, ReactNode } from "react";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
  import { FallbackProps } from "react-error-boundary";
4
4
 
5
+ //#region src/components/async-boundary.d.ts
6
+ interface AsyncBoundaryProps {
7
+ /** Suspense fallback (shown while loading) */
8
+ fallback?: ReactNode;
9
+ /** Error fallback component (shown on error) */
10
+ errorFallback?: ComponentType<FallbackProps>;
11
+ /** Called when an error is caught */
12
+ onError?: (error: unknown, info: {
13
+ componentStack?: string | null;
14
+ }) => void;
15
+ /** Called when the error boundary resets */
16
+ onReset?: () => void;
17
+ children: ReactNode;
18
+ }
19
+ /**
20
+ * AsyncBoundary — Suspense + ErrorBoundary combined.
21
+ *
22
+ * If `errorFallback` is provided, wraps in ErrorBoundary from react-error-boundary.
23
+ * Otherwise, renders Suspense only.
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * import { AsyncBoundary, InlineErrorFallback } from "@classytic/fluid/client";
28
+ *
29
+ * <AsyncBoundary
30
+ * fallback={<SkeletonTable rows={5} />}
31
+ * errorFallback={InlineErrorFallback}
32
+ * >
33
+ * <DataFetchingComponent />
34
+ * </AsyncBoundary>
35
+ * ```
36
+ */
37
+ declare function AsyncBoundary({
38
+ fallback,
39
+ errorFallback: ErrorFallback,
40
+ onError,
41
+ onReset,
42
+ children
43
+ }: AsyncBoundaryProps): react_jsx_runtime0.JSX.Element;
44
+ //#endregion
5
45
  //#region src/components/error-boundary.d.ts
6
46
  interface ErrorBoundaryFallbackProps extends FallbackProps {}
7
47
  interface ErrorBoundaryProps {
@@ -82,44 +122,4 @@ declare function FeatureErrorBoundary({
82
122
  className
83
123
  }: FeatureErrorBoundaryProps): react_jsx_runtime0.JSX.Element;
84
124
  //#endregion
85
- //#region src/components/async-boundary.d.ts
86
- interface AsyncBoundaryProps {
87
- /** Suspense fallback (shown while loading) */
88
- fallback?: ReactNode;
89
- /** Error fallback component (shown on error) */
90
- errorFallback?: ComponentType<FallbackProps>;
91
- /** Called when an error is caught */
92
- onError?: (error: unknown, info: {
93
- componentStack?: string | null;
94
- }) => void;
95
- /** Called when the error boundary resets */
96
- onReset?: () => void;
97
- children: ReactNode;
98
- }
99
- /**
100
- * AsyncBoundary — Suspense + ErrorBoundary combined.
101
- *
102
- * If `errorFallback` is provided, wraps in ErrorBoundary from react-error-boundary.
103
- * Otherwise, renders Suspense only.
104
- *
105
- * @example
106
- * ```tsx
107
- * import { AsyncBoundary, InlineErrorFallback } from "@classytic/fluid/client";
108
- *
109
- * <AsyncBoundary
110
- * fallback={<SkeletonTable rows={5} />}
111
- * errorFallback={InlineErrorFallback}
112
- * >
113
- * <DataFetchingComponent />
114
- * </AsyncBoundary>
115
- * ```
116
- */
117
- declare function AsyncBoundary({
118
- fallback,
119
- errorFallback: ErrorFallback,
120
- onError,
121
- onReset,
122
- children
123
- }: AsyncBoundaryProps): react_jsx_runtime0.JSX.Element;
124
- //#endregion
125
125
  export { AsyncBoundary, type AsyncBoundaryProps, ErrorBoundary, type ErrorBoundaryFallbackProps, type ErrorBoundaryProps, FeatureErrorBoundary, type FeatureErrorBoundaryProps, FullPageErrorFallback, InlineErrorFallback };
@@ -1,12 +1,46 @@
1
1
  "use client";
2
2
 
3
3
  import { t as cn } from "../utils-DQ5SCVoW.mjs";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
4
  import { Suspense } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { AlertCircle, Home, RefreshCw } from "lucide-react";
7
7
  import { Button } from "@/components/ui/button";
8
8
  import { ErrorBoundary as ErrorBoundary$1 } from "react-error-boundary";
9
9
 
10
+ //#region src/components/async-boundary.tsx
11
+ /**
12
+ * AsyncBoundary — Suspense + ErrorBoundary combined.
13
+ *
14
+ * If `errorFallback` is provided, wraps in ErrorBoundary from react-error-boundary.
15
+ * Otherwise, renders Suspense only.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * import { AsyncBoundary, InlineErrorFallback } from "@classytic/fluid/client";
20
+ *
21
+ * <AsyncBoundary
22
+ * fallback={<SkeletonTable rows={5} />}
23
+ * errorFallback={InlineErrorFallback}
24
+ * >
25
+ * <DataFetchingComponent />
26
+ * </AsyncBoundary>
27
+ * ```
28
+ */
29
+ function AsyncBoundary({ fallback, errorFallback: ErrorFallback, onError, onReset, children }) {
30
+ const suspenseWrapped = /* @__PURE__ */ jsx(Suspense, {
31
+ fallback: fallback ?? null,
32
+ children
33
+ });
34
+ if (!ErrorFallback) return suspenseWrapped;
35
+ return /* @__PURE__ */ jsx(ErrorBoundary$1, {
36
+ FallbackComponent: ErrorFallback,
37
+ onError,
38
+ onReset,
39
+ children: suspenseWrapped
40
+ });
41
+ }
42
+
43
+ //#endregion
10
44
  //#region src/components/error-boundary.tsx
11
45
  /**
12
46
  * Full-page error fallback with retry and go-home buttons.
@@ -128,39 +162,5 @@ function FeatureErrorBoundary({ featureName = "Feature", onError, onReset, child
128
162
  });
129
163
  }
130
164
 
131
- //#endregion
132
- //#region src/components/async-boundary.tsx
133
- /**
134
- * AsyncBoundary — Suspense + ErrorBoundary combined.
135
- *
136
- * If `errorFallback` is provided, wraps in ErrorBoundary from react-error-boundary.
137
- * Otherwise, renders Suspense only.
138
- *
139
- * @example
140
- * ```tsx
141
- * import { AsyncBoundary, InlineErrorFallback } from "@classytic/fluid/client";
142
- *
143
- * <AsyncBoundary
144
- * fallback={<SkeletonTable rows={5} />}
145
- * errorFallback={InlineErrorFallback}
146
- * >
147
- * <DataFetchingComponent />
148
- * </AsyncBoundary>
149
- * ```
150
- */
151
- function AsyncBoundary({ fallback, errorFallback: ErrorFallback, onError, onReset, children }) {
152
- const suspenseWrapped = /* @__PURE__ */ jsx(Suspense, {
153
- fallback: fallback ?? null,
154
- children
155
- });
156
- if (!ErrorFallback) return suspenseWrapped;
157
- return /* @__PURE__ */ jsx(ErrorBoundary$1, {
158
- FallbackComponent: ErrorFallback,
159
- onError,
160
- onReset,
161
- children: suspenseWrapped
162
- });
163
- }
164
-
165
165
  //#endregion
166
166
  export { AsyncBoundary, ErrorBoundary, FeatureErrorBoundary, FullPageErrorFallback, InlineErrorFallback };
@@ -0,0 +1,175 @@
1
+ import { ReactNode } from "react";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#region src/components/gallery/gallery-dots.d.ts
5
+ interface GalleryDotsProps {
6
+ /** Show on desktop (default: false — dots are usually mobile-only) */
7
+ showOnDesktop?: boolean;
8
+ className?: string;
9
+ }
10
+ declare function GalleryDots({
11
+ showOnDesktop,
12
+ className
13
+ }: GalleryDotsProps): react_jsx_runtime0.JSX.Element | null;
14
+ //#endregion
15
+ //#region src/components/gallery/gallery-lightbox.d.ts
16
+ interface GalleryLightboxProps {
17
+ className?: string;
18
+ }
19
+ declare function GalleryLightbox({
20
+ className
21
+ }: GalleryLightboxProps): react_jsx_runtime0.JSX.Element | null;
22
+ //#endregion
23
+ //#region src/components/gallery/types.d.ts
24
+ interface GalleryImage {
25
+ src: string;
26
+ thumbnail?: string;
27
+ alt?: string;
28
+ }
29
+ interface GalleryBadge {
30
+ label: string;
31
+ className?: string;
32
+ }
33
+ interface GalleryClassNames {
34
+ root?: string;
35
+ main?: string;
36
+ mainImage?: string;
37
+ slider?: string;
38
+ thumbnails?: string;
39
+ thumbnail?: string;
40
+ thumbnailActive?: string;
41
+ dots?: string;
42
+ dot?: string;
43
+ dotActive?: string;
44
+ nav?: string;
45
+ navPrev?: string;
46
+ navNext?: string;
47
+ badges?: string;
48
+ badge?: string;
49
+ lightbox?: string;
50
+ lightboxImage?: string;
51
+ lightboxHeader?: string;
52
+ lightboxFooter?: string;
53
+ }
54
+ interface GalleryContextValue {
55
+ images: GalleryImage[];
56
+ selectedIndex: number;
57
+ setSelectedIndex: (index: number) => void;
58
+ lightboxOpen: boolean;
59
+ setLightboxOpen: (open: boolean) => void;
60
+ goToNext: () => void;
61
+ goToPrevious: () => void;
62
+ classNames?: GalleryClassNames;
63
+ title?: string;
64
+ }
65
+ //#endregion
66
+ //#region src/components/gallery/gallery-main.d.ts
67
+ interface GalleryMainProps {
68
+ children?: ReactNode;
69
+ badges?: GalleryBadge[];
70
+ showNav?: boolean;
71
+ aspectRatio?: string;
72
+ className?: string;
73
+ }
74
+ declare function GalleryMain({
75
+ children,
76
+ badges,
77
+ showNav,
78
+ aspectRatio,
79
+ className
80
+ }: GalleryMainProps): react_jsx_runtime0.JSX.Element;
81
+ //#endregion
82
+ //#region src/components/gallery/gallery-nav.d.ts
83
+ interface GalleryNavProps {
84
+ /** Which direction this button navigates */
85
+ direction: "prev" | "next";
86
+ className?: string;
87
+ children?: React.ReactNode;
88
+ }
89
+ declare function GalleryNav({
90
+ direction,
91
+ className,
92
+ children
93
+ }: GalleryNavProps): react_jsx_runtime0.JSX.Element | null;
94
+ //#endregion
95
+ //#region src/components/gallery/gallery-thumbnails.d.ts
96
+ interface GalleryThumbnailsProps {
97
+ /** Show on mobile (default: true) */
98
+ showOnMobile?: boolean;
99
+ /** Layout orientation (default: "horizontal") */
100
+ orientation?: "horizontal" | "vertical";
101
+ /** Thumbnail size class (default: "w-16 h-20 sm:w-20 sm:h-24") */
102
+ sizeClassName?: string;
103
+ className?: string;
104
+ }
105
+ declare function GalleryThumbnails({
106
+ showOnMobile,
107
+ orientation,
108
+ sizeClassName,
109
+ className
110
+ }: GalleryThumbnailsProps): react_jsx_runtime0.JSX.Element | null;
111
+ //#endregion
112
+ //#region src/components/gallery/index.d.ts
113
+ interface ImageGalleryRootProps {
114
+ children: ReactNode;
115
+ images: GalleryImage[];
116
+ defaultIndex?: number;
117
+ classNames?: GalleryClassNames;
118
+ title?: string;
119
+ onIndexChange?: (index: number) => void;
120
+ className?: string;
121
+ }
122
+ declare function ImageGalleryRoot({
123
+ children,
124
+ images,
125
+ defaultIndex,
126
+ classNames,
127
+ title,
128
+ onIndexChange,
129
+ className
130
+ }: ImageGalleryRootProps): react_jsx_runtime0.JSX.Element;
131
+ interface ImageGalleryProps {
132
+ images: GalleryImage[];
133
+ title?: string;
134
+ badges?: GalleryBadge[];
135
+ /** Default selected index */
136
+ defaultIndex?: number;
137
+ /** Show thumbnails on mobile (default: true). If false, shows dots */
138
+ showMobileThumbnails?: boolean;
139
+ /** Main image aspect ratio */
140
+ aspectRatio?: string;
141
+ /** Show navigation arrows */
142
+ showNav?: boolean;
143
+ /** Custom class names for styling */
144
+ classNames?: GalleryClassNames;
145
+ /** Callback when index changes */
146
+ onIndexChange?: (index: number) => void;
147
+ /** Root className */
148
+ className?: string;
149
+ }
150
+ declare function ImageGallerySimple({
151
+ images,
152
+ title,
153
+ badges,
154
+ defaultIndex,
155
+ showMobileThumbnails,
156
+ aspectRatio,
157
+ showNav,
158
+ classNames,
159
+ onIndexChange,
160
+ className
161
+ }: ImageGalleryProps): react_jsx_runtime0.JSX.Element;
162
+ declare const ImageGallery: typeof ImageGallerySimple & {
163
+ Root: typeof ImageGalleryRoot;
164
+ Main: typeof GalleryMain;
165
+ Thumbnails: typeof GalleryThumbnails;
166
+ Dots: typeof GalleryDots;
167
+ Nav: typeof GalleryNav;
168
+ Lightbox: typeof GalleryLightbox;
169
+ };
170
+ //#endregion
171
+ //#region src/components/gallery/gallery-context.d.ts
172
+ declare function useGallery(): GalleryContextValue;
173
+ declare function useGalleryOptional(): GalleryContextValue | null;
174
+ //#endregion
175
+ export { type GalleryBadge, type GalleryClassNames, type GalleryImage, ImageGallery, type ImageGalleryProps, useGallery, useGalleryOptional };