@povio/ui 3.0.0-rc.3 → 3.1.0
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 +39 -0
- package/dist/assets/icons/AlignCenter.js +11 -26
- package/dist/assets/icons/AlignLeft.js +11 -26
- package/dist/assets/icons/AlignLeftRight.js +11 -26
- package/dist/assets/icons/AlignRight.js +11 -26
- package/dist/assets/icons/ArrowDropDown.js +11 -26
- package/dist/assets/icons/ArrowDropUp.js +11 -26
- package/dist/assets/icons/ArrowLeft.js +11 -26
- package/dist/assets/icons/ArrowRight.js +11 -26
- package/dist/assets/icons/Bold.js +11 -26
- package/dist/assets/icons/BulletedList.js +11 -26
- package/dist/assets/icons/Calendar.js +13 -28
- package/dist/assets/icons/Check.js +13 -28
- package/dist/assets/icons/CheckCircle.js +11 -26
- package/dist/assets/icons/CheckboxCheckmark.js +14 -29
- package/dist/assets/icons/CheckboxIndeterminate.js +14 -29
- package/dist/assets/icons/ChevronDown.js +13 -28
- package/dist/assets/icons/ChevronLeft.js +13 -28
- package/dist/assets/icons/ChevronRight.js +13 -28
- package/dist/assets/icons/ChevronUp.js +13 -28
- package/dist/assets/icons/ChevronsLeft.js +13 -28
- package/dist/assets/icons/ChevronsRight.js +13 -28
- package/dist/assets/icons/Clock.js +11 -26
- package/dist/assets/icons/Close.js +11 -26
- package/dist/assets/icons/DateTime.js +14 -35
- package/dist/assets/icons/DragIndicator.js +11 -26
- package/dist/assets/icons/File.js +13 -28
- package/dist/assets/icons/Highlight.js +11 -26
- package/dist/assets/icons/HighlightOn.js +15 -49
- package/dist/assets/icons/Home.js +11 -26
- package/dist/assets/icons/Info.js +16 -37
- package/dist/assets/icons/Italic.js +11 -26
- package/dist/assets/icons/Link.js +11 -26
- package/dist/assets/icons/Menu.js +11 -26
- package/dist/assets/icons/NumberedList.js +11 -26
- package/dist/assets/icons/PointerHorizontal.js +11 -26
- package/dist/assets/icons/PointerVertical.js +11 -26
- package/dist/assets/icons/Search.js +11 -26
- package/dist/assets/icons/Send.js +13 -28
- package/dist/assets/icons/Strikethrough.js +11 -26
- package/dist/assets/icons/TextColor.js +14 -48
- package/dist/assets/icons/Today.js +11 -26
- package/dist/assets/icons/Underlined.js +13 -28
- package/dist/assets/icons/Upload.js +14 -35
- package/dist/assets/icons/Visibility.js +11 -26
- package/dist/assets/icons/VisibilityOff.js +11 -26
- package/dist/assets/icons/WarningFilled.js +13 -28
- package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
- package/dist/components/Menu/Menu.d.ts +4 -0
- package/dist/components/Menu/Menu.js +2 -18
- package/dist/components/Menu/MenuDesktop.js +7 -41
- package/dist/components/Menu/MenuItem.js +9 -32
- package/dist/components/Menu/MenuMobile.d.ts +1 -1
- package/dist/components/Menu/MenuMobile.js +39 -97
- package/dist/components/Menu/MenuPopover.js +29 -105
- package/dist/components/buttons/IconButton/IconButton.js +8 -40
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
- package/dist/components/buttons/PillButton/PillButton.js +17 -55
- package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
- package/dist/components/buttons/TextButton/TextButton.js +8 -30
- package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
- package/dist/components/buttons/shared/ButtonContent.js +22 -80
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +0 -1
- package/dist/components/inputs/Checkbox/Checkbox.js +35 -201
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
- package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -12
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +75 -373
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -12
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +186 -492
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -14
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +47 -273
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -7
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +121 -611
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +3 -5
- package/dist/components/inputs/DateTime/shared/Calendar.js +120 -338
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -4
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +103 -310
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -4
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -150
- package/dist/components/inputs/DateTime/shared/CalendarHeader.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +98 -249
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
- package/dist/components/inputs/DateTime/shared/DateField.js +112 -286
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -14
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +129 -356
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -15
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -96
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +28 -81
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
- package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +110 -279
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -4
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -210
- package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
- package/dist/components/inputs/File/FileUpload.js +45 -88
- package/dist/components/inputs/File/FileUploadContainer.js +7 -15
- package/dist/components/inputs/File/InputUpload.js +79 -317
- package/dist/components/inputs/File/shared/FileCard.js +41 -104
- package/dist/components/inputs/File/shared/FileCardList.js +12 -47
- package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
- package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
- package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
- package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
- package/dist/components/inputs/File/shared/ProgressBar.d.ts +2 -2
- package/dist/components/inputs/File/shared/ProgressBar.js +20 -53
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +1 -1
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -1
- package/dist/components/inputs/File/shared/progressBar.cva.d.ts +38 -0
- package/dist/components/inputs/File/shared/progressBar.cva.js +28 -0
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +37 -119
- package/dist/components/inputs/FormField/FormFieldError.js +5 -25
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
- package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +97 -447
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
- package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
- package/dist/components/inputs/Input/TextInput/TextInput.js +90 -419
- package/dist/components/inputs/Input/shared/InputContent.js +59 -192
- package/dist/components/inputs/Inputs/Form.js +11 -40
- package/dist/components/inputs/Inputs/InputItem.d.ts +21 -15
- package/dist/components/inputs/Inputs/InputItem.js +14 -69
- package/dist/components/inputs/Inputs/Inputs.js +11 -37
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -3
- package/dist/components/inputs/RadioGroup/RadioGroup.js +61 -353
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -45
- package/dist/components/inputs/RadioGroup/radio.cva.js +1 -48
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +22 -217
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -107
- package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
- package/dist/components/inputs/Selection/Select/Select.js +18 -227
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +3 -8
- package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +116 -397
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +21 -70
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +6 -11
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/select.context.js +36 -67
- package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
- package/dist/components/inputs/Slider/Slider.d.ts +1 -2
- package/dist/components/inputs/Slider/Slider.js +76 -265
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
- package/dist/components/inputs/Toggle/Toggle.d.ts +0 -1
- package/dist/components/inputs/Toggle/Toggle.js +37 -214
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
- package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
- package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
- package/dist/components/inputs/shared/CheckContent.js +11 -21
- package/dist/components/inputs/shared/InputClear.d.ts +1 -2
- package/dist/components/inputs/shared/InputClear.js +12 -88
- package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
- package/dist/components/inputs/shared/input.cva.d.ts +0 -28
- package/dist/components/inputs/shared/input.cva.js +4 -38
- package/dist/components/navigation/Accordion/Accordion.js +22 -69
- package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
- package/dist/components/navigation/Stepper/Stepper.js +22 -67
- package/dist/components/navigation/Stepper/StepperItem.js +31 -104
- package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
- package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
- package/dist/components/overlays/BottomSheet/BottomSheet.js +25 -98
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
- package/dist/components/overlays/Drawer/Drawer.js +22 -64
- package/dist/components/overlays/Modal/modal.cva.js +1 -1
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.d.ts +5 -1
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +28 -83
- package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
- package/dist/components/segment/Segment.js +57 -218
- package/dist/components/segment/SegmentItem.js +10 -67
- package/dist/components/shared/pagination/Pagination.js +22 -108
- package/dist/components/shared/pagination/PaginationList.js +64 -167
- package/dist/components/status/Alert/Alert.js +30 -97
- package/dist/components/status/Loader/Loader.js +22 -77
- package/dist/components/status/Toast/Toast.js +17 -22
- package/dist/components/status/Toast/toast.cva.d.ts +14 -3
- package/dist/components/status/Toast/toast.cva.js +12 -10
- package/dist/components/status/Toast/useToast.js +57 -62
- package/dist/components/table/ColumnConfig.js +54 -158
- package/dist/components/table/InfiniteTable.js +16 -67
- package/dist/components/table/PaginatedTable.js +18 -84
- package/dist/components/table/Table.js +30 -30
- package/dist/components/table/table.cva.d.ts +7 -0
- package/dist/components/table/table.cva.js +2 -1
- package/dist/components/text/Link/Link.js +7 -19
- package/dist/components/text/Pill/Pill.d.ts +15 -0
- package/dist/components/text/Pill/Pill.js +44 -0
- package/dist/components/text/Typography/Typography.js +8 -23
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +9 -23
- package/dist/config/router.context.js +16 -42
- package/dist/config/theme.context.js +45 -98
- package/dist/config/uiConfig.context.d.ts +10 -21
- package/dist/config/uiConfig.context.js +18 -69
- package/dist/config/uiOverrides.context.d.ts +10 -20
- package/dist/config/uiOverrides.context.js +14 -54
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +0 -3
- package/dist/hooks/useAutosave.d.ts +1 -2
- package/dist/hooks/useAutosave.js +4 -12
- package/dist/hooks/useBreakpoint.js +3 -16
- package/dist/hooks/useDebounceCallback.js +17 -51
- package/dist/hooks/useFilters.js +64 -125
- package/dist/hooks/useForm.js +8 -42
- package/dist/hooks/useFormAutosave.d.ts +1 -3
- package/dist/hooks/useFormAutosave.js +30 -122
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +24 -91
- package/dist/hooks/useLocalStorage.js +10 -43
- package/dist/hooks/useLongPressRepeat.js +20 -55
- package/dist/hooks/usePagination.js +19 -49
- package/dist/hooks/useScrollableListBox.js +16 -37
- package/dist/hooks/useSorting.js +28 -69
- package/dist/hooks/useStateAndRef.js +7 -21
- package/dist/hooks/useTableColumnConfig.js +31 -124
- package/dist/hooks/useTranslationMemo.js +5 -25
- package/dist/index.d.ts +7 -16
- package/dist/index.js +6 -13
- package/dist/tw-ui-plugin.js +0 -6
- package/dist/utils/date-time.utils.d.ts +10 -38
- package/dist/utils/date-time.utils.js +22 -136
- package/package.json +1 -1
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -5
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -16
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -16
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -15
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -32
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -40
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -85
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -13
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -14
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -575
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -8
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -37
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
- package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -178
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -14
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -43
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -6
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -12
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -8
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -54
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -82
- package/dist/components/inputs/Skeleton/InputFrame.js +0 -548
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -8
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
- package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
- package/dist/hooks/useAutosave.spec.d.ts +0 -1
- package/dist/hooks/useFormAutosave.spec.d.ts +0 -1
- package/dist/hooks/useKeyInteractions.d.ts +0 -20
- package/dist/hooks/useKeyInteractions.js +0 -54
- package/dist/hooks/useKeyInteractions.spec.d.ts +0 -1
- package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
- package/dist/hooks/useQueryAutocomplete.js +0 -72
- package/dist/utils/query.utils.d.ts +0 -4
- package/dist/utils/query.utils.js +0 -8
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
"use no memo";
|
|
2
1
|
import { ChevronDownIcon } from "../../assets/icons/ChevronDown.js";
|
|
3
2
|
import { ChevronUpIcon } from "../../assets/icons/ChevronUp.js";
|
|
4
3
|
import { UIOverrides } from "../../config/uiOverrides.context.js";
|
|
5
4
|
import { InlineIconButton } from "../buttons/InlineIconButton/InlineIconButton.js";
|
|
6
5
|
import { useIntersectionObserver } from "../../hooks/useIntersectionObserver.js";
|
|
7
|
-
import { tableDataDefinition, tableHeadDataDefinition, tableHeadRowDefinition, tableRowDefinition } from "./table.cva.js";
|
|
6
|
+
import { tableDataDefinition, tableHeadDataDefinition, tableHeadRowDefinition, tableRowDefinition, theadDefinition } from "./table.cva.js";
|
|
8
7
|
import { CellText } from "./CellText.js";
|
|
9
8
|
import { DragIndicatorIcon } from "../../assets/icons/DragIndicator.js";
|
|
10
9
|
import { HeaderText } from "./HeaderText.js";
|
|
@@ -27,8 +26,8 @@ var CustomCellContext = (context) => {
|
|
|
27
26
|
value: context.getValue()
|
|
28
27
|
};
|
|
29
28
|
};
|
|
30
|
-
var
|
|
31
|
-
const rendered =
|
|
29
|
+
var CellRender = (Comp, props) => {
|
|
30
|
+
const rendered = typeof Comp === "function" ? Comp(props) : Comp;
|
|
32
31
|
return typeof rendered === "string" ? /* @__PURE__ */ jsx(CellText, { children: rendered }) : rendered;
|
|
33
32
|
};
|
|
34
33
|
var RowDragHandleCell = ({ rowId }) => {
|
|
@@ -69,13 +68,14 @@ var DraggableRow = ({ row, showCellBorder, onRowClick, onDoubleClick, tableRowCv
|
|
|
69
68
|
return /* @__PURE__ */ jsx("td", {
|
|
70
69
|
tabIndex: -1,
|
|
71
70
|
className: clsx(tableDataCva({ hasRightBorder: cellIndex > 0 && showCellBorder }), columnMeta.cellClass, columnMeta.width),
|
|
72
|
-
children:
|
|
71
|
+
children: CellRender(cell.column.columnDef.cell, CustomCellContext(cell.getContext()))
|
|
73
72
|
}, cell.id);
|
|
74
73
|
})
|
|
75
74
|
});
|
|
76
75
|
};
|
|
77
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 }) => {
|
|
78
77
|
const tableRowCva = UIOverrides.useCva("table.rowCva", tableRowDefinition);
|
|
78
|
+
const theadCva = UIOverrides.useCva("table.theadCva", theadDefinition);
|
|
79
79
|
const tableHeadRowCva = UIOverrides.useCva("table.headRowCva", tableHeadRowDefinition);
|
|
80
80
|
const tableHeadDataCva = UIOverrides.useCva("table.headDataCva", tableHeadDataDefinition);
|
|
81
81
|
const tableDataCva = UIOverrides.useCva("table.dataCva", tableDataDefinition);
|
|
@@ -155,8 +155,8 @@ var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, classN
|
|
|
155
155
|
if (!active || !over || active.id === over.id) return;
|
|
156
156
|
if (getRowId && (onReorder || onDragEnd)) {
|
|
157
157
|
if (onReorder) {
|
|
158
|
-
const oldIndex = items.findIndex((
|
|
159
|
-
const newIndex = items.findIndex((
|
|
158
|
+
const oldIndex = items.findIndex((item) => getRowId(item) === active.id);
|
|
159
|
+
const newIndex = items.findIndex((item) => getRowId(item) === over.id);
|
|
160
160
|
if (oldIndex !== -1 && newIndex !== -1) onReorder(arrayMove(items, oldIndex, newIndex));
|
|
161
161
|
}
|
|
162
162
|
onDragEnd?.(event);
|
|
@@ -176,7 +176,7 @@ var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, classN
|
|
|
176
176
|
className: clsx("w-full", className),
|
|
177
177
|
...listeners,
|
|
178
178
|
children: [/* @__PURE__ */ jsxs("thead", {
|
|
179
|
-
className:
|
|
179
|
+
className: clsx(theadCva({})),
|
|
180
180
|
"data-is-sticky": isSticky || void 0,
|
|
181
181
|
children: [/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("th", {
|
|
182
182
|
ref: stickyRef,
|
|
@@ -186,18 +186,18 @@ var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, classN
|
|
|
186
186
|
children: headerGroup.headers.filter((header) => {
|
|
187
187
|
if (isAnyRowSelected && header.index > 0) return false;
|
|
188
188
|
return header.column.getIsVisible();
|
|
189
|
-
}).map((
|
|
190
|
-
const columnMeta =
|
|
189
|
+
}).map((header, index) => {
|
|
190
|
+
const columnMeta = header.column.columnDef.meta ?? {};
|
|
191
191
|
return /* @__PURE__ */ jsx("th", {
|
|
192
|
-
colSpan: isAnyRowSelected ? columnCount :
|
|
192
|
+
colSpan: isAnyRowSelected ? columnCount : header.colSpan,
|
|
193
193
|
tabIndex: -1,
|
|
194
194
|
className: clsx(tableHeadDataCva({ hasRightBorder: index > 0 && showCellBorder }), columnMeta.headerClass, columnMeta.width),
|
|
195
195
|
children: isAnyRowSelected ? /* @__PURE__ */ jsx(ActionHeader, { table }) : /* @__PURE__ */ jsxs("button", {
|
|
196
196
|
type: "button",
|
|
197
197
|
"aria-label": "Sort column",
|
|
198
|
-
className: clsx("flex select-none items-center gap-1 text-text-default-1",
|
|
199
|
-
onClick:
|
|
200
|
-
children: [typeof
|
|
198
|
+
className: clsx("flex select-none items-center gap-1 text-text-default-1", header.column.getCanSort() ? "h-6 cursor-pointer rounded-xs px-1 hover:bg-elevation-fill-default-2" : "cursor-default", columnMeta.sortClass),
|
|
199
|
+
onClick: header.column.getToggleSortingHandler(),
|
|
200
|
+
children: [typeof header.column.columnDef.header === "function" ? flexRender(header.column.columnDef.header, header.getContext()) : /* @__PURE__ */ jsx(HeaderText, { children: header.column.columnDef.header }), {
|
|
201
201
|
asc: /* @__PURE__ */ jsx(ChevronUpIcon, {
|
|
202
202
|
width: 18,
|
|
203
203
|
height: 18
|
|
@@ -206,9 +206,9 @@ var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, classN
|
|
|
206
206
|
width: 18,
|
|
207
207
|
height: 18
|
|
208
208
|
})
|
|
209
|
-
}[
|
|
209
|
+
}[header.column.getIsSorted()] ?? null]
|
|
210
210
|
})
|
|
211
|
-
},
|
|
211
|
+
}, header.id);
|
|
212
212
|
})
|
|
213
213
|
}, headerGroup.id))]
|
|
214
214
|
}), /* @__PURE__ */ jsx("tbody", {
|
|
@@ -217,8 +217,8 @@ var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, classN
|
|
|
217
217
|
children: enableDragDrop ? /* @__PURE__ */ jsx(SortableContext, {
|
|
218
218
|
items: dataIds,
|
|
219
219
|
strategy: verticalListSortingStrategy,
|
|
220
|
-
children: table.getRowModel().rows.map((
|
|
221
|
-
row
|
|
220
|
+
children: table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx(DraggableRow, {
|
|
221
|
+
row,
|
|
222
222
|
showCellBorder,
|
|
223
223
|
onRowClick,
|
|
224
224
|
onDoubleClick,
|
|
@@ -227,29 +227,29 @@ var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, classN
|
|
|
227
227
|
tableDataCva,
|
|
228
228
|
hasOnClick,
|
|
229
229
|
...props
|
|
230
|
-
},
|
|
231
|
-
}) : table.getRowModel().rows.map((
|
|
230
|
+
}, row.id))
|
|
231
|
+
}) : table.getRowModel().rows.map((row) => {
|
|
232
232
|
return /* @__PURE__ */ jsx("tr", {
|
|
233
233
|
className: clsx(tableRowCva({ ...props })),
|
|
234
234
|
onClick: () => {
|
|
235
235
|
if (onRowClick) {
|
|
236
|
-
onRowClick(
|
|
236
|
+
onRowClick(row.original);
|
|
237
237
|
return;
|
|
238
238
|
}
|
|
239
|
-
if (
|
|
239
|
+
if (row.getCanSelect()) row.toggleSelected();
|
|
240
240
|
},
|
|
241
|
-
onDoubleClick: () => onDoubleClick?.(
|
|
242
|
-
"data-clickable": hasOnClick ||
|
|
243
|
-
"data-selected":
|
|
244
|
-
children:
|
|
245
|
-
const
|
|
241
|
+
onDoubleClick: () => onDoubleClick?.(row.original),
|
|
242
|
+
"data-clickable": hasOnClick || row.getCanSelect() || void 0,
|
|
243
|
+
"data-selected": row.getIsSelected() || void 0,
|
|
244
|
+
children: row.getVisibleCells().map((cell, cellIndex) => {
|
|
245
|
+
const columnMeta = cell.column.columnDef.meta ?? {};
|
|
246
246
|
return /* @__PURE__ */ jsx("td", {
|
|
247
247
|
tabIndex: -1,
|
|
248
|
-
className: clsx(tableDataCva({ hasRightBorder: cellIndex > 0 && showCellBorder }),
|
|
249
|
-
children:
|
|
248
|
+
className: clsx(tableDataCva({ hasRightBorder: cellIndex > 0 && showCellBorder }), columnMeta.cellClass, columnMeta.width),
|
|
249
|
+
children: CellRender(cell.column.columnDef.cell, CustomCellContext(cell.getContext()))
|
|
250
250
|
}, cell.id);
|
|
251
251
|
})
|
|
252
|
-
},
|
|
252
|
+
}, row.id);
|
|
253
253
|
})
|
|
254
254
|
})]
|
|
255
255
|
});
|
|
@@ -11,6 +11,13 @@ export declare const tableRowDefinition: {
|
|
|
11
11
|
export type TableRowConfig = NonNullable<typeof tableRowDefinition.config>;
|
|
12
12
|
export interface TableRowVariantProps extends UIOverrides.VariantProps<TableRowConfig> {
|
|
13
13
|
}
|
|
14
|
+
export declare const theadDefinition: {
|
|
15
|
+
base: string[];
|
|
16
|
+
config?: import("../../utils/style-merge.util").StyleMergeUtils.Config<Record<never, never>>;
|
|
17
|
+
};
|
|
18
|
+
export type TheadConfig = NonNullable<typeof theadDefinition.config>;
|
|
19
|
+
export interface TheadVariantProps extends UIOverrides.VariantProps<TheadConfig> {
|
|
20
|
+
}
|
|
14
21
|
export declare const tableHeadRowDefinition: {
|
|
15
22
|
base: string[];
|
|
16
23
|
config?: import("../../utils/style-merge.util").StyleMergeUtils.Config<Record<never, never>>;
|
|
@@ -15,6 +15,7 @@ var tableRowDefinition = UIOverrides.defineConfig({
|
|
|
15
15
|
odd: "odd:bg-elevation-fill-inverted-4/5"
|
|
16
16
|
} } }
|
|
17
17
|
});
|
|
18
|
+
var theadDefinition = UIOverrides.defineConfig({ base: ["group/table-head sticky top-0 z-sticky data-is-sticky:shadow-2"] });
|
|
18
19
|
var tableHeadRowDefinition = UIOverrides.defineConfig({ base: ["h-8 w-full"] });
|
|
19
20
|
var tableHeadDataDefinition = UIOverrides.defineConfig({
|
|
20
21
|
base: ["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"],
|
|
@@ -45,4 +46,4 @@ var tableDataDefinition = UIOverrides.defineConfig({
|
|
|
45
46
|
var tableHeaderTextDefinition = UIOverrides.defineConfig({ base: ["overflow-hidden text-ellipsis px-table-cell-content-side-m py-table-cell-content-height-m text-text-default-1"] });
|
|
46
47
|
var tableCellTextDefinition = UIOverrides.defineConfig({ base: ["block overflow-hidden text-ellipsis text-text-default-2"] });
|
|
47
48
|
//#endregion
|
|
48
|
-
export { tableCellTextDefinition, tableDataDefinition, tableHeadDataDefinition, tableHeadRowDefinition, tableHeaderTextDefinition, tableRowDefinition };
|
|
49
|
+
export { tableCellTextDefinition, tableDataDefinition, tableHeadDataDefinition, tableHeadRowDefinition, tableHeaderTextDefinition, tableRowDefinition, theadDefinition };
|
|
@@ -1,33 +1,21 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
import { LinkContext } from "../../../config/link.context.js";
|
|
3
3
|
import { linkDefinition } from "./link.cva.js";
|
|
4
|
-
import { c } from "react/compiler-runtime";
|
|
5
4
|
import { jsx } from "react/jsx-runtime";
|
|
6
5
|
import { Link } from "react-aria-components";
|
|
7
6
|
//#region src/components/text/Link/Link.tsx
|
|
8
|
-
var Link$1 = (
|
|
9
|
-
const $ = c(4);
|
|
10
|
-
const { variant, ...props } = t0;
|
|
7
|
+
var Link$1 = ({ variant, ...props }) => {
|
|
11
8
|
const linkContext = LinkContext.useLinkContext();
|
|
12
9
|
const linkCva = UIOverrides.useCva("link.cva", linkDefinition);
|
|
13
10
|
const LinkComponent = linkContext?.LinkComponent ?? Link;
|
|
14
11
|
if (!props.to && props.href) props.to = props.href;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
className:
|
|
12
|
+
return /* @__PURE__ */ jsx(LinkComponent, {
|
|
13
|
+
...props,
|
|
14
|
+
className: linkCva({
|
|
15
|
+
variant,
|
|
16
|
+
className: props.className
|
|
17
|
+
})
|
|
18
18
|
});
|
|
19
|
-
let t2;
|
|
20
|
-
if ($[0] !== LinkComponent || $[1] !== props || $[2] !== t1) {
|
|
21
|
-
t2 = /* @__PURE__ */ jsx(LinkComponent, {
|
|
22
|
-
...props,
|
|
23
|
-
className: t1
|
|
24
|
-
});
|
|
25
|
-
$[0] = LinkComponent;
|
|
26
|
-
$[1] = props;
|
|
27
|
-
$[2] = t1;
|
|
28
|
-
$[3] = t2;
|
|
29
|
-
} else t2 = $[3];
|
|
30
|
-
return t2;
|
|
31
19
|
};
|
|
32
20
|
//#endregion
|
|
33
21
|
export { Link$1 as Link };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { ButtonProps as AriaButtonProps } from 'react-aria-components';
|
|
3
|
+
import { PillButtonVariants } from '../../buttons/PillButton/pillButton.cva';
|
|
4
|
+
import { TypographyProps } from '../Typography/Typography';
|
|
5
|
+
export interface PillProps extends PillButtonVariants, AriaButtonProps {
|
|
6
|
+
className?: string;
|
|
7
|
+
children: string;
|
|
8
|
+
dismissable?: boolean;
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
contentRef?: Ref<HTMLElement>;
|
|
11
|
+
textVariant?: TypographyProps["variant"];
|
|
12
|
+
textSize?: TypographyProps["size"];
|
|
13
|
+
onDismiss?: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const Pill: ({ className, children, dismissable, isDisabled, onDismiss, contentRef, variant, ...props }: PillProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { CloseIcon } from "../../../assets/icons/Close.js";
|
|
2
|
+
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
3
|
+
import { Typography } from "../Typography/Typography.js";
|
|
4
|
+
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
5
|
+
import { pillButtonDefinition } from "../../buttons/PillButton/pillButton.cva.js";
|
|
6
|
+
import "../../../config/i18n.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { clsx } from "clsx";
|
|
9
|
+
import { Button } from "react-aria-components";
|
|
10
|
+
import { useTranslation } from "react-i18next";
|
|
11
|
+
//#region src/components/text/Pill/Pill.tsx
|
|
12
|
+
var Pill = ({ className, children, dismissable, isDisabled, onDismiss, contentRef, variant = "subtle", ...props }) => {
|
|
13
|
+
const uiConfig = UIConfig.useConfig();
|
|
14
|
+
const { textVariant = uiConfig.tag.textVariant, textSize = uiConfig.tag.textSize } = props;
|
|
15
|
+
const pillCva = UIOverrides.useCva("pillButton.cva", pillButtonDefinition);
|
|
16
|
+
const { t } = useTranslation("ui");
|
|
17
|
+
const buttonProps = {
|
|
18
|
+
isDisabled,
|
|
19
|
+
onPress: onDismiss,
|
|
20
|
+
label: t(($) => $.ui.tag.dismiss),
|
|
21
|
+
...props
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
24
|
+
className: pillCva({
|
|
25
|
+
...props,
|
|
26
|
+
variant,
|
|
27
|
+
className: clsx("pointer-events-none inline-flex gap-list-gap-icon-to-label overflow-hidden", className)
|
|
28
|
+
}),
|
|
29
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
30
|
+
ref: contentRef,
|
|
31
|
+
variant: textVariant,
|
|
32
|
+
size: textSize,
|
|
33
|
+
as: "span",
|
|
34
|
+
className: "truncate",
|
|
35
|
+
children
|
|
36
|
+
}), dismissable && /* @__PURE__ */ jsx(Button, {
|
|
37
|
+
...buttonProps,
|
|
38
|
+
className: "pointer-events-auto shrink-0",
|
|
39
|
+
children: /* @__PURE__ */ jsx(CloseIcon, { className: "size-4" })
|
|
40
|
+
})]
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { Pill };
|
|
@@ -1,31 +1,16 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
import { typographyDefinition } from "./typography.cva.js";
|
|
3
|
-
import { c } from "react/compiler-runtime";
|
|
4
3
|
import { jsx } from "react/jsx-runtime";
|
|
5
4
|
//#region src/components/text/Typography/Typography.tsx
|
|
6
|
-
var Typography = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
...props
|
|
14
|
-
sizeMobile: props.sizeMobile ?? props.size,
|
|
15
|
-
className
|
|
5
|
+
var Typography = ({ as = "p", className, ...props }) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(as, {
|
|
7
|
+
className: UIOverrides.useCva("typography.cva", typographyDefinition)({
|
|
8
|
+
...props,
|
|
9
|
+
sizeMobile: props.sizeMobile ?? props.size,
|
|
10
|
+
className
|
|
11
|
+
}),
|
|
12
|
+
...props
|
|
16
13
|
});
|
|
17
|
-
let t3;
|
|
18
|
-
if ($[0] !== Tag || $[1] !== props || $[2] !== t2) {
|
|
19
|
-
t3 = /* @__PURE__ */ jsx(Tag, {
|
|
20
|
-
className: t2,
|
|
21
|
-
...props
|
|
22
|
-
});
|
|
23
|
-
$[0] = Tag;
|
|
24
|
-
$[1] = props;
|
|
25
|
-
$[2] = t2;
|
|
26
|
-
$[3] = t3;
|
|
27
|
-
} else t3 = $[3];
|
|
28
|
-
return t3;
|
|
29
14
|
};
|
|
30
15
|
//#endregion
|
|
31
16
|
export { Typography };
|
|
@@ -24,7 +24,7 @@ var Confirmation;
|
|
|
24
24
|
const [state, setState] = useState(DEFAULT_STATE);
|
|
25
25
|
const { t } = useTranslation("ui");
|
|
26
26
|
const onCancel = () => setState(DEFAULT_STATE);
|
|
27
|
-
const confirm = useCallback(async ({ heading, description, buttonSize, textAlign, modalClassName, cancelLabel = t(($) => $.ui.confirmation.cancel), confirmLabel = t(($
|
|
27
|
+
const confirm = useCallback(async ({ heading, description, buttonSize, textAlign, modalClassName, cancelLabel = t(($) => $.ui.confirmation.cancel), confirmLabel = t(($) => $.ui.confirmation.confirm), confirmVariant, confirmColor, cancelVariant, cancelColor }) => {
|
|
28
28
|
return new Promise((resolve) => {
|
|
29
29
|
setState({
|
|
30
30
|
heading,
|
|
@@ -1,31 +1,17 @@
|
|
|
1
|
-
import { c } from "react/compiler-runtime";
|
|
2
1
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, use } from "react";
|
|
2
|
+
import { createContext, use, useMemo } from "react";
|
|
4
3
|
//#region src/config/link.context.tsx
|
|
5
4
|
var LinkContext;
|
|
6
5
|
(function(_LinkContext) {
|
|
7
6
|
const LinkContextInternal = createContext(null);
|
|
8
|
-
_LinkContext.LinkContextProvider = (
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} else t1 = $[1];
|
|
17
|
-
const value = t1;
|
|
18
|
-
let t2;
|
|
19
|
-
if ($[2] !== children || $[3] !== value) {
|
|
20
|
-
t2 = /* @__PURE__ */ jsx(LinkContextInternal.Provider, {
|
|
21
|
-
value,
|
|
22
|
-
children
|
|
23
|
-
});
|
|
24
|
-
$[2] = children;
|
|
25
|
-
$[3] = value;
|
|
26
|
-
$[4] = t2;
|
|
27
|
-
} else t2 = $[4];
|
|
28
|
-
return t2;
|
|
7
|
+
_LinkContext.LinkContextProvider = ({ children, LinkComponent }) => {
|
|
8
|
+
const value = useMemo(() => {
|
|
9
|
+
return { LinkComponent };
|
|
10
|
+
}, [LinkComponent]);
|
|
11
|
+
return /* @__PURE__ */ jsx(LinkContextInternal.Provider, {
|
|
12
|
+
value,
|
|
13
|
+
children
|
|
14
|
+
});
|
|
29
15
|
};
|
|
30
16
|
_LinkContext.useLinkContext = () => {
|
|
31
17
|
return use(LinkContextInternal);
|
|
@@ -1,57 +1,31 @@
|
|
|
1
|
-
import { c } from "react/compiler-runtime";
|
|
2
1
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, use } from "react";
|
|
2
|
+
import { createContext, use, useMemo } from "react";
|
|
4
3
|
import { RouterProvider } from "react-aria";
|
|
5
4
|
//#region src/config/router.context.tsx
|
|
6
5
|
var UIRouter;
|
|
7
6
|
(function(_UIRouter) {
|
|
8
7
|
const UIRouterContext = createContext(null);
|
|
9
|
-
_UIRouter.UIRouterProvider = (
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
$[0] = searchString;
|
|
16
|
-
$[1] = t1;
|
|
17
|
-
} else t1 = $[1];
|
|
18
|
-
const searchParams = t1;
|
|
19
|
-
let t2;
|
|
20
|
-
if ($[2] !== push || $[3] !== replace || $[4] !== searchParams || $[5] !== searchString) {
|
|
21
|
-
t2 = {
|
|
8
|
+
_UIRouter.UIRouterProvider = ({ children, push, replace, searchString }) => {
|
|
9
|
+
const searchParams = useMemo(() => {
|
|
10
|
+
return new URLSearchParams(searchString);
|
|
11
|
+
}, [searchString]);
|
|
12
|
+
return /* @__PURE__ */ jsx(UIRouterContext, {
|
|
13
|
+
value: useMemo(() => ({
|
|
22
14
|
searchParams,
|
|
23
15
|
push,
|
|
24
16
|
searchString,
|
|
25
17
|
replace
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const value = t2;
|
|
34
|
-
let t3;
|
|
35
|
-
if ($[7] !== children || $[8] !== push) {
|
|
36
|
-
t3 = /* @__PURE__ */ jsx(RouterProvider, {
|
|
18
|
+
}), [
|
|
19
|
+
searchParams,
|
|
20
|
+
push,
|
|
21
|
+
searchString,
|
|
22
|
+
replace
|
|
23
|
+
]),
|
|
24
|
+
children: /* @__PURE__ */ jsx(RouterProvider, {
|
|
37
25
|
navigate: push,
|
|
38
26
|
children
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
$[8] = push;
|
|
42
|
-
$[9] = t3;
|
|
43
|
-
} else t3 = $[9];
|
|
44
|
-
let t4;
|
|
45
|
-
if ($[10] !== t3 || $[11] !== value) {
|
|
46
|
-
t4 = /* @__PURE__ */ jsx(UIRouterContext, {
|
|
47
|
-
value,
|
|
48
|
-
children: t3
|
|
49
|
-
});
|
|
50
|
-
$[10] = t3;
|
|
51
|
-
$[11] = value;
|
|
52
|
-
$[12] = t4;
|
|
53
|
-
} else t4 = $[12];
|
|
54
|
-
return t4;
|
|
27
|
+
})
|
|
28
|
+
});
|
|
55
29
|
};
|
|
56
30
|
_UIRouter.useUIRouter = () => {
|
|
57
31
|
const context = use(UIRouterContext);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useLocalStorage } from "../hooks/useLocalStorage.js";
|
|
2
|
-
import { c } from "react/compiler-runtime";
|
|
3
2
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { createContext, use, useEffect, useState } from "react";
|
|
3
|
+
import { createContext, use, useCallback, useEffect, useMemo, useState } from "react";
|
|
5
4
|
import { z } from "zod";
|
|
6
5
|
//#region src/config/theme.context.tsx
|
|
7
6
|
var ThemeContext;
|
|
@@ -13,108 +12,56 @@ var ThemeContext;
|
|
|
13
12
|
"system"
|
|
14
13
|
]);
|
|
15
14
|
const ThemeContext = createContext(null);
|
|
16
|
-
_ThemeContext.ThemeContextProvider = (
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
_ThemeContext.ThemeContextProvider = ({ children, storageKey = DEFAULT_STORAGE_KEY }) => {
|
|
16
|
+
const [systemTheme, setSystemTheme] = useState(() => {
|
|
17
|
+
if (typeof window === "undefined") return;
|
|
18
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
19
|
+
});
|
|
20
|
+
const { value: theme, set } = useLocalStorage({
|
|
21
|
+
key: storageKey,
|
|
22
|
+
schema: ThemeSchema
|
|
23
|
+
});
|
|
24
|
+
const updateTheme = useCallback((theme) => {
|
|
25
|
+
set(theme);
|
|
26
|
+
}, [set]);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (typeof window === "undefined") return;
|
|
29
|
+
const onChange = (event) => {
|
|
30
|
+
setSystemTheme(event.matches ? "dark" : "light");
|
|
26
31
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
let t3;
|
|
32
|
-
if ($[2] !== set) {
|
|
33
|
-
t3 = (theme_0) => {
|
|
34
|
-
set(theme_0);
|
|
32
|
+
const media = window.matchMedia("(prefers-color-scheme: dark)");
|
|
33
|
+
media.addEventListener("change", onChange);
|
|
34
|
+
return () => {
|
|
35
|
+
media.removeEventListener("change", onChange);
|
|
35
36
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
useEffect(t4, t5);
|
|
62
|
-
let t6;
|
|
63
|
-
let t7;
|
|
64
|
-
if ($[6] !== systemTheme || $[7] !== theme) {
|
|
65
|
-
t6 = () => {
|
|
66
|
-
document.documentElement.classList.remove("dark");
|
|
67
|
-
if ((!theme || theme === "system") && systemTheme === "dark" || theme === "dark") {
|
|
68
|
-
document.documentElement.classList.add("dark");
|
|
69
|
-
document.documentElement.style.colorScheme = "dark";
|
|
70
|
-
} else if (theme === "light") {
|
|
71
|
-
document.documentElement.classList.add("light");
|
|
72
|
-
document.documentElement.style.colorScheme = "light";
|
|
73
|
-
} else document.documentElement.style.colorScheme = "light";
|
|
74
|
-
};
|
|
75
|
-
t7 = [theme, systemTheme];
|
|
76
|
-
$[6] = systemTheme;
|
|
77
|
-
$[7] = theme;
|
|
78
|
-
$[8] = t6;
|
|
79
|
-
$[9] = t7;
|
|
80
|
-
} else {
|
|
81
|
-
t6 = $[8];
|
|
82
|
-
t7 = $[9];
|
|
83
|
-
}
|
|
84
|
-
useEffect(t6, t7);
|
|
85
|
-
const t8 = theme ?? "system";
|
|
86
|
-
let t9;
|
|
87
|
-
if ($[10] !== systemTheme || $[11] !== t8 || $[12] !== updateTheme) {
|
|
88
|
-
t9 = {
|
|
89
|
-
theme: t8,
|
|
90
|
-
systemTheme,
|
|
91
|
-
updateTheme
|
|
92
|
-
};
|
|
93
|
-
$[10] = systemTheme;
|
|
94
|
-
$[11] = t8;
|
|
95
|
-
$[12] = updateTheme;
|
|
96
|
-
$[13] = t9;
|
|
97
|
-
} else t9 = $[13];
|
|
98
|
-
const contextValue = t9;
|
|
99
|
-
let t10;
|
|
100
|
-
if ($[14] !== children || $[15] !== contextValue) {
|
|
101
|
-
t10 = /* @__PURE__ */ jsx(ThemeContext.Provider, {
|
|
102
|
-
value: contextValue,
|
|
103
|
-
children
|
|
104
|
-
});
|
|
105
|
-
$[14] = children;
|
|
106
|
-
$[15] = contextValue;
|
|
107
|
-
$[16] = t10;
|
|
108
|
-
} else t10 = $[16];
|
|
109
|
-
return t10;
|
|
37
|
+
}, []);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
document.documentElement.classList.remove("dark");
|
|
40
|
+
if ((!theme || theme === "system") && systemTheme === "dark" || theme === "dark") {
|
|
41
|
+
document.documentElement.classList.add("dark");
|
|
42
|
+
document.documentElement.style.colorScheme = "dark";
|
|
43
|
+
} else if (theme === "light") {
|
|
44
|
+
document.documentElement.classList.add("light");
|
|
45
|
+
document.documentElement.style.colorScheme = "light";
|
|
46
|
+
} else document.documentElement.style.colorScheme = "light";
|
|
47
|
+
}, [theme, systemTheme]);
|
|
48
|
+
const contextValue = useMemo(() => ({
|
|
49
|
+
theme: theme ?? "system",
|
|
50
|
+
systemTheme,
|
|
51
|
+
updateTheme
|
|
52
|
+
}), [
|
|
53
|
+
theme,
|
|
54
|
+
systemTheme,
|
|
55
|
+
updateTheme
|
|
56
|
+
]);
|
|
57
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, {
|
|
58
|
+
value: contextValue,
|
|
59
|
+
children
|
|
60
|
+
});
|
|
110
61
|
};
|
|
111
62
|
_ThemeContext.useTheme = () => {
|
|
112
63
|
return use(ThemeContext);
|
|
113
64
|
};
|
|
114
65
|
})(ThemeContext || (ThemeContext = {}));
|
|
115
|
-
function _temp() {
|
|
116
|
-
if (typeof window === "undefined") return;
|
|
117
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
118
|
-
}
|
|
119
66
|
//#endregion
|
|
120
67
|
export { ThemeContext };
|