Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"node": "^24.0.0"
},
"packageManager": "pnpm@9.1.1",
"pnpm": {
"overrides": {
"@swc/core": "^1.15.0"
}
},
"devDependencies": {
"@commitlint/cli": "^17.0.2",
"@commitlint/config-conventional": "^17.0.2",
Expand Down
8 changes: 2 additions & 6 deletions packages/react-component-library/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ module.exports = {
},
},
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@storybook/addon-interactions'),
getAbsolutePath('@storybook/addon-a11y'),
'@storybook/addon-webpack5-compiler-babel',
],
Expand Down Expand Up @@ -49,11 +47,13 @@ module.exports = {
},

stories: ['../src/**/*.stories.tsx', '../src/**/*.mdx'],

staticDirs: [
'../src/forms/images',
'../src/tokens/images',
'../src/intro/static',
],

framework: {
name: getAbsolutePath('@storybook/react-webpack5'),

Expand All @@ -62,10 +62,6 @@ module.exports = {
},
},

docs: {
autodocs: true,
},

typescript: {
reactDocgen: 'react-docgen',
},
Expand Down
4 changes: 2 additions & 2 deletions packages/react-component-library/.storybook/manager.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { addons } from '@storybook/manager-api'
import { themes } from '@storybook/theming'
import { addons } from 'storybook/manager-api'
import { themes } from 'storybook/theming'

addons.setConfig({
theme: themes.light,
Expand Down
3 changes: 2 additions & 1 deletion packages/react-component-library/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DocsPage } from '@storybook/addon-docs'
import { DocsPage } from '@storybook/addon-docs/blocks'
import isChromatic from 'chromatic'
import React from 'react'
import '@royalnavy/fonts'
Expand Down Expand Up @@ -75,3 +75,4 @@ const fontLoader = async () => ({
})

export const loaders = isChromatic() && document.fonts ? [fontLoader] : []
export const tags = ['autodocs']
29 changes: 11 additions & 18 deletions packages/react-component-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"test:e2e:install": "playwright install --with-deps",
"test:e2e:show-report": "playwright show-report e2e-output/html",
"test:e2e:trace": "playwright test --trace retain-on-failure",
"types": "tsc",
"types": "tsc -p tsconfig.build.json",
"playwright:install": "playwright install --with-deps chromium",
"ci:server:storybook": "http-server .static_storybook --port 6006 --silent",
"ci:test:a11y": "concurrently -k -s first -n 'SB,TEST' -c 'magenta,blue' 'pnpm run ci:server:storybook' 'wait-on tcp:6006 && pnpm run test:a11y'"
Expand Down Expand Up @@ -82,19 +82,11 @@
"@happy-dom/jest-environment": "^14.10.1",
"@playwright/test": "^1.47.2",
"@royalnavy/eslint-config-react": "^4.51.2",
"@storybook/addon-a11y": "^8.3.4",
"@storybook/addon-actions": "^8.3.4",
"@storybook/addon-essentials": "^8.3.4",
"@storybook/addon-interactions": "^8.3.4",
"@storybook/addon-links": "^8.3.4",
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
"@storybook/blocks": "^8.3.4",
"@storybook/manager-api": "^8.3.4",
"@storybook/react": "^8.3.4",
"@storybook/react-webpack5": "^8.3.4",
"@storybook/test": "^8.3.4",
"@storybook/test-runner": "^0.19.1",
"@storybook/theming": "^8.3.4",
"@storybook/addon-a11y": "^10.4.6",
"@storybook/addon-links": "^10.4.6",
"@storybook/addon-webpack5-compiler-babel": "^4.0.1",
"@storybook/react-webpack5": "^10.4.6",
"@storybook/test-runner": "^0.24.4",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.1",
Expand Down Expand Up @@ -127,7 +119,7 @@
"csstype": "^3.1.3",
"eslint": "^8.2.0",
"eslint-plugin-playwright": "^0.12.0",
"eslint-plugin-storybook": "^0.6.15",
"eslint-plugin-storybook": "^10.4.6",
"formik": "^2.2.9",
"hex-rgb": "^5.0.0",
"html-webpack-plugin": "^5.2.0",
Expand All @@ -147,7 +139,7 @@
"react-hook-form": "6.15.8",
"react-hot-loader": "^4.12.19",
"source-map-loader": "^4.0.1",
"storybook": "^8.3.4",
"storybook": "^10.4.6",
"styled-components": "^6.1.8",
"timezone-mock": "^1.1.3",
"typescript": "^5.4.4",
Expand All @@ -157,7 +149,8 @@
"webpack": "^5.94.0",
"webpack-bundle-analyzer": "^4.2.0",
"webpack-cli": "^5.0.1",
"webpack-merge": "^5.2.0"
"webpack-merge": "^5.2.0",
"@storybook/addon-docs": "^10.4.6"
},
"files": [
"dist"
Expand Down Expand Up @@ -192,4 +185,4 @@
"peerDependencies": {
"styled-components": ">= 6"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { StoryFn, Meta } from '@storybook/react-webpack5'

import { Alert, ALERT_VARIANT } from './index'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
IconBrightnessAuto,
IconRemove,
} from '@royalnavy/icon-library'
import { StoryFn, Meta } from '@storybook/react'
import { StoryFn, Meta } from '@storybook/react-webpack5'
import styled from 'styled-components'

import { Autocomplete, AutocompleteOption } from './index'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { StoryFn, Meta } from '@storybook/react-webpack5'

import { Avatar, AVATAR_VARIANT } from '.'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import styled from 'styled-components'
import { spacing } from '@royalnavy/design-tokens'
import { Meta, StoryFn } from '@storybook/react'
import { Meta, StoryFn } from '@storybook/react-webpack5'

import {
Badge,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { StoryFn, Meta } from '@storybook/react-webpack5'

import { Breadcrumbs, BreadcrumbsItem } from '.'
import { Link } from '../Link'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import styled from 'styled-components'

import { Meta, StoryFn } from '@storybook/react'
import { Meta, StoryFn } from '@storybook/react-webpack5'

import { IconWifi, IconWeb, IconAnchor } from '@royalnavy/icon-library'
import { spacing } from '@royalnavy/design-tokens'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { action } from '@storybook/addon-actions'
import { StoryFn, Meta } from '@storybook/react-webpack5'
import { action } from 'storybook/actions'
import { IconBrightnessLow } from '@royalnavy/icon-library'

import { ButtonGroup, ButtonGroupItem } from '.'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { StoryFn, Meta } from '@storybook/react-webpack5'

import { CardFrame } from './index'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { StoryFn, Meta } from '@storybook/react-webpack5'
import { color } from '@royalnavy/design-tokens'

import { Checkbox, IndeterminateCheckbox, CheckboxProps } from '.'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { StoryFn, Meta } from '@storybook/react-webpack5'

import { ClassificationBar } from './ClassificationBar'
import { storyAccessibilityConfig } from '../../a11y/storyAccessibilityConfig'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useRef } from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { StoryFn, Meta } from '@storybook/react-webpack5'
import { color } from '@royalnavy/design-tokens'
import styled from 'styled-components'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { faker } from '@faker-js/faker'
import React, { useCallback, useState } from 'react'
import styled, { css } from 'styled-components'
import { spacing } from '@royalnavy/design-tokens'
import { fn } from '@storybook/test'
import { Meta, StoryFn } from '@storybook/react'
import { fn } from 'storybook/test'
import { Meta, StoryFn } from '@storybook/react-webpack5'
import type {
ColumnDef,
SortingState,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { Meta, StoryFn } from '@storybook/react'
import {
addDays,
endOfMonth,
parseISO,
startOfMonth,
subDays,
} from 'date-fns'
import { Meta, StoryFn } from '@storybook/react-webpack5'
import { addDays, endOfMonth, parseISO, startOfMonth, subDays } from 'date-fns'
import React from 'react'
import styled from 'styled-components'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { StoryFn, Meta } from '@storybook/react-webpack5'

import { storyAccessibilityConfig } from '../../a11y/storyAccessibilityConfig'
import { DescriptionList, DescriptionListItem } from './index'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useRef } from 'react'
import { Meta, StoryFn } from '@storybook/react'
import { Meta, StoryFn } from '@storybook/react-webpack5'
import { color, spacing } from '@royalnavy/design-tokens'
import styled from 'styled-components'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Meta, StoryFn as Story } from '@storybook/react'
import { Meta, StoryFn as Story } from '@storybook/react-webpack5'

import { DismissibleBanner, DismissibleBannerWithTitleProps } from '.'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import styled from 'styled-components'

import { Meta, StoryFn } from '@storybook/react'
import { Meta, StoryFn } from '@storybook/react-webpack5'
import { color } from '@royalnavy/design-tokens'

import { Drawer } from '.'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { action } from '@storybook/addon-actions'
import { StoryFn, Meta } from '@storybook/react-webpack5'
import { action } from 'storybook/actions'
import { IconLayers, IconAnchor } from '@royalnavy/icon-library'
import styled from 'styled-components'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { StoryFn, Meta } from '@storybook/react-webpack5'

import { Field } from './index'
import { TextInput } from '../TextInput'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { StoryFn, Meta } from '@storybook/react-webpack5'

import { Fieldset } from './index'
import { Field } from '../Field'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Meta, StoryFn } from '@storybook/react'
import { Meta, StoryFn } from '@storybook/react-webpack5'

import { Group } from '.'
import { Button } from '../Button'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { action } from '@storybook/addon-actions'
import { StoryFn, Meta } from '@storybook/react-webpack5'
import { action } from 'storybook/actions'

import { List, ListItem } from '.'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useRef, useEffect } from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { StoryFn, Meta } from '@storybook/react-webpack5'
import { fn } from 'storybook/test'
import styled from 'styled-components'
import { spacing } from '@royalnavy/design-tokens'
import noop from 'lodash/noop'
Expand All @@ -21,12 +22,15 @@ export default {
component: Modal,
title: 'Components/Modal',
parameters: {
actions: { argTypesRegex: '^on.*' },
layout: 'fullscreen',
jsx: {
showFunctions: true,
},
},
args: {
onOpen: fn(),
onClose: fn(),
},
} as Meta<typeof Modal>

const primaryButton: ButtonProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Meta, StoryFn } from '@storybook/react'
import { Meta, StoryFn } from '@storybook/react-webpack5'
import {
IconAnchor,
IconBrightnessHigh,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { StoryFn, Meta } from '@storybook/react-webpack5'

import { Pagination } from '.'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import styled from 'styled-components'

import { color, spacing } from '@royalnavy/design-tokens'
import { Meta, StoryFn } from '@storybook/react'
import { Meta, StoryFn } from '@storybook/react-webpack5'

import { Panel } from './index'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { StoryFn, Meta } from '@storybook/react-webpack5'
import styled from 'styled-components'

import { PhaseBanner } from '.'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { StoryFn, Meta } from '@storybook/react-webpack5'
import styled from 'styled-components'

import { FLOATING_BOX_SCHEME } from '../../primitives/FloatingBox'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Meta, StoryFn } from '@storybook/react'
import { Meta, StoryFn } from '@storybook/react-webpack5'

import { ProgressBar } from '.'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import styled from 'styled-components'
import { StoryFn, Meta } from '@storybook/react'
import { StoryFn, Meta } from '@storybook/react-webpack5'

import { StyledProgressIndicator } from './partials/StyledProgressIndicator'
import { ProgressIndicator } from './index'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { StoryFn, Meta } from '@storybook/react'
import { StoryFn, Meta } from '@storybook/react-webpack5'

import { color } from '@royalnavy/design-tokens'
import { Radio, RadioProps } from '.'
Expand Down
Loading
Loading