@povio/ui 2.3.0-rc.6 → 2.3.0-rc.7

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 (191) hide show
  1. package/dist/assets/icons/AlignCenter.js +26 -11
  2. package/dist/assets/icons/AlignLeft.js +26 -11
  3. package/dist/assets/icons/AlignLeftRight.js +26 -11
  4. package/dist/assets/icons/AlignRight.js +26 -11
  5. package/dist/assets/icons/ArrowDropDown.js +26 -11
  6. package/dist/assets/icons/ArrowDropUp.js +26 -11
  7. package/dist/assets/icons/ArrowLeft.js +26 -11
  8. package/dist/assets/icons/ArrowRight.js +26 -11
  9. package/dist/assets/icons/Bold.js +26 -11
  10. package/dist/assets/icons/BulletedList.js +26 -11
  11. package/dist/assets/icons/Calendar.js +28 -13
  12. package/dist/assets/icons/Check.js +28 -13
  13. package/dist/assets/icons/CheckCircle.js +26 -11
  14. package/dist/assets/icons/CheckboxCheckmark.js +29 -14
  15. package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
  16. package/dist/assets/icons/ChevronDown.js +28 -13
  17. package/dist/assets/icons/ChevronLeft.js +28 -13
  18. package/dist/assets/icons/ChevronRight.js +28 -13
  19. package/dist/assets/icons/ChevronUp.js +28 -13
  20. package/dist/assets/icons/ChevronsLeft.js +28 -13
  21. package/dist/assets/icons/ChevronsRight.js +28 -13
  22. package/dist/assets/icons/Clock.js +26 -11
  23. package/dist/assets/icons/Close.js +26 -11
  24. package/dist/assets/icons/DateTime.js +35 -14
  25. package/dist/assets/icons/DragIndicator.js +26 -11
  26. package/dist/assets/icons/File.js +28 -13
  27. package/dist/assets/icons/Highlight.js +26 -11
  28. package/dist/assets/icons/HighlightOn.js +49 -15
  29. package/dist/assets/icons/Home.js +26 -11
  30. package/dist/assets/icons/Info.js +37 -16
  31. package/dist/assets/icons/Italic.js +26 -11
  32. package/dist/assets/icons/Link.js +26 -11
  33. package/dist/assets/icons/Menu.js +26 -11
  34. package/dist/assets/icons/NumberedList.js +26 -11
  35. package/dist/assets/icons/PointerHorizontal.js +26 -11
  36. package/dist/assets/icons/PointerVertical.js +26 -11
  37. package/dist/assets/icons/Search.js +26 -11
  38. package/dist/assets/icons/Send.js +28 -13
  39. package/dist/assets/icons/Strikethrough.js +26 -11
  40. package/dist/assets/icons/TextColor.js +48 -14
  41. package/dist/assets/icons/Today.js +26 -11
  42. package/dist/assets/icons/Underlined.js +28 -13
  43. package/dist/assets/icons/Upload.js +35 -14
  44. package/dist/assets/icons/Visibility.js +26 -11
  45. package/dist/assets/icons/VisibilityOff.js +26 -11
  46. package/dist/assets/icons/WarningFilled.js +28 -13
  47. package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
  48. package/dist/components/Menu/Menu.js +18 -2
  49. package/dist/components/Menu/MenuDesktop.js +41 -7
  50. package/dist/components/Menu/MenuItem.js +32 -9
  51. package/dist/components/Menu/MenuMobile.js +97 -38
  52. package/dist/components/Menu/MenuPopover.js +105 -29
  53. package/dist/components/buttons/IconButton/IconButton.js +40 -8
  54. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
  55. package/dist/components/buttons/PillButton/PillButton.js +55 -17
  56. package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
  57. package/dist/components/buttons/TextButton/TextButton.js +30 -8
  58. package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
  59. package/dist/components/buttons/shared/ButtonContent.js +80 -22
  60. package/dist/components/inputs/Checkbox/Checkbox.js +164 -34
  61. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
  62. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +8 -8
  63. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +103 -103
  64. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +9 -9
  65. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +384 -116
  66. package/dist/components/inputs/DateTime/shared/Calendar.js +331 -137
  67. package/dist/components/inputs/DateTime/shared/CalendarCell.js +283 -102
  68. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +142 -33
  69. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +245 -90
  70. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  71. package/dist/components/inputs/DateTime/shared/DateField.js +296 -112
  72. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +345 -142
  73. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +94 -21
  74. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
  75. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
  76. package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
  77. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
  78. package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
  79. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
  80. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +205 -70
  81. package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
  82. package/dist/components/inputs/File/FileUpload.js +86 -44
  83. package/dist/components/inputs/File/FileUploadContainer.js +15 -7
  84. package/dist/components/inputs/File/InputUpload.js +317 -79
  85. package/dist/components/inputs/File/shared/FileCard.js +104 -41
  86. package/dist/components/inputs/File/shared/FileCardList.js +47 -12
  87. package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
  88. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
  89. package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
  90. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
  91. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
  92. package/dist/components/inputs/File/shared/InputUploadContent.js +148 -35
  93. package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
  94. package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
  95. package/dist/components/inputs/FormField/FormField.js +119 -37
  96. package/dist/components/inputs/FormField/FormFieldError.js +25 -5
  97. package/dist/components/inputs/FormField/FormFieldHeader.js +79 -22
  98. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
  99. package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
  100. package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
  101. package/dist/components/inputs/Input/NumberInput/NumberInput.js +253 -82
  102. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +541 -116
  103. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +314 -75
  104. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
  105. package/dist/components/inputs/Input/TextArea/TextArea.js +298 -89
  106. package/dist/components/inputs/Input/TextInput/TextInput.js +241 -81
  107. package/dist/components/inputs/Input/shared/InputContent.js +190 -58
  108. package/dist/components/inputs/Inputs/Form.js +40 -11
  109. package/dist/components/inputs/Inputs/InputItem.js +65 -14
  110. package/dist/components/inputs/Inputs/Inputs.js +37 -11
  111. package/dist/components/inputs/RadioGroup/RadioGroup.js +317 -106
  112. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +2 -2
  113. package/dist/components/inputs/Selection/Select/QuerySelect.js +107 -27
  114. package/dist/components/inputs/Selection/shared/SelectBase.js +69 -20
  115. package/dist/components/inputs/Selection/shared/SelectDesktop.js +390 -143
  116. package/dist/components/inputs/Selection/shared/SelectInput.js +334 -136
  117. package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
  118. package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
  119. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
  120. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
  121. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
  122. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
  123. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +36 -11
  124. package/dist/components/inputs/Selection/shared/select.context.js +34 -34
  125. package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
  126. package/dist/components/inputs/Skeleton/InputFrame.js +472 -145
  127. package/dist/components/inputs/Slider/Slider.js +247 -74
  128. package/dist/components/inputs/TextEditor/TextEditor.js +447 -103
  129. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
  130. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
  131. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
  132. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
  133. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
  134. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
  135. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
  136. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
  137. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
  138. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
  139. package/dist/components/inputs/Toggle/Toggle.js +187 -41
  140. package/dist/components/inputs/shared/CheckContent.js +21 -10
  141. package/dist/components/inputs/shared/InputClear.js +78 -21
  142. package/dist/components/inputs/shared/TooltipWrapper.js +47 -12
  143. package/dist/components/inputs/shared/input.cva.js +13 -3
  144. package/dist/components/inputs/shared/useStaticInputHandoff.js +93 -50
  145. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  146. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  147. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  148. package/dist/components/navigation/Stepper/StepperItem.js +104 -31
  149. package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
  150. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  151. package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
  152. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
  153. package/dist/components/overlays/Drawer/Drawer.js +62 -20
  154. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
  155. package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
  156. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
  157. package/dist/components/segment/Segment.js +218 -57
  158. package/dist/components/segment/SegmentItem.js +67 -10
  159. package/dist/components/shared/pagination/Pagination.js +108 -22
  160. package/dist/components/shared/pagination/PaginationList.js +167 -64
  161. package/dist/components/status/Alert/Alert.js +97 -30
  162. package/dist/components/status/Loader/Loader.js +77 -22
  163. package/dist/components/status/Toast/Toast.js +21 -13
  164. package/dist/components/status/Toast/useToast.js +62 -57
  165. package/dist/components/table/ColumnConfig.js +158 -54
  166. package/dist/components/table/InfiniteTable.js +67 -16
  167. package/dist/components/table/PaginatedTable.js +84 -18
  168. package/dist/components/table/Table.js +23 -23
  169. package/dist/components/text/Link/Link.js +19 -7
  170. package/dist/components/text/Typography/Typography.js +23 -8
  171. package/dist/config/confirmation.context.js +1 -1
  172. package/dist/config/link.context.js +23 -9
  173. package/dist/config/router.context.js +42 -16
  174. package/dist/config/theme.context.js +98 -45
  175. package/dist/config/uiConfig.context.js +39 -8
  176. package/dist/config/uiStyle.context.js +15 -5
  177. package/dist/hooks/useBreakpoint.js +16 -3
  178. package/dist/hooks/useDebounceCallback.js +51 -17
  179. package/dist/hooks/useFilters.js +125 -64
  180. package/dist/hooks/useForm.js +42 -8
  181. package/dist/hooks/useFormAutosave.js +101 -30
  182. package/dist/hooks/useIntersectionObserver.js +86 -32
  183. package/dist/hooks/useLocalStorage.js +43 -10
  184. package/dist/hooks/useLongPressRepeat.js +55 -20
  185. package/dist/hooks/usePagination.js +49 -19
  186. package/dist/hooks/useScrollableListBox.js +37 -16
  187. package/dist/hooks/useSorting.js +69 -28
  188. package/dist/hooks/useStateAndRef.js +21 -7
  189. package/dist/hooks/useTableColumnConfig.js +124 -31
  190. package/dist/hooks/useTranslationMemo.js +25 -5
  191. package/package.json +1 -1
@@ -1,52 +1,115 @@
1
1
  import { FileUploadContentError } from "./FileUploadContentError.js";
2
2
  import { FileUploadContentFilled } from "./FileUploadContentFilled.js";
3
3
  import { FileUploadContentLoading } from "./FileUploadContentLoading.js";
4
+ import { c } from "react/compiler-runtime";
4
5
  import { jsx } from "react/jsx-runtime";
5
6
  import { clsx } from "clsx";
6
- import { useMemo } from "react";
7
7
  //#region src/components/inputs/File/shared/FileCard.tsx
8
- var FileCard = ({ index, as, state, onRemove, isDisabled, onCancel }) => {
9
- const content = useMemo(() => {
10
- if (state.state === "uploading") return /* @__PURE__ */ jsx(FileUploadContentLoading, {
11
- index,
12
- variant: "horizontal",
13
- as,
14
- isDisabled,
15
- state,
16
- onCancel: () => onCancel?.(index)
17
- });
18
- if (state.state === "error") return /* @__PURE__ */ jsx(FileUploadContentError, {
19
- as,
20
- removeWithIcon: true,
21
- variant: "horizontal",
22
- isDisabled,
23
- state,
24
- onRemove: () => {
25
- onCancel?.(index);
26
- }
27
- });
28
- return /* @__PURE__ */ jsx(FileUploadContentFilled, {
29
- as,
30
- removeWithIcon: true,
31
- variant: "horizontal",
32
- isDisabled,
33
- state,
34
- onRemove: () => {
8
+ var FileCard = (t0) => {
9
+ const $ = c(28);
10
+ const { index, as, state, onRemove, isDisabled, onCancel } = t0;
11
+ let t1;
12
+ bb0: {
13
+ if (state.state === "uploading") {
14
+ let t2;
15
+ if ($[0] !== index || $[1] !== onCancel) {
16
+ t2 = () => onCancel?.(index);
17
+ $[0] = index;
18
+ $[1] = onCancel;
19
+ $[2] = t2;
20
+ } else t2 = $[2];
21
+ let t3;
22
+ if ($[3] !== as || $[4] !== index || $[5] !== isDisabled || $[6] !== state || $[7] !== t2) {
23
+ t3 = /* @__PURE__ */ jsx(FileUploadContentLoading, {
24
+ index,
25
+ variant: "horizontal",
26
+ as,
27
+ isDisabled,
28
+ state,
29
+ onCancel: t2
30
+ });
31
+ $[3] = as;
32
+ $[4] = index;
33
+ $[5] = isDisabled;
34
+ $[6] = state;
35
+ $[7] = t2;
36
+ $[8] = t3;
37
+ } else t3 = $[8];
38
+ t1 = t3;
39
+ break bb0;
40
+ }
41
+ if (state.state === "error") {
42
+ let t2;
43
+ if ($[9] !== index || $[10] !== onCancel) {
44
+ t2 = () => {
45
+ onCancel?.(index);
46
+ };
47
+ $[9] = index;
48
+ $[10] = onCancel;
49
+ $[11] = t2;
50
+ } else t2 = $[11];
51
+ let t3;
52
+ if ($[12] !== as || $[13] !== isDisabled || $[14] !== state || $[15] !== t2) {
53
+ t3 = /* @__PURE__ */ jsx(FileUploadContentError, {
54
+ as,
55
+ removeWithIcon: true,
56
+ variant: "horizontal",
57
+ isDisabled,
58
+ state,
59
+ onRemove: t2
60
+ });
61
+ $[12] = as;
62
+ $[13] = isDisabled;
63
+ $[14] = state;
64
+ $[15] = t2;
65
+ $[16] = t3;
66
+ } else t3 = $[16];
67
+ t1 = t3;
68
+ break bb0;
69
+ }
70
+ let t2;
71
+ if ($[17] !== onRemove || $[18] !== state.id) {
72
+ t2 = () => {
35
73
  onRemove?.(state.id ?? "");
36
- }
74
+ };
75
+ $[17] = onRemove;
76
+ $[18] = state.id;
77
+ $[19] = t2;
78
+ } else t2 = $[19];
79
+ let t3;
80
+ if ($[20] !== as || $[21] !== isDisabled || $[22] !== state || $[23] !== t2) {
81
+ t3 = /* @__PURE__ */ jsx(FileUploadContentFilled, {
82
+ as,
83
+ removeWithIcon: true,
84
+ variant: "horizontal",
85
+ isDisabled,
86
+ state,
87
+ onRemove: t2
88
+ });
89
+ $[20] = as;
90
+ $[21] = isDisabled;
91
+ $[22] = state;
92
+ $[23] = t2;
93
+ $[24] = t3;
94
+ } else t3 = $[24];
95
+ t1 = t3;
96
+ }
97
+ const content = t1;
98
+ let t2;
99
+ if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
100
+ t2 = clsx("flex items-center self-stretch", "bg-elevation-fill-default-1", "px-file-upload-file-card-side-default", "py-4", "rounded-file-upload-file-card-rounding-default border border-elevation-outline-default-1 border-solid");
101
+ $[25] = t2;
102
+ } else t2 = $[25];
103
+ let t3;
104
+ if ($[26] !== content) {
105
+ t3 = /* @__PURE__ */ jsx("div", {
106
+ className: t2,
107
+ children: content
37
108
  });
38
- }, [
39
- state,
40
- index,
41
- as,
42
- isDisabled,
43
- onCancel,
44
- onRemove
45
- ]);
46
- return /* @__PURE__ */ jsx("div", {
47
- className: clsx("flex items-center self-stretch", "bg-elevation-fill-default-1", "px-file-upload-file-card-side-default", "py-4", "rounded-file-upload-file-card-rounding-default border border-elevation-outline-default-1 border-solid"),
48
- children: content
49
- });
109
+ $[26] = content;
110
+ $[27] = t3;
111
+ } else t3 = $[27];
112
+ return t3;
50
113
  };
51
114
  //#endregion
52
115
  export { FileCard };
@@ -1,19 +1,54 @@
1
1
  import { FileCard } from "./FileCard.js";
2
+ import { c } from "react/compiler-runtime";
2
3
  import { jsx } from "react/jsx-runtime";
3
4
  import { clsx } from "clsx";
4
5
  //#region src/components/inputs/File/shared/FileCardList.tsx
5
- var FileCardList = ({ uploadState, as, isDisabled, className, onRemove, onCancel }) => {
6
- return /* @__PURE__ */ jsx("div", {
7
- className: clsx("mt-10 flex flex-col items-start gap-4 self-stretch", className),
8
- children: uploadState.map((state, index) => /* @__PURE__ */ jsx(FileCard, {
9
- index,
10
- as,
11
- state,
12
- isDisabled,
13
- onRemove,
14
- onCancel
15
- }, state.file?.name ?? state.displayName ?? state.id ?? state.src))
16
- });
6
+ var FileCardList = (t0) => {
7
+ const $ = c(16);
8
+ const { uploadState, as, isDisabled, className, onRemove, onCancel } = t0;
9
+ let t1;
10
+ if ($[0] !== className) {
11
+ t1 = clsx("mt-10 flex flex-col items-start gap-4 self-stretch", className);
12
+ $[0] = className;
13
+ $[1] = t1;
14
+ } else t1 = $[1];
15
+ let t2;
16
+ if ($[2] !== as || $[3] !== isDisabled || $[4] !== onCancel || $[5] !== onRemove || $[6] !== uploadState) {
17
+ let t3;
18
+ if ($[8] !== as || $[9] !== isDisabled || $[10] !== onCancel || $[11] !== onRemove) {
19
+ t3 = (state, index) => /* @__PURE__ */ jsx(FileCard, {
20
+ index,
21
+ as,
22
+ state,
23
+ isDisabled,
24
+ onRemove,
25
+ onCancel
26
+ }, state.file?.name ?? state.displayName ?? state.id ?? state.src);
27
+ $[8] = as;
28
+ $[9] = isDisabled;
29
+ $[10] = onCancel;
30
+ $[11] = onRemove;
31
+ $[12] = t3;
32
+ } else t3 = $[12];
33
+ t2 = uploadState.map(t3);
34
+ $[2] = as;
35
+ $[3] = isDisabled;
36
+ $[4] = onCancel;
37
+ $[5] = onRemove;
38
+ $[6] = uploadState;
39
+ $[7] = t2;
40
+ } else t2 = $[7];
41
+ let t3;
42
+ if ($[13] !== t1 || $[14] !== t2) {
43
+ t3 = /* @__PURE__ */ jsx("div", {
44
+ className: t1,
45
+ children: t2
46
+ });
47
+ $[13] = t1;
48
+ $[14] = t2;
49
+ $[15] = t3;
50
+ } else t3 = $[15];
51
+ return t3;
17
52
  };
18
53
  //#endregion
19
54
  export { FileCardList };
@@ -2,53 +2,166 @@ import { FileUploadContentError } from "./FileUploadContentError.js";
2
2
  import { FileUploadContentFilled } from "./FileUploadContentFilled.js";
3
3
  import { FileUploadContentLoading } from "./FileUploadContentLoading.js";
4
4
  import { FileUploadContentEmpty } from "./FileUploadContentEmpty.js";
5
+ import { c } from "react/compiler-runtime";
5
6
  import { jsx } from "react/jsx-runtime";
6
7
  import { FileTrigger } from "react-aria-components";
7
8
  //#region src/components/inputs/File/shared/FileUploadContent.tsx
8
- var FileUploadContent = ({ variant, as, isDisabled, browseText, uploadText, emptyText, uploadState, handleCancelUpload, handleRemove, acceptedFileTypes, allowsMultiple, handleSelect, ...rest }) => {
9
- const currentState = uploadState.at(0);
10
- const fileTriggerProps = {
11
- ...rest,
12
- acceptedFileTypes,
13
- allowsMultiple,
14
- onSelect: handleSelect
15
- };
9
+ var FileUploadContent = (t0) => {
10
+ const $ = c(57);
11
+ let acceptedFileTypes;
12
+ let allowsMultiple;
13
+ let as;
14
+ let browseText;
15
+ let emptyText;
16
+ let handleCancelUpload;
17
+ let handleRemove;
18
+ let handleSelect;
19
+ let isDisabled;
20
+ let rest;
21
+ let uploadState;
22
+ let uploadText;
23
+ let variant;
24
+ if ($[0] !== t0) {
25
+ ({variant, as, isDisabled, browseText, uploadText, emptyText, uploadState, handleCancelUpload, handleRemove, acceptedFileTypes, allowsMultiple, handleSelect, ...rest} = t0);
26
+ $[0] = t0;
27
+ $[1] = acceptedFileTypes;
28
+ $[2] = allowsMultiple;
29
+ $[3] = as;
30
+ $[4] = browseText;
31
+ $[5] = emptyText;
32
+ $[6] = handleCancelUpload;
33
+ $[7] = handleRemove;
34
+ $[8] = handleSelect;
35
+ $[9] = isDisabled;
36
+ $[10] = rest;
37
+ $[11] = uploadState;
38
+ $[12] = uploadText;
39
+ $[13] = variant;
40
+ } else {
41
+ acceptedFileTypes = $[1];
42
+ allowsMultiple = $[2];
43
+ as = $[3];
44
+ browseText = $[4];
45
+ emptyText = $[5];
46
+ handleCancelUpload = $[6];
47
+ handleRemove = $[7];
48
+ handleSelect = $[8];
49
+ isDisabled = $[9];
50
+ rest = $[10];
51
+ uploadState = $[11];
52
+ uploadText = $[12];
53
+ variant = $[13];
54
+ }
55
+ let t1;
56
+ if ($[14] !== uploadState) {
57
+ t1 = uploadState.at(0);
58
+ $[14] = uploadState;
59
+ $[15] = t1;
60
+ } else t1 = $[15];
61
+ const currentState = t1;
62
+ let t2;
63
+ if ($[16] !== acceptedFileTypes || $[17] !== allowsMultiple || $[18] !== handleSelect || $[19] !== rest) {
64
+ t2 = {
65
+ ...rest,
66
+ acceptedFileTypes,
67
+ allowsMultiple,
68
+ onSelect: handleSelect
69
+ };
70
+ $[16] = acceptedFileTypes;
71
+ $[17] = allowsMultiple;
72
+ $[18] = handleSelect;
73
+ $[19] = rest;
74
+ $[20] = t2;
75
+ } else t2 = $[20];
76
+ const fileTriggerProps = t2;
16
77
  if (!allowsMultiple && currentState) {
17
- if (currentState.state === "uploading") return /* @__PURE__ */ jsx(FileUploadContentLoading, {
18
- index: 0,
19
- variant,
20
- as,
21
- singleFile: true,
22
- isDisabled,
23
- state: currentState,
24
- onCancel: handleCancelUpload
25
- });
26
- if (currentState.state === "uploaded") return /* @__PURE__ */ jsx(FileUploadContentFilled, {
27
- as,
28
- variant,
29
- singleFile: true,
30
- isDisabled,
31
- state: currentState,
32
- browseText,
33
- fileTriggerProps,
34
- onRemove: () => {
35
- handleRemove(currentState.id ?? "");
36
- }
37
- });
38
- if (currentState.state === "error") return /* @__PURE__ */ jsx(FileUploadContentError, {
39
- as,
40
- variant,
41
- singleFile: true,
42
- isDisabled,
43
- state: currentState,
44
- onRemove: () => {
45
- handleRemove(currentState.id ?? "");
46
- }
47
- });
78
+ if (currentState.state === "uploading") {
79
+ let t3;
80
+ if ($[21] !== as || $[22] !== currentState || $[23] !== handleCancelUpload || $[24] !== isDisabled || $[25] !== variant) {
81
+ t3 = /* @__PURE__ */ jsx(FileUploadContentLoading, {
82
+ index: 0,
83
+ variant,
84
+ as,
85
+ singleFile: true,
86
+ isDisabled,
87
+ state: currentState,
88
+ onCancel: handleCancelUpload
89
+ });
90
+ $[21] = as;
91
+ $[22] = currentState;
92
+ $[23] = handleCancelUpload;
93
+ $[24] = isDisabled;
94
+ $[25] = variant;
95
+ $[26] = t3;
96
+ } else t3 = $[26];
97
+ return t3;
98
+ }
99
+ if (currentState.state === "uploaded") {
100
+ let t3;
101
+ if ($[27] !== currentState.id || $[28] !== handleRemove) {
102
+ t3 = () => {
103
+ handleRemove(currentState.id ?? "");
104
+ };
105
+ $[27] = currentState.id;
106
+ $[28] = handleRemove;
107
+ $[29] = t3;
108
+ } else t3 = $[29];
109
+ let t4;
110
+ if ($[30] !== as || $[31] !== browseText || $[32] !== currentState || $[33] !== fileTriggerProps || $[34] !== isDisabled || $[35] !== t3 || $[36] !== variant) {
111
+ t4 = /* @__PURE__ */ jsx(FileUploadContentFilled, {
112
+ as,
113
+ variant,
114
+ singleFile: true,
115
+ isDisabled,
116
+ state: currentState,
117
+ browseText,
118
+ fileTriggerProps,
119
+ onRemove: t3
120
+ });
121
+ $[30] = as;
122
+ $[31] = browseText;
123
+ $[32] = currentState;
124
+ $[33] = fileTriggerProps;
125
+ $[34] = isDisabled;
126
+ $[35] = t3;
127
+ $[36] = variant;
128
+ $[37] = t4;
129
+ } else t4 = $[37];
130
+ return t4;
131
+ }
132
+ if (currentState.state === "error") {
133
+ let t3;
134
+ if ($[38] !== currentState.id || $[39] !== handleRemove) {
135
+ t3 = () => {
136
+ handleRemove(currentState.id ?? "");
137
+ };
138
+ $[38] = currentState.id;
139
+ $[39] = handleRemove;
140
+ $[40] = t3;
141
+ } else t3 = $[40];
142
+ let t4;
143
+ if ($[41] !== as || $[42] !== currentState || $[43] !== isDisabled || $[44] !== t3 || $[45] !== variant) {
144
+ t4 = /* @__PURE__ */ jsx(FileUploadContentError, {
145
+ as,
146
+ variant,
147
+ singleFile: true,
148
+ isDisabled,
149
+ state: currentState,
150
+ onRemove: t3
151
+ });
152
+ $[41] = as;
153
+ $[42] = currentState;
154
+ $[43] = isDisabled;
155
+ $[44] = t3;
156
+ $[45] = variant;
157
+ $[46] = t4;
158
+ } else t4 = $[46];
159
+ return t4;
160
+ }
48
161
  }
49
- return /* @__PURE__ */ jsx(FileTrigger, {
50
- ...fileTriggerProps,
51
- children: /* @__PURE__ */ jsx(FileUploadContentEmpty, {
162
+ let t3;
163
+ if ($[47] !== as || $[48] !== browseText || $[49] !== emptyText || $[50] !== isDisabled || $[51] !== uploadText || $[52] !== variant) {
164
+ t3 = /* @__PURE__ */ jsx(FileUploadContentEmpty, {
52
165
  as,
53
166
  variant,
54
167
  singleFile: true,
@@ -56,8 +169,26 @@ var FileUploadContent = ({ variant, as, isDisabled, browseText, uploadText, empt
56
169
  title: emptyText,
57
170
  uploadText,
58
171
  browseText
59
- })
60
- });
172
+ });
173
+ $[47] = as;
174
+ $[48] = browseText;
175
+ $[49] = emptyText;
176
+ $[50] = isDisabled;
177
+ $[51] = uploadText;
178
+ $[52] = variant;
179
+ $[53] = t3;
180
+ } else t3 = $[53];
181
+ let t4;
182
+ if ($[54] !== fileTriggerProps || $[55] !== t3) {
183
+ t4 = /* @__PURE__ */ jsx(FileTrigger, {
184
+ ...fileTriggerProps,
185
+ children: t3
186
+ });
187
+ $[54] = fileTriggerProps;
188
+ $[55] = t3;
189
+ $[56] = t4;
190
+ } else t4 = $[56];
191
+ return t4;
61
192
  };
62
193
  //#endregion
63
194
  export { FileUploadContent };
@@ -2,55 +2,158 @@ import { Typography } from "../../../text/Typography/Typography.js";
2
2
  import { Button } from "../../../buttons/Button/Button.js";
3
3
  import { TextButton } from "../../../buttons/TextButton/TextButton.js";
4
4
  import { UploadIcon } from "../../../../assets/icons/Upload.js";
5
+ import { c } from "react/compiler-runtime";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
  import { clsx } from "clsx";
7
8
  //#region src/components/inputs/File/shared/FileUploadContentEmpty.tsx
8
- var FileUploadContentEmpty = ({ variant, as, isDisabled, title, browseText, uploadText, singleFile, hideButton = false, className }) => {
9
- return /* @__PURE__ */ jsxs("div", {
10
- className: clsx("flex w-full items-center gap-file-upload-content-gap-text-to-text", className, {
11
- "flex-col": variant === "vertical",
12
- "min-h-11 flex-row justify-between": variant === "horizontal"
13
- }),
14
- children: [/* @__PURE__ */ jsxs("div", {
15
- className: clsx("flex items-center gap-file-upload-content-gap-icon-to-content", {
16
- "flex-col": variant === "vertical",
17
- "flex-row": variant === "horizontal",
18
- "opacity-50": isDisabled
19
- }),
20
- children: [/* @__PURE__ */ jsx(UploadIcon, { className: "h-6 w-6 text-text-default-1" }), /* @__PURE__ */ jsx(Typography, {
21
- variant: "prominent-1",
22
- size: "label-1",
23
- as: "span",
24
- className: clsx("self-stretch text-text-default-1", { "text-center": variant === "vertical" }),
25
- children: title
26
- })]
27
- }), /* @__PURE__ */ jsxs("div", {
28
- className: clsx("flex items-center justify-center", {
29
- "flex-col": variant === "vertical" && as === "button",
30
- "gap-file-upload-content-gap-text-to-text": as === "link",
31
- "gap-file-upload-content-gap-content-to-button": as === "button"
32
- }),
33
- children: [/* @__PURE__ */ jsx(Typography, {
34
- variant: "default",
35
- size: singleFile ? "label-2" : "label-3",
36
- as: "span",
37
- className: clsx("text-text-default-2", {
38
- "text-center": variant === "vertical",
39
- "opacity-50": isDisabled
40
- }),
41
- children: uploadText
42
- }), !hideButton && browseText && (as === "link" ? /* @__PURE__ */ jsx(TextButton, {
43
- className: "text-interactive-text-primary-idle lowercase",
44
- children: browseText
45
- }) : /* @__PURE__ */ jsx(Button, {
46
- variant: "outlined",
47
- size: "xs",
48
- width: "hug",
49
- isDisabled,
50
- children: browseText
51
- }))]
52
- })]
53
- });
9
+ var FileUploadContentEmpty = (t0) => {
10
+ const $ = c(41);
11
+ const { variant, as, isDisabled, title, browseText, uploadText, singleFile, hideButton: t1, className } = t0;
12
+ const hideButton = t1 === void 0 ? false : t1;
13
+ const t2 = variant === "vertical";
14
+ const t3 = variant === "horizontal";
15
+ let t4;
16
+ if ($[0] !== className || $[1] !== t2 || $[2] !== t3) {
17
+ t4 = clsx("flex w-full items-center gap-file-upload-content-gap-text-to-text", className, {
18
+ "flex-col": t2,
19
+ "min-h-11 flex-row justify-between": t3
20
+ });
21
+ $[0] = className;
22
+ $[1] = t2;
23
+ $[2] = t3;
24
+ $[3] = t4;
25
+ } else t4 = $[3];
26
+ const t5 = variant === "vertical";
27
+ const t6 = variant === "horizontal";
28
+ let t7;
29
+ if ($[4] !== isDisabled || $[5] !== t5 || $[6] !== t6) {
30
+ t7 = clsx("flex items-center gap-file-upload-content-gap-icon-to-content", {
31
+ "flex-col": t5,
32
+ "flex-row": t6,
33
+ "opacity-50": isDisabled
34
+ });
35
+ $[4] = isDisabled;
36
+ $[5] = t5;
37
+ $[6] = t6;
38
+ $[7] = t7;
39
+ } else t7 = $[7];
40
+ let t8;
41
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
42
+ t8 = /* @__PURE__ */ jsx(UploadIcon, { className: "h-6 w-6 text-text-default-1" });
43
+ $[8] = t8;
44
+ } else t8 = $[8];
45
+ const t9 = variant === "vertical";
46
+ let t10;
47
+ if ($[9] !== t9) {
48
+ t10 = clsx("self-stretch text-text-default-1", { "text-center": t9 });
49
+ $[9] = t9;
50
+ $[10] = t10;
51
+ } else t10 = $[10];
52
+ let t11;
53
+ if ($[11] !== t10 || $[12] !== title) {
54
+ t11 = /* @__PURE__ */ jsx(Typography, {
55
+ variant: "prominent-1",
56
+ size: "label-1",
57
+ as: "span",
58
+ className: t10,
59
+ children: title
60
+ });
61
+ $[11] = t10;
62
+ $[12] = title;
63
+ $[13] = t11;
64
+ } else t11 = $[13];
65
+ let t12;
66
+ if ($[14] !== t11 || $[15] !== t7) {
67
+ t12 = /* @__PURE__ */ jsxs("div", {
68
+ className: t7,
69
+ children: [t8, t11]
70
+ });
71
+ $[14] = t11;
72
+ $[15] = t7;
73
+ $[16] = t12;
74
+ } else t12 = $[16];
75
+ const t13 = variant === "vertical" && as === "button";
76
+ const t14 = as === "link";
77
+ const t15 = as === "button";
78
+ let t16;
79
+ if ($[17] !== t13 || $[18] !== t14 || $[19] !== t15) {
80
+ t16 = clsx("flex items-center justify-center", {
81
+ "flex-col": t13,
82
+ "gap-file-upload-content-gap-text-to-text": t14,
83
+ "gap-file-upload-content-gap-content-to-button": t15
84
+ });
85
+ $[17] = t13;
86
+ $[18] = t14;
87
+ $[19] = t15;
88
+ $[20] = t16;
89
+ } else t16 = $[20];
90
+ const t17 = singleFile ? "label-2" : "label-3";
91
+ const t18 = variant === "vertical";
92
+ let t19;
93
+ if ($[21] !== isDisabled || $[22] !== t18) {
94
+ t19 = clsx("text-text-default-2", {
95
+ "text-center": t18,
96
+ "opacity-50": isDisabled
97
+ });
98
+ $[21] = isDisabled;
99
+ $[22] = t18;
100
+ $[23] = t19;
101
+ } else t19 = $[23];
102
+ let t20;
103
+ if ($[24] !== t17 || $[25] !== t19 || $[26] !== uploadText) {
104
+ t20 = /* @__PURE__ */ jsx(Typography, {
105
+ variant: "default",
106
+ size: t17,
107
+ as: "span",
108
+ className: t19,
109
+ children: uploadText
110
+ });
111
+ $[24] = t17;
112
+ $[25] = t19;
113
+ $[26] = uploadText;
114
+ $[27] = t20;
115
+ } else t20 = $[27];
116
+ let t21;
117
+ if ($[28] !== as || $[29] !== browseText || $[30] !== hideButton || $[31] !== isDisabled) {
118
+ t21 = !hideButton && browseText && (as === "link" ? /* @__PURE__ */ jsx(TextButton, {
119
+ className: "text-interactive-text-primary-idle lowercase",
120
+ children: browseText
121
+ }) : /* @__PURE__ */ jsx(Button, {
122
+ variant: "outlined",
123
+ size: "xs",
124
+ width: "hug",
125
+ isDisabled,
126
+ children: browseText
127
+ }));
128
+ $[28] = as;
129
+ $[29] = browseText;
130
+ $[30] = hideButton;
131
+ $[31] = isDisabled;
132
+ $[32] = t21;
133
+ } else t21 = $[32];
134
+ let t22;
135
+ if ($[33] !== t16 || $[34] !== t20 || $[35] !== t21) {
136
+ t22 = /* @__PURE__ */ jsxs("div", {
137
+ className: t16,
138
+ children: [t20, t21]
139
+ });
140
+ $[33] = t16;
141
+ $[34] = t20;
142
+ $[35] = t21;
143
+ $[36] = t22;
144
+ } else t22 = $[36];
145
+ let t23;
146
+ if ($[37] !== t12 || $[38] !== t22 || $[39] !== t4) {
147
+ t23 = /* @__PURE__ */ jsxs("div", {
148
+ className: t4,
149
+ children: [t12, t22]
150
+ });
151
+ $[37] = t12;
152
+ $[38] = t22;
153
+ $[39] = t4;
154
+ $[40] = t23;
155
+ } else t23 = $[40];
156
+ return t23;
54
157
  };
55
158
  //#endregion
56
159
  export { FileUploadContentEmpty };