@tesouro/embedded-components-react 0.11.206 → 0.11.211

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 (89) hide show
  1. package/dist/index.css +13 -126
  2. package/dist/index.d.ts +6 -5
  3. package/dist/lib/ReceivablesWidget.d.ts +6 -5
  4. package/dist/lib/WidgetSuite.d.ts +6 -5
  5. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableAttachmentsSection.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableCustomerSection.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +16 -18
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +186 -239
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +59 -52
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +5 -4
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentRecord.js +5 -5
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentTerms.js +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/preview.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurringSeries.js +19 -23
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/reminders.js +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/statusColors.js +34 -0
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +2 -6
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +5 -1
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +16 -16
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +1 -2
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +2 -0
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +28 -27
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +18 -120
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +89 -84
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +91 -36
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +41 -2
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +2 -12
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +9 -9
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +9 -25
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +26 -208
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +209 -52
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +50 -208
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +186 -138
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +157 -12
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +10 -19
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +23 -2
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +2 -116
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +117 -3
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +3 -198
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +198 -2
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +2 -54
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +14 -19
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +22 -8
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +40 -77
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +17 -37
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +8 -18
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +61 -38
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +27 -27
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +26 -15
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +14 -6
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +19 -35
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +31 -14
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +67 -24
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +391 -84
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +2 -494
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +47 -2
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +62 -38
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +433 -61
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +176 -428
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +20 -224
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +6 -21
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +264 -0
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +2 -264
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +131 -2
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +22 -126
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +235 -23
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +3 -239
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +247 -3
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +26 -244
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js +183 -26
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +21 -194
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index61.js +143 -21
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index62.js +2 -143
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index63.js +47 -2
  77. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index16.js +47 -48
  78. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +127 -144
  79. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index3.js +0 -3
  80. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index16.js +107 -111
  81. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index5.js +1 -1
  82. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index.js +2 -2
  83. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index7.js +2 -31
  84. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  85. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/helpers.js +1 -1
  86. package/dist/packages/shared-ui-shadcn/dist/index.js +1554 -1544
  87. package/package.json +1 -1
  88. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +0 -7
  89. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index64.js +0 -47
@@ -1,27 +1,239 @@
1
- import { Typography as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- import { FileIcon as r, MailXIcon as i, SendIcon as a } from "lucide-react";
1
+ import { Button as e, DatePicker as t, FieldError as n, Input as r, Label as i, Select as a, SelectContent as o, SelectItem as s, SelectSeparator as c, SelectTrigger as l, SelectValue as u, Typography as d, cn as f } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_RECURRENCE_SECTION_LABELS_EN as p } from "./index18.js";
3
+ import { CreationModeOption as m } from "./index54.js";
4
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
4
5
  // ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js
5
- var o = {
6
- issue_and_send: a,
7
- issue: i,
8
- draft: r
9
- };
10
- function s({ option: r }) {
11
- let i = o[r.value];
12
- return /* @__PURE__ */ n("div", {
13
- className: "ttw:flex ttw:items-center ttw:gap-3",
14
- children: [/* @__PURE__ */ t(i, { className: "ttw:size-5 ttw:shrink-0 ttw:text-muted-foreground" }), /* @__PURE__ */ n("div", {
15
- className: "ttw:flex ttw:flex-col ttw:text-left",
16
- children: [/* @__PURE__ */ t(e, {
17
- variant: "body2",
18
- children: r.title
19
- }), /* @__PURE__ */ t(e, {
20
- variant: "body2",
21
- color: "muted",
22
- children: r.description
23
- })]
6
+ var v = "ttw:text-sm ttw:font-normal ttw:text-nowrap ttw:text-muted-foreground";
7
+ function y({ idPrefix: y, view: b, disabled: x, onFrequencyChange: S, onMonthDayChange: C, onWeekdayChange: w, onStartDateChange: T, onEndModeChange: E, onEndDateChange: D, onMaxOccurrencesChange: O, onCreationModeChange: k, onSetUpEmailClick: A, emailDialog: j, labels: M }) {
8
+ let N = {
9
+ ...p,
10
+ ...M
11
+ }, P = {
12
+ frequency: `${y}-frequency`,
13
+ monthDay: `${y}-issue-mode`,
14
+ startDate: `${y}-start-date`,
15
+ endMode: `${y}-end-mode`,
16
+ endDate: `${y}-end-date`,
17
+ occurrences: `${y}-max-occurrences`,
18
+ creationMode: `${y}-automation-level`,
19
+ emailError: `${y}-email-error`
20
+ }, { schedule: F, creationMode: I } = b, L = (e, n, r) => /* @__PURE__ */ g("div", {
21
+ className: "ttw:w-44",
22
+ children: /* @__PURE__ */ g(t, {
23
+ id: e,
24
+ value: n.value,
25
+ onChange: r,
26
+ placeholder: N.recurrenceDatePlaceholder,
27
+ disabled: x || n.disabled,
28
+ minDate: n.minDate,
29
+ maxDate: n.maxDate,
30
+ defaultMonth: n.minDate,
31
+ disabledDates: n.isDateDisabled,
32
+ "aria-invalid": n.invalid || void 0,
33
+ className: "ttw:flex-row-reverse ttw:justify-between ttw:text-foreground ttw:[&>svg]:mr-0"
34
+ })
35
+ }), R = (e) => /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("div", {
36
+ className: "ttw:relative",
37
+ children: [/* @__PURE__ */ g(r, {
38
+ id: P.occurrences,
39
+ className: "ttw:w-16",
40
+ type: "text",
41
+ inputMode: "numeric",
42
+ value: e.value,
43
+ disabled: x,
44
+ "aria-invalid": e.invalid || void 0,
45
+ "aria-describedby": F?.maxOccurrencesError ? `${P.occurrences}-error` : void 0,
46
+ onChange: (e) => O(e.target.value)
47
+ }), F?.maxOccurrencesError && /* @__PURE__ */ g(n, {
48
+ id: `${P.occurrences}-error`,
49
+ className: "ttw:absolute ttw:top-full ttw:left-0 ttw:mt-1 ttw:text-nowrap",
50
+ errors: [{ message: F.maxOccurrencesError }]
24
51
  })]
52
+ }), /* @__PURE__ */ g(i, {
53
+ htmlFor: P.occurrences,
54
+ className: v,
55
+ children: e.unitLabel
56
+ })] });
57
+ return /* @__PURE__ */ _("section", {
58
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5",
59
+ children: [
60
+ /* @__PURE__ */ _("div", {
61
+ className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-2.5",
62
+ children: [
63
+ /* @__PURE__ */ g(i, {
64
+ htmlFor: P.frequency,
65
+ className: v,
66
+ children: N.recurrenceRepeatLabel
67
+ }),
68
+ /* @__PURE__ */ _(a, {
69
+ value: b.frequency.value,
70
+ disabled: x || b.frequency.disabled,
71
+ onValueChange: S,
72
+ children: [/* @__PURE__ */ g(l, {
73
+ id: P.frequency,
74
+ className: "ttw:w-31",
75
+ children: /* @__PURE__ */ g(u, {})
76
+ }), /* @__PURE__ */ g(o, { children: b.frequency.options.map((e) => /* @__PURE__ */ g(s, {
77
+ value: e.value,
78
+ children: e.label
79
+ }, e.value)) })]
80
+ }),
81
+ b.monthDay && /* @__PURE__ */ _(h, { children: [
82
+ /* @__PURE__ */ g(i, {
83
+ htmlFor: P.monthDay,
84
+ className: v,
85
+ children: N.recurrenceMonthDayLead
86
+ }),
87
+ /* @__PURE__ */ _(a, {
88
+ value: b.monthDay.value,
89
+ disabled: x || b.monthDay.disabled,
90
+ onValueChange: C,
91
+ children: [/* @__PURE__ */ g(l, {
92
+ id: P.monthDay,
93
+ className: "ttw:w-fit ttw:min-w-21",
94
+ "aria-invalid": b.monthDay.invalid || void 0,
95
+ children: /* @__PURE__ */ g(u, {})
96
+ }), /* @__PURE__ */ _(o, { children: [
97
+ b.monthDay.edgeOptions.map((e) => /* @__PURE__ */ g(s, {
98
+ value: e.value,
99
+ children: e.label
100
+ }, e.value)),
101
+ /* @__PURE__ */ g(c, {}),
102
+ b.monthDay.dayOptions.map((e) => /* @__PURE__ */ g(s, {
103
+ value: e.value,
104
+ children: e.label
105
+ }, e.value))
106
+ ] })]
107
+ }),
108
+ /* @__PURE__ */ g(d, {
109
+ variant: "body2",
110
+ color: "muted",
111
+ component: "span",
112
+ className: "ttw:text-nowrap",
113
+ children: b.monthDay.trailLabel
114
+ })
115
+ ] }),
116
+ b.weekday && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(d, {
117
+ variant: "body2",
118
+ color: "muted",
119
+ component: "span",
120
+ children: N.recurrenceWeekdayLead
121
+ }), /* @__PURE__ */ g("div", {
122
+ className: f("ttw:flex ttw:h-8 ttw:w-56 ttw:rounded-md ttw:border ttw:border-border", b.weekday.invalid && "ttw:border-destructive", b.weekday.disabled && "ttw:opacity-50"),
123
+ children: b.weekday.options.map((e, t, n) => /* @__PURE__ */ g("button", {
124
+ type: "button",
125
+ disabled: x || b.weekday?.disabled,
126
+ "aria-pressed": e.pressed,
127
+ onClick: () => w(e.value),
128
+ className: f("ttw:flex ttw:flex-1 ttw:items-center ttw:justify-center ttw:text-sm ttw:font-medium ttw:transition-colors ttw:hover:cursor-pointer ttw:hover:bg-muted ttw:disabled:pointer-events-none", e.pressed && "ttw:bg-muted", t < n.length - 1 && "ttw:border-r ttw:border-border"),
129
+ children: e.label
130
+ }, e.value))
131
+ })] })
132
+ ]
133
+ }),
134
+ F && /* @__PURE__ */ _("div", {
135
+ className: f("ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-2.5", F.maxOccurrencesError && "ttw:pb-6"),
136
+ children: [
137
+ /* @__PURE__ */ g(i, {
138
+ htmlFor: P.startDate,
139
+ className: v,
140
+ children: N.recurrenceStartOnLabel
141
+ }),
142
+ L(P.startDate, F.start, T),
143
+ F.end.kind === "choice" ? /* @__PURE__ */ _(h, { children: [
144
+ /* @__PURE__ */ g(i, {
145
+ htmlFor: P.endMode,
146
+ className: v,
147
+ children: N.recurrenceEndChoiceLead
148
+ }),
149
+ /* @__PURE__ */ _(a, {
150
+ value: F.end.mode.value,
151
+ disabled: x,
152
+ onValueChange: E,
153
+ children: [/* @__PURE__ */ g(l, {
154
+ id: P.endMode,
155
+ className: "ttw:w-21",
156
+ "aria-invalid": F.end.mode.invalid || void 0,
157
+ children: /* @__PURE__ */ g(u, {})
158
+ }), /* @__PURE__ */ g(o, { children: F.end.mode.options.map((e) => /* @__PURE__ */ g(s, {
159
+ value: e.value,
160
+ children: e.label
161
+ }, e.value)) })]
162
+ }),
163
+ F.end.date && L(P.endDate, F.end.date, D),
164
+ F.end.occurrences && R(F.end.occurrences)
165
+ ] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(i, {
166
+ htmlFor: P.occurrences,
167
+ className: v,
168
+ children: N.recurrenceEndCountLead
169
+ }), R(F.end.occurrences)] })
170
+ ]
171
+ }),
172
+ j,
173
+ b.lastDayCaption && /* @__PURE__ */ g(d, {
174
+ variant: "caption",
175
+ color: "muted",
176
+ children: b.lastDayCaption
177
+ }),
178
+ I && /* @__PURE__ */ _("div", {
179
+ className: "ttw:flex ttw:flex-col ttw:gap-2 ttw:pt-1.5",
180
+ children: [
181
+ /* @__PURE__ */ g(i, {
182
+ htmlFor: P.creationMode,
183
+ children: /* @__PURE__ */ _(d, {
184
+ variant: "body2",
185
+ component: "span",
186
+ className: "ttw:block",
187
+ children: [
188
+ N.recurrenceCreationModeQuestion,
189
+ " ",
190
+ /* @__PURE__ */ g(d, {
191
+ variant: "body2",
192
+ component: "span",
193
+ color: "muted",
194
+ children: N.recurrenceCreationModeHint
195
+ })
196
+ ]
197
+ })
198
+ }),
199
+ /* @__PURE__ */ _(a, {
200
+ value: I.value,
201
+ disabled: x,
202
+ onValueChange: (e) => k(e),
203
+ children: [/* @__PURE__ */ g(l, {
204
+ id: P.creationMode,
205
+ "aria-invalid": !!I.emailError || void 0,
206
+ "aria-describedby": I.emailError ? P.emailError : void 0,
207
+ className: "ttw:h-auto! ttw:w-full ttw:py-2.5 ttw:*:data-[slot=select-value]:line-clamp-none",
208
+ children: /* @__PURE__ */ g(u, {})
209
+ }), /* @__PURE__ */ g(o, { children: I.options.map((e) => /* @__PURE__ */ g(s, {
210
+ value: e.value,
211
+ children: /* @__PURE__ */ g(m, { option: e })
212
+ }, e.value)) })]
213
+ }),
214
+ I.emailSummary !== void 0 && /* @__PURE__ */ _("div", {
215
+ className: "ttw:flex ttw:items-center ttw:gap-2",
216
+ children: [/* @__PURE__ */ g(d, {
217
+ variant: "body2",
218
+ color: "muted",
219
+ className: "ttw:truncate",
220
+ children: I.emailSummary
221
+ }), /* @__PURE__ */ g(e, {
222
+ type: "button",
223
+ variant: "link",
224
+ className: "ttw:h-auto ttw:p-0",
225
+ disabled: x,
226
+ onClick: A,
227
+ children: N.recurrenceSetUpEmail
228
+ })]
229
+ }),
230
+ I.emailError && /* @__PURE__ */ g(n, {
231
+ id: P.emailError,
232
+ errors: [{ message: I.emailError }]
233
+ })
234
+ ]
235
+ })
236
+ ]
25
237
  });
26
238
  }
27
- export { s as CreationModeOption };
239
+ export { y as ReceivableRecurrenceSection, y as default };
@@ -1,239 +1,3 @@
1
- import { Button as e, DatePicker as t, FieldError as n, Input as r, Label as i, Select as a, SelectContent as o, SelectItem as s, SelectSeparator as c, SelectTrigger as l, SelectValue as u, Typography as d, cn as f } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { RECEIVABLE_RECURRENCE_SECTION_LABELS_EN as p } from "./index17.js";
3
- import { CreationModeOption as m } from "./index55.js";
4
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
5
- // ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js
6
- var v = "ttw:text-sm ttw:font-normal ttw:text-nowrap ttw:text-muted-foreground";
7
- function y({ idPrefix: y, view: b, disabled: x, onFrequencyChange: S, onMonthDayChange: C, onWeekdayChange: w, onStartDateChange: T, onEndModeChange: E, onEndDateChange: D, onMaxOccurrencesChange: O, onCreationModeChange: k, onSetUpEmailClick: A, emailDialog: j, labels: M }) {
8
- let N = {
9
- ...p,
10
- ...M
11
- }, P = {
12
- frequency: `${y}-frequency`,
13
- monthDay: `${y}-issue-mode`,
14
- startDate: `${y}-start-date`,
15
- endMode: `${y}-end-mode`,
16
- endDate: `${y}-end-date`,
17
- occurrences: `${y}-max-occurrences`,
18
- creationMode: `${y}-automation-level`,
19
- emailError: `${y}-email-error`
20
- }, { schedule: F, creationMode: I } = b, L = (e, n, r) => /* @__PURE__ */ g("div", {
21
- className: "ttw:w-44",
22
- children: /* @__PURE__ */ g(t, {
23
- id: e,
24
- value: n.value,
25
- onChange: r,
26
- placeholder: N.recurrenceDatePlaceholder,
27
- disabled: x || n.disabled,
28
- minDate: n.minDate,
29
- maxDate: n.maxDate,
30
- defaultMonth: n.minDate,
31
- disabledDates: n.isDateDisabled,
32
- "aria-invalid": n.invalid || void 0,
33
- className: "ttw:flex-row-reverse ttw:justify-between ttw:text-foreground ttw:[&>svg]:mr-0"
34
- })
35
- }), R = (e) => /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("div", {
36
- className: "ttw:relative",
37
- children: [/* @__PURE__ */ g(r, {
38
- id: P.occurrences,
39
- className: "ttw:w-16",
40
- type: "text",
41
- inputMode: "numeric",
42
- value: e.value,
43
- disabled: x,
44
- "aria-invalid": e.invalid || void 0,
45
- "aria-describedby": F?.maxOccurrencesError ? `${P.occurrences}-error` : void 0,
46
- onChange: (e) => O(e.target.value)
47
- }), F?.maxOccurrencesError && /* @__PURE__ */ g(n, {
48
- id: `${P.occurrences}-error`,
49
- className: "ttw:absolute ttw:top-full ttw:left-0 ttw:mt-1 ttw:text-nowrap",
50
- errors: [{ message: F.maxOccurrencesError }]
51
- })]
52
- }), /* @__PURE__ */ g(i, {
53
- htmlFor: P.occurrences,
54
- className: v,
55
- children: e.unitLabel
56
- })] });
57
- return /* @__PURE__ */ _("section", {
58
- className: "ttw:flex ttw:flex-col ttw:gap-2.5",
59
- children: [
60
- /* @__PURE__ */ _("div", {
61
- className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-2.5",
62
- children: [
63
- /* @__PURE__ */ g(i, {
64
- htmlFor: P.frequency,
65
- className: v,
66
- children: N.recurrenceRepeatLabel
67
- }),
68
- /* @__PURE__ */ _(a, {
69
- value: b.frequency.value,
70
- disabled: x || b.frequency.disabled,
71
- onValueChange: S,
72
- children: [/* @__PURE__ */ g(l, {
73
- id: P.frequency,
74
- className: "ttw:w-31",
75
- children: /* @__PURE__ */ g(u, {})
76
- }), /* @__PURE__ */ g(o, { children: b.frequency.options.map((e) => /* @__PURE__ */ g(s, {
77
- value: e.value,
78
- children: e.label
79
- }, e.value)) })]
80
- }),
81
- b.monthDay && /* @__PURE__ */ _(h, { children: [
82
- /* @__PURE__ */ g(i, {
83
- htmlFor: P.monthDay,
84
- className: v,
85
- children: N.recurrenceMonthDayLead
86
- }),
87
- /* @__PURE__ */ _(a, {
88
- value: b.monthDay.value,
89
- disabled: x || b.monthDay.disabled,
90
- onValueChange: C,
91
- children: [/* @__PURE__ */ g(l, {
92
- id: P.monthDay,
93
- className: "ttw:w-fit ttw:min-w-21",
94
- "aria-invalid": b.monthDay.invalid || void 0,
95
- children: /* @__PURE__ */ g(u, {})
96
- }), /* @__PURE__ */ _(o, { children: [
97
- b.monthDay.edgeOptions.map((e) => /* @__PURE__ */ g(s, {
98
- value: e.value,
99
- children: e.label
100
- }, e.value)),
101
- /* @__PURE__ */ g(c, {}),
102
- b.monthDay.dayOptions.map((e) => /* @__PURE__ */ g(s, {
103
- value: e.value,
104
- children: e.label
105
- }, e.value))
106
- ] })]
107
- }),
108
- /* @__PURE__ */ g(d, {
109
- variant: "body2",
110
- color: "muted",
111
- component: "span",
112
- className: "ttw:text-nowrap",
113
- children: b.monthDay.trailLabel
114
- })
115
- ] }),
116
- b.weekday && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(d, {
117
- variant: "body2",
118
- color: "muted",
119
- component: "span",
120
- children: N.recurrenceWeekdayLead
121
- }), /* @__PURE__ */ g("div", {
122
- className: f("ttw:flex ttw:h-8 ttw:w-56 ttw:rounded-md ttw:border ttw:border-border", b.weekday.invalid && "ttw:border-destructive", b.weekday.disabled && "ttw:opacity-50"),
123
- children: b.weekday.options.map((e, t, n) => /* @__PURE__ */ g("button", {
124
- type: "button",
125
- disabled: x || b.weekday?.disabled,
126
- "aria-pressed": e.pressed,
127
- onClick: () => w(e.value),
128
- className: f("ttw:flex ttw:flex-1 ttw:items-center ttw:justify-center ttw:text-sm ttw:font-medium ttw:transition-colors ttw:hover:cursor-pointer ttw:hover:bg-muted ttw:disabled:pointer-events-none", e.pressed && "ttw:bg-muted", t < n.length - 1 && "ttw:border-r ttw:border-border"),
129
- children: e.label
130
- }, e.value))
131
- })] })
132
- ]
133
- }),
134
- F && /* @__PURE__ */ _("div", {
135
- className: f("ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-2.5", F.maxOccurrencesError && "ttw:pb-6"),
136
- children: [
137
- /* @__PURE__ */ g(i, {
138
- htmlFor: P.startDate,
139
- className: v,
140
- children: N.recurrenceStartOnLabel
141
- }),
142
- L(P.startDate, F.start, T),
143
- F.end.kind === "choice" ? /* @__PURE__ */ _(h, { children: [
144
- /* @__PURE__ */ g(i, {
145
- htmlFor: P.endMode,
146
- className: v,
147
- children: N.recurrenceEndChoiceLead
148
- }),
149
- /* @__PURE__ */ _(a, {
150
- value: F.end.mode.value,
151
- disabled: x,
152
- onValueChange: E,
153
- children: [/* @__PURE__ */ g(l, {
154
- id: P.endMode,
155
- className: "ttw:w-21",
156
- "aria-invalid": F.end.mode.invalid || void 0,
157
- children: /* @__PURE__ */ g(u, {})
158
- }), /* @__PURE__ */ g(o, { children: F.end.mode.options.map((e) => /* @__PURE__ */ g(s, {
159
- value: e.value,
160
- children: e.label
161
- }, e.value)) })]
162
- }),
163
- F.end.date && L(P.endDate, F.end.date, D),
164
- F.end.occurrences && R(F.end.occurrences)
165
- ] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(i, {
166
- htmlFor: P.occurrences,
167
- className: v,
168
- children: N.recurrenceEndCountLead
169
- }), R(F.end.occurrences)] })
170
- ]
171
- }),
172
- j,
173
- b.lastDayCaption && /* @__PURE__ */ g(d, {
174
- variant: "caption",
175
- color: "muted",
176
- children: b.lastDayCaption
177
- }),
178
- I && /* @__PURE__ */ _("div", {
179
- className: "ttw:flex ttw:flex-col ttw:gap-2 ttw:pt-1.5",
180
- children: [
181
- /* @__PURE__ */ g(i, {
182
- htmlFor: P.creationMode,
183
- children: /* @__PURE__ */ _(d, {
184
- variant: "body2",
185
- component: "span",
186
- className: "ttw:block",
187
- children: [
188
- N.recurrenceCreationModeQuestion,
189
- " ",
190
- /* @__PURE__ */ g(d, {
191
- variant: "body2",
192
- component: "span",
193
- color: "muted",
194
- children: N.recurrenceCreationModeHint
195
- })
196
- ]
197
- })
198
- }),
199
- /* @__PURE__ */ _(a, {
200
- value: I.value,
201
- disabled: x,
202
- onValueChange: (e) => k(e),
203
- children: [/* @__PURE__ */ g(l, {
204
- id: P.creationMode,
205
- "aria-invalid": !!I.emailError || void 0,
206
- "aria-describedby": I.emailError ? P.emailError : void 0,
207
- className: "ttw:h-auto! ttw:w-full ttw:py-2.5 ttw:*:data-[slot=select-value]:line-clamp-none",
208
- children: /* @__PURE__ */ g(u, {})
209
- }), /* @__PURE__ */ g(o, { children: I.options.map((e) => /* @__PURE__ */ g(s, {
210
- value: e.value,
211
- children: /* @__PURE__ */ g(m, { option: e })
212
- }, e.value)) })]
213
- }),
214
- I.emailSummary !== void 0 && /* @__PURE__ */ _("div", {
215
- className: "ttw:flex ttw:items-center ttw:gap-2",
216
- children: [/* @__PURE__ */ g(d, {
217
- variant: "body2",
218
- color: "muted",
219
- className: "ttw:truncate",
220
- children: I.emailSummary
221
- }), /* @__PURE__ */ g(e, {
222
- type: "button",
223
- variant: "link",
224
- className: "ttw:h-auto ttw:p-0",
225
- disabled: x,
226
- onClick: A,
227
- children: N.recurrenceSetUpEmail
228
- })]
229
- }),
230
- I.emailError && /* @__PURE__ */ g(n, {
231
- id: P.emailError,
232
- errors: [{ message: I.emailError }]
233
- })
234
- ]
235
- })
236
- ]
237
- });
238
- }
239
- export { y as ReceivableRecurrenceSection, y as default };
1
+ import "./index18.js";
2
+ import "./index53.js";
3
+ import "./index55.js";