@caseparts-org/caseblocks 0.0.119 → 0.0.121
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/assets/Root.css +1 -1
- package/dist/atoms/Popover/Popover.d.ts +1 -1
- package/dist/atoms/Popover/Popover.js +1 -1
- package/dist/atoms/Root/Root.d.ts +2 -2
- package/dist/atoms/SlideInPanel/SlideInPanel.js +1 -1
- package/dist/atoms/Text/Text.d.ts +1 -0
- package/dist/atoms/Tooltip/Tooltip.d.ts +1 -1
- package/dist/atoms/Tooltip/Tooltip.js +1 -1
- package/dist/{index-B4KbmMH3.js → index-BkF-BQ3Q.js} +2 -2
- package/dist/main-client.d.ts +4 -0
- package/dist/main-client.js +53 -49
- package/dist/molecules/Account/Account.js +16 -19
- package/dist/molecules/ImageViewer/ImageViewer.d.ts +8 -0
- package/dist/molecules/ImageViewer/ImageViewer.js +123 -0
- package/dist/molecules/ImageViewer/ImageViewer.stories.d.ts +6 -0
- package/dist/molecules/ImageViewer/ImageViewer.stories.js +30 -0
- package/dist/molecules/Logo/Logo.stories.d.ts +28 -0
- package/dist/molecules/ToggleView/ToggleView.d.ts +1 -1
- package/dist/organisms/SpinZoomViewer/SpinZoomViewer.d.ts +3 -2
- package/dist/organisms/SpinZoomViewer/SpinZoomViewer.js +1 -0
- package/package.json +7 -7
|
@@ -7,7 +7,7 @@ export type PopoverAPI = {
|
|
|
7
7
|
type PositionKeyword = "top" | "right" | "bottom" | "left";
|
|
8
8
|
type Position = "top left" | "top center" | "top right" | "right top" | "right center" | "right bottom" | "bottom left" | "bottom center" | "bottom right" | "left top" | "left center" | "left bottom" | PositionKeyword;
|
|
9
9
|
export type PopoverProps = {
|
|
10
|
-
trigger: React.ReactElement
|
|
10
|
+
trigger: React.ReactElement<any>;
|
|
11
11
|
children: React.ReactNode | ((_api: PopoverAPI) => React.ReactNode);
|
|
12
12
|
position?: Position;
|
|
13
13
|
popoverClassName?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as F, Fragment as H, jsx as k } from "react/jsx-runtime";
|
|
2
2
|
import * as f from "react";
|
|
3
|
-
import { r as N } from "../../index-
|
|
3
|
+
import { r as N } from "../../index-BkF-BQ3Q.js";
|
|
4
4
|
import { c as z } from "../../clsx-OuTLNxxd.js";
|
|
5
5
|
import '../../assets/Popover.css';const W = "_popover_vlr81_1", q = "_content_vlr81_7", P = {
|
|
6
6
|
popover: W,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as k, jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
|
-
import { r as A } from "../../index-
|
|
3
|
+
import { r as A } from "../../index-BkF-BQ3Q.js";
|
|
4
4
|
import { c } from "../../clsx-OuTLNxxd.js";
|
|
5
5
|
import { getHideAtStyles as N } from "../HideAt.js";
|
|
6
6
|
import '../../assets/SlideInPanel.css';const q = "_root_12lt6_1", P = "_overlay_12lt6_8", R = "_panel_12lt6_16", j = "_active_12lt6_52", o = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HideAtProps } from '../HideAt';
|
|
2
|
+
import { JSX } from 'react';
|
|
2
3
|
type ElementType = keyof Pick<JSX.IntrinsicElements, "span" | "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div">;
|
|
3
4
|
/** A text element. */
|
|
4
5
|
export type TextProps<T extends ElementType = "span"> = HideAtProps & {
|
|
@@ -3,7 +3,7 @@ type PositionKeyword = "top" | "right" | "bottom" | "left";
|
|
|
3
3
|
type Position = "top left" | "top center" | "top right" | "right top" | "right center" | "right bottom" | "bottom left" | "bottom center" | "bottom right" | "left top" | "left center" | "left bottom" | PositionKeyword;
|
|
4
4
|
export type TooltipProps = {
|
|
5
5
|
children: React.ReactNode;
|
|
6
|
-
trigger: React.ReactElement
|
|
6
|
+
trigger: React.ReactElement<any>;
|
|
7
7
|
tooltipClassName?: string;
|
|
8
8
|
contentClassName?: string;
|
|
9
9
|
position?: Position;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as W, Fragment as X, jsx as O } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
3
|
import { c as S } from "../../clsx-OuTLNxxd.js";
|
|
4
|
-
import { r as Y } from "../../index-
|
|
4
|
+
import { r as Y } from "../../index-BkF-BQ3Q.js";
|
|
5
5
|
import '../../assets/Tooltip.css';const A = "_tooltip_17o7a_1", D = "_content_17o7a_11", j = {
|
|
6
6
|
tooltip: A,
|
|
7
7
|
content: D
|
|
@@ -140,7 +140,7 @@ function R() {
|
|
|
140
140
|
return y.H.useFormState(n, r, a);
|
|
141
141
|
}, c.useFormStatus = function() {
|
|
142
142
|
return y.H.useHostTransitionStatus();
|
|
143
|
-
}, c.version = "19.
|
|
143
|
+
}, c.version = "19.2.3", c;
|
|
144
144
|
}
|
|
145
145
|
var s = {};
|
|
146
146
|
/**
|
|
@@ -362,7 +362,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
|
|
|
362
362
|
return y().useFormState(t, e, i);
|
|
363
363
|
}, s.useFormStatus = function() {
|
|
364
364
|
return y().useHostTransitionStatus();
|
|
365
|
-
}, s.version = "19.
|
|
365
|
+
}, s.version = "19.2.3", typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
366
366
|
}()), s;
|
|
367
367
|
}
|
|
368
368
|
function E() {
|
package/dist/main-client.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ export { AddToCart } from './molecules/AddToCart/AddToCart';
|
|
|
24
24
|
export type { CategoryWithChildren as MainCategory, Category } from './molecules/CategoryNav/CategoryNav';
|
|
25
25
|
export { Modal } from './molecules/Modal/Modal';
|
|
26
26
|
export type { ModalProps } from './molecules/Modal/Modal';
|
|
27
|
+
export { ImageViewer } from './molecules/ImageViewer/ImageViewer';
|
|
28
|
+
export type { ImageViewerProps } from './molecules/ImageViewer/ImageViewer';
|
|
27
29
|
export { MainNav } from './organisms/MainNav/MainNav';
|
|
28
30
|
export type { MainNavProps } from './organisms/MainNav/MainNav';
|
|
29
31
|
export { ChipSelector } from './organisms/ChipSelector/ChipSelector';
|
|
@@ -34,3 +36,5 @@ export { Carousel } from './organisms/Carousel/Carousel';
|
|
|
34
36
|
export type { CarouselProps } from './organisms/Carousel/Carousel';
|
|
35
37
|
export { Footer } from './organisms/Footer/Footer';
|
|
36
38
|
export type { FooterProps } from './organisms/Footer/Footer';
|
|
39
|
+
export { SpinZoomViewer } from './organisms/SpinZoomViewer/SpinZoomViewer';
|
|
40
|
+
export type { SpinZoomViewerProps } from './organisms/SpinZoomViewer/SpinZoomViewer';
|
package/dist/main-client.js
CHANGED
|
@@ -5,23 +5,23 @@ import { Head as n } from "./atoms/Root/Head.js";
|
|
|
5
5
|
import { Icon as l } from "./atoms/Icon/Icon.js";
|
|
6
6
|
import { Root as d } from "./atoms/Root/Root.js";
|
|
7
7
|
import { Separator as C } from "./atoms/Separator/Separator.js";
|
|
8
|
-
import { Text as
|
|
9
|
-
import { Input as
|
|
10
|
-
import { Link as
|
|
11
|
-
import { linkClassName as
|
|
12
|
-
import { configureLink as
|
|
13
|
-
import { LinkButton as
|
|
14
|
-
import { configureImage as
|
|
15
|
-
import { Logo as
|
|
16
|
-
import { SearchBox as
|
|
17
|
-
import { QuantityInput as
|
|
18
|
-
import { Pricing as
|
|
19
|
-
import { Availability as
|
|
20
|
-
import { Avatar as
|
|
21
|
-
import { BannerCard as
|
|
22
|
-
import { CardLink as
|
|
23
|
-
import { Breadcrumbs as
|
|
24
|
-
import { NotFound as
|
|
8
|
+
import { Text as S } from "./atoms/Text/Text.js";
|
|
9
|
+
import { Input as I } from "./atoms/Input/Input.js";
|
|
10
|
+
import { Link as s } from "./atoms/Link/Link.js";
|
|
11
|
+
import { linkClassName as A } from "./atoms/Link/linkClassName.js";
|
|
12
|
+
import { configureLink as P, routerOverride as h } from "./atoms/Link/configureLink.js";
|
|
13
|
+
import { LinkButton as w } from "./atoms/LinkButton/LinkButton.js";
|
|
14
|
+
import { configureImage as M } from "./atoms/Image/configureImage.js";
|
|
15
|
+
import { Logo as V } from "./molecules/Logo/Logo.js";
|
|
16
|
+
import { SearchBox as y } from "./molecules/SearchBox/SearchBox.js";
|
|
17
|
+
import { QuantityInput as z } from "./molecules/QuantityInput/QuantityInput.js";
|
|
18
|
+
import { Pricing as O } from "./molecules/Pricing/Pricing.js";
|
|
19
|
+
import { Availability as R } from "./molecules/Availability/Availability.js";
|
|
20
|
+
import { Avatar as j } from "./molecules/Avatar/Avatar.js";
|
|
21
|
+
import { BannerCard as D } from "./molecules/BannerCard/BannerCard.js";
|
|
22
|
+
import { CardLink as J } from "./molecules/CardLink/CardLink.js";
|
|
23
|
+
import { Breadcrumbs as U } from "./molecules/Breadcrumbs/Breadcrumbs.js";
|
|
24
|
+
import { NotFound as X } from "./organisms/NotFound/NotFound.js";
|
|
25
25
|
import { HorizontalScroll as _ } from "./atoms/HorizontalScroll/HorizontalScroll.js";
|
|
26
26
|
import { SlideInPanel as oo } from "./atoms/SlideInPanel/SlideInPanel.js";
|
|
27
27
|
import { Tooltip as eo } from "./atoms/Tooltip/Tooltip.js";
|
|
@@ -31,28 +31,30 @@ import { Chip as ao } from "./molecules/Chip/Chip.js";
|
|
|
31
31
|
import { ToggleView as io } from "./molecules/ToggleView/ToggleView.js";
|
|
32
32
|
import { CartSlideInPanel as uo } from "./molecules/Cart/CartSlideInPanel.js";
|
|
33
33
|
import { StatefulButton as Co } from "./molecules/StatefulButton/StatefulButton.js";
|
|
34
|
-
import { AnimatedCheckMark as
|
|
35
|
-
import { AddToCart as
|
|
36
|
-
import { Modal as
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
34
|
+
import { AnimatedCheckMark as So } from "./molecules/StatefulButton/AnimatedCheckmark.js";
|
|
35
|
+
import { AddToCart as Io } from "./molecules/AddToCart/AddToCart.js";
|
|
36
|
+
import { Modal as so } from "./molecules/Modal/Modal.js";
|
|
37
|
+
import { ImageViewer as Ao } from "./molecules/ImageViewer/ImageViewer.js";
|
|
38
|
+
import { MainNav as Po } from "./organisms/MainNav/MainNav.js";
|
|
39
|
+
import { ChipSelector as To } from "./organisms/ChipSelector/ChipSelector.js";
|
|
40
|
+
import { Product as Fo } from "./organisms/Product/Product.js";
|
|
41
|
+
import { Carousel as No } from "./organisms/Carousel/Carousel.js";
|
|
41
42
|
import { Footer as bo } from "./organisms/Footer/Footer.js";
|
|
43
|
+
import { default as Ho } from "./organisms/SpinZoomViewer/SpinZoomViewer.js";
|
|
42
44
|
export {
|
|
43
45
|
fo as Account,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
Io as AddToCart,
|
|
47
|
+
So as AnimatedCheckMark,
|
|
48
|
+
R as Availability,
|
|
49
|
+
j as Avatar,
|
|
50
|
+
D as BannerCard,
|
|
51
|
+
U as Breadcrumbs,
|
|
50
52
|
e as Button,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
J as CardLink,
|
|
54
|
+
No as Carousel,
|
|
53
55
|
uo as CartSlideInPanel,
|
|
54
56
|
ao as Chip,
|
|
55
|
-
|
|
57
|
+
To as ChipSelector,
|
|
56
58
|
f as Column,
|
|
57
59
|
p as Flex,
|
|
58
60
|
bo as Footer,
|
|
@@ -60,27 +62,29 @@ export {
|
|
|
60
62
|
n as Head,
|
|
61
63
|
_ as HorizontalScroll,
|
|
62
64
|
l as Icon,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
Ao as ImageViewer,
|
|
66
|
+
I as Input,
|
|
67
|
+
s as Link,
|
|
68
|
+
w as LinkButton,
|
|
69
|
+
V as Logo,
|
|
70
|
+
Po as MainNav,
|
|
71
|
+
so as Modal,
|
|
72
|
+
X as NotFound,
|
|
70
73
|
po as Popover,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
O as Pricing,
|
|
75
|
+
Fo as Product,
|
|
76
|
+
z as QuantityInput,
|
|
74
77
|
d as Root,
|
|
75
|
-
|
|
78
|
+
y as SearchBox,
|
|
76
79
|
C as Separator,
|
|
77
80
|
oo as SlideInPanel,
|
|
81
|
+
Ho as SpinZoomViewer,
|
|
78
82
|
Co as StatefulButton,
|
|
79
|
-
|
|
83
|
+
S as Text,
|
|
80
84
|
io as ToggleView,
|
|
81
85
|
eo as Tooltip,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
M as configureImage,
|
|
87
|
+
P as configureLink,
|
|
88
|
+
A as linkClassName,
|
|
89
|
+
h as routerOverride
|
|
86
90
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n, jsxs as t } from "react/jsx-runtime";
|
|
2
2
|
import { getHideAtStyles as m } from "../../atoms/HideAt.js";
|
|
3
3
|
import { Icon as f } from "../../atoms/Icon/Icon.js";
|
|
4
4
|
import { Text as c } from "../../atoms/Text/Text.js";
|
|
@@ -16,7 +16,7 @@ function y(i) {
|
|
|
16
16
|
return i.account !== void 0;
|
|
17
17
|
}
|
|
18
18
|
function j(i) {
|
|
19
|
-
return i.isAccountLoading ? /* @__PURE__ */
|
|
19
|
+
return i.isAccountLoading ? /* @__PURE__ */ n("div", { className: o.placeholder }) : y(i) ? /* @__PURE__ */ n(_, { ...i }) : /* @__PURE__ */ n(N, { ...i });
|
|
20
20
|
}
|
|
21
21
|
function _(i) {
|
|
22
22
|
const {
|
|
@@ -27,17 +27,17 @@ function _(i) {
|
|
|
27
27
|
isAccountLoading: h,
|
|
28
28
|
...l
|
|
29
29
|
} = i;
|
|
30
|
-
return a ? /* @__PURE__ */
|
|
30
|
+
return a ? /* @__PURE__ */ n(
|
|
31
31
|
A,
|
|
32
32
|
{
|
|
33
33
|
position: "bottom right",
|
|
34
|
-
trigger: /* @__PURE__ */
|
|
34
|
+
trigger: /* @__PURE__ */ t(
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
37
37
|
className: g(o.loggedIn, m(s), r),
|
|
38
38
|
...l,
|
|
39
39
|
children: [
|
|
40
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ t(
|
|
41
41
|
d,
|
|
42
42
|
{
|
|
43
43
|
flexDirection: "column",
|
|
@@ -45,30 +45,30 @@ function _(i) {
|
|
|
45
45
|
hideAt: ["sm", "md"],
|
|
46
46
|
className: o.customer,
|
|
47
47
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ t(c, { size: "xxs", children: [
|
|
49
49
|
"Acct: ",
|
|
50
50
|
e == null ? void 0 : e.number
|
|
51
51
|
] }),
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ t(c, { size: "sm", variant: "display", colorToken: "links", children: [
|
|
53
53
|
"Hello ",
|
|
54
54
|
e == null ? void 0 : e.name
|
|
55
55
|
] })
|
|
56
56
|
]
|
|
57
57
|
}
|
|
58
58
|
),
|
|
59
|
-
e.avatar ?? (e.initials ? /* @__PURE__ */
|
|
59
|
+
e.avatar ?? (e.initials ? /* @__PURE__ */ n(u, { initials: e.initials }) : null)
|
|
60
60
|
]
|
|
61
61
|
}
|
|
62
62
|
),
|
|
63
63
|
children: a
|
|
64
64
|
}
|
|
65
|
-
) : /* @__PURE__ */
|
|
65
|
+
) : /* @__PURE__ */ t(
|
|
66
66
|
"div",
|
|
67
67
|
{
|
|
68
68
|
className: g(o.loggedIn, m(s), r),
|
|
69
69
|
...l,
|
|
70
70
|
children: [
|
|
71
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ t(
|
|
72
72
|
d,
|
|
73
73
|
{
|
|
74
74
|
flexDirection: "column",
|
|
@@ -76,18 +76,15 @@ function _(i) {
|
|
|
76
76
|
hideAt: ["sm", "md"],
|
|
77
77
|
className: o.customer,
|
|
78
78
|
children: [
|
|
79
|
-
/* @__PURE__ */ n(c, { size: "xxs", children:
|
|
80
|
-
|
|
81
|
-
e == null ? void 0 : e.number
|
|
82
|
-
] }),
|
|
83
|
-
/* @__PURE__ */ n(c, { size: "sm", variant: "display", colorToken: "links", children: [
|
|
79
|
+
/* @__PURE__ */ n(c, { size: "xxs", children: e == null ? void 0 : e.number }),
|
|
80
|
+
/* @__PURE__ */ t(c, { size: "sm", variant: "display", colorToken: "links", children: [
|
|
84
81
|
"Hello ",
|
|
85
82
|
e == null ? void 0 : e.name
|
|
86
83
|
] })
|
|
87
84
|
]
|
|
88
85
|
}
|
|
89
86
|
),
|
|
90
|
-
e.avatar ?? (e.initials ? /* @__PURE__ */
|
|
87
|
+
e.avatar ?? (e.initials ? /* @__PURE__ */ n(u, { initials: e.initials }) : null)
|
|
91
88
|
]
|
|
92
89
|
}
|
|
93
90
|
);
|
|
@@ -101,7 +98,7 @@ function N(i) {
|
|
|
101
98
|
isAccountLoading: h,
|
|
102
99
|
...l
|
|
103
100
|
} = i;
|
|
104
|
-
return /* @__PURE__ */
|
|
101
|
+
return /* @__PURE__ */ t(
|
|
105
102
|
d,
|
|
106
103
|
{
|
|
107
104
|
flexDirection: "row",
|
|
@@ -113,7 +110,7 @@ function N(i) {
|
|
|
113
110
|
r
|
|
114
111
|
),
|
|
115
112
|
children: [
|
|
116
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ n(
|
|
117
114
|
p,
|
|
118
115
|
{
|
|
119
116
|
onClick: e,
|
|
@@ -123,7 +120,7 @@ function N(i) {
|
|
|
123
120
|
children: "Sign In / Register"
|
|
124
121
|
}
|
|
125
122
|
),
|
|
126
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ n(f, { iconKey: "fa-kit fa-user-anon", size: "lg", hideAt: "lg" })
|
|
127
124
|
]
|
|
128
125
|
}
|
|
129
126
|
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ImageViewerProps {
|
|
2
|
+
imgSrc: string;
|
|
3
|
+
zoomFactor?: number;
|
|
4
|
+
minZoomScale?: number;
|
|
5
|
+
maxZoomScale?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function ImageViewer({ imgSrc, zoomFactor, // Default 10% per wheel notch
|
|
8
|
+
minZoomScale, maxZoomScale, }: ImageViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsx as U } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as o, useEffect as Q } from "react";
|
|
3
|
+
function Z({
|
|
4
|
+
imgSrc: j,
|
|
5
|
+
zoomFactor: O = 1.1,
|
|
6
|
+
// Default 10% per wheel notch
|
|
7
|
+
minZoomScale: x = 1,
|
|
8
|
+
maxZoomScale: z = 5
|
|
9
|
+
// 500%
|
|
10
|
+
}) {
|
|
11
|
+
const D = o(null), a = o(null), d = o(null), h = o(1), g = o(0), p = o(0), P = o(null), y = o(!1), A = o(0), b = o(0), W = o(0), B = o(0), R = o(!1), u = o(/* @__PURE__ */ new Map()), T = o(0), q = o(1), L = o({ x: 0, y: 0 });
|
|
12
|
+
Q(() => {
|
|
13
|
+
const t = a.current, n = D.current;
|
|
14
|
+
if (!t || !n) return;
|
|
15
|
+
const s = () => {
|
|
16
|
+
const e = n.getBoundingClientRect();
|
|
17
|
+
t.height = e.height, t.width = e.width;
|
|
18
|
+
const c = t.getContext("2d");
|
|
19
|
+
c && (c.setTransform(1, 0, 0, 1, 0, 0), d.current = c, k());
|
|
20
|
+
};
|
|
21
|
+
s();
|
|
22
|
+
const r = new ResizeObserver(s);
|
|
23
|
+
return r.observe(n), s(), () => r.disconnect();
|
|
24
|
+
}, []);
|
|
25
|
+
const k = () => {
|
|
26
|
+
const t = a.current;
|
|
27
|
+
if (!d.current || !t) return;
|
|
28
|
+
d.current.clearRect(0, 0, t.width, t.height);
|
|
29
|
+
const n = new Image();
|
|
30
|
+
n.crossOrigin = "anonymous", n.src = j, n.onload = () => {
|
|
31
|
+
P.current = n, Y();
|
|
32
|
+
};
|
|
33
|
+
}, Y = () => {
|
|
34
|
+
const t = a.current, n = P.current;
|
|
35
|
+
if (!d.current || !t || !n) return;
|
|
36
|
+
const s = n.width / 2, r = n.height / 2, e = t.width / 2, c = t.height / 2, i = e - s, f = c - r;
|
|
37
|
+
h.current = 1, g.current = i, p.current = f, v();
|
|
38
|
+
}, E = (t) => {
|
|
39
|
+
const n = a.current;
|
|
40
|
+
if (!d.current || !n) return;
|
|
41
|
+
const s = t.deltaY < 0 ? O : 1 / O, r = h.current;
|
|
42
|
+
let e = r * s;
|
|
43
|
+
if (e = Math.max(x, Math.min(z, e)), h.current = e, e === x) {
|
|
44
|
+
Y();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const { x: c, y: i } = X(t, n), f = (c - g.current) / r, w = (i - p.current) / r, m = c - f * e, l = i - w * e;
|
|
48
|
+
g.current = m, p.current = l, v();
|
|
49
|
+
}, H = (t) => {
|
|
50
|
+
var r;
|
|
51
|
+
const n = a.current;
|
|
52
|
+
if (!d.current || !n) return;
|
|
53
|
+
(r = a.current) == null || r.setPointerCapture(t.pointerId);
|
|
54
|
+
const s = X(t, n);
|
|
55
|
+
if (u.current.set(t.pointerId, s), u.current.size === 2) {
|
|
56
|
+
R.current = !0, y.current = !1;
|
|
57
|
+
const [e, c] = Array.from(u.current.values()), i = e.x - c.x, f = e.y - c.y, w = Math.sqrt(i * i + f * f);
|
|
58
|
+
T.current = w, q.current = h.current;
|
|
59
|
+
const m = (e.x + c.x) / 2, l = (e.y + c.y) / 2, M = (m - g.current) / h.current, C = (l - p.current) / h.current;
|
|
60
|
+
L.current = { x: M, y: C }, R.current = !0;
|
|
61
|
+
} else if (u.current.size === 1) {
|
|
62
|
+
const [e] = Array.from(u.current.values());
|
|
63
|
+
A.current = e.x, b.current = e.y, W.current = g.current, B.current = p.current, y.current = !0;
|
|
64
|
+
}
|
|
65
|
+
}, S = (t) => {
|
|
66
|
+
const n = a.current;
|
|
67
|
+
if (!d.current || !n) return;
|
|
68
|
+
const s = X(t, n);
|
|
69
|
+
if (u.current.has(t.pointerId)) {
|
|
70
|
+
if (u.current.set(t.pointerId, s), R.current && u.current.size === 2) {
|
|
71
|
+
const [r, e] = Array.from(u.current.values()), c = r.x - e.x, i = r.y - e.y, f = Math.sqrt(c * c + i * i), w = T.current;
|
|
72
|
+
if (w === 0) return;
|
|
73
|
+
const m = f / w;
|
|
74
|
+
let l = q.current * m;
|
|
75
|
+
if (l = Math.max(x, Math.min(z, l)), l === x) {
|
|
76
|
+
Y();
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const M = (r.x + e.x) / 2, C = (r.y + e.y) / 2, { x: G, y: J } = L.current, K = M - G * l, N = C - J * l;
|
|
80
|
+
h.current = l, g.current = K, p.current = N, v();
|
|
81
|
+
} else if (y.current && u.current.size === 1) {
|
|
82
|
+
const r = n.getBoundingClientRect(), e = t.clientX - r.left, c = t.clientY - r.top, i = e - A.current, f = c - b.current;
|
|
83
|
+
g.current = W.current + i, p.current = B.current + f, v();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}, I = (t) => {
|
|
87
|
+
u.current.delete(t.pointerId), u.current.size < 2 && (R.current = !1), u.current.size === 0 && (y.current = !1);
|
|
88
|
+
const n = a.current;
|
|
89
|
+
!d.current || !n || n.releasePointerCapture(t.pointerId);
|
|
90
|
+
}, V = I, F = I, X = (t, n) => {
|
|
91
|
+
const s = n.getBoundingClientRect();
|
|
92
|
+
return {
|
|
93
|
+
x: t.clientX - s.left,
|
|
94
|
+
y: t.clientY - s.top
|
|
95
|
+
};
|
|
96
|
+
}, v = () => {
|
|
97
|
+
const t = a.current, n = d.current, s = P.current;
|
|
98
|
+
!t || !n || !s || (n.setTransform(1, 0, 0, 1, 0, 0), n.clearRect(0, 0, t.width, t.height), n.setTransform(
|
|
99
|
+
h.current,
|
|
100
|
+
0,
|
|
101
|
+
0,
|
|
102
|
+
h.current,
|
|
103
|
+
g.current,
|
|
104
|
+
p.current
|
|
105
|
+
), n.drawImage(s, 0, 0));
|
|
106
|
+
};
|
|
107
|
+
return /* @__PURE__ */ U("div", { ref: D, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ U(
|
|
108
|
+
"canvas",
|
|
109
|
+
{
|
|
110
|
+
ref: a,
|
|
111
|
+
style: { width: "100%", height: "100%", display: "block", touchAction: "none" },
|
|
112
|
+
onWheel: E,
|
|
113
|
+
onPointerDown: H,
|
|
114
|
+
onPointerMove: S,
|
|
115
|
+
onPointerUp: I,
|
|
116
|
+
onPointerLeave: V,
|
|
117
|
+
onPointerCancel: F
|
|
118
|
+
}
|
|
119
|
+
) });
|
|
120
|
+
}
|
|
121
|
+
export {
|
|
122
|
+
Z as ImageViewer
|
|
123
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { ImageViewer as o } from "./ImageViewer.js";
|
|
3
|
+
const r = {
|
|
4
|
+
title: "Case Parts/Molecules/ImageViewer",
|
|
5
|
+
component: o,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: "fullscreen"
|
|
8
|
+
},
|
|
9
|
+
argTypes: {
|
|
10
|
+
imgSrc: { control: "text" },
|
|
11
|
+
zoomFactor: { control: { type: "number", min: 1, max: 2, step: 0.01 } },
|
|
12
|
+
minZoomScale: { control: { type: "number", min: 0.1, max: 2, step: 0.1 } },
|
|
13
|
+
maxZoomScale: { control: { type: "number", min: 2, max: 10, step: 0.5 } }
|
|
14
|
+
},
|
|
15
|
+
decorators: [
|
|
16
|
+
(t) => /* @__PURE__ */ e("div", { style: { height: "90dvh", width: "100%" }, children: /* @__PURE__ */ e(t, {}) })
|
|
17
|
+
]
|
|
18
|
+
}, c = {
|
|
19
|
+
name: "Default",
|
|
20
|
+
args: {
|
|
21
|
+
imgSrc: "https://cdnimg.webstaurantstore.com/images/products/large/573147/2989461.jpg",
|
|
22
|
+
zoomFactor: 1.1,
|
|
23
|
+
minZoomScale: 1,
|
|
24
|
+
maxZoomScale: 5
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
c as Default,
|
|
29
|
+
r as default
|
|
30
|
+
};
|
|
@@ -59,6 +59,10 @@ declare const meta: {
|
|
|
59
59
|
results?: number | undefined;
|
|
60
60
|
security?: string | undefined;
|
|
61
61
|
unselectable?: "on" | "off" | undefined;
|
|
62
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined;
|
|
63
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
64
|
+
popoverTarget?: string | undefined;
|
|
65
|
+
inert?: boolean | undefined;
|
|
62
66
|
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
63
67
|
is?: string | undefined;
|
|
64
68
|
exportparts?: string | undefined;
|
|
@@ -268,6 +272,8 @@ declare const meta: {
|
|
|
268
272
|
onLostPointerCaptureCapture?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
269
273
|
onScroll?: import('react').UIEventHandler<HTMLDivElement> | undefined;
|
|
270
274
|
onScrollCapture?: import('react').UIEventHandler<HTMLDivElement> | undefined;
|
|
275
|
+
onScrollEnd?: import('react').UIEventHandler<HTMLDivElement> | undefined;
|
|
276
|
+
onScrollEndCapture?: import('react').UIEventHandler<HTMLDivElement> | undefined;
|
|
271
277
|
onWheel?: import('react').WheelEventHandler<HTMLDivElement> | undefined;
|
|
272
278
|
onWheelCapture?: import('react').WheelEventHandler<HTMLDivElement> | undefined;
|
|
273
279
|
onAnimationStart?: import('react').AnimationEventHandler<HTMLDivElement> | undefined;
|
|
@@ -276,8 +282,16 @@ declare const meta: {
|
|
|
276
282
|
onAnimationEndCapture?: import('react').AnimationEventHandler<HTMLDivElement> | undefined;
|
|
277
283
|
onAnimationIteration?: import('react').AnimationEventHandler<HTMLDivElement> | undefined;
|
|
278
284
|
onAnimationIterationCapture?: import('react').AnimationEventHandler<HTMLDivElement> | undefined;
|
|
285
|
+
onToggle?: import('react').ToggleEventHandler<HTMLDivElement> | undefined;
|
|
286
|
+
onBeforeToggle?: import('react').ToggleEventHandler<HTMLDivElement> | undefined;
|
|
287
|
+
onTransitionCancel?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
288
|
+
onTransitionCancelCapture?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
279
289
|
onTransitionEnd?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
280
290
|
onTransitionEndCapture?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
291
|
+
onTransitionRun?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
292
|
+
onTransitionRunCapture?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
293
|
+
onTransitionStart?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
294
|
+
onTransitionStartCapture?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
281
295
|
}>, context: import('storybook/internal/csf').StoryContext<import('@storybook/react').ReactRenderer, {
|
|
282
296
|
variant?: ("color" | "white") | undefined;
|
|
283
297
|
defaultChecked?: boolean | undefined;
|
|
@@ -327,6 +341,10 @@ declare const meta: {
|
|
|
327
341
|
results?: number | undefined;
|
|
328
342
|
security?: string | undefined;
|
|
329
343
|
unselectable?: "on" | "off" | undefined;
|
|
344
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined;
|
|
345
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
346
|
+
popoverTarget?: string | undefined;
|
|
347
|
+
inert?: boolean | undefined;
|
|
330
348
|
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
331
349
|
is?: string | undefined;
|
|
332
350
|
exportparts?: string | undefined;
|
|
@@ -536,6 +554,8 @@ declare const meta: {
|
|
|
536
554
|
onLostPointerCaptureCapture?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
537
555
|
onScroll?: import('react').UIEventHandler<HTMLDivElement> | undefined;
|
|
538
556
|
onScrollCapture?: import('react').UIEventHandler<HTMLDivElement> | undefined;
|
|
557
|
+
onScrollEnd?: import('react').UIEventHandler<HTMLDivElement> | undefined;
|
|
558
|
+
onScrollEndCapture?: import('react').UIEventHandler<HTMLDivElement> | undefined;
|
|
539
559
|
onWheel?: import('react').WheelEventHandler<HTMLDivElement> | undefined;
|
|
540
560
|
onWheelCapture?: import('react').WheelEventHandler<HTMLDivElement> | undefined;
|
|
541
561
|
onAnimationStart?: import('react').AnimationEventHandler<HTMLDivElement> | undefined;
|
|
@@ -544,8 +564,16 @@ declare const meta: {
|
|
|
544
564
|
onAnimationEndCapture?: import('react').AnimationEventHandler<HTMLDivElement> | undefined;
|
|
545
565
|
onAnimationIteration?: import('react').AnimationEventHandler<HTMLDivElement> | undefined;
|
|
546
566
|
onAnimationIterationCapture?: import('react').AnimationEventHandler<HTMLDivElement> | undefined;
|
|
567
|
+
onToggle?: import('react').ToggleEventHandler<HTMLDivElement> | undefined;
|
|
568
|
+
onBeforeToggle?: import('react').ToggleEventHandler<HTMLDivElement> | undefined;
|
|
569
|
+
onTransitionCancel?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
570
|
+
onTransitionCancelCapture?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
547
571
|
onTransitionEnd?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
548
572
|
onTransitionEndCapture?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
573
|
+
onTransitionRun?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
574
|
+
onTransitionRunCapture?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
575
|
+
onTransitionStart?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
576
|
+
onTransitionStartCapture?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
549
577
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
550
578
|
};
|
|
551
579
|
export default meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { HideAtProps } from '../../atoms/HideAt';
|
|
3
|
-
export interface ToggleViewProps extends React.HTMLAttributes<HTMLDivElement>, HideAtProps {
|
|
3
|
+
export interface ToggleViewProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onToggle">, HideAtProps {
|
|
4
4
|
selectedId: string | number;
|
|
5
5
|
onToggle: (id: string | number) => void;
|
|
6
6
|
className?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React, CSSProperties, ComponentType } from 'react';
|
|
2
|
-
type
|
|
2
|
+
export type SpinZoomViewerProps = {
|
|
3
3
|
images: string[];
|
|
4
4
|
defaultIndex?: number;
|
|
5
5
|
disableSpin?: boolean;
|
|
@@ -16,5 +16,6 @@ type SpinZoom360Props = {
|
|
|
16
16
|
src: string;
|
|
17
17
|
}) => void;
|
|
18
18
|
};
|
|
19
|
-
declare const SpinZoomViewer: React.FC<
|
|
19
|
+
declare const SpinZoomViewer: React.FC<SpinZoomViewerProps>;
|
|
20
20
|
export default SpinZoomViewer;
|
|
21
|
+
export { SpinZoomViewer };
|