diff --git a/.changeset/violet-cherries-drop.md b/.changeset/violet-cherries-drop.md new file mode 100644 index 0000000000..6d0e4a68a7 --- /dev/null +++ b/.changeset/violet-cherries-drop.md @@ -0,0 +1,8 @@ +--- +"@marigold/docs": major +"@marigold/components": major +--- + +refa(DST-629): Align `` modes with loading pattern naming convention + +**BREAKING CHANGE:** Rename `mode` prop to align with the "Loading state" pattern. Renamed `"fullsize"` to `"fullscreen"` and `"inline"` to `"section"`. diff --git a/docs/content/components/content/xloader/xloader-fullscreen.demo.tsx b/docs/content/components/content/xloader/xloader-fullscreen.demo.tsx index 1d4b0c38c9..599dc839bc 100644 --- a/docs/content/components/content/xloader/xloader-fullscreen.demo.tsx +++ b/docs/content/components/content/xloader/xloader-fullscreen.demo.tsx @@ -16,7 +16,7 @@ export default () => { - {loading ? : null} + {loading ? : null} ); }; diff --git a/docs/content/components/content/xloader/xloader-inline.demo.tsx b/docs/content/components/content/xloader/xloader-section.demo.tsx similarity index 98% rename from docs/content/components/content/xloader/xloader-inline.demo.tsx rename to docs/content/components/content/xloader/xloader-section.demo.tsx index 76aafdc798..47c737ed21 100644 --- a/docs/content/components/content/xloader/xloader-inline.demo.tsx +++ b/docs/content/components/content/xloader/xloader-section.demo.tsx @@ -34,7 +34,7 @@ const Venues = () => { if (status === 'pending' || isFetching) { return (
- +
); } diff --git a/docs/content/components/content/xloader/xloader.mdx b/docs/content/components/content/xloader/xloader.mdx index 3266686da2..859f6af68c 100644 --- a/docs/content/components/content/xloader/xloader.mdx +++ b/docs/content/components/content/xloader/xloader.mdx @@ -24,13 +24,13 @@ However, overuse of fullscreen loaders can lead to a frustrating user experience -### Inline +### Section -An inline loader is used to indicate that a specific section of the page is currently processing or loading data. Unlike a fullscreen loader, it only blocks interaction with that section, allowing users to continue interacting with other parts of the page. +A section loader is used to indicate that a specific section of the page is currently processing or loading data. Unlike a fullscreen loader, it only blocks interaction with that section, allowing users to continue interacting with other parts of the page. -Use inline loaders for non-blocking tasks, like loading a list of items. They should ideally not cause layout shifts, ensuring the rest of the page remains stable while the content is being loaded, providing a seamless experience for the user. +Use section loaders for non-blocking tasks, like loading a list of items. They should ideally not cause layout shifts, ensuring the rest of the page remains stable while the content is being loaded, providing a seamless experience for the user. - + ## Props diff --git a/docs/content/patterns/loading-states/full-section.demo.tsx b/docs/content/patterns/loading-states/full-section.demo.tsx index 5338509eec..ee1a8d9aab 100644 --- a/docs/content/patterns/loading-states/full-section.demo.tsx +++ b/docs/content/patterns/loading-states/full-section.demo.tsx @@ -59,7 +59,7 @@ export default () => { - {isLoading && } + {isLoading && } ); }; diff --git a/packages/components/src/XLoader/XLoader.stories.tsx b/packages/components/src/XLoader/XLoader.stories.tsx index ed9c2321cd..af4c0b6847 100644 --- a/packages/components/src/XLoader/XLoader.stories.tsx +++ b/packages/components/src/XLoader/XLoader.stories.tsx @@ -10,7 +10,7 @@ const meta = { type: 'radio', }, description: 'Mode of the Loader.', - options: ['default', 'fullsize', 'inline'], + options: ['default', 'fullscreen', 'section'], }, variant: { control: { @@ -34,9 +34,9 @@ export const Basic: Story = { render: args => , }; -export const Fullsize: Story = { +export const Fullscreen: Story = { args: { - mode: 'fullsize', + mode: 'fullscreen', }, render: args => ( <> @@ -45,9 +45,9 @@ export const Fullsize: Story = { ), }; -export const Inline: Story = { +export const Section: Story = { args: { - mode: 'inline', + mode: 'section', }, render: args => (
diff --git a/packages/components/src/XLoader/XLoader.test.tsx b/packages/components/src/XLoader/XLoader.test.tsx index 57ce41f33f..fe726601ec 100644 --- a/packages/components/src/XLoader/XLoader.test.tsx +++ b/packages/components/src/XLoader/XLoader.test.tsx @@ -63,7 +63,7 @@ test('render custom label', () => { test('fullsize uses "inverted" variant', () => { render( - Loading... + Loading... ); @@ -74,7 +74,7 @@ test('fullsize uses "inverted" variant', () => { test('inline uses "inverted" variant', () => { render( - Loading... + Loading... ); diff --git a/packages/components/src/XLoader/XLoader.tsx b/packages/components/src/XLoader/XLoader.tsx index 49e19d55fa..6094397cc4 100644 --- a/packages/components/src/XLoader/XLoader.tsx +++ b/packages/components/src/XLoader/XLoader.tsx @@ -7,15 +7,15 @@ import { BaseLoader } from './BaseLoader'; // --------------- export interface XLoaderProps extends LoaderProps { /** - * Show the loader in `fullsize` to overlay and block interaction with the site or `ìnline` to show loading for a certain area. + * Show the loader in `fullscreen` to overlay and block interaction with the site or `section` to show loading for a certain area. * @default undefined */ - mode?: 'fullsize' | 'inline'; + mode?: 'fullscreen' | 'section'; } -// Full Size +// Full Screen // --------------- -const LoaderFullSize = (props: LoaderProps) => { +const LoaderFullScreen = (props: LoaderProps) => { const className = useClassNames({ component: 'Underlay', variant: 'modal', @@ -33,9 +33,9 @@ const LoaderFullSize = (props: LoaderProps) => { ); }; -// Inline +// Section // --------------- -const LoaderInline = (props: LoaderProps) => { +const LoaderSection = (props: LoaderProps) => { const className = useClassNames({ component: 'Underlay', variant: 'modal', @@ -52,10 +52,10 @@ const LoaderInline = (props: LoaderProps) => { // Component // --------------- export const XLoader = ({ mode, variant, ...props }: XLoaderProps) => - mode === 'fullsize' ? ( - - ) : mode === 'inline' ? ( - + mode === 'fullscreen' ? ( + + ) : mode === 'section' ? ( + ) : ( );