mautourco-components 0.2.4 → 0.2.7

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 (297) hide show
  1. package/README.md +190 -190
  2. package/dist/components/atoms/Avatar/Avatar.d.ts +14 -14
  3. package/dist/components/atoms/Avatar/Avatar.js +31 -31
  4. package/dist/components/atoms/Button/Button.css +320 -320
  5. package/dist/components/atoms/Button/Button.d.ts +27 -27
  6. package/dist/components/atoms/Button/Button.js +35 -35
  7. package/dist/components/atoms/Checkbox/Checkbox.d.ts +13 -13
  8. package/dist/components/atoms/Checkbox/Checkbox.js +39 -39
  9. package/dist/components/atoms/Icon/Icon.d.ts +10 -10
  10. package/dist/components/atoms/Icon/Icon.js +123 -123
  11. package/dist/components/atoms/Icon/icons/ArrivalIcon.d.ts +8 -8
  12. package/dist/components/atoms/Icon/icons/ArrivalIcon.js +31 -31
  13. package/dist/components/atoms/Icon/icons/BuildingIcon.d.ts +8 -8
  14. package/dist/components/atoms/Icon/icons/BuildingIcon.js +36 -36
  15. package/dist/components/atoms/Icon/icons/CalendarIcon.d.ts +12 -12
  16. package/dist/components/atoms/Icon/icons/CalendarIcon.js +41 -41
  17. package/dist/components/atoms/Icon/icons/CalendarOutlineIcon.d.ts +8 -8
  18. package/dist/components/atoms/Icon/icons/CalendarOutlineIcon.js +36 -36
  19. package/dist/components/atoms/Icon/icons/CarIcon.d.ts +8 -8
  20. package/dist/components/atoms/Icon/icons/CarIcon.js +30 -30
  21. package/dist/components/atoms/Icon/icons/Check.d.ts +8 -8
  22. package/dist/components/atoms/Icon/icons/Check.js +30 -30
  23. package/dist/components/atoms/Icon/icons/CheckCircleIcon.d.ts +8 -8
  24. package/dist/components/atoms/Icon/icons/CheckCircleIcon.js +30 -30
  25. package/dist/components/atoms/Icon/icons/Chevron.d.ts +9 -9
  26. package/dist/components/atoms/Icon/icons/Chevron.js +54 -54
  27. package/dist/components/atoms/Icon/icons/ChevronDownIcon.d.ts +8 -8
  28. package/dist/components/atoms/Icon/icons/ChevronDownIcon.js +30 -30
  29. package/dist/components/atoms/Icon/icons/Close.d.ts +8 -8
  30. package/dist/components/atoms/Icon/icons/Close.js +30 -30
  31. package/dist/components/atoms/Icon/icons/DeleteIcon.d.ts +8 -8
  32. package/dist/components/atoms/Icon/icons/DeleteIcon.js +30 -30
  33. package/dist/components/atoms/Icon/icons/DepartureIcon.d.ts +8 -8
  34. package/dist/components/atoms/Icon/icons/DepartureIcon.js +30 -30
  35. package/dist/components/atoms/Icon/icons/EyeIcon.d.ts +8 -8
  36. package/dist/components/atoms/Icon/icons/EyeIcon.js +30 -30
  37. package/dist/components/atoms/Icon/icons/FacebookIcon.d.ts +8 -8
  38. package/dist/components/atoms/Icon/icons/FacebookIcon.js +36 -36
  39. package/dist/components/atoms/Icon/icons/HomeIcon.d.ts +8 -8
  40. package/dist/components/atoms/Icon/icons/HomeIcon.js +25 -25
  41. package/dist/components/atoms/Icon/icons/InfoIcon.d.ts +8 -8
  42. package/dist/components/atoms/Icon/icons/InfoIcon.js +30 -30
  43. package/dist/components/atoms/Icon/icons/LinkedInIcon.d.ts +8 -8
  44. package/dist/components/atoms/Icon/icons/LinkedInIcon.js +36 -36
  45. package/dist/components/atoms/Icon/icons/MapPinIcon.d.ts +8 -8
  46. package/dist/components/atoms/Icon/icons/MapPinIcon.js +30 -30
  47. package/dist/components/atoms/Icon/icons/MautoucoLogo.d.ts +8 -8
  48. package/dist/components/atoms/Icon/icons/MautoucoLogo.js +37 -37
  49. package/dist/components/atoms/Icon/icons/MenuIcon.d.ts +8 -8
  50. package/dist/components/atoms/Icon/icons/MenuIcon.js +37 -37
  51. package/dist/components/atoms/Icon/icons/MinusIcon.d.ts +8 -8
  52. package/dist/components/atoms/Icon/icons/MinusIcon.js +25 -25
  53. package/dist/components/atoms/Icon/icons/MoreIcon.d.ts +8 -8
  54. package/dist/components/atoms/Icon/icons/MoreIcon.js +30 -30
  55. package/dist/components/atoms/Icon/icons/PlaneIcon.d.ts +8 -8
  56. package/dist/components/atoms/Icon/icons/PlaneIcon.js +36 -36
  57. package/dist/components/atoms/Icon/icons/PlusIcon.d.ts +8 -8
  58. package/dist/components/atoms/Icon/icons/PlusIcon.js +25 -25
  59. package/dist/components/atoms/Icon/icons/Search.d.ts +8 -8
  60. package/dist/components/atoms/Icon/icons/Search.js +30 -30
  61. package/dist/components/atoms/Icon/icons/Settings.d.ts +8 -8
  62. package/dist/components/atoms/Icon/icons/Settings.js +30 -30
  63. package/dist/components/atoms/Icon/icons/ShipIcon.d.ts +8 -8
  64. package/dist/components/atoms/Icon/icons/ShipIcon.js +36 -36
  65. package/dist/components/atoms/Icon/icons/StrollerIcon.d.ts +8 -8
  66. package/dist/components/atoms/Icon/icons/StrollerIcon.js +30 -30
  67. package/dist/components/atoms/Icon/icons/TwitterIcon.d.ts +8 -8
  68. package/dist/components/atoms/Icon/icons/TwitterIcon.js +36 -36
  69. package/dist/components/atoms/Icon/icons/User.d.ts +8 -8
  70. package/dist/components/atoms/Icon/icons/User.js +30 -30
  71. package/dist/components/atoms/Icon/icons/UserIcon.d.ts +12 -12
  72. package/dist/components/atoms/Icon/icons/UserIcon.js +41 -41
  73. package/dist/components/atoms/Icon/icons/Youtube.d.ts +8 -8
  74. package/dist/components/atoms/Icon/icons/Youtube.js +36 -36
  75. package/dist/components/atoms/Illustration/Illustration.d.ts +14 -14
  76. package/dist/components/atoms/Illustration/Illustration.js +33 -33
  77. package/dist/components/atoms/Illustration/illustrations.d.ts +51 -51
  78. package/dist/components/atoms/Illustration/illustrations.js +97 -97
  79. package/dist/components/atoms/Inputs/DropdownInput/DropdownInput.d.ts +12 -12
  80. package/dist/components/atoms/Inputs/DropdownInput/DropdownInput.js +53 -53
  81. package/dist/components/atoms/Inputs/Input/Input.d.ts +15 -15
  82. package/dist/components/atoms/Inputs/Input/Input.js +27 -27
  83. package/dist/components/atoms/Inputs/Textarea/Textarea.d.ts +14 -14
  84. package/dist/components/atoms/Inputs/Textarea/Textarea.js +15 -15
  85. package/dist/components/atoms/Link/Link.d.ts +44 -44
  86. package/dist/components/atoms/Link/Link.js +76 -76
  87. package/dist/components/atoms/RatingStar/RatingStar.d.ts +40 -40
  88. package/dist/components/atoms/RatingStar/RatingStar.js +54 -54
  89. package/dist/components/atoms/SegmentedButton/SegmentedButton.d.ts +27 -27
  90. package/dist/components/atoms/SegmentedButton/SegmentedButton.js +49 -49
  91. package/dist/components/atoms/SelectedValue/SelectedValue.d.ts +11 -11
  92. package/dist/components/atoms/SelectedValue/SelectedValue.js +29 -29
  93. package/dist/components/atoms/Slider/Slider.d.ts +52 -52
  94. package/dist/components/atoms/Slider/Slider.js +30 -30
  95. package/dist/components/atoms/Spinner/Spinner.d.ts +9 -9
  96. package/dist/components/atoms/Spinner/Spinner.js +38 -38
  97. package/dist/components/atoms/Spinner/variants/ButtonSpinner.d.ts +8 -8
  98. package/dist/components/atoms/Spinner/variants/ButtonSpinner.js +19 -19
  99. package/dist/components/atoms/Spinner/variants/LoadingSpinner.d.ts +7 -7
  100. package/dist/components/atoms/Spinner/variants/LoadingSpinner.js +7 -7
  101. package/dist/components/atoms/Tab/Tab.css +266 -266
  102. package/dist/components/atoms/Tab/Tab.d.ts +22 -22
  103. package/dist/components/atoms/Tab/Tab.js +54 -54
  104. package/dist/components/atoms/Typography/Typography.d.ts +24 -24
  105. package/dist/components/atoms/Typography/Typography.js +100 -100
  106. package/dist/components/molecules/Calendar/CalendarInput.d.ts +34 -34
  107. package/dist/components/molecules/Calendar/CalendarInput.js +49 -49
  108. package/dist/components/molecules/Calendar/DateTime.d.ts +25 -25
  109. package/dist/components/molecules/Calendar/DateTime.js +106 -106
  110. package/dist/components/molecules/Calendar/TimePicker.d.ts +16 -16
  111. package/dist/components/molecules/Calendar/TimePicker.js +91 -91
  112. package/dist/components/molecules/LocationDropdown/LocationDropdown.d.ts +34 -34
  113. package/dist/components/molecules/LocationDropdown/LocationDropdown.js +120 -120
  114. package/dist/components/molecules/LocationDropdown/index.d.ts +2 -2
  115. package/dist/components/molecules/LocationDropdown/index.js +1 -1
  116. package/dist/components/molecules/MultiSelectDropdown/MultiSelectDropdown.d.ts +29 -29
  117. package/dist/components/molecules/MultiSelectDropdown/MultiSelectDropdown.js +106 -106
  118. package/dist/components/molecules/RatingTab/RatingTab.d.ts +39 -39
  119. package/dist/components/molecules/RatingTab/RatingTab.js +41 -41
  120. package/dist/components/molecules/TabGroup/TabGroup.d.ts +17 -17
  121. package/dist/components/molecules/TabGroup/TabGroup.js +30 -30
  122. package/dist/components/molecules/UserCard/UserCard.d.ts +20 -20
  123. package/dist/components/molecules/UserCard/UserCard.js +57 -57
  124. package/dist/components/organisms/CardContainer/CardContainer.d.ts +37 -37
  125. package/dist/components/organisms/CardContainer/CardContainer.js +27 -27
  126. package/dist/components/organisms/DateTimePicker/DateTimePicker.d.ts +15 -15
  127. package/dist/components/organisms/DateTimePicker/DateTimePicker.js +66 -66
  128. package/dist/components/organisms/Dialog/Dialog.d.ts +103 -103
  129. package/dist/components/organisms/Dialog/Dialog.js +162 -162
  130. package/dist/components/organisms/Footer/Footer.d.ts +38 -38
  131. package/dist/components/organisms/Footer/Footer.js +74 -74
  132. package/dist/components/organisms/PaxSelector/PaxSelector.d.ts +63 -63
  133. package/dist/components/organisms/PaxSelector/PaxSelector.js +402 -402
  134. package/dist/components/organisms/RoundTrip/RoundTrip.d.ts +54 -54
  135. package/dist/components/organisms/RoundTrip/RoundTrip.js +179 -179
  136. package/dist/components/organisms/RoundTrip/index.d.ts +2 -2
  137. package/dist/components/organisms/RoundTrip/index.js +1 -1
  138. package/dist/components/organisms/SearchBarTransfer/SearchBarTransfer.d.ts +35 -35
  139. package/dist/components/organisms/SearchBarTransfer/SearchBarTransfer.js +192 -192
  140. package/dist/components/organisms/SearchBarTransfer/index.d.ts +2 -2
  141. package/dist/components/organisms/SearchBarTransfer/index.js +1 -1
  142. package/dist/components/organisms/TopNavigation/DesktopNav.d.ts +33 -33
  143. package/dist/components/organisms/TopNavigation/DesktopNav.js +32 -26
  144. package/dist/components/organisms/TopNavigation/MobileNav.d.ts +32 -32
  145. package/dist/components/organisms/TopNavigation/MobileNav.js +45 -45
  146. package/dist/components/organisms/TopNavigation/TopNavigation.d.ts +33 -33
  147. package/dist/components/organisms/TopNavigation/TopNavigation.js +20 -20
  148. package/dist/components/organisms/TransferLine/TransferLine.d.ts +53 -53
  149. package/dist/components/organisms/TransferLine/TransferLine.js +179 -179
  150. package/dist/components/ui/button.d.ts +10 -10
  151. package/dist/components/ui/button.js +56 -56
  152. package/dist/components/ui/calendar.d.ts +8 -8
  153. package/dist/components/ui/calendar.js +87 -87
  154. package/dist/components/ui/popover.d.ts +7 -7
  155. package/dist/components/ui/popover.js +42 -42
  156. package/dist/hooks/useMobile.d.ts +5 -5
  157. package/dist/hooks/useMobile.js +26 -26
  158. package/dist/index.d.ts +49 -49
  159. package/dist/index.js +46 -46
  160. package/dist/lib/utils.d.ts +7 -7
  161. package/dist/lib/utils.js +13 -13
  162. package/dist/styles/components/avatar.css +122 -122
  163. package/dist/styles/components/calendar.css +140 -140
  164. package/dist/styles/components/checkbox.css +206 -206
  165. package/dist/styles/components/dropdown.css +269 -269
  166. package/dist/styles/components/forms.css +209 -209
  167. package/dist/styles/components/illustration.css +123 -123
  168. package/dist/styles/components/molecule/calendarInput.css +133 -133
  169. package/dist/styles/components/molecule/dateTime.css +126 -126
  170. package/dist/styles/components/molecule/location-dropdown.css +132 -132
  171. package/dist/styles/components/molecule/timePicker.css +122 -122
  172. package/dist/styles/components/multiselect-dropdown.css +286 -286
  173. package/dist/styles/components/organism/card-container.css +148 -148
  174. package/dist/styles/components/organism/dialog.css +168 -168
  175. package/dist/styles/components/organism/footer.css +119 -119
  176. package/dist/styles/components/organism/pax-selector.css +617 -617
  177. package/dist/styles/components/organism/round-trip.css +139 -139
  178. package/dist/styles/components/organism/search-bar-transfer.css +158 -161
  179. package/dist/styles/components/organism/topnavigation.css +143 -143
  180. package/dist/styles/components/organism/transfer-line.css +138 -138
  181. package/dist/styles/components/rating-star.css +145 -145
  182. package/dist/styles/components/rating-tab.css +179 -179
  183. package/dist/styles/components/scrollbar.css +155 -155
  184. package/dist/styles/components/segmented-button.css +214 -214
  185. package/dist/styles/components/selected-value.css +175 -175
  186. package/dist/styles/components/slider.css +182 -182
  187. package/dist/styles/components/typography.css +245 -245
  188. package/dist/styles/tokens/tokens.css +119 -119
  189. package/dist/styles/tokens/tokens.d.ts +3108 -3108
  190. package/dist/styles/tokens/tokens.js +2652 -2652
  191. package/package.json +103 -103
  192. package/src/components/atoms/Avatar/Avatar.tsx +60 -60
  193. package/src/components/atoms/Button/Button.css +200 -200
  194. package/src/components/atoms/Button/Button.tsx +82 -82
  195. package/src/components/atoms/Checkbox/Checkbox.tsx +83 -83
  196. package/src/components/atoms/Icon/Icon.tsx +163 -163
  197. package/src/components/atoms/Icon/icons/ArrivalIcon.tsx +52 -52
  198. package/src/components/atoms/Icon/icons/BuildingIcon.tsx +50 -50
  199. package/src/components/atoms/Icon/icons/CalendarIcon.tsx +63 -63
  200. package/src/components/atoms/Icon/icons/CalendarOutlineIcon.tsx +50 -50
  201. package/src/components/atoms/Icon/icons/CarIcon.tsx +44 -44
  202. package/src/components/atoms/Icon/icons/Check.tsx +36 -36
  203. package/src/components/atoms/Icon/icons/CheckCircleIcon.tsx +48 -48
  204. package/src/components/atoms/Icon/icons/Chevron.tsx +73 -73
  205. package/src/components/atoms/Icon/icons/ChevronDownIcon.tsx +46 -46
  206. package/src/components/atoms/Icon/icons/Close.tsx +39 -39
  207. package/src/components/atoms/Icon/icons/DeleteIcon.tsx +44 -44
  208. package/src/components/atoms/Icon/icons/DepartureIcon.tsx +50 -50
  209. package/src/components/atoms/Icon/icons/EyeIcon.tsx +44 -44
  210. package/src/components/atoms/Icon/icons/FacebookIcon.tsx +50 -50
  211. package/src/components/atoms/Icon/icons/HomeIcon.tsx +52 -52
  212. package/src/components/atoms/Icon/icons/InfoIcon.tsx +44 -44
  213. package/src/components/atoms/Icon/icons/LinkedInIcon.tsx +50 -50
  214. package/src/components/atoms/Icon/icons/MapPinIcon.tsx +44 -44
  215. package/src/components/atoms/Icon/icons/MautoucoLogo.tsx +93 -93
  216. package/src/components/atoms/Icon/icons/MenuIcon.tsx +49 -49
  217. package/src/components/atoms/Icon/icons/MinusIcon.tsx +45 -45
  218. package/src/components/atoms/Icon/icons/MoreIcon.tsx +44 -44
  219. package/src/components/atoms/Icon/icons/PlaneIcon.tsx +50 -50
  220. package/src/components/atoms/Icon/icons/PlusIcon.tsx +45 -45
  221. package/src/components/atoms/Icon/icons/Search.tsx +37 -37
  222. package/src/components/atoms/Icon/icons/Settings.tsx +38 -38
  223. package/src/components/atoms/Icon/icons/ShipIcon.tsx +50 -50
  224. package/src/components/atoms/Icon/icons/StrollerIcon.tsx +44 -44
  225. package/src/components/atoms/Icon/icons/TwitterIcon.tsx +50 -50
  226. package/src/components/atoms/Icon/icons/User.tsx +37 -37
  227. package/src/components/atoms/Icon/icons/UserIcon.tsx +63 -63
  228. package/src/components/atoms/Icon/icons/Youtube.tsx +50 -50
  229. package/src/components/atoms/Illustration/Illustration.tsx +28 -28
  230. package/src/components/atoms/Illustration/illustrations.ts +116 -116
  231. package/src/components/atoms/Inputs/DropdownInput/DropdownInput.tsx +96 -96
  232. package/src/components/atoms/Inputs/Textarea/Textarea.tsx +51 -51
  233. package/src/components/atoms/Link/Link.tsx +168 -168
  234. package/src/components/atoms/RatingStar/RatingStar.tsx +114 -114
  235. package/src/components/atoms/SegmentedButton/SegmentedButton.tsx +94 -94
  236. package/src/components/atoms/SelectedValue/SelectedValue.tsx +59 -59
  237. package/src/components/atoms/Slider/Slider.tsx +95 -95
  238. package/src/components/atoms/Spinner/Spinner.tsx +56 -56
  239. package/src/components/atoms/Spinner/variants/ButtonSpinner.tsx +37 -37
  240. package/src/components/atoms/Spinner/variants/LoadingSpinner.tsx +22 -22
  241. package/src/components/atoms/Tab/Tab.css +147 -147
  242. package/src/components/atoms/Tab/Tab.tsx +96 -96
  243. package/src/components/atoms/Typography/Typography.tsx +153 -153
  244. package/src/components/molecules/Calendar/CalendarInput.tsx +135 -135
  245. package/src/components/molecules/Calendar/DateTime.tsx +172 -172
  246. package/src/components/molecules/Calendar/TimePicker.tsx +174 -174
  247. package/src/components/molecules/LocationDropdown/LocationDropdown.tsx +234 -234
  248. package/src/components/molecules/LocationDropdown/index.ts +2 -2
  249. package/src/components/molecules/RatingTab/RatingTab.tsx +96 -96
  250. package/src/components/molecules/TabGroup/TabGroup.tsx +60 -60
  251. package/src/components/molecules/UserCard/UserCard.stories.tsx +36 -36
  252. package/src/components/molecules/UserCard/UserCard.tsx +173 -173
  253. package/src/components/organisms/CardContainer/CardContainer.tsx +66 -66
  254. package/src/components/organisms/DateTimePicker/DateTimePicker.tsx +110 -110
  255. package/src/components/organisms/Dialog/Dialog.tsx +352 -352
  256. package/src/components/organisms/Footer/Footer.tsx +290 -290
  257. package/src/components/organisms/PaxSelector/PaxSelector.tsx +979 -979
  258. package/src/components/organisms/RoundTrip/RoundTrip.tsx +335 -335
  259. package/src/components/organisms/RoundTrip/index.ts +2 -2
  260. package/src/components/organisms/SearchBarTransfer/SearchBarTransfer.tsx +388 -388
  261. package/src/components/organisms/SearchBarTransfer/index.ts +2 -2
  262. package/src/components/organisms/TopNavigation/DesktopNav.tsx +133 -122
  263. package/src/components/organisms/TopNavigation/MobileNav.tsx +212 -212
  264. package/src/components/organisms/TopNavigation/TopNavigation.tsx +45 -45
  265. package/src/components/organisms/TransferLine/TransferLine.tsx +369 -369
  266. package/src/components/ui/button.tsx +60 -60
  267. package/src/components/ui/calendar.tsx +246 -246
  268. package/src/components/ui/popover.tsx +46 -46
  269. package/src/styles/components/avatar.css +58 -58
  270. package/src/styles/components/calendar.css +85 -85
  271. package/src/styles/components/checkbox.css +130 -130
  272. package/src/styles/components/dropdown.css +214 -214
  273. package/src/styles/components/forms.css +147 -147
  274. package/src/styles/components/illustration.css +7 -7
  275. package/src/styles/components/molecule/calendarInput.css +156 -156
  276. package/src/styles/components/molecule/dateTime.css +14 -14
  277. package/src/styles/components/molecule/location-dropdown.css +204 -204
  278. package/src/styles/components/molecule/timePicker.css +78 -78
  279. package/src/styles/components/multiselect-dropdown.css +230 -230
  280. package/src/styles/components/organism/card-container.css +49 -49
  281. package/src/styles/components/organism/dialog.css +241 -241
  282. package/src/styles/components/organism/footer.css +113 -113
  283. package/src/styles/components/organism/pax-selector.css +702 -702
  284. package/src/styles/components/organism/round-trip.css +55 -55
  285. package/src/styles/components/organism/search-bar-transfer.css +128 -127
  286. package/src/styles/components/organism/topnavigation.css +161 -161
  287. package/src/styles/components/organism/transfer-line.css +86 -86
  288. package/src/styles/components/rating-star.css +39 -39
  289. package/src/styles/components/rating-tab.css +83 -83
  290. package/src/styles/components/scrollbar.css +63 -63
  291. package/src/styles/components/segmented-button.css +134 -134
  292. package/src/styles/components/selected-value.css +80 -80
  293. package/src/styles/components/slider.css +86 -86
  294. package/src/styles/components/typography.css +251 -251
  295. package/src/styles/fonts.css +50 -0
  296. package/src/styles/tokens/tokens.css +119 -119
  297. package/src/styles/tokens/tokens.js +12 -6
@@ -1,94 +1,94 @@
1
- import React from 'react';
2
-
3
- export interface SegmentedButtonOption {
4
- /** Valeur de l'option */
5
- value: string;
6
- /** Libellé affiché */
7
- label: string;
8
- /** État désactivé */
9
- disabled?: boolean;
10
- }
11
-
12
- export interface SegmentedButtonProps {
13
- /** Options du bouton segmenté */
14
- options: SegmentedButtonOption[];
15
- /** Valeur sélectionnée */
16
- value: string;
17
- /** Handler de changement */
18
- onChange: (value: string) => void;
19
- /** Orientation du bouton segmenté */
20
- orientation?: 'horizontal' | 'vertical';
21
- /** État désactivé pour tout le groupe */
22
- disabled?: boolean;
23
- /** Classes CSS supplémentaires */
24
- className?: string;
25
- /** Nom du groupe pour l'accessibilité */
26
- name?: string;
27
- }
28
-
29
- const SegmentedButton: React.FC<SegmentedButtonProps> = ({
30
- options,
31
- value,
32
- onChange,
33
- orientation = 'horizontal',
34
- disabled = false,
35
- className = '',
36
- name,
37
- }) => {
38
- const containerClasses = [
39
- 'segmented-button',
40
- `segmented-button--${orientation}`,
41
- disabled && 'segmented-button--disabled',
42
- className,
43
- ]
44
- .filter(Boolean)
45
- .join(' ');
46
-
47
- const handleClick = (optionValue: string, optionDisabled?: boolean) => {
48
- if (!disabled && !optionDisabled && optionValue !== value) {
49
- onChange(optionValue);
50
- }
51
- };
52
-
53
- const getButtonClasses = (option: SegmentedButtonOption, index: number) => {
54
- const isSelected = option.value === value;
55
- const isFirst = index === 0;
56
- const isLast = index === options.length - 1;
57
- const isDisabled = disabled || option.disabled;
58
-
59
- return [
60
- 'segmented-button__item',
61
- isSelected && 'segmented-button__item--selected',
62
- isFirst && 'segmented-button__item--first',
63
- isLast && 'segmented-button__item--last',
64
- isDisabled && 'segmented-button__item--disabled',
65
- ]
66
- .filter(Boolean)
67
- .join(' ');
68
- };
69
-
70
- return (
71
- <div className={containerClasses} role="group" aria-label={name}>
72
- {options.map((option, index) => {
73
- const isSelected = option.value === value;
74
- const isDisabled = disabled || option.disabled;
75
-
76
- return (
77
- <button
78
- key={option.value}
79
- type="button"
80
- className={getButtonClasses(option, index)}
81
- onClick={() => handleClick(option.value, option.disabled)}
82
- disabled={isDisabled}
83
- aria-pressed={isSelected}
84
- aria-label={option.label}
85
- >
86
- <span className="segmented-button__label">{option.label}</span>
87
- </button>
88
- );
89
- })}
90
- </div>
91
- );
92
- };
93
-
94
- export default SegmentedButton;
1
+ import React from 'react';
2
+
3
+ export interface SegmentedButtonOption {
4
+ /** Valeur de l'option */
5
+ value: string;
6
+ /** Libellé affiché */
7
+ label: string;
8
+ /** État désactivé */
9
+ disabled?: boolean;
10
+ }
11
+
12
+ export interface SegmentedButtonProps {
13
+ /** Options du bouton segmenté */
14
+ options: SegmentedButtonOption[];
15
+ /** Valeur sélectionnée */
16
+ value: string;
17
+ /** Handler de changement */
18
+ onChange: (value: string) => void;
19
+ /** Orientation du bouton segmenté */
20
+ orientation?: 'horizontal' | 'vertical';
21
+ /** État désactivé pour tout le groupe */
22
+ disabled?: boolean;
23
+ /** Classes CSS supplémentaires */
24
+ className?: string;
25
+ /** Nom du groupe pour l'accessibilité */
26
+ name?: string;
27
+ }
28
+
29
+ const SegmentedButton: React.FC<SegmentedButtonProps> = ({
30
+ options,
31
+ value,
32
+ onChange,
33
+ orientation = 'horizontal',
34
+ disabled = false,
35
+ className = '',
36
+ name,
37
+ }) => {
38
+ const containerClasses = [
39
+ 'segmented-button',
40
+ `segmented-button--${orientation}`,
41
+ disabled && 'segmented-button--disabled',
42
+ className,
43
+ ]
44
+ .filter(Boolean)
45
+ .join(' ');
46
+
47
+ const handleClick = (optionValue: string, optionDisabled?: boolean) => {
48
+ if (!disabled && !optionDisabled && optionValue !== value) {
49
+ onChange(optionValue);
50
+ }
51
+ };
52
+
53
+ const getButtonClasses = (option: SegmentedButtonOption, index: number) => {
54
+ const isSelected = option.value === value;
55
+ const isFirst = index === 0;
56
+ const isLast = index === options.length - 1;
57
+ const isDisabled = disabled || option.disabled;
58
+
59
+ return [
60
+ 'segmented-button__item',
61
+ isSelected && 'segmented-button__item--selected',
62
+ isFirst && 'segmented-button__item--first',
63
+ isLast && 'segmented-button__item--last',
64
+ isDisabled && 'segmented-button__item--disabled',
65
+ ]
66
+ .filter(Boolean)
67
+ .join(' ');
68
+ };
69
+
70
+ return (
71
+ <div className={containerClasses} role="group" aria-label={name}>
72
+ {options.map((option, index) => {
73
+ const isSelected = option.value === value;
74
+ const isDisabled = disabled || option.disabled;
75
+
76
+ return (
77
+ <button
78
+ key={option.value}
79
+ type="button"
80
+ className={getButtonClasses(option, index)}
81
+ onClick={() => handleClick(option.value, option.disabled)}
82
+ disabled={isDisabled}
83
+ aria-pressed={isSelected}
84
+ aria-label={option.label}
85
+ >
86
+ <span className="segmented-button__label">{option.label}</span>
87
+ </button>
88
+ );
89
+ })}
90
+ </div>
91
+ );
92
+ };
93
+
94
+ export default SegmentedButton;
@@ -1,59 +1,59 @@
1
- import React from 'react';
2
- import Icon from '../Icon/Icon';
3
- import { Text } from '../Typography/Typography';
4
-
5
- interface SelectedValueProps {
6
- value: string;
7
- onRemove?: () => void;
8
- className?: string;
9
- iconSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
10
- size?: 'xs' | 'sm' | 'md' | 'lg';
11
- variant?: 'filled' | 'text';
12
- }
13
-
14
- const SelectedValue: React.FC<SelectedValueProps> = ({
15
- value,
16
- onRemove,
17
- className = '',
18
- iconSize = 'xs',
19
- size = 'md',
20
- variant = 'filled',
21
- }) => {
22
- const handleRemove = (event: React.MouseEvent) => {
23
- event.stopPropagation();
24
- if (onRemove) {
25
- onRemove();
26
- }
27
- };
28
-
29
- const classes = `selected-value selected-value--${size} selected-value--${variant} ${className}`.trim();
30
-
31
- const getTextSize = () => {
32
- return size; // Utilise directement la taille passée en prop
33
- };
34
-
35
- return (
36
- <div className={classes}>
37
- <Text
38
- size={getTextSize() as any}
39
- variant="medium"
40
- leading="4"
41
- className="selected-value__text"
42
- >
43
- {value}
44
- </Text>
45
- {variant !== 'text' && onRemove && (
46
- <button
47
- type="button"
48
- className="selected-value__remove"
49
- onClick={handleRemove}
50
- aria-label={`Remove ${value}`}
51
- >
52
- <Icon name="close" size={iconSize} className="selected-value__remove-icon" />
53
- </button>
54
- )}
55
- </div>
56
- );
57
- };
58
-
59
- export default SelectedValue;
1
+ import React from 'react';
2
+ import Icon from '../Icon/Icon';
3
+ import { Text } from '../Typography/Typography';
4
+
5
+ interface SelectedValueProps {
6
+ value: string;
7
+ onRemove?: () => void;
8
+ className?: string;
9
+ iconSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
10
+ size?: 'xs' | 'sm' | 'md' | 'lg';
11
+ variant?: 'filled' | 'text';
12
+ }
13
+
14
+ const SelectedValue: React.FC<SelectedValueProps> = ({
15
+ value,
16
+ onRemove,
17
+ className = '',
18
+ iconSize = 'xs',
19
+ size = 'md',
20
+ variant = 'filled',
21
+ }) => {
22
+ const handleRemove = (event: React.MouseEvent) => {
23
+ event.stopPropagation();
24
+ if (onRemove) {
25
+ onRemove();
26
+ }
27
+ };
28
+
29
+ const classes = `selected-value selected-value--${size} selected-value--${variant} ${className}`.trim();
30
+
31
+ const getTextSize = () => {
32
+ return size; // Utilise directement la taille passée en prop
33
+ };
34
+
35
+ return (
36
+ <div className={classes}>
37
+ <Text
38
+ size={getTextSize() as any}
39
+ variant="medium"
40
+ leading="4"
41
+ className="selected-value__text"
42
+ >
43
+ {value}
44
+ </Text>
45
+ {variant !== 'text' && onRemove && (
46
+ <button
47
+ type="button"
48
+ className="selected-value__remove"
49
+ onClick={handleRemove}
50
+ aria-label={`Remove ${value}`}
51
+ >
52
+ <Icon name="close" size={iconSize} className="selected-value__remove-icon" />
53
+ </button>
54
+ )}
55
+ </div>
56
+ );
57
+ };
58
+
59
+ export default SelectedValue;
@@ -1,95 +1,95 @@
1
- import React from 'react';
2
-
3
- export type SliderVariant = 'full' | 'half';
4
-
5
- export interface SliderProps {
6
- /**
7
- * Current value of the slider (controlled mode).
8
- */
9
- value: number;
10
- /**
11
- * Minimum value.
12
- */
13
- min?: number;
14
- /**
15
- * Maximum value.
16
- */
17
- max?: number;
18
- /**
19
- * Step between values.
20
- */
21
- step?: number;
22
- /**
23
- * Called when the value changes.
24
- */
25
- onChange: (value: number) => void;
26
- /**
27
- * Visual variant (from Figma: Type=Full | Type=Half).
28
- */
29
- variant?: SliderVariant;
30
- /**
31
- * Whether the slider is disabled.
32
- */
33
- disabled?: boolean;
34
- /**
35
- * Accessible label (aria-label) if no visible label is provided.
36
- */
37
- 'aria-label'?: string;
38
- /**
39
- * Optional id to link with an external label.
40
- */
41
- id?: string;
42
- /**
43
- * Additional CSS classes.
44
- */
45
- className?: string;
46
- }
47
-
48
- /**
49
- * Slider atom.
50
- *
51
- * Represents a single horizontal slider control (rail + thumb),
52
- * matching the Figma Slider component (Full / Half variants).
53
- */
54
- export const Slider: React.FC<SliderProps> = ({
55
- value,
56
- min = 0,
57
- max = 100,
58
- step = 1,
59
- onChange,
60
- variant = 'full',
61
- disabled = false,
62
- id,
63
- className = '',
64
- 'aria-label': ariaLabel,
65
- }) => {
66
- const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
67
- const next = Number(event.target.value);
68
- onChange(next);
69
- };
70
-
71
- const classes = ['slider', `slider--${variant}`, disabled ? 'slider--disabled' : '', className]
72
- .filter(Boolean)
73
- .join(' ');
74
-
75
- return (
76
- <div className="slider-container">
77
- <input
78
- id={id}
79
- type="range"
80
- className={classes}
81
- min={min}
82
- max={max}
83
- step={step}
84
- value={value}
85
- onChange={handleChange}
86
- disabled={disabled}
87
- aria-label={ariaLabel}
88
- />
89
- </div>
90
- );
91
- };
92
-
93
- export default Slider;
94
-
95
-
1
+ import React from 'react';
2
+
3
+ export type SliderVariant = 'full' | 'half';
4
+
5
+ export interface SliderProps {
6
+ /**
7
+ * Current value of the slider (controlled mode).
8
+ */
9
+ value: number;
10
+ /**
11
+ * Minimum value.
12
+ */
13
+ min?: number;
14
+ /**
15
+ * Maximum value.
16
+ */
17
+ max?: number;
18
+ /**
19
+ * Step between values.
20
+ */
21
+ step?: number;
22
+ /**
23
+ * Called when the value changes.
24
+ */
25
+ onChange: (value: number) => void;
26
+ /**
27
+ * Visual variant (from Figma: Type=Full | Type=Half).
28
+ */
29
+ variant?: SliderVariant;
30
+ /**
31
+ * Whether the slider is disabled.
32
+ */
33
+ disabled?: boolean;
34
+ /**
35
+ * Accessible label (aria-label) if no visible label is provided.
36
+ */
37
+ 'aria-label'?: string;
38
+ /**
39
+ * Optional id to link with an external label.
40
+ */
41
+ id?: string;
42
+ /**
43
+ * Additional CSS classes.
44
+ */
45
+ className?: string;
46
+ }
47
+
48
+ /**
49
+ * Slider atom.
50
+ *
51
+ * Represents a single horizontal slider control (rail + thumb),
52
+ * matching the Figma Slider component (Full / Half variants).
53
+ */
54
+ export const Slider: React.FC<SliderProps> = ({
55
+ value,
56
+ min = 0,
57
+ max = 100,
58
+ step = 1,
59
+ onChange,
60
+ variant = 'full',
61
+ disabled = false,
62
+ id,
63
+ className = '',
64
+ 'aria-label': ariaLabel,
65
+ }) => {
66
+ const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
67
+ const next = Number(event.target.value);
68
+ onChange(next);
69
+ };
70
+
71
+ const classes = ['slider', `slider--${variant}`, disabled ? 'slider--disabled' : '', className]
72
+ .filter(Boolean)
73
+ .join(' ');
74
+
75
+ return (
76
+ <div className="slider-container">
77
+ <input
78
+ id={id}
79
+ type="range"
80
+ className={classes}
81
+ min={min}
82
+ max={max}
83
+ step={step}
84
+ value={value}
85
+ onChange={handleChange}
86
+ disabled={disabled}
87
+ aria-label={ariaLabel}
88
+ />
89
+ </div>
90
+ );
91
+ };
92
+
93
+ export default Slider;
94
+
95
+
@@ -1,56 +1,56 @@
1
- import React from 'react';
2
-
3
- interface SpinnerProps {
4
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5
- className?: string;
6
- color?: string;
7
- speed?: 'slow' | 'normal' | 'fast';
8
- }
9
-
10
- const Spinner: React.FC<SpinnerProps> = ({
11
- size = 'md',
12
- className = '',
13
- color,
14
- speed = 'normal'
15
- }) => {
16
- const getSizeClasses = () => {
17
- switch (size) {
18
- case 'xs': return 'w-3 h-3';
19
- case 'sm': return 'w-4 h-4';
20
- case 'md': return 'w-5 h-5';
21
- case 'lg': return 'w-6 h-6';
22
- case 'xl': return 'w-8 h-8';
23
- default: return 'w-5 h-5';
24
- }
25
- };
26
-
27
- const getSpeedClasses = () => {
28
- switch (speed) {
29
- case 'slow': return 'animate-spin-slow';
30
- case 'fast': return 'animate-spin-fast';
31
- default: return 'animate-spin';
32
- }
33
- };
34
-
35
- const sizeClasses = getSizeClasses();
36
- const speedClasses = getSpeedClasses();
37
- const colorClass = color ? `text-${color}` : 'text-current';
38
- const classes = `${sizeClasses} ${speedClasses} ${colorClass} ${className}`;
39
-
40
- return (
41
- <svg
42
- className={classes}
43
- viewBox="0 0 24 24"
44
- fill="none"
45
- stroke="currentColor"
46
- strokeWidth="2"
47
- strokeLinecap="round"
48
- strokeLinejoin="round"
49
- >
50
- <path d="M21 12A9 9 0 1 1 3 12A9 9 0 0 1 21 12Z" strokeOpacity="0.25" />
51
- <path d="M21 12A9 9 0 0 0 3 12" />
52
- </svg>
53
- );
54
- };
55
-
56
- export default Spinner;
1
+ import React from 'react';
2
+
3
+ interface SpinnerProps {
4
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5
+ className?: string;
6
+ color?: string;
7
+ speed?: 'slow' | 'normal' | 'fast';
8
+ }
9
+
10
+ const Spinner: React.FC<SpinnerProps> = ({
11
+ size = 'md',
12
+ className = '',
13
+ color,
14
+ speed = 'normal'
15
+ }) => {
16
+ const getSizeClasses = () => {
17
+ switch (size) {
18
+ case 'xs': return 'w-3 h-3';
19
+ case 'sm': return 'w-4 h-4';
20
+ case 'md': return 'w-5 h-5';
21
+ case 'lg': return 'w-6 h-6';
22
+ case 'xl': return 'w-8 h-8';
23
+ default: return 'w-5 h-5';
24
+ }
25
+ };
26
+
27
+ const getSpeedClasses = () => {
28
+ switch (speed) {
29
+ case 'slow': return 'animate-spin-slow';
30
+ case 'fast': return 'animate-spin-fast';
31
+ default: return 'animate-spin';
32
+ }
33
+ };
34
+
35
+ const sizeClasses = getSizeClasses();
36
+ const speedClasses = getSpeedClasses();
37
+ const colorClass = color ? `text-${color}` : 'text-current';
38
+ const classes = `${sizeClasses} ${speedClasses} ${colorClass} ${className}`;
39
+
40
+ return (
41
+ <svg
42
+ className={classes}
43
+ viewBox="0 0 24 24"
44
+ fill="none"
45
+ stroke="currentColor"
46
+ strokeWidth="2"
47
+ strokeLinecap="round"
48
+ strokeLinejoin="round"
49
+ >
50
+ <path d="M21 12A9 9 0 1 1 3 12A9 9 0 0 1 21 12Z" strokeOpacity="0.25" />
51
+ <path d="M21 12A9 9 0 0 0 3 12" />
52
+ </svg>
53
+ );
54
+ };
55
+
56
+ export default Spinner;