@pantheon-systems/pds-toolkit-react 2.0.0-alpha.36 → 2.0.0-alpha.38

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 (166) hide show
  1. package/codemods/v1-to-v2/mappings.json +319 -41
  2. package/codemods/v1-to-v2/transforms/__testfixtures__/component-renames/basic.input.tsx +33 -0
  3. package/codemods/v1-to-v2/transforms/__testfixtures__/component-renames/basic.output.tsx +33 -0
  4. package/codemods/v1-to-v2/transforms/__testfixtures__/component-renames/only.input.tsx +8 -0
  5. package/codemods/v1-to-v2/transforms/__testfixtures__/component-renames/only.output.tsx +8 -0
  6. package/codemods/v1-to-v2/transforms/__testfixtures__/css-class-removals/basic.input.tsx +31 -0
  7. package/codemods/v1-to-v2/transforms/__testfixtures__/css-class-removals/basic.output.tsx +31 -0
  8. package/codemods/v1-to-v2/transforms/__testfixtures__/css-class-renames/basic.input.tsx +31 -0
  9. package/codemods/v1-to-v2/transforms/__testfixtures__/css-class-renames/basic.output.tsx +31 -0
  10. package/codemods/v1-to-v2/transforms/__testfixtures__/icon-name-updates/basic.input.tsx +35 -0
  11. package/codemods/v1-to-v2/transforms/__testfixtures__/icon-name-updates/basic.output.tsx +35 -0
  12. package/codemods/v1-to-v2/transforms/__testfixtures__/icon-name-updates/only.input.tsx +8 -0
  13. package/codemods/v1-to-v2/transforms/__testfixtures__/icon-name-updates/only.output.tsx +8 -0
  14. package/codemods/v1-to-v2/transforms/__testfixtures__/prop-renames/basic.input.tsx +28 -0
  15. package/codemods/v1-to-v2/transforms/__testfixtures__/prop-renames/basic.output.tsx +28 -0
  16. package/codemods/v1-to-v2/transforms/__testfixtures__/prop-renames/only.input.tsx +8 -0
  17. package/codemods/v1-to-v2/transforms/__testfixtures__/prop-renames/only.output.tsx +8 -0
  18. package/codemods/v1-to-v2/transforms/__testfixtures__/prop-value-standardization/basic.output.tsx +10 -10
  19. package/codemods/v1-to-v2/transforms/__testfixtures__/prop-value-standardization/only.input.tsx +21 -0
  20. package/codemods/v1-to-v2/transforms/__testfixtures__/prop-value-standardization/only.output.tsx +21 -0
  21. package/codemods/v1-to-v2/transforms/__testfixtures__/removed-prop-values/basic.input.tsx +60 -0
  22. package/codemods/v1-to-v2/transforms/__testfixtures__/removed-prop-values/basic.output.tsx +51 -0
  23. package/codemods/v1-to-v2/transforms/__testfixtures__/removed-prop-values/only.input.tsx +8 -0
  24. package/codemods/v1-to-v2/transforms/__testfixtures__/removed-prop-values/only.output.tsx +8 -0
  25. package/codemods/v1-to-v2/transforms/__tests__/component-renames.test.js +15 -0
  26. package/codemods/v1-to-v2/transforms/__tests__/css-class-removals.test.js +6 -0
  27. package/codemods/v1-to-v2/transforms/__tests__/css-class-renames.test.js +6 -0
  28. package/codemods/v1-to-v2/transforms/__tests__/icon-name-updates.test.js +15 -0
  29. package/codemods/v1-to-v2/transforms/__tests__/prop-renames.test.js +15 -0
  30. package/codemods/v1-to-v2/transforms/__tests__/prop-value-standardization.test.js +10 -0
  31. package/codemods/v1-to-v2/transforms/__tests__/removed-prop-values.test.js +15 -0
  32. package/codemods/v1-to-v2/transforms/component-renames.js +166 -0
  33. package/codemods/v1-to-v2/transforms/css-class-removals.js +192 -0
  34. package/codemods/v1-to-v2/transforms/css-class-renames.js +114 -0
  35. package/codemods/v1-to-v2/transforms/icon-name-updates.js +124 -0
  36. package/codemods/v1-to-v2/transforms/prop-renames.js +109 -0
  37. package/codemods/v1-to-v2/transforms/prop-value-standardization.js +33 -2
  38. package/codemods/v1-to-v2/transforms/removed-prop-values.js +206 -0
  39. package/dist/components/Callout/Callout.d.ts +6 -2
  40. package/dist/components/CodeBlock/CodeBlock.d.ts +10 -5
  41. package/dist/components/CodeBlock/code-examples.d.ts +1 -0
  42. package/dist/components/CodeBlock/themes/index.d.ts +1 -2
  43. package/dist/components/CodeBlock/themes/{pdsDark.d.ts → pds.d.ts} +1 -1
  44. package/dist/components/Dropdown/Dropdown.d.ts +46 -0
  45. package/dist/components/PantheonLogo/PantheonLogo.d.ts +5 -4
  46. package/dist/components/SiteFooter/SiteFooter.d.ts +4 -1
  47. package/dist/components/Tabs/Tabs.d.ts +1 -6
  48. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  49. package/dist/components/UtilityBar/UtilityBar.d.ts +2 -3
  50. package/dist/components/badges/StatusBadge/StatusBadge.d.ts +2 -1
  51. package/dist/components/buttons/CloseButton/CloseButton.d.ts +2 -2
  52. package/dist/components/buttons/FilterButton/FilterButton.d.ts +82 -0
  53. package/dist/components/buttons/MenuButton/MenuButton.d.ts +1 -1
  54. package/dist/components/buttons/SegmentedButton/SegmentedButton.d.ts +28 -4
  55. package/dist/components/buttons/SplitButton/SplitButton.d.ts +1 -1
  56. package/dist/components/cards/ActionCard/ActionCard.d.ts +2 -2
  57. package/dist/components/cards/Card/Card.d.ts +2 -2
  58. package/dist/components/icons/Icon/custom-icons.d.ts +1 -1
  59. package/dist/components/icons/Icon/generated-icon-data.d.ts +114 -30
  60. package/dist/components/inputs/Combobox/Combobox.d.ts +1 -1
  61. package/dist/components/inputs/ComboboxMultiselect/ComboboxMultiselect.d.ts +1 -1
  62. package/dist/components/inputs/Select/Select.d.ts +1 -1
  63. package/dist/components/inputs/TagsInput/TagsInput.d.ts +1 -1
  64. package/dist/components/inputs/TextInput/TextInput.d.ts +1 -1
  65. package/dist/components/inputs/Textarea/Textarea.d.ts +1 -1
  66. package/dist/components/loading-indicators/Spinner/Spinner.d.ts +5 -4
  67. package/dist/components/navigation/ButtonNav/ButtonNav.d.ts +1 -5
  68. package/dist/components/navigation/Navbar/Navbar.d.ts +9 -21
  69. package/dist/components/navigation/TabMenu/TabMenu.d.ts +1 -6
  70. package/dist/components/navigation/WorkspaceSelector/WorkspaceSelector.d.ts +0 -11
  71. package/dist/components/panels/Panel/Panel.d.ts +3 -3
  72. package/dist/css/component-css/pds-action-card.css +1 -1
  73. package/dist/css/component-css/pds-avatar.css +1 -1
  74. package/dist/css/component-css/pds-button-nav.css +1 -1
  75. package/dist/css/component-css/pds-button.css +1 -1
  76. package/dist/css/component-css/pds-callout.css +1 -1
  77. package/dist/css/component-css/pds-card-select.css +1 -1
  78. package/dist/css/component-css/pds-card.css +1 -1
  79. package/dist/css/component-css/pds-checkbox.css +1 -1
  80. package/dist/css/component-css/pds-close-button.css +1 -1
  81. package/dist/css/component-css/pds-code-block.css +1 -1
  82. package/dist/css/component-css/pds-combobox-multiselect.css +1 -2
  83. package/dist/css/component-css/pds-combobox.css +1 -1
  84. package/dist/css/component-css/pds-datepicker.css +3 -1
  85. package/dist/css/component-css/pds-dropdown.css +2 -2
  86. package/dist/css/component-css/pds-filter-button.css +1 -0
  87. package/dist/css/component-css/pds-icon.css +1 -1
  88. package/dist/css/component-css/pds-index.css +51 -45
  89. package/dist/css/component-css/pds-input-utilities.css +1 -1
  90. package/dist/css/component-css/pds-menu-button.css +4 -1
  91. package/dist/css/component-css/pds-nav-menu.css +1 -1
  92. package/dist/css/component-css/pds-navbar.css +2 -2
  93. package/dist/css/component-css/pds-panel.css +1 -1
  94. package/dist/css/component-css/pds-pantheon-logo.css +1 -1
  95. package/dist/css/component-css/pds-popover.css +1 -1
  96. package/dist/css/component-css/pds-radio-group.css +1 -1
  97. package/dist/css/component-css/pds-segmented-button.css +2 -1
  98. package/dist/css/component-css/pds-select.css +1 -1
  99. package/dist/css/component-css/pds-side-nav-global.css +1 -1
  100. package/dist/css/component-css/pds-side-nav.css +1 -1
  101. package/dist/css/component-css/pds-site-footer.css +1 -1
  102. package/dist/css/component-css/pds-site-search.css +1 -1
  103. package/dist/css/component-css/pds-spinner.css +1 -1
  104. package/dist/css/component-css/pds-split-button.css +1 -1
  105. package/dist/css/component-css/pds-status-badge.css +1 -1
  106. package/dist/css/component-css/pds-status-indicator.css +1 -1
  107. package/dist/css/component-css/pds-switch.css +2 -2
  108. package/dist/css/component-css/pds-tab-menu.css +1 -1
  109. package/dist/css/component-css/pds-tabs.css +1 -1
  110. package/dist/css/component-css/pds-tags-input.css +1 -1
  111. package/dist/css/component-css/pds-text-input.css +1 -1
  112. package/dist/css/component-css/pds-textarea.css +1 -1
  113. package/dist/css/component-css/pds-toaster.css +1 -1
  114. package/dist/css/component-css/pds-user-menu.css +6 -3
  115. package/dist/css/component-css/pds-utility-bar.css +1 -1
  116. package/dist/css/component-css/pds-utility-button.css +1 -1
  117. package/dist/css/component-css/pds-vertical-empty-state.css +1 -1
  118. package/dist/css/component-css/pds-workspace-selector.css +13 -3
  119. package/dist/css/design-tokens/variables.dark.css +26 -21
  120. package/dist/css/design-tokens/variables.global.css +0 -1
  121. package/dist/css/design-tokens/variables.light.css +26 -21
  122. package/dist/css/design-tokens/variables.typography.css +0 -1
  123. package/dist/css/layout-css/pds-app-layout.css +5 -2
  124. package/dist/css/layout-css/pds-index.css +5 -2
  125. package/dist/css/layout-css/pds-sidebar-layout.css +1 -1
  126. package/dist/css/pds-components.css +51 -45
  127. package/dist/css/pds-core.css +2 -2
  128. package/dist/css/pds-layouts.css +5 -2
  129. package/dist/index.css +1 -1
  130. package/dist/index.d.ts +4 -2
  131. package/dist/index.js +3090 -1859
  132. package/dist/index.js.map +1 -1
  133. package/dist/index.source.d.ts +3 -2
  134. package/dist/layouts/AppLayout/AppLayout.d.ts +22 -2
  135. package/dist/layouts/SidebarLayout/SidebarLayout.d.ts +4 -3
  136. package/dist/layouts/ThreeItemLayout/ThreeItemLayout.d.ts +3 -3
  137. package/dist/layouts/TwoItemLayout/TwoItemLayout.d.ts +3 -3
  138. package/dist/libs/components/NavAccordion/NavAccordion.d.ts +1 -1
  139. package/dist/libs/types/custom-types.d.ts +1 -1
  140. package/dist/libs/types/layout-types.d.ts +2 -1
  141. package/dist/svg/circleHalfStroke.svg +3 -0
  142. package/dist/svg/claude.svg +3 -0
  143. package/dist/svg/clock.svg +3 -0
  144. package/dist/svg/diagramVenn.svg +3 -0
  145. package/dist/svg/floppyDisk.svg +3 -0
  146. package/dist/svg/grid.svg +2 -2
  147. package/dist/svg/grid2.svg +3 -0
  148. package/dist/svg/octagonExclamation.svg +3 -0
  149. package/dist/svg/openai.svg +3 -0
  150. package/dist/svg/slider.svg +3 -0
  151. package/dist/svg/squareDashed.svg +3 -0
  152. package/dist/svg/tableColumns.svg +3 -0
  153. package/dist/svg/userSolid.svg +3 -0
  154. package/dist/utilities/FlexContainer/FlexContainer.d.ts +5 -6
  155. package/dist/utilities/grid/Grid.d.ts +58 -0
  156. package/dist/utilities/grid/GridItem.d.ts +57 -0
  157. package/package.json +2 -2
  158. package/dist/components/CodeBlock/themes/pdsLight.d.ts +0 -2
  159. package/dist/components/notifications/NotificationHubIcon/NotificationHubIcon.d.ts +0 -38
  160. package/dist/components/notifications/NotificationsPopover/NotificationsPopover.d.ts +0 -113
  161. package/dist/css/component-css/pds-notification-hub-icon.css +0 -1
  162. package/dist/css/component-css/pds-notifications-popover.css +0 -13
  163. /package/dist/svg/{arrowDownLeftAndArrowUpRightToCenter.svg → collapseToCenter.svg} +0 -0
  164. /package/dist/svg/{linkSimple.svg → link.svg} +0 -0
  165. /package/dist/svg/{arrowsUpDownLeftRight.svg → move.svg} +0 -0
  166. /package/dist/svg/{linkSimpleSlash.svg → unlink.svg} +0 -0
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import {
3
+ Badge,
4
+ SiteMenu,
5
+ StatusChecker,
6
+ StepList,
7
+ CardSelect,
8
+ SiteSearch,
9
+ TreeNav,
10
+ } from '@pantheon-systems/pds-toolkit-react';
11
+ // Aliased import — imported name changes, local alias and JSX stay the same
12
+ import { Badge as LegacyBadge } from '@pantheon-systems/pds-toolkit-react';
13
+ // Non-PDS import with the same name — untouched
14
+ import { IndicatorBadge as ThirdPartyBadge } from 'some-other-library';
15
+ // Deep path import — path and specifier name should both be updated
16
+ import { Badge as DeepBadge } from "@pantheon-systems/pds-toolkit-react/components/badges/Badge/Badge";
17
+ // Deep path aliased import — path and imported name updated, local alias preserved
18
+ import { Badge as LegacyDeepBadge } from "@pantheon-systems/pds-toolkit-react/components/badges/Badge/Badge";
19
+
20
+ // Non-aliased — both import specifier and JSX tags should be renamed
21
+ const A = () => <Badge color='blue' label='v1 badge' />;
22
+ const B = () => <SiteMenu ariaLabel='Main nav' menuItems={[]} />;
23
+ const C = () => <StatusChecker />;
24
+ const D = () => <StepList steps={[]} />;
25
+ const E = () => <CardSelect options={[]} />;
26
+ const F = () => <SiteSearch id='search' label='Search' siteList={[]} />;
27
+ const G = () => <TreeNav items={[]} />;
28
+
29
+ // Aliased — only the import specifier changes, JSX stays as <LegacyBadge>
30
+ const H = () => <LegacyBadge color='blue' label='aliased' />;
31
+
32
+ // Non-PDS import — untouched
33
+ const I = () => <ThirdPartyBadge />;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { IndicatorBadge, NavMenu } from '@pantheon-systems/pds-toolkit-react';
3
+
4
+ // IndicatorBadge — matches --only=IndicatorBadge, should be renamed
5
+ const A = () => <IndicatorBadge color='blue' label='v1 badge' />;
6
+
7
+ // NavMenu — not in --only list, should be left alone
8
+ const B = () => <NavMenu ariaLabel='Main nav' menuItems={[]} />;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { Badge, NavMenu } from '@pantheon-systems/pds-toolkit-react';
3
+
4
+ // IndicatorBadge — matches --only=IndicatorBadge, should be renamed
5
+ const A = () => <Badge color='blue' label='v1 badge' />;
6
+
7
+ // NavMenu — not in --only list, should be left alone
8
+ const B = () => <NavMenu ariaLabel='Main nav' menuItems={[]} />;
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+
3
+ // Direct renames — replaced automatically
4
+ const A = () => <div className='pds-button--navbar' />;
5
+ const B = () => <div className='pds-ts-9xl heading' />;
6
+
7
+ // Safe removal — removed automatically (product is now the default context)
8
+ const C = () => <div className='pds-typography--product body-text' />;
9
+
10
+ // Mixed: rename + safe removal in one className
11
+ const D = () => <div className='pds-button--navbar pds-typography--product foo' />;
12
+
13
+ // Template literal with direct rename
14
+ const E = ({ active }: { active: boolean }) => (
15
+ <div className={`pds-button--navbar ${active ? 'is-active' : ''}`} />
16
+ );
17
+
18
+ // Flag only — left in place, warning emitted
19
+ const F = () => <div className='pds-color-bg-brand header' />;
20
+ const G = () => <div className='pds-lead-text intro' />;
21
+ const H = () => <div className='pds-quote-text pullquote' />;
22
+
23
+ // JSX expression container
24
+ const I = () => <div className={'pds-button--navbar extra'} />;
25
+
26
+ // Already correct — should be left alone
27
+ const J = () => <div className='pds-button--subtle' />;
28
+
29
+ // Dynamic class — cannot transform, leave as-is
30
+ const cls = 'pds-button--navbar';
31
+ const K = () => <div className={cls} />;
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+
3
+ // Direct renames — replaced automatically
4
+ const A = () => <div className="pds-button--subtle" />;
5
+ const B = () => <div className="pds-ts-8xl heading" />;
6
+
7
+ // Safe removal — removed automatically (product is now the default context)
8
+ const C = () => <div className="body-text" />;
9
+
10
+ // Mixed: rename + safe removal in one className
11
+ const D = () => <div className="pds-button--subtle foo" />;
12
+
13
+ // Template literal with direct rename
14
+ const E = ({ active }: { active: boolean }) => (
15
+ <div className={`pds-button--subtle ${active ? 'is-active' : ''}`} />
16
+ );
17
+
18
+ // Flag only — left in place, warning emitted
19
+ const F = () => <div className='pds-color-bg-brand header' />;
20
+ const G = () => <div className='pds-lead-text intro' />;
21
+ const H = () => <div className='pds-quote-text pullquote' />;
22
+
23
+ // JSX expression container
24
+ const I = () => <div className={"pds-button--subtle extra"} />;
25
+
26
+ // Already correct — should be left alone
27
+ const J = () => <div className='pds-button--subtle' />;
28
+
29
+ // Dynamic class — cannot transform, leave as-is
30
+ const cls = 'pds-button--navbar';
31
+ const K = () => <div className={cls} />;
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+
3
+ // String literal — single class
4
+ const A = () => <div className='pds-overline-text' />;
5
+
6
+ // String literal — multiple classes, variant classes must not be mangled
7
+ const B = () => <div className='pds-overline-text--sm foo pds-overline-text--lg' />;
8
+
9
+ // String literal — old and variant together
10
+ const C = () => <div className='pds-overline-text pds-overline-text--sm bar' />;
11
+
12
+ // JSX expression container with string literal
13
+ const D = () => <div className={'pds-overline-text'} />;
14
+
15
+ // Template literal — static part
16
+ const E = () => <div className={`pds-overline-text extra-class`} />;
17
+
18
+ // Template literal — with interpolation
19
+ const F = ({ active }: { active: boolean }) => (
20
+ <div className={`pds-overline-text--lg ${active ? 'is-active' : ''}`} />
21
+ );
22
+
23
+ // Already correct — should be left alone
24
+ const G = () => <div className='pds-overline-m' />;
25
+
26
+ // Dynamic class — cannot transform, leave as-is
27
+ const cls = 'pds-overline-text';
28
+ const H = () => <div className={cls} />;
29
+
30
+ // Non-className attribute — should be left alone
31
+ const I = () => <div id='pds-overline-text' />;
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+
3
+ // String literal — single class
4
+ const A = () => <div className="pds-overline-m" />;
5
+
6
+ // String literal — multiple classes, variant classes must not be mangled
7
+ const B = () => <div className="pds-overline-s foo pds-overline-l" />;
8
+
9
+ // String literal — old and variant together
10
+ const C = () => <div className="pds-overline-m pds-overline-s bar" />;
11
+
12
+ // JSX expression container with string literal
13
+ const D = () => <div className={"pds-overline-m"} />;
14
+
15
+ // Template literal — static part
16
+ const E = () => <div className={`pds-overline-m extra-class`} />;
17
+
18
+ // Template literal — with interpolation
19
+ const F = ({ active }: { active: boolean }) => (
20
+ <div className={`pds-overline-l ${active ? 'is-active' : ''}`} />
21
+ );
22
+
23
+ // Already correct — should be left alone
24
+ const G = () => <div className='pds-overline-m' />;
25
+
26
+ // Dynamic class — cannot transform, leave as-is
27
+ const cls = 'pds-overline-text';
28
+ const H = () => <div className={cls} />;
29
+
30
+ // Non-className attribute — should be left alone
31
+ const I = () => <div id='pds-overline-text' />;
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import {
3
+ Button,
4
+ ButtonLink,
5
+ Icon,
6
+ IconButton,
7
+ } from '@pantheon-systems/pds-toolkit-react';
8
+ // Aliased import
9
+ import { Icon as PdsIcon } from '@pantheon-systems/pds-toolkit-react';
10
+
11
+ // Icon component — renamed icons should be updated
12
+ const A = () => <Icon iconName='circlePlusOutline' />;
13
+ const B = () => <Icon iconName='circleMinusOutline' />;
14
+ const C = () => <Icon iconName='globeLine' />;
15
+
16
+ // Other PDS components using the same registry — should also be updated
17
+ const D = () => <Button iconName='circlePlusOutline' label='Add' />;
18
+ const E = () => <ButtonLink iconName='globeLine' linkContent={<a href='/'>Home</a>} />;
19
+ const F = () => <IconButton iconName='circleMinusOutline' label='Remove' />;
20
+
21
+ // JSX expression container — should also be updated
22
+ const G = () => <Icon iconName={'circlePlusOutline'} />;
23
+
24
+ // Aliased import — should still be updated
25
+ const H = () => <PdsIcon iconName='globeLine' />;
26
+
27
+ // Already correct — should be left alone
28
+ const I = () => <Icon iconName='circlePlus' />;
29
+
30
+ // Dynamic value — cannot transform, leave as-is
31
+ const myIcon = 'circlePlusOutline';
32
+ const J = () => <Icon iconName={myIcon} />;
33
+
34
+ // Non-PDS component — should be left alone
35
+ const K = () => <div iconName='circlePlusOutline' />;
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import {
3
+ Button,
4
+ ButtonLink,
5
+ Icon,
6
+ IconButton,
7
+ } from '@pantheon-systems/pds-toolkit-react';
8
+ // Aliased import
9
+ import { Icon as PdsIcon } from '@pantheon-systems/pds-toolkit-react';
10
+
11
+ // Icon component — renamed icons should be updated
12
+ const A = () => <Icon iconName="circlePlus" />;
13
+ const B = () => <Icon iconName="circleMinus" />;
14
+ const C = () => <Icon iconName="globe" />;
15
+
16
+ // Other PDS components using the same registry — should also be updated
17
+ const D = () => <Button iconName="circlePlus" label='Add' />;
18
+ const E = () => <ButtonLink iconName="globe" linkContent={<a href='/'>Home</a>} />;
19
+ const F = () => <IconButton iconName="circleMinus" label='Remove' />;
20
+
21
+ // JSX expression container — should also be updated
22
+ const G = () => <Icon iconName={"circlePlus"} />;
23
+
24
+ // Aliased import — should still be updated
25
+ const H = () => <PdsIcon iconName="globe" />;
26
+
27
+ // Already correct — should be left alone
28
+ const I = () => <Icon iconName='circlePlus' />;
29
+
30
+ // Dynamic value — cannot transform, leave as-is
31
+ const myIcon = 'circlePlusOutline';
32
+ const J = () => <Icon iconName={myIcon} />;
33
+
34
+ // Non-PDS component — should be left alone
35
+ const K = () => <div iconName='circlePlusOutline' />;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { Icon, Button } from '@pantheon-systems/pds-toolkit-react';
3
+
4
+ // Icon — matches --only=Icon, should be updated
5
+ const A = () => <Icon iconName='circlePlusOutline' />;
6
+
7
+ // Button — not in --only list, should be left alone
8
+ const B = () => <Button iconName='circlePlusOutline' label='Add' />;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { Icon, Button } from '@pantheon-systems/pds-toolkit-react';
3
+
4
+ // Icon — matches --only=Icon, should be updated
5
+ const A = () => <Icon iconName="circlePlus" />;
6
+
7
+ // Button — not in --only list, should be left alone
8
+ const B = () => <Button iconName='circlePlusOutline' label='Add' />;
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import {
3
+ Button,
4
+ CloseButton,
5
+ FileDiff,
6
+ GlobalWrapper,
7
+ Icon,
8
+ } from '@pantheon-systems/pds-toolkit-react';
9
+ // Aliased import
10
+ import { Icon as PdsIcon } from '@pantheon-systems/pds-toolkit-react';
11
+
12
+ // Simple renames
13
+ const A = () => <Button isLoading />;
14
+ const B = () => <GlobalWrapper mobileMenuMaxWidth={767} />;
15
+ const C = () => <FileDiff labelStrings={{ add: 'Added', remove: 'Removed' }} />;
16
+
17
+ // Same old prop name, different components — both should rename
18
+ const D = () => <Icon iconSize='m' iconName='star' />;
19
+ const E = () => <CloseButton iconSize='l' />;
20
+
21
+ // Aliased import — should still rename
22
+ const F = () => <PdsIcon iconSize='s' iconName='gear' />;
23
+
24
+ // Already correct — should be left alone
25
+ const G = () => <Button isWorking />;
26
+
27
+ // Non-PDS component — should be left alone
28
+ const H = () => <div isLoading />;
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import {
3
+ Button,
4
+ CloseButton,
5
+ FileDiff,
6
+ GlobalWrapper,
7
+ Icon,
8
+ } from '@pantheon-systems/pds-toolkit-react';
9
+ // Aliased import
10
+ import { Icon as PdsIcon } from '@pantheon-systems/pds-toolkit-react';
11
+
12
+ // Simple renames
13
+ const A = () => <Button isWorking />;
14
+ const B = () => <GlobalWrapper mobileMaxWidth={767} />;
15
+ const C = () => <FileDiff translationStrings={{ add: 'Added', remove: 'Removed' }} />;
16
+
17
+ // Same old prop name, different components — both should rename
18
+ const D = () => <Icon size='m' iconName='star' />;
19
+ const E = () => <CloseButton size='l' />;
20
+
21
+ // Aliased import — should still rename
22
+ const F = () => <PdsIcon size='s' iconName='gear' />;
23
+
24
+ // Already correct — should be left alone
25
+ const G = () => <Button isWorking />;
26
+
27
+ // Non-PDS component — should be left alone
28
+ const H = () => <div isLoading />;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { Button, Icon } from '@pantheon-systems/pds-toolkit-react';
3
+
4
+ // Button — matches --only=Button, should be renamed
5
+ const A = () => <Button isLoading />;
6
+
7
+ // Icon — not in --only list, should be left alone
8
+ const B = () => <Icon iconSize='m' iconName='star' />;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { Button, Icon } from '@pantheon-systems/pds-toolkit-react';
3
+
4
+ // Button — matches --only=Button, should be renamed
5
+ const A = () => <Button isWorking />;
6
+
7
+ // Icon — not in --only list, should be left alone
8
+ const B = () => <Icon iconSize='m' iconName='star' />;
@@ -9,19 +9,19 @@ import {
9
9
  import { IconButton as PdsIconButton } from '@pantheon-systems/pds-toolkit-react';
10
10
 
11
11
  // String literals — should be updated
12
- const A = () => <Spinner size='s' />;
13
- const B = () => <Spinner size='m' />;
14
- const C = () => <Spinner size='l' />;
15
- const D = () => <Avatar size='s' />;
16
- const E = () => <Avatar size='m' />;
12
+ const A = () => <Spinner size="s" />;
13
+ const B = () => <Spinner size="m" />;
14
+ const C = () => <Spinner size="l" />;
15
+ const D = () => <Avatar size="s" />;
16
+ const E = () => <Avatar size="m" />;
17
17
  // StatusIndicator has a different mapping: sm→xs, md→s
18
- const F = () => <StatusIndicator size='xs' />;
19
- const G = () => <StatusIndicator size='s' />;
18
+ const F = () => <StatusIndicator size="xs" />;
19
+ const G = () => <StatusIndicator size="s" />;
20
20
  // Aliased import
21
- const H = () => <PdsIconButton size='s' />;
21
+ const H = () => <PdsIconButton size="s" />;
22
22
 
23
23
  // JSX expression container — should also be updated
24
- const I = () => <Badge size={'s'} />;
24
+ const I = () => <Badge size={"s"} />;
25
25
 
26
26
  // Already correct — should be left alone
27
27
  const J = () => <Spinner size='s' />;
@@ -33,4 +33,4 @@ const K = () => <Spinner size={mySize} />;
33
33
  const L = () => <div size='sm' />;
34
34
 
35
35
  // Tooltip uses a different prop name: triggerIconSize
36
- const M = () => <Tooltip triggerIconSize='s' />;
36
+ const M = () => <Tooltip triggerIconSize="s" />;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import {
3
+ Spinner,
4
+ Avatar,
5
+ StatusIndicator,
6
+ Badge,
7
+ Tooltip,
8
+ } from '@pantheon-systems/pds-toolkit-react';
9
+ import { IconButton as PdsIconButton } from '@pantheon-systems/pds-toolkit-react';
10
+
11
+ // Spinner — matches --only=Spinner, should be updated
12
+ const A = () => <Spinner size='sm' />;
13
+ const B = () => <Spinner size='md' />;
14
+ const C = () => <Spinner size='lg' />;
15
+
16
+ // Other PDS components — not in --only list, should be left alone
17
+ const D = () => <Avatar size='sm' />;
18
+ const E = () => <StatusIndicator size='sm' />;
19
+ const F = () => <Badge size={'sm'} />;
20
+ const G = () => <PdsIconButton size='sm' />;
21
+ const H = () => <Tooltip triggerIconSize='sm' />;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import {
3
+ Spinner,
4
+ Avatar,
5
+ StatusIndicator,
6
+ Badge,
7
+ Tooltip,
8
+ } from '@pantheon-systems/pds-toolkit-react';
9
+ import { IconButton as PdsIconButton } from '@pantheon-systems/pds-toolkit-react';
10
+
11
+ // Spinner — matches --only=Spinner, should be updated
12
+ const A = () => <Spinner size="s" />;
13
+ const B = () => <Spinner size="m" />;
14
+ const C = () => <Spinner size="l" />;
15
+
16
+ // Other PDS components — not in --only list, should be left alone
17
+ const D = () => <Avatar size='sm' />;
18
+ const E = () => <StatusIndicator size='sm' />;
19
+ const F = () => <Badge size={'sm'} />;
20
+ const G = () => <PdsIconButton size='sm' />;
21
+ const H = () => <Tooltip triggerIconSize='sm' />;
@@ -0,0 +1,60 @@
1
+ import React from 'react';
2
+ import {
3
+ Avatar,
4
+ Button,
5
+ Card,
6
+ CodeBlock,
7
+ IconButton,
8
+ MenuButton,
9
+ Panel,
10
+ Spinner,
11
+ Switch,
12
+ } from '@pantheon-systems/pds-toolkit-react';
13
+
14
+ // Value rewrites — prop stays, value changes
15
+ const A = () => <Button variant='brand-secondary'>Click</Button>;
16
+ const B = () => <Button variant='navbar'>Click</Button>;
17
+ const C = () => (
18
+ <MenuButton variant='navbar' id='menu' label='Menu' menuItems={[]} />
19
+ );
20
+ const D = () => (
21
+ <IconButton variant='critical-hover' iconName='x' label='Close' />
22
+ );
23
+ const E = () => <Avatar size='xl' />;
24
+
25
+ // JSX expression container value rewrite
26
+ const F = () => <Button variant={'brand-secondary'}>Click</Button>;
27
+
28
+ // Unconditional prop removals
29
+ const G = () => <Spinner colorType='full-color' />;
30
+ const H = () => <CodeBlock colorType='dark' />;
31
+ const I = () => (
32
+ <Panel
33
+ hasStatusIndicator
34
+ statusType='success'
35
+ typeLabels={{ success: 'OK' }}
36
+ />
37
+ );
38
+ const J = () => (
39
+ <Switch
40
+ showStatusLabel
41
+ statusLabelPlacement='end'
42
+ onLabel='On'
43
+ offLabel='Off'
44
+ />
45
+ );
46
+
47
+ // Conditional removal — remove only deprecated gradient values, leave valid values alone
48
+ const K = () => <Card background='mint-gradient' />;
49
+ const L = () => <Card background='sundown-gradient' />;
50
+ const M = () => <Card background='default' />;
51
+
52
+ // Already correct — should be left alone
53
+ const N = () => <Button variant='secondary'>Click</Button>;
54
+
55
+ // Non-PDS component — should be left alone
56
+ const O = () => <div variant='brand-secondary' />;
57
+
58
+ // Dynamic value — cannot transform, leave as-is
59
+ const myVariant = 'brand-secondary';
60
+ const P = () => <Button variant={myVariant}>Click</Button>;
@@ -0,0 +1,51 @@
1
+ import React from 'react';
2
+ import {
3
+ Avatar,
4
+ Button,
5
+ Card,
6
+ CodeBlock,
7
+ IconButton,
8
+ MenuButton,
9
+ Panel,
10
+ Spinner,
11
+ Switch,
12
+ } from '@pantheon-systems/pds-toolkit-react';
13
+
14
+ // Value rewrites — prop stays, value changes
15
+ const A = () => <Button variant="secondary">Click</Button>;
16
+ const B = () => <Button variant="subtle">Click</Button>;
17
+ const C = () => (
18
+ <MenuButton variant="subtle" id='menu' label='Menu' menuItems={[]} />
19
+ );
20
+ const D = () => (
21
+ <IconButton variant="critical" iconName='x' label='Close' />
22
+ );
23
+ const E = () => <Avatar size="l" />;
24
+
25
+ // JSX expression container value rewrite
26
+ const F = () => <Button variant={"secondary"}>Click</Button>;
27
+
28
+ // Unconditional prop removals
29
+ const G = () => <Spinner />;
30
+ const H = () => <CodeBlock />;
31
+ const I = () => (
32
+ <Panel />
33
+ );
34
+ const J = () => (
35
+ <Switch />
36
+ );
37
+
38
+ // Conditional removal — remove only deprecated gradient values, leave valid values alone
39
+ const K = () => <Card />;
40
+ const L = () => <Card />;
41
+ const M = () => <Card background='default' />;
42
+
43
+ // Already correct — should be left alone
44
+ const N = () => <Button variant='secondary'>Click</Button>;
45
+
46
+ // Non-PDS component — should be left alone
47
+ const O = () => <div variant='brand-secondary' />;
48
+
49
+ // Dynamic value — cannot transform, leave as-is
50
+ const myVariant = 'brand-secondary';
51
+ const P = () => <Button variant={myVariant}>Click</Button>;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { Button, Spinner } from '@pantheon-systems/pds-toolkit-react';
3
+
4
+ // Button — matches --only=Button, should be transformed
5
+ const A = () => <Button variant='brand-secondary'>Click</Button>;
6
+
7
+ // Spinner — not in --only list, should be left alone
8
+ const B = () => <Spinner colorType='full-color' />;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { Button, Spinner } from '@pantheon-systems/pds-toolkit-react';
3
+
4
+ // Button — matches --only=Button, should be transformed
5
+ const A = () => <Button variant="secondary">Click</Button>;
6
+
7
+ // Spinner — not in --only list, should be left alone
8
+ const B = () => <Spinner colorType='full-color' />;
@@ -0,0 +1,15 @@
1
+ const { defineTest } = require('jscodeshift/src/testUtils');
2
+
3
+ const transform = 'component-renames';
4
+
5
+ // Unfiltered: renames all components
6
+ defineTest(__dirname, transform, null, `${transform}/basic`, { parser: 'tsx' });
7
+
8
+ // --only=IndicatorBadge: renames only IndicatorBadge; all other components untouched
9
+ defineTest(
10
+ __dirname,
11
+ transform,
12
+ { only: 'IndicatorBadge' },
13
+ `${transform}/only`,
14
+ { parser: 'tsx' },
15
+ );
@@ -0,0 +1,6 @@
1
+ const { defineTest } = require('jscodeshift/src/testUtils');
2
+
3
+ const transform = 'css-class-removals';
4
+
5
+ // CSS class removals apply to any element — no --only flag
6
+ defineTest(__dirname, transform, null, `${transform}/basic`, { parser: 'tsx' });
@@ -0,0 +1,6 @@
1
+ const { defineTest } = require('jscodeshift/src/testUtils');
2
+
3
+ const transform = 'css-class-renames';
4
+
5
+ // CSS class renames apply to any element — no --only flag
6
+ defineTest(__dirname, transform, null, `${transform}/basic`, { parser: 'tsx' });
@@ -0,0 +1,15 @@
1
+ const { defineTest } = require('jscodeshift/src/testUtils');
2
+
3
+ const transform = 'icon-name-updates';
4
+
5
+ // Unfiltered: updates iconName on all PDS components
6
+ defineTest(__dirname, transform, null, `${transform}/basic`, { parser: 'tsx' });
7
+
8
+ // --only=Icon: updates only Icon's iconName; Button is untouched
9
+ defineTest(
10
+ __dirname,
11
+ transform,
12
+ { only: 'Icon' },
13
+ `${transform}/only`,
14
+ { parser: 'tsx' },
15
+ );
@@ -0,0 +1,15 @@
1
+ const { defineTest } = require('jscodeshift/src/testUtils');
2
+
3
+ const transform = 'prop-renames';
4
+
5
+ // Unfiltered: renames all components' props
6
+ defineTest(__dirname, transform, null, `${transform}/basic`, { parser: 'tsx' });
7
+
8
+ // --only=Button: renames only Button's props; Icon and others are untouched
9
+ defineTest(
10
+ __dirname,
11
+ transform,
12
+ { only: 'Button' },
13
+ `${transform}/only`,
14
+ { parser: 'tsx' },
15
+ );
@@ -3,4 +3,14 @@ const { defineTest } = require('jscodeshift/src/testUtils');
3
3
  const transform = 'prop-value-standardization';
4
4
  const fixtures = `${__dirname}/../__testfixtures__/${transform}`;
5
5
 
6
+ // Unfiltered: rewrites all components with size migration rules
6
7
  defineTest(__dirname, transform, null, `${transform}/basic`, { parser: 'tsx' });
8
+
9
+ // --only=Spinner: rewrites only Spinner; all other PDS components are untouched
10
+ defineTest(
11
+ __dirname,
12
+ transform,
13
+ { only: 'Spinner' },
14
+ `${transform}/only`,
15
+ { parser: 'tsx' },
16
+ );