pentatrion-design 0.0.1

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 (208) hide show
  1. package/.storybook/main.ts +33 -0
  2. package/.storybook/manager.ts +8 -0
  3. package/.storybook/preview-head.html +2 -0
  4. package/.storybook/preview.ts +26 -0
  5. package/.storybook/public/bg-map.jpg +0 -0
  6. package/.storybook/public/favicon-32x32.png +0 -0
  7. package/.storybook/public/favicon.svg +28 -0
  8. package/.storybook/public/movies.json +2153 -0
  9. package/.storybook/public/population.json +1178 -0
  10. package/.storybook/public/town-74.geojson +8995 -0
  11. package/.storybook/public/town-74.json +4062 -0
  12. package/.storybook/theme.ts +14 -0
  13. package/Makefile +14 -0
  14. package/README.md +40 -0
  15. package/TODO.md +5 -0
  16. package/dist/index.d.ts +1110 -0
  17. package/dist/index.js +3707 -0
  18. package/dist/redux/index.d.ts +43 -0
  19. package/dist/redux/index.js +583 -0
  20. package/dist/types.d-DlHa_IaW.d.ts +14 -0
  21. package/images/logo-shadow.svg +173 -0
  22. package/images/logo.svg +76 -0
  23. package/package.json +85 -0
  24. package/postcss.config.js +7 -0
  25. package/src/components/autocomplete/Autocomplete.stories.tsx +89 -0
  26. package/src/components/autocomplete/Autocomplete.tsx +316 -0
  27. package/src/components/autocomplete/AutocompleteOption.tsx +35 -0
  28. package/src/components/autocomplete/LazyAutocomplete.tsx +130 -0
  29. package/src/components/autocomplete/SimpleAutocomplete.tsx +74 -0
  30. package/src/components/autocomplete/index.ts +6 -0
  31. package/src/components/autocomplete/useAutocompleteContext.ts +20 -0
  32. package/src/components/autocomplete/util.ts +19 -0
  33. package/src/components/badge/Badge.stories.tsx +72 -0
  34. package/src/components/badge/Badge.tsx +70 -0
  35. package/src/components/button/Button.stories.tsx +189 -0
  36. package/src/components/button/Button.test.tsx +20 -0
  37. package/src/components/button/Button.tsx +200 -0
  38. package/src/components/button/ButtonGroup.stories.tsx +46 -0
  39. package/src/components/button/ButtonGroup.tsx +29 -0
  40. package/src/components/button/index.ts +2 -0
  41. package/src/components/card/Card.stories.tsx +21 -0
  42. package/src/components/card/config.ts +4 -0
  43. package/src/components/card/index.ts +1 -0
  44. package/src/components/code/Code.tsx +15 -0
  45. package/src/components/context-menu/ContextMenu.stories.tsx +22 -0
  46. package/src/components/context-menu/ContextMenu.tsx +175 -0
  47. package/src/components/context-menu/ContextMenuItem.tsx +34 -0
  48. package/src/components/context-menu/index.ts +2 -0
  49. package/src/components/dialog/Dialog.stories.tsx +270 -0
  50. package/src/components/dialog/Dialog.tsx +46 -0
  51. package/src/components/dialog/index.ts +1 -0
  52. package/src/components/dialog/util.ts +29 -0
  53. package/src/components/dropdown-menu/DropdownMenu.stories.tsx +19 -0
  54. package/src/components/dropdown-menu/DropdownMenu.tsx +12 -0
  55. package/src/components/dropdown-menu/DropdownMenuContent.tsx +46 -0
  56. package/src/components/dropdown-menu/DropdownMenuItem.tsx +33 -0
  57. package/src/components/dropdown-menu/DropdownMenuTrigger.tsx +42 -0
  58. package/src/components/dropdown-menu/index.ts +7 -0
  59. package/src/components/dropdown-menu/interface.d.ts +13 -0
  60. package/src/components/dropdown-menu/useDropdownMenu.tsx +115 -0
  61. package/src/components/dropdown-menu/useDropdownMenuContext.ts +16 -0
  62. package/src/components/dropdown-menu-nested/DropdownMenuNested.stories.tsx +33 -0
  63. package/src/components/dropdown-menu-nested/DropdownMenuNested.tsx +19 -0
  64. package/src/components/dropdown-menu-nested/MenuContext.ts +15 -0
  65. package/src/components/dropdown-menu-nested/MenuItem.tsx +43 -0
  66. package/src/components/dropdown-menu-nested/MenuItemWithChildren.tsx +204 -0
  67. package/src/components/dropdown-menu-nested/index.ts +3 -0
  68. package/src/components/flash/Flash.stories.tsx +34 -0
  69. package/src/components/flash/Flash.tsx +24 -0
  70. package/src/components/highlight/Highlight.stories.tsx +128 -0
  71. package/src/components/highlight/Highlight.tsx +29 -0
  72. package/src/components/href/Href.stories.tsx +55 -0
  73. package/src/components/href/Href.tsx +18 -0
  74. package/src/components/input/Checkbox.stories.tsx +52 -0
  75. package/src/components/input/Checkbox.tsx +41 -0
  76. package/src/components/input/Input.stories.tsx +103 -0
  77. package/src/components/input/Input.test.tsx +10 -0
  78. package/src/components/input/Input.tsx +60 -0
  79. package/src/components/input/RadioGroup.stories.tsx +76 -0
  80. package/src/components/input/RadioGroup.tsx +84 -0
  81. package/src/components/input/Toggle.stories.tsx +29 -0
  82. package/src/components/input/Toggle.tsx +35 -0
  83. package/src/components/input/index.ts +4 -0
  84. package/src/components/input-field/InputField.stories.tsx +227 -0
  85. package/src/components/input-field/InputField.tsx +62 -0
  86. package/src/components/loader/Loader.stories.tsx +37 -0
  87. package/src/components/loader/Loader.tsx +54 -0
  88. package/src/components/modal/Components.tsx +58 -0
  89. package/src/components/modal/Modal.stories.tsx +113 -0
  90. package/src/components/modal/Modal.tsx +13 -0
  91. package/src/components/modal/ModalContent.tsx +46 -0
  92. package/src/components/modal/ModalTrigger.tsx +41 -0
  93. package/src/components/modal/index.ts +7 -0
  94. package/src/components/modal/interface.d.ts +10 -0
  95. package/src/components/modal/useModal.ts +48 -0
  96. package/src/components/modal/useModalContext.ts +16 -0
  97. package/src/components/notification/Notification.stories.tsx +51 -0
  98. package/src/components/notification/NotificationsContext.ts +79 -0
  99. package/src/components/notification/NotificationsProvider.tsx +58 -0
  100. package/src/components/notification/index.ts +2 -0
  101. package/src/components/popover/Components.tsx +45 -0
  102. package/src/components/popover/Popover.stories.tsx +46 -0
  103. package/src/components/popover/Popover.test.tsx +21 -0
  104. package/src/components/popover/Popover.tsx +12 -0
  105. package/src/components/popover/PopoverContent.tsx +46 -0
  106. package/src/components/popover/PopoverTrigger.tsx +42 -0
  107. package/src/components/popover/index.ts +7 -0
  108. package/src/components/popover/interface.d.ts +13 -0
  109. package/src/components/popover/usePopover.tsx +80 -0
  110. package/src/components/popover/usePopoverContext.ts +16 -0
  111. package/src/components/portal/Portal.tsx +12 -0
  112. package/src/components/quick-settings/QuickSettings.stories.tsx +182 -0
  113. package/src/components/resize-area/ResizeArea.stories.css +40 -0
  114. package/src/components/resize-area/ResizeArea.stories.tsx +30 -0
  115. package/src/components/resize-area/ResizeArea.tsx +79 -0
  116. package/src/components/scroll/Scroll.stories.tsx +81 -0
  117. package/src/components/scroll/Scroll.tsx +111 -0
  118. package/src/components/select/Select.stories.tsx +248 -0
  119. package/src/components/select/Select.tsx +362 -0
  120. package/src/components/select/SelectOption.tsx +29 -0
  121. package/src/components/select/SelectSelection.tsx +13 -0
  122. package/src/components/select/index.ts +5 -0
  123. package/src/components/select/interface.d.ts +36 -0
  124. package/src/components/select/useSelectContext.ts +19 -0
  125. package/src/components/select/util.ts +12 -0
  126. package/src/components/snack/Snack.stories.tsx +33 -0
  127. package/src/components/snack/Snack.tsx +47 -0
  128. package/src/components/sortable/Sortable.stories.tsx +98 -0
  129. package/src/components/sortable/Sortable.tsx +37 -0
  130. package/src/components/sortable/index.ts +2 -0
  131. package/src/components/sortable/types.d.ts +12 -0
  132. package/src/components/steps/Step.tsx +41 -0
  133. package/src/components/steps/Steps.stories.tsx +141 -0
  134. package/src/components/steps/Steps.tsx +49 -0
  135. package/src/components/steps/index.ts +3 -0
  136. package/src/components/steps/util.ts +3 -0
  137. package/src/components/table/Table.stories.tsx +36 -0
  138. package/src/components/table/Table.tsx +13 -0
  139. package/src/components/table/TableBody.tsx +9 -0
  140. package/src/components/table/TableCell.tsx +16 -0
  141. package/src/components/table/TableFooter.tsx +9 -0
  142. package/src/components/table/TableHeader.tsx +14 -0
  143. package/src/components/table/TableHeaderCell.tsx +14 -0
  144. package/src/components/table/TableRow.tsx +14 -0
  145. package/src/components/table/index.ts +7 -0
  146. package/src/components/tabs/Tabs.stories.tsx +66 -0
  147. package/src/components/tabs/Tabs.tsx +80 -0
  148. package/src/components/tooltip/SimpleTooltip.tsx +17 -0
  149. package/src/components/tooltip/Tooltip.stories.tsx +129 -0
  150. package/src/components/tooltip/Tooltip.test.tsx +18 -0
  151. package/src/components/tooltip/Tooltip.tsx +13 -0
  152. package/src/components/tooltip/TooltipContent.tsx +41 -0
  153. package/src/components/tooltip/TooltipTrigger.tsx +36 -0
  154. package/src/components/tooltip/index.ts +6 -0
  155. package/src/components/tooltip/interface.d.ts +15 -0
  156. package/src/components/tooltip/useTooltip.ts +87 -0
  157. package/src/components/tooltip/useTooltipContext.ts +16 -0
  158. package/src/env.d.ts +27 -0
  159. package/src/hooks/index.ts +13 -0
  160. package/src/hooks/useCombinedRefs.test.tsx +42 -0
  161. package/src/hooks/useCombinedRefs.ts +21 -0
  162. package/src/hooks/useCopyToClipboard.ts +28 -0
  163. package/src/hooks/useDebounce.ts +59 -0
  164. package/src/hooks/useEventCallback.ts +13 -0
  165. package/src/hooks/useEventListener.ts +86 -0
  166. package/src/hooks/useFetch.tsx +21 -0
  167. package/src/hooks/useIsClosing.ts +25 -0
  168. package/src/hooks/useIsMounted.tsx +16 -0
  169. package/src/hooks/useIsomorphicLayoutEffect.ts +4 -0
  170. package/src/hooks/useNotifications.tsx +13 -0
  171. package/src/hooks/useOnClickOutside.ts +35 -0
  172. package/src/hooks/usePrevious.ts +9 -0
  173. package/src/hooks/useRipple.test.tsx +52 -0
  174. package/src/hooks/useRipple.tsx +79 -0
  175. package/src/index.css +14 -0
  176. package/src/index.ts +39 -0
  177. package/src/lib/arrUtil.ts +8 -0
  178. package/src/lib/error.ts +18 -0
  179. package/src/lib/fetch.test.ts +107 -0
  180. package/src/lib/fetch.ts +115 -0
  181. package/src/lib/index.ts +3 -0
  182. package/src/lib/tailwindVariants.ts +35 -0
  183. package/src/redux/index.ts +1 -0
  184. package/src/redux/notification/components/NotificationConsumer.tsx +52 -0
  185. package/src/redux/notification/errorCatcherMiddleware.ts +17 -0
  186. package/src/redux/notification/hooks/useNotification.ts +26 -0
  187. package/src/redux/notification/index.ts +5 -0
  188. package/src/redux/notification/notificationSlice.ts +68 -0
  189. package/src/styles/Animation.stories.tsx +43 -0
  190. package/src/styles/Shadow.stories.tsx +43 -0
  191. package/src/styles/Themes.stories.tsx +31 -0
  192. package/src/styles/Typography.stories.tsx +101 -0
  193. package/src/tailwind/base.css +188 -0
  194. package/src/tailwind/components-input-outline.css +62 -0
  195. package/src/tailwind/components-resize-area.css +112 -0
  196. package/src/tailwind/components-step.css +161 -0
  197. package/src/tailwind/components.css +51 -0
  198. package/src/tailwind/keyframes.ts +69 -0
  199. package/src/tailwind/pentatrionTw.ts +147 -0
  200. package/src/tailwind/utilities-dialog.css +103 -0
  201. package/src/tailwind/utilities.css +3 -0
  202. package/src/types.d.ts +12 -0
  203. package/tailwind.config.js +18 -0
  204. package/tests/README.md +32 -0
  205. package/tests/setup.ts +1 -0
  206. package/tsconfig.json +14 -0
  207. package/tsup.config.ts +23 -0
  208. package/vite.config.ts +24 -0
@@ -0,0 +1,173 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+ <svg
5
+ width="512"
6
+ height="512"
7
+ viewBox="0 0 512 512"
8
+ version="1.1"
9
+ id="svg5"
10
+ sodipodi:docname="logo-shadow.svg"
11
+ inkscape:export-filename="/home/lhapaipai/projets/lonlat/apps/front/public/favicon-64x64.png"
12
+ inkscape:export-xdpi="12"
13
+ inkscape:export-ydpi="12"
14
+ inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
15
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
16
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
17
+ xmlns:xlink="http://www.w3.org/1999/xlink"
18
+ xmlns="http://www.w3.org/2000/svg"
19
+ xmlns:svg="http://www.w3.org/2000/svg">
20
+ <sodipodi:namedview
21
+ id="namedview17"
22
+ pagecolor="#ffffff"
23
+ bordercolor="#666666"
24
+ borderopacity="1.0"
25
+ inkscape:pageshadow="2"
26
+ inkscape:pageopacity="0.0"
27
+ inkscape:pagecheckerboard="0"
28
+ showgrid="false"
29
+ inkscape:zoom="0.74316406"
30
+ inkscape:cx="112.35742"
31
+ inkscape:cy="308.81472"
32
+ inkscape:window-width="1920"
33
+ inkscape:window-height="1048"
34
+ inkscape:window-x="0"
35
+ inkscape:window-y="0"
36
+ inkscape:window-maximized="1"
37
+ inkscape:current-layer="g4909" />
38
+ <defs
39
+ id="defs2">
40
+ <linearGradient
41
+ id="linearGradient3450">
42
+ <stop
43
+ style="stop-color:#c3830e;stop-opacity:1;"
44
+ offset="0"
45
+ id="stop3446" />
46
+ <stop
47
+ style="stop-color:#ffe218;stop-opacity:1;"
48
+ offset="1"
49
+ id="stop3448" />
50
+ </linearGradient>
51
+ <linearGradient
52
+ id="linearGradient1196">
53
+ <stop
54
+ style="stop-color:#e6c932;stop-opacity:1;"
55
+ offset="0.51667702"
56
+ id="stop1192" />
57
+ <stop
58
+ style="stop-color:#c3830e;stop-opacity:1;"
59
+ offset="1"
60
+ id="stop1194" />
61
+ </linearGradient>
62
+ <radialGradient
63
+ xlink:href="#linearGradient1196"
64
+ id="radialGradient1264"
65
+ cx="42.980968"
66
+ cy="87.500946"
67
+ fx="42.980968"
68
+ fy="87.500946"
69
+ r="8.343936"
70
+ gradientTransform="matrix(25.100951,0,0,27.159761,-840.11601,-2144.2749)"
71
+ gradientUnits="userSpaceOnUse" />
72
+ <linearGradient
73
+ xlink:href="#linearGradient3450"
74
+ id="linearGradient3452"
75
+ x1="45.214294"
76
+ y1="88.793221"
77
+ x2="51.894505"
78
+ y2="88.793221"
79
+ gradientUnits="userSpaceOnUse"
80
+ gradientTransform="matrix(25.100951,0,0,25.100951,-840.11601,-1956.0803)" />
81
+ <filter
82
+ style="color-interpolation-filters:sRGB;"
83
+ inkscape:label="Drop Shadow"
84
+ id="filter2008"
85
+ x="-0.29554829"
86
+ y="-0.21686776"
87
+ width="1.7872743"
88
+ height="1.4200445">
89
+ <feFlood
90
+ flood-opacity="0.498039"
91
+ flood-color="rgb(0,0,0)"
92
+ result="flood"
93
+ id="feFlood1998" />
94
+ <feComposite
95
+ in="flood"
96
+ in2="SourceGraphic"
97
+ operator="in"
98
+ result="composite1"
99
+ id="feComposite2000" />
100
+ <feGaussianBlur
101
+ in="composite1"
102
+ stdDeviation="3"
103
+ result="blur"
104
+ id="feGaussianBlur2002" />
105
+ <feOffset
106
+ dx="6"
107
+ dy="6"
108
+ result="offset"
109
+ id="feOffset2004" />
110
+ <feComposite
111
+ in="SourceGraphic"
112
+ in2="offset"
113
+ operator="over"
114
+ result="composite2"
115
+ id="feComposite2006" />
116
+ </filter>
117
+ <filter
118
+ style="color-interpolation-filters:sRGB;"
119
+ inkscape:label="Drop Shadow"
120
+ id="filter2020"
121
+ x="-0.11830901"
122
+ y="-0.10934075"
123
+ width="1.2688781"
124
+ height="1.2319196">
125
+ <feFlood
126
+ flood-opacity="0.498039"
127
+ flood-color="rgb(0,0,0)"
128
+ result="flood"
129
+ id="feFlood2010" />
130
+ <feComposite
131
+ in="flood"
132
+ in2="SourceGraphic"
133
+ operator="in"
134
+ result="composite1"
135
+ id="feComposite2012" />
136
+ <feGaussianBlur
137
+ in="composite1"
138
+ stdDeviation="3"
139
+ result="blur"
140
+ id="feGaussianBlur2014" />
141
+ <feOffset
142
+ dx="6"
143
+ dy="6"
144
+ result="offset"
145
+ id="feOffset2016" />
146
+ <feComposite
147
+ in="SourceGraphic"
148
+ in2="offset"
149
+ operator="over"
150
+ result="composite2"
151
+ id="feComposite2018" />
152
+ </filter>
153
+ </defs>
154
+ <g
155
+ id="layer1"
156
+ transform="translate(-35.994184,-82.381019)" />
157
+ <g
158
+ id="layer2"
159
+ transform="matrix(0.91335741,0,0,0.91335741,-10.695052,-53.062812)">
160
+ <g
161
+ id="g4909"
162
+ transform="translate(19.405757)">
163
+ <path
164
+ d="m 462.48547,135.99209 -94.35307,12.75075 -68.2289,141.47403 c -3.40036,17.00168 -5.09773,30.81717 -5.09773,41.44323 0,25.92758 6.15784,45.47974 18.48408,58.65598 12.75127,12.75128 29.32985,19.11989 49.73187,19.11989 18.27683,0 34.01319,-5.73681 47.18951,-17.21297 13.60136,-11.90137 21.246,-28.47977 22.94619,-49.73188 -5.95061,2.55025 -12.75306,3.82651 -20.40384,3.82651 -17.42673,0 -26.13712,-8.49984 -26.13712,-25.50152 0,-5.95061 0.8552,-12.10845 2.55536,-18.48409 z"
165
+ style="font-size:25.4px;line-height:1.25;font-family:Lobster;-inkscape-font-specification:Lobster;display:inline;fill:url(#linearGradient3452);fill-opacity:1;stroke:#ffffff;stroke-width:84.7149;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke markers fill;filter:url(#filter2008)"
166
+ id="path539" />
167
+ <path
168
+ id="path396"
169
+ style="font-size:25.4px;line-height:1.25;font-family:Lobster;-inkscape-font-specification:Lobster;display:inline;fill:url(#radialGradient1264);fill-opacity:1;stroke:#ffffff;stroke-width:84.7149;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke markers fill;filter:url(#filter2020)"
170
+ d="m 287.15272,111.76171 c -34.85341,0 -69.70801,8.07874 -104.56145,24.23035 -34.85343,15.72655 -63.53719,36.55507 -86.064418,62.48264 -22.102166,25.50252 -33.154592,51.84426 -33.154592,79.04697 0,22.10219 5.526226,38.04915 16.577297,47.82509 11.476155,9.35093 28.686393,14.02197 51.638653,14.02197 0,-0.85017 -1.48673,-4.24485 -4.46212,-10.19543 -2.97529,-6.37564 -4.46212,-17.42802 -4.46212,-33.15459 0,-34.00336 7.65768,-62.70009 22.95916,-86.07741 15.72655,-23.80234 37.8184,-41.43372 66.29618,-52.90982 l -94.98865,263.88389 c 3.40035,-0.42421 8.28191,-0.63556 14.65755,-0.63556 18.27681,0 36.1317,3.61831 53.5584,10.84412 17.85175,7.22556 34.21981,15.93609 49.09629,26.13712 15.30148,10.62598 33.57746,24.4413 54.82958,41.44317 28.47779,22.5271 51.8459,39.09273 70.12273,49.71896 18.70181,11.05067 37.62243,16.57715 56.74931,16.57715 17.42674,0 31.87386,-8.92088 43.35002,-26.77266 11.90116,-17.85179 19.55881,-42.28556 22.95916,-73.3136 -16.57667,6.80061 -34.43152,10.19526 -53.5584,10.19526 -21.2521,0 -41.65955,-4.03924 -61.21146,-12.11497 -19.55193,-7.65078 -43.13061,-18.91383 -70.7583,-33.7904 -17.85179,-9.77582 -33.15411,-17.64396 -45.90535,-23.59465 -12.32625,-5.52547 -24.44434,-9.77557 -36.34553,-12.75078 L 312.65425,113.0329 c -11.05106,-0.85017 -19.55093,-1.27111 -25.50153,-1.27111 z" />
171
+ </g>
172
+ </g>
173
+ </svg>
@@ -0,0 +1,76 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+ <svg
5
+ width="512"
6
+ height="512"
7
+ viewBox="0 0 512 512"
8
+ version="1.1"
9
+ id="svg5"
10
+ xmlns:xlink="http://www.w3.org/1999/xlink"
11
+ xmlns="http://www.w3.org/2000/svg"
12
+ xmlns:svg="http://www.w3.org/2000/svg">
13
+ <defs
14
+ id="defs2">
15
+ <linearGradient
16
+ id="linearGradient3450">
17
+ <stop
18
+ style="stop-color:#c3830e;stop-opacity:1;"
19
+ offset="0"
20
+ id="stop3446" />
21
+ <stop
22
+ style="stop-color:#ffe218;stop-opacity:1;"
23
+ offset="1"
24
+ id="stop3448" />
25
+ </linearGradient>
26
+ <linearGradient
27
+ id="linearGradient1196">
28
+ <stop
29
+ style="stop-color:#e6c932;stop-opacity:1;"
30
+ offset="0.51667702"
31
+ id="stop1192" />
32
+ <stop
33
+ style="stop-color:#c3830e;stop-opacity:1;"
34
+ offset="1"
35
+ id="stop1194" />
36
+ </linearGradient>
37
+ <radialGradient
38
+ xlink:href="#linearGradient1196"
39
+ id="radialGradient1264"
40
+ cx="42.980968"
41
+ cy="87.500946"
42
+ fx="42.980968"
43
+ fy="87.500946"
44
+ r="8.343936"
45
+ gradientTransform="matrix(28.355234,0,0,30.680964,-984.62933,-2466.1457)"
46
+ gradientUnits="userSpaceOnUse" />
47
+ <linearGradient
48
+ xlink:href="#linearGradient3450"
49
+ id="linearGradient3452"
50
+ x1="45.214294"
51
+ y1="88.793221"
52
+ x2="51.894505"
53
+ y2="88.793221"
54
+ gradientUnits="userSpaceOnUse"
55
+ gradientTransform="matrix(28.355234,0,0,28.355234,-984.62933,-2253.5521)" />
56
+ </defs>
57
+ <g
58
+ id="layer1"
59
+ transform="translate(-35.994184,-82.381019)" />
60
+ <g
61
+ id="layer2"
62
+ transform="translate(-35.994184,-82.381019)">
63
+ <g
64
+ id="g4909"
65
+ transform="translate(19.405757)">
66
+ <path
67
+ id="path396"
68
+ style="font-size:25.4px;line-height:1.25;font-family:Lobster;-inkscape-font-specification:Lobster;fill:url(#radialGradient1264);fill-opacity:1;stroke-width:7.50231"
69
+ d="m 288.78728,82.381019 c -39.37207,0 -78.74549,9.126132 -118.11761,27.371761 -39.3721,17.76546 -71.774645,41.29435 -97.222475,70.58338 -24.967663,28.80886 -37.453011,58.56575 -37.453011,89.29523 0,24.96769 6.242688,42.98214 18.726506,54.02551 12.964013,10.56326 32.405524,15.83988 58.33349,15.83988 0,-0.96039 -1.67948,-4.79518 -5.04062,-11.51724 -3.36103,-7.20223 -5.04063,-19.68752 -5.04063,-37.45301 0,-38.41182 8.65048,-70.82902 25.93577,-97.23716 17.76546,-26.88825 42.72147,-46.8055 74.89133,-59.76946 L 96.496314,431.61577 c 3.841196,-0.47921 9.355636,-0.71796 16.557866,-0.71796 20.64636,0 40.81609,4.08741 60.50213,12.25003 20.16619,8.16234 38.65633,18.00217 55.46151,29.52574 17.28529,12.00362 37.93071,27.61006 61.93812,46.81619 32.16987,25.44769 58.5676,44.16101 79.21398,56.16491 21.12646,12.48337 42.5001,18.72634 64.10673,18.72634 19.68608,0 36.00624,-10.07745 48.97026,-30.24367 13.44412,-20.16624 22.09457,-47.76779 25.93576,-82.81855 -18.72579,7.68229 -38.89549,11.51705 -60.50213,11.51705 -24.00738,0 -47.06061,-4.56292 -69.14738,-13.68565 -22.0868,-8.64268 -48.7224,-21.36596 -79.93196,-38.17125 C 279.43496,429.93572 262.14873,421.04749 247.74432,414.32531 233.82,408.08347 220.13083,403.28236 206.68668,399.92142 L 317.59503,83.817013 c -12.48381,-0.960392 -22.08566,-1.435909 -28.80775,-1.435909 z" />
70
+ <path
71
+ d="M 486.85154,109.75281 380.2658,124.15667 303.19117,283.9725 c -3.8412,19.20591 -5.75864,34.81254 -5.75864,46.81625 0,29.28903 6.95619,51.37608 20.88051,66.2606 14.40444,14.40445 33.13239,21.59874 56.17949,21.59874 20.64638,0 38.42293,-6.48058 53.30753,-19.4446 15.36474,-13.44435 24.00049,-32.1721 25.92111,-56.17951 -6.72209,2.88089 -14.40647,4.32261 -23.04915,4.32261 -19.68607,0 -29.52574,-9.60182 -29.52574,-28.80773 0,-6.72209 0.96607,-13.67828 2.88665,-20.88051 z"
72
+ style="font-size:25.4px;line-height:1.25;font-family:Lobster;-inkscape-font-specification:Lobster;fill:url(#linearGradient3452);fill-opacity:1;stroke-width:7.50231"
73
+ id="path539" />
74
+ </g>
75
+ </g>
76
+ </svg>
package/package.json ADDED
@@ -0,0 +1,85 @@
1
+ {
2
+ "name": "pentatrion-design",
3
+ "version": "0.0.1",
4
+ "description": "",
5
+ "keywords": [],
6
+ "author": "Hugues Tavernier",
7
+ "license": "ISC",
8
+ "main": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": "./dist/index.js",
12
+ "./redux": "./dist/redux/index.js",
13
+ "./src/*": "./src/*"
14
+ },
15
+ "type": "module",
16
+ "devDependencies": {
17
+ "@floating-ui/react-dom": "^2.0.9",
18
+ "@react-spring/web": "^9.7.3",
19
+ "@reduxjs/toolkit": "^2.2.4",
20
+ "@storybook/addon-actions": "^8.1.0",
21
+ "@storybook/addon-docs": "^8.1.0",
22
+ "@storybook/addon-essentials": "^8.1.0",
23
+ "@storybook/addon-interactions": "^8.1.0",
24
+ "@storybook/addon-links": "^8.1.0",
25
+ "@storybook/addon-themes": "^8.1.0",
26
+ "@storybook/blocks": "^8.1.0",
27
+ "@storybook/manager-api": "^8.1.0",
28
+ "@storybook/react": "^8.1.0",
29
+ "@storybook/react-vite": "^8.1.0",
30
+ "@storybook/test": "^8.1.0",
31
+ "@storybook/theming": "^8.1.0",
32
+ "@storybook/types": "^8.1.0",
33
+ "@testing-library/jest-dom": "^6.4.5",
34
+ "@testing-library/react": "^14.3.1",
35
+ "@types/geojson": "^7946.0.14",
36
+ "@types/react": "^18.3.2",
37
+ "@types/react-dom": "^18.3.0",
38
+ "@use-gesture/react": "^10.3.1",
39
+ "@vitejs/plugin-react-swc": "^3.6.0",
40
+ "@vitest/ui": "^1.6.0",
41
+ "fuse.js": "^7.0.0",
42
+ "jsdom": "^24.0.0",
43
+ "maplibre-gl": "^4.2.0",
44
+ "postcss": "^8.4.38",
45
+ "postcss-load-config": "^5.1.0",
46
+ "react-redux": "^9.1.2",
47
+ "storybook": "^8.1.0",
48
+ "tailwindcss": "^3.4.3",
49
+ "tsup": "^8.0.2",
50
+ "typescript": "^5.4.5",
51
+ "vite": "^5.2.11",
52
+ "vitest": "^1.6.0",
53
+ "pentatrion-fonts": "0.0.1"
54
+ },
55
+ "dependencies": {
56
+ "@floating-ui/react": "^0.26.14",
57
+ "clsx": "^2.1.0",
58
+ "react": "^18.0",
59
+ "react-dom": "^18.0",
60
+ "react-polymorphic-types": "^2.0.0",
61
+ "react-sortablejs": "^6.1.4"
62
+ },
63
+ "peerDependencies": {
64
+ "@reduxjs/toolkit": "*",
65
+ "react-redux": "*",
66
+ "tailwindcss": "*"
67
+ },
68
+ "peerDependenciesMeta": {
69
+ "@types/react": {
70
+ "optional": true
71
+ },
72
+ "@types/react-dom": {
73
+ "optional": true
74
+ }
75
+ },
76
+ "scripts": {
77
+ "dev": "tsup --watch",
78
+ "build": "tsup",
79
+ "tsc": "tsc",
80
+ "test": "vitest",
81
+ "test:ui": "vitest --ui",
82
+ "storybook": "storybook dev -p 6007",
83
+ "storybook-build": "storybook build"
84
+ }
85
+ }
@@ -0,0 +1,7 @@
1
+ /** @type {import("postcss-load-config").Config} */
2
+ export default {
3
+ plugins: {
4
+ "tailwindcss/nesting": {},
5
+ tailwindcss: {},
6
+ },
7
+ };
@@ -0,0 +1,89 @@
1
+ import { Meta, ReactRenderer } from "@storybook/react";
2
+
3
+ import { useState } from "react";
4
+ import Autocomplete from "./Autocomplete";
5
+ import { NotificationsProvider } from "../notification";
6
+ import { Button } from "../button";
7
+ import SimpleAutocomplete from "./SimpleAutocomplete";
8
+ import { Option } from "../select";
9
+ import { PartialStoryFn } from "@storybook/types";
10
+ const meta = {
11
+ title: "Components/Autocomplete",
12
+ component: Autocomplete,
13
+ decorators: [
14
+ (Story) => (
15
+ <NotificationsProvider>
16
+ <Story />
17
+ </NotificationsProvider>
18
+ ),
19
+ ] as ((story: PartialStoryFn<ReactRenderer, any>) => JSX.Element)[],
20
+ } satisfies Meta<typeof Autocomplete>;
21
+ export default meta;
22
+
23
+ const options: Option[] = [
24
+ { value: "abbeville", label: "Abbeville" },
25
+ { value: "agde", label: "Agde" },
26
+ { value: "agen", label: "Agen" },
27
+ { value: "aixenprovence", label: "Aix-en-Provence" },
28
+ { value: "ajaccio", label: "Ajaccio" },
29
+ { value: "albi", label: "Albi" },
30
+ { value: "alencon", label: "Alençon" },
31
+ { value: "amiens", label: "Amiens" },
32
+ { value: "angers", label: "Angers" },
33
+ { value: "angouleme", label: "Angoulême" },
34
+ { value: "annonay", label: "Annonay" },
35
+ { value: "antibes", label: "Antibes" },
36
+ { value: "arcachon", label: "Arcachon" },
37
+ { value: "arles", label: "Arles" },
38
+ { value: "arras", label: "Arras" },
39
+ { value: "asnieres-sur-seine", label: "Asnières-sur-Seine" },
40
+ { value: "aubagne", label: "Aubagne" },
41
+ { value: "aubervilliers", label: "Aubervilliers" },
42
+ { value: "aulnay-sous-bois", label: "Aulnay-sous-Bois" },
43
+ { value: "avignon", label: "Avignon" },
44
+ { value: "avranches", label: "Avranches" },
45
+ { value: "avoriaz", label: "Avoriaz" },
46
+ { value: "avray", label: "Avray" },
47
+ ];
48
+
49
+ export const Simple = () => {
50
+ const [selection, setSelection] = useState<Option | null>(null);
51
+
52
+ function handleClick(action: "random" | "unknown" | "unselect") {
53
+ switch (action) {
54
+ case "random":
55
+ setSelection(options[Math.floor(Math.random() * options.length)]);
56
+ break;
57
+ case "unknown":
58
+ setSelection({
59
+ value: "unknown",
60
+ label: "Unknown",
61
+ });
62
+
63
+ break;
64
+ case "unselect":
65
+ setSelection(null);
66
+ break;
67
+ }
68
+ }
69
+
70
+ return (
71
+ <>
72
+ <SimpleAutocomplete
73
+ options={options}
74
+ selection={selection}
75
+ onChangeSelection={setSelection}
76
+ />
77
+ <div>sélection : {selection && selection.label}</div>
78
+ <div>
79
+ <Button onClick={() => handleClick("random")} className="mr-2">
80
+ select random
81
+ </Button>
82
+ <Button onClick={() => handleClick("unknown")} className="mr-2">
83
+ select Unknown
84
+ </Button>
85
+ <Button onClick={() => handleClick("unselect")}>unselect</Button>
86
+ </div>
87
+ </>
88
+ );
89
+ };