@povio/ui 2.2.1 → 2.2.3
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/README.md +8 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +5 -6
- package/dist/components/Menu/MenuItem.js +1 -1
- package/dist/components/Menu/MenuMobile.js +2 -3
- package/dist/components/Menu/MenuPopover.js +8 -7
- package/dist/components/buttons/Button/Button.js +24 -8
- package/dist/components/buttons/PillButton/PillButton.js +2 -3
- package/dist/components/buttons/shared/ButtonContent.js +1 -1
- package/dist/components/inputs/Checkbox/Checkbox.js +2 -2
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +2 -3
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +2 -6
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +3 -10
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +1 -3
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +63 -78
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +33 -50
- package/dist/components/inputs/File/shared/InputUploadContent.js +2 -2
- package/dist/components/inputs/File/shared/InputUploadFilled.js +1 -1
- package/dist/components/inputs/FormField/FormField.js +1 -1
- package/dist/components/inputs/FormField/FormFieldError.js +4 -4
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -1
- package/dist/components/inputs/FormField/FormFieldLabel.js +14 -21
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +29 -26
- package/dist/components/inputs/Input/TextArea/TextArea.js +15 -7
- package/dist/components/inputs/Input/TextInput/TextInput.js +30 -27
- package/dist/components/inputs/Input/shared/InputContent.d.ts +2 -2
- package/dist/components/inputs/Input/shared/InputContent.js +53 -73
- package/dist/components/inputs/RadioGroup/RadioGroup.js +3 -4
- package/dist/components/inputs/Selection/shared/SelectBase.js +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +15 -4
- package/dist/components/inputs/Selection/shared/SelectInput.js +24 -41
- package/dist/components/inputs/Slider/Slider.js +1 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +9 -2
- package/dist/components/inputs/Toggle/Toggle.js +3 -4
- package/dist/components/inputs/shared/CheckContent.js +1 -1
- package/dist/components/inputs/shared/InputClear.d.ts +2 -1
- package/dist/components/inputs/shared/InputClear.js +2 -2
- package/dist/components/inputs/shared/input.cva.js +34 -25
- package/dist/components/inputs/shared/label.cva.js +10 -38
- package/dist/components/navigation/Accordion/Accordion.js +1 -1
- package/dist/components/navigation/Accordion/AccordionItem.js +9 -10
- package/dist/components/navigation/Stepper/Stepper.js +1 -1
- package/dist/components/navigation/Stepper/StepperItem.js +5 -6
- package/dist/components/navigation/Stepper/StepperSeparator.js +1 -1
- package/dist/components/outline.clsx.js +1 -1
- package/dist/components/overlays/ActionModal/ActionModal.d.ts +6 -1
- package/dist/components/overlays/ActionModal/ActionModal.js +7 -6
- package/dist/components/overlays/Modal/Modal.d.ts +2 -1
- package/dist/components/overlays/Modal/Modal.js +5 -5
- package/dist/components/overlays/Tooltip/Tooltip.js +4 -5
- package/dist/components/segment/Segment.js +1 -2
- package/dist/components/segment/SegmentItem.js +1 -1
- package/dist/components/status/Alert/Alert.js +3 -4
- package/dist/components/status/Toast/Toast.js +4 -5
- package/dist/components/table/Table.js +16 -11
- package/dist/components/text/Link/Link.js +1 -1
- package/dist/components/text/Tag/Tag.js +1 -1
- package/dist/components/text/Typography/Typography.d.ts +1 -1
- package/dist/components/text/Typography/Typography.js +1 -1
- package/dist/config/uiConfig.context.d.ts +4 -0
- package/dist/config/uiConfig.context.js +11 -0
- package/dist/config/uiStyle.context.d.ts +7 -3
- package/dist/config/uiStyle.context.js +13 -1
- package/dist/index.js +4 -4
- package/dist/tw-ui-plugin.d.ts +3 -0
- package/dist/tw-ui-plugin.js +21 -0
- package/dist/utils/compoundMapper.d.ts +1 -1
- package/package.json +27 -27
|
@@ -1,49 +1,32 @@
|
|
|
1
1
|
import { ArrowDropDownIcon } from "../../../../assets/icons/ArrowDropDown.js";
|
|
2
2
|
import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
3
3
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
4
|
-
import { inputBase, inputSide, inputSize } from "../../shared/input.cva.js";
|
|
5
4
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
6
5
|
import { ns } from "../../../../config/i18n.js";
|
|
7
6
|
import { InputClear } from "../../shared/InputClear.js";
|
|
7
|
+
import { inputBase, inputSize } 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";
|
|
11
11
|
import { clsx } from "clsx";
|
|
12
|
-
import { use, useMemo, useState } from "react";
|
|
12
|
+
import { use, useMemo, useRef, useState } from "react";
|
|
13
13
|
import { Button, ComboBoxStateContext, Input } from "react-aria-components";
|
|
14
14
|
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
15
|
-
import useMeasure from "react-use-measure";
|
|
16
15
|
import { useTranslation } from "react-i18next";
|
|
17
16
|
const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, onCloseComboBox, onBlur, ...props }) => {
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const inputBaseCva = uiStyle?.input?.baseCva ?? inputBase;
|
|
21
|
-
const inputSideCva = uiStyle?.input?.sideCva ?? inputSide;
|
|
17
|
+
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
18
|
+
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
22
19
|
const { t } = useTranslation("ui");
|
|
23
20
|
const state = use(ComboBoxStateContext);
|
|
24
21
|
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
25
22
|
const [isFocused, setIsFocused] = useState(false);
|
|
26
23
|
const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
|
|
27
24
|
const { isFocusVisible } = useFocusVisible();
|
|
28
|
-
const
|
|
25
|
+
const inputRef = useRef(null);
|
|
29
26
|
const { fieldState, isOpen, setIsOpen, listItems, selectedItems, onChange, onClear, onRemove, isMultiple, isLoading } = SelectContext.useSelect();
|
|
30
27
|
const isEmpty = selectedItems.length === 0;
|
|
31
28
|
const showTags = isMultiple && !isEmpty;
|
|
32
29
|
const showClearButton = isClearable && isHovered && (selectedItems.length > 0 || isSearchable && fieldState.inputValue !== "");
|
|
33
|
-
const style = useMemo(() => {
|
|
34
|
-
if (as !== "filter") return {};
|
|
35
|
-
return { paddingLeft: `calc(${isSearchable || showTags ? "1 * " : "2 * "}var(${inputSideCva({
|
|
36
|
-
size,
|
|
37
|
-
type: "var"
|
|
38
|
-
})}) + ${labelWidth}px)` };
|
|
39
|
-
}, [
|
|
40
|
-
labelWidth,
|
|
41
|
-
as,
|
|
42
|
-
size,
|
|
43
|
-
isSearchable,
|
|
44
|
-
showTags,
|
|
45
|
-
inputSideCva
|
|
46
|
-
]);
|
|
47
30
|
const labelProps = useMemo(() => {
|
|
48
31
|
const { labelProps: headerLabelProps } = headerProps ?? {};
|
|
49
32
|
if (!(as && ["filter", "floating"].includes(as)) || isSearchable) return headerLabelProps;
|
|
@@ -64,13 +47,21 @@ const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvali
|
|
|
64
47
|
}
|
|
65
48
|
if (e.key === "Backspace" && isMultiple && fieldState.inputValue === "" && Array.isArray(fieldState.value) && fieldState.value.length > 0) onChange(fieldState.value.slice(0, -1));
|
|
66
49
|
};
|
|
50
|
+
const onClick = () => {
|
|
51
|
+
if (isDisabled) return;
|
|
52
|
+
if (!isSearchable) {
|
|
53
|
+
setIsOpen(!isOpen);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
inputRef.current?.focus();
|
|
57
|
+
};
|
|
67
58
|
return /* @__PURE__ */ jsxs("div", {
|
|
68
59
|
ref,
|
|
69
60
|
className: inputBaseCva({
|
|
70
61
|
variant,
|
|
71
62
|
as,
|
|
72
63
|
...props,
|
|
73
|
-
className: clsx("group/select-content relative flex px-0!", isSearchable && "cursor-text", className)
|
|
64
|
+
className: clsx("group/select-content relative flex px-0!", !isDisabled && isSearchable && "cursor-text", className)
|
|
74
65
|
}),
|
|
75
66
|
"data-rac": "",
|
|
76
67
|
"data-disabled": isDisabled || void 0,
|
|
@@ -88,21 +79,20 @@ const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvali
|
|
|
88
79
|
...focusWithinProps,
|
|
89
80
|
children: [
|
|
90
81
|
/* @__PURE__ */ jsxs("div", {
|
|
91
|
-
className: clsx("relative flex flex-1 items-center truncate",
|
|
82
|
+
className: clsx("relative flex flex-1 items-center gap-input-gap-input-text-to-elements truncate", !isDisabled && isSearchable && "cursor-text", !isDisabled && !isSearchable && "cursor-pointer", inputSizeCva({
|
|
92
83
|
as,
|
|
93
84
|
size,
|
|
94
85
|
...props
|
|
95
86
|
})),
|
|
87
|
+
onClick,
|
|
96
88
|
children: [
|
|
97
89
|
as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
98
|
-
ref: labelContentRef,
|
|
99
90
|
as,
|
|
100
91
|
...headerProps,
|
|
101
92
|
labelProps
|
|
102
93
|
}),
|
|
103
94
|
(showTags || isSearchable) && /* @__PURE__ */ jsxs("div", {
|
|
104
|
-
className: clsx("flex flex-1 flex-wrap gap-
|
|
105
|
-
style,
|
|
95
|
+
className: clsx("flex flex-1 flex-wrap gap-input-gap-input-text-to-elements truncate", !isSearchable && "pointer-events-none z-1"),
|
|
106
96
|
children: [showTags && /* @__PURE__ */ jsx(SelectInputTags, {
|
|
107
97
|
selectedItems,
|
|
108
98
|
isDisabled,
|
|
@@ -110,14 +100,10 @@ const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvali
|
|
|
110
100
|
selectedTagsType,
|
|
111
101
|
onRemove
|
|
112
102
|
}), isSearchable && /* @__PURE__ */ jsx(Input, {
|
|
103
|
+
ref: inputRef,
|
|
113
104
|
placeholder: as === "floating" ? void 0 : placeholder,
|
|
114
105
|
onBlur,
|
|
115
|
-
className: clsx("w-full flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled",
|
|
116
|
-
as,
|
|
117
|
-
size,
|
|
118
|
-
...props,
|
|
119
|
-
className: "rounded-input-rounding-default"
|
|
120
|
-
}), inputClassName),
|
|
106
|
+
className: clsx("w-full flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", inputClassName),
|
|
121
107
|
onKeyDown,
|
|
122
108
|
...fieldProps
|
|
123
109
|
})]
|
|
@@ -127,13 +113,7 @@ const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvali
|
|
|
127
113
|
onPress: () => setIsOpen(!isOpen),
|
|
128
114
|
onBlur,
|
|
129
115
|
"data-type": "select-trigger",
|
|
130
|
-
className:
|
|
131
|
-
size,
|
|
132
|
-
as,
|
|
133
|
-
...props,
|
|
134
|
-
className: clsx("w-full truncate text-start outline-none disabled:text-interactive-text-secondary-disabled", showTags && "absolute inset-0 z-0")
|
|
135
|
-
}),
|
|
136
|
-
style,
|
|
116
|
+
className: clsx("w-full truncate text-start outline-none disabled:text-interactive-text-secondary-disabled", showTags && "absolute inset-0 z-0"),
|
|
137
117
|
...fieldProps,
|
|
138
118
|
children: [(as === "floating" && isEmpty || isMultiple && !isEmpty) && /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }), (isEmpty || !isMultiple) && (as !== "floating" || !isEmpty) && /* @__PURE__ */ jsxs(Typography, {
|
|
139
119
|
size: "label-1",
|
|
@@ -143,7 +123,10 @@ const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvali
|
|
|
143
123
|
})
|
|
144
124
|
]
|
|
145
125
|
}),
|
|
146
|
-
|
|
126
|
+
isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
127
|
+
onClear,
|
|
128
|
+
show: showClearButton
|
|
129
|
+
}),
|
|
147
130
|
!hideDropdownIcon && /* @__PURE__ */ jsx(Button, {
|
|
148
131
|
excludeFromTabOrder: true,
|
|
149
132
|
"aria-label": t(($) => isOpen ? $.ui.closeAlt : $.ui.openAlt),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Typography } from "../../text/Typography/Typography.js";
|
|
2
|
-
import { uiOutlineClass } from "../../outline.clsx.js";
|
|
3
2
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
3
|
+
import { uiOutlineClass } from "../../outline.clsx.js";
|
|
4
4
|
import { FormField } from "../FormField/FormField.js";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { clsx } from "clsx";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
2
2
|
import { isEqual } from "../../../utils/isEqual.js";
|
|
3
|
+
import { uiOutlineClass } from "../../outline.clsx.js";
|
|
3
4
|
import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
|
|
5
|
+
import { inputSide } from "../shared/input.cva.js";
|
|
4
6
|
import { FormField } from "../FormField/FormField.js";
|
|
5
7
|
import { TextEditorToolbar } from "./Toolbar/TextEditorToolbar.js";
|
|
6
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -40,6 +42,7 @@ var TextEditorBase = ({ ref, as = "default", placeholder, label, hideLabel, tool
|
|
|
40
42
|
const [isFocused, setIsFocused] = useState(false);
|
|
41
43
|
const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
|
|
42
44
|
const { isFocusVisible } = useFocusVisible();
|
|
45
|
+
const inputSideCva = UIStyle.useCva("input.sideCva", inputSide);
|
|
43
46
|
const formFieldProps = {
|
|
44
47
|
error,
|
|
45
48
|
label,
|
|
@@ -112,7 +115,11 @@ var TextEditorBase = ({ ref, as = "default", placeholder, label, hideLabel, tool
|
|
|
112
115
|
className: clsx("relative overflow-auto", as === "floating" && "pt-3"),
|
|
113
116
|
children: [as === "floating" && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
114
117
|
as,
|
|
115
|
-
...headerProps
|
|
118
|
+
...headerProps,
|
|
119
|
+
className: clsx(headerProps.className, inputSideCva({
|
|
120
|
+
size: "default",
|
|
121
|
+
type: "left"
|
|
122
|
+
}))
|
|
116
123
|
}), /* @__PURE__ */ jsx(EditorContent, {
|
|
117
124
|
editor,
|
|
118
125
|
placeholder: as === "floating" ? "" : placeholder,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
2
|
+
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
2
3
|
import { FormFieldError } from "../FormField/FormFieldError.js";
|
|
3
4
|
import { CheckContent } from "../shared/CheckContent.js";
|
|
4
|
-
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
5
5
|
import { toggle, toggleTypography } from "./toggle.cva.js";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { clsx } from "clsx";
|
|
@@ -10,9 +10,8 @@ import { mergeRefs } from "@react-aria/utils";
|
|
|
10
10
|
import { Controller } from "react-hook-form";
|
|
11
11
|
var ToggleBase = (props) => {
|
|
12
12
|
const ui = UIConfig.useConfig();
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const toggleTypographyMap = uiStyle?.toggle?.typography ?? toggleTypography;
|
|
13
|
+
const toggleCva = UIStyle.useCva("toggle.cva", toggle);
|
|
14
|
+
const toggleTypographyMap = UIStyle.useMapper("toggle.typography", toggleTypography);
|
|
16
15
|
const { className, children, isDisabled, error, variant = ui.toggle.variant, ...rest } = props;
|
|
17
16
|
const formFieldErrorProps = {
|
|
18
17
|
error,
|
|
@@ -4,7 +4,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
4
4
|
import clsx$1 from "clsx";
|
|
5
5
|
const CheckContent = ({ children, className, ...props }) => {
|
|
6
6
|
return /* @__PURE__ */ jsx("div", {
|
|
7
|
-
className: clsx$1(
|
|
7
|
+
className: clsx$1(UIStyle.useCva("typography.cva", typography)({
|
|
8
8
|
size: "label-1",
|
|
9
9
|
variant: "default",
|
|
10
10
|
...props.typography,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
interface InputClearProps {
|
|
3
3
|
onClear: () => void;
|
|
4
|
+
show?: boolean;
|
|
4
5
|
className?: string;
|
|
5
6
|
style?: CSSProperties;
|
|
6
7
|
}
|
|
7
|
-
export declare const InputClear: ({ onClear, className, style }: InputClearProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const InputClear: ({ onClear, className, style, show }: InputClearProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -4,11 +4,11 @@ import { ns } from "../../../config/i18n.js";
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { clsx } from "clsx";
|
|
6
6
|
import { useTranslation } from "react-i18next";
|
|
7
|
-
const InputClear = ({ onClear, className, style }) => {
|
|
7
|
+
const InputClear = ({ onClear, className, style, show }) => {
|
|
8
8
|
const { t } = useTranslation("ui");
|
|
9
9
|
return /* @__PURE__ */ jsx(InlineIconButton, {
|
|
10
10
|
color: "secondary",
|
|
11
|
-
className: clsx("group-hover/date-picker-content:
|
|
11
|
+
className: clsx("invisible flex items-center", "group-focus-within:visible group-hover/date-picker-content:visible group-hover/select-content:visible group-hover/text-area:visible group-hover:visible", "border-0!", !show && "invisible!", className),
|
|
12
12
|
label: t(($) => $.ui.clearAlt),
|
|
13
13
|
icon: CloseIcon,
|
|
14
14
|
onPress: onClear,
|
|
@@ -16,9 +16,11 @@ const inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
16
16
|
"h-full",
|
|
17
17
|
"border-transparent border-b-0 bg-transparent text-text-default-1",
|
|
18
18
|
"hover:border-input-outlined-outline-hover",
|
|
19
|
-
"focus:border-input-outlined-outline-active",
|
|
19
|
+
"focus-within:border-input-outlined-outline-active",
|
|
20
20
|
"invalid:border-input-outlined-outline-error",
|
|
21
|
-
"
|
|
21
|
+
"has-invalid:border-input-outlined-outline-error",
|
|
22
|
+
"disabled:hover:border-transparent",
|
|
23
|
+
"has-disabled:hover:border-transparent"
|
|
22
24
|
]
|
|
23
25
|
}
|
|
24
26
|
},
|
|
@@ -31,9 +33,12 @@ const inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
31
33
|
"hover:border-input-outlined-outline-hover hover:border-solid hover:bg-input-outlined-hover hover:text-text-default-1",
|
|
32
34
|
"focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-active focus-within:text-text-default-1",
|
|
33
35
|
"invalid:border-input-outlined-outline-error invalid:border-solid invalid:bg-input-outlined-error invalid:text-text-default-1",
|
|
36
|
+
"has-invalid:border-input-outlined-outline-error has-invalid:border-solid has-invalid:bg-input-outlined-error has-invalid:text-text-default-1",
|
|
34
37
|
"disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-1",
|
|
38
|
+
"has-disabled:border-input-outlined-outline-disabled has-disabled:border-solid has-disabled:bg-input-outlined-disabled has-disabled:text-text-default-1",
|
|
35
39
|
"placeholder:text-text-default-3",
|
|
36
|
-
"focus-visible:outline-interactive-contained-primary-focus"
|
|
40
|
+
"focus-visible:outline-interactive-contained-primary-focus",
|
|
41
|
+
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
37
42
|
]
|
|
38
43
|
},
|
|
39
44
|
{
|
|
@@ -44,9 +49,12 @@ const inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
44
49
|
"hover:border-input-filled-outline-hover hover:border-solid hover:bg-input-filled-hover hover:text-text-default-1",
|
|
45
50
|
"focus-within:border-input-filled-outline-active focus-within:border-solid focus-within:bg-input-filled-active focus-within:text-text-default-1",
|
|
46
51
|
"invalid:border-input-filled-outline-error invalid:border-solid invalid:bg-input-filled-error invalid:text-text-default-1",
|
|
52
|
+
"has-invalid:border-input-filled-outline-error has-invalid:border-solid has-invalid:bg-input-filled-error has-invalid:text-text-default-1",
|
|
47
53
|
"disabled:bg-input-filled-disabled disabled:text-text-default-1",
|
|
54
|
+
"has-disabled:bg-input-filled-disabled has-disabled:text-text-default-1",
|
|
48
55
|
"placeholder:text-text-default-3",
|
|
49
|
-
"focus-visible:outline-interactive-contained-primary-focus"
|
|
56
|
+
"focus-visible:outline-interactive-contained-primary-focus",
|
|
57
|
+
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
50
58
|
]
|
|
51
59
|
},
|
|
52
60
|
{
|
|
@@ -57,9 +65,12 @@ const inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
57
65
|
"hover:border-input-outlined-outline-hover hover:border-solid hover:bg-input-outlined-hover hover:text-text-default-1",
|
|
58
66
|
"focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-active focus-within:text-text-default-1",
|
|
59
67
|
"invalid:border-input-outlined-outline-error invalid:border-solid invalid:bg-input-outlined-error invalid:text-text-default-1",
|
|
68
|
+
"has-invalid:border-input-outlined-outline-error has-invalid:border-solid has-invalid:bg-input-outlined-error has-invalid:text-text-default-1",
|
|
60
69
|
"disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-1",
|
|
70
|
+
"has-disabled:border-input-outlined-outline-disabled has-disabled:border-solid has-disabled:bg-input-outlined-disabled has-disabled:text-text-default-1",
|
|
61
71
|
"placeholder:text-text-default-3",
|
|
62
|
-
"focus-visible:outline-interactive-contained-primary-focus"
|
|
72
|
+
"focus-visible:outline-interactive-contained-primary-focus",
|
|
73
|
+
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
63
74
|
]
|
|
64
75
|
},
|
|
65
76
|
{
|
|
@@ -69,10 +80,13 @@ const inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
69
80
|
"border border-transparent border-solid bg-input-filled-idle text-text-default-1",
|
|
70
81
|
"hover:border-input-filled-outline-hover hover:border-solid hover:bg-input-filled-hover hover:text-text-default-1",
|
|
71
82
|
"focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-idle focus-within:text-text-default-1",
|
|
72
|
-
"invalid:border
|
|
83
|
+
"invalid:border-input-filled-outline-error invalid:border-solid invalid:bg-input-filled-error invalid:text-text-default-1",
|
|
84
|
+
"has-invalid:border-input-filled-outline-error has-invalid:border-solid has-invalid:bg-input-filled-error has-invalid:text-text-default-1",
|
|
73
85
|
"disabled:bg-input-filled-disabled disabled:text-text-default-1",
|
|
86
|
+
"has-disabled:bg-input-filled-disabled has-disabled:text-text-default-1",
|
|
74
87
|
"placeholder:text-text-default-3",
|
|
75
|
-
"focus-visible:outline-interactive-contained-primary-focus"
|
|
88
|
+
"focus-visible:outline-interactive-contained-primary-focus",
|
|
89
|
+
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
76
90
|
]
|
|
77
91
|
},
|
|
78
92
|
{
|
|
@@ -83,9 +97,12 @@ const inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
83
97
|
"hover:border-input-outlined-outline-hover hover:border-solid hover:bg-input-outlined-hover hover:text-text-default-1",
|
|
84
98
|
"focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-active focus-within:text-text-default-1",
|
|
85
99
|
"invalid:border-input-outlined-outline-error invalid:border-solid invalid:bg-input-outlined-error invalid:text-text-default-1",
|
|
100
|
+
"has-invalid:border-input-outlined-outline-error has-invalid:border-solid has-invalid:bg-input-outlined-error has-invalid:text-text-default-1",
|
|
86
101
|
"disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-1",
|
|
102
|
+
"has-disabled:border-input-outlined-outline-disabled has-disabled:border-solid has-disabled:bg-input-outlined-disabled has-disabled:text-text-default-1",
|
|
87
103
|
"placeholder:text-text-default-3",
|
|
88
|
-
"focus-visible:outline-interactive-contained-primary-focus"
|
|
104
|
+
"focus-visible:outline-interactive-contained-primary-focus",
|
|
105
|
+
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
89
106
|
]
|
|
90
107
|
},
|
|
91
108
|
{
|
|
@@ -95,10 +112,13 @@ const inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
95
112
|
"border border-transparent border-solid bg-input-filled-idle text-text-default-1",
|
|
96
113
|
"hover:border-input-filled-outline-hover hover:border-solid hover:bg-input-filled-hover hover:text-text-default-1",
|
|
97
114
|
"focus-within:border-input-filled-outline-active focus-within:border-solid focus-within:bg-input-filled-active focus-within:text-text-default-1",
|
|
115
|
+
"has-invalid:border-input-filled-outline-error has-invalid:border-solid has-invalid:bg-input-filled-error has-invalid:text-text-default-1",
|
|
98
116
|
"invalid:border-input-filled-outline-error invalid:border-solid invalid:bg-input-filled-error invalid:text-text-default-1",
|
|
99
117
|
"disabled:bg-input-filled-disabled disabled:text-text-default-1",
|
|
118
|
+
"has-disabled:bg-input-filled-disabled has-disabled:text-text-default-1",
|
|
100
119
|
"placeholder:text-text-default-3",
|
|
101
|
-
"focus-visible:outline-interactive-contained-primary-focus"
|
|
120
|
+
"focus-visible:outline-interactive-contained-primary-focus",
|
|
121
|
+
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
102
122
|
]
|
|
103
123
|
}
|
|
104
124
|
],
|
|
@@ -119,19 +139,9 @@ const inputSize = cva("", {
|
|
|
119
139
|
default: "",
|
|
120
140
|
floating: [
|
|
121
141
|
"px-input-side-m",
|
|
122
|
-
"py-floating-label-input-height-empty
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"group-has-[input:not(:placeholder-shown)]/select-content:pb-[calc(var(--spacing-floating-label-input-height-filled)+var(--spacing-floating-label-input-offset-bottom))]!",
|
|
126
|
-
"group-has-[input:not(:placeholder-shown)]/select-content:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--spacing-floating-label-input-offset-top)+var(--text-label-3--line-height)*var(--text-label-3))]!",
|
|
127
|
-
"group-data-[has-selection]/select-content:pb-[calc(var(--spacing-floating-label-input-height-filled)+var(--spacing-floating-label-input-offset-bottom))]!",
|
|
128
|
-
"group-data-[has-selection]/select-content:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--spacing-floating-label-input-offset-top)+var(--text-label-3--line-height)*var(--text-label-3))]!",
|
|
129
|
-
"group-data-[has-search]/select-content:pb-[calc(var(--spacing-floating-label-input-height-filled)+var(--spacing-floating-label-input-offset-bottom))]!",
|
|
130
|
-
"group-data-[has-search]/select-content:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--spacing-floating-label-input-offset-top)+var(--text-label-3--line-height)*var(--text-label-3))]!",
|
|
131
|
-
"data-[datetime-input]:data-[has-selection]:pb-[calc(var(--spacing-floating-label-input-height-filled)+var(--spacing-floating-label-input-offset-bottom))]!",
|
|
132
|
-
"data-[datetime-input]:data-[has-selection]:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--spacing-floating-label-input-offset-top)+var(--text-label-3--line-height)*var(--text-label-3))]!",
|
|
133
|
-
"data-[datetime-input]:data-[focus-within]:pb-[calc(var(--spacing-floating-label-input-height-filled)+var(--spacing-floating-label-input-offset-bottom))]!",
|
|
134
|
-
"data-[datetime-input]:data-[focus-within]:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--spacing-floating-label-input-offset-top)+var(--text-label-3--line-height)*var(--text-label-3))]!"
|
|
142
|
+
"py-floating-label-input-height-empty",
|
|
143
|
+
"input-filled:pb-[calc(var(--spacing-floating-label-input-height-filled)+var(--spacing-floating-label-input-offset-bottom))]",
|
|
144
|
+
"input-filled:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--spacing-floating-label-input-offset-top)+var(--text-label-3--line-height)*var(--text-label-3))]"
|
|
135
145
|
],
|
|
136
146
|
filter: "",
|
|
137
147
|
inline: ""
|
|
@@ -259,9 +269,8 @@ const inputSide = cva("", {
|
|
|
259
269
|
defaultVariants: { size: "default" }
|
|
260
270
|
});
|
|
261
271
|
const useInputCva = () => {
|
|
262
|
-
const
|
|
263
|
-
const
|
|
264
|
-
const inputSizeCva = uiStyle?.input?.sizeCva ?? inputSize;
|
|
272
|
+
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
273
|
+
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
265
274
|
return ({ className, ...rest }) => {
|
|
266
275
|
return clsx(inputBaseCva(rest), inputSizeCva(rest), className);
|
|
267
276
|
};
|
|
@@ -3,51 +3,23 @@ import { cva } from "class-variance-authority";
|
|
|
3
3
|
const labelBase = cva("", {
|
|
4
4
|
variants: { as: {
|
|
5
5
|
default: ["flex items-start gap-1 text-text-default-1"],
|
|
6
|
-
filter: ["
|
|
6
|
+
filter: ["text-text-default-1"],
|
|
7
7
|
inline: ["flex items-start gap-1 text-text-default-1"],
|
|
8
8
|
floating: [
|
|
9
9
|
"pointer-events-none",
|
|
10
10
|
"absolute transition-all duration-75",
|
|
11
11
|
"top-1/2 -translate-y-1/2",
|
|
12
|
-
"text-text-default-3
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
12
|
+
"text-text-default-3",
|
|
13
|
+
"input-disabled:text-interactive-text-secondary-disabled!",
|
|
14
|
+
"input-filled:top-[calc(var(--spacing-floating-label-input-height-filled)+var(--spacing-floating-label-input-offset-top))]",
|
|
15
|
+
"input-filled:translate-y-0",
|
|
16
|
+
"input-filled:text-text-default-1",
|
|
17
|
+
"input-filled:font-semibold!",
|
|
18
|
+
"input-filled:text-label-3!",
|
|
17
19
|
"group-data-[text-area]/text-area:top-floating-label-input-height-empty group-data-[text-area]/text-area:translate-y-0",
|
|
18
|
-
"group-data-[text-editor]/text-editor:top-floating-label-input-height-empty group-data-[text-editor]/text-editor:left-input-side-default group-data-[text-editor]/text-editor:translate-y-0",
|
|
19
|
-
"group-has-[input:not(:placeholder-shown)]/input-content:top-[calc(var(--spacing-floating-label-input-height-filled)+var(--spacing-floating-label-input-offset-top))] group-has-[input:not(:placeholder-shown)]/input-content:translate-y-0",
|
|
20
20
|
"group-has-[textarea:not(:placeholder-shown)]/text-area:hidden",
|
|
21
|
-
"group-
|
|
22
|
-
"group-
|
|
23
|
-
"group-data-[is-filled=true]/text-editor:hidden",
|
|
24
|
-
"group-has-[data-text-editor:placeholder-shown]/text-editor:text-text-default-3",
|
|
25
|
-
"group-has-[data-text-editor:placeholder-shown]/text-editor:font-medium!",
|
|
26
|
-
"group-data-[has-selection]/date-picker-content:top-1 group-data-[has-selection]/date-picker-content:translate-y-0",
|
|
27
|
-
"group-focus-within/date-picker-content:top-1 group-focus-within/date-picker-content:translate-y-0",
|
|
28
|
-
"group-data-[has-selection]/select-content:top-1 group-data-[has-selection]/select-content:translate-y-0",
|
|
29
|
-
"group-data-[searchable-focus-within]/select-content:top-1 group-data-[searchable-focus-within]/select-content:translate-y-0",
|
|
30
|
-
"group-data-[has-search]/select-content:top-1 group-data-[has-search]/select-content:translate-y-0",
|
|
31
|
-
"group-has-[input:placeholder-shown]/input-content:text-text-default-3",
|
|
32
|
-
"group-has-[input:placeholder-shown]/input-content:font-medium!",
|
|
33
|
-
"group-has-[input:not(:placeholder-shown)]/input-content:font-semibold!",
|
|
34
|
-
"group-has-[input:not(:placeholder-shown)]/input-content:text-label-3!",
|
|
35
|
-
"group-has-[input:not(:placeholder-shown)]/input-content:text-text-default-1",
|
|
36
|
-
"group-data-[has-selection]/date-picker-content:font-semibold!",
|
|
37
|
-
"group-data-[has-selection]/date-picker-content:text-label-3!",
|
|
38
|
-
"group-data-[has-selection]/date-picker-content:text-text-default-1",
|
|
39
|
-
"group-focus-within/date-picker-content:font-semibold!",
|
|
40
|
-
"group-focus-within/date-picker-content:text-label-3!",
|
|
41
|
-
"group-focus-within/date-picker-content:text-text-default-1",
|
|
42
|
-
"group-data-[has-selection]/select-content:font-semibold!",
|
|
43
|
-
"group-data-[has-selection]/select-content:text-label-3!",
|
|
44
|
-
"group-data-[has-selection]/select-content:text-text-default-1",
|
|
45
|
-
"group-data-[searchable-focus-within]/select-content:font-semibold!",
|
|
46
|
-
"group-data-[searchable-focus-within]/select-content:text-label-3!",
|
|
47
|
-
"group-data-[searchable-focus-within]/select-content:text-text-default-1",
|
|
48
|
-
"group-data-[has-search]/select-content:font-semibold!",
|
|
49
|
-
"group-data-[has-search]/select-content:text-label-3!",
|
|
50
|
-
"group-data-[has-search]/select-content:text-text-default-1"
|
|
21
|
+
"group-data-[text-editor]/text-editor:top-floating-label-input-height-empty group-data-[text-editor]/text-editor:left-input-side-default group-data-[text-editor]/text-editor:translate-y-0",
|
|
22
|
+
"group-data-[is-filled=true]/text-editor:hidden"
|
|
51
23
|
]
|
|
52
24
|
} },
|
|
53
25
|
defaultVariants: { as: "default" }
|
|
@@ -10,7 +10,7 @@ const Accordion = ({ items, variant = "filled", actionPosition = "right", allows
|
|
|
10
10
|
expandedKeys,
|
|
11
11
|
defaultExpandedKeys,
|
|
12
12
|
onExpandedChange,
|
|
13
|
-
className: clsx(
|
|
13
|
+
className: clsx(UIStyle.useCva("accordion.cva", accordionCva)({
|
|
14
14
|
className,
|
|
15
15
|
variant,
|
|
16
16
|
singleItem: items.length === 1
|
|
@@ -5,16 +5,15 @@ import { accordionChevronCva, accordionHeadingCva, accordionHeadingSubtitleCva,
|
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Button, Disclosure, DisclosurePanel, Heading } from "react-aria-components";
|
|
7
7
|
const AccordionItem = ({ id, disabled, heading, subheading, children, icon: Icon, variant = "filled", actionPosition = "right", isSingle }) => {
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const panelContentCva = uiStyle?.accordion?.panelContentCva ?? accordionPanelContentCva;
|
|
8
|
+
const itemCva = UIStyle.useCva("accordion.itemCva", accordionItemCva);
|
|
9
|
+
const triggerCva = UIStyle.useCva("accordion.triggerCva", accordionTriggerCva);
|
|
10
|
+
const headingCva = UIStyle.useCva("accordion.headingCva", accordionHeadingCva);
|
|
11
|
+
const headingTitleCva = UIStyle.useCva("accordion.headingTitleCva", accordionHeadingTitleCva);
|
|
12
|
+
const headingSubtitleCva = UIStyle.useCva("accordion.headingSubtitleCva", accordionHeadingSubtitleCva);
|
|
13
|
+
const chevronCva = UIStyle.useCva("accordion.chevronCva", accordionChevronCva);
|
|
14
|
+
const iconCva = UIStyle.useCva("accordion.iconCva", accordionIconCva);
|
|
15
|
+
const panelCva = UIStyle.useCva("accordion.panelCva", accordionPanelCva);
|
|
16
|
+
const panelContentCva = UIStyle.useCva("accordion.panelContentCva", accordionPanelContentCva);
|
|
18
17
|
return /* @__PURE__ */ jsx(Disclosure, {
|
|
19
18
|
id,
|
|
20
19
|
className: itemCva({
|
|
@@ -6,7 +6,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
import { Fragment as Fragment$1 } from "react";
|
|
7
7
|
const Stepper = ({ steps, currentStep, orientation = "horizontal", contentOrientation = "horizontal", iconsOnly, titlesOnly, onStepClick, className }) => {
|
|
8
8
|
return /* @__PURE__ */ jsx("div", {
|
|
9
|
-
className:
|
|
9
|
+
className: UIStyle.useCva("stepper.cva", stepperCva)({
|
|
10
10
|
orientation,
|
|
11
11
|
className
|
|
12
12
|
}),
|
|
@@ -6,12 +6,11 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
import { clsx } from "clsx";
|
|
7
7
|
import { Button } from "react-aria-components";
|
|
8
8
|
const StepperItem = ({ step, stepNumber, status, contentOrientation, iconsOnly, titlesOnly, onPress }) => {
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const stepperSubtextCva$1 = uiStyle?.stepper?.subtextCva ?? stepperSubtextCva;
|
|
9
|
+
const stepperItemCva$1 = UIStyle.useCva("stepper.itemCva", stepperItemCva);
|
|
10
|
+
const stepperIconCva$1 = UIStyle.useCva("stepper.iconCva", stepperIconCva);
|
|
11
|
+
const stepperNumberCva$1 = UIStyle.useCva("stepper.numberCva", stepperNumberCva);
|
|
12
|
+
const stepperTitleCva$1 = UIStyle.useCva("stepper.titleCva", stepperTitleCva);
|
|
13
|
+
const stepperSubtextCva$1 = UIStyle.useCva("stepper.subtextCva", stepperSubtextCva);
|
|
15
14
|
const showTitle = !iconsOnly;
|
|
16
15
|
const showSubtext = !iconsOnly && !titlesOnly && !!step.subtext;
|
|
17
16
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -2,7 +2,7 @@ import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
|
2
2
|
import { stepperSeparatorCva } from "./stepper.cva.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
const StepperSeparator = ({ orientation, contentOrientation }) => {
|
|
5
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
5
|
+
return /* @__PURE__ */ jsx("div", { className: UIStyle.useCva("stepper.separatorCva", stepperSeparatorCva)({
|
|
6
6
|
orientation,
|
|
7
7
|
contentOrientation
|
|
8
8
|
}) });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { clsx } from "clsx";
|
|
2
|
-
const uiOutlineClass = clsx("focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2");
|
|
2
|
+
const uiOutlineClass = clsx("focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2", "has-focus-visible:outline has-focus-visible:outline-2 has-focus-visible:outline-solid has-focus-visible:outline-offset-2");
|
|
3
3
|
const uiGroupOutlineClass = clsx("group-focus:outline-none group-focus-visible:outline group-focus-visible:outline-2 group-focus-visible:outline-solid group-focus-visible:outline-offset-2");
|
|
4
4
|
export { uiGroupOutlineClass, uiOutlineClass };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ButtonVariantProps } from '../../buttons/Button/button.cva';
|
|
2
2
|
import { ModalProps } from '../Modal/Modal';
|
|
3
|
+
import { TypographyPropsCva } from '../../text/Typography/Typography';
|
|
3
4
|
interface ActionModalAction {
|
|
4
5
|
label: string;
|
|
5
6
|
onPress: () => void;
|
|
@@ -14,6 +15,10 @@ export interface ActionModalProps extends ModalProps {
|
|
|
14
15
|
secondaryAction?: ActionModalAction;
|
|
15
16
|
buttonSize?: ButtonVariantProps["size"];
|
|
16
17
|
textAlign?: "left" | "center" | "right";
|
|
18
|
+
titleTypography?: TypographyPropsCva;
|
|
19
|
+
titleClassName?: string;
|
|
20
|
+
descriptionTypography?: TypographyPropsCva;
|
|
21
|
+
descriptionClassName?: string;
|
|
17
22
|
}
|
|
18
|
-
export declare const ActionModal: ({ heading, description, primaryAction, secondaryAction, buttonSize, textAlign, modalClassName, ...modalProps }: ActionModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const ActionModal: ({ heading, description, primaryAction, secondaryAction, buttonSize, textAlign, modalClassName, titleTypography, titleClassName, descriptionTypography, descriptionClassName, ...modalProps }: ActionModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
24
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Typography } from "../../text/Typography/Typography.js";
|
|
2
|
+
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
2
3
|
import { Button } from "../../buttons/Button/Button.js";
|
|
3
4
|
import { Modal } from "../Modal/Modal.js";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -8,7 +9,8 @@ var textAlignClassMap = {
|
|
|
8
9
|
center: "text-center",
|
|
9
10
|
right: "text-right"
|
|
10
11
|
};
|
|
11
|
-
const ActionModal = ({ heading, description, primaryAction, secondaryAction, buttonSize = "m", textAlign = "left", modalClassName, ...modalProps }) => {
|
|
12
|
+
const ActionModal = ({ heading, description, primaryAction, secondaryAction, buttonSize = "m", textAlign = "left", modalClassName, titleTypography, titleClassName, descriptionTypography, descriptionClassName, ...modalProps }) => {
|
|
13
|
+
const ui = UIConfig.useConfig();
|
|
12
14
|
const textAlignClass = textAlignClassMap[textAlign];
|
|
13
15
|
return /* @__PURE__ */ jsxs(Modal, {
|
|
14
16
|
modalClassName: clsx("w-modal", modalClassName),
|
|
@@ -16,14 +18,13 @@ const ActionModal = ({ heading, description, primaryAction, secondaryAction, but
|
|
|
16
18
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
17
19
|
className: "flex flex-col gap-modal-gap-text",
|
|
18
20
|
children: [/* @__PURE__ */ jsx(Typography, {
|
|
19
|
-
|
|
20
|
-
variant: "prominent-1",
|
|
21
|
+
...titleTypography ?? ui.actionModal.titleTypography,
|
|
21
22
|
as: "h2",
|
|
22
|
-
className: clsx("text-text-default-1", textAlignClass),
|
|
23
|
+
className: clsx("text-text-default-1", textAlignClass, titleClassName),
|
|
23
24
|
children: heading
|
|
24
25
|
}), /* @__PURE__ */ jsx(Typography, {
|
|
25
|
-
|
|
26
|
-
className: clsx("text-text-default-1", textAlignClass),
|
|
26
|
+
...descriptionTypography ?? ui.actionModal.descriptionTypography,
|
|
27
|
+
className: clsx("text-text-default-1", textAlignClass, descriptionClassName),
|
|
27
28
|
children: description
|
|
28
29
|
})]
|
|
29
30
|
}), /* @__PURE__ */ jsxs("div", {
|
|
@@ -9,6 +9,7 @@ export interface ModalProps extends ModalVariantProps {
|
|
|
9
9
|
overlayClassName?: string;
|
|
10
10
|
showCloseIcon?: boolean;
|
|
11
11
|
isDismissable?: boolean;
|
|
12
|
+
isKeyboardDismissable?: boolean;
|
|
12
13
|
shouldCloseOnInteractOutside?: () => boolean;
|
|
13
14
|
}
|
|
14
|
-
export declare const Modal: ({ isOpen, portalContainerRef, onClose, aside, children, modalClassName, closeIconClassName, overlayClassName, showCloseIcon, isDismissable, shouldCloseOnInteractOutside, }: PropsWithChildren<ModalProps>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const Modal: ({ isOpen, portalContainerRef, onClose, aside, children, modalClassName, closeIconClassName, overlayClassName, showCloseIcon, isDismissable, isKeyboardDismissable, shouldCloseOnInteractOutside, }: PropsWithChildren<ModalProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,12 +7,11 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
import { clsx } from "clsx";
|
|
8
8
|
import { Dialog, Modal, ModalOverlay } from "react-aria-components";
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
|
-
const Modal$1 = ({ isOpen, portalContainerRef, onClose, aside, children, modalClassName, closeIconClassName, overlayClassName, showCloseIcon, isDismissable = true, shouldCloseOnInteractOutside }) => {
|
|
10
|
+
const Modal$1 = ({ isOpen, portalContainerRef, onClose, aside, children, modalClassName, closeIconClassName, overlayClassName, showCloseIcon, isDismissable = true, isKeyboardDismissable, shouldCloseOnInteractOutside }) => {
|
|
11
11
|
const { t } = useTranslation("ui");
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const modalOverlayCva = uiStyle?.modal?.overlayCva ?? modalOverlay;
|
|
12
|
+
const modalMainCva = UIStyle.useCva("modal.mainCva", modalMain);
|
|
13
|
+
const modalContentCva = UIStyle.useCva("modal.contentCva", modalContent);
|
|
14
|
+
const modalOverlayCva = UIStyle.useCva("modal.overlayCva", modalOverlay);
|
|
16
15
|
return /* @__PURE__ */ jsx(ModalOverlay, {
|
|
17
16
|
UNSTABLE_portalContainer: portalContainerRef?.current,
|
|
18
17
|
className: modalOverlayCva({
|
|
@@ -20,6 +19,7 @@ const Modal$1 = ({ isOpen, portalContainerRef, onClose, aside, children, modalCl
|
|
|
20
19
|
className: overlayClassName
|
|
21
20
|
}),
|
|
22
21
|
isDismissable,
|
|
22
|
+
isKeyboardDismissDisabled: !(isKeyboardDismissable ?? isDismissable),
|
|
23
23
|
isOpen,
|
|
24
24
|
shouldCloseOnInteractOutside: () => {
|
|
25
25
|
if (shouldCloseOnInteractOutside) {
|