Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Implement truncation warning for large numeric input values #212

Closed
wants to merge 77 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
bf071b4
feat: notify users of truncated numeric input values in field display
MailineN Dec 4, 2024
72328c5
chore(deps): update all minor and patch updates (#176)
renovate[bot] Jun 12, 2024
4b1c7b3
orchestrator for stories
ddecrulle Jun 14, 2024
5e40464
chore(deps): update all minor and patch updates (#181)
renovate[bot] Jun 14, 2024
38f1b1b
dep upgrade
ddecrulle Jun 14, 2024
3ecd319
remove console log
ddecrulle Jun 14, 2024
cdcd17e
remove prettier resolution
ddecrulle Jun 14, 2024
ee20b62
Revert "remove prettier resolution"
ddecrulle Jun 14, 2024
fbc9dc9
bump version
ddecrulle Jun 14, 2024
47cee00
error on simple table style
ddecrulle Jun 14, 2024
4ea3753
bump version
ddecrulle Jun 14, 2024
2b3c3fa
chore(deps): update all minor and patch updates (#182)
renovate[bot] Jun 17, 2024
7e86f12
add orientation feature on Radio
ddecrulle Jun 17, 2024
5203c6a
chore(deps): update garronej/ts-ci action to v2.1.5 (#184)
renovate[bot] Jun 20, 2024
d6f664b
style: Question use h4
ddecrulle Jul 3, 2024
c5c8138
v1.22.22
ddecrulle Jul 3, 2024
c6bedd0
fix storybook docs issue and ugrade dep
ddecrulle Jul 3, 2024
203cdc7
adapt table according to new DSFR Table component
ddecrulle Jul 3, 2024
7e0dcec
refacto: adapt roundabout with new modelisation (#188)
ddecrulle Jul 3, 2024
68d9c4f
bump version to 2.1.0
ddecrulle Jul 3, 2024
78762e1
fix #186 and improve error handling
ddecrulle Jul 4, 2024
0d52f5e
upgrade react-dsfr
ddecrulle Jul 4, 2024
caf29ce
Bump version
ddecrulle Jul 4, 2024
2554e72
Delete useEffectOnValueChange.tsx
ddecrulle Jul 4, 2024
bfacc8d
Revert "Delete useEffectOnValueChange.tsx"
ddecrulle Jul 4, 2024
4ac89af
feat: cell can be multiline in table
ddecrulle Jul 4, 2024
4855f00
bump version
ddecrulle Jul 4, 2024
b886796
fix: do not render any html when description is null or undefined
ddecrulle Jul 8, 2024
b88bf25
work on accessibility
ddecrulle Jul 11, 2024
ebb69bb
bump version
ddecrulle Jul 11, 2024
bf8cf6f
aria-describedby -> aria-labelledby
ddecrulle Jul 11, 2024
76096df
improve tooltip
ddecrulle Jul 11, 2024
4c1ac18
fix log msg
ddecrulle Jul 11, 2024
f914c55
upgrade react-dsfr
ddecrulle Jul 11, 2024
6a32118
bump version
ddecrulle Jul 11, 2024
1011b80
update story input
ddecrulle Jul 11, 2024
10e7454
fix style in suggester
ddecrulle Jul 11, 2024
e8486ab
fix: option label can have multiline with p
ddecrulle Jul 11, 2024
abd48f2
style: question add margin bottom
ddecrulle Jul 11, 2024
f4bbe89
bump version
ddecrulle Jul 11, 2024
b90babb
storybook: autodocs changed
ddecrulle Jul 11, 2024
eaad5fc
chore(deps): update all minor and patch updates (#183)
renovate[bot] Jul 16, 2024
d3f7c15
upgrade dependencies
ddecrulle Jul 16, 2024
c24f592
Bump version
ddecrulle Jul 16, 2024
0f03cec
Update to react-dsfr 1.10
garronej Jul 18, 2024
ee7ae46
Update storybook setup
garronej Jul 19, 2024
af5d807
Fix storybook
garronej Jul 19, 2024
35005ba
setup vitest
ddecrulle Jul 25, 2024
8fbc361
fix #193
ddecrulle Jul 25, 2024
87c5220
dep upgrade
ddecrulle Jul 25, 2024
96659a5
bump version
ddecrulle Jul 25, 2024
69deb33
feat: Suggester multiline
ddecrulle Jul 31, 2024
e4a8e12
update stories form
ddecrulle Jul 31, 2024
22e4e3b
fix: arbitrary
ddecrulle Jul 31, 2024
d43fcce
update readme
ddecrulle Aug 1, 2024
e75aaf8
upgrade lunatic
ddecrulle Aug 1, 2024
2526e82
Bump version
ddecrulle Aug 1, 2024
92e77de
Make the internal tooltip focusable
ddecrulle Aug 2, 2024
11dc1b1
remove margin top in table
ddecrulle Aug 2, 2024
c107900
bump version
ddecrulle Aug 2, 2024
209c99f
dep upgrade
ddecrulle Aug 12, 2024
bb9df9f
chore(deps): upgrade to eslint v9 and lunatic
ddecrulle Aug 14, 2024
b9bb387
remove unused rule
ddecrulle Aug 14, 2024
0d55c39
feat: add error display in roundabout (#196)
ddecrulle Aug 19, 2024
78bf60a
bump version
ddecrulle Aug 19, 2024
31c6989
chore(deps): update all minor and patch updates (#191)
renovate[bot] Aug 20, 2024
e991812
chore(deps): update lunatic 3.4.3
QRuhier Sep 11, 2024
a16f15a
bump: 2.4.1
QRuhier Sep 11, 2024
f9642e3
build: fix ci and configuration of build (esm + cjs) (#205)
laurentC35 Oct 28, 2024
b6b7f90
bump: 2.4.2
laurentC35 Oct 28, 2024
54bebdf
feat: add leading zeros to YYYY input (#206)
chloe-renaud Nov 28, 2024
64b5dd1
fix: do not allow decimals in duration input (#207)
chloe-renaud Nov 28, 2024
38f2092
chore(deps): update dependency vite to v5.4.6 [security] (#200)
renovate[bot] Nov 29, 2024
ff8b441
bump: lunatic to 3.4.8 (#208)
laurentC35 Nov 29, 2024
914e795
bump: 2.4.3
laurentC35 Nov 29, 2024
80770d1
fix : do not save unvalid date in Datepicker
QRuhier Nov 29, 2024
61a25f2
feat: extend trunctation to all Input components
MailineN Dec 5, 2024
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
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

14 changes: 0 additions & 14 deletions .eslintrc.cjs

This file was deleted.

15 changes: 6 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
name: ci
on:
push:
branches:
- main
- v1
branches: ["main", "v1"]
pull_request:
branches:
- main
- v1
branches: ["main", "v1"]

jobs:
test_lint:
Expand Down Expand Up @@ -38,6 +34,7 @@ jobs:
- uses: bahmutov/npm-install@v1
env:
XDG_CACHE_HOME: "/home/runner/.cache/yarn"
- run: yarn test
- run: yarn build
- name: Build Storybook
run: yarn run build-storybook
Expand Down Expand Up @@ -114,7 +111,7 @@ jobs:
is_upgraded_version: ${{ steps.step1.outputs.is_upgraded_version }}
is_pre_release: ${{steps.step1.outputs.is_pre_release }}
steps:
- uses: garronej/[email protected].2
- uses: garronej/[email protected].5
id: step1
with:
action_name: is_package_json_version_upgraded
Expand Down Expand Up @@ -158,10 +155,10 @@ jobs:
env:
XDG_CACHE_HOME: "/home/runner/.cache/yarn"
- run: yarn build
- run: npx -y -p denoify@1.3.0 enable_short_npm_import_path
- run: npx -y -p denoify@1.6.13 enable_short_npm_import_path
env:
DRY_RUN: "0"
- uses: garronej/[email protected].2
- uses: garronej/[email protected].5
with:
action_name: remove_dark_mode_specific_images_from_readme
- name: Publishing on NPM
Expand Down
25 changes: 13 additions & 12 deletions .storybook/DocsContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
import { useIsDark } from "@codegouvfr/react-dsfr/useIsDark";
import { DocsContainer as DocsContainer_base } from "@storybook/addon-docs";
import { DocsContainer as DocsContainer_base } from "@storybook/blocks";
import React, { ComponentProps, useEffect } from "react";
import { useDarkMode } from "storybook-dark-mode";
import { darkTheme, lightTheme } from "./customTheme";
import { DARK_MODE_EVENT_NAME } from "storybook-dark-mode";

import { addons } from "@storybook/preview-api";
const channel = addons.getChannel();

type Props = ComponentProps<typeof DocsContainer_base>;

export function DocsContainer(props: Props) {
const { children, context } = props;
const isStorybookUiDark = useDarkMode();
const { setIsDark } = useIsDark();

useEffect(
//Docs Page and storybookUI must have same theme
() => {
setIsDark(isStorybookUiDark);
},
[isStorybookUiDark],
);
const { setIsDark, isDark } = useIsDark();

useEffect(() => {
// listen to DARK_MODE event
channel.on(DARK_MODE_EVENT_NAME, setIsDark);
return () => channel.off(DARK_MODE_EVENT_NAME, setIsDark);
}, [channel, setIsDark]);

return (
<DocsContainer_base context={context} theme={isStorybookUiDark ? darkTheme : lightTheme}>
<DocsContainer_base context={context} theme={isDark ? darkTheme : lightTheme}>
{children}
</DocsContainer_base>
);
Expand Down
13 changes: 10 additions & 3 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
import type { StorybookConfig } from "@storybook/react-vite";
import { mergeConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";

export default {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],

addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"storybook-dark-mode",
"@storybook/addon-a11y",
],

docs: {
//👇 See the table below for the list of supported options
autodocs: true,
defaultName: "Documentation",
},

framework: {
name: "@storybook/react-vite",
options: {},
},

core: {
builder: "@storybook/builder-vite",
},
staticDirs: ["./static"],

async viteFinal(config) {
const { mergeConfig } = await import("vite");

// Merge custom configuration into the default config
return mergeConfig(config, {
plugins: [tsconfigPaths()],
Expand Down
115 changes: 6 additions & 109 deletions .storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -1,115 +1,12 @@
<link rel="apple-touch-icon" href="%PUBLIC_URL%/dsfr/favicon/apple-touch-icon.png" />
<link rel="icon" href="%PUBLIC_URL%/dsfr/favicon/favicon.svg" type="image/svg+xml" />
<link rel="shortcut icon" href="%PUBLIC_URL%/dsfr/favicon/favicon.ico" type="image/x-icon" />
<link
rel="manifest"
href="%PUBLIC_URL%/dsfr/favicon/manifest.webmanifest"
crossorigin="use-credentials"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/favicon/apple-touch-icon.png" />
<link rel="icon" href="%PUBLIC_URL%/favicon/favicon.svg" type="image/svg+xml" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon/favicon.ico" type="image/x-icon" />
<link rel="manifest" href="%PUBLIC_URL%/favicon/manifest.webmanifest" crossorigin="use-credentials" />

<link rel="stylesheet" href="%PUBLIC_URL%/fonts/index.css" />
<!-- Meta tags generated by metatags.io -->
<!-- Primary Meta Tags -->
<title>Lunatic DSFR</title>
<meta name="title" content="lunatic-dsfr components" />
<meta name="description" content="@inseefr/lunatic-dsfr components" />

<style>
@font-face {
font-family: Marianne;
src:
url("./dsfr/fonts/Marianne-Light.woff2") format("woff2"),
url("./dsfr/fonts/Marianne-Light.woff") format("woff");
font-weight: 300;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: Marianne;
src:
url("./dsfr/fonts/Marianne-Light_Italic.woff2") format("woff2"),
url("./dsfr/fonts/Marianne-Light_Italic.woff") format("woff");
font-weight: 300;
font-style: italic;
font-display: swap;
}

@font-face {
font-family: Marianne;
src:
url("./dsfr/fonts/Marianne-Regular.woff2") format("woff2"),
url("./dsfr/fonts/Marianne-Regular.woff") format("woff");
font-weight: 400;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: Marianne;
src:
url("./dsfr/fonts/Marianne-Regular_Italic.woff2") format("woff2"),
url("./dsfr/fonts/Marianne-Regular_Italic.woff") format("woff");
font-weight: 400;
font-style: italic;
font-display: swap;
}

@font-face {
font-family: Marianne;
src:
url("./dsfr/fonts/Marianne-Medium.woff2") format("woff2"),
url("./dsfr/fonts/Marianne-Medium.woff") format("woff");
font-weight: 500;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: Marianne;
src:
url("./dsfr/fonts/Marianne-Medium_Italic.woff2") format("woff2"),
url("./dsfr/fonts/Marianne-Medium_Italic.woff") format("woff");
font-weight: 500;
font-style: italic;
font-display: swap;
}

@font-face {
font-family: Marianne;
src:
url("./dsfr/fonts/Marianne-Bold.woff2") format("woff2"),
url("./dsfr/fonts/Marianne-Bold.woff") format("woff");
font-weight: 700;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: Marianne;
src:
url("./dsfr/fonts/Marianne-Bold_Italic.woff2") format("woff2"),
url("./dsfr/fonts/Marianne-Bold_Italic.woff") format("woff");
font-weight: 700;
font-style: italic;
font-display: swap;
}

@font-face {
font-family: Spectral;
src:
url("./dsfr/fonts/Spectral-Regular.woff2") format("woff2"),
url("./dsfr/fonts/Spectral-Regular.woff") format("woff");
font-weight: 400;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: Spectral;
src:
url("./dsfr/fonts/Spectral-ExtraBold.woff2") format("woff2"),
url("./dsfr/fonts/Spectral-ExtraBold.woff") format("woff");
font-weight: 900;
font-style: normal;
font-display: swap;
}
</style>
28 changes: 24 additions & 4 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import type { Preview } from "@storybook/react";
import { darkTheme, lightTheme } from "./customTheme";
import "./static/dsfr/utility/icons/icons.min.css";
import "./static/dsfr/dsfr.css";
import "@codegouvfr/react-dsfr/main.css";
import { startReactDsfr } from "@codegouvfr/react-dsfr/spa";
import { useIsDark as useIsDsfrDark } from "@codegouvfr/react-dsfr/useIsDark";
import { useDarkMode as useStorybookUiDarkMode } from "storybook-dark-mode";
import { useEffectOnValueChange } from "../src/hooks/useEffectOnValueChange";
import type { Channel } from "@storybook/channels";
import { UPDATE_STORY_ARGS } from "@storybook/core-events";
import React, { useEffect } from "react";
import React, { useEffect, useRef } from "react";
import { DocsContainer } from "./DocsContainer";

const defaultLang = "fr";
Expand All @@ -32,6 +30,7 @@ const preview = {
},
},
},

parameters: {
backgrounds: { disable: true },
docs: {
Expand All @@ -48,6 +47,7 @@ const preview = {
expanded: true,
},
},

argTypes: {
darkMode: {
control: { type: "boolean" },
Expand All @@ -63,6 +63,7 @@ const preview = {
control: { type: "boolean" },
},
},

decorators: [
(Story, context) => {
const isStorybookUiDark = useStorybookUiDarkMode();
Expand All @@ -87,6 +88,25 @@ const preview = {
return <Story />;
},
],

tags: ["autodocs"],
} satisfies Preview;

export default preview;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
function useEffectOnValueChange<T extends readonly [value: any, ...moreValues: any[]]>(
effect: (...args: T) => void | (() => void),
values: T,
): void {
const refIsFistRender = useRef(true);

useEffect(() => {
if (refIsFistRender.current) {
refIsFistRender.current = false;
return;
}

return effect(...values);
}, values);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .storybook/static/favicon/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .storybook/static/favicon/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions .storybook/static/favicon/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions .storybook/static/favicon/manifest.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"icons": [
{
"src": "android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
Binary file added .storybook/static/fonts/Marianne-Bold.woff
Binary file not shown.
Binary file added .storybook/static/fonts/Marianne-Bold.woff2
Binary file not shown.
Binary file added .storybook/static/fonts/Marianne-Bold_Italic.woff
Binary file not shown.
Binary file not shown.
Binary file added .storybook/static/fonts/Marianne-Light.woff
Binary file not shown.
Binary file added .storybook/static/fonts/Marianne-Light.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .storybook/static/fonts/Marianne-Medium.woff
Binary file not shown.
Binary file added .storybook/static/fonts/Marianne-Medium.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .storybook/static/fonts/Marianne-Regular.woff
Binary file not shown.
Binary file added .storybook/static/fonts/Marianne-Regular.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .storybook/static/fonts/Spectral-ExtraBold.woff
Binary file not shown.
Binary file added .storybook/static/fonts/Spectral-ExtraBold.woff2
Binary file not shown.
Binary file added .storybook/static/fonts/Spectral-Regular.woff
Binary file not shown.
Binary file added .storybook/static/fonts/Spectral-Regular.woff2
Binary file not shown.
Loading