aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
Commit message (Collapse)AuthorAgeFilesLines
...
* refactor(components): extract SettingsForm component form SettingsModalArmand Philippot2023-11-1136-476/+607
| | | | | | We could use an array of items and map over it instead of repeating the Switch component for each settings but with translations, it becomes quickly unreadable. So I prefer to keep separate components.
* feat(hooks): add useBoolean and useToggle hooksArmand Philippot2023-11-119-84/+72
|
* refactor(providers,hooks): rewrite PrismThemeProvider & usePrismThemeArmand Philippot2023-11-111-22/+5
| | | | | | * reuse Theme provider logic * move DOM mutation from provider to hook * add a script to init theme before page load
* feat: replace next-themes with a custom ThemeProviderArmand Philippot2023-11-111-11/+4
| | | | | | | To be honest, next-themes was working fine. However since I use a theme provider for Prism code blocks, some code is duplicated between this app and the library. So I prefer to use a custom Provider without the options I don't need.
* refactor(hooks,provider): move reduce motion setterArmand Philippot2023-11-1115-170/+32
| | | | | | | | | | Since the local storage key is not meant to change between the components, it should be set directly inside the app file. So both the local storage and the data attribute should be handle in a provider. I also added a custom document because we need a script to retrieve the stored value in local storage earlier to avoid flashing on hydration.
* refactor(hooks,providers): rewrite useAckee hook and AckeeProviderArmand Philippot2023-11-1114-163/+45
|
* refactor(hooks): rewrite useLocalStorage hookArmand Philippot2023-11-112-5/+13
| | | | | | | * return a tuple instead of an object * add a validator function as parameter (if the stored value is manually changed, it is not safe to cast its type) * add tests
* refactor(components): remove SiteHeader and SiteFooter componentsArmand Philippot2023-11-1111-619/+151
| | | | | They do not help to make the layout more readable (on the contrary I think...) so the props drilling is useless.
* refactor(components): extract MainNav component from toolbarArmand Philippot2023-11-1111-81/+253
|
* refactor(components): rewrite Breadcrumbs componentArmand Philippot2023-11-1113-246/+163
|
* refactor(components): rewrite Pagination componentArmand Philippot2023-11-1115-467/+627
|
* feat(components): add a Colophon componentArmand Philippot2023-11-119-39/+211
|
* refactor(components): rewrite Copyright componentArmand Philippot2023-11-1116-201/+175
| | | | | | | | | * remove `icon` prop (it is confusing because a copyright should have the copyright symbol, the license is not part of the copyright) * reorganize copyright informations I also updated the CC BY SA icon because the elements was in the wrong order.
* refactor(components): rewrite NavList componentArmand Philippot2023-11-1119-276/+262
| | | | | | | * extract NavItem from NavList * remove `kind` and `listClassName` props (since the consumer has control over NavList, NavItem and NavLink components these props are obsolete)
* refactor(components): rewrite NavLink componentArmand Philippot2023-11-116-73/+190
| | | | * handle style variants to avoid declaring the styles in consumers
* feat(components): add a generic Grid componentArmand Philippot2023-11-1123-688/+373
| | | | | * merge Columns, Gallery and CardsList into Grid component * add more options to control the grid
* refactor(components): rewrite Card componentArmand Philippot2023-11-1131-926/+1679
| | | | | | | | | | | | | * make the component more generic * merge `<Summary />` and `<Comment />` styles into card component to avoid repeating the same structure * remove most of the props to use composition However the CSS is a bit complex because of the two variants... Also, the component should be refactored when the CSS pseudo-class `:has` has enough support: the provider and the `cover` and `meta` props should be removed.
* refactor(components): rewrite Code component and usePrism hookArmand Philippot2023-11-1111-508/+397
| | | | | | | | | | | | * 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-1110-68/+232
| | | | | | 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-1136-690/+1019
| | | | | | 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-1124-476/+295
| | | | | | | | 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-1115-458/+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-1125-368/+521
| | | | | | 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-1131-722/+515
| | | | | | 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-1110-91/+104
|
* feat(components): add a Help icon shapeArmand Philippot2023-11-117-1/+45
|
* refactor(components): rewrite BackToTop componentArmand Philippot2023-11-1110-115/+143
| | | | | * 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-1110-111/+159
| | | | | * replace default label with a label prop * rename name prop to icon prop
* refactor(components): rewrite SharingLink componentArmand Philippot2023-11-1110-319/+359
| | | | | * replace default label with label prop * simplify CSS rules
* refactor(components): rewrite Link componentArmand Philippot2023-11-1124-402/+523
| | | | | | | | | * 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-119-48/+71
| | | | * 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-1132-697/+575
| | | | | | | | | | | | | * 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-1139-527/+725
| | | | | | | | | * 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-2412-172/+252
| | | | | | | * 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-24117-2025/+1497
| | | | | 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-2453-208/+572
| | | | | Some components have been renamed to be able to create Footer, Header and Nav.
* refactor(components): rewrite Heading componentArmand Philippot2023-10-2423-463/+408
| | | | | | | | | * 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-2411-186/+187
| | | | | | * 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-2426-514/+639
| | | | | | | | | | | | | | 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-241-23/+37
| | | | | | | | 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-24172-4061/+3194
|
* refactor: use named export for everything except pagesArmand Philippot2023-09-20315-1380/+1115
| | | | | | 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-191-1/+4
| | | | | * MDX type has changed so some components props had to be updated * Since Storybook now supports TS, I renamed the main/preview files