ownui-system 0.1.2 → 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.
@@ -0,0 +1,15 @@
1
+ import type { StoryObj } from "@storybook/react";
2
+ import { SnackBar } from ".";
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof SnackBar;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const Default: Story;
13
+ export declare const Success: Story;
14
+ export declare const Danger: Story;
15
+ export declare const WithAction: Story;
@@ -0,0 +1,2 @@
1
+ export { default as SnackBarProvider } from "./snackbar-provider";
2
+ export { default as SnackBar } from "./snackbar";
@@ -0,0 +1,28 @@
1
+ /// <reference types="react" />
2
+ export type SnackBarType = "normal" | "success" | "danger";
3
+ export type SnackBarAction = {
4
+ name: string;
5
+ callback: () => void;
6
+ };
7
+ export type SnackBarOptions = {
8
+ type: SnackBarType;
9
+ action?: SnackBarAction;
10
+ delay?: number;
11
+ };
12
+ type SnackBarContextValue = {
13
+ isOpen: boolean;
14
+ message?: string;
15
+ action?: SnackBarAction;
16
+ type?: SnackBarType;
17
+ delay: number;
18
+ openSnackBar: (message: string, options?: SnackBarOptions) => void;
19
+ closeSnackBar: () => void;
20
+ resetSnackBar: () => void;
21
+ };
22
+ declare function useContext(): SnackBarContextValue;
23
+ export default function useSnackBarContext(): {
24
+ SnackBarContextProvider: import("react").Provider<SnackBarContextValue | undefined>;
25
+ useContext: typeof useContext;
26
+ Context: import("react").Context<SnackBarContextValue | undefined>;
27
+ };
28
+ export {};
@@ -0,0 +1,7 @@
1
+ import { type PropsWithChildren } from "react";
2
+ type SnackBarAreaProps = {
3
+ className?: string;
4
+ zIndex?: number;
5
+ } & PropsWithChildren;
6
+ declare function SnackBarProvider({ children, className, zIndex, }: SnackBarAreaProps): import("react/jsx-runtime").JSX.Element;
7
+ export default SnackBarProvider;
@@ -0,0 +1,5 @@
1
+ export declare const baseStyle = "fixed z-[var(--zIndex)] flex items-center justify-center w-full h-full top-0 left-0 ";
2
+ export declare const itemPositionStyle = "fixed left-[50%] bottom-10";
3
+ export declare const itemStyle = "flex items-center justify-between gap-12 rounded-xl text-white w-fit min-w-[144px] h-14 bg-gray-950 opacity-95 shadow-[0px_4px_10px_0px_rgba(106,113,126,0.40)]";
4
+ export declare const withActionStyle = "pl-8 pr-6";
5
+ export declare const withoutActionStyle = "pl-[42px] pr-11";
@@ -0,0 +1,18 @@
1
+ export declare const slideInOut: {
2
+ enter: {
3
+ y: string;
4
+ x: string;
5
+ transition: {
6
+ duration: number;
7
+ ease: number[];
8
+ };
9
+ };
10
+ exit: {
11
+ y: string;
12
+ x: string;
13
+ transition: {
14
+ duration: number;
15
+ ease: number[];
16
+ };
17
+ };
18
+ };
@@ -0,0 +1,5 @@
1
+ type SnackBarProps = {
2
+ className?: string;
3
+ };
4
+ declare function SnackBar({ className }: SnackBarProps): import("react/jsx-runtime").JSX.Element;
5
+ export default SnackBar;
@@ -16,8 +16,9 @@ export * from "./Modal";
16
16
  export * from "./Dropdown";
17
17
  export * from "./Popover";
18
18
  export * from "./BottomSheet";
19
- export * from './InfiniteSlider';
20
- export * from './Checkbox';
21
- export * from './Radio';
22
- export * from './Pagination';
23
- export * from './Switch';
19
+ export * from "./InfiniteSlider";
20
+ export * from "./Checkbox";
21
+ export * from "./Radio";
22
+ export * from "./Pagination";
23
+ export * from "./Switch";
24
+ export * from "./SnackBar";
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ type Case = string | number;
3
+ type SwitchCaseProps<T extends Case> = {
4
+ value: T;
5
+ caseBy: Partial<Record<T, JSX.Element | null>>;
6
+ defaultComponent?: JSX.Element | null;
7
+ };
8
+ declare function SwitchCase<T extends Case>({ value, caseBy, defaultComponent, }: SwitchCaseProps<T>): JSX.Element | null;
9
+ export default SwitchCase;
@@ -0,0 +1,8 @@
1
+ import { type DependencyList } from "react";
2
+ type UseTimeoutProps = {
3
+ callback: () => void;
4
+ enabled?: boolean;
5
+ delay?: number;
6
+ };
7
+ declare function useTimeout({ callback, enabled, delay }: UseTimeoutProps, deps?: DependencyList): void;
8
+ export default useTimeout;