@spacing-ui/core 0.1.0 → 0.2.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/dist/index.cjs +988 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +150 -6
- package/dist/index.d.ts +150 -6
- package/dist/index.js +983 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { HTMLAttributes,
|
|
2
|
+
import { ReactNode, ButtonHTMLAttributes, HTMLAttributes, ReactElement, Ref } from 'react';
|
|
3
3
|
|
|
4
4
|
type Renderable<S> = ReactNode | ((state: S) => ReactNode);
|
|
5
5
|
interface SelectProps {
|
|
@@ -7,13 +7,13 @@ interface SelectProps {
|
|
|
7
7
|
onValueChange: (value: string) => void;
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
}
|
|
10
|
-
interface TriggerProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
10
|
+
interface TriggerProps$4 extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
11
11
|
children?: Renderable<{
|
|
12
12
|
open: boolean;
|
|
13
13
|
value: string;
|
|
14
14
|
}>;
|
|
15
15
|
}
|
|
16
|
-
interface ContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
16
|
+
interface ContentProps$4 extends HTMLAttributes<HTMLDivElement> {
|
|
17
17
|
children: ReactNode;
|
|
18
18
|
}
|
|
19
19
|
interface OptionProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
@@ -25,9 +25,153 @@ interface OptionProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
|
25
25
|
}>;
|
|
26
26
|
}
|
|
27
27
|
declare const Select: (({ value, onValueChange, children }: SelectProps) => react.JSX.Element) & {
|
|
28
|
-
Trigger: react.ForwardRefExoticComponent<TriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
29
|
-
Content: ({ children, onKeyDown, ...rest }: ContentProps) => react.JSX.Element | null;
|
|
28
|
+
Trigger: react.ForwardRefExoticComponent<TriggerProps$4 & react.RefAttributes<HTMLButtonElement>>;
|
|
29
|
+
Content: ({ children, onKeyDown, ...rest }: ContentProps$4) => react.JSX.Element | null;
|
|
30
30
|
Option: ({ value, textValue, children, onMouseEnter, onClick, ...rest }: OptionProps) => react.JSX.Element;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
interface ProviderProps {
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
delayDuration?: number;
|
|
36
|
+
skipDelayDuration?: number;
|
|
37
|
+
}
|
|
38
|
+
interface RootProps$3 {
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
delayDuration?: number;
|
|
41
|
+
open?: boolean;
|
|
42
|
+
defaultOpen?: boolean;
|
|
43
|
+
onOpenChange?: (open: boolean) => void;
|
|
44
|
+
}
|
|
45
|
+
type SlottableProps = HTMLAttributes<HTMLElement> & {
|
|
46
|
+
ref?: Ref<HTMLElement>;
|
|
47
|
+
"aria-describedby"?: string;
|
|
48
|
+
};
|
|
49
|
+
interface TriggerProps$3 {
|
|
50
|
+
children: ReactElement<SlottableProps>;
|
|
51
|
+
}
|
|
52
|
+
interface ContentProps$3 extends HTMLAttributes<HTMLDivElement> {
|
|
53
|
+
children: ReactNode;
|
|
54
|
+
forceMount?: boolean;
|
|
55
|
+
}
|
|
56
|
+
declare const Tooltip: (({ children, delayDuration, open: controlledOpen, defaultOpen, onOpenChange, }: RootProps$3) => react.JSX.Element) & {
|
|
57
|
+
Provider: ({ children, delayDuration, skipDelayDuration, }: ProviderProps) => react.JSX.Element;
|
|
58
|
+
Trigger: ({ children }: TriggerProps$3) => ReactElement<SlottableProps, string | react.JSXElementConstructor<any>>;
|
|
59
|
+
Content: ({ children, forceMount, id, ...rest }: ContentProps$3) => react.JSX.Element | null;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
interface SwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onChange" | "defaultChecked"> {
|
|
63
|
+
checked?: boolean;
|
|
64
|
+
defaultChecked?: boolean;
|
|
65
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
66
|
+
disabled?: boolean;
|
|
67
|
+
}
|
|
68
|
+
declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLButtonElement>>;
|
|
69
|
+
|
|
70
|
+
type CheckedState = boolean | "indeterminate";
|
|
71
|
+
interface CheckboxProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onChange" | "defaultChecked"> {
|
|
72
|
+
checked?: CheckedState;
|
|
73
|
+
defaultChecked?: CheckedState;
|
|
74
|
+
onCheckedChange?: (checked: CheckedState) => void;
|
|
75
|
+
disabled?: boolean;
|
|
76
|
+
required?: boolean;
|
|
77
|
+
}
|
|
78
|
+
declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLButtonElement>>;
|
|
79
|
+
|
|
80
|
+
interface RadioGroupRootProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
81
|
+
value?: string;
|
|
82
|
+
defaultValue?: string;
|
|
83
|
+
onValueChange?: (value: string) => void;
|
|
84
|
+
name?: string;
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
orientation?: "horizontal" | "vertical";
|
|
87
|
+
}
|
|
88
|
+
interface ItemProps$1 extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value"> {
|
|
89
|
+
value: string;
|
|
90
|
+
disabled?: boolean;
|
|
91
|
+
}
|
|
92
|
+
declare const RadioGroup: react.ForwardRefExoticComponent<RadioGroupRootProps & react.RefAttributes<HTMLDivElement>> & {
|
|
93
|
+
Item: react.ForwardRefExoticComponent<ItemProps$1 & react.RefAttributes<HTMLButtonElement>>;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
type Orientation = "horizontal" | "vertical";
|
|
97
|
+
type ActivationMode = "automatic" | "manual";
|
|
98
|
+
interface RootProps$2 extends HTMLAttributes<HTMLDivElement> {
|
|
99
|
+
value?: string;
|
|
100
|
+
defaultValue?: string;
|
|
101
|
+
onValueChange?: (value: string) => void;
|
|
102
|
+
orientation?: Orientation;
|
|
103
|
+
activationMode?: ActivationMode;
|
|
104
|
+
}
|
|
105
|
+
interface ListProps extends HTMLAttributes<HTMLDivElement> {
|
|
106
|
+
loop?: boolean;
|
|
107
|
+
}
|
|
108
|
+
interface TriggerProps$2 extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
109
|
+
value: string;
|
|
110
|
+
disabled?: boolean;
|
|
111
|
+
}
|
|
112
|
+
interface ContentProps$2 extends HTMLAttributes<HTMLDivElement> {
|
|
113
|
+
value: string;
|
|
114
|
+
forceMount?: boolean;
|
|
115
|
+
}
|
|
116
|
+
declare const Tabs: react.ForwardRefExoticComponent<RootProps$2 & react.RefAttributes<HTMLDivElement>> & {
|
|
117
|
+
List: react.ForwardRefExoticComponent<ListProps & react.RefAttributes<HTMLDivElement>>;
|
|
118
|
+
Trigger: react.ForwardRefExoticComponent<TriggerProps$2 & react.RefAttributes<HTMLButtonElement>>;
|
|
119
|
+
Content: react.ForwardRefExoticComponent<ContentProps$2 & react.RefAttributes<HTMLDivElement>>;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
type RootProps$1 = (HTMLAttributes<HTMLDivElement> & {
|
|
123
|
+
type: "single";
|
|
124
|
+
value?: string;
|
|
125
|
+
defaultValue?: string;
|
|
126
|
+
onValueChange?: (value: string) => void;
|
|
127
|
+
collapsible?: boolean;
|
|
128
|
+
disabled?: boolean;
|
|
129
|
+
}) | (HTMLAttributes<HTMLDivElement> & {
|
|
130
|
+
type: "multiple";
|
|
131
|
+
value?: string[];
|
|
132
|
+
defaultValue?: string[];
|
|
133
|
+
onValueChange?: (value: string[]) => void;
|
|
134
|
+
disabled?: boolean;
|
|
135
|
+
});
|
|
136
|
+
interface ItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
137
|
+
value: string;
|
|
138
|
+
disabled?: boolean;
|
|
139
|
+
}
|
|
140
|
+
type TriggerProps$1 = ButtonHTMLAttributes<HTMLButtonElement>;
|
|
141
|
+
interface ContentProps$1 extends HTMLAttributes<HTMLDivElement> {
|
|
142
|
+
forceMount?: boolean;
|
|
143
|
+
}
|
|
144
|
+
declare const Accordion: react.ForwardRefExoticComponent<RootProps$1 & react.RefAttributes<HTMLDivElement>> & {
|
|
145
|
+
Item: react.ForwardRefExoticComponent<ItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
146
|
+
Trigger: react.ForwardRefExoticComponent<TriggerProps$1 & react.RefAttributes<HTMLButtonElement>>;
|
|
147
|
+
Content: react.ForwardRefExoticComponent<ContentProps$1 & react.RefAttributes<HTMLDivElement>>;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
interface RootProps {
|
|
151
|
+
children: ReactNode;
|
|
152
|
+
open?: boolean;
|
|
153
|
+
defaultOpen?: boolean;
|
|
154
|
+
onOpenChange?: (open: boolean) => void;
|
|
155
|
+
modal?: boolean;
|
|
156
|
+
}
|
|
157
|
+
type TriggerProps = ButtonHTMLAttributes<HTMLButtonElement>;
|
|
158
|
+
interface OverlayProps extends HTMLAttributes<HTMLDivElement> {
|
|
159
|
+
forceMount?: boolean;
|
|
160
|
+
}
|
|
161
|
+
interface ContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
162
|
+
forceMount?: boolean;
|
|
163
|
+
onEscapeKeyDown?: (e: KeyboardEvent) => void;
|
|
164
|
+
}
|
|
165
|
+
type TitleProps = HTMLAttributes<HTMLHeadingElement>;
|
|
166
|
+
type DescriptionProps = HTMLAttributes<HTMLParagraphElement>;
|
|
167
|
+
type CloseProps = ButtonHTMLAttributes<HTMLButtonElement>;
|
|
168
|
+
declare const Dialog: (({ children, open: controlled, defaultOpen, onOpenChange, modal, }: RootProps) => react.JSX.Element) & {
|
|
169
|
+
Trigger: react.ForwardRefExoticComponent<TriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
170
|
+
Overlay: react.ForwardRefExoticComponent<OverlayProps & react.RefAttributes<HTMLDivElement>>;
|
|
171
|
+
Content: react.ForwardRefExoticComponent<ContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
172
|
+
Title: react.ForwardRefExoticComponent<TitleProps & react.RefAttributes<HTMLHeadingElement>>;
|
|
173
|
+
Description: react.ForwardRefExoticComponent<DescriptionProps & react.RefAttributes<HTMLParagraphElement>>;
|
|
174
|
+
Close: react.ForwardRefExoticComponent<CloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export { Accordion, type ContentProps$1 as AccordionContentProps, type ItemProps as AccordionItemProps, type RootProps$1 as AccordionProps, type TriggerProps$1 as AccordionTriggerProps, Checkbox, type CheckboxProps, type CheckedState, Dialog, type CloseProps as DialogCloseProps, type ContentProps as DialogContentProps, type DescriptionProps as DialogDescriptionProps, type OverlayProps as DialogOverlayProps, type RootProps as DialogProps, type TitleProps as DialogTitleProps, type TriggerProps as DialogTriggerProps, RadioGroup, type ItemProps$1 as RadioGroupItemProps, type RadioGroupRootProps as RadioGroupProps, Select, type ContentProps$4 as SelectContentProps, type OptionProps as SelectOptionProps, type SelectProps, type TriggerProps$4 as SelectTriggerProps, Switch, type SwitchProps, Tabs, type ContentProps$2 as TabsContentProps, type ListProps as TabsListProps, type RootProps$2 as TabsProps, type TriggerProps$2 as TabsTriggerProps, Tooltip, type ContentProps$3 as TooltipContentProps, type RootProps$3 as TooltipProps, type ProviderProps as TooltipProviderProps, type TriggerProps$3 as TooltipTriggerProps };
|