@middag-io/react 0.6.0 → 0.7.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 (44) hide show
  1. package/dist-lib/{ConditionTreeBlock-BGPYAImJ.js → ConditionTreeBlock-Cjp5jC4y.js} +39 -36
  2. package/dist-lib/{FormBuilderBlock-b_-QQaKn.js → FormBuilderBlock-CZLYP_2A.js} +773 -772
  3. package/dist-lib/{MarkdownContent-BgwUdgoN.js → MarkdownContent-BXOiFtrq.js} +1322 -1320
  4. package/dist-lib/{SentenceBuilderBlock-ClWjm0dX.js → SentenceBuilderBlock-CiUpfCrn.js} +39 -38
  5. package/dist-lib/app/providers/i18n-defaults.d.ts +12 -0
  6. package/dist-lib/app/providers/i18n-defaults.d.ts.map +1 -0
  7. package/dist-lib/app/providers/i18n.d.ts.map +1 -1
  8. package/dist-lib/base/blocks/ActionGridBlock.d.ts.map +1 -1
  9. package/dist-lib/base/blocks/ActivityTimelineBlock.d.ts.map +1 -1
  10. package/dist-lib/base/blocks/ConditionTreeBlock.d.ts.map +1 -1
  11. package/dist-lib/base/blocks/DenseTableBlock.d.ts.map +1 -1
  12. package/dist-lib/base/blocks/DetailPanelBlock.d.ts.map +1 -1
  13. package/dist-lib/base/blocks/EmptyStateBlock.d.ts.map +1 -1
  14. package/dist-lib/base/blocks/FormBuilderBlock.d.ts.map +1 -1
  15. package/dist-lib/base/blocks/FormPanelBlock.d.ts.map +1 -1
  16. package/dist-lib/base/blocks/SentenceBuilderBlock.d.ts.map +1 -1
  17. package/dist-lib/base/form/fields/MultiSelectField.d.ts.map +1 -1
  18. package/dist-lib/base/partials/ActionBar/index.d.ts.map +1 -1
  19. package/dist-lib/base/partials/ConfirmationDialog/index.d.ts.map +1 -1
  20. package/dist-lib/base/partials/DataTable/index.d.ts +1 -1
  21. package/dist-lib/base/partials/DataTable/index.d.ts.map +1 -1
  22. package/dist-lib/base/partials/FilterBar/index.d.ts.map +1 -1
  23. package/dist-lib/base/partials/FormSection/index.d.ts.map +1 -1
  24. package/dist-lib/base/partials/LogViewer/LogViewerToolbar.d.ts.map +1 -1
  25. package/dist-lib/base/partials/MarkdownContent/index.d.ts.map +1 -1
  26. package/dist-lib/base/partials/TimelineList/index.d.ts.map +1 -1
  27. package/dist-lib/base/shell/AdminShell.d.ts.map +1 -1
  28. package/dist-lib/base/shell/ProductShell.d.ts.map +1 -1
  29. package/dist-lib/base/shell/partials/CommandPalette.d.ts.map +1 -1
  30. package/dist-lib/base/shell/partials/HelpPanel.d.ts.map +1 -1
  31. package/dist-lib/base/shell/partials/InlineInspector.d.ts.map +1 -1
  32. package/dist-lib/base/shell/partials/NavErrorBoundary.d.ts.map +1 -1
  33. package/dist-lib/base/shell/partials/OverlayScreen.d.ts.map +1 -1
  34. package/dist-lib/base/shell/partials/PageActionButton.d.ts.map +1 -1
  35. package/dist-lib/base/shell/partials/PageHeader.d.ts.map +1 -1
  36. package/dist-lib/base/shell/partials/SidebarNav.d.ts.map +1 -1
  37. package/dist-lib/i18n-CWmqBtgM.js +126 -0
  38. package/dist-lib/index.d.ts +1 -0
  39. package/dist-lib/index.d.ts.map +1 -1
  40. package/dist-lib/middag-react.js +5015 -5037
  41. package/package.json +1 -1
  42. /package/dist-lib/{FlowEditorBlock-D3nx4re7.js → FlowEditorBlock-CHodeGBw.js} +0 -0
  43. /package/dist-lib/{dist-C3f2_wwS.js → dist-BDvVQ5m8.js} +0 -0
  44. /package/dist-lib/{index.min-BVLV21vp.js → index.min-Cno07_zY.js} +0 -0
@@ -1,83 +1,86 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
1
+ import { n as e } from "./i18n-CWmqBtgM.js";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
3
  //#region src/base/blocks/ConditionTreeBlock.tsx
3
- function n({ logic: t }) {
4
- return /* @__PURE__ */ e("span", {
5
- className: t === "and" ? "text-primary inline-flex items-center rounded bg-[oklch(0.93_0.04_264)] px-2 py-0.5 text-xs font-bold uppercase" : "inline-flex items-center rounded bg-[oklch(0.95_0.04_75)] px-2 py-0.5 text-xs font-bold text-[oklch(0.55_0.16_75)] uppercase",
6
- children: t
4
+ function r({ logic: e }) {
5
+ return /* @__PURE__ */ t("span", {
6
+ className: e === "and" ? "text-primary inline-flex items-center rounded bg-[oklch(0.93_0.04_264)] px-2 py-0.5 text-xs font-bold uppercase" : "inline-flex items-center rounded bg-[oklch(0.95_0.04_75)] px-2 py-0.5 text-xs font-bold text-[oklch(0.55_0.16_75)] uppercase",
7
+ children: e
7
8
  });
8
9
  }
9
- function r({ rule: n }) {
10
- return /* @__PURE__ */ t("div", {
10
+ function i({ rule: r }) {
11
+ let { t: i } = e();
12
+ return /* @__PURE__ */ n("div", {
11
13
  className: "bg-background flex items-center gap-2 rounded-md p-2",
12
14
  children: [
13
- /* @__PURE__ */ e("span", {
15
+ /* @__PURE__ */ t("span", {
14
16
  className: "border-border bg-muted/50 inline-flex items-center rounded border px-2 py-1 text-sm font-medium",
15
- children: n.field
17
+ children: r.field
16
18
  }),
17
- /* @__PURE__ */ e("span", {
19
+ /* @__PURE__ */ t("span", {
18
20
  className: "text-muted-foreground text-sm",
19
- children: n.operator
21
+ children: r.operator
20
22
  }),
21
- /* @__PURE__ */ e("span", {
23
+ /* @__PURE__ */ t("span", {
22
24
  className: "border-border bg-muted/50 inline-flex items-center rounded border px-2 py-1 text-sm font-medium",
23
- children: n.value
25
+ children: r.value
24
26
  }),
25
- /* @__PURE__ */ e("button", {
27
+ /* @__PURE__ */ t("button", {
26
28
  type: "button",
27
29
  className: "text-muted-foreground hover:text-destructive ml-auto flex h-6 w-6 items-center justify-center rounded text-sm transition-colors",
28
30
  tabIndex: -1,
29
- "aria-label": "Remover regra",
31
+ "aria-label": i("middag.ui.condition_tree.remove_rule"),
30
32
  children: "×"
31
33
  })
32
34
  ]
33
35
  });
34
36
  }
35
- function i({ group: a, depth: o }) {
36
- return /* @__PURE__ */ t("div", {
37
+ function a({ group: o, depth: s }) {
38
+ let { t: c } = e();
39
+ return /* @__PURE__ */ n("div", {
37
40
  className: "bg-muted/30 space-y-2 rounded-lg border p-3",
38
- style: o > 0 ? { marginLeft: `${o * 16}px` } : void 0,
41
+ style: s > 0 ? { marginLeft: `${s * 16}px` } : void 0,
39
42
  children: [
40
- /* @__PURE__ */ t("div", {
43
+ /* @__PURE__ */ n("div", {
41
44
  className: "flex items-center gap-2",
42
- children: [/* @__PURE__ */ e(n, { logic: a.logic }), o > 0 && /* @__PURE__ */ e("button", {
45
+ children: [/* @__PURE__ */ t(r, { logic: o.logic }), s > 0 && /* @__PURE__ */ t("button", {
43
46
  type: "button",
44
47
  className: "text-muted-foreground hover:text-destructive ml-auto flex h-6 w-6 items-center justify-center rounded text-sm transition-colors",
45
48
  tabIndex: -1,
46
- "aria-label": "Remover grupo",
49
+ "aria-label": c("middag.ui.condition_tree.remove_group"),
47
50
  children: "×"
48
51
  })]
49
52
  }),
50
- a.rules.map((t) => /* @__PURE__ */ e(r, { rule: t }, t.id)),
51
- a.groups.map((t) => /* @__PURE__ */ e(i, {
52
- group: t,
53
- depth: o + 1
54
- }, t.id)),
55
- /* @__PURE__ */ t("div", {
53
+ o.rules.map((e) => /* @__PURE__ */ t(i, { rule: e }, e.id)),
54
+ o.groups.map((e) => /* @__PURE__ */ t(a, {
55
+ group: e,
56
+ depth: s + 1
57
+ }, e.id)),
58
+ /* @__PURE__ */ n("div", {
56
59
  className: "flex items-center gap-2 pt-1",
57
- children: [/* @__PURE__ */ e("button", {
60
+ children: [/* @__PURE__ */ t("button", {
58
61
  type: "button",
59
62
  className: "text-muted-foreground hover:border-primary hover:text-primary rounded-md border border-dashed px-3 py-1 text-xs transition-colors",
60
63
  tabIndex: -1,
61
- children: "+ Adicionar regra"
62
- }), /* @__PURE__ */ e("button", {
64
+ children: c("middag.ui.condition_tree.add_rule")
65
+ }), /* @__PURE__ */ t("button", {
63
66
  type: "button",
64
67
  className: "text-muted-foreground hover:border-primary hover:text-primary rounded-md border border-dashed px-3 py-1 text-xs transition-colors",
65
68
  tabIndex: -1,
66
- children: "+ Adicionar grupo"
69
+ children: c("middag.ui.condition_tree.add_group")
67
70
  })]
68
71
  })
69
72
  ]
70
73
  });
71
74
  }
72
- function a({ block: t }) {
73
- let { data: n } = t;
74
- return /* @__PURE__ */ e("div", {
75
+ function o({ block: e }) {
76
+ let { data: n } = e;
77
+ return /* @__PURE__ */ t("div", {
75
78
  className: "space-y-3",
76
- children: /* @__PURE__ */ e(i, {
79
+ children: /* @__PURE__ */ t(a, {
77
80
  group: n.root,
78
81
  depth: 0
79
82
  })
80
83
  });
81
84
  }
82
85
  //#endregion
83
- export { a as ConditionTreeBlock };
86
+ export { o as ConditionTreeBlock };