{"version":3,"file":"sixbell-telco-sdk-components-sonner.mjs","sources":["../../../projects/sdk/components/sonner/src/sonner.component.ts","../../../projects/sdk/components/sonner/toaster/src/toaster.component.ts","../../../projects/sdk/components/sonner/sixbell-telco-sdk-components-sonner.ts"],"sourcesContent":["import { Type } from '@angular/core';\nimport { cva } from 'class-variance-authority';\nimport { toast as ngxToast } from 'ngx-sonner';\n\n/**\n * @internal\n * Generates base toast classes with style variants for semantic colors\n */\nexport const toastVariants = cva('', {\n\tvariants: {\n\t\tvariant: {\n\t\t\tdefault: '',\n\t\t\tsuccess: 'text-success',\n\t\t\terror: 'text-error',\n\t\t\twarning: 'text-warning',\n\t\t\tinfo: 'text-info',\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tvariant: 'default',\n\t},\n});\n\n/** Possible toast style variants */\nexport type ToastVariantProps = 'default' | 'success' | 'error' | 'warning' | 'info' | null | undefined;\n\n/**\n * Toast function with semantic variants and Tailwind styling\n * Proxies ngx-sonner toast functionality with SDK styling\n */\nfunction createToast(message: string, options?: Record<string, unknown>) {\n\treturn ngxToast(message, options);\n}\n\n// Add methods to the function\ncreateToast.success = (message: string, options?: Record<string, unknown>) => {\n\treturn ngxToast.success(message, options);\n};\n\ncreateToast.error = (message: string, options?: Record<string, unknown>) => {\n\treturn ngxToast.error(message, options);\n};\n\n// IMPORTANT: use the variant helpers so ngx-sonner applies variant metadata (was plain toast before)\ncreateToast.warning = (message: string, options?: Record<string, unknown>) => {\n\treturn ngxToast.warning(message, options);\n};\n\ncreateToast.info = (message: string, options?: Record<string, unknown>) => {\n\treturn ngxToast.info(message, options);\n};\n\ncreateToast.loading = (message: string, options?: Record<string, unknown>) => ngxToast.loading(message, options);\n\ncreateToast.promise = (promise: Promise<unknown>, options: Record<string, unknown>) => ngxToast.promise(promise, options);\n\ncreateToast.custom = (component: Type<unknown>, options?: Record<string, unknown>) => ngxToast.custom(component, options);\n\ncreateToast.dismiss = (id?: string | number) => ngxToast.dismiss(id);\n\ncreateToast.dismissAll = () => ngxToast.dismiss();\n\nexport const toast = createToast as typeof createToast & {\n\tsuccess: (message: string, options?: Record<string, unknown>) => ReturnType<typeof ngxToast>;\n\terror: (message: string, options?: Record<string, unknown>) => ReturnType<typeof ngxToast>;\n\twarning: (message: string, options?: Record<string, unknown>) => ReturnType<typeof ngxToast>;\n\tinfo: (message: string, options?: Record<string, unknown>) => ReturnType<typeof ngxToast>;\n\tloading: (message: string, options?: Record<string, unknown>) => ReturnType<typeof ngxToast>;\n\tpromise: (promise: Promise<unknown>, options: Record<string, unknown>) => ReturnType<typeof ngxToast>;\n\tcustom: (component: Type<unknown>, options?: Record<string, unknown>) => ReturnType<typeof ngxToast>;\n\tdismiss: (id?: string | number) => ReturnType<typeof ngxToast>;\n\tdismissAll: () => ReturnType<typeof ngxToast>;\n};\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { NgxSonnerToaster } from 'ngx-sonner';\n\n/**\n * Sixbell Telco Sonner Toaster Component\n *\n * A wrapper around ngx-sonner-toaster that provides Tailwind CSS styling and semantic color variants.\n * This component proxies the ngx-sonner-toaster functionality while applying the SDK's design system.\n *\n * @example\n * ```html\n * <st-sonner-toaster\n *   [theme]=\"'light'\"\n *   [position]=\"'bottom-right'\"\n *   [richColors]=\"true\"\n * />\n * ```\n */\n@Component({\n\tselector: 'st-sonner-toaster',\n\timports: [CommonModule, NgxSonnerToaster],\n\ttemplate: `\n\t\t<ngx-sonner-toaster\n\t\t\t[dir]=\"dir()\"\n\t\t\t[expand]=\"expand()\"\n\t\t\t[visibleToasts]=\"visibleToasts()\"\n\t\t\t[position]=\"position()\"\n\t\t\t[offset]=\"offset()\"\n\t\t\t[closeButton]=\"closeButton()\"\n\t\t\t[duration]=\"duration()\"\n\t\t\t[toastOptions]=\"toastOptions()\"\n\t\t/>\n\t`,\n\tstandalone: true,\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SonnerToasterComponent {\n\t/**\n\t * Direction for the toasts\n\t * @defaultValue 'ltr'\n\t */\n\tdir = input<'ltr' | 'rtl'>('ltr');\n\n\t/**\n\t * Whether to use rich colors for semantic toasts\n\t * @defaultValue true\n\t */\n\trichColors = input<boolean>(false);\n\n\t/**\n\t * Whether to expand the toast on hover\n\t * @defaultValue false\n\t */\n\texpand = input<boolean>(false);\n\n\t/**\n\t * Maximum number of visible toasts\n\t * @defaultValue 3\n\t */\n\tvisibleToasts = input<number>(3);\n\n\t/**\n\t * Position of the toasts\n\t * @defaultValue 'bottom-right'\n\t */\n\tposition = input<'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center'>('bottom-right');\n\n\t/**\n\t * Offset from the edge of the screen\n\t * @defaultValue '16px'\n\t */\n\toffset = input<string>('16px');\n\n\t/**\n\t * Whether to show close button\n\t * @defaultValue false\n\t */\n\tcloseButton = input<boolean>(false);\n\n\t/**\n\t * Duration for the toast in milliseconds\n\t * @defaultValue 4000\n\t */\n\tduration = input<number>(4000);\n\n\t/**\n\t * Default toast options with semantic styling\n\t */\n\ttoastOptions = computed(() => {\n\t\tconst baseClasses = {\n\t\t\ttoast: cn(\n\t\t\t\t'bg-base-200! data-[type=loading]:border-neutral! data-[type=default]:border-neutral! text-base-content! rounded-box shadow-main-lg! w-[22rem]! border! p-4! text-pretty! transition-[transform,opacity,height,box-shadow,border-color,color]! duration-[400ms,400ms,400ms,200ms,200ms,200ms]!',\n\t\t\t\t{ 'border-neutral!': this.richColors() === false },\n\t\t\t),\n\t\t\ttitle: cn('font-heading! font-medium!'),\n\t\t\tdescription: cn('text-base-content/70!'),\n\t\t\tactionButton: cn('btn! btn-primary! btn-xs! font-body! leading-normal! font-medium! text-pretty!'),\n\t\t\tcancelButton: cn('btn! btn-secondary! btn-xs! font-body! leading-normal! font-medium! text-pretty!'),\n\t\t\tcloseButton: cn('btn! btn-circle! btn-xs! font-body! border-neutral! border! text-pretty!'),\n\t\t};\n\n\t\tconst semanticClasses = this.richColors()\n\t\t\t? {\n\t\t\t\t\tsuccess: cn('bg-base-200! border-success! text-success!'),\n\t\t\t\t\terror: cn('bg-base-200! border-error! text-error!'),\n\t\t\t\t\twarning: cn('bg-base-200! border-warning! text-warning!'),\n\t\t\t\t\tinfo: cn('bg-base-200! border-info! text-info!'),\n\t\t\t\t}\n\t\t\t: {};\n\n\t\treturn {\n\t\t\tunstyled: false,\n\t\t\tclasses: {\n\t\t\t\t...baseClasses,\n\t\t\t\t...semanticClasses,\n\t\t\t},\n\t\t};\n\t});\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["ngxToast"],"mappings":";;;;;;;AAIA;;;AAGG;AACI,MAAM,aAAa,GAAG,GAAG,CAAC,EAAE,EAAE;AACpC,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;AACR,YAAA,OAAO,EAAE,EAAE;AACX,YAAA,OAAO,EAAE,cAAc;AACvB,YAAA,KAAK,EAAE,YAAY;AACnB,YAAA,OAAO,EAAE,cAAc;AACvB,YAAA,IAAI,EAAE,WAAW;AACjB,SAAA;AACD,KAAA;AACD,IAAA,eAAe,EAAE;AAChB,QAAA,OAAO,EAAE,SAAS;AAClB,KAAA;AACD,CAAA;AAKD;;;AAGG;AACH,SAAS,WAAW,CAAC,OAAe,EAAE,OAAiC,EAAA;AACtE,IAAA,OAAOA,OAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;AAClC;AAEA;AACA,WAAW,CAAC,OAAO,GAAG,CAAC,OAAe,EAAE,OAAiC,KAAI;IAC5E,OAAOA,OAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC;AAC1C,CAAC;AAED,WAAW,CAAC,KAAK,GAAG,CAAC,OAAe,EAAE,OAAiC,KAAI;IAC1E,OAAOA,OAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC;AACxC,CAAC;AAED;AACA,WAAW,CAAC,OA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