@povio/ui 2.3.3 → 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/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/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,12 +1,5 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
cva
|
|
3
|
-
variants: { iconPosition: {
|
|
4
|
-
left: "flex-row",
|
|
5
|
-
right: "flex-row-reverse",
|
|
6
|
-
none: "flex-row"
|
|
7
|
-
} },
|
|
8
|
-
defaultVariants: { iconPosition: "left" }
|
|
9
|
-
});
|
|
2
|
+
//#region src/components/buttons/shared/buttonContent.cva.ts
|
|
10
3
|
var buttonContentLabel = cva("hyphens-auto md:truncate", {
|
|
11
4
|
variants: {
|
|
12
5
|
iconPosition: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
3
3
|
import { checkboxIndicatorClass, checkboxTypography } from "./checkbox.cva.js";
|
|
4
4
|
import { FormFieldError } from "../FormField/FormFieldError.js";
|
|
@@ -12,7 +12,7 @@ import { Controller } from "react-hook-form";
|
|
|
12
12
|
//#region src/components/inputs/Checkbox/Checkbox.tsx
|
|
13
13
|
var CheckboxBase = (props) => {
|
|
14
14
|
const ui = UIConfig.useConfig();
|
|
15
|
-
const checkboxTypographyMap =
|
|
15
|
+
const checkboxTypographyMap = UIOverrides.useMapper("checkbox.typography", checkboxTypography);
|
|
16
16
|
const { className, children, isDisabled, error, variant = ui.checkbox.variant, hideLabel = ui.input.hideLabel, ...rest } = props;
|
|
17
17
|
const formFieldErrorProps = {
|
|
18
18
|
error,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { CheckboxCheckmarkIcon } from "../../../assets/icons/CheckboxCheckmark.js";
|
|
2
2
|
import { CheckboxIndeterminateIcon } from "../../../assets/icons/CheckboxIndeterminate.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
4
|
+
import { checkboxDefinition, checkboxIconDefinition } from "./checkbox.cva.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/inputs/Checkbox/CheckboxCheckmark.tsx
|
|
7
7
|
var CheckboxCheckmark = ({ variant, className, selectedIcon: SelectedIcon = CheckboxCheckmarkIcon, indeterminateIcon: IndeterminateIcon = CheckboxIndeterminateIcon, ...props }) => {
|
|
8
|
-
const checkboxCva =
|
|
9
|
-
const checkboxIconCva =
|
|
8
|
+
const checkboxCva = UIOverrides.useCva("checkbox.cva", checkboxDefinition);
|
|
9
|
+
const checkboxIconCva = UIOverrides.useCva("checkbox.iconCva", checkboxIconDefinition);
|
|
10
10
|
return /* @__PURE__ */ jsxs("div", {
|
|
11
11
|
className: checkboxCva({
|
|
12
12
|
variant,
|
|
@@ -1,16 +1,29 @@
|
|
|
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 checkboxDefinition: {
|
|
4
|
+
base: string[];
|
|
5
|
+
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
6
|
+
readonly variant: {
|
|
7
|
+
readonly default: ["m-1 border-interactive-outlined-secondary-on-idle", "text-interactive-contained-primary-on-idle", "group-hover:text-interactive-contained-primary-on-hover", "group-pressed:text-interactive-contained-primary-on-pressed", "group-disabled:text-interactive-contained-primary-on-disabled", "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-hover:bg-interactive-contained-primary-hover", "group-selected:group-hover:border-interactive-contained-primary-hover", "group-selected:group-pressed:bg-interactive-contained-primary-pressed", "group-selected:group-pressed:border-interactive-contained-primary-pressed", "group-selected:group-disabled:bg-interactive-contained-primary-disabled", "group-selected:group-disabled:border-interactive-contained-primary-disabled", "group-indeterminate:border-interactive-contained-primary-idle", "group-indeterminate:bg-interactive-contained-primary-idle", "group-indeterminate:group-hover:bg-interactive-contained-primary-hover", "group-indeterminate:group-hover:border-interactive-contained-primary-hover", "group-indeterminate:group-pressed:bg-interactive-contained-primary-pressed", "group-indeterminate:group-pressed:border-interactive-contained-primary-pressed", "group-invalid:border-interactive-outlined-error-on-idle", "group-focus-visible:outline-interactive-contained-primary-focus"];
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
export type CheckboxConfig = NonNullable<typeof checkboxDefinition.config>;
|
|
12
|
+
export interface CheckboxVariantProps extends UIOverrides.VariantProps<CheckboxConfig> {
|
|
7
13
|
}
|
|
8
14
|
export declare const checkboxIndicatorClass = "group flex items-center gap-2";
|
|
9
15
|
export declare const checkboxTypography: (props: {
|
|
10
|
-
variant?: "default" | null | undefined;
|
|
16
|
+
readonly variant?: "default" | null | undefined;
|
|
11
17
|
}) => TypographyVariantProps | undefined;
|
|
12
|
-
export declare const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
export declare const checkboxIconDefinition: {
|
|
19
|
+
base: string[];
|
|
20
|
+
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
21
|
+
readonly iconVariant: {
|
|
22
|
+
readonly selected: ["group-selected:block"];
|
|
23
|
+
readonly indeterminate: ["group-indeterminate:block"];
|
|
24
|
+
};
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
export type CheckboxIconConfig = NonNullable<typeof checkboxIconDefinition.config>;
|
|
28
|
+
export interface CheckboxIconVariantProps extends UIOverrides.VariantProps<CheckboxIconConfig> {
|
|
16
29
|
}
|
|
@@ -1,39 +1,42 @@
|
|
|
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/Checkbox/checkbox.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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
5
|
+
var checkboxDefinition = UIOverrides.defineConfig({
|
|
6
|
+
base: [
|
|
7
|
+
"flex items-center justify-center border-2",
|
|
8
|
+
"relative size-4 shrink-0 rounded-xs p-1",
|
|
9
|
+
uiGroupOutlineClass
|
|
10
|
+
],
|
|
11
|
+
config: {
|
|
12
|
+
variants: { variant: { default: [
|
|
13
|
+
"m-1 border-interactive-outlined-secondary-on-idle",
|
|
14
|
+
"text-interactive-contained-primary-on-idle",
|
|
15
|
+
"group-hover:text-interactive-contained-primary-on-hover",
|
|
16
|
+
"group-pressed:text-interactive-contained-primary-on-pressed",
|
|
17
|
+
"group-disabled:text-interactive-contained-primary-on-disabled",
|
|
18
|
+
"group-disabled:border-interactive-outlined-secondary-on-disabled",
|
|
19
|
+
"group-hover:border-interactive-outlined-secondary-on-hover",
|
|
20
|
+
"group-pressed:border-interactive-outlined-secondary-on-pressed",
|
|
21
|
+
"group-selected:border-interactive-contained-primary-idle",
|
|
22
|
+
"group-selected:bg-interactive-contained-primary-idle",
|
|
23
|
+
"group-selected:group-hover:bg-interactive-contained-primary-hover",
|
|
24
|
+
"group-selected:group-hover:border-interactive-contained-primary-hover",
|
|
25
|
+
"group-selected:group-pressed:bg-interactive-contained-primary-pressed",
|
|
26
|
+
"group-selected:group-pressed:border-interactive-contained-primary-pressed",
|
|
27
|
+
"group-selected:group-disabled:bg-interactive-contained-primary-disabled",
|
|
28
|
+
"group-selected:group-disabled:border-interactive-contained-primary-disabled",
|
|
29
|
+
"group-indeterminate:border-interactive-contained-primary-idle",
|
|
30
|
+
"group-indeterminate:bg-interactive-contained-primary-idle",
|
|
31
|
+
"group-indeterminate:group-hover:bg-interactive-contained-primary-hover",
|
|
32
|
+
"group-indeterminate:group-hover:border-interactive-contained-primary-hover",
|
|
33
|
+
"group-indeterminate:group-pressed:bg-interactive-contained-primary-pressed",
|
|
34
|
+
"group-indeterminate:group-pressed:border-interactive-contained-primary-pressed",
|
|
35
|
+
"group-invalid:border-interactive-outlined-error-on-idle",
|
|
36
|
+
"group-focus-visible:outline-interactive-contained-primary-focus"
|
|
37
|
+
] } },
|
|
38
|
+
defaultVariants: { variant: "default" }
|
|
39
|
+
}
|
|
37
40
|
});
|
|
38
41
|
var checkboxIndicatorClass = "group flex items-center gap-2";
|
|
39
42
|
var checkboxTypography = compoundMapper({ default: {
|
|
@@ -41,12 +44,15 @@ var checkboxTypography = compoundMapper({ default: {
|
|
|
41
44
|
sizeMobile: "label-1",
|
|
42
45
|
variant: "default"
|
|
43
46
|
} });
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
var checkboxIconDefinition = UIOverrides.defineConfig({
|
|
48
|
+
base: ["absolute hidden size-3"],
|
|
49
|
+
config: {
|
|
50
|
+
variants: { iconVariant: {
|
|
51
|
+
selected: ["group-selected:block"],
|
|
52
|
+
indeterminate: ["group-indeterminate:block"]
|
|
53
|
+
} },
|
|
54
|
+
defaultVariants: { iconVariant: "selected" }
|
|
55
|
+
}
|
|
50
56
|
});
|
|
51
57
|
//#endregion
|
|
52
|
-
export {
|
|
58
|
+
export { checkboxDefinition, checkboxIconDefinition, checkboxIndicatorClass, checkboxTypography };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CalendarIcon } from "../../../../assets/icons/Calendar.js";
|
|
2
2
|
import { DateTimeIcon } from "../../../../assets/icons/DateTime.js";
|
|
3
|
-
import {
|
|
3
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
4
4
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
5
5
|
import { IconButton } from "../../../buttons/IconButton/IconButton.js";
|
|
6
6
|
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
@@ -8,7 +8,7 @@ import { TodayIcon } from "../../../../assets/icons/Today.js";
|
|
|
8
8
|
import { DateField } from "./DateField.js";
|
|
9
9
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
10
10
|
import { InputClear } from "../../shared/InputClear.js";
|
|
11
|
-
import {
|
|
11
|
+
import { inputBaseDefinition, inputSizeDefinition } from "../../shared/input.cva.js";
|
|
12
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { clsx } from "clsx";
|
|
14
14
|
import { useCallback, useImperativeHandle, useRef, useState } from "react";
|
|
@@ -19,8 +19,8 @@ import { getLocalTimeZone, now, toCalendarDateTime, today } from "@international
|
|
|
19
19
|
var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, isDirty, isRequired, disableManualEntry, placeholder, className, onOpenDropdown, dateGranularity = "day", timeZone, autoFixYear, isTimeOptional = false, format, ...props }) => {
|
|
20
20
|
let effectiveTimeZone = getLocalTimeZone();
|
|
21
21
|
if (timeZone) effectiveTimeZone = timeZone;
|
|
22
|
-
const inputBaseCva =
|
|
23
|
-
const inputSizeCva =
|
|
22
|
+
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
23
|
+
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
24
24
|
const [canClear, setCanClear] = useState(false);
|
|
25
25
|
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
26
26
|
const [isFocused, setIsFocused] = useState(false);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
2
|
import { BottomSheet } from "../../../overlays/BottomSheet/BottomSheet.js";
|
|
3
3
|
import { useBreakpoint } from "../../../../hooks/useBreakpoint.js";
|
|
4
|
-
import {
|
|
4
|
+
import { popoverDefinition } from "../../../shared/popover.cva.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import clsx$1 from "clsx";
|
|
7
7
|
import { Dialog, Popover } from "react-aria-components";
|
|
8
8
|
//#region src/components/inputs/DateTime/shared/DateTimeDialog.tsx
|
|
9
9
|
var DateTimeDialog = ({ hideSidebar, children, footer, sidebar, label, isOpen, triggerRef, dialogProps, onOpenChange }) => {
|
|
10
|
-
const popoverCva =
|
|
10
|
+
const popoverCva = UIOverrides.useCva("popover.cva", popoverDefinition);
|
|
11
11
|
if (useBreakpoint("md")) {
|
|
12
12
|
if (!isOpen) return null;
|
|
13
13
|
return /* @__PURE__ */ jsx(Popover, {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ClockIcon } from "../../../../assets/icons/Clock.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
5
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
6
6
|
import { InputClear } from "../../shared/InputClear.js";
|
|
7
|
-
import {
|
|
7
|
+
import { inputBaseDefinition, inputSizeDefinition } from "../../shared/input.cva.js";
|
|
8
8
|
import { TimeField } from "./TimeField.js";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { clsx } from "clsx";
|
|
@@ -13,8 +13,8 @@ import { Button } from "react-aria-components";
|
|
|
13
13
|
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
14
14
|
//#region src/components/inputs/DateTime/shared/TimePickerInput.tsx
|
|
15
15
|
var TimePickerInput = ({ ref, as, fieldProps, state, isDisabled, isDirty, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, ...props }) => {
|
|
16
|
-
const inputBaseCva =
|
|
17
|
-
const inputSizeCva =
|
|
16
|
+
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
17
|
+
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
18
18
|
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
19
19
|
const [isFocused, setIsFocused] = useState(false);
|
|
20
20
|
const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
|
|
@@ -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,
|