Skip to content

Commit e2b9bad

Browse files
authored
chore: deprecate packages (#1527)
* chore: update story titles * chore: deprecate packages * chore: remove legacy code
1 parent 8b65bec commit e2b9bad

File tree

111 files changed

+128
-453
lines changed

Some content is hidden

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

111 files changed

+128
-453
lines changed

.changeset/lovely-shirts-glow.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
"@launchpad-ui/progress-bubbles": patch
3+
"@launchpad-ui/collapsible": patch
4+
"@launchpad-ui/navigation": patch
5+
"@launchpad-ui/pagination": patch
6+
"@launchpad-ui/markdown": patch
7+
"@launchpad-ui/columns": patch
8+
"@launchpad-ui/avatar": patch
9+
"@launchpad-ui/inline": patch
10+
"@launchpad-ui/stack": patch
11+
"@launchpad-ui/core": patch
12+
---
13+
14+
Deprecate packages

.plop/templates/component/story.tsx.hbs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ export default {
66
component: {{pascalCase name}},
77
title: 'Components/{{pascalCase name}}',
88
description: '{{description}}',
9-
parameters: {
10-
status: {
11-
type: import.meta.env.STORYBOOK_PACKAGE_STATUS__{{constantCase name}},
12-
},
13-
},
149
};
1510

1611
type Story = StoryObj<typeof {{pascalCase name}}>;

.storybook/main.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import type { StorybookConfig } from '@storybook/react-vite';
22

3-
import fs from 'fs';
4-
import path from 'path';
5-
6-
import tsconfig from '../tsconfig.json';
7-
83
const config: StorybookConfig = {
94
stories: [
105
'../docs/stories/**/*.mdx',
@@ -29,11 +24,6 @@ const config: StorybookConfig = {
2924
disableTelemetry: true,
3025
},
3126
staticDirs: ['.', { from: '../packages/card/src/img', to: '/static' }],
32-
env: (config) => {
33-
const packageStatuses = getPackageStatusEnvVars();
34-
35-
return { ...config, ...packageStatuses };
36-
},
3727
async viteFinal(config) {
3828
return config;
3929
},
@@ -57,22 +47,4 @@ const config: StorybookConfig = {
5747
},
5848
};
5949

60-
const getPackageStatusEnvVars = () => {
61-
const paths = tsconfig.compilerOptions.paths;
62-
const statuses: Record<string, string> = {};
63-
64-
for (const key of Object.keys(paths)) {
65-
const filepath = path.resolve(
66-
__dirname,
67-
`.${paths[key as keyof typeof paths][0]}/../package.json`,
68-
);
69-
const contents = fs.readFileSync(filepath);
70-
const { status } = JSON.parse(contents.toString());
71-
const statusKey = key.replace('@launchpad-ui/', '').replace(/-/g, '_').toUpperCase();
72-
statuses[`STORYBOOK_PACKAGE_STATUS__${statusKey}`] = status;
73-
}
74-
75-
return statuses;
76-
};
77-
7850
export default config;

.storybook/preview.tsx

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -87,27 +87,6 @@ export const parameters: Parameters = {
8787
dark: allModes.dark,
8888
},
8989
},
90-
status: {
91-
statuses: {
92-
alpha: {
93-
background: 'hsl(275.4, 48%, 50.2%)',
94-
color: '#ffffff',
95-
description:
96-
'This component is very unstable and will likely break when upgrading versions.',
97-
},
98-
beta: {
99-
background: 'hsl(45.4, 58.3%, 50.2%)',
100-
color: '#ffffff',
101-
description:
102-
'This component is still relatively unstable and may break when upgrading versions.',
103-
},
104-
stable: {
105-
background: 'hsl(154.1, 100%, 36.3%)',
106-
color: '#ffffff',
107-
description: 'This component is stable for production use.',
108-
},
109-
},
110-
},
11190
docs: {
11291
source: {
11392
excludeDecorators: true,

packages/alert/stories/Alert.stories.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ import { Alert } from '../src';
77

88
export default {
99
component: Alert,
10-
title: 'Legacy/Deprecated/Alert',
10+
title: 'Legacy/Alert',
1111
description: 'Actions trigger alerts based on user interaction.',
1212
parameters: {
13-
status: {
14-
type: import.meta.env.STORYBOOK_PACKAGE_STATUS__ALERT,
15-
},
1613
chromatic: { disableSnapshot: true },
1714
},
1815
argTypes: {

packages/avatar/src/Avatar.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ const DIMENSIONS = {
2424
large: '40',
2525
};
2626

27+
/**
28+
* @deprecated use `Avatar` from `@launchpad-ui/components` instead
29+
*
30+
* https://launchpad.launchdarkly.com/?path=/docs/components-content-avatar--docs
31+
*/
2732
const Avatar = ({
2833
alt = '',
2934
url,

packages/avatar/stories/Avatar.stories.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ import { Avatar } from '../src';
66

77
export default {
88
component: Avatar,
9-
title: 'Legacy/Sunset/Avatar',
9+
title: 'Legacy/Avatar',
1010
description: 'An element that represents a user visually.',
1111
parameters: {
12-
status: {
13-
type: import.meta.env.STORYBOOK_PACKAGE_STATUS__AVATAR,
14-
},
12+
chromatic: { disableSnapshot: true },
1513
},
1614
argTypes: {
1715
size: {

packages/banner/stories/Banner.stories.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@ import { Banner } from '../src';
44

55
export default {
66
component: Banner,
7-
title: 'Legacy/Deprecated/Banner',
7+
title: 'Legacy/Banner',
88
description: 'Banners contain a system-wide message or status.',
99
parameters: {
10-
status: {
11-
type: import.meta.env.STORYBOOK_PACKAGE_STATUS__BANNER,
12-
},
1310
chromatic: { disableSnapshot: true },
1411
},
1512
argTypes: {

packages/box/stories/Box.stories.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ export default {
88
component: Box,
99
title: 'Legacy/Experimental/Box',
1010
description: '',
11-
parameters: {
12-
status: {
13-
type: import.meta.env.STORYBOOK_PACKAGE_STATUS__BOX,
14-
},
15-
},
1611
};
1712

1813
type Story = StoryObj<typeof Box>;
@@ -30,7 +25,7 @@ export const Example: Story = {
3025
export const Composition: Story = {
3126
args: {
3227
background: '$yellow-cyan',
33-
borderColor: '$cyan.500',
28+
borderColor: '$brand.cyan.base',
3429
color: '$black.900',
3530
asChild: true,
3631
children: <Button>Button</Button>,

packages/button/stories/Button.stories.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,10 @@ const buttonTemplateWithStates: Decorator = (storyComponent, context) => {
4545

4646
export default {
4747
component: Button,
48-
title: 'Legacy/Deprecated/Button',
48+
title: 'Legacy/Button',
4949
description: 'Buttons trigger actions based on user interaction.',
5050
decorators: [buttonTemplateWithStates],
5151
parameters: {
52-
status: {
53-
type: import.meta.env.STORYBOOK_PACKAGE_STATUS__BUTTON,
54-
},
5552
chromatic: { disableSnapshot: true },
5653
},
5754
argTypes: {

0 commit comments

Comments
 (0)