Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into date-range-picker-…
Browse files Browse the repository at this point in the history
…ux-enhancements
  • Loading branch information
stowball committed Dec 15, 2024
2 parents b243eb2 + 598725a commit 5312a7a
Show file tree
Hide file tree
Showing 24 changed files with 4,572 additions and 3,894 deletions.
5 changes: 5 additions & 0 deletions .changeset/few-pears-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ag.ds-next/yourgov': patch
---

yourgov: Simple markup and UI fixes.
5 changes: 5 additions & 0 deletions .changeset/neat-toes-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ag.ds-next/docs': patch
---

docs: Remove unused react-simple-code-editor.
11 changes: 11 additions & 0 deletions .changeset/new-dragons-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@ag.ds-next/docs': minor
---

docs: Update Storybook to version 8, update NextJS and Playroom to latest minor version.

react: Dependency updates.

yourgov: Dependency updates.

example-site: Dependency updates.
5 changes: 5 additions & 0 deletions .changeset/odd-ants-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ag.ds-next/react': patch
---

callout: Remove callout in control group story as we no longer support this pattern.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
# Enable version updates for npm
- package-ecosystem: 'npm'
# Look for `package.json` and `lock` files in the `root` directory
directory: '/'
# Check the npm registry for updates every day (weekdays)
schedule:
interval: 'weekly'
2 changes: 0 additions & 2 deletions .github/workflows/deploy-develop-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ jobs:
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ jobs:
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ jobs:
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ jobs:
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn
Expand Down Expand Up @@ -67,8 +65,6 @@ jobs:
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn
Expand Down Expand Up @@ -102,8 +98,6 @@ jobs:
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn
Expand Down
94 changes: 14 additions & 80 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,97 +1,31 @@
import path from 'path';
import { existsSync } from 'fs';
import { readdir } from 'fs/promises';
import type { StorybookConfig } from '@storybook/react-vite';
import type { StorybookConfig } from '@storybook/react-webpack5';

const config: StorybookConfig = {
framework: {
name: '@storybook/react-vite',
options: {},
},
core: {
builder: '@storybook/builder-vite',
},
features: {
storyStoreV7: false,
buildStoriesJson: true,
},
framework: '@storybook/nextjs',
addons: [
'@storybook/addon-links',
'@storybook/addon-a11y',
{ name: '@storybook/addon-essentials', options: { background: false } },
{
name: '@storybook/addon-essentials',
options: { background: false },
},
],
stories: [
'../packages/*/src/**/*.stories.@(ts|tsx)',
'../example-site/**/*.stories.@(ts|tsx)',
'../docs/content/**/*.stories.@(ts|tsx)',
'./stories/**/*.stories.@(ts|tsx)',
],
core: {
builder: {
name: '@storybook/builder-webpack5',
options: {},
},
},
staticDirs: ['../example-site/public'],
// Extend the vite config to work in a monorepo
// See https://vitejs.dev/guide/dep-pre-bundling.html#monorepos-and-linked-dependencies
viteFinal: async function viteConfig(config) {
const entryPoints = await getEntryPoints();
const include = config.build?.commonjsOptions?.include;

return {
...config,
define: {
...config.define,
'process.env': {},
},
resolve: {
alias: {
'next/router': 'next-router-mock',
},
},
optimizeDeps: {
...config.optimizeDeps,
include: [
...(config.optimizeDeps?.include ?? []),
...entryPoints.map((name) => `@ag.ds-next/react/${name}`),
],
},
build: {
...config.build,
rollupOptions: {
...config.build?.rollupOptions,
onwarn(warning, defaultHandler) {
if (
warning.message.startsWith(
'Module level directives cause errors when bundled, "use client"'
) ||
warning.message ===
"Error when using sourcemap for reporting an error: Can't resolve original location of error."
) {
return;
}
defaultHandler(warning);
},
},
commonjsOptions: {
...config.build?.commonjsOptions,
include: [
...(include ? (Array.isArray(include) ? include : [include]) : []),
/(packages\/react.+.cjs.js)/,
/node_modules/,
],
},
},
};
typescript: {
reactDocgen: false,
},
};

export default config;

async function getEntryPoints() {
const basePath = `${process.cwd()}/packages/react`;

// Get the contents of the `@ag.ds-next/react` package
const folderContents = await readdir(basePath, {
withFileTypes: true,
});

return folderContents
.filter(({ name }) => existsSync(path.join(basePath, name, 'package.json')))
.map(({ name }) => name);
}
6 changes: 5 additions & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,17 @@ function makeViewports() {
}

const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
options: {
storySort: {
method: 'alphabetical',
},
},
viewport: {
viewports: makeViewports(),
},
Expand Down
5 changes: 2 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,16 @@
"@types/gtag.js": "^0.0.12",
"clipboard-copy": "^4.0.1",
"gray-matter": "^4.0.3",
"next": "^14.0.4",
"next": "^14.2.10",
"next-mdx-remote": "^4.4.1",
"next-remote-watch": "^2.0.0",
"next-sitemap": "^4.2.3",
"playroom": "^0.32.0",
"playroom": "^0.39.1",
"prism-react-renderer": "^2.1.0",
"prismjs": "^1.29.0",
"react": "18.1.0",
"react-dom": "18.1.0",
"react-live": "^4.1.5",
"react-simple-code-editor": "^0.13.1",
"remark-hint": "^1.0.10",
"remark-mdx-code-meta": "^2.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion example-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@hookform/resolvers": "^2.8.8",
"@preconstruct/next": "^4.0.0",
"@types/gtag.js": "^0.0.12",
"next": "^14.0.4",
"next": "^14.2.10",
"react": "18.1.0",
"react-dom": "18.1.0",
"react-hook-form": "^7.27.1",
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,17 @@
"@emotion/react": "^11.7.0",
"@faker-js/faker": "^7.6.0",
"@manypkg/cli": "^0.20.0",
"@preconstruct/cli": "^2.8.4",
"@preconstruct/cli": "^2.8.10",
"@preconstruct/next": "^4.0.0",
"@storybook/addon-a11y": "^7.6.7",
"@storybook/addon-actions": "^7.6.7",
"@storybook/addon-essentials": "^7.6.7",
"@storybook/addon-interactions": "^7.6.7",
"@storybook/addon-links": "^7.6.7",
"@storybook/builder-vite": "^7.6.7",
"@storybook/react": "^7.6.7",
"@storybook/react-vite": "^7.6.7",
"@storybook/addon-a11y": "^8.4.7",
"@storybook/addon-actions": "^8.4.7",
"@storybook/addon-essentials": "^8.4.7",
"@storybook/addon-interactions": "^8.4.7",
"@storybook/addon-links": "^8.4.7",
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
"@storybook/nextjs": "^8.4.7",
"@storybook/react": "^8.4.7",
"@storybook/react-webpack5": "^8.4.7",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
Expand All @@ -78,21 +79,20 @@
"eslint-config-next": "^13.4.12",
"eslint-config-prettier": "^8.8.0",
"facepaint": "^1.2.1",
"html-validate": "^8.1.0",
"html-validate": "^8.27.0",
"jest": "^29.7.0",
"jest-axe": "^8.0.0",
"jest-environment-jsdom": "^29.7.0",
"next-router-mock": "^0.9.9",
"plop": "^3.1.1",
"prettier": "^3.0.0",
"prettier-plugin-packagejson": "^2.4.5",
"react": "18.1.0",
"react-dom": "18.1.0",
"rimraf": "^3.0.2",
"storybook": "^7.6.7",
"storybook": "^8.4.7",
"swr": "^1.3.0",
"typescript": "^4.7.4",
"vite": "4.4.7"
"webpack": "^5.97.0"
},
"engines": {
"node": "18"
Expand Down
22 changes: 0 additions & 22 deletions packages/react/src/callout/Callout.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { StoryObj, Meta } from '@storybook/react';
import { ConditionalFieldContainer } from '../../../../docs/components/ConditionalFieldContainer';
import { VisuallyHidden } from '../a11y';
import { Box } from '../box';
import { ControlGroup } from '../control-group';
import { Flex } from '../flex';
import { CalendarIcon } from '../icon';
import { Radio } from '../radio';
import { Text } from '../text';
import { Callout } from './Callout';
import { CalloutTitle } from './CalloutTitle';
Expand Down Expand Up @@ -158,25 +155,6 @@ export const CalendarExample: Story = {
),
};

export const InControlGroup: Story = {
render: (args) => (
<ControlGroup label="Control group label" required block>
<Radio checked={false}>Radio option one</Radio>
<Radio checked={true}>Radio option two</Radio>
<ConditionalFieldContainer>
<Callout {...args} />
</ConditionalFieldContainer>
<Radio checked={false}>Text message</Radio>
</ControlGroup>
),
args: {
title: 'Callout heading',
children: <Text as="p">Description of the callout.</Text>,
tone: 'info',
variant: 'compact',
},
};

export const NoTitle: Story = {
args: {
title: undefined,
Expand Down
Loading

0 comments on commit 5312a7a

Please sign in to comment.