@mgdis/mg-components 3.1.0

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 (271) hide show
  1. package/LICENSE +29 -0
  2. package/dist/cjs/css-shim-a22512c4.js +6 -0
  3. package/dist/cjs/index-85a4a0b6.js +1674 -0
  4. package/dist/cjs/index.cjs.js +2 -0
  5. package/dist/cjs/loader.cjs.js +35 -0
  6. package/dist/cjs/mg-badge_20.cjs.entry.js +4661 -0
  7. package/dist/cjs/mg-components.cjs.js +23 -0
  8. package/dist/cjs/shadow-css-8940f82d.js +390 -0
  9. package/dist/collection/collection-manifest.json +31 -0
  10. package/dist/collection/components/atoms/mg-badge/mg-badge.conf.js +4 -0
  11. package/dist/collection/components/atoms/mg-badge/mg-badge.css +99 -0
  12. package/dist/collection/components/atoms/mg-badge/mg-badge.js +148 -0
  13. package/dist/collection/components/atoms/mg-badge/mg-badge.stories.js +27 -0
  14. package/dist/collection/components/atoms/mg-button/mg-button.conf.js +4 -0
  15. package/dist/collection/components/atoms/mg-button/mg-button.css +134 -0
  16. package/dist/collection/components/atoms/mg-button/mg-button.js +236 -0
  17. package/dist/collection/components/atoms/mg-button/mg-button.stories.js +38 -0
  18. package/dist/collection/components/atoms/mg-character-left/mg-character-left.css +3 -0
  19. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +133 -0
  20. package/dist/collection/components/atoms/mg-character-left/mg-character-left.stories.js +15 -0
  21. package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +54 -0
  22. package/dist/collection/components/atoms/mg-icon/mg-icon.css +57 -0
  23. package/dist/collection/components/atoms/mg-icon/mg-icon.js +155 -0
  24. package/dist/collection/components/atoms/mg-icon/mg-icon.stories.js +34 -0
  25. package/dist/collection/components/atoms/mg-input-title/mg-input-title.css +12 -0
  26. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +95 -0
  27. package/dist/collection/components/atoms/mg-input-title/mg-input-title.stories.js +21 -0
  28. package/dist/collection/components/atoms/mg-tag/mg-tag.conf.js +4 -0
  29. package/dist/collection/components/atoms/mg-tag/mg-tag.css +73 -0
  30. package/dist/collection/components/atoms/mg-tag/mg-tag.js +94 -0
  31. package/dist/collection/components/atoms/mg-tag/mg-tag.stories.js +25 -0
  32. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.css +44 -0
  33. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +225 -0
  34. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.stories.js +26 -0
  35. package/dist/collection/components/molecules/inputs/MgInput.conf.js +7 -0
  36. package/dist/collection/components/molecules/inputs/MgInput.js +130 -0
  37. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +1 -0
  38. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +156 -0
  39. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +444 -0
  40. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.stories.js +57 -0
  41. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js +7 -0
  42. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +171 -0
  43. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +467 -0
  44. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.stories.js +46 -0
  45. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js +11 -0
  46. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +199 -0
  47. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +633 -0
  48. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.stories.js +68 -0
  49. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +195 -0
  50. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +401 -0
  51. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.stories.js +43 -0
  52. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.js +1 -0
  53. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.css +156 -0
  54. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +443 -0
  55. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.stories.js +65 -0
  56. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.conf.js +1 -0
  57. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +201 -0
  58. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +532 -0
  59. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.stories.js +70 -0
  60. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +222 -0
  61. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +589 -0
  62. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.stories.js +115 -0
  63. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +217 -0
  64. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +553 -0
  65. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.stories.js +52 -0
  66. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.js +1 -0
  67. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +213 -0
  68. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +457 -0
  69. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.stories.js +73 -0
  70. package/dist/collection/components/molecules/mg-message/mg-message.conf.js +4 -0
  71. package/dist/collection/components/molecules/mg-message/mg-message.css +94 -0
  72. package/dist/collection/components/molecules/mg-message/mg-message.js +285 -0
  73. package/dist/collection/components/molecules/mg-message/mg-message.stories.js +43 -0
  74. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js +5 -0
  75. package/dist/collection/components/molecules/mg-pagination/mg-pagination.css +39 -0
  76. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +218 -0
  77. package/dist/collection/components/molecules/mg-pagination/mg-pagination.stories.js +23 -0
  78. package/dist/collection/components/molecules/mg-popover/mg-popover.css +59 -0
  79. package/dist/collection/components/molecules/mg-popover/mg-popover.js +249 -0
  80. package/dist/collection/components/molecules/mg-popover/mg-popover.stories.js +36 -0
  81. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +1 -0
  82. package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +30 -0
  83. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +212 -0
  84. package/dist/collection/components/molecules/mg-tabs/mg-tabs.stories.js +40 -0
  85. package/dist/collection/fonts/OpenSans-Regular.ttf +0 -0
  86. package/dist/collection/fonts/OpenSans-SemiBold.ttf +0 -0
  87. package/dist/collection/fonts/Poppins-Bold.ttf +0 -0
  88. package/dist/collection/index.js +1 -0
  89. package/dist/collection/locales/index.js +4 -0
  90. package/dist/collection/stories/buttons.stories.js +43 -0
  91. package/dist/collection/stories/grids.stories.js +50 -0
  92. package/dist/collection/stories/icons.stories.js +20 -0
  93. package/dist/collection/stories/messages.stories.js +44 -0
  94. package/dist/collection/stories/tags.stories.js +13 -0
  95. package/dist/collection/stories/typography.stories.js +28 -0
  96. package/dist/collection/utils/components.utils.js +67 -0
  97. package/dist/collection/utils/locale.utils.js +32 -0
  98. package/dist/collection/utils/test.utils.js +26 -0
  99. package/dist/collection/variables.css +177 -0
  100. package/dist/collection/variables.scss +177 -0
  101. package/dist/components/MgInput.js +140 -0
  102. package/dist/components/components.utils.js +69 -0
  103. package/dist/components/index.d.ts +26 -0
  104. package/dist/components/index.js +1 -0
  105. package/dist/components/index2.js +54 -0
  106. package/dist/components/locale.utils.js +35 -0
  107. package/dist/components/mg-badge.d.ts +11 -0
  108. package/dist/components/mg-badge.js +6 -0
  109. package/dist/components/mg-badge2.js +82 -0
  110. package/dist/components/mg-button.d.ts +11 -0
  111. package/dist/components/mg-button.js +6 -0
  112. package/dist/components/mg-button2.js +148 -0
  113. package/dist/components/mg-character-left.d.ts +11 -0
  114. package/dist/components/mg-character-left.js +6 -0
  115. package/dist/components/mg-character-left2.js +77 -0
  116. package/dist/components/mg-icon.d.ts +11 -0
  117. package/dist/components/mg-icon.js +6 -0
  118. package/dist/components/mg-icon2.js +147 -0
  119. package/dist/components/mg-input-checkbox.d.ts +11 -0
  120. package/dist/components/mg-input-checkbox.js +222 -0
  121. package/dist/components/mg-input-date.d.ts +11 -0
  122. package/dist/components/mg-input-date.js +245 -0
  123. package/dist/components/mg-input-numeric.d.ts +11 -0
  124. package/dist/components/mg-input-numeric.js +324 -0
  125. package/dist/components/mg-input-password.d.ts +11 -0
  126. package/dist/components/mg-input-password.js +171 -0
  127. package/dist/components/mg-input-radio.d.ts +11 -0
  128. package/dist/components/mg-input-radio.js +211 -0
  129. package/dist/components/mg-input-select.d.ts +11 -0
  130. package/dist/components/mg-input-select.js +6 -0
  131. package/dist/components/mg-input-select2.js +243 -0
  132. package/dist/components/mg-input-text.d.ts +11 -0
  133. package/dist/components/mg-input-text.js +242 -0
  134. package/dist/components/mg-input-textarea.d.ts +11 -0
  135. package/dist/components/mg-input-textarea.js +224 -0
  136. package/dist/components/mg-input-title.d.ts +11 -0
  137. package/dist/components/mg-input-title.js +6 -0
  138. package/dist/components/mg-input-title2.js +55 -0
  139. package/dist/components/mg-input-toggle.d.ts +11 -0
  140. package/dist/components/mg-input-toggle.js +247 -0
  141. package/dist/components/mg-message.d.ts +11 -0
  142. package/dist/components/mg-message.js +183 -0
  143. package/dist/components/mg-pagination.d.ts +11 -0
  144. package/dist/components/mg-pagination.js +175 -0
  145. package/dist/components/mg-popover.d.ts +11 -0
  146. package/dist/components/mg-popover.js +183 -0
  147. package/dist/components/mg-tabs.d.ts +11 -0
  148. package/dist/components/mg-tabs.js +160 -0
  149. package/dist/components/mg-tag.d.ts +11 -0
  150. package/dist/components/mg-tag.js +76 -0
  151. package/dist/components/mg-tooltip.d.ts +11 -0
  152. package/dist/components/mg-tooltip.js +6 -0
  153. package/dist/components/mg-tooltip2.js +150 -0
  154. package/dist/components/popper.js +1784 -0
  155. package/dist/esm/css-shim-7c240feb.js +4 -0
  156. package/dist/esm/index-e3e84606.js +1643 -0
  157. package/dist/esm/index.js +1 -0
  158. package/dist/esm/loader.js +31 -0
  159. package/dist/esm/mg-badge_20.entry.js +4638 -0
  160. package/dist/esm/mg-components.js +21 -0
  161. package/dist/esm/polyfills/core-js.js +11 -0
  162. package/dist/esm/polyfills/css-shim.js +1 -0
  163. package/dist/esm/polyfills/dom.js +79 -0
  164. package/dist/esm/polyfills/es5-html-element.js +1 -0
  165. package/dist/esm/polyfills/index.js +34 -0
  166. package/dist/esm/polyfills/system.js +6 -0
  167. package/dist/esm/shadow-css-5d2d01ce.js +388 -0
  168. package/dist/esm-es5/css-shim-7c240feb.js +1 -0
  169. package/dist/esm-es5/index-e3e84606.js +1 -0
  170. package/dist/esm-es5/index.js +0 -0
  171. package/dist/esm-es5/loader.js +1 -0
  172. package/dist/esm-es5/mg-badge_20.entry.js +2 -0
  173. package/dist/esm-es5/mg-components.js +1 -0
  174. package/dist/esm-es5/shadow-css-5d2d01ce.js +12 -0
  175. package/dist/index.cjs.js +1 -0
  176. package/dist/index.js +1 -0
  177. package/dist/mg-components/fonts/OpenSans-Regular.ttf +0 -0
  178. package/dist/mg-components/fonts/OpenSans-SemiBold.ttf +0 -0
  179. package/dist/mg-components/fonts/Poppins-Bold.ttf +0 -0
  180. package/dist/mg-components/index.esm.js +0 -0
  181. package/dist/mg-components/mg-components.css +1 -0
  182. package/dist/mg-components/mg-components.esm.js +1 -0
  183. package/dist/mg-components/mg-components.js +132 -0
  184. package/dist/mg-components/p-1cd24462.system.js +1 -0
  185. package/dist/mg-components/p-2e2f6b27.system.entry.js +2 -0
  186. package/dist/mg-components/p-366a224e.js +1 -0
  187. package/dist/mg-components/p-422c429b.system.js +1 -0
  188. package/dist/mg-components/p-50ea2036.system.js +1 -0
  189. package/dist/mg-components/p-62fa3797.js +1 -0
  190. package/dist/mg-components/p-71d57b8b.system.js +13 -0
  191. package/dist/mg-components/p-9a215712.system.js +1 -0
  192. package/dist/mg-components/p-cbf0464b.entry.js +1 -0
  193. package/dist/mg-components/p-f6455ab3.js +12 -0
  194. package/dist/mg-components/variables.css +177 -0
  195. package/dist/mg-components/variables.scss +177 -0
  196. package/dist/types/components/atoms/mg-badge/mg-badge.conf.d.ts +8 -0
  197. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +36 -0
  198. package/dist/types/components/atoms/mg-badge/mg-badge.stories.d.ts +19 -0
  199. package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +4 -0
  200. package/dist/types/components/atoms/mg-button/mg-button.d.ts +67 -0
  201. package/dist/types/components/atoms/mg-button/mg-button.stories.d.ts +16 -0
  202. package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +39 -0
  203. package/dist/types/components/atoms/mg-character-left/mg-character-left.stories.d.ts +7 -0
  204. package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +12 -0
  205. package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +36 -0
  206. package/dist/types/components/atoms/mg-icon/mg-icon.stories.d.ts +26 -0
  207. package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +24 -0
  208. package/dist/types/components/atoms/mg-input-title/mg-input-title.stories.d.ts +6 -0
  209. package/dist/types/components/atoms/mg-tag/mg-tag.conf.d.ts +4 -0
  210. package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +25 -0
  211. package/dist/types/components/atoms/mg-tag/mg-tag.stories.d.ts +14 -0
  212. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +56 -0
  213. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.stories.d.ts +11 -0
  214. package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +10 -0
  215. package/dist/types/components/molecules/inputs/MgInput.d.ts +35 -0
  216. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +19 -0
  217. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +120 -0
  218. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.stories.d.ts +6 -0
  219. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.conf.d.ts +6 -0
  220. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +128 -0
  221. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.stories.d.ts +7 -0
  222. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.d.ts +10 -0
  223. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +173 -0
  224. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.stories.d.ts +21 -0
  225. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +111 -0
  226. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.stories.d.ts +9 -0
  227. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.d.ts +9 -0
  228. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +121 -0
  229. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.stories.d.ts +15 -0
  230. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +18 -0
  231. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +133 -0
  232. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.stories.d.ts +14 -0
  233. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +160 -0
  234. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.stories.d.ts +26 -0
  235. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +150 -0
  236. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.stories.d.ts +6 -0
  237. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +8 -0
  238. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +117 -0
  239. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.stories.d.ts +7 -0
  240. package/dist/types/components/molecules/mg-message/mg-message.conf.d.ts +4 -0
  241. package/dist/types/components/molecules/mg-message/mg-message.d.ts +76 -0
  242. package/dist/types/components/molecules/mg-message/mg-message.stories.d.ts +16 -0
  243. package/dist/types/components/molecules/mg-pagination/mg-pagination.conf.d.ts +4 -0
  244. package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +53 -0
  245. package/dist/types/components/molecules/mg-pagination/mg-pagination.stories.d.ts +6 -0
  246. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +62 -0
  247. package/dist/types/components/molecules/mg-popover/mg-popover.stories.d.ts +12 -0
  248. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +10 -0
  249. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +63 -0
  250. package/dist/types/components/molecules/mg-tabs/mg-tabs.stories.d.ts +7 -0
  251. package/dist/types/components.d.ts +1987 -0
  252. package/dist/types/index.d.ts +1 -0
  253. package/dist/types/locales/index.d.ts +44 -0
  254. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  255. package/dist/types/stories/buttons.stories.d.ts +13 -0
  256. package/dist/types/stories/grids.stories.d.ts +5 -0
  257. package/dist/types/stories/icons.stories.d.ts +13 -0
  258. package/dist/types/stories/messages.stories.d.ts +13 -0
  259. package/dist/types/stories/tags.stories.d.ts +5 -0
  260. package/dist/types/stories/typography.stories.d.ts +5 -0
  261. package/dist/types/utils/components.utils.d.ts +43 -0
  262. package/dist/types/utils/locale.utils.d.ts +22 -0
  263. package/dist/types/utils/test.utils.d.ts +5 -0
  264. package/loader/cdn.js +3 -0
  265. package/loader/index.cjs.js +3 -0
  266. package/loader/index.d.ts +12 -0
  267. package/loader/index.es2017.js +3 -0
  268. package/loader/index.js +4 -0
  269. package/loader/package.json +10 -0
  270. package/package.json +86 -0
  271. package/readme.md +159 -0
@@ -0,0 +1,177 @@
1
+ :root {
2
+ /*
3
+ Fonts
4
+ */
5
+
6
+ --font-size: 1.3rem;
7
+ --line-height: 1.4;
8
+
9
+ /* Open Sans is used for the body (mostly all texts) */
10
+ --font-family: 'Open Sans', sans-serif;
11
+
12
+ /* Poppins is used for the headings (h1 to h6) */
13
+ --font-family-heading: 'Poppins', sans-serif;
14
+
15
+ /* Font colors */
16
+ --color-font-light: var(--color-light);
17
+ --color-font-dark: var(--color-dark);
18
+ /*
19
+ Colors
20
+ https://jira.mgdis.fr/browse/PDA9-690
21
+ */
22
+
23
+ /* Neutral */
24
+ /* #fefefe; */
25
+ /* rgb(254, 254, 254); */
26
+ --color-neutral-h: 0;
27
+ --color-neutral-s: 0%;
28
+ --color-neutral-l: 99.6%;
29
+ --color-neutral: var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l);
30
+
31
+ /* Warning */
32
+ /* #ffc33e */
33
+ /* rgb(255, 195, 62); */
34
+ --color-warning-h: 41;
35
+ --color-warning-s: 100%;
36
+ --color-warning-l: 62.2%;
37
+ --color-warning: var(--color-warning-h), var(--color-warning-s), var(--color-warning-l);
38
+
39
+ /* Success */
40
+ /* #32d59c */
41
+ /* rgb(50, 213, 156); */
42
+ --color-success-h: 159;
43
+ --color-success-s: 66%;
44
+ --color-success-l: 51.6%;
45
+ --color-success: var(--color-success-h), var(--color-success-s), var(--color-success-l);
46
+
47
+ /* Info */
48
+ /* #005e9c; */
49
+ /* rgb(0, 94, 156); */
50
+ --color-info-h: 204;
51
+ --color-info-s: 100%;
52
+ --color-info-l: 30.6%;
53
+ --color-info: var(--color-info-h), var(--color-info-s), var(--color-info-l);
54
+
55
+ /* Danger */
56
+ /* #df242c; */
57
+ /* rgb(223, 36, 44); */
58
+ --color-danger-h: 357;
59
+ --color-danger-s: 74.5%;
60
+ --color-danger-l: 50.8%;
61
+ --color-danger: var(--color-danger-h), var(--color-danger-s), var(--color-danger-l);
62
+
63
+ /* Dark */
64
+ /* #15282e; */
65
+ /* rgb(21, 40, 46); */
66
+ --color-dark-h: 194;
67
+ --color-dark-s: 37.3%;
68
+ --color-dark-l: 13.1%;
69
+ --color-dark: var(--color-dark-h), var(--color-dark-s), var(--color-dark-l);
70
+
71
+ /* Light */
72
+ /* white; (#ffffff) */
73
+ /* rgb(255, 255, 255); */
74
+ --color-light-h: 0;
75
+ --color-light-s: 0%;
76
+ --color-light-l: 100%;
77
+ --color-light: var(--color-light-h), var(--color-light-s), var(--color-light-l);
78
+
79
+ /*
80
+ Global
81
+ */
82
+ --default-size: 3.5rem;
83
+
84
+ /*
85
+ <mg-icon>
86
+ */
87
+ --mg-icon-regular-size: 1.6rem;
88
+ --mg-icon-large-size: 2.4rem;
89
+ --mg-icon-extra-large-size: 3.6rem;
90
+
91
+ /*
92
+ <mg-button>
93
+ */
94
+
95
+ --mg-button-border-radius: 0.3rem;
96
+ --mg-button-icon-border-radius: var(--default-size);
97
+ --mg-button-disabled-opacity: 0.6;
98
+
99
+ /* Primary */
100
+ --mg-button-primary-color-h: var(--color-dark-h);
101
+ --mg-button-primary-color-s: var(--color-dark-s);
102
+ --mg-button-primary-color-l: var(--color-dark-l);
103
+ --mg-button-primary-font-color: var(--color-neutral);
104
+
105
+ /* Secondary */
106
+ --mg-button-secondary-color-h: var(--color-neutral-h);
107
+ --mg-button-secondary-color-s: var(--color-neutral-s);
108
+ --mg-button-secondary-color-l: var(--color-neutral-l);
109
+ --mg-button-secondary-font-color: var(--color-dark);
110
+
111
+ /*
112
+ <mg-tag>
113
+ */
114
+ --mg-tag-height: 2.3rem;
115
+ --mg-tag-border-radius: 0.5rem;
116
+ --mg-tag-font-size: 1.2rem;
117
+
118
+ /*
119
+ <mg-badge>
120
+ */
121
+ --mg-badge-size: 1.6rem;
122
+ --mg-badge-font-size: 1.1rem;
123
+
124
+ /*
125
+ <mg-tooltip>
126
+ */
127
+ --mg-tooltip-border-radius: 0.5rem;
128
+ --mg-tooltip-background-color: var(--color-dark);
129
+ --mg-tooltip-font-color: var(--color-font-light);
130
+
131
+ /*
132
+ <mg-popover>
133
+ */
134
+ --mg-popover-background-color: var(--color-light);
135
+ --mg-popover-font-color: var(--color-font-dark);
136
+ --mg-popover-title-font-size: 1.4rem;
137
+
138
+ /*
139
+ <mg-message>
140
+ */
141
+ --mg-message-border-radius: 0.3rem;
142
+
143
+ /*
144
+ Layout
145
+ */
146
+ --mg-grid-spacing: 1rem;
147
+
148
+ /*
149
+ Forms
150
+ */
151
+ --mg-form-group-vertical-space: 1.5rem;
152
+
153
+ /*
154
+ <mg-input-...>
155
+ */
156
+ --mg-inputs-border-width: 0.1rem;
157
+ --mg-inputs-border-radius: 0.3rem;
158
+ --mg-inputs-color: #b5c2c9;
159
+ --mg-inputs-spacer: 1rem;
160
+
161
+ /* Input focus shadow */
162
+ /* #b5c2c9 */
163
+ /* rgb(0, 221, 255); */
164
+ /* hsl(188, 100%, 50%); */
165
+ --mg-inputs-color-shadow-focus-hsl: 188, 100%, 50%;
166
+
167
+ /*
168
+ <mg-input-toggle>
169
+ */
170
+ --mg-input-toggle-border-radius-ratio: 2;
171
+
172
+ /*
173
+ <mg-input-checkbox>
174
+ <mg-input-radio>
175
+ */
176
+ --mg-input-check-size: 1.3rem;
177
+ }
@@ -0,0 +1,177 @@
1
+ :root {
2
+ /*
3
+ Fonts
4
+ */
5
+
6
+ --font-size: 1.3rem;
7
+ --line-height: 1.4;
8
+
9
+ /* Open Sans is used for the body (mostly all texts) */
10
+ --font-family: 'Open Sans', sans-serif;
11
+
12
+ /* Poppins is used for the headings (h1 to h6) */
13
+ --font-family-heading: 'Poppins', sans-serif;
14
+
15
+ /* Font colors */
16
+ --color-font-light: var(--color-light);
17
+ --color-font-dark: var(--color-dark);
18
+ /*
19
+ Colors
20
+ https://jira.mgdis.fr/browse/PDA9-690
21
+ */
22
+
23
+ /* Neutral */
24
+ /* #fefefe; */
25
+ /* rgb(254, 254, 254); */
26
+ --color-neutral-h: 0;
27
+ --color-neutral-s: 0%;
28
+ --color-neutral-l: 99.6%;
29
+ --color-neutral: var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l);
30
+
31
+ /* Warning */
32
+ /* #ffc33e */
33
+ /* rgb(255, 195, 62); */
34
+ --color-warning-h: 41;
35
+ --color-warning-s: 100%;
36
+ --color-warning-l: 62.2%;
37
+ --color-warning: var(--color-warning-h), var(--color-warning-s), var(--color-warning-l);
38
+
39
+ /* Success */
40
+ /* #32d59c */
41
+ /* rgb(50, 213, 156); */
42
+ --color-success-h: 159;
43
+ --color-success-s: 66%;
44
+ --color-success-l: 51.6%;
45
+ --color-success: var(--color-success-h), var(--color-success-s), var(--color-success-l);
46
+
47
+ /* Info */
48
+ /* #005e9c; */
49
+ /* rgb(0, 94, 156); */
50
+ --color-info-h: 204;
51
+ --color-info-s: 100%;
52
+ --color-info-l: 30.6%;
53
+ --color-info: var(--color-info-h), var(--color-info-s), var(--color-info-l);
54
+
55
+ /* Danger */
56
+ /* #df242c; */
57
+ /* rgb(223, 36, 44); */
58
+ --color-danger-h: 357;
59
+ --color-danger-s: 74.5%;
60
+ --color-danger-l: 50.8%;
61
+ --color-danger: var(--color-danger-h), var(--color-danger-s), var(--color-danger-l);
62
+
63
+ /* Dark */
64
+ /* #15282e; */
65
+ /* rgb(21, 40, 46); */
66
+ --color-dark-h: 194;
67
+ --color-dark-s: 37.3%;
68
+ --color-dark-l: 13.1%;
69
+ --color-dark: var(--color-dark-h), var(--color-dark-s), var(--color-dark-l);
70
+
71
+ /* Light */
72
+ /* white; (#ffffff) */
73
+ /* rgb(255, 255, 255); */
74
+ --color-light-h: 0;
75
+ --color-light-s: 0%;
76
+ --color-light-l: 100%;
77
+ --color-light: var(--color-light-h), var(--color-light-s), var(--color-light-l);
78
+
79
+ /*
80
+ Global
81
+ */
82
+ --default-size: 3.5rem;
83
+
84
+ /*
85
+ <mg-icon>
86
+ */
87
+ --mg-icon-regular-size: 1.6rem;
88
+ --mg-icon-large-size: 2.4rem;
89
+ --mg-icon-extra-large-size: 3.6rem;
90
+
91
+ /*
92
+ <mg-button>
93
+ */
94
+
95
+ --mg-button-border-radius: 0.3rem;
96
+ --mg-button-icon-border-radius: var(--default-size);
97
+ --mg-button-disabled-opacity: 0.6;
98
+
99
+ /* Primary */
100
+ --mg-button-primary-color-h: var(--color-dark-h);
101
+ --mg-button-primary-color-s: var(--color-dark-s);
102
+ --mg-button-primary-color-l: var(--color-dark-l);
103
+ --mg-button-primary-font-color: var(--color-neutral);
104
+
105
+ /* Secondary */
106
+ --mg-button-secondary-color-h: var(--color-neutral-h);
107
+ --mg-button-secondary-color-s: var(--color-neutral-s);
108
+ --mg-button-secondary-color-l: var(--color-neutral-l);
109
+ --mg-button-secondary-font-color: var(--color-dark);
110
+
111
+ /*
112
+ <mg-tag>
113
+ */
114
+ --mg-tag-height: 2.3rem;
115
+ --mg-tag-border-radius: 0.5rem;
116
+ --mg-tag-font-size: 1.2rem;
117
+
118
+ /*
119
+ <mg-badge>
120
+ */
121
+ --mg-badge-size: 1.6rem;
122
+ --mg-badge-font-size: 1.1rem;
123
+
124
+ /*
125
+ <mg-tooltip>
126
+ */
127
+ --mg-tooltip-border-radius: 0.5rem;
128
+ --mg-tooltip-background-color: var(--color-dark);
129
+ --mg-tooltip-font-color: var(--color-font-light);
130
+
131
+ /*
132
+ <mg-popover>
133
+ */
134
+ --mg-popover-background-color: var(--color-light);
135
+ --mg-popover-font-color: var(--color-font-dark);
136
+ --mg-popover-title-font-size: 1.4rem;
137
+
138
+ /*
139
+ <mg-message>
140
+ */
141
+ --mg-message-border-radius: 0.3rem;
142
+
143
+ /*
144
+ Layout
145
+ */
146
+ --mg-grid-spacing: 1rem;
147
+
148
+ /*
149
+ Forms
150
+ */
151
+ --mg-form-group-vertical-space: 1.5rem;
152
+
153
+ /*
154
+ <mg-input-...>
155
+ */
156
+ --mg-inputs-border-width: 0.1rem;
157
+ --mg-inputs-border-radius: 0.3rem;
158
+ --mg-inputs-color: #b5c2c9;
159
+ --mg-inputs-spacer: 1rem;
160
+
161
+ /* Input focus shadow */
162
+ /* #b5c2c9 */
163
+ /* rgb(0, 221, 255); */
164
+ /* hsl(188, 100%, 50%); */
165
+ --mg-inputs-color-shadow-focus-hsl: 188, 100%, 50%;
166
+
167
+ /*
168
+ <mg-input-toggle>
169
+ */
170
+ --mg-input-toggle-border-radius-ratio: 2;
171
+
172
+ /*
173
+ <mg-input-checkbox>
174
+ <mg-input-radio>
175
+ */
176
+ --mg-input-check-size: 1.3rem;
177
+ }
@@ -0,0 +1,140 @@
1
+ import { h } from '@stencil/core/internal/client';
2
+
3
+ /**
4
+ * Possible input classes
5
+ */
6
+ var InputClass;
7
+ (function (InputClass) {
8
+ InputClass["ERROR"] = "is-not-valid";
9
+ })(InputClass || (InputClass = {}));
10
+
11
+ /**
12
+ * Apply in all input child node the aria-describedby attribute
13
+ * @param children
14
+ * @param ariaDescribedbyIDs
15
+ * @param utils
16
+ * @returns {VNode[]}
17
+ */
18
+ const applyAriadescribedBy = (children, ariaDescribedbyIDs, utils) => utils.map(children, child => {
19
+ if (['input', 'select', 'textarea'].includes(child.vtag)) {
20
+ return Object.assign(Object.assign({}, child), { vattrs: Object.assign(Object.assign({}, child.vattrs), { 'aria-describedby': [...ariaDescribedbyIDs].join(' ') }) });
21
+ }
22
+ // we recursively apply ariadescribedBy attributes to child input nodes if exists
23
+ if (child.vchildren === null)
24
+ return Object.assign({}, child);
25
+ return Object.assign(Object.assign({}, child), { vchildren: applyAriadescribedBy(child.vchildren, ariaDescribedbyIDs, utils) });
26
+ });
27
+ /**
28
+ * Add classes based on props
29
+ * @param props
30
+ */
31
+ const manageClasses = (props) => {
32
+ props.classList.add('mg-input');
33
+ if (props.labelOnTop)
34
+ props.classList.add('mg-input--label-on-top');
35
+ if (props.readonly)
36
+ props.classList.add('mg-input--readonly');
37
+ if (props.width !== undefined)
38
+ props.classList.add(`mg-input--width-${props.width}`);
39
+ if (props.readonly || props.disabled) {
40
+ props.classList.delete(InputClass.ERROR);
41
+ }
42
+ };
43
+ /**
44
+ * Define tagname based on props
45
+ * @param isFieldset
46
+ * @returns {string} tag name
47
+ */
48
+ const getTagName = (isFieldset) => (isFieldset ? 'fieldset' : 'div');
49
+ /**
50
+ * Get input template
51
+ * @param props MgInput Interface Props
52
+ * @param children Represent scoped elements
53
+ * @param utils Stencil.js utils
54
+ * @returns JSX template
55
+ */
56
+ const MgInput = (props, children, utils) => {
57
+ /**
58
+ * Check required properties
59
+ */
60
+ if (typeof props.label !== 'string' || props.label === '') {
61
+ throw new Error('<mg-input> prop "label" is required');
62
+ }
63
+ if (props.labelOnTop && props.labelHide) {
64
+ throw new Error('<mg-input> prop "labelOnTop" must not be paired with the prop "labelHide"');
65
+ }
66
+ /**
67
+ * Component classes
68
+ */
69
+ manageClasses(props);
70
+ /**
71
+ * a11y IDs
72
+ */
73
+ const ariaDescribedbyIDs = new Set();
74
+ // Character Left
75
+ const characterLeftId = `${props.identifier}-character-left`;
76
+ if (props.classList.has('is-focused') && props.displayCharacterLeft) {
77
+ ariaDescribedbyIDs.add(characterLeftId);
78
+ }
79
+ // Help text
80
+ const helpTextId = `${props.identifier}-help-text`;
81
+ if (typeof props.helpText === 'string' && props.helpText !== '') {
82
+ ariaDescribedbyIDs.add(helpTextId);
83
+ }
84
+ // Error Message
85
+ const helpTextErrorId = `${props.identifier}-error`;
86
+ if (typeof props.errorMessage === 'string' && props.errorMessage !== '') {
87
+ ariaDescribedbyIDs.add(helpTextErrorId);
88
+ }
89
+ /**
90
+ * Update input(s) in children
91
+ */
92
+ if (props.readonly) {
93
+ children = children.filter(child => child.$name$ === 'append-input');
94
+ }
95
+ else {
96
+ children = applyAriadescribedBy(children, ariaDescribedbyIDs, utils);
97
+ }
98
+ /**
99
+ * Return template
100
+ *
101
+ * +--------+--------------+---------+
102
+ * | label | input | tooltip |
103
+ * | +--------------+---------+
104
+ * | | nb Char Left |
105
+ * | +------------------------+
106
+ * | | Help Text |
107
+ * | +------------------------+
108
+ * | | Error |
109
+ * +--------+------------------------+
110
+ *
111
+ * Error message is based on this aria method: https://www.w3.org/WAI/tutorials/forms/notifications/#on-focus-change
112
+ */
113
+ const TagName = getTagName(props.isFieldset);
114
+ /**
115
+ * Get tooltip node
116
+ * @returns mg-tooltip
117
+ */
118
+ const getTooltip = () => (h("mg-tooltip", { identifier: `${props.identifier}-tooltip`, message: props.tooltip },
119
+ h("mg-icon", { icon: "info-circle" })));
120
+ /**
121
+ * Get input title (label) node
122
+ * @returns mg-input-title
123
+ */
124
+ const getInputTitle = () => (h("mg-input-title", { identifier: props.identifier, class: props.labelHide ? 'sr-only' : undefined, required: props.required, "is-legend": props.isFieldset }, props.label));
125
+ return (h(TagName, { class: props.classList.join() },
126
+ props.labelOnTop ? (h("div", { class: "mg-input__title" },
127
+ getInputTitle(),
128
+ !props.readonly && props.tooltip && getTooltip())) : (getInputTitle()),
129
+ props.readonly ? (h("div", { class: "mg-input__input-container" },
130
+ h("strong", null, props.readonlyValue || props.value),
131
+ children)) : (h("div", { class: "mg-input__input-container" },
132
+ h("div", { class: "mg-input__input" },
133
+ children,
134
+ !props.labelOnTop && props.tooltip && getTooltip()),
135
+ props.displayCharacterLeft && props.maxlength && props.classList.has('is-focused') && (h("mg-character-left", { identifier: characterLeftId, characters: props.value, maxlength: props.maxlength, template: props.characterLeftTemplate })),
136
+ props.helpText && h("div", { id: helpTextId, class: "mg-input__help-text", innerHTML: props.helpText }),
137
+ props.errorMessage && h("div", { id: helpTextErrorId, class: "mg-input__error", innerHTML: props.errorMessage, "aria-live": "assertive" })))));
138
+ };
139
+
140
+ export { InputClass as I, MgInput as M };
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Create random ID
3
+ * @param prefix {string} add prefix to created ID
4
+ * @returns {string} ID
5
+ */
6
+ function createID(prefix = '', length = 10) {
7
+ let ID = '';
8
+ const chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
9
+ const charsLength = chars.length;
10
+ for (var i = 0; i < length; i++) {
11
+ ID += chars.charAt(Math.floor(Math.random() * charsLength));
12
+ }
13
+ return (prefix !== '' ? `${prefix}-` : '') + ID;
14
+ }
15
+ /**
16
+ * Class to manage component classlist
17
+ * Set() are not working when imported in project
18
+ */
19
+ class ClassList {
20
+ constructor(classlist = []) {
21
+ /**
22
+ * Add class
23
+ * @param className
24
+ * @returns {void}
25
+ */
26
+ this.add = (className) => {
27
+ if (!this.has(className)) {
28
+ this.classes.push(className);
29
+ }
30
+ };
31
+ /**
32
+ * Delete class
33
+ * @param className
34
+ * @returns {void}
35
+ */
36
+ this.delete = (className) => {
37
+ const index = this.classes.indexOf(className);
38
+ if (index > -1) {
39
+ this.classes.splice(index, 1);
40
+ }
41
+ };
42
+ /**
43
+ * Check if class exist in list
44
+ * @param className
45
+ * @returns {boolean}
46
+ */
47
+ this.has = (className) => {
48
+ return this.classes.includes(className);
49
+ };
50
+ /**
51
+ * Join classes seperated by spaces
52
+ * @returns {string}
53
+ */
54
+ this.join = () => {
55
+ return this.classes.join(' ');
56
+ };
57
+ this.classes = classlist;
58
+ }
59
+ }
60
+ /**
61
+ * Check if all items are string
62
+ * @param items
63
+ * @returns {boolean}
64
+ */
65
+ function allItemsAreString(items) {
66
+ return items && items.every(item => typeof item === 'string');
67
+ }
68
+
69
+ export { ClassList as C, allItemsAreString as a, createID as c };
@@ -0,0 +1,26 @@
1
+ /* MgComponents custom elements */
2
+
3
+ import type { Components, JSX } from "../types/components";
4
+
5
+ /**
6
+ * Used to manually set the base path where assets can be found.
7
+ * If the script is used as "module", it's recommended to use "import.meta.url",
8
+ * such as "setAssetPath(import.meta.url)". Other options include
9
+ * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
10
+ * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
11
+ * But do note that this configuration depends on how your script is bundled, or lack of
12
+ * bunding, and where your assets can be loaded from. Additionally custom bundling
13
+ * will have to ensure the static assets are copied to its build directory.
14
+ */
15
+ export declare const setAssetPath: (path: string) => void;
16
+
17
+ export interface SetPlatformOptions {
18
+ raf?: (c: FrameRequestCallback) => number;
19
+ ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
20
+ rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
21
+ }
22
+ export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
23
+
24
+ export type { Components, JSX };
25
+
26
+ export * from '../types';
@@ -0,0 +1 @@
1
+ export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
@@ -0,0 +1,54 @@
1
+ const errors = {
2
+ required: "Ce champ est obligatoire.",
3
+ date: {
4
+ badInput: "Le format de la date doit être du type <span aria-hidden=\"true\">jj/mm/aaaa</span><span class=\"sr-only\">j j / m m / a a a a</span> et la date supérieure au {min}",
5
+ min: "La date ne peut pas être antérieure au {min}",
6
+ max: "La date ne peut pas être postérieure au {max}",
7
+ minMax: "La date doit être comprise entre {min} et {max}"
8
+ },
9
+ numeric: {
10
+ min: "La valeur ne peut pas être inférieure à {min}",
11
+ max: "La valeur ne peut pas être supérieure à {max}",
12
+ minMax: "La valeur doit être comprise entre {min} et {max}"
13
+ }
14
+ };
15
+ const nbCharLeft = "{counter} caractères disponibles.";
16
+ const input = {
17
+ select: {
18
+ placeholder: "Veuillez sélectionner une valeur"
19
+ },
20
+ checkbox: {
21
+ "true": "Oui",
22
+ "false": "Non",
23
+ indeterminate: "Indéterminé"
24
+ }
25
+ };
26
+ const message = {
27
+ closeButton: "Fermer le message"
28
+ };
29
+ const popover = {
30
+ closeButton: "Fermer"
31
+ };
32
+ const pagination = {
33
+ page: "page",
34
+ pages: "pages",
35
+ next: "suivant",
36
+ previous: "précédent",
37
+ nextPage: "Page suivante",
38
+ previousPage: "Page précédente",
39
+ selectPage: "Sélectionner la page à afficher."
40
+ };
41
+ const fr = {
42
+ errors: errors,
43
+ nbCharLeft: nbCharLeft,
44
+ input: input,
45
+ message: message,
46
+ popover: popover,
47
+ pagination: pagination
48
+ };
49
+
50
+ const locale = 'fr-FR';
51
+ const messages = fr;
52
+ const currency = 'EUR';
53
+
54
+ export { currency as c, locale as l, messages as m };
@@ -0,0 +1,35 @@
1
+ import { l as locale, c as currency } from './index2.js';
2
+
3
+ /**
4
+ * Format number to the locale currency
5
+ * @param number {number}
6
+ * @returns {string} formatted currency
7
+ */
8
+ function localeCurrency(number) {
9
+ return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(number);
10
+ }
11
+ /**
12
+ * Format number to locale
13
+ * @param number {number}
14
+ * @returns {string} formatted number
15
+ */
16
+ function localeNumber(number) {
17
+ return new Intl.NumberFormat(locale).format(number);
18
+ }
19
+ /**
20
+ * Date RegExp
21
+ */
22
+ const dateRegExp = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/;
23
+ /**
24
+ * Locale date format
25
+ * @param date {string}
26
+ * @returns {string} formatted date
27
+ */
28
+ function localeDate(date) {
29
+ if (typeof date !== 'string' || date === '' || !dateRegExp.test(date)) {
30
+ return '';
31
+ }
32
+ return new Intl.DateTimeFormat(locale).format(new Date(date));
33
+ }
34
+
35
+ export { localeCurrency as a, localeNumber as b, dateRegExp as d, localeDate as l };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface MgBadge extends Components.MgBadge, HTMLElement {}
4
+ export const MgBadge: {
5
+ prototype: MgBadge;
6
+ new (): MgBadge;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { M as MgBadge$1, d as defineCustomElement$1 } from './mg-badge2.js';
2
+
3
+ const MgBadge = MgBadge$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { MgBadge, defineCustomElement };