@povio/ui 2.2.4 → 2.2.6
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/Search.js +13 -0
- package/dist/components/Menu/Menu.d.ts +2 -0
- package/dist/components/Menu/MenuMobile.js +1 -0
- package/dist/components/inputs/Checkbox/Checkbox.js +1 -1
- package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +3 -2
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +3 -2
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +3 -2
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +1 -1
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +4 -5
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +8 -14
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +1 -1
- package/dist/components/inputs/File/FileUpload.d.ts +1 -1
- package/dist/components/inputs/File/FileUpload.js +15 -3
- package/dist/components/inputs/File/fileUpload.types.d.ts +11 -1
- package/dist/components/inputs/File/shared/FileCardList.js +1 -1
- package/dist/components/inputs/File/shared/FileUploadContentError.js +2 -2
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +3 -3
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +2 -2
- package/dist/components/inputs/File/shared/InputUploadContent.js +1 -1
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -1
- package/dist/components/inputs/FormField/FormField.js +8 -0
- package/dist/components/inputs/FormField/FormFieldError.js +2 -2
- package/dist/components/inputs/FormField/FormFieldHelper.d.ts +8 -0
- package/dist/components/inputs/FormField/FormFieldHelper.js +12 -0
- package/dist/components/inputs/FormField/FormFieldLabel.js +1 -0
- package/dist/components/inputs/FormField/formFieldError.cva.d.ts +6 -0
- package/dist/components/inputs/FormField/formFieldError.cva.js +9 -0
- package/dist/components/inputs/FormField/formFieldHelper.cva.d.ts +6 -0
- package/dist/components/inputs/FormField/formFieldHelper.cva.js +9 -0
- package/dist/components/inputs/Input/shared/InputContent.js +1 -0
- package/dist/components/inputs/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/inputs/RadioGroup/radio.cva.js +1 -0
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/SelectBase.js +2 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +4 -1
- package/dist/components/inputs/Selection/shared/SelectInput.js +1 -1
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +1 -1
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +1 -1
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +16 -12
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +4 -1
- package/dist/components/inputs/Toggle/toggle.cva.js +1 -0
- package/dist/components/inputs/shared/CheckContent.js +1 -0
- package/dist/components/inputs/shared/label.cva.js +5 -0
- package/dist/components/overlays/BottomSheet/BottomSheet.d.ts +9 -0
- package/dist/components/overlays/BottomSheet/BottomSheet.js +52 -20
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.d.ts +13 -0
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +36 -0
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +8 -10
- package/dist/components/shared/popover.cva.d.ts +4 -0
- package/dist/components/shared/popover.cva.js +3 -0
- package/dist/components/table/CellText.d.ts +2 -1
- package/dist/components/table/CellText.js +16 -10
- package/dist/components/table/ColumnConfig.js +1 -1
- package/dist/components/table/HeaderText.d.ts +5 -2
- package/dist/components/table/HeaderText.js +15 -7
- package/dist/components/table/Table.js +1 -1
- package/dist/components/table/table.cva.d.ts +6 -0
- package/dist/components/table/table.cva.js +3 -1
- package/dist/config/uiConfig.context.d.ts +7 -1
- package/dist/config/uiConfig.context.js +19 -1
- package/dist/config/uiStyle.context.d.ts +13 -1
- package/dist/index.js +2 -2
- package/dist/utils/file.utils.d.ts +4 -0
- package/dist/utils/file.utils.js +7 -2
- package/package.json +1 -1
|
@@ -9,6 +9,9 @@ import { SelectBaseProps } from '../components/inputs/Selection/shared/SelectBas
|
|
|
9
9
|
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
|
+
import { BottomSheetProps } from '../components/overlays/BottomSheet/BottomSheet';
|
|
13
|
+
import { CellTextProps } from '../components/table/CellText';
|
|
14
|
+
import { HeaderTextProps } from '../components/table/HeaderText';
|
|
12
15
|
export declare namespace UIConfig {
|
|
13
16
|
type DeepRequired<T> = {
|
|
14
17
|
[P in keyof T]-?: T[P] extends object ? DeepRequired<T[P]> : Exclude<T[P], null | undefined>;
|
|
@@ -19,11 +22,14 @@ export declare namespace UIConfig {
|
|
|
19
22
|
numberInput: Pick<NumberInputProps, "formatOptions">;
|
|
20
23
|
radioGroup: Pick<RadioGroupProps, "variant" | "hideLabel">;
|
|
21
24
|
checkbox: Pick<CheckboxProps, "variant">;
|
|
22
|
-
select: Pick<SelectBaseProps, "selectionMode" | "isSearchable" | "collapseAfter" | "selectedTagsType">;
|
|
25
|
+
select: Pick<SelectBaseProps, "selectionMode" | "isSearchable" | "collapseAfter" | "selectedTagsType" | "hideSearchIcon">;
|
|
23
26
|
toggle: Pick<ToggleProps, "variant">;
|
|
24
27
|
slider: Pick<SliderProps, "minValue" | "maxValue">;
|
|
25
28
|
dateInput: Pick<DatePickerProps, "todayIcon" | "shouldForceLeadingZeros" | "disableManualEntry">;
|
|
26
29
|
actionModal: Pick<ActionModalProps, "titleTypography" | "descriptionTypography">;
|
|
30
|
+
bottomSheet: Pick<BottomSheetProps, "closeDragThreshold" | "closeVelocityThreshold" | "hideThumb" | "headerTypography">;
|
|
31
|
+
tableHeaderText: Pick<HeaderTextProps, "variant" | "size">;
|
|
32
|
+
tableCellText: Pick<CellTextProps, "variant" | "size">;
|
|
27
33
|
}
|
|
28
34
|
interface ProviderProps {
|
|
29
35
|
config?: Partial<Options>;
|
|
@@ -29,7 +29,8 @@ let UIConfig;
|
|
|
29
29
|
selectionMode: "single",
|
|
30
30
|
isSearchable: false,
|
|
31
31
|
selectedTagsType: "list",
|
|
32
|
-
collapseAfter: 3
|
|
32
|
+
collapseAfter: 3,
|
|
33
|
+
hideSearchIcon: false
|
|
33
34
|
},
|
|
34
35
|
toggle: { variant: "default" },
|
|
35
36
|
slider: {
|
|
@@ -47,6 +48,23 @@ let UIConfig;
|
|
|
47
48
|
variant: "prominent-1"
|
|
48
49
|
},
|
|
49
50
|
descriptionTypography: { size: "body-3" }
|
|
51
|
+
},
|
|
52
|
+
bottomSheet: {
|
|
53
|
+
closeDragThreshold: 100,
|
|
54
|
+
closeVelocityThreshold: 200,
|
|
55
|
+
hideThumb: false,
|
|
56
|
+
headerTypography: {
|
|
57
|
+
size: "label-2",
|
|
58
|
+
variant: "prominent-1"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
tableHeaderText: {
|
|
62
|
+
variant: "default",
|
|
63
|
+
size: "label-1"
|
|
64
|
+
},
|
|
65
|
+
tableCellText: {
|
|
66
|
+
variant: "default",
|
|
67
|
+
size: "label-1"
|
|
50
68
|
}
|
|
51
69
|
};
|
|
52
70
|
const Context = createContext(DEFAULT_CONFIG);
|
|
@@ -4,6 +4,8 @@ import { BreadcrumbChevronVariantProps, BreadcrumbIconVariantProps, BreadcrumbIt
|
|
|
4
4
|
import { ButtonVariantProps } from '../components/buttons/Button/button.cva';
|
|
5
5
|
import { PillButtonVariants } from '../components/buttons/PillButton/pillButton.cva';
|
|
6
6
|
import { CheckboxIconVariantProps, CheckboxVariantProps } from '../components/inputs/Checkbox/checkbox.cva';
|
|
7
|
+
import { FormFieldErrorVariantProps } from '../components/inputs/FormField/formFieldError.cva';
|
|
8
|
+
import { FormFieldHelperVariantProps } from '../components/inputs/FormField/formFieldHelper.cva';
|
|
7
9
|
import { RadioVariantProps } from '../components/inputs/RadioGroup/radio.cva';
|
|
8
10
|
import { InputBaseProps, InputSideProps, InputSizeProps } from '../components/inputs/shared/input.cva';
|
|
9
11
|
import { LabelBaseProps } from '../components/inputs/shared/label.cva';
|
|
@@ -14,9 +16,10 @@ import { StepperIconVariantProps, StepperItemVariantProps, StepperNumberVariantP
|
|
|
14
16
|
import { ModalVariantProps } from '../components/overlays/Modal/modal.cva';
|
|
15
17
|
import { TooltipPointerHorizontalVariantProps, TooltipPointerVerticalVariantProps, TooltipTextVariantProps, TooltipVariantProps } from '../components/overlays/Tooltip/tooltip.cva';
|
|
16
18
|
import { SegmentItemVariantProps, SegmentVariantProps } from '../components/segment/segment.cva';
|
|
19
|
+
import { PopoverVariantProps } from '../components/shared/popover.cva';
|
|
17
20
|
import { AlertVariantProps } from '../components/status/Alert/alert.cva';
|
|
18
21
|
import { ToastVariantProps } from '../components/status/Toast/toast.cva';
|
|
19
|
-
import { TableDataVariantProps, TableHeadDataVariantProps, TableHeadRowVariantProps, TableRowVariantProps } from '../components/table/table.cva';
|
|
22
|
+
import { TableCellTextVariantProps, TableDataVariantProps, TableHeadDataVariantProps, TableHeadRowVariantProps, TableHeaderTextVariantProps, TableRowVariantProps } from '../components/table/table.cva';
|
|
20
23
|
import { LinkVariantProps } from '../components/text/Link/link.cva';
|
|
21
24
|
import { TagVariantProps } from '../components/text/Tag/tag.cva';
|
|
22
25
|
import { TypographyVariantProps } from '../components/text/Typography/typography.cva';
|
|
@@ -85,6 +88,8 @@ export declare namespace UIStyle {
|
|
|
85
88
|
headDataCva?: Cva<TableHeadDataVariantProps>;
|
|
86
89
|
rowCva?: Cva<TableRowVariantProps>;
|
|
87
90
|
dataCva?: Cva<TableDataVariantProps>;
|
|
91
|
+
headerTextCva?: Cva<TableHeaderTextVariantProps>;
|
|
92
|
+
cellTextCva?: Cva<TableCellTextVariantProps>;
|
|
88
93
|
};
|
|
89
94
|
tooltip: {
|
|
90
95
|
cva?: Cva<TooltipVariantProps>;
|
|
@@ -135,6 +140,13 @@ export declare namespace UIStyle {
|
|
|
135
140
|
chevronCva?: Cva<BreadcrumbChevronVariantProps>;
|
|
136
141
|
iconCva?: Cva<BreadcrumbIconVariantProps>;
|
|
137
142
|
};
|
|
143
|
+
popover: {
|
|
144
|
+
cva?: Cva<PopoverVariantProps>;
|
|
145
|
+
};
|
|
146
|
+
formField: {
|
|
147
|
+
errorLabelCva?: Cva<FormFieldErrorVariantProps>;
|
|
148
|
+
helperLabelCva?: Cva<FormFieldHelperVariantProps>;
|
|
149
|
+
};
|
|
138
150
|
}
|
|
139
151
|
interface ProviderProps {
|
|
140
152
|
config?: Partial<Options>;
|
package/dist/index.js
CHANGED
|
@@ -55,6 +55,8 @@ import { Button } from "./components/buttons/Button/Button.js";
|
|
|
55
55
|
import { IconButton } from "./components/buttons/IconButton/IconButton.js";
|
|
56
56
|
import { InlineIconButton } from "./components/buttons/InlineIconButton/InlineIconButton.js";
|
|
57
57
|
import { PillButton } from "./components/buttons/PillButton/PillButton.js";
|
|
58
|
+
import { ns, resources } from "./config/i18n.js";
|
|
59
|
+
import { useStateAndRef } from "./hooks/useStateAndRef.js";
|
|
58
60
|
import { DomUtils } from "./utils/dom.utils.js";
|
|
59
61
|
import { BottomSheet } from "./components/overlays/BottomSheet/BottomSheet.js";
|
|
60
62
|
import { useBreakpoint } from "./hooks/useBreakpoint.js";
|
|
@@ -65,7 +67,6 @@ import { ToggleButton } from "./components/buttons/ToggleButton/ToggleButton.js"
|
|
|
65
67
|
import { Checkbox } from "./components/inputs/Checkbox/Checkbox.js";
|
|
66
68
|
import { useLongPressRepeat } from "./hooks/useLongPressRepeat.js";
|
|
67
69
|
import { useScrollableListBox } from "./hooks/useScrollableListBox.js";
|
|
68
|
-
import { ns, resources } from "./config/i18n.js";
|
|
69
70
|
import { FormField } from "./components/inputs/FormField/FormField.js";
|
|
70
71
|
import { DateTimeUtils } from "./utils/date-time.utils.js";
|
|
71
72
|
import { DatePicker } from "./components/inputs/DateTime/DatePicker/DatePicker.js";
|
|
@@ -130,7 +131,6 @@ import { useForm } from "./hooks/useForm.js";
|
|
|
130
131
|
import { useFormAutosave } from "./hooks/useFormAutosave.js";
|
|
131
132
|
import { usePagination } from "./hooks/usePagination.js";
|
|
132
133
|
import { useSorting } from "./hooks/useSorting.js";
|
|
133
|
-
import { useStateAndRef } from "./hooks/useStateAndRef.js";
|
|
134
134
|
import { useTableColumnConfig } from "./hooks/useTableColumnConfig.js";
|
|
135
135
|
import { ArrayUtils } from "./utils/array.utils.js";
|
|
136
136
|
import { QueriesUtils } from "./utils/queries.utils.js";
|
|
@@ -5,5 +5,9 @@ export declare namespace FileUtils {
|
|
|
5
5
|
const downloadFile: (data: Blob | AxiosResponse<Blob>, fileName?: string, revokeTimeoutMs?: number) => void;
|
|
6
6
|
const isFileTypeAccepted: (file: File, fileTypes?: readonly string[] | string[]) => boolean;
|
|
7
7
|
const getCalculatedFileSize: (file?: File) => string;
|
|
8
|
+
const getFileDisplaySize: (state: {
|
|
9
|
+
file?: File;
|
|
10
|
+
displaySize?: number;
|
|
11
|
+
}) => string;
|
|
8
12
|
const formatBytes: (size: number, decimals?: number) => string;
|
|
9
13
|
}
|
package/dist/utils/file.utils.js
CHANGED
|
@@ -26,14 +26,19 @@ let FileUtils;
|
|
|
26
26
|
return file.name.toLowerCase().endsWith(type.toLowerCase());
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
|
-
_FileUtils.getCalculatedFileSize = (file) => {
|
|
29
|
+
const getCalculatedFileSize = _FileUtils.getCalculatedFileSize = (file) => {
|
|
30
30
|
if (!file) return "";
|
|
31
31
|
if (file.size < 1024) return `${file.size} B`;
|
|
32
32
|
if (file.size < 1024 * 1024) return `${(file.size / 1024).toFixed(2)} KB`;
|
|
33
33
|
if (file.size < 1024 * 1024 * 1024) return `${(file.size / 1024 / 1024).toFixed(2)} MB`;
|
|
34
34
|
return `${(file.size / 1024 / 1024 / 1024).toFixed(2)} GB`;
|
|
35
35
|
};
|
|
36
|
-
_FileUtils.
|
|
36
|
+
_FileUtils.getFileDisplaySize = (state) => {
|
|
37
|
+
if (state.file) return getCalculatedFileSize(state.file);
|
|
38
|
+
if (state.displaySize != null) return formatBytes(state.displaySize);
|
|
39
|
+
return "";
|
|
40
|
+
};
|
|
41
|
+
const formatBytes = _FileUtils.formatBytes = (size, decimals = 2) => {
|
|
37
42
|
if (size < 1024) return `${size} B`;
|
|
38
43
|
if (size < 1024 * 1024) return `${(size / 1024).toFixed(decimals)} KB`;
|
|
39
44
|
if (size < 1024 * 1024 * 1024) return `${(size / 1024 / 1024).toFixed(decimals)} MB`;
|