Skip to content

Commit 24af74f

Browse files
committed
Merge branch 'appdir'
2 parents 1b18203 + 6bd7ffe commit 24af74f

File tree

107 files changed

+3455
-518
lines changed

Some content is hidden

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

107 files changed

+3455
-518
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ dist/
33
CHANGELOG.md
44
.yarn_home/
55
src/integration/
6-
src/lib/tools/@mui/
76

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
test/integration/**/* linguist-documentation
2-
src/lib/tools/@mui/**/* linguist-documentation
32
.eslintrc.js linguist-documentation
43
src/bin/copy-dsfr-to-public.ts -linguist-detectable
54
src/bin/only-include-used-icons.ts -linguist-detectable

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jspm_packages
4444
/dist
4545
/.yarn_home
4646
/dsfr
47-
/src/lib/generatedFromCss
47+
/src/fr/generatedFromCss
4848
/storybook-static
4949

5050

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ node_modules/
44
/.yarn_home/
55
/test/integration/
66
/dsfr/
7-
/src/lib/tools/@mui/

.storybook/DocsContainer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { useDarkMode } from "storybook-dark-mode";
55
import { darkTheme, lightTheme } from "./customTheme";
66
import "../dist/dsfr/dsfr.css";
77
import "../dist/dsfr/utility/icons/icons.min.css";
8-
import { startReactDsfr, useIsDark, useColors } from "../dist";
8+
import { useIsDark } from "../dist/useIsDark";
9+
import { startReactDsfr } from "../dist/spa";
10+
import { useColors } from "../dist/useColors";
911

1012
startReactDsfr({
1113
"defaultColorScheme": "system",

COMPONENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@
4040
- [ ] Tag
4141
- [ ] Download
4242
- [ ] Transcription
43-
- [x] Tile
43+
- [ ] Tile

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ yarn storybook
9292

9393
# Starting test apps
9494
yarn start-cra # For testing in in a Create React App setup
95-
yarn start-next # For testing in a Next.js setup
9695
yarn start-vite # For testing in a Vite setup
96+
yarn start-next-pagesdir # For testing in a Next.js 13 PagesDir setup (the default setup)
97+
yarn start-next-appdir # For testing in a Next.js 13 AppDir setup
9798

9899
# Run all unit test (test/runtime):
99100
yarn test

package.json

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codegouvfr/react-dsfr",
3-
"version": "0.13.0",
3+
"version": "0.12.1",
44
"description": "French State Design System React integration library",
55
"repository": {
66
"type": "git",
@@ -10,8 +10,9 @@
1010
"build": "ts-node -T src/scripts/build",
1111
"yarn-link": "ts-node -T src/scripts/yarn-link.ts",
1212
"start-cra": "yarn build && yarn yarn-link && ((tsc -w -p src) & (cd test/integration/cra && yarn start))",
13-
"start-next": "yarn build && yarn yarn-link && ((tsc -w -p src) & (cd test/integration/next && yarn dev))",
1413
"start-vite": "yarn build && yarn yarn-link && ((tsc -w -p src) & (cd test/integration/vite && yarn dev))",
14+
"start-next-pagesdir": "yarn build && yarn yarn-link && ((tsc -w -p src) & (cd test/integration/next-pagesdir && yarn dev))",
15+
"start-next-appdir": "yarn build && yarn yarn-link && ((tsc -w -p src) & (cd test/integration/next-appdir && yarn dev))",
1516
"test": "vitest",
1617
"lint:check": "eslint . --ext .ts,.tsx",
1718
"lint": "yarn lint:check --fix",
@@ -115,15 +116,21 @@
115116
"typescript": "^4.9.1-beta",
116117
"vitest": "^0.24.3"
117118
},
118-
"main": "dist/lib/index.js",
119-
"types": "dist/lib/index.d.ts",
120-
"module": "dist/lib/index.js",
119+
"main": "dist/fr/index.js",
120+
"types": "dist/fr/index.d.ts",
121+
"module": "dist/fr/index.js",
121122
"exports": {
122-
".": "./dist/lib/index.js",
123-
"./next": "./dist/next.js",
123+
".": "./dist/fr/index.js",
124+
"./spa": "./dist/spa.js",
125+
"./next-appdir": "./dist/next-appdir/index.js",
126+
"./next-appdir/DsfrHead": "./dist/next-appdir/DsfrHead.js",
127+
"./next-appdir/DsfrProvider": "./dist/next-appdir/DsfrProvider.js",
128+
"./next-appdir/getColorSchemeHtmlAttributes": "./dist/next-appdir/getColorSchemeHtmlAttributes.js",
129+
"./next-pagesdir": "./dist/next-pagesdir.js",
130+
"./useIsDark": "./dist/useIsDark/index.js",
131+
"./useColors": "./dist/useColors.js",
132+
"./i18n": "./dist/i18n/index.js",
124133
"./mui": "./dist/mui.js",
125-
"./lib": "./dist/lib/index.js",
126-
"./Tile": "./dist/Tile.js",
127134
"./Tabs": "./dist/Tabs.js",
128135
"./Summary": "./dist/Summary.js",
129136
"./Stepper": "./dist/Stepper.js",

src/Accordion.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
"use client";
2+
13
import React, { forwardRef, memo, ReactNode, useId, useState } from "react";
24
import { assert } from "tsafe";
35
import type { Equals } from "tsafe";
4-
import { fr } from "./lib";
5-
import { cx } from "./lib/tools/cx";
6+
import { fr } from "./fr";
7+
import { cx } from "./tools/cx";
68
import { symToStr } from "tsafe/symToStr";
7-
import { useConstCallback } from "./lib/tools/powerhooks/useConstCallback";
9+
import { useConstCallback } from "./tools/powerhooks/useConstCallback";
810
import "./dsfr/component/accordion/accordion.css";
911

1012
export type AccordionProps = AccordionProps.Controlled | AccordionProps.Uncontrolled;

src/Alert.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1+
"use client";
2+
13
import React, { memo, forwardRef, useState, useEffect, useRef } from "react";
24
import type { ReactNode } from "react";
3-
import type { FrClassName } from "./lib/generatedFromCss/classNames";
5+
import type { FrClassName } from "./fr/generatedFromCss/classNames";
46
import { symToStr } from "tsafe/symToStr";
5-
import { fr } from "./lib";
6-
import { cx } from "./lib/tools/cx";
7+
import { fr } from "./fr";
8+
import { cx } from "./tools/cx";
79
import { assert } from "tsafe/assert";
810
import type { Equals } from "tsafe";
9-
import { useConstCallback } from "./lib/tools/powerhooks/useConstCallback";
10-
import { createComponentI18nApi } from "./lib/i18n";
11-
// We make users import dsfr.css so we don't need to import the scoped CSS
12-
// but in the future if we have a complete component coverage it
13-
// we could stop requiring users to import the hole CSS and only import on a
14-
// per component basis.
15-
import "./dsfr/component/alert/alert.css";
11+
import { useConstCallback } from "./tools/powerhooks/useConstCallback";
12+
import { createComponentI18nApi } from "./i18n/i18n";
1613

1714
export type AlertProps = {
1815
className?: string;

0 commit comments

Comments
 (0)