@povio/ui 2.1.9 → 2.1.11
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/Menu/Menu.d.ts +2 -1
- package/dist/components/Menu/MenuDesktop.d.ts +1 -1
- package/dist/components/Menu/MenuDesktop.js +8 -2
- package/dist/components/Menu/MenuItem.d.ts +1 -2
- package/dist/components/Menu/MenuItem.js +7 -14
- package/dist/components/Menu/MenuMobile.d.ts +1 -1
- package/dist/components/Menu/MenuMobile.js +9 -4
- package/dist/components/Menu/MenuPopover.d.ts +1 -1
- package/dist/components/Menu/MenuPopover.js +9 -4
- package/dist/components/Menu/menu.cva.d.ts +17 -0
- package/dist/components/Menu/menu.cva.js +45 -0
- package/dist/components/buttons/Button/button.cva.js +505 -485
- package/dist/components/inputs/File/FileUpload.js +1 -1
- package/dist/components/inputs/Input/shared/InputContent.js +2 -2
- package/dist/components/inputs/Slider/Slider.js +1 -1
- package/dist/components/inputs/shared/label.cva.js +2 -2
- package/dist/components/overlays/Modal/Modal.js +8 -3
- package/dist/components/segment/Segment.js +5 -6
- package/dist/components/segment/SegmentItem.js +6 -15
- package/dist/components/segment/segment.cva.d.ts +9 -0
- package/dist/components/segment/segment.cva.js +35 -0
- package/dist/components/segment/segment.types.d.ts +3 -2
- package/dist/components/text/Tag/Tag.d.ts +1 -1
- package/dist/components/text/Tag/Tag.js +2 -2
- package/dist/config/uiStyle.context.d.ts +18 -0
- package/package.json +1 -1
|
@@ -184,7 +184,7 @@ const FileUploadBase = (props) => {
|
|
|
184
184
|
title: emptyText,
|
|
185
185
|
uploadText,
|
|
186
186
|
browseText,
|
|
187
|
-
className: "
|
|
187
|
+
className: "group-drop-target/file-upload-drop-zone:flex! absolute top-1/2 left-1/2 z-50 hidden -translate-x-1/2 -translate-y-1/2 flex-col"
|
|
188
188
|
}
|
|
189
189
|
)
|
|
190
190
|
] }) : /* @__PURE__ */ jsx(
|
|
@@ -60,7 +60,7 @@ const InputContent = ({
|
|
|
60
60
|
{
|
|
61
61
|
ref: leadingContentRef,
|
|
62
62
|
className: clsx(
|
|
63
|
-
"-
|
|
63
|
+
"absolute top-1/2 -translate-y-1/2",
|
|
64
64
|
!isLeadingIconElement && "pointer-events-none",
|
|
65
65
|
inputSideCva({ size, type: "left" })
|
|
66
66
|
),
|
|
@@ -72,7 +72,7 @@ const InputContent = ({
|
|
|
72
72
|
{
|
|
73
73
|
ref: trailingContentRef,
|
|
74
74
|
className: clsx(
|
|
75
|
-
"-
|
|
75
|
+
"absolute top-1/2 flex -translate-y-1/2 items-center gap-2",
|
|
76
76
|
!isTrailingIconElement && !action && !showClear && "pointer-events-none",
|
|
77
77
|
inputSideCva({ size, type: "right" })
|
|
78
78
|
),
|
|
@@ -69,7 +69,7 @@ const SliderBase = (props) => {
|
|
|
69
69
|
}
|
|
70
70
|
),
|
|
71
71
|
/* @__PURE__ */ jsx(SliderTrack, { className: "relative mx-2 h-6 w-full", children: ({ state }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
72
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
72
|
+
/* @__PURE__ */ jsx("div", { className: "absolute top-1/2 h-1 w-full -translate-y-1/2 overflow-hidden rounded-full bg-elevation-outline-default-1", children: /* @__PURE__ */ jsx(
|
|
73
73
|
"div",
|
|
74
74
|
{
|
|
75
75
|
className: clsx(
|
|
@@ -4,12 +4,12 @@ const labelBase = cva("text-text-default-1", {
|
|
|
4
4
|
variants: {
|
|
5
5
|
as: {
|
|
6
6
|
default: ["flex items-start gap-1"],
|
|
7
|
-
filter: ["-
|
|
7
|
+
filter: ["absolute top-1/2 -translate-y-1/2"],
|
|
8
8
|
inline: ["flex items-start gap-1"],
|
|
9
9
|
floating: [
|
|
10
10
|
"pointer-events-none",
|
|
11
11
|
"absolute transition-all duration-75",
|
|
12
|
-
"-
|
|
12
|
+
"top-1/2 -translate-y-1/2",
|
|
13
13
|
"text-text-default-2 group-has-[input:disabled]/input-content:text-interactive-text-secondary-disabled",
|
|
14
14
|
"group-disabled/date-picker-content:text-interactive-text-secondary-disabled",
|
|
15
15
|
"group-disabled/text-editor:text-interactive-text-secondary-disabled",
|
|
@@ -4,8 +4,9 @@ import { ModalOverlay, Modal as Modal$1, Dialog } from "react-aria-components";
|
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
5
|
import { CloseIcon } from "../../../assets/icons/Close.js";
|
|
6
6
|
import { InlineIconButton } from "../../buttons/InlineIconButton/InlineIconButton.js";
|
|
7
|
-
import {
|
|
7
|
+
import { modalMain, modalContent, modalOverlay } from "./modal.cva.js";
|
|
8
8
|
import { ns } from "../../../config/i18n.js";
|
|
9
|
+
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
9
10
|
const Modal = ({
|
|
10
11
|
isOpen,
|
|
11
12
|
portalContainerRef,
|
|
@@ -18,11 +19,15 @@ const Modal = ({
|
|
|
18
19
|
isDismissable = true
|
|
19
20
|
}) => {
|
|
20
21
|
const { t } = useTranslation(ns);
|
|
22
|
+
const uiStyle = UIStyle.useConfig();
|
|
23
|
+
const modalMainCva = uiStyle?.modal?.mainCva ?? modalMain;
|
|
24
|
+
const modalContentCva = uiStyle?.modal?.contentCva ?? modalContent;
|
|
25
|
+
const modalOverlayCva = uiStyle?.modal?.overlayCva ?? modalOverlay;
|
|
21
26
|
return /* @__PURE__ */ jsx(
|
|
22
27
|
ModalOverlay,
|
|
23
28
|
{
|
|
24
29
|
UNSTABLE_portalContainer: portalContainerRef?.current,
|
|
25
|
-
className:
|
|
30
|
+
className: modalOverlayCva({ aside }),
|
|
26
31
|
isDismissable,
|
|
27
32
|
isOpen,
|
|
28
33
|
shouldCloseOnInteractOutside: () => {
|
|
@@ -33,7 +38,7 @@ const Modal = ({
|
|
|
33
38
|
onClose();
|
|
34
39
|
}
|
|
35
40
|
},
|
|
36
|
-
children: /* @__PURE__ */ jsx(Modal$1, { className:
|
|
41
|
+
children: /* @__PURE__ */ jsx(Modal$1, { className: modalMainCva({ aside }), children: /* @__PURE__ */ jsxs(Dialog, { className: modalContentCva({ aside, className: modalClassName }), children: [
|
|
37
42
|
showCloseIcon && /* @__PURE__ */ jsx(
|
|
38
43
|
InlineIconButton,
|
|
39
44
|
{
|
|
@@ -7,6 +7,8 @@ import { ToggleButtonGroup } from "react-aria-components";
|
|
|
7
7
|
import { Controller } from "react-hook-form";
|
|
8
8
|
import { useToggleGroupState } from "react-stately";
|
|
9
9
|
import { FormField } from "../inputs/FormField/FormField.js";
|
|
10
|
+
import { segmentCva } from "./segment.cva.js";
|
|
11
|
+
import { UIStyle } from "../../config/uiStyle.context.js";
|
|
10
12
|
import { SegmentItem } from "./SegmentItem.js";
|
|
11
13
|
const SegmentBase = ({
|
|
12
14
|
className,
|
|
@@ -23,8 +25,10 @@ const SegmentBase = ({
|
|
|
23
25
|
selectedKeys: value ? Array.isArray(value) ? value : [value] : void 0
|
|
24
26
|
};
|
|
25
27
|
const buttonGroupRef = useRef(null);
|
|
28
|
+
const uiStyle = UIStyle.useConfig();
|
|
26
29
|
const state = useToggleGroupState(props);
|
|
27
30
|
const { groupProps } = useToggleButtonGroup(props, state, buttonGroupRef);
|
|
31
|
+
const segmentCva$1 = uiStyle?.segment?.cva ?? segmentCva;
|
|
28
32
|
const formFieldProps = {
|
|
29
33
|
error,
|
|
30
34
|
label: "",
|
|
@@ -53,12 +57,7 @@ const SegmentBase = ({
|
|
|
53
57
|
...groupProps,
|
|
54
58
|
ref: buttonGroupRef,
|
|
55
59
|
onSelectionChange,
|
|
56
|
-
className:
|
|
57
|
-
"group/segment grid w-fit items-center gap-segmented-control-side-segmented-control p-segmented-control-side-segmented-control",
|
|
58
|
-
"bg-elevation-fill-default-3",
|
|
59
|
-
"rounded-segmented-control-rounding-segmented-control",
|
|
60
|
-
className
|
|
61
|
-
),
|
|
60
|
+
className: segmentCva$1({ ...props, className }),
|
|
62
61
|
style: {
|
|
63
62
|
gridTemplateColumns
|
|
64
63
|
},
|
|
@@ -1,28 +1,19 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
2
|
import { ToggleButton } from "react-aria-components";
|
|
3
|
+
import { segmentItemCva } from "./segment.cva.js";
|
|
4
4
|
import { Typography } from "../text/Typography/Typography.js";
|
|
5
|
+
import { UIStyle } from "../../config/uiStyle.context.js";
|
|
5
6
|
const SegmentItem = ({ label, icon, id, isDisabled, ...props }) => {
|
|
6
7
|
const IconComponent = icon;
|
|
7
|
-
const iconOnly = icon && !label;
|
|
8
|
+
const iconOnly = !!(icon && !label);
|
|
9
|
+
const uiStyle = UIStyle.useConfig();
|
|
10
|
+
const segmentItemCva$1 = uiStyle?.segment?.itemCva ?? segmentItemCva;
|
|
8
11
|
return /* @__PURE__ */ jsxs(
|
|
9
12
|
ToggleButton,
|
|
10
13
|
{
|
|
11
14
|
...props,
|
|
12
15
|
id,
|
|
13
|
-
className:
|
|
14
|
-
"flex items-center justify-center gap-segmented-control-gap-content-icon-to-text transition-all duration-200",
|
|
15
|
-
"border border-support-transparent-outline",
|
|
16
|
-
"py-segmented-control-height-segment",
|
|
17
|
-
iconOnly ? "px-segmented-control-height-segment" : "px-segmented-control-side-segment",
|
|
18
|
-
"rounded-segmented-control-rounding-segment",
|
|
19
|
-
"text-interactive-subtle-secondary-on-idle",
|
|
20
|
-
"hover:border-interactive-subtle-secondary-hover hover:bg-interactive-subtle-secondary-hover hover:text-interactive-subtle-secondary-on-hover",
|
|
21
|
-
"pressed:border-interactive-subtle-secondary-pressed pressed:bg-interactive-subtle-secondary-pressed pressed:text-interactive-subtle-secondary-on-pressed",
|
|
22
|
-
"disabled:border-support-transparent-outline disabled:text-interactive-subtle-secondary-on-disabled",
|
|
23
|
-
"selected:border-interactive-subtle-secondary-toggled-idle selected:bg-interactive-subtle-secondary-toggled-idle selected:text-interactive-subtle-secondary-on-toggled-idle",
|
|
24
|
-
"selected:disabled:border-interactive-subtle-secondary-toggled-disabled selected:disabled:bg-interactive-subtle-secondary-toggled-disabled selected:disabled:text-interactive-subtle-secondary-on-toggled-disabled"
|
|
25
|
-
),
|
|
16
|
+
className: segmentItemCva$1({ iconOnly }),
|
|
26
17
|
isDisabled,
|
|
27
18
|
children: [
|
|
28
19
|
icon && /* @__PURE__ */ jsx(IconComponent, { className: "size-6" }),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export declare const segmentCva: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
3
|
+
export interface SegmentVariantProps extends VariantProps<typeof segmentCva> {
|
|
4
|
+
}
|
|
5
|
+
export declare const segmentItemCva: (props?: ({
|
|
6
|
+
iconOnly?: boolean | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export interface SegmentItemVariantProps extends VariantProps<typeof segmentItemCva> {
|
|
9
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
const segmentCva = cva([
|
|
3
|
+
"group/segment grid w-fit items-center gap-segmented-control-side-segmented-control p-segmented-control-side-segmented-control",
|
|
4
|
+
"bg-elevation-fill-default-3",
|
|
5
|
+
"rounded-segmented-control-rounding-segmented-control"
|
|
6
|
+
]);
|
|
7
|
+
const segmentItemCva = cva(
|
|
8
|
+
[
|
|
9
|
+
"flex items-center justify-center gap-segmented-control-gap-content-icon-to-text transition-all duration-200",
|
|
10
|
+
"border border-support-transparent-outline",
|
|
11
|
+
"py-segmented-control-height-segment",
|
|
12
|
+
"rounded-segmented-control-rounding-segment",
|
|
13
|
+
"text-interactive-subtle-secondary-on-idle",
|
|
14
|
+
"hover:border-interactive-subtle-secondary-hover hover:bg-interactive-subtle-secondary-hover hover:text-interactive-subtle-secondary-on-hover",
|
|
15
|
+
"pressed:border-interactive-subtle-secondary-pressed pressed:bg-interactive-subtle-secondary-pressed pressed:text-interactive-subtle-secondary-on-pressed",
|
|
16
|
+
"disabled:border-support-transparent-outline disabled:text-interactive-subtle-secondary-on-disabled",
|
|
17
|
+
"selected:border-interactive-subtle-secondary-toggled-idle selected:bg-interactive-subtle-secondary-toggled-idle selected:text-interactive-subtle-secondary-on-toggled-idle",
|
|
18
|
+
"selected:disabled:border-interactive-subtle-secondary-toggled-disabled selected:disabled:bg-interactive-subtle-secondary-toggled-disabled selected:disabled:text-interactive-subtle-secondary-on-toggled-disabled"
|
|
19
|
+
],
|
|
20
|
+
{
|
|
21
|
+
variants: {
|
|
22
|
+
iconOnly: {
|
|
23
|
+
true: "px-segmented-control-height-segment",
|
|
24
|
+
false: "px-segmented-control-side-segment"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
iconOnly: false
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
export {
|
|
33
|
+
segmentCva,
|
|
34
|
+
segmentItemCva
|
|
35
|
+
};
|
|
@@ -2,7 +2,8 @@ import { FC, ReactElement, Ref, SVGProps } from 'react';
|
|
|
2
2
|
import { Key, ToggleButtonGroupProps, ToggleButtonProps } from 'react-aria-components';
|
|
3
3
|
import { FieldValues } from 'react-hook-form';
|
|
4
4
|
import { ControlProps } from '../inputs/shared/form.types';
|
|
5
|
-
|
|
5
|
+
import { SegmentItemVariantProps, SegmentVariantProps } from './segment.cva';
|
|
6
|
+
export interface SegmentItem<TKey extends Key = Key> extends ToggleButtonProps, SegmentItemVariantProps {
|
|
6
7
|
id: TKey;
|
|
7
8
|
label?: string;
|
|
8
9
|
icon?: FC<SVGProps<SVGSVGElement>> | ReactElement;
|
|
@@ -25,7 +26,7 @@ export type GroupedSegmentControlProps<TFieldValues extends FieldValues, TKey ex
|
|
|
25
26
|
} & ControlProps<MultiSegmentProps<TKey>, TFieldValues>) | ({
|
|
26
27
|
selectionMode?: SingleSegmentProps["selectionMode"];
|
|
27
28
|
} & ControlProps<SingleSegmentProps<TKey>, TFieldValues>);
|
|
28
|
-
export type SegmentProps<TKey extends Key = Key> = Omit<ToggleButtonGroupProps, "children" | "onSelectionChange" | "selectedKeys" | "defaultSelectedKeys"> & {
|
|
29
|
+
export type SegmentProps<TKey extends Key = Key> = Omit<ToggleButtonGroupProps & SegmentVariantProps, "children" | "onSelectionChange" | "selectedKeys" | "defaultSelectedKeys"> & {
|
|
29
30
|
ref?: Ref<HTMLElement>;
|
|
30
31
|
items: SegmentItem<TKey>[];
|
|
31
32
|
className?: string;
|
|
@@ -7,4 +7,4 @@ export interface TagProps extends TagVariantProps, AriaButtonProps {
|
|
|
7
7
|
isDisabled?: boolean;
|
|
8
8
|
onDismiss?: () => void;
|
|
9
9
|
}
|
|
10
|
-
export declare const Tag: ({
|
|
10
|
+
export declare const Tag: ({ className, children, dismissable, isDisabled, onDismiss, ...props }: TagProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,7 +8,7 @@ import { tag } from "./tag.cva.js";
|
|
|
8
8
|
import { Typography } from "../Typography/Typography.js";
|
|
9
9
|
import { ns } from "../../../config/i18n.js";
|
|
10
10
|
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
11
|
-
const Tag = ({
|
|
11
|
+
const Tag = ({ className, children, dismissable, isDisabled, onDismiss, ...props }) => {
|
|
12
12
|
const uiStyle = UIStyle.useConfig();
|
|
13
13
|
const tagCva = uiStyle?.tag?.cva ?? tag;
|
|
14
14
|
const { t } = useTranslation(ns);
|
|
@@ -17,7 +17,7 @@ const Tag = ({ color, className, children, dismissable, isDisabled, onDismiss, .
|
|
|
17
17
|
"div",
|
|
18
18
|
{
|
|
19
19
|
className: tagCva({
|
|
20
|
-
|
|
20
|
+
...props,
|
|
21
21
|
className: clsx("pointer-events-none", className)
|
|
22
22
|
}),
|
|
23
23
|
children: [
|
|
@@ -7,7 +7,10 @@ import { RadioVariantProps } from '../components/inputs/RadioGroup/radio.cva';
|
|
|
7
7
|
import { InputBaseProps, InputSideProps, InputSizeProps } from '../components/inputs/shared/input.cva';
|
|
8
8
|
import { LabelBaseProps } from '../components/inputs/shared/label.cva';
|
|
9
9
|
import { ToggleVariantProps } from '../components/inputs/Toggle/toggle.cva';
|
|
10
|
+
import { MenuCvaVariantProps, MenuItemVariantProps, MenuPopoverVariantProps, MenuPopoverWrapperVariantProps } from '../components/Menu/menu.cva';
|
|
11
|
+
import { ModalVariantProps } from '../components/overlays/Modal/modal.cva';
|
|
10
12
|
import { TooltipPointerHorizontalVariantProps, TooltipPointerVerticalVariantProps, TooltipTextVariantProps, TooltipVariantProps } from '../components/overlays/Tooltip/tooltip.cva';
|
|
13
|
+
import { SegmentItemVariantProps, SegmentVariantProps } from '../components/segment/segment.cva';
|
|
11
14
|
import { AlertVariantProps } from '../components/status/Alert/alert.cva';
|
|
12
15
|
import { ToastVariantProps } from '../components/status/Toast/toast.cva';
|
|
13
16
|
import { TableDataVariantProps, TableHeadDataVariantProps, TableHeadRowVariantProps, TableRowVariantProps } from '../components/table/table.cva';
|
|
@@ -82,6 +85,21 @@ export declare namespace UIStyle {
|
|
|
82
85
|
pointerVerticalCva?: Cva<TooltipPointerVerticalVariantProps>;
|
|
83
86
|
textCva?: Cva<TooltipTextVariantProps>;
|
|
84
87
|
};
|
|
88
|
+
modal: {
|
|
89
|
+
contentCva?: Cva<ModalVariantProps>;
|
|
90
|
+
overlayCva?: Cva<ModalVariantProps>;
|
|
91
|
+
mainCva?: Cva<ModalVariantProps>;
|
|
92
|
+
};
|
|
93
|
+
menu: {
|
|
94
|
+
cva?: Cva<MenuCvaVariantProps>;
|
|
95
|
+
itemCva?: Cva<MenuItemVariantProps>;
|
|
96
|
+
popoverCva?: Cva<MenuPopoverVariantProps>;
|
|
97
|
+
popoverWrapperCva?: Cva<MenuPopoverWrapperVariantProps>;
|
|
98
|
+
};
|
|
99
|
+
segment: {
|
|
100
|
+
cva?: Cva<SegmentVariantProps>;
|
|
101
|
+
itemCva?: Cva<SegmentItemVariantProps>;
|
|
102
|
+
};
|
|
85
103
|
}
|
|
86
104
|
interface ProviderProps {
|
|
87
105
|
config?: Partial<Options>;
|