@trackunit/react-components 3.5.6 → 3.7.3

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.
Files changed (54) hide show
  1. package/index.cjs.js +132 -42
  2. package/index.esm.js +132 -43
  3. package/migrations/entry.js.map +1 -0
  4. package/migrations/utils/jsx-utils.js.map +1 -0
  5. package/migrations/v2-0-0/breadcrumb-remove-deprecated-props.js.map +1 -0
  6. package/migrations/v2-0-0/cardheader-onclickclose-to-actions.js.map +1 -0
  7. package/migrations/v2-0-0/iconbutton-add-required-name.js.map +1 -0
  8. package/migrations/v2-0-0/kpi-tooltiplabel-to-wrapper.js.map +1 -0
  9. package/migrations/v2-0-0/notice-tooltiplabel-to-wrapper.js.map +1 -0
  10. package/migrations/v2-0-0/pagination-add-required-titles.js.map +1 -0
  11. package/migrations/v2-0-0/tag-add-removetaglabel.js.map +1 -0
  12. package/migrations/v2-0-0/togglegroup-remove-item-style.js.map +1 -0
  13. package/migrations/v3-0-0/copyabletext-to-text-copybutton.js.map +1 -0
  14. package/migrations/v3-0-0/menulist-rename-to-menucontent.js.map +1 -0
  15. package/package.json +6 -6
  16. package/src/common/StorybookProps.d.ts +1 -1
  17. package/src/components/CopyButton/CopyButton.d.ts +14 -15
  18. package/src/components/CopyableValue/CopyableValue.d.ts +86 -0
  19. package/src/components/CopyableValue/CopyableValue.variants.d.ts +60 -0
  20. package/src/index.d.ts +1 -0
  21. package/translation.cjs.js +1 -0
  22. package/translation.esm.js +1 -0
  23. package/translation10.cjs.js +1 -0
  24. package/translation10.esm.js +1 -0
  25. package/translation11.cjs.js +1 -0
  26. package/translation11.esm.js +1 -0
  27. package/translation12.cjs.js +1 -0
  28. package/translation12.esm.js +1 -0
  29. package/translation13.cjs.js +1 -0
  30. package/translation13.esm.js +1 -0
  31. package/translation14.cjs.js +1 -0
  32. package/translation14.esm.js +1 -0
  33. package/translation15.cjs.js +1 -0
  34. package/translation15.esm.js +1 -0
  35. package/translation16.cjs.js +1 -0
  36. package/translation16.esm.js +1 -0
  37. package/translation17.cjs.js +1 -0
  38. package/translation17.esm.js +1 -0
  39. package/translation2.cjs.js +1 -0
  40. package/translation2.esm.js +1 -0
  41. package/translation3.cjs.js +1 -0
  42. package/translation3.esm.js +1 -0
  43. package/translation4.cjs.js +1 -0
  44. package/translation4.esm.js +1 -0
  45. package/translation5.cjs.js +1 -0
  46. package/translation5.esm.js +1 -0
  47. package/translation6.cjs.js +1 -0
  48. package/translation6.esm.js +1 -0
  49. package/translation7.cjs.js +1 -0
  50. package/translation7.esm.js +1 -0
  51. package/translation8.cjs.js +1 -0
  52. package/translation8.esm.js +1 -0
  53. package/translation9.cjs.js +1 -0
  54. package/translation9.esm.js +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag-add-removetaglabel.js","sourceRoot":"","sources":["../../../../../../libs/react/components/migrations/v2-0-0/tag-add-removetaglabel.ts"],"names":[],"mappings":";;;AAAA,uCAA+C;AAC/C,kDAQ4B;AAE5B,MAAM,YAAY,GAAG,6BAA6B,CAAC;AACnD,MAAM,cAAc,GAAG,KAAK,CAAC;AAE7B,MAAM,4BAA4B,GAAG,YAAY,CAAC;AAElD,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAE,OAAe,EAAiB,EAAE;IAC7E,MAAM,UAAU,GAAG,IAAA,oBAAQ,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAE/C,MAAM,OAAO,GAAG,IAAA,8BAAkB,EAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IAC7D,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAElC,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5F,IAAI,UAAU,KAAK,SAAS;QAAE,OAAO,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ACjB,CAAC,CAAC;AAEF;;;;;GAKG;AACI,MAAM,oBAAoB,GAAG,CAAC,IAAU,EAAQ,EAAE;IACvD,MAAM,OAAO,GAAG,IAAA,yBAAa,EAAC,IAAI,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;IAC9D,IAAA,sBAAU,EAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;IAC9C,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;QAChB,eAAM,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC;IAC9F,CAAC;AACH,CAAC,CAAC;AANW,QAAA,oBAAoB,wBAM/B;AAEF,kBAAe,4BAAoB,CAAC","sourcesContent":["import { type Tree, logger } from \"@nx/devkit\";\nimport {\n findJsxAttribute,\n findJsxElements,\n getImportedAliases,\n hasSpreadAttribute,\n logSummary,\n parseTsx,\n visitTsxFiles,\n} from \"../utils/jsx-utils\";\n\nconst PACKAGE_NAME = \"@trackunit/react-components\";\nconst COMPONENT_NAME = \"Tag\";\n\nconst REMOVE_TAG_LABEL_PLACEHOLDER = \"Remove tag\";\n\nconst transformTagUsage = (filePath: string, content: string): string | null => {\n const sourceFile = parseTsx(content, filePath);\n\n const aliases = getImportedAliases(sourceFile, PACKAGE_NAME);\n if (aliases === null) return null;\n\n const localAlias = Object.entries(aliases).find(([, name]) => name === COMPONENT_NAME)?.[0];\n if (localAlias === undefined) return null;\n\n const matches = findJsxElements(sourceFile, [localAlias]);\n if (matches.length === 0) return null;\n\n type Edit = { offset: number; text: string };\n const edits: Array<Edit> = [];\n\n for (const { openingElement } of matches) {\n if (hasSpreadAttribute(openingElement)) continue;\n\n // Only act when the tag is dismissible (has onClickClose) and missing the\n // newly required label.\n if (findJsxAttribute(openingElement, \"onClickClose\") === null) continue;\n if (findJsxAttribute(openingElement, \"removeTagLabel\") !== null) continue;\n\n edits.push({\n offset: openingElement.tagName.getEnd(),\n text: ` removeTagLabel=\"${REMOVE_TAG_LABEL_PLACEHOLDER}\"`,\n });\n }\n\n if (edits.length === 0) return null;\n\n edits.sort((a, b) => (a.offset === b.offset ? 0 : b.offset - a.offset));\n\n let updated = content;\n for (const { offset, text } of edits) {\n updated = updated.slice(0, offset) + text + updated.slice(offset);\n }\n return updated;\n};\n\n/**\n * Adds the now-required `removeTagLabel` prop to dismissible `<Tag>` usages\n * (those with `onClickClose`) when it is missing. Default value is the English\n * string \"Remove tag\"; consumers should replace it with their own localized\n * label.\n */\nexport const tagAddRemoveTagLabel = (tree: Tree): void => {\n const touched = visitTsxFiles(tree, \"Tag\", transformTagUsage);\n logSummary(\"tag-add-removetaglabel\", touched);\n if (touched > 0) {\n logger.info(` Replace the placeholder \"Remove tag\" string with your own localized value.`);\n }\n};\n\nexport default tagAddRemoveTagLabel;\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"togglegroup-remove-item-style.js","sourceRoot":"","sources":["../../../../../../libs/react/components/migrations/v2-0-0/togglegroup-remove-item-style.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA+C;AAC/C,+CAAiC;AACjC,kDAO4B;AAE5B,MAAM,YAAY,GAAG,6BAA6B,CAAC;AACnD,MAAM,cAAc,GAAG,aAAa,CAAC;AAIrC,MAAM,6BAA6B,GAAG,CAAC,YAAuC,EAA0B,EAAE;IACxG,MAAM,QAAQ,GAAmB,EAAE,CAAC;IACpC,KAAK,MAAM,OAAO,IAAI,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC5C,IAAI,CAAC,EAAE,CAAC,yBAAyB,CAAC,OAAO,CAAC;YAAE,SAAS;QACrD,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACtC,IACE,CAAC,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,6BAA6B,CAAC,IAAI,CAAC,CAAC;gBACzE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC1B,IAAI,CAAC,IAAI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;YACzB,GAAG,IAAI,CAAC,CAAC;QACX,CAAC;QACD,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAChD,CAAC,CAAC;AAEF;;;;;;;GAOG;AACI,MAAM,0BAA0B,GAAG,CAAC,IAAU,EAAQ,EAAE;IAC7D,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,IAAA,yBAAa,EAAC,IAAI,EAAE,cAAc,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE;QACxD,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,yBAAyB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC5F,YAAY,IAAI,gBAAgB,CAAC;QACjC,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;YAC5C,OAAO,IAAI,CAAC,CAAC;YACb,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IACH,IAAA,sBAAU,EAAC,+BAA+B,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;IACnE,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;QACrB,eAAM,CAAC,IAAI,CACT,KAAK,YAAY,0IAA0I,CAC5J,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAlBW,QAAA,0BAA0B,8BAkBrC;AAEF,kBAAe,kCAA0B,CAAC","sourcesContent":["import { type Tree, logger } from \"@nx/devkit\";\nimport * as ts from \"typescript\";\nimport {\n findJsxAttribute,\n findJsxElements,\n getImportedAliases,\n logSummary,\n parseTsx,\n visitTsxFiles,\n} from \"../utils/jsx-utils\";\n\nconst PACKAGE_NAME = \"@trackunit/react-components\";\nconst COMPONENT_NAME = \"ToggleGroup\";\n\ntype Removal = { start: number; end: number };\n\nconst collectStyleRemovalsFromArray = (arrayLiteral: ts.ArrayLiteralExpression): ReadonlyArray<Removal> => {\n const removals: Array<Removal> = [];\n for (const element of arrayLiteral.elements) {\n if (!ts.isObjectLiteralExpression(element)) continue;\n for (const prop of element.properties) {\n if (\n (ts.isPropertyAssignment(prop) || ts.isShorthandPropertyAssignment(prop)) &&\n ts.isIdentifier(prop.name) &&\n prop.name.text === \"style\"\n ) {\n removals.push({ start: prop.getFullStart(), end: prop.getEnd() });\n }\n }\n }\n return removals;\n};\n\nconst transformToggleGroupUsage = (\n filePath: string,\n content: string\n): { content: string | null; skippedNonInline: number } => {\n const sourceFile = parseTsx(content, filePath);\n\n const aliases = getImportedAliases(sourceFile, PACKAGE_NAME);\n if (aliases === null) return { content: null, skippedNonInline: 0 };\n\n const localAlias = Object.entries(aliases).find(([, name]) => name === COMPONENT_NAME)?.[0];\n if (localAlias === undefined) return { content: null, skippedNonInline: 0 };\n\n const matches = findJsxElements(sourceFile, [localAlias]);\n if (matches.length === 0) return { content: null, skippedNonInline: 0 };\n\n const removals: Array<Removal> = [];\n let skippedNonInline = 0;\n\n for (const { openingElement } of matches) {\n const listAttr = findJsxAttribute(openingElement, \"list\");\n if (listAttr === null) continue;\n\n const initializer = listAttr.initializer;\n if (initializer === undefined || !ts.isJsxExpression(initializer)) continue;\n const expr = initializer.expression;\n if (expr === undefined) continue;\n\n if (!ts.isArrayLiteralExpression(expr)) {\n // The list is referenced through a variable / function call; we can't\n // safely strip `style` without potentially editing unrelated objects.\n skippedNonInline += 1;\n continue;\n }\n\n removals.push(...collectStyleRemovalsFromArray(expr));\n }\n\n if (removals.length === 0) return { content: null, skippedNonInline };\n\n // Remove the property and its trailing comma if present so we don't leave\n // dangling `, ,` sequences.\n const sorted = [...removals].sort((a, b) => b.start - a.start);\n let updated = content;\n for (let { start, end } of sorted) {\n while (start > 0 && (updated[start - 1] === \" \" || updated[start - 1] === \"\\t\")) {\n start -= 1;\n }\n if (updated[end] === \",\") {\n end += 1;\n }\n updated = updated.slice(0, start) + updated.slice(end);\n }\n\n return { content: updated, skippedNonInline };\n};\n\n/**\n * Removes the `style` property from items in `<ToggleGroup list={[...]}>`\n * because `BasicToggleGroupListProps` no longer extends `Styleable`.\n *\n * Only inline array literals are processed; lists pulled in via a variable or\n * function call are left untouched and reported in the migration summary so\n * the developer can review them.\n */\nexport const toggleGroupRemoveItemStyle = (tree: Tree): void => {\n let touched = 0;\n let totalSkipped = 0;\n visitTsxFiles(tree, COMPONENT_NAME, (filePath, content) => {\n const { content: updated, skippedNonInline } = transformToggleGroupUsage(filePath, content);\n totalSkipped += skippedNonInline;\n if (updated !== null && updated !== content) {\n touched += 1;\n return updated;\n }\n return null;\n });\n logSummary(\"togglegroup-remove-item-style\", touched, totalSkipped);\n if (totalSkipped > 0) {\n logger.info(\n ` ${totalSkipped} ToggleGroup usage(s) referenced their list through a variable/function. Remove any 'style' properties from those item objects manually.`\n );\n }\n};\n\nexport default toggleGroupRemoveItemStyle;\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copyabletext-to-text-copybutton.js","sourceRoot":"","sources":["../../../../../../libs/react/components/migrations/v3-0-0/copyabletext-to-text-copybutton.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAAiC;AACjC,kDAQ4B;AAE5B,MAAM,YAAY,GAAG,6BAA6B,CAAC;AACnD,MAAM,cAAc,GAAG,cAAc,CAAC;AAEtC,gFAAgF;AAChF,MAAM,aAAa,GAAG,CAAC,IAAqB,EAAiB,EAAE;IAC7D,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;IACrC,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC3C,OAAO,WAAW,CAAC,OAAO,EAAE,CAAC;AAC/B,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,cAAc,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AmE;IACnE,MAAM,SAAS,GAAG,IAAA,2BAAe,EAAC,IAAA,oBAAQ,EAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACpF,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,GAAG,iBAAiB,CAAC,OAAO,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC;IACrE,CAAC;SAAM,CAAC;QACN,iBAAiB,IAAI,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,GAAG,iBAAiB,CAAC,OAAO,EAAE,YAAY,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;IAE3E,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACI,MAAM,4BAA4B,GAAG,CAAC,IAAU,EAAQ,EAAE;IAC/D,iBAAiB,GAAG,CAAC,CAAC;IACtB,MAAM,OAAO,GAAG,IAAA,yBAAa,EAAC,IAAI,EAAE,cAAc,EAAE,0BAA0B,CAAC,CAAC;IAChF,IAAA,sBAAU,EAAC,iCAAiC,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;AAC5E,CAAC,CAAC;AAJW,QAAA,4BAA4B,gCAIvC;AAEF,kBAAe,oCAA4B,CAAC","sourcesContent":["import { type Tree } from \"@nx/devkit\";\nimport * as ts from \"typescript\";\nimport {\n findJsxAttribute,\n findJsxElements,\n getImportedAliases,\n hasSpreadAttribute,\n logSummary,\n parseTsx,\n visitTsxFiles,\n} from \"../utils/jsx-utils\";\n\nconst PACKAGE_NAME = \"@trackunit/react-components\";\nconst COMPONENT_NAME = \"CopyableText\";\n\n/** Attribute initializer rendered back to source, e.g. `\"abc\"` or `{value}`. */\nconst attributeText = (attr: ts.JsxAttribute): string | null => {\n const initializer = attr.initializer;\n if (initializer === undefined) return null;\n return initializer.getText();\n};\n\n/**\n * The expression the copied text resolves to: `text=\"abc\"` yields `\"abc\"`,\n * `text={value}` yields `value`. Used both as the CopyButton value and as the\n * rendered children, so it must be a side-effect-free expression.\n */\nconst textExpression = (attr: ts.JsxAttribute): string | null => {\n const initializer = attr.initializer;\n if (initializer === undefined) return null;\n if (ts.isStringLiteral(initializer)) return initializer.getText();\n if (ts.isJsxExpression(initializer) && initializer.expression !== undefined) {\n return initializer.expression.getText();\n }\n return null;\n};\n\nconst renderReplacement = ({\n textExpr,\n size,\n copyLabelAttr,\n copiedLabelAttr,\n classNameLiteral,\n styleAttr,\n testIdAttr,\n textAlias,\n copyButtonAlias,\n}: {\n textExpr: string;\n size: \"sm\" | \"xs\";\n copyLabelAttr: string | null;\n copiedLabelAttr: string | null;\n classNameLiteral: string | null;\n styleAttr: string | null;\n testIdAttr: string | null;\n textAlias: string;\n copyButtonAlias: string;\n}): string => {\n const wrapperClasses = [\"flex\", \"min-w-0\", \"max-w-full\", \"items-center\", \"gap-0.5\", classNameLiteral]\n .filter(Boolean)\n .join(\" \");\n\n const wrapperAttrs = [\n `className=\"${wrapperClasses}\"`,\n styleAttr !== null ? `style=${styleAttr}` : null,\n testIdAttr !== null ? `data-testid=${testIdAttr}` : null,\n ]\n .filter(Boolean)\n .join(\" \");\n\n const textProps = [`className=\"min-w-0 truncate\"`, size === \"xs\" ? `size=\"small\"` : null, `type=\"span\"`]\n .filter(Boolean)\n .join(\" \");\n\n const buttonProps = [\n `className=\"shrink-0\"`,\n copiedLabelAttr !== null ? `copiedLabel=${copiedLabelAttr}` : null,\n copyLabelAttr !== null ? `copyLabel=${copyLabelAttr}` : null,\n size === \"xs\" ? `size=\"extraSmall\"` : null,\n `value={${textExpr}}`,\n ]\n .filter(Boolean)\n .join(\" \");\n\n return `<span ${wrapperAttrs}><${textAlias} ${textProps}>{${textExpr}}</${textAlias}><${copyButtonAlias} ${buttonProps} /></span>`;\n};\n\n/** Removes `name` (possibly aliased) from the package's named import list. */\nconst removeNamedImport = (content: string, packageName: string, name: string): string => {\n const sourceFile = parseTsx(content, \"source.tsx\");\n\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) continue;\n const moduleSpecifier = stmt.moduleSpecifier;\n if (!ts.isStringLiteral(moduleSpecifier) || moduleSpecifier.text !== packageName) continue;\n\n const namedBindings = stmt.importClause?.namedBindings;\n if (namedBindings === undefined || !ts.isNamedImports(namedBindings)) continue;\n\n const remaining = namedBindings.elements.filter(el => (el.propertyName?.text ?? el.name.text) !== name);\n if (remaining.length === namedBindings.elements.length) continue;\n\n if (remaining.length === 0) {\n // The import only carried this component; drop the whole statement.\n const start = stmt.getFullStart();\n const end = stmt.getEnd();\n const trailing = content.slice(end).startsWith(\"\\n\") ? end + 1 : end;\n return `${content.slice(0, start)}${content.slice(trailing)}`;\n }\n\n const elementsText = remaining.map(el => el.getText()).join(\", \");\n return `${content.slice(0, namedBindings.getStart())}{ ${elementsText} }${content.slice(namedBindings.getEnd())}`;\n }\n\n return content;\n};\n\nconst ensureNamedImport = (content: string, packageName: string, namesToAdd: ReadonlyArray<string>): string => {\n const sourceFile = parseTsx(content, \"source.tsx\");\n const aliases = getImportedAliases(sourceFile, packageName) ?? {};\n\n const missing = namesToAdd.filter(name => !Object.values(aliases).includes(name));\n if (missing.length === 0) return content;\n\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) continue;\n const moduleSpecifier = stmt.moduleSpecifier;\n if (!ts.isStringLiteral(moduleSpecifier) || moduleSpecifier.text !== packageName) continue;\n\n const namedBindings = stmt.importClause?.namedBindings;\n if (namedBindings === undefined || !ts.isNamedImports(namedBindings)) continue;\n\n const elementsText = namedBindings.elements.map(el => el.getText()).join(\", \");\n const merged = [elementsText, ...missing].join(\", \");\n return `${content.slice(0, namedBindings.getStart())}{ ${merged} }${content.slice(namedBindings.getEnd())}`;\n }\n\n const importLine = `import { ${missing.join(\", \")} } from \"${packageName}\";\\n`;\n return `${importLine}${content}`;\n};\n\nlet manualReviewCount = 0;\n\nconst transformCopyableTextUsage = (filePath: string, content: string): string | null => {\n const sourceFile = parseTsx(content, filePath);\n\n const aliases = getImportedAliases(sourceFile, PACKAGE_NAME);\n if (aliases === null) return null;\n\n const copyableTextAlias = Object.entries(aliases).find(([, name]) => name === COMPONENT_NAME)?.[0];\n if (copyableTextAlias === undefined) return null;\n\n // A referenced CopyableTextProps type cannot be rewritten mechanically;\n // leave the whole file for a human so it isn't half-migrated.\n if (Object.values(aliases).includes(\"CopyableTextProps\")) {\n manualReviewCount += 1;\n return null;\n }\n\n const matches = findJsxElements(sourceFile, [copyableTextAlias]);\n if (matches.length === 0) return null;\n\n type Edit = { start: number; end: number; replacement: string };\n const edits: Array<Edit> = [];\n\n for (const { openingElement, element } of matches) {\n if (hasSpreadAttribute(openingElement) || findJsxAttribute(openingElement, \"ref\") !== null) {\n manualReviewCount += 1;\n continue;\n }\n\n const textAttr = findJsxAttribute(openingElement, \"text\");\n const textExpr = textAttr !== null ? textExpression(textAttr) : null;\n if (textExpr === null) {\n manualReviewCount += 1;\n continue;\n }\n\n const sizeAttr = findJsxAttribute(openingElement, \"size\");\n const sizeInitializer = sizeAttr?.initializer;\n const size = sizeInitializer !== undefined && sizeInitializer.getText().includes(\"xs\") ? \"xs\" : \"sm\";\n\n const classNameAttr = findJsxAttribute(openingElement, \"className\");\n let classNameLiteral: string | null = null;\n if (classNameAttr !== null) {\n const initializer = classNameAttr.initializer;\n if (initializer !== undefined && ts.isStringLiteral(initializer)) {\n classNameLiteral = initializer.text;\n } else {\n // Dynamic classNames can't be merged into the wrapper's string safely.\n manualReviewCount += 1;\n continue;\n }\n }\n\n const copyLabelAttr = findJsxAttribute(openingElement, \"copyLabel\");\n const copiedLabelAttr = findJsxAttribute(openingElement, \"copiedLabel\");\n const styleAttr = findJsxAttribute(openingElement, \"style\");\n const testIdAttr = findJsxAttribute(openingElement, \"data-testid\");\n\n const replacement = renderReplacement({\n textExpr,\n size,\n copyLabelAttr: copyLabelAttr !== null ? attributeText(copyLabelAttr) : null,\n copiedLabelAttr: copiedLabelAttr !== null ? attributeText(copiedLabelAttr) : null,\n classNameLiteral,\n styleAttr: styleAttr !== null ? attributeText(styleAttr) : null,\n testIdAttr: testIdAttr !== null ? attributeText(testIdAttr) : null,\n textAlias: \"Text\",\n copyButtonAlias: \"CopyButton\",\n });\n\n edits.push({ start: element.getStart(), end: element.getEnd(), replacement });\n }\n\n if (edits.length === 0) return null;\n\n edits.sort((a, b) => b.start - a.start);\n\n let updated = content;\n for (const { start, end, replacement } of edits) {\n updated = `${updated.slice(0, start)}${replacement}${updated.slice(end)}`;\n }\n\n // Only drop the import when every usage in the file was rewritten.\n const remaining = findJsxElements(parseTsx(updated, filePath), [copyableTextAlias]);\n if (remaining.length === 0) {\n updated = removeNamedImport(updated, PACKAGE_NAME, COMPONENT_NAME);\n } else {\n manualReviewCount += 1;\n }\n\n updated = ensureNamedImport(updated, PACKAGE_NAME, [\"Text\", \"CopyButton\"]);\n\n return updated;\n};\n\n/**\n * Rewrites `<CopyableText text={x} …/>` (removed in v3) into the plain\n * value/copy pair: a `Text` next to a `CopyButton` that copies the same\n * expression. `size=\"xs\"` maps to `Text size=\"small\"` + `CopyButton\n * size=\"extraSmall\"`; `copyLabel`/`copiedLabel` carry over (CopyButton also\n * ships localized defaults). Usages with spreads, refs, dynamic classNames,\n * or a referenced `CopyableTextProps` type are left for manual review.\n */\nexport const copyableTextToTextCopyButton = (tree: Tree): void => {\n manualReviewCount = 0;\n const touched = visitTsxFiles(tree, COMPONENT_NAME, transformCopyableTextUsage);\n logSummary(\"copyabletext-to-text-copybutton\", touched, manualReviewCount);\n};\n\nexport default copyableTextToTextCopyButton;\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menulist-rename-to-menucontent.js","sourceRoot":"","sources":["../../../../../../libs/react/components/migrations/v3-0-0/menulist-rename-to-menucontent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAAiC;AACjC,kDAA6F;AAE7F,MAAM,YAAY,GAAG,6BAA6B,CAA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E,EAAE,CAAC,CAAC,CAAC;QAC9D,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,GAAG,8BAA8B,CAAC,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;YAChF,IAAI,IAAI,KAAK,IAAI;gBAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEpC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAExC,IAAI,OAAO,GAAG,OAAO,CAAC;IACtB,KAAK,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,KAAK,EAAE,CAAC;QACzC,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;;;;;;;;;GAUG;AACI,MAAM,2BAA2B,GAAG,CAAC,IAAU,EAAQ,EAAE;IAC9D,MAAM,OAAO,GAAG,IAAA,yBAAa,EAAC,IAAI,EAAE,UAAU,EAAE,sBAAsB,CAAC,CAAC;IACxE,IAAA,sBAAU,EAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;AACxD,CAAC,CAAC;AAHW,QAAA,2BAA2B,+BAGtC;AAEF,kBAAe,mCAA2B,CAAC","sourcesContent":["import { type Tree } from \"@nx/devkit\";\nimport * as ts from \"typescript\";\nimport { getImportedAliases, logSummary, parseTsx, visitTsxFiles } from \"../utils/jsx-utils\";\n\nconst PACKAGE_NAME = \"@trackunit/react-components\";\n\nconst RENAMES: ReadonlyArray<{ readonly from: string; readonly to: string }> = [\n { from: \"MenuList\", to: \"MenuContent\" },\n { from: \"MenuListProps\", to: \"MenuContentProps\" },\n];\n\ntype Edit = { start: number; end: number; text: string };\n\n/**\n * Every `Identifier` node in the file matching `name`. Safe to use as a\n * blanket rename once we've confirmed (via `getImportedAliases`) that `name`\n * is genuinely imported from the target package with no local alias — in\n * that case the import specifier, JSX tag references, and type references\n * all share the same identifier text, so one pass covers every site.\n */\nconst collectIdentifierEdits = (sourceFile: ts.SourceFile, name: string, replacement: string): Array<Edit> => {\n const edits: Array<Edit> = [];\n const visit = (node: ts.Node): void => {\n if (ts.isIdentifier(node) && node.text === name) {\n edits.push({ start: node.getStart(sourceFile), end: node.getEnd(), text: replacement });\n }\n ts.forEachChild(node, visit);\n };\n visit(sourceFile);\n return edits;\n};\n\n/**\n * Locates the `propertyName` of an aliased named import specifier\n * (`{ MenuList as Foo }`) for `importedName`. Only that part needs\n * rewriting — the local binding `Foo` (and therefore every usage site in\n * the file) stays exactly as the author wrote it.\n */\nconst findAliasedImportSpecifierEdit = (\n sourceFile: ts.SourceFile,\n packageName: string,\n importedName: string,\n replacement: string\n): Edit | null => {\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) continue;\n const moduleSpecifier = stmt.moduleSpecifier;\n if (!ts.isStringLiteral(moduleSpecifier) || moduleSpecifier.text !== packageName) continue;\n\n const namedBindings = stmt.importClause?.namedBindings;\n if (namedBindings === undefined || !ts.isNamedImports(namedBindings)) continue;\n\n for (const element of namedBindings.elements) {\n if (element.propertyName === undefined) continue;\n if (element.propertyName.text !== importedName) continue;\n return {\n start: element.propertyName.getStart(sourceFile),\n end: element.propertyName.getEnd(),\n text: replacement,\n };\n }\n }\n return null;\n};\n\nconst transformMenuListUsage = (filePath: string, content: string): string | null => {\n const sourceFile = parseTsx(content, filePath);\n\n const aliases = getImportedAliases(sourceFile, PACKAGE_NAME);\n if (aliases === null) return null;\n\n const edits: Array<Edit> = [];\n\n for (const { from, to } of RENAMES) {\n const localAlias = Object.entries(aliases).find(([, original]) => original === from)?.[0];\n if (localAlias === undefined) continue;\n\n if (localAlias === from) {\n edits.push(...collectIdentifierEdits(sourceFile, from, to));\n } else {\n const edit = findAliasedImportSpecifierEdit(sourceFile, PACKAGE_NAME, from, to);\n if (edit !== null) edits.push(edit);\n }\n }\n\n if (edits.length === 0) return null;\n\n edits.sort((a, b) => b.start - a.start);\n\n let updated = content;\n for (const { start, end, text } of edits) {\n updated = updated.slice(0, start) + text + updated.slice(end);\n }\n return updated;\n};\n\n/**\n * Renames `MenuList`/`MenuListProps` to `MenuContent`/`MenuContentProps`\n * everywhere they're imported from `@trackunit/react-components` — the\n * import specifier, every JSX tag usage, and every type reference (e.g.\n * `Omit<MenuListProps, \"children\">`).\n *\n * Aliased imports (`{ MenuList as Foo }`) only need the imported name\n * rewritten; the local alias and its usage sites are left untouched.\n * Unrelated same-prefix exports like `cvaMenuList`/`cvaMenuListItem` are\n * never matched since identifier comparisons are exact, not substring.\n */\nexport const menuListRenameToMenuContent = (tree: Tree): void => {\n const touched = visitTsxFiles(tree, \"MenuList\", transformMenuListUsage);\n logSummary(\"menulist-rename-to-menucontent\", touched);\n};\n\nexport default menuListRenameToMenuContent;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "3.5.6",
3
+ "version": "3.7.3",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "migrations": "./migrations.json",
@@ -14,16 +14,16 @@
14
14
  "@floating-ui/react": "^0.26.25",
15
15
  "string-ts": "^2.0.0",
16
16
  "tailwind-merge": "^2.0.0",
17
- "@trackunit/ui-design-tokens": "1.17.3",
18
- "@trackunit/css-class-variance-utilities": "2.2.3",
19
- "@trackunit/shared-utils": "1.18.3",
20
- "@trackunit/ui-icons": "1.16.4",
17
+ "@trackunit/ui-design-tokens": "1.18.2",
18
+ "@trackunit/css-class-variance-utilities": "2.3.2",
19
+ "@trackunit/shared-utils": "1.19.2",
20
+ "@trackunit/ui-icons": "1.17.2",
21
21
  "es-toolkit": "^1.52.0",
22
22
  "@tanstack/react-virtual": "^3.14.13",
23
23
  "dequal": "^2.0.3",
24
24
  "fflate": "^0.8.3",
25
25
  "zod": "^3.25.76",
26
- "@trackunit/i18n-library-translation": "2.7.4"
26
+ "@trackunit/i18n-library-translation": "2.8.2"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": "^19.0.0",
@@ -1,6 +1,6 @@
1
1
  export declare const docs: {
2
2
  source: {
3
- type: string;
3
+ type: "dynamic";
4
4
  excludeDecorators: boolean;
5
5
  };
6
6
  };
@@ -41,11 +41,11 @@ export interface CopyButtonProps extends CommonProps, Styleable, Refable<HTMLBut
41
41
  */
42
42
  variant?: ButtonVariant;
43
43
  /**
44
- * Called after the value has been written to the clipboard — via the
45
- * Clipboard API or the `execCommand("copy")` fallback. Only skipped when
46
- * both mechanisms fail.
44
+ * Called with the copied value after it has been written to the clipboard —
45
+ * via the Clipboard API or the `execCommand("copy")` fallback. Only skipped
46
+ * when both mechanisms fail.
47
47
  */
48
- onCopy?: () => void;
48
+ onCopy?: (value: string) => void;
49
49
  }
50
50
  /**
51
51
  * CopyButton is a standalone icon button that copies a value to the clipboard when clicked,
@@ -53,28 +53,27 @@ export interface CopyButtonProps extends CommonProps, Styleable, Refable<HTMLBut
53
53
  * element, so the button can be placed next to plain (non-clickable) text.
54
54
  *
55
55
  * ### When to use
56
- * - Icon-only (default): the copyable value is displayed as plain text (e.g. in a table cell or
57
- * row) and only a dedicated icon should trigger the copy, keeping the rest of the row clickable.
58
56
  * - Labelled (`label` set): copying is the primary action of a panel or section — e.g. an invite
59
57
  * link — and deserves a full button that is itself the click target.
58
+ * - Icon-only (default): a copy control on its own, where no value is displayed next to it — e.g.
59
+ * in the corner of a code block.
60
60
  *
61
61
  * ### When not to use
62
- * Do not hand-roll copy affordances (custom icons, click-to-copy text) — this component is the
63
- * one copy control; pick icon-only or labelled mode instead.
62
+ * - To show a value with a copy button beside it, use `CopyableValue` — it owns the layout,
63
+ * truncation and hover highlight. Do not pair `Text` and `CopyButton` by hand.
64
+ * - Do not hand-roll copy affordances (custom icons, click-to-copy text) — use this component or
65
+ * `CopyableValue` instead.
64
66
  *
65
67
  * ### Empty values
66
68
  * CopyButton renders nothing when `value` is empty, so consumers never present a copy control
67
69
  * that has no meaningful result.
68
70
  *
69
- * @example Icon button next to plain text
71
+ * @example Labelled button for an invite link
70
72
  * ```tsx
71
- * import { CopyButton, Text } from "@trackunit/react-components";
73
+ * import { CopyButton } from "@trackunit/react-components";
72
74
  *
73
- * const ShortCode = ({ code }: { code: string }) => (
74
- * <div className="flex items-center gap-0.5">
75
- * <Text type="span">{code}</Text>
76
- * <CopyButton value={code} />
77
- * </div>
75
+ * const CopyInviteLink = ({ link }: { link: string }) => (
76
+ * <CopyButton label="Copy link" value={link} variant="secondary" />
78
77
  * );
79
78
  * ```
80
79
  * @param {CopyButtonProps} props - The props for the CopyButton component
@@ -0,0 +1,86 @@
1
+ import { type ReactElement, type ReactNode } from "react";
2
+ import { CommonProps } from "../../common/CommonProps";
3
+ import { Refable } from "../../common/Refable";
4
+ import { Size } from "../../common/Size";
5
+ import type { Styleable } from "../../common/Styleable";
6
+ import { IconButtonSize } from "../buttons/shared/IconButtonSize";
7
+ export interface CopyableValueProps extends CommonProps, Styleable, Refable<HTMLSpanElement> {
8
+ /**
9
+ * The value copied to the clipboard. It is also what is displayed, unless `children` is set.
10
+ * An empty string renders the `EmptyValue` dash with no copy button, so missing data looks the
11
+ * same as everywhere else.
12
+ */
13
+ value: string;
14
+ /**
15
+ * What to display in place of `value` — e.g. a link that stands in for the id being copied.
16
+ * The copy button still copies `value`.
17
+ */
18
+ children?: ReactNode;
19
+ /**
20
+ * Accessible label for the copy button, and tooltip text shown before copying. Defaults to the
21
+ * library's localized "Copy {value}", so the full value is available even when the displayed
22
+ * text is truncated, and every row in a table gets a distinct accessible name. Pass a short label
23
+ * that names the value (e.g. "Copy token") for long values such as tokens, keys or long URLs.
24
+ */
25
+ copyLabel?: string;
26
+ /**
27
+ * Tooltip text shown briefly after a successful copy. Defaults to the library's localized "Copied!".
28
+ */
29
+ copiedLabel?: string;
30
+ /**
31
+ * The size of the copy button. Use `extraSmall` inside fixed-height contexts such as table rows,
32
+ * where the button must fit a single text line.
33
+ *
34
+ * @default "small"
35
+ */
36
+ size?: IconButtonSize;
37
+ /**
38
+ * The text size of the displayed value.
39
+ *
40
+ * @default "medium"
41
+ */
42
+ textSize?: Size;
43
+ /**
44
+ * Places the pair inside running text, such as a sentence. The pair sits in the line as one inline
45
+ * box, and a long value wraps inside that box instead of truncating. Set `textSize` to match the
46
+ * surrounding text.
47
+ *
48
+ * @default false
49
+ */
50
+ inline?: boolean;
51
+ /**
52
+ * Called with the copied value after it has been written to the clipboard.
53
+ */
54
+ onCopy?: (value: string) => void;
55
+ }
56
+ /**
57
+ * CopyableValue displays a value as plain (non-clickable) text with a copy button beside it. While the
58
+ * button is hovered or focused, the value is highlighted together with it, so the two read as one control
59
+ * and it is clear what will be copied.
60
+ *
61
+ * ### When to use
62
+ * Use CopyableValue whenever a value such as an ID, short code, URL or token is shown and should be
63
+ * copyable — in table cells, detail lists, cards and drawers. Long values truncate to the available
64
+ * width while the full value is still copied.
65
+ *
66
+ * ### When not to use
67
+ * - Do not hand-roll a `Text` + `CopyButton` pair — this component owns the layout, truncation and highlight.
68
+ * - When copying is the primary action of a panel (e.g. an invite link), use `CopyButton` with a `label` instead.
69
+ * - Do not make the value itself click-to-copy — only the button copies, so the surrounding row or
70
+ * card stays clickable.
71
+ *
72
+ * @example Copyable account ID in a table cell
73
+ * ```tsx
74
+ * import { CopyableValue } from "@trackunit/react-components";
75
+ *
76
+ * const AccountIdCell = ({ accountId }: { accountId: string }) => (
77
+ * <CopyableValue size="extraSmall" value={accountId} />
78
+ * );
79
+ * ```
80
+ * @param {CopyableValueProps} props - The props for the CopyableValue component
81
+ * @returns {ReactElement} CopyableValue component
82
+ */
83
+ export declare const CopyableValue: {
84
+ ({ value, children, copyLabel, copiedLabel, size, textSize, inline, onCopy, className, style, "data-testid": dataTestId, ref, }: CopyableValueProps): ReactElement;
85
+ displayName: string;
86
+ };
@@ -0,0 +1,60 @@
1
+ export declare const cvaCopyableValue: import("cva").CVAComponent<Omit<{
2
+ base: string[];
3
+ variants: {
4
+ inline: {
5
+ false: string[];
6
+ true: string[];
7
+ };
8
+ };
9
+ defaultVariants: {
10
+ inline: false;
11
+ };
12
+ }, "defaultVariants"> & {
13
+ variants: {
14
+ inline: {
15
+ false: string[];
16
+ true: string[];
17
+ };
18
+ };
19
+ defaultVariants: Omit<{}, "inline"> & {
20
+ inline: false;
21
+ };
22
+ }, {
23
+ inline: {
24
+ false: string[];
25
+ true: string[];
26
+ };
27
+ }>;
28
+ export declare const cvaCopyableValueText: import("cva").CVAComponent<Omit<{
29
+ base: string[];
30
+ variants: {
31
+ inline: {
32
+ false: string[];
33
+ true: string[];
34
+ };
35
+ };
36
+ defaultVariants: {
37
+ inline: false;
38
+ };
39
+ }, "defaultVariants"> & {
40
+ variants: {
41
+ inline: {
42
+ false: string[];
43
+ true: string[];
44
+ };
45
+ };
46
+ defaultVariants: Omit<{}, "inline"> & {
47
+ inline: false;
48
+ };
49
+ }, {
50
+ inline: {
51
+ false: string[];
52
+ true: string[];
53
+ };
54
+ }>;
55
+ export declare const cvaCopyableValueButton: import("cva").CVAComponent<Omit<{
56
+ base: string[];
57
+ }, "defaultVariants"> & {
58
+ variants: unknown;
59
+ defaultVariants: Omit<{}, never>;
60
+ }, unknown>;
package/src/index.d.ts CHANGED
@@ -24,6 +24,7 @@ export * from "./components/Card/CardHeader";
24
24
  export * from "./components/Clickable/Clickable.variants";
25
25
  export * from "./components/Collapse/Collapse";
26
26
  export * from "./components/CompletionStatusIndicator/CompletionStatusIndicator";
27
+ export * from "./components/CopyableValue/CopyableValue";
27
28
  export * from "./components/CopyButton/CopyButton";
28
29
  export * from "./components/DetailsList/DetailsList";
29
30
  export * from "./components/EmptyState/EmptyState";
@@ -3,6 +3,7 @@
3
3
  var translation = {
4
4
  "breadcrumb.backButton": "Back",
5
5
  "breadcrumb.expandButton": "ausklappen",
6
+ "copyableValue.copyValue": "Copy {{value}}",
6
7
  "copyButton.copied": "Copied!",
7
8
  "copyButton.copy": "Copy",
8
9
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -1,6 +1,7 @@
1
1
  var translation = {
2
2
  "breadcrumb.backButton": "Back",
3
3
  "breadcrumb.expandButton": "ausklappen",
4
+ "copyableValue.copyValue": "Copy {{value}}",
4
5
  "copyButton.copied": "Copied!",
5
6
  "copyButton.copy": "Copy",
6
7
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -3,6 +3,7 @@
3
3
  var translation = {
4
4
  "breadcrumb.backButton": "Back",
5
5
  "breadcrumb.expandButton": "rozwiń",
6
+ "copyableValue.copyValue": "Copy {{value}}",
6
7
  "copyButton.copied": "Copied!",
7
8
  "copyButton.copy": "Copy",
8
9
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -1,6 +1,7 @@
1
1
  var translation = {
2
2
  "breadcrumb.backButton": "Back",
3
3
  "breadcrumb.expandButton": "rozwiń",
4
+ "copyableValue.copyValue": "Copy {{value}}",
4
5
  "copyButton.copied": "Copied!",
5
6
  "copyButton.copy": "Copy",
6
7
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -3,6 +3,7 @@
3
3
  var translation = {
4
4
  "breadcrumb.backButton": "Back",
5
5
  "breadcrumb.expandButton": "expandir",
6
+ "copyableValue.copyValue": "Copy {{value}}",
6
7
  "copyButton.copied": "Copied!",
7
8
  "copyButton.copy": "Copy",
8
9
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -1,6 +1,7 @@
1
1
  var translation = {
2
2
  "breadcrumb.backButton": "Back",
3
3
  "breadcrumb.expandButton": "expandir",
4
+ "copyableValue.copyValue": "Copy {{value}}",
4
5
  "copyButton.copied": "Copied!",
5
6
  "copyButton.copy": "Copy",
6
7
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -3,6 +3,7 @@
3
3
  var translation = {
4
4
  "breadcrumb.backButton": "Back",
5
5
  "breadcrumb.expandButton": "развернуть",
6
+ "copyableValue.copyValue": "Copy {{value}}",
6
7
  "copyButton.copied": "Copied!",
7
8
  "copyButton.copy": "Copy",
8
9
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -1,6 +1,7 @@
1
1
  var translation = {
2
2
  "breadcrumb.backButton": "Back",
3
3
  "breadcrumb.expandButton": "развернуть",
4
+ "copyableValue.copyValue": "Copy {{value}}",
4
5
  "copyButton.copied": "Copied!",
5
6
  "copyButton.copy": "Copy",
6
7
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -3,6 +3,7 @@
3
3
  var translation = {
4
4
  "breadcrumb.backButton": "Back",
5
5
  "breadcrumb.expandButton": "extindere",
6
+ "copyableValue.copyValue": "Copy {{value}}",
6
7
  "copyButton.copied": "Copied!",
7
8
  "copyButton.copy": "Copy",
8
9
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -1,6 +1,7 @@
1
1
  var translation = {
2
2
  "breadcrumb.backButton": "Back",
3
3
  "breadcrumb.expandButton": "extindere",
4
+ "copyableValue.copyValue": "Copy {{value}}",
4
5
  "copyButton.copied": "Copied!",
5
6
  "copyButton.copy": "Copy",
6
7
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -3,6 +3,7 @@
3
3
  var translation = {
4
4
  "breadcrumb.backButton": "Back",
5
5
  "breadcrumb.expandButton": "expandir",
6
+ "copyableValue.copyValue": "Copy {{value}}",
6
7
  "copyButton.copied": "Copied!",
7
8
  "copyButton.copy": "Copy",
8
9
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -1,6 +1,7 @@
1
1
  var translation = {
2
2
  "breadcrumb.backButton": "Back",
3
3
  "breadcrumb.expandButton": "expandir",
4
+ "copyableValue.copyValue": "Copy {{value}}",
4
5
  "copyButton.copied": "Copied!",
5
6
  "copyButton.copy": "Copy",
6
7
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -3,6 +3,7 @@
3
3
  var translation = {
4
4
  "breadcrumb.backButton": "Back",
5
5
  "breadcrumb.expandButton": "expandera",
6
+ "copyableValue.copyValue": "Copy {{value}}",
6
7
  "copyButton.copied": "Copied!",
7
8
  "copyButton.copy": "Copy",
8
9
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -1,6 +1,7 @@
1
1
  var translation = {
2
2
  "breadcrumb.backButton": "Back",
3
3
  "breadcrumb.expandButton": "expandera",
4
+ "copyableValue.copyValue": "Copy {{value}}",
4
5
  "copyButton.copied": "Copied!",
5
6
  "copyButton.copy": "Copy",
6
7
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -3,6 +3,7 @@
3
3
  var translation = {
4
4
  "breadcrumb.backButton": "Back",
5
5
  "breadcrumb.expandButton": "展開",
6
+ "copyableValue.copyValue": "Copy {{value}}",
6
7
  "copyButton.copied": "Copied!",
7
8
  "copyButton.copy": "Copy",
8
9
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -1,6 +1,7 @@
1
1
  var translation = {
2
2
  "breadcrumb.backButton": "Back",
3
3
  "breadcrumb.expandButton": "展開",
4
+ "copyableValue.copyValue": "Copy {{value}}",
4
5
  "copyButton.copied": "Copied!",
5
6
  "copyButton.copy": "Copy",
6
7
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -3,6 +3,7 @@
3
3
  var translation = {
4
4
  "breadcrumb.backButton": "Back",
5
5
  "breadcrumb.expandButton": "ขยาย",
6
+ "copyableValue.copyValue": "Copy {{value}}",
6
7
  "copyButton.copied": "Copied!",
7
8
  "copyButton.copy": "Copy",
8
9
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -1,6 +1,7 @@
1
1
  var translation = {
2
2
  "breadcrumb.backButton": "Back",
3
3
  "breadcrumb.expandButton": "ขยาย",
4
+ "copyableValue.copyValue": "Copy {{value}}",
4
5
  "copyButton.copied": "Copied!",
5
6
  "copyButton.copy": "Copy",
6
7
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -3,6 +3,7 @@
3
3
  var translation = {
4
4
  "breadcrumb.backButton": "Back",
5
5
  "breadcrumb.expandButton": "udvid",
6
+ "copyableValue.copyValue": "Copy {{value}}",
6
7
  "copyButton.copied": "Copied!",
7
8
  "copyButton.copy": "Copy",
8
9
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -1,6 +1,7 @@
1
1
  var translation = {
2
2
  "breadcrumb.backButton": "Back",
3
3
  "breadcrumb.expandButton": "udvid",
4
+ "copyableValue.copyValue": "Copy {{value}}",
4
5
  "copyButton.copied": "Copied!",
5
6
  "copyButton.copy": "Copy",
6
7
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -3,6 +3,7 @@
3
3
  var translation = {
4
4
  "breadcrumb.backButton": "Back",
5
5
  "breadcrumb.expandButton": "rozbalit",
6
+ "copyableValue.copyValue": "Copy {{value}}",
6
7
  "copyButton.copied": "Copied!",
7
8
  "copyButton.copy": "Copy",
8
9
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -1,6 +1,7 @@
1
1
  var translation = {
2
2
  "breadcrumb.backButton": "Back",
3
3
  "breadcrumb.expandButton": "rozbalit",
4
+ "copyableValue.copyValue": "Copy {{value}}",
4
5
  "copyButton.copied": "Copied!",
5
6
  "copyButton.copy": "Copy",
6
7
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -3,6 +3,7 @@
3
3
  var translation = {
4
4
  "breadcrumb.backButton": "Back",
5
5
  "breadcrumb.expandButton": "uitklappen",
6
+ "copyableValue.copyValue": "Copy {{value}}",
6
7
  "copyButton.copied": "Copied!",
7
8
  "copyButton.copy": "Copy",
8
9
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -1,6 +1,7 @@
1
1
  var translation = {
2
2
  "breadcrumb.backButton": "Back",
3
3
  "breadcrumb.expandButton": "uitklappen",
4
+ "copyableValue.copyValue": "Copy {{value}}",
4
5
  "copyButton.copied": "Copied!",
5
6
  "copyButton.copy": "Copy",
6
7
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -3,6 +3,7 @@
3
3
  var translation = {
4
4
  "breadcrumb.backButton": "Back",
5
5
  "breadcrumb.expandButton": "développer",
6
+ "copyableValue.copyValue": "Copy {{value}}",
6
7
  "copyButton.copied": "Copied!",
7
8
  "copyButton.copy": "Copy",
8
9
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -1,6 +1,7 @@
1
1
  var translation = {
2
2
  "breadcrumb.backButton": "Back",
3
3
  "breadcrumb.expandButton": "développer",
4
+ "copyableValue.copyValue": "Copy {{value}}",
4
5
  "copyButton.copied": "Copied!",
5
6
  "copyButton.copy": "Copy",
6
7
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -3,6 +3,7 @@
3
3
  var translation = {
4
4
  "breadcrumb.backButton": "Back",
5
5
  "breadcrumb.expandButton": "laajenna",
6
+ "copyableValue.copyValue": "Copy {{value}}",
6
7
  "copyButton.copied": "Copied!",
7
8
  "copyButton.copy": "Copy",
8
9
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -1,6 +1,7 @@
1
1
  var translation = {
2
2
  "breadcrumb.backButton": "Back",
3
3
  "breadcrumb.expandButton": "laajenna",
4
+ "copyableValue.copyValue": "Copy {{value}}",
4
5
  "copyButton.copied": "Copied!",
5
6
  "copyButton.copy": "Copy",
6
7
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -3,6 +3,7 @@
3
3
  var translation = {
4
4
  "breadcrumb.backButton": "Back",
5
5
  "breadcrumb.expandButton": "kibontás",
6
+ "copyableValue.copyValue": "Copy {{value}}",
6
7
  "copyButton.copied": "Copied!",
7
8
  "copyButton.copy": "Copy",
8
9
  "horizontalOverflowScroller.scrollLeft": "Scroll left",
@@ -1,6 +1,7 @@
1
1
  var translation = {
2
2
  "breadcrumb.backButton": "Back",
3
3
  "breadcrumb.expandButton": "kibontás",
4
+ "copyableValue.copyValue": "Copy {{value}}",
4
5
  "copyButton.copied": "Copied!",
5
6
  "copyButton.copy": "Copy",
6
7
  "horizontalOverflowScroller.scrollLeft": "Scroll left",