@trycourier/courier-ui-core
Version:
The core UI kit for Courier Web Components
1 lines • 45.8 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../src/utils/courier-colors.ts","../src/utils/theme.ts","../src/utils/system-theme-mode.ts","../src/components/courier-base-element.ts","../src/components/courier-system-theme-element.ts","../src/components/courier-button.ts","../src/components/courier-icon.ts","../src/components/courier-link.ts","../src/components/courier-element.ts","../src/components/courier-info-state.ts","../src/components/courier-icon-button.ts","../src/utils/registeration.ts","../src/index.ts"],"sourcesContent":["export const CourierColors = {\n black: {\n 400: '#0A0A0A',\n 500: '#171717',\n 500_10: '#1717171A',\n 500_20: '#17171733',\n },\n gray: {\n 200: '#F5F5F5',\n 400: '#3A3A3A',\n 500: '#E5E5E5',\n 600: '#737373',\n },\n white: {\n 500: '#FFFFFF',\n 500_10: '#FFFFFF1A',\n 500_20: '#FFFFFF33',\n },\n blue: {\n 400: '#60A5FA',\n 500: '#2563EB',\n }\n};","import { CourierColors } from \"./courier-colors\";\n\nexport interface Colors {\n primary: string;\n secondary: string;\n border: string;\n link: string;\n icon: string;\n}\n\nexport interface Theme {\n colors: Colors\n button: {\n cornerRadius: string;\n }\n}\n\nexport const theme: { light: Theme, dark: Theme } = {\n light: {\n colors: {\n primary: CourierColors.black[500],\n secondary: CourierColors.white[500],\n border: CourierColors.gray[500],\n link: CourierColors.blue[500],\n icon: CourierColors.black[500]\n },\n button: {\n cornerRadius: '4px'\n }\n },\n dark: {\n colors: {\n primary: CourierColors.white[500],\n secondary: CourierColors.black[500],\n border: CourierColors.gray[400],\n link: CourierColors.blue[400],\n icon: CourierColors.white[500]\n },\n button: {\n cornerRadius: '4px'\n }\n }\n};","export type SystemThemeMode = 'light' | 'dark';\n\nexport type CourierComponentThemeMode = SystemThemeMode | 'system';\n\nexport const getSystemThemeMode = (): SystemThemeMode => {\n if (typeof window === 'undefined') {\n return 'light';\n }\n\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n};\n\nexport const addSystemThemeModeListener = (callback: (mode: SystemThemeMode) => void): (() => void) => {\n if (typeof window === 'undefined') {\n return () => { };\n }\n\n const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n\n const handler = (e: MediaQueryListEvent) => {\n callback(e.matches ? 'dark' : 'light');\n };\n\n mediaQuery.addEventListener('change', handler);\n\n return () => {\n mediaQuery.removeEventListener('change', handler);\n };\n};\n","/**\n * Resolve the class we can safely `extends`.\n * • In the browser → the real `HTMLElement`.\n * • During SSR / Node → a no-op stub so `class … extends …` is still valid.\n */\nconst HTMLElementBase: typeof HTMLElement = ((): any => {\n // `typeof HTMLElement` throws in some bundlers, so wrap in try/catch.\n try {\n // Will be `undefined` under Node.\n return typeof HTMLElement === 'undefined' ? class { } : HTMLElement;\n } catch {\n return class { };\n }\n})();\n\n/**\n * Universal base class for Courier web-components.\n *\n * ⚠️ IMPORTANT: When you create a concrete element, extend **this**\n * (or `HTMLElementBase`) instead of `HTMLElement` directly.\n */\nexport class CourierBaseElement extends HTMLElementBase {\n /** Tag-name you’ll use in `customElements.define()` */\n static get id(): string {\n return 'courier-base-element';\n }\n\n /** Prevents double-initialisation when the node is re-inserted. */\n #isInitialised = false;\n\n /* ------------------------------------------------------------------ */\n /* Custom-elements lifecycle hooks */\n /* ------------------------------------------------------------------ */\n\n connectedCallback() {\n if (this.#isInitialised) return;\n this.#isInitialised = true;\n this.onComponentMounted?.();\n }\n\n disconnectedCallback() {\n this.#isInitialised = false;\n this.onComponentUnmounted?.();\n }\n\n /* ------------------------------------------------------------------ */\n /* Overridable hooks */\n /* ------------------------------------------------------------------ */\n\n /** Called **once** when the element first becomes part of the DOM. */\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n protected onComponentMounted(): void { }\n\n /** Called when the element is removed from the DOM. */\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n protected onComponentUnmounted(): void { }\n}","import { addSystemThemeModeListener, getSystemThemeMode, SystemThemeMode } from \"../utils/system-theme-mode\";\nimport { CourierBaseElement } from \"./courier-base-element\";\n\nexport class CourierSystemThemeElement extends CourierBaseElement {\n\n static get id(): string {\n return 'courier-system-theme-element';\n }\n\n // State\n private _currentSystemTheme: SystemThemeMode;\n public get currentSystemTheme() {\n return this._currentSystemTheme;\n }\n\n // System theme\n private _systemThemeCleanup: (() => void) | undefined;\n\n constructor() {\n super();\n\n // Get the initial system theme\n this._currentSystemTheme = getSystemThemeMode();\n\n // Set up the system theme listener\n this._systemThemeCleanup = addSystemThemeModeListener(mode => {\n this._currentSystemTheme = mode;\n this.onSystemThemeChange(mode);\n });\n }\n\n protected onComponentUnmounted() {\n this._systemThemeCleanup?.();\n super.onComponentUnmounted();\n }\n\n protected onSystemThemeChange(_: SystemThemeMode): void {\n // Default implementation does nothing\n }\n\n}","import { CourierComponentThemeMode, SystemThemeMode } from \"../utils/system-theme-mode\";\nimport { theme } from \"../utils/theme\";\nimport { CourierSystemThemeElement } from \"./courier-system-theme-element\";\n\nexport type CourierButtonVariant = 'primary' | 'secondary' | 'tertiary';\n\nexport type CourierButtonProps = {\n mode: CourierComponentThemeMode\n text?: string,\n shadow?: string,\n border?: string,\n borderRadius?: string,\n backgroundColor?: string,\n hoverBackgroundColor?: string,\n activeBackgroundColor?: string,\n fontFamily?: string,\n fontSize?: string,\n fontWeight?: string,\n textColor?: string,\n variant?: CourierButtonVariant,\n onClick?: () => void\n}\n\nconst baseButtonStyles = {\n borderRadius: '4px',\n fontSize: '14px'\n} as const;\n\nexport const CourierButtonVariants = {\n primary: (mode: SystemThemeMode) => {\n return {\n ...baseButtonStyles,\n backgroundColor: theme[mode].colors.primary,\n textColor: theme[mode].colors.secondary,\n fontWeight: '500',\n shadow: 'none'\n };\n },\n\n secondary: (mode: SystemThemeMode) => {\n return {\n ...baseButtonStyles,\n backgroundColor: theme[mode].colors.secondary,\n textColor: theme[mode].colors.primary,\n fontWeight: '500',\n border: `1px solid ${theme[mode].colors.border}`,\n shadow: mode === 'light'\n ? '0px 1px 2px 0px rgba(0, 0, 0, 0.06)'\n : '0px 1px 2px 0px rgba(255, 255, 255, 0.1)'\n };\n },\n\n tertiary: (mode: SystemThemeMode) => {\n return {\n ...baseButtonStyles,\n backgroundColor: theme[mode].colors.border,\n textColor: theme[mode].colors.primary,\n fontWeight: '500',\n border: 'none',\n shadow: 'none'\n };\n }\n} as const;\n\nexport class CourierButton extends CourierSystemThemeElement {\n\n static get id(): string {\n return 'courier-button';\n }\n\n // Components\n private _button: HTMLButtonElement;\n private _style: HTMLStyleElement;\n\n constructor(props: CourierButtonProps) {\n super();\n const shadow = this.attachShadow({ mode: 'open' });\n\n this._button = document.createElement('button');\n this._button.setAttribute('part', 'button');\n\n this._style = document.createElement('style');\n this._style.textContent = this.getStyles(props);\n\n shadow.appendChild(this._style);\n shadow.appendChild(this._button);\n\n this.updateButton(props);\n\n // Add click handler with prevent default and stop propagation\n this._button.addEventListener('click', (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n if (props.onClick) {\n props.onClick();\n }\n });\n }\n\n private getStyles(props: CourierButtonProps): string {\n\n const mode = props.mode === 'system' ? this.currentSystemTheme : props.mode;\n\n const defaultTextColor = () => {\n const secondary = CourierButtonVariants.secondary(mode);\n return secondary.textColor;\n }\n\n const defaultBackgroundColor = () => {\n const secondary = CourierButtonVariants.secondary(mode);\n return secondary.backgroundColor;\n }\n\n const defaultBorder = () => {\n const secondary = CourierButtonVariants.secondary(mode);\n return secondary.border;\n }\n\n const defaultShadow = () => {\n const secondary = CourierButtonVariants.secondary(mode);\n return secondary.shadow;\n }\n\n const defaultBorderRadius = () => {\n const secondary = CourierButtonVariants.secondary(mode);\n return secondary.borderRadius;\n }\n\n const defaultFontSize = () => {\n const secondary = CourierButtonVariants.secondary(mode);\n return secondary.fontSize;\n }\n\n const defaultFontWeight = () => {\n const secondary = CourierButtonVariants.secondary(mode);\n return secondary.fontWeight;\n }\n\n return `\n :host {\n display: inline-block;\n }\n\n button {\n border: none;\n border-radius: ${props.borderRadius ?? defaultBorderRadius()};\n font-weight: ${props.fontWeight ?? defaultFontWeight()};\n font-family: ${props.fontFamily ?? 'inherit'};\n font-size: ${props.fontSize ?? defaultFontSize()};\n padding: 6px 10px;\n cursor: pointer;\n width: 100%;\n height: 100%;\n background-color: ${props.backgroundColor ?? defaultBackgroundColor()};\n color: ${props.textColor ?? defaultTextColor()};\n border: ${props.border ?? defaultBorder()};\n box-shadow: ${props.shadow ?? defaultShadow()};\n touch-action: manipulation;\n }\n\n button:hover {\n ${props.hoverBackgroundColor ? `background-color: ${props.hoverBackgroundColor};` : 'filter: brightness(0.9);'}\n }\n\n button:active {\n ${props.activeBackgroundColor ? `background-color: ${props.activeBackgroundColor};` : 'filter: brightness(0.8);'}\n }\n\n button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n `;\n }\n\n public updateButton(props: CourierButtonProps) {\n if (props.text) {\n this._button.textContent = props.text;\n }\n this._style.textContent = this.getStyles(props);\n }\n}","import { CourierColors } from \"../utils/courier-colors\";\nimport { CourierBaseElement } from \"./courier-base-element\";\n\nexport const CourierIconSVGs = {\n inbox: `<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M5.5 14.5V17C5.5 17.2812 5.71875 17.5 6 17.5H18C18.25 17.5 18.5 17.2812 18.5 17V14.5H15.9375L15.2812 15.8125C15.0938 16.25 14.6562 16.5 14.1875 16.5H9.78125C9.3125 16.5 8.875 16.25 8.6875 15.8125L8.03125 14.5H5.5ZM18.1875 13L16.6562 6.90625C16.5938 6.65625 16.4062 6.5 16.1875 6.5H7.8125C7.5625 6.5 7.375 6.65625 7.3125 6.90625L5.78125 13H8.1875C8.65625 13 9.09375 13.2812 9.3125 13.7188L9.9375 15H14.0312L14.6875 13.7188C14.875 13.2812 15.3125 13 15.7812 13H18.1875ZM4 14.25C4 14.0938 4 13.9375 4.03125 13.7812L5.84375 6.53125C6.09375 5.625 6.875 5 7.8125 5H16.1875C17.0938 5 17.9062 5.625 18.125 6.53125L19.9375 13.7812C19.9688 13.9375 20 14.0938 20 14.25V17C20 18.125 19.0938 19 18 19H6C4.875 19 4 18.125 4 17V14.25Z\" fill=\"currentColor\"/>\n</svg>`,\n archive: `<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M5.5 6.5V8H18.5V6.5H5.5ZM5 5H19C19.5312 5 20 5.46875 20 6V8.5C20 9.0625 19.5312 9.5 19 9.5H5C4.4375 9.5 4 9.0625 4 8.5V6C4 5.46875 4.4375 5 5 5ZM9 11.75C9 11.3438 9.3125 11 9.75 11H14.25C14.6562 11 15 11.3438 15 11.75C15 12.1875 14.6562 12.5 14.25 12.5H9.75C9.3125 12.5 9 12.1875 9 11.75ZM5 17V10.5H6.5V17C6.5 17.2812 6.71875 17.5 7 17.5H17C17.25 17.5 17.5 17.2812 17.5 17V10.5H19V17C19 18.125 18.0938 19 17 19H7C5.875 19 5 18.125 5 17Z\" fill=\"currentColor\"/>\n</svg>`,\n check: `<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M18.793 7.33203C19.0742 7.64453 19.0742 8.11328 18.793 8.39453L10.543 16.6445C10.2305 16.957 9.76172 16.957 9.48047 16.6445L5.23047 12.3945C4.91797 12.1133 4.91797 11.6445 5.23047 11.3633C5.51172 11.0508 5.98047 11.0508 6.26172 11.3633L9.98047 15.082L17.7305 7.33203C18.0117 7.05078 18.4805 7.05078 18.7617 7.33203H18.793Z\" fill=\"currentColor\"/>\n</svg>`,\n filter: `<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M5 7C5 6.59375 5.3125 6.25 5.75 6.25H18.25C18.6562 6.25 19 6.59375 19 7C19 7.4375 18.6562 7.75 18.25 7.75H5.75C5.3125 7.75 5 7.4375 5 7ZM7 12C7 11.5938 7.3125 11.25 7.75 11.25H16.25C16.6562 11.25 17 11.5938 17 12C17 12.4375 16.6562 12.75 16.25 12.75H7.75C7.3125 12.75 7 12.4375 7 12ZM14 17C14 17.4375 13.6562 17.75 13.25 17.75H10.75C10.3125 17.75 10 17.4375 10 17C10 16.5938 10.3125 16.25 10.75 16.25H13.25C13.6562 16.25 14 16.5938 14 17Z\" fill=\"currentColor\"/>\n</svg>`,\n right: `<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M18.75 12.547L13.25 17.797C12.9375 18.0783 12.4688 18.0783 12.1875 17.7658C11.9062 17.4533 11.9062 16.9845 12.2188 16.7033L16.375 12.7345H5.75C5.3125 12.7345 5 12.422 5 11.9845C5 11.5783 5.3125 11.2345 5.75 11.2345H16.375L12.2188 7.29703C11.9062 7.01578 11.9062 6.51578 12.1875 6.23453C12.4688 5.92203 12.9688 5.92203 13.25 6.20328L18.75 11.4533C18.9062 11.6095 19 11.797 19 11.9845C19 12.2033 18.9062 12.3908 18.75 12.547Z\" fill=\"currentColor\"/>\n</svg>`,\n remove: `<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M16.7969 8.27344L13.0469 12.0234L16.7656 15.7422C17.0781 16.0234 17.0781 16.4922 16.7656 16.7734C16.4844 17.0859 16.0156 17.0859 15.7344 16.7734L11.9844 13.0547L8.26562 16.7734C7.98438 17.0859 7.51562 17.0859 7.23438 16.7734C6.92188 16.4922 6.92188 16.0234 7.23438 15.7109L10.9531 11.9922L7.23438 8.27344C6.92188 7.99219 6.92188 7.52344 7.23438 7.21094C7.51562 6.92969 7.98438 6.92969 8.29688 7.21094L12.0156 10.9609L15.7344 7.24219C16.0156 6.92969 16.4844 6.92969 16.7969 7.24219C17.0781 7.52344 17.0781 7.99219 16.7969 8.27344Z\" fill=\"currentColor\"/>\n</svg>`,\n overflow: `<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M18.5117 11.9883C18.5117 12.5508 18.1992 13.0195 17.7617 13.3008C17.293 13.582 16.6992 13.582 16.2617 13.3008C15.793 13.0195 15.5117 12.5508 15.5117 11.9883C15.5117 11.457 15.793 10.9883 16.2617 10.707C16.6992 10.4258 17.293 10.4258 17.7617 10.707C18.1992 10.9883 18.5117 11.457 18.5117 11.9883ZM13.5117 11.9883C13.5117 12.5508 13.1992 13.0195 12.7617 13.3008C12.293 13.582 11.6992 13.582 11.2617 13.3008C10.793 13.0195 10.5117 12.5508 10.5117 11.9883C10.5117 11.457 10.793 10.9883 11.2617 10.707C11.6992 10.4258 12.293 10.4258 12.7617 10.707C13.1992 10.9883 13.5117 11.457 13.5117 11.9883ZM7.01172 13.4883C6.44922 13.4883 5.98047 13.207 5.69922 12.7383C5.41797 12.3008 5.41797 11.707 5.69922 11.2383C5.98047 10.8008 6.44922 10.4883 7.01172 10.4883C7.54297 10.4883 8.01172 10.8008 8.29297 11.2383C8.57422 11.707 8.57422 12.3008 8.29297 12.7383C8.01172 13.207 7.54297 13.4883 7.01172 13.4883Z\" fill=\"currentColor\"/>\n</svg>`,\n read: `<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M7 6.5C6.71875 6.5 6.5 6.75 6.5 7V17C6.5 17.2812 6.71875 17.5 7 17.5H17C17.25 17.5 17.5 17.2812 17.5 17V7C17.5 6.75 17.25 6.5 17 6.5H7ZM5 7C5 5.90625 5.875 5 7 5H17C18.0938 5 19 5.90625 19 7V17C19 18.125 18.0938 19 17 19H7C5.875 19 5 18.125 5 17V7ZM15.5312 10.5312L11.5312 14.5312C11.2188 14.8438 10.75 14.8438 10.4688 14.5312L8.46875 12.5312C8.15625 12.25 8.15625 11.7812 8.46875 11.5C8.75 11.1875 9.21875 11.1875 9.53125 11.5L11 12.9688L14.4688 9.46875C14.75 9.1875 15.2188 9.1875 15.5 9.46875C15.8125 9.78125 15.8125 10.25 15.5 10.5312H15.5312Z\" fill=\"currentColor\"/>\n</svg>`,\n archiveRead: `<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M7.5 6.5V15.25H16.5V6.5H7.5ZM6 15.25V6.5C6 5.6875 6.65625 5 7.5 5H16.5C17.3125 5 18 5.6875 18 6.5V15.25C18.4062 15.25 18.75 15.5938 18.75 16C18.75 16.4375 18.4062 16.75 18 16.75H6C5.5625 16.75 5.25 16.4375 5.25 16C5.25 15.5938 5.5625 15.25 6 15.25ZM5 13V14.5H4.5V17.5H19.5V14.5H19V13H19.5C20.3125 13 21 13.6875 21 14.5V17.5C21 18.3438 20.3125 19 19.5 19H4.5C3.65625 19 3 18.3438 3 17.5V14.5C3 13.6875 3.65625 13 4.5 13H5ZM15.0312 9.625L11.6875 12.9688C11.5312 13.0938 11.3438 13.1875 11.1562 13.1875C10.9375 13.1875 10.75 13.0938 10.625 12.9688L8.96875 11.2812C8.65625 11 8.65625 10.5312 8.96875 10.25C9.25 9.9375 9.71875 9.9375 10 10.25L11.1562 11.375L13.9688 8.5625C14.25 8.28125 14.7188 8.28125 15 8.5625C15.3125 8.875 15.3125 9.34375 15 9.625H15.0312Z\" fill=\"currentColor\"/>\n</svg>`,\n unread: `<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M17 6.5H7C6.71875 6.5 6.5 6.75 6.5 7V17C6.5 17.2812 6.71875 17.5 7 17.5H17C17.25 17.5 17.5 17.2812 17.5 17V7C17.5 6.75 17.25 6.5 17 6.5ZM7 5H17C18.0938 5 19 5.90625 19 7V17C19 18.125 18.0938 19 17 19H7C5.875 19 5 18.125 5 17V7C5 5.90625 5.875 5 7 5Z\" fill=\"currentColor\"/>\n</svg>`,\n unarchive: `<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M5.5 11C5.0625 11 4.75 10.6875 4.75 10.25V5.75C4.75 5.34375 5.0625 5 5.5 5C5.90625 5 6.25 5.34375 6.25 5.75V8.28125L6.875 7.53125C8.15625 6 10.0625 5 12.25 5C16.0938 5 19.25 8.15625 19.25 12C19.25 15.875 16.0938 19 12.25 19C10.6562 19 9.21875 18.5 8.03125 17.625C7.71875 17.375 7.625 16.9062 7.875 16.5625C8.125 16.2188 8.59375 16.1562 8.9375 16.4062C9.84375 17.0938 11 17.5 12.25 17.5C15.2812 17.5 17.75 15.0625 17.75 12C17.75 8.96875 15.2812 6.5 12.25 6.5C10.5312 6.5 9.03125 7.28125 8 8.5L7.15625 9.5H10C10.4062 9.5 10.75 9.84375 10.75 10.25C10.75 10.6875 10.4062 11 10 11H5.5Z\" fill=\"currentColor\"/>\n</svg>`\n};\n\nexport class CourierIcon extends CourierBaseElement {\n\n static get id(): string {\n return 'courier-icon';\n }\n\n // State\n private _color?: string;\n private _svg?: string;\n\n // Components\n private _iconContainer: HTMLElement;\n private _style: HTMLStyleElement;\n\n constructor(color?: string, svg?: string) {\n super();\n\n // Set initial values from constructor\n this._color = color ?? CourierColors.black[500];\n this._svg = svg;\n\n // Create components\n const shadow = this.attachShadow({ mode: 'open' });\n this._iconContainer = document.createElement('div');\n shadow.appendChild(this._iconContainer);\n\n // Add styles\n this._style = document.createElement('style');\n this._style.textContent = this.getStyles(this._color);\n shadow.appendChild(this._style);\n\n // Refresh\n this.refresh();\n }\n\n private getStyles(color: string): string {\n return `\n :host {\n display: inline-block;\n line-height: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n svg {\n width: 24px;\n height: 24px;\n color: ${color};\n }\n `;\n }\n\n private refresh() {\n if (this._svg) {\n this._iconContainer.innerHTML = this._svg;\n }\n if (this._color) {\n this._style.textContent = this.getStyles(this._color);\n }\n }\n\n public updateColor(color: string) {\n this._color = color;\n this.refresh();\n }\n\n public updateSVG(svg: string) {\n this._svg = svg;\n this.refresh();\n }\n}\n","import { theme } from \"../utils/theme\";\nimport { CourierBaseElement } from \"./courier-base-element\";\n\nexport class CourierLink extends CourierBaseElement {\n\n static get id(): string {\n return 'courier-link';\n }\n\n private link: HTMLAnchorElement;\n static observedAttributes = [\n 'href',\n 'variant',\n 'disabled',\n 'color',\n 'underline',\n 'mode',\n 'target',\n 'font-family',\n 'font-size'\n ];\n\n constructor() {\n super();\n const shadow = this.attachShadow({ mode: 'open' });\n\n this.link = document.createElement('a');\n this.link.setAttribute('part', 'link');\n\n const style = document.createElement('style');\n style.textContent = `\n :host {\n display: inline-block;\n }\n\n a {\n text-decoration: none;\n border-radius: 4px;\n cursor: pointer;\n font-weight: 500;\n transition: all 0.2s ease;\n font-family: var(--courier-link-font-family, inherit);\n font-size: var(--courier-link-font-size, inherit);\n }\n\n /* Variants */\n a[data-variant=\"primary\"][data-mode=\"light\"] {\n color: var(--courier-link-color, ${theme.light.colors.link});\n }\n\n a[data-variant=\"primary\"][data-mode=\"light\"]:hover {\n opacity: 0.8;\n }\n\n a[data-variant=\"primary\"][data-mode=\"light\"]:active {\n opacity: 0.6;\n }\n\n a[data-variant=\"primary\"][data-mode=\"dark\"] {\n color: var(--courier-link-color, ${theme.dark.colors.link});\n }\n\n a[data-variant=\"primary\"][data-mode=\"dark\"]:hover {\n opacity: 0.8;\n }\n\n a[data-variant=\"primary\"][data-mode=\"dark\"]:active {\n opacity: 0.6;\n }\n\n a[data-underline=\"true\"] {\n text-decoration: underline;\n }\n\n a:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n pointer-events: none;\n }\n `;\n\n shadow.appendChild(style);\n shadow.appendChild(this.link);\n\n this.updateVariant();\n this.updateUnderline();\n this.updateMode();\n }\n\n connectedCallback() {\n const slot = document.createElement('slot');\n this.link.appendChild(slot);\n this.updateHref();\n }\n\n attributeChangedCallback(name: string, oldValue: string, newValue: string) {\n if (oldValue === newValue) return;\n\n switch (name) {\n case 'href':\n this.updateHref();\n break;\n case 'variant':\n case 'mode':\n this.updateVariant();\n break;\n case 'disabled':\n this.link.style.pointerEvents = this.hasAttribute('disabled') ? 'none' : 'auto';\n this.link.style.opacity = this.hasAttribute('disabled') ? '0.6' : '1';\n break;\n case 'color':\n this.updateColor();\n break;\n case 'underline':\n this.updateUnderline();\n break;\n case 'target':\n this.updateTarget();\n break;\n case 'font-family':\n this.updateFontFamily();\n break;\n case 'font-size':\n this.updateFontSize();\n break;\n }\n }\n\n private updateHref() {\n const href = this.getAttribute('href');\n if (href) {\n this.link.href = href;\n }\n }\n\n private updateVariant() {\n const variant = this.getAttribute('variant') || 'primary';\n const mode = this.getAttribute('mode') || 'light';\n this.link.setAttribute('data-variant', variant);\n this.link.setAttribute('data-mode', mode);\n }\n\n private updateColor() {\n const color = this.getAttribute('color');\n if (color) {\n this.link.style.setProperty('--courier-link-color', color);\n } else {\n this.link.style.removeProperty('--courier-link-color');\n }\n }\n\n private updateUnderline() {\n const underline = this.getAttribute('underline') === 'true';\n this.link.setAttribute('data-underline', underline.toString());\n }\n\n private updateMode() {\n const mode = this.getAttribute('mode') || 'light';\n this.link.setAttribute('data-mode', mode);\n }\n\n private updateTarget() {\n const target = this.getAttribute('target');\n if (target) {\n this.link.target = target;\n }\n }\n\n private updateFontFamily() {\n const fontFamily = this.getAttribute('font-family');\n if (fontFamily) {\n this.link.style.setProperty('--courier-link-font-family', fontFamily);\n } else {\n this.link.style.removeProperty('--courier-link-font-family');\n }\n }\n\n private updateFontSize() {\n const fontSize = this.getAttribute('font-size');\n if (fontSize) {\n this.link.style.setProperty('--courier-link-font-size', fontSize);\n } else {\n this.link.style.removeProperty('--courier-link-font-size');\n }\n }\n}\n","import { CourierSystemThemeElement } from \"./courier-system-theme-element\";\n\nexport class CourierFactoryElement extends CourierSystemThemeElement {\n\n constructor() {\n super();\n }\n\n // Build the element with a factory function\n public build(newElement: HTMLElement | undefined | null) {\n if (newElement === null) {\n this.replaceChildren();\n return;\n }\n const element = newElement ?? this.defaultElement();\n this.replaceChildren(element);\n }\n\n // Default element to be used if no factory is provided\n public defaultElement(): HTMLElement {\n const element = document.createElement('div');\n element.textContent = 'Default Element Factory';\n element.style.cssText = `\n background-color: red;\n text-align: center;\n padding: 12px;\n `;\n return element;\n }\n\n}","import { CourierFactoryElement } from \"./courier-element\";\nimport { CourierButton, CourierButtonProps, CourierButtonVariants } from \"./courier-button\";\nimport { SystemThemeMode } from \"../utils/system-theme-mode\";\n\nexport type CourierInfoStateProps = {\n title?: {\n text?: string,\n textColor?: string,\n fontSize?: string,\n fontWeight?: string,\n fontFamily?: string\n };\n button: CourierButtonProps;\n};\n\nexport class CourierInfoState extends CourierFactoryElement {\n\n static get id(): string {\n return 'courier-info-state';\n }\n\n // Props\n private _props: CourierInfoStateProps;\n\n // Components\n private _title?: HTMLElement;\n private _button?: CourierButton;\n private _style?: HTMLStyleElement;\n\n constructor(props: CourierInfoStateProps) {\n super();\n this._props = props;\n }\n\n defaultElement(): HTMLElement {\n const container = document.createElement('div');\n\n // Title\n this._title = document.createElement('h2');\n if (this._props.title?.text) {\n this._title.textContent = this._props.title.text;\n }\n\n // Button\n this._button = new CourierButton(this._props.button ?? CourierButtonVariants.secondary(this.currentSystemTheme));\n\n this._style = document.createElement('style');\n this._style.textContent = this.getStyles(this._props);\n\n container.className = 'container';\n container.appendChild(this._style);\n container.appendChild(this._title);\n container.appendChild(this._button);\n this.appendChild(container);\n\n return container;\n }\n\n protected onSystemThemeChange(_: SystemThemeMode) {\n this.updateStyles(this._props);\n }\n\n private getStyles(props: CourierInfoStateProps): string {\n\n return `\n :host {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n }\n\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 16px;\n text-align: center;\n padding: 24px;\n box-sizing: border-box;\n height: 100%;\n }\n\n .container h2 {\n margin: 0;\n color: ${props.title?.textColor ?? 'red'};\n font-size: ${props.title?.fontSize ?? '16px'};\n font-weight: ${props.title?.fontWeight ?? '500'};\n font-family: ${props.title?.fontFamily ?? 'inherit'};\n }\n `;\n }\n\n public updateStyles(props: CourierInfoStateProps) {\n this._props = props;\n if (this._style) {\n this._style.textContent = this.getStyles(props);\n }\n if (this._button) {\n this._button.updateButton(props.button);\n }\n }\n\n}\n","import { CourierBaseElement } from \"./courier-base-element\";\nimport { CourierIcon } from \"./courier-icon\";\n\nexport class CourierIconButton extends CourierBaseElement {\n\n static get id(): string {\n return 'courier-icon-button';\n }\n\n // State\n private _backgroundColor?: string;\n private _hoverBackgroundColor?: string;\n private _activeBackgroundColor?: string;\n private _borderRadius?: string;\n private _height?: string;\n private _width?: string;\n\n // Elements\n private _style: HTMLStyleElement;\n private _button: HTMLButtonElement;\n private _icon: CourierIcon;\n\n constructor(svg?: string, color?: string, backgroundColor?: string, hoverBackgroundColor?: string, activeBackgroundColor?: string, borderRadius?: string, height?: string, width?: string) {\n super();\n\n this._borderRadius = borderRadius;\n this._backgroundColor = backgroundColor;\n this._hoverBackgroundColor = hoverBackgroundColor;\n this._activeBackgroundColor = activeBackgroundColor;\n this._height = height;\n this._width = width;\n\n const shadow = this.attachShadow({ mode: 'open' });\n\n this._button = document.createElement('button');\n this._button.setAttribute('part', 'button');\n this._icon = new CourierIcon(color, svg);\n\n this._style = document.createElement('style');\n this.refresh();\n\n shadow.appendChild(this._style);\n this._button.appendChild(this._icon);\n shadow.appendChild(this._button);\n }\n\n private refresh() {\n this._style.textContent = this.getStyles();\n }\n\n private getStyles(): string {\n return `\n :host {\n display: inline-block;\n border-radius: ${this._borderRadius ?? '50%'};\n }\n\n button {\n border: none;\n border-radius: ${this._borderRadius ?? '50%'};\n cursor: pointer;\n width: ${this._width ?? '36px'};\n height: ${this._height ?? '36px'};\n display: flex;\n align-items: center;\n justify-content: center;\n background: ${this._backgroundColor ?? 'transparent'};\n transition: background-color 0.2s ease;\n touch-action: manipulation;\n }\n\n button:hover {\n background-color: ${this._hoverBackgroundColor ?? 'red'};\n }\n\n button:active {\n background-color: ${this._activeBackgroundColor ?? 'red'};\n }\n\n button:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n\n [part=\"icon\"] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n }\n `;\n }\n\n updateIconColor(color: string) {\n this._icon.updateColor(color);\n }\n\n updateIconSVG(svg: string) {\n this._icon.updateSVG(svg);\n }\n\n updateBackgroundColor(color: string) {\n this._backgroundColor = color;\n this.refresh();\n }\n\n updateHoverBackgroundColor(color: string) {\n this._hoverBackgroundColor = color;\n this.refresh();\n }\n\n updateActiveBackgroundColor(color: string) {\n this._activeBackgroundColor = color;\n this.refresh();\n }\n\n}","export function registerElement(element: CustomElementConstructor & { id: string }) {\n if (typeof window !== 'undefined' && !customElements.get(element.id)) {\n customElements.define(element.id, element);\n }\n}\n\nexport function injectGlobalStyle(styleId: string, styles: string): HTMLStyleElement {\n // Inject component-scoped styles just once per document\n const selector = `style[data-${styleId}]`;\n const existingStyle = document.querySelector(selector) as HTMLStyleElement;\n\n if (!existingStyle) {\n const style = document.createElement('style');\n style.setAttribute(`data-${styleId}`, '');\n style.textContent = styles;\n document.head.appendChild(style);\n return style;\n }\n\n return existingStyle;\n}","// Import core UI components\nimport { CourierButton } from './components/courier-button';\nimport { CourierIcon } from './components/courier-icon';\nimport { CourierLink } from './components/courier-link';\nimport { CourierInfoState } from './components/courier-info-state';\nimport { CourierIconButton } from './components/courier-icon-button';\nimport { CourierSystemThemeElement } from './components/courier-system-theme-element';\nimport { registerElement } from './utils/registeration';\n\n// Export all components for external use\nexport * from './components/courier-button';\nexport * from './components/courier-icon';\nexport * from './components/courier-link';\nexport * from './components/courier-info-state';\nexport * from './components/courier-icon-button';\nexport * from './components/courier-element';\nexport * from './components/courier-system-theme-element';\nexport * from './components/courier-base-element';\nexport * from './utils/system-theme-mode';\nexport * from './utils/theme';\nexport * from './utils/courier-colors';\nexport * from './utils/registeration';\n\n// Register core UI components\nregisterElement(CourierButton);\nregisterElement(CourierIcon);\nregisterElement(CourierLink);\nregisterElement(CourierInfoState);\nregisterElement(CourierIconButton);\nregisterElement(CourierSystemThemeElement);"],"names":[],"mappings":";;;;;;;;;;AAAO;AAAA,MAAM,gBAAgB;AAAA,EAC3B,OAAO;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,OAAQ;AAAA,IACR,OAAQ;AAAA,EAAA;AAAA,EAEV,MAAM;AAAA,IACJ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA,EAEP,OAAO;AAAA,IACL,KAAK;AAAA,IACL,OAAQ;AAAA,IACR,OAAQ;AAAA,EAAA;AAAA,EAEV,MAAM;AAAA,IACJ,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAET;ACLO,MAAM,QAAuC;AAAA,EAClD,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,SAAS,cAAc,MAAM,GAAG;AAAA,MAChC,WAAW,cAAc,MAAM,GAAG;AAAA,MAClC,QAAQ,cAAc,KAAK,GAAG;AAAA,MAC9B,MAAM,cAAc,KAAK,GAAG;AAAA,MAC5B,MAAM,cAAc,MAAM,GAAG;AAAA,IAAA;AAAA,IAE/B,QAAQ;AAAA,MACN,cAAc;AAAA,IAAA;AAAA,EAChB;AAAA,EAEF,MAAM;AAAA,IACJ,QAAQ;AAAA,MACN,SAAS,cAAc,MAAM,GAAG;AAAA,MAChC,WAAW,cAAc,MAAM,GAAG;AAAA,MAClC,QAAQ,cAAc,KAAK,GAAG;AAAA,MAC9B,MAAM,cAAc,KAAK,GAAG;AAAA,MAC5B,MAAM,cAAc,MAAM,GAAG;AAAA,IAAA;AAAA,IAE/B,QAAQ;AAAA,MACN,cAAc;AAAA,IAAA;AAAA,EAChB;AAEJ;ACtCO,MAAM,qBAAqB,MAAuB;AACvD,MAA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