@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/ui/toast.js
CHANGED
|
@@ -3,36 +3,104 @@ import { cn } from "../lib/cn.js";
|
|
|
3
3
|
import { controlEffectsAttribute } from "../skin.js";
|
|
4
4
|
import { useSkin } from "../skin-provider.js";
|
|
5
5
|
import { Button } from "./button.js";
|
|
6
|
+
import { PopupCloseButton } from "../popup-parts.js";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { CircleCheckIcon, CircleXIcon, InfoIcon, TriangleAlertIcon } from "lucide-react";
|
|
7
9
|
import { Toast } from "@base-ui/react/toast";
|
|
8
10
|
//#region src/ui/toast.tsx
|
|
9
11
|
const toastManager = Toast.createToastManager();
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
const errorDefaults = {
|
|
13
|
+
timeout: 0,
|
|
14
|
+
priority: "high"
|
|
15
|
+
};
|
|
16
|
+
function persistenceDefaults(options) {
|
|
17
|
+
if (options.type === "error") return errorDefaults;
|
|
18
|
+
return options.actionProps ? { timeout: 0 } : void 0;
|
|
19
|
+
}
|
|
20
|
+
function show(title, options = {}) {
|
|
21
|
+
return toastManager.add({
|
|
12
22
|
title,
|
|
23
|
+
...persistenceDefaults(options),
|
|
24
|
+
...options
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function withType(type) {
|
|
28
|
+
return (title, options) => show(title, {
|
|
13
29
|
type,
|
|
14
30
|
...options
|
|
15
31
|
});
|
|
16
32
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
33
|
+
function persistentError(update) {
|
|
34
|
+
return typeof update === "string" ? {
|
|
35
|
+
...errorDefaults,
|
|
36
|
+
description: update
|
|
37
|
+
} : {
|
|
38
|
+
...errorDefaults,
|
|
39
|
+
...update
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const toast = Object.assign(show, {
|
|
21
43
|
success: withType("success"),
|
|
22
44
|
error: withType("error"),
|
|
23
45
|
warning: withType("warning"),
|
|
24
46
|
info: withType("info"),
|
|
25
|
-
message: (title, options) =>
|
|
26
|
-
|
|
27
|
-
...options
|
|
47
|
+
message: (title, options) => show(title, options),
|
|
48
|
+
promise: (promise, options) => toastManager.promise(promise, {
|
|
49
|
+
...options,
|
|
50
|
+
error: (reason) => persistentError(typeof options.error === "function" ? options.error(reason) : options.error)
|
|
28
51
|
}),
|
|
29
|
-
promise: (...args) => toastManager.promise(...args),
|
|
30
52
|
dismiss: (id) => toastManager.close(id)
|
|
31
53
|
});
|
|
54
|
+
const statusIcons = {
|
|
55
|
+
success: CircleCheckIcon,
|
|
56
|
+
error: CircleXIcon,
|
|
57
|
+
warning: TriangleAlertIcon,
|
|
58
|
+
info: InfoIcon
|
|
59
|
+
};
|
|
60
|
+
function isToastStatus(type) {
|
|
61
|
+
return type !== void 0 && Object.hasOwn(statusIcons, type);
|
|
62
|
+
}
|
|
32
63
|
const useToast = Toast.useToastManager;
|
|
33
|
-
function
|
|
64
|
+
function ToastIndicator({ status, style }) {
|
|
65
|
+
if (!status) return null;
|
|
66
|
+
const StatusIcon = statusIcons[status];
|
|
67
|
+
return /* @__PURE__ */ jsx("span", {
|
|
68
|
+
"aria-hidden": "true",
|
|
69
|
+
"data-control-ui": "toast",
|
|
70
|
+
"data-control-family": "popup",
|
|
71
|
+
"data-popup-kind": "toast",
|
|
72
|
+
"data-slot": "indicator",
|
|
73
|
+
style,
|
|
74
|
+
className: "shrink-0",
|
|
75
|
+
children: /* @__PURE__ */ jsx(StatusIcon, { className: "size-4" })
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function ToastText({ entry, statusPrefix }) {
|
|
79
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
80
|
+
className: "flex min-w-0 flex-1 flex-col",
|
|
81
|
+
children: [entry.title ? /* @__PURE__ */ jsxs(Toast.Title, {
|
|
82
|
+
"data-control-ui": "toast",
|
|
83
|
+
"data-control-family": "popup",
|
|
84
|
+
"data-popup-kind": "toast",
|
|
85
|
+
"data-slot": "title",
|
|
86
|
+
children: [statusPrefix, entry.title]
|
|
87
|
+
}) : null, entry.description ? /* @__PURE__ */ jsxs(Toast.Description, {
|
|
88
|
+
"data-control-ui": "toast",
|
|
89
|
+
"data-control-family": "popup",
|
|
90
|
+
"data-popup-kind": "toast",
|
|
91
|
+
"data-slot": "description",
|
|
92
|
+
children: [entry.title ? null : statusPrefix, entry.description]
|
|
93
|
+
}) : null]
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function ToastList({ rootStyle, indicatorStyle, actionStyle, closeStyle, closeLabel, statusLabels }) {
|
|
34
97
|
const { toasts } = Toast.useToastManager();
|
|
35
98
|
return toasts.map((entry) => {
|
|
99
|
+
const status = isToastStatus(entry.type) ? entry.type : void 0;
|
|
100
|
+
const statusPrefix = status ? /* @__PURE__ */ jsx("span", {
|
|
101
|
+
className: "sr-only",
|
|
102
|
+
children: `${statusLabels[status]}: `
|
|
103
|
+
}) : null;
|
|
36
104
|
return /* @__PURE__ */ jsx(Toast.Root, {
|
|
37
105
|
toast: entry,
|
|
38
106
|
"data-control-ui": "toast",
|
|
@@ -43,7 +111,7 @@ function ToastList({ rootStyle, indicatorStyle, actionStyle, closeStyle }) {
|
|
|
43
111
|
style: rootStyle,
|
|
44
112
|
"data-slot": "root",
|
|
45
113
|
"data-surface": "floating",
|
|
46
|
-
className: cn("[--gap:0.75rem] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))]", "absolute
|
|
114
|
+
className: cn("[--gap:0.75rem] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))]", "absolute end-0 bottom-0 z-[calc(var(--z-toast)-var(--toast-index))] h-[var(--height)] w-full select-none data-[expanded]:h-[var(--toast-height)]", "after:absolute after:top-full after:start-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']"),
|
|
47
115
|
children: /* @__PURE__ */ jsxs(Toast.Content, {
|
|
48
116
|
"data-control-ui": "toast",
|
|
49
117
|
"data-control-family": "popup",
|
|
@@ -51,28 +119,13 @@ function ToastList({ rootStyle, indicatorStyle, actionStyle, closeStyle }) {
|
|
|
51
119
|
"data-slot": "content",
|
|
52
120
|
className: "flex items-start",
|
|
53
121
|
children: [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
className: "shrink-0"
|
|
62
|
-
}) : null,
|
|
63
|
-
/* @__PURE__ */ jsxs("div", {
|
|
64
|
-
className: "flex min-w-0 flex-1 flex-col",
|
|
65
|
-
children: [entry.title ? /* @__PURE__ */ jsx(Toast.Title, {
|
|
66
|
-
"data-control-ui": "toast",
|
|
67
|
-
"data-control-family": "popup",
|
|
68
|
-
"data-popup-kind": "toast",
|
|
69
|
-
"data-slot": "title"
|
|
70
|
-
}) : null, entry.description ? /* @__PURE__ */ jsx(Toast.Description, {
|
|
71
|
-
"data-control-ui": "toast",
|
|
72
|
-
"data-control-family": "popup",
|
|
73
|
-
"data-popup-kind": "toast",
|
|
74
|
-
"data-slot": "description"
|
|
75
|
-
}) : null]
|
|
122
|
+
/* @__PURE__ */ jsx(ToastIndicator, {
|
|
123
|
+
status,
|
|
124
|
+
style: indicatorStyle
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ jsx(ToastText, {
|
|
127
|
+
entry,
|
|
128
|
+
statusPrefix
|
|
76
129
|
}),
|
|
77
130
|
entry.actionProps ? /* @__PURE__ */ jsx(Toast.Action, {
|
|
78
131
|
style: actionStyle,
|
|
@@ -86,25 +139,11 @@ function ToastList({ rootStyle, indicatorStyle, actionStyle, closeStyle }) {
|
|
|
86
139
|
}) : null,
|
|
87
140
|
/* @__PURE__ */ jsx(Toast.Close, {
|
|
88
141
|
style: closeStyle,
|
|
89
|
-
|
|
90
|
-
render: (renderProps) => /* @__PURE__ */ jsx(Button, {
|
|
142
|
+
render: (renderProps) => /* @__PURE__ */ jsx(PopupCloseButton, {
|
|
91
143
|
...renderProps,
|
|
92
144
|
"data-popup-kind": "toast",
|
|
93
|
-
|
|
94
|
-
variant: "quiet"
|
|
95
|
-
size: "xs",
|
|
96
|
-
iconOnly: true
|
|
97
|
-
}),
|
|
98
|
-
children: /* @__PURE__ */ jsx("svg", {
|
|
99
|
-
viewBox: "0 0 16 16",
|
|
100
|
-
"aria-hidden": "true",
|
|
101
|
-
fill: "none",
|
|
102
|
-
children: /* @__PURE__ */ jsx("path", {
|
|
103
|
-
d: "M4 4 12 12M12 4 4 12",
|
|
104
|
-
stroke: "currentColor",
|
|
105
|
-
strokeWidth: "1.4",
|
|
106
|
-
strokeLinecap: "round"
|
|
107
|
-
})
|
|
145
|
+
label: closeLabel,
|
|
146
|
+
variant: "quiet"
|
|
108
147
|
})
|
|
109
148
|
})
|
|
110
149
|
]
|
|
@@ -112,7 +151,7 @@ function ToastList({ rootStyle, indicatorStyle, actionStyle, closeStyle }) {
|
|
|
112
151
|
}, entry.id);
|
|
113
152
|
});
|
|
114
153
|
}
|
|
115
|
-
function Toaster({ className, timeout, limit, rootStyle, indicatorStyle, actionStyle, closeStyle }) {
|
|
154
|
+
function Toaster({ className, timeout, limit, rootStyle, indicatorStyle, actionStyle, closeStyle, closeLabel = "Dismiss notification", successLabel = "Success", errorLabel = "Error", warningLabel = "Warning", infoLabel = "Info" }) {
|
|
116
155
|
const skin = useSkin();
|
|
117
156
|
return /* @__PURE__ */ jsx(Toast.Provider, {
|
|
118
157
|
toastManager,
|
|
@@ -125,12 +164,19 @@ function Toaster({ className, timeout, limit, rootStyle, indicatorStyle, actionS
|
|
|
125
164
|
"data-slot": "viewport",
|
|
126
165
|
"data-skin": skin.id,
|
|
127
166
|
"data-effects": controlEffectsAttribute(skin.effects),
|
|
128
|
-
className: cn("fixed
|
|
167
|
+
className: cn("fixed end-4 bottom-4 z-(--z-toast) mx-auto w-[calc(100vw-2rem)] sm:end-6 sm:bottom-6 sm:w-[22.5rem]", className),
|
|
129
168
|
children: /* @__PURE__ */ jsx(ToastList, {
|
|
130
169
|
rootStyle,
|
|
131
170
|
indicatorStyle,
|
|
132
171
|
actionStyle,
|
|
133
|
-
closeStyle
|
|
172
|
+
closeStyle,
|
|
173
|
+
closeLabel,
|
|
174
|
+
statusLabels: {
|
|
175
|
+
success: successLabel,
|
|
176
|
+
error: errorLabel,
|
|
177
|
+
warning: warningLabel,
|
|
178
|
+
info: infoLabel
|
|
179
|
+
}
|
|
134
180
|
})
|
|
135
181
|
}) })
|
|
136
182
|
});
|
package/dist/ui/toggle.d.ts
CHANGED
|
@@ -15,6 +15,6 @@ export type ToggleGroupProps<TValue extends string = string> = Omit<ComponentPro
|
|
|
15
15
|
orientation?: "horizontal" | "vertical";
|
|
16
16
|
indicator?: HoverIndicator;
|
|
17
17
|
};
|
|
18
|
-
export declare function Toggle({ variant, size, tone, active, showCheck, className, pressed, defaultPressed, onPressedChange, value, disabled, children, ...props }: ToggleProps): import("react").JSX.Element;
|
|
18
|
+
export declare function Toggle({ variant, size, tone, active, iconOnly, showCheck, className, pressed, defaultPressed, onPressedChange, value, disabled, children, ...props }: ToggleProps): import("react").JSX.Element;
|
|
19
19
|
export declare function ToggleGroup<TValue extends string = string>({ className, orientation, indicator, children, ...props }: ToggleGroupProps<TValue>): import("react").JSX.Element;
|
|
20
20
|
//#endregion
|
package/dist/ui/toggle.js
CHANGED
|
@@ -8,7 +8,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
|
|
9
9
|
import { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
|
|
10
10
|
//#region src/ui/toggle.tsx
|
|
11
|
-
function Toggle({ variant = "surface", size = "sm", tone = "neutral", active, showCheck = false, className, pressed, defaultPressed, onPressedChange, value, disabled, children, ...props }) {
|
|
11
|
+
function Toggle({ variant = "surface", size = "sm", tone = "neutral", active, iconOnly = false, showCheck = false, className, pressed, defaultPressed, onPressedChange, value, disabled, children, ...props }) {
|
|
12
12
|
const tracksHover = useContext(ButtonTrackContext);
|
|
13
13
|
return /* @__PURE__ */ jsx(Toggle$1, {
|
|
14
14
|
"data-track-item": tracksHover ? "" : void 0,
|
|
@@ -30,6 +30,7 @@ function Toggle({ variant = "surface", size = "sm", tone = "neutral", active, sh
|
|
|
30
30
|
"data-variant": variant,
|
|
31
31
|
"data-tone": tone,
|
|
32
32
|
"data-size": size,
|
|
33
|
+
"data-icon-only": iconOnly ? "true" : void 0,
|
|
33
34
|
className: cn(buttonStructureClasses, renderProps.className, className),
|
|
34
35
|
children: /* @__PURE__ */ jsxs("span", {
|
|
35
36
|
"data-control-ui": "toggle",
|
package/dist/ui/toolbar.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ToolbarKnobStyle } from "../knob-contracts/toolbar-knobs.js";
|
|
2
|
-
import { CSSProperties, ComponentProps } from "react";
|
|
3
2
|
import { Toolbar as Toolbar$1 } from "@base-ui/react/toolbar";
|
|
3
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
4
4
|
//#region src/ui/toolbar.d.ts
|
|
5
5
|
export type ToolbarVariant = "default" | "inverse" | "floating";
|
|
6
6
|
export type ToolbarLinkVariant = "default" | "track";
|
|
@@ -15,6 +15,7 @@ export type ToolbarButtonProps = Omit<ComponentProps<"button">, "style"> & {
|
|
|
15
15
|
};
|
|
16
16
|
export type ToolbarLinkProps = Omit<ComponentProps<"a">, "style"> & {
|
|
17
17
|
variant?: ToolbarLinkVariant;
|
|
18
|
+
active?: boolean;
|
|
18
19
|
style?: CSSProperties & ToolbarKnobStyle;
|
|
19
20
|
};
|
|
20
21
|
export type ToolbarGroupProps = ComponentProps<"div"> & {
|
|
@@ -31,7 +32,7 @@ export declare function Toolbar({ orientation, variant, className, children, ...
|
|
|
31
32
|
type RefinedToolbarButtonProps = ToolbarButtonProps & Pick<ComponentProps<typeof Toolbar$1.Button>, "render">;
|
|
32
33
|
export declare function ToolbarButton({ iconOnly, className, ...props }: RefinedToolbarButtonProps): import("react").JSX.Element;
|
|
33
34
|
type RefinedToolbarLinkProps = ToolbarLinkProps & Pick<ComponentProps<typeof Toolbar$1.Link>, "render">;
|
|
34
|
-
export declare function ToolbarLink({ variant, className, ...props }: RefinedToolbarLinkProps): import("react").JSX.Element;
|
|
35
|
+
export declare function ToolbarLink({ variant, active, className, ...props }: RefinedToolbarLinkProps): import("react").JSX.Element;
|
|
35
36
|
export declare function ToolbarGroup({ className, ...props }: ToolbarGroupProps): import("react").JSX.Element;
|
|
36
37
|
export declare function ToolbarSeparator({ orientation, className, ...props }: ToolbarSeparatorProps): import("react").JSX.Element;
|
|
37
38
|
type RefinedToolbarInputProps = ToolbarInputProps & Pick<ComponentProps<typeof Toolbar$1.Input>, "render">;
|
package/dist/ui/toolbar.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
3
|
import { Toolbar as Toolbar$1 } from "@base-ui/react/toolbar";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/ui/toolbar.tsx
|
|
6
6
|
function Toolbar({ orientation = "horizontal", variant = "default", className, children, ...props }) {
|
|
7
7
|
return /* @__PURE__ */ jsxs(Toolbar$1.Root, {
|
|
@@ -37,7 +37,7 @@ function ToolbarButton({ iconOnly = false, className, ...props }) {
|
|
|
37
37
|
...props
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
function ToolbarLink({ variant = "default", className, ...props }) {
|
|
40
|
+
function ToolbarLink({ variant = "default", active = false, className, ...props }) {
|
|
41
41
|
return /* @__PURE__ */ jsx(Toolbar$1.Link, {
|
|
42
42
|
"data-control-ui": "toolbar",
|
|
43
43
|
"data-control-family": "toolbar",
|
|
@@ -45,6 +45,8 @@ function ToolbarLink({ variant = "default", className, ...props }) {
|
|
|
45
45
|
"data-control": "true",
|
|
46
46
|
"data-size": "sm",
|
|
47
47
|
"data-variant": variant,
|
|
48
|
+
"data-active": active || void 0,
|
|
49
|
+
"aria-current": active ? "page" : void 0,
|
|
48
50
|
className: cn("inline-flex shrink-0 items-center justify-center [&_svg]:block [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", variant === "track" && "relative z-[2]", className),
|
|
49
51
|
...props
|
|
50
52
|
});
|
package/dist/ui/tooltip.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
3
|
import { controlEffectsAttribute } from "../skin.js";
|
|
4
4
|
import { useSkin } from "../skin-provider.js";
|
|
5
|
+
import { PopupArrowShape } from "../popup-parts.js";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
|
|
7
8
|
//#region src/ui/tooltip.tsx
|
|
@@ -64,29 +65,11 @@ function TooltipContent({ className, children, side = "top", sideOffset = 8, ali
|
|
|
64
65
|
"data-control-family": "popup",
|
|
65
66
|
"data-popup-kind": "tooltip",
|
|
66
67
|
"data-slot": "arrow",
|
|
67
|
-
className:
|
|
68
|
-
children: /* @__PURE__ */ jsx(
|
|
68
|
+
className: "flex",
|
|
69
|
+
children: /* @__PURE__ */ jsx(PopupArrowShape, {})
|
|
69
70
|
}) : null]
|
|
70
71
|
})
|
|
71
72
|
}) });
|
|
72
73
|
}
|
|
73
|
-
function TooltipArrowSvg() {
|
|
74
|
-
return /* @__PURE__ */ jsx("svg", {
|
|
75
|
-
"aria-hidden": "true",
|
|
76
|
-
focusable: "false",
|
|
77
|
-
width: "12",
|
|
78
|
-
height: "8",
|
|
79
|
-
viewBox: "0 0 12 8",
|
|
80
|
-
fill: "none",
|
|
81
|
-
overflow: "visible",
|
|
82
|
-
children: /* @__PURE__ */ jsx("path", {
|
|
83
|
-
"data-control-ui": "tooltip",
|
|
84
|
-
"data-popup-kind": "tooltip",
|
|
85
|
-
"data-control-family": "popup",
|
|
86
|
-
"data-slot": "arrow-shape",
|
|
87
|
-
d: "M0 7L4 2Q6 0 8 2L12 7L12 8L0 8Z"
|
|
88
|
-
})
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
74
|
//#endregion
|
|
92
75
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|