@povio/ui 2.3.0-rc.9 → 2.3.1

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 (282) hide show
  1. package/dist/assets/icons/AlignCenter.js +11 -26
  2. package/dist/assets/icons/AlignLeft.js +11 -26
  3. package/dist/assets/icons/AlignLeftRight.js +11 -26
  4. package/dist/assets/icons/AlignRight.js +11 -26
  5. package/dist/assets/icons/ArrowDropDown.js +11 -26
  6. package/dist/assets/icons/ArrowDropUp.js +11 -26
  7. package/dist/assets/icons/ArrowLeft.js +11 -26
  8. package/dist/assets/icons/ArrowRight.js +11 -26
  9. package/dist/assets/icons/Bold.js +11 -26
  10. package/dist/assets/icons/BulletedList.js +11 -26
  11. package/dist/assets/icons/Calendar.js +13 -28
  12. package/dist/assets/icons/Check.js +13 -28
  13. package/dist/assets/icons/CheckCircle.js +11 -26
  14. package/dist/assets/icons/CheckboxCheckmark.js +14 -29
  15. package/dist/assets/icons/CheckboxIndeterminate.js +14 -29
  16. package/dist/assets/icons/ChevronDown.js +13 -28
  17. package/dist/assets/icons/ChevronLeft.js +13 -28
  18. package/dist/assets/icons/ChevronRight.js +13 -28
  19. package/dist/assets/icons/ChevronUp.js +13 -28
  20. package/dist/assets/icons/ChevronsLeft.js +13 -28
  21. package/dist/assets/icons/ChevronsRight.js +13 -28
  22. package/dist/assets/icons/Clock.js +11 -26
  23. package/dist/assets/icons/Close.js +11 -26
  24. package/dist/assets/icons/DateTime.js +14 -35
  25. package/dist/assets/icons/DragIndicator.js +11 -26
  26. package/dist/assets/icons/File.js +13 -28
  27. package/dist/assets/icons/Highlight.js +11 -26
  28. package/dist/assets/icons/HighlightOn.js +15 -49
  29. package/dist/assets/icons/Home.js +11 -26
  30. package/dist/assets/icons/Info.js +16 -37
  31. package/dist/assets/icons/Italic.js +11 -26
  32. package/dist/assets/icons/Link.js +11 -26
  33. package/dist/assets/icons/Menu.js +11 -26
  34. package/dist/assets/icons/NumberedList.js +11 -26
  35. package/dist/assets/icons/PointerHorizontal.js +11 -26
  36. package/dist/assets/icons/PointerVertical.js +11 -26
  37. package/dist/assets/icons/Search.js +11 -26
  38. package/dist/assets/icons/Send.js +13 -28
  39. package/dist/assets/icons/Strikethrough.js +11 -26
  40. package/dist/assets/icons/TextColor.js +14 -48
  41. package/dist/assets/icons/Today.js +11 -26
  42. package/dist/assets/icons/Underlined.js +13 -28
  43. package/dist/assets/icons/Upload.js +14 -35
  44. package/dist/assets/icons/Visibility.js +11 -26
  45. package/dist/assets/icons/VisibilityOff.js +11 -26
  46. package/dist/assets/icons/WarningFilled.js +13 -28
  47. package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
  48. package/dist/components/Menu/Menu.js +2 -18
  49. package/dist/components/Menu/MenuDesktop.js +7 -41
  50. package/dist/components/Menu/MenuItem.js +9 -32
  51. package/dist/components/Menu/MenuMobile.js +38 -97
  52. package/dist/components/Menu/MenuPopover.js +29 -105
  53. package/dist/components/buttons/IconButton/IconButton.js +8 -40
  54. package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
  55. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
  56. package/dist/components/buttons/PillButton/PillButton.js +17 -55
  57. package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
  58. package/dist/components/buttons/TextButton/TextButton.js +8 -30
  59. package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
  60. package/dist/components/buttons/shared/ButtonContent.js +22 -80
  61. package/dist/components/inputs/Checkbox/Checkbox.js +35 -172
  62. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
  63. package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
  64. package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
  65. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -10
  66. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +20 -121
  67. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -10
  68. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +111 -215
  69. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -11
  70. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +19 -123
  71. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -5
  72. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +104 -448
  73. package/dist/components/inputs/DateTime/shared/Calendar.d.ts +2 -5
  74. package/dist/components/inputs/DateTime/shared/Calendar.js +119 -330
  75. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +1 -1
  76. package/dist/components/inputs/DateTime/shared/CalendarCell.js +102 -283
  77. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +1 -1
  78. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -142
  79. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +93 -249
  80. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
  81. package/dist/components/inputs/DateTime/shared/DateField.js +112 -296
  82. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -6
  83. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +136 -355
  84. package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -14
  85. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -97
  86. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +27 -81
  87. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
  88. package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
  89. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
  90. package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
  91. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +110 -279
  92. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -2
  93. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -207
  94. package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
  95. package/dist/components/inputs/File/FileUpload.js +44 -87
  96. package/dist/components/inputs/File/FileUploadContainer.js +7 -15
  97. package/dist/components/inputs/File/InputUpload.js +79 -317
  98. package/dist/components/inputs/File/shared/FileCard.js +41 -104
  99. package/dist/components/inputs/File/shared/FileCardList.js +12 -47
  100. package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
  101. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
  102. package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
  103. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
  104. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
  105. package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
  106. package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
  107. package/dist/components/inputs/File/shared/ProgressBar.js +9 -48
  108. package/dist/components/inputs/FormField/FormField.d.ts +3 -3
  109. package/dist/components/inputs/FormField/FormField.js +37 -119
  110. package/dist/components/inputs/FormField/FormFieldError.js +5 -25
  111. package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
  112. package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
  113. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
  114. package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
  115. package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
  116. package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
  117. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
  118. package/dist/components/inputs/Input/NumberInput/NumberInput.js +88 -334
  119. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
  120. package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
  121. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
  122. package/dist/components/inputs/Input/TextInput/TextInput.js +79 -319
  123. package/dist/components/inputs/Input/shared/InputContent.js +59 -192
  124. package/dist/components/inputs/Inputs/Form.js +11 -40
  125. package/dist/components/inputs/Inputs/InputItem.d.ts +21 -16
  126. package/dist/components/inputs/Inputs/InputItem.js +14 -71
  127. package/dist/components/inputs/Inputs/Inputs.js +11 -37
  128. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
  129. package/dist/components/inputs/RadioGroup/RadioGroup.js +60 -352
  130. package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -17
  131. package/dist/components/inputs/RadioGroup/radio.cva.js +1 -42
  132. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
  133. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +7 -109
  134. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
  135. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -34
  136. package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
  137. package/dist/components/inputs/Selection/Select/Select.js +5 -132
  138. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -8
  139. package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
  140. package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
  141. package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
  142. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  143. package/dist/components/inputs/Selection/shared/SelectInput.js +116 -338
  144. package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
  145. package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
  146. package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
  147. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
  148. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
  149. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +21 -70
  150. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
  151. package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
  152. package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -9
  153. package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
  154. package/dist/components/inputs/Selection/shared/select.context.js +34 -57
  155. package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
  156. package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
  157. package/dist/components/inputs/Slider/Slider.js +74 -250
  158. package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
  159. package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
  160. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
  161. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
  162. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
  163. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
  164. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
  165. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
  166. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
  167. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
  168. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
  169. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
  170. package/dist/components/inputs/Toggle/Toggle.js +37 -189
  171. package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
  172. package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
  173. package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
  174. package/dist/components/inputs/shared/CheckContent.js +11 -21
  175. package/dist/components/inputs/shared/InputClear.d.ts +1 -2
  176. package/dist/components/inputs/shared/InputClear.js +13 -79
  177. package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
  178. package/dist/components/inputs/shared/input.cva.d.ts +0 -10
  179. package/dist/components/inputs/shared/input.cva.js +4 -32
  180. package/dist/components/navigation/Accordion/Accordion.js +22 -69
  181. package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
  182. package/dist/components/navigation/Stepper/Stepper.js +22 -67
  183. package/dist/components/navigation/Stepper/StepperItem.js +31 -104
  184. package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
  185. package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
  186. package/dist/components/overlays/BottomSheet/BottomSheet.js +49 -98
  187. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
  188. package/dist/components/overlays/Drawer/Drawer.js +20 -62
  189. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +27 -83
  190. package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
  191. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
  192. package/dist/components/segment/Segment.js +57 -218
  193. package/dist/components/segment/SegmentItem.js +10 -67
  194. package/dist/components/shared/pagination/Pagination.js +22 -108
  195. package/dist/components/shared/pagination/PaginationList.js +64 -167
  196. package/dist/components/status/Alert/Alert.js +30 -97
  197. package/dist/components/status/Loader/Loader.js +22 -77
  198. package/dist/components/status/Toast/Toast.js +13 -21
  199. package/dist/components/status/Toast/useToast.js +57 -62
  200. package/dist/components/table/ColumnConfig.js +54 -158
  201. package/dist/components/table/InfiniteTable.js +16 -67
  202. package/dist/components/table/PaginatedTable.js +18 -84
  203. package/dist/components/table/Table.js +27 -28
  204. package/dist/components/text/Link/Link.js +7 -19
  205. package/dist/components/text/Typography/Typography.js +8 -23
  206. package/dist/config/confirmation.context.js +1 -1
  207. package/dist/config/link.context.js +9 -23
  208. package/dist/config/router.context.js +16 -42
  209. package/dist/config/theme.context.js +45 -98
  210. package/dist/config/uiConfig.context.d.ts +6 -16
  211. package/dist/config/uiConfig.context.js +13 -56
  212. package/dist/config/uiStyle.context.d.ts +4 -27
  213. package/dist/config/uiStyle.context.js +5 -15
  214. package/dist/helpers/dynamicInputs.d.ts +5 -5
  215. package/dist/helpers/dynamicInputs.js +0 -3
  216. package/dist/hooks/useBreakpoint.js +3 -16
  217. package/dist/hooks/useDebounceCallback.js +17 -51
  218. package/dist/hooks/useFilters.js +64 -125
  219. package/dist/hooks/useForm.js +8 -42
  220. package/dist/hooks/useFormAutosave.js +30 -101
  221. package/dist/hooks/useIntersectionObserver.d.ts +1 -1
  222. package/dist/hooks/useIntersectionObserver.js +24 -91
  223. package/dist/hooks/useLocalStorage.js +10 -43
  224. package/dist/hooks/useLongPressRepeat.js +20 -55
  225. package/dist/hooks/usePagination.js +19 -49
  226. package/dist/hooks/useScrollableListBox.js +16 -37
  227. package/dist/hooks/useSorting.js +28 -69
  228. package/dist/hooks/useStateAndRef.js +7 -21
  229. package/dist/hooks/useTableColumnConfig.js +31 -124
  230. package/dist/hooks/useTranslationMemo.js +5 -25
  231. package/dist/index.d.ts +0 -7
  232. package/dist/index.js +3 -5
  233. package/dist/tw-ui-plugin.js +0 -2
  234. package/dist/utils/date-time.utils.d.ts +10 -31
  235. package/dist/utils/date-time.utils.js +22 -123
  236. package/dist/utils/dom.utils.js +1 -1
  237. package/package.json +1 -1
  238. package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -4
  239. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -7
  240. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -13
  241. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -6
  242. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -21
  243. package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
  244. package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
  245. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -31
  246. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -80
  247. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
  248. package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -6
  249. package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -11
  250. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
  251. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
  252. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
  253. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -479
  254. package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -4
  255. package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
  256. package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
  257. package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
  258. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -36
  259. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
  260. package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -122
  261. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
  262. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
  263. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -6
  264. package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -13
  265. package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -3
  266. package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
  267. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -5
  268. package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -5
  269. package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
  270. package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -37
  271. package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
  272. package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -79
  273. package/dist/components/inputs/Skeleton/InputFrame.js +0 -526
  274. package/dist/components/inputs/shared/StaticInput.d.ts +0 -38
  275. package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -4
  276. package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
  277. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
  278. package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
  279. package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
  280. package/dist/hooks/useQueryAutocomplete.js +0 -57
  281. package/dist/utils/query.utils.d.ts +0 -4
  282. package/dist/utils/query.utils.js +0 -8
@@ -4,125 +4,53 @@ import { Typography } from "../../../text/Typography/Typography.js";
4
4
  import { useInputCva } from "../../shared/input.cva.js";
5
5
  import { popover } from "../../../shared/popover.cva.js";
6
6
  import { ColorPicker } from "./ColorPicker.js";
7
- import { c } from "react/compiler-runtime";
8
7
  import { jsx, jsxs } from "react/jsx-runtime";
9
8
  import { clsx } from "clsx";
10
9
  import { useState } from "react";
11
10
  import { Button, Dialog, DialogTrigger, Popover } from "react-aria-components";
12
11
  //#region src/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.tsx
13
- var ColorPickerDropdown = (t0) => {
14
- const $ = c(28);
15
- const { colors, value, onChange, isDisabled, children } = t0;
12
+ var ColorPickerDropdown = ({ colors, value, onChange, isDisabled, children }) => {
16
13
  const inputCva = useInputCva();
17
14
  const popoverCva = UIStyle.useCva("popover.cva", popover);
18
15
  const [isOpen, setIsOpen] = useState(false);
19
- let t1;
20
- if ($[0] !== onChange) {
21
- t1 = (color) => {
22
- onChange(color);
23
- setIsOpen(false);
24
- };
25
- $[0] = onChange;
26
- $[1] = t1;
27
- } else t1 = $[1];
28
- const handleChange = t1;
29
- let t2;
30
- if ($[2] !== inputCva) {
31
- t2 = inputCva({
32
- as: "inline",
33
- className: clsx("flex items-center justify-between gap-2")
34
- });
35
- $[2] = inputCva;
36
- $[3] = t2;
37
- } else t2 = $[3];
38
- let t3;
39
- if ($[4] !== children) {
40
- t3 = /* @__PURE__ */ jsx(Typography, {
41
- size: "label-1",
42
- className: "truncate",
43
- children
44
- });
45
- $[4] = children;
46
- $[5] = t3;
47
- } else t3 = $[5];
48
- const t4 = isOpen && "rotate-180";
49
- let t5;
50
- if ($[6] !== t4) {
51
- t5 = clsx("size-6 shrink-0", t4);
52
- $[6] = t4;
53
- $[7] = t5;
54
- } else t5 = $[7];
55
- let t6;
56
- if ($[8] !== t5) {
57
- t6 = /* @__PURE__ */ jsx(ArrowDropDownIcon, {
58
- className: t5,
59
- "aria-hidden": "true"
60
- });
61
- $[8] = t5;
62
- $[9] = t6;
63
- } else t6 = $[9];
64
- let t7;
65
- if ($[10] !== isDisabled || $[11] !== t2 || $[12] !== t3 || $[13] !== t6) {
66
- t7 = /* @__PURE__ */ jsxs(Button, {
67
- className: t2,
16
+ const handleChange = (color) => {
17
+ onChange(color);
18
+ setIsOpen(false);
19
+ };
20
+ return /* @__PURE__ */ jsxs(DialogTrigger, {
21
+ isOpen,
22
+ onOpenChange: setIsOpen,
23
+ children: [/* @__PURE__ */ jsxs(Button, {
24
+ className: inputCva({
25
+ as: "inline",
26
+ className: clsx("flex items-center justify-between gap-2")
27
+ }),
68
28
  isDisabled,
69
- children: [t3, t6]
70
- });
71
- $[10] = isDisabled;
72
- $[11] = t2;
73
- $[12] = t3;
74
- $[13] = t6;
75
- $[14] = t7;
76
- } else t7 = $[14];
77
- let t8;
78
- if ($[15] !== popoverCva) {
79
- t8 = clsx(popoverCva({}), "flex justify-center overflow-hidden p-2");
80
- $[15] = popoverCva;
81
- $[16] = t8;
82
- } else t8 = $[16];
83
- let t9;
84
- if ($[17] !== colors || $[18] !== handleChange || $[19] !== value) {
85
- t9 = /* @__PURE__ */ jsx(ColorPicker, {
86
- colors,
87
- value,
88
- onChange: handleChange
89
- });
90
- $[17] = colors;
91
- $[18] = handleChange;
92
- $[19] = value;
93
- $[20] = t9;
94
- } else t9 = $[20];
95
- let t10;
96
- if ($[21] !== t8 || $[22] !== t9) {
97
- t10 = /* @__PURE__ */ jsx(Popover, {
29
+ children: [/* @__PURE__ */ jsx(Typography, {
30
+ size: "label-1",
31
+ className: "truncate",
32
+ children
33
+ }), /* @__PURE__ */ jsx(ArrowDropDownIcon, {
34
+ className: clsx("size-6 shrink-0", isOpen && "rotate-180"),
35
+ "aria-hidden": "true"
36
+ })]
37
+ }), /* @__PURE__ */ jsx(Popover, {
98
38
  className: "my-4 w-40 outline-none",
99
39
  offset: 0,
100
40
  placement: "bottom start",
101
41
  children: /* @__PURE__ */ jsx(Dialog, {
102
42
  className: "outline-none",
103
43
  children: /* @__PURE__ */ jsx("div", {
104
- className: t8,
105
- children: t9
44
+ className: clsx(popoverCva({}), "flex justify-center overflow-hidden p-2"),
45
+ children: /* @__PURE__ */ jsx(ColorPicker, {
46
+ colors,
47
+ value,
48
+ onChange: handleChange
49
+ })
106
50
  })
107
51
  })
108
- });
109
- $[21] = t8;
110
- $[22] = t9;
111
- $[23] = t10;
112
- } else t10 = $[23];
113
- let t11;
114
- if ($[24] !== isOpen || $[25] !== t10 || $[26] !== t7) {
115
- t11 = /* @__PURE__ */ jsxs(DialogTrigger, {
116
- isOpen,
117
- onOpenChange: setIsOpen,
118
- children: [t7, t10]
119
- });
120
- $[24] = isOpen;
121
- $[25] = t10;
122
- $[26] = t7;
123
- $[27] = t11;
124
- } else t11 = $[27];
125
- return t11;
52
+ })]
53
+ });
126
54
  };
127
55
  //#endregion
128
56
  export { ColorPickerDropdown };
@@ -4,218 +4,69 @@ import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconBu
4
4
  import "../../../../config/i18n.js";
5
5
  import { TextInput } from "../../Input/TextInput/TextInput.js";
6
6
  import { ResponsivePopover } from "../../../overlays/ResponsivePopover/ResponsivePopover.js";
7
- import { c } from "react/compiler-runtime";
8
7
  import { jsx, jsxs } from "react/jsx-runtime";
9
8
  import { clsx } from "clsx";
10
9
  import { useEffect, useState } from "react";
11
10
  import { useTranslation } from "react-i18next";
12
11
  //#region src/components/inputs/TextEditor/Toolbar/HyperlinkAction.tsx
13
- var HyperlinkAction = (t0) => {
14
- const $ = c(49);
15
- const { editor } = t0;
12
+ var HyperlinkAction = ({ editor }) => {
16
13
  const { t } = useTranslation("ui");
17
14
  const [isOpen, setIsOpen] = useState(false);
18
15
  const [url, setUrl] = useState("");
19
- const isLinkEnabled = !!editor.extensionManager.extensions.find(_temp);
16
+ const isLinkEnabled = !!editor.extensionManager.extensions.find((extension) => extension.name === "link");
20
17
  const linkHref = editor.getAttributes("link")?.href;
21
- let t1;
22
- let t2;
23
- if ($[0] !== linkHref) {
24
- t1 = () => {
25
- setUrl(linkHref || "");
26
- };
27
- t2 = [linkHref];
28
- $[0] = linkHref;
29
- $[1] = t1;
30
- $[2] = t2;
31
- } else {
32
- t1 = $[1];
33
- t2 = $[2];
34
- }
35
- useEffect(t1, t2);
18
+ useEffect(() => {
19
+ setUrl(linkHref || "");
20
+ }, [linkHref]);
36
21
  if (!isLinkEnabled) return null;
37
- let t3;
38
- if ($[3] !== editor) {
39
- t3 = () => {
40
- editor.chain().focus().extendMarkRange("link").unsetLink().run();
41
- setIsOpen(false);
42
- };
43
- $[3] = editor;
44
- $[4] = t3;
45
- } else t3 = $[4];
46
- const onRemove = t3;
47
- let t4;
48
- if ($[5] !== editor || $[6] !== url) {
49
- t4 = () => {
50
- editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
51
- setIsOpen(false);
52
- };
53
- $[5] = editor;
54
- $[6] = url;
55
- $[7] = t4;
56
- } else t4 = $[7];
57
- const onApply = t4;
58
- let t5;
59
- if ($[8] !== t) {
60
- t5 = t(_temp2);
61
- $[8] = t;
62
- $[9] = t5;
63
- } else t5 = $[9];
64
- let t6;
65
- if ($[10] !== t) {
66
- t6 = t(_temp3);
67
- $[10] = t;
68
- $[11] = t6;
69
- } else t6 = $[11];
70
- let t7;
71
- if ($[12] !== editor) {
72
- t7 = clsx(editor.isActive("link") && "!text-interactive-text-primary-idle");
73
- $[12] = editor;
74
- $[13] = t7;
75
- } else t7 = $[13];
76
- const t8 = !editor.isEditable;
77
- let t9;
78
- if ($[14] !== t6 || $[15] !== t7 || $[16] !== t8) {
79
- t9 = /* @__PURE__ */ jsx(InlineIconButton, {
22
+ const onRemove = () => {
23
+ editor.chain().focus().extendMarkRange("link").unsetLink().run();
24
+ setIsOpen(false);
25
+ };
26
+ const onApply = () => {
27
+ editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
28
+ setIsOpen(false);
29
+ };
30
+ return /* @__PURE__ */ jsxs(ResponsivePopover, {
31
+ isOpen,
32
+ onOpenChange: setIsOpen,
33
+ sheetLabel: t(($) => $.ui.textEditor.link.label),
34
+ trigger: /* @__PURE__ */ jsx(InlineIconButton, {
80
35
  color: "secondary",
81
- label: t6,
36
+ label: t(($) => $.ui.textEditor.link.label),
82
37
  icon: LinkIcon,
83
- className: t7,
84
- isDisabled: t8
85
- });
86
- $[14] = t6;
87
- $[15] = t7;
88
- $[16] = t8;
89
- $[17] = t9;
90
- } else t9 = $[17];
91
- let t10;
92
- if ($[18] !== t) {
93
- t10 = t(_temp4);
94
- $[18] = t;
95
- $[19] = t10;
96
- } else t10 = $[19];
97
- let t11;
98
- if ($[20] !== t) {
99
- t11 = t(_temp5);
100
- $[20] = t;
101
- $[21] = t11;
102
- } else t11 = $[21];
103
- let t12;
104
- if ($[22] !== t10 || $[23] !== t11 || $[24] !== url) {
105
- t12 = /* @__PURE__ */ jsx(TextInput, {
38
+ className: clsx(editor.isActive("link") && "!text-interactive-text-primary-idle"),
39
+ isDisabled: !editor.isEditable
40
+ }),
41
+ children: [/* @__PURE__ */ jsx(TextInput, {
106
42
  variant: "outlined",
107
43
  hideLabel: true,
108
- label: t10,
109
- placeholder: t11,
44
+ label: t(($) => $.ui.textEditor.link.urlLabel),
45
+ placeholder: t(($) => $.ui.textEditor.link.urlPlaceholder),
110
46
  value: url,
111
47
  onChange: setUrl,
112
48
  className: "mb-4"
113
- });
114
- $[22] = t10;
115
- $[23] = t11;
116
- $[24] = url;
117
- $[25] = t12;
118
- } else t12 = $[25];
119
- const t13 = !url;
120
- let t14;
121
- if ($[26] !== t) {
122
- t14 = t(_temp6);
123
- $[26] = t;
124
- $[27] = t14;
125
- } else t14 = $[27];
126
- let t15;
127
- if ($[28] !== onApply || $[29] !== t13 || $[30] !== t14) {
128
- t15 = /* @__PURE__ */ jsx(Button, {
129
- variant: "contained",
130
- color: "secondary",
131
- size: "xs",
132
- width: "hug",
133
- onPress: onApply,
134
- isDisabled: t13,
135
- children: t14
136
- });
137
- $[28] = onApply;
138
- $[29] = t13;
139
- $[30] = t14;
140
- $[31] = t15;
141
- } else t15 = $[31];
142
- let t16;
143
- if ($[32] !== editor) {
144
- t16 = editor.isActive("link");
145
- $[32] = editor;
146
- $[33] = t16;
147
- } else t16 = $[33];
148
- const t17 = !t16;
149
- let t18;
150
- if ($[34] !== t) {
151
- t18 = t(_temp7);
152
- $[34] = t;
153
- $[35] = t18;
154
- } else t18 = $[35];
155
- let t19;
156
- if ($[36] !== onRemove || $[37] !== t17 || $[38] !== t18) {
157
- t19 = /* @__PURE__ */ jsx(Button, {
158
- variant: "outlined",
159
- color: "secondary",
160
- size: "xs",
161
- width: "hug",
162
- onPress: onRemove,
163
- isDisabled: t17,
164
- children: t18
165
- });
166
- $[36] = onRemove;
167
- $[37] = t17;
168
- $[38] = t18;
169
- $[39] = t19;
170
- } else t19 = $[39];
171
- let t20;
172
- if ($[40] !== t15 || $[41] !== t19) {
173
- t20 = /* @__PURE__ */ jsxs("div", {
49
+ }), /* @__PURE__ */ jsxs("div", {
174
50
  className: "flex justify-between",
175
- children: [t15, t19]
176
- });
177
- $[40] = t15;
178
- $[41] = t19;
179
- $[42] = t20;
180
- } else t20 = $[42];
181
- let t21;
182
- if ($[43] !== isOpen || $[44] !== t12 || $[45] !== t20 || $[46] !== t5 || $[47] !== t9) {
183
- t21 = /* @__PURE__ */ jsxs(ResponsivePopover, {
184
- isOpen,
185
- onOpenChange: setIsOpen,
186
- sheetLabel: t5,
187
- trigger: t9,
188
- children: [t12, t20]
189
- });
190
- $[43] = isOpen;
191
- $[44] = t12;
192
- $[45] = t20;
193
- $[46] = t5;
194
- $[47] = t9;
195
- $[48] = t21;
196
- } else t21 = $[48];
197
- return t21;
51
+ children: [/* @__PURE__ */ jsx(Button, {
52
+ variant: "contained",
53
+ color: "secondary",
54
+ size: "xs",
55
+ width: "hug",
56
+ onPress: onApply,
57
+ isDisabled: !url,
58
+ children: t(($) => $.ui.textEditor.link.apply)
59
+ }), /* @__PURE__ */ jsx(Button, {
60
+ variant: "outlined",
61
+ color: "secondary",
62
+ size: "xs",
63
+ width: "hug",
64
+ onPress: onRemove,
65
+ isDisabled: !editor.isActive("link"),
66
+ children: t(($) => $.ui.textEditor.link.remove)
67
+ })]
68
+ })]
69
+ });
198
70
  };
199
- function _temp(extension) {
200
- return extension.name === "link";
201
- }
202
- function _temp2($) {
203
- return $.ui.textEditor.link.label;
204
- }
205
- function _temp3($_0) {
206
- return $_0.ui.textEditor.link.label;
207
- }
208
- function _temp4($_1) {
209
- return $_1.ui.textEditor.link.urlLabel;
210
- }
211
- function _temp5($_2) {
212
- return $_2.ui.textEditor.link.urlPlaceholder;
213
- }
214
- function _temp6($_3) {
215
- return $_3.ui.textEditor.link.apply;
216
- }
217
- function _temp7($_4) {
218
- return $_4.ui.textEditor.link.remove;
219
- }
220
71
  //#endregion
221
72
  export { HyperlinkAction };
@@ -4,103 +4,43 @@ import { AlignLeftRightIcon } from "../../../../assets/icons/AlignLeftRight.js";
4
4
  import { AlignRightIcon } from "../../../../assets/icons/AlignRight.js";
5
5
  import "../../../../config/i18n.js";
6
6
  import { Select } from "../../Selection/Select/Select.js";
7
- import { c } from "react/compiler-runtime";
8
7
  import { jsx } from "react/jsx-runtime";
9
8
  import { useTranslation } from "react-i18next";
10
9
  //#region src/components/inputs/TextEditor/Toolbar/TextAlignSelect.tsx
11
- var TextAlignSelect = (t0) => {
12
- const $0 = c(18);
13
- const { editor } = t0;
10
+ var TextAlignSelect = ({ editor }) => {
14
11
  const { t } = useTranslation("ui");
15
- if (!!!editor.extensionManager.extensions.find(_temp)) return null;
16
- let t1;
17
- if ($0[0] !== editor) {
18
- t1 = (val) => {
19
- if (val) editor.chain().focus().setTextAlign(val).run();
20
- else editor.chain().focus().unsetTextAlign().run();
21
- };
22
- $0[0] = editor;
23
- $0[1] = t1;
24
- } else t1 = $0[1];
25
- const onChange = t1;
26
- let t2;
27
- if ($0[2] !== editor || $0[3] !== t) {
28
- t2 = (id, Icon) => ({
12
+ if (!!!editor.extensionManager.extensions.find((extension) => extension.name === "textAlign")) return null;
13
+ const onChange = (val) => {
14
+ if (val) editor.chain().focus().setTextAlign(val).run();
15
+ else editor.chain().focus().unsetTextAlign().run();
16
+ };
17
+ const getItem = (id, Icon) => {
18
+ return {
29
19
  id,
30
20
  label: t(($) => $.ui.textEditor.textAlign[id]),
31
21
  content: /* @__PURE__ */ jsx(Icon, { className: "size-6" }),
32
22
  isActive: editor.isActive({ textAlign: id }),
33
23
  can: editor.can().setTextAlign(id)
34
- });
35
- $0[2] = editor;
36
- $0[3] = t;
37
- $0[4] = t2;
38
- } else t2 = $0[4];
39
- const getItem = t2;
40
- let t3;
41
- if ($0[5] !== getItem) {
42
- t3 = [
43
- getItem("left", AlignLeftIcon),
44
- getItem("center", AlignCenterIcon),
45
- getItem("right", AlignRightIcon),
46
- getItem("justify", AlignLeftRightIcon)
47
- ].filter(_temp2);
48
- $0[5] = getItem;
49
- $0[6] = t3;
50
- } else t3 = $0[6];
51
- const enabledItems = t3;
52
- let t4;
53
- if ($0[7] !== t) {
54
- t4 = t(_temp3);
55
- $0[7] = t;
56
- $0[8] = t4;
57
- } else t4 = $0[8];
58
- let t5;
59
- if ($0[9] !== t) {
60
- t5 = t(_temp4);
61
- $0[9] = t;
62
- $0[10] = t5;
63
- } else t5 = $0[10];
64
- const t6 = enabledItems.find(_temp5)?.id || "left";
65
- const t7 = !editor.isEditable;
66
- let t8;
67
- if ($0[11] !== enabledItems || $0[12] !== onChange || $0[13] !== t4 || $0[14] !== t5 || $0[15] !== t6 || $0[16] !== t7) {
68
- t8 = /* @__PURE__ */ jsx(Select, {
69
- as: "inline",
70
- label: t4,
71
- placeholder: t5,
72
- hideLabel: true,
73
- ignoreTriggerWidth: true,
74
- showSelectionContent: true,
75
- onChange,
76
- items: enabledItems,
77
- value: t6,
78
- isDisabled: t7
79
- });
80
- $0[11] = enabledItems;
81
- $0[12] = onChange;
82
- $0[13] = t4;
83
- $0[14] = t5;
84
- $0[15] = t6;
85
- $0[16] = t7;
86
- $0[17] = t8;
87
- } else t8 = $0[17];
88
- return t8;
24
+ };
25
+ };
26
+ const enabledItems = [
27
+ getItem("left", AlignLeftIcon),
28
+ getItem("center", AlignCenterIcon),
29
+ getItem("right", AlignRightIcon),
30
+ getItem("justify", AlignLeftRightIcon)
31
+ ].filter((item) => item.can);
32
+ return /* @__PURE__ */ jsx(Select, {
33
+ as: "inline",
34
+ label: t(($) => $.ui.textEditor.textAlign.label),
35
+ placeholder: t(($) => $.ui.textEditor.textAlign.label),
36
+ hideLabel: true,
37
+ ignoreTriggerWidth: true,
38
+ showSelectionContent: true,
39
+ onChange,
40
+ items: enabledItems,
41
+ value: enabledItems.find((item) => item.isActive)?.id || "left",
42
+ isDisabled: !editor.isEditable
43
+ });
89
44
  };
90
- function _temp(extension) {
91
- return extension.name === "textAlign";
92
- }
93
- function _temp2(item) {
94
- return item.can;
95
- }
96
- function _temp3($_0) {
97
- return $_0.ui.textEditor.textAlign.label;
98
- }
99
- function _temp4($_1) {
100
- return $_1.ui.textEditor.textAlign.label;
101
- }
102
- function _temp5(item_0) {
103
- return item_0.isActive;
104
- }
105
45
  //#endregion
106
46
  export { TextAlignSelect };
@@ -1,58 +1,24 @@
1
1
  import { TextColorIcon } from "../../../../assets/icons/TextColor.js";
2
2
  import { ColorPickerDropdown } from "./ColorPickerDropdown.js";
3
3
  import { defaultColors } from "../textEditor.types.js";
4
- import { c } from "react/compiler-runtime";
5
4
  import { jsx } from "react/jsx-runtime";
6
5
  //#region src/components/inputs/TextEditor/Toolbar/TextColorSelect.tsx
7
- var TextColorSelect = (t0) => {
8
- const $ = c(11);
9
- const { editor } = t0;
10
- if (!editor.extensionManager.extensions.some(_temp)) return null;
11
- let t1;
12
- if ($[0] !== editor) {
13
- t1 = (color) => {
14
- editor.chain().focus().setColor(color).run();
15
- };
16
- $[0] = editor;
17
- $[1] = t1;
18
- } else t1 = $[1];
19
- const onChange = t1;
20
- let t2;
21
- if ($[2] !== editor) {
22
- t2 = editor.getAttributes("textStyle").color || "#000000";
23
- $[2] = editor;
24
- $[3] = t2;
25
- } else t2 = $[3];
26
- const textColor = t2;
27
- const t3 = !editor.isEditable;
28
- let t4;
29
- if ($[4] !== textColor) {
30
- t4 = /* @__PURE__ */ jsx(TextColorIcon, {
6
+ var TextColorSelect = ({ editor }) => {
7
+ if (!editor.extensionManager.extensions.some((extension) => extension.name === "color")) return null;
8
+ const onChange = (color) => {
9
+ editor.chain().focus().setColor(color).run();
10
+ };
11
+ const textColor = editor.getAttributes("textStyle").color || "#000000";
12
+ return /* @__PURE__ */ jsx(ColorPickerDropdown, {
13
+ value: textColor,
14
+ onChange,
15
+ colors: defaultColors,
16
+ isDisabled: !editor.isEditable,
17
+ children: /* @__PURE__ */ jsx(TextColorIcon, {
31
18
  className: "size-6",
32
19
  textColor
33
- });
34
- $[4] = textColor;
35
- $[5] = t4;
36
- } else t4 = $[5];
37
- let t5;
38
- if ($[6] !== onChange || $[7] !== t3 || $[8] !== t4 || $[9] !== textColor) {
39
- t5 = /* @__PURE__ */ jsx(ColorPickerDropdown, {
40
- value: textColor,
41
- onChange,
42
- colors: defaultColors,
43
- isDisabled: t3,
44
- children: t4
45
- });
46
- $[6] = onChange;
47
- $[7] = t3;
48
- $[8] = t4;
49
- $[9] = textColor;
50
- $[10] = t5;
51
- } else t5 = $[10];
52
- return t5;
20
+ })
21
+ });
53
22
  };
54
- function _temp(extension) {
55
- return extension.name === "color";
56
- }
57
23
  //#endregion
58
24
  export { TextColorSelect };