@mw-kit/mw-ui 1.7.46 → 1.7.47

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.
@@ -1,11 +1,14 @@
1
1
  /// <reference types="react" />
2
+ import { ColorOptions } from '../../../../../../theme/interfaces';
3
+ import { DayAppearance } from '../../interfaces';
2
4
  export * from '../../styles';
3
5
  export declare const Footer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
6
  export declare const WeekContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
5
7
  export declare const Header: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
6
8
  interface DayContainerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
7
9
  today: 1 | 0;
8
- appearance?: 'active' | 'highlight' | 'disabled';
10
+ appearance?: DayAppearance;
11
+ activeColor: ColorOptions;
9
12
  }
10
13
  export declare const DayContainer: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, DayContainerProps, never>;
11
14
  export declare const DayIndicator: import("styled-components").StyledComponent<(props: Partial<import("../../../../../Indicator/interfaces").IndicatorProps>) => JSX.Element, import("styled-components").DefaultTheme, {
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ReactNode } from '../../../../interfaces';
3
+ import { ColorOptions } from '../../../../theme/interfaces';
3
4
  import { AbsoluteContainerProps } from '../../../AbsoluteContainer/interfaces';
4
5
  import { IndicatorProps } from '../../../Indicator/interfaces';
5
6
  export interface CalendarInterface {
@@ -7,13 +8,15 @@ export interface CalendarInterface {
7
8
  year: number;
8
9
  weeks: Date[][];
9
10
  }
11
+ export declare type DayAppearance = 'active' | 'highlight' | 'disabled';
10
12
  export interface Common extends React.HTMLAttributes<HTMLDivElement> {
11
13
  label?: ReactNode;
12
14
  initialMonth?: Date;
13
15
  max?: Date;
14
16
  min?: Date;
15
17
  getDay: (date: Date) => {
16
- appearance?: 'active' | 'highlight' | 'disabled';
18
+ appearance?: DayAppearance;
19
+ activeColor?: ColorOptions;
17
20
  onClick?: React.MouseEventHandler<HTMLButtonElement>;
18
21
  onMouseOver?: React.MouseEventHandler<HTMLButtonElement>;
19
22
  onMouseOut?: React.MouseEventHandler<HTMLButtonElement>;
package/dist/index.js CHANGED
@@ -12585,7 +12585,15 @@ var Checkbox = React__default.forwardRef(function (props, ref) {
12585
12585
  bordered = props.bordered;
12586
12586
  var htmlProps = filterObject(props, ['label', 'invalid', 'required', 'padding', 'bordered']);
12587
12587
 
12588
- var _ref = typeof props.label === 'function' ? [props.label] : [LabelContent, props.label],
12588
+ var _ref = function () {
12589
+ if (!props.label) {
12590
+ return [function () {
12591
+ return null;
12592
+ }];
12593
+ }
12594
+
12595
+ return typeof props.label === 'function' ? [props.label] : [LabelContent, props.label];
12596
+ }(),
12589
12597
  LabelComponent = _ref[0],
12590
12598
  children = _ref[1];
12591
12599
 
@@ -12858,9 +12866,14 @@ var MenuComponent = function MenuComponent(props, ref) {
12858
12866
  var children = _ref2.children;
12859
12867
  return React__default.createElement(semanticUiReact.Popup, Object.assign({
12860
12868
  on: 'click',
12861
- position: 'top left',
12869
+ position: 'left center',
12862
12870
  inverted: true,
12863
- wide: true
12871
+ wide: true,
12872
+ popperModifiers: {
12873
+ preventOverflow: {
12874
+ boundariesElement: 'window'
12875
+ }
12876
+ }
12864
12877
  }, rule, {
12865
12878
  trigger: React__default.createElement("div", null, children)
12866
12879
  }));
@@ -13081,6 +13094,7 @@ var Header = styled__default.div(_templateObject3$a || (_templateObject3$a = _ta
13081
13094
  var DayContainer = styled__default.button(_templateObject4$8 || (_templateObject4$8 = _taggedTemplateLiteralLoose(["\n position: relative;\n overflow: hidden;\n\n ", ";\n\n ", "\n\n :disabled {\n color: ", ";\n }\n\n &,\n :after {\n transition-property: background-color, color, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.25s;\n }\n\n ", "\n"])), function (_ref8) {
13082
13095
  var theme = _ref8.theme,
13083
13096
  appearance = _ref8.appearance,
13097
+ activeColor = _ref8.activeColor,
13084
13098
  onClick = _ref8.onClick;
13085
13099
 
13086
13100
  if (!onClick) {
@@ -13096,9 +13110,9 @@ var DayContainer = styled__default.button(_templateObject4$8 || (_templateObject
13096
13110
  } else if (appearance === 'highlight') {
13097
13111
  return styled.css(_templateObject8$5 || (_templateObject8$5 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n ", "\n "])), theme.getColor('blue', 30), hover('blue'));
13098
13112
  } else if (appearance === 'active') {
13099
- return styled.css(_templateObject9$5 || (_templateObject9$5 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n color: ", ";\n :not(:last-child) {\n border-right-color: ", ";\n }\n ", "\n "])), theme.colors.blue, theme.colors.white, function (_ref9) {
13113
+ return styled.css(_templateObject9$5 || (_templateObject9$5 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n color: ", ";\n :not(:last-child) {\n border-right-color: ", ";\n }\n ", "\n "])), theme.colors[activeColor], theme.colors.white, function (_ref9) {
13100
13114
  var theme = _ref9.theme;
13101
- return theme.colors.blue;
13115
+ return theme.colors[activeColor];
13102
13116
  }, hover('white'));
13103
13117
  }
13104
13118
 
@@ -13542,6 +13556,7 @@ var Main = React__default.forwardRef(function (props, ref) {
13542
13556
  onMouseOut: onMouseOut,
13543
13557
  disabled: disabled,
13544
13558
  appearance: appearance,
13559
+ activeColor: details.activeColor || 'blue',
13545
13560
  today: dateCompare(new Date(), date, 'eq', false) ? 1 : 0
13546
13561
  }, day, details.indicator && React__default.createElement(DayIndicator, {
13547
13562
  type: details.indicator