Skip to content

Commit 84e1ee9

Browse files
authored
refactor(quickaction): deprecate component; support this in docs (#2304)
BREAKING CHANGE: @spectrum-css/quickaction deprecated This component has been deprecated. Use an action bar to allow users to perform actions on either a single or multiple items at the same time, instead.
1 parent 474c136 commit 84e1ee9

File tree

24 files changed

+634
-1546
lines changed

24 files changed

+634
-1546
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
// Import the component markup template
2-
import { Template } from "./template";
1+
import { Template } from "@spectrum-css/quickaction/stories/template.js";
32

43
export default {
5-
title: "Components/Quick actions",
6-
description: "The Quick actions component is...",
4+
title: "Deprecated/Quick actions",
75
component: "QuickAction",
86
argTypes: {
97
content: { table: { disable: true } },
@@ -40,45 +38,31 @@ export default {
4038
rootClass: "spectrum-QuickActions",
4139
isOpen: true,
4240
textOnly: false,
41+
content: [
42+
{
43+
iconName: "Edit",
44+
label: "Edit",
45+
},
46+
{
47+
iconName: "Copy",
48+
label: "Copy",
49+
},
50+
{
51+
iconName: "Delete",
52+
label: "Delete",
53+
},
54+
],
4355
},
4456
parameters: {
4557
actions: {
4658
handles: [],
4759
},
4860
status: {
49-
type: process.env.MIGRATED_PACKAGES.includes("quickaction")
50-
? "migrated"
51-
: undefined,
61+
type: "deprecated"
5262
},
63+
chromatic: { disable: true },
5364
},
5465
};
5566

5667
export const Default = Template.bind({});
57-
Default.args = {
58-
content: [
59-
{
60-
iconName: "Edit",
61-
},
62-
{
63-
iconName: "Copy",
64-
},
65-
{
66-
iconName: "Delete",
67-
},
68-
],
69-
};
70-
71-
export const TextOnly = Template.bind({});
72-
TextOnly.args = {
73-
content: [
74-
{
75-
label: "Edit",
76-
},
77-
{
78-
label: "Copy",
79-
},
80-
{
81-
label: "Delete",
82-
},
83-
],
84-
};
68+
Default.args = {};

components/quickaction/metadata/quickaction.yml renamed to .storybook/deprecated/quickaction/quickaction.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
id: quickactions
22
name: Quick actions
3-
status: Verified
4-
description: "Note that the `.spectrum-QuickActions-overlay` class should be placed on the container where the Quick Actions are displayed, and the `.spectrum-QuickActions--textOnly` class should be applied when the buttons have text only."
3+
status: Deprecated
4+
deprecationNotice: Use an <a href="actionbar.html">action bar</a> to allow users to perform actions on either a single or multiple items at the same time, instead.
5+
description: Note that the `.spectrum-QuickActions-overlay` class should be placed on the container where the Quick Actions are displayed, and the `.spectrum-QuickActions--textOnly` class should be applied when the buttons have text only.
56
SpectrumSiteSlug: https://spectrum.adobe.com/page/quick-actions/
6-
section:
7-
- name: Migration Guide
8-
description: |
9-
### Change workflow icon size to medium
10-
Please replace `.spectrum-Icon--sizeS` with `.spectrum-Icon--sizeM`.
117
examples:
128
- id: quickactions
139
name: Standard

.storybook/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module.exports = {
1111
stories: [
1212
"../components/*/stories/*.stories.js",
1313
"./guides/*.mdx",
14+
"./deprecated/*/*.stories.js",
1415
],
1516
rootDir: "../",
1617
staticDirs: ["../assets"],

.storybook/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"dependencies": {
1313
"@adobe/spectrum-css-workflow-icons": "^1.5.4",
1414
"@spectrum-css/expressvars": "^3.0.9",
15+
"@spectrum-css/quickaction": "^3.1.1",
1516
"@spectrum-css/site": "^4.2.1",
1617
"@spectrum-css/tokens": "^13.1.2",
1718
"@spectrum-css/ui-icons": "^1.1.2",

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,3 +404,13 @@ Occasionally, you may want to run a prerelease for an individual package and ski
404404
- You **must** run a build **before** continuing with the prerelease. An npm task for cleaning, building, and beta publishing is available, and it can be run via the following command: `yarn release:beta-from-package`. This command will perform a full `clean` (via the `clean` task), a full `build` (via the `build` task), and will attempt to publish the package (via `lerna publish --conventional-prerelease --preid beta --pre-dist-tag beta --no-private`).
405405
- Depending on the severity of your change(s), and before publishing to npm, Lerna should show a preview of the affected package version number that looks something like: `@spectrum-css/switch: 1.0.23 => 2.0.0-beta.0`. Additionally, at this time, Lerna will ask if you would like to continue with publishing the changes or cancel.
406406
- Selecting `y` to publish will publish the affected package(s) to npm.
407+
408+
## Deprecating a component
409+
410+
1. Create a new folder with the component name in `.storybook/deprecated`, i.e., `.storybook/deprecated/quickaction`.
411+
2. Copy _.stories.js and metadata/_.yml into the new folder (directly, not nested inside subfolders).
412+
3. Update the title of the `*.stories.js` asset to be prefixed with the `Deprecated` category, i.e., `title: "Deprecated/Quick actions"`.
413+
4. Update any local references to `template.js` or other files to point to their package name, i.e., `import { Template } from "./template";` -> `import { Template } from "@spectrum-css/quickaction/stories/template.js";`.
414+
5. In the parameters section of the `*.stories.js`, add `chromatic: { disable: true },` to ensure it no longer runs regression tests.
415+
6. Update the status of the component to `Deprecated` in the `*.yml` file. Add any additional migration notes to the `deprecationNotice` keyword.
416+
7. Delete the package from the components directory.

components/card/stories/card.stories.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { html } from "lit";
21

32
// Import the component markup template
43
import { Template } from "./template";
54

65
import { default as ActionButton } from "@spectrum-css/actionbutton/stories/actionbutton.stories.js";
7-
import { default as QuickAction } from "@spectrum-css/quickaction/stories/quickaction.stories.js";
86
import { default as Checkbox } from "@spectrum-css/checkbox/stories/checkbox.stories.js";
7+
import { default as QuickAction } from "@spectrum-css/quickaction/stories/quickaction.stories.js";
98

109
export default {
1110
title: "Components/Card",

0 commit comments

Comments
 (0)