@mtes-mct/monitor-ui 1.1.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 (120) hide show
  1. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js +12 -0
  2. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js.map +1 -0
  3. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js +25 -0
  4. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js.map +1 -0
  5. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js +51 -0
  6. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js.map +1 -0
  7. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js +20 -0
  8. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js.map +1 -0
  9. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/fr/_lib/formatDistance/index.js +89 -0
  10. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/fr/_lib/formatDistance/index.js.map +1 -0
  11. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/fr/_lib/formatLong/index.js +37 -0
  12. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/fr/_lib/formatLong/index.js.map +1 -0
  13. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/fr/_lib/formatRelative/index.js +15 -0
  14. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/fr/_lib/formatRelative/index.js.map +1 -0
  15. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/fr/_lib/localize/index.js +101 -0
  16. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/fr/_lib/localize/index.js.map +1 -0
  17. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/fr/_lib/match/index.js +101 -0
  18. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/fr/_lib/match/index.js.map +1 -0
  19. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/fr/index.js +34 -0
  20. package/.yarn/cache/date-fns-npm-2.29.3-fef7e3c72c-e01cf5b62a.zip/node_modules/date-fns/esm/locale/fr/index.js.map +1 -0
  21. package/.yarn/cache/dayjs-npm-1.11.5-a825142dc5-e3bbaa7b48.zip/node_modules/dayjs/locale/fr.js +8 -0
  22. package/.yarn/cache/dayjs-npm-1.11.5-a825142dc5-e3bbaa7b48.zip/node_modules/dayjs/locale/fr.js.map +1 -0
  23. package/.yarn/cache/dayjs-npm-1.11.5-a825142dc5-e3bbaa7b48.zip/node_modules/dayjs/plugin/timezone.js +11 -0
  24. package/.yarn/cache/dayjs-npm-1.11.5-a825142dc5-e3bbaa7b48.zip/node_modules/dayjs/plugin/timezone.js.map +1 -0
  25. package/.yarn/cache/dayjs-npm-1.11.5-a825142dc5-e3bbaa7b48.zip/node_modules/dayjs/plugin/utc.js +11 -0
  26. package/.yarn/cache/dayjs-npm-1.11.5-a825142dc5-e3bbaa7b48.zip/node_modules/dayjs/plugin/utc.js.map +1 -0
  27. package/.yarn/cache/lodash.throttle-npm-4.1.1-856641af92-129c0a28ce.zip/node_modules/lodash.throttle/index.js +444 -0
  28. package/.yarn/cache/lodash.throttle-npm-4.1.1-856641af92-129c0a28ce.zip/node_modules/lodash.throttle/index.js.map +1 -0
  29. package/CHANGELOG.md +15 -0
  30. package/LICENSE +661 -0
  31. package/README.md +25 -0
  32. package/ThemeProvider.d.ts +7 -0
  33. package/_virtual/_commonjsHelpers.js +4 -0
  34. package/_virtual/_commonjsHelpers.js.map +1 -0
  35. package/_virtual/fr.js +4 -0
  36. package/_virtual/fr.js.map +1 -0
  37. package/_virtual/timezone.js +4 -0
  38. package/_virtual/timezone.js.map +1 -0
  39. package/_virtual/utc.js +4 -0
  40. package/_virtual/utc.js.map +1 -0
  41. package/constants.d.ts +1 -0
  42. package/fields/DatePicker/CalendarPicker.d.ts +9 -0
  43. package/fields/DatePicker/index.d.ts +23 -0
  44. package/fields/DateRangePicker/DateInput.d.ts +22 -0
  45. package/fields/DateRangePicker/NumberInput.d.ts +32 -0
  46. package/fields/DateRangePicker/RangeCalendarPicker.d.ts +10 -0
  47. package/fields/DateRangePicker/RangedTimePicker.d.ts +9 -0
  48. package/fields/DateRangePicker/TimeInput.d.ts +24 -0
  49. package/fields/DateRangePicker/constants.d.ts +11 -0
  50. package/fields/DateRangePicker/index.d.ts +24 -0
  51. package/fields/DateRangePicker/types.d.ts +18 -0
  52. package/fields/DateRangePicker/utils.d.ts +24 -0
  53. package/fields/Select.d.ts +11 -0
  54. package/formiks/FormikEffect.d.ts +5 -0
  55. package/formiks/FormikSelect.d.ts +5 -0
  56. package/hooks/useForceUpdate.d.ts +10 -0
  57. package/index.d.ts +14 -0
  58. package/package.json +53 -0
  59. package/src/ThemeProvider.js +13 -0
  60. package/src/ThemeProvider.js.map +1 -0
  61. package/src/constants.js +2 -0
  62. package/src/constants.js.map +1 -0
  63. package/src/fields/DatePicker/CalendarPicker.js +137 -0
  64. package/src/fields/DatePicker/CalendarPicker.js.map +1 -0
  65. package/src/fields/DatePicker/index.js +136 -0
  66. package/src/fields/DatePicker/index.js.map +1 -0
  67. package/src/fields/DateRangePicker/DateInput.js +84 -0
  68. package/src/fields/DateRangePicker/DateInput.js.map +1 -0
  69. package/src/fields/DateRangePicker/NumberInput.js +82 -0
  70. package/src/fields/DateRangePicker/NumberInput.js.map +1 -0
  71. package/src/fields/DateRangePicker/RangeCalendarPicker.js +147 -0
  72. package/src/fields/DateRangePicker/RangeCalendarPicker.js.map +1 -0
  73. package/src/fields/DateRangePicker/RangedTimePicker.js +90 -0
  74. package/src/fields/DateRangePicker/RangedTimePicker.js.map +1 -0
  75. package/src/fields/DateRangePicker/TimeInput.js +116 -0
  76. package/src/fields/DateRangePicker/TimeInput.js.map +1 -0
  77. package/src/fields/DateRangePicker/constants.js +34 -0
  78. package/src/fields/DateRangePicker/constants.js.map +1 -0
  79. package/src/fields/DateRangePicker/index.js +197 -0
  80. package/src/fields/DateRangePicker/index.js.map +1 -0
  81. package/src/fields/DateRangePicker/types.js +8 -0
  82. package/src/fields/DateRangePicker/types.js.map +1 -0
  83. package/src/fields/DateRangePicker/utils.js +73 -0
  84. package/src/fields/DateRangePicker/utils.js.map +1 -0
  85. package/src/fields/Select.js +38 -0
  86. package/src/fields/Select.js.map +1 -0
  87. package/src/formiks/FormikEffect.js +14 -0
  88. package/src/formiks/FormikEffect.js.map +1 -0
  89. package/src/formiks/FormikSelect.js +21 -0
  90. package/src/formiks/FormikSelect.js.map +1 -0
  91. package/src/hooks/useForceUpdate.js +17 -0
  92. package/src/hooks/useForceUpdate.js.map +1 -0
  93. package/src/index.js +10 -0
  94. package/src/index.js.map +1 -0
  95. package/src/theme.js +68 -0
  96. package/src/theme.js.map +1 -0
  97. package/src/utils/capitalizeFirstLetter.js +9 -0
  98. package/src/utils/capitalizeFirstLetter.js.map +1 -0
  99. package/src/utils/dayjs.js +11 -0
  100. package/src/utils/dayjs.js.map +1 -0
  101. package/src/utils/getLocalizedDayjs.js +19 -0
  102. package/src/utils/getLocalizedDayjs.js.map +1 -0
  103. package/src/utils/getUtcDayjs.js +9 -0
  104. package/src/utils/getUtcDayjs.js.map +1 -0
  105. package/src/utils/getUtcizedDayjs.js +20 -0
  106. package/src/utils/getUtcizedDayjs.js.map +1 -0
  107. package/src/utils/sortDates.js +12 -0
  108. package/src/utils/sortDates.js.map +1 -0
  109. package/src/utils/stopMouseEventPropagation.js +6 -0
  110. package/src/utils/stopMouseEventPropagation.js.map +1 -0
  111. package/theme.d.ts +54 -0
  112. package/types/index.d.ts +8 -0
  113. package/utils/capitalizeFirstLetter.d.ts +4 -0
  114. package/utils/cleanInputString.d.ts +4 -0
  115. package/utils/dayjs.d.ts +3 -0
  116. package/utils/getLocalizedDayjs.d.ts +8 -0
  117. package/utils/getUtcDayjs.d.ts +2 -0
  118. package/utils/getUtcizedDayjs.d.ts +8 -0
  119. package/utils/sortDates.d.ts +1 -0
  120. package/utils/stopMouseEventPropagation.d.ts +2 -0
@@ -0,0 +1,21 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useField } from 'formik';
3
+ import { useCallback, useEffect } from 'react';
4
+ import { Select } from '../fields/Select.js';
5
+
6
+ function FormikSelect({ name, ...originalProps }) {
7
+ const [, , helpers] = useField(name);
8
+ // We don't include `setValues` in `useCallback()` and `useEffect()` dependencies
9
+ // both because it is useless and it will trigger infinite hook calls
10
+ const { setValue } = helpers;
11
+ const handleChange = useCallback((valueOrValues) => {
12
+ setValue(valueOrValues);
13
+ // eslint-disable-next-line react-hooks/exhaustive-deps
14
+ }, []);
15
+ // eslint-disable-next-line react-hooks/exhaustive-deps
16
+ useEffect(() => () => setValue(undefined), []);
17
+ return jsx(Select, { name: name, onChange: handleChange, ...originalProps });
18
+ }
19
+
20
+ export { FormikSelect };
21
+ //# sourceMappingURL=FormikSelect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormikSelect.js","sources":["../../../src/formiks/FormikSelect.tsx"],"sourcesContent":["import { useField } from 'formik'\nimport { useCallback, useEffect } from 'react'\n\nimport { Select } from '../fields/Select'\n\nimport type { SelectProps } from '../fields/Select'\n\nexport type FormikSelectProps = Omit<SelectProps, 'name' | 'onChange'> & {\n name: string\n}\nexport function FormikSelect({ name, ...originalProps }: FormikSelectProps) {\n const [, , helpers] = useField(name)\n // We don't include `setValues` in `useCallback()` and `useEffect()` dependencies\n // both because it is useless and it will trigger infinite hook calls\n const { setValue } = helpers\n\n const handleChange = useCallback((valueOrValues: string | string[] | undefined) => {\n setValue(valueOrValues)\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => () => setValue(undefined), [])\n\n return <Select name={name} onChange={handleChange} {...originalProps} />\n}\n"],"names":["_jsx"],"mappings":";;;;;AAUM,SAAU,YAAY,CAAC,EAAE,IAAI,EAAE,GAAG,aAAa,EAAqB,EAAA;IACxE,MAAM,KAAK,OAAO,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;;;AAGpC,IAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;AAE5B,IAAA,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,aAA4C,KAAI;QAChF,QAAQ,CAAC,aAAa,CAAC,CAAA;;KAGxB,EAAE,EAAE,CAAC,CAAA;;AAGN,IAAA,SAAS,CAAC,MAAM,MAAM,QAAQ,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,CAAA;AAE9C,IAAA,OAAOA,GAAC,CAAA,MAAM,EAAC,EAAA,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAM,GAAA,aAAa,GAAI,CAAA;AAC1E;;;;"}
@@ -0,0 +1,17 @@
1
+ import lodash_throttle from '../../.yarn/cache/lodash.throttle-npm-4.1.1-856641af92-129c0a28ce.zip/node_modules/lodash.throttle/index.js';
2
+ import { useReducer, useMemo } from 'react';
3
+
4
+ /**
5
+ * Force component re-rendering
6
+ *
7
+ * @see https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
8
+ */
9
+ function useForceUpdate() {
10
+ // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars
11
+ const [_, forceUpdate] = useReducer(x => x + 1, 0);
12
+ const forceDebouncedUpdate = useMemo(() => lodash_throttle(forceUpdate, 500), [forceUpdate]);
13
+ return { forceDebouncedUpdate, forceUpdate };
14
+ }
15
+
16
+ export { useForceUpdate };
17
+ //# sourceMappingURL=useForceUpdate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useForceUpdate.js","sources":["../../../src/hooks/useForceUpdate.ts"],"sourcesContent":["import throttle from 'lodash.throttle'\nimport { useMemo, useReducer } from 'react'\n\n/**\n * Force component re-rendering\n *\n * @see https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate\n */\nexport function useForceUpdate() {\n // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars\n const [_, forceUpdate] = useReducer(x => x + 1, 0)\n\n const forceDebouncedUpdate = useMemo(() => throttle(forceUpdate, 500), [forceUpdate])\n\n return { forceDebouncedUpdate, forceUpdate }\n}\n"],"names":["throttle"],"mappings":";;;AAGA;;;;AAIG;SACa,cAAc,GAAA;;AAE5B,IAAA,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;AAElD,IAAA,MAAM,oBAAoB,GAAG,OAAO,CAAC,MAAMA,eAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAA;AAErF,IAAA,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,CAAA;AAC9C;;;;"}
package/src/index.js ADDED
@@ -0,0 +1,10 @@
1
+ import * as constants from './constants.js';
2
+ export { constants as MUI };
3
+ export { THEME } from './theme.js';
4
+ export { DateRangePicker } from './fields/DateRangePicker/index.js';
5
+ export { DatePicker } from './fields/DatePicker/index.js';
6
+ export { Select } from './fields/Select.js';
7
+ export { FormikEffect } from './formiks/FormikEffect.js';
8
+ export { FormikSelect } from './formiks/FormikSelect.js';
9
+ export { ThemeProvider } from './ThemeProvider.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
package/src/theme.js ADDED
@@ -0,0 +1,68 @@
1
+ /* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
2
+ const THEME = {
3
+ // https://xd.adobe.com/view/b6d4c472-3fbe-4dec-9f14-38fe03872a3e-e387/screen/b9bdc1ba-5f07-4c4f-bd44-2d38b2c6f663/specs/
4
+ color: {
5
+ /** INTERFACE COLORS */
6
+ // Neutral Colors
7
+ gunMetal: '#282F3E',
8
+ // TODO Make that charcoal object 100 & 50
9
+ charcoal: '#3B4559',
10
+ charcoalShadow: 'rgba(59, 69, 89, 0.5)',
11
+ slateGray: '#707785',
12
+ lightGray: '#CCCFD6',
13
+ gainsboro: '#E5E5EB',
14
+ cultured: '#F7F7FA',
15
+ white: '#FFFFFF',
16
+ // Accentuation Colors
17
+ blueYonder: {
18
+ 25: '#D4DDE7',
19
+ 100: '#567A9E'
20
+ },
21
+ blueGray: {
22
+ 100: '#5697D2',
23
+ 25: '#D4E5F4'
24
+ },
25
+ babyBlueEyes: '#99C9FF',
26
+ // Notification Colors
27
+ mediumSeaGreen: '#29B361',
28
+ goldenPoppy: '#FAC11A',
29
+ maximumRed: '#E1000F',
30
+ /** CONTEXTUAL COLORS */
31
+ // Risk Factor
32
+ cadetGray: '#8E9A9F',
33
+ grullo: '#B89B8C',
34
+ copperRed: '#CF6A4E',
35
+ chineseRed: '#A13112',
36
+ // Vessel Track
37
+ darkCornflowerBlue: '#2A4670',
38
+ jungleGreen: '#1C9B7B',
39
+ // Beacon Malfunction
40
+ powderBlue: '#9ED7D9',
41
+ wheat: '#EDD6A4',
42
+ // goldenPoppy: '#FAC11A',
43
+ // maximumRed: '#E1000F',
44
+ // charcoal: '#3B4559',
45
+ // mediumSeaGreen: '#29B361',
46
+ opal: '#A5BCC0',
47
+ // Regulation Areas
48
+ yaleBlue: '#295375',
49
+ glaucous: '#6284A6',
50
+ blueNcs: '#3690C0',
51
+ iceberg: '#67A9CF',
52
+ lightSteelBlue: '#9AB4D6',
53
+ lightPeriwinkle: '#CDCFEA',
54
+ aliceBlue: '#EBF0F4',
55
+ lightCyan: '#C7EAE5',
56
+ middleBlueGreen: '#91CFC9',
57
+ verdigris: '#56B3AB',
58
+ viridianGreen: '#01A29D',
59
+ paoloVeroneseGreen: '#21977F',
60
+ skobeloff: '#01686B',
61
+ blueSapphire: '#01536A',
62
+ indigoDye: '#033E54',
63
+ lightCoral: '#FA8282'
64
+ }
65
+ };
66
+
67
+ export { THEME };
68
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sources":["../../src/theme.ts"],"sourcesContent":["/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */\n\nimport type { DeepPartial } from './types'\n\nexport type Theme = typeof THEME\nexport type PartialTheme = DeepPartial<Theme>\n\nexport const THEME = {\n // https://xd.adobe.com/view/b6d4c472-3fbe-4dec-9f14-38fe03872a3e-e387/screen/b9bdc1ba-5f07-4c4f-bd44-2d38b2c6f663/specs/\n color: {\n /** INTERFACE COLORS */\n\n // Neutral Colors\n gunMetal: '#282F3E',\n // TODO Make that charcoal object 100 & 50\n charcoal: '#3B4559',\n charcoalShadow: 'rgba(59, 69, 89, 0.5)',\n slateGray: '#707785',\n lightGray: '#CCCFD6',\n gainsboro: '#E5E5EB',\n cultured: '#F7F7FA',\n white: '#FFFFFF',\n\n // Accentuation Colors\n blueYonder: {\n 25: '#D4DDE7',\n 100: '#567A9E'\n },\n blueGray: {\n 100: '#5697D2',\n 25: '#D4E5F4'\n },\n babyBlueEyes: '#99C9FF',\n\n // Notification Colors\n mediumSeaGreen: '#29B361',\n goldenPoppy: '#FAC11A',\n maximumRed: '#E1000F',\n\n /** CONTEXTUAL COLORS */\n\n // Risk Factor\n cadetGray: '#8E9A9F',\n grullo: '#B89B8C',\n copperRed: '#CF6A4E',\n chineseRed: '#A13112',\n\n // Vessel Track\n darkCornflowerBlue: '#2A4670',\n jungleGreen: '#1C9B7B',\n\n // Beacon Malfunction\n powderBlue: '#9ED7D9',\n wheat: '#EDD6A4',\n // goldenPoppy: '#FAC11A',\n // maximumRed: '#E1000F',\n // charcoal: '#3B4559',\n // mediumSeaGreen: '#29B361',\n opal: '#A5BCC0',\n\n // Regulation Areas\n yaleBlue: '#295375',\n glaucous: '#6284A6',\n blueNcs: '#3690C0',\n iceberg: '#67A9CF',\n lightSteelBlue: '#9AB4D6',\n lightPeriwinkle: '#CDCFEA',\n aliceBlue: '#EBF0F4',\n lightCyan: '#C7EAE5',\n middleBlueGreen: '#91CFC9',\n verdigris: '#56B3AB',\n viridianGreen: '#01A29D',\n paoloVeroneseGreen: '#21977F',\n skobeloff: '#01686B',\n blueSapphire: '#01536A',\n indigoDye: '#033E54',\n lightCoral: '#FA8282'\n }\n}\n"],"names":[],"mappings":"AAAA;AAOa,MAAA,KAAK,GAAG;;AAEnB,IAAA,KAAK,EAAE;;;AAIL,QAAA,QAAQ,EAAE,SAAS;;AAEnB,QAAA,QAAQ,EAAE,SAAS;AACnB,QAAA,cAAc,EAAE,uBAAuB;AACvC,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,QAAQ,EAAE,SAAS;AACnB,QAAA,KAAK,EAAE,SAAS;;AAGhB,QAAA,UAAU,EAAE;AACV,YAAA,EAAE,EAAE,SAAS;AACb,YAAA,GAAG,EAAE,SAAS;AACf,SAAA;AACD,QAAA,QAAQ,EAAE;AACR,YAAA,GAAG,EAAE,SAAS;AACd,YAAA,EAAE,EAAE,SAAS;AACd,SAAA;AACD,QAAA,YAAY,EAAE,SAAS;;AAGvB,QAAA,cAAc,EAAE,SAAS;AACzB,QAAA,WAAW,EAAE,SAAS;AACtB,QAAA,UAAU,EAAE,SAAS;;;AAKrB,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,MAAM,EAAE,SAAS;AACjB,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,UAAU,EAAE,SAAS;;AAGrB,QAAA,kBAAkB,EAAE,SAAS;AAC7B,QAAA,WAAW,EAAE,SAAS;;AAGtB,QAAA,UAAU,EAAE,SAAS;AACrB,QAAA,KAAK,EAAE,SAAS;;;;;AAKhB,QAAA,IAAI,EAAE,SAAS;;AAGf,QAAA,QAAQ,EAAE,SAAS;AACnB,QAAA,QAAQ,EAAE,SAAS;AACnB,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,cAAc,EAAE,SAAS;AACzB,QAAA,eAAe,EAAE,SAAS;AAC1B,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,eAAe,EAAE,SAAS;AAC1B,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,aAAa,EAAE,SAAS;AACxB,QAAA,kBAAkB,EAAE,SAAS;AAC7B,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,YAAY,EAAE,SAAS;AACvB,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,UAAU,EAAE,SAAS;AACtB,KAAA;;;;;"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Capitalize the first letter of a string
3
+ */
4
+ function capitalizeFirstLetter(text) {
5
+ return text.charAt(0).toUpperCase() + text.slice(1);
6
+ }
7
+
8
+ export { capitalizeFirstLetter };
9
+ //# sourceMappingURL=capitalizeFirstLetter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capitalizeFirstLetter.js","sources":["../../../src/utils/capitalizeFirstLetter.ts"],"sourcesContent":["/**\n * Capitalize the first letter of a string\n */\nexport function capitalizeFirstLetter(text: string): string {\n return text.charAt(0).toUpperCase() + text.slice(1)\n}\n"],"names":[],"mappings":"AAAA;;AAEG;AACG,SAAU,qBAAqB,CAAC,IAAY,EAAA;AAChD,IAAA,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACrD;;;;"}
@@ -0,0 +1,11 @@
1
+ import dayjs from 'dayjs';
2
+ export { default as dayjs } from 'dayjs';
3
+ import timezone from '../../.yarn/cache/dayjs-npm-1.11.5-a825142dc5-e3bbaa7b48.zip/node_modules/dayjs/plugin/timezone.js';
4
+ import utc from '../../.yarn/cache/dayjs-npm-1.11.5-a825142dc5-e3bbaa7b48.zip/node_modules/dayjs/plugin/utc.js';
5
+ import '../../.yarn/cache/dayjs-npm-1.11.5-a825142dc5-e3bbaa7b48.zip/node_modules/dayjs/locale/fr.js';
6
+
7
+ dayjs.extend(timezone);
8
+ dayjs.extend(utc);
9
+ dayjs.locale('fr');
10
+ dayjs.tz.setDefault('UTC');
11
+ //# sourceMappingURL=dayjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dayjs.js","sources":["../../../src/utils/dayjs.ts"],"sourcesContent":["import dayjs from 'dayjs'\nimport timezone from 'dayjs/plugin/timezone'\nimport utc from 'dayjs/plugin/utc'\n\nimport 'dayjs/locale/fr'\n\ndayjs.extend(timezone)\ndayjs.extend(utc)\ndayjs.locale('fr')\n\ndayjs.tz.setDefault('UTC')\n\nexport { dayjs }\n"],"names":[],"mappings":";;;;;;AAMA,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AACtB,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AACjB,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;AAElB,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC"}
@@ -0,0 +1,19 @@
1
+ import './dayjs.js';
2
+ import dayjs from 'dayjs';
3
+
4
+ // TODO Use `date-fns` instead of `dayjs`.
5
+ /**
6
+ * Get a Dayjs instance of a UTC date treated as if it was a locally timezoned one
7
+ *
8
+ * @example
9
+ * `2022-01-02T03:04:05.006Z` => `2022-01-02T03:04:05.006+01:00` (or `+02:00` during DST) in Europe/Paris timezone.
10
+ */
11
+ function getLocalizedDayjs(utcDate) {
12
+ // The number of minutes returned by getTimezoneOffset() is positive if the local time zone is behind UTC,
13
+ // and negative if the local time zone is ahead of UTC. For example, for UTC+10, -600 will be returned.
14
+ const timezoneOffsetInMinutes = utcDate.getTimezoneOffset();
15
+ return dayjs(utcDate).add(timezoneOffsetInMinutes, 'minutes');
16
+ }
17
+
18
+ export { getLocalizedDayjs };
19
+ //# sourceMappingURL=getLocalizedDayjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getLocalizedDayjs.js","sources":["../../../src/utils/getLocalizedDayjs.ts"],"sourcesContent":["// TODO Use `date-fns` instead of `dayjs`.\n\nimport { dayjs } from './dayjs'\n\nimport type { Dayjs } from 'dayjs'\n\n/**\n * Get a Dayjs instance of a UTC date treated as if it was a locally timezoned one\n *\n * @example\n * `2022-01-02T03:04:05.006Z` => `2022-01-02T03:04:05.006+01:00` (or `+02:00` during DST) in Europe/Paris timezone.\n */\nexport function getLocalizedDayjs(utcDate: Date): Dayjs {\n // The number of minutes returned by getTimezoneOffset() is positive if the local time zone is behind UTC,\n // and negative if the local time zone is ahead of UTC. For example, for UTC+10, -600 will be returned.\n const timezoneOffsetInMinutes = utcDate.getTimezoneOffset()\n\n return dayjs(utcDate).add(timezoneOffsetInMinutes, 'minutes')\n}\n"],"names":[],"mappings":";;;AAAA;AAMA;;;;;AAKG;AACG,SAAU,iBAAiB,CAAC,OAAa,EAAA;;;AAG7C,IAAA,MAAM,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAA;IAE3D,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAA;AAC/D;;;;"}
@@ -0,0 +1,9 @@
1
+ import './dayjs.js';
2
+ import dayjs from 'dayjs';
3
+
4
+ function getUtcDayjs() {
5
+ return dayjs().utc();
6
+ }
7
+
8
+ export { getUtcDayjs };
9
+ //# sourceMappingURL=getUtcDayjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUtcDayjs.js","sources":["../../../src/utils/getUtcDayjs.ts"],"sourcesContent":["import { dayjs } from './dayjs'\n\nimport type { Dayjs } from 'dayjs'\n\nexport function getUtcDayjs(): Dayjs {\n return dayjs().utc()\n}\n"],"names":[],"mappings":";;;SAIgB,WAAW,GAAA;AACzB,IAAA,OAAO,KAAK,EAAE,CAAC,GAAG,EAAE,CAAA;AACtB;;;;"}
@@ -0,0 +1,20 @@
1
+ import './dayjs.js';
2
+ import dayjs from 'dayjs';
3
+
4
+ // TODO Use `date-fns` instead of `dayjs`.
5
+ /**
6
+ * Get a Dayjs instance of a locally timezoned date treated as if it was a UTC one
7
+ *
8
+ * @example
9
+ * `2022-01-02T03:04:05.006+01:00` => `2022-01-02T03:04:05.006Z`.
10
+ */
11
+ function getUtcizedDayjs(localDate) {
12
+ const definedLocalDate = localDate || new Date();
13
+ // The number of minutes returned by getTimezoneOffset() is positive if the local time zone is behind UTC,
14
+ // and negative if the local time zone is ahead of UTC. For example, for UTC+10, -600 will be returned.
15
+ const timezoneOffsetInMinutes = definedLocalDate.getTimezoneOffset();
16
+ return dayjs(definedLocalDate).subtract(timezoneOffsetInMinutes, 'minutes');
17
+ }
18
+
19
+ export { getUtcizedDayjs };
20
+ //# sourceMappingURL=getUtcizedDayjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUtcizedDayjs.js","sources":["../../../src/utils/getUtcizedDayjs.ts"],"sourcesContent":["// TODO Use `date-fns` instead of `dayjs`.\n\nimport { dayjs } from './dayjs'\n\nimport type { Dayjs } from 'dayjs'\n\n/**\n * Get a Dayjs instance of a locally timezoned date treated as if it was a UTC one\n *\n * @example\n * `2022-01-02T03:04:05.006+01:00` => `2022-01-02T03:04:05.006Z`.\n */\nexport function getUtcizedDayjs(localDate?: Date): Dayjs {\n const definedLocalDate = localDate || new Date()\n // The number of minutes returned by getTimezoneOffset() is positive if the local time zone is behind UTC,\n // and negative if the local time zone is ahead of UTC. For example, for UTC+10, -600 will be returned.\n const timezoneOffsetInMinutes = definedLocalDate.getTimezoneOffset()\n\n return dayjs(definedLocalDate).subtract(timezoneOffsetInMinutes, 'minutes')\n}\n"],"names":[],"mappings":";;;AAAA;AAMA;;;;;AAKG;AACG,SAAU,eAAe,CAAC,SAAgB,EAAA;AAC9C,IAAA,MAAM,gBAAgB,GAAG,SAAS,IAAI,IAAI,IAAI,EAAE,CAAA;;;AAGhD,IAAA,MAAM,uBAAuB,GAAG,gBAAgB,CAAC,iBAAiB,EAAE,CAAA;IAEpE,OAAO,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAA;AAC7E;;;;"}
@@ -0,0 +1,12 @@
1
+ import './dayjs.js';
2
+ import dayjs from 'dayjs';
3
+
4
+ function sortDates(dates) {
5
+ return dates
6
+ .map(date => date.toISOString())
7
+ .sort()
8
+ .map(dateAsIsoString => dayjs(dateAsIsoString).toDate());
9
+ }
10
+
11
+ export { sortDates };
12
+ //# sourceMappingURL=sortDates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sortDates.js","sources":["../../../src/utils/sortDates.ts"],"sourcesContent":["import { dayjs } from './dayjs'\n\nexport function sortDates(dates: Date[]): Date[] {\n return dates\n .map(date => date.toISOString())\n .sort()\n .map(dateAsIsoString => dayjs(dateAsIsoString).toDate())\n}\n"],"names":[],"mappings":";;;AAEM,SAAU,SAAS,CAAC,KAAa,EAAA;AACrC,IAAA,OAAO,KAAK;SACT,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;AAC/B,SAAA,IAAI,EAAE;AACN,SAAA,GAAG,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC,CAAA;AAC5D;;;;"}
@@ -0,0 +1,6 @@
1
+ function stopMouseEventPropagation(event) {
2
+ event.stopPropagation();
3
+ }
4
+
5
+ export { stopMouseEventPropagation };
6
+ //# sourceMappingURL=stopMouseEventPropagation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stopMouseEventPropagation.js","sources":["../../../src/utils/stopMouseEventPropagation.ts"],"sourcesContent":["import type { MouseEvent } from 'react'\n\nexport function stopMouseEventPropagation(event: MouseEvent<HTMLElement>) {\n event.stopPropagation()\n}\n"],"names":[],"mappings":"AAEM,SAAU,yBAAyB,CAAC,KAA8B,EAAA;IACtE,KAAK,CAAC,eAAe,EAAE,CAAA;AACzB;;;;"}
package/theme.d.ts ADDED
@@ -0,0 +1,54 @@
1
+ import type { DeepPartial } from './types';
2
+ export declare type Theme = typeof THEME;
3
+ export declare type PartialTheme = DeepPartial<Theme>;
4
+ export declare const THEME: {
5
+ color: {
6
+ /** INTERFACE COLORS */
7
+ gunMetal: string;
8
+ charcoal: string;
9
+ charcoalShadow: string;
10
+ slateGray: string;
11
+ lightGray: string;
12
+ gainsboro: string;
13
+ cultured: string;
14
+ white: string;
15
+ blueYonder: {
16
+ 25: string;
17
+ 100: string;
18
+ };
19
+ blueGray: {
20
+ 100: string;
21
+ 25: string;
22
+ };
23
+ babyBlueEyes: string;
24
+ mediumSeaGreen: string;
25
+ goldenPoppy: string;
26
+ maximumRed: string;
27
+ /** CONTEXTUAL COLORS */
28
+ cadetGray: string;
29
+ grullo: string;
30
+ copperRed: string;
31
+ chineseRed: string;
32
+ darkCornflowerBlue: string;
33
+ jungleGreen: string;
34
+ powderBlue: string;
35
+ wheat: string;
36
+ opal: string;
37
+ yaleBlue: string;
38
+ glaucous: string;
39
+ blueNcs: string;
40
+ iceberg: string;
41
+ lightSteelBlue: string;
42
+ lightPeriwinkle: string;
43
+ aliceBlue: string;
44
+ lightCyan: string;
45
+ middleBlueGreen: string;
46
+ verdigris: string;
47
+ viridianGreen: string;
48
+ paoloVeroneseGreen: string;
49
+ skobeloff: string;
50
+ blueSapphire: string;
51
+ indigoDye: string;
52
+ lightCoral: string;
53
+ };
54
+ };
@@ -0,0 +1,8 @@
1
+ export declare type DateRange = [Date, Date];
2
+ export declare type DeepPartial<T> = T extends object ? {
3
+ [P in keyof T]?: DeepPartial<T[P]>;
4
+ } : T;
5
+ export declare type Option<V = string> = {
6
+ label: string;
7
+ value: V;
8
+ };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Capitalize the first letter of a string
3
+ */
4
+ export declare function capitalizeFirstLetter(text: string): string;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Trim and single-space a string
3
+ */
4
+ export declare function cleanInputString(text: string): string;
@@ -0,0 +1,3 @@
1
+ import dayjs from 'dayjs';
2
+ import 'dayjs/locale/fr';
3
+ export { dayjs };
@@ -0,0 +1,8 @@
1
+ import type { Dayjs } from 'dayjs';
2
+ /**
3
+ * Get a Dayjs instance of a UTC date treated as if it was a locally timezoned one
4
+ *
5
+ * @example
6
+ * `2022-01-02T03:04:05.006Z` => `2022-01-02T03:04:05.006+01:00` (or `+02:00` during DST) in Europe/Paris timezone.
7
+ */
8
+ export declare function getLocalizedDayjs(utcDate: Date): Dayjs;
@@ -0,0 +1,2 @@
1
+ import type { Dayjs } from 'dayjs';
2
+ export declare function getUtcDayjs(): Dayjs;
@@ -0,0 +1,8 @@
1
+ import type { Dayjs } from 'dayjs';
2
+ /**
3
+ * Get a Dayjs instance of a locally timezoned date treated as if it was a UTC one
4
+ *
5
+ * @example
6
+ * `2022-01-02T03:04:05.006+01:00` => `2022-01-02T03:04:05.006Z`.
7
+ */
8
+ export declare function getUtcizedDayjs(localDate?: Date): Dayjs;
@@ -0,0 +1 @@
1
+ export declare function sortDates(dates: Date[]): Date[];
@@ -0,0 +1,2 @@
1
+ import type { MouseEvent } from 'react';
2
+ export declare function stopMouseEventPropagation(event: MouseEvent<HTMLElement>): void;