Skip to content

Commit 5a61a2e

Browse files
Melissa Thompsoncastastrophe
andauthored
refactor(splitbutton): deprecate component (#2527)
* refactor(splitbutton): deprecate component * fix(storybook): update logic in postcss for rendering styles --------- Co-authored-by: castastrophe <[email protected]>
1 parent d1922f9 commit 5a61a2e

File tree

13 files changed

+18
-1310
lines changed

13 files changed

+18
-1310
lines changed

.storybook/deprecated/splitbutton/splitbutton.stories.js

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ export default {
4646
size: "m",
4747
position: "right",
4848
label: "Split Button",
49+
variant: "accent",
50+
treatment: "fill",
51+
iconName: "ChevronDown100",
4952
},
5053
parameters: {
5154
actions: {
@@ -58,44 +61,5 @@ export default {
5861
},
5962
};
6063

61-
export const CTA = Template.bind({});
62-
CTA.args = {
63-
variant: "accent",
64-
treatment: "fill",
65-
iconName: "ChevronDown100",
66-
};
67-
68-
export const CTAMoreIcon = Template.bind({});
69-
CTAMoreIcon.args = {
70-
variant: "accent",
71-
treatment: "fill",
72-
iconName: "More",
73-
};
74-
75-
export const Primary = Template.bind({});
76-
Primary.args = {
77-
variant: "primary",
78-
treatment: "outline",
79-
iconName: "ChevronDown100",
80-
};
81-
82-
export const PrimaryMoreIcon = Template.bind({});
83-
PrimaryMoreIcon.args = {
84-
variant: "primary",
85-
treatment: "outline",
86-
iconName: "More",
87-
};
88-
89-
export const Secondary = Template.bind({});
90-
Secondary.args = {
91-
variant: "secondary",
92-
treatment: "outline",
93-
iconName: "ChevronDown100",
94-
};
95-
96-
export const SecondaryMoreIcon = Template.bind({});
97-
SecondaryMoreIcon.args = {
98-
variant: "secondary",
99-
treatment: "outline",
100-
iconName: "More",
101-
};
64+
export const Default = Template.bind({});
65+
Default.args = {};

.storybook/deprecated/splitbutton/splitbutton.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Split button
22
status: Deprecated
3-
deprecationNotice: Use a <a href="buttongroup.html">button group</a> to show any additional actions related to the most critical action. Reference <a href="https://spectrum.corp.adobe.com/page/button-group/#Use-a-button-group-to-show-additional-actions">Spectrum documentation</a> for more information.
3+
deprecationNotice: Use a [button group](buttongroup.html) to show any additional actions related to the most critical action. Reference [Spectrum documentation](https://spectrum.corp.adobe.com/page/button-group/#Use-a-button-group-to-show-additional-actions) for more information.
44
examples:
55
- id: splitbutton
66
name: CTA

.storybook/postcss.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
const { resolve, basename } = require("path");
2-
const { existsSync } = require("fs");
1+
const { basename } = require("path");
32
const warnCleaner = require("postcss-warn-cleaner");
43

54
const simpleBuilder = require("@spectrum-css/component-builder-simple/css/processors.js");
@@ -16,10 +15,11 @@ function getPackageFromPath(filePath) {
1615

1716
module.exports = (ctx) => {
1817
let plugins = [];
19-
const componentPath = resolve(__dirname, "../components");
2018
/** @todo put together a more robust fallback determination */
2119
const folderName = getPackageFromPath(ctx.file) ?? "tokens";
22-
const pkgPath = resolve(componentPath, folderName, "package.json");
20+
const pkgPath = require.resolve(`@spectrum-css/${folderName}/package.json`);
21+
22+
if (!pkgPath) return plugins;
2323

2424
/**
2525
* For our token libraries, include a little extra parsing to allow duplicate
@@ -56,7 +56,7 @@ module.exports = (ctx) => {
5656
]
5757
: []),
5858
];
59-
} else if (existsSync(pkgPath)) {
59+
} else {
6060
/**
6161
* If a path has a package.json, we can assume it's a component and
6262
* we want to leverage the correct plugins for it.

0 commit comments

Comments
 (0)