@povio/ui 3.1.0 → 3.1.1
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/components/buttons/Button/button.cva.d.ts +3 -3
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +1 -1
- package/dist/components/inputs/File/FileUpload.js +4 -2
- package/dist/components/inputs/File/index.d.ts +1 -1
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +0 -11
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -18
- package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
- package/dist/components/status/Toast/toast.cva.d.ts +1 -1
- package/dist/config/uiOverrides.context.d.ts +11 -11
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -92,8 +92,8 @@ export declare const buttonIconSizeDefinition: {
|
|
|
92
92
|
export type ButtonIconSizeConfig = NonNullable<typeof buttonIconSizeDefinition.config>;
|
|
93
93
|
export declare const buttonTypography: (props: {
|
|
94
94
|
readonly width?: "fill" | "hug" | null | undefined;
|
|
95
|
-
readonly size?: "none" | "
|
|
96
|
-
readonly color?: "primary" | "dual" | "secondary" | "success" | "warning" |
|
|
97
|
-
readonly variant?: "
|
|
95
|
+
readonly size?: "none" | "s" | "xs" | "m" | "l" | null | undefined;
|
|
96
|
+
readonly color?: "error" | "primary" | "dual" | "secondary" | "success" | "warning" | null | undefined;
|
|
97
|
+
readonly variant?: "text" | "contained" | "outlined" | "subtle" | "ghost" | null | undefined;
|
|
98
98
|
readonly inverted?: boolean | null | undefined;
|
|
99
99
|
}) => TypographyVariantProps | undefined;
|
|
@@ -35,6 +35,6 @@ export declare const pillButtonContent: (props?: ({
|
|
|
35
35
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
36
36
|
export declare const pillButtonIconSize: string;
|
|
37
37
|
export declare const pillButtonTypography: (props: {
|
|
38
|
-
readonly color?: "
|
|
38
|
+
readonly color?: "error" | "primary" | "secondary" | "success" | "warning" | null | undefined;
|
|
39
39
|
readonly variant?: "contained" | "outlined" | "subtle" | null | undefined;
|
|
40
40
|
}) => TypographyVariantProps | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
1
2
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
2
3
|
import "../../../config/i18n.js";
|
|
3
4
|
import { FormField } from "../FormField/FormField.js";
|
|
@@ -5,7 +6,7 @@ import { FileUtils } from "../../../utils/file.utils.js";
|
|
|
5
6
|
import { FileCardList } from "./shared/FileCardList.js";
|
|
6
7
|
import { FileUploadContentEmpty } from "./shared/FileUploadContentEmpty.js";
|
|
7
8
|
import { FileUploadContent } from "./shared/FileUploadContent.js";
|
|
8
|
-
import {
|
|
9
|
+
import { fileUploadDropZoneDefinition } from "./shared/fileUpload.cva.js";
|
|
9
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
11
|
import { clsx } from "clsx";
|
|
11
12
|
import { useCallback, useState } from "react";
|
|
@@ -18,6 +19,7 @@ var FileUploadBase = (props) => {
|
|
|
18
19
|
const { t } = useTranslation("ui");
|
|
19
20
|
const { ref: _ref, label, tooltipText, variant = "vertical", as = "button", helperText, isRequired, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, allowsMultiple = false, hideLabel, acceptedFileTypes, clearOnSuccess, emptyText = t(($) => $.ui.fileUpload.emptyText), uploadText = t(($) => $.ui.fileUpload.uploadText), browseText = t(($) => $.ui.fileUpload.browse), fileUpload, fileRemove, children, listRenderer, onInvalidFileType, defaultState, ...rest } = props;
|
|
20
21
|
const ui = UIConfig.useConfig();
|
|
22
|
+
const fileUploadDropZoneCva = UIOverrides.useCva("fileUpload.dropZoneCva", fileUploadDropZoneDefinition);
|
|
21
23
|
const getInitialState = () => {
|
|
22
24
|
if (props.value != null && props.value.length > 0) return props.value;
|
|
23
25
|
if (!defaultState?.length) return [];
|
|
@@ -133,7 +135,7 @@ var FileUploadBase = (props) => {
|
|
|
133
135
|
"data-has-files": uploadState.length > 0 || void 0,
|
|
134
136
|
isDisabled,
|
|
135
137
|
onDrop: handleDrop,
|
|
136
|
-
className:
|
|
138
|
+
className: fileUploadDropZoneCva({
|
|
137
139
|
variant,
|
|
138
140
|
isContainer: !!children,
|
|
139
141
|
className: "group/file-upload-drop-zone"
|
|
@@ -6,4 +6,4 @@ export type { InputUploadBaseProps, InputUploadProps } from './InputUpload';
|
|
|
6
6
|
export { InputUpload } from './InputUpload';
|
|
7
7
|
export { FileCard } from './shared/FileCard';
|
|
8
8
|
export type { FileUploadDropZoneProps } from './shared/fileUpload.cva';
|
|
9
|
-
export {
|
|
9
|
+
export { fileUploadDropZoneDefinition } from './shared/fileUpload.cva';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ClassProp } from 'class-variance-authority/types';
|
|
2
1
|
import { UIOverrides } from '../../../../config/uiOverrides.context';
|
|
3
2
|
export declare const fileUploadDropZoneDefinition: {
|
|
4
3
|
base: string[];
|
|
@@ -16,13 +15,3 @@ export declare const fileUploadDropZoneDefinition: {
|
|
|
16
15
|
export type FileUploadDropZoneConfig = NonNullable<typeof fileUploadDropZoneDefinition.config>;
|
|
17
16
|
export interface FileUploadDropZoneProps extends UIOverrides.VariantProps<FileUploadDropZoneConfig> {
|
|
18
17
|
}
|
|
19
|
-
export declare const fileUploadDropZone: (props: FileUploadDropZoneProps & ClassProp) => string;
|
|
20
|
-
export declare const fileCardListDefinition: {
|
|
21
|
-
base: string[];
|
|
22
|
-
config: import("../../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
23
|
-
readonly variant: {
|
|
24
|
-
readonly vertical: ["flex-col"];
|
|
25
|
-
readonly horizontal: ["flex-row flex-wrap"];
|
|
26
|
-
};
|
|
27
|
-
}>;
|
|
28
|
-
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
2
|
//#region src/components/inputs/File/shared/fileUpload.cva.ts
|
|
5
3
|
var fileUploadDropZoneDefinition = UIOverrides.defineConfig({
|
|
6
4
|
base: ["relative w-full rounded-file-upload-container-rounding-default"],
|
|
@@ -40,20 +38,5 @@ var fileUploadDropZoneDefinition = UIOverrides.defineConfig({
|
|
|
40
38
|
defaultVariants: { variant: "vertical" }
|
|
41
39
|
}
|
|
42
40
|
});
|
|
43
|
-
var fileUploadDropZoneBase = cva(fileUploadDropZoneDefinition.base, fileUploadDropZoneDefinition.config);
|
|
44
|
-
var fileUploadDropZone = (props) => {
|
|
45
|
-
const { className, ...rest } = props;
|
|
46
|
-
return clsx(fileUploadDropZoneBase(rest), className);
|
|
47
|
-
};
|
|
48
|
-
var fileCardListDefinition = UIOverrides.defineConfig({
|
|
49
|
-
base: ["flex gap-3"],
|
|
50
|
-
config: {
|
|
51
|
-
variants: { variant: {
|
|
52
|
-
vertical: ["flex-col"],
|
|
53
|
-
horizontal: ["flex-row flex-wrap"]
|
|
54
|
-
} },
|
|
55
|
-
defaultVariants: { variant: "vertical" }
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
41
|
//#endregion
|
|
59
|
-
export {
|
|
42
|
+
export { fileUploadDropZoneDefinition };
|
|
@@ -43,7 +43,7 @@ export interface ToastVariantProps extends UIOverrides.VariantProps<ToastConfig>
|
|
|
43
43
|
}
|
|
44
44
|
export declare const buttonColorVariant: (props: {
|
|
45
45
|
readonly variant?: "contained" | "outlined" | null | undefined;
|
|
46
|
-
readonly color?: "
|
|
46
|
+
readonly color?: "error" | "success" | "warning" | "neutral" | null | undefined;
|
|
47
47
|
readonly position?: "bottom-right" | "bottom-left" | "top-right" | "top-left" | "bottom-center" | "top-center" | null | undefined;
|
|
48
48
|
}) => Pick<ButtonVariantProps, "color" | "inverted"> | undefined;
|
|
49
49
|
export declare const statusIconDefinition: {
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { ClassProp } from 'class-variance-authority/types';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
|
-
import { ButtonConfig, ButtonContentConfig, ButtonIconSizeConfig, ButtonSizeConfig } from '../components/buttons/Button/button.cva';
|
|
4
|
-
import { StatusIconConfig, StatusSeparatorConfig, ToastConfig, ToastContainerConfig } from '../components/status/Toast/toast.cva';
|
|
5
3
|
import { CompoundMapper, ConfigSchema } from '../utils/compoundMapper';
|
|
6
4
|
import { StyleMergeUtils } from '../utils/style-merge.util';
|
|
7
5
|
export declare namespace UIOverrides {
|
|
8
6
|
export type Cva<T> = (props?: (T & ClassProp) | ClassProp) => string;
|
|
9
7
|
type GenericCva = Cva<unknown>;
|
|
10
8
|
type Mapper = CompoundMapper<unknown, ConfigSchema>;
|
|
11
|
-
type CvaOption<TConfig extends StyleMergeUtils.CvaConfigShape> = StyleMergeUtils.CvaConfigOverride<TConfig> | GenericCva;
|
|
12
9
|
type GenericCvaOption = StyleMergeUtils.CvaConfigOverride | GenericCva;
|
|
13
10
|
type OptionKey = {
|
|
14
11
|
[K in keyof Options]: Options[K] extends object ? `${K & string}.${keyof Options[K] & string}` : never;
|
|
@@ -27,10 +24,10 @@ export declare namespace UIOverrides {
|
|
|
27
24
|
export type OverrideVariantProps<TOverride> = VariantProps<ExtractConfig<TOverride>>;
|
|
28
25
|
export interface Options {
|
|
29
26
|
button: {
|
|
30
|
-
cva?:
|
|
31
|
-
sizeCva?:
|
|
32
|
-
contentCva?:
|
|
33
|
-
iconSize?:
|
|
27
|
+
cva?: GenericCvaOption;
|
|
28
|
+
sizeCva?: GenericCvaOption;
|
|
29
|
+
contentCva?: GenericCvaOption;
|
|
30
|
+
iconSize?: GenericCvaOption;
|
|
34
31
|
typography?: Mapper;
|
|
35
32
|
};
|
|
36
33
|
pillButton: {
|
|
@@ -47,12 +44,12 @@ export declare namespace UIOverrides {
|
|
|
47
44
|
typography?: Mapper;
|
|
48
45
|
};
|
|
49
46
|
status: {
|
|
50
|
-
iconCva?:
|
|
51
|
-
separatorCva?:
|
|
47
|
+
iconCva?: GenericCvaOption;
|
|
48
|
+
separatorCva?: GenericCvaOption;
|
|
52
49
|
};
|
|
53
50
|
toast: {
|
|
54
|
-
cva?:
|
|
55
|
-
containerCva?:
|
|
51
|
+
cva?: GenericCvaOption;
|
|
52
|
+
containerCva?: GenericCvaOption;
|
|
56
53
|
buttonColor?: Mapper;
|
|
57
54
|
};
|
|
58
55
|
alert: {
|
|
@@ -155,6 +152,9 @@ export declare namespace UIOverrides {
|
|
|
155
152
|
fillCva?: GenericCvaOption;
|
|
156
153
|
valueCva?: GenericCvaOption;
|
|
157
154
|
};
|
|
155
|
+
fileUpload: {
|
|
156
|
+
dropZoneCva?: GenericCvaOption;
|
|
157
|
+
};
|
|
158
158
|
}
|
|
159
159
|
export type Config = Partial<Options>;
|
|
160
160
|
interface ProviderProps {
|
package/dist/index.d.ts
CHANGED
|
@@ -178,7 +178,7 @@ export { breadcrumbChevronDefinition, breadcrumbIconDefinition, breadcrumbItemDe
|
|
|
178
178
|
export { buttonContentDefinition, buttonDefinition, buttonIconSizeDefinition, buttonSizeDefinition, } from './components/buttons/Button/button.cva';
|
|
179
179
|
export { pillButtonContentDefinition, pillButtonDefinition } from './components/buttons/PillButton/pillButton.cva';
|
|
180
180
|
export { checkboxDefinition, checkboxIconDefinition } from './components/inputs/Checkbox/checkbox.cva';
|
|
181
|
-
export {
|
|
181
|
+
export { fileUploadDropZoneDefinition } from './components/inputs/File/shared/fileUpload.cva';
|
|
182
182
|
export { inputUploadButtonDefinition, inputUploadDropZoneDefinition, } from './components/inputs/File/shared/inputUploadButton.cva';
|
|
183
183
|
export { progressBarDefinition, progressBarFillDefinition, progressBarTrackDefinition, progressBarTrackWrapperDefinition, progressBarValueDefinition, } from './components/inputs/File/shared/progressBar.cva';
|
|
184
184
|
export type { ProgressBarConfig, ProgressBarTrackConfig, ProgressBarVariantProps, } from './components/inputs/File/shared/progressBar.cva';
|
package/dist/index.js
CHANGED
|
@@ -97,7 +97,7 @@ import { RestUtils } from "./utils/rest.utils.js";
|
|
|
97
97
|
import { FileUtils } from "./utils/file.utils.js";
|
|
98
98
|
import { progressBarDefinition, progressBarFillDefinition, progressBarTrackDefinition, progressBarTrackWrapperDefinition, progressBarValueDefinition } from "./components/inputs/File/shared/progressBar.cva.js";
|
|
99
99
|
import { ProgressBar } from "./components/inputs/File/shared/ProgressBar.js";
|
|
100
|
-
import {
|
|
100
|
+
import { fileUploadDropZoneDefinition } from "./components/inputs/File/shared/fileUpload.cva.js";
|
|
101
101
|
import { FileUpload } from "./components/inputs/File/FileUpload.js";
|
|
102
102
|
import { FileUploadContainer } from "./components/inputs/File/FileUploadContainer.js";
|
|
103
103
|
import { inputUploadButtonDefinition, inputUploadDropZoneDefinition } from "./components/inputs/File/shared/inputUploadButton.cva.js";
|
|
@@ -165,4 +165,4 @@ import { useSorting } from "./hooks/useSorting.js";
|
|
|
165
165
|
import { useTableColumnConfig } from "./hooks/useTableColumnConfig.js";
|
|
166
166
|
import { ArrayUtils } from "./utils/array.utils.js";
|
|
167
167
|
import { QueriesUtils } from "./utils/queries.utils.js";
|
|
168
|
-
export { Accordion, ActionModal, Alert, AlignCenterIcon, AlignLeftIcon, AlignLeftRightIcon, AlignRightIcon, ArrayUtils, ArrowDropDownIcon, ArrowDropUpIcon, ArrowLeftIcon, ArrowRightIcon, Autocomplete, BoldIcon, BottomSheet, Breadcrumbs, BulletedListIcon, Button, CalendarIcon, CellText, CheckIcon, Checkbox, CheckboxCheckmarkIcon, CheckboxIndeterminateIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsLeftIcon, ChevronsRightIcon, ClockIcon, CloseIcon, ColumnConfigModal, Confirmation, DatePicker, DateRangePicker, DateTimeIcon, DateTimePicker, DateTimeUtils, DateUtils, DomUtils, Drawer, FileUpload, FileUploadContainer, FileUtils, Form, FormField, HeaderText, HighlightIcon, HighlightOnIcon, HomeIcon, IconButton, InfiniteTable, InfoIcon, InlineIconButton, InputUpload, Inputs, ItalicIcon, Link, LinkContext, LinkIcon, Loader, Menu, MenuIcon, MenuItem, MenuPopover, Modal, NumberInput, NumberedListIcon, ObjectUtils, PaginatedTable, Pagination, PaginationList, PasswordInput, Pill, PillButton, PointerHorizontalIcon, PointerVerticalIcon, ProgressBar, QueriesUtils, QueryAutocomplete, RadioGroup, ResponsivePopover, RestUtils, RoutingUtils, Segment, Select, SendIcon, Slider, SplitButton, Stepper, StrikethroughIcon, StringUtils, Table, Tag, TextArea, TextButton, TextColorIcon, TextInput, ThemeContext, TimePicker, Toast, ToastContainer, Toggle, ToggleButton, Tooltip, TooltipEllipsis, Typography, UIConfig, UIOverrides, UIRouter, UnderlinedIcon, VisibilityIcon, VisibilityOffIcon, accordionChevronDefinition, accordionDefinition, accordionHeadingDefinition, accordionHeadingSubtitleDefinition, accordionHeadingTitleDefinition, accordionIconDefinition, accordionItemDefinition, accordionPanelContentDefinition, accordionPanelDefinition, accordionTriggerDefinition, alertDefinition, breadcrumbChevronDefinition, breadcrumbIconDefinition, breadcrumbItemDefinition, breadcrumbSegmentDefinition, breadcrumbsDefinition, buttonContentDefinition, buttonDefinition, buttonIconSizeDefinition, buttonSizeDefinition, checkboxDefinition, checkboxIconDefinition, compoundMapper, dynamicColumns, dynamicInputs,
|
|
168
|
+
export { Accordion, ActionModal, Alert, AlignCenterIcon, AlignLeftIcon, AlignLeftRightIcon, AlignRightIcon, ArrayUtils, ArrowDropDownIcon, ArrowDropUpIcon, ArrowLeftIcon, ArrowRightIcon, Autocomplete, BoldIcon, BottomSheet, Breadcrumbs, BulletedListIcon, Button, CalendarIcon, CellText, CheckIcon, Checkbox, CheckboxCheckmarkIcon, CheckboxIndeterminateIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsLeftIcon, ChevronsRightIcon, ClockIcon, CloseIcon, ColumnConfigModal, Confirmation, DatePicker, DateRangePicker, DateTimeIcon, DateTimePicker, DateTimeUtils, DateUtils, DomUtils, Drawer, FileUpload, FileUploadContainer, FileUtils, Form, FormField, HeaderText, HighlightIcon, HighlightOnIcon, HomeIcon, IconButton, InfiniteTable, InfoIcon, InlineIconButton, InputUpload, Inputs, ItalicIcon, Link, LinkContext, LinkIcon, Loader, Menu, MenuIcon, MenuItem, MenuPopover, Modal, NumberInput, NumberedListIcon, ObjectUtils, PaginatedTable, Pagination, PaginationList, PasswordInput, Pill, PillButton, PointerHorizontalIcon, PointerVerticalIcon, ProgressBar, QueriesUtils, QueryAutocomplete, RadioGroup, ResponsivePopover, RestUtils, RoutingUtils, Segment, Select, SendIcon, Slider, SplitButton, Stepper, StrikethroughIcon, StringUtils, Table, Tag, TextArea, TextButton, TextColorIcon, TextInput, ThemeContext, TimePicker, Toast, ToastContainer, Toggle, ToggleButton, Tooltip, TooltipEllipsis, Typography, UIConfig, UIOverrides, UIRouter, UnderlinedIcon, VisibilityIcon, VisibilityOffIcon, accordionChevronDefinition, accordionDefinition, accordionHeadingDefinition, accordionHeadingSubtitleDefinition, accordionHeadingTitleDefinition, accordionIconDefinition, accordionItemDefinition, accordionPanelContentDefinition, accordionPanelDefinition, accordionTriggerDefinition, alertDefinition, breadcrumbChevronDefinition, breadcrumbIconDefinition, breadcrumbItemDefinition, breadcrumbSegmentDefinition, breadcrumbsDefinition, buttonContentDefinition, buttonDefinition, buttonIconSizeDefinition, buttonSizeDefinition, checkboxDefinition, checkboxIconDefinition, compoundMapper, dynamicColumns, dynamicInputs, fileUploadDropZoneDefinition, formFieldErrorDefinition, formFieldHelperDefinition, inputBaseDefinition, inputSideDefinition, inputSizeDefinition, inputUploadButtonDefinition, inputUploadDropZoneDefinition, isEqual, labelDefinition, linkDefinition, loaderDefinition, loaderWrapperDefinition, logger, menuDefinition, menuItemDefinition, menuPopoverDefinition, menuPopoverWrapperDefinition, modalContentDefinition, modalMainDefinition, modalOverlayDefinition, ns, pillButtonContentDefinition, pillButtonDefinition, popoverDefinition, progressBarDefinition, progressBarFillDefinition, progressBarTrackDefinition, progressBarTrackWrapperDefinition, progressBarValueDefinition, radioDefinition, resources, segmentDefinition, segmentItemDefinition, selectListBoxItemDefinition, statusIconDefinition, statusSeparatorDefinition, stepperDefinition, stepperIconDefinition, stepperItemDefinition, stepperNumberDefinition, stepperSeparatorDefinition, stepperSubtextDefinition, stepperTitleDefinition, tableCellTextDefinition, tableDataDefinition, tableHeadDataDefinition, tableHeadRowDefinition, tableHeaderTextDefinition, tableRowDefinition, tagDefinition, toastDefinition, statusIconDefinition$1 as toastStatusIconDefinition, statusSeparatorDefinition$1 as toastStatusSeparatorDefinition, toggleDefinition, tooltipDefinition, tooltipPointerHorizontalDefinition, tooltipPointerVerticalDefinition, tooltipTextDefinition, typographyDefinition, uiOutlineClass, useAutosave, useBreakpoint, useDebounceCallback, useDeepCompareEffect, useDeepCompareLayoutEffect, useDeepCompareMemo, useFilters, useForm, useFormAutosave, useIntersectionObserver, useLocalStorage, useLongPressRepeat, usePagination, useScrollableListBox, useSorting, useStateAndRef, useTableColumnConfig, useTableNav, useToast, useTranslationMemo };
|