Skip to content

Commit ad00af4

Browse files
committed
Revert "Merge branch 'Add-Figma-Changelog-entry-for-4.15.0' of https://github.com/hashicorp/design-system into Add-Figma-Changelog-entry-for-4.15.0"
This reverts commit 4215808, reversing changes made to 47be9a5.
1 parent 4215808 commit ad00af4

File tree

285 files changed

+10631
-12067
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

285 files changed

+10631
-12067
lines changed

.changeset/cold-humans-mix.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hashicorp/design-system-components": patch
3+
---
4+
5+
`Dropdown` - Fixed an issue with the `ToggleIcon` to make the focus ring visible on mouse click

.changeset/gorgeous-days-call.md

-5
This file was deleted.

.changeset/lovely-goats-work.md

-5
This file was deleted.

.changeset/smart-seahorses-cough.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hashicorp/flight-icons": minor
3+
---
4+
5+
`Postgres` service icon added.

.changeset/sweet-penguins-shave.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hashicorp/design-system-components": patch
3+
---
4+
5+
`IconTile` - Updated visual design of `IconTile` to make it distinguishable from secondary `IconButton`.

.changeset/thin-games-doubt.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hashicorp/design-system-components": minor
3+
---
4+
5+
`Table` - Exposed the index of the `@each` loop over the `@model` as `rowIndex`

.yarn/releases/yarn-4.4.0.cjs

+925
Large diffs are not rendered by default.

.yarn/releases/yarn-4.5.3.cjs

-934
This file was deleted.

.yarnrc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ enableGlobalCache: false
44

55
nodeLinker: node-modules
66

7-
yarnPath: .yarn/releases/yarn-4.5.3.cjs
7+
yarnPath: .yarn/releases/yarn-4.4.0.cjs

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Note: If you want to ignore a changeset bump in terminal (e.g. major bump for se
9090

9191
## Releasing
9292

93-
See the [release docs](https://hashicorp.atlassian.net/wiki/x/HIBT0Q) for the process we follow to publish a new package version.
93+
See the [release docs](packages/components/RELEASE.md) for the process we follow to publish a new package version.
9494

9595
## License
9696

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"release-packages": "yarn changeset publish",
1717
"version-packages": "yarn changeset version && yarn install --mode update-lockfile && yarn workspace website generate-changelog-markdown-files"
1818
},
19-
"packageManager": "yarn@4.5.3",
19+
"packageManager": "yarn@4.4.0",
2020
"resolutions": {
2121
"broccoli-asset-rewrite@^2.0.0": "patch:broccoli-asset-rewrite@npm%3A2.0.0#./.yarn/patches/broccoli-asset-rewrite-npm-2.0.0-c4ce42084a.patch",
2222
"@glint/environment-ember-loose": "patch:@glint/environment-ember-loose@npm%3A1.4.0#~/.yarn/patches/@glint-environment-ember-loose-npm-1.4.0-31c2f31bcb.patch"

packages/codemods/CHANGELOG.md

-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
# @hashicorp/design-system-codemods
22

3-
## 0.5.0
4-
5-
### Minor Changes
6-
7-
Update `v4/dropdown-list-item-interactive` codemod to successfully parse nested content blocks such as conditionals
8-
9-
<small class="doc-whats-new-changelog-metadata">[#2575](https://github.com/hashicorp/design-system/pull/2575)</small>
10-
11-
<div class="doc-whats-new-changelog-separator"></div>
12-
133
## 0.4.0
144

155
### Minor Changes

packages/codemods/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ node ./packages/codemods/bin/cli.js v3/dropdown path/to/some/glob/**/*.hbs
3030
### v4
3131
<!--TRANSFORMS_START-->
3232
* [v4/contextual-components](transforms/v4/contextual-components/README.md)
33-
* [v4/dropdown-list-item-interactive](transforms/v4/dropdown-list-item-interactive/README.md)
3433
* [v4/table](transforms/v4/table/README.md)
3534
* [v4/icon](transforms/v4/icon/README.md)
3635
<!--TRANSFORMS_END-->

packages/codemods/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@hashicorp/design-system-codemods",
33
"description": "Helios Design System codemods",
4-
"version": "0.5.0",
4+
"version": "0.4.0",
55
"scripts": {
66
"lint": "eslint --cache .",
77
"lint:fix": "eslint . --fix",

packages/codemods/transforms/v4/dropdown-list-item-interactive/__testfixtures__/inside-conditional.input.hbs

-10
This file was deleted.

packages/codemods/transforms/v4/dropdown-list-item-interactive/__testfixtures__/inside-conditional.output.hbs

-10
This file was deleted.

packages/codemods/transforms/v4/dropdown-list-item-interactive/index.js

+72-99
Original file line numberDiff line numberDiff line change
@@ -5,85 +5,6 @@
55

66
const CODEMOD_ANALYSIS = process.env.CODEMOD_ANALYSIS;
77

8-
function processChildren(children, asPrefix, b) {
9-
let hasUpdatedChildren = false;
10-
let processedChildren = [];
11-
12-
children.forEach((child) => {
13-
let updatedChild;
14-
let isProcessed = false;
15-
16-
// Check if the child is an ElementNode with the specified tag
17-
if (child.type === 'ElementNode' && child.tag === `${asPrefix}.Interactive`) {
18-
const textAttr = child.attributes.find((a) => a.name === '@text');
19-
20-
if (textAttr) {
21-
const childOutputAttributes = child.attributes.filter((a) => a.name !== '@text');
22-
23-
const isHandlebarsAttr = textAttr.value.type === 'MustacheStatement';
24-
25-
let children = [];
26-
27-
// Handle different types of MustacheStatement values
28-
if (isHandlebarsAttr) {
29-
if (textAttr.value.path.type === 'NumberLiteral') {
30-
children = [b.mustache(b.number(textAttr.value.path.value))];
31-
} else if (textAttr.value.path.type === 'StringLiteral') {
32-
children = [b.mustache(b.string(textAttr.value.path.value))];
33-
} else {
34-
children = [
35-
b.mustache(
36-
textAttr.value.path.original,
37-
[...textAttr.value.params],
38-
textAttr.value.hash
39-
),
40-
];
41-
}
42-
} else {
43-
children = [b.text(textAttr.value.chars)];
44-
}
45-
46-
// Create a new element with the updated children and attributes
47-
updatedChild = b.element(
48-
{ name: child.tag, selfClosing: false },
49-
{
50-
children,
51-
attrs: childOutputAttributes,
52-
modifiers: child.modifiers,
53-
blockParams: child.blockParams,
54-
}
55-
);
56-
57-
isProcessed = true;
58-
} else {
59-
updatedChild = child;
60-
}
61-
} else if (child.type === 'BlockStatement') {
62-
// Recursively process children of BlockStatement nodes
63-
const { hasUpdatedChildren: nestedHasUpdated, processedChildren: nestedProcessed } =
64-
processChildren(child.program.body, asPrefix, b);
65-
66-
if (nestedHasUpdated) {
67-
updatedChild = b.block(
68-
child.path,
69-
child.params,
70-
child.hash,
71-
b.program(nestedProcessed, child.program.blockParams),
72-
child.inverse
73-
);
74-
isProcessed = true;
75-
} else {
76-
updatedChild = child;
77-
}
78-
}
79-
80-
processedChildren.push(updatedChild || child);
81-
hasUpdatedChildren = hasUpdatedChildren || isProcessed;
82-
});
83-
84-
return { hasUpdatedChildren, processedChildren };
85-
}
86-
878
module.exports = function ({ source /*, path*/ }, { parse, visit }) {
889
const ast = parse(source);
8910

@@ -92,33 +13,85 @@ module.exports = function ({ source /*, path*/ }, { parse, visit }) {
9213

9314
return {
9415
ElementNode(node) {
95-
// Check if the node is an Hds::Dropdown element
9616
if (node.type === 'ElementNode' && node.tag === 'Hds::Dropdown') {
17+
let hasUpdatedChildren = false;
18+
let processedChildren;
19+
9720
if (node.blockParams && node.blockParams.length > 0) {
9821
const asPrefix = node.blockParams[0];
9922

100-
// Process the children of the Hds::Dropdown element
101-
const { hasUpdatedChildren, processedChildren } = processChildren(
102-
node.children,
103-
asPrefix,
104-
b
105-
);
106-
107-
// Return the updated element if any children were updated
108-
if (hasUpdatedChildren && !CODEMOD_ANALYSIS) {
109-
return [
110-
b.element(
111-
{ name: node.tag, selfClosing: false },
112-
{
113-
attrs: node.attributes,
114-
children: processedChildren,
115-
modifiers: node.modifiers,
116-
blockParams: node.blockParams,
23+
processedChildren = [];
24+
25+
if (node.children) {
26+
node.children.forEach((child) => {
27+
let updatedChild;
28+
let isProcessed = false;
29+
30+
if (child.type === 'ElementNode' && child.tag === `${asPrefix}.Interactive`) {
31+
const textAttr = child.attributes.find((a) => a.name === '@text');
32+
33+
if (textAttr) {
34+
const childOutputAttributes = child.attributes.filter(
35+
(a) => a.name !== '@text'
36+
);
37+
38+
const isHandlebarsAttr = textAttr.value.type === 'MustacheStatement';
39+
40+
let children = [];
41+
42+
if (isHandlebarsAttr) {
43+
if (textAttr.value.path.type === 'NumberLiteral') {
44+
children = [b.mustache(b.number(textAttr.value.path.value))];
45+
} else if (textAttr.value.path.type === 'StringLiteral') {
46+
children = [b.mustache(b.string(textAttr.value.path.value))];
47+
} else {
48+
children = [
49+
b.mustache(
50+
textAttr.value.path.original,
51+
[...textAttr.value.params],
52+
textAttr.value.hash
53+
),
54+
];
55+
}
56+
} else {
57+
children = [b.text(textAttr.value.chars)];
58+
}
59+
60+
updatedChild = b.element(
61+
{ name: child.tag, selfClosing: false },
62+
{
63+
children,
64+
attrs: childOutputAttributes,
65+
modifiers: child.modifiers,
66+
blockParams: child.blockParams,
67+
}
68+
);
69+
70+
isProcessed = true;
71+
} else {
72+
updatedChild = child;
11773
}
118-
),
119-
];
74+
}
75+
76+
processedChildren.push(updatedChild || child);
77+
hasUpdatedChildren = hasUpdatedChildren || isProcessed;
78+
});
12079
}
12180
}
81+
82+
if (hasUpdatedChildren && !CODEMOD_ANALYSIS) {
83+
return [
84+
b.element(
85+
{ name: node.tag, selfClosing: false },
86+
{
87+
attrs: node.attributes,
88+
children: processedChildren || node.children,
89+
modifiers: node.modifiers,
90+
blockParams: node.blockParams,
91+
}
92+
),
93+
];
94+
}
12295
}
12396
},
12497
};

0 commit comments

Comments
 (0)