@optiaxiom/proteus 0.3.0 → 1.1.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/esm/_virtual/_openai-shim-script.js +3 -2
- package/dist/esm/assets/src/proteus-chart/{ProteusChart.css.ts.vanilla-DNE5j3uT.css → ProteusChart.css.ts.vanilla-yGx8JdKz.css} +2 -2
- package/dist/esm/assets/src/proteus-chart/{ProteusChartTooltipContent.css.ts.vanilla-DM8u1icS.css → ProteusChartTooltipContent.css.ts.vanilla-HapBe2oo.css} +2 -2
- package/dist/esm/assets/src/proteus-document/{ProteusDocumentShell.css.ts.vanilla-DjZJuQ2A.css → ProteusDocumentShell.css.ts.vanilla-BPytQ9pT.css} +2 -2
- package/dist/esm/assets/src/proteus-image-carousel/{ProteusImageCarousel.css.ts.vanilla-CIwMJ4Cg.css → ProteusImageCarousel.css.ts.vanilla-DnlXoyv1.css} +2 -2
- package/dist/esm/assets/src/proteus-question/{ProteusQuestion.css.ts.vanilla-DiCe_bxf.css → ProteusQuestion.css.ts.vanilla-CpDgoW0l.css} +2 -2
- package/dist/esm/hooks/useEffectEvent.js +11 -10
- package/dist/esm/hooks/useObserveValue.js +24 -30
- package/dist/esm/icons/IconAngleLeft.js +13 -19
- package/dist/esm/icons/IconAngleRight.js +13 -19
- package/dist/esm/icons/IconX.js +10 -18
- package/dist/esm/icons/withIcon.js +17 -28
- package/dist/esm/index.js +22 -17
- package/dist/esm/proteus-action/ProteusAction.js +44 -39
- package/dist/esm/proteus-bridge/ProteusBridge.js +71 -85
- package/dist/esm/proteus-card-link/ProteusCardLink.js +24 -37
- package/dist/esm/proteus-chart/ProteusChart-css.js +14 -5
- package/dist/esm/proteus-chart/ProteusChart.js +86 -84
- package/dist/esm/proteus-chart/ProteusChartContext.js +3 -3
- package/dist/esm/proteus-chart/ProteusChartTooltipContent-css.js +23 -6
- package/dist/esm/proteus-chart/ProteusChartTooltipContent.js +52 -66
- package/dist/esm/proteus-data-table/ProteusDataTable.js +28 -29
- package/dist/esm/proteus-date-input/ProteusDateInput.js +23 -0
- package/dist/esm/proteus-document/ProteusDocumentContext.js +4 -3
- package/dist/esm/proteus-document/ProteusDocumentPathContext.js +6 -5
- package/dist/esm/proteus-document/ProteusDocumentRenderer.js +25 -33
- package/dist/esm/proteus-document/ProteusDocumentShell-css.js +32 -6
- package/dist/esm/proteus-document/ProteusDocumentShell.js +226 -219
- package/dist/esm/proteus-document/getProteusValue.js +28 -42
- package/dist/esm/proteus-document/resolveProteusProp.js +31 -49
- package/dist/esm/proteus-document/resolveProteusValue.js +73 -136
- package/dist/esm/proteus-document/schemas.js +42 -45
- package/dist/esm/proteus-document/useResolveProteusValues.js +10 -16
- package/dist/esm/proteus-element/ProteusElement.js +114 -180
- package/dist/esm/proteus-federated/ProteusFederated.js +51 -52
- package/dist/esm/proteus-file-icon/ProteusFileIcon.js +29 -38
- package/dist/esm/proteus-file-upload/ProteusFileUpload.js +107 -133
- package/dist/esm/proteus-image/ProteusImage.js +99 -106
- package/dist/esm/proteus-image/downloadFile.js +3 -2
- package/dist/esm/proteus-image-carousel/ProteusImageCarousel-css.js +49 -11
- package/dist/esm/proteus-image-carousel/ProteusImageCarousel.js +151 -163
- package/dist/esm/proteus-input/ProteusInput.js +19 -27
- package/dist/esm/proteus-length/ProteusLength.js +10 -0
- package/dist/esm/proteus-map/ProteusMap.js +18 -31
- package/dist/esm/proteus-map-index/ProteusMapIndex.js +11 -0
- package/dist/esm/proteus-pill-menu/ProteusPillMenu.js +65 -0
- package/dist/esm/proteus-pill-menu/useInputValueChangeInteraction.js +36 -0
- package/dist/esm/proteus-question/ProteusQuestion-css.js +40 -8
- package/dist/esm/proteus-question/ProteusQuestion.js +324 -400
- package/dist/esm/proteus-select/ProteusSelect.js +25 -40
- package/dist/esm/proteus-show/ProteusShow.js +10 -18
- package/dist/esm/proteus-switch/ProteusSwitch.js +33 -36
- package/dist/esm/proteus-textarea/ProteusTextarea.js +18 -27
- package/dist/esm/proteus-value/ProteusValue.js +4 -4
- package/dist/esm/schema/public-schema.js +4537 -0
- package/dist/esm/schema/runtime-schema.js +4460 -0
- package/dist/esm/spec.js +5 -1
- package/dist/esm/use-proteus-value/useProteusValue.js +8 -12
- package/dist/index.d.ts +516 -347
- package/dist/spec.d.ts +5 -9952
- package/package.json +5 -5
- package/dist/esm/icons/IconCalendar.js +0 -20
- package/dist/esm/schema/public-schema.json.js +0 -9041
- package/dist/esm/schema/runtime-schema.json.js +0 -8974
|
@@ -1,137 +1,111 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useRef, useState
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
function ProteusFileUpload({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
{
|
|
109
|
-
accept,
|
|
110
|
-
disabled: !onUpload || readOnly || atMax,
|
|
111
|
-
onFilesDrop: handleFilesDrop,
|
|
112
|
-
children: [
|
|
113
|
-
/* @__PURE__ */ jsx(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
114
|
-
"input",
|
|
115
|
-
{
|
|
116
|
-
"aria-hidden": true,
|
|
117
|
-
defaultValue: 0,
|
|
118
|
-
max: maxFiles !== void 0 ? String(maxFiles) : void 0,
|
|
119
|
-
min: String(minFiles),
|
|
120
|
-
name,
|
|
121
|
-
ref: inputRef,
|
|
122
|
-
tabIndex: -1,
|
|
123
|
-
type: "number"
|
|
124
|
-
}
|
|
125
|
-
) }),
|
|
126
|
-
items.length > 0 ? /* @__PURE__ */ jsxs(Flex, { flexDirection: "column", gap: "8", children: [
|
|
127
|
-
multiple && !atMax && /* @__PURE__ */ jsx(FileUploadTrigger, { alignSelf: "end", icon: /* @__PURE__ */ jsx(IconPlus, {}), children: "Add File" }),
|
|
128
|
-
/* @__PURE__ */ jsx(FileUploadList, { items, onRemove: handleRemove }),
|
|
129
|
-
!atMax && /* @__PURE__ */ jsx(FileUploadDropzone, { overlay: true })
|
|
130
|
-
] }) : /* @__PURE__ */ jsx(FileUploadDropzone, { children: /* @__PURE__ */ jsx(FileUploadTrigger, {}) })
|
|
131
|
-
]
|
|
132
|
-
}
|
|
133
|
-
);
|
|
2
|
+
import { useProteusDocumentContext } from "../proteus-document/ProteusDocumentContext.js";
|
|
3
|
+
import { useProteusDocumentPathContext } from "../proteus-document/ProteusDocumentPathContext.js";
|
|
4
|
+
import { useObserveValue } from "../hooks/useObserveValue.js";
|
|
5
|
+
import { Flex, toaster } from "@optiaxiom/react";
|
|
6
|
+
import { useCallback, useRef, useState } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { FileUpload, FileUploadDropzone, FileUploadList, FileUploadTrigger, VisuallyHidden } from "@optiaxiom/react/unstable";
|
|
9
|
+
import { IconPlus } from "@optiaxiom/icons";
|
|
10
|
+
//#region src/proteus-file-upload/ProteusFileUpload.tsx
|
|
11
|
+
function ProteusFileUpload({ accept, maxFiles, minFiles = 0, name }) {
|
|
12
|
+
const { onDataChange, onUpload, readOnly } = useProteusDocumentContext("@optiaxiom/proteus/ProteusFileUpload");
|
|
13
|
+
const { path: parentPath } = useProteusDocumentPathContext("@optiaxiom/proteus/ProteusFileUpload");
|
|
14
|
+
const inputRef = useRef(null);
|
|
15
|
+
const itemsRef = useRef([]);
|
|
16
|
+
const [items, setItems] = useState([]);
|
|
17
|
+
const forceValueChange = useObserveValue(inputRef);
|
|
18
|
+
const multiple = maxFiles !== 1;
|
|
19
|
+
const atMax = multiple && maxFiles !== void 0 && items.length >= maxFiles;
|
|
20
|
+
const writeValue = useCallback(() => {
|
|
21
|
+
setItems(itemsRef.current);
|
|
22
|
+
if (inputRef.current) forceValueChange(itemsRef.current.filter((item) => item.status === "complete").length.toString());
|
|
23
|
+
if (name) {
|
|
24
|
+
const value = itemsRef.current.filter((item) => item.status === "complete").map((item) => item.metadata).filter((metadata) => !!metadata);
|
|
25
|
+
onDataChange?.(`${parentPath}/${name}`, value);
|
|
26
|
+
}
|
|
27
|
+
}, [
|
|
28
|
+
forceValueChange,
|
|
29
|
+
name,
|
|
30
|
+
onDataChange,
|
|
31
|
+
parentPath
|
|
32
|
+
]);
|
|
33
|
+
const handleFilesDrop = useCallback(async (incoming) => {
|
|
34
|
+
let skipped = 0;
|
|
35
|
+
if (maxFiles !== void 0) {
|
|
36
|
+
const existing = multiple ? itemsRef.current.length : 0;
|
|
37
|
+
const remaining = Math.max(0, maxFiles - existing);
|
|
38
|
+
if (incoming.length > remaining) {
|
|
39
|
+
skipped = incoming.length - remaining;
|
|
40
|
+
incoming = incoming.slice(0, remaining);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (skipped > 0) {
|
|
44
|
+
const accepted = incoming.length;
|
|
45
|
+
const skippedWord = skipped === 1 ? "was" : "were";
|
|
46
|
+
toaster.create(accepted > 0 ? `Added ${accepted} file${accepted === 1 ? "" : "s"}. ${skipped} ${skippedWord} skipped because the limit is ${maxFiles}.` : `${skipped} file${skipped === 1 ? "" : "s"} ${skippedWord} skipped because the limit is ${maxFiles}.`, { type: "warning" });
|
|
47
|
+
}
|
|
48
|
+
if (!onUpload || readOnly || incoming.length === 0) return;
|
|
49
|
+
itemsRef.current = [...multiple ? itemsRef.current : [], ...incoming.map((file) => ({
|
|
50
|
+
file,
|
|
51
|
+
status: "uploading"
|
|
52
|
+
}))];
|
|
53
|
+
writeValue();
|
|
54
|
+
const result = new Map(await Promise.all(incoming.map((file) => onUpload(file).then((metadata) => [file, {
|
|
55
|
+
file,
|
|
56
|
+
metadata,
|
|
57
|
+
status: "complete"
|
|
58
|
+
}]).catch(() => [file, {
|
|
59
|
+
file,
|
|
60
|
+
status: "error"
|
|
61
|
+
}]))));
|
|
62
|
+
itemsRef.current = itemsRef.current.map((item) => result.get(item.file) ?? item);
|
|
63
|
+
writeValue();
|
|
64
|
+
}, [
|
|
65
|
+
maxFiles,
|
|
66
|
+
multiple,
|
|
67
|
+
onUpload,
|
|
68
|
+
readOnly,
|
|
69
|
+
writeValue
|
|
70
|
+
]);
|
|
71
|
+
const handleRemove = useCallback((item) => {
|
|
72
|
+
itemsRef.current = itemsRef.current.filter((i) => i !== item);
|
|
73
|
+
writeValue();
|
|
74
|
+
}, [writeValue]);
|
|
75
|
+
return /* @__PURE__ */ jsxs(FileUpload, {
|
|
76
|
+
accept,
|
|
77
|
+
disabled: !onUpload || readOnly || atMax,
|
|
78
|
+
onFilesDrop: handleFilesDrop,
|
|
79
|
+
children: [/* @__PURE__ */ jsx(VisuallyHidden, {
|
|
80
|
+
asChild: true,
|
|
81
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
82
|
+
"aria-hidden": true,
|
|
83
|
+
defaultValue: 0,
|
|
84
|
+
max: maxFiles !== void 0 ? String(maxFiles) : void 0,
|
|
85
|
+
min: String(minFiles),
|
|
86
|
+
name,
|
|
87
|
+
ref: inputRef,
|
|
88
|
+
tabIndex: -1,
|
|
89
|
+
type: "number"
|
|
90
|
+
})
|
|
91
|
+
}), items.length > 0 ? /* @__PURE__ */ jsxs(Flex, {
|
|
92
|
+
flexDirection: "column",
|
|
93
|
+
gap: "8",
|
|
94
|
+
children: [
|
|
95
|
+
multiple && !atMax && /* @__PURE__ */ jsx(FileUploadTrigger, {
|
|
96
|
+
alignSelf: "end",
|
|
97
|
+
icon: /* @__PURE__ */ jsx(IconPlus, {}),
|
|
98
|
+
children: "Add File"
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ jsx(FileUploadList, {
|
|
101
|
+
items,
|
|
102
|
+
onRemove: handleRemove
|
|
103
|
+
}),
|
|
104
|
+
!atMax && /* @__PURE__ */ jsx(FileUploadDropzone, { overlay: true })
|
|
105
|
+
]
|
|
106
|
+
}) : /* @__PURE__ */ jsx(FileUploadDropzone, { children: /* @__PURE__ */ jsx(FileUploadTrigger, {}) })]
|
|
107
|
+
});
|
|
134
108
|
}
|
|
135
109
|
ProteusFileUpload.displayName = "@optiaxiom/proteus/ProteusFileUpload";
|
|
136
|
-
|
|
110
|
+
//#endregion
|
|
137
111
|
export { ProteusFileUpload };
|
|
@@ -1,111 +1,104 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { Box,
|
|
4
|
-
import { useState } from
|
|
5
|
-
import {
|
|
6
|
-
|
|
2
|
+
import { useProteusDocumentContext } from "../proteus-document/ProteusDocumentContext.js";
|
|
3
|
+
import { Box, Button, Dialog, DialogBody, DialogClose, DialogContent, DialogFooter, DialogHeader, DialogTrigger, Spinner } from "@optiaxiom/react";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/proteus-image/ProteusImage.tsx
|
|
7
7
|
function ProteusImage(props) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
children: /* @__PURE__ */ jsx("a", { download: true, href: props.src, children: "Download" })
|
|
102
|
-
}
|
|
103
|
-
)
|
|
104
|
-
] })
|
|
105
|
-
] })
|
|
106
|
-
] })
|
|
107
|
-
] });
|
|
8
|
+
const { onEvent } = useProteusDocumentContext("@optiaxiom/proteus/ProteusImage");
|
|
9
|
+
const [open, setOpen] = useState(false);
|
|
10
|
+
const [isDownloading, setIsDownloading] = useState(false);
|
|
11
|
+
const [isLoaded, setIsLoaded] = useState(false);
|
|
12
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [!isLoaded && /* @__PURE__ */ jsx(Box, {
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
bg: "bg.tertiary",
|
|
15
|
+
display: "flex",
|
|
16
|
+
justifyContent: "center",
|
|
17
|
+
p: "24",
|
|
18
|
+
rounded: "md",
|
|
19
|
+
style: { aspectRatio: "16 / 9" },
|
|
20
|
+
w: "full",
|
|
21
|
+
...props,
|
|
22
|
+
children: /* @__PURE__ */ jsx(Spinner, {})
|
|
23
|
+
}), /* @__PURE__ */ jsxs(Dialog, {
|
|
24
|
+
onOpenChange: setOpen,
|
|
25
|
+
open,
|
|
26
|
+
children: [/* @__PURE__ */ jsx(DialogTrigger, {
|
|
27
|
+
"aria-label": "Expand",
|
|
28
|
+
asChild: true,
|
|
29
|
+
children: /* @__PURE__ */ jsx(Box, {
|
|
30
|
+
asChild: true,
|
|
31
|
+
cursor: "pointer",
|
|
32
|
+
display: isLoaded ? "flex" : "none",
|
|
33
|
+
objectFit: "contain",
|
|
34
|
+
overflow: "hidden",
|
|
35
|
+
rounded: "inherit",
|
|
36
|
+
size: "full",
|
|
37
|
+
...props,
|
|
38
|
+
children: /* @__PURE__ */ jsx("img", {
|
|
39
|
+
alt: props.alt,
|
|
40
|
+
draggable: true,
|
|
41
|
+
onDragStart: (event) => {
|
|
42
|
+
event.stopPropagation();
|
|
43
|
+
event.dataTransfer.effectAllowed = "copy";
|
|
44
|
+
event.dataTransfer.setData("opal-chat-dnd-data", JSON.stringify({
|
|
45
|
+
link: props.src,
|
|
46
|
+
mime_type: "image/*",
|
|
47
|
+
name: props.src?.split("/").pop()
|
|
48
|
+
}));
|
|
49
|
+
},
|
|
50
|
+
onLoad: () => setIsLoaded(true),
|
|
51
|
+
src: props.src
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
}), /* @__PURE__ */ jsxs(DialogContent, {
|
|
55
|
+
size: "fullscreen",
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsx(DialogHeader, {
|
|
58
|
+
lineClamp: "1",
|
|
59
|
+
children: props.alt
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ jsx(DialogBody, {
|
|
62
|
+
overflow: "hidden",
|
|
63
|
+
children: /* @__PURE__ */ jsx(Box, {
|
|
64
|
+
asChild: true,
|
|
65
|
+
display: "block",
|
|
66
|
+
maxH: "full",
|
|
67
|
+
maxW: "full",
|
|
68
|
+
objectFit: "contain",
|
|
69
|
+
children: /* @__PURE__ */ jsx("img", {
|
|
70
|
+
alt: props.alt,
|
|
71
|
+
src: props.src
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ jsxs(DialogFooter, { children: [/* @__PURE__ */ jsx(DialogClose, { children: "Close" }), /* @__PURE__ */ jsx(Button, {
|
|
76
|
+
appearance: "primary",
|
|
77
|
+
asChild: true,
|
|
78
|
+
loading: isDownloading,
|
|
79
|
+
onClick: async (event) => {
|
|
80
|
+
event.preventDefault();
|
|
81
|
+
if (isDownloading) return;
|
|
82
|
+
setIsDownloading(true);
|
|
83
|
+
try {
|
|
84
|
+
await onEvent({
|
|
85
|
+
action: "download",
|
|
86
|
+
url: String(props.src)
|
|
87
|
+
});
|
|
88
|
+
} finally {
|
|
89
|
+
setIsDownloading(false);
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
children: /* @__PURE__ */ jsx("a", {
|
|
93
|
+
download: true,
|
|
94
|
+
href: props.src,
|
|
95
|
+
children: "Download"
|
|
96
|
+
})
|
|
97
|
+
})] })
|
|
98
|
+
]
|
|
99
|
+
})]
|
|
100
|
+
})] });
|
|
108
101
|
}
|
|
109
102
|
ProteusImage.displayName = "@optiaxiom/proteus/ProteusImage";
|
|
110
|
-
|
|
103
|
+
//#endregion
|
|
111
104
|
export { ProteusImage };
|
|
@@ -1,12 +1,50 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
var carousel = recipe({base:[{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { recipe } from "@optiaxiom/react/css-runtime";
|
|
2
|
+
import "./../assets/src/proteus-image-carousel/ProteusImageCarousel.css.ts.vanilla-DnlXoyv1.css";
|
|
3
|
+
//#region src/proteus-image-carousel/ProteusImageCarousel.css.ts
|
|
4
|
+
var carousel = recipe({ base: [{
|
|
5
|
+
flexDirection: "column",
|
|
6
|
+
gap: "12"
|
|
7
|
+
}, "ProteusImageCarousel__1t6qej70"] });
|
|
8
|
+
var content = recipe({ base: [{
|
|
9
|
+
display: "grid",
|
|
10
|
+
overflow: "hidden",
|
|
11
|
+
rounded: "lg"
|
|
12
|
+
}, "ProteusImageCarousel__1t6qej71"] });
|
|
13
|
+
var navButton = recipe({
|
|
14
|
+
base: [{
|
|
15
|
+
bg: "bg.default",
|
|
16
|
+
display: "grid",
|
|
17
|
+
mx: "16",
|
|
18
|
+
placeItems: "center",
|
|
19
|
+
rounded: "full",
|
|
20
|
+
size: "md",
|
|
21
|
+
transition: "opacity"
|
|
22
|
+
}, "ProteusImageCarousel__1t6qej75"],
|
|
23
|
+
variants: { side: {
|
|
24
|
+
left: [{ mr: "32" }, "ProteusImageCarousel__1t6qej76"],
|
|
25
|
+
right: [{ ml: "32" }, "ProteusImageCarousel__1t6qej77"]
|
|
26
|
+
} }
|
|
27
|
+
});
|
|
28
|
+
var slide = recipe({ base: [{
|
|
29
|
+
objectFit: "cover",
|
|
30
|
+
size: "full"
|
|
31
|
+
}, "ProteusImageCarousel__1t6qej74"] });
|
|
32
|
+
var slideContainer = recipe({ base: [{ size: "full" }, "ProteusImageCarousel__1t6qej73"] });
|
|
33
|
+
var thumbnail = recipe({
|
|
34
|
+
base: [{
|
|
35
|
+
cursor: "pointer",
|
|
36
|
+
flex: "none",
|
|
37
|
+
objectFit: "cover",
|
|
38
|
+
overflow: "hidden",
|
|
39
|
+
rounded: "lg",
|
|
40
|
+
size: "80",
|
|
41
|
+
transition: "opacity"
|
|
42
|
+
}, "ProteusImageCarousel__1t6qej78"],
|
|
43
|
+
variants: { selected: {
|
|
44
|
+
false: "ProteusImageCarousel__1t6qej79",
|
|
45
|
+
true: "ProteusImageCarousel__1t6qej7a"
|
|
46
|
+
} }
|
|
47
|
+
});
|
|
48
|
+
var viewport = recipe({ base: [{ overflow: "hidden" }, "ProteusImageCarousel__1t6qej72"] });
|
|
49
|
+
//#endregion
|
|
12
50
|
export { carousel, content, navButton, slide, slideContainer, thumbnail, viewport };
|