@tensor_1/react 2.31.0 → 2.33.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 (117) hide show
  1. package/README.md +367 -0
  2. package/dist/SchedulingCalendar-C4XVbqZr.d.ts +339 -0
  3. package/dist/attachment-labels.d.ts +16 -0
  4. package/dist/attachment-labels.js +9 -0
  5. package/dist/calendar-model.d.ts +141 -1
  6. package/dist/calendar-model.js +200 -11
  7. package/dist/chart-preset.cjs +127 -7
  8. package/dist/chart-preset.d.cts +2 -2
  9. package/dist/chart-preset.d.ts +1 -0
  10. package/dist/chart-preset.js +6 -1
  11. package/dist/chart-theme-Cl0IrkKQ.d.cts +112 -0
  12. package/dist/chart-theme.d.ts +51 -0
  13. package/dist/chart-theme.js +99 -0
  14. package/dist/chart.cjs +127 -7
  15. package/dist/chart.d.cts +2 -2
  16. package/dist/chart.d.ts +1 -0
  17. package/dist/chart.js +6 -2
  18. package/dist/components/Alert.d.ts +17 -1
  19. package/dist/components/Alert.js +9 -4
  20. package/dist/components/AlertDismiss.d.ts +14 -0
  21. package/dist/components/AlertDismiss.js +11 -0
  22. package/dist/components/Attachment.d.ts +15 -12
  23. package/dist/components/Attachment.js +17 -17
  24. package/dist/components/AttachmentParts.d.ts +24 -0
  25. package/dist/components/AttachmentParts.js +20 -0
  26. package/dist/components/Chart.d.ts +1 -0
  27. package/dist/components/Chart.js +6 -1
  28. package/dist/components/ChartCore.d.ts +6 -1
  29. package/dist/components/ChartCore.js +23 -5
  30. package/dist/components/Chip.d.ts +17 -2
  31. package/dist/components/Chip.js +35 -11
  32. package/dist/components/ChipRemove.d.ts +17 -0
  33. package/dist/components/ChipRemove.js +13 -0
  34. package/dist/components/CollapsibleParts.d.ts +29 -0
  35. package/dist/components/CollapsibleParts.js +20 -0
  36. package/dist/components/CollapsibleSection.d.ts +30 -3
  37. package/dist/components/CollapsibleSection.js +7 -11
  38. package/dist/components/CollapsibleSectionState.d.ts +1 -1
  39. package/dist/components/CollapsibleSectionState.js +54 -27
  40. package/dist/components/DashboardGrid.d.ts +60 -0
  41. package/dist/components/DashboardGrid.js +40 -0
  42. package/dist/components/DateRangePicker.d.ts +7 -1
  43. package/dist/components/DateRangePicker.js +5 -1
  44. package/dist/components/DescriptionList.d.ts +12 -1
  45. package/dist/components/DescriptionList.js +5 -5
  46. package/dist/components/Dialogs.d.ts +24 -3
  47. package/dist/components/Dialogs.js +74 -16
  48. package/dist/components/FileUpload.d.ts +10 -2
  49. package/dist/components/FileUpload.js +10 -4
  50. package/dist/components/FilterEditor.d.ts +4 -0
  51. package/dist/components/FilterEditor.js +13 -2
  52. package/dist/components/Heartbeat.d.ts +31 -0
  53. package/dist/components/Heartbeat.js +28 -0
  54. package/dist/components/Menu.d.ts +53 -5
  55. package/dist/components/Menu.js +104 -4
  56. package/dist/components/Meter.d.ts +7 -3
  57. package/dist/components/Meter.js +2 -1
  58. package/dist/components/Popover.d.ts +21 -2
  59. package/dist/components/Popover.js +94 -17
  60. package/dist/components/Prose.d.ts +6 -2
  61. package/dist/components/Prose.js +1 -1
  62. package/dist/components/RuleBuilder.d.ts +52 -4
  63. package/dist/components/RuleBuilder.js +109 -24
  64. package/dist/components/SchedulingCalendar.d.ts +4 -110
  65. package/dist/components/SchedulingCalendar.js +299 -63
  66. package/dist/components/SchedulingTimeGrid.d.ts +4 -0
  67. package/dist/components/SchedulingTimeGrid.js +521 -0
  68. package/dist/components/SchedulingTimeline.d.ts +2 -1
  69. package/dist/components/Segmented.d.ts +17 -3
  70. package/dist/components/Segmented.js +59 -5
  71. package/dist/components/Select.d.ts +66 -2
  72. package/dist/components/Select.js +800 -10
  73. package/dist/components/Spinner.d.ts +2 -1
  74. package/dist/components/Spinner.js +1 -1
  75. package/dist/components/StatusPill.d.ts +8 -2
  76. package/dist/components/StatusPill.js +2 -2
  77. package/dist/components/Steps.d.ts +28 -4
  78. package/dist/components/Steps.js +46 -16
  79. package/dist/components/TableControls.js +4 -3
  80. package/dist/components/Tabs.d.ts +7 -2
  81. package/dist/components/Tabs.js +14 -1
  82. package/dist/components/TextDiff.d.ts +49 -0
  83. package/dist/components/TextDiff.js +124 -0
  84. package/dist/{emoji-image-6mPZ15Zy.d.cts → emoji-image-DjCKpdwE.d.cts} +1 -1
  85. package/dist/emoji.cjs +169 -27
  86. package/dist/emoji.d.cts +3 -3
  87. package/dist/file-model.d.ts +22 -3
  88. package/dist/file-model.js +6 -4
  89. package/dist/filter-model.d.ts +26 -2
  90. package/dist/filter-model.js +13 -1
  91. package/dist/hooks/useAnchoredPosition.d.ts +24 -1
  92. package/dist/hooks/useAnchoredPosition.js +58 -8
  93. package/dist/hooks/useVirtualRows.d.ts +17 -2
  94. package/dist/hooks/useVirtualRows.js +6 -5
  95. package/dist/icons/Icon.d.ts +14 -14
  96. package/dist/index.cjs +4888 -1714
  97. package/dist/index.d.cts +1871 -658
  98. package/dist/index.d.ts +16 -9
  99. package/dist/index.js +67 -4
  100. package/dist/labels-context.d.ts +29 -1
  101. package/dist/{overlay-position-Cjv5E7mn.d.cts → overlay-position-2Afke51l.d.cts} +20 -0
  102. package/dist/overlay-position.d.ts +20 -0
  103. package/dist/overlay-position.js +17 -2
  104. package/dist/rich-text.cjs +169 -27
  105. package/dist/rich-text.d.cts +3 -3
  106. package/dist/rule-builder-model.d.ts +34 -2
  107. package/dist/rule-builder-model.js +48 -12
  108. package/dist/scheduling-calendar-model.d.ts +169 -0
  109. package/dist/scheduling-calendar-model.js +176 -0
  110. package/dist/select-model.d.ts +80 -0
  111. package/dist/select-model.js +109 -0
  112. package/dist/table-engine.d.ts +7 -0
  113. package/dist/table-engine.js +2 -1
  114. package/dist/text-diff-model.d.ts +71 -0
  115. package/dist/text-diff-model.js +261 -0
  116. package/package.json +1 -1
  117. package/dist/ChartCore-DzWe10bN.d.cts +0 -59
@@ -7,10 +7,12 @@ import {
7
7
  mapRuleGroup,
8
8
  moveRuleNode,
9
9
  removeRuleNode,
10
+ setRuleCombinator,
10
11
  summarizeRule,
11
12
  validateRuleDefinition
12
13
  } from "../rule-builder-model.js";
13
14
  import { fillLabel } from "../fill-label.js";
15
+ import { useUixLabels } from "../labels-context.js";
14
16
  const DEFAULT_RULE_BUILDER_LABELS = {
15
17
  region: "Rule builder",
16
18
  summary: "Rule summary",
@@ -40,7 +42,20 @@ const DEFAULT_RULE_BUILDER_LABELS = {
40
42
  summaryIssuesMany: "Rule has {count} validation issues.",
41
43
  addCondition: "Add condition",
42
44
  addGroup: "Add group",
43
- addAction: "Add action"
45
+ addAction: "Add action",
46
+ issueDuplicateId: "Duplicate id \u201C{id}\u201D.",
47
+ issueMaxDepth: "Nesting exceeds {max} levels.",
48
+ issueEmptyGroup: "Add at least one condition.",
49
+ issueMissingField: "Choose a field.",
50
+ issueMissingOperator: "Choose an operator.",
51
+ issueNoActions: "Add at least one action.",
52
+ issueMissingActionType: "Choose an action.",
53
+ summarySentence: "When {conditions}, then {actions}.",
54
+ summarySentenceConditionsOnly: "When {conditions}.",
55
+ summaryNoConditions: "no conditions",
56
+ summaryNoActions: "no actions",
57
+ and: "AND",
58
+ or: "OR"
44
59
  };
45
60
  let ruleId = 0;
46
61
  const nextId = (prefix) => `${prefix}-${Date.now().toString(36)}-${(++ruleId).toString(36)}`;
@@ -49,28 +64,45 @@ function defaultCondition(fields, operators) {
49
64
  const operator = operators.find((item) => field?.operators?.includes(item.id)) ?? operators[0];
50
65
  return { id: nextId("condition"), field: field?.id ?? "", operator: operator?.id ?? "", value: "" };
51
66
  }
52
- function RuleGroupEditor({ group, depth, root, fields, operators, maxDepth, disabled, onRootChange, labels }) {
67
+ function RuleGroupEditor({ group, depth, root, fields, operators, maxDepth, disabled, onRootChange, labels, combinator, hideCombinator, allowGroups }) {
53
68
  const updateNode = (id, update) => onRootChange(mapRuleGroup(root, id, update));
54
69
  const addCondition = () => onRootChange(appendRuleNode(root, group.id, defaultCondition(fields, operators), maxDepth));
55
70
  const addGroup = () => onRootChange(appendRuleNode(root, group.id, {
56
71
  id: nextId("group"),
57
- combinator: "and",
72
+ combinator: combinator ?? "and",
58
73
  conditions: [defaultCondition(fields, operators)]
59
74
  }, maxDepth));
75
+ const rowControls = (node, index, label) => disabled ? null : /* @__PURE__ */ jsx(
76
+ RowControls,
77
+ {
78
+ labels,
79
+ label,
80
+ first: index === 0,
81
+ last: index === group.conditions.length - 1,
82
+ disabled: false,
83
+ onUp: () => onRootChange(moveRuleNode(root, node.id, -1)),
84
+ onDown: () => onRootChange(moveRuleNode(root, node.id, 1)),
85
+ onRemove: () => onRootChange(removeRuleNode(root, node.id))
86
+ }
87
+ );
60
88
  return /* @__PURE__ */ jsxs("fieldset", { className: "uix-rule-builder__group", "data-depth": depth, children: [
61
89
  /* @__PURE__ */ jsxs("legend", { className: "uix-rule-builder__group-heading", children: [
62
90
  /* @__PURE__ */ jsx("span", { children: depth === 1 ? labels.when : labels.group }),
63
- /* @__PURE__ */ jsxs("label", { children: [
91
+ !hideCombinator && (combinator ? /* @__PURE__ */ jsxs("span", { className: "uix-rule-builder__match", children: [
92
+ labels.match,
93
+ " ",
94
+ combinator === "or" ? labels.any : labels.all
95
+ ] }) : /* @__PURE__ */ jsxs("label", { children: [
64
96
  labels.match,
65
97
  /* @__PURE__ */ jsxs("select", { className: "uix-select uix-select--sm", value: group.combinator, disabled, onChange: (event) => updateNode(group.id, (node) => ({ ...node, combinator: event.currentTarget.value })), children: [
66
98
  /* @__PURE__ */ jsx("option", { value: "and", children: labels.all }),
67
99
  /* @__PURE__ */ jsx("option", { value: "or", children: labels.any })
68
100
  ] })
69
- ] })
101
+ ] }))
70
102
  ] }),
71
103
  /* @__PURE__ */ jsx("div", { className: "uix-rule-builder__rows", children: group.conditions.map((node, index) => isRuleGroup(node) ? /* @__PURE__ */ jsxs("div", { className: "uix-rule-builder__nested", children: [
72
- /* @__PURE__ */ jsx(RuleGroupEditor, { ...{ group: node, depth: depth + 1, root, fields, operators, maxDepth, disabled, onRootChange, labels } }),
73
- /* @__PURE__ */ jsx(RowControls, { labels, label: labels.itemGroup, first: index === 0, last: index === group.conditions.length - 1, disabled, onUp: () => onRootChange(moveRuleNode(root, node.id, -1)), onDown: () => onRootChange(moveRuleNode(root, node.id, 1)), onRemove: () => onRootChange(removeRuleNode(root, node.id)) })
104
+ /* @__PURE__ */ jsx(RuleGroupEditor, { ...{ group: node, depth: depth + 1, root, fields, operators, maxDepth, disabled, onRootChange, labels, combinator, hideCombinator, allowGroups } }),
105
+ rowControls(node, index, labels.itemGroup)
74
106
  ] }, node.id) : /* @__PURE__ */ jsx(
75
107
  ConditionRow,
76
108
  {
@@ -80,13 +112,13 @@ function RuleGroupEditor({ group, depth, root, fields, operators, maxDepth, disa
80
112
  operators,
81
113
  disabled,
82
114
  onChange: (condition) => updateNode(node.id, () => condition),
83
- controls: /* @__PURE__ */ jsx(RowControls, { labels, label: labels.itemCondition, first: index === 0, last: index === group.conditions.length - 1, disabled, onUp: () => onRootChange(moveRuleNode(root, node.id, -1)), onDown: () => onRootChange(moveRuleNode(root, node.id, 1)), onRemove: () => onRootChange(removeRuleNode(root, node.id)) })
115
+ controls: rowControls(node, index, labels.itemCondition)
84
116
  },
85
117
  node.id
86
118
  )) }),
87
- /* @__PURE__ */ jsxs("div", { className: "uix-rule-builder__add", children: [
88
- /* @__PURE__ */ jsx("button", { type: "button", className: "uix-btn uix-btn--secondary uix-btn--sm", onClick: addCondition, disabled: disabled || fields.length === 0 || operators.length === 0, children: labels.addCondition }),
89
- /* @__PURE__ */ jsx("button", { type: "button", className: "uix-btn uix-btn--ghost uix-btn--sm", onClick: addGroup, disabled: disabled || depth >= maxDepth, children: labels.addGroup })
119
+ !disabled && /* @__PURE__ */ jsxs("div", { className: "uix-rule-builder__add", children: [
120
+ /* @__PURE__ */ jsx("button", { type: "button", className: "uix-btn uix-btn--secondary uix-btn--sm", onClick: addCondition, disabled: fields.length === 0 || operators.length === 0, children: labels.addCondition }),
121
+ allowGroups && /* @__PURE__ */ jsx("button", { type: "button", className: "uix-btn uix-btn--ghost uix-btn--sm", onClick: addGroup, disabled: depth >= maxDepth, children: labels.addGroup })
90
122
  ] })
91
123
  ] });
92
124
  }
@@ -124,9 +156,14 @@ function RuleBuilder({
124
156
  onChange,
125
157
  fields,
126
158
  operators,
127
- actions,
159
+ actions = [],
128
160
  maxDepth = 3,
129
161
  readOnly = false,
162
+ conditionsOnly = false,
163
+ combinator,
164
+ hideCombinator = false,
165
+ allowGroups = true,
166
+ checks,
130
167
  validate,
131
168
  className,
132
169
  addConditionLabel,
@@ -134,33 +171,81 @@ function RuleBuilder({
134
171
  addActionLabel,
135
172
  labels: labelOverrides
136
173
  }) {
174
+ const provided = useUixLabels().ruleBuilder;
137
175
  const labels = {
138
176
  ...DEFAULT_RULE_BUILDER_LABELS,
177
+ ...provided,
139
178
  ...addConditionLabel != null ? { addCondition: addConditionLabel } : {},
140
179
  ...addGroupLabel != null ? { addGroup: addGroupLabel } : {},
141
180
  ...addActionLabel != null ? { addAction: addActionLabel } : {},
142
181
  ...labelOverrides
143
182
  };
144
183
  const issuesText = (template1, templateN) => fillLabel(issues.length === 1 ? template1 : templateN, { count: issues.length });
145
- const issues = [...validateRuleDefinition(value, maxDepth), ...validate?.(value) ?? []];
184
+ const builtIn = validateRuleDefinition(value, maxDepth, {
185
+ messages: {
186
+ duplicateId: labels.issueDuplicateId,
187
+ maxDepth: labels.issueMaxDepth,
188
+ emptyGroup: labels.issueEmptyGroup,
189
+ missingField: labels.issueMissingField,
190
+ missingOperator: labels.issueMissingOperator,
191
+ noActions: labels.issueNoActions,
192
+ missingActionType: labels.issueMissingActionType
193
+ },
194
+ checks: conditionsOnly ? { noActions: false, missingActionType: false, ...checks } : checks
195
+ });
196
+ const issues = [...builtIn, ...validate?.(value) ?? []];
146
197
  const fieldLabels = Object.fromEntries(fields.map((field) => [field.id, field.label]));
147
198
  const operatorLabels = Object.fromEntries(operators.map((operator) => [operator.id, operator.label]));
148
199
  const actionLabels = Object.fromEntries(actions.map((action) => [action.id, action.label]));
149
- if (readOnly) return /* @__PURE__ */ jsxs("section", { className: cx("uix-rule-builder uix-rule-builder--summary", className), "aria-label": labels.summary, children: [
150
- /* @__PURE__ */ jsx("p", { children: summarizeRule(value, { fields: fieldLabels, operators: operatorLabels, actions: actionLabels }) }),
151
- issues.length > 0 && /* @__PURE__ */ jsx("p", { className: "uix-rule-builder__invalid", children: issuesText(labels.summaryIssuesOne, labels.summaryIssuesMany) })
152
- ] });
200
+ if (readOnly === "summary") {
201
+ const sentence = summarizeRule(value, {
202
+ fields: fieldLabels,
203
+ operators: operatorLabels,
204
+ actions: actionLabels,
205
+ conditionsOnly,
206
+ words: {
207
+ sentence: labels.summarySentence,
208
+ sentenceConditionsOnly: labels.summarySentenceConditionsOnly,
209
+ noConditions: labels.summaryNoConditions,
210
+ noActions: labels.summaryNoActions,
211
+ and: labels.and,
212
+ or: labels.or
213
+ }
214
+ });
215
+ return /* @__PURE__ */ jsxs("section", { className: cx("uix-rule-builder uix-rule-builder--summary", className), "aria-label": labels.summary, children: [
216
+ /* @__PURE__ */ jsx("p", { children: sentence }),
217
+ issues.length > 0 && /* @__PURE__ */ jsx("p", { className: "uix-rule-builder__invalid", children: issuesText(labels.summaryIssuesOne, labels.summaryIssuesMany) })
218
+ ] });
219
+ }
220
+ const disabled = readOnly === true;
221
+ const emitWhen = (when) => onChange({ ...value, when: combinator ? setRuleCombinator(when, combinator) : when });
153
222
  const updateActions = (next) => onChange({ ...value, then: next });
154
- return /* @__PURE__ */ jsxs("section", { className: cx("uix-rule-builder", className), "aria-label": labels.region, children: [
155
- /* @__PURE__ */ jsx(RuleGroupEditor, { group: value.when, depth: 1, root: value.when, fields, operators, maxDepth, disabled: readOnly, onRootChange: (when) => onChange({ ...value, when }), labels }),
156
- /* @__PURE__ */ jsxs("fieldset", { className: "uix-rule-builder__actions", children: [
223
+ return /* @__PURE__ */ jsxs("section", { className: cx("uix-rule-builder", disabled && "uix-rule-builder--readonly", className), "aria-label": labels.region, children: [
224
+ /* @__PURE__ */ jsx(
225
+ RuleGroupEditor,
226
+ {
227
+ group: value.when,
228
+ depth: 1,
229
+ root: value.when,
230
+ fields,
231
+ operators,
232
+ maxDepth,
233
+ disabled,
234
+ onRootChange: emitWhen,
235
+ labels,
236
+ combinator,
237
+ hideCombinator,
238
+ allowGroups: allowGroups && maxDepth > 1
239
+ }
240
+ ),
241
+ !conditionsOnly && /* @__PURE__ */ jsxs("fieldset", { className: "uix-rule-builder__actions", children: [
157
242
  /* @__PURE__ */ jsx("legend", { children: labels.then }),
158
243
  value.then.map((action, index) => {
159
244
  const definition = actions.find((item) => item.id === action.type);
160
245
  return /* @__PURE__ */ jsxs("div", { className: "uix-rule-builder__action", children: [
161
- /* @__PURE__ */ jsx("select", { className: "uix-select", value: action.type, onChange: (event) => updateActions(value.then.map((item) => item.id === action.id ? { ...item, type: event.currentTarget.value } : item)), "aria-label": labels.actionType, children: actions.map((item) => /* @__PURE__ */ jsx("option", { value: item.id, children: item.label }, item.id)) }),
162
- definition?.renderParameters?.(action, (parameters) => updateActions(value.then.map((item) => item.id === action.id ? { ...item, parameters } : item)), false),
163
- /* @__PURE__ */ jsx(
246
+ /* @__PURE__ */ jsx("select", { className: "uix-select", value: action.type, disabled, onChange: (event) => updateActions(value.then.map((item) => item.id === action.id ? { ...item, type: event.currentTarget.value } : item)), "aria-label": labels.actionType, children: actions.map((item) => /* @__PURE__ */ jsx("option", { value: item.id, children: item.label }, item.id)) }),
247
+ definition?.renderParameters?.(action, (parameters) => updateActions(value.then.map((item) => item.id === action.id ? { ...item, parameters } : item)), disabled),
248
+ !disabled && /* @__PURE__ */ jsx(
164
249
  RowControls,
165
250
  {
166
251
  labels,
@@ -183,7 +268,7 @@ function RuleBuilder({
183
268
  )
184
269
  ] }, action.id);
185
270
  }),
186
- /* @__PURE__ */ jsx("button", { type: "button", className: "uix-btn uix-btn--secondary uix-btn--sm", disabled: actions.length === 0, onClick: () => updateActions([...value.then, { id: nextId("action"), type: actions[0]?.id ?? "", parameters: {} }]), children: labels.addAction })
271
+ !disabled && /* @__PURE__ */ jsx("button", { type: "button", className: "uix-btn uix-btn--secondary uix-btn--sm", disabled: actions.length === 0, onClick: () => updateActions([...value.then, { id: nextId("action"), type: actions[0]?.id ?? "", parameters: {} }]), children: labels.addAction })
187
272
  ] }),
188
273
  /* @__PURE__ */ jsx("div", { className: "uix-rule-builder__validation", "aria-live": "polite", children: issues.length === 0 ? /* @__PURE__ */ jsx("span", { children: labels.valid }) : /* @__PURE__ */ jsxs(Fragment, { children: [
189
274
  /* @__PURE__ */ jsx("strong", { children: issuesText(labels.issuesOne, labels.issuesMany) }),
@@ -1,110 +1,4 @@
1
- import * as react from 'react';
2
- import { ReactNode } from 'react';
3
- import { CalendarWeekday } from '../calendar-model.js';
4
-
5
- type SchedulingCalendarView = 'month' | 'week' | 'agenda';
6
- type SchedulingEntryState = 'scheduled' | 'conflicted' | 'in-progress' | 'blackout-violation';
7
- type SchedulingOverlayKind = 'maintenance' | 'blackout';
8
- /**
9
- * Which date text a `formatDate` call is for (TENSOR B1/C9, HAR-1347):
10
- * `day` names one day (each day cell's accessible name, the week-range title);
11
- * `weekday` is the short column header (the date is any day of that weekday);
12
- * `month` is the month-view title (the date is the first of the month).
13
- */
14
- type SchedulingDatePart = 'day' | 'weekday' | 'month';
15
- interface SchedulingCalendarEntry {
16
- id: string;
17
- title: string;
18
- start: string;
19
- end: string;
20
- state?: SchedulingEntryState;
21
- meta?: string;
22
- }
23
- interface SchedulingCalendarOverlay {
24
- id: string;
25
- label: string;
26
- start: string;
27
- end: string;
28
- kind: SchedulingOverlayKind;
29
- }
30
- /**
31
- * Every word the calendar renders (TENSOR RX-125, UIX-12). `{timeZone}`, `{view}`,
32
- * `{title}`, `{state}`, `{start}`, `{end}` are placeholders.
33
- */
34
- interface SchedulingCalendarLabels {
35
- region: string;
36
- previous: string;
37
- next: string;
38
- viewGroup: string;
39
- viewMonth: string;
40
- viewWeek: string;
41
- viewAgenda: string;
42
- loading: string;
43
- retry: string;
44
- agenda: string;
45
- agendaEmpty: string;
46
- grid: string;
47
- entry: string;
48
- legend: string;
49
- /** The "+N more" toggle on a day with more entries than `maxEntriesPerDay`. `{count}` placeholder. */
50
- moreEntries: string;
51
- /** Accessible name of that toggle. `{count}` and `{date}` placeholders. */
52
- moreEntriesLabel: string;
53
- /** The toggle once the day is expanded in place. */
54
- fewerEntries: string;
55
- states: Record<SchedulingEntryState, string>;
56
- }
57
- declare const DEFAULT_SCHEDULING_CALENDAR_LABELS: SchedulingCalendarLabels;
58
- interface SchedulingCalendarProps {
59
- entries: SchedulingCalendarEntry[];
60
- anchorDate: string;
61
- timeZone: string;
62
- view?: SchedulingCalendarView;
63
- onViewChange?: (view: SchedulingCalendarView) => void;
64
- onAnchorDateChange?: (date: string) => void;
65
- onSelectEntry?: (entry: SchedulingCalendarEntry) => void;
66
- overlays?: SchedulingCalendarOverlay[];
67
- filter?: (entry: SchedulingCalendarEntry) => boolean;
68
- renderEntry?: (entry: SchedulingCalendarEntry) => ReactNode;
69
- locale?: string;
70
- /** First column of the month and week grids: 0 = Sunday … 6 = Saturday. Defaults to 1 (Monday). */
71
- weekStartsOn?: CalendarWeekday;
72
- /**
73
- * Formats every calendar date the component writes (`date` is `YYYY-MM-DD`). Use it to
74
- * apply a product date format such as DD.MM.YYYY; defaults to `Intl` in `locale`.
75
- */
76
- formatDate?: (date: string, part: SchedulingDatePart) => string;
77
- /**
78
- * Formats an entry's start or end instant (ISO 8601) for the agenda and the entry names.
79
- * The component does not shift it: render it in `timeZone` yourself. Defaults to `Intl`
80
- * medium date + short time in `timeZone`.
81
- */
82
- formatInstant?: (instant: string) => string;
83
- /**
84
- * Show at most this many entries in a month or week day; the rest collapse behind a
85
- * "+N more" toggle. Unset shows every entry.
86
- */
87
- maxEntriesPerDay?: number;
88
- /**
89
- * Called by the "+N more" toggle with the day and every entry on it. When set, the
90
- * consumer shows them (a popover, a drawer, the day view) and the day stays collapsed;
91
- * otherwise the day expands in place.
92
- */
93
- onShowMore?: (date: string, entries: SchedulingCalendarEntry[]) => void;
94
- /**
95
- * A small badge beside a day's date, e.g. a collision count. Keep it short (a number or a
96
- * glyph): it shares a narrow column with the date and is clipped, not wrapped. It sits
97
- * outside the date button, so give it its own accessible text (a visually hidden word next
98
- * to the number). Return null for no badge.
99
- */
100
- renderDayBadge?: (date: string, entries: SchedulingCalendarEntry[]) => ReactNode;
101
- loading?: boolean;
102
- error?: string;
103
- onRetry?: () => void;
104
- className?: string;
105
- labels?: Partial<SchedulingCalendarLabels>;
106
- }
107
- /** Month/week/agenda calendar for UTC ranges rendered in an explicit IANA time zone. */
108
- declare function SchedulingCalendar({ entries, anchorDate, timeZone, view: controlledView, onViewChange, onAnchorDateChange, onSelectEntry, overlays, filter, renderEntry, locale, weekStartsOn, formatDate, formatInstant: formatInstantProp, maxEntriesPerDay, onShowMore, renderDayBadge, loading, error, onRetry, className, labels: labelOverrides, }: SchedulingCalendarProps): react.JSX.Element;
109
-
110
- export { DEFAULT_SCHEDULING_CALENDAR_LABELS, SchedulingCalendar, type SchedulingCalendarEntry, type SchedulingCalendarLabels, type SchedulingCalendarOverlay, type SchedulingCalendarProps, type SchedulingCalendarView, type SchedulingDatePart, type SchedulingEntryState, type SchedulingOverlayKind };
1
+ import 'react';
2
+ import '../calendar-model.js';
3
+ import '../scheduling-calendar-model.js';
4
+ export { D as DEFAULT_SCHEDULING_CALENDAR_LABELS, S as SchedulingBand, a as SchedulingCalendar, b as SchedulingCalendarDay, c as SchedulingCalendarEntry, d as SchedulingCalendarLabels, e as SchedulingCalendarOverlay, f as SchedulingCalendarProps, g as SchedulingCalendarView, h as SchedulingDatePart, i as SchedulingEntryState, j as SchedulingLegendItem, k as SchedulingMarker, l as SchedulingMarkerEmphasis, m as SchedulingOverlayKind, n as SchedulingOverlayPattern, o as SchedulingStatus } from '../SchedulingCalendar-C4XVbqZr.js';