@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,44 +1,29 @@
1
1
  "use client";
2
- import { jsx } from 'react/jsx-runtime';
3
- import { Select } from '@optiaxiom/react';
4
- import { useRef } from 'react';
5
- import { useProteusDocumentContext } from '../proteus-document/ProteusDocumentContext.js';
6
- import { useProteusDocumentPathContext } from '../proteus-document/ProteusDocumentPathContext.js';
7
- import { useProteusValue } from '../use-proteus-value/useProteusValue.js';
8
-
9
- function ProteusSelect({
10
- children,
11
- options = [],
12
- ...props
13
- }) {
14
- const { onDataChange, readOnly } = useProteusDocumentContext(
15
- "@optiaxiom/proteus/ProteusSelect"
16
- );
17
- const { path: parentPath } = useProteusDocumentPathContext(
18
- "@optiaxiom/proteus/ProteusSelect"
19
- );
20
- const optionsRef = useRef(options);
21
- optionsRef.current = options;
22
- const resolved = useProteusValue({ path: props.name ?? "" });
23
- const value = props.name ? String(resolved ?? options[0]?.value ?? "") : options[0]?.value ?? "";
24
- return /* @__PURE__ */ jsx(
25
- Select,
26
- {
27
- ...props,
28
- onValueChange: (value2) => {
29
- if (readOnly) {
30
- return;
31
- }
32
- if (props.name) {
33
- onDataChange?.(`${parentPath}/${props.name}`, value2);
34
- }
35
- },
36
- options,
37
- value,
38
- children
39
- }
40
- );
2
+ import { useProteusDocumentContext } from "../proteus-document/ProteusDocumentContext.js";
3
+ import { useProteusDocumentPathContext } from "../proteus-document/ProteusDocumentPathContext.js";
4
+ import { useProteusValue } from "../use-proteus-value/useProteusValue.js";
5
+ import { Select } from "@optiaxiom/react";
6
+ import { useRef } from "react";
7
+ import { jsx } from "react/jsx-runtime";
8
+ //#region src/proteus-select/ProteusSelect.tsx
9
+ function ProteusSelect({ children, options = [], ...props }) {
10
+ const { onDataChange, readOnly } = useProteusDocumentContext("@optiaxiom/proteus/ProteusSelect");
11
+ const { path: parentPath } = useProteusDocumentPathContext("@optiaxiom/proteus/ProteusSelect");
12
+ const optionsRef = useRef(options);
13
+ optionsRef.current = options;
14
+ const resolved = useProteusValue({ path: props.name ?? "" });
15
+ const value = props.name ? String(resolved ?? options[0]?.value ?? "") : options[0]?.value ?? "";
16
+ return /* @__PURE__ */ jsx(Select, {
17
+ ...props,
18
+ onValueChange: (value) => {
19
+ if (readOnly) return;
20
+ if (props.name) onDataChange?.(`${parentPath}/${props.name}`, value);
21
+ },
22
+ options,
23
+ value,
24
+ children
25
+ });
41
26
  }
42
27
  ProteusSelect.displayName = "@optiaxiom/proteus/ProteusSelect";
43
-
28
+ //#endregion
44
29
  export { ProteusSelect };
@@ -1,23 +1,15 @@
1
1
  "use client";
2
- import { jsx, Fragment } from 'react/jsx-runtime';
3
- import { useProteusDocumentContext } from '../proteus-document/ProteusDocumentContext.js';
4
- import { useProteusDocumentPathContext } from '../proteus-document/ProteusDocumentPathContext.js';
5
- import { evaluateCondition } from '../proteus-document/resolveProteusValue.js';
6
-
2
+ import { useProteusDocumentContext } from "../proteus-document/ProteusDocumentContext.js";
3
+ import { useProteusDocumentPathContext } from "../proteus-document/ProteusDocumentPathContext.js";
4
+ import { evaluateCondition } from "../proteus-document/resolveProteusValue.js";
5
+ import { Fragment, jsx } from "react/jsx-runtime";
6
+ //#region src/proteus-show/ProteusShow.tsx
7
7
  function ProteusShow({ children, when }) {
8
- const { data } = useProteusDocumentContext("@optiaxiom/proteus/ProteusShow");
9
- const { mapIndices, path: parentPath } = useProteusDocumentPathContext(
10
- "@optiaxiom/proteus/ProteusShow"
11
- );
12
- const conditions = Array.isArray(when) ? when : [when];
13
- const shouldShow = conditions.every(
14
- (condition) => evaluateCondition(condition, data, parentPath, mapIndices)
15
- );
16
- if (!shouldShow) {
17
- return null;
18
- }
19
- return /* @__PURE__ */ jsx(Fragment, { children });
8
+ const { data } = useProteusDocumentContext("@optiaxiom/proteus/ProteusShow");
9
+ const { mapIndices, path: parentPath } = useProteusDocumentPathContext("@optiaxiom/proteus/ProteusShow");
10
+ if (!(Array.isArray(when) ? when : [when]).every((condition) => evaluateCondition(condition, data, parentPath, mapIndices))) return null;
11
+ return /* @__PURE__ */ jsx(Fragment, { children });
20
12
  }
21
13
  ProteusShow.displayName = "@optiaxiom/proteus/ProteusShow";
22
-
14
+ //#endregion
23
15
  export { ProteusShow };
@@ -1,41 +1,38 @@
1
1
  "use client";
2
- import { jsx } from 'react/jsx-runtime';
3
- import { Switch } from '@optiaxiom/react';
4
- import { useEffect } from 'react';
5
- import { useProteusDocumentContext } from '../proteus-document/ProteusDocumentContext.js';
6
- import { useProteusDocumentPathContext } from '../proteus-document/ProteusDocumentPathContext.js';
7
- import { useProteusValue } from '../use-proteus-value/useProteusValue.js';
8
-
2
+ import { useProteusDocumentContext } from "../proteus-document/ProteusDocumentContext.js";
3
+ import { useProteusDocumentPathContext } from "../proteus-document/ProteusDocumentPathContext.js";
4
+ import { useProteusValue } from "../use-proteus-value/useProteusValue.js";
5
+ import { Switch } from "@optiaxiom/react";
6
+ import { useEffect } from "react";
7
+ import { jsx } from "react/jsx-runtime";
8
+ //#region src/proteus-switch/ProteusSwitch.tsx
9
9
  function ProteusSwitch(props) {
10
- const { onDataChange, readOnly } = useProteusDocumentContext(
11
- "@optiaxiom/proteus/ProteusSwitch"
12
- );
13
- const { path: parentPath } = useProteusDocumentPathContext(
14
- "@optiaxiom/proteus/ProteusSwitch"
15
- );
16
- const dataValue = useProteusValue({ path: props.name ?? "" });
17
- const hasValue = props.value !== void 0;
18
- useEffect(() => {
19
- if (hasValue && props.name && (dataValue === null || dataValue === void 0)) {
20
- onDataChange?.(`${parentPath}/${props.name}`, "No");
21
- }
22
- }, [dataValue, hasValue, onDataChange, parentPath, props.name]);
23
- const checked = hasValue ? dataValue === props.value : Boolean(dataValue);
24
- return /* @__PURE__ */ jsx(
25
- Switch,
26
- {
27
- ...props,
28
- checked: props.name ? checked : false,
29
- disabled: readOnly,
30
- onCheckedChange: (newChecked) => {
31
- if (props.name) {
32
- const newValue = hasValue ? newChecked ? props.value : "No" : newChecked;
33
- onDataChange?.(`${parentPath}/${props.name}`, newValue);
34
- }
35
- }
36
- }
37
- );
10
+ const { onDataChange, readOnly } = useProteusDocumentContext("@optiaxiom/proteus/ProteusSwitch");
11
+ const { path: parentPath } = useProteusDocumentPathContext("@optiaxiom/proteus/ProteusSwitch");
12
+ const dataValue = useProteusValue({ path: props.name ?? "" });
13
+ const hasValue = props.value !== void 0;
14
+ useEffect(() => {
15
+ if (hasValue && props.name && (dataValue === null || dataValue === void 0)) onDataChange?.(`${parentPath}/${props.name}`, "No");
16
+ }, [
17
+ dataValue,
18
+ hasValue,
19
+ onDataChange,
20
+ parentPath,
21
+ props.name
22
+ ]);
23
+ const checked = hasValue ? dataValue === props.value : Boolean(dataValue);
24
+ return /* @__PURE__ */ jsx(Switch, {
25
+ ...props,
26
+ checked: props.name ? checked : false,
27
+ disabled: readOnly,
28
+ onCheckedChange: (newChecked) => {
29
+ if (props.name) {
30
+ const newValue = hasValue ? newChecked ? props.value : "No" : newChecked;
31
+ onDataChange?.(`${parentPath}/${props.name}`, newValue);
32
+ }
33
+ }
34
+ });
38
35
  }
39
36
  ProteusSwitch.displayName = "@optiaxiom/proteus/ProteusSwitch";
40
-
37
+ //#endregion
41
38
  export { ProteusSwitch };
@@ -1,32 +1,23 @@
1
1
  "use client";
2
- import { jsx } from 'react/jsx-runtime';
3
- import { Textarea } from '@optiaxiom/react';
4
- import { useProteusDocumentContext } from '../proteus-document/ProteusDocumentContext.js';
5
- import { useProteusDocumentPathContext } from '../proteus-document/ProteusDocumentPathContext.js';
6
- import { useProteusValue } from '../use-proteus-value/useProteusValue.js';
7
-
2
+ import { useProteusDocumentContext } from "../proteus-document/ProteusDocumentContext.js";
3
+ import { useProteusDocumentPathContext } from "../proteus-document/ProteusDocumentPathContext.js";
4
+ import { useProteusValue } from "../use-proteus-value/useProteusValue.js";
5
+ import { Textarea } from "@optiaxiom/react";
6
+ import { jsx } from "react/jsx-runtime";
7
+ //#region src/proteus-textarea/ProteusTextarea.tsx
8
8
  function ProteusTextarea(props) {
9
- const { onDataChange, readOnly } = useProteusDocumentContext(
10
- "@optiaxiom/proteus/ProteusTextarea"
11
- );
12
- const { path: parentPath } = useProteusDocumentPathContext(
13
- "@optiaxiom/proteus/ProteusTextarea"
14
- );
15
- const value = useProteusValue({ path: props.name ?? "" });
16
- return /* @__PURE__ */ jsx(
17
- Textarea,
18
- {
19
- ...props,
20
- onValueChange: (value2) => {
21
- if (props.name) {
22
- onDataChange?.(`${parentPath}/${props.name}`, value2);
23
- }
24
- },
25
- readOnly,
26
- value: props.name ? String(value ?? "") : void 0
27
- }
28
- );
9
+ const { onDataChange, readOnly } = useProteusDocumentContext("@optiaxiom/proteus/ProteusTextarea");
10
+ const { path: parentPath } = useProteusDocumentPathContext("@optiaxiom/proteus/ProteusTextarea");
11
+ const value = useProteusValue({ path: props.name ?? "" });
12
+ return /* @__PURE__ */ jsx(Textarea, {
13
+ ...props,
14
+ onValueChange: (value) => {
15
+ if (props.name) onDataChange?.(`${parentPath}/${props.name}`, value);
16
+ },
17
+ readOnly,
18
+ value: props.name ? String(value ?? "") : void 0
19
+ });
29
20
  }
30
21
  ProteusTextarea.displayName = "@optiaxiom/proteus/ProteusTextarea";
31
-
22
+ //#endregion
32
23
  export { ProteusTextarea };
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { useProteusValue } from '../use-proteus-value/useProteusValue.js';
3
-
2
+ import { useProteusValue } from "../use-proteus-value/useProteusValue.js";
3
+ //#region src/proteus-value/ProteusValue.tsx
4
4
  function ProteusValue(props) {
5
- return useProteusValue(props);
5
+ return useProteusValue(props);
6
6
  }
7
7
  ProteusValue.displayName = "@optiaxiom/proteus/ProteusValue";
8
-
8
+ //#endregion
9
9
  export { ProteusValue };