@stokelp/ui 1.24.0 → 1.25.0
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/components/index.d.ts +1 -0
- package/dist/components/popover/Popover.d.ts +21 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/table/Table.d.ts +7 -3
- package/dist/components/table/TableProvider.d.ts +22 -0
- package/dist/components/table/common.d.ts +4 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/theme/recipes/index.d.ts +1 -0
- package/dist/theme/recipes/popover.d.ts +2 -0
- package/dist/ui.cjs +3 -3
- package/dist/ui.cjs.map +1 -1
- package/dist/ui.js +602 -455
- package/dist/ui.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Popover as ArkPopover } from '@ark-ui/react';
|
|
2
|
+
import { ComponentProps, ForwardRefExoticComponent, RefAttributes, ReactNode } from 'react';
|
|
3
|
+
import { ComponentVariants } from '../../utils/slots';
|
|
4
|
+
import { PopoverRecipe } from '@stokelp/styled-system/recipes';
|
|
5
|
+
import { StyledComponent } from '@stokelp/styled-system/jsx';
|
|
6
|
+
|
|
7
|
+
export declare const Popover: ComponentVariants<(props: ArkPopover.RootProps) => import("react/jsx-runtime").JSX.Element, PopoverRecipe>;
|
|
8
|
+
export declare const PopoverCloseTrigger: StyledComponent<ForwardRefExoticComponent<ArkPopover.CloseTriggerProps & RefAttributes<HTMLButtonElement>>, {}>;
|
|
9
|
+
export declare const PopoverTrigger: StyledComponent<ForwardRefExoticComponent<ArkPopover.TriggerProps & RefAttributes<HTMLButtonElement>>, {}>;
|
|
10
|
+
export declare const PopoverContent: StyledComponent<ForwardRefExoticComponent<Omit<ArkPopover.ContentProps & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>, {}>;
|
|
11
|
+
export declare const PopoverContext: (props: ArkPopover.ContextProps) => ReactNode;
|
|
12
|
+
export interface PopoverProps extends ComponentProps<typeof Popover> {
|
|
13
|
+
}
|
|
14
|
+
export interface PopoverCloseTriggerProps extends ComponentProps<typeof PopoverCloseTrigger> {
|
|
15
|
+
}
|
|
16
|
+
export interface PopoverContentProps extends ComponentProps<typeof PopoverContent> {
|
|
17
|
+
}
|
|
18
|
+
export interface PopoverTriggerProps extends ComponentProps<typeof PopoverTrigger> {
|
|
19
|
+
}
|
|
20
|
+
export interface PopoverContextProps extends ComponentProps<typeof PopoverContext> {
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Popover';
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { ComponentProps, FC, ReactNode } from 'react';
|
|
2
|
+
import { TableProviderProps } from './TableProvider';
|
|
2
3
|
import { StyledComponent } from '@stokelp/styled-system/jsx';
|
|
3
4
|
import { TableContainerVariantProps, TableRecipe, TableGroupTitleVariantProps, TableEmptyRowVariantProps } from '@stokelp/styled-system/recipes';
|
|
4
5
|
import { ComponentVariants } from '../../utils/slots';
|
|
5
6
|
|
|
6
7
|
export declare const TableContainer: StyledComponent<"div", TableContainerVariantProps>;
|
|
7
|
-
|
|
8
|
+
declare const StyledTable: ComponentVariants<StyledComponent<"table", {}>, TableRecipe>;
|
|
9
|
+
type StyledTableProps = ComponentProps<typeof StyledTable>;
|
|
10
|
+
export interface TableProps extends StyledTableProps, Pick<TableProviderProps, 'onSortChange'> {
|
|
11
|
+
}
|
|
12
|
+
export declare const Table: FC<TableProps>;
|
|
8
13
|
export declare const Thead: StyledComponent<"thead", {}>;
|
|
9
14
|
export declare const Tbody: StyledComponent<"tbody", {}>;
|
|
10
15
|
export declare const Tr: StyledComponent<"tr", {}>;
|
|
@@ -12,6 +17,7 @@ declare const StyledTh: StyledComponent<"th", {}>;
|
|
|
12
17
|
type StyledThProps = ComponentProps<typeof StyledTh>;
|
|
13
18
|
export interface ThProps extends StyledThProps {
|
|
14
19
|
addon?: ReactNode;
|
|
20
|
+
sortKey?: string;
|
|
15
21
|
}
|
|
16
22
|
export declare const Th: FC<ThProps>;
|
|
17
23
|
export declare const Td: StyledComponent<"td", {}>;
|
|
@@ -21,8 +27,6 @@ export declare const TableGroupTitle: FC<TableGroupTitleProps>;
|
|
|
21
27
|
declare const StyledTableEmptyRow: StyledComponent<"td", TableEmptyRowVariantProps>;
|
|
22
28
|
export type TableEmptyRowProps = ComponentProps<typeof StyledTableEmptyRow>;
|
|
23
29
|
export declare const TableEmptyRow: FC<TableEmptyRowProps>;
|
|
24
|
-
export interface TableProps extends ComponentProps<typeof Table> {
|
|
25
|
-
}
|
|
26
30
|
export interface TheadProps extends ComponentProps<typeof Thead> {
|
|
27
31
|
}
|
|
28
32
|
export interface TbodyProps extends ComponentProps<typeof Tbody> {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Dispatch, FC, ReactNode } from 'react';
|
|
2
|
+
import { TableSortDescriptor } from './common';
|
|
3
|
+
|
|
4
|
+
type State = {
|
|
5
|
+
sortDescriptor: TableSortDescriptor;
|
|
6
|
+
};
|
|
7
|
+
type Action = {
|
|
8
|
+
type: 'UPDATE_SORT_DESCRIPTOR';
|
|
9
|
+
payload: TableSortDescriptor;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'CLEAR_SORT_DESCRIPTOR';
|
|
12
|
+
};
|
|
13
|
+
type Context = State & {
|
|
14
|
+
dispatch: Dispatch<Action>;
|
|
15
|
+
};
|
|
16
|
+
export interface TableProviderProps {
|
|
17
|
+
onSortChange?: (descriptor: TableSortDescriptor<any>) => void;
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export declare const useTable: () => Context;
|
|
21
|
+
export declare const TableProvider: FC<TableProviderProps>;
|
|
22
|
+
export {};
|