@robert-stackflow/oneui 0.6.19 → 0.6.20
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/components/Accordion.d.ts +1 -1
- package/components/Accordion.js +1 -0
- package/components/AccountItem.js +1 -0
- package/components/ActionSheet.js +1 -0
- package/components/Alert.js +1 -0
- package/components/AppShell.js +1 -0
- package/components/AppearanceSettings.js +1 -0
- package/components/AuthLayout.js +1 -0
- package/components/Avatar.js +1 -0
- package/components/AvatarGroup.js +1 -0
- package/components/Badge.js +1 -0
- package/components/Banner.d.ts +3 -3
- package/components/Banner.js +12 -4
- package/components/BarChart.js +1 -0
- package/components/BlockedTab.js +1 -0
- package/components/Breadcrumb.js +1 -0
- package/components/Button.d.ts +4 -2
- package/components/Button.js +24 -0
- package/components/Calendar.js +19 -13
- package/components/Card.d.ts +5 -4
- package/components/Card.js +8 -4
- package/components/Card.module.css +10 -0
- package/components/Cascader.js +1 -0
- package/components/CatalogIcon.js +1 -0
- package/components/CharacterPicker.js +1 -0
- package/components/Checkbox.d.ts +5 -3
- package/components/Checkbox.js +17 -5
- package/components/ColorField.js +1 -0
- package/components/ColorPicker.js +1 -0
- package/components/Combobox.js +1 -0
- package/components/CommandPalette.js +1 -0
- package/components/ContextMenu.js +1 -0
- package/components/ContextMenuPanel.js +1 -0
- package/components/ContributionCalendar.js +1 -0
- package/components/ContributionCell.js +1 -0
- package/components/CopyButton.js +1 -0
- package/components/DataTable.js +1 -0
- package/components/DatePicker.js +8 -4
- package/components/DateRangePicker.js +1 -0
- package/components/Descriptions.js +1 -0
- package/components/Dialog.d.ts +9 -3
- package/components/Dialog.js +33 -11
- package/components/DialogVariants.js +1 -0
- package/components/DisclosureChevron.js +1 -0
- package/components/Divider.js +1 -0
- package/components/Drawer.d.ts +5 -2
- package/components/Drawer.js +20 -5
- package/components/EmojiPicker.js +1 -0
- package/components/EmptyState.js +1 -0
- package/components/FieldLabel.d.ts +2 -1
- package/components/FieldLabel.js +1 -0
- package/components/FieldMessages.d.ts +3 -2
- package/components/FieldMessages.js +1 -0
- package/components/FileDropOverlay.js +1 -0
- package/components/FileDropZone.js +1 -0
- package/components/FilePicker.d.ts +3 -2
- package/components/FilePicker.js +21 -5
- package/components/FileSelectionFeedback.js +1 -0
- package/components/FileTree.js +1 -0
- package/components/Form.js +1 -0
- package/components/FormErrorSummary.js +1 -0
- package/components/FormField.js +1 -0
- package/components/FormGroup.js +1 -0
- package/components/FormLayout.js +1 -0
- package/components/IconButton.js +1 -0
- package/components/IconPicker.js +1 -0
- package/components/Indicator.js +1 -0
- package/components/Input.js +1 -0
- package/components/Layout.js +1 -0
- package/components/LoadingOverlay.js +1 -0
- package/components/LoadingState.js +1 -0
- package/components/Markdown.js +1 -0
- package/components/Menu.js +1 -0
- package/components/MenuItem.d.ts +8 -3
- package/components/MenuItem.js +24 -1
- package/components/MenuItemContent.js +1 -0
- package/components/MultiSelect.js +1 -0
- package/components/NavBar.d.ts +2 -1
- package/components/NavBar.js +3 -1
- package/components/NumberInput.js +1 -0
- package/components/Page.d.ts +2 -1
- package/components/Page.js +4 -2
- package/components/Page.module.css +9 -0
- package/components/Pagination.d.ts +4 -1
- package/components/Pagination.js +28 -14
- package/components/PasskeyItem.js +1 -0
- package/components/PasswordField.js +1 -0
- package/components/PinInput.js +1 -0
- package/components/Placeholder.js +1 -0
- package/components/Popconfirm.js +1 -0
- package/components/Popover.d.ts +3 -2
- package/components/Popover.js +9 -2
- package/components/Progress.js +1 -0
- package/components/RadioGroup.js +1 -0
- package/components/RangeSlider.js +1 -0
- package/components/ResizablePanel.js +1 -0
- package/components/ResourceCard.js +1 -0
- package/components/SearchField.js +1 -0
- package/components/Section.js +1 -0
- package/components/Segmented.d.ts +1 -0
- package/components/Segmented.js +32 -20
- package/components/Select.d.ts +3 -1
- package/components/Select.js +12 -2
- package/components/SelectOptionContent.js +1 -0
- package/components/SelectSettingRow.js +1 -0
- package/components/SelectTrigger.js +1 -0
- package/components/SelectionTag.js +1 -0
- package/components/SessionItem.js +1 -0
- package/components/SettingRow.d.ts +3 -2
- package/components/SettingRow.js +9 -2
- package/components/SettingsLayout.js +1 -0
- package/components/ShortcutInput.js +1 -0
- package/components/SideBar.js +1 -0
- package/components/SidebarNavigation.js +1 -0
- package/components/Skeleton.js +1 -0
- package/components/SkeletonRows.js +1 -0
- package/components/SkinTonePicker.js +1 -0
- package/components/Slider.js +1 -0
- package/components/Spinner.js +1 -0
- package/components/SplitButton.js +1 -0
- package/components/Statistic.js +1 -0
- package/components/Steps.js +1 -0
- package/components/Switch.d.ts +5 -0
- package/components/Switch.js +26 -2
- package/components/Switch.module.css +101 -59
- package/components/SwitchSettingRow.js +1 -0
- package/components/SymbolPicker.js +1 -0
- package/components/TabList.js +1 -0
- package/components/Table.js +1 -0
- package/components/TableColumnFilter.js +1 -0
- package/components/TableColumnVisibility.js +1 -0
- package/components/TableMarkup.d.ts +2 -2
- package/components/TableMarkup.js +5 -2
- package/components/TableOfContents.js +1 -0
- package/components/Tabs.js +1 -0
- package/components/TagInput.js +1 -0
- package/components/TextAreaSettingRow.js +1 -0
- package/components/TextSettingRow.js +1 -0
- package/components/Textarea.js +1 -0
- package/components/ThemePicker.js +1 -0
- package/components/ThemeProvider.js +1 -0
- package/components/ThemeStylePicker.js +1 -0
- package/components/TimeColumns.js +8 -1
- package/components/Timeline.js +1 -0
- package/components/Toast.js +4 -1
- package/components/ToastProvider.js +1 -0
- package/components/Tooltip.js +7 -3
- package/components/TreeGuides.js +1 -0
- package/components/TreeSelect.js +1 -0
- package/components/TreeTable.js +1 -0
- package/components/UIProvider.d.ts +1 -0
- package/components/UIProvider.js +2 -0
- package/components/UnderlinedTab.js +1 -0
- package/components/Upload.js +1 -0
- package/components/UploadList.js +1 -0
- package/components/UploadListItem.js +1 -0
- package/components/UptimeChart.js +1 -0
- package/components/VirtualPickerList.js +1 -0
- package/components/appearance.js +1 -0
- package/components/calendarNow.js +1 -0
- package/components/characterCatalog.js +1 -0
- package/components/color.js +1 -0
- package/components/contribution.js +1 -0
- package/components/createToaster.js +1 -0
- package/components/dateConstraints.js +1 -0
- package/components/field.d.ts +7 -7
- package/components/field.js +3 -2
- package/components/fileSelection.js +1 -0
- package/components/hierarchy.js +1 -0
- package/components/iconCatalog.js +1 -0
- package/components/index.d.ts +1 -0
- package/components/index.js +3 -0
- package/components/menuFocus.js +1 -0
- package/components/menuPointer.js +1 -0
- package/components/menuTypes.js +1 -0
- package/components/motion.js +1 -0
- package/components/rangeMath.js +1 -0
- package/components/settingRowControl.js +1 -0
- package/components/surfacePortal.js +1 -0
- package/components/tooltipState.js +1 -0
- package/components/types.js +1 -0
- package/components/uploadTypes.js +1 -0
- package/components/useFormState.js +1 -0
- package/components/useHierarchy.js +1 -0
- package/components/useMenuLayers.js +1 -0
- package/components/useModalFocus.d.ts +1 -1
- package/components/useModalFocus.js +9 -3
- package/components/useModalScrollLock.js +1 -0
- package/components/usePopover.js +1 -0
- package/components/usePortalRoot.d.ts +2 -0
- package/components/usePortalRoot.js +12 -0
- package/components/useTabIndicator.js +1 -0
- package/components/useUIText.d.ts +5 -0
- package/components/useUIText.js +14 -0
- package/components/useUploadQueue.js +1 -0
- package/package.json +1 -1
|
@@ -1,59 +1,101 @@
|
|
|
1
|
-
.switch {
|
|
2
|
-
position: relative;
|
|
3
|
-
width: 36px;
|
|
4
|
-
height: 22px;
|
|
5
|
-
flex-shrink: 0;
|
|
6
|
-
padding: 0;
|
|
7
|
-
border: 1px solid color-mix(in srgb, var(--fg) 25%, var(--surface));
|
|
8
|
-
border-radius: 999px;
|
|
9
|
-
background: var(--field);
|
|
10
|
-
transition:
|
|
11
|
-
background-color var(--motion-panel) var(--ease),
|
|
12
|
-
border-color var(--motion-panel) var(--ease),
|
|
13
|
-
box-shadow var(--motion-hover);
|
|
14
|
-
}
|
|
15
|
-
.switch span {
|
|
16
|
-
position: absolute;
|
|
17
|
-
left: 3px;
|
|
18
|
-
top: 3px;
|
|
19
|
-
width: 14px;
|
|
20
|
-
height: 14px;
|
|
21
|
-
border-radius: 50%;
|
|
22
|
-
background: var(--muted);
|
|
23
|
-
transition:
|
|
24
|
-
transform var(--motion-panel) var(--ease),
|
|
25
|
-
width var(--motion-press) var(--ease),
|
|
26
|
-
background-color var(--motion-panel);
|
|
27
|
-
}
|
|
28
|
-
.switch:hover:not(:disabled) {
|
|
29
|
-
background: var(--hover);
|
|
30
|
-
border-color: var(--muted);
|
|
31
|
-
}
|
|
32
|
-
.switch[aria-checked="true"] {
|
|
33
|
-
background: var(--switch-on, var(--accent));
|
|
34
|
-
border-color: var(--switch-on, var(--accent));
|
|
35
|
-
}
|
|
36
|
-
.switch[aria-checked="true"]:hover:not(:disabled) {
|
|
37
|
-
background: var(
|
|
38
|
-
--switch-on-hover,
|
|
39
|
-
color-mix(in srgb, var(--accent) 88%, var(--fg))
|
|
40
|
-
);
|
|
41
|
-
border-color: var(--switch-on, var(--accent));
|
|
42
|
-
}
|
|
43
|
-
.switch[aria-checked="true"] span {
|
|
44
|
-
transform: translateX(14px);
|
|
45
|
-
background: var(--switch-thumb-on, var(--on-accent));
|
|
46
|
-
}
|
|
47
|
-
.switch:active:not(:disabled) span {
|
|
48
|
-
width: 17px;
|
|
49
|
-
}
|
|
50
|
-
.switch[aria-checked="true"]:active:not(:disabled) span {
|
|
51
|
-
transform: translateX(11px);
|
|
52
|
-
}
|
|
53
|
-
.switch:focus-visible {
|
|
54
|
-
outline: 0;
|
|
55
|
-
box-shadow: 0 0 0 3px
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
1
|
+
.switch {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 36px;
|
|
4
|
+
height: 22px;
|
|
5
|
+
flex-shrink: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
border: 1px solid color-mix(in srgb, var(--fg) 25%, var(--surface));
|
|
8
|
+
border-radius: 999px;
|
|
9
|
+
background: var(--field);
|
|
10
|
+
transition:
|
|
11
|
+
background-color var(--motion-panel) var(--ease),
|
|
12
|
+
border-color var(--motion-panel) var(--ease),
|
|
13
|
+
box-shadow var(--motion-hover);
|
|
14
|
+
}
|
|
15
|
+
.switch span {
|
|
16
|
+
position: absolute;
|
|
17
|
+
left: 3px;
|
|
18
|
+
top: 3px;
|
|
19
|
+
width: 14px;
|
|
20
|
+
height: 14px;
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
background: var(--muted);
|
|
23
|
+
transition:
|
|
24
|
+
transform var(--motion-panel) var(--ease),
|
|
25
|
+
width var(--motion-press) var(--ease),
|
|
26
|
+
background-color var(--motion-panel);
|
|
27
|
+
}
|
|
28
|
+
.switch:hover:not(:disabled) {
|
|
29
|
+
background: var(--hover);
|
|
30
|
+
border-color: var(--muted);
|
|
31
|
+
}
|
|
32
|
+
.switch[aria-checked="true"] {
|
|
33
|
+
background: var(--switch-on, var(--accent));
|
|
34
|
+
border-color: var(--switch-on, var(--accent));
|
|
35
|
+
}
|
|
36
|
+
.switch[aria-checked="true"]:hover:not(:disabled) {
|
|
37
|
+
background: var(
|
|
38
|
+
--switch-on-hover,
|
|
39
|
+
color-mix(in srgb, var(--accent) 88%, var(--fg))
|
|
40
|
+
);
|
|
41
|
+
border-color: var(--switch-on, var(--accent));
|
|
42
|
+
}
|
|
43
|
+
.switch[aria-checked="true"] span {
|
|
44
|
+
transform: translateX(14px);
|
|
45
|
+
background: var(--switch-thumb-on, var(--on-accent));
|
|
46
|
+
}
|
|
47
|
+
.switch:active:not(:disabled) span {
|
|
48
|
+
width: 17px;
|
|
49
|
+
}
|
|
50
|
+
.switch[aria-checked="true"]:active:not(:disabled) span {
|
|
51
|
+
transform: translateX(11px);
|
|
52
|
+
}
|
|
53
|
+
.switch:focus-visible {
|
|
54
|
+
outline: 0;
|
|
55
|
+
box-shadow: 0 0 0 3px
|
|
56
|
+
color-mix(in srgb, var(--accent-ink, var(--accent)) 14%, transparent);
|
|
57
|
+
}
|
|
58
|
+
.switch:disabled {
|
|
59
|
+
opacity: 0.4;
|
|
60
|
+
}
|
|
61
|
+
.nativeLabel {
|
|
62
|
+
display: inline-flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: 8px;
|
|
65
|
+
}
|
|
66
|
+
.nativeControl {
|
|
67
|
+
display: inline-flex;
|
|
68
|
+
position: relative;
|
|
69
|
+
width: 36px;
|
|
70
|
+
height: 22px;
|
|
71
|
+
flex-shrink: 0;
|
|
72
|
+
}
|
|
73
|
+
.nativeInput {
|
|
74
|
+
position: absolute;
|
|
75
|
+
z-index: 1;
|
|
76
|
+
inset: 0;
|
|
77
|
+
width: 100%;
|
|
78
|
+
height: 100%;
|
|
79
|
+
margin: 0;
|
|
80
|
+
opacity: 0;
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
}
|
|
83
|
+
.nativeInput + .switch {
|
|
84
|
+
pointer-events: none;
|
|
85
|
+
box-sizing: border-box;
|
|
86
|
+
}
|
|
87
|
+
.nativeInput:checked + .switch {
|
|
88
|
+
background: var(--switch-on, var(--accent));
|
|
89
|
+
border-color: var(--switch-on, var(--accent));
|
|
90
|
+
}
|
|
91
|
+
.nativeInput:checked + .switch span {
|
|
92
|
+
transform: translateX(14px);
|
|
93
|
+
background: var(--switch-thumb-on, var(--on-accent));
|
|
94
|
+
}
|
|
95
|
+
.nativeInput:disabled + .switch {
|
|
96
|
+
opacity: 0.4;
|
|
97
|
+
}
|
|
98
|
+
.nativeInput:focus-visible + .switch {
|
|
99
|
+
box-shadow: 0 0 0 3px
|
|
100
|
+
color-mix(in srgb, var(--accent-ink, var(--accent)) 14%, transparent);
|
|
101
|
+
}
|
package/components/TabList.js
CHANGED
package/components/Table.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { HTMLAttributes, TdHTMLAttributes, ThHTMLAttributes, CSSProperties, ReactNode } from "react";
|
|
1
|
+
import type { HTMLAttributes, TdHTMLAttributes, ThHTMLAttributes, CSSProperties, ReactNode, ComponentProps } from "react";
|
|
2
2
|
import type { TableAppearance } from "./Table";
|
|
3
3
|
/** Semantic table composition for cells with forms, selection and nested content. */
|
|
4
4
|
declare function Markup({ children, className, striped, density, hoverable, bordered, stickyHeader, ...props }: HTMLAttributes<HTMLTableElement> & TableAppearance): import("react").JSX.Element;
|
|
5
|
-
declare function ScrollContainer({ children, minWidth, }: {
|
|
5
|
+
declare function ScrollContainer({ children, minWidth, className, ...props }: ComponentProps<"div"> & {
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
minWidth?: number;
|
|
8
8
|
}): import("react").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import s from "./Table.module.css";
|
|
3
4
|
function Markup({
|
|
@@ -26,9 +27,11 @@ function Markup({
|
|
|
26
27
|
}
|
|
27
28
|
function ScrollContainer({
|
|
28
29
|
children,
|
|
29
|
-
minWidth = 600
|
|
30
|
+
minWidth = 600,
|
|
31
|
+
className = "",
|
|
32
|
+
...props
|
|
30
33
|
}) {
|
|
31
|
-
return /* @__PURE__ */ jsx("div", { className: s.scroll
|
|
34
|
+
return /* @__PURE__ */ jsx("div", { ...props, className: `${s.scroll} ${className}`, children: /* @__PURE__ */ jsx("div", { style: { minWidth }, children }) });
|
|
32
35
|
}
|
|
33
36
|
function Th({
|
|
34
37
|
ta,
|
package/components/Tabs.js
CHANGED
package/components/TagInput.js
CHANGED
package/components/Textarea.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { useLayoutEffect, useRef } from "react";
|
|
3
4
|
import s from "./TimeColumns.module.css";
|
|
5
|
+
import { useUIText } from "./useUIText.js";
|
|
4
6
|
function TimeColumns({
|
|
5
7
|
value,
|
|
6
8
|
onChange,
|
|
7
9
|
seconds = false,
|
|
8
10
|
active = true
|
|
9
11
|
}) {
|
|
12
|
+
const { text } = useUIText();
|
|
10
13
|
const root = useRef(null), parts = value.split(":");
|
|
11
14
|
useLayoutEffect(() => {
|
|
12
15
|
if (active)
|
|
@@ -20,7 +23,11 @@ function TimeColumns({
|
|
|
20
23
|
updated[part] = String(next).padStart(2, "0");
|
|
21
24
|
onChange(updated.slice(0, seconds ? 3 : 2).join(":"));
|
|
22
25
|
};
|
|
23
|
-
return /* @__PURE__ */ jsx("div", { ref: root, className: s.columns, children: [
|
|
26
|
+
return /* @__PURE__ */ jsx("div", { ref: root, className: s.columns, children: [
|
|
27
|
+
text("\u5C0F\u65F6", "Hours", "\u5C0F\u6642"),
|
|
28
|
+
text("\u5206\u949F", "Minutes", "\u5206\u9418"),
|
|
29
|
+
...seconds ? [text("\u79D2", "Seconds")] : []
|
|
30
|
+
].map((name, part) => /* @__PURE__ */ jsxs("div", { className: s.column, children: [
|
|
24
31
|
/* @__PURE__ */ jsx("span", { children: name }),
|
|
25
32
|
/* @__PURE__ */ jsx("div", { role: "listbox", "aria-label": name, children: Array.from({ length: part ? 60 : 24 }, (_, n) => /* @__PURE__ */ jsx(
|
|
26
33
|
"button",
|
package/components/Timeline.js
CHANGED
package/components/Toast.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import {
|
|
3
4
|
useEffect,
|
|
@@ -16,6 +17,7 @@ import {
|
|
|
16
17
|
} from "lucide-react";
|
|
17
18
|
import { toastMotion, cancelMotion } from "./motion.js";
|
|
18
19
|
import s from "./Toast.module.css";
|
|
20
|
+
import { useUIText } from "./useUIText.js";
|
|
19
21
|
const icons = {
|
|
20
22
|
neutral: Info,
|
|
21
23
|
success: CheckCircle2,
|
|
@@ -35,6 +37,7 @@ function Toast({
|
|
|
35
37
|
onHoverChange,
|
|
36
38
|
onHeightChange
|
|
37
39
|
}) {
|
|
40
|
+
const { text } = useUIText();
|
|
38
41
|
const ref = useRef(null), current = useRef(toast), timer = useRef(void 0), pendingId = useRef(null);
|
|
39
42
|
const [pending, setPending] = useState(false), [error, setError] = useState("");
|
|
40
43
|
current.current = toast;
|
|
@@ -197,7 +200,7 @@ function Toast({
|
|
|
197
200
|
{
|
|
198
201
|
className: s.close,
|
|
199
202
|
type: "button",
|
|
200
|
-
"aria-label": "\u5173\u95ED\u63D0\u793A",
|
|
203
|
+
"aria-label": text("\u5173\u95ED\u63D0\u793A", "Dismiss notification", "\u95DC\u9589\u63D0\u793A"),
|
|
201
204
|
onClick: dismiss,
|
|
202
205
|
children: /* @__PURE__ */ jsx(X, {})
|
|
203
206
|
}
|
package/components/Tooltip.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import {
|
|
3
4
|
cloneElement,
|
|
@@ -9,6 +10,7 @@ import {
|
|
|
9
10
|
useState
|
|
10
11
|
} from "react";
|
|
11
12
|
import { useUIConfig } from "./UIProvider.js";
|
|
13
|
+
import { usePortalRoot } from "./usePortalRoot.js";
|
|
12
14
|
import { createPortal } from "react-dom";
|
|
13
15
|
import { surfaceMotion, cancelMotion } from "./motion.js";
|
|
14
16
|
import {
|
|
@@ -29,7 +31,8 @@ function Tooltip({
|
|
|
29
31
|
const config = useUIConfig();
|
|
30
32
|
const preferred = placement || config.tooltipPlacement, id = useId();
|
|
31
33
|
const anchor = useRef(null), popup = useRef(null), timer = useRef(void 0);
|
|
32
|
-
const
|
|
34
|
+
const portalRoot = usePortalRoot();
|
|
35
|
+
const owner = useSurfacePortal(), portalHost = owner?.host || portalRoot;
|
|
33
36
|
const [requestedOpen, setOpen] = useState(false), opened = useRef(false), visible = useRef(false);
|
|
34
37
|
const open = requestedOpen && owner?.active !== false;
|
|
35
38
|
const hide = useCallback((immediate = false) => {
|
|
@@ -57,7 +60,7 @@ function Tooltip({
|
|
|
57
60
|
return () => {
|
|
58
61
|
clearTimeout(timer.current);
|
|
59
62
|
releaseTooltip(hide, visible.current);
|
|
60
|
-
cancelMotion(node);
|
|
63
|
+
if (node) cancelMotion(node);
|
|
61
64
|
release();
|
|
62
65
|
};
|
|
63
66
|
}, [hide, portalHost]);
|
|
@@ -66,6 +69,7 @@ function Tooltip({
|
|
|
66
69
|
}, [owner?.active, hide]);
|
|
67
70
|
useLayoutEffect(() => {
|
|
68
71
|
const node = popup.current;
|
|
72
|
+
if (!node) return;
|
|
69
73
|
if (!open) {
|
|
70
74
|
if (node.matches(":popover-open"))
|
|
71
75
|
void surfaceMotion(node, "exit", node.dataset.offset).then((done) => {
|
|
@@ -150,7 +154,7 @@ function Tooltip({
|
|
|
150
154
|
})
|
|
151
155
|
}
|
|
152
156
|
),
|
|
153
|
-
createPortal(
|
|
157
|
+
portalHost && createPortal(
|
|
154
158
|
/* @__PURE__ */ jsx(
|
|
155
159
|
"div",
|
|
156
160
|
{
|
package/components/TreeGuides.js
CHANGED
package/components/TreeSelect.js
CHANGED
package/components/TreeTable.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
export type UIConfig = {
|
|
3
|
+
locale: string;
|
|
3
4
|
toastPosition: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
4
5
|
tooltipPlacement: "top" | "bottom" | "left" | "right";
|
|
5
6
|
requiredIndicator: "asterisk" | "text" | "none";
|
package/components/UIProvider.js
CHANGED
package/components/Upload.js
CHANGED
package/components/UploadList.js
CHANGED
package/components/appearance.js
CHANGED
package/components/color.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
const dateKey = (date) => `${String(date.getFullYear()).padStart(4, "0")}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
|
|
2
3
|
function calendarDate(year, month, day = 1) {
|
|
3
4
|
const date = /* @__PURE__ */ new Date(0);
|
package/components/field.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AriaAttributes } from "react";
|
|
1
|
+
import type { AriaAttributes, ReactNode } from "react";
|
|
2
2
|
export type FieldOptions = {
|
|
3
3
|
id?: string;
|
|
4
4
|
name?: string;
|
|
@@ -6,8 +6,8 @@ export type FieldOptions = {
|
|
|
6
6
|
required?: boolean;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
readOnly?: boolean;
|
|
9
|
-
error?:
|
|
10
|
-
hint?:
|
|
9
|
+
error?: ReactNode;
|
|
10
|
+
hint?: ReactNode;
|
|
11
11
|
"aria-describedby"?: string;
|
|
12
12
|
"aria-invalid"?: AriaAttributes["aria-invalid"];
|
|
13
13
|
};
|
|
@@ -18,8 +18,8 @@ export type FieldState = {
|
|
|
18
18
|
required: boolean;
|
|
19
19
|
disabled: boolean;
|
|
20
20
|
readOnly: boolean;
|
|
21
|
-
error?:
|
|
22
|
-
hint?:
|
|
21
|
+
error?: ReactNode;
|
|
22
|
+
hint?: ReactNode;
|
|
23
23
|
descriptionId?: string;
|
|
24
24
|
invalid: AriaAttributes["aria-invalid"];
|
|
25
25
|
};
|
|
@@ -50,8 +50,8 @@ export declare function useFieldControl(options: FieldOptions): {
|
|
|
50
50
|
required: boolean;
|
|
51
51
|
disabled: boolean;
|
|
52
52
|
readOnly: boolean;
|
|
53
|
-
error:
|
|
54
|
-
hint:
|
|
53
|
+
error: ReactNode;
|
|
54
|
+
hint: ReactNode;
|
|
55
55
|
descriptionId: string | undefined;
|
|
56
56
|
invalid: "false" | "grammar" | "spelling" | "true" | boolean;
|
|
57
57
|
wrapped: boolean;
|
package/components/field.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { createContext, useContext, useId } from "react";
|
|
2
3
|
const FieldContext = createContext(null);
|
|
3
4
|
function fieldInputProps(field) {
|
|
@@ -41,8 +42,8 @@ function useFieldControl(options) {
|
|
|
41
42
|
descriptionId: joinIds(
|
|
42
43
|
inherited?.descriptionId,
|
|
43
44
|
options["aria-describedby"],
|
|
44
|
-
hint ? id + "-hint" : void 0,
|
|
45
|
-
error ? id + "-error" : void 0
|
|
45
|
+
hint && (!inherited || id === inherited.id || options.hint !== void 0) ? id + "-hint" : void 0,
|
|
46
|
+
error && (!inherited || id === inherited.id || options.error !== void 0) ? id + "-error" : void 0
|
|
46
47
|
),
|
|
47
48
|
invalid: error ? true : options["aria-invalid"] ?? inherited?.invalid ?? false,
|
|
48
49
|
wrapped: !!inherited
|
package/components/hierarchy.js
CHANGED
package/components/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export { SelectSettingRow, type SelectSettingRowProps, } from "./SelectSettingRo
|
|
|
27
27
|
export { Skeleton } from "./Skeleton";
|
|
28
28
|
export { SkeletonRows } from "./SkeletonRows";
|
|
29
29
|
export { Switch } from "./Switch";
|
|
30
|
+
export { SwitchInput } from "./Switch";
|
|
30
31
|
export { ToastProvider } from "./ToastProvider";
|
|
31
32
|
export { Tooltip } from "./Tooltip";
|
|
32
33
|
export type { SelectOption } from "./types";
|
package/components/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { Badge } from "./Badge.js";
|
|
2
3
|
import { ActionSheet } from "./ActionSheet.js";
|
|
3
4
|
import { Button } from "./Button.js";
|
|
@@ -33,6 +34,7 @@ import {
|
|
|
33
34
|
import { Skeleton } from "./Skeleton.js";
|
|
34
35
|
import { SkeletonRows } from "./SkeletonRows.js";
|
|
35
36
|
import { Switch } from "./Switch.js";
|
|
37
|
+
import { SwitchInput } from "./Switch.js";
|
|
36
38
|
import { ToastProvider } from "./ToastProvider.js";
|
|
37
39
|
import { Tooltip } from "./Tooltip.js";
|
|
38
40
|
import { FileDropOverlay } from "./FileDropOverlay.js";
|
|
@@ -266,6 +268,7 @@ export {
|
|
|
266
268
|
Steps,
|
|
267
269
|
Surface,
|
|
268
270
|
Switch,
|
|
271
|
+
SwitchInput,
|
|
269
272
|
SwitchSettingRow,
|
|
270
273
|
SymbolPicker,
|
|
271
274
|
Table,
|
package/components/menuFocus.js
CHANGED
package/components/menuTypes.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";
|