@povio/ui 2.3.0-rc.39 → 2.3.0-rc.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/inputs/Checkbox/Checkbox.js +50 -45
- package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +25 -6
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +31 -7
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +18 -5
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +97 -68
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +131 -136
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +39 -37
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +9 -1
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +43 -7
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +16 -8
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +43 -40
- package/dist/components/inputs/File/InputUpload.js +1 -1
- package/dist/components/inputs/File/shared/InputUploadFilled.js +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +103 -97
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +2 -2
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +52 -29
- package/dist/components/inputs/Input/TextArea/TextArea.js +2 -2
- package/dist/components/inputs/Input/TextInput/TextInput.js +2 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +29 -43
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +1 -0
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +2 -2
- package/dist/components/inputs/Selection/Select/QuerySelect.js +45 -63
- package/dist/components/inputs/Selection/Select/Select.js +1 -0
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +54 -53
- package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -2
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +12 -1
- package/dist/components/inputs/Selection/shared/select.context.js +3 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +1 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +100 -92
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +170 -156
- package/dist/components/inputs/TextEditor/TextEditor.js +1 -1
- package/dist/components/inputs/Toggle/Toggle.js +70 -64
- package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
- package/dist/components/inputs/shared/InputClear.js +71 -61
- package/dist/components/inputs/shared/input.cva.js +22 -10
- package/dist/components/inputs/shared/label.cva.js +2 -2
- package/dist/components/overlays/BottomSheet/BottomSheet.js +26 -2
- package/dist/config/uiConfig.context.d.ts +3 -1
- package/dist/config/uiConfig.context.js +2 -1
- package/dist/tw-ui-plugin.js +6 -1
- package/dist/utils/date-time.utils.d.ts +5 -0
- package/dist/utils/date-time.utils.js +10 -0
- package/dist/utils/dom.utils.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CloseIcon } from "../../../assets/icons/Close.js";
|
|
2
|
+
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
2
3
|
import { InlineIconButton } from "../../buttons/InlineIconButton/InlineIconButton.js";
|
|
3
4
|
import "../../../config/i18n.js";
|
|
4
5
|
import { c } from "react/compiler-runtime";
|
|
@@ -7,84 +8,93 @@ import { clsx } from "clsx";
|
|
|
7
8
|
import { useTranslation } from "react-i18next";
|
|
8
9
|
//#region src/components/inputs/shared/InputClear.tsx
|
|
9
10
|
var InputClear = (t0) => {
|
|
10
|
-
const $ = c(
|
|
11
|
+
const $ = c(12);
|
|
11
12
|
const { onClear, className, style, show, renderStatic } = t0;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let t2;
|
|
15
|
-
if ($[0] !== className || $[1] !== t1) {
|
|
16
|
-
t2 = clsx("invisible relative z-1 flex items-center size-6 shrink-0", "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!", t1, className);
|
|
17
|
-
$[0] = className;
|
|
18
|
-
$[1] = t1;
|
|
19
|
-
$[2] = t2;
|
|
20
|
-
} else t2 = $[2];
|
|
21
|
-
let t3;
|
|
22
|
-
if ($[3] !== style || $[4] !== t2) {
|
|
23
|
-
t3 = /* @__PURE__ */ jsx("button", {
|
|
24
|
-
className: t2,
|
|
25
|
-
style
|
|
26
|
-
});
|
|
27
|
-
$[3] = style;
|
|
28
|
-
$[4] = t2;
|
|
29
|
-
$[5] = t3;
|
|
30
|
-
} else t3 = $[5];
|
|
31
|
-
return t3;
|
|
32
|
-
}
|
|
13
|
+
const alwaysShowClear = UIConfig.useConfig().input.alwaysShowClear;
|
|
14
|
+
let clearClassName;
|
|
33
15
|
let t1;
|
|
34
|
-
if ($[
|
|
35
|
-
t1 =
|
|
16
|
+
if ($[0] !== alwaysShowClear || $[1] !== className || $[2] !== renderStatic || $[3] !== show || $[4] !== style) {
|
|
17
|
+
t1 = Symbol.for("react.early_return_sentinel");
|
|
18
|
+
bb0: {
|
|
19
|
+
clearClassName = clsx("relative z-1 flex items-center", !alwaysShowClear && "md:invisible 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);
|
|
20
|
+
if (renderStatic) {
|
|
21
|
+
let t2;
|
|
22
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
23
|
+
t2 = /* @__PURE__ */ jsx(CloseIcon, { className: "h-6 w-6 shrink-0" });
|
|
24
|
+
$[7] = t2;
|
|
25
|
+
} else t2 = $[7];
|
|
26
|
+
t1 = /* @__PURE__ */ jsx("button", {
|
|
27
|
+
type: "button",
|
|
28
|
+
"aria-hidden": "true",
|
|
29
|
+
tabIndex: -1,
|
|
30
|
+
className: clsx("group inline-flex items-center justify-center border border-solid border-support-transparent-outline", "rounded-button-rounding-s p-0 text-interactive-text-secondary-idle", clearClassName),
|
|
31
|
+
style,
|
|
32
|
+
children: t2
|
|
33
|
+
});
|
|
34
|
+
break bb0;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
$[0] = alwaysShowClear;
|
|
38
|
+
$[1] = className;
|
|
39
|
+
$[2] = renderStatic;
|
|
40
|
+
$[3] = show;
|
|
41
|
+
$[4] = style;
|
|
42
|
+
$[5] = clearClassName;
|
|
43
|
+
$[6] = t1;
|
|
44
|
+
} else {
|
|
45
|
+
clearClassName = $[5];
|
|
46
|
+
t1 = $[6];
|
|
47
|
+
}
|
|
48
|
+
if (t1 !== Symbol.for("react.early_return_sentinel")) return t1;
|
|
49
|
+
let t2;
|
|
50
|
+
if ($[8] !== clearClassName || $[9] !== onClear || $[10] !== style) {
|
|
51
|
+
t2 = /* @__PURE__ */ jsx(InputClearButton, {
|
|
36
52
|
onClear,
|
|
37
|
-
className,
|
|
38
|
-
style
|
|
39
|
-
show
|
|
53
|
+
className: clearClassName,
|
|
54
|
+
style
|
|
40
55
|
});
|
|
41
|
-
$[
|
|
42
|
-
$[
|
|
43
|
-
$[
|
|
44
|
-
$[
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return t1;
|
|
56
|
+
$[8] = clearClassName;
|
|
57
|
+
$[9] = onClear;
|
|
58
|
+
$[10] = style;
|
|
59
|
+
$[11] = t2;
|
|
60
|
+
} else t2 = $[11];
|
|
61
|
+
return t2;
|
|
48
62
|
};
|
|
49
63
|
var InputClearButton = (t0) => {
|
|
50
|
-
const $ = c(
|
|
51
|
-
const { onClear, className, style
|
|
64
|
+
const $ = c(7);
|
|
65
|
+
const { onClear, className, style } = t0;
|
|
52
66
|
const { t } = useTranslation("ui");
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
$[0] = className;
|
|
67
|
+
let t1;
|
|
68
|
+
if ($[0] !== t) {
|
|
69
|
+
t1 = t(_temp);
|
|
70
|
+
$[0] = t;
|
|
58
71
|
$[1] = t1;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
t3 = t(_temp);
|
|
64
|
-
$[3] = t;
|
|
65
|
-
$[4] = t3;
|
|
66
|
-
} else t3 = $[4];
|
|
67
|
-
let t4;
|
|
68
|
-
if ($[5] !== onClear || $[6] !== style || $[7] !== t2 || $[8] !== t3) {
|
|
69
|
-
t4 = /* @__PURE__ */ jsx(InlineIconButton, {
|
|
72
|
+
} else t1 = $[1];
|
|
73
|
+
let t2;
|
|
74
|
+
if ($[2] !== className || $[3] !== onClear || $[4] !== style || $[5] !== t1) {
|
|
75
|
+
t2 = /* @__PURE__ */ jsx(InlineIconButton, {
|
|
70
76
|
color: "secondary",
|
|
71
|
-
className
|
|
72
|
-
label:
|
|
77
|
+
className,
|
|
78
|
+
label: t1,
|
|
73
79
|
icon: CloseIcon,
|
|
74
80
|
onPress: onClear,
|
|
81
|
+
onMouseDown: _temp2,
|
|
75
82
|
excludeFromTabOrder: true,
|
|
76
83
|
style
|
|
77
84
|
});
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
} else
|
|
84
|
-
return
|
|
85
|
+
$[2] = className;
|
|
86
|
+
$[3] = onClear;
|
|
87
|
+
$[4] = style;
|
|
88
|
+
$[5] = t1;
|
|
89
|
+
$[6] = t2;
|
|
90
|
+
} else t2 = $[6];
|
|
91
|
+
return t2;
|
|
85
92
|
};
|
|
86
93
|
function _temp($) {
|
|
87
94
|
return $.ui.clearAlt;
|
|
88
95
|
}
|
|
96
|
+
function _temp2(e) {
|
|
97
|
+
return e.preventDefault();
|
|
98
|
+
}
|
|
89
99
|
//#endregion
|
|
90
100
|
export { InputClear };
|
|
@@ -36,9 +36,11 @@ var inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
36
36
|
"focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-active focus-within:text-text-default-1",
|
|
37
37
|
"invalid:border-input-outlined-outline-error invalid:border-solid invalid:bg-input-outlined-error invalid:text-text-default-1",
|
|
38
38
|
"has-invalid:border-input-outlined-outline-error has-invalid:border-solid has-invalid:bg-input-outlined-error has-invalid:text-text-default-1",
|
|
39
|
-
"disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-
|
|
40
|
-
"has-disabled:border-input-outlined-outline-disabled has-disabled:border-solid has-disabled:bg-input-outlined-disabled has-disabled:text-text-default-
|
|
39
|
+
"disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-3",
|
|
40
|
+
"has-disabled:border-input-outlined-outline-disabled has-disabled:border-solid has-disabled:bg-input-outlined-disabled has-disabled:text-text-default-3",
|
|
41
41
|
"placeholder:text-text-default-3",
|
|
42
|
+
"disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
43
|
+
"has-disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
42
44
|
"focus-visible:outline-interactive-contained-primary-focus",
|
|
43
45
|
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
44
46
|
]
|
|
@@ -52,9 +54,11 @@ var inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
52
54
|
"focus-within:border-input-filled-outline-active focus-within:border-solid focus-within:bg-input-filled-active focus-within:text-text-default-1",
|
|
53
55
|
"invalid:border-input-filled-outline-error invalid:border-solid invalid:bg-input-filled-error invalid:text-text-default-1",
|
|
54
56
|
"has-invalid:border-input-filled-outline-error has-invalid:border-solid has-invalid:bg-input-filled-error has-invalid:text-text-default-1",
|
|
55
|
-
"disabled:bg-input-filled-disabled disabled:text-text-default-
|
|
56
|
-
"has-disabled:bg-input-filled-disabled has-disabled:text-text-default-
|
|
57
|
+
"disabled:bg-input-filled-disabled disabled:text-text-default-3",
|
|
58
|
+
"has-disabled:bg-input-filled-disabled has-disabled:text-text-default-3",
|
|
57
59
|
"placeholder:text-text-default-3",
|
|
60
|
+
"disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
61
|
+
"has-disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
58
62
|
"focus-visible:outline-interactive-contained-primary-focus",
|
|
59
63
|
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
60
64
|
]
|
|
@@ -68,9 +72,11 @@ var inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
68
72
|
"focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-active focus-within:text-text-default-1",
|
|
69
73
|
"invalid:border-input-outlined-outline-error invalid:border-solid invalid:bg-input-outlined-error invalid:text-text-default-1",
|
|
70
74
|
"has-invalid:border-input-outlined-outline-error has-invalid:border-solid has-invalid:bg-input-outlined-error has-invalid:text-text-default-1",
|
|
71
|
-
"disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-
|
|
72
|
-
"has-disabled:border-input-outlined-outline-disabled has-disabled:border-solid has-disabled:bg-input-outlined-disabled has-disabled:text-text-default-
|
|
75
|
+
"disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-3",
|
|
76
|
+
"has-disabled:border-input-outlined-outline-disabled has-disabled:border-solid has-disabled:bg-input-outlined-disabled has-disabled:text-text-default-3",
|
|
73
77
|
"placeholder:text-text-default-3",
|
|
78
|
+
"disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
79
|
+
"has-disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
74
80
|
"focus-visible:outline-interactive-contained-primary-focus",
|
|
75
81
|
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
76
82
|
]
|
|
@@ -84,9 +90,11 @@ var inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
84
90
|
"focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-idle focus-within:text-text-default-1",
|
|
85
91
|
"invalid:border-input-filled-outline-error invalid:border-solid invalid:bg-input-filled-error invalid:text-text-default-1",
|
|
86
92
|
"has-invalid:border-input-filled-outline-error has-invalid:border-solid has-invalid:bg-input-filled-error has-invalid:text-text-default-1",
|
|
87
|
-
"disabled:bg-input-filled-disabled disabled:text-text-default-
|
|
88
|
-
"has-disabled:bg-input-filled-disabled has-disabled:text-text-default-
|
|
93
|
+
"disabled:bg-input-filled-disabled disabled:text-text-default-3",
|
|
94
|
+
"has-disabled:bg-input-filled-disabled has-disabled:text-text-default-3",
|
|
89
95
|
"placeholder:text-text-default-3",
|
|
96
|
+
"disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
97
|
+
"has-disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
90
98
|
"focus-visible:outline-interactive-contained-primary-focus",
|
|
91
99
|
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
92
100
|
]
|
|
@@ -100,9 +108,11 @@ var inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
100
108
|
"focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-active focus-within:text-text-default-1",
|
|
101
109
|
"invalid:border-input-outlined-outline-error invalid:border-solid invalid:bg-input-outlined-error invalid:text-text-default-1",
|
|
102
110
|
"has-invalid:border-input-outlined-outline-error has-invalid:border-solid has-invalid:bg-input-outlined-error has-invalid:text-text-default-1",
|
|
103
|
-
"disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-
|
|
104
|
-
"has-disabled:border-input-outlined-outline-disabled has-disabled:border-solid has-disabled:bg-input-outlined-disabled has-disabled:text-text-default-
|
|
111
|
+
"disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-3",
|
|
112
|
+
"has-disabled:border-input-outlined-outline-disabled has-disabled:border-solid has-disabled:bg-input-outlined-disabled has-disabled:text-text-default-3",
|
|
105
113
|
"placeholder:text-text-default-3",
|
|
114
|
+
"disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
115
|
+
"has-disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
106
116
|
"focus-visible:outline-interactive-contained-primary-focus",
|
|
107
117
|
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
108
118
|
]
|
|
@@ -119,6 +129,8 @@ var inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
119
129
|
"disabled:bg-input-filled-disabled disabled:text-text-default-1",
|
|
120
130
|
"has-disabled:bg-input-filled-disabled has-disabled:text-text-default-1",
|
|
121
131
|
"placeholder:text-text-default-3",
|
|
132
|
+
"disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
133
|
+
"has-disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
122
134
|
"focus-visible:outline-interactive-contained-primary-focus",
|
|
123
135
|
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
124
136
|
]
|
|
@@ -3,8 +3,8 @@ import { cva } from "class-variance-authority";
|
|
|
3
3
|
//#region src/components/inputs/shared/label.cva.ts
|
|
4
4
|
var labelBase = cva("", {
|
|
5
5
|
variants: { as: {
|
|
6
|
-
default: ["flex items-start gap-1 text-text-default-1"],
|
|
7
|
-
filter: ["text-text-default-1"],
|
|
6
|
+
default: ["flex items-start gap-1 text-text-default-1 input-disabled:text-text-default-3"],
|
|
7
|
+
filter: ["text-text-default-1 input-disabled:text-text-default-3"],
|
|
8
8
|
inline: ["flex items-start gap-1 text-text-default-1"],
|
|
9
9
|
floating: [
|
|
10
10
|
"pointer-events-none",
|
|
@@ -27,6 +27,7 @@ var staticTransition = {
|
|
|
27
27
|
1
|
|
28
28
|
]
|
|
29
29
|
};
|
|
30
|
+
var KEYBOARD_INSET_THRESHOLD = 48;
|
|
30
31
|
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 }) => {
|
|
31
32
|
const uiConfig = UIConfig.useConfig();
|
|
32
33
|
const closeDragThreshold = closeDragThresholdProp ?? uiConfig.bottomSheet.closeDragThreshold;
|
|
@@ -49,6 +50,27 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = tr
|
|
|
49
50
|
const focusTrapRef = useRef(null);
|
|
50
51
|
const [footerElement, footerRef, setFooterElement] = useStateAndRef(null);
|
|
51
52
|
const [footerHeight, setFooterHeight] = useState(0);
|
|
53
|
+
const [keyboardInset, setKeyboardInset] = useState(0);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (!isOpen) {
|
|
56
|
+
setKeyboardInset(0);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const vv = window.visualViewport;
|
|
60
|
+
if (!vv) return;
|
|
61
|
+
const update = () => {
|
|
62
|
+
const naturalHeight = vv.height * Math.max(vv.scale, 1);
|
|
63
|
+
const next = Math.max(0, window.innerHeight - naturalHeight);
|
|
64
|
+
setKeyboardInset(next > KEYBOARD_INSET_THRESHOLD ? Math.round(next) : 0);
|
|
65
|
+
};
|
|
66
|
+
update();
|
|
67
|
+
vv.addEventListener("resize", update);
|
|
68
|
+
vv.addEventListener("scroll", update);
|
|
69
|
+
return () => {
|
|
70
|
+
vv.removeEventListener("resize", update);
|
|
71
|
+
vv.removeEventListener("scroll", update);
|
|
72
|
+
};
|
|
73
|
+
}, [isOpen]);
|
|
52
74
|
useEffect(() => {
|
|
53
75
|
if (!footerElement) return;
|
|
54
76
|
const onResize = () => {
|
|
@@ -78,6 +100,7 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = tr
|
|
|
78
100
|
isOpen: true,
|
|
79
101
|
UNSTABLE_portalContainer: portalContainerRef?.current,
|
|
80
102
|
className: clsx("fixed top-0 left-0 z-10 w-screen h-dvh", containerClassName),
|
|
103
|
+
style: { "--bottom-sheet-keyboard-inset": `${keyboardInset}px` },
|
|
81
104
|
onOpenChange,
|
|
82
105
|
isDismissable,
|
|
83
106
|
ref: overlayRef,
|
|
@@ -111,7 +134,8 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = tr
|
|
|
111
134
|
transition: staticTransition,
|
|
112
135
|
style: {
|
|
113
136
|
y,
|
|
114
|
-
|
|
137
|
+
height: "calc(100dvh - var(--bottom-sheet-keyboard-inset, 0px))",
|
|
138
|
+
minHeight: "calc(100dvh - var(--bottom-sheet-keyboard-inset, 0px))"
|
|
115
139
|
},
|
|
116
140
|
drag: "y",
|
|
117
141
|
dragListener: false,
|
|
@@ -189,7 +213,7 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = tr
|
|
|
189
213
|
initial: { opacity: 0 },
|
|
190
214
|
exit: { opacity: 0 },
|
|
191
215
|
ref: setFooterElement,
|
|
192
|
-
className: clsx("pointer-events-auto absolute z-50 w-full bg-elevation-fill-default-2", "top-[100dvh] left-0 translate-y-[calc(-100%-var(--scroll-position,
|
|
216
|
+
className: clsx("pointer-events-auto absolute z-50 w-full bg-elevation-fill-default-2", "top-[calc(100dvh-var(--bottom-sheet-keyboard-inset,0))] left-0 translate-y-[calc(-100%-var(--scroll-position,0))]"),
|
|
193
217
|
children: footer
|
|
194
218
|
})
|
|
195
219
|
] })
|
|
@@ -20,7 +20,9 @@ export declare namespace UIConfig {
|
|
|
20
20
|
};
|
|
21
21
|
export interface Options {
|
|
22
22
|
renderStaticInput: boolean;
|
|
23
|
-
input: Pick<TextInputProps, "variant" | "isClearable" | "hideLabel" | "as" | "size"
|
|
23
|
+
input: Pick<TextInputProps, "variant" | "isClearable" | "hideLabel" | "as" | "size"> & {
|
|
24
|
+
alwaysShowClear?: boolean;
|
|
25
|
+
};
|
|
24
26
|
button: Pick<ButtonProps, "variant" | "size">;
|
|
25
27
|
numberInput: Pick<NumberInputProps, "formatOptions">;
|
|
26
28
|
radioGroup: Pick<RadioGroupProps, "variant" | "hideLabel" | "fireBlurOnChange">;
|
package/dist/tw-ui-plugin.js
CHANGED
|
@@ -13,12 +13,17 @@ var uiPlugin = plugin(({ addVariant }) => {
|
|
|
13
13
|
].join(", "));
|
|
14
14
|
addVariant("input-disabled", [
|
|
15
15
|
"&:is(:where(.group\\/input-content):has(*:is(input:disabled)) *)",
|
|
16
|
+
"&:is(:where(.group):has(*:is(input:disabled)) *)",
|
|
16
17
|
"&:is(:where(.group\\/select-content)[data-disabled] *)",
|
|
17
18
|
"&:is(:where(.group\\/select-content):has(*:is(input:disabled)) *)",
|
|
19
|
+
"&:is(:where(.group):has([data-disabled]) *)",
|
|
18
20
|
"&:is(:where(.group\\/radio-group-content)[data-disabled] *)",
|
|
19
21
|
"&:is(:where(.group\\/text-area):has(*:is(textarea:disabled)) *)",
|
|
22
|
+
"&:is(:where(.group):has(*:is(textarea:disabled)) *)",
|
|
20
23
|
"&:is(:where(.group\\/text-editor):where([data-rac])[data-disabled] *)",
|
|
21
|
-
"&:is(:where(.group
|
|
24
|
+
"&:is(:where(.group):where([data-rac])[data-disabled] *)",
|
|
25
|
+
"&:is(:where(.group\\/date-picker-content):where([data-rac])[data-disabled] *)",
|
|
26
|
+
"&:is(:where(.group):where([data-rac])[data-disabled] *)"
|
|
22
27
|
].join(", "));
|
|
23
28
|
});
|
|
24
29
|
//#endregion
|
|
@@ -15,10 +15,15 @@ export declare namespace DateTimeUtils {
|
|
|
15
15
|
export function getDateRangePlaceholder(locale?: string, options?: LocalizedDateFormatOptions): string;
|
|
16
16
|
export function formatCalendarDateLocalized(calendarDate: CalendarDate, locale?: string, options?: LocalizedDateFormatOptions): string;
|
|
17
17
|
export function formatCalendarDatePartsLocalized(calendarDate?: CalendarDate | null, locale?: string, options?: LocalizedDateFormatOptions): LocalizedDatePart[];
|
|
18
|
+
export function formatCalendarDateTimePartsLocalized(calendarDateTime?: Pick<CalendarDateTime, "day" | "month" | "year" | "hour" | "minute"> | null, locale?: string, options?: LocalizedDateFormatOptions): LocalizedDatePart[];
|
|
18
19
|
export function formatTimeLocalized(timeValue: {
|
|
19
20
|
hour: number;
|
|
20
21
|
minute: number;
|
|
21
22
|
}, locale?: string): string;
|
|
23
|
+
export function formatTimePartsLocalized(timeValue?: {
|
|
24
|
+
hour: number;
|
|
25
|
+
minute: number;
|
|
26
|
+
} | null, locale?: string): LocalizedDatePart[];
|
|
22
27
|
export function formatCalendarDateTimeLocalized(calendarDateTime: Pick<CalendarDateTime, "day" | "month" | "year" | "hour" | "minute">, locale?: string, options?: LocalizedDateFormatOptions): string;
|
|
23
28
|
export function fromISOtoZonedDateTime(isoString: string, timeZone?: string): ZonedDateTime;
|
|
24
29
|
export function fromDateValueToISO(dateValue: DateValue, timeZone?: string): string;
|
|
@@ -110,11 +110,21 @@ var DateTimeUtils;
|
|
|
110
110
|
return formatLocalizedDatePartList(getDateFormatter(locale, options), calendarDate?.toDate("UTC") ?? DATE_SAMPLE_DATE_UTC, !calendarDate);
|
|
111
111
|
}
|
|
112
112
|
_DateTimeUtils.formatCalendarDatePartsLocalized = formatCalendarDatePartsLocalized;
|
|
113
|
+
function formatCalendarDateTimePartsLocalized(calendarDateTime, locale, options) {
|
|
114
|
+
const normalizedValue = calendarDateTime ? new CalendarDateTime(calendarDateTime.year, calendarDateTime.month, calendarDateTime.day, calendarDateTime.hour, calendarDateTime.minute) : null;
|
|
115
|
+
return formatLocalizedDatePartList(getDateTimeFormatter(locale, options), normalizedValue?.toDate("UTC") ?? TIME_SAMPLE_DATE_UTC, !calendarDateTime);
|
|
116
|
+
}
|
|
117
|
+
_DateTimeUtils.formatCalendarDateTimePartsLocalized = formatCalendarDateTimePartsLocalized;
|
|
113
118
|
function formatTimeLocalized(timeValue, locale) {
|
|
114
119
|
const dateTime = new CalendarDateTime(2e3, 11, 22, timeValue.hour, timeValue.minute);
|
|
115
120
|
return getTimeFormatter(locale).format(dateTime.toDate("UTC"));
|
|
116
121
|
}
|
|
117
122
|
_DateTimeUtils.formatTimeLocalized = formatTimeLocalized;
|
|
123
|
+
function formatTimePartsLocalized(timeValue, locale) {
|
|
124
|
+
const normalizedValue = new CalendarDateTime(2e3, 11, 22, timeValue?.hour ?? 6, timeValue?.minute ?? 45);
|
|
125
|
+
return formatLocalizedDatePartList(getTimeFormatter(locale), normalizedValue.toDate("UTC"), !timeValue);
|
|
126
|
+
}
|
|
127
|
+
_DateTimeUtils.formatTimePartsLocalized = formatTimePartsLocalized;
|
|
118
128
|
function formatCalendarDateTimeLocalized(calendarDateTime, locale, options) {
|
|
119
129
|
const normalizedValue = new CalendarDateTime(calendarDateTime.year, calendarDateTime.month, calendarDateTime.day, calendarDateTime.hour, calendarDateTime.minute);
|
|
120
130
|
return formatLocalizedDateParts(getDateTimeFormatter(locale, options), normalizedValue.toDate("UTC"));
|
package/dist/utils/dom.utils.js
CHANGED
|
@@ -9,7 +9,7 @@ var DomUtils;
|
|
|
9
9
|
"image"
|
|
10
10
|
]);
|
|
11
11
|
_DomUtils.isKeyboardInput = (elem) => {
|
|
12
|
-
return elem.tagName === "INPUT" && !KEYBOARD_INPUTS.has(elem.type) || elem.hasAttribute("contenteditable");
|
|
12
|
+
return elem.tagName === "INPUT" && !KEYBOARD_INPUTS.has(elem.type) || elem.tagName === "TEXTAREA" || elem.hasAttribute("contenteditable");
|
|
13
13
|
};
|
|
14
14
|
_DomUtils.isKeyboardEvent = (event) => {
|
|
15
15
|
return event.nativeEvent instanceof KeyboardEvent;
|