Skip to content

Commit 616a30d

Browse files
Merge branch 'main' into dsw-2307-pie-radio
# Conflicts: # apps/pie-storybook/stories/pie-radio.stories.ts
2 parents 0cb4c91 + 7ca43a3 commit 616a30d

36 files changed

+142
-160
lines changed

.changeset/hungry-kids-relate.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"pie-storybook": minor
3+
"@justeattakeaway/generator-pie-component": patch
4+
---
5+
6+
[Changed] - use storybook's Meta type instead of custom StoryMeta type

.changeset/neat-forks-add.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"pie-docs": minor
3+
---
4+
5+
[Changed] - Use only css to apply columns to docs site contents tables

.changeset/ninety-monkeys-run.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"pie-storybook": patch
3+
"pie-docs": patch
4+
"pie-monorepo": patch
5+
---
6+
7+
[Changed] - Add caching for `generate:component-statuses` build.
8+
[Added] - New `copy:component-statuses` script for `pie-docs` and `pie-storybook` which copies the status file from the root.

apps/pie-docs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"build:dev": "DEPLOYMENT_ENVIRONMENT='development' eleventy",
1313
"clean": "run -T rimraf dist",
1414
"dev": "npx @11ty/eleventy --serve --port=8080",
15-
"generate:component-statuses": "npx generate-component-statuses",
15+
"copy:component-statuses": "cp -v ../../component-statuses.json .",
1616
"lint:scripts": "run -T eslint .",
1717
"lint:scripts:fix": "run -T eslint . --fix",
1818
"lint:style": "run -T stylelint ./src/**/*.{css,scss}",

apps/pie-docs/src/assets/js/contents.js

-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@ window.addEventListener('DOMContentLoaded', () => {
1414
item.setAttribute('data-title', textContent);
1515
}
1616
});
17-
18-
list[0].style.setProperty('--column-count', columns);
1917
});

apps/pie-docs/src/assets/styles/components/_contentList.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ $tooltip-border-radius: 100px;
1313
max-width: $contentList-maxWidth;
1414

1515
ol {
16-
column-width: $contentList-column-width 1;
1716
column-gap: var(--dt-spacing-f);
1817
padding: 0;
1918
column-fill: auto;
19+
column-count: 1;
2020

2121
@include f.media('>=mid') {
2222
max-height: $contentList-maxHeight;
23-
column-count: var(--column-count);
23+
column-count: 3;
2424
}
2525
}
2626

apps/pie-docs/turbo.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"dependsOn": [
1414
"^build",
1515
"clean",
16-
"generate:component-statuses"
16+
"copy:component-statuses"
1717
],
1818
"outputs": [
1919
"dist/**"
@@ -23,7 +23,7 @@
2323
"cache": true,
2424
"dependsOn": [
2525
"^build",
26-
"generate:component-statuses"
26+
"copy:component-statuses"
2727
]
2828
},
2929
"dev": {
@@ -32,6 +32,12 @@
3232
"build:dev"
3333
]
3434
},
35+
"copy:component-statuses": {
36+
"dependsOn": [
37+
"//#generate:component-statuses"
38+
],
39+
"cache": false
40+
},
3541
"test:generate-routes": {
3642
"cache": true,
3743
"dependsOn": [

apps/pie-storybook/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build": "storybook build --output-dir dist && cp -R ./static ./dist",
99
"lint:scripts": "run -T eslint .",
1010
"lint:scripts:fix": "run -T eslint . --fix",
11-
"generate:component-statuses": "npx generate-component-statuses"
11+
"copy:component-statuses": "cp -v ../../component-statuses.json ."
1212
},
1313
"author": "Just Eat Takeaway.com - Design System Team",
1414
"license": "Apache-2.0",

apps/pie-storybook/stories/pie-assistive-text.stories.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { html } from 'lit';
22
import { ifDefined } from 'lit/directives/if-defined.js';
3-
/* eslint-disable import/no-duplicates */
3+
import { type Meta } from '@storybook/web-components';
4+
45
import '@justeattakeaway/pie-assistive-text';
5-
import { AssistiveTextProps as AssistiveTextBaseProps, variants, defaultProps } from '@justeattakeaway/pie-assistive-text';
6-
/* eslint-enable import/no-duplicates */
6+
import { type AssistiveTextProps as AssistiveTextBaseProps, variants, defaultProps } from '@justeattakeaway/pie-assistive-text';
77

8-
import { type StoryMeta, SlottedComponentProps } from '../types';
8+
import { type SlottedComponentProps } from '../types';
99
import { createStory, type TemplateFunction, sanitizeAndRenderHTML } from '../utilities';
1010

1111
type AssistiveTextProps = SlottedComponentProps<AssistiveTextBaseProps>;
12-
type AssistiveTextStoryMeta = StoryMeta<AssistiveTextProps>;
12+
type AssistiveTextStoryMeta = Meta<AssistiveTextProps>;
1313

1414
const defaultArgs: AssistiveTextProps = {
1515
...defaultProps,

apps/pie-storybook/stories/pie-button.stories.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
import { html, nothing } from 'lit';
22
import { ifDefined } from 'lit/directives/if-defined.js';
3+
import { type Meta } from '@storybook/web-components';
34

4-
/* eslint-disable import/no-duplicates */
55
import '@justeattakeaway/pie-button';
66
import {
7-
type ButtonProps as ButtonPropsBase,
8-
defaultProps, iconPlacements, responsiveSizes, sizes, types, variants,
7+
type ButtonProps as ButtonPropsBase, defaultProps, iconPlacements, responsiveSizes, sizes, types, variants,
98
} from '@justeattakeaway/pie-button';
10-
/* eslint-enable import/no-duplicates */
119
import '@justeattakeaway/pie-icons-webc/dist/IconPlusCircle.js';
1210

1311
import { createStory, type TemplateFunction, sanitizeAndRenderHTML } from '../utilities';
14-
import { type StoryMeta, type SlottedComponentProps } from '../types';
12+
import { type SlottedComponentProps } from '../types';
1513

1614
type ButtonProps = SlottedComponentProps<ButtonPropsBase>;
17-
type ButtonStoryMeta = StoryMeta<ButtonProps>;
15+
type ButtonStoryMeta = Meta<ButtonProps>;
1816

1917
const defaultArgs: ButtonProps = {
2018
...defaultProps,

apps/pie-storybook/stories/pie-card.stories.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
import { nothing } from 'lit';
22
import { html } from 'lit/static-html.js';
33
import { ifDefined } from 'lit/directives/if-defined.js';
4+
import { type Meta } from '@storybook/web-components';
45

5-
/* eslint-disable import/no-duplicates */
66
import '@justeattakeaway/pie-card';
77
import {
8-
CardProps as CardPropsBase, variants, tags, paddingValues, defaultProps,
8+
type CardProps as CardPropsBase, variants, tags, paddingValues, defaultProps,
99
} from '@justeattakeaway/pie-card';
10-
/* eslint-enable import/no-duplicates */
1110

12-
import type { StoryMeta, SlottedComponentProps } from '../types';
11+
import { type SlottedComponentProps } from '../types';
1312
import { createStory, type TemplateFunction, sanitizeAndRenderHTML } from '../utilities';
1413

1514
type CardProps = SlottedComponentProps<CardPropsBase>;
16-
type CardStoryMeta = StoryMeta<CardProps>;
15+
type CardStoryMeta = Meta<CardProps>;
1716

1817
const defaultArgs: CardProps = {
1918
...defaultProps,

apps/pie-storybook/stories/pie-checkbox-group.stories.ts

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
import { html, nothing } from 'lit';
22
import { ifDefined } from 'lit/directives/if-defined.js';
3-
/* eslint-disable import/no-duplicates */
4-
import '@justeattakeaway/pie-checkbox-group';
5-
import { CheckboxGroupProps as CheckboxGroupBase, defaultProps, statusTypes } from '@justeattakeaway/pie-checkbox-group';
6-
/* eslint-enable import/no-duplicates */
7-
8-
import { type StoryMeta } from '../types';
9-
import { createStory } from '../utilities';
3+
import { type Meta } from '@storybook/web-components';
104

5+
import '@justeattakeaway/pie-checkbox-group';
6+
import { type CheckboxGroupProps as CheckboxGroupBase, defaultProps, statusTypes } from '@justeattakeaway/pie-checkbox-group';
117
import '@justeattakeaway/pie-link';
128
import '@justeattakeaway/pie-checkbox';
139
import '@justeattakeaway/pie-form-label';
1410

11+
import { createStory } from '../utilities';
12+
1513
// Extending the props type definition to include storybook specific properties for controls
1614
type CheckboxGroupProps = CheckboxGroupBase & {
1715
labelSlot: keyof typeof labelSlotOptions;
1816
};
1917

20-
type CheckboxGroupStoryMeta = StoryMeta<CheckboxGroupProps>;
18+
type CheckboxGroupStoryMeta = Meta<CheckboxGroupProps>;
2119

2220
const defaultArgs: CheckboxGroupProps = {
2321
...defaultProps,

apps/pie-storybook/stories/pie-checkbox.stories.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { html } from 'lit';
22
import { ifDefined } from 'lit/directives/if-defined.js';
3-
/* eslint-disable import/no-duplicates */
3+
import { type Meta } from '@storybook/web-components';
4+
45
import '@justeattakeaway/pie-checkbox';
56
import { type CheckboxProps as CheckboxBaseProps, defaultProps, statusTypes } from '@justeattakeaway/pie-checkbox';
6-
/* eslint-enable import/no-duplicates */
77

88
import { action } from '@storybook/addon-actions';
9-
import { type StoryMeta, type SlottedComponentProps } from '../types';
9+
import { type SlottedComponentProps } from '../types';
1010
import { createStory, type TemplateFunction, sanitizeAndRenderHTML } from '../utilities';
1111

1212
type CheckboxProps = SlottedComponentProps<CheckboxBaseProps>;
13-
type CheckboxStoryMeta = StoryMeta<CheckboxProps>;
13+
type CheckboxStoryMeta = Meta<CheckboxProps>;
1414

1515
const defaultArgs: CheckboxProps = {
1616
...defaultProps,

apps/pie-storybook/stories/pie-chip.stories.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import { html, nothing } from 'lit';
2-
import { action } from '@storybook/addon-actions';
32
import { ifDefined } from 'lit/directives/if-defined.js';
3+
import { action } from '@storybook/addon-actions';
4+
import { type Meta } from '@storybook/web-components';
45

5-
/* eslint-disable import/no-duplicates */
66
import '@justeattakeaway/pie-chip';
7-
import { ChipProps as ChipPropsBase, variants, defaultProps } from '@justeattakeaway/pie-chip';
8-
/* eslint-enable import/no-duplicates */
7+
import { type ChipProps as ChipPropsBase, variants, defaultProps } from '@justeattakeaway/pie-chip';
98
import '@justeattakeaway/pie-icons-webc/dist/IconHeartFilled.js';
109

11-
import type { StoryMeta, SlottedComponentProps } from '../types';
10+
import { type SlottedComponentProps } from '../types';
1211
import { createStory, type TemplateFunction, sanitizeAndRenderHTML } from '../utilities';
1312

1413
type ChipProps = SlottedComponentProps<ChipPropsBase> & { showIcon: boolean };
15-
type ChipStoryMeta = StoryMeta<ChipProps>;
14+
type ChipStoryMeta = Meta<ChipProps>;
1615

1716
const defaultArgs: ChipProps = {
1817
...defaultProps,

apps/pie-storybook/stories/pie-cookie-banner.stories.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { html } from 'lit';
22
import { action } from '@storybook/addon-actions';
3+
import { type Meta } from '@storybook/web-components';
34

45
import '@justeattakeaway/pie-cookie-banner';
56
import { type CookieBannerProps, defaultProps } from '@justeattakeaway/pie-cookie-banner';
67
import pieCookieBannerLocales from '@justeattakeaway/pie-cookie-banner/locales';
78

8-
import { type StoryMeta } from '../types';
99
import { createStory } from '../utilities';
1010

11-
type CookieBannerStoryMeta = StoryMeta<CookieBannerProps>;
11+
type CookieBannerStoryMeta = Meta<CookieBannerProps>;
1212

1313
const defaultArgs: CookieBannerProps = {
1414
...defaultProps,

apps/pie-storybook/stories/pie-divider.stories.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
import { html } from 'lit';
22
import { ifDefined } from 'lit/directives/if-defined.js';
3+
import { type Meta } from '@storybook/web-components';
34

4-
/* eslint-disable import/no-duplicates */
55
import '@justeattakeaway/pie-divider';
66
import {
77
type DividerProps, variants, orientations, defaultProps,
88
} from '@justeattakeaway/pie-divider';
9-
/* eslint-enable import/no-duplicates */
109

11-
import { type StoryMeta } from '../types';
1210
import { createStory, type TemplateFunction } from '../utilities';
1311

14-
type DividerStoryMeta = StoryMeta<DividerProps>;
12+
type DividerStoryMeta = Meta<DividerProps>;
1513

1614
const defaultArgs: DividerProps = { ...defaultProps };
1715

@@ -68,4 +66,3 @@ export const Default = createDividerStory();
6866
export const Inverse = createDividerStory({ variant: 'inverse' }, { bgColor: 'dark (container-dark)' });
6967
export const Labelled = createDividerStory({ label: 'Label' });
7068
export const LargeTextContent = createDividerStory({ label: 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit quas inventore quasi ullam, sed ab odio dicta, tempore' });
71-

apps/pie-storybook/stories/pie-form-label.stories.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import { html, nothing } from 'lit';
2+
import { type Meta } from '@storybook/web-components';
23

3-
/* eslint-disable import/no-duplicates */
44
import '@justeattakeaway/pie-form-label';
5-
import { FormLabelProps as FormLabelPropsBase } from '@justeattakeaway/pie-form-label';
6-
/* eslint-enable import/no-duplicates */
5+
import { type FormLabelProps as FormLabelPropsBase } from '@justeattakeaway/pie-form-label';
76

8-
import { SlottedComponentProps, type StoryMeta } from '../types';
7+
import { type SlottedComponentProps } from '../types';
98
import { createStory, type TemplateFunction, sanitizeAndRenderHTML } from '../utilities';
109

1110
type FormLabelProps = SlottedComponentProps<FormLabelPropsBase>;
12-
type FormLabelStoryMeta = StoryMeta<FormLabelProps>;
11+
type FormLabelStoryMeta = Meta<FormLabelProps>;
1312

1413
const defaultArgs: FormLabelProps = {
1514
for: 'form-label',

apps/pie-storybook/stories/pie-icon-button.stories.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
import { html } from 'lit';
22
import { ifDefined } from 'lit/directives/if-defined.js';
3+
import { type Meta } from '@storybook/web-components';
34

4-
/* eslint-disable import/no-duplicates */
55
import '@justeattakeaway/pie-icon-button';
66
import {
7-
IconButtonProps, sizes, variants, defaultProps,
7+
type IconButtonProps, sizes, variants, defaultProps,
88
} from '@justeattakeaway/pie-icon-button';
9-
/* eslint-enable import/no-duplicates */
109
import '@justeattakeaway/pie-icons-webc/dist/IconClose.js';
1110

12-
import { StoryMeta } from '../types';
1311
import { createStory, type TemplateFunction } from '../utilities';
1412

15-
type IconButtonStoryMeta = StoryMeta<IconButtonProps>;
13+
type IconButtonStoryMeta = Meta<IconButtonProps>;
1614

1715
const defaultArgs: IconButtonProps = { ...defaultProps };
1816

apps/pie-storybook/stories/pie-link.stories.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import { html, nothing } from 'lit';
22
import { ifDefined } from 'lit/directives/if-defined.js';
3+
import { type Meta } from '@storybook/web-components';
34

45
import '@justeattakeaway/pie-link';
56
import {
6-
type LinkProps as LinkBaseProps, sizes, variants,
7-
iconPlacements, tags, buttonTypes, underlineTypes, defaultProps,
7+
type LinkProps as LinkBaseProps, sizes, variants, iconPlacements, tags, buttonTypes, underlineTypes, defaultProps,
88
} from '@justeattakeaway/pie-link';
99
import '@justeattakeaway/pie-icons-webc/dist/IconPlusCircle.js';
1010

11-
import { type StoryMeta, type SlottedComponentProps } from '../types';
11+
import { type SlottedComponentProps } from '../types';
1212
import { createStory, type TemplateFunction, sanitizeAndRenderHTML } from '../utilities';
1313

1414
type LinkProps = SlottedComponentProps<LinkBaseProps>;
15-
type LinkStoryMeta = StoryMeta<LinkProps>;
15+
type LinkStoryMeta = Meta<LinkProps>;
1616

1717
const defaultArgs: LinkProps = {
1818
...defaultProps,

apps/pie-storybook/stories/pie-lottie-player.stories.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import { html } from 'lit';
2-
/* eslint-disable import/no-duplicates */
2+
import { type Meta } from '@storybook/web-components';
3+
34
import '@justeattakeaway/pie-lottie-player';
45
import {
56
type LottiePlayerProps as LottiePlayerBaseProps, PieLottiePlayer, defaultProps, directions,
67
} from '@justeattakeaway/pie-lottie-player';
7-
/* eslint-enable import/no-duplicates */
88

9-
import { type StoryMeta } from '../types';
109
import { createStory } from '../utilities';
1110

1211
type LottiePlayerProps = Omit<LottiePlayerBaseProps, 'play' | 'stop'>
13-
type LottiePlayerStoryMeta = StoryMeta<LottiePlayerProps>;
12+
type LottiePlayerStoryMeta = Meta<LottiePlayerProps>;
1413

1514
const defaultArgs: LottiePlayerProps = { ...defaultProps };
1615

0 commit comments

Comments
 (0)