@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
@@ -1,526 +0,0 @@
1
- import { UIStyle } from "../../../config/uiStyle.context.js";
2
- import { typography } from "../../text/Typography/typography.cva.js";
3
- import { Loader } from "../../status/Loader/Loader.js";
4
- import { UIConfig } from "../../../config/uiConfig.context.js";
5
- import { InlineIconButton } from "../../buttons/InlineIconButton/InlineIconButton.js";
6
- import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
7
- import { InputClear } from "../shared/InputClear.js";
8
- import { inputBase, inputContentWrapper, inputSize } from "../shared/input.cva.js";
9
- import { FormField } from "../FormField/FormField.js";
10
- import { TooltipWrapper } from "../shared/TooltipWrapper.js";
11
- import { c } from "react/compiler-runtime";
12
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
- import { clsx } from "clsx";
14
- import { isValidElement, useId } from "react";
15
- //#region src/components/inputs/Skeleton/InputFrame.tsx
16
- var InputFrame = (props) => {
17
- const $ = c(182);
18
- const ui = UIConfig.useConfig();
19
- const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
20
- const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
21
- const inputContentWrapperCva = UIStyle.useCva("input.contentWrapperCva", inputContentWrapper);
22
- const typographyCva = UIStyle.useCva("typography.cva", typography);
23
- const generatedInputId = useId();
24
- const { ref, children, formFieldRef, labelProps: labelPropsProp, headerProps, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isHeaderHidden, hideLabel: hideLabelProp, headerClassName, errorClassName, className, leadingContent, leadingIcon, actionContent, actionContentPlacement: t0, trailingContent, trailingIcon, trailingAction, unit, isLoading, action, isClearable: isClearableProp, showClear, renderStatic, onStaticInteract, clearClassName, onClear, dataAttributes, typographySize, id: idProp, inputClassName, contentClassName, contentWrapperClassName, contentAndTrailingClassName, wrapContentAndTrailing, wrapTrailingContent: t1, labelPlacement: t2, trailingClassName, onMouseEnter, onFocusCapture, variant: variantProp, as: asProp, size: sizeProp } = props;
25
- const actionContentPlacement = t0 === void 0 ? "content-wrapper" : t0;
26
- const wrapTrailingContent = t1 === void 0 ? true : t1;
27
- const labelPlacement = t2 === void 0 ? "content-wrapper" : t2;
28
- const as = asProp ?? ui.input.as;
29
- const size = sizeProp ?? ui.input.size;
30
- const variant = variantProp ?? ui.input.variant;
31
- const hideLabel = hideLabelProp ?? ui.input.hideLabel;
32
- const hasClear = !!(isClearableProp ?? ui.input.isClearable);
33
- let t3;
34
- if ($[0] !== leadingIcon) {
35
- t3 = leadingIcon && isValidElement(leadingIcon);
36
- $[0] = leadingIcon;
37
- $[1] = t3;
38
- } else t3 = $[1];
39
- const isLeadingIconElement = t3;
40
- let t4;
41
- if ($[2] !== trailingIcon) {
42
- t4 = trailingIcon && isValidElement(trailingIcon);
43
- $[2] = trailingIcon;
44
- $[3] = t4;
45
- } else t4 = $[3];
46
- const isTrailingIconElement = t4;
47
- const hasTrailingContent = hasClear || !!trailingContent || !!unit || !!isLoading || !!action || !!trailingIcon || !!trailingAction;
48
- const isTrailingInteractive = !!action || !!trailingAction || !!isTrailingIconElement || hasClear && !!showClear || !!trailingContent;
49
- let dataAttributeProps;
50
- let formFieldProps;
51
- let labelProps;
52
- let t10;
53
- let t11;
54
- let t12;
55
- let t13;
56
- let t5;
57
- let t6;
58
- let t7;
59
- let t8;
60
- let t9;
61
- if ($[4] !== actionContent || $[5] !== actionContentPlacement || $[6] !== as || $[7] !== children || $[8] !== className || $[9] !== contentClassName || $[10] !== contentWrapperClassName || $[11] !== dataAttributes || $[12] !== error || $[13] !== errorClassName || $[14] !== generatedInputId || $[15] !== headerClassName || $[16] !== headerProps || $[17] !== helperText || $[18] !== hideLabel || $[19] !== idProp || $[20] !== inputContentWrapperCva || $[21] !== inputSizeCva || $[22] !== isDisabled || $[23] !== isHeaderHidden || $[24] !== isLeadingIconElement || $[25] !== isRequired || $[26] !== label || $[27] !== labelPlacement || $[28] !== labelPropsProp || $[29] !== leadingContent || $[30] !== leadingIcon || $[31] !== rightContent || $[32] !== size || $[33] !== tooltipText || $[34] !== typographyCva || $[35] !== typographySize) {
62
- dataAttributeProps = getInputFrameDataAttributeProps(dataAttributes);
63
- const baseLabelProps = headerProps?.labelProps ?? labelPropsProp;
64
- const inputId = idProp ?? baseLabelProps?.htmlFor ?? `input-frame_${generatedInputId}`;
65
- let t14;
66
- if ($[48] !== baseLabelProps || $[49] !== inputId) {
67
- t14 = {
68
- ...baseLabelProps,
69
- htmlFor: inputId
70
- };
71
- $[48] = baseLabelProps;
72
- $[49] = inputId;
73
- $[50] = t14;
74
- } else t14 = $[50];
75
- labelProps = t14;
76
- const t15 = label ?? "";
77
- const t16 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
78
- let t17;
79
- if ($[51] !== className || $[52] !== error || $[53] !== errorClassName || $[54] !== headerClassName || $[55] !== helperText || $[56] !== hideLabel || $[57] !== isDisabled || $[58] !== isRequired || $[59] !== rightContent || $[60] !== t15 || $[61] !== t16 || $[62] !== tooltipText) {
80
- t17 = {
81
- error,
82
- label: t15,
83
- tooltipText,
84
- helperText,
85
- isRequired,
86
- rightContent,
87
- isHeaderHidden: t16,
88
- hideLabel,
89
- isDisabled,
90
- headerClassName,
91
- errorClassName,
92
- className
93
- };
94
- $[51] = className;
95
- $[52] = error;
96
- $[53] = errorClassName;
97
- $[54] = headerClassName;
98
- $[55] = helperText;
99
- $[56] = hideLabel;
100
- $[57] = isDisabled;
101
- $[58] = isRequired;
102
- $[59] = rightContent;
103
- $[60] = t15;
104
- $[61] = t16;
105
- $[62] = tooltipText;
106
- $[63] = t17;
107
- } else t17 = $[63];
108
- formFieldProps = t17;
109
- let t18;
110
- if ($[64] !== headerClassName || $[65] !== headerProps || $[66] !== helperText || $[67] !== hideLabel || $[68] !== isDisabled || $[69] !== isHeaderHidden || $[70] !== isRequired || $[71] !== label || $[72] !== labelProps || $[73] !== rightContent || $[74] !== tooltipText) {
111
- t18 = headerProps ? {
112
- ...headerProps,
113
- labelProps
114
- } : {
115
- label: label ?? "",
116
- tooltipText,
117
- helperText,
118
- isRequired,
119
- rightContent,
120
- isHeaderHidden: hideLabel || isHeaderHidden,
121
- isDisabled,
122
- className: headerClassName,
123
- labelProps
124
- };
125
- $[64] = headerClassName;
126
- $[65] = headerProps;
127
- $[66] = helperText;
128
- $[67] = hideLabel;
129
- $[68] = isDisabled;
130
- $[69] = isHeaderHidden;
131
- $[70] = isRequired;
132
- $[71] = label;
133
- $[72] = labelProps;
134
- $[73] = rightContent;
135
- $[74] = tooltipText;
136
- $[75] = t18;
137
- } else t18 = $[75];
138
- const resolvedHeaderProps = t18;
139
- let t19;
140
- if ($[76] !== as) {
141
- t19 = as && ["filter", "floating"].includes(as);
142
- $[76] = as;
143
- $[77] = t19;
144
- } else t19 = $[77];
145
- const shouldRenderLabel = t19;
146
- let t20;
147
- if ($[78] !== as || $[79] !== resolvedHeaderProps || $[80] !== shouldRenderLabel || $[81] !== size) {
148
- t20 = shouldRenderLabel ? /* @__PURE__ */ jsx(FormFieldLabel, {
149
- as,
150
- size,
151
- ...resolvedHeaderProps
152
- }) : null;
153
- $[78] = as;
154
- $[79] = resolvedHeaderProps;
155
- $[80] = shouldRenderLabel;
156
- $[81] = size;
157
- $[82] = t20;
158
- } else t20 = $[82];
159
- const labelContent = t20;
160
- let t21;
161
- if ($[83] !== as || $[84] !== contentWrapperClassName || $[85] !== inputContentWrapperCva) {
162
- t21 = contentWrapperClassName ?? inputContentWrapperCva({ as });
163
- $[83] = as;
164
- $[84] = contentWrapperClassName;
165
- $[85] = inputContentWrapperCva;
166
- $[86] = t21;
167
- } else t21 = $[86];
168
- const resolvedContentWrapperClassName = t21;
169
- if ($[87] !== as || $[88] !== contentClassName || $[89] !== inputSizeCva || $[90] !== size || $[91] !== typographyCva || $[92] !== typographySize) {
170
- let t22;
171
- if ($[94] !== typographyCva || $[95] !== typographySize) {
172
- t22 = typographySize && typographyCva({ size: typographySize });
173
- $[94] = typographyCva;
174
- $[95] = typographySize;
175
- $[96] = t22;
176
- } else t22 = $[96];
177
- t9 = clsx("group/input-frame flex min-w-0 w-full items-center gap-input-gap-input-text-to-elements", inputSizeCva({
178
- size,
179
- as
180
- }), t22, contentClassName);
181
- $[87] = as;
182
- $[88] = contentClassName;
183
- $[89] = inputSizeCva;
184
- $[90] = size;
185
- $[91] = typographyCva;
186
- $[92] = typographySize;
187
- $[93] = t9;
188
- } else t9 = $[93];
189
- t10 = leadingContent;
190
- if ($[97] !== isLeadingIconElement || $[98] !== leadingIcon) {
191
- t11 = leadingIcon && /* @__PURE__ */ jsx("div", {
192
- className: clsx(!isLeadingIconElement && "pointer-events-none"),
193
- children: renderIconVisual(leadingIcon)
194
- });
195
- $[97] = isLeadingIconElement;
196
- $[98] = leadingIcon;
197
- $[99] = t11;
198
- } else t11 = $[99];
199
- t12 = labelPlacement === "content-row" && labelContent;
200
- t13 = actionContentPlacement === "content-row" && actionContent;
201
- t5 = resolvedContentWrapperClassName;
202
- t6 = labelPlacement === "content-wrapper" && labelContent;
203
- t7 = actionContentPlacement === "content-wrapper" && actionContent;
204
- t8 = typeof children === "function" ? children({
205
- ...dataAttributeProps,
206
- id: inputId
207
- }) : children;
208
- $[4] = actionContent;
209
- $[5] = actionContentPlacement;
210
- $[6] = as;
211
- $[7] = children;
212
- $[8] = className;
213
- $[9] = contentClassName;
214
- $[10] = contentWrapperClassName;
215
- $[11] = dataAttributes;
216
- $[12] = error;
217
- $[13] = errorClassName;
218
- $[14] = generatedInputId;
219
- $[15] = headerClassName;
220
- $[16] = headerProps;
221
- $[17] = helperText;
222
- $[18] = hideLabel;
223
- $[19] = idProp;
224
- $[20] = inputContentWrapperCva;
225
- $[21] = inputSizeCva;
226
- $[22] = isDisabled;
227
- $[23] = isHeaderHidden;
228
- $[24] = isLeadingIconElement;
229
- $[25] = isRequired;
230
- $[26] = label;
231
- $[27] = labelPlacement;
232
- $[28] = labelPropsProp;
233
- $[29] = leadingContent;
234
- $[30] = leadingIcon;
235
- $[31] = rightContent;
236
- $[32] = size;
237
- $[33] = tooltipText;
238
- $[34] = typographyCva;
239
- $[35] = typographySize;
240
- $[36] = dataAttributeProps;
241
- $[37] = formFieldProps;
242
- $[38] = labelProps;
243
- $[39] = t10;
244
- $[40] = t11;
245
- $[41] = t12;
246
- $[42] = t13;
247
- $[43] = t5;
248
- $[44] = t6;
249
- $[45] = t7;
250
- $[46] = t8;
251
- $[47] = t9;
252
- } else {
253
- dataAttributeProps = $[36];
254
- formFieldProps = $[37];
255
- labelProps = $[38];
256
- t10 = $[39];
257
- t11 = $[40];
258
- t12 = $[41];
259
- t13 = $[42];
260
- t5 = $[43];
261
- t6 = $[44];
262
- t7 = $[45];
263
- t8 = $[46];
264
- t9 = $[47];
265
- }
266
- let t14;
267
- if ($[100] !== t5 || $[101] !== t6 || $[102] !== t7 || $[103] !== t8) {
268
- t14 = /* @__PURE__ */ jsxs("div", {
269
- className: t5,
270
- children: [
271
- t6,
272
- t7,
273
- t8
274
- ]
275
- });
276
- $[100] = t5;
277
- $[101] = t6;
278
- $[102] = t7;
279
- $[103] = t8;
280
- $[104] = t14;
281
- } else t14 = $[104];
282
- let t15;
283
- if ($[105] !== t10 || $[106] !== t11 || $[107] !== t12 || $[108] !== t13 || $[109] !== t14 || $[110] !== t9) {
284
- t15 = /* @__PURE__ */ jsxs("div", {
285
- className: t9,
286
- children: [
287
- t10,
288
- t11,
289
- t12,
290
- t13,
291
- t14
292
- ]
293
- });
294
- $[105] = t10;
295
- $[106] = t11;
296
- $[107] = t12;
297
- $[108] = t13;
298
- $[109] = t14;
299
- $[110] = t9;
300
- $[111] = t15;
301
- } else t15 = $[111];
302
- const contentRow = t15;
303
- let t16;
304
- if ($[112] !== action || $[113] !== clearClassName || $[114] !== hasClear || $[115] !== hasTrailingContent || $[116] !== isDisabled || $[117] !== isLoading || $[118] !== onClear || $[119] !== renderStatic || $[120] !== showClear || $[121] !== trailingAction || $[122] !== trailingContent || $[123] !== trailingIcon || $[124] !== typographyCva || $[125] !== unit) {
305
- t16 = hasTrailingContent ? /* @__PURE__ */ jsxs(Fragment, { children: [
306
- hasClear && /* @__PURE__ */ jsx(InputClear, {
307
- onClear: () => onClear?.(),
308
- className: clearClassName,
309
- show: !!showClear,
310
- renderStatic
311
- }),
312
- trailingContent,
313
- unit && /* @__PURE__ */ jsx("span", {
314
- className: typographyCva({
315
- size: "label-2",
316
- sizeMobile: "label-2",
317
- variant: "prominent-1",
318
- className: "text-text-default-3"
319
- }),
320
- children: unit
321
- }),
322
- isLoading && /* @__PURE__ */ jsx("div", {
323
- className: "inline-flex",
324
- children: /* @__PURE__ */ jsx(Loader, {})
325
- }),
326
- !isLoading && action && /* @__PURE__ */ jsx(InlineIconButton, {
327
- color: "secondary",
328
- icon: action.icon,
329
- isDisabled,
330
- onPress: action.onClick,
331
- excludeFromTabOrder: true,
332
- label: action.altText,
333
- className: clsx("border-0!", action.className)
334
- }),
335
- !isLoading && !action && trailingIcon && renderIconVisual(trailingIcon),
336
- trailingAction
337
- ] }) : null;
338
- $[112] = action;
339
- $[113] = clearClassName;
340
- $[114] = hasClear;
341
- $[115] = hasTrailingContent;
342
- $[116] = isDisabled;
343
- $[117] = isLoading;
344
- $[118] = onClear;
345
- $[119] = renderStatic;
346
- $[120] = showClear;
347
- $[121] = trailingAction;
348
- $[122] = trailingContent;
349
- $[123] = trailingIcon;
350
- $[124] = typographyCva;
351
- $[125] = unit;
352
- $[126] = t16;
353
- } else t16 = $[126];
354
- const trailingContentNodes = t16;
355
- let t17;
356
- if ($[127] !== as || $[128] !== inputSizeCva || $[129] !== isTrailingInteractive || $[130] !== size || $[131] !== trailingClassName || $[132] !== trailingContentNodes || $[133] !== wrapTrailingContent) {
357
- t17 = wrapTrailingContent && trailingContentNodes ? /* @__PURE__ */ jsx("div", {
358
- className: clsx("flex items-center gap-input-gap-trailing-elements", inputSizeCva({
359
- size,
360
- as
361
- }), !isTrailingInteractive && "pointer-events-none", trailingClassName),
362
- children: trailingContentNodes
363
- }) : trailingContentNodes;
364
- $[127] = as;
365
- $[128] = inputSizeCva;
366
- $[129] = isTrailingInteractive;
367
- $[130] = size;
368
- $[131] = trailingClassName;
369
- $[132] = trailingContentNodes;
370
- $[133] = wrapTrailingContent;
371
- $[134] = t17;
372
- } else t17 = $[134];
373
- const trailingRow = t17;
374
- let t18;
375
- if ($[135] !== contentAndTrailingClassName || $[136] !== contentRow || $[137] !== trailingRow || $[138] !== wrapContentAndTrailing) {
376
- t18 = wrapContentAndTrailing ? /* @__PURE__ */ jsxs("div", {
377
- className: clsx("flex w-full items-center gap-input-gap-input-text-to-elements", contentAndTrailingClassName),
378
- children: [contentRow, trailingRow]
379
- }) : /* @__PURE__ */ jsxs(Fragment, { children: [contentRow, trailingRow] });
380
- $[135] = contentAndTrailingClassName;
381
- $[136] = contentRow;
382
- $[137] = trailingRow;
383
- $[138] = wrapContentAndTrailing;
384
- $[139] = t18;
385
- } else t18 = $[139];
386
- const inputFrameContent = t18;
387
- const t19 = as === "inline" ? -1 : void 0;
388
- const t20 = as === "inline" ? -1 : void 0;
389
- let t21;
390
- if ($[140] !== onMouseEnter || $[141] !== onStaticInteract || $[142] !== renderStatic) {
391
- t21 = (event) => {
392
- onMouseEnter?.(event);
393
- if (renderStatic) onStaticInteract?.(false);
394
- };
395
- $[140] = onMouseEnter;
396
- $[141] = onStaticInteract;
397
- $[142] = renderStatic;
398
- $[143] = t21;
399
- } else t21 = $[143];
400
- let t22;
401
- if ($[144] !== onFocusCapture || $[145] !== onStaticInteract || $[146] !== renderStatic) {
402
- t22 = (event_0) => {
403
- onFocusCapture?.(event_0);
404
- if (renderStatic) onStaticInteract?.(true);
405
- };
406
- $[144] = onFocusCapture;
407
- $[145] = onStaticInteract;
408
- $[146] = renderStatic;
409
- $[147] = t22;
410
- } else t22 = $[147];
411
- let t23;
412
- if ($[148] !== as || $[149] !== inputBaseCva || $[150] !== inputClassName || $[151] !== variant) {
413
- t23 = clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
414
- variant,
415
- as
416
- }), inputClassName);
417
- $[148] = as;
418
- $[149] = inputBaseCva;
419
- $[150] = inputClassName;
420
- $[151] = variant;
421
- $[152] = t23;
422
- } else t23 = $[152];
423
- const t24 = renderStatic ? isDisabled ? -1 : 0 : void 0;
424
- let t25;
425
- let t26;
426
- let t27;
427
- if ($[153] !== onStaticInteract || $[154] !== renderStatic) {
428
- t25 = () => {
429
- if (renderStatic) onStaticInteract?.(true);
430
- };
431
- t26 = () => {
432
- if (renderStatic) onStaticInteract?.(true);
433
- };
434
- t27 = () => {
435
- if (renderStatic) onStaticInteract?.(true);
436
- };
437
- $[153] = onStaticInteract;
438
- $[154] = renderStatic;
439
- $[155] = t25;
440
- $[156] = t26;
441
- $[157] = t27;
442
- } else {
443
- t25 = $[155];
444
- t26 = $[156];
445
- t27 = $[157];
446
- }
447
- let t28;
448
- if ($[158] !== dataAttributeProps || $[159] !== inputFrameContent || $[160] !== ref || $[161] !== t23 || $[162] !== t24 || $[163] !== t25 || $[164] !== t26 || $[165] !== t27) {
449
- t28 = /* @__PURE__ */ jsx("div", {
450
- ref,
451
- ...dataAttributeProps,
452
- className: t23,
453
- tabIndex: t24,
454
- onFocus: t25,
455
- onClick: t26,
456
- onPointerDown: t27,
457
- "data-rac": "",
458
- children: inputFrameContent
459
- });
460
- $[158] = dataAttributeProps;
461
- $[159] = inputFrameContent;
462
- $[160] = ref;
463
- $[161] = t23;
464
- $[162] = t24;
465
- $[163] = t25;
466
- $[164] = t26;
467
- $[165] = t27;
468
- $[166] = t28;
469
- } else t28 = $[166];
470
- let t29;
471
- if ($[167] !== as || $[168] !== dataAttributeProps || $[169] !== formFieldProps || $[170] !== formFieldRef || $[171] !== labelProps || $[172] !== t20 || $[173] !== t21 || $[174] !== t22 || $[175] !== t28) {
472
- t29 = /* @__PURE__ */ jsx(FormField, {
473
- ...formFieldProps,
474
- ...dataAttributeProps,
475
- ref: formFieldRef,
476
- as,
477
- labelProps,
478
- tabIndex: t20,
479
- onMouseEnter: t21,
480
- onFocusCapture: t22,
481
- children: t28
482
- });
483
- $[167] = as;
484
- $[168] = dataAttributeProps;
485
- $[169] = formFieldProps;
486
- $[170] = formFieldRef;
487
- $[171] = labelProps;
488
- $[172] = t20;
489
- $[173] = t21;
490
- $[174] = t22;
491
- $[175] = t28;
492
- $[176] = t29;
493
- } else t29 = $[176];
494
- let t30;
495
- if ($[177] !== as || $[178] !== error || $[179] !== t19 || $[180] !== t29) {
496
- t30 = /* @__PURE__ */ jsx(TooltipWrapper, {
497
- as,
498
- error,
499
- triggerTabIndex: t19,
500
- children: t29
501
- });
502
- $[177] = as;
503
- $[178] = error;
504
- $[179] = t19;
505
- $[180] = t29;
506
- $[181] = t30;
507
- } else t30 = $[181];
508
- return t30;
509
- };
510
- var renderIconVisual = (icon) => {
511
- if (isValidElement(icon)) return icon;
512
- return /* @__PURE__ */ jsx(icon, { className: "size-6 text-interactive-text-secondary-idle" });
513
- };
514
- var getInputFrameDataAttributeProps = (dataAttributes) => ({
515
- "data-is-empty": dataAttributes?.dataIsEmpty || void 0,
516
- "data-is-filled": dataAttributes?.dataIsFilled || void 0,
517
- "data-is-dirty": dataAttributes?.dataIsDirty || void 0,
518
- "data-is-required": dataAttributes?.dataIsRequired || void 0,
519
- "data-is-disabled": dataAttributes?.dataIsDisabled || void 0,
520
- "data-disabled": dataAttributes?.dataDisabled || void 0,
521
- "data-has-search": dataAttributes?.dataHasSearch || void 0,
522
- "data-invalid": dataAttributes?.dataInvalid || void 0,
523
- "data-has-selection": dataAttributes?.dataHasSelection || void 0
524
- });
525
- //#endregion
526
- export { InputFrame };
@@ -1,38 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { FormFieldProps } from '../FormField/FormField';
3
- import { TextInputProps } from '../Input/TextInput/TextInput';
4
- import { InputSizeProps, InputVariantProps } from './input.cva';
5
- import { TypographyVariantProps } from '../../text/Typography/typography.cva';
6
- type StaticInputDataAttributes = {
7
- dataDisabled?: boolean;
8
- dataHasSearch?: boolean;
9
- dataHasSelection?: boolean;
10
- dataInvalid?: boolean;
11
- dataIsDirty?: boolean;
12
- dataIsDisabled?: boolean;
13
- dataIsEmpty?: boolean;
14
- dataIsFilled?: boolean;
15
- dataIsRequired?: boolean;
16
- };
17
- interface StaticInputProps extends FormFieldProps {
18
- onInteract: (shouldFocus: boolean) => void;
19
- as?: TextInputProps["as"];
20
- typographySize?: TypographyVariantProps["size"];
21
- size?: InputSizeProps["size"];
22
- variant?: InputVariantProps["variant"];
23
- applyMinInputWidth?: boolean;
24
- placeholder?: ReactNode;
25
- showPlacholderIfFilled?: boolean;
26
- displayValue?: ReactNode;
27
- isEmpty?: boolean;
28
- leadingVisual?: ReactNode;
29
- leadingContent?: ReactNode;
30
- leadingContentClassName?: string;
31
- hasClearIcon?: boolean;
32
- trailingContent?: ReactNode;
33
- contentRowClassName?: string;
34
- inputClassName?: string;
35
- dataAttributes?: StaticInputDataAttributes;
36
- }
37
- export declare const StaticInput: ({ onInteract, as, typographySize, size, variant, applyMinInputWidth, placeholder, showPlacholderIfFilled, displayValue, isEmpty, leadingVisual, leadingContent, leadingContentClassName, hasClearIcon, trailingContent, contentRowClassName, inputClassName, dataAttributes, className, ...formFieldProps }: StaticInputProps) => import("react/jsx-runtime").JSX.Element;
38
- export {};
@@ -1,4 +0,0 @@
1
- import { VariantProps } from 'class-variance-authority';
2
- export declare const tooltipWrapperTrigger: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
3
- export interface TooltipWrapperTriggerVariantProps extends VariantProps<typeof tooltipWrapperTrigger> {
4
- }
@@ -1,5 +0,0 @@
1
- import { cva } from "class-variance-authority";
2
- //#region src/components/inputs/shared/tooltipWrapper.cva.ts
3
- var tooltipWrapperTrigger = cva("inline-flex");
4
- //#endregion
5
- export { tooltipWrapperTrigger };
@@ -1,14 +0,0 @@
1
- import { Dispatch, RefObject, SetStateAction } from 'react';
2
- interface StaticInputHandoffOptions<TElement extends HTMLElement> {
3
- inputRef: RefObject<TElement | null>;
4
- renderInput: boolean;
5
- setRenderInput: Dispatch<SetStateAction<boolean>>;
6
- getFocusTarget?: (element: TElement) => HTMLElement | null | undefined;
7
- }
8
- export declare const useStaticInputHandoff: <TElement extends HTMLElement = HTMLInputElement>({ inputRef, renderInput, setRenderInput, getFocusTarget, }: StaticInputHandoffOptions<TElement>) => {
9
- shouldFocus: boolean;
10
- renderRealInput: (focus: boolean) => void;
11
- replayStaticInputChange: (value: string) => void;
12
- replayStaticInputPress: () => void;
13
- };
14
- export {};
@@ -1,100 +0,0 @@
1
- import { c } from "react/compiler-runtime";
2
- import { useLayoutEffect, useRef, useState } from "react";
3
- //#region src/components/inputs/shared/useStaticInputHandoff.ts
4
- var useStaticInputHandoff = (t0) => {
5
- const $ = c(15);
6
- const { inputRef, renderInput, setRenderInput, getFocusTarget } = t0;
7
- const [shouldFocus, setShouldFocus] = useState(false);
8
- const pendingStaticChangeRef = useRef(null);
9
- const shouldReplayStaticPressRef = useRef(false);
10
- let t1;
11
- let t2;
12
- if ($[0] !== getFocusTarget || $[1] !== inputRef || $[2] !== renderInput || $[3] !== shouldFocus) {
13
- t1 = () => {
14
- if (!renderInput || !shouldFocus) return;
15
- const focusRealInput = (replayPendingInteraction) => {
16
- const input = inputRef.current;
17
- const pendingValue = pendingStaticChangeRef.current;
18
- const focusTarget = input ? getFocusTarget?.(input) ?? input : null;
19
- if (replayPendingInteraction && focusTarget instanceof HTMLInputElement && pendingValue != null) {
20
- (Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set)?.call(focusTarget, pendingValue);
21
- focusTarget.dispatchEvent(new Event("input", { bubbles: true }));
22
- pendingStaticChangeRef.current = null;
23
- }
24
- focusTarget?.focus();
25
- if (replayPendingInteraction && shouldReplayStaticPressRef.current) {
26
- shouldReplayStaticPressRef.current = false;
27
- focusTarget?.click();
28
- }
29
- };
30
- focusRealInput(true);
31
- const frame = requestAnimationFrame(() => {
32
- focusRealInput(false);
33
- setShouldFocus(false);
34
- });
35
- return () => {
36
- cancelAnimationFrame(frame);
37
- };
38
- };
39
- t2 = [
40
- getFocusTarget,
41
- inputRef,
42
- renderInput,
43
- shouldFocus
44
- ];
45
- $[0] = getFocusTarget;
46
- $[1] = inputRef;
47
- $[2] = renderInput;
48
- $[3] = shouldFocus;
49
- $[4] = t1;
50
- $[5] = t2;
51
- } else {
52
- t1 = $[4];
53
- t2 = $[5];
54
- }
55
- useLayoutEffect(t1, t2);
56
- let t3;
57
- let t4;
58
- let t5;
59
- if ($[6] !== setRenderInput) {
60
- t3 = (focus) => {
61
- setShouldFocus(focus);
62
- setRenderInput(true);
63
- };
64
- t4 = (value) => {
65
- pendingStaticChangeRef.current = value;
66
- setShouldFocus(true);
67
- setRenderInput(true);
68
- };
69
- t5 = () => {
70
- shouldReplayStaticPressRef.current = true;
71
- setShouldFocus(true);
72
- setRenderInput(true);
73
- };
74
- $[6] = setRenderInput;
75
- $[7] = t3;
76
- $[8] = t4;
77
- $[9] = t5;
78
- } else {
79
- t3 = $[7];
80
- t4 = $[8];
81
- t5 = $[9];
82
- }
83
- let t6;
84
- if ($[10] !== shouldFocus || $[11] !== t3 || $[12] !== t4 || $[13] !== t5) {
85
- t6 = {
86
- shouldFocus,
87
- renderRealInput: t3,
88
- replayStaticInputChange: t4,
89
- replayStaticInputPress: t5
90
- };
91
- $[10] = shouldFocus;
92
- $[11] = t3;
93
- $[12] = t4;
94
- $[13] = t5;
95
- $[14] = t6;
96
- } else t6 = $[14];
97
- return t6;
98
- };
99
- //#endregion
100
- export { useStaticInputHandoff };