@povio/ui 2.1.19 → 2.1.21
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/BottomSheet.js +5 -5
- package/dist/DatePickerInput.js +18 -5
- package/dist/DateTimeDialog.js +1 -1
- package/dist/InfiniteTable.js +2 -7
- package/dist/InputContent.js +1 -1
- package/dist/SelectInput.js +9 -5
- package/dist/SelectListBox.js +2 -2
- package/dist/SelectListBoxLoadingItem.js +2 -7
- package/dist/SelectMobile.js +4 -4
- package/dist/Table.js +28 -18
- package/dist/TextInput.js +1 -1
- package/dist/TimePickerInput.js +18 -5
- package/dist/components/inputs/shared/input.cva.d.ts +1 -0
- package/dist/components/overlays/BottomSheet/BottomSheet.d.ts +1 -0
- package/dist/hooks/useIntersectionObserver.d.ts +3 -2
- package/dist/input.cva.js +72 -13
- package/dist/label.cva.js +26 -38
- package/dist/table.cva.js +1 -1
- package/dist/useIntersectionObserver.js +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ This is required for buttons to behave as expected. It is based on [Tailwind Upg
|
|
|
32
32
|
In order for Tailwind to also compile classes for @povio/ui package, you need to include @source directive in Tailwind config.
|
|
33
33
|
In your globals.css add (make sure path is correct):
|
|
34
34
|
```css
|
|
35
|
-
@source "
|
|
35
|
+
@source "../../../../node_modules/@povio/ui/dist";
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
### React Aria
|
package/dist/BottomSheet.js
CHANGED
|
@@ -22,7 +22,7 @@ var staticTransition = {
|
|
|
22
22
|
1
|
|
23
23
|
]
|
|
24
24
|
};
|
|
25
|
-
var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = false, isScrollable = true, height = "full", label, portalContainerRef, children, footer, sheetMarginTop = 96, sheetMarginBottom = 128, shouldCloseOnInteractOutside }) => {
|
|
25
|
+
var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = false, isScrollable = true, height = "full", label, portalContainerRef, children, footer, sheetMarginTop = 96, sheetMarginBottom = 128, shouldCloseOnInteractOutside, containerClassName }) => {
|
|
26
26
|
const viewport = useViewportSize();
|
|
27
27
|
const { sheetHeight, windowHeight } = useMemo(() => {
|
|
28
28
|
return {
|
|
@@ -60,7 +60,7 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = fa
|
|
|
60
60
|
return /* @__PURE__ */ jsx(react_exports.AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxs(MotionModalOverlay, {
|
|
61
61
|
isOpen: true,
|
|
62
62
|
UNSTABLE_portalContainer: portalContainerRef?.current,
|
|
63
|
-
className: "fixed top-0 left-0 z-10 w-screen",
|
|
63
|
+
className: clsx("fixed top-0 left-0 z-10 w-screen", containerClassName),
|
|
64
64
|
onOpenChange,
|
|
65
65
|
isDismissable,
|
|
66
66
|
style: { height: viewport.height },
|
|
@@ -73,7 +73,7 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = fa
|
|
|
73
73
|
exit: { opacity: 0 }
|
|
74
74
|
}), /* @__PURE__ */ jsx(MotionModal, {
|
|
75
75
|
isDismissable: true,
|
|
76
|
-
className: clsx("pointer-events-none flex w-full flex-col items-stretch justify-end outline-none will-change-transform"
|
|
76
|
+
className: clsx("pointer-events-none flex h-full w-full flex-col items-stretch justify-end outline-none will-change-transform"),
|
|
77
77
|
animate: {
|
|
78
78
|
y: 0,
|
|
79
79
|
opacity: 1
|
|
@@ -143,13 +143,13 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = fa
|
|
|
143
143
|
tabIndex: -1
|
|
144
144
|
}),
|
|
145
145
|
/* @__PURE__ */ jsx("div", {
|
|
146
|
-
className:
|
|
146
|
+
className: "flex max-h-full min-h-0 flex-col items-stretch",
|
|
147
147
|
ref: containerRef,
|
|
148
148
|
children: typeof children === "function" ? children(close) : children
|
|
149
149
|
}),
|
|
150
150
|
/* @__PURE__ */ jsx("div", {
|
|
151
151
|
className: "shrink-0",
|
|
152
|
-
style: { height: `${footerHeight + sheetMarginBottom}px` }
|
|
152
|
+
style: { height: `${footerHeight + (isScrollable ? 0 : sheetMarginBottom)}px` }
|
|
153
153
|
}),
|
|
154
154
|
/* @__PURE__ */ jsx("div", { className: "absolute top-full h-screen w-full bg-elevation-fill-default-1" })
|
|
155
155
|
]
|
package/dist/DatePickerInput.js
CHANGED
|
@@ -34,6 +34,7 @@ const DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, butto
|
|
|
34
34
|
const endDateFieldRef = useRef(null);
|
|
35
35
|
const containerRef = useRef(null);
|
|
36
36
|
const [labelContentRef, { width: labelWidth }] = useMeasure();
|
|
37
|
+
const [trailingContentRef, { width: trailingWidth }] = useMeasure();
|
|
37
38
|
useImperativeHandle(ref, () => ({
|
|
38
39
|
clear: () => {
|
|
39
40
|
dateFieldRef.current?.clearField();
|
|
@@ -66,12 +67,19 @@ const DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, butto
|
|
|
66
67
|
};
|
|
67
68
|
const hidePlaceholder = as === "floating" && !fieldProps.value && !isFocused;
|
|
68
69
|
const style = useMemo(() => {
|
|
69
|
-
return {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
return {
|
|
71
|
+
paddingLeft: as === "filter" ? `calc(var(${inputSideCva({
|
|
72
|
+
size,
|
|
73
|
+
type: "var"
|
|
74
|
+
})}) + ${labelWidth}px)` : "0px",
|
|
75
|
+
paddingRight: `calc(var(${inputSideCva({
|
|
76
|
+
size,
|
|
77
|
+
type: "var"
|
|
78
|
+
})}) + ${trailingWidth}px)`
|
|
79
|
+
};
|
|
73
80
|
}, [
|
|
74
81
|
labelWidth,
|
|
82
|
+
trailingWidth,
|
|
75
83
|
as,
|
|
76
84
|
size,
|
|
77
85
|
inputSideCva
|
|
@@ -86,6 +94,7 @@ const DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, butto
|
|
|
86
94
|
className: clsx("group/date-picker-content relative flex min-w-input-width-min-width items-center justify-between gap-2")
|
|
87
95
|
}),
|
|
88
96
|
"data-rac": "",
|
|
97
|
+
"data-datetime-input": "",
|
|
89
98
|
"data-hovered": isHovered || void 0,
|
|
90
99
|
"data-disabled": isDisabled || void 0,
|
|
91
100
|
"data-invalid": isInvalid || void 0,
|
|
@@ -144,7 +153,11 @@ const DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, butto
|
|
|
144
153
|
})] })] })
|
|
145
154
|
]
|
|
146
155
|
})] }), /* @__PURE__ */ jsxs("div", {
|
|
147
|
-
|
|
156
|
+
ref: trailingContentRef,
|
|
157
|
+
className: clsx("absolute top-1/2 flex -translate-y-1/2 items-center gap-2", inputSideCva({
|
|
158
|
+
size,
|
|
159
|
+
type: "right"
|
|
160
|
+
})),
|
|
148
161
|
children: [isClearable && canClear && /* @__PURE__ */ jsx(InputClear, { onClear }), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
149
162
|
label: "",
|
|
150
163
|
color: "secondary",
|
package/dist/DateTimeDialog.js
CHANGED
|
@@ -32,7 +32,7 @@ const DateTimeDialog = ({ hideSidebar, children, footer, sidebar, label, isOpen,
|
|
|
32
32
|
isOpen,
|
|
33
33
|
onOpenChange,
|
|
34
34
|
sheetMarginBottom: 0,
|
|
35
|
-
isScrollable:
|
|
35
|
+
isScrollable: true,
|
|
36
36
|
height: "auto",
|
|
37
37
|
isDismissable: true,
|
|
38
38
|
children: (close) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
package/dist/InfiniteTable.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Table } from "./Table.js";
|
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { useCallback } from "react";
|
|
6
6
|
const InfiniteTable = ({ hasNextPage, isFetchingNextPage = false, fetchNextPage,...rest }) => {
|
|
7
|
-
const {
|
|
7
|
+
const { ref } = useIntersectionObserver({
|
|
8
8
|
onIntersection: useCallback(() => {
|
|
9
9
|
if (!isFetchingNextPage && hasNextPage) fetchNextPage();
|
|
10
10
|
}, [
|
|
@@ -17,12 +17,7 @@ const InfiniteTable = ({ hasNextPage, isFetchingNextPage = false, fetchNextPage,
|
|
|
17
17
|
return /* @__PURE__ */ jsxs("div", {
|
|
18
18
|
className: "flex flex-col",
|
|
19
19
|
children: [/* @__PURE__ */ jsx(Table, { ...rest }), (hasNextPage || isFetchingNextPage) && /* @__PURE__ */ jsx("div", {
|
|
20
|
-
ref
|
|
21
|
-
setRef(ref);
|
|
22
|
-
return () => {
|
|
23
|
-
setRef(null);
|
|
24
|
-
};
|
|
25
|
-
},
|
|
20
|
+
ref,
|
|
26
21
|
className: "flex justify-center py-4",
|
|
27
22
|
children: /* @__PURE__ */ jsx(Loader, {})
|
|
28
23
|
})]
|
package/dist/InputContent.js
CHANGED
|
@@ -38,7 +38,7 @@ const InputContent = ({ leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, un
|
|
|
38
38
|
inputSideCva
|
|
39
39
|
]);
|
|
40
40
|
return /* @__PURE__ */ jsxs("div", {
|
|
41
|
-
className: clsx("group/input-content relative",
|
|
41
|
+
className: clsx("group/input-content relative", as === "inline" && "h-full"),
|
|
42
42
|
children: [
|
|
43
43
|
as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
44
44
|
ref: labelContentRef,
|
package/dist/SelectInput.js
CHANGED
|
@@ -7,7 +7,7 @@ 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";
|
|
10
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { clsx } from "clsx";
|
|
12
12
|
import { Button, ComboBoxStateContext, Input } from "react-aria-components";
|
|
13
13
|
import { use, useMemo, useState } from "react";
|
|
@@ -83,11 +83,13 @@ const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvali
|
|
|
83
83
|
"data-has-search": fieldState.searchValue !== "" || void 0,
|
|
84
84
|
"data-invalid": isInvalid || void 0,
|
|
85
85
|
"data-is-empty": isEmpty || void 0,
|
|
86
|
+
"data-select-input": "",
|
|
86
87
|
...hoverProps,
|
|
87
88
|
...focusWithinProps,
|
|
88
89
|
children: [
|
|
89
90
|
/* @__PURE__ */ jsxs("div", {
|
|
90
91
|
className: clsx("relative flex flex-1 items-center truncate", showTags && inputSizeCva({
|
|
92
|
+
as,
|
|
91
93
|
size,
|
|
92
94
|
...props
|
|
93
95
|
})),
|
|
@@ -108,9 +110,10 @@ const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvali
|
|
|
108
110
|
selectedTagsType,
|
|
109
111
|
onRemove
|
|
110
112
|
}), isSearchable && /* @__PURE__ */ jsx(Input, {
|
|
111
|
-
placeholder,
|
|
113
|
+
placeholder: as === "floating" ? void 0 : placeholder,
|
|
112
114
|
onBlur,
|
|
113
115
|
className: clsx("w-full flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", !showTags && inputSizeCva({
|
|
116
|
+
as,
|
|
114
117
|
size,
|
|
115
118
|
...props,
|
|
116
119
|
className: "rounded-input-rounding-default"
|
|
@@ -119,23 +122,24 @@ const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvali
|
|
|
119
122
|
...fieldProps
|
|
120
123
|
})]
|
|
121
124
|
}),
|
|
122
|
-
!isSearchable && /* @__PURE__ */
|
|
125
|
+
!isSearchable && /* @__PURE__ */ jsxs(Button, {
|
|
123
126
|
isDisabled,
|
|
124
127
|
onPress: () => setIsOpen(!isOpen),
|
|
125
128
|
onBlur,
|
|
126
129
|
"data-type": "select-trigger",
|
|
127
130
|
className: inputSizeCva({
|
|
128
131
|
size,
|
|
132
|
+
as,
|
|
129
133
|
...props,
|
|
130
134
|
className: clsx("w-full truncate text-start outline-none disabled:text-interactive-text-secondary-disabled", showTags && "absolute inset-0 z-0")
|
|
131
135
|
}),
|
|
132
136
|
style,
|
|
133
137
|
...fieldProps,
|
|
134
|
-
children: (isEmpty || !isMultiple) && /* @__PURE__ */ jsxs(Typography, {
|
|
138
|
+
children: [(as === "floating" && isEmpty || isMultiple && !isEmpty) && /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }), (isEmpty || !isMultiple) && (as !== "floating" || !isEmpty) && /* @__PURE__ */ jsxs(Typography, {
|
|
135
139
|
size: "label-1",
|
|
136
140
|
className: clsx("truncate empty:before:inline-block empty:before:content-['']", isEmpty && "text-text-default-3"),
|
|
137
141
|
children: [isEmpty && placeholder, !isEmpty && (showSelectionContent ? selectedItems[0].content : selectedItems[0].label)]
|
|
138
|
-
})
|
|
142
|
+
})]
|
|
139
143
|
})
|
|
140
144
|
]
|
|
141
145
|
}),
|
package/dist/SelectListBox.js
CHANGED
|
@@ -48,7 +48,7 @@ const SelectListBox = ({ label, selectionMode, isSearchable, isScrollable = true
|
|
|
48
48
|
...props,
|
|
49
49
|
"aria-label": label,
|
|
50
50
|
selectionMode,
|
|
51
|
-
className: clsx("flex-1 outline-none [&>div:last-child>*]:border-b-0", isScrollable ? "overflow-y-auto overflow-x-hidden" : "overflow-hidden", className),
|
|
51
|
+
className: clsx("flex-1 outline-none [&>div:last-child>*]:border-b-0", isScrollable ? "max-h-full overflow-y-auto overflow-x-hidden" : "overflow-hidden", className),
|
|
52
52
|
items: listItems,
|
|
53
53
|
selectedKeys: selectedIds,
|
|
54
54
|
onSelectionChange,
|
|
@@ -61,7 +61,7 @@ const SelectListBox = ({ label, selectionMode, isSearchable, isScrollable = true
|
|
|
61
61
|
...props,
|
|
62
62
|
"aria-label": label,
|
|
63
63
|
selectionMode,
|
|
64
|
-
className: clsx("flex-1 outline-none [&>div:last-child]:border-b-0", isScrollable ? "overflow-y-auto overflow-x-hidden" : "overflow-hidden", className),
|
|
64
|
+
className: clsx("flex-1 outline-none [&>div:last-child]:border-b-0", isScrollable ? "max-h-full overflow-y-auto overflow-x-hidden" : "overflow-hidden", className),
|
|
65
65
|
items: listItems,
|
|
66
66
|
selectedKeys: selectedIds,
|
|
67
67
|
onSelectionChange,
|
|
@@ -10,7 +10,7 @@ import { useTranslation } from "react-i18next";
|
|
|
10
10
|
const SelectListBoxLoadingItem = ({ id, label, onLoadMore }) => {
|
|
11
11
|
const { t } = useTranslation("ui");
|
|
12
12
|
const { isDebouncing, isLoading, hasLoadMore } = SelectContext.useSelect();
|
|
13
|
-
const {
|
|
13
|
+
const { ref } = useIntersectionObserver({
|
|
14
14
|
onIntersection: useCallback(() => {
|
|
15
15
|
if (!isDebouncing && !isLoading && hasLoadMore) onLoadMore?.();
|
|
16
16
|
}, [
|
|
@@ -27,12 +27,7 @@ const SelectListBoxLoadingItem = ({ id, label, onLoadMore }) => {
|
|
|
27
27
|
isDisabled: true,
|
|
28
28
|
className: selectListBoxItemClass,
|
|
29
29
|
children: /* @__PURE__ */ jsx("div", {
|
|
30
|
-
ref
|
|
31
|
-
setRef(ref);
|
|
32
|
-
return () => {
|
|
33
|
-
setRef(null);
|
|
34
|
-
};
|
|
35
|
-
},
|
|
30
|
+
ref,
|
|
36
31
|
className: "flex flex-1 justify-center text-interactive-text-primary-idle",
|
|
37
32
|
children: /* @__PURE__ */ jsx(Loader, {})
|
|
38
33
|
})
|
package/dist/SelectMobile.js
CHANGED
|
@@ -83,7 +83,7 @@ const SelectMobile = ({ ref, error, showSelectionContent, inputClassName, contai
|
|
|
83
83
|
footer: isMultiple && /* @__PURE__ */ jsx(SelectListBoxSelectionBar, {}),
|
|
84
84
|
isDismissable: true,
|
|
85
85
|
children: (close) => /* @__PURE__ */ jsxs("div", {
|
|
86
|
-
className: "flex flex-col",
|
|
86
|
+
className: "flex max-h-full flex-col overflow-hidden",
|
|
87
87
|
children: [isSearchable ? /* @__PURE__ */ jsx(TextInput, {
|
|
88
88
|
ref: searchInputRef,
|
|
89
89
|
label,
|
|
@@ -96,12 +96,12 @@ const SelectMobile = ({ ref, error, showSelectionContent, inputClassName, contai
|
|
|
96
96
|
}) : /* @__PURE__ */ jsx(FormFieldHeader, {
|
|
97
97
|
label,
|
|
98
98
|
rightContent: /* @__PURE__ */ jsx(FormFieldHeaderClose, { onClose: close }),
|
|
99
|
-
className: "
|
|
99
|
+
className: "mb-1-5! px-4 pt-3"
|
|
100
100
|
}), /* @__PURE__ */ jsx(SelectListBox, {
|
|
101
101
|
...props,
|
|
102
102
|
autoFocus: !isSearchable,
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
onClose: close,
|
|
104
|
+
isScrollable: true
|
|
105
105
|
})]
|
|
106
106
|
})
|
|
107
107
|
})]
|
package/dist/Table.js
CHANGED
|
@@ -2,6 +2,7 @@ import { ChevronDownIcon } from "./ChevronDown.js";
|
|
|
2
2
|
import { ChevronUpIcon } from "./ChevronUp.js";
|
|
3
3
|
import { UIStyle } from "./uiStyle.context.js";
|
|
4
4
|
import { InlineIconButton } from "./InlineIconButton.js";
|
|
5
|
+
import { useIntersectionObserver } from "./useIntersectionObserver.js";
|
|
5
6
|
import { CellText } from "./CellText.js";
|
|
6
7
|
import { DragIcon } from "./Drag.js";
|
|
7
8
|
import { HeaderText } from "./HeaderText.js";
|
|
@@ -93,22 +94,27 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
93
94
|
internalSelectedRows
|
|
94
95
|
]);
|
|
95
96
|
const baseColumns = useMemo(() => typeof columns === "function" ? columns(i18next.t) : columns, [columns]);
|
|
97
|
+
const tableColumns = useMemo(() => {
|
|
98
|
+
if (enableDragDrop && getRowId) return [{
|
|
99
|
+
id: "drag-handle",
|
|
100
|
+
header: "",
|
|
101
|
+
meta: { width: "w-12" },
|
|
102
|
+
cell: AutoDragHandleCell,
|
|
103
|
+
enableSorting: false
|
|
104
|
+
}, ...baseColumns];
|
|
105
|
+
return baseColumns;
|
|
106
|
+
}, [
|
|
107
|
+
baseColumns,
|
|
108
|
+
enableDragDrop,
|
|
109
|
+
getRowId
|
|
110
|
+
]);
|
|
111
|
+
const [isSticky, setIsSticky] = useState(false);
|
|
112
|
+
const { ref: stickyRef } = useIntersectionObserver({ onIntersectionChange: useCallback((entry) => {
|
|
113
|
+
setIsSticky(entry.intersectionRatio < 1);
|
|
114
|
+
}, []) });
|
|
96
115
|
const table = useReactTable({
|
|
97
116
|
data,
|
|
98
|
-
columns:
|
|
99
|
-
if (enableDragDrop && getRowId) return [{
|
|
100
|
-
id: "drag-handle",
|
|
101
|
-
header: "",
|
|
102
|
-
meta: { width: "w-12" },
|
|
103
|
-
cell: AutoDragHandleCell,
|
|
104
|
-
enableSorting: false
|
|
105
|
-
}, ...baseColumns];
|
|
106
|
-
return baseColumns;
|
|
107
|
-
}, [
|
|
108
|
-
baseColumns,
|
|
109
|
-
enableDragDrop,
|
|
110
|
-
getRowId
|
|
111
|
-
]),
|
|
117
|
+
columns: tableColumns,
|
|
112
118
|
state: {
|
|
113
119
|
sorting,
|
|
114
120
|
columnOrder,
|
|
@@ -165,9 +171,13 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
165
171
|
const tableElement = /* @__PURE__ */ jsxs("table", {
|
|
166
172
|
className: clsx("w-full", className),
|
|
167
173
|
...listeners,
|
|
168
|
-
children: [/* @__PURE__ */
|
|
169
|
-
className: "sticky top-0 z-10
|
|
170
|
-
|
|
174
|
+
children: [/* @__PURE__ */ jsxs("thead", {
|
|
175
|
+
className: "group/table-head sticky top-0 z-10 data-is-sticky:shadow-2",
|
|
176
|
+
"data-is-sticky": isSticky || void 0,
|
|
177
|
+
children: [/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("th", {
|
|
178
|
+
ref: stickyRef,
|
|
179
|
+
className: "-mt-px block"
|
|
180
|
+
}) }), table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", {
|
|
171
181
|
className: clsx(tableHeadRowCva({})),
|
|
172
182
|
children: headerGroup.headers.filter((header) => {
|
|
173
183
|
if (isAnyRowSelected && header.index > 0) return false;
|
|
@@ -196,7 +206,7 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
|
|
|
196
206
|
})
|
|
197
207
|
}, header.id);
|
|
198
208
|
})
|
|
199
|
-
}, headerGroup.id))
|
|
209
|
+
}, headerGroup.id))]
|
|
200
210
|
}), /* @__PURE__ */ jsx("tbody", {
|
|
201
211
|
ref,
|
|
202
212
|
className: "relative",
|
package/dist/TextInput.js
CHANGED
|
@@ -70,7 +70,7 @@ var TextInputBase = (props) => {
|
|
|
70
70
|
...formFieldProps,
|
|
71
71
|
as,
|
|
72
72
|
labelProps,
|
|
73
|
-
className: clsx("group w-full",
|
|
73
|
+
className: clsx("group w-full", as === "inline" && "h-full", className),
|
|
74
74
|
tabIndex: as === "inline" ? -1 : void 0,
|
|
75
75
|
children: /* @__PURE__ */ jsx(InputContent, {
|
|
76
76
|
...inputContentProps,
|
package/dist/TimePickerInput.js
CHANGED
|
@@ -20,14 +20,22 @@ const TimePickerInput = ({ ref, as, fieldProps, state, isDisabled, isDirty, isIn
|
|
|
20
20
|
const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
|
|
21
21
|
const { isFocusVisible } = useFocusVisible();
|
|
22
22
|
const [labelContentRef, { width: labelWidth }] = useMeasure();
|
|
23
|
+
const [trailingContentRef, { width: trailingWidth }] = useMeasure();
|
|
23
24
|
const hidePlaceholder = as === "floating" && !state.value && !isFocused;
|
|
24
25
|
const style = useMemo(() => {
|
|
25
|
-
return {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
return {
|
|
27
|
+
paddingLeft: as === "filter" ? `calc(var(${inputSideCva({
|
|
28
|
+
size,
|
|
29
|
+
type: "var"
|
|
30
|
+
})}) + ${labelWidth}px)` : "0px",
|
|
31
|
+
paddingRight: `calc(var(${inputSideCva({
|
|
32
|
+
size,
|
|
33
|
+
type: "var"
|
|
34
|
+
})}) + ${trailingWidth}px)`
|
|
35
|
+
};
|
|
29
36
|
}, [
|
|
30
37
|
labelWidth,
|
|
38
|
+
trailingWidth,
|
|
31
39
|
as,
|
|
32
40
|
size,
|
|
33
41
|
inputSideCva
|
|
@@ -43,6 +51,7 @@ const TimePickerInput = ({ ref, as, fieldProps, state, isDisabled, isDirty, isIn
|
|
|
43
51
|
className: clsx("group/date-picker-content relative flex min-w-input-width-min-width items-center justify-between gap-2")
|
|
44
52
|
}),
|
|
45
53
|
"data-rac": "",
|
|
54
|
+
"data-datetime-input": "",
|
|
46
55
|
"data-hovered": isHovered || void 0,
|
|
47
56
|
"data-disabled": isDisabled || void 0,
|
|
48
57
|
"data-invalid": isInvalid || void 0,
|
|
@@ -78,7 +87,11 @@ const TimePickerInput = ({ ref, as, fieldProps, state, isDisabled, isDirty, isIn
|
|
|
78
87
|
})
|
|
79
88
|
})
|
|
80
89
|
] }), /* @__PURE__ */ jsxs("div", {
|
|
81
|
-
|
|
90
|
+
ref: trailingContentRef,
|
|
91
|
+
className: clsx("absolute top-1/2 flex -translate-y-1/2 items-center gap-2", inputSideCva({
|
|
92
|
+
size,
|
|
93
|
+
type: "right"
|
|
94
|
+
})),
|
|
82
95
|
children: [isClearable && canClear && /* @__PURE__ */ jsx(InputClear, { onClear: () => state.setValue(null) }), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
83
96
|
label: "",
|
|
84
97
|
color: "secondary",
|
|
@@ -8,6 +8,7 @@ export interface InputBaseProps extends VariantProps<typeof inputBase> {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const inputSize: (props?: ({
|
|
10
10
|
size?: "default" | "small" | "extra-small" | "large" | null | undefined;
|
|
11
|
+
as?: "default" | "filter" | "inline" | "floating" | null | undefined;
|
|
11
12
|
} & ClassProp) | undefined) => string;
|
|
12
13
|
export interface InputSizeProps extends VariantProps<typeof inputSize> {
|
|
13
14
|
}
|
|
@@ -14,6 +14,7 @@ interface BottomSheetBaseProps {
|
|
|
14
14
|
sheetMarginTop?: number;
|
|
15
15
|
sheetMarginBottom?: number;
|
|
16
16
|
shouldCloseOnInteractOutside?: () => boolean;
|
|
17
|
+
containerClassName?: string;
|
|
17
18
|
}
|
|
18
19
|
export interface BottomSheetProps extends BottomSheetBaseProps {
|
|
19
20
|
trigger?: ReactNode;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
type UseIntersectionObserverProps = {
|
|
2
2
|
onIntersection?: () => void;
|
|
3
|
+
onIntersectionChange?: (entry: IntersectionObserverEntry) => void;
|
|
3
4
|
} & IntersectionObserverInit;
|
|
4
|
-
export declare const useIntersectionObserver: ({ onIntersection, root, rootMargin, threshold, }: UseIntersectionObserverProps) => {
|
|
5
|
-
|
|
5
|
+
export declare const useIntersectionObserver: <T extends HTMLElement>({ onIntersection, onIntersectionChange, root, rootMargin, threshold, }: UseIntersectionObserverProps) => {
|
|
6
|
+
ref: import('react').RefObject<T | null>;
|
|
6
7
|
};
|
|
7
8
|
export {};
|
package/dist/input.cva.js
CHANGED
|
@@ -10,12 +10,7 @@ const inputBase = cva([uiOutlineClass, "flex w-full truncate"], {
|
|
|
10
10
|
},
|
|
11
11
|
as: {
|
|
12
12
|
default: "rounded-input-rounding-default",
|
|
13
|
-
floating:
|
|
14
|
-
"rounded-input-rounding-default",
|
|
15
|
-
"py-floating-label-input-height-empty!",
|
|
16
|
-
"group-has-[input:not(:placeholder-shown)]/input-content:pb-floating-label-input-height-filled!",
|
|
17
|
-
"group-has-[input:not(:placeholder-shown)]/input-content:pt-[calc(var(--spacing-input-height-default)+14px)]!"
|
|
18
|
-
],
|
|
13
|
+
floating: "rounded-input-rounding-default",
|
|
19
14
|
filter: "rounded-input-rounding-default",
|
|
20
15
|
inline: [
|
|
21
16
|
"h-full",
|
|
@@ -113,13 +108,77 @@ const inputBase = cva([uiOutlineClass, "flex w-full truncate"], {
|
|
|
113
108
|
}
|
|
114
109
|
});
|
|
115
110
|
const inputSize = cva("", {
|
|
116
|
-
variants: {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
111
|
+
variants: {
|
|
112
|
+
size: {
|
|
113
|
+
"extra-small": "text-label-1",
|
|
114
|
+
small: "text-label-1",
|
|
115
|
+
default: "text-label-1",
|
|
116
|
+
large: "text-label-1"
|
|
117
|
+
},
|
|
118
|
+
as: {
|
|
119
|
+
default: "",
|
|
120
|
+
floating: [
|
|
121
|
+
"px-input-side-default",
|
|
122
|
+
"py-floating-label-input-height-empty!",
|
|
123
|
+
"group-has-[input:not(:placeholder-shown)]/input-content:pb-floating-label-input-height-filled!",
|
|
124
|
+
"group-has-[input:not(:placeholder-shown)]/input-content:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--text-label-3--line-height)*var(--text-label-3))]!",
|
|
125
|
+
"group-has-[input:not(:placeholder-shown)]/select-content:pb-floating-label-input-height-filled!",
|
|
126
|
+
"group-has-[input:not(:placeholder-shown)]/select-content:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--text-label-3--line-height)*var(--text-label-3))]!",
|
|
127
|
+
"group-data-[has-selection]/select-content:pb-floating-label-input-height-filled!",
|
|
128
|
+
"group-data-[has-selection]/select-content:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--text-label-3--line-height)*var(--text-label-3))]!",
|
|
129
|
+
"group-data-[has-search]/select-content:pb-floating-label-input-height-filled!",
|
|
130
|
+
"group-data-[has-search]/select-content:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--text-label-3--line-height)*var(--text-label-3))]!",
|
|
131
|
+
"data-[datetime-input]:data-[has-selection]:pb-floating-label-input-height-filled!",
|
|
132
|
+
"data-[datetime-input]:data-[has-selection]:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--text-label-3--line-height)*var(--text-label-3))]!",
|
|
133
|
+
"data-[datetime-input]:data-[focus-within]:pb-floating-label-input-height-filled!",
|
|
134
|
+
"data-[datetime-input]:data-[focus-within]:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--text-label-3--line-height)*var(--text-label-3))]!"
|
|
135
|
+
],
|
|
136
|
+
filter: "",
|
|
137
|
+
inline: ""
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
compoundVariants: [
|
|
141
|
+
{
|
|
142
|
+
as: [
|
|
143
|
+
"default",
|
|
144
|
+
"filter",
|
|
145
|
+
"inline"
|
|
146
|
+
],
|
|
147
|
+
size: "extra-small",
|
|
148
|
+
className: "px-input-side-default py-input-height-default text-label-1"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
as: [
|
|
152
|
+
"default",
|
|
153
|
+
"filter",
|
|
154
|
+
"inline"
|
|
155
|
+
],
|
|
156
|
+
size: "small",
|
|
157
|
+
className: "px-input-side-default py-input-height-default text-label-1"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
as: [
|
|
161
|
+
"default",
|
|
162
|
+
"filter",
|
|
163
|
+
"inline"
|
|
164
|
+
],
|
|
165
|
+
size: "default",
|
|
166
|
+
className: "px-input-side-default py-input-height-default text-label-1"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
as: [
|
|
170
|
+
"default",
|
|
171
|
+
"filter",
|
|
172
|
+
"inline"
|
|
173
|
+
],
|
|
174
|
+
size: "large",
|
|
175
|
+
className: "px-input-side-default py-input-height-default text-label-1"
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
defaultVariants: {
|
|
179
|
+
size: "default",
|
|
180
|
+
as: "default"
|
|
181
|
+
}
|
|
123
182
|
});
|
|
124
183
|
const inputSide = cva("", {
|
|
125
184
|
variants: {
|
package/dist/label.cva.js
CHANGED
|
@@ -1,64 +1,52 @@
|
|
|
1
1
|
import { compoundMapper } from "./compoundMapper.js";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
|
-
const labelBase = cva("
|
|
3
|
+
const labelBase = cva("", {
|
|
4
4
|
variants: { as: {
|
|
5
|
-
default: ["flex items-start gap-1"],
|
|
6
|
-
filter: ["absolute top-1/2 -translate-y-1/2"],
|
|
7
|
-
inline: ["flex items-start gap-1"],
|
|
5
|
+
default: ["flex items-start gap-1 text-text-default-1"],
|
|
6
|
+
filter: ["absolute top-1/2 -translate-y-1/2 text-text-default-1"],
|
|
7
|
+
inline: ["flex items-start gap-1 text-text-default-1"],
|
|
8
8
|
floating: [
|
|
9
9
|
"pointer-events-none",
|
|
10
10
|
"absolute transition-all duration-75",
|
|
11
11
|
"top-1/2 -translate-y-1/2",
|
|
12
|
-
"text-text-default-
|
|
12
|
+
"text-text-default-3 group-has-[input:disabled]/input-content:text-interactive-text-secondary-disabled",
|
|
13
13
|
"group-disabled/date-picker-content:text-interactive-text-secondary-disabled",
|
|
14
14
|
"group-disabled/text-editor:text-interactive-text-secondary-disabled",
|
|
15
15
|
"group-has-[input:disabled]/select-content:text-interactive-text-secondary-disabled",
|
|
16
16
|
"group-has-[textarea:disabled]/text-area:text-interactive-text-secondary-disabled",
|
|
17
|
-
"group-data-[text-area]/text-area:top-
|
|
18
|
-
"group-data-[text-editor]/text-editor:top-
|
|
17
|
+
"group-data-[text-area]/text-area:top-floating-label-input-height-empty group-data-[text-area]/text-area:translate-y-0",
|
|
18
|
+
"group-data-[text-editor]/text-editor:top-floating-label-input-height-empty group-data-[text-editor]/text-editor:left-input-side-default group-data-[text-editor]/text-editor:translate-y-0",
|
|
19
19
|
"group-has-[input:not(:placeholder-shown)]/input-content:top-floating-label-input-height-filled group-has-[input:not(:placeholder-shown)]/input-content:translate-y-0",
|
|
20
|
-
"group-has-[textarea:not(:placeholder-shown)]/text-area:
|
|
21
|
-
"group-
|
|
20
|
+
"group-has-[textarea:not(:placeholder-shown)]/text-area:hidden",
|
|
21
|
+
"group-has-[textarea:placeholder-shown]/text-area:text-text-default-3",
|
|
22
|
+
"group-has-[textarea:placeholder-shown]/text-area:font-medium!",
|
|
23
|
+
"group-data-[is-filled=true]/text-editor:hidden",
|
|
24
|
+
"group-has-[data-text-editor:placeholder-shown]/text-editor:text-text-default-3",
|
|
25
|
+
"group-has-[data-text-editor:placeholder-shown]/text-editor:font-medium!",
|
|
22
26
|
"group-data-[has-selection]/date-picker-content:top-1 group-data-[has-selection]/date-picker-content:translate-y-0",
|
|
23
27
|
"group-focus-within/date-picker-content:top-1 group-focus-within/date-picker-content:translate-y-0",
|
|
24
28
|
"group-data-[has-selection]/select-content:top-1 group-data-[has-selection]/select-content:translate-y-0",
|
|
25
29
|
"group-data-[searchable-focus-within]/select-content:top-1 group-data-[searchable-focus-within]/select-content:translate-y-0",
|
|
26
30
|
"group-data-[has-search]/select-content:top-1 group-data-[has-search]/select-content:translate-y-0",
|
|
27
31
|
"group-has-[input:placeholder-shown]/input-content:text-text-default-3",
|
|
28
|
-
"group-has-[input:placeholder-shown]/input-content
|
|
29
|
-
"group-has-[input:not(:placeholder-shown)]/input-content
|
|
30
|
-
"group-has-[input:not(:placeholder-shown)]/input-content
|
|
32
|
+
"group-has-[input:placeholder-shown]/input-content:font-medium!",
|
|
33
|
+
"group-has-[input:not(:placeholder-shown)]/input-content:font-semibold!",
|
|
34
|
+
"group-has-[input:not(:placeholder-shown)]/input-content:text-label-3!",
|
|
31
35
|
"group-has-[input:not(:placeholder-shown)]/input-content:text-text-default-1",
|
|
32
|
-
"group-
|
|
33
|
-
"group-
|
|
34
|
-
"group-has-[textarea:not(placeholder-shown)]/text-area:!font-semibold",
|
|
35
|
-
"group-has-[textarea:not(:placeholder-shown)]/text-area:!text-label-3",
|
|
36
|
-
"group-has-[textarea:not(placeholder-shown)]/text-area:text-text-default-1",
|
|
37
|
-
"group-focus-within/text-area:!text-text-default-1",
|
|
38
|
-
"group-focus-within/text-area:text-label-3",
|
|
39
|
-
"group-has-[textarea:focus-within]/text-area:!font-semibold",
|
|
40
|
-
"group-has-[data-text-editor:placeholder-shown]/text-editor:text-text-default-3",
|
|
41
|
-
"group-has-[data-text-editor:placeholder-shown]/text-editor:!font-medium",
|
|
42
|
-
"group-data-[is-filled=true]/text-editor:!font-semibold",
|
|
43
|
-
"group-data-[is-filled=true]/text-editor:!text-label-3",
|
|
44
|
-
"group-data-[is-filled=true]/text-editor:text-text-default-1",
|
|
45
|
-
"group-focus-within/text-editor:!text-text-default-1",
|
|
46
|
-
"group-focus-within/text-editor:text-label-3",
|
|
47
|
-
"group-has-[data-text-editor:focus-within]/text-editor:!font-semibold",
|
|
48
|
-
"group-data-[has-selection]/date-picker-content:!font-semibold",
|
|
49
|
-
"group-data-[has-selection]/date-picker-content:!text-label-3",
|
|
36
|
+
"group-data-[has-selection]/date-picker-content:font-semibold!",
|
|
37
|
+
"group-data-[has-selection]/date-picker-content:text-label-3!",
|
|
50
38
|
"group-data-[has-selection]/date-picker-content:text-text-default-1",
|
|
51
|
-
"group-focus-within/date-picker-content
|
|
52
|
-
"group-focus-within/date-picker-content
|
|
39
|
+
"group-focus-within/date-picker-content:font-semibold!",
|
|
40
|
+
"group-focus-within/date-picker-content:text-label-3!",
|
|
53
41
|
"group-focus-within/date-picker-content:text-text-default-1",
|
|
54
|
-
"group-data-[has-selection]/select-content
|
|
55
|
-
"group-data-[has-selection]/select-content
|
|
42
|
+
"group-data-[has-selection]/select-content:font-semibold!",
|
|
43
|
+
"group-data-[has-selection]/select-content:text-label-3!",
|
|
56
44
|
"group-data-[has-selection]/select-content:text-text-default-1",
|
|
57
|
-
"group-data-[searchable-focus-within]/select-content
|
|
58
|
-
"group-data-[searchable-focus-within]/select-content
|
|
45
|
+
"group-data-[searchable-focus-within]/select-content:font-semibold!",
|
|
46
|
+
"group-data-[searchable-focus-within]/select-content:text-label-3!",
|
|
59
47
|
"group-data-[searchable-focus-within]/select-content:text-text-default-1",
|
|
60
|
-
"group-data-[has-search]/select-content
|
|
61
|
-
"group-data-[has-search]/select-content
|
|
48
|
+
"group-data-[has-search]/select-content:font-semibold!",
|
|
49
|
+
"group-data-[has-search]/select-content:text-label-3!",
|
|
62
50
|
"group-data-[has-search]/select-content:text-text-default-1"
|
|
63
51
|
]
|
|
64
52
|
} },
|
package/dist/table.cva.js
CHANGED
|
@@ -12,7 +12,7 @@ const tableRow = cva([
|
|
|
12
12
|
odd: "odd:bg-elevation-fill-inverted-4/5"
|
|
13
13
|
} } });
|
|
14
14
|
const tableHeadRow = cva(["h-8 w-full"]);
|
|
15
|
-
const tableHeadData = cva(["border-b border-b-elevation-outline-default-1 border-solid bg-elevation-fill-default-1 px-table-header-cell-container-side-default py-table-header-cell-container-height-default text-left"], {
|
|
15
|
+
const tableHeadData = cva(["border-b border-b-elevation-outline-default-1 border-solid bg-elevation-fill-default-1 px-table-header-cell-container-side-default py-table-header-cell-container-height-default text-left", "group-data-[is-sticky=true]/table-head:bg-elevation-fill-default-1"], {
|
|
16
16
|
variants: { hasRightBorder: {
|
|
17
17
|
true: "border-l border-l-elevation-outline-default-1 border-solid",
|
|
18
18
|
false: ""
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { useEffect,
|
|
2
|
-
const useIntersectionObserver = ({ onIntersection, root, rootMargin, threshold }) => {
|
|
3
|
-
const
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
const useIntersectionObserver = ({ onIntersection, onIntersectionChange, root, rootMargin, threshold }) => {
|
|
3
|
+
const ref = useRef(null);
|
|
4
4
|
useEffect(() => {
|
|
5
5
|
const observer = new IntersectionObserver((entries) => {
|
|
6
6
|
if (entries.some((entry) => entry.isIntersecting)) onIntersection?.();
|
|
7
|
+
onIntersectionChange?.(entries[0]);
|
|
7
8
|
}, {
|
|
8
9
|
root,
|
|
9
10
|
rootMargin,
|
|
10
11
|
threshold
|
|
11
12
|
});
|
|
12
|
-
if (ref) observer.observe(ref);
|
|
13
|
+
if (ref.current) observer.observe(ref.current);
|
|
13
14
|
return () => observer.disconnect();
|
|
14
15
|
}, [
|
|
15
16
|
ref,
|
|
16
17
|
root,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
onIntersection
|
|
18
|
+
onIntersection,
|
|
19
|
+
onIntersectionChange
|
|
20
20
|
]);
|
|
21
|
-
return {
|
|
21
|
+
return { ref };
|
|
22
22
|
};
|
|
23
23
|
export { useIntersectionObserver };
|