@povio/ui 2.1.28 → 2.1.29
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/BottomSheet.js +51 -19
- package/dist/BottomSheetHeader.js +36 -0
- package/dist/CalendarSelectHeader.js +1 -1
- package/dist/CheckContent.js +1 -0
- package/dist/Checkbox.js +2 -2
- package/dist/ColorPickerDropdown.js +4 -1
- package/dist/ColumnConfig.js +1 -1
- package/dist/DatePicker.js +3 -2
- package/dist/DatePickerInput.js +2 -2
- package/dist/DateRangePicker.js +4 -3
- package/dist/DateTimeDialog.js +8 -14
- package/dist/DateTimeDialogFooter.js +1 -1
- package/dist/DateTimePicker.js +3 -2
- package/dist/FileUpload.js +2 -2
- package/dist/FileUploadContentError.js +1 -1
- package/dist/FileUploadContentFilled.js +1 -1
- package/dist/FormFieldLabel.js +1 -0
- package/dist/InputUploadContent.js +1 -1
- package/dist/MenuMobile.js +1 -0
- package/dist/RadioGroup.js +4 -4
- package/dist/ResponsivePopover.js +8 -10
- package/dist/SelectBase.js +1 -1
- package/dist/SelectDesktop.js +4 -1
- package/dist/SelectInput.js +2 -2
- package/dist/SelectListBoxItem.js +1 -1
- package/dist/SelectListBoxItemSelectAll.js +1 -1
- package/dist/SelectListBoxSelectionBar.js +1 -1
- package/dist/SelectMobile.js +1 -1
- package/dist/Toggle.js +1 -1
- package/dist/checkbox.cva.js +1 -0
- package/dist/components/Menu/Menu.d.ts +2 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -1
- package/dist/components/overlays/BottomSheet/BottomSheet.d.ts +9 -0
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.d.ts +13 -0
- package/dist/components/shared/popover.cva.d.ts +4 -0
- package/dist/config/uiConfig.context.d.ts +2 -0
- package/dist/config/uiStyle.context.d.ts +4 -0
- package/dist/index.js +6 -6
- package/dist/label.cva.js +5 -0
- package/dist/popover.cva.js +3 -0
- package/dist/radio.cva.js +1 -0
- package/dist/toggle.cva.js +1 -0
- package/dist/uiConfig.context.js +9 -0
- package/package.json +1 -1
package/dist/BottomSheet.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { react_exports } from "./react.js";
|
|
2
|
+
import { BottomSheetHeader } from "./BottomSheetHeader.js";
|
|
3
|
+
import { UIConfig } from "./uiConfig.context.js";
|
|
4
|
+
import { useStateAndRef } from "./useStateAndRef.js";
|
|
2
5
|
import { DomUtils } from "./dom.utils.js";
|
|
3
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
7
|
import { clsx } from "clsx";
|
|
@@ -22,7 +25,12 @@ var staticTransition = {
|
|
|
22
25
|
1
|
|
23
26
|
]
|
|
24
27
|
};
|
|
25
|
-
var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable =
|
|
28
|
+
var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = true, isScrollable = true, height = "full", label, portalContainerRef, children, footer, hideHeader, hideThumb: hideThumbProp, sheetMarginTop = 96, sheetMarginBottom = 128, closeDragThreshold: closeDragThresholdProp, closeVelocityThreshold: closeVelocityThresholdProp, shouldCloseOnInteractOutside, containerClassName, overlayClassName, headerTypography: headerTypographyProp }) => {
|
|
29
|
+
const uiConfig = UIConfig.useConfig();
|
|
30
|
+
const closeDragThreshold = closeDragThresholdProp ?? uiConfig.bottomSheet.closeDragThreshold;
|
|
31
|
+
const closeVelocityThreshold = closeVelocityThresholdProp ?? uiConfig.bottomSheet.closeVelocityThreshold;
|
|
32
|
+
const hideThumb = hideThumbProp ?? uiConfig.bottomSheet.hideThumb;
|
|
33
|
+
const headerTypography = headerTypographyProp ?? uiConfig.bottomSheet.headerTypography;
|
|
26
34
|
const viewport = useViewportSize();
|
|
27
35
|
const { sheetHeight, windowHeight } = useMemo(() => {
|
|
28
36
|
return {
|
|
@@ -31,19 +39,26 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = fa
|
|
|
31
39
|
};
|
|
32
40
|
}, [viewport.height, sheetMarginTop]);
|
|
33
41
|
const y = (0, react_exports.useMotionValue)(sheetHeight);
|
|
42
|
+
const dragControls = (0, react_exports.useDragControls)();
|
|
34
43
|
const closeVelocityRef = useRef(true);
|
|
35
44
|
const overlayRef = useRef(null);
|
|
36
45
|
const containerRef = useRef(null);
|
|
37
46
|
const dialogRef = useRef(null);
|
|
38
|
-
const footerRef = useRef(null);
|
|
39
47
|
const focusTrapRef = useRef(null);
|
|
48
|
+
const [footerElement, footerRef, setFooterElement] = useStateAndRef(null);
|
|
40
49
|
const [footerHeight, setFooterHeight] = useState(0);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
onResize
|
|
44
|
-
setFooterHeight(
|
|
45
|
-
}
|
|
46
|
-
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (!footerElement) return;
|
|
52
|
+
const onResize = () => {
|
|
53
|
+
setFooterHeight(footerElement.offsetHeight || 0);
|
|
54
|
+
};
|
|
55
|
+
onResize();
|
|
56
|
+
const observer = new ResizeObserver(onResize);
|
|
57
|
+
observer.observe(footerElement);
|
|
58
|
+
return () => {
|
|
59
|
+
observer.disconnect();
|
|
60
|
+
};
|
|
61
|
+
}, [footerElement]);
|
|
47
62
|
const oldHeightRef = useRef(0);
|
|
48
63
|
useResizeObserver({
|
|
49
64
|
ref: dialogRef,
|
|
@@ -67,12 +82,12 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = fa
|
|
|
67
82
|
ref: overlayRef,
|
|
68
83
|
shouldCloseOnInteractOutside,
|
|
69
84
|
children: [/* @__PURE__ */ jsx(react_exports.motion.div, {
|
|
70
|
-
className: "pointer-events-none absolute inset-0 bg-support-overlay",
|
|
85
|
+
className: clsx("pointer-events-none absolute inset-0 bg-support-overlay", overlayClassName),
|
|
71
86
|
animate: { opacity: 1 },
|
|
72
87
|
initial: { opacity: 0 },
|
|
73
88
|
exit: { opacity: 0 }
|
|
74
89
|
}), /* @__PURE__ */ jsx(MotionModal, {
|
|
75
|
-
isDismissable
|
|
90
|
+
isDismissable,
|
|
76
91
|
className: clsx("pointer-events-none flex h-full w-full flex-col items-stretch justify-end outline-none will-change-transform"),
|
|
77
92
|
animate: {
|
|
78
93
|
y: 0,
|
|
@@ -98,6 +113,8 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = fa
|
|
|
98
113
|
minHeight: "100%"
|
|
99
114
|
},
|
|
100
115
|
drag: "y",
|
|
116
|
+
dragListener: false,
|
|
117
|
+
dragControls,
|
|
101
118
|
dragElastic: {
|
|
102
119
|
top: 0,
|
|
103
120
|
bottom: .5
|
|
@@ -118,12 +135,16 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = fa
|
|
|
118
135
|
},
|
|
119
136
|
onDragEnd: (e, { velocity }) => {
|
|
120
137
|
containerRef.current?.style.removeProperty("pointer-events");
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
138
|
+
const yValue = y.get();
|
|
139
|
+
if (yValue > 0) {
|
|
140
|
+
const dragPastThreshold = yValue > closeDragThreshold;
|
|
141
|
+
if (closeVelocityRef.current && velocity.y > closeVelocityThreshold || dragPastThreshold) onOpenChange?.(false);
|
|
142
|
+
else (0, react_exports.animate)(y, 0, {
|
|
143
|
+
...inertiaTransition,
|
|
144
|
+
min: 0,
|
|
145
|
+
max: 0
|
|
146
|
+
});
|
|
147
|
+
}
|
|
127
148
|
},
|
|
128
149
|
children: /* @__PURE__ */ jsx(Dialog, {
|
|
129
150
|
className: "relative flex min-h-0 flex-1 flex-col items-stretch outline-none",
|
|
@@ -142,10 +163,18 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = fa
|
|
|
142
163
|
ref: focusTrapRef,
|
|
143
164
|
tabIndex: -1
|
|
144
165
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ jsxs("div", {
|
|
146
167
|
className: "flex max-h-full min-h-0 flex-col items-stretch",
|
|
147
168
|
ref: containerRef,
|
|
148
|
-
children:
|
|
169
|
+
children: [/* @__PURE__ */ jsx(BottomSheetHeader, {
|
|
170
|
+
label,
|
|
171
|
+
dragControls,
|
|
172
|
+
onClose: close,
|
|
173
|
+
isDismissable,
|
|
174
|
+
hideHeader,
|
|
175
|
+
hideThumb,
|
|
176
|
+
headerTypography
|
|
177
|
+
}), typeof children === "function" ? children(close) : children]
|
|
149
178
|
}),
|
|
150
179
|
/* @__PURE__ */ jsx("div", {
|
|
151
180
|
className: "shrink-0",
|
|
@@ -155,7 +184,10 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = fa
|
|
|
155
184
|
]
|
|
156
185
|
}),
|
|
157
186
|
footer && /* @__PURE__ */ jsx(react_exports.motion.div, {
|
|
158
|
-
|
|
187
|
+
animate: { opacity: 1 },
|
|
188
|
+
initial: { opacity: 0 },
|
|
189
|
+
exit: { opacity: 0 },
|
|
190
|
+
ref: setFooterElement,
|
|
159
191
|
className: clsx("pointer-events-auto absolute z-50 w-full bg-elevation-fill-default-2", "top-(--visual-viewport-height) left-0 translate-y-[calc(-100%-var(--scroll-position,0px))]"),
|
|
160
192
|
children: footer
|
|
161
193
|
})
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CloseIcon } from "./Close.js";
|
|
2
|
+
import { Typography } from "./Typography.js";
|
|
3
|
+
import { ns } from "./i18n.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
|
+
import { Button } from "react-aria-components";
|
|
7
|
+
import { useTranslation } from "react-i18next";
|
|
8
|
+
const BottomSheetHeader = ({ label, dragControls, isDismissable, hideThumb, hideHeader, headerTypography, onClose }) => {
|
|
9
|
+
const { t } = useTranslation("ui");
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
11
|
+
className: clsx("pb-list-height-title-bottom", !isDismissable && "pt-list-height-title-top"),
|
|
12
|
+
children: [isDismissable && !hideThumb && /* @__PURE__ */ jsx("div", {
|
|
13
|
+
className: "flex shrink-0 cursor-grab touch-none justify-center px-list-side-title pt-list-height-title-top pb-2-5",
|
|
14
|
+
onPointerDown: (e) => {
|
|
15
|
+
e.preventDefault();
|
|
16
|
+
dragControls?.start(e);
|
|
17
|
+
},
|
|
18
|
+
"aria-hidden": true,
|
|
19
|
+
children: /* @__PURE__ */ jsx("div", { className: "h-1 w-16 shrink-0 rounded-full bg-elevation-fill-default-3" })
|
|
20
|
+
}), !hideHeader && /* @__PURE__ */ jsxs("div", {
|
|
21
|
+
className: "flex justify-between px-list-side-title",
|
|
22
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
23
|
+
size: "label-2",
|
|
24
|
+
variant: "prominent-1",
|
|
25
|
+
...headerTypography,
|
|
26
|
+
children: label
|
|
27
|
+
}), onClose && isDismissable && /* @__PURE__ */ jsx(Button, {
|
|
28
|
+
onPress: onClose,
|
|
29
|
+
"aria-label": t(($) => $.ui.closeAlt),
|
|
30
|
+
className: "-m-2 shrink-0 p-2 text-interactive-text-secondary-idle focus-visible:outline-interactive-text-secondary-focus",
|
|
31
|
+
children: /* @__PURE__ */ jsx(CloseIcon, { className: "size-6" })
|
|
32
|
+
})]
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
export { BottomSheetHeader };
|
|
@@ -9,8 +9,8 @@ import { ns } from "./i18n.js";
|
|
|
9
9
|
import { Select } from "./Select.js";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { useMemo } from "react";
|
|
12
|
-
import { useDateFormatter } from "@react-aria/i18n";
|
|
13
12
|
import { useTranslation } from "react-i18next";
|
|
13
|
+
import { useDateFormatter } from "@react-aria/i18n";
|
|
14
14
|
const CalendarSelectHeader = ({ state, isPrevMonthDisabled, isPrevYearDisabled, isNextMonthDisabled, isNextYearDisabled, offset = { months: 0 }, onNavigate, maxDate, minDate }) => {
|
|
15
15
|
const { t } = useTranslation("ui");
|
|
16
16
|
const displayDate = state.visibleRange.start.add(offset);
|
package/dist/CheckContent.js
CHANGED
|
@@ -6,6 +6,7 @@ const CheckContent = ({ children, className,...props }) => {
|
|
|
6
6
|
return /* @__PURE__ */ jsx("div", {
|
|
7
7
|
className: clsx$1((UIStyle.useConfig()?.typography?.cva ?? typography)({
|
|
8
8
|
size: "label-1",
|
|
9
|
+
sizeMobile: "label-1",
|
|
9
10
|
variant: "default",
|
|
10
11
|
...props.typography,
|
|
11
12
|
className: "text-text-default-2"
|
package/dist/Checkbox.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { UIStyle } from "./uiStyle.context.js";
|
|
2
|
+
import { UIConfig } from "./uiConfig.context.js";
|
|
2
3
|
import { checkboxIndicatorClass, checkboxTypography } from "./checkbox.cva.js";
|
|
3
4
|
import { FormFieldError } from "./FormFieldError.js";
|
|
4
5
|
import { CheckContent } from "./CheckContent.js";
|
|
5
|
-
import { UIConfig } from "./uiConfig.context.js";
|
|
6
6
|
import { CheckboxCheckmark } from "./CheckboxCheckmark2.js";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { clsx } from "clsx";
|
|
@@ -24,7 +24,7 @@ var CheckboxBase = (props) => {
|
|
|
24
24
|
"aria-errormessage": error || void 0,
|
|
25
25
|
"data-is-dirty": props.isDirty || void 0,
|
|
26
26
|
"data-is-required": props.isRequired || void 0,
|
|
27
|
-
className: clsx(checkboxIndicatorClass, className),
|
|
27
|
+
className: clsx("relative", checkboxIndicatorClass, className),
|
|
28
28
|
children: [/* @__PURE__ */ jsx(CheckboxCheckmark, {
|
|
29
29
|
variant,
|
|
30
30
|
...rest
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ArrowDropDownIcon } from "./ArrowDropDown.js";
|
|
2
|
+
import { UIStyle } from "./uiStyle.context.js";
|
|
2
3
|
import { Typography } from "./Typography.js";
|
|
3
4
|
import { useInputCva } from "./input.cva.js";
|
|
5
|
+
import { popover } from "./popover.cva.js";
|
|
4
6
|
import { ColorPicker } from "./ColorPicker.js";
|
|
5
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
8
|
import { clsx } from "clsx";
|
|
@@ -8,6 +10,7 @@ import { Button, Dialog, DialogTrigger, Popover } from "react-aria-components";
|
|
|
8
10
|
import { useState } from "react";
|
|
9
11
|
const ColorPickerDropdown = ({ colors, value, onChange, isDisabled, children }) => {
|
|
10
12
|
const inputCva = useInputCva();
|
|
13
|
+
const popoverCva = UIStyle.useConfig()?.popover?.cva ?? popover;
|
|
11
14
|
const [isOpen, setIsOpen] = useState(false);
|
|
12
15
|
const handleChange = (color) => {
|
|
13
16
|
onChange(color);
|
|
@@ -37,7 +40,7 @@ const ColorPickerDropdown = ({ colors, value, onChange, isDisabled, children })
|
|
|
37
40
|
children: /* @__PURE__ */ jsx(Dialog, {
|
|
38
41
|
className: "outline-none",
|
|
39
42
|
children: /* @__PURE__ */ jsx("div", {
|
|
40
|
-
className: clsx("flex justify-center overflow-hidden p-2
|
|
43
|
+
className: clsx(popoverCva({}), "flex justify-center overflow-hidden p-2"),
|
|
41
44
|
children: /* @__PURE__ */ jsx(ColorPicker, {
|
|
42
45
|
colors,
|
|
43
46
|
value,
|
package/dist/ColumnConfig.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Typography } from "./Typography.js";
|
|
2
|
-
import { Checkbox } from "./Checkbox.js";
|
|
3
2
|
import { ns } from "./i18n.js";
|
|
3
|
+
import { Checkbox } from "./Checkbox.js";
|
|
4
4
|
import { Modal } from "./Modal.js";
|
|
5
5
|
import { Table } from "./Table.js";
|
|
6
6
|
import { useTranslationMemo } from "./useTranslationMemo.js";
|
package/dist/DatePicker.js
CHANGED
|
@@ -18,7 +18,7 @@ import { useCalendarState, useDatePickerState } from "react-stately";
|
|
|
18
18
|
var PLACEHOLDER_VALUE = new CalendarDate(2024, 1, 1);
|
|
19
19
|
var DatePickerBase = (props) => {
|
|
20
20
|
const ui = UIConfig.useConfig();
|
|
21
|
-
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDirty, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, onChange, value, disableDropdown, className, placeholder, as = ui.input.as, hideLabel = ui.input.hideLabel, variant = ui.input.variant, size = ui.input.size, isClearable = ui.input.isClearable, todayIcon = ui.dateInput.todayIcon, shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros, disableManualEntry = ui.dateInput.disableManualEntry, shouldUpdateDateOnMonthYearChange = ui.dateInput.shouldUpdateDateOnMonthYearChange,...rest } = props;
|
|
21
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDirty, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, onChange, value, disableDropdown, className, placeholder, inputClassName, as = ui.input.as, hideLabel = ui.input.hideLabel, variant = ui.input.variant, size = ui.input.size, isClearable = ui.input.isClearable, todayIcon = ui.dateInput.todayIcon, shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros, disableManualEntry = ui.dateInput.disableManualEntry, shouldUpdateDateOnMonthYearChange = ui.dateInput.shouldUpdateDateOnMonthYearChange,...rest } = props;
|
|
22
22
|
const formFieldProps = {
|
|
23
23
|
error,
|
|
24
24
|
label,
|
|
@@ -139,7 +139,8 @@ var DatePickerBase = (props) => {
|
|
|
139
139
|
headerProps,
|
|
140
140
|
todayIcon,
|
|
141
141
|
onOpenDropdown: () => state.toggle(),
|
|
142
|
-
placeholder
|
|
142
|
+
placeholder,
|
|
143
|
+
className: inputClassName
|
|
143
144
|
}), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
144
145
|
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
145
146
|
isDisabled,
|
package/dist/DatePickerInput.js
CHANGED
|
@@ -16,7 +16,7 @@ import { useCallback, useImperativeHandle, useMemo, useRef, useState } from "rea
|
|
|
16
16
|
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
17
17
|
import { getLocalTimeZone, now, toCalendarDateTime, today } from "@internationalized/date";
|
|
18
18
|
import useMeasure from "react-use-measure";
|
|
19
|
-
const DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, isDirty, isRequired, disableManualEntry, placeholder, onOpenDropdown,...props }) => {
|
|
19
|
+
const DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, isDirty, isRequired, disableManualEntry, placeholder, className, onOpenDropdown,...props }) => {
|
|
20
20
|
const inputCva = useInputCva();
|
|
21
21
|
const inputSideCva = UIStyle.useConfig()?.input?.sideCva ?? inputSide;
|
|
22
22
|
const [canClear, setCanClear] = useState(false);
|
|
@@ -91,7 +91,7 @@ const DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, butto
|
|
|
91
91
|
as,
|
|
92
92
|
size,
|
|
93
93
|
...props,
|
|
94
|
-
className: clsx("group/date-picker-content relative flex min-w-input-width-min-width items-center justify-between gap-2")
|
|
94
|
+
className: clsx("group/date-picker-content relative flex min-w-input-width-min-width items-center justify-between gap-2", className)
|
|
95
95
|
}),
|
|
96
96
|
"data-rac": "",
|
|
97
97
|
"data-datetime-input": "",
|
package/dist/DateRangePicker.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Typography } from "./Typography.js";
|
|
2
|
-
import { UIConfig } from "./uiConfig.context.js";
|
|
3
2
|
import { ns } from "./i18n.js";
|
|
3
|
+
import { UIConfig } from "./uiConfig.context.js";
|
|
4
4
|
import { DatePickerInput } from "./DatePickerInput.js";
|
|
5
5
|
import { DateTimeDialog } from "./DateTimeDialog.js";
|
|
6
6
|
import { DateTimeDialogFooter } from "./DateTimeDialogFooter.js";
|
|
@@ -14,16 +14,16 @@ import { Button } from "react-aria-components";
|
|
|
14
14
|
import { useCallback, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
15
15
|
import { useDateRangePicker, useLocale as useLocale$1 } from "react-aria";
|
|
16
16
|
import { mergeRefs } from "@react-aria/utils";
|
|
17
|
+
import { useTranslation } from "react-i18next";
|
|
17
18
|
import { Controller } from "react-hook-form";
|
|
18
19
|
import { CalendarDate, createCalendar, endOfMonth, endOfWeek, endOfYear, getLocalTimeZone, startOfMonth, startOfWeek, startOfYear, toCalendarDate, today } from "@internationalized/date";
|
|
19
20
|
import { DateTime } from "luxon";
|
|
20
21
|
import { useDateRangePickerState, useRangeCalendarState } from "react-stately";
|
|
21
|
-
import { useTranslation } from "react-i18next";
|
|
22
22
|
var PLACEHOLDER_VALUE = new CalendarDate(2024, 1, 1);
|
|
23
23
|
var DateRangePickerBase = (props) => {
|
|
24
24
|
const ui = UIConfig.useConfig();
|
|
25
25
|
const { t } = useTranslation();
|
|
26
|
-
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, value, disableDropdown, className, hideSidebar, placeholder, hideLabel = ui.input.hideLabel, variant = ui.input.variant, as = ui.input.as, size = ui.input.size, isClearable = ui.input.isClearable, todayIcon = ui.dateInput.todayIcon, shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros, disableManualEntry = ui.dateInput.disableManualEntry,...rest } = props;
|
|
26
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, value, disableDropdown, className, hideSidebar, placeholder, inputClassName, hideLabel = ui.input.hideLabel, variant = ui.input.variant, as = ui.input.as, size = ui.input.size, isClearable = ui.input.isClearable, todayIcon = ui.dateInput.todayIcon, shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros, disableManualEntry = ui.dateInput.disableManualEntry,...rest } = props;
|
|
27
27
|
const [validationRangeError, setValidationRangeError] = useState();
|
|
28
28
|
const datePickerInputRef = useRef(null);
|
|
29
29
|
const dateRangePickerRef = useMemo(() => ({ get current() {
|
|
@@ -484,6 +484,7 @@ var DateRangePickerBase = (props) => {
|
|
|
484
484
|
isDirty,
|
|
485
485
|
disableManualEntry,
|
|
486
486
|
placeholder,
|
|
487
|
+
className: inputClassName,
|
|
487
488
|
onOpenDropdown: () => state.toggle()
|
|
488
489
|
}), /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
489
490
|
hideSidebar,
|
package/dist/DateTimeDialog.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { UIStyle } from "./uiStyle.context.js";
|
|
1
2
|
import { BottomSheet } from "./BottomSheet.js";
|
|
2
3
|
import { useBreakpoint } from "./useBreakpoint.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
4
|
+
import { popover } from "./popover.cva.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import clsx$1 from "clsx";
|
|
6
7
|
import { Dialog, Popover } from "react-aria-components";
|
|
7
8
|
const DateTimeDialog = ({ hideSidebar, children, footer, sidebar, label, isOpen, triggerRef, dialogProps, onOpenChange }) => {
|
|
9
|
+
const popoverCva = UIStyle.useConfig()?.popover?.cva ?? popover;
|
|
8
10
|
if (useBreakpoint("md")) {
|
|
9
11
|
if (!isOpen) return null;
|
|
10
12
|
return /* @__PURE__ */ jsx(Popover, {
|
|
@@ -17,7 +19,7 @@ const DateTimeDialog = ({ hideSidebar, children, footer, sidebar, label, isOpen,
|
|
|
17
19
|
className: "outline-none!",
|
|
18
20
|
"aria-label": label,
|
|
19
21
|
children: /* @__PURE__ */ jsxs("div", {
|
|
20
|
-
className: "flex overflow-hidden
|
|
22
|
+
className: clsx$1(popoverCva({}), "flex overflow-hidden"),
|
|
21
23
|
children: [!hideSidebar && sidebar, /* @__PURE__ */ jsxs("div", {
|
|
22
24
|
className: "flex flex-1 flex-col justify-between",
|
|
23
25
|
children: [children, footer]
|
|
@@ -26,7 +28,7 @@ const DateTimeDialog = ({ hideSidebar, children, footer, sidebar, label, isOpen,
|
|
|
26
28
|
})
|
|
27
29
|
});
|
|
28
30
|
}
|
|
29
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ jsxs(BottomSheet, {
|
|
30
32
|
label,
|
|
31
33
|
footer,
|
|
32
34
|
isOpen,
|
|
@@ -35,15 +37,7 @@ const DateTimeDialog = ({ hideSidebar, children, footer, sidebar, label, isOpen,
|
|
|
35
37
|
isScrollable: true,
|
|
36
38
|
height: "auto",
|
|
37
39
|
isDismissable: true,
|
|
38
|
-
children:
|
|
39
|
-
/* @__PURE__ */ jsx(FormFieldHeader, {
|
|
40
|
-
label,
|
|
41
|
-
className: "mb-8! shrink-0 px-4 pt-3",
|
|
42
|
-
rightContent: /* @__PURE__ */ jsx(FormFieldHeaderClose, { onClose: close })
|
|
43
|
-
}),
|
|
44
|
-
children,
|
|
45
|
-
!hideSidebar && sidebar
|
|
46
|
-
] })
|
|
40
|
+
children: [children, !hideSidebar && sidebar]
|
|
47
41
|
});
|
|
48
42
|
};
|
|
49
43
|
export { DateTimeDialog };
|
package/dist/DateTimePicker.js
CHANGED
|
@@ -16,7 +16,7 @@ import { useCalendarState, useDatePickerState } from "react-stately";
|
|
|
16
16
|
var PLACEHOLDER_VALUE = new CalendarDateTime(2024, 1, 1);
|
|
17
17
|
var DateTimePickerBase = (props) => {
|
|
18
18
|
const ui = UIConfig.useConfig();
|
|
19
|
-
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, value, disableDropdown, isTimeOptional, placeholder, hideLabel = ui.input.hideLabel, variant = ui.input.variant, as = ui.input.as, size = ui.input.size, isClearable = ui.input.isClearable, todayIcon = ui.dateInput.todayIcon, shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros, disableManualEntry = ui.dateInput.disableManualEntry, shouldUpdateDateOnMonthYearChange = ui.dateInput.shouldUpdateDateOnMonthYearChange,...rest } = props;
|
|
19
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, value, disableDropdown, isTimeOptional, placeholder, inputClassName, hideLabel = ui.input.hideLabel, variant = ui.input.variant, as = ui.input.as, size = ui.input.size, isClearable = ui.input.isClearable, todayIcon = ui.dateInput.todayIcon, shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros, disableManualEntry = ui.dateInput.disableManualEntry, shouldUpdateDateOnMonthYearChange = ui.dateInput.shouldUpdateDateOnMonthYearChange,...rest } = props;
|
|
20
20
|
const formFieldProps = {
|
|
21
21
|
error,
|
|
22
22
|
label,
|
|
@@ -164,7 +164,8 @@ var DateTimePickerBase = (props) => {
|
|
|
164
164
|
isRequired,
|
|
165
165
|
disableManualEntry,
|
|
166
166
|
placeholder,
|
|
167
|
-
onOpenDropdown: () => state.toggle()
|
|
167
|
+
onOpenDropdown: () => state.toggle(),
|
|
168
|
+
className: inputClassName
|
|
168
169
|
}), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
169
170
|
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
170
171
|
isDisabled,
|
package/dist/FileUpload.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UIConfig } from "./uiConfig.context.js";
|
|
2
1
|
import { ns } from "./i18n.js";
|
|
2
|
+
import { UIConfig } from "./uiConfig.context.js";
|
|
3
3
|
import { FormField } from "./FormField.js";
|
|
4
4
|
import { FileUtils } from "./file.utils.js";
|
|
5
5
|
import { FileCardList } from "./FileCardList.js";
|
|
@@ -11,8 +11,8 @@ import { clsx } from "clsx";
|
|
|
11
11
|
import { DropZone } from "react-aria-components";
|
|
12
12
|
import { useCallback, useState } from "react";
|
|
13
13
|
import { mergeRefs, useLabels } from "@react-aria/utils";
|
|
14
|
-
import { Controller } from "react-hook-form";
|
|
15
14
|
import { useTranslation } from "react-i18next";
|
|
15
|
+
import { Controller } from "react-hook-form";
|
|
16
16
|
var FileUploadBase = (props) => {
|
|
17
17
|
const { t } = useTranslation("ui");
|
|
18
18
|
const { ref: _ref, label, tooltipText, variant = "vertical", as = "button", helperText, isRequired, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, allowsMultiple = false, hideLabel, acceptedFileTypes, clearOnSuccess, emptyText = t(($) => $.ui.fileUpload.emptyText), uploadText = t(($) => $.ui.fileUpload.uploadText), browseText = t(($) => $.ui.fileUpload.browse), fileUpload, fileRemove, children, listRenderer, onInvalidFileType,...rest } = props;
|
|
@@ -2,8 +2,8 @@ import { CloseIcon } from "./Close.js";
|
|
|
2
2
|
import { Typography } from "./Typography.js";
|
|
3
3
|
import { Button as Button$1 } from "./Button.js";
|
|
4
4
|
import { InlineIconButton } from "./InlineIconButton.js";
|
|
5
|
-
import { TextButton } from "./TextButton.js";
|
|
6
5
|
import { ns } from "./i18n.js";
|
|
6
|
+
import { TextButton } from "./TextButton.js";
|
|
7
7
|
import { WarningFilledIcon } from "./WarningFilled.js";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { clsx } from "clsx";
|
|
@@ -2,8 +2,8 @@ import { CloseIcon } from "./Close.js";
|
|
|
2
2
|
import { Typography } from "./Typography.js";
|
|
3
3
|
import { Button as Button$1 } from "./Button.js";
|
|
4
4
|
import { InlineIconButton } from "./InlineIconButton.js";
|
|
5
|
-
import { TextButton } from "./TextButton.js";
|
|
6
5
|
import { ns } from "./i18n.js";
|
|
6
|
+
import { TextButton } from "./TextButton.js";
|
|
7
7
|
import { FileUtils } from "./file.utils.js";
|
|
8
8
|
import { CheckCircleIcon } from "./CheckCircle.js";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
package/dist/FormFieldLabel.js
CHANGED
|
@@ -16,6 +16,7 @@ const FormFieldLabel = ({ ref, as, label, isRequired, isDisabled, labelProps, si
|
|
|
16
16
|
ref,
|
|
17
17
|
as: "span",
|
|
18
18
|
size: "label-2",
|
|
19
|
+
sizeMobile: "label-2",
|
|
19
20
|
variant: "prominent-1",
|
|
20
21
|
...labelTypographyMap({ as }),
|
|
21
22
|
className: clsx(labelBaseCva({ as }), as && ["filter", "floating"].includes(as) && inputSideCva({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { UIStyle } from "./uiStyle.context.js";
|
|
2
2
|
import { Typography } from "./Typography.js";
|
|
3
3
|
import { Button as Button$1 } from "./Button.js";
|
|
4
|
+
import { ns } from "./i18n.js";
|
|
4
5
|
import { TextButton } from "./TextButton.js";
|
|
5
6
|
import { inputSize } from "./input.cva.js";
|
|
6
|
-
import { ns } from "./i18n.js";
|
|
7
7
|
import { UploadIcon } from "./Upload.js";
|
|
8
8
|
import { inputUploadButton, inputUploadDropZone } from "./inputUploadButton.cva.js";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/dist/MenuMobile.js
CHANGED
|
@@ -44,6 +44,7 @@ const MenuMobile = ({ trigger, items, onAction,...props }) => {
|
|
|
44
44
|
onOpenChange: setIsOpen,
|
|
45
45
|
trigger,
|
|
46
46
|
isDismissable: true,
|
|
47
|
+
hideHeader: true,
|
|
47
48
|
children: () => /* @__PURE__ */ jsxs(Fragment, { children: [activeItem && /* @__PURE__ */ jsxs(Button, {
|
|
48
49
|
className: clsx(menuItemCva$1({
|
|
49
50
|
...props,
|
package/dist/RadioGroup.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { UIStyle } from "./uiStyle.context.js";
|
|
2
|
-
import { CheckContent } from "./CheckContent.js";
|
|
3
2
|
import { UIConfig } from "./uiConfig.context.js";
|
|
3
|
+
import { CheckContent } from "./CheckContent.js";
|
|
4
4
|
import { FormField } from "./FormField.js";
|
|
5
5
|
import { radio, radioIndicatorClass, radioTypography } from "./radio.cva.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import clsx
|
|
7
|
+
import { clsx } from "clsx";
|
|
8
8
|
import { Radio, RadioGroup } from "react-aria-components";
|
|
9
9
|
import { mergeRefs } from "@react-aria/utils";
|
|
10
10
|
import { Controller } from "react-hook-form";
|
|
@@ -37,10 +37,10 @@ var RadioGroupBase = (props) => {
|
|
|
37
37
|
children: /* @__PURE__ */ jsx(FormField, {
|
|
38
38
|
...formFieldProps,
|
|
39
39
|
children: /* @__PURE__ */ jsx("div", {
|
|
40
|
-
className: clsx
|
|
40
|
+
className: clsx("flex flex-col", inputClassName),
|
|
41
41
|
children: options.map((option) => /* @__PURE__ */ jsxs(Radio, {
|
|
42
42
|
value: option.value,
|
|
43
|
-
className: radioIndicatorClass,
|
|
43
|
+
className: clsx("relative", radioIndicatorClass),
|
|
44
44
|
children: [/* @__PURE__ */ jsx("div", { className: radioCva({
|
|
45
45
|
variant,
|
|
46
46
|
...rest
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
+
import { UIStyle } from "./uiStyle.context.js";
|
|
1
2
|
import { BottomSheet } from "./BottomSheet.js";
|
|
2
3
|
import { useBreakpoint } from "./useBreakpoint.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { popover } from "./popover.cva.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { clsx } from "clsx";
|
|
7
7
|
import { Dialog, DialogTrigger, Popover } from "react-aria-components";
|
|
8
8
|
const ResponsivePopover = ({ trigger, isOpen, onOpenChange, children, popoverClassName, sheetLabel }) => {
|
|
9
|
+
const popoverCva = UIStyle.useConfig()?.popover?.cva ?? popover;
|
|
9
10
|
if (!useBreakpoint("md")) return /* @__PURE__ */ jsx(BottomSheet, {
|
|
10
11
|
isOpen,
|
|
11
12
|
onOpenChange,
|
|
12
13
|
trigger,
|
|
13
14
|
height: "auto",
|
|
14
15
|
isDismissable: true,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
rightContent: /* @__PURE__ */ jsx(FormFieldHeaderClose, { onClose: close }),
|
|
18
|
-
className: "px-4 pt-3"
|
|
19
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
16
|
+
label: sheetLabel,
|
|
17
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
20
18
|
className: "p-4",
|
|
21
19
|
children
|
|
22
|
-
})
|
|
20
|
+
})
|
|
23
21
|
});
|
|
24
22
|
return /* @__PURE__ */ jsxs(DialogTrigger, {
|
|
25
23
|
isOpen,
|
|
@@ -31,7 +29,7 @@ const ResponsivePopover = ({ trigger, isOpen, onOpenChange, children, popoverCla
|
|
|
31
29
|
children: /* @__PURE__ */ jsx(Dialog, {
|
|
32
30
|
className: "outline-none",
|
|
33
31
|
children: /* @__PURE__ */ jsx("div", {
|
|
34
|
-
className: clsx("overflow-hidden p-2
|
|
32
|
+
className: clsx(popoverCva({}), "overflow-hidden p-2"),
|
|
35
33
|
children
|
|
36
34
|
})
|
|
37
35
|
})
|
package/dist/SelectBase.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useBreakpoint } from "./useBreakpoint.js";
|
|
2
1
|
import { UIConfig } from "./uiConfig.context.js";
|
|
2
|
+
import { useBreakpoint } from "./useBreakpoint.js";
|
|
3
3
|
import { SelectContext } from "./select.context.js";
|
|
4
4
|
import { SelectDesktop } from "./SelectDesktop.js";
|
|
5
5
|
import { SelectMobile } from "./SelectMobile.js";
|
package/dist/SelectDesktop.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { UIStyle } from "./uiStyle.context.js";
|
|
2
|
+
import { popover } from "./popover.cva.js";
|
|
1
3
|
import { FormField } from "./FormField.js";
|
|
2
4
|
import { TooltipWrapper } from "./TooltipWrapper.js";
|
|
3
5
|
import { SelectAllItemId } from "./useSelectItems.js";
|
|
@@ -13,6 +15,7 @@ import { mergeRefs } from "@react-aria/utils";
|
|
|
13
15
|
import useMeasure from "react-use-measure";
|
|
14
16
|
const SelectDesktop = ({ ref, error, ignoreTriggerWidth, showSelectionContent, inputClassName, containerClassName, customTrigger, onBlur,...props }) => {
|
|
15
17
|
const { label, tooltipText, helperText, isRequired, rightContent, isHeaderHidden, headerClassName, errorClassName, placeholder, variant, isDisabled, className, hideLabel, hideDropdownIcon, isSearchable, isClearable, isLoading, as, size, collapseAfter, selectedTagsType } = props;
|
|
18
|
+
const popoverCva = UIStyle.useConfig()?.popover?.cva ?? popover;
|
|
16
19
|
const formFieldProps = {
|
|
17
20
|
error,
|
|
18
21
|
label,
|
|
@@ -137,7 +140,7 @@ const SelectDesktop = ({ ref, error, ignoreTriggerWidth, showSelectionContent, i
|
|
|
137
140
|
offset: 0,
|
|
138
141
|
children: /* @__PURE__ */ jsx(SelectListBox, {
|
|
139
142
|
...props,
|
|
140
|
-
className: "max-h-80!
|
|
143
|
+
className: clsx(popoverCva({}), "max-h-80! [scrollbar-width:thin]"),
|
|
141
144
|
autoFocus: !isSearchable
|
|
142
145
|
})
|
|
143
146
|
})]
|
package/dist/SelectInput.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ArrowDropDownIcon } from "./ArrowDropDown.js";
|
|
2
2
|
import { UIStyle } from "./uiStyle.context.js";
|
|
3
3
|
import { Typography } from "./Typography.js";
|
|
4
|
+
import { ns } from "./i18n.js";
|
|
4
5
|
import { inputBase, inputSide, inputSize } from "./input.cva.js";
|
|
5
6
|
import { FormFieldLabel } from "./FormFieldLabel.js";
|
|
6
|
-
import { ns } from "./i18n.js";
|
|
7
7
|
import { InputClear } from "./InputClear.js";
|
|
8
8
|
import { SelectInputTags } from "./SelectInputTags.js";
|
|
9
9
|
import { SelectContext } from "./select.context.js";
|
|
@@ -12,8 +12,8 @@ import { clsx } from "clsx";
|
|
|
12
12
|
import { Button, ComboBoxStateContext, Input } from "react-aria-components";
|
|
13
13
|
import { use, useMemo, useState } from "react";
|
|
14
14
|
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
15
|
-
import useMeasure from "react-use-measure";
|
|
16
15
|
import { useTranslation } from "react-i18next";
|
|
16
|
+
import useMeasure from "react-use-measure";
|
|
17
17
|
const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, onCloseComboBox, onBlur,...props }) => {
|
|
18
18
|
const uiStyle = UIStyle.useConfig();
|
|
19
19
|
const inputSizeCva = uiStyle?.input?.sizeCva ?? inputSize;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CheckboxCheckmark } from "./CheckboxCheckmark2.js";
|
|
2
1
|
import { ns } from "./i18n.js";
|
|
2
|
+
import { CheckboxCheckmark } from "./CheckboxCheckmark2.js";
|
|
3
3
|
import { SelectContext } from "./select.context.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { clsx } from "clsx";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CheckboxCheckmark } from "./CheckboxCheckmark2.js";
|
|
2
1
|
import { ns } from "./i18n.js";
|
|
2
|
+
import { CheckboxCheckmark } from "./CheckboxCheckmark2.js";
|
|
3
3
|
import { SelectContext } from "./select.context.js";
|
|
4
4
|
import { selectListBoxItemClass } from "./SelectListBoxItem.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/dist/SelectMobile.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BottomSheet } from "./BottomSheet.js";
|
|
2
2
|
import { FormFieldHeader } from "./FormFieldHeader.js";
|
|
3
|
-
import { FormFieldHeaderClose } from "./FormFieldHeaderClose.js";
|
|
4
3
|
import { FormField } from "./FormField.js";
|
|
5
4
|
import { SelectContext } from "./select.context.js";
|
|
6
5
|
import { SelectInput } from "./SelectInput.js";
|
|
7
6
|
import { SelectListBox } from "./SelectListBox.js";
|
|
7
|
+
import { FormFieldHeaderClose } from "./FormFieldHeaderClose.js";
|
|
8
8
|
import { TextInput } from "./TextInput.js";
|
|
9
9
|
import { SelectListBoxSelectionBar } from "./SelectListBoxSelectionBar.js";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/dist/Toggle.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UIStyle } from "./uiStyle.context.js";
|
|
2
|
+
import { UIConfig } from "./uiConfig.context.js";
|
|
2
3
|
import { FormFieldError } from "./FormFieldError.js";
|
|
3
4
|
import { CheckContent } from "./CheckContent.js";
|
|
4
|
-
import { UIConfig } from "./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";
|
package/dist/checkbox.cva.js
CHANGED
|
@@ -35,6 +35,7 @@ const checkbox = cva([
|
|
|
35
35
|
const checkboxIndicatorClass = "group flex items-center gap-2";
|
|
36
36
|
const checkboxTypography = compoundMapper({ default: {
|
|
37
37
|
size: "label-1",
|
|
38
|
+
sizeMobile: "label-1",
|
|
38
39
|
variant: "default"
|
|
39
40
|
} });
|
|
40
41
|
const checkboxIcon = cva(["absolute hidden size-3"], {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
2
|
import { Placement } from 'react-aria';
|
|
3
|
-
import { MenuItemProps } from 'react-aria-components';
|
|
3
|
+
import { Key, MenuItemProps } from 'react-aria-components';
|
|
4
4
|
import { MenuCvaVariantProps, MenuItemVariantProps, MenuPopoverVariantProps, MenuPopoverWrapperVariantProps } from './menu.cva';
|
|
5
5
|
export interface MenuItem extends Omit<MenuItemProps, "aria-label" | "textValue" | "children">, MenuItemVariantProps, MenuCvaVariantProps, MenuPopoverVariantProps, MenuPopoverWrapperVariantProps {
|
|
6
6
|
label: string;
|
|
@@ -16,6 +16,7 @@ interface DatePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<Da
|
|
|
16
16
|
disableManualEntry?: boolean;
|
|
17
17
|
placeholder?: string;
|
|
18
18
|
shouldUpdateDateOnMonthYearChange?: boolean;
|
|
19
|
+
inputClassName?: string;
|
|
19
20
|
}
|
|
20
21
|
export interface DatePickerProps extends Omit<DatePickerBaseProps, "value" | "onChange" | "minValue" | "maxValue"> {
|
|
21
22
|
value?: string | null;
|
|
@@ -17,6 +17,7 @@ interface DateRangePickerBaseProps extends FormFieldProps, InputVariantProps, Om
|
|
|
17
17
|
isDirty?: boolean;
|
|
18
18
|
disableManualEntry?: boolean;
|
|
19
19
|
placeholder?: string;
|
|
20
|
+
inputClassName?: string;
|
|
20
21
|
}
|
|
21
22
|
export interface DateRangePickerProps extends Omit<DateRangePickerBaseProps, "value" | "onChange" | "minValue" | "maxValue"> {
|
|
22
23
|
value?: {
|
|
@@ -16,6 +16,7 @@ interface DateTimePickerBaseProps extends FormFieldProps, InputVariantProps, Omi
|
|
|
16
16
|
disableManualEntry?: boolean;
|
|
17
17
|
placeholder?: string;
|
|
18
18
|
shouldUpdateDateOnMonthYearChange?: boolean;
|
|
19
|
+
inputClassName?: string;
|
|
19
20
|
}
|
|
20
21
|
export interface DateTimePickerProps extends Omit<DateTimePickerBaseProps, "value" | "onChange"> {
|
|
21
22
|
value?: string | null;
|
|
@@ -23,7 +23,8 @@ interface DatePickerInputProps extends InputVariantProps {
|
|
|
23
23
|
isRequired?: boolean;
|
|
24
24
|
disableManualEntry?: boolean;
|
|
25
25
|
placeholder?: string;
|
|
26
|
+
className?: string;
|
|
26
27
|
onOpenDropdown?: () => void;
|
|
27
28
|
}
|
|
28
|
-
export declare const DatePickerInput: ({ ref, as, groupProps, fieldProps, endFieldProps, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, isDirty, isRequired, disableManualEntry, placeholder, onOpenDropdown, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const DatePickerInput: ({ ref, as, groupProps, fieldProps, endFieldProps, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, isDirty, isRequired, disableManualEntry, placeholder, className, onOpenDropdown, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
30
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { TypographyVariantProps } from '../../text/Typography/typography.cva';
|
|
2
3
|
type BottomSheetState = "closed" | "opening" | "opened" | "closing";
|
|
3
4
|
interface BottomSheetBaseProps {
|
|
4
5
|
isOpen?: boolean;
|
|
@@ -6,6 +7,8 @@ interface BottomSheetBaseProps {
|
|
|
6
7
|
onStateChange?: (state: BottomSheetState) => void;
|
|
7
8
|
isDismissable?: boolean;
|
|
8
9
|
isScrollable?: boolean;
|
|
10
|
+
hideHeader?: boolean;
|
|
11
|
+
hideThumb?: boolean;
|
|
9
12
|
height?: "auto" | "full";
|
|
10
13
|
label?: string;
|
|
11
14
|
portalContainerRef?: RefObject<HTMLElement>;
|
|
@@ -13,8 +16,14 @@ interface BottomSheetBaseProps {
|
|
|
13
16
|
footer?: ReactNode;
|
|
14
17
|
sheetMarginTop?: number;
|
|
15
18
|
sheetMarginBottom?: number;
|
|
19
|
+
/** Min downward drag distance (px) to allow close on release. Increase to require a longer drag. */
|
|
20
|
+
closeDragThreshold?: number;
|
|
21
|
+
/** Min downward velocity to close on flick. Increase to require a more intentional swipe. */
|
|
22
|
+
closeVelocityThreshold?: number;
|
|
16
23
|
shouldCloseOnInteractOutside?: () => boolean;
|
|
17
24
|
containerClassName?: string;
|
|
25
|
+
overlayClassName?: string;
|
|
26
|
+
headerTypography?: TypographyVariantProps;
|
|
18
27
|
}
|
|
19
28
|
export interface BottomSheetProps extends BottomSheetBaseProps {
|
|
20
29
|
trigger?: ReactNode;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DragControls } from 'motion/react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { TypographyVariantProps } from '../../text/Typography/typography.cva';
|
|
4
|
+
export interface BottomSheetHeaderProps {
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
isDismissable?: boolean;
|
|
7
|
+
dragControls?: DragControls;
|
|
8
|
+
hideHeader?: boolean;
|
|
9
|
+
hideThumb?: boolean;
|
|
10
|
+
headerTypography?: TypographyVariantProps;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const BottomSheetHeader: ({ label, dragControls, isDismissable, hideThumb, hideHeader, headerTypography, onClose, }: BottomSheetHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,6 +8,7 @@ import { SelectBaseProps } from '../components/inputs/Selection/shared/SelectBas
|
|
|
8
8
|
import { SliderProps } from '../components/inputs/Slider/Slider';
|
|
9
9
|
import { ToggleProps } from '../components/inputs/Toggle/Toggle';
|
|
10
10
|
import { ActionModalProps } from '../components/overlays/ActionModal/ActionModal';
|
|
11
|
+
import { BottomSheetProps } from '../components/overlays/BottomSheet/BottomSheet';
|
|
11
12
|
export declare namespace UIConfig {
|
|
12
13
|
type DeepRequired<T> = {
|
|
13
14
|
[P in keyof T]-?: T[P] extends object ? DeepRequired<T[P]> : Exclude<T[P], null | undefined>;
|
|
@@ -22,6 +23,7 @@ export declare namespace UIConfig {
|
|
|
22
23
|
slider: Pick<SliderProps, "minValue" | "maxValue">;
|
|
23
24
|
dateInput: Pick<DatePickerProps, "todayIcon" | "shouldForceLeadingZeros" | "disableManualEntry" | "shouldUpdateDateOnMonthYearChange">;
|
|
24
25
|
actionModal: Pick<ActionModalProps, "titleTypography" | "descriptionTypography">;
|
|
26
|
+
bottomSheet: Pick<BottomSheetProps, "closeDragThreshold" | "closeVelocityThreshold" | "hideThumb" | "headerTypography">;
|
|
25
27
|
}
|
|
26
28
|
interface ProviderProps {
|
|
27
29
|
config?: Partial<Options>;
|
|
@@ -11,6 +11,7 @@ import { MenuCvaVariantProps, MenuItemVariantProps, MenuPopoverVariantProps, Men
|
|
|
11
11
|
import { ModalVariantProps } from '../components/overlays/Modal/modal.cva';
|
|
12
12
|
import { TooltipPointerHorizontalVariantProps, TooltipPointerVerticalVariantProps, TooltipTextVariantProps, TooltipVariantProps } from '../components/overlays/Tooltip/tooltip.cva';
|
|
13
13
|
import { SegmentItemVariantProps, SegmentVariantProps } from '../components/segment/segment.cva';
|
|
14
|
+
import { PopoverVariantProps } from '../components/shared/popover.cva';
|
|
14
15
|
import { AlertVariantProps } from '../components/status/Alert/alert.cva';
|
|
15
16
|
import { ToastVariantProps } from '../components/status/Toast/toast.cva';
|
|
16
17
|
import { TableDataVariantProps, TableHeadDataVariantProps, TableHeadRowVariantProps, TableRowVariantProps } from '../components/table/table.cva';
|
|
@@ -101,6 +102,9 @@ export declare namespace UIStyle {
|
|
|
101
102
|
cva?: Cva<SegmentVariantProps>;
|
|
102
103
|
itemCva?: Cva<SegmentItemVariantProps>;
|
|
103
104
|
};
|
|
105
|
+
popover: {
|
|
106
|
+
cva?: Cva<PopoverVariantProps>;
|
|
107
|
+
};
|
|
104
108
|
}
|
|
105
109
|
interface ProviderProps {
|
|
106
110
|
config?: Partial<Options>;
|
package/dist/index.js
CHANGED
|
@@ -50,6 +50,12 @@ import { InlineIconButton } from "./InlineIconButton.js";
|
|
|
50
50
|
import { PillButton } from "./PillButton.js";
|
|
51
51
|
import { MenuItem } from "./MenuItem.js";
|
|
52
52
|
import { MenuPopover } from "./MenuPopover.js";
|
|
53
|
+
import { ns, resources } from "./i18n.js";
|
|
54
|
+
import { ObjectUtils } from "./object.utils.js";
|
|
55
|
+
import { isEqual } from "./isEqual.js";
|
|
56
|
+
import { useDeepCompareEffect, useDeepCompareLayoutEffect, useDeepCompareMemo } from "./useDeepCompare.js";
|
|
57
|
+
import { UIConfig } from "./uiConfig.context.js";
|
|
58
|
+
import { useStateAndRef } from "./useStateAndRef.js";
|
|
53
59
|
import { DomUtils } from "./dom.utils.js";
|
|
54
60
|
import { BottomSheet } from "./BottomSheet.js";
|
|
55
61
|
import { useBreakpoint } from "./useBreakpoint.js";
|
|
@@ -57,14 +63,9 @@ import { Menu } from "./Menu2.js";
|
|
|
57
63
|
import { SplitButton } from "./SplitButton.js";
|
|
58
64
|
import { TextButton } from "./TextButton.js";
|
|
59
65
|
import { ToggleButton } from "./ToggleButton.js";
|
|
60
|
-
import { ObjectUtils } from "./object.utils.js";
|
|
61
|
-
import { isEqual } from "./isEqual.js";
|
|
62
|
-
import { useDeepCompareEffect, useDeepCompareLayoutEffect, useDeepCompareMemo } from "./useDeepCompare.js";
|
|
63
|
-
import { UIConfig } from "./uiConfig.context.js";
|
|
64
66
|
import { Checkbox } from "./Checkbox.js";
|
|
65
67
|
import { useLongPressRepeat } from "./useLongPressRepeat.js";
|
|
66
68
|
import { useScrollableListBox } from "./useScrollableListBox.js";
|
|
67
|
-
import { ns, resources } from "./i18n.js";
|
|
68
69
|
import { FormField } from "./FormField.js";
|
|
69
70
|
import { DateTimeUtils } from "./date-time.utils.js";
|
|
70
71
|
import { DatePicker } from "./DatePicker.js";
|
|
@@ -126,7 +127,6 @@ import { useForm } from "./useForm.js";
|
|
|
126
127
|
import { useFormAutosave } from "./useFormAutosave.js";
|
|
127
128
|
import { usePagination } from "./usePagination.js";
|
|
128
129
|
import { useSorting } from "./useSorting.js";
|
|
129
|
-
import { useStateAndRef } from "./useStateAndRef.js";
|
|
130
130
|
import { useTableColumnConfig } from "./useTableColumnConfig.js";
|
|
131
131
|
import { ArrayUtils } from "./array.utils.js";
|
|
132
132
|
import { QueriesUtils } from "./queries.utils.js";
|
package/dist/label.cva.js
CHANGED
|
@@ -58,6 +58,7 @@ const labelTypography = compoundMapper({
|
|
|
58
58
|
as: "default",
|
|
59
59
|
value: {
|
|
60
60
|
size: "label-2",
|
|
61
|
+
sizeMobile: "label-2",
|
|
61
62
|
variant: "prominent-1"
|
|
62
63
|
}
|
|
63
64
|
},
|
|
@@ -65,6 +66,7 @@ const labelTypography = compoundMapper({
|
|
|
65
66
|
as: "filter",
|
|
66
67
|
value: {
|
|
67
68
|
size: "label-1",
|
|
69
|
+
sizeMobile: "label-1",
|
|
68
70
|
variant: "default"
|
|
69
71
|
}
|
|
70
72
|
},
|
|
@@ -72,6 +74,7 @@ const labelTypography = compoundMapper({
|
|
|
72
74
|
as: "inline",
|
|
73
75
|
value: {
|
|
74
76
|
size: "label-2",
|
|
77
|
+
sizeMobile: "label-2",
|
|
75
78
|
variant: "prominent-1"
|
|
76
79
|
}
|
|
77
80
|
},
|
|
@@ -79,12 +82,14 @@ const labelTypography = compoundMapper({
|
|
|
79
82
|
as: "floating",
|
|
80
83
|
value: {
|
|
81
84
|
size: "label-1",
|
|
85
|
+
sizeMobile: "label-1",
|
|
82
86
|
variant: "default"
|
|
83
87
|
}
|
|
84
88
|
}
|
|
85
89
|
],
|
|
86
90
|
default: {
|
|
87
91
|
size: "label-2",
|
|
92
|
+
sizeMobile: "label-2",
|
|
88
93
|
variant: "prominent-1"
|
|
89
94
|
},
|
|
90
95
|
defaultVariants: { as: "default" }
|
package/dist/radio.cva.js
CHANGED
|
@@ -37,6 +37,7 @@ const radio = cva([
|
|
|
37
37
|
const radioIndicatorClass = "group flex items-center gap-2";
|
|
38
38
|
const radioTypography = compoundMapper({ default: {
|
|
39
39
|
size: "label-1",
|
|
40
|
+
sizeMobile: "label-1",
|
|
40
41
|
variant: "default"
|
|
41
42
|
} });
|
|
42
43
|
export { radio, radioIndicatorClass, radioTypography };
|
package/dist/toggle.cva.js
CHANGED
package/dist/uiConfig.context.js
CHANGED
|
@@ -44,6 +44,15 @@ let UIConfig;
|
|
|
44
44
|
variant: "prominent-1"
|
|
45
45
|
},
|
|
46
46
|
descriptionTypography: { size: "body-3" }
|
|
47
|
+
},
|
|
48
|
+
bottomSheet: {
|
|
49
|
+
closeDragThreshold: 100,
|
|
50
|
+
closeVelocityThreshold: 200,
|
|
51
|
+
hideThumb: false,
|
|
52
|
+
headerTypography: {
|
|
53
|
+
size: "label-2",
|
|
54
|
+
variant: "prominent-1"
|
|
55
|
+
}
|
|
47
56
|
}
|
|
48
57
|
};
|
|
49
58
|
const Context = createContext(DEFAULT_CONFIG);
|