{"version":3,"file":"UTableHeaderText.mjs","names":["makeComponentProps","makeTagProps","genericComponent","propsFactory","computed","UIcon","UTooltip","makeUTableHeaderTextProps","_objectSpread","prependIcon","type","String","undefined","required","appendIcon","isHovered","Boolean","isDisabled","UTableHeaderText","name","props","emits","setup","_ref","emit","slots","textColorClasses","color","iconColorClasses","_slots$default","_createVNode","value","call","tooltipToggle","text"],"sources":["../../../src/components/UTable/UTableHeaderText.tsx"],"sourcesContent":["import { makeComponentProps } from '@/composables/component'\nimport { makeTagProps } from '@/composables/tag'\nimport { genericComponent, propsFactory } from '@/utils'\nimport { ExtractPropTypes, PropType, computed } from 'vue'\nimport { UIcon, UTooltip } from '../../components'\nimport type ColorName from '../../types/colors'\n\nexport const makeUTableHeaderTextProps = propsFactory(\n  {\n    prependIcon: {\n      type: [String, undefined] as PropType<string | undefined>,\n      default: undefined,\n      required: false,\n    },\n    appendIcon: {\n      type: [String, undefined] as PropType<string | undefined>,\n      default: undefined,\n      required: false,\n    },\n    isHovered: {\n      type: Boolean,\n      default: false,\n      required: false,\n    },\n    isDisabled: {\n      type: Boolean,\n      default: false,\n      required: false,\n    },\n    ...makeComponentProps(),\n    ...makeTagProps(),\n  },\n  'UTableHeaderText'\n)\n\nexport type UTableHeaderTextProps = ExtractPropTypes<\n  typeof makeUTableHeaderTextProps\n>\n\nexport type UTableHeaderTextSlots = {\n  default: never\n}\n\nexport const UTableHeaderText = genericComponent<UTableHeaderTextSlots>()({\n  name: 'UTableHeaderText',\n\n  props: makeUTableHeaderTextProps(),\n\n  emits: {\n    //\n  },\n\n  setup(props, { emit, slots }) {\n    const textColorClasses = computed(() => {\n      let color = 'text-gray-600'\n      if (props.isHovered) {\n        color = 'text-gray-700'\n      } else if (props.isDisabled) {\n        color = 'text-gray-300'\n      }\n      return color\n    })\n\n    const iconColorClasses = computed(() => {\n      let color = 'gray-600'\n      if (props.isDisabled) {\n        color = 'gray-300'\n      }\n      return color as ColorName\n    })\n\n    return () => (\n      <div class=\"flex items-center\">\n        <span\n          class={[\n            textColorClasses.value,\n            `overflow-hidden whitespace-nowrap overflow-ellipsis text-text-xs font-medium w-fit \n            h-fit`,\n          ]}\n        >\n          {slots.default?.()}\n        </span>\n        {props.prependIcon ? (\n          <div class=\"pl-2 flex justify-center items-center\">\n            <UTooltip position=\"bottom\" theme=\"light\">\n              {{\n                tooltipToggle: () => (\n                  <UIcon\n                    color=\"gray-400\"\n                    size=\"14\"\n                    icon={props.prependIcon}\n                  ></UIcon>\n                ),\n                text: () =>\n                  `Tooltips are used to describe or identify an element. In most scenarios, \n                  tooltips help the user understand meaning, function, or alt-text.`,\n              }}\n            </UTooltip>\n          </div>\n        ) : null}\n        {props.appendIcon ? (\n          <div class=\"pl-2\">\n            <UIcon\n              size=\"14\"\n              color={iconColorClasses.value}\n              icon={props.appendIcon}\n            ></UIcon>\n          </div>\n        ) : null}\n      </div>\n    )\n  },\n})\n\nexport type UTableHeaderText = InstanceType<typeof UTableHeaderText>\n"],"mappings":";;;;;;;SAASA,kBAAkB;AAAA,SAClBC,YAAY;AAAA,SACZC,gBAAgB,EAAEC,YAAY;AACvC,SAAqCC,QAAQ,QAAQ,KAAK;AAAA,SACjDC,KAAK,EAAEC,QAAQ;AAGxB,OAAO,IAAMC,yBAAyB,GAAGJ,YAAY,CAAAK,aAAA,CAAAA,aAAA;EAEjDC,WAAW,EAAE;IACXC,IAAI,EAAE,CAACC,MAAM,EAAEC,SAAS,CAAiC;IACzD,WAASA,SAAS;IAClBC,QAAQ,EAAE;EACZ,CAAC;EACDC,UAAU,EAAE;IACVJ,IAAI,EAAE,CAACC,MAAM,EAAEC,SAAS,CAAiC;IACzD,WAASA,SAAS;IAClBC,QAAQ,EAAE;EACZ,CAAC;EACDE,SAAS,EAAE;IACTL,IAAI,EAAEM,OAAO;IACb,WAAS,KAAK;IACdH,QAAQ,EAAE;EACZ,CAAC;EACDI,UAAU,EAAE;IACVP,IAAI,EAAEM,OAAO;IACb,WAAS,KAAK;IACdH,QAAQ,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