@mtes-mct/monitor-ui 5.8.1 → 5.9.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [5.9.0](https://github.com/MTES-MCT/monitor-ui/compare/v5.8.1...v5.9.0) (2023-05-05)
2
+
3
+
4
+ ### Features
5
+
6
+ * **components:** add Dialog ([89057d2](https://github.com/MTES-MCT/monitor-ui/commit/89057d25674f76b8298fc432a6bd1f521b25f605))
7
+
8
+ ## [5.8.1](https://github.com/MTES-MCT/monitor-ui/compare/v5.8.0...v5.8.1) (2023-05-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **fields:** add missing isUndefinedWhenDisabled prop to DatePicker & DateRangePicker ([17ba4f8](https://github.com/MTES-MCT/monitor-ui/commit/17ba4f8a60204c9a297d59c167c0ae2d872070cf))
14
+
1
15
  # [5.8.0](https://github.com/MTES-MCT/monitor-ui/compare/v5.7.1...v5.8.0) (2023-05-04)
2
16
 
3
17
 
@@ -0,0 +1 @@
1
+ export declare const Action: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1 @@
1
+ export declare const Body: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1 @@
1
+ export declare const Title: import("styled-components").StyledComponent<"h4", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,16 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export type DialogProps = HTMLAttributes<HTMLDivElement> & {
3
+ isAbsolute?: boolean;
4
+ };
5
+ export declare function RawDialog({ children, className, isAbsolute, ...nativeProps }: DialogProps): JSX.Element;
6
+ export declare namespace RawDialog {
7
+ var displayName: string;
8
+ }
9
+ export declare const Box: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
10
+ $isAbsolute: boolean;
11
+ }, never>;
12
+ export declare const Dialog: typeof RawDialog & {
13
+ Action: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
14
+ Body: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
15
+ Title: import("styled-components").StyledComponent<"h4", import("styled-components").DefaultTheme, {}, never>;
16
+ };
@@ -16,7 +16,7 @@ export type NumberInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'defa
16
16
  onPrevious?: (() => Promisable<void>) | undefined;
17
17
  size: number;
18
18
  };
19
- export declare const NumberInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "pattern" | "defaultValue" | "onInput" | "type" | "maxLength"> & {
19
+ export declare const NumberInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "pattern" | "type" | "defaultValue" | "onInput" | "maxLength"> & {
20
20
  isLight: boolean;
21
21
  max: number;
22
22
  min: number;
package/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export { GlobalStyle } from './GlobalStyle';
10
10
  export { OnlyFontGlobalStyle } from './OnlyFontGlobalStyle';
11
11
  export { THEME } from './theme';
12
12
  export { ThemeProvider } from './ThemeProvider';
13
+ export { Dialog } from './components/Dialog';
13
14
  export { Dropdown } from './components/Dropdown';
14
15
  export { NewWindow } from './components/NewWindow';
15
16
  export { SingleTag } from './components/SingleTag';
@@ -65,6 +66,7 @@ export { isNumeric } from './utils/isNumeric';
65
66
  export { stopMouseEventPropagation } from './utils/stopMouseEventPropagation';
66
67
  export type { PartialTheme, Theme } from './theme';
67
68
  export type { Coordinates, DateAsStringRange, DateRange, Defined, IconProps, Option, OptionValueType, Undefine } from './types';
69
+ export type { DialogProps } from './components/Dialog';
68
70
  export type { DropdownProps, DropdownItemProps } from './components/Dropdown';
69
71
  export type { NewWindowProps } from './components/NewWindow';
70
72
  export type { SingleTagProps } from './components/SingleTag';
package/index.js CHANGED
@@ -2163,6 +2163,173 @@ function ThemeProvider({ children, theme = {} }) {
2163
2163
  return jsx(UntypedStyledComponentsThemeProvider, { theme: finalTheme, children: children });
2164
2164
  }
2165
2165
 
2166
+ var classnames = {exports: {}};
2167
+
2168
+ /*!
2169
+ Copyright (c) 2018 Jed Watson.
2170
+ Licensed under the MIT License (MIT), see
2171
+ http://jedwatson.github.io/classnames
2172
+ */
2173
+
2174
+ (function (module) {
2175
+ /* global define */
2176
+
2177
+ (function () {
2178
+
2179
+ var hasOwn = {}.hasOwnProperty;
2180
+
2181
+ function classNames() {
2182
+ var classes = [];
2183
+
2184
+ for (var i = 0; i < arguments.length; i++) {
2185
+ var arg = arguments[i];
2186
+ if (!arg) continue;
2187
+
2188
+ var argType = typeof arg;
2189
+
2190
+ if (argType === 'string' || argType === 'number') {
2191
+ classes.push(arg);
2192
+ } else if (Array.isArray(arg)) {
2193
+ if (arg.length) {
2194
+ var inner = classNames.apply(null, arg);
2195
+ if (inner) {
2196
+ classes.push(inner);
2197
+ }
2198
+ }
2199
+ } else if (argType === 'object') {
2200
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
2201
+ classes.push(arg.toString());
2202
+ continue;
2203
+ }
2204
+
2205
+ for (var key in arg) {
2206
+ if (hasOwn.call(arg, key) && arg[key]) {
2207
+ classes.push(key);
2208
+ }
2209
+ }
2210
+ }
2211
+ }
2212
+
2213
+ return classes.join(' ');
2214
+ }
2215
+
2216
+ if (module.exports) {
2217
+ classNames.default = classNames;
2218
+ module.exports = classNames;
2219
+ } else {
2220
+ window.classNames = classNames;
2221
+ }
2222
+ }());
2223
+ } (classnames));
2224
+
2225
+ var classnamesExports = classnames.exports;
2226
+ var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
2227
+
2228
+ const Action = styled.div `
2229
+ background-color: ${p => p.theme.color.white};
2230
+ border-bottom-left-radius: 2px;
2231
+ border-bottom-right-radius: 2px;
2232
+ display: flex;
2233
+ flex-direction: column-reverse;
2234
+ padding: 8px 8px 8px 8px;
2235
+ @media (min-width: 740px) {
2236
+ align-items: center;
2237
+ flex-direction: row;
2238
+ justify-content: center;
2239
+ padding: 48px 8px 48px 8px;
2240
+ }
2241
+
2242
+ > button {
2243
+ margin-bottom: 2px;
2244
+ }
2245
+ @media (min-width: 740px) {
2246
+ > button {
2247
+ margin-bottom: 0;
2248
+ margin-right: 2px;
2249
+ }
2250
+ }
2251
+ `;
2252
+
2253
+ const Body = styled.div `
2254
+ background-color: ${p => p.theme.color.white};
2255
+ border-top-left-radius: 2px;
2256
+ border-top-right-radius: 2px;
2257
+ display: flex;
2258
+ flex-direction: column;
2259
+ padding: 8px 8px 8px 8px;
2260
+ text-align: center;
2261
+ @media (min-width: 740px) {
2262
+ padding: 48px 8px 8px 8px;
2263
+ text-align: center;
2264
+ }
2265
+
2266
+ > p {
2267
+ color: ${p => p.theme.color.slateGray};
2268
+ padding-top: 2px;
2269
+ }
2270
+ `;
2271
+
2272
+ const Title = styled.h4 `
2273
+ font-size: 125%;
2274
+ font-weight: 500;
2275
+ line-height: 48px;
2276
+ padding-bottom: 2px;
2277
+ height: 48px;
2278
+ color: ${p => p.theme.color.white};
2279
+ background-color: ${p => p.theme.color.charcoal};
2280
+ text-align: center;
2281
+ `;
2282
+
2283
+ function stopMouseEventPropagation(event) {
2284
+ event.stopPropagation();
2285
+ }
2286
+
2287
+ function RawDialog({ children, className, isAbsolute = false, ...nativeProps }) {
2288
+ const controlledClassName = useMemo(() => classNames('Component-Dialog', className), [className]);
2289
+ return (jsxs(Box$g, { "$isAbsolute": isAbsolute, className: controlledClassName, ...nativeProps, onClick: stopMouseEventPropagation, children: [jsx(Overlay, { "$isAbsolute": isAbsolute }), jsx(Window, { "$isAbsolute": isAbsolute, children: children })] }));
2290
+ }
2291
+ const Box$g = styled.div `
2292
+ position: ${p => (p.$isAbsolute ? 'absolute' : 'fixed')};
2293
+ top: 0;
2294
+ bottom: 0;
2295
+ right: 0;
2296
+ left: 0;
2297
+ display: flex;
2298
+ justify-content: center;
2299
+ align-items: center;
2300
+ overflow-y: auto;
2301
+ z-index: 9000;
2302
+ `;
2303
+ const Overlay = styled.div `
2304
+ background-color: ${p => p.theme.color.charcoal};
2305
+ bottom: 0;
2306
+ left: 0;
2307
+ opacity: 0.53;
2308
+ position: ${p => (p.$isAbsolute ? 'absolute' : 'fixed')};
2309
+ right: 0;
2310
+ top: 0;
2311
+ z-index: 1;
2312
+ `;
2313
+ const Window = styled.div `
2314
+ border-radius: 2px;
2315
+ bottom: 100px;
2316
+ box-shadow: 4px;
2317
+ max-width: 32rem;
2318
+ position: ${p => (p.$isAbsolute ? 'absolute' : 'fixed')};
2319
+ width: calc(100% - 2 * 8px);
2320
+ z-index: 1;
2321
+ @media (min-width: 740px) {
2322
+ bottom: auto;
2323
+ min-width: 586px;
2324
+ }
2325
+ `;
2326
+ RawDialog.displayName = 'Dialog';
2327
+ const Dialog = Object.assign(RawDialog, {
2328
+ Action,
2329
+ Body,
2330
+ Title
2331
+ });
2332
+
2166
2333
  function Item({ Icon, ...originalProps }) {
2167
2334
  const icon = useMemo(() => (Icon ? jsx(Icon, { size: 20 }) : undefined), [Icon]);
2168
2335
  const hasIcon = useMemo(() => Boolean(Icon), [Icon]);
@@ -2537,10 +2704,6 @@ function toWindowFeatures(features) {
2537
2704
  .join(',');
2538
2705
  }
2539
2706
 
2540
- function stopMouseEventPropagation(event) {
2541
- event.stopPropagation();
2542
- }
2543
-
2544
2707
  const ICON_SIZE = {
2545
2708
  [Size.LARGE]: 20,
2546
2709
  [Size.NORMAL]: 20,
@@ -3147,68 +3310,6 @@ const StyledIconButton = styled(IconButton) `
3147
3310
  }
3148
3311
  `;
3149
3312
 
3150
- var classnames = {exports: {}};
3151
-
3152
- /*!
3153
- Copyright (c) 2018 Jed Watson.
3154
- Licensed under the MIT License (MIT), see
3155
- http://jedwatson.github.io/classnames
3156
- */
3157
-
3158
- (function (module) {
3159
- /* global define */
3160
-
3161
- (function () {
3162
-
3163
- var hasOwn = {}.hasOwnProperty;
3164
-
3165
- function classNames() {
3166
- var classes = [];
3167
-
3168
- for (var i = 0; i < arguments.length; i++) {
3169
- var arg = arguments[i];
3170
- if (!arg) continue;
3171
-
3172
- var argType = typeof arg;
3173
-
3174
- if (argType === 'string' || argType === 'number') {
3175
- classes.push(arg);
3176
- } else if (Array.isArray(arg)) {
3177
- if (arg.length) {
3178
- var inner = classNames.apply(null, arg);
3179
- if (inner) {
3180
- classes.push(inner);
3181
- }
3182
- }
3183
- } else if (argType === 'object') {
3184
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
3185
- classes.push(arg.toString());
3186
- continue;
3187
- }
3188
-
3189
- for (var key in arg) {
3190
- if (hasOwn.call(arg, key) && arg[key]) {
3191
- classes.push(key);
3192
- }
3193
- }
3194
- }
3195
- }
3196
-
3197
- return classes.join(' ');
3198
- }
3199
-
3200
- if (module.exports) {
3201
- classNames.default = classNames;
3202
- module.exports = classNames;
3203
- } else {
3204
- window.classNames = classNames;
3205
- }
3206
- }());
3207
- } (classnames));
3208
-
3209
- var classnamesExports = classnames.exports;
3210
- var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
3211
-
3212
3313
  const Field$2 = styled.div.attrs(props => ({
3213
3314
  className: classNames('Element-Field', props.className)
3214
3315
  })) `
@@ -32448,5 +32549,5 @@ function useNewWindow() {
32448
32549
  return contextValue;
32449
32550
  }
32450
32551
 
32451
- export { Accent, Button, Checkbox, CoordinatesFormat, CoordinatesInput, DatePicker, DateRangePicker, Dropdown, Field$2 as Field, Fieldset, FormikCheckbox, FormikCoordinatesInput, FormikDatePicker, FormikDateRangePicker, FormikEffect, FormikMultiCheckbox, FormikMultiRadio, FormikMultiSelect, FormikNumberInput, FormikSearch, FormikSelect, FormikTextInput, FormikTextarea, GlobalStyle, index as Icon, IconButton, Label, Legend, MultiCheckbox, MultiRadio, MultiSelect, MultiZoneEditor, NewWindow, NewWindowContext, NumberInput, OPENLAYERS_PROJECTION, OnlyFontGlobalStyle, Search, Select, SimpleTable, SingleTag, Size, THEME, Tag, TagBullet, TagGroup, TextInput, Textarea, ThemeProvider, WSG84_PROJECTION, coordinatesAreDistinct, customDayjs, getCoordinates, getLocalizedDayjs, getPseudoRandomString, getUtcizedDayjs, isNumeric, noop, stopMouseEventPropagation, useClickOutsideEffect, useFieldControl, useForceUpdate, useKey, useNewWindow, usePrevious };
32552
+ export { Accent, Button, Checkbox, CoordinatesFormat, CoordinatesInput, DatePicker, DateRangePicker, Dialog, Dropdown, Field$2 as Field, Fieldset, FormikCheckbox, FormikCoordinatesInput, FormikDatePicker, FormikDateRangePicker, FormikEffect, FormikMultiCheckbox, FormikMultiRadio, FormikMultiSelect, FormikNumberInput, FormikSearch, FormikSelect, FormikTextInput, FormikTextarea, GlobalStyle, index as Icon, IconButton, Label, Legend, MultiCheckbox, MultiRadio, MultiSelect, MultiZoneEditor, NewWindow, NewWindowContext, NumberInput, OPENLAYERS_PROJECTION, OnlyFontGlobalStyle, Search, Select, SimpleTable, SingleTag, Size, THEME, Tag, TagBullet, TagGroup, TextInput, Textarea, ThemeProvider, WSG84_PROJECTION, coordinatesAreDistinct, customDayjs, getCoordinates, getLocalizedDayjs, getPseudoRandomString, getUtcizedDayjs, isNumeric, noop, stopMouseEventPropagation, useClickOutsideEffect, useFieldControl, useForceUpdate, useKey, useNewWindow, usePrevious };
32452
32553
  //# sourceMappingURL=index.js.map