@povio/ui 2.1.14 → 2.1.15
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.
- package/README.md +74 -0
- package/dist/AclGuard.js +12 -0
- package/dist/ActionModal.js +51 -0
- package/dist/Alert.js +46 -0
- package/dist/AlignCenter.js +13 -0
- package/dist/AlignLeft.js +13 -0
- package/dist/AlignLeftRight.js +13 -0
- package/dist/AlignRight.js +13 -0
- package/dist/ArrowDropDown.js +13 -0
- package/dist/ArrowDropUp.js +13 -0
- package/dist/ArrowLeft.js +13 -0
- package/dist/ArrowRight.js +13 -0
- package/dist/AuthGuard.js +22 -0
- package/dist/Autocomplete.js +28 -0
- package/dist/Bold.js +13 -0
- package/dist/BottomSheet.js +191 -0
- package/dist/BulletedList.js +13 -0
- package/dist/Button.js +54 -0
- package/dist/ButtonContent.js +28 -0
- package/dist/Calendar.js +15 -0
- package/dist/Calendar2.js +54 -0
- package/dist/CalendarCell.js +130 -0
- package/dist/CalendarGrid.js +50 -0
- package/dist/CalendarHeader.js +75 -0
- package/dist/CalendarSelectHeader.js +170 -0
- package/dist/Can.js +13 -0
- package/dist/CellText.js +13 -0
- package/dist/Check.js +15 -0
- package/dist/CheckCircle.js +13 -0
- package/dist/CheckContent.js +16 -0
- package/dist/Checkbox.js +61 -0
- package/dist/CheckboxCheckmark.js +16 -0
- package/dist/CheckboxCheckmark2.js +25 -0
- package/dist/CheckboxIndeterminate.js +16 -0
- package/dist/ChevronDown.js +15 -0
- package/dist/ChevronLeft.js +15 -0
- package/dist/ChevronRight.js +15 -0
- package/dist/ChevronUp.js +15 -0
- package/dist/ChevronsLeft.js +15 -0
- package/dist/ChevronsRight.js +15 -0
- package/dist/Clock.js +13 -0
- package/dist/Close.js +13 -0
- package/dist/ColorPicker.js +16 -0
- package/dist/ColorPickerDropdown.js +51 -0
- package/dist/ColumnConfig.js +81 -0
- package/dist/DateField.js +89 -0
- package/dist/DatePicker.js +191 -0
- package/dist/DatePickerInput.js +158 -0
- package/dist/DateRangePicker.js +601 -0
- package/dist/DateSegmentItem.js +29 -0
- package/dist/DateTime.js +18 -0
- package/dist/DateTimeDialog.js +49 -0
- package/dist/DateTimeDialogFooter.js +25 -0
- package/dist/DateTimePicker.js +200 -0
- package/dist/Drag.js +13 -0
- package/dist/Drawer.js +43 -0
- package/dist/File.js +15 -0
- package/dist/FileCard.js +50 -0
- package/dist/FileCardList.js +17 -0
- package/dist/FileUpload.js +189 -0
- package/dist/FileUploadContainer.js +12 -0
- package/dist/FileUploadContent.js +61 -0
- package/dist/FileUploadContentEmpty.js +54 -0
- package/dist/FileUploadContentError.js +109 -0
- package/dist/FileUploadContentFilled.js +112 -0
- package/dist/FileUploadContentLoading.js +76 -0
- package/dist/Form.js +42 -0
- package/dist/FormField.js +35 -0
- package/dist/FormFieldError.js +11 -0
- package/dist/FormFieldHeader.js +36 -0
- package/dist/FormFieldHeaderClose.js +15 -0
- package/dist/FormFieldLabel.js +32 -0
- package/dist/HeaderText.js +10 -0
- package/dist/Highlight.js +13 -0
- package/dist/HighlightOn.js +19 -0
- package/dist/HyperlinkAction.js +70 -0
- package/dist/IconButton.js +12 -0
- package/dist/InfiniteTable.js +31 -0
- package/dist/Info.js +18 -0
- package/dist/InlineIconButton.js +13 -0
- package/dist/InputClear.js +19 -0
- package/dist/InputContent.js +94 -0
- package/dist/InputItem.js +54 -0
- package/dist/InputUpload.js +111 -0
- package/dist/InputUploadContent.js +52 -0
- package/dist/InputUploadFilled.js +26 -0
- package/dist/Inputs.js +15 -0
- package/dist/Italic.js +13 -0
- package/dist/Link.js +13 -0
- package/dist/Link2.js +19 -0
- package/dist/Loader.js +32 -0
- package/dist/Menu.js +13 -0
- package/dist/Menu2.js +9 -0
- package/dist/MenuDesktop.js +53 -0
- package/dist/MenuItem.js +21 -0
- package/dist/MenuMobile.js +64 -0
- package/dist/MenuPopover.js +30 -0
- package/dist/Modal.js +49 -0
- package/dist/MonthPicker.js +56 -0
- package/dist/NumberInput.js +132 -0
- package/dist/NumberedList.js +13 -0
- package/dist/PaginatedTable.js +26 -0
- package/dist/Pagination.js +43 -0
- package/dist/PaginationList.js +105 -0
- package/dist/PasswordInput.js +21 -0
- package/dist/PillButton.js +37 -0
- package/dist/PointerHorizontal.js +13 -0
- package/dist/PointerVertical.js +13 -0
- package/dist/ProgressBar.js +25 -0
- package/dist/QueryAutocomplete.js +18 -0
- package/dist/RadioGroup.js +81 -0
- package/dist/RangeCalendar.js +96 -0
- package/dist/ResponsivePopover.js +41 -0
- package/dist/Segment.js +82 -0
- package/dist/SegmentItem.js +23 -0
- package/dist/Select.js +24 -0
- package/dist/SelectBase.js +28 -0
- package/dist/SelectDesktop.js +147 -0
- package/dist/SelectInput.js +159 -0
- package/dist/SelectInputTags.js +29 -0
- package/dist/SelectListBox.js +73 -0
- package/dist/SelectListBoxItem.js +48 -0
- package/dist/SelectListBoxItemSelectAll.js +31 -0
- package/dist/SelectListBoxLoadingItem.js +41 -0
- package/dist/SelectListBoxSelectionBar.js +25 -0
- package/dist/SelectMobile.js +111 -0
- package/dist/Send.js +15 -0
- package/dist/Slider.js +93 -0
- package/dist/SplitButton.js +36 -0
- package/dist/Strikethrough.js +13 -0
- package/dist/Table.js +248 -0
- package/dist/Tag.js +42 -0
- package/dist/TextAlignSelect.js +44 -0
- package/dist/TextArea.js +120 -0
- package/dist/TextButton.js +13 -0
- package/dist/TextColor.js +16 -0
- package/dist/TextColorSelect.js +22 -0
- package/dist/TextEditor.js +143 -0
- package/dist/TextEditorToolbar.js +30 -0
- package/dist/TextHighlightSelect.js +24 -0
- package/dist/TextInput.js +125 -0
- package/dist/TextListActions.js +42 -0
- package/dist/TextMarksActions.js +67 -0
- package/dist/TextStyleSelect.js +52 -0
- package/dist/TimeField.js +17 -0
- package/dist/TimePicker.js +158 -0
- package/dist/TimePickerForm.js +158 -0
- package/dist/TimePickerInput.js +92 -0
- package/dist/Toast.js +58 -0
- package/dist/Today.js +13 -0
- package/dist/Toggle.js +60 -0
- package/dist/ToggleButton.js +13 -0
- package/dist/Tooltip.js +49 -0
- package/dist/TooltipEllipsis.js +18 -0
- package/dist/TooltipWrapper.js +19 -0
- package/dist/Typography.js +14 -0
- package/dist/Underlined.js +15 -0
- package/dist/Upload.js +16 -0
- package/dist/View.js +13 -0
- package/dist/ViewOff.js +13 -0
- package/dist/WarningFilled.js +15 -0
- package/dist/YearPicker.js +64 -0
- package/dist/ability.context.js +35 -0
- package/dist/alert.cva.js +62 -0
- package/dist/array.utils.js +8 -0
- package/dist/auth.context.js +37 -0
- package/dist/auth.js +6 -12
- package/dist/button.cva.js +656 -0
- package/dist/buttonContent.cva.js +10 -0
- package/dist/checkbox.cva.js +47 -0
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.d.ts +2 -2
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +5 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +8 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -1
- package/dist/components/inputs/File/fileUpload.types.d.ts +1 -0
- package/dist/components/inputs/FormField/FormField.d.ts +4 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +4 -2
- package/dist/components/inputs/Input/TextArea/TextArea.d.ts +1 -0
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +2 -1
- package/dist/components/inputs/Input/shared/InputContent.d.ts +4 -3
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -0
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.d.ts +2 -0
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/compoundMapper.js +11 -0
- package/dist/config/uiStyle.context.d.ts +2 -1
- package/dist/confirmation.context.js +78 -0
- package/dist/date-time.utils.js +50 -0
- package/dist/date.utils.js +17 -0
- package/dist/dom.utils.js +17 -0
- package/dist/dynamicColumns.js +272 -0
- package/dist/dynamicInputs.js +186 -0
- package/dist/error-handling.js +87 -0
- package/dist/file.utils.js +43 -0
- package/dist/fileUpload.cva.js +49 -0
- package/dist/i18n.js +8 -0
- package/dist/index.js +136 -278
- package/dist/input.cva.js +210 -0
- package/dist/inputUploadButton.cva.js +27 -0
- package/dist/isEqual.js +57 -0
- package/dist/label.cva.js +104 -0
- package/dist/link.context.js +17 -0
- package/dist/link.cva.js +7 -0
- package/dist/loader.cva.js +16 -0
- package/dist/logger.js +17 -0
- package/dist/menu.cva.js +27 -0
- package/dist/minWidth.cva.js +9 -0
- package/dist/modal.cva.js +31 -0
- package/dist/object.utils.js +36 -0
- package/dist/outline.clsx.js +4 -0
- package/dist/pillButton.cva.js +254 -0
- package/dist/queries.utils.js +7 -0
- package/dist/radio.cva.js +42 -0
- package/dist/react.js +6 -0
- package/dist/rest-interceptor.js +22 -0
- package/dist/rest.utils.js +31 -0
- package/dist/rolldown_runtime.js +16 -0
- package/dist/router.context.js +37 -0
- package/dist/routing.utils.js +9 -0
- package/dist/segment.cva.js +25 -0
- package/dist/select.context.js +190 -0
- package/dist/status.cva.js +57 -0
- package/dist/string.utils.js +10 -0
- package/dist/table.cva.js +35 -0
- package/dist/tag.cva.js +50 -0
- package/dist/text-editor.js +2 -4
- package/dist/textEditor.types.js +38 -0
- package/dist/theme.context.js +65 -0
- package/dist/toast.cva.js +158 -0
- package/dist/toggle.cva.js +27 -0
- package/dist/tooltip.cva.js +30 -0
- package/dist/translation.js +147 -0
- package/dist/translation2.js +145 -0
- package/dist/typography.cva.js +124 -0
- package/dist/uiConfig.context.js +58 -0
- package/dist/uiStyle.context.js +16 -0
- package/dist/useAutosave.js +62 -0
- package/dist/useBreakpoint.js +28 -0
- package/dist/useDebounceCallback.js +23 -0
- package/dist/useDeepCompare.js +21 -0
- package/dist/useFilters.js +121 -0
- package/dist/useForm.js +12 -0
- package/dist/useFormAutosave.js +52 -0
- package/dist/useIntersectionObserver.js +23 -0
- package/dist/useLocalStorage.js +35 -0
- package/dist/useLongPressRepeat.js +27 -0
- package/dist/usePagination.js +26 -0
- package/dist/useScrollableListBox.js +24 -0
- package/dist/useSelectItems.js +82 -0
- package/dist/useSorting.js +34 -0
- package/dist/useStateAndRef.js +15 -0
- package/dist/useTableColumnConfig.js +38 -0
- package/dist/useTableNav.js +279 -0
- package/dist/useToast.js +63 -0
- package/dist/useTranslationMemo.js +10 -0
- package/dist/zod.utils.js +17 -0
- package/package.json +14 -14
- package/dist/assets/icons/AlignCenter.js +0 -21
- package/dist/assets/icons/AlignLeft.js +0 -21
- package/dist/assets/icons/AlignLeftRight.js +0 -21
- package/dist/assets/icons/AlignRight.js +0 -21
- package/dist/assets/icons/ArrowDropDown.js +0 -21
- package/dist/assets/icons/ArrowDropUp.js +0 -21
- package/dist/assets/icons/ArrowLeft.js +0 -21
- package/dist/assets/icons/ArrowRight.js +0 -21
- package/dist/assets/icons/Bold.js +0 -21
- package/dist/assets/icons/BulletedList.js +0 -21
- package/dist/assets/icons/Calendar.js +0 -23
- package/dist/assets/icons/Check.js +0 -23
- package/dist/assets/icons/CheckCircle.js +0 -21
- package/dist/assets/icons/CheckboxCheckmark.js +0 -24
- package/dist/assets/icons/CheckboxIndeterminate.js +0 -24
- package/dist/assets/icons/ChevronDown.js +0 -23
- package/dist/assets/icons/ChevronLeft.js +0 -23
- package/dist/assets/icons/ChevronRight.js +0 -23
- package/dist/assets/icons/ChevronUp.js +0 -23
- package/dist/assets/icons/ChevronsLeft.js +0 -23
- package/dist/assets/icons/ChevronsRight.js +0 -23
- package/dist/assets/icons/Clock.js +0 -21
- package/dist/assets/icons/Close.js +0 -21
- package/dist/assets/icons/DateTime.js +0 -32
- package/dist/assets/icons/Drag.js +0 -21
- package/dist/assets/icons/File.js +0 -23
- package/dist/assets/icons/Highlight.js +0 -21
- package/dist/assets/icons/HighlightOn.js +0 -30
- package/dist/assets/icons/Info.js +0 -32
- package/dist/assets/icons/Italic.js +0 -21
- package/dist/assets/icons/Link.js +0 -21
- package/dist/assets/icons/Menu.js +0 -21
- package/dist/assets/icons/NumberedList.js +0 -21
- package/dist/assets/icons/PointerHorizontal.js +0 -21
- package/dist/assets/icons/PointerVertical.js +0 -21
- package/dist/assets/icons/Send.js +0 -23
- package/dist/assets/icons/Strikethrough.js +0 -21
- package/dist/assets/icons/TextColor.js +0 -30
- package/dist/assets/icons/Today.js +0 -21
- package/dist/assets/icons/Underlined.js +0 -23
- package/dist/assets/icons/Upload.js +0 -30
- package/dist/assets/icons/View.js +0 -18
- package/dist/assets/icons/ViewOff.js +0 -18
- package/dist/assets/icons/WarningFilled.js +0 -23
- package/dist/assets/locales/en/translation.json.js +0 -14
- package/dist/assets/locales/sl/translation.json.js +0 -14
- package/dist/components/Menu/Menu.js +0 -14
- package/dist/components/Menu/MenuDesktop.js +0 -74
- package/dist/components/Menu/MenuItem.js +0 -27
- package/dist/components/Menu/MenuMobile.js +0 -83
- package/dist/components/Menu/MenuPopover.js +0 -43
- package/dist/components/Menu/menu.cva.js +0 -45
- package/dist/components/buttons/Button/Button.js +0 -73
- package/dist/components/buttons/Button/button.cva.js +0 -666
- package/dist/components/buttons/IconButton/IconButton.js +0 -17
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +0 -18
- package/dist/components/buttons/PillButton/PillButton.js +0 -44
- package/dist/components/buttons/PillButton/pillButton.cva.js +0 -268
- package/dist/components/buttons/SplitButton/SplitButton.js +0 -65
- package/dist/components/buttons/TextButton/TextButton.js +0 -18
- package/dist/components/buttons/ToggleButton/ToggleButton.js +0 -21
- package/dist/components/buttons/shared/ButtonContent.js +0 -53
- package/dist/components/buttons/shared/buttonContent.cva.js +0 -16
- package/dist/components/inputs/Checkbox/Checkbox.js +0 -81
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +0 -32
- package/dist/components/inputs/Checkbox/checkbox.cva.js +0 -51
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +0 -251
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +0 -689
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +0 -265
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +0 -217
- package/dist/components/inputs/DateTime/shared/Calendar.js +0 -85
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +0 -160
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +0 -67
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +0 -89
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +0 -203
- package/dist/components/inputs/DateTime/shared/DateField.js +0 -77
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +0 -206
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +0 -55
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +0 -76
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +0 -47
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +0 -82
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +0 -133
- package/dist/components/inputs/DateTime/shared/TimeField.js +0 -26
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +0 -186
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +0 -125
- package/dist/components/inputs/DateTime/shared/YearPicker.js +0 -89
- package/dist/components/inputs/File/FileUpload.js +0 -257
- package/dist/components/inputs/File/FileUploadContainer.js +0 -17
- package/dist/components/inputs/File/InputUpload.js +0 -174
- package/dist/components/inputs/File/shared/FileCard.js +0 -67
- package/dist/components/inputs/File/shared/FileCardList.js +0 -20
- package/dist/components/inputs/File/shared/FileUploadContent.js +0 -92
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +0 -92
- package/dist/components/inputs/File/shared/FileUploadContentError.js +0 -167
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +0 -173
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +0 -128
- package/dist/components/inputs/File/shared/InputUploadContent.js +0 -73
- package/dist/components/inputs/File/shared/InputUploadFilled.js +0 -45
- package/dist/components/inputs/File/shared/ProgressBar.js +0 -42
- package/dist/components/inputs/File/shared/fileUpload.cva.js +0 -58
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +0 -49
- package/dist/components/inputs/FormField/FormField.js +0 -54
- package/dist/components/inputs/FormField/FormFieldError.js +0 -16
- package/dist/components/inputs/FormField/FormFieldHeader.js +0 -57
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +0 -20
- package/dist/components/inputs/FormField/FormFieldLabel.js +0 -37
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +0 -166
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +0 -26
- package/dist/components/inputs/Input/TextArea/TextArea.js +0 -155
- package/dist/components/inputs/Input/TextInput/TextInput.js +0 -162
- package/dist/components/inputs/Input/shared/InputContent.js +0 -114
- package/dist/components/inputs/Inputs/Form.js +0 -68
- package/dist/components/inputs/Inputs/InputItem.js +0 -61
- package/dist/components/inputs/Inputs/Inputs.js +0 -32
- package/dist/components/inputs/RadioGroup/RadioGroup.js +0 -103
- package/dist/components/inputs/RadioGroup/radio.cva.js +0 -57
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +0 -39
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +0 -25
- package/dist/components/inputs/Selection/Select/Select.js +0 -32
- package/dist/components/inputs/Selection/shared/SelectBase.js +0 -27
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +0 -223
- package/dist/components/inputs/Selection/shared/SelectInput.js +0 -234
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +0 -49
- package/dist/components/inputs/Selection/shared/SelectListBox.js +0 -127
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +0 -78
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +0 -45
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +0 -47
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +0 -42
- package/dist/components/inputs/Selection/shared/SelectMobile.js +0 -165
- package/dist/components/inputs/Selection/shared/select.context.js +0 -244
- package/dist/components/inputs/Selection/shared/useSelectItems.js +0 -94
- package/dist/components/inputs/Slider/Slider.js +0 -137
- package/dist/components/inputs/TextEditor/TextEditor.js +0 -223
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +0 -34
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +0 -80
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +0 -92
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +0 -56
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +0 -33
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +0 -31
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +0 -37
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +0 -51
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +0 -73
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +0 -61
- package/dist/components/inputs/TextEditor/textEditor.types.js +0 -40
- package/dist/components/inputs/Toggle/Toggle.js +0 -65
- package/dist/components/inputs/Toggle/toggle.cva.js +0 -44
- package/dist/components/inputs/shared/CheckContent.js +0 -22
- package/dist/components/inputs/shared/InputClear.js +0 -27
- package/dist/components/inputs/shared/TooltipWrapper.js +0 -23
- package/dist/components/inputs/shared/input.cva.js +0 -174
- package/dist/components/inputs/shared/label.cva.js +0 -128
- package/dist/components/outline.clsx.js +0 -11
- package/dist/components/overlays/ActionModal/ActionModal.js +0 -80
- package/dist/components/overlays/BottomSheet/BottomSheet.js +0 -261
- package/dist/components/overlays/Drawer/Drawer.js +0 -84
- package/dist/components/overlays/Modal/Modal.js +0 -64
- package/dist/components/overlays/Modal/modal.cva.js +0 -53
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +0 -71
- package/dist/components/overlays/Tooltip/Tooltip.js +0 -92
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +0 -27
- package/dist/components/overlays/Tooltip/tooltip.cva.js +0 -60
- package/dist/components/segment/Segment.js +0 -118
- package/dist/components/segment/SegmentItem.js +0 -35
- package/dist/components/segment/segment.cva.js +0 -35
- package/dist/components/shared/pagination/Pagination.js +0 -75
- package/dist/components/shared/pagination/PaginationList.js +0 -145
- package/dist/components/shared/pagination/minWidth.cva.js +0 -15
- package/dist/components/status/Alert/Alert.js +0 -41
- package/dist/components/status/Alert/alert.cva.js +0 -64
- package/dist/components/status/Loader/Loader.js +0 -37
- package/dist/components/status/Loader/loader.cva.js +0 -27
- package/dist/components/status/Toast/Toast.js +0 -65
- package/dist/components/status/Toast/toast.cva.js +0 -150
- package/dist/components/status/Toast/useToast.js +0 -94
- package/dist/components/status/shared/status.cva.js +0 -62
- package/dist/components/table/CellText.js +0 -18
- package/dist/components/table/ColumnConfig.js +0 -124
- package/dist/components/table/HeaderText.js +0 -15
- package/dist/components/table/InfiniteTable.js +0 -40
- package/dist/components/table/PaginatedTable.js +0 -33
- package/dist/components/table/Table.js +0 -370
- package/dist/components/table/table.cva.js +0 -63
- package/dist/components/text/Link/Link.js +0 -24
- package/dist/components/text/Link/link.cva.js +0 -18
- package/dist/components/text/Tag/Tag.js +0 -49
- package/dist/components/text/Tag/tag.cva.js +0 -59
- package/dist/components/text/Typography/Typography.js +0 -22
- package/dist/components/text/Typography/typography.cva.js +0 -100
- package/dist/config/confirmation.context.js +0 -107
- package/dist/config/i18n.js +0 -15
- package/dist/config/link.context.js +0 -19
- package/dist/config/router.context.js +0 -39
- package/dist/config/theme.context.js +0 -73
- package/dist/config/uiConfig.context.js +0 -69
- package/dist/config/uiStyle.context.js +0 -16
- package/dist/helpers/dynamicColumns.js +0 -359
- package/dist/helpers/dynamicInputs.js +0 -212
- package/dist/hooks/useAutosave.js +0 -83
- package/dist/hooks/useBreakpoint.js +0 -33
- package/dist/hooks/useDebounceCallback.js +0 -29
- package/dist/hooks/useDeepCompare.js +0 -25
- package/dist/hooks/useFilters.js +0 -160
- package/dist/hooks/useForm.js +0 -22
- package/dist/hooks/useFormAutosave.js +0 -67
- package/dist/hooks/useIntersectionObserver.js +0 -27
- package/dist/hooks/useLocalStorage.js +0 -54
- package/dist/hooks/useLongPressRepeat.js +0 -33
- package/dist/hooks/usePagination.js +0 -35
- package/dist/hooks/useScrollableListBox.js +0 -30
- package/dist/hooks/useSorting.js +0 -32
- package/dist/hooks/useStateAndRef.js +0 -17
- package/dist/hooks/useTableColumnConfig.js +0 -63
- package/dist/hooks/useTableNav.js +0 -394
- package/dist/hooks/useTranslationMemo.js +0 -14
- package/dist/utils/array.utils.js +0 -12
- package/dist/utils/compoundMapper.js +0 -14
- package/dist/utils/date-time.utils.js +0 -77
- package/dist/utils/date.utils.js +0 -23
- package/dist/utils/dom.utils.js +0 -13
- package/dist/utils/file.utils.js +0 -63
- package/dist/utils/isEqual.js +0 -95
- package/dist/utils/logger.js +0 -19
- package/dist/utils/object.utils.js +0 -53
- package/dist/utils/queries.utils.js +0 -9
- package/dist/utils/rest.utils.js +0 -51
- package/dist/utils/routing.utils.js +0 -15
- package/dist/utils/string.utils.js +0 -12
- package/dist/utils/vendor/acl/AclGuard.js +0 -14
- package/dist/utils/vendor/acl/Can.js +0 -18
- package/dist/utils/vendor/acl/ability.context.js +0 -37
- package/dist/utils/vendor/auth/AuthGuard.js +0 -26
- package/dist/utils/vendor/auth/auth.context.js +0 -41
- package/dist/utils/vendor/error-handling.js +0 -119
- package/dist/utils/vendor/rest-interceptor.js +0 -21
- package/dist/utils/zod.utils.js +0 -21
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# @povio/ui
|
|
2
|
+
|
|
3
|
+
UI Components that match Povio's Atlas Design System.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
`yarn add @povio/ui`
|
|
8
|
+
|
|
9
|
+
## Versioning
|
|
10
|
+
|
|
11
|
+
Major and minor version will correspond to the Atlas version (v2.1.0 corresponds Atlas 2.1) and patch versions are fixes/updates within that Atlas version.
|
|
12
|
+
|
|
13
|
+
## Requirements
|
|
14
|
+
|
|
15
|
+
### Tailwind 4
|
|
16
|
+
|
|
17
|
+
`@povio/ui` is using Tailwind 4 for styling so your project should also use Tailwind version 4. This is especially noticable with modifier classes (important modifier or child selectors) which changed between version 3 and 4.
|
|
18
|
+
|
|
19
|
+
Tailwind version 4 also defaults to `cursor: default` for buttons which differs from version 3. In order to alleviate that add the following snippet to your base styles:
|
|
20
|
+
|
|
21
|
+
```css
|
|
22
|
+
@layer base {
|
|
23
|
+
button:not(:disabled),
|
|
24
|
+
[role="button"]:not(:disabled) {
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
This is required for buttons to behave as expected. It is based on [Tailwind Upgrade Guide](https://tailwindcss.com/docs/upgrade-guide#buttons-use-the-default-cursor).
|
|
31
|
+
|
|
32
|
+
### React Aria
|
|
33
|
+
|
|
34
|
+
We are using `react-aria-components` for our UI components including their plugin for Tailwind that makes classes for modifiers a bit shorter. As such, make sure to install and setup [`tailwindcss-react-aria-components`](https://www.npmjs.com/package/tailwindcss-react-aria-components)
|
|
35
|
+
|
|
36
|
+
### Translations
|
|
37
|
+
|
|
38
|
+
We're using `i18next` for translations. Make sure the package versions match in your project. Out of sync major version might cause issues.
|
|
39
|
+
|
|
40
|
+
#### Overriding translations
|
|
41
|
+
|
|
42
|
+
To override the translations, add a partial `ui-translation.json` file for the locale (same structure as the translation.json in @povio/ui package) and merge it into the UI namespace.
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
// src/config/locales/en/ui-translation.json
|
|
46
|
+
{
|
|
47
|
+
"ui": {
|
|
48
|
+
"fileUpload": {
|
|
49
|
+
"emptyText": "Upload file"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
// src/config/i18n.ts
|
|
57
|
+
import { resources as uiDefaultResources, ns as uiNs } from "@povio/ui";
|
|
58
|
+
import deepMerge from "deepmerge";
|
|
59
|
+
|
|
60
|
+
import uiTranslationEN from "./locales/en/ui-translation.json";
|
|
61
|
+
|
|
62
|
+
const uiResources = deepMerge(uiDefaultResources, { en: { [uiNs]: uiTranslationEN } });
|
|
63
|
+
export const resources = deepMerge(defaultResources, uiResources);
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Misc
|
|
67
|
+
|
|
68
|
+
We're using a helper class for flex, so make sure to add this into your base css as well:
|
|
69
|
+
|
|
70
|
+
```css
|
|
71
|
+
.flex-fill {
|
|
72
|
+
flex: 1 0 0;
|
|
73
|
+
}
|
|
74
|
+
```
|
package/dist/AclGuard.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UIRouter } from "./router.context.js";
|
|
2
|
+
import { AbilityContext } from "./ability.context.js";
|
|
3
|
+
const createAclGuard = () => ({ canUse, redirectTo = "/", children }) => {
|
|
4
|
+
const ability = AbilityContext.useAbility();
|
|
5
|
+
const { replace } = UIRouter.useUIRouter();
|
|
6
|
+
if (!ability.can(canUse[0], canUse[1])) {
|
|
7
|
+
replace(redirectTo);
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
return children;
|
|
11
|
+
};
|
|
12
|
+
export { createAclGuard };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Typography } from "./Typography.js";
|
|
2
|
+
import { Button } from "./Button.js";
|
|
3
|
+
import { Modal } from "./Modal.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
|
+
var textAlignClassMap = {
|
|
7
|
+
left: "text-left",
|
|
8
|
+
center: "text-center",
|
|
9
|
+
right: "text-right"
|
|
10
|
+
};
|
|
11
|
+
const ActionModal = ({ heading, description, primaryAction, secondaryAction, buttonSize = "m", textAlign = "left", modalClassName,...modalProps }) => {
|
|
12
|
+
const textAlignClass = textAlignClassMap[textAlign];
|
|
13
|
+
return /* @__PURE__ */ jsxs(Modal, {
|
|
14
|
+
modalClassName: clsx("w-modal", modalClassName),
|
|
15
|
+
...modalProps,
|
|
16
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
17
|
+
className: "flex flex-col gap-modal-gap-text",
|
|
18
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
19
|
+
size: "title-5",
|
|
20
|
+
variant: "prominent-1",
|
|
21
|
+
as: "h2",
|
|
22
|
+
className: clsx("text-text-default-1", textAlignClass),
|
|
23
|
+
children: heading
|
|
24
|
+
}), /* @__PURE__ */ jsx(Typography, {
|
|
25
|
+
size: "body-3",
|
|
26
|
+
className: clsx("text-text-default-1", textAlignClass),
|
|
27
|
+
children: description
|
|
28
|
+
})]
|
|
29
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
30
|
+
className: "flex w-full flex-wrap gap-modal-gap-buttons pt-1",
|
|
31
|
+
children: [secondaryAction && /* @__PURE__ */ jsx(Button, {
|
|
32
|
+
variant: secondaryAction?.variant ?? "contained",
|
|
33
|
+
size: buttonSize,
|
|
34
|
+
color: secondaryAction?.color ?? "secondary",
|
|
35
|
+
width: "fill",
|
|
36
|
+
onPress: secondaryAction?.onPress,
|
|
37
|
+
className: clsx("min-w-40 flex-1 shrink-0", secondaryAction?.className),
|
|
38
|
+
children: secondaryAction?.label
|
|
39
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
40
|
+
variant: primaryAction?.variant ?? "contained",
|
|
41
|
+
size: buttonSize,
|
|
42
|
+
color: primaryAction?.color ?? "primary",
|
|
43
|
+
width: "fill",
|
|
44
|
+
onPress: primaryAction.onPress,
|
|
45
|
+
className: clsx("min-w-40 flex-1 shrink-0", primaryAction?.className),
|
|
46
|
+
children: primaryAction.label
|
|
47
|
+
})]
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
export { ActionModal };
|
package/dist/Alert.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Loader } from "./Loader.js";
|
|
2
|
+
import { UIStyle } from "./uiStyle.context.js";
|
|
3
|
+
import { Typography } from "./Typography.js";
|
|
4
|
+
import { alert } from "./alert.cva.js";
|
|
5
|
+
import { statusIcon, statusSeparator } from "./status.cva.js";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
const Alert = ({ variant, color, text, isLoading = false, rightContent, hasSeparator, icon: Icon, className }) => {
|
|
8
|
+
const uiStyle = UIStyle.useConfig();
|
|
9
|
+
const alertCva = uiStyle?.alert?.cva ?? alert;
|
|
10
|
+
const iconCva = uiStyle?.status?.iconCva ?? statusIcon;
|
|
11
|
+
const separatorCva = uiStyle?.status?.separatorCva ?? statusSeparator;
|
|
12
|
+
return /* @__PURE__ */ jsx("div", {
|
|
13
|
+
className: alertCva({
|
|
14
|
+
variant,
|
|
15
|
+
color,
|
|
16
|
+
className
|
|
17
|
+
}),
|
|
18
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
19
|
+
className: "flex w-auto flex-col items-center md:flex-row",
|
|
20
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
21
|
+
className: "flex w-full items-start gap-alert-gap-icon-to-text px-alert-side-default py-alert-height-content",
|
|
22
|
+
children: [
|
|
23
|
+
isLoading && /* @__PURE__ */ jsx(Loader, {
|
|
24
|
+
size: "default",
|
|
25
|
+
className: "shrink-0"
|
|
26
|
+
}),
|
|
27
|
+
!isLoading && Icon && /* @__PURE__ */ jsx(Icon, { className: iconCva({
|
|
28
|
+
variant,
|
|
29
|
+
color
|
|
30
|
+
}) }),
|
|
31
|
+
/* @__PURE__ */ jsx(Typography, {
|
|
32
|
+
size: "label-2",
|
|
33
|
+
children: text
|
|
34
|
+
})
|
|
35
|
+
]
|
|
36
|
+
}), !!rightContent && /* @__PURE__ */ jsxs(Fragment, { children: [hasSeparator && /* @__PURE__ */ jsx("div", { className: separatorCva({
|
|
37
|
+
variant,
|
|
38
|
+
color
|
|
39
|
+
}) }), /* @__PURE__ */ jsx("div", {
|
|
40
|
+
className: "flex w-full shrink-0 flex-wrap items-center justify-end gap-alert-gap-action px-alert-side-default py-alert-height-actions-mobile md:w-auto md:justify-center md:py-alert-height-actions-desktop",
|
|
41
|
+
children: rightContent
|
|
42
|
+
})] })]
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
export { Alert };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const AlignCenterIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 25 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
d: "M4.586 20.5a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.535A.73.73 0 0 1 4.586 19h15.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.535a.73.73 0 0 1-.534.215zm4-3.875a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.534a.73.73 0 0 1 .534-.216h7.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.535a.73.73 0 0 1-.534.215zm-4-3.875a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.534a.73.73 0 0 1 .534-.216h15.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.534a.73.73 0 0 1-.534.216zm4-3.875a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.535a.73.73 0 0 1 .534-.215h7.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.534a.73.73 0 0 1-.534.216zM4.586 5a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.534a.73.73 0 0 1 .534-.216h15.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.535a.73.73 0 0 1-.534.215z"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
export { AlignCenterIcon };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const AlignLeftIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 25 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
d: "M4.586 20.5a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.535A.73.73 0 0 1 4.586 19h15.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.535a.73.73 0 0 1-.534.215zm0-3.875a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.534a.73.73 0 0 1 .534-.216h9.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.535a.73.73 0 0 1-.534.215zm0-3.875a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.534a.73.73 0 0 1 .534-.216h15.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.534a.73.73 0 0 1-.534.216zm0-3.875a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.535a.73.73 0 0 1 .534-.215h9.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.534a.73.73 0 0 1-.534.216zm0-3.875a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.534a.73.73 0 0 1 .534-.216h15.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.535a.73.73 0 0 1-.534.215z"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
export { AlignLeftIcon };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const AlignLeftRightIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 25 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
d: "M4.586 20.5a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.535A.73.73 0 0 1 4.586 19h15.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.535a.73.73 0 0 1-.534.215zm0-3.875a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.534a.73.73 0 0 1 .534-.216h15.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.535a.73.73 0 0 1-.534.215zm0-3.875a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.534a.73.73 0 0 1 .534-.216h15.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.534a.73.73 0 0 1-.534.216zm0-3.875a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.535a.73.73 0 0 1 .534-.215h15.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.534a.73.73 0 0 1-.534.216zm0-3.875a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.534a.73.73 0 0 1 .534-.216h15.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.535a.73.73 0 0 1-.534.215z"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
export { AlignLeftRightIcon };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const AlignRightIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 25 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
d: "M4.586 5a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.534a.73.73 0 0 1 .534-.216h15.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.535a.73.73 0 0 1-.534.215zm6 3.875a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.535a.73.73 0 0 1 .534-.215h9.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.534a.73.73 0 0 1-.534.216zm-6 3.875a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.534a.73.73 0 0 1 .534-.216h15.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.534a.73.73 0 0 1-.534.216zm6 3.875a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.534a.73.73 0 0 1 .534-.216h9.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.535a.73.73 0 0 1-.534.215zm-6 3.875a.73.73 0 0 1-.534-.216.73.73 0 0 1-.216-.534q0-.32.216-.535A.73.73 0 0 1 4.586 19h15.5q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .32-.216.535a.73.73 0 0 1-.534.215z"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
export { AlignRightIcon };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const ArrowDropDownIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
d: "m12 15-5-5h10z"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
export { ArrowDropDownIcon };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const ArrowDropUpIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
d: "m7 14 5-5 5 5z"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
export { ArrowDropUpIcon };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const ArrowLeftIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
d: "m14 17-5-5 5-5z"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
export { ArrowLeftIcon };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const ArrowRightIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
d: "M10 17V7l5 5z"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
export { ArrowRightIcon };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UIRouter } from "./router.context.js";
|
|
2
|
+
import { AuthContext } from "./auth.context.js";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
const AuthGuard = ({ type, redirectTo, children }) => {
|
|
5
|
+
const { isAuthenticated, routes, loadingState } = AuthContext.useAuth();
|
|
6
|
+
const { replace } = UIRouter.useUIRouter();
|
|
7
|
+
const [hasMounted, setHasMounted] = useState(false);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
setHasMounted(true);
|
|
10
|
+
}, []);
|
|
11
|
+
if (!hasMounted) return loadingState;
|
|
12
|
+
if (type === "private" && !isAuthenticated) {
|
|
13
|
+
replace(redirectTo || routes?.unauthenticated || "/");
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
if (type === "public-only" && isAuthenticated) {
|
|
17
|
+
replace(redirectTo || routes?.authenticated || "/");
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return children;
|
|
21
|
+
};
|
|
22
|
+
export { AuthGuard };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SelectBase } from "./SelectBase.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { mergeRefs } from "@react-aria/utils";
|
|
4
|
+
import { Controller } from "react-hook-form";
|
|
5
|
+
const Autocomplete = (props) => {
|
|
6
|
+
if ("formControl" in props && props.formControl) {
|
|
7
|
+
const { formControl, ref,...innerProps } = props;
|
|
8
|
+
return /* @__PURE__ */ jsx(Controller, {
|
|
9
|
+
control: formControl.control,
|
|
10
|
+
name: formControl.name,
|
|
11
|
+
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(SelectBase, {
|
|
12
|
+
...innerProps,
|
|
13
|
+
ref: mergeRefs(ref, field.ref),
|
|
14
|
+
value: field.value,
|
|
15
|
+
onChange: field.onChange,
|
|
16
|
+
onBlur: field.onBlur,
|
|
17
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
18
|
+
error: props.error ?? error?.message,
|
|
19
|
+
isSearchable: true
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return /* @__PURE__ */ jsx(SelectBase, {
|
|
24
|
+
...props,
|
|
25
|
+
isSearchable: true
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
export { Autocomplete };
|
package/dist/Bold.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const BoldIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 25 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
d: "M9.016 19q-.669 0-1.137-.468a1.55 1.55 0 0 1-.469-1.137V6.605q0-.667.469-1.137A1.55 1.55 0 0 1 9.016 5h3.531q1.615 0 2.921 1.006 1.305 1.005 1.305 2.708 0 1.185-.572 1.932-.571.746-1.232 1.084.813.28 1.553 1.108t.74 2.23q0 2.026-1.494 2.979-1.495.953-3.01.953zm.666-2.105h2.991q1.248 0 1.764-.693t.516-1.329-.516-1.329-1.813-.693H9.682zm0-6.084h2.741q.963 0 1.527-.55t.564-1.32q0-.816-.596-1.334-.597-.518-1.462-.518H9.682z"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
export { BoldIcon };
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { react_exports } from "./react.js";
|
|
2
|
+
import { DomUtils } from "./dom.utils.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { clsx } from "clsx";
|
|
5
|
+
import { Dialog, DialogTrigger, Modal, ModalOverlay } from "react-aria-components";
|
|
6
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
7
|
+
import { useResizeObserver, useViewportSize } from "@react-aria/utils";
|
|
8
|
+
var MotionModal = react_exports.motion.create(Modal);
|
|
9
|
+
var MotionModalOverlay = react_exports.motion.create(ModalOverlay);
|
|
10
|
+
var inertiaTransition = {
|
|
11
|
+
type: "inertia",
|
|
12
|
+
bounceStiffness: 300,
|
|
13
|
+
bounceDamping: 40,
|
|
14
|
+
timeConstant: 300
|
|
15
|
+
};
|
|
16
|
+
var staticTransition = {
|
|
17
|
+
duration: .5,
|
|
18
|
+
ease: [
|
|
19
|
+
.32,
|
|
20
|
+
.72,
|
|
21
|
+
0,
|
|
22
|
+
1
|
|
23
|
+
]
|
|
24
|
+
};
|
|
25
|
+
var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = false, isScrollable = true, height = "full", label, portalContainerRef, children, footer, sheetMarginTop = 96, sheetMarginBottom = 128 }) => {
|
|
26
|
+
const viewport = useViewportSize();
|
|
27
|
+
const { sheetHeight, windowHeight } = useMemo(() => {
|
|
28
|
+
return {
|
|
29
|
+
sheetHeight: viewport.height - sheetMarginTop,
|
|
30
|
+
windowHeight: Math.max(window.innerHeight, viewport.height) - sheetMarginTop
|
|
31
|
+
};
|
|
32
|
+
}, [viewport.height, sheetMarginTop]);
|
|
33
|
+
const y = (0, react_exports.useMotionValue)(sheetHeight);
|
|
34
|
+
const closeVelocityRef = useRef(true);
|
|
35
|
+
const overlayRef = useRef(null);
|
|
36
|
+
const containerRef = useRef(null);
|
|
37
|
+
const dialogRef = useRef(null);
|
|
38
|
+
const footerRef = useRef(null);
|
|
39
|
+
const focusTrapRef = useRef(null);
|
|
40
|
+
const [footerHeight, setFooterHeight] = useState(0);
|
|
41
|
+
useResizeObserver({
|
|
42
|
+
ref: footerRef,
|
|
43
|
+
onResize: () => {
|
|
44
|
+
setFooterHeight(footerRef.current?.offsetHeight || 0);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
const oldHeightRef = useRef(0);
|
|
48
|
+
useResizeObserver({
|
|
49
|
+
ref: dialogRef,
|
|
50
|
+
onResize: () => {
|
|
51
|
+
const rect = dialogRef.current?.getBoundingClientRect();
|
|
52
|
+
if (!rect || oldHeightRef.current === rect.height) return;
|
|
53
|
+
oldHeightRef.current = rect.height;
|
|
54
|
+
if (rect.bottom < viewport.height) {
|
|
55
|
+
y.stop();
|
|
56
|
+
(0, react_exports.animate)(y, -(rect.height - viewport.height + sheetMarginTop));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return /* @__PURE__ */ jsx(react_exports.AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxs(MotionModalOverlay, {
|
|
61
|
+
isOpen: true,
|
|
62
|
+
UNSTABLE_portalContainer: portalContainerRef?.current,
|
|
63
|
+
className: "fixed top-0 left-0 z-10 w-screen",
|
|
64
|
+
onOpenChange,
|
|
65
|
+
isDismissable,
|
|
66
|
+
style: { height: viewport.height },
|
|
67
|
+
ref: overlayRef,
|
|
68
|
+
children: [/* @__PURE__ */ jsx(react_exports.motion.div, {
|
|
69
|
+
className: "pointer-events-none absolute inset-0 bg-support-overlay",
|
|
70
|
+
animate: { opacity: 1 },
|
|
71
|
+
initial: { opacity: 0 },
|
|
72
|
+
exit: { opacity: 0 }
|
|
73
|
+
}), /* @__PURE__ */ jsx(MotionModal, {
|
|
74
|
+
isDismissable: true,
|
|
75
|
+
className: clsx("pointer-events-none flex w-full flex-col items-stretch justify-end outline-none will-change-transform", isScrollable ? "h-auto" : "h-full"),
|
|
76
|
+
animate: {
|
|
77
|
+
y: 0,
|
|
78
|
+
opacity: 1
|
|
79
|
+
},
|
|
80
|
+
initial: {
|
|
81
|
+
y: windowHeight,
|
|
82
|
+
opacity: 1
|
|
83
|
+
},
|
|
84
|
+
exit: {
|
|
85
|
+
y: windowHeight,
|
|
86
|
+
opacity: 1
|
|
87
|
+
},
|
|
88
|
+
onAnimationComplete: (data) => {
|
|
89
|
+
onStateChange?.(data.y === 0 ? "opened" : "closed");
|
|
90
|
+
},
|
|
91
|
+
onAnimationStart: (data) => {
|
|
92
|
+
onStateChange?.(data.y === 0 ? "opening" : "closing");
|
|
93
|
+
},
|
|
94
|
+
transition: staticTransition,
|
|
95
|
+
style: {
|
|
96
|
+
y,
|
|
97
|
+
minHeight: "100%"
|
|
98
|
+
},
|
|
99
|
+
drag: "y",
|
|
100
|
+
dragElastic: 1,
|
|
101
|
+
dragConstraints: overlayRef,
|
|
102
|
+
onUpdate: (latest) => {
|
|
103
|
+
if (!latest || !footerRef.current) return;
|
|
104
|
+
footerRef.current?.style.setProperty("--scroll-position", `${(latest.y || 0).toFixed(0)}px`);
|
|
105
|
+
},
|
|
106
|
+
onDragStart: () => {
|
|
107
|
+
if (document.activeElement && DomUtils.isKeyboardInput(document.activeElement)) focusTrapRef.current?.focus();
|
|
108
|
+
y.animation?.stop();
|
|
109
|
+
closeVelocityRef.current = isScrollable ? y.get() >= -10 : true;
|
|
110
|
+
containerRef.current?.style.setProperty("pointer-events", "none");
|
|
111
|
+
},
|
|
112
|
+
onDragEnd: (e, { velocity }) => {
|
|
113
|
+
containerRef.current?.style.removeProperty("pointer-events");
|
|
114
|
+
if (y.get() > 0) if (closeVelocityRef.current && velocity.y > 10 || y.get() > 200) onOpenChange?.(false);
|
|
115
|
+
else (0, react_exports.animate)(y, 0, {
|
|
116
|
+
...inertiaTransition,
|
|
117
|
+
min: 0,
|
|
118
|
+
max: 0
|
|
119
|
+
});
|
|
120
|
+
},
|
|
121
|
+
children: /* @__PURE__ */ jsx(Dialog, {
|
|
122
|
+
className: "relative flex min-h-0 flex-1 flex-col items-stretch outline-none",
|
|
123
|
+
ref: dialogRef,
|
|
124
|
+
"aria-label": label,
|
|
125
|
+
children: ({ close }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
126
|
+
/* @__PURE__ */ jsx("div", {
|
|
127
|
+
style: { minHeight: `${sheetMarginTop}px` },
|
|
128
|
+
className: clsx("shrink-0", height === "auto" && "grow")
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ jsxs("div", {
|
|
131
|
+
className: clsx("pointer-events-auto relative flex min-h-0 flex-col items-stretch rounded-t-xl bg-elevation-fill-default-1", height === "full" && "flex-1"),
|
|
132
|
+
children: [
|
|
133
|
+
/* @__PURE__ */ jsx("div", {
|
|
134
|
+
className: clsx("absolute bottom-full left-0 w-full outline-none", isDismissable ? "h-0" : "h-screen"),
|
|
135
|
+
ref: focusTrapRef,
|
|
136
|
+
tabIndex: -1
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ jsx("div", {
|
|
139
|
+
className: clsx("flex min-h-0 grow flex-col items-stretch", isScrollable ? "shrink-0" : "shrink"),
|
|
140
|
+
ref: containerRef,
|
|
141
|
+
children: typeof children === "function" ? children(close) : children
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ jsx("div", {
|
|
144
|
+
className: "shrink-0",
|
|
145
|
+
style: { height: `${footerHeight + sheetMarginBottom}px` }
|
|
146
|
+
}),
|
|
147
|
+
/* @__PURE__ */ jsx("div", { className: "absolute top-full h-screen w-full bg-elevation-fill-default-1" })
|
|
148
|
+
]
|
|
149
|
+
}),
|
|
150
|
+
footer && /* @__PURE__ */ jsx(react_exports.motion.div, {
|
|
151
|
+
ref: footerRef,
|
|
152
|
+
className: clsx("pointer-events-auto absolute z-50 w-full bg-elevation-fill-default-2", "top-(--visual-viewport-height) left-0 translate-y-[calc(-100%-var(--scroll-position,0px))]"),
|
|
153
|
+
children: footer
|
|
154
|
+
})
|
|
155
|
+
] })
|
|
156
|
+
})
|
|
157
|
+
})]
|
|
158
|
+
}) });
|
|
159
|
+
};
|
|
160
|
+
const BottomSheet = ({ isOpen, portalContainerRef, onOpenChange, trigger, children,...rest }) => {
|
|
161
|
+
const [isSheetOpen, setIsSheetOpen] = useState(!!isOpen);
|
|
162
|
+
const hasTrigger = !!trigger;
|
|
163
|
+
useEffect(() => {
|
|
164
|
+
if (hasTrigger) setIsSheetOpen(!!isOpen);
|
|
165
|
+
}, [isOpen, hasTrigger]);
|
|
166
|
+
if (trigger) {
|
|
167
|
+
const handleOpenChange = (open) => {
|
|
168
|
+
setIsSheetOpen(open);
|
|
169
|
+
onOpenChange?.(open);
|
|
170
|
+
};
|
|
171
|
+
return /* @__PURE__ */ jsxs(DialogTrigger, {
|
|
172
|
+
isOpen: isSheetOpen,
|
|
173
|
+
onOpenChange: handleOpenChange,
|
|
174
|
+
children: [trigger, /* @__PURE__ */ jsx(BottomSheetBase, {
|
|
175
|
+
isOpen: isSheetOpen,
|
|
176
|
+
onOpenChange: handleOpenChange,
|
|
177
|
+
portalContainerRef,
|
|
178
|
+
...rest,
|
|
179
|
+
children
|
|
180
|
+
})]
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
return /* @__PURE__ */ jsx(BottomSheetBase, {
|
|
184
|
+
isOpen,
|
|
185
|
+
onOpenChange,
|
|
186
|
+
portalContainerRef,
|
|
187
|
+
...rest,
|
|
188
|
+
children
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
export { BottomSheet };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const BulletedListIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 25 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
d: "M10.394 18.75a.73.73 0 0 1-.535-.216.73.73 0 0 1-.215-.534q0-.32.215-.535a.73.73 0 0 1 .535-.215h9.692q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .319-.216.534a.73.73 0 0 1-.534.216zm0-6a.73.73 0 0 1-.535-.216.73.73 0 0 1-.215-.534q0-.32.215-.535a.73.73 0 0 1 .535-.215h9.692q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .319-.216.534a.73.73 0 0 1-.534.216zm0-6a.73.73 0 0 1-.535-.216A.73.73 0 0 1 9.644 6q0-.32.215-.535a.73.73 0 0 1 .535-.215h9.692q.318 0 .534.216a.73.73 0 0 1 .216.534q0 .319-.216.534a.73.73 0 0 1-.534.216zM5.499 19.663q-.686 0-1.174-.488A1.6 1.6 0 0 1 3.835 18q0-.687.49-1.175a1.6 1.6 0 0 1 1.174-.489q.687 0 1.175.49.489.487.489 1.174t-.489 1.175a1.6 1.6 0 0 1-1.175.488m0-6q-.686 0-1.174-.488A1.6 1.6 0 0 1 3.835 12q0-.687.49-1.175a1.6 1.6 0 0 1 1.174-.489q.687 0 1.175.49.489.487.489 1.174t-.489 1.175a1.6 1.6 0 0 1-1.175.488m0-6q-.686 0-1.174-.488A1.6 1.6 0 0 1 3.835 6q0-.687.49-1.175a1.6 1.6 0 0 1 1.174-.489q.687 0 1.175.49.489.487.489 1.174t-.489 1.175a1.6 1.6 0 0 1-1.175.488"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
export { BulletedListIcon };
|
package/dist/Button.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { UIStyle } from "./uiStyle.context.js";
|
|
2
|
+
import { ButtonContent } from "./ButtonContent.js";
|
|
3
|
+
import { TooltipEllipsis } from "./TooltipEllipsis.js";
|
|
4
|
+
import { LinkContext } from "./link.context.js";
|
|
5
|
+
import { button, buttonContent, buttonIconSize, buttonSize, buttonTypography } from "./button.cva.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { clsx } from "clsx";
|
|
8
|
+
import { Button, Link, ToggleButton } from "react-aria-components";
|
|
9
|
+
const Button$1 = ({ icon: Icon, iconPosition, children, isLoading, className, link, iconClassName, noDisableWhenLoading, disableTooltip,...props }) => {
|
|
10
|
+
const linkContext = LinkContext.useLinkContext();
|
|
11
|
+
const uiStyle = UIStyle.useConfig();
|
|
12
|
+
const buttonCva = uiStyle?.button?.cva ?? button;
|
|
13
|
+
const buttonSizeCva = uiStyle?.button?.sizeCva ?? buttonSize;
|
|
14
|
+
const buttonContentCva = uiStyle?.button?.contentCva ?? buttonContent;
|
|
15
|
+
const buttonIconSizeCva = uiStyle?.button?.iconSize ?? buttonIconSize;
|
|
16
|
+
const typographyMap = uiStyle?.button?.typography ?? buttonTypography;
|
|
17
|
+
const Component = (() => {
|
|
18
|
+
if (link) return linkContext?.LinkComponent ?? Link;
|
|
19
|
+
if (props.toggle != null) return ToggleButton;
|
|
20
|
+
return Button;
|
|
21
|
+
})();
|
|
22
|
+
if (link && !link.to && link.href) link.to = link.href;
|
|
23
|
+
return /* @__PURE__ */ jsx(TooltipEllipsis, {
|
|
24
|
+
text: children,
|
|
25
|
+
isDisabled: disableTooltip,
|
|
26
|
+
children: (onContentRef) => /* @__PURE__ */ jsx(Component, {
|
|
27
|
+
...props,
|
|
28
|
+
...link,
|
|
29
|
+
isDisabled: props.isDisabled || isLoading && !noDisableWhenLoading,
|
|
30
|
+
className: clsx(buttonCva({
|
|
31
|
+
...props,
|
|
32
|
+
className
|
|
33
|
+
}), buttonSizeCva({ ...props })),
|
|
34
|
+
children: /* @__PURE__ */ jsx(ButtonContent, {
|
|
35
|
+
isLoading,
|
|
36
|
+
icon: Icon,
|
|
37
|
+
text: children,
|
|
38
|
+
ref: onContentRef,
|
|
39
|
+
hideText: props.iconOnly,
|
|
40
|
+
iconPosition,
|
|
41
|
+
iconClassName: buttonIconSizeCva({
|
|
42
|
+
...props,
|
|
43
|
+
className: iconClassName
|
|
44
|
+
}),
|
|
45
|
+
className: buttonContentCva({
|
|
46
|
+
...props,
|
|
47
|
+
iconPosition: !Icon ? "none" : iconPosition
|
|
48
|
+
}),
|
|
49
|
+
typography: typographyMap({ ...props })
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
export { Button$1 as Button };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { buttonContent } from "./buttonContent.cva.js";
|
|
2
|
+
import { Loader } from "./Loader.js";
|
|
3
|
+
import { Typography } from "./Typography.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
|
+
import { isValidElement } from "react";
|
|
7
|
+
const ButtonContent = ({ ref, text, isLoading, className, icon: Icon, iconClassName, hideText, iconPosition, typography }) => {
|
|
8
|
+
let iconOrLoader = null;
|
|
9
|
+
if (isLoading) iconOrLoader = /* @__PURE__ */ jsx(Loader, { className: "shrink-0" });
|
|
10
|
+
else if (Icon) if (isValidElement(Icon)) iconOrLoader = Icon;
|
|
11
|
+
else iconOrLoader = /* @__PURE__ */ jsx(Icon, { className: clsx("shrink-0", iconClassName) });
|
|
12
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
13
|
+
className: buttonContent({
|
|
14
|
+
iconPosition: iconOrLoader ? iconPosition : null,
|
|
15
|
+
className
|
|
16
|
+
}),
|
|
17
|
+
children: [iconOrLoader, /* @__PURE__ */ jsx(Typography, {
|
|
18
|
+
as: "span",
|
|
19
|
+
size: "label-2",
|
|
20
|
+
variant: "prominent-1",
|
|
21
|
+
...typography,
|
|
22
|
+
className: clsx("hyphens-auto md:truncate", hideText && "sr-only"),
|
|
23
|
+
ref,
|
|
24
|
+
children: text
|
|
25
|
+
})]
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
export { ButtonContent };
|