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.
Files changed (30) hide show
  1. package/README.md +1 -1
  2. package/dist/components/BottomSheet/bottomsheet-header.d.ts +1 -1
  3. package/dist/components/Button/index.d.ts +1 -1
  4. package/dist/components/Dimmed/index.d.ts +1 -1
  5. package/dist/components/Drawer/drawer-context.d.ts +2 -1
  6. package/dist/components/Drawer/drawer.d.ts +3 -2
  7. package/dist/components/Dropdown/dropdown-header.d.ts +1 -1
  8. package/dist/components/Dropdown/dropdown.d.ts +1 -1
  9. package/dist/components/InfiniteSlider/InfiniteSlider.d.ts +1 -1
  10. package/dist/components/Input/index.d.ts +1 -1
  11. package/dist/components/Modal/modal-body.d.ts +1 -1
  12. package/dist/components/Modal/modal-footer.d.ts +1 -1
  13. package/dist/components/Modal/modal-header.d.ts +1 -1
  14. package/dist/components/Popover/hook/usePopover.d.ts +3 -2
  15. package/dist/components/Popover/popover-context.d.ts +4 -3
  16. package/dist/components/Popover/popover-trigger.d.ts +1 -1
  17. package/dist/components/Popover/popover.d.ts +3 -2
  18. package/dist/components/Radio/radio-group.d.ts +1 -1
  19. package/dist/components/Radio/radio-item.d.ts +1 -1
  20. package/dist/components/Skeleton/index.d.ts +1 -1
  21. package/dist/components/Tab/tab-group.d.ts +2 -1
  22. package/dist/components/Text/index.d.ts +1 -1
  23. package/dist/components/TextArea/index.d.ts +1 -1
  24. package/dist/components/Tooltip/Tooltip.stories.d.ts +16 -0
  25. package/dist/components/Tooltip/index.d.ts +12 -0
  26. package/dist/components/Tooltip/tooltip-style.d.ts +29 -0
  27. package/dist/ownui-system.js.map +1 -1
  28. package/dist/ownui-system.umd.cjs.map +1 -1
  29. package/dist/types/index.d.ts +1 -0
  30. package/package.json +11 -11
package/README.md CHANGED
@@ -108,5 +108,5 @@ export default {
108
108
  - [x] Switch
109
109
  - [x] Radio / RadioGroup
110
110
  - [x] InfiniteSlider
111
- - [ ] Tooltip
111
+ - [x] Tooltip
112
112
  - [ ] Step
@@ -1,3 +1,3 @@
1
- import { ComponentProps } from "react";
1
+ import { type ComponentProps } from "react";
2
2
  declare function BottomSheetHeader({ onPointerDown }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
3
3
  export default BottomSheetHeader;
@@ -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,4 +1,4 @@
1
- import { CSSProperties, PropsWithChildren } from "react";
1
+ import { type CSSProperties, type PropsWithChildren } from "react";
2
2
  interface DimmedProps extends PropsWithChildren {
3
3
  className?: string;
4
4
  opacity?: CSSProperties["opacity"];
@@ -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?: "top" | "bottom" | "left" | "right";
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 { HTMLMotionProps } from "framer-motion";
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?: "top" | "bottom" | "left" | "right";
8
+ placement?: ComponentPosition;
8
9
  zIndex?: number;
9
10
  drawerId?: string;
10
11
  allowCloseOnClickBackDrop?: boolean;
@@ -1,3 +1,3 @@
1
- import { ComponentProps } from "react";
1
+ import { type ComponentProps } from "react";
2
2
  declare function DropdownHeader({ ...rest }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
3
3
  export default DropdownHeader;
@@ -1,4 +1,4 @@
1
- import { PropsWithChildren } from "react";
1
+ import { type PropsWithChildren } from "react";
2
2
  interface DropdownProps extends PropsWithChildren {
3
3
  selectedItem: {
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import { PropsWithChildren } from "react";
1
+ import { type PropsWithChildren } from "react";
2
2
  import "./style.css";
3
3
  type InfiniteSliderProps = {
4
4
  className?: string;
@@ -1,4 +1,4 @@
1
- import { ComponentProps, ReactNode } from "react";
1
+ import { type ComponentProps, type ReactNode } from "react";
2
2
  interface InputProps extends Omit<ComponentProps<"input">, "size"> {
3
3
  left?: ReactNode;
4
4
  right?: ReactNode;
@@ -1,4 +1,4 @@
1
- import { PropsWithChildren } from "react";
1
+ import { type PropsWithChildren } from "react";
2
2
  type ModalBodyProps = {
3
3
  className?: string;
4
4
  } & PropsWithChildren;
@@ -1,4 +1,4 @@
1
- import { PropsWithChildren } from "react";
1
+ import { type PropsWithChildren } from "react";
2
2
  type ModalFooterProps = {
3
3
  className?: string;
4
4
  } & PropsWithChildren;
@@ -1,4 +1,4 @@
1
- import { PropsWithChildren } from "react";
1
+ import { type PropsWithChildren } from "react";
2
2
  type ModalBodyProps = {
3
3
  className?: string;
4
4
  } & PropsWithChildren;
@@ -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?: "top" | "bottom" | "left" | "right";
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: "bottom" | "left" | "right" | "top" | undefined;
15
+ placement: ComponentPosition | undefined;
15
16
  motionVariant: import("framer-motion").Variants | {
16
17
  enter: {
17
18
  opacity: number;
@@ -1,10 +1,11 @@
1
- import { HTMLMotionProps } from "framer-motion";
2
- import { ComponentProps } from "react";
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?: "top" | "bottom" | "left" | "right";
8
+ placement?: ComponentPosition;
8
9
  motionVariant?: HTMLMotionProps<"div">["variants"];
9
10
  zIndex: number;
10
11
  onClose?: () => void;
@@ -1,3 +1,3 @@
1
- import { PropsWithChildren } from "react";
1
+ import { type PropsWithChildren } from "react";
2
2
  declare function PopoverTrigger({ children }: PropsWithChildren): import("react").FunctionComponentElement<any>;
3
3
  export default PopoverTrigger;
@@ -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?: "top" | "bottom" | "left" | "right";
11
+ placement?: ComponentPosition;
11
12
  motionVariant?: HTMLMotionProps<"div">["variants"];
12
13
  onOpenChange: (isOpen: boolean) => void;
13
14
  }
@@ -1,4 +1,4 @@
1
- import { PropsWithChildren } from "react";
1
+ import { type PropsWithChildren } from "react";
2
2
  interface RadioGroupProps extends PropsWithChildren {
3
3
  className?: string;
4
4
  activeColor?: string;
@@ -1,4 +1,4 @@
1
- import { ComponentProps } from "react";
1
+ import { type ComponentProps } from "react";
2
2
  export type RadioItemProps = {
3
3
  name: string;
4
4
  id: string;
@@ -1,4 +1,4 @@
1
- import { CSSProperties, ReactNode } from "react";
1
+ import { type CSSProperties, type ReactNode } from "react";
2
2
  interface SkeletinProps {
3
3
  width: CSSProperties["width"];
4
4
  height: CSSProperties["height"];
@@ -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;
@@ -1,4 +1,4 @@
1
- import { CSSProperties, PropsWithChildren } from "react";
1
+ import { type CSSProperties, type PropsWithChildren } from "react";
2
2
  type TextProps = {
3
3
  fontSize?: CSSProperties["fontSize"];
4
4
  fontWeight?: CSSProperties["fontWeight"];
@@ -1,4 +1,4 @@
1
- import { CSSProperties, ComponentProps } from "react";
1
+ import { type CSSProperties, type ComponentProps } from "react";
2
2
  export interface TextAreaProps extends Omit<ComponentProps<"textarea">, "size"> {
3
3
  label?: React.ReactNode;
4
4
  hasError?: boolean;
@@ -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
+ };