@mtes-mct/monitor-ui 9.2.2 → 9.3.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.
- package/CHANGELOG.md +7 -0
- package/index.js +27 -4
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/src/fields/TextInput.d.ts +2 -2
- package/src/icons/Comment.d.ts +2 -0
- package/src/icons/Phone.d.ts +2 -0
- package/src/icons/Rescue.d.ts +2 -0
- package/src/icons/index.d.ts +4 -1
- package/src/theme.d.ts +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [9.2.2](https://github.com/MTES-MCT/monitor-ui/compare/v9.2.1...v9.2.2) (2023-09-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **tables:** remove secondary generic type in DataTable ([ff2208c](https://github.com/MTES-MCT/monitor-ui/commit/ff2208c13b2db93260ca3999e2ca85357aa09ba9))
|
|
7
|
+
|
|
1
8
|
## [9.2.1](https://github.com/MTES-MCT/monitor-ui/compare/v9.2.0...v9.2.1) (2023-09-08)
|
|
2
9
|
|
|
3
10
|
# [9.2.0](https://github.com/MTES-MCT/monitor-ui/compare/v9.1.1...v9.2.0) (2023-09-08)
|
package/index.js
CHANGED
|
@@ -316,7 +316,15 @@ const THEME = {
|
|
|
316
316
|
apricot: '#F0C1A1',
|
|
317
317
|
melon: '#E7A58D',
|
|
318
318
|
paleDogwood: '#F8D7CE',
|
|
319
|
-
seashell: '#FCECE4'
|
|
319
|
+
seashell: '#FCECE4',
|
|
320
|
+
// Custom Zones
|
|
321
|
+
darkGoldenrod: '#A98A0F',
|
|
322
|
+
pear: '#DBE33E',
|
|
323
|
+
jonquil: '#F0CB38',
|
|
324
|
+
earthYellow: '#E6B771',
|
|
325
|
+
ecru: '#BAAB68',
|
|
326
|
+
goldMetallic: '#C5A730',
|
|
327
|
+
mindaro: '#F2F58E'
|
|
320
328
|
}
|
|
321
329
|
};
|
|
322
330
|
|
|
@@ -33749,7 +33757,7 @@ const FONT_SIZE = {
|
|
|
33749
33757
|
[Size.SMALL]: '11px'
|
|
33750
33758
|
};
|
|
33751
33759
|
const PADDING$2 = {
|
|
33752
|
-
[Size.LARGE]: '
|
|
33760
|
+
[Size.LARGE]: '12px',
|
|
33753
33761
|
[Size.NORMAL]: '6px 12px',
|
|
33754
33762
|
[Size.SMALL]: '5px 8px 4px'
|
|
33755
33763
|
};
|
|
@@ -34054,6 +34062,10 @@ function Close({ color, size, ...nativeProps }) {
|
|
|
34054
34062
|
return (jsx(IconBox, { "$color": color, "$size": size, children: jsx("svg", { height: "20", viewBox: "0 0 20 20", width: "20", ...nativeProps, children: jsxs("g", { transform: "translate(160 -82)", children: [jsxs("g", { fill: "none", strokeMiterlimit: "10", children: [jsx("path", { d: "M-142,85.415-143.415,84-150,90.585-156.585,84-158,85.415-151.415,92-158,98.585l1.415,1.415L-150,93.415l6.585,6.585L-142,98.585-148.585,92Z", stroke: "none" }), jsx("path", { d: "M -156.5853271484375 84 L -150 90.5853271484375 L -143.4146728515625 84 L -142 85.4146728515625 L -148.5853271484375 92 L -142 98.5853271484375 L -143.4146728515625 100 L -150 93.4146728515625 L -156.5853271484375 100 L -158 98.5853271484375 L -151.4146728515625 92 L -158 85.4146728515625 L -156.5853271484375 84 Z", fill: "currentColor", stroke: "none" })] }), jsx("rect", { fill: "none", height: "20", transform: "translate(-160 82)", width: "20" })] }) }) }));
|
|
34055
34063
|
}
|
|
34056
34064
|
|
|
34065
|
+
function Comment({ color, size, ...nativeProps }) {
|
|
34066
|
+
return (jsx(IconBox, { "$color": color, "$size": size, children: jsxs("svg", { height: "20", viewBox: "0 0 20 20", width: "20", ...nativeProps, children: [jsx("clipPath", { children: jsx("path", { d: "m0 0h20v20h-20z" }) }), jsxs("g", { clipPath: "url(#a)", children: [jsx("path", { d: "m0 0h20v20h-20z", fill: "#fff" }), jsx("path", { d: "m6.455 19.41-4.455 3.59v-18.974a1.013 1.013 0 0 1 1-1.026h18a1.013 1.013 0 0 1 1 1.026v14.359a1.013 1.013 0 0 1 -1 1.026zm.545-9.231v2.051h2v-2.051zm4 0v2.051h2v-2.051zm4 0v2.051h2v-2.051z", fill: "currentColor", transform: "translate(-2 -3)" })] })] }) }));
|
|
34067
|
+
}
|
|
34068
|
+
|
|
34057
34069
|
function Confirm({ color, size, ...nativeProps }) {
|
|
34058
34070
|
return (jsx(IconBox, { "$color": color, "$size": size, children: jsx("svg", { height: "20", viewBox: "0 0 20 20", width: "20", ...nativeProps, children: jsxs("g", { transform: "translate(-40)", children: [jsx("path", { d: "M50,1a9,9,0,1,0,9,9A9,9,0,0,0,50,1Zm0,16a7,7,0,1,1,7-7A7,7,0,0,1,50,17Z", fill: "currentColor" }), jsx("path", { d: "M53.382,6.529l-4.243,4.243L47.018,8.65,45.6,10.064l2.121,2.121h0L49.139,13.6,54.8,7.943Z", fill: "currentColor" }), jsx("rect", { fill: "none", height: "20", transform: "translate(40)", width: "20" })] }) }) }));
|
|
34059
34071
|
}
|
|
@@ -34202,6 +34214,10 @@ function Observation({ color, size, ...nativeProps }) {
|
|
|
34202
34214
|
return (jsx(IconBox, { "$color": color, "$size": size, children: jsxs("svg", { height: "20", viewBox: "0 0 20 20", width: "20", ...nativeProps, children: [jsx("rect", { fill: "none", height: "20", width: "20" }), jsxs("g", { fill: "currentColor", strokeMiterlimit: "10", children: [jsx("path", { d: "M 15.5 17 C 13.57009029388428 17 12 15.42990970611572 12 13.5 L 12 12.11200046539307 L 12 11.31332969665527 L 11.22109985351563 11.13675022125244 C 10.82866764068604 11.0477819442749 10.42606067657471 11.0018138885498 10.02403163909912 11.0000524520874 C 10.30024242401123 11.00124073028564 10.57746124267578 11.0228853225708 10.8484001159668 11.06443977355957 L 12 11.24106979370117 L 12 10.07600021362305 L 12 9.093000411987305 L 12 8.244170188903809 L 11.16244983673096 8.106280326843262 C 10.85622978210449 8.055870056152344 10.44736003875732 7.998000144958496 10 7.998000144958496 C 9.552639961242676 7.998000144958496 9.143770217895508 8.055870056152344 8.837550163269043 8.106280326843262 L 8 8.244170188903809 L 8 9.093000411987305 L 8 10.07699966430664 L 8 11.2455997467041 L 9.154560089111328 11.06497955322266 C 9.42243480682373 11.02307319641113 9.698649406433105 11.00124740600586 9.975924491882324 11.0000524520874 C 9.573919296264648 11.0018196105957 9.171308517456055 11.0477876663208 8.778900146484375 11.13675022125244 L 8 11.31332969665527 L 8 12.11200046539307 L 8 13.5 C 8 15.42990970611572 6.429910182952881 17 4.5 17 C 2.570090055465698 17 1 15.42990970611572 1 13.5 C 1 13.03215980529785 1.091449975967407 12.57750988006592 1.27180004119873 12.1486701965332 L 1.28702437877655 12.11246967315674 L 5.101890087127686 3.952510118484497 L 5.178922653198242 3.78773832321167 C 5.439716339111328 3.304912328720093 5.943906784057617 3 6.5 3 C 7.327099800109863 3 8 3.672899961471558 8 4.5 L 8 5.061999797821045 L 8 6.183760166168213 L 9.114399909973145 6.055439949035645 C 9.454680442810059 6.016250133514404 9.736089706420898 5.998000144958496 10 5.998000144958496 C 10.26076984405518 5.998000144958496 10.54312038421631 6.016039848327637 10.88858032226563 6.054769992828369 L 12 6.179389953613281 L 12 5.060999870300293 L 12 4.5 C 12 3.672899961471558 12.67290019989014 3 13.5 3 C 14.06018733978271 3 14.56766128540039 3.309339284896851 14.82675552368164 3.798352241516113 L 14.89809036254883 3.952470064163208 L 18.64599990844727 11.97018814086914 L 18.64599990844727 11.98406982421875 L 18.72974967956543 12.15236186981201 C 18.90907287597656 12.58011913299561 19 13.03350162506104 19 13.5 C 19 15.42990970611572 17.42991065979004 17 15.5 17 Z M 15.5 10.25 C 13.70794010162354 10.25 12.25 11.70794010162354 12.25 13.5 C 12.25 15.29205989837646 13.70794010162354 16.75 15.5 16.75 C 17.29206085205078 16.75 18.75 15.29205989837646 18.75 13.5 C 18.75 11.70794010162354 17.29206085205078 10.25 15.5 10.25 Z M 4.5 10.25 C 2.707940101623535 10.25 1.25 11.70794010162354 1.25 13.5 C 1.25 15.29205989837646 2.707940101623535 16.75 4.5 16.75 C 6.292059898376465 16.75 7.75 15.29205989837646 7.75 13.5 C 7.75 11.70794010162354 6.292059898376465 10.25 4.5 10.25 Z", stroke: "none" }), jsx("path", { d: "M 13 10.06495571136475 C 13.70204067230225 9.552577972412109 14.56627750396729 9.25 15.5 9.25 C 15.77562522888184 9.25 16.04530715942383 9.276392936706543 16.30645370483398 9.326748847961426 L 13.9340877532959 4.251050472259521 C 13.86002540588379 4.125204086303711 13.71336269378662 4 13.5 4 C 13.22430038452148 4 13 4.224299907684326 13 4.5 L 13 7.297770023345947 L 11.10828113555908 7.085675716400146 C 11.18476295471191 7.096925735473633 11.25709533691406 7.108408451080322 11.32489013671875 7.119569778442383 L 13 7.395349979400635 L 13 10.06495571136475 M 7 10.06495571136475 L 7 7.395349979400635 L 8.67510986328125 7.119569778442383 C 8.725531578063965 7.111268520355225 8.778477668762207 7.102787971496582 8.833767890930176 7.094357490539551 L 7 7.305520057678223 L 7 4.5 C 7 4.224299907684326 6.775700092315674 4 6.5 4 C 6.287984848022461 4 6.141829490661621 4.123627662658691 6.067324161529541 4.248665809631348 L 3.69323992729187 9.326807975769043 C 3.954513072967529 9.276401519775391 4.224231719970703 9.25 4.5 9.25 C 5.433722496032715 9.25 6.297959804534912 9.552577972412109 7 10.06495571136475 M 15.5 18 C 13.01500034332275 18 11 15.98499965667725 11 13.5 L 11 12.11200046539307 C 10.67800045013428 12.03899955749512 10.3430004119873 12 10 12 C 9.656000137329102 12 9.321999549865723 12.03899955749512 9 12.11200046539307 L 9 13.5 C 9 15.98499965667725 6.985000133514404 18 4.5 18 C 2.015000104904175 18 0 15.98499965667725 0 13.5 C 0 12.88300037384033 0.125 12.29599952697754 0.3499999940395355 11.76099967956543 L 0.3479999899864197 11.76099967956543 L 0.3540000021457672 11.74699974060059 L 4.196000099182129 3.526999950408936 C 4.576000213623047 2.630000114440918 5.464000225067139 2 6.5 2 C 7.88100004196167 2 9 3.11899995803833 9 4.5 L 9 5.061999797821045 C 9.329999923706055 5.02400016784668 9.661999702453613 4.998000144958496 10 4.998000144958496 C 10.33800029754639 4.998000144958496 10.67000007629395 5.02400016784668 11 5.060999870300293 L 11 4.5 C 11 3.11899995803833 12.11900043487549 2 13.5 2 C 14.53600025177002 2 15.42399978637695 2.630000114440918 15.80399990081787 3.526999950408936 L 15.80399990081787 3.529000043869019 L 19.65200042724609 11.76099967956543 L 19.64999961853027 11.76099967956543 C 19.875 12.29599952697754 20 12.88300037384033 20 13.5 C 20 15.98499965667725 17.98500061035156 18 15.5 18 Z M 15.5 11.25 C 14.25899982452393 11.25 13.25 12.25899982452393 13.25 13.5 C 13.25 14.74100017547607 14.25899982452393 15.75 15.5 15.75 C 16.74099922180176 15.75 17.75 14.74100017547607 17.75 13.5 C 17.75 12.25899982452393 16.74099922180176 11.25 15.5 11.25 Z M 4.5 11.25 C 3.259000062942505 11.25 2.25 12.25899982452393 2.25 13.5 C 2.25 14.74100017547607 3.259000062942505 15.75 4.5 15.75 C 5.741000175476074 15.75 6.75 14.74100017547607 6.75 13.5 C 6.75 12.25899982452393 5.741000175476074 11.25 4.5 11.25 Z M 10 8.998000144958496 C 9.659999847412109 8.998000144958496 9.328000068664551 9.038999557495117 9 9.093000411987305 L 9 10.07699966430664 C 9.326000213623047 10.02600002288818 9.659999847412109 10 10 10 C 10.34000015258789 10 10.67399978637695 10.02600002288818 11 10.07600021362305 L 11 9.093000411987305 C 10.67199993133545 9.038999557495117 10.34000015258789 8.998000144958496 10 8.998000144958496 Z", fill: "currentColor", stroke: "none" })] })] }) }));
|
|
34203
34215
|
}
|
|
34204
34216
|
|
|
34217
|
+
function Phone({ color, size, ...nativeProps }) {
|
|
34218
|
+
return (jsx(IconBox, { "$color": color, "$size": size, children: jsxs("svg", { height: "20", viewBox: "0 0 20 20", width: "20", ...nativeProps, children: [jsx("clipPath", { children: jsx("path", { d: "m0 0h20v20h-20z" }) }), jsx("clipPath", { children: jsx("path", { d: "m0 0h20v20h-20z" }) }), jsxs("g", { clipPath: "url(#b)", children: [jsx("path", { d: "m0 0h20v20h-20z", fill: "#fff" }), jsx("g", { clipPath: "url(#a)", children: jsx("path", { d: "m13.719 12.5 3.54.984a1.02 1.02 0 0 1 .735 1.1 3.526 3.526 0 0 1 -.987 2.257c-2.147 2.141-6.286 1.428-10.773-3.067s-5.223-8.662-3.076-10.784a3.647 3.647 0 0 1 2.263-.984 1.052 1.052 0 0 1 1.1.733l.986 3.53a1.034 1.034 0 0 1 -.345 1.081l-1.1.868a.719.719 0 0 0 -.155.964 18 18 0 0 0 2.263 2.662 20.743 20.743 0 0 0 2.667 2.256.709.709 0 0 0 .967-.154l.871-1.1a.926.926 0 0 1 1.044-.347", fill: "currentColor" }) })] })] }) }));
|
|
34219
|
+
}
|
|
34220
|
+
|
|
34205
34221
|
function Pin({ color, size, ...nativeProps }) {
|
|
34206
34222
|
return (jsx(IconBox, { "$color": color, "$size": size, children: jsx("svg", { height: "20", viewBox: "0 0 20 20", width: "20", ...nativeProps, children: jsxs("g", { transform: "translate(-240)", children: [jsx("path", { d: "M250.94,2l-1.412,1.412.706.707L246.7,7.65h-2.824l-1.412,1.413,3.518,3.52-3.985,4L243.413,18l3.985-4,3.54,3.542,1.413-1.412V13.3l3.531-3.531.706.706L258,9.064Zm0,9.888v2.825l-5.648-5.651h2.824l3.531-3.531,2.824,2.825Z", fill: "currentColor" }), jsx("rect", { fill: "none", height: "20", transform: "translate(240)", width: "20" })] }) }) }));
|
|
34207
34223
|
}
|
|
@@ -34234,6 +34250,10 @@ function Report({ color, size, ...nativeProps }) {
|
|
|
34234
34250
|
return (jsx(IconBox, { "$color": color, "$size": size, children: jsxs("svg", { height: "20", viewBox: "0 0 20 20", width: "20", ...nativeProps, children: [jsx("rect", { fill: "none", height: "20", width: "20" }), jsx("path", { d: "M-143,6.6-155,1V19h2V11.453Z", fill: "currentColor", transform: "translate(160)" })] }) }));
|
|
34235
34251
|
}
|
|
34236
34252
|
|
|
34253
|
+
function Rescue({ color, size, ...nativeProps }) {
|
|
34254
|
+
return (jsx(IconBox, { "$color": color, "$size": size, children: jsxs("svg", { height: "20", viewBox: "0 0 20 20", width: "20", ...nativeProps, children: [jsx("clipPath", { children: jsx("path", { d: "m0 0h20v20h-20z" }) }), jsx("clipPath", { children: jsx("path", { d: "m0 0h20v20h-20z" }) }), jsxs("g", { clipPath: "url(#b)", children: [jsx("path", { d: "m0 0h20v20h-20z", fill: "#fff" }), jsx("g", { clipPath: "url(#a)", children: jsx("path", { d: "m10 1a9 9 0 1 0 9 9 9 9 0 0 0 -9-9m6.7 7h-2.122a5.014 5.014 0 0 0 -2.578-2.578v-2.122a7.022 7.022 0 0 1 4.7 4.7m-6.7 5a3 3 0 1 1 3-3 3 3 0 0 1 -3 3m-2-9.7v2.122a5.014 5.014 0 0 0 -2.578 2.578h-2.122a7.022 7.022 0 0 1 4.7-4.7m-4.7 8.7h2.122a5.014 5.014 0 0 0 2.578 2.578v2.122a7.024 7.024 0 0 1 -4.7-4.7m8.7 4.7v-2.122a5.014 5.014 0 0 0 2.578-2.578h2.122a7.024 7.024 0 0 1 -4.7 4.7", fill: "currentColor" }) })] })] }) }));
|
|
34255
|
+
}
|
|
34256
|
+
|
|
34237
34257
|
function Reset({ color, size, ...nativeProps }) {
|
|
34238
34258
|
return (jsx(IconBox, { "$color": color, "$size": size, children: jsxs("svg", { height: "20", viewBox: "0 0 20 20", width: "20", ...nativeProps, children: [jsx("path", { d: "M0,0H20V20H0Z", fill: "none" }), jsxs("g", { children: [jsx("path", { d: "M17.37,15.155A8.992,8.992,0,0,0,4.124,3.192l1,1.793,0,.01A6.993,6.993,0,0,1,17,10H14.495l1.75,3.142-.012.028.017-.019.92,1.653.2.361Z", fill: "currentColor" }), jsx("path", { d: "M14.888,15A6.994,6.994,0,0,1,3,10H5.505L3.756,6.856l.01-.023-.015.014-.373-.67L2.634,4.838h0l0-.006v.011A8.992,8.992,0,0,0,15.877,16.806l-1-1.792Z", fill: "currentColor" })] })] }) }));
|
|
34239
34259
|
}
|
|
@@ -34330,6 +34350,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
34330
34350
|
Chevron: Chevron,
|
|
34331
34351
|
Clock: Clock,
|
|
34332
34352
|
Close: Close,
|
|
34353
|
+
Comment: Comment,
|
|
34333
34354
|
Confirm: Confirm,
|
|
34334
34355
|
Control: Control,
|
|
34335
34356
|
ControlUnit: ControlUnit,
|
|
@@ -34367,6 +34388,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
34367
34388
|
More: More,
|
|
34368
34389
|
Note: Note,
|
|
34369
34390
|
Observation: Observation,
|
|
34391
|
+
Phone: Phone,
|
|
34370
34392
|
Pin: Pin,
|
|
34371
34393
|
PinFilled: PinFilled,
|
|
34372
34394
|
Pinpoint: Pinpoint,
|
|
@@ -34375,6 +34397,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
34375
34397
|
Plus: Plus,
|
|
34376
34398
|
Reject: Reject,
|
|
34377
34399
|
Report: Report,
|
|
34400
|
+
Rescue: Rescue,
|
|
34378
34401
|
Reset: Reset,
|
|
34379
34402
|
Save: Save,
|
|
34380
34403
|
Search: Search$1,
|
|
@@ -67221,7 +67244,7 @@ const StyledInput$1 = styled(Input) `
|
|
|
67221
67244
|
}
|
|
67222
67245
|
`;
|
|
67223
67246
|
|
|
67224
|
-
function TextInput({ className, error, Icon, isErrorMessageHidden = false, isLabelHidden = false, isLight = false, isUndefinedWhenDisabled = false, label, onChange, size = Size.NORMAL, style, value, ...originalProps }) {
|
|
67247
|
+
function TextInput({ className, error, Icon, isErrorMessageHidden = false, isLabelHidden = false, isLight = false, isUndefinedWhenDisabled = false, label, onChange, size = Size.NORMAL, style, type = 'text', value, ...originalProps }) {
|
|
67225
67248
|
const controlledClassname = useMemo(() => classnames('Field-TextInput', className), [className]);
|
|
67226
67249
|
const controlledError = useMemo(() => normalizeString(error), [error]);
|
|
67227
67250
|
const hasError = useMemo(() => Boolean(controlledError), [controlledError]);
|
|
@@ -67234,7 +67257,7 @@ function TextInput({ className, error, Icon, isErrorMessageHidden = false, isLab
|
|
|
67234
67257
|
onChange(normalizedNextValue);
|
|
67235
67258
|
}, [onChange]);
|
|
67236
67259
|
useFieldUndefineEffect(isUndefinedWhenDisabled && originalProps.disabled, onChange);
|
|
67237
|
-
return (jsxs(Field$2, { className: controlledClassname, style: style, children: [jsx(Label, { disabled: originalProps.disabled, hasError: hasError, htmlFor: originalProps.name, isHidden: isLabelHidden, children: label }), jsxs(InputBox, { "$size": size, children: [jsx(StyledInput, { "$hasError": hasError, "$hasIcon": !!Icon, "$isLight": isLight, "$size": size, id: originalProps.name, onChange: handleChange, type:
|
|
67260
|
+
return (jsxs(Field$2, { className: controlledClassname, style: style, children: [jsx(Label, { disabled: originalProps.disabled, hasError: hasError, htmlFor: originalProps.name, isHidden: isLabelHidden, children: label }), jsxs(InputBox, { "$size": size, children: [jsx(StyledInput, { "$hasError": hasError, "$hasIcon": !!Icon, "$isLight": isLight, "$size": size, id: originalProps.name, onChange: handleChange, type: type, value: value || '', ...originalProps }, key), Icon && jsx(Icon, { color: THEME.color.slateGray })] }), !isErrorMessageHidden && hasError && jsx(FieldError, { children: controlledError })] }));
|
|
67238
67261
|
}
|
|
67239
67262
|
const PADDING = {
|
|
67240
67263
|
[Size.LARGE]: '8px 16px 11px',
|