@valu/block-components 0.1.0 → 0.2.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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../components/matrix/styles/tokens.ts","../../../components/matrix/styles/index.ts","../../../components/matrix/MatrixHeader.tsx","../../../components/matrix/utils.ts","../../../components/matrix/MatrixCell.tsx","../../../components/matrix/MatrixGroupSummary.tsx","../../../components/matrix/MatrixRow.tsx","../../../components/matrix/styles/emotionCache.tsx","../../../components/matrix/hooks/useExpandedGroups.ts","../../../components/matrix/Matrix.tsx"],"names":["css","styled","jsx","jsxs","useCallback","ToggleControl","CheckboxControl","useState","useMemo","createCache","CacheProvider","isExpanded","useId"],"mappings":";;;;;;;;;;;;;;;;;AAOO,IAAM,MAAA,GAAS;AAAA,EACrB,MAAA,EAAQ,sCAAA;AAAA,EACR,WAAA,EACC,6GAAA;AAAA,EAGD,EAAA,EAAI,gDAAA;AAAA,EACJ,OAAA,EAAS,8CAAA;AAAA,EACT,EAAA,EAAI,gDAAA;AAAA,EAEJ,OAAA,EAAS,8CAAA;AAAA,EACT,OAAA,EAAS,8CAAA;AAAA,EACT,OAAA,EAAS,8CAAA;AAAA,EACT,OAAA,EAAS,8CAAA;AAAA,EAET,QAAA,EAAU,KAAA;AAAA,EACV,QAAA,EAAU,KAAA;AAAA,EAEV,YAAA,EAAc,MAAA;AAAA,EAEd,eAAA,EAAiB,oCAAA;AAAA,EACjB,gBAAA,EAAkB,oCAAA;AAAA,EAElB,OAAA,EAAS,KAAA;AAAA,EACT,OAAA,EAAS,KAAA;AAAA,EACT,OAAA,EAAS,MAAA;AAAA,EAGT,cAAA,EAAgB,gBAAA;AAAA,EAEhB,YAAA,EAAc,MAAA;AAAA,EACd,aAAA,EAAe,MAAA;AAAA,EACf,iBAAA,EAAmB,GAAA;AAAA,EACnB,gBAAA,EAAkB,GAAA;AAAA,EAClB,cAAA,EAAgB,GAAA;AAAA;A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AA,QACA,cAAA;AAAA,QACA,iBAAA;AAAA,QACA,gBAAA;AAAA,QACA,OAAA;AAAA,QACA,QAAA;AAAA,QACA,MAAA,EAAQ,cAAA;AAAA,QACR,UAAA;AAAA,QACA,eAAA;AAAA,QACA;AAAA,OAAA;AAAA,MAdK,GAAA,CAAI;AAAA,KAgBV,CAAA,EACF;AAAA,GAAA,EACD,CAAA,EACD,GACD,CAAA,EACD,CAAA;AAEF","file":"index.cjs","sourcesContent":["/**\n * Design tokens — CSS custom-property passthroughs with fallbacks.\n *\n * These mirror the ContentPicker tokens so the Matrix bundle stays\n * self-contained (no cross-component import). They map to the same\n * WordPress admin variables (`--wp-admin-theme-color`, `--wp-components-color-*`).\n */\nexport const tokens = {\n\taccent: 'var(--wp-admin-theme-color, #3858e9)',\n\taccentHover:\n\t\t'color-mix(in srgb, var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9)) 4%, transparent)',\n\taccentActive:\n\t\t'color-mix(in srgb, var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9)) 8%, transparent)',\n\tbg: 'var(--wp-components-color-background, #ffffff)',\n\tbgMuted: 'var(--wp-components-color-gray-100, #f0f0f0)',\n\tfg: 'var(--wp-components-color-foreground, #1e1e1e)',\n\tgray100: 'var(--wp-components-color-gray-100, #f0f0f0)',\n\tgray200: 'var(--wp-components-color-gray-200, #ebebeb)',\n\tgray300: 'var(--wp-components-color-gray-300, #dcdcde)',\n\tgray600: 'var(--wp-components-color-gray-600, #757575)',\n\tgray900: 'var(--wp-components-color-gray-900, #1e1e1e)',\n\n\tradiusSm: '2px',\n\tradiusMd: '4px',\n\n\trowMinHeight: '44px',\n\n\tshadowStickyTop: 'inset 0 -1px 0 rgba(0, 0, 0, 0.08)',\n\tshadowStickyLeft: 'inset -1px 0 0 rgba(0, 0, 0, 0.08)',\n\n\tspaceXs: '4px',\n\tspaceSm: '8px',\n\tspaceMd: '12px',\n\tspaceLg: '16px',\n\n\ttransitionFast: '120ms ease-out',\n\n\tfontSizeBody: '13px',\n\tfontSizeSmall: '11px',\n\tfontWeightRegular: 400,\n\tfontWeightMedium: 500,\n\tfontWeightBold: 600,\n\n\t/** Sticky z-index layering. Row-header > master > top headers > leaf cells. */\n\tzRowHeader: 4,\n\tzMaster: 3,\n\tzHeader: 3,\n\tzCell: 1,\n} as const;\n\nexport type Tokens = typeof tokens;\n","import styled from '@emotion/styled';\nimport { css } from '@emotion/react';\n\nimport { tokens as t } from './tokens';\n\nexport const visuallyHiddenCss = css`\n\tposition: absolute !important;\n\tclip: rect(1px, 1px, 1px, 1px);\n\twidth: 1px;\n\theight: 1px;\n\toverflow: hidden;\n\twhite-space: nowrap;\n`;\n\nexport const Root = styled.div`\n\tcolor: ${t.fg};\n\tfont-size: ${t.fontSizeBody};\n\n\t* {\n\t\tbox-sizing: border-box;\n\t}\n`;\n\n/** Scroll viewport — owns sticky positioning's containing block. */\nexport const Viewport = styled.div<{ $maxHeight: string }>`\n\tposition: relative;\n\toverflow: auto;\n\tmax-height: ${(p) => p.$maxHeight};\n\tborder: 1px solid ${t.gray300};\n\tborder-radius: ${t.radiusMd};\n\tbackground: ${t.bg};\n`;\n\nexport const Table = styled.table`\n\tborder-collapse: separate;\n\tborder-spacing: 0;\n\twidth: 100%;\n\tmin-width: max-content;\n\n\tcaption {\n\t\t${visuallyHiddenCss};\n\t}\n\n\tth,\n\ttd {\n\t\ttext-align: left;\n\t\tpadding: ${t.spaceSm} ${t.spaceMd};\n\t\tborder-bottom: 1px solid ${t.gray200};\n\t\tfont-weight: ${t.fontWeightRegular};\n\t\tvertical-align: middle;\n\t\tbackground: ${t.bg};\n\t}\n\n\ttbody tr:last-of-type th,\n\ttbody tr:last-of-type td {\n\t\tborder-bottom: none;\n\t}\n\n\ttbody tr:hover th,\n\ttbody tr:hover td {\n\t\tbackground: ${t.bgMuted};\n\t}\n`;\n\nexport const HeaderCell = styled.th<{\n\t$sticky?: boolean;\n\t$leftSticky?: boolean;\n\t$leftOffset?: string;\n\t$top?: string;\n\t$z?: number;\n\t$align?: 'left' | 'center';\n}>`\n\tfont-weight: ${t.fontWeightBold};\n\tfont-size: ${t.fontSizeSmall};\n\ttext-transform: uppercase;\n\tletter-spacing: 0.02em;\n\tcolor: ${t.gray900};\n\twhite-space: nowrap;\n\ttext-align: ${(p) => p.$align ?? 'left'};\n\n\t${(p) =>\n\t\tp.$sticky &&\n\t\tcss`\n\t\t\tposition: sticky;\n\t\t\ttop: ${p.$top ?? '0'};\n\t\t\tz-index: ${p.$z ?? t.zHeader};\n\t\t\tbox-shadow: ${t.shadowStickyTop};\n\t\t`};\n\n\t${(p) =>\n\t\tp.$leftSticky &&\n\t\tcss`\n\t\t\tposition: sticky;\n\t\t\tleft: ${p.$leftOffset ?? '0'};\n\t\t\tz-index: ${(p.$z ?? t.zHeader) + 1};\n\t\t\tbox-shadow: ${t.shadowStickyLeft}, ${t.shadowStickyTop};\n\t\t`};\n`;\n\nexport const GroupHeaderButton = styled.button`\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: ${t.spaceXs};\n\tbackground: transparent;\n\tborder: 1px solid transparent;\n\tborder-radius: ${t.radiusSm};\n\tpadding: 2px ${t.spaceXs};\n\tfont: inherit;\n\tcolor: inherit;\n\tcursor: pointer;\n\ttext-transform: inherit;\n\tletter-spacing: inherit;\n\n\t&:hover {\n\t\tbackground: ${t.accentHover};\n\t}\n\n\t&:focus-visible {\n\t\toutline: 2px solid ${t.accent};\n\t\toutline-offset: 1px;\n\t}\n\n\t&[disabled] {\n\t\tcursor: default;\n\t\t&:hover {\n\t\t\tbackground: transparent;\n\t\t}\n\t}\n`;\n\nexport const Caret = styled.span<{ $open: boolean }>`\n\tdisplay: inline-block;\n\twidth: 0;\n\theight: 0;\n\tborder-left: 4px solid transparent;\n\tborder-right: 4px solid transparent;\n\tborder-top: 5px solid currentColor;\n\ttransition: transform ${t.transitionFast};\n\ttransform: ${(p) => (p.$open ? 'rotate(0deg)' : 'rotate(-90deg)')};\n`;\n\nexport const RowHeaderCell = styled.th<{ $leftSticky: boolean }>`\n\tmin-width: 220px;\n\tmax-width: 320px;\n\t${(p) =>\n\t\tp.$leftSticky &&\n\t\tcss`\n\t\t\tposition: sticky;\n\t\t\tleft: 0;\n\t\t\tz-index: ${t.zRowHeader};\n\t\t\tbox-shadow: ${t.shadowStickyLeft};\n\t\t`};\n`;\n\nexport const RowHeaderInner = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: ${t.spaceMd};\n\tmin-height: ${t.rowMinHeight};\n`;\n\nexport const RowHeaderText = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n\tmin-width: 0;\n`;\n\nexport const RowLabel = styled.div`\n\tfont-weight: ${t.fontWeightMedium};\n\tcolor: ${t.gray900};\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n`;\n\nexport const RowSublabel = styled.div`\n\tcolor: ${t.gray600};\n\tfont-size: ${t.fontSizeSmall};\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n`;\n\nexport const RowMeta = styled.div`\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: ${t.spaceXs};\n\tmargin-left: auto;\n`;\n\nexport const MasterCell = styled.td<{ $leftSticky: boolean; $leftOffset: string }>`\n\tmin-width: 96px;\n\ttext-align: center;\n\t${(p) =>\n\t\tp.$leftSticky &&\n\t\tcss`\n\t\t\tposition: sticky;\n\t\t\tleft: ${p.$leftOffset};\n\t\t\tz-index: ${t.zMaster};\n\t\t\tbox-shadow: ${t.shadowStickyLeft};\n\t\t`};\n`;\n\nexport const LeafCell = styled.td`\n\tmin-width: 88px;\n\ttext-align: center;\n\n\t&[data-disabled='true'] {\n\t\topacity: 0.45;\n\t}\n`;\n\nexport const SummaryCell = styled.td`\n\tmin-width: 88px;\n\ttext-align: center;\n\tcolor: ${t.gray600};\n\tfont-variant-numeric: tabular-nums;\n`;\n\nexport const CellControlWrap = styled.div`\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\n\t/* Trim @wordpress/components default vertical margins inside table cells. */\n\t.components-checkbox-control,\n\t.components-toggle-control,\n\t.components-base-control,\n\t.components-base-control__field {\n\t\tmargin: 0;\n\t}\n\n\t.components-checkbox-control__input-container {\n\t\tmargin: 0;\n\t}\n`;\n\nexport const Caption = styled.caption`\n\t${visuallyHiddenCss};\n`;\n","import { GroupHeaderButton, Caret, HeaderCell } from './styles';\nimport type {\n\tMatrixColumn,\n\tMatrixColumnGroup,\n\tMatrixLabels,\n\tMatrixMasterColumn,\n} from './types';\n\ninterface MatrixHeaderProps {\n\tgroups: MatrixColumnGroup[];\n\tmaster?: MatrixMasterColumn;\n\tflat: boolean;\n\tstickyHeader: boolean;\n\tstickyFirstColumn: boolean;\n\tmasterLeftOffset: string;\n\texpandedGroups: ReadonlySet<string>;\n\tonToggleGroup: (groupId: string) => void;\n\tlabels: Required<MatrixLabels>;\n\trenderHeader?: (column: MatrixColumn) => React.ReactNode;\n\trowHeaderLabel?: string;\n}\n\nconst isExpanded = (group: MatrixColumnGroup, expanded: ReadonlySet<string>): boolean =>\n\tgroup.collapsible === false ? true : expanded.has(group.id);\n\nexport const MatrixHeader = ({\n\tgroups,\n\tmaster,\n\tflat,\n\tstickyHeader,\n\tstickyFirstColumn,\n\tmasterLeftOffset,\n\texpandedGroups,\n\tonToggleGroup,\n\tlabels,\n\trenderHeader,\n\trowHeaderLabel,\n}: MatrixHeaderProps) => {\n\t// Flat / single-row header.\n\tif (flat) {\n\t\tconst cols = groups[0]?.columns ?? [];\n\t\treturn (\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<HeaderCell\n\t\t\t\t\t\tscope=\"col\"\n\t\t\t\t\t\t$sticky={stickyHeader}\n\t\t\t\t\t\t$leftSticky={stickyFirstColumn}\n\t\t\t\t\t\t$leftOffset=\"0\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{rowHeaderLabel ?? ''}\n\t\t\t\t\t</HeaderCell>\n\t\t\t\t\t{master && (\n\t\t\t\t\t\t<HeaderCell\n\t\t\t\t\t\t\tscope=\"col\"\n\t\t\t\t\t\t\t$sticky={stickyHeader}\n\t\t\t\t\t\t\t$leftSticky={stickyFirstColumn}\n\t\t\t\t\t\t\t$leftOffset={masterLeftOffset}\n\t\t\t\t\t\t\t$align=\"center\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{master.label}\n\t\t\t\t\t\t</HeaderCell>\n\t\t\t\t\t)}\n\t\t\t\t\t{cols.map((col) => (\n\t\t\t\t\t\t<HeaderCell\n\t\t\t\t\t\t\tkey={col.id}\n\t\t\t\t\t\t\tscope=\"col\"\n\t\t\t\t\t\t\t$sticky={stickyHeader}\n\t\t\t\t\t\t\t$align=\"center\"\n\t\t\t\t\t\t\taria-description={col.description}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{renderHeader ? renderHeader(col) : col.label}\n\t\t\t\t\t\t</HeaderCell>\n\t\t\t\t\t))}\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t);\n\t}\n\n\t// Grouped — two header rows.\n\tconst TOP_ROW_HEIGHT = '36px';\n\n\treturn (\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<HeaderCell\n\t\t\t\t\tscope=\"col\"\n\t\t\t\t\trowSpan={2}\n\t\t\t\t\t$sticky={stickyHeader}\n\t\t\t\t\t$leftSticky={stickyFirstColumn}\n\t\t\t\t\t$leftOffset=\"0\"\n\t\t\t\t>\n\t\t\t\t\t{rowHeaderLabel ?? ''}\n\t\t\t\t</HeaderCell>\n\t\t\t\t{master && (\n\t\t\t\t\t<HeaderCell\n\t\t\t\t\t\tscope=\"col\"\n\t\t\t\t\t\trowSpan={2}\n\t\t\t\t\t\t$sticky={stickyHeader}\n\t\t\t\t\t\t$leftSticky={stickyFirstColumn}\n\t\t\t\t\t\t$leftOffset={masterLeftOffset}\n\t\t\t\t\t\t$align=\"center\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{master.label}\n\t\t\t\t\t</HeaderCell>\n\t\t\t\t)}\n\t\t\t\t{groups.map((group) => {\n\t\t\t\t\tconst open = isExpanded(group, expandedGroups);\n\t\t\t\t\tconst span = open ? group.columns.length : 1;\n\t\t\t\t\tconst collapsible = group.collapsible !== false;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<HeaderCell\n\t\t\t\t\t\t\tkey={group.id}\n\t\t\t\t\t\t\tscope=\"colgroup\"\n\t\t\t\t\t\t\tcolSpan={span}\n\t\t\t\t\t\t\trowSpan={open ? 1 : 2}\n\t\t\t\t\t\t\t$sticky={stickyHeader}\n\t\t\t\t\t\t\t$align=\"center\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{collapsible ? (\n\t\t\t\t\t\t\t\t<GroupHeaderButton\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\taria-expanded={open}\n\t\t\t\t\t\t\t\t\taria-label={open ? labels.collapseGroup : labels.expandGroup}\n\t\t\t\t\t\t\t\t\tonClick={() => onToggleGroup(group.id)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Caret $open={open} aria-hidden />\n\t\t\t\t\t\t\t\t\t{group.label}\n\t\t\t\t\t\t\t\t</GroupHeaderButton>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<span>{group.label}</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</HeaderCell>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t{groups.map((group) => {\n\t\t\t\t\tconst open = isExpanded(group, expandedGroups);\n\t\t\t\t\tif (!open) return null;\n\t\t\t\t\treturn group.columns.map((col) => (\n\t\t\t\t\t\t<HeaderCell\n\t\t\t\t\t\t\tkey={`${group.id}::${col.id}`}\n\t\t\t\t\t\t\tscope=\"col\"\n\t\t\t\t\t\t\t$sticky={stickyHeader}\n\t\t\t\t\t\t\t$top={TOP_ROW_HEIGHT}\n\t\t\t\t\t\t\t$align=\"center\"\n\t\t\t\t\t\t\taria-description={col.description}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{renderHeader ? renderHeader(col) : col.label}\n\t\t\t\t\t\t</HeaderCell>\n\t\t\t\t\t));\n\t\t\t\t})}\n\t\t\t</tr>\n\t\t</thead>\n\t);\n};\n","import type {\n\tColId,\n\tMatrixColumn,\n\tMatrixColumnGroup,\n\tMatrixLabels,\n\tRowId,\n} from './types';\n\n/** Selection-set key for a single cell. */\nexport const cellKey = (rowId: RowId, colId: ColId): string => `${rowId}::${colId}`;\n\n/**\n * Returns the column ids selected for a single row.\n *\n * @example\n * selectionByRow(value, 'user-42') // ['create', 'edit']\n */\nexport const selectionByRow = (\n\tvalue: ReadonlySet<string>,\n\trowId: RowId,\n): ColId[] => {\n\tconst prefix = `${rowId}::`;\n\tconst out: ColId[] = [];\n\tfor (const key of value) {\n\t\tif (key.startsWith(prefix)) out.push(key.slice(prefix.length));\n\t}\n\treturn out;\n};\n\n/** Toggle a single cell, returning the next Set (always a new instance). */\nexport const toggleCell = (\n\tvalue: ReadonlySet<string>,\n\trowId: RowId,\n\tcolId: ColId,\n\tchecked: boolean,\n): Set<string> => {\n\tconst next = new Set(value);\n\tif (checked) next.add(cellKey(rowId, colId));\n\telse next.delete(cellKey(rowId, colId));\n\treturn next;\n};\n\n/**\n * Normalize the public `columns | groups` choice into a single internal\n * shape. A flat `columns` list becomes one synthetic, non-collapsible group.\n */\nexport const normalizeGroups = (input: {\n\tcolumns?: MatrixColumn[];\n\tgroups?: MatrixColumnGroup[];\n}): { groups: MatrixColumnGroup[]; flat: boolean } => {\n\tif (input.groups) return { groups: input.groups, flat: false };\n\treturn {\n\t\tgroups: [\n\t\t\t{\n\t\t\t\tid: '__flat__',\n\t\t\t\tlabel: '',\n\t\t\t\tcolumns: input.columns ?? [],\n\t\t\t\tcollapsible: false,\n\t\t\t\tdefaultExpanded: true,\n\t\t\t},\n\t\t],\n\t\tflat: true,\n\t};\n};\n\n/**\n * Default labels — used when a key isn't supplied by the consumer. English\n * only; consumers using `@wordpress/i18n` should pass translated strings.\n */\nexport const defaultLabels = (overrides: MatrixLabels = {}): Required<MatrixLabels> => ({\n\texpandGroup: overrides.expandGroup ?? 'Expand group',\n\tcollapseGroup: overrides.collapseGroup ?? 'Collapse group',\n\tgroupSummary: overrides.groupSummary ?? ((selected, total) => `${selected} / ${total}`),\n\tcellToggled:\n\t\toverrides.cellToggled ??\n\t\t((rowLabel, colLabel, checked) =>\n\t\t\tchecked ? `${colLabel} added to ${rowLabel}` : `${colLabel} removed from ${rowLabel}`),\n});\n\n/** Stringify a ReactNode as best we can for `aria-label`. */\nexport const toPlainText = (node: unknown): string => {\n\tif (node === null || node === undefined || node === false || node === true) return '';\n\tif (typeof node === 'string' || typeof node === 'number') return String(node);\n\tif (Array.isArray(node)) return node.map(toPlainText).join(' ');\n\tif (typeof node === 'object' && 'props' in (node as object)) {\n\t\tconst props = (node as { props?: { children?: unknown } }).props;\n\t\tif (props && 'children' in props) return toPlainText(props.children);\n\t}\n\treturn '';\n};\n","import { useCallback } from 'react';\nimport { CheckboxControl, ToggleControl } from '@wordpress/components';\n\nimport { CellControlWrap, LeafCell } from './styles';\nimport { cellKey, toggleCell, toPlainText } from './utils';\nimport type {\n\tCellContext,\n\tMatrixChange,\n\tMatrixColumn,\n\tMatrixRow,\n\tMatrixVariant,\n} from './types';\n\ninterface MatrixCellProps {\n\trow: MatrixRow;\n\tcolumn: MatrixColumn;\n\tvalue: ReadonlySet<string>;\n\tdisabled: boolean;\n\tvariant: MatrixVariant;\n\tonChange: (next: ReadonlySet<string>, change: MatrixChange) => void;\n\trenderCell?: (ctx: CellContext) => React.ReactNode;\n}\n\nexport const MatrixCell = ({\n\trow,\n\tcolumn,\n\tvalue,\n\tdisabled,\n\tvariant,\n\tonChange,\n\trenderCell,\n}: MatrixCellProps) => {\n\tconst key = cellKey(row.id, column.id);\n\tconst checked = value.has(key);\n\n\tconst toggle = useCallback(\n\t\t(nextChecked: boolean) => {\n\t\t\tif (disabled) return;\n\t\t\tconst next = toggleCell(value, row.id, column.id, nextChecked);\n\t\t\tonChange(next, { rowId: row.id, colId: column.id, checked: nextChecked });\n\t\t},\n\t\t[column.id, disabled, onChange, row.id, value],\n\t);\n\n\tconst ariaLabel = `${toPlainText(row.label)} — ${toPlainText(column.label)}`;\n\n\tconst content = renderCell ? (\n\t\trenderCell({ row, column, checked, disabled, toggle, selectionKey: key })\n\t) : variant === 'toggle' ? (\n\t\t<ToggleControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel=\"\"\n\t\t\tchecked={checked}\n\t\t\tdisabled={disabled}\n\t\t\taria-label={ariaLabel}\n\t\t\tonChange={toggle}\n\t\t/>\n\t) : (\n\t\t<CheckboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel=\"\"\n\t\t\tchecked={checked}\n\t\t\tdisabled={disabled}\n\t\t\taria-label={ariaLabel}\n\t\t\tonChange={toggle}\n\t\t/>\n\t);\n\n\treturn (\n\t\t<LeafCell data-disabled={disabled || undefined}>\n\t\t\t<CellControlWrap>{content}</CellControlWrap>\n\t\t</LeafCell>\n\t);\n};\n","import { SummaryCell } from './styles';\nimport type { GroupSummaryContext, MatrixLabels } from './types';\n\ninterface MatrixGroupSummaryProps {\n\tctx: GroupSummaryContext;\n\tlabels: Required<MatrixLabels>;\n\trender?: (ctx: GroupSummaryContext) => React.ReactNode;\n}\n\nexport const MatrixGroupSummary = ({ ctx, labels, render }: MatrixGroupSummaryProps) => {\n\tif (render) return <SummaryCell>{render(ctx)}</SummaryCell>;\n\treturn <SummaryCell>{labels.groupSummary(ctx.selectedCount, ctx.totalCount)}</SummaryCell>;\n};\n","import { useCallback } from 'react';\nimport { ToggleControl } from '@wordpress/components';\n\nimport { MatrixCell } from './MatrixCell';\nimport { MatrixGroupSummary } from './MatrixGroupSummary';\nimport {\n\tCellControlWrap,\n\tMasterCell,\n\tRowHeaderCell,\n\tRowHeaderInner,\n\tRowLabel,\n\tRowMeta,\n\tRowSublabel,\n\tRowHeaderText,\n} from './styles';\nimport { cellKey, toggleCell, toPlainText } from './utils';\nimport type {\n\tCellContext,\n\tGroupSummaryContext,\n\tMatrixChange,\n\tMatrixColumn,\n\tMatrixColumnGroup,\n\tMatrixLabels,\n\tMatrixMasterColumn,\n\tMatrixRow as MatrixRowType,\n\tMatrixVariant,\n} from './types';\n\ninterface MatrixRowProps {\n\trow: MatrixRowType;\n\tgroups: MatrixColumnGroup[];\n\tmaster?: MatrixMasterColumn;\n\tflat: boolean;\n\tvalue: ReadonlySet<string>;\n\texpandedGroups: ReadonlySet<string>;\n\tstickyFirstColumn: boolean;\n\tmasterLeftOffset: string;\n\tvariant: MatrixVariant;\n\tonChange: (next: ReadonlySet<string>, change: MatrixChange) => void;\n\tlabels: Required<MatrixLabels>;\n\trenderCell?: (ctx: CellContext) => React.ReactNode;\n\trenderRowHeader?: (row: MatrixRowType) => React.ReactNode;\n\trenderGroupSummary?: (ctx: GroupSummaryContext) => React.ReactNode;\n}\n\nconst isGroupExpanded = (group: MatrixColumnGroup, expanded: ReadonlySet<string>): boolean =>\n\tgroup.collapsible === false ? true : expanded.has(group.id);\n\nconst countSelected = (\n\tvalue: ReadonlySet<string>,\n\trowId: string,\n\tcols: MatrixColumn[],\n): number => {\n\tlet n = 0;\n\tfor (const c of cols) if (value.has(cellKey(rowId, c.id))) n += 1;\n\treturn n;\n};\n\nexport const MatrixRowView = ({\n\trow,\n\tgroups,\n\tmaster,\n\tflat,\n\tvalue,\n\texpandedGroups,\n\tstickyFirstColumn,\n\tmasterLeftOffset,\n\tvariant,\n\tonChange,\n\tlabels,\n\trenderCell,\n\trenderRowHeader,\n\trenderGroupSummary,\n}: MatrixRowProps) => {\n\tconst masterChecked = master ? value.has(cellKey(row.id, master.id)) : true;\n\tconst masterDisablesRow = master ? master.disablesRow !== false : false;\n\tconst rowDisabled = master ? masterDisablesRow && !masterChecked : false;\n\n\tconst toggleMaster = useCallback(\n\t\t(checked: boolean) => {\n\t\t\tif (!master) return;\n\t\t\tconst next = toggleCell(value, row.id, master.id, checked);\n\t\t\tonChange(next, { rowId: row.id, colId: master.id, checked });\n\t\t},\n\t\t[master, onChange, row.id, value],\n\t);\n\n\treturn (\n\t\t<tr>\n\t\t\t<RowHeaderCell scope=\"row\" $leftSticky={stickyFirstColumn}>\n\t\t\t\t{renderRowHeader ? (\n\t\t\t\t\trenderRowHeader(row)\n\t\t\t\t) : (\n\t\t\t\t\t<RowHeaderInner>\n\t\t\t\t\t\t{row.avatar}\n\t\t\t\t\t\t<RowHeaderText>\n\t\t\t\t\t\t\t<RowLabel>{row.label}</RowLabel>\n\t\t\t\t\t\t\t{row.sublabel && <RowSublabel>{row.sublabel}</RowSublabel>}\n\t\t\t\t\t\t</RowHeaderText>\n\t\t\t\t\t\t{row.meta && <RowMeta>{row.meta}</RowMeta>}\n\t\t\t\t\t</RowHeaderInner>\n\t\t\t\t)}\n\t\t\t</RowHeaderCell>\n\n\t\t\t{master && (\n\t\t\t\t<MasterCell $leftSticky={stickyFirstColumn} $leftOffset={masterLeftOffset}>\n\t\t\t\t\t<CellControlWrap>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel=\"\"\n\t\t\t\t\t\t\tchecked={masterChecked}\n\t\t\t\t\t\t\taria-label={`${toPlainText(master.label)} — ${toPlainText(row.label)}`}\n\t\t\t\t\t\t\tonChange={toggleMaster}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</CellControlWrap>\n\t\t\t\t</MasterCell>\n\t\t\t)}\n\n\t\t\t{flat\n\t\t\t\t? groups[0]!.columns.map((col) => (\n\t\t\t\t\t\t<MatrixCell\n\t\t\t\t\t\t\tkey={col.id}\n\t\t\t\t\t\t\trow={row}\n\t\t\t\t\t\t\tcolumn={col}\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\tdisabled={rowDisabled}\n\t\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\trenderCell={renderCell}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))\n\t\t\t\t: groups.flatMap((group) => {\n\t\t\t\t\t\tconst open = isGroupExpanded(group, expandedGroups);\n\t\t\t\t\t\tif (!open) {\n\t\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\t\t<MatrixGroupSummary\n\t\t\t\t\t\t\t\t\tkey={group.id}\n\t\t\t\t\t\t\t\t\tctx={{\n\t\t\t\t\t\t\t\t\t\trow,\n\t\t\t\t\t\t\t\t\t\tgroup,\n\t\t\t\t\t\t\t\t\t\tselectedCount: countSelected(value, row.id, group.columns),\n\t\t\t\t\t\t\t\t\t\ttotalCount: group.columns.length,\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tlabels={labels}\n\t\t\t\t\t\t\t\t\trender={renderGroupSummary}\n\t\t\t\t\t\t\t\t/>,\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn group.columns.map((col) => (\n\t\t\t\t\t\t\t<MatrixCell\n\t\t\t\t\t\t\t\tkey={`${group.id}::${col.id}`}\n\t\t\t\t\t\t\t\trow={row}\n\t\t\t\t\t\t\t\tcolumn={col}\n\t\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\t\tdisabled={rowDisabled}\n\t\t\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\t\trenderCell={renderCell}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t));\n\t\t\t\t\t})}\n\t\t</tr>\n\t);\n};\n","import { useCallback, useMemo, useState, type ReactNode } from 'react';\nimport { CacheProvider } from '@emotion/react';\nimport createCache from '@emotion/cache';\n\n/**\n * Emotion cache scoped to the Matrix component.\n *\n * Same pattern as ContentPicker — captures the owning document via a\n * callback ref so styles reach the iframe head when the component is rendered\n * inside the WordPress site editor.\n */\nexport const EmotionCacheProvider = ({ children }: { children: ReactNode }) => {\n\tconst [head, setHead] = useState<HTMLElement | null>(null);\n\n\tconst captureDocument = useCallback((node: HTMLDivElement | null) => {\n\t\tif (!node) return;\n\t\tconst owner = node.ownerDocument ?? document;\n\t\tsetHead((prev) => (prev === owner.head ? prev : (owner.head as HTMLElement)));\n\t}, []);\n\n\tconst cache = useMemo(() => {\n\t\tif (!head) return null;\n\t\treturn createCache({ key: 'valu-mx', container: head, prepend: true });\n\t}, [head]);\n\n\tif (!cache) {\n\t\treturn <div ref={captureDocument} style={{ display: 'contents' }} />;\n\t}\n\n\treturn (\n\t\t<CacheProvider value={cache}>\n\t\t\t<div ref={captureDocument} style={{ display: 'contents' }}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</CacheProvider>\n\t);\n};\n","import { useCallback, useState } from 'react';\n\n/**\n * Controlled / uncontrolled expanded-group state.\n *\n * - Pass `expanded` to make it controlled. `onChange` fires on every toggle.\n * - Otherwise pass `defaultExpanded` for the initial state.\n */\nexport interface UseExpandedGroupsOptions {\n\texpanded?: ReadonlySet<string>;\n\tdefaultExpanded?: ReadonlySet<string>;\n\tonChange?: (next: ReadonlySet<string>) => void;\n}\n\nexport interface UseExpandedGroupsResult {\n\texpanded: ReadonlySet<string>;\n\tisExpanded: (groupId: string) => boolean;\n\ttoggle: (groupId: string) => void;\n\texpand: (groupId: string) => void;\n\tcollapse: (groupId: string) => void;\n}\n\nexport const useExpandedGroups = ({\n\texpanded: controlled,\n\tdefaultExpanded,\n\tonChange,\n}: UseExpandedGroupsOptions): UseExpandedGroupsResult => {\n\tconst [uncontrolled, setUncontrolled] = useState<ReadonlySet<string>>(\n\t\t() => defaultExpanded ?? new Set<string>(),\n\t);\n\tconst isControlled = controlled !== undefined;\n\tconst expanded = isControlled ? controlled : uncontrolled;\n\n\tconst apply = useCallback(\n\t\t(next: ReadonlySet<string>) => {\n\t\t\tif (!isControlled) setUncontrolled(next);\n\t\t\tonChange?.(next);\n\t\t},\n\t\t[isControlled, onChange],\n\t);\n\n\tconst isExpanded = useCallback((groupId: string) => expanded.has(groupId), [expanded]);\n\n\tconst toggle = useCallback(\n\t\t(groupId: string) => {\n\t\t\tconst next = new Set(expanded);\n\t\t\tif (next.has(groupId)) next.delete(groupId);\n\t\t\telse next.add(groupId);\n\t\t\tapply(next);\n\t\t},\n\t\t[apply, expanded],\n\t);\n\n\tconst expand = useCallback(\n\t\t(groupId: string) => {\n\t\t\tif (expanded.has(groupId)) return;\n\t\t\tconst next = new Set(expanded);\n\t\t\tnext.add(groupId);\n\t\t\tapply(next);\n\t\t},\n\t\t[apply, expanded],\n\t);\n\n\tconst collapse = useCallback(\n\t\t(groupId: string) => {\n\t\t\tif (!expanded.has(groupId)) return;\n\t\t\tconst next = new Set(expanded);\n\t\t\tnext.delete(groupId);\n\t\t\tapply(next);\n\t\t},\n\t\t[apply, expanded],\n\t);\n\n\treturn { expanded, isExpanded, toggle, expand, collapse };\n};\n","import { useId, useMemo } from 'react';\n\nimport { MatrixHeader } from './MatrixHeader';\nimport { MatrixRowView } from './MatrixRow';\nimport { EmotionCacheProvider } from './styles/emotionCache';\nimport { Caption, Root, Table, Viewport } from './styles';\nimport { useExpandedGroups } from './hooks/useExpandedGroups';\nimport { defaultLabels, normalizeGroups } from './utils';\nimport type { MatrixProps } from './types';\n\nconst DEFAULT_MAX_HEIGHT = 'calc(100vh - 260px)';\n\n/**\n * `<Matrix />` — abstract row × column grid of selectable cells.\n *\n * Rows × columns × cells. Each cell is identified by `${rowId}::${colId}`,\n * and the selection is a flat `Set<string>`. The component is **controlled**:\n * the consumer owns the value and the expanded-group state (or uses the\n * `defaultExpanded` escape hatch for uncontrolled expansion).\n *\n * Pass either `columns` (flat — single header row, no expand/collapse) or\n * `groups` (two header rows, collapsible). Optional sticky `master` column\n * can gate the row.\n *\n * @example flat\n * <Matrix\n * caption=\"Notification preferences\"\n * rows={users}\n * columns={[{ id: 'email', label: 'Email' }, { id: 'push', label: 'Push' }]}\n * value={selection}\n * onChange={setSelection}\n * />\n *\n * @example grouped with master\n * <Matrix\n * caption=\"User permissions\"\n * rows={users}\n * master={{ id: 'enabled', label: 'Enabled' }}\n * groups={categories}\n * value={selection}\n * onChange={setSelection}\n * />\n */\nexport const Matrix = (props: MatrixProps) => {\n\tconst {\n\t\trows,\n\t\tmaster,\n\t\tvalue,\n\t\tonChange,\n\t\texpanded,\n\t\tdefaultExpanded,\n\t\tonExpandedChange,\n\t\tvariant = 'checkbox',\n\t\trenderCell,\n\t\trenderRowHeader,\n\t\trenderGroupSummary,\n\t\trenderHeader,\n\t\tstickyHeader = true,\n\t\tstickyFirstColumn = true,\n\t\tmaxHeight = DEFAULT_MAX_HEIGHT,\n\t\tcaption,\n\t\tlabels,\n\t\tclassName,\n\t\tid,\n\t} = props;\n\n\tconst reactId = useId();\n\tconst rootId = id ?? `valu-mx-${reactId.replace(/:/g, '')}`;\n\n\tconst { groups, flat } = useMemo(\n\t\t() => normalizeGroups({ columns: props.columns, groups: props.groups }),\n\t\t[props.columns, props.groups],\n\t);\n\n\tconst resolvedLabels = useMemo(() => defaultLabels(labels), [labels]);\n\n\tconst { expanded: expandedGroups, toggle: toggleGroup } = useExpandedGroups({\n\t\texpanded,\n\t\tdefaultExpanded,\n\t\tonChange: onExpandedChange,\n\t});\n\n\tconst maxHeightCss = typeof maxHeight === 'number' ? `${maxHeight}px` : maxHeight;\n\tconst masterLeftOffset = '220px'; // Matches `RowHeaderCell` `min-width`.\n\n\treturn (\n\t\t<EmotionCacheProvider>\n\t\t\t<Root id={rootId} className={className}>\n\t\t\t\t<Viewport $maxHeight={maxHeightCss}>\n\t\t\t\t\t<Table>\n\t\t\t\t\t\t{caption && <Caption>{caption}</Caption>}\n\t\t\t\t\t\t<MatrixHeader\n\t\t\t\t\t\t\tgroups={groups}\n\t\t\t\t\t\t\tmaster={master}\n\t\t\t\t\t\t\tflat={flat}\n\t\t\t\t\t\t\tstickyHeader={stickyHeader}\n\t\t\t\t\t\t\tstickyFirstColumn={stickyFirstColumn}\n\t\t\t\t\t\t\tmasterLeftOffset={masterLeftOffset}\n\t\t\t\t\t\t\texpandedGroups={expandedGroups}\n\t\t\t\t\t\t\tonToggleGroup={toggleGroup}\n\t\t\t\t\t\t\tlabels={resolvedLabels}\n\t\t\t\t\t\t\trenderHeader={renderHeader}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t{rows.map((row) => (\n\t\t\t\t\t\t\t\t<MatrixRowView\n\t\t\t\t\t\t\t\t\tkey={row.id}\n\t\t\t\t\t\t\t\t\trow={row}\n\t\t\t\t\t\t\t\t\tgroups={groups}\n\t\t\t\t\t\t\t\t\tmaster={master}\n\t\t\t\t\t\t\t\t\tflat={flat}\n\t\t\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\t\t\texpandedGroups={expandedGroups}\n\t\t\t\t\t\t\t\t\tstickyFirstColumn={stickyFirstColumn}\n\t\t\t\t\t\t\t\t\tmasterLeftOffset={masterLeftOffset}\n\t\t\t\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\t\t\tlabels={resolvedLabels}\n\t\t\t\t\t\t\t\t\trenderCell={renderCell}\n\t\t\t\t\t\t\t\t\trenderRowHeader={renderRowHeader}\n\t\t\t\t\t\t\t\t\trenderGroupSummary={renderGroupSummary}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</Table>\n\t\t\t\t</Viewport>\n\t\t\t</Root>\n\t\t</EmotionCacheProvider>\n\t);\n};\n"]}
@@ -0,0 +1,195 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ /** Stable id for a row. */
5
+ type RowId = string;
6
+ /** Stable id for a column. */
7
+ type ColId = string;
8
+ /** Default cell control. Anything else uses `renderCell`. */
9
+ type MatrixVariant = 'checkbox' | 'toggle';
10
+ /** A row in the matrix. The `id` must be unique and stable. */
11
+ interface MatrixRow {
12
+ id: RowId;
13
+ /** Primary line in the row header. */
14
+ label: ReactNode;
15
+ /** Secondary line under the label (e.g. an email). */
16
+ sublabel?: ReactNode;
17
+ /** Visual to the left of the label (e.g. an avatar). */
18
+ avatar?: ReactNode;
19
+ /** Trailing chips/tags shown after the labels (roles, tags, …). */
20
+ meta?: ReactNode;
21
+ }
22
+ /** A leaf column. */
23
+ interface MatrixColumn {
24
+ id: ColId;
25
+ label: ReactNode;
26
+ /** Tooltip / `aria-description` text. */
27
+ description?: string;
28
+ }
29
+ /** A column group — collapsible by default. */
30
+ interface MatrixColumnGroup {
31
+ id: string;
32
+ label: ReactNode;
33
+ columns: MatrixColumn[];
34
+ /** Whether the user can expand/collapse this group. @default true */
35
+ collapsible?: boolean;
36
+ /** Initial expanded state when uncontrolled. @default false */
37
+ defaultExpanded?: boolean;
38
+ }
39
+ /**
40
+ * Optional sticky "master" column that gates the row.
41
+ *
42
+ * The master cell uses the same value Set as every other cell — its presence
43
+ * is checked at `${rowId}::${master.id}`. When `disablesRow` is true and the
44
+ * master cell is unchecked, every leaf cell in that row renders disabled.
45
+ */
46
+ interface MatrixMasterColumn {
47
+ id: ColId;
48
+ label: ReactNode;
49
+ /** Disable every leaf cell in the row when this cell is unchecked. @default true */
50
+ disablesRow?: boolean;
51
+ }
52
+ /** Context passed to a custom cell renderer. */
53
+ interface CellContext {
54
+ row: MatrixRow;
55
+ column: MatrixColumn;
56
+ /** Is this cell currently selected (i.e. `${row.id}::${column.id}` is in `value`). */
57
+ checked: boolean;
58
+ /** Disabled because the master cell is off (only when `master.disablesRow`). */
59
+ disabled: boolean;
60
+ /** Toggle the cell. Calls the same `onChange` flow as the default control. */
61
+ toggle: (checked: boolean) => void;
62
+ /** Stable selection-set key for this cell (`row::col`). */
63
+ selectionKey: string;
64
+ }
65
+ /** Context passed to a collapsed-group summary cell renderer. */
66
+ interface GroupSummaryContext {
67
+ row: MatrixRow;
68
+ group: MatrixColumnGroup;
69
+ /** How many of the group's columns are currently selected for this row. */
70
+ selectedCount: number;
71
+ /** Total leaf columns in the group. */
72
+ totalCount: number;
73
+ }
74
+ /** Information about a single value change, paired with the next Set. */
75
+ interface MatrixChange {
76
+ rowId: RowId;
77
+ colId: ColId;
78
+ checked: boolean;
79
+ }
80
+ /** i18n bag — every key has a sensible English default. */
81
+ interface MatrixLabels {
82
+ expandGroup?: string;
83
+ collapseGroup?: string;
84
+ /** Format the collapsed-group summary, e.g. `2 / 5`. */
85
+ groupSummary?: (selected: number, total: number) => string;
86
+ /** Screen-reader-only announcement on cell change. */
87
+ cellToggled?: (rowLabel: string, colLabel: string, checked: boolean) => string;
88
+ }
89
+ /** Props that don't depend on the columns/groups choice. */
90
+ interface MatrixBaseProps {
91
+ /** Rows top-to-bottom. */
92
+ rows: MatrixRow[];
93
+ /** Optional sticky gate column. Same value Set as everything else. */
94
+ master?: MatrixMasterColumn;
95
+ /** Controlled selection. Each entry is `${rowId}::${colId}`. */
96
+ value: ReadonlySet<string>;
97
+ /** Called with the next Set and the specific change that caused it. */
98
+ onChange: (next: ReadonlySet<string>, change: MatrixChange) => void;
99
+ /** Controlled expanded-group state (group ids). */
100
+ expanded?: ReadonlySet<string>;
101
+ /** Uncontrolled initial expanded-group state. */
102
+ defaultExpanded?: ReadonlySet<string>;
103
+ /** Fires when the user expands or collapses a group. */
104
+ onExpandedChange?: (next: ReadonlySet<string>) => void;
105
+ /** Default control rendered in each leaf cell. @default 'checkbox' */
106
+ variant?: MatrixVariant;
107
+ /** Custom cell renderer (overrides `variant`). */
108
+ renderCell?: (ctx: CellContext) => ReactNode;
109
+ /** Custom row-header renderer. */
110
+ renderRowHeader?: (row: MatrixRow) => ReactNode;
111
+ /** Custom collapsed-group summary cell renderer. */
112
+ renderGroupSummary?: (ctx: GroupSummaryContext) => ReactNode;
113
+ /** Custom leaf-column header renderer. */
114
+ renderHeader?: (column: MatrixColumn) => ReactNode;
115
+ /** Stick the column headers to the top of the scroll viewport. @default true */
116
+ stickyHeader?: boolean;
117
+ /** Stick the row-header column to the left of the scroll viewport. @default true */
118
+ stickyFirstColumn?: boolean;
119
+ /** Caps the scroll viewport. @default 'calc(100vh - 260px)' */
120
+ maxHeight?: number | string;
121
+ /** `<caption>` text — required for accessibility unless `aria-label` is set. */
122
+ caption?: string;
123
+ /** i18n overrides. */
124
+ labels?: MatrixLabels;
125
+ /** Extra class on the root. */
126
+ className?: string;
127
+ /** Explicit id; used as ARIA prefix. */
128
+ id?: string;
129
+ }
130
+ /**
131
+ * Public props.
132
+ *
133
+ * Exactly one of `columns` (flat — single header row, no expand/collapse) or
134
+ * `groups` (two header rows, collapsible) must be provided.
135
+ *
136
+ * @example flat
137
+ * <Matrix rows={rows} columns={[{ id: 'a', label: 'A' }]} value={set} onChange={…} />
138
+ *
139
+ * @example grouped
140
+ * <Matrix rows={rows} groups={[{ id: 'g', label: 'G', columns: […] }]} value={set} onChange={…} />
141
+ */
142
+ type MatrixProps = MatrixBaseProps & ({
143
+ columns: MatrixColumn[];
144
+ groups?: never;
145
+ } | {
146
+ groups: MatrixColumnGroup[];
147
+ columns?: never;
148
+ });
149
+
150
+ /**
151
+ * `<Matrix />` — abstract row × column grid of selectable cells.
152
+ *
153
+ * Rows × columns × cells. Each cell is identified by `${rowId}::${colId}`,
154
+ * and the selection is a flat `Set<string>`. The component is **controlled**:
155
+ * the consumer owns the value and the expanded-group state (or uses the
156
+ * `defaultExpanded` escape hatch for uncontrolled expansion).
157
+ *
158
+ * Pass either `columns` (flat — single header row, no expand/collapse) or
159
+ * `groups` (two header rows, collapsible). Optional sticky `master` column
160
+ * can gate the row.
161
+ *
162
+ * @example flat
163
+ * <Matrix
164
+ * caption="Notification preferences"
165
+ * rows={users}
166
+ * columns={[{ id: 'email', label: 'Email' }, { id: 'push', label: 'Push' }]}
167
+ * value={selection}
168
+ * onChange={setSelection}
169
+ * />
170
+ *
171
+ * @example grouped with master
172
+ * <Matrix
173
+ * caption="User permissions"
174
+ * rows={users}
175
+ * master={{ id: 'enabled', label: 'Enabled' }}
176
+ * groups={categories}
177
+ * value={selection}
178
+ * onChange={setSelection}
179
+ * />
180
+ */
181
+ declare const Matrix: (props: MatrixProps) => react_jsx_runtime.JSX.Element;
182
+
183
+ /** Selection-set key for a single cell. */
184
+ declare const cellKey: (rowId: RowId, colId: ColId) => string;
185
+ /**
186
+ * Returns the column ids selected for a single row.
187
+ *
188
+ * @example
189
+ * selectionByRow(value, 'user-42') // ['create', 'edit']
190
+ */
191
+ declare const selectionByRow: (value: ReadonlySet<string>, rowId: RowId) => ColId[];
192
+ /** Toggle a single cell, returning the next Set (always a new instance). */
193
+ declare const toggleCell: (value: ReadonlySet<string>, rowId: RowId, colId: ColId, checked: boolean) => Set<string>;
194
+
195
+ export { type CellContext, type ColId, type GroupSummaryContext, Matrix, type MatrixChange, type MatrixColumn, type MatrixColumnGroup, type MatrixLabels, type MatrixMasterColumn, type MatrixProps, type MatrixRow, type MatrixVariant, type RowId, cellKey, selectionByRow, toggleCell };
@@ -0,0 +1,195 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ /** Stable id for a row. */
5
+ type RowId = string;
6
+ /** Stable id for a column. */
7
+ type ColId = string;
8
+ /** Default cell control. Anything else uses `renderCell`. */
9
+ type MatrixVariant = 'checkbox' | 'toggle';
10
+ /** A row in the matrix. The `id` must be unique and stable. */
11
+ interface MatrixRow {
12
+ id: RowId;
13
+ /** Primary line in the row header. */
14
+ label: ReactNode;
15
+ /** Secondary line under the label (e.g. an email). */
16
+ sublabel?: ReactNode;
17
+ /** Visual to the left of the label (e.g. an avatar). */
18
+ avatar?: ReactNode;
19
+ /** Trailing chips/tags shown after the labels (roles, tags, …). */
20
+ meta?: ReactNode;
21
+ }
22
+ /** A leaf column. */
23
+ interface MatrixColumn {
24
+ id: ColId;
25
+ label: ReactNode;
26
+ /** Tooltip / `aria-description` text. */
27
+ description?: string;
28
+ }
29
+ /** A column group — collapsible by default. */
30
+ interface MatrixColumnGroup {
31
+ id: string;
32
+ label: ReactNode;
33
+ columns: MatrixColumn[];
34
+ /** Whether the user can expand/collapse this group. @default true */
35
+ collapsible?: boolean;
36
+ /** Initial expanded state when uncontrolled. @default false */
37
+ defaultExpanded?: boolean;
38
+ }
39
+ /**
40
+ * Optional sticky "master" column that gates the row.
41
+ *
42
+ * The master cell uses the same value Set as every other cell — its presence
43
+ * is checked at `${rowId}::${master.id}`. When `disablesRow` is true and the
44
+ * master cell is unchecked, every leaf cell in that row renders disabled.
45
+ */
46
+ interface MatrixMasterColumn {
47
+ id: ColId;
48
+ label: ReactNode;
49
+ /** Disable every leaf cell in the row when this cell is unchecked. @default true */
50
+ disablesRow?: boolean;
51
+ }
52
+ /** Context passed to a custom cell renderer. */
53
+ interface CellContext {
54
+ row: MatrixRow;
55
+ column: MatrixColumn;
56
+ /** Is this cell currently selected (i.e. `${row.id}::${column.id}` is in `value`). */
57
+ checked: boolean;
58
+ /** Disabled because the master cell is off (only when `master.disablesRow`). */
59
+ disabled: boolean;
60
+ /** Toggle the cell. Calls the same `onChange` flow as the default control. */
61
+ toggle: (checked: boolean) => void;
62
+ /** Stable selection-set key for this cell (`row::col`). */
63
+ selectionKey: string;
64
+ }
65
+ /** Context passed to a collapsed-group summary cell renderer. */
66
+ interface GroupSummaryContext {
67
+ row: MatrixRow;
68
+ group: MatrixColumnGroup;
69
+ /** How many of the group's columns are currently selected for this row. */
70
+ selectedCount: number;
71
+ /** Total leaf columns in the group. */
72
+ totalCount: number;
73
+ }
74
+ /** Information about a single value change, paired with the next Set. */
75
+ interface MatrixChange {
76
+ rowId: RowId;
77
+ colId: ColId;
78
+ checked: boolean;
79
+ }
80
+ /** i18n bag — every key has a sensible English default. */
81
+ interface MatrixLabels {
82
+ expandGroup?: string;
83
+ collapseGroup?: string;
84
+ /** Format the collapsed-group summary, e.g. `2 / 5`. */
85
+ groupSummary?: (selected: number, total: number) => string;
86
+ /** Screen-reader-only announcement on cell change. */
87
+ cellToggled?: (rowLabel: string, colLabel: string, checked: boolean) => string;
88
+ }
89
+ /** Props that don't depend on the columns/groups choice. */
90
+ interface MatrixBaseProps {
91
+ /** Rows top-to-bottom. */
92
+ rows: MatrixRow[];
93
+ /** Optional sticky gate column. Same value Set as everything else. */
94
+ master?: MatrixMasterColumn;
95
+ /** Controlled selection. Each entry is `${rowId}::${colId}`. */
96
+ value: ReadonlySet<string>;
97
+ /** Called with the next Set and the specific change that caused it. */
98
+ onChange: (next: ReadonlySet<string>, change: MatrixChange) => void;
99
+ /** Controlled expanded-group state (group ids). */
100
+ expanded?: ReadonlySet<string>;
101
+ /** Uncontrolled initial expanded-group state. */
102
+ defaultExpanded?: ReadonlySet<string>;
103
+ /** Fires when the user expands or collapses a group. */
104
+ onExpandedChange?: (next: ReadonlySet<string>) => void;
105
+ /** Default control rendered in each leaf cell. @default 'checkbox' */
106
+ variant?: MatrixVariant;
107
+ /** Custom cell renderer (overrides `variant`). */
108
+ renderCell?: (ctx: CellContext) => ReactNode;
109
+ /** Custom row-header renderer. */
110
+ renderRowHeader?: (row: MatrixRow) => ReactNode;
111
+ /** Custom collapsed-group summary cell renderer. */
112
+ renderGroupSummary?: (ctx: GroupSummaryContext) => ReactNode;
113
+ /** Custom leaf-column header renderer. */
114
+ renderHeader?: (column: MatrixColumn) => ReactNode;
115
+ /** Stick the column headers to the top of the scroll viewport. @default true */
116
+ stickyHeader?: boolean;
117
+ /** Stick the row-header column to the left of the scroll viewport. @default true */
118
+ stickyFirstColumn?: boolean;
119
+ /** Caps the scroll viewport. @default 'calc(100vh - 260px)' */
120
+ maxHeight?: number | string;
121
+ /** `<caption>` text — required for accessibility unless `aria-label` is set. */
122
+ caption?: string;
123
+ /** i18n overrides. */
124
+ labels?: MatrixLabels;
125
+ /** Extra class on the root. */
126
+ className?: string;
127
+ /** Explicit id; used as ARIA prefix. */
128
+ id?: string;
129
+ }
130
+ /**
131
+ * Public props.
132
+ *
133
+ * Exactly one of `columns` (flat — single header row, no expand/collapse) or
134
+ * `groups` (two header rows, collapsible) must be provided.
135
+ *
136
+ * @example flat
137
+ * <Matrix rows={rows} columns={[{ id: 'a', label: 'A' }]} value={set} onChange={…} />
138
+ *
139
+ * @example grouped
140
+ * <Matrix rows={rows} groups={[{ id: 'g', label: 'G', columns: […] }]} value={set} onChange={…} />
141
+ */
142
+ type MatrixProps = MatrixBaseProps & ({
143
+ columns: MatrixColumn[];
144
+ groups?: never;
145
+ } | {
146
+ groups: MatrixColumnGroup[];
147
+ columns?: never;
148
+ });
149
+
150
+ /**
151
+ * `<Matrix />` — abstract row × column grid of selectable cells.
152
+ *
153
+ * Rows × columns × cells. Each cell is identified by `${rowId}::${colId}`,
154
+ * and the selection is a flat `Set<string>`. The component is **controlled**:
155
+ * the consumer owns the value and the expanded-group state (or uses the
156
+ * `defaultExpanded` escape hatch for uncontrolled expansion).
157
+ *
158
+ * Pass either `columns` (flat — single header row, no expand/collapse) or
159
+ * `groups` (two header rows, collapsible). Optional sticky `master` column
160
+ * can gate the row.
161
+ *
162
+ * @example flat
163
+ * <Matrix
164
+ * caption="Notification preferences"
165
+ * rows={users}
166
+ * columns={[{ id: 'email', label: 'Email' }, { id: 'push', label: 'Push' }]}
167
+ * value={selection}
168
+ * onChange={setSelection}
169
+ * />
170
+ *
171
+ * @example grouped with master
172
+ * <Matrix
173
+ * caption="User permissions"
174
+ * rows={users}
175
+ * master={{ id: 'enabled', label: 'Enabled' }}
176
+ * groups={categories}
177
+ * value={selection}
178
+ * onChange={setSelection}
179
+ * />
180
+ */
181
+ declare const Matrix: (props: MatrixProps) => react_jsx_runtime.JSX.Element;
182
+
183
+ /** Selection-set key for a single cell. */
184
+ declare const cellKey: (rowId: RowId, colId: ColId) => string;
185
+ /**
186
+ * Returns the column ids selected for a single row.
187
+ *
188
+ * @example
189
+ * selectionByRow(value, 'user-42') // ['create', 'edit']
190
+ */
191
+ declare const selectionByRow: (value: ReadonlySet<string>, rowId: RowId) => ColId[];
192
+ /** Toggle a single cell, returning the next Set (always a new instance). */
193
+ declare const toggleCell: (value: ReadonlySet<string>, rowId: RowId, colId: ColId, checked: boolean) => Set<string>;
194
+
195
+ export { type CellContext, type ColId, type GroupSummaryContext, Matrix, type MatrixChange, type MatrixColumn, type MatrixColumnGroup, type MatrixLabels, type MatrixMasterColumn, type MatrixProps, type MatrixRow, type MatrixVariant, type RowId, cellKey, selectionByRow, toggleCell };