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.
Files changed (79) hide show
  1. package/dist/components/badge/Badge.d.ts +126 -0
  2. package/dist/components/badge/Badge.stories.d.ts +10 -0
  3. package/dist/components/button/Button.d.ts +227 -0
  4. package/dist/components/button/Button.stories.d.ts +16 -0
  5. package/dist/components/icon/Icon.d.ts +45 -0
  6. package/dist/components/icon/Icon.stories.d.ts +36 -0
  7. package/dist/components/input/input/Input.d.ts +8 -0
  8. package/dist/components/input/input/Input.stories.d.ts +29 -0
  9. package/dist/components/input/input/context/InputContext.d.ts +14 -0
  10. package/dist/components/input/secret-input/SecretInput.d.ts +3 -0
  11. package/dist/components/input/secret-input/SecretInput.stories.d.ts +29 -0
  12. package/dist/components/input/secret-input/components/ShowValueToggler.d.ts +4 -0
  13. package/dist/components/input/text-input/TextInput.d.ts +3 -0
  14. package/dist/components/input/text-input/TextInput.stories.d.ts +29 -0
  15. package/dist/components/input/text-input/components/CopyButton.d.ts +4 -0
  16. package/dist/components/label/Label.d.ts +4 -0
  17. package/dist/components/label/Label.stories.d.ts +15 -0
  18. package/dist/components/scheduler/Scheduler.d.ts +73 -0
  19. package/dist/components/scheduler/Scheduler.stories.d.ts +14 -0
  20. package/dist/components/scheduler/components/day/Day.d.ts +65 -0
  21. package/dist/components/scheduler/components/day/Day.stories.d.ts +6 -0
  22. package/dist/components/scheduler/components/day-column/DayColumn.d.ts +6 -0
  23. package/dist/components/scheduler/components/day-column/DayColumn.stories.d.ts +23 -0
  24. package/dist/components/scheduler/components/day-columns/DayColumns.d.ts +5 -0
  25. package/dist/components/scheduler/components/day-columns/DayColumns.stories.d.ts +22 -0
  26. package/dist/components/scheduler/components/hour-rows/HourRows.d.ts +1 -0
  27. package/dist/components/scheduler/components/hour-rows/HourRows.stories.d.ts +12 -0
  28. package/dist/components/scheduler/components/scheduled-event/ScheduledEvent.d.ts +9 -0
  29. package/dist/components/scheduler/components/scheduled-event/ScheduledEvent.stories.d.ts +7 -0
  30. package/dist/components/scheduler/components/scheduled-event/ScheduledEventResizeHandler.d.ts +2 -0
  31. package/dist/components/scheduler/components/time-ruler/CurrentTimeMarker.d.ts +5 -0
  32. package/dist/components/scheduler/components/time-ruler/TimeRuler.d.ts +5 -0
  33. package/dist/components/scheduler/components/time-ruler/TimeRuler.stories.d.ts +7 -0
  34. package/dist/components/scheduler/components/week-days/WeekDays.d.ts +1 -0
  35. package/dist/components/scheduler/components/week-days/WeekDays.stories.d.ts +15 -0
  36. package/dist/components/scheduler/context/SchedulerContext.d.ts +32 -0
  37. package/dist/components/scheduler/index.d.ts +1 -0
  38. package/dist/components/scheduler/story-utils/SchedulerContextDecorator.d.ts +1 -0
  39. package/dist/components/scheduler/story-utils/SchedulerStoriesData.d.ts +2 -0
  40. package/dist/components/scheduler/types.d.ts +7 -0
  41. package/dist/components/scheduler/utils/SchedulerUtils.d.ts +34 -0
  42. package/dist/components/scheduler.d.ts +2 -0
  43. package/dist/components/scheduler.js +8025 -0
  44. package/dist/components/scheduler.js.map +1 -0
  45. package/dist/components/separator/separator.d.ts +44 -0
  46. package/dist/components/separator/separator.stories.d.ts +6 -0
  47. package/dist/components/toast/Toast.d.ts +406 -0
  48. package/dist/components/toast/Toast.stories.d.ts +450 -0
  49. package/dist/components/toast/components/large-toast/LargeToast.d.ts +2 -0
  50. package/dist/components/toast/components/medium-toast/MediumToast.d.ts +2 -0
  51. package/dist/components/toast/components/small-toast/SmallToast.d.ts +2 -0
  52. package/dist/components/toast/components/toast-action/ToastAction.d.ts +2 -0
  53. package/dist/components/toast/components/toast-action/ToastAction.stories.d.ts +42 -0
  54. package/dist/components/toast/components/toast-close-action/ToastCloseButton.d.ts +4 -0
  55. package/dist/components/toast/components/toast-close-action/ToastCloseButton.stories.d.ts +41 -0
  56. package/dist/components/toast/components/toast-container/ToastContainer.d.ts +4 -0
  57. package/dist/components/toast/components/toast-icon/ToastIcon.d.ts +5 -0
  58. package/dist/components/toast/components/toast-icon/ToastIcon.stories.d.ts +41 -0
  59. package/dist/components/toast/context/ToastContext.d.ts +9 -0
  60. package/dist/components/toast/hooks/useToast.d.ts +6 -0
  61. package/dist/components/toast/hooks/useToastContainer.d.ts +9 -0
  62. package/dist/components/toast/hooks/useToastContext.d.ts +12 -0
  63. package/dist/components/toast/utils/ToastUtils.d.ts +5 -0
  64. package/dist/components/ui/tooltip.d.ts +7 -0
  65. package/dist/index-DBNvHuQo.js +266 -0
  66. package/dist/index-DBNvHuQo.js.map +1 -0
  67. package/dist/index.d.ts +4 -0
  68. package/dist/index.js +533 -0
  69. package/dist/index.js.map +1 -0
  70. package/dist/lib/utils/date/date.d.ts +1 -0
  71. package/dist/lib/utils/date/getFirstDayOfWeek.d.ts +7 -0
  72. package/dist/lib/utils/date/getFirstDayOfWeek.test.d.ts +1 -0
  73. package/dist/lib/utils/date/roundDateTime.d.ts +10 -0
  74. package/dist/lib/utils/date/roundDateTime.test.d.ts +1 -0
  75. package/dist/lib/utils/storybook.d.ts +2 -0
  76. package/dist/lib/utils.d.ts +2 -0
  77. package/dist/styles.css +1598 -0
  78. package/dist/types/css.d.ts +4 -0
  79. package/package.json +96 -0
@@ -0,0 +1,126 @@
1
+ import { FC, HTMLAttributes, PropsWithChildren } from 'react';
2
+ import { VariantProps, TVReturnType } from 'tailwind-variants';
3
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
4
+ declare const badgeVariants: TVReturnType<{
5
+ status: {
6
+ default: string;
7
+ info: string;
8
+ success: string;
9
+ warning: string;
10
+ error: string;
11
+ };
12
+ focus: {
13
+ low: string;
14
+ high: string;
15
+ };
16
+ size: {
17
+ sm: string;
18
+ md: string;
19
+ lg: string;
20
+ };
21
+ }, undefined, "inline-flex items-center justify-center overflow-hidden rounded-sm border px-2 font-medium leading-none", TVConfig<{
22
+ status: {
23
+ default: string;
24
+ info: string;
25
+ success: string;
26
+ warning: string;
27
+ error: string;
28
+ };
29
+ focus: {
30
+ low: string;
31
+ high: string;
32
+ };
33
+ size: {
34
+ sm: string;
35
+ md: string;
36
+ lg: string;
37
+ };
38
+ }, {
39
+ status: {
40
+ default: string;
41
+ info: string;
42
+ success: string;
43
+ warning: string;
44
+ error: string;
45
+ };
46
+ focus: {
47
+ low: string;
48
+ high: string;
49
+ };
50
+ size: {
51
+ sm: string;
52
+ md: string;
53
+ lg: string;
54
+ };
55
+ }>, {
56
+ status: {
57
+ default: string;
58
+ info: string;
59
+ success: string;
60
+ warning: string;
61
+ error: string;
62
+ };
63
+ focus: {
64
+ low: string;
65
+ high: string;
66
+ };
67
+ size: {
68
+ sm: string;
69
+ md: string;
70
+ lg: string;
71
+ };
72
+ }, undefined, TVReturnType<{
73
+ status: {
74
+ default: string;
75
+ info: string;
76
+ success: string;
77
+ warning: string;
78
+ error: string;
79
+ };
80
+ focus: {
81
+ low: string;
82
+ high: string;
83
+ };
84
+ size: {
85
+ sm: string;
86
+ md: string;
87
+ lg: string;
88
+ };
89
+ }, undefined, "inline-flex items-center justify-center overflow-hidden rounded-sm border px-2 font-medium leading-none", TVConfig<{
90
+ status: {
91
+ default: string;
92
+ info: string;
93
+ success: string;
94
+ warning: string;
95
+ error: string;
96
+ };
97
+ focus: {
98
+ low: string;
99
+ high: string;
100
+ };
101
+ size: {
102
+ sm: string;
103
+ md: string;
104
+ lg: string;
105
+ };
106
+ }, {
107
+ status: {
108
+ default: string;
109
+ info: string;
110
+ success: string;
111
+ warning: string;
112
+ error: string;
113
+ };
114
+ focus: {
115
+ low: string;
116
+ high: string;
117
+ };
118
+ size: {
119
+ sm: string;
120
+ md: string;
121
+ lg: string;
122
+ };
123
+ }>, unknown, unknown, undefined>>;
124
+ export type BadgeProps = Omit<HTMLAttributes<HTMLDivElement>, "status" | "focus"> & VariantProps<typeof badgeVariants>;
125
+ export declare const Badge: FC<PropsWithChildren<BadgeProps>>;
126
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Badge } from './Badge';
3
+ declare const meta: Meta<typeof Badge>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Badge>;
6
+ export declare const Default: Story;
7
+ export declare const SmallWithIcon: Story;
8
+ export declare const MediumWithIcon: Story;
9
+ export declare const LargeWithIcon: Story;
10
+ export declare const Actions: Story;
@@ -0,0 +1,227 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { VariantProps, TVReturnType } from 'tailwind-variants';
3
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
4
+ declare const buttonVariants: TVReturnType<{
5
+ variant: {
6
+ primary: string;
7
+ secondary: string;
8
+ outline: string;
9
+ ghost: string;
10
+ link: string;
11
+ text: string;
12
+ };
13
+ state: {
14
+ default: string;
15
+ disabled: string;
16
+ };
17
+ status: {
18
+ default: string;
19
+ info: string;
20
+ success: string;
21
+ warning: string;
22
+ error: string;
23
+ };
24
+ size: {
25
+ xs: string;
26
+ sm: string;
27
+ md: string;
28
+ lg: string;
29
+ xl: string;
30
+ };
31
+ iconOnly: {
32
+ true: string;
33
+ false: string;
34
+ };
35
+ }, undefined, "inline-flex shrink-0 cursor-pointer select-none items-center justify-center rounded-md font-medium text-primary-fg", TVConfig<{
36
+ variant: {
37
+ primary: string;
38
+ secondary: string;
39
+ outline: string;
40
+ ghost: string;
41
+ link: string;
42
+ text: string;
43
+ };
44
+ state: {
45
+ default: string;
46
+ disabled: string;
47
+ };
48
+ status: {
49
+ default: string;
50
+ info: string;
51
+ success: string;
52
+ warning: string;
53
+ error: string;
54
+ };
55
+ size: {
56
+ xs: string;
57
+ sm: string;
58
+ md: string;
59
+ lg: string;
60
+ xl: string;
61
+ };
62
+ iconOnly: {
63
+ true: string;
64
+ false: string;
65
+ };
66
+ }, {
67
+ variant: {
68
+ primary: string;
69
+ secondary: string;
70
+ outline: string;
71
+ ghost: string;
72
+ link: string;
73
+ text: string;
74
+ };
75
+ state: {
76
+ default: string;
77
+ disabled: string;
78
+ };
79
+ status: {
80
+ default: string;
81
+ info: string;
82
+ success: string;
83
+ warning: string;
84
+ error: string;
85
+ };
86
+ size: {
87
+ xs: string;
88
+ sm: string;
89
+ md: string;
90
+ lg: string;
91
+ xl: string;
92
+ };
93
+ iconOnly: {
94
+ true: string;
95
+ false: string;
96
+ };
97
+ }>, {
98
+ variant: {
99
+ primary: string;
100
+ secondary: string;
101
+ outline: string;
102
+ ghost: string;
103
+ link: string;
104
+ text: string;
105
+ };
106
+ state: {
107
+ default: string;
108
+ disabled: string;
109
+ };
110
+ status: {
111
+ default: string;
112
+ info: string;
113
+ success: string;
114
+ warning: string;
115
+ error: string;
116
+ };
117
+ size: {
118
+ xs: string;
119
+ sm: string;
120
+ md: string;
121
+ lg: string;
122
+ xl: string;
123
+ };
124
+ iconOnly: {
125
+ true: string;
126
+ false: string;
127
+ };
128
+ }, undefined, TVReturnType<{
129
+ variant: {
130
+ primary: string;
131
+ secondary: string;
132
+ outline: string;
133
+ ghost: string;
134
+ link: string;
135
+ text: string;
136
+ };
137
+ state: {
138
+ default: string;
139
+ disabled: string;
140
+ };
141
+ status: {
142
+ default: string;
143
+ info: string;
144
+ success: string;
145
+ warning: string;
146
+ error: string;
147
+ };
148
+ size: {
149
+ xs: string;
150
+ sm: string;
151
+ md: string;
152
+ lg: string;
153
+ xl: string;
154
+ };
155
+ iconOnly: {
156
+ true: string;
157
+ false: string;
158
+ };
159
+ }, undefined, "inline-flex shrink-0 cursor-pointer select-none items-center justify-center rounded-md font-medium text-primary-fg", TVConfig<{
160
+ variant: {
161
+ primary: string;
162
+ secondary: string;
163
+ outline: string;
164
+ ghost: string;
165
+ link: string;
166
+ text: string;
167
+ };
168
+ state: {
169
+ default: string;
170
+ disabled: string;
171
+ };
172
+ status: {
173
+ default: string;
174
+ info: string;
175
+ success: string;
176
+ warning: string;
177
+ error: string;
178
+ };
179
+ size: {
180
+ xs: string;
181
+ sm: string;
182
+ md: string;
183
+ lg: string;
184
+ xl: string;
185
+ };
186
+ iconOnly: {
187
+ true: string;
188
+ false: string;
189
+ };
190
+ }, {
191
+ variant: {
192
+ primary: string;
193
+ secondary: string;
194
+ outline: string;
195
+ ghost: string;
196
+ link: string;
197
+ text: string;
198
+ };
199
+ state: {
200
+ default: string;
201
+ disabled: string;
202
+ };
203
+ status: {
204
+ default: string;
205
+ info: string;
206
+ success: string;
207
+ warning: string;
208
+ error: string;
209
+ };
210
+ size: {
211
+ xs: string;
212
+ sm: string;
213
+ md: string;
214
+ lg: string;
215
+ xl: string;
216
+ };
217
+ iconOnly: {
218
+ true: string;
219
+ false: string;
220
+ };
221
+ }>, unknown, unknown, undefined>>;
222
+ export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants> & {
223
+ className?: string;
224
+ asChild?: boolean;
225
+ };
226
+ export declare const Button: FC<PropsWithChildren<ButtonProps>>;
227
+ export {};
@@ -0,0 +1,16 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { Button, ButtonProps } from './Button';
3
+ import { FC, PropsWithChildren } from 'react';
4
+ declare const meta: {
5
+ component: FC<PropsWithChildren<ButtonProps>>;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<typeof Button>;
12
+ export declare const Default: Story;
13
+ export declare const WithSmallIcons: Story;
14
+ export declare const WithMediumIcons: Story;
15
+ export declare const IconOnly: Story;
16
+ export declare const Loading: Story;
@@ -0,0 +1,45 @@
1
+ import { VariantProps, TVReturnType } from 'tailwind-variants';
2
+ import { LucideIcon } from 'lucide-react';
3
+ import { TVConfig } from 'tailwind-variants/dist/config.js';
4
+ declare const iconVariants: TVReturnType<{
5
+ size: {
6
+ sm: string;
7
+ md: string;
8
+ };
9
+ }, undefined, "h-4 w-4", TVConfig<{
10
+ size: {
11
+ sm: string;
12
+ md: string;
13
+ };
14
+ }, {
15
+ size: {
16
+ sm: string;
17
+ md: string;
18
+ };
19
+ }>, {
20
+ size: {
21
+ sm: string;
22
+ md: string;
23
+ };
24
+ }, undefined, TVReturnType<{
25
+ size: {
26
+ sm: string;
27
+ md: string;
28
+ };
29
+ }, undefined, "h-4 w-4", TVConfig<{
30
+ size: {
31
+ sm: string;
32
+ md: string;
33
+ };
34
+ }, {
35
+ size: {
36
+ sm: string;
37
+ md: string;
38
+ };
39
+ }>, unknown, unknown, undefined>>;
40
+ export type IconProps = VariantProps<typeof iconVariants> & {
41
+ icon: LucideIcon;
42
+ className?: string;
43
+ };
44
+ export declare const Icon: React.FC<IconProps>;
45
+ export {};
@@ -0,0 +1,36 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { FC, ForwardRefExoticComponent, RefAttributes } from 'react';
3
+ import { IconProps } from './Icon';
4
+ import { LucideProps } from 'lucide-react';
5
+ declare const meta: {
6
+ component: FC<IconProps>;
7
+ parameters: {
8
+ layout: string;
9
+ };
10
+ argTypes: {
11
+ size: {
12
+ control: string;
13
+ options: string[];
14
+ };
15
+ icon: {
16
+ control: {
17
+ variant: string;
18
+ };
19
+ options: string[];
20
+ mapping: {
21
+ Factory: ForwardRefExoticComponent<Omit< LucideProps, "ref"> & RefAttributes<SVGSVGElement>>;
22
+ Heart: ForwardRefExoticComponent<Omit< LucideProps, "ref"> & RefAttributes<SVGSVGElement>>;
23
+ Check: ForwardRefExoticComponent<Omit< LucideProps, "ref"> & RefAttributes<SVGSVGElement>>;
24
+ Star: ForwardRefExoticComponent<Omit< LucideProps, "ref"> & RefAttributes<SVGSVGElement>>;
25
+ Settings: ForwardRefExoticComponent<Omit< LucideProps, "ref"> & RefAttributes<SVGSVGElement>>;
26
+ User: ForwardRefExoticComponent<Omit< LucideProps, "ref"> & RefAttributes<SVGSVGElement>>;
27
+ Bell: ForwardRefExoticComponent<Omit< LucideProps, "ref"> & RefAttributes<SVGSVGElement>>;
28
+ Calendar: ForwardRefExoticComponent<Omit< LucideProps, "ref"> & RefAttributes<SVGSVGElement>>;
29
+ undefined: undefined;
30
+ };
31
+ };
32
+ };
33
+ };
34
+ export default meta;
35
+ type Story = StoryObj<typeof meta>;
36
+ export declare const Base: Story;
@@ -0,0 +1,8 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ export type InputProps = React.InputHTMLAttributes<HTMLInputElement> & {
3
+ className?: string;
4
+ icon?: React.ReactElement;
5
+ isValid?: (value: string) => boolean;
6
+ defaultType?: string;
7
+ };
8
+ export declare const Input: FC<PropsWithChildren<InputProps>>;
@@ -0,0 +1,29 @@
1
+ import { StoryObj, StoryFn } from '@storybook/react';
2
+ import { Input, InputProps } from './Input';
3
+ import { FC, PropsWithChildren } from 'react';
4
+ declare const meta: {
5
+ component: FC<PropsWithChildren<InputProps>>;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ args: {
11
+ placeholder: string;
12
+ readOnly: boolean;
13
+ icon: boolean;
14
+ };
15
+ argTypes: {
16
+ icon: {
17
+ control: string;
18
+ mapping: {
19
+ true: import("react/jsx-runtime").JSX.Element;
20
+ false: undefined;
21
+ };
22
+ };
23
+ };
24
+ decorators: ((Story: StoryFn) => import("react/jsx-runtime").JSX.Element)[];
25
+ };
26
+ export default meta;
27
+ type Story = StoryObj<typeof Input>;
28
+ export declare const Default: Story;
29
+ export declare const WithValidation: Story;
@@ -0,0 +1,14 @@
1
+ interface InputContextType {
2
+ value: string;
3
+ isFocused: boolean;
4
+ isHovered: boolean;
5
+ readOnly?: boolean;
6
+ type: string;
7
+ setType: (type: string) => void;
8
+ }
9
+ export declare const InputProvider: ({ children, value }: {
10
+ children: React.ReactNode;
11
+ value: InputContextType;
12
+ }) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const useInputContext: () => InputContextType;
14
+ export {};
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { InputProps } from '../input/Input';
3
+ export declare const SecretInput: FC<InputProps>;
@@ -0,0 +1,29 @@
1
+ import { StoryObj, StoryFn } from '@storybook/react';
2
+ import { SecretInput } from './SecretInput';
3
+ import { FC } from 'react';
4
+ import { InputProps } from '../input/Input';
5
+ declare const meta: {
6
+ component: FC<InputProps>;
7
+ parameters: {
8
+ layout: string;
9
+ };
10
+ tags: string[];
11
+ args: {
12
+ placeholder: string;
13
+ readOnly: boolean;
14
+ icon: boolean;
15
+ };
16
+ argTypes: {
17
+ icon: {
18
+ control: string;
19
+ mapping: {
20
+ true: import("react/jsx-runtime").JSX.Element;
21
+ false: undefined;
22
+ };
23
+ };
24
+ };
25
+ decorators: ((Story: StoryFn) => import("react/jsx-runtime").JSX.Element)[];
26
+ };
27
+ export default meta;
28
+ type Story = StoryObj<typeof SecretInput>;
29
+ export declare const Default: Story;
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ export declare const ShowValueToggler: FC<{
3
+ className?: string;
4
+ }>;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { InputProps } from '../input/Input';
3
+ export declare const TextInput: FC<InputProps>;
@@ -0,0 +1,29 @@
1
+ import { StoryObj, StoryFn } from '@storybook/react';
2
+ import { TextInput } from './TextInput';
3
+ import { FC } from 'react';
4
+ import { InputProps } from '../input/Input';
5
+ declare const meta: {
6
+ component: FC<InputProps>;
7
+ parameters: {
8
+ layout: string;
9
+ };
10
+ tags: string[];
11
+ args: {
12
+ placeholder: string;
13
+ readOnly: boolean;
14
+ icon: boolean;
15
+ };
16
+ argTypes: {
17
+ icon: {
18
+ control: string;
19
+ mapping: {
20
+ true: import("react/jsx-runtime").JSX.Element;
21
+ false: undefined;
22
+ };
23
+ };
24
+ };
25
+ decorators: ((Story: StoryFn) => import("react/jsx-runtime").JSX.Element)[];
26
+ };
27
+ export default meta;
28
+ type Story = StoryObj<typeof TextInput>;
29
+ export declare const Default: Story;
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ export declare const CopyButton: FC<{
3
+ className?: string;
4
+ }>;
@@ -0,0 +1,4 @@
1
+ export type LabelProps = {
2
+ className?: string;
3
+ };
4
+ export declare const Label: React.FC<React.PropsWithChildren<LabelProps>>;
@@ -0,0 +1,15 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { FC, PropsWithChildren } from 'react';
3
+ import { LabelProps } from './Label';
4
+ declare const meta: {
5
+ component: FC<PropsWithChildren<LabelProps>>;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ args: {};
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Base: Story;
14
+ export declare const WithIcon: Story;
15
+ export declare const RequiredWithIcon: Story;
@@ -0,0 +1,73 @@
1
+ import { IScheduledEvent } from './types';
2
+ interface EventComponentProps {
3
+ event: IScheduledEvent;
4
+ baseEventComponent: React.ReactNode;
5
+ }
6
+ export interface EventDateChange {
7
+ startDate: Date;
8
+ endDate: Date;
9
+ }
10
+ export interface SchedulerBaseSettings {
11
+ /**
12
+ * Высота строки часа, в px
13
+ * @default 40
14
+ */
15
+ hourHeight?: number;
16
+ /**
17
+ * Интервал округления времени в минутах
18
+ * @default 15
19
+ */
20
+ timeSnap?: number;
21
+ /**
22
+ * Событие, которое срабатывает при клике на день.
23
+ * Время задается в зависимости от позиции клика.
24
+ */
25
+ onDayClick?: (data: {
26
+ date: Date;
27
+ }) => void;
28
+ /**
29
+ * Событие, которое срабатывает при клике на событие
30
+ */
31
+ onEventClick?: (event: IScheduledEvent) => void;
32
+ /**
33
+ * Событие, которое срабатывает при перетаскивании события
34
+ */
35
+ onEventDrop?: (event: IScheduledEvent, change: EventDateChange) => void;
36
+ /**
37
+ * Событие, которое срабатывает при изменении времени события с помощью ресайзера
38
+ */
39
+ onEventResize?: (event: IScheduledEvent, change: EventDateChange) => void;
40
+ /**
41
+ * Компонент, который будет использоваться для отображения события
42
+ */
43
+ eventComponent?: React.ComponentType<EventComponentProps>;
44
+ /**
45
+ * Функция, определяющая, можно ли перетаскивать событие
46
+ */
47
+ isDraggable?: (event: IScheduledEvent) => boolean;
48
+ /**
49
+ * Функция, определяющая, можно ли изменять размер события
50
+ */
51
+ isResizable?: (event: IScheduledEvent) => boolean;
52
+ }
53
+ export interface SchedulerProps extends SchedulerBaseSettings {
54
+ /**
55
+ * Список отображаемых событий
56
+ */
57
+ events: IScheduledEvent[];
58
+ /**
59
+ * Дата с которой начинается отображение
60
+ */
61
+ startDate?: Date;
62
+ /**
63
+ * Дата с которой заканчивается отображение
64
+ */
65
+ endDate?: Date;
66
+ /**
67
+ * Показывать дни в заголовке. По умолчанию оторажаются.
68
+ * @default true
69
+ */
70
+ showDates?: boolean;
71
+ }
72
+ export declare const Scheduler: React.FC<SchedulerProps>;
73
+ export {};