@splenddev/kreativ-ui 0.3.21 → 0.3.22
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/Select.types-CIRmqiVe.d.cts +264 -0
- package/dist/Select.types-CIRmqiVe.d.ts +264 -0
- package/dist/{chunk-P63AGDBG.js → chunk-CQUJK47V.js} +5265 -2561
- package/dist/chunk-CQUJK47V.js.map +1 -0
- package/dist/{chunk-C4PCJAAL.js → chunk-D4IXLW5S.js} +34 -3
- package/dist/chunk-D4IXLW5S.js.map +1 -0
- package/dist/{chunk-X7373GJO.js → chunk-HQEFPDPP.js} +421 -46
- package/dist/chunk-HQEFPDPP.js.map +1 -0
- package/dist/{chunk-JCJNV2P2.cjs → chunk-Q73HEANM.cjs} +5292 -2579
- package/dist/chunk-Q73HEANM.cjs.map +1 -0
- package/dist/{chunk-C2JEK4T5.cjs → chunk-TR5LTN5O.cjs} +423 -45
- package/dist/chunk-TR5LTN5O.cjs.map +1 -0
- package/dist/{chunk-5GGCRNXA.cjs → chunk-Z6CDH3CY.cjs} +34 -2
- package/dist/chunk-Z6CDH3CY.cjs.map +1 -0
- package/dist/components.cjs +139 -90
- package/dist/components.d.cts +626 -266
- package/dist/components.d.ts +626 -266
- package/dist/components.js +3 -2
- package/dist/core.cjs +17 -17
- package/dist/core.js +1 -1
- package/dist/index.cjs +12 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +73 -2
- package/dist/index.d.ts +73 -2
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/types.d.cts +4 -28
- package/dist/types.d.ts +4 -28
- package/dist/utils.cjs +39 -35
- package/dist/utils.d.cts +42 -2
- package/dist/utils.d.ts +42 -2
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5GGCRNXA.cjs.map +0 -1
- package/dist/chunk-C2JEK4T5.cjs.map +0 -1
- package/dist/chunk-C4PCJAAL.js.map +0 -1
- package/dist/chunk-JCJNV2P2.cjs.map +0 -1
- package/dist/chunk-P63AGDBG.js.map +0 -1
- package/dist/chunk-X7373GJO.js.map +0 -1
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import * as _splenddev_kreativ_core from '@splenddev/kreativ-core';
|
|
2
|
+
import { Slots, KuiComponent, BaseProps as BaseProps$1, SizeProps as SizeProps$1, ValueProps as ValueProps$1, VariantProps as VariantProps$1, DisabledProps as DisabledProps$1, ClearableProps as ClearableProps$1, StateProps as StateProps$1, Styleable } from '@splenddev/kreativ-core';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ButtonHTMLAttributes, ReactNode, CSSProperties, ReactElement, ComponentPropsWithoutRef, HTMLInputTypeAttribute, HTMLAttributes } from 'react';
|
|
5
|
+
import { BaseProps, ColorProps, BaseColor, VariantProps, BaseVariant, DisabledProps, LoadingProps, FullWidthProps, TypographyProps, SizeValue, SizeProps, ClearableProps, UndoRedoProps, ValueProps, StateProps, TrimProps } from '@splenddev/kreativ-core/types';
|
|
6
|
+
import { Placement } from '@floating-ui/react';
|
|
7
|
+
|
|
8
|
+
declare module "@splenddev/kreativ-core" {
|
|
9
|
+
interface ComponentPropsRegistry {
|
|
10
|
+
Button: ButtonProps;
|
|
11
|
+
Input: InputProps;
|
|
12
|
+
Select: Slots<{
|
|
13
|
+
Root: SelectRootProps;
|
|
14
|
+
Trigger: SelectTriggerProps;
|
|
15
|
+
Content: SelectContentProps;
|
|
16
|
+
Item: SelectItemProps;
|
|
17
|
+
Value: SelectValueProps;
|
|
18
|
+
Group: SelectGroupProps;
|
|
19
|
+
Label: SelectLabelProps;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type SingleFormControlComponent<P extends object = any> = KuiComponent<P, any> & {
|
|
25
|
+
__kui: {
|
|
26
|
+
formControl: "single";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
type ValuePropConvention = "value" | "checked";
|
|
30
|
+
/** Token names that map to `--kui-spacing-<token>`. */
|
|
31
|
+
type SpaceToken = "none" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | (string & {});
|
|
32
|
+
/**
|
|
33
|
+
* - `"sm"` / `"md"` / … → `var(--kui-spacing-sm)`
|
|
34
|
+
* - `24` → `"24px"`
|
|
35
|
+
* - `"24px"` / `"1rem"` → used as-is
|
|
36
|
+
*/
|
|
37
|
+
type SpaceValue = SpaceToken | number | (string & {});
|
|
38
|
+
/** Any color token (`"brand"`, `"surface-raised"`) or raw CSS color. */
|
|
39
|
+
type RadiusValue = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | (string & {});
|
|
40
|
+
interface SuppressKuiWarningProps {
|
|
41
|
+
suppressKuiWarning?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/** Shared feedback status enum (same one Feedback/Toast/TopBar use). */
|
|
44
|
+
type FeedbackStatus = "neutral" | "info" | "success" | "warning" | "error" | "brand";
|
|
45
|
+
interface FeedbackStatusProps {
|
|
46
|
+
status?: FeedbackStatus;
|
|
47
|
+
}
|
|
48
|
+
type OverscrollValue = "auto" | "contain" | "none";
|
|
49
|
+
type AxisOverscroll = OverscrollValue | false;
|
|
50
|
+
type OverscrollBehaviorProp = false | OverscrollValue | {
|
|
51
|
+
x?: AxisOverscroll;
|
|
52
|
+
y?: AxisOverscroll;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
interface MenuRootProps {
|
|
56
|
+
open?: boolean;
|
|
57
|
+
defaultOpen?: boolean;
|
|
58
|
+
onOpenChange?: (open: boolean) => void;
|
|
59
|
+
placement?: Placement;
|
|
60
|
+
offset?: number;
|
|
61
|
+
children?: React.ReactNode;
|
|
62
|
+
role?: "menu" | "listbox";
|
|
63
|
+
selectedIndex?: number | null;
|
|
64
|
+
matchReferenceWidth?: boolean;
|
|
65
|
+
}
|
|
66
|
+
declare function MenuRoot(props: MenuRootProps): React.JSX.Element;
|
|
67
|
+
interface MenuSubProps {
|
|
68
|
+
open?: boolean;
|
|
69
|
+
defaultOpen?: boolean;
|
|
70
|
+
onOpenChange?: (open: boolean) => void;
|
|
71
|
+
children?: React.ReactNode;
|
|
72
|
+
}
|
|
73
|
+
declare function MenuSub({ children, ...opts }: MenuSubProps): React.JSX.Element;
|
|
74
|
+
/** Optional at the consumer level: Content portals itself when no Menu.Portal wraps it. */
|
|
75
|
+
declare function MenuPortal({ children }: {
|
|
76
|
+
children?: React.ReactNode;
|
|
77
|
+
}): React.JSX.Element | null;
|
|
78
|
+
interface MenuTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
79
|
+
asChild?: boolean;
|
|
80
|
+
}
|
|
81
|
+
interface MenuContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
82
|
+
/**
|
|
83
|
+
* Maximum height of the menu.
|
|
84
|
+
* Defaults to the available viewport height.
|
|
85
|
+
*/
|
|
86
|
+
maxHeight?: number | string;
|
|
87
|
+
}
|
|
88
|
+
interface MenuLabelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
89
|
+
}
|
|
90
|
+
interface ItemBaseProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect"> {
|
|
91
|
+
disabled?: boolean;
|
|
92
|
+
/** Typeahead label; derived from `children` when that is a plain string. */
|
|
93
|
+
textValue?: string;
|
|
94
|
+
/** Called on activation. `event.preventDefault()` keeps the menu open. */
|
|
95
|
+
onSelect?: (event: Event) => void;
|
|
96
|
+
}
|
|
97
|
+
interface MenuItemProps extends ItemBaseProps {
|
|
98
|
+
tone?: "default" | "destructive";
|
|
99
|
+
inset?: boolean;
|
|
100
|
+
}
|
|
101
|
+
interface MenuCheckboxItemProps extends ItemBaseProps {
|
|
102
|
+
checked?: boolean;
|
|
103
|
+
defaultChecked?: boolean;
|
|
104
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
105
|
+
}
|
|
106
|
+
interface MenuRadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> {
|
|
107
|
+
value?: string;
|
|
108
|
+
defaultValue?: string;
|
|
109
|
+
onValueChange?: (value: string) => void;
|
|
110
|
+
}
|
|
111
|
+
interface MenuRadioItemProps extends ItemBaseProps {
|
|
112
|
+
value: string;
|
|
113
|
+
}
|
|
114
|
+
interface MenuSubTriggerProps extends Omit<ItemBaseProps, "onSelect"> {
|
|
115
|
+
}
|
|
116
|
+
declare const Menu: {
|
|
117
|
+
Root: typeof MenuRoot;
|
|
118
|
+
Trigger: _splenddev_kreativ_core.KuiComponent<MenuTriggerProps, HTMLButtonElement>;
|
|
119
|
+
Portal: typeof MenuPortal;
|
|
120
|
+
Label: _splenddev_kreativ_core.KuiComponent<MenuLabelProps, HTMLDivElement>;
|
|
121
|
+
Content: _splenddev_kreativ_core.KuiComponent<MenuContentProps, HTMLDivElement>;
|
|
122
|
+
Item: _splenddev_kreativ_core.KuiComponent<MenuItemProps, HTMLButtonElement>;
|
|
123
|
+
CheckboxItem: _splenddev_kreativ_core.KuiComponent<MenuCheckboxItemProps, HTMLButtonElement>;
|
|
124
|
+
RadioGroup: _splenddev_kreativ_core.KuiComponent<MenuRadioGroupProps, HTMLDivElement>;
|
|
125
|
+
RadioItem: _splenddev_kreativ_core.KuiComponent<MenuRadioItemProps, HTMLButtonElement>;
|
|
126
|
+
Separator: _splenddev_kreativ_core.KuiComponent<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
127
|
+
Sub: typeof MenuSub;
|
|
128
|
+
SubTrigger: _splenddev_kreativ_core.KuiComponent<MenuSubTriggerProps, HTMLButtonElement>;
|
|
129
|
+
SubContent: _splenddev_kreativ_core.KuiComponent<MenuContentProps, HTMLDivElement>;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
type ButtonSize = SizeValue | "icon";
|
|
133
|
+
type ButtonVariant = BaseVariant | "link";
|
|
134
|
+
type ButtonColor = BaseColor | "black";
|
|
135
|
+
interface ButtonRenderProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "color"> {
|
|
136
|
+
className?: string;
|
|
137
|
+
style?: CSSProperties;
|
|
138
|
+
disabled?: boolean;
|
|
139
|
+
"aria-disabled"?: boolean;
|
|
140
|
+
"aria-busy"?: boolean;
|
|
141
|
+
"data-kui-responsive"?: string;
|
|
142
|
+
children?: ReactNode;
|
|
143
|
+
}
|
|
144
|
+
interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "color">, BaseProps, ColorProps<ButtonColor>, VariantProps<ButtonVariant>, DisabledProps, LoadingProps, FullWidthProps, TypographyProps {
|
|
145
|
+
size?: ButtonSize;
|
|
146
|
+
leftIcon?: ReactNode;
|
|
147
|
+
rightIcon?: ReactNode;
|
|
148
|
+
iconOnly?: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Text shown when isLoading is `true`
|
|
151
|
+
*/
|
|
152
|
+
loadingText?: ReactNode;
|
|
153
|
+
/**
|
|
154
|
+
* Custom rendering escape hatch.
|
|
155
|
+
*
|
|
156
|
+
* Receives the resolved Button props and allows the consumer
|
|
157
|
+
* to render the Button using another element or component.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```tsx
|
|
161
|
+
* <Button
|
|
162
|
+
* render={(props) => (
|
|
163
|
+
* <a {...props} href="/templates">
|
|
164
|
+
* Templates
|
|
165
|
+
* </a>
|
|
166
|
+
* )}
|
|
167
|
+
* >
|
|
168
|
+
* Templates
|
|
169
|
+
* </Button>
|
|
170
|
+
* ```
|
|
171
|
+
*
|
|
172
|
+
* @remarks
|
|
173
|
+
* The render function must be created inside a Client Component
|
|
174
|
+
* when using Next.js App Router. Functions cannot be passed from
|
|
175
|
+
* Server Components to Client Components.
|
|
176
|
+
*/
|
|
177
|
+
render?: (props: ButtonRenderProps) => ReactElement;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Internal. Not part of the public API — do not re-export from the package index.
|
|
182
|
+
* Callers resolve `type` themselves. This function has no password concept.
|
|
183
|
+
*/
|
|
184
|
+
type BaseInputExtraAdornmentContext = {
|
|
185
|
+
iconSize: string | number;
|
|
186
|
+
/** Motion-gated icon-button classes. Transition styles are omitted when motion is off. */
|
|
187
|
+
iconButtonClass: string;
|
|
188
|
+
};
|
|
189
|
+
type BaseInputProps = Omit<ComponentPropsWithoutRef<"input">, "size" | "type"> & BaseProps & SizeProps & VariantProps<InputVariant> & DisabledProps & LoadingProps & FullWidthProps & ClearableProps & UndoRedoProps & ValueProps<string | number> & StateProps & TrimProps & TypographyProps & {
|
|
190
|
+
type: HTMLInputTypeAttribute;
|
|
191
|
+
inputClassName?: string;
|
|
192
|
+
scrollIntoViewOnError?: boolean;
|
|
193
|
+
startIcon?: ReactNode;
|
|
194
|
+
endIcon?: ReactNode;
|
|
195
|
+
rounded?: boolean;
|
|
196
|
+
motion?: boolean;
|
|
197
|
+
validatePattern?: string | RegExp;
|
|
198
|
+
patternMessage?: string;
|
|
199
|
+
embedded?: boolean;
|
|
200
|
+
extraEndAdornment?: ReactNode | ((ctx: BaseInputExtraAdornmentContext) => ReactNode);
|
|
201
|
+
};
|
|
202
|
+
type InputVariant = "outline" | "filled" | "ghost";
|
|
203
|
+
type InputSize = "2xs" | "xs" | "sm" | "md" | "lg";
|
|
204
|
+
type InputKind = "text" | "email" | "tel" | "url" | "search" | "numeric" | "number" | "date" | "time" | "datetime-local" | "month" | "week";
|
|
205
|
+
type PasswordKind = "password-current" | "password-new";
|
|
206
|
+
type KindDefaultBase = {
|
|
207
|
+
type?: string;
|
|
208
|
+
autoComplete?: string;
|
|
209
|
+
placeholder?: string;
|
|
210
|
+
pattern?: string;
|
|
211
|
+
min?: number;
|
|
212
|
+
max?: number;
|
|
213
|
+
step?: number;
|
|
214
|
+
};
|
|
215
|
+
type InputKindDefaults = Record<InputKind, KindDefaultBase & {
|
|
216
|
+
inputMode?: "none" | "text" | "decimal" | "numeric" | "tel" | "search" | "email" | "url";
|
|
217
|
+
}>;
|
|
218
|
+
type PasswordInputKindDefaults = Record<PasswordKind, KindDefaultBase & {
|
|
219
|
+
inputMode?: "none" | "text";
|
|
220
|
+
}>;
|
|
221
|
+
type InputProps = Omit<BaseInputProps, "type" | "extraEndAdornment" | "motion"> & {
|
|
222
|
+
kind?: InputKind;
|
|
223
|
+
hideKindIcon?: boolean;
|
|
224
|
+
type?: HTMLInputTypeAttribute;
|
|
225
|
+
motion?: boolean;
|
|
226
|
+
};
|
|
227
|
+
type PasswordInputProps = Omit<BaseInputProps, "type" | "extraEndAdornment" | "motion"> & {
|
|
228
|
+
motion?: boolean;
|
|
229
|
+
kind?: PasswordKind;
|
|
230
|
+
visible?: boolean;
|
|
231
|
+
defaultVisible?: boolean;
|
|
232
|
+
onVisibleChange?: (visible: boolean) => void;
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
interface SelectRootProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "children" | "defaultValue">, Omit<BaseProps$1, "children">, SizeProps$1, ValueProps$1<string | undefined>, VariantProps$1<InputVariant>, DisabledProps$1, Omit<ClearableProps$1, "onClear">, Omit<StateProps$1, "warning" | "scrollIntoViewOnError"> {
|
|
236
|
+
rounded?: boolean;
|
|
237
|
+
placeholder?: string;
|
|
238
|
+
required?: boolean;
|
|
239
|
+
name?: string;
|
|
240
|
+
children: ReactNode;
|
|
241
|
+
open?: boolean;
|
|
242
|
+
defaultOpen?: boolean;
|
|
243
|
+
onOpenChange?: (open: boolean) => void;
|
|
244
|
+
}
|
|
245
|
+
interface SelectTriggerProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value" | "className">, Styleable {
|
|
246
|
+
startIcon?: ReactNode;
|
|
247
|
+
}
|
|
248
|
+
interface SelectItemProps extends Omit<ItemBaseProps, "children">, Styleable {
|
|
249
|
+
value: string;
|
|
250
|
+
children: ReactNode;
|
|
251
|
+
}
|
|
252
|
+
interface SelectContentProps extends Omit<HTMLAttributes<HTMLDivElement>, "className">, Styleable {
|
|
253
|
+
maxHeight?: number | string;
|
|
254
|
+
}
|
|
255
|
+
interface SelectValueProps extends Styleable {
|
|
256
|
+
placeholder?: string;
|
|
257
|
+
style?: CSSProperties;
|
|
258
|
+
}
|
|
259
|
+
interface SelectGroupProps extends Styleable, Required<Pick<BaseProps$1, "children">> {
|
|
260
|
+
}
|
|
261
|
+
interface SelectLabelProps extends Styleable, Required<Pick<BaseProps$1, "children">> {
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export { type PasswordKind as A, type ButtonProps as B, type AxisOverscroll as C, type FeedbackStatus as D, type OverscrollValue as E, type FeedbackStatusProps as F, type SpaceToken as G, type InputProps as I, Menu as M, type OverscrollBehaviorProp as O, type PasswordInputKindDefaults as P, type RadiusValue as R, type SpaceValue as S, type ValuePropConvention as V, type ButtonVariant as a, type SingleFormControlComponent as b, type SuppressKuiWarningProps as c, type SelectValueProps as d, type SelectGroupProps as e, type SelectLabelProps as f, type SelectRootProps as g, type SelectTriggerProps as h, type SelectContentProps as i, type SelectItemProps as j, type InputVariant as k, type InputSize as l, type BaseInputProps as m, type BaseInputExtraAdornmentContext as n, type InputKind as o, type InputKindDefaults as p, type MenuCheckboxItemProps as q, type MenuContentProps as r, type MenuItemProps as s, type MenuRadioGroupProps as t, type MenuRadioItemProps as u, type MenuRootProps as v, type MenuSubProps as w, type MenuSubTriggerProps as x, type MenuTriggerProps as y, type PasswordInputProps as z };
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import * as _splenddev_kreativ_core from '@splenddev/kreativ-core';
|
|
2
|
+
import { Slots, KuiComponent, BaseProps as BaseProps$1, SizeProps as SizeProps$1, ValueProps as ValueProps$1, VariantProps as VariantProps$1, DisabledProps as DisabledProps$1, ClearableProps as ClearableProps$1, StateProps as StateProps$1, Styleable } from '@splenddev/kreativ-core';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ButtonHTMLAttributes, ReactNode, CSSProperties, ReactElement, ComponentPropsWithoutRef, HTMLInputTypeAttribute, HTMLAttributes } from 'react';
|
|
5
|
+
import { BaseProps, ColorProps, BaseColor, VariantProps, BaseVariant, DisabledProps, LoadingProps, FullWidthProps, TypographyProps, SizeValue, SizeProps, ClearableProps, UndoRedoProps, ValueProps, StateProps, TrimProps } from '@splenddev/kreativ-core/types';
|
|
6
|
+
import { Placement } from '@floating-ui/react';
|
|
7
|
+
|
|
8
|
+
declare module "@splenddev/kreativ-core" {
|
|
9
|
+
interface ComponentPropsRegistry {
|
|
10
|
+
Button: ButtonProps;
|
|
11
|
+
Input: InputProps;
|
|
12
|
+
Select: Slots<{
|
|
13
|
+
Root: SelectRootProps;
|
|
14
|
+
Trigger: SelectTriggerProps;
|
|
15
|
+
Content: SelectContentProps;
|
|
16
|
+
Item: SelectItemProps;
|
|
17
|
+
Value: SelectValueProps;
|
|
18
|
+
Group: SelectGroupProps;
|
|
19
|
+
Label: SelectLabelProps;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type SingleFormControlComponent<P extends object = any> = KuiComponent<P, any> & {
|
|
25
|
+
__kui: {
|
|
26
|
+
formControl: "single";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
type ValuePropConvention = "value" | "checked";
|
|
30
|
+
/** Token names that map to `--kui-spacing-<token>`. */
|
|
31
|
+
type SpaceToken = "none" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | (string & {});
|
|
32
|
+
/**
|
|
33
|
+
* - `"sm"` / `"md"` / … → `var(--kui-spacing-sm)`
|
|
34
|
+
* - `24` → `"24px"`
|
|
35
|
+
* - `"24px"` / `"1rem"` → used as-is
|
|
36
|
+
*/
|
|
37
|
+
type SpaceValue = SpaceToken | number | (string & {});
|
|
38
|
+
/** Any color token (`"brand"`, `"surface-raised"`) or raw CSS color. */
|
|
39
|
+
type RadiusValue = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | (string & {});
|
|
40
|
+
interface SuppressKuiWarningProps {
|
|
41
|
+
suppressKuiWarning?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/** Shared feedback status enum (same one Feedback/Toast/TopBar use). */
|
|
44
|
+
type FeedbackStatus = "neutral" | "info" | "success" | "warning" | "error" | "brand";
|
|
45
|
+
interface FeedbackStatusProps {
|
|
46
|
+
status?: FeedbackStatus;
|
|
47
|
+
}
|
|
48
|
+
type OverscrollValue = "auto" | "contain" | "none";
|
|
49
|
+
type AxisOverscroll = OverscrollValue | false;
|
|
50
|
+
type OverscrollBehaviorProp = false | OverscrollValue | {
|
|
51
|
+
x?: AxisOverscroll;
|
|
52
|
+
y?: AxisOverscroll;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
interface MenuRootProps {
|
|
56
|
+
open?: boolean;
|
|
57
|
+
defaultOpen?: boolean;
|
|
58
|
+
onOpenChange?: (open: boolean) => void;
|
|
59
|
+
placement?: Placement;
|
|
60
|
+
offset?: number;
|
|
61
|
+
children?: React.ReactNode;
|
|
62
|
+
role?: "menu" | "listbox";
|
|
63
|
+
selectedIndex?: number | null;
|
|
64
|
+
matchReferenceWidth?: boolean;
|
|
65
|
+
}
|
|
66
|
+
declare function MenuRoot(props: MenuRootProps): React.JSX.Element;
|
|
67
|
+
interface MenuSubProps {
|
|
68
|
+
open?: boolean;
|
|
69
|
+
defaultOpen?: boolean;
|
|
70
|
+
onOpenChange?: (open: boolean) => void;
|
|
71
|
+
children?: React.ReactNode;
|
|
72
|
+
}
|
|
73
|
+
declare function MenuSub({ children, ...opts }: MenuSubProps): React.JSX.Element;
|
|
74
|
+
/** Optional at the consumer level: Content portals itself when no Menu.Portal wraps it. */
|
|
75
|
+
declare function MenuPortal({ children }: {
|
|
76
|
+
children?: React.ReactNode;
|
|
77
|
+
}): React.JSX.Element | null;
|
|
78
|
+
interface MenuTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
79
|
+
asChild?: boolean;
|
|
80
|
+
}
|
|
81
|
+
interface MenuContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
82
|
+
/**
|
|
83
|
+
* Maximum height of the menu.
|
|
84
|
+
* Defaults to the available viewport height.
|
|
85
|
+
*/
|
|
86
|
+
maxHeight?: number | string;
|
|
87
|
+
}
|
|
88
|
+
interface MenuLabelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
89
|
+
}
|
|
90
|
+
interface ItemBaseProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect"> {
|
|
91
|
+
disabled?: boolean;
|
|
92
|
+
/** Typeahead label; derived from `children` when that is a plain string. */
|
|
93
|
+
textValue?: string;
|
|
94
|
+
/** Called on activation. `event.preventDefault()` keeps the menu open. */
|
|
95
|
+
onSelect?: (event: Event) => void;
|
|
96
|
+
}
|
|
97
|
+
interface MenuItemProps extends ItemBaseProps {
|
|
98
|
+
tone?: "default" | "destructive";
|
|
99
|
+
inset?: boolean;
|
|
100
|
+
}
|
|
101
|
+
interface MenuCheckboxItemProps extends ItemBaseProps {
|
|
102
|
+
checked?: boolean;
|
|
103
|
+
defaultChecked?: boolean;
|
|
104
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
105
|
+
}
|
|
106
|
+
interface MenuRadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> {
|
|
107
|
+
value?: string;
|
|
108
|
+
defaultValue?: string;
|
|
109
|
+
onValueChange?: (value: string) => void;
|
|
110
|
+
}
|
|
111
|
+
interface MenuRadioItemProps extends ItemBaseProps {
|
|
112
|
+
value: string;
|
|
113
|
+
}
|
|
114
|
+
interface MenuSubTriggerProps extends Omit<ItemBaseProps, "onSelect"> {
|
|
115
|
+
}
|
|
116
|
+
declare const Menu: {
|
|
117
|
+
Root: typeof MenuRoot;
|
|
118
|
+
Trigger: _splenddev_kreativ_core.KuiComponent<MenuTriggerProps, HTMLButtonElement>;
|
|
119
|
+
Portal: typeof MenuPortal;
|
|
120
|
+
Label: _splenddev_kreativ_core.KuiComponent<MenuLabelProps, HTMLDivElement>;
|
|
121
|
+
Content: _splenddev_kreativ_core.KuiComponent<MenuContentProps, HTMLDivElement>;
|
|
122
|
+
Item: _splenddev_kreativ_core.KuiComponent<MenuItemProps, HTMLButtonElement>;
|
|
123
|
+
CheckboxItem: _splenddev_kreativ_core.KuiComponent<MenuCheckboxItemProps, HTMLButtonElement>;
|
|
124
|
+
RadioGroup: _splenddev_kreativ_core.KuiComponent<MenuRadioGroupProps, HTMLDivElement>;
|
|
125
|
+
RadioItem: _splenddev_kreativ_core.KuiComponent<MenuRadioItemProps, HTMLButtonElement>;
|
|
126
|
+
Separator: _splenddev_kreativ_core.KuiComponent<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
127
|
+
Sub: typeof MenuSub;
|
|
128
|
+
SubTrigger: _splenddev_kreativ_core.KuiComponent<MenuSubTriggerProps, HTMLButtonElement>;
|
|
129
|
+
SubContent: _splenddev_kreativ_core.KuiComponent<MenuContentProps, HTMLDivElement>;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
type ButtonSize = SizeValue | "icon";
|
|
133
|
+
type ButtonVariant = BaseVariant | "link";
|
|
134
|
+
type ButtonColor = BaseColor | "black";
|
|
135
|
+
interface ButtonRenderProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "color"> {
|
|
136
|
+
className?: string;
|
|
137
|
+
style?: CSSProperties;
|
|
138
|
+
disabled?: boolean;
|
|
139
|
+
"aria-disabled"?: boolean;
|
|
140
|
+
"aria-busy"?: boolean;
|
|
141
|
+
"data-kui-responsive"?: string;
|
|
142
|
+
children?: ReactNode;
|
|
143
|
+
}
|
|
144
|
+
interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "color">, BaseProps, ColorProps<ButtonColor>, VariantProps<ButtonVariant>, DisabledProps, LoadingProps, FullWidthProps, TypographyProps {
|
|
145
|
+
size?: ButtonSize;
|
|
146
|
+
leftIcon?: ReactNode;
|
|
147
|
+
rightIcon?: ReactNode;
|
|
148
|
+
iconOnly?: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Text shown when isLoading is `true`
|
|
151
|
+
*/
|
|
152
|
+
loadingText?: ReactNode;
|
|
153
|
+
/**
|
|
154
|
+
* Custom rendering escape hatch.
|
|
155
|
+
*
|
|
156
|
+
* Receives the resolved Button props and allows the consumer
|
|
157
|
+
* to render the Button using another element or component.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```tsx
|
|
161
|
+
* <Button
|
|
162
|
+
* render={(props) => (
|
|
163
|
+
* <a {...props} href="/templates">
|
|
164
|
+
* Templates
|
|
165
|
+
* </a>
|
|
166
|
+
* )}
|
|
167
|
+
* >
|
|
168
|
+
* Templates
|
|
169
|
+
* </Button>
|
|
170
|
+
* ```
|
|
171
|
+
*
|
|
172
|
+
* @remarks
|
|
173
|
+
* The render function must be created inside a Client Component
|
|
174
|
+
* when using Next.js App Router. Functions cannot be passed from
|
|
175
|
+
* Server Components to Client Components.
|
|
176
|
+
*/
|
|
177
|
+
render?: (props: ButtonRenderProps) => ReactElement;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Internal. Not part of the public API — do not re-export from the package index.
|
|
182
|
+
* Callers resolve `type` themselves. This function has no password concept.
|
|
183
|
+
*/
|
|
184
|
+
type BaseInputExtraAdornmentContext = {
|
|
185
|
+
iconSize: string | number;
|
|
186
|
+
/** Motion-gated icon-button classes. Transition styles are omitted when motion is off. */
|
|
187
|
+
iconButtonClass: string;
|
|
188
|
+
};
|
|
189
|
+
type BaseInputProps = Omit<ComponentPropsWithoutRef<"input">, "size" | "type"> & BaseProps & SizeProps & VariantProps<InputVariant> & DisabledProps & LoadingProps & FullWidthProps & ClearableProps & UndoRedoProps & ValueProps<string | number> & StateProps & TrimProps & TypographyProps & {
|
|
190
|
+
type: HTMLInputTypeAttribute;
|
|
191
|
+
inputClassName?: string;
|
|
192
|
+
scrollIntoViewOnError?: boolean;
|
|
193
|
+
startIcon?: ReactNode;
|
|
194
|
+
endIcon?: ReactNode;
|
|
195
|
+
rounded?: boolean;
|
|
196
|
+
motion?: boolean;
|
|
197
|
+
validatePattern?: string | RegExp;
|
|
198
|
+
patternMessage?: string;
|
|
199
|
+
embedded?: boolean;
|
|
200
|
+
extraEndAdornment?: ReactNode | ((ctx: BaseInputExtraAdornmentContext) => ReactNode);
|
|
201
|
+
};
|
|
202
|
+
type InputVariant = "outline" | "filled" | "ghost";
|
|
203
|
+
type InputSize = "2xs" | "xs" | "sm" | "md" | "lg";
|
|
204
|
+
type InputKind = "text" | "email" | "tel" | "url" | "search" | "numeric" | "number" | "date" | "time" | "datetime-local" | "month" | "week";
|
|
205
|
+
type PasswordKind = "password-current" | "password-new";
|
|
206
|
+
type KindDefaultBase = {
|
|
207
|
+
type?: string;
|
|
208
|
+
autoComplete?: string;
|
|
209
|
+
placeholder?: string;
|
|
210
|
+
pattern?: string;
|
|
211
|
+
min?: number;
|
|
212
|
+
max?: number;
|
|
213
|
+
step?: number;
|
|
214
|
+
};
|
|
215
|
+
type InputKindDefaults = Record<InputKind, KindDefaultBase & {
|
|
216
|
+
inputMode?: "none" | "text" | "decimal" | "numeric" | "tel" | "search" | "email" | "url";
|
|
217
|
+
}>;
|
|
218
|
+
type PasswordInputKindDefaults = Record<PasswordKind, KindDefaultBase & {
|
|
219
|
+
inputMode?: "none" | "text";
|
|
220
|
+
}>;
|
|
221
|
+
type InputProps = Omit<BaseInputProps, "type" | "extraEndAdornment" | "motion"> & {
|
|
222
|
+
kind?: InputKind;
|
|
223
|
+
hideKindIcon?: boolean;
|
|
224
|
+
type?: HTMLInputTypeAttribute;
|
|
225
|
+
motion?: boolean;
|
|
226
|
+
};
|
|
227
|
+
type PasswordInputProps = Omit<BaseInputProps, "type" | "extraEndAdornment" | "motion"> & {
|
|
228
|
+
motion?: boolean;
|
|
229
|
+
kind?: PasswordKind;
|
|
230
|
+
visible?: boolean;
|
|
231
|
+
defaultVisible?: boolean;
|
|
232
|
+
onVisibleChange?: (visible: boolean) => void;
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
interface SelectRootProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "children" | "defaultValue">, Omit<BaseProps$1, "children">, SizeProps$1, ValueProps$1<string | undefined>, VariantProps$1<InputVariant>, DisabledProps$1, Omit<ClearableProps$1, "onClear">, Omit<StateProps$1, "warning" | "scrollIntoViewOnError"> {
|
|
236
|
+
rounded?: boolean;
|
|
237
|
+
placeholder?: string;
|
|
238
|
+
required?: boolean;
|
|
239
|
+
name?: string;
|
|
240
|
+
children: ReactNode;
|
|
241
|
+
open?: boolean;
|
|
242
|
+
defaultOpen?: boolean;
|
|
243
|
+
onOpenChange?: (open: boolean) => void;
|
|
244
|
+
}
|
|
245
|
+
interface SelectTriggerProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value" | "className">, Styleable {
|
|
246
|
+
startIcon?: ReactNode;
|
|
247
|
+
}
|
|
248
|
+
interface SelectItemProps extends Omit<ItemBaseProps, "children">, Styleable {
|
|
249
|
+
value: string;
|
|
250
|
+
children: ReactNode;
|
|
251
|
+
}
|
|
252
|
+
interface SelectContentProps extends Omit<HTMLAttributes<HTMLDivElement>, "className">, Styleable {
|
|
253
|
+
maxHeight?: number | string;
|
|
254
|
+
}
|
|
255
|
+
interface SelectValueProps extends Styleable {
|
|
256
|
+
placeholder?: string;
|
|
257
|
+
style?: CSSProperties;
|
|
258
|
+
}
|
|
259
|
+
interface SelectGroupProps extends Styleable, Required<Pick<BaseProps$1, "children">> {
|
|
260
|
+
}
|
|
261
|
+
interface SelectLabelProps extends Styleable, Required<Pick<BaseProps$1, "children">> {
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export { type PasswordKind as A, type ButtonProps as B, type AxisOverscroll as C, type FeedbackStatus as D, type OverscrollValue as E, type FeedbackStatusProps as F, type SpaceToken as G, type InputProps as I, Menu as M, type OverscrollBehaviorProp as O, type PasswordInputKindDefaults as P, type RadiusValue as R, type SpaceValue as S, type ValuePropConvention as V, type ButtonVariant as a, type SingleFormControlComponent as b, type SuppressKuiWarningProps as c, type SelectValueProps as d, type SelectGroupProps as e, type SelectLabelProps as f, type SelectRootProps as g, type SelectTriggerProps as h, type SelectContentProps as i, type SelectItemProps as j, type InputVariant as k, type InputSize as l, type BaseInputProps as m, type BaseInputExtraAdornmentContext as n, type InputKind as o, type InputKindDefaults as p, type MenuCheckboxItemProps as q, type MenuContentProps as r, type MenuItemProps as s, type MenuRadioGroupProps as t, type MenuRadioItemProps as u, type MenuRootProps as v, type MenuSubProps as w, type MenuSubTriggerProps as x, type MenuTriggerProps as y, type PasswordInputProps as z };
|