{"version":3,"file":"flowbite-angular-tooltip.mjs","sources":["../../../../libs/flowbite-angular/tooltip/src/tooltip/theme.ts","../../../../libs/flowbite-angular/tooltip/src/config/tooltip-config.ts","../../../../libs/flowbite-angular/tooltip/src/tooltip/tooltip-state.ts","../../../../libs/flowbite-angular/tooltip/src/tooltip/tooltip.directive.ts","../../../../libs/flowbite-angular/tooltip/src/index.ts","../../../../libs/flowbite-angular/tooltip/src/flowbite-angular-tooltip.ts"],"sourcesContent":["import type { ColorToTheme, FlowbiteColors } from 'flowbite-angular';\r\nimport { createTheme } from 'flowbite-angular';\r\n\r\nexport interface FlowbiteTooltipColors\r\n  extends Pick<FlowbiteColors, 'default' | 'info' | 'failure' | 'success' | 'warning' | 'primary'> {\r\n  [key: string]: ColorToTheme;\r\n}\r\n\r\nexport interface FlowbiteTooltipTheme {\r\n  host: FlowbiteTooltipHostTheme;\r\n}\r\n\r\nexport interface FlowbiteTooltipHostTheme {\r\n  base: string;\r\n  transition: string;\r\n  color: FlowbiteTooltipColors;\r\n}\r\n\r\nexport const flowbiteTooltipTheme: FlowbiteTooltipTheme = createTheme({\r\n  host: {\r\n    base: 'absolute z-10 inline-block rounded-lg border p-3 py-2 text-sm font-medium shadow-xs',\r\n    transition: '',\r\n    color: {\r\n      default: {\r\n        light: 'border-gray-200 bg-gray-100 text-gray-900',\r\n        dark: 'dark:border-gray-800 dark:bg-gray-900 dark:text-gray-100',\r\n      },\r\n      info: {\r\n        light: 'border-blue-200 bg-gray-100 text-gray-900',\r\n        dark: 'dark:border-blue-800 dark:bg-gray-900 dark:text-gray-100',\r\n      },\r\n      failure: {\r\n        light: 'border-red-200 bg-gray-100 text-gray-900',\r\n        dark: 'dark:border-red-800 dark:bg-gray-900 dark:text-gray-100',\r\n      },\r\n      success: {\r\n        light: 'border-green-200 bg-gray-100 text-gray-900',\r\n        dark: 'dark:border-green-800 dark:bg-gray-900 dark:text-gray-100',\r\n      },\r\n      warning: {\r\n        light: 'border-yellow-200 bg-gray-100 text-gray-900',\r\n        dark: 'dark:border-yellow-800 dark:bg-gray-900 dark:text-gray-100',\r\n      },\r\n      primary: {\r\n        light: 'border-primary-200 bg-gray-100 text-gray-900',\r\n        dark: 'dark:border-primary-800 dark:bg-gray-900 dark:text-gray-100',\r\n      },\r\n    },\r\n  },\r\n});\r\n","import type { FlowbiteTooltipColors } from '../tooltip/theme';\r\nimport { flowbiteTooltipTheme, type FlowbiteTooltipTheme } from '../tooltip/theme';\r\n\r\nimport type { DeepPartial } from 'flowbite-angular';\r\n\r\nimport type { Provider } from '@angular/core';\r\nimport { inject, InjectionToken } from '@angular/core';\r\n\r\nexport interface FlowbiteTooltipConfig {\r\n  /**\r\n   * The default theme of tooltip\r\n   */\r\n  baseTheme: FlowbiteTooltipTheme;\r\n  /**\r\n   * The default color of tooltip\r\n   */\r\n  color: keyof FlowbiteTooltipColors;\r\n  /**\r\n   * The custom theme of tooltip\r\n   */\r\n  customTheme: DeepPartial<FlowbiteTooltipTheme>;\r\n}\r\n\r\nexport const defaultFlowbiteTooltipConfig: FlowbiteTooltipConfig = {\r\n  baseTheme: flowbiteTooltipTheme,\r\n  color: 'default',\r\n  customTheme: {},\r\n};\r\n\r\nexport const FlowbiteTooltipConfigToken = new InjectionToken<FlowbiteTooltipConfig>(\r\n  'FlowbiteTooltipConfigToken'\r\n);\r\n\r\n/**\r\n * Provide the default Tooltip configuration\r\n * @param config The Tooltip configuration\r\n * @returns The provider\r\n */\r\nexport const provideFlowbiteTooltipConfig = (\r\n  config: Partial<FlowbiteTooltipConfig>\r\n): Provider[] => [\r\n  {\r\n    provide: FlowbiteTooltipConfigToken,\r\n    useValue: { ...defaultFlowbiteTooltipConfig, ...config },\r\n  },\r\n];\r\n\r\n/**\r\n * Inject the Tooltip configuration\r\n * @see {@link defaultFlowbiteTooltipConfig}\r\n * @returns The configuration\r\n */\r\nexport const injectFlowbiteTooltipConfig = (): FlowbiteTooltipConfig =>\r\n  inject(FlowbiteTooltipConfigToken, { optional: true }) ?? defaultFlowbiteTooltipConfig;\r\n","import type { Tooltip } from './tooltip.directive';\r\n\r\nimport {\r\n  createState,\r\n  createStateInjector,\r\n  createStateProvider,\r\n  createStateToken,\r\n} from 'ng-primitives/state';\r\n\r\nexport const FlowbiteTooltipStateToken = createStateToken<Tooltip>('Flowbite Tooltip');\r\nexport const provideFlowbiteTooltipState = createStateProvider(FlowbiteTooltipStateToken);\r\nexport const injectFlowbiteTooltipState = createStateInjector(FlowbiteTooltipStateToken);\r\nexport const flowbiteTooltipState = createState(FlowbiteTooltipStateToken);\r\n","import { injectFlowbiteTooltipConfig } from '../config/tooltip-config';\r\nimport type { FlowbiteTooltipColors, FlowbiteTooltipTheme } from './theme';\r\nimport { flowbiteTooltipState, provideFlowbiteTooltipState } from './tooltip-state';\r\n\r\nimport { colorToTheme, mergeDeep, type DeepPartial } from 'flowbite-angular';\r\n\r\nimport { computed, Directive, input } from '@angular/core';\r\nimport { twMerge } from 'tailwind-merge';\r\n\r\n@Directive({\r\n  standalone: true,\r\n  selector: `\r\n    [flowbiteTooltip]\r\n  `,\r\n  exportAs: 'flowbiteTooltip',\r\n  hostDirectives: [],\r\n  providers: [provideFlowbiteTooltipState()],\r\n  host: { '[class]': `theme().host.root` },\r\n})\r\nexport class Tooltip {\r\n  protected readonly config = injectFlowbiteTooltipConfig();\r\n\r\n  /**\r\n   * @see {@link injectFlowbiteTooltipConfig}\r\n   */\r\n  readonly color = input<keyof FlowbiteTooltipColors>(this.config.color);\r\n  /**\r\n   * @see {@link injectFlowbiteTooltipConfig}\r\n   */\r\n  readonly customTheme = input<DeepPartial<FlowbiteTooltipTheme>>(this.config.customTheme);\r\n\r\n  readonly theme = computed(() => {\r\n    const mergedTheme = mergeDeep(this.config.baseTheme, this.state.customTheme());\r\n\r\n    return {\r\n      host: {\r\n        root: twMerge(\r\n          mergedTheme.host.base,\r\n          colorToTheme(mergedTheme.host.color, this.state.color())\r\n        ),\r\n      },\r\n    };\r\n  });\r\n\r\n  /**\r\n   * @internal\r\n   */\r\n  readonly state = flowbiteTooltipState<Tooltip>(this);\r\n}\r\n","/* Tooltip */\r\nexport * from './tooltip/tooltip.directive';\r\nexport * from './tooltip/tooltip-state';\r\nexport * from './tooltip/theme';\r\n/* Config */\r\nexport * from './config/tooltip-config';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAkBO,MAAM,oBAAoB,GAAyB,WAAW,CAAC;AACpE,IAAA,IAAI,EAAE;AACJ,QAAA,IAAI,EAAE,qFAAqF;AAC3F,QAAA,UAAU,EAAE,EAAE;AACd,QAAA,KAAK,EAAE;AACL,YAAA,OAAO,EAAE;AACP,gBAAA,KAAK,EAAE,2CAA2C;AAClD,gBAAA,IAAI,EAAE,0DAA0D;AACjE,aAAA;AACD,YAAA,IAAI,EAAE;AACJ,gBAAA,KAAK,EAAE,2CAA2C;AAClD,gBAAA,IAAI,EAAE,0DAA0D;AACjE,aAAA;AACD,YAAA,OAAO,EAAE;AACP,gBAAA,KAAK,EAAE,0CAA0C;AACjD,gBAAA,IAAI,EAAE,yDAAyD;AAChE,aAAA;AACD,YAAA,OAAO,EAAE;AACP,gBAAA,KAAK,EAAE,4CAA4C;AACnD,gBAAA,IAAI,EAAE,2DAA2D;AAClE,aAAA;AACD,YAAA,OAAO,EAAE;AACP,gBAAA,KAAK,EAAE,6CAA6C;AACpD,gBAAA,IAAI,EAAE,4DAA4D;AACnE,aAAA;AACD,YAAA,OAAO,EAAE;AACP,gBAAA,KAAK,EAAE,8CAA8C;AACrD,gBAAA,IAAI,EAAE,6DAA6D;AACpE,aAAA;AACF,SAAA;AACF,KAAA;AACF,CAAA;;AC1BM,MAAM,4BAA4B,GAA0B;AACjE,IAAA,SAAS,EAAE,oBAAoB;AAC/B,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,WAAW,EAAE,EAAE;;MAGJ,0BAA0B,GAAG,IAAI,cAAc,CAC1D,4BAA4B;AAG9B;;;;AAIG;MACU,4B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