aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* refactor(components): rewrite Code component and usePrism hookArmand Philippot2023-11-1121-710/+744
| | | | | | | | | | | | * move Prism styles to Sass placeholders to avoid repeats * let usePrism consumer define its plugins (remove default ones) * remove `plugins` prop from Code component * add new props to Code component to let consumer configure plugins (and handle plugin list from the given options) However there are some problems with Prism plugins: line-highlight and treeview does not seems to be loaded. I don't want to use Babel instead of SWC so I have no solution for now.
* feat(components): add a Time componentArmand Philippot2023-11-1121-221/+263
| | | | | | Instead of using helpers functions to format the date each time we need to use a time element, it makes more sense to create a new component dedicated to this task.
* refactor(components): replace Meta component with MetaListArmand Philippot2023-11-1151-910/+1855
| | | | | | It removes items complexity by allowing consumers to use any label/value association. Translations should also be defined by the consumer. Each item can now be configured separately (borders, layout...).
* refactor(components): replace ResponsiveImage with Figure componentArmand Philippot2023-11-1131-502/+337
| | | | | | | | The styles applied to ResponsiveImage are related to the figure and figcaption elements. Those elements could be use with other contents than images. So I extracted them in a Figure component. The ResponsiveImage component is no longer useful: the consumer should use the Image component from `next` and wrap it in a link if needed.
* refactor(components): rewrite Branding componentArmand Philippot2023-11-1117-486/+443
| | | | | | The component should only be responsible of the layout for the logo, the name and the optional baseline. Also, the homepage url could be different from `/` so the consumer should give the right url.
* refactor(components): extract FlippingLogo from Branding componentArmand Philippot2023-11-118-33/+143
|
* feat(components): add a generic Flip componentArmand Philippot2023-11-1126-388/+543
| | | | | | The flipping animation is used at several places so it makes sense to use a single component to handle the animation. It will avoid styles duplication.
* refactor(components): merge HeadingButton and Widget componentsArmand Philippot2023-11-1141-792/+618
| | | | | | The HeadingButton component was only used inside Widget component and it is not very useful on its own so I merge the two components in a new Collapsible component.
* refactor(components): make form components compliant with Eslint rulesArmand Philippot2023-11-1154-224/+250
|
* refactor(components): rewrite HelpButton componentArmand Philippot2023-11-1112-100/+113
|
* feat(components): add a Help icon shapeArmand Philippot2023-11-118-1/+104
|
* refactor(components): rewrite BackToTop componentArmand Philippot2023-11-1112-123/+151
| | | | | * replace `link` prop with `anchor` prop * add a `label` prop to let consumer handle the accessible name
* feat(components): add a VisuallyHidden componentArmand Philippot2023-11-117-2/+98
|
* refactor(components): rewrite SocialLink componentArmand Philippot2023-11-1115-126/+312
| | | | | * replace default label with a label prop * rename name prop to icon prop
* refactor(components): rewrite SharingLink componentArmand Philippot2023-11-1112-327/+407
| | | | | * replace default label with label prop * simplify CSS rules
* refactor(components): rewrite Link componentArmand Philippot2023-11-1132-615/+685
| | | | | | | | | * rename `external` prop to `isExternal` * rename `download` prop to `isDownload` * rewrite CSS to reduce code length and complexity * move link styles in Sass placeholders to avoid repeats because of WordPress articles * move NavLink component to molecules
* refactor(components): rewrite Notice componentArmand Philippot2023-11-1112-57/+80
| | | | * Rename message prop to children prop and set ReactNode as type
* refactor(components): remove Column and NoScript from atomsArmand Philippot2023-11-1120-197/+60
| | | | | | | * Column is a simple div meant to be used inside Columns component so they should live together. * NoScript is only used in Layout component and its name does not make sense since it needs to be used inside a `noscript` element.
* refactor(components): rewrite DescriptionList componentArmand Philippot2023-11-1134-710/+607
| | | | | | | | | | | | | * add a `spacing` prop * replace `layout` prop with `isInline` prop * remove `items` prop (and classNames props) in favor of new components: Description, Group, Term * remove `withSeparator` prop (CSS content is announced by screen readers and Firefox/Safari have no support for alternative text so the consumer should add itself an element with `aria-hidden` if it need a separator) Be aware, Meta component and its consumers can be visually broken, they should be refactored before using them in production.
* refactor(components): rewrite List componentArmand Philippot2023-11-1151-741/+889
| | | | | | | | | * change `items` prop to children * replace `kind` prop with `isHierarchical`, `isOrdered` & `isInline` props * add `hideMarker` prop * add `spacing` prop to control item spacing * move lists styles to Sass placeholders to avoid repeats because of headless WordPress
* refactor(components): rewrite ProgressBar componentArmand Philippot2023-11-1111-155/+256
| | | | | | | * Avoid browser vendors by adding an extra div * Add a loading state * Add an option to center the progress bar (no longer the default) * Remove min since it is always 0
* refactor(components): rewrite Spinner componentArmand Philippot2023-10-2418-190/+312
| | | | | | | * Message should be set as children * Default message is no longer available (depending on use case, the consumer might prefer aria-label instead) * It is now possible to define the message position
* refactor(components): make Logo component ESlint compliantArmand Philippot2023-10-248-66/+78
| | | | | I also renamed the title prop to heading because title already exists as HTML attribute.
* feat(components): replace icons with a generic Icon componentArmand Philippot2023-10-24127-2095/+1682
| | | | | Sizes are also predefined and can be set using the `size` prop, so the consumers should no longer adjust the size in CSS.
* feat(components): add Article, Aside, Footer, Header, Main & NavArmand Philippot2023-10-2455-216/+580
| | | | | Some components have been renamed to be able to create Footer, Header and Nav.
* refactor(components): rewrite Heading componentArmand Philippot2023-10-2430-550/+601
| | | | | | | | | * remove `alignment` and `withMargin` props (consumer should handle that) * move styles to Sass placeholders to avoid repeats with headings coming from WordPress * refactor some other components that depend on Heading to avoid ESlint errors
* refactor(components): rewrite Section componentArmand Philippot2023-10-2412-205/+197
| | | | | | * Make it compliant with ESlint rules * Remove mandatory heading, it now depends on the consumer * Change defaults for hasBorder and variant
* refactor(components): rewrite Button and ButtonLink componentsArmand Philippot2023-10-2430-531/+848
| | | | | | | | | | | | | | Both: * move styles to Sass placeholders Button: * add `isPressed` prop to Button * add `isLoading` prop to Button (to differentiate state from disabled) ButtonLink: * replace `external` prop with `isExternal` prop * replace `href` prop with `to` prop
* refactor(routes): replace hardcoded routes with constantsArmand Philippot2023-10-2421-501/+653
| | | | | | | | It makes it easier to change a route if needed and it avoid typo mistakes. I also refactored a bit the concerned files to be complient with the new ESlint config. However, I should rewrite the pages to reduce the number of statements.
* build: convert project to esmArmand Philippot2023-10-2498-2/+100
|
* refactor(components): rewrite form componentsArmand Philippot2023-10-24176-4085/+3212
|
* build(deps): add cSpell to lint and fix spelling errorsArmand Philippot2023-09-211-0/+0
|
* chore(pages): update CVArmand Philippot2023-09-201-0/+0
|
* refactor: use named export for everything except pagesArmand Philippot2023-09-20378-1795/+1534
| | | | | | Next expect a default export for pages so only those components should use default exports. Everything else should use named exports to reduce the number of import statements.
* build(deps): bump all dependenciesArmand Philippot2023-09-196-39/+92
| | | | | * MDX type has changed so some components props had to be updated * Since Storybook now supports TS, I renamed the main/preview files
* refactor(build): replace paths aliases with relative pathsArmand Philippot2023-09-19308-852/+848
| | | | | | Using paths aliases starting with "@" can be confusing and can lead to conflict with existings modules. I prefer to use relative paths to avoid extra configuration in tools because of these aliases.
* chore: make Links and Images compliant with Next.js 13Armand Philippot2023-01-2322-283/+303
|
* build(storybook): fix loading errors due to updated depsArmand Philippot2022-09-211-1/+1
|
* fix(projects): load content dynamically and refresh table of contentsArmand Philippot2022-09-213-3/+47
| | | | | | | The previous way of handling content import was causing issue. So I use dynamic import instead. However, the table of contents was not displayed because the wrapper is first empty. I added a mutation observer to refresh the table of contents when the body is updated.
* fix(types): add custom types to pageProps with translationArmand Philippot2022-09-212-4/+15
|
* chore(content): fix typo and complete some contents on Home & CVArmand Philippot2022-09-211-0/+0
|
* chore: update CVArmand Philippot2022-08-211-0/+0
|
* chore: add DigDir projectArmand Philippot2022-08-211-0/+0
|
* fix(projects): do not transform pre to Code componentArmand Philippot2022-08-211-1/+0
| | | | | Sometimes it is useful to display some preformatted data that are not code.
* fix(comments): load all comments on a postArmand Philippot2022-08-2110-91/+159
| | | | | | | | | Previously, only the first 10 comments was loaded. So I update the fetching method to retrieve all the comments on a post. Also, I choose to order comments on client side because of a bug with WPGraphQL. Finally, I renamed the Comment type to SingleComment to avoid conflict with existing types.
* refactor(types): move and rename GraphQL typesArmand Philippot2022-08-2018-384/+380
| | | | | | | The api file in services was not really readable. So I move the types and I also rewrite a little the fetch function. I also rename most of the type to avoid conflict with preexisting types (like Node) and to keep consistency.
* fix(article): prevent TypeError on buildArmand Philippot2022-07-233-11/+31
| | | | | | By switching to custom hooks for revalidating articles and comments, everything was working on development mode but articles failed to build for production.
* refactor(article): wrap useSWR with a custom hook to revalidate articleArmand Philippot2022-07-223-9/+31
|
* fix(comments): refresh comments on changes or new commentArmand Philippot2022-07-222-3/+35
|
* chore(content): update CVArmand Philippot2022-06-221-0/+0
|