@lumx/vue 4.9.0-next.8 → 4.9.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/{DCsEMm-b.js → BqMObS2T.js} +40 -37
- package/_internal/BqMObS2T.js.map +1 -0
- package/components/button/Button.d.ts +3 -5
- package/components/button/IconButton.d.ts +3 -5
- package/components/combobox/Combobox.stories.d.ts +152 -0
- package/components/combobox/Combobox.test.stories.d.ts +112 -0
- package/components/combobox/ComboboxButton.d.ts +44 -0
- package/components/combobox/ComboboxInput.d.ts +68 -0
- package/components/combobox/ComboboxList.d.ts +15 -0
- package/components/combobox/ComboboxOption.d.ts +29 -0
- package/components/combobox/ComboboxOptionAction.d.ts +20 -0
- package/components/combobox/ComboboxOptionMoreInfo.d.ts +29 -0
- package/components/combobox/ComboboxOptionSkeleton.d.ts +14 -0
- package/components/combobox/ComboboxPopover.d.ts +20 -0
- package/components/combobox/ComboboxProvider.d.ts +16 -0
- package/components/combobox/ComboboxSection.d.ts +14 -0
- package/components/combobox/ComboboxState.d.ts +14 -0
- package/components/combobox/context/ComboboxContext.d.ts +23 -0
- package/components/combobox/context/ComboboxListContext.d.ts +14 -0
- package/components/combobox/context/ComboboxOptionContext.d.ts +16 -0
- package/components/combobox/context/useComboboxEvent.d.ts +7 -0
- package/components/combobox/context/useComboboxOpen.d.ts +7 -0
- package/components/combobox/index.d.ts +112 -0
- package/components/expansion-panel/ExpansionPanel.d.ts +39 -0
- package/components/expansion-panel/ExpansionPanel.stories.d.ts +54 -0
- package/components/expansion-panel/index.d.ts +1 -0
- package/components/image-block/ImageBlock.d.ts +19 -0
- package/components/image-block/ImageBlock.stories.d.ts +178 -0
- package/components/image-block/ImageCaption.d.ts +18 -0
- package/components/image-block/index.d.ts +1 -0
- package/components/list/ListSection.stories.d.ts +21 -23
- package/components/mosaic/Mosaic.d.ts +30 -0
- package/components/mosaic/Mosaic.stories.d.ts +93 -0
- package/components/mosaic/index.d.ts +1 -0
- package/components/text-field/RawInputText.d.ts +3 -0
- package/components/text-field/RawInputTextarea.d.ts +3 -0
- package/components/text-field/TextField.d.ts +11 -0
- package/composables/useWatchDisposable.d.ts +19 -0
- package/index.d.ts +4 -0
- package/index.js +8264 -6242
- package/index.js.map +1 -1
- package/package.json +4 -5
- package/stories/decorators/withValueOnChange.d.ts +4 -4
- package/utils/VueToJSX.d.ts +7 -0
- package/utils/index.js +2 -2
- package/_internal/DCsEMm-b.js.map +0 -1
package/package.json
CHANGED
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"sideEffects": false,
|
|
36
|
-
"version": "4.9.0
|
|
36
|
+
"version": "4.9.0",
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@floating-ui/vue": "^1.1.10",
|
|
39
|
-
"@lumx/core": "^4.9.0
|
|
40
|
-
"@lumx/icons": "^4.9.0
|
|
39
|
+
"@lumx/core": "^4.9.0",
|
|
40
|
+
"@lumx/icons": "^4.9.0",
|
|
41
41
|
"@vueuse/core": "^14.1.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
@@ -69,6 +69,5 @@
|
|
|
69
69
|
"vitest": "^4.0.18",
|
|
70
70
|
"vue": "^3.5.27",
|
|
71
71
|
"vue-tsc": "^3.2.4"
|
|
72
|
-
}
|
|
73
|
-
"stableVersion": "4.8.1"
|
|
72
|
+
}
|
|
74
73
|
}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This is the Vue equivalent of the React withValueOnChange decorator.
|
|
6
6
|
*/
|
|
7
|
-
export declare const withValueOnChange: ({ valueProp, valueTransform, }?: {
|
|
7
|
+
export declare const withValueOnChange: ({ valueProp, valueTransform, onChangeProp, valueExtract, }?: {
|
|
8
8
|
valueProp?: string;
|
|
9
9
|
valueTransform?: (v: any) => any;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
10
|
+
onChangeProp?: string;
|
|
11
|
+
valueExtract?: (v: any) => any;
|
|
12
|
+
}) => (story: any, ctx: any) => () => any;
|
package/utils/VueToJSX.d.ts
CHANGED
|
@@ -10,6 +10,13 @@ export type VueToJSXProps<Props, OmitProps extends keyof Props = never> = Omit<P
|
|
|
10
10
|
/** Class name forwarded to the root element of the component. */
|
|
11
11
|
class?: string;
|
|
12
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Hyphenated aria-* prop keys that must NOT be declared as Vue component props.
|
|
15
|
+
* When declared, Vue normalizes them to camelCase (e.g. aria-haspopup → ariaHaspopup),
|
|
16
|
+
* which breaks hyphenated key destructuring in core component templates.
|
|
17
|
+
* By excluding them from props, they flow through `attrs` with their original hyphenated keys.
|
|
18
|
+
*/
|
|
19
|
+
export type HyphenatedAriaProps = 'aria-expanded' | 'aria-haspopup' | 'aria-label' | 'aria-pressed';
|
|
13
20
|
export declare const keysOf: <T>() => <K extends readonly (keyof T)[]>(...keys: [keyof T] extends [K[number]] ? K : [Error: "\u274C Missing keys in your list:", Exclude<keyof T, K[number]>]) => Record<K[number], {
|
|
14
21
|
required: false;
|
|
15
22
|
}>;
|
package/utils/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s } from "../_internal/
|
|
2
|
-
import { C as P, P as v, a as w, T as d, u as C } from "../_internal/
|
|
1
|
+
import { s } from "../_internal/BqMObS2T.js";
|
|
2
|
+
import { C as P, P as v, a as w, T as d, u as C } from "../_internal/BqMObS2T.js";
|
|
3
3
|
import { watchEffect as n, onBeforeUnmount as l } from "vue";
|
|
4
4
|
function u({ callback: t, childrenRefs: o }) {
|
|
5
5
|
let e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DCsEMm-b.js","sources":["../../src/utils/theme/useTheme.ts","../../src/utils/theme/ThemeProvider.ts","../../src/utils/Portal/PortalProvider.tsx","../../src/utils/Portal/Portal.tsx","../../../lumx-core/src/js/utils/ClickAway/index.ts","../../src/utils/ClickAway/ClickAwayProvider.tsx"],"sourcesContent":["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","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 { 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) => 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] as HTMLElement[];\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: HTMLElement[];\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 const contextChildrenRefs: HTMLElement[] = [];\n\n const currentContext: ContextValue = {\n childrenRefs: contextChildrenRefs,\n addRefs(...newChildrenRefs) {\n for (const newRef of newChildrenRefs) {\n const el = newRef.value;\n if (el) {\n contextChildrenRefs.push(el);\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 the context's collected refs directly\n teardown = setupClickAway(() => contextChildrenRefs, props.callback);\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"],"names":["useTheme","options","Theme","defaultTheme","injected","inject","computed","unref","ThemeProvider","defineComponent","props","slots","provide","PORTAL_KEY","Symbol","defaultPortalInit","container","PortalProvider","value","default","name","type","Function","required","_isSlot","s","Object","prototype","toString","call","_isVNode","Portal","portalInit","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","evtType","CLICK_AWAY_KEY","ClickAwayProvider","parentContext","contextChildrenRefs","currentContext","childrenRefs","addRefs","newChildrenRefs","newRef","el","push","parentRef","onMounted","refs","undefined"],"mappings":";;AAWO,SAASA,EAASC,IAAoB,EAAE,cAAcC,EAAM,SAAyC;AACxG,QAAM,EAAE,cAAAC,MAAiBF,GACnBG,IAAWC,EAAmD,SAAS,MAAS;AACtF,SAAOC,EAAS,MAAMC,EAAMH,CAAQ,KAAKD,CAAY;AACzD;ACRO,MAAMK,IAAgBC;AAAA,EACzB,CAACC,GAAqC,EAAE,OAAAC,SACpCC;AAAA,IACI;AAAA,IACAN,EAAS,MAAMI,E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