fancy-ui-vue 0.1.1 → 0.3.0
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/PORTING.md +123 -2
- package/README.md +40 -13
- package/dist/components/accordion/Accordion.vue.d.ts +44 -0
- package/dist/components/accordion/Accordion.vue.js +88 -0
- package/dist/components/accordion/Accordion.vue2.js +4 -0
- package/dist/components/accordion/AccordionContent.vue.d.ts +25 -0
- package/dist/components/accordion/AccordionContent.vue.js +42 -0
- package/dist/components/accordion/AccordionContent.vue2.js +4 -0
- package/dist/components/accordion/AccordionItem.vue.d.ts +21 -0
- package/dist/components/accordion/AccordionItem.vue.js +66 -0
- package/dist/components/accordion/AccordionItem.vue2.js +4 -0
- package/dist/components/accordion/AccordionTrigger.vue.d.ts +24 -0
- package/dist/components/accordion/AccordionTrigger.vue.js +83 -0
- package/dist/components/accordion/AccordionTrigger.vue2.js +4 -0
- package/dist/components/accordion/accordion-core.d.ts +35 -0
- package/dist/components/accordion/accordion-core.js +44 -0
- package/dist/components/accordion/index.d.ts +11 -0
- package/dist/components/accordion/types.d.ts +45 -0
- package/dist/components/accordion/types.js +7 -0
- package/dist/components/alert-dialog/AlertDialog.vue.js +22 -3
- package/dist/components/animated-testimonials/AnimatedTestimonials.vue.js +3 -3
- package/dist/components/apple-card-carousel/AppleCard.vue.js +1 -1
- package/dist/components/autocomplete/Autocomplete.vue.js +1 -1
- package/dist/components/autocomplete/Autocomplete.vue2.js +22 -15
- package/dist/components/avatar/Avatar.vue.d.ts +27 -0
- package/dist/components/avatar/Avatar.vue.js +119 -0
- package/dist/components/avatar/Avatar.vue2.js +4 -0
- package/dist/components/avatar/avatar-core.d.ts +40 -0
- package/dist/components/avatar/avatar-core.js +57 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/badge/Badge.vue.d.ts +21 -0
- package/dist/components/badge/Badge.vue.js +46 -0
- package/dist/components/badge/Badge.vue2.js +4 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/bento-grid/BentoFrame.vue.js +1 -1
- package/dist/components/bento-grid/BentoFrame.vue2.js +6 -5
- package/dist/components/bento-grid/BentoGrid.vue.js +1 -1
- package/dist/components/bento-grid/BentoGrid.vue2.js +12 -12
- package/dist/components/bento-grid/BentoGridCard.vue.js +6 -5
- package/dist/components/bento-grid/BentoGridItem.vue.js +6 -5
- package/dist/components/bg-falling-stars/FallingStarsBg.vue.d.ts +1 -1
- package/dist/components/bg-falling-stars/FallingStarsBg.vue.js +1 -1
- package/dist/components/bg-falling-stars/bg-falling-stars-core.d.ts +1 -1
- package/dist/components/bg-falling-stars/bg-falling-stars-core.js +47 -12
- package/dist/components/book/Book.vue.js +8 -9
- package/dist/components/book/BookDescription.vue.js +6 -5
- package/dist/components/book/BookHeader.vue.js +6 -5
- package/dist/components/book/BookTitle.vue.js +6 -5
- package/dist/components/box-reveal/BoxReveal.vue.js +6 -5
- package/dist/components/button/Button.vue.d.ts +6 -4
- package/dist/components/button/Button.vue.js +1 -1
- package/dist/components/button/Button.vue2.js +50 -22
- package/dist/components/card-3d/CardContainer.vue.js +1 -1
- package/dist/components/card-3d/CardItem.vue.js +1 -1
- package/dist/components/card-spotlight/CardSpotlight.vue.js +1 -1
- package/dist/components/chat-message/ChatMessageAction.vue.d.ts +4 -2
- package/dist/components/chat-message/ChatMessageAction.vue.js +4 -2
- package/dist/components/checkbox/Checkbox.vue.d.ts +2 -0
- package/dist/components/checkbox/Checkbox.vue.js +1 -1
- package/dist/components/checkbox/Checkbox.vue2.js +17 -7
- package/dist/components/collapsible/Collapsible.vue.d.ts +31 -0
- package/dist/components/collapsible/Collapsible.vue.js +60 -0
- package/dist/components/collapsible/Collapsible.vue2.js +4 -0
- package/dist/components/collapsible/CollapsibleContent.vue.d.ts +26 -0
- package/dist/components/collapsible/CollapsibleContent.vue.js +81 -0
- package/dist/components/collapsible/CollapsibleContent.vue2.js +4 -0
- package/dist/components/collapsible/CollapsibleTrigger.vue.d.ts +21 -0
- package/dist/components/collapsible/CollapsibleTrigger.vue.js +57 -0
- package/dist/components/collapsible/CollapsibleTrigger.vue2.js +4 -0
- package/dist/components/collapsible/collapsible-core.d.ts +47 -0
- package/dist/components/collapsible/collapsible-core.js +40 -0
- package/dist/components/collapsible/index.d.ts +8 -0
- package/dist/components/collapsible/types.d.ts +24 -0
- package/dist/components/collapsible/types.js +5 -0
- package/dist/components/combobox/Combobox.vue.js +1 -1
- package/dist/components/combobox/Combobox.vue2.js +24 -16
- package/dist/components/command-menu/CommandMenu.vue.d.ts +5 -0
- package/dist/components/command-menu/CommandMenu.vue.js +1 -1
- package/dist/components/command-menu/CommandMenu.vue2.js +5 -2
- package/dist/components/compare/Compare.vue.d.ts +15 -5
- package/dist/components/compare/Compare.vue.js +1 -1
- package/dist/components/compare/Compare.vue2.js +28 -13
- package/dist/components/composer/ComposerInput.vue.js +1 -1
- package/dist/components/composer/ComposerInput.vue2.js +11 -11
- package/dist/components/composer/ComposerModelPicker.vue.d.ts +4 -0
- package/dist/components/composer/ComposerModelPicker.vue.js +1 -1
- package/dist/components/composer/ComposerModelPicker.vue2.js +29 -15
- package/dist/components/composer/ComposerSubmit.vue.d.ts +2 -0
- package/dist/components/composer/ComposerSubmit.vue.js +16 -15
- package/dist/components/confetti/ConfettiButton.vue.d.ts +9 -2
- package/dist/components/confetti/ConfettiButton.vue.js +24 -6
- package/dist/components/container-text-flip/ContainerTextFlip.vue.js +1 -1
- package/dist/components/container-text-flip/ContainerTextFlip.vue2.js +12 -13
- package/dist/components/copy-button/CopyButton.vue.d.ts +5 -0
- package/dist/components/copy-button/CopyButton.vue.js +1 -1
- package/dist/components/copy-button/CopyButton.vue2.js +72 -11
- package/dist/components/datamosh-transition/DatamoshTransition.vue.d.ts +6 -2
- package/dist/components/datamosh-transition/DatamoshTransition.vue.js +7 -4
- package/dist/components/date-picker/DatePicker.vue.js +1 -1
- package/dist/components/date-picker/DatePicker.vue2.js +27 -21
- package/dist/components/dialog/Dialog.vue.js +20 -1
- package/dist/components/dialog/DialogSurface.vue.js +1 -1
- package/dist/components/dialog/DialogSurface.vue2.js +5 -2
- package/dist/components/dialog/types.d.ts +2 -0
- package/dist/components/direction-aware-hover/DirectionAwareHover.vue.js +1 -1
- package/dist/components/direction-aware-hover/DirectionAwareHover.vue2.js +9 -7
- package/dist/components/displacement-text/DisplacementText.vue.d.ts +4 -1
- package/dist/components/displacement-text/DisplacementText.vue.js +38 -11
- package/dist/components/displacement-text/displacement-text-core.d.ts +94 -4
- package/dist/components/displacement-text/displacement-text-core.js +287 -97
- package/dist/components/drawer/Drawer.vue.d.ts +5 -0
- package/dist/components/drawer/Drawer.vue.js +1 -1
- package/dist/components/drawer/Drawer.vue2.js +5 -2
- package/dist/components/dropdown-menu/DropdownMenuContent.vue.js +2 -1
- package/dist/components/dropdown-menu/DropdownMenuItem.vue.d.ts +4 -0
- package/dist/components/dropdown-menu/DropdownMenuItem.vue.js +17 -10
- package/dist/components/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +8 -0
- package/dist/components/dropdown-menu/DropdownMenuSubTrigger.vue.js +28 -13
- package/dist/components/dropdown-menu/DropdownMenuTrigger.vue.d.ts +4 -0
- package/dist/components/dropdown-menu/DropdownMenuTrigger.vue.js +1 -1
- package/dist/components/dropdown-menu/DropdownMenuTrigger.vue2.js +20 -10
- package/dist/components/editorial-engine/EditorialEngine.vue.js +1 -1
- package/dist/components/editorial-engine/engine.js +13 -0
- package/dist/components/file-upload/FileUpload.vue.d.ts +2 -0
- package/dist/components/file-upload/FileUpload.vue.js +1 -1
- package/dist/components/file-upload/FileUpload.vue2.js +20 -10
- package/dist/components/fireworks-hdr/FireworksHdr.vue.js +2 -2
- package/dist/components/flickering-grid/FlickeringGrid.vue.d.ts +1 -1
- package/dist/components/flickering-grid/FlickeringGrid.vue.js +1 -1
- package/dist/components/flickering-grid/flickering-grid-core.d.ts +1 -1
- package/dist/components/flickering-grid/flickering-grid-core.js +51 -9
- package/dist/components/flip-card/FlipCard.vue.d.ts +3 -1
- package/dist/components/flip-card/FlipCard.vue.js +1 -1
- package/dist/components/flip-card/FlipCard.vue2.js +5 -3
- package/dist/components/fluid-cursor/FluidCursor.vue.js +37 -9
- package/dist/components/fluid-cursor/fluid-cursor-core.js +3 -3
- package/dist/components/fluid-cursor/webgpu-engine.js +3 -3
- package/dist/components/focus/Focus.vue.js +1 -1
- package/dist/components/focus/Focus.vue2.js +2 -2
- package/dist/components/follow-button/FollowButton.vue.d.ts +69 -0
- package/dist/components/follow-button/FollowButton.vue.js +7 -0
- package/dist/components/follow-button/FollowButton.vue2.js +239 -0
- package/dist/components/follow-button/follow-core.d.ts +83 -0
- package/dist/components/follow-button/follow-core.js +92 -0
- package/dist/components/follow-button/index.d.ts +2 -0
- package/dist/components/frosted-glass/FrostedGlass.vue.js +1 -1
- package/dist/components/glare-card/GlareCard.vue.js +1 -1
- package/dist/components/glare-card/GlareCard.vue2.js +4 -4
- package/dist/components/glowing-effect/GlowingEffect.vue.js +3 -3
- package/dist/components/glowing-effect/glowing-effect-core.js +4 -1
- package/dist/components/gradient-button/GradientButton.vue.d.ts +6 -4
- package/dist/components/gradient-button/GradientButton.vue.js +1 -1
- package/dist/components/gradient-button/GradientButton.vue2.js +13 -3
- package/dist/components/icon-button/IconButton.vue.d.ts +6 -4
- package/dist/components/icon-button/IconButton.vue.js +11 -8
- package/dist/components/image-trail-cursor/ImageTrailCursor.vue.js +17 -7
- package/dist/components/image-trail-cursor/trail-variants.js +3 -6
- package/dist/components/inline-citation/InlineCitation.vue.js +1 -1
- package/dist/components/inline-citation/InlineCitation.vue2.js +20 -14
- package/dist/components/input/Input.vue.js +1 -1
- package/dist/components/input/Input.vue2.js +18 -8
- package/dist/components/interactive-grid-pattern/InteractiveGridPattern.vue.js +1 -1
- package/dist/components/interactive-grid-pattern/InteractiveGridPattern.vue2.js +1 -1
- package/dist/components/interactive-hover-button/InteractiveHoverButton.vue.d.ts +6 -3
- package/dist/components/interactive-hover-button/InteractiveHoverButton.vue.js +1 -1
- package/dist/components/interactive-hover-button/InteractiveHoverButton.vue2.js +12 -2
- package/dist/components/letter-pullup/LetterPullup.vue.js +4 -4
- package/dist/components/line-hover-link/LineHoverLink.vue.js +1 -1
- package/dist/components/line-hover-link/LineHoverLink.vue2.js +5 -6
- package/dist/components/link/Link.vue.d.ts +4 -2
- package/dist/components/link/Link.vue.js +1 -1
- package/dist/components/link/Link.vue2.js +11 -8
- package/dist/components/mosaic-glow/MosaicGlow.vue.d.ts +6 -0
- package/dist/components/mosaic-glow/MosaicGlow.vue.js +53 -9
- package/dist/components/mosaic-glow/mosaic-glow-core.d.ts +30 -0
- package/dist/components/mosaic-glow/mosaic-glow-core.js +27 -0
- package/dist/components/mosaic-glow/mosaic-glow-hdr.d.ts +24 -0
- package/dist/components/mosaic-glow/mosaic-glow-hdr.js +200 -0
- package/dist/components/navbar/NavbarLink.vue.d.ts +4 -2
- package/dist/components/navbar/NavbarLink.vue.js +1 -1
- package/dist/components/navbar/NavbarLink.vue2.js +16 -13
- package/dist/components/navigation-menu/NavigationMenu.vue.js +6 -3
- package/dist/components/navigation-menu/NavigationMenuLink.vue.js +1 -1
- package/dist/components/navigation-menu/NavigationMenuLink.vue2.js +8 -8
- package/dist/components/navigation-menu/NavigationMenuTrigger.vue.d.ts +15 -0
- package/dist/components/navigation-menu/NavigationMenuTrigger.vue.js +1 -1
- package/dist/components/navigation-menu/NavigationMenuTrigger.vue2.js +36 -15
- package/dist/components/neon-border/NeonBorder.vue.js +1 -1
- package/dist/components/neon-border/NeonBorder.vue2.js +10 -11
- package/dist/components/number-input/NumberInput.vue.js +1 -1
- package/dist/components/number-input/NumberInput.vue2.js +22 -12
- package/dist/components/password-input/PasswordInput.vue.js +1 -1
- package/dist/components/password-input/PasswordInput.vue2.js +18 -11
- package/dist/components/pixel-loader/PixelLoader.vue.js +1 -1
- package/dist/components/pixel-loader/PixelLoader.vue2.js +6 -6
- package/dist/components/popover/Popover.vue.d.ts +4 -0
- package/dist/components/popover/Popover.vue.js +1 -1
- package/dist/components/popover/Popover.vue2.js +8 -6
- package/dist/components/popover/PopoverContent.vue.js +6 -2
- package/dist/components/pulse-beam/PulseBeam.vue.d.ts +6 -2
- package/dist/components/pulse-beam/PulseBeam.vue.js +1 -1
- package/dist/components/pulse-beam/PulseBeam.vue2.js +7 -4
- package/dist/components/radio-group/RadioGroup.vue.js +12 -11
- package/dist/components/radio-group/RadioGroupItem.vue.d.ts +2 -0
- package/dist/components/radio-group/RadioGroupItem.vue.js +1 -1
- package/dist/components/radio-group/RadioGroupItem.vue2.js +20 -7
- package/dist/components/rainbow-button/RainbowButton.vue.d.ts +11 -2
- package/dist/components/rainbow-button/RainbowButton.vue.js +1 -1
- package/dist/components/rainbow-button/RainbowButton.vue2.js +35 -18
- package/dist/components/ripple-button/RippleButton.vue.d.ts +6 -4
- package/dist/components/ripple-button/RippleButton.vue.js +1 -1
- package/dist/components/ripple-button/RippleButton.vue2.js +10 -5
- package/dist/components/search-input/SearchInput.vue.js +1 -1
- package/dist/components/search-input/SearchInput.vue2.js +19 -9
- package/dist/components/select/Select.vue.d.ts +1 -1
- package/dist/components/select/Select.vue.js +1 -1
- package/dist/components/select/Select.vue2.js +25 -17
- package/dist/components/sheet/Sheet.vue.d.ts +5 -0
- package/dist/components/sheet/Sheet.vue.js +5 -2
- package/dist/components/shimmer-button/ShimmerButton.vue.d.ts +2 -2
- package/dist/components/shimmer-button/ShimmerButton.vue.js +1 -1
- package/dist/components/shimmer-button/ShimmerButton.vue2.js +14 -6
- package/dist/components/sidebar/SidebarItem.vue.d.ts +4 -2
- package/dist/components/sidebar/SidebarItem.vue.js +1 -1
- package/dist/components/sidebar/SidebarItem.vue2.js +4 -2
- package/dist/components/slider/Slider.vue.d.ts +4 -0
- package/dist/components/slider/Slider.vue.js +1 -1
- package/dist/components/slider/Slider.vue2.js +20 -8
- package/dist/components/sources/SourcesTrigger.vue.js +1 -1
- package/dist/components/sources/SourcesTrigger.vue2.js +11 -11
- package/dist/components/sparkles/sparkles-core.d.ts +1 -1
- package/dist/components/sparkles/sparkles-core.js +36 -2
- package/dist/components/switch/Switch.vue.d.ts +2 -0
- package/dist/components/switch/Switch.vue.js +1 -1
- package/dist/components/switch/Switch.vue2.js +16 -6
- package/dist/components/tabs/TabsTrigger.vue.d.ts +6 -0
- package/dist/components/tabs/TabsTrigger.vue.js +1 -1
- package/dist/components/tabs/TabsTrigger.vue2.js +28 -15
- package/dist/components/terminal-block/TerminalBlock.vue.js +1 -1
- package/dist/components/terminal-block/TerminalBlock.vue2.js +10 -9
- package/dist/components/text-reveal-card/TextRevealCard.vue.js +1 -2
- package/dist/components/textarea/Textarea.vue.js +1 -1
- package/dist/components/textarea/Textarea.vue2.js +19 -12
- package/dist/components/tick-nav/TickNav.vue.d.ts +71 -0
- package/dist/components/tick-nav/TickNav.vue.js +7 -0
- package/dist/components/tick-nav/TickNav.vue2.js +285 -0
- package/dist/components/tick-nav/index.d.ts +3 -0
- package/dist/components/tick-nav/tick-nav-core.d.ts +102 -0
- package/dist/components/tick-nav/tick-nav-core.js +398 -0
- package/dist/components/tick-nav/tick-nav-hdr.d.ts +60 -0
- package/dist/components/tick-nav/tick-nav-hdr.js +284 -0
- package/dist/components/tick-nav/types.d.ts +13 -0
- package/dist/components/time-picker/TimePicker.vue.js +1 -1
- package/dist/components/time-picker/TimePicker.vue2.js +25 -17
- package/dist/components/toast/Toast.vue.js +1 -1
- package/dist/components/toast/Toast.vue2.js +16 -4
- package/dist/components/toast/index.d.ts +1 -1
- package/dist/components/toast/store.d.ts +23 -0
- package/dist/components/toast/store.js +35 -7
- package/dist/components/toggle/Toggle.vue.d.ts +12 -0
- package/dist/components/toggle/Toggle.vue.js +1 -1
- package/dist/components/toggle/Toggle.vue2.js +27 -11
- package/dist/components/toggle-group/ToggleGroup.vue.d.ts +11 -0
- package/dist/components/toggle-group/ToggleGroup.vue.js +1 -1
- package/dist/components/toggle-group/ToggleGroup.vue2.js +16 -3
- package/dist/components/toggle-group/ToggleGroupItem.vue.d.ts +6 -0
- package/dist/components/toggle-group/ToggleGroupItem.vue.js +1 -1
- package/dist/components/toggle-group/ToggleGroupItem.vue2.js +27 -14
- package/dist/components/tooltip/Tooltip.vue.js +13 -0
- package/dist/components/typing-indicator/TypingIndicator.vue.js +1 -1
- package/dist/components/typing-indicator/TypingIndicator.vue2.js +7 -6
- package/dist/index.d.ts +6 -0
- package/dist/index.js +440 -413
- package/dist/internals/anchor-position.js +3 -0
- package/dist/internals/call-listener.d.ts +11 -0
- package/dist/internals/call-listener.js +31 -0
- package/dist/internals/dismissable.d.ts +17 -0
- package/dist/internals/dismissable.js +44 -1
- package/dist/internals/env.d.ts +1 -0
- package/dist/internals/env.js +11 -0
- package/dist/internals/focus-trap.js +29 -4
- package/dist/internals/merge-ids.d.ts +6 -0
- package/dist/internals/merge-ids.js +11 -0
- package/dist/internals/motion/presence-core.d.ts +1 -1
- package/dist/sound/engine.js +23 -9
- package/dist/sound/themes.d.ts +4 -3
- package/dist/sound/themes.js +49 -211
- package/dist/sound/types.d.ts +9 -1
- package/dist/sound/types.js +2 -2
- package/dist/styles.css +974 -571
- package/package.json +2 -2
- package/tailwind.css +9 -9
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
2
|
+
const DEFAULT_SETTLE_MS = 300;
|
|
3
|
+
const SETTLE_SLACK_MS = 60;
|
|
4
|
+
const COLLAPSE_PROPERTY = "grid-template-rows";
|
|
5
|
+
function prefersReducedMotionNow() {
|
|
6
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return false;
|
|
7
|
+
return window.matchMedia(REDUCED_MOTION_QUERY).matches;
|
|
8
|
+
}
|
|
9
|
+
function parseTimeList(value) {
|
|
10
|
+
return value.split(",").map((token) => token.trim()).filter((token) => token !== "").map((token) => {
|
|
11
|
+
const match = /^(-?\d*\.?\d+)(ms|s)$/.exec(token);
|
|
12
|
+
if (!match) return Number.NaN;
|
|
13
|
+
return Number.parseFloat(match[1] ?? "") * (match[2] === "s" ? 1e3 : 1);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function settleDelayMs(timing, reduced) {
|
|
17
|
+
if (reduced) return 0;
|
|
18
|
+
const durations = timing ? parseTimeList(timing.transitionDuration).filter(Number.isFinite) : [];
|
|
19
|
+
if (durations.length === 0) return DEFAULT_SETTLE_MS + SETTLE_SLACK_MS;
|
|
20
|
+
const delays = parseTimeList(timing?.transitionDelay ?? "").filter(Number.isFinite);
|
|
21
|
+
const total = Math.max(
|
|
22
|
+
...durations.map(
|
|
23
|
+
(duration, index) => duration + (delays[index % Math.max(delays.length, 1)] ?? 0)
|
|
24
|
+
)
|
|
25
|
+
);
|
|
26
|
+
return total <= 0 ? 0 : total + SETTLE_SLACK_MS;
|
|
27
|
+
}
|
|
28
|
+
function isCollapseEnd(event) {
|
|
29
|
+
return event.target === event.currentTarget && event.propertyName === COLLAPSE_PROPERTY;
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
COLLAPSE_PROPERTY,
|
|
33
|
+
DEFAULT_SETTLE_MS,
|
|
34
|
+
REDUCED_MOTION_QUERY,
|
|
35
|
+
SETTLE_SLACK_MS,
|
|
36
|
+
isCollapseEnd,
|
|
37
|
+
parseTimeList,
|
|
38
|
+
prefersReducedMotionNow,
|
|
39
|
+
settleDelayMs
|
|
40
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Collapsible from "./Collapsible.vue";
|
|
2
|
+
import CollapsibleTrigger from "./CollapsibleTrigger.vue";
|
|
3
|
+
import CollapsibleContent from "./CollapsibleContent.vue";
|
|
4
|
+
import type { CollapsibleProps } from "./Collapsible.vue";
|
|
5
|
+
import type { CollapsibleTriggerProps } from "./CollapsibleTrigger.vue";
|
|
6
|
+
import type { CollapsibleContentProps } from "./CollapsibleContent.vue";
|
|
7
|
+
export { Collapsible, type CollapsibleProps, CollapsibleTrigger, type CollapsibleTriggerProps, CollapsibleContent, type CollapsibleContentProps, };
|
|
8
|
+
export { COLLAPSIBLE_KEY, type CollapsibleContext } from "./types.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The contract between a collapsible root and its trigger and content.
|
|
3
|
+
*
|
|
4
|
+
* `Collapsible` owns the open state; `CollapsibleTrigger` and
|
|
5
|
+
* `CollapsibleContent` read it through injected context instead of a prop and
|
|
6
|
+
* a callback threaded down by hand. `AccordionItem` publishes the same
|
|
7
|
+
* context, so an accordion item's trigger and region are a collapsible's,
|
|
8
|
+
* driven by the accordion's value instead of a flag of their own.
|
|
9
|
+
*/
|
|
10
|
+
import { type InternalContext } from "../../internals/dom/context.js";
|
|
11
|
+
/** What a root publishes. The pieces read it; only the root (or an accordion item) writes it. */
|
|
12
|
+
export interface CollapsibleContext {
|
|
13
|
+
/** Whether the content is expanded. */
|
|
14
|
+
readonly open: boolean;
|
|
15
|
+
/** Whether the trigger is inert. Does not stop a controlled change from opening it. */
|
|
16
|
+
readonly disabled: boolean;
|
|
17
|
+
/** Flips the open state and reports it. A no-op while disabled. */
|
|
18
|
+
toggle(): void;
|
|
19
|
+
/** The id the trigger renders; the content's `aria-labelledby` target when it is a region. */
|
|
20
|
+
readonly triggerId: string;
|
|
21
|
+
/** The id the content renders; the trigger's `aria-controls` target. */
|
|
22
|
+
readonly contentId: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const COLLAPSIBLE_KEY: InternalContext<CollapsibleContext>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./Combobox.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const Combobox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const Combobox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ba8b78a3"]]);
|
|
5
5
|
export {
|
|
6
6
|
Combobox as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, mergeModels, useModel, computed, useTemplateRef, ref, watch, provide, createElementBlock, openBlock, Fragment, createElementVNode, createVNode, createCommentVNode,
|
|
1
|
+
import { defineComponent, mergeModels, useAttrs, useModel, computed, useTemplateRef, ref, watch, provide, createElementBlock, openBlock, Fragment, createElementVNode, createVNode, createCommentVNode, mergeProps, unref, toDisplayString } from "vue";
|
|
2
2
|
import { cn } from "../../utils.js";
|
|
3
3
|
import { useField } from "../../internals/field.js";
|
|
4
4
|
import { useListbox } from "../../internals/listbox.js";
|
|
@@ -8,8 +8,8 @@ import _sfc_main$1 from "./ComboboxPanel.vue.js";
|
|
|
8
8
|
import { defaultFilter } from "./match.js";
|
|
9
9
|
import { COMBOBOX_KEY } from "./types.js";
|
|
10
10
|
const _hoisted_1 = { class: "ft-combobox-wrapper relative" };
|
|
11
|
-
const _hoisted_2 = ["id", "placeholder", "value", "disabled", "required"
|
|
12
|
-
const _hoisted_3 = ["name", "^value", "disabled"];
|
|
11
|
+
const _hoisted_2 = ["id", "placeholder", "value", "disabled", "required"];
|
|
12
|
+
const _hoisted_3 = ["name", "form", "^value", "disabled"];
|
|
13
13
|
const _hoisted_4 = {
|
|
14
14
|
class: "sr-only",
|
|
15
15
|
role: "status",
|
|
@@ -39,6 +39,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
39
39
|
}),
|
|
40
40
|
emits: ["update:value"],
|
|
41
41
|
setup(__props, { expose: __expose }) {
|
|
42
|
+
const attrs = useAttrs();
|
|
42
43
|
const value = useModel(__props, "value");
|
|
43
44
|
const field = useField();
|
|
44
45
|
const uid = useFancyId();
|
|
@@ -200,37 +201,44 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
200
201
|
__props.class
|
|
201
202
|
)
|
|
202
203
|
);
|
|
204
|
+
function inputAttrs() {
|
|
205
|
+
const describedBy = [field?.describedBy, attrs["aria-describedby"]].filter(Boolean).join(" ") || void 0;
|
|
206
|
+
return {
|
|
207
|
+
...attrs,
|
|
208
|
+
type: "text",
|
|
209
|
+
role: "combobox",
|
|
210
|
+
"aria-invalid": effectiveInvalid.value ? "true" : attrs["aria-invalid"],
|
|
211
|
+
"aria-describedby": describedBy,
|
|
212
|
+
"aria-label": field?.labelId ? void 0 : __props.label ?? attrs["aria-label"],
|
|
213
|
+
"aria-expanded": open.value,
|
|
214
|
+
"aria-haspopup": "listbox",
|
|
215
|
+
"aria-autocomplete": "list",
|
|
216
|
+
"aria-controls": open.value ? panelId : void 0,
|
|
217
|
+
"aria-activedescendant": open.value && listbox.activeIndex >= 0 ? optionId(listbox.activeIndex) : void 0
|
|
218
|
+
};
|
|
219
|
+
}
|
|
203
220
|
return (_ctx, _cache) => {
|
|
204
221
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
205
222
|
createElementVNode("div", _hoisted_1, [
|
|
206
|
-
createElementVNode("input", {
|
|
223
|
+
createElementVNode("input", mergeProps({
|
|
207
224
|
ref_key: "inputEl",
|
|
208
225
|
ref: inputEl,
|
|
209
|
-
type: "text",
|
|
210
|
-
role: "combobox",
|
|
211
226
|
id: effectiveId.value,
|
|
212
227
|
placeholder: __props.placeholder,
|
|
213
228
|
value: query.value,
|
|
214
229
|
disabled: effectiveDisabled.value,
|
|
215
230
|
required: effectiveRequired.value,
|
|
216
|
-
|
|
217
|
-
"aria-describedby": unref(field)?.describedBy,
|
|
218
|
-
"aria-label": unref(field)?.labelId ? void 0 : __props.label,
|
|
219
|
-
"aria-expanded": open.value,
|
|
220
|
-
"aria-haspopup": "listbox",
|
|
221
|
-
"aria-autocomplete": "list",
|
|
222
|
-
"aria-controls": open.value ? panelId : void 0,
|
|
223
|
-
"aria-activedescendant": open.value && unref(listbox).activeIndex >= 0 ? optionId(unref(listbox).activeIndex) : void 0,
|
|
224
|
-
class: normalizeClass(classes.value),
|
|
231
|
+
class: classes.value,
|
|
225
232
|
onInput: handleInput,
|
|
226
233
|
onFocus: handleFocus,
|
|
227
234
|
onBlur: handleBlur,
|
|
228
235
|
onKeydown: handleKeydown
|
|
229
|
-
}, null,
|
|
236
|
+
}, inputAttrs()), null, 16, _hoisted_2),
|
|
230
237
|
__props.name ? (openBlock(), createElementBlock("input", {
|
|
231
238
|
key: 0,
|
|
232
239
|
type: "hidden",
|
|
233
240
|
name: __props.name,
|
|
241
|
+
form: unref(attrs).form,
|
|
234
242
|
"^value": value.value,
|
|
235
243
|
disabled: effectiveDisabled.value
|
|
236
244
|
}, null, 8, _hoisted_3)) : createCommentVNode("", true),
|
|
@@ -22,6 +22,11 @@ export interface CommandMenuProps {
|
|
|
22
22
|
label?: string;
|
|
23
23
|
/** Matches an item against the current query. Default: case- and diacritic-insensitive substring match on `label` plus `keywords`. */
|
|
24
24
|
filter?: (item: CommandItem, query: string) => boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The panel's `id`. A trigger the caller renders outside the component
|
|
27
|
+
* points its `aria-controls` at it while the panel is open.
|
|
28
|
+
*/
|
|
29
|
+
id?: string;
|
|
25
30
|
/** Additional CSS classes for the panel. */
|
|
26
31
|
class?: HTMLAttributes["class"];
|
|
27
32
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./CommandMenu.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const CommandMenu = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const CommandMenu = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-eaa4bb74"]]);
|
|
5
5
|
export {
|
|
6
6
|
CommandMenu as default
|
|
7
7
|
};
|
|
@@ -12,7 +12,7 @@ import { useListbox } from "../../internals/listbox.js";
|
|
|
12
12
|
import { useFancyId } from "../../internals/use-id.js";
|
|
13
13
|
import { useSoundCue } from "../../sound/use-sound.js";
|
|
14
14
|
import { getMatchRange, defaultFilter } from "./match.js";
|
|
15
|
-
const _hoisted_1 = ["aria-label", "data-state"];
|
|
15
|
+
const _hoisted_1 = ["id", "aria-label", "data-state"];
|
|
16
16
|
const _hoisted_2 = { class: "border-border flex h-[42px] shrink-0 items-center gap-[10px] border-b px-[14px]" };
|
|
17
17
|
const _hoisted_3 = ["aria-label", "aria-activedescendant", "placeholder", "value"];
|
|
18
18
|
const _hoisted_4 = ["aria-label"];
|
|
@@ -57,6 +57,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
57
57
|
emptyMessage: { default: "No results" },
|
|
58
58
|
label: { default: "Command menu" },
|
|
59
59
|
filter: { type: Function },
|
|
60
|
+
id: {},
|
|
60
61
|
class: { type: [Boolean, null, String, Object, Array] },
|
|
61
62
|
sound: { type: Boolean, default: false }
|
|
62
63
|
}, {
|
|
@@ -151,7 +152,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
151
152
|
useScrollLock(() => presence.mounted);
|
|
152
153
|
useDismissable(panel, () => ({
|
|
153
154
|
onDismiss: () => setOpen(false),
|
|
154
|
-
active: () => open.value
|
|
155
|
+
active: () => open.value,
|
|
156
|
+
keepFocus: true
|
|
155
157
|
}));
|
|
156
158
|
const panelRef = composeRefs(
|
|
157
159
|
panel,
|
|
@@ -277,6 +279,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
277
279
|
createElementVNode("div", {
|
|
278
280
|
ref: unref(panelRef),
|
|
279
281
|
role: "dialog",
|
|
282
|
+
id: __props.id,
|
|
280
283
|
"aria-modal": "true",
|
|
281
284
|
"aria-label": __props.label,
|
|
282
285
|
tabindex: "-1",
|
|
@@ -38,11 +38,21 @@ export interface CompareProps {
|
|
|
38
38
|
beamColors?: string[];
|
|
39
39
|
/** Accessible name of the slider */
|
|
40
40
|
label?: string;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
onPercentageChange?: ((percentage: number) => void) | ((percentage: number) => void)[];
|
|
42
|
+
/** @deprecated Use `@percentage-change` / `onPercentageChange`. Only called when `onPercentageChange` is absent. */
|
|
43
|
+
onpercentagechange?: ((percentage: number) => void) | ((percentage: number) => void)[];
|
|
44
|
+
onDragStart?: (() => void) | (() => void)[];
|
|
45
|
+
/** @deprecated Use `@drag-start` / `onDragStart`. Only called when `onDragStart` is absent. */
|
|
46
|
+
ondragstart?: (() => void) | (() => void)[];
|
|
47
|
+
onDragEnd?: (() => void) | (() => void)[];
|
|
48
|
+
/** @deprecated Use `@drag-end` / `onDragEnd`. Only called when `onDragEnd` is absent. */
|
|
49
|
+
ondragend?: (() => void) | (() => void)[];
|
|
50
|
+
onHoverEnter?: (() => void) | (() => void)[];
|
|
51
|
+
/** @deprecated Use `@hover-enter` / `onHoverEnter`. Only called when `onHoverEnter` is absent. */
|
|
52
|
+
onhoverenter?: (() => void) | (() => void)[];
|
|
53
|
+
onHoverLeave?: (() => void) | (() => void)[];
|
|
54
|
+
/** @deprecated Use `@hover-leave` / `onHoverLeave`. Only called when `onHoverLeave` is absent. */
|
|
55
|
+
onhoverleave?: (() => void) | (() => void)[];
|
|
46
56
|
}
|
|
47
57
|
declare const _default: typeof __VLS_export;
|
|
48
58
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import _sfc_main from "./Compare.vue2.js";
|
|
|
2
2
|
import { COMPARE_BEAM_COLORS, beamPalette, beamStep, keyStep } from "./Compare.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const Compare = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
5
|
+
const Compare = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f58e8a01"]]);
|
|
6
6
|
export {
|
|
7
7
|
COMPARE_BEAM_COLORS,
|
|
8
8
|
beamPalette,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineComponent, useTemplateRef, ref, computed, watch, onMounted, onBeforeUnmount, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createElementVNode, createStaticVNode, renderSlot, createCommentVNode } from "vue";
|
|
2
|
+
import { callListener } from "../../internals/call-listener.js";
|
|
2
3
|
import { cn } from "../../utils.js";
|
|
3
4
|
import { createReducedMotion } from "../../internals/motion/media-query.js";
|
|
4
5
|
const _hoisted_1 = ["data-active", "aria-label", "aria-valuenow", "aria-valuetext"];
|
|
@@ -62,11 +63,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
62
63
|
autoplayDuration: { default: 5e3 },
|
|
63
64
|
beamColors: {},
|
|
64
65
|
label: { default: "Comparison slider" },
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
onPercentageChange: { type: [Function, Array] },
|
|
67
|
+
onpercentagechange: { type: [Function, Array] },
|
|
68
|
+
onDragStart: { type: [Function, Array] },
|
|
69
|
+
ondragstart: { type: [Function, Array] },
|
|
70
|
+
onDragEnd: { type: [Function, Array] },
|
|
71
|
+
ondragend: { type: [Function, Array] },
|
|
72
|
+
onHoverEnter: { type: [Function, Array] },
|
|
73
|
+
onhoverenter: { type: [Function, Array] },
|
|
74
|
+
onHoverLeave: { type: [Function, Array] },
|
|
75
|
+
onhoverleave: { type: [Function, Array] }
|
|
70
76
|
},
|
|
71
77
|
setup(__props) {
|
|
72
78
|
const reducedMotion = createReducedMotion();
|
|
@@ -85,7 +91,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
85
91
|
function setPercent(p) {
|
|
86
92
|
const next = Math.max(0, Math.min(100, p));
|
|
87
93
|
sliderXPercent.value = next;
|
|
88
|
-
__props.onpercentagechange
|
|
94
|
+
callListener(__props.onPercentageChange ?? __props.onpercentagechange, next);
|
|
89
95
|
}
|
|
90
96
|
function startAutoplay() {
|
|
91
97
|
stopAutoplay();
|
|
@@ -137,7 +143,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
137
143
|
function mouseEnterHandler() {
|
|
138
144
|
isMouseOver.value = true;
|
|
139
145
|
stopReturn();
|
|
140
|
-
__props.onhoverenter
|
|
146
|
+
callListener(__props.onHoverEnter ?? __props.onhoverenter);
|
|
141
147
|
if (__props.autoplay) {
|
|
142
148
|
stopAutoplay();
|
|
143
149
|
}
|
|
@@ -145,7 +151,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
145
151
|
function mouseLeaveHandler() {
|
|
146
152
|
isMouseOver.value = false;
|
|
147
153
|
isInteracting.value = false;
|
|
148
|
-
__props.onhoverleave
|
|
154
|
+
callListener(__props.onHoverLeave ?? __props.onhoverleave);
|
|
149
155
|
if (__props.slideMode === "hover") {
|
|
150
156
|
glideTo(__props.initialSliderPercentage);
|
|
151
157
|
}
|
|
@@ -161,7 +167,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
161
167
|
if (__props.slideMode === "drag") {
|
|
162
168
|
isDragging.value = true;
|
|
163
169
|
isInteracting.value = true;
|
|
164
|
-
__props.ondragstart
|
|
170
|
+
callListener(__props.onDragStart ?? __props.ondragstart);
|
|
165
171
|
stopAutoplay();
|
|
166
172
|
}
|
|
167
173
|
}
|
|
@@ -169,7 +175,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
169
175
|
if (__props.slideMode === "drag") {
|
|
170
176
|
isDragging.value = false;
|
|
171
177
|
isInteracting.value = false;
|
|
172
|
-
__props.ondragend
|
|
178
|
+
callListener(__props.onDragEnd ?? __props.ondragend);
|
|
173
179
|
if (__props.autoplay && !isMouseOver.value) {
|
|
174
180
|
startAutoplay();
|
|
175
181
|
}
|
|
@@ -239,7 +245,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
239
245
|
}
|
|
240
246
|
}
|
|
241
247
|
watch(
|
|
242
|
-
[
|
|
248
|
+
[
|
|
249
|
+
() => __props.autoplay,
|
|
250
|
+
isMouseOver,
|
|
251
|
+
isDragging,
|
|
252
|
+
() => __props.autoplayDuration,
|
|
253
|
+
() => __props.onPercentageChange,
|
|
254
|
+
() => __props.onpercentagechange
|
|
255
|
+
],
|
|
243
256
|
syncAutoplay,
|
|
244
257
|
{ flush: "post" }
|
|
245
258
|
);
|
|
@@ -260,7 +273,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
260
273
|
return openBlock(), createElementBlock("div", {
|
|
261
274
|
ref_key: "sliderRef",
|
|
262
275
|
ref: sliderRef,
|
|
263
|
-
class: normalizeClass(
|
|
276
|
+
class: normalizeClass(
|
|
277
|
+
unref(cn)("compare h-[400px] w-[400px] touch-pan-y touch-pinch-zoom overflow-hidden", __props.class)
|
|
278
|
+
),
|
|
264
279
|
style: normalizeStyle({
|
|
265
280
|
position: "relative",
|
|
266
281
|
cursor: __props.slideMode === "drag" ? isDragging.value ? "grabbing" : "grab" : "col-resize",
|
|
@@ -294,7 +309,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
294
309
|
style: normalizeStyle({ left: `${sliderXPercent.value}%` }),
|
|
295
310
|
"aria-hidden": "true"
|
|
296
311
|
}, [..._cache[0] || (_cache[0] = [
|
|
297
|
-
createStaticVNode('<span class="compare-beam__glow" data-v-
|
|
312
|
+
createStaticVNode('<span class="compare-beam__glow" data-v-f58e8a01></span><span class="compare-beam__trail" data-v-f58e8a01></span><span class="compare-beam__fringe" data-v-f58e8a01></span><span class="compare-beam__core" data-v-f58e8a01></span><span class="compare-beam__pulse" data-v-f58e8a01></span><span class="compare-beam__pulse compare-beam__pulse--late" data-v-f58e8a01></span>', 6)
|
|
298
313
|
])], 4),
|
|
299
314
|
createElementVNode("div", {
|
|
300
315
|
class: "compare-seam pointer-events-none absolute top-0 z-[41] h-full w-px",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./ComposerInput.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const ComposerInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const ComposerInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5b6b4daf"]]);
|
|
5
5
|
export {
|
|
6
6
|
ComposerInput as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, inject, computed, onMounted, onBeforeUnmount, watch, createElementBlock, openBlock,
|
|
1
|
+
import { defineComponent, useAttrs, useTemplateRef, inject, computed, onMounted, onBeforeUnmount, watch, createElementBlock, openBlock, mergeProps, unref } from "vue";
|
|
2
2
|
import { cn } from "../../utils.js";
|
|
3
3
|
import { COMPOSER_CONTEXT_KEY } from "./types.js";
|
|
4
4
|
const _hoisted_1 = ["rows", "placeholder", "value", "readonly", "aria-disabled"];
|
|
@@ -13,6 +13,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
13
13
|
class: { type: [Boolean, null, String, Object, Array] }
|
|
14
14
|
},
|
|
15
15
|
setup(__props, { expose: __expose }) {
|
|
16
|
+
const attrs = useAttrs();
|
|
16
17
|
const el = useTemplateRef("el");
|
|
17
18
|
__expose({ ref: el });
|
|
18
19
|
const FALLBACK_LINE_HEIGHT = 20;
|
|
@@ -75,23 +76,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
75
76
|
});
|
|
76
77
|
watch([value, minLines, maxLines], () => grow(), { flush: "post" });
|
|
77
78
|
return (_ctx, _cache) => {
|
|
78
|
-
return openBlock(), createElementBlock("textarea", {
|
|
79
|
+
return openBlock(), createElementBlock("textarea", mergeProps({
|
|
79
80
|
ref_key: "el",
|
|
80
81
|
ref: el,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
onInput: handleInput,
|
|
83
|
+
onKeydown: handleKeydown
|
|
84
|
+
}, unref(attrs), {
|
|
85
|
+
class: unref(cn)(
|
|
86
|
+
"ft-composer-input placeholder:text-muted-foreground w-full resize-none bg-transparent px-2 py-1.5 text-sm leading-relaxed outline-none",
|
|
87
|
+
__props.class
|
|
86
88
|
),
|
|
87
89
|
rows: minLines.value,
|
|
88
90
|
placeholder: __props.placeholder,
|
|
89
91
|
value: value.value,
|
|
90
92
|
readonly: locked.value,
|
|
91
|
-
"aria-disabled": locked.value ? "true" : void 0
|
|
92
|
-
|
|
93
|
-
onKeydown: handleKeydown
|
|
94
|
-
}, null, 42, _hoisted_1);
|
|
93
|
+
"aria-disabled": locked.value ? "true" : void 0
|
|
94
|
+
}), null, 16, _hoisted_1);
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
});
|
|
@@ -14,6 +14,10 @@ export interface ComposerModelPickerProps {
|
|
|
14
14
|
label?: string;
|
|
15
15
|
/** Additional CSS classes */
|
|
16
16
|
class?: HTMLAttributes["class"];
|
|
17
|
+
/** Called after the component's own handling, never while disabled. */
|
|
18
|
+
onClick?: ((event: MouseEvent) => void) | ((event: MouseEvent) => void)[];
|
|
19
|
+
/** Called after the component's own handling, never while disabled. */
|
|
20
|
+
onKeydown?: ((event: KeyboardEvent) => void) | ((event: KeyboardEvent) => void)[];
|
|
17
21
|
}
|
|
18
22
|
declare const _default: typeof __VLS_export;
|
|
19
23
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./ComposerModelPicker.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const ComposerModelPicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const ComposerModelPicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-baddb42f"]]);
|
|
5
5
|
export {
|
|
6
6
|
ComposerModelPicker as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineComponent, mergeModels, useModel, inject, ref, useTemplateRef, computed, watch, createElementBlock, openBlock, Fragment, createElementVNode, createCommentVNode,
|
|
1
|
+
import { defineComponent, mergeModels, useAttrs, useModel, inject, ref, useTemplateRef, computed, watch, createElementBlock, openBlock, Fragment, createElementVNode, createCommentVNode, mergeProps, unref, toDisplayString, renderList } from "vue";
|
|
2
|
+
import { callListener } from "../../internals/call-listener.js";
|
|
2
3
|
import { cn } from "../../utils.js";
|
|
3
4
|
import { useFancyId } from "../../internals/use-id.js";
|
|
4
5
|
import { useFloat } from "../../internals/use-float.js";
|
|
@@ -41,13 +42,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
42
|
value: {},
|
|
42
43
|
onChange: { type: Function },
|
|
43
44
|
label: { default: "Model" },
|
|
44
|
-
class: { type: [Boolean, null, String, Object, Array] }
|
|
45
|
+
class: { type: [Boolean, null, String, Object, Array] },
|
|
46
|
+
onClick: { type: [Function, Array] },
|
|
47
|
+
onKeydown: { type: [Function, Array] }
|
|
45
48
|
}, {
|
|
46
49
|
"value": {},
|
|
47
50
|
"valueModifiers": {}
|
|
48
51
|
}),
|
|
49
52
|
emits: ["update:value"],
|
|
50
53
|
setup(__props) {
|
|
54
|
+
const attrs = useAttrs();
|
|
51
55
|
const value = useModel(__props, "value");
|
|
52
56
|
const composer = inject(COMPOSER_CONTEXT_KEY, void 0);
|
|
53
57
|
const playCue = useSoundCue(() => composer?.sound);
|
|
@@ -95,7 +99,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
95
99
|
closeMenu(true, changed ? "commit" : "dismiss");
|
|
96
100
|
if (changed) __props.onChange?.(model.id);
|
|
97
101
|
}
|
|
102
|
+
function handleTriggerClick(event) {
|
|
103
|
+
if (isDisabled.value) return;
|
|
104
|
+
if (open.value) closeMenu(true);
|
|
105
|
+
else openMenu();
|
|
106
|
+
callListener(__props.onClick, event);
|
|
107
|
+
}
|
|
98
108
|
function handleTriggerKeydown(event) {
|
|
109
|
+
if (isDisabled.value) return;
|
|
110
|
+
handleTriggerKey(event);
|
|
111
|
+
callListener(__props.onKeydown, event);
|
|
112
|
+
}
|
|
113
|
+
function handleTriggerKey(event) {
|
|
99
114
|
if (event.key !== "ArrowDown" && event.key !== "ArrowUp") return;
|
|
100
115
|
event.preventDefault();
|
|
101
116
|
openMenu();
|
|
@@ -155,28 +170,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
155
170
|
);
|
|
156
171
|
return (_ctx, _cache) => {
|
|
157
172
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
158
|
-
createElementVNode("button", {
|
|
173
|
+
createElementVNode("button", mergeProps({
|
|
159
174
|
ref_key: "triggerEl",
|
|
160
175
|
ref: triggerEl,
|
|
176
|
+
onClick: handleTriggerClick,
|
|
177
|
+
onKeydown: handleTriggerKeydown
|
|
178
|
+
}, unref(attrs), {
|
|
161
179
|
type: "button",
|
|
162
|
-
class:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
__props.class
|
|
166
|
-
)
|
|
180
|
+
class: unref(cn)(
|
|
181
|
+
"ft-composer-model text-foreground/70 hover:bg-muted hover:text-foreground inline-flex max-w-full cursor-pointer items-center gap-1.5 rounded-md px-2 py-1 font-mono text-xs transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-40",
|
|
182
|
+
__props.class
|
|
167
183
|
),
|
|
168
184
|
disabled: isDisabled.value,
|
|
169
185
|
"data-open": open.value ? "" : void 0,
|
|
170
186
|
"aria-haspopup": "listbox",
|
|
171
187
|
"aria-expanded": open.value,
|
|
172
188
|
"aria-controls": open.value ? menuId : void 0,
|
|
173
|
-
"aria-label": selected.value ? `${__props.label}: ${selected.value.label}` : __props.label
|
|
174
|
-
|
|
175
|
-
onKeydown: handleTriggerKeydown
|
|
176
|
-
}, [
|
|
189
|
+
"aria-label": selected.value ? `${__props.label}: ${selected.value.label}` : __props.label
|
|
190
|
+
}), [
|
|
177
191
|
createElementVNode("span", _hoisted_2, toDisplayString(selected.value?.label ?? __props.label), 1),
|
|
178
192
|
selected.value?.badge ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(selected.value.badge), 1)) : createCommentVNode("", true),
|
|
179
|
-
_cache[
|
|
193
|
+
_cache[0] || (_cache[0] = createElementVNode("svg", {
|
|
180
194
|
class: "ft-composer-model-chevron size-3 shrink-0",
|
|
181
195
|
viewBox: "0 0 16 16",
|
|
182
196
|
fill: "none",
|
|
@@ -188,7 +202,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
188
202
|
}, [
|
|
189
203
|
createElementVNode("path", { d: "m4 6 4 4 4-4" })
|
|
190
204
|
], -1))
|
|
191
|
-
],
|
|
205
|
+
], 16, _hoisted_1),
|
|
192
206
|
open.value ? (openBlock(), createElementBlock("div", {
|
|
193
207
|
key: 0,
|
|
194
208
|
ref_key: "menuEl",
|
|
@@ -217,7 +231,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
217
231
|
createElementVNode("span", _hoisted_6, [
|
|
218
232
|
createElementVNode("span", _hoisted_7, toDisplayString(model.label), 1),
|
|
219
233
|
model.badge ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(model.badge), 1)) : createCommentVNode("", true),
|
|
220
|
-
model.id === selectedId.value ? (openBlock(), createElementBlock("svg", _hoisted_9, [..._cache[
|
|
234
|
+
model.id === selectedId.value ? (openBlock(), createElementBlock("svg", _hoisted_9, [..._cache[1] || (_cache[1] = [
|
|
221
235
|
createElementVNode("path", { d: "m3 8.5 3.5 3.5L13 5" }, null, -1)
|
|
222
236
|
])])) : createCommentVNode("", true)
|
|
223
237
|
]),
|
|
@@ -9,6 +9,8 @@ export interface ComposerSubmitProps {
|
|
|
9
9
|
stopLabel?: string;
|
|
10
10
|
/** Additional CSS classes */
|
|
11
11
|
class?: HTMLAttributes["class"];
|
|
12
|
+
/** Called after the component's own handling, never while disabled. */
|
|
13
|
+
onClick?: ((event: MouseEvent) => void) | ((event: MouseEvent) => void)[];
|
|
12
14
|
}
|
|
13
15
|
declare const _default: typeof __VLS_export;
|
|
14
16
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineComponent, inject, computed, createElementBlock, openBlock,
|
|
1
|
+
import { defineComponent, useAttrs, inject, computed, createElementBlock, openBlock, mergeProps, unref, renderSlot, createElementVNode } from "vue";
|
|
2
|
+
import { callListener } from "../../internals/call-listener.js";
|
|
2
3
|
import { cn } from "../../utils.js";
|
|
3
4
|
import { COMPOSER_CONTEXT_KEY } from "./types.js";
|
|
4
5
|
const _hoisted_1 = ["type", "disabled", "aria-label", "title"];
|
|
@@ -25,9 +26,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
25
26
|
props: {
|
|
26
27
|
label: { default: "Send" },
|
|
27
28
|
stopLabel: { default: "Stop" },
|
|
28
|
-
class: { type: [Boolean, null, String, Object, Array] }
|
|
29
|
+
class: { type: [Boolean, null, String, Object, Array] },
|
|
30
|
+
onClick: { type: [Function, Array] }
|
|
29
31
|
},
|
|
30
32
|
setup(__props) {
|
|
33
|
+
const attrs = useAttrs();
|
|
31
34
|
const composer = inject(COMPOSER_CONTEXT_KEY, void 0);
|
|
32
35
|
const streaming = computed(() => composer?.streaming ?? false);
|
|
33
36
|
const empty = computed(
|
|
@@ -38,24 +41,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
38
41
|
() => (composer?.disabled ?? false) || (streaming.value ? !stoppable.value : empty.value)
|
|
39
42
|
);
|
|
40
43
|
const name = computed(() => streaming.value ? __props.stopLabel : __props.label);
|
|
41
|
-
function handleClick() {
|
|
42
|
-
if (
|
|
43
|
-
composer?.stop();
|
|
44
|
+
function handleClick(event) {
|
|
45
|
+
if (isDisabled.value) return;
|
|
46
|
+
if (streaming.value) composer?.stop();
|
|
47
|
+
callListener(__props.onClick, event);
|
|
44
48
|
}
|
|
45
49
|
return (_ctx, _cache) => {
|
|
46
|
-
return openBlock(), createElementBlock("button", {
|
|
50
|
+
return openBlock(), createElementBlock("button", mergeProps({ onClick: handleClick }, unref(attrs), {
|
|
47
51
|
type: streaming.value ? "button" : "submit",
|
|
48
|
-
class:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
__props.class
|
|
52
|
-
)
|
|
52
|
+
class: unref(cn)(
|
|
53
|
+
"ft-composer-submit bg-foreground text-background hover:bg-foreground/90 focus-visible:ring-ring inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-lg transition-colors focus-visible:ring-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-40",
|
|
54
|
+
__props.class
|
|
53
55
|
),
|
|
54
56
|
disabled: isDisabled.value,
|
|
55
57
|
"aria-label": name.value,
|
|
56
|
-
title: name.value
|
|
57
|
-
|
|
58
|
-
}, [
|
|
58
|
+
title: name.value
|
|
59
|
+
}), [
|
|
59
60
|
_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 0) : streaming.value ? (openBlock(), createElementBlock("svg", _hoisted_2, [..._cache[0] || (_cache[0] = [
|
|
60
61
|
createElementVNode("rect", {
|
|
61
62
|
x: "3",
|
|
@@ -69,7 +70,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
69
70
|
createElementVNode("path", { d: "M14 2 2 6.8l4.6 2.6L9.2 14z" }, null, -1),
|
|
70
71
|
createElementVNode("path", { d: "M14 2 6.6 9.4" }, null, -1)
|
|
71
72
|
])]))
|
|
72
|
-
],
|
|
73
|
+
], 16, _hoisted_1);
|
|
73
74
|
};
|
|
74
75
|
}
|
|
75
76
|
});
|