@ctrl-ui/react 0.8.7 → 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 +40 -20
- package/dist/activity.js +8 -16
- 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 +39 -39
- package/dist/blocks/design-canvas-inspector.js +2 -2
- package/dist/blocks/design-canvas.d.ts +5 -1
- package/dist/blocks/design-canvas.js +200 -94
- 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 +102 -80
- 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 +4 -1
- package/dist/chat-composer-attachment.js +35 -10
- 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 +57 -30
- package/dist/chat-composer.d.ts +13 -32
- package/dist/chat-composer.js +53 -13
- package/dist/chat-layout.d.ts +19 -0
- package/dist/chat-layout.js +91 -40
- 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 +39 -24
- 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 +86 -23
- 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/editor.js +20 -8
- package/dist/filter-bar/model.d.ts +1 -0
- package/dist/filter-bar/model.js +10 -1
- package/dist/filter-bar/motion.js +4 -4
- package/dist/filter-bar/parts.js +20 -9
- package/dist/filter-bar/types.d.ts +1 -0
- package/dist/filter-bar.js +20 -14
- package/dist/hooks/use-audio-recorder.js +12 -6
- package/dist/hooks/use-chat-composer.d.ts +19 -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-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 +36 -15
- package/dist/inline-citation.d.ts +12 -5
- package/dist/inline-citation.js +26 -17
- 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-message-knobs.d.ts +1 -1
- package/dist/knob-contracts/chat-message-knobs.js +8 -1
- 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/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 +1 -1
- package/dist/knob-contracts/filter-bar-knobs.js +1 -2
- 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 +2 -1
- package/dist/knob-contracts/popup-knobs.d.ts +1 -1
- package/dist/knob-contracts/popup-knobs.js +27 -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 +2 -1
- 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/phone-input-format.js +1 -1
- package/dist/lib/trigger-detect.js +6 -8
- package/dist/markdown-block.js +2 -1
- package/dist/popup-parts.d.ts +8 -0
- package/dist/popup-parts.js +43 -0
- 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 +10 -5
- 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 +5 -7
- package/dist/styles/recipes/button-states.css +66 -0
- package/dist/styles/recipes/button.css +24 -83
- 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 +7 -10
- package/dist/styles/recipes/chat-layout.css +35 -0
- 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 +18 -21
- package/dist/styles/recipes/code-diff.css +46 -33
- package/dist/styles/recipes/code.css +36 -16
- package/dist/styles/recipes/collapsible.css +7 -2
- 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 +11 -2
- package/dist/styles/recipes/context.css +3 -3
- package/dist/styles/recipes/dockable-panel.css +7 -4
- 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 +30 -24
- package/dist/styles/recipes/field.css +61 -26
- package/dist/styles/recipes/filter-bar.css +18 -31
- package/dist/styles/recipes/gradient-editor.css +18 -7
- package/dist/styles/recipes/infinite-canvas.css +0 -1
- package/dist/styles/recipes/inline-attachment.css +3 -3
- 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 +20 -12
- package/dist/styles/recipes/pagination.css +4 -5
- package/dist/styles/recipes/phone-input.css +12 -8
- package/dist/styles/recipes/popup-controls.css +166 -33
- package/dist/styles/recipes/popup-drawer.css +3 -14
- package/dist/styles/recipes/popup-lists.css +128 -27
- package/dist/styles/recipes/popup-motion.css +4 -45
- package/dist/styles/recipes/popup-toast.css +55 -26
- package/dist/styles/recipes/popup.css +139 -141
- package/dist/styles/recipes/range.css +54 -18
- package/dist/styles/recipes/resizable.css +2 -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 +8 -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 +9 -1
- package/dist/styles/recipes/table.css +14 -10
- package/dist/styles/recipes/tabs.css +17 -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 +10 -7
- 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 +37 -16
- 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-dialog.js +1 -1
- package/dist/ui/alert.d.ts +3 -1
- package/dist/ui/alert.js +14 -8
- package/dist/ui/autocomplete.js +4 -2
- 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 +3 -3
- 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.d.ts +2 -0
- package/dist/ui/code-diff.d.ts +1 -1
- package/dist/ui/code-diff.js +72 -28
- package/dist/ui/code.d.ts +5 -3
- package/dist/ui/code.js +28 -29
- package/dist/ui/collapsible.js +1 -1
- package/dist/ui/color-picker.d.ts +5 -2
- package/dist/ui/color-picker.js +85 -37
- package/dist/ui/combobox-disabled-selection.d.ts +1 -2
- package/dist/ui/combobox-disabled-selection.js +7 -9
- package/dist/ui/combobox.js +14 -6
- package/dist/ui/command.d.ts +8 -2
- package/dist/ui/command.js +30 -14
- package/dist/ui/context-menu.js +4 -1
- package/dist/ui/dialog.d.ts +2 -1
- package/dist/ui/dialog.js +4 -23
- 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 +63 -23
- package/dist/ui/drawer.js +1 -1
- package/dist/ui/dropdown-menu.js +5 -4
- package/dist/ui/dropzone.d.ts +2 -2
- package/dist/ui/dropzone.js +75 -16
- 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/gradient-editor.d.ts +1 -1
- package/dist/ui/gradient-editor.js +37 -21
- package/dist/ui/hover-card.js +1 -1
- package/dist/ui/infinite-canvas.d.ts +3 -2
- package/dist/ui/infinite-canvas.js +63 -19
- package/dist/ui/input-group.d.ts +0 -3
- package/dist/ui/input-group.js +4 -14
- package/dist/ui/input-otp.d.ts +1 -1
- package/dist/ui/input-otp.js +32 -15
- package/dist/ui/input.js +4 -4
- package/dist/ui/item.d.ts +2 -1
- package/dist/ui/item.js +12 -8
- 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 +31 -1
- package/dist/ui/menubar.js +3 -3
- package/dist/ui/morphing-panel.js +3 -2
- package/dist/ui/native-select.d.ts +1 -1
- package/dist/ui/native-select.js +24 -11
- package/dist/ui/navigation-menu.js +1 -1
- 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 +58 -60
- package/dist/ui/popover.js +1 -1
- package/dist/ui/radio-group.d.ts +2 -0
- package/dist/ui/resizable.d.ts +3 -2
- package/dist/ui/resizable.js +5 -3
- package/dist/ui/responsive-dialog.d.ts +1 -1
- package/dist/ui/responsive-dialog.js +4 -21
- package/dist/ui/rich-tooltip.d.ts +10 -4
- package/dist/ui/rich-tooltip.js +82 -34
- package/dist/ui/scroll-area.d.ts +1 -1
- package/dist/ui/scroll-area.js +43 -28
- package/dist/ui/select.js +1 -1
- package/dist/ui/sheet.js +1 -1
- package/dist/ui/sidebar-menu.d.ts +5 -1
- package/dist/ui/sidebar-menu.js +32 -34
- package/dist/ui/sidebar-provider.d.ts +10 -1
- package/dist/ui/sidebar-provider.js +39 -14
- package/dist/ui/sidebar-resize-rail.js +8 -4
- package/dist/ui/sidebar.d.ts +11 -6
- package/dist/ui/sidebar.js +47 -24
- 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 +2 -2
- package/dist/ui/table-of-contents.js +20 -8
- package/dist/ui/table.js +4 -2
- 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 +101 -55
- package/dist/ui/toolbar.d.ts +3 -2
- package/dist/ui/toolbar.js +4 -2
- package/dist/ui/tooltip.js +4 -21
- package/dist/ui/tree.js +121 -81
- package/dist/ui/trigger-menu.js +2 -1
- package/dist/user-ask.d.ts +10 -5
- package/dist/user-ask.js +32 -12
- package/package.json +5 -1
- package/dist/hooks/use-keyboard-navigation.d.ts +0 -3
- package/dist/hooks/use-keyboard-navigation.js +0 -22
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { Collapsible } from "@base-ui/react/collapsible";
|
|
6
6
|
//#region src/ui/morphing-panel.tsx
|
|
7
7
|
function MorphingPanelTriggerElement({ triggerProps, open, render, className, children }) {
|
|
@@ -13,6 +13,7 @@ function MorphingPanelTriggerElement({ triggerProps, open, render, className, ch
|
|
|
13
13
|
props: {
|
|
14
14
|
...triggerProps,
|
|
15
15
|
"data-control-ui": "morphing-panel",
|
|
16
|
+
"data-control-family": "morphing-panel",
|
|
16
17
|
"data-slot": "trigger",
|
|
17
18
|
"data-state": panelState,
|
|
18
19
|
className: cn(triggerProps.className, className),
|
|
@@ -55,7 +56,7 @@ function MorphingPanel({ collapsedSize, expandedSize, className, style, ...props
|
|
|
55
56
|
}
|
|
56
57
|
function MorphingPanelTrigger({ render, className, children, ...props }) {
|
|
57
58
|
return /* @__PURE__ */ jsx(Collapsible.Trigger, {
|
|
58
|
-
className: "group/morphing-panel-trigger absolute top-0
|
|
59
|
+
className: "group/morphing-panel-trigger absolute top-0 end-0 z-10 flex cursor-pointer items-center justify-between data-[state=open]:top-2 data-[state=open]:end-2 data-[state=open]:justify-center [&>svg]:shrink-0",
|
|
59
60
|
...props,
|
|
60
61
|
render: (triggerProps, state) => /* @__PURE__ */ jsx(MorphingPanelTriggerElement, {
|
|
61
62
|
triggerProps,
|
|
@@ -7,5 +7,5 @@ export type NativeSelectProps = Omit<Omit<ComponentProps<"select">, "size">, "st
|
|
|
7
7
|
} & {
|
|
8
8
|
size?: ControlSize;
|
|
9
9
|
};
|
|
10
|
-
export declare function NativeSelect({ size, className, children, ...props }: NativeSelectProps): import("react").JSX.Element;
|
|
10
|
+
export declare function NativeSelect({ ref, id, name, value, defaultValue, disabled, autoFocus, size, className, children, ...props }: NativeSelectProps): import("react").JSX.Element;
|
|
11
11
|
//#endregion
|
package/dist/ui/native-select.js
CHANGED
|
@@ -1,19 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { cn } from "../lib/cn.js";
|
|
2
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Input } from "@base-ui/react/input";
|
|
3
5
|
//#region src/ui/native-select.tsx
|
|
4
|
-
function NativeSelect({ size = "md", className, children, ...props }) {
|
|
6
|
+
function NativeSelect({ ref, id, name, value, defaultValue, disabled, autoFocus, size = "md", className, children, ...props }) {
|
|
5
7
|
return /* @__PURE__ */ jsxs("div", {
|
|
8
|
+
"data-control-family": "field",
|
|
9
|
+
"data-field-kind": "native-select",
|
|
6
10
|
className: "relative inline-flex w-full items-center",
|
|
7
|
-
children: [/* @__PURE__ */ jsx(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
children: [/* @__PURE__ */ jsx(Input, {
|
|
12
|
+
ref,
|
|
13
|
+
id,
|
|
14
|
+
name,
|
|
15
|
+
value,
|
|
16
|
+
defaultValue,
|
|
17
|
+
disabled,
|
|
18
|
+
autoFocus,
|
|
19
|
+
render: /* @__PURE__ */ jsx("select", {
|
|
20
|
+
...props,
|
|
21
|
+
"data-control-ui": "native-select",
|
|
22
|
+
"data-field-kind": "native-select",
|
|
23
|
+
"data-slot": "root",
|
|
24
|
+
"data-size": size,
|
|
25
|
+
"data-control-family": "field",
|
|
26
|
+
"data-control": "true",
|
|
27
|
+
className: cn("w-full min-w-0 cursor-pointer", className),
|
|
28
|
+
children
|
|
29
|
+
})
|
|
17
30
|
}), /* @__PURE__ */ jsx("span", {
|
|
18
31
|
"aria-hidden": "true",
|
|
19
32
|
"data-control-ui": "native-select",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { controlEffectsAttribute } from "../skin.js";
|
|
3
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { controlEffectsAttribute } from "../skin.js";
|
|
4
4
|
import { useSkin } from "../skin-provider.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { NavigationMenu as NavigationMenu$1 } from "@base-ui/react/navigation-menu";
|
package/dist/ui/page-layout.d.ts
CHANGED
|
@@ -26,11 +26,11 @@ export declare function PageHeader({ variant, className, ...props }: PageHeaderP
|
|
|
26
26
|
export type PageTitleProps = Omit<ComponentProps<"h1">, "style"> & {
|
|
27
27
|
style?: PageStyle;
|
|
28
28
|
};
|
|
29
|
-
export declare function PageTitle(
|
|
29
|
+
export declare function PageTitle(props: PageTitleProps): import("react").JSX.Element;
|
|
30
30
|
export type PageDescriptionProps = Omit<ComponentProps<"p">, "style"> & {
|
|
31
31
|
style?: PageStyle;
|
|
32
32
|
};
|
|
33
|
-
export declare function PageDescription(
|
|
33
|
+
export declare function PageDescription(props: PageDescriptionProps): import("react").JSX.Element;
|
|
34
34
|
export type PageActionsProps = Omit<ComponentProps<"div">, "style"> & {
|
|
35
35
|
style?: PageStyle;
|
|
36
36
|
};
|
package/dist/ui/page-layout.js
CHANGED
|
@@ -55,21 +55,19 @@ function PageHeader({ variant = "flow", className, ...props }) {
|
|
|
55
55
|
...props
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
function PageTitle(
|
|
58
|
+
function PageTitle(props) {
|
|
59
59
|
return /* @__PURE__ */ jsx("h1", {
|
|
60
60
|
"data-control-ui": "page-layout",
|
|
61
61
|
"data-control-family": "page-layout",
|
|
62
62
|
"data-slot": "title",
|
|
63
|
-
className: cn("text-balance", className),
|
|
64
63
|
...props
|
|
65
64
|
});
|
|
66
65
|
}
|
|
67
|
-
function PageDescription(
|
|
66
|
+
function PageDescription(props) {
|
|
68
67
|
return /* @__PURE__ */ jsx("p", {
|
|
69
68
|
"data-control-ui": "page-layout",
|
|
70
69
|
"data-control-family": "page-layout",
|
|
71
70
|
"data-slot": "description",
|
|
72
|
-
className: cn("text-pretty", className),
|
|
73
71
|
...props
|
|
74
72
|
});
|
|
75
73
|
}
|
package/dist/ui/pagination.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { PaginationKnobStyle } from "../knob-contracts/pagination-knobs.js";
|
|
2
2
|
import { CSSProperties, ComponentProps } from "react";
|
|
3
3
|
//#region src/ui/pagination.d.ts
|
|
4
|
-
export type PaginationEllipsisProps = Omit<ComponentProps<"span">, "style"> & {
|
|
4
|
+
export type PaginationEllipsisProps = Omit<ComponentProps<"span">, "style" | "children"> & {
|
|
5
|
+
label?: string;
|
|
5
6
|
style?: CSSProperties & PaginationKnobStyle;
|
|
6
7
|
};
|
|
7
8
|
export type PaginationLinkProps = Omit<ComponentProps<"a"> & {
|
|
8
9
|
isActive?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
9
11
|
}, "style"> & {
|
|
10
12
|
style?: CSSProperties & PaginationKnobStyle;
|
|
11
13
|
};
|
|
@@ -18,8 +20,8 @@ export declare function PaginationContent({ className, ...props }: ComponentProp
|
|
|
18
20
|
export declare function PaginationItem({ className, ...props }: ComponentProps<"li"> & {
|
|
19
21
|
style?: CSSProperties & PaginationKnobStyle;
|
|
20
22
|
}): import("react").JSX.Element;
|
|
21
|
-
export declare function PaginationLink({ isActive, className, ...props }: PaginationLinkProps): import("react").JSX.Element;
|
|
22
|
-
export declare function PaginationPrevious({ className, ...props }:
|
|
23
|
-
export declare function PaginationNext({ className, ...props }:
|
|
24
|
-
export declare function PaginationEllipsis({ className, ...props }: PaginationEllipsisProps): import("react").JSX.Element;
|
|
23
|
+
export declare function PaginationLink({ isActive, disabled, href, className, ...props }: PaginationLinkProps): import("react").JSX.Element;
|
|
24
|
+
export declare function PaginationPrevious({ className, children, ...props }: PaginationLinkProps): import("react").JSX.Element;
|
|
25
|
+
export declare function PaginationNext({ className, children, ...props }: PaginationLinkProps): import("react").JSX.Element;
|
|
26
|
+
export declare function PaginationEllipsis({ label, className, ...props }: PaginationEllipsisProps): import("react").JSX.Element;
|
|
25
27
|
//#endregion
|
package/dist/ui/pagination.js
CHANGED
|
@@ -4,7 +4,7 @@ import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";
|
|
|
4
4
|
//#region src/ui/pagination.tsx
|
|
5
5
|
function Pagination({ className, ...props }) {
|
|
6
6
|
return /* @__PURE__ */ jsx("nav", {
|
|
7
|
-
"aria-label": "
|
|
7
|
+
"aria-label": "Pagination",
|
|
8
8
|
"data-control-ui": "pagination",
|
|
9
9
|
"data-control-family": "pagination",
|
|
10
10
|
"data-slot": "root",
|
|
@@ -31,7 +31,7 @@ function PaginationItem({ className, ...props }) {
|
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
const paginationLinkChrome = "inline-flex h-[var(--control-h-sm)] min-w-[var(--control-h-sm)] cursor-pointer select-none items-center justify-center whitespace-nowrap aria-disabled:pointer-events-none [&>svg]:size-4 [&>svg]:shrink-0";
|
|
34
|
-
function PaginationLink({ isActive = false, className, ...props }) {
|
|
34
|
+
function PaginationLink({ isActive = false, disabled = false, href, className, ...props }) {
|
|
35
35
|
return /* @__PURE__ */ jsx("a", {
|
|
36
36
|
"aria-current": isActive ? "page" : void 0,
|
|
37
37
|
"data-control-ui": "pagination",
|
|
@@ -39,37 +39,43 @@ function PaginationLink({ isActive = false, className, ...props }) {
|
|
|
39
39
|
"data-slot": "link",
|
|
40
40
|
"data-control": "true",
|
|
41
41
|
"data-active": isActive ? "true" : void 0,
|
|
42
|
+
role: disabled ? "link" : void 0,
|
|
43
|
+
"aria-disabled": disabled || void 0,
|
|
42
44
|
className: cn(paginationLinkChrome, className),
|
|
43
|
-
...props
|
|
45
|
+
...props,
|
|
46
|
+
href: disabled ? void 0 : href
|
|
44
47
|
});
|
|
45
48
|
}
|
|
46
|
-
function PaginationPrevious({ className, ...props }) {
|
|
49
|
+
function PaginationPrevious({ className, children = "Previous", ...props }) {
|
|
47
50
|
return /* @__PURE__ */ jsxs(PaginationLink, {
|
|
48
|
-
"aria-label": "Go to previous page",
|
|
49
51
|
className,
|
|
50
52
|
...props,
|
|
51
|
-
children: [/* @__PURE__ */ jsx(ChevronLeft, {
|
|
53
|
+
children: [/* @__PURE__ */ jsx(ChevronLeft, {
|
|
54
|
+
"aria-hidden": "true",
|
|
55
|
+
"data-icon-dir": "inline"
|
|
56
|
+
}), /* @__PURE__ */ jsx("span", { children })]
|
|
52
57
|
});
|
|
53
58
|
}
|
|
54
|
-
function PaginationNext({ className, ...props }) {
|
|
59
|
+
function PaginationNext({ className, children = "Next", ...props }) {
|
|
55
60
|
return /* @__PURE__ */ jsxs(PaginationLink, {
|
|
56
|
-
"aria-label": "Go to next page",
|
|
57
61
|
className,
|
|
58
62
|
...props,
|
|
59
|
-
children: [/* @__PURE__ */ jsx("span", { children
|
|
63
|
+
children: [/* @__PURE__ */ jsx("span", { children }), /* @__PURE__ */ jsx(ChevronRight, {
|
|
64
|
+
"aria-hidden": "true",
|
|
65
|
+
"data-icon-dir": "inline"
|
|
66
|
+
})]
|
|
60
67
|
});
|
|
61
68
|
}
|
|
62
|
-
function PaginationEllipsis({ className, ...props }) {
|
|
69
|
+
function PaginationEllipsis({ label = "More pages", className, ...props }) {
|
|
63
70
|
return /* @__PURE__ */ jsxs("span", {
|
|
64
|
-
"aria-hidden": "true",
|
|
65
71
|
"data-control-ui": "pagination",
|
|
66
72
|
"data-control-family": "pagination",
|
|
67
73
|
"data-slot": "ellipsis",
|
|
68
74
|
className: cn("flex h-[var(--control-h-sm)] min-w-[var(--control-h-sm)] items-center justify-center [&>svg]:size-4", className),
|
|
69
75
|
...props,
|
|
70
|
-
children: [/* @__PURE__ */ jsx(MoreHorizontal, {}), /* @__PURE__ */ jsx("span", {
|
|
76
|
+
children: [/* @__PURE__ */ jsx(MoreHorizontal, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", {
|
|
71
77
|
className: "sr-only",
|
|
72
|
-
children:
|
|
78
|
+
children: label
|
|
73
79
|
})]
|
|
74
80
|
});
|
|
75
81
|
}
|
package/dist/ui/phone-input.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export type PhoneInputProps = Omit<ComponentProps<"input">, "defaultValue" | "si
|
|
|
21
21
|
countryCallingCodeEditable?: boolean;
|
|
22
22
|
addInternationalOption?: boolean;
|
|
23
23
|
countrySearchPlaceholder?: string;
|
|
24
|
+
countrySearchLabel?: string;
|
|
24
25
|
countryEmptyMessage?: string;
|
|
25
26
|
"data-invalid"?: boolean | string;
|
|
26
27
|
style?: CSSProperties & PhoneInputKnobStyle;
|
package/dist/ui/phone-input.js
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
3
|
import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
|
|
4
|
-
import { InputGroup, InputGroupAddon
|
|
5
|
-
import {
|
|
4
|
+
import { InputGroup, InputGroupAddon } from "./input-group.js";
|
|
5
|
+
import { Input } from "./input.js";
|
|
6
6
|
import { normalizePhoneInputText, normalizePhoneInputValue } from "../lib/phone-input-format.js";
|
|
7
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "./command.js";
|
|
7
8
|
import { useState } from "react";
|
|
8
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import flags from "react-phone-number-input/flags";
|
|
10
10
|
import PhoneNumberInput, { getCountryCallingCode, parsePhoneNumber } from "react-phone-number-input/max";
|
|
11
|
+
import flags from "react-phone-number-input/flags";
|
|
11
12
|
//#region src/ui/phone-input.tsx
|
|
12
13
|
const FLAG_COMPONENTS = flags;
|
|
13
14
|
const PhoneNumberInputWithRef = PhoneNumberInput;
|
|
15
|
+
function phoneInputKnobs(style) {
|
|
16
|
+
if (!style) return void 0;
|
|
17
|
+
return Object.fromEntries(Object.entries(style).filter(([property]) => property.startsWith("--cui-phone-input-")));
|
|
18
|
+
}
|
|
14
19
|
function PhoneInputContainer({ className, ...props }) {
|
|
15
20
|
return /* @__PURE__ */ jsx(InputGroup, {
|
|
16
21
|
"data-field-kind": "phone-input",
|
|
@@ -19,12 +24,8 @@ function PhoneInputContainer({ className, ...props }) {
|
|
|
19
24
|
});
|
|
20
25
|
}
|
|
21
26
|
function PhoneInputControl({ className, normalizationCountry, onChange, onNativeChange, ...props }) {
|
|
22
|
-
return /* @__PURE__ */ jsx(
|
|
27
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
23
28
|
...props,
|
|
24
|
-
"data-control-ui": "field",
|
|
25
|
-
"data-control-family": "field",
|
|
26
|
-
"data-field-kind": "phone-input",
|
|
27
|
-
"data-slot": "input",
|
|
28
29
|
dir: "ltr",
|
|
29
30
|
className,
|
|
30
31
|
onChange: (event) => {
|
|
@@ -35,11 +36,7 @@ function PhoneInputControl({ className, normalizationCountry, onChange, onNative
|
|
|
35
36
|
}
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
|
-
function PhoneCountrySelect({ value, options, onChange, onFocus, onBlur, disabled, readOnly, "aria-label": ariaLabel = "Country", searchPlaceholder = "Search country…", emptyMessage, knobStyle }) {
|
|
39
|
-
const countryStyle = knobStyle;
|
|
40
|
-
const triggerStyle = knobStyle;
|
|
41
|
-
const metadataStyle = knobStyle;
|
|
42
|
-
const chevronStyle = knobStyle;
|
|
39
|
+
function PhoneCountrySelect({ value, options, onChange, onFocus, onBlur, disabled, readOnly, "aria-label": ariaLabel = "Country", searchPlaceholder = "Search country…", searchLabel = "Search countries", emptyMessage, knobStyle }) {
|
|
43
40
|
const [open, setOpen] = useState(false);
|
|
44
41
|
const selectedOption = options.find((option) => option.value === value);
|
|
45
42
|
const selectedCallingCode = value ? `+${getCountryCallingCode(value)}` : void 0;
|
|
@@ -47,7 +44,6 @@ function PhoneCountrySelect({ value, options, onChange, onFocus, onBlur, disable
|
|
|
47
44
|
return /* @__PURE__ */ jsx(InputGroupAddon, {
|
|
48
45
|
"data-phone-input-country": "",
|
|
49
46
|
className: "h-full self-stretch p-0",
|
|
50
|
-
style: countryStyle,
|
|
51
47
|
children: /* @__PURE__ */ jsxs(Popover, {
|
|
52
48
|
open,
|
|
53
49
|
onOpenChange: setOpen,
|
|
@@ -61,52 +57,54 @@ function PhoneCountrySelect({ value, options, onChange, onFocus, onBlur, disable
|
|
|
61
57
|
onFocus,
|
|
62
58
|
onBlur,
|
|
63
59
|
className: "inline-flex h-full items-center justify-center disabled:cursor-not-allowed",
|
|
64
|
-
|
|
65
|
-
children: [/* @__PURE__ */ jsx(CountryFlag, { country: value }), /* @__PURE__ */ jsx(ChevronIcon, {
|
|
66
|
-
open,
|
|
67
|
-
style: chevronStyle
|
|
68
|
-
})]
|
|
60
|
+
children: [/* @__PURE__ */ jsx(CountryFlag, { country: value }), /* @__PURE__ */ jsx(ChevronIcon, { open })]
|
|
69
61
|
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
70
62
|
align: "start",
|
|
71
63
|
padding: "none",
|
|
72
64
|
className: "w-[min(20rem,calc(100vw-2rem))]",
|
|
73
|
-
children: /* @__PURE__ */
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
65
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
66
|
+
"data-control-ui": "phone-input",
|
|
67
|
+
"data-control-family": "phone-input",
|
|
68
|
+
"data-slot": "root",
|
|
69
|
+
className: "contents",
|
|
70
|
+
style: knobStyle,
|
|
71
|
+
children: /* @__PURE__ */ jsxs(Command, {
|
|
72
|
+
chrome: "embedded",
|
|
73
|
+
children: [/* @__PURE__ */ jsx(CommandInput, {
|
|
74
|
+
"aria-label": searchLabel,
|
|
75
|
+
placeholder: searchPlaceholder
|
|
76
|
+
}), /* @__PURE__ */ jsxs(CommandList, { children: [/* @__PURE__ */ jsx(CommandEmpty, { title: emptyMessage }), /* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => {
|
|
77
|
+
const callingCode = option.value ? `+${getCountryCallingCode(option.value)}` : "";
|
|
78
|
+
const selected = option.value === value;
|
|
79
|
+
return /* @__PURE__ */ jsxs(CommandItem, {
|
|
80
|
+
value: `${option.label} ${option.value ?? "international"} ${callingCode}`,
|
|
81
|
+
"data-current": selected ? "" : void 0,
|
|
82
|
+
onSelect: () => {
|
|
83
|
+
onChange(option.value);
|
|
84
|
+
setOpen(false);
|
|
85
|
+
},
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ jsx(CountryFlag, { country: option.value }),
|
|
88
|
+
/* @__PURE__ */ jsx("span", {
|
|
89
|
+
className: "min-w-0 flex-1 truncate",
|
|
90
|
+
children: option.label
|
|
91
|
+
}),
|
|
92
|
+
callingCode ? /* @__PURE__ */ jsx("span", {
|
|
93
|
+
"data-control-ui": "phone-input",
|
|
94
|
+
"data-control-family": "phone-input",
|
|
95
|
+
"data-slot": "metadata",
|
|
96
|
+
className: "min-w-0",
|
|
97
|
+
children: callingCode
|
|
98
|
+
}) : null,
|
|
99
|
+
selected ? /* @__PURE__ */ jsx("span", {
|
|
100
|
+
className: "sr-only",
|
|
101
|
+
children: "Selected"
|
|
102
|
+
}) : null,
|
|
103
|
+
/* @__PURE__ */ jsx(CheckIcon, { visible: selected })
|
|
104
|
+
]
|
|
105
|
+
}, option.value ?? "international");
|
|
106
|
+
}) })] })]
|
|
107
|
+
})
|
|
110
108
|
})
|
|
111
109
|
})]
|
|
112
110
|
})
|
|
@@ -134,8 +132,8 @@ function PhoneFlag({ country }) {
|
|
|
134
132
|
}
|
|
135
133
|
function PhoneInput(props) {
|
|
136
134
|
const controlled = Object.hasOwn(props, "value");
|
|
137
|
-
const { ref, size = "md", value, defaultValue, onValueChange, onChange: onNativeChange, name, disabled, readOnly, className, style, defaultCountry, countries, labels, locales, countryOptionsOrder, onCountryChange, countryCallingCodeEditable = true, addInternationalOption = true, countrySearchPlaceholder, countryEmptyMessage, "aria-invalid": ariaInvalid, "data-invalid": dataInvalid, ...inputProps } = props;
|
|
138
|
-
const knobStyle = style;
|
|
135
|
+
const { ref, size = "md", value, defaultValue, onValueChange, onChange: onNativeChange, name, disabled, readOnly, className, style, defaultCountry, countries, labels, locales, countryOptionsOrder, onCountryChange, countryCallingCodeEditable = true, addInternationalOption = true, countrySearchPlaceholder, countrySearchLabel, countryEmptyMessage, "aria-invalid": ariaInvalid, "data-invalid": dataInvalid, ...inputProps } = props;
|
|
136
|
+
const knobStyle = phoneInputKnobs(style);
|
|
139
137
|
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
140
138
|
const [selectedCountry, setSelectedCountry] = useState(defaultCountry);
|
|
141
139
|
const currentValue = controlled ? value : internalValue;
|
|
@@ -186,6 +184,7 @@ function PhoneInput(props) {
|
|
|
186
184
|
countrySelectComponent: PhoneCountrySelect,
|
|
187
185
|
countrySelectProps: {
|
|
188
186
|
searchPlaceholder: countrySearchPlaceholder,
|
|
187
|
+
searchLabel: countrySearchLabel,
|
|
189
188
|
emptyMessage: countryEmptyMessage,
|
|
190
189
|
knobStyle
|
|
191
190
|
},
|
|
@@ -197,7 +196,7 @@ function PhoneInput(props) {
|
|
|
197
196
|
disabled
|
|
198
197
|
}) : null] });
|
|
199
198
|
}
|
|
200
|
-
function ChevronIcon({ open
|
|
199
|
+
function ChevronIcon({ open }) {
|
|
201
200
|
return /* @__PURE__ */ jsx("svg", {
|
|
202
201
|
"data-control-ui": "phone-input",
|
|
203
202
|
"data-control-family": "phone-input",
|
|
@@ -205,7 +204,6 @@ function ChevronIcon({ open, style }) {
|
|
|
205
204
|
viewBox: "0 0 12 12",
|
|
206
205
|
"data-open": open ? "true" : void 0,
|
|
207
206
|
className: "size-3",
|
|
208
|
-
style,
|
|
209
207
|
"aria-hidden": "true",
|
|
210
208
|
fill: "none",
|
|
211
209
|
children: /* @__PURE__ */ jsx("path", {
|
package/dist/ui/popover.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { controlEffectsAttribute } from "../skin.js";
|
|
3
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { controlEffectsAttribute } from "../skin.js";
|
|
4
4
|
import { useSkin } from "../skin-provider.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { Popover as Popover$1 } from "@base-ui/react/popover";
|
package/dist/ui/radio-group.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export type RadioProps = Omit<{
|
|
|
20
20
|
className?: string;
|
|
21
21
|
"aria-label"?: string;
|
|
22
22
|
"aria-labelledby"?: string;
|
|
23
|
+
"aria-describedby"?: string;
|
|
24
|
+
"aria-invalid"?: boolean | "true" | "false";
|
|
23
25
|
}, "style"> & {
|
|
24
26
|
style?: CSSProperties & ChoiceKnobStyle;
|
|
25
27
|
};
|
package/dist/ui/resizable.d.ts
CHANGED
|
@@ -63,10 +63,11 @@ export type ResizableFloatingPanelProps = Omit<ComponentProps<"div">, "style"> &
|
|
|
63
63
|
maxSize?: number;
|
|
64
64
|
handleVariant?: ResizableHandleVariant;
|
|
65
65
|
handleLabel?: string;
|
|
66
|
+
getAriaValueText?: (size: number) => string;
|
|
66
67
|
style?: ResizableFloatingPanelStyle;
|
|
67
68
|
};
|
|
68
69
|
export declare function ResizablePanelGroup({ className, orientation, variant, disableCursor, children, ...props }: ResizablePanelGroupProps): import("react").JSX.Element;
|
|
69
70
|
export declare function ResizablePanel({ className, ...props }: ResizablePanelProps): import("react").JSX.Element;
|
|
70
|
-
export declare function ResizableHandle({ className, variant, withHandle, children, ...props }: ResizableHandleProps): import("react").JSX.Element;
|
|
71
|
-
export declare function ResizableFloatingPanel({ side, size: controlledSize, defaultSize, onSizeChange, minSize, maxSize, handleVariant, handleLabel, className, style, children, ...props }: ResizableFloatingPanelProps): import("react").JSX.Element;
|
|
71
|
+
export declare function ResizableHandle({ className, variant, withHandle, children, "aria-label": ariaLabel, ...props }: ResizableHandleProps): import("react").JSX.Element;
|
|
72
|
+
export declare function ResizableFloatingPanel({ side, size: controlledSize, defaultSize, onSizeChange, minSize, maxSize, handleVariant, handleLabel, getAriaValueText, className, style, children, ...props }: ResizableFloatingPanelProps): import("react").JSX.Element;
|
|
72
73
|
//#endregion
|
package/dist/ui/resizable.js
CHANGED
|
@@ -42,7 +42,7 @@ function ResizablePanel({ className, ...props }) {
|
|
|
42
42
|
...props
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
function ResizableHandle({ className, variant = "solid", withHandle, children, ...props }) {
|
|
45
|
+
function ResizableHandle({ className, variant = "solid", withHandle, children, "aria-label": ariaLabel = "Resize panel", ...props }) {
|
|
46
46
|
const { orientation, disableCursor } = useContext(ResizableGroupContext);
|
|
47
47
|
const axis = orientation === "horizontal" ? "vertical" : "horizontal";
|
|
48
48
|
return /* @__PURE__ */ jsxs(Separator, {
|
|
@@ -53,6 +53,7 @@ function ResizableHandle({ className, variant = "solid", withHandle, children, .
|
|
|
53
53
|
"data-axis": axis,
|
|
54
54
|
"data-cursor": disableCursor ? "none" : void 0,
|
|
55
55
|
className: cn("relative flex items-center justify-center", axis === "vertical" ? "w-px touch-pan-y" : "h-px touch-pan-x", className),
|
|
56
|
+
"aria-label": ariaLabel,
|
|
56
57
|
...props,
|
|
57
58
|
children: [withHandle ? /* @__PURE__ */ jsx("span", {
|
|
58
59
|
"data-control-ui": "resizable",
|
|
@@ -65,7 +66,7 @@ function ResizableHandle({ className, variant = "solid", withHandle, children, .
|
|
|
65
66
|
}) : null, children]
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
|
-
function ResizableFloatingPanel({ side = "right", size: controlledSize, defaultSize = 280, onSizeChange, minSize = 160, maxSize = 640, handleVariant = "hover", handleLabel = "Resize panel", className, style, children, ...props }) {
|
|
69
|
+
function ResizableFloatingPanel({ side = "right", size: controlledSize, defaultSize = 280, onSizeChange, minSize = 160, maxSize = 640, handleVariant = "hover", handleLabel = "Resize panel", getAriaValueText = (value) => `${value} pixels`, className, style, children, ...props }) {
|
|
69
70
|
const [uncontrolledSize, setUncontrolledSize] = useState(defaultSize);
|
|
70
71
|
const [hovered, setHovered] = useState(false);
|
|
71
72
|
const [focused, setFocused] = useState(false);
|
|
@@ -150,13 +151,14 @@ function ResizableFloatingPanel({ side = "right", size: controlledSize, defaultS
|
|
|
150
151
|
"aria-valuenow": size,
|
|
151
152
|
"aria-valuemin": minSize,
|
|
152
153
|
"aria-valuemax": maxSize,
|
|
154
|
+
"aria-valuetext": getAriaValueText(size),
|
|
153
155
|
"data-control-ui": "resizable",
|
|
154
156
|
"data-control-family": "resizable",
|
|
155
157
|
"data-slot": "handle",
|
|
156
158
|
"data-variant": handleVariant,
|
|
157
159
|
"data-axis": "vertical",
|
|
158
160
|
"data-separator": separatorState,
|
|
159
|
-
className: cn("absolute inset-y-0 w-px touch-none after:absolute after:inset-y-0 after
|
|
161
|
+
className: cn("absolute inset-y-0 w-px touch-none after:absolute after:inset-y-0 after:inset-x-[calc((1px_-_var(--target-min))/2)] after:content-['']", side === "right" ? "left-0" : "right-0"),
|
|
160
162
|
onPointerDown: beginResize,
|
|
161
163
|
onPointerMove: updateResize,
|
|
162
164
|
onPointerUp: endResize,
|
|
@@ -9,7 +9,7 @@ export type ResponsiveDialogContentProps = DialogContentProps & {
|
|
|
9
9
|
export declare function ResponsiveDialog({ open: controlledOpen, defaultOpen, onOpenChange, children }: ResponsiveDialogProps): import("react").JSX.Element;
|
|
10
10
|
export declare function ResponsiveDialogTrigger(props: Omit<ComponentProps<typeof DialogTrigger>, "handle">): import("react").JSX.Element;
|
|
11
11
|
export declare function ResponsiveDialogClose({ className, children, variant, size, tone, iconOnly, ...props }: DialogCloseProps): import("react").JSX.Element;
|
|
12
|
-
export declare function ResponsiveDialogContent({ className, dialogClassName, drawerClassName, children, showCloseButton, ...props }: ResponsiveDialogContentProps): import("react").JSX.Element;
|
|
12
|
+
export declare function ResponsiveDialogContent({ className, dialogClassName, drawerClassName, children, showCloseButton, closeLabel, ...props }: ResponsiveDialogContentProps): import("react").JSX.Element;
|
|
13
13
|
export declare function ResponsiveDialogHeader(props: ComponentProps<typeof DialogHeader>): import("react").JSX.Element;
|
|
14
14
|
export declare function ResponsiveDialogFooter(props: ComponentProps<typeof DialogFooter>): import("react").JSX.Element;
|
|
15
15
|
export declare function ResponsiveDialogTitle(props: ComponentProps<typeof DialogTitle>): import("react").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
3
|
import { Button } from "./button.js";
|
|
4
|
+
import { PopupCloseButton } from "../popup-parts.js";
|
|
4
5
|
import { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger } from "./drawer.js";
|
|
5
6
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "./dialog.js";
|
|
6
7
|
import { createContext, useContext, useState, useSyncExternalStore } from "react";
|
|
@@ -73,10 +74,11 @@ function ResponsiveDialogClose({ className, children, variant = "surface", size
|
|
|
73
74
|
})
|
|
74
75
|
});
|
|
75
76
|
}
|
|
76
|
-
function ResponsiveDialogContent({ className, dialogClassName, drawerClassName, children, showCloseButton = true, ...props }) {
|
|
77
|
+
function ResponsiveDialogContent({ className, dialogClassName, drawerClassName, children, showCloseButton = true, closeLabel = "Close", ...props }) {
|
|
77
78
|
if (!useResponsiveDialogContext()) return /* @__PURE__ */ jsx(DialogContent, {
|
|
78
79
|
className: cn(className, dialogClassName),
|
|
79
80
|
showCloseButton,
|
|
81
|
+
closeLabel,
|
|
80
82
|
...props,
|
|
81
83
|
children
|
|
82
84
|
});
|
|
@@ -86,26 +88,7 @@ function ResponsiveDialogContent({ className, dialogClassName, drawerClassName,
|
|
|
86
88
|
children: [/* @__PURE__ */ jsx(DrawerBody, {
|
|
87
89
|
padding: "none",
|
|
88
90
|
children
|
|
89
|
-
}), showCloseButton ? /* @__PURE__ */
|
|
90
|
-
variant: "ghost",
|
|
91
|
-
size: "xs",
|
|
92
|
-
className: "absolute right-3 top-3 w-[var(--control-h-xs)] px-0",
|
|
93
|
-
children: [/* @__PURE__ */ jsx("svg", {
|
|
94
|
-
viewBox: "0 0 16 16",
|
|
95
|
-
className: "size-4",
|
|
96
|
-
"aria-hidden": "true",
|
|
97
|
-
fill: "none",
|
|
98
|
-
children: /* @__PURE__ */ jsx("path", {
|
|
99
|
-
d: "M4 4 12 12M12 4 4 12",
|
|
100
|
-
stroke: "currentColor",
|
|
101
|
-
strokeWidth: "1.4",
|
|
102
|
-
strokeLinecap: "round"
|
|
103
|
-
})
|
|
104
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
105
|
-
className: "sr-only",
|
|
106
|
-
children: "Close"
|
|
107
|
-
})]
|
|
108
|
-
}) : null]
|
|
91
|
+
}), showCloseButton ? /* @__PURE__ */ jsx(DrawerClose, { render: /* @__PURE__ */ jsx(PopupCloseButton, { label: closeLabel }) }) : null]
|
|
109
92
|
});
|
|
110
93
|
}
|
|
111
94
|
function ResponsiveDialogHeader(props) {
|
|
@@ -30,9 +30,10 @@ export type RichTooltipProps = Omit<ComponentProps<typeof Popover.Root>, "modal"
|
|
|
30
30
|
tone?: RichTooltipTone;
|
|
31
31
|
storageKey?: string;
|
|
32
32
|
dismissOnOutsidePress?: boolean;
|
|
33
|
+
dismissOnFocusOut?: boolean;
|
|
33
34
|
trapFocus?: boolean;
|
|
34
35
|
};
|
|
35
|
-
export declare function RichTooltip({ step, tone, storageKey, dismissOnOutsidePress, trapFocus, open, defaultOpen, onOpenChange, children, ...props }: RichTooltipProps): import("react").JSX.Element;
|
|
36
|
+
export declare function RichTooltip({ step, tone, storageKey, dismissOnOutsidePress, dismissOnFocusOut, trapFocus, open, defaultOpen, onOpenChange, children, ...props }: RichTooltipProps): import("react").JSX.Element;
|
|
36
37
|
export declare function RichTooltipTrigger({ className, ...props }: ComponentProps<typeof Popover.Trigger> & {
|
|
37
38
|
style?: CSSProperties & PopupKnobStyle;
|
|
38
39
|
}): import("react").JSX.Element;
|
|
@@ -69,13 +70,18 @@ export type RichTooltipProgressProps = Omit<ComponentProps<"div">, "style"> & {
|
|
|
69
70
|
style?: CSSProperties & RichTooltipKnobStyle & PopupKnobStyle;
|
|
70
71
|
};
|
|
71
72
|
export declare function RichTooltipProgress({ className, variant, children, ...props }: RichTooltipProgressProps): import("react").JSX.Element | null;
|
|
72
|
-
export declare function RichTooltipPrevious({ className, children, onClick, ...props }: Omit<ComponentProps<"button">, "style"> & {
|
|
73
|
+
export declare function RichTooltipPrevious({ className, children, label, onClick, ...props }: Omit<ComponentProps<"button">, "style"> & {
|
|
73
74
|
style?: CSSProperties & RichTooltipKnobStyle & PopupKnobStyle;
|
|
75
|
+
label?: string;
|
|
74
76
|
}): import("react").JSX.Element | null;
|
|
75
|
-
export declare function RichTooltipNext({ className, children, onClick, ...props }: Omit<ComponentProps<"button">, "style"> & {
|
|
77
|
+
export declare function RichTooltipNext({ className, children, nextLabel, finishLabel, gotItLabel, onClick, ref, ...props }: Omit<ComponentProps<"button">, "style"> & {
|
|
76
78
|
style?: CSSProperties & RichTooltipKnobStyle & PopupKnobStyle;
|
|
79
|
+
nextLabel?: string;
|
|
80
|
+
finishLabel?: string;
|
|
81
|
+
gotItLabel?: string;
|
|
77
82
|
}): import("react").JSX.Element;
|
|
78
|
-
export declare function RichTooltipClose({ className, children, ...props }: Omit<ComponentProps<typeof Popover.Close>, "style"> & {
|
|
83
|
+
export declare function RichTooltipClose({ className, children, label, ...props }: Omit<ComponentProps<typeof Popover.Close>, "style"> & {
|
|
79
84
|
style?: CSSProperties & RichTooltipKnobStyle & PopupKnobStyle;
|
|
85
|
+
label?: string;
|
|
80
86
|
}): import("react").JSX.Element;
|
|
81
87
|
//#endregion
|