@ldkj/web-ui 0.4.0 → 0.5.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.
- package/components/interact/ghost-button/GhostButton.d.ts +20 -0
- package/components/interact/ghost-button/GhostButtonGroup.d.ts +26 -0
- package/components/interact/ghost-button/index.d.ts +2 -0
- package/index.cjs +7 -7
- package/index.d.ts +1 -0
- package/index.js +1465 -1194
- package/package.json +1 -1
- package/style.css +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CSSProperties, ElementType } from "react";
|
|
2
|
+
import { type ButtonProps } from "../button";
|
|
3
|
+
declare const ghostButtonSizeClasses: {
|
|
4
|
+
readonly xs: "h-8 w-8 text-xs";
|
|
5
|
+
readonly sm: "h-10 w-10 text-sm";
|
|
6
|
+
readonly md: "h-12 w-12 text-base";
|
|
7
|
+
readonly lg: "h-14 w-14 text-lg";
|
|
8
|
+
readonly xl: "h-16 w-16 text-xl";
|
|
9
|
+
};
|
|
10
|
+
type GhostButtonSizePreset = keyof typeof ghostButtonSizeClasses;
|
|
11
|
+
export type GhostButtonSize = GhostButtonSizePreset | number | string;
|
|
12
|
+
type GhostButtonPositionProps = Pick<CSSProperties, "position" | "left" | "top" | "right" | "bottom" | "zIndex">;
|
|
13
|
+
export type GhostButtonProps<T extends ElementType = "button"> = Omit<ButtonProps<T>, "size"> & GhostButtonPositionProps & {
|
|
14
|
+
size?: GhostButtonSize;
|
|
15
|
+
};
|
|
16
|
+
export declare function GhostButton<T extends ElementType = "button">(props: GhostButtonProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare namespace GhostButton {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { CSSProperties, ElementType, ReactElement, ReactNode } from "react";
|
|
3
|
+
import { type GhostButtonProps } from "./GhostButton";
|
|
4
|
+
type GhostButtonGroupTrigger = "click" | "hover";
|
|
5
|
+
type GhostButtonGroupDirection = "up" | "down" | "left" | "right";
|
|
6
|
+
type GhostButtonGroupPositionProps = Pick<CSSProperties, "position" | "left" | "top" | "right" | "bottom" | "zIndex">;
|
|
7
|
+
type GhostButtonGroupItemPositionlessProps<T extends ElementType = "button"> = Omit<GhostButtonProps<T>, keyof GhostButtonGroupPositionProps>;
|
|
8
|
+
export type GhostButtonGroupItemProps<T extends ElementType = "button"> = GhostButtonGroupItemPositionlessProps<T> & {
|
|
9
|
+
itemKey?: React.Key;
|
|
10
|
+
};
|
|
11
|
+
export type GhostButtonGroupItemConfig<T extends ElementType = "button"> = GhostButtonGroupItemProps<T> & {
|
|
12
|
+
key?: React.Key;
|
|
13
|
+
};
|
|
14
|
+
export type GhostButtonGroupProps<T extends ElementType = "button"> = Omit<GhostButtonProps<T>, keyof GhostButtonGroupPositionProps> & GhostButtonGroupPositionProps & {
|
|
15
|
+
trigger?: GhostButtonGroupTrigger | GhostButtonGroupTrigger[];
|
|
16
|
+
direction?: GhostButtonGroupDirection;
|
|
17
|
+
gap?: number | string;
|
|
18
|
+
items?: GhostButtonGroupItemConfig[];
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
};
|
|
21
|
+
type GhostButtonGroupCompound = {
|
|
22
|
+
Item: <T extends ElementType = "button">(props: GhostButtonGroupItemProps<T>) => ReactElement | null;
|
|
23
|
+
};
|
|
24
|
+
type GhostButtonGroupComponent = (<T extends ElementType = "button">(props: GhostButtonGroupProps<T>) => ReactElement | null) & GhostButtonGroupCompound;
|
|
25
|
+
export declare const GhostButtonGroup: GhostButtonGroupComponent;
|
|
26
|
+
export type { GhostButtonGroupTrigger, GhostButtonGroupDirection, GhostButtonGroupPositionProps };
|