@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,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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
|
+
import { popoverDefinition } from "../../../shared/popover.cva.js";
|
|
3
3
|
import { FormField } from "../../FormField/FormField.js";
|
|
4
4
|
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
5
5
|
import "./useSelectItems.js";
|
|
@@ -15,7 +15,7 @@ import { mergeRefs } from "@react-aria/utils";
|
|
|
15
15
|
//#region src/components/inputs/Selection/shared/SelectDesktop.tsx
|
|
16
16
|
var SelectDesktop = ({ ref, error, ignoreTriggerWidth, showSelectionContent, inputClassName, containerClassName, customTrigger, onBlur, ...props }) => {
|
|
17
17
|
const { label, tooltipText, helperText, isRequired, rightContent, isHeaderHidden, headerClassName, errorClassName, placeholder, variant, isDisabled, className, hideLabel, hideDropdownIcon, isSearchable, isClearable, isLoading, as, size, collapseAfter, selectedTagsType } = props;
|
|
18
|
-
const popoverCva =
|
|
18
|
+
const popoverCva = UIOverrides.useCva("popover.cva", popoverDefinition);
|
|
19
19
|
const formFieldProps = {
|
|
20
20
|
error,
|
|
21
21
|
label,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ArrowDropDownIcon } from "../../../../assets/icons/ArrowDropDown.js";
|
|
2
|
-
import {
|
|
2
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
3
3
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
4
4
|
import "../../../../config/i18n.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 { SelectInputTags } from "./SelectInputTags.js";
|
|
9
9
|
import { SelectContext } from "./select.context.js";
|
|
10
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -15,8 +15,8 @@ import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
|
15
15
|
import { useTranslation } from "react-i18next";
|
|
16
16
|
//#region src/components/inputs/Selection/shared/SelectInput.tsx
|
|
17
17
|
var SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, onCloseComboBox, onBlur, ...props }) => {
|
|
18
|
-
const inputSizeCva =
|
|
19
|
-
const inputBaseCva =
|
|
18
|
+
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
19
|
+
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
20
20
|
const { t } = useTranslation("ui");
|
|
21
21
|
const state = use(ComboBoxStateContext);
|
|
22
22
|
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
2
|
import "../../../../config/i18n.js";
|
|
3
3
|
import { CheckboxCheckmark } from "../../Checkbox/CheckboxCheckmark.js";
|
|
4
4
|
import { SelectContext } from "./select.context.js";
|
|
5
|
-
import {
|
|
5
|
+
import { selectListBoxItemDefinition } from "./selectItem.cva.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { useMemo, useRef } from "react";
|
|
8
8
|
import { ListBoxItem } from "react-aria-components";
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
10
|
//#region src/components/inputs/Selection/shared/SelectListBoxItem.tsx
|
|
11
11
|
var SelectListBoxItem = ({ isSearchable, isNewItem, newItemRender, id, label, content, isDisabled }) => {
|
|
12
|
-
const selectListItemCva =
|
|
12
|
+
const selectListItemCva = UIOverrides.useCva("select.listBoxItemCva", selectListBoxItemDefinition);
|
|
13
13
|
const ref = useRef(null);
|
|
14
14
|
const { t } = useTranslation("ui");
|
|
15
15
|
const { selectedIds, isMultiple } = SelectContext.useSelect();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
2
|
import "../../../../config/i18n.js";
|
|
3
3
|
import { CheckboxCheckmark } from "../../Checkbox/CheckboxCheckmark.js";
|
|
4
4
|
import { SelectContext } from "./select.context.js";
|
|
5
|
-
import {
|
|
5
|
+
import { selectListBoxItemDefinition } from "./selectItem.cva.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { useRef } from "react";
|
|
8
8
|
import { ListBoxItem } from "react-aria-components";
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
10
|
//#region src/components/inputs/Selection/shared/SelectListBoxItemSelectAll.tsx
|
|
11
11
|
var SelectListBoxItemSelectAll = ({ id, label, isDisabled }) => {
|
|
12
|
-
const selectListItemCva =
|
|
12
|
+
const selectListItemCva = UIOverrides.useCva("select.listBoxItemCva", selectListBoxItemDefinition);
|
|
13
13
|
const ref = useRef(null);
|
|
14
14
|
const { t } = useTranslation("ui");
|
|
15
15
|
const { selectableListItems, selectedIds } = SelectContext.useSelect();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
2
|
import { Loader } from "../../../status/Loader/Loader.js";
|
|
3
3
|
import "../../../../config/i18n.js";
|
|
4
4
|
import { SelectContext } from "./select.context.js";
|
|
5
|
-
import {
|
|
5
|
+
import { selectListBoxItemDefinition } from "./selectItem.cva.js";
|
|
6
6
|
import { useIntersectionObserver } from "../../../../hooks/useIntersectionObserver.js";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
import { useCallback } from "react";
|
|
@@ -10,7 +10,7 @@ import { ListBoxItem } from "react-aria-components";
|
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
11
|
//#region src/components/inputs/Selection/shared/SelectListBoxLoadingItem.tsx
|
|
12
12
|
var SelectListBoxLoadingItem = ({ id, label, onLoadMore }) => {
|
|
13
|
-
const selectListItemCva =
|
|
13
|
+
const selectListItemCva = UIOverrides.useCva("select.listBoxItemCva", selectListBoxItemDefinition);
|
|
14
14
|
const { t } = useTranslation("ui");
|
|
15
15
|
const { isDebouncing, isLoading, hasLoadMore } = SelectContext.useSelect();
|
|
16
16
|
const { ref } = useIntersectionObserver({
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { UIOverrides } from '../../../../config/uiOverrides.context';
|
|
2
|
+
export declare const selectListBoxItemDefinition: {
|
|
3
|
+
base: string[];
|
|
4
|
+
config: import("../../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
5
|
+
readonly isSingle: {
|
|
6
|
+
readonly true: "selected:bg-interactive-contained-primary-idle selected:text-interactive-contained-primary-on-idle";
|
|
7
|
+
};
|
|
8
|
+
readonly isNewItem: {
|
|
9
|
+
readonly true: "text-interactive-text-primary-idle";
|
|
10
|
+
readonly false: "text-interactive-text-secondary-idle";
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
};
|
|
14
|
+
export type SelectListBoxItemConfig = NonNullable<typeof selectListBoxItemDefinition.config>;
|
|
15
|
+
export interface SelectListBoxItemCva extends UIOverrides.VariantProps<SelectListBoxItemConfig> {
|
|
16
|
+
}
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
2
|
//#region src/components/inputs/Selection/shared/selectItem.cva.ts
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
true: "
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
var selectListBoxItemDefinition = UIOverrides.defineConfig({
|
|
4
|
+
base: [
|
|
5
|
+
"group flex cursor-pointer items-center gap-2 px-list-side-item-left py-list-height-item",
|
|
6
|
+
"border-b border-b-elevation-outline-default-1 outline-none",
|
|
7
|
+
"font-labels-default text-label-2",
|
|
8
|
+
"hover:text-interactive-text-secondary-hover",
|
|
9
|
+
"focus-visible:bg-interactive-contained-primary-focus focus-visible:text-interactive-text-secondary-idle-inverted",
|
|
10
|
+
"disabled:cursor-default disabled:text-interactive-text-secondary-disabled"
|
|
11
|
+
],
|
|
12
|
+
config: {
|
|
13
|
+
variants: {
|
|
14
|
+
isSingle: { true: "selected:bg-interactive-contained-primary-idle selected:text-interactive-contained-primary-on-idle" },
|
|
15
|
+
isNewItem: {
|
|
16
|
+
true: "text-interactive-text-primary-idle",
|
|
17
|
+
false: "text-interactive-text-secondary-idle"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: { isNewItem: false }
|
|
21
|
+
}
|
|
19
22
|
});
|
|
20
23
|
//#endregion
|
|
21
|
-
export {
|
|
24
|
+
export { selectListBoxItemDefinition };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
import { isEqual } from "../../../utils/isEqual.js";
|
|
3
3
|
import { uiOutlineClass } from "../../outline.clsx.js";
|
|
4
4
|
import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
|
|
5
|
-
import {
|
|
5
|
+
import { inputSideDefinition } from "../shared/input.cva.js";
|
|
6
6
|
import { FormField } from "../FormField/FormField.js";
|
|
7
7
|
import { TextEditorToolbar } from "./Toolbar/TextEditorToolbar.js";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -43,7 +43,7 @@ var TextEditorBase = ({ ref, as = "default", placeholder, label, hideLabel, tool
|
|
|
43
43
|
const [isFocused, setIsFocused] = useState(false);
|
|
44
44
|
const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
|
|
45
45
|
const { isFocusVisible } = useFocusVisible();
|
|
46
|
-
const inputSideCva =
|
|
46
|
+
const inputSideCva = UIOverrides.useCva("input.sideCva", inputSideDefinition);
|
|
47
47
|
const formFieldProps = {
|
|
48
48
|
error,
|
|
49
49
|
label,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ArrowDropDownIcon } from "../../../../assets/icons/ArrowDropDown.js";
|
|
2
|
-
import {
|
|
2
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
3
3
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
4
4
|
import { useInputCva } from "../../shared/input.cva.js";
|
|
5
|
-
import {
|
|
5
|
+
import { popoverDefinition } from "../../../shared/popover.cva.js";
|
|
6
6
|
import { ColorPicker } from "./ColorPicker.js";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { clsx } from "clsx";
|
|
@@ -11,7 +11,7 @@ import { Button, Dialog, DialogTrigger, Popover } from "react-aria-components";
|
|
|
11
11
|
//#region src/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.tsx
|
|
12
12
|
var ColorPickerDropdown = ({ colors, value, onChange, isDisabled, children }) => {
|
|
13
13
|
const inputCva = useInputCva();
|
|
14
|
-
const popoverCva =
|
|
14
|
+
const popoverCva = UIOverrides.useCva("popover.cva", popoverDefinition);
|
|
15
15
|
const [isOpen, setIsOpen] = useState(false);
|
|
16
16
|
const handleChange = (color) => {
|
|
17
17
|
onChange(color);
|
|
@@ -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 { FormFieldError } from "../FormField/FormFieldError.js";
|
|
4
4
|
import { CheckContent } from "../shared/CheckContent.js";
|
|
5
|
-
import {
|
|
5
|
+
import { toggleDefinition, toggleTypography } from "./toggle.cva.js";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { clsx } from "clsx";
|
|
8
8
|
import { Switch } from "react-aria-components";
|
|
@@ -11,8 +11,8 @@ import { Controller } from "react-hook-form";
|
|
|
11
11
|
//#region src/components/inputs/Toggle/Toggle.tsx
|
|
12
12
|
var ToggleBase = (props) => {
|
|
13
13
|
const ui = UIConfig.useConfig();
|
|
14
|
-
const toggleCva =
|
|
15
|
-
const toggleTypographyMap =
|
|
14
|
+
const toggleCva = UIOverrides.useCva("toggle.cva", toggleDefinition);
|
|
15
|
+
const toggleTypographyMap = UIOverrides.useMapper("toggle.typography", toggleTypography);
|
|
16
16
|
const { className, children, isDisabled, error, variant = ui.toggle.variant, ...rest } = props;
|
|
17
17
|
const formFieldErrorProps = {
|
|
18
18
|
error,
|
|
@@ -1,10 +1,16 @@
|
|
|
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 toggleDefinition: {
|
|
4
|
+
base: string[];
|
|
5
|
+
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
6
|
+
readonly variant: {
|
|
7
|
+
readonly default: ["bg-interactive-contained-secondary-idle", "group-disabled:bg-interactive-contained-secondary-disabled", "group-hover:bg-interactive-contained-secondary-hover", "group-pressed:bg-interactive-contained-secondary-pressed", "group-selected:bg-interactive-contained-primary-idle", "group-selected:group-hover:bg-interactive-contained-primary-hover", "group-selected:group-pressed:bg-interactive-contained-primary-pressed", "group-focus-visible:outline-interactive-text-secondary-focus", "before:bg-interactive-contained-secondary-on-idle", "group-hover:before:bg-interactive-contained-secondary-on-hover", "group-disabled:before:bg-interactive-contained-secondary-on-disabled", "group-selected:before:bg-interactive-contained-primary-on-idle", "group-selected:group-hover:before:bg-interactive-contained-primary-on-hover", "group-selected:group-pressed:before:bg-interactive-contained-primary-on-pressed", "group-selected:group-disabled:bg-interactive-contained-primary-disabled"];
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
export type ToggleConfig = NonNullable<typeof toggleDefinition.config>;
|
|
12
|
+
export interface ToggleVariantProps extends UIOverrides.VariantProps<ToggleConfig> {
|
|
7
13
|
}
|
|
8
14
|
export declare const toggleTypography: (props: {
|
|
9
|
-
variant?: "default" | null | undefined;
|
|
15
|
+
readonly variant?: "default" | null | undefined;
|
|
10
16
|
}) => TypographyVariantProps | undefined;
|
|
@@ -1,26 +1,29 @@
|
|
|
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/Toggle/toggle.cva.ts
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
var toggleDefinition = UIOverrides.defineConfig({
|
|
6
|
+
base: ["h-6 w-10 rounded-full before:m-0-5 before:block before:aspect-square before:h-5 before:rounded-full before:transition-transform before:content-[''] group-selected:before:translate-x-4", uiGroupOutlineClass],
|
|
7
|
+
config: {
|
|
8
|
+
variants: { variant: { default: [
|
|
9
|
+
"bg-interactive-contained-secondary-idle",
|
|
10
|
+
"group-disabled:bg-interactive-contained-secondary-disabled",
|
|
11
|
+
"group-hover:bg-interactive-contained-secondary-hover",
|
|
12
|
+
"group-pressed:bg-interactive-contained-secondary-pressed",
|
|
13
|
+
"group-selected:bg-interactive-contained-primary-idle",
|
|
14
|
+
"group-selected:group-hover:bg-interactive-contained-primary-hover",
|
|
15
|
+
"group-selected:group-pressed:bg-interactive-contained-primary-pressed",
|
|
16
|
+
"group-focus-visible:outline-interactive-text-secondary-focus",
|
|
17
|
+
"before:bg-interactive-contained-secondary-on-idle",
|
|
18
|
+
"group-hover:before:bg-interactive-contained-secondary-on-hover",
|
|
19
|
+
"group-disabled:before:bg-interactive-contained-secondary-on-disabled",
|
|
20
|
+
"group-selected:before:bg-interactive-contained-primary-on-idle",
|
|
21
|
+
"group-selected:group-hover:before:bg-interactive-contained-primary-on-hover",
|
|
22
|
+
"group-selected:group-pressed:before:bg-interactive-contained-primary-on-pressed",
|
|
23
|
+
"group-selected:group-disabled:bg-interactive-contained-primary-disabled"
|
|
24
|
+
] } },
|
|
25
|
+
defaultVariants: { variant: "default" }
|
|
26
|
+
}
|
|
24
27
|
});
|
|
25
28
|
var toggleTypography = compoundMapper({ default: {
|
|
26
29
|
size: "label-1",
|
|
@@ -28,4 +31,4 @@ var toggleTypography = compoundMapper({ default: {
|
|
|
28
31
|
variant: "default"
|
|
29
32
|
} });
|
|
30
33
|
//#endregion
|
|
31
|
-
export {
|
|
34
|
+
export { toggleDefinition, toggleTypography };
|