@ctrl-ui/react 0.8.6 → 0.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action-bar.d.ts +15 -7
- package/dist/action-bar.js +39 -19
- package/dist/activity.js +7 -15
- package/dist/audio-recorder.d.ts +14 -4
- package/dist/audio-recorder.js +82 -29
- package/dist/audio-visualizer.js +1 -1
- package/dist/blocks/coding-agent.js +54 -57
- package/dist/blocks/design-canvas-data.d.ts +32 -0
- package/dist/blocks/design-canvas-data.js +100 -0
- package/dist/blocks/design-canvas-inspector.d.ts +8 -0
- package/dist/blocks/design-canvas-inspector.js +238 -0
- package/dist/blocks/design-canvas.d.ts +21 -0
- package/dist/blocks/design-canvas.js +452 -0
- package/dist/blocks/discussion.d.ts +28 -0
- package/dist/blocks/discussion.js +67 -0
- package/dist/blocks/file-explorer-data.d.ts +1 -0
- package/dist/blocks/file-explorer-data.js +4 -1
- package/dist/blocks/file-explorer.d.ts +9 -1
- package/dist/blocks/file-explorer.js +461 -192
- package/dist/blocks/settings.d.ts +2 -1
- package/dist/blocks/settings.js +101 -79
- package/dist/blocks/team-chat.d.ts +12 -0
- package/dist/blocks/team-chat.js +26 -0
- package/dist/blocks/theme-toggle.js +23 -31
- package/dist/chat-composer-attachment.d.ts +12 -3
- package/dist/chat-composer-attachment.js +61 -19
- package/dist/chat-composer-editor/extensions/mention.d.ts +5 -1
- package/dist/chat-composer-editor/extensions/mention.js +58 -27
- package/dist/chat-composer-editor/ghost.js +2 -4
- package/dist/chat-composer-editor/types.d.ts +5 -0
- package/dist/chat-composer-editor.d.ts +1 -1
- package/dist/chat-composer-editor.js +71 -28
- package/dist/chat-composer.d.ts +13 -32
- package/dist/chat-composer.js +54 -13
- package/dist/chat-layout.d.ts +19 -0
- package/dist/chat-layout.js +96 -32
- package/dist/chat-message/social.d.ts +26 -0
- package/dist/chat-message/social.js +122 -0
- package/dist/chat-message.d.ts +28 -29
- package/dist/chat-message.js +106 -25
- package/dist/context.d.ts +2 -2
- package/dist/context.js +38 -23
- package/dist/dynamic-notification-canvas-loop.d.ts +24 -0
- package/dist/dynamic-notification-canvas-loop.js +113 -0
- package/dist/dynamic-notification-glass.js +23 -114
- package/dist/dynamic-notification-liquid.js +14 -118
- package/dist/dynamic-notification.d.ts +16 -8
- package/dist/dynamic-notification.js +85 -22
- package/dist/email/email-brand.d.ts +7 -4
- package/dist/email/email-brand.js +9 -6
- package/dist/email/email-code.d.ts +3 -2
- package/dist/email/email-code.js +11 -9
- package/dist/email/email-footer.d.ts +5 -3
- package/dist/email/email-footer.js +11 -5
- package/dist/email/email.d.ts +31 -9
- package/dist/email/email.js +50 -26
- package/dist/email/templates.d.ts +10 -9
- package/dist/email/templates.js +102 -38
- package/dist/email/theme.js +1 -1
- package/dist/environment-variables.d.ts +4 -2
- package/dist/environment-variables.js +52 -32
- package/dist/filter-bar/context.d.ts +32 -0
- package/dist/filter-bar/context.js +11 -0
- package/dist/filter-bar/editor.d.ts +14 -0
- package/dist/filter-bar/editor.js +216 -0
- package/dist/filter-bar/model.d.ts +10 -0
- package/dist/filter-bar/model.js +57 -0
- package/dist/filter-bar/motion.d.ts +10 -0
- package/dist/filter-bar/motion.js +84 -0
- package/dist/filter-bar/parts.d.ts +19 -0
- package/dist/filter-bar/parts.js +244 -0
- package/dist/filter-bar/types.d.ts +54 -0
- package/dist/filter-bar/types.js +0 -0
- package/dist/filter-bar.d.ts +27 -0
- package/dist/filter-bar.js +310 -0
- package/dist/hooks/use-audio-recorder.js +12 -6
- package/dist/hooks/use-chat-composer.d.ts +21 -7
- package/dist/hooks/use-chat-composer.js +32 -5
- package/dist/hooks/use-chat-message.d.ts +28 -2
- package/dist/hooks/use-chat-message.js +41 -10
- package/dist/hooks/use-chat-thread-scroll.js +43 -7
- package/dist/hooks/use-color-area.d.ts +3 -3
- package/dist/hooks/use-color-area.js +13 -12
- package/dist/hooks/use-copy-to-clipboard.d.ts +2 -1
- package/dist/hooks/use-copy-to-clipboard.js +20 -20
- package/dist/hooks/use-dropzone.d.ts +7 -4
- package/dist/hooks/use-dropzone.js +34 -3
- package/dist/hooks/use-dynamic-notification.d.ts +6 -2
- package/dist/hooks/use-dynamic-notification.js +26 -10
- package/dist/hooks/use-mobile.d.ts +3 -2
- package/dist/hooks/use-mobile.js +8 -4
- package/dist/hooks/use-textarea-trigger-menu.js +2 -1
- package/dist/hooks/use-trigger-menu.d.ts +54 -0
- package/dist/hooks/use-trigger-menu.js +102 -47
- package/dist/hooks/use-user-ask.d.ts +2 -0
- package/dist/hooks/use-user-ask.js +35 -41
- package/dist/inline-attachment.d.ts +6 -2
- package/dist/inline-attachment.js +44 -29
- package/dist/inline-citation.d.ts +12 -5
- package/dist/inline-citation.js +25 -16
- 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/audio-visualizer-knobs.d.ts +1 -1
- package/dist/knob-contracts/audio-visualizer-knobs.js +2 -1
- package/dist/knob-contracts/avatar-knobs.d.ts +1 -1
- package/dist/knob-contracts/avatar-knobs.js +6 -1
- package/dist/knob-contracts/badge-knobs.d.ts +1 -1
- package/dist/knob-contracts/badge-knobs.js +2 -1
- package/dist/knob-contracts/breadcrumb-knobs.d.ts +4 -0
- package/dist/knob-contracts/breadcrumb-knobs.js +8 -0
- package/dist/knob-contracts/button-knobs.d.ts +1 -1
- package/dist/knob-contracts/button-knobs.js +1 -0
- package/dist/knob-contracts/chat-layout-knobs.d.ts +1 -1
- package/dist/knob-contracts/chat-layout-knobs.js +2 -1
- package/dist/knob-contracts/chat-message-knobs.d.ts +1 -1
- package/dist/knob-contracts/chat-message-knobs.js +8 -1
- package/dist/knob-contracts/choice-knobs.d.ts +1 -1
- package/dist/knob-contracts/choice-knobs.js +1 -0
- package/dist/knob-contracts/code-diff-knobs.d.ts +1 -1
- package/dist/knob-contracts/code-diff-knobs.js +2 -0
- package/dist/knob-contracts/code-knobs.d.ts +1 -1
- package/dist/knob-contracts/code-knobs.js +2 -1
- package/dist/knob-contracts/collapsible-knobs.d.ts +1 -1
- package/dist/knob-contracts/collapsible-knobs.js +1 -1
- package/dist/knob-contracts/dynamic-notification-knobs.d.ts +1 -1
- package/dist/knob-contracts/dynamic-notification-knobs.js +2 -0
- package/dist/knob-contracts/emoji-picker-knobs.d.ts +4 -0
- package/dist/knob-contracts/emoji-picker-knobs.js +10 -0
- package/dist/knob-contracts/field-knobs.d.ts +1 -1
- package/dist/knob-contracts/field-knobs.js +5 -1
- package/dist/knob-contracts/filter-bar-knobs.d.ts +4 -0
- package/dist/knob-contracts/filter-bar-knobs.js +15 -0
- package/dist/knob-contracts/infinite-canvas-knobs.d.ts +1 -1
- package/dist/knob-contracts/infinite-canvas-knobs.js +3 -0
- package/dist/knob-contracts/markdown-knobs.d.ts +1 -1
- package/dist/knob-contracts/markdown-knobs.js +3 -1
- package/dist/knob-contracts/page-layout-knobs.d.ts +1 -1
- package/dist/knob-contracts/page-layout-knobs.js +4 -1
- package/dist/knob-contracts/popup-knobs.d.ts +1 -1
- package/dist/knob-contracts/popup-knobs.js +28 -0
- package/dist/knob-contracts/range-knobs.d.ts +1 -1
- package/dist/knob-contracts/range-knobs.js +1 -0
- package/dist/knob-contracts/rich-tooltip-knobs.d.ts +1 -1
- package/dist/knob-contracts/rich-tooltip-knobs.js +2 -1
- package/dist/knob-contracts/sidebar-knobs.d.ts +1 -1
- package/dist/knob-contracts/sidebar-knobs.js +27 -2
- package/dist/knob-contracts/spinner-knobs.d.ts +1 -1
- package/dist/knob-contracts/spinner-knobs.js +1 -1
- package/dist/knob-contracts/stepper-knobs.d.ts +1 -1
- package/dist/knob-contracts/stepper-knobs.js +4 -1
- package/dist/knob-contracts/switch-knobs.d.ts +1 -1
- package/dist/knob-contracts/switch-knobs.js +5 -0
- package/dist/knob-contracts/table-of-contents-knobs.d.ts +1 -1
- package/dist/knob-contracts/table-of-contents-knobs.js +4 -5
- package/dist/knob-contracts/tabs-knobs.d.ts +1 -1
- package/dist/knob-contracts/tabs-knobs.js +1 -0
- package/dist/knob-contracts/tree-knobs.d.ts +1 -1
- package/dist/knob-contracts/tree-knobs.js +2 -1
- package/dist/lib/cn.js +0 -4
- package/dist/lib/contrast.d.ts +1 -0
- package/dist/lib/contrast.js +17 -5
- package/dist/lib/dropzone-validation.js +41 -28
- package/dist/lib/env-file.d.ts +1 -1
- package/dist/lib/env-file.js +5 -5
- package/dist/lib/motion.d.ts +4 -0
- package/dist/lib/motion.js +15 -0
- package/dist/lib/trigger-detect.js +6 -8
- package/dist/markdown-block.js +13 -8
- package/dist/popup-parts.d.ts +8 -0
- package/dist/popup-parts.js +43 -0
- package/dist/scripts/contrast-eval.js +5 -4
- package/dist/source-badge.js +3 -1
- package/dist/styles/code.css +0 -2
- package/dist/styles/effects.css +6 -32
- package/dist/styles/index.css +14 -8
- package/dist/styles/recipes/accordion.css +9 -6
- package/dist/styles/recipes/action-bar.css +0 -15
- package/dist/styles/recipes/activity.css +5 -11
- package/dist/styles/recipes/alert.css +4 -4
- package/dist/styles/recipes/audio-recorder.css +15 -3
- package/dist/styles/recipes/audio-visualizer.css +13 -2
- package/dist/styles/recipes/avatar.css +78 -1
- package/dist/styles/recipes/badge.css +14 -4
- package/dist/styles/recipes/breadcrumb.css +77 -0
- package/dist/styles/recipes/button-group.css +6 -8
- package/dist/styles/recipes/button-states.css +66 -0
- package/dist/styles/recipes/button.css +26 -85
- package/dist/styles/recipes/calendar.css +17 -23
- package/dist/styles/recipes/card.css +2 -2
- package/dist/styles/recipes/chat-composer-attachment.css +9 -3
- package/dist/styles/recipes/chat-composer.css +21 -16
- package/dist/styles/recipes/chat-layout.css +64 -2
- package/dist/styles/recipes/chat-message-social.css +123 -0
- package/dist/styles/recipes/chat-message.css +157 -37
- package/dist/styles/recipes/choice.css +25 -21
- package/dist/styles/recipes/code-diff.css +51 -26
- package/dist/styles/recipes/code.css +44 -18
- package/dist/styles/recipes/collapsible.css +43 -1
- package/dist/styles/recipes/color-picker-details.css +3 -4
- package/dist/styles/recipes/color-picker-values.css +9 -8
- package/dist/styles/recipes/color-picker.css +23 -4
- package/dist/styles/recipes/context.css +3 -3
- package/dist/styles/recipes/dockable-panel.css +18 -7
- package/dist/styles/recipes/dropzone.css +7 -8
- package/dist/styles/recipes/dynamic-notification-input.css +8 -5
- package/dist/styles/recipes/dynamic-notification-motion.css +12 -21
- package/dist/styles/recipes/dynamic-notification.css +40 -26
- package/dist/styles/recipes/emoji-picker.css +132 -0
- package/dist/styles/recipes/empty.css +5 -4
- package/dist/styles/recipes/environment-variables.css +4 -15
- package/dist/styles/recipes/field-parts.css +89 -21
- package/dist/styles/recipes/field.css +83 -26
- package/dist/styles/recipes/filter-bar.css +161 -0
- package/dist/styles/recipes/gradient-editor.css +18 -7
- package/dist/styles/recipes/infinite-canvas.css +51 -4
- package/dist/styles/recipes/inline-attachment.css +9 -4
- package/dist/styles/recipes/inline-citation.css +10 -4
- package/dist/styles/recipes/item.css +23 -9
- package/dist/styles/recipes/markdown-block.css +5 -4
- package/dist/styles/recipes/markdown.css +68 -26
- package/dist/styles/recipes/morphing-panel.css +8 -8
- package/dist/styles/recipes/page-layout.css +36 -10
- package/dist/styles/recipes/pagination.css +5 -6
- package/dist/styles/recipes/phone-input.css +12 -8
- package/dist/styles/recipes/popup-controls.css +175 -26
- package/dist/styles/recipes/popup-drawer.css +35 -44
- package/dist/styles/recipes/popup-lists.css +139 -29
- package/dist/styles/recipes/popup-motion.css +4 -45
- package/dist/styles/recipes/popup-toast.css +55 -26
- package/dist/styles/recipes/popup.css +149 -153
- package/dist/styles/recipes/range.css +55 -19
- package/dist/styles/recipes/resizable.css +36 -7
- package/dist/styles/recipes/rich-tooltip.css +24 -34
- package/dist/styles/recipes/scroll-area.css +8 -1
- package/dist/styles/recipes/sidebar-menu.css +149 -34
- package/dist/styles/recipes/sidebar-parts.css +154 -0
- package/dist/styles/recipes/sidebar.css +187 -128
- package/dist/styles/recipes/source-badge.css +1 -1
- package/dist/styles/recipes/spinner.css +12 -1
- package/dist/styles/recipes/stepper.css +31 -13
- package/dist/styles/recipes/switch.css +68 -23
- package/dist/styles/recipes/table-of-contents.css +49 -41
- package/dist/styles/recipes/table.css +14 -10
- package/dist/styles/recipes/tabs.css +38 -12
- package/dist/styles/recipes/task-list.css +7 -14
- package/dist/styles/recipes/thread-rail.css +42 -19
- package/dist/styles/recipes/timeline.css +2 -0
- package/dist/styles/recipes/toolbar.css +27 -25
- package/dist/styles/recipes/track-highlight.css +12 -8
- package/dist/styles/recipes/transcript-divider.css +2 -2
- package/dist/styles/recipes/tree.css +31 -4
- package/dist/styles/recipes/user-ask-details.css +0 -1
- package/dist/styles/recipes/user-ask.css +4 -4
- package/dist/styles/theme.css +287 -107
- package/dist/task-list.d.ts +4 -1
- package/dist/task-list.js +24 -8
- package/dist/thread-rail.d.ts +1 -1
- package/dist/thread-rail.js +61 -19
- package/dist/transcript-divider.js +2 -1
- package/dist/ui/alert.d.ts +3 -1
- package/dist/ui/alert.js +14 -8
- package/dist/ui/autocomplete.js +7 -1
- package/dist/ui/avatar.d.ts +8 -0
- package/dist/ui/avatar.js +23 -3
- package/dist/ui/badge.js +1 -1
- package/dist/ui/breadcrumb.d.ts +27 -0
- package/dist/ui/breadcrumb.js +88 -0
- package/dist/ui/button.d.ts +2 -1
- package/dist/ui/button.js +1 -1
- package/dist/ui/calendar.js +2 -2
- package/dist/ui/card.d.ts +3 -1
- package/dist/ui/card.js +12 -7
- package/dist/ui/checkbox-group.js +1 -1
- package/dist/ui/checkbox.d.ts +2 -0
- package/dist/ui/code-diff.d.ts +1 -1
- package/dist/ui/code-diff.js +71 -27
- package/dist/ui/code.d.ts +5 -3
- package/dist/ui/code.js +27 -28
- package/dist/ui/color-picker.d.ts +5 -2
- package/dist/ui/color-picker.js +84 -36
- package/dist/ui/combobox-disabled-selection.d.ts +1 -2
- package/dist/ui/combobox-disabled-selection.js +7 -8
- package/dist/ui/combobox.d.ts +5 -23
- package/dist/ui/combobox.js +36 -16
- package/dist/ui/command.d.ts +8 -2
- package/dist/ui/command.js +39 -15
- package/dist/ui/context-menu.js +3 -0
- package/dist/ui/dialog.d.ts +2 -1
- package/dist/ui/dialog.js +3 -22
- package/dist/ui/dockable-panel-geometry.d.ts +1 -0
- package/dist/ui/dockable-panel-geometry.js +7 -1
- package/dist/ui/dockable-panel.d.ts +9 -6
- package/dist/ui/dockable-panel.js +81 -33
- package/dist/ui/drawer.d.ts +7 -4
- package/dist/ui/drawer.js +35 -22
- package/dist/ui/dropdown-menu.js +4 -3
- package/dist/ui/dropzone.d.ts +5 -3
- package/dist/ui/dropzone.js +78 -17
- package/dist/ui/emoji-picker.d.ts +18 -0
- package/dist/ui/emoji-picker.js +136 -0
- package/dist/ui/empty.d.ts +3 -1
- package/dist/ui/empty.js +12 -7
- package/dist/ui/field.js +1 -1
- package/dist/ui/gradient-editor.d.ts +1 -1
- package/dist/ui/gradient-editor.js +37 -21
- package/dist/ui/infinite-canvas.d.ts +13 -1
- package/dist/ui/infinite-canvas.js +139 -20
- package/dist/ui/input-group.d.ts +2 -4
- package/dist/ui/input-group.js +13 -14
- package/dist/ui/input-otp.d.ts +1 -1
- package/dist/ui/input-otp.js +32 -15
- package/dist/ui/input.js +11 -2
- package/dist/ui/item.d.ts +2 -1
- package/dist/ui/item.js +11 -7
- package/dist/ui/live-status.d.ts +7 -0
- package/dist/ui/live-status.js +17 -0
- package/dist/ui/markdown-elements.d.ts +6 -0
- package/dist/ui/markdown-elements.js +42 -9
- package/dist/ui/menubar.js +2 -2
- package/dist/ui/morphing-panel.js +2 -1
- package/dist/ui/native-select.d.ts +1 -1
- package/dist/ui/native-select.js +24 -11
- package/dist/ui/number-field.d.ts +1 -1
- package/dist/ui/number-field.js +13 -2
- package/dist/ui/page-layout.d.ts +2 -2
- package/dist/ui/page-layout.js +2 -4
- package/dist/ui/pagination.d.ts +7 -5
- package/dist/ui/pagination.js +19 -13
- package/dist/ui/phone-input.d.ts +1 -0
- package/dist/ui/phone-input.js +56 -58
- package/dist/ui/radio-group.d.ts +3 -0
- package/dist/ui/radio-group.js +11 -1
- package/dist/ui/resizable.d.ts +20 -2
- package/dist/ui/resizable.js +130 -8
- package/dist/ui/responsive-dialog.d.ts +1 -1
- package/dist/ui/responsive-dialog.js +9 -23
- package/dist/ui/rich-tooltip.d.ts +10 -4
- package/dist/ui/rich-tooltip.js +81 -33
- package/dist/ui/scroll-area.d.ts +4 -1
- package/dist/ui/scroll-area.js +44 -28
- package/dist/ui/select.d.ts +2 -1
- package/dist/ui/select.js +57 -32
- package/dist/ui/sidebar-menu.d.ts +5 -1
- package/dist/ui/sidebar-menu.js +31 -33
- package/dist/ui/sidebar-provider.d.ts +10 -1
- package/dist/ui/sidebar-provider.js +38 -13
- package/dist/ui/sidebar-resize-rail.js +7 -3
- package/dist/ui/sidebar.d.ts +11 -6
- package/dist/ui/sidebar.js +46 -23
- package/dist/ui/slider.js +31 -22
- package/dist/ui/spinner.d.ts +3 -2
- package/dist/ui/spinner.js +3 -2
- package/dist/ui/stepper.d.ts +8 -1
- package/dist/ui/stepper.js +74 -25
- package/dist/ui/switch.d.ts +1 -0
- package/dist/ui/table-of-contents.d.ts +5 -4
- package/dist/ui/table-of-contents.js +143 -52
- package/dist/ui/table.js +15 -9
- package/dist/ui/textarea.d.ts +1 -1
- package/dist/ui/textarea.js +20 -9
- package/dist/ui/timeline.d.ts +3 -1
- package/dist/ui/timeline.js +17 -9
- package/dist/ui/toast.d.ts +11 -5
- package/dist/ui/toast.js +100 -54
- package/dist/ui/toggle.d.ts +1 -1
- package/dist/ui/toggle.js +2 -1
- package/dist/ui/toolbar.d.ts +3 -2
- package/dist/ui/toolbar.js +4 -2
- package/dist/ui/tooltip.js +3 -20
- package/dist/ui/tree.js +120 -80
- package/dist/ui/trigger-menu.js +7 -2
- package/dist/user-ask.d.ts +10 -5
- package/dist/user-ask.js +31 -11
- package/package.json +5 -1
- package/dist/hooks/use-keyboard-navigation.d.ts +0 -3
- package/dist/hooks/use-keyboard-navigation.js +0 -22
package/dist/task-list.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "./lib/cn.js";
|
|
3
|
+
import { LiveStatus } from "./ui/live-status.js";
|
|
3
4
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./ui/collapsible.js";
|
|
4
5
|
import { createContext, useContext, useEffect, useId, useState } from "react";
|
|
5
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { ChevronRight, CircleCheck, CircleDashed, Loader2 } from "lucide-react";
|
|
7
8
|
//#region src/task-list.tsx
|
|
9
|
+
const taskStatusLabels = {
|
|
10
|
+
pending: "Pending",
|
|
11
|
+
active: "In progress",
|
|
12
|
+
completed: "Done"
|
|
13
|
+
};
|
|
8
14
|
const TaskListContext = createContext(null);
|
|
9
15
|
const TaskListRegistrationContext = createContext(null);
|
|
10
16
|
function useTaskListContext() {
|
|
@@ -31,7 +37,7 @@ function currentTaskIndex(tasks) {
|
|
|
31
37
|
if (pending !== -1) return pending;
|
|
32
38
|
return tasks.length - 1;
|
|
33
39
|
}
|
|
34
|
-
function TaskList({ className, children, ...props }) {
|
|
40
|
+
function TaskList({ statusLabels, className, children, ...props }) {
|
|
35
41
|
const [tasks, setTasks] = useState([]);
|
|
36
42
|
const [registration] = useState(() => ({
|
|
37
43
|
registerTask(entry) {
|
|
@@ -45,6 +51,11 @@ function TaskList({ className, children, ...props }) {
|
|
|
45
51
|
const currentIndex = currentTaskIndex(tasks);
|
|
46
52
|
const current = tasks[currentIndex];
|
|
47
53
|
const allCompleted = total > 0 && tasks.every((task) => task.status === "completed");
|
|
54
|
+
const labels = {
|
|
55
|
+
...taskStatusLabels,
|
|
56
|
+
...statusLabels
|
|
57
|
+
};
|
|
58
|
+
const progressStatus = current?.status === "active" ? `${current.label}: ${labels.active}` : "";
|
|
48
59
|
return /* @__PURE__ */ jsx(TaskListRegistrationContext.Provider, {
|
|
49
60
|
value: registration,
|
|
50
61
|
children: /* @__PURE__ */ jsx(TaskListContext.Provider, {
|
|
@@ -52,16 +63,17 @@ function TaskList({ className, children, ...props }) {
|
|
|
52
63
|
total,
|
|
53
64
|
current,
|
|
54
65
|
currentNumber: total === 0 ? 0 : currentIndex + 1,
|
|
55
|
-
allCompleted
|
|
66
|
+
allCompleted,
|
|
67
|
+
statusLabels: labels
|
|
56
68
|
},
|
|
57
|
-
children: /* @__PURE__ */
|
|
69
|
+
children: /* @__PURE__ */ jsxs(Collapsible, {
|
|
58
70
|
"data-control-ui": "task-list",
|
|
59
71
|
"data-control-family": "task-list",
|
|
60
72
|
"data-slot": "root",
|
|
61
73
|
"data-surface": "panel",
|
|
62
74
|
className: cn("w-full overflow-hidden", className),
|
|
63
75
|
...props,
|
|
64
|
-
children
|
|
76
|
+
children: [children, /* @__PURE__ */ jsx(LiveStatus, { message: progressStatus })]
|
|
65
77
|
})
|
|
66
78
|
})
|
|
67
79
|
});
|
|
@@ -101,13 +113,15 @@ function TaskListProgress({ className, children, ...props }) {
|
|
|
101
113
|
}
|
|
102
114
|
function TaskListLabel({ className, children, ...props }) {
|
|
103
115
|
const { current } = useTaskListContext();
|
|
116
|
+
const text = children ?? current?.label;
|
|
104
117
|
return /* @__PURE__ */ jsx("span", {
|
|
105
118
|
"data-control-ui": "task-list",
|
|
106
119
|
"data-control-family": "task-list",
|
|
107
120
|
"data-slot": "label",
|
|
121
|
+
title: typeof text === "string" ? text : void 0,
|
|
108
122
|
className: cn("min-w-0 flex-1 truncate", className),
|
|
109
123
|
...props,
|
|
110
|
-
children:
|
|
124
|
+
children: text
|
|
111
125
|
});
|
|
112
126
|
}
|
|
113
127
|
function TaskListContent({ className, children, ...props }) {
|
|
@@ -145,7 +159,7 @@ function TaskListItem({ label, status = "pending", className, children, ...props
|
|
|
145
159
|
className: cn("flex items-center", className),
|
|
146
160
|
...props,
|
|
147
161
|
children: [/* @__PURE__ */ jsx(TaskListIndicator, { status }), /* @__PURE__ */ jsx("span", {
|
|
148
|
-
className: "min-w-0 flex-1
|
|
162
|
+
className: "min-w-0 flex-1 text-pretty",
|
|
149
163
|
children: children ?? label
|
|
150
164
|
})]
|
|
151
165
|
});
|
|
@@ -157,6 +171,7 @@ const indicatorIcons = {
|
|
|
157
171
|
};
|
|
158
172
|
function TaskListIndicator({ status = "pending", className, ...props }) {
|
|
159
173
|
const Icon = indicatorIcons[status];
|
|
174
|
+
const statusLabels = useContext(TaskListContext)?.statusLabels ?? taskStatusLabels;
|
|
160
175
|
return /* @__PURE__ */ jsxs("span", {
|
|
161
176
|
"data-control-ui": "task-list",
|
|
162
177
|
"data-control-family": "task-list",
|
|
@@ -166,12 +181,13 @@ function TaskListIndicator({ status = "pending", className, ...props }) {
|
|
|
166
181
|
...props,
|
|
167
182
|
children: [/* @__PURE__ */ jsx(Icon, {
|
|
168
183
|
"aria-hidden": "true",
|
|
184
|
+
"data-motion-essential": status === "active" ? "" : void 0,
|
|
169
185
|
className: "size-3.5"
|
|
170
186
|
}), /* @__PURE__ */ jsx("span", {
|
|
171
187
|
className: "sr-only",
|
|
172
|
-
children: status
|
|
188
|
+
children: statusLabels[status]
|
|
173
189
|
})]
|
|
174
190
|
});
|
|
175
191
|
}
|
|
176
192
|
//#endregion
|
|
177
|
-
export { TaskList, TaskListContent, TaskListIndicator, TaskListItem, TaskListLabel, TaskListProgress, TaskListTrigger };
|
|
193
|
+
export { TaskList, TaskListContent, TaskListIndicator, TaskListItem, TaskListLabel, TaskListProgress, TaskListTrigger, taskStatusLabels };
|
package/dist/thread-rail.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare function ThreadRailItem({ from, inView, active, index, className,
|
|
|
18
18
|
export type ThreadRailLineProps = Omit<ComponentProps<"button">, "style"> & {
|
|
19
19
|
style?: CSSProperties & ThreadRailKnobStyle;
|
|
20
20
|
};
|
|
21
|
-
export declare function ThreadRailLine({ className, ...props }: ThreadRailLineProps): import("react").JSX.Element;
|
|
21
|
+
export declare function ThreadRailLine({ className, onKeyDown, "aria-label": ariaLabel, ...props }: ThreadRailLineProps): import("react").JSX.Element;
|
|
22
22
|
export type ThreadRailPopoverProps = Omit<ComponentProps<"div">, "style"> & {
|
|
23
23
|
children?: ReactNode;
|
|
24
24
|
style?: CSSProperties & ThreadRailKnobStyle;
|
package/dist/thread-rail.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "./lib/cn.js";
|
|
3
|
-
import { Children, cloneElement, createContext, isValidElement, useContext, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
3
|
+
import { Children, cloneElement, createContext, isValidElement, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/thread-rail.tsx
|
|
6
6
|
const useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
@@ -16,11 +16,14 @@ function useItem() {
|
|
|
16
16
|
if (!context) throw new Error("ThreadRail compound parts must be rendered inside <ThreadRailItem>.");
|
|
17
17
|
return context;
|
|
18
18
|
}
|
|
19
|
+
const LayerContext = createContext(null);
|
|
19
20
|
function ThreadRail({ className, children, style, ...props }) {
|
|
20
21
|
const [hovered, setHovered] = useState(0);
|
|
21
22
|
const cardRef = useRef(null);
|
|
22
23
|
const activeLayerRef = useRef(null);
|
|
23
24
|
const [cardHeight, setCardHeight] = useState();
|
|
25
|
+
const baseId = useId();
|
|
26
|
+
const lines = useRef([]);
|
|
24
27
|
const items = Children.toArray(children).filter((child) => isValidElement(child));
|
|
25
28
|
const popovers = items.map((item) => {
|
|
26
29
|
const popover = Children.toArray(item.props.children).find((child) => isValidElement(child) && child.type === ThreadRailPopover);
|
|
@@ -40,7 +43,10 @@ function ThreadRail({ className, children, style, ...props }) {
|
|
|
40
43
|
return /* @__PURE__ */ jsx(RailContext.Provider, {
|
|
41
44
|
value: {
|
|
42
45
|
current: hovered,
|
|
43
|
-
|
|
46
|
+
count: items.length,
|
|
47
|
+
activate: setHovered,
|
|
48
|
+
layerId: (index, part) => `${baseId}-${index}-${part}`,
|
|
49
|
+
lines
|
|
44
50
|
},
|
|
45
51
|
children: /* @__PURE__ */ jsxs("nav", {
|
|
46
52
|
"data-control-ui": "thread-rail",
|
|
@@ -52,6 +58,7 @@ function ThreadRail({ className, children, style, ...props }) {
|
|
|
52
58
|
...props,
|
|
53
59
|
children: [items.map((item, index) => cloneElement(item, { index })), /* @__PURE__ */ jsx("div", {
|
|
54
60
|
ref: cardRef,
|
|
61
|
+
"aria-hidden": "true",
|
|
55
62
|
"data-control-ui": "thread-rail",
|
|
56
63
|
"data-control-family": "thread-rail",
|
|
57
64
|
"data-slot": "popover",
|
|
@@ -61,14 +68,16 @@ function ThreadRail({ className, children, style, ...props }) {
|
|
|
61
68
|
height: cardHeight
|
|
62
69
|
},
|
|
63
70
|
className: cn("pointer-events-none z-20 w-72 overflow-hidden", activePopover?.className),
|
|
64
|
-
children: items.map((item, index) => /* @__PURE__ */ jsx(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
children: items.map((item, index) => /* @__PURE__ */ jsx(LayerContext.Provider, {
|
|
72
|
+
value: index,
|
|
73
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
74
|
+
"data-control-ui": "thread-rail",
|
|
75
|
+
"data-control-family": "thread-rail",
|
|
76
|
+
"data-slot": "popover-layer",
|
|
77
|
+
ref: index === hovered ? activeLayerRef : void 0,
|
|
78
|
+
"data-active": index === hovered ? "true" : void 0,
|
|
79
|
+
children: popovers[index]?.children ?? null
|
|
80
|
+
})
|
|
72
81
|
}, item.key ?? index))
|
|
73
82
|
})]
|
|
74
83
|
})
|
|
@@ -81,7 +90,7 @@ function ThreadRailItem({ from = "user", inView = false, active = false, index =
|
|
|
81
90
|
value: {
|
|
82
91
|
index,
|
|
83
92
|
inView: isInView,
|
|
84
|
-
|
|
93
|
+
active
|
|
85
94
|
},
|
|
86
95
|
children: /* @__PURE__ */ jsx("div", {
|
|
87
96
|
"data-control-ui": "thread-rail",
|
|
@@ -97,38 +106,71 @@ function ThreadRailItem({ from = "user", inView = false, active = false, index =
|
|
|
97
106
|
})
|
|
98
107
|
});
|
|
99
108
|
}
|
|
100
|
-
function
|
|
101
|
-
const
|
|
109
|
+
function rovingTarget(key, index, count) {
|
|
110
|
+
const last = count - 1;
|
|
111
|
+
return {
|
|
112
|
+
ArrowDown: Math.min(index + 1, last),
|
|
113
|
+
ArrowUp: Math.max(index - 1, 0),
|
|
114
|
+
Home: 0,
|
|
115
|
+
End: last
|
|
116
|
+
}[key];
|
|
117
|
+
}
|
|
118
|
+
function ThreadRailLine({ className, onKeyDown, "aria-label": ariaLabel, ...props }) {
|
|
119
|
+
const { index, active } = useItem();
|
|
120
|
+
const rail = useRail();
|
|
102
121
|
return /* @__PURE__ */ jsx("button", {
|
|
122
|
+
ref: (node) => {
|
|
123
|
+
rail.lines.current[index] = node;
|
|
124
|
+
},
|
|
103
125
|
"data-control-ui": "thread-rail",
|
|
104
126
|
"data-control-family": "thread-rail",
|
|
105
127
|
"data-slot": "line",
|
|
106
128
|
type: "button",
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
129
|
+
tabIndex: index === rail.current ? 0 : -1,
|
|
130
|
+
"aria-current": active ? "location" : void 0,
|
|
131
|
+
"aria-label": ariaLabel,
|
|
132
|
+
"aria-labelledby": ariaLabel === void 0 ? rail.layerId(index, "title") : void 0,
|
|
133
|
+
"aria-describedby": rail.layerId(index, "summary"),
|
|
134
|
+
onMouseEnter: () => rail.activate(index),
|
|
135
|
+
onFocus: () => rail.activate(index),
|
|
136
|
+
onKeyDown: (event) => {
|
|
137
|
+
onKeyDown?.(event);
|
|
138
|
+
const target = event.defaultPrevented ? void 0 : rovingTarget(event.key, index, rail.count);
|
|
139
|
+
if (target === void 0) return;
|
|
140
|
+
event.preventDefault();
|
|
141
|
+
rail.lines.current[target]?.focus();
|
|
142
|
+
},
|
|
143
|
+
className: cn("relative block cursor-pointer", className),
|
|
111
144
|
...props
|
|
112
145
|
});
|
|
113
146
|
}
|
|
114
147
|
function ThreadRailPopover(_props) {
|
|
115
148
|
return null;
|
|
116
149
|
}
|
|
150
|
+
function useLayerId(part) {
|
|
151
|
+
const rail = useRail();
|
|
152
|
+
const layer = useContext(LayerContext);
|
|
153
|
+
return layer === null ? void 0 : rail.layerId(layer, part);
|
|
154
|
+
}
|
|
117
155
|
function ThreadRailTitle({ className, ...props }) {
|
|
156
|
+
const id = useLayerId("title");
|
|
118
157
|
return /* @__PURE__ */ jsx("div", {
|
|
158
|
+
id,
|
|
119
159
|
"data-control-ui": "thread-rail",
|
|
120
160
|
"data-control-family": "thread-rail",
|
|
121
161
|
"data-slot": "title",
|
|
122
|
-
className: cn("
|
|
162
|
+
className: cn("line-clamp-2 text-pretty", className),
|
|
123
163
|
...props
|
|
124
164
|
});
|
|
125
165
|
}
|
|
126
166
|
function ThreadRailSummary({ className, ...props }) {
|
|
167
|
+
const id = useLayerId("summary");
|
|
127
168
|
return /* @__PURE__ */ jsx("p", {
|
|
169
|
+
id,
|
|
128
170
|
"data-control-ui": "thread-rail",
|
|
129
171
|
"data-control-family": "thread-rail",
|
|
130
172
|
"data-slot": "summary",
|
|
131
|
-
className: cn("line-clamp-3", className),
|
|
173
|
+
className: cn("line-clamp-3 text-pretty", className),
|
|
132
174
|
...props
|
|
133
175
|
});
|
|
134
176
|
}
|
|
@@ -3,6 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
//#region src/transcript-divider.tsx
|
|
4
4
|
function TranscriptDivider({ tone = "neutral", className, children, ...props }) {
|
|
5
5
|
return /* @__PURE__ */ jsx("div", {
|
|
6
|
+
role: children == null ? "separator" : void 0,
|
|
6
7
|
"data-control-ui": "transcript-divider",
|
|
7
8
|
"data-control-family": "transcript-divider",
|
|
8
9
|
"data-slot": "root",
|
|
@@ -17,7 +18,7 @@ function TranscriptDividerLabel({ className, ...props }) {
|
|
|
17
18
|
"data-control-ui": "transcript-divider",
|
|
18
19
|
"data-control-family": "transcript-divider",
|
|
19
20
|
"data-slot": "label",
|
|
20
|
-
className: cn("min-w-0
|
|
21
|
+
className: cn("min-w-0 text-center text-pretty", className),
|
|
21
22
|
...props
|
|
22
23
|
});
|
|
23
24
|
}
|
package/dist/ui/alert.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RenderProp } from "../control-props.js";
|
|
1
2
|
import { AlertKnobStyle } from "../knob-contracts/alert-knobs.js";
|
|
2
3
|
import { CSSProperties, ComponentProps } from "react";
|
|
3
4
|
//#region src/ui/alert.d.ts
|
|
@@ -9,12 +10,13 @@ export type AlertProps = Omit<ComponentProps<"div">, "style"> & {
|
|
|
9
10
|
variant?: AlertVariant;
|
|
10
11
|
};
|
|
11
12
|
export type AlertTitleProps = Omit<ComponentProps<"div">, "style"> & {
|
|
13
|
+
render?: RenderProp<ComponentProps<"div">>;
|
|
12
14
|
style?: CSSProperties & AlertKnobStyle;
|
|
13
15
|
};
|
|
14
16
|
export type AlertDescriptionProps = Omit<ComponentProps<"div">, "style"> & {
|
|
15
17
|
style?: CSSProperties & AlertKnobStyle;
|
|
16
18
|
};
|
|
17
19
|
export declare function Alert({ variant, className, ...props }: AlertProps): import("react").JSX.Element;
|
|
18
|
-
export declare function AlertTitle({ className, ...props }: AlertTitleProps): import("react").
|
|
20
|
+
export declare function AlertTitle({ render, className, ...props }: AlertTitleProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
19
21
|
export declare function AlertDescription({ className, ...props }: AlertDescriptionProps): import("react").JSX.Element;
|
|
20
22
|
//#endregion
|
package/dist/ui/alert.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
4
|
import { jsx } from "react/jsx-runtime";
|
|
3
5
|
//#region src/ui/alert.tsx
|
|
4
6
|
const alertVariants = ["default", "destructive"];
|
|
5
7
|
function Alert({ variant = "default", className, ...props }) {
|
|
6
8
|
return /* @__PURE__ */ jsx("div", {
|
|
7
|
-
role: "alert",
|
|
9
|
+
role: variant === "destructive" ? "alert" : "status",
|
|
8
10
|
"data-control-ui": "alert",
|
|
9
11
|
"data-control-family": "alert",
|
|
10
12
|
"data-slot": "root",
|
|
@@ -14,13 +16,17 @@ function Alert({ variant = "default", className, ...props }) {
|
|
|
14
16
|
...props
|
|
15
17
|
});
|
|
16
18
|
}
|
|
17
|
-
function AlertTitle({ className, ...props }) {
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
function AlertTitle({ render, className, ...props }) {
|
|
20
|
+
return useRender({
|
|
21
|
+
defaultTagName: "div",
|
|
22
|
+
render,
|
|
23
|
+
props: {
|
|
24
|
+
...props,
|
|
25
|
+
"data-control-ui": "alert",
|
|
26
|
+
"data-control-family": "alert",
|
|
27
|
+
"data-slot": "title",
|
|
28
|
+
className: cn("col-start-2 min-w-0", className)
|
|
29
|
+
}
|
|
24
30
|
});
|
|
25
31
|
}
|
|
26
32
|
function AlertDescription({ className, ...props }) {
|
package/dist/ui/autocomplete.js
CHANGED
|
@@ -53,7 +53,7 @@ function AutocompleteInput({ size = "md", className, ...props }) {
|
|
|
53
53
|
"data-size": size,
|
|
54
54
|
className: cn("w-full min-w-0 disabled:cursor-not-allowed", className),
|
|
55
55
|
...props
|
|
56
|
-
}), /* @__PURE__ */ jsx(AutocompleteClear, { className: "absolute
|
|
56
|
+
}), /* @__PURE__ */ jsx(AutocompleteClear, { className: "absolute end-1.5 top-1/2 -translate-y-1/2" })]
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
function AutocompleteContent({ className, children, sideOffset = 6, ...props }) {
|
|
@@ -85,7 +85,9 @@ function AutocompleteContent({ className, children, sideOffset = 6, ...props })
|
|
|
85
85
|
function AutocompleteList({ className, children, ...props }) {
|
|
86
86
|
return /* @__PURE__ */ jsx(ScrollArea, {
|
|
87
87
|
className: "w-full",
|
|
88
|
+
viewportClassName: "overscroll-contain",
|
|
88
89
|
maxHeight: "min(18rem, var(--available-height))",
|
|
90
|
+
lockAxis: "x",
|
|
89
91
|
children: /* @__PURE__ */ jsx(Autocomplete$1.List, {
|
|
90
92
|
"data-control-ui": "autocomplete",
|
|
91
93
|
"data-popup-kind": "autocomplete",
|
|
@@ -120,6 +122,10 @@ function AutocompleteItem({ className, children, disabled, ...props }) {
|
|
|
120
122
|
className: cn(popupItemStructureClasses, className),
|
|
121
123
|
...props,
|
|
122
124
|
children: /* @__PURE__ */ jsx("span", {
|
|
125
|
+
"data-control-ui": "autocomplete",
|
|
126
|
+
"data-control-family": "popup",
|
|
127
|
+
"data-popup-kind": "autocomplete",
|
|
128
|
+
"data-slot": "item-text",
|
|
123
129
|
className: "flex min-w-0 flex-1 items-center truncate",
|
|
124
130
|
children
|
|
125
131
|
})
|
package/dist/ui/avatar.d.ts
CHANGED
|
@@ -16,8 +16,16 @@ export type AvatarFallbackProps = Omit<ComponentProps<"span">, "style"> & {
|
|
|
16
16
|
delay?: number;
|
|
17
17
|
style?: CSSProperties & AvatarKnobStyle;
|
|
18
18
|
};
|
|
19
|
+
export declare const avatarBadgeStatuses: readonly ["online", "away", "busy", "offline"];
|
|
20
|
+
export type AvatarBadgeStatus = (typeof avatarBadgeStatuses)[number];
|
|
21
|
+
export type AvatarBadgeProps = Omit<ComponentProps<"span">, "style"> & {
|
|
22
|
+
status?: AvatarBadgeStatus;
|
|
23
|
+
label?: string;
|
|
24
|
+
style?: CSSProperties & AvatarKnobStyle;
|
|
25
|
+
};
|
|
19
26
|
export declare function Avatar({ className, ...props }: AvatarProps): import("react").JSX.Element;
|
|
20
27
|
export declare function AvatarGroup({ className, ...props }: AvatarGroupProps): import("react").JSX.Element;
|
|
21
28
|
export declare function AvatarImage({ className, ...props }: AvatarImageProps): import("react").JSX.Element;
|
|
22
29
|
export declare function AvatarFallback({ className, ...props }: AvatarFallbackProps): import("react").JSX.Element;
|
|
30
|
+
export declare function AvatarBadge({ className, status, label, children, ...props }: AvatarBadgeProps): import("react").JSX.Element;
|
|
23
31
|
//#endregion
|
package/dist/ui/avatar.js
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
|
|
5
5
|
//#region src/ui/avatar.tsx
|
|
6
|
+
const avatarBadgeStatuses = [
|
|
7
|
+
"online",
|
|
8
|
+
"away",
|
|
9
|
+
"busy",
|
|
10
|
+
"offline"
|
|
11
|
+
];
|
|
6
12
|
function Avatar({ className, ...props }) {
|
|
7
13
|
return /* @__PURE__ */ jsx(Avatar$1.Root, {
|
|
8
14
|
"data-control-ui": "avatar",
|
|
9
15
|
"data-control-family": "avatar",
|
|
10
16
|
"data-slot": "root",
|
|
11
|
-
className: cn("relative inline-flex shrink-0 select-none items-center justify-center
|
|
17
|
+
className: cn("relative inline-flex shrink-0 select-none items-center justify-center align-middle", className),
|
|
12
18
|
...props
|
|
13
19
|
});
|
|
14
20
|
}
|
|
@@ -40,5 +46,19 @@ function AvatarFallback({ className, ...props }) {
|
|
|
40
46
|
...props
|
|
41
47
|
});
|
|
42
48
|
}
|
|
49
|
+
function AvatarBadge({ className, status, label, children, ...props }) {
|
|
50
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
51
|
+
"data-control-ui": "avatar",
|
|
52
|
+
"data-control-family": "avatar",
|
|
53
|
+
"data-slot": "badge",
|
|
54
|
+
"data-status": status,
|
|
55
|
+
className: cn("absolute inline-flex items-center justify-center", className),
|
|
56
|
+
...props,
|
|
57
|
+
children: [children, label ? /* @__PURE__ */ jsx("span", {
|
|
58
|
+
className: "sr-only",
|
|
59
|
+
children: label
|
|
60
|
+
}) : null]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
43
63
|
//#endregion
|
|
44
|
-
export { Avatar, AvatarFallback, AvatarGroup, AvatarImage };
|
|
64
|
+
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarImage, avatarBadgeStatuses };
|
package/dist/ui/badge.js
CHANGED
|
@@ -27,7 +27,7 @@ function Badge({ variant = "default", size = "md", color, render, className, chi
|
|
|
27
27
|
"data-variant": variant,
|
|
28
28
|
"data-size": size,
|
|
29
29
|
"data-color": resolvedColor,
|
|
30
|
-
className: cn("inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap border font-medium [&>svg]:pointer-events-none [&>svg]:size-3",
|
|
30
|
+
className: cn("inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap border font-medium [&>svg]:pointer-events-none [&>svg]:size-3", className),
|
|
31
31
|
children
|
|
32
32
|
}
|
|
33
33
|
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { RenderProp } from "../control-props.js";
|
|
2
|
+
import { BreadcrumbKnobStyle } from "../knob-contracts/breadcrumb-knobs.js";
|
|
3
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
4
|
+
//#region src/ui/breadcrumb.d.ts
|
|
5
|
+
export declare function Breadcrumb({ className, ...props }: ComponentProps<"nav"> & {
|
|
6
|
+
style?: CSSProperties & BreadcrumbKnobStyle;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export declare function BreadcrumbList({ className, ...props }: Omit<ComponentProps<"ol">, "style"> & {
|
|
9
|
+
style?: CSSProperties & BreadcrumbKnobStyle;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
export declare function BreadcrumbItem({ className, ...props }: ComponentProps<"li"> & {
|
|
12
|
+
style?: CSSProperties & BreadcrumbKnobStyle;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
export declare function BreadcrumbLink({ render, className, children, ...props }: ComponentProps<"a"> & {
|
|
15
|
+
render?: RenderProp<ComponentProps<"a">>;
|
|
16
|
+
}): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
17
|
+
export declare function BreadcrumbPage({ className, ...props }: Omit<ComponentProps<"span">, "style"> & {
|
|
18
|
+
style?: CSSProperties & BreadcrumbKnobStyle;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
20
|
+
export declare function BreadcrumbSeparator({ children, className, ...props }: ComponentProps<"li"> & {
|
|
21
|
+
style?: CSSProperties & BreadcrumbKnobStyle;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
export declare function BreadcrumbEllipsis({ label, className, ...props }: Omit<ComponentProps<"span">, "children"> & {
|
|
24
|
+
label?: string;
|
|
25
|
+
style?: CSSProperties & BreadcrumbKnobStyle;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
|
+
//#endregion
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
|
6
|
+
//#region src/ui/breadcrumb.tsx
|
|
7
|
+
function Breadcrumb({ className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
9
|
+
"aria-label": "Breadcrumb",
|
|
10
|
+
"data-control-ui": "breadcrumb",
|
|
11
|
+
"data-control-family": "breadcrumb",
|
|
12
|
+
"data-slot": "root",
|
|
13
|
+
className,
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function BreadcrumbList({ className, ...props }) {
|
|
18
|
+
return /* @__PURE__ */ jsx("ol", {
|
|
19
|
+
"data-control-ui": "breadcrumb",
|
|
20
|
+
"data-control-family": "breadcrumb",
|
|
21
|
+
"data-slot": "list",
|
|
22
|
+
className: cn("flex flex-wrap items-center break-words", className),
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function BreadcrumbItem({ className, ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx("li", {
|
|
28
|
+
"data-control-ui": "breadcrumb",
|
|
29
|
+
"data-control-family": "breadcrumb",
|
|
30
|
+
"data-slot": "item",
|
|
31
|
+
className: cn("inline-flex items-center", className),
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function BreadcrumbLink({ render, className, children, ...props }) {
|
|
36
|
+
return useRender({
|
|
37
|
+
defaultTagName: "a",
|
|
38
|
+
render,
|
|
39
|
+
props: {
|
|
40
|
+
...props,
|
|
41
|
+
"data-control-ui": "breadcrumb",
|
|
42
|
+
"data-control-family": "breadcrumb",
|
|
43
|
+
"data-slot": "link",
|
|
44
|
+
className,
|
|
45
|
+
children
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
50
|
+
return /* @__PURE__ */ jsx("span", {
|
|
51
|
+
"data-control-ui": "breadcrumb",
|
|
52
|
+
"data-control-family": "breadcrumb",
|
|
53
|
+
"data-slot": "page",
|
|
54
|
+
"aria-current": "page",
|
|
55
|
+
className,
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
60
|
+
return /* @__PURE__ */ jsx("li", {
|
|
61
|
+
"data-control-ui": "breadcrumb",
|
|
62
|
+
"data-control-family": "breadcrumb",
|
|
63
|
+
"data-slot": "separator",
|
|
64
|
+
role: "presentation",
|
|
65
|
+
"aria-hidden": "true",
|
|
66
|
+
className: cn("[&>svg]:size-3.5", className),
|
|
67
|
+
...props,
|
|
68
|
+
children: children ?? /* @__PURE__ */ jsx(ChevronRight, { "data-icon-dir": "inline" })
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function BreadcrumbEllipsis({ label = "Show hidden breadcrumbs", className, ...props }) {
|
|
72
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
73
|
+
"data-control-ui": "breadcrumb",
|
|
74
|
+
"data-control-family": "breadcrumb",
|
|
75
|
+
"data-slot": "ellipsis",
|
|
76
|
+
className: cn("flex items-center justify-center", className),
|
|
77
|
+
...props,
|
|
78
|
+
children: [/* @__PURE__ */ jsx(MoreHorizontal, {
|
|
79
|
+
"aria-hidden": "true",
|
|
80
|
+
className: "size-4"
|
|
81
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
82
|
+
className: "sr-only",
|
|
83
|
+
children: label
|
|
84
|
+
})]
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
|
package/dist/ui/button.d.ts
CHANGED
|
@@ -23,12 +23,13 @@ export type ButtonProps = ComponentProps<"button"> & ButtonAppearanceProps & {
|
|
|
23
23
|
disabled: boolean;
|
|
24
24
|
}>;
|
|
25
25
|
nativeButton?: boolean;
|
|
26
|
+
focusableWhenDisabled?: boolean;
|
|
26
27
|
};
|
|
27
28
|
export type ButtonLinkProps = ComponentProps<"a"> & ButtonAppearanceProps & {
|
|
28
29
|
render?: RenderProp<ComponentProps<"a">>;
|
|
29
30
|
};
|
|
30
31
|
export type ButtonLabelProps = ComponentProps<"label"> & ButtonAppearanceProps;
|
|
31
|
-
export declare const buttonStructureClasses = "
|
|
32
|
+
export declare const buttonStructureClasses = "isolate inline-flex shrink-0 items-center justify-center overflow-visible whitespace-nowrap";
|
|
32
33
|
export declare const buttonTrackStructureClasses = "data-[track=hover]:relative data-[track=hover]:isolate [&_[data-track-item]]:[isolation:auto]";
|
|
33
34
|
export declare const buttonContentClasses = "relative z-[1] inline-flex min-w-0 items-center justify-center gap-[inherit]";
|
|
34
35
|
export declare function Button({ variant, size, tone, active, iconOnly, shape, type, disabled, render, nativeButton, className, children, ...props }: ButtonProps): import("react").JSX.Element;
|
package/dist/ui/button.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
|
9
9
|
//#region src/ui/button.tsx
|
|
10
10
|
const ButtonTrackContext = createContext(false);
|
|
11
11
|
const buttonShapes = ["default", "circle"];
|
|
12
|
-
const buttonStructureClasses = "
|
|
12
|
+
const buttonStructureClasses = "isolate inline-flex shrink-0 items-center justify-center overflow-visible whitespace-nowrap";
|
|
13
13
|
const buttonTrackStructureClasses = "data-[track=hover]:relative data-[track=hover]:isolate [&_[data-track-item]]:[isolation:auto]";
|
|
14
14
|
const buttonContentClasses = "relative z-[1] inline-flex min-w-0 items-center justify-center gap-[inherit]";
|
|
15
15
|
function wrapButtonText(children) {
|
package/dist/ui/calendar.js
CHANGED
|
@@ -4,8 +4,8 @@ import { useEffect, useRef } from "react";
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { CaptionLabel, Day, DayPicker, Month, MonthCaption, MonthGrid, Months, Nav, Weekday } from "react-day-picker";
|
|
6
6
|
//#region src/ui/calendar.tsx
|
|
7
|
-
const dayButtonClasses = "flex w-full items-center justify-center disabled:pointer-events-none";
|
|
8
|
-
const navButtonClasses = "inline-flex items-center justify-center disabled:pointer-events-none";
|
|
7
|
+
const dayButtonClasses = "flex w-full items-center justify-center disabled:pointer-events-none aria-disabled:pointer-events-none";
|
|
8
|
+
const navButtonClasses = "inline-flex items-center justify-center disabled:pointer-events-none aria-disabled:pointer-events-none";
|
|
9
9
|
const chevronPathByOrientation = {
|
|
10
10
|
left: "M10 3 5.5 8 10 13",
|
|
11
11
|
right: "M6 3 10.5 8 6 13",
|
package/dist/ui/card.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RenderProp } from "../control-props.js";
|
|
1
2
|
import { CardKnobStyle } from "../knob-contracts/card-knobs.js";
|
|
2
3
|
import { CSSProperties, ComponentProps } from "react";
|
|
3
4
|
//#region src/ui/card.d.ts
|
|
@@ -11,6 +12,7 @@ export type CardHeaderProps = ComponentProps<"div"> & {
|
|
|
11
12
|
style?: CSSProperties & CardKnobStyle;
|
|
12
13
|
};
|
|
13
14
|
export type CardTitleProps = Omit<ComponentProps<"div">, "style"> & {
|
|
15
|
+
render?: RenderProp<ComponentProps<"div">>;
|
|
14
16
|
style?: CSSProperties & CardKnobStyle;
|
|
15
17
|
};
|
|
16
18
|
export type CardDescriptionProps = ComponentProps<"div"> & {
|
|
@@ -27,7 +29,7 @@ export type CardFooterProps = ComponentProps<"div"> & {
|
|
|
27
29
|
};
|
|
28
30
|
export declare function Card({ variant, className, ...props }: CardProps): import("react").JSX.Element;
|
|
29
31
|
export declare function CardHeader({ className, ...props }: CardHeaderProps): import("react").JSX.Element;
|
|
30
|
-
export declare function CardTitle({
|
|
32
|
+
export declare function CardTitle({ render, ...props }: CardTitleProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
31
33
|
export declare function CardDescription({ className, ...props }: CardDescriptionProps): import("react").JSX.Element;
|
|
32
34
|
export declare function CardAction({ className, ...props }: CardActionProps): import("react").JSX.Element;
|
|
33
35
|
export declare function CardContent({ className, ...props }: CardContentProps): import("react").JSX.Element;
|