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