treege 3.0.0-beta.30 → 3.0.0-beta.32

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 (41) hide show
  1. package/README.md +1 -3
  2. package/dist/ThemeContext-CF4x2MjM.js +990 -0
  3. package/dist/editor/constants/inputTypeIcons.d.ts +3 -0
  4. package/dist/editor/features/TreegeEditor/nodes/components/InputTypeBadge.d.ts +7 -0
  5. package/dist/editor/features/TreegeEditor/nodes/components/NodeMoreMenu.d.ts +6 -0
  6. package/dist/editor/features/TreegeEditor/nodes/components/OptionsEditor.d.ts +7 -0
  7. package/dist/editor/features/TreegeEditor/nodes/components/RequiredBadge.d.ts +6 -0
  8. package/dist/editor/hooks/useFlowActions.d.ts +1 -0
  9. package/dist/editor/utils/inputTypeIcon.d.ts +6 -0
  10. package/dist/{editor-DnrJgSrC.js → editor-Bu-BRxFn.js} +1290 -1106
  11. package/dist/editor.js +2 -2
  12. package/dist/main.js +4 -4
  13. package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputs.d.ts +1 -6
  14. package/dist/renderer/features/TreegeRenderer/native/components/DefaultUI.d.ts +1 -1
  15. package/dist/{renderer-MCPhNlp1.js → renderer-BTSDEkG-.js} +92 -45
  16. package/dist/renderer-native.js +143 -55
  17. package/dist/renderer.js +3 -3
  18. package/dist/{separator-gO82kpxa.js → separator-NOjYTDU_.js} +3 -2
  19. package/dist/shared/components/ui/alert-dialog.d.ts +1 -1
  20. package/dist/shared/components/ui/button.d.ts +1 -1
  21. package/dist/shared/components/ui/collapsible.d.ts +1 -1
  22. package/dist/shared/components/ui/command.d.ts +1 -1
  23. package/dist/shared/components/ui/dropdown-menu.d.ts +1 -1
  24. package/dist/shared/components/ui/form.d.ts +1 -1
  25. package/dist/shared/components/ui/popover.d.ts +1 -1
  26. package/dist/shared/components/ui/sheet.d.ts +1 -1
  27. package/dist/shared/components/ui/tooltip.d.ts +1 -1
  28. package/dist/shared/locales/ar.json.d.ts +7 -1
  29. package/dist/shared/locales/de.json.d.ts +8 -2
  30. package/dist/shared/locales/en.json.d.ts +8 -2
  31. package/dist/shared/locales/es.json.d.ts +8 -2
  32. package/dist/shared/locales/fr.json.d.ts +8 -2
  33. package/dist/shared/locales/it.json.d.ts +8 -2
  34. package/dist/shared/locales/pt.json.d.ts +8 -2
  35. package/dist/shared/types/node.d.ts +10 -2
  36. package/dist/{useRenderNode-B_GPMTPf.js → useRenderNode-B5u9MZKo.js} +1 -1
  37. package/package.json +6 -6
  38. package/dist/ThemeContext-D49eu_oE.js +0 -1472
  39. package/dist/editor/features/TreegeEditor/nodes/components/NodeTypeBadge.d.ts +0 -8
  40. package/dist/editor/features/TreegeEditor/nodes/components/OpenSheetButton.d.ts +0 -6
  41. package/dist/editor/features/TreegeEditor/nodes/components/SubTypeBadge.d.ts +0 -8
package/dist/editor.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as e, t } from "./ThemeContext-D49eu_oE.js";
2
- import { t as n } from "./editor-DnrJgSrC.js";
1
+ import { n as e, t } from "./ThemeContext-CF4x2MjM.js";
2
+ import { t as n } from "./editor-Bu-BRxFn.js";
3
3
  export { t as ThemeProvider, n as TreegeEditor, e as useTheme };
package/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
- import { c as e, d as t, l as n, n as r, o as i, s as a, t as o, u as s } from "./ThemeContext-D49eu_oE.js";
2
- import { t as c } from "./editor-DnrJgSrC.js";
3
- import { C as l, _ as u, a as d, b as f, d as p, f as m, g as h, h as g, i as _, l as v, m as y, n as b, p as x, r as S, u as C, v as w, w as T, x as E, y as D } from "./useRenderNode-B_GPMTPf.js";
4
- import { C as O, S as k, _ as A, a as j, b as M, c as N, d as P, f as F, g as I, h as L, i as R, l as z, m as B, n as V, o as H, p as U, r as W, s as G, t as K, u as q, v as J, x as Y, y as X } from "./renderer-MCPhNlp1.js";
1
+ import { c as e, d as t, l as n, n as r, o as i, s as a, t as o, u as s } from "./ThemeContext-CF4x2MjM.js";
2
+ import { t as c } from "./editor-Bu-BRxFn.js";
3
+ import { C as l, _ as u, a as d, b as f, d as p, f as m, g as h, h as g, i as _, l as v, m as y, n as b, p as x, r as S, u as C, v as w, w as T, x as E, y as D } from "./useRenderNode-B5u9MZKo.js";
4
+ import { C as O, S as k, _ as A, a as j, b as M, c as N, d as P, f as F, g as I, h as L, i as R, l as z, m as B, n as V, o as H, p as U, r as W, s as G, t as K, u as q, v as J, x as Y, y as X } from "./renderer-BTSDEkG-.js";
5
5
  export { k as DefaultAddressInput, Y as DefaultAutocompleteInput, M as DefaultCheckboxInput, X as DefaultDateInput, J as DefaultDateRangeInput, A as DefaultFileInput, O as DefaultGroup, I as DefaultHiddenInput, L as DefaultHttpInput, B as DefaultNumberInput, U as DefaultPasswordInput, F as DefaultRadioInput, P as DefaultSelectInput, q as DefaultSwitchInput, z as DefaultTextAreaInput, N as DefaultTextInput, G as DefaultTimeInput, H as DefaultTimeRangeInput, V as Divider, o as ThemeProvider, W as Title, l as TreegeConfigProvider, c as TreegeEditor, K as TreegeRenderer, u as applyReferenceTransformation, w as calculateReferenceFieldUpdates, D as checkFormFieldHasValue, f as convertFormValuesToNamedFormat, j as defaultInputRenderers, R as defaultUI, x as evaluateCondition, y as evaluateConditions, b as fileToSerializable, S as filesToSerializable, v as findStartNode, C as getFlowRenderState, i as getStaticTranslations, a as getTranslatedText, E as isFieldEmpty, e as isFlowNode, n as isGroupNode, s as isInputNode, p as isStartNode, t as isUINode, m as mergeFlows, g as sanitize, h as sanitizeHttpResponse, _ as serializableToFile, r as useTheme, T as useTreegeConfig, d as useTreegeRenderer };
@@ -16,11 +16,6 @@ import { default as DefaultTextInput } from './inputs/DefaultTextInput';
16
16
  import { default as DefaultTimeInput } from './inputs/DefaultTimeInput';
17
17
  import { default as DefaultTimeRangeInput } from './inputs/DefaultTimeRangeInput';
18
18
  import { InputRenderers, InputRenderProps } from '../../../../types/renderer';
19
- export { DefaultTextInput, DefaultNumberInput, DefaultPasswordInput, DefaultTextareaInput };
20
- export { DefaultCheckboxInput, DefaultSwitchInput, DefaultRadioInput, DefaultSelectInput };
21
- export { DefaultHiddenInput };
22
- export { DefaultAddressInput, DefaultAutocompleteInput, DefaultHttpInput };
23
- export { DefaultDateInput, DefaultDateRangeInput, DefaultTimeInput, DefaultTimeRangeInput };
24
- export { DefaultFileInput };
19
+ export { DefaultAddressInput, DefaultAutocompleteInput, DefaultCheckboxInput, DefaultDateInput, DefaultDateRangeInput, DefaultFileInput, DefaultHiddenInput, DefaultHttpInput, DefaultNumberInput, DefaultPasswordInput, DefaultRadioInput, DefaultSelectInput, DefaultSwitchInput, DefaultTextareaInput, DefaultTextInput, DefaultTimeInput, DefaultTimeRangeInput, };
25
20
  export declare const DefaultSubmitInput: ({ node }: InputRenderProps<"submit">) => import("react/jsx-runtime").JSX.Element;
26
21
  export declare const defaultInputRenderers: InputRenderers;
@@ -1,7 +1,7 @@
1
1
  import { UiRenderProps } from '../../../../types/renderer';
2
2
  declare const DefaultTitleUI: ({ node }: UiRenderProps) => import("react/jsx-runtime").JSX.Element;
3
3
  declare const DefaultDividerUI: () => import("react/jsx-runtime").JSX.Element;
4
- export { DefaultTitleUI, DefaultDividerUI };
4
+ export { DefaultDividerUI, DefaultTitleUI };
5
5
  export declare const defaultUI: {
6
6
  divider: () => import("react/jsx-runtime").JSX.Element;
7
7
  title: ({ node }: UiRenderProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
- import { f as e, t } from "./ThemeContext-D49eu_oE.js";
2
- import { A as n, C as r, D as i, E as a, F as o, M as s, N as c, O as l, P as u, S as d, T as f, _ as p, a as m, b as h, c as g, i as _, j as v, k as y, l as b, n as ee, o as te, r as x, s as S, t as C, v as w, w as T, y as E } from "./separator-gO82kpxa.js";
3
- import { S as D, a as O, b as ne, c as k, d as A, g as re, n as j, o as M, r as N, s as P, t as F, w as I } from "./useRenderNode-B_GPMTPf.js";
1
+ import { f as e, t } from "./ThemeContext-CF4x2MjM.js";
2
+ import { A as n, C as r, D as i, E as a, F as o, M as s, N as c, O as l, P as u, S as d, T as f, _ as p, a as m, b as h, c as g, i as _, j as v, k as y, l as b, n as ee, o as te, r as x, s as S, t as C, v as w, w as T, y as E } from "./separator-NOjYTDU_.js";
3
+ import { S as D, a as O, b as ne, c as k, d as A, g as re, n as j, o as M, r as N, s as P, t as F, w as I } from "./useRenderNode-B5u9MZKo.js";
4
4
  import * as L from "react";
5
5
  import { forwardRef as R, useCallback as ie, useEffect as z, useMemo as ae, useRef as B, useState as V } from "react";
6
6
  import { Check as oe, ChevronDownIcon as se, ChevronLeftIcon as ce, ChevronRightIcon as le, ChevronsUpDown as ue, CircleIcon as H, Loader2 as de, MapPin as U } from "lucide-react";
@@ -182,20 +182,30 @@ var J = e(), fe = ({ children: e, onSubmit: t }) => /* @__PURE__ */ (0, J.jsx)("
182
182
  }),
183
183
  /* @__PURE__ */ (0, J.jsx)("div", {
184
184
  className: "space-y-2",
185
- children: e.data.options.map((e, t) => /* @__PURE__ */ (0, J.jsxs)("div", {
186
- className: "flex items-center gap-3",
187
- children: [/* @__PURE__ */ (0, J.jsx)(s, {
188
- id: `${l}-${e.value}`,
189
- name: u,
190
- checked: f.includes(String(e.value)),
191
- onCheckedChange: (t) => p(String(e.value), !!t),
192
- disabled: e.disabled
193
- }), /* @__PURE__ */ (0, J.jsx)(i, {
194
- htmlFor: `${l}-${e.value}`,
195
- className: "cursor-pointer font-normal text-sm",
196
- children: d(e.label) ? d(e.label) : e.value
197
- })]
198
- }, e.value + t))
185
+ children: e.data.options.map((e, t) => {
186
+ let n = d(e.description);
187
+ return /* @__PURE__ */ (0, J.jsxs)("div", {
188
+ className: "flex items-start gap-3",
189
+ children: [/* @__PURE__ */ (0, J.jsx)(s, {
190
+ id: `${l}-${e.value}`,
191
+ name: u,
192
+ checked: f.includes(String(e.value)),
193
+ onCheckedChange: (t) => p(String(e.value), !!t),
194
+ disabled: e.disabled,
195
+ className: "mt-0.5"
196
+ }), /* @__PURE__ */ (0, J.jsxs)("div", {
197
+ className: "flex flex-col",
198
+ children: [/* @__PURE__ */ (0, J.jsx)(i, {
199
+ htmlFor: `${l}-${e.value}`,
200
+ className: "cursor-pointer font-normal text-sm",
201
+ children: d(e.label) ? d(e.label) : e.value
202
+ }), n && /* @__PURE__ */ (0, J.jsx)("span", {
203
+ className: "text-muted-foreground text-xs",
204
+ children: n
205
+ })]
206
+ })]
207
+ }, e.value + t);
208
+ })
199
209
  }),
200
210
  a && /* @__PURE__ */ (0, J.jsx)(n, { children: a }),
201
211
  c && !a && /* @__PURE__ */ (0, J.jsx)(y, { children: c })
@@ -788,47 +798,84 @@ function Me({ className: e, ...t }) {
788
798
  }
789
799
  //#endregion
790
800
  //#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.tsx
791
- var Ne = ({ node: e, value: t, setValue: r, error: a, label: o, helperText: s, id: c, name: l }) => {
792
- let u = M(), d = t ? String(t) : "";
801
+ var Ne = ({ node: e, value: t, setValue: r, error: a, label: s, helperText: c, id: l, name: u }) => {
802
+ let d = M(), f = t ? String(t) : "", p = e.data.variant === "card";
793
803
  return /* @__PURE__ */ (0, J.jsxs)(v, {
794
804
  className: "mb-4",
795
805
  children: [
796
806
  /* @__PURE__ */ (0, J.jsxs)(i, {
797
807
  className: "mb-1",
798
- htmlFor: c,
799
- children: [o || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
808
+ htmlFor: l,
809
+ children: [s || e.data.name, e.data.required && /* @__PURE__ */ (0, J.jsx)("span", {
800
810
  className: "text-red-500",
801
811
  children: "*"
802
812
  })]
803
813
  }),
804
814
  /* @__PURE__ */ (0, J.jsx)(je, {
805
- value: d,
815
+ value: f,
806
816
  onValueChange: (e) => r(e),
807
- id: c,
808
- name: l,
809
- children: e.data.options?.map((e, t) => /* @__PURE__ */ (0, J.jsxs)("div", {
810
- className: "flex items-center space-x-2",
811
- children: [
812
- /* @__PURE__ */ (0, J.jsx)(Me, {
813
- value: String(e.value),
814
- id: `${c}-${e.value}`,
815
- disabled: e.disabled
816
- }),
817
- e.image && /* @__PURE__ */ (0, J.jsx)("img", {
818
- src: e.image,
819
- alt: "",
820
- className: "h-8 w-8 rounded object-cover"
821
- }),
822
- /* @__PURE__ */ (0, J.jsx)(i, {
823
- htmlFor: `${c}-${e.value}`,
824
- className: "cursor-pointer font-normal text-sm",
825
- children: u(e.label) ? u(e.label) : e.value
826
- })
827
- ]
828
- }, e.value + t))
817
+ id: l,
818
+ name: u,
819
+ className: p ? "flex flex-col gap-2" : void 0,
820
+ children: e.data.options?.map((e, t) => {
821
+ let n = `${l}-${e.value}`, r = d(e.label) || e.value, a = d(e.description), s = f === String(e.value);
822
+ return p ? /* @__PURE__ */ (0, J.jsxs)(i, {
823
+ htmlFor: n,
824
+ className: o("flex cursor-pointer items-start gap-3 rounded-md border p-3 transition-colors", "hover:border-primary/50", s && "border-primary bg-primary/5", e.disabled && "pointer-events-none opacity-50"),
825
+ children: [
826
+ /* @__PURE__ */ (0, J.jsx)(Me, {
827
+ value: String(e.value),
828
+ id: n,
829
+ disabled: e.disabled,
830
+ className: "mt-1"
831
+ }),
832
+ e.image && /* @__PURE__ */ (0, J.jsx)("img", {
833
+ src: e.image,
834
+ alt: "",
835
+ className: "h-10 w-10 shrink-0 rounded object-cover"
836
+ }),
837
+ /* @__PURE__ */ (0, J.jsxs)("div", {
838
+ className: "flex min-w-0 flex-col",
839
+ children: [/* @__PURE__ */ (0, J.jsx)("span", {
840
+ className: "font-medium text-sm",
841
+ children: r
842
+ }), a && /* @__PURE__ */ (0, J.jsx)("span", {
843
+ className: "text-muted-foreground text-xs",
844
+ children: a
845
+ })]
846
+ })
847
+ ]
848
+ }, e.value + t) : /* @__PURE__ */ (0, J.jsxs)("div", {
849
+ className: "flex items-start space-x-2",
850
+ children: [
851
+ /* @__PURE__ */ (0, J.jsx)(Me, {
852
+ value: String(e.value),
853
+ id: n,
854
+ disabled: e.disabled,
855
+ className: "mt-0.5"
856
+ }),
857
+ e.image && /* @__PURE__ */ (0, J.jsx)("img", {
858
+ src: e.image,
859
+ alt: "",
860
+ className: "h-8 w-8 rounded object-cover"
861
+ }),
862
+ /* @__PURE__ */ (0, J.jsxs)("div", {
863
+ className: "flex flex-col",
864
+ children: [/* @__PURE__ */ (0, J.jsx)(i, {
865
+ htmlFor: n,
866
+ className: "cursor-pointer font-normal text-sm",
867
+ children: r
868
+ }), a && /* @__PURE__ */ (0, J.jsx)("span", {
869
+ className: "text-muted-foreground text-xs",
870
+ children: a
871
+ })]
872
+ })
873
+ ]
874
+ }, e.value + t);
875
+ })
829
876
  }),
830
877
  a && /* @__PURE__ */ (0, J.jsx)(n, { children: a }),
831
- s && !a && /* @__PURE__ */ (0, J.jsx)(y, { children: s })
878
+ c && !a && /* @__PURE__ */ (0, J.jsx)(y, { children: c })
832
879
  ]
833
880
  });
834
881
  }, Pe = ({ node: e, value: t, setValue: a, error: o, label: s, placeholder: c, helperText: l, name: u, id: f }) => {
@@ -1,5 +1,5 @@
1
- import { f as e, n as t, s as n, t as r } from "./ThemeContext-D49eu_oE.js";
2
- import { C as i, S as a, _ as o, a as s, b as c, c as l, d as u, f as d, i as f, l as p, m, n as h, o as g, p as _, r as v, s as y, t as b, u as x, v as S, w as C, x as w, y as T } from "./useRenderNode-B_GPMTPf.js";
1
+ import { f as e, n as t, s as n, t as r } from "./ThemeContext-CF4x2MjM.js";
2
+ import { C as i, S as a, _ as o, a as s, b as c, c as l, d as u, f as d, i as f, l as p, m, n as h, o as g, p as _, r as v, s as y, t as b, u as x, v as S, w as C, x as w, y as T } from "./useRenderNode-B5u9MZKo.js";
3
3
  import { useCallback as E, useEffect as D, useMemo as O, useRef as k, useState as A } from "react";
4
4
  import { ActivityIndicator as j, Alert as M, FlatList as ee, Image as N, Modal as P, ScrollView as F, StyleSheet as I, Switch as te, Text as L, TextInput as ne, TouchableOpacity as R, View as z } from "react-native";
5
5
  //#region src/renderer/features/TreegeRenderer/native/components/DefaultFormWrapper.tsx
@@ -568,43 +568,52 @@ var B = e(), re = ({ children: e }) => /* @__PURE__ */ (0, B.jsx)(z, {
568
568
  children: "*"
569
569
  })]
570
570
  }),
571
- l.length > 0 ? l.map((e) => /* @__PURE__ */ (0, B.jsxs)(R, {
572
- style: G.option,
573
- onPress: () => p(e.value),
574
- disabled: e.disabled,
575
- activeOpacity: .7,
576
- accessible: !0,
577
- accessibilityRole: "checkbox",
578
- accessibilityState: {
579
- checked: m(e.value),
580
- disabled: e.disabled
581
- },
582
- accessibilityLabel: s(e.label) || e.value,
583
- children: [/* @__PURE__ */ (0, B.jsx)(z, {
584
- style: [
585
- G.checkbox,
586
- {
587
- backgroundColor: c.input,
588
- borderColor: c.border
589
- },
590
- m(e.value) && {
591
- backgroundColor: c.primary,
592
- borderColor: c.primary
593
- }
594
- ],
595
- children: m(e.value) && /* @__PURE__ */ (0, B.jsx)(L, {
596
- style: G.checkmark,
597
- children: "✓"
598
- })
599
- }), /* @__PURE__ */ (0, B.jsx)(L, {
600
- style: [
601
- G.optionLabel,
602
- { color: c.textSecondary },
603
- e.disabled && { color: c.textMuted }
604
- ],
605
- children: s(e.label) || e.value
606
- })]
607
- }, e.value)) : /* @__PURE__ */ (0, B.jsxs)(R, {
571
+ l.length > 0 ? l.map((e) => {
572
+ let t = s(e.description);
573
+ return /* @__PURE__ */ (0, B.jsxs)(R, {
574
+ style: G.option,
575
+ onPress: () => p(e.value),
576
+ disabled: e.disabled,
577
+ activeOpacity: .7,
578
+ accessible: !0,
579
+ accessibilityRole: "checkbox",
580
+ accessibilityState: {
581
+ checked: m(e.value),
582
+ disabled: e.disabled
583
+ },
584
+ accessibilityLabel: s(e.label) || e.value,
585
+ children: [/* @__PURE__ */ (0, B.jsx)(z, {
586
+ style: [
587
+ G.checkbox,
588
+ {
589
+ backgroundColor: c.input,
590
+ borderColor: c.border
591
+ },
592
+ m(e.value) && {
593
+ backgroundColor: c.primary,
594
+ borderColor: c.primary
595
+ }
596
+ ],
597
+ children: m(e.value) && /* @__PURE__ */ (0, B.jsx)(L, {
598
+ style: G.checkmark,
599
+ children: "✓"
600
+ })
601
+ }), /* @__PURE__ */ (0, B.jsxs)(z, {
602
+ style: G.optionTextContainer,
603
+ children: [/* @__PURE__ */ (0, B.jsx)(L, {
604
+ style: [
605
+ G.optionLabel,
606
+ { color: c.textSecondary },
607
+ e.disabled && { color: c.textMuted }
608
+ ],
609
+ children: s(e.label) || e.value
610
+ }), t && /* @__PURE__ */ (0, B.jsx)(L, {
611
+ style: [G.optionDescription, { color: c.textMuted }],
612
+ children: t
613
+ })]
614
+ })]
615
+ }, e.value);
616
+ }) : /* @__PURE__ */ (0, B.jsxs)(R, {
608
617
  style: G.option,
609
618
  onPress: () => p(""),
610
619
  activeOpacity: .7,
@@ -673,14 +682,16 @@ var B = e(), re = ({ children: e }) => /* @__PURE__ */ (0, B.jsx)(z, {
673
682
  marginBottom: 8
674
683
  },
675
684
  option: {
676
- alignItems: "center",
685
+ alignItems: "flex-start",
677
686
  flexDirection: "row",
678
687
  marginBottom: 8
679
688
  },
680
- optionLabel: {
681
- flex: 1,
682
- fontSize: 14
683
- }
689
+ optionDescription: {
690
+ fontSize: 12,
691
+ marginTop: 2
692
+ },
693
+ optionLabel: { fontSize: 14 },
694
+ optionTextContainer: { flex: 1 }
684
695
  }), ue = ({ node: e, value: n, setValue: r, error: i, label: a, placeholder: o, helperText: s }) => {
685
696
  let [c, l] = A(!1), u = g(), { colors: d } = t(), f = n ? new Date(n) : void 0, { year: p, month: m, today: h } = O(() => {
686
697
  let e = f || /* @__PURE__ */ new Date(), t = e.getFullYear(), n = e.getMonth(), r = /* @__PURE__ */ new Date();
@@ -2230,7 +2241,7 @@ var B = e(), re = ({ children: e }) => /* @__PURE__ */ (0, B.jsx)(z, {
2230
2241
  fontWeight: "600"
2231
2242
  }
2232
2243
  }), Oe = ({ node: e, value: n, setValue: r, error: i, label: a, helperText: o }) => {
2233
- let s = g(), { colors: c } = t(), l = e.data.options || [], u = n || "", d = (e) => {
2244
+ let s = g(), { colors: c } = t(), l = e.data.options || [], u = n || "", d = e.data.variant === "card", f = (e) => {
2234
2245
  r(e);
2235
2246
  };
2236
2247
  return /* @__PURE__ */ (0, B.jsxs)(z, {
@@ -2244,10 +2255,21 @@ var B = e(), re = ({ children: e }) => /* @__PURE__ */ (0, B.jsx)(z, {
2244
2255
  })]
2245
2256
  }),
2246
2257
  l.map((e) => {
2247
- let t = u === e.value;
2248
- return /* @__PURE__ */ (0, B.jsxs)(R, {
2249
- style: X.option,
2250
- onPress: () => d(e.value),
2258
+ let t = u === e.value, n = s(e.label) || e.value, r = s(e.description);
2259
+ return d ? /* @__PURE__ */ (0, B.jsxs)(R, {
2260
+ style: [
2261
+ X.card,
2262
+ {
2263
+ backgroundColor: c.input,
2264
+ borderColor: c.border
2265
+ },
2266
+ t && {
2267
+ backgroundColor: `${c.primary}10`,
2268
+ borderColor: c.primary
2269
+ },
2270
+ e.disabled && { opacity: .5 }
2271
+ ],
2272
+ onPress: () => f(e.value),
2251
2273
  disabled: e.disabled,
2252
2274
  activeOpacity: .7,
2253
2275
  children: [
@@ -2264,15 +2286,53 @@ var B = e(), re = ({ children: e }) => /* @__PURE__ */ (0, B.jsx)(z, {
2264
2286
  }),
2265
2287
  e.image && /* @__PURE__ */ (0, B.jsx)(N, {
2266
2288
  source: { uri: e.image },
2267
- style: X.image
2289
+ style: X.cardImage
2268
2290
  }),
2269
- /* @__PURE__ */ (0, B.jsx)(L, {
2291
+ /* @__PURE__ */ (0, B.jsxs)(z, {
2292
+ style: X.cardTextContainer,
2293
+ children: [/* @__PURE__ */ (0, B.jsx)(L, {
2294
+ style: [X.cardLabel, { color: c.textSecondary }],
2295
+ children: n
2296
+ }), r && /* @__PURE__ */ (0, B.jsx)(L, {
2297
+ style: [X.cardDescription, { color: c.textMuted }],
2298
+ children: r
2299
+ })]
2300
+ })
2301
+ ]
2302
+ }, e.value) : /* @__PURE__ */ (0, B.jsxs)(R, {
2303
+ style: X.option,
2304
+ onPress: () => f(e.value),
2305
+ disabled: e.disabled,
2306
+ activeOpacity: .7,
2307
+ children: [
2308
+ /* @__PURE__ */ (0, B.jsx)(z, {
2270
2309
  style: [
2271
- X.optionLabel,
2272
- { color: c.textSecondary },
2273
- e.disabled && { color: c.textMuted }
2310
+ X.radio,
2311
+ {
2312
+ backgroundColor: c.input,
2313
+ borderColor: c.border
2314
+ },
2315
+ t && { borderColor: c.primary }
2274
2316
  ],
2275
- children: s(e.label) || e.value
2317
+ children: t && /* @__PURE__ */ (0, B.jsx)(z, { style: [X.radioInner, { backgroundColor: c.primary }] })
2318
+ }),
2319
+ e.image && /* @__PURE__ */ (0, B.jsx)(N, {
2320
+ source: { uri: e.image },
2321
+ style: X.image
2322
+ }),
2323
+ /* @__PURE__ */ (0, B.jsxs)(z, {
2324
+ style: X.optionTextContainer,
2325
+ children: [/* @__PURE__ */ (0, B.jsx)(L, {
2326
+ style: [
2327
+ X.optionLabel,
2328
+ { color: c.textSecondary },
2329
+ e.disabled && { color: c.textMuted }
2330
+ ],
2331
+ children: n
2332
+ }), r && /* @__PURE__ */ (0, B.jsx)(L, {
2333
+ style: [X.optionDescription, { color: c.textMuted }],
2334
+ children: r
2335
+ })]
2276
2336
  })
2277
2337
  ]
2278
2338
  }, e.value);
@@ -2288,6 +2348,29 @@ var B = e(), re = ({ children: e }) => /* @__PURE__ */ (0, B.jsx)(z, {
2288
2348
  ]
2289
2349
  });
2290
2350
  }, X = I.create({
2351
+ card: {
2352
+ alignItems: "flex-start",
2353
+ borderRadius: 8,
2354
+ borderWidth: 1,
2355
+ flexDirection: "row",
2356
+ marginBottom: 8,
2357
+ padding: 12
2358
+ },
2359
+ cardDescription: {
2360
+ fontSize: 12,
2361
+ marginTop: 2
2362
+ },
2363
+ cardImage: {
2364
+ borderRadius: 4,
2365
+ height: 40,
2366
+ marginRight: 12,
2367
+ width: 40
2368
+ },
2369
+ cardLabel: {
2370
+ fontSize: 14,
2371
+ fontWeight: "500"
2372
+ },
2373
+ cardTextContainer: { flex: 1 },
2291
2374
  container: { marginBottom: 16 },
2292
2375
  error: {
2293
2376
  fontSize: 12,
@@ -2313,7 +2396,12 @@ var B = e(), re = ({ children: e }) => /* @__PURE__ */ (0, B.jsx)(z, {
2313
2396
  flexDirection: "row",
2314
2397
  marginBottom: 8
2315
2398
  },
2399
+ optionDescription: {
2400
+ fontSize: 12,
2401
+ marginTop: 2
2402
+ },
2316
2403
  optionLabel: { fontSize: 14 },
2404
+ optionTextContainer: { flex: 1 },
2317
2405
  radio: {
2318
2406
  alignItems: "center",
2319
2407
  borderRadius: 10,
package/dist/renderer.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as e, s as t, t as n } from "./ThemeContext-D49eu_oE.js";
2
- import { C as r, _ as i, a, b as o, d as s, f as c, g as l, h as u, i as d, l as f, m as p, n as m, p as h, r as g, u as _, v, w as y, x as b, y as x } from "./useRenderNode-B_GPMTPf.js";
3
- import { C as S, S as C, _ as w, a as T, b as E, c as D, d as O, f as k, g as A, h as j, i as M, l as N, m as P, n as F, o as I, p as L, r as R, s as z, t as B, u as V, v as H, x as U, y as W } from "./renderer-MCPhNlp1.js";
1
+ import { n as e, s as t, t as n } from "./ThemeContext-CF4x2MjM.js";
2
+ import { C as r, _ as i, a, b as o, d as s, f as c, g as l, h as u, i as d, l as f, m as p, n as m, p as h, r as g, u as _, v, w as y, x as b, y as x } from "./useRenderNode-B5u9MZKo.js";
3
+ import { C as S, S as C, _ as w, a as T, b as E, c as D, d as O, f as k, g as A, h as j, i as M, l as N, m as P, n as F, o as I, p as L, r as R, s as z, t as B, u as V, v as H, x as U, y as W } from "./renderer-BTSDEkG-.js";
4
4
  export { C as DefaultAddressInput, U as DefaultAutocompleteInput, E as DefaultCheckboxInput, W as DefaultDateInput, H as DefaultDateRangeInput, w as DefaultFileInput, S as DefaultGroup, A as DefaultHiddenInput, j as DefaultHttpInput, P as DefaultNumberInput, L as DefaultPasswordInput, k as DefaultRadioInput, O as DefaultSelectInput, V as DefaultSwitchInput, N as DefaultTextAreaInput, D as DefaultTextInput, z as DefaultTimeInput, I as DefaultTimeRangeInput, F as Divider, n as ThemeProvider, R as Title, r as TreegeConfigProvider, B as TreegeRenderer, i as applyReferenceTransformation, v as calculateReferenceFieldUpdates, x as checkFormFieldHasValue, o as convertFormValuesToNamedFormat, T as defaultInputRenderers, M as defaultUI, h as evaluateCondition, p as evaluateConditions, m as fileToSerializable, g as filesToSerializable, f as findStartNode, _ as getFlowRenderState, t as getTranslatedText, b as isFieldEmpty, s as isStartNode, c as mergeFlows, u as sanitize, l as sanitizeHttpResponse, d as serializableToFile, e as useTheme, y as useTreegeConfig, a as useTreegeRenderer };
@@ -1,4 +1,4 @@
1
- import { f as e } from "./ThemeContext-D49eu_oE.js";
1
+ import { f as e } from "./ThemeContext-CF4x2MjM.js";
2
2
  import "react";
3
3
  import { CheckIcon as t, ChevronDownIcon as n, ChevronUpIcon as r, SearchIcon as i, XIcon as a } from "lucide-react";
4
4
  import { Slot as o } from "@radix-ui/react-slot";
@@ -31,7 +31,8 @@ var y = e(), b = s("inline-flex items-center justify-center gap-2 whitespace-now
31
31
  "icon-lg": "size-10",
32
32
  "icon-sm": "size-8",
33
33
  lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
34
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5"
34
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
35
+ xs: "h-6 rounded-md gap-1 px-2 text-xs has-[>svg]:px-1.5"
35
36
  },
36
37
  variant: {
37
38
  default: "bg-primary text-primary-foreground hover:bg-primary/90",
@@ -11,4 +11,4 @@ declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<
11
11
  declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
12
12
  declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action>): import("react/jsx-runtime").JSX.Element;
13
13
  declare function AlertDialogCancel({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>): import("react/jsx-runtime").JSX.Element;
14
- export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
14
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  declare const buttonVariants: (props?: ({
4
- size?: "default" | "icon" | "icon-lg" | "icon-sm" | "lg" | "sm" | null | undefined;
4
+ size?: "default" | "icon" | "icon-lg" | "icon-sm" | "lg" | "sm" | "xs" | null | undefined;
5
5
  variant?: "default" | "link" | "destructive" | "ghost" | "outline" | "secondary" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
@@ -2,4 +2,4 @@ import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
2
2
  declare function Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>): import("react/jsx-runtime").JSX.Element;
3
3
  declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): import("react/jsx-runtime").JSX.Element;
4
4
  declare function CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): import("react/jsx-runtime").JSX.Element;
5
- export { Collapsible, CollapsibleTrigger, CollapsibleContent };
5
+ export { Collapsible, CollapsibleContent, CollapsibleTrigger };
@@ -15,4 +15,4 @@ declare function CommandGroup({ className, ...props }: React.ComponentProps<type
15
15
  declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
16
16
  declare function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
17
17
  declare function CommandShortcut({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
18
- export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator };
18
+ export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
@@ -22,4 +22,4 @@ declare function DropdownMenuSubTrigger({ className, inset, children, ...props }
22
22
  inset?: boolean;
23
23
  }): import("react/jsx-runtime").JSX.Element;
24
24
  declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
25
- export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
25
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
@@ -2,4 +2,4 @@ import * as React from "react";
2
2
  declare function FormItem({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
3
3
  declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
4
4
  declare function FormError({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
5
- export { FormError, FormItem, FormDescription };
5
+ export { FormDescription, FormError, FormItem };
@@ -6,4 +6,4 @@ declare function PopoverContent({ className, align, sideOffset, disablePortal, .
6
6
  disablePortal?: boolean;
7
7
  }): import("react/jsx-runtime").JSX.Element;
8
8
  declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): import("react/jsx-runtime").JSX.Element;
9
- export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
9
+ export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };
@@ -10,4 +10,4 @@ declare function SheetHeader({ className, ...props }: React.ComponentProps<"div"
10
10
  declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
11
11
  declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
12
12
  declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
13
- export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription };
13
+ export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
@@ -4,4 +4,4 @@ declare function TooltipProvider({ delayDuration, ...props }: React.ComponentPro
4
4
  declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
5
5
  declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
6
  declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
7
- export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
7
+ export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
@@ -8,6 +8,7 @@ declare const _default: {
8
8
  "other": "أخرى",
9
9
  "retry": "إعادة المحاولة",
10
10
  "save": "حفظ",
11
+ "settings": "الإعدادات",
11
12
  "submit": "إرسال",
12
13
  "toggle": "تبديل"
13
14
  },
@@ -157,6 +158,8 @@ declare const _default: {
157
158
  "noParentFieldsAvailable": "لا توجد حقول أصلية متاحة",
158
159
  "objectMapping": "تعيين الكائن",
159
160
  "objectMappingDesc": "تعيين خصائص الكائن المصدر إلى بنية جديدة",
161
+ "optional": "اختياري",
162
+ "optionDescription": "الوصف",
160
163
  "optionImageAdd": "إضافة صورة",
161
164
  "optionImageError": "تعذر معالجة الصورة.",
162
165
  "optionImageInvalid": "تنسيق صورة غير مدعوم.",
@@ -188,7 +191,10 @@ declare const _default: {
188
191
  "transformNumber": "تحويل إلى رقم",
189
192
  "transformString": "تحويل إلى نص",
190
193
  "transformType": "نوع التحويل",
191
- "validation": "التحقق"
194
+ "validation": "التحقق",
195
+ "variant": "متغير",
196
+ "variantCard": "بطاقة",
197
+ "variantDefault": "افتراضي"
192
198
  },
193
199
  "nodeActionsSheet": {
194
200
  "deleteNode": "حذف العقدة",