@konoma-development/react-components 0.1.18 → 0.2.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.
@@ -1,11 +1,11 @@
1
- import { JSX, Ref } from 'react';
1
+ import { ReactNode, Ref } from 'react';
2
2
  export declare const ErrorContext: import('react').Context<{
3
3
  errors: Record<string, string[]>;
4
4
  setErrors: (errors: Record<string, string[]>) => void;
5
5
  }>;
6
6
  export default function Form<DataType>({ children, className, validators, data, formRef, onValidation, onSubmit, }: {
7
7
  formRef?: Ref<HTMLFormElement>;
8
- children: JSX.Element[] | JSX.Element;
8
+ children: ReactNode;
9
9
  className?: string;
10
10
  data: DataType;
11
11
  validators: Record<keyof DataType, ((value: string | number | boolean | null) => string)[]>;
@@ -1,4 +1,4 @@
1
- import { ChangeEvent, HTMLInputTypeAttribute, JSX, MouseEvent } from 'react';
1
+ import { ChangeEvent, HTMLInputTypeAttribute, MouseEvent, ReactNode } from 'react';
2
2
  type LabelPosition = 'top' | 'bottom' | 'left' | 'right';
3
3
  export type FormValue = string | number | boolean | Option;
4
4
  export interface Option {
@@ -86,7 +86,7 @@ export interface FormFieldProps<DataType> extends Classes {
86
86
  indeterminate?: boolean;
87
87
  isClearable?: boolean;
88
88
  replacements?: Record<string, string>;
89
- label?: string | JSX.Element;
89
+ label?: ReactNode;
90
90
  labelPosition?: LabelPosition;
91
91
  maxLength?: number;
92
92
  maxLengthLabel?: string;
@@ -1,2 +1,2 @@
1
- export declare function required(message?: string): (value: string | number | boolean | null) => string;
2
- export declare function email(message?: string): (value: string | number | boolean | null) => string;
1
+ export declare function required(message: string): (value: string | number | boolean | null) => string;
2
+ export declare function email(message: string): (value: string | number | boolean | null) => string;
@@ -1,8 +1,8 @@
1
- import { JSX } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { PaginationClasses } from './pagination.tsx';
3
3
  export interface TableColumn<DataType> {
4
4
  id: keyof DataType;
5
- title: string | JSX.Element;
5
+ title: ReactNode;
6
6
  initialWidth?: string | number;
7
7
  hidden?: boolean;
8
8
  sorting?: '+' | '-' | undefined;
@@ -13,7 +13,7 @@ export interface TableColumn<DataType> {
13
13
  allowResize?: boolean;
14
14
  filterable?: boolean;
15
15
  grow?: boolean;
16
- filterComponent?: (filters: Record<string, string[]>, setFilters: (filters: Record<string, string[]>) => Promise<void>) => JSX.Element;
16
+ filterComponent?: (filters: Record<string, string[]>, setFilters: (filters: Record<string, string[]>) => Promise<void>) => ReactNode;
17
17
  }
18
18
  export default function Table<DataType extends {
19
19
  dragRef?: React.RefObject<HTMLDivElement>;
@@ -40,10 +40,10 @@ export default function Table<DataType extends {
40
40
  cellRenderer?: {
41
41
  [key in keyof DataType]?: (data: DataType & {
42
42
  dragRef?: React.RefObject<HTMLDivElement>;
43
- }) => JSX.Element;
43
+ }) => ReactNode;
44
44
  };
45
45
  filterComponents?: {
46
- [key in keyof DataType]?: (filters: Record<string, string[]>, setFilters: (filters: Record<string, string[]>) => Promise<void>) => JSX.Element;
46
+ [key in keyof DataType]?: (filters: Record<string, string[]>, setFilters: (filters: Record<string, string[]>) => Promise<void>) => ReactNode;
47
47
  };
48
48
  filters?: Record<string, string[]>;
49
49
  showFilters?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { MouseEvent } from 'react';
2
- export default function Button({ className, classesBase, classesPrimary, classesSecondary, classesActiveSecondary, classesError, classesAlert, loadingClassesBase, loadingClassesPrimary, loadingClassesSecondary, loadingClassesActiveSecondary, loadingClassesError, loadingClassesAlert, iconLeftClasses, iconRightClasses, type, variant, label, loading, disabled, iconLeftPath, iconLeftName, iconRightPath, iconRightName, name, onClick, }: {
2
+ export default function Button({ className, classesBase, classesPrimary, classesSecondary, classesActiveSecondary, classesError, classesAlert, loadingClassesBase, loadingClassesPrimary, loadingClassesSecondary, loadingClassesActiveSecondary, loadingClassesError, loadingClassesAlert, iconLeftClasses, iconRightClasses, type, variant, label, loading, disabled, iconLeftPath, iconLeftName, iconRightPath, iconRightName, onClick, }: {
3
3
  classesBase?: string;
4
4
  classesPrimary?: string;
5
5
  classesSecondary?: string;
@@ -24,6 +24,5 @@ export default function Button({ className, classesBase, classesPrimary, classes
24
24
  iconLeftName?: string;
25
25
  iconRightPath?: string;
26
26
  iconRightName?: string;
27
- name?: string;
28
27
  onClick?: (e: MouseEvent) => Promise<void> | void;
29
28
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ export declare const i18nContext: import('react').Context<{
3
+ locale: string;
4
+ }>;
5
+ export default function ComponentsWrapper({ children, locale }: {
6
+ children: ReactNode;
7
+ locale?: string;
8
+ }): import("react/jsx-runtime").JSX.Element;
package/dist/main.d.ts CHANGED
@@ -21,5 +21,6 @@ import { default as LoadingIndicator } from './components/ui/loadingIndicator.ts
21
21
  import { default as Modal } from './components/ui/modal.tsx';
22
22
  import { default as Tabs } from './components/ui/tabs.tsx';
23
23
  import { default as Tag } from './components/ui/tag.tsx';
24
+ import { default as ComponentsWrapper } from './components/wrapper.tsx';
24
25
  import * as validators from './components/form/validators.ts';
25
- export { Button, Checkbox, CheckboxList, Classes, ColumnChooser, ColumnChooserEntry, ErrorContext, FilterContext, Form, FormField, FormFieldProps, FormValue, Icon, Input, LoadingIndicator, Mask, Modal, Option, Pagination, PhoneInput, RadioButtonGroup, Select, Table, TableActionEntry, TableActions, TableColumn, Tabs, Tag, TagList, TextArea, validators, };
26
+ export { Button, Checkbox, CheckboxList, Classes, ColumnChooser, ColumnChooserEntry, ComponentsWrapper, ErrorContext, FilterContext, Form, FormField, FormFieldProps, FormValue, Icon, Input, LoadingIndicator, Mask, Modal, Option, Pagination, PhoneInput, RadioButtonGroup, Select, Table, TableActionEntry, TableActions, TableColumn, Tabs, Tag, TagList, TextArea, validators, };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@konoma-development/react-components",
3
3
  "packageManager": "yarn@4.6.0",
4
- "version": "0.1.18",
4
+ "version": "0.2.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },