ics-ui-kit 0.1.0-alpha.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/dist/components/badge/Badge.d.ts +126 -0
- package/dist/components/badge/Badge.stories.d.ts +10 -0
- package/dist/components/button/Button.d.ts +227 -0
- package/dist/components/button/Button.stories.d.ts +16 -0
- package/dist/components/icon/Icon.d.ts +45 -0
- package/dist/components/icon/Icon.stories.d.ts +36 -0
- package/dist/components/input/input/Input.d.ts +8 -0
- package/dist/components/input/input/Input.stories.d.ts +29 -0
- package/dist/components/input/input/context/InputContext.d.ts +14 -0
- package/dist/components/input/secret-input/SecretInput.d.ts +3 -0
- package/dist/components/input/secret-input/SecretInput.stories.d.ts +29 -0
- package/dist/components/input/secret-input/components/ShowValueToggler.d.ts +4 -0
- package/dist/components/input/text-input/TextInput.d.ts +3 -0
- package/dist/components/input/text-input/TextInput.stories.d.ts +29 -0
- package/dist/components/input/text-input/components/CopyButton.d.ts +4 -0
- package/dist/components/label/Label.d.ts +4 -0
- package/dist/components/label/Label.stories.d.ts +15 -0
- package/dist/components/scheduler/Scheduler.d.ts +73 -0
- package/dist/components/scheduler/Scheduler.stories.d.ts +14 -0
- package/dist/components/scheduler/components/day/Day.d.ts +65 -0
- package/dist/components/scheduler/components/day/Day.stories.d.ts +6 -0
- package/dist/components/scheduler/components/day-column/DayColumn.d.ts +6 -0
- package/dist/components/scheduler/components/day-column/DayColumn.stories.d.ts +23 -0
- package/dist/components/scheduler/components/day-columns/DayColumns.d.ts +5 -0
- package/dist/components/scheduler/components/day-columns/DayColumns.stories.d.ts +22 -0
- package/dist/components/scheduler/components/hour-rows/HourRows.d.ts +1 -0
- package/dist/components/scheduler/components/hour-rows/HourRows.stories.d.ts +12 -0
- package/dist/components/scheduler/components/scheduled-event/ScheduledEvent.d.ts +9 -0
- package/dist/components/scheduler/components/scheduled-event/ScheduledEvent.stories.d.ts +7 -0
- package/dist/components/scheduler/components/scheduled-event/ScheduledEventResizeHandler.d.ts +2 -0
- package/dist/components/scheduler/components/time-ruler/CurrentTimeMarker.d.ts +5 -0
- package/dist/components/scheduler/components/time-ruler/TimeRuler.d.ts +5 -0
- package/dist/components/scheduler/components/time-ruler/TimeRuler.stories.d.ts +7 -0
- package/dist/components/scheduler/components/week-days/WeekDays.d.ts +1 -0
- package/dist/components/scheduler/components/week-days/WeekDays.stories.d.ts +15 -0
- package/dist/components/scheduler/context/SchedulerContext.d.ts +32 -0
- package/dist/components/scheduler/index.d.ts +1 -0
- package/dist/components/scheduler/story-utils/SchedulerContextDecorator.d.ts +1 -0
- package/dist/components/scheduler/story-utils/SchedulerStoriesData.d.ts +2 -0
- package/dist/components/scheduler/types.d.ts +7 -0
- package/dist/components/scheduler/utils/SchedulerUtils.d.ts +34 -0
- package/dist/components/scheduler.d.ts +2 -0
- package/dist/components/scheduler.js +8025 -0
- package/dist/components/scheduler.js.map +1 -0
- package/dist/components/separator/separator.d.ts +44 -0
- package/dist/components/separator/separator.stories.d.ts +6 -0
- package/dist/components/toast/Toast.d.ts +406 -0
- package/dist/components/toast/Toast.stories.d.ts +450 -0
- package/dist/components/toast/components/large-toast/LargeToast.d.ts +2 -0
- package/dist/components/toast/components/medium-toast/MediumToast.d.ts +2 -0
- package/dist/components/toast/components/small-toast/SmallToast.d.ts +2 -0
- package/dist/components/toast/components/toast-action/ToastAction.d.ts +2 -0
- package/dist/components/toast/components/toast-action/ToastAction.stories.d.ts +42 -0
- package/dist/components/toast/components/toast-close-action/ToastCloseButton.d.ts +4 -0
- package/dist/components/toast/components/toast-close-action/ToastCloseButton.stories.d.ts +41 -0
- package/dist/components/toast/components/toast-container/ToastContainer.d.ts +4 -0
- package/dist/components/toast/components/toast-icon/ToastIcon.d.ts +5 -0
- package/dist/components/toast/components/toast-icon/ToastIcon.stories.d.ts +41 -0
- package/dist/components/toast/context/ToastContext.d.ts +9 -0
- package/dist/components/toast/hooks/useToast.d.ts +6 -0
- package/dist/components/toast/hooks/useToastContainer.d.ts +9 -0
- package/dist/components/toast/hooks/useToastContext.d.ts +12 -0
- package/dist/components/toast/utils/ToastUtils.d.ts +5 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/index-DBNvHuQo.js +266 -0
- package/dist/index-DBNvHuQo.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +533 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils/date/date.d.ts +1 -0
- package/dist/lib/utils/date/getFirstDayOfWeek.d.ts +7 -0
- package/dist/lib/utils/date/getFirstDayOfWeek.test.d.ts +1 -0
- package/dist/lib/utils/date/roundDateTime.d.ts +10 -0
- package/dist/lib/utils/date/roundDateTime.test.d.ts +1 -0
- package/dist/lib/utils/storybook.d.ts +2 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/styles.css +1598 -0
- package/dist/types/css.d.ts +4 -0
- package/package.json +96 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Scheduler } from './Scheduler';
|
|
3
|
+
declare const meta: Meta<typeof Scheduler>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Scheduler>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Controlled: Story;
|
|
8
|
+
export declare const Resize: Story;
|
|
9
|
+
export declare const WithTooltip: Story;
|
|
10
|
+
export declare const WithCustomEventComponent: Story;
|
|
11
|
+
export declare const SingleDay: Story;
|
|
12
|
+
export declare const WithoutDragNDrop: Story;
|
|
13
|
+
export declare const ConditionalDragNDrop: Story;
|
|
14
|
+
export declare const DndPg: Story;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { VariantProps, TVReturnType } from 'tailwind-variants';
|
|
2
|
+
import { TVConfig } from 'tailwind-variants/dist/config.js';
|
|
3
|
+
declare const day: TVReturnType<{
|
|
4
|
+
holyday: {
|
|
5
|
+
true: {
|
|
6
|
+
dayOfWeek: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
}, {
|
|
10
|
+
wrapper: string;
|
|
11
|
+
date: string;
|
|
12
|
+
dayOfWeek: string;
|
|
13
|
+
monthName: string;
|
|
14
|
+
}, undefined, TVConfig<{
|
|
15
|
+
holyday: {
|
|
16
|
+
true: {
|
|
17
|
+
dayOfWeek: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}, {
|
|
21
|
+
holyday: {
|
|
22
|
+
true: {
|
|
23
|
+
dayOfWeek: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}>, {
|
|
27
|
+
holyday: {
|
|
28
|
+
true: {
|
|
29
|
+
dayOfWeek: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}, {
|
|
33
|
+
wrapper: string;
|
|
34
|
+
date: string;
|
|
35
|
+
dayOfWeek: string;
|
|
36
|
+
monthName: string;
|
|
37
|
+
}, TVReturnType<{
|
|
38
|
+
holyday: {
|
|
39
|
+
true: {
|
|
40
|
+
dayOfWeek: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}, {
|
|
44
|
+
wrapper: string;
|
|
45
|
+
date: string;
|
|
46
|
+
dayOfWeek: string;
|
|
47
|
+
monthName: string;
|
|
48
|
+
}, undefined, TVConfig<{
|
|
49
|
+
holyday: {
|
|
50
|
+
true: {
|
|
51
|
+
dayOfWeek: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
}, {
|
|
55
|
+
holyday: {
|
|
56
|
+
true: {
|
|
57
|
+
dayOfWeek: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
}>, unknown, unknown, undefined>>;
|
|
61
|
+
type DayProps = VariantProps<typeof day> & {
|
|
62
|
+
date: Date;
|
|
63
|
+
};
|
|
64
|
+
export declare const Day: React.FC<DayProps>;
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { DayColumnProps } from './DayColumn';
|
|
4
|
+
declare const meta: {
|
|
5
|
+
component: FC<DayColumnProps>;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
decorators: (((Story: React.FC) => import("react/jsx-runtime").JSX.Element) | ((story: () => React.ReactNode) => import("react/jsx-runtime").JSX.Element))[];
|
|
10
|
+
args: {
|
|
11
|
+
day: Date;
|
|
12
|
+
events: {
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
startDate: Date;
|
|
16
|
+
endDate: Date;
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof meta>;
|
|
22
|
+
export declare const Default: Story;
|
|
23
|
+
export declare const WithOverlappingEvents: Story;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { DayColumnsProps } from './DayColumns';
|
|
4
|
+
declare const meta: {
|
|
5
|
+
component: FC<DayColumnsProps>;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
decorators: ((story: () => React.ReactNode) => import("react/jsx-runtime").JSX.Element)[];
|
|
11
|
+
args: {
|
|
12
|
+
events: {
|
|
13
|
+
id: number;
|
|
14
|
+
title: string;
|
|
15
|
+
startDate: Date;
|
|
16
|
+
endDate: Date;
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof meta>;
|
|
22
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const HourRows: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StoryObj, ReactRenderer } from '@storybook/react';
|
|
2
|
+
import { PartialStoryFn } from '@storybook/csf';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
component: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
decorators: ((Story: PartialStoryFn<ReactRenderer, {}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IScheduledEvent } from '../../types';
|
|
2
|
+
export interface ScheduledEventProps<T = unknown> {
|
|
3
|
+
event: IScheduledEvent<T>;
|
|
4
|
+
top?: string;
|
|
5
|
+
left?: string;
|
|
6
|
+
width?: string;
|
|
7
|
+
onEventClick?: (event: IScheduledEvent<T>) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const ScheduledEvent: React.FC<ScheduledEventProps>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ScheduledEvent } from './ScheduledEvent';
|
|
3
|
+
declare const meta: Meta<typeof ScheduledEvent>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Resizable: Story;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { TimeRuler } from './TimeRuler';
|
|
3
|
+
declare const meta: Meta<typeof TimeRuler>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof TimeRuler>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithCurrentTime: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const WeekDays: React.FC;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
component: FC<{}>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
args: {
|
|
9
|
+
startDate: Date;
|
|
10
|
+
};
|
|
11
|
+
tags: string[];
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SchedulerBaseSettings } from '../Scheduler';
|
|
2
|
+
interface SchedulerContextType extends SchedulerBaseSettings {
|
|
3
|
+
dates: Date[];
|
|
4
|
+
hourHeight: number;
|
|
5
|
+
timeSnap: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const SchedulerProvider: ({ children, value }: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
value: SchedulerContextType;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
interface UseSchedulerProps {
|
|
12
|
+
/**
|
|
13
|
+
* Размер сетки для перетаскивания и ресайза события.
|
|
14
|
+
* Вычисляется из hourHeight и timeSnap.
|
|
15
|
+
*/
|
|
16
|
+
gridSize: number;
|
|
17
|
+
/**
|
|
18
|
+
* Преобразование пикселей в минуты.
|
|
19
|
+
* Используется для вычисления времени при перетаскивании и ресайзе события.
|
|
20
|
+
*/
|
|
21
|
+
pxToMinutes: (px: number) => number;
|
|
22
|
+
/**
|
|
23
|
+
* Округление времени до ближайшего времени с учетом timeSnap.
|
|
24
|
+
*/
|
|
25
|
+
snapToTime: (time: Date) => Date;
|
|
26
|
+
/**
|
|
27
|
+
* Преобразование минут в пиксели.
|
|
28
|
+
*/
|
|
29
|
+
minInPx: (min: number) => number;
|
|
30
|
+
}
|
|
31
|
+
export declare const useScheduler: () => UseSchedulerProps & SchedulerContextType;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Scheduler } from './Scheduler';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const schedulerContextDecorator: (story: () => React.ReactNode) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ClientRect } from '@dnd-kit/core';
|
|
2
|
+
import { IScheduledEvent } from '../types';
|
|
3
|
+
export declare const DAY_COLUMN_DATA_ATTRIBUTE = "data-day-column";
|
|
4
|
+
export declare function getDateFromClick(event: React.MouseEvent<HTMLDivElement>, day: Date, timeSnap: number): Date;
|
|
5
|
+
export declare function getDateFromY(positionY: number, targetRect: ClientRect, day: Date, timeSnap: number): Date;
|
|
6
|
+
/**
|
|
7
|
+
* Возвращает процент времени от начала дня до текущего момента
|
|
8
|
+
*/
|
|
9
|
+
export declare function getCurrentTimePercentage(): string;
|
|
10
|
+
/**
|
|
11
|
+
* Группирует события, которые пересекаются по времени
|
|
12
|
+
*/
|
|
13
|
+
export declare function groupCrossingEvents(events: IScheduledEvent[]): IScheduledEvent[][];
|
|
14
|
+
/**
|
|
15
|
+
* Позиция элемента
|
|
16
|
+
*/
|
|
17
|
+
interface EventPosition {
|
|
18
|
+
top: string;
|
|
19
|
+
left: string;
|
|
20
|
+
width: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Возвращает данные для позиционирования событий на день
|
|
24
|
+
*/
|
|
25
|
+
export declare function getEventPositions(events: IScheduledEvent[], hourHeight: number): Map<string | number, EventPosition>;
|
|
26
|
+
/**
|
|
27
|
+
* Возвращает высоту события в пикселях
|
|
28
|
+
*/
|
|
29
|
+
export declare function getEventHeight(event: IScheduledEvent, hourHeight: number): number;
|
|
30
|
+
/**
|
|
31
|
+
* Возвращает количество минут, прошедших с начала дня
|
|
32
|
+
*/
|
|
33
|
+
export declare function getMinutesFromStartOfDay(date: Date): number;
|
|
34
|
+
export {};
|