@povio/ui 3.4.0-rc.17 → 3.4.0-rc.19

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 (218) hide show
  1. package/README.md +20 -1
  2. package/dist/components/Menu/Menu.d.ts +23 -0
  3. package/dist/components/Menu/Menu.js +27 -0
  4. package/dist/components/Menu/MenuItem.d.ts +1 -1
  5. package/dist/components/Menu/MenuPopover.d.ts +1 -1
  6. package/dist/components/accordion.d.ts +3 -5
  7. package/dist/components/accordion.js +1 -80
  8. package/dist/components/action-modal.d.ts +1 -1
  9. package/dist/components/action-modal.js +1 -1
  10. package/dist/components/alert.js +1 -1
  11. package/dist/components/autocomplete.js +1 -1
  12. package/dist/components/breadcrumbs.js +1 -1
  13. package/dist/components/checkbox-group.js +2 -2
  14. package/dist/components/checkbox.js +2 -2
  15. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +3 -3
  16. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +4 -4
  17. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +3 -3
  18. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +3 -3
  19. package/dist/components/inputs/DateTime/shared/CalendarCell.js +1 -1
  20. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +1 -1
  21. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +2 -2
  22. package/dist/components/inputs/DateTime/shared/MonthPicker.js +1 -1
  23. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +1 -1
  24. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +2 -2
  25. package/dist/components/inputs/DateTime/shared/YearPicker.js +1 -1
  26. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +1 -1
  27. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +1 -1
  28. package/dist/components/inputs/File/shared/FileUploadContentError.js +1 -1
  29. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +1 -1
  30. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +1 -1
  31. package/dist/components/inputs/File/shared/InputUploadContent.js +1 -1
  32. package/dist/components/inputs/File/shared/InputUploadFilled.js +1 -1
  33. package/dist/components/inputs/File/shared/ProgressBar.js +1 -1
  34. package/dist/components/inputs/FormField/FormFieldHeader.js +1 -1
  35. package/dist/components/inputs/Input/shared/InputContent.js +1 -1
  36. package/dist/components/inputs/Inputs/InputItem.d.ts +1 -1
  37. package/dist/components/inputs/Inputs/InputItem.js +5 -5
  38. package/dist/components/inputs/Selection/Select/Select.js +2 -2
  39. package/dist/components/inputs/Selection/shared/SelectDesktop.js +2 -2
  40. package/dist/components/inputs/Selection/shared/SelectInput.js +3 -3
  41. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +1 -1
  42. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +1 -1
  43. package/dist/components/inputs/Skeleton/InputFrame.js +1 -1
  44. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +1 -1
  45. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +1 -1
  46. package/dist/components/menu.d.ts +3 -23
  47. package/dist/components/menu.js +3 -27
  48. package/dist/components/navigation/Accordion/Accordion.d.ts +5 -0
  49. package/dist/components/navigation/Accordion/Accordion.js +81 -0
  50. package/dist/components/navigation/Accordion/AccordionItem.js +1 -1
  51. package/dist/components/navigation/Stepper/Stepper.d.ts +5 -0
  52. package/dist/components/navigation/Stepper/Stepper.js +79 -0
  53. package/dist/components/navigation/Stepper/StepperItem.js +1 -1
  54. package/dist/components/number-input.js +3 -3
  55. package/dist/components/number-range-input.js +2 -2
  56. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +1 -1
  57. package/dist/components/{shared/pagination/PaginationList.d.ts → pagination-list.d.ts} +1 -1
  58. package/dist/components/{shared/pagination/PaginationList.js → pagination-list.js} +3 -3
  59. package/dist/components/pagination.d.ts +1 -1
  60. package/dist/components/pagination.js +2 -2
  61. package/dist/components/pill.d.ts +1 -1
  62. package/dist/components/pill.js +1 -1
  63. package/dist/components/progress-bar.d.ts +2 -0
  64. package/dist/components/progress-bar.js +2 -0
  65. package/dist/components/radio-group.js +1 -1
  66. package/dist/components/segment/Segment.d.ts +7 -0
  67. package/dist/components/segment/Segment.js +245 -0
  68. package/dist/components/segment/SegmentItem.js +1 -1
  69. package/dist/components/segment.d.ts +3 -7
  70. package/dist/components/segment.js +1 -244
  71. package/dist/components/slider.js +1 -1
  72. package/dist/components/split-button.d.ts +1 -1
  73. package/dist/components/split-button.js +1 -1
  74. package/dist/components/status/Toast/Toast.d.ts +17 -0
  75. package/dist/components/status/Toast/Toast.js +82 -0
  76. package/dist/components/stepper.d.ts +3 -5
  77. package/dist/components/stepper.js +1 -78
  78. package/dist/components/table/CellText.d.ts +1 -1
  79. package/dist/components/table/CellText.js +1 -1
  80. package/dist/components/table/ColumnConfig.d.ts +6 -4
  81. package/dist/components/table/ColumnConfig.js +1 -1
  82. package/dist/components/table/HeaderText.d.ts +1 -1
  83. package/dist/components/table/HeaderText.js +1 -1
  84. package/dist/components/table/InfiniteTable.d.ts +4 -3
  85. package/dist/components/table/PaginatedTable.d.ts +4 -4
  86. package/dist/components/table/Table.d.ts +13 -9
  87. package/dist/components/table/Table.js +8 -8
  88. package/dist/components/tag.d.ts +1 -1
  89. package/dist/components/tag.js +1 -1
  90. package/dist/components/text/Typography/Typography.d.ts +12 -0
  91. package/dist/components/text/Typography/Typography.js +31 -0
  92. package/dist/components/text-area.js +1 -1
  93. package/dist/components/text-input.js +2 -2
  94. package/dist/components/toast.d.ts +2 -16
  95. package/dist/components/toast.js +1 -81
  96. package/dist/components/tooltip.js +1 -1
  97. package/dist/components/typography.d.ts +2 -11
  98. package/dist/components/typography.js +1 -30
  99. package/dist/components/use-toast.d.ts +16 -0
  100. package/dist/components/{status/Toast/useToast.js → use-toast.js} +1 -1
  101. package/dist/config/confirmation.d.ts +2 -0
  102. package/dist/config/confirmation.js +2 -0
  103. package/dist/config/link-context.d.ts +3 -0
  104. package/dist/config/link-context.js +2 -0
  105. package/dist/config/resources.d.ts +2 -0
  106. package/dist/config/resources.js +2 -0
  107. package/dist/config/theme-context.d.ts +2 -0
  108. package/dist/config/theme-context.js +2 -0
  109. package/dist/config/ui-config.d.ts +2 -0
  110. package/dist/config/ui-config.js +2 -0
  111. package/dist/config/ui-overrides.d.ts +2 -0
  112. package/dist/config/ui-overrides.js +2 -0
  113. package/dist/config/ui-router.d.ts +2 -0
  114. package/dist/config/ui-router.js +2 -0
  115. package/dist/config/uiConfig.context.d.ts +1 -1
  116. package/dist/helpers/dynamicColumns.d.ts +13 -10
  117. package/dist/helpers/dynamicInputs.d.ts +1 -1
  118. package/dist/hooks/use-filters.d.ts +2 -0
  119. package/dist/hooks/use-filters.js +2 -0
  120. package/dist/hooks/use-local-storage.d.ts +2 -0
  121. package/dist/hooks/use-local-storage.js +2 -0
  122. package/dist/hooks/use-translation-memo.d.ts +2 -0
  123. package/dist/hooks/use-translation-memo.js +2 -0
  124. package/dist/hooks/useTableColumnConfig.d.ts +7 -5
  125. package/dist/hooks/useTableNav.js +1 -1
  126. package/dist/icons.d.ts +2 -0
  127. package/dist/icons.js +2 -0
  128. package/dist/index.d.ts +59 -39
  129. package/dist/index.js +43 -23
  130. package/dist/rhf/Inputs.d.ts +19 -1
  131. package/dist/rhf/{Inputs.js → Inputs2.js} +18 -1
  132. package/dist/rhf/autocomplete.d.ts +15 -2
  133. package/dist/rhf/autocomplete.js +8 -1
  134. package/dist/rhf/checkbox-group.d.ts +8 -2
  135. package/dist/rhf/checkbox-group.js +8 -1
  136. package/dist/rhf/checkbox.d.ts +8 -2
  137. package/dist/rhf/checkbox.js +8 -1
  138. package/dist/rhf/components.d.ts +30 -69
  139. package/dist/rhf/date-picker.d.ts +8 -2
  140. package/dist/rhf/date-picker.js +9 -1
  141. package/dist/rhf/date-range-picker.d.ts +8 -2
  142. package/dist/rhf/date-range-picker.js +9 -1
  143. package/dist/rhf/date-time-picker.d.ts +8 -2
  144. package/dist/rhf/date-time-picker.js +9 -1
  145. package/dist/rhf/date.transforms.js +15 -0
  146. package/dist/rhf/entry.utils.js +19 -2
  147. package/dist/rhf/file-upload.d.ts +10 -0
  148. package/dist/rhf/file-upload.js +7 -0
  149. package/dist/rhf/input-upload.d.ts +10 -0
  150. package/dist/rhf/input-upload.js +7 -0
  151. package/dist/rhf/inputs.js +3 -0
  152. package/dist/rhf/inputs2.d.ts +6 -0
  153. package/dist/rhf/number-input.js +2 -2
  154. package/dist/rhf/number-range-input.js +2 -2
  155. package/dist/rhf/password-input.js +2 -2
  156. package/dist/rhf/query-autocomplete.d.ts +14 -2
  157. package/dist/rhf/query-autocomplete.js +8 -1
  158. package/dist/rhf/query-select.d.ts +15 -2
  159. package/dist/rhf/query-select.js +8 -1
  160. package/dist/rhf/radio-group.d.ts +8 -2
  161. package/dist/rhf/radio-group.js +8 -1
  162. package/dist/rhf/segment.d.ts +8 -2
  163. package/dist/rhf/segment.js +6 -1
  164. package/dist/rhf/select.d.ts +15 -2
  165. package/dist/rhf/select.js +8 -1
  166. package/dist/rhf/slider.d.ts +7 -2
  167. package/dist/rhf/slider.js +6 -1
  168. package/dist/rhf/text-area.js +2 -2
  169. package/dist/rhf/text-editor.d.ts +8 -0
  170. package/dist/rhf/text-editor.js +7 -0
  171. package/dist/rhf/text-input.js +1 -1
  172. package/dist/rhf/time-picker.d.ts +8 -2
  173. package/dist/rhf/time-picker.js +9 -1
  174. package/dist/rhf/toggle.d.ts +8 -2
  175. package/dist/rhf/toggle.js +8 -1
  176. package/dist/rhf.d.ts +60 -39
  177. package/dist/rhf.js +43 -23
  178. package/dist/styles/input.d.ts +2 -0
  179. package/dist/styles/input.js +0 -0
  180. package/dist/styles/outline.d.ts +2 -0
  181. package/dist/styles/outline.js +2 -0
  182. package/dist/tanstack/file-upload.d.ts +3 -0
  183. package/dist/tanstack/file-upload.js +2 -0
  184. package/dist/tanstack/form.d.ts +2 -1
  185. package/dist/tanstack/form.js +2 -1
  186. package/dist/tanstack/input-upload.d.ts +3 -0
  187. package/dist/tanstack/input-upload.js +2 -0
  188. package/dist/tanstack/inputs.d.ts +6 -0
  189. package/dist/tanstack/inputs.js +3 -0
  190. package/dist/tanstack/segment.d.ts +1 -1
  191. package/dist/tanstack/segment.js +1 -1
  192. package/dist/tanstack/table.d.ts +2 -1
  193. package/dist/tanstack/table.js +2 -1
  194. package/dist/tanstack/text-editor.d.ts +2 -0
  195. package/dist/tanstack/text-editor.js +2 -0
  196. package/dist/tanstack.d.ts +40 -40
  197. package/dist/tanstack.js +30 -30
  198. package/dist/types/index.d.ts +2 -0
  199. package/dist/types/index.js +0 -0
  200. package/dist/utils/compound-mapper.d.ts +2 -0
  201. package/dist/utils/compound-mapper.js +2 -0
  202. package/dist/utils/date-time.d.ts +2 -0
  203. package/dist/utils/date-time.js +2 -0
  204. package/dist/utils/date.d.ts +2 -0
  205. package/dist/utils/date.js +2 -0
  206. package/dist/utils/file.d.ts +2 -0
  207. package/dist/utils/file.js +2 -0
  208. package/dist/utils/intl.d.ts +2 -0
  209. package/dist/utils/intl.js +2 -0
  210. package/dist/utils/logger.js +1 -18
  211. package/dist/utils/logger2.d.ts +2 -0
  212. package/dist/utils/logger2.js +19 -0
  213. package/dist/utils/string.d.ts +2 -0
  214. package/dist/utils/string.js +2 -0
  215. package/package.json +197 -10
  216. package/dist/components/status/Toast/useToast.d.ts +0 -16
  217. package/dist/rhf/components.js +0 -101
  218. /package/dist/styles/{editor.css → styles/editor.css} +0 -0
@@ -1,7 +1,3 @@
1
- import { FieldValues } from "./inputs/shared/form.binding.js";
2
- import { ControlledSegmentProps } from "./segment/segment.types.js";
3
- import { Key } from "react-aria-components";
4
- //#region src/components/segment/Segment.d.ts
5
- declare const Segment: <TFieldValues extends FieldValues, TKey extends Key = Key>(props: ControlledSegmentProps<TFieldValues, TKey>) => import("react/jsx-runtime").JSX.Element;
6
- //#endregion
7
- export { Segment };
1
+ import { ControlledSegmentProps, SegmentProps } from "./segment/segment.types.js";
2
+ import { Segment } from "./segment/Segment.js";
3
+ export { type ControlledSegmentProps, Segment, type SegmentProps };
@@ -1,245 +1,2 @@
1
- import { UIOverrides } from "../config/uiOverrides.context.js";
2
- import { FieldController } from "./inputs/shared/form.binding.js";
3
- import { FormField } from "./form-field.js";
4
- import { segmentDefinition } from "./segment/segment.cva.js";
5
- import { SegmentItem } from "./segment/SegmentItem.js";
6
- import { c } from "react/compiler-runtime";
7
- import { clsx } from "clsx";
8
- import { Fragment, useRef } from "react";
9
- import { ToggleButtonGroup } from "react-aria-components";
10
- import { jsx, jsxs } from "react/jsx-runtime";
11
- import { useToggleButtonGroup } from "react-aria";
12
- import { mergeRefs } from "@react-aria/utils";
13
- import { useToggleGroupState } from "react-stately";
14
- //#region src/components/segment/Segment.tsx
15
- const SegmentBase = (t0) => {
16
- const $ = c(49);
17
- let className;
18
- let defaultValue;
19
- let error;
20
- let items;
21
- let onChange;
22
- let rest;
23
- let segmentItemClassName;
24
- let value;
25
- if ($[0] !== t0) {
26
- ({className, items, error, onChange, value, defaultValue, segmentItemClassName, ...rest} = t0);
27
- $[0] = t0;
28
- $[1] = className;
29
- $[2] = defaultValue;
30
- $[3] = error;
31
- $[4] = items;
32
- $[5] = onChange;
33
- $[6] = rest;
34
- $[7] = segmentItemClassName;
35
- $[8] = value;
36
- } else {
37
- className = $[1];
38
- defaultValue = $[2];
39
- error = $[3];
40
- items = $[4];
41
- onChange = $[5];
42
- rest = $[6];
43
- segmentItemClassName = $[7];
44
- value = $[8];
45
- }
46
- let t1;
47
- if ($[9] !== defaultValue) {
48
- t1 = defaultValue ? Array.isArray(defaultValue) ? defaultValue : [defaultValue] : void 0;
49
- $[9] = defaultValue;
50
- $[10] = t1;
51
- } else t1 = $[10];
52
- let t2;
53
- if ($[11] !== value) {
54
- t2 = value ? Array.isArray(value) ? value : [value] : void 0;
55
- $[11] = value;
56
- $[12] = t2;
57
- } else t2 = $[12];
58
- let t3;
59
- if ($[13] !== rest || $[14] !== t1 || $[15] !== t2) {
60
- t3 = {
61
- ...rest,
62
- defaultSelectedKeys: t1,
63
- selectedKeys: t2
64
- };
65
- $[13] = rest;
66
- $[14] = t1;
67
- $[15] = t2;
68
- $[16] = t3;
69
- } else t3 = $[16];
70
- const props = t3;
71
- const buttonGroupRef = useRef(null);
72
- const state = useToggleGroupState(props);
73
- const { groupProps } = useToggleButtonGroup(props, state, buttonGroupRef);
74
- const segmentCva = UIOverrides.useCva("segment.cva", segmentDefinition);
75
- let t4;
76
- if ($[17] !== error || $[18] !== props.isDisabled) {
77
- t4 = {
78
- error,
79
- label: "",
80
- hideLabel: true,
81
- isDisabled: props.isDisabled
82
- };
83
- $[17] = error;
84
- $[18] = props.isDisabled;
85
- $[19] = t4;
86
- } else t4 = $[19];
87
- const formFieldProps = t4;
88
- let t5;
89
- if ($[20] !== onChange || $[21] !== props.selectionMode) {
90
- t5 = (keys) => {
91
- if (props.selectionMode === "multiple") onChange?.(Array.from(keys.values()));
92
- else onChange?.(Array.from(keys.values())[0]);
93
- };
94
- $[20] = onChange;
95
- $[21] = props.selectionMode;
96
- $[22] = t5;
97
- } else t5 = $[22];
98
- const onSelectionChange = t5;
99
- let t6;
100
- if ($[23] !== items.length) {
101
- t6 = items.length > 2 ? Array.from({ length: items.length * 2 - 1 }, _temp).join(" ") : `repeat(${items.length}, 1fr)`;
102
- $[23] = items.length;
103
- $[24] = t6;
104
- } else t6 = $[24];
105
- const gridTemplateColumns = t6;
106
- let t7;
107
- if ($[25] !== className) {
108
- t7 = clsx("relative w-full", className);
109
- $[25] = className;
110
- $[26] = t7;
111
- } else t7 = $[26];
112
- let t8;
113
- if ($[27] !== className || $[28] !== props || $[29] !== segmentCva) {
114
- t8 = segmentCva({
115
- ...props,
116
- className
117
- });
118
- $[27] = className;
119
- $[28] = props;
120
- $[29] = segmentCva;
121
- $[30] = t8;
122
- } else t8 = $[30];
123
- let t9;
124
- if ($[31] !== gridTemplateColumns) {
125
- t9 = { gridTemplateColumns };
126
- $[31] = gridTemplateColumns;
127
- $[32] = t9;
128
- } else t9 = $[32];
129
- let t10;
130
- if ($[33] !== items || $[34] !== props.isDisabled || $[35] !== segmentItemClassName || $[36] !== state) {
131
- t10 = items.map((item, index) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SegmentItem, {
132
- ...item,
133
- className: clsx(item.className, segmentItemClassName),
134
- isDisabled: item.isDisabled || props.isDisabled,
135
- isSelected: state.selectedKeys.has(item.id),
136
- onPress: () => {
137
- state.toggleKey(item.id);
138
- }
139
- }), index !== items.length - 1 && items.length > 2 && /* @__PURE__ */ jsx("div", {
140
- className: clsx("h-5 w-px rounded-2xl", !state.selectedKeys.has(item.id) && !state.selectedKeys.has(items[index + 1].id) && "bg-elevation-outline-default-1"),
141
- children: /* @__PURE__ */ jsx("span", { className: "flex h-full w-px" })
142
- })] }, item.id));
143
- $[33] = items;
144
- $[34] = props.isDisabled;
145
- $[35] = segmentItemClassName;
146
- $[36] = state;
147
- $[37] = t10;
148
- } else t10 = $[37];
149
- let t11;
150
- if ($[38] !== groupProps || $[39] !== onSelectionChange || $[40] !== props || $[41] !== t10 || $[42] !== t8 || $[43] !== t9) {
151
- t11 = /* @__PURE__ */ jsx(ToggleButtonGroup, {
152
- ...props,
153
- ...groupProps,
154
- ref: buttonGroupRef,
155
- onSelectionChange,
156
- className: t8,
157
- style: t9,
158
- children: t10
159
- });
160
- $[38] = groupProps;
161
- $[39] = onSelectionChange;
162
- $[40] = props;
163
- $[41] = t10;
164
- $[42] = t8;
165
- $[43] = t9;
166
- $[44] = t11;
167
- } else t11 = $[44];
168
- let t12;
169
- if ($[45] !== formFieldProps || $[46] !== t11 || $[47] !== t7) {
170
- t12 = /* @__PURE__ */ jsx(FormField, {
171
- ...formFieldProps,
172
- className: t7,
173
- children: t11
174
- });
175
- $[45] = formFieldProps;
176
- $[46] = t11;
177
- $[47] = t7;
178
- $[48] = t12;
179
- } else t12 = $[48];
180
- return t12;
181
- };
182
- const Segment = (props) => {
183
- const $ = c(15);
184
- if ("field" in props && props.field) {
185
- let field;
186
- let innerProps;
187
- let ref;
188
- if ($[0] !== props) {
189
- ({field, ref, ...innerProps} = props);
190
- $[0] = props;
191
- $[1] = field;
192
- $[2] = innerProps;
193
- $[3] = ref;
194
- } else {
195
- field = $[1];
196
- innerProps = $[2];
197
- ref = $[3];
198
- }
199
- let t0;
200
- if ($[4] !== innerProps || $[5] !== props.error || $[6] !== props.isDisabled || $[7] !== ref) {
201
- t0 = (t1) => {
202
- const { field: field_0, fieldState: t2 } = t1;
203
- const { error } = t2;
204
- return /* @__PURE__ */ jsx(SegmentBase, {
205
- ...innerProps,
206
- ref: mergeRefs(ref, field_0.ref),
207
- value: field_0.value,
208
- onChange: field_0.onChange,
209
- isDisabled: field_0.disabled || props.isDisabled,
210
- error: props.error ?? error?.message
211
- });
212
- };
213
- $[4] = innerProps;
214
- $[5] = props.error;
215
- $[6] = props.isDisabled;
216
- $[7] = ref;
217
- $[8] = t0;
218
- } else t0 = $[8];
219
- let t1;
220
- if ($[9] !== field.form || $[10] !== field.name || $[11] !== t0) {
221
- t1 = /* @__PURE__ */ jsx(FieldController, {
222
- control: field.form,
223
- name: field.name,
224
- render: t0
225
- });
226
- $[9] = field.form;
227
- $[10] = field.name;
228
- $[11] = t0;
229
- $[12] = t1;
230
- } else t1 = $[12];
231
- return t1;
232
- }
233
- let t0;
234
- if ($[13] !== props) {
235
- t0 = /* @__PURE__ */ jsx(SegmentBase, { ...props });
236
- $[13] = props;
237
- $[14] = t0;
238
- } else t0 = $[14];
239
- return t0;
240
- };
241
- function _temp(_, i) {
242
- return i % 2 === 0 ? "1fr" : "auto";
243
- }
244
- //#endregion
1
+ import { Segment } from "./segment/Segment.js";
245
2
  export { Segment };
@@ -1,4 +1,4 @@
1
- import { Typography } from "./typography.js";
1
+ import { Typography } from "./text/Typography/Typography.js";
2
2
  import { UIConfig } from "../config/uiConfig.context.js";
3
3
  import { uiOutlineClass } from "./outline.clsx.js";
4
4
  import { FieldController } from "./inputs/shared/form.binding.js";
@@ -1,6 +1,6 @@
1
1
  import { LinkNavigationProps } from "./link.js";
2
- import { MenuItem as MenuItem$1 } from "./menu.js";
3
2
  import { ButtonVariantProps } from "./buttons/Button/button.cva.js";
3
+ import { MenuItem as MenuItem$1 } from "./Menu/Menu.js";
4
4
  import { ButtonProps } from "react-aria-components";
5
5
  //#region src/components/buttons/SplitButton/SplitButton.d.ts
6
6
  interface SplitButtonProps extends ButtonVariantProps, Omit<ButtonProps, "children"> {
@@ -1,6 +1,6 @@
1
1
  import { Button } from "./buttons/Button/Button.js";
2
2
  import { IconButton } from "./icon-button.js";
3
- import { Menu } from "./menu.js";
3
+ import { Menu } from "./Menu/Menu.js";
4
4
  import { ChevronDown } from "lucide-react";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import { clsx } from "clsx";
@@ -0,0 +1,17 @@
1
+ import { ToastVariantProps } from "./toast.cva.js";
2
+ import { FC, ReactNode, SVGProps } from "react";
3
+ //#region src/components/status/Toast/Toast.d.ts
4
+ interface ToastAction {
5
+ text: string;
6
+ onPress: () => void;
7
+ }
8
+ interface ToastProps extends ToastVariantProps {
9
+ text: ReactNode;
10
+ isLoading?: boolean;
11
+ icon?: FC<SVGProps<SVGSVGElement>>;
12
+ actions?: ToastAction[];
13
+ }
14
+ declare const Toast: ({ text, isLoading, actions, icon: Icon, ...props }: ToastProps) => import("react/jsx-runtime").JSX.Element;
15
+ declare const ToastContainer: () => import("react/jsx-runtime").JSX.Element;
16
+ //#endregion
17
+ export { Toast, ToastAction, ToastContainer, ToastProps };
@@ -0,0 +1,82 @@
1
+ import { UIOverrides } from "../../../config/uiOverrides.context.js";
2
+ import { Typography } from "../../text/Typography/Typography.js";
3
+ import { Loader } from "../../loader.js";
4
+ import { UIConfig } from "../../../config/uiConfig.context.js";
5
+ import { Button } from "../../buttons/Button/Button.js";
6
+ import { buttonColorVariant, statusIconDefinition, statusSeparatorDefinition, toastContainerDefinition, toastDefinition, toastWrapper } from "./toast.cva.js";
7
+ import { c } from "react/compiler-runtime";
8
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
+ import { ToastContainer } from "react-toastify";
10
+ //#region src/components/status/Toast/Toast.tsx
11
+ const Toast = ({ text, isLoading = false, actions = [], icon: Icon, ...props }) => {
12
+ const uiConfig = UIConfig.useConfig();
13
+ const { variant = uiConfig.toast.variant, ...restProps } = props;
14
+ const toastCva = UIOverrides.useCva("toast.cva", toastDefinition);
15
+ const buttonColor = UIOverrides.useMapper("toast.buttonColor", buttonColorVariant);
16
+ const iconCva = UIOverrides.useCva("status.iconCva", statusIconDefinition);
17
+ const separatorCva = UIOverrides.useCva("status.separatorCva", statusSeparatorDefinition);
18
+ const variantProps = {
19
+ variant,
20
+ ...restProps
21
+ };
22
+ return /* @__PURE__ */ jsxs("div", {
23
+ className: toastCva(variantProps),
24
+ children: [/* @__PURE__ */ jsxs("div", {
25
+ className: "flex items-start gap-toast-gap-icon-to-text px-toast-side-default py-toast-height-content",
26
+ children: [
27
+ isLoading && /* @__PURE__ */ jsx(Loader, {
28
+ size: "default",
29
+ className: "shrink-0"
30
+ }),
31
+ !isLoading && Icon && /* @__PURE__ */ jsx(Icon, { className: iconCva(variantProps) }),
32
+ /* @__PURE__ */ jsx(Typography, {
33
+ size: "label-2",
34
+ children: text
35
+ })
36
+ ]
37
+ }), actions.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", { className: separatorCva(variantProps) }), /* @__PURE__ */ jsx("div", {
38
+ className: "flex w-full shrink-0 flex-wrap items-center justify-end gap-toast-gap-action px-toast-side-default py-toast-height-actions-mobile md:w-auto md:justify-center md:py-toast-height-actions-desktop",
39
+ children: actions.map(({ text: buttonText, onPress }) => /* @__PURE__ */ jsx(Button, {
40
+ onPress,
41
+ ...buttonColor(variantProps),
42
+ variant: "text",
43
+ size: "none",
44
+ width: "hug",
45
+ children: buttonText
46
+ }, buttonText))
47
+ })] })]
48
+ });
49
+ };
50
+ const ToastContainer$1 = () => {
51
+ const $ = c(6);
52
+ const uiConfig = UIConfig.useConfig();
53
+ const containerCva = UIOverrides.useCva("toast.containerCva", toastContainerDefinition);
54
+ let t0;
55
+ if ($[0] !== containerCva || $[1] !== uiConfig.toast.position) {
56
+ t0 = (params) => containerCva({
57
+ position: params?.position ?? uiConfig.toast.position,
58
+ className: params?.defaultClassName
59
+ });
60
+ $[0] = containerCva;
61
+ $[1] = uiConfig.toast.position;
62
+ $[2] = t0;
63
+ } else t0 = $[2];
64
+ let t1;
65
+ if ($[3] !== t0 || $[4] !== uiConfig.toast.position) {
66
+ t1 = /* @__PURE__ */ jsx(ToastContainer, {
67
+ position: uiConfig.toast.position,
68
+ className: t0,
69
+ toastClassName: toastWrapper,
70
+ autoClose: 2500,
71
+ icon: false,
72
+ closeButton: false,
73
+ hideProgressBar: true
74
+ });
75
+ $[3] = t0;
76
+ $[4] = uiConfig.toast.position;
77
+ $[5] = t1;
78
+ } else t1 = $[5];
79
+ return t1;
80
+ };
81
+ //#endregion
82
+ export { Toast, ToastContainer$1 as ToastContainer };
@@ -1,5 +1,3 @@
1
- import { StepperProps } from "./navigation/Stepper/stepper.types.js";
2
- //#region src/components/navigation/Stepper/Stepper.d.ts
3
- declare const Stepper: ({ steps, currentStep, orientation, contentOrientation, iconsOnly, titlesOnly, onStepClick, className }: StepperProps) => import("react/jsx-runtime").JSX.Element;
4
- //#endregion
5
- export { Stepper };
1
+ import { StepItem, StepperProps } from "./navigation/Stepper/stepper.types.js";
2
+ import { Stepper } from "./navigation/Stepper/Stepper.js";
3
+ export { type StepItem, Stepper, type StepperProps };
@@ -1,79 +1,2 @@
1
- import { UIOverrides } from "../config/uiOverrides.context.js";
2
- import { stepperDefinition } from "./navigation/Stepper/stepper.cva.js";
3
- import { StepperItem } from "./navigation/Stepper/StepperItem.js";
4
- import { StepperSeparator } from "./navigation/Stepper/StepperSeparator.js";
5
- import { c } from "react/compiler-runtime";
6
- import { Fragment } from "react";
7
- import { jsx, jsxs } from "react/jsx-runtime";
8
- //#region src/components/navigation/Stepper/Stepper.tsx
9
- const Stepper = (t0) => {
10
- const $ = c(23);
11
- const { steps, currentStep, orientation: t1, contentOrientation: t2, iconsOnly, titlesOnly, onStepClick, className } = t0;
12
- const orientation = t1 === void 0 ? "horizontal" : t1;
13
- const contentOrientation = t2 === void 0 ? "horizontal" : t2;
14
- const stepperCva = UIOverrides.useCva("stepper.cva", stepperDefinition);
15
- let t3;
16
- if ($[0] !== className || $[1] !== orientation || $[2] !== stepperCva) {
17
- t3 = stepperCva({
18
- orientation,
19
- className
20
- });
21
- $[0] = className;
22
- $[1] = orientation;
23
- $[2] = stepperCva;
24
- $[3] = t3;
25
- } else t3 = $[3];
26
- let t4;
27
- if ($[4] !== contentOrientation || $[5] !== currentStep || $[6] !== iconsOnly || $[7] !== onStepClick || $[8] !== orientation || $[9] !== steps || $[10] !== titlesOnly) {
28
- let t5;
29
- if ($[12] !== contentOrientation || $[13] !== currentStep || $[14] !== iconsOnly || $[15] !== onStepClick || $[16] !== orientation || $[17] !== steps.length || $[18] !== titlesOnly) {
30
- t5 = (step, index) => {
31
- const status = index < currentStep ? "completed" : index === currentStep ? "active" : "todo";
32
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(StepperItem, {
33
- step,
34
- stepNumber: index + 1,
35
- status,
36
- contentOrientation,
37
- iconsOnly,
38
- titlesOnly,
39
- onPress: onStepClick && status === "completed" ? () => onStepClick(index) : void 0
40
- }), index < steps.length - 1 && /* @__PURE__ */ jsx(StepperSeparator, {
41
- orientation,
42
- contentOrientation
43
- })] }, step.id);
44
- };
45
- $[12] = contentOrientation;
46
- $[13] = currentStep;
47
- $[14] = iconsOnly;
48
- $[15] = onStepClick;
49
- $[16] = orientation;
50
- $[17] = steps.length;
51
- $[18] = titlesOnly;
52
- $[19] = t5;
53
- } else t5 = $[19];
54
- t4 = steps.map(t5);
55
- $[4] = contentOrientation;
56
- $[5] = currentStep;
57
- $[6] = iconsOnly;
58
- $[7] = onStepClick;
59
- $[8] = orientation;
60
- $[9] = steps;
61
- $[10] = titlesOnly;
62
- $[11] = t4;
63
- } else t4 = $[11];
64
- let t5;
65
- if ($[20] !== t3 || $[21] !== t4) {
66
- t5 = /* @__PURE__ */ jsx("div", {
67
- className: t3,
68
- role: "group",
69
- "aria-label": "Progress",
70
- children: t4
71
- });
72
- $[20] = t3;
73
- $[21] = t4;
74
- $[22] = t5;
75
- } else t5 = $[22];
76
- return t5;
77
- };
78
- //#endregion
1
+ import { Stepper } from "./navigation/Stepper/Stepper.js";
79
2
  export { Stepper };
@@ -1,4 +1,4 @@
1
- import { TypographyProps } from "../typography.js";
1
+ import { TypographyProps } from "../text/Typography/Typography.js";
2
2
  import { CSSProperties, FC, ReactNode } from "react";
3
3
  //#region src/components/table/CellText.d.ts
4
4
  interface CellTextProps extends Partial<Pick<TypographyProps, "variant" | "size">> {
@@ -1,5 +1,5 @@
1
1
  import { UIOverrides } from "../../config/uiOverrides.context.js";
2
- import { Typography } from "../typography.js";
2
+ import { Typography } from "../text/Typography/Typography.js";
3
3
  import { UIConfig } from "../../config/uiConfig.context.js";
4
4
  import { tableCellTextDefinition } from "./table.cva.js";
5
5
  import { jsx } from "react/jsx-runtime";
@@ -1,13 +1,15 @@
1
- import { ColumnDef, ColumnOrderState, VisibilityState } from "@tanstack/react-table";
1
+ import { ColumnDef, ColumnOrderState, ColumnVisibilityState, RowData, StockFeatures } from "@tanstack/react-table";
2
2
  //#region src/components/table/ColumnConfig.d.ts
3
- interface ColumnConfigModalProps<TData, TValue> {
3
+ type ColumnDef$1<TData extends RowData, TValue = unknown> = ColumnDef<StockFeatures, TData, TValue>;
4
+ type VisibilityState = ColumnVisibilityState;
5
+ interface ColumnConfigModalProps<TData extends RowData, TValue> {
4
6
  isOpen: boolean;
5
7
  onClose: () => void;
6
- configColumns: ColumnDef<TData, TValue>[];
8
+ configColumns: ColumnDef$1<TData, TValue>[];
7
9
  visibleColumns: VisibilityState;
8
10
  onVisibilityChange: (visibleColumns: VisibilityState) => void;
9
11
  onOrderChange: (columnOrder: ColumnOrderState) => void;
10
12
  }
11
- declare function ColumnConfigModal<TData, TValue>({ isOpen, onClose, configColumns, visibleColumns, onVisibilityChange, onOrderChange }: ColumnConfigModalProps<TData, TValue>): import("react/jsx-runtime").JSX.Element | null;
13
+ declare function ColumnConfigModal<TData extends RowData, TValue>({ isOpen, onClose, configColumns, visibleColumns, onVisibilityChange, onOrderChange }: ColumnConfigModalProps<TData, TValue>): import("react/jsx-runtime").JSX.Element | null;
12
14
  //#endregion
13
15
  export { ColumnConfigModal, ColumnConfigModalProps };
@@ -1,4 +1,4 @@
1
- import { Typography } from "../typography.js";
1
+ import { Typography } from "../text/Typography/Typography.js";
2
2
  import "../../config/i18n.js";
3
3
  import { Checkbox } from "../checkbox.js";
4
4
  import { Modal } from "../overlays/Modal/Modal.js";
@@ -1,4 +1,4 @@
1
- import { TypographyProps } from "../typography.js";
1
+ import { TypographyProps } from "../text/Typography/Typography.js";
2
2
  import { CSSProperties, FC, ReactNode } from "react";
3
3
  //#region src/components/table/HeaderText.d.ts
4
4
  interface HeaderTextProps extends Partial<Pick<TypographyProps, "variant" | "size">> {
@@ -1,5 +1,5 @@
1
1
  import { UIOverrides } from "../../config/uiOverrides.context.js";
2
- import { Typography } from "../typography.js";
2
+ import { Typography } from "../text/Typography/Typography.js";
3
3
  import { UIConfig } from "../../config/uiConfig.context.js";
4
4
  import { tableHeaderTextDefinition } from "./table.cva.js";
5
5
  import { jsx } from "react/jsx-runtime";
@@ -1,11 +1,12 @@
1
1
  import { TableProps } from "./Table.js";
2
+ import { RowData } from "@tanstack/react-table";
2
3
  //#region src/components/table/InfiniteTable.d.ts
3
- interface InfiniteTableWrapperProps<T> extends Omit<InfiniteTableProps<T>, "columns"> {}
4
- interface InfiniteTableProps<T> extends TableProps<T> {
4
+ interface InfiniteTableWrapperProps<T extends RowData> extends Omit<InfiniteTableProps<T>, "columns"> {}
5
+ interface InfiniteTableProps<T extends RowData> extends TableProps<T> {
5
6
  hasNextPage: boolean;
6
7
  isFetchingNextPage?: boolean;
7
8
  fetchNextPage: () => void;
8
9
  }
9
- declare const InfiniteTable: <T>({ hasNextPage, isFetchingNextPage, fetchNextPage, ...rest }: InfiniteTableProps<T>) => import("react/jsx-runtime").JSX.Element;
10
+ declare const InfiniteTable: <T extends RowData>({ hasNextPage, isFetchingNextPage, fetchNextPage, ...rest }: InfiniteTableProps<T>) => import("react/jsx-runtime").JSX.Element;
10
11
  //#endregion
11
12
  export { InfiniteTable, InfiniteTableProps, InfiniteTableWrapperProps };
@@ -1,13 +1,13 @@
1
1
  import { TableProps } from "./Table.js";
2
2
  import { Dispatch, SetStateAction } from "react";
3
- import { PaginationState } from "@tanstack/react-table";
3
+ import { PaginationState, RowData } from "@tanstack/react-table";
4
4
  //#region src/components/table/PaginatedTable.d.ts
5
- interface PaginatedTableWrapperProps<T> extends Omit<PaginatedTableProps<T>, "columns"> {}
6
- interface PaginatedTableProps<T> extends TableProps<T> {
5
+ interface PaginatedTableWrapperProps<T extends RowData> extends Omit<PaginatedTableProps<T>, "columns"> {}
6
+ interface PaginatedTableProps<T extends RowData> extends TableProps<T> {
7
7
  totalItems: number;
8
8
  pagination: PaginationState;
9
9
  setPagination: Dispatch<SetStateAction<PaginationState>>;
10
10
  }
11
- declare const PaginatedTable: <T>({ pagination, setPagination, items, totalItems, ...rest }: PaginatedTableProps<T>) => import("react/jsx-runtime").JSX.Element;
11
+ declare const PaginatedTable: <T extends RowData>({ pagination, setPagination, items, totalItems, ...rest }: PaginatedTableProps<T>) => import("react/jsx-runtime").JSX.Element;
12
12
  //#endregion
13
13
  export { PaginatedTable, PaginatedTableProps, PaginatedTableWrapperProps };
@@ -1,16 +1,20 @@
1
1
  import { TableRowVariantProps } from "./table.cva.js";
2
2
  import { ComponentType, Dispatch, SetStateAction } from "react";
3
3
  import { DragEndEvent, UniqueIdentifier } from "@dnd-kit/core";
4
- import { ColumnDef, ColumnOrderState, OnChangeFn, Row, RowSelectionState, SortingState, Table, VisibilityState } from "@tanstack/react-table";
4
+ import { ColumnDef, ColumnOrderState, ColumnVisibilityState, OnChangeFn, Row, RowData, RowSelectionState, SortingState, StockFeatures, Table } from "@tanstack/react-table";
5
5
  import { TFunction } from "i18next";
6
6
  //#region src/components/table/Table.d.ts
7
- type BulkSelectionActionsComponent<T> = ComponentType<{
8
- table: Table<T>;
7
+ type ColumnDef$1<TData extends RowData, TValue = unknown> = ColumnDef<StockFeatures, TData, TValue>;
8
+ type ReactTable<TData extends RowData> = Table<StockFeatures, TData>;
9
+ type Row$1<TData extends RowData> = Row<StockFeatures, TData>;
10
+ type VisibilityState = ColumnVisibilityState;
11
+ type BulkSelectionActionsComponent<T extends RowData> = ComponentType<{
12
+ table: ReactTable<T>;
9
13
  }>;
10
- interface TableWrapperProps<T> extends Omit<TableProps<T>, "columns"> {}
11
- interface TableProps<T> extends TableRowVariantProps {
14
+ interface TableWrapperProps<T extends RowData> extends Omit<TableProps<T>, "columns"> {}
15
+ interface TableProps<T extends RowData> extends TableRowVariantProps {
12
16
  items: T[];
13
- columns: ((t: TFunction) => ColumnDef<T>[]) | ColumnDef<T>[];
17
+ columns: ((t: TFunction) => ColumnDef$1<T>[]) | ColumnDef$1<T>[];
14
18
  showCellBorder?: boolean;
15
19
  onRowClick?: (row: T) => void;
16
20
  onDoubleClick?: (row: T) => void;
@@ -26,11 +30,11 @@ interface TableProps<T> extends TableRowVariantProps {
26
30
  onDragEnd?: (event: DragEndEvent) => void;
27
31
  onReorder?: (reorderedItems: T[]) => void;
28
32
  getRowId?: (row: T) => UniqueIdentifier;
29
- enableRowSelection?: boolean | ((row: Row<T>) => boolean);
30
- enableMultiRowSelection?: boolean | ((row: Row<T>) => boolean);
33
+ enableRowSelection?: boolean | ((row: Row$1<T>) => boolean);
34
+ enableMultiRowSelection?: boolean | ((row: Row$1<T>) => boolean);
31
35
  defaultSelectedRows?: RowSelectionState;
32
36
  onRowSelectionChange?: OnChangeFn<RowSelectionState>;
33
37
  }
34
- declare const Table$1: <T>({ items, showCellBorder, columns, onRowClick, onDoubleClick, className, sorting, setSorting, columnOrder, setColumnOrder, columnVisibility, setColumnVisibility, bulkSelectionActions: ActionHeader, enableDragDrop, onDragEnd, onReorder, getRowId, enableRowSelection, enableMultiRowSelection, defaultSelectedRows, onRowSelectionChange, ...props }: TableProps<T>) => import("react/jsx-runtime").JSX.Element;
38
+ declare const Table$1: <T extends RowData>({ items, showCellBorder, columns, onRowClick, onDoubleClick, className, sorting, setSorting, columnOrder, setColumnOrder, columnVisibility, setColumnVisibility, bulkSelectionActions: ActionHeader, enableDragDrop, onDragEnd, onReorder, getRowId, enableRowSelection, enableMultiRowSelection, defaultSelectedRows, onRowSelectionChange, ...props }: TableProps<T>) => import("react/jsx-runtime").JSX.Element;
35
39
  //#endregion
36
40
  export { BulkSelectionActionsComponent, Table$1 as Table, TableProps, TableWrapperProps };
@@ -14,9 +14,14 @@ import { DndContext, KeyboardSensor, MouseSensor, TouchSensor, closestCenter, us
14
14
  import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
15
15
  import { SortableContext, arrayMove, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
16
16
  import { CSS } from "@dnd-kit/utilities";
17
- import { flexRender, getCoreRowModel, getPaginationRowModel, getSortedRowModel, useReactTable } from "@tanstack/react-table";
17
+ import { createPaginatedRowModel, createSortedRowModel, flexRender, stockFeatures, tableFeatures, useTable } from "@tanstack/react-table";
18
18
  import i18next from "i18next";
19
19
  //#region src/components/table/Table.tsx
20
+ const tableFeaturesConfig = tableFeatures({
21
+ ...stockFeatures,
22
+ sortedRowModel: createSortedRowModel(),
23
+ paginatedRowModel: createPaginatedRowModel()
24
+ });
20
25
  const CustomCellContext = (context) => {
21
26
  return {
22
27
  ...context,
@@ -81,9 +86,6 @@ const Table$1 = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, cl
81
86
  const tableDataCva = UIOverrides.useCva("table.dataCva", tableDataDefinition);
82
87
  const ref = useRef(null);
83
88
  const { listeners } = useTableNav();
84
- const getCoreRowModelCallback = useCallback(getCoreRowModel, []);
85
- const getSortedRowModelCallback = useCallback(getSortedRowModel, []);
86
- const getPaginationRowModelCallback = useCallback(getPaginationRowModel, []);
87
89
  const data = useMemo(() => items ?? [], [items]);
88
90
  const [internalSelectedRows, setInternalSelectedRows] = useState({});
89
91
  const { rowSelection, handleRowSelectionChange } = useMemo(() => {
@@ -117,7 +119,8 @@ const Table$1 = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, cl
117
119
  setIsSticky(entry.intersectionRatio < 1);
118
120
  }, []);
119
121
  const { ref: stickyRef } = useIntersectionObserver({ onIntersectionChange });
120
- const table = useReactTable({
122
+ const table = useTable({
123
+ features: tableFeaturesConfig,
121
124
  data,
122
125
  columns: tableColumns,
123
126
  state: {
@@ -127,9 +130,6 @@ const Table$1 = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, cl
127
130
  rowSelection
128
131
  },
129
132
  rowCount: items.length,
130
- getCoreRowModel: getCoreRowModelCallback(),
131
- getSortedRowModel: getSortedRowModelCallback(),
132
- getPaginationRowModel: getPaginationRowModelCallback(),
133
133
  manualPagination: true,
134
134
  onColumnOrderChange: setColumnOrder,
135
135
  onColumnVisibilityChange: setColumnVisibility,