From 81b1e0e05919eb368a66aef47adcf7738af76f29 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 29 Sep 2023 11:47:06 +0200
Subject: refactor(components): rewrite Spinner component

* 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
---
 .../atoms/loaders/spinner/spinner.stories.tsx      | 37 ++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 src/components/atoms/loaders/spinner/spinner.stories.tsx

(limited to 'src/components/atoms/loaders/spinner/spinner.stories.tsx')

diff --git a/src/components/atoms/loaders/spinner/spinner.stories.tsx b/src/components/atoms/loaders/spinner/spinner.stories.tsx
new file mode 100644
index 0000000..e9dfae4
--- /dev/null
+++ b/src/components/atoms/loaders/spinner/spinner.stories.tsx
@@ -0,0 +1,37 @@
+import type { ComponentMeta, ComponentStory } from '@storybook/react';
+import { Spinner as SpinnerComponent } from './spinner';
+
+/**
+ * Spinner - Storybook Meta
+ */
+export default {
+  title: 'Atoms/Loaders',
+  component: SpinnerComponent,
+  argTypes: {
+    children: {
+      control: {
+        type: 'text',
+      },
+      description: 'Loading message.',
+      table: {
+        category: 'Options',
+      },
+      type: {
+        name: 'string',
+        required: false,
+      },
+    },
+  },
+} as ComponentMeta<typeof SpinnerComponent>;
+
+const Template: ComponentStory<typeof SpinnerComponent> = (args) => (
+  <SpinnerComponent {...args} />
+);
+
+/**
+ * Loaders Stories - Spinner
+ */
+export const Spinner = Template.bind({});
+Spinner.args = {
+  children: 'Submitting...',
+};
-- 
cgit v1.2.3

