@lumx/vue 4.17.0-next.2 → 4.17.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/_internal/{CO3BhTbu.js → CHaqSUjw.js} +24 -26
- package/_internal/CHaqSUjw.js.map +1 -0
- package/components/menu-button/MenuButton.d.ts +52 -0
- package/components/menu-button/MenuButton.stories.d.ts +46 -0
- package/components/menu-button/MenuButton.test.d.ts +1 -0
- package/components/menu-button/MenuButton.test.stories.d.ts +26 -0
- package/components/menu-button/MenuItem.d.ts +44 -0
- package/components/menu-button/MenuItem.test.d.ts +1 -0
- package/components/menu-button/MenuList.d.ts +15 -0
- package/components/menu-button/MenuPopover.d.ts +15 -0
- package/components/menu-button/MenuProvider.d.ts +15 -0
- package/components/menu-button/MenuTrigger.d.ts +15 -0
- package/components/menu-button/Stories/WithLinkItems.vue.d.ts +8 -0
- package/components/menu-button/context.d.ts +13 -0
- package/components/menu-button/index.d.ts +3 -0
- package/components/menu-button/useMenuEvent.d.ts +3 -0
- package/components/menu-button/useMenuOpen.d.ts +2 -0
- package/index.d.ts +1 -0
- package/index.js +4258 -3700
- package/index.js.map +1 -1
- package/package.json +4 -5
- package/utils/ClickAway/ClickAwayProvider.d.ts +1 -1
- package/utils/index.js +2 -2
- package/_internal/CO3BhTbu.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Theme as
|
|
1
|
+
import { defineComponent as l, provide as s, inject as u, ref as p, watch as P, onBeforeUnmount as v, createVNode as h, Teleport as I, isVNode as L, onMounted as C, computed as b, unref as x, watchEffect as A } from "vue";
|
|
2
|
+
import { Theme as R } from "@lumx/core/js/constants";
|
|
3
3
|
const S = () => (...e) => e.reduce(
|
|
4
4
|
(n, o) => (n[o] = { required: !1 }, n),
|
|
5
5
|
{}
|
|
6
6
|
), y = /* @__PURE__ */ Symbol("LumxPortal"), E = () => ({
|
|
7
7
|
container: "body"
|
|
8
|
-
}), Y = /* @__PURE__ */
|
|
8
|
+
}), Y = /* @__PURE__ */ l((e, {
|
|
9
9
|
slots: n
|
|
10
|
-
}) => (
|
|
10
|
+
}) => (s(y, e.value), () => n.default?.()), {
|
|
11
11
|
name: "LumxPortalProvider",
|
|
12
12
|
props: {
|
|
13
13
|
value: {
|
|
@@ -17,12 +17,12 @@ const S = () => (...e) => e.reduce(
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
function T(e) {
|
|
20
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
20
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !L(e);
|
|
21
21
|
}
|
|
22
|
-
const K = /* @__PURE__ */
|
|
22
|
+
const K = /* @__PURE__ */ l((e, {
|
|
23
23
|
slots: n
|
|
24
24
|
}) => {
|
|
25
|
-
const o =
|
|
25
|
+
const o = u(y, E), t = p(null), a = () => {
|
|
26
26
|
e.enabled ? t.value = o() : t.value = null;
|
|
27
27
|
};
|
|
28
28
|
return a(), P(() => e.enabled, a), v(() => {
|
|
@@ -58,26 +58,24 @@ function k(e, n) {
|
|
|
58
58
|
d.forEach((t) => document.removeEventListener(t, o));
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
const m = /* @__PURE__ */ Symbol("LumxClickAway"), q = /* @__PURE__ */
|
|
61
|
+
const m = /* @__PURE__ */ Symbol("LumxClickAway"), q = /* @__PURE__ */ l((e, {
|
|
62
62
|
slots: n
|
|
63
63
|
}) => {
|
|
64
|
-
const o =
|
|
64
|
+
const o = u(m, null), t = /* @__PURE__ */ new Set(), a = {
|
|
65
65
|
childrenRefs: t,
|
|
66
66
|
addRefs(...r) {
|
|
67
|
-
for (const
|
|
68
|
-
|
|
69
|
-
i && t.push(i);
|
|
70
|
-
}
|
|
67
|
+
for (const i of r)
|
|
68
|
+
t.has(i) || t.add(i);
|
|
71
69
|
o && (o.addRefs(...r), e.parentRef && o.addRefs(e.parentRef));
|
|
72
70
|
}
|
|
73
71
|
};
|
|
74
|
-
|
|
72
|
+
s(m, a);
|
|
75
73
|
let c;
|
|
76
|
-
return
|
|
74
|
+
return C(() => {
|
|
77
75
|
const r = e.childrenRefs.value;
|
|
78
|
-
r && a.addRefs(...r), c = k(() => t, (
|
|
79
|
-
const
|
|
80
|
-
typeof
|
|
76
|
+
r && a.addRefs(...r), c = k(() => Array.from(t).map((i) => i.value).filter((i) => i instanceof HTMLElement), (i) => {
|
|
77
|
+
const f = e.callback;
|
|
78
|
+
typeof f == "function" && f(i);
|
|
81
79
|
});
|
|
82
80
|
}), v(() => {
|
|
83
81
|
c?.();
|
|
@@ -98,8 +96,8 @@ const m = /* @__PURE__ */ Symbol("LumxClickAway"), q = /* @__PURE__ */ s((e, {
|
|
|
98
96
|
default: void 0
|
|
99
97
|
}
|
|
100
98
|
}
|
|
101
|
-
}), B =
|
|
102
|
-
(e, { slots: n }) => (
|
|
99
|
+
}), B = l(
|
|
100
|
+
(e, { slots: n }) => (s(
|
|
103
101
|
"theme",
|
|
104
102
|
b(() => e.value)
|
|
105
103
|
), () => n.default?.()),
|
|
@@ -108,8 +106,8 @@ const m = /* @__PURE__ */ Symbol("LumxClickAway"), q = /* @__PURE__ */ s((e, {
|
|
|
108
106
|
props: { value: { type: String, default: void 0 } }
|
|
109
107
|
}
|
|
110
108
|
);
|
|
111
|
-
function F(e = { defaultTheme:
|
|
112
|
-
const { defaultTheme: n } = e, o =
|
|
109
|
+
function F(e = { defaultTheme: R.light }) {
|
|
110
|
+
const { defaultTheme: n } = e, o = u("theme", void 0);
|
|
113
111
|
return b(() => x(o) || n);
|
|
114
112
|
}
|
|
115
113
|
function N(e, n, o) {
|
|
@@ -133,9 +131,9 @@ const O = "lumx-infinite-scroll-anchor", _ = ({
|
|
|
133
131
|
height: "4px"
|
|
134
132
|
}
|
|
135
133
|
}, null)
|
|
136
|
-
),
|
|
134
|
+
), M = /* @__PURE__ */ l((e) => {
|
|
137
135
|
const n = p(null);
|
|
138
|
-
return
|
|
136
|
+
return A((o) => {
|
|
139
137
|
const t = n.value;
|
|
140
138
|
if (!t) return;
|
|
141
139
|
const a = N(t, e.callback, e.options);
|
|
@@ -150,7 +148,7 @@ const O = "lumx-infinite-scroll-anchor", _ = ({
|
|
|
150
148
|
});
|
|
151
149
|
export {
|
|
152
150
|
q as C,
|
|
153
|
-
|
|
151
|
+
M as I,
|
|
154
152
|
K as P,
|
|
155
153
|
B as T,
|
|
156
154
|
Y as a,
|
|
@@ -158,4 +156,4 @@ export {
|
|
|
158
156
|
k as s,
|
|
159
157
|
F as u
|
|
160
158
|
};
|
|
161
|
-
//# sourceMappingURL=
|
|
159
|
+
//# sourceMappingURL=CHaqSUjw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CHaqSUjw.js","sources":["../../src/utils/VueToJSX.ts","../../src/utils/Portal/PortalProvider.tsx","../../src/utils/Portal/Portal.tsx","../../../lumx-core/src/js/utils/ClickAway/index.ts","../../src/utils/ClickAway/ClickAwayProvider.tsx","../../src/utils/theme/ThemeProvider.ts","../../src/utils/theme/useTheme.ts","../../../lumx-core/src/js/utils/InfiniteScroll/setupInfiniteScrollObserver.ts","../../../lumx-core/src/js/utils/InfiniteScroll/index.tsx","../../src/utils/InfiniteScroll/InfiniteScroll.tsx"],"sourcesContent":["import { PropsToOverride } from '@lumx/core/js/types';\n\n/**\n * Mirrors the value types accepted by Vue's class binding (and `normalizeClass`):\n * a string, an object mapping class names to booleans, an array of any of the above, or falsy.\n */\nexport type ClassValue = string | number | boolean | null | undefined | ClassValue[] | Record<string, unknown>;\n\n/**\n * Props interface for components wrapped with VueToJSX.\n * It omits JSX-specific props like `children` and `className` and adds Vue's `class`.\n *\n * @template Props - The base props type\n * @template OmitProps - Additional props to omit beyond the defaults (children, className, ref)\n */\nexport type VueToJSXProps<Props, OmitProps extends keyof Props = never> = Omit<\n Props,\n PropsToOverride | 'children' | 'className' | OmitProps\n> & {\n /** Class name forwarded to the root element of the component. */\n class?: ClassValue;\n};\n\n/**\n * Hyphenated aria-* prop keys that must NOT be declared as Vue component props.\n * When declared, Vue normalizes them to camelCase (e.g. aria-haspopup → ariaHaspopup),\n * which breaks hyphenated key destructuring in core component templates.\n * By excluding them from props, they flow through `attrs` with their original hyphenated keys.\n */\nexport type HyphenatedAriaProps = 'aria-expanded' | 'aria-haspopup' | 'aria-label' | 'aria-pressed';\n\nexport const keysOf = <T>() => {\n return <K extends readonly (keyof T)[]>(\n ...keys: [keyof T] extends [K[number]]\n ? K\n : [Error: '❌ Missing keys in your list:', Exclude<keyof T, K[number]>]\n ) => {\n // Return an object with all props marked as optional (not required)\n // This ensures Vue's type system correctly infers props as optional\n return keys.reduce(\n (acc, key) => {\n acc[key as K[number]] = { required: false };\n return acc;\n },\n {} as Record<K[number], { required: false }>,\n );\n };\n};\n\n/**\n * Derive the typed Vue emits map from a runtime `emitSchema` object.\n *\n * @example\n * export const emitSchema = {\n * change: (_newValue?: unknown) => true,\n * search: (_text: string) => true,\n * };\n * export type MyEmits<O> = EmitsOf<typeof emitSchema>\n */\nexport type EmitsOf<S> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [K in keyof S]: S[K] extends (...args: infer A) => any ? (...args: A) => void : never;\n};\n","import { defineComponent, provide, type PropType, type InjectionKey } from 'vue';\n\nexport type { PortalInit, PortalProviderProps } from '@lumx/core/js/utils/Portal';\nimport type { PortalInit, PortalProviderProps } from '@lumx/core/js/utils/Portal';\n\nexport const PORTAL_KEY: InjectionKey<PortalInit> = Symbol('LumxPortal');\n\nexport const defaultPortalInit: PortalInit = () => ({ container: 'body' });\n\n/**\n * Customize where <Portal> wrapped elements render (tooltip, popover, dialog, etc.)\n */\nexport const PortalProvider = defineComponent(\n (props: PortalProviderProps, { slots }) => {\n provide(PORTAL_KEY, props.value);\n return () => slots.default?.();\n },\n {\n name: 'LumxPortalProvider',\n props: {\n value: {\n type: Function as PropType<PortalInit>,\n required: true,\n },\n },\n },\n);\n","import { defineComponent, inject, onBeforeUnmount, Teleport, ref, watch } from 'vue';\nimport { PORTAL_KEY, defaultPortalInit } from './PortalProvider';\n\nexport type { PortalProps } from '@lumx/core/js/utils/Portal';\nimport type { PortalProps } from '@lumx/core/js/utils/Portal';\n\n/**\n * Render children in a portal outside the current DOM position\n * (defaults to `document.body` but can be customized with the PortalProvider)\n */\nexport const Portal = defineComponent(\n (props: PortalProps, { slots }) => {\n const portalInit = inject(PORTAL_KEY, defaultPortalInit);\n const context = ref<ReturnType<typeof portalInit> | null>(null);\n\n // Initialize portal context when enabled\n const initializePortal = () => {\n if (props.enabled) {\n context.value = portalInit();\n } else {\n context.value = null;\n }\n };\n\n // Initialize on mount and when enabled changes\n initializePortal();\n watch(() => props.enabled, initializePortal);\n\n // Register teardown on unmount\n onBeforeUnmount(() => {\n context.value?.teardown?.();\n });\n\n return () => {\n const content = slots.default?.();\n const container = context.value?.container;\n\n // If disabled or no container, render inline\n if (!props.enabled || !container) {\n return content;\n }\n\n // Render in portal using Teleport\n return <Teleport to={container}>{content}</Teleport>;\n };\n },\n {\n name: 'LumxPortal',\n props: {\n enabled: {\n type: Boolean,\n default: true,\n },\n },\n },\n);\n","/**\n * Shared types and logic for ClickAway detection.\n *\n * ClickAway detects clicks outside a set of elements and triggers a callback.\n * The core logic (event listening + target checking) is framework-agnostic.\n * Framework-specific wrappers (React hook, Vue composable) and context providers\n * (React context, Vue provide/inject) are implemented in each framework package.\n */\n\nimport type { Falsy } from '@lumx/core/js/types';\n\n/** Event types that trigger click away detection. */\nexport const CLICK_AWAY_EVENT_TYPES = ['mousedown', 'touchstart'] as const;\n\n/** Callback triggered when a click away is detected. */\nexport type ClickAwayCallback = EventListener | Falsy;\n\n/**\n * Check if the click event targets are outside all the given elements.\n *\n * @param targets - The event target elements (from `event.target` and `event.composedPath()`).\n * @param elements - The elements considered \"inside\" the click away context.\n * @returns `true` if the click is outside all elements (i.e. a click away).\n */\nexport function isClickAway(targets: HTMLElement[], elements: HTMLElement[]): boolean {\n return !elements.some((element) => element instanceof Node && targets.some((target) => element.contains(target)));\n}\n\n/**\n * Imperative setup for click away detection.\n * Adds mousedown/touchstart listeners on `document` and calls the callback when a click\n * occurs outside the elements returned by `getElements`.\n *\n * Note: when `getElements` returns an empty array, any click is considered a click away.\n * Callers should guard against calling `setupClickAway` when no refs are registered.\n *\n * @param getElements - Getter returning the current list of elements considered \"inside\".\n * @param callback - Callback to invoke on click away.\n * @returns A teardown function that removes the event listeners.\n */\nexport function setupClickAway(\n getElements: () => HTMLElement[],\n callback: ClickAwayCallback,\n): (() => void) | undefined {\n if (!callback) {\n return undefined;\n }\n\n const listener: EventListener = (evt) => {\n const targets = [evt.composedPath?.()[0], evt.target].filter((t): t is HTMLElement => t instanceof Node);\n const elements = getElements();\n if (isClickAway(targets, elements)) {\n callback(evt);\n }\n };\n\n CLICK_AWAY_EVENT_TYPES.forEach((evtType) => document.addEventListener(evtType, listener));\n return () => {\n CLICK_AWAY_EVENT_TYPES.forEach((evtType) => document.removeEventListener(evtType, listener));\n };\n}\n","import {\n defineComponent,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n type InjectionKey,\n type PropType,\n type Ref,\n} from 'vue';\nimport { setupClickAway, type ClickAwayCallback } from '@lumx/core/js/utils/ClickAway';\n\ninterface ContextValue {\n childrenRefs: Set<Ref<HTMLElement | undefined>>;\n addRefs(...newChildrenRefs: Array<Ref<HTMLElement | undefined>>): void;\n}\n\nexport const CLICK_AWAY_KEY: InjectionKey<ContextValue> = Symbol('LumxClickAway');\n\n/**\n * Component combining click away detection with Vue's provide/inject to hook into the component tree\n * and take into account both the DOM tree and the component tree to detect click away.\n */\nexport const ClickAwayProvider = defineComponent(\n (\n props: {\n callback: ClickAwayCallback;\n childrenRefs: Ref<Array<Ref<HTMLElement | undefined>>>;\n parentRef?: Ref<HTMLElement | undefined>;\n },\n { slots },\n ) => {\n const parentContext = inject(CLICK_AWAY_KEY, null);\n\n // Store raw refs so they are resolved lazily at click time (not at mount time).\n // This avoids missing elements that are not yet mounted when addRefs is first called.\n const contextChildrenRefs = new Set<Ref<HTMLElement | undefined>>();\n\n const currentContext: ContextValue = {\n childrenRefs: contextChildrenRefs,\n addRefs(...newChildrenRefs) {\n for (const newRef of newChildrenRefs) {\n if (!contextChildrenRefs.has(newRef)) {\n contextChildrenRefs.add(newRef);\n }\n }\n if (parentContext) {\n parentContext.addRefs(...newChildrenRefs);\n if (props.parentRef) {\n parentContext.addRefs(props.parentRef);\n }\n }\n },\n };\n\n provide(CLICK_AWAY_KEY, currentContext);\n\n let teardown: (() => void) | undefined;\n\n onMounted(() => {\n const refs = props.childrenRefs.value;\n if (refs) {\n currentContext.addRefs(...refs);\n }\n\n // Setup click away using a closure that always reads the latest callback prop.\n // This handles transitions like closeMode=\"hide\" where the callback changes\n // between open (handleClose) and closed (undefined) without re-creating the listener.\n // Refs are resolved lazily at click time so late-mounted anchors are included.\n teardown = setupClickAway(\n () =>\n Array.from(contextChildrenRefs)\n .map((r) => r.value)\n .filter((el): el is HTMLElement => el instanceof HTMLElement),\n (event) => {\n const cb = props.callback;\n if (typeof cb === 'function') cb(event);\n },\n );\n });\n\n onBeforeUnmount(() => {\n teardown?.();\n });\n\n return () => slots.default?.();\n },\n {\n name: 'LumxClickAwayProvider',\n props: {\n callback: {\n type: [Function, Boolean, undefined] as PropType<ClickAwayCallback>,\n default: undefined,\n },\n childrenRefs: {\n type: Object as PropType<Ref<Array<Ref<HTMLElement | undefined>>>>,\n required: true,\n },\n parentRef: {\n type: Object as PropType<Ref<HTMLElement | undefined>>,\n default: undefined,\n },\n },\n },\n);\n","import { computed, defineComponent, provide, type PropType } from 'vue';\nimport type { Theme } from '@lumx/core/js/constants';\n\n/**\n * ThemeProvider for Vue: wraps children with `provide('theme', value)` for theme isolation.\n * Vue's `provide()` requires a component boundary, so this is a component.\n */\nexport const ThemeProvider = defineComponent(\n (props: { value: Theme | undefined }, { slots }) => {\n provide(\n 'theme',\n computed(() => props.value),\n );\n return () => slots.default?.();\n },\n {\n name: 'LumxThemeProvider',\n props: { value: { type: String as PropType<Theme | undefined>, default: undefined } },\n },\n);\n","import { type ComputedRef, type Ref, computed, inject, unref } from 'vue';\n\nimport { Theme } from '@lumx/core/js/constants';\n\nexport interface UseTheme {\n defaultTheme?: Theme;\n}\n/**\n * Retrieves the globally applied theme.\n * @returns computed theme value (auto-updates when the provided theme changes)\n */\nexport function useTheme(options: UseTheme = { defaultTheme: Theme.light }): ComputedRef<Theme | undefined> {\n const { defaultTheme } = options;\n const injected = inject<Theme | Ref<Theme | undefined> | undefined>('theme', undefined);\n return computed(() => unref(injected) || defaultTheme);\n}\n","type EventCallback = (evt?: Event) => void;\n\n/**\n * Sets up an IntersectionObserver on the given element.\n * Calls `callback` when at least one observed entry is intersecting.\n * Returns a cleanup function that unobserves the element.\n */\nexport function setupInfiniteScrollObserver(\n element: Element,\n callback: EventCallback,\n options?: IntersectionObserverInit,\n): () => void {\n const observer = new IntersectionObserver((entries = []) => {\n const hasIntersection = entries.some((entry) => entry.isIntersecting);\n\n if (!hasIntersection) {\n return;\n }\n\n callback();\n }, options);\n\n observer.observe(element);\n\n return () => {\n observer.unobserve(element);\n };\n}\n","import type { CommonRef } from '../../types';\n\nexport { setupInfiniteScrollObserver } from './setupInfiniteScrollObserver';\n\nexport const INFINITE_SCROLL_CLASSNAME = 'lumx-infinite-scroll-anchor';\n\nexport interface InfiniteScrollProps {\n /** Callback when infinite scroll component is in view */\n // eslint-disable-next-line react/no-unused-prop-types\n callback: (evt?: Event) => void;\n /** Customize intersection observer option */\n // eslint-disable-next-line react/no-unused-prop-types\n options?: IntersectionObserverInit;\n}\n\n/**\n * Framework-agnostic InfiniteScroll sentinel component.\n *\n * Renders a tiny invisible div that triggers a callback when it enters the viewport\n * (or intersects its root element) via IntersectionObserver.\n *\n * The div has a small height (4px) to avoid issues when a browser zoom is applied,\n * where a zero-height element might not trigger IntersectionObserver reliably.\n */\nexport const InfiniteScroll = ({ ref }: { ref?: CommonRef }) => (\n // In order to avoid issues when a zoom is added to the browser, we add a small height to the div so that\n // the intersection has a higher chance of working correctly.\n <div ref={ref} aria-hidden=\"true\" className={INFINITE_SCROLL_CLASSNAME} style={{ height: '4px' }} />\n);\n","import { defineComponent, ref, watchEffect } from 'vue';\nimport {\n InfiniteScroll as UI,\n type InfiniteScrollProps,\n setupInfiniteScrollObserver,\n} from '@lumx/core/js/utils/InfiniteScroll';\nimport { keysOf } from '../VueToJSX';\n\nexport type { InfiniteScrollProps };\n\n/**\n * Handles basic callback pattern by using intersection observers.\n */\nexport const InfiniteScroll = defineComponent(\n (props: InfiniteScrollProps) => {\n const elementRef = ref<HTMLDivElement | null>(null);\n\n watchEffect((onCleanup) => {\n const element = elementRef.value;\n if (!element) return;\n\n const cleanup = setupInfiniteScrollObserver(element, props.callback, props.options);\n onCleanup(cleanup);\n });\n\n return () => UI({ ref: elementRef });\n },\n {\n name: 'LumxInfiniteScroll',\n inheritAttrs: false,\n props: keysOf<InfiniteScrollProps>()('callback', 'options'),\n },\n);\n\nexport default InfiniteScroll;\n"],"names":["keysOf","keys","acc","key","PORTAL_KEY","Symbol","defaultPortalInit","container","PortalProvider","props","slots","provide","value","default","name","type","Function","required","_isSlot","s","Object","prototype","toString","call","_isVNode","Portal","portalInit","inject","context","ref","initializePortal","enabled","watch","onBeforeUnmount","teardown","content","_createVNode","Teleport","Boolean","CLICK_AWAY_EVENT_TYPES","isClickAway","targets","elements","element","target","setupClickAway","getElements","callback","listener","evt","t","evtType","CLICK_AWAY_KEY","ClickAwayProvider","parentContext","contextChildrenRefs","Set","currentContext","childrenRefs","addRefs","newChildrenRefs","newRef","has","add","parentRef","onMounted","refs","Array","from","map","r","filter","el","HTMLElement","event","cb","undefined","ThemeProvider","defineComponent","computed","useTheme","options","Theme","defaultTheme","injected","unref","setupInfiniteScrollObserver","observer","entries","entry","INFINITE_SCROLL_CLASSNAME","InfiniteScroll","height","elementRef","watchEffect","onCleanup","cleanup","UI","inheritAttrs"],"mappings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x/core/js/components/Menu/MenuButton';
|
|
2
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
|
+
import { ButtonProps } from '../button/Button';
|
|
4
|
+
import { IconButtonProps } from '../button/IconButton';
|
|
5
|
+
import { ChipProps } from '../chip/Chip';
|
|
6
|
+
import { LinkProps } from '../link/Link';
|
|
7
|
+
import { MenuPopoverProps } from './MenuPopover';
|
|
8
|
+
/** Props that MenuButton explicitly declares */
|
|
9
|
+
type MenuButtonBaseProps = VueToJSXProps<UIProps, 'children' | 'triggerProps' | 'onOpen'> & {
|
|
10
|
+
/** Menu button label */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Trigger variant */
|
|
13
|
+
variant?: MenuButtonVariant;
|
|
14
|
+
/** Menu popover props */
|
|
15
|
+
popoverProps?: MenuPopoverProps;
|
|
16
|
+
};
|
|
17
|
+
/** MenuButton props — discriminated union over the variant to inherit the target component's props. */
|
|
18
|
+
export type MenuButtonProps = MenuButtonVariantsProps<MenuButtonBaseProps, {
|
|
19
|
+
button: ButtonProps;
|
|
20
|
+
'icon-button': IconButtonProps;
|
|
21
|
+
chip: ChipProps;
|
|
22
|
+
link: LinkProps;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* MenuButton component.
|
|
26
|
+
*
|
|
27
|
+
* @param props Component props.
|
|
28
|
+
* @return Vue element.
|
|
29
|
+
*/
|
|
30
|
+
declare const MenuButton: import('vue').DefineSetupFnComponent<MenuButtonBaseProps, "open"[], {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "onOpen" | "triggerProps"> & {
|
|
31
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
32
|
+
} & {
|
|
33
|
+
/** Menu button label */
|
|
34
|
+
label: string;
|
|
35
|
+
/** Trigger variant */
|
|
36
|
+
variant?: MenuButtonVariant;
|
|
37
|
+
/** Menu popover props */
|
|
38
|
+
popoverProps?: MenuPopoverProps;
|
|
39
|
+
} & {
|
|
40
|
+
onOpen?: ((...args: any[]) => any) | undefined;
|
|
41
|
+
}, import('vue').PublicProps>;
|
|
42
|
+
/**
|
|
43
|
+
* MenuButton component constructor.
|
|
44
|
+
*/
|
|
45
|
+
export interface MenuButtonConstructor {
|
|
46
|
+
new (props: MenuButtonProps): {
|
|
47
|
+
$props: MenuButtonProps;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
declare const _default: MenuButtonConstructor & typeof MenuButton;
|
|
51
|
+
export default _default;
|
|
52
|
+
export { COMPONENT_NAME };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
component: any;
|
|
3
|
+
argTypes: {
|
|
4
|
+
onOpen: {
|
|
5
|
+
action: boolean;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
args: {
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
play(): Promise<void>;
|
|
12
|
+
title: string;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
15
|
+
/** Default menu button config */
|
|
16
|
+
export declare const Default: {
|
|
17
|
+
argTypes: {
|
|
18
|
+
onItemClick: {
|
|
19
|
+
action: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
render: ({ onItemClick, ...args }: any) => import("vue/jsx-runtime").JSX.Element;
|
|
23
|
+
};
|
|
24
|
+
/** All MenuButton variants */
|
|
25
|
+
export declare const Variants: {
|
|
26
|
+
argTypes: {
|
|
27
|
+
onItemClick: {
|
|
28
|
+
action: boolean;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
decorators: ((story: any, context: any) => any)[];
|
|
32
|
+
render: ({ onItemClick, ...args }: any) => import("vue/jsx-runtime").JSX.Element;
|
|
33
|
+
};
|
|
34
|
+
/** Menu with link items */
|
|
35
|
+
export declare const WithLinkItems: {
|
|
36
|
+
render: (args: any) => () => import("vue/jsx-runtime").JSX.Element;
|
|
37
|
+
argTypes: {
|
|
38
|
+
onItemClick: {
|
|
39
|
+
action: boolean;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
args: {
|
|
43
|
+
label: string;
|
|
44
|
+
emphasis: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: string;
|
|
3
|
+
tags: string[];
|
|
4
|
+
args: {
|
|
5
|
+
onOne: import('storybook/test').Mock<(...args: any[]) => any>;
|
|
6
|
+
onTwo: import('storybook/test').Mock<(...args: any[]) => any>;
|
|
7
|
+
onThree: import('storybook/test').Mock<(...args: any[]) => any>;
|
|
8
|
+
};
|
|
9
|
+
render: (args: any) => import("vue/jsx-runtime").JSX.Element;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
12
|
+
export declare const TabFromLastItemClosesAndMovesFocus: {
|
|
13
|
+
play: ({ canvasElement }: any) => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
export declare const ShiftTabFromFirstItemClosesAndReturnsToTrigger: {
|
|
16
|
+
play: ({ canvasElement }: any) => Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
export declare const EscapeRestoresFocusToTrigger: {
|
|
19
|
+
play: ({ canvasElement }: any) => Promise<void>;
|
|
20
|
+
};
|
|
21
|
+
export declare const ItemActivationRestoresFocusToTrigger: {
|
|
22
|
+
play: ({ canvasElement, args }: any) => Promise<void>;
|
|
23
|
+
};
|
|
24
|
+
export declare const ClickAwayClosesMenu: {
|
|
25
|
+
play: ({ canvasElement }: any) => Promise<void>;
|
|
26
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { SlotsType } from 'vue';
|
|
2
|
+
import { ColorPalette } from '@lumx/core/js/constants';
|
|
3
|
+
import { MenuItemProps as UIProps, MenuItemPropsToOverride, CLASSNAME, COMPONENT_NAME } from '@lumx/core/js/components/Menu/MenuItem';
|
|
4
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
5
|
+
export interface MenuItemActionSlotProps {
|
|
6
|
+
/** Props to spread on the custom action element (includes onClick). */
|
|
7
|
+
actionProps: Record<string, any>;
|
|
8
|
+
/** Whether the item is disabled. */
|
|
9
|
+
isDisabled: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** MenuItem props. */
|
|
12
|
+
export type MenuItemProps = VueToJSXProps<UIProps, MenuItemPropsToOverride> & {
|
|
13
|
+
/** MDI icon rendered as `<Icon size="xs" />` prepended to the `before` slot. */
|
|
14
|
+
icon?: string;
|
|
15
|
+
/** MDI icon rendered as `<Icon size="xs" />` appended to the `after` slot. */
|
|
16
|
+
afterIcon?: string;
|
|
17
|
+
/** Foreground color applied to the icon and label text. */
|
|
18
|
+
color?: ColorPalette;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* MenuItem component.
|
|
22
|
+
*
|
|
23
|
+
* @param props Component props.
|
|
24
|
+
* @return Vue element.
|
|
25
|
+
*/
|
|
26
|
+
declare const MenuItem: import('vue').DefineSetupFnComponent<MenuItemProps, "click"[], SlotsType<{
|
|
27
|
+
default: void;
|
|
28
|
+
action: MenuItemActionSlotProps;
|
|
29
|
+
before: void;
|
|
30
|
+
after: void;
|
|
31
|
+
}>, Omit<UIProps, "className" | "ref" | "handleClick" | "handleChange" | "handleInput" | "handleKeyPress" | "handleClose" | "handleFocus" | "handleBlur" | "handleBeforeClick" | "handleAfterClick" | "handleMouseEnter" | "handleMouseLeave" | "handleKeyDown" | "children" | "before" | "after" | "actionProps" | "actionRef"> & {
|
|
32
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
33
|
+
} & {
|
|
34
|
+
/** MDI icon rendered as `<Icon size="xs" />` prepended to the `before` slot. */
|
|
35
|
+
icon?: string;
|
|
36
|
+
/** MDI icon rendered as `<Icon size="xs" />` appended to the `after` slot. */
|
|
37
|
+
afterIcon?: string;
|
|
38
|
+
/** Foreground color applied to the icon and label text. */
|
|
39
|
+
color?: ColorPalette;
|
|
40
|
+
} & {
|
|
41
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
42
|
+
}, import('vue').PublicProps>;
|
|
43
|
+
export { CLASSNAME, COMPONENT_NAME };
|
|
44
|
+
export default MenuItem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MenuListProps as UIProps, CLASSNAME, COMPONENT_NAME } from '@lumx/core/js/components/Menu/MenuList';
|
|
2
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
|
+
/** MenuList props. */
|
|
4
|
+
export type MenuListProps = VueToJSXProps<UIProps, 'id' | 'aria-labelledby'>;
|
|
5
|
+
/**
|
|
6
|
+
* MenuList component.
|
|
7
|
+
*
|
|
8
|
+
* @param props Component props.
|
|
9
|
+
* @return Vue element.
|
|
10
|
+
*/
|
|
11
|
+
declare const MenuList: import('vue').DefineSetupFnComponent<MenuListProps, {}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "id" | "children" | "aria-labelledby"> & {
|
|
12
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
13
|
+
} & {}, import('vue').PublicProps>;
|
|
14
|
+
export { CLASSNAME, COMPONENT_NAME };
|
|
15
|
+
export default MenuList;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MenuPopoverProps as UIProps, CLASSNAME as MENU_POPOVER_CLASSNAME, COMPONENT_NAME as MENU_POPOVER_COMPONENT_NAME } from '@lumx/core/js/components/Menu/MenuPopover';
|
|
2
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
|
+
/** MenusPopover props. */
|
|
4
|
+
export type MenuPopoverProps = VueToJSXProps<UIProps, 'anchorRef' | 'isOpen' | 'handleClose'>;
|
|
5
|
+
/**
|
|
6
|
+
* MenuPopover component.
|
|
7
|
+
*
|
|
8
|
+
* @param props Component props.
|
|
9
|
+
* @return Vue element.
|
|
10
|
+
*/
|
|
11
|
+
declare const MenuPopover: import('vue').DefineSetupFnComponent<MenuPopoverProps, {}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "isOpen" | "children" | "anchorRef"> & {
|
|
12
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
13
|
+
} & {}, import('vue').PublicProps>;
|
|
14
|
+
export { MENU_POPOVER_CLASSNAME as CLASSNAME, MENU_POPOVER_COMPONENT_NAME as COMPONENT_NAME };
|
|
15
|
+
export default MenuPopover;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** MenuProvider props. */
|
|
2
|
+
export interface MenuProviderProps {
|
|
3
|
+
onOpen?: (isOpen: boolean) => void;
|
|
4
|
+
class?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* MenuProvider component.
|
|
8
|
+
*
|
|
9
|
+
* @param props Component props.
|
|
10
|
+
* @return Vue element.
|
|
11
|
+
*/
|
|
12
|
+
declare const MenuProvider: import('vue').DefineSetupFnComponent<MenuProviderProps, "open"[], {}, MenuProviderProps & {
|
|
13
|
+
onOpen?: ((...args: any[]) => any) | undefined;
|
|
14
|
+
}, import('vue').PublicProps>;
|
|
15
|
+
export default MenuProvider;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MenuTriggerProps as UIProps, CLASSNAME, COMPONENT_NAME } from '@lumx/core/js/components/Menu/MenuTrigger';
|
|
2
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
|
+
/** MenuTrigger props. */
|
|
4
|
+
export type MenuTriggerProps = VueToJSXProps<UIProps, 'menuId' | 'isOpen'>;
|
|
5
|
+
/**
|
|
6
|
+
* MenuTrigger component.
|
|
7
|
+
*
|
|
8
|
+
* @param props Component props.
|
|
9
|
+
* @return Vue element.
|
|
10
|
+
*/
|
|
11
|
+
declare const MenuTrigger: import('vue').DefineSetupFnComponent<MenuTriggerProps, {}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "isOpen" | "children" | "menuId"> & {
|
|
12
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
13
|
+
} & {}, import('vue').PublicProps>;
|
|
14
|
+
export { CLASSNAME, COMPONENT_NAME };
|
|
15
|
+
export default MenuTrigger;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Emphasis } from '@lumx/core/js/constants';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
onItemClick?: (...args: any[]) => void;
|
|
4
|
+
label: string;
|
|
5
|
+
emphasis?: Emphasis;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { MenuHandle } from '@lumx/core/js/components/Menu/types';
|
|
3
|
+
/** Shared context value passed from MenuProvider to all Menu sub-components. */
|
|
4
|
+
export interface MenuContextValue {
|
|
5
|
+
handle: MenuHandle;
|
|
6
|
+
menuId: string;
|
|
7
|
+
triggerId: string;
|
|
8
|
+
anchorRef: Ref<HTMLElement | null>;
|
|
9
|
+
}
|
|
10
|
+
/** Provides the Menu context to all descendant Menu sub-components. */
|
|
11
|
+
export declare function provideMenuContext(value: MenuContextValue): void;
|
|
12
|
+
/** Injects and returns the Menu context; throws if used outside a MenuProvider. */
|
|
13
|
+
export declare function useMenuContext(): MenuContextValue;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { default as MenuItem, type MenuItemProps, type MenuItemActionSlotProps } from './MenuItem';
|
|
2
|
+
export { default as MenuButton, type MenuButtonProps } from './MenuButton';
|
|
3
|
+
export { default as MenuDivider, type ListDividerProps as MenuDividerProps } from '../list/ListDivider';
|
package/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from './components/input-label';
|
|
|
22
22
|
export * from './components/link';
|
|
23
23
|
export * from './components/link-preview';
|
|
24
24
|
export * from './components/list';
|
|
25
|
+
export * from './components/menu-button';
|
|
25
26
|
export * from './components/message';
|
|
26
27
|
export * from './components/mosaic';
|
|
27
28
|
export * from './components/popover';
|