colibri-ui 0.8.36 → 0.8.38

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.
@@ -93,7 +93,7 @@ var Month = function Month(props) {
93
93
  key: "week-".concat(arguments.length <= 1 ? undefined : arguments[1]),
94
94
  className: clx(styles__default.default.week)
95
95
  }, days.map(function (day) {
96
- var key = "day-".concat(arguments.length <= 1 ? undefined : arguments[1]);
96
+ var key = "".concat(year, "-").concat(month, "-").concat(day.day);
97
97
  if (day.isDummy) {
98
98
  return /*#__PURE__*/React__namespace.createElement("li", {
99
99
  className: clx(styles__default.default.day),
@@ -13,38 +13,33 @@
13
13
  display: flex;
14
14
  flex-direction: column;
15
15
  width: 100%;
16
+ height: auto;
16
17
  }
17
18
 
18
19
  .week {
19
- align-items: stretch;
20
- display: flex;
21
- flex-wrap: nowrap;
22
- justify-content: space-between;
23
- list-style: none;
24
- margin: 0;
20
+ display: grid;
21
+ grid-template-columns: repeat(7, 1fr);
22
+ gap: 4px;
23
+ justify-content: center;
25
24
  padding: 0;
25
+ margin: 2px 0;
26
26
  }
27
27
 
28
28
  .day {
29
29
  display: block;
30
- height: 32px;
30
+ min-height: 32px;
31
31
  position: relative;
32
32
  text-align: center;
33
33
  width: 32px;
34
34
  }
35
35
 
36
36
  .legend {
37
- align-items: stretch;
38
- display: flex;
39
- flex-wrap: nowrap;
40
- font-size: 14px;
41
- justify-content: space-between;
42
- line-height: 20px;
43
- list-style: none;
44
- margin: 0;
45
- padding: 0;
37
+ display: grid;
38
+ grid-template-columns: repeat(7, 1fr);
39
+ gap: 4px;
46
40
  text-align: center;
47
- text-transform: capitalize;
41
+ padding: 0;
42
+ margin: 2px 0;
48
43
  }
49
44
 
50
45
  .selected-range-day {
package/Calendar/index.js CHANGED
@@ -38,7 +38,7 @@ var Calendar = function Calendar(_ref) {
38
38
  onChange = _ref.onChange,
39
39
  onCancel = _ref.onCancel,
40
40
  _ref$minWidth = _ref.minWidth,
41
- minWidth = _ref$minWidth === void 0 ? 360 : _ref$minWidth,
41
+ minWidth = _ref$minWidth === void 0 ? 320 : _ref$minWidth,
42
42
  _ref$withContinueButt = _ref.withContinueButton,
43
43
  withContinueButton = _ref$withContinueButt === void 0 ? false : _ref$withContinueButt,
44
44
  className = _ref.className,
@@ -185,7 +185,7 @@ var Calendar = function Calendar(_ref) {
185
185
  },
186
186
  "data-testid": "calendar",
187
187
  ref: $root
188
- }, /*#__PURE__*/React__default.default.createElement("div", null, contentWidth ? (/*#__PURE__*/React__default.default.createElement("div", {
188
+ }, /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, contentWidth ? (/*#__PURE__*/React__default.default.createElement("div", {
189
189
  "data-component": "Months",
190
190
  className: clx(styles__default.default.months),
191
191
  style: {
@@ -4,7 +4,8 @@
4
4
  -moz-osx-font-smoothing: grayscale;
5
5
  -webkit-font-smoothing: antialiased;
6
6
  gap: 1rem;
7
- min-width: 360px;
7
+ min-width: 320px;
8
+ min-height: 360px;
8
9
  overflow: hidden;
9
10
  position: relative;
10
11
  text-rendering: optimizelegibility;
@@ -33,7 +34,7 @@
33
34
  padding: 0 16px;
34
35
  position: absolute;
35
36
  top: 0;
36
- width: 80px;
37
+ width: 60px;
37
38
  }
38
39
  .month-control[disabled] {
39
40
  cursor: default;
@@ -3,8 +3,4 @@ export type DatePreset = {
3
3
  date: string;
4
4
  period: number;
5
5
  };
6
- export declare function getPresets(presets: string[]): ({
7
- name: string;
8
- date: string;
9
- period: number;
10
- } | undefined)[] | undefined;
6
+ export declare function getPresets(presets: string[]): DatePreset[];
package/Input/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { InputProps } from "./index.props";
3
- declare const Input: ({ className, startIcon, endIcon, label, hint, hasError, required, onChange, inputRef, disabled, variant, size, ref, ...props }: InputProps) => React.JSX.Element;
3
+ declare const Input: ({ className, startIcon, endIcon, label, hint, hasError, required, onChange, onFocus, onBlur, onKeyDown, inputRef, disabled, variant, size, ref, ...props }: InputProps) => React.JSX.Element;
4
4
  export default Input;
package/Input/index.js CHANGED
@@ -23,6 +23,9 @@ var Input = function Input(_a) {
23
23
  hasError = _a.hasError,
24
24
  required = _a.required,
25
25
  onChange = _a.onChange,
26
+ onFocus = _a.onFocus,
27
+ onBlur = _a.onBlur,
28
+ onKeyDown = _a.onKeyDown,
26
29
  inputRef = _a.inputRef,
27
30
  disabled = _a.disabled,
28
31
  _a$variant = _a.variant,
@@ -30,7 +33,7 @@ var Input = function Input(_a) {
30
33
  _a$size = _a.size,
31
34
  size = _a$size === void 0 ? "m" : _a$size,
32
35
  ref = _a.ref,
33
- props = tslib.__rest(_a, ["className", "startIcon", "endIcon", "label", "hint", "hasError", "required", "onChange", "inputRef", "disabled", "variant", "size", "ref"]);
36
+ props = tslib.__rest(_a, ["className", "startIcon", "endIcon", "label", "hint", "hasError", "required", "onChange", "onFocus", "onBlur", "onKeyDown", "inputRef", "disabled", "variant", "size", "ref"]);
34
37
  return /*#__PURE__*/React__default.default.createElement(index.default, {
35
38
  className: classNames__default.default(className),
36
39
  label: label,
@@ -48,6 +51,9 @@ var Input = function Input(_a) {
48
51
  }, /*#__PURE__*/React__default.default.createElement(index$2.default, Object.assign({
49
52
  ref: inputRef,
50
53
  onChange: onChange,
54
+ onFocus: onFocus,
55
+ onBlur: onBlur,
56
+ onKeyDown: onKeyDown,
51
57
  type: "text"
52
58
  }, props))));
53
59
  };
@@ -1,4 +1,4 @@
1
- import type { ChangeEvent, ForwardedRef, InputHTMLAttributes, ReactNode, Ref } from "react";
1
+ import type { ChangeEvent, ForwardedRef, InputHTMLAttributes, ReactNode, FocusEvent, KeyboardEvent, FormEvent, Ref } from "react";
2
2
  import type { FormFieldProps } from "../base/FormField/index.props";
3
3
  import type { Size, Variant } from "../base/InputRoot/index.props";
4
4
  export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "size">, Omit<FormFieldProps, "children"> {
@@ -8,6 +8,10 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
8
8
  inputRef?: ForwardedRef<HTMLInputElement>;
9
9
  label?: ReactNode;
10
10
  onChange?: (e: ChangeEvent<HTMLInputElement>, value: string) => void;
11
+ onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
12
+ onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
13
+ onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
14
+ onInput?: (event: FormEvent<HTMLInputElement>) => void;
11
15
  ref?: Ref<HTMLInputElement>;
12
16
  required?: boolean;
13
17
  size?: Size;
@@ -66,7 +66,7 @@ var Month = function Month(props) {
66
66
  key: "week-".concat(arguments.length <= 1 ? undefined : arguments[1]),
67
67
  className: clx(styles.week)
68
68
  }, days.map(function (day) {
69
- var key = "day-".concat(arguments.length <= 1 ? undefined : arguments[1]);
69
+ var key = "".concat(year, "-").concat(month, "-").concat(day.day);
70
70
  if (day.isDummy) {
71
71
  return /*#__PURE__*/React.createElement("li", {
72
72
  className: clx(styles.day),
@@ -13,38 +13,33 @@
13
13
  display: flex;
14
14
  flex-direction: column;
15
15
  width: 100%;
16
+ height: auto;
16
17
  }
17
18
 
18
19
  .week {
19
- align-items: stretch;
20
- display: flex;
21
- flex-wrap: nowrap;
22
- justify-content: space-between;
23
- list-style: none;
24
- margin: 0;
20
+ display: grid;
21
+ grid-template-columns: repeat(7, 1fr);
22
+ gap: 4px;
23
+ justify-content: center;
25
24
  padding: 0;
25
+ margin: 2px 0;
26
26
  }
27
27
 
28
28
  .day {
29
29
  display: block;
30
- height: 32px;
30
+ min-height: 32px;
31
31
  position: relative;
32
32
  text-align: center;
33
33
  width: 32px;
34
34
  }
35
35
 
36
36
  .legend {
37
- align-items: stretch;
38
- display: flex;
39
- flex-wrap: nowrap;
40
- font-size: 14px;
41
- justify-content: space-between;
42
- line-height: 20px;
43
- list-style: none;
44
- margin: 0;
45
- padding: 0;
37
+ display: grid;
38
+ grid-template-columns: repeat(7, 1fr);
39
+ gap: 4px;
46
40
  text-align: center;
47
- text-transform: capitalize;
41
+ padding: 0;
42
+ margin: 2px 0;
48
43
  }
49
44
 
50
45
  .selected-range-day {
@@ -27,7 +27,7 @@ var Calendar = function Calendar(_ref) {
27
27
  onChange = _ref.onChange,
28
28
  onCancel = _ref.onCancel,
29
29
  _ref$minWidth = _ref.minWidth,
30
- minWidth = _ref$minWidth === void 0 ? 360 : _ref$minWidth,
30
+ minWidth = _ref$minWidth === void 0 ? 320 : _ref$minWidth,
31
31
  _ref$withContinueButt = _ref.withContinueButton,
32
32
  withContinueButton = _ref$withContinueButt === void 0 ? false : _ref$withContinueButt,
33
33
  className = _ref.className,
@@ -174,7 +174,7 @@ var Calendar = function Calendar(_ref) {
174
174
  },
175
175
  "data-testid": "calendar",
176
176
  ref: $root
177
- }, /*#__PURE__*/React__default.createElement("div", null, contentWidth ? (/*#__PURE__*/React__default.createElement("div", {
177
+ }, /*#__PURE__*/React__default.createElement(React__default.Fragment, null, contentWidth ? (/*#__PURE__*/React__default.createElement("div", {
178
178
  "data-component": "Months",
179
179
  className: clx(styles.months),
180
180
  style: {
@@ -4,7 +4,8 @@
4
4
  -moz-osx-font-smoothing: grayscale;
5
5
  -webkit-font-smoothing: antialiased;
6
6
  gap: 1rem;
7
- min-width: 360px;
7
+ min-width: 320px;
8
+ min-height: 360px;
8
9
  overflow: hidden;
9
10
  position: relative;
10
11
  text-rendering: optimizelegibility;
@@ -33,7 +34,7 @@
33
34
  padding: 0 16px;
34
35
  position: absolute;
35
36
  top: 0;
36
- width: 80px;
37
+ width: 60px;
37
38
  }
38
39
  .month-control[disabled] {
39
40
  cursor: default;
@@ -3,8 +3,4 @@ export type DatePreset = {
3
3
  date: string;
4
4
  period: number;
5
5
  };
6
- export declare function getPresets(presets: string[]): ({
7
- name: string;
8
- date: string;
9
- period: number;
10
- } | undefined)[] | undefined;
6
+ export declare function getPresets(presets: string[]): DatePreset[];
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { InputProps } from "./index.props";
3
- declare const Input: ({ className, startIcon, endIcon, label, hint, hasError, required, onChange, inputRef, disabled, variant, size, ref, ...props }: InputProps) => React.JSX.Element;
3
+ declare const Input: ({ className, startIcon, endIcon, label, hint, hasError, required, onChange, onFocus, onBlur, onKeyDown, inputRef, disabled, variant, size, ref, ...props }: InputProps) => React.JSX.Element;
4
4
  export default Input;
@@ -14,6 +14,9 @@ var Input = function Input(_a) {
14
14
  hasError = _a.hasError,
15
15
  required = _a.required,
16
16
  onChange = _a.onChange,
17
+ onFocus = _a.onFocus,
18
+ onBlur = _a.onBlur,
19
+ onKeyDown = _a.onKeyDown,
17
20
  inputRef = _a.inputRef,
18
21
  disabled = _a.disabled,
19
22
  _a$variant = _a.variant,
@@ -21,7 +24,7 @@ var Input = function Input(_a) {
21
24
  _a$size = _a.size,
22
25
  size = _a$size === void 0 ? "m" : _a$size,
23
26
  ref = _a.ref,
24
- props = __rest(_a, ["className", "startIcon", "endIcon", "label", "hint", "hasError", "required", "onChange", "inputRef", "disabled", "variant", "size", "ref"]);
27
+ props = __rest(_a, ["className", "startIcon", "endIcon", "label", "hint", "hasError", "required", "onChange", "onFocus", "onBlur", "onKeyDown", "inputRef", "disabled", "variant", "size", "ref"]);
25
28
  return /*#__PURE__*/React__default.createElement(FormField, {
26
29
  className: classNames(className),
27
30
  label: label,
@@ -39,6 +42,9 @@ var Input = function Input(_a) {
39
42
  }, /*#__PURE__*/React__default.createElement(BaseInput, Object.assign({
40
43
  ref: inputRef,
41
44
  onChange: onChange,
45
+ onFocus: onFocus,
46
+ onBlur: onBlur,
47
+ onKeyDown: onKeyDown,
42
48
  type: "text"
43
49
  }, props))));
44
50
  };
@@ -1,4 +1,4 @@
1
- import type { ChangeEvent, ForwardedRef, InputHTMLAttributes, ReactNode, Ref } from "react";
1
+ import type { ChangeEvent, ForwardedRef, InputHTMLAttributes, ReactNode, FocusEvent, KeyboardEvent, FormEvent, Ref } from "react";
2
2
  import type { FormFieldProps } from "../base/FormField/index.props";
3
3
  import type { Size, Variant } from "../base/InputRoot/index.props";
4
4
  export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "size">, Omit<FormFieldProps, "children"> {
@@ -8,6 +8,10 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
8
8
  inputRef?: ForwardedRef<HTMLInputElement>;
9
9
  label?: ReactNode;
10
10
  onChange?: (e: ChangeEvent<HTMLInputElement>, value: string) => void;
11
+ onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
12
+ onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
13
+ onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
14
+ onInput?: (event: FormEvent<HTMLInputElement>) => void;
11
15
  ref?: Ref<HTMLInputElement>;
12
16
  required?: boolean;
13
17
  size?: Size;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "colibri-ui",
3
- "version": "0.8.36",
3
+ "version": "0.8.38",
4
4
  "description": "React UI components library",
5
5
  "main": "index.js",
6
6
  "scripts": {},