Skip to content

Commit

Permalink
fix(combobox): corrects cases where open combobx stories and testing …
Browse files Browse the repository at this point in the history
…previews could overlap adjacent components (#3568)
  • Loading branch information
cdransf authored and castastrophe committed Feb 24, 2025
1 parent a25e0a9 commit 0f14273
Show file tree
Hide file tree
Showing 8 changed files with 286 additions and 277 deletions.
2 changes: 1 addition & 1 deletion .storybook/decorators/context.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { makeDecorator, useEffect } from "@storybook/preview-api";
import { fetchContainers, toggleStyles } from "./helpers.js";

import tokens from "@spectrum-css/tokens/dist/index.css?inline";
import tokens from "@spectrum-css/tokens/dist/css/index.css?inline";

/**
* @type import('@storybook/csf').DecoratorFunction<import('@storybook/web-components').WebComponentsFramework>
Expand Down
6 changes: 3 additions & 3 deletions .storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spectrum-css/preview",
"version": "11.0.1-next.2",
"version": "12.0.3",
"description": "A Spectrum CSS preview",
"license": "Apache-2.0",
"author": "Adobe",
Expand Down Expand Up @@ -40,8 +40,8 @@
},
"dependencies": {
"@adobe/spectrum-css-workflow-icons": "^4.0.0",
"@spectrum-css/bundle": "workspace:^",
"@spectrum-css/tokens": "14.0.0-next.2",
"@spectrum-css/bundle": "1.0.0",
"@spectrum-css/tokens": "16.0.1",
"@spectrum-css/ui-icons": "1.1.2"
},
"devDependencies": {
Expand Down
10 changes: 10 additions & 0 deletions components/combobox/stories/combobox.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ DefaultGroup.args = Default.args;
DefaultGroup.tags = ["!dev"];
DefaultGroup.parameters = {
chromatic: { disableSnapshot: true },
docs: {
story: {
height: "360px",
},
},
};

export const QuietGroup = VariantGroup.bind({});
Expand All @@ -182,6 +187,11 @@ QuietGroup.args = {
QuietGroup.tags = ["!dev"];
QuietGroup.parameters = {
chromatic: { disableSnapshot: true },
docs: {
story: {
height: "360px",
},
},
};

/**
Expand Down
9 changes: 6 additions & 3 deletions components/combobox/stories/combobox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import { Template } from "./template.js";
export const ComboBoxGroup = Variants({
Template,
sizeDirection: "row",
wrapperStyles: {
"align-items": "flex-start",
},
testData: [
{
testHeading: "Default",
Expand All @@ -20,11 +17,17 @@ export const ComboBoxGroup = Variants({
{
testHeading: "Open",
isOpen: true,
wrapperStyles: {
"min-block-size": "250px",
},
},
{
testHeading: "Quiet + open",
isQuiet: true,
isOpen: true,
wrapperStyles: {
"min-block-size": "250px",
},
},
{
testHeading: "With field label top",
Expand Down
2 changes: 1 addition & 1 deletion components/dialog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"main": "dist/index.css",
"peerDependencies": {
"@spectrum-css/button": ">=14.0.0-next.0",
"@spectrum-css/button": ">=14.0.0 <15.0.0",
"@spectrum-css/buttongroup": ">=9.0.0 <10.0.0",
"@spectrum-css/closebutton": ">=6.0.0 <7.0.0",
"@spectrum-css/divider": ">=5.0.0 <6.0.0",
Expand Down
171 changes: 85 additions & 86 deletions tools/bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,92 +30,91 @@
},
"main": "dist/index.css",
"devDependencies": {
"@spectrum-css/accordion": "workspace:^",
"@spectrum-css/actionbar": "workspace:^",
"@spectrum-css/actionbutton": "workspace:^",
"@spectrum-css/actiongroup": "workspace:^",
"@spectrum-css/actionmenu": "workspace:^",
"@spectrum-css/alertbanner": "workspace:^",
"@spectrum-css/alertdialog": "workspace:^",
"@spectrum-css/asset": "workspace:^",
"@spectrum-css/assetcard": "workspace:^",
"@spectrum-css/assetlist": "workspace:^",
"@spectrum-css/avatar": "workspace:^",
"@spectrum-css/badge": "workspace:^",
"@spectrum-css/breadcrumb": "workspace:^",
"@spectrum-css/button": "workspace:^",
"@spectrum-css/buttongroup": "workspace:^",
"@spectrum-css/calendar": "workspace:^",
"@spectrum-css/card": "workspace:^",
"@spectrum-css/checkbox": "workspace:^",
"@spectrum-css/clearbutton": "workspace:^",
"@spectrum-css/closebutton": "workspace:^",
"@spectrum-css/coachindicator": "workspace:^",
"@spectrum-css/coachmark": "workspace:^",
"@spectrum-css/colorarea": "workspace:^",
"@spectrum-css/colorhandle": "workspace:^",
"@spectrum-css/colorloupe": "workspace:^",
"@spectrum-css/colorslider": "workspace:^",
"@spectrum-css/colorwheel": "workspace:^",
"@spectrum-css/combobox": "workspace:^",
"@spectrum-css/commons": "workspace:^",
"@spectrum-css/contextualhelp": "workspace:^",
"@spectrum-css/datepicker": "workspace:^",
"@spectrum-css/dial": "workspace:^",
"@spectrum-css/dialog": "workspace:^",
"@spectrum-css/divider": "workspace:^",
"@spectrum-css/dropindicator": "workspace:^",
"@spectrum-css/dropzone": "workspace:^",
"@spectrum-css/fieldgroup": "workspace:^",
"@spectrum-css/fieldlabel": "workspace:^",
"@spectrum-css/floatingactionbutton": "workspace:^",
"@spectrum-css/form": "workspace:^",
"@spectrum-css/helptext": "workspace:^",
"@spectrum-css/icon": "workspace:^",
"@spectrum-css/illustratedmessage": "workspace:^",
"@spectrum-css/infieldbutton": "workspace:^",
"@spectrum-css/infieldprogresscircle": "workspace:^",
"@spectrum-css/inlinealert": "workspace:^",
"@spectrum-css/link": "workspace:^",
"@spectrum-css/logicbutton": "workspace:^",
"@spectrum-css/menu": "workspace:^",
"@spectrum-css/meter": "workspace:^",
"@spectrum-css/miller": "workspace:^",
"@spectrum-css/modal": "workspace:^",
"@spectrum-css/opacitycheckerboard": "workspace:^",
"@spectrum-css/page": "workspace:^",
"@spectrum-css/pagination": "workspace:^",
"@spectrum-css/picker": "workspace:^",
"@spectrum-css/pickerbutton": "workspace:^",
"@spectrum-css/popover": "workspace:^",
"@spectrum-css/progressbar": "workspace:^",
"@spectrum-css/progresscircle": "workspace:^",
"@spectrum-css/radio": "workspace:^",
"@spectrum-css/rating": "workspace:^",
"@spectrum-css/search": "workspace:^",
"@spectrum-css/sidenav": "workspace:^",
"@spectrum-css/slider": "workspace:^",
"@spectrum-css/splitview": "workspace:^",
"@spectrum-css/statuslight": "workspace:^",
"@spectrum-css/steplist": "workspace:^",
"@spectrum-css/stepper": "workspace:^",
"@spectrum-css/swatch": "workspace:^",
"@spectrum-css/swatchgroup": "workspace:^",
"@spectrum-css/switch": "workspace:^",
"@spectrum-css/table": "workspace:^",
"@spectrum-css/tabs": "workspace:^",
"@spectrum-css/tag": "workspace:^",
"@spectrum-css/taggroup": "workspace:^",
"@spectrum-css/textfield": "workspace:^",
"@spectrum-css/thumbnail": "workspace:^",
"@spectrum-css/toast": "workspace:^",
"@spectrum-css/tokens": "workspace:^",
"@spectrum-css/tooltip": "workspace:^",
"@spectrum-css/tray": "workspace:^",
"@spectrum-css/treeview": "workspace:^",
"@spectrum-css/typography": "workspace:^",
"@spectrum-css/underlay": "workspace:^",
"@spectrum-css/well": "workspace:^",
"@spectrum-css/accordion": "7.1.0",
"@spectrum-css/actionbar": "10.1.1",
"@spectrum-css/actionbutton": "7.1.1",
"@spectrum-css/actiongroup": "6.1.0",
"@spectrum-css/actionmenu": "7.1.1",
"@spectrum-css/alertbanner": "3.1.0",
"@spectrum-css/alertdialog": "4.1.0",
"@spectrum-css/asset": "7.1.0",
"@spectrum-css/assetcard": "5.1.0",
"@spectrum-css/assetlist": "8.1.0",
"@spectrum-css/avatar": "9.1.0",
"@spectrum-css/badge": "6.1.0",
"@spectrum-css/breadcrumb": "11.1.0",
"@spectrum-css/button": "14.1.1",
"@spectrum-css/buttongroup": "9.1.0",
"@spectrum-css/calendar": "7.1.0",
"@spectrum-css/card": "11.1.0",
"@spectrum-css/checkbox": "10.1.0",
"@spectrum-css/clearbutton": "7.1.0",
"@spectrum-css/closebutton": "6.1.0",
"@spectrum-css/coachindicator": "4.1.0",
"@spectrum-css/coachmark": "9.1.1",
"@spectrum-css/colorarea": "7.1.0",
"@spectrum-css/colorhandle": "10.1.0",
"@spectrum-css/colorloupe": "7.1.0",
"@spectrum-css/colorslider": "8.1.0",
"@spectrum-css/colorwheel": "6.1.0",
"@spectrum-css/combobox": "4.1.1",
"@spectrum-css/commons": "11.0.0",
"@spectrum-css/contextualhelp": "5.1.2",
"@spectrum-css/datepicker": "4.1.1",
"@spectrum-css/dial": "5.1.0",
"@spectrum-css/dialog": "12.1.0",
"@spectrum-css/divider": "5.1.0",
"@spectrum-css/dropindicator": "7.1.0",
"@spectrum-css/dropzone": "8.1.0",
"@spectrum-css/fieldgroup": "7.1.0",
"@spectrum-css/fieldlabel": "10.1.0",
"@spectrum-css/floatingactionbutton": "4.1.0",
"@spectrum-css/form": "1.1.0",
"@spectrum-css/helptext": "7.1.0",
"@spectrum-css/icon": "9.1.0",
"@spectrum-css/illustratedmessage": "9.1.0",
"@spectrum-css/infieldbutton": "6.1.0",
"@spectrum-css/infieldprogresscircle": "0.0.0",
"@spectrum-css/inlinealert": "10.1.0",
"@spectrum-css/link": "7.1.0",
"@spectrum-css/logicbutton": "6.1.0",
"@spectrum-css/menu": "9.1.0",
"@spectrum-css/meter": "1.1.0",
"@spectrum-css/miller": "8.1.0",
"@spectrum-css/modal": "7.1.0",
"@spectrum-css/opacitycheckerboard": "4.1.0",
"@spectrum-css/page": "9.1.0",
"@spectrum-css/pagination": "10.1.0",
"@spectrum-css/picker": "9.1.1",
"@spectrum-css/pickerbutton": "6.1.1",
"@spectrum-css/popover": "8.2.0",
"@spectrum-css/progressbar": "6.1.0",
"@spectrum-css/progresscircle": "5.1.0",
"@spectrum-css/radio": "10.1.0",
"@spectrum-css/rating": "6.1.0",
"@spectrum-css/search": "8.1.0",
"@spectrum-css/sidenav": "7.1.0",
"@spectrum-css/slider": "6.1.0",
"@spectrum-css/splitview": "7.1.0",
"@spectrum-css/statuslight": "9.1.0",
"@spectrum-css/steplist": "7.1.0",
"@spectrum-css/stepper": "7.1.0",
"@spectrum-css/swatch": "8.1.0",
"@spectrum-css/swatchgroup": "5.1.0",
"@spectrum-css/switch": "6.1.0",
"@spectrum-css/table": "8.1.0",
"@spectrum-css/tabs": "6.1.1",
"@spectrum-css/tag": "10.1.0",
"@spectrum-css/taggroup": "7.1.0",
"@spectrum-css/textfield": "8.1.0",
"@spectrum-css/thumbnail": "8.1.0",
"@spectrum-css/toast": "11.1.0",
"@spectrum-css/tooltip": "7.1.0",
"@spectrum-css/tray": "5.1.0",
"@spectrum-css/treeview": "12.1.0",
"@spectrum-css/typography": "8.1.0",
"@spectrum-css/underlay": "6.1.0",
"@spectrum-css/well": "7.1.0",
"colors": "^1.4.0",
"postcss": "^8.5.3",
"postcss-licensing": "^2.0.0"
Expand Down
7 changes: 6 additions & 1 deletion tools/bundle/tasks/bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ const bundleRoot = path.resolve(dirs.root, "tools", "bundle");
* @returns {Promise<string[]>}
*/
async function validateDependencies(components) {
// This is the bundle's package.json
const localPackage = path.join(bundleRoot, "package.json");

// Confirm the dependencies listed in this package.json match the components in the components directory
const packageJSON = JSON.parse(fs.readFileSync(localPackage, "utf8"));

Expand All @@ -51,8 +53,11 @@ async function validateDependencies(components) {

// Update the package.json dependencies
missing.forEach((dependency) => {
// Fetch the package.json for the component to get the version
const componentPackage = JSON.parse(fs.readFileSync(path.join(dirs.components, dependency, "package.json"), "utf8"));

reports.push(`${"+".green} ${`@spectrum-css/${dependency} to package.json`.gray}`);
packageJSON.devDependencies[`@spectrum-css/${dependency}`] = "workspace:^";
packageJSON.devDependencies[`@spectrum-css/${dependency}`] = componentPackage?.version ?? "workspace:^";
});
}

Expand Down
Loading

0 comments on commit 0f14273

Please sign in to comment.