@mtes-mct/monitor-ui 22.0.0 → 22.0.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
+ ## [22.0.0](https://github.com/MTES-MCT/monitor-ui/compare/v21.3.0...v22.0.0) (2024-09-09)
2
+
3
+
4
+ ### ⚠ BREAKING CHANGES
5
+
6
+ * **elements:** - `disabled` is renamed `$isDisabled` in `Label` props.
7
+ - `hasError` is renamed `$hasError` in `Label` props.
8
+ - `isHidden` is renamed `$isHidden` in `Label` props.
9
+
10
+ ### Bug Fixes
11
+
12
+ * **elements:** add missing styled component prop prefixes in Button ([6e9a56d](https://github.com/MTES-MCT/monitor-ui/commit/6e9a56d8c3f8e7190030a580372ce55d2df2f740))
13
+ * **elements:** add missing styled component prop prefixes in Label ([f2b5188](https://github.com/MTES-MCT/monitor-ui/commit/f2b518858d3fc959dddeff5d039f6cb5527680d5))
14
+
1
15
  ## [21.3.0](https://github.com/MTES-MCT/monitor-ui/compare/v21.2.1...v21.3.0) (2024-09-06)
2
16
 
3
17
 
@@ -0,0 +1,14 @@
1
+ import { type ButtonHTMLAttributes, type FunctionComponent } from 'react';
2
+ import { Accent, Size } from '../../constants';
3
+ import { type IconProps } from '../../types/definitions';
4
+ export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> & {
5
+ Icon?: FunctionComponent<IconProps> | undefined;
6
+ accent?: Accent | undefined;
7
+ children?: string | undefined;
8
+ isFullWidth?: boolean | undefined;
9
+ size?: Size | undefined;
10
+ /** Prevent onClick event propagation. */
11
+ withUnpropagatedClick?: boolean | undefined;
12
+ };
13
+ export declare function Button({ accent, children, className, Icon, isFullWidth, onClick, size, type, withUnpropagatedClick, ...nativeProps }: ButtonProps): import("react/jsx-runtime").JSX.Element;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/Button/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyC,KAAK,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAIhH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAA;AASxD,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,GAAG;IACpF,IAAI,CAAC,EAAE,iBAAiB,CAAC,SAAS,CAAC,GAAG,SAAS,CAAA;IAC/C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACjC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;IACvB,yCAAyC;IACzC,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC5C,CAAA;AACD,wBAAgB,MAAM,CAAC,EACrB,MAAuB,EACvB,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,WAAmB,EACnB,OAAO,EACP,IAAkB,EAClB,IAAe,EACf,qBAA6B,EAC7B,GAAG,WAAW,EACf,EAAE,WAAW,2CAmDb"}
@@ -0,0 +1,3 @@
1
+ export declare function getPrimaryButtonCss(): import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
2
+ export declare function getSecondaryButtonCss(): import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
3
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/elements/Button/styles.ts"],"names":[],"mappings":"AAEA,wBAAgB,mBAAmB,uIA2BlC;AAED,wBAAgB,qBA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AC,EAAE,IAAI,GAAG,SAAS,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC3B,CAAA;AACD,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,QAAgB,EAChB,KAAK,EACL,IAAI,EACJ,oBAA4B,EAC5B,aAAqB,EACrB,OAAe,EACf,UAAkB,EAClB,aAAqB,EACrB,aAAqB,EACrB,uBAA+B,EAC/B,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,QAAgB,EAChB,IAAkB,EAClB,KAAK,EACL,IAAa,EACb,KAAK,EACL,GAAG,aAAa,EACjB,EAAE,cAAc,2CAgFhB"}
package/index.js CHANGED
@@ -51,7 +51,7 @@ var quarterOfYear = /*@__PURE__*/getDefaultExportFromCjs(quarterOfYearExports);
51
51
  var timezone$1 = {exports: {}};
52
52
 
53
53
  (function (module, exports) {
54
- !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(n,i,o){var r,a=function(t,n,i){void 0===i&&(i={});var o=new Date(t),r=function(t,n){void 0===n&&(n={});var i=n.timeZoneName||"short",o=t+"|"+i,r=e[o];return r||(r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:i}),e[o]=r),r}(n,i);return r.formatToParts(o)},u=function(e,n){for(var i=a(e,n),r=[],u=0;u<i.length;u+=1){var f=i[u],s=f.type,m=f.value,c=t[s];c>=0&&(r[c]=parseInt(m,10));}var d=r[3],l=24===d?0:d,h=r[0]+"-"+r[1]+"-"+r[2]+" "+l+":"+r[4]+":"+r[5]+":000",v=+e;return (o.utc(h).valueOf()-(v-=v%1e3))/6e4},f=i.prototype;f.tz=function(t,e){void 0===t&&(t=r);var n=this.utcOffset(),i=this.toDate(),a=i.toLocaleString("en-US",{timeZone:t}),u=Math.round((i-new Date(a))/1e3/60),f=o(a,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(i.getTimezoneOffset()/15)-u,!0);if(e){var s=f.utcOffset();f=f.add(n-s,"minute");}return f.$x.$timezone=t,f},f.offsetName=function(t){var e=this.$x.$timezone||o.tz.guess(),n=a(this.valueOf(),e,{timeZoneName:t}).find((function(t){return "timezonename"===t.type.toLowerCase()}));return n&&n.value};var s=f.startOf;f.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return s.call(this,t,e);var n=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return s.call(n,t,e).tz(this.$x.$timezone,!0)},o.tz=function(t,e,n){var i=n&&e,a=n||e||r,f=u(+o(),a);if("string"!=typeof t)return o(t).tz(a);var s=function(t,e,n){var i=t-60*e*1e3,o=u(i,n);if(e===o)return [i,e];var r=u(i-=60*(o-e)*1e3,n);return o===r?[i,o]:[t-60*Math.min(o,r)*1e3,Math.max(o,r)]}(o.utc(t,i).valueOf(),f,a),m=s[0],c=s[1],d=o(m).utcOffset(c);return d.$x.$timezone=a,d},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(t){r=t;};}}));
54
+ !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(n,i,o){var r,a=function(t,n,i){void 0===i&&(i={});var o=new Date(t),r=function(t,n){void 0===n&&(n={});var i=n.timeZoneName||"short",o=t+"|"+i,r=e[o];return r||(r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:i}),e[o]=r),r}(n,i);return r.formatToParts(o)},u=function(e,n){for(var i=a(e,n),r=[],u=0;u<i.length;u+=1){var f=i[u],s=f.type,m=f.value,c=t[s];c>=0&&(r[c]=parseInt(m,10));}var d=r[3],l=24===d?0:d,h=r[0]+"-"+r[1]+"-"+r[2]+" "+l+":"+r[4]+":"+r[5]+":000",v=+e;return (o.utc(h).valueOf()-(v-=v%1e3))/6e4},f=i.prototype;f.tz=function(t,e){void 0===t&&(t=r);var n,i=this.utcOffset(),a=this.toDate(),u=a.toLocaleString("en-US",{timeZone:t}),f=Math.round((a-new Date(u))/1e3/60),s=15*-Math.round(a.getTimezoneOffset()/15)-f;if(!Number(s))n=this.utcOffset(0,e);else if(n=o(u,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(s,!0),e){var m=n.utcOffset();n=n.add(i-m,"minute");}return n.$x.$timezone=t,n},f.offsetName=function(t){var e=this.$x.$timezone||o.tz.guess(),n=a(this.valueOf(),e,{timeZoneName:t}).find((function(t){return "timezonename"===t.type.toLowerCase()}));return n&&n.value};var s=f.startOf;f.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return s.call(this,t,e);var n=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return s.call(n,t,e).tz(this.$x.$timezone,!0)},o.tz=function(t,e,n){var i=n&&e,a=n||e||r,f=u(+o(),a);if("string"!=typeof t)return o(t).tz(a);var s=function(t,e,n){var i=t-60*e*1e3,o=u(i,n);if(e===o)return [i,e];var r=u(i-=60*(o-e)*1e3,n);return o===r?[i,o]:[t-60*Math.min(o,r)*1e3,Math.max(o,r)]}(o.utc(t,i).valueOf(),f,a),m=s[0],c=s[1],d=o(m).utcOffset(c);return d.$x.$timezone=a,d},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(t){r=t;};}}));
55
55
  } (timezone$1));
56
56
 
57
57
  var timezoneExports = timezone$1.exports;
@@ -53380,252 +53380,62 @@ function Notifier({ isSideWindow = false }) {
53380
53380
  // We need to retype `ToastContainer` manually because `styled-components` mess up with the `children` prop
53381
53381
  const StyledToastContainer = styled(k)``;
53382
53382
 
53383
- const ICON_SIZE$1 = {
53384
- [Size.LARGE]: 20,
53385
- [Size.NORMAL]: 20,
53386
- [Size.SMALL]: 12
53387
- };
53388
- function Button$1({ accent = Accent.PRIMARY, children, className, Icon, isFullWidth = false, onClick, size = Size.NORMAL, type = 'button', withUnpropagatedClick = false, ...nativeProps }) {
53389
- const handleClick = useCallback((event)=>{
53390
- if (withUnpropagatedClick) {
53391
- stopMouseEventPropagation(event);
53392
- }
53393
- if (onClick) {
53394
- onClick(event);
53395
- }
53396
- }, [
53397
- onClick,
53398
- withUnpropagatedClick
53399
- ]);
53400
- const commonChildren = useMemo(()=>/*#__PURE__*/ jsxs(Fragment, {
53401
- children: [
53402
- Icon && /*#__PURE__*/ jsx(Icon, {
53403
- size: ICON_SIZE$1[size]
53404
- }),
53405
- children && /*#__PURE__*/ jsx(ButtonLabel, {
53406
- children: children
53407
- })
53408
- ]
53409
- }), [
53410
- children,
53411
- Icon,
53412
- size
53413
- ]);
53414
- const commonProps = useMemo(()=>({
53415
- as: StyledButton$1,
53416
- children: commonChildren,
53417
- className: classnames('Element-Button', className),
53418
- isFullWidth,
53419
- onClick: handleClick,
53420
- size,
53421
- type,
53422
- ...nativeProps
53423
- }), [
53424
- className,
53425
- commonChildren,
53426
- handleClick,
53427
- isFullWidth,
53428
- nativeProps,
53429
- size,
53430
- type
53431
- ]);
53432
- switch(accent){
53433
- case Accent.SECONDARY:
53434
- return /*#__PURE__*/ jsx(SecondaryButton, {
53435
- ...commonProps
53436
- });
53437
- case Accent.TERTIARY:
53438
- return /*#__PURE__*/ jsx(TertiaryButton$1, {
53439
- ...commonProps
53440
- });
53441
- case Accent.WARNING:
53442
- return /*#__PURE__*/ jsx(WarningButton, {
53443
- ...commonProps
53444
- });
53445
- case Accent.ERROR:
53446
- return /*#__PURE__*/ jsx(ErrorButton, {
53447
- ...commonProps
53448
- });
53449
- default:
53450
- return /*#__PURE__*/ jsx(PrimaryButton, {
53451
- ...commonProps
53452
- });
53453
- }
53454
- }
53455
- const FONT_SIZE$1 = {
53456
- [Size.LARGE]: '13px',
53457
- [Size.NORMAL]: '13px',
53458
- [Size.SMALL]: '11px'
53459
- };
53460
- const PADDING$2 = {
53461
- [Size.LARGE]: '12px',
53462
- [Size.NORMAL]: '6px 12px',
53463
- [Size.SMALL]: '5px 8px 4px'
53464
- };
53465
- const StyledButton$1 = styled.button`
53466
- align-items: center;
53467
- display: inline-flex;
53468
- font-size: ${(p)=>FONT_SIZE$1[p.$size]};
53469
- justify-content: center;
53470
- max-width: 100%;
53471
- padding: ${(p)=>PADDING$2[p.$size]};
53472
- width: ${(p)=>p.$isFullWidth ? '100%' : 'auto'};
53473
-
53474
- > .Element-IconBox {
53475
- margin-right: 5px;
53476
- }
53477
- `;
53478
- const ButtonLabel = styled.span`
53479
- line-height: 1.3846;
53480
- margin-top: -3px;
53481
- min-width: 0;
53482
- overflow: hidden;
53483
- text-overflow: ellipsis;
53484
- white-space: nowrap;
53485
- `;
53486
- const PrimaryButton = styled.button`
53487
- background-color: ${(p)=>p.theme.color.charcoal};
53488
- border: 1px solid ${(p)=>p.theme.color.charcoal};
53489
- color: ${(p)=>p.theme.color.gainsboro};
53490
-
53491
- &:hover,
53492
- &._hover {
53493
- background-color: ${(p)=>p.theme.color.blueYonder};
53494
- border: 1px solid ${(p)=>p.theme.color.blueYonder};
53495
- color: ${(p)=>p.theme.color.white};
53496
- }
53497
-
53498
- &:active,
53499
- &._active {
53500
- background-color: ${(p)=>p.theme.color.blueGray};
53501
- border: 1px solid ${(p)=>p.theme.color.blueGray};
53502
- color: ${(p)=>p.theme.color.white};
53503
- }
53504
-
53505
- &:disabled,
53506
- &._disabled {
53507
- background-color: ${(p)=>p.theme.color.lightGray};
53508
- border: 1px solid ${(p)=>p.theme.color.lightGray};
53509
- color: ${(p)=>p.theme.color.cultured};
53510
- }
53511
- `;
53512
- const SecondaryButton = styled.button`
53513
- background-color: transparent;
53514
- border: 1px solid ${(p)=>p.theme.color.charcoal};
53515
- color: ${(p)=>p.theme.color.charcoal};
53383
+ function getPrimaryButtonCss() {
53384
+ return css`
53385
+ background-color: ${(p)=>p.theme.color.charcoal};
53386
+ border: 1px solid ${(p)=>p.theme.color.charcoal};
53387
+ color: ${(p)=>p.theme.color.gainsboro};
53516
53388
 
53517
- &:hover,
53518
- &._hover {
53519
- background-color: ${(p)=>p.theme.color.blueYonder25};
53520
- border: 1px solid ${(p)=>p.theme.color.blueYonder};
53521
- color: ${(p)=>p.theme.color.blueYonder};
53522
- }
53389
+ &:hover,
53390
+ &._hover {
53391
+ background-color: ${(p)=>p.theme.color.blueYonder};
53392
+ border: 1px solid ${(p)=>p.theme.color.blueYonder};
53393
+ color: ${(p)=>p.theme.color.white};
53394
+ }
53523
53395
 
53524
- &:active,
53525
- &._active {
53526
- background-color: ${(p)=>p.theme.color.blueGray25};
53527
- border: 1px solid ${(p)=>p.theme.color.blueGray};
53528
- color: ${(p)=>p.theme.color.blueGray};
53529
- }
53396
+ &:active,
53397
+ &._active {
53398
+ background-color: ${(p)=>p.theme.color.blueGray};
53399
+ border: 1px solid ${(p)=>p.theme.color.blueGray};
53400
+ color: ${(p)=>p.theme.color.white};
53401
+ }
53530
53402
 
53531
- &:disabled,
53532
- &._disabled {
53403
+ &:disabled,
53404
+ &._disabled {
53405
+ background-color: ${(p)=>p.theme.color.lightGray};
53406
+ border: 1px solid ${(p)=>p.theme.color.lightGray};
53407
+ color: ${(p)=>p.theme.color.cultured};
53408
+ }
53409
+ `;
53410
+ }
53411
+ function getSecondaryButtonCss() {
53412
+ return css`
53533
53413
  background-color: transparent;
53534
- border: 1px solid ${(p)=>p.theme.color.lightGray};
53535
- color: ${(p)=>p.theme.color.lightGray};
53536
- }
53537
- `;
53538
- const TertiaryButton$1 = styled.button`
53539
- background-color: ${(p)=>p.theme.color.white};
53540
- border: 1px solid ${(p)=>p.theme.color.white};
53541
- color: ${(p)=>p.theme.color.charcoal};
53542
-
53543
- &:hover,
53544
- &._hover {
53545
- background-color: ${(p)=>p.theme.color.blueYonder25};
53546
- border: 1px solid ${(p)=>p.theme.color.blueYonder25};
53547
- color: ${(p)=>p.theme.color.blueYonder};
53548
- }
53549
-
53550
- &:active,
53551
- &._active {
53552
- background-color: ${(p)=>p.theme.color.blueGray25};
53553
- border: 1px solid ${(p)=>p.theme.color.blueGray};
53554
- color: ${(p)=>p.theme.color.blueGray};
53555
- }
53556
-
53557
- &:disabled,
53558
- &._disabled {
53559
- background-color: ${(p)=>p.theme.color.white};
53560
- border: 1px solid ${(p)=>p.theme.color.lightGray};
53561
- color: ${(p)=>p.theme.color.lightGray};
53562
- }
53563
- `;
53564
- const WarningButton = styled.button`
53565
- background-color: transparent;
53566
- border: 1px solid ${(p)=>p.theme.color.goldenPoppy};
53567
- color: ${(p)=>p.theme.color.charcoal};
53568
-
53569
- &:hover,
53570
- &._hover {
53571
- /* 26 is for opacity = 15% */
53572
- background-color: ${(p)=>p.theme.color.goldenPoppy}26;
53573
- border: 1px solid ${(p)=>p.theme.color.goldenPoppy};
53574
- color: ${(p)=>p.theme.color.charcoal};
53575
- }
53576
-
53577
- &:active,
53578
- &._active {
53579
- background-color: ${(p)=>p.theme.color.goldenPoppy};
53580
- border: 1px solid ${(p)=>p.theme.color.goldenPoppy};
53414
+ border: 1px solid ${(p)=>p.theme.color.charcoal};
53581
53415
  color: ${(p)=>p.theme.color.charcoal};
53582
- }
53583
53416
 
53584
- &:disabled,
53585
- &._disabled {
53586
- background-color: transparent;
53587
- border: 1px solid ${(p)=>p.theme.color.lightGray};
53588
- color: ${(p)=>p.theme.color.lightGray};
53589
- }
53590
- `;
53591
- const ErrorButton = styled.button`
53592
- background-color: transparent;
53593
- border: 1px solid ${(p)=>p.theme.color.maximumRed};
53594
- color: ${(p)=>p.theme.color.charcoal};
53595
- > * {
53596
- color: ${(p)=>p.theme.color.maximumRed};
53597
- }
53598
-
53599
- &:hover,
53600
- &._hover {
53601
- /* 26 is for opacity = 15% */
53602
- background-color: ${(p)=>p.theme.color.maximumRed}26;
53603
- border: 1px solid ${(p)=>p.theme.color.maximumRed};
53604
- > * {
53605
- color: ${(p)=>p.theme.color.maximumRed};
53417
+ &:hover,
53418
+ &._hover {
53419
+ background-color: ${(p)=>p.theme.color.blueYonder25};
53420
+ border: 1px solid ${(p)=>p.theme.color.blueYonder};
53421
+ color: ${(p)=>p.theme.color.blueYonder};
53606
53422
  }
53607
- }
53608
53423
 
53609
- &:active,
53610
- &._active {
53611
- background-color: ${(p)=>p.theme.color.maximumRed};
53612
- border: 1px solid ${(p)=>p.theme.color.maximumRed};
53613
- color: ${(p)=>p.theme.color.white};
53614
- > * {
53615
- color: ${(p)=>p.theme.color.white};
53424
+ &:active,
53425
+ &._active {
53426
+ background-color: ${(p)=>p.theme.color.blueGray25};
53427
+ border: 1px solid ${(p)=>p.theme.color.blueGray};
53428
+ color: ${(p)=>p.theme.color.blueGray};
53616
53429
  }
53617
- }
53618
53430
 
53619
- &:disabled,
53620
- &._disabled {
53621
- background-color: transparent;
53622
- border: 1px solid ${(p)=>p.theme.color.lightGray};
53623
- color: ${(p)=>p.theme.color.lightGray};
53624
- > * {
53431
+ &:disabled,
53432
+ &._disabled {
53433
+ background-color: transparent;
53434
+ border: 1px solid ${(p)=>p.theme.color.lightGray};
53625
53435
  color: ${(p)=>p.theme.color.lightGray};
53626
53436
  }
53627
- }
53628
- `;
53437
+ `;
53438
+ }
53629
53439
 
53630
53440
  const ICON_SIZE_IN_PX = {
53631
53441
  [Size.LARGE]: 26,
@@ -53654,11 +53464,11 @@ function IconButton({ accent = Accent.PRIMARY, badgeBackgroundColor, badgeColor,
53654
53464
  size
53655
53465
  ]);
53656
53466
  const buttonProps = useMemo(()=>({
53467
+ $isCompact: isCompact,
53468
+ $size: size,
53657
53469
  children: commonChildren,
53658
53470
  className: badgeNumber === undefined ? classnames('Element-IconButton', className) : classnames('Element-IconButton'),
53659
- isCompact,
53660
53471
  onClick: handleClick,
53661
- size,
53662
53472
  style: badgeNumber === undefined ? style : undefined,
53663
53473
  type,
53664
53474
  ...nativeProps
@@ -53676,21 +53486,19 @@ function IconButton({ accent = Accent.PRIMARY, badgeBackgroundColor, badgeColor,
53676
53486
  switch(accent){
53677
53487
  case Accent.SECONDARY:
53678
53488
  return /*#__PURE__*/ jsx(Fragment, {
53679
- children: badgeNumber === undefined ? /*#__PURE__*/ jsx(SecondaryButton, {
53680
- as: StyledButton,
53489
+ children: badgeNumber === undefined ? /*#__PURE__*/ jsx(SecondaryButton$1, {
53681
53490
  ...buttonProps
53682
53491
  }) : /*#__PURE__*/ jsxs(Wrapper$2, {
53683
53492
  className: className,
53684
53493
  style: style,
53685
53494
  children: [
53686
53495
  /*#__PURE__*/ jsx(BadgeNumber, {
53687
- backgroundColor: badgeBackgroundColor,
53688
- color: badgeColor,
53689
- size: size,
53496
+ $backgroundColor: badgeBackgroundColor,
53497
+ $color: badgeColor,
53498
+ $size: size,
53690
53499
  children: badgeNumber
53691
53500
  }),
53692
- /*#__PURE__*/ jsx(SecondaryButton, {
53693
- as: StyledButton,
53501
+ /*#__PURE__*/ jsx(SecondaryButton$1, {
53694
53502
  ...buttonProps
53695
53503
  })
53696
53504
  ]
@@ -53698,21 +53506,19 @@ function IconButton({ accent = Accent.PRIMARY, badgeBackgroundColor, badgeColor,
53698
53506
  });
53699
53507
  case Accent.TERTIARY:
53700
53508
  return /*#__PURE__*/ jsx(Fragment, {
53701
- children: badgeNumber === undefined ? /*#__PURE__*/ jsx(TertiaryButton, {
53702
- as: StyledButton,
53509
+ children: badgeNumber === undefined ? /*#__PURE__*/ jsx(TertiaryButton$1, {
53703
53510
  ...buttonProps
53704
53511
  }) : /*#__PURE__*/ jsxs(Wrapper$2, {
53705
53512
  className: className,
53706
53513
  style: style,
53707
53514
  children: [
53708
53515
  /*#__PURE__*/ jsx(BadgeNumber, {
53709
- backgroundColor: badgeBackgroundColor,
53710
- color: badgeColor,
53711
- size: size,
53516
+ $backgroundColor: badgeBackgroundColor,
53517
+ $color: badgeColor,
53518
+ $size: size,
53712
53519
  children: badgeNumber
53713
53520
  }),
53714
- /*#__PURE__*/ jsx(TertiaryButton, {
53715
- as: StyledButton,
53521
+ /*#__PURE__*/ jsx(TertiaryButton$1, {
53716
53522
  ...buttonProps
53717
53523
  })
53718
53524
  ]
@@ -53720,21 +53526,19 @@ function IconButton({ accent = Accent.PRIMARY, badgeBackgroundColor, badgeColor,
53720
53526
  });
53721
53527
  default:
53722
53528
  return /*#__PURE__*/ jsx(Fragment, {
53723
- children: badgeNumber === undefined ? /*#__PURE__*/ jsx(PrimaryButton, {
53724
- as: StyledButton,
53529
+ children: badgeNumber === undefined ? /*#__PURE__*/ jsx(PrimaryButton$1, {
53725
53530
  ...buttonProps
53726
53531
  }) : /*#__PURE__*/ jsxs(Wrapper$2, {
53727
53532
  className: className,
53728
53533
  style: style,
53729
53534
  children: [
53730
53535
  /*#__PURE__*/ jsx(BadgeNumber, {
53731
- backgroundColor: badgeBackgroundColor,
53732
- color: badgeColor,
53733
- size: size,
53536
+ $backgroundColor: badgeBackgroundColor,
53537
+ $color: badgeColor,
53538
+ $size: size,
53734
53539
  children: badgeNumber
53735
53540
  }),
53736
- /*#__PURE__*/ jsx(PrimaryButton, {
53737
- as: StyledButton,
53541
+ /*#__PURE__*/ jsx(PrimaryButton$1, {
53738
53542
  ...buttonProps
53739
53543
  })
53740
53544
  ]
@@ -53742,7 +53546,7 @@ function IconButton({ accent = Accent.PRIMARY, badgeBackgroundColor, badgeColor,
53742
53546
  });
53743
53547
  }
53744
53548
  }
53745
- const PADDING$1 = {
53549
+ const PADDING$2 = {
53746
53550
  [Size.LARGE]: '7px',
53747
53551
  [Size.NORMAL]: '5px',
53748
53552
  [Size.SMALL]: '3px'
@@ -53764,23 +53568,24 @@ const BadgeNumber = styled.div`
53764
53568
  border-radius: 10px;
53765
53569
  top: -5px;
53766
53570
  line-height: 14px;
53767
- left: ${(p)=>p.size ? LEFT_MARGIN[p.size] : 25}px;
53768
- background: ${(p)=>p.backgroundColor ? p.backgroundColor : p.theme.color.maximumRed};
53769
- color: ${(p)=>p.color ? p.color : p.theme.color.white};
53571
+ left: ${(p)=>p.$size ? LEFT_MARGIN[p.$size] : 25}px;
53572
+ background: ${(p)=>p.$backgroundColor ? p.$backgroundColor : p.theme.color.maximumRed};
53573
+ color: ${(p)=>p.$color ? p.$color : p.theme.color.white};
53770
53574
  font-size: 12px;
53771
53575
  letter-spacing: 0px;
53772
53576
  font-weight: 700;
53773
53577
  `;
53774
- // We can't use $-prefixed props here for some reason (maybe because the `as` prop exclude them?).
53775
- const StyledButton = styled.button`
53578
+ const BaseButton$1 = styled.button`
53776
53579
  align-items: center;
53777
53580
  border-style: solid;
53778
- border-width: ${(p)=>p.isCompact ? 0 : 1}px;
53581
+ border-width: ${(p)=>p.$isCompact ? 0 : 1}px;
53779
53582
  display: flex;
53780
53583
  justify-content: center;
53781
- padding: ${(p)=>p.isCompact ? 0 : PADDING$1[p.size]};
53584
+ padding: ${(p)=>p.$isCompact ? 0 : PADDING$2[p.$size]};
53782
53585
  `;
53783
- const TertiaryButton = styled.button`
53586
+ const PrimaryButton$1 = styled(BaseButton$1)(getPrimaryButtonCss);
53587
+ const SecondaryButton$1 = styled(BaseButton$1)(getSecondaryButtonCss);
53588
+ const TertiaryButton$1 = styled.button`
53784
53589
  background-color: transparent;
53785
53590
  border-color: transparent;
53786
53591
  color: ${(p)=>p.theme.color.charcoal};
@@ -53807,7 +53612,7 @@ const TertiaryButton = styled.button`
53807
53612
  }
53808
53613
  `;
53809
53614
 
53810
- function Button({ Icon, isActive, title, ...originalProps }) {
53615
+ function Button$1({ Icon, isActive, title, ...originalProps }) {
53811
53616
  return /*#__PURE__*/ jsx(MenuButton, {
53812
53617
  $isActive: isActive,
53813
53618
  Icon: Icon,
@@ -53864,7 +53669,7 @@ const Wrapper$1 = styled.div`
53864
53669
  `;
53865
53670
  Menu.displayName = 'SideMenu';
53866
53671
  const SideMenu = Object.assign(Menu, {
53867
- Button
53672
+ Button: Button$1
53868
53673
  });
53869
53674
 
53870
53675
  function SingleTag({ accent = Accent.PRIMARY, children, className, onDelete, ...nativeProps }) {
@@ -54118,12 +53923,12 @@ const Box$c = styled.div`
54118
53923
  padding: 16px;
54119
53924
  `;
54120
53925
 
54121
- const FONT_SIZE = {
53926
+ const FONT_SIZE$1 = {
54122
53927
  [Size.LARGE]: '16px',
54123
53928
  [Size.NORMAL]: '13px',
54124
53929
  [Size.SMALL]: '11px'
54125
53930
  };
54126
- const ICON_SIZE = {
53931
+ const ICON_SIZE$1 = {
54127
53932
  [Size.LARGE]: 16,
54128
53933
  [Size.NORMAL]: 13,
54129
53934
  [Size.SMALL]: 11
@@ -54135,7 +53940,7 @@ const StyledLinkButton = styled.button`
54135
53940
  cursor: ${(p)=>p.disabled ? 'none' : 'pointer'};
54136
53941
  display: flex;
54137
53942
  flex-direction: row;
54138
- font-size: ${(p)=>FONT_SIZE[p.size]};
53943
+ font-size: ${(p)=>FONT_SIZE$1[p.size]};
54139
53944
  gap: 0.4rem;
54140
53945
  text-decoration: underline;
54141
53946
 
@@ -54170,7 +53975,7 @@ function LinkButton({ children, Icon, ...props }) {
54170
53975
  children: [
54171
53976
  Icon && /*#__PURE__*/ jsx(Icon, {
54172
53977
  color: THEME.color.slateGray,
54173
- size: ICON_SIZE[props.size]
53978
+ size: ICON_SIZE$1[props.size]
54174
53979
  }),
54175
53980
  lodashExports.isString(children) ? /*#__PURE__*/ jsx("p", {
54176
53981
  children: children
@@ -54344,6 +54149,202 @@ const HideText = styled.span`
54344
54149
  `;
54345
54150
  Banner.displayName = 'Banner';
54346
54151
 
54152
+ const ICON_SIZE = {
54153
+ [Size.LARGE]: 20,
54154
+ [Size.NORMAL]: 20,
54155
+ [Size.SMALL]: 12
54156
+ };
54157
+ function Button({ accent = Accent.PRIMARY, children, className, Icon, isFullWidth = false, onClick, size = Size.NORMAL, type = 'button', withUnpropagatedClick = false, ...nativeProps }) {
54158
+ const handleClick = useCallback((event)=>{
54159
+ if (withUnpropagatedClick) {
54160
+ stopMouseEventPropagation(event);
54161
+ }
54162
+ if (onClick) {
54163
+ onClick(event);
54164
+ }
54165
+ }, [
54166
+ onClick,
54167
+ withUnpropagatedClick
54168
+ ]);
54169
+ const commonChildren = useMemo(()=>/*#__PURE__*/ jsxs(Fragment, {
54170
+ children: [
54171
+ Icon && /*#__PURE__*/ jsx(Icon, {
54172
+ size: ICON_SIZE[size]
54173
+ }),
54174
+ children && /*#__PURE__*/ jsx(ButtonLabel, {
54175
+ children: children
54176
+ })
54177
+ ]
54178
+ }), [
54179
+ children,
54180
+ Icon,
54181
+ size
54182
+ ]);
54183
+ const commonProps = useMemo(()=>({
54184
+ $isFullWidth: isFullWidth,
54185
+ $size: size,
54186
+ children: commonChildren,
54187
+ className: classnames('Element-Button', className),
54188
+ onClick: handleClick,
54189
+ type,
54190
+ ...nativeProps
54191
+ }), [
54192
+ className,
54193
+ commonChildren,
54194
+ handleClick,
54195
+ isFullWidth,
54196
+ nativeProps,
54197
+ size,
54198
+ type
54199
+ ]);
54200
+ switch(accent){
54201
+ case Accent.SECONDARY:
54202
+ return /*#__PURE__*/ jsx(SecondaryButton, {
54203
+ ...commonProps
54204
+ });
54205
+ case Accent.TERTIARY:
54206
+ return /*#__PURE__*/ jsx(TertiaryButton, {
54207
+ ...commonProps
54208
+ });
54209
+ case Accent.WARNING:
54210
+ return /*#__PURE__*/ jsx(WarningButton, {
54211
+ ...commonProps
54212
+ });
54213
+ case Accent.ERROR:
54214
+ return /*#__PURE__*/ jsx(ErrorButton, {
54215
+ ...commonProps
54216
+ });
54217
+ default:
54218
+ return /*#__PURE__*/ jsx(PrimaryButton, {
54219
+ ...commonProps
54220
+ });
54221
+ }
54222
+ }
54223
+ const FONT_SIZE = {
54224
+ [Size.LARGE]: '13px',
54225
+ [Size.NORMAL]: '13px',
54226
+ [Size.SMALL]: '11px'
54227
+ };
54228
+ const PADDING$1 = {
54229
+ [Size.LARGE]: '12px',
54230
+ [Size.NORMAL]: '6px 12px',
54231
+ [Size.SMALL]: '5px 8px 4px'
54232
+ };
54233
+ const BaseButton = styled.button`
54234
+ align-items: center;
54235
+ display: inline-flex;
54236
+ font-size: ${(p)=>FONT_SIZE[p.$size]};
54237
+ justify-content: center;
54238
+ max-width: 100%;
54239
+ padding: ${(p)=>PADDING$1[p.$size]};
54240
+ width: ${(p)=>p.$isFullWidth ? '100%' : 'auto'};
54241
+
54242
+ > .Element-IconBox {
54243
+ margin-right: 5px;
54244
+ }
54245
+ `;
54246
+ const ButtonLabel = styled.span`
54247
+ line-height: 1.3846;
54248
+ margin-top: -3px;
54249
+ min-width: 0;
54250
+ overflow: hidden;
54251
+ text-overflow: ellipsis;
54252
+ white-space: nowrap;
54253
+ `;
54254
+ const PrimaryButton = styled(BaseButton)(getPrimaryButtonCss);
54255
+ const SecondaryButton = styled(BaseButton)(getSecondaryButtonCss);
54256
+ const TertiaryButton = styled(BaseButton)`
54257
+ background-color: ${(p)=>p.theme.color.white};
54258
+ border: 1px solid ${(p)=>p.theme.color.white};
54259
+ color: ${(p)=>p.theme.color.charcoal};
54260
+
54261
+ &:hover,
54262
+ &._hover {
54263
+ background-color: ${(p)=>p.theme.color.blueYonder25};
54264
+ border: 1px solid ${(p)=>p.theme.color.blueYonder25};
54265
+ color: ${(p)=>p.theme.color.blueYonder};
54266
+ }
54267
+
54268
+ &:active,
54269
+ &._active {
54270
+ background-color: ${(p)=>p.theme.color.blueGray25};
54271
+ border: 1px solid ${(p)=>p.theme.color.blueGray};
54272
+ color: ${(p)=>p.theme.color.blueGray};
54273
+ }
54274
+
54275
+ &:disabled,
54276
+ &._disabled {
54277
+ background-color: ${(p)=>p.theme.color.white};
54278
+ border: 1px solid ${(p)=>p.theme.color.lightGray};
54279
+ color: ${(p)=>p.theme.color.lightGray};
54280
+ }
54281
+ `;
54282
+ const WarningButton = styled(BaseButton)`
54283
+ background-color: transparent;
54284
+ border: 1px solid ${(p)=>p.theme.color.goldenPoppy};
54285
+ color: ${(p)=>p.theme.color.charcoal};
54286
+
54287
+ &:hover,
54288
+ &._hover {
54289
+ /* 26 is for opacity = 15% */
54290
+ background-color: ${(p)=>p.theme.color.goldenPoppy}26;
54291
+ border: 1px solid ${(p)=>p.theme.color.goldenPoppy};
54292
+ color: ${(p)=>p.theme.color.charcoal};
54293
+ }
54294
+
54295
+ &:active,
54296
+ &._active {
54297
+ background-color: ${(p)=>p.theme.color.goldenPoppy};
54298
+ border: 1px solid ${(p)=>p.theme.color.goldenPoppy};
54299
+ color: ${(p)=>p.theme.color.charcoal};
54300
+ }
54301
+
54302
+ &:disabled,
54303
+ &._disabled {
54304
+ background-color: transparent;
54305
+ border: 1px solid ${(p)=>p.theme.color.lightGray};
54306
+ color: ${(p)=>p.theme.color.lightGray};
54307
+ }
54308
+ `;
54309
+ const ErrorButton = styled(BaseButton)`
54310
+ background-color: transparent;
54311
+ border: 1px solid ${(p)=>p.theme.color.maximumRed};
54312
+ color: ${(p)=>p.theme.color.charcoal};
54313
+ > * {
54314
+ color: ${(p)=>p.theme.color.maximumRed};
54315
+ }
54316
+
54317
+ &:hover,
54318
+ &._hover {
54319
+ /* 26 is for opacity = 15% */
54320
+ background-color: ${(p)=>p.theme.color.maximumRed}26;
54321
+ border: 1px solid ${(p)=>p.theme.color.maximumRed};
54322
+ > * {
54323
+ color: ${(p)=>p.theme.color.maximumRed};
54324
+ }
54325
+ }
54326
+
54327
+ &:active,
54328
+ &._active {
54329
+ background-color: ${(p)=>p.theme.color.maximumRed};
54330
+ border: 1px solid ${(p)=>p.theme.color.maximumRed};
54331
+ color: ${(p)=>p.theme.color.white};
54332
+ > * {
54333
+ color: ${(p)=>p.theme.color.white};
54334
+ }
54335
+ }
54336
+
54337
+ &:disabled,
54338
+ &._disabled {
54339
+ background-color: transparent;
54340
+ border: 1px solid ${(p)=>p.theme.color.lightGray};
54341
+ color: ${(p)=>p.theme.color.lightGray};
54342
+ > * {
54343
+ color: ${(p)=>p.theme.color.lightGray};
54344
+ }
54345
+ }
54346
+ `;
54347
+
54347
54348
  const Field$2 = styled.div.attrs((props)=>({
54348
54349
  className: classnames('Element-Field', props.className)
54349
54350
  }))`
@@ -68475,7 +68476,7 @@ function MultiZoneEditor({ addButtonLabel, className, defaultValue = [], disable
68475
68476
  legend: label,
68476
68477
  style: style,
68477
68478
  children: [
68478
- /*#__PURE__*/ jsx(Button$1, {
68479
+ /*#__PURE__*/ jsx(Button, {
68479
68480
  accent: hasError ? Accent.ERROR : Accent.SECONDARY,
68480
68481
  disabled: disabled || isAddButtonDisabled,
68481
68482
  Icon: Plus,
@@ -74242,4 +74243,4 @@ const undefineObjectProps = (record)=>Object.fromEntries(Object.entries(record).
74242
74243
  return value;
74243
74244
  }
74244
74245
 
74245
- export { Accent, Banner, Button$1 as Button, CheckPicker, Checkbox, ControlUnit, CoordinatesFormat, CoordinatesInput, CustomSearch, DataTable, DatePicker, DateRangePicker, Dialog, Dot, Dropdown, ExclamationPoint, Field$2 as Field, FieldError, Fieldset, Figure, FormikCheckPicker, FormikCheckbox, FormikCoordinatesInput, FormikDatePicker, FormikDateRangePicker, FormikEffect, FormikMultiCascader, FormikMultiCheckbox, FormikMultiRadio, FormikMultiSelect, FormikNumberInput, FormikPhoneInput, FormikRichBooleanCheckbox, FormikSearch, FormikSelect, FormikTextInput, FormikTextarea, FormikToggle, GlobalStyle, index as Icon, IconButton, Label, Legend, Level, Link$1 as Link, LinkButton, MapMenuDialog, Message, Mission, MultiCascader, MultiCheckbox, MultiRadio, MultiSelect, MultiZoneEditor, NewWindow, NewWindowContext, NotificationEvent, Notifier, NumberInput, OPENLAYERS_PROJECTION, OnlyFontGlobalStyle, PhoneInput, Radio, RichBoolean, RichBooleanCheckbox, Search, Select, SideMenu, SimpleTable, SingleTag, Size, THEME, TableWithSelectableRows, Tag, TagBullet, TagGroup, TextInput, Textarea, ThemeProvider, Toggle, WSG84_PROJECTION, cleanString, coordinatesAreDistinct, customDayjs, getControlUnitResourceCategoryFromType, getCoordinates, getFilteredCollection, getHashFromCollection, getLocalizedDayjs, getMaybeBooleanFromRichBoolean, getOptionsFromIdAndName, getOptionsFromLabelledEnum, getPseudoRandomString, getSelectedOptionFromOptionValue, getSelectedOptionFromOptionValueInTree, getUtcizedDayjs, humanizePastDate, isArray, isDefined, isEmptyish, isNumeric, isObject, logSoftError, normalizeString, nullify, pluralize, sortCollectionByLocalizedProps, stopMouseEventPropagation, undefine, useClickOutsideEffect, useDeepCompareEffect, useFieldControl, useForceUpdate, useKey, useNewWindow, usePressEscapeEffect, usePrevious };
74246
+ export { Accent, Banner, Button, CheckPicker, Checkbox, ControlUnit, CoordinatesFormat, CoordinatesInput, CustomSearch, DataTable, DatePicker, DateRangePicker, Dialog, Dot, Dropdown, ExclamationPoint, Field$2 as Field, FieldError, Fieldset, Figure, FormikCheckPicker, FormikCheckbox, FormikCoordinatesInput, FormikDatePicker, FormikDateRangePicker, FormikEffect, FormikMultiCascader, FormikMultiCheckbox, FormikMultiRadio, FormikMultiSelect, FormikNumberInput, FormikPhoneInput, FormikRichBooleanCheckbox, FormikSearch, FormikSelect, FormikTextInput, FormikTextarea, FormikToggle, GlobalStyle, index as Icon, IconButton, Label, Legend, Level, Link$1 as Link, LinkButton, MapMenuDialog, Message, Mission, MultiCascader, MultiCheckbox, MultiRadio, MultiSelect, MultiZoneEditor, NewWindow, NewWindowContext, NotificationEvent, Notifier, NumberInput, OPENLAYERS_PROJECTION, OnlyFontGlobalStyle, PhoneInput, Radio, RichBoolean, RichBooleanCheckbox, Search, Select, SideMenu, SimpleTable, SingleTag, Size, THEME, TableWithSelectableRows, Tag, TagBullet, TagGroup, TextInput, Textarea, ThemeProvider, Toggle, WSG84_PROJECTION, cleanString, coordinatesAreDistinct, customDayjs, getControlUnitResourceCategoryFromType, getCoordinates, getFilteredCollection, getHashFromCollection, getLocalizedDayjs, getMaybeBooleanFromRichBoolean, getOptionsFromIdAndName, getOptionsFromLabelledEnum, getPseudoRandomString, getSelectedOptionFromOptionValue, getSelectedOptionFromOptionValueInTree, getUtcizedDayjs, humanizePastDate, isArray, isDefined, isEmptyish, isNumeric, isObject, logSoftError, normalizeString, nullify, pluralize, sortCollectionByLocalizedProps, stopMouseEventPropagation, undefine, useClickOutsideEffect, useDeepCompareEffect, useFieldControl, useForceUpdate, useKey, useNewWindow, usePressEscapeEffect, usePrevious };
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": "22.0.0",
4
+ "version": "22.0.1",
5
5
  "license": "AGPL-3.0",
6
6
  "type": "module",
7
7
  "engines": {
@@ -1,19 +0,0 @@
1
- import { type ButtonHTMLAttributes, type FunctionComponent } from 'react';
2
- import { Accent, Size } from '../constants';
3
- import { type IconProps } from '../types/definitions';
4
- export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> & {
5
- Icon?: FunctionComponent<IconProps> | undefined;
6
- accent?: Accent | undefined;
7
- children?: string | undefined;
8
- isFullWidth?: boolean | undefined;
9
- size?: Size | undefined;
10
- /** Prevent onClick event propagation. */
11
- withUnpropagatedClick?: boolean | undefined;
12
- };
13
- export declare function Button({ accent, children, className, Icon, isFullWidth, onClick, size, type, withUnpropagatedClick, ...nativeProps }: ButtonProps): import("react/jsx-runtime").JSX.Element;
14
- export declare const PrimaryButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
15
- export declare const SecondaryButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
16
- export declare const TertiaryButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
17
- export declare const WarningButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
18
- export declare const ErrorButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
19
- //# sourceMappingURL=Button.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/elements/Button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyC,KAAK,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAGhH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAA;AASrD,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,GAAG;IACpF,IAAI,CAAC,EAAE,iBAAiB,CAAC,SAAS,CAAC,GAAG,SAAS,CAAA;IAC/C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACjC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;IACvB,yCAAyC;IACzC,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC5C,CAAA;AACD,wBAAgB,MAAM,CAAC,EACrB,MAAuB,EACvB,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,WAAmB,EACnB,OAAO,EACP,IAAkB,EAClB,IAAe,EACf,qBAA6B,EAC7B,GAAG,WAAW,EACf,EAAE,WAAW,2CAoDb;AAsCD,eAAO,MAAM,aAAa,4GAyBzB,CAAA;AAED,eAAO,MAAM,eAAe,4GAyB3B,CAAA;AAED,eAAO,MAAM,cAAc,4GAyB1B,CAAA;AACD,eAAO,MAAM,aAAa,4GA0BzB,CAAA;AACD,eAAO,MAAM,WAAW,4GAqCvB,CAAA"}