@povio/ui 2.2.5 → 2.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/AlignCenter.js +3 -1
- package/dist/assets/icons/AlignLeft.js +3 -1
- package/dist/assets/icons/AlignLeftRight.js +3 -1
- package/dist/assets/icons/AlignRight.js +3 -1
- package/dist/assets/icons/ArrowDropDown.js +3 -1
- package/dist/assets/icons/ArrowDropUp.js +3 -1
- package/dist/assets/icons/ArrowLeft.js +3 -1
- package/dist/assets/icons/ArrowRight.js +3 -1
- package/dist/assets/icons/Bold.js +3 -1
- package/dist/assets/icons/BulletedList.js +3 -1
- package/dist/assets/icons/Calendar.js +3 -1
- package/dist/assets/icons/Check.js +3 -1
- package/dist/assets/icons/CheckCircle.js +3 -1
- package/dist/assets/icons/CheckboxCheckmark.js +3 -1
- package/dist/assets/icons/CheckboxIndeterminate.js +3 -1
- package/dist/assets/icons/ChevronDown.js +3 -1
- package/dist/assets/icons/ChevronLeft.js +3 -1
- package/dist/assets/icons/ChevronRight.js +3 -1
- package/dist/assets/icons/ChevronUp.js +3 -1
- package/dist/assets/icons/ChevronsLeft.js +3 -1
- package/dist/assets/icons/ChevronsRight.js +3 -1
- package/dist/assets/icons/Clock.js +3 -1
- package/dist/assets/icons/Close.js +3 -1
- package/dist/assets/icons/DateTime.js +3 -1
- package/dist/assets/icons/DragIndicator.js +3 -1
- package/dist/assets/icons/File.js +3 -1
- package/dist/assets/icons/Highlight.js +3 -1
- package/dist/assets/icons/HighlightOn.js +3 -1
- package/dist/assets/icons/Home.js +3 -1
- package/dist/assets/icons/Info.js +3 -1
- package/dist/assets/icons/Italic.js +3 -1
- package/dist/assets/icons/Link.js +3 -1
- package/dist/assets/icons/Menu.js +3 -1
- package/dist/assets/icons/NumberedList.js +3 -1
- package/dist/assets/icons/PointerHorizontal.js +3 -1
- package/dist/assets/icons/PointerVertical.js +3 -1
- package/dist/assets/icons/Search.js +15 -0
- package/dist/assets/icons/Send.js +3 -1
- package/dist/assets/icons/Strikethrough.js +3 -1
- package/dist/assets/icons/TextColor.js +3 -1
- package/dist/assets/icons/Today.js +3 -1
- package/dist/assets/icons/Underlined.js +3 -1
- package/dist/assets/icons/Upload.js +3 -1
- package/dist/assets/icons/Visibility.js +3 -1
- package/dist/assets/icons/VisibilityOff.js +3 -1
- package/dist/assets/icons/WarningFilled.js +3 -1
- package/dist/assets/locales/en/translation.json.js +1 -0
- package/dist/assets/locales/sl/translation.json.js +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +5 -3
- package/dist/components/Breadcrumbs/breadcrumbs.cva.js +7 -5
- package/dist/components/Menu/Menu.js +3 -1
- package/dist/components/Menu/MenuDesktop.js +3 -1
- package/dist/components/Menu/MenuItem.js +3 -1
- package/dist/components/Menu/MenuMobile.js +4 -1
- package/dist/components/Menu/MenuPopover.js +3 -1
- package/dist/components/Menu/menu.cva.js +6 -4
- package/dist/components/buttons/Button/Button.js +3 -1
- package/dist/components/buttons/Button/button.cva.js +7 -5
- package/dist/components/buttons/IconButton/IconButton.js +3 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +3 -1
- package/dist/components/buttons/PillButton/PillButton.js +3 -1
- package/dist/components/buttons/PillButton/pillButton.cva.js +6 -4
- package/dist/components/buttons/SplitButton/SplitButton.js +3 -1
- package/dist/components/buttons/TextButton/TextButton.js +3 -1
- package/dist/components/buttons/ToggleButton/ToggleButton.js +3 -1
- package/dist/components/buttons/shared/ButtonContent.js +3 -1
- package/dist/components/buttons/shared/buttonContent.cva.js +2 -1
- package/dist/components/inputs/Checkbox/Checkbox.js +4 -2
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +3 -1
- package/dist/components/inputs/Checkbox/checkbox.cva.js +7 -4
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +3 -1
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +10 -8
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +3 -1
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +3 -1
- package/dist/components/inputs/DateTime/shared/Calendar.js +3 -1
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +3 -1
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +3 -1
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +3 -1
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +5 -3
- package/dist/components/inputs/DateTime/shared/DateField.js +3 -1
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +3 -1
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +4 -2
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +6 -14
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +4 -2
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +3 -1
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +3 -1
- package/dist/components/inputs/DateTime/shared/TimeField.js +3 -1
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +3 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +3 -1
- package/dist/components/inputs/DateTime/shared/YearPicker.js +3 -1
- package/dist/components/inputs/File/FileUpload.d.ts +1 -1
- package/dist/components/inputs/File/FileUpload.js +21 -7
- package/dist/components/inputs/File/FileUploadContainer.js +3 -1
- package/dist/components/inputs/File/InputUpload.js +3 -1
- package/dist/components/inputs/File/fileUpload.types.d.ts +11 -1
- package/dist/components/inputs/File/shared/FileCard.js +3 -1
- package/dist/components/inputs/File/shared/FileCardList.js +4 -2
- package/dist/components/inputs/File/shared/FileUploadContent.js +3 -1
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +3 -1
- package/dist/components/inputs/File/shared/FileUploadContentError.js +5 -3
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +6 -4
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +6 -4
- package/dist/components/inputs/File/shared/InputUploadContent.js +4 -2
- package/dist/components/inputs/File/shared/InputUploadFilled.js +3 -1
- package/dist/components/inputs/File/shared/ProgressBar.js +3 -1
- package/dist/components/inputs/File/shared/fileUpload.cva.js +4 -2
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +6 -3
- package/dist/components/inputs/FormField/FormField.js +11 -1
- package/dist/components/inputs/FormField/FormFieldError.js +5 -3
- package/dist/components/inputs/FormField/FormFieldHeader.js +3 -1
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +4 -2
- package/dist/components/inputs/FormField/FormFieldHelper.d.ts +8 -0
- package/dist/components/inputs/FormField/FormFieldHelper.js +14 -0
- package/dist/components/inputs/FormField/FormFieldLabel.js +4 -1
- package/dist/components/inputs/FormField/formFieldError.cva.d.ts +6 -0
- package/dist/components/inputs/FormField/formFieldError.cva.js +11 -0
- package/dist/components/inputs/FormField/formFieldHelper.cva.d.ts +6 -0
- package/dist/components/inputs/FormField/formFieldHelper.cva.js +11 -0
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +3 -1
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +4 -2
- package/dist/components/inputs/Input/TextArea/TextArea.js +3 -1
- package/dist/components/inputs/Input/TextInput/TextInput.js +3 -1
- package/dist/components/inputs/Input/shared/InputContent.js +4 -1
- package/dist/components/inputs/Inputs/Form.js +2 -0
- package/dist/components/inputs/Inputs/InputItem.js +2 -0
- package/dist/components/inputs/Inputs/Inputs.js +2 -0
- package/dist/components/inputs/RadioGroup/RadioGroup.js +6 -4
- package/dist/components/inputs/RadioGroup/radio.cva.js +6 -3
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +3 -1
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +3 -1
- package/dist/components/inputs/Selection/Select/Select.js +3 -1
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/SelectBase.js +5 -2
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +4 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +4 -2
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +3 -1
- package/dist/components/inputs/Selection/shared/SelectListBox.js +4 -2
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +5 -3
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +4 -2
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +4 -2
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +4 -2
- package/dist/components/inputs/Selection/shared/SelectMobile.js +19 -13
- package/dist/components/inputs/Selection/shared/select.context.js +20 -18
- package/dist/components/inputs/Selection/shared/useSelectItems.js +6 -4
- package/dist/components/inputs/Slider/Slider.js +3 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +3 -1
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +3 -1
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +3 -1
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +4 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +4 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +3 -1
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +3 -1
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +3 -1
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +4 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +4 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +4 -2
- package/dist/components/inputs/TextEditor/textEditor.types.js +3 -1
- package/dist/components/inputs/Toggle/Toggle.js +3 -1
- package/dist/components/inputs/Toggle/toggle.cva.js +5 -2
- package/dist/components/inputs/shared/CheckContent.js +4 -1
- package/dist/components/inputs/shared/InputClear.js +5 -3
- package/dist/components/inputs/shared/TooltipWrapper.js +3 -1
- package/dist/components/inputs/shared/input.cva.js +6 -4
- package/dist/components/inputs/shared/label.cva.js +9 -2
- package/dist/components/navigation/Accordion/Accordion.js +3 -1
- package/dist/components/navigation/Accordion/AccordionItem.js +3 -1
- package/dist/components/navigation/Accordion/accordion.cva.js +12 -10
- package/dist/components/navigation/Stepper/Stepper.js +3 -1
- package/dist/components/navigation/Stepper/StepperItem.js +3 -1
- package/dist/components/navigation/Stepper/StepperSeparator.js +3 -1
- package/dist/components/navigation/Stepper/stepper.cva.js +9 -7
- package/dist/components/outline.clsx.js +4 -2
- package/dist/components/overlays/ActionModal/ActionModal.js +3 -1
- package/dist/components/overlays/BottomSheet/BottomSheet.d.ts +5 -0
- package/dist/components/overlays/BottomSheet/BottomSheet.js +23 -7
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.d.ts +13 -0
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +38 -0
- package/dist/components/overlays/Drawer/Drawer.js +3 -1
- package/dist/components/overlays/Modal/Modal.js +4 -2
- package/dist/components/overlays/Modal/modal.cva.js +5 -3
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +7 -10
- package/dist/components/overlays/Tooltip/Tooltip.js +7 -2
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +3 -1
- package/dist/components/overlays/Tooltip/tooltip.cva.js +6 -4
- package/dist/components/segment/Segment.js +3 -1
- package/dist/components/segment/SegmentItem.js +3 -1
- package/dist/components/segment/segment.cva.js +4 -2
- package/dist/components/shared/pagination/Pagination.js +4 -2
- package/dist/components/shared/pagination/PaginationList.js +4 -2
- package/dist/components/shared/pagination/minWidth.cva.js +3 -1
- package/dist/components/shared/popover.cva.js +3 -1
- package/dist/components/status/Alert/Alert.js +3 -1
- package/dist/components/status/Alert/alert.cva.js +3 -1
- package/dist/components/status/Loader/Loader.js +3 -1
- package/dist/components/status/Loader/loader.cva.js +4 -2
- package/dist/components/status/Toast/Toast.js +15 -6
- package/dist/components/status/Toast/toast.cva.js +6 -20
- package/dist/components/status/Toast/useToast.js +3 -1
- package/dist/components/status/shared/status.cva.js +4 -2
- package/dist/components/table/CellText.d.ts +2 -1
- package/dist/components/table/CellText.js +18 -10
- package/dist/components/table/ColumnConfig.js +3 -1
- package/dist/components/table/HeaderText.d.ts +5 -2
- package/dist/components/table/HeaderText.js +17 -7
- package/dist/components/table/InfiniteTable.js +3 -1
- package/dist/components/table/PaginatedTable.js +3 -1
- package/dist/components/table/Table.js +5 -3
- package/dist/components/table/table.cva.d.ts +6 -0
- package/dist/components/table/table.cva.js +9 -5
- package/dist/components/text/Link/Link.js +3 -1
- package/dist/components/text/Link/link.cva.js +3 -1
- package/dist/components/text/Tag/Tag.d.ts +3 -0
- package/dist/components/text/Tag/Tag.js +9 -4
- package/dist/components/text/Tag/tag.cva.js +3 -1
- package/dist/components/text/Typography/Typography.js +3 -1
- package/dist/components/text/Typography/typography.cva.js +3 -1
- package/dist/config/confirmation.context.js +4 -2
- package/dist/config/i18n.js +4 -2
- package/dist/config/link.context.js +3 -1
- package/dist/config/router.context.js +3 -1
- package/dist/config/theme.context.js +8 -6
- package/dist/config/uiConfig.context.d.ts +10 -2
- package/dist/config/uiConfig.context.js +25 -4
- package/dist/config/uiStyle.context.d.ts +9 -1
- package/dist/config/uiStyle.context.js +3 -1
- package/dist/helpers/dynamicColumns.js +4 -2
- package/dist/helpers/dynamicInputs.js +5 -3
- package/dist/hooks/useAutosave.js +2 -0
- package/dist/hooks/useBreakpoint.js +5 -3
- package/dist/hooks/useDebounceCallback.js +2 -0
- package/dist/hooks/useDeepCompare.js +5 -3
- package/dist/hooks/useFilters.js +3 -1
- package/dist/hooks/useForm.js +2 -0
- package/dist/hooks/useFormAutosave.js +2 -0
- package/dist/hooks/useIntersectionObserver.js +3 -1
- package/dist/hooks/useLocalStorage.js +3 -1
- package/dist/hooks/useLongPressRepeat.js +3 -1
- package/dist/hooks/usePagination.js +2 -0
- package/dist/hooks/useScrollableListBox.js +2 -0
- package/dist/hooks/useSorting.js +2 -0
- package/dist/hooks/useStateAndRef.js +3 -1
- package/dist/hooks/useTableColumnConfig.js +2 -0
- package/dist/hooks/useTableNav.js +124 -20
- package/dist/hooks/useTranslationMemo.js +2 -0
- package/dist/index.js +1 -1
- package/dist/tw-ui-plugin.js +4 -2
- package/dist/utils/array.utils.js +3 -1
- package/dist/utils/compoundMapper.js +3 -1
- package/dist/utils/date-time.utils.js +3 -1
- package/dist/utils/date.utils.js +3 -1
- package/dist/utils/dom.utils.js +3 -1
- package/dist/utils/file.utils.d.ts +4 -0
- package/dist/utils/file.utils.js +10 -3
- package/dist/utils/isEqual.js +3 -1
- package/dist/utils/logger.js +3 -1
- package/dist/utils/object.utils.js +3 -1
- package/dist/utils/queries.utils.js +3 -1
- package/dist/utils/rest.utils.js +3 -1
- package/dist/utils/routing.utils.js +3 -1
- package/dist/utils/string.utils.js +3 -1
- package/dist/utils/zod.utils.js +3 -1
- package/package.json +2 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { compoundMapper } from "../../../utils/compoundMapper.js";
|
|
2
2
|
import { clsx } from "clsx";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
|
-
|
|
4
|
+
//#region src/components/status/Toast/toast.cva.ts
|
|
5
|
+
var toastContainer = cva("m-toast-gap-margin-mobile w-auto gap-toast-gap-margin-mobile p-0 md:m-toast-gap-margin-desktop md:gap-toast-gap-margin-desktop", { variants: { position: {
|
|
5
6
|
"bottom-right": "right-0 bottom-0",
|
|
6
7
|
"bottom-left": "bottom-0 left-0",
|
|
7
8
|
"top-right": "top-0 right-0",
|
|
@@ -9,8 +10,8 @@ const toastContainer = cva("m-toast-gap-margin-mobile w-auto p-0 md:m-toast-gap-
|
|
|
9
10
|
"bottom-center": "bottom-0",
|
|
10
11
|
"top-center": "top-0"
|
|
11
12
|
} } });
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
var toastWrapper = clsx("m-0! min-h-0! w-auto! max-w-toast bg-transparent! p-0! shadow-none!");
|
|
14
|
+
var toast = cva("m-0 inline-flex w-auto flex-col items-center overflow-hidden rounded-toast-rounding-default shadow-4 md:flex-row", {
|
|
14
15
|
variants: {
|
|
15
16
|
variant: {
|
|
16
17
|
outlined: "border bg-elevation-fill-default-1 text-text-default-1",
|
|
@@ -32,22 +33,6 @@ const toast = cva("inline-flex w-auto flex-col items-center overflow-hidden roun
|
|
|
32
33
|
}
|
|
33
34
|
},
|
|
34
35
|
compoundVariants: [
|
|
35
|
-
{
|
|
36
|
-
position: [
|
|
37
|
-
"bottom-right",
|
|
38
|
-
"bottom-left",
|
|
39
|
-
"bottom-center"
|
|
40
|
-
],
|
|
41
|
-
className: "mt-toast-gap-margin-mobile md:mt-toast-gap-margin-desktop"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
position: [
|
|
45
|
-
"top-right",
|
|
46
|
-
"top-left",
|
|
47
|
-
"top-center"
|
|
48
|
-
],
|
|
49
|
-
className: "mb-toast-gap-margin-mobile md:mb-toast-gap-margin-desktop"
|
|
50
|
-
},
|
|
51
36
|
{
|
|
52
37
|
variant: "outlined",
|
|
53
38
|
color: "neutral",
|
|
@@ -94,7 +79,7 @@ const toast = cva("inline-flex w-auto flex-col items-center overflow-hidden roun
|
|
|
94
79
|
color: "neutral"
|
|
95
80
|
}
|
|
96
81
|
});
|
|
97
|
-
|
|
82
|
+
var buttonColorVariant = compoundMapper({
|
|
98
83
|
compoundVariants: [
|
|
99
84
|
{
|
|
100
85
|
variant: "outlined",
|
|
@@ -155,4 +140,5 @@ const buttonColorVariant = compoundMapper({
|
|
|
155
140
|
},
|
|
156
141
|
default: { color: "secondary" }
|
|
157
142
|
});
|
|
143
|
+
//#endregion
|
|
158
144
|
export { buttonColorVariant, toast, toastContainer, toastWrapper };
|
|
@@ -2,7 +2,8 @@ import { Toast } from "./Toast.js";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useMemo } from "react";
|
|
4
4
|
import { toast } from "react-toastify";
|
|
5
|
-
|
|
5
|
+
//#region src/components/status/Toast/useToast.tsx
|
|
6
|
+
var useToast = () => {
|
|
6
7
|
const successToast = useCallback((params, options) => {
|
|
7
8
|
return toast.success(/* @__PURE__ */ jsx(Toast, {
|
|
8
9
|
color: "success",
|
|
@@ -60,4 +61,5 @@ const useToast = () => {
|
|
|
60
61
|
closeToast
|
|
61
62
|
]);
|
|
62
63
|
};
|
|
64
|
+
//#endregion
|
|
63
65
|
export { useToast };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
|
|
2
|
+
//#region src/components/status/shared/status.cva.ts
|
|
3
|
+
var statusIcon = cva("size-6 shrink-0", {
|
|
3
4
|
variants: {
|
|
4
5
|
variant: {
|
|
5
6
|
outlined: "",
|
|
@@ -39,7 +40,7 @@ const statusIcon = cva("size-6 shrink-0", {
|
|
|
39
40
|
color: "neutral"
|
|
40
41
|
}
|
|
41
42
|
});
|
|
42
|
-
|
|
43
|
+
var statusSeparator = cva("h-px shrink-0 self-stretch md:h-auto md:w-px", {
|
|
43
44
|
variants: {
|
|
44
45
|
variant: {
|
|
45
46
|
outlined: "",
|
|
@@ -54,4 +55,5 @@ const statusSeparator = cva("h-px shrink-0 self-stretch md:h-auto md:w-px", {
|
|
|
54
55
|
},
|
|
55
56
|
defaultVariants: { color: "neutral" }
|
|
56
57
|
});
|
|
58
|
+
//#endregion
|
|
57
59
|
export { statusIcon, statusSeparator };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, FC, ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
import { TypographyProps } from '../text/Typography/Typography';
|
|
3
|
+
export interface CellTextProps extends Partial<Pick<TypographyProps, "variant" | "size">> {
|
|
3
4
|
children: ReactNode;
|
|
4
5
|
className?: string;
|
|
5
6
|
style?: CSSProperties;
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
+
import { UIStyle } from "../../config/uiStyle.context.js";
|
|
1
2
|
import { Typography } from "../text/Typography/Typography.js";
|
|
3
|
+
import { UIConfig } from "../../config/uiConfig.context.js";
|
|
4
|
+
import { tableCellText } from "./table.cva.js";
|
|
2
5
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
size
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
//#region src/components/table/CellText.tsx
|
|
7
|
+
var CellText = (props) => {
|
|
8
|
+
const uiConfig = UIConfig.useConfig();
|
|
9
|
+
const { variant = uiConfig.tableCellText.variant, size = uiConfig.tableCellText.size, children, style, className } = props;
|
|
10
|
+
return /* @__PURE__ */ jsx(Typography, {
|
|
11
|
+
className: UIStyle.useCva("table.cellTextCva", tableCellText)({ className }),
|
|
12
|
+
as: "span",
|
|
13
|
+
variant,
|
|
14
|
+
size,
|
|
15
|
+
style,
|
|
16
|
+
"data-rac": true,
|
|
17
|
+
children
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
13
21
|
export { CellText };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Typography } from "../text/Typography/Typography.js";
|
|
2
|
+
import "../../config/i18n.js";
|
|
2
3
|
import { Checkbox } from "../inputs/Checkbox/Checkbox.js";
|
|
3
|
-
import { ns } from "../../config/i18n.js";
|
|
4
4
|
import { Modal } from "../overlays/Modal/Modal.js";
|
|
5
5
|
import { Table } from "./Table.js";
|
|
6
6
|
import { useTranslationMemo } from "../../hooks/useTranslationMemo.js";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { useCallback, useEffect, useState } from "react";
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
|
+
//#region src/components/table/ColumnConfig.tsx
|
|
10
11
|
var VisibilityCell = ({ original, onToggle }) => /* @__PURE__ */ jsx(Checkbox, {
|
|
11
12
|
isSelected: original.visible,
|
|
12
13
|
onChange: () => onToggle(original.id),
|
|
@@ -78,4 +79,5 @@ function ColumnConfigModal({ isOpen, onClose, configColumns, visibleColumns, onV
|
|
|
78
79
|
})
|
|
79
80
|
});
|
|
80
81
|
}
|
|
82
|
+
//#endregion
|
|
81
83
|
export { ColumnConfigModal };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { FC, ReactNode } from 'react';
|
|
2
|
-
|
|
1
|
+
import { CSSProperties, FC, ReactNode } from 'react';
|
|
2
|
+
import { TypographyProps } from '../text/Typography/Typography';
|
|
3
|
+
export interface HeaderTextProps extends Partial<Pick<TypographyProps, "variant" | "size">> {
|
|
3
4
|
children: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: CSSProperties;
|
|
4
7
|
}
|
|
5
8
|
export declare const HeaderText: FC<HeaderTextProps>;
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
+
import { UIStyle } from "../../config/uiStyle.context.js";
|
|
1
2
|
import { Typography } from "../text/Typography/Typography.js";
|
|
3
|
+
import { UIConfig } from "../../config/uiConfig.context.js";
|
|
4
|
+
import { tableHeaderText } from "./table.cva.js";
|
|
2
5
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
//#region src/components/table/HeaderText.tsx
|
|
7
|
+
var HeaderText = (props) => {
|
|
8
|
+
const uiConfig = UIConfig.useConfig();
|
|
9
|
+
const { variant = uiConfig.tableHeaderText.variant, size = uiConfig.tableHeaderText.size, children, style, className } = props;
|
|
10
|
+
return /* @__PURE__ */ jsx(Typography, {
|
|
11
|
+
className: UIStyle.useCva("table.headerTextCva", tableHeaderText)({ className }),
|
|
12
|
+
as: "span",
|
|
13
|
+
variant,
|
|
14
|
+
size,
|
|
15
|
+
style,
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
10
20
|
export { HeaderText };
|
|
@@ -3,7 +3,8 @@ import { useIntersectionObserver } from "../../hooks/useIntersectionObserver.js"
|
|
|
3
3
|
import { Table } from "./Table.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { useCallback } from "react";
|
|
6
|
-
|
|
6
|
+
//#region src/components/table/InfiniteTable.tsx
|
|
7
|
+
var InfiniteTable = ({ hasNextPage, isFetchingNextPage = false, fetchNextPage, ...rest }) => {
|
|
7
8
|
const { ref } = useIntersectionObserver({
|
|
8
9
|
onIntersection: useCallback(() => {
|
|
9
10
|
if (!isFetchingNextPage && hasNextPage) fetchNextPage();
|
|
@@ -23,4 +24,5 @@ const InfiniteTable = ({ hasNextPage, isFetchingNextPage = false, fetchNextPage,
|
|
|
23
24
|
})]
|
|
24
25
|
});
|
|
25
26
|
};
|
|
27
|
+
//#endregion
|
|
26
28
|
export { InfiniteTable };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Pagination } from "../shared/pagination/Pagination.js";
|
|
2
2
|
import { Table } from "./Table.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
//#region src/components/table/PaginatedTable.tsx
|
|
5
|
+
var PaginatedTable = ({ pagination, setPagination, items, totalItems, ...rest }) => {
|
|
5
6
|
return /* @__PURE__ */ jsxs("div", {
|
|
6
7
|
className: "flex flex-col gap-4",
|
|
7
8
|
children: [/* @__PURE__ */ jsx(Table, {
|
|
@@ -23,4 +24,5 @@ const PaginatedTable = ({ pagination, setPagination, items, totalItems, ...rest
|
|
|
23
24
|
})]
|
|
24
25
|
});
|
|
25
26
|
};
|
|
27
|
+
//#endregion
|
|
26
28
|
export { PaginatedTable };
|
|
@@ -3,11 +3,11 @@ import { ChevronUpIcon } from "../../assets/icons/ChevronUp.js";
|
|
|
3
3
|
import { UIStyle } from "../../config/uiStyle.context.js";
|
|
4
4
|
import { InlineIconButton } from "../buttons/InlineIconButton/InlineIconButton.js";
|
|
5
5
|
import { useIntersectionObserver } from "../../hooks/useIntersectionObserver.js";
|
|
6
|
+
import { tableData, tableHeadData, tableHeadRow, tableRow } from "./table.cva.js";
|
|
6
7
|
import { CellText } from "./CellText.js";
|
|
7
8
|
import { DragIndicatorIcon } from "../../assets/icons/DragIndicator.js";
|
|
8
9
|
import { HeaderText } from "./HeaderText.js";
|
|
9
10
|
import { useTableNav } from "../../hooks/useTableNav.js";
|
|
10
|
-
import { tableData, tableHeadData, tableHeadRow, tableRow } from "./table.cva.js";
|
|
11
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
import { clsx } from "clsx";
|
|
13
13
|
import { useCallback, useMemo, useRef, useState } from "react";
|
|
@@ -17,6 +17,7 @@ import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
|
|
|
17
17
|
import { SortableContext, arrayMove, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
18
18
|
import { CSS } from "@dnd-kit/utilities";
|
|
19
19
|
import { flexRender, getCoreRowModel, getPaginationRowModel, getSortedRowModel, useReactTable } from "@tanstack/react-table";
|
|
20
|
+
//#region src/components/table/Table.tsx
|
|
20
21
|
var CustomCellContext = (context) => {
|
|
21
22
|
return {
|
|
22
23
|
...context,
|
|
@@ -29,7 +30,7 @@ var CellRender = (Comp, props) => {
|
|
|
29
30
|
const rendered = typeof Comp === "function" ? Comp(props) : Comp;
|
|
30
31
|
return typeof rendered === "string" ? /* @__PURE__ */ jsx(CellText, { children: rendered }) : rendered;
|
|
31
32
|
};
|
|
32
|
-
|
|
33
|
+
var RowDragHandleCell = ({ rowId }) => {
|
|
33
34
|
const { attributes, listeners } = useSortable({ id: rowId });
|
|
34
35
|
return /* @__PURE__ */ jsx(InlineIconButton, {
|
|
35
36
|
...attributes,
|
|
@@ -72,7 +73,7 @@ var DraggableRow = ({ row, showCellBorder, onRowClick, onDoubleClick, tableRowCv
|
|
|
72
73
|
})
|
|
73
74
|
});
|
|
74
75
|
};
|
|
75
|
-
|
|
76
|
+
var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, className, sorting, setSorting, columnOrder, setColumnOrder, columnVisibility, setColumnVisibility, bulkSelectionActions: ActionHeader, enableDragDrop = false, onDragEnd, onReorder, getRowId, enableRowSelection, enableMultiRowSelection = false, defaultSelectedRows, onRowSelectionChange, ...props }) => {
|
|
76
77
|
const tableRowCva = UIStyle.useCva("table.rowCva", tableRow);
|
|
77
78
|
const tableHeadRowCva = UIStyle.useCva("table.headRowCva", tableHeadRow);
|
|
78
79
|
const tableHeadDataCva = UIStyle.useCva("table.headDataCva", tableHeadData);
|
|
@@ -260,4 +261,5 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
260
261
|
});
|
|
261
262
|
return tableElement;
|
|
262
263
|
};
|
|
264
|
+
//#endregion
|
|
263
265
|
export { Table };
|
|
@@ -17,3 +17,9 @@ export declare const tableData: (props?: ({
|
|
|
17
17
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
18
18
|
export interface TableDataVariantProps extends VariantProps<typeof tableData> {
|
|
19
19
|
}
|
|
20
|
+
export declare const tableHeaderText: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
21
|
+
export interface TableHeaderTextVariantProps extends VariantProps<typeof tableHeaderText> {
|
|
22
|
+
}
|
|
23
|
+
export declare const tableCellText: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
24
|
+
export interface TableCellTextVariantProps extends VariantProps<typeof tableCellText> {
|
|
25
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
|
|
2
|
+
//#region src/components/table/table.cva.ts
|
|
3
|
+
var tableRow = cva([
|
|
3
4
|
"h-9 max-h-12",
|
|
4
5
|
"hover:bg-elevation-fill-default-2",
|
|
5
6
|
"disabled:opacity-50",
|
|
@@ -11,15 +12,15 @@ const tableRow = cva([
|
|
|
11
12
|
even: "even:bg-elevation-fill-inverted-4/5",
|
|
12
13
|
odd: "odd:bg-elevation-fill-inverted-4/5"
|
|
13
14
|
} } });
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
var tableHeadRow = cva(["h-8 w-full"]);
|
|
16
|
+
var tableHeadData = cva(["border-b border-b-elevation-outline-default-1 border-solid px-table-header-cell-container-side-default py-table-header-cell-container-height-default text-left", "group-data-[is-sticky=true]/table-head:bg-elevation-fill-default-1"], {
|
|
16
17
|
variants: { hasRightBorder: {
|
|
17
18
|
true: "border-l border-l-elevation-outline-default-1 border-solid",
|
|
18
19
|
false: ""
|
|
19
20
|
} },
|
|
20
21
|
defaultVariants: { hasRightBorder: true }
|
|
21
22
|
});
|
|
22
|
-
|
|
23
|
+
var tableData = cva([
|
|
23
24
|
"relative h-0-5 overflow-hidden text-ellipsis whitespace-nowrap border-t border-t-transparent px-2",
|
|
24
25
|
"border-b border-b-elevation-outline-default-1",
|
|
25
26
|
"has-[*>[data-hovered]:not([data-disabled])]:hover:border-b-input-outlined-outline-hover",
|
|
@@ -32,4 +33,7 @@ const tableData = cva([
|
|
|
32
33
|
} },
|
|
33
34
|
defaultVariants: { hasRightBorder: true }
|
|
34
35
|
});
|
|
35
|
-
|
|
36
|
+
var tableHeaderText = cva(["overflow-hidden text-ellipsis px-table-cell-content-side-m py-table-cell-content-height-m text-text-default-1"]);
|
|
37
|
+
var tableCellText = cva(["block overflow-hidden text-ellipsis text-text-default-2"]);
|
|
38
|
+
//#endregion
|
|
39
|
+
export { tableCellText, tableData, tableHeadData, tableHeadRow, tableHeaderText, tableRow };
|
|
@@ -3,7 +3,8 @@ import { LinkContext } from "../../../config/link.context.js";
|
|
|
3
3
|
import { link } from "./link.cva.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { Link } from "react-aria-components";
|
|
6
|
-
|
|
6
|
+
//#region src/components/text/Link/Link.tsx
|
|
7
|
+
var Link$1 = ({ variant, ...props }) => {
|
|
7
8
|
const linkContext = LinkContext.useLinkContext();
|
|
8
9
|
const linkCva = UIStyle.useCva("link.cva", link);
|
|
9
10
|
const LinkComponent = linkContext?.LinkComponent ?? Link;
|
|
@@ -16,4 +17,5 @@ const Link$1 = ({ variant, ...props }) => {
|
|
|
16
17
|
})
|
|
17
18
|
});
|
|
18
19
|
};
|
|
20
|
+
//#endregion
|
|
19
21
|
export { Link$1 as Link };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { uiOutlineClass } from "../../outline.clsx.js";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
|
-
|
|
3
|
+
//#region src/components/text/Link/link.cva.ts
|
|
4
|
+
var link = cva(["underline", uiOutlineClass], {
|
|
4
5
|
variants: { variant: { default: ["text-interactive-text-primary-idle focus-visible:outline-interactive-text-primary-focus", "hover:text-interactive-text-primary-hover focus-visible:text-interactive-text-primary-focus active:text-interactive-text-primary-pressed"] } },
|
|
5
6
|
defaultVariants: { variant: "default" }
|
|
6
7
|
});
|
|
8
|
+
//#endregion
|
|
7
9
|
export { link };
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
2
|
import { ButtonProps as AriaButtonProps } from 'react-aria-components';
|
|
3
3
|
import { TagVariantProps } from './tag.cva';
|
|
4
|
+
import { TypographyProps } from '../Typography/Typography';
|
|
4
5
|
export interface TagProps extends TagVariantProps, AriaButtonProps {
|
|
5
6
|
className?: string;
|
|
6
7
|
children: string;
|
|
7
8
|
dismissable?: boolean;
|
|
8
9
|
isDisabled?: boolean;
|
|
9
10
|
contentRef?: Ref<HTMLElement>;
|
|
11
|
+
textVariant?: TypographyProps["variant"];
|
|
12
|
+
textSize?: TypographyProps["size"];
|
|
10
13
|
onDismiss?: () => void;
|
|
11
14
|
}
|
|
12
15
|
export declare const Tag: ({ className, children, dismissable, isDisabled, onDismiss, contentRef, ...props }: TagProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { CloseIcon } from "../../../assets/icons/Close.js";
|
|
2
2
|
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
3
3
|
import { Typography } from "../Typography/Typography.js";
|
|
4
|
-
import {
|
|
4
|
+
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
5
|
+
import "../../../config/i18n.js";
|
|
5
6
|
import { tag } from "./tag.cva.js";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import { clsx } from "clsx";
|
|
8
9
|
import { Button } from "react-aria-components";
|
|
9
10
|
import { useTranslation } from "react-i18next";
|
|
10
|
-
|
|
11
|
+
//#region src/components/text/Tag/Tag.tsx
|
|
12
|
+
var Tag = ({ className, children, dismissable, isDisabled, onDismiss, contentRef, ...props }) => {
|
|
13
|
+
const uiConfig = UIConfig.useConfig();
|
|
14
|
+
const { textVariant = uiConfig.tag.textVariant, textSize = uiConfig.tag.textSize } = props;
|
|
11
15
|
const tagCva = UIStyle.useCva("tag.cva", tag);
|
|
12
16
|
const { t } = useTranslation("ui");
|
|
13
17
|
const buttonProps = {
|
|
@@ -23,8 +27,8 @@ const Tag = ({ className, children, dismissable, isDisabled, onDismiss, contentR
|
|
|
23
27
|
}),
|
|
24
28
|
children: [/* @__PURE__ */ jsx(Typography, {
|
|
25
29
|
ref: contentRef,
|
|
26
|
-
variant:
|
|
27
|
-
size:
|
|
30
|
+
variant: textVariant,
|
|
31
|
+
size: textSize,
|
|
28
32
|
as: "span",
|
|
29
33
|
className: "truncate",
|
|
30
34
|
children
|
|
@@ -35,4 +39,5 @@ const Tag = ({ className, children, dismissable, isDisabled, onDismiss, contentR
|
|
|
35
39
|
})]
|
|
36
40
|
});
|
|
37
41
|
};
|
|
42
|
+
//#endregion
|
|
38
43
|
export { Tag };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { uiOutlineClass } from "../../outline.clsx.js";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
|
-
|
|
3
|
+
//#region src/components/text/Tag/tag.cva.ts
|
|
4
|
+
var tag = cva([
|
|
4
5
|
uiOutlineClass,
|
|
5
6
|
"inline-flex items-center gap-list-gap-icon-to-label",
|
|
6
7
|
"p-pill-height-s px-1-5",
|
|
@@ -47,4 +48,5 @@ const tag = cva([
|
|
|
47
48
|
} },
|
|
48
49
|
defaultVariants: { color: "primary" }
|
|
49
50
|
});
|
|
51
|
+
//#endregion
|
|
50
52
|
export { tag };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
2
2
|
import { typography } from "./typography.cva.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
//#region src/components/text/Typography/Typography.tsx
|
|
5
|
+
var Typography = ({ as = "p", className, ...props }) => {
|
|
5
6
|
return /* @__PURE__ */ jsx(as, {
|
|
6
7
|
className: UIStyle.useCva("typography.cva", typography)({
|
|
7
8
|
...props,
|
|
@@ -11,4 +12,5 @@ const Typography = ({ as = "p", className, ...props }) => {
|
|
|
11
12
|
...props
|
|
12
13
|
});
|
|
13
14
|
};
|
|
15
|
+
//#endregion
|
|
14
16
|
export { Typography };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
|
|
2
|
+
//#region src/components/text/Typography/typography.cva.ts
|
|
3
|
+
var typography = cva("", {
|
|
3
4
|
variants: {
|
|
4
5
|
size: {
|
|
5
6
|
"headline-1": "md:text-desktop-headline-1",
|
|
@@ -121,4 +122,5 @@ const typography = cva("", {
|
|
|
121
122
|
}
|
|
122
123
|
]
|
|
123
124
|
});
|
|
125
|
+
//#endregion
|
|
124
126
|
export { typography };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./i18n.js";
|
|
2
2
|
import { ActionModal } from "../components/overlays/ActionModal/ActionModal.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { createContext, use, useCallback, useMemo, useState } from "react";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
|
-
|
|
6
|
+
//#region src/config/confirmation.context.tsx
|
|
7
|
+
var Confirmation;
|
|
7
8
|
(function(_Confirmation) {
|
|
8
9
|
const DEFAULT_STATE = {
|
|
9
10
|
heading: "",
|
|
@@ -75,4 +76,5 @@ let Confirmation;
|
|
|
75
76
|
return context;
|
|
76
77
|
};
|
|
77
78
|
})(Confirmation || (Confirmation = {}));
|
|
79
|
+
//#endregion
|
|
78
80
|
export { Confirmation };
|
package/dist/config/i18n.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import translation_default from "../assets/locales/en/translation.json.js";
|
|
2
2
|
import translation_default$1 from "../assets/locales/sl/translation.json.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
//#region src/config/i18n.ts
|
|
4
|
+
var ns = "ui";
|
|
5
|
+
var resources = {
|
|
5
6
|
en: { ["ui"]: translation_default },
|
|
6
7
|
sl: { ["ui"]: translation_default$1 }
|
|
7
8
|
};
|
|
9
|
+
//#endregion
|
|
8
10
|
export { ns, resources };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, use } from "react";
|
|
3
|
-
|
|
3
|
+
//#region src/config/link.context.tsx
|
|
4
|
+
var LinkContext;
|
|
4
5
|
(function(_LinkContext) {
|
|
5
6
|
const LinkContextInternal = createContext(null);
|
|
6
7
|
_LinkContext.LinkContextProvider = ({ children, LinkComponent }) => {
|
|
@@ -14,4 +15,5 @@ let LinkContext;
|
|
|
14
15
|
return use(LinkContextInternal);
|
|
15
16
|
};
|
|
16
17
|
})(LinkContext || (LinkContext = {}));
|
|
18
|
+
//#endregion
|
|
17
19
|
export { LinkContext };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, use, useMemo } from "react";
|
|
3
3
|
import { RouterProvider } from "react-aria";
|
|
4
|
-
|
|
4
|
+
//#region src/config/router.context.tsx
|
|
5
|
+
var UIRouter;
|
|
5
6
|
(function(_UIRouter) {
|
|
6
7
|
const UIRouterContext = createContext(null);
|
|
7
8
|
_UIRouter.UIRouterProvider = ({ children, pathname, push, replace, searchString }) => {
|
|
@@ -34,4 +35,5 @@ let UIRouter;
|
|
|
34
35
|
return context;
|
|
35
36
|
};
|
|
36
37
|
})(UIRouter || (UIRouter = {}));
|
|
38
|
+
//#endregion
|
|
37
39
|
export { UIRouter };
|
|
@@ -2,7 +2,8 @@ import { useLocalStorage } from "../hooks/useLocalStorage.js";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, use, useCallback, useEffect, useMemo, useState } from "react";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
5
|
+
//#region src/config/theme.context.tsx
|
|
6
|
+
var ThemeContext;
|
|
6
7
|
(function(_ThemeContext) {
|
|
7
8
|
const DEFAULT_STORAGE_KEY = "theme";
|
|
8
9
|
const ThemeSchema = z.literal([
|
|
@@ -10,7 +11,7 @@ let ThemeContext;
|
|
|
10
11
|
"dark",
|
|
11
12
|
"system"
|
|
12
13
|
]);
|
|
13
|
-
const ThemeContext
|
|
14
|
+
const ThemeContext = createContext(null);
|
|
14
15
|
_ThemeContext.ThemeContextProvider = ({ children, storageKey = DEFAULT_STORAGE_KEY }) => {
|
|
15
16
|
const [systemTheme, setSystemTheme] = useState(() => {
|
|
16
17
|
if (typeof window === "undefined") return;
|
|
@@ -20,8 +21,8 @@ let ThemeContext;
|
|
|
20
21
|
key: storageKey,
|
|
21
22
|
schema: ThemeSchema
|
|
22
23
|
});
|
|
23
|
-
const updateTheme = useCallback((theme
|
|
24
|
-
set(theme
|
|
24
|
+
const updateTheme = useCallback((theme) => {
|
|
25
|
+
set(theme);
|
|
25
26
|
}, [set]);
|
|
26
27
|
useEffect(() => {
|
|
27
28
|
if (typeof window === "undefined") return;
|
|
@@ -53,13 +54,14 @@ let ThemeContext;
|
|
|
53
54
|
systemTheme,
|
|
54
55
|
updateTheme
|
|
55
56
|
]);
|
|
56
|
-
return /* @__PURE__ */ jsx(ThemeContext
|
|
57
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, {
|
|
57
58
|
value: contextValue,
|
|
58
59
|
children
|
|
59
60
|
});
|
|
60
61
|
};
|
|
61
62
|
_ThemeContext.useTheme = () => {
|
|
62
|
-
return use(ThemeContext
|
|
63
|
+
return use(ThemeContext);
|
|
63
64
|
};
|
|
64
65
|
})(ThemeContext || (ThemeContext = {}));
|
|
66
|
+
//#endregion
|
|
65
67
|
export { ThemeContext };
|
|
@@ -10,6 +10,10 @@ import { SliderProps } from '../components/inputs/Slider/Slider';
|
|
|
10
10
|
import { ToggleProps } from '../components/inputs/Toggle/Toggle';
|
|
11
11
|
import { ActionModalProps } from '../components/overlays/ActionModal/ActionModal';
|
|
12
12
|
import { BottomSheetProps } from '../components/overlays/BottomSheet/BottomSheet';
|
|
13
|
+
import { ToastProps } from '../components/status/Toast/Toast';
|
|
14
|
+
import { CellTextProps } from '../components/table/CellText';
|
|
15
|
+
import { HeaderTextProps } from '../components/table/HeaderText';
|
|
16
|
+
import { TagProps } from '../components/text/Tag/Tag';
|
|
13
17
|
export declare namespace UIConfig {
|
|
14
18
|
type DeepRequired<T> = {
|
|
15
19
|
[P in keyof T]-?: T[P] extends object ? DeepRequired<T[P]> : Exclude<T[P], null | undefined>;
|
|
@@ -20,12 +24,16 @@ export declare namespace UIConfig {
|
|
|
20
24
|
numberInput: Pick<NumberInputProps, "formatOptions">;
|
|
21
25
|
radioGroup: Pick<RadioGroupProps, "variant" | "hideLabel">;
|
|
22
26
|
checkbox: Pick<CheckboxProps, "variant">;
|
|
23
|
-
select: Pick<SelectBaseProps, "selectionMode" | "isSearchable" | "collapseAfter" | "selectedTagsType">;
|
|
27
|
+
select: Pick<SelectBaseProps, "selectionMode" | "isSearchable" | "collapseAfter" | "selectedTagsType" | "hideSearchIcon">;
|
|
24
28
|
toggle: Pick<ToggleProps, "variant">;
|
|
25
29
|
slider: Pick<SliderProps, "minValue" | "maxValue">;
|
|
26
30
|
dateInput: Pick<DatePickerProps, "todayIcon" | "shouldForceLeadingZeros" | "disableManualEntry">;
|
|
27
31
|
actionModal: Pick<ActionModalProps, "titleTypography" | "descriptionTypography">;
|
|
28
|
-
bottomSheet: Pick<BottomSheetProps, "closeDragThreshold" | "closeVelocityThreshold">;
|
|
32
|
+
bottomSheet: Pick<BottomSheetProps, "closeDragThreshold" | "closeVelocityThreshold" | "hideThumb" | "headerTypography">;
|
|
33
|
+
tableHeaderText: Pick<HeaderTextProps, "variant" | "size">;
|
|
34
|
+
tableCellText: Pick<CellTextProps, "variant" | "size">;
|
|
35
|
+
tag: Pick<TagProps, "textVariant" | "textSize">;
|
|
36
|
+
toast: Pick<ToastProps, "variant">;
|
|
29
37
|
}
|
|
30
38
|
interface ProviderProps {
|
|
31
39
|
config?: Partial<Options>;
|