@aquera/nile-elements 1.2.7-beta-1.0 → 1.2.7-beta-1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"nile-light-tooltip.js","sourceRoot":"","sources":["../../../src/nile-light-tooltip/nile-light-tooltip.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAGH,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAA0B,MAAM,UAAU,CAAC;AAElD;;;;GAIG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,WAAW;IACxC,MAAM,KAAK,MAAM;QACtB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAES,gBAAgB;QACxB,gCAAgC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAaD;QACE,KAAK,EAAE,CAAC;QAZV,2BAA2B;QACC,YAAO,GAAG,EAAE,CAAC;QAEzC,0DAA0D;QAC9B,cAAS,GAAuB,KAAK,CAAC;QAElE,oDAAoD;QACxB,YAAO,GAAqB,kBAAkB,CAAC;QAMzE,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACK,iBAAiB;QACvB,MAAM,QAAQ,GAAG,mBAAmB,CAAC;QACrC,IAAI,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC;YAAE,OAAO,CAAC,mBAAmB;QAElE,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC9C,KAAK,CAAC,EAAE,GAAG,QAAQ,CAAC;QACpB,KAAK,CAAC,WAAW,GAAG;;;;;;;;;;;;;;;;KAgBnB,CAAC;QACF,QAAQ,CAAC,IAAI,CAAC,WAAW,CAA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cesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, CSSResultArray, TemplateResult, PropertyValues } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styles } from './nile-light-tooltip.css';\nimport NileElement from '../internal/nile-element';\nimport tippy, { Instance, Props } from 'tippy.js';\n\n/**\n * Nile light-tooltip component.\n *\n * @tag nile-light-tooltip\n */\n@customElement('nile-light-tooltip')\nexport class NileLightTooltip extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n protected createRenderRoot() {\n // Keep tooltip in the light DOM\n return this;\n }\n\n /** Tooltip text content */\n @property({ type: String }) content = '';\n\n /** Placement of the tooltip (top, right, bottom, left) */\n @property({ type: String }) placement: Props['placement'] = 'top';\n\n /** Whether tooltip should show on hover or click */\n @property({ type: String }) trigger: Props['trigger'] = 'mouseenter focus';\n\n private tooltipInstance?: Instance[];\n\n constructor() {\n super();\n this.injectTippyStyles();\n }\n\n /**\n * Injects Tippy.js base styles into the Light DOM (document.head)\n * if not already present.\n */\n private injectTippyStyles(): void {\n const STYLE_ID = 'nile-tippy-styles';\n if (document.getElementById(STYLE_ID)) return; // avoid duplicates\n\n const style = document.createElement('style');\n style.id = STYLE_ID;\n style.textContent = `\n .tippy-box[data-animation=fade][data-state=hidden]{opacity:0}\n [data-tippy-root]{max-width:calc(100vw - 10px)}\n .tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}\n .tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}\n .tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}\n .tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}\n .tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}\n .tippy-box[data-placement^=left]>.tippy-arrow{right:0}\n .tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}\n .tippy-box[data-placement^=right]>.tippy-arrow{left:0}\n .tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}\n .tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}\n .tippy-arrow{width:16px;height:16px;color:#333}\n .tippy-arrow:before{content:\"\";position:absolute;border-color:transparent;border-style:solid}\n .tippy-content{position:relative;padding:5px 9px;z-index:1}\n `;\n document.head.appendChild(style);\n }\n\n firstUpdated(): void {\n const assignedNodes = this.querySelectorAll('*');\n if (assignedNodes.length > 0) {\n this.tooltipInstance = tippy(assignedNodes, {\n content: this.content,\n placement: this.placement,\n trigger: this.trigger,\n theme: 'light',\n animation: 'fade',\n });\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.tooltipInstance?.forEach((t) => t.destroy());\n }\n\n updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('content')) {\n this.tooltipInstance?.forEach((t) => (t.setContent(this.content)));\n }\n\t \n }\n \n\n \n}\n\nexport default NileLightTooltip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-light-tooltip': NileLightTooltip;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-light-tooltip.js","sourceRoot":"","sources":["../../../src/nile-light-tooltip/nile-light-tooltip.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,EAAmB,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC5E,OAA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Array, PropertyValues } from 'lit';\nimport { styles } from './nile-light-tooltip.css';\nimport NileElement from '../internal/nile-element';\nimport tippy, { Instance, Props, followCursor, roundArrow } from 'tippy.js';\nimport { parseFollowCursor, parseDuration } from './utils';\n\n/**\n * Nile light-tooltip component.\n *\t\n * Supports wrapper and sibling (for) modes.\n * Aligns with Tippy.js props and Nile design system.\n *\n * @tag nile-light-tooltip\n */\n@customElement('nile-light-tooltip')\nexport class NileLightTooltip extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n protected createRenderRoot() {\n return this; // Light DOM\n }\n\n // ───────────── Props ─────────────\n /** ID of the target element (for sibling mode) */\n @property({ type: String, attribute: 'for' }) for: string | null = null;\n\n /** Tooltip content text or HTML */\n @property({ type: String, reflect: true }) content = '';\n\n /** Tooltip size (applies CSS class) */\n @property({ type: String, reflect: true }) size: 'small' | 'large' = 'small';\n\n /** Animation duration for show/hide (ms). Can be a single value or [show, hide]. */\n@property({ type: String, reflect: true }) duration: string | number | [number, number] = 200;\n\n\n\n /** Placement of the tooltip */\n @property({ type: String })\n placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end'\n | 'auto'\n | 'auto-start'\n | 'auto-end' = 'top';\n\n /** Disabled state */\n @property({ type: Boolean }) disabled = false;\n\n /** Distance (Popper offset Y or main axis) */\n @property({ type: Number }) distance = 8;\n\n /** Skidding (Popper offset X or cross axis) */\n @property({ type: Number }) skidding = 0;\n\n /** Whether tooltip is open (controlled mode) */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /** Trigger behavior */\n @property({ type: String }) trigger: Props['trigger'] = 'mouseenter focus';\n\n /** Hoist the tooltip to body (avoid clipping) */\n @property({ type: Boolean, reflect: true }) hoist = false;\n\n /** Allow HTML content rendering */\n @property({ type: Boolean, reflect: true }) allowHTML = false;\n\n /** Cursor following mode */\n @property({ type: String, reflect: true, attribute: true })\n followCursor:\n | boolean\n | 'initial'\n | 'horizontal'\n | 'vertical'\n | 'true'\n | 'false' = false;\n\n /** Arrow type for tooltip */\n @property({ type: String, reflect: true, attribute: true })\n arrow: 'default' | 'round' | 'large' | 'small' | 'wide' | 'narrow' | 'none' =\n 'default';\n\n private tooltipInstances?: Instance[];\n private singleInstance?: Instance;\n private targetEl?: HTMLElement | null;\n private generatedId?: string;\n private prevDescribedby?: string | null;\n\n constructor() {\n super();\n this.injectTippyStyles();\n }\n\n // Inject custom styles for tooltips\n private injectTippyStyles(): void {\n const STYLE_ID = 'nile-light-tooltip-styles';\n if (document.getElementById(STYLE_ID)) return;\n\n const style = document.createElement('style');\n style.id = STYLE_ID;\n style.textContent = `\n .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0; }\n [data-tippy-root] { max-width: calc(100vw - 10px); }\n .tippy-box {\n position: relative;\n background-color: #333;\n color: #fff;\n border-radius: 4px;\n font-size: 14px;\n line-height: 1.4;\n white-space: normal;\n outline: 0;\n transition-property: transform, visibility, opacity;\n }\n\n /* Placement-specific arrows */\n .tippy-box[data-placement^=top] > .tippy-arrow { bottom: 0; }\n .tippy-box[data-placement^=top] > .tippy-arrow:before {\n bottom: -7px;\n border-width: 8px 8px 0;\n border-top-color: initial;\n }\n\n .tippy-box[data-placement^=bottom] > .tippy-arrow { top: 0; }\n .tippy-box[data-placement^=bottom] > .tippy-arrow:before {\n top: -7px;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n }\n\n .tippy-box[data-placement^=left] > .tippy-arrow { right: 0; }\n .tippy-box[data-placement^=left] > .tippy-arrow:before {\n right: -7px;\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n }\n\n .tippy-box[data-placement^=right] > .tippy-arrow { left: 0; }\n .tippy-box[data-placement^=right] > .tippy-arrow:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n }\n\n .tippy-box[data-inertia][data-state=visible] {\n transition-timing-function: cubic-bezier(.54, 1.5, .38, 1.11);\n }\n\n .tippy-box.large { font-size: 16px; padding: 8px 12px; }\n .tippy-arrow { width: 16px; height: 16px; color: #333; }\n .tippy-arrow:before {\n content: \"\";\n position: absolute;\n border-color: transparent;\n border-style: solid;\n }\n\n .tippy-content {\n position: relative;\n padding: 5px 9px;\n z-index: 1;\n }\n\t\t.tippy-box[data-placement^=top]>.tippy-svg-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-svg-arrow:after,.tippy-box[data-placement^=top]>.tippy-svg-arrow>svg{top:16px;transform:rotate(180deg)}.tippy-box[data-placement^=bottom]>.tippy-svg-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-svg-arrow>svg{bottom:16px}.tippy-box[data-placement^=left]>.tippy-svg-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-svg-arrow:after,.tippy-box[data-placement^=left]>.tippy-svg-arrow>svg{transform:rotate(90deg);top:calc(50% - 3px);left:11px}.tippy-box[data-placement^=right]>.tippy-svg-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-svg-arrow:after,.tippy-box[data-placement^=right]>.tippy-svg-arrow>svg{transform:rotate(-90deg);top:calc(50% - 3px);right:11px}.tippy-svg-arrow{width:16px;height:16px;fill:#333;text-align:initial}.tippy-svg-arrow,.tippy-svg-arrow>svg{position:absolute}\n `;\n document.head.appendChild(style);\n }\n\n firstUpdated(): void {\n this.attachTooltip();\n }\n\n \n\n\n private attachTooltip(): void {\n this.destroyTooltips();\n if (this.disabled) return;\n\n const options: Partial<Props> = {\n content: this.content,\n placement: this.placement,\n trigger: this.trigger,\n offset: [this.skidding, this.distance],\n theme: 'light',\n animation: 'fade',\n\t duration: parseDuration(this.duration),\n allowHTML: this.allowHTML,\n appendTo: this.hoist ? document.body : undefined,\n followCursor: parseFollowCursor(this.followCursor),\n plugins: parseFollowCursor(this.followCursor) ? [followCursor] : [],\n arrow: roundArrow,\n onShow: instance => { this.open = true; return undefined; },\n onHide: instance => { this.open = false; return undefined; }\n };\n\n // Sibling mode\n if (this.for) {\n this.targetEl = document.getElementById(this.for);\n if (!this.targetEl) return;\n\n if (!this.id) {\n this.generatedId = `nile-tooltip-${Math.random().toString(36).slice(2, 9)}`;\n this.id = this.generatedId;\n }\n\n this.prevDescribedby = this.targetEl.getAttribute('aria-describedby');\n const describedby = this.prevDescribedby\n ? `${this.prevDescribedby} ${this.id}`\n : this.id;\n this.targetEl.setAttribute('aria-describedby', describedby);\n\n this.singleInstance = tippy(this.targetEl, options);\n if (this.size)\n this.singleInstance.popper\n .querySelector('.tippy-box')\n ?.classList.add(this.size);\n\t\t if (this.open) {\n\t\t\tqueueMicrotask(() => this.singleInstance?.show());\n\t\t }\t\t \n return;\n }\n\n // Wrapper mode\n const children = this.querySelectorAll('*');\n if (children.length > 0) {\n this.tooltipInstances = tippy(children, options);\n this.tooltipInstances.forEach(t =>\n t.popper.querySelector('.tippy-box')?.classList.add(this.size)\n );\n if (this.open) this.tooltipInstances.forEach(t => t.show());\n }\n }\n\n private destroyTooltips(): void {\n this.tooltipInstances?.forEach(t => t.destroy());\n this.singleInstance?.destroy();\n this.tooltipInstances = undefined;\n this.singleInstance = undefined;\n\n if (this.targetEl && this.id) {\n const current = this.targetEl\n .getAttribute('aria-describedby')\n ?.split(' ')\n .filter(id => id !== this.id)\n .join(' ')\n .trim();\n if (current) {\n this.targetEl.setAttribute('aria-describedby', current);\n } else {\n this.targetEl.removeAttribute('aria-describedby');\n }\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.destroyTooltips();\n }\n\n updated(changed: PropertyValues): void {\n super.updated(changed);\n\n if (\n ['for', 'content', 'placement', 'distance', 'skidding', 'trigger', 'disabled', 'hoist', 'size', 'arrow']\n .some(p => changed.has(p))\n ) {\n this.attachTooltip();\n }\n\n // Controlled open/close\n if (changed.has('open')) {\n if (this.open) {\n this.singleInstance?.show();\n this.tooltipInstances?.forEach(t => t.show());\n } else {\n this.singleInstance?.hide();\n this.tooltipInstances?.forEach(t => t.hide());\n }\n }\n }\n}\n\nexport default NileLightTooltip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-light-tooltip': NileLightTooltip;\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export declare function parseFollowCursor(value: boolean | 'initial' | 'horizontal' | 'vertical' | 'true' | 'false'): boolean | 'initial' | 'horizontal' | 'vertical';
2
+ export declare function parseDuration(value: string | number | [number, number] | undefined): number | [number, number];
@@ -0,0 +1,29 @@
1
+ export function parseFollowCursor(value) {
2
+ if (value === true || value === 'true')
3
+ return true;
4
+ if (value === false || value === 'false')
5
+ return false;
6
+ if (['initial', 'horizontal', 'vertical'].includes(String(value))) {
7
+ return value;
8
+ }
9
+ return false;
10
+ }
11
+ export function parseDuration(value) {
12
+ if (Array.isArray(value))
13
+ return value;
14
+ if (typeof value === 'number')
15
+ return value;
16
+ if (typeof value === 'string') {
17
+ // Handle comma-separated (e.g. "200,100")
18
+ if (value.includes(',')) {
19
+ const parts = value.split(',').map(v => parseInt(v.trim(), 10));
20
+ return parts;
21
+ }
22
+ // Single numeric string
23
+ const num = parseInt(value, 10);
24
+ if (!isNaN(num))
25
+ return num;
26
+ }
27
+ return 200; // default fallback
28
+ }
29
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/nile-light-tooltip/utils.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,iBAAiB,CAC/B,KAAyE;IAEzE,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IACpD,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IACvD,IAAI,CAAC,SAAS,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QAClE,OAAO,KAA8C,CAAC;IACxD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAGD,MAAM,UAAU,aAAa,CACzB,KAAqD;IAErD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACvC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAE5C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,0CAA0C;QAC1C,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YAChE,OAAO,KAAyB,CAAC;QACnC,CAAC;QAED,wBAAwB;QACxB,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAChC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;YAAE,OAAO,GAAG,CAAC;IAC9B,CAAC;IAED,OAAO,GAAG,CAAC,CAAC,mBAAmB;AACjC,CAAC","sourcesContent":[" \nexport function parseFollowCursor(\n value: boolean | 'initial' | 'horizontal' | 'vertical' | 'true' | 'false'\n): boolean | 'initial' | 'horizontal' | 'vertical' {\n if (value === true || value === 'true') return true;\n if (value === false || value === 'false') return false;\n if (['initial', 'horizontal', 'vertical'].includes(String(value))) {\n return value as 'initial' | 'horizontal' | 'vertical';\n }\n return false;\n}\n\n\nexport function parseDuration(\n value: string | number | [number, number] | undefined\n ): number | [number, number] {\n if (Array.isArray(value)) return value;\n if (typeof value === 'number') return value;\n \n if (typeof value === 'string') {\n // Handle comma-separated (e.g. \"200,100\")\n if (value.includes(',')) {\n const parts = value.split(',').map(v => parseInt(v.trim(), 10));\n return parts as [number, number];\n }\n \n // Single numeric string\n const num = parseInt(value, 10);\n if (!isNaN(num)) return num;\n }\n \n return 200; // default fallback\n }"]}
@@ -1,5 +1,5 @@
1
1
  // Version utility - placeholders will be replaced during build
2
- export const NILE_ELEMENTS_VERSION = '1.2.7-beta-1.0';
2
+ export const NILE_ELEMENTS_VERSION = '1.2.7-beta-1.1';
3
3
  export const NILE_VERSION = '1.0.9';
4
4
  // Set global versions for runtime access
5
5
  if (typeof window !== 'undefined') {
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AACjE,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAE/C,yCAAyC;AACzC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IACjC,MAAc,CAAC,mBAAmB,GAAG,qBAAqB,CAAC;IAC3D,MAAc,CAAC,WAAW,GAAG,YAAY,CAAC;IAC3C,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,CAAC;AACzE,CAAC","sourcesContent":["// Version utility - placeholders will be replaced during build\nexport const NILE_ELEMENTS_VERSION = '1.2.7-beta-1.0';\nexport const NILE_VERSION = '1.0.9';\n\n// Set global versions for runtime access\nif (typeof window !== 'undefined') {\n (window as any).nileElementsVersion = NILE_ELEMENTS_VERSION;\n (window as any).nileVersion = NILE_VERSION;\n window.process = window.process || { env: { NODE_ENV: 'production' } };\n}\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AACjE,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAE/C,yCAAyC;AACzC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IACjC,MAAc,CAAC,mBAAmB,GAAG,qBAAqB,CAAC;IAC3D,MAAc,CAAC,WAAW,GAAG,YAAY,CAAC;IAC3C,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,CAAC;AACzE,CAAC","sourcesContent":["// Version utility - placeholders will be replaced during build\nexport const NILE_ELEMENTS_VERSION = '1.2.7-beta-1.1';\nexport const NILE_VERSION = '1.0.9';\n\n// Set global versions for runtime access\nif (typeof window !== 'undefined') {\n (window as any).nileElementsVersion = NILE_ELEMENTS_VERSION;\n (window as any).nileVersion = NILE_VERSION;\n window.process = window.process || { env: { NODE_ENV: 'production' } };\n}\n"]}