@kolking/react-ui 1.8.20 → 1.9.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.
- package/dist/Thumbnails-BlXFynlF.js +38 -0
- package/dist/components/Avatar/Avatar.js +12 -12
- package/dist/components/Badge/Badge.js +28 -29
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Dialog/Dialog.js +44 -44
- package/dist/components/Dialog/useDialog.d.ts +1 -1
- package/dist/components/Dialog/useDialog.js +21 -29
- package/dist/components/Fields/Numeric.js +34 -36
- package/dist/components/Fields/Range.d.ts +1 -1
- package/dist/components/Fields/Range.js +33 -33
- package/dist/components/Flex/Flex.d.ts +1 -1
- package/dist/components/Gallery/Gallery.d.ts +11 -0
- package/dist/components/Gallery/Gallery.js +48 -0
- package/dist/components/Gallery/GalleryItem.d.ts +12 -0
- package/dist/components/Gallery/GalleryItem.js +41 -0
- package/dist/components/Gallery/index.d.ts +2 -0
- package/dist/components/Gallery/index.js +6 -0
- package/dist/components/Icon/Icon.js +125 -122
- package/dist/components/Icon/icons.d.ts +1 -1
- package/dist/components/Icon/icons.js +4 -0
- package/dist/components/Lightbox/Lightbox.d.ts +12 -0
- package/dist/components/Lightbox/Lightbox.js +150 -0
- package/dist/components/Lightbox/Thumbnail.d.ts +7 -0
- package/dist/components/Lightbox/Thumbnail.js +26 -0
- package/dist/components/Lightbox/Thumbnails.d.ts +11 -0
- package/dist/components/Lightbox/Thumbnails.js +8 -0
- package/dist/components/Lightbox/index.d.ts +1 -0
- package/dist/components/Lightbox/index.js +4 -0
- package/dist/components/Menu/Menu.js +44 -45
- package/dist/components/Menu/MenuItem.js +33 -33
- package/dist/components/Popover/Popover.js +40 -41
- package/dist/components/Segmented/Segmented.js +43 -47
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/components/ToggleButton/ToggleButton.d.ts +1 -1
- package/dist/components/ToggleButton/ToggleGroup.js +42 -40
- package/dist/components/Tooltip/Tooltip.js +30 -31
- package/dist/index.d.ts +3 -1
- package/dist/index.js +71 -63
- package/dist/styles/style.css +1 -1
- package/dist/styles.module-D0C-vMZX.js +7 -0
- package/dist/utils/helpers.d.ts +3 -1
- package/dist/utils/helpers.js +30 -19
- package/package.json +31 -32
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as C, useState as v, useEffect as w } from "react";
|
|
3
|
+
import j from "classnames";
|
|
4
|
+
import { Composite as x } from "@floating-ui/react";
|
|
5
|
+
import { cssProps as R } from "../../utils/helpers.js";
|
|
6
|
+
import { s as S } from "../../styles.module-D0C-vMZX.js";
|
|
7
|
+
const O = ({
|
|
8
|
+
gap: s,
|
|
9
|
+
loop: o = !1,
|
|
10
|
+
cols: e = "auto",
|
|
11
|
+
itemSize: n,
|
|
12
|
+
objectFit: m,
|
|
13
|
+
marginStart: l,
|
|
14
|
+
marginEnd: u,
|
|
15
|
+
className: a,
|
|
16
|
+
style: c,
|
|
17
|
+
children: i,
|
|
18
|
+
...f
|
|
19
|
+
}) => {
|
|
20
|
+
const t = C(null), [p, g] = v(e === "auto" ? 1 : e);
|
|
21
|
+
return w(() => {
|
|
22
|
+
const r = new ResizeObserver((y) => {
|
|
23
|
+
const b = window.getComputedStyle(y[0].target).gridTemplateColumns;
|
|
24
|
+
g(b.split(" ").length);
|
|
25
|
+
});
|
|
26
|
+
return t.current && (e === "auto" ? r.observe(t.current) : r.unobserve(t.current)), () => {
|
|
27
|
+
r.disconnect();
|
|
28
|
+
};
|
|
29
|
+
}, [e]), /* @__PURE__ */ d(
|
|
30
|
+
x,
|
|
31
|
+
{
|
|
32
|
+
...f,
|
|
33
|
+
ref: t,
|
|
34
|
+
loop: o,
|
|
35
|
+
cols: p,
|
|
36
|
+
"data-gallery": !0,
|
|
37
|
+
className: j(S.gallery, a),
|
|
38
|
+
style: {
|
|
39
|
+
...c,
|
|
40
|
+
...R({ gap: s, marginStart: l, marginEnd: u, itemSize: n, imageObjectFit: m })
|
|
41
|
+
},
|
|
42
|
+
children: i
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
O as Gallery
|
|
48
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CompositeItemProps } from '@floating-ui/react';
|
|
3
|
+
type BaseProps = React.HTMLAttributes<HTMLDivElement> & CompositeItemProps;
|
|
4
|
+
export type GalleryItemProps = (BaseProps & {
|
|
5
|
+
index?: undefined;
|
|
6
|
+
onSelect?: undefined;
|
|
7
|
+
}) | (Omit<BaseProps, 'onSelect'> & {
|
|
8
|
+
index: number;
|
|
9
|
+
onSelect?: (index: number) => void;
|
|
10
|
+
});
|
|
11
|
+
export declare const GalleryItem: ({ index, children, className, onClick, onSelect, onKeyDown, ...props }: GalleryItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as s } from "react";
|
|
3
|
+
import { CompositeItem as y } from "@floating-ui/react";
|
|
4
|
+
import n from "classnames";
|
|
5
|
+
import { s as u } from "../../styles.module-D0C-vMZX.js";
|
|
6
|
+
const I = ({
|
|
7
|
+
index: o,
|
|
8
|
+
children: l,
|
|
9
|
+
className: e,
|
|
10
|
+
onClick: t,
|
|
11
|
+
onSelect: m,
|
|
12
|
+
onKeyDown: a,
|
|
13
|
+
...p
|
|
14
|
+
}) => {
|
|
15
|
+
const c = s(
|
|
16
|
+
(r) => {
|
|
17
|
+
m?.(o), t?.(r);
|
|
18
|
+
},
|
|
19
|
+
[o, t, m]
|
|
20
|
+
), f = s(
|
|
21
|
+
(r) => {
|
|
22
|
+
(r.code === "Enter" || r.code === "Space") && m?.(o), a?.(r);
|
|
23
|
+
},
|
|
24
|
+
[o, a, m]
|
|
25
|
+
);
|
|
26
|
+
return /* @__PURE__ */ i(
|
|
27
|
+
y,
|
|
28
|
+
{
|
|
29
|
+
...p,
|
|
30
|
+
role: "button",
|
|
31
|
+
"data-gallery-image": o,
|
|
32
|
+
className: n(u.item, e),
|
|
33
|
+
onClick: c,
|
|
34
|
+
onKeyDown: f,
|
|
35
|
+
children: l
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
I as GalleryItem
|
|
41
|
+
};
|