@reportportal/ui-kit 0.0.1-alpha.52 → 0.0.1-alpha.53

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.
Files changed (69) hide show
  1. package/README.md +4 -1
  2. package/dist/common/hooks/useOnClickOutside.d.ts +1 -0
  3. package/dist/components/baseIconButton/baseIconButton.d.ts +1 -0
  4. package/dist/components/baseIconButton/index.d.ts +1 -0
  5. package/dist/components/bubblesLoader/bubblesLoader.d.ts +1 -0
  6. package/dist/components/bubblesLoader/index.d.ts +1 -0
  7. package/dist/components/button/button.d.ts +1 -0
  8. package/dist/components/button/index.d.ts +1 -0
  9. package/dist/components/checkbox/checkbox.d.ts +1 -0
  10. package/dist/components/checkbox/index.d.ts +1 -0
  11. package/dist/components/datePicker/datePicker.d.ts +1 -0
  12. package/dist/components/datePicker/header/datePickerHeader.d.ts +1 -0
  13. package/dist/components/datePicker/header/index.d.ts +1 -0
  14. package/dist/components/datePicker/index.d.ts +3 -1
  15. package/dist/components/datePicker/utils.d.ts +1 -0
  16. package/dist/components/dropdown/constants.d.ts +1 -0
  17. package/dist/components/dropdown/dropdown.d.ts +1 -0
  18. package/dist/components/dropdown/dropdownOption/dropdownOption.d.ts +1 -0
  19. package/dist/components/dropdown/dropdownOption/index.d.ts +1 -0
  20. package/dist/components/dropdown/index.d.ts +1 -0
  21. package/dist/components/dropdown/types.d.ts +1 -0
  22. package/dist/components/dropdown/utils.d.ts +1 -0
  23. package/dist/components/fieldNumber/constants.d.ts +1 -0
  24. package/dist/components/fieldNumber/fieldNumber.d.ts +1 -0
  25. package/dist/components/fieldNumber/index.d.ts +1 -0
  26. package/dist/components/fieldText/fieldText.d.ts +2 -1
  27. package/dist/components/fieldText/index.d.ts +1 -0
  28. package/dist/components/fieldTextFlex/fieldTextFlex.d.ts +1 -0
  29. package/dist/components/fieldTextFlex/index.d.ts +1 -0
  30. package/dist/components/maxValueDisplay/index.d.ts +1 -0
  31. package/dist/components/maxValueDisplay/maxValueDisplay.d.ts +1 -0
  32. package/dist/components/modal/modal.d.ts +1 -0
  33. package/dist/components/modal/modalContent/modalContent.d.ts +1 -0
  34. package/dist/components/modal/modalFooter/modalFooter.d.ts +1 -0
  35. package/dist/components/modal/modalHeader/modalHeader.d.ts +1 -0
  36. package/dist/components/pagination/index.d.ts +1 -0
  37. package/dist/components/pagination/itemsCounter/itemCounter.d.ts +1 -0
  38. package/dist/components/pagination/pageControls/activePage/activePage.d.ts +1 -0
  39. package/dist/components/pagination/pageControls/activePage/pageSelector/pageSelector.d.ts +1 -0
  40. package/dist/components/pagination/pageControls/pageControls.d.ts +1 -0
  41. package/dist/components/pagination/pageControls/pageNavigator/bar/bar.d.ts +1 -0
  42. package/dist/components/pagination/pageControls/pageNavigator/pageNavigator.d.ts +1 -0
  43. package/dist/components/pagination/pageSizeControl/pageSizeControl.d.ts +1 -0
  44. package/dist/components/pagination/pageSizeControl/sizeSelector/sizeSelector.d.ts +1 -0
  45. package/dist/components/pagination/pagination.d.ts +1 -0
  46. package/dist/components/popover/popover.d.ts +1 -0
  47. package/dist/components/radio/index.d.ts +1 -0
  48. package/dist/components/radio/radio.d.ts +1 -0
  49. package/dist/components/radio/radioGroup.d.ts +1 -0
  50. package/dist/components/spinLoader/index.d.ts +1 -0
  51. package/dist/components/spinLoader/spinLoader.d.ts +1 -0
  52. package/dist/components/systemAlert/systemAlert.d.ts +1 -0
  53. package/dist/components/systemAlert/types.d.ts +1 -0
  54. package/dist/components/systemMessage/index.d.ts +1 -0
  55. package/dist/components/systemMessage/systemMessage.d.ts +1 -0
  56. package/dist/components/table/index.d.ts +1 -0
  57. package/dist/components/table/table.d.ts +1 -0
  58. package/dist/components/table/types.d.ts +1 -0
  59. package/dist/components/table/utils.d.ts +1 -0
  60. package/dist/components/themeProvider/index.d.ts +1 -0
  61. package/dist/components/themeProvider/themeProvider.d.ts +1 -0
  62. package/dist/components/toggle/index.d.ts +1 -0
  63. package/dist/components/toggle/toggle.d.ts +1 -0
  64. package/dist/components/tooltip/tooltip.d.ts +1 -0
  65. package/dist/datePicker-e7db2778.js +197 -0
  66. package/dist/datePicker.js +4 -2
  67. package/dist/index.js +2 -2
  68. package/package.json +2 -2
  69. package/dist/datePicker-8c37bd50.js +0 -193
package/README.md CHANGED
@@ -234,6 +234,9 @@ The CSS custom properties that come from DS are prefixed with `rp-ui-base` to av
234
234
 
235
235
  ### Testing
236
236
 
237
+ Each new component/hook/utility **must be** covered by unit/component tests.
238
+ All existing uncovered stuff will be tested gradually in the scope of tech-debt elimination activities.
239
+
237
240
  #### Testing Tools
238
241
 
239
242
  The project uses the following testing tools:
@@ -257,4 +260,4 @@ The project maintains a minimum of 80% test coverage threshold for:
257
260
  - Statements
258
261
  - Branches
259
262
  - Functions
260
- - Lines
263
+ - Lines
@@ -1,2 +1,3 @@
1
1
  import { RefObject } from 'react';
2
+
2
3
  export declare function useOnClickOutside<T extends HTMLElement = HTMLDivElement>(ref: RefObject<T>, handler?: (e?: MouseEvent) => void): void;
@@ -1,4 +1,5 @@
1
1
  import { FC, MouseEventHandler, ReactNode, HTMLAttributes } from 'react';
2
+
2
3
  export interface BaseIconButtonProps extends HTMLAttributes<HTMLButtonElement> {
3
4
  children: ReactNode;
4
5
  className?: string;
@@ -1,4 +1,5 @@
1
1
  import { BaseIconButton, BaseIconButtonProps } from './baseIconButton';
2
+
2
3
  export { BaseIconButton };
3
4
  export type { BaseIconButtonProps };
4
5
  export default BaseIconButton;
@@ -1,4 +1,5 @@
1
1
  import { FC } from 'react';
2
+
2
3
  interface BubblesLoaderProps {
3
4
  color?: string;
4
5
  className?: string;
@@ -1,3 +1,4 @@
1
1
  import { BubblesLoader } from './bubblesLoader';
2
+
2
3
  export { BubblesLoader };
3
4
  export default BubblesLoader;
@@ -1,4 +1,5 @@
1
1
  import { FC, ReactNode, ComponentPropsWithRef, MouseEventHandler } from 'react';
2
+
2
3
  type IconPlace = 'start' | 'end';
3
4
  type ButtonVariant = 'primary' | 'ghost' | 'danger' | 'text';
4
5
  type ButtonWidth = 'content' | 'wide-content' | 'parent';
@@ -1,4 +1,5 @@
1
1
  import { Button, ButtonProps } from './button';
2
+
2
3
  export { Button };
3
4
  export type { ButtonProps };
4
5
  export default Button;
@@ -1,4 +1,5 @@
1
1
  import { FC, ReactNode, ChangeEventHandler, HTMLAttributes } from 'react';
2
+
2
3
  interface CheckboxProps extends HTMLAttributes<HTMLInputElement> {
3
4
  value: boolean;
4
5
  children?: ReactNode;
@@ -1,3 +1,4 @@
1
1
  import { Checkbox } from './checkbox';
2
+
2
3
  export { Checkbox };
3
4
  export default Checkbox;
@@ -1,4 +1,5 @@
1
1
  import { FC, ReactNode, ReactElement } from 'react';
2
+
2
3
  interface DatePickerProps {
3
4
  onChange?: (date: Date | any) => void;
4
5
  onBlur?: () => void;
@@ -1,4 +1,5 @@
1
1
  import { FC, ReactNode } from 'react';
2
+
2
3
  export interface DatePickerHeaderProps {
3
4
  changeYear: (year: number) => void;
4
5
  changeMonth: (month: number) => void;
@@ -1,3 +1,4 @@
1
1
  import { DatePickerHeader } from './datePickerHeader';
2
+
2
3
  export { DatePickerHeader };
3
4
  export default DatePickerHeader;
@@ -1,3 +1,5 @@
1
1
  import { DatePicker } from './datePicker';
2
- export { DatePicker };
2
+ import { registerDatePickerLocale } from './utils';
3
+
4
+ export { DatePicker, registerDatePickerLocale };
3
5
  export default DatePicker;
@@ -1,3 +1,4 @@
1
1
  import { Locale } from 'date-fns';
2
+
2
3
  export declare const registerDatePickerLocale: (language: string, locale: Locale) => void;
3
4
  export declare const getYearsFrom: (start: number, amountYearsToGenerate?: number) => number[];
@@ -1,4 +1,5 @@
1
1
  import { KeyCodes } from '../../common/constants/keyCodes';
2
+
2
3
  export declare const OPEN_DROPDOWN_KEY_CODES: KeyCodes[];
3
4
  export declare const CLOSE_DROPDOWN_KEY_CODES: KeyCodes[];
4
5
  export declare enum EventName {
@@ -1,5 +1,6 @@
1
1
  import { ReactNode, FC } from 'react';
2
2
  import { DropdownVariant, RenderDropdownOption, DropdownOptionType, DropdownValue } from './types';
3
+
3
4
  export interface DropdownProps {
4
5
  options: DropdownOptionType[];
5
6
  value: DropdownValue | DropdownValue[];
@@ -1,3 +1,4 @@
1
1
  import { FC } from 'react';
2
2
  import { DropdownOptionProps } from '../types';
3
+
3
4
  export declare const DropdownOption: FC<DropdownOptionProps>;
@@ -1,3 +1,4 @@
1
1
  import { DropdownOption } from './dropdownOption';
2
+
2
3
  export { DropdownOption };
3
4
  export default DropdownOption;
@@ -1,3 +1,4 @@
1
1
  import { Dropdown } from './dropdown';
2
+
2
3
  export { Dropdown };
3
4
  export default Dropdown;
@@ -1,4 +1,5 @@
1
1
  import { MouseEventHandler, ReactNode } from 'react';
2
+
2
3
  export type DropdownVariant = 'default' | 'ghost';
3
4
  export type DropdownValue = string | boolean | number;
4
5
  export type RenderDropdownOption = (props: DropdownOptionProps) => ReactNode;
@@ -1,4 +1,5 @@
1
1
  import { DropdownValue, DropdownOptionType } from './types';
2
+
2
3
  export declare const calculateDefaultIndex: (options: DropdownOptionType[], selectedValue: DropdownValue | DropdownValue[]) => number;
3
4
  export declare const calculateNextIndex: (options: DropdownOptionType[], index?: number) => number;
4
5
  export declare const calculatePrevIndex: (options: DropdownOptionType[], index?: number) => number;
@@ -1,4 +1,5 @@
1
1
  import { KeyCodes } from '../../common/constants/keyCodes';
2
+
2
3
  export declare const DEFAULT_WIDTH_CH = 5;
3
4
  export declare const MAX_WIDTH_CH = 16;
4
5
  export declare const ALLOWED_KEY_CODES: KeyCodes[];
@@ -1,4 +1,5 @@
1
1
  import { FC, HTMLAttributes, FocusEventHandler } from 'react';
2
+
2
3
  type FieldNumberValue = number | string;
3
4
  interface FieldNumberProps extends Omit<HTMLAttributes<HTMLInputElement>, 'onChange' | 'onFocus'> {
4
5
  onChange: (value: number | string) => void;
@@ -1,3 +1,4 @@
1
1
  import { FieldNumber } from './fieldNumber.js';
2
+
2
3
  export { FieldNumber };
3
4
  export default FieldNumber;
@@ -1,4 +1,5 @@
1
1
  import { ChangeEventHandler, ReactNode, InputHTMLAttributes } from 'react';
2
+
2
3
  interface FieldTextProps extends InputHTMLAttributes<HTMLInputElement> {
3
4
  value?: string;
4
5
  className?: string;
@@ -26,5 +27,5 @@ interface FieldTextProps extends InputHTMLAttributes<HTMLInputElement> {
26
27
  collapsible?: boolean;
27
28
  loading?: boolean;
28
29
  }
29
- export declare const FieldText: import("react").ForwardRefExoticComponent<FieldTextProps & import("react").RefAttributes<HTMLInputElement>>;
30
+ export declare const FieldText: import('react').ForwardRefExoticComponent<FieldTextProps & import('react').RefAttributes<HTMLInputElement>>;
30
31
  export {};
@@ -1,3 +1,4 @@
1
1
  import { FieldText } from './fieldText';
2
+
2
3
  export { FieldText };
3
4
  export default FieldText;
@@ -1,4 +1,5 @@
1
1
  import { ChangeEventHandler, ComponentPropsWithRef, FC, FocusEventHandler, KeyboardEventHandler } from 'react';
2
+
2
3
  export interface FieldTextFlexProps extends ComponentPropsWithRef<'textarea'> {
3
4
  value: string;
4
5
  readonly?: boolean;
@@ -1,3 +1,4 @@
1
1
  import { FieldTextFlex } from './fieldTextFlex';
2
+
2
3
  export { FieldTextFlex };
3
4
  export default FieldTextFlex;
@@ -1,3 +1,4 @@
1
1
  import { MaxValueDisplay } from './maxValueDisplay';
2
+
2
3
  export { MaxValueDisplay };
3
4
  export default MaxValueDisplay;
@@ -1,5 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { ShapeWithClassName } from '../../common/types';
3
+
3
4
  export interface MaxValueDisplayProps {
4
5
  value: number;
5
6
  maxValue?: number;
@@ -1,6 +1,7 @@
1
1
  import { ReactNode, FC } from 'react';
2
2
  import { ButtonProps } from '../button';
3
3
  import { ModalSize } from './modalFooter';
4
+
4
5
  type ModalOverlay = 'default' | 'light-cyan';
5
6
  interface ModalProps {
6
7
  onClose?: () => void;
@@ -1,4 +1,5 @@
1
1
  import { ReactNode, FC } from 'react';
2
+
2
3
  interface ModalContentProps {
3
4
  scrollable?: boolean;
4
5
  children?: ReactNode;
@@ -1,5 +1,6 @@
1
1
  import { ReactNode, FC, MouseEventHandler } from 'react';
2
2
  import { ButtonProps } from '../../button';
3
+
3
4
  export type ModalSize = 'default' | 'small' | 'large';
4
5
  interface ModalFooterProps {
5
6
  closeHandler: MouseEventHandler<HTMLButtonElement>;
@@ -1,4 +1,5 @@
1
1
  import { ReactNode, FC } from 'react';
2
+
2
3
  interface ModalHeaderProps {
3
4
  title?: ReactNode;
4
5
  onClose: () => void;
@@ -1,4 +1,5 @@
1
1
  import { Pagination, PaginationProps } from './pagination';
2
+
2
3
  export { Pagination };
3
4
  export type { PaginationProps };
4
5
  export default Pagination;
@@ -1,4 +1,5 @@
1
1
  import { FC } from 'react';
2
+
2
3
  export interface ItemCounterProps {
3
4
  activePage: number;
4
5
  pageSize: number;
@@ -1,5 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { ChangePage } from '../../types';
3
+
3
4
  interface ActivePageProps {
4
5
  activePage: number;
5
6
  totalPages: number;
@@ -1,5 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { ChangePage } from '../../../types';
3
+
3
4
  interface PageSelectorProps {
4
5
  pageText: string;
5
6
  goActionText: string;
@@ -1,5 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { ChangePage } from '../types';
3
+
3
4
  type PageControlsCaptions = {
4
5
  page: string;
5
6
  goTo: string;
@@ -1,5 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { ChangePage } from '../../../types';
3
+
3
4
  export interface BarProps {
4
5
  totalPages: number;
5
6
  activePage: number;
@@ -1,5 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { ChangePage } from '../../types';
3
+
3
4
  export interface PageNavigatorProps {
4
5
  activePage: number;
5
6
  totalPages: number;
@@ -1,5 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { ChangePageSize } from '../types';
3
+
3
4
  interface PageSizeControlProps {
4
5
  size: number;
5
6
  sizeOptions: number[];
@@ -1,5 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { ChangePageSize } from '../../types';
3
+
3
4
  export interface SizeSelectorProps {
4
5
  currentSize: number;
5
6
  options: number[];
@@ -1,5 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { ChangePageSize, ChangePage } from './types';
3
+
3
4
  type PaginationCaptions = {
4
5
  items?: string;
5
6
  of?: string;
@@ -1,5 +1,6 @@
1
1
  import { FC, ReactNode } from 'react';
2
2
  import { Placement } from '@floating-ui/react';
3
+
3
4
  interface PopoverProps {
4
5
  className?: string;
5
6
  content: ReactNode;
@@ -1,4 +1,5 @@
1
1
  import { Radio, RadioProps } from './radio.js';
2
+
2
3
  export { Radio };
3
4
  export type { RadioProps };
4
5
  export default Radio;
@@ -1,4 +1,5 @@
1
1
  import { ChangeEventHandler, HTMLAttributes, ReactNode, FC } from 'react';
2
+
2
3
  export type RadioValue = string | number;
3
4
  export type RadioOption = {
4
5
  value: RadioValue;
@@ -1,6 +1,7 @@
1
1
  import { FC } from 'react';
2
2
  import { RadioProps } from './index';
3
3
  import { RadioOption } from './radio';
4
+
4
5
  interface RadioGroupProps extends Omit<RadioProps, 'option'> {
5
6
  options: RadioOption[];
6
7
  }
@@ -1,3 +1,4 @@
1
1
  import { SpinLoader } from './spinLoader';
2
+
2
3
  export { SpinLoader };
3
4
  export default SpinLoader;
@@ -1,4 +1,5 @@
1
1
  import { FC } from 'react';
2
+
2
3
  interface SpinLoaderProps {
3
4
  color?: string;
4
5
  className?: string;
@@ -1,3 +1,4 @@
1
1
  import { FC } from 'react';
2
2
  import { SystemAlertProps } from './types';
3
+
3
4
  export declare const SystemAlert: FC<SystemAlertProps>;
@@ -1,4 +1,5 @@
1
1
  import { ReactElement } from 'react';
2
+
2
3
  export declare enum SystemAlertType {
3
4
  INFO = "info",
4
5
  SUCCESS = "success",
@@ -1,3 +1,4 @@
1
1
  import { SystemMessage } from './systemMessage';
2
+
2
3
  export { SystemMessage };
3
4
  export default SystemMessage;
@@ -1,4 +1,5 @@
1
1
  import { FC, ReactNode } from 'react';
2
+
2
3
  type Mode = 'info' | 'warning' | 'error';
3
4
  interface SystemMessageProps {
4
5
  children?: ReactNode;
@@ -1,3 +1,4 @@
1
1
  import { Table } from './table';
2
+
2
3
  export { Table };
3
4
  export default Table;
@@ -1,3 +1,4 @@
1
1
  import { FC } from 'react';
2
2
  import { TableComponentProps } from './types';
3
+
3
4
  export declare const Table: FC<TableComponentProps>;
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+
2
3
  export interface Column {
3
4
  key: string;
4
5
  header: string;
@@ -1,3 +1,4 @@
1
1
  import { Column, RowData, SortConfig } from './types';
2
+
2
3
  export declare const sortTableData: (tableData: RowData[], sortConfig?: SortConfig) => RowData[];
3
4
  export declare const getColumnsKeys: (columns: Column[]) => string[];
@@ -1,3 +1,4 @@
1
1
  import { ThemeProvider } from './themeProvider';
2
+
2
3
  export { ThemeProvider };
3
4
  export default ThemeProvider;
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+
2
3
  type ThemeKey = 'light' | 'dark' | string;
3
4
  interface ITheme {
4
5
  [themeKey: ThemeKey]: string;
@@ -1,3 +1,4 @@
1
1
  import { Toggle } from './toggle';
2
+
2
3
  export { Toggle };
3
4
  export default Toggle;
@@ -1,4 +1,5 @@
1
1
  import { ChangeEventHandler, FC, HTMLAttributes, ReactNode } from 'react';
2
+
2
3
  interface ToggleProps extends HTMLAttributes<HTMLInputElement> {
3
4
  value: boolean;
4
5
  title?: string;
@@ -1,5 +1,6 @@
1
1
  import { FC, ReactNode } from 'react';
2
2
  import { Placement } from '@floating-ui/react';
3
+
3
4
  interface TooltipProps {
4
5
  content: ReactNode;
5
6
  children: ReactNode;
@@ -0,0 +1,197 @@
1
+ import { jsxs as A, Fragment as I, jsx as n } from "react/jsx-runtime";
2
+ import * as U from "react-datepicker";
3
+ import { registerLocale as $ } from "react-datepicker";
4
+ import { c as R } from "./bind-06a7ff84.js";
5
+ import { useMemo as E, useRef as B } from "react";
6
+ import { F as G } from "./fieldText-78c1be1a.js";
7
+ import { a as P, S as H } from "./calendarArrow-3e1339ea.js";
8
+ import { D as T } from "./dropdown-6edea86c.js";
9
+ const pe = (t, s) => {
10
+ $(t, s);
11
+ }, V = (t, s = 20) => {
12
+ const l = t + s;
13
+ return new Array(l - t).fill(void 0).map((g, e) => t - e);
14
+ }, O = "_header_a3cjx_1", W = "_disabled_a3cjx_25", q = "_dropdown_a3cjx_8", z = {
15
+ header: O,
16
+ "dropdowns-wrapper": "_dropdowns-wrapper_a3cjx_8",
17
+ "button-prev": "_button-prev_a3cjx_13",
18
+ "button-next": "_button-next_a3cjx_14",
19
+ disabled: W,
20
+ dropdown: q,
21
+ "month-dropdown": "_month-dropdown_a3cjx_44",
22
+ "toggle-button": "_toggle-button_a3cjx_47"
23
+ }, a = R.bind(z), J = ({
24
+ date: t = /* @__PURE__ */ new Date(),
25
+ changeYear: s = () => {
26
+ },
27
+ changeMonth: l = () => {
28
+ },
29
+ decreaseMonth: g = () => {
30
+ },
31
+ increaseMonth: e = () => {
32
+ },
33
+ prevMonthButtonDisabled: o = !1,
34
+ nextMonthButtonDisabled: h = !1,
35
+ headerNodes: b = null,
36
+ customClassName: w = "",
37
+ yearsOptions: i = [],
38
+ locale: j
39
+ }) => {
40
+ const p = t.getFullYear(), C = t.getMonth(), f = E(() => {
41
+ const r = Array(12).keys(), c = new Intl.DateTimeFormat(j, {
42
+ month: "long"
43
+ }), d = (m) => c.format(new Date(p, m));
44
+ return Array.from(r, d).reduce((m, x, k) => m.concat({
45
+ value: k,
46
+ label: x
47
+ }), []);
48
+ }, []), N = E(() => (i.length > 0 ? i : V(p)).reduce(
49
+ (c, d) => c.concat({ value: d, label: `${d}` }),
50
+ []
51
+ ), [i]), v = (r) => {
52
+ l(r);
53
+ }, y = (r) => {
54
+ s(r);
55
+ };
56
+ return /* @__PURE__ */ A(I, { children: [
57
+ b && /* @__PURE__ */ n("div", { className: a(w), children: b }),
58
+ /* @__PURE__ */ A("div", { className: a("header"), children: [
59
+ /* @__PURE__ */ n(
60
+ "button",
61
+ {
62
+ "aria-label": "Previous Months",
63
+ disabled: o,
64
+ onClick: g,
65
+ className: a("button-prev", { disabled: o }),
66
+ children: /* @__PURE__ */ n(P, {})
67
+ }
68
+ ),
69
+ /* @__PURE__ */ A("div", { className: a("dropdowns-wrapper"), children: [
70
+ /* @__PURE__ */ n(
71
+ T,
72
+ {
73
+ options: f,
74
+ value: C,
75
+ onChange: v,
76
+ transparentBackground: !0,
77
+ className: a("dropdown", "month-dropdown"),
78
+ toggleButtonClassName: a("toggle-button")
79
+ }
80
+ ),
81
+ /* @__PURE__ */ n(
82
+ T,
83
+ {
84
+ options: N,
85
+ value: p,
86
+ onChange: y,
87
+ transparentBackground: !0,
88
+ className: a("dropdown"),
89
+ toggleButtonClassName: a("toggle-button")
90
+ }
91
+ )
92
+ ] }),
93
+ /* @__PURE__ */ n(
94
+ "button",
95
+ {
96
+ "aria-label": "Next Months",
97
+ disabled: h,
98
+ onClick: e,
99
+ className: a("button-next", { disabled: h }),
100
+ children: /* @__PURE__ */ n(P, {})
101
+ }
102
+ )
103
+ ] })
104
+ ] });
105
+ }, K = "_calendar_1jr94_5", Q = "_date_1jr94_90", X = "_disabled_1jr94_202", Z = "_popper_1jr94_210", ee = "_input_1jr94_214", oe = {
106
+ calendar: K,
107
+ "current-date": "_current-date_1jr94_89",
108
+ date: Q,
109
+ "selected-range": "_selected-range_1jr94_119",
110
+ "end-date": "_end-date_1jr94_119",
111
+ disabled: X,
112
+ popper: Z,
113
+ input: ee
114
+ }, ne = U.default, _ = R.bind(oe), te = "en", L = "MM-dd-yyyy", me = ({
115
+ onChange: t = () => {
116
+ },
117
+ disabled: s = !1,
118
+ onBlur: l = () => {
119
+ },
120
+ onFocus: g = () => {
121
+ },
122
+ endDate: e = void 0,
123
+ startDate: o = void 0,
124
+ headerNodes: h = null,
125
+ customClassName: b = "",
126
+ customTimeInput: w = void 0,
127
+ shouldCloseOnSelect: i = !0,
128
+ popperClassName: j = "",
129
+ calendarClassName: p = "",
130
+ fixedHeight: C = !1,
131
+ language: f = te,
132
+ yearsOptions: N = [],
133
+ placeholder: v = L.toUpperCase(),
134
+ dateFormat: y = L,
135
+ selects: r = "start",
136
+ value: c = null
137
+ }) => {
138
+ const d = B(null), S = o == null ? void 0 : o.toDateString(), m = e == null ? void 0 : e.toDateString(), x = e && o && e > o, k = (u) => {
139
+ const F = u.toDateString(), Y = F === S, M = x && F === m, D = o && e && u > o && u < e;
140
+ return _("date", {
141
+ "current-date": Y,
142
+ "selected-range": D && !M,
143
+ "end-date": M && x,
144
+ disabled: s
145
+ });
146
+ };
147
+ return /* @__PURE__ */ n(
148
+ ne,
149
+ {
150
+ customInput: /* @__PURE__ */ n(
151
+ G,
152
+ {
153
+ className: _("input"),
154
+ defaultWidth: !1,
155
+ endIcon: /* @__PURE__ */ n(H, {}),
156
+ ref: d
157
+ }
158
+ ),
159
+ placeholderText: v,
160
+ selected: c,
161
+ startDate: o,
162
+ endDate: e,
163
+ minDate: r === "end" ? o : void 0,
164
+ disabled: s,
165
+ shouldCloseOnSelect: i,
166
+ fixedHeight: C,
167
+ locale: f,
168
+ showPopperArrow: !1,
169
+ dayClassName: k,
170
+ calendarClassName: _(p, "calendar"),
171
+ renderCustomHeader: (u) => /* @__PURE__ */ n(
172
+ J,
173
+ {
174
+ ...u,
175
+ headerNodes: h,
176
+ customClassName: b,
177
+ yearsOptions: N,
178
+ locale: f
179
+ }
180
+ ),
181
+ onChange: t,
182
+ onBlur: l,
183
+ onFocus: g,
184
+ customTimeInput: w,
185
+ showTimeInput: !!w,
186
+ popperClassName: _(j, "popper"),
187
+ dateFormat: y,
188
+ selectsStart: r === "start",
189
+ selectsEnd: r === "end",
190
+ className: _("datepicker")
191
+ }
192
+ );
193
+ };
194
+ export {
195
+ me as D,
196
+ pe as r
197
+ };
@@ -1,4 +1,5 @@
1
- import { D as t } from "./datePicker-8c37bd50.js";
1
+ import { D as t } from "./datePicker-e7db2778.js";
2
+ import { r as n } from "./datePicker-e7db2778.js";
2
3
  import "react/jsx-runtime";
3
4
  import "react-datepicker";
4
5
  import "./bind-06a7ff84.js";
@@ -20,5 +21,6 @@ import "./dropdown-0260bb66.js";
20
21
  import "./checkbox-9a6c7ce1.js";
21
22
  export {
22
23
  t as DatePicker,
23
- t as default
24
+ t as default,
25
+ n as registerDatePickerLocale
24
26
  };
package/dist/index.js CHANGED
@@ -16,7 +16,8 @@ import { Tooltip as q } from "./tooltip.js";
16
16
  import { Popover as J } from "./popover.js";
17
17
  import { P as Q } from "./pagination-066b1b2b.js";
18
18
  import { T as W } from "./table-32fc8c70.js";
19
- import { D as Y } from "./datePicker-8c37bd50.js";
19
+ import { D as Y } from "./datePicker-e7db2778.js";
20
+ import "react-datepicker";
20
21
  import { SystemAlert as _ } from "./systemAlert.js";
21
22
  import { S as oo, a as ro } from "./arrowUp-4a5caee7.js";
22
23
  import { BreadcrumbsTreeIcon as to, ChevronDownDropdownIcon as ao, ChevronRightBreadcrumbsIcon as no, CopyIcon as po, DeleteIcon as mo, EditIcon as so, ExportIcon as co, ExternalLinkIcon as xo, FilterFilledIcon as Io, FilterOutlineIcon as io, FlagIcon as fo, HideIcon as lo, MaximizeIcon as So, MeatballMenuIcon as uo, SearchIcon as Co, SortIcon as Fo } from "./icons.js";
@@ -38,7 +39,6 @@ import "./useOnClickOutside-c332f7d3.js";
38
39
  import "@floating-ui/react-dom";
39
40
  import "downshift";
40
41
  import "@floating-ui/react";
41
- import "react-datepicker";
42
42
  export {
43
43
  oo as ArrowDownIcon,
44
44
  ro as ArrowUpIcon,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reportportal/ui-kit",
3
- "version": "0.0.1-alpha.52",
3
+ "version": "0.0.1-alpha.53",
4
4
  "description": "The UI-kit library for ReportPortal Design System.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -32,7 +32,7 @@
32
32
  "downshift": "^6.1.12",
33
33
  "framer-motion": "^10.15.2",
34
34
  "rc-scrollbars": "^1.1.6",
35
- "react-datepicker": "^7.3.0"
35
+ "react-datepicker": "^7.6.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@storybook/addon-essentials": "^8.2.9",
@@ -1,193 +0,0 @@
1
- import { jsxs as S, Fragment as U, jsx as o } from "react/jsx-runtime";
2
- import $ from "react-datepicker";
3
- import { c as Y } from "./bind-06a7ff84.js";
4
- import { useMemo as E, useRef as B } from "react";
5
- import { F as D } from "./fieldText-78c1be1a.js";
6
- import { a as T, S as G } from "./calendarArrow-3e1339ea.js";
7
- import { D as P } from "./dropdown-6edea86c.js";
8
- const H = (a, c = 20) => {
9
- const l = a + c;
10
- return new Array(l - a).fill(void 0).map((g, e) => a - e);
11
- }, V = "_header_a3cjx_1", O = "_disabled_a3cjx_25", W = "_dropdown_a3cjx_8", q = {
12
- header: V,
13
- "dropdowns-wrapper": "_dropdowns-wrapper_a3cjx_8",
14
- "button-prev": "_button-prev_a3cjx_13",
15
- "button-next": "_button-next_a3cjx_14",
16
- disabled: O,
17
- dropdown: W,
18
- "month-dropdown": "_month-dropdown_a3cjx_44",
19
- "toggle-button": "_toggle-button_a3cjx_47"
20
- }, r = Y.bind(q), z = ({
21
- date: a = /* @__PURE__ */ new Date(),
22
- changeYear: c = () => {
23
- },
24
- changeMonth: l = () => {
25
- },
26
- decreaseMonth: g = () => {
27
- },
28
- increaseMonth: e = () => {
29
- },
30
- prevMonthButtonDisabled: n = !1,
31
- nextMonthButtonDisabled: h = !1,
32
- headerNodes: b = null,
33
- customClassName: w = "",
34
- yearsOptions: i = [],
35
- locale: x
36
- }) => {
37
- const p = a.getFullYear(), C = a.getMonth(), f = E(() => {
38
- const t = Array(12).keys(), s = new Intl.DateTimeFormat(x, {
39
- month: "long"
40
- }), d = (m) => s.format(new Date(p, m));
41
- return Array.from(t, d).reduce((m, j, A) => m.concat({
42
- value: A,
43
- label: j
44
- }), []);
45
- }, []), N = E(() => (i.length > 0 ? i : H(p)).reduce(
46
- (s, d) => s.concat({ value: d, label: `${d}` }),
47
- []
48
- ), [i]), v = (t) => {
49
- l(t);
50
- }, y = (t) => {
51
- c(t);
52
- };
53
- return /* @__PURE__ */ S(U, { children: [
54
- b && /* @__PURE__ */ o("div", { className: r(w), children: b }),
55
- /* @__PURE__ */ S("div", { className: r("header"), children: [
56
- /* @__PURE__ */ o(
57
- "button",
58
- {
59
- "aria-label": "Previous Months",
60
- disabled: n,
61
- onClick: g,
62
- className: r("button-prev", { disabled: n }),
63
- children: /* @__PURE__ */ o(T, {})
64
- }
65
- ),
66
- /* @__PURE__ */ S("div", { className: r("dropdowns-wrapper"), children: [
67
- /* @__PURE__ */ o(
68
- P,
69
- {
70
- options: f,
71
- value: C,
72
- onChange: v,
73
- transparentBackground: !0,
74
- className: r("dropdown", "month-dropdown"),
75
- toggleButtonClassName: r("toggle-button")
76
- }
77
- ),
78
- /* @__PURE__ */ o(
79
- P,
80
- {
81
- options: N,
82
- value: p,
83
- onChange: y,
84
- transparentBackground: !0,
85
- className: r("dropdown"),
86
- toggleButtonClassName: r("toggle-button")
87
- }
88
- )
89
- ] }),
90
- /* @__PURE__ */ o(
91
- "button",
92
- {
93
- "aria-label": "Next Months",
94
- disabled: h,
95
- onClick: e,
96
- className: r("button-next", { disabled: h }),
97
- children: /* @__PURE__ */ o(T, {})
98
- }
99
- )
100
- ] })
101
- ] });
102
- }, J = "_calendar_1jr94_5", K = "_date_1jr94_90", Q = "_disabled_1jr94_202", X = "_popper_1jr94_210", Z = "_input_1jr94_214", ee = {
103
- calendar: J,
104
- "current-date": "_current-date_1jr94_89",
105
- date: K,
106
- "selected-range": "_selected-range_1jr94_119",
107
- "end-date": "_end-date_1jr94_119",
108
- disabled: Q,
109
- popper: X,
110
- input: Z
111
- }, _ = Y.bind(ee), ne = "en", R = "MM-dd-yyyy", le = ({
112
- onChange: a = () => {
113
- },
114
- disabled: c = !1,
115
- onBlur: l = () => {
116
- },
117
- onFocus: g = () => {
118
- },
119
- endDate: e = void 0,
120
- startDate: n = void 0,
121
- headerNodes: h = null,
122
- customClassName: b = "",
123
- customTimeInput: w = void 0,
124
- shouldCloseOnSelect: i = !0,
125
- popperClassName: x = "",
126
- calendarClassName: p = "",
127
- fixedHeight: C = !1,
128
- language: f = ne,
129
- yearsOptions: N = [],
130
- placeholder: v = R.toUpperCase(),
131
- dateFormat: y = R,
132
- selects: t = "start",
133
- value: s = null
134
- }) => {
135
- const d = B(null), F = n == null ? void 0 : n.toDateString(), m = e == null ? void 0 : e.toDateString(), j = e && n && e > n, A = (u) => {
136
- const k = u.toDateString(), I = k === F, M = j && k === m, L = n && e && u > n && u < e;
137
- return _("date", {
138
- "current-date": I,
139
- "selected-range": L && !M,
140
- "end-date": M && j,
141
- disabled: c
142
- });
143
- };
144
- return /* @__PURE__ */ o(
145
- $,
146
- {
147
- customInput: /* @__PURE__ */ o(
148
- D,
149
- {
150
- className: _("input"),
151
- defaultWidth: !1,
152
- endIcon: /* @__PURE__ */ o(G, {}),
153
- ref: d
154
- }
155
- ),
156
- placeholderText: v,
157
- selected: s,
158
- startDate: n,
159
- endDate: e,
160
- minDate: t === "end" ? n : void 0,
161
- disabled: c,
162
- shouldCloseOnSelect: i,
163
- fixedHeight: C,
164
- locale: f,
165
- showPopperArrow: !1,
166
- dayClassName: A,
167
- calendarClassName: _(p, "calendar"),
168
- renderCustomHeader: (u) => /* @__PURE__ */ o(
169
- z,
170
- {
171
- ...u,
172
- headerNodes: h,
173
- customClassName: b,
174
- yearsOptions: N,
175
- locale: f
176
- }
177
- ),
178
- onChange: a,
179
- onBlur: l,
180
- onFocus: g,
181
- customTimeInput: w,
182
- showTimeInput: !!w,
183
- popperClassName: _(x, "popper"),
184
- dateFormat: y,
185
- selectsStart: t === "start",
186
- selectsEnd: t === "end",
187
- className: _("datepicker")
188
- }
189
- );
190
- };
191
- export {
192
- le as D
193
- };