pentatrion-design 0.0.1 → 0.0.3

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 (209) hide show
  1. package/README.md +146 -15
  2. package/dist/index.d.ts +353 -294
  3. package/dist/index.js +2962 -2210
  4. package/index.ts +38 -0
  5. package/package.json +40 -37
  6. package/.storybook/main.ts +0 -33
  7. package/.storybook/manager.ts +0 -8
  8. package/.storybook/preview-head.html +0 -2
  9. package/.storybook/preview.ts +0 -26
  10. package/.storybook/public/bg-map.jpg +0 -0
  11. package/.storybook/public/favicon-32x32.png +0 -0
  12. package/.storybook/public/favicon.svg +0 -28
  13. package/.storybook/public/movies.json +0 -2153
  14. package/.storybook/public/population.json +0 -1178
  15. package/.storybook/public/town-74.geojson +0 -8995
  16. package/.storybook/public/town-74.json +0 -4062
  17. package/.storybook/theme.ts +0 -14
  18. package/Makefile +0 -14
  19. package/TODO.md +0 -5
  20. package/dist/redux/index.d.ts +0 -43
  21. package/dist/redux/index.js +0 -583
  22. package/dist/types.d-DlHa_IaW.d.ts +0 -14
  23. package/images/logo-shadow.svg +0 -173
  24. package/images/logo.svg +0 -76
  25. package/postcss.config.js +0 -7
  26. package/src/components/autocomplete/Autocomplete.stories.tsx +0 -89
  27. package/src/components/autocomplete/Autocomplete.tsx +0 -316
  28. package/src/components/autocomplete/AutocompleteOption.tsx +0 -35
  29. package/src/components/autocomplete/LazyAutocomplete.tsx +0 -130
  30. package/src/components/autocomplete/SimpleAutocomplete.tsx +0 -74
  31. package/src/components/autocomplete/index.ts +0 -6
  32. package/src/components/autocomplete/useAutocompleteContext.ts +0 -20
  33. package/src/components/autocomplete/util.ts +0 -19
  34. package/src/components/badge/Badge.stories.tsx +0 -72
  35. package/src/components/badge/Badge.tsx +0 -70
  36. package/src/components/button/Button.stories.tsx +0 -189
  37. package/src/components/button/Button.test.tsx +0 -20
  38. package/src/components/button/Button.tsx +0 -200
  39. package/src/components/button/ButtonGroup.stories.tsx +0 -46
  40. package/src/components/button/ButtonGroup.tsx +0 -29
  41. package/src/components/button/index.ts +0 -2
  42. package/src/components/card/Card.stories.tsx +0 -21
  43. package/src/components/card/config.ts +0 -4
  44. package/src/components/card/index.ts +0 -1
  45. package/src/components/code/Code.tsx +0 -15
  46. package/src/components/context-menu/ContextMenu.stories.tsx +0 -22
  47. package/src/components/context-menu/ContextMenu.tsx +0 -175
  48. package/src/components/context-menu/ContextMenuItem.tsx +0 -34
  49. package/src/components/context-menu/index.ts +0 -2
  50. package/src/components/dialog/Dialog.stories.tsx +0 -270
  51. package/src/components/dialog/Dialog.tsx +0 -46
  52. package/src/components/dialog/index.ts +0 -1
  53. package/src/components/dialog/util.ts +0 -29
  54. package/src/components/dropdown-menu/DropdownMenu.stories.tsx +0 -19
  55. package/src/components/dropdown-menu/DropdownMenu.tsx +0 -12
  56. package/src/components/dropdown-menu/DropdownMenuContent.tsx +0 -46
  57. package/src/components/dropdown-menu/DropdownMenuItem.tsx +0 -33
  58. package/src/components/dropdown-menu/DropdownMenuTrigger.tsx +0 -42
  59. package/src/components/dropdown-menu/index.ts +0 -7
  60. package/src/components/dropdown-menu/interface.d.ts +0 -13
  61. package/src/components/dropdown-menu/useDropdownMenu.tsx +0 -115
  62. package/src/components/dropdown-menu/useDropdownMenuContext.ts +0 -16
  63. package/src/components/dropdown-menu-nested/DropdownMenuNested.stories.tsx +0 -33
  64. package/src/components/dropdown-menu-nested/DropdownMenuNested.tsx +0 -19
  65. package/src/components/dropdown-menu-nested/MenuContext.ts +0 -15
  66. package/src/components/dropdown-menu-nested/MenuItem.tsx +0 -43
  67. package/src/components/dropdown-menu-nested/MenuItemWithChildren.tsx +0 -204
  68. package/src/components/dropdown-menu-nested/index.ts +0 -3
  69. package/src/components/flash/Flash.stories.tsx +0 -34
  70. package/src/components/flash/Flash.tsx +0 -24
  71. package/src/components/highlight/Highlight.stories.tsx +0 -128
  72. package/src/components/highlight/Highlight.tsx +0 -29
  73. package/src/components/href/Href.stories.tsx +0 -55
  74. package/src/components/href/Href.tsx +0 -18
  75. package/src/components/input/Checkbox.stories.tsx +0 -52
  76. package/src/components/input/Checkbox.tsx +0 -41
  77. package/src/components/input/Input.stories.tsx +0 -103
  78. package/src/components/input/Input.test.tsx +0 -10
  79. package/src/components/input/Input.tsx +0 -60
  80. package/src/components/input/RadioGroup.stories.tsx +0 -76
  81. package/src/components/input/RadioGroup.tsx +0 -84
  82. package/src/components/input/Toggle.stories.tsx +0 -29
  83. package/src/components/input/Toggle.tsx +0 -35
  84. package/src/components/input/index.ts +0 -4
  85. package/src/components/input-field/InputField.stories.tsx +0 -227
  86. package/src/components/input-field/InputField.tsx +0 -62
  87. package/src/components/loader/Loader.stories.tsx +0 -37
  88. package/src/components/loader/Loader.tsx +0 -54
  89. package/src/components/modal/Components.tsx +0 -58
  90. package/src/components/modal/Modal.stories.tsx +0 -113
  91. package/src/components/modal/Modal.tsx +0 -13
  92. package/src/components/modal/ModalContent.tsx +0 -46
  93. package/src/components/modal/ModalTrigger.tsx +0 -41
  94. package/src/components/modal/index.ts +0 -7
  95. package/src/components/modal/interface.d.ts +0 -10
  96. package/src/components/modal/useModal.ts +0 -48
  97. package/src/components/modal/useModalContext.ts +0 -16
  98. package/src/components/notification/Notification.stories.tsx +0 -51
  99. package/src/components/notification/NotificationsContext.ts +0 -79
  100. package/src/components/notification/NotificationsProvider.tsx +0 -58
  101. package/src/components/notification/index.ts +0 -2
  102. package/src/components/popover/Components.tsx +0 -45
  103. package/src/components/popover/Popover.stories.tsx +0 -46
  104. package/src/components/popover/Popover.test.tsx +0 -21
  105. package/src/components/popover/Popover.tsx +0 -12
  106. package/src/components/popover/PopoverContent.tsx +0 -46
  107. package/src/components/popover/PopoverTrigger.tsx +0 -42
  108. package/src/components/popover/index.ts +0 -7
  109. package/src/components/popover/interface.d.ts +0 -13
  110. package/src/components/popover/usePopover.tsx +0 -80
  111. package/src/components/popover/usePopoverContext.ts +0 -16
  112. package/src/components/portal/Portal.tsx +0 -12
  113. package/src/components/quick-settings/QuickSettings.stories.tsx +0 -182
  114. package/src/components/resize-area/ResizeArea.stories.css +0 -40
  115. package/src/components/resize-area/ResizeArea.stories.tsx +0 -30
  116. package/src/components/resize-area/ResizeArea.tsx +0 -79
  117. package/src/components/scroll/Scroll.stories.tsx +0 -81
  118. package/src/components/scroll/Scroll.tsx +0 -111
  119. package/src/components/select/Select.stories.tsx +0 -248
  120. package/src/components/select/Select.tsx +0 -362
  121. package/src/components/select/SelectOption.tsx +0 -29
  122. package/src/components/select/SelectSelection.tsx +0 -13
  123. package/src/components/select/index.ts +0 -5
  124. package/src/components/select/interface.d.ts +0 -36
  125. package/src/components/select/useSelectContext.ts +0 -19
  126. package/src/components/select/util.ts +0 -12
  127. package/src/components/snack/Snack.stories.tsx +0 -33
  128. package/src/components/snack/Snack.tsx +0 -47
  129. package/src/components/sortable/Sortable.stories.tsx +0 -98
  130. package/src/components/sortable/Sortable.tsx +0 -37
  131. package/src/components/sortable/index.ts +0 -2
  132. package/src/components/sortable/types.d.ts +0 -12
  133. package/src/components/steps/Step.tsx +0 -41
  134. package/src/components/steps/Steps.stories.tsx +0 -141
  135. package/src/components/steps/Steps.tsx +0 -49
  136. package/src/components/steps/index.ts +0 -3
  137. package/src/components/steps/util.ts +0 -3
  138. package/src/components/table/Table.stories.tsx +0 -36
  139. package/src/components/table/Table.tsx +0 -13
  140. package/src/components/table/TableBody.tsx +0 -9
  141. package/src/components/table/TableCell.tsx +0 -16
  142. package/src/components/table/TableFooter.tsx +0 -9
  143. package/src/components/table/TableHeader.tsx +0 -14
  144. package/src/components/table/TableHeaderCell.tsx +0 -14
  145. package/src/components/table/TableRow.tsx +0 -14
  146. package/src/components/table/index.ts +0 -7
  147. package/src/components/tabs/Tabs.stories.tsx +0 -66
  148. package/src/components/tabs/Tabs.tsx +0 -80
  149. package/src/components/tooltip/SimpleTooltip.tsx +0 -17
  150. package/src/components/tooltip/Tooltip.stories.tsx +0 -129
  151. package/src/components/tooltip/Tooltip.test.tsx +0 -18
  152. package/src/components/tooltip/Tooltip.tsx +0 -13
  153. package/src/components/tooltip/TooltipContent.tsx +0 -41
  154. package/src/components/tooltip/TooltipTrigger.tsx +0 -36
  155. package/src/components/tooltip/index.ts +0 -6
  156. package/src/components/tooltip/interface.d.ts +0 -15
  157. package/src/components/tooltip/useTooltip.ts +0 -87
  158. package/src/components/tooltip/useTooltipContext.ts +0 -16
  159. package/src/env.d.ts +0 -27
  160. package/src/hooks/index.ts +0 -13
  161. package/src/hooks/useCombinedRefs.test.tsx +0 -42
  162. package/src/hooks/useCombinedRefs.ts +0 -21
  163. package/src/hooks/useCopyToClipboard.ts +0 -28
  164. package/src/hooks/useDebounce.ts +0 -59
  165. package/src/hooks/useEventCallback.ts +0 -13
  166. package/src/hooks/useEventListener.ts +0 -86
  167. package/src/hooks/useFetch.tsx +0 -21
  168. package/src/hooks/useIsClosing.ts +0 -25
  169. package/src/hooks/useIsMounted.tsx +0 -16
  170. package/src/hooks/useIsomorphicLayoutEffect.ts +0 -4
  171. package/src/hooks/useNotifications.tsx +0 -13
  172. package/src/hooks/useOnClickOutside.ts +0 -35
  173. package/src/hooks/usePrevious.ts +0 -9
  174. package/src/hooks/useRipple.test.tsx +0 -52
  175. package/src/hooks/useRipple.tsx +0 -79
  176. package/src/index.css +0 -14
  177. package/src/index.ts +0 -39
  178. package/src/lib/arrUtil.ts +0 -8
  179. package/src/lib/error.ts +0 -18
  180. package/src/lib/fetch.test.ts +0 -107
  181. package/src/lib/fetch.ts +0 -115
  182. package/src/lib/index.ts +0 -3
  183. package/src/lib/tailwindVariants.ts +0 -35
  184. package/src/redux/index.ts +0 -1
  185. package/src/redux/notification/components/NotificationConsumer.tsx +0 -52
  186. package/src/redux/notification/errorCatcherMiddleware.ts +0 -17
  187. package/src/redux/notification/hooks/useNotification.ts +0 -26
  188. package/src/redux/notification/index.ts +0 -5
  189. package/src/redux/notification/notificationSlice.ts +0 -68
  190. package/src/styles/Animation.stories.tsx +0 -43
  191. package/src/styles/Shadow.stories.tsx +0 -43
  192. package/src/styles/Themes.stories.tsx +0 -31
  193. package/src/styles/Typography.stories.tsx +0 -101
  194. package/src/tailwind/base.css +0 -188
  195. package/src/tailwind/components-input-outline.css +0 -62
  196. package/src/tailwind/components-resize-area.css +0 -112
  197. package/src/tailwind/components-step.css +0 -161
  198. package/src/tailwind/components.css +0 -51
  199. package/src/tailwind/keyframes.ts +0 -69
  200. package/src/tailwind/pentatrionTw.ts +0 -147
  201. package/src/tailwind/utilities-dialog.css +0 -103
  202. package/src/tailwind/utilities.css +0 -3
  203. package/src/types.d.ts +0 -12
  204. package/tailwind.config.js +0 -18
  205. package/tests/README.md +0 -32
  206. package/tests/setup.ts +0 -1
  207. package/tsconfig.json +0 -14
  208. package/tsup.config.ts +0 -23
  209. package/vite.config.ts +0 -24
package/README.md CHANGED
@@ -1,40 +1,171 @@
1
- # Pentatrion Design System
1
+ # [Pentatrion Design System](https://storybook.lonlat.pentatrion.com)
2
2
 
3
- ## Installation
3
+ <a href="https://storybook.lonlat.pentatrion.com">
4
+ <img src="https://raw.githubusercontent.com/lhapaipai/lonlat/main/extra/assets/public/graphics/screenshots/storybook.jpg" alt="Pentatrion design system" />
5
+ </a>
4
6
 
5
- La dépendance `pentatrion-fonts` est optionnelle.
7
+ ## Prérequis
8
+
9
+ Créez un nouveau projet Vite + React + TailwindCSS. [Official doc](https://tailwindcss.com/docs/guides/vite)
6
10
 
7
11
  ```bash
8
- pnpm add pentatrion-design pentatrion-fonts
12
+ pnpm create vite my-app
13
+
14
+ # 1. React
15
+ # 2. TypeScript + SWC
16
+
17
+ cd my-app
18
+
19
+ pnpm add -D tailwindcss postcss autoprefixer postcss-load-config prettier-plugin-tailwindcss
20
+
21
+ # si vous utilisez le composant <input type="range" />
22
+ pnpm add -D postcss-input-range
23
+ ```
24
+
25
+ Supprimer les fichiers inutiles
26
+
9
27
  ```
28
+ .
29
+ ├── src
30
+ │ ├── App.tsx
31
+ │ ├── index.css
32
+ │ ├── main.tsx
33
+ │ └── vite-env.d.ts
34
+ ├── tailwind.config.js
35
+ └── postcss.config.js
36
+ ```
37
+
38
+ Créer un fichier `tailwind.config.js` et `postcss.config.js`.
10
39
 
11
40
  ```js
12
41
  // tailwind.config.js
13
- import pentatrionTw from "pentatrion-design";
14
42
 
15
43
  /** @type {import('tailwindcss').Config} */
16
44
  export default {
17
45
  content: [
18
- "./node_modules/pentatrion-design/dist/*.js",
46
+ "./index.html",
47
+ "./src/**/*.{js,ts,jsx,tsx}",
19
48
  ],
20
49
  darkMode: ["class"],
21
- plugins: [pentatrionTw],
50
+ };
51
+
52
+
53
+ // postcss.config.js
54
+ /** @type {import("postcss-load-config").Config} */
55
+ export default {
56
+ plugins: {
57
+ "tailwindcss/nesting": {},
58
+ tailwindcss: {},
59
+
60
+ // si vous utilisez le composant <input type="range" />
61
+ // bien le mettre en dernier car tailwind génère du contenu à transformer
62
+ "postcss-input-range": {}
63
+ },
22
64
  };
23
65
  ```
66
+
67
+ Mettre à jour le fichier `src/index.css`
24
68
  ```css
69
+ /* on utilisera des imports pour faciliter l'intégration du design système */
70
+ @import "tailwindcss/base";
71
+ @import "tailwindcss/components";
72
+ @import "tailwindcss/utilities";
73
+ ```
74
+
75
+ ## Installation
76
+
77
+
78
+ ```bash
79
+ pnpm add pentatrion-design
80
+ ```
81
+
82
+ Mettre à jour la configuration de tailwind.
83
+
84
+ ```diff
85
+ // tailwind.config.js
86
+ + import { pentatrionTw } from "pentatrion-design/tailwind";
87
+
88
+ /** @type {import('tailwindcss').Config} */
89
+ export default {
90
+ content: [
91
+ "./index.html",
92
+ "./src/**/*.{js,ts,jsx,tsx}",
93
+ + "./node_modules/pentatrion-design/components/**/*.{ts,tsx}",
94
+ + "./node_modules/pentatrion-design/hooks/**/*.{ts,tsx}",
95
+ + "./node_modules/pentatrion-design/redux/**/*.{ts,tsx}",
96
+ ],
97
+ darkMode: ["class"],
98
+ + plugins: [pentatrionTw],
99
+ };
100
+ ```
101
+
102
+ La dépendance `pentatrion-fonts` est optionnelle.
103
+
104
+ Mettre à jour `src/App.tsx`
105
+ ```tsx
106
+ // import global
107
+ import { Button } from "pentatrion-design";
108
+
109
+ // import minimal
110
+ import { Button } from "pentatrion-design/components/button";
111
+
112
+ import { useState } from "react"
113
+
114
+ function App() {
115
+ const [counter, setCounter] = useState(0);
116
+
117
+ return (
118
+ <div className="flex flex-col gap-2 items-center">
119
+ <h1 className="text-gray-6">Vite + React</h1>
120
+ <Button onClick={() => setCounter(c => c + 1)}>Click me !</Button>
121
+ <p>{counter}</p>
122
+ </div>
123
+ )
124
+ }
125
+
126
+ export default App
127
+ ```
128
+
129
+ L'import minimal `import { Button } from "pentatrion-design/components/button";` est plus contraignant et n'est pas nécessaire si votre projet utilise toutes les dépendances de `pentatrion-design`. si par contre votre projet n'utilise que certains composants et n'utilise pas certains dépendances comme `react-sortablejs` il vaut mieux utiliser l'import `pentatrion-design/components/button`. Cela allégera le build (que notre compilateur fasse du tree shaking ou non).
130
+
131
+ Mettre à jour `src/index.css`
132
+ ```diff
25
133
  /* index.css */
26
134
  @import "tailwindcss/base";
27
- @import "pentatrion-design/src/tailwind/base.css" layer(base);
135
+ + @import "pentatrion-design/tailwind/base.css" layer(base);
28
136
 
29
137
  @import "tailwindcss/components";
30
- @import "pentatrion-design/src/tailwind/components.css" layer(components);
31
- @import "pentatrion-design/src/tailwind/components-input-outline.css" layer(components);
32
- @import "pentatrion-design/src/tailwind/components-resize-area.css" layer(components);
33
- @import "pentatrion-design/src/tailwind/components-step.css" layer(components);
138
+ + @import "pentatrion-design/tailwind/components.css" layer(components);
139
+ + @import "pentatrion-design/tailwind/components-input-outline.css" layer(components);
140
+ + @import "pentatrion-design/tailwind/components-resize-area.css" layer(components);
141
+ + @import "pentatrion-design/tailwind/components-step.css" layer(components);
34
142
 
35
143
  @import "tailwindcss/utilities";
36
- @import "pentatrion-design/src/tailwind/utilities.css" layer(utilities);
37
- @import "pentatrion-design/src/tailwind/utilities-dialog.css" layer(utilities);
144
+ + @import "pentatrion-design/tailwind/utilities.css" layer(utilities);
145
+ + @import "pentatrion-design/tailwind/utilities-dialog.css" layer(utilities);
146
+
147
+ /* Optionel */
148
+ + @import "pentatrion-fonts/fontello-lonlat";
149
+ ```
150
+
151
+
152
+ ## projet sans TypeScript
153
+
154
+ pour faciliter l'expérience de développement, `pentatrion-design` fait référence par défaut aux fichiers TypeScript non compilés. Si votre projet n'utilise pas TypeScript il faudra faire référence au dossier `dist`
155
+
156
+ ```js
157
+ import { Button } from "pentatrion-design/dist";
158
+ ```
159
+
160
+ ## VsCode
161
+
162
+
163
+ Create a `.vscode/settings.json` file
38
164
 
39
- @import "pentatrion-fonts/fontello-lonlat";
165
+ ```json
166
+ {
167
+ "files.associations": {
168
+ "*.css": "tailwindcss"
169
+ }
170
+ }
40
171
  ```