@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.
Files changed (46) hide show
  1. package/_internal/{DCsEMm-b.js → BqMObS2T.js} +40 -37
  2. package/_internal/BqMObS2T.js.map +1 -0
  3. package/components/button/Button.d.ts +3 -5
  4. package/components/button/IconButton.d.ts +3 -5
  5. package/components/combobox/Combobox.stories.d.ts +152 -0
  6. package/components/combobox/Combobox.test.stories.d.ts +112 -0
  7. package/components/combobox/ComboboxButton.d.ts +44 -0
  8. package/components/combobox/ComboboxInput.d.ts +68 -0
  9. package/components/combobox/ComboboxList.d.ts +15 -0
  10. package/components/combobox/ComboboxOption.d.ts +29 -0
  11. package/components/combobox/ComboboxOptionAction.d.ts +20 -0
  12. package/components/combobox/ComboboxOptionMoreInfo.d.ts +29 -0
  13. package/components/combobox/ComboboxOptionSkeleton.d.ts +14 -0
  14. package/components/combobox/ComboboxPopover.d.ts +20 -0
  15. package/components/combobox/ComboboxProvider.d.ts +16 -0
  16. package/components/combobox/ComboboxSection.d.ts +14 -0
  17. package/components/combobox/ComboboxState.d.ts +14 -0
  18. package/components/combobox/context/ComboboxContext.d.ts +23 -0
  19. package/components/combobox/context/ComboboxListContext.d.ts +14 -0
  20. package/components/combobox/context/ComboboxOptionContext.d.ts +16 -0
  21. package/components/combobox/context/useComboboxEvent.d.ts +7 -0
  22. package/components/combobox/context/useComboboxOpen.d.ts +7 -0
  23. package/components/combobox/index.d.ts +112 -0
  24. package/components/expansion-panel/ExpansionPanel.d.ts +39 -0
  25. package/components/expansion-panel/ExpansionPanel.stories.d.ts +54 -0
  26. package/components/expansion-panel/index.d.ts +1 -0
  27. package/components/image-block/ImageBlock.d.ts +19 -0
  28. package/components/image-block/ImageBlock.stories.d.ts +178 -0
  29. package/components/image-block/ImageCaption.d.ts +18 -0
  30. package/components/image-block/index.d.ts +1 -0
  31. package/components/list/ListSection.stories.d.ts +21 -23
  32. package/components/mosaic/Mosaic.d.ts +30 -0
  33. package/components/mosaic/Mosaic.stories.d.ts +93 -0
  34. package/components/mosaic/index.d.ts +1 -0
  35. package/components/text-field/RawInputText.d.ts +3 -0
  36. package/components/text-field/RawInputTextarea.d.ts +3 -0
  37. package/components/text-field/TextField.d.ts +11 -0
  38. package/composables/useWatchDisposable.d.ts +19 -0
  39. package/index.d.ts +4 -0
  40. package/index.js +8264 -6242
  41. package/index.js.map +1 -1
  42. package/package.json +4 -5
  43. package/stories/decorators/withValueOnChange.d.ts +4 -4
  44. package/utils/VueToJSX.d.ts +7 -0
  45. package/utils/index.js +2 -2
  46. package/_internal/DCsEMm-b.js.map +0 -1
@@ -1,23 +1,23 @@
1
- import { inject as l, computed as m, unref as P, defineComponent as c, provide as i, ref as y, watch as b, onBeforeUnmount as p, createVNode as C, Teleport as R, isVNode as x, onMounted as L } from "vue";
1
+ import { inject as d, computed as p, unref as y, defineComponent as i, provide as f, ref as P, watch as b, onBeforeUnmount as v, createVNode as C, Teleport as R, isVNode as x, onMounted as L } from "vue";
2
2
  import { Theme as T } from "@lumx/core/js/constants";
3
3
  function S(e = { defaultTheme: T.light }) {
4
- const { defaultTheme: n } = e, o = l("theme", void 0);
5
- return m(() => P(o) || n);
4
+ const { defaultTheme: n } = e, o = d("theme", void 0);
5
+ return p(() => y(o) || n);
6
6
  }
7
- const g = c(
8
- (e, { slots: n }) => (i(
7
+ const g = i(
8
+ (e, { slots: n }) => (f(
9
9
  "theme",
10
- m(() => e.value)
10
+ p(() => e.value)
11
11
  ), () => n.default?.()),
12
12
  {
13
13
  name: "LumxThemeProvider",
14
14
  props: { value: { type: String, default: void 0 } }
15
15
  }
16
- ), v = /* @__PURE__ */ Symbol("LumxPortal"), A = () => ({
16
+ ), h = /* @__PURE__ */ Symbol("LumxPortal"), A = () => ({
17
17
  container: "body"
18
- }), O = /* @__PURE__ */ c((e, {
18
+ }), N = /* @__PURE__ */ i((e, {
19
19
  slots: n
20
- }) => (i(v, e.value), () => n.default?.()), {
20
+ }) => (f(h, e.value), () => n.default?.()), {
21
21
  name: "LumxPortalProvider",
22
22
  props: {
23
23
  value: {
@@ -29,20 +29,20 @@ const g = c(
29
29
  function w(e) {
30
30
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !x(e);
31
31
  }
32
- const Y = /* @__PURE__ */ c((e, {
32
+ const O = /* @__PURE__ */ i((e, {
33
33
  slots: n
34
34
  }) => {
35
- const o = l(v, A), t = y(null), u = () => {
35
+ const o = d(h, A), t = P(null), c = () => {
36
36
  e.enabled ? t.value = o() : t.value = null;
37
37
  };
38
- return u(), b(() => e.enabled, u), p(() => {
38
+ return c(), b(() => e.enabled, c), v(() => {
39
39
  t.value?.teardown?.();
40
40
  }), () => {
41
- const r = n.default?.(), a = t.value?.container;
42
- return !e.enabled || !a ? r : C(R, {
43
- to: a
44
- }, w(r) ? r : {
45
- default: () => [r]
41
+ const a = n.default?.(), r = t.value?.container;
42
+ return !e.enabled || !r ? a : C(R, {
43
+ to: r
44
+ }, w(a) ? a : {
45
+ default: () => [a]
46
46
  });
47
47
  };
48
48
  }, {
@@ -55,39 +55,42 @@ const Y = /* @__PURE__ */ c((e, {
55
55
  }
56
56
  }), s = ["mousedown", "touchstart"];
57
57
  function E(e, n) {
58
- return !n.some((o) => e.some((t) => o?.contains(t)));
58
+ return !n.some((o) => o instanceof Node && e.some((t) => o.contains(t)));
59
59
  }
60
60
  function j(e, n) {
61
61
  if (!n)
62
62
  return;
63
63
  const o = (t) => {
64
- const u = [t.composedPath?.()[0], t.target], r = e();
65
- E(u, r) && n(t);
64
+ const c = [t.composedPath?.()[0], t.target].filter((r) => r instanceof Node), a = e();
65
+ E(c, a) && n(t);
66
66
  };
67
67
  return s.forEach((t) => document.addEventListener(t, o)), () => {
68
68
  s.forEach((t) => document.removeEventListener(t, o));
69
69
  };
70
70
  }
71
- const f = /* @__PURE__ */ Symbol("LumxClickAway"), I = /* @__PURE__ */ c((e, {
71
+ const m = /* @__PURE__ */ Symbol("LumxClickAway"), Y = /* @__PURE__ */ i((e, {
72
72
  slots: n
73
73
  }) => {
74
- const o = l(f, null), t = [], u = {
74
+ const o = d(m, null), t = [], c = {
75
75
  childrenRefs: t,
76
- addRefs(...a) {
77
- for (const h of a) {
78
- const d = h.value;
79
- d && t.push(d);
76
+ addRefs(...r) {
77
+ for (const l of r) {
78
+ const u = l.value;
79
+ u && t.push(u);
80
80
  }
81
- o && (o.addRefs(...a), e.parentRef && o.addRefs(e.parentRef));
81
+ o && (o.addRefs(...r), e.parentRef && o.addRefs(e.parentRef));
82
82
  }
83
83
  };
84
- i(f, u);
85
- let r;
84
+ f(m, c);
85
+ let a;
86
86
  return L(() => {
87
- const a = e.childrenRefs.value;
88
- a && u.addRefs(...a), r = j(() => t, e.callback);
89
- }), p(() => {
90
- r?.();
87
+ const r = e.childrenRefs.value;
88
+ r && c.addRefs(...r), a = j(() => t, (l) => {
89
+ const u = e.callback;
90
+ typeof u == "function" && u(l);
91
+ });
92
+ }), v(() => {
93
+ a?.();
91
94
  }), () => n.default?.();
92
95
  }, {
93
96
  name: "LumxClickAwayProvider",
@@ -107,11 +110,11 @@ const f = /* @__PURE__ */ Symbol("LumxClickAway"), I = /* @__PURE__ */ c((e, {
107
110
  }
108
111
  });
109
112
  export {
110
- I as C,
111
- Y as P,
113
+ Y as C,
114
+ O as P,
112
115
  g as T,
113
- O as a,
116
+ N as a,
114
117
  j as s,
115
118
  S as u
116
119
  };
117
- //# sourceMappingURL=DCsEMm-b.js.map
120
+ //# sourceMappingURL=BqMObS2T.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BqMObS2T.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) => 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: 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 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 teardown = setupClickAway(\n () => contextChildrenRefs,\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"],"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","t","evtType","CLICK_AWAY_KEY","ClickAwayProvider","parentContext","contextChildrenRefs","currentContext","childrenRefs","addRefs","newChildrenRefs","newRef","el","push","parentRef","onMounted","refs","event","cb","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;ACR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,cAAME,IAAKD,EAAO/C;AAClB,QAAIgD,KACAN,EAAoBO,KAAKD,CAAE;AAAA,MAEnC;AACA,MAAIP,MACAA,EAAcI,QAAQ,GAAGC,CAAe,GACpCtD,EAAM0D,aACNT,EAAcI,QAAQrD,EAAM0D,SAAS;AAAA,IAGjD;AAAA;AAGJxD,EAAAA,EAAQ6C,GAAgBI,CAAc;AAEtC,MAAItB;AAEJ8B,SAAAA,EAAU,MAAM;AACZ,UAAMC,IAAO5D,EAAMoD,aAAa5C;AAChC,IAAIoD,KACAT,EAAeE,QAAQ,GAAGO,CAAI,GAMlC/B,IAAWW,EACP,MAAMU,GACLW,CAAAA,MAAU;AACP,YAAMC,IAAK9D,EAAM0C;AACjB,MAAI,OAAOoB,KAAO,cAAYA,EAAGD,CAAK;AAAA,IAC1C,CACJ;AAAA,EACJ,CAAC,GAEDjC,EAAgB,MAAM;AAClBC,IAAAA,IAAQ;AAAA,EACZ,CAAC,GAEM,MAAM5B,EAAMQ,UAAO;AAC9B,GACA;AAAA,EACIC,MAAM;AAAA,EACNV,OAAO;AAAA,IACH0C,UAAU;AAAA,MACN/B,MAAM,CAACC,UAAUqB,SAAS8B,MAAS;AAAA,MACnCtD,SAASsD;AAAAA;IAEbX,cAAc;AAAA,MACVzC,MAAMK;AAAAA,MACNH,UAAU;AAAA;IAEd6C,WAAW;AAAA,MACP/C,MAAMK;AAAAA,MACNP,SAASsD;AAAAA,IACb;AAAA,EACJ;AACJ,CACJ;"}
@@ -1,6 +1,6 @@
1
1
  import { ButtonProps as UIProps, CLASSNAME, COMPONENT_NAME, DEFAULT_PROPS } from '@lumx/core/js/components/Button/Button';
2
- import { VueToJSXProps } from '../../utils/VueToJSX';
3
- export type ButtonProps = VueToJSXProps<UIProps>;
2
+ import { HyphenatedAriaProps, VueToJSXProps } from '../../utils/VueToJSX';
3
+ export type ButtonProps = Omit<VueToJSXProps<UIProps>, HyphenatedAriaProps>;
4
4
  export declare const emitSchema: {
5
5
  click: (event: MouseEvent) => boolean;
6
6
  };
@@ -13,9 +13,7 @@ export { CLASSNAME, COMPONENT_NAME, DEFAULT_PROPS };
13
13
  */
14
14
  declare const Button: import('vue').DefineSetupFnComponent<ButtonProps, {
15
15
  click: (event: MouseEvent) => boolean;
16
- }, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children"> & {
17
- class?: string;
18
- } & {
16
+ }, {}, ButtonProps & {
19
17
  onClick?: ((event: MouseEvent) => any) | undefined;
20
18
  }, import('vue').PublicProps>;
21
19
  export default Button;
@@ -1,7 +1,7 @@
1
1
  import { IconButtonProps as UIProps } from '@lumx/core/js/components/Button/IconButton';
2
2
  import { TooltipProps } from '../tooltip/Tooltip';
3
- import { VueToJSXProps } from '../../utils/VueToJSX';
4
- export type IconButtonProps = VueToJSXProps<UIProps> & {
3
+ import { HyphenatedAriaProps, VueToJSXProps } from '../../utils/VueToJSX';
4
+ export type IconButtonProps = Omit<VueToJSXProps<UIProps>, HyphenatedAriaProps> & {
5
5
  /**
6
6
  * Props to pass to the tooltip.
7
7
  * If undefined or if tooltipProps.label is undefined, the label prop will be used as tooltip label.
@@ -21,9 +21,7 @@ export declare const emitSchema: {
21
21
  */
22
22
  declare const IconButton: import('vue').DefineSetupFnComponent<IconButtonProps, {
23
23
  click: (event: MouseEvent) => boolean;
24
- }, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children"> & {
25
- class?: string;
26
- } & {
24
+ }, {}, Omit<VueToJSXProps<UIProps>, HyphenatedAriaProps> & {
27
25
  /**
28
26
  * Props to pass to the tooltip.
29
27
  * If undefined or if tooltipProps.label is undefined, the label prop will be used as tooltip label.
@@ -0,0 +1,152 @@
1
+ declare const _default: {
2
+ component: any;
3
+ play(): Promise<void>;
4
+ title: string;
5
+ };
6
+ export default _default;
7
+ export declare const ComboboxWithSubcomponents: {
8
+ args: {
9
+ value: string;
10
+ };
11
+ decorators: ((story: any, context: any) => any)[];
12
+ render: ({ value, onChange }: {
13
+ value: string;
14
+ onChange: (v: string) => void;
15
+ }) => import("vue/jsx-runtime").JSX.Element;
16
+ };
17
+ export declare const ComboboxWithSection: {
18
+ args: {
19
+ value: string;
20
+ };
21
+ decorators: ((story: any, context: any) => any)[];
22
+ render: ({ value, onChange }: {
23
+ value: string;
24
+ onChange: (v: string) => void;
25
+ }) => import("vue/jsx-runtime").JSX.Element;
26
+ };
27
+ export declare const ComboboxWithFilteredSections: {
28
+ args: {
29
+ value: string;
30
+ };
31
+ decorators: ((story: any, context: any) => any)[];
32
+ render: ({ value, onChange }: {
33
+ value: string;
34
+ onChange: (v: string) => void;
35
+ }) => import("vue/jsx-runtime").JSX.Element;
36
+ };
37
+ export declare const ComboboxWithButton: {
38
+ args: {
39
+ value: string;
40
+ };
41
+ decorators: ((story: any, context: any) => any)[];
42
+ render: ({ value, onSelect }: {
43
+ value: string;
44
+ onSelect: (option: {
45
+ value: string;
46
+ }) => void;
47
+ }) => import("vue/jsx-runtime").JSX.Element;
48
+ };
49
+ export declare const ComboboxWithLinkOptions: {
50
+ args: {
51
+ value: string;
52
+ };
53
+ decorators: ((story: any, context: any) => any)[];
54
+ render: ({ value, onChange }: {
55
+ value: string;
56
+ onChange: (v: string) => void;
57
+ }) => import("vue/jsx-runtime").JSX.Element;
58
+ };
59
+ export declare const ComboboxWithOptionMoreInfo: {
60
+ args: {
61
+ value: string;
62
+ };
63
+ decorators: ((story: any, context: any) => any)[];
64
+ render: ({ value, onChange }: {
65
+ value: string;
66
+ onChange: (v: string) => void;
67
+ }) => import("vue/jsx-runtime").JSX.Element;
68
+ };
69
+ export declare const GridComboboxWithInput: {
70
+ args: {
71
+ value: string;
72
+ };
73
+ argTypes: {
74
+ onEdit: {
75
+ action: string;
76
+ };
77
+ onDelete: {
78
+ action: string;
79
+ };
80
+ };
81
+ decorators: ((story: any, context: any) => any)[];
82
+ render: ({ value, onChange, onEdit, onDelete, }: {
83
+ value: string;
84
+ onChange: (v: string) => void;
85
+ onEdit: (fruit: string) => void;
86
+ onDelete: (fruit: string) => void;
87
+ }) => import("vue/jsx-runtime").JSX.Element;
88
+ };
89
+ export declare const GridComboboxWithButton: {
90
+ args: {
91
+ value: string;
92
+ };
93
+ argTypes: {
94
+ onDelete: {
95
+ action: string;
96
+ };
97
+ };
98
+ decorators: ((story: any, context: any) => any)[];
99
+ render: ({ value, onSelect, onDelete, }: {
100
+ value: string;
101
+ onSelect: (option: {
102
+ value: string;
103
+ }) => void;
104
+ onDelete: (fruit: string) => void;
105
+ }) => import("vue/jsx-runtime").JSX.Element;
106
+ };
107
+ export declare const ComboboxWithEmptyState: {
108
+ args: {
109
+ value: string;
110
+ };
111
+ decorators: ((story: any, context: any) => any)[];
112
+ render: ({ value, onChange }: {
113
+ value: string;
114
+ onChange: (v: string) => void;
115
+ }) => import("vue/jsx-runtime").JSX.Element;
116
+ };
117
+ export declare const ComboboxWithErrorState: {
118
+ render: () => import("vue/jsx-runtime").JSX.Element;
119
+ };
120
+ export declare const ComboboxWithLoading: {
121
+ render: () => import("vue/jsx-runtime").JSX.Element;
122
+ };
123
+ export declare const ComboboxWithLoadMore: {
124
+ args: {
125
+ value: string;
126
+ };
127
+ decorators: ((story: any, context: any) => any)[];
128
+ render: ({ value, onChange }: {
129
+ value: string;
130
+ onChange: (v: string) => void;
131
+ }) => import("vue/jsx-runtime").JSX.Element;
132
+ };
133
+ export declare const ComboboxWithSectionLoading: {
134
+ args: {
135
+ value: string;
136
+ };
137
+ decorators: ((story: any, context: any) => any)[];
138
+ render: ({ value, onChange }: {
139
+ value: string;
140
+ onChange: (v: string) => void;
141
+ }) => import("vue/jsx-runtime").JSX.Element;
142
+ };
143
+ export declare const ComboboxWithAvatarLoading: {
144
+ args: {
145
+ value: string;
146
+ };
147
+ decorators: ((story: any, context: any) => any)[];
148
+ render: ({ value, onChange }: {
149
+ value: string;
150
+ onChange: (v: string) => void;
151
+ }) => import("vue/jsx-runtime").JSX.Element;
152
+ };
@@ -0,0 +1,112 @@
1
+ declare const _default: {
2
+ component: any;
3
+ tags: string[];
4
+ parameters: {
5
+ chromatic: {
6
+ disable: boolean;
7
+ };
8
+ };
9
+ title: string;
10
+ };
11
+ export default _default;
12
+ export declare const SelectOptionUpdatesInput: {
13
+ play: ({ canvasElement }: any) => Promise<void>;
14
+ args: {
15
+ value: string;
16
+ };
17
+ decorators: ((story: any, context: any) => any)[];
18
+ render: ({ value, onChange, onSelect, }: {
19
+ value: string;
20
+ onChange: (v: string) => void;
21
+ onSelect?: (option: {
22
+ value: string;
23
+ }) => void;
24
+ }) => import("vue/jsx-runtime").JSX.Element;
25
+ };
26
+ export declare const MouseHoverDoesNotActivateOption: {
27
+ play: ({ canvasElement }: any) => Promise<void>;
28
+ args: {
29
+ value: string;
30
+ };
31
+ decorators: ((story: any, context: any) => any)[];
32
+ render: ({ value, onChange, onSelect, }: {
33
+ value: string;
34
+ onChange: (v: string) => void;
35
+ onSelect?: (option: {
36
+ value: string;
37
+ }) => void;
38
+ }) => import("vue/jsx-runtime").JSX.Element;
39
+ };
40
+ export declare const ClickAwayClosesPopup: {
41
+ render: (args: any) => import("vue/jsx-runtime").JSX.Element;
42
+ play: ({ canvasElement }: any) => Promise<void>;
43
+ args: {
44
+ value: string;
45
+ };
46
+ decorators: ((story: any, context: any) => any)[];
47
+ };
48
+ export declare const MouseHoverThenKeyboardNav: {
49
+ play: ({ canvasElement }: any) => Promise<void>;
50
+ args: {
51
+ value: string;
52
+ };
53
+ decorators: ((story: any, context: any) => any)[];
54
+ render: ({ value, onChange, onSelect, }: {
55
+ value: string;
56
+ onChange: (v: string) => void;
57
+ onSelect?: (option: {
58
+ value: string;
59
+ }) => void;
60
+ }) => import("vue/jsx-runtime").JSX.Element;
61
+ };
62
+ export declare const OptionMoreInfoKeyboardHighlight: {
63
+ play: ({ canvasElement }: any) => Promise<void>;
64
+ args: {
65
+ value: string;
66
+ };
67
+ argTypes: {
68
+ onToggle: {
69
+ action: string;
70
+ };
71
+ };
72
+ decorators: ((story: any, context: any) => any)[];
73
+ render: ({ value, onChange, onToggle, }: {
74
+ value: string;
75
+ onChange: (v: string) => void;
76
+ onToggle?: (isOpen: boolean) => void;
77
+ }) => import("vue/jsx-runtime").JSX.Element;
78
+ };
79
+ export declare const OptionMoreInfoMouseHover: {
80
+ play: ({ canvasElement }: any) => Promise<void>;
81
+ args: {
82
+ value: string;
83
+ };
84
+ argTypes: {
85
+ onToggle: {
86
+ action: string;
87
+ };
88
+ };
89
+ decorators: ((story: any, context: any) => any)[];
90
+ render: ({ value, onChange, onToggle, }: {
91
+ value: string;
92
+ onChange: (v: string) => void;
93
+ onToggle?: (isOpen: boolean) => void;
94
+ }) => import("vue/jsx-runtime").JSX.Element;
95
+ };
96
+ export declare const OptionMoreInfoAriaDescribedBy: {
97
+ play: ({ canvasElement }: any) => Promise<void>;
98
+ args: {
99
+ value: string;
100
+ };
101
+ argTypes: {
102
+ onToggle: {
103
+ action: string;
104
+ };
105
+ };
106
+ decorators: ((story: any, context: any) => any)[];
107
+ render: ({ value, onChange, onToggle, }: {
108
+ value: string;
109
+ onChange: (v: string) => void;
110
+ onToggle?: (isOpen: boolean) => void;
111
+ }) => import("vue/jsx-runtime").JSX.Element;
112
+ };
@@ -0,0 +1,44 @@
1
+ import { ComboboxButtonProps as UIProps, ComboboxButtonLabelDisplayMode, COMPONENT_NAME, CLASSNAME } from '@lumx/core/js/components/Combobox/ComboboxButton';
2
+ import { VueToJSXProps } from '../../utils/VueToJSX';
3
+ export type ComboboxButtonProps = VueToJSXProps<UIProps, 'label'> & {
4
+ /** The label for the button (used for ARIA and tooltip). */
5
+ label: string;
6
+ /** The currently selected value to display. */
7
+ value?: string;
8
+ /** Controls how the label/value is displayed. @default 'show-selection' */
9
+ labelDisplayMode?: ComboboxButtonLabelDisplayMode;
10
+ /** Called when an option is selected. */
11
+ onSelect?: (option: {
12
+ value: string;
13
+ }) => void;
14
+ };
15
+ /**
16
+ * Combobox.Button component - Button trigger for select-only combobox mode.
17
+ *
18
+ * @param props Component props.
19
+ * @return Vue element.
20
+ */
21
+ declare const ComboboxButton: import('vue').DefineSetupFnComponent<ComboboxButtonProps, {
22
+ select: (option: {
23
+ value: string;
24
+ }) => true;
25
+ }, {}, Omit<UIProps, "className" | "label" | import('@lumx/core/js/types').PropsToOverride | "children"> & {
26
+ class?: string;
27
+ } & {
28
+ /** The label for the button (used for ARIA and tooltip). */
29
+ label: string;
30
+ /** The currently selected value to display. */
31
+ value?: string;
32
+ /** Controls how the label/value is displayed. @default 'show-selection' */
33
+ labelDisplayMode?: ComboboxButtonLabelDisplayMode;
34
+ /** Called when an option is selected. */
35
+ onSelect?: (option: {
36
+ value: string;
37
+ }) => void;
38
+ } & {
39
+ onSelect?: ((option: {
40
+ value: string;
41
+ }) => any) | undefined;
42
+ }, import('vue').PublicProps>;
43
+ export { COMPONENT_NAME, CLASSNAME };
44
+ export default ComboboxButton;
@@ -0,0 +1,68 @@
1
+ import { COMPONENT_NAME, CLASSNAME } from '@lumx/core/js/components/Combobox/ComboboxInput';
2
+ import { VueToJSXProps } from '../../utils/VueToJSX';
3
+ import { TextFieldProps } from '../text-field/TextField';
4
+ import { IconButtonProps } from '../button/IconButton';
5
+ /**
6
+ * Props for Combobox.Input component.
7
+ * Note: role, aria-autocomplete, aria-controls, aria-expanded are set internally and cannot be overridden.
8
+ */
9
+ export type ComboboxInputProps = VueToJSXProps<TextFieldProps, 'inputRef' | 'textFieldRef'> & {
10
+ /**
11
+ * Props for the toggle button.
12
+ * When provided, a chevron button will be rendered in the text field's afterElement
13
+ * to toggle the listbox visibility.
14
+ */
15
+ toggleButtonProps?: Pick<IconButtonProps, 'label'> & Partial<Omit<IconButtonProps, 'label'>>;
16
+ /** Called when an option is selected. */
17
+ onSelect?: (option: {
18
+ value: string;
19
+ }) => void;
20
+ /**
21
+ * When true (default), the combobox automatically filters options as the user types.
22
+ * Set to false when you handle filtering yourself (e.g. async search).
23
+ */
24
+ autoFilter?: boolean;
25
+ };
26
+ /**
27
+ * Combobox.Input component - wraps TextField with combobox ARIA attributes.
28
+ *
29
+ * @param props Component props.
30
+ * @return Vue element.
31
+ */
32
+ declare const ComboboxInput: import('vue').DefineSetupFnComponent<ComboboxInputProps, {
33
+ select: (option: {
34
+ value: string;
35
+ }) => true;
36
+ change: (value: string, _name?: string, _event?: Event) => boolean;
37
+ focus: (_event?: FocusEvent) => true;
38
+ blur: (_event?: FocusEvent) => true;
39
+ clear: (_event?: MouseEvent) => true;
40
+ }, {}, Omit<TextFieldProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "inputRef" | "textFieldRef"> & {
41
+ class?: string;
42
+ } & {
43
+ /**
44
+ * Props for the toggle button.
45
+ * When provided, a chevron button will be rendered in the text field's afterElement
46
+ * to toggle the listbox visibility.
47
+ */
48
+ toggleButtonProps?: Pick<IconButtonProps, "label"> & Partial<Omit<IconButtonProps, "label">>;
49
+ /** Called when an option is selected. */
50
+ onSelect?: (option: {
51
+ value: string;
52
+ }) => void;
53
+ /**
54
+ * When true (default), the combobox automatically filters options as the user types.
55
+ * Set to false when you handle filtering yourself (e.g. async search).
56
+ */
57
+ autoFilter?: boolean;
58
+ } & {
59
+ onSelect?: ((option: {
60
+ value: string;
61
+ }) => any) | undefined;
62
+ onBlur?: ((_event?: FocusEvent | undefined) => any) | undefined;
63
+ onChange?: ((value: string, _name?: string | undefined, _event?: Event | undefined) => any) | undefined;
64
+ onFocus?: ((_event?: FocusEvent | undefined) => any) | undefined;
65
+ onClear?: ((_event?: MouseEvent | undefined) => any) | undefined;
66
+ }, import('vue').PublicProps>;
67
+ export { COMPONENT_NAME, CLASSNAME };
68
+ export default ComboboxInput;
@@ -0,0 +1,15 @@
1
+ import { ComboboxListProps as UIProps, COMPONENT_NAME, CLASSNAME } from '@lumx/core/js/components/Combobox/ComboboxList';
2
+ import { VueToJSXProps } from '../../utils/VueToJSX';
3
+ export type ComboboxListProps = VueToJSXProps<UIProps, 'aria-label' | 'aria-busy' | 'id'>;
4
+ /**
5
+ * Combobox.List component - wraps List with listbox ARIA attributes.
6
+ * Registers itself as the combobox listbox on mount.
7
+ *
8
+ * @param props Component props.
9
+ * @return Vue element.
10
+ */
11
+ declare const ComboboxList: import('vue').DefineSetupFnComponent<ComboboxListProps, {}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "aria-label" | "id" | "aria-busy"> & {
12
+ class?: string;
13
+ } & {}, import('vue').PublicProps>;
14
+ export { COMPONENT_NAME, CLASSNAME };
15
+ export default ComboboxList;
@@ -0,0 +1,29 @@
1
+ import { ComboboxOptionProps as UIProps, ComboboxOptionPropsToOverride, COMPONENT_NAME, CLASSNAME } from '@lumx/core/js/components/Combobox/ComboboxOption';
2
+ import { VueToJSXProps } from '../../utils/VueToJSX';
3
+ import { TooltipProps } from '../tooltip/Tooltip';
4
+ export type ComboboxOptionProps = VueToJSXProps<UIProps, ComboboxOptionPropsToOverride | 'descriptionId' | 'hidden' | 'isGrid' | 'id'> & {
5
+ /** Props forwarded to a Tooltip wrapping the option trigger element. */
6
+ tooltipProps?: Partial<TooltipProps>;
7
+ /** On option clicked (or activated with keyboard). */
8
+ onClick?: () => void;
9
+ /** Props forwarded to the inner action element (e.g. `{ as: 'a', href: '/foo' }`). */
10
+ actionProps?: Record<string, any>;
11
+ };
12
+ /**
13
+ * Combobox.Option component - wraps ListItem with option role and data-value.
14
+ *
15
+ * @param props Component props.
16
+ * @return Vue element.
17
+ */
18
+ declare const ComboboxOption: import('vue').DefineSetupFnComponent<ComboboxOptionProps, {}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "hidden" | "id" | "descriptionId" | "isGrid" | ComboboxOptionPropsToOverride> & {
19
+ class?: string;
20
+ } & {
21
+ /** Props forwarded to a Tooltip wrapping the option trigger element. */
22
+ tooltipProps?: Partial<TooltipProps>;
23
+ /** On option clicked (or activated with keyboard). */
24
+ onClick?: () => void;
25
+ /** Props forwarded to the inner action element (e.g. `{ as: 'a', href: '/foo' }`). */
26
+ actionProps?: Record<string, any>;
27
+ } & {}, import('vue').PublicProps>;
28
+ export { COMPONENT_NAME, CLASSNAME };
29
+ export default ComboboxOption;
@@ -0,0 +1,20 @@
1
+ import { ComboboxOptionActionProps as UIProps, COMPONENT_NAME, CLASSNAME } from '@lumx/core/js/components/Combobox/ComboboxOptionAction';
2
+ import { VueToJSXProps } from '../../utils/VueToJSX';
3
+ export type ComboboxOptionActionProps = Pick<VueToJSXProps<UIProps>, 'isDisabled' | 'class'> & {
4
+ /** On click callback. */
5
+ onClick?: (evt: MouseEvent) => void;
6
+ };
7
+ /**
8
+ * Combobox.OptionAction sub-component.
9
+ *
10
+ * Renders a secondary action button within a combobox option row (grid mode).
11
+ *
12
+ * @param props Component props.
13
+ * @return Vue element.
14
+ */
15
+ declare const ComboboxOptionAction: import('vue').DefineSetupFnComponent<ComboboxOptionActionProps, {}, {}, Pick<VueToJSXProps<UIProps>, "isDisabled" | "class"> & {
16
+ /** On click callback. */
17
+ onClick?: (evt: MouseEvent) => void;
18
+ } & {}, import('vue').PublicProps>;
19
+ export { COMPONENT_NAME, CLASSNAME };
20
+ export default ComboboxOptionAction;