@pyreon/elements 0.12.13 → 0.12.14

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.
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["styles","component","Fragment","Component","Styled","component","styles","Component","Styled","component","Wrapper","Content","name","Component","component","Component","Iterator","Element","name","Component","Component","name","Component","CorePortal","name","Component","Styled","name","Component"],"sources":["../src/constants.ts","../src/utils.ts","../src/helpers/Content/styled.ts","../../../core/core/lib/jsx-runtime.js","../src/helpers/Content/component.tsx","../src/helpers/Content/index.ts","../src/helpers/Wrapper/styled.ts","../src/helpers/Wrapper/constants.ts","../src/helpers/Wrapper/utils.ts","../src/helpers/Wrapper/component.tsx","../src/helpers/Wrapper/index.ts","../src/Element/constants.ts","../src/Element/utils.ts","../src/Element/component.tsx","../src/helpers/Iterator/component.tsx","../src/helpers/Iterator/index.ts","../src/List/component.tsx","../src/Overlay/context.tsx","../src/Overlay/useOverlay.tsx","../src/Overlay/component.tsx","../src/Portal/component.tsx","../src/Text/styled.ts","../src/Text/component.tsx","../src/Util/component.tsx"],"sourcesContent":["export const PKG_NAME = '@pyreon/elements' as const\n","export const IS_DEVELOPMENT = process.env.NODE_ENV !== 'production'\n","/**\n * Styled component for content areas (before/content/after). Applies\n * responsive flex alignment, gap spacing between slots based on parent\n * direction (margin-right for inline, margin-bottom for rows), and\n * equalCols flex distribution. The \"content\" slot gets `flex: 1` to\n * fill remaining space between before and after.\n */\nimport { config } from '@pyreon/ui-core'\nimport { alignContent, extendCss, makeItResponsive, value } from '@pyreon/unistyle'\nimport type { ResponsiveStylesCallback } from '../../types'\nimport type { StyledProps, ThemeProps } from './types'\n\nconst { styled, css, component } = config\n\nconst equalColsCSS = `\n flex: 1;\n`\n\nconst typeContentCSS = `\n flex: 1;\n`\n\n// --------------------------------------------------------\n// calculate spacing between before / content / after\n// --------------------------------------------------------\nconst gapDimensions = {\n inline: {\n before: 'margin-right',\n after: 'margin-left',\n },\n reverseInline: {\n before: 'margin-right',\n after: 'margin-left',\n },\n rows: {\n before: 'margin-bottom',\n after: 'margin-top',\n },\n reverseRows: {\n before: 'margin-bottom',\n after: 'margin-top',\n },\n} as const\n\nconst calculateGap = ({\n direction,\n type,\n value: gapValue,\n}: {\n direction: keyof typeof gapDimensions\n type: ThemeProps['contentType']\n value: string | number | null | undefined\n}) => {\n if (!direction || !type || type === 'content') return undefined\n\n const finalStyles = `${gapDimensions[direction][type]}: ${gapValue};`\n\n return finalStyles\n}\n\n// --------------------------------------------------------\n// calculations of styles to be rendered\n// --------------------------------------------------------\nconst styles: ResponsiveStylesCallback = ({ css: cssFn, theme: t, rootSize }) => cssFn`\n ${alignContent({\n direction: t.direction,\n alignX: t.alignX,\n alignY: t.alignY,\n })};\n\n ${t.equalCols && equalColsCSS};\n\n ${\n t.gap &&\n t.contentType &&\n calculateGap({\n direction: t.parentDirection,\n type: t.contentType,\n value: value(t.gap, rootSize),\n })\n };\n\n ${t.extraStyles && extendCss(t.extraStyles as Parameters<typeof extendCss>[0])};\n`\n\nconst platformCSS = `box-sizing: border-box;`\n\nconst StyledComponent = styled(component, { layer: 'elements' })`\n ${platformCSS};\n\n display: flex;\n align-self: stretch;\n flex-wrap: wrap;\n\n ${(({ $contentType }: StyledProps) => $contentType === 'content' && typeContentCSS) as any};\n\n ${makeItResponsive({\n key: '$element',\n styles,\n css,\n normalize: true,\n })};\n`\n\nexport default StyledComponent\n","//#region src/h.ts\n/** Marker for fragment nodes — renders children without a wrapper element */\nconst Fragment = Symbol(\"Pyreon.Fragment\");\n/**\n* Hyperscript function — the compiled output of JSX.\n* `<div class=\"x\">hello</div>` → `h(\"div\", { class: \"x\" }, \"hello\")`\n*\n* Generic on P so TypeScript validates props match the component's signature\n* at the call site, then stores the result in the loosely-typed VNode.\n*/\n/** Shared empty props sentinel — identity-checked in mountElement to skip applyProps. */\nconst EMPTY_PROPS = {};\nfunction h(type, props, ...children) {\n\treturn {\n\t\ttype,\n\t\tprops: props ?? EMPTY_PROPS,\n\t\tchildren: normalizeChildren(children),\n\t\tkey: props?.key ?? null\n\t};\n}\nfunction normalizeChildren(children) {\n\tfor (let i = 0; i < children.length; i++) if (Array.isArray(children[i])) return flattenChildren(children);\n\treturn children;\n}\nfunction flattenChildren(children) {\n\tconst result = [];\n\tfor (const child of children) if (Array.isArray(child)) result.push(...flattenChildren(child));\n\telse result.push(child);\n\treturn result;\n}\n\n//#endregion\n//#region src/jsx-runtime.ts\n/**\n* JSX automatic runtime.\n*\n* When tsconfig has `\"jsxImportSource\": \"@pyreon/core\"`, the TS/bundler compiler\n* rewrites JSX to imports from this file automatically:\n* <div class=\"x\" /> → jsx(\"div\", { class: \"x\" })\n*/\nfunction jsx(type, props, key) {\n\tconst { children, ...rest } = props;\n\tconst propsWithKey = key != null ? {\n\t\t...rest,\n\t\tkey\n\t} : rest;\n\tif (typeof type === \"function\") return h(type, children !== void 0 ? {\n\t\t...propsWithKey,\n\t\tchildren\n\t} : propsWithKey);\n\treturn h(type, propsWithKey, ...children === void 0 ? [] : Array.isArray(children) ? children : [children]);\n}\nconst jsxs = jsx;\n\n//#endregion\nexport { Fragment, jsx, jsxs };\n//# sourceMappingURL=jsx-runtime.js.map","/**\n * Content area used inside Element to render one of the three\n * layout slots (before, content, after). Passes alignment, direction,\n * gap, and equalCols styling props to the underlying styled component.\n * Adds a `data-pyr-element` attribute in development for debugging.\n *\n * Children are rendered via core `render()`.\n */\nimport { splitProps } from '@pyreon/core'\nimport { render } from '@pyreon/ui-core'\nimport { IS_DEVELOPMENT } from '../../utils'\nimport Styled from './styled'\nimport type { Props } from './types'\n\nconst Component = (props: Partial<Props>) => {\n const [own, rest] = splitProps(props, [\n 'contentType',\n 'tag',\n 'parentDirection',\n 'direction',\n 'alignX',\n 'alignY',\n 'equalCols',\n 'gap',\n 'extendCss',\n 'children',\n ])\n\n const debugProps = IS_DEVELOPMENT\n ? {\n 'data-pyr-element': own.contentType,\n }\n : {}\n\n const stylingProps = {\n contentType: own.contentType,\n parentDirection: own.parentDirection,\n direction: own.direction,\n alignX: own.alignX,\n alignY: own.alignY,\n equalCols: own.equalCols,\n gap: own.gap,\n extraStyles: own.extendCss,\n }\n\n return (\n <Styled as={own.tag} $contentType={own.contentType} $element={stylingProps} {...debugProps} {...rest}>\n {render(own.children)}\n </Styled>\n )\n}\n\nexport default Component\n","import component from './component'\n\nexport default component\n","/**\n * Styled component for the Element wrapper layer. Handles responsive\n * block/inline-flex display, direction, alignment, and custom CSS injection.\n * Includes special handling for the `parentFix` / `childFix` flags that\n * split flex behavior across two DOM nodes for button/fieldset/legend\n * elements where a single flex container is insufficient.\n */\nimport { config } from '@pyreon/ui-core'\nimport { alignContent, extendCss, makeItResponsive } from '@pyreon/unistyle'\nimport type { ResponsiveStylesCallback } from '../../types'\nimport type { StyledProps } from './types'\n\nconst { styled, css, component } = config\n\nconst childFixCSS = `\n display: flex;\n flex: 1;\n width: 100%;\n height: 100%;\n`\n\nconst parentFixCSS = `\n flex-direction: column;\n`\n\nconst fullHeightCSS = `\n height: 100%;\n`\n\nconst blockCSS = `\n align-self: stretch;\n flex: 1;\n min-width: 0;\n`\n\nconst childFixPosition = (isBlock?: boolean) => `display: ${isBlock ? 'flex' : 'inline-flex'};`\n\nconst styles: ResponsiveStylesCallback = ({ theme: t, css: cssFn }) => cssFn`\n ${t.alignY === 'block' && fullHeightCSS};\n\n ${alignContent({\n direction: t.direction,\n alignX: t.alignX,\n alignY: t.alignY,\n })};\n\n ${t.block && blockCSS};\n ${t.alignY === 'block' && t.block && fullHeightCSS};\n\n ${!t.childFix && childFixPosition(t.block)};\n ${t.parentFix && parentFixCSS};\n\n ${t.extraStyles && extendCss(t.extraStyles as Parameters<typeof extendCss>[0])};\n`\n\nconst platformCSS = `box-sizing: border-box;`\n\nexport default styled(component, { layer: 'elements' })`\n position: relative;\n ${platformCSS};\n\n ${(({ $childFix }: StyledProps) => $childFix && childFixCSS) as any};\n\n ${makeItResponsive({\n key: '$element',\n styles,\n css,\n normalize: true,\n })};\n`\n","/**\n * HTML elements that need a two-layer DOM workaround because browsers do not\n * fully support flexbox layout on button, fieldset, and legend elements.\n * @see https://stackoverflow.com/questions/35464067/flexbox-not-working-on-button-or-fieldset-elements\n */\nexport const INLINE_ELEMENTS_FLEX_FIX = {\n button: true,\n fieldset: true,\n legend: true,\n}\n","import { INLINE_ELEMENTS_FLEX_FIX } from './constants'\n\ntype IsWebFixNeeded = (tag?: string) => boolean\nexport const isWebFixNeeded: IsWebFixNeeded = (tag) => {\n if (tag && tag in INLINE_ELEMENTS_FLEX_FIX) return true\n return false\n}\n","/**\n * Wrapper component that serves as the outermost styled container for Element.\n * On web, it detects button/fieldset/legend tags and applies a two-layer flex\n * fix (parent + child Styled) because these HTML elements do not natively\n * support `display: flex` consistently across browsers.\n */\nimport { IS_DEVELOPMENT } from '../../utils'\nimport Styled from './styled'\nimport type { Props } from './types'\nimport { isWebFixNeeded } from './utils'\n\nconst DEV_PROPS: Record<string, string> = IS_DEVELOPMENT ? { 'data-pyr-element': 'Element' } : {}\n\nconst Component = ({\n children,\n tag,\n block,\n extendCss,\n direction,\n alignX,\n alignY,\n equalCols,\n isInline,\n ref,\n ...props\n}: Partial<Props> & { ref?: any }) => {\n const COMMON_PROPS = {\n ...props,\n ...DEV_PROPS,\n ref,\n as: tag,\n }\n\n const needsFix = !props.dangerouslySetInnerHTML && isWebFixNeeded(tag)\n\n const normalElement = {\n block,\n direction,\n alignX,\n alignY,\n equalCols,\n extraStyles: extendCss,\n }\n\n const parentFixElement = {\n parentFix: true as const,\n block,\n extraStyles: extendCss,\n }\n\n const childFixElement = {\n childFix: true as const,\n direction,\n alignX,\n alignY,\n equalCols,\n }\n\n if (!needsFix) {\n return (\n <Styled {...COMMON_PROPS} $element={normalElement}>\n {children}\n </Styled>\n )\n }\n\n const asTag = isInline ? 'span' : 'div'\n\n return (\n <Styled {...COMMON_PROPS} $element={parentFixElement}>\n <Styled as={asTag} $childFix $element={childFixElement}>\n {children}\n </Styled>\n </Styled>\n )\n}\n\nexport default Component\n","import component from './component'\n\nexport default component\n","/** Props consumed by Element that should not be forwarded to the underlying DOM node. */\nexport const RESERVED_PROPS = [\n 'innerRef',\n 'tag',\n 'block',\n 'label',\n 'children',\n 'beforeContent',\n 'afterContent',\n\n 'equalCols',\n 'vertical',\n 'direction',\n 'alignX',\n 'alignY',\n\n 'css',\n 'contentCss',\n 'beforeContentCss',\n 'afterContentCss',\n\n 'contentDirection',\n 'contentAlignX',\n 'contentAlignY',\n\n 'beforeContentDirection',\n 'beforeContentAlignX',\n 'beforeContentAlignY',\n\n 'afterContentDirection',\n 'afterContentAlignX',\n 'afterContentAlignY',\n] as const\n\n/**\n * HTML tags that are inline-level by default. When Element renders one of\n * these tags, child Content wrappers use `span` instead of `div` to\n * preserve valid HTML nesting.\n */\nexport const INLINE_ELEMENTS = {\n span: true,\n a: true,\n button: true,\n input: true,\n label: true,\n select: true,\n textarea: true,\n br: true,\n img: true,\n strong: true,\n small: true,\n code: true,\n b: true,\n big: true,\n i: true,\n tt: true,\n abbr: true,\n acronym: true,\n cite: true,\n dfn: true,\n em: true,\n kbd: true,\n samp: true,\n var: true,\n bdo: true,\n map: true,\n object: true,\n q: true,\n script: true,\n sub: true,\n sup: true,\n}\n\n/**\n * HTML void/self-closing elements that cannot have children. When Element\n * detects one of these tags, it skips rendering beforeContent/content/afterContent\n * and returns the Wrapper alone.\n */\nexport const EMPTY_ELEMENTS = {\n area: true,\n base: true,\n br: true,\n col: true,\n embed: true,\n hr: true,\n img: true,\n input: true,\n keygen: true,\n link: true,\n textarea: true,\n // 'meta': true,\n // 'param': true,\n source: true,\n track: true,\n wbr: true,\n}\n","import { EMPTY_ELEMENTS, INLINE_ELEMENTS } from './constants'\n\ntype GetValue = (tag?: string) => boolean\n\n/** Checks whether the given HTML tag is an inline-level element, used to determine sub-tag nesting. */\nexport const isInlineElement: GetValue = (tag) => {\n if (tag && tag in INLINE_ELEMENTS) return true\n return false\n}\n\n/** Checks whether the given HTML tag is a void element that cannot have children. */\nexport const getShouldBeEmpty: GetValue = (tag) => {\n if (tag && tag in EMPTY_ELEMENTS) return true\n return false\n}\n","/**\n * Core building block of the elements package. Renders a three-section layout\n * (beforeContent / content / afterContent) inside a flex Wrapper. When only\n * content is present, the Wrapper inherits content-level alignment directly\n * to avoid an unnecessary nesting layer. Handles HTML-specific edge cases\n * like void elements (input, img) and inline elements (span, a) by\n * skipping children or switching sub-tags accordingly.\n */\n\nimport { onMount, splitProps } from '@pyreon/core'\nimport { render } from '@pyreon/ui-core'\nimport { PKG_NAME } from '../constants'\nimport { Content, Wrapper } from '../helpers'\nimport type { PyreonElement } from './types'\nimport { getShouldBeEmpty, isInlineElement } from './utils'\n\nconst equalize = (el: HTMLElement, direction: unknown) => {\n const beforeEl = el.firstElementChild as HTMLElement | null\n const afterEl = el.lastElementChild as HTMLElement | null\n\n if (beforeEl && afterEl && beforeEl !== afterEl) {\n const type: 'height' | 'width' = direction === 'rows' ? 'height' : 'width'\n const prop = type === 'height' ? 'offsetHeight' : 'offsetWidth'\n const beforeSize = beforeEl[prop]\n const afterSize = afterEl[prop]\n\n if (Number.isInteger(beforeSize) && Number.isInteger(afterSize)) {\n const maxSize = `${Math.max(beforeSize, afterSize)}px`\n beforeEl.style[type] = maxSize\n afterEl.style[type] = maxSize\n }\n }\n}\n\nconst defaultDirection = 'inline'\nconst defaultContentDirection = 'rows'\nconst defaultAlignX = 'left'\nconst defaultAlignY = 'center'\n\nconst Component: PyreonElement = (props) => {\n const [own, rest] = splitProps(props, [\n 'innerRef',\n 'tag',\n 'label',\n 'content',\n 'children',\n 'beforeContent',\n 'afterContent',\n 'equalBeforeAfter',\n 'block',\n 'equalCols',\n 'gap',\n 'direction',\n 'alignX',\n 'alignY',\n 'css',\n 'contentCss',\n 'beforeContentCss',\n 'afterContentCss',\n 'contentDirection',\n 'contentAlignX',\n 'contentAlignY',\n 'beforeContentDirection',\n 'beforeContentAlignX',\n 'beforeContentAlignY',\n 'afterContentDirection',\n 'afterContentAlignX',\n 'afterContentAlignY',\n 'ref',\n ])\n\n const alignX = own.alignX ?? defaultAlignX\n const alignY = own.alignY ?? defaultAlignY\n const contentDirection = own.contentDirection ?? defaultContentDirection\n const contentAlignX = own.contentAlignX ?? defaultAlignX\n const contentAlignY = own.contentAlignY ?? defaultAlignY\n const beforeContentDirection = own.beforeContentDirection ?? defaultDirection\n const beforeContentAlignX = own.beforeContentAlignX ?? defaultAlignX\n const beforeContentAlignY = own.beforeContentAlignY ?? defaultAlignY\n const afterContentDirection = own.afterContentDirection ?? defaultDirection\n const afterContentAlignX = own.afterContentAlignX ?? defaultAlignX\n const afterContentAlignY = own.afterContentAlignY ?? defaultAlignY\n\n // --------------------------------------------------------\n // check if should render only single element\n // --------------------------------------------------------\n const shouldBeEmpty = !!rest.dangerouslySetInnerHTML || getShouldBeEmpty(own.tag)\n\n // --------------------------------------------------------\n // if not single element, calculate values\n // --------------------------------------------------------\n const isSimpleElement = !own.beforeContent && !own.afterContent\n // Getter — preserves reactivity of own.content (which may be _rp() wrapped).\n // Reading own.content via ?? at setup would capture the value once.\n const getChildren = () => own.children ?? own.content ?? own.label\n\n const isInline = isInlineElement(own.tag)\n const SUB_TAG = isInline ? 'span' : undefined\n\n // --------------------------------------------------------\n // direction & alignX & alignY calculations\n // --------------------------------------------------------\n let wrapperDirection: typeof own.direction = own.direction\n let wrapperAlignX: typeof alignX = alignX\n let wrapperAlignY: typeof alignY = alignY\n\n if (isSimpleElement) {\n if (contentDirection) wrapperDirection = contentDirection\n if (contentAlignX) wrapperAlignX = contentAlignX\n if (contentAlignY) wrapperAlignY = contentAlignY\n } else if (own.direction) {\n wrapperDirection = own.direction\n } else {\n wrapperDirection = defaultDirection\n }\n\n // --------------------------------------------------------\n // equalBeforeAfter: measure & equalize slot dimensions\n // --------------------------------------------------------\n let equalizeRef: HTMLElement | null = null\n const externalRef = own.ref ?? own.innerRef\n\n const mergedRef = (node: HTMLElement | null) => {\n equalizeRef = node\n if (typeof externalRef === 'function') (externalRef as (el: HTMLElement | null) => void)(node)\n else if (externalRef != null) {\n ;(externalRef as unknown as { current: HTMLElement | null }).current = node\n }\n }\n\n if (own.equalBeforeAfter && own.beforeContent && own.afterContent) {\n onMount(() => {\n if (equalizeRef) equalize(equalizeRef, own.direction)\n return undefined\n })\n }\n\n // --------------------------------------------------------\n // common wrapper props\n // --------------------------------------------------------\n const WRAPPER_PROPS = {\n ref: mergedRef,\n extendCss: own.css,\n tag: own.tag,\n block: own.block,\n direction: wrapperDirection,\n alignX: wrapperAlignX,\n alignY: wrapperAlignY,\n as: undefined, // reset styled-components `as` prop\n }\n\n // --------------------------------------------------------\n // return simple/empty element like input or image etc.\n // --------------------------------------------------------\n if (shouldBeEmpty) {\n return <Wrapper {...rest} {...WRAPPER_PROPS} />\n }\n\n return (\n <Wrapper {...rest} {...WRAPPER_PROPS} isInline={isInline}>\n {own.beforeContent && (\n <Content\n tag={SUB_TAG}\n contentType=\"before\"\n parentDirection={wrapperDirection}\n extendCss={own.beforeContentCss}\n direction={beforeContentDirection}\n alignX={beforeContentAlignX}\n alignY={beforeContentAlignY}\n equalCols={own.equalCols}\n gap={own.gap}\n >\n {own.beforeContent}\n </Content>\n )}\n\n {isSimpleElement ? (\n render(getChildren())\n ) : (\n <Content\n tag={SUB_TAG}\n contentType=\"content\"\n parentDirection={wrapperDirection}\n extendCss={own.contentCss}\n direction={contentDirection}\n alignX={contentAlignX}\n alignY={contentAlignY}\n equalCols={own.equalCols}\n >\n {getChildren()}\n </Content>\n )}\n\n {own.afterContent && (\n <Content\n tag={SUB_TAG}\n contentType=\"after\"\n parentDirection={wrapperDirection}\n extendCss={own.afterContentCss}\n direction={afterContentDirection}\n alignX={afterContentAlignX}\n alignY={afterContentAlignY}\n equalCols={own.equalCols}\n gap={own.gap}\n >\n {own.afterContent}\n </Content>\n )}\n </Wrapper>\n )\n}\n\nconst name = `${PKG_NAME}/Element` as const\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.PYREON__COMPONENT = name\n\nexport default Component\n","/**\n * Data-driven list renderer that supports three input modes: children,\n * an array of primitives, or an array of objects.\n * Each item receives positional metadata (first, last, odd, even, position)\n * and optional injected props via `itemProps`. Items can be individually\n * wrapped with `wrapComponent`. Children always take priority over the\n * component+data prop pattern.\n */\n\nimport type { VNode, VNodeChild } from '@pyreon/core'\nimport { Fragment } from '@pyreon/core'\nimport { isEmpty, render } from '@pyreon/ui-core'\nimport type { ExtendedProps, ObjectValue, Props, SimpleValue } from './types'\n\ntype ClassifiedData =\n | { type: 'simple'; data: SimpleValue[] }\n | { type: 'complex'; data: ObjectValue[] }\n | null\n\nconst classifyData = (data: unknown[]): ClassifiedData => {\n const items = data.filter(\n (item) =>\n item != null && !(typeof item === 'object' && isEmpty(item as Record<string, unknown>)),\n )\n\n if (items.length === 0) return null\n\n let isSimple = true\n let isComplex = true\n\n for (const item of items) {\n if (typeof item === 'string' || typeof item === 'number') {\n isComplex = false\n } else if (typeof item === 'object') {\n isSimple = false\n } else {\n isSimple = false\n isComplex = false\n }\n }\n\n if (isSimple) return { type: 'simple', data: items as SimpleValue[] }\n if (isComplex) return { type: 'complex', data: items as ObjectValue[] }\n return null\n}\n\nconst RESERVED_PROPS = [\n 'children',\n 'component',\n 'wrapComponent',\n 'data',\n 'itemKey',\n 'valueName',\n 'itemProps',\n 'wrapProps',\n] as const\n\ntype AttachItemProps = ({ i, length }: { i: number; length: number }) => ExtendedProps\n\nconst attachItemProps: AttachItemProps = ({ i, length }: { i: number; length: number }) => {\n const position = i + 1\n\n return {\n index: i,\n first: position === 1,\n last: position === length,\n odd: position % 2 === 1,\n even: position % 2 === 0,\n position,\n }\n}\n\nconst Component = (props: Props) => {\n const {\n itemKey,\n valueName,\n children,\n component,\n data,\n wrapComponent: Wrapper,\n wrapProps,\n itemProps,\n } = props\n\n const injectItemProps = typeof itemProps === 'function' ? itemProps : () => itemProps\n\n const injectWrapItemProps = typeof wrapProps === 'function' ? wrapProps : () => wrapProps\n\n const getKey = (item: string | number, index: number) => {\n if (typeof itemKey === 'function') return itemKey(item, index)\n return index\n }\n\n const renderChild = (child: VNodeChild, total = 1, i = 0) => {\n if (!itemProps && !Wrapper) return child\n\n const extendedProps = attachItemProps({\n i,\n length: total,\n })\n\n const finalItemProps = itemProps ? injectItemProps({}, extendedProps) : {}\n\n if (Wrapper) {\n const finalWrapProps = wrapProps ? injectWrapItemProps({}, extendedProps) : {}\n\n return (\n <Wrapper key={i} {...finalWrapProps}>\n {render(child, finalItemProps)}\n </Wrapper>\n )\n }\n\n return render(child, {\n key: i,\n ...finalItemProps,\n })\n }\n\n // --------------------------------------------------------\n // render children\n // --------------------------------------------------------\n const renderChildren = () => {\n if (!children) return null\n\n // if children is Array\n if (Array.isArray(children)) {\n return children.map((item, i) => renderChild(item, children.length, i))\n }\n\n // if children is Fragment — check VNode type\n if (\n typeof children === 'object' &&\n 'type' in (children as VNode) &&\n (children as VNode).type === Fragment\n ) {\n const fragmentChildren = (children as VNode).children as VNodeChild[]\n const childrenLength = fragmentChildren.length\n\n return fragmentChildren.map((item, i) => renderChild(item, childrenLength, i))\n }\n\n // if single child\n return renderChild(children)\n }\n\n // --------------------------------------------------------\n // render array of strings or numbers\n // --------------------------------------------------------\n const renderSimpleArray = (simpleData: SimpleValue[]) => {\n const { length } = simpleData\n\n if (length === 0) return null\n\n return simpleData.map((item, i) => {\n const key = getKey(item, i)\n const keyName = valueName ?? 'children'\n const extendedProps = attachItemProps({\n i,\n length,\n })\n\n const finalItemProps = {\n ...(itemProps ? injectItemProps({ [keyName]: item }, extendedProps) : {}),\n [keyName]: item,\n }\n\n if (Wrapper) {\n const finalWrapProps = wrapProps\n ? injectWrapItemProps({ [keyName]: item }, extendedProps)\n : {}\n\n return (\n <Wrapper key={key} {...finalWrapProps}>\n {render(component, finalItemProps)}\n </Wrapper>\n )\n }\n\n return render(component, { key, ...finalItemProps })\n })\n }\n\n // --------------------------------------------------------\n // render array of objects\n // --------------------------------------------------------\n const getObjectKey = (item: ObjectValue, index: number) => {\n if (!itemKey) return item.key ?? item.id ?? item.itemId ?? index\n if (typeof itemKey === 'function') return itemKey(item, index)\n if (typeof itemKey === 'string') return item[itemKey]\n\n return index\n }\n\n const renderComplexArray = (complexData: ObjectValue[]) => {\n const { length } = complexData\n\n if (length === 0) return null\n\n return complexData.map((item, i) => {\n const { component: itemComponent, ...restItem } = item\n const renderItem = itemComponent ?? component\n const key = getObjectKey(restItem, i)\n const extendedProps = attachItemProps({\n i,\n length,\n })\n\n const finalItemProps = {\n ...(itemProps ? injectItemProps(item, extendedProps) : {}),\n ...restItem,\n }\n\n if (Wrapper && !itemComponent) {\n const finalWrapProps = wrapProps ? injectWrapItemProps(item, extendedProps) : {}\n\n return (\n <Wrapper key={key} {...finalWrapProps}>\n {render(renderItem, finalItemProps)}\n </Wrapper>\n )\n }\n\n return render(renderItem, { key, ...finalItemProps })\n })\n }\n\n // --------------------------------------------------------\n // render list items\n // --------------------------------------------------------\n const renderItems = (): VNodeChild => {\n // children have priority over props component + data\n if (children) return renderChildren() as VNodeChild\n\n // render props component + data\n if (component && Array.isArray(data)) {\n const classified = classifyData(data)\n if (!classified) return null\n if (classified.type === 'simple') return renderSimpleArray(classified.data) as VNodeChild\n return renderComplexArray(classified.data) as VNodeChild\n }\n\n return null\n }\n\n return renderItems()\n}\n\nexport default Object.assign(Component, {\n isIterator: true as const,\n RESERVED_PROPS,\n})\n","import component from './component'\nimport type {\n ElementType,\n ExtendedProps,\n MaybeNull,\n ObjectValue,\n Props,\n PropsCallback,\n SimpleValue,\n} from './types'\n\nexport type { ElementType, ExtendedProps, MaybeNull, ObjectValue, Props, PropsCallback, SimpleValue }\n\nexport default component\n","/**\n * List component that combines Iterator (data-driven rendering) with an\n * optional Element root wrapper. When `rootElement` is false (default),\n * it renders a bare Iterator as a fragment. When true, the Iterator output\n * is wrapped in an Element that receives all non-iterator props (e.g.,\n * layout, alignment, css), allowing the list to be styled as a single block.\n */\nimport { omit, pick } from '@pyreon/ui-core'\nimport { PKG_NAME } from '../constants'\nimport type { ElementProps, PyreonElement } from '../Element'\nimport { Element } from '../Element'\nimport type { Props as IteratorProps } from '../helpers/Iterator'\nimport Iterator from '../helpers/Iterator'\nimport type { MergeTypes } from '../types'\n\ntype ListProps = {\n /**\n * A boolean value. When set to `false`, component returns fragment.\n * When set to `true`, component returns as the **root** element `Element`\n * component.\n */\n rootElement?: boolean\n /**\n * Label prop from `Element` component is being ignored.\n */\n label: never\n /**\n * Content prop from `Element` component is being ignored.\n */\n content: never\n}\n\nexport type Props = MergeTypes<[IteratorProps, ListProps]> & Partial<Omit<ElementProps, 'children' | 'content' | 'label'>>\n\nconst Component: PyreonElement<Props> = (({\n rootElement = false,\n ref,\n ...props\n}: Partial<Props & ElementProps>) => {\n const renderedList = <Iterator {...pick(props, Iterator.RESERVED_PROPS)} />\n\n if (!rootElement) return renderedList\n\n return (\n <Element {...(ref ? { ref } : {})} {...omit(props, Iterator.RESERVED_PROPS)}>\n {renderedList}\n </Element>\n )\n}) as PyreonElement<Props>\n\nconst name = `${PKG_NAME}/List` as const\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.PYREON__COMPONENT = name\n\nexport default Component\n","/**\n * Context for nested overlay coordination. When a child overlay opens, it\n * sets the parent's blocked state to true, preventing the parent from\n * closing in response to click/hover events that belong to the child.\n */\n\nimport type { VNodeChild } from '@pyreon/core'\nimport { createContext, provide, useContext } from '@pyreon/core'\n\nexport interface OverlayContext {\n blocked: boolean | (() => boolean)\n setBlocked: () => void\n setUnblocked: () => void\n}\n\nconst context = createContext<OverlayContext>({} as OverlayContext)\n\nexport const useOverlayContext = () => useContext(context)\n\nconst Component = (props: OverlayContext & { children: VNodeChild }) => {\n const ctx = {\n blocked: props.blocked,\n setBlocked: props.setBlocked,\n setUnblocked: props.setUnblocked,\n }\n\n provide(context, ctx)\n\n return <>{props.children}</>\n}\n\nexport default Component\n","/**\n * Core hook powering the Overlay component. Manages open/close state, DOM\n * event listeners (click, hover, scroll, resize, ESC key), and dynamic\n * positioning of overlay content relative to its trigger. Supports dropdown,\n * tooltip, popover, and modal types with automatic edge-of-viewport flipping.\n * Event handlers are throttled for performance, and nested overlay blocking\n * is coordinated through the overlay context.\n */\n\nimport { signal } from '@pyreon/reactivity'\nimport { throttle } from '@pyreon/ui-core'\nimport { value } from '@pyreon/unistyle'\nimport { IS_DEVELOPMENT } from '../utils'\nimport Provider, { useOverlayContext } from './context'\n\ntype OverlayPosition = Partial<{\n top: number | string\n bottom: number | string\n left: number | string\n right: number | string\n}>\n\ntype Align = 'bottom' | 'top' | 'left' | 'right'\ntype AlignX = 'left' | 'center' | 'right'\ntype AlignY = 'bottom' | 'top' | 'center'\n\nexport type UseOverlayProps = Partial<{\n isOpen: boolean\n openOn: 'click' | 'hover' | 'manual'\n closeOn: 'click' | 'clickOnTrigger' | 'clickOutsideContent' | 'hover' | 'manual'\n type: 'dropdown' | 'tooltip' | 'popover' | 'modal' | 'custom'\n position: 'absolute' | 'fixed' | 'relative' | 'static'\n align: Align\n alignX: AlignX\n alignY: AlignY\n offsetX: number\n offsetY: number\n throttleDelay: number\n parentContainer: HTMLElement | null\n closeOnEsc: boolean\n hoverDelay: number\n disabled: boolean\n onOpen: () => void\n onClose: () => void\n}>\n\ntype PositionResult = {\n pos: OverlayPosition\n resolvedAlignX: AlignX\n resolvedAlignY: AlignY\n}\n\n// Reference counter for nested modals sharing document.body overflow lock.\nlet modalOverflowCount = 0\n\nconst sel = <T,>(cond: boolean, a: T, b: T): T => (cond ? a : b)\n\nconst devWarn = (msg: string) => {\n if (!IS_DEVELOPMENT) return\n // oxlint-disable-next-line no-console\n console.warn(msg)\n}\n\nconst calcDropdownVertical = (\n c: DOMRect,\n t: DOMRect,\n align: 'top' | 'bottom',\n alignX: AlignX,\n offsetX: number,\n offsetY: number,\n): PositionResult => {\n const pos: OverlayPosition = {}\n\n const topPos = t.top - offsetY - c.height\n const bottomPos = t.bottom + offsetY\n const leftPos = t.left + offsetX\n const rightPos = t.right - offsetX - c.width\n\n const fitsTop = topPos >= 0\n const fitsBottom = bottomPos + c.height <= window.innerHeight\n const fitsLeft = leftPos + c.width <= window.innerWidth\n const fitsRight = rightPos >= 0\n\n const useTop = sel(align === 'top', fitsTop, !fitsBottom)\n pos.top = sel(useTop, topPos, bottomPos)\n const resolvedAlignY: AlignY = sel(useTop, 'top', 'bottom')\n\n let resolvedAlignX: AlignX = alignX\n if (alignX === 'left') {\n pos.left = sel(fitsLeft, leftPos, rightPos)\n resolvedAlignX = sel(fitsLeft, 'left', 'right')\n } else if (alignX === 'right') {\n pos.left = sel(fitsRight, rightPos, leftPos)\n resolvedAlignX = sel(fitsRight, 'right', 'left')\n } else {\n const center = t.left + (t.right - t.left) / 2 - c.width / 2\n const fitsCL = center >= 0\n const fitsCR = center + c.width <= window.innerWidth\n\n if (fitsCL && fitsCR) {\n resolvedAlignX = 'center'\n pos.left = center\n } else if (fitsCL) {\n resolvedAlignX = 'left'\n pos.left = leftPos\n } else if (fitsCR) {\n resolvedAlignX = 'right'\n pos.left = rightPos\n }\n }\n\n return { pos, resolvedAlignX, resolvedAlignY }\n}\n\nconst calcDropdownHorizontal = (\n c: DOMRect,\n t: DOMRect,\n align: 'left' | 'right',\n alignY: AlignY,\n offsetX: number,\n offsetY: number,\n): PositionResult => {\n const pos: OverlayPosition = {}\n\n const leftPos = t.left - offsetX - c.width\n const rightPos = t.right + offsetX\n const topPos = t.top + offsetY\n const bottomPos = t.bottom - offsetY - c.height\n\n const fitsLeft = leftPos >= 0\n const fitsRight = rightPos + c.width <= window.innerWidth\n const fitsTop = topPos + c.height <= window.innerHeight\n const fitsBottom = bottomPos >= 0\n\n const useLeft = sel(align === 'left', fitsLeft, !fitsRight)\n pos.left = sel(useLeft, leftPos, rightPos)\n const resolvedAlignX: AlignX = sel(useLeft, 'left', 'right')\n\n let resolvedAlignY: AlignY = alignY\n if (alignY === 'top') {\n pos.top = sel(fitsTop, topPos, bottomPos)\n resolvedAlignY = sel(fitsTop, 'top', 'bottom')\n } else if (alignY === 'bottom') {\n pos.top = sel(fitsBottom, bottomPos, topPos)\n resolvedAlignY = sel(fitsBottom, 'bottom', 'top')\n } else {\n const center = t.top + (t.bottom - t.top) / 2 - c.height / 2\n const fitsCT = center >= 0\n const fitsCB = center + c.height <= window.innerHeight\n\n if (fitsCT && fitsCB) {\n resolvedAlignY = 'center'\n pos.top = center\n } else if (fitsCT) {\n resolvedAlignY = 'top'\n pos.top = topPos\n } else if (fitsCB) {\n resolvedAlignY = 'bottom'\n pos.top = bottomPos\n }\n }\n\n return { pos, resolvedAlignX, resolvedAlignY }\n}\n\nconst calcModalPos = (\n c: DOMRect,\n alignX: AlignX,\n alignY: AlignY,\n offsetX: number,\n offsetY: number,\n): OverlayPosition => {\n const pos: OverlayPosition = {}\n\n switch (alignX) {\n case 'right':\n pos.right = offsetX\n break\n case 'left':\n pos.left = offsetX\n break\n case 'center':\n pos.left = window.innerWidth / 2 - c.width / 2\n break\n default:\n pos.right = offsetX\n }\n\n switch (alignY) {\n case 'top':\n pos.top = offsetY\n break\n case 'center':\n pos.top = window.innerHeight / 2 - c.height / 2\n break\n case 'bottom':\n pos.bottom = offsetY\n break\n default:\n pos.top = offsetY\n }\n\n return pos\n}\n\nconst adjustForAncestor = (\n pos: OverlayPosition,\n ancestor: { top: number; left: number },\n): OverlayPosition => {\n if (ancestor.top === 0 && ancestor.left === 0) return pos\n\n const result = { ...pos }\n if (typeof result.top === 'number') result.top -= ancestor.top\n if (typeof result.bottom === 'number') result.bottom += ancestor.top\n if (typeof result.left === 'number') result.left -= ancestor.left\n if (typeof result.right === 'number') result.right += ancestor.left\n\n return result\n}\n\ntype ComputeResult = {\n pos: OverlayPosition\n resolvedAlignX?: AlignX\n resolvedAlignY?: AlignY\n}\n\nconst computePosition = (\n type: string,\n align: Align,\n alignX: AlignX,\n alignY: AlignY,\n offsetX: number,\n offsetY: number,\n triggerEl: HTMLElement | null,\n contentEl: HTMLElement | null,\n ancestorOffset: { top: number; left: number },\n): ComputeResult => {\n const isDropdown = ['dropdown', 'tooltip', 'popover'].includes(type)\n\n if (isDropdown && (!triggerEl || !contentEl)) {\n devWarn(\n `[@pyreon/elements] Overlay (${type}): ` +\n `${triggerEl ? 'contentRef' : 'triggerRef'} is not attached. ` +\n 'Position cannot be calculated without both refs.',\n )\n return { pos: {} }\n }\n\n if (isDropdown && triggerEl && contentEl) {\n const c = contentEl.getBoundingClientRect()\n const t = triggerEl.getBoundingClientRect()\n const result =\n align === 'top' || align === 'bottom'\n ? calcDropdownVertical(c, t, align, alignX, offsetX, offsetY)\n : calcDropdownHorizontal(c, t, align as 'left' | 'right', alignY, offsetX, offsetY)\n\n return {\n pos: adjustForAncestor(result.pos, ancestorOffset),\n resolvedAlignX: result.resolvedAlignX,\n resolvedAlignY: result.resolvedAlignY,\n }\n }\n\n if (type === 'modal') {\n if (!contentEl) {\n devWarn(\n '[@pyreon/elements] Overlay (modal): contentRef is not attached. ' +\n 'Modal position cannot be calculated without a content element.',\n )\n return { pos: {} }\n }\n const c = contentEl.getBoundingClientRect()\n return {\n pos: adjustForAncestor(calcModalPos(c, alignX, alignY, offsetX, offsetY), ancestorOffset),\n }\n }\n\n return { pos: {} }\n}\n\nconst processVisibilityEvent = (\n e: Event,\n active: boolean,\n openOn: string,\n closeOn: string,\n isTrigger: (evt: Event) => boolean,\n isContent: (evt: Event) => boolean,\n showContent: () => void,\n hideContent: () => void,\n) => {\n if (!active && openOn === 'click' && e.type === 'click' && isTrigger(e)) {\n showContent()\n return\n }\n\n if (!active) return\n\n if (closeOn === 'hover' && e.type === 'scroll') {\n hideContent()\n return\n }\n\n if (e.type !== 'click') return\n\n if (closeOn === 'click') {\n hideContent()\n } else if (closeOn === 'clickOnTrigger' && isTrigger(e)) {\n hideContent()\n } else if (closeOn === 'clickOutsideContent' && !isContent(e)) {\n hideContent()\n }\n}\n\nconst useOverlay = ({\n isOpen = false,\n openOn = 'click',\n closeOn = 'click',\n type = 'dropdown',\n position = 'fixed',\n align = 'bottom',\n alignX: propAlignX = 'left',\n alignY: propAlignY = 'bottom',\n offsetX = 0,\n offsetY = 0,\n throttleDelay = 200,\n parentContainer,\n closeOnEsc = true,\n hoverDelay = 100,\n disabled,\n onOpen,\n onClose,\n}: Partial<UseOverlayProps> = {}) => {\n const ctx = useOverlayContext()\n\n // Signal-based state\n const active = signal(isOpen)\n const isContentLoaded = signal(false)\n const innerAlignX = signal(propAlignX)\n const innerAlignY = signal(propAlignY)\n const blockedCount = signal(0)\n\n const blocked = () => blockedCount() > 0\n\n // DOM refs (plain variables, component runs once)\n let triggerEl: HTMLElement | null = null\n let contentEl: HTMLElement | null = null\n const _prevFocusEl: HTMLElement | null = null\n let hoverTimeout: ReturnType<typeof setTimeout> | null = null\n\n const triggerRef = (node: HTMLElement | null) => {\n triggerEl = node\n }\n\n const contentRefCallback = (node: HTMLElement | null) => {\n contentEl = node\n isContentLoaded.set(!!node)\n }\n\n const setBlocked = () => blockedCount.update((c) => c + 1)\n const setUnblocked = () => blockedCount.update((c) => Math.max(0, c - 1))\n\n const showContent = () => {\n active.set(true)\n onOpen?.()\n ctx.setBlocked?.()\n }\n\n const hideContent = () => {\n active.set(false)\n isContentLoaded.set(false)\n onClose?.()\n ctx.setUnblocked?.()\n }\n\n // Position calculation helpers\n const getAncestorOffset = () => {\n if (position !== 'absolute' || !contentEl) {\n return { top: 0, left: 0 }\n }\n\n const offsetParent = contentEl.offsetParent as HTMLElement | null\n if (!offsetParent || offsetParent === document.body) {\n return { top: 0, left: 0 }\n }\n\n const rect = offsetParent.getBoundingClientRect()\n return { top: rect.top, left: rect.left }\n }\n\n const calculateContentPosition = () => {\n if (!active() || !isContentLoaded()) return {}\n\n const result = computePosition(\n type,\n align,\n propAlignX,\n propAlignY,\n offsetX,\n offsetY,\n triggerEl,\n contentEl,\n getAncestorOffset(),\n )\n\n if (result.resolvedAlignX) innerAlignX.set(result.resolvedAlignX)\n if (result.resolvedAlignY) innerAlignY.set(result.resolvedAlignY)\n\n return result.pos\n }\n\n const assignContentPosition = (values: OverlayPosition = {}) => {\n if (!contentEl) return\n\n const el = contentEl\n const setValue = (param?: string | number) => value(param, 16) as string\n\n el.style.position = position\n\n el.style.top = values.top != null ? setValue(values.top) : ''\n el.style.bottom = values.bottom != null ? setValue(values.bottom) : ''\n el.style.left = values.left != null ? setValue(values.left) : ''\n el.style.right = values.right != null ? setValue(values.right) : ''\n }\n\n const setContentPosition = () => {\n const currentPosition = calculateContentPosition()\n assignContentPosition(currentPosition)\n }\n\n const isNodeOrChild = (getRef: () => HTMLElement | null) => (e: Event) => {\n const ref = getRef()\n if (e?.target && ref) {\n return ref.contains(e.target as Element) || e.target === ref\n }\n return false\n }\n\n const handleVisibilityByEventType = (e: Event) => {\n if (blocked() || disabled) return\n\n processVisibilityEvent(\n e,\n active(),\n openOn,\n closeOn,\n isNodeOrChild(() => triggerEl),\n isNodeOrChild(() => contentEl),\n showContent,\n hideContent,\n )\n }\n\n const handleContentPosition = throttle(() => setContentPosition(), throttleDelay)\n\n const handleClick = (e: Event) => handleVisibilityByEventType(e)\n\n const handleVisibility = throttle((e: Event) => handleVisibilityByEventType(e), throttleDelay)\n\n // --------------------------------------------------------------------------\n // Set up all event listeners on mount, clean up on unmount\n // --------------------------------------------------------------------------\n const setupListeners = () => {\n const cleanups: (() => void)[] = []\n\n // Click-based open/close\n const enabledClick =\n openOn === 'click' || ['click', 'clickOnTrigger', 'clickOutsideContent'].includes(closeOn)\n\n if (enabledClick) {\n window.addEventListener('click', handleClick)\n cleanups.push(() => window.removeEventListener('click', handleClick))\n }\n\n // ESC key\n if (closeOnEsc) {\n const handleEscKey = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && active() && !blocked()) {\n hideContent()\n }\n }\n window.addEventListener('keydown', handleEscKey)\n cleanups.push(() => window.removeEventListener('keydown', handleEscKey))\n }\n\n // Hover-based open/close\n const enabledHover = openOn === 'hover' || closeOn === 'hover'\n if (enabledHover) {\n const clearHoverTimeout = () => {\n if (hoverTimeout != null) {\n clearTimeout(hoverTimeout)\n hoverTimeout = null\n }\n }\n\n const scheduleHide = () => {\n clearHoverTimeout()\n hoverTimeout = setTimeout(hideContent, hoverDelay)\n }\n\n const onTriggerEnter = () => {\n clearHoverTimeout()\n if (openOn === 'hover' && !active()) showContent()\n }\n\n const onTriggerLeave = () => {\n if (closeOn === 'hover' && active()) scheduleHide()\n }\n\n const onContentEnter = () => {\n clearHoverTimeout()\n }\n\n const onContentLeave = () => {\n if (closeOn === 'hover' && active()) scheduleHide()\n }\n\n // We need to defer listener attachment until refs are available\n const attachHoverListeners = () => {\n if (triggerEl) {\n triggerEl.addEventListener('mouseenter', onTriggerEnter)\n triggerEl.addEventListener('mouseleave', onTriggerLeave)\n }\n if (contentEl) {\n contentEl.addEventListener('mouseenter', onContentEnter)\n contentEl.addEventListener('mouseleave', onContentLeave)\n }\n }\n\n attachHoverListeners()\n\n cleanups.push(() => {\n clearHoverTimeout()\n if (triggerEl) {\n triggerEl.removeEventListener('mouseenter', onTriggerEnter)\n triggerEl.removeEventListener('mouseleave', onTriggerLeave)\n }\n if (contentEl) {\n contentEl.removeEventListener('mouseenter', onContentEnter)\n contentEl.removeEventListener('mouseleave', onContentLeave)\n }\n })\n }\n\n // Resize/scroll repositioning\n const shouldSetOverflow = type === 'modal'\n\n const onScroll = (e: Event) => {\n handleContentPosition()\n handleVisibility(e)\n }\n\n if (shouldSetOverflow) {\n modalOverflowCount++\n if (modalOverflowCount === 1) document.body.style.overflow = 'hidden'\n }\n\n window.addEventListener('resize', handleContentPosition)\n window.addEventListener('scroll', onScroll, { passive: true })\n cleanups.push(() => {\n handleContentPosition.cancel()\n handleVisibility.cancel()\n if (shouldSetOverflow) {\n modalOverflowCount--\n if (modalOverflowCount === 0) document.body.style.overflow = ''\n }\n window.removeEventListener('resize', handleContentPosition)\n window.removeEventListener('scroll', onScroll)\n })\n\n // Parent container scroll\n if (parentContainer) {\n if (closeOn !== 'hover') parentContainer.style.overflow = 'hidden'\n\n const onParentScroll = (e: Event) => {\n handleContentPosition()\n handleVisibility(e)\n }\n\n parentContainer.addEventListener('scroll', onParentScroll, {\n passive: true,\n })\n cleanups.push(() => {\n parentContainer.style.overflow = ''\n parentContainer.removeEventListener('scroll', onParentScroll)\n })\n }\n\n // Cleanup function\n return () => {\n for (const cleanup of cleanups) cleanup()\n }\n }\n\n // Handle disabled state\n if (disabled) {\n active.set(false)\n }\n\n return {\n triggerRef,\n contentRef: contentRefCallback,\n active,\n align,\n alignX: innerAlignX,\n alignY: innerAlignY,\n showContent,\n hideContent,\n blocked,\n setBlocked,\n setUnblocked,\n setupListeners,\n Provider,\n }\n}\n\nexport default useOverlay\n","/**\n * Overlay component that renders a trigger element and conditionally shows\n * content via a Portal. The trigger receives a ref and optional show/hide\n * callbacks; the content is positioned and managed by the useOverlay hook.\n * A context Provider wraps the content to support nested overlays (e.g.,\n * a dropdown inside another dropdown) via blocked-state propagation.\n */\n\nimport type { VNodeChild } from '@pyreon/core'\nimport { onMount, Portal, splitProps } from '@pyreon/core'\nimport { render } from '@pyreon/ui-core'\nimport { PKG_NAME } from '../constants'\nimport type { Content, PyreonComponent } from '../types'\nimport useOverlay, { type UseOverlayProps } from './useOverlay'\n\nconst IS_BROWSER = typeof window !== 'undefined'\n\ntype Align = 'bottom' | 'top' | 'left' | 'right'\ntype AlignX = 'left' | 'center' | 'right'\ntype AlignY = 'bottom' | 'top' | 'center'\n\ntype TriggerRenderer = (\n props: Partial<{\n active: boolean\n showContent: () => void\n hideContent: () => void\n }>,\n) => VNodeChild\n\ntype ContentRenderer = (\n props: Partial<{\n active: boolean\n showContent: () => void\n hideContent: () => void\n align: Align\n alignX: AlignX\n alignY: AlignY\n }>,\n) => VNodeChild\n\nexport type Props = {\n children: ContentRenderer | Content\n trigger: TriggerRenderer | Content\n DOMLocation?: HTMLElement\n triggerRefName?: string\n contentRefName?: string\n} & UseOverlayProps\n\nconst Component: PyreonComponent<Props> = (props) => {\n const [own, overlayProps] = splitProps(props, [\n 'children',\n 'trigger',\n 'DOMLocation',\n 'triggerRefName',\n 'contentRefName',\n ])\n\n const triggerRefName = own.triggerRefName ?? 'ref'\n const contentRefName = own.contentRefName ?? 'ref'\n\n const {\n active,\n triggerRef,\n contentRef,\n showContent,\n hideContent,\n align,\n alignX,\n alignY,\n setupListeners,\n Provider,\n ...ctx\n } = useOverlay(overlayProps)\n\n const { openOn, closeOn, type } = overlayProps\n\n const passHandlers =\n openOn === 'manual' || closeOn === 'manual' || closeOn === 'clickOutsideContent'\n\n const ariaHasPopup = (() => {\n switch (type) {\n case 'modal':\n return 'dialog' as const\n case 'tooltip':\n return 'true' as const\n default:\n return 'menu' as const\n }\n })()\n\n // Set up event listeners on mount\n onMount(() => {\n const cleanup = setupListeners()\n return cleanup\n })\n\n return (\n <>\n {render(own.trigger, {\n [triggerRefName]: triggerRef,\n active: active(),\n 'aria-expanded': active(),\n 'aria-haspopup': ariaHasPopup,\n ...(passHandlers ? { showContent, hideContent } : {}),\n })}\n\n {() =>\n IS_BROWSER && active() ? (\n <Portal target={own.DOMLocation ?? document.body}>\n <Provider {...ctx}>\n {render(own.children, {\n [contentRefName]: contentRef,\n role: type === 'modal' ? 'dialog' : undefined,\n 'aria-modal': type === 'modal' ? true : undefined,\n active: active(),\n align,\n alignX: alignX(),\n alignY: alignY(),\n ...(passHandlers ? { showContent, hideContent } : {}),\n })}\n </Provider>\n </Portal>\n ) : null\n }\n </>\n )\n}\n\nconst name = `${PKG_NAME}/Overlay` as const\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.PYREON__COMPONENT = name\n\nexport default Component\n","/**\n * Portal component stub. In Pyreon, the actual Portal is provided by\n * @pyreon/core's runtime-dom. This component re-exports it for API\n * compatibility with the elements package structure.\n */\n\nimport type { VNodeChild } from '@pyreon/core'\nimport { Portal as CorePortal } from '@pyreon/core'\nimport { PKG_NAME } from '../constants'\nimport type { PyreonComponent } from '../types'\n\nexport interface Props {\n /**\n * Defines a HTML DOM where children to be appended.\n */\n DOMLocation?: HTMLElement\n /**\n * Children to be rendered within **Portal** component.\n */\n children: VNodeChild\n /**\n * Valid HTML Tag\n */\n tag?: string\n}\n\nconst Component: PyreonComponent<Props> = (props) => {\n const target = props.DOMLocation ?? (typeof document !== 'undefined' ? document.body : undefined)\n\n if (!target) return null\n\n return <CorePortal target={target}>{props.children}</CorePortal>\n}\n\nconst name = `${PKG_NAME}/Portal` as const\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.PYREON__COMPONENT = name\n\nexport default Component\n","/**\n * Styled text primitive that inherits color, font-weight, and line-height\n * from its parent so it blends seamlessly into any context. Additional\n * styles can be injected via the responsive `extraStyles` prop processed\n * through makeItResponsive.\n */\nimport { config } from '@pyreon/ui-core'\nimport { extendCss, makeItResponsive } from '@pyreon/unistyle'\nimport type { ResponsiveStylesCallback } from '../types'\n\nconst { styled, css, textComponent } = config\n\nconst styles: ResponsiveStylesCallback = ({ css: cssFn, theme: t }) => cssFn`\n ${t.extraStyles && extendCss(t.extraStyles)};\n`\n\nexport default styled(textComponent, { layer: 'elements' })`\n ${css`\n color: inherit;\n font-weight: inherit;\n line-height: 1;\n `};\n\n ${makeItResponsive({\n key: '$text',\n styles,\n css,\n normalize: false,\n })};\n`\n","/**\n * Text component for rendering inline or block-level text. Supports a\n * `paragraph` shorthand that automatically renders as a `<p>` tag, or\n * a custom `tag` for semantic HTML (h1-h6, span, etc.). Marked with\n * a static `isText` flag so other components can detect text children.\n */\n\nimport { splitProps } from '@pyreon/core'\nimport type { PyreonHTMLAttributes, VNodeChild } from '@pyreon/core'\nimport type { HTMLTextTags } from '@pyreon/ui-core'\nimport { PKG_NAME } from '../constants'\nimport type { ExtendCss, PyreonComponent } from '../types'\nimport Styled from './styled'\n\nexport type Props = Partial<{\n /**\n * Label can be used instead of children for inline syntax. But **children** prop takes a precedence\n */\n label: VNodeChild\n /**\n * Children to be rendered within **Text** component.\n */\n children: VNodeChild\n /**\n * Defines whether should behave as a block text element. Automatically adds **p** HTML tag\n */\n paragraph: boolean\n /**\n * Defines what kind of HTML tag should be rendered\n */\n tag: HTMLTextTags\n /**\n * If an additional styling needs to be added, it can be do so via injecting styles using this property.\n */\n css: ExtendCss\n}> &\n PyreonHTMLAttributes\n\nconst Component: PyreonComponent<Props> & {\n isText?: true\n} = (props) => {\n const [own, rest] = splitProps(props, ['paragraph', 'label', 'children', 'tag', 'css', 'ref'])\n\n let finalTag: string | undefined\n\n if (own.paragraph) finalTag = 'p'\n else {\n finalTag = own.tag\n }\n\n return (\n <Styled ref={own.ref} as={finalTag} $text={{ extraStyles: own.css }} {...rest}>\n {own.children ?? own.label}\n </Styled>\n )\n}\n\n// ----------------------------------------------\n// DEFINE STATICS\n// ----------------------------------------------\nconst name = `${PKG_NAME}/Text` as const\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.PYREON__COMPONENT = name\nComponent.isText = true\n\nexport default Component\n","/**\n * Utility wrapper that injects className and/or style props into its\n * children without adding any DOM nodes of its own. Uses the core `render`\n * helper to clone children with the merged props.\n */\n\nimport type { VNode, VNodeChild } from '@pyreon/core'\nimport { render } from '@pyreon/ui-core'\nimport { PKG_NAME } from '../constants'\nimport type { PyreonComponent } from '../types'\n\nexport interface Props {\n /**\n * Children to be rendered within **Util** component.\n */\n children: VNodeChild\n /**\n * Class name(s) to be added to children component.\n */\n className?: string | string[] | undefined\n /**\n * Style property to extend children component inline styles\n */\n style?: Record<string, unknown> | undefined\n}\n\nconst Component: PyreonComponent<Props> = (({ children, className, style }: Props) => {\n const mergedClasses = Array.isArray(className) ? className.join(' ') : className\n\n const finalProps: Record<string, any> = {}\n if (style) finalProps.style = style\n if (mergedClasses) finalProps.className = mergedClasses\n\n return render(children, finalProps) as VNode | null\n}) as PyreonComponent<Props>\n\nconst name = `${PKG_NAME}/Util` as const\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.PYREON__COMPONENT = name\n\nexport default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EvC,MAAM,UAAoC,EAAE,KAAK,OAAO,OAAO,QAAQ,KAAK;IACxE,EAAE,eAAe,UAAU,EAAE,YAAY,CAAC;;AAG9C,qBAAe,OAAO,eAAe,EAAE,OAAO,YAAY,CAAC;IACvD,GAAG;;;;IAIH;;IAEA,iBAAiB;CACjB,KAAK;CACL;CACA;CACA,WAAW;CACZ,CAAC,CAAC;;;;;;;;;;;ACUL,MAAMC,eAED,UAAU;CACb,MAAM,CAAC,KAAK,QAAQ,WAAW,OAAO;EAAC;EAAa;EAAS;EAAY;EAAO;EAAO;EAAM,CAAC;CAE9F,IAAI;AAEJ,KAAI,IAAI,UAAW,YAAW;KAE5B,YAAW,IAAI;AAGjB,QACE,oBAACC,gBAAD;EAAQ,KAAK,IAAI;EAAK,IAAI;EAAU,OAAO,EAAE,aAAa,IAAI,KAAK;EAAE,GAAI;YACtE,IAAI,YAAY,IAAI;EACd;;AAOb,MAAMC,SAAO,GAAG,SAAS;AAEzB,YAAU,cAAcA;AACxB,YAAU,UAAU;AACpB,YAAU,oBAAoBA;AAC9B,YAAU,SAAS;;;;ACvCnB,MAAMC,gBAAsC,EAAE,UAAU,WAAW,YAAmB;CACpF,MAAM,gBAAgB,MAAM,QAAQ,UAAU,GAAG,UAAU,KAAK,IAAI,GAAG;CAEvE,MAAM,aAAkC,EAAE;AAC1C,KAAI,MAAO,YAAW,QAAQ;AAC9B,KAAI,cAAe,YAAW,YAAY;AAE1C,QAAO,OAAO,UAAU,WAAW;;AAGrC,MAAM,OAAO,GAAG,SAAS;AAEzB,YAAU,cAAc;AACxB,YAAU,UAAU;AACpB,YAAU,oBAAoB"}
1
+ {"version":3,"file":"index.js","names":["styles","component","Fragment","Component","Styled","component","styles","Component","Styled","component","Wrapper","Content","name","Component","component","Component","Iterator","Element","name","Component","Component","name","Component","CorePortal","name","Component","Styled","name","Component"],"sources":["../src/constants.ts","../src/utils.ts","../src/helpers/Content/styled.ts","../../../core/core/lib/jsx-runtime.js","../src/helpers/Content/component.tsx","../src/helpers/Content/index.ts","../src/helpers/Wrapper/styled.ts","../src/helpers/Wrapper/constants.ts","../src/helpers/Wrapper/utils.ts","../src/helpers/Wrapper/component.tsx","../src/helpers/Wrapper/index.ts","../src/Element/constants.ts","../src/Element/utils.ts","../src/Element/component.tsx","../src/helpers/Iterator/component.tsx","../src/helpers/Iterator/index.ts","../src/List/component.tsx","../src/Overlay/context.tsx","../src/Overlay/positioning.ts","../src/Overlay/useOverlay.tsx","../src/Overlay/component.tsx","../src/Portal/component.tsx","../src/Text/styled.ts","../src/Text/component.tsx","../src/Util/component.tsx"],"sourcesContent":["export const PKG_NAME = '@pyreon/elements' as const\n","// `import.meta.env.DEV` is provided by Vite/Rolldown at build time and\n// literal-replaced so prod bundles tree-shake the dev branch to zero bytes.\n// Typed through a narrowing interface so downstream packages don't need\n// `vite/client` in their tsconfigs to type-check this file transitively.\ninterface ViteMeta {\n readonly env?: { readonly DEV?: boolean }\n}\nexport const IS_DEVELOPMENT: boolean = (import.meta as ViteMeta).env?.DEV === true\n","/**\n * Styled component for content areas (before/content/after). Applies\n * responsive flex alignment, gap spacing between slots based on parent\n * direction (margin-right for inline, margin-bottom for rows), and\n * equalCols flex distribution. The \"content\" slot gets `flex: 1` to\n * fill remaining space between before and after.\n */\nimport { config } from '@pyreon/ui-core'\nimport { alignContent, extendCss, makeItResponsive, value } from '@pyreon/unistyle'\nimport type { ResponsiveStylesCallback } from '../../types'\nimport type { StyledProps, ThemeProps } from './types'\n\nconst { styled, css, component } = config\n\nconst equalColsCSS = `\n flex: 1;\n`\n\nconst typeContentCSS = `\n flex: 1;\n`\n\n// --------------------------------------------------------\n// calculate spacing between before / content / after\n// --------------------------------------------------------\nconst gapDimensions = {\n inline: {\n before: 'margin-right',\n after: 'margin-left',\n },\n reverseInline: {\n before: 'margin-right',\n after: 'margin-left',\n },\n rows: {\n before: 'margin-bottom',\n after: 'margin-top',\n },\n reverseRows: {\n before: 'margin-bottom',\n after: 'margin-top',\n },\n} as const\n\nconst calculateGap = ({\n direction,\n type,\n value: gapValue,\n}: {\n direction: keyof typeof gapDimensions\n type: ThemeProps['contentType']\n value: string | number | null | undefined\n}) => {\n if (!direction || !type || type === 'content') return undefined\n\n const finalStyles = `${gapDimensions[direction][type]}: ${gapValue};`\n\n return finalStyles\n}\n\n// --------------------------------------------------------\n// calculations of styles to be rendered\n// --------------------------------------------------------\nconst styles: ResponsiveStylesCallback = ({ css: cssFn, theme: t, rootSize }) => cssFn`\n ${alignContent({\n direction: t.direction,\n alignX: t.alignX,\n alignY: t.alignY,\n })};\n\n ${t.equalCols && equalColsCSS};\n\n ${\n t.gap &&\n t.contentType &&\n calculateGap({\n direction: t.parentDirection,\n type: t.contentType,\n value: value(t.gap, rootSize),\n })\n };\n\n ${t.extraStyles && extendCss(t.extraStyles as Parameters<typeof extendCss>[0])};\n`\n\nconst platformCSS = `box-sizing: border-box;`\n\nconst StyledComponent = styled(component, { layer: 'elements' })`\n ${platformCSS};\n\n display: flex;\n align-self: stretch;\n flex-wrap: wrap;\n\n ${(({ $contentType }: StyledProps) => $contentType === 'content' && typeContentCSS) as any};\n\n ${makeItResponsive({\n key: '$element',\n styles,\n css,\n normalize: true,\n })};\n`\n\nexport default StyledComponent\n","//#region src/h.ts\n/** Marker for fragment nodes — renders children without a wrapper element */\nconst Fragment = Symbol(\"Pyreon.Fragment\");\n/**\n* Hyperscript function — the compiled output of JSX.\n* `<div class=\"x\">hello</div>` → `h(\"div\", { class: \"x\" }, \"hello\")`\n*\n* Generic on P so TypeScript validates props match the component's signature\n* at the call site, then stores the result in the loosely-typed VNode.\n*/\n/** Shared empty props sentinel — identity-checked in mountElement to skip applyProps. */\nconst EMPTY_PROPS = {};\nfunction h(type, props, ...children) {\n\treturn {\n\t\ttype,\n\t\tprops: props ?? EMPTY_PROPS,\n\t\tchildren: normalizeChildren(children),\n\t\tkey: props?.key ?? null\n\t};\n}\nfunction normalizeChildren(children) {\n\tfor (let i = 0; i < children.length; i++) if (Array.isArray(children[i])) return flattenChildren(children);\n\treturn children;\n}\nfunction flattenChildren(children) {\n\tconst result = [];\n\tfor (const child of children) if (Array.isArray(child)) result.push(...flattenChildren(child));\n\telse result.push(child);\n\treturn result;\n}\n\n//#endregion\n//#region src/jsx-runtime.ts\n/**\n* JSX automatic runtime.\n*\n* When tsconfig has `\"jsxImportSource\": \"@pyreon/core\"`, the TS/bundler compiler\n* rewrites JSX to imports from this file automatically:\n* <div class=\"x\" /> → jsx(\"div\", { class: \"x\" })\n*/\nfunction jsx(type, props, key) {\n\tconst { children, ...rest } = props;\n\tconst propsWithKey = key != null ? {\n\t\t...rest,\n\t\tkey\n\t} : rest;\n\tif (typeof type === \"function\") return h(type, children !== void 0 ? {\n\t\t...propsWithKey,\n\t\tchildren\n\t} : propsWithKey);\n\treturn h(type, propsWithKey, ...children === void 0 ? [] : Array.isArray(children) ? children : [children]);\n}\nconst jsxs = jsx;\n\n//#endregion\nexport { Fragment, jsx, jsxs };\n//# sourceMappingURL=jsx-runtime.js.map","/**\n * Content area used inside Element to render one of the three\n * layout slots (before, content, after). Passes alignment, direction,\n * gap, and equalCols styling props to the underlying styled component.\n * Adds a `data-pyr-element` attribute in development for debugging.\n *\n * Children are rendered via core `render()`.\n */\nimport { splitProps } from '@pyreon/core'\nimport { render } from '@pyreon/ui-core'\nimport { IS_DEVELOPMENT } from '../../utils'\nimport Styled from './styled'\nimport type { Props } from './types'\n\nconst Component = (props: Partial<Props>) => {\n const [own, rest] = splitProps(props, [\n 'contentType',\n 'tag',\n 'parentDirection',\n 'direction',\n 'alignX',\n 'alignY',\n 'equalCols',\n 'gap',\n 'extendCss',\n 'children',\n ])\n\n const debugProps = IS_DEVELOPMENT\n ? {\n 'data-pyr-element': own.contentType,\n }\n : {}\n\n const stylingProps = {\n contentType: own.contentType,\n parentDirection: own.parentDirection,\n direction: own.direction,\n alignX: own.alignX,\n alignY: own.alignY,\n equalCols: own.equalCols,\n gap: own.gap,\n extraStyles: own.extendCss,\n }\n\n return (\n <Styled as={own.tag} $contentType={own.contentType} $element={stylingProps} {...debugProps} {...rest}>\n {render(own.children)}\n </Styled>\n )\n}\n\nexport default Component\n","import component from './component'\n\nexport default component\n","/**\n * Styled component for the Element wrapper layer. Handles responsive\n * block/inline-flex display, direction, alignment, and custom CSS injection.\n * Includes special handling for the `parentFix` / `childFix` flags that\n * split flex behavior across two DOM nodes for button/fieldset/legend\n * elements where a single flex container is insufficient.\n */\nimport { config } from '@pyreon/ui-core'\nimport { alignContent, extendCss, makeItResponsive } from '@pyreon/unistyle'\nimport type { ResponsiveStylesCallback } from '../../types'\nimport type { StyledProps } from './types'\n\nconst { styled, css, component } = config\n\nconst childFixCSS = `\n display: flex;\n flex: 1;\n width: 100%;\n height: 100%;\n`\n\nconst parentFixCSS = `\n flex-direction: column;\n`\n\nconst fullHeightCSS = `\n height: 100%;\n`\n\nconst blockCSS = `\n align-self: stretch;\n flex: 1;\n min-width: 0;\n`\n\nconst childFixPosition = (isBlock?: boolean) => `display: ${isBlock ? 'flex' : 'inline-flex'};`\n\nconst styles: ResponsiveStylesCallback = ({ theme: t, css: cssFn }) => cssFn`\n ${t.alignY === 'block' && fullHeightCSS};\n\n ${alignContent({\n direction: t.direction,\n alignX: t.alignX,\n alignY: t.alignY,\n })};\n\n ${t.block && blockCSS};\n ${t.alignY === 'block' && t.block && fullHeightCSS};\n\n ${!t.childFix && childFixPosition(t.block)};\n ${t.parentFix && parentFixCSS};\n\n ${t.extraStyles && extendCss(t.extraStyles as Parameters<typeof extendCss>[0])};\n`\n\nconst platformCSS = `box-sizing: border-box;`\n\nexport default styled(component, { layer: 'elements' })`\n position: relative;\n ${platformCSS};\n\n ${(({ $childFix }: StyledProps) => $childFix && childFixCSS) as any};\n\n ${makeItResponsive({\n key: '$element',\n styles,\n css,\n normalize: true,\n })};\n`\n","/**\n * HTML elements that need a two-layer DOM workaround because browsers do not\n * fully support flexbox layout on button, fieldset, and legend elements.\n * @see https://stackoverflow.com/questions/35464067/flexbox-not-working-on-button-or-fieldset-elements\n */\nexport const INLINE_ELEMENTS_FLEX_FIX = {\n button: true,\n fieldset: true,\n legend: true,\n}\n","import { INLINE_ELEMENTS_FLEX_FIX } from './constants'\n\ntype IsWebFixNeeded = (tag?: string) => boolean\nexport const isWebFixNeeded: IsWebFixNeeded = (tag) => {\n if (tag && tag in INLINE_ELEMENTS_FLEX_FIX) return true\n return false\n}\n","/**\n * Wrapper component that serves as the outermost styled container for Element.\n * On web, it detects button/fieldset/legend tags and applies a two-layer flex\n * fix (parent + child Styled) because these HTML elements do not natively\n * support `display: flex` consistently across browsers.\n */\nimport { splitProps } from '@pyreon/core'\nimport { IS_DEVELOPMENT } from '../../utils'\nimport Styled from './styled'\nimport type { Props } from './types'\nimport { isWebFixNeeded } from './utils'\n\nconst DEV_PROPS: Record<string, string> = IS_DEVELOPMENT ? { 'data-pyr-element': 'Element' } : {}\n\n// Layout / ref keys consumed by Wrapper itself. Everything else is forwarded\n// onto the underlying DOM node. Listed as a tuple so `splitProps` narrows\n// `own` correctly while preserving reactive prop tracking on both halves.\nconst OWN_KEYS: Array<keyof Props | 'ref'> = [\n 'children',\n 'tag',\n 'block',\n 'extendCss',\n 'direction',\n 'alignX',\n 'alignY',\n 'equalCols',\n 'isInline',\n 'ref',\n 'dangerouslySetInnerHTML',\n]\n\nconst Component = (props: Partial<Props> & { ref?: unknown }) => {\n const [own, rest] = splitProps(props, OWN_KEYS)\n\n const commonProps = {\n ...rest,\n ...DEV_PROPS,\n ref: own.ref,\n as: own.tag,\n }\n\n const needsFix = !own.dangerouslySetInnerHTML && isWebFixNeeded(own.tag)\n\n if (!needsFix) {\n return (\n <Styled\n {...commonProps}\n $element={{\n block: own.block,\n direction: own.direction,\n alignX: own.alignX,\n alignY: own.alignY,\n equalCols: own.equalCols,\n extraStyles: own.extendCss,\n }}\n >\n {own.children}\n </Styled>\n )\n }\n\n const asTag = own.isInline ? 'span' : 'div'\n\n return (\n <Styled\n {...commonProps}\n $element={{\n parentFix: true as const,\n block: own.block,\n extraStyles: own.extendCss,\n }}\n >\n <Styled\n as={asTag}\n $childFix\n $element={{\n childFix: true as const,\n direction: own.direction,\n alignX: own.alignX,\n alignY: own.alignY,\n equalCols: own.equalCols,\n }}\n >\n {own.children}\n </Styled>\n </Styled>\n )\n}\n\nexport default Component\n","import component from './component'\n\nexport default component\n","/** Props consumed by Element that should not be forwarded to the underlying DOM node. */\nexport const RESERVED_PROPS = [\n 'innerRef',\n 'tag',\n 'block',\n 'label',\n 'children',\n 'beforeContent',\n 'afterContent',\n\n 'equalCols',\n 'vertical',\n 'direction',\n 'alignX',\n 'alignY',\n\n 'css',\n 'contentCss',\n 'beforeContentCss',\n 'afterContentCss',\n\n 'contentDirection',\n 'contentAlignX',\n 'contentAlignY',\n\n 'beforeContentDirection',\n 'beforeContentAlignX',\n 'beforeContentAlignY',\n\n 'afterContentDirection',\n 'afterContentAlignX',\n 'afterContentAlignY',\n] as const\n\n/**\n * HTML tags that are inline-level by default. When Element renders one of\n * these tags, child Content wrappers use `span` instead of `div` to\n * preserve valid HTML nesting.\n */\nexport const INLINE_ELEMENTS = {\n span: true,\n a: true,\n button: true,\n input: true,\n label: true,\n select: true,\n textarea: true,\n br: true,\n img: true,\n strong: true,\n small: true,\n code: true,\n b: true,\n big: true,\n i: true,\n tt: true,\n abbr: true,\n acronym: true,\n cite: true,\n dfn: true,\n em: true,\n kbd: true,\n samp: true,\n var: true,\n bdo: true,\n map: true,\n object: true,\n q: true,\n script: true,\n sub: true,\n sup: true,\n}\n\n/**\n * HTML void/self-closing elements that cannot have children. When Element\n * detects one of these tags, it skips rendering beforeContent/content/afterContent\n * and returns the Wrapper alone.\n */\nexport const EMPTY_ELEMENTS = {\n area: true,\n base: true,\n br: true,\n col: true,\n embed: true,\n hr: true,\n img: true,\n input: true,\n keygen: true,\n link: true,\n textarea: true,\n // 'meta': true,\n // 'param': true,\n source: true,\n track: true,\n wbr: true,\n}\n","import { EMPTY_ELEMENTS, INLINE_ELEMENTS } from './constants'\n\ntype GetValue = (tag?: string) => boolean\n\n/** Checks whether the given HTML tag is an inline-level element, used to determine sub-tag nesting. */\nexport const isInlineElement: GetValue = (tag) => {\n if (tag && tag in INLINE_ELEMENTS) return true\n return false\n}\n\n/** Checks whether the given HTML tag is a void element that cannot have children. */\nexport const getShouldBeEmpty: GetValue = (tag) => {\n if (tag && tag in EMPTY_ELEMENTS) return true\n return false\n}\n","/**\n * Core building block of the elements package. Renders a three-section layout\n * (beforeContent / content / afterContent) inside a flex Wrapper. When only\n * content is present, the Wrapper inherits content-level alignment directly\n * to avoid an unnecessary nesting layer. Handles HTML-specific edge cases\n * like void elements (input, img) and inline elements (span, a) by\n * skipping children or switching sub-tags accordingly.\n */\n\nimport { onMount, splitProps } from '@pyreon/core'\nimport { render } from '@pyreon/ui-core'\nimport { PKG_NAME } from '../constants'\nimport { Content, Wrapper } from '../helpers'\nimport type { PyreonElement } from './types'\nimport { getShouldBeEmpty, isInlineElement } from './utils'\n\nconst equalize = (el: HTMLElement, direction: unknown) => {\n const beforeEl = el.firstElementChild as HTMLElement | null\n const afterEl = el.lastElementChild as HTMLElement | null\n\n if (beforeEl && afterEl && beforeEl !== afterEl) {\n const type: 'height' | 'width' = direction === 'rows' ? 'height' : 'width'\n const prop = type === 'height' ? 'offsetHeight' : 'offsetWidth'\n const beforeSize = beforeEl[prop]\n const afterSize = afterEl[prop]\n\n if (Number.isInteger(beforeSize) && Number.isInteger(afterSize)) {\n const maxSize = `${Math.max(beforeSize, afterSize)}px`\n beforeEl.style[type] = maxSize\n afterEl.style[type] = maxSize\n }\n }\n}\n\nconst defaultDirection = 'inline'\nconst defaultContentDirection = 'rows'\nconst defaultAlignX = 'left'\nconst defaultAlignY = 'center'\n\nconst Component: PyreonElement = (props) => {\n const [own, rest] = splitProps(props, [\n 'innerRef',\n 'tag',\n 'label',\n 'content',\n 'children',\n 'beforeContent',\n 'afterContent',\n 'equalBeforeAfter',\n 'block',\n 'equalCols',\n 'gap',\n 'direction',\n 'alignX',\n 'alignY',\n 'css',\n 'contentCss',\n 'beforeContentCss',\n 'afterContentCss',\n 'contentDirection',\n 'contentAlignX',\n 'contentAlignY',\n 'beforeContentDirection',\n 'beforeContentAlignX',\n 'beforeContentAlignY',\n 'afterContentDirection',\n 'afterContentAlignX',\n 'afterContentAlignY',\n 'ref',\n ])\n\n const alignX = own.alignX ?? defaultAlignX\n const alignY = own.alignY ?? defaultAlignY\n const contentDirection = own.contentDirection ?? defaultContentDirection\n const contentAlignX = own.contentAlignX ?? defaultAlignX\n const contentAlignY = own.contentAlignY ?? defaultAlignY\n const beforeContentDirection = own.beforeContentDirection ?? defaultDirection\n const beforeContentAlignX = own.beforeContentAlignX ?? defaultAlignX\n const beforeContentAlignY = own.beforeContentAlignY ?? defaultAlignY\n const afterContentDirection = own.afterContentDirection ?? defaultDirection\n const afterContentAlignX = own.afterContentAlignX ?? defaultAlignX\n const afterContentAlignY = own.afterContentAlignY ?? defaultAlignY\n\n // --------------------------------------------------------\n // check if should render only single element\n // --------------------------------------------------------\n const shouldBeEmpty = !!rest.dangerouslySetInnerHTML || getShouldBeEmpty(own.tag)\n\n // --------------------------------------------------------\n // if not single element, calculate values\n // --------------------------------------------------------\n const isSimpleElement = !own.beforeContent && !own.afterContent\n // Getter — preserves reactivity of own.content (which may be _rp() wrapped).\n // Reading own.content via ?? at setup would capture the value once.\n const getChildren = () => own.children ?? own.content ?? own.label\n\n const isInline = isInlineElement(own.tag)\n const SUB_TAG = isInline ? 'span' : undefined\n\n // --------------------------------------------------------\n // direction & alignX & alignY calculations\n // --------------------------------------------------------\n let wrapperDirection: typeof own.direction = own.direction\n let wrapperAlignX: typeof alignX = alignX\n let wrapperAlignY: typeof alignY = alignY\n\n if (isSimpleElement) {\n if (contentDirection) wrapperDirection = contentDirection\n if (contentAlignX) wrapperAlignX = contentAlignX\n if (contentAlignY) wrapperAlignY = contentAlignY\n } else if (own.direction) {\n wrapperDirection = own.direction\n } else {\n wrapperDirection = defaultDirection\n }\n\n // --------------------------------------------------------\n // equalBeforeAfter: measure & equalize slot dimensions\n // --------------------------------------------------------\n let equalizeRef: HTMLElement | null = null\n const externalRef = own.ref ?? own.innerRef\n\n const mergedRef = (node: HTMLElement | null) => {\n equalizeRef = node\n if (typeof externalRef === 'function') (externalRef as (el: HTMLElement | null) => void)(node)\n else if (externalRef != null) {\n ;(externalRef as unknown as { current: HTMLElement | null }).current = node\n }\n }\n\n if (own.equalBeforeAfter && own.beforeContent && own.afterContent) {\n onMount(() => {\n if (equalizeRef) equalize(equalizeRef, own.direction)\n return undefined\n })\n }\n\n // --------------------------------------------------------\n // common wrapper props\n // --------------------------------------------------------\n const WRAPPER_PROPS = {\n ref: mergedRef,\n extendCss: own.css,\n tag: own.tag,\n block: own.block,\n direction: wrapperDirection,\n alignX: wrapperAlignX,\n alignY: wrapperAlignY,\n as: undefined, // reset styled-components `as` prop\n }\n\n // --------------------------------------------------------\n // return simple/empty element like input or image etc.\n // --------------------------------------------------------\n if (shouldBeEmpty) {\n return <Wrapper {...rest} {...WRAPPER_PROPS} />\n }\n\n return (\n <Wrapper {...rest} {...WRAPPER_PROPS} isInline={isInline}>\n {own.beforeContent && (\n <Content\n tag={SUB_TAG}\n contentType=\"before\"\n parentDirection={wrapperDirection}\n extendCss={own.beforeContentCss}\n direction={beforeContentDirection}\n alignX={beforeContentAlignX}\n alignY={beforeContentAlignY}\n equalCols={own.equalCols}\n gap={own.gap}\n >\n {own.beforeContent}\n </Content>\n )}\n\n {isSimpleElement ? (\n render(getChildren())\n ) : (\n <Content\n tag={SUB_TAG}\n contentType=\"content\"\n parentDirection={wrapperDirection}\n extendCss={own.contentCss}\n direction={contentDirection}\n alignX={contentAlignX}\n alignY={contentAlignY}\n equalCols={own.equalCols}\n >\n {getChildren()}\n </Content>\n )}\n\n {own.afterContent && (\n <Content\n tag={SUB_TAG}\n contentType=\"after\"\n parentDirection={wrapperDirection}\n extendCss={own.afterContentCss}\n direction={afterContentDirection}\n alignX={afterContentAlignX}\n alignY={afterContentAlignY}\n equalCols={own.equalCols}\n gap={own.gap}\n >\n {own.afterContent}\n </Content>\n )}\n </Wrapper>\n )\n}\n\nconst name = `${PKG_NAME}/Element` as const\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.PYREON__COMPONENT = name\n\nexport default Component\n","/**\n * Data-driven list renderer that supports three input modes: children,\n * an array of primitives, or an array of objects.\n * Each item receives positional metadata (first, last, odd, even, position)\n * and optional injected props via `itemProps`. Items can be individually\n * wrapped with `wrapComponent`. Children always take priority over the\n * component+data prop pattern.\n */\n\nimport type { VNode, VNodeChild } from '@pyreon/core'\nimport { Fragment } from '@pyreon/core'\nimport { isEmpty, render } from '@pyreon/ui-core'\nimport type { ExtendedProps, ObjectValue, Props, SimpleValue } from './types'\n\ntype ClassifiedData =\n | { type: 'simple'; data: SimpleValue[] }\n | { type: 'complex'; data: ObjectValue[] }\n | null\n\nconst classifyData = (data: unknown[]): ClassifiedData => {\n const items = data.filter(\n (item) =>\n item != null && !(typeof item === 'object' && isEmpty(item as Record<string, unknown>)),\n )\n\n if (items.length === 0) return null\n\n let isSimple = true\n let isComplex = true\n\n for (const item of items) {\n if (typeof item === 'string' || typeof item === 'number') {\n isComplex = false\n } else if (typeof item === 'object') {\n isSimple = false\n } else {\n isSimple = false\n isComplex = false\n }\n }\n\n if (isSimple) return { type: 'simple', data: items as SimpleValue[] }\n if (isComplex) return { type: 'complex', data: items as ObjectValue[] }\n return null\n}\n\nconst RESERVED_PROPS = [\n 'children',\n 'component',\n 'wrapComponent',\n 'data',\n 'itemKey',\n 'valueName',\n 'itemProps',\n 'wrapProps',\n] as const\n\ntype AttachItemProps = ({ i, length }: { i: number; length: number }) => ExtendedProps\n\nconst attachItemProps: AttachItemProps = ({ i, length }: { i: number; length: number }) => {\n const position = i + 1\n\n return {\n index: i,\n first: position === 1,\n last: position === length,\n odd: position % 2 === 1,\n even: position % 2 === 0,\n position,\n }\n}\n\nconst Component = (props: Props) => {\n const {\n itemKey,\n valueName,\n children,\n component,\n data,\n wrapComponent: Wrapper,\n wrapProps,\n itemProps,\n } = props\n\n const injectItemProps = typeof itemProps === 'function' ? itemProps : () => itemProps\n\n const injectWrapItemProps = typeof wrapProps === 'function' ? wrapProps : () => wrapProps\n\n const getKey = (item: string | number, index: number) => {\n if (typeof itemKey === 'function') return itemKey(item, index)\n return index\n }\n\n const renderChild = (child: VNodeChild, total = 1, i = 0) => {\n if (!itemProps && !Wrapper) return child\n\n const extendedProps = attachItemProps({\n i,\n length: total,\n })\n\n const finalItemProps = itemProps ? injectItemProps({}, extendedProps) : {}\n\n if (Wrapper) {\n const finalWrapProps = wrapProps ? injectWrapItemProps({}, extendedProps) : {}\n\n return (\n <Wrapper key={i} {...finalWrapProps}>\n {render(child, finalItemProps)}\n </Wrapper>\n )\n }\n\n return render(child, {\n key: i,\n ...finalItemProps,\n })\n }\n\n // --------------------------------------------------------\n // render children\n // --------------------------------------------------------\n const renderChildren = () => {\n if (!children) return null\n\n // if children is Array\n if (Array.isArray(children)) {\n return children.map((item, i) => renderChild(item, children.length, i))\n }\n\n // if children is Fragment — check VNode type\n if (\n typeof children === 'object' &&\n 'type' in (children as VNode) &&\n (children as VNode).type === Fragment\n ) {\n const fragmentChildren = (children as VNode).children as VNodeChild[]\n const childrenLength = fragmentChildren.length\n\n return fragmentChildren.map((item, i) => renderChild(item, childrenLength, i))\n }\n\n // if single child\n return renderChild(children)\n }\n\n // --------------------------------------------------------\n // render array of strings or numbers\n // --------------------------------------------------------\n const renderSimpleArray = (simpleData: SimpleValue[]) => {\n const { length } = simpleData\n\n if (length === 0) return null\n\n return simpleData.map((item, i) => {\n const key = getKey(item, i)\n const keyName = valueName ?? 'children'\n const extendedProps = attachItemProps({\n i,\n length,\n })\n\n const finalItemProps = {\n ...(itemProps ? injectItemProps({ [keyName]: item }, extendedProps) : {}),\n [keyName]: item,\n }\n\n if (Wrapper) {\n const finalWrapProps = wrapProps\n ? injectWrapItemProps({ [keyName]: item }, extendedProps)\n : {}\n\n return (\n <Wrapper key={key} {...finalWrapProps}>\n {render(component, finalItemProps)}\n </Wrapper>\n )\n }\n\n return render(component, { key, ...finalItemProps })\n })\n }\n\n // --------------------------------------------------------\n // render array of objects\n // --------------------------------------------------------\n const getObjectKey = (item: ObjectValue, index: number) => {\n if (!itemKey) return item.key ?? item.id ?? item.itemId ?? index\n if (typeof itemKey === 'function') return itemKey(item, index)\n if (typeof itemKey === 'string') return item[itemKey]\n\n return index\n }\n\n const renderComplexArray = (complexData: ObjectValue[]) => {\n const { length } = complexData\n\n if (length === 0) return null\n\n return complexData.map((item, i) => {\n const { component: itemComponent, ...restItem } = item\n const renderItem = itemComponent ?? component\n const key = getObjectKey(restItem, i)\n const extendedProps = attachItemProps({\n i,\n length,\n })\n\n const finalItemProps = {\n ...(itemProps ? injectItemProps(item, extendedProps) : {}),\n ...restItem,\n }\n\n if (Wrapper && !itemComponent) {\n const finalWrapProps = wrapProps ? injectWrapItemProps(item, extendedProps) : {}\n\n return (\n <Wrapper key={key} {...finalWrapProps}>\n {render(renderItem, finalItemProps)}\n </Wrapper>\n )\n }\n\n return render(renderItem, { key, ...finalItemProps })\n })\n }\n\n // --------------------------------------------------------\n // render list items\n // --------------------------------------------------------\n const renderItems = (): VNodeChild => {\n // children have priority over props component + data\n if (children) return renderChildren() as VNodeChild\n\n // render props component + data\n if (component && Array.isArray(data)) {\n const classified = classifyData(data)\n if (!classified) return null\n if (classified.type === 'simple') return renderSimpleArray(classified.data) as VNodeChild\n return renderComplexArray(classified.data) as VNodeChild\n }\n\n return null\n }\n\n return renderItems()\n}\n\nexport default Object.assign(Component, {\n isIterator: true as const,\n RESERVED_PROPS,\n})\n","import component from './component'\nimport type {\n ElementType,\n ExtendedProps,\n MaybeNull,\n ObjectValue,\n Props,\n PropsCallback,\n SimpleValue,\n} from './types'\n\nexport type { ElementType, ExtendedProps, MaybeNull, ObjectValue, Props, PropsCallback, SimpleValue }\n\nexport default component\n","/**\n * List component that combines Iterator (data-driven rendering) with an\n * optional Element root wrapper. When `rootElement` is false (default),\n * it renders a bare Iterator as a fragment. When true, the Iterator output\n * is wrapped in an Element that receives all non-iterator props (e.g.,\n * layout, alignment, css), allowing the list to be styled as a single block.\n */\nimport { splitProps } from '@pyreon/core'\nimport { omit, pick } from '@pyreon/ui-core'\nimport { PKG_NAME } from '../constants'\nimport type { ElementProps, PyreonElement } from '../Element'\nimport { Element } from '../Element'\nimport type { Props as IteratorProps } from '../helpers/Iterator'\nimport Iterator from '../helpers/Iterator'\nimport type { MergeTypes } from '../types'\n\ntype ListProps = {\n /**\n * A boolean value. When set to `false`, component returns fragment.\n * When set to `true`, component returns as the **root** element `Element`\n * component.\n */\n rootElement?: boolean\n /**\n * Label prop from `Element` component is being ignored.\n */\n label: never\n /**\n * Content prop from `Element` component is being ignored.\n */\n content: never\n}\n\nexport type Props = MergeTypes<[IteratorProps, ListProps]> & Partial<Omit<ElementProps, 'children' | 'content' | 'label'>>\n\nconst Component: PyreonElement<Props> = ((allProps: Partial<Props & ElementProps>) => {\n const [own, props] = splitProps(allProps, ['rootElement', 'ref'])\n const renderedList = <Iterator {...pick(props, Iterator.RESERVED_PROPS)} />\n\n if (!own.rootElement) return renderedList\n\n return (\n <Element {...(own.ref ? { ref: own.ref } : {})} {...omit(props, Iterator.RESERVED_PROPS)}>\n {renderedList}\n </Element>\n )\n}) as PyreonElement<Props>\n\nconst name = `${PKG_NAME}/List` as const\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.PYREON__COMPONENT = name\n\nexport default Component\n","/**\n * Context for nested overlay coordination. When a child overlay opens, it\n * sets the parent's blocked state to true, preventing the parent from\n * closing in response to click/hover events that belong to the child.\n */\n\nimport type { VNodeChild } from '@pyreon/core'\nimport { createContext, provide, useContext } from '@pyreon/core'\n\nexport interface OverlayContext {\n blocked: boolean | (() => boolean)\n setBlocked: () => void\n setUnblocked: () => void\n}\n\nconst context = createContext<OverlayContext>({} as OverlayContext)\n\nexport const useOverlayContext = () => useContext(context)\n\nconst Component = (props: OverlayContext & { children: VNodeChild }) => {\n const ctx = {\n blocked: props.blocked,\n setBlocked: props.setBlocked,\n setUnblocked: props.setUnblocked,\n }\n\n provide(context, ctx)\n\n return <>{props.children}</>\n}\n\nexport default Component\n","/**\n * Pure positioning helpers for the Overlay component. Split out from\n * `useOverlay.tsx` so the SSR-fallback branches (`typeof window === 'undefined'`)\n * can be exercised directly by tests that stub `globalThis.window` — the\n * `useOverlay` hook itself runs these via event handlers registered inside\n * `onMount`, which are unreachable during module-level test imports in\n * happy-dom (where `window` is always defined).\n */\n\nexport type OverlayPosition = Partial<{\n top: number | string\n bottom: number | string\n left: number | string\n right: number | string\n}>\n\nexport type Align = 'bottom' | 'top' | 'left' | 'right'\nexport type AlignX = 'left' | 'center' | 'right'\nexport type AlignY = 'bottom' | 'top' | 'center'\n\nexport type PositionResult = {\n pos: OverlayPosition\n resolvedAlignX: AlignX\n resolvedAlignY: AlignY\n}\n\nconst sel = <T,>(cond: boolean, a: T, b: T): T => (cond ? a : b)\n\nexport const calcDropdownVertical = (\n c: DOMRect,\n t: DOMRect,\n align: 'top' | 'bottom',\n alignX: AlignX,\n offsetX: number,\n offsetY: number,\n): PositionResult => {\n // SSR-fallback: positioning only runs in the mounted browser context, but\n // the explicit guard documents the SSR-safety contract at the callsite\n // and lets `no-window-in-ssr` prove it locally. Return shape mirrors the\n // \"no element\" path below (empty `pos`, alignment preserved).\n if (typeof window === 'undefined') return { pos: {}, resolvedAlignX: alignX, resolvedAlignY: align }\n const pos: OverlayPosition = {}\n\n const topPos = t.top - offsetY - c.height\n const bottomPos = t.bottom + offsetY\n const leftPos = t.left + offsetX\n const rightPos = t.right - offsetX - c.width\n\n const fitsTop = topPos >= 0\n const fitsBottom = bottomPos + c.height <= window.innerHeight\n const fitsLeft = leftPos + c.width <= window.innerWidth\n const fitsRight = rightPos >= 0\n\n const useTop = sel(align === 'top', fitsTop, !fitsBottom)\n pos.top = sel(useTop, topPos, bottomPos)\n const resolvedAlignY: AlignY = sel(useTop, 'top', 'bottom')\n\n let resolvedAlignX: AlignX = alignX\n if (alignX === 'left') {\n pos.left = sel(fitsLeft, leftPos, rightPos)\n resolvedAlignX = sel(fitsLeft, 'left', 'right')\n } else if (alignX === 'right') {\n pos.left = sel(fitsRight, rightPos, leftPos)\n resolvedAlignX = sel(fitsRight, 'right', 'left')\n } else {\n const center = t.left + (t.right - t.left) / 2 - c.width / 2\n const fitsCL = center >= 0\n const fitsCR = center + c.width <= window.innerWidth\n\n if (fitsCL && fitsCR) {\n resolvedAlignX = 'center'\n pos.left = center\n } else if (fitsCL) {\n resolvedAlignX = 'left'\n pos.left = leftPos\n } else if (fitsCR) {\n resolvedAlignX = 'right'\n pos.left = rightPos\n }\n }\n\n return { pos, resolvedAlignX, resolvedAlignY }\n}\n\nexport const calcDropdownHorizontal = (\n c: DOMRect,\n t: DOMRect,\n align: 'left' | 'right',\n alignY: AlignY,\n offsetX: number,\n offsetY: number,\n): PositionResult => {\n if (typeof window === 'undefined') return { pos: {}, resolvedAlignX: align, resolvedAlignY: alignY }\n const pos: OverlayPosition = {}\n\n const leftPos = t.left - offsetX - c.width\n const rightPos = t.right + offsetX\n const topPos = t.top + offsetY\n const bottomPos = t.bottom - offsetY - c.height\n\n const fitsLeft = leftPos >= 0\n const fitsRight = rightPos + c.width <= window.innerWidth\n const fitsTop = topPos + c.height <= window.innerHeight\n const fitsBottom = bottomPos >= 0\n\n const useLeft = sel(align === 'left', fitsLeft, !fitsRight)\n pos.left = sel(useLeft, leftPos, rightPos)\n const resolvedAlignX: AlignX = sel(useLeft, 'left', 'right')\n\n let resolvedAlignY: AlignY = alignY\n if (alignY === 'top') {\n pos.top = sel(fitsTop, topPos, bottomPos)\n resolvedAlignY = sel(fitsTop, 'top', 'bottom')\n } else if (alignY === 'bottom') {\n pos.top = sel(fitsBottom, bottomPos, topPos)\n resolvedAlignY = sel(fitsBottom, 'bottom', 'top')\n } else {\n const center = t.top + (t.bottom - t.top) / 2 - c.height / 2\n const fitsCT = center >= 0\n const fitsCB = center + c.height <= window.innerHeight\n\n if (fitsCT && fitsCB) {\n resolvedAlignY = 'center'\n pos.top = center\n } else if (fitsCT) {\n resolvedAlignY = 'top'\n pos.top = topPos\n } else if (fitsCB) {\n resolvedAlignY = 'bottom'\n pos.top = bottomPos\n }\n }\n\n return { pos, resolvedAlignX, resolvedAlignY }\n}\n\nexport const calcModalPos = (\n c: DOMRect,\n alignX: AlignX,\n alignY: AlignY,\n offsetX: number,\n offsetY: number,\n): OverlayPosition => {\n if (typeof window === 'undefined') return {}\n const pos: OverlayPosition = {}\n\n switch (alignX) {\n case 'right':\n pos.right = offsetX\n break\n case 'left':\n pos.left = offsetX\n break\n case 'center':\n pos.left = window.innerWidth / 2 - c.width / 2\n break\n default:\n pos.right = offsetX\n }\n\n switch (alignY) {\n case 'top':\n pos.top = offsetY\n break\n case 'center':\n pos.top = window.innerHeight / 2 - c.height / 2\n break\n case 'bottom':\n pos.bottom = offsetY\n break\n default:\n pos.top = offsetY\n }\n\n return pos\n}\n\nexport const adjustForAncestor = (\n pos: OverlayPosition,\n ancestor: { top: number; left: number },\n): OverlayPosition => {\n if (ancestor.top === 0 && ancestor.left === 0) return pos\n\n const result = { ...pos }\n if (typeof result.top === 'number') result.top -= ancestor.top\n if (typeof result.bottom === 'number') result.bottom += ancestor.top\n if (typeof result.left === 'number') result.left -= ancestor.left\n if (typeof result.right === 'number') result.right += ancestor.left\n\n return result\n}\n","/**\n * Core hook powering the Overlay component. Manages open/close state, DOM\n * event listeners (click, hover, scroll, resize, ESC key), and dynamic\n * positioning of overlay content relative to its trigger. Supports dropdown,\n * tooltip, popover, and modal types with automatic edge-of-viewport flipping.\n * Event handlers are throttled for performance, and nested overlay blocking\n * is coordinated through the overlay context.\n */\n\nimport { signal } from '@pyreon/reactivity'\nimport { throttle } from '@pyreon/ui-core'\nimport { value } from '@pyreon/unistyle'\nimport { IS_DEVELOPMENT } from '../utils'\nimport Provider, { useOverlayContext } from './context'\nimport {\n adjustForAncestor,\n calcDropdownHorizontal,\n calcDropdownVertical,\n calcModalPos,\n type Align,\n type AlignX,\n type AlignY,\n type OverlayPosition,\n} from './positioning'\n\nexport type UseOverlayProps = Partial<{\n isOpen: boolean\n openOn: 'click' | 'hover' | 'manual'\n closeOn: 'click' | 'clickOnTrigger' | 'clickOutsideContent' | 'hover' | 'manual'\n type: 'dropdown' | 'tooltip' | 'popover' | 'modal' | 'custom'\n position: 'absolute' | 'fixed' | 'relative' | 'static'\n align: Align\n alignX: AlignX\n alignY: AlignY\n offsetX: number\n offsetY: number\n throttleDelay: number\n parentContainer: HTMLElement | null\n closeOnEsc: boolean\n hoverDelay: number\n disabled: boolean\n onOpen: () => void\n onClose: () => void\n}>\n\n// Reference counter for nested modals sharing document.body overflow lock.\nlet modalOverflowCount = 0\n\nconst devWarn = (msg: string) => {\n if (!IS_DEVELOPMENT) return\n // oxlint-disable-next-line no-console\n console.warn(msg)\n}\n\n\ntype ComputeResult = {\n pos: OverlayPosition\n resolvedAlignX?: AlignX\n resolvedAlignY?: AlignY\n}\n\nconst computePosition = (\n type: string,\n align: Align,\n alignX: AlignX,\n alignY: AlignY,\n offsetX: number,\n offsetY: number,\n triggerEl: HTMLElement | null,\n contentEl: HTMLElement | null,\n ancestorOffset: { top: number; left: number },\n): ComputeResult => {\n const isDropdown = ['dropdown', 'tooltip', 'popover'].includes(type)\n\n if (isDropdown && (!triggerEl || !contentEl)) {\n devWarn(\n `[@pyreon/elements] Overlay (${type}): ` +\n `${triggerEl ? 'contentRef' : 'triggerRef'} is not attached. ` +\n 'Position cannot be calculated without both refs.',\n )\n return { pos: {} }\n }\n\n if (isDropdown && triggerEl && contentEl) {\n const c = contentEl.getBoundingClientRect()\n const t = triggerEl.getBoundingClientRect()\n const result =\n align === 'top' || align === 'bottom'\n ? calcDropdownVertical(c, t, align, alignX, offsetX, offsetY)\n : calcDropdownHorizontal(c, t, align as 'left' | 'right', alignY, offsetX, offsetY)\n\n return {\n pos: adjustForAncestor(result.pos, ancestorOffset),\n resolvedAlignX: result.resolvedAlignX,\n resolvedAlignY: result.resolvedAlignY,\n }\n }\n\n if (type === 'modal') {\n if (!contentEl) {\n devWarn(\n '[@pyreon/elements] Overlay (modal): contentRef is not attached. ' +\n 'Modal position cannot be calculated without a content element.',\n )\n return { pos: {} }\n }\n const c = contentEl.getBoundingClientRect()\n return {\n pos: adjustForAncestor(calcModalPos(c, alignX, alignY, offsetX, offsetY), ancestorOffset),\n }\n }\n\n return { pos: {} }\n}\n\nconst processVisibilityEvent = (\n e: Event,\n active: boolean,\n openOn: string,\n closeOn: string,\n isTrigger: (evt: Event) => boolean,\n isContent: (evt: Event) => boolean,\n showContent: () => void,\n hideContent: () => void,\n) => {\n if (!active && openOn === 'click' && e.type === 'click' && isTrigger(e)) {\n showContent()\n return\n }\n\n if (!active) return\n\n if (closeOn === 'hover' && e.type === 'scroll') {\n hideContent()\n return\n }\n\n if (e.type !== 'click') return\n\n if (closeOn === 'click') {\n hideContent()\n } else if (closeOn === 'clickOnTrigger' && isTrigger(e)) {\n hideContent()\n } else if (closeOn === 'clickOutsideContent' && !isContent(e)) {\n hideContent()\n }\n}\n\nconst useOverlay = ({\n isOpen = false,\n openOn = 'click',\n closeOn = 'click',\n type = 'dropdown',\n position = 'fixed',\n align = 'bottom',\n alignX: propAlignX = 'left',\n alignY: propAlignY = 'bottom',\n offsetX = 0,\n offsetY = 0,\n throttleDelay = 200,\n parentContainer,\n closeOnEsc = true,\n hoverDelay = 100,\n disabled,\n onOpen,\n onClose,\n}: Partial<UseOverlayProps> = {}) => {\n const ctx = useOverlayContext()\n\n // Signal-based state\n const active = signal(isOpen)\n const isContentLoaded = signal(false)\n const innerAlignX = signal(propAlignX)\n const innerAlignY = signal(propAlignY)\n const blockedCount = signal(0)\n\n const blocked = () => blockedCount() > 0\n\n // DOM refs (plain variables, component runs once)\n let triggerEl: HTMLElement | null = null\n let contentEl: HTMLElement | null = null\n const _prevFocusEl: HTMLElement | null = null\n let hoverTimeout: ReturnType<typeof setTimeout> | null = null\n\n const triggerRef = (node: HTMLElement | null) => {\n triggerEl = node\n }\n\n const contentRefCallback = (node: HTMLElement | null) => {\n contentEl = node\n isContentLoaded.set(!!node)\n }\n\n const setBlocked = () => blockedCount.update((c) => c + 1)\n const setUnblocked = () => blockedCount.update((c) => Math.max(0, c - 1))\n\n const showContent = () => {\n active.set(true)\n onOpen?.()\n ctx.setBlocked?.()\n }\n\n const hideContent = () => {\n active.set(false)\n isContentLoaded.set(false)\n onClose?.()\n ctx.setUnblocked?.()\n }\n\n // Position calculation helpers\n const getAncestorOffset = () => {\n if (typeof document === 'undefined') return { top: 0, left: 0 }\n if (position !== 'absolute' || !contentEl) {\n return { top: 0, left: 0 }\n }\n\n const offsetParent = contentEl.offsetParent as HTMLElement | null\n if (!offsetParent || offsetParent === document.body) {\n return { top: 0, left: 0 }\n }\n\n const rect = offsetParent.getBoundingClientRect()\n return { top: rect.top, left: rect.left }\n }\n\n const calculateContentPosition = () => {\n if (!active() || !isContentLoaded()) return {}\n\n const result = computePosition(\n type,\n align,\n propAlignX,\n propAlignY,\n offsetX,\n offsetY,\n triggerEl,\n contentEl,\n getAncestorOffset(),\n )\n\n if (result.resolvedAlignX) innerAlignX.set(result.resolvedAlignX)\n if (result.resolvedAlignY) innerAlignY.set(result.resolvedAlignY)\n\n return result.pos\n }\n\n const assignContentPosition = (values: OverlayPosition = {}) => {\n if (!contentEl) return\n\n const el = contentEl\n const setValue = (param?: string | number) => value(param, 16) as string\n\n el.style.position = position\n\n el.style.top = values.top != null ? setValue(values.top) : ''\n el.style.bottom = values.bottom != null ? setValue(values.bottom) : ''\n el.style.left = values.left != null ? setValue(values.left) : ''\n el.style.right = values.right != null ? setValue(values.right) : ''\n }\n\n const setContentPosition = () => {\n const currentPosition = calculateContentPosition()\n assignContentPosition(currentPosition)\n }\n\n const isNodeOrChild = (getRef: () => HTMLElement | null) => (e: Event) => {\n const ref = getRef()\n if (e?.target && ref) {\n return ref.contains(e.target as Element) || e.target === ref\n }\n return false\n }\n\n const handleVisibilityByEventType = (e: Event) => {\n if (blocked() || disabled) return\n\n processVisibilityEvent(\n e,\n active(),\n openOn,\n closeOn,\n isNodeOrChild(() => triggerEl),\n isNodeOrChild(() => contentEl),\n showContent,\n hideContent,\n )\n }\n\n const handleContentPosition = throttle(() => setContentPosition(), throttleDelay)\n\n const handleClick = (e: Event) => handleVisibilityByEventType(e)\n\n const handleVisibility = throttle((e: Event) => handleVisibilityByEventType(e), throttleDelay)\n\n // --------------------------------------------------------------------------\n // Set up all event listeners on mount, clean up on unmount\n // --------------------------------------------------------------------------\n const setupListeners = () => {\n if (typeof window === 'undefined') return () => {}\n const cleanups: (() => void)[] = []\n\n // Click-based open/close\n const enabledClick =\n openOn === 'click' || ['click', 'clickOnTrigger', 'clickOutsideContent'].includes(closeOn)\n\n if (enabledClick) {\n window.addEventListener('click', handleClick)\n cleanups.push(() => window.removeEventListener('click', handleClick))\n }\n\n // ESC key\n if (closeOnEsc) {\n const handleEscKey = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && active() && !blocked()) {\n hideContent()\n }\n }\n window.addEventListener('keydown', handleEscKey)\n cleanups.push(() => window.removeEventListener('keydown', handleEscKey))\n }\n\n // Hover-based open/close\n const enabledHover = openOn === 'hover' || closeOn === 'hover'\n if (enabledHover) {\n const clearHoverTimeout = () => {\n if (hoverTimeout != null) {\n clearTimeout(hoverTimeout)\n hoverTimeout = null\n }\n }\n\n const scheduleHide = () => {\n clearHoverTimeout()\n hoverTimeout = setTimeout(hideContent, hoverDelay)\n }\n\n const onTriggerEnter = () => {\n clearHoverTimeout()\n if (openOn === 'hover' && !active()) showContent()\n }\n\n const onTriggerLeave = () => {\n if (closeOn === 'hover' && active()) scheduleHide()\n }\n\n const onContentEnter = () => {\n clearHoverTimeout()\n }\n\n const onContentLeave = () => {\n if (closeOn === 'hover' && active()) scheduleHide()\n }\n\n // We need to defer listener attachment until refs are available\n const attachHoverListeners = () => {\n if (triggerEl) {\n triggerEl.addEventListener('mouseenter', onTriggerEnter)\n triggerEl.addEventListener('mouseleave', onTriggerLeave)\n }\n if (contentEl) {\n contentEl.addEventListener('mouseenter', onContentEnter)\n contentEl.addEventListener('mouseleave', onContentLeave)\n }\n }\n\n attachHoverListeners()\n\n cleanups.push(() => {\n clearHoverTimeout()\n if (triggerEl) {\n triggerEl.removeEventListener('mouseenter', onTriggerEnter)\n triggerEl.removeEventListener('mouseleave', onTriggerLeave)\n }\n if (contentEl) {\n contentEl.removeEventListener('mouseenter', onContentEnter)\n contentEl.removeEventListener('mouseleave', onContentLeave)\n }\n })\n }\n\n // Resize/scroll repositioning\n const shouldSetOverflow = type === 'modal'\n\n const onScroll = (e: Event) => {\n handleContentPosition()\n handleVisibility(e)\n }\n\n if (shouldSetOverflow) {\n modalOverflowCount++\n if (modalOverflowCount === 1) document.body.style.overflow = 'hidden'\n }\n\n window.addEventListener('resize', handleContentPosition)\n window.addEventListener('scroll', onScroll, { passive: true })\n cleanups.push(() => {\n handleContentPosition.cancel()\n handleVisibility.cancel()\n if (shouldSetOverflow) {\n modalOverflowCount--\n if (modalOverflowCount === 0) document.body.style.overflow = ''\n }\n window.removeEventListener('resize', handleContentPosition)\n window.removeEventListener('scroll', onScroll)\n })\n\n // Parent container scroll\n if (parentContainer) {\n if (closeOn !== 'hover') parentContainer.style.overflow = 'hidden'\n\n const onParentScroll = (e: Event) => {\n handleContentPosition()\n handleVisibility(e)\n }\n\n parentContainer.addEventListener('scroll', onParentScroll, {\n passive: true,\n })\n cleanups.push(() => {\n parentContainer.style.overflow = ''\n parentContainer.removeEventListener('scroll', onParentScroll)\n })\n }\n\n // Cleanup function\n return () => {\n for (const cleanup of cleanups) cleanup()\n }\n }\n\n // Handle disabled state\n if (disabled) {\n active.set(false)\n }\n\n return {\n triggerRef,\n contentRef: contentRefCallback,\n active,\n align,\n alignX: innerAlignX,\n alignY: innerAlignY,\n showContent,\n hideContent,\n blocked,\n setBlocked,\n setUnblocked,\n setupListeners,\n Provider,\n }\n}\n\nexport default useOverlay\n","/**\n * Overlay component that renders a trigger element and conditionally shows\n * content via a Portal. The trigger receives a ref and optional show/hide\n * callbacks; the content is positioned and managed by the useOverlay hook.\n * A context Provider wraps the content to support nested overlays (e.g.,\n * a dropdown inside another dropdown) via blocked-state propagation.\n */\n\nimport type { VNodeChild } from '@pyreon/core'\nimport { onMount, Portal, splitProps } from '@pyreon/core'\nimport { render } from '@pyreon/ui-core'\nimport { PKG_NAME } from '../constants'\nimport type { Content, PyreonComponent } from '../types'\nimport useOverlay, { type UseOverlayProps } from './useOverlay'\n\nconst IS_BROWSER = typeof window !== 'undefined'\n\ntype Align = 'bottom' | 'top' | 'left' | 'right'\ntype AlignX = 'left' | 'center' | 'right'\ntype AlignY = 'bottom' | 'top' | 'center'\n\ntype TriggerRenderer = (\n props: Partial<{\n active: boolean\n showContent: () => void\n hideContent: () => void\n }>,\n) => VNodeChild\n\ntype ContentRenderer = (\n props: Partial<{\n active: boolean\n showContent: () => void\n hideContent: () => void\n align: Align\n alignX: AlignX\n alignY: AlignY\n }>,\n) => VNodeChild\n\nexport type Props = {\n children: ContentRenderer | Content\n trigger: TriggerRenderer | Content\n DOMLocation?: HTMLElement\n triggerRefName?: string\n contentRefName?: string\n} & UseOverlayProps\n\nconst Component: PyreonComponent<Props> = (props) => {\n const [own, overlayProps] = splitProps(props, [\n 'children',\n 'trigger',\n 'DOMLocation',\n 'triggerRefName',\n 'contentRefName',\n ])\n\n const triggerRefName = own.triggerRefName ?? 'ref'\n const contentRefName = own.contentRefName ?? 'ref'\n\n const {\n active,\n triggerRef,\n contentRef,\n showContent,\n hideContent,\n align,\n alignX,\n alignY,\n setupListeners,\n Provider,\n ...ctx\n } = useOverlay(overlayProps)\n\n const { openOn, closeOn, type } = overlayProps\n\n const passHandlers =\n openOn === 'manual' || closeOn === 'manual' || closeOn === 'clickOutsideContent'\n\n const ariaHasPopup = (() => {\n switch (type) {\n case 'modal':\n return 'dialog' as const\n case 'tooltip':\n return 'true' as const\n default:\n return 'menu' as const\n }\n })()\n\n // Set up event listeners on mount\n onMount(() => {\n const cleanup = setupListeners()\n return cleanup\n })\n\n return (\n <>\n {render(own.trigger, {\n [triggerRefName]: triggerRef,\n active: active(),\n 'aria-expanded': active(),\n 'aria-haspopup': ariaHasPopup,\n ...(passHandlers ? { showContent, hideContent } : {}),\n })}\n\n {() =>\n IS_BROWSER && active() ? (\n <Portal target={own.DOMLocation ?? document.body}>\n <Provider {...ctx}>\n {render(own.children, {\n [contentRefName]: contentRef,\n role: type === 'modal' ? 'dialog' : undefined,\n 'aria-modal': type === 'modal' ? true : undefined,\n active: active(),\n align,\n alignX: alignX(),\n alignY: alignY(),\n ...(passHandlers ? { showContent, hideContent } : {}),\n })}\n </Provider>\n </Portal>\n ) : null\n }\n </>\n )\n}\n\nconst name = `${PKG_NAME}/Overlay` as const\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.PYREON__COMPONENT = name\n\nexport default Component\n","/**\n * Portal component stub. In Pyreon, the actual Portal is provided by\n * @pyreon/core's runtime-dom. This component re-exports it for API\n * compatibility with the elements package structure.\n */\n\nimport type { VNodeChild } from '@pyreon/core'\nimport { Portal as CorePortal } from '@pyreon/core'\nimport { PKG_NAME } from '../constants'\nimport type { PyreonComponent } from '../types'\n\nexport interface Props {\n /**\n * Defines a HTML DOM where children to be appended.\n */\n DOMLocation?: HTMLElement\n /**\n * Children to be rendered within **Portal** component.\n */\n children: VNodeChild\n /**\n * Valid HTML Tag\n */\n tag?: string\n}\n\nconst Component: PyreonComponent<Props> = (props) => {\n const target = props.DOMLocation ?? (typeof document !== 'undefined' ? document.body : undefined)\n\n if (!target) return null\n\n return <CorePortal target={target}>{props.children}</CorePortal>\n}\n\nconst name = `${PKG_NAME}/Portal` as const\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.PYREON__COMPONENT = name\n\nexport default Component\n","/**\n * Styled text primitive that inherits color, font-weight, and line-height\n * from its parent so it blends seamlessly into any context. Additional\n * styles can be injected via the responsive `extraStyles` prop processed\n * through makeItResponsive.\n */\nimport { config } from '@pyreon/ui-core'\nimport { extendCss, makeItResponsive } from '@pyreon/unistyle'\nimport type { ResponsiveStylesCallback } from '../types'\n\nconst { styled, css, textComponent } = config\n\nconst styles: ResponsiveStylesCallback = ({ css: cssFn, theme: t }) => cssFn`\n ${t.extraStyles && extendCss(t.extraStyles)};\n`\n\nexport default styled(textComponent, { layer: 'elements' })`\n ${css`\n color: inherit;\n font-weight: inherit;\n line-height: 1;\n `};\n\n ${makeItResponsive({\n key: '$text',\n styles,\n css,\n normalize: false,\n })};\n`\n","/**\n * Text component for rendering inline or block-level text. Supports a\n * `paragraph` shorthand that automatically renders as a `<p>` tag, or\n * a custom `tag` for semantic HTML (h1-h6, span, etc.). Marked with\n * a static `isText` flag so other components can detect text children.\n */\n\nimport { splitProps } from '@pyreon/core'\nimport type { PyreonHTMLAttributes, VNodeChild } from '@pyreon/core'\nimport type { HTMLTextTags } from '@pyreon/ui-core'\nimport { PKG_NAME } from '../constants'\nimport type { ExtendCss, PyreonComponent } from '../types'\nimport Styled from './styled'\n\nexport type Props = Partial<{\n /**\n * Label can be used instead of children for inline syntax. But **children** prop takes a precedence\n */\n label: VNodeChild\n /**\n * Children to be rendered within **Text** component.\n */\n children: VNodeChild\n /**\n * Defines whether should behave as a block text element. Automatically adds **p** HTML tag\n */\n paragraph: boolean\n /**\n * Defines what kind of HTML tag should be rendered\n */\n tag: HTMLTextTags\n /**\n * If an additional styling needs to be added, it can be do so via injecting styles using this property.\n */\n css: ExtendCss\n}> &\n PyreonHTMLAttributes\n\nconst Component: PyreonComponent<Props> & {\n isText?: true\n} = (props) => {\n const [own, rest] = splitProps(props, ['paragraph', 'label', 'children', 'tag', 'css', 'ref'])\n\n let finalTag: string | undefined\n\n if (own.paragraph) finalTag = 'p'\n else {\n finalTag = own.tag\n }\n\n return (\n <Styled ref={own.ref} as={finalTag} $text={{ extraStyles: own.css }} {...rest}>\n {own.children ?? own.label}\n </Styled>\n )\n}\n\n// ----------------------------------------------\n// DEFINE STATICS\n// ----------------------------------------------\nconst name = `${PKG_NAME}/Text` as const\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.PYREON__COMPONENT = name\nComponent.isText = true\n\nexport default Component\n","/**\n * Utility wrapper that injects className and/or style props into its\n * children without adding any DOM nodes of its own. Uses the core `render`\n * helper to clone children with the merged props.\n */\n\nimport type { VNode, VNodeChild } from '@pyreon/core'\nimport { render } from '@pyreon/ui-core'\nimport { PKG_NAME } from '../constants'\nimport type { PyreonComponent } from '../types'\n\nexport interface Props {\n /**\n * Children to be rendered within **Util** component.\n */\n children: VNodeChild\n /**\n * Class name(s) to be added to children component.\n */\n className?: string | string[] | undefined\n /**\n * Style property to extend children component inline styles\n */\n style?: Record<string, unknown> | undefined\n}\n\nconst Component: PyreonComponent<Props> = (({ children, className, style }: Props) => {\n const mergedClasses = Array.isArray(className) ? className.join(' ') : className\n\n const finalProps: Record<string, any> = {}\n if (style) finalProps.style = style\n if (mergedClasses) finalProps.className = mergedClasses\n\n return render(children, finalProps) as VNode | null\n}) as PyreonComponent<Props>\n\nconst name = `${PKG_NAME}/Util` as const\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.PYREON__COMPONENT = name\n\nexport default Component\n"],"mappings":";;;;;;AAAA,MAAa,WAAW;;;;ACOxB,MAAa,iBAA2B,OAAO,KAAkB,KAAK,QAAQ;;;;;;;;;;;ACK9E,MAAM,EAAE,kBAAQ,YAAK,2BAAc;AAEnC,MAAM,eAAe;;;AAIrB,MAAM,iBAAiB;;;AAOvB,MAAM,gBAAgB;CACpB,QAAQ;EACN,QAAQ;EACR,OAAO;EACR;CACD,eAAe;EACb,QAAQ;EACR,OAAO;EACR;CACD,MAAM;EACJ,QAAQ;EACR,OAAO;EACR;CACD,aAAa;EACX,QAAQ;EACR,OAAO;EACR;CACF;AAED,MAAM,gBAAgB,EACpB,WACA,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reon/elements",
3
- "version": "0.12.13",
3
+ "version": "0.12.14",
4
4
  "description": "Foundational UI components for Pyreon",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -35,19 +35,25 @@
35
35
  "build:watch": "bun run vl_rolldown_build-watch",
36
36
  "lint": "oxlint .",
37
37
  "test": "vitest run",
38
+ "test:browser": "vitest run --config ./vitest.browser.config.ts",
38
39
  "test:coverage": "vitest run --coverage",
39
40
  "test:watch": "vitest",
40
41
  "typecheck": "tsc --noEmit"
41
42
  },
42
43
  "devDependencies": {
43
- "@pyreon/typescript": "^0.12.13",
44
+ "@pyreon/core": "^0.12.14",
45
+ "@pyreon/reactivity": "^0.12.14",
46
+ "@pyreon/runtime-dom": "^0.12.14",
47
+ "@pyreon/test-utils": "^0.12.10",
48
+ "@pyreon/typescript": "^0.12.14",
49
+ "@vitest/browser-playwright": "^4.1.4",
44
50
  "@vitus-labs/tools-rolldown": "^1.15.3"
45
51
  },
46
52
  "peerDependencies": {
47
- "@pyreon/core": "^0.12.13",
48
- "@pyreon/reactivity": "^0.12.13",
49
- "@pyreon/ui-core": "^0.12.13",
50
- "@pyreon/unistyle": "^0.12.13"
53
+ "@pyreon/core": "^0.12.14",
54
+ "@pyreon/reactivity": "^0.12.14",
55
+ "@pyreon/ui-core": "^0.12.14",
56
+ "@pyreon/unistyle": "^0.12.14"
51
57
  },
52
58
  "engines": {
53
59
  "node": ">= 22"
@@ -5,6 +5,7 @@
5
5
  * is wrapped in an Element that receives all non-iterator props (e.g.,
6
6
  * layout, alignment, css), allowing the list to be styled as a single block.
7
7
  */
8
+ import { splitProps } from '@pyreon/core'
8
9
  import { omit, pick } from '@pyreon/ui-core'
9
10
  import { PKG_NAME } from '../constants'
10
11
  import type { ElementProps, PyreonElement } from '../Element'
@@ -32,17 +33,14 @@ type ListProps = {
32
33
 
33
34
  export type Props = MergeTypes<[IteratorProps, ListProps]> & Partial<Omit<ElementProps, 'children' | 'content' | 'label'>>
34
35
 
35
- const Component: PyreonElement<Props> = (({
36
- rootElement = false,
37
- ref,
38
- ...props
39
- }: Partial<Props & ElementProps>) => {
36
+ const Component: PyreonElement<Props> = ((allProps: Partial<Props & ElementProps>) => {
37
+ const [own, props] = splitProps(allProps, ['rootElement', 'ref'])
40
38
  const renderedList = <Iterator {...pick(props, Iterator.RESERVED_PROPS)} />
41
39
 
42
- if (!rootElement) return renderedList
40
+ if (!own.rootElement) return renderedList
43
41
 
44
42
  return (
45
- <Element {...(ref ? { ref } : {})} {...omit(props, Iterator.RESERVED_PROPS)}>
43
+ <Element {...(own.ref ? { ref: own.ref } : {})} {...omit(props, Iterator.RESERVED_PROPS)}>
46
44
  {renderedList}
47
45
  </Element>
48
46
  )