@helixui/library 3.6.0 → 3.7.0
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/custom-elements.json +1561 -1356
- package/dist/components/hx-alert/hx-alert.d.ts +18 -0
- package/dist/components/hx-alert/hx-alert.d.ts.map +1 -1
- package/dist/components/hx-badge/index.js +1 -1
- package/dist/components/hx-button/hx-button.d.ts +18 -0
- package/dist/components/hx-button/hx-button.d.ts.map +1 -1
- package/dist/components/hx-button/hx-button.styles.d.ts.map +1 -1
- package/dist/components/hx-button/index.js +1 -1
- package/dist/components/hx-checkbox/hx-checkbox.d.ts +18 -0
- package/dist/components/hx-checkbox/hx-checkbox.d.ts.map +1 -1
- package/dist/components/hx-checkbox/hx-checkbox.styles.d.ts.map +1 -1
- package/dist/components/hx-checkbox/index.js +1 -1
- package/dist/components/hx-date-picker/hx-date-picker.styles.d.ts.map +1 -1
- package/dist/components/hx-date-picker/index.js +1 -1
- package/dist/components/hx-dialog/hx-dialog.d.ts +18 -0
- package/dist/components/hx-dialog/hx-dialog.d.ts.map +1 -1
- package/dist/components/hx-icon-button/hx-icon-button.styles.d.ts.map +1 -1
- package/dist/components/hx-icon-button/index.js +1 -1
- package/dist/components/hx-pagination/hx-pagination.styles.d.ts.map +1 -1
- package/dist/components/hx-pagination/index.js +1 -1
- package/dist/components/hx-radio-group/index.js +1 -1
- package/dist/components/hx-steps/index.js +1 -1
- package/dist/components/hx-text-input/hx-text-input.d.ts +18 -0
- package/dist/components/hx-text-input/hx-text-input.d.ts.map +1 -1
- package/dist/components/hx-toggle-button/hx-toggle-button.styles.d.ts.map +1 -1
- package/dist/components/hx-toggle-button/index.js +1 -1
- package/dist/css/helix-all.css +59 -34
- package/dist/css/helix-core.css +20 -14
- package/dist/css/helix-forms.css +33 -17
- package/dist/css/helix-navigation.css +6 -3
- package/dist/css/helix-tokens.css +5 -4
- package/dist/css/hx-badge.css +5 -5
- package/dist/css/hx-button.css +11 -4
- package/dist/css/hx-checkbox.css +10 -4
- package/dist/css/hx-date-picker.css +5 -2
- package/dist/css/hx-icon-button.css +4 -5
- package/dist/css/hx-pagination.css +6 -3
- package/dist/css/hx-toggle-button.css +18 -11
- package/dist/css/index.css +1 -1
- package/dist/css/manifest.json +18 -9
- package/dist/index.js +9 -9
- package/dist/shared/hx-alert-Bto8-TIi.js.map +1 -1
- package/dist/shared/{hx-badge-JlFtAdxS.js → hx-badge-DFL35nzi.js} +16 -16
- package/dist/shared/hx-badge-DFL35nzi.js.map +1 -0
- package/dist/shared/{hx-button-BOwAEcF1.js → hx-button-rRNmD4fd.js} +12 -5
- package/dist/shared/hx-button-rRNmD4fd.js.map +1 -0
- package/dist/shared/{hx-checkbox-CYd0YV_u.js → hx-checkbox-hPlIw6Lb.js} +25 -19
- package/dist/shared/hx-checkbox-hPlIw6Lb.js.map +1 -0
- package/dist/shared/{hx-date-picker-B49yo4Vm.js → hx-date-picker-DSKDkCy1.js} +6 -3
- package/dist/shared/hx-date-picker-DSKDkCy1.js.map +1 -0
- package/dist/shared/hx-dialog-B4weoj_1.js.map +1 -1
- package/dist/shared/{hx-icon-button-a6OpeQz5.js → hx-icon-button-B2BdVdyK.js} +10 -11
- package/dist/shared/hx-icon-button-B2BdVdyK.js.map +1 -0
- package/dist/shared/{hx-pagination-C7y8GVyU.js → hx-pagination-D726PyTM.js} +7 -4
- package/dist/shared/hx-pagination-D726PyTM.js.map +1 -0
- package/dist/shared/{hx-radio-C7eTj5YI.js → hx-radio-CY4kQfZw.js} +44 -44
- package/dist/shared/{hx-radio-C7eTj5YI.js.map → hx-radio-CY4kQfZw.js.map} +1 -1
- package/dist/shared/{hx-step-R2rjp1fT.js → hx-step-CUzliIK_.js} +3 -3
- package/dist/shared/hx-step-CUzliIK_.js.map +1 -0
- package/dist/shared/hx-text-input-D6FlOZM-.js.map +1 -1
- package/dist/shared/{hx-toggle-button-DwBers3A.js → hx-toggle-button-DSJeFlb0.js} +52 -45
- package/dist/shared/{hx-toggle-button-DwBers3A.js.map → hx-toggle-button-DSJeFlb0.js.map} +1 -1
- package/figma-inventory.json +144 -48
- package/package.json +2 -2
- package/dist/shared/hx-badge-JlFtAdxS.js.map +0 -1
- package/dist/shared/hx-button-BOwAEcF1.js.map +0 -1
- package/dist/shared/hx-checkbox-CYd0YV_u.js.map +0 -1
- package/dist/shared/hx-date-picker-B49yo4Vm.js.map +0 -1
- package/dist/shared/hx-icon-button-a6OpeQz5.js.map +0 -1
- package/dist/shared/hx-pagination-C7y8GVyU.js.map +0 -1
- package/dist/shared/hx-step-R2rjp1fT.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx-pagination-D726PyTM.js","sources":["../../src/components/hx-pagination/hx-pagination.styles.ts","../../src/components/hx-pagination/hx-pagination.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixPaginationStyles = css`\n :host {\n display: block;\n font-family: var(--hx-pagination-font-family, var(--hx-font-family-sans, sans-serif));\n }\n\n .pagination-root {\n display: flex;\n align-items: center;\n gap: var(--hx-space-4, 1rem);\n flex-wrap: wrap;\n }\n\n nav {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .list {\n display: flex;\n align-items: center;\n gap: var(--hx-pagination-gap, var(--hx-space-1, 0.25rem));\n list-style: none;\n margin: 0;\n padding: 0;\n }\n\n .item {\n display: flex;\n }\n\n .button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: var(--hx-pagination-button-size, var(--hx-touch-target-min, 2.75rem));\n min-height: var(--hx-pagination-button-size, var(--hx-touch-target-min, 2.75rem));\n padding: 0 var(--hx-space-2, 0.5rem);\n border: var(--hx-border-width-thin, 1px) solid\n var(--hx-pagination-border-color, var(--hx-color-border-strong, #66787b));\n border-radius: var(--hx-pagination-border-radius, var(--hx-border-radius-md, 0.375rem));\n background: var(--hx-pagination-bg, var(--hx-color-surface-default, #ffffff));\n color: var(--hx-pagination-color, var(--hx-color-text-primary, #0d1825));\n font-size: var(--hx-font-size-sm, 0.875rem);\n font-family: inherit;\n cursor: pointer;\n transition:\n background-color var(--hx-transition-fast, 150ms) ease,\n border-color var(--hx-transition-fast, 150ms) ease,\n color var(--hx-transition-fast, 150ms) ease;\n text-decoration: none;\n white-space: nowrap;\n }\n\n .button:hover:not(:disabled) {\n background: var(--hx-pagination-hover-bg, var(--hx-color-surface-sunken, #ebeee9));\n border-color: var(\n --hx-pagination-hover-border-color,\n var(--hx-color-action-primary-bg, #0f7078)\n );\n }\n\n .button:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(--hx-pagination-focus-ring-color, var(--hx-focus-ring-color, #0f7078));\n outline-offset: var(--hx-focus-ring-offset, 2px);\n }\n\n .button[aria-current='page'] {\n background: var(--hx-pagination-active-bg, var(--hx-color-action-primary-bg, #0f7078));\n border-color: var(\n --hx-pagination-active-border-color,\n var(--hx-pagination-active-bg, var(--hx-color-action-primary-bg, #0f7078))\n );\n color: var(--hx-pagination-active-color, var(--hx-color-text-on-primary, #ffffff));\n font-weight: var(--hx-font-weight-semibold, 600);\n cursor: default;\n pointer-events: none;\n }\n\n .button:disabled {\n opacity: var(--hx-opacity-disabled, 0.5);\n pointer-events: none;\n }\n\n .ellipsis {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: var(--hx-pagination-button-size, var(--hx-touch-target-min, 2.75rem));\n min-height: var(--hx-pagination-button-size, var(--hx-touch-target-min, 2.75rem));\n color: var(--hx-pagination-ellipsis-color, var(--hx-color-text-muted, #4a5362));\n font-size: var(--hx-font-size-sm, 0.875rem);\n user-select: none;\n }\n\n .button[aria-disabled='true'] {\n cursor: default;\n pointer-events: none;\n }\n\n /* Page size selector */\n .page-size-wrapper {\n display: flex;\n align-items: center;\n }\n\n .page-size-label {\n display: flex;\n align-items: center;\n gap: var(--hx-space-2, 0.5rem);\n font-size: var(--hx-font-size-sm, 0.875rem);\n color: var(--hx-pagination-page-size-label-color, var(--hx-color-text-muted, #4a5362));\n white-space: nowrap;\n }\n\n .page-size-select {\n min-height: var(--hx-pagination-button-size, var(--hx-touch-target-min, 2.75rem));\n padding: 0 var(--hx-space-2, 0.5rem);\n border: var(--hx-border-width-thin, 1px) solid\n var(--hx-pagination-border-color, var(--hx-color-border-strong, #66787b));\n border-radius: var(--hx-pagination-border-radius, var(--hx-border-radius-md, 0.375rem));\n background: var(--hx-pagination-bg, var(--hx-color-surface-default, #ffffff));\n color: var(--hx-pagination-color, var(--hx-color-text-primary, #0d1825));\n font-size: var(--hx-font-size-sm, 0.875rem);\n font-family: inherit;\n cursor: pointer;\n }\n\n .page-size-select:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(--hx-pagination-focus-ring-color, var(--hx-focus-ring-color, #0f7078));\n outline-offset: var(--hx-focus-ring-offset, 2px);\n }\n\n /* Visually hidden — used for aria-live status messages */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .button {\n transition: none;\n }\n }\n\n /* Windows High Contrast / forced-colors support */\n @media (forced-colors: active) {\n .button {\n border: 1px solid ButtonText;\n color: ButtonText;\n background: ButtonFace;\n forced-color-adjust: none;\n }\n\n .button:hover:not(:disabled) {\n border-color: Highlight;\n color: Highlight;\n }\n\n .button:focus-visible {\n outline-color: Highlight;\n }\n\n .button[aria-current='page'] {\n background: Highlight;\n border-color: Highlight;\n color: HighlightText;\n }\n\n .button:disabled {\n color: GrayText;\n border-color: GrayText;\n opacity: 1;\n }\n\n .button[aria-disabled='true'] {\n color: GrayText;\n }\n\n .page-size-select {\n border-color: ButtonText;\n color: ButtonText;\n background: ButtonFace;\n forced-color-adjust: none;\n }\n }\n`;\n","import { html, nothing } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { HelixElement } from '../../base/index.js';\nimport { forcedColorsInteractive } from '../../styles/forced-colors.js';\nimport { helixPaginationStyles } from './hx-pagination.styles.js';\n\n/** Detail for the hx-page-change event dispatched by hx-pagination. */\nexport interface HxPageChangeDetail {\n page: number;\n}\n\n/** Detail for the hx-page-size-change event dispatched by hx-pagination. */\nexport interface HxPageSizeChangeDetail {\n pageSize: number;\n}\n\n/**\n * A pagination component for navigating content listings.\n *\n * @summary Page navigation with page numbers, prev/next, and ellipsis.\n *\n * @tag hx-pagination\n *\n * @csspart nav - The wrapping `<nav>` element.\n * @csspart list - The `<ul>` containing pagination items.\n * @csspart item - Each `<li>` item.\n * @csspart button - Each page button or prev/next control.\n * @csspart ellipsis - The ellipsis (`…`) span between page groups.\n * @csspart page-size-wrapper - The wrapper `<div>` around the page-size selector.\n * @csspart page-size-label - The `<label>` element for the page-size selector.\n * @csspart page-size-select - The `<select>` element for page-size.\n *\n * @cssprop [--hx-pagination-gap=0.25rem] - Gap between pagination buttons. Inherits from --hx-spacing-1.\n * @cssprop [--hx-pagination-button-size=2.25rem] - Minimum width and height of each button.\n * @cssprop [--hx-pagination-border-color] - Border color of buttons. Inherits from --hx-color-border (final fallback: #d1d5db).\n * @cssprop [--hx-pagination-border-radius] - Border radius of buttons. Inherits from --hx-border-radius-md (final fallback: 0.375rem).\n * @cssprop [--hx-pagination-bg] - Background color of buttons. Inherits from --hx-color-surface (final fallback: #ffffff).\n * @cssprop [--hx-pagination-color] - Text color of buttons. Inherits from --hx-color-text-primary (final fallback: #111827).\n * @cssprop [--hx-pagination-hover-bg] - Background color of buttons on hover. Inherits from --hx-color-surface-hover (final fallback: #f3f4f6).\n * @cssprop [--hx-pagination-hover-border-color] - Border color of buttons on hover. Inherits from --hx-color-primary (final fallback: #2563eb).\n * @cssprop [--hx-pagination-active-bg] - Background color of the active/current page button. Inherits from --hx-color-primary (final fallback: #2563eb).\n * @cssprop [--hx-pagination-active-color] - Text color of the active/current page button. Inherits from --hx-color-surface (final fallback: #ffffff).\n * @cssprop [--hx-pagination-active-border-color] - Border color of the active/current page button. Defaults to --hx-pagination-active-bg.\n * @cssprop [--hx-pagination-ellipsis-color] - Color of ellipsis characters. Inherits from --hx-color-text-secondary (final fallback: #6b7280).\n * @cssprop [--hx-transition-fast=150ms] - Duration used for hover/focus transitions.\n *\n * @fires {CustomEvent<{ page: number }>} hx-page-change - Fired when the user navigates to a new page.\n * @fires {CustomEvent<{ pageSize: number }>} hx-page-size-change - Fired when the user selects a new page size.\n *\n * @example\n * ```html\n * <hx-pagination total-pages=\"10\" current-page=\"1\"></hx-pagination>\n * ```\n *\n * @example Drupal / Twig integration\n * ```twig\n * {#\n * Drupal's pager uses 0-based page index in the URL (?page=N).\n * This component is 1-based, so add 1 to the Drupal page value.\n * Listen to hx-page-change and update the URL query param:\n * element.addEventListener('hx-page-change', (e) => {\n * const params = new URLSearchParams(location.search);\n * params.set('page', e.detail.page - 1); // convert back to 0-based\n * history.pushState({}, '', '?' + params.toString());\n * });\n * #}\n * <hx-pagination\n * total-pages=\"{{ total_pages }}\"\n * current-page=\"{{ pager.current_page + 1 }}\"\n * label=\"{{ 'Pagination'|t }}\"\n * {{ show_first_last ? 'show-first-last' : '' }}\n * ></hx-pagination>\n * ```\n * @cssprop [--hx-pagination-font-family=var(--hx-font-family-sans)] - CSS custom property.\n * @cssprop [--hx-font-family-sans] - Font family.\n * @cssprop [--hx-space-4] - Spacing token.\n * @cssprop [--hx-space-1] - Spacing token.\n * @cssprop [--hx-touch-target-min] - Minimum touch target size.\n * @cssprop [--hx-space-2] - Spacing token.\n * @cssprop [--hx-border-width-thin] - Width.\n * @cssprop [--hx-color-neutral-300] - Color.\n * @cssprop [--hx-border-radius-md] - CSS custom property.\n * @cssprop [--hx-color-neutral-0] - Color.\n * @cssprop [--hx-color-neutral-900] - Color.\n * @cssprop [--hx-font-size-sm] - Font size.\n * @cssprop [--hx-color-neutral-100] - Color.\n * @cssprop [--hx-color-primary-500] - Color.\n * @cssprop [--hx-focus-ring-width] - Width.\n * @cssprop [--hx-pagination-focus-ring-color=var(--hx-focus-ring-color)] - Color.\n * @cssprop [--hx-focus-ring-color] - Color.\n * @cssprop [--hx-focus-ring-offset] - CSS custom property.\n * @cssprop [--hx-font-weight-semibold] - Font weight.\n * @cssprop [--hx-opacity-disabled] - Opacity.\n * @cssprop [--hx-color-neutral-500] - Color.\n */\n@customElement('hx-pagination')\nexport class HelixPagination extends HelixElement {\n static override styles = [helixPaginationStyles, forcedColorsInteractive];\n\n /**\n * Total number of pages.\n * @attr total-pages\n */\n @property({ type: Number, attribute: 'total-pages', reflect: true })\n totalPages = 1;\n\n /**\n * The currently active page (1-based).\n * @attr current-page\n */\n @property({ type: Number, attribute: 'current-page' })\n currentPage = 1;\n\n /**\n * Number of page buttons shown on each side of the current page.\n * @attr sibling-count\n */\n @property({ type: Number, attribute: 'sibling-count', reflect: true })\n siblingCount = 1;\n\n /**\n * Number of pages always shown at the start and end of the list.\n * @attr boundary-count\n */\n @property({ type: Number, attribute: 'boundary-count', reflect: true })\n boundaryCount = 1;\n\n /**\n * Whether to show First and Last page buttons.\n * @attr show-first-last\n */\n @property({ type: Boolean, attribute: 'show-first-last', reflect: true })\n showFirstLast = false;\n\n /**\n * Accessible label for the `<nav>` element.\n * @attr label\n */\n @property({ type: String, reflect: true })\n label = 'Pagination';\n\n /**\n * The number of items displayed per page. When set, a page-size selector\n * `<select>` is rendered. Set `show-page-size` to display the selector.\n * @attr page-size\n */\n @property({ type: Number, attribute: 'page-size', reflect: true })\n pageSize = 25;\n\n /**\n * Whether to show the page-size selector UI.\n * @attr show-page-size\n */\n @property({ type: Boolean, attribute: 'show-page-size', reflect: true })\n showPageSize = false;\n\n /**\n * Label text for the rows-per-page selector.\n * @attr label-rows-per-page\n */\n @property({ type: String, attribute: 'label-rows-per-page' })\n labelRowsPerPage = 'Rows per page:';\n\n /**\n * Accessible label for the \"First page\" navigation button.\n * @attr first-page-label\n */\n @property({ attribute: 'first-page-label' })\n firstPageLabel = 'First page';\n\n /**\n * Accessible label for the \"Previous page\" navigation button.\n * @attr previous-page-label\n */\n @property({ attribute: 'previous-page-label' })\n previousPageLabel = 'Previous page';\n\n /**\n * Accessible label for the \"Next page\" navigation button.\n * @attr next-page-label\n */\n @property({ attribute: 'next-page-label' })\n nextPageLabel = 'Next page';\n\n /**\n * Accessible label for the \"Last page\" navigation button.\n * @attr last-page-label\n */\n @property({ attribute: 'last-page-label' })\n lastPageLabel = 'Last page';\n\n /**\n * Function to format the page navigation announcement. Override for i18n.\n */\n @property({ attribute: false })\n labelPageMessage: (current: number, total: number) => string = (current, total) =>\n `Page ${current} of ${total}`;\n\n /**\n * Function to format page button aria-labels. Override for i18n.\n */\n @property({ attribute: false })\n labelPageButton: (page: number) => string = (page) => `Page ${page}`;\n\n /** Tracks the roving tabindex target. Null means default to currentPage. */\n /** @internal */\n @state() private _rovingKey: number | string | null = null;\n\n /** Text for the aria-live region, updated on navigation. */\n /** @internal */\n @state() private _liveMessage = '';\n\n /** Memoization cache for _buildPageRange. */\n /** @internal */\n private _pageRangeCache: { key: string; result: Array<number | 'ellipsis'> } | null = null;\n\n // ─── Helpers ───\n\n /** @internal */\n private _buildPageRange(): Array<number | 'ellipsis'> {\n const key = `${this.totalPages}-${this.currentPage}-${this.siblingCount}-${this.boundaryCount}`;\n if (this._pageRangeCache?.key === key) return this._pageRangeCache.result;\n\n const total = Math.max(1, this.totalPages);\n const current = Math.min(Math.max(1, this.currentPage), total);\n const boundary = Math.max(0, this.boundaryCount);\n const sibling = Math.max(0, this.siblingCount);\n\n const startPages = this._range(1, Math.min(boundary, total));\n const endPages = this._range(Math.max(total - boundary + 1, boundary + 1), total);\n\n const siblingStart = Math.max(\n Math.min(current - sibling, total - boundary - sibling * 2 - 1),\n boundary + 2,\n );\n const siblingEnd = Math.min(\n Math.max(current + sibling, boundary + sibling * 2 + 2),\n endPages.length > 0 ? (endPages[0] ?? total) - 2 : total - 1,\n );\n\n const items: Array<number | 'ellipsis'> = [];\n\n for (const p of startPages) items.push(p);\n\n if (siblingStart > boundary + 2) {\n items.push('ellipsis');\n } else if (boundary + 1 < siblingStart) {\n items.push(boundary + 1);\n }\n\n for (const p of this._range(siblingStart, siblingEnd)) items.push(p);\n\n if (siblingEnd < total - boundary - 1) {\n items.push('ellipsis');\n } else if (siblingEnd < total - boundary) {\n items.push(total - boundary);\n }\n\n for (const p of endPages) items.push(p);\n\n this._pageRangeCache = { key, result: items };\n return items;\n }\n\n /** @internal */\n private _range(start: number, end: number): number[] {\n const result: number[] = [];\n for (let i = start; i <= end; i++) result.push(i);\n return result;\n }\n\n /** @internal */\n private _navigate(page: number): void {\n const clamped = Math.min(Math.max(1, page), this.totalPages);\n if (clamped === this.currentPage) return;\n\n this.currentPage = clamped;\n this._rovingKey = null; // reset so focus follows the new current page\n this._liveMessage = this.labelPageMessage(clamped, this.totalPages);\n this.dispatchEvent(\n new CustomEvent<{ page: number }>('hx-page-change', {\n detail: { page: clamped },\n bubbles: true,\n composed: true,\n }),\n );\n\n // PAGINATION-005: restore focus to the new current-page button after render\n void this.updateComplete.then(() => {\n const btn = this.shadowRoot?.querySelector<HTMLButtonElement>(\n `button[data-roving-key=\"${clamped}\"]`,\n );\n btn?.focus();\n });\n }\n\n /** @internal */\n private _handlePageSizeChange(e: Event): void {\n const select = e.target as HTMLSelectElement;\n const newSize = Number(select.value);\n if (newSize === this.pageSize) return;\n\n this.pageSize = newSize;\n this.dispatchEvent(\n new CustomEvent<{ pageSize: number }>('hx-page-size-change', {\n detail: { pageSize: newSize },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n /** @internal */\n private get _effectiveRovingKey(): number | string {\n return this._rovingKey ?? this.currentPage;\n }\n\n /** @internal */\n private _handleFocusin(e: FocusEvent): void {\n const btn = e.target as HTMLElement;\n if (btn.tagName !== 'BUTTON') return;\n const key = btn.dataset['rovingKey'];\n if (key === undefined) return;\n this._rovingKey = isNaN(Number(key)) ? key : Number(key);\n }\n\n /** @internal */\n private _handleKeydown(e: KeyboardEvent): void {\n if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight' && e.key !== 'Home' && e.key !== 'End')\n return;\n e.preventDefault();\n\n const list = this.shadowRoot?.querySelector('.list');\n if (!list) return;\n\n // Collect all non-disabled buttons (disabled prev/next excluded; aria-disabled current page included)\n const buttons = Array.from(list.querySelectorAll<HTMLButtonElement>('button:not([disabled])'));\n const focused = this.shadowRoot?.activeElement as HTMLButtonElement | null;\n const currentIdx = focused ? buttons.indexOf(focused) : 0;\n\n let nextIdx: number;\n if (e.key === 'Home') {\n nextIdx = 0;\n } else if (e.key === 'End') {\n nextIdx = buttons.length - 1;\n } else {\n nextIdx =\n e.key === 'ArrowLeft'\n ? Math.max(0, currentIdx - 1)\n : Math.min(buttons.length - 1, currentIdx + 1);\n }\n\n if (nextIdx !== currentIdx || e.key === 'Home' || e.key === 'End') {\n const nextBtn = buttons[nextIdx];\n if (!nextBtn) return;\n const key = nextBtn.dataset['rovingKey'];\n if (key !== undefined) {\n this._rovingKey = isNaN(Number(key)) ? key : Number(key);\n }\n nextBtn.focus();\n }\n }\n\n // ─── Render ───\n\n override render() {\n const pages = this._buildPageRange();\n const isFirst = this.currentPage <= 1;\n const isLast = this.currentPage >= this.totalPages;\n const rovingKey = this._effectiveRovingKey;\n\n return html`\n <div class=\"pagination-root\">\n ${this.showPageSize\n ? html`\n <div part=\"page-size-wrapper\" class=\"page-size-wrapper\">\n <label part=\"page-size-label\" class=\"page-size-label\">\n ${this.labelRowsPerPage}\n <select\n part=\"page-size-select\"\n class=\"page-size-select\"\n @change=${this._handlePageSizeChange}\n >\n ${[10, 25, 50, 100].map(\n (n) =>\n html`<option value=${n} ?selected=${n === this.pageSize}>${n}</option>`,\n )}\n </select>\n </label>\n </div>\n `\n : nothing}\n\n <nav part=\"nav\" aria-label=${this.label}>\n <span class=\"visually-hidden\" aria-live=\"polite\" aria-atomic=\"true\"\n >${this._liveMessage}</span\n >\n <ul\n part=\"list\"\n class=\"list\"\n role=\"list\"\n @keydown=${this._handleKeydown}\n @focusin=${this._handleFocusin}\n >\n ${this.showFirstLast\n ? html`\n <li part=\"item\" class=\"item\">\n <button\n part=\"button\"\n class=\"button\"\n ?disabled=${isFirst}\n tabindex=${rovingKey === 'first' ? 0 : -1}\n data-roving-key=\"first\"\n aria-label=${this.firstPageLabel}\n @click=${() => this._navigate(1)}\n >\n «\n </button>\n </li>\n `\n : nothing}\n\n <li part=\"item\" class=\"item\">\n <button\n part=\"button\"\n class=\"button\"\n ?disabled=${isFirst}\n tabindex=${rovingKey === 'prev' ? 0 : -1}\n data-roving-key=\"prev\"\n aria-label=${this.previousPageLabel}\n @click=${() => this._navigate(this.currentPage - 1)}\n >\n ‹\n </button>\n </li>\n\n ${repeat(\n pages,\n (page, i) => (page === 'ellipsis' ? `ellipsis-${i}` : `page-${page}`),\n (page) => {\n if (page === 'ellipsis') {\n return html`\n <li part=\"item\" class=\"item\">\n <span part=\"ellipsis\" class=\"ellipsis\" aria-hidden=\"true\">…</span>\n </li>\n `;\n }\n const isCurrent = page === this.currentPage;\n return html`\n <li part=\"item\" class=\"item\">\n <button\n part=\"button\"\n class=${classMap({ button: true })}\n aria-disabled=${isCurrent ? 'true' : nothing}\n tabindex=${rovingKey === page ? 0 : -1}\n data-roving-key=${page}\n aria-current=${isCurrent ? 'page' : nothing}\n aria-label=${this.labelPageButton(page)}\n @click=${() => this._navigate(page)}\n >\n ${page}\n </button>\n </li>\n `;\n },\n )}\n\n <li part=\"item\" class=\"item\">\n <button\n part=\"button\"\n class=\"button\"\n ?disabled=${isLast}\n tabindex=${rovingKey === 'next' ? 0 : -1}\n data-roving-key=\"next\"\n aria-label=${this.nextPageLabel}\n @click=${() => this._navigate(this.currentPage + 1)}\n >\n ›\n </button>\n </li>\n\n ${this.showFirstLast\n ? html`\n <li part=\"item\" class=\"item\">\n <button\n part=\"button\"\n class=\"button\"\n ?disabled=${isLast}\n tabindex=${rovingKey === 'last' ? 0 : -1}\n data-roving-key=\"last\"\n aria-label=${this.lastPageLabel}\n @click=${() => this._navigate(this.totalPages)}\n >\n »\n </button>\n </li>\n `\n : nothing}\n </ul>\n </nav>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-pagination': HelixPagination;\n }\n}\n\n/** Canonical type alias for HelixPagination. Use this when typing hx-pagination element references. */\nexport type HxPagination = HelixPagination;\n"],"names":["helixPaginationStyles","css","HelixPagination","HelixElement","current","total","page","key","_a","boundary","sibling","startPages","endPages","siblingStart","siblingEnd","items","p","start","end","result","i","clamped","btn","e","select","newSize","list","buttons","focused","_b","currentIdx","nextIdx","nextBtn","pages","isFirst","isLast","rovingKey","html","n","nothing","repeat","isCurrent","classMap","forcedColorsInteractive","__decorateClass","property","state","customElement"],"mappings":";;;;;;AAEO,MAAMA,IAAwBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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;AAAA,GACjB7C,CAAA;"}
|
|
@@ -116,18 +116,18 @@ const N = O`
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
`;
|
|
119
|
-
var K = Object.defineProperty, P = Object.getOwnPropertyDescriptor, n = (e, t,
|
|
120
|
-
for (var
|
|
121
|
-
(a = e[o]) && (
|
|
122
|
-
return r &&
|
|
119
|
+
var K = Object.defineProperty, P = Object.getOwnPropertyDescriptor, n = (e, t, s, r) => {
|
|
120
|
+
for (var i = r > 1 ? void 0 : r ? P(t, s) : t, o = e.length - 1, a; o >= 0; o--)
|
|
121
|
+
(a = e[o]) && (i = (r ? a(t, s, i) : a(i)) || i);
|
|
122
|
+
return r && i && K(t, s, i), i;
|
|
123
123
|
};
|
|
124
124
|
const U = z("hx-radio-group");
|
|
125
125
|
function H(e) {
|
|
126
126
|
const t = e.querySelector("slot");
|
|
127
127
|
if (t) {
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
130
|
-
return
|
|
128
|
+
const s = t.assignedNodes({ flatten: !0 });
|
|
129
|
+
if (s.length > 0)
|
|
130
|
+
return s.map((r) => r.textContent ?? "").join("").trim();
|
|
131
131
|
}
|
|
132
132
|
return (e.textContent ?? "").trim();
|
|
133
133
|
}
|
|
@@ -168,9 +168,9 @@ let l = class extends G($) {
|
|
|
168
168
|
);
|
|
169
169
|
return;
|
|
170
170
|
}
|
|
171
|
-
const r = (b = (c = e.target) == null ? void 0 : c.closest) == null ? void 0 : b.call(c, "hx-radio"),
|
|
171
|
+
const r = (b = (c = e.target) == null ? void 0 : c.closest) == null ? void 0 : b.call(c, "hx-radio"), i = r ? t.indexOf(r) : t.findIndex((h) => h.checked);
|
|
172
172
|
let o;
|
|
173
|
-
e.key === "Home" ? o = 0 : e.key === "End" ? o = t.length - 1 : e.key === "ArrowDown" || e.key === "ArrowRight" ? o =
|
|
173
|
+
e.key === "Home" ? o = 0 : e.key === "End" ? o = t.length - 1 : e.key === "ArrowDown" || e.key === "ArrowRight" ? o = i === -1 ? 0 : (i + 1) % t.length : o = i <= 0 ? t.length - 1 : i - 1;
|
|
174
174
|
const a = t[o];
|
|
175
175
|
a && (a.focus(), a.dispatchEvent(
|
|
176
176
|
new CustomEvent("hx-radio-select", {
|
|
@@ -213,8 +213,8 @@ let l = class extends G($) {
|
|
|
213
213
|
* @internal
|
|
214
214
|
*/
|
|
215
215
|
_installHelpSlotTextObserver(e) {
|
|
216
|
-
var
|
|
217
|
-
if ((
|
|
216
|
+
var s;
|
|
217
|
+
if ((s = this._helpSlotTextObserver) == null || s.disconnect(), !e) {
|
|
218
218
|
this._helpSlotTextObserver = null;
|
|
219
219
|
return;
|
|
220
220
|
}
|
|
@@ -235,8 +235,8 @@ let l = class extends G($) {
|
|
|
235
235
|
* @internal
|
|
236
236
|
*/
|
|
237
237
|
_installErrorSlotTextObserver(e) {
|
|
238
|
-
var
|
|
239
|
-
if ((
|
|
238
|
+
var s;
|
|
239
|
+
if ((s = this._errorSlotTextObserver) == null || s.disconnect(), !e) {
|
|
240
240
|
this._errorSlotTextObserver = null;
|
|
241
241
|
return;
|
|
242
242
|
}
|
|
@@ -262,9 +262,9 @@ let l = class extends G($) {
|
|
|
262
262
|
}), this._previousRadios = e);
|
|
263
263
|
}
|
|
264
264
|
disconnectedCallback() {
|
|
265
|
-
var e, t,
|
|
266
|
-
super.disconnectedCallback(), this.removeEventListener("hx-radio-select", this._handleRadioSelect), this.removeEventListener("keydown", this._handleKeydown), (e = this._ariaMirror) == null || e.disconnect(), this._ariaMirror = null, (t = this._childDisabledObserver) == null || t.disconnect(), this._childDisabledObserver = null, (
|
|
267
|
-
this._suppressedChildren.has(
|
|
265
|
+
var e, t, s, r;
|
|
266
|
+
super.disconnectedCallback(), this.removeEventListener("hx-radio-select", this._handleRadioSelect), this.removeEventListener("keydown", this._handleKeydown), (e = this._ariaMirror) == null || e.disconnect(), this._ariaMirror = null, (t = this._childDisabledObserver) == null || t.disconnect(), this._childDisabledObserver = null, (s = this._helpSlotTextObserver) == null || s.disconnect(), this._helpSlotTextObserver = null, (r = this._errorSlotTextObserver) == null || r.disconnect(), this._errorSlotTextObserver = null, this._previousRadios.forEach((i) => {
|
|
267
|
+
this._suppressedChildren.has(i) && (i._groupedSuppress = !1, this._suppressedChildren.delete(i));
|
|
268
268
|
}), this._previousRadios = [];
|
|
269
269
|
}
|
|
270
270
|
updated(e) {
|
|
@@ -284,14 +284,14 @@ let l = class extends G($) {
|
|
|
284
284
|
var E, w, k, C;
|
|
285
285
|
const e = this._internals;
|
|
286
286
|
e.role = "radiogroup", e.ariaRequired = this.required ? "true" : "false", e.ariaInvalid = e.validity.valid ? "false" : "true", e.ariaDisabled = this.disabled ? "true" : "false", e.ariaOrientation = this.orientation === "horizontal" ? "horizontal" : "vertical";
|
|
287
|
-
const t = ((E = this.getAttribute("aria-label")) == null ? void 0 : E.trim()) || "",
|
|
287
|
+
const t = ((E = this.getAttribute("aria-label")) == null ? void 0 : E.trim()) || "", s = (w = this.shadowRoot) == null ? void 0 : w.getElementById(`${this._groupId}-legend`), r = (k = this.shadowRoot) == null ? void 0 : k.getElementById(this._helpTextId), i = (C = this.shadowRoot) == null ? void 0 : C.getElementById(this._errorId), o = this.getAttribute("aria-labelledby");
|
|
288
288
|
o !== this._lastWrittenLabelledBy && (this._consumerLabelledBy = o);
|
|
289
289
|
const a = this.getAttribute("aria-describedby");
|
|
290
290
|
a !== this._lastWrittenDescribedBy && (this._consumerDescribedBy = a);
|
|
291
291
|
const u = this._consumerLabelledBy, p = this._consumerDescribedBy, c = T(this, u), b = c.length > 0;
|
|
292
|
-
t ? e.ariaLabel = t : b ? e.ariaLabel = null : e.ariaLabel = this.label || null, c.length === 0 && !t && this.label &&
|
|
292
|
+
t ? e.ariaLabel = t : b ? e.ariaLabel = null : e.ariaLabel = this.label || null, c.length === 0 && !t && this.label && s && c.push(s);
|
|
293
293
|
const h = T(this, p), v = !!(this.error || this._hasErrorSlot);
|
|
294
|
-
if (r && !v && (this.helpText || this._hasHelpSlot) && h.push(r),
|
|
294
|
+
if (r && !v && (this.helpText || this._hasHelpSlot) && h.push(r), i && v && h.push(i), this._supportsIdrefRefs) {
|
|
295
295
|
const g = e;
|
|
296
296
|
g.ariaLabelledByElements = c.length > 0 ? c : null, g.ariaDescribedByElements = h.length > 0 ? h : null, e.ariaDescription = null;
|
|
297
297
|
} else {
|
|
@@ -299,7 +299,7 @@ let l = class extends G($) {
|
|
|
299
299
|
x ? (I !== x && this.setAttribute("aria-labelledby", x), this._lastWrittenLabelledBy = x) : I !== null && (this.removeAttribute("aria-labelledby"), this._lastWrittenLabelledBy = null);
|
|
300
300
|
const m = [...M].filter(Boolean).join(" ") || "", D = this.getAttribute("aria-describedby");
|
|
301
301
|
m ? (D !== m && this.setAttribute("aria-describedby", m), this._lastWrittenDescribedBy = m) : D !== null && this._lastWrittenDescribedBy !== null && (this.removeAttribute("aria-describedby"), this._lastWrittenDescribedBy = null);
|
|
302
|
-
const F = r && !v && (this.helpText || this._hasHelpSlot) ? H(r) : "", q =
|
|
302
|
+
const F = r && !v && (this.helpText || this._hasHelpSlot) ? H(r) : "", q = i && v ? H(i) : "", W = [F, q].filter(Boolean).join(" ");
|
|
303
303
|
e.ariaDescription = W || null;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
@@ -328,19 +328,19 @@ let l = class extends G($) {
|
|
|
328
328
|
const e = this._getRadios(), t = this._getEnabledRadios();
|
|
329
329
|
e.forEach((r) => {
|
|
330
330
|
r._groupedSuppress = !0, this._suppressedChildren.add(r);
|
|
331
|
-
const
|
|
332
|
-
if (r.checked =
|
|
331
|
+
const i = r.value === this.value && this.value !== "";
|
|
332
|
+
if (r.checked = i, this.disabled)
|
|
333
333
|
this._individualDisabledStates.has(r) || this._individualDisabledStates.set(r, r.disabled), r.disabled = !0;
|
|
334
334
|
else {
|
|
335
335
|
const o = this._individualDisabledStates.get(r);
|
|
336
336
|
o !== void 0 && (r.disabled = o, this._individualDisabledStates.delete(r));
|
|
337
337
|
}
|
|
338
338
|
});
|
|
339
|
-
const
|
|
339
|
+
const s = t.find((r) => r.checked);
|
|
340
340
|
if (e.forEach((r) => {
|
|
341
341
|
r.tabIndex = -1;
|
|
342
|
-
}),
|
|
343
|
-
|
|
342
|
+
}), s)
|
|
343
|
+
s.tabIndex = 0;
|
|
344
344
|
else if (t.length > 0) {
|
|
345
345
|
const r = t[0];
|
|
346
346
|
r && (r.tabIndex = 0);
|
|
@@ -377,17 +377,17 @@ let l = class extends G($) {
|
|
|
377
377
|
* @internal
|
|
378
378
|
*/
|
|
379
379
|
_reconcileChildren() {
|
|
380
|
-
const e = this._previousRadios, t = this._getRadios().filter((
|
|
381
|
-
if (
|
|
382
|
-
const
|
|
383
|
-
this.value && !
|
|
380
|
+
const e = this._previousRadios, t = this._getRadios().filter((i) => i.checked && !i.disabled), s = t.find((i) => i.value !== this.value) ?? t[0];
|
|
381
|
+
if (s && s.value !== this.value && (this.value = s.value), this._syncRadios(), this.disabled) {
|
|
382
|
+
const i = this._getRadios().map((o) => o.value);
|
|
383
|
+
this.value && !i.includes(this.value) && (this.value = ""), this._updateValidity();
|
|
384
384
|
} else {
|
|
385
|
-
const
|
|
385
|
+
const i = this._getRadios().find((a) => a.checked && !a.disabled), o = (i == null ? void 0 : i.value) ?? "";
|
|
386
386
|
o !== this.value && (this.value = o), this._internals.setFormValue(this.value || null), this._updateValidity();
|
|
387
387
|
}
|
|
388
388
|
const r = new Set(this._getRadios());
|
|
389
|
-
e.forEach((
|
|
390
|
-
!r.has(
|
|
389
|
+
e.forEach((i) => {
|
|
390
|
+
!r.has(i) && this._suppressedChildren.has(i) && (i._groupedSuppress = !1, this._suppressedChildren.delete(i));
|
|
391
391
|
}), this._previousRadios = this._getRadios();
|
|
392
392
|
}
|
|
393
393
|
/**
|
|
@@ -398,15 +398,15 @@ let l = class extends G($) {
|
|
|
398
398
|
* @internal
|
|
399
399
|
*/
|
|
400
400
|
_installChildDisabledObservers() {
|
|
401
|
-
var
|
|
402
|
-
(
|
|
401
|
+
var s;
|
|
402
|
+
(s = this._childDisabledObserver) == null || s.disconnect();
|
|
403
403
|
const e = this._getRadios();
|
|
404
404
|
if (e.length === 0) {
|
|
405
405
|
this._childDisabledObserver = null;
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
408
|
const t = new MutationObserver((r) => {
|
|
409
|
-
r.some((
|
|
409
|
+
r.some((i) => i.attributeName === "disabled") && this._reconcileChildren();
|
|
410
410
|
});
|
|
411
411
|
e.forEach((r) => {
|
|
412
412
|
t.observe(r, {
|
|
@@ -446,7 +446,7 @@ let l = class extends G($) {
|
|
|
446
446
|
}
|
|
447
447
|
// ─── Render ───
|
|
448
448
|
render() {
|
|
449
|
-
const e = !!this.error || this._hasErrorSlot, t = !!this.helpText || this._hasHelpSlot,
|
|
449
|
+
const e = !!this.error || this._hasErrorSlot, t = !!this.helpText || this._hasHelpSlot, s = `${this._groupId}-legend`, r = {
|
|
450
450
|
fieldset: !0,
|
|
451
451
|
"fieldset--error": e,
|
|
452
452
|
"fieldset--disabled": this.disabled,
|
|
@@ -460,7 +460,7 @@ let l = class extends G($) {
|
|
|
460
460
|
aria-orientation=${this.orientation === "horizontal" ? "horizontal" : R}
|
|
461
461
|
>
|
|
462
462
|
${this.label ? y`
|
|
463
|
-
<legend part="legend" class="fieldset__legend" id=${
|
|
463
|
+
<legend part="legend" class="fieldset__legend" id=${s}>
|
|
464
464
|
${this.label}
|
|
465
465
|
${this.required ? y`<span class="fieldset__required-marker" aria-hidden="true">*</span>` : R}
|
|
466
466
|
</legend>
|
|
@@ -622,8 +622,8 @@ const J = O`
|
|
|
622
622
|
/* ─── Checked State ─── */
|
|
623
623
|
|
|
624
624
|
.radio--checked .radio__control {
|
|
625
|
-
border-color: var(--hx-radio-checked-border-color, var(--hx-color-primary-
|
|
626
|
-
background-color: var(--hx-radio-checked-bg, var(--hx-color-primary-
|
|
625
|
+
border-color: var(--hx-radio-checked-border-color, var(--hx-color-action-primary-bg, #0f7078));
|
|
626
|
+
background-color: var(--hx-radio-checked-bg, var(--hx-color-action-primary-bg, #0f7078));
|
|
627
627
|
}
|
|
628
628
|
|
|
629
629
|
.radio--checked .radio__dot {
|
|
@@ -709,10 +709,10 @@ const J = O`
|
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
711
|
`;
|
|
712
|
-
var Q = Object.defineProperty, X = Object.getOwnPropertyDescriptor, f = (e, t,
|
|
713
|
-
for (var
|
|
714
|
-
(a = e[o]) && (
|
|
715
|
-
return r &&
|
|
712
|
+
var Q = Object.defineProperty, X = Object.getOwnPropertyDescriptor, f = (e, t, s, r) => {
|
|
713
|
+
for (var i = r > 1 ? void 0 : r ? X(t, s) : t, o = e.length - 1, a; o >= 0; o--)
|
|
714
|
+
(a = e[o]) && (i = (r ? a(t, s, i) : a(i)) || i);
|
|
715
|
+
return r && i && Q(t, s, i), i;
|
|
716
716
|
};
|
|
717
717
|
const Y = z("hx-radio");
|
|
718
718
|
let _ = class extends $ {
|
|
@@ -819,4 +819,4 @@ export {
|
|
|
819
819
|
_ as H,
|
|
820
820
|
l as a
|
|
821
821
|
};
|
|
822
|
-
//# sourceMappingURL=hx-radio-
|
|
822
|
+
//# sourceMappingURL=hx-radio-CY4kQfZw.js.map
|