@ctrl-ui/react 0.8.21 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/action-bar.d.ts +1 -2
- package/dist/action-bar.js +7 -8
- package/dist/blocks/design-canvas-inspector.js +4 -1
- package/dist/blocks/file-explorer.js +1 -1
- package/dist/chat-message.js +4 -13
- package/dist/hooks/use-textarea-trigger-menu.d.ts +21 -3
- package/dist/hooks/use-textarea-trigger-menu.js +36 -40
- package/dist/hooks/use-user-ask.d.ts +1 -0
- package/dist/hooks/use-user-ask.js +5 -1
- package/dist/knob-contracts/audio-recorder-knobs.d.ts +1 -1
- package/dist/knob-contracts/audio-recorder-knobs.js +2 -1
- package/dist/knob-contracts/chart-knobs.d.ts +4 -0
- package/dist/knob-contracts/chart-knobs.js +24 -0
- package/dist/knob-contracts/choice-knobs.d.ts +1 -1
- package/dist/knob-contracts/choice-knobs.js +1 -0
- package/dist/knob-contracts/dockable-panel-knobs.d.ts +1 -1
- package/dist/knob-contracts/dockable-panel-knobs.js +2 -1
- package/dist/knob-contracts/emoji-picker-knobs.d.ts +1 -1
- package/dist/knob-contracts/emoji-picker-knobs.js +1 -0
- package/dist/knob-contracts/empty-knobs.d.ts +1 -1
- package/dist/knob-contracts/empty-knobs.js +2 -1
- package/dist/knob-contracts/icon-picker-knobs.d.ts +1 -1
- package/dist/knob-contracts/icon-picker-knobs.js +3 -1
- package/dist/knob-contracts/range-knobs.d.ts +1 -1
- package/dist/knob-contracts/range-knobs.js +2 -0
- package/dist/knob-contracts/resizable-knobs.d.ts +1 -1
- package/dist/knob-contracts/resizable-knobs.js +2 -2
- package/dist/knob-contracts/sidebar-knobs.d.ts +1 -1
- package/dist/knob-contracts/sidebar-knobs.js +3 -1
- package/dist/knob-contracts/tabs-knobs.d.ts +1 -1
- package/dist/knob-contracts/tabs-knobs.js +2 -1
- package/dist/knob-contracts/tree-knobs.d.ts +1 -1
- package/dist/knob-contracts/tree-knobs.js +2 -1
- package/dist/lib/color.d.ts +2 -6
- package/dist/lib/color.js +45 -28
- package/dist/lib/contrast.d.ts +6 -0
- package/dist/lib/contrast.js +33 -1
- package/dist/lib/gradient.d.ts +17 -0
- package/dist/lib/gradient.js +69 -0
- package/dist/lib/level-meter-ballistics.d.ts +17 -0
- package/dist/lib/level-meter-ballistics.js +32 -0
- package/dist/markdown-editor/drag-handle.js +73 -10
- package/dist/markdown-editor/drag-preview.d.ts +3 -0
- package/dist/markdown-editor/drag-preview.js +31 -0
- package/dist/markdown-editor/extensions.d.ts +2 -2
- package/dist/markdown-editor/extensions.js +25 -3
- package/dist/markdown-editor/suggestions.js +5 -5
- package/dist/markdown-editor/task-item.d.ts +3 -0
- package/dist/markdown-editor/task-item.js +50 -0
- package/dist/markdown-editor/toolbar.js +122 -63
- package/dist/markdown-editor.js +3 -3
- package/dist/skin.d.ts +0 -1
- package/dist/styles/index.css +5 -3
- package/dist/styles/recipes/action-bar.css +1 -1
- package/dist/styles/recipes/activity.css +1 -1
- package/dist/styles/recipes/alert.css +9 -10
- package/dist/styles/recipes/app-shell-header.css +2 -2
- package/dist/styles/recipes/audio-recorder.css +15 -4
- package/dist/styles/recipes/audio-visualizer.css +4 -4
- package/dist/styles/recipes/avatar.css +3 -3
- package/dist/styles/recipes/badge.css +2 -2
- package/dist/styles/recipes/button.css +2 -5
- package/dist/styles/recipes/card.css +0 -2
- package/dist/styles/recipes/chart.css +378 -0
- package/dist/styles/recipes/chat-composer-attachment.css +3 -3
- package/dist/styles/recipes/chat-composer.css +3 -3
- package/dist/styles/recipes/chat-layout.css +2 -2
- package/dist/styles/recipes/chat-message-social.css +1 -1
- package/dist/styles/recipes/chat-message.css +1 -1
- package/dist/styles/recipes/choice.css +9 -3
- package/dist/styles/recipes/code-diff.css +1 -1
- package/dist/styles/recipes/code.css +1 -1
- package/dist/styles/recipes/color-picker-details.css +17 -11
- package/dist/styles/recipes/color-picker-values.css +17 -7
- package/dist/styles/recipes/color-picker.css +88 -70
- package/dist/styles/recipes/context.css +2 -2
- package/dist/styles/recipes/dockable-panel.css +9 -2
- package/dist/styles/recipes/dynamic-notification-motion.css +1 -55
- package/dist/styles/recipes/dynamic-notification.css +0 -1
- package/dist/styles/recipes/emoji-picker.css +35 -19
- package/dist/styles/recipes/empty.css +19 -14
- package/dist/styles/recipes/field-parts.css +2 -2
- package/dist/styles/recipes/field.css +6 -4
- package/dist/styles/recipes/filter-bar.css +10 -10
- package/dist/styles/recipes/flow.css +2 -2
- package/dist/styles/recipes/gradient-editor.css +8 -0
- package/dist/styles/recipes/icon-picker.css +45 -10
- package/dist/styles/recipes/inline-attachment.css +4 -4
- package/dist/styles/recipes/inline-citation.css +2 -2
- package/dist/styles/recipes/item.css +4 -4
- package/dist/styles/recipes/markdown-editor.css +35 -24
- package/dist/styles/recipes/markdown.css +23 -27
- package/dist/styles/recipes/page-layout.css +13 -11
- package/dist/styles/recipes/popup-controls.css +2 -2
- package/dist/styles/recipes/popup-lists.css +3 -3
- package/dist/styles/recipes/popup.css +11 -9
- package/dist/styles/recipes/range-level-meter.css +87 -0
- package/dist/styles/recipes/range.css +4 -5
- package/dist/styles/recipes/resizable.css +15 -10
- package/dist/styles/recipes/resize-handle.css +2 -2
- package/dist/styles/recipes/scroll-area.css +1 -1
- package/dist/styles/recipes/sidebar-menu.css +5 -15
- package/dist/styles/recipes/sidebar-mobile.css +4 -4
- package/dist/styles/recipes/sidebar-parts.css +26 -1
- package/dist/styles/recipes/sidebar.css +18 -31
- package/dist/styles/recipes/skeleton.css +10 -5
- package/dist/styles/recipes/stepper.css +1 -1
- package/dist/styles/recipes/switch.css +12 -11
- package/dist/styles/recipes/table-of-contents.css +6 -8
- package/dist/styles/recipes/table.css +4 -4
- package/dist/styles/recipes/tabs.css +10 -5
- package/dist/styles/recipes/task-list.css +3 -3
- package/dist/styles/recipes/tree.css +10 -3
- package/dist/styles/recipes/user-ask-details.css +5 -4
- package/dist/styles/recipes/user-ask.css +5 -5
- package/dist/styles/theme.css +158 -177
- package/dist/ui/chart-cartesian.d.ts +801 -0
- package/dist/ui/chart-cartesian.js +420 -0
- package/dist/ui/chart-colors.d.ts +7 -0
- package/dist/ui/chart-colors.js +27 -0
- package/dist/ui/chart-curves.d.ts +7 -0
- package/dist/ui/chart-curves.js +87 -0
- package/dist/ui/chart-marks.d.ts +68 -0
- package/dist/ui/chart-marks.js +227 -0
- package/dist/ui/chart-polar.d.ts +103 -0
- package/dist/ui/chart-polar.js +124 -0
- package/dist/ui/chart-series.d.ts +36 -0
- package/dist/ui/chart-series.js +71 -0
- package/dist/ui/chart.d.ts +32 -0
- package/dist/ui/chart.js +257 -0
- package/dist/ui/color-picker-area.d.ts +16 -0
- package/dist/ui/color-picker-area.js +175 -0
- package/dist/ui/color-picker-context.d.ts +27 -0
- package/dist/ui/color-picker-context.js +87 -0
- package/dist/ui/color-picker-contrast.d.ts +20 -0
- package/dist/ui/color-picker-contrast.js +129 -0
- package/dist/ui/color-picker-sliders.d.ts +15 -0
- package/dist/ui/color-picker-sliders.js +146 -0
- package/dist/ui/color-picker-swatches.d.ts +23 -0
- package/dist/ui/color-picker-swatches.js +94 -0
- package/dist/ui/color-picker-values.d.ts +59 -0
- package/dist/ui/color-picker-values.js +244 -0
- package/dist/ui/color-picker.d.ts +15 -110
- package/dist/ui/color-picker.js +30 -759
- package/dist/ui/emoji-picker.d.ts +10 -1
- package/dist/ui/emoji-picker.js +71 -14
- package/dist/ui/gradient-editor-controls.d.ts +19 -0
- package/dist/ui/gradient-editor-controls.js +75 -0
- package/dist/ui/gradient-editor.d.ts +23 -22
- package/dist/ui/gradient-editor.js +77 -123
- package/dist/ui/icon-picker.d.ts +1 -1
- package/dist/ui/icon-picker.js +11 -6
- package/dist/ui/level-meter.d.ts +31 -0
- package/dist/ui/level-meter.js +152 -0
- package/dist/ui/markdown-elements.d.ts +3 -1
- package/dist/ui/markdown-elements.js +62 -22
- package/dist/ui/markdown-heading.d.ts +9 -0
- package/dist/ui/markdown-heading.js +25 -0
- package/dist/ui/resizable.js +24 -9
- package/dist/ui/sidebar-provider.js +3 -12
- package/dist/ui/typography.d.ts +1 -0
- package/dist/ui/typography.js +12 -3
- package/dist/user-ask.js +4 -8
- package/package.json +5 -1
- package/dist/ui/emoji-icon-picker.d.ts +0 -13
- package/dist/ui/emoji-icon-picker.js +0 -50
package/dist/ui/icon-picker.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { ScrollArea } from "./scroll-area.js";
|
|
3
4
|
import { Input } from "./input.js";
|
|
4
5
|
import { Toolbar } from "@base-ui/react/toolbar";
|
|
5
6
|
import { createContext, useContext, useRef, useState } from "react";
|
|
@@ -62,7 +63,7 @@ function IconPickerSearch({ placeholder = "Search icons…", "aria-label": ariaL
|
|
|
62
63
|
}
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
|
-
function IconPickerContent({ className, empty = "No icons found.", "aria-label": ariaLabel = "Icons", ...props }) {
|
|
66
|
+
function IconPickerContent({ className, ref, empty = "No icons found.", "aria-label": ariaLabel = "Icons", ...props }) {
|
|
66
67
|
const picker = useIconPicker();
|
|
67
68
|
const buttonsRef = useRef(/* @__PURE__ */ new Map());
|
|
68
69
|
const normalizedSearch = picker.search.trim().toLocaleLowerCase();
|
|
@@ -76,12 +77,16 @@ function IconPickerContent({ className, empty = "No icons found.", "aria-label":
|
|
|
76
77
|
const nextIndex = Math.max(0, Math.min(filteredItems.length - 1, currentIndex + direction * picker.columns));
|
|
77
78
|
buttonsRef.current.get(filteredItems[nextIndex].value)?.focus();
|
|
78
79
|
};
|
|
79
|
-
return /* @__PURE__ */ jsx(
|
|
80
|
-
|
|
81
|
-
"data-control-family": "icon-picker",
|
|
82
|
-
"data-slot": "content",
|
|
80
|
+
return /* @__PURE__ */ jsx(ScrollArea, {
|
|
81
|
+
lockAxis: "x",
|
|
83
82
|
className,
|
|
84
|
-
|
|
83
|
+
viewportRef: ref,
|
|
84
|
+
viewportProps: {
|
|
85
|
+
"data-control-ui": "icon-picker",
|
|
86
|
+
"data-control-family": "icon-picker",
|
|
87
|
+
"data-slot": "content",
|
|
88
|
+
...props
|
|
89
|
+
},
|
|
85
90
|
children: filteredItems.length === 0 ? /* @__PURE__ */ jsx("div", {
|
|
86
91
|
"data-control-ui": "icon-picker",
|
|
87
92
|
"data-control-family": "icon-picker",
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { RangeKnobStyle } from "../knob-contracts/range-knobs.js";
|
|
2
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
3
|
+
//#region src/ui/level-meter.d.ts
|
|
4
|
+
export type LevelMeterSource = {
|
|
5
|
+
subscribe: (listener: (levelDb: number) => void) => () => void;
|
|
6
|
+
};
|
|
7
|
+
export type LevelMeterOrientation = "horizontal" | "vertical";
|
|
8
|
+
export type LevelMeterProps = Omit<ComponentProps<"div">, "style"> & {
|
|
9
|
+
value?: number;
|
|
10
|
+
source?: LevelMeterSource | null;
|
|
11
|
+
minDb?: number;
|
|
12
|
+
maxDb?: number;
|
|
13
|
+
warningDb?: number;
|
|
14
|
+
clipDb?: number;
|
|
15
|
+
orientation?: LevelMeterOrientation;
|
|
16
|
+
style?: CSSProperties & RangeKnobStyle;
|
|
17
|
+
};
|
|
18
|
+
export type LevelMeterTrackProps = Omit<ComponentProps<"div">, "style"> & {
|
|
19
|
+
style?: CSSProperties & RangeKnobStyle;
|
|
20
|
+
};
|
|
21
|
+
export type LevelMeterBarProps = Omit<ComponentProps<"div">, "style" | "children"> & {
|
|
22
|
+
style?: CSSProperties & RangeKnobStyle;
|
|
23
|
+
};
|
|
24
|
+
export type LevelMeterPeakProps = Omit<ComponentProps<"div">, "style" | "children"> & {
|
|
25
|
+
style?: CSSProperties & RangeKnobStyle;
|
|
26
|
+
};
|
|
27
|
+
export declare function LevelMeter({ value, source, minDb, maxDb, warningDb, clipDb, orientation, className, style, children, ref, ...props }: LevelMeterProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
28
|
+
export declare function LevelMeterTrack({ className, ...props }: LevelMeterTrackProps): import("react").JSX.Element;
|
|
29
|
+
export declare function LevelMeterBar({ className, ...props }: LevelMeterBarProps): import("react").JSX.Element;
|
|
30
|
+
export declare function LevelMeterPeak({ className, ...props }: LevelMeterPeakProps): import("react").JSX.Element;
|
|
31
|
+
//#endregion
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { advanceLevelMeterReading, levelMeterFraction, levelMeterReadingSettled } from "../lib/level-meter-ballistics.js";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/ui/level-meter.tsx
|
|
8
|
+
const ARIA_UPDATE_INTERVAL_MS = 250;
|
|
9
|
+
function createLevelMeterPainter() {
|
|
10
|
+
let root = null;
|
|
11
|
+
let scale = {
|
|
12
|
+
minDb: -60,
|
|
13
|
+
maxDb: 0
|
|
14
|
+
};
|
|
15
|
+
let announcesValue = false;
|
|
16
|
+
let targetDb = Number.NEGATIVE_INFINITY;
|
|
17
|
+
let reading = {
|
|
18
|
+
levelDb: scale.minDb,
|
|
19
|
+
peakDb: scale.minDb,
|
|
20
|
+
peakHeldUntilMs: 0
|
|
21
|
+
};
|
|
22
|
+
let frame = 0;
|
|
23
|
+
let lastFrameMs = 0;
|
|
24
|
+
let lastAnnouncedMs = Number.NEGATIVE_INFINITY;
|
|
25
|
+
const paint = (element, nowMs, settled) => {
|
|
26
|
+
element.style.setProperty("--_range-level", `${levelMeterFraction(reading.levelDb, scale)}`);
|
|
27
|
+
element.style.setProperty("--_range-level-peak", `${levelMeterFraction(reading.peakDb, scale)}`);
|
|
28
|
+
if (!announcesValue || !settled && nowMs - lastAnnouncedMs < ARIA_UPDATE_INTERVAL_MS) return;
|
|
29
|
+
lastAnnouncedMs = nowMs;
|
|
30
|
+
const roundedDb = Math.round(reading.levelDb);
|
|
31
|
+
element.setAttribute("aria-valuenow", `${roundedDb}`);
|
|
32
|
+
element.setAttribute("aria-valuetext", `${roundedDb} dB`);
|
|
33
|
+
};
|
|
34
|
+
const step = (nowMs) => {
|
|
35
|
+
frame = 0;
|
|
36
|
+
if (!root) return;
|
|
37
|
+
reading = advanceLevelMeterReading(reading, targetDb, nowMs - lastFrameMs, nowMs, scale);
|
|
38
|
+
lastFrameMs = nowMs;
|
|
39
|
+
const settled = levelMeterReadingSettled(reading, targetDb, scale);
|
|
40
|
+
paint(root, nowMs, settled);
|
|
41
|
+
if (!settled) frame = requestAnimationFrame(step);
|
|
42
|
+
};
|
|
43
|
+
const wake = () => {
|
|
44
|
+
if (frame !== 0 || !root) return;
|
|
45
|
+
lastFrameMs = performance.now();
|
|
46
|
+
frame = requestAnimationFrame(step);
|
|
47
|
+
};
|
|
48
|
+
return {
|
|
49
|
+
attach(element, nextScale, nextAnnouncesValue) {
|
|
50
|
+
root = element;
|
|
51
|
+
scale = nextScale;
|
|
52
|
+
announcesValue = nextAnnouncesValue;
|
|
53
|
+
wake();
|
|
54
|
+
return () => {
|
|
55
|
+
cancelAnimationFrame(frame);
|
|
56
|
+
frame = 0;
|
|
57
|
+
root = null;
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
setTarget(levelDb) {
|
|
61
|
+
targetDb = levelDb;
|
|
62
|
+
wake();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function LevelMeter({ value, source, minDb = -60, maxDb = 0, warningDb = -18, clipDb = -6, orientation = "horizontal", className, style, children, ref, ...props }) {
|
|
67
|
+
const [painter] = useState(createLevelMeterPainter);
|
|
68
|
+
const rootRef = useRef(null);
|
|
69
|
+
const labelled = Boolean(props["aria-label"] || props["aria-labelledby"]);
|
|
70
|
+
const scale = {
|
|
71
|
+
minDb,
|
|
72
|
+
maxDb
|
|
73
|
+
};
|
|
74
|
+
const zoneStyle = {
|
|
75
|
+
"--_range-level-warning-start": `${levelMeterFraction(warningDb, scale)}`,
|
|
76
|
+
"--_range-level-clip-start": `${levelMeterFraction(clipDb, scale)}`,
|
|
77
|
+
...style
|
|
78
|
+
};
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
const root = rootRef.current;
|
|
81
|
+
if (!root) return;
|
|
82
|
+
return painter.attach(root, {
|
|
83
|
+
minDb,
|
|
84
|
+
maxDb
|
|
85
|
+
}, labelled);
|
|
86
|
+
}, [
|
|
87
|
+
painter,
|
|
88
|
+
minDb,
|
|
89
|
+
maxDb,
|
|
90
|
+
labelled
|
|
91
|
+
]);
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
if (source) return source.subscribe(painter.setTarget);
|
|
94
|
+
painter.setTarget(value ?? Number.NEGATIVE_INFINITY);
|
|
95
|
+
}, [
|
|
96
|
+
painter,
|
|
97
|
+
source,
|
|
98
|
+
value
|
|
99
|
+
]);
|
|
100
|
+
return useRender({
|
|
101
|
+
defaultTagName: "div",
|
|
102
|
+
ref: [ref ?? null, rootRef],
|
|
103
|
+
props: {
|
|
104
|
+
...props,
|
|
105
|
+
role: labelled ? "meter" : void 0,
|
|
106
|
+
"aria-hidden": labelled ? void 0 : true,
|
|
107
|
+
"aria-valuemin": labelled ? minDb : void 0,
|
|
108
|
+
"aria-valuemax": labelled ? maxDb : void 0,
|
|
109
|
+
"aria-valuenow": labelled ? minDb : void 0,
|
|
110
|
+
"data-control-ui": "level-meter",
|
|
111
|
+
"data-control-family": "range",
|
|
112
|
+
"data-range-kind": "level-meter",
|
|
113
|
+
"data-slot": "root",
|
|
114
|
+
"data-orientation": orientation,
|
|
115
|
+
className: cn("flex", className),
|
|
116
|
+
style: zoneStyle,
|
|
117
|
+
children: children ?? /* @__PURE__ */ jsx(LevelMeterTrack, { children: /* @__PURE__ */ jsx(LevelMeterBar, {}) })
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function LevelMeterTrack({ className, ...props }) {
|
|
122
|
+
return /* @__PURE__ */ jsx("div", {
|
|
123
|
+
"data-control-ui": "level-meter",
|
|
124
|
+
"data-control-family": "range",
|
|
125
|
+
"data-range-kind": "level-meter",
|
|
126
|
+
"data-slot": "track",
|
|
127
|
+
className: cn("relative overflow-hidden", className),
|
|
128
|
+
...props
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
function LevelMeterBar({ className, ...props }) {
|
|
132
|
+
return /* @__PURE__ */ jsx("div", {
|
|
133
|
+
"data-control-ui": "level-meter",
|
|
134
|
+
"data-control-family": "range",
|
|
135
|
+
"data-range-kind": "level-meter",
|
|
136
|
+
"data-slot": "bar",
|
|
137
|
+
className: cn("absolute inset-0", className),
|
|
138
|
+
...props
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
function LevelMeterPeak({ className, ...props }) {
|
|
142
|
+
return /* @__PURE__ */ jsx("div", {
|
|
143
|
+
"data-control-ui": "level-meter",
|
|
144
|
+
"data-control-family": "range",
|
|
145
|
+
"data-range-kind": "level-meter",
|
|
146
|
+
"data-slot": "peak",
|
|
147
|
+
className: cn("absolute inset-0", className),
|
|
148
|
+
...props
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
//#endregion
|
|
152
|
+
export { LevelMeter, LevelMeterBar, LevelMeterPeak, LevelMeterTrack };
|
|
@@ -11,6 +11,7 @@ type MarkdownElementProps<Tag extends keyof JSX.IntrinsicElements> = ComponentPr
|
|
|
11
11
|
} & {
|
|
12
12
|
style?: CSSProperties & MarkdownKnobStyle;
|
|
13
13
|
};
|
|
14
|
+
export declare function MarkdownInput({ type, checked, className, node: _node, ...props }: MarkdownElementProps<"input">): JSX.Element;
|
|
14
15
|
export declare function MarkdownInlineCode({ className, children, node: _node, ...props }: MarkdownCodeProps): JSX.Element;
|
|
15
16
|
export declare function MarkdownPre({ children, node: _node }: MarkdownElementProps<"pre">): JSX.Element;
|
|
16
17
|
export declare function MarkdownCode({ className, children, node: _node, ...props }: MarkdownCodeProps): JSX.Element;
|
|
@@ -23,7 +24,7 @@ export declare function MarkdownH6({ className, node: _node, ...props }: Markdow
|
|
|
23
24
|
export declare function MarkdownP({ className, node: _node, ...props }: MarkdownElementProps<"p">): JSX.Element;
|
|
24
25
|
export declare function MarkdownUl({ className, node: _node, ...props }: MarkdownElementProps<"ul">): JSX.Element;
|
|
25
26
|
export declare function MarkdownOl({ className, node: _node, ...props }: MarkdownElementProps<"ol">): JSX.Element;
|
|
26
|
-
export declare function MarkdownLi({ className, node: _node, ...props }: MarkdownElementProps<"li">): JSX.Element;
|
|
27
|
+
export declare function MarkdownLi({ id, className, node: _node, ...props }: MarkdownElementProps<"li">): JSX.Element;
|
|
27
28
|
export declare function MarkdownA({ className, node: _node, ...props }: MarkdownElementProps<"a">): JSX.Element;
|
|
28
29
|
export declare function MarkdownBlockquote({ className, node: _node, ...props }: MarkdownElementProps<"blockquote">): JSX.Element;
|
|
29
30
|
export declare function MarkdownHr({ className, node: _node, ...props }: MarkdownElementProps<"hr">): JSX.Element;
|
|
@@ -33,6 +34,7 @@ export declare function MarkdownTable({ className, children, node: _node, ...pro
|
|
|
33
34
|
export declare function MarkdownTh({ className, node: _node, ...props }: MarkdownElementProps<"th">): JSX.Element;
|
|
34
35
|
export declare function MarkdownTd({ className, node: _node, ...props }: MarkdownElementProps<"td">): JSX.Element;
|
|
35
36
|
export declare const markdownComponents: {
|
|
37
|
+
input: typeof MarkdownInput;
|
|
36
38
|
code: typeof MarkdownCode;
|
|
37
39
|
inlineCode: typeof MarkdownInlineCode;
|
|
38
40
|
h1: typeof MarkdownH1;
|
|
@@ -1,9 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { cn } from "../lib/cn.js";
|
|
2
3
|
import { ScrollArea } from "./scroll-area.js";
|
|
4
|
+
import { Heading } from "./typography.js";
|
|
3
5
|
import { Code, CodeActions, CodeContent, CodeCopy, CodeHeader, CodeTitle } from "./code.js";
|
|
6
|
+
import { Checkbox } from "./checkbox.js";
|
|
4
7
|
import { CodeDiff } from "./code-diff.js";
|
|
5
|
-
import {
|
|
8
|
+
import { markdownHeadingAttributes } from "./markdown-heading.js";
|
|
9
|
+
import { createContext, use, useId } from "react";
|
|
10
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
11
|
//#region src/ui/markdown-elements.tsx
|
|
12
|
+
const MarkdownTaskLabelContext = createContext(void 0);
|
|
13
|
+
function MarkdownInput({ type, checked, className, node: _node, ...props }) {
|
|
14
|
+
const labelId = use(MarkdownTaskLabelContext);
|
|
15
|
+
if (type !== "checkbox") return /* @__PURE__ */ jsx("input", {
|
|
16
|
+
type,
|
|
17
|
+
checked,
|
|
18
|
+
className,
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
return /* @__PURE__ */ jsx(Checkbox, {
|
|
22
|
+
checked: Boolean(checked),
|
|
23
|
+
readOnly: true,
|
|
24
|
+
className,
|
|
25
|
+
"aria-label": labelId ? void 0 : "Task item",
|
|
26
|
+
"aria-labelledby": labelId
|
|
27
|
+
});
|
|
28
|
+
}
|
|
7
29
|
function textValue(children) {
|
|
8
30
|
return Array.isArray(children) ? children.join("") : String(children ?? "");
|
|
9
31
|
}
|
|
@@ -21,7 +43,7 @@ function MarkdownInlineCode({ className, children, node: _node, ...props }) {
|
|
|
21
43
|
});
|
|
22
44
|
}
|
|
23
45
|
function MarkdownPre({ children, node: _node }) {
|
|
24
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
46
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
25
47
|
}
|
|
26
48
|
function MarkdownCode({ className, children, node: _node, ...props }) {
|
|
27
49
|
const lang = languageFromClassName(className);
|
|
@@ -44,56 +66,68 @@ function MarkdownCode({ className, children, node: _node, ...props }) {
|
|
|
44
66
|
})] });
|
|
45
67
|
}
|
|
46
68
|
function MarkdownH1({ className, node: _node, ...props }) {
|
|
47
|
-
|
|
69
|
+
const { class: headingClass } = markdownHeadingAttributes(1);
|
|
70
|
+
return /* @__PURE__ */ jsx(Heading, {
|
|
71
|
+
level: 1,
|
|
48
72
|
"data-control-ui": "markdown",
|
|
49
73
|
"data-control-family": "markdown",
|
|
50
74
|
"data-slot": "h1",
|
|
51
|
-
className,
|
|
75
|
+
className: cn(headingClass, className),
|
|
52
76
|
...props
|
|
53
77
|
});
|
|
54
78
|
}
|
|
55
79
|
function MarkdownH2({ className, node: _node, ...props }) {
|
|
56
|
-
|
|
80
|
+
const { class: headingClass } = markdownHeadingAttributes(2);
|
|
81
|
+
return /* @__PURE__ */ jsx(Heading, {
|
|
82
|
+
level: 2,
|
|
57
83
|
"data-control-ui": "markdown",
|
|
58
84
|
"data-control-family": "markdown",
|
|
59
85
|
"data-slot": "h2",
|
|
60
|
-
className,
|
|
86
|
+
className: cn(headingClass, className),
|
|
61
87
|
...props
|
|
62
88
|
});
|
|
63
89
|
}
|
|
64
90
|
function MarkdownH3({ className, node: _node, ...props }) {
|
|
65
|
-
|
|
91
|
+
const { class: headingClass } = markdownHeadingAttributes(3);
|
|
92
|
+
return /* @__PURE__ */ jsx(Heading, {
|
|
93
|
+
level: 3,
|
|
66
94
|
"data-control-ui": "markdown",
|
|
67
95
|
"data-control-family": "markdown",
|
|
68
96
|
"data-slot": "h3",
|
|
69
|
-
className,
|
|
97
|
+
className: cn(headingClass, className),
|
|
70
98
|
...props
|
|
71
99
|
});
|
|
72
100
|
}
|
|
73
101
|
function MarkdownH4({ className, node: _node, ...props }) {
|
|
74
|
-
|
|
102
|
+
const { class: headingClass } = markdownHeadingAttributes(4);
|
|
103
|
+
return /* @__PURE__ */ jsx(Heading, {
|
|
104
|
+
level: 4,
|
|
75
105
|
"data-control-ui": "markdown",
|
|
76
106
|
"data-control-family": "markdown",
|
|
77
107
|
"data-slot": "h4",
|
|
78
|
-
className,
|
|
108
|
+
className: cn(headingClass, className),
|
|
79
109
|
...props
|
|
80
110
|
});
|
|
81
111
|
}
|
|
82
112
|
function MarkdownH5({ className, node: _node, ...props }) {
|
|
83
|
-
|
|
113
|
+
const { class: headingClass } = markdownHeadingAttributes(5);
|
|
114
|
+
return /* @__PURE__ */ jsx(Heading, {
|
|
115
|
+
level: 5,
|
|
84
116
|
"data-control-ui": "markdown",
|
|
85
117
|
"data-control-family": "markdown",
|
|
86
118
|
"data-slot": "h5",
|
|
87
|
-
className,
|
|
119
|
+
className: cn(headingClass, className),
|
|
88
120
|
...props
|
|
89
121
|
});
|
|
90
122
|
}
|
|
91
123
|
function MarkdownH6({ className, node: _node, ...props }) {
|
|
92
|
-
|
|
124
|
+
const { class: headingClass } = markdownHeadingAttributes(6);
|
|
125
|
+
return /* @__PURE__ */ jsx(Heading, {
|
|
126
|
+
level: 6,
|
|
93
127
|
"data-control-ui": "markdown",
|
|
94
128
|
"data-control-family": "markdown",
|
|
95
129
|
"data-slot": "h6",
|
|
96
|
-
className,
|
|
130
|
+
className: cn(headingClass, className),
|
|
97
131
|
...props
|
|
98
132
|
});
|
|
99
133
|
}
|
|
@@ -124,13 +158,18 @@ function MarkdownOl({ className, node: _node, ...props }) {
|
|
|
124
158
|
...props
|
|
125
159
|
});
|
|
126
160
|
}
|
|
127
|
-
function MarkdownLi({ className, node: _node, ...props }) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
161
|
+
function MarkdownLi({ id, className, node: _node, ...props }) {
|
|
162
|
+
const labelId = useId();
|
|
163
|
+
return /* @__PURE__ */ jsx(MarkdownTaskLabelContext, {
|
|
164
|
+
value: id ?? labelId,
|
|
165
|
+
children: /* @__PURE__ */ jsx("li", {
|
|
166
|
+
id: id ?? labelId,
|
|
167
|
+
"data-control-ui": "markdown",
|
|
168
|
+
"data-control-family": "markdown",
|
|
169
|
+
"data-slot": "list-item",
|
|
170
|
+
className,
|
|
171
|
+
...props
|
|
172
|
+
})
|
|
134
173
|
});
|
|
135
174
|
}
|
|
136
175
|
function MarkdownA({ className, node: _node, ...props }) {
|
|
@@ -215,6 +254,7 @@ function MarkdownTd({ className, node: _node, ...props }) {
|
|
|
215
254
|
});
|
|
216
255
|
}
|
|
217
256
|
const markdownComponents = {
|
|
257
|
+
input: MarkdownInput,
|
|
218
258
|
code: MarkdownCode,
|
|
219
259
|
inlineCode: MarkdownInlineCode,
|
|
220
260
|
h1: MarkdownH1,
|
|
@@ -237,4 +277,4 @@ const markdownComponents = {
|
|
|
237
277
|
td: MarkdownTd
|
|
238
278
|
};
|
|
239
279
|
//#endregion
|
|
240
|
-
export { MarkdownA, MarkdownBlockquote, MarkdownCode, MarkdownEm, MarkdownH1, MarkdownH2, MarkdownH3, MarkdownH4, MarkdownH5, MarkdownH6, MarkdownHr, MarkdownInlineCode, MarkdownLi, MarkdownOl, MarkdownP, MarkdownPre, MarkdownStrong, MarkdownTable, MarkdownTd, MarkdownTh, MarkdownUl, markdownComponents };
|
|
280
|
+
export { MarkdownA, MarkdownBlockquote, MarkdownCode, MarkdownEm, MarkdownH1, MarkdownH2, MarkdownH3, MarkdownH4, MarkdownH5, MarkdownH6, MarkdownHr, MarkdownInlineCode, MarkdownInput, MarkdownLi, MarkdownOl, MarkdownP, MarkdownPre, MarkdownStrong, MarkdownTable, MarkdownTd, MarkdownTh, MarkdownUl, markdownComponents };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HeadingLevel } from "./typography.js";
|
|
2
|
+
//#region src/ui/markdown-heading.d.ts
|
|
3
|
+
export declare function markdownHeadingAttributes(level: HeadingLevel): {
|
|
4
|
+
"data-control-ui": string;
|
|
5
|
+
"data-control-family": string;
|
|
6
|
+
"data-slot": string;
|
|
7
|
+
class: string;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { headingClassName } from "./typography.js";
|
|
2
|
+
//#region src/ui/markdown-heading.ts
|
|
3
|
+
const headingSizes = {
|
|
4
|
+
1: "heading-2",
|
|
5
|
+
2: "heading-3",
|
|
6
|
+
3: "heading-4",
|
|
7
|
+
4: "body",
|
|
8
|
+
5: "body",
|
|
9
|
+
6: "body"
|
|
10
|
+
};
|
|
11
|
+
function markdownHeadingAttributes(level) {
|
|
12
|
+
return {
|
|
13
|
+
"data-control-ui": "markdown",
|
|
14
|
+
"data-control-family": "markdown",
|
|
15
|
+
"data-slot": `h${level}`,
|
|
16
|
+
class: headingClassName({
|
|
17
|
+
level,
|
|
18
|
+
size: headingSizes[level],
|
|
19
|
+
weight: level >= 4 ? "semibold" : void 0,
|
|
20
|
+
className: level >= 4 ? "leading-tight" : void 0
|
|
21
|
+
})
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { markdownHeadingAttributes };
|
package/dist/ui/resizable.js
CHANGED
|
@@ -208,26 +208,41 @@ function ResizableFloatingPanel({ side = "right", size: controlledSize, defaultS
|
|
|
208
208
|
}
|
|
209
209
|
function GripIcon({ className }) {
|
|
210
210
|
return /* @__PURE__ */ jsxs("svg", {
|
|
211
|
-
viewBox: "0 0
|
|
212
|
-
width: "
|
|
213
|
-
height: "
|
|
211
|
+
viewBox: "0 0 6 10",
|
|
212
|
+
width: "6",
|
|
213
|
+
height: "10",
|
|
214
214
|
fill: "currentColor",
|
|
215
215
|
"aria-hidden": "true",
|
|
216
216
|
className,
|
|
217
217
|
children: [
|
|
218
218
|
/* @__PURE__ */ jsx("circle", {
|
|
219
|
-
cx: "
|
|
220
|
-
cy: "
|
|
219
|
+
cx: "1",
|
|
220
|
+
cy: "1",
|
|
221
221
|
r: "1"
|
|
222
222
|
}),
|
|
223
223
|
/* @__PURE__ */ jsx("circle", {
|
|
224
|
-
cx: "
|
|
225
|
-
cy: "
|
|
224
|
+
cx: "5",
|
|
225
|
+
cy: "1",
|
|
226
226
|
r: "1"
|
|
227
227
|
}),
|
|
228
228
|
/* @__PURE__ */ jsx("circle", {
|
|
229
|
-
cx: "
|
|
230
|
-
cy: "
|
|
229
|
+
cx: "1",
|
|
230
|
+
cy: "5",
|
|
231
|
+
r: "1"
|
|
232
|
+
}),
|
|
233
|
+
/* @__PURE__ */ jsx("circle", {
|
|
234
|
+
cx: "5",
|
|
235
|
+
cy: "5",
|
|
236
|
+
r: "1"
|
|
237
|
+
}),
|
|
238
|
+
/* @__PURE__ */ jsx("circle", {
|
|
239
|
+
cx: "1",
|
|
240
|
+
cy: "9",
|
|
241
|
+
r: "1"
|
|
242
|
+
}),
|
|
243
|
+
/* @__PURE__ */ jsx("circle", {
|
|
244
|
+
cx: "5",
|
|
245
|
+
cy: "9",
|
|
231
246
|
r: "1"
|
|
232
247
|
})
|
|
233
248
|
]
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
-
import { useSkin } from "../skin-provider.js";
|
|
4
3
|
import { SIDEBAR_COOKIE_NAME } from "../control-props.js";
|
|
5
4
|
import { TooltipProvider } from "./tooltip.js";
|
|
6
5
|
import { useIsMobile } from "../hooks/use-mobile.js";
|
|
7
|
-
import { createContext, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
6
|
+
import { createContext, useContext, useEffect, useEffectEvent, useId, useLayoutEffect, useRef, useState } from "react";
|
|
8
7
|
import { useRender } from "@base-ui/react/use-render";
|
|
9
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
9
|
//#region src/ui/sidebar-provider.tsx
|
|
11
10
|
const SIDEBAR_COOKIE_MAX_AGE = 604800;
|
|
12
|
-
const SIDEBAR_WIDTH = "16rem";
|
|
13
|
-
const SIDEBAR_WIDTH_ICON = "3rem";
|
|
14
11
|
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
15
12
|
const SIDEBAR_MOBILE_BREAKPOINT = "--breakpoint-lg";
|
|
16
13
|
const SidebarElementsContext = createContext(null);
|
|
@@ -39,7 +36,6 @@ function useSidebar() {
|
|
|
39
36
|
return context;
|
|
40
37
|
}
|
|
41
38
|
function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange, defaultWidth, minWidth = 224, maxWidth = 420, width: widthProp, onWidthChange, persistOpen = true, keyboardShortcut = SIDEBAR_KEYBOARD_SHORTCUT, layout = "viewport", skipLinkLabel = "Skip to content", contentId: contentIdProp, ref, className, style, children, ...props }) {
|
|
42
|
-
const skin = useSkin();
|
|
43
39
|
const isMobile = useIsMobile(SIDEBAR_MOBILE_BREAKPOINT);
|
|
44
40
|
const [openMobile, setOpenMobile] = useState(false);
|
|
45
41
|
if (!isMobile && openMobile) setOpenMobile(false);
|
|
@@ -88,10 +84,7 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange, def
|
|
|
88
84
|
if (persistOpen) document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
89
85
|
};
|
|
90
86
|
const toggleSidebar = () => isMobile ? setOpenMobile((prev) => !prev) : setOpen(!open);
|
|
91
|
-
const
|
|
92
|
-
useEffect(() => {
|
|
93
|
-
toggleRef.current = toggleSidebar;
|
|
94
|
-
});
|
|
87
|
+
const toggleSidebarFromShortcut = useEffectEvent(toggleSidebar);
|
|
95
88
|
useEffect(() => {
|
|
96
89
|
if (keyboardShortcut === null) return;
|
|
97
90
|
const shortcut = keyboardShortcut.toLowerCase();
|
|
@@ -101,7 +94,7 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange, def
|
|
|
101
94
|
const target = event.target;
|
|
102
95
|
if (target instanceof HTMLElement && (target.isContentEditable || target.closest("input, textarea, select") !== null)) return;
|
|
103
96
|
event.preventDefault();
|
|
104
|
-
|
|
97
|
+
toggleSidebarFromShortcut();
|
|
105
98
|
};
|
|
106
99
|
window.addEventListener("keydown", handleKeyDown);
|
|
107
100
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
@@ -124,8 +117,6 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange, def
|
|
|
124
117
|
contentId
|
|
125
118
|
};
|
|
126
119
|
const wrapperStyle = {
|
|
127
|
-
"--sidebar-width": skin.sidebarWidth ?? SIDEBAR_WIDTH,
|
|
128
|
-
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
129
120
|
...style,
|
|
130
121
|
...width === void 0 ? {} : { "--sidebar-width": `${width}px` }
|
|
131
122
|
};
|
package/dist/ui/typography.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export type HeadingProps = ComponentProps<"h1"> & {
|
|
|
34
34
|
weight?: TextWeight;
|
|
35
35
|
tone?: TypeTone;
|
|
36
36
|
};
|
|
37
|
+
export declare function headingClassName({ level, size, weight, tone, className }: HeadingProps): string;
|
|
37
38
|
export declare function Heading({ level, size, weight, tone, className, ...props }: HeadingProps): import("react").JSX.Element;
|
|
38
39
|
export type TextTag = "p" | "span" | "div" | "small" | "strong" | "em" | "code" | "li" | "dt" | "dd" | "figcaption" | "legend" | "blockquote";
|
|
39
40
|
export type TextProps = HTMLAttributes<HTMLElement> & {
|
package/dist/ui/typography.js
CHANGED
|
@@ -33,13 +33,22 @@ const headingSizeByLevel = {
|
|
|
33
33
|
5: "heading-4",
|
|
34
34
|
6: "heading-4"
|
|
35
35
|
};
|
|
36
|
-
function
|
|
36
|
+
function headingClassName({ level, size = headingSizeByLevel[level], weight, tone = "default", className }) {
|
|
37
|
+
return cn(sizeClassNames[size], weight ? weightClassNames[weight] : void 0, toneClassNames[tone], className);
|
|
38
|
+
}
|
|
39
|
+
function Heading({ level, size, weight, tone, className, ...props }) {
|
|
37
40
|
const Tag = `h${level}`;
|
|
38
41
|
return /* @__PURE__ */ jsx(Tag, {
|
|
39
42
|
"data-control-ui": "typography",
|
|
40
43
|
"data-control-family": "typography",
|
|
41
44
|
"data-slot": "heading",
|
|
42
|
-
className:
|
|
45
|
+
className: headingClassName({
|
|
46
|
+
level,
|
|
47
|
+
size,
|
|
48
|
+
weight,
|
|
49
|
+
tone,
|
|
50
|
+
className
|
|
51
|
+
}),
|
|
43
52
|
...props
|
|
44
53
|
});
|
|
45
54
|
}
|
|
@@ -58,4 +67,4 @@ function Text({ as: Tag = "span", size = "body", weight, tone = "default", class
|
|
|
58
67
|
});
|
|
59
68
|
}
|
|
60
69
|
//#endregion
|
|
61
|
-
export { Heading, Text };
|
|
70
|
+
export { Heading, Text, headingClassName };
|
package/dist/user-ask.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Button } from "./ui/button.js";
|
|
|
4
4
|
import { LiveStatus } from "./ui/live-status.js";
|
|
5
5
|
import { useUserAsk } from "./hooks/use-user-ask.js";
|
|
6
6
|
import { Kbd } from "./ui/kbd.js";
|
|
7
|
-
import { createContext, useContext, useEffect, useId, useRef
|
|
7
|
+
import { createContext, useContext, useEffect, useId, useRef } from "react";
|
|
8
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { Check, ChevronLeft, ChevronRight, PencilLine } from "lucide-react";
|
|
10
10
|
//#region src/user-ask.tsx
|
|
@@ -30,21 +30,17 @@ function UserAsk({ onComplete, onDismiss, autoFocus = false, questionStatusLabel
|
|
|
30
30
|
});
|
|
31
31
|
const titleId = useId();
|
|
32
32
|
const panelRef = useRef(null);
|
|
33
|
-
const
|
|
34
|
-
const questionStatus = hasNavigated && ask.activeQuestion ? questionStatusLabel(ask.activeIndex + 1, ask.questions.length, ask.activeQuestion.title) : "";
|
|
33
|
+
const questionStatus = ask.hasNavigated && ask.activeQuestion ? questionStatusLabel(ask.activeIndex + 1, ask.questions.length, ask.activeQuestion.title) : "";
|
|
35
34
|
useEffect(() => {
|
|
36
35
|
if (autoFocus) panelRef.current?.focus();
|
|
37
36
|
}, [autoFocus]);
|
|
38
|
-
const lastActiveIndex = useRef(ask.activeIndex);
|
|
39
37
|
useEffect(() => {
|
|
40
|
-
if (
|
|
41
|
-
lastActiveIndex.current = ask.activeIndex;
|
|
42
|
-
setHasNavigated(true);
|
|
38
|
+
if (!ask.hasNavigated) return;
|
|
43
39
|
const panel = panelRef.current;
|
|
44
40
|
const active = document.activeElement;
|
|
45
41
|
const activeIsUsable = active instanceof HTMLElement && panel?.contains(active) && active.checkVisibility();
|
|
46
42
|
if (panel && !activeIsUsable) panel.focus();
|
|
47
|
-
}, [ask.activeIndex]);
|
|
43
|
+
}, [ask.activeIndex, ask.hasNavigated]);
|
|
48
44
|
return /* @__PURE__ */ jsx(UserAskContext.Provider, {
|
|
49
45
|
value: {
|
|
50
46
|
...ask,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctrl-ui/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Control UI components, blocks, and primitives with neutral defaults and consumer-owned themes.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@base-ui/react": "^1.8.0",
|
|
38
|
+
"@tanstack/charts": "^1.1.0",
|
|
38
39
|
"@tanstack/react-virtual": "^3.14.13",
|
|
39
40
|
"@tiptap/core": "3.31.4",
|
|
40
41
|
"@tiptap/extension-image": "3.31.4",
|
|
@@ -71,6 +72,9 @@
|
|
|
71
72
|
"zod": "^4.6.5"
|
|
72
73
|
},
|
|
73
74
|
"peerDependenciesMeta": {
|
|
75
|
+
"@tanstack/charts": {
|
|
76
|
+
"optional": true
|
|
77
|
+
},
|
|
74
78
|
"@tanstack/react-virtual": {
|
|
75
79
|
"optional": true
|
|
76
80
|
},
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { EmojiPicker } from "./emoji-picker.js";
|
|
2
|
-
import { IconPicker } from "./icon-picker.js";
|
|
3
|
-
import { Tabs, TabsList } from "./tabs.js";
|
|
4
|
-
import { ComponentProps } from "react";
|
|
5
|
-
//#region src/ui/emoji-icon-picker.d.ts
|
|
6
|
-
export declare function EmojiIconPicker({ children, defaultValue, ...props }: ComponentProps<typeof Tabs<"emoji" | "icons">>): import("react").JSX.Element;
|
|
7
|
-
export declare function EmojiIconPickerTabs({ emojiLabel, iconsLabel, ...props }: Omit<ComponentProps<typeof TabsList>, "children"> & {
|
|
8
|
-
emojiLabel?: string;
|
|
9
|
-
iconsLabel?: string;
|
|
10
|
-
}): import("react").JSX.Element;
|
|
11
|
-
export declare function EmojiIconPickerEmoji(props: ComponentProps<typeof EmojiPicker>): import("react").JSX.Element;
|
|
12
|
-
export declare function EmojiIconPickerIcons(props: ComponentProps<typeof IconPicker>): import("react").JSX.Element;
|
|
13
|
-
//#endregion
|