@candy.thieves/ui-kit-lumos 0.0.12 → 0.0.14
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/index.css +1 -1
- package/dist/index.js +1603 -1384
- package/dist/index.js.map +1 -1
- package/dist/types/components/Modal/Modal.d.ts +25 -0
- package/dist/types/components/Modal/index.d.ts +1 -0
- package/dist/types/components/Scroll/Scroll.d.ts +6 -0
- package/dist/types/components/Scroll/index.d.ts +1 -0
- package/dist/types/components/TextArea/FormTextArea.d.ts +8 -0
- package/dist/types/components/TextArea/TextArea.d.ts +11 -0
- package/dist/types/components/TextArea/index.d.ts +2 -0
- package/dist/types/components/index.d.ts +3 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/useScrollThumbs.d.ts +9 -0
- package/dist/types/hooks/useThumbDrag.d.ts +9 -0
- package/dist/types/types/types.d.ts +11 -0
- package/dist/types/utils/getHorizontalMetrics.d.ts +2 -0
- package/dist/types/utils/getVerticalMetrics.d.ts +2 -0
- package/package.json +5 -4
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as Dialog from '@radix-ui/react-dialog';
|
|
2
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
3
|
+
import type { ModalSize } from '@/types';
|
|
4
|
+
export type ModalProps = {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
size?: ModalSize;
|
|
8
|
+
modalTitle?: ReactNode;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
showHeader?: boolean;
|
|
11
|
+
showCloseButton?: boolean;
|
|
12
|
+
fullSize?: boolean;
|
|
13
|
+
closeButtonOutside?: boolean;
|
|
14
|
+
} & Omit<ComponentPropsWithoutRef<typeof Dialog.Content>, 'children'>;
|
|
15
|
+
export declare const Modal: import("react").ForwardRefExoticComponent<{
|
|
16
|
+
open: boolean;
|
|
17
|
+
onClose: () => void;
|
|
18
|
+
size?: ModalSize;
|
|
19
|
+
modalTitle?: ReactNode;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
showHeader?: boolean;
|
|
22
|
+
showCloseButton?: boolean;
|
|
23
|
+
fullSize?: boolean;
|
|
24
|
+
closeButtonOutside?: boolean;
|
|
25
|
+
} & Omit<Omit<Dialog.DialogContentProps & import("react").RefAttributes<HTMLDivElement>, "ref">, "children"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Modal';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Scroll';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Control, type FieldPath, type FieldValues } from 'react-hook-form';
|
|
2
|
+
import { type TextAreaProps } from './TextArea';
|
|
3
|
+
type FormTextAreaProps<T extends FieldValues> = {
|
|
4
|
+
control: Control<T>;
|
|
5
|
+
name: FieldPath<T>;
|
|
6
|
+
} & Omit<TextAreaProps, 'defaultValue' | 'onBlur' | 'onChange' | 'value'>;
|
|
7
|
+
export declare const FormTextArea: <T extends FieldValues>({ control, name, ...props }: FormTextAreaProps<T>) => import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type TextAreaProps = {
|
|
3
|
+
label?: string;
|
|
4
|
+
error?: string;
|
|
5
|
+
resize?: 'both' | 'horizontal' | 'none' | 'vertical';
|
|
6
|
+
} & ComponentPropsWithoutRef<'textarea'>;
|
|
7
|
+
export declare const TextArea: import("react").ForwardRefExoticComponent<{
|
|
8
|
+
label?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
resize?: "both" | "horizontal" | "none" | "vertical";
|
|
11
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -7,12 +7,15 @@ export * from './CircularProgress';
|
|
|
7
7
|
export * from './Input';
|
|
8
8
|
export * from './LinearProgress';
|
|
9
9
|
export * from './Message';
|
|
10
|
+
export * from './Modal';
|
|
10
11
|
export * from './PasswordInput';
|
|
11
12
|
export * from './RadioGroup';
|
|
12
13
|
export * from './ReadMore';
|
|
14
|
+
export * from './Scroll';
|
|
13
15
|
export * from './SearchInput';
|
|
14
16
|
export * from './Select';
|
|
15
17
|
export * from './Table';
|
|
16
18
|
export * from './Tabs';
|
|
19
|
+
export * from './TextArea';
|
|
17
20
|
export * from './Tooltip';
|
|
18
21
|
export * from './Typography';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
type UseScrollThumbsParams = {
|
|
3
|
+
viewportRef: RefObject<HTMLDivElement | null>;
|
|
4
|
+
contentRef: RefObject<HTMLDivElement | null>;
|
|
5
|
+
verticalThumbRef: RefObject<HTMLDivElement | null>;
|
|
6
|
+
horizontalThumbRef: RefObject<HTMLDivElement | null>;
|
|
7
|
+
};
|
|
8
|
+
export declare const useScrollThumbs: ({ viewportRef, contentRef, verticalThumbRef, horizontalThumbRef, }: UseScrollThumbsParams) => void;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
type UseThumbDragParams = {
|
|
3
|
+
viewportRef: RefObject<HTMLDivElement | null>;
|
|
4
|
+
};
|
|
5
|
+
export declare const useThumbDrag: ({ viewportRef }: UseThumbDragParams) => {
|
|
6
|
+
handleVerticalMouseDown: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
7
|
+
handleHorizontalMouseDown: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -2,3 +2,14 @@ export type ProgressThemeColor = 'error' | 'inherit' | 'primary' | 'success' | '
|
|
|
2
2
|
export type ProgressSizeVariant = 'lg' | 'md' | 'sm';
|
|
3
3
|
export type AvatarSize = 'l' | 'm' | 's' | 'xs';
|
|
4
4
|
export type MainAvatarSize = 'xl' | 'xxl';
|
|
5
|
+
export type ModalSize = 'l' | 'm' | 's' | 'xl' | 'xs';
|
|
6
|
+
export type VerticalMetrics = {
|
|
7
|
+
thumbHeight: number;
|
|
8
|
+
maxThumbOffsetY: number;
|
|
9
|
+
maxScrollOffsetY: number;
|
|
10
|
+
};
|
|
11
|
+
export type HorizontalMetrics = {
|
|
12
|
+
thumbWidth: number;
|
|
13
|
+
maxThumbOffsetX: number;
|
|
14
|
+
maxScrollOffsetX: number;
|
|
15
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@candy.thieves/ui-kit-lumos",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.14",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -28,9 +28,10 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@fontsource-variable/inter": "^5.3.0",
|
|
30
30
|
"@fontsource-variable/roboto": "^5.3.0",
|
|
31
|
-
"@radix-ui/react-tabs": "^1.1.18",
|
|
32
31
|
"@radix-ui/react-checkbox": "^1.3.8",
|
|
32
|
+
"@radix-ui/react-dialog": "^1.1.23",
|
|
33
33
|
"@radix-ui/react-radio-group": "^1.4.5",
|
|
34
|
+
"@radix-ui/react-tabs": "^1.1.18",
|
|
34
35
|
"@radix-ui/react-tooltip": "^1.2.16",
|
|
35
36
|
"@radix-ui/themes": "^3.3.0",
|
|
36
37
|
"clsx": "^2.1.1",
|
|
@@ -74,14 +75,14 @@
|
|
|
74
75
|
"lint-staged": "^17.1.0",
|
|
75
76
|
"playwright": "^1.61.1",
|
|
76
77
|
"prettier": "3.9.5",
|
|
78
|
+
"react-hook-form": "^7.82.0",
|
|
77
79
|
"sass": "^1.101.0",
|
|
78
80
|
"storybook": "^10.5.2",
|
|
79
81
|
"stylelint": "^17.14.0",
|
|
80
82
|
"typescript": "~6.0.2",
|
|
81
83
|
"typescript-eslint": "^8.62.0",
|
|
82
84
|
"vite": "^8.1.1",
|
|
83
|
-
"vitest": "^4.1.10"
|
|
84
|
-
"react-hook-form": "^7.82.0"
|
|
85
|
+
"vitest": "^4.1.10"
|
|
85
86
|
},
|
|
86
87
|
"lint-staged": {
|
|
87
88
|
"**/*.{jsx,js,tsx,ts}": [
|