@stokelp/ui 1.23.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.
@@ -0,0 +1,20 @@
1
+ import { ComponentProps, FC, ReactNode, ForwardRefExoticComponent, DetailedHTMLProps, AnchorHTMLAttributes, DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES, RefObject } from 'react';
2
+ import { ComponentVariants } from '../../utils/slots';
3
+ import { StyledComponent } from '@stokelp/styled-system/jsx';
4
+ import { BreadcrumbRecipe } from '@stokelp/styled-system/recipes';
5
+ import { PolymorphicProps } from '@ark-ui/react';
6
+
7
+ declare const StyledBreadcrumb: ComponentVariants<StyledComponent<"nav", {}>, BreadcrumbRecipe>;
8
+ export declare const BreadcrumbItem: StyledComponent<"li", {}>;
9
+ export declare const BreadcrumbLink: StyledComponent<ForwardRefExoticComponent<Omit< DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
10
+ ref?: ((instance: HTMLAnchorElement | null) => void | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | RefObject<HTMLAnchorElement> | null | undefined;
11
+ } & PolymorphicProps>, {}>;
12
+ export declare const Breadcrumb: FC<BreadcrumbProps>;
13
+ export interface BreadcrumbLinkProps extends ComponentProps<typeof BreadcrumbLink> {
14
+ }
15
+ export interface BreadcrumbItemProps extends ComponentProps<typeof BreadcrumbItem> {
16
+ }
17
+ export interface BreadcrumbProps extends ComponentProps<typeof StyledBreadcrumb> {
18
+ separator?: ReactNode;
19
+ }
20
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Breadcrumb';
@@ -21,4 +21,6 @@ export * from './icon-button';
21
21
  export * from './tooltip';
22
22
  export * from './alert';
23
23
  export * from './table';
24
+ export * from './breadcrumb';
25
+ export * from './popover';
24
26
  export * from './app';
@@ -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
- export declare const Table: ComponentVariants<StyledComponent<"table", {}>, TableRecipe>;
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 {};
@@ -0,0 +1,4 @@
1
+ export type TableSortDescriptor<Key = string> = {
2
+ key: Key;
3
+ direction: 'asc' | 'desc';
4
+ } | null;
@@ -1 +1,2 @@
1
1
  export * from './Table';
2
+ export { type TableSortDescriptor } from './common';