@axa-fr/design-system-slash-react 0.2.0-beta.338 → 0.2.0-beta.347

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/package.json +15 -15
  2. package/dist/Action/Action.stories.d.ts +0 -6
  3. package/dist/Action/Action.stories.js +0 -30
  4. package/dist/Alert/Alert.stories.d.ts +0 -9
  5. package/dist/Alert/Alert.stories.js +0 -54
  6. package/dist/Badge/Badge.stories.d.ts +0 -7
  7. package/dist/Badge/Badge.stories.js +0 -69
  8. package/dist/Button/Button.stories.d.ts +0 -18
  9. package/dist/Button/Button.stories.js +0 -97
  10. package/dist/Form/Checkbox/Checkbox.stories.d.ts +0 -18
  11. package/dist/Form/Checkbox/Checkbox.stories.js +0 -108
  12. package/dist/Form/Choice/Choice.stories.d.ts +0 -9
  13. package/dist/Form/Choice/Choice.stories.js +0 -27
  14. package/dist/Form/Choice/ChoiceInput.stories.d.ts +0 -9
  15. package/dist/Form/Choice/ChoiceInput.stories.js +0 -33
  16. package/dist/Form/Date/Date.stories.d.ts +0 -9
  17. package/dist/Form/Date/Date.stories.js +0 -28
  18. package/dist/Form/Date/DateInput.stories.d.ts +0 -9
  19. package/dist/Form/Date/DateInput.stories.js +0 -54
  20. package/dist/Form/File/FileInput.stories.d.ts +0 -9
  21. package/dist/Form/File/FileInput.stories.js +0 -103
  22. package/dist/Form/File/__tests__/File.spec.d.ts +0 -1
  23. package/dist/Form/File/__tests__/File.spec.js +0 -9
  24. package/dist/Form/File/__tests__/FileInput.spec.d.ts +0 -1
  25. package/dist/Form/File/__tests__/FileInput.spec.js +0 -10
  26. package/dist/Form/File/__tests__/FileLine.spec.d.ts +0 -1
  27. package/dist/Form/File/__tests__/FileLine.spec.js +0 -25
  28. package/dist/Form/File/__tests__/FileTable.spec.d.ts +0 -1
  29. package/dist/Form/File/__tests__/FileTable.spec.js +0 -58
  30. package/dist/Form/MultiSelect/MultiSelect.stories.d.ts +0 -10
  31. package/dist/Form/MultiSelect/MultiSelect.stories.js +0 -89
  32. package/dist/Form/MultiSelect/__tests__/MultiSelect.spec.d.ts +0 -10
  33. package/dist/Form/MultiSelect/__tests__/MultiSelect.spec.js +0 -15
  34. package/dist/Form/MultiSelect/__tests__/MultiSelectInput.spec.d.ts +0 -1
  35. package/dist/Form/MultiSelect/__tests__/MultiSelectInput.spec.js +0 -9
  36. package/dist/Form/Number/Number.stories.d.ts +0 -9
  37. package/dist/Form/Number/Number.stories.js +0 -31
  38. package/dist/Form/Number/NumberInput.stories.d.ts +0 -9
  39. package/dist/Form/Number/NumberInput.stories.js +0 -39
  40. package/dist/Form/Pass/Pass.stories.d.ts +0 -5
  41. package/dist/Form/Pass/Pass.stories.js +0 -32
  42. package/dist/Form/Pass/PassInput.stories.d.ts +0 -5
  43. package/dist/Form/Pass/PassInput.stories.js +0 -59
  44. package/dist/Form/Radio/Radio.stories.d.ts +0 -9
  45. package/dist/Form/Radio/Radio.stories.js +0 -44
  46. package/dist/Form/Radio/RadioInput.stories.d.ts +0 -9
  47. package/dist/Form/Radio/RadioInput.stories.js +0 -46
  48. package/dist/Form/Radio/RadioItem.stories.d.ts +0 -9
  49. package/dist/Form/Radio/RadioItem.stories.js +0 -28
  50. package/dist/Form/Select/Select.stories.d.ts +0 -8
  51. package/dist/Form/Select/Select.stories.js +0 -35
  52. package/dist/Form/Select/SelectInput.stories.d.ts +0 -9
  53. package/dist/Form/Select/SelectInput.stories.js +0 -82
  54. package/dist/Form/Slider/Slider.stories.d.ts +0 -10
  55. package/dist/Form/Slider/Slider.stories.js +0 -39
  56. package/dist/Form/Slider/SliderInput.stories.d.ts +0 -10
  57. package/dist/Form/Slider/SliderInput.stories.js +0 -45
  58. package/dist/Form/Text/Text.stories.d.ts +0 -9
  59. package/dist/Form/Text/Text.stories.js +0 -36
  60. package/dist/Form/Text/TextInput.stories.d.ts +0 -9
  61. package/dist/Form/Text/TextInput.stories.js +0 -127
  62. package/dist/Form/Textarea/Textarea.stories.d.ts +0 -9
  63. package/dist/Form/Textarea/Textarea.stories.js +0 -31
  64. package/dist/Form/Textarea/TextareaInput.stories.d.ts +0 -6
  65. package/dist/Form/Textarea/TextareaInput.stories.js +0 -35
  66. package/dist/Layout/Footer/Footer.stories.d.ts +0 -10
  67. package/dist/Layout/Footer/Footer.stories.js +0 -18
  68. package/dist/Layout/Header/Header.stories.d.ts +0 -6
  69. package/dist/Layout/Header/Header.stories.js +0 -26
  70. package/dist/Layout/Header/Infos/Infos.stories.d.ts +0 -5
  71. package/dist/Layout/Header/Infos/Infos.stories.js +0 -15
  72. package/dist/Layout/Header/MenuTitleWrapper/MenuTitleWrapper.stories.d.ts +0 -6
  73. package/dist/Layout/Header/MenuTitleWrapper/MenuTitleWrapper.stories.js +0 -25
  74. package/dist/Layout/Header/Name/Name.stories.d.ts +0 -5
  75. package/dist/Layout/Header/Name/Name.stories.js +0 -18
  76. package/dist/Layout/Header/NavBar/NavBar.stories.d.ts +0 -9
  77. package/dist/Layout/Header/NavBar/NavBar.stories.js +0 -32
  78. package/dist/Layout/Header/NavBar/NavBarItem/NavBarItem.stories.d.ts +0 -11
  79. package/dist/Layout/Header/NavBar/NavBarItem/NavBarItem.stories.js +0 -43
  80. package/dist/Layout/Header/TitleHeader/TitleHeader.stories.d.ts +0 -7
  81. package/dist/Layout/Header/TitleHeader/TitleHeader.stories.js +0 -45
  82. package/dist/Layout/Header/ToggleButton/ToggleButton.stories.d.ts +0 -6
  83. package/dist/Layout/Header/ToggleButton/ToggleButton.stories.js +0 -19
  84. package/dist/Layout/Header/User/User.stories.d.ts +0 -6
  85. package/dist/Layout/Header/User/User.stories.js +0 -23
  86. package/dist/ModalAgent/Modal.stories.d.ts +0 -31
  87. package/dist/ModalAgent/Modal.stories.js +0 -84
  88. package/dist/Restitution/Restitution.stories.d.ts +0 -4
  89. package/dist/Restitution/Restitution.stories.js +0 -44
  90. package/dist/Steps/Steps.stories.d.ts +0 -11
  91. package/dist/Steps/Steps.stories.js +0 -31
  92. package/dist/Steps/__tests__/Step.spec.d.ts +0 -1
  93. package/dist/Steps/__tests__/Step.spec.js +0 -9
  94. package/dist/Summary/Summary.stories.d.ts +0 -8
  95. package/dist/Summary/Summary.stories.js +0 -38
  96. package/dist/Svg/Svg.stories.d.ts +0 -7
  97. package/dist/Svg/Svg.stories.js +0 -38
  98. package/dist/Svg/__tests__/Svg.test.d.ts +0 -1
  99. package/dist/Svg/__tests__/Svg.test.js +0 -38
  100. package/dist/Table/Table.stories.d.ts +0 -7
  101. package/dist/Table/Table.stories.js +0 -33
  102. package/dist/Tabs/Tabs.stories.d.ts +0 -6
  103. package/dist/Tabs/Tabs.stories.js +0 -29
  104. package/dist/Title/Title.stories.d.ts +0 -13
  105. package/dist/Title/Title.stories.js +0 -58
  106. package/dist/Title/__tests__/Title.test.d.ts +0 -1
  107. package/dist/Title/__tests__/Title.test.js +0 -40
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/design-system-slash-react",
3
- "version": "0.2.0-beta.338",
3
+ "version": "0.2.0-beta.347",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
@@ -17,7 +17,7 @@
17
17
  ],
18
18
  "scripts": {
19
19
  "prebuild": "rimraf dist",
20
- "build": "tsc",
20
+ "build": "tsc -p tsconfig.build.json",
21
21
  "postbuild": "copyfiles --up 1 \"src/assets/svg/*.svg\" ./dist/",
22
22
  "start:storybook": "storybook dev -p 6007",
23
23
  "build:storybook": "storybook build",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "homepage": "https://github.com/AxaFrance/design-system#readme",
43
43
  "peerDependencies": {
44
- "@axa-fr/design-system-slash-css": "0.2.0-beta.338",
44
+ "@axa-fr/design-system-slash-css": "0.2.0-beta.347",
45
45
  "@material-symbols/svg-400": ">= 0.19.0",
46
46
  "react": ">= 18"
47
47
  },
@@ -61,17 +61,16 @@
61
61
  },
62
62
  "devDependencies": {
63
63
  "@material-symbols/svg-400": "*",
64
- "@storybook/addon-docs": "^7.6.14",
65
- "@storybook/addon-essentials": "^7.6.14",
66
- "@storybook/addon-interactions": "^7.6.14",
67
- "@storybook/addon-links": "^7.6.14",
68
- "@storybook/addon-mdx-gfm": "^7.6.14",
69
- "@storybook/addon-onboarding": "^1.0.10",
70
- "@storybook/addons": "^7.6.14",
71
- "@storybook/blocks": "^7.6.14",
72
- "@storybook/react": "^7.6.14",
73
- "@storybook/react-vite": "^7.6.14",
74
- "@storybook/test": "^7.6.14",
64
+ "@storybook/addon-essentials": "^8.3.5",
65
+ "@storybook/addon-interactions": "^8.3.5",
66
+ "@storybook/addon-links": "^8.3.5",
67
+ "@storybook/addon-onboarding": "^8.3.5",
68
+ "@storybook/blocks": "^8.3.5",
69
+ "@storybook/manager-api": "^8.3.5",
70
+ "@storybook/react": "^8.3.5",
71
+ "@storybook/react-vite": "^8.3.5",
72
+ "@storybook/test": "^8.3.5",
73
+ "@storybook/theming": "^8.3.5",
75
74
  "@testing-library/dom": "^10.1.0",
76
75
  "@testing-library/jest-dom": "^6.5.0",
77
76
  "@testing-library/react": "^16.0.0",
@@ -96,6 +95,7 @@
96
95
  "eslint-plugin-prettier": "^5.1.3",
97
96
  "eslint-plugin-react": "^7.36.1",
98
97
  "eslint-plugin-react-hooks": "^4.6.0",
98
+ "eslint-plugin-storybook": "^0.9.0",
99
99
  "jest-axe": "^8.0.0",
100
100
  "jsdom": "^24.0.0",
101
101
  "prettier": "^3.3.3",
@@ -103,7 +103,7 @@
103
103
  "react": "^18.3.1",
104
104
  "react-dom": "^18.2.0",
105
105
  "rimraf": "^6.0.1",
106
- "storybook": "^7.6.14",
106
+ "storybook": "^8.3.5",
107
107
  "tsc-files": "^1.1.4",
108
108
  "typescript": "^5.4.4",
109
109
  "vitest": "^2.0.5"
@@ -1,6 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react";
2
- import { Action } from "./Action";
3
- declare const meta: Meta<typeof Action>;
4
- export default meta;
5
- export declare const Default: StoryObj<typeof Action>;
6
- export declare const Button: StoryObj<typeof Action>;
@@ -1,30 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Action } from "./Action";
3
- const meta = {
4
- title: "Components/Action",
5
- component: Action,
6
- };
7
- export default meta;
8
- export const Default = {
9
- name: "Action Link",
10
- render: ({ ...args }) => _jsx(Action, { ...args }),
11
- args: {
12
- href: "http://www.axa.fr",
13
- icon: "link",
14
- title: "Lien de test",
15
- target: "_blank",
16
- id: "id",
17
- },
18
- };
19
- export const Button = {
20
- name: "Action Button",
21
- render: ({ onClick, ...args }) => _jsx(Action, { onClick: onClick, ...args }),
22
- args: {
23
- icon: "floppy-disk",
24
- title: "Enregistrer",
25
- id: "id",
26
- },
27
- argTypes: {
28
- onClick: { action: "clicked" },
29
- },
30
- };
@@ -1,9 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react";
2
- import { Alert } from "./Alert";
3
- declare const meta: Meta<typeof Alert>;
4
- export default meta;
5
- export declare const Default: StoryObj<typeof Alert>;
6
- export declare const DangerAlert: StoryObj<typeof Alert>;
7
- export declare const InfoAlert: StoryObj<typeof Alert>;
8
- export declare const SuccessAlert: StoryObj<typeof Alert>;
9
- export declare const ErrorAlert: StoryObj<typeof Alert>;
@@ -1,54 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Alert } from "./Alert";
3
- const MODIFIERS = ["success", "info", "danger", "error"];
4
- const meta = {
5
- title: "Components/Alert",
6
- component: Alert,
7
- };
8
- export default meta;
9
- export const Default = {
10
- name: "Default",
11
- args: {
12
- classModifier: "danger",
13
- title: "Attention: Ceci est une alerte",
14
- },
15
- argTypes: {
16
- classModifier: {
17
- options: MODIFIERS,
18
- control: { type: "select" },
19
- },
20
- },
21
- };
22
- export const DangerAlert = {
23
- name: "Danger Alert",
24
- args: {
25
- classModifier: "danger",
26
- title: "Attention: des informations sont manquantes",
27
- iconClassName: "glyphicon glyphicon-alert",
28
- },
29
- };
30
- export const InfoAlert = {
31
- name: "Info Alert",
32
- args: {
33
- classModifier: "info",
34
- title: "Attention: des informations sont manquantes",
35
- iconClassName: "glyphicon glyphicon-info-sign",
36
- },
37
- };
38
- export const SuccessAlert = {
39
- name: "Success Alert",
40
- args: {
41
- classModifier: "success",
42
- title: "Succès: votre demande a bien été enregistrée.",
43
- iconClassName: "glyphicon glyphicon-ok",
44
- },
45
- };
46
- export const ErrorAlert = {
47
- name: "Error Alert",
48
- args: {
49
- classModifier: "error",
50
- title: "Erreur dans les champs suivants :",
51
- iconClassName: "glyphicon glyphicon-minus-sign",
52
- children: (_jsxs("ul", { children: [_jsx("li", { children: "Le nom est obligatoire" }), _jsx("li", { children: "Le pr\u00E9nom est obligatoire" }), _jsx("li", { children: "L'email est obligatoire" }), _jsx("li", { children: "Le format de date est invalide" })] })),
53
- },
54
- };
@@ -1,7 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react";
2
- import { Badge } from "./Badge";
3
- declare const meta: Meta<typeof Badge>;
4
- export default meta;
5
- export declare const Default: StoryObj<typeof Badge>;
6
- export declare const BadgeIconStory: StoryObj<typeof Badge>;
7
- export declare const MultiExamples: StoryObj<typeof Badge>;
@@ -1,69 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Badge } from "./Badge";
3
- const meta = {
4
- title: "Components/Badge",
5
- component: Badge,
6
- parameters: {
7
- layout: "centered",
8
- },
9
- };
10
- export default meta;
11
- export const Default = {
12
- name: "Badge",
13
- args: {
14
- children: "Lorem ipsum",
15
- classModifier: "success",
16
- disabled: false,
17
- },
18
- argTypes: {
19
- classModifier: {
20
- options: ["success", "info", "danger", "error"],
21
- control: { type: "select" },
22
- defaultValue: "succes",
23
- },
24
- },
25
- };
26
- export const BadgeIconStory = {
27
- name: "Badge With Icon",
28
- args: {
29
- children: _jsx("i", { className: "glyphicon glyphicon-bell" }),
30
- classModifier: "error",
31
- disabled: false,
32
- },
33
- argTypes: {
34
- classModifier: {
35
- options: ["success", "info", "danger", "error"],
36
- control: { type: "select" },
37
- defaultValue: "error",
38
- },
39
- },
40
- };
41
- export const MultiExamples = {
42
- name: "Badge with modifiers",
43
- render: (args) => {
44
- return (_jsxs("div", { style: {
45
- display: "flex",
46
- justifyContent: "space-evenly",
47
- flexDirection: "column",
48
- alignItems: "center",
49
- flexWrap: "wrap",
50
- }, children: [_jsxs("div", { style: {
51
- display: "flex",
52
- justifyContent: "space-evenly",
53
- alignItems: "center",
54
- padding: "2rem",
55
- flexWrap: "wrap",
56
- gap: "2rem",
57
- }, children: [_jsx(Badge, { disabled: args.disabled, classModifier: "success", children: "Badge Success" }), _jsx(Badge, { disabled: args.disabled, classModifier: "danger", children: "Badge Danger" }), _jsx(Badge, { disabled: args.disabled, classModifier: "info", children: "Badge Info" }), _jsx(Badge, { disabled: args.disabled, classModifier: "error", children: "Badge Error" })] }), _jsxs("div", { style: {
58
- display: "flex",
59
- justifyContent: "space-evenly",
60
- alignItems: "center",
61
- padding: "2rem",
62
- flexWrap: "wrap",
63
- gap: "5rem",
64
- }, children: [_jsx(Badge, { disabled: args.disabled, classModifier: "success", children: _jsx("i", { className: "glyphicon glyphicon-bell" }) }), _jsx(Badge, { disabled: args.disabled, classModifier: "danger", children: _jsx("i", { className: "glyphicon glyphicon-bell" }) }), _jsx(Badge, { disabled: args.disabled, classModifier: "info", children: _jsx("i", { className: "glyphicon glyphicon-bell" }) }), _jsx(Badge, { disabled: args.disabled, classModifier: "error", children: _jsx("i", { className: "glyphicon glyphicon-bell" }) })] })] }));
65
- },
66
- args: {
67
- disabled: false,
68
- },
69
- };
@@ -1,18 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { Button } from "./Button";
3
- declare const meta: Meta<typeof Button>;
4
- export default meta;
5
- type StoryProps = Omit<React.ComponentProps<typeof Button>, "classModifier" | "children"> & {
6
- children: string;
7
- classModifier: string[];
8
- };
9
- type Story = StoryObj<StoryProps>;
10
- export declare const Playground: Story;
11
- export declare const MultiExamples: StoryObj<typeof Button>;
12
- export declare const Reverse: StoryObj<typeof Button>;
13
- export declare const Success: StoryObj<typeof Button>;
14
- export declare const Danger: StoryObj<typeof Button>;
15
- export declare const WithIconRight: StoryObj<typeof Button>;
16
- export declare const WithIconLeft: StoryObj<typeof Button>;
17
- export declare const Small: StoryObj<typeof Button>;
18
- export declare const Circle: StoryObj<typeof Button>;
@@ -1,97 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Button } from "./Button";
3
- const MODIFIERS = [
4
- "success",
5
- "info",
6
- "danger",
7
- "reverse",
8
- "disabled",
9
- "small",
10
- "hasiconLeft",
11
- "hasiconRight",
12
- ];
13
- const meta = {
14
- component: Button,
15
- title: "Components/Button",
16
- parameters: {
17
- layout: "centered",
18
- },
19
- argTypes: { onClick: { action: "clicked" } },
20
- };
21
- export default meta;
22
- export const Playground = {
23
- name: "Button",
24
- render: ({ children: text, classModifier, onClick, ...args }) => (_jsx(Button, { classModifier: classModifier.join(" "), onClick: onClick, ...args, children: text })),
25
- args: {
26
- children: "Button",
27
- classModifier: [],
28
- },
29
- argTypes: {
30
- classModifier: {
31
- options: MODIFIERS,
32
- control: { type: "multi-select" },
33
- },
34
- },
35
- };
36
- export const MultiExamples = {
37
- name: "Button with modifiers",
38
- render: () => {
39
- return (_jsxs("div", { style: {
40
- display: "flex",
41
- justifyContent: "space-evenly",
42
- padding: "2rem",
43
- flexWrap: "wrap",
44
- gap: "2rem",
45
- }, children: [_jsx(Button, { classModifier: "reverse", children: "Button Reverse" }), _jsx(Button, { classModifier: "success", children: "Button Success" }), _jsx(Button, { classModifier: "danger", children: "Button Danger" }), _jsx(Button, { classModifier: "small", children: "Button Small" }), _jsx(Button, { classModifier: "disabled", children: "Button disabled" })] }));
46
- },
47
- };
48
- export const Reverse = {
49
- name: "Button reverse",
50
- args: {
51
- children: "Button Reverse",
52
- classModifier: "reverse",
53
- },
54
- };
55
- export const Success = {
56
- name: "Button success",
57
- args: {
58
- children: "Button success",
59
- classModifier: "success",
60
- },
61
- };
62
- export const Danger = {
63
- name: "Button danger",
64
- args: {
65
- children: "Button Danger",
66
- classModifier: "danger",
67
- },
68
- };
69
- export const WithIconRight = {
70
- name: "Button with right icon",
71
- args: {
72
- children: (_jsxs(_Fragment, { children: [_jsx("span", { className: "glyphicon glyphicon-arrow-right" }), _jsx("span", { className: "af-btn__text", children: "With icon" })] })),
73
- classModifier: "hasiconRight",
74
- },
75
- };
76
- export const WithIconLeft = {
77
- name: "Button with left icon",
78
- args: {
79
- children: (_jsxs(_Fragment, { children: [_jsx("span", { className: "glyphicon glyphicon-arrow-left" }), _jsx("span", { className: "af-btn__text", children: "With icon" })] })),
80
- classModifier: "hasiconLeft",
81
- },
82
- };
83
- export const Small = {
84
- name: "Button small",
85
- args: {
86
- children: "Button Small",
87
- classModifier: "small",
88
- },
89
- };
90
- export const Circle = {
91
- name: "Button circle",
92
- args: {
93
- classModifier: "circle",
94
- title: "Save",
95
- children: _jsx("span", { className: "glyphicon glyphicon-floppy-disk" }),
96
- },
97
- };
@@ -1,18 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react";
2
- import { ComponentPropsWithoutRef } from "react";
3
- import { Checkbox } from "./Checkbox";
4
- import { CheckboxInput } from "./CheckboxInput";
5
- import { CheckboxItem } from "./CheckboxItem";
6
- declare const meta: Meta;
7
- export default meta;
8
- type Story = StoryObj<Omit<ComponentPropsWithoutRef<typeof CheckboxInput>, "classModifier"> & {
9
- classModifier: string[];
10
- }>;
11
- export declare const CheckboxInputStory: Story;
12
- export declare const CheckboxItemToggleStory: StoryObj<{
13
- isChecked: boolean;
14
- disabled: boolean;
15
- onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
16
- }>;
17
- export declare const CheckboxItemStory: StoryObj<typeof CheckboxItem>;
18
- export declare const CheckboxStory: StoryObj<typeof Checkbox>;
@@ -1,108 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { MessageTypes } from "../core";
3
- import { Checkbox } from "./Checkbox";
4
- import { CheckboxInput } from "./CheckboxInput";
5
- import { CheckboxItem } from "./CheckboxItem";
6
- import { CheckboxModes } from "./CheckboxModes";
7
- const meta = {
8
- title: "Components/Form/Input/Checkbox",
9
- component: CheckboxInput,
10
- argTypes: {
11
- onChange: { action: "onChange" },
12
- messageType: {
13
- control: { type: "select", options: Object.values(MessageTypes) },
14
- },
15
- mode: {
16
- control: { type: "select", options: Object.values(CheckboxModes) },
17
- },
18
- },
19
- };
20
- export default meta;
21
- const modifiers = ["required", "disabled"];
22
- const Badge = ({ children, classModifier, }) => (_jsx("strong", { style: { color: "green" }, className: classModifier ?? "", children: children }));
23
- const options = [
24
- { label: "Disabled", value: "1", disabled: true, id: "uniqueId1" },
25
- { label: "Unchecked", value: "2", id: "uniqueId2" },
26
- { label: "Checked", value: "3" },
27
- {
28
- label: _jsx(Badge, { classModifier: "success", children: "A JSX element" }),
29
- value: "4",
30
- },
31
- ];
32
- const values = ["1", "3"];
33
- export const CheckboxInputStory = {
34
- name: "CheckboxInput",
35
- render: ({ classModifier, ...args }) => (_jsx("form", { className: "af-form", name: "myform", children: _jsx(CheckboxInput, { ...args, values: values, options: options, classModifier: (classModifier ?? []).join(" "), isVisible: true, classNameContainerLabel: "col-md-2", classNameContainerInput: "col-md-10" }) })),
36
- args: {
37
- label: "Place type",
38
- classModifier: ["required"],
39
- mode: CheckboxModes.classic,
40
- message: "Error message",
41
- messageType: MessageTypes.error,
42
- forceDisplayMessage: false,
43
- id: "inputuniqueid",
44
- name: "placeType",
45
- },
46
- argTypes: {
47
- classModifier: {
48
- options: modifiers,
49
- control: { type: "inline-check" },
50
- },
51
- onChange: { action: "onChange" },
52
- },
53
- parameters: {
54
- controls: {
55
- include: [
56
- "label",
57
- "classModifier",
58
- "mode",
59
- "message",
60
- "messageType",
61
- "forceDisplayMessage",
62
- "onChange",
63
- ],
64
- },
65
- },
66
- };
67
- export const CheckboxItemToggleStory = {
68
- name: "CheckboxItem Toggle",
69
- render: (args) => (_jsx(CheckboxItem, { ...args, name: "placeType", id: "uniqueid", value: "toto", className: "af-form__checkbox-toggle" })),
70
- args: {
71
- isChecked: true,
72
- disabled: false,
73
- },
74
- argTypes: {
75
- onChange: { action: "onChange" },
76
- },
77
- parameters: {
78
- controls: {
79
- include: ["isChecked", "disabled", "onChange"],
80
- },
81
- },
82
- };
83
- export const CheckboxItemStory = {
84
- name: "CheckboxItem",
85
- render: ({ isChecked, ...args }) => (_jsx(CheckboxItem, { ...args, name: "placeType", id: "uniqueid", value: "toto", defaultChecked: isChecked })),
86
- args: {
87
- label: "web center forever",
88
- isChecked: true,
89
- disabled: false,
90
- },
91
- parameters: {
92
- controls: {
93
- include: ["isChecked", "disabled", "label", "onChange"],
94
- },
95
- },
96
- };
97
- export const CheckboxStory = {
98
- name: "Checkbox",
99
- render: (args) => (_jsx(Checkbox, { ...args, options: options, values: values, name: "placeName", id: "uniqueid", placeholder: "Paris" })),
100
- args: {
101
- mode: CheckboxModes.default,
102
- },
103
- parameters: {
104
- controls: {
105
- include: ["mode"],
106
- },
107
- },
108
- };
@@ -1,9 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react";
2
- import { ComponentPropsWithRef } from "react";
3
- import { Choice } from "./Choice";
4
- declare const meta: Meta<typeof Choice>;
5
- export default meta;
6
- type ChoiceProps = Omit<ComponentPropsWithRef<typeof Choice>, "classModifier"> & {
7
- classModifier?: string[];
8
- };
9
- export declare const ChoiceStory: StoryObj<ChoiceProps>;
@@ -1,27 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Choice } from "./Choice";
3
- const meta = {
4
- component: Choice,
5
- title: "Components/Form/Input/Choice",
6
- argTypes: { onChange: { action: "onChange" } },
7
- };
8
- export default meta;
9
- export const ChoiceStory = {
10
- name: "Choice",
11
- render: ({ classModifier, ...args }) => (_jsx(Choice, { classModifier: classModifier?.join(" "), ...args })),
12
- args: {
13
- name: "placeName",
14
- placeholder: "Paris",
15
- id: "uniqueid",
16
- classModifier: [],
17
- readOnly: false,
18
- disabled: false,
19
- },
20
- argTypes: {
21
- onChange: { action: "onChange" },
22
- classModifier: {
23
- options: ["disabled", "required"],
24
- control: { type: "inline-check" },
25
- },
26
- },
27
- };
@@ -1,9 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react";
2
- import { ComponentPropsWithRef } from "react";
3
- import { ChoiceInput } from "./ChoiceInput";
4
- declare const meta: Meta<typeof ChoiceInput>;
5
- export default meta;
6
- type ChoiceInputProps = Omit<ComponentPropsWithRef<typeof ChoiceInput>, "classModifier"> & {
7
- classModifier?: string[];
8
- };
9
- export declare const ChoiceInputStory: StoryObj<ChoiceInputProps>;
@@ -1,33 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { MessageTypes } from "../core";
3
- import { ChoiceInput } from "./ChoiceInput";
4
- const meta = {
5
- component: ChoiceInput,
6
- title: "Components/Form/Input/Choice",
7
- argTypes: { onChange: { action: "onChange" } },
8
- };
9
- export default meta;
10
- export const ChoiceInputStory = {
11
- name: "ChoiceInput",
12
- render: ({ classModifier, ...args }) => (_jsx(ChoiceInput, { classModifier: classModifier?.join(" "), ...args })),
13
- args: {
14
- name: "placeName",
15
- label: "Place type",
16
- placeholder: "Paris",
17
- message: "",
18
- messageType: MessageTypes.error,
19
- forceDisplayMessage: false,
20
- id: "uniqueid",
21
- classModifier: [],
22
- isVisible: true,
23
- readOnly: false,
24
- disabled: false,
25
- },
26
- argTypes: {
27
- onChange: { action: "onChange" },
28
- classModifier: {
29
- options: ["disabled", "required"],
30
- control: { type: "inline-check" },
31
- },
32
- },
33
- };
@@ -1,9 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react";
2
- import { Date as DateComponent } from "./Date";
3
- declare const meta: Meta<typeof DateComponent>;
4
- export default meta;
5
- type StoryProps = Omit<React.ComponentProps<typeof DateComponent>, "classModifier"> & {
6
- classModifier: string[];
7
- };
8
- type Story = StoryObj<StoryProps>;
9
- export declare const DateStory: Story;
@@ -1,28 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Date as DateComponent } from "./Date";
3
- const MODIFIERS = ["", "required", "disabled"];
4
- const commonProps = {
5
- name: "birthDate",
6
- id: "uniqueid",
7
- value: new Date("01/01/2024"),
8
- };
9
- const meta = {
10
- component: DateComponent,
11
- title: "Components/Form/Input/Date",
12
- argTypes: { onChange: { action: "onChange" } },
13
- };
14
- export default meta;
15
- export const DateStory = {
16
- name: "Date",
17
- tags: ["Form", "Input"],
18
- render: ({ classModifier, onChange, ...args }) => (_jsx(DateComponent, { classModifier: classModifier.join(" "), onChange: onChange, ...args })),
19
- args: {
20
- ...commonProps,
21
- classModifier: [],
22
- },
23
- argTypes: {
24
- classModifier: {
25
- options: MODIFIERS,
26
- },
27
- },
28
- };
@@ -1,9 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react";
2
- import { ComponentProps } from "react";
3
- import { DateInput } from "./DateInput";
4
- declare const meta: Meta<typeof DateInput>;
5
- export default meta;
6
- type StoryProps = ComponentProps<typeof DateInput>;
7
- type Story = StoryObj<StoryProps>;
8
- export declare const DateInputStory: Story;
9
- export declare const DateInputRequiredStory: Story;