ownui-system 0.0.13 → 0.1.1
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/README.md +1 -1
- package/dist/components/BottomSheet/bottomsheet-header.d.ts +1 -1
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Dimmed/index.d.ts +1 -1
- package/dist/components/Drawer/drawer-context.d.ts +2 -1
- package/dist/components/Drawer/drawer.d.ts +3 -2
- package/dist/components/Dropdown/dropdown-header.d.ts +1 -1
- package/dist/components/Dropdown/dropdown.d.ts +1 -1
- package/dist/components/InfiniteSlider/InfiniteSlider.d.ts +1 -1
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Modal/modal-body.d.ts +1 -1
- package/dist/components/Modal/modal-footer.d.ts +1 -1
- package/dist/components/Modal/modal-header.d.ts +1 -1
- package/dist/components/Popover/hook/usePopover.d.ts +3 -2
- package/dist/components/Popover/popover-context.d.ts +4 -3
- package/dist/components/Popover/popover-trigger.d.ts +1 -1
- package/dist/components/Popover/popover.d.ts +3 -2
- package/dist/components/Radio/radio-group.d.ts +1 -1
- package/dist/components/Radio/radio-item.d.ts +1 -1
- package/dist/components/Skeleton/index.d.ts +1 -1
- package/dist/components/Tab/tab-group.d.ts +2 -1
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/TextArea/index.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.stories.d.ts +16 -0
- package/dist/components/Tooltip/index.d.ts +12 -0
- package/dist/components/Tooltip/tooltip-style.d.ts +29 -0
- package/dist/ownui-system.js.map +1 -1
- package/dist/ownui-system.umd.cjs.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentProps, ReactNode } from "react";
|
|
1
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
2
2
|
export interface ButtonProps extends ComponentProps<"button"> {
|
|
3
3
|
size?: "xsmall" | "small" | "medium" | "large" | "xlarge";
|
|
4
4
|
variant?: "normal" | "line" | "text";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { ComponentPosition } from '../../types';
|
|
1
2
|
import { HTMLMotionProps } from "framer-motion";
|
|
2
3
|
import { ComponentProps } from "react";
|
|
3
4
|
import Drawer from "./drawer";
|
|
4
5
|
type DrawerProps = ComponentProps<typeof Drawer>;
|
|
5
6
|
type DrawerContextValue = {
|
|
6
7
|
isOpen: DrawerProps["isOpen"];
|
|
7
|
-
placement?:
|
|
8
|
+
placement?: ComponentPosition;
|
|
8
9
|
motionVariant?: HTMLMotionProps<"div">["variants"];
|
|
9
10
|
zIndex?: number;
|
|
10
11
|
drawerId: string;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import type { ComponentPosition } from '../../types';
|
|
3
|
+
import { type HTMLMotionProps } from "framer-motion";
|
|
3
4
|
export type DrawerProps = {
|
|
4
5
|
onOpenChange: (isOpen: boolean) => void;
|
|
5
6
|
isOpen: boolean;
|
|
6
7
|
children?: React.ReactNode;
|
|
7
|
-
placement?:
|
|
8
|
+
placement?: ComponentPosition;
|
|
8
9
|
zIndex?: number;
|
|
9
10
|
drawerId?: string;
|
|
10
11
|
allowCloseOnClickBackDrop?: boolean;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type { ComponentPosition } from '../../../types';
|
|
1
2
|
import { HTMLMotionProps } from "framer-motion";
|
|
2
3
|
type UsePopoverProps = {
|
|
3
4
|
isOpen: boolean;
|
|
4
5
|
zIndex: number;
|
|
5
6
|
className?: string;
|
|
6
|
-
placement?:
|
|
7
|
+
placement?: ComponentPosition;
|
|
7
8
|
motionVariant?: HTMLMotionProps<"div">["variants"];
|
|
8
9
|
onOpenChange: (isOpen: boolean) => void;
|
|
9
10
|
onOpen?: () => void;
|
|
@@ -11,7 +12,7 @@ type UsePopoverProps = {
|
|
|
11
12
|
};
|
|
12
13
|
declare function usePopover({ isOpen, zIndex, placement, motionVariant, onOpen, onClose, onOpenChange, }: UsePopoverProps): {
|
|
13
14
|
isOpen: boolean;
|
|
14
|
-
placement:
|
|
15
|
+
placement: ComponentPosition | undefined;
|
|
15
16
|
motionVariant: import("framer-motion").Variants | {
|
|
16
17
|
enter: {
|
|
17
18
|
opacity: number;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ComponentPosition } from '../../types';
|
|
2
|
+
import { type HTMLMotionProps } from "framer-motion";
|
|
3
|
+
import { type ComponentProps } from "react";
|
|
3
4
|
import Popover from "./popover";
|
|
4
5
|
type PopoverProps = ComponentProps<typeof Popover>;
|
|
5
6
|
type PopoverPropsContextValue = {
|
|
6
7
|
isOpen: PopoverProps["isOpen"];
|
|
7
|
-
placement?:
|
|
8
|
+
placement?: ComponentPosition;
|
|
8
9
|
motionVariant?: HTMLMotionProps<"div">["variants"];
|
|
9
10
|
zIndex: number;
|
|
10
11
|
onClose?: () => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { ComponentPosition } from '../../types';
|
|
1
2
|
import { HTMLMotionProps } from "framer-motion";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
+
import { type ReactNode } from "react";
|
|
3
4
|
export interface PopoverProps {
|
|
4
5
|
id?: string;
|
|
5
6
|
children: ReactNode[];
|
|
@@ -7,7 +8,7 @@ export interface PopoverProps {
|
|
|
7
8
|
zIndex?: number;
|
|
8
9
|
topOffset?: number;
|
|
9
10
|
leftOffset?: number;
|
|
10
|
-
placement?:
|
|
11
|
+
placement?: ComponentPosition;
|
|
11
12
|
motionVariant?: HTMLMotionProps<"div">["variants"];
|
|
12
13
|
onOpenChange: (isOpen: boolean) => void;
|
|
13
14
|
}
|
|
@@ -4,6 +4,7 @@ interface TabGroupProps {
|
|
|
4
4
|
size?: "large" | "medium" | "small";
|
|
5
5
|
activeColor?: string;
|
|
6
6
|
children: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
7
8
|
}
|
|
8
|
-
declare function TabGroup({ children, size, type, activeColor, }: TabGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function TabGroup({ children, className, size, type, activeColor, }: TabGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export default TabGroup;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react";
|
|
2
|
+
import Tooltip from ".";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Tooltip;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Top: Story;
|
|
14
|
+
export declare const Bottom: Story;
|
|
15
|
+
export declare const Left: Story;
|
|
16
|
+
export declare const Right: Story;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ComponentPosition } from '../../types';
|
|
2
|
+
import { type CSSProperties, type PropsWithChildren } from "react";
|
|
3
|
+
type TooltipProps = {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
message: string;
|
|
6
|
+
placement?: ComponentPosition;
|
|
7
|
+
className?: string;
|
|
8
|
+
tailOffset?: string;
|
|
9
|
+
bgColor?: CSSProperties["backgroundColor"];
|
|
10
|
+
} & PropsWithChildren;
|
|
11
|
+
declare function Tooltip({ children, className, open, message, placement, tailOffset, bgColor, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default Tooltip;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const baseStyle = "relative inline-block text-center";
|
|
2
|
+
export declare const afterStyle = "after:absolute after:content-[''] after:block after:text-[var(--text-color)] after:border after:w-0 after:h-0 after:opacity-0 after:transition-all after:delay-100";
|
|
3
|
+
export declare const beforeStyle = "before:absolute before:pointer-events-none before:z-[1] before:content-[attr(data-tip)] before:rounded-md before:px-1 before:py-2 before:bg-[var(--bg-color)] before:max-w-80 before:w-max before:whitespace-normal before:opacity-0 before:transition-all before:delay-100 ";
|
|
4
|
+
export declare const hoverStyle: {
|
|
5
|
+
before: string;
|
|
6
|
+
after: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const openStyle: {
|
|
9
|
+
before: string;
|
|
10
|
+
after: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const positionStyle: {
|
|
13
|
+
top: {
|
|
14
|
+
after: string;
|
|
15
|
+
before: string;
|
|
16
|
+
};
|
|
17
|
+
bottom: {
|
|
18
|
+
after: string;
|
|
19
|
+
before: string;
|
|
20
|
+
};
|
|
21
|
+
left: {
|
|
22
|
+
after: string;
|
|
23
|
+
before: string;
|
|
24
|
+
};
|
|
25
|
+
right: {
|
|
26
|
+
after: string;
|
|
27
|
+
before: string;
|
|
28
|
+
};
|
|
29
|
+
};
|