@anker-in/headless-ui 0.0.7 → 0.0.9

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/package.json +10 -1
  2. package/dist/esm/src/components/badge.d.ts +0 -9
  3. package/dist/esm/src/components/button.d.ts +0 -20
  4. package/dist/esm/src/components/checkbox.d.ts +0 -4
  5. package/dist/esm/src/components/dialog.d.ts +0 -19
  6. package/dist/esm/src/components/heading.d.ts +0 -7
  7. package/dist/esm/src/components/index.d.ts +0 -11
  8. package/dist/esm/src/components/input.d.ts +0 -21
  9. package/dist/esm/src/components/popover.d.ts +0 -6
  10. package/dist/esm/src/components/radio.d.ts +0 -5
  11. package/dist/esm/src/components/skeleton.d.ts +0 -6
  12. package/dist/esm/src/components/text.d.ts +0 -12
  13. package/dist/esm/src/components/theme.d.ts +0 -13
  14. package/dist/esm/src/helpers/component-props.d.ts +0 -7
  15. package/dist/esm/src/helpers/constants.d.ts +0 -2
  16. package/dist/esm/src/helpers/index.d.ts +0 -1
  17. package/dist/esm/src/helpers/utils.d.ts +0 -2
  18. package/dist/esm/src/icons/spinner.d.ts +0 -7
  19. package/dist/esm/src/index.d.ts +0 -1
  20. package/dist/esm/src/stories/badge.stories.d.ts +0 -26
  21. package/dist/esm/src/stories/button.stories.d.ts +0 -47
  22. package/dist/esm/src/stories/checkbox.stories.d.ts +0 -5
  23. package/dist/esm/src/stories/dialog.stories.d.ts +0 -5
  24. package/dist/esm/src/stories/input.stories.d.ts +0 -30
  25. package/dist/esm/src/stories/popover.stories.d.ts +0 -5
  26. package/dist/esm/src/stories/radio.stories.d.ts +0 -5
  27. package/dist/esm/src/stories/skeleton.stories.d.ts +0 -14
  28. package/dist/esm/src/stories/text.stories.d.ts +0 -16
  29. package/dist/esm/tests/badge.test.d.ts +0 -1
  30. package/dist/esm/tests/button.test.d.ts +0 -1
package/package.json CHANGED
@@ -1,10 +1,19 @@
1
1
  {
2
2
  "name": "@anker-in/headless-ui",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "main": "./dist/esm/index.js",
5
5
  "types": "./dist/esm/index.d.ts",
6
6
  "module": "./dist/esm/index.js",
7
7
  "style": "./style.css",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./dist/esm/index.d.ts",
12
+ "default": "./dist/esm/index.js"
13
+ }
14
+ },
15
+ "./*": "./*"
16
+ },
8
17
  "description": "",
9
18
  "type": "module",
10
19
  "files": [
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
- import { type VariantProps } from 'class-variance-authority';
3
- declare const badgeVariants: (props?: ({
4
- variant?: "default" | "secondary" | "destructive" | "outline" | null | undefined;
5
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
6
- export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
7
- }
8
- declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
9
- export default Badge;
@@ -1,20 +0,0 @@
1
- import * as React from 'react';
2
- import { type VariantProps } from 'class-variance-authority';
3
- /**
4
- * Button Variants
5
- */
6
- declare const buttonVariants: (props?: ({
7
- variant?: "link" | "primary" | "secondary" | "ghost" | null | undefined;
8
- size?: "sm" | "lg" | "base" | "icon" | null | undefined;
9
- hoverEffect?: "none" | "slide" | null | undefined;
10
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
11
- export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
12
- /** 设置按钮载入状态 */
13
- loading?: boolean;
14
- /** 设置按钮失效状态 */
15
- disabled?: boolean;
16
- /** 定义自组件作为父组件的类型, 详细使用方式请参考radix-ui */
17
- asChild?: boolean;
18
- }
19
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
20
- export default Button;
@@ -1,4 +0,0 @@
1
- import * as React from 'react';
2
- import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
3
- declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
4
- export default Checkbox;
@@ -1,19 +0,0 @@
1
- import * as React from 'react';
2
- import * as DialogPrimitive from '@radix-ui/react-dialog';
3
- declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
4
- declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
- declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
6
- declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
7
- declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
- declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
- declare const DialogHeader: {
10
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
11
- displayName: string;
12
- };
13
- declare const DialogFooter: {
14
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
15
- displayName: string;
16
- };
17
- declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
18
- declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
19
- export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface HeadingProps extends React.ComponentPropsWithoutRef<'h1'> {
3
- as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | undefined;
4
- asChild?: boolean;
5
- }
6
- declare const Heading: React.ForwardRefExoticComponent<HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
7
- export { Heading };
@@ -1,11 +0,0 @@
1
- export { default as Button } from './button';
2
- export { default as Badge } from './badge';
3
- export * from './input';
4
- export { default as Checkbox } from './checkbox';
5
- export { default as Skeleton } from './skeleton';
6
- export * from './dialog';
7
- export * from './popover';
8
- export * from './radio';
9
- export * from './dialog';
10
- export * from './text';
11
- export { default as Theme } from './theme';
@@ -1,21 +0,0 @@
1
- import * as React from 'react';
2
- import { ComponentPropsWithout, RemovedProps } from '@/helpers/component-props';
3
- import { type VariantProps } from 'class-variance-authority';
4
- declare const inputVariants: (props?: ({
5
- size?: "sm" | "lg" | "base" | null | undefined;
6
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
7
- export interface InputProps extends ComponentPropsWithout<'input', 'size'>, VariantProps<typeof inputVariants> {
8
- }
9
- interface InputSlotProps extends ComponentPropsWithout<'div', RemovedProps> {
10
- /**
11
- * 插槽的位置
12
- */
13
- side: 'left' | 'right';
14
- }
15
- /**
16
- * InputSlot
17
- * 用来在 Input 组件中插入额外的内容,比如icon ,按钮
18
- */
19
- declare const InputSlot: React.ForwardRefExoticComponent<InputSlotProps & React.RefAttributes<HTMLDivElement>>;
20
- declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
21
- export { Input, InputSlot };
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import * as PopoverPrimitive from '@radix-ui/react-popover';
3
- declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
4
- declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
- declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
6
- export { Popover, PopoverTrigger, PopoverContent };
@@ -1,5 +0,0 @@
1
- import * as React from 'react';
2
- import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
3
- declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
- declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
5
- export { RadioGroup, RadioGroupItem };
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
3
- declare namespace Skeleton {
4
- var displayName: string;
5
- }
6
- export default Skeleton;
@@ -1,12 +0,0 @@
1
- import * as React from 'react';
2
- import { VariantProps } from 'class-variance-authority';
3
- interface TextProps extends React.ComponentPropsWithoutRef<'span'> {
4
- as?: 'div' | 'label' | 'p' | 'span' | undefined;
5
- asChild?: boolean;
6
- color?: string;
7
- }
8
- declare const Text: React.ForwardRefExoticComponent<TextProps & VariantProps<(props?: ({
9
- size?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | null | undefined;
10
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLSpanElement>>;
11
- export { Text };
12
- export type { TextProps };
@@ -1,13 +0,0 @@
1
- import * as React from 'react';
2
- import type { Brand } from '@/helpers/constants';
3
- interface ThemeProps {
4
- brand: Brand;
5
- children: React.ReactNode;
6
- }
7
- /**
8
- *
9
- * @param param
10
- * @returns
11
- */
12
- declare const Theme: ({ brand, children }: ThemeProps) => import("react/jsx-runtime").JSX.Element;
13
- export default Theme;
@@ -1,7 +0,0 @@
1
- import type React from 'react';
2
- type ComponentPropsAs<C extends React.ElementType<any>, T extends React.ComponentPropsWithoutRef<C>['as']> = Omit<Extract<React.ComponentPropsWithoutRef<C>, {
3
- as: T;
4
- }>, 'as' | 'asChild'>;
5
- type ComponentPropsWithout<T extends React.ElementType, O extends Omit<string, keyof React.ComponentPropsWithoutRef<T>> | keyof React.ComponentPropsWithoutRef<T>> = Omit<React.ComponentPropsWithoutRef<T>, O & string>;
6
- type RemovedProps = 'asChild' | 'defaultChecked' | 'defaultValue' | 'color';
7
- export type { ComponentPropsAs, ComponentPropsWithout, RemovedProps };
@@ -1,2 +0,0 @@
1
- export declare const ALL_BRANDS: readonly ["anker", "eufy", "soundcore", "nebula", "ankerWork", "ankerMake"];
2
- export type Brand = (typeof ALL_BRANDS)[number];
@@ -1 +0,0 @@
1
- export { cn } from './utils';
@@ -1,2 +0,0 @@
1
- import { type ClassValue } from 'clsx';
2
- export declare function cn(...inputs: ClassValue[]): string;
@@ -1,7 +0,0 @@
1
- export interface SpinnerProps {
2
- /** loading 图标大小 */
3
- size?: 'sm' | 'md' | 'lg';
4
- color?: string;
5
- }
6
- declare const Spinner: ({ size, color }: SpinnerProps) => import("react/jsx-runtime").JSX.Element;
7
- export default Spinner;
@@ -1 +0,0 @@
1
- export * from './components/index';
@@ -1,26 +0,0 @@
1
- import type { StoryObj } from '@storybook/react';
2
- import { Badge } from '../components/index';
3
- declare const meta: {
4
- title: string;
5
- component: typeof Badge;
6
- parameters: {
7
- layout: string;
8
- };
9
- tags: string[];
10
- argTypes: {
11
- variant: {
12
- control: {
13
- type: "select";
14
- };
15
- options: string[];
16
- };
17
- };
18
- args: {
19
- variant: "default";
20
- children: string;
21
- };
22
- };
23
- export default meta;
24
- type Story = StoryObj<typeof meta>;
25
- export declare const Default: Story;
26
- export declare const Examples: Story;
@@ -1,47 +0,0 @@
1
- import type { StoryObj } from '@storybook/react';
2
- import React from 'react';
3
- declare const meta: {
4
- title: string;
5
- component: React.ForwardRefExoticComponent<import("../components/button").ButtonProps & React.RefAttributes<HTMLButtonElement>>;
6
- parameters: {
7
- layout: string;
8
- };
9
- tags: string[];
10
- argTypes: {
11
- variant: {
12
- control: {
13
- type: "select";
14
- };
15
- options: string[];
16
- };
17
- size: {
18
- control: {
19
- type: "select";
20
- };
21
- options: string[];
22
- };
23
- hoverEffect: {
24
- description: string;
25
- control: {
26
- type: "select";
27
- };
28
- options: string[];
29
- };
30
- };
31
- args: {
32
- variant: "primary";
33
- size: "base";
34
- children: string;
35
- asChild: false;
36
- disabled: false;
37
- loading: false;
38
- hoverEffect: "none";
39
- };
40
- };
41
- export default meta;
42
- type Story = StoryObj<typeof meta>;
43
- export declare const Primary: Story;
44
- export declare const Secondary: Story;
45
- export declare const Link: Story;
46
- export declare const WithIcon: Story;
47
- export declare const Aschild: Story;
@@ -1,5 +0,0 @@
1
- declare const _default: {
2
- title: string;
3
- };
4
- export default _default;
5
- export declare const Default: () => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +0,0 @@
1
- declare const _default: {
2
- title: string;
3
- };
4
- export default _default;
5
- export declare const Default: () => import("react/jsx-runtime").JSX.Element;
@@ -1,30 +0,0 @@
1
- import type { StoryObj } from '@storybook/react';
2
- import type { ComponentType } from 'react';
3
- import React from 'react';
4
- declare const meta: {
5
- title: string;
6
- component: React.ForwardRefExoticComponent<import("../components/input").InputProps & React.RefAttributes<HTMLInputElement>>;
7
- subcomponents: {
8
- InputSlot: ComponentType<unknown>;
9
- };
10
- parameters: {
11
- layout: string;
12
- };
13
- tags: string[];
14
- argTypes: {
15
- size: {
16
- control: {
17
- type: "select";
18
- };
19
- options: string[];
20
- };
21
- };
22
- args: {
23
- size: "base";
24
- };
25
- };
26
- export default meta;
27
- type Story = StoryObj<typeof meta>;
28
- export declare const Default: Story;
29
- export declare const WithButton: Story;
30
- export declare const WithIcon: Story;
@@ -1,5 +0,0 @@
1
- declare const _default: {
2
- title: string;
3
- };
4
- export default _default;
5
- export declare const Default: () => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +0,0 @@
1
- declare const _default: {
2
- title: string;
3
- };
4
- export default _default;
5
- export declare const Default: () => import("react/jsx-runtime").JSX.Element;
@@ -1,14 +0,0 @@
1
- import type { StoryObj } from '@storybook/react';
2
- import { Skeleton } from '../components/index';
3
- declare const meta: {
4
- title: string;
5
- component: typeof Skeleton;
6
- parameters: {
7
- layout: string;
8
- };
9
- tags: string[];
10
- };
11
- export default meta;
12
- type Story = StoryObj<typeof meta>;
13
- export declare const Default: Story;
14
- export declare const Example: Story;
@@ -1,16 +0,0 @@
1
- import type { StoryObj } from '@storybook/react';
2
- import React from 'react';
3
- declare const meta: {
4
- title: string;
5
- component: React.ForwardRefExoticComponent<import("../components/text").TextProps & import("class-variance-authority").VariantProps<(props?: ({
6
- size?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | null | undefined;
7
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLSpanElement>>;
8
- parameters: {
9
- layout: string;
10
- };
11
- tags: string[];
12
- };
13
- export default meta;
14
- type Story = StoryObj<typeof meta>;
15
- export declare const Default: Story;
16
- export declare const All: Story;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};