@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.
Files changed (71) hide show
  1. package/dist/assets/icons/Search.js +13 -0
  2. package/dist/components/Menu/Menu.d.ts +2 -0
  3. package/dist/components/Menu/MenuMobile.js +1 -0
  4. package/dist/components/inputs/Checkbox/Checkbox.js +1 -1
  5. package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -0
  6. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +1 -0
  7. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +3 -2
  8. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
  9. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +3 -2
  10. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -0
  11. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +3 -2
  12. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +1 -1
  13. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -1
  14. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +4 -5
  15. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +8 -14
  16. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +1 -1
  17. package/dist/components/inputs/File/FileUpload.d.ts +1 -1
  18. package/dist/components/inputs/File/FileUpload.js +15 -3
  19. package/dist/components/inputs/File/fileUpload.types.d.ts +11 -1
  20. package/dist/components/inputs/File/shared/FileCardList.js +1 -1
  21. package/dist/components/inputs/File/shared/FileUploadContentError.js +2 -2
  22. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +3 -3
  23. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +2 -2
  24. package/dist/components/inputs/File/shared/InputUploadContent.js +1 -1
  25. package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -1
  26. package/dist/components/inputs/FormField/FormField.js +8 -0
  27. package/dist/components/inputs/FormField/FormFieldError.js +2 -2
  28. package/dist/components/inputs/FormField/FormFieldHelper.d.ts +8 -0
  29. package/dist/components/inputs/FormField/FormFieldHelper.js +12 -0
  30. package/dist/components/inputs/FormField/FormFieldLabel.js +1 -0
  31. package/dist/components/inputs/FormField/formFieldError.cva.d.ts +6 -0
  32. package/dist/components/inputs/FormField/formFieldError.cva.js +9 -0
  33. package/dist/components/inputs/FormField/formFieldHelper.cva.d.ts +6 -0
  34. package/dist/components/inputs/FormField/formFieldHelper.cva.js +9 -0
  35. package/dist/components/inputs/Input/shared/InputContent.js +1 -0
  36. package/dist/components/inputs/RadioGroup/RadioGroup.js +3 -3
  37. package/dist/components/inputs/RadioGroup/radio.cva.js +1 -0
  38. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -0
  39. package/dist/components/inputs/Selection/shared/SelectBase.js +2 -1
  40. package/dist/components/inputs/Selection/shared/SelectDesktop.js +4 -1
  41. package/dist/components/inputs/Selection/shared/SelectInput.js +1 -1
  42. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +1 -1
  43. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +1 -1
  44. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +1 -1
  45. package/dist/components/inputs/Selection/shared/SelectMobile.js +16 -12
  46. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +4 -1
  47. package/dist/components/inputs/Toggle/toggle.cva.js +1 -0
  48. package/dist/components/inputs/shared/CheckContent.js +1 -0
  49. package/dist/components/inputs/shared/label.cva.js +5 -0
  50. package/dist/components/overlays/BottomSheet/BottomSheet.d.ts +9 -0
  51. package/dist/components/overlays/BottomSheet/BottomSheet.js +52 -20
  52. package/dist/components/overlays/BottomSheet/BottomSheetHeader.d.ts +13 -0
  53. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +36 -0
  54. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +8 -10
  55. package/dist/components/shared/popover.cva.d.ts +4 -0
  56. package/dist/components/shared/popover.cva.js +3 -0
  57. package/dist/components/table/CellText.d.ts +2 -1
  58. package/dist/components/table/CellText.js +16 -10
  59. package/dist/components/table/ColumnConfig.js +1 -1
  60. package/dist/components/table/HeaderText.d.ts +5 -2
  61. package/dist/components/table/HeaderText.js +15 -7
  62. package/dist/components/table/Table.js +1 -1
  63. package/dist/components/table/table.cva.d.ts +6 -0
  64. package/dist/components/table/table.cva.js +3 -1
  65. package/dist/config/uiConfig.context.d.ts +7 -1
  66. package/dist/config/uiConfig.context.js +19 -1
  67. package/dist/config/uiStyle.context.d.ts +13 -1
  68. package/dist/index.js +2 -2
  69. package/dist/utils/file.utils.d.ts +4 -0
  70. package/dist/utils/file.utils.js +7 -2
  71. 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
  }
@@ -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.formatBytes = (size, decimals = 2) => {
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`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/ui",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",