@povio/ui 3.3.0 → 3.3.1
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 +1 -1
- package/dist/browser-tests/checkbox/CheckboxGroupHarness.d.ts +10 -0
- package/dist/browser-tests/checkbox/CheckboxHarness.d.ts +10 -0
- package/dist/browser-tests/checkbox/checkbox-group.spec.d.ts +1 -0
- package/dist/browser-tests/checkbox/checkbox.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/DateTimeHarnesses.d.ts +43 -0
- package/dist/browser-tests/datetime-picker/assertions.d.ts +9 -0
- package/dist/browser-tests/datetime-picker/date-input-focus.firefox.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/date-picker.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/date-range-picker.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/date-time-picker.spec.d.ts +1 -0
- package/dist/browser-tests/datetime-picker/time-picker.spec.d.ts +1 -0
- package/dist/browser-tests/file-upload/FileUploadHarness.d.ts +4 -0
- package/dist/browser-tests/file-upload/file-upload.spec.d.ts +1 -0
- package/dist/browser-tests/file-upload-container/FileUploadContainerHarness.d.ts +4 -0
- package/dist/browser-tests/file-upload-container/file-upload-container.spec.d.ts +1 -0
- package/dist/browser-tests/input-upload/InputUploadHarness.d.ts +9 -0
- package/dist/browser-tests/input-upload/input-upload.spec.d.ts +1 -0
- package/dist/browser-tests/modal/ModalHarness.d.ts +5 -0
- package/dist/browser-tests/modal/modal.spec.d.ts +1 -0
- package/dist/browser-tests/number-input/NumberInputHarness.d.ts +10 -0
- package/dist/browser-tests/number-input/number-input.spec.d.ts +1 -0
- package/dist/browser-tests/number-range-input/NumberRangeInputHarness.d.ts +10 -0
- package/dist/browser-tests/number-range-input/number-range-input.spec.d.ts +1 -0
- package/dist/browser-tests/password-input/PasswordInputHarness.d.ts +6 -0
- package/dist/browser-tests/password-input/password-input.spec.d.ts +1 -0
- package/dist/browser-tests/radio-group/RadioGroupHarness.d.ts +15 -0
- package/dist/browser-tests/radio-group/radio-group.spec.d.ts +1 -0
- package/dist/browser-tests/selection/SelectionHarnesses.d.ts +61 -0
- package/dist/browser-tests/selection/autocomplete.spec.d.ts +1 -0
- package/dist/browser-tests/selection/interactions.d.ts +2 -0
- package/dist/browser-tests/selection/query-autocomplete.spec.d.ts +1 -0
- package/dist/browser-tests/selection/query-select.spec.d.ts +1 -0
- package/dist/browser-tests/selection/select.spec.d.ts +1 -0
- package/dist/browser-tests/slider/SliderHarness.d.ts +11 -0
- package/dist/browser-tests/slider/slider.spec.d.ts +1 -0
- package/dist/browser-tests/text-area/TextAreaHarness.d.ts +10 -0
- package/dist/browser-tests/text-area/text-area.spec.d.ts +1 -0
- package/dist/browser-tests/text-input/TextInputHarness.d.ts +10 -0
- package/dist/browser-tests/text-input/text-input.spec.d.ts +1 -0
- package/dist/browser-tests/toggle/ToggleHarness.d.ts +10 -0
- package/dist/browser-tests/toggle/toggle.spec.d.ts +1 -0
- package/dist/browser-tests/utils/blur.d.ts +22 -0
- package/dist/browser-tests/utils/events.d.ts +4 -0
- package/dist/browser-tests/utils/input.d.ts +10 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +206 -55
- package/dist/components/buttons/Button/button.cva.d.ts +1 -1
- package/dist/components/buttons/Button/button.cva.js +4 -4
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/pillButton.cva.js +4 -4
- package/dist/components/buttons/shared/ButtonContent.js +80 -22
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +222 -74
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +182 -56
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +128 -41
- package/dist/components/inputs/DateTime/shared/Calendar.js +339 -139
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +308 -114
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +150 -35
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +229 -95
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +296 -115
- package/dist/components/inputs/DateTime/shared/DateField.js +306 -135
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +338 -140
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
- package/dist/components/inputs/File/FileUpload.js +1 -1
- package/dist/components/inputs/File/InputUpload.js +261 -65
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +180 -48
- package/dist/components/inputs/File/shared/FileUploadContentError.js +265 -95
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +261 -99
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +234 -56
- package/dist/components/inputs/File/shared/ProgressBar.js +102 -15
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +313 -75
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +83 -23
- package/dist/components/inputs/Selection/Select/QuerySelect.js +96 -30
- package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
- package/dist/components/inputs/Selection/shared/useSelectItems.js +108 -48
- package/dist/components/inputs/Skeleton/InputFrame.js +550 -177
- package/dist/components/inputs/TextEditor/TextEditor.js +389 -87
- package/dist/components/navigation/Accordion/Accordion.js +69 -22
- package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
- package/dist/components/navigation/Stepper/Stepper.js +67 -22
- package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
- package/dist/components/overlays/BottomSheet/BottomSheet.js +1 -1
- package/dist/components/overlays/Modal/Modal.d.ts +3 -2
- package/dist/components/overlays/Modal/Modal.js +3 -1
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +110 -29
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
- package/dist/components/status/Alert/Alert.js +97 -30
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/text/Typography/Typography.js +23 -8
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/theme.context.js +98 -45
- package/dist/config/uiConfig.context.js +39 -8
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useFormAutosave.js +120 -33
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/vitest.setup.browser.d.ts +6 -0
- package/package.json +1 -1
|
@@ -2,10 +2,15 @@ import { ChevronDownIcon } from "../../../assets/icons/ChevronDown.js";
|
|
|
2
2
|
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
3
3
|
import { Typography } from "../../text/Typography/Typography.js";
|
|
4
4
|
import { accordionChevronDefinition, accordionHeadingDefinition, accordionHeadingSubtitleDefinition, accordionHeadingTitleDefinition, accordionIconDefinition, accordionItemDefinition, accordionPanelContentDefinition, accordionPanelDefinition, accordionTriggerDefinition } from "./accordion.cva.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
5
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { Button, Disclosure, DisclosurePanel, Heading } from "react-aria-components";
|
|
7
8
|
//#region src/components/navigation/Accordion/AccordionItem.tsx
|
|
8
|
-
var AccordionItem = (
|
|
9
|
+
var AccordionItem = (t0) => {
|
|
10
|
+
const $ = c(25);
|
|
11
|
+
const { id, disabled, heading, subheading, children, icon: Icon, variant: t1, actionPosition: t2, isSingle } = t0;
|
|
12
|
+
const variant = t1 === void 0 ? "filled" : t1;
|
|
13
|
+
const actionPosition = t2 === void 0 ? "right" : t2;
|
|
9
14
|
const itemCva = UIOverrides.useCva("accordion.itemCva", accordionItemDefinition);
|
|
10
15
|
const triggerCva = UIOverrides.useCva("accordion.triggerCva", accordionTriggerDefinition);
|
|
11
16
|
const headingCva = UIOverrides.useCva("accordion.headingCva", accordionHeadingDefinition);
|
|
@@ -15,49 +20,89 @@ var AccordionItem = ({ id, disabled, heading, subheading, children, icon: Icon,
|
|
|
15
20
|
const iconCva = UIOverrides.useCva("accordion.iconCva", accordionIconDefinition);
|
|
16
21
|
const panelCva = UIOverrides.useCva("accordion.panelCva", accordionPanelDefinition);
|
|
17
22
|
const panelContentCva = UIOverrides.useCva("accordion.panelContentCva", accordionPanelContentDefinition);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
let t3;
|
|
24
|
+
if ($[0] !== isSingle || $[1] !== itemCva || $[2] !== variant) {
|
|
25
|
+
t3 = itemCva({
|
|
21
26
|
variant,
|
|
22
27
|
singleItem: isSingle
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
28
|
+
});
|
|
29
|
+
$[0] = isSingle;
|
|
30
|
+
$[1] = itemCva;
|
|
31
|
+
$[2] = variant;
|
|
32
|
+
$[3] = t3;
|
|
33
|
+
} else t3 = $[3];
|
|
34
|
+
let t4;
|
|
35
|
+
if ($[4] !== Icon || $[5] !== actionPosition || $[6] !== chevronCva || $[7] !== children || $[8] !== disabled || $[9] !== heading || $[10] !== headingCva || $[11] !== headingSubtitleCva || $[12] !== headingTitleCva || $[13] !== iconCva || $[14] !== panelContentCva || $[15] !== panelCva || $[16] !== subheading || $[17] !== triggerCva || $[18] !== variant) {
|
|
36
|
+
t4 = (t5) => {
|
|
37
|
+
const { isExpanded } = t5;
|
|
38
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Heading, { children: /* @__PURE__ */ jsxs(Button, {
|
|
39
|
+
slot: "trigger",
|
|
40
|
+
className: triggerCva({
|
|
41
|
+
variant,
|
|
42
|
+
actionPosition,
|
|
43
|
+
disabled
|
|
44
|
+
}),
|
|
45
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
46
|
+
className: headingCva({}),
|
|
47
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
48
|
+
className: "flex flex-1 items-center gap-accordion-gap-icon-to-text",
|
|
49
|
+
children: [
|
|
50
|
+
Icon && /* @__PURE__ */ jsx(Icon, { className: iconCva({}) }),
|
|
51
|
+
/* @__PURE__ */ jsx(Typography, {
|
|
52
|
+
size: "label-2",
|
|
53
|
+
variant: "default",
|
|
54
|
+
className: headingTitleCva({}),
|
|
55
|
+
children: heading
|
|
56
|
+
}),
|
|
57
|
+
subheading && /* @__PURE__ */ jsx(Typography, {
|
|
58
|
+
size: "label-3",
|
|
59
|
+
variant: "default",
|
|
60
|
+
className: headingSubtitleCva({}),
|
|
61
|
+
children: subheading
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
})
|
|
65
|
+
}), /* @__PURE__ */ jsx(ChevronDownIcon, { className: chevronCva({ isExpanded }) })]
|
|
66
|
+
}) }), /* @__PURE__ */ jsx(DisclosurePanel, {
|
|
67
|
+
className: panelCva({ isExpanded }),
|
|
68
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
69
|
+
className: panelContentCva({}),
|
|
70
|
+
children
|
|
51
71
|
})
|
|
52
|
-
})
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
72
|
+
})] });
|
|
73
|
+
};
|
|
74
|
+
$[4] = Icon;
|
|
75
|
+
$[5] = actionPosition;
|
|
76
|
+
$[6] = chevronCva;
|
|
77
|
+
$[7] = children;
|
|
78
|
+
$[8] = disabled;
|
|
79
|
+
$[9] = heading;
|
|
80
|
+
$[10] = headingCva;
|
|
81
|
+
$[11] = headingSubtitleCva;
|
|
82
|
+
$[12] = headingTitleCva;
|
|
83
|
+
$[13] = iconCva;
|
|
84
|
+
$[14] = panelContentCva;
|
|
85
|
+
$[15] = panelCva;
|
|
86
|
+
$[16] = subheading;
|
|
87
|
+
$[17] = triggerCva;
|
|
88
|
+
$[18] = variant;
|
|
89
|
+
$[19] = t4;
|
|
90
|
+
} else t4 = $[19];
|
|
91
|
+
let t5;
|
|
92
|
+
if ($[20] !== disabled || $[21] !== id || $[22] !== t3 || $[23] !== t4) {
|
|
93
|
+
t5 = /* @__PURE__ */ jsx(Disclosure, {
|
|
94
|
+
id,
|
|
95
|
+
className: t3,
|
|
96
|
+
isDisabled: disabled,
|
|
97
|
+
children: t4
|
|
98
|
+
});
|
|
99
|
+
$[20] = disabled;
|
|
100
|
+
$[21] = id;
|
|
101
|
+
$[22] = t3;
|
|
102
|
+
$[23] = t4;
|
|
103
|
+
$[24] = t5;
|
|
104
|
+
} else t5 = $[24];
|
|
105
|
+
return t5;
|
|
61
106
|
};
|
|
62
107
|
//#endregion
|
|
63
108
|
export { AccordionItem };
|
|
@@ -2,33 +2,78 @@ import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
|
2
2
|
import { stepperDefinition } from "./stepper.cva.js";
|
|
3
3
|
import { StepperItem } from "./StepperItem.js";
|
|
4
4
|
import { StepperSeparator } from "./StepperSeparator.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { Fragment as Fragment$1 } from "react";
|
|
7
8
|
//#region src/components/navigation/Stepper/Stepper.tsx
|
|
8
|
-
var Stepper = (
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
var Stepper = (t0) => {
|
|
10
|
+
const $ = c(23);
|
|
11
|
+
const { steps, currentStep, orientation: t1, contentOrientation: t2, iconsOnly, titlesOnly, onStepClick, className } = t0;
|
|
12
|
+
const orientation = t1 === void 0 ? "horizontal" : t1;
|
|
13
|
+
const contentOrientation = t2 === void 0 ? "horizontal" : t2;
|
|
14
|
+
const stepperCva = UIOverrides.useCva("stepper.cva", stepperDefinition);
|
|
15
|
+
let t3;
|
|
16
|
+
if ($[0] !== className || $[1] !== orientation || $[2] !== stepperCva) {
|
|
17
|
+
t3 = stepperCva({
|
|
11
18
|
orientation,
|
|
12
19
|
className
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
});
|
|
21
|
+
$[0] = className;
|
|
22
|
+
$[1] = orientation;
|
|
23
|
+
$[2] = stepperCva;
|
|
24
|
+
$[3] = t3;
|
|
25
|
+
} else t3 = $[3];
|
|
26
|
+
let t4;
|
|
27
|
+
if ($[4] !== contentOrientation || $[5] !== currentStep || $[6] !== iconsOnly || $[7] !== onStepClick || $[8] !== orientation || $[9] !== steps || $[10] !== titlesOnly) {
|
|
28
|
+
let t5;
|
|
29
|
+
if ($[12] !== contentOrientation || $[13] !== currentStep || $[14] !== iconsOnly || $[15] !== onStepClick || $[16] !== orientation || $[17] !== steps.length || $[18] !== titlesOnly) {
|
|
30
|
+
t5 = (step, index) => {
|
|
31
|
+
const status = index < currentStep ? "completed" : index === currentStep ? "active" : "todo";
|
|
32
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(StepperItem, {
|
|
33
|
+
step,
|
|
34
|
+
stepNumber: index + 1,
|
|
35
|
+
status,
|
|
36
|
+
contentOrientation,
|
|
37
|
+
iconsOnly,
|
|
38
|
+
titlesOnly,
|
|
39
|
+
onPress: onStepClick && status === "completed" ? () => onStepClick(index) : void 0
|
|
40
|
+
}), index < steps.length - 1 && /* @__PURE__ */ jsx(StepperSeparator, {
|
|
41
|
+
orientation,
|
|
42
|
+
contentOrientation
|
|
43
|
+
})] }, step.id);
|
|
44
|
+
};
|
|
45
|
+
$[12] = contentOrientation;
|
|
46
|
+
$[13] = currentStep;
|
|
47
|
+
$[14] = iconsOnly;
|
|
48
|
+
$[15] = onStepClick;
|
|
49
|
+
$[16] = orientation;
|
|
50
|
+
$[17] = steps.length;
|
|
51
|
+
$[18] = titlesOnly;
|
|
52
|
+
$[19] = t5;
|
|
53
|
+
} else t5 = $[19];
|
|
54
|
+
t4 = steps.map(t5);
|
|
55
|
+
$[4] = contentOrientation;
|
|
56
|
+
$[5] = currentStep;
|
|
57
|
+
$[6] = iconsOnly;
|
|
58
|
+
$[7] = onStepClick;
|
|
59
|
+
$[8] = orientation;
|
|
60
|
+
$[9] = steps;
|
|
61
|
+
$[10] = titlesOnly;
|
|
62
|
+
$[11] = t4;
|
|
63
|
+
} else t4 = $[11];
|
|
64
|
+
let t5;
|
|
65
|
+
if ($[20] !== t3 || $[21] !== t4) {
|
|
66
|
+
t5 = /* @__PURE__ */ jsx("div", {
|
|
67
|
+
className: t3,
|
|
68
|
+
role: "group",
|
|
69
|
+
"aria-label": "Progress",
|
|
70
|
+
children: t4
|
|
71
|
+
});
|
|
72
|
+
$[20] = t3;
|
|
73
|
+
$[21] = t4;
|
|
74
|
+
$[22] = t5;
|
|
75
|
+
} else t5 = $[22];
|
|
76
|
+
return t5;
|
|
32
77
|
};
|
|
33
78
|
//#endregion
|
|
34
79
|
export { Stepper };
|
|
@@ -2,6 +2,7 @@ import { Typography } from "../../text/Typography/Typography.js";
|
|
|
2
2
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
3
3
|
import { Button } from "../../buttons/Button/Button.js";
|
|
4
4
|
import { Modal } from "../Modal/Modal.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { clsx } from "clsx";
|
|
7
8
|
//#region src/components/overlays/ActionModal/ActionModal.tsx
|
|
@@ -10,45 +11,178 @@ var textAlignClassMap = {
|
|
|
10
11
|
center: "text-center",
|
|
11
12
|
right: "text-right"
|
|
12
13
|
};
|
|
13
|
-
var ActionModal = (
|
|
14
|
+
var ActionModal = (t0) => {
|
|
15
|
+
const $ = c(52);
|
|
16
|
+
let description;
|
|
17
|
+
let descriptionClassName;
|
|
18
|
+
let descriptionTypography;
|
|
19
|
+
let heading;
|
|
20
|
+
let modalClassName;
|
|
21
|
+
let modalProps;
|
|
22
|
+
let primaryAction;
|
|
23
|
+
let secondaryAction;
|
|
24
|
+
let t1;
|
|
25
|
+
let t2;
|
|
26
|
+
let titleClassName;
|
|
27
|
+
let titleTypography;
|
|
28
|
+
if ($[0] !== t0) {
|
|
29
|
+
({heading, description, primaryAction, secondaryAction, buttonSize: t1, textAlign: t2, modalClassName, titleTypography, titleClassName, descriptionTypography, descriptionClassName, ...modalProps} = t0);
|
|
30
|
+
$[0] = t0;
|
|
31
|
+
$[1] = description;
|
|
32
|
+
$[2] = descriptionClassName;
|
|
33
|
+
$[3] = descriptionTypography;
|
|
34
|
+
$[4] = heading;
|
|
35
|
+
$[5] = modalClassName;
|
|
36
|
+
$[6] = modalProps;
|
|
37
|
+
$[7] = primaryAction;
|
|
38
|
+
$[8] = secondaryAction;
|
|
39
|
+
$[9] = t1;
|
|
40
|
+
$[10] = t2;
|
|
41
|
+
$[11] = titleClassName;
|
|
42
|
+
$[12] = titleTypography;
|
|
43
|
+
} else {
|
|
44
|
+
description = $[1];
|
|
45
|
+
descriptionClassName = $[2];
|
|
46
|
+
descriptionTypography = $[3];
|
|
47
|
+
heading = $[4];
|
|
48
|
+
modalClassName = $[5];
|
|
49
|
+
modalProps = $[6];
|
|
50
|
+
primaryAction = $[7];
|
|
51
|
+
secondaryAction = $[8];
|
|
52
|
+
t1 = $[9];
|
|
53
|
+
t2 = $[10];
|
|
54
|
+
titleClassName = $[11];
|
|
55
|
+
titleTypography = $[12];
|
|
56
|
+
}
|
|
57
|
+
const buttonSize = t1 === void 0 ? "m" : t1;
|
|
58
|
+
const textAlign = t2 === void 0 ? "left" : t2;
|
|
14
59
|
const ui = UIConfig.useConfig();
|
|
15
60
|
const textAlignClass = textAlignClassMap[textAlign];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
61
|
+
let t3;
|
|
62
|
+
if ($[13] !== modalClassName) {
|
|
63
|
+
t3 = clsx("w-modal", modalClassName);
|
|
64
|
+
$[13] = modalClassName;
|
|
65
|
+
$[14] = t3;
|
|
66
|
+
} else t3 = $[14];
|
|
67
|
+
const t4 = titleTypography ?? ui.actionModal.titleTypography;
|
|
68
|
+
let t5;
|
|
69
|
+
if ($[15] !== textAlignClass || $[16] !== titleClassName) {
|
|
70
|
+
t5 = clsx("text-text-default-1", textAlignClass, titleClassName);
|
|
71
|
+
$[15] = textAlignClass;
|
|
72
|
+
$[16] = titleClassName;
|
|
73
|
+
$[17] = t5;
|
|
74
|
+
} else t5 = $[17];
|
|
75
|
+
let t6;
|
|
76
|
+
if ($[18] !== heading || $[19] !== t4 || $[20] !== t5) {
|
|
77
|
+
t6 = /* @__PURE__ */ jsx(Typography, {
|
|
78
|
+
...t4,
|
|
79
|
+
as: "h2",
|
|
80
|
+
className: t5,
|
|
81
|
+
children: heading
|
|
82
|
+
});
|
|
83
|
+
$[18] = heading;
|
|
84
|
+
$[19] = t4;
|
|
85
|
+
$[20] = t5;
|
|
86
|
+
$[21] = t6;
|
|
87
|
+
} else t6 = $[21];
|
|
88
|
+
const t7 = descriptionTypography ?? ui.actionModal.descriptionTypography;
|
|
89
|
+
let t8;
|
|
90
|
+
if ($[22] !== descriptionClassName || $[23] !== textAlignClass) {
|
|
91
|
+
t8 = clsx("text-text-default-1", textAlignClass, descriptionClassName);
|
|
92
|
+
$[22] = descriptionClassName;
|
|
93
|
+
$[23] = textAlignClass;
|
|
94
|
+
$[24] = t8;
|
|
95
|
+
} else t8 = $[24];
|
|
96
|
+
let t9;
|
|
97
|
+
if ($[25] !== description || $[26] !== t7 || $[27] !== t8) {
|
|
98
|
+
t9 = /* @__PURE__ */ jsx(Typography, {
|
|
99
|
+
...t7,
|
|
100
|
+
className: t8,
|
|
101
|
+
children: description
|
|
102
|
+
});
|
|
103
|
+
$[25] = description;
|
|
104
|
+
$[26] = t7;
|
|
105
|
+
$[27] = t8;
|
|
106
|
+
$[28] = t9;
|
|
107
|
+
} else t9 = $[28];
|
|
108
|
+
let t10;
|
|
109
|
+
if ($[29] !== t6 || $[30] !== t9) {
|
|
110
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
20
111
|
className: "flex flex-col gap-modal-gap-text",
|
|
21
|
-
children: [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
112
|
+
children: [t6, t9]
|
|
113
|
+
});
|
|
114
|
+
$[29] = t6;
|
|
115
|
+
$[30] = t9;
|
|
116
|
+
$[31] = t10;
|
|
117
|
+
} else t10 = $[31];
|
|
118
|
+
let t11;
|
|
119
|
+
if ($[32] !== buttonSize || $[33] !== secondaryAction) {
|
|
120
|
+
t11 = secondaryAction && /* @__PURE__ */ jsx(Button, {
|
|
121
|
+
variant: secondaryAction?.variant ?? "contained",
|
|
122
|
+
size: buttonSize,
|
|
123
|
+
color: secondaryAction?.color ?? "secondary",
|
|
124
|
+
width: "fill",
|
|
125
|
+
onPress: secondaryAction?.onPress,
|
|
126
|
+
className: clsx("min-w-40 flex-1 shrink-0", secondaryAction?.className),
|
|
127
|
+
children: secondaryAction?.label
|
|
128
|
+
});
|
|
129
|
+
$[32] = buttonSize;
|
|
130
|
+
$[33] = secondaryAction;
|
|
131
|
+
$[34] = t11;
|
|
132
|
+
} else t11 = $[34];
|
|
133
|
+
const t12 = primaryAction?.variant ?? "contained";
|
|
134
|
+
const t13 = primaryAction?.color ?? "primary";
|
|
135
|
+
const t14 = primaryAction.onPress;
|
|
136
|
+
const t15 = primaryAction?.className;
|
|
137
|
+
let t16;
|
|
138
|
+
if ($[35] !== t15) {
|
|
139
|
+
t16 = clsx("min-w-40 flex-1 shrink-0", t15);
|
|
140
|
+
$[35] = t15;
|
|
141
|
+
$[36] = t16;
|
|
142
|
+
} else t16 = $[36];
|
|
143
|
+
let t17;
|
|
144
|
+
if ($[37] !== buttonSize || $[38] !== primaryAction.label || $[39] !== primaryAction.onPress || $[40] !== t12 || $[41] !== t13 || $[42] !== t16) {
|
|
145
|
+
t17 = /* @__PURE__ */ jsx(Button, {
|
|
146
|
+
variant: t12,
|
|
147
|
+
size: buttonSize,
|
|
148
|
+
color: t13,
|
|
149
|
+
width: "fill",
|
|
150
|
+
onPress: t14,
|
|
151
|
+
className: t16,
|
|
152
|
+
children: primaryAction.label
|
|
153
|
+
});
|
|
154
|
+
$[37] = buttonSize;
|
|
155
|
+
$[38] = primaryAction.label;
|
|
156
|
+
$[39] = primaryAction.onPress;
|
|
157
|
+
$[40] = t12;
|
|
158
|
+
$[41] = t13;
|
|
159
|
+
$[42] = t16;
|
|
160
|
+
$[43] = t17;
|
|
161
|
+
} else t17 = $[43];
|
|
162
|
+
let t18;
|
|
163
|
+
if ($[44] !== t11 || $[45] !== t17) {
|
|
164
|
+
t18 = /* @__PURE__ */ jsxs("div", {
|
|
32
165
|
className: "flex w-full flex-wrap gap-modal-gap-buttons pt-1",
|
|
33
|
-
children: [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
166
|
+
children: [t11, t17]
|
|
167
|
+
});
|
|
168
|
+
$[44] = t11;
|
|
169
|
+
$[45] = t17;
|
|
170
|
+
$[46] = t18;
|
|
171
|
+
} else t18 = $[46];
|
|
172
|
+
let t19;
|
|
173
|
+
if ($[47] !== modalProps || $[48] !== t10 || $[49] !== t18 || $[50] !== t3) {
|
|
174
|
+
t19 = /* @__PURE__ */ jsxs(Modal, {
|
|
175
|
+
modalClassName: t3,
|
|
176
|
+
...modalProps,
|
|
177
|
+
children: [t10, t18]
|
|
178
|
+
});
|
|
179
|
+
$[47] = modalProps;
|
|
180
|
+
$[48] = t10;
|
|
181
|
+
$[49] = t18;
|
|
182
|
+
$[50] = t3;
|
|
183
|
+
$[51] = t19;
|
|
184
|
+
} else t19 = $[51];
|
|
185
|
+
return t19;
|
|
52
186
|
};
|
|
53
187
|
//#endregion
|
|
54
188
|
export { ActionModal };
|
|
@@ -100,7 +100,7 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = tr
|
|
|
100
100
|
isOpen: true,
|
|
101
101
|
UNSTABLE_portalContainer: portalContainerRef?.current,
|
|
102
102
|
className: clsx("fixed top-0 left-0 z-bottom-sheet w-screen h-dvh", containerClassName),
|
|
103
|
-
style: { "--bottom-sheet-keyboard-inset":
|
|
103
|
+
style: { "--bottom-sheet-keyboard-inset": `var(--bottom-sheet-host-inset, ${keyboardInset}px)` },
|
|
104
104
|
onOpenChange,
|
|
105
105
|
isDismissable,
|
|
106
106
|
ref: overlayRef,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PropsWithChildren, RefObject } from 'react';
|
|
2
|
+
import { DialogProps as AriaDialogProps } from 'react-aria-components';
|
|
2
3
|
import { ModalVariantProps } from './modal.cva';
|
|
3
|
-
export interface ModalProps extends ModalVariantProps {
|
|
4
|
+
export interface ModalProps extends ModalVariantProps, Pick<AriaDialogProps, "aria-label" | "aria-labelledby"> {
|
|
4
5
|
isOpen: boolean;
|
|
5
6
|
portalContainerRef?: RefObject<HTMLElement>;
|
|
6
7
|
onClose: () => void;
|
|
@@ -12,4 +13,4 @@ export interface ModalProps extends ModalVariantProps {
|
|
|
12
13
|
isKeyboardDismissable?: boolean;
|
|
13
14
|
shouldCloseOnInteractOutside?: () => boolean;
|
|
14
15
|
}
|
|
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;
|
|
16
|
+
export declare const Modal: ({ isOpen, portalContainerRef, onClose, aside, children, modalClassName, closeIconClassName, overlayClassName, showCloseIcon, isDismissable, isKeyboardDismissable, shouldCloseOnInteractOutside, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, }: PropsWithChildren<ModalProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,7 +8,7 @@ import { clsx } from "clsx";
|
|
|
8
8
|
import { Dialog, Modal, ModalOverlay } from "react-aria-components";
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
10
|
//#region src/components/overlays/Modal/Modal.tsx
|
|
11
|
-
var Modal$1 = ({ isOpen, portalContainerRef, onClose, aside, children, modalClassName, closeIconClassName, overlayClassName, showCloseIcon, isDismissable = true, isKeyboardDismissable, shouldCloseOnInteractOutside }) => {
|
|
11
|
+
var Modal$1 = ({ isOpen, portalContainerRef, onClose, aside, children, modalClassName, closeIconClassName, overlayClassName, showCloseIcon, isDismissable = true, isKeyboardDismissable, shouldCloseOnInteractOutside, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy }) => {
|
|
12
12
|
const { t } = useTranslation("ui");
|
|
13
13
|
const modalMainCva = UIOverrides.useCva("modal.mainCva", modalMainDefinition);
|
|
14
14
|
const modalContentCva = UIOverrides.useCva("modal.contentCva", modalContentDefinition);
|
|
@@ -35,6 +35,8 @@ var Modal$1 = ({ isOpen, portalContainerRef, onClose, aside, children, modalClas
|
|
|
35
35
|
children: /* @__PURE__ */ jsx(Modal, {
|
|
36
36
|
className: modalMainCva({ aside }),
|
|
37
37
|
children: /* @__PURE__ */ jsxs(Dialog, {
|
|
38
|
+
"aria-label": ariaLabel,
|
|
39
|
+
"aria-labelledby": ariaLabelledBy,
|
|
38
40
|
className: modalContentCva({
|
|
39
41
|
aside,
|
|
40
42
|
className: modalClassName
|
|
@@ -2,44 +2,125 @@ import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
|
2
2
|
import { BottomSheet } from "../BottomSheet/BottomSheet.js";
|
|
3
3
|
import { useBreakpoint } from "../../../hooks/useBreakpoint.js";
|
|
4
4
|
import { popoverDefinition } from "../../shared/popover.cva.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { clsx } from "clsx";
|
|
7
8
|
import { Dialog, DialogTrigger, Popover } from "react-aria-components";
|
|
8
9
|
//#region src/components/overlays/ResponsivePopover/ResponsivePopover.tsx
|
|
9
|
-
var ResponsivePopover = (
|
|
10
|
+
var ResponsivePopover = (t0) => {
|
|
11
|
+
const $ = c(33);
|
|
12
|
+
const { trigger, isOpen, onOpenChange, children, popoverClassName, sheetLabel, bottomSheetProps, popoverProps } = t0;
|
|
10
13
|
const popoverCva = UIOverrides.useCva("popover.cva", popoverDefinition);
|
|
11
14
|
const isDesktop = useBreakpoint("md");
|
|
12
|
-
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
let t1;
|
|
16
|
+
if ($[0] !== popoverProps) {
|
|
17
|
+
t1 = popoverProps ?? {};
|
|
18
|
+
$[0] = popoverProps;
|
|
19
|
+
$[1] = t1;
|
|
20
|
+
} else t1 = $[1];
|
|
21
|
+
let restPopoverProps;
|
|
22
|
+
let t2;
|
|
23
|
+
let t3;
|
|
24
|
+
if ($[2] !== t1) {
|
|
25
|
+
({offset: t2, placement: t3, ...restPopoverProps} = t1);
|
|
26
|
+
$[2] = t1;
|
|
27
|
+
$[3] = restPopoverProps;
|
|
28
|
+
$[4] = t2;
|
|
29
|
+
$[5] = t3;
|
|
30
|
+
} else {
|
|
31
|
+
restPopoverProps = $[3];
|
|
32
|
+
t2 = $[4];
|
|
33
|
+
t3 = $[5];
|
|
34
|
+
}
|
|
35
|
+
const offset = t2 === void 0 ? 0 : t2;
|
|
36
|
+
const placement = t3 === void 0 ? "bottom start" : t3;
|
|
37
|
+
if (!isDesktop) {
|
|
38
|
+
let t4;
|
|
39
|
+
if ($[6] !== children) {
|
|
40
|
+
t4 = /* @__PURE__ */ jsx("div", {
|
|
41
|
+
className: "p-4",
|
|
42
|
+
children
|
|
43
|
+
});
|
|
44
|
+
$[6] = children;
|
|
45
|
+
$[7] = t4;
|
|
46
|
+
} else t4 = $[7];
|
|
47
|
+
let t5;
|
|
48
|
+
if ($[8] !== bottomSheetProps || $[9] !== isOpen || $[10] !== onOpenChange || $[11] !== sheetLabel || $[12] !== t4 || $[13] !== trigger) {
|
|
49
|
+
t5 = /* @__PURE__ */ jsx(BottomSheet, {
|
|
50
|
+
height: "auto",
|
|
51
|
+
isDismissable: true,
|
|
52
|
+
label: sheetLabel,
|
|
53
|
+
...bottomSheetProps,
|
|
54
|
+
isOpen,
|
|
55
|
+
onOpenChange,
|
|
56
|
+
trigger,
|
|
57
|
+
children: t4
|
|
58
|
+
});
|
|
59
|
+
$[8] = bottomSheetProps;
|
|
60
|
+
$[9] = isOpen;
|
|
61
|
+
$[10] = onOpenChange;
|
|
62
|
+
$[11] = sheetLabel;
|
|
63
|
+
$[12] = t4;
|
|
64
|
+
$[13] = trigger;
|
|
65
|
+
$[14] = t5;
|
|
66
|
+
} else t5 = $[14];
|
|
67
|
+
return t5;
|
|
68
|
+
}
|
|
69
|
+
let t4;
|
|
70
|
+
if ($[15] !== popoverClassName) {
|
|
71
|
+
t4 = clsx("my-4 outline-none", popoverClassName);
|
|
72
|
+
$[15] = popoverClassName;
|
|
73
|
+
$[16] = t4;
|
|
74
|
+
} else t4 = $[16];
|
|
75
|
+
let t5;
|
|
76
|
+
if ($[17] !== popoverCva) {
|
|
77
|
+
t5 = clsx(popoverCva({}), "overflow-hidden p-2");
|
|
78
|
+
$[17] = popoverCva;
|
|
79
|
+
$[18] = t5;
|
|
80
|
+
} else t5 = $[18];
|
|
81
|
+
let t6;
|
|
82
|
+
if ($[19] !== children || $[20] !== t5) {
|
|
83
|
+
t6 = /* @__PURE__ */ jsx(Dialog, {
|
|
84
|
+
className: "outline-none",
|
|
85
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
86
|
+
className: t5,
|
|
87
|
+
children
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
$[19] = children;
|
|
91
|
+
$[20] = t5;
|
|
92
|
+
$[21] = t6;
|
|
93
|
+
} else t6 = $[21];
|
|
94
|
+
let t7;
|
|
95
|
+
if ($[22] !== offset || $[23] !== placement || $[24] !== restPopoverProps || $[25] !== t4 || $[26] !== t6) {
|
|
96
|
+
t7 = /* @__PURE__ */ jsx(Popover, {
|
|
30
97
|
...restPopoverProps,
|
|
31
|
-
className:
|
|
98
|
+
className: t4,
|
|
32
99
|
offset,
|
|
33
100
|
placement,
|
|
34
|
-
children:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
101
|
+
children: t6
|
|
102
|
+
});
|
|
103
|
+
$[22] = offset;
|
|
104
|
+
$[23] = placement;
|
|
105
|
+
$[24] = restPopoverProps;
|
|
106
|
+
$[25] = t4;
|
|
107
|
+
$[26] = t6;
|
|
108
|
+
$[27] = t7;
|
|
109
|
+
} else t7 = $[27];
|
|
110
|
+
let t8;
|
|
111
|
+
if ($[28] !== isOpen || $[29] !== onOpenChange || $[30] !== t7 || $[31] !== trigger) {
|
|
112
|
+
t8 = /* @__PURE__ */ jsxs(DialogTrigger, {
|
|
113
|
+
isOpen,
|
|
114
|
+
onOpenChange,
|
|
115
|
+
children: [trigger, t7]
|
|
116
|
+
});
|
|
117
|
+
$[28] = isOpen;
|
|
118
|
+
$[29] = onOpenChange;
|
|
119
|
+
$[30] = t7;
|
|
120
|
+
$[31] = trigger;
|
|
121
|
+
$[32] = t8;
|
|
122
|
+
} else t8 = $[32];
|
|
123
|
+
return t8;
|
|
43
124
|
};
|
|
44
125
|
//#endregion
|
|
45
126
|
export { ResponsivePopover };
|