@trackunit/react-components 7.0.9 → 8.0.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/index.cjs.js +297 -128
- package/index.esm.js +297 -128
- package/migrations/assets/react-router-components/package.json +6 -6
- package/migrations/utils/jsx-utils.js +7 -1
- package/migrations/utils/jsx-utils.js.map +1 -1
- package/migrations/v7-0-0/collapse-native-details.js +593 -0
- package/migrations/v7-0-0/collapse-native-details.js.map +1 -0
- package/migrations.json +5 -0
- package/package.json +6 -6
- package/src/components/Collapse/Collapse.d.ts +76 -8
- package/src/components/Collapse/Collapse.variants.d.ts +121 -87
- package/src/components/Collapse/utils/getInteractiveDescendant/getInteractiveDescendant.d.ts +5 -0
- package/src/components/Collapse/utils/isNativelyActivatable/isNativelyActivatable.d.ts +5 -0
- package/src/components/Tag/Tag.d.ts +9 -1
- package/src/components/buttons/Button/Button.d.ts +1 -1
- package/src/components/buttons/shared/ButtonProps.d.ts +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapse-native-details.js","sourceRoot":"","sources":["../../../../../../libs/react/components/migrations/v7-0-0/collapse-native-details.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAqE;AACrE,2CAA6B;AAC7B,+CAAiC;AACjC,kDAS4B;AAE5B,MAAM,cAAc,GAAG,yBAAyB,CAAC;AACjD,MAAM,YAAY,GAAG,6BAA6B,CAAC;AACnD,MAAM,cAAc,GAAG,UAAU,CAAC;AAClC,MAAM,cAAc,GAAG,6BAA6B,CAAC;AACrD,MAAM,SAAS,GAAG,MAAM,CAAC;AAEzB,mEAAmE;AACnE,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAC3D,MAAM,iBAAiB,GAAG,yBAAyB,CAAC;AACpD,gHAAgH;AAChH,MAAM,4BAA4B,GAAG,6BAA6B,CAAC;AAC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,YAAY;QAAE,eAAM,CAAC,IAAI,CAAC,KAAK,cAAc,KAAK,OAAO,EAAE,CAAC,CAAC;IACzF,IAAA,sBAAU,EAAC,cAAc,EAAE,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;AACjE,CAAC,CAAC;AAXW,QAAA,qBAAqB,yBAWhC;AAEF,kBAAe,6BAAqB,CAAC","sourcesContent":["import { logger, type Tree, visitNotIgnoredFiles } from \"@nx/devkit\";\nimport * as path from \"path\";\nimport * as ts from \"typescript\";\nimport {\n findJsxAttribute,\n findJsxElements,\n getImportedAliases,\n hasSpreadAttribute,\n isWorkspaceSourceFile,\n logSummary,\n parseTsx,\n visitTsxFiles,\n} from \"../utils/jsx-utils\";\n\nconst MIGRATION_NAME = \"collapse-native-details\";\nconst PACKAGE_NAME = \"@trackunit/react-components\";\nconst COMPONENT_NAME = \"Collapse\";\nconst NEW_EVENT_TYPE = \"SyntheticEvent<HTMLElement>\";\nconst LAZY_PROP = \"lazy\";\n\n/** Extensions tried when resolving a relative import to a file. */\nconst MODULE_EXTENSIONS = [\".ts\", \".tsx\", \".jsx\"] as const;\nconst TEST_FILE_PATTERN = /\\.(spec|test)\\.[jt]sx?$/;\n/** Attributes the old header had. Other components have them too, so they only count next to a header query. */\nconst OLD_HEADER_ATTRIBUTE_PATTERN = /aria-expanded|aria-controls/;\n/** A variable assigned on a line, as in `const header = screen.getByRole(…)`: group 1 is its name. */\nconst HEADER_VARIABLE_PATTERN = /(?:const|let|var)\\s+([A-Za-z_][\\w]*)\\s*=/;\n/** Any button query by role, used to count the specs whose header queries can't be identified statically. */\nconst BUTTON_ROLE_QUERY_PATTERN = /ByRole\\(\\s*[\"'`]button[\"'`]/;\n/** A button query with a string or regex `name`, which may span lines: group 1 is the name literal. */\nconst NAMED_BUTTON_QUERY_PATTERN =\n /ByRole\\(\\s*[\"'`]button[\"'`]\\s*,\\s*\\{\\s*name:\\s*(\\/(?:\\\\.|[^/\\\\\\n])+\\/[a-z]*|\"[^\"\\n]*\"|'[^'\\n]*'|`[^`$\\n]*`)/g;\n/** A nameless button query scoped to a test id, e.g. `within(screen.getByTestId(\"x\")).getByRole(\"button\")`: group 1 is the id. */\nconst SCOPED_BUTTON_QUERY_PATTERN =\n /within\\(\\s*(?:screen\\.)?(?:get|query|find)ByTestId\\(\\s*[\"'`]([^\"'`]+)[\"'`]\\s*\\)\\s*\\)\\.(?:get|query|find)(?:All)?ByRole\\(\\s*[\"'`]button[\"'`]\\s*\\)/g;\n/** Elements that are interactive themselves, so nesting them in the `<summary>` header is `nested-interactive`. */\nconst INTERACTIVE_ELEMENTS: ReadonlySet<string> = new Set([\n \"a\",\n \"button\",\n \"input\",\n \"select\",\n \"textarea\",\n \"Button\",\n \"IconButton\",\n \"ToggleGroup\",\n \"Link\",\n \"ExternalLink\",\n \"Checkbox\",\n \"Toggle\",\n \"RadioGroup\",\n \"Select\",\n \"TextField\",\n \"MoreMenu\",\n]);\nconst RELATIVE_IMPORT_PATTERN = /(?:from\\s+|import\\s*\\(\\s*|require\\s*\\(\\s*)[\"'](\\.{1,2}\\/[^\"']+)[\"']/g;\n\ntype Edit = { start: number; end: number; text: string };\n\ntype FunctionLike = ts.ArrowFunction | ts.FunctionExpression | ts.FunctionDeclaration;\n\ntype ReactImports = {\n /** Local names of named imports from \"react\", mapped to the imported name. */\n named: Map<string, string>;\n /** Local names of default and namespace imports of \"react\" (e.g. `React`). */\n namespaces: Set<string>;\n};\n\n/** What the Collapses in one file give test queries to match on. */\ntype CollapseFacts = {\n /** Static `label`s: string literals and the key of a `t(\"key\")` call. */\n labels: Set<string>;\n /** Static `data-testid`s. */\n testIds: Set<string>;\n};\n\ntype RunState = {\n tree: Tree;\n /** Every file that renders a Collapse, by path. */\n collapses: Map<string, CollapseFacts>;\n manualReview: Array<string>;\n};\n\n/** One file being migrated: its parsed source, the edits collected for it and the run's review list. */\ntype FileContext = {\n filePath: string;\n sourceFile: ts.SourceFile;\n edits: Array<Edit>;\n /** Set when a handler is retyped to the bare `SyntheticEvent`, which the file then has to import. */\n needsSyntheticEventImport: boolean;\n manualReview: Array<string>;\n};\n\nconst location = (file: FileContext, node: ts.Node): string =>\n `${file.filePath}:${file.sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1}`;\n\nconst addEdit = (file: FileContext, edit: Edit): void => {\n // The same handler can be reached through several Collapses; record each edit once.\n if (!file.edits.some(existing => existing.start === edit.start && existing.end === edit.end)) {\n file.edits.push(edit);\n }\n};\n\nconst applyEdits = (content: string, edits: ReadonlyArray<Edit>): string =>\n [...edits]\n .sort((a, b) => b.start - a.start)\n .reduce((updated, { start, end, text }) => `${updated.slice(0, start)}${text}${updated.slice(end)}`, content);\n\nconst getReactImports = (sourceFile: ts.SourceFile): ReactImports => {\n const named = new Map<string, string>();\n const namespaces = new Set<string>();\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt) || !ts.isStringLiteral(stmt.moduleSpecifier)) continue;\n if (stmt.moduleSpecifier.text !== \"react\") continue;\n const clause = stmt.importClause;\n if (clause === undefined) continue;\n if (clause.name !== undefined) namespaces.add(clause.name.text);\n const bindings = clause.namedBindings;\n if (bindings === undefined) continue;\n if (ts.isNamespaceImport(bindings)) {\n namespaces.add(bindings.name.text);\n } else {\n for (const element of bindings.elements) {\n named.set(element.name.text, element.propertyName?.text ?? element.name.text);\n }\n }\n }\n return { named, namespaces };\n};\n\ntype LocalDeclaration = ts.VariableDeclaration | ts.FunctionDeclaration;\n\nconst bindsName = (name: ts.BindingName, identifier: string): boolean =>\n ts.isIdentifier(name)\n ? name.text === identifier\n : name.elements.some(element => !ts.isOmittedExpression(element) && bindsName(element.name, identifier));\n\n/** The statements a scope node holds directly, or none when the node isn't a scope with statements. */\nconst statementsOf = (node: ts.Node): ReadonlyArray<ts.Statement> =>\n ts.isBlock(node) ||\n ts.isSourceFile(node) ||\n ts.isModuleBlock(node) ||\n ts.isCaseClause(node) ||\n ts.isDefaultClause(node)\n ? node.statements\n : [];\n\n/**\n * Finds the declaration an identifier refers to, walking out through the scopes that enclose `from`, so two\n * components in one file that each declare `handleToggle` resolve to their own.\n *\n * Returns `null` when the name is a parameter, a destructured binding or an import, or isn't declared in this file.\n */\nconst resolveLocalDeclaration = (from: ts.Node, identifier: string): LocalDeclaration | null => {\n // `from` is inside a source file, and the source file is the outermost scope.\n for (let scope = from.parent; ; scope = scope.parent) {\n if (ts.isFunctionLike(scope) && scope.parameters.some(parameter => bindsName(parameter.name, identifier))) {\n return null;\n }\n for (const statement of statementsOf(scope)) {\n if (ts.isFunctionDeclaration(statement) && statement.name?.text === identifier) return statement;\n if (!ts.isVariableStatement(statement)) continue;\n for (const declaration of statement.declarationList.declarations) {\n if (!bindsName(declaration.name, identifier)) continue;\n return ts.isIdentifier(declaration.name) ? declaration : null;\n }\n }\n if (ts.isSourceFile(scope)) return null;\n }\n};\n\n/** Unwraps parentheses and `useCallback(fn, deps)` to reach the function itself. */\nconst unwrapFunction = (expression: ts.Expression): FunctionLike | null => {\n if (ts.isParenthesizedExpression(expression)) return unwrapFunction(expression.expression);\n if (ts.isArrowFunction(expression) || ts.isFunctionExpression(expression)) return expression;\n if (ts.isCallExpression(expression)) {\n const callee = expression.expression;\n const calleeName = ts.isIdentifier(callee)\n ? callee.text\n : ts.isPropertyAccessExpression(callee)\n ? callee.name.text\n : null;\n const firstArgument = expression.arguments[0];\n if (calleeName === \"useCallback\" && firstArgument !== undefined) return unwrapFunction(firstArgument);\n }\n return null;\n};\n\nconst jsxExpressionOf = (attribute: ts.JsxAttribute): ts.Expression | null => {\n const initializer = attribute.initializer;\n if (initializer === undefined || !ts.isJsxExpression(initializer)) return null;\n return initializer.expression ?? null;\n};\n\n/** Resolves a relative import specifier to a file that exists in the tree. */\nconst resolveRelativeModule = (tree: Tree, fromFile: string, specifier: string): string | null => {\n const base = path.posix.normalize(path.posix.join(path.posix.dirname(fromFile), specifier));\n const candidates = [\n base,\n ...MODULE_EXTENSIONS.map(ext => `${base}${ext}`),\n ...MODULE_EXTENSIONS.map(ext => `${base}/index${ext}`),\n ];\n return candidates.find(candidate => tree.exists(candidate) && tree.isFile(candidate)) ?? null;\n};\n\n/* -------------------------------------------------------------------------- */\n/* onToggle: MouseEvent<HTMLDivElement> -> SyntheticEvent<HTMLElement> */\n/* -------------------------------------------------------------------------- */\n\n/** Returns the replacement text when `type` is React's MouseEvent, or `null` when it isn't. */\nconst syntheticEventReplacement = (type: ts.TypeNode, reactImports: ReactImports): string | null => {\n if (!ts.isTypeReferenceNode(type)) return null;\n const typeName = type.typeName;\n if (ts.isIdentifier(typeName)) {\n return reactImports.named.get(typeName.text) === \"MouseEvent\" ? NEW_EVENT_TYPE : null;\n }\n if (ts.isIdentifier(typeName.left) && reactImports.namespaces.has(typeName.left.text)) {\n return typeName.right.text === \"MouseEvent\" ? `${typeName.left.text}.${NEW_EVENT_TYPE}` : null;\n }\n return null;\n};\n\nconst retypeOnToggle = (file: FileContext, attribute: ts.JsxAttribute, reactImports: ReactImports): void => {\n const expression = jsxExpressionOf(attribute);\n if (expression === null) return;\n const flagForReview = (): void => {\n file.manualReview.push(\n `${location(file, attribute)}: check the onToggle handler's event parameter; its type is now SyntheticEvent<HTMLElement> (was MouseEvent<HTMLDivElement>).`\n );\n };\n\n const declaration = ts.isIdentifier(expression) ? resolveLocalDeclaration(attribute, expression.text) : null;\n const handler = !ts.isIdentifier(expression)\n ? unwrapFunction(expression)\n : declaration === null\n ? null\n : ts.isFunctionDeclaration(declaration)\n ? declaration\n : declaration.initializer !== undefined\n ? unwrapFunction(declaration.initializer)\n : null;\n if (handler === null) {\n flagForReview();\n return;\n }\n\n // The event type is on the handler's first parameter, or on the variable's own function type:\n // `const onToggle: (event: MouseEvent<HTMLDivElement>, expanded: boolean) => void = (event, expanded) => …`.\n const annotation = declaration !== null && ts.isVariableDeclaration(declaration) ? declaration.type : undefined;\n const eventType =\n handler.parameters[0]?.type ??\n (annotation !== undefined && ts.isFunctionTypeNode(annotation) ? annotation.parameters[0]?.type : undefined);\n if (eventType === undefined) {\n // Typed some other way, such as a type alias. Untyped handlers need nothing.\n if (annotation?.getText().includes(\"MouseEvent\") === true) flagForReview();\n return;\n }\n const replacement = syntheticEventReplacement(eventType, reactImports);\n if (replacement === null) {\n // A MouseEvent this migration can't tie to React, such as one behind an alias.\n if (eventType.getText().includes(\"MouseEvent\")) flagForReview();\n return;\n }\n\n addEdit(file, { start: eventType.getStart(), end: eventType.getEnd(), text: replacement });\n if (!replacement.includes(\".\")) file.needsSyntheticEventImport = true;\n};\n\n/** Adds `SyntheticEvent` to the react import and drops `MouseEvent` when nothing else uses it. */\nconst updateReactImport = (content: string, filePath: string): string => {\n const sourceFile = parseTsx(content, filePath);\n const reactImports = getReactImports(sourceFile);\n\n const mouseEventLocal = [...reactImports.named.entries()].find(([, imported]) => imported === \"MouseEvent\")?.[0];\n let mouseEventStillUsed = false;\n if (mouseEventLocal !== undefined) {\n const visit = (node: ts.Node): void => {\n if (mouseEventStillUsed || ts.isImportDeclaration(node)) return;\n if (ts.isIdentifier(node) && node.text === mouseEventLocal) {\n mouseEventStillUsed = true;\n return;\n }\n ts.forEachChild(node, visit);\n };\n visit(sourceFile);\n }\n const hasSyntheticEvent = [...reactImports.named.values()].includes(\"SyntheticEvent\");\n\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt) || !ts.isStringLiteral(stmt.moduleSpecifier)) continue;\n if (stmt.moduleSpecifier.text !== \"react\") continue;\n const bindings = stmt.importClause?.namedBindings;\n if (bindings === undefined || !ts.isNamedImports(bindings)) continue;\n\n const kept = bindings.elements\n .filter(element => mouseEventStillUsed || (element.propertyName?.text ?? element.name.text) !== \"MouseEvent\")\n .map(element => element.getText());\n const isSorted = kept.every((name, index) => index === 0 || (kept[index - 1] ?? \"\").localeCompare(name) <= 0);\n const withSyntheticEvent = hasSyntheticEvent ? kept : [...kept, \"SyntheticEvent\"];\n const merged = isSorted ? [...withSyntheticEvent].sort((a, b) => a.localeCompare(b)) : withSyntheticEvent;\n return `${content.slice(0, bindings.getStart())}{ ${merged.join(\", \")} }${content.slice(bindings.getEnd())}`;\n }\n\n return hasSyntheticEvent ? content : `import { SyntheticEvent } from \"react\";\\n${content}`;\n};\n\nconst containsJsx = (node: ts.Node): boolean =>\n ts.isJsxElement(node) ||\n ts.isJsxSelfClosingElement(node) ||\n ts.isJsxFragment(node) ||\n ts.forEachChild(node, containsJsx) === true;\n\n/** `null`, `undefined`, booleans, strings and numbers render nothing interactive. */\nconst isEmptyOrTextLiteral = (expression: ts.Expression): boolean =>\n ts.isParenthesizedExpression(expression)\n ? isEmptyOrTextLiteral(expression.expression)\n : expression.kind === ts.SyntaxKind.NullKeyword ||\n expression.kind === ts.SyntaxKind.TrueKeyword ||\n expression.kind === ts.SyntaxKind.FalseKeyword ||\n (ts.isIdentifier(expression) && expression.text === \"undefined\") ||\n ts.isStringLiteralLike(expression) ||\n ts.isNumericLiteral(expression);\n\n/**\n * Interactive controls in the addon are `nested-interactive` inside a native `<summary>`.\n * They are logged, not moved: the controls belong in the content, and where they go there is a layout decision.\n */\nconst flagInteractiveAddon = (file: FileContext, attribute: ts.JsxAttribute): void => {\n const expression = jsxExpressionOf(attribute);\n if (expression === null) return;\n const flagOpaque = (): void => {\n const source = expression.getText();\n file.manualReview.push(\n `${location(file, attribute)}: headerAddon is \\`${source.length > 60 ? `${source.slice(0, 57)}...` : source}\\`, which this migration can't look into (it comes from a prop, an import or a call). If it can render interactive controls such as a Button or ToggleGroup, move those into the content (e.g. a toolbar row at the top): the header is now a native <summary>, and controls nested in it are reported by axe as nested-interactive.`\n );\n };\n\n if (isEmptyOrTextLiteral(expression)) return;\n\n const declaration = ts.isIdentifier(expression) ? resolveLocalDeclaration(attribute, expression.text) : null;\n const addonRoot = !ts.isIdentifier(expression)\n ? expression\n : declaration !== null && ts.isVariableDeclaration(declaration)\n ? (declaration.initializer ?? null)\n : null;\n if (addonRoot === null) {\n flagOpaque();\n return;\n }\n\n const found = new Set<string>();\n const visit = (node: ts.Node): void => {\n if (ts.isJsxOpeningElement(node) || ts.isJsxSelfClosingElement(node)) {\n const tagName = node.tagName.getText();\n if (INTERACTIVE_ELEMENTS.has(tagName)) found.add(tagName);\n }\n ts.forEachChild(node, visit);\n };\n visit(addonRoot);\n if (found.size === 0) {\n if (!containsJsx(addonRoot) && !isEmptyOrTextLiteral(addonRoot)) flagOpaque();\n return;\n }\n\n file.manualReview.push(\n `${location(file, attribute)}: headerAddon contains interactive controls (${[...found].join(\", \")}). The header is now a native <summary>, which is interactive itself, so axe reports nested-interactive and screen readers may not announce these controls. Clicks on them still don't toggle the section, but move them into the content (e.g. a toolbar row at the top), and keep only non-interactive items such as status icons or badges in headerAddon.`\n );\n};\n\n/* -------------------------------------------------------------------------- */\n/* animate={false} -> animate={false} lazy */\n/* -------------------------------------------------------------------------- */\n\n/** The `lazy` attribute that keeps the old rendering of this `animate` value, or `null` when it is always true. */\nconst lazyAttributeFor = (animate: ts.JsxAttribute): string | null => {\n // The `animate` shorthand means `animate={true}`.\n if (animate.initializer === undefined) return null;\n const expression = jsxExpressionOf(animate);\n if (expression === null || expression.kind === ts.SyntaxKind.TrueKeyword) return null;\n if (expression.kind === ts.SyntaxKind.FalseKeyword) return LAZY_PROP;\n const text = expression.getText();\n const isSimple = ts.isIdentifier(expression) || ts.isPropertyAccessExpression(expression);\n return `${LAZY_PROP}={!${isSimple ? text : `(${text})`}}`;\n};\n\n/**\n * `animate={false}` used to also mean \"render children only while open\". That is now the separate `lazy` prop,\n * so it is added wherever `animate` is, or can be, false. It goes in alphabetical position when the attributes\n * are sorted, and right after `animate` otherwise.\n */\nconst keepLazyRendering = (\n file: FileContext,\n openingElement: ts.JsxOpeningElement | ts.JsxSelfClosingElement,\n animate: ts.JsxAttribute\n): void => {\n const lazyAttribute = lazyAttributeFor(animate);\n if (lazyAttribute === null) return;\n\n const named: Array<{ attribute: ts.JsxAttribute; name: string }> = [];\n for (const attribute of openingElement.attributes.properties) {\n if (ts.isJsxAttribute(attribute) && ts.isIdentifier(attribute.name)) {\n named.push({ attribute, name: attribute.name.text.toLowerCase() });\n }\n }\n const isSorted =\n named.length === openingElement.attributes.properties.length &&\n named.every(({ name }, index) => index === 0 || (named[index - 1]?.name ?? \"\") <= name);\n const anchor = isSorted ? (named.filter(({ name }) => name < LAZY_PROP).at(-1)?.attribute ?? animate) : animate;\n\n const leadingTrivia = file.sourceFile.text.slice(anchor.getFullStart(), anchor.getStart());\n const separator = /^\\s+$/.test(leadingTrivia) ? leadingTrivia : \" \";\n addEdit(file, { start: anchor.getEnd(), end: anchor.getEnd(), text: `${separator}${lazyAttribute}` });\n};\n\n/* -------------------------------------------------------------------------- */\n/* Manual review: tests that query the old header */\n/* -------------------------------------------------------------------------- */\n\n/** What a test file can render: its Collapse files' static labels and test ids, found through relative imports. */\ntype ReachedCollapses = { files: number; labels: Set<string>; testIds: Set<string> };\n\nconst reachedCollapses = (\n state: RunState,\n dependenciesOf: (filePath: string) => ReadonlyArray<string>,\n testFile: string\n): ReachedCollapses => {\n const reached: ReachedCollapses = { files: 0, labels: new Set(), testIds: new Set() };\n const visited = new Set<string>([testFile]);\n const queue = [testFile];\n for (let next = queue.shift(); next !== undefined; next = queue.shift()) {\n const facts = state.collapses.get(next);\n if (facts !== undefined) {\n reached.files++;\n for (const label of facts.labels) reached.labels.add(label);\n for (const testId of facts.testIds) reached.testIds.add(testId);\n }\n for (const dependency of dependenciesOf(next)) {\n if (visited.has(dependency)) continue;\n visited.add(dependency);\n queue.push(dependency);\n }\n }\n return reached;\n};\n\nconst flagOldHeaderQueries = (state: RunState): void => {\n // Nothing renders a Collapse, so no test can target its header.\n if (state.collapses.size === 0) return;\n\n const testFiles: Array<string> = [];\n visitNotIgnoredFiles(state.tree, \"/\", filePath => {\n if (isWorkspaceSourceFile(filePath) && TEST_FILE_PATTERN.test(filePath)) testFiles.push(filePath);\n });\n\n // The import graph is followed outward from the test files, so only files a test can reach are read.\n const dependencies = new Map<string, ReadonlyArray<string>>();\n const dependenciesOf = (filePath: string): ReadonlyArray<string> => {\n const known = dependencies.get(filePath);\n if (known !== undefined) return known;\n const resolved = new Set<string>();\n for (const match of (state.tree.read(filePath, \"utf-8\") ?? \"\").matchAll(RELATIVE_IMPORT_PATTERN)) {\n const specifier = match[1];\n const target = specifier === undefined ? null : resolveRelativeModule(state.tree, filePath, specifier);\n if (target !== null) resolved.add(target);\n }\n const result = [...resolved];\n dependencies.set(filePath, result);\n return result;\n };\n\n let unidentifiedFiles = 0;\n for (const testFile of testFiles) {\n const reached = reachedCollapses(state, dependenciesOf, testFile);\n if (reached.files === 0) continue;\n const content = state.tree.read(testFile, \"utf-8\") ?? \"\";\n const lines = headerQueryLines(reached, content);\n if (lines.length === 0) {\n if (BUTTON_ROLE_QUERY_PATTERN.test(content) || OLD_HEADER_ATTRIBUTE_PATTERN.test(content)) unidentifiedFiles++;\n continue;\n }\n state.manualReview.push(\n `${testFile} (${lines.length === 1 ? \"line\" : \"lines\"} ${lines.join(\", \")}): these queries target the header of a Collapse, which is now a native <summary> without role=\"button\", aria-expanded or aria-controls (other button queries in the file may too, if their Collapse label isn't static). Query it with getByTestId(\"<data-testid>-header\"), or to keep checking the label, with within(getByTestId(\"<data-testid>-header\")).getByText(label): a bare getByText(label) also matches the same text elsewhere and no longer proves it is the header. Read the state from the open attribute of the \"<data-testid>-details\" element. Content is in the DOM while the section is closed (unless the Collapse is lazy), so finding it doesn't prove the section expanded: assert the open attribute instead.`\n );\n }\n\n if (unidentifiedFiles > 0) {\n state.manualReview.push(\n `${unidentifiedFiles} other test ${unidentifiedFiles === 1 ? \"file renders\" : \"files render\"} a Collapse and ${unidentifiedFiles === 1 ? \"queries\" : \"query\"} buttons by role or ${unidentifiedFiles === 1 ? \"asserts\" : \"assert\"} aria-expanded or aria-controls. Those usually target other elements. Any that targeted a Collapse header, for example by a label rendered from a variable, now fail with 'Unable to find an accessible element with the role \"button\"': fix them as described for the files above.`\n );\n }\n};\n\n/**\n * 1-based line numbers in a test file of queries and assertions that target the old Collapse header.\n *\n * `aria-expanded` and `aria-controls` are also on selects, popovers and menus, so an assertion on them counts only\n * when its line holds a header query or a variable assigned from one.\n */\nconst headerQueryLines = (reached: ReachedCollapses, content: string): Array<number> => {\n const lineOf = (index: number): number => content.slice(0, index).split(\"\\n\").length;\n const lines = new Set<number>();\n\n for (const match of content.matchAll(SCOPED_BUTTON_QUERY_PATTERN)) {\n const testId = match[1];\n if (testId !== undefined && reached.testIds.has(testId)) lines.add(lineOf(match.index));\n }\n for (const match of content.matchAll(NAMED_BUTTON_QUERY_PATTERN)) {\n const name = match[1];\n if (name !== undefined && matchesCollapseLabel(reached.labels, name)) lines.add(lineOf(match.index));\n }\n\n const sourceLines = content.split(\"\\n\");\n const headerVariables = [...lines]\n .map(line => HEADER_VARIABLE_PATTERN.exec(sourceLines[line - 1] ?? \"\")?.[1])\n .filter(name => name !== undefined);\n sourceLines.forEach((line, index) => {\n if (!OLD_HEADER_ATTRIBUTE_PATTERN.test(line)) return;\n const usesHeaderVariable = headerVariables.some(name => new RegExp(`(?<![\\\\w$])${name}(?![\\\\w$])`).test(line));\n if (lines.has(index + 1) || usesHeaderVariable) lines.add(index + 1);\n });\n\n return [...lines].sort((a, b) => a - b);\n};\n\n/** Whether a query's `name` literal (a string or a regex) matches one of the static Collapse labels. */\nconst matchesCollapseLabel = (labels: ReadonlySet<string>, nameLiteral: string): boolean => {\n if (!nameLiteral.startsWith(\"/\")) {\n const name = nameLiteral.slice(1, -1).trim();\n return labels.has(name);\n }\n const lastSlash = nameLiteral.lastIndexOf(\"/\");\n let pattern: RegExp;\n try {\n pattern = new RegExp(nameLiteral.slice(1, lastSlash), nameLiteral.slice(lastSlash + 1).replace(/[gy]/g, \"\"));\n } catch {\n return false;\n }\n return [...labels].some(label => pattern.test(label));\n};\n\n/** The text of a string literal attribute, `{\"text\"}`, or the key of a translation call such as `{t(\"key\")}`. */\nconst staticAttributeText = (attribute: ts.JsxAttribute | null): string | null => {\n if (attribute === null || attribute.initializer === undefined) return null;\n if (ts.isStringLiteral(attribute.initializer)) return attribute.initializer.text;\n const expression = jsxExpressionOf(attribute);\n if (expression === null) return null;\n if (ts.isStringLiteral(expression) || ts.isNoSubstitutionTemplateLiteral(expression)) return expression.text;\n if (ts.isCallExpression(expression)) {\n const [firstArgument] = expression.arguments;\n if (firstArgument !== undefined && ts.isStringLiteral(firstArgument)) return firstArgument.text;\n }\n return null;\n};\n\n/* -------------------------------------------------------------------------- */\n\n/** Migrates the Collapses in one file and returns its new content, or `null` when nothing in it changes. */\nconst migrateCollapseUsages = (state: RunState, filePath: string, content: string): string | null => {\n const sourceFile = parseTsx(content, filePath);\n const aliases = getImportedAliases(sourceFile, PACKAGE_NAME);\n if (aliases === null) return null;\n const collapseAliases = Object.entries(aliases)\n .filter(([, imported]) => imported === COMPONENT_NAME)\n .map(([local]) => local);\n if (collapseAliases.length === 0) return null;\n\n const matches = findJsxElements(sourceFile, collapseAliases);\n if (matches.length === 0) return null;\n\n const file: FileContext = {\n filePath,\n sourceFile,\n edits: [],\n needsSyntheticEventImport: false,\n manualReview: state.manualReview,\n };\n const facts: CollapseFacts = { labels: new Set(), testIds: new Set() };\n state.collapses.set(filePath, facts);\n const reactImports = getReactImports(sourceFile);\n\n for (const { openingElement } of matches) {\n const onToggle = findJsxAttribute(openingElement, \"onToggle\");\n if (onToggle !== null) retypeOnToggle(file, onToggle, reactImports);\n\n const headerAddon = findJsxAttribute(openingElement, \"headerAddon\");\n if (headerAddon !== null) flagInteractiveAddon(file, headerAddon);\n\n if (findJsxAttribute(openingElement, LAZY_PROP) === null) {\n const animate = findJsxAttribute(openingElement, \"animate\");\n if (animate !== null) {\n keepLazyRendering(file, openingElement, animate);\n } else if (hasSpreadAttribute(openingElement)) {\n file.manualReview.push(\n `${location(file, openingElement)}: this Collapse gets props from a spread. If they can include animate={false}, also pass lazy: animate={false} now only turns the animation off, and lazy renders children only while the section is open, as animate={false} used to.`\n );\n }\n }\n\n const label = staticAttributeText(findJsxAttribute(openingElement, \"label\"));\n if (label !== null) facts.labels.add(label);\n const testId = staticAttributeText(findJsxAttribute(openingElement, \"data-testid\"));\n if (testId !== null) facts.testIds.add(testId);\n }\n\n if (file.edits.length === 0) return null;\n const edited = applyEdits(content, file.edits);\n return file.needsSyntheticEventImport ? updateReactImport(edited, filePath) : edited;\n};\n\n/**\n * Migrates consumers to the 7.0.0 `Collapse`, rebuilt on native `<details>`/`<summary>`:\n *\n * - Retypes `onToggle` handlers declared as `(event: MouseEvent<HTMLDivElement>, …)`, inline or in the same file,\n * to `SyntheticEvent<HTMLElement>` and updates the `react` import.\n * - Adds `lazy` next to `animate={false}` (and `lazy={!value}` next to a dynamic `animate={value}`): `animate` now\n * only controls the animation, and `lazy` renders children only while the section is open.\n * - Logs, without changing them:\n * - Collapses that get their props from a spread, which may carry `animate={false}`.\n * - `headerAddon`s that contain interactive controls (e.g. a `Button` or `ToggleGroup`), which would be\n * `nested-interactive` inside the native `<summary>`, and ones it can't look into (a prop, an import or a call).\n * - `onToggle` handlers it can't resolve or whose `MouseEvent` type it can't rewrite.\n * - Test lines that target the old header, which was a `role=\"button\"` with `aria-expanded` and `aria-controls`:\n * nameless button queries scoped to a Collapse's `data-testid`, button queries whose `name` matches a Collapse's\n * static label (a string or a `t(\"key\")` key), and assertions on those two attributes next to such a query.\n * Other button queries and attribute assertions in tests that render a Collapse are counted in a single note,\n * since they usually target other elements.\n *\n * Handlers and addons passed by name are resolved in the scope of the Collapse that uses them.\n */\nexport const collapseNativeDetails = (tree: Tree): void => {\n const state: RunState = { tree, collapses: new Map(), manualReview: [] };\n\n const touched = visitTsxFiles(tree, PACKAGE_NAME, (filePath, content) =>\n migrateCollapseUsages(state, filePath, content)\n );\n\n flagOldHeaderQueries(state);\n\n for (const message of state.manualReview) logger.warn(` ${MIGRATION_NAME}: ${message}`);\n logSummary(MIGRATION_NAME, touched, state.manualReview.length);\n};\n\nexport default collapseNativeDetails;\n"]}
|
package/migrations.json
CHANGED
|
@@ -54,6 +54,11 @@
|
|
|
54
54
|
"version": "4.0.0",
|
|
55
55
|
"description": "Move imports of usePersistedState, useSearchParamSync, useCursorUrlSync, MAX_URL_LENGTH, UrlPersistenceLocation and Breadcrumb from @trackunit/react-components to @trackunit/react-router-components, and add @trackunit/react-router-components to the root package.json. Re-install dependencies afterwards.",
|
|
56
56
|
"implementation": "./migrations/v4-0-0/move-to-router-components"
|
|
57
|
+
},
|
|
58
|
+
"v7-0-0-collapse-native-details": {
|
|
59
|
+
"version": "7.0.0",
|
|
60
|
+
"description": "Collapse is rebuilt on native details/summary: retype onToggle handlers from MouseEvent<HTMLDivElement> to SyntheticEvent<HTMLElement>, add lazy next to animate={false} (animate now only controls the animation; lazy renders children only while open), and log Collapses that get props from a spread, headerAddons that contain interactive controls and tests that query the old role=button header for manual review.",
|
|
61
|
+
"implementation": "./migrations/v7-0-0/collapse-native-details"
|
|
57
62
|
}
|
|
58
63
|
}
|
|
59
64
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"migrations": "./migrations.json",
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
"@floating-ui/react": "^0.26.25",
|
|
15
15
|
"string-ts": "^2.0.0",
|
|
16
16
|
"tailwind-merge": "^3.7.0",
|
|
17
|
-
"@trackunit/ui-design-tokens": "^1.21.
|
|
18
|
-
"@trackunit/css-class-variance-utilities": "^2.6.
|
|
19
|
-
"@trackunit/shared-utils": "^1.22.
|
|
20
|
-
"@trackunit/ui-icons": "^1.20.
|
|
17
|
+
"@trackunit/ui-design-tokens": "^1.21.56",
|
|
18
|
+
"@trackunit/css-class-variance-utilities": "^2.6.59",
|
|
19
|
+
"@trackunit/shared-utils": "^1.22.59",
|
|
20
|
+
"@trackunit/ui-icons": "^1.20.56",
|
|
21
21
|
"es-toolkit": "^1.52.0",
|
|
22
22
|
"@tanstack/react-virtual": "^3.14.13",
|
|
23
23
|
"fflate": "^0.8.3",
|
|
24
24
|
"zod": "^3.25.76",
|
|
25
|
-
"@trackunit/i18n-library-translation": "^2.14.
|
|
25
|
+
"@trackunit/i18n-library-translation": "^2.14.55"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^19.0.0",
|
|
@@ -1,25 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactElement, ReactNode, SyntheticEvent } from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
-
import type { Styleable } from "../../common/Styleable";
|
|
4
3
|
import { Refable } from "../../common/Refable";
|
|
4
|
+
import type { Styleable } from "../../common/Styleable";
|
|
5
5
|
export interface CollapseProps extends CommonProps, Styleable, Refable<HTMLDivElement> {
|
|
6
|
+
/**
|
|
7
|
+
* Id of the content wrapper.
|
|
8
|
+
*/
|
|
6
9
|
id: string;
|
|
7
10
|
/**
|
|
8
11
|
* Visual variant of the collapse component.
|
|
9
12
|
*/
|
|
10
13
|
variant?: "primary" | "secondary";
|
|
11
14
|
/**
|
|
12
|
-
* Expands the collapse component during initialization.
|
|
15
|
+
* Expands the collapse component during initialization. Ignored when `expanded` is set.
|
|
13
16
|
*/
|
|
14
17
|
initialExpanded?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Controls the expanded state. When set, clicking the header (or pressing Enter or Space on it) calls
|
|
20
|
+
* `onToggle` with the requested state but doesn't change the section; update `expanded` to apply it.
|
|
21
|
+
*
|
|
22
|
+
* Controlled mode can't block toggles the browser makes itself: find-in-page opening the section, or a
|
|
23
|
+
* `name` group closing it. Those call `onToggle`, and the section follows the browser until `expanded`
|
|
24
|
+
* changes or the header is clicked. A header click always toggles from what is on screen.
|
|
25
|
+
*/
|
|
26
|
+
expanded?: boolean;
|
|
15
27
|
/**
|
|
16
28
|
* Class name for the header.
|
|
17
29
|
*/
|
|
18
30
|
headerClassName?: string;
|
|
19
31
|
/**
|
|
20
|
-
*
|
|
32
|
+
* Called when the user opens or closes the section, with the new expanded state.
|
|
33
|
+
*
|
|
34
|
+
* In uncontrolled mode the event is the native `toggle` event of the underlying `<details>` element, so it
|
|
35
|
+
* fires asynchronously, after the click (or key press) that caused it. In controlled mode (`expanded` set) a
|
|
36
|
+
* header click calls it synchronously with the click event; toggles the browser makes itself, such as
|
|
37
|
+
* find-in-page, still use the `toggle` event. It is not called for state the component sets itself, such as
|
|
38
|
+
* mounting with `initialExpanded` or a parent updating `expanded`.
|
|
21
39
|
*/
|
|
22
|
-
onToggle?: (event:
|
|
40
|
+
onToggle?: (event: SyntheticEvent<HTMLElement>, expanded: boolean) => void;
|
|
23
41
|
/**
|
|
24
42
|
* Child nodes.
|
|
25
43
|
*/
|
|
@@ -30,18 +48,43 @@ export interface CollapseProps extends CommonProps, Styleable, Refable<HTMLDivEl
|
|
|
30
48
|
label: ReactNode;
|
|
31
49
|
/**
|
|
32
50
|
* An addon to add to the header. This can be used for a status indicator or similar.
|
|
51
|
+
* It is rendered inside the header, which is interactive itself, so keep it non-interactive. Put controls
|
|
52
|
+
* in the content instead, for example in a toolbar row at the top.
|
|
33
53
|
*/
|
|
34
54
|
headerAddon?: ReactNode;
|
|
35
55
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
56
|
+
* Animates opening and closing. With `animate={false}` the section opens and closes instantly.
|
|
57
|
+
* It doesn't change when children are rendered; use `lazy` for that.
|
|
38
58
|
*/
|
|
39
59
|
animate?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Renders children only while the section is open, which improves performance for high volume data and
|
|
62
|
+
* resets the children's state every time the section closes. By default children stay mounted while closed.
|
|
63
|
+
*
|
|
64
|
+
* Content that isn't rendered can't be found with the browser's find-in-page, and because the children
|
|
65
|
+
* unmount as soon as the section closes, it closes without animation.
|
|
66
|
+
*/
|
|
67
|
+
lazy?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Adds padding around the header and content.
|
|
70
|
+
*/
|
|
40
71
|
extraPadding?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Groups Collapses into an exclusive accordion: Collapses that share a `name` close the others when
|
|
74
|
+
* one of them opens. This uses the native `name` attribute of `<details>`.
|
|
75
|
+
*
|
|
76
|
+
* If several Collapses with the same `name` start open, the browser keeps only one of them open, and
|
|
77
|
+
* `onToggle` is called on mount for the ones it closes.
|
|
78
|
+
*/
|
|
79
|
+
name?: string;
|
|
41
80
|
}
|
|
42
81
|
/**
|
|
43
82
|
* The Collapse component is a container for additional information that adds context to various flows. It is used for displaying non-essential information that can be hidden away.
|
|
44
83
|
*
|
|
84
|
+
* It is built on the native `<details>` and `<summary>` elements, so keyboard support, screen reader state and
|
|
85
|
+
* find-in-page come from the browser. Opening and closing animate in CSS; in Firefox closing doesn't animate, and
|
|
86
|
+
* nothing animates when the user prefers reduced motion.
|
|
87
|
+
*
|
|
45
88
|
* ### When to use
|
|
46
89
|
* - To keep content off the screen to shorten pages and reduce scrolling, while it's still only a tap away. Remember that the users might choose not to interact with the component and won't see the information within.
|
|
47
90
|
* - To display additional details that are not essential or necessary in the main flow/page.
|
|
@@ -82,7 +125,32 @@ export interface CollapseProps extends CommonProps, Styleable, Refable<HTMLDivEl
|
|
|
82
125
|
* </Collapse>
|
|
83
126
|
* );
|
|
84
127
|
* ```
|
|
128
|
+
* @example Accordion group where opening one section closes the others
|
|
129
|
+
* ```tsx
|
|
130
|
+
* import { Collapse } from "@trackunit/react-components";
|
|
131
|
+
*
|
|
132
|
+
* const Faq = () => (
|
|
133
|
+
* <>
|
|
134
|
+
* <Collapse id="faq-billing" label="Billing" name="faq">Billing answers</Collapse>
|
|
135
|
+
* <Collapse id="faq-access" label="Access" name="faq">Access answers</Collapse>
|
|
136
|
+
* </>
|
|
137
|
+
* );
|
|
138
|
+
* ```
|
|
139
|
+
* @example Controlled collapse
|
|
140
|
+
* ```tsx
|
|
141
|
+
* import { Collapse } from "@trackunit/react-components";
|
|
142
|
+
* import { useState } from "react";
|
|
143
|
+
*
|
|
144
|
+
* const ControlledSection = () => {
|
|
145
|
+
* const [expanded, setExpanded] = useState(false);
|
|
146
|
+
* return (
|
|
147
|
+
* <Collapse expanded={expanded} id="controlled" label="Details" onToggle={(_e, next) => setExpanded(next)}>
|
|
148
|
+
* Details content
|
|
149
|
+
* </Collapse>
|
|
150
|
+
* );
|
|
151
|
+
* };
|
|
152
|
+
* ```
|
|
85
153
|
* @param {CollapseProps} props - The props for the Collapse component
|
|
86
154
|
* @returns {ReactElement} Collapse component
|
|
87
155
|
*/
|
|
88
|
-
export declare const Collapse: ({ id, variant, initialExpanded, onToggle, label, children, className, headerClassName, headerAddon, "data-testid": dataTestId, animate, extraPadding, style, ref, }: CollapseProps) => ReactElement;
|
|
156
|
+
export declare const Collapse: ({ id, variant, initialExpanded, onToggle, label, children, className, headerClassName, headerAddon, "data-testid": dataTestId, animate, lazy, extraPadding, style, ref, name, expanded, }: CollapseProps) => ReactElement;
|
|
@@ -1,32 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The container doesn't clip its content: the header's focus ring is the browser's own, drawn outside the
|
|
3
|
+
* header like a button's, and clipping would cut it off. The header and the content round their own corners
|
|
4
|
+
* to the container's inner radius instead: `rounded-md` minus the 1px border, taken from the theme's
|
|
5
|
+
* `--radius-md` so it follows the token.
|
|
6
|
+
*/
|
|
1
7
|
export declare const cvaCollapse: import("cva").CVAComponent<Omit<{
|
|
2
8
|
base: string[];
|
|
3
9
|
variants: {
|
|
4
10
|
variant: {
|
|
5
11
|
primary: string[];
|
|
6
|
-
secondary:
|
|
12
|
+
secondary: never[];
|
|
7
13
|
};
|
|
8
14
|
};
|
|
9
15
|
}, "defaultVariants"> & {
|
|
10
16
|
variants: {
|
|
11
17
|
variant: {
|
|
12
18
|
primary: string[];
|
|
13
|
-
secondary:
|
|
19
|
+
secondary: never[];
|
|
14
20
|
};
|
|
15
21
|
};
|
|
16
22
|
defaultVariants: Omit<{}, never>;
|
|
17
23
|
}, {
|
|
18
24
|
variant: {
|
|
19
25
|
primary: string[];
|
|
20
|
-
secondary:
|
|
26
|
+
secondary: never[];
|
|
21
27
|
};
|
|
22
28
|
}>;
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
/**
|
|
30
|
+
* The `::details-content` box is a one-row grid whose row animates from `0fr` to `1fr`, so the content
|
|
31
|
+
* height is never measured in JavaScript. `content-visibility` is transitioned discretely so the content
|
|
32
|
+
* stays visible until the closing animation ends. Browsers without `::details-content` support, users
|
|
33
|
+
* who prefer reduced motion, and `animate={false}` get an instant open and close.
|
|
34
|
+
*/
|
|
35
|
+
export declare const cvaCollapseDetails: import("cva").CVAComponent<Omit<{
|
|
25
36
|
variants: {
|
|
26
|
-
|
|
27
|
-
true:
|
|
37
|
+
animate: {
|
|
38
|
+
true: string[];
|
|
39
|
+
false: never[];
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
defaultVariants: {
|
|
43
|
+
animate: true;
|
|
44
|
+
};
|
|
45
|
+
}, "defaultVariants"> & {
|
|
46
|
+
variants: {
|
|
47
|
+
animate: {
|
|
48
|
+
true: string[];
|
|
28
49
|
false: never[];
|
|
29
50
|
};
|
|
51
|
+
};
|
|
52
|
+
defaultVariants: Omit<{}, "animate"> & {
|
|
53
|
+
animate: true;
|
|
54
|
+
};
|
|
55
|
+
}, {
|
|
56
|
+
animate: {
|
|
57
|
+
true: string[];
|
|
58
|
+
false: never[];
|
|
59
|
+
};
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* A closed primary header rounds its bottom corners. The `open` attribute is removed as soon as closing
|
|
63
|
+
* starts, so when the closing is animated the rounding waits for the animation to end: until then the
|
|
64
|
+
* content is still visible below a header that should stay square.
|
|
65
|
+
*/
|
|
66
|
+
export declare const cvaCollapseHeader: import("cva").CVAComponent<Omit<{
|
|
67
|
+
base: string[];
|
|
68
|
+
variants: {
|
|
30
69
|
variant: {
|
|
31
70
|
primary: string[];
|
|
32
71
|
secondary: string[];
|
|
@@ -35,44 +74,42 @@ export declare const cvaCollapseHeader: import("cva").CVAComponent<Omit<{
|
|
|
35
74
|
true: never[];
|
|
36
75
|
false: never[];
|
|
37
76
|
};
|
|
77
|
+
animate: {
|
|
78
|
+
true: never[];
|
|
79
|
+
false: never[];
|
|
80
|
+
};
|
|
38
81
|
};
|
|
39
82
|
compoundVariants: ({
|
|
40
|
-
variant: "primary";
|
|
41
|
-
expanded: true;
|
|
42
|
-
class: ("border-b" | "border-solid" | "border-neutral-200")[];
|
|
43
|
-
extraPadding?: undefined;
|
|
44
|
-
} | {
|
|
45
|
-
variant: "primary";
|
|
46
|
-
expanded: false;
|
|
47
|
-
class: never[];
|
|
48
|
-
extraPadding?: undefined;
|
|
49
|
-
} | {
|
|
50
83
|
variant: "primary";
|
|
51
84
|
extraPadding: true;
|
|
52
85
|
class: ("py-1.5" | "px-4")[];
|
|
53
|
-
|
|
86
|
+
animate?: undefined;
|
|
54
87
|
} | {
|
|
55
88
|
variant: "primary";
|
|
56
89
|
extraPadding: false;
|
|
57
90
|
class: ("py-1.5" | "px-3")[];
|
|
58
|
-
|
|
91
|
+
animate?: undefined;
|
|
59
92
|
} | {
|
|
60
93
|
variant: "secondary";
|
|
61
94
|
extraPadding: true;
|
|
62
95
|
class: ("py-1.5" | "px-4")[];
|
|
63
|
-
|
|
96
|
+
animate?: undefined;
|
|
64
97
|
} | {
|
|
65
98
|
variant: "secondary";
|
|
66
99
|
extraPadding: false;
|
|
67
100
|
class: never[];
|
|
68
|
-
|
|
101
|
+
animate?: undefined;
|
|
102
|
+
} | {
|
|
103
|
+
variant: "primary";
|
|
104
|
+
animate: true;
|
|
105
|
+
class: "motion-safe:supports-[selector(::details-content)]:[details:not([open])>&]:[transition:background-color_150ms,border-radius_0s_200ms]"[];
|
|
106
|
+
extraPadding?: undefined;
|
|
69
107
|
})[];
|
|
108
|
+
defaultVariants: {
|
|
109
|
+
animate: true;
|
|
110
|
+
};
|
|
70
111
|
}, "defaultVariants"> & {
|
|
71
112
|
variants: {
|
|
72
|
-
expanded: {
|
|
73
|
-
true: never[];
|
|
74
|
-
false: never[];
|
|
75
|
-
};
|
|
76
113
|
variant: {
|
|
77
114
|
primary: string[];
|
|
78
115
|
secondary: string[];
|
|
@@ -81,13 +118,15 @@ export declare const cvaCollapseHeader: import("cva").CVAComponent<Omit<{
|
|
|
81
118
|
true: never[];
|
|
82
119
|
false: never[];
|
|
83
120
|
};
|
|
121
|
+
animate: {
|
|
122
|
+
true: never[];
|
|
123
|
+
false: never[];
|
|
124
|
+
};
|
|
84
125
|
};
|
|
85
|
-
defaultVariants: Omit<{},
|
|
86
|
-
|
|
87
|
-
expanded: {
|
|
88
|
-
true: never[];
|
|
89
|
-
false: never[];
|
|
126
|
+
defaultVariants: Omit<{}, "animate"> & {
|
|
127
|
+
animate: true;
|
|
90
128
|
};
|
|
129
|
+
}, {
|
|
91
130
|
variant: {
|
|
92
131
|
primary: string[];
|
|
93
132
|
secondary: string[];
|
|
@@ -96,6 +135,10 @@ export declare const cvaCollapseHeader: import("cva").CVAComponent<Omit<{
|
|
|
96
135
|
true: never[];
|
|
97
136
|
false: never[];
|
|
98
137
|
};
|
|
138
|
+
animate: {
|
|
139
|
+
true: never[];
|
|
140
|
+
false: never[];
|
|
141
|
+
};
|
|
99
142
|
}>;
|
|
100
143
|
export declare const cvaCollapseLabelContainer: import("cva").CVAComponent<Omit<{
|
|
101
144
|
base: string[];
|
|
@@ -141,13 +184,48 @@ export declare const cvaCollapseLabel: import("cva").CVAComponent<Omit<{
|
|
|
141
184
|
secondary: string[];
|
|
142
185
|
};
|
|
143
186
|
}>;
|
|
144
|
-
|
|
187
|
+
/**
|
|
188
|
+
* The single grid item inside `::details-content`. It must not carry padding, because padding would
|
|
189
|
+
* stay visible while the row is collapsed to `0fr`. `min-w-0` keeps wide content (a code block, a table)
|
|
190
|
+
* from stretching the grid column past the Collapse: a grid item is otherwise at least as wide as its content.
|
|
191
|
+
*/
|
|
192
|
+
export declare const cvaCollapseContent: import("cva").CVAComponent<Omit<{
|
|
145
193
|
base: string[];
|
|
146
194
|
variants: {
|
|
147
195
|
variant: {
|
|
148
|
-
primary:
|
|
196
|
+
primary: string[];
|
|
197
|
+
secondary: never[];
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
}, "defaultVariants"> & {
|
|
201
|
+
variants: {
|
|
202
|
+
variant: {
|
|
203
|
+
primary: string[];
|
|
149
204
|
secondary: never[];
|
|
150
205
|
};
|
|
206
|
+
};
|
|
207
|
+
defaultVariants: Omit<{}, never>;
|
|
208
|
+
}, {
|
|
209
|
+
variant: {
|
|
210
|
+
primary: string[];
|
|
211
|
+
secondary: never[];
|
|
212
|
+
};
|
|
213
|
+
}>;
|
|
214
|
+
/**
|
|
215
|
+
* Hidden while it has no children, so its padding doesn't show as an empty box. A `lazy` Collapse renders
|
|
216
|
+
* its children a moment after the section opens, when the browser's `toggle` event arrives.
|
|
217
|
+
*
|
|
218
|
+
* The line between the header and the content is this element's top border, not the header's bottom border.
|
|
219
|
+
* It is clipped away with the content, and it fades out over the closing animation so it doesn't end in a
|
|
220
|
+
* hard cut when the content reaches zero height.
|
|
221
|
+
*/
|
|
222
|
+
export declare const cvaCollapsible: import("cva").CVAComponent<Omit<{
|
|
223
|
+
base: string[];
|
|
224
|
+
variants: {
|
|
225
|
+
variant: {
|
|
226
|
+
primary: string[];
|
|
227
|
+
secondary: string[];
|
|
228
|
+
};
|
|
151
229
|
extraPadding: {
|
|
152
230
|
true: never[];
|
|
153
231
|
false: never[];
|
|
@@ -173,8 +251,8 @@ export declare const cvaCollapsible: import("cva").CVAComponent<Omit<{
|
|
|
173
251
|
}, "defaultVariants"> & {
|
|
174
252
|
variants: {
|
|
175
253
|
variant: {
|
|
176
|
-
primary:
|
|
177
|
-
secondary:
|
|
254
|
+
primary: string[];
|
|
255
|
+
secondary: string[];
|
|
178
256
|
};
|
|
179
257
|
extraPadding: {
|
|
180
258
|
true: never[];
|
|
@@ -184,65 +262,21 @@ export declare const cvaCollapsible: import("cva").CVAComponent<Omit<{
|
|
|
184
262
|
defaultVariants: Omit<{}, never>;
|
|
185
263
|
}, {
|
|
186
264
|
variant: {
|
|
187
|
-
primary:
|
|
188
|
-
secondary:
|
|
265
|
+
primary: string[];
|
|
266
|
+
secondary: string[];
|
|
189
267
|
};
|
|
190
268
|
extraPadding: {
|
|
191
269
|
true: never[];
|
|
192
270
|
false: never[];
|
|
193
271
|
};
|
|
194
272
|
}>;
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
true: string;
|
|
200
|
-
false: string;
|
|
201
|
-
};
|
|
202
|
-
};
|
|
203
|
-
defaultVariants: {
|
|
204
|
-
expanded: false;
|
|
205
|
-
};
|
|
206
|
-
}, "defaultVariants"> & {
|
|
207
|
-
variants: {
|
|
208
|
-
expanded: {
|
|
209
|
-
true: string;
|
|
210
|
-
false: string;
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
defaultVariants: Omit<{}, "expanded"> & {
|
|
214
|
-
expanded: false;
|
|
215
|
-
};
|
|
216
|
-
}, {
|
|
217
|
-
expanded: {
|
|
218
|
-
true: string;
|
|
219
|
-
false: string;
|
|
220
|
-
};
|
|
221
|
-
}>;
|
|
273
|
+
/**
|
|
274
|
+
* Rotates when this Collapse's own `<details>` is open, with the same timing as the height animation.
|
|
275
|
+
* The child combinator keeps a nested Collapse's chevron from rotating when only its parent is open.
|
|
276
|
+
*/
|
|
222
277
|
export declare const cvaChevronIcon: import("cva").CVAComponent<Omit<{
|
|
223
278
|
base: string[];
|
|
224
|
-
variants: {
|
|
225
|
-
expanded: {
|
|
226
|
-
true: string;
|
|
227
|
-
false: string;
|
|
228
|
-
};
|
|
229
|
-
};
|
|
230
|
-
defaultVariants: {
|
|
231
|
-
expanded: false;
|
|
232
|
-
};
|
|
233
279
|
}, "defaultVariants"> & {
|
|
234
|
-
variants:
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
false: string;
|
|
238
|
-
};
|
|
239
|
-
};
|
|
240
|
-
defaultVariants: Omit<{}, "expanded"> & {
|
|
241
|
-
expanded: false;
|
|
242
|
-
};
|
|
243
|
-
}, {
|
|
244
|
-
expanded: {
|
|
245
|
-
true: string;
|
|
246
|
-
false: string;
|
|
247
|
-
};
|
|
248
|
-
}>;
|
|
280
|
+
variants: unknown;
|
|
281
|
+
defaultVariants: Omit<{}, never>;
|
|
282
|
+
}, unknown>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether an interactive element's own activation behaviour takes the click, so a `<summary>` around it doesn't
|
|
3
|
+
* toggle natively. Calling preventDefault on such an element would cancel its action (e.g. a checkbox change).
|
|
4
|
+
*/
|
|
5
|
+
export declare const isNativelyActivatable: (element: Element) => boolean;
|
|
@@ -49,6 +49,7 @@ interface NonDismissibleTagProps extends TagBaseProps {
|
|
|
49
49
|
*/
|
|
50
50
|
removeTagLabel?: string;
|
|
51
51
|
removeButtonInTabOrder?: undefined;
|
|
52
|
+
keepFocus?: undefined;
|
|
52
53
|
}
|
|
53
54
|
interface DismissibleTagProps extends TagBaseProps {
|
|
54
55
|
/**
|
|
@@ -68,6 +69,13 @@ interface DismissibleTagProps extends TagBaseProps {
|
|
|
68
69
|
* so the remove button adds no Tab stop. Defaults to true.
|
|
69
70
|
*/
|
|
70
71
|
removeButtonInTabOrder?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Set `keepFocus` when the tag belongs to an input, like a removable scope chip in a search field,
|
|
74
|
+
* so clicking the remove button doesn't move focus away. Keyboard focus and Tab order are unaffected.
|
|
75
|
+
*
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
78
|
+
keepFocus?: boolean;
|
|
71
79
|
}
|
|
72
80
|
export type TagProps = DismissibleTagProps | NonDismissibleTagProps;
|
|
73
81
|
/**
|
|
@@ -118,5 +126,5 @@ export type TagProps = DismissibleTagProps | NonDismissibleTagProps;
|
|
|
118
126
|
* @param {TagProps} props - The props for the Tag component.
|
|
119
127
|
* @returns {ReactElement} The rendered Tag component.
|
|
120
128
|
*/
|
|
121
|
-
export declare const Tag: ({ className, "data-testid": dataTestId, children, size, onClickClose, color, disabled, ref, icon, onMouseEnter, style, removeTagLabel, removeButtonInTabOrder, }: TagProps) => ReactElement;
|
|
129
|
+
export declare const Tag: ({ className, "data-testid": dataTestId, children, size, onClickClose, color, disabled, ref, icon, onMouseEnter, style, removeTagLabel, removeButtonInTabOrder, keepFocus, }: TagProps) => ReactElement;
|
|
122
130
|
export {};
|