@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,6 @@
|
|
|
1
1
|
import { ChevronRightIcon } from "../../assets/icons/ChevronRight.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { UIOverrides } from "../../config/uiOverrides.context.js";
|
|
3
|
+
import { breadcrumbChevronDefinition, breadcrumbIconDefinition, breadcrumbItemDefinition, breadcrumbSegmentDefinition, breadcrumbsDefinition } from "./breadcrumbs.cva.js";
|
|
4
4
|
import { MenuDesktop } from "../Menu/MenuDesktop.js";
|
|
5
5
|
import { Typography } from "../text/Typography/Typography.js";
|
|
6
6
|
import { Tooltip as Tooltip$1 } from "../overlays/Tooltip/Tooltip.js";
|
|
@@ -11,11 +11,11 @@ import { useLayoutEffect, useRef, useState } from "react";
|
|
|
11
11
|
import { Breadcrumb, Breadcrumbs, Button, Link } from "react-aria-components";
|
|
12
12
|
//#region src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
13
13
|
var Breadcrumbs$1 = ({ items, className, onAction, iconOnly = false }) => {
|
|
14
|
-
const breadcrumbsCva
|
|
15
|
-
const breadcrumbItem
|
|
16
|
-
const breadcrumbSegmentCva =
|
|
17
|
-
const breadcrumbChevronCva =
|
|
18
|
-
const breadcrumbIconCva =
|
|
14
|
+
const breadcrumbsCva = UIOverrides.useCva("breadcrumbs.cva", breadcrumbsDefinition);
|
|
15
|
+
const breadcrumbItem = UIOverrides.useCva("breadcrumbs.itemCva", breadcrumbItemDefinition);
|
|
16
|
+
const breadcrumbSegmentCva = UIOverrides.useCva("breadcrumbs.segmentCva", breadcrumbSegmentDefinition);
|
|
17
|
+
const breadcrumbChevronCva = UIOverrides.useCva("breadcrumbs.chevronCva", breadcrumbChevronDefinition);
|
|
18
|
+
const breadcrumbIconCva = UIOverrides.useCva("breadcrumbs.iconCva", breadcrumbIconDefinition);
|
|
19
19
|
const containerRef = useRef(null);
|
|
20
20
|
const [isOverflowing, setIsOverflowing] = useState(items.length <= 2 ? false : null);
|
|
21
21
|
useLayoutEffect(() => {
|
|
@@ -38,7 +38,7 @@ var Breadcrumbs$1 = ({ items, className, onAction, iconOnly = false }) => {
|
|
|
38
38
|
const LinkComponent = LinkContext.useLinkContext()?.LinkComponent ?? Link;
|
|
39
39
|
const renderBreadcrumbLink = (item, isCurrent, iconOnly) => /* @__PURE__ */ jsxs(LinkComponent, {
|
|
40
40
|
...item.link,
|
|
41
|
-
className: breadcrumbItem
|
|
41
|
+
className: breadcrumbItem({ isCurrent }),
|
|
42
42
|
children: [item.icon && /* @__PURE__ */ jsx(item.icon, {
|
|
43
43
|
className: breadcrumbIconCva({}),
|
|
44
44
|
"aria-label": item.label
|
|
@@ -59,7 +59,7 @@ var Breadcrumbs$1 = ({ items, className, onAction, iconOnly = false }) => {
|
|
|
59
59
|
text: hiddenItems.map((i) => i.label).join(", "),
|
|
60
60
|
children: /* @__PURE__ */ jsx(Button, {
|
|
61
61
|
"aria-label": "Show hidden breadcrumbs",
|
|
62
|
-
className: breadcrumbItem
|
|
62
|
+
className: breadcrumbItem({
|
|
63
63
|
isCurrent: false,
|
|
64
64
|
isEllipsis: true
|
|
65
65
|
}),
|
|
@@ -75,7 +75,7 @@ var Breadcrumbs$1 = ({ items, className, onAction, iconOnly = false }) => {
|
|
|
75
75
|
});
|
|
76
76
|
return /* @__PURE__ */ jsxs(Breadcrumbs, {
|
|
77
77
|
onAction,
|
|
78
|
-
className: clsx(breadcrumbsCva
|
|
78
|
+
className: clsx(breadcrumbsCva({}), className),
|
|
79
79
|
children: [
|
|
80
80
|
/* @__PURE__ */ jsxs(Breadcrumb, {
|
|
81
81
|
id: firstItem.id,
|
|
@@ -99,7 +99,7 @@ var Breadcrumbs$1 = ({ items, className, onAction, iconOnly = false }) => {
|
|
|
99
99
|
ref: containerRef,
|
|
100
100
|
items,
|
|
101
101
|
onAction,
|
|
102
|
-
className: clsx(breadcrumbsCva
|
|
102
|
+
className: clsx(breadcrumbsCva({}), className),
|
|
103
103
|
style: { visibility: isReady ? "visible" : "hidden" },
|
|
104
104
|
children: (item) => /* @__PURE__ */ jsx(Breadcrumb, {
|
|
105
105
|
id: item.id,
|
|
@@ -1,19 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
1
|
+
import { UIOverrides } from '../../config/uiOverrides.context';
|
|
2
|
+
export declare const breadcrumbsDefinition: {
|
|
3
|
+
base: string[];
|
|
4
|
+
config?: import("../../utils/style-merge.util").StyleMergeUtils.Config<Record<never, never>>;
|
|
5
|
+
};
|
|
6
|
+
export type BreadcrumbsConfig = NonNullable<typeof breadcrumbsDefinition.config>;
|
|
7
|
+
export interface BreadcrumbsVariantProps extends UIOverrides.VariantProps<BreadcrumbsConfig> {
|
|
4
8
|
}
|
|
5
|
-
export declare const
|
|
6
|
-
|
|
9
|
+
export declare const breadcrumbSegmentDefinition: {
|
|
10
|
+
base: string[];
|
|
11
|
+
config?: import("../../utils/style-merge.util").StyleMergeUtils.Config<Record<never, never>>;
|
|
12
|
+
};
|
|
13
|
+
export type BreadcrumbSegmentConfig = NonNullable<typeof breadcrumbSegmentDefinition.config>;
|
|
14
|
+
export interface BreadcrumbSegmentVariantProps extends UIOverrides.VariantProps<BreadcrumbSegmentConfig> {
|
|
7
15
|
}
|
|
8
|
-
export declare const
|
|
9
|
-
|
|
16
|
+
export declare const breadcrumbChevronDefinition: {
|
|
17
|
+
base: string[];
|
|
18
|
+
config?: import("../../utils/style-merge.util").StyleMergeUtils.Config<Record<never, never>>;
|
|
19
|
+
};
|
|
20
|
+
export type BreadcrumbChevronConfig = NonNullable<typeof breadcrumbChevronDefinition.config>;
|
|
21
|
+
export interface BreadcrumbChevronVariantProps extends UIOverrides.VariantProps<BreadcrumbChevronConfig> {
|
|
10
22
|
}
|
|
11
|
-
export declare const
|
|
12
|
-
|
|
23
|
+
export declare const breadcrumbIconDefinition: {
|
|
24
|
+
base: string[];
|
|
25
|
+
config?: import("../../utils/style-merge.util").StyleMergeUtils.Config<Record<never, never>>;
|
|
26
|
+
};
|
|
27
|
+
export type BreadcrumbIconConfig = NonNullable<typeof breadcrumbIconDefinition.config>;
|
|
28
|
+
export interface BreadcrumbIconVariantProps extends UIOverrides.VariantProps<BreadcrumbIconConfig> {
|
|
13
29
|
}
|
|
14
|
-
export declare const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
30
|
+
export declare const breadcrumbItemDefinition: {
|
|
31
|
+
base: string[];
|
|
32
|
+
config: import("../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
33
|
+
readonly isCurrent: {
|
|
34
|
+
readonly true: "text-interactive-text-primary-idle";
|
|
35
|
+
readonly false: "text-interactive-text-secondary-idle hover:text-interactive-text-secondary-hover";
|
|
36
|
+
};
|
|
37
|
+
readonly isEllipsis: {
|
|
38
|
+
readonly true: "hover:text-interactive-text-primary-hover!";
|
|
39
|
+
readonly false: "";
|
|
40
|
+
};
|
|
41
|
+
}>;
|
|
42
|
+
};
|
|
43
|
+
export type BreadcrumbItemConfig = NonNullable<typeof breadcrumbItemDefinition.config>;
|
|
44
|
+
export interface BreadcrumbItemVariantProps extends UIOverrides.VariantProps<BreadcrumbItemConfig> {
|
|
19
45
|
}
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../config/uiOverrides.context.js";
|
|
2
2
|
//#region src/components/Breadcrumbs/breadcrumbs.cva.ts
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
var breadcrumbsDefinition = UIOverrides.defineConfig({ base: ["flex items-center gap-breadcrumbs-gap-segment-to-segment"] });
|
|
4
|
+
var breadcrumbSegmentDefinition = UIOverrides.defineConfig({ base: ["flex items-center gap-breadcrumbs-gap-segment-to-segment"] });
|
|
5
|
+
var breadcrumbChevronDefinition = UIOverrides.defineConfig({ base: ["size-6 shrink-0 text-interactive-text-secondary-idle"] });
|
|
6
|
+
var breadcrumbIconDefinition = UIOverrides.defineConfig({ base: ["size-4 shrink-0"] });
|
|
7
|
+
var breadcrumbItemDefinition = UIOverrides.defineConfig({
|
|
8
|
+
base: ["inline-flex cursor-pointer items-center gap-breadcrumbs-gap-icon-to-text whitespace-nowrap font-inter font-medium text-label-3 no-underline"],
|
|
9
|
+
config: {
|
|
10
|
+
variants: {
|
|
11
|
+
isCurrent: {
|
|
12
|
+
true: "text-interactive-text-primary-idle",
|
|
13
|
+
false: "text-interactive-text-secondary-idle hover:text-interactive-text-secondary-hover"
|
|
14
|
+
},
|
|
15
|
+
isEllipsis: {
|
|
16
|
+
true: "hover:text-interactive-text-primary-hover!",
|
|
17
|
+
false: ""
|
|
18
|
+
}
|
|
12
19
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
isCurrent: false,
|
|
22
|
+
isEllipsis: false
|
|
16
23
|
}
|
|
17
|
-
},
|
|
18
|
-
defaultVariants: {
|
|
19
|
-
isCurrent: false,
|
|
20
|
-
isEllipsis: false
|
|
21
24
|
}
|
|
22
25
|
});
|
|
23
26
|
//#endregion
|
|
24
|
-
export {
|
|
27
|
+
export { breadcrumbChevronDefinition, breadcrumbIconDefinition, breadcrumbItemDefinition, breadcrumbSegmentDefinition, breadcrumbsDefinition };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { ArrowRightIcon } from "../../assets/icons/ArrowRight.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { UIOverrides } from "../../config/uiOverrides.context.js";
|
|
3
|
+
import { menuItemDefinition } from "./menu.cva.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { clsx } from "clsx";
|
|
6
6
|
import { MenuItem } from "react-aria-components";
|
|
7
7
|
//#region src/components/Menu/MenuItem.tsx
|
|
8
8
|
var MenuItem$1 = ({ label, content, children, className, ...item }) => {
|
|
9
9
|
const hasSubmenu = !!children && children?.length > 0;
|
|
10
|
-
const menuItemCva
|
|
10
|
+
const menuItemCva = UIOverrides.useCva("menu.itemCva", menuItemDefinition);
|
|
11
11
|
return /* @__PURE__ */ jsxs(MenuItem, {
|
|
12
12
|
...item,
|
|
13
13
|
textValue: label,
|
|
14
14
|
"aria-label": label,
|
|
15
|
-
className: clsx(menuItemCva
|
|
15
|
+
className: clsx(menuItemCva({
|
|
16
16
|
...item,
|
|
17
17
|
isMobile: false
|
|
18
18
|
}), className),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ArrowLeftIcon } from "../../assets/icons/ArrowLeft.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { UIOverrides } from "../../config/uiOverrides.context.js";
|
|
3
|
+
import { menuDefinition, menuItemDefinition } from "./menu.cva.js";
|
|
4
4
|
import { MenuItem as MenuItem$1 } from "./MenuItem.js";
|
|
5
5
|
import { BottomSheet } from "../overlays/BottomSheet/BottomSheet.js";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -9,8 +9,8 @@ import { useRef, useState } from "react";
|
|
|
9
9
|
import { Button, Menu } from "react-aria-components";
|
|
10
10
|
//#region src/components/Menu/MenuMobile.tsx
|
|
11
11
|
var MenuMobile = ({ trigger, items, onAction, ...props }) => {
|
|
12
|
-
const menuItemCva
|
|
13
|
-
const menuCva
|
|
12
|
+
const menuItemCva = UIOverrides.useCva("menu.itemCva", menuItemDefinition);
|
|
13
|
+
const menuCva = UIOverrides.useCva("menu.cva", menuDefinition);
|
|
14
14
|
const activeItemRef = useRef(null);
|
|
15
15
|
const activeItemParentsRef = useRef([]);
|
|
16
16
|
const lastEventRef = useRef(null);
|
|
@@ -46,7 +46,7 @@ var MenuMobile = ({ trigger, items, onAction, ...props }) => {
|
|
|
46
46
|
isDismissable: true,
|
|
47
47
|
hideHeader: true,
|
|
48
48
|
children: () => /* @__PURE__ */ jsxs(Fragment, { children: [activeItem && /* @__PURE__ */ jsxs(Button, {
|
|
49
|
-
className: clsx(menuItemCva
|
|
49
|
+
className: clsx(menuItemCva({
|
|
50
50
|
...props,
|
|
51
51
|
isMobile: true
|
|
52
52
|
})),
|
|
@@ -62,7 +62,7 @@ var MenuMobile = ({ trigger, items, onAction, ...props }) => {
|
|
|
62
62
|
children: /* @__PURE__ */ jsx(Menu, {
|
|
63
63
|
autoFocus: true,
|
|
64
64
|
onClose,
|
|
65
|
-
className: menuCva
|
|
65
|
+
className: menuCva({
|
|
66
66
|
...props,
|
|
67
67
|
isMobile: true
|
|
68
68
|
}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../config/uiOverrides.context.js";
|
|
2
|
+
import { menuDefinition, menuPopoverDefinition, menuPopoverWrapperDefinition } from "./menu.cva.js";
|
|
3
3
|
import { MenuItem as MenuItem$1 } from "./MenuItem.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { useRef } from "react";
|
|
@@ -7,17 +7,17 @@ import { Menu, Popover, SubmenuTrigger } from "react-aria-components";
|
|
|
7
7
|
//#region src/components/Menu/MenuPopover.tsx
|
|
8
8
|
var MenuPopover = ({ items, className, onAction, ...props }) => {
|
|
9
9
|
const lastEventRef = useRef(null);
|
|
10
|
-
const menuPopoverCva
|
|
11
|
-
const menuPopoverWrapperCva
|
|
12
|
-
const menuCva
|
|
10
|
+
const menuPopoverCva = UIOverrides.useCva("menu.popoverCva", menuPopoverDefinition);
|
|
11
|
+
const menuPopoverWrapperCva = UIOverrides.useCva("menu.popoverWrapperCva", menuPopoverWrapperDefinition);
|
|
12
|
+
const menuCva = UIOverrides.useCva("menu.cva", menuDefinition);
|
|
13
13
|
return /* @__PURE__ */ jsx(Popover, {
|
|
14
14
|
...props,
|
|
15
|
-
className: menuPopoverCva
|
|
15
|
+
className: menuPopoverCva({
|
|
16
16
|
...props,
|
|
17
17
|
className
|
|
18
18
|
}),
|
|
19
19
|
children: /* @__PURE__ */ jsx("div", {
|
|
20
|
-
className: menuPopoverWrapperCva
|
|
20
|
+
className: menuPopoverWrapperCva({}),
|
|
21
21
|
children: /* @__PURE__ */ jsx("div", {
|
|
22
22
|
onClickCapture: (e) => {
|
|
23
23
|
lastEventRef.current = e;
|
|
@@ -27,7 +27,7 @@ var MenuPopover = ({ items, className, onAction, ...props }) => {
|
|
|
27
27
|
},
|
|
28
28
|
children: /* @__PURE__ */ jsx(Menu, {
|
|
29
29
|
onAction: (key) => onAction?.(key, lastEventRef.current),
|
|
30
|
-
className: menuCva
|
|
30
|
+
className: menuCva({
|
|
31
31
|
...props,
|
|
32
32
|
isMobile: false
|
|
33
33
|
}),
|
|
@@ -1,17 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { UIOverrides } from '../../config/uiOverrides.context';
|
|
2
|
+
export declare const menuDefinition: {
|
|
3
|
+
base: string[];
|
|
4
|
+
config: import("../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
5
|
+
readonly isMobile: {
|
|
6
|
+
readonly true: [];
|
|
7
|
+
readonly false: [];
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
export type MenuConfig = NonNullable<typeof menuDefinition.config>;
|
|
12
|
+
export interface MenuCvaVariantProps extends UIOverrides.VariantProps<MenuConfig> {
|
|
6
13
|
}
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
export declare const menuItemDefinition: {
|
|
15
|
+
base: string[];
|
|
16
|
+
config: import("../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
17
|
+
readonly isMobile: {
|
|
18
|
+
readonly true: ["justify-start! w-full font-labels-default"];
|
|
19
|
+
readonly false: [];
|
|
20
|
+
};
|
|
21
|
+
}>;
|
|
22
|
+
};
|
|
23
|
+
export type MenuItemConfig = NonNullable<typeof menuItemDefinition.config>;
|
|
24
|
+
export interface MenuItemVariantProps extends UIOverrides.VariantProps<MenuItemConfig> {
|
|
11
25
|
}
|
|
12
|
-
export declare const
|
|
13
|
-
|
|
26
|
+
export declare const menuPopoverDefinition: {
|
|
27
|
+
base: string[];
|
|
28
|
+
config?: import("../../utils/style-merge.util").StyleMergeUtils.Config<Record<never, never>>;
|
|
29
|
+
};
|
|
30
|
+
export type MenuPopoverConfig = NonNullable<typeof menuPopoverDefinition.config>;
|
|
31
|
+
export interface MenuPopoverVariantProps extends UIOverrides.VariantProps<MenuPopoverConfig> {
|
|
14
32
|
}
|
|
15
|
-
export declare const
|
|
16
|
-
|
|
33
|
+
export declare const menuPopoverWrapperDefinition: {
|
|
34
|
+
base: string[];
|
|
35
|
+
config?: import("../../utils/style-merge.util").StyleMergeUtils.Config<Record<never, never>>;
|
|
36
|
+
};
|
|
37
|
+
export type MenuPopoverWrapperConfig = NonNullable<typeof menuPopoverWrapperDefinition.config>;
|
|
38
|
+
export interface MenuPopoverWrapperVariantProps extends UIOverrides.VariantProps<MenuPopoverWrapperConfig> {
|
|
17
39
|
}
|
|
@@ -1,28 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../config/uiOverrides.context.js";
|
|
2
2
|
//#region src/components/Menu/menu.cva.ts
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
var menuDefinition = UIOverrides.defineConfig({
|
|
4
|
+
base: ["outline-none"],
|
|
5
|
+
config: {
|
|
6
|
+
variants: { isMobile: {
|
|
7
|
+
true: [],
|
|
8
|
+
false: []
|
|
9
|
+
} },
|
|
10
|
+
defaultVariants: { isMobile: false }
|
|
11
|
+
}
|
|
9
12
|
});
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
var menuItemDefinition = UIOverrides.defineConfig({
|
|
14
|
+
base: [
|
|
15
|
+
"flex cursor-pointer items-center justify-between gap-list-gap-checkbox-to-label px-list-side-item-left py-list-height-item has-submenu:pr-list-side-item-right",
|
|
16
|
+
"border-b border-b-elevation-outline-default-1 outline-none last:border-b-0",
|
|
17
|
+
"bg-elevation-fill-default-1 text-interactive-text-secondary-idle",
|
|
18
|
+
"disabled:cursor-default disabled:text-interactive-text-secondary-disabled",
|
|
19
|
+
"hover:bg-elevation-fill-default-2 hover:text-interactive-text-secondary-hover",
|
|
20
|
+
"open:cursor-default open:bg-interactive-contained-primary-idle! open:text-interactive-contained-primary-on-idle!",
|
|
21
|
+
"focus-visible:bg-elevation-fill-default-2 focus-visible:text-interactive-text-secondary-hover"
|
|
22
|
+
],
|
|
23
|
+
config: {
|
|
24
|
+
variants: { isMobile: {
|
|
25
|
+
true: ["justify-start! w-full font-labels-default"],
|
|
26
|
+
false: []
|
|
27
|
+
} },
|
|
28
|
+
defaultVariants: { isMobile: false }
|
|
29
|
+
}
|
|
24
30
|
});
|
|
25
|
-
var
|
|
26
|
-
var
|
|
31
|
+
var menuPopoverDefinition = UIOverrides.defineConfig({ base: ["pt-2 outline-none"] });
|
|
32
|
+
var menuPopoverWrapperDefinition = UIOverrides.defineConfig({ base: ["overflow-hidden rounded-list-rounding-dropdown border border-elevation-outline-default-1 shadow-5 outline-none"] });
|
|
27
33
|
//#endregion
|
|
28
|
-
export {
|
|
34
|
+
export { menuDefinition, menuItemDefinition, menuPopoverDefinition, menuPopoverWrapperDefinition };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
import { LinkContext } from "../../../config/link.context.js";
|
|
3
3
|
import { ButtonContent } from "../shared/ButtonContent.js";
|
|
4
4
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
5
|
-
import {
|
|
5
|
+
import { buttonContentDefinition, buttonDefinition, buttonIconSizeDefinition, buttonSizeDefinition, buttonTypography } from "./button.cva.js";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { clsx } from "clsx";
|
|
8
8
|
import { Button, Link, ToggleButton } from "react-aria-components";
|
|
@@ -11,11 +11,11 @@ var Button$1 = ({ icon: Icon, iconPosition, children, isLoading, className, link
|
|
|
11
11
|
const linkContext = LinkContext.useLinkContext();
|
|
12
12
|
const uiConfig = UIConfig.useConfig();
|
|
13
13
|
const { variant = uiConfig.button.variant, size = uiConfig.button.size } = props;
|
|
14
|
-
const buttonCva =
|
|
15
|
-
const buttonSizeCva =
|
|
16
|
-
const buttonContentCva =
|
|
17
|
-
const buttonIconSizeCva =
|
|
18
|
-
const typographyMap =
|
|
14
|
+
const buttonCva = UIOverrides.useCva("button.cva", buttonDefinition);
|
|
15
|
+
const buttonSizeCva = UIOverrides.useCva("button.sizeCva", buttonSizeDefinition);
|
|
16
|
+
const buttonContentCva = UIOverrides.useCva("button.contentCva", buttonContentDefinition);
|
|
17
|
+
const buttonIconSizeCva = UIOverrides.useCva("button.iconSize", buttonIconSizeDefinition);
|
|
18
|
+
const typographyMap = UIOverrides.useMapper("button.typography", buttonTypography);
|
|
19
19
|
const Component = (() => {
|
|
20
20
|
if (link) return linkContext?.LinkComponent ?? Link;
|
|
21
21
|
if (props.toggle != null) return ToggleButton;
|
|
@@ -1,30 +1,99 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from '../../../config/uiOverrides.context';
|
|
2
2
|
import { TypographyVariantProps } from '../../text/Typography/typography.cva';
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
3
|
+
export declare const buttonDefinition: {
|
|
4
|
+
base: string[];
|
|
5
|
+
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
6
|
+
readonly width: {
|
|
7
|
+
readonly fill: "w-full";
|
|
8
|
+
readonly hug: "w-auto";
|
|
9
|
+
};
|
|
10
|
+
readonly size: {
|
|
11
|
+
readonly none: "";
|
|
12
|
+
readonly xs: "";
|
|
13
|
+
readonly s: "";
|
|
14
|
+
readonly m: "";
|
|
15
|
+
readonly l: "";
|
|
16
|
+
};
|
|
17
|
+
readonly color: {
|
|
18
|
+
readonly primary: "";
|
|
19
|
+
readonly secondary: "";
|
|
20
|
+
readonly success: "";
|
|
21
|
+
readonly warning: "";
|
|
22
|
+
readonly error: "";
|
|
23
|
+
readonly dual: "";
|
|
24
|
+
};
|
|
25
|
+
readonly variant: {
|
|
26
|
+
readonly contained: "";
|
|
27
|
+
readonly outlined: "";
|
|
28
|
+
readonly subtle: "";
|
|
29
|
+
readonly text: "group-data-[split]/split:data-[separator]:after:hidden";
|
|
30
|
+
readonly ghost: "";
|
|
31
|
+
};
|
|
32
|
+
readonly inverted: {
|
|
33
|
+
readonly true: "";
|
|
34
|
+
readonly false: "";
|
|
35
|
+
};
|
|
36
|
+
}>;
|
|
37
|
+
};
|
|
38
|
+
export type ButtonConfig = NonNullable<typeof buttonDefinition.config>;
|
|
39
|
+
export interface ButtonVariantProps extends UIOverrides.VariantProps<ButtonConfig> {
|
|
11
40
|
}
|
|
12
|
-
export declare const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
41
|
+
export declare const buttonSizeDefinition: {
|
|
42
|
+
base: string[];
|
|
43
|
+
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
44
|
+
readonly size: {
|
|
45
|
+
readonly none: "rounded-button-rounding-s p-0";
|
|
46
|
+
readonly xs: "rounded-button-rounding-s";
|
|
47
|
+
readonly s: "rounded-button-rounding-s";
|
|
48
|
+
readonly m: "rounded-button-rounding-m";
|
|
49
|
+
readonly l: "rounded-button-rounding-l";
|
|
50
|
+
};
|
|
51
|
+
readonly iconOnly: {
|
|
52
|
+
readonly true: "";
|
|
53
|
+
readonly false: "";
|
|
54
|
+
};
|
|
55
|
+
}>;
|
|
56
|
+
};
|
|
57
|
+
export type ButtonSizeConfig = NonNullable<typeof buttonSizeDefinition.config>;
|
|
58
|
+
export declare const buttonContentDefinition: {
|
|
59
|
+
base: string[];
|
|
60
|
+
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
61
|
+
readonly size: {
|
|
62
|
+
readonly none: "gap-button-gap-icon-to-label";
|
|
63
|
+
readonly xs: "gap-button-gap-icon-to-label";
|
|
64
|
+
readonly s: "gap-button-gap-icon-to-label";
|
|
65
|
+
readonly m: "gap-button-gap-icon-to-label";
|
|
66
|
+
readonly l: "gap-button-gap-icon-to-label";
|
|
67
|
+
};
|
|
68
|
+
readonly iconPosition: {
|
|
69
|
+
readonly left: "";
|
|
70
|
+
readonly right: "";
|
|
71
|
+
readonly none: "";
|
|
72
|
+
};
|
|
73
|
+
readonly iconOnly: {
|
|
74
|
+
readonly true: "";
|
|
75
|
+
readonly false: "";
|
|
76
|
+
};
|
|
77
|
+
}>;
|
|
78
|
+
};
|
|
79
|
+
export type ButtonContentConfig = NonNullable<typeof buttonContentDefinition.config>;
|
|
80
|
+
export declare const buttonIconSizeDefinition: {
|
|
81
|
+
base: string[];
|
|
82
|
+
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
83
|
+
readonly size: {
|
|
84
|
+
readonly none: "h-6 w-6";
|
|
85
|
+
readonly xs: "h-6 w-6";
|
|
86
|
+
readonly s: "h-6 w-6";
|
|
87
|
+
readonly m: "h-6 w-6";
|
|
88
|
+
readonly l: "h-6 w-6";
|
|
89
|
+
};
|
|
90
|
+
}>;
|
|
91
|
+
};
|
|
92
|
+
export type ButtonIconSizeConfig = NonNullable<typeof buttonIconSizeDefinition.config>;
|
|
24
93
|
export declare const buttonTypography: (props: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
variant?: "contained" | "outlined" | "subtle" | "
|
|
29
|
-
inverted?: boolean | null | undefined;
|
|
94
|
+
readonly width?: "fill" | "hug" | null | undefined;
|
|
95
|
+
readonly size?: "none" | "xs" | "s" | "m" | "l" | null | undefined;
|
|
96
|
+
readonly color?: "primary" | "dual" | "secondary" | "success" | "warning" | "error" | null | undefined;
|
|
97
|
+
readonly variant?: "contained" | "outlined" | "subtle" | "ghost" | "text" | null | undefined;
|
|
98
|
+
readonly inverted?: boolean | null | undefined;
|
|
30
99
|
}) => TypographyVariantProps | undefined;
|