@tesouro/embedded-components-react 0.7.70 → 0.7.73

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 (46) hide show
  1. package/README.md +15 -12
  2. package/dist/index.css +24 -6
  3. package/dist/index.d.ts +76 -8
  4. package/dist/lib/LinkedAccountsWidget.d.ts +9 -0
  5. package/dist/lib/ProductsWidget.d.ts +12 -6
  6. package/dist/lib/ReceivablesWidget.d.ts +1 -5
  7. package/dist/lib/TransfersWidget.d.ts +55 -2
  8. package/dist/lib/WidgetSuite.d.ts +63 -1
  9. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/LinkedAccountsWidget.js +6 -4
  10. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +199 -182
  11. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/ProductsWidget.js +23 -24
  12. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/constants.js +6 -2
  13. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/useProductsTable.js +112 -51
  14. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/useProductsWidget.js +80 -56
  15. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index.js +6 -5
  16. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index2.js +15 -6
  17. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index4.js +170 -135
  18. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index5.js +49 -150
  19. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index6.js +152 -24
  20. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index7.js +28 -0
  21. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/index.js +13 -12
  23. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +2 -2
  24. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/ProductSelector.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/helpers.js +41 -27
  26. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useProductForm.js +70 -52
  27. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index.js +7 -6
  28. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index2.js +19 -8
  29. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index3.js +171 -218
  30. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index4.js +52 -180
  31. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index5.js +188 -46
  32. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +47 -124
  33. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index7.js +128 -0
  34. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetFeature.js +4 -3
  35. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetInner.js +99 -108
  36. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/testIds.js +2 -0
  37. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/transferViews.js +135 -0
  38. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js +140 -153
  39. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferAccountTile.js +15 -0
  40. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferDetailSheet.js +111 -0
  41. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferStatusBadge.js +18 -0
  42. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransfersWidget.js +181 -126
  43. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/labels.js +33 -0
  44. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/sections/TransfersSection.js +16 -8
  45. package/dist/packages/shared-ui-shadcn/dist/index.js +328 -327
  46. package/package.json +1 -1
@@ -1,193 +1,65 @@
1
- import { Button as e, DropdownMenu as t, DropdownMenuContent as n, DropdownMenuItem as r, DropdownMenuTrigger as i, Input as a, InputGroup as o, InputGroupInput as s, Sheet as c, SheetContent as l, SheetDescription as u, SheetFooter as d, SheetHeader as f, SheetTitle as p, Table as m, TableBody as h, TableCell as g, TableHead as _, TableHeader as v, TableRow as y } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { MEASURE_UNITS_MANAGER_LABELS_EN as b } from "./index2.js";
3
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
4
- import { CheckIcon as C, MoreVerticalIcon as w, PencilIcon as T, Trash2Icon as E, XIcon as D } from "lucide-react";
1
+ import { Button as e, Sheet as t, SheetContent as n, SheetDescription as r, SheetFooter as i, SheetHeader as a, SheetTitle as o } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { mergeProductFormSheetLabels as s } from "./index2.js";
3
+ import { ProductFormFields as c } from "./index3.js";
4
+ import { useId as l } from "react";
5
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
5
6
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index4.js
6
- var O = "—";
7
- function k({ open: k, onOpenChange: A, units: j, isLoading: M, searchValue: N, onSearchChange: P, createValues: F, createError: I, onCreateChange: L, onCreateSubmit: R, isCreating: z, editingUnitId: B, editValues: V, editError: H, onEditStart: U, onEditChange: W, onEditSubmit: G, onEditCancel: K, isUpdating: q, onDeleteClick: J, onDone: Y, labels: X }) {
8
- let Z = {
9
- ...b,
10
- ...X
11
- };
12
- return /* @__PURE__ */ x(c, {
13
- open: k,
14
- onOpenChange: A,
15
- children: /* @__PURE__ */ S(l, {
16
- className: "ttw:w-150 ttw:sm:max-w-150 ttw:gap-0 ttw:p-0",
7
+ function f({ open: f, onOpenChange: p, values: m, errors: h, unitOptions: g, pricePrefix: _, inProgress: v, onChange: y, onSubmit: b, onCancel: x, labels: S }) {
8
+ let C = s(S), w = l(), T = m.type === "service" ? C.typeService.toLowerCase() : C.typeProduct.toLowerCase();
9
+ return /* @__PURE__ */ u(t, {
10
+ open: f,
11
+ onOpenChange: p,
12
+ children: /* @__PURE__ */ d(n, {
13
+ className: "ttw:w-150 ttw:sm:max-w-150 ttw:gap-0",
17
14
  children: [
18
- /* @__PURE__ */ S(f, {
15
+ /* @__PURE__ */ d(a, {
19
16
  className: "ttw:border-b ttw:border-border",
20
- children: [/* @__PURE__ */ x(p, { children: Z.title }), /* @__PURE__ */ x(u, {
21
- className: "ttw:sr-only",
22
- children: Z.hiddenDescription
17
+ children: [/* @__PURE__ */ u(o, {
18
+ className: "ttw:text-2xl",
19
+ children: C.createTitle
20
+ }), /* @__PURE__ */ u(r, {
21
+ className: "ttw:max-w-130",
22
+ children: C.headerDescription
23
23
  })]
24
24
  }),
25
- /* @__PURE__ */ S("div", {
26
- className: "ttw:flex-1 ttw:flex ttw:flex-col ttw:gap-4 ttw:overflow-y-auto ttw:px-6 ttw:py-4",
27
- children: [/* @__PURE__ */ x(o, { children: /* @__PURE__ */ x(s, {
28
- placeholder: Z.searchPlaceholder,
29
- value: N,
30
- onChange: (e) => P(e.target.value)
31
- }) }), /* @__PURE__ */ S(m, {
32
- className: "ttw:table-fixed ttw:border ttw:border-border ttw:rounded-md",
33
- children: [/* @__PURE__ */ x(v, { children: /* @__PURE__ */ S(y, {
34
- className: "ttw:hover:bg-transparent ttw:border-border",
35
- children: [
36
- /* @__PURE__ */ x(_, {
37
- className: "ttw:w-[30%]",
38
- children: Z.columnLabel
39
- }),
40
- /* @__PURE__ */ x(_, {
41
- className: "ttw:w-[50%]",
42
- children: Z.columnDescription
43
- }),
44
- /* @__PURE__ */ x(_, { className: "ttw:w-[20%]" })
45
- ]
46
- }) }), /* @__PURE__ */ S(h, { children: [
47
- /* @__PURE__ */ S(y, {
48
- className: "ttw:hover:bg-transparent ttw:border-border",
49
- children: [
50
- /* @__PURE__ */ S(g, {
51
- className: "ttw:align-top",
52
- children: [/* @__PURE__ */ x(a, {
53
- placeholder: Z.namePlaceholder,
54
- value: F.name,
55
- "aria-invalid": !!I,
56
- disabled: z,
57
- className: "ttw:h-8",
58
- onChange: (e) => L({ name: e.target.value })
59
- }), I && /* @__PURE__ */ x("p", {
60
- className: "ttw:mt-1 ttw:text-sm ttw:text-destructive",
61
- children: I
62
- })]
63
- }),
64
- /* @__PURE__ */ x(g, {
65
- className: "ttw:align-top",
66
- children: /* @__PURE__ */ x(a, {
67
- placeholder: Z.descriptionPlaceholder,
68
- value: F.description,
69
- disabled: z,
70
- className: "ttw:h-8",
71
- onChange: (e) => L({ description: e.target.value })
72
- })
73
- }),
74
- /* @__PURE__ */ x(g, {
75
- className: "ttw:align-top ttw:text-right",
76
- children: /* @__PURE__ */ x(e, {
77
- variant: "secondary",
78
- size: "sm",
79
- onClick: R,
80
- disabled: z,
81
- children: Z.addButton
82
- })
83
- })
84
- ]
85
- }),
86
- M ? null : j.map((o) => B === o.id ? /* @__PURE__ */ S(y, {
87
- className: "ttw:hover:bg-transparent ttw:border-border",
88
- children: [
89
- /* @__PURE__ */ S(g, {
90
- className: "ttw:align-top",
91
- children: [/* @__PURE__ */ x(a, {
92
- value: V.name,
93
- "aria-invalid": !!H,
94
- disabled: q,
95
- className: "ttw:h-8",
96
- onChange: (e) => W({ name: e.target.value })
97
- }), H && /* @__PURE__ */ x("p", {
98
- className: "ttw:mt-1 ttw:text-sm ttw:text-destructive",
99
- children: H
100
- })]
101
- }),
102
- /* @__PURE__ */ x(g, {
103
- className: "ttw:align-top",
104
- children: /* @__PURE__ */ x(a, {
105
- value: V.description,
106
- disabled: q,
107
- className: "ttw:h-8",
108
- onChange: (e) => W({ description: e.target.value })
109
- })
110
- }),
111
- /* @__PURE__ */ x(g, {
112
- className: "ttw:align-top",
113
- children: /* @__PURE__ */ S("div", {
114
- className: "ttw:flex ttw:justify-end ttw:gap-1",
115
- children: [/* @__PURE__ */ x(e, {
116
- variant: "outline",
117
- size: "icon",
118
- "aria-label": Z.saveAction,
119
- onClick: G,
120
- disabled: q,
121
- className: "ttw:size-8 ttw:border-border",
122
- children: /* @__PURE__ */ x(C, { className: "ttw:size-4" })
123
- }), /* @__PURE__ */ x(e, {
124
- variant: "outline",
125
- size: "icon",
126
- "aria-label": Z.cancelAction,
127
- onClick: K,
128
- disabled: q,
129
- className: "ttw:size-8 ttw:border-border",
130
- children: /* @__PURE__ */ x(D, { className: "ttw:size-4" })
131
- })]
132
- })
133
- })
134
- ]
135
- }, o.id) : /* @__PURE__ */ S(y, {
136
- className: "ttw:hover:bg-transparent ttw:border-border",
137
- children: [
138
- /* @__PURE__ */ x(g, {
139
- className: "ttw:text-sm ttw:truncate",
140
- children: o.name
141
- }),
142
- /* @__PURE__ */ x(g, {
143
- className: "ttw:text-sm ttw:text-muted-foreground ttw:truncate",
144
- children: o.description || O
145
- }),
146
- /* @__PURE__ */ x(g, {
147
- className: "ttw:text-right",
148
- children: /* @__PURE__ */ S(t, { children: [/* @__PURE__ */ x(i, {
149
- asChild: !0,
150
- children: /* @__PURE__ */ x(e, {
151
- variant: "ghost",
152
- size: "icon-sm",
153
- "aria-label": Z.moreActionsLabel,
154
- children: /* @__PURE__ */ x(w, { className: "ttw:size-4" })
155
- })
156
- }), /* @__PURE__ */ S(n, {
157
- align: "end",
158
- children: [/* @__PURE__ */ S(r, {
159
- onClick: () => U(o),
160
- children: [/* @__PURE__ */ x(T, { className: "ttw:size-4" }), Z.editAction]
161
- }), /* @__PURE__ */ S(r, {
162
- onClick: () => J(o),
163
- variant: "destructive",
164
- children: [/* @__PURE__ */ x(E, { className: "ttw:size-4" }), Z.deleteAction]
165
- })]
166
- })] })
167
- })
168
- ]
169
- }, o.id)),
170
- !M && j.length === 0 && /* @__PURE__ */ x(y, {
171
- className: "ttw:hover:bg-transparent",
172
- children: /* @__PURE__ */ x(g, {
173
- colSpan: 3,
174
- className: "ttw:text-center ttw:text-muted-foreground",
175
- children: Z.emptyText
176
- })
177
- })
178
- ] })]
179
- })]
25
+ /* @__PURE__ */ u("form", {
26
+ id: w,
27
+ onSubmit: (e) => {
28
+ e.preventDefault(), e.stopPropagation(), b();
29
+ },
30
+ children: /* @__PURE__ */ u("div", {
31
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-6 ttw:py-8 ttw:overflow-auto",
32
+ children: /* @__PURE__ */ u(c, {
33
+ idPrefix: w,
34
+ values: m,
35
+ errors: h,
36
+ unitOptions: g,
37
+ pricePrefix: _,
38
+ onChange: y,
39
+ labels: S
40
+ })
41
+ })
180
42
  }),
181
- /* @__PURE__ */ x(d, {
43
+ /* @__PURE__ */ d(i, {
182
44
  className: "ttw:border-t ttw:border-border ttw:flex-row ttw:justify-end",
183
- children: /* @__PURE__ */ x(e, {
184
- onClick: Y,
185
- children: Z.doneButton
186
- })
45
+ children: [/* @__PURE__ */ u(e, {
46
+ type: "button",
47
+ variant: "outline",
48
+ className: "ttw:w-fit ttw:border-border",
49
+ onClick: x,
50
+ children: C.cancelButton
51
+ }), /* @__PURE__ */ u(e, {
52
+ type: "submit",
53
+ form: w,
54
+ className: "ttw:w-fit",
55
+ disabled: v,
56
+ loading: v,
57
+ children: C.createButton.replace("{type}", T)
58
+ })]
187
59
  })
188
60
  ]
189
61
  })
190
62
  });
191
63
  }
192
64
  //#endregion
193
- export { k as MeasureUnitsManager, k as default };
65
+ export { f as ProductFormSheet, f as default };
@@ -1,51 +1,193 @@
1
- import { AlertDialog as e, AlertDialogContent as t, AlertDialogDescription as n, AlertDialogFooter as r, AlertDialogHeader as i, AlertDialogTitle as a, Button as o, Spinner as s, Table as c, TableBody as l, TableCell as u, TableRow as d } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { MEASURE_UNIT_DELETE_DIALOG_LABELS_EN as f } from "./index2.js";
3
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
1
+ import { Button as e, DropdownMenu as t, DropdownMenuContent as n, DropdownMenuItem as r, DropdownMenuTrigger as i, Input as a, InputGroup as o, InputGroupInput as s, Sheet as c, SheetContent as l, SheetDescription as u, SheetFooter as d, SheetHeader as f, SheetTitle as p, Table as m, TableBody as h, TableCell as g, TableHead as _, TableHeader as v, TableRow as y } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { MEASURE_UNITS_MANAGER_LABELS_EN as b } from "./index2.js";
3
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
4
+ import { CheckIcon as C, MoreVerticalIcon as w, PencilIcon as T, Trash2Icon as E, XIcon as D } from "lucide-react";
4
5
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index5.js
5
- function h({ open: h, onOpenChange: g, unitName: _, affectedProducts: v, isLoadingProducts: y, isDeleting: b, onConfirm: x, onCancel: S, labels: C }) {
6
- let w = {
7
- ...f,
8
- ...C
9
- }, T = v.length > 0;
10
- return /* @__PURE__ */ p(e, {
11
- open: h,
12
- onOpenChange: g,
13
- children: /* @__PURE__ */ m(t, { children: [
14
- /* @__PURE__ */ m(i, { children: [/* @__PURE__ */ p(a, { children: (T ? w.titleWithItems : w.titleNoItems).replace("{name}", _) }), /* @__PURE__ */ p(n, { children: T ? w.messageWithItems : w.messageNoItems })] }),
15
- /* @__PURE__ */ p("p", {
16
- className: "ttw:text-sm ttw:text-muted-foreground",
17
- children: T ? w.messageWithItemsHint : w.messageNoItemsHint
18
- }),
19
- y ? /* @__PURE__ */ p("div", {
20
- className: "ttw:flex ttw:justify-center ttw:py-4",
21
- children: /* @__PURE__ */ p(s, {})
22
- }) : T ? /* @__PURE__ */ p("div", {
23
- className: "ttw:max-h-60 ttw:overflow-auto ttw:rounded-md ttw:border",
24
- children: /* @__PURE__ */ p(c, { children: /* @__PURE__ */ p(l, { children: v.map((e) => /* @__PURE__ */ m(d, {
25
- className: "ttw:border-border ttw:hover:bg-transparent",
26
- children: [/* @__PURE__ */ p(u, {
27
- className: "ttw:pl-0 ttw:whitespace-normal ttw:text-text ttw:font-medium",
28
- children: e.name
29
- }), /* @__PURE__ */ p(u, {
30
- className: "ttw:pr-0 ttw:text-right ttw:text-text ttw:font-medium",
31
- children: e.priceLabel
6
+ var O = "—";
7
+ function k({ open: k, onOpenChange: A, units: j, isLoading: M, searchValue: N, onSearchChange: P, createValues: F, createError: I, onCreateChange: L, onCreateSubmit: R, isCreating: z, editingUnitId: B, editValues: V, editError: H, onEditStart: U, onEditChange: W, onEditSubmit: G, onEditCancel: K, isUpdating: q, onDeleteClick: J, onDone: Y, labels: X }) {
8
+ let Z = {
9
+ ...b,
10
+ ...X
11
+ };
12
+ return /* @__PURE__ */ x(c, {
13
+ open: k,
14
+ onOpenChange: A,
15
+ children: /* @__PURE__ */ S(l, {
16
+ className: "ttw:w-150 ttw:sm:max-w-150 ttw:gap-0 ttw:p-0",
17
+ children: [
18
+ /* @__PURE__ */ S(f, {
19
+ className: "ttw:border-b ttw:border-border",
20
+ children: [/* @__PURE__ */ x(p, { children: Z.title }), /* @__PURE__ */ x(u, {
21
+ className: "ttw:sr-only",
22
+ children: Z.hiddenDescription
32
23
  })]
33
- }, e.id)) }) })
34
- }) : null,
35
- /* @__PURE__ */ m(r, { children: [/* @__PURE__ */ p(o, {
36
- variant: "ghost",
37
- onClick: S,
38
- disabled: b,
39
- children: w.cancelButton
40
- }), /* @__PURE__ */ p(o, {
41
- variant: "destructive",
42
- onClick: x,
43
- disabled: b || y,
44
- loading: b,
45
- children: w.confirmButton
46
- })] })
47
- ] })
24
+ }),
25
+ /* @__PURE__ */ S("div", {
26
+ className: "ttw:flex-1 ttw:flex ttw:flex-col ttw:gap-4 ttw:overflow-y-auto ttw:px-6 ttw:py-4",
27
+ children: [/* @__PURE__ */ x(o, { children: /* @__PURE__ */ x(s, {
28
+ placeholder: Z.searchPlaceholder,
29
+ value: N,
30
+ onChange: (e) => P(e.target.value)
31
+ }) }), /* @__PURE__ */ S(m, {
32
+ className: "ttw:table-fixed ttw:border ttw:border-border ttw:rounded-md",
33
+ children: [/* @__PURE__ */ x(v, { children: /* @__PURE__ */ S(y, {
34
+ className: "ttw:hover:bg-transparent ttw:border-border",
35
+ children: [
36
+ /* @__PURE__ */ x(_, {
37
+ className: "ttw:w-[30%]",
38
+ children: Z.columnLabel
39
+ }),
40
+ /* @__PURE__ */ x(_, {
41
+ className: "ttw:w-[50%]",
42
+ children: Z.columnDescription
43
+ }),
44
+ /* @__PURE__ */ x(_, { className: "ttw:w-[20%]" })
45
+ ]
46
+ }) }), /* @__PURE__ */ S(h, { children: [
47
+ /* @__PURE__ */ S(y, {
48
+ className: "ttw:hover:bg-transparent ttw:border-border",
49
+ children: [
50
+ /* @__PURE__ */ S(g, {
51
+ className: "ttw:align-top",
52
+ children: [/* @__PURE__ */ x(a, {
53
+ placeholder: Z.namePlaceholder,
54
+ value: F.name,
55
+ "aria-invalid": !!I,
56
+ disabled: z,
57
+ className: "ttw:h-8",
58
+ onChange: (e) => L({ name: e.target.value })
59
+ }), I && /* @__PURE__ */ x("p", {
60
+ className: "ttw:mt-1 ttw:text-sm ttw:text-destructive",
61
+ children: I
62
+ })]
63
+ }),
64
+ /* @__PURE__ */ x(g, {
65
+ className: "ttw:align-top",
66
+ children: /* @__PURE__ */ x(a, {
67
+ placeholder: Z.descriptionPlaceholder,
68
+ value: F.description,
69
+ disabled: z,
70
+ className: "ttw:h-8",
71
+ onChange: (e) => L({ description: e.target.value })
72
+ })
73
+ }),
74
+ /* @__PURE__ */ x(g, {
75
+ className: "ttw:align-top ttw:text-right",
76
+ children: /* @__PURE__ */ x(e, {
77
+ variant: "secondary",
78
+ size: "sm",
79
+ onClick: R,
80
+ disabled: z,
81
+ children: Z.addButton
82
+ })
83
+ })
84
+ ]
85
+ }),
86
+ M ? null : j.map((o) => B === o.id ? /* @__PURE__ */ S(y, {
87
+ className: "ttw:hover:bg-transparent ttw:border-border",
88
+ children: [
89
+ /* @__PURE__ */ S(g, {
90
+ className: "ttw:align-top",
91
+ children: [/* @__PURE__ */ x(a, {
92
+ value: V.name,
93
+ "aria-invalid": !!H,
94
+ disabled: q,
95
+ className: "ttw:h-8",
96
+ onChange: (e) => W({ name: e.target.value })
97
+ }), H && /* @__PURE__ */ x("p", {
98
+ className: "ttw:mt-1 ttw:text-sm ttw:text-destructive",
99
+ children: H
100
+ })]
101
+ }),
102
+ /* @__PURE__ */ x(g, {
103
+ className: "ttw:align-top",
104
+ children: /* @__PURE__ */ x(a, {
105
+ value: V.description,
106
+ disabled: q,
107
+ className: "ttw:h-8",
108
+ onChange: (e) => W({ description: e.target.value })
109
+ })
110
+ }),
111
+ /* @__PURE__ */ x(g, {
112
+ className: "ttw:align-top",
113
+ children: /* @__PURE__ */ S("div", {
114
+ className: "ttw:flex ttw:justify-end ttw:gap-1",
115
+ children: [/* @__PURE__ */ x(e, {
116
+ variant: "outline",
117
+ size: "icon",
118
+ "aria-label": Z.saveAction,
119
+ onClick: G,
120
+ disabled: q,
121
+ className: "ttw:size-8 ttw:border-border",
122
+ children: /* @__PURE__ */ x(C, { className: "ttw:size-4" })
123
+ }), /* @__PURE__ */ x(e, {
124
+ variant: "outline",
125
+ size: "icon",
126
+ "aria-label": Z.cancelAction,
127
+ onClick: K,
128
+ disabled: q,
129
+ className: "ttw:size-8 ttw:border-border",
130
+ children: /* @__PURE__ */ x(D, { className: "ttw:size-4" })
131
+ })]
132
+ })
133
+ })
134
+ ]
135
+ }, o.id) : /* @__PURE__ */ S(y, {
136
+ className: "ttw:hover:bg-transparent ttw:border-border",
137
+ children: [
138
+ /* @__PURE__ */ x(g, {
139
+ className: "ttw:text-sm ttw:truncate",
140
+ children: o.name
141
+ }),
142
+ /* @__PURE__ */ x(g, {
143
+ className: "ttw:text-sm ttw:text-muted-foreground ttw:truncate",
144
+ children: o.description || O
145
+ }),
146
+ /* @__PURE__ */ x(g, {
147
+ className: "ttw:text-right",
148
+ children: /* @__PURE__ */ S(t, { children: [/* @__PURE__ */ x(i, {
149
+ asChild: !0,
150
+ children: /* @__PURE__ */ x(e, {
151
+ variant: "ghost",
152
+ size: "icon-sm",
153
+ "aria-label": Z.moreActionsLabel,
154
+ children: /* @__PURE__ */ x(w, { className: "ttw:size-4" })
155
+ })
156
+ }), /* @__PURE__ */ S(n, {
157
+ align: "end",
158
+ children: [/* @__PURE__ */ S(r, {
159
+ onClick: () => U(o),
160
+ children: [/* @__PURE__ */ x(T, { className: "ttw:size-4" }), Z.editAction]
161
+ }), /* @__PURE__ */ S(r, {
162
+ onClick: () => J(o),
163
+ variant: "destructive",
164
+ children: [/* @__PURE__ */ x(E, { className: "ttw:size-4" }), Z.deleteAction]
165
+ })]
166
+ })] })
167
+ })
168
+ ]
169
+ }, o.id)),
170
+ !M && j.length === 0 && /* @__PURE__ */ x(y, {
171
+ className: "ttw:hover:bg-transparent",
172
+ children: /* @__PURE__ */ x(g, {
173
+ colSpan: 3,
174
+ className: "ttw:text-center ttw:text-muted-foreground",
175
+ children: Z.emptyText
176
+ })
177
+ })
178
+ ] })]
179
+ })]
180
+ }),
181
+ /* @__PURE__ */ x(d, {
182
+ className: "ttw:border-t ttw:border-border ttw:flex-row ttw:justify-end",
183
+ children: /* @__PURE__ */ x(e, {
184
+ onClick: Y,
185
+ children: Z.doneButton
186
+ })
187
+ })
188
+ ]
189
+ })
48
190
  });
49
191
  }
50
192
  //#endregion
51
- export { h as MeasureUnitDeleteDialog, h as default };
193
+ export { k as MeasureUnitsManager, k as default };