{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../packages/hooks/use-size/index.ts"],"sourcesContent":["import { computed, inject, unref } from 'vue'\nimport { buildProp } from '@element-plus/utils'\nimport { componentSizes } from '@element-plus/constants'\n\nimport type { InjectionKey, Ref } from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\n\nexport const useSizeProp = buildProp({\n  type: String,\n  values: componentSizes,\n  required: false,\n} as const)\n\nexport const useSizeProps = {\n  size: useSizeProp,\n}\n\nexport interface SizeContext {\n  size: Ref<ComponentSize>\n}\n\nexport const SIZE_INJECTION_KEY: InjectionKey<SizeContext> = Symbol('size')\n\nexport const useGlobalSize = () => {\n  const injectedSize = inject(SIZE_INJECTION_KEY, {} as SizeContext)\n\n  return computed<ComponentSize>(() => {\n    return unref(injectedSize.size) || ''\n  })\n}\n"],"mappings":";;;;AAOA,MAAa,cAAc,UAAU;CACnC,MAAM;CACN,QAAQ;CACR,UAAU;AACZ,CAAU;AAEV,MAAa,eAAe,EAC1B,MAAM,YACR;AAMA,MAAa,qBAAgD,OAAO,MAAM;AAE1E,MAAa,sBAAsB;CACjC,MAAM,eAAe,OAAO,oBAAoB,CAAC,CAAgB;CAEjE,OAAO,eAA8B;EACnC,OAAO,MAAM,aAAa,IAAI,KAAK;CACrC,CAAC;AACH"}