@sorocraft/ui 1.2.41 → 1.2.45

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,9 +1,13 @@
1
1
  import { ReactElement, RefObject } from "react";
2
+ import { TextProps } from "../Text/Text.types";
2
3
  interface Props {
3
4
  children: ReactElement[];
4
5
  gap?: number;
5
6
  className?: string;
7
+ enableNavigation?: boolean;
8
+ title?: string;
9
+ titleVariant?: TextProps["variant"];
6
10
  onGetRef?: (ref: RefObject<HTMLDivElement>) => void;
7
11
  }
8
- declare const Carousel: ({ children, gap, className, onGetRef }: Props) => import("react/jsx-runtime").JSX.Element;
12
+ declare const Carousel: ({ children, gap, className, enableNavigation, title, titleVariant, onGetRef, }: Props) => import("react/jsx-runtime").JSX.Element;
9
13
  export default Carousel;
@@ -0,0 +1,9 @@
1
+ import { RefObject } from "react";
2
+ import { SIZE } from "src/models/ui";
3
+ interface Props {
4
+ size: SIZE;
5
+ scrollRef: RefObject<HTMLDivElement>;
6
+ scrollAmount?: number;
7
+ }
8
+ declare const NavigationButton: ({ size, scrollRef, scrollAmount }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export default NavigationButton;
@@ -0,0 +1 @@
1
+ export { default } from "./CarouselNavigation.";
@@ -0,0 +1,6 @@
1
+ export declare const initialState: {
2
+ sourceContentId: any;
3
+ targetContentId: any;
4
+ destinationId: any;
5
+ isOverTargetTopHalf: boolean;
6
+ };
@@ -0,0 +1,4 @@
1
+ import { ID } from "./DnD.types";
2
+ export declare const useIsDnDOver: (contentId: ID) => boolean;
3
+ export declare const useIsDragging: (contentId: ID) => boolean;
4
+ export declare const useIsTargetOverTopHalf: () => boolean;
@@ -0,0 +1,13 @@
1
+ export type ID = string | number | null;
2
+ export interface DnDState {
3
+ sourceContentId: ID;
4
+ targetContentId: ID;
5
+ isOverTargetTopHalf: boolean;
6
+ destinationId?: ID;
7
+ }
8
+ export type SetParams = Partial<DnDState>;
9
+ export type DndContent = {
10
+ dndState: DnDState;
11
+ setDnDState: (params: SetParams) => void;
12
+ resetDnDState: () => void;
13
+ };
@@ -0,0 +1,4 @@
1
+ import { DndContent } from "./DnD.types";
2
+ declare const DnDContext: import("react").Context<DndContent>;
3
+ export declare const useDnDContext: () => DndContent;
4
+ export default DnDContext;
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from "react";
2
+ declare const DnDProvider: ({ children }: {
3
+ children: ReactNode;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default DnDProvider;
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from "react";
2
+ import { ID } from "../DnD.types";
3
+ interface Props {
4
+ contentId: ID;
5
+ children: ReactNode;
6
+ }
7
+ declare const Draggable: ({ contentId, children }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export default Draggable;
@@ -0,0 +1 @@
1
+ export { default } from "./Draggable";
@@ -0,0 +1,9 @@
1
+ import { DragEventHandler, ReactNode } from "react";
2
+ interface Props {
3
+ onDrop?: DragEventHandler<HTMLDivElement>;
4
+ onDragEnter?: DragEventHandler<HTMLDivElement>;
5
+ onDragLeave?: DragEventHandler<HTMLDivElement>;
6
+ children: ReactNode;
7
+ }
8
+ declare const Droppable: ({ children, onDrop, onDragEnter, onDragLeave }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export default Droppable;
@@ -0,0 +1,5 @@
1
+ export { default as Draggable } from "./Draggable";
2
+ export { default as Droppable } from "./Droppable";
3
+ export { default as DnDContext } from "./DnDContext";
4
+ export * from "./DnDContext";
5
+ export { default as DnDProvider } from "./DnDProvider";
package/dist/index.d.ts CHANGED
@@ -48,6 +48,7 @@ export { default as ToggleSwitch } from "./components/ToggleSwitch";
48
48
  export { default as Grid } from "./components/Grid";
49
49
  export { default as AddressAutocomplete } from "./components/AddressAutocomplete";
50
50
  export * from "./components/Table";
51
+ export * from "./components/DnD";
51
52
  export * from "./components/SVGIcon/SVGIcon.types";
52
53
  export * from "./components/Input/Input.types";
53
54
  export * from "./components/DropDown/DropDown.types";