@povio/ui 2.3.2 → 3.0.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/dist/assets/locales/sl/translation.json.js +2 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.js +11 -11
- package/dist/components/Breadcrumbs/breadcrumbs.cva.d.ts +40 -14
- package/dist/components/Breadcrumbs/breadcrumbs.cva.js +21 -18
- package/dist/components/Menu/MenuItem.js +4 -4
- package/dist/components/Menu/MenuMobile.js +6 -6
- package/dist/components/Menu/MenuPopover.js +8 -8
- package/dist/components/Menu/menu.cva.d.ts +35 -13
- package/dist/components/Menu/menu.cva.js +30 -24
- package/dist/components/buttons/Button/Button.js +7 -7
- package/dist/components/buttons/Button/button.cva.d.ts +95 -26
- package/dist/components/buttons/Button/button.cva.js +601 -589
- package/dist/components/buttons/PillButton/PillButton.js +4 -4
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +33 -9
- package/dist/components/buttons/PillButton/pillButton.cva.js +247 -239
- package/dist/components/buttons/shared/ButtonContent.js +3 -3
- package/dist/components/buttons/shared/buttonContent.cva.d.ts +3 -5
- package/dist/components/buttons/shared/buttonContent.cva.js +1 -8
- package/dist/components/inputs/Checkbox/Checkbox.js +2 -2
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +4 -4
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +23 -10
- package/dist/components/inputs/Checkbox/checkbox.cva.js +46 -40
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +150 -68
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +4 -4
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +3 -3
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +4 -4
- package/dist/components/inputs/File/shared/InputUploadContent.js +3 -3
- package/dist/components/inputs/File/shared/InputUploadFilled.js +3 -3
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +26 -9
- package/dist/components/inputs/File/shared/fileUpload.cva.js +48 -40
- package/dist/components/inputs/File/shared/inputUploadButton.cva.d.ts +23 -6
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +29 -20
- package/dist/components/inputs/FormField/FormFieldError.js +3 -3
- package/dist/components/inputs/FormField/FormFieldHelper.js +3 -3
- package/dist/components/inputs/FormField/FormFieldLabel.js +6 -6
- package/dist/components/inputs/FormField/formFieldError.cva.d.ts +12 -5
- package/dist/components/inputs/FormField/formFieldError.cva.js +11 -8
- package/dist/components/inputs/FormField/formFieldHelper.cva.d.ts +12 -5
- package/dist/components/inputs/FormField/formFieldHelper.cva.js +11 -8
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +3 -3
- package/dist/components/inputs/Input/TextArea/TextArea.js +4 -4
- package/dist/components/inputs/Input/TextInput/TextInput.js +3 -3
- package/dist/components/inputs/Input/shared/InputContent.js +5 -5
- package/dist/components/inputs/RadioGroup/RadioGroup.js +4 -4
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +12 -6
- package/dist/components/inputs/RadioGroup/radio.cva.js +27 -24
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +3 -3
- package/dist/components/inputs/Selection/shared/SelectInput.js +4 -4
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +3 -3
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +3 -3
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +3 -3
- package/dist/components/inputs/Selection/shared/selectItem.cva.d.ts +16 -6
- package/dist/components/inputs/Selection/shared/selectItem.cva.js +21 -18
- package/dist/components/inputs/TextEditor/TextEditor.js +3 -3
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +3 -3
- package/dist/components/inputs/Toggle/Toggle.js +4 -4
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +12 -6
- package/dist/components/inputs/Toggle/toggle.cva.js +24 -21
- package/dist/components/inputs/shared/CheckContent.js +3 -3
- package/dist/components/inputs/shared/input.cva.d.ts +55 -16
- package/dist/components/inputs/shared/input.cva.js +279 -271
- package/dist/components/inputs/shared/label.cva.d.ts +15 -6
- package/dist/components/inputs/shared/label.cva.js +28 -25
- package/dist/components/navigation/Accordion/Accordion.js +3 -3
- package/dist/components/navigation/Accordion/AccordionItem.js +11 -11
- package/dist/components/navigation/Accordion/accordion.cva.d.ts +109 -44
- package/dist/components/navigation/Accordion/accordion.cva.js +114 -84
- package/dist/components/navigation/Stepper/Stepper.js +3 -3
- package/dist/components/navigation/Stepper/StepperItem.js +12 -12
- package/dist/components/navigation/Stepper/StepperSeparator.js +3 -3
- package/dist/components/navigation/Stepper/stepper.cva.d.ts +86 -30
- package/dist/components/navigation/Stepper/stepper.cva.js +104 -83
- package/dist/components/overlays/Modal/Modal.js +5 -5
- package/dist/components/overlays/Modal/modal.cva.d.ts +34 -9
- package/dist/components/overlays/Modal/modal.cva.js +38 -27
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +3 -3
- package/dist/components/overlays/Tooltip/Tooltip.js +9 -9
- package/dist/components/overlays/Tooltip/tooltip.cva.d.ts +45 -17
- package/dist/components/overlays/Tooltip/tooltip.cva.js +38 -26
- package/dist/components/segment/Segment.js +4 -4
- package/dist/components/segment/SegmentItem.js +4 -4
- package/dist/components/segment/segment.cva.d.ts +18 -7
- package/dist/components/segment/segment.cva.js +24 -21
- package/dist/components/shared/popover.cva.d.ts +7 -3
- package/dist/components/shared/popover.cva.js +3 -3
- package/dist/components/status/Alert/Alert.js +6 -6
- package/dist/components/status/Alert/alert.cva.d.ts +18 -6
- package/dist/components/status/Alert/alert.cva.js +60 -57
- package/dist/components/status/Loader/loader.cva.d.ts +23 -4
- package/dist/components/status/Loader/loader.cva.js +22 -13
- package/dist/components/status/Toast/Toast.js +6 -7
- package/dist/components/status/Toast/toast.cva.d.ts +61 -10
- package/dist/components/status/Toast/toast.cva.js +129 -64
- package/dist/components/status/shared/status.cva.d.ts +30 -8
- package/dist/components/status/shared/status.cva.js +56 -50
- package/dist/components/table/CellText.js +3 -3
- package/dist/components/table/HeaderText.js +3 -3
- package/dist/components/table/Table.js +6 -6
- package/dist/components/table/table.cva.d.ts +52 -19
- package/dist/components/table/table.cva.js +44 -35
- package/dist/components/text/Link/Link.js +3 -3
- package/dist/components/text/Link/link.cva.d.ts +11 -5
- package/dist/components/text/Link/link.cva.js +8 -5
- package/dist/components/text/Tag/Tag.js +3 -3
- package/dist/components/text/Tag/tag.cva.d.ts +15 -5
- package/dist/components/text/Tag/tag.cva.js +51 -48
- package/dist/components/text/Typography/Typography.js +3 -3
- package/dist/components/text/Typography/typography.cva.d.ts +48 -7
- package/dist/components/text/Typography/typography.cva.js +125 -122
- package/dist/config/uiOverrides.context.d.ts +174 -0
- package/dist/config/uiOverrides.context.js +73 -0
- package/dist/index.d.ts +29 -1
- package/dist/index.js +30 -2
- package/dist/utils/style-merge.util.d.ts +43 -0
- package/dist/utils/style-merge.util.js +233 -0
- package/dist/utils/style-merge.util.spec.d.ts +1 -0
- package/package.json +1 -1
- package/dist/config/uiStyle.context.d.ts +0 -162
- package/dist/config/uiStyle.context.js +0 -30
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
2
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
3
3
|
import { Button as Button$1 } from "../../../buttons/Button/Button.js";
|
|
4
4
|
import "../../../../config/i18n.js";
|
|
5
5
|
import { TextButton } from "../../../buttons/TextButton/TextButton.js";
|
|
6
|
-
import {
|
|
6
|
+
import { inputSizeDefinition } from "../../shared/input.cva.js";
|
|
7
7
|
import { UploadIcon } from "../../../../assets/icons/Upload.js";
|
|
8
8
|
import { inputButtonSizeMapping } from "../inputUpload.types.js";
|
|
9
9
|
import { inputUploadButton, inputUploadDropZone } from "./inputUploadButton.cva.js";
|
|
@@ -15,7 +15,7 @@ import { useTranslation } from "react-i18next";
|
|
|
15
15
|
var InputUploadContent = (props) => {
|
|
16
16
|
const { variant, isDisabled, error, placeholder, buttonText, size, ...rest } = props;
|
|
17
17
|
const { t } = useTranslation("ui");
|
|
18
|
-
const inputSizeCva =
|
|
18
|
+
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
19
19
|
return /* @__PURE__ */ jsx(FileTrigger, {
|
|
20
20
|
...rest,
|
|
21
21
|
children: /* @__PURE__ */ jsxs("div", {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { CloseIcon } from "../../../../assets/icons/Close.js";
|
|
2
|
-
import {
|
|
2
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
3
3
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
4
4
|
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
5
|
-
import {
|
|
5
|
+
import { inputSizeDefinition } from "../../shared/input.cva.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { clsx } from "clsx";
|
|
8
8
|
//#region src/components/inputs/File/shared/InputUploadFilled.tsx
|
|
9
9
|
var InputUploadFilled = ({ files, onRemove, isDisabled, size }) => {
|
|
10
10
|
return /* @__PURE__ */ jsxs("div", {
|
|
11
|
-
className: clsx("flex items-center rounded-input-rounding-default border border-input-outlined-outline-idle border-solid bg-input-outlined-idle",
|
|
11
|
+
className: clsx("flex items-center rounded-input-rounding-default border border-input-outlined-outline-idle border-solid bg-input-outlined-idle", UIOverrides.useCva("input.sizeCva", inputSizeDefinition)({ size })),
|
|
12
12
|
children: [/* @__PURE__ */ jsx(Typography, {
|
|
13
13
|
variant: "default",
|
|
14
14
|
size: "label-1",
|
|
@@ -1,11 +1,28 @@
|
|
|
1
|
-
import { VariantProps } from 'class-variance-authority';
|
|
2
1
|
import { ClassProp } from 'class-variance-authority/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { UIOverrides } from '../../../../config/uiOverrides.context';
|
|
3
|
+
export declare const fileUploadDropZoneDefinition: {
|
|
4
|
+
base: string[];
|
|
5
|
+
config: import("../../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
6
|
+
readonly variant: {
|
|
7
|
+
readonly vertical: ["flex-col justify-center"];
|
|
8
|
+
readonly horizontal: ["flex-row justify-between"];
|
|
9
|
+
};
|
|
10
|
+
readonly isContainer: {
|
|
11
|
+
readonly true: ["data-[drop-target]:before:content-['']", "data-[drop-target]:before:absolute", "data-[drop-target]:before:z-40", "data-[drop-target]:before:width-full", "data-[drop-target]:before:height-full", "data-[drop-target]:before:top-0", "data-[drop-target]:before:left-0", "data-[drop-target]:border data-[drop-target]:border-dashed", "data-[drop-target]:border-elevation-outline-default-2", "data-[drop-target]:before:pointer-events-none data-[drop-target]:before:inset-0", "data-[drop-target]:before:bg-elevation-fill-default-2"];
|
|
12
|
+
readonly false: ["flex items-center", "py-file-upload-container-height-top-bottom", "px-file-upload-container-side-default", "gap-gap-file-upload-content-gap-icon-to-content", "border border-input-outlined-outline-idle border-dashed bg-input-outlined-idle", "hover:border-elevation-outline-default-2 hover:bg-elevation-fill-default-2", "invalid:border invalid:border-input-outlined-outline-error", "data-[drop-target]:border-elevation-outline-default-2 data-[drop-target]:bg-elevation-fill-default-2", "data-[has-files]:border-solid"];
|
|
13
|
+
};
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
export type FileUploadDropZoneConfig = NonNullable<typeof fileUploadDropZoneDefinition.config>;
|
|
17
|
+
export interface FileUploadDropZoneProps extends UIOverrides.VariantProps<FileUploadDropZoneConfig> {
|
|
18
|
+
}
|
|
8
19
|
export declare const fileUploadDropZone: (props: FileUploadDropZoneProps & ClassProp) => string;
|
|
9
|
-
export declare const
|
|
10
|
-
|
|
11
|
-
|
|
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,51 +1,59 @@
|
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
1
2
|
import { clsx } from "clsx";
|
|
2
3
|
import { cva } from "class-variance-authority";
|
|
3
4
|
//#region src/components/inputs/File/shared/fileUpload.cva.ts
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
var fileUploadDropZoneDefinition = UIOverrides.defineConfig({
|
|
6
|
+
base: ["relative w-full rounded-file-upload-container-rounding-default"],
|
|
7
|
+
config: {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
vertical: ["flex-col justify-center"],
|
|
11
|
+
horizontal: ["flex-row justify-between"]
|
|
12
|
+
},
|
|
13
|
+
isContainer: {
|
|
14
|
+
true: [
|
|
15
|
+
"data-[drop-target]:before:content-['']",
|
|
16
|
+
"data-[drop-target]:before:absolute",
|
|
17
|
+
"data-[drop-target]:before:z-40",
|
|
18
|
+
"data-[drop-target]:before:width-full",
|
|
19
|
+
"data-[drop-target]:before:height-full",
|
|
20
|
+
"data-[drop-target]:before:top-0",
|
|
21
|
+
"data-[drop-target]:before:left-0",
|
|
22
|
+
"data-[drop-target]:border data-[drop-target]:border-dashed",
|
|
23
|
+
"data-[drop-target]:border-elevation-outline-default-2",
|
|
24
|
+
"data-[drop-target]:before:pointer-events-none data-[drop-target]:before:inset-0",
|
|
25
|
+
"data-[drop-target]:before:bg-elevation-fill-default-2"
|
|
26
|
+
],
|
|
27
|
+
false: [
|
|
28
|
+
"flex items-center",
|
|
29
|
+
"py-file-upload-container-height-top-bottom",
|
|
30
|
+
"px-file-upload-container-side-default",
|
|
31
|
+
"gap-gap-file-upload-content-gap-icon-to-content",
|
|
32
|
+
"border border-input-outlined-outline-idle border-dashed bg-input-outlined-idle",
|
|
33
|
+
"hover:border-elevation-outline-default-2 hover:bg-elevation-fill-default-2",
|
|
34
|
+
"invalid:border invalid:border-input-outlined-outline-error",
|
|
35
|
+
"data-[drop-target]:border-elevation-outline-default-2 data-[drop-target]:bg-elevation-fill-default-2",
|
|
36
|
+
"data-[has-files]:border-solid"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
9
39
|
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"data-[drop-target]:before:content-['']",
|
|
13
|
-
"data-[drop-target]:before:absolute",
|
|
14
|
-
"data-[drop-target]:before:z-40",
|
|
15
|
-
"data-[drop-target]:before:width-full",
|
|
16
|
-
"data-[drop-target]:before:height-full",
|
|
17
|
-
"data-[drop-target]:before:top-0",
|
|
18
|
-
"data-[drop-target]:before:left-0",
|
|
19
|
-
"data-[drop-target]:border data-[drop-target]:border-dashed",
|
|
20
|
-
"data-[drop-target]:border-elevation-outline-default-2",
|
|
21
|
-
"data-[drop-target]:before:pointer-events-none data-[drop-target]:before:inset-0",
|
|
22
|
-
"data-[drop-target]:before:bg-elevation-fill-default-2"
|
|
23
|
-
],
|
|
24
|
-
false: [
|
|
25
|
-
"flex items-center",
|
|
26
|
-
"py-file-upload-container-height-top-bottom",
|
|
27
|
-
"px-file-upload-container-side-default",
|
|
28
|
-
"gap-gap-file-upload-content-gap-icon-to-content",
|
|
29
|
-
"border border-input-outlined-outline-idle border-dashed bg-input-outlined-idle",
|
|
30
|
-
"hover:border-elevation-outline-default-2 hover:bg-elevation-fill-default-2",
|
|
31
|
-
"invalid:border invalid:border-input-outlined-outline-error",
|
|
32
|
-
"data-[drop-target]:border-elevation-outline-default-2 data-[drop-target]:bg-elevation-fill-default-2",
|
|
33
|
-
"data-[has-files]:border-solid"
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
defaultVariants: { variant: "vertical" }
|
|
40
|
+
defaultVariants: { variant: "vertical" }
|
|
41
|
+
}
|
|
38
42
|
});
|
|
43
|
+
var fileUploadDropZoneBase = cva(fileUploadDropZoneDefinition.base, fileUploadDropZoneDefinition.config);
|
|
39
44
|
var fileUploadDropZone = (props) => {
|
|
40
45
|
const { className, ...rest } = props;
|
|
41
46
|
return clsx(fileUploadDropZoneBase(rest), className);
|
|
42
47
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
+
}
|
|
49
57
|
});
|
|
50
58
|
//#endregion
|
|
51
|
-
export { fileUploadDropZone };
|
|
59
|
+
export { fileCardListDefinition, fileUploadDropZone, fileUploadDropZoneDefinition };
|
|
@@ -1,10 +1,27 @@
|
|
|
1
|
-
import { VariantProps } from 'class-variance-authority';
|
|
2
1
|
import { ClassProp } from 'class-variance-authority/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { UIOverrides } from '../../../../config/uiOverrides.context';
|
|
3
|
+
export declare const inputUploadButtonDefinition: {
|
|
4
|
+
base: string[];
|
|
5
|
+
config: import("../../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
6
|
+
readonly variant: {
|
|
7
|
+
readonly default: [];
|
|
8
|
+
readonly nested: [];
|
|
9
|
+
};
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
export type InputUploadButtonConfig = NonNullable<typeof inputUploadButtonDefinition.config>;
|
|
13
|
+
export interface InputUploadButtonProps extends UIOverrides.VariantProps<InputUploadButtonConfig> {
|
|
14
|
+
}
|
|
7
15
|
export declare const inputUploadButton: (props: InputUploadButtonProps & ClassProp) => string;
|
|
16
|
+
export declare const inputUploadDropZoneDefinition: {
|
|
17
|
+
base: string[];
|
|
18
|
+
config: import("../../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
19
|
+
readonly variant: {
|
|
20
|
+
readonly default: ["rounded-input-rounding-default border border-input-outlined-outline-idle border-solid bg-input-outlined-idle"];
|
|
21
|
+
readonly nested: ["rounded-input-rounding-default border border-input-outlined-outline-idle border-solid bg-input-outlined-idle"];
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
8
25
|
export declare const inputUploadDropZone: (props?: ({
|
|
9
|
-
variant?: "default" | "nested" | null | undefined;
|
|
26
|
+
readonly variant?: "default" | "nested" | null | undefined;
|
|
10
27
|
} & ClassProp) | undefined) => string;
|
|
@@ -1,30 +1,39 @@
|
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
1
2
|
import { clsx } from "clsx";
|
|
2
3
|
import { cva } from "class-variance-authority";
|
|
3
4
|
//#region src/components/inputs/File/shared/inputUploadButton.cva.ts
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
var inputUploadButtonDefinition = UIOverrides.defineConfig({
|
|
6
|
+
base: ["flex w-full items-center justify-between gap-input-gap-input-to-button-gap"],
|
|
7
|
+
config: {
|
|
8
|
+
variants: { variant: {
|
|
9
|
+
default: [],
|
|
10
|
+
nested: []
|
|
11
|
+
} },
|
|
12
|
+
defaultVariants: { variant: "default" }
|
|
13
|
+
}
|
|
10
14
|
});
|
|
15
|
+
var inputUploadButtonBase = cva(inputUploadButtonDefinition.base, inputUploadButtonDefinition.config);
|
|
11
16
|
var inputUploadButton = (props) => {
|
|
12
17
|
const { className, ...rest } = props;
|
|
13
18
|
return clsx(inputUploadButtonBase(rest), className);
|
|
14
19
|
};
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
var inputUploadDropZoneDefinition = UIOverrides.defineConfig({
|
|
21
|
+
base: [
|
|
22
|
+
"relative",
|
|
23
|
+
"min-w-0 flex-1",
|
|
24
|
+
"flex items-center",
|
|
25
|
+
"group-invalid/input-upload:border group-invalid/input-upload:border-input-outlined-outline-error",
|
|
26
|
+
"data-[drop-target]:border-input-outlined-outline-hover",
|
|
27
|
+
"hover:border-input-outlined-outline-hover"
|
|
28
|
+
],
|
|
29
|
+
config: {
|
|
30
|
+
variants: { variant: {
|
|
31
|
+
default: ["rounded-input-rounding-default border border-input-outlined-outline-idle border-solid bg-input-outlined-idle"],
|
|
32
|
+
nested: ["rounded-input-rounding-default border border-input-outlined-outline-idle border-solid bg-input-outlined-idle"]
|
|
33
|
+
} },
|
|
34
|
+
defaultVariants: { variant: "default" }
|
|
35
|
+
}
|
|
28
36
|
});
|
|
37
|
+
var inputUploadDropZone = cva(inputUploadDropZoneDefinition.base, inputUploadDropZoneDefinition.config);
|
|
29
38
|
//#endregion
|
|
30
|
-
export { inputUploadButton, inputUploadDropZone };
|
|
39
|
+
export { inputUploadButton, inputUploadButtonDefinition, inputUploadDropZone, inputUploadDropZoneDefinition };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
|
+
import { formFieldErrorDefinition } from "./formFieldError.cva.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { clsx } from "clsx";
|
|
5
5
|
//#region src/components/inputs/FormField/FormFieldError.tsx
|
|
6
6
|
var FormFieldError = ({ error, isDisabled, isHidden, className }) => {
|
|
7
7
|
return /* @__PURE__ */ jsx("p", {
|
|
8
|
-
className: clsx(
|
|
8
|
+
className: clsx(UIOverrides.useCva("formField.errorLabelCva", formFieldErrorDefinition)({ visible: !!error && !isDisabled && !isHidden }), className),
|
|
9
9
|
children: error
|
|
10
10
|
});
|
|
11
11
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
|
+
import { formFieldHelperDefinition } from "./formFieldHelper.cva.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { clsx } from "clsx";
|
|
5
5
|
//#region src/components/inputs/FormField/FormFieldHelper.tsx
|
|
6
6
|
var FormFieldHelper = ({ helperText, isDisabled, isHidden, hasError, className }) => {
|
|
7
7
|
return /* @__PURE__ */ jsx("p", {
|
|
8
|
-
className: clsx(
|
|
8
|
+
className: clsx(UIOverrides.useCva("formField.helperLabelCva", formFieldHelperDefinition)({ visible: !!helperText && !isDisabled && !isHidden && !hasError }), className),
|
|
9
9
|
slot: "description",
|
|
10
10
|
children: helperText
|
|
11
11
|
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
|
+
import { typographyDefinition } from "../../text/Typography/typography.cva.js";
|
|
3
|
+
import { labelDefinition, labelTypography } from "../shared/label.cva.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { clsx } from "clsx";
|
|
6
6
|
import { Label } from "react-aria-components";
|
|
7
7
|
//#region src/components/inputs/FormField/FormFieldLabel.tsx
|
|
8
8
|
var FormFieldLabel = ({ ref, as, label, isRequired, isDisabled, labelProps, className }) => {
|
|
9
|
-
const typographyCva =
|
|
10
|
-
const labelTypographyMap =
|
|
11
|
-
const labelBaseCva =
|
|
9
|
+
const typographyCva = UIOverrides.useCva("typography.cva", typographyDefinition);
|
|
10
|
+
const labelTypographyMap = UIOverrides.useMapper("label.typography", labelTypography);
|
|
11
|
+
const labelBaseCva = UIOverrides.useCva("label.cva", labelDefinition);
|
|
12
12
|
return /* @__PURE__ */ jsxs(Label, {
|
|
13
13
|
...labelProps,
|
|
14
14
|
ref,
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { UIOverrides } from '../../../config/uiOverrides.context';
|
|
2
|
+
export declare const formFieldErrorDefinition: {
|
|
3
|
+
base: string[];
|
|
4
|
+
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
5
|
+
readonly visible: {
|
|
6
|
+
readonly true: "mt-1-5";
|
|
7
|
+
readonly false: "sr-only";
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
export type FormFieldErrorConfig = NonNullable<typeof formFieldErrorDefinition.config>;
|
|
12
|
+
export interface FormFieldErrorVariantProps extends UIOverrides.VariantProps<FormFieldErrorConfig> {
|
|
6
13
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
//#region src/components/inputs/FormField/formFieldError.cva.ts
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
var formFieldErrorDefinition = UIOverrides.defineConfig({
|
|
4
|
+
base: ["text-label-3 text-text-error-1"],
|
|
5
|
+
config: {
|
|
6
|
+
variants: { visible: {
|
|
7
|
+
true: "mt-1-5",
|
|
8
|
+
false: "sr-only"
|
|
9
|
+
} },
|
|
10
|
+
defaultVariants: { visible: false }
|
|
11
|
+
}
|
|
9
12
|
});
|
|
10
13
|
//#endregion
|
|
11
|
-
export {
|
|
14
|
+
export { formFieldErrorDefinition };
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { UIOverrides } from '../../../config/uiOverrides.context';
|
|
2
|
+
export declare const formFieldHelperDefinition: {
|
|
3
|
+
base: string[];
|
|
4
|
+
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
5
|
+
readonly visible: {
|
|
6
|
+
readonly true: "mt-1-5";
|
|
7
|
+
readonly false: "sr-only";
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
export type FormFieldHelperConfig = NonNullable<typeof formFieldHelperDefinition.config>;
|
|
12
|
+
export interface FormFieldHelperVariantProps extends UIOverrides.VariantProps<FormFieldHelperConfig> {
|
|
6
13
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
//#region src/components/inputs/FormField/formFieldHelper.cva.ts
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
var formFieldHelperDefinition = UIOverrides.defineConfig({
|
|
4
|
+
base: ["text-label-3 text-text-default-2"],
|
|
5
|
+
config: {
|
|
6
|
+
variants: { visible: {
|
|
7
|
+
true: "mt-1-5",
|
|
8
|
+
false: "sr-only"
|
|
9
|
+
} },
|
|
10
|
+
defaultVariants: { visible: false }
|
|
11
|
+
}
|
|
9
12
|
});
|
|
10
13
|
//#endregion
|
|
11
|
-
export {
|
|
14
|
+
export { formFieldHelperDefinition };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
2
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
|
-
import {
|
|
3
|
+
import { inputBaseDefinition } from "../../shared/input.cva.js";
|
|
4
4
|
import { FormField } from "../../FormField/FormField.js";
|
|
5
5
|
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
6
6
|
import { InputContent } from "../shared/InputContent.js";
|
|
@@ -15,7 +15,7 @@ import { useNumberFieldState } from "react-stately";
|
|
|
15
15
|
//#region src/components/inputs/Input/NumberInput/NumberInput.tsx
|
|
16
16
|
var NumberInputBase = (props) => {
|
|
17
17
|
const ui = UIConfig.useConfig();
|
|
18
|
-
const inputBaseCva =
|
|
18
|
+
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
19
19
|
const inputRef = useRef(null);
|
|
20
20
|
const { ref, inputClassName, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, className, unit, isLoading, action, leadingIcon, trailingIcon, value, onChange, onBlur, formatOptions = ui.numberInput.formatOptions, variant = ui.input.variant, as = ui.input.as, size = ui.input.size, hideLabel = ui.input.hideLabel, isClearable = ui.input.isClearable, ...rest } = props;
|
|
21
21
|
const numberFieldRef = useRef(null);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
2
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
3
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
4
4
|
import { InputClear } from "../../shared/InputClear.js";
|
|
5
|
-
import {
|
|
5
|
+
import { inputSideDefinition, inputSizeDefinition, useInputCva } from "../../shared/input.cva.js";
|
|
6
6
|
import { FormField } from "../../FormField/FormField.js";
|
|
7
7
|
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -16,8 +16,8 @@ import { Controller } from "react-hook-form";
|
|
|
16
16
|
var TextAreaBase = (props) => {
|
|
17
17
|
const ui = UIConfig.useConfig();
|
|
18
18
|
const inputCva = useInputCva();
|
|
19
|
-
const inputSizeCva =
|
|
20
|
-
const inputSideCva =
|
|
19
|
+
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
20
|
+
const inputSideCva = UIOverrides.useCva("input.sideCva", inputSideDefinition);
|
|
21
21
|
const { ref, className, inputClassName, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, value, onChange, onBlur, as = ui.input.as, hideLabel = ui.input.hideLabel, variant = ui.input.variant, isClearable = ui.input.isClearable, ...rest } = props;
|
|
22
22
|
const textFieldRef = useRef(null);
|
|
23
23
|
const { labelProps, inputProps } = useTextField({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
2
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
|
-
import {
|
|
3
|
+
import { inputBaseDefinition } from "../../shared/input.cva.js";
|
|
4
4
|
import { FormField } from "../../FormField/FormField.js";
|
|
5
5
|
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
6
6
|
import { InputContent } from "../shared/InputContent.js";
|
|
@@ -14,7 +14,7 @@ import { Controller } from "react-hook-form";
|
|
|
14
14
|
//#region src/components/inputs/Input/TextInput/TextInput.tsx
|
|
15
15
|
var TextInputBase = (props) => {
|
|
16
16
|
const ui = UIConfig.useConfig();
|
|
17
|
-
const inputBaseCva =
|
|
17
|
+
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
18
18
|
const inputRef = useRef(null);
|
|
19
19
|
const { ref, inputClassName, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, className, unit, isLoading, action, leadingIcon, trailingIcon, value, onChange, onBlur, as = ui.input.as, hideLabel = ui.input.hideLabel, variant = ui.input.variant, size = ui.input.size, isClearable = ui.input.isClearable, ...rest } = props;
|
|
20
20
|
const textFieldRef = useRef(null);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
|
+
import { typographyDefinition } from "../../../text/Typography/typography.cva.js";
|
|
3
3
|
import { Loader } from "../../../status/Loader/Loader.js";
|
|
4
4
|
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
5
5
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
6
6
|
import { InputClear } from "../../shared/InputClear.js";
|
|
7
|
-
import {
|
|
7
|
+
import { inputSizeDefinition } from "../../shared/input.cva.js";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { clsx } from "clsx";
|
|
10
10
|
import { isValidElement } from "react";
|
|
11
11
|
//#region src/components/inputs/Input/shared/InputContent.tsx
|
|
12
12
|
var InputContent = ({ leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, unit, isLoading, isDisabled, action, isClearable, value, onChange, onBlur, children, headerProps, as, size }) => {
|
|
13
|
-
const typographyCva =
|
|
14
|
-
const inputSizeCva =
|
|
13
|
+
const typographyCva = UIOverrides.useCva("typography.cva", typographyDefinition);
|
|
14
|
+
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
15
15
|
const isLeadingIconElement = LeadingIcon && isValidElement(LeadingIcon);
|
|
16
16
|
const isTrailingIconElement = TrailingIcon && isValidElement(TrailingIcon);
|
|
17
17
|
const showClear = value != null && value !== "" && !isDisabled;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
3
3
|
import { CheckContent } from "../shared/CheckContent.js";
|
|
4
4
|
import { FormField } from "../FormField/FormField.js";
|
|
5
|
-
import {
|
|
5
|
+
import { radioDefinition, radioIndicatorClass, radioTypography } from "./radio.cva.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { clsx } from "clsx";
|
|
8
8
|
import { Radio, RadioGroup } from "react-aria-components";
|
|
@@ -11,8 +11,8 @@ import { Controller } from "react-hook-form";
|
|
|
11
11
|
//#region src/components/inputs/RadioGroup/RadioGroup.tsx
|
|
12
12
|
var RadioGroupBase = (props) => {
|
|
13
13
|
const ui = UIConfig.useConfig();
|
|
14
|
-
const radioCva =
|
|
15
|
-
const radioTypographyMap =
|
|
14
|
+
const radioCva = UIOverrides.useCva("radio.cva", radioDefinition);
|
|
15
|
+
const radioTypographyMap = UIOverrides.useMapper("radio.typography", radioTypography);
|
|
16
16
|
const { label, tooltipText, helperText, isDirty, isRequired, rightContent, isDisabled, headerClassName, errorClassName, labelClassName, inputClassName, isHeaderHidden, error, className, options, variant = ui.radioGroup.variant, hideLabel = ui.radioGroup.hideLabel, ...rest } = props;
|
|
17
17
|
const formFieldProps = {
|
|
18
18
|
className,
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { VariantProps } from 'class-variance-authority';
|
|
2
1
|
import { TypographyVariantProps } from '../../text/Typography/typography.cva';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { UIOverrides } from '../../../config/uiOverrides.context';
|
|
3
|
+
export declare const radioDefinition: {
|
|
4
|
+
base: string[];
|
|
5
|
+
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
6
|
+
readonly variant: {
|
|
7
|
+
readonly default: ["border-interactive-outlined-secondary-on-idle", "group-disabled:border-interactive-outlined-secondary-on-disabled", "group-hover:border-interactive-outlined-secondary-on-hover", "group-pressed:border-interactive-outlined-secondary-on-pressed", "group-selected:border-interactive-contained-primary-idle", "group-selected:bg-interactive-contained-primary-idle", "group-selected:group-disabled:bg-interactive-contained-primary-disabled", "group-selected:group-disabled:border-interactive-contained-primary-disabled", "group-invalid:border-interactive-outlined-error-on-idle", "group-focus-visible:outline-interactive-contained-primary-focus", "before:bg-interactive-contained-primary-on-idle", "group-hover:before:bg-interactive-contained-primary-on-hover", "group-selected:before:block"];
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
export type RadioConfig = NonNullable<typeof radioDefinition.config>;
|
|
12
|
+
export interface RadioVariantProps extends UIOverrides.VariantProps<RadioConfig> {
|
|
7
13
|
}
|
|
8
14
|
export declare const radioIndicatorClass = "group flex items-center gap-2";
|
|
9
15
|
export declare const radioTypography: (props: {
|
|
10
|
-
variant?: "default" | null | undefined;
|
|
16
|
+
readonly variant?: "default" | null | undefined;
|
|
11
17
|
}) => TypographyVariantProps | undefined;
|
|
@@ -1,29 +1,32 @@
|
|
|
1
|
+
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
1
2
|
import { uiGroupOutlineClass } from "../../outline.clsx.js";
|
|
2
3
|
import { compoundMapper } from "../../../utils/compoundMapper.js";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
4
|
//#region src/components/inputs/RadioGroup/radio.cva.ts
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
5
|
+
var radioDefinition = UIOverrides.defineConfig({
|
|
6
|
+
base: [
|
|
7
|
+
"flex items-center justify-center border-2",
|
|
8
|
+
"relative size-3-5 rounded-full p-1-5",
|
|
9
|
+
"before:absolute before:hidden before:size-1 before:rounded-full",
|
|
10
|
+
uiGroupOutlineClass
|
|
11
|
+
],
|
|
12
|
+
config: {
|
|
13
|
+
variants: { variant: { default: [
|
|
14
|
+
"border-interactive-outlined-secondary-on-idle",
|
|
15
|
+
"group-disabled:border-interactive-outlined-secondary-on-disabled",
|
|
16
|
+
"group-hover:border-interactive-outlined-secondary-on-hover",
|
|
17
|
+
"group-pressed:border-interactive-outlined-secondary-on-pressed",
|
|
18
|
+
"group-selected:border-interactive-contained-primary-idle",
|
|
19
|
+
"group-selected:bg-interactive-contained-primary-idle",
|
|
20
|
+
"group-selected:group-disabled:bg-interactive-contained-primary-disabled",
|
|
21
|
+
"group-selected:group-disabled:border-interactive-contained-primary-disabled",
|
|
22
|
+
"group-invalid:border-interactive-outlined-error-on-idle",
|
|
23
|
+
"group-focus-visible:outline-interactive-contained-primary-focus",
|
|
24
|
+
"before:bg-interactive-contained-primary-on-idle",
|
|
25
|
+
"group-hover:before:bg-interactive-contained-primary-on-hover",
|
|
26
|
+
"group-selected:before:block"
|
|
27
|
+
] } },
|
|
28
|
+
defaultVariants: { variant: "default" }
|
|
29
|
+
}
|
|
27
30
|
});
|
|
28
31
|
var radioIndicatorClass = "group flex items-center gap-2";
|
|
29
32
|
var radioTypography = compoundMapper({ default: {
|
|
@@ -32,4 +35,4 @@ var radioTypography = compoundMapper({ default: {
|
|
|
32
35
|
variant: "default"
|
|
33
36
|
} });
|
|
34
37
|
//#endregion
|
|
35
|
-
export {
|
|
38
|
+
export { radioDefinition, radioIndicatorClass, radioTypography };
|