,
@@ -18,7 +20,7 @@ const meta = {
parameters: {
badges: [BADGES.WIP, BADGES.CANARY],
tokens,
- tokensPrefix: 'react-form-label',
+ tokensPrefix: 'utrecht-form-label',
},
argTypes: {
children: {
@@ -110,3 +112,18 @@ export const CheckedLabel: Story = {
type: 'checkbox',
},
};
+
+export const DesignTokens = createDesignTokensStory(meta);
+
+export const Visual = createVisualRegressionStory(() => (
+
+
Light
+
+
+
+ Dark
+
+
+
+
+));
diff --git a/packages/storybook/src/react-components/form-field-label/visual/States.tsx b/packages/storybook/src/react-components/form-field-label/visual/States.tsx
new file mode 100644
index 000000000..bb2852d59
--- /dev/null
+++ b/packages/storybook/src/react-components/form-field-label/visual/States.tsx
@@ -0,0 +1,11 @@
+import { LuxFormFieldLabel } from '@lux-design-system/components-react';
+
+export const VisualStates = () => (
+ <>
+ Label
+ Checkbox Label
+ Radio Label
+ Checked Label
+ Disabled Label
+ >
+);
diff --git a/packages/storybook/src/react-components/form-field-radio-group/form-field-radio-group.stories.tsx b/packages/storybook/src/react-components/form-field-radio-group/form-field-radio-group.stories.tsx
index b8e2ea9d2..6beccab4e 100644
--- a/packages/storybook/src/react-components/form-field-radio-group/form-field-radio-group.stories.tsx
+++ b/packages/storybook/src/react-components/form-field-radio-group/form-field-radio-group.stories.tsx
@@ -1,6 +1,8 @@
import { LuxFormFieldRadioGroup } from '@lux-design-system/components-react';
import { Meta, StoryObj } from '@storybook/react';
+import { VisualStates } from './visual/States';
import { BADGES } from '../../../config/preview';
+import { createVisualRegressionStory, VisualRegressionWrapper } from '../../utils';
type Story = StoryObj;
@@ -208,3 +210,16 @@ export const WithLongLabels: Story = {
},
},
};
+
+export const Visual = createVisualRegressionStory(() => (
+
+
Light
+
+
+
+ Dark
+
+
+
+
+));
diff --git a/packages/storybook/src/react-components/form-field-radio-group/visual/States.tsx b/packages/storybook/src/react-components/form-field-radio-group/visual/States.tsx
new file mode 100644
index 000000000..5faff29e0
--- /dev/null
+++ b/packages/storybook/src/react-components/form-field-radio-group/visual/States.tsx
@@ -0,0 +1,44 @@
+import { LuxFormFieldRadioGroup } from '@lux-design-system/components-react';
+
+const options = [
+ { value: '1', label: 'Radio Option 1' },
+ { value: '2', label: 'Radio Option 2' },
+ { value: '3', label: 'Radio Option 3' },
+];
+
+export const VisualStates = ({ mode }: { mode: 'light' | 'dark' }) => (
+ <>
+
+
+ Object.assign({}, { ...option }, { description: `Option Description ${option.value}` }),
+ )}
+ />
+
+
+
+
+
+
+ Object.assign({}, { ...option }, { checked: option.value === '2' }))}
+ />
+ Object.assign({}, { ...option }, { disabled: option.value === '2' }))}
+ />
+
+ >
+);
diff --git a/packages/storybook/src/react-components/form-field-radio-option/form-field-radio-option.stories.tsx b/packages/storybook/src/react-components/form-field-radio-option/form-field-radio-option.stories.tsx
index 1551896cb..5def367ea 100644
--- a/packages/storybook/src/react-components/form-field-radio-option/form-field-radio-option.stories.tsx
+++ b/packages/storybook/src/react-components/form-field-radio-option/form-field-radio-option.stories.tsx
@@ -1,7 +1,9 @@
import { LuxFormFieldRadioOption } from '@lux-design-system/components-react';
import tokens from '@lux-design-system/design-tokens/dist/index.json';
import type { Meta, StoryObj } from '@storybook/react';
+import { VisualStates } from './visual/States';
import { BADGES } from '../../../config/preview';
+import { createVisualRegressionStory, VisualRegressionWrapper } from '../../utils';
type Story = StoryObj;
@@ -150,3 +152,16 @@ export const FocusVisible: Story = {
pseudo: { focus: true, focusVisible: true },
},
};
+
+export const Visual = createVisualRegressionStory(() => (
+
+
Light
+
+
+
+ Dark
+
+
+
+
+));
diff --git a/packages/storybook/src/react-components/form-field-radio-option/visual/States.tsx b/packages/storybook/src/react-components/form-field-radio-option/visual/States.tsx
new file mode 100644
index 000000000..8e9353243
--- /dev/null
+++ b/packages/storybook/src/react-components/form-field-radio-option/visual/States.tsx
@@ -0,0 +1,17 @@
+import { LuxFormFieldRadioOption } from '@lux-design-system/components-react';
+
+export const VisualStates = ({ mode }: { mode: 'light' | 'dark' }) => (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+ >
+);
diff --git a/packages/storybook/src/react-components/form-field-select/form-field-select.mdx b/packages/storybook/src/react-components/form-field-select/form-field-select.mdx
index 811cbd243..e319df632 100644
--- a/packages/storybook/src/react-components/form-field-select/form-field-select.mdx
+++ b/packages/storybook/src/react-components/form-field-select/form-field-select.mdx
@@ -1,11 +1,33 @@
-import { Canvas, Controls, Meta } from "@storybook/blocks";
+import { Canvas, Controls, Description, Meta } from "@storybook/blocks";
import * as FormFieldSelectStories from "./form-field-select.stories";
-# Lux Form Field Select
+# Form Field Select
## Playground
+
+## States
+
+### Disabled
+
+
+
+
+### Invalid
+
+
+
+
+### Hover
+
+
+
+
+### Focus
+
+
+
diff --git a/packages/storybook/src/react-components/form-field-select/form-field-select.stories.tsx b/packages/storybook/src/react-components/form-field-select/form-field-select.stories.tsx
index 192f3659f..7beee04fe 100644
--- a/packages/storybook/src/react-components/form-field-select/form-field-select.stories.tsx
+++ b/packages/storybook/src/react-components/form-field-select/form-field-select.stories.tsx
@@ -1,11 +1,23 @@
-import { LuxFormFieldSelect, type LuxFormFieldSelectProps } from '@lux-design-system/components-react';
+import {
+ LuxFormFieldSelect,
+ type LuxFormFieldSelectOptionsProps,
+ type LuxFormFieldSelectProps,
+} from '@lux-design-system/components-react';
import tokens from '@lux-design-system/design-tokens/dist/index.json';
import type { Meta, StoryObj } from '@storybook/react';
+import { VisualStates } from './visual/States';
import { BADGES } from '../../../config/preview';
+import { createDesignTokensStory, createVisualRegressionStory, VisualRegressionWrapper } from '../../utils';
import FormFieldDescriptionMeta from '../form-field-description/form-field-description.stories';
import FormFieldErrorMessageMeta from '../form-field-error-message/form-field-error-message.stories';
import SelectMeta from '../select/select.stories';
+const options: LuxFormFieldSelectOptionsProps[] = [
+ { value: '1', label: 'Option 1', disabled: true },
+ { value: '2', label: 'Option 2', selected: true },
+ { value: '3', label: 'Option 3' },
+];
+
const meta = {
title: 'React Components/Form Field/Form Field Select',
id: 'react-components-form-field-form-field-select',
@@ -41,9 +53,10 @@ type Story = StoryObj;
export const Playground: Story = {
name: 'Playground',
args: {
- label: 'Form Field Select',
- description: 'Select in een FormField',
- errorMessage: 'Zo kan het ook een ErrorMessage hebben',
+ label: 'Label',
+ options,
+ description: 'Description',
+ errorMessage: 'Error Message',
invalid: false,
appearance: undefined,
},
@@ -54,3 +67,52 @@ export const Playground: Story = {
},
tags: ['!autodocs'],
};
+
+export const Disabled: Story = {
+ ...Playground,
+ name: 'Disabled',
+ args: {
+ ...Playground.args,
+ disabled: true,
+ },
+};
+
+export const Invalid: Story = {
+ ...Playground,
+ name: 'Invalid',
+ args: {
+ ...Playground.args,
+ invalid: true,
+ },
+};
+
+export const Hover: Story = {
+ ...Playground,
+ name: 'Hover',
+ parameters: {
+ pseudo: { hover: true },
+ },
+};
+
+export const Focus: Story = {
+ ...Playground,
+ name: 'Focus',
+ parameters: {
+ pseudo: { focus: true, focusVisible: true },
+ },
+};
+
+export const DesignTokens = createDesignTokensStory(meta);
+
+export const Visual = createVisualRegressionStory(() => (
+ <>
+ Light
+
+
+
+ Dark
+
+
+
+ >
+));
diff --git a/packages/storybook/src/react-components/form-field-select/visual/States.tsx b/packages/storybook/src/react-components/form-field-select/visual/States.tsx
new file mode 100644
index 000000000..2ca70f0e4
--- /dev/null
+++ b/packages/storybook/src/react-components/form-field-select/visual/States.tsx
@@ -0,0 +1,27 @@
+import { LuxFormFieldSelect, type LuxFormFieldSelectProps } from '@lux-design-system/components-react';
+
+export const VisualStates = ({ options }: Pick) => (
+ <>
+
+
+ Hover & Focus
+
+
+
+
+
+
+ Invalid
+
+
+ Disabled
+
+
+ >
+);
diff --git a/packages/storybook/src/react-components/form-field-textbox/form-field-textbox.stories.tsx b/packages/storybook/src/react-components/form-field-textbox/form-field-textbox.stories.tsx
index 47b26387c..e73483589 100644
--- a/packages/storybook/src/react-components/form-field-textbox/form-field-textbox.stories.tsx
+++ b/packages/storybook/src/react-components/form-field-textbox/form-field-textbox.stories.tsx
@@ -1,7 +1,9 @@
import { LuxFormFieldTextbox, type LuxFormFieldTextboxProps } from '@lux-design-system/components-react';
import tokens from '@lux-design-system/design-tokens/dist/index.json';
import type { Meta, StoryObj } from '@storybook/react';
+import { VisualStates } from './visual/States';
import { BADGES } from '../../../config/preview';
+import { createDesignTokensStory, createVisualRegressionStory, VisualRegressionWrapper } from '../../utils';
import FormFieldDescriptionMeta from '../form-field-description/form-field-description.stories';
import FormFieldErrorMessageMeta from '../form-field-error-message/form-field-error-message.stories';
import TextboxMeta from '../textbox/textbox.stories';
@@ -54,3 +56,18 @@ export const Playground: Story = {
},
tags: ['!autodocs'],
};
+
+export const DesignTokens = createDesignTokensStory(meta);
+
+export const Visual = createVisualRegressionStory(() => (
+ <>
+ Light
+
+
+
+ Dark
+
+
+
+ >
+));
diff --git a/packages/storybook/src/react-components/form-field-textbox/visual/States.tsx b/packages/storybook/src/react-components/form-field-textbox/visual/States.tsx
new file mode 100644
index 000000000..9c5f9301a
--- /dev/null
+++ b/packages/storybook/src/react-components/form-field-textbox/visual/States.tsx
@@ -0,0 +1,21 @@
+import { LuxFormFieldTextbox } from '@lux-design-system/components-react';
+
+export const VisualStates = () => (
+ <>
+
+
+ Hover & Focus
+
+
+
+
+
+
+ Invalid
+
+
+ Disabled
+
+
+ >
+);
diff --git a/packages/storybook/src/react-components/form-field/form-field.stories.tsx b/packages/storybook/src/react-components/form-field/form-field.stories.tsx
index 9cdc137e0..6953d4b5f 100644
--- a/packages/storybook/src/react-components/form-field/form-field.stories.tsx
+++ b/packages/storybook/src/react-components/form-field/form-field.stories.tsx
@@ -8,7 +8,9 @@ import {
} from '@lux-design-system/components-react';
import tokens from '@lux-design-system/design-tokens/dist/index.json';
import type { Meta, StoryObj } from '@storybook/react';
+import { FormFieldType } from './visual/FormFieldTypes';
import { BADGES } from '../../../config/preview';
+import { createDesignTokensStory, createVisualRegressionStory, VisualRegressionWrapper } from '../../utils';
const meta = {
title: 'React Components/Form Field',
@@ -141,3 +143,49 @@ export const FormFieldError: Story = {
invalid: true,
},
};
+
+export const DesignTokens = createDesignTokensStory(meta);
+
+export const Visual = createVisualRegressionStory(() => (
+ <>
+
+ Note: Dit is alleen een test voor het FormField, de verschillende inputs hebben hun eigen tests.
+
+ Light
+
+ Type: text
+
+
+
+
+ Type: checkbox
+
+
+
+
+ Type: radio
+
+
+
+
+
+ Dark
+
+ Type: text
+
+
+
+
+ Type: checkbox
+
+
+
+
+ Type: radio
+
+
+
+
+
+ >
+));
diff --git a/packages/storybook/src/react-components/form-field/visual/FormFieldTypes.tsx b/packages/storybook/src/react-components/form-field/visual/FormFieldTypes.tsx
new file mode 100644
index 000000000..401fab6a8
--- /dev/null
+++ b/packages/storybook/src/react-components/form-field/visual/FormFieldTypes.tsx
@@ -0,0 +1,84 @@
+import {
+ LuxFormField,
+ LuxFormFieldDescription,
+ LuxFormFieldErrorMessage,
+ LuxFormFieldLabel,
+ type LuxFormFieldLabelProps,
+ LuxParagraph,
+} from '@lux-design-system/components-react';
+
+type FormFieldTypeProps = {
+ type?: 'text' | 'checkbox' | 'radio';
+ invalid?: boolean;
+ show?: {
+ description?: boolean;
+ extra?: boolean;
+ };
+};
+
+export const FormFieldType = ({
+ type = 'text',
+ invalid = false,
+ show = { description: true, extra: false },
+}: FormFieldTypeProps) => {
+ const Input = ({ type }: any) => {
+ switch (type) {
+ case 'checkbox':
+ return (
+
+ );
+
+ case 'radio':
+ return (
+
+ );
+
+ default:
+ return (
+
+ );
+ }
+ };
+
+ return (
+ {`Label`}}
+ description={
+ show.description ? (
+
+ {`Description`}
+
+ ) : null
+ }
+ errorMessage={invalid ? {`Error Message`} : null}
+ input={}
+ invalid={invalid}
+ >
+ {show.extra ? {`Extra content`} : null}
+
+ );
+};