@binamik/components 0.1.1 → 0.1.3
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/Assets/animations/Spinner/SpinnerStyles.d.ts +1 -0
- package/dist/Buttons/DefaultButton/Button.d.ts +1 -1
- package/dist/Buttons/DefaultButton/Button.styles.d.ts +1 -0
- package/dist/Table/EmptyRow.d.ts +6 -0
- package/dist/Table/Header.d.ts +8 -0
- package/dist/Table/MobileSortMenu.d.ts +7 -0
- package/dist/Table/Row.d.ts +12 -0
- package/dist/Table/Table.d.ts +38 -0
- package/dist/Table/helpers.d.ts +5 -0
- package/dist/Table/index.d.ts +5 -0
- package/dist/Table/styles.d.ts +2349 -0
- package/dist/binamik-components.es.js +1429 -239
- package/dist/binamik-components.umd.js +419 -22
- package/dist/index.d.ts +1 -0
- package/package.json +14 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ButtonHTMLAttributes } from 'react';
|
|
2
|
-
declare type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
2
|
+
export declare type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
3
3
|
isLoading?: boolean;
|
|
4
4
|
loadingText?: string;
|
|
5
5
|
outlined?: boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IndexedColumnProps, SortOrder } from './Table';
|
|
3
|
+
export interface TableHeaderProps {
|
|
4
|
+
column: IndexedColumnProps;
|
|
5
|
+
onSort: (v: SortOrder) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const TableHeader: React.FC<TableHeaderProps>;
|
|
8
|
+
export { TableHeader };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IndexedColumnProps, SortOrder } from './Table';
|
|
3
|
+
interface SortMenuProps {
|
|
4
|
+
onSortingChange: (column: IndexedColumnProps) => (order: SortOrder) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const MobileSortMenu: ({ onSortingChange }: SortMenuProps) => JSX.Element | null;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
3
|
+
export interface TableRowProps extends HTMLMotionProps<'li'> {
|
|
4
|
+
children: React.ReactNode[];
|
|
5
|
+
className?: string;
|
|
6
|
+
annex?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface FullTableRowProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare const TableRow: React.FC<TableRowProps>;
|
|
12
|
+
export { TableRow };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SerializedStyles } from '@emotion/react';
|
|
3
|
+
export declare type SortOrder = 'asc' | 'desc' | '';
|
|
4
|
+
export interface SortingProps {
|
|
5
|
+
column: string;
|
|
6
|
+
order: SortOrder;
|
|
7
|
+
}
|
|
8
|
+
export interface ColumnProps {
|
|
9
|
+
label: string;
|
|
10
|
+
name: string;
|
|
11
|
+
sortable?: boolean;
|
|
12
|
+
width?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface IndexedColumnProps extends ColumnProps {
|
|
15
|
+
index: number;
|
|
16
|
+
key: string;
|
|
17
|
+
}
|
|
18
|
+
interface TableProps {
|
|
19
|
+
columns: ColumnProps[];
|
|
20
|
+
mobileBreakpoint?: number;
|
|
21
|
+
children: React.ReactNode[];
|
|
22
|
+
customCss?: SerializedStyles | SerializedStyles[];
|
|
23
|
+
sorting?: {
|
|
24
|
+
column: string;
|
|
25
|
+
order: SortOrder;
|
|
26
|
+
} | null;
|
|
27
|
+
onSortingChange?: ({ column, order }: SortingProps) => void;
|
|
28
|
+
}
|
|
29
|
+
interface TableContextData {
|
|
30
|
+
columns: IndexedColumnProps[];
|
|
31
|
+
sortedColumn?: string;
|
|
32
|
+
sortedOrder?: SortOrder;
|
|
33
|
+
}
|
|
34
|
+
export declare const defaultSortingHandler: (_: SortingProps) => undefined;
|
|
35
|
+
declare const Table: React.FC<TableProps>;
|
|
36
|
+
declare function useTable(): TableContextData;
|
|
37
|
+
export { Table, useTable };
|
|
38
|
+
export type { TableProps };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SortOrder, ColumnProps } from './Table';
|
|
2
|
+
import { TableProps } from './index';
|
|
3
|
+
export declare const buildColumnTemplate: (columns?: ColumnProps[]) => string;
|
|
4
|
+
export declare const validateProps: ({ columns, children, mobileBreakpoint }: TableProps) => void;
|
|
5
|
+
export declare const changeSortOrder: (sortOrder: SortOrder) => SortOrder;
|