@digital-ai/dot-components 2.5.5 → 2.6.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.
@@ -34,6 +34,7 @@ export type { progressColorOptions, progressVariantOptions, ProgressProps, } fro
34
34
  export type { FileItemProps, FileUploadError, FileUploadProps, ListItemFile, MappedFile, MappedListItemFile, } from './file-upload';
35
35
  export type { LinearProgressColor, LinearProgressProps, LinearProgressVariant, } from './linear-progress';
36
36
  export type { DatePickerLocale, DatePickerProps, FieldChangeHandlerContext, } from './date-picker';
37
+ export type { TimePickerProps } from './time-picker';
37
38
  export { DotAccordion } from './accordion/Accordion';
38
39
  export { DotActionToolbar } from './action-toolbar/ActionToolbar';
39
40
  export { DotAlertBanner } from './alert-banner/AlertBanner';
@@ -81,6 +82,7 @@ export { DotSidebar } from './sidebar/Sidebar';
81
82
  export { DotSkeleton } from './skeleton/Skeleton';
82
83
  export { DotSnackbar, DotSnackbarContainer, DotSnackbarProvider, useDotSnackbarContext, } from './snackbar';
83
84
  export { DotSplitButton } from './split-button/SplitButton';
85
+ export { DotStepper } from './stepper/Stepper';
84
86
  export { DotProgressButton } from './progress-button/ProgressButton';
85
87
  export { DotSwitch } from './switch';
86
88
  export { DotHeaderRow, DotTable, DotTablePagination, DotTableActions, DotTableAction, } from './table';
@@ -94,4 +96,5 @@ export { DotTruncateWithTooltip } from './truncate-with-tooltip';
94
96
  export { DotDraggableList } from './draggable-list';
95
97
  export { DotLinearProgress } from './linear-progress';
96
98
  export { DotDatePicker } from './date-picker';
99
+ export { Daytime, DotTimePicker, mockScrollIntoView } from './time-picker';
97
100
  export { CreateUUID } from './createUUID';
@@ -1,3 +1,4 @@
1
1
  import { Theme } from '@mui/material';
2
2
  export declare const formHelperTextRootStyles: (theme: Theme) => import("styled-components").FlattenSimpleInterpolation;
3
3
  export declare const adornmentIconStyles: () => import("styled-components").FlattenSimpleInterpolation;
4
+ export declare const pickerInputStyles: (theme: Theme) => import("styled-components").FlattenSimpleInterpolation;
@@ -2,7 +2,7 @@ import { ComponentMeta, Story } from '@storybook/react';
2
2
  import { SidebarProps } from './Sidebar';
3
3
  declare const _default: ComponentMeta<({ appLogo, appLogoSmall, ariaLabel, backItem, brandDesc, children, className, collapsable, "data-testid": dataTestId, displayAppLogo, displayBrand, goBack, navItems, nestedListType, onCollapseChange, open, title, titleAvatarProps, width, }: SidebarProps) => JSX.Element>;
4
4
  export default _default;
5
- export declare const Default: Story<SidebarProps>;
6
- export declare const WithReactRouter: Story<SidebarProps>;
7
- export declare const WithTooltipsWhenCollapsed: Story<SidebarProps>;
8
- export declare const WithBackItem: Story<SidebarProps>;
5
+ export declare const Default: Story;
6
+ export declare const WithReactRouter: Story;
7
+ export declare const WithTooltipsWhenCollapsed: Story;
8
+ export declare const WithBackItem: Story;
@@ -2,7 +2,7 @@ import { MouseEvent } from 'react';
2
2
  import { ListItemProps } from '../list/utils/models';
3
3
  export declare const childElement: JSX.Element;
4
4
  export declare const getNavigationItems: (isSelected: (key: number) => boolean, handleClick: (key: number) => void) => ({
5
- startIconId: string;
5
+ startIcon: JSX.Element;
6
6
  onClick: import("@storybook/addon-actions").HandlerFunction;
7
7
  items: ({
8
8
  text: string;
@@ -24,7 +24,6 @@ export declare const getNavigationItems: (isSelected: (key: number) => boolean,
24
24
  selected?: undefined;
25
25
  })[];
26
26
  text: string;
27
- startIcon?: undefined;
28
27
  endIconId?: undefined;
29
28
  selected?: undefined;
30
29
  divider?: undefined;
@@ -44,7 +43,6 @@ export declare const getNavigationItems: (isSelected: (key: number) => boolean,
44
43
  })[];
45
44
  startIcon: JSX.Element;
46
45
  text: string;
47
- startIconId?: undefined;
48
46
  onClick?: undefined;
49
47
  endIconId?: undefined;
50
48
  selected?: undefined;
@@ -55,16 +53,14 @@ export declare const getNavigationItems: (isSelected: (key: number) => boolean,
55
53
  onClick: (_event: MouseEvent) => void;
56
54
  selected: boolean;
57
55
  text: string;
58
- startIconId?: undefined;
59
56
  items?: undefined;
60
57
  divider?: undefined;
61
58
  } | {
62
59
  text: string;
63
60
  divider: boolean;
64
- startIconId?: undefined;
61
+ startIcon?: undefined;
65
62
  onClick?: undefined;
66
63
  items?: undefined;
67
- startIcon?: undefined;
68
64
  endIconId?: undefined;
69
65
  selected?: undefined;
70
66
  } | {
@@ -72,17 +68,15 @@ export declare const getNavigationItems: (isSelected: (key: number) => boolean,
72
68
  onClick: (_event: MouseEvent) => void;
73
69
  selected: boolean;
74
70
  text: string;
75
- startIconId?: undefined;
76
71
  items?: undefined;
77
72
  endIconId?: undefined;
78
73
  divider?: undefined;
79
74
  } | {
80
75
  divider: boolean;
81
- startIconId?: undefined;
76
+ startIcon?: undefined;
82
77
  onClick?: undefined;
83
78
  items?: undefined;
84
79
  text?: undefined;
85
- startIcon?: undefined;
86
80
  endIconId?: undefined;
87
81
  selected?: undefined;
88
82
  })[];
@@ -0,0 +1,60 @@
1
+ import { MouseEvent, KeyboardEvent, ReactNode } from 'react';
2
+ import { CommonProps } from '../CommonProps';
3
+ import { CssCellProps } from '../css-grid/CssCell';
4
+ export declare const defaultCellProps: CssCellProps;
5
+ export declare type StepperOrientation = 'horizontal' | 'vertical';
6
+ export declare type StepsPosition = 'left' | 'right';
7
+ export interface StepProps extends CommonProps {
8
+ /** if set to `true` the step will display a checkmark icon */
9
+ completed?: boolean;
10
+ /** will be displayed in the right-hand side of the step */
11
+ content?: ReactNode;
12
+ /** will be displayed below the label of the step */
13
+ description?: ReactNode;
14
+ /** if set to `true` the step will be completely disabled */
15
+ disabled?: boolean;
16
+ /** if set to `true` the step will display a error icon and color */
17
+ error?: boolean;
18
+ /** if set to `true`, content will take half of the width, otherwise it takes full width by default */
19
+ halfWidthContent?: boolean;
20
+ /** if specified, the icon will be used for the step instead of the default icon */
21
+ iconId?: string;
22
+ /** order of the step in the list */
23
+ id: number;
24
+ /** determines if the step is currently in progress */
25
+ inProgress?: boolean;
26
+ /** displays the step title */
27
+ label: string;
28
+ /** function that is called when the step is clicked */
29
+ onClick?: () => void;
30
+ /** callback function that is called when the step is completed */
31
+ onComplete?: () => void;
32
+ onError?: (isValid: boolean) => void;
33
+ }
34
+ export interface StepperProps extends CommonProps {
35
+ /** determines the `id` of the step which is active */
36
+ activeStep?: number;
37
+ /** final content displayed after the last step is completed */
38
+ finalContent?: ReactNode;
39
+ /** initial content displayed before any step is active, ie when `activeStep` is 0 */
40
+ initialContent?: ReactNode;
41
+ /** if passed, will overwrite the default "next" button text */
42
+ nextButtonText?: string;
43
+ /** if set to `true`, the "next" button will be disabled */
44
+ nextStepDisabled?: boolean;
45
+ /** function that is called if the "previous" button is clicked */
46
+ onBack?: () => void;
47
+ /** function that is called if the "cancel" button is clicked */
48
+ onCancel?: (event: MouseEvent<Element> | KeyboardEvent<Element>) => void;
49
+ /** function that is called when all steps are finished and the "submit" button is clicked */
50
+ onSubmit?: () => void;
51
+ /** orientation of the stepper */
52
+ orientation?: StepperOrientation;
53
+ /** array of steps to be displayed */
54
+ steps: StepProps[];
55
+ /** determines where to display the array of steps */
56
+ stepsPosition?: StepsPosition;
57
+ /** if passed, will overwrite the default "submit" button text */
58
+ submitButtonText?: string;
59
+ }
60
+ export declare const DotStepper: ({ activeStep, ariaLabel, className, "data-testid": dataTestId, finalContent, initialContent, nextButtonText, nextStepDisabled, onBack, onCancel, onSubmit, orientation, steps, stepsPosition, submitButtonText, }: StepperProps) => JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { ComponentMeta, Story } from '@storybook/react';
2
+ import { StepperProps } from './Stepper';
3
+ declare const _default: ComponentMeta<({ activeStep, ariaLabel, className, "data-testid": dataTestId, finalContent, initialContent, nextButtonText, nextStepDisabled, onBack, onCancel, onSubmit, orientation, steps, stepsPosition, submitButtonText, }: StepperProps) => JSX.Element>;
4
+ export default _default;
5
+ export declare const Default: Story<StepperProps>;
6
+ export declare const WithStepDescription: Story<StepperProps>;
7
+ export declare const WithHorizontalOrientation: Story<StepperProps>;
8
+ export declare const WithErrorStep: Story<StepperProps>;
9
+ export declare const WithInitialAndFinalContent: Story<StepperProps>;
10
+ export declare const WithStepperListOnRightSide: Story<StepperProps>;
@@ -0,0 +1,80 @@
1
+ export declare const demoSteps: ({
2
+ content: string;
3
+ completed: boolean;
4
+ iconId: string;
5
+ id: number;
6
+ label: string;
7
+ halfWidthContent?: undefined;
8
+ inProgress?: undefined;
9
+ } | {
10
+ content: JSX.Element;
11
+ halfWidthContent: boolean;
12
+ id: number;
13
+ inProgress: boolean;
14
+ label: string;
15
+ completed?: undefined;
16
+ iconId?: undefined;
17
+ } | {
18
+ content: JSX.Element;
19
+ id: number;
20
+ label: string;
21
+ completed?: undefined;
22
+ iconId?: undefined;
23
+ halfWidthContent?: undefined;
24
+ inProgress?: undefined;
25
+ })[];
26
+ export declare const withErrorStep: ({
27
+ content: string;
28
+ completed: boolean;
29
+ iconId: string;
30
+ id: number;
31
+ label: string;
32
+ halfWidthContent?: undefined;
33
+ inProgress?: undefined;
34
+ } | {
35
+ content: JSX.Element;
36
+ halfWidthContent: boolean;
37
+ id: number;
38
+ inProgress: boolean;
39
+ label: string;
40
+ completed?: undefined;
41
+ iconId?: undefined;
42
+ } | {
43
+ content: JSX.Element;
44
+ id: number;
45
+ label: string;
46
+ completed?: undefined;
47
+ iconId?: undefined;
48
+ halfWidthContent?: undefined;
49
+ inProgress?: undefined;
50
+ } | {
51
+ content: string;
52
+ error: boolean;
53
+ id: number;
54
+ label: string;
55
+ })[];
56
+ export declare const withStepDescription: ({
57
+ content: string;
58
+ description: string;
59
+ completed: boolean;
60
+ iconId: string;
61
+ id: number;
62
+ label: string;
63
+ disabled?: undefined;
64
+ } | {
65
+ content: JSX.Element;
66
+ description: string;
67
+ id: number;
68
+ label: string;
69
+ completed?: undefined;
70
+ iconId?: undefined;
71
+ disabled?: undefined;
72
+ } | {
73
+ content: JSX.Element;
74
+ description: JSX.Element;
75
+ disabled: boolean;
76
+ id: number;
77
+ label: string;
78
+ completed?: undefined;
79
+ iconId?: undefined;
80
+ })[];
@@ -0,0 +1,11 @@
1
+ export declare const rootClassName = "dot-stepper";
2
+ export declare const stepListClassName = "dot-stepper-list";
3
+ export declare const contentClassName = "dot-stepper-content";
4
+ export declare const StyledStepper: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ export declare const StepContentWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
6
+ export declare const StepDescription: import("styled-components").StyledComponent<({ ariaLabel, className, "data-testid": dataTestId, children, component, noMarginBottom, noWrap, variant, }: import("../typography/Typography").TypographyProps) => JSX.Element, any, {}, never>;
7
+ interface StyledStepActionsContainerProps {
8
+ displayCancelButton?: boolean;
9
+ }
10
+ export declare const StepActionsContainer: import("styled-components").StyledComponent<"div", any, StyledStepActionsContainerProps, never>;
11
+ export {};
@@ -0,0 +1,48 @@
1
+ import { ReactNode } from 'react';
2
+ import { FieldChangeHandlerContext } from '@mui/x-date-pickers/internals';
3
+ import { CommonProps } from '../CommonProps';
4
+ export interface TimePickerProps extends CommonProps {
5
+ /** 12h/24h view for hour selection clock. Default is `true`. */
6
+ ampm?: boolean;
7
+ /** If `true`, the `input` element is focused during the first mount. */
8
+ autoFocus?: boolean;
9
+ /** If `true`, the open picker button will not be rendered (renders only the field). */
10
+ disableOpenPicker?: boolean;
11
+ /** If `true`, the picker and text field are disabled. */
12
+ disabled?: boolean;
13
+ /** If true, the label will be displayed in an error state. */
14
+ error?: boolean;
15
+ /** Format of the time when rendered in the input(s). Defaults to localized format based on the used `views`. */
16
+ format?: string;
17
+ /** If true, the input will take up the full width of its container */
18
+ fullWidth?: boolean;
19
+ /** The helper text content. */
20
+ helperText?: ReactNode;
21
+ hideActionButtons?: boolean;
22
+ /** Identifies the input element and also used to create label "for" and helper text id attribute */
23
+ inputId: string;
24
+ /** The name of input element */
25
+ inputName?: string;
26
+ /** The label content. */
27
+ label?: string;
28
+ /** Callback fired when the value changes. */
29
+ onChange?: (value: string, context: FieldChangeHandlerContext<string>) => void;
30
+ /** Callback fired when the popup requests to be closed. Use in controlled mode (see `open`). */
31
+ onClose?: () => void;
32
+ /** Callback fired when the popup requests to be opened. Use in controlled mode (see `open`). */
33
+ onOpen?: () => void;
34
+ /** Control the popup or dialog open state. */
35
+ open?: boolean;
36
+ /** If true, the label will be persistently displayed outside the field */
37
+ persistentLabel?: boolean;
38
+ /** If true, the input will be read-only. */
39
+ readOnly?: boolean;
40
+ /** If true, the label is displayed as required and the input element will be required. */
41
+ required?: boolean;
42
+ /** The selected value. Used when the component is controlled. */
43
+ value?: string;
44
+ }
45
+ export declare const DEFAULT_PICKER_TIME_FORMAT = "hh:mm";
46
+ export declare const DEFAULT_TIME_FORMAT = "hh:mm A";
47
+ export declare const DEFAULT_TIME = "01:00";
48
+ export declare const DotTimePicker: ({ ampm, ariaLabel, autoFocus, className, "data-testid": dataTestId, disableOpenPicker, disabled, error, format, fullWidth, helperText, hideActionButtons, inputId, inputName, label, onChange, onClose, onOpen, open, persistentLabel, readOnly, required, value, }: TimePickerProps) => JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { ComponentMeta, Story } from '@storybook/react';
2
+ import { TimePickerProps } from './';
3
+ declare const _default: ComponentMeta<({ ampm, ariaLabel, autoFocus, className, "data-testid": dataTestId, disableOpenPicker, disabled, error, format, fullWidth, helperText, hideActionButtons, inputId, inputName, label, onChange, onClose, onOpen, open, persistentLabel, readOnly, required, value, }: TimePickerProps) => JSX.Element>;
4
+ export default _default;
5
+ export declare const Default: TimePickerProps;
6
+ export declare const WithAutoFocus: any;
7
+ export declare const WithDisableOpenPicker: any;
8
+ export declare const WithDisabledOption: any;
9
+ export declare const WithError: any;
10
+ export declare const WithCustomTimeFormat: any;
11
+ export declare const WithFullWidth: any;
12
+ export declare const WithPersistentLabel: any;
13
+ export declare const With24HourFormat: any;
14
+ export declare const WithReadOnly: any;
15
+ export declare const WithHelperText: any;
16
+ export declare const WithRequiredOption: any;
17
+ export declare const WithOpenedTimePopper: any;
18
+ export declare const WithControlledMode: Story<TimePickerProps>;
19
+ export declare const WithHourFormatPicker: Story<TimePickerProps>;
20
+ export declare const WithOutsideTimeSetter: Story<TimePickerProps>;
@@ -0,0 +1,6 @@
1
+ export declare const timePickerWithControlledModeClassName = "dot-time-picker-with-controlled-mode";
2
+ export declare const timePickerWithHourFormatPickerClassName = "dot-time-picker-with-hour-format-picker";
3
+ export declare const timePickerWithOutsideTimeSetterClassName = "dot-time-picker-with-outside-time-setter";
4
+ export declare const StyledTimePickerWithControlledMode: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ export declare const StyledTimePickerWithHourFormatPicker: import("styled-components").StyledComponent<"div", any, {}, never>;
6
+ export declare const StyledTimePickerWithOutsideTimeSetter: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare const rootClassName = "dot-time-picker";
3
+ export declare const containerClassName = "dot-time-picker-container";
4
+ export declare const StyledTimePickerContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ export declare const StyledTimePicker: import("styled-components").StyledComponent<(<TDate>(props: import("@mui/x-date-pickers").TimePickerProps<TDate> & import("react").RefAttributes<HTMLDivElement>) => JSX.Element) & {
6
+ propTypes?: any;
7
+ }, any, {}, never>;
@@ -0,0 +1,3 @@
1
+ export { Daytime } from './utils/models';
2
+ export { mockScrollIntoView } from '../../testing-utils/scroll-into-view-mock';
3
+ export * from './TimePicker';
@@ -0,0 +1,11 @@
1
+ import dayjs, { Dayjs } from 'dayjs';
2
+ import { Daytime } from './models';
3
+ export declare const getDayjsUtcDate: (value: string, timeFormat?: string) => dayjs.Dayjs;
4
+ export declare const createNumbersArray: (length: number, offset?: number) => number[];
5
+ export declare const getHoursForTimePicker: (hasDaytimeSelection: boolean) => number[];
6
+ export declare const getMinutesForTimePicker: () => number[];
7
+ export declare const checkIfAm: (currentTime: Dayjs) => boolean;
8
+ export declare const calculateTimeForHourSelection: (is12hourFormat: boolean, selectedHour: number, currentTime: Dayjs) => Dayjs;
9
+ export declare const calculateTimeForDaytimeSelection: (currentTime: Dayjs, selectedDaytime: Daytime) => Dayjs;
10
+ export declare const calculateHourBasedOnTimeFormat: (time: Dayjs, is12hourFormat: boolean) => number;
11
+ export declare const getSelectedHourButtonIndex: (selectedHour: number, is12HourFormat: boolean) => number;
@@ -0,0 +1,4 @@
1
+ export declare enum Daytime {
2
+ AM = "AM",
3
+ PM = "PM"
4
+ }
@@ -0,0 +1 @@
1
+ export declare const mockIntersectionObserver: () => void;
@@ -0,0 +1 @@
1
+ export declare const mockScrollIntoView: (scrollIntoViewMock: typeof jest.fn) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-ai/dot-components",
3
- "version": "2.5.5",
3
+ "version": "2.6.1",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN <LICENSE.md>",
6
6
  "contributors": [