@mtes-mct/monitor-ui 5.8.1 → 5.9.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 CHANGED
@@ -1,3 +1,10 @@
1
+ ## [5.8.1](https://github.com/MTES-MCT/monitor-ui/compare/v5.8.0...v5.8.1) (2023-05-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **fields:** add missing isUndefinedWhenDisabled prop to DatePicker & DateRangePicker ([17ba4f8](https://github.com/MTES-MCT/monitor-ui/commit/17ba4f8a60204c9a297d59c167c0ae2d872070cf))
7
+
1
8
  # [5.8.0](https://github.com/MTES-MCT/monitor-ui/compare/v5.7.1...v5.8.0) (2023-05-04)
2
9
 
3
10
 
@@ -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 type { HTMLAttributes } from 'react';
2
+ export type DialogProps = HTMLAttributes<HTMLDivElement> & {
3
+ isAbsolute?: boolean;
4
+ };
5
+ export declare function RawDialog({ children, 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,106 @@ function ThemeProvider({ children, theme = {} }) {
2163
2163
  return jsx(UntypedStyledComponentsThemeProvider, { theme: finalTheme, children: children });
2164
2164
  }
2165
2165
 
2166
+ const Action = styled.div `
2167
+ background-color: ${p => p.theme.color.white};
2168
+ border-bottom-left-radius: 2px;
2169
+ border-bottom-right-radius: 2px;
2170
+ display: flex;
2171
+ flex-direction: column-reverse;
2172
+ padding: 8px 8px 8px 8px;
2173
+ @media (min-width: 740px) {
2174
+ align-items: center;
2175
+ flex-direction: row;
2176
+ justify-content: center;
2177
+ padding: 48px 8px 48px 8px;
2178
+ }
2179
+
2180
+ > button {
2181
+ margin-bottom: 2px;
2182
+ }
2183
+ @media (min-width: 740px) {
2184
+ > button {
2185
+ margin-bottom: 0;
2186
+ margin-right: 2px;
2187
+ }
2188
+ }
2189
+ `;
2190
+
2191
+ const Body = styled.div `
2192
+ background-color: ${p => p.theme.color.white};
2193
+ border-top-left-radius: 2px;
2194
+ border-top-right-radius: 2px;
2195
+ display: flex;
2196
+ flex-direction: column;
2197
+ padding: 8px 8px 8px 8px;
2198
+ text-align: center;
2199
+ @media (min-width: 740px) {
2200
+ padding: 48px 8px 8px 8px;
2201
+ text-align: center;
2202
+ }
2203
+
2204
+ > p {
2205
+ color: ${p => p.theme.color.slateGray};
2206
+ padding-top: 2px;
2207
+ }
2208
+ `;
2209
+
2210
+ const Title = styled.h4 `
2211
+ font-size: 125%;
2212
+ font-weight: 500;
2213
+ line-height: 48px;
2214
+ padding-bottom: 2px;
2215
+ height: 48px;
2216
+ color: ${p => p.theme.color.white};
2217
+ background-color: ${p => p.theme.color.charcoal};
2218
+ text-align: center;
2219
+ `;
2220
+
2221
+ function RawDialog({ children, isAbsolute = false, ...nativeProps }) {
2222
+ return (jsxs(Box$g, { "$isAbsolute": isAbsolute, ...nativeProps, onClick: e => e.stopPropagation(), children: [jsx(Overlay, { "$isAbsolute": isAbsolute }), jsx(Window, { "$isAbsolute": isAbsolute, children: children })] }));
2223
+ }
2224
+ const Box$g = styled.div `
2225
+ position: ${p => (p.$isAbsolute ? 'absolute' : 'fixed')};
2226
+ top: 0;
2227
+ bottom: 0;
2228
+ right: 0;
2229
+ left: 0;
2230
+ display: flex;
2231
+ justify-content: center;
2232
+ align-items: center;
2233
+ overflow-y: auto;
2234
+ z-index: 9000;
2235
+ `;
2236
+ const Overlay = styled.div `
2237
+ background-color: ${p => p.theme.color.charcoal};
2238
+ bottom: 0;
2239
+ left: 0;
2240
+ opacity: 0.53;
2241
+ position: ${p => (p.$isAbsolute ? 'absolute' : 'fixed')};
2242
+ right: 0;
2243
+ top: 0;
2244
+ z-index: 1;
2245
+ `;
2246
+ const Window = styled.div `
2247
+ border-radius: 2px;
2248
+ bottom: 100px;
2249
+ box-shadow: 4px;
2250
+ max-width: 32rem;
2251
+ position: ${p => (p.$isAbsolute ? 'absolute' : 'fixed')};
2252
+ width: calc(100% - 2 * 8px);
2253
+ z-index: 1;
2254
+ @media (min-width: 740px) {
2255
+ bottom: auto;
2256
+ min-width: 586px;
2257
+ }
2258
+ `;
2259
+ RawDialog.displayName = 'Dialog';
2260
+ const Dialog = Object.assign(RawDialog, {
2261
+ Action,
2262
+ Body,
2263
+ Title
2264
+ });
2265
+
2166
2266
  function Item({ Icon, ...originalProps }) {
2167
2267
  const icon = useMemo(() => (Icon ? jsx(Icon, { size: 20 }) : undefined), [Icon]);
2168
2268
  const hasIcon = useMemo(() => Boolean(Icon), [Icon]);
@@ -32448,5 +32548,5 @@ function useNewWindow() {
32448
32548
  return contextValue;
32449
32549
  }
32450
32550
 
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 };
32551
+ 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
32552
  //# sourceMappingURL=index.js.map