@iris-ui-kit/vue 0.2.29 → 0.2.30

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 (53) hide show
  1. package/dist/admin.cjs +29 -3
  2. package/dist/admin.cjs.map +1 -1
  3. package/dist/admin.js +3 -3
  4. package/dist/{chunk-X7Y35UUL.js → chunk-3547J6IN.js} +3 -3
  5. package/dist/{chunk-X7Y35UUL.js.map → chunk-3547J6IN.js.map} +1 -1
  6. package/dist/{chunk-BVKOOTXG.js → chunk-IAG64CHL.js} +3 -3
  7. package/dist/chunk-IAG64CHL.js.map +1 -0
  8. package/dist/{chunk-KSJZLFAT.js → chunk-MO7AAXA6.js} +6 -6
  9. package/dist/chunk-MO7AAXA6.js.map +1 -0
  10. package/dist/{chunk-EZUDM4TM.js → chunk-PT6X4543.js} +31 -5
  11. package/dist/chunk-PT6X4543.js.map +1 -0
  12. package/dist/{chunk-W3JMJVEK.js → chunk-TCAXRWT6.js} +3 -3
  13. package/dist/chunk-TCAXRWT6.js.map +1 -0
  14. package/dist/{chunk-KAOPZNZF.js → chunk-UPC4GN3F.js} +3 -3
  15. package/dist/chunk-UPC4GN3F.js.map +1 -0
  16. package/dist/{chunk-X5UOY4IV.js → chunk-W64OMUBD.js} +3 -3
  17. package/dist/{chunk-X5UOY4IV.js.map → chunk-W64OMUBD.js.map} +1 -1
  18. package/dist/{chunk-OH4YSGFK.js → chunk-ZTPIXL7Q.js} +3 -3
  19. package/dist/chunk-ZTPIXL7Q.js.map +1 -0
  20. package/dist/error-boundary.cjs +1 -1
  21. package/dist/error-boundary.cjs.map +1 -1
  22. package/dist/error-boundary.js +2 -2
  23. package/dist/form.cjs +1 -1
  24. package/dist/form.cjs.map +1 -1
  25. package/dist/form.js +1 -1
  26. package/dist/i18n.cjs +1 -1
  27. package/dist/i18n.cjs.map +1 -1
  28. package/dist/i18n.js +1 -1
  29. package/dist/index.cjs +437 -42
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +28 -3
  32. package/dist/index.d.ts +28 -3
  33. package/dist/index.js +416 -47
  34. package/dist/index.js.map +1 -1
  35. package/dist/provider.cjs +4 -4
  36. package/dist/provider.cjs.map +1 -1
  37. package/dist/provider.js +4 -4
  38. package/dist/skeletons.cjs +1 -1
  39. package/dist/skeletons.cjs.map +1 -1
  40. package/dist/skeletons.js +2 -2
  41. package/dist/skins.cjs +1 -1
  42. package/dist/skins.cjs.map +1 -1
  43. package/dist/skins.js +1 -1
  44. package/dist/theme.cjs +1 -1
  45. package/dist/theme.cjs.map +1 -1
  46. package/dist/theme.js +1 -1
  47. package/package.json +15 -15
  48. package/dist/chunk-BVKOOTXG.js.map +0 -1
  49. package/dist/chunk-EZUDM4TM.js.map +0 -1
  50. package/dist/chunk-KAOPZNZF.js.map +0 -1
  51. package/dist/chunk-KSJZLFAT.js.map +0 -1
  52. package/dist/chunk-OH4YSGFK.js.map +0 -1
  53. package/dist/chunk-W3JMJVEK.js.map +0 -1
package/dist/admin.js CHANGED
@@ -1,11 +1,11 @@
1
- export { IrisAdminBreadcrumb, IrisAdminLayout, IrisAdminTabs, IrisNavMenu, createAdminPreferences, createTabsNav, filterNavByAccess, findNavNode, findNavPath, firstLeaf, flattenNav, isBranch, isClosable, localStorageAdminPreferencesStorage, nodeAllowsRoles, useAdminPreferences, useAdminShell, useTabsNav, visibleNav } from './chunk-EZUDM4TM.js';
1
+ export { IrisAdminBreadcrumb, IrisAdminLayout, IrisAdminTabs, IrisNavMenu, createAdminPreferences, createTabsNav, filterNavByAccess, findNavNode, findNavPath, firstLeaf, flattenNav, isBranch, isClosable, localStorageAdminPreferencesStorage, nodeAllowsRoles, useAdminPreferences, useAdminShell, useTabsNav, visibleNav } from './chunk-PT6X4543.js';
2
2
  import './chunk-IPR5JAVF.js';
3
3
  import './chunk-NNOF7KUH.js';
4
4
  import './chunk-F77KIPOH.js';
5
5
  import './chunk-3V46HGRC.js';
6
- import './chunk-OH4YSGFK.js';
6
+ import './chunk-ZTPIXL7Q.js';
7
7
  import './chunk-W3B6E5GN.js';
8
8
  import './chunk-75GSYEJS.js';
9
- import './chunk-W3JMJVEK.js';
9
+ import './chunk-TCAXRWT6.js';
10
10
  //# sourceMappingURL=admin.js.map
11
11
  //# sourceMappingURL=admin.js.map
@@ -1,4 +1,4 @@
1
- import { useI18n } from './chunk-W3JMJVEK.js';
1
+ import { useI18n } from './chunk-TCAXRWT6.js';
2
2
  import { defineComponent, ref, getCurrentInstance, onErrorCaptured, h } from 'vue';
3
3
 
4
4
  var IrisErrorBoundary = defineComponent({
@@ -75,5 +75,5 @@ var IrisErrorBoundary = defineComponent({
75
75
  });
76
76
 
77
77
  export { IrisErrorBoundary };
78
- //# sourceMappingURL=chunk-X7Y35UUL.js.map
79
- //# sourceMappingURL=chunk-X7Y35UUL.js.map
78
+ //# sourceMappingURL=chunk-3547J6IN.js.map
79
+ //# sourceMappingURL=chunk-3547J6IN.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/error-boundary/IrisErrorBoundary.ts"],"names":[],"mappings":";;;AA0CO,IAAM,oBAAoB,eAAA,CAAgB;AAAA,EAC/C,IAAA,EAAM,mBAAA;AAAA,EACN,YAAA,EAAc,KAAA;AAAA,EACd,KAAA,EAAO;AAAA,IACL,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,QAAA;AAAA,MACN,OAAA,EAAS;AAAA,KACX;AAAA,IACA,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,QAAA;AAAA,MACN,OAAA,EAAS;AAAA;AACX,GACF;AAAA,EACA,KAAA,CAAM,KAAA,EAAO,EAAE,KAAA,EAAO,OAAM,EAAG;AAC7B,IAAA,MAAM,EAAE,CAAA,EAAE,GAAI,OAAA,EAAQ;AACtB,IAAA,MAAM,KAAA,GAAQ,IAAa,IAAI,CAAA;AAG/B,IAAA,MAAM,UAAA,GAAa,oBAAmB,CAAG,UAAA;AAEzC,IAAA,MAAM,QAAQ,MAAM;AAClB,MAAA,KA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AqB;AAAA;AACzB;AACF,OACF;AAAA,IACF,CAAA;AAEA,IAAA,OAAO,MAAM;AACX,MAAA,IAAI,KAAA,CAAM,UAAU,IAAA,EAAM;AACxB,QAAA,MAAM,MAAA,GAAS,KAAA,CAAM,QAAA,IAAY,KAAA,CAAM,QAAA;AACvC,QAAA,IAAI,MAAA,EAAQ;AACV,UAAA,OAAO,OAAO,EAAE,KAAA,EAAO,KAAA,CAAM,KAAA,EAAO,OAAO,CAAA;AAAA,QAC7C;AACA,QAAA,OAAO,qBAAA,EAAsB;AAAA,MAC/B;AACA,MAAA,OAAO,MAAM,OAAA,IAAU;AAAA,IACzB,CAAA;AAAA,EACF;AACF,CAAC","file":"chunk-X7Y35UUL.js","sourcesContent":["import {\n defineComponent,\n getCurrentInstance,\n h,\n onErrorCaptured,\n ref,\n type PropType,\n type VNode,\n} from 'vue'\nimport { useI18n } from '../i18n'\n\n/** Render-customization payload handed to the `#fallback` slot / `fallback` prop. */\nexport interface IrisErrorBoundaryFallbackProps {\n /** The error caught while rendering the guarded subtree. */\n error: unknown\n /** Clears the error and re-attempts rendering the children. */\n reset: () => void\n}\n\n/** Public prop surface of {@link IrisErrorBoundary}. */\nexport interface IrisErrorBoundaryProps {\n /**\n * Custom fallback renderer. Receives `{ error, reset }` and returns the\n * fallback UI. A `#fallback` scoped slot takes precedence when both are given.\n * When neither is supplied the themed DEFAULT fallback renders.\n */\n fallback?: (props: IrisErrorBoundaryFallbackProps) => VNode | VNode[] | string\n /** Invoked with the caught error (and Vue's error-info string) for logging. */\n onError?: (error: unknown, info?: string) => void\n}\n\n/**\n * IrisErrorBoundary: catches errors thrown while rendering its guarded subtree\n * (default slot), switches to a fallback, and exposes `reset()` to clear the\n * error and re-attempt rendering. Catching does NOT rethrow — a single broken\n * subtree no longer crashes the whole tree.\n *\n * Customize via a `#fallback` scoped slot or the `fallback` prop, each receiving\n * `{ error, reset }`. Without either, a themed, accessible (`role=\"alert\"`)\n * default fallback shows the error message + a retry button, i18n'd through\n * `useI18n()` (English defaults without a provider).\n */\nexport const IrisErrorBoundary = defineComponent({\n name: 'IrisErrorBoundary',\n inheritAttrs: false,\n props: {\n fallback: {\n type: Function as PropType<IrisErrorBoundaryProps['fallback']>,\n default: undefined,\n },\n onError: {\n type: Function as PropType<IrisErrorBoundaryProps['onError']>,\n default: undefined,\n },\n },\n setup(props, { attrs, slots }) {\n const { t } = useI18n()\n const error = ref<unknown>(null)\n // App-level telemetry handler (Sentry/…). Read live so a handler\n // configured after this component's setup is still picked up.\n const appContext = getCurrentInstance()!.appContext\n\n const reset = () => {\n error.value = null\n }\n\n onErrorCaptured((err, instance, info) => {\n error.value = err\n props.onError?.(err, info)\n // Vue's handleError skips its app.config.errorHandler branch when a hook\n // returns false, so forward explicitly with the exact args Vue would\n // have passed — (err, exposedInstance, errorInfo). Guarded so a throwing\n // handler is logged, not rethrown: a bare call would escape containment\n // from inside the hook and re-enter handleError with the handler's own\n // error (Vue's own path wraps the handler in callWithErrorHandling).\n try {\n appContext.config.errorHandler?.(err, instance, info)\n } catch (handlerError) {\n console.error(handlerError)\n }\n // Stop further propagation so the error does not crash the parent tree.\n return false\n })\n\n const renderDefaultFallback = (): VNode => {\n const message =\n error.value instanceof Error && error.value.message\n ? error.value.message\n : t('errorBoundary.message')\n\n return h(\n 'div',\n {\n ...attrs,\n 'data-iris-error-boundary': '',\n role: 'alert',\n style: {\n padding: '16px',\n border: '1px solid var(--iris-danger)',\n borderRadius: 'var(--iris-radius-md, 6px)',\n color: 'var(--iris-danger)',\n ...((attrs.style as Record<string, string> | undefined) ?? {}),\n },\n },\n [\n h('div', { 'data-iris-error-boundary-message': '' }, message),\n h(\n 'button',\n {\n type: 'button',\n 'data-iris-error-boundary-retry': '',\n onClick: reset,\n },\n t('errorBoundary.retry'),\n ),\n ],\n )\n }\n\n return () => {\n if (error.value !== null) {\n const custom = slots.fallback ?? props.fallback\n if (custom) {\n return custom({ error: error.value, reset })\n }\n return renderDefaultFallback()\n }\n return slots.default?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A,CAAM,KAAA,CAAM,OAAA,GACZ,CAAA,CAAE,uBAAuB,CAAA;AAE/B,MAAA,OAAO,CAAA;AAAA,QACL,KAAA;AAAA,QACA;AAAA,UACE,GAAG,KAAA;AAAA,UACH,0BAAA,EAA4B,EAAA;AAAA,UAC5B,IAAA,EAAM,OAAA;AAAA,UACN,KAAA,EAAO;AAAA,YACL,OAAA,EAAS,MAAA;AAAA,YACT,MAAA,EAAQ,8BAAA;AAAA,YACR,YAAA,EAAc,4BAAA;AAAA,YACd,KAAA,EAAO,oBAAA;AAAA,YACP,GAAK,KAAA,CAAM,KAAA,IAAgD;AAAC;AAC9D,SACF;AAAA,QACA;AAAA,UACE,EAAE,KAAA,EAAO,EAAE,kCAAA,EAAoC,EAAA,IAAM,OAAO,CAAA;AAAA,UAC5D,CAAA;AAAA,YACE,QAAA;AAAA,YACA;AAAA,cACE,IAAA,EAAM,QAAA;AAAA,cACN,gCAAA,EAAkC,EAAA;AAAA,cAClC,OAAA,EAAS;AAAA,aACX;AAAA,YACA,EAAE,qBAAqB;AAAA;AACzB;AACF,OACF;AAAA,IACF,CAAA;AAEA,IAAA,OAAO,MAAM;AACX,MAAA,IAAI,KAAA,CAAM,UAAU,IAAA,EAAM;AACxB,QAAA,MAAM,MAAA,GAAS,KAAA,CAAM,QAAA,IAAY,KAAA,CAAM,QAAA;AACvC,QAAA,IAAI,MAAA,EAAQ;AACV,UAAA,OAAO,OAAO,EAAE,KAAA,EAAO,KAAA,CAAM,KAAA,EAAO,OAAO,CAAA;AAAA,QAC7C;AACA,QAAA,OAAO,qBAAA,EAAsB;AAAA,MAC/B;AACA,MAAA,OAAO,MAAM,OAAA,IAAU;AAAA,IACzB,CAAA;AAAA,EACF;AACF,CAAC","file":"chunk-3547J6IN.js","sourcesContent":["import {\n defineComponent,\n getCurrentInstance,\n h,\n onErrorCaptured,\n ref,\n type PropType,\n type VNode,\n} from 'vue'\nimport { useI18n } from '../i18n'\n\n/** Render-customization payload handed to the `#fallback` slot / `fallback` prop. */\nexport interface IrisErrorBoundaryFallbackProps {\n /** The error caught while rendering the guarded subtree. */\n error: unknown\n /** Clears the error and re-attempts rendering the children. */\n reset: () => void\n}\n\n/** Public prop surface of {@link IrisErrorBoundary}. */\nexport interface IrisErrorBoundaryProps {\n /**\n * Custom fallback renderer. Receives `{ error, reset }` and returns the\n * fallback UI. A `#fallback` scoped slot takes precedence when both are given.\n * When neither is supplied the themed DEFAULT fallback renders.\n */\n fallback?: (props: IrisErrorBoundaryFallbackProps) => VNode | VNode[] | string\n /** Invoked with the caught error (and Vue's error-info string) for logging. */\n onError?: (error: unknown, info?: string) => void\n}\n\n/**\n * IrisErrorBoundary: catches errors thrown while rendering its guarded subtree\n * (default slot), switches to a fallback, and exposes `reset()` to clear the\n * error and re-attempt rendering. Catching does NOT rethrow — a single broken\n * subtree no longer crashes the whole tree.\n *\n * Customize via a `#fallback` scoped slot or the `fallback` prop, each receiving\n * `{ error, reset }`. Without either, a themed, accessible (`role=\"alert\"`)\n * default fallback shows the error message + a retry button, i18n'd through\n * `useI18n()` (English defaults without a provider).\n */\nexport const IrisErrorBoundary = defineComponent({\n name: 'IrisErrorBoundary',\n inheritAttrs: false,\n props: {\n fallback: {\n type: Function as PropType<IrisErrorBoundaryProps['fallback']>,\n default: undefined,\n },\n onError: {\n type: Function as PropType<IrisErrorBoundaryProps['onError']>,\n default: undefined,\n },\n },\n setup(props, { attrs, slots }) {\n const { t } = useI18n()\n const error = ref<unknown>(null)\n // App-level telemetry handler (Sentry/…). Read live so a handler\n // configured after this component's setup is still picked up.\n const appContext = getCurrentInstance()!.appContext\n\n const reset = () => {\n error.value = null\n }\n\n onErrorCaptured((err, instance, info) => {\n error.value = err\n props.onError?.(err, info)\n // Vue's handleError skips its app.config.errorHandler branch when a hook\n // returns false, so forward explicitly with the exact args Vue would\n // have passed — (err, exposedInstance, errorInfo). Guarded so a throwing\n // handler is logged, not rethrown: a bare call would escape containment\n // from inside the hook and re-enter handleError with the handler's own\n // error (Vue's own path wraps the handler in callWithErrorHandling).\n try {\n appContext.config.errorHandler?.(err, instance, info)\n } catch (handlerError) {\n console.error(handlerError)\n }\n // Stop further propagation so the error does not crash the parent tree.\n return false\n })\n\n const renderDefaultFallback = (): VNode => {\n const message =\n error.value instanceof Error && error.value.message\n ? error.value.message\n : t('errorBoundary.message')\n\n return h(\n 'div',\n {\n ...attrs,\n 'data-iris-error-boundary': '',\n role: 'alert',\n style: {\n padding: '16px',\n border: '1px solid var(--iris-danger)',\n borderRadius: 'var(--iris-radius-md, 6px)',\n color: 'var(--iris-danger)',\n ...((attrs.style as Record<string, string> | undefined) ?? {}),\n },\n },\n [\n h('div', { 'data-iris-error-boundary-message': '' }, message),\n h(\n 'button',\n {\n type: 'button',\n 'data-iris-error-boundary-retry': '',\n onClick: reset,\n },\n t('errorBoundary.retry'),\n ),\n ],\n )\n }\n\n return () => {\n if (error.value !== null) {\n const custom = slots.fallback ?? props.fallback\n if (custom) {\n return custom({ error: error.value, reset })\n }\n return renderDefaultFallback()\n }\n return slots.default?.()\n }\n },\n})\n"]}
@@ -2,7 +2,7 @@ import { useStore, useStoreSelector } from './chunk-75GSYEJS.js';
2
2
  import { defineComponent, provide, ref, h, inject, computed } from 'vue';
3
3
  import { createFormStore, formatPath, parsePath, getByPath } from '@iris-ui-kit/core';
4
4
 
5
- var FormInjectionKey = Symbol("IrisForm");
5
+ var FormInjectionKey = /* @__PURE__ */ Symbol("IrisForm");
6
6
  function useFormContext() {
7
7
  const form = inject(FormInjectionKey, null);
8
8
  if (!form) {
@@ -126,5 +126,5 @@ function useFieldArray(name) {
126
126
  }
127
127
 
128
128
  export { FormInjectionKey, IrisForm, useField, useFieldArray, useForm, useFormContext };
129
- //# sourceMappingURL=chunk-BVKOOTXG.js.map
130
- //# sourceMappingURL=chunk-BVKOOTXG.js.map
129
+ //# sourceMappingURL=chunk-IAG64CHL.js.map
130
+ //# sourceMappingURL=chunk-IAG64CHL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/form/context.ts","../src/form/Form.ts","../src/form/useForm.ts","../src/form/useField.ts","../src/form/useFieldArray.ts"],"names":["computed","touched"],"mappings":";;;;AAQO,IAAM,gBAAA,0BAA+D,UAAU;AAE/E,SAAS,cAAA,GAAwC;AACtD,EAAA,MAAM,IAAA,GAAO,MAAA,CAAO,gBAAA,EAAkB,IAAI,CAAA;AAC1C,EAAA,IAAI,CAAC,IAAA,EAAM;AACT,IAAA,MAAM,IAAI,MAAM,6DAA6D,CAAA;AAAA,EAC/E;AACA,EAAA,OAAO,IAAA;AACT;;;ACXA,SAAS,eAAA,CACP,QACA,MAAA,EACM;AACN,EAAA,IAAI,CAAC,MAAA,EAAQ;AACb,EAAA,MAAM,IAAA,GAAO,MAAA,CAAO,IAAA,CAAK,MAAM,CAAA;AAC/B,EAAA,IAAI,IAAA,CAAK,WAAW,CAAA,EAAG;AACvB,EAAA,MAAM,WAAW,MAAA,CAAO,gBAAA;AAAA,IACtB;AAAA,GACF;AACA,EAAA,KAAA,MAAW,EAAA,IAAM,KAAA,CAAM,IAAA,CAAK,QAAQ,CAAA,EAAG;AACrC,IAAA,MAAM,OAAO,EAAA,CAAG,YAAA,CAAa,MAAM,CAAA,IAAK,EAAA,CAAG,aAAa,iBAAiB,CAAA;AACzE,IAAA,IAAI,IAAA,IAAQ,IAAA,CAAK,QAAA,CAAS,IAAI,CAAA,EAAG;AAC/B,MAAA,EAAA,CAAG,KAAA,EAAM;AACT,MAAA,IAAI;AACF,QAAA,EAAA,CAAG,cAAA,CAAe,EAAE,KAAA,EAAO,QAAA,EAAU,CAAA;AAAA,MACvC,CAAA,CAAA,MAAQ;AAAA,MAER;AACA,MAAA;AAAA,IACF;AAAA,EACF;AACF;AAaO,IAAM,WAAW,eAAA,CAAgB;AAAA,EACtC,IAAA,EAAM,UAAA;AAAA,EACN,KAAA,EAAO;AAAA;AAAA,IAEL,IAAA,EAAM;AAAA,MACJ,IAAA,EAAM,MAAA;AAAA,MACN,QAAA,EAA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CAAQ,GAAA,CAAI,KAAK,CAAA,GAAI,GAAA,CAAI,KAAA,GAAQ,EAAU,CAAA;AAEhF,EAAA,OAAO;AAAA,IACL,IAAA;AAAA,IACA,MAAA;AAAA,IACA,MAAM,CAAC,IAAA,KAAS,IAAA,CAAK,SAAA,CAAU,MAAe,IAAa,CAAA;AAAA,IAC3D,QAAQ,CAAC,KAAA,KAAU,IAAA,CAAK,WAAA,CAAY,MAAe,KAAK,CAAA;AAAA,IACxD,MAAA,EAAQ,CAAC,KAAA,EAAO,IAAA,KAAS,KAAK,WAAA,CAAY,IAAA,EAAe,OAAO,IAAa,CAAA;AAAA,IAC7E,IAAA,EAAM,CAAC,IAAA,EAAM,EAAA,KAAO,KAAK,SAAA,CAAU,IAAA,EAAe,MAAM,EAAE,CAAA;AAAA,IAC1D,SAAS,CAAC,KAAA,KAAU,IAAA,CAAK,aAAA,CAAc,MAAM,KAAc;AAAA,GAC7D;AACF","file":"chunk-IAG64CHL.js","sourcesContent":["import { inject, type InjectionKey } from 'vue'\nimport type { FormStore, FormValues } from '@iris-ui-kit/core'\n\n/**\n * Provides the active form's {@link FormStore} to descendant fields so\n * `useField` can bind without prop drilling. The generic is erased at the\n * injection boundary; `useField<T>` re-applies the value type at the call site.\n */\nexport const FormInjectionKey: InjectionKey<FormStore<FormValues>> = Symbol('IrisForm')\n\nexport function useFormContext(): FormStore<FormValues> {\n const form = inject(FormInjectionKey, null)\n if (!form) {\n throw new Error('useField / useFormContext must be used within an <IrisForm>')\n }\n return form\n}\n","import { defineComponent, h, provide, ref, type PropType } from 'vue'\nimport type { FormStore, FormValues } from '@iris-ui-kit/core'\nimport { FormInjectionKey } from './context'\n\n/** Focus (and best-effort scroll to) the first errored named control in DOM order. */\nfunction focusFirstError(\n formEl: HTMLElement | null,\n errors: Record<string, string | undefined>,\n): void {\n if (!formEl) return\n const keys = Object.keys(errors)\n if (keys.length === 0) return\n const controls = formEl.querySelectorAll<HTMLElement>(\n 'input[name], select[name], textarea[name], [data-iris-field]',\n )\n for (const el of Array.from(controls)) {\n const name = el.getAttribute('name') ?? el.getAttribute('data-iris-field')\n if (name && keys.includes(name)) {\n el.focus()\n try {\n el.scrollIntoView({ block: 'center' })\n } catch {\n /* scrollIntoView is unavailable in jsdom — focus is the contract */\n }\n return\n }\n }\n}\n\n/**\n * Provides the form store to descendant `useField` calls and wires the native\n * `<form>` submit to `handleSubmit` (with `preventDefault`). Composition:\n *\n * ```html\n * <IrisForm :form=\"f.form\">\n * <IrisFormField label=\"Email\"><IrisInput v-bind=\"email.fieldProps.value\" /></IrisFormField>\n * <IrisButton type=\"submit\" :disabled=\"f.isSubmitting.value\">Save</IrisButton>\n * </IrisForm>\n * ```\n */\nexport const IrisForm = defineComponent({\n name: 'IrisForm',\n props: {\n /** The store from `useForm(...).form`. */\n form: {\n type: Object as PropType<FormStore<FormValues>>,\n required: true,\n },\n },\n setup(props, { slots }) {\n provide(FormInjectionKey, props.form)\n const formRef = ref<HTMLElement | null>(null)\n return () =>\n h(\n 'form',\n {\n ref: formRef,\n 'data-iris-form': '',\n onSubmit: (event: Event) => {\n event.preventDefault()\n // On a failed submit, move focus to the first errored field (a11y).\n void props.form\n .handleSubmit()\n .then(() => focusFirstError(formRef.value, props.form.getState().errors))\n },\n },\n slots.default?.(),\n )\n },\n})\n","import { computed, type ComputedRef, type Ref } from 'vue'\nimport {\n createFormStore,\n type FieldErrors,\n type FieldFlags,\n type FormConfig,\n type FormState,\n type FormStore,\n type FormValues,\n} from '@iris-ui-kit/core'\nimport { useStore } from '../useStore'\n\nexport interface UseFormReturn<V extends FormValues> {\n /** The form store — pass to `<IrisForm :form=\"...\">`. */\n form: FormStore<V>\n /** The full reactive state snapshot. */\n state: Ref<FormState<V>>\n values: ComputedRef<V>\n errors: ComputedRef<FieldErrors<V>>\n touched: ComputedRef<FieldFlags<V>>\n dirty: ComputedRef<FieldFlags<V>>\n isSubmitting: ComputedRef<boolean>\n isValidating: ComputedRef<boolean>\n submitCount: ComputedRef<number>\n isValid: ComputedRef<boolean>\n setFieldValue: FormStore<V>['setFieldValue']\n setValues: FormStore<V>['setValues']\n setFieldTouched: FormStore<V>['setFieldTouched']\n setFieldError: FormStore<V>['setFieldError']\n setErrors: FormStore<V>['setErrors']\n validateField: FormStore<V>['validateField']\n validateForm: FormStore<V>['validateForm']\n handleSubmit: FormStore<V>['handleSubmit']\n reset: FormStore<V>['reset']\n}\n\n/**\n * Vue binding for the framework-agnostic form engine. Creates the store in\n * `setup()` (runs once) and bridges it into Vue reactivity via `useStore` (a\n * shallow snapshot ref updated on each store change, detached on scope\n * dispose). Because `setup` runs once,\n * `onSubmit` / `validate` closures stay live against reactive state — no\n * stale-callback handling is needed (unlike the React adapter).\n */\nexport function useForm<V extends FormValues>(config: FormConfig<V>): UseFormReturn<V> {\n const form = createFormStore(config)\n\n // Whole-state bridge via the shared `useStore` (shallow, detached on scope\n // dispose — identical to the old `onBeforeUnmount` for setup-scope consumers,\n // and correct for nested scopes too). The published `state: Ref<FormState<V>>`\n // type is unchanged (R5); the runtime is a shallow snapshot — the store is the\n // only write path (it always was), so this localized cast is type-only. The\n // per-field narrowing payoff comes from `useField` / `useFieldArray`; the\n // form-level computeds below are whole-form aggregates by design.\n const state = useStore(form.store) as unknown as Ref<FormState<V>>\n\n return {\n form,\n state,\n values: computed(() => state.value.values),\n errors: computed(() => state.value.errors),\n touched: computed(() => state.value.touched),\n dirty: computed(() => state.value.dirty),\n isSubmitting: computed(() => state.value.isSubmitting),\n isValidating: computed(() => state.value.isValidating),\n submitCount: computed(() => state.value.submitCount),\n isValid: computed(() => Object.keys(state.value.errors).length === 0),\n setFieldValue: form.setFieldValue,\n setValues: form.setValues,\n setFieldTouched: form.setFieldTouched,\n setFieldError: form.setFieldError,\n setErrors: form.setErrors,\n validateField: form.validateField,\n validateForm: form.validateForm,\n handleSubmit: form.handleSubmit,\n reset: form.reset,\n }\n}\n","import { computed, type ComputedRef } from 'vue'\nimport { formatPath, getByPath, parsePath } from '@iris-ui-kit/core'\nimport { useFormContext } from './context'\nimport { useStoreSelector } from '../useStore'\n\nexport interface FieldBindProps {\n modelValue: unknown\n 'onUpdate:modelValue': (value: unknown) => void\n invalid: boolean\n onBlur: () => void\n}\n\nexport interface UseFieldReturn<T> {\n name: string\n value: ComputedRef<T>\n error: ComputedRef<string | undefined>\n touched: ComputedRef<boolean>\n dirty: ComputedRef<boolean>\n setValue: (value: T) => void\n setTouched: (touched?: boolean) => void\n /**\n * Bundle for `v-bind` onto a v-model'd Iris control (`IrisInput`,\n * `IrisSelect`, …): wires `modelValue` / `update:modelValue` / `invalid` /\n * `blur`. Use `value` + `setValue` directly for bespoke bindings.\n */\n fieldProps: ComputedRef<FieldBindProps>\n}\n\n/**\n * Binds a single field to the surrounding `<IrisForm>`. `T` is the value type\n * at the call site (the injection erases the form's generic).\n *\n * `name` may be a flat top-level key OR a nested PATH (`'address.city'`,\n * `'items[2].sku'`); a flat key is a 1-segment path and stays back-compatible\n * (v3 R19).\n */\nexport function useField<T = unknown>(name: string): UseFieldReturn<T> {\n const form = useFormContext()\n\n // Canonical key for per-field state lookups (a flat key maps to itself).\n const key = formatPath(name)\n // Hoisted once — selectors run on every store emission (core `subscribeWith`).\n const segments = parsePath(name)\n\n // Four narrow per-field slices, each Object.is-gated by core `subscribeWith`.\n // Core writes use structural sharing (`setByPath`, per-key flag spread-copies),\n // so an unrelated keystroke does NOT move these refs and this field's computeds\n // do not invalidate (previously a whole-form deep `ref` re-ran every field's\n // computeds on every emission). Selectors are allocation-free by construction.\n const valueSlice = useStoreSelector(form.store, (s) => getByPath(s.values, segments) as T)\n const errorSlice = useStoreSelector(form.store, (s) => s.errors[key])\n const touchedSlice = useStoreSelector(form.store, (s) => Boolean(s.touched[key]))\n const dirtySlice = useStoreSelector(form.store, (s) => Boolean(s.dirty[key]))\n\n // computed wrappers keep the published ComputedRef<T> member types exactly as\n // declared (a bare shallow ref is not assignable to ComputedRef in Vue 3.4+),\n // and each computed invalidates only when its own slice actually moves.\n const value = computed(() => valueSlice.value)\n const error = computed(() => errorSlice.value)\n const touched = computed(() => touchedSlice.value)\n const dirty = computed(() => dirtySlice.value)\n\n return {\n name,\n value,\n error,\n touched,\n dirty,\n setValue: (next) => form.setFieldValue(name, next as never),\n setTouched: (touched = true) => form.setFieldTouched(name, touched),\n fieldProps: computed(() => ({\n modelValue: value.value,\n 'onUpdate:modelValue': (next: unknown) => form.setFieldValue(name, next as never),\n invalid: Boolean(error.value),\n onBlur: () => form.setFieldTouched(name, true),\n })),\n }\n}\n","import { computed, type ComputedRef } from 'vue'\nimport { useFormContext } from './context'\nimport { useStoreSelector } from '../useStore'\n\nexport interface UseFieldArrayReturn<T> {\n name: string\n /** Current array value (reactive). */\n fields: ComputedRef<T[]>\n /** Append an item. */\n push: (item: T) => void\n /** Remove the item at `index`. */\n remove: (index: number) => void\n /** Insert `item` at `index` (shifting the rest right). */\n insert: (index: number, item: T) => void\n /** Move the item from `from` to `to`. */\n move: (from: number, to: number) => void\n /** Replace the whole array. */\n replace: (items: T[]) => void\n}\n\n/**\n * Manage a dynamic array field (repeatable rows) inside an `<IrisForm>`. Mutators\n * delegate to the core {@link FormStore} array helpers (`arrayPush`/`arrayInsert`/\n * `arrayRemove`/`arrayMove`), which RE-KEY each element's error/touched/dirty/\n * validating state across the mutation — so a row's per-element validation state\n * FOLLOWS the row when rows are removed or reordered (removing `items[0]` shifts\n * `items[2]`'s error down to `items[1]`). `replace` swaps the whole array.\n */\nexport function useFieldArray<T = unknown>(name: string): UseFieldArrayReturn<T> {\n const form = useFormContext()\n\n // One narrow slice for the whole array, Object.is-gated by core `subscribeWith`.\n // CRITICAL: the selector must not allocate — `(s) => s.values[name] ?? []` would\n // mint a fresh [] per emission and defeat the Object.is gate — so the `[]`\n // fallback lives in the computed wrapper (re-evaluated only when the raw slice\n // moves). Array mutations produce a fresh array (correct re-render); untouched\n // rows are unaffected.\n const raw = useStoreSelector(form.store, (s) => s.values[name])\n const fields = computed(() => (Array.isArray(raw.value) ? raw.value : []) as T[])\n\n return {\n name,\n fields,\n push: (item) => form.arrayPush(name as never, item as never),\n remove: (index) => form.arrayRemove(name as never, index),\n insert: (index, item) => form.arrayInsert(name as never, index, item as never),\n move: (from, to) => form.arrayMove(name as never, from, to),\n replace: (items) => form.setFieldValue(name, items as never),\n }\n}\n"]}
@@ -1,12 +1,12 @@
1
- import { SkinProvider } from './chunk-KAOPZNZF.js';
2
- import { ThemeProvider } from './chunk-OH4YSGFK.js';
3
- import { IrisI18nProvider } from './chunk-W3JMJVEK.js';
1
+ import { SkinProvider } from './chunk-UPC4GN3F.js';
2
+ import { ThemeProvider } from './chunk-ZTPIXL7Q.js';
3
+ import { IrisI18nProvider } from './chunk-TCAXRWT6.js';
4
4
  import { defineComponent, shallowRef, shallowReactive, provide, onMounted, watch, onBeforeUnmount, h, inject } from 'vue';
5
5
  import { runPlugins } from '@iris-ui-kit/core';
6
6
  import { applyCssVars } from '@iris-ui-kit/theme';
7
7
 
8
8
  // src/provider/context.ts
9
- var PluginStoreContextKey = Symbol("IrisPluginStore");
9
+ var PluginStoreContextKey = /* @__PURE__ */ Symbol("IrisPluginStore");
10
10
 
11
11
  // src/provider/IrisProvider.ts
12
12
  var DEFAULT_LOCALE = "en-US";
@@ -119,5 +119,5 @@ function usePluginStore(nsOrKey, key) {
119
119
  }
120
120
 
121
121
  export { IrisProvider, PluginStoreContextKey, usePlugin, usePluginStore };
122
- //# sourceMappingURL=chunk-KSJZLFAT.js.map
123
- //# sourceMappingURL=chunk-KSJZLFAT.js.map
122
+ //# sourceMappingURL=chunk-MO7AAXA6.js.map
123
+ //# sourceMappingURL=chunk-MO7AAXA6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/provider/context.ts","../src/provider/IrisProvider.ts","../src/provider/hooks.ts"],"names":[],"mappings":";;;;;;;;AAiBO,IAAM,qBAAA,0BAAiE,iBAAiB;;;ACG/F,IAAM,cAAA,GAAiB,OAAA;AA4BhB,IAAM,eAAe,eAAA,CAA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AAA,mFAAA;AAAA,GAEpC;AACF","file":"chunk-MO7AAXA6.js","sourcesContent":["import { type InjectionKey } from 'vue'\n\n/**\n * Shape carried by the plugin-store context: the live store instances collected\n * from every installed plugin, plus the set of installed plugin names. Surfaced\n * to descendants through `usePluginStore` / `usePlugin`.\n */\nexport interface PluginStoreContext {\n stores: Map<string, unknown>\n installed: Set<string>\n}\n\n/**\n * Injection key for the {@link PluginStoreContext}. The name ends in `Key` (and\n * the type in `Context`) so the manifest's discover step never mistakes it for a\n * component export.\n */\nexport const PluginStoreContextKey: InjectionKey<PluginStoreContext> = Symbol('IrisPluginStore')\n","import {\n defineComponent,\n h,\n onBeforeUnmount,\n onMounted,\n provide,\n shallowReactive,\n shallowRef,\n watch,\n type PropType,\n type VNode,\n} from 'vue'\nimport { runPlugins, type CollectedRegistrations, type IrisPlugin } from '@iris-ui-kit/core'\nimport { applyCssVars, type ApplyCssVarsResult, type ThemeStore } from '@iris-ui-kit/theme'\nimport type { SkinEngine } from '@iris-ui-kit/skins'\nimport { ThemeProvider } from '../theme'\nimport { SkinProvider } from '../skins'\nimport { IrisI18nProvider } from '../i18n'\nimport { PluginStoreContextKey, type PluginStoreContext } from './context'\n\nconst DEFAULT_LOCALE = 'en-US'\n\n/** Public prop surface of {@link IrisProvider}. */\nexport interface IrisProviderProps {\n /** Theme store; when present the inner `ThemeProvider` wraps the subtree. */\n theme?: ThemeStore\n /** Skin engine; when present the inner `SkinProvider` wraps the subtree. */\n skin?: SkinEngine\n /** Writing direction, forwarded to `ThemeProvider` when a theme is given. */\n dir?: 'ltr' | 'rtl'\n /** Active BCP-47 locale; defaults to `'en-US'`. */\n locale?: string\n /** User messages — merged OVER plugin-registered messages (user wins). */\n messages?: Record<string, string>\n /** Plugins to install; their tokens / messages / stores are collected once. */\n plugins?: IrisPlugin[]\n /** Element receiving the plugin token layer; defaults to `documentElement`. */\n target?: HTMLElement | null\n}\n\n/**\n * The single unified Iris entry point. Runs `plugins` through the core\n * `runPlugins` collector and wires the result into the theme (tokens), i18n\n * (messages) and a plugin-store context, composing the existing per-framework\n * providers. A thin bridge — the real logic lives in `@iris-ui-kit/core`.\n *\n * Render order when present: Theme → Skin → I18n → PluginContext → children.\n */\nexport const IrisProvider = defineComponent({\n name: 'IrisProvider',\n props: {\n theme: { type: Object as PropType<ThemeStore>, default: undefined },\n skin: { type: Object as PropType<SkinEngine>, default: undefined },\n dir: { type: String as PropType<'ltr' | 'rtl'>, default: undefined },\n locale: { type: String, default: undefined },\n messages: { type: Object as PropType<Record<string, string>>, default: undefined },\n plugins: { type: Array as PropType<IrisPlugin[]>, default: undefined },\n target: { type: Object as PropType<HTMLElement | null>, default: null },\n },\n setup(props, { slots }) {\n // R1: `collected` is reactive so a `plugins` swap re-derives everything\n // downstream (tokens, messages, stores, installed set). Shallow: the stores\n // Map and store instances stay raw — never proxied — so `instanceof` /\n // private fields on class-based stores keep working.\n const collected = shallowRef<CollectedRegistrations>(runPlugins(props.plugins ?? []))\n\n // R4: one reactive context created once in setup (`provide()` cannot run\n // from a watcher — it requires the setup instance context) and mutated in\n // place on swap so `usePlugin` / `usePluginStore` consumers observe the new\n // stores and installed set after a re-render. Shallow for the same reason.\n const ctx = shallowReactive<PluginStoreContext>({\n stores: collected.value.stores,\n installed: new Set((props.plugins ?? []).map((p) => p.name)),\n })\n provide(PluginStoreContextKey, ctx)\n\n // tokens → additive CSS-var layer over the active theme; reverted on unmount.\n let applied: ApplyCssVarsResult | null = null\n // Pre-mount swaps must not create a token layer whose revert handle gets\n // shadowed by onMounted — `onMounted` applies the (already current) set.\n let mounted = false\n onMounted(() => {\n mounted = true\n if (typeof document === 'undefined') return\n const el = props.target ?? document.documentElement\n applied = applyCssVars(Object.entries(collected.value.tokens), el)\n })\n\n // R1–R4: re-collect when the `plugins` prop identity changes (array ref,\n // `Object.is` — same semantics as React `useMemo([plugins])` / Solid\n // `createMemo` / Svelte `$derived`). Non-immediate: the initial collection\n // happens in setup above, so an immediate watch would re-run `runPlugins`\n // (double eager store factories + spurious install→teardown→install).\n // Compute-then-commit: `runPlugins` is the only fallible step; a throwing\n // install aborts before any revert/teardown/replacement is committed.\n watch(\n () => props.plugins,\n (next) => {\n const prev = collected.value\n const nextCollected = runPlugins(next ?? [])\n applied?.revert()\n applied = null\n // R3: the removed set is torn exactly once at the swap (idempotent in\n // core); the current set is still torn exactly once in onBeforeUnmount.\n prev.teardown()\n collected.value = nextCollected\n ctx.stores = nextCollected.stores\n ctx.installed = new Set((next ?? []).map((p) => p.name))\n // R2 + R5: re-apply the new layer (guard `document` for SSR). Pre-mount\n // swaps are applied by onMounted — exactly one layer, no orphaned handle.\n if (mounted && typeof document !== 'undefined') {\n const el = props.target ?? document.documentElement\n applied = applyCssVars(Object.entries(nextCollected.tokens), el)\n }\n },\n )\n\n onBeforeUnmount(() => {\n applied?.revert()\n applied = null\n // Run plugin teardowns on unmount so eager stores / subscriptions /\n // timers don't leak. Idempotent and safe with no plugins.\n collected.value.teardown()\n })\n\n return () => {\n const locale = props.locale ?? DEFAULT_LOCALE\n // Plugin messages as BASE, user messages WIN.\n const messages = { ...collected.value.messages[locale], ...(props.messages ?? {}) }\n\n // I18n always renders, wrapping children.\n let tree: VNode = h(\n IrisI18nProvider,\n { locale: props.locale, messages },\n { default: () => slots.default?.() },\n )\n // Skin wraps only when a `skin` engine is supplied.\n if (props.skin) {\n tree = h(\n SkinProvider,\n { engine: props.skin, target: props.target },\n { default: () => tree },\n )\n }\n // Theme wraps only when a `theme` store is supplied.\n if (props.theme) {\n tree = h(\n ThemeProvider,\n { store: props.theme, target: props.target, dir: props.dir ?? 'ltr' },\n { default: () => tree },\n )\n }\n return tree\n }\n },\n})\n","import { inject } from 'vue'\nimport { PluginStoreContextKey } from './context'\n\n/** Whether the named plugin is installed by the nearest `<IrisProvider>`. */\nexport function usePlugin(name: string): boolean {\n const ctx = inject(PluginStoreContextKey, null)\n return ctx ? ctx.installed.has(name) : false\n}\n\n// Tracks ambiguous store key warnings to avoid spamming the console.\nconst warnedKeys = new Map<string, boolean>()\n\n/**\n * Read a plugin-registered store by `key` (backward-compatible single-arg form).\n * Throws a clear error when used outside an `<IrisProvider>`.\n */\nexport function usePluginStore<T>(key: string): T\n\n/**\n * Read a plugin-registered store by `namespace` + `key`.\n */\nexport function usePluginStore<T>(namespace: string, key: string): T\n\nexport function usePluginStore<T>(nsOrKey: string, key?: string): T {\n const ctx = inject(PluginStoreContextKey, null)\n if (!ctx) {\n const displayKey = key !== undefined ? `${nsOrKey}::${key}` : nsOrKey\n throw new Error(`[iris-ui] usePluginStore(\"${displayKey}\"): no <IrisProvider> ancestor found`)\n }\n\n const fullKey = key !== undefined ? `${nsOrKey}::${key}` : nsOrKey\n\n // 1. Direct lookup\n let store = ctx.stores.get(fullKey) as T | undefined\n if (store !== undefined) return store\n\n // 2. Single-arg fallback\n if (key === undefined) {\n store = ctx.stores.get(nsOrKey) as T | undefined\n if (store !== undefined) return store\n\n for (const k of ctx.stores.keys()) {\n if (typeof k === 'string' && k.endsWith(`::${nsOrKey}`)) {\n // Warn at most once per ambiguous key.\n if (!warnedKeys.has(nsOrKey)) {\n warnedKeys.set(nsOrKey, true)\n console.warn(\n `[iris-ui] Ambiguous plugin store key \"${nsOrKey}\". ` +\n `Found \"${k}\". Use the namespaced form: usePluginStore(\"${k}\").`,\n )\n }\n return ctx.stores.get(k) as T\n }\n }\n }\n\n throw new Error(\n `[iris-ui] Plugin store \"${fullKey}\" not found. ` +\n `Ensure the plugin is installed in IrisProvider and the key is correct.`,\n )\n}\n"]}
@@ -2,10 +2,10 @@ import { useFloating, useDismiss } from './chunk-IPR5JAVF.js';
2
2
  import { useMachine } from './chunk-NNOF7KUH.js';
3
3
  import { findFirstElement, mergeSlotProps } from './chunk-F77KIPOH.js';
4
4
  import { IrisHeaderLayout, IrisSidebarLayout } from './chunk-3V46HGRC.js';
5
- import { IrisThemeKey } from './chunk-OH4YSGFK.js';
5
+ import { IrisThemeKey } from './chunk-ZTPIXL7Q.js';
6
6
  import { IrisSortable } from './chunk-W3B6E5GN.js';
7
7
  import { useStore } from './chunk-75GSYEJS.js';
8
- import { useI18n } from './chunk-W3JMJVEK.js';
8
+ import { useI18n } from './chunk-TCAXRWT6.js';
9
9
  import { defineComponent, inject, h, computed, shallowRef, onBeforeUnmount, watch, provide, useId, ref, nextTick, Teleport, Fragment, watchEffect, toValue, onMounted } from 'vue';
10
10
  import { visibleNav, findNavPath, createExpansion, branchTrail, createFloatingMachine, isBranch, findNavNode, firstLeaf, matchTypeahead, nextEnabledIndex, isClosable, createAdminShell } from '@iris-ui-kit/core';
11
11
  export { createAdminPreferences, createTabsNav, filterNavByAccess, findNavNode, findNavPath, firstLeaf, flattenNav, isBranch, isClosable, localStorageAdminPreferencesStorage, nodeAllowsRoles, visibleNav } from '@iris-ui-kit/core';
@@ -190,6 +190,32 @@ var CSS = `
190
190
  background: var(--iris-nav-item-active-hover, color-mix(in srgb, var(--iris-primary) 88%, black));
191
191
  }
192
192
 
193
+ /* \u6C34\u5E73\u6A21\u5F0F\uFF1Aantd \u98CE\u683C\u9009\u4E2D\u6001\uFF08\u4E0B\u5212\u7EBF + \u6587\u5B57\u8272 + \u900F\u660E\u80CC\u666F\uFF09\uFF0C\u800C\u975E
194
+ vertical \u7684\u6574\u5757 primary \u80CC\u666F\u3002hover \u4E00\u5F8B\u6D45\u80CC\u666F\uFF08active \u9879\u4E5F\u54CD\u5E94\uFF09\u3002 */
195
+ :where(.iris-nav-menu--horizontal .iris-nav-menu-group > .iris-nav-menu-item) {
196
+ position: relative;
197
+ }
198
+ :where(.iris-nav-menu--horizontal .iris-nav-menu-group > .iris-nav-menu-item):hover {
199
+ background: var(--iris-nav-item-hover);
200
+ }
201
+ :where(.iris-nav-menu--horizontal .iris-nav-menu-group > .iris-nav-menu-item[data-active='true']) {
202
+ background: transparent;
203
+ color: var(--iris-primary);
204
+ font-weight: 600;
205
+ }
206
+ :where(.iris-nav-menu--horizontal .iris-nav-menu-group > .iris-nav-menu-item[data-active='true'])::after {
207
+ content: '';
208
+ position: absolute;
209
+ inset-inline: 12px;
210
+ bottom: 2px;
211
+ height: 2px;
212
+ border-radius: 1px;
213
+ background: var(--iris-primary);
214
+ }
215
+ :where(.iris-nav-menu--horizontal .iris-nav-menu-group > .iris-nav-menu-item[data-active='true']):hover {
216
+ background: var(--iris-nav-item-hover);
217
+ }
218
+
193
219
  :where(.iris-nav-menu-item[data-active-trail='true']) {
194
220
  color: var(--iris-primary);
195
221
  font-weight: 600;
@@ -1173,7 +1199,7 @@ function useTabsNav(nav) {
1173
1199
  }
1174
1200
 
1175
1201
  // src/primitives/dropdown/context.ts
1176
- var DropdownContextKey = Symbol("IrisDropdown");
1202
+ var DropdownContextKey = /* @__PURE__ */ Symbol("IrisDropdown");
1177
1203
 
1178
1204
  // src/primitives/dropdown/Dropdown.ts
1179
1205
  var IrisDropdown = defineComponent({
@@ -2132,5 +2158,5 @@ function useAdminPreferences(preferences, hydrate = true) {
2132
2158
  }
2133
2159
 
2134
2160
  export { DropdownContextKey, IrisAdminBreadcrumb, IrisAdminLayout, IrisAdminTabs, IrisBreadcrumb, IrisBreadcrumbItem, IrisDropdown, IrisDropdownItem, IrisDropdownMenu, IrisDropdownSeparator, IrisDropdownTrigger, IrisIcon, IrisNavMenu, useAdminPreferences, useAdminShell, useTabsNav };
2135
- //# sourceMappingURL=chunk-EZUDM4TM.js.map
2136
- //# sourceMappingURL=chunk-EZUDM4TM.js.map
2161
+ //# sourceMappingURL=chunk-PT6X4543.js.map
2162
+ //# sourceMappingURL=chunk-PT6X4543.js.map