aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules
Commit message (Collapse)AuthorAgeFilesLines
* fix(build): handle Next.js errors and warnings during buildArmand Philippot2023-12-161-0/+2
| | | | | | | | | | | | * extract Blog component from BlogPage (paginated) and extract Article component from ArticlePage to avoid `Cannot read properties` errors due to fallback route * fix sitemap build (cjs not supported) * fix eslint warnings (react/jsx-no-literals) * update `start` script since I'm using standalone output * update `postbuild` script since we need to copy public and static files to standalone directory (Next.js does not handle it itself because we should use a CDN...)
* refactor(stories): migrate stories to CSF3 formatArmand Philippot2023-12-1524-1877/+1641
|
* refactor(pages): refine Project pagesArmand Philippot2023-12-081-2/+1
| | | | | | | | | | | * refactor ProjectOverview component to let consumers handle the value * extract project overview depending on Github to avoid fetching Github API if the project is not on Github * wrap dynamic import in a useMemo hook to avoid infinite rerender * fix table of contents by adding a useMutationObserver hook to refresh headings tree (without it useHeadingsTree is not retriggered once the dynamic import is done) * add Cypress tests
* refactor(pages): improve HomepageArmand Philippot2023-11-293-0/+60
| | | | | | | | | * move custom homepage components that does not require props to the MDX file (links should not need to be translated here but where they are defined) * move SEO title and meta desc to MDX file * make Page component the wrapper instead of using a React fragment * fix MDX module types
* refactor(components): refine Card component stylesArmand Philippot2023-11-231-15/+29
| | | | | | | * remove cover img absolute positioning * remove fixed height on card variant 1 * make title always centered on card variant 2 * make header meta centered on card variant 2 on small containers
* refactor(components): replace items prop in Grid with children propArmand Philippot2023-11-226-107/+238
| | | | | | | | | It is easier to read and to maintain this way. The `items` prop was not useful since we are not manipulating the items. Changes: * extract GridItem component from Grid component * replace `items` prop of type Array<ReactNode> with `children` prop of type ReactNode * remove GridItem styles
* refactor(components): replace PageLayout template with PageArmand Philippot2023-11-2010-391/+2
| | | | | | | | | * split pages in smaller components (it is both easier to maintain and more readable, we avoid the use of fragments in pages directory) * extract breadcrumbs from article tag (the navigation is not related to the page contents) * remove useReadingTime hook * remove layout options except `isHome`
* refactor(components): extract MetaItem from MetaListArmand Philippot2023-11-2011-304/+252
| | | | | | * replace `items` prop on MetaList with `children` prop: it was too restrictive and the global options was not really useful. It is better too give control to the consumers.
* build(components, hooks): fix type errors introduced by deps upgradeArmand Philippot2023-11-161-2/+4
| | | | Since #7e37f2b Typescript was complaining about some types.
* refactor(components): replace Summary component with PostPreviewArmand Philippot2023-11-111-3/+9
| | | | | | | | | | | * rename component to PostPreview because Summary is an HTML element and it could lead to confusion * replace `title` and `titleLevel` with `heading` and `headingLvl` because `title` is a native attribute * rename `intro` prop to `excerpt` * extract `cover` from `meta` prop * rewrite meta type * extract meta logic into a new component
* refactor(components): replace Toolbar with Navbar componentArmand Philippot2023-11-116-189/+0
| | | | | | | | * remove SearchModal and SettingsModal components * add a generic NavbarItem component (instead of the previous toolbar items to avoid unreadable styles...) * move FlippingLabel component logic into NavbarItem since it is only used here
* refactor(hooks): rewrite useOnClickOutside hookArmand Philippot2023-11-111-4/+6
| | | | | | | * remove `useCapture` parameter (it does not make sense to use bubbling here) * return a MutableRefObject instead of a RefObject to be able to test the hook
* refactor(components): rewrite Modal componentArmand Philippot2023-11-1113-46/+534
| | | | | * add an optional close button * add an icon prop
* refactor(components): extract SettingsForm component form SettingsModalArmand Philippot2023-11-111-20/+19
| | | | | | 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-111-4/+3
|
* refactor(hooks,provider): move reduce motion setterArmand Philippot2023-11-111-3/+1
| | | | | | | | | | 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(components): rewrite Breadcrumbs componentArmand Philippot2023-11-115-238/+0
|
* refactor(components): rewrite Pagination componentArmand Philippot2023-11-115-458/+0
|
* feat(components): add a Colophon componentArmand Philippot2023-11-116-0/+201
|
* refactor(components): rewrite Copyright componentArmand Philippot2023-11-116-0/+142
| | | | | | | | | * 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-1113-230/+178
| | | | | | | * 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-1111-248/+368
| | | | | * merge Columns, Gallery and CardsList into Grid component * add more options to control the grid
* refactor(components): rewrite Card componentArmand Philippot2023-11-1122-456/+1414
| | | | | | | | | | | | | * 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-1110-505/+396
| | | | | | | | | | | | * 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.
* refactor(components): replace Meta component with MetaListArmand Philippot2023-11-1125-540/+736
| | | | | | 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-118-413/+8
| | | | | | | | 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-1111-421/+308
| | | | | | 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-1113-352/+186
| | | | | | 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-1116-513/+365
| | | | | | 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-1110-61/+94
|
* refactor(components): rewrite HelpButton componentArmand Philippot2023-11-1110-91/+104
|
* refactor(components): rewrite BackToTop componentArmand Philippot2023-11-118-113/+131
| | | | | * replace `link` prop with `anchor` prop * add a `label` prop to let consumer handle the accessible name
* refactor(components): rewrite Link componentArmand Philippot2023-11-1110-5/+229
| | | | | | | | | * 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): remove Column and NoScript from atomsArmand Philippot2023-11-113-15/+33
| | | | | | | * 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-117-104/+81
| | | | | | | | | | | | | * 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-116-51/+31
| | | | | | | | | * 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): make Logo component ESlint compliantArmand Philippot2023-10-241-8/+15
| | | | | 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-248-29/+34
| | | | | 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-247-51/+41
| | | | | Some components have been renamed to be able to create Footer, Header and Nav.
* refactor(components): rewrite Heading componentArmand Philippot2023-10-245-45/+41
| | | | | | | | | * 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 Button and ButtonLink componentsArmand Philippot2023-10-247-56/+69
| | | | | | | | | | | | | | 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
* build: convert project to esmArmand Philippot2023-10-2421-1/+22
|
* refactor(components): rewrite form componentsArmand Philippot2023-10-2474-3428/+1092
|
* refactor: use named export for everything except pagesArmand Philippot2023-09-2091-325/+288
| | | | | | 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.
* refactor(build): replace paths aliases with relative pathsArmand Philippot2023-09-1978-127/+126
| | | | | | 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-237-35/+23
|
* fix(settings): avoid cropped tooltip on small devicesArmand Philippot2022-06-0912-19/+69
| | | | | | I changed the settings disposition to make tooltip positioning easier. Jest complains about ref passed but everything seems to work as expected so I'm not sure it is relevant. Maybe a bug with cloneElement.
* fix(settings): close tooltip when modal is closingArmand Philippot2022-06-082-15/+20
| | | | | The event was not captured so the tooltip remained open when the settings was closed. It prevented to click on the toolbar buttons.