@mtes-mct/monitor-ui 22.1.0 → 23.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.
- package/CHANGELOG.md +31 -0
- package/components/Dialog/Body.d.ts.map +1 -1
- package/elements/Fieldset.d.ts.map +1 -1
- package/elements/Label.d.ts +1 -1
- package/elements/Legend.d.ts +7 -7
- package/elements/Legend.d.ts.map +1 -1
- package/fields/NumberInput.d.ts +2 -1
- package/fields/NumberInput.d.ts.map +1 -1
- package/index.js +87 -35
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
## [23.0.0](https://github.com/MTES-MCT/monitor-ui/compare/v22.1.0...v23.0.0) (2024-09-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### ⚠ BREAKING CHANGES
|
|
5
|
+
|
|
6
|
+
* **elements:** - `disabled` is renamed `$isDisabled` in `Legend` props.
|
|
7
|
+
- `hasError` is renamed `$hasError` in `Legend` props.
|
|
8
|
+
- `isHidden` is renamed `$isHidden` in `Legend` props.
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **elements:** prefix styled component props in Legend ([ef4284a](https://github.com/MTES-MCT/monitor-ui/commit/ef4284a50dee68cdb6c65308d2ae42da2798efdf))
|
|
13
|
+
* **fields:** prefix styled components props in DateRangePicker ([3572267](https://github.com/MTES-MCT/monitor-ui/commit/3572267c6e285d87f7c9efd006bf7c0daf592a5e))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Buid System & Dependencies
|
|
17
|
+
|
|
18
|
+
* **deps:** bump express from 4.19.2 to 4.21.0 ([46d1134](https://github.com/MTES-MCT/monitor-ui/commit/46d113401e48191f59f9c8e309761ba2e44ccbb0))
|
|
19
|
+
|
|
20
|
+
## [22.1.0](https://github.com/MTES-MCT/monitor-ui/compare/v22.0.1...v22.1.0) (2024-09-12)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* **icons:** add bullseye icon ([1f76116](https://github.com/MTES-MCT/monitor-ui/commit/1f76116bf996528e4d548479996cf47e78d2453d))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Buid System & Dependencies
|
|
29
|
+
|
|
30
|
+
* **dev-deps:** bump the all-non-major-dependencies group across 1 directory with 5 updates ([52dabbf](https://github.com/MTES-MCT/monitor-ui/commit/52dabbfed940b787a9fb1490f0696595291d5f6e))
|
|
31
|
+
|
|
1
32
|
## [22.0.1](https://github.com/MTES-MCT/monitor-ui/compare/v22.0.0...v22.0.1) (2024-09-09)
|
|
2
33
|
|
|
3
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Body.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Body.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;
|
|
1
|
+
{"version":3,"file":"Body.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Body.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;aACN,MAAM;SAkBhB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fieldset.d.ts","sourceRoot":"","sources":["../../src/elements/Fieldset.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,sBAAsB,EAAW,MAAM,OAAO,CAAA;AAK5D,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,EAAE,cAAc,GAAG,UAAU,GAAG,OAAO,CAAC,GAAG;IACrH,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACpC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAChC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B,CAAA;AACD,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,SAAS,EACT,SAAiB,EACjB,QAAgB,EAChB,cAAsB,EACtB,OAAe,EACf,UAAkB,EAClB,MAAM,EACN,GAAG,WAAW,EACf,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"Fieldset.d.ts","sourceRoot":"","sources":["../../src/elements/Fieldset.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,sBAAsB,EAAW,MAAM,OAAO,CAAA;AAK5D,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,EAAE,cAAc,GAAG,UAAU,GAAG,OAAO,CAAC,GAAG;IACrH,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACpC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAChC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B,CAAA;AACD,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,SAAS,EACT,SAAiB,EACjB,QAAgB,EAChB,cAAsB,EACtB,OAAe,EACf,UAAkB,EAClB,MAAM,EACN,GAAG,WAAW,EACf,EAAE,aAAa,2CAqBf"}
|
package/elements/Label.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ export declare const Label: import("styled-components").StyledComponent<"label",
|
|
|
10
10
|
$idDisabled?: boolean | undefined;
|
|
11
11
|
$isHidden?: boolean | undefined;
|
|
12
12
|
$isRequired?: boolean | undefined;
|
|
13
|
-
}, keyof LabelHTMLAttributes<HTMLLabelElement> | "$isHidden" | "$
|
|
13
|
+
}, keyof LabelHTMLAttributes<HTMLLabelElement> | "$isHidden" | "$hasError" | "$isRequired" | "$idDisabled">;
|
|
14
14
|
//# sourceMappingURL=Label.d.ts.map
|
package/elements/Legend.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react';
|
|
2
2
|
export type LegendProps = HTMLAttributes<HTMLLegendElement> & {
|
|
3
|
+
$disabled?: boolean | undefined;
|
|
4
|
+
$hasError?: boolean | undefined;
|
|
5
|
+
$isHidden?: boolean | undefined;
|
|
3
6
|
$isRequired?: boolean | undefined;
|
|
4
|
-
disabled?: boolean | undefined;
|
|
5
|
-
hasError?: boolean | undefined;
|
|
6
|
-
isHidden?: boolean | undefined;
|
|
7
7
|
};
|
|
8
8
|
export declare const Legend: import("styled-components").StyledComponent<"legend", import("styled-components").DefaultTheme, HTMLAttributes<HTMLLegendElement> & {
|
|
9
|
+
$disabled?: boolean | undefined;
|
|
10
|
+
$hasError?: boolean | undefined;
|
|
11
|
+
$isHidden?: boolean | undefined;
|
|
9
12
|
$isRequired?: boolean | undefined;
|
|
10
|
-
|
|
11
|
-
hasError?: boolean | undefined;
|
|
12
|
-
isHidden?: boolean | undefined;
|
|
13
|
-
}, "disabled" | keyof HTMLAttributes<HTMLLegendElement> | "isHidden" | "$isRequired" | "hasError">;
|
|
13
|
+
}, keyof HTMLAttributes<HTMLLegendElement> | "$isHidden" | "$disabled" | "$hasError" | "$isRequired">;
|
|
14
14
|
//# sourceMappingURL=Legend.d.ts.map
|
package/elements/Legend.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../src/elements/Legend.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG;IAC5D,
|
|
1
|
+
{"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../src/elements/Legend.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG;IAC5D,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAClC,CAAA;AACD,eAAO,MAAM,MAAM;gBALL,OAAO,GAAG,SAAS;gBACnB,OAAO,GAAG,SAAS;gBACnB,OAAO,GAAG,SAAS;kBACjB,OAAO,GAAG,SAAS;qGAoBlC,CAAA"}
|
package/fields/NumberInput.d.ts
CHANGED
|
@@ -14,7 +14,8 @@ export type NumberInputProps = Omit<InputProps, 'as' | 'defaultValue' | 'id' | '
|
|
|
14
14
|
name: string;
|
|
15
15
|
onChange?: (nextValue: number | undefined) => Promisable<void>;
|
|
16
16
|
readOnly?: boolean | undefined;
|
|
17
|
+
unit?: string | undefined;
|
|
17
18
|
value?: number | undefined;
|
|
18
19
|
};
|
|
19
|
-
export declare function NumberInput({ areArrowsHidden, className, disabled, error, isErrorMessageHidden, isLabelHidden, isLight, isRequired, isTransparent, isUndefinedWhenDisabled, label, name, onBlur, onChange, onFocus, readOnly, style, value, ...originalProps }: NumberInputProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function NumberInput({ areArrowsHidden, className, disabled, error, isErrorMessageHidden, isLabelHidden, isLight, isRequired, isTransparent, isUndefinedWhenDisabled, label, name, onBlur, onChange, onFocus, readOnly, style, unit, value, ...originalProps }: NumberInputProps): import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
//# sourceMappingURL=NumberInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["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L,oBAA4B,EAC5B,aAAqB,EACrB,OAAe,EACf,UAAkB,EAClB,aAAqB,EACrB,uBAA+B,EAC/B,KAAK,EACL,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAgB,EAChB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,GAAG,aAAa,EACjB,EAAE,gBAAgB,2CA6FlB"}
|
package/index.js
CHANGED
|
@@ -54394,8 +54394,8 @@ const Legend = styled.legend.attrs((props)=>({
|
|
|
54394
54394
|
className: classnames('Element-Legend', props.className)
|
|
54395
54395
|
}))`
|
|
54396
54396
|
color: ${(p)=>// eslint-disable-next-line no-nested-ternary
|
|
54397
|
-
p
|
|
54398
|
-
display: ${(p)=>p
|
|
54397
|
+
p.$disabled ? p.theme.color.lightGray : p.$hasError ? p.theme.color.maximumRed : p.theme.color.slateGray};
|
|
54398
|
+
display: ${(p)=>p.$isHidden ? 'none' : 'block'};
|
|
54399
54399
|
font-size: 13px;
|
|
54400
54400
|
line-height: 1.3846;
|
|
54401
54401
|
margin-bottom: 4px;
|
|
@@ -54416,10 +54416,10 @@ function Fieldset({ children, className, hasBorder = false, hasError = false, is
|
|
|
54416
54416
|
...nativeProps,
|
|
54417
54417
|
children: [
|
|
54418
54418
|
legend && /*#__PURE__*/ jsx(Legend, {
|
|
54419
|
+
$disabled: nativeProps.disabled,
|
|
54420
|
+
$hasError: hasError,
|
|
54421
|
+
$isHidden: isLegendHidden,
|
|
54419
54422
|
$isRequired: isRequired,
|
|
54420
|
-
disabled: nativeProps.disabled,
|
|
54421
|
-
hasError: hasError,
|
|
54422
|
-
isHidden: isLegendHidden,
|
|
54423
54423
|
children: legend
|
|
54424
54424
|
}),
|
|
54425
54425
|
/*#__PURE__*/ jsx(InnerBox, {
|
|
@@ -66674,9 +66674,9 @@ function RangedTimePicker({ filter, minutesRange, onChange }) {
|
|
|
66674
66674
|
onClick: stopMouseEventPropagation,
|
|
66675
66675
|
role: "listbox",
|
|
66676
66676
|
children: filteredRangedTimeOptions.map(({ label, value }, index)=>/*#__PURE__*/ jsx(Option, {
|
|
66677
|
+
$isSelected: index === selectedOptionIndex,
|
|
66677
66678
|
"aria-selected": false,
|
|
66678
66679
|
className: "js-ranged-time-picker-option",
|
|
66679
|
-
isSelected: index === selectedOptionIndex,
|
|
66680
66680
|
onClick: ()=>onChange(value),
|
|
66681
66681
|
role: "option",
|
|
66682
66682
|
tabIndex: -1,
|
|
@@ -66715,14 +66715,14 @@ const Box$5 = styled.div`
|
|
|
66715
66715
|
}
|
|
66716
66716
|
`;
|
|
66717
66717
|
const Option = styled.div`
|
|
66718
|
-
background-color: ${(p)=>p
|
|
66719
|
-
color: ${(p)=>p
|
|
66718
|
+
background-color: ${(p)=>p.$isSelected ? p.theme.color.blueGray : 'transparent'};
|
|
66719
|
+
color: ${(p)=>p.$isSelected ? p.theme.color.white : p.theme.color.gunMetal};
|
|
66720
66720
|
cursor: pointer;
|
|
66721
66721
|
line-height: 1;
|
|
66722
66722
|
padding: 8.5px 0 10.5px 8px;
|
|
66723
66723
|
|
|
66724
66724
|
&:hover {
|
|
66725
|
-
background-color: ${(p)=>p
|
|
66725
|
+
background-color: ${(p)=>p.$isSelected ? p.theme.color.blueGray : p.theme.color.blueYonder25};
|
|
66726
66726
|
}
|
|
66727
66727
|
|
|
66728
66728
|
> span {
|
|
@@ -67602,7 +67602,7 @@ readOnly = false, style, withTime = false, ...nativeProps }) {
|
|
|
67602
67602
|
})
|
|
67603
67603
|
}),
|
|
67604
67604
|
withTime && /*#__PURE__*/ jsx(Field, {
|
|
67605
|
-
isTimeField: true,
|
|
67605
|
+
$isTimeField: true,
|
|
67606
67606
|
children: /*#__PURE__*/ jsx(TimeInput, {
|
|
67607
67607
|
ref: startTimeInputRef,
|
|
67608
67608
|
baseContainer: baseContainer ?? undefined,
|
|
@@ -67624,7 +67624,7 @@ readOnly = false, style, withTime = false, ...nativeProps }) {
|
|
|
67624
67624
|
})
|
|
67625
67625
|
}),
|
|
67626
67626
|
/*#__PURE__*/ jsx(Field, {
|
|
67627
|
-
isEndDateField: true,
|
|
67627
|
+
$isEndDateField: true,
|
|
67628
67628
|
children: /*#__PURE__*/ jsx(DateInput, {
|
|
67629
67629
|
ref: endDateInputRef,
|
|
67630
67630
|
baseContainer: baseContainer ?? undefined,
|
|
@@ -67647,7 +67647,7 @@ readOnly = false, style, withTime = false, ...nativeProps }) {
|
|
|
67647
67647
|
})
|
|
67648
67648
|
}),
|
|
67649
67649
|
withTime && /*#__PURE__*/ jsx(Field, {
|
|
67650
|
-
isTimeField: true,
|
|
67650
|
+
$isTimeField: true,
|
|
67651
67651
|
children: /*#__PURE__*/ jsx(TimeInput, {
|
|
67652
67652
|
ref: endTimeInputRef,
|
|
67653
67653
|
baseContainer: baseContainer ?? undefined,
|
|
@@ -67706,10 +67706,10 @@ const Box$2 = styled.div`
|
|
|
67706
67706
|
const Field = styled.span`
|
|
67707
67707
|
font-size: inherit;
|
|
67708
67708
|
margin-left: ${(p)=>{
|
|
67709
|
-
if (p
|
|
67709
|
+
if (p.$isEndDateField) {
|
|
67710
67710
|
return '10px';
|
|
67711
67711
|
}
|
|
67712
|
-
return p
|
|
67712
|
+
return p.$isTimeField ? '2px' : 0;
|
|
67713
67713
|
}} !important;
|
|
67714
67714
|
`;
|
|
67715
67715
|
|
|
@@ -68598,7 +68598,7 @@ const Link = styled.a`
|
|
|
68598
68598
|
}
|
|
68599
68599
|
`;
|
|
68600
68600
|
|
|
68601
|
-
function NumberInput({ areArrowsHidden = false, className, disabled = false, error, isErrorMessageHidden = false, isLabelHidden = false, isLight = false, isRequired = false, isTransparent = false, isUndefinedWhenDisabled = false, label, name, onBlur, onChange, onFocus, readOnly = false, style, value, ...originalProps }) {
|
|
68601
|
+
function NumberInput({ areArrowsHidden = false, className, disabled = false, error, isErrorMessageHidden = false, isLabelHidden = false, isLight = false, isRequired = false, isTransparent = false, isUndefinedWhenDisabled = false, label, name, onBlur, onChange, onFocus, readOnly = false, style, unit, value, ...originalProps }) {
|
|
68602
68602
|
// eslint-disable-next-line no-null/no-null
|
|
68603
68603
|
const inputRef = useRef(null);
|
|
68604
68604
|
const controlledClassname = useMemo(()=>classnames('Field-NumberInput', className), [
|
|
@@ -68645,6 +68645,24 @@ function NumberInput({ areArrowsHidden = false, className, disabled = false, err
|
|
|
68645
68645
|
preventWheelEvent
|
|
68646
68646
|
]);
|
|
68647
68647
|
useFieldUndefineEffect(isUndefinedWhenDisabled && !!disabled, onChange);
|
|
68648
|
+
const commonInputProps = {
|
|
68649
|
+
$areArrowsHidden: areArrowsHidden,
|
|
68650
|
+
$hasError: hasError,
|
|
68651
|
+
$isDisabled: disabled,
|
|
68652
|
+
$isLight: isLight,
|
|
68653
|
+
$isReadOnly: readOnly,
|
|
68654
|
+
$isTransparent: isTransparent,
|
|
68655
|
+
disabled,
|
|
68656
|
+
id: name,
|
|
68657
|
+
onBlur: handleBlur,
|
|
68658
|
+
onChange: handleChange,
|
|
68659
|
+
onFocus: handleFocus,
|
|
68660
|
+
readOnly,
|
|
68661
|
+
ref: inputRef,
|
|
68662
|
+
type: 'number',
|
|
68663
|
+
value: value ?? '',
|
|
68664
|
+
...originalProps
|
|
68665
|
+
};
|
|
68648
68666
|
return /*#__PURE__*/ jsxs(Field$2, {
|
|
68649
68667
|
className: controlledClassname,
|
|
68650
68668
|
style: style,
|
|
@@ -68656,23 +68674,21 @@ function NumberInput({ areArrowsHidden = false, className, disabled = false, err
|
|
|
68656
68674
|
htmlFor: name,
|
|
68657
68675
|
children: label
|
|
68658
68676
|
}),
|
|
68659
|
-
/*#__PURE__*/ jsx(
|
|
68660
|
-
|
|
68661
|
-
|
|
68677
|
+
!unit && /*#__PURE__*/ jsx(InputWithoutUnit, {
|
|
68678
|
+
...commonInputProps
|
|
68679
|
+
}, key),
|
|
68680
|
+
!!unit && /*#__PURE__*/ jsxs(InputBoxWithUnit, {
|
|
68662
68681
|
$hasError: hasError,
|
|
68663
68682
|
$isDisabled: disabled,
|
|
68664
68683
|
$isLight: isLight,
|
|
68665
68684
|
$isReadOnly: readOnly,
|
|
68666
68685
|
$isTransparent: isTransparent,
|
|
68667
|
-
|
|
68668
|
-
|
|
68669
|
-
|
|
68670
|
-
|
|
68671
|
-
|
|
68672
|
-
|
|
68673
|
-
type: "number",
|
|
68674
|
-
value: value ?? '',
|
|
68675
|
-
...originalProps
|
|
68686
|
+
children: [
|
|
68687
|
+
/*#__PURE__*/ jsx(InputWithUnit, {
|
|
68688
|
+
...commonInputProps
|
|
68689
|
+
}),
|
|
68690
|
+
unit
|
|
68691
|
+
]
|
|
68676
68692
|
}, key),
|
|
68677
68693
|
!isErrorMessageHidden && hasError && /*#__PURE__*/ jsx(FieldError, {
|
|
68678
68694
|
children: controlledError
|
|
@@ -68680,9 +68696,7 @@ function NumberInput({ areArrowsHidden = false, className, disabled = false, err
|
|
|
68680
68696
|
]
|
|
68681
68697
|
});
|
|
68682
68698
|
}
|
|
68683
|
-
const
|
|
68684
|
-
background-color: ${getFieldBackgroundColorFactory()};
|
|
68685
|
-
border: solid 1px ${getFieldBorderColorFactoryForState('default')};
|
|
68699
|
+
const BaseInput = styled(Input)`
|
|
68686
68700
|
border-radius: 0;
|
|
68687
68701
|
color: ${(p)=>p.theme.color.gunMetal};
|
|
68688
68702
|
${(p)=>p.$isReadOnly && `cursor: default;`}
|
|
@@ -68707,9 +68721,6 @@ const StyledInput = styled(Input)`
|
|
|
68707
68721
|
}
|
|
68708
68722
|
|
|
68709
68723
|
&:hover {
|
|
68710
|
-
background-color: ${getFieldBackgroundColorFactory()};
|
|
68711
|
-
border: solid 1px ${getFieldBorderColorFactoryForState('hover')} !important;
|
|
68712
|
-
|
|
68713
68724
|
&::placeholder {
|
|
68714
68725
|
color: ${getFieldPlaceholderColorFactoryForState('hover')};
|
|
68715
68726
|
}
|
|
@@ -68717,8 +68728,6 @@ const StyledInput = styled(Input)`
|
|
|
68717
68728
|
|
|
68718
68729
|
&:active,
|
|
68719
68730
|
&:focus {
|
|
68720
|
-
background-color: ${getFieldBackgroundColorFactory()};
|
|
68721
|
-
border: solid 1px ${getFieldBorderColorFactoryForState('focus')} !important;
|
|
68722
68731
|
outline: 0;
|
|
68723
68732
|
|
|
68724
68733
|
&::placeholder {
|
|
@@ -68726,6 +68735,49 @@ const StyledInput = styled(Input)`
|
|
|
68726
68735
|
}
|
|
68727
68736
|
}
|
|
68728
68737
|
`;
|
|
68738
|
+
const InputWithoutUnit = styled(BaseInput)`
|
|
68739
|
+
background-color: ${getFieldBackgroundColorFactory()};
|
|
68740
|
+
border: solid 1px ${getFieldBorderColorFactoryForState('default')};
|
|
68741
|
+
|
|
68742
|
+
&:hover {
|
|
68743
|
+
background-color: ${getFieldBackgroundColorFactory()};
|
|
68744
|
+
border: solid 1px ${getFieldBorderColorFactoryForState('hover')} !important;
|
|
68745
|
+
}
|
|
68746
|
+
|
|
68747
|
+
&:active,
|
|
68748
|
+
&:focus {
|
|
68749
|
+
background-color: ${getFieldBackgroundColorFactory()};
|
|
68750
|
+
border: solid 1px ${getFieldBorderColorFactoryForState('focus')} !important;
|
|
68751
|
+
}
|
|
68752
|
+
`;
|
|
68753
|
+
const InputBoxWithUnit = styled.div`
|
|
68754
|
+
align-items: center;
|
|
68755
|
+
background-color: ${getFieldBackgroundColorFactory()};
|
|
68756
|
+
border: solid 1px ${getFieldBorderColorFactoryForState('default')};
|
|
68757
|
+
color: ${(p)=>p.theme.color.slateGray};
|
|
68758
|
+
display: flex;
|
|
68759
|
+
font-size: 13px;
|
|
68760
|
+
line-height: 19px;
|
|
68761
|
+
padding-right: 8px;
|
|
68762
|
+
user-select: none;
|
|
68763
|
+
width: 100%;
|
|
68764
|
+
|
|
68765
|
+
&:hover {
|
|
68766
|
+
background-color: ${getFieldBackgroundColorFactory()};
|
|
68767
|
+
border: solid 1px ${getFieldBorderColorFactoryForState('hover')} !important;
|
|
68768
|
+
}
|
|
68769
|
+
|
|
68770
|
+
&:active,
|
|
68771
|
+
&:focus {
|
|
68772
|
+
background-color: ${getFieldBackgroundColorFactory()};
|
|
68773
|
+
border: solid 1px ${getFieldBorderColorFactoryForState('focus')} !important;
|
|
68774
|
+
}
|
|
68775
|
+
`;
|
|
68776
|
+
const InputWithUnit = styled(BaseInput)`
|
|
68777
|
+
background-color: transparent;
|
|
68778
|
+
border: none;
|
|
68779
|
+
flex-grow: 1;
|
|
68780
|
+
`;
|
|
68729
68781
|
|
|
68730
68782
|
const PADDING = {
|
|
68731
68783
|
[Size.LARGE]: '8px 16px 10px',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mtes-mct/monitor-ui",
|
|
3
3
|
"description": "Common React components, hooks, utilities and CSS stylesheets for MonitorFish, MonitorEnv and RapportNav.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "23.1.0",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|