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
|
@@ -18,6 +18,11 @@ export interface DrawerProps {
|
|
|
18
18
|
dismissible?: boolean;
|
|
19
19
|
/** Whether dragging the handle down past the threshold closes the drawer. */
|
|
20
20
|
swipeToClose?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The panel's `id`. A trigger the caller renders outside the component
|
|
23
|
+
* points its `aria-controls` at it while the panel is open.
|
|
24
|
+
*/
|
|
25
|
+
id?: string;
|
|
21
26
|
/** Additional CSS classes merged onto the panel. */
|
|
22
27
|
class?: HTMLAttributes["class"];
|
|
23
28
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./Drawer.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bef5f5e0"]]);
|
|
5
5
|
export {
|
|
6
6
|
Drawer as default
|
|
7
7
|
};
|
|
@@ -10,7 +10,7 @@ import { anchored, prefersReducedMotion } from "../../internals/motion/anchored.
|
|
|
10
10
|
import { usePresence } from "../../internals/motion/presence.js";
|
|
11
11
|
import { DURATIONS, JS_EASINGS } from "../../internals/motion/tokens.js";
|
|
12
12
|
import { useSoundCue } from "../../sound/use-sound.js";
|
|
13
|
-
const _hoisted_1 = ["aria-labelledby", "aria-label", "aria-describedby", "data-state"];
|
|
13
|
+
const _hoisted_1 = ["id", "aria-labelledby", "aria-label", "aria-describedby", "data-state"];
|
|
14
14
|
const _hoisted_2 = ["id"];
|
|
15
15
|
const _hoisted_3 = ["id"];
|
|
16
16
|
const _hoisted_4 = { class: "ft-drawer-body flex flex-1 flex-col gap-3 overflow-y-auto" };
|
|
@@ -31,6 +31,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
31
31
|
description: {},
|
|
32
32
|
dismissible: { type: Boolean, default: true },
|
|
33
33
|
swipeToClose: { type: Boolean, default: true },
|
|
34
|
+
id: {},
|
|
34
35
|
class: { type: [Boolean, null, String, Object, Array] },
|
|
35
36
|
sound: { type: Boolean, default: false }
|
|
36
37
|
}, {
|
|
@@ -107,7 +108,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
107
108
|
onDismiss: close,
|
|
108
109
|
escape: props.dismissible,
|
|
109
110
|
outsideClick: props.dismissible,
|
|
110
|
-
active: () => open.value
|
|
111
|
+
active: () => open.value,
|
|
112
|
+
keepFocus: true
|
|
111
113
|
}));
|
|
112
114
|
const panelRef = composeRefs(
|
|
113
115
|
panel,
|
|
@@ -185,6 +187,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
185
187
|
ref: unref(panelRef),
|
|
186
188
|
class: normalizeClass(panelClasses.value),
|
|
187
189
|
role: "dialog",
|
|
190
|
+
id: props.id,
|
|
188
191
|
"aria-modal": "true",
|
|
189
192
|
"aria-labelledby": titleId.value,
|
|
190
193
|
"aria-label": titleId.value ? void 0 : props.ariaLabel,
|
|
@@ -37,7 +37,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
37
37
|
useDismissable(panel, () => ({
|
|
38
38
|
onDismiss: () => root.close(),
|
|
39
39
|
exclude: () => [root.triggerRef],
|
|
40
|
-
active: () => root.open
|
|
40
|
+
active: () => root.open,
|
|
41
|
+
keepFocus: true
|
|
41
42
|
}));
|
|
42
43
|
const menuContext = {
|
|
43
44
|
get focus() {
|
|
@@ -12,6 +12,10 @@ export interface DropdownMenuItemProps {
|
|
|
12
12
|
closeOnSelect?: boolean;
|
|
13
13
|
/** Additional CSS classes. */
|
|
14
14
|
class?: HTMLAttributes["class"];
|
|
15
|
+
/** Called after the component's own handling, never while disabled. */
|
|
16
|
+
onClick?: ((event: MouseEvent) => void) | ((event: MouseEvent) => void)[];
|
|
17
|
+
/** Called after the component's own handling, never while disabled. */
|
|
18
|
+
onMouseenter?: ((event: MouseEvent) => void) | ((event: MouseEvent) => void)[];
|
|
15
19
|
}
|
|
16
20
|
declare const _default: typeof __VLS_export;
|
|
17
21
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, computed, createElementBlock, openBlock,
|
|
1
|
+
import { defineComponent, useAttrs, useTemplateRef, computed, createElementBlock, openBlock, mergeProps, unref, createElementVNode, createCommentVNode, renderSlot, toDisplayString } from "vue";
|
|
2
|
+
import { callListener } from "../../internals/call-listener.js";
|
|
2
3
|
import { cn } from "../../utils.js";
|
|
3
4
|
import { useMenuItem } from "../../internals/menu.js";
|
|
4
5
|
import { sound } from "../../sound/sound.js";
|
|
@@ -24,22 +25,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
24
25
|
variant: { default: "default" },
|
|
25
26
|
shortcut: {},
|
|
26
27
|
closeOnSelect: { type: Boolean, default: true },
|
|
27
|
-
class: { type: [Boolean, null, String, Object, Array] }
|
|
28
|
+
class: { type: [Boolean, null, String, Object, Array] },
|
|
29
|
+
onClick: { type: [Function, Array] },
|
|
30
|
+
onMouseenter: { type: [Function, Array] }
|
|
28
31
|
},
|
|
29
32
|
setup(__props) {
|
|
33
|
+
const attrs = useAttrs();
|
|
30
34
|
const ctx = MENU_KEY.useRequired();
|
|
31
35
|
const item = useTemplateRef("item");
|
|
32
36
|
useMenuItem(ctx.focus, item);
|
|
33
|
-
function handleClick() {
|
|
37
|
+
function handleClick(event) {
|
|
34
38
|
if (__props.disabled) return;
|
|
35
39
|
if (ctx.sound) sound.play("select");
|
|
36
40
|
if (item.value) ctx.focus.focusItem(item.value);
|
|
37
41
|
__props.onSelect?.();
|
|
38
42
|
if (__props.closeOnSelect) ctx.closeAll({ silent: true });
|
|
43
|
+
callListener(__props.onClick, event);
|
|
39
44
|
}
|
|
40
|
-
function handleMouseEnter() {
|
|
45
|
+
function handleMouseEnter(event) {
|
|
41
46
|
if (__props.disabled || !item.value) return;
|
|
42
47
|
ctx.focus.focusItem(item.value);
|
|
48
|
+
callListener(__props.onMouseenter, event);
|
|
43
49
|
}
|
|
44
50
|
const classes = computed(
|
|
45
51
|
() => cn(
|
|
@@ -51,19 +57,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
51
57
|
)
|
|
52
58
|
);
|
|
53
59
|
return (_ctx, _cache) => {
|
|
54
|
-
return openBlock(), createElementBlock("button", {
|
|
60
|
+
return openBlock(), createElementBlock("button", mergeProps({
|
|
55
61
|
ref_key: "item",
|
|
56
62
|
ref: item,
|
|
63
|
+
onClick: handleClick,
|
|
64
|
+
onMouseenter: handleMouseEnter
|
|
65
|
+
}, unref(attrs), {
|
|
57
66
|
type: "button",
|
|
58
67
|
role: "menuitem",
|
|
59
68
|
tabindex: "-1",
|
|
60
69
|
disabled: __props.disabled,
|
|
61
70
|
"aria-disabled": __props.disabled ? "true" : void 0,
|
|
62
71
|
"data-variant": __props.variant,
|
|
63
|
-
class:
|
|
64
|
-
|
|
65
|
-
onMouseenter: handleMouseEnter
|
|
66
|
-
}, [
|
|
72
|
+
class: classes.value
|
|
73
|
+
}), [
|
|
67
74
|
createElementVNode("span", _hoisted_2, [
|
|
68
75
|
_ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_3, [
|
|
69
76
|
renderSlot(_ctx.$slots, "icon")
|
|
@@ -73,7 +80,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
73
80
|
])
|
|
74
81
|
]),
|
|
75
82
|
__props.shortcut ? (openBlock(), createElementBlock("kbd", _hoisted_4, toDisplayString(__props.shortcut), 1)) : createCommentVNode("", true)
|
|
76
|
-
],
|
|
83
|
+
], 16, _hoisted_1);
|
|
77
84
|
};
|
|
78
85
|
}
|
|
79
86
|
});
|
|
@@ -4,6 +4,14 @@ export interface DropdownMenuSubTriggerProps {
|
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
/** Additional CSS classes. */
|
|
6
6
|
class?: HTMLAttributes["class"];
|
|
7
|
+
/** Called after the component's own handling, never while disabled. */
|
|
8
|
+
onClick?: ((event: MouseEvent) => void) | ((event: MouseEvent) => void)[];
|
|
9
|
+
/** Called after the component's own handling, never while disabled. */
|
|
10
|
+
onMouseenter?: ((event: MouseEvent) => void) | ((event: MouseEvent) => void)[];
|
|
11
|
+
/** Called after the component's own handling, never while disabled. */
|
|
12
|
+
onMouseleave?: ((event: MouseEvent) => void) | ((event: MouseEvent) => void)[];
|
|
13
|
+
/** Called after the component's own handling, never while disabled. */
|
|
14
|
+
onKeydown?: ((event: KeyboardEvent) => void) | ((event: KeyboardEvent) => void)[];
|
|
7
15
|
}
|
|
8
16
|
declare const _default: typeof __VLS_export;
|
|
9
17
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, watch, onBeforeUnmount, computed, createElementBlock, openBlock,
|
|
1
|
+
import { defineComponent, useAttrs, useTemplateRef, watch, onBeforeUnmount, computed, createElementBlock, openBlock, mergeProps, unref, createElementVNode, createCommentVNode, renderSlot, toDisplayString } from "vue";
|
|
2
|
+
import { callListener } from "../../internals/call-listener.js";
|
|
2
3
|
import { cn } from "../../utils.js";
|
|
3
4
|
import { MENU_KEY, SUB_KEY } from "./types.js";
|
|
4
5
|
const _hoisted_1 = ["id", "disabled", "aria-disabled", "aria-expanded", "aria-controls"];
|
|
@@ -17,9 +18,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
17
18
|
__name: "DropdownMenuSubTrigger",
|
|
18
19
|
props: {
|
|
19
20
|
disabled: { type: Boolean, default: false },
|
|
20
|
-
class: { type: [Boolean, null, String, Object, Array] }
|
|
21
|
+
class: { type: [Boolean, null, String, Object, Array] },
|
|
22
|
+
onClick: { type: [Function, Array] },
|
|
23
|
+
onMouseenter: { type: [Function, Array] },
|
|
24
|
+
onMouseleave: { type: [Function, Array] },
|
|
25
|
+
onKeydown: { type: [Function, Array] }
|
|
21
26
|
},
|
|
22
27
|
setup(__props) {
|
|
28
|
+
const attrs = useAttrs();
|
|
23
29
|
const parentMenu = MENU_KEY.useRequired();
|
|
24
30
|
const sub = SUB_KEY.useRequired();
|
|
25
31
|
const item = useTemplateRef("item");
|
|
@@ -45,12 +51,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
45
51
|
openIntentTimer = null;
|
|
46
52
|
}
|
|
47
53
|
}
|
|
48
|
-
function handleClick() {
|
|
54
|
+
function handleClick(event) {
|
|
49
55
|
if (__props.disabled) return;
|
|
50
56
|
if (item.value) parentMenu.focus.focusItem(item.value);
|
|
51
57
|
sub.openSub();
|
|
58
|
+
callListener(__props.onClick, event);
|
|
52
59
|
}
|
|
53
|
-
function handleMouseEnter() {
|
|
60
|
+
function handleMouseEnter(event) {
|
|
54
61
|
if (__props.disabled || !item.value) return;
|
|
55
62
|
sub.keepOpen();
|
|
56
63
|
parentMenu.focus.focusItem(item.value);
|
|
@@ -59,13 +66,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
59
66
|
openIntentTimer = null;
|
|
60
67
|
sub.openSub();
|
|
61
68
|
}, OPEN_INTENT_MS);
|
|
69
|
+
callListener(__props.onMouseenter, event);
|
|
62
70
|
}
|
|
63
|
-
function handleMouseLeave() {
|
|
71
|
+
function handleMouseLeave(event) {
|
|
64
72
|
clearOpenIntent();
|
|
65
73
|
sub.scheduleClose();
|
|
74
|
+
if (__props.disabled) return;
|
|
75
|
+
callListener(__props.onMouseleave, event);
|
|
66
76
|
}
|
|
67
77
|
function handleKeydown(event) {
|
|
68
78
|
if (__props.disabled) return;
|
|
79
|
+
handleNavigationKey(event);
|
|
80
|
+
callListener(__props.onKeydown, event);
|
|
81
|
+
}
|
|
82
|
+
function handleNavigationKey(event) {
|
|
69
83
|
if (event.key === "ArrowRight") {
|
|
70
84
|
event.preventDefault();
|
|
71
85
|
sub.openSub();
|
|
@@ -80,9 +94,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
80
94
|
)
|
|
81
95
|
);
|
|
82
96
|
return (_ctx, _cache) => {
|
|
83
|
-
return openBlock(), createElementBlock("button", {
|
|
97
|
+
return openBlock(), createElementBlock("button", mergeProps({
|
|
84
98
|
ref_key: "item",
|
|
85
99
|
ref: item,
|
|
100
|
+
onClick: handleClick,
|
|
101
|
+
onMouseenter: handleMouseEnter,
|
|
102
|
+
onMouseleave: handleMouseLeave,
|
|
103
|
+
onKeydown: handleKeydown
|
|
104
|
+
}, unref(attrs), {
|
|
86
105
|
id: unref(sub).triggerId,
|
|
87
106
|
type: "button",
|
|
88
107
|
role: "menuitem",
|
|
@@ -92,12 +111,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
92
111
|
"aria-haspopup": "menu",
|
|
93
112
|
"aria-expanded": unref(sub).open,
|
|
94
113
|
"aria-controls": unref(sub).open ? unref(sub).contentId : void 0,
|
|
95
|
-
class:
|
|
96
|
-
|
|
97
|
-
onMouseenter: handleMouseEnter,
|
|
98
|
-
onMouseleave: handleMouseLeave,
|
|
99
|
-
onKeydown: handleKeydown
|
|
100
|
-
}, [
|
|
114
|
+
class: classes.value
|
|
115
|
+
}), [
|
|
101
116
|
createElementVNode("span", _hoisted_2, [
|
|
102
117
|
_ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_3, [
|
|
103
118
|
renderSlot(_ctx.$slots, "icon")
|
|
@@ -107,7 +122,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
107
122
|
])
|
|
108
123
|
]),
|
|
109
124
|
createElementVNode("span", _hoisted_4, toDisplayString(unref(sub).resolvedSide === "left" ? "‹" : "›"), 1)
|
|
110
|
-
],
|
|
125
|
+
], 16, _hoisted_1);
|
|
111
126
|
};
|
|
112
127
|
}
|
|
113
128
|
});
|
|
@@ -4,6 +4,10 @@ export interface DropdownMenuTriggerProps {
|
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
/** Additional CSS classes, merged onto the trigger. */
|
|
6
6
|
class?: HTMLAttributes["class"];
|
|
7
|
+
/** Called after the component's own handling, never while disabled. */
|
|
8
|
+
onClick?: ((event: MouseEvent) => void) | ((event: MouseEvent) => void)[];
|
|
9
|
+
/** Called after the component's own handling, never while disabled. */
|
|
10
|
+
onKeydown?: ((event: KeyboardEvent) => void) | ((event: KeyboardEvent) => void)[];
|
|
7
11
|
}
|
|
8
12
|
declare const _default: typeof __VLS_export;
|
|
9
13
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./DropdownMenuTrigger.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const DropdownMenuTrigger = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const DropdownMenuTrigger = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c0b482be"]]);
|
|
5
5
|
export {
|
|
6
6
|
DropdownMenuTrigger as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, watch, computed, createElementBlock, openBlock,
|
|
1
|
+
import { defineComponent, useAttrs, useTemplateRef, watch, computed, createElementBlock, openBlock, mergeProps, unref, renderSlot } from "vue";
|
|
2
|
+
import { callListener } from "../../internals/call-listener.js";
|
|
2
3
|
import { cn } from "../../utils.js";
|
|
3
4
|
import { DROPDOWN_MENU_KEY } from "./types.js";
|
|
4
5
|
const _hoisted_1 = ["id", "disabled", "aria-expanded", "aria-controls"];
|
|
@@ -7,9 +8,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
7
8
|
__name: "DropdownMenuTrigger",
|
|
8
9
|
props: {
|
|
9
10
|
disabled: { type: Boolean, default: false },
|
|
10
|
-
class: { type: [Boolean, null, String, Object, Array] }
|
|
11
|
+
class: { type: [Boolean, null, String, Object, Array] },
|
|
12
|
+
onClick: { type: [Function, Array] },
|
|
13
|
+
onKeydown: { type: [Function, Array] }
|
|
11
14
|
},
|
|
12
15
|
setup(__props, { expose: __expose }) {
|
|
16
|
+
const attrs = useAttrs();
|
|
13
17
|
const ctx = DROPDOWN_MENU_KEY.useRequired();
|
|
14
18
|
const trigger = useTemplateRef("trigger");
|
|
15
19
|
__expose({ ref: trigger });
|
|
@@ -21,16 +25,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
21
25
|
},
|
|
22
26
|
{ flush: "post" }
|
|
23
27
|
);
|
|
24
|
-
function handleClick() {
|
|
28
|
+
function handleClick(event) {
|
|
25
29
|
if (__props.disabled) return;
|
|
26
30
|
if (ctx.open) {
|
|
27
31
|
ctx.close({ returnFocus: false });
|
|
28
32
|
} else {
|
|
29
33
|
ctx.openWithFocus("first");
|
|
30
34
|
}
|
|
35
|
+
callListener(__props.onClick, event);
|
|
31
36
|
}
|
|
32
37
|
function handleKeydown(event) {
|
|
33
38
|
if (__props.disabled) return;
|
|
39
|
+
handleNavigationKey(event);
|
|
40
|
+
callListener(__props.onKeydown, event);
|
|
41
|
+
}
|
|
42
|
+
function handleNavigationKey(event) {
|
|
34
43
|
switch (event.key) {
|
|
35
44
|
case "Enter":
|
|
36
45
|
case " ":
|
|
@@ -51,21 +60,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
51
60
|
)
|
|
52
61
|
);
|
|
53
62
|
return (_ctx, _cache) => {
|
|
54
|
-
return openBlock(), createElementBlock("button", {
|
|
63
|
+
return openBlock(), createElementBlock("button", mergeProps({
|
|
55
64
|
ref_key: "trigger",
|
|
56
65
|
ref: trigger,
|
|
66
|
+
onClick: handleClick,
|
|
67
|
+
onKeydown: handleKeydown
|
|
68
|
+
}, unref(attrs), {
|
|
57
69
|
id: unref(ctx).triggerId,
|
|
58
70
|
type: "button",
|
|
59
71
|
disabled: __props.disabled,
|
|
60
|
-
class:
|
|
72
|
+
class: classes.value,
|
|
61
73
|
"aria-haspopup": "menu",
|
|
62
74
|
"aria-expanded": unref(ctx).open,
|
|
63
|
-
"aria-controls": unref(ctx).open ? unref(ctx).contentId : void 0
|
|
64
|
-
|
|
65
|
-
onKeydown: handleKeydown
|
|
66
|
-
}, [
|
|
75
|
+
"aria-controls": unref(ctx).open ? unref(ctx).contentId : void 0
|
|
76
|
+
}), [
|
|
67
77
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
68
|
-
],
|
|
78
|
+
], 16, _hoisted_1);
|
|
69
79
|
};
|
|
70
80
|
}
|
|
71
81
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./EditorialEngine.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const EditorialEngine = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const EditorialEngine = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c5fd96f6"]]);
|
|
5
5
|
export {
|
|
6
6
|
EditorialEngine as default
|
|
7
7
|
};
|
|
@@ -485,6 +485,17 @@ function createEditorialEngine(stage, options) {
|
|
|
485
485
|
pointer = point;
|
|
486
486
|
scheduleRender();
|
|
487
487
|
}
|
|
488
|
+
function onTouchStart(event) {
|
|
489
|
+
const touch = event.changedTouches[0];
|
|
490
|
+
if (touch === void 0 || !event.cancelable) return;
|
|
491
|
+
const point = stagePoint(touch);
|
|
492
|
+
const isNarrow = stageW < NARROW_BREAKPOINT;
|
|
493
|
+
const activeOrbCount = isNarrow ? NARROW_ACTIVE_ORBS : orbs.length;
|
|
494
|
+
const radiusScale = isNarrow ? NARROW_ORB_SCALE : 1;
|
|
495
|
+
if (hitTestOrbs(orbs, point.x, point.y, activeOrbCount, radiusScale) !== -1) {
|
|
496
|
+
event.preventDefault();
|
|
497
|
+
}
|
|
498
|
+
}
|
|
488
499
|
function onPointerMove(event) {
|
|
489
500
|
const point = stagePoint(event);
|
|
490
501
|
pointer = point;
|
|
@@ -514,6 +525,7 @@ function createEditorialEngine(stage, options) {
|
|
|
514
525
|
scheduleRender();
|
|
515
526
|
}
|
|
516
527
|
stage.addEventListener("pointerdown", onPointerDown);
|
|
528
|
+
stage.addEventListener("touchstart", onTouchStart, { passive: false });
|
|
517
529
|
window.addEventListener("pointermove", onPointerMove);
|
|
518
530
|
window.addEventListener("pointerup", onPointerUp);
|
|
519
531
|
window.addEventListener("pointercancel", onPointerUp);
|
|
@@ -532,6 +544,7 @@ function createEditorialEngine(stage, options) {
|
|
|
532
544
|
if (scheduledRaf !== null) cancelAnimationFrame(scheduledRaf);
|
|
533
545
|
resizeObserver.disconnect();
|
|
534
546
|
stage.removeEventListener("pointerdown", onPointerDown);
|
|
547
|
+
stage.removeEventListener("touchstart", onTouchStart);
|
|
535
548
|
window.removeEventListener("pointermove", onPointerMove);
|
|
536
549
|
window.removeEventListener("pointerup", onPointerUp);
|
|
537
550
|
window.removeEventListener("pointercancel", onPointerUp);
|
|
@@ -17,6 +17,8 @@ export interface FileUploadProps {
|
|
|
17
17
|
files?: UploadFile[];
|
|
18
18
|
/** Called with the new list on every change — a selection, a drop, or a removal. */
|
|
19
19
|
onFilesChange?: (files: UploadFile[]) => void;
|
|
20
|
+
/** A consumer `@change` on the file input, run once after the internal handling. */
|
|
21
|
+
onChange?: (event: Event) => void;
|
|
20
22
|
/** The input's native `accept` attribute (comma-separated extensions and/or MIME types/wildcards). Also enforced in JS: a dropped file never passes through the picker, so the browser's own filtering never sees it. */
|
|
21
23
|
accept?: string;
|
|
22
24
|
/** Allows more than one file per selection or drop. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./FileUpload.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const FileUpload = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const FileUpload = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0513d385"]]);
|
|
5
5
|
export {
|
|
6
6
|
FileUpload as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, mergeModels, useModel, computed, ref, useTemplateRef, watch, onBeforeUnmount, createElementBlock, openBlock, normalizeClass, createElementVNode, createCommentVNode, createTextVNode, toDisplayString, createVNode, TransitionGroup, withCtx, Fragment, renderList, normalizeStyle,
|
|
1
|
+
import { defineComponent, mergeModels, useModel, computed, useAttrs, ref, useTemplateRef, watch, onBeforeUnmount, createElementBlock, openBlock, normalizeClass, createElementVNode, createCommentVNode, mergeProps, unref, createTextVNode, toDisplayString, createVNode, TransitionGroup, withCtx, Fragment, renderList, normalizeStyle, nextTick } from "vue";
|
|
2
2
|
import { cn } from "../../utils.js";
|
|
3
3
|
import { useField } from "../../internals/field.js";
|
|
4
4
|
import { useFancyId } from "../../internals/use-id.js";
|
|
@@ -44,6 +44,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
44
44
|
props: /* @__PURE__ */ mergeModels({
|
|
45
45
|
files: {},
|
|
46
46
|
onFilesChange: { type: Function },
|
|
47
|
+
onChange: { type: Function },
|
|
47
48
|
accept: {},
|
|
48
49
|
multiple: { type: Boolean, default: false },
|
|
49
50
|
maxSize: {},
|
|
@@ -71,9 +72,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
71
72
|
const effectiveRequired = computed(() => field?.required ?? __props.required);
|
|
72
73
|
const effectiveInvalid = computed(() => field?.invalid ?? __props.invalid);
|
|
73
74
|
const hintId = computed(() => `${effectiveId.value}-hint`);
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
const attrs = useAttrs();
|
|
76
|
+
function describedBy() {
|
|
77
|
+
return [field?.describedBy, attrs["aria-describedby"], __props.hint ? hintId.value : void 0].filter(Boolean).join(" ") || void 0;
|
|
78
|
+
}
|
|
77
79
|
const dragDepth = ref(0);
|
|
78
80
|
const dragging = computed(() => dragDepth.value > 0);
|
|
79
81
|
const inputRef = useTemplateRef("input");
|
|
@@ -160,12 +162,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
160
162
|
await announceLive(`${addedCount} file${addedCount === 1 ? "" : "s"} added.`);
|
|
161
163
|
}
|
|
162
164
|
}
|
|
165
|
+
function callListener(listener, ...args) {
|
|
166
|
+
if (Array.isArray(listener)) {
|
|
167
|
+
for (const fn of listener) if (typeof fn === "function") fn(...args);
|
|
168
|
+
} else if (typeof listener === "function") {
|
|
169
|
+
listener(...args);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
163
172
|
function handleInputChange(event) {
|
|
164
173
|
if (effectiveDisabled.value) return;
|
|
165
174
|
const input = event.currentTarget;
|
|
166
175
|
const picked = Array.from(input.files ?? []);
|
|
167
|
-
input.value = "";
|
|
168
176
|
addFiles(picked);
|
|
177
|
+
callListener(__props.onChange, event);
|
|
178
|
+
input.value = "";
|
|
169
179
|
}
|
|
170
180
|
function handleDragEnter(event) {
|
|
171
181
|
event.preventDefault();
|
|
@@ -288,7 +298,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
288
298
|
onDragleave: handleDragLeave,
|
|
289
299
|
onDrop: handleDrop
|
|
290
300
|
}, [
|
|
291
|
-
createElementVNode("input", {
|
|
301
|
+
createElementVNode("input", mergeProps(unref(attrs), {
|
|
292
302
|
ref: "input",
|
|
293
303
|
type: "file",
|
|
294
304
|
id: effectiveId.value,
|
|
@@ -297,12 +307,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
297
307
|
multiple: __props.multiple,
|
|
298
308
|
disabled: effectiveDisabled.value,
|
|
299
309
|
required: effectiveRequired.value,
|
|
300
|
-
"aria-invalid": effectiveInvalid.value ? "true" :
|
|
301
|
-
"aria-describedby": describedBy
|
|
302
|
-
"aria-label": __props.label,
|
|
310
|
+
"aria-invalid": effectiveInvalid.value ? "true" : unref(attrs)["aria-invalid"],
|
|
311
|
+
"aria-describedby": describedBy(),
|
|
312
|
+
"aria-label": __props.label ?? unref(attrs)["aria-label"],
|
|
303
313
|
class: "ft-file-upload-input sr-only",
|
|
304
314
|
onChange: handleInputChange
|
|
305
|
-
}, null,
|
|
315
|
+
}), null, 16, _hoisted_2),
|
|
306
316
|
createElementVNode("label", {
|
|
307
317
|
for: effectiveId.value,
|
|
308
318
|
class: "ft-file-upload-prompt flex flex-col items-center gap-1"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineComponent, useTemplateRef, onMounted, onBeforeUnmount, watchEffect, createElementBlock, openBlock, normalizeClass, unref, createElementVNode } from "vue";
|
|
2
2
|
import { cn } from "../../utils.js";
|
|
3
|
+
import { isDev } from "../../internals/env.js";
|
|
3
4
|
import { useReducedMotion } from "../../internals/motion/use-media-query.js";
|
|
4
5
|
import { EXPOSURE_AMBIENT } from "./fireworks-shared.js";
|
|
5
6
|
import { createFireworksHdr } from "./fireworks-hdr-core.js";
|
|
@@ -26,7 +27,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
26
27
|
},
|
|
27
28
|
setup(__props) {
|
|
28
29
|
const canvasRef = useTemplateRef("canvas");
|
|
29
|
-
const DEV = false;
|
|
30
30
|
const reducedMotion = useReducedMotion();
|
|
31
31
|
let engine = null;
|
|
32
32
|
onMounted(() => {
|
|
@@ -62,7 +62,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
62
62
|
quality: __props.quality,
|
|
63
63
|
ambientShells: __props.ambientShells,
|
|
64
64
|
reducedMotion: prefersReduced,
|
|
65
|
-
debug:
|
|
65
|
+
debug: isDev,
|
|
66
66
|
onReady: __props.onReady,
|
|
67
67
|
onLost: __props.onLost,
|
|
68
68
|
// Any teardown — unmount, the handle's `cleanup()`, or the give-up
|
|
@@ -12,7 +12,7 @@ export interface FlickeringGridProps {
|
|
|
12
12
|
gridGap?: number;
|
|
13
13
|
/** Probability of a square changing opacity each second (0-1) */
|
|
14
14
|
flickerChance?: number;
|
|
15
|
-
/** Color of the squares
|
|
15
|
+
/** Color of the squares: a hex string, or `currentColor` (default) to follow the text colour */
|
|
16
16
|
color?: string;
|
|
17
17
|
/** Maximum opacity of squares (0-1) */
|
|
18
18
|
maxOpacity?: number;
|
|
@@ -12,7 +12,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
12
12
|
squareSize: { default: 4 },
|
|
13
13
|
gridGap: { default: 6 },
|
|
14
14
|
flickerChance: { default: 0.3 },
|
|
15
|
-
color: { default: "
|
|
15
|
+
color: { default: "currentColor" },
|
|
16
16
|
maxOpacity: { default: 0.3 },
|
|
17
17
|
width: {},
|
|
18
18
|
height: {},
|
|
@@ -19,7 +19,7 @@ export interface FlickeringGridLiveOptions {
|
|
|
19
19
|
gridGap?: number;
|
|
20
20
|
/** Probability of a square changing opacity each second (0-1) */
|
|
21
21
|
flickerChance?: number;
|
|
22
|
-
/** Color of the squares
|
|
22
|
+
/** Color of the squares: a hex string, or `currentColor` (default) to follow the text colour */
|
|
23
23
|
color?: string;
|
|
24
24
|
/** Maximum opacity of squares (0-1) */
|
|
25
25
|
maxOpacity?: number;
|
|
@@ -2,16 +2,56 @@ const DEFAULTS = {
|
|
|
2
2
|
squareSize: 4,
|
|
3
3
|
gridGap: 6,
|
|
4
4
|
flickerChance: 0.3,
|
|
5
|
-
color: "
|
|
5
|
+
color: "currentColor",
|
|
6
6
|
maxOpacity: 0.3
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
const CURRENT_COLOR = /^\s*currentcolor\s*$/i;
|
|
9
|
+
function parseHex(hex) {
|
|
10
|
+
let h = (hex || "#000").trim().replace(/^#/, "");
|
|
11
|
+
if (h.length === 3) {
|
|
12
|
+
h = h.split("").map((c) => c + c).join("");
|
|
13
|
+
}
|
|
14
|
+
const bigint = parseInt(h, 16) || 0;
|
|
15
|
+
return { r: bigint >> 16 & 255, g: bigint >> 8 & 255, b: bigint & 255 };
|
|
16
|
+
}
|
|
17
|
+
function computedToRgb(computed) {
|
|
18
|
+
const m = /^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/i.exec(computed);
|
|
19
|
+
if (m) return { r: Math.round(+m[1]), g: Math.round(+m[2]), b: Math.round(+m[3]) };
|
|
20
|
+
if (!computed) return { r: 0, g: 0, b: 0 };
|
|
21
|
+
try {
|
|
22
|
+
const probe = document.createElement("canvas");
|
|
23
|
+
probe.width = probe.height = 1;
|
|
24
|
+
const pctx = probe.getContext("2d", { willReadFrequently: true });
|
|
25
|
+
if (pctx) {
|
|
26
|
+
pctx.fillStyle = computed;
|
|
27
|
+
pctx.fillRect(0, 0, 1, 1);
|
|
28
|
+
const [r = 0, g = 0, b = 0] = pctx.getImageData(0, 0, 1, 1).data;
|
|
29
|
+
return { r, g, b };
|
|
30
|
+
}
|
|
31
|
+
} catch {
|
|
32
|
+
}
|
|
33
|
+
return { r: 0, g: 0, b: 0 };
|
|
34
|
+
}
|
|
35
|
+
function createColorResolver(el) {
|
|
36
|
+
let lastComputed = "";
|
|
37
|
+
let lastRgb = { r: 0, g: 0, b: 0 };
|
|
38
|
+
let lastHex = "";
|
|
39
|
+
let lastHexRgb = { r: 0, g: 0, b: 0 };
|
|
40
|
+
return (color) => {
|
|
41
|
+
if (CURRENT_COLOR.test(color)) {
|
|
42
|
+
const computed = getComputedStyle(el).color;
|
|
43
|
+
if (computed !== lastComputed) {
|
|
44
|
+
lastComputed = computed;
|
|
45
|
+
lastRgb = computedToRgb(computed);
|
|
46
|
+
}
|
|
47
|
+
return lastRgb;
|
|
48
|
+
}
|
|
49
|
+
if (color !== lastHex) {
|
|
50
|
+
lastHex = color;
|
|
51
|
+
lastHexRgb = parseHex(color);
|
|
52
|
+
}
|
|
53
|
+
return lastHexRgb;
|
|
54
|
+
};
|
|
15
55
|
}
|
|
16
56
|
function createFlickeringGrid(el, options, random = Math.random) {
|
|
17
57
|
const ctx = el.canvas.getContext("2d");
|
|
@@ -25,6 +65,7 @@ function createFlickeringGrid(el, options, random = Math.random) {
|
|
|
25
65
|
let squares = new Float32Array(0);
|
|
26
66
|
let dpr = 1;
|
|
27
67
|
let destroyed = false;
|
|
68
|
+
const resolveColor = createColorResolver(el.container);
|
|
28
69
|
function setupCanvas(w, h) {
|
|
29
70
|
dpr = window.devicePixelRatio || 1;
|
|
30
71
|
el.canvas.width = w * dpr;
|
|
@@ -46,7 +87,8 @@ function createFlickeringGrid(el, options, random = Math.random) {
|
|
|
46
87
|
}
|
|
47
88
|
}
|
|
48
89
|
function drawGrid() {
|
|
49
|
-
const
|
|
90
|
+
const { r, g, b } = resolveColor(opts.color);
|
|
91
|
+
const colorPrefix = `rgba(${r}, ${g}, ${b},`;
|
|
50
92
|
ctx.clearRect(0, 0, el.canvas.width, el.canvas.height);
|
|
51
93
|
for (let i = 0; i < cols; i++) {
|
|
52
94
|
for (let j = 0; j < rows; j++) {
|
|
@@ -12,7 +12,9 @@ export interface FlipCardProps {
|
|
|
12
12
|
/** Whether the back is showing. Bindable (`v-model:flipped`). */
|
|
13
13
|
flipped?: boolean;
|
|
14
14
|
/** Called with the new state after every flip, however it happened. */
|
|
15
|
-
|
|
15
|
+
onFlip?: ((flipped: boolean) => void) | ((flipped: boolean) => void)[];
|
|
16
|
+
/** @deprecated Use `@flip` / `onFlip`. Only called when `onFlip` is absent. */
|
|
17
|
+
onflip?: ((flipped: boolean) => void) | ((flipped: boolean) => void)[];
|
|
16
18
|
/** Length of one flip in milliseconds */
|
|
17
19
|
duration?: number;
|
|
18
20
|
/** Light the faces as they turn: a sheen sweeping across and shading edge-on */
|