asterui 0.12.65 → 0.12.67

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.
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ export interface AspectRatioProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** Aspect ratio as width / height */
4
+ ratio?: number;
5
+ children?: React.ReactNode;
6
+ /** Test ID for testing */
7
+ 'data-testid'?: string;
8
+ }
9
+ export declare const AspectRatio: React.ForwardRefExoticComponent<AspectRatioProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,14 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { forwardRef as n } from "react";
3
+ const p = n(function({ ratio: t = 1, children: e, className: o = "", style: s, ...a }, i) {
4
+ const r = ["relative w-full", o].filter(Boolean).join(" "), c = {
5
+ ...s,
6
+ aspectRatio: t
7
+ };
8
+ return /* @__PURE__ */ l("div", { ref: i, className: r, style: c, ...a, children: e });
9
+ });
10
+ p.displayName = "AspectRatio";
11
+ export {
12
+ p as AspectRatio
13
+ };
14
+ //# sourceMappingURL=AspectRatio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AspectRatio.js","sources":["../../src/components/AspectRatio.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\n\nexport interface AspectRatioProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Aspect ratio as width / height */\n ratio?: number\n children?: React.ReactNode\n /** Test ID for testing */\n 'data-testid'?: string\n}\n\nexport const AspectRatio = forwardRef<HTMLDivElement, AspectRatioProps>(function AspectRatio(\n { ratio = 1, children, className = '', style, ...rest },\n ref\n) {\n const classes = ['relative w-full', className]\n .filter(Boolean)\n .join(' ')\n const mergedStyle: React.CSSProperties = {\n ...style,\n aspectRatio: ratio,\n }\n\n return (\n <div ref={ref} className={classes} style={mergedStyle} {...rest}>\n {children}\n </div>\n )\n})\n\nAspectRatio.displayName = 'AspectRatio'\n"],"names":["AspectRatio","forwardRef","ratio","children","className","style","rest","ref","classes","mergedStyle","jsx"],"mappings":";;AAUO,MAAMA,IAAcC,EAA6C,SACtE,EAAE,OAAAC,IAAQ,GAAG,UAAAC,GAAU,WAAAC,IAAY,IAAI,OAAAC,GAAO,GAAGC,EAAA,GACjDC,GACA;AACA,QAAMC,IAAU,CAAC,mBAAmBJ,CAAS,EAC1C,OAAO,OAAO,EACd,KAAK,GAAG,GACLK,IAAmC;AAAA,IACvC,GAAGJ;AAAA,IACH,aAAaH;AAAA,EAAA;AAGf,SACE,gBAAAQ,EAAC,SAAI,KAAAH,GAAU,WAAWC,GAAS,OAAOC,GAAc,GAAGH,GACxD,UAAAH,EAAA,CACH;AAEJ,CAAC;AAEDH,EAAY,cAAc;"}
@@ -1,90 +1,113 @@
1
- import { jsxs as p, Fragment as F, jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as z, useState as h, useEffect as W, useCallback as i } from "react";
3
- const H = "btn", R = "btn-circle", V = "btn-sm", q = z(
1
+ import { jsxs as x, Fragment as H, jsx as t } from "react/jsx-runtime";
2
+ import { forwardRef as T, useState as u, useRef as V, useEffect as B, useCallback as l } from "react";
3
+ const q = "btn", A = "btn-circle", G = "btn-sm", I = T(
4
4
  ({
5
- src: l,
6
- alt: n = "",
7
- fallback: c,
8
- placeholder: y,
9
- preview: s = !0,
10
- width: d,
11
- height: m,
12
- className: C = "",
13
- onLoad: k,
14
- onError: w,
15
- "data-testid": o = "image",
16
- ...N
17
- }, j) => {
18
- const [a, g] = h(!0), [r, v] = h(!1), [L, u] = h(!1), [P, x] = h(l);
19
- W(() => {
20
- g(!0), v(!1), x(l);
21
- }, [l]);
22
- const B = i(() => {
23
- g(!1), v(!1), k?.();
24
- }, [k]), S = i(() => {
25
- g(!1), v(!0), c && x(c), w?.();
26
- }, [c, w]), D = i(() => {
27
- s && !r && !a && u(!0);
28
- }, [s, r, a]), $ = i(() => {
29
- u(!1);
30
- }, []), E = i(
5
+ src: m,
6
+ alt: c = "",
7
+ fallback: o,
8
+ placeholder: $,
9
+ preview: d = !0,
10
+ width: f,
11
+ height: h,
12
+ className: S = "",
13
+ onLoad: C,
14
+ onError: N,
15
+ "data-testid": r = "image",
16
+ ...D
17
+ }, g) => {
18
+ const [a, i] = u(!0), [s, n] = u(!1), [E, p] = u(!1), [j, b] = u(m), [v, w] = u(!1), L = V(null);
19
+ B(() => {
20
+ i(!0), n(!1), w(!1), b(m);
21
+ }, [m]), B(() => {
22
+ const e = L.current;
23
+ if (!(!e || !e.complete)) {
24
+ if (e.naturalWidth > 0) {
25
+ i(!1), n(!1);
26
+ return;
27
+ }
28
+ if (o && !v) {
29
+ w(!0), b(o), i(!0), n(!1);
30
+ return;
31
+ }
32
+ i(!1), n(!0);
33
+ }
34
+ }, [j, o, v]);
35
+ const F = l(() => {
36
+ i(!1), n(!1), C?.();
37
+ }, [C]), K = l(() => {
38
+ if (N?.(), o && !v) {
39
+ w(!0), b(o), i(!0), n(!1);
40
+ return;
41
+ }
42
+ i(!1), n(!0);
43
+ }, [o, v, N]), M = l(() => {
44
+ d && !s && !a && p(!0);
45
+ }, [d, s, a]), P = l(() => {
46
+ p(!1);
47
+ }, []), R = l(
31
48
  (e) => {
32
- s && !r && !a && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), u(!0));
49
+ d && !s && !a && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), p(!0));
33
50
  },
34
- [s, r, a]
35
- ), K = i((e) => {
36
- e.key === "Escape" && u(!1);
37
- }, []), b = () => {
51
+ [d, s, a]
52
+ ), W = l((e) => {
53
+ e.key === "Escape" && p(!1);
54
+ }, []), k = () => {
38
55
  const e = {};
39
- return d && (e.width = typeof d == "number" ? `${d}px` : d), m && (e.height = typeof m == "number" ? `${m}px` : m), e;
40
- }, f = s && !r && !a, M = [
41
- C,
42
- f ? "cursor-pointer hover:opacity-80 transition-opacity" : ""
56
+ return f && (e.width = typeof f == "number" ? `${f}px` : f), h && (e.height = typeof h == "number" ? `${h}px` : h), e;
57
+ }, y = d && !s && !a, z = [
58
+ S,
59
+ y ? "cursor-pointer hover:opacity-80 transition-opacity" : ""
43
60
  ].filter(Boolean).join(" ");
44
- return /* @__PURE__ */ p(F, { children: [
45
- /* @__PURE__ */ p(
61
+ return /* @__PURE__ */ x(H, { children: [
62
+ /* @__PURE__ */ x(
46
63
  "div",
47
64
  {
48
65
  className: "relative inline-block",
49
- style: b(),
50
- "data-testid": o,
51
- "data-state": a ? "loading" : r ? "error" : "loaded",
66
+ style: k(),
67
+ "data-testid": r,
68
+ "data-state": a ? "loading" : s ? "error" : "loaded",
52
69
  children: [
53
- a && y && /* @__PURE__ */ t(
70
+ a && $ && /* @__PURE__ */ t(
54
71
  "div",
55
72
  {
56
73
  className: "absolute inset-0 flex items-center justify-center bg-base-200",
57
- "data-testid": `${o}-placeholder`,
58
- children: y
74
+ "data-testid": `${r}-placeholder`,
75
+ children: $
59
76
  }
60
77
  ),
61
78
  /* @__PURE__ */ t(
62
79
  "img",
63
80
  {
64
- ref: j,
65
- ...N,
66
- src: P,
67
- alt: n,
68
- className: M,
69
- style: { ...b(), display: a ? "none" : "block" },
70
- onLoad: B,
71
- onError: S,
72
- onClick: D,
73
- onKeyDown: E,
74
- tabIndex: f ? 0 : void 0,
75
- role: f ? "button" : void 0,
76
- "aria-label": f ? `${n || "Image"} (click to preview)` : void 0,
77
- "data-testid": `${o}-img`
81
+ ref: (e) => {
82
+ L.current = e, typeof g == "function" ? g(e) : g && (g.current = e);
83
+ },
84
+ ...D,
85
+ src: j,
86
+ alt: c,
87
+ className: z,
88
+ style: {
89
+ ...k(),
90
+ opacity: a ? 0 : 1,
91
+ transition: "opacity 150ms ease"
92
+ },
93
+ onLoad: F,
94
+ onError: K,
95
+ onClick: M,
96
+ onKeyDown: R,
97
+ tabIndex: y ? 0 : void 0,
98
+ role: y ? "button" : void 0,
99
+ "aria-label": y ? `${c || "Image"} (click to preview)` : void 0,
100
+ "data-testid": `${r}-img`
78
101
  }
79
102
  ),
80
- r && !c && /* @__PURE__ */ t(
103
+ s && /* @__PURE__ */ t(
81
104
  "div",
82
105
  {
83
106
  className: "flex items-center justify-center bg-base-200 text-base-content/50",
84
- style: b(),
85
- "data-testid": `${o}-error`,
107
+ style: k(),
108
+ "data-testid": `${r}-error`,
86
109
  role: "img",
87
- "aria-label": `Failed to load: ${n || "image"}`,
110
+ "aria-label": `Failed to load: ${c || "image"}`,
88
111
  children: /* @__PURE__ */ t(
89
112
  "svg",
90
113
  {
@@ -109,25 +132,25 @@ const H = "btn", R = "btn-circle", V = "btn-sm", q = z(
109
132
  ]
110
133
  }
111
134
  ),
112
- L && /* @__PURE__ */ t(
135
+ E && /* @__PURE__ */ t(
113
136
  "div",
114
137
  {
115
138
  className: "fixed inset-0 z-50 bg-black bg-opacity-80 flex items-center justify-center p-4",
116
- onClick: $,
117
- onKeyDown: K,
139
+ onClick: P,
140
+ onKeyDown: W,
118
141
  role: "dialog",
119
142
  "aria-modal": "true",
120
- "aria-label": `Preview: ${n || "Image"}`,
121
- "data-testid": `${o}-preview`,
122
- children: /* @__PURE__ */ p("div", { className: "relative max-w-full max-h-full", children: [
143
+ "aria-label": `Preview: ${c || "Image"}`,
144
+ "data-testid": `${r}-preview`,
145
+ children: /* @__PURE__ */ x("div", { className: "relative max-w-full max-h-full", children: [
123
146
  /* @__PURE__ */ t(
124
147
  "button",
125
148
  {
126
- className: `absolute top-4 right-4 ${H} ${R} ${V}`,
127
- onClick: $,
149
+ className: `absolute top-4 right-4 ${q} ${A} ${G}`,
150
+ onClick: P,
128
151
  "aria-label": "Close preview",
129
152
  autoFocus: !0,
130
- "data-testid": `${o}-preview-close`,
153
+ "data-testid": `${r}-preview-close`,
131
154
  children: /* @__PURE__ */ t(
132
155
  "svg",
133
156
  {
@@ -152,11 +175,11 @@ const H = "btn", R = "btn-circle", V = "btn-sm", q = z(
152
175
  /* @__PURE__ */ t(
153
176
  "img",
154
177
  {
155
- src: l,
156
- alt: n,
178
+ src: m,
179
+ alt: c,
157
180
  className: "max-w-full max-h-[90vh] object-contain",
158
181
  onClick: (e) => e.stopPropagation(),
159
- "data-testid": `${o}-preview-img`
182
+ "data-testid": `${r}-preview-img`
160
183
  }
161
184
  )
162
185
  ] })
@@ -165,8 +188,8 @@ const H = "btn", R = "btn-circle", V = "btn-sm", q = z(
165
188
  ] });
166
189
  }
167
190
  );
168
- q.displayName = "Image";
191
+ I.displayName = "Image";
169
192
  export {
170
- q as Image
193
+ I as Image
171
194
  };
172
195
  //# sourceMappingURL=Image.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Image.js","sources":["../../src/components/Image.tsx"],"sourcesContent":["import React, { useState, useEffect, forwardRef, useCallback } from 'react'\n\n// DaisyUI classes\nconst dBtn = 'btn'\nconst dBtnCircle = 'btn-circle'\nconst dBtnSm = 'btn-sm'\n\nexport interface ImageProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, 'placeholder'> {\n /** Image source URL */\n src: string\n /** Alternative text for the image */\n alt?: string\n /** Fallback image URL when source fails to load */\n fallback?: string\n /** Placeholder content shown while loading */\n placeholder?: React.ReactNode\n /** Enable click to preview image in lightbox */\n preview?: boolean\n /** Image width */\n width?: string | number\n /** Image height */\n height?: string | number\n /** Additional CSS classes */\n className?: string\n /** Callback when image loads successfully */\n onLoad?: () => void\n /** Callback when image fails to load */\n onError?: () => void\n /** Test ID for the component */\n 'data-testid'?: string\n}\n\nexport const Image = forwardRef<HTMLImageElement, ImageProps>(\n (\n {\n src,\n alt = '',\n fallback,\n placeholder,\n preview = true,\n width,\n height,\n className = '',\n onLoad,\n onError,\n 'data-testid': testId = 'image',\n ...props\n },\n ref\n ) => {\n const [loading, setLoading] = useState(true)\n const [error, setError] = useState(false)\n const [showPreview, setShowPreview] = useState(false)\n const [currentSrc, setCurrentSrc] = useState(src)\n\n useEffect(() => {\n setLoading(true)\n setError(false)\n setCurrentSrc(src)\n }, [src])\n\n const handleLoad = useCallback(() => {\n setLoading(false)\n setError(false)\n onLoad?.()\n }, [onLoad])\n\n const handleError = useCallback(() => {\n setLoading(false)\n setError(true)\n if (fallback) {\n setCurrentSrc(fallback)\n }\n onError?.()\n }, [fallback, onError])\n\n const handleImageClick = useCallback(() => {\n if (preview && !error && !loading) {\n setShowPreview(true)\n }\n }, [preview, error, loading])\n\n const handleClosePreview = useCallback(() => {\n setShowPreview(false)\n }, [])\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (preview && !error && !loading && (e.key === 'Enter' || e.key === ' ')) {\n e.preventDefault()\n setShowPreview(true)\n }\n },\n [preview, error, loading]\n )\n\n const handlePreviewKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n setShowPreview(false)\n }\n }, [])\n\n const getStyle = (): React.CSSProperties => {\n const style: React.CSSProperties = {}\n if (width) {\n style.width = typeof width === 'number' ? `${width}px` : width\n }\n if (height) {\n style.height = typeof height === 'number' ? `${height}px` : height\n }\n return style\n }\n\n const isPreviewable = preview && !error && !loading\n const imageClasses = [\n className,\n isPreviewable ? 'cursor-pointer hover:opacity-80 transition-opacity' : '',\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <>\n <div\n className=\"relative inline-block\"\n style={getStyle()}\n data-testid={testId}\n data-state={loading ? 'loading' : error ? 'error' : 'loaded'}\n >\n {loading && placeholder && (\n <div\n className=\"absolute inset-0 flex items-center justify-center bg-base-200\"\n data-testid={`${testId}-placeholder`}\n >\n {placeholder}\n </div>\n )}\n <img\n ref={ref}\n {...props}\n src={currentSrc}\n alt={alt}\n className={imageClasses}\n style={{ ...getStyle(), display: loading ? 'none' : 'block' }}\n onLoad={handleLoad}\n onError={handleError}\n onClick={handleImageClick}\n onKeyDown={handleKeyDown}\n tabIndex={isPreviewable ? 0 : undefined}\n role={isPreviewable ? 'button' : undefined}\n aria-label={isPreviewable ? `${alt || 'Image'} (click to preview)` : undefined}\n data-testid={`${testId}-img`}\n />\n {error && !fallback && (\n <div\n className=\"flex items-center justify-center bg-base-200 text-base-content/50\"\n style={getStyle()}\n data-testid={`${testId}-error`}\n role=\"img\"\n aria-label={`Failed to load: ${alt || 'image'}`}\n >\n <svg\n className=\"w-12 h-12\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z\"\n />\n </svg>\n </div>\n )}\n </div>\n\n {showPreview && (\n <div\n className=\"fixed inset-0 z-50 bg-black bg-opacity-80 flex items-center justify-center p-4\"\n onClick={handleClosePreview}\n onKeyDown={handlePreviewKeyDown}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={`Preview: ${alt || 'Image'}`}\n data-testid={`${testId}-preview`}\n >\n <div className=\"relative max-w-full max-h-full\">\n <button\n className={`absolute top-4 right-4 ${dBtn} ${dBtnCircle} ${dBtnSm}`}\n onClick={handleClosePreview}\n aria-label=\"Close preview\"\n autoFocus\n data-testid={`${testId}-preview-close`}\n >\n <svg\n className=\"w-6 h-6\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n </button>\n <img\n src={src}\n alt={alt}\n className=\"max-w-full max-h-[90vh] object-contain\"\n onClick={(e) => e.stopPropagation()}\n data-testid={`${testId}-preview-img`}\n />\n </div>\n </div>\n )}\n </>\n )\n }\n)\n\nImage.displayName = 'Image'\n"],"names":["dBtn","dBtnCircle","dBtnSm","Image","forwardRef","src","alt","fallback","placeholder","preview","width","height","className","onLoad","onError","testId","props","ref","loading","setLoading","useState","error","setError","showPreview","setShowPreview","currentSrc","setCurrentSrc","useEffect","handleLoad","useCallback","handleError","handleImageClick","handleClosePreview","handleKeyDown","handlePreviewKeyDown","getStyle","style","isPreviewable","imageClasses","jsxs","Fragment","jsx"],"mappings":";;AAGA,MAAMA,IAAO,OACPC,IAAa,cACbC,IAAS,UA2BFC,IAAQC;AAAA,EACnB,CACE;AAAA,IACE,KAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,QAAAC;AAAA,IACA,SAAAC;AAAA,IACA,eAAeC,IAAS;AAAA,IACxB,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAM,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAI,GACrC,CAACC,GAAOC,CAAQ,IAAIF,EAAS,EAAK,GAClC,CAACG,GAAaC,CAAc,IAAIJ,EAAS,EAAK,GAC9C,CAACK,GAAYC,CAAa,IAAIN,EAASf,CAAG;AAEhD,IAAAsB,EAAU,MAAM;AACd,MAAAR,EAAW,EAAI,GACfG,EAAS,EAAK,GACdI,EAAcrB,CAAG;AAAA,IACnB,GAAG,CAACA,CAAG,CAAC;AAER,UAAMuB,IAAaC,EAAY,MAAM;AACnC,MAAAV,EAAW,EAAK,GAChBG,EAAS,EAAK,GACdT,IAAA;AAAA,IACF,GAAG,CAACA,CAAM,CAAC,GAELiB,IAAcD,EAAY,MAAM;AACpC,MAAAV,EAAW,EAAK,GAChBG,EAAS,EAAI,GACTf,KACFmB,EAAcnB,CAAQ,GAExBO,IAAA;AAAA,IACF,GAAG,CAACP,GAAUO,CAAO,CAAC,GAEhBiB,IAAmBF,EAAY,MAAM;AACzC,MAAIpB,KAAW,CAACY,KAAS,CAACH,KACxBM,EAAe,EAAI;AAAA,IAEvB,GAAG,CAACf,GAASY,GAAOH,CAAO,CAAC,GAEtBc,IAAqBH,EAAY,MAAM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,cAAC;AAAA,cAAA;AAAA,gBACC,WAAW,0BAA0BzC,CAAI,IAAIC,CAAU,IAAIC,CAAM;AAAA,gBACjE,SAAS8B;AAAA,gBACT,cAAW;AAAA,gBACX,WAAS;AAAA,gBACT,eAAa,GAAGjB,CAAM;AAAA,gBAEtB,UAAA,gBAAA0B;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,MAAK;AAAA,oBACL,QAAO;AAAA,oBACP,SAAQ;AAAA,oBACR,eAAY;AAAA,oBAEZ,UAAA,gBAAAA;AAAA,sBAAC;AAAA,sBAAA;AAAA,wBACC,eAAc;AAAA,wBACd,gBAAe;AAAA,wBACf,aAAa;AAAA,wBACb,GAAE;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACJ;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,YAEF,gBAAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,KAAApC;AAAA,gBACA,KAAAC;AAAA,gBACA,WAAU;AAAA,gBACV,SAAS,CAAC,MAAM,EAAE,gBAAA;AAAA,gBAClB,eAAa,GAAGS,CAAM;AAAA,cAAA;AAAA,YAAA;AAAA,UACxB,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,GAEJ;AAAA,EAEJ;AACF;AAEAZ,EAAM,cAAc;"}
1
+ {"version":3,"file":"Image.js","sources":["../../src/components/Image.tsx"],"sourcesContent":["import React, { useState, useEffect, forwardRef, useCallback, useRef } from 'react'\n\n// DaisyUI classes\nconst dBtn = 'btn'\nconst dBtnCircle = 'btn-circle'\nconst dBtnSm = 'btn-sm'\n\nexport interface ImageProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, 'placeholder'> {\n /** Image source URL */\n src: string\n /** Alternative text for the image */\n alt?: string\n /** Fallback image URL when source fails to load */\n fallback?: string\n /** Placeholder content shown while loading */\n placeholder?: React.ReactNode\n /** Enable click to preview image in lightbox */\n preview?: boolean\n /** Image width */\n width?: string | number\n /** Image height */\n height?: string | number\n /** Additional CSS classes */\n className?: string\n /** Callback when image loads successfully */\n onLoad?: () => void\n /** Callback when image fails to load */\n onError?: () => void\n /** Test ID for the component */\n 'data-testid'?: string\n}\n\nexport const Image = forwardRef<HTMLImageElement, ImageProps>(\n (\n {\n src,\n alt = '',\n fallback,\n placeholder,\n preview = true,\n width,\n height,\n className = '',\n onLoad,\n onError,\n 'data-testid': testId = 'image',\n ...props\n },\n ref\n ) => {\n const [loading, setLoading] = useState(true)\n const [error, setError] = useState(false)\n const [showPreview, setShowPreview] = useState(false)\n const [currentSrc, setCurrentSrc] = useState(src)\n const [hasTriedFallback, setHasTriedFallback] = useState(false)\n const imgRef = useRef<HTMLImageElement | null>(null)\n\n useEffect(() => {\n setLoading(true)\n setError(false)\n setHasTriedFallback(false)\n setCurrentSrc(src)\n }, [src])\n\n useEffect(() => {\n const img = imgRef.current\n if (!img || !img.complete) return\n\n if (img.naturalWidth > 0) {\n setLoading(false)\n setError(false)\n return\n }\n\n if (fallback && !hasTriedFallback) {\n setHasTriedFallback(true)\n setCurrentSrc(fallback)\n setLoading(true)\n setError(false)\n return\n }\n\n setLoading(false)\n setError(true)\n }, [currentSrc, fallback, hasTriedFallback])\n\n const handleLoad = useCallback(() => {\n setLoading(false)\n setError(false)\n onLoad?.()\n }, [onLoad])\n\n const handleError = useCallback(() => {\n onError?.()\n if (fallback && !hasTriedFallback) {\n setHasTriedFallback(true)\n setCurrentSrc(fallback)\n setLoading(true)\n setError(false)\n return\n }\n setLoading(false)\n setError(true)\n }, [fallback, hasTriedFallback, onError])\n\n const handleImageClick = useCallback(() => {\n if (preview && !error && !loading) {\n setShowPreview(true)\n }\n }, [preview, error, loading])\n\n const handleClosePreview = useCallback(() => {\n setShowPreview(false)\n }, [])\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (preview && !error && !loading && (e.key === 'Enter' || e.key === ' ')) {\n e.preventDefault()\n setShowPreview(true)\n }\n },\n [preview, error, loading]\n )\n\n const handlePreviewKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n setShowPreview(false)\n }\n }, [])\n\n const getStyle = (): React.CSSProperties => {\n const style: React.CSSProperties = {}\n if (width) {\n style.width = typeof width === 'number' ? `${width}px` : width\n }\n if (height) {\n style.height = typeof height === 'number' ? `${height}px` : height\n }\n return style\n }\n\n const isPreviewable = preview && !error && !loading\n const imageClasses = [\n className,\n isPreviewable ? 'cursor-pointer hover:opacity-80 transition-opacity' : '',\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <>\n <div\n className=\"relative inline-block\"\n style={getStyle()}\n data-testid={testId}\n data-state={loading ? 'loading' : error ? 'error' : 'loaded'}\n >\n {loading && placeholder && (\n <div\n className=\"absolute inset-0 flex items-center justify-center bg-base-200\"\n data-testid={`${testId}-placeholder`}\n >\n {placeholder}\n </div>\n )}\n <img\n ref={(node) => {\n imgRef.current = node\n if (typeof ref === 'function') {\n ref(node)\n } else if (ref) {\n ref.current = node\n }\n }}\n {...props}\n src={currentSrc}\n alt={alt}\n className={imageClasses}\n style={{\n ...getStyle(),\n opacity: loading ? 0 : 1,\n transition: 'opacity 150ms ease',\n }}\n onLoad={handleLoad}\n onError={handleError}\n onClick={handleImageClick}\n onKeyDown={handleKeyDown}\n tabIndex={isPreviewable ? 0 : undefined}\n role={isPreviewable ? 'button' : undefined}\n aria-label={isPreviewable ? `${alt || 'Image'} (click to preview)` : undefined}\n data-testid={`${testId}-img`}\n />\n {error && (\n <div\n className=\"flex items-center justify-center bg-base-200 text-base-content/50\"\n style={getStyle()}\n data-testid={`${testId}-error`}\n role=\"img\"\n aria-label={`Failed to load: ${alt || 'image'}`}\n >\n <svg\n className=\"w-12 h-12\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z\"\n />\n </svg>\n </div>\n )}\n </div>\n\n {showPreview && (\n <div\n className=\"fixed inset-0 z-50 bg-black bg-opacity-80 flex items-center justify-center p-4\"\n onClick={handleClosePreview}\n onKeyDown={handlePreviewKeyDown}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={`Preview: ${alt || 'Image'}`}\n data-testid={`${testId}-preview`}\n >\n <div className=\"relative max-w-full max-h-full\">\n <button\n className={`absolute top-4 right-4 ${dBtn} ${dBtnCircle} ${dBtnSm}`}\n onClick={handleClosePreview}\n aria-label=\"Close preview\"\n autoFocus\n data-testid={`${testId}-preview-close`}\n >\n <svg\n className=\"w-6 h-6\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n </button>\n <img\n src={src}\n alt={alt}\n className=\"max-w-full max-h-[90vh] object-contain\"\n onClick={(e) => e.stopPropagation()}\n data-testid={`${testId}-preview-img`}\n />\n </div>\n </div>\n )}\n </>\n )\n }\n)\n\nImage.displayName = 'Image'\n"],"names":["dBtn","dBtnCircle","dBtnSm","Image","forwardRef","src","alt","fallback","placeholder","preview","width","height","className","onLoad","onError","testId","props","ref","loading","setLoading","useState","error","setError","showPreview","setShowPreview","currentSrc","setCurrentSrc","hasTriedFallback","setHasTriedFallback","imgRef","useRef","useEffect","img","handleLoad","useCallback","handleError","handleImageClick","handleClosePreview","handleKeyDown","handlePreviewKeyDown","getStyle","style","isPreviewable","imageClasses","jsxs","Fragment","jsx","node"],"mappings":";;AAGA,MAAMA,IAAO,OACPC,IAAa,cACbC,IAAS,UA2BFC,IAAQC;AAAA,EACnB,CACE;AAAA,I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AAAA,gBAClB,eAAa,GAAGS,CAAM;AAAA,cAAA;AAAA,YAAA;AAAA,UACxB,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,GAEJ;AAAA,EAEJ;AACF;AAEAZ,EAAM,cAAc;"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export { Affix } from './components/Affix';
2
2
  export type { AffixProps } from './components/Affix';
3
+ export { AspectRatio } from './components/AspectRatio';
4
+ export type { AspectRatioProps } from './components/AspectRatio';
3
5
  export { Anchor } from './components/Anchor';
4
6
  export type { AnchorProps, AnchorLinkProps, AnchorLinkItem } from './components/Anchor';
5
7
  export { Alert } from './components/Alert';
package/dist/index.js CHANGED
@@ -1,264 +1,266 @@
1
1
  import { Affix as e } from "./components/Affix.js";
2
- import { Anchor as p } from "./components/Anchor.js";
3
- import { Alert as f } from "./components/Alert.js";
4
- import { Autocomplete as a } from "./components/Autocomplete.js";
5
- import { Avatar as n, AvatarGroup as i } from "./components/Avatar.js";
6
- import { Badge as l } from "./components/Badge.js";
7
- import { Breadcrumb as C } from "./components/Breadcrumb.js";
8
- import { Button as g } from "./components/Button.js";
9
- import { SizeContext as S, SizeProvider as P, useSize as h } from "./contexts/SizeContext.js";
10
- import { CopyButton as v } from "./components/CopyButton.js";
11
- import { Checkbox as b } from "./components/Checkbox.js";
12
- import { Chat as w } from "./components/Chat.js";
13
- import { ColorPicker as B } from "./components/ColorPicker.js";
14
- import { Card as M } from "./components/Card.js";
15
- import { Carousel as L } from "./components/Carousel.js";
16
- import { Cascader as z } from "./components/Cascader.js";
17
- import { ConfigContext as G, ConfigProvider as K, useComponentLocale as W, useConfig as E, useLocale as N } from "./providers/ConfigProvider.js";
18
- import { Collapse as O } from "./components/Collapse.js";
19
- import { Command as j } from "./components/Command.js";
20
- import { Container as Q } from "./components/Container.js";
21
- import { ContextMenu as X } from "./components/ContextMenu.js";
22
- import { Countdown as Z } from "./components/Countdown.js";
23
- import { DatePicker as $ } from "./components/DatePicker.js";
24
- import { MonthCalendar as ro } from "./components/MonthCalendar.js";
25
- import { WeekCalendar as to } from "./components/WeekCalendar.js";
26
- import { Descriptions as mo } from "./components/Descriptions.js";
27
- import { Diff as xo } from "./components/Diff.js";
28
- import { Dock as so } from "./components/Dock.js";
29
- import { Divider as io } from "./components/Divider.js";
30
- import { Drawer as lo } from "./components/Drawer.js";
31
- import { ResponsiveDrawer as co } from "./components/ResponsiveDrawer.js";
32
- import { Fieldset as To } from "./components/Fieldset.js";
33
- import { FileInput as Po } from "./components/FileInput.js";
34
- import { Filter as ko } from "./components/Filter.js";
35
- import { Flex as Ro } from "./components/Flex.js";
36
- import { FloatButton as Do } from "./components/FloatButton.js";
37
- import { Footer as yo } from "./components/Footer.js";
38
- import { Form as Fo, useFormInstance as Mo } from "./components/Form.js";
39
- import { Col as Lo, Grid as Io, Row as zo } from "./components/Grid.js";
40
- import { Hero as Go } from "./components/Hero.js";
41
- import { HoverGallery as Wo } from "./components/HoverGallery.js";
42
- import { Image as No } from "./components/Image.js";
43
- import { Dropdown as Oo } from "./components/Dropdown.js";
44
- import { Empty as jo } from "./components/Empty.js";
45
- import { Input as Qo } from "./components/Input.js";
46
- import { InputNumber as Xo } from "./components/InputNumber.js";
47
- import { Join as Zo } from "./components/Join.js";
48
- import { Kbd as $o } from "./components/Kbd.js";
49
- import { Layout as rr, useSiderContext as er } from "./components/Layout.js";
50
- import { List as pr } from "./components/List.js";
51
- import { Loading as fr } from "./components/Loading.js";
52
- import { Mask as ar } from "./components/Mask.js";
53
- import { Masonry as nr } from "./components/Masonry.js";
54
- import { Mention as ur } from "./components/Mention.js";
55
- import { Menu as dr } from "./components/Menu.js";
56
- import { Browser as cr } from "./components/Browser.js";
57
- import { Code as Tr } from "./components/Code.js";
58
- import { Phone as Pr } from "./components/Phone.js";
59
- import { Window as kr } from "./components/Window.js";
60
- import { Modal as Rr } from "./components/Modal.js";
61
- import { Navbar as Dr } from "./components/Navbar.js";
62
- import { notification as yr } from "./components/Notification.js";
63
- import { MessageManager as Fr, message as Mr } from "./components/Message.js";
64
- import { OTPInput as Lr } from "./components/OTPInput.js";
65
- import { Pagination as zr } from "./components/Pagination.js";
66
- import { Popconfirm as Gr } from "./components/Popconfirm.js";
67
- import { Popover as Wr } from "./components/Popover.js";
68
- import { Progress as Nr } from "./components/Progress.js";
69
- import { Radio as Or } from "./components/Radio.js";
70
- import { RadialProgress as jr } from "./components/RadialProgress.js";
71
- import { Range as Qr } from "./components/Range.js";
72
- import { Rating as Xr } from "./components/Rating.js";
73
- import { Result as Zr } from "./components/Result.js";
74
- import { Select as $r } from "./components/Select.js";
75
- import { Segmented as re } from "./components/Segmented.js";
76
- import { Skeleton as te } from "./components/Skeleton.js";
77
- import { Space as me } from "./components/Space.js";
78
- import { Splitter as xe } from "./components/Splitter.js";
79
- import { Stats as se } from "./components/Stat.js";
80
- import { Status as ie } from "./components/Status.js";
81
- import { Steps as le } from "./components/Steps.js";
82
- import { Table as Ce } from "./components/Table.js";
83
- import { Tabs as ge } from "./components/Tabs.js";
84
- import { Textarea as Se } from "./components/Textarea.js";
85
- import { TextRotate as he } from "./components/TextRotate.js";
86
- import { CheckableTag as ve, Tag as Re, TagLiveRegion as be } from "./components/Tag.js";
87
- import { ThemeController as we } from "./components/ThemeController.js";
88
- import { ThemeProvider as Be, useHasThemeProvider as Fe, useThemeContext as Me } from "./providers/ThemeProvider.js";
89
- import { TimePicker as Le } from "./components/TimePicker.js";
90
- import { Timeline as ze } from "./components/Timeline.js";
91
- import { Toggle as Ge } from "./components/Toggle.js";
92
- import { Tour as We } from "./components/Tour.js";
93
- import { Tooltip as Ne } from "./components/Tooltip.js";
94
- import { Transfer as Oe } from "./components/Transfer.js";
95
- import { Tree as je } from "./components/Tree.js";
96
- import { TreeSelect as Qe, TreeSelectComponent as Ve } from "./components/TreeSelect.js";
97
- import { Typography as Ye } from "./components/Typography.js";
98
- import { Upload as _e } from "./components/Upload.js";
99
- import { Watermark as ot } from "./components/Watermark.js";
100
- import { Hide as et, Show as tt } from "./components/Responsive.js";
101
- import { useBreakpoint as mt } from "./hooks/useBreakpoint.js";
102
- import { useDisclosure as xt } from "./hooks/useDisclosure.js";
103
- import { useClipboard as st } from "./hooks/useClipboard.js";
104
- import { useLocalStorage as it } from "./hooks/useLocalStorage.js";
105
- import { useDebounce as lt } from "./hooks/useDebounce.js";
106
- import { useClickOutside as Ct } from "./hooks/useClickOutside.js";
107
- import { usePrevious as gt } from "./hooks/usePrevious.js";
108
- import { useHover as St } from "./hooks/useHover.js";
109
- import { useKeyPress as ht, useKeyPressCallback as kt } from "./hooks/useKeyPress.js";
110
- import { useWindowSize as Rt } from "./hooks/useWindowSize.js";
111
- import { useTheme as Dt } from "./hooks/useTheme.js";
112
- import { default as yt } from "./locale/en-US.js";
113
- import { default as Ft } from "./locale/en-GB.js";
114
- import { default as At } from "./locale/en-CA.js";
115
- import { default as It } from "./locale/zh-CN.js";
116
- import { default as Ht } from "./locale/es-ES.js";
117
- import { default as Kt } from "./locale/ja-JP.js";
118
- import { default as Et } from "./locale/pt-BR.js";
119
- import { default as Jt } from "./locale/de-DE.js";
120
- import { default as Ut } from "./locale/fr-FR.js";
121
- import { default as qt } from "./locale/ko-KR.js";
2
+ import { AspectRatio as p } from "./components/AspectRatio.js";
3
+ import { Anchor as f } from "./components/Anchor.js";
4
+ import { Alert as a } from "./components/Alert.js";
5
+ import { Autocomplete as n } from "./components/Autocomplete.js";
6
+ import { Avatar as u, AvatarGroup as l } from "./components/Avatar.js";
7
+ import { Badge as C } from "./components/Badge.js";
8
+ import { Breadcrumb as g } from "./components/Breadcrumb.js";
9
+ import { Button as S } from "./components/Button.js";
10
+ import { SizeContext as h, SizeProvider as k, useSize as v } from "./contexts/SizeContext.js";
11
+ import { CopyButton as b } from "./components/CopyButton.js";
12
+ import { Checkbox as w } from "./components/Checkbox.js";
13
+ import { Chat as B } from "./components/Chat.js";
14
+ import { ColorPicker as M } from "./components/ColorPicker.js";
15
+ import { Card as L } from "./components/Card.js";
16
+ import { Carousel as z } from "./components/Carousel.js";
17
+ import { Cascader as G } from "./components/Cascader.js";
18
+ import { ConfigContext as W, ConfigProvider as E, useComponentLocale as N, useConfig as J, useLocale as O } from "./providers/ConfigProvider.js";
19
+ import { Collapse as j } from "./components/Collapse.js";
20
+ import { Command as Q } from "./components/Command.js";
21
+ import { Container as X } from "./components/Container.js";
22
+ import { ContextMenu as Z } from "./components/ContextMenu.js";
23
+ import { Countdown as $ } from "./components/Countdown.js";
24
+ import { DatePicker as ro } from "./components/DatePicker.js";
25
+ import { MonthCalendar as to } from "./components/MonthCalendar.js";
26
+ import { WeekCalendar as mo } from "./components/WeekCalendar.js";
27
+ import { Descriptions as xo } from "./components/Descriptions.js";
28
+ import { Diff as so } from "./components/Diff.js";
29
+ import { Dock as io } from "./components/Dock.js";
30
+ import { Divider as lo } from "./components/Divider.js";
31
+ import { Drawer as co } from "./components/Drawer.js";
32
+ import { ResponsiveDrawer as To } from "./components/ResponsiveDrawer.js";
33
+ import { Fieldset as Po } from "./components/Fieldset.js";
34
+ import { FileInput as ko } from "./components/FileInput.js";
35
+ import { Filter as Ro } from "./components/Filter.js";
36
+ import { Flex as Do } from "./components/Flex.js";
37
+ import { FloatButton as yo } from "./components/FloatButton.js";
38
+ import { Footer as Fo } from "./components/Footer.js";
39
+ import { Form as Ao, useFormInstance as Lo } from "./components/Form.js";
40
+ import { Col as zo, Grid as Ho, Row as Go } from "./components/Grid.js";
41
+ import { Hero as Wo } from "./components/Hero.js";
42
+ import { HoverGallery as No } from "./components/HoverGallery.js";
43
+ import { Image as Oo } from "./components/Image.js";
44
+ import { Dropdown as jo } from "./components/Dropdown.js";
45
+ import { Empty as Qo } from "./components/Empty.js";
46
+ import { Input as Xo } from "./components/Input.js";
47
+ import { InputNumber as Zo } from "./components/InputNumber.js";
48
+ import { Join as $o } from "./components/Join.js";
49
+ import { Kbd as rr } from "./components/Kbd.js";
50
+ import { Layout as tr, useSiderContext as pr } from "./components/Layout.js";
51
+ import { List as fr } from "./components/List.js";
52
+ import { Loading as ar } from "./components/Loading.js";
53
+ import { Mask as nr } from "./components/Mask.js";
54
+ import { Masonry as ur } from "./components/Masonry.js";
55
+ import { Mention as dr } from "./components/Mention.js";
56
+ import { Menu as cr } from "./components/Menu.js";
57
+ import { Browser as Tr } from "./components/Browser.js";
58
+ import { Code as Pr } from "./components/Code.js";
59
+ import { Phone as kr } from "./components/Phone.js";
60
+ import { Window as Rr } from "./components/Window.js";
61
+ import { Modal as Dr } from "./components/Modal.js";
62
+ import { Navbar as yr } from "./components/Navbar.js";
63
+ import { notification as Fr } from "./components/Notification.js";
64
+ import { MessageManager as Ar, message as Lr } from "./components/Message.js";
65
+ import { OTPInput as zr } from "./components/OTPInput.js";
66
+ import { Pagination as Gr } from "./components/Pagination.js";
67
+ import { Popconfirm as Wr } from "./components/Popconfirm.js";
68
+ import { Popover as Nr } from "./components/Popover.js";
69
+ import { Progress as Or } from "./components/Progress.js";
70
+ import { Radio as jr } from "./components/Radio.js";
71
+ import { RadialProgress as Qr } from "./components/RadialProgress.js";
72
+ import { Range as Xr } from "./components/Range.js";
73
+ import { Rating as Zr } from "./components/Rating.js";
74
+ import { Result as $r } from "./components/Result.js";
75
+ import { Select as re } from "./components/Select.js";
76
+ import { Segmented as te } from "./components/Segmented.js";
77
+ import { Skeleton as me } from "./components/Skeleton.js";
78
+ import { Space as xe } from "./components/Space.js";
79
+ import { Splitter as se } from "./components/Splitter.js";
80
+ import { Stats as ie } from "./components/Stat.js";
81
+ import { Status as le } from "./components/Status.js";
82
+ import { Steps as Ce } from "./components/Steps.js";
83
+ import { Table as ge } from "./components/Table.js";
84
+ import { Tabs as Se } from "./components/Tabs.js";
85
+ import { Textarea as he } from "./components/Textarea.js";
86
+ import { TextRotate as ve } from "./components/TextRotate.js";
87
+ import { CheckableTag as be, Tag as De, TagLiveRegion as we } from "./components/Tag.js";
88
+ import { ThemeController as Be } from "./components/ThemeController.js";
89
+ import { ThemeProvider as Me, useHasThemeProvider as Ae, useThemeContext as Le } from "./providers/ThemeProvider.js";
90
+ import { TimePicker as ze } from "./components/TimePicker.js";
91
+ import { Timeline as Ge } from "./components/Timeline.js";
92
+ import { Toggle as We } from "./components/Toggle.js";
93
+ import { Tour as Ne } from "./components/Tour.js";
94
+ import { Tooltip as Oe } from "./components/Tooltip.js";
95
+ import { Transfer as je } from "./components/Transfer.js";
96
+ import { Tree as Qe } from "./components/Tree.js";
97
+ import { TreeSelect as Xe, TreeSelectComponent as Ye } from "./components/TreeSelect.js";
98
+ import { Typography as _e } from "./components/Typography.js";
99
+ import { Upload as ot } from "./components/Upload.js";
100
+ import { Watermark as et } from "./components/Watermark.js";
101
+ import { Hide as pt, Show as mt } from "./components/Responsive.js";
102
+ import { useBreakpoint as xt } from "./hooks/useBreakpoint.js";
103
+ import { useDisclosure as st } from "./hooks/useDisclosure.js";
104
+ import { useClipboard as it } from "./hooks/useClipboard.js";
105
+ import { useLocalStorage as lt } from "./hooks/useLocalStorage.js";
106
+ import { useDebounce as Ct } from "./hooks/useDebounce.js";
107
+ import { useClickOutside as gt } from "./hooks/useClickOutside.js";
108
+ import { usePrevious as St } from "./hooks/usePrevious.js";
109
+ import { useHover as ht } from "./hooks/useHover.js";
110
+ import { useKeyPress as vt, useKeyPressCallback as Rt } from "./hooks/useKeyPress.js";
111
+ import { useWindowSize as Dt } from "./hooks/useWindowSize.js";
112
+ import { useTheme as yt } from "./hooks/useTheme.js";
113
+ import { default as Ft } from "./locale/en-US.js";
114
+ import { default as At } from "./locale/en-GB.js";
115
+ import { default as It } from "./locale/en-CA.js";
116
+ import { default as Ht } from "./locale/zh-CN.js";
117
+ import { default as Kt } from "./locale/es-ES.js";
118
+ import { default as Et } from "./locale/ja-JP.js";
119
+ import { default as Jt } from "./locale/pt-BR.js";
120
+ import { default as Ut } from "./locale/de-DE.js";
121
+ import { default as qt } from "./locale/fr-FR.js";
122
+ import { default as Vt } from "./locale/ko-KR.js";
122
123
  export {
123
124
  e as Affix,
124
- f as Alert,
125
- p as Anchor,
126
- a as Autocomplete,
127
- n as Avatar,
128
- i as AvatarGroup,
129
- l as Badge,
130
- C as Breadcrumb,
131
- cr as Browser,
132
- g as Button,
133
- M as Card,
134
- L as Carousel,
135
- z as Cascader,
136
- w as Chat,
137
- ve as CheckableTag,
138
- b as Checkbox,
139
- Tr as Code,
140
- Lo as Col,
141
- O as Collapse,
142
- B as ColorPicker,
143
- j as Command,
144
- G as ConfigContext,
145
- K as ConfigProvider,
146
- Q as Container,
147
- X as ContextMenu,
148
- v as CopyButton,
149
- Z as Countdown,
150
- $ as DatePicker,
151
- mo as Descriptions,
152
- xo as Diff,
153
- io as Divider,
154
- so as Dock,
155
- lo as Drawer,
156
- Oo as Dropdown,
157
- jo as Empty,
158
- To as Fieldset,
159
- Po as FileInput,
160
- ko as Filter,
161
- Ro as Flex,
162
- Do as FloatButton,
163
- yo as Footer,
164
- Fo as Form,
165
- Io as Grid,
166
- Go as Hero,
167
- et as Hide,
168
- Wo as HoverGallery,
169
- No as Image,
170
- Qo as Input,
171
- Xo as InputNumber,
172
- Zo as Join,
173
- $o as Kbd,
174
- rr as Layout,
175
- pr as List,
176
- fr as Loading,
177
- ar as Mask,
178
- nr as Masonry,
179
- ur as Mention,
180
- dr as Menu,
181
- Fr as MessageManager,
182
- Rr as Modal,
183
- ro as MonthCalendar,
184
- Dr as Navbar,
185
- Lr as OTPInput,
186
- zr as Pagination,
187
- Pr as Phone,
188
- Gr as Popconfirm,
189
- Wr as Popover,
190
- Nr as Progress,
191
- jr as RadialProgress,
192
- Or as Radio,
193
- Qr as Range,
194
- Xr as Rating,
195
- co as ResponsiveDrawer,
196
- Zr as Result,
197
- zo as Row,
198
- re as Segmented,
199
- $r as Select,
200
- tt as Show,
201
- S as SizeContext,
202
- P as SizeProvider,
203
- te as Skeleton,
204
- me as Space,
205
- xe as Splitter,
206
- se as Stats,
207
- ie as Status,
208
- le as Steps,
209
- Ce as Table,
210
- ge as Tabs,
211
- Re as Tag,
212
- be as TagLiveRegion,
213
- he as TextRotate,
214
- Se as Textarea,
215
- we as ThemeController,
216
- Be as ThemeProvider,
217
- Le as TimePicker,
218
- ze as Timeline,
219
- Ge as Toggle,
220
- Ne as Tooltip,
221
- We as Tour,
222
- Oe as Transfer,
223
- je as Tree,
224
- Qe as TreeSelect,
225
- Ve as TreeSelectComponent,
226
- Ye as Typography,
227
- _e as Upload,
228
- ot as Watermark,
229
- to as WeekCalendar,
230
- kr as Window,
231
- Jt as deDE,
232
- At as enCA,
233
- Ft as enGB,
234
- yt as enUS,
235
- Ht as esES,
236
- Ut as frFR,
237
- Kt as jaJP,
238
- qt as koKR,
239
- Mr as message,
240
- yr as notification,
241
- Et as ptBR,
242
- mt as useBreakpoint,
243
- Ct as useClickOutside,
244
- st as useClipboard,
245
- W as useComponentLocale,
246
- E as useConfig,
247
- lt as useDebounce,
248
- xt as useDisclosure,
249
- Mo as useFormInstance,
250
- Fe as useHasThemeProvider,
251
- St as useHover,
252
- ht as useKeyPress,
253
- kt as useKeyPressCallback,
254
- it as useLocalStorage,
255
- N as useLocale,
256
- gt as usePrevious,
257
- er as useSiderContext,
258
- h as useSize,
259
- Dt as useTheme,
260
- Me as useThemeContext,
261
- Rt as useWindowSize,
262
- It as zhCN
125
+ a as Alert,
126
+ f as Anchor,
127
+ p as AspectRatio,
128
+ n as Autocomplete,
129
+ u as Avatar,
130
+ l as AvatarGroup,
131
+ C as Badge,
132
+ g as Breadcrumb,
133
+ Tr as Browser,
134
+ S as Button,
135
+ L as Card,
136
+ z as Carousel,
137
+ G as Cascader,
138
+ B as Chat,
139
+ be as CheckableTag,
140
+ w as Checkbox,
141
+ Pr as Code,
142
+ zo as Col,
143
+ j as Collapse,
144
+ M as ColorPicker,
145
+ Q as Command,
146
+ W as ConfigContext,
147
+ E as ConfigProvider,
148
+ X as Container,
149
+ Z as ContextMenu,
150
+ b as CopyButton,
151
+ $ as Countdown,
152
+ ro as DatePicker,
153
+ xo as Descriptions,
154
+ so as Diff,
155
+ lo as Divider,
156
+ io as Dock,
157
+ co as Drawer,
158
+ jo as Dropdown,
159
+ Qo as Empty,
160
+ Po as Fieldset,
161
+ ko as FileInput,
162
+ Ro as Filter,
163
+ Do as Flex,
164
+ yo as FloatButton,
165
+ Fo as Footer,
166
+ Ao as Form,
167
+ Ho as Grid,
168
+ Wo as Hero,
169
+ pt as Hide,
170
+ No as HoverGallery,
171
+ Oo as Image,
172
+ Xo as Input,
173
+ Zo as InputNumber,
174
+ $o as Join,
175
+ rr as Kbd,
176
+ tr as Layout,
177
+ fr as List,
178
+ ar as Loading,
179
+ nr as Mask,
180
+ ur as Masonry,
181
+ dr as Mention,
182
+ cr as Menu,
183
+ Ar as MessageManager,
184
+ Dr as Modal,
185
+ to as MonthCalendar,
186
+ yr as Navbar,
187
+ zr as OTPInput,
188
+ Gr as Pagination,
189
+ kr as Phone,
190
+ Wr as Popconfirm,
191
+ Nr as Popover,
192
+ Or as Progress,
193
+ Qr as RadialProgress,
194
+ jr as Radio,
195
+ Xr as Range,
196
+ Zr as Rating,
197
+ To as ResponsiveDrawer,
198
+ $r as Result,
199
+ Go as Row,
200
+ te as Segmented,
201
+ re as Select,
202
+ mt as Show,
203
+ h as SizeContext,
204
+ k as SizeProvider,
205
+ me as Skeleton,
206
+ xe as Space,
207
+ se as Splitter,
208
+ ie as Stats,
209
+ le as Status,
210
+ Ce as Steps,
211
+ ge as Table,
212
+ Se as Tabs,
213
+ De as Tag,
214
+ we as TagLiveRegion,
215
+ ve as TextRotate,
216
+ he as Textarea,
217
+ Be as ThemeController,
218
+ Me as ThemeProvider,
219
+ ze as TimePicker,
220
+ Ge as Timeline,
221
+ We as Toggle,
222
+ Oe as Tooltip,
223
+ Ne as Tour,
224
+ je as Transfer,
225
+ Qe as Tree,
226
+ Xe as TreeSelect,
227
+ Ye as TreeSelectComponent,
228
+ _e as Typography,
229
+ ot as Upload,
230
+ et as Watermark,
231
+ mo as WeekCalendar,
232
+ Rr as Window,
233
+ Ut as deDE,
234
+ It as enCA,
235
+ At as enGB,
236
+ Ft as enUS,
237
+ Kt as esES,
238
+ qt as frFR,
239
+ Et as jaJP,
240
+ Vt as koKR,
241
+ Lr as message,
242
+ Fr as notification,
243
+ Jt as ptBR,
244
+ xt as useBreakpoint,
245
+ gt as useClickOutside,
246
+ it as useClipboard,
247
+ N as useComponentLocale,
248
+ J as useConfig,
249
+ Ct as useDebounce,
250
+ st as useDisclosure,
251
+ Lo as useFormInstance,
252
+ Ae as useHasThemeProvider,
253
+ ht as useHover,
254
+ vt as useKeyPress,
255
+ Rt as useKeyPressCallback,
256
+ lt as useLocalStorage,
257
+ O as useLocale,
258
+ St as usePrevious,
259
+ pr as useSiderContext,
260
+ v as useSize,
261
+ yt as useTheme,
262
+ Le as useThemeContext,
263
+ Dt as useWindowSize,
264
+ Ht as zhCN
263
265
  };
264
266
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asterui",
3
- "version": "0.12.65",
3
+ "version": "0.12.67",
4
4
  "description": "React UI component library with DaisyUI",
5
5
  "homepage": "https://asterui.com",
6
6
  "repository": {