@ynput/ayon-react-components 0.2.1 → 0.3.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 (77) hide show
  1. package/README.md +31 -0
  2. package/dist/AssigneeSelect/AssigneeDropdownTemplate.d.ts +9 -0
  3. package/dist/AssigneeSelect/AssigneeField.d.ts +15 -0
  4. package/dist/AssigneeSelect/AssigneeSelect.d.ts +15 -0
  5. package/dist/AssigneeSelect/index.d.ts +3 -0
  6. package/dist/Button/Button.d.ts +11 -0
  7. package/dist/Button/index.d.ts +1 -0
  8. package/dist/Dropdown/Dropdown.d.ts +32 -0
  9. package/dist/Dropdown/index.d.ts +1 -0
  10. package/dist/FileUpload/FileUpload.d.ts +10 -0
  11. package/dist/FileUpload/index.d.ts +1 -0
  12. package/dist/Icon/Icon.d.ts +6 -0
  13. package/dist/Icon/index.d.ts +3 -0
  14. package/dist/IconSelect/IconSelect.d.ts +16 -0
  15. package/dist/IconSelect/index.d.ts +1 -0
  16. package/dist/Inputs/InputColor/ColorPickerPreview.d.ts +10 -0
  17. package/dist/Inputs/InputColor/InputColor.d.ts +14 -0
  18. package/dist/Inputs/InputColor/index.d.ts +1 -0
  19. package/dist/Inputs/InputNumber/InputNumber.d.ts +2 -0
  20. package/dist/Inputs/InputNumber/index.d.ts +1 -0
  21. package/dist/Inputs/InputPassword/InputPassword.d.ts +2 -0
  22. package/dist/Inputs/InputPassword/index.d.ts +1 -0
  23. package/dist/Inputs/InputSwitch/InputSwitch.d.ts +6 -0
  24. package/dist/Inputs/InputSwitch/index.d.ts +1 -0
  25. package/dist/Inputs/InputText/InputText.d.ts +2 -0
  26. package/dist/Inputs/InputText/index.d.ts +1 -0
  27. package/dist/Inputs/InputTextarea/InputTextarea.d.ts +2 -0
  28. package/dist/Inputs/InputTextarea/index.d.ts +1 -0
  29. package/dist/Inputs/LockedInput/LockedInput.d.ts +15 -0
  30. package/dist/Inputs/LockedInput/index.d.ts +1 -0
  31. package/dist/Inputs/styles.d.ts +2 -0
  32. package/dist/Layout/Divider/Divider.d.ts +2 -0
  33. package/dist/Layout/Divider/index.d.ts +1 -0
  34. package/dist/Layout/FormLayout/FormLayout.d.ts +2 -0
  35. package/dist/Layout/FormLayout/index.d.ts +1 -0
  36. package/dist/Layout/FormRow/FormRow.d.ts +5 -0
  37. package/dist/Layout/FormRow/index.d.ts +1 -0
  38. package/dist/Layout/OverflowField/OverflowField.d.ts +6 -0
  39. package/dist/Layout/OverflowField/index.d.ts +1 -0
  40. package/dist/Layout/Section/Section.d.ts +2 -0
  41. package/dist/Layout/Section/index.d.ts +1 -0
  42. package/dist/Layout/Spacer/Spacer.d.ts +2 -0
  43. package/dist/Layout/Spacer/index.d.ts +1 -0
  44. package/dist/Layout/TableRow/TableRow.d.ts +7 -0
  45. package/dist/Layout/TableRow/index.d.ts +1 -0
  46. package/dist/Layout/Toolbar/Toolbar.d.ts +2 -0
  47. package/dist/Layout/Toolbar/index.d.ts +1 -0
  48. package/dist/Overlay/Dialog/Dialog.d.ts +11 -0
  49. package/dist/Overlay/Dialog/index.d.ts +1 -0
  50. package/dist/Overlay/LoaderShade/LoaderShade.d.ts +4 -0
  51. package/dist/Overlay/LoaderShade/index.d.ts +1 -0
  52. package/dist/Panels/Panel/Panel.d.ts +3 -0
  53. package/dist/Panels/Panel/index.d.ts +1 -0
  54. package/dist/Panels/ScrollPanel/ScrollPanel.d.ts +6 -0
  55. package/dist/Panels/ScrollPanel/index.d.ts +1 -0
  56. package/dist/Panels/TablePanel/TablePanel.d.ts +7 -0
  57. package/dist/Panels/TablePanel/index.d.ts +1 -0
  58. package/dist/User/UserImage/UserImage.d.ts +7 -0
  59. package/dist/User/UserImage/index.d.ts +1 -0
  60. package/dist/User/UserImagesStacked/UserImagesStacked.d.ts +12 -0
  61. package/dist/User/UserImagesStacked/index.d.ts +1 -0
  62. package/dist/ayon-react-components.es.js +7629 -7232
  63. package/dist/ayon-react-components.umd.js +730 -476
  64. package/dist/favicon-16x16.png +0 -0
  65. package/dist/favicon-32x32.png +0 -0
  66. package/dist/favicon.ico +0 -0
  67. package/dist/helpers/floatToInt16.d.ts +2 -0
  68. package/dist/helpers/floatToInt8.d.ts +2 -0
  69. package/dist/helpers/hexToFloat.d.ts +2 -0
  70. package/dist/helpers/int8ToHex.d.ts +2 -0
  71. package/dist/helpers/toHexColor.d.ts +2 -0
  72. package/dist/helpers/validateHexColor.d.ts +2 -0
  73. package/dist/index.d.ts +29 -0
  74. package/dist/preview.css +14 -0
  75. package/dist/storybook.css +28 -0
  76. package/dist/style.css +1 -1
  77. package/package.json +61 -14
package/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # AYON Component Library
2
+
3
+ This is a collection of components for the AYON project. It is a work in progress.
4
+
5
+ It can be used to create consistent and accessible AYON addons.
6
+
7
+ For full documentation, see the [storybook](https://ayon.ynput.io/storybook).
8
+
9
+ ## Need a component or found a bug?
10
+
11
+ Please open an github issue.
12
+
13
+ ## Contributing
14
+
15
+ This is an open source project. We welcome contributions.
16
+
17
+ ## Community
18
+
19
+ 👪 Check out our community discussions forum.
20
+
21
+ ☎️ Want to know even more about AYON? Get in contact.
22
+
23
+ 🙋 Need some support or want something custom? Take a look at our services.
24
+
25
+ ## Get Started with Storybook
26
+
27
+ Run locally: `yarn storybook`
28
+
29
+ build: `yarn build-storybook`
30
+
31
+ build-package: `yarn build`
@@ -0,0 +1,9 @@
1
+ export interface AssigneeDropdownProps {
2
+ name: string;
3
+ fullName?: string;
4
+ avatarUrl?: string;
5
+ isSelected?: boolean;
6
+ onClick?: () => void;
7
+ size?: number;
8
+ }
9
+ export declare const AssigneeDropdownTemplate: ({ name, avatarUrl, fullName, isSelected, onClick, size, }: AssigneeDropdownProps) => JSX.Element;
@@ -0,0 +1,15 @@
1
+ export interface AssigneeFieldProps extends React.HTMLAttributes<HTMLDivElement> {
2
+ value: {
3
+ name: string;
4
+ fullName?: string;
5
+ avatarUrl?: string;
6
+ }[];
7
+ onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
8
+ disabled?: boolean;
9
+ isMultiple?: boolean;
10
+ placeholder?: string;
11
+ emptyMessage?: string;
12
+ emptyIcon?: boolean;
13
+ size?: number;
14
+ }
15
+ export declare const AssigneeField: import("react").ForwardRefExoticComponent<AssigneeFieldProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,15 @@
1
+ export interface AssigneeSelectProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
2
+ value: string[];
3
+ options: {
4
+ name: string;
5
+ fullName?: string;
6
+ avatarUrl?: string;
7
+ }[];
8
+ editor?: boolean;
9
+ onChange?: (names: string[]) => void;
10
+ widthExpand?: boolean;
11
+ disabled?: boolean;
12
+ align?: 'left' | 'right';
13
+ isMultiple?: boolean;
14
+ }
15
+ export declare const AssigneeSelect: import("react").ForwardRefExoticComponent<AssigneeSelectProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,3 @@
1
+ export * from './AssigneeSelect';
2
+ export * from './AssigneeField';
3
+ export * from './AssigneeDropdownTemplate';
@@ -0,0 +1,11 @@
1
+ import { ButtonHTMLAttributes } from 'react';
2
+ import { IconType } from '../Icon';
3
+ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
4
+ label?: string;
5
+ icon?: IconType;
6
+ tooltip?: string;
7
+ link?: boolean;
8
+ disabled?: boolean;
9
+ iconStyle?: React.CSSProperties;
10
+ }
11
+ export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1 @@
1
+ export * from './Button';
@@ -0,0 +1,32 @@
1
+ import { CSSProperties } from 'react';
2
+ export interface DropdownProps {
3
+ message?: string;
4
+ itemStyle?: CSSProperties;
5
+ valueStyle?: CSSProperties;
6
+ listStyle?: CSSProperties;
7
+ onOpen?: () => void;
8
+ onClose?: () => void;
9
+ value: Array<string | number>;
10
+ valueTemplate?: (value?: (string | number)[]) => React.ReactNode;
11
+ dataKey?: string;
12
+ dataLabel?: string;
13
+ options: Array<any>;
14
+ itemTemplate?: (option: any, isActive: boolean, isSelected: boolean) => React.ReactNode;
15
+ align?: 'left' | 'right';
16
+ multiSelect?: boolean;
17
+ search?: boolean;
18
+ disabled?: boolean;
19
+ valueIcon?: string;
20
+ emptyMessage?: string;
21
+ placeholder?: string;
22
+ isChanged?: boolean;
23
+ isMultiple?: boolean;
24
+ onChange?: (v: (string | number)[]) => void;
25
+ maxOptionsShown?: number;
26
+ style?: CSSProperties;
27
+ className?: string;
28
+ widthExpand?: boolean;
29
+ searchFields?: string[];
30
+ minSelected?: number;
31
+ }
32
+ export declare const Dropdown: import("react").ForwardRefExoticComponent<DropdownProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './Dropdown';
@@ -0,0 +1,10 @@
1
+ export interface FileUploadProps extends React.HTMLAttributes<HTMLFormElement> {
2
+ files: File[];
3
+ setFiles: React.Dispatch<React.SetStateAction<File[]>>;
4
+ mode?: 'single' | 'multiple' | 'sequence';
5
+ validExtensions?: string[];
6
+ showMaxFiles?: number;
7
+ style?: React.CSSProperties;
8
+ className?: string;
9
+ }
10
+ export declare const FileUpload: import("react").ForwardRefExoticComponent<FileUploadProps & import("react").RefAttributes<HTMLFormElement>>;
@@ -0,0 +1 @@
1
+ export * from './FileUpload';
@@ -0,0 +1,6 @@
1
+ import iconSet from './icons.json';
2
+ export type IconType = keyof typeof iconSet;
3
+ export interface IconProps extends React.HTMLAttributes<HTMLSpanElement> {
4
+ icon: IconType;
5
+ }
6
+ export declare const Icon: import("react").ForwardRefExoticComponent<IconProps & import("react").RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,3 @@
1
+ export * from './Icon';
2
+ import iconSet from './icons.json';
3
+ export { iconSet };
@@ -0,0 +1,16 @@
1
+ import { DropdownProps } from '../Dropdown';
2
+ import { IconType } from '../Icon';
3
+ export interface IconTemplateProps {
4
+ value: IconSelectProps['value'];
5
+ valueTemplate?: boolean;
6
+ isActive?: boolean;
7
+ isSelected?: boolean;
8
+ }
9
+ export interface IconSelectProps extends Omit<DropdownProps, 'options' | 'valueTemplate' | 'itemTemplate' | 'search' | 'ref'> {
10
+ value: DropdownProps['value'];
11
+ onChange?: DropdownProps['onChange'];
12
+ featured?: IconType[];
13
+ featuredOnly?: boolean;
14
+ multiSelect?: DropdownProps['multiSelect'];
15
+ }
16
+ export declare const IconSelect: import("react").ForwardRefExoticComponent<IconSelectProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './IconSelect';
@@ -0,0 +1,10 @@
1
+ import { ChangeEvent, FocusEvent } from 'react';
2
+ export interface ColorPickerPreviewProps {
3
+ onClick?: () => void;
4
+ onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
5
+ backgroundColor?: string;
6
+ value?: string;
7
+ onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
8
+ }
9
+ declare const ColorPickerPreview: import("react").ForwardRefExoticComponent<ColorPickerPreviewProps & import("react").RefAttributes<HTMLDivElement>>;
10
+ export default ColorPickerPreview;
@@ -0,0 +1,14 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export interface InputColorProps {
3
+ value: string | number[];
4
+ onChange: (event: {
5
+ target: {
6
+ value: string | number[];
7
+ };
8
+ }) => void;
9
+ alpha?: boolean;
10
+ format?: 'hex' | 'float' | 'uint8' | 'uint16';
11
+ className?: string;
12
+ style?: HTMLAttributes<HTMLDivElement>['style'];
13
+ }
14
+ export declare const InputColor: import("react").ForwardRefExoticComponent<InputColorProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './InputColor';
@@ -0,0 +1,2 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ export declare const InputNumber: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1 @@
1
+ export * from './InputNumber';
@@ -0,0 +1,2 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ export declare const InputPassword: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1 @@
1
+ export * from './InputPassword';
@@ -0,0 +1,6 @@
1
+ import { CSSProperties, InputHTMLAttributes } from 'react';
2
+ export interface InputSwitchProps extends InputHTMLAttributes<HTMLInputElement> {
3
+ switchClassName?: string;
4
+ switchStyle?: CSSProperties;
5
+ }
6
+ export declare const InputSwitch: import("react").ForwardRefExoticComponent<InputSwitchProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1 @@
1
+ export * from './InputSwitch';
@@ -0,0 +1,2 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ export declare const InputText: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1 @@
1
+ export * from './InputText';
@@ -0,0 +1,2 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ export declare const InputTextarea: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLTextAreaElement> & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -0,0 +1 @@
1
+ export { InputTextarea } from './InputTextarea';
@@ -0,0 +1,15 @@
1
+ import { IconType } from '../../Icon';
2
+ export interface LockedInputProps extends Omit<React.InputHTMLAttributes<HTMLDivElement>, 'onSubmit'> {
3
+ value: string;
4
+ onSubmit?: (value: string) => void;
5
+ onEdit?: () => void;
6
+ onCancel?: () => void;
7
+ label?: string;
8
+ disabled?: boolean;
9
+ saveLabel?: string;
10
+ cancelLabel?: string;
11
+ editIcon?: IconType;
12
+ fullUnlock?: boolean;
13
+ type?: React.HTMLInputTypeAttribute;
14
+ }
15
+ export declare const LockedInput: import("react").ForwardRefExoticComponent<LockedInputProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './LockedInput';
@@ -0,0 +1,2 @@
1
+ declare const StyledInput: import("styled-components").StyledComponent<"input", any, {}, never>;
2
+ export default StyledInput;
@@ -0,0 +1,2 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export declare const Divider: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './Divider';
@@ -0,0 +1,2 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export declare const FormLayout: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './FormLayout';
@@ -0,0 +1,5 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export interface FormRowProps extends HTMLAttributes<HTMLDivElement> {
3
+ label: string;
4
+ }
5
+ export declare const FormRow: import("react").ForwardRefExoticComponent<FormRowProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './FormRow';
@@ -0,0 +1,6 @@
1
+ export interface OverflowFieldProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'> {
2
+ value?: string | number | React.ReactNode;
3
+ align?: 'left' | 'right';
4
+ onClick?: (value: string) => void;
5
+ }
6
+ export declare const OverflowField: import("react").ForwardRefExoticComponent<OverflowFieldProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './OverflowField';
@@ -0,0 +1,2 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export declare const Section: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1 @@
1
+ export * from './Section';
@@ -0,0 +1,2 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export declare const Spacer: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './Spacer';
@@ -0,0 +1,7 @@
1
+ export interface TableRowProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onCopy'> {
2
+ name?: string;
3
+ value?: string | number | React.ReactNode;
4
+ tooltip?: string;
5
+ onCopy?: (value: string) => void;
6
+ }
7
+ export declare const TableRow: import("react").ForwardRefExoticComponent<TableRowProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './TableRow';
@@ -0,0 +1,2 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export declare const Toolbar: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1 @@
1
+ export * from './Toolbar';
@@ -0,0 +1,11 @@
1
+ export interface DialogProps extends React.HTMLAttributes<HTMLDivElement> {
2
+ onHide?: () => void;
3
+ header?: React.ReactNode;
4
+ footer?: React.ReactNode;
5
+ children?: React.ReactNode;
6
+ headerStyle?: React.CSSProperties;
7
+ bodyStyle?: React.CSSProperties;
8
+ footerStyle?: React.CSSProperties;
9
+ visible?: boolean;
10
+ }
11
+ export declare const Dialog: import("react").ForwardRefExoticComponent<DialogProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './Dialog';
@@ -0,0 +1,4 @@
1
+ export interface LoaderProps extends React.HTMLAttributes<HTMLDivElement> {
2
+ message?: string;
3
+ }
4
+ export declare const LoaderShade: import("react").ForwardRefExoticComponent<LoaderProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './LoaderShade';
@@ -0,0 +1,3 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export declare const PanelStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const Panel: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './Panel';
@@ -0,0 +1,6 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export interface ScrollPanelProps extends HTMLAttributes<HTMLDivElement> {
3
+ children: React.ReactNode;
4
+ scrollStyle?: React.CSSProperties;
5
+ }
6
+ export declare const ScrollPanel: import("react").ForwardRefExoticComponent<ScrollPanelProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './ScrollPanel';
@@ -0,0 +1,7 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export interface ScrollPanelProps extends HTMLAttributes<HTMLDivElement> {
3
+ children: React.ReactNode;
4
+ scrollStyle?: React.CSSProperties;
5
+ loading?: boolean;
6
+ }
7
+ export declare const TablePanel: import("react").ForwardRefExoticComponent<ScrollPanelProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './TablePanel';
@@ -0,0 +1,7 @@
1
+ export interface UserImageProps extends React.HTMLAttributes<HTMLDivElement> {
2
+ src?: string;
3
+ fullName?: string;
4
+ size?: number;
5
+ highlight?: boolean;
6
+ }
7
+ export declare const UserImage: import("react").ForwardRefExoticComponent<UserImageProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './UserImage';
@@ -0,0 +1,12 @@
1
+ export interface UserImagesStackedProps extends React.HTMLAttributes<HTMLDivElement> {
2
+ users: {
3
+ avatarUrl?: string;
4
+ fullName?: string;
5
+ self?: boolean;
6
+ }[];
7
+ size?: number;
8
+ gap?: number;
9
+ max?: number;
10
+ userStyle?: React.CSSProperties;
11
+ }
12
+ export declare const UserImagesStacked: import("react").ForwardRefExoticComponent<UserImagesStackedProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './UserImagesStacked';