@spark-ui/components 11.1.0 → 11.1.2
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/DialogTrigger-woU7vsJi.d.ts +142 -0
- package/dist/Input-N8AWWSmt.d.ts +41 -0
- package/dist/InputTrailingIcon-ZZx8PoJy.d.ts +20 -0
- package/dist/LabelRequiredIndicator-DRnCzHMU.d.ts +19 -0
- package/dist/accordion/index.d.ts +73 -0
- package/dist/accordion/index.js +325 -0
- package/dist/accordion/index.js.map +1 -0
- package/dist/alert-dialog/index.d.ts +119 -0
- package/dist/alert-dialog/index.js +1554 -0
- package/dist/alert-dialog/index.js.map +1 -0
- package/dist/avatar/index.d.ts +66 -0
- package/dist/avatar/index.js +1303 -0
- package/dist/avatar/index.js.map +1 -0
- package/dist/badge/index.d.ts +47 -0
- package/dist/badge/index.js +122 -0
- package/dist/badge/index.js.map +1 -0
- package/dist/breadcrumb/index.d.ts +64 -0
- package/dist/breadcrumb/index.js +327 -0
- package/dist/breadcrumb/index.js.map +1 -0
- package/dist/button/index.d.ts +41 -0
- package/dist/button/index.js +935 -0
- package/dist/button/index.js.map +1 -0
- package/dist/card/index.d.ts +61 -0
- package/dist/card/index.js +502 -0
- package/dist/card/index.js.map +1 -0
- package/dist/carousel/index.d.ts +261 -0
- package/dist/carousel/index.js +1801 -0
- package/dist/carousel/index.js.map +1 -0
- package/dist/checkbox/index.d.ts +120 -0
- package/dist/checkbox/index.js +511 -0
- package/dist/checkbox/index.js.map +1 -0
- package/dist/chip/index.d.ts +97 -0
- package/dist/chip/index.js +908 -0
- package/dist/chip/index.js.map +1 -0
- package/dist/collapsible/index.d.ts +43 -0
- package/dist/collapsible/index.js +109 -0
- package/dist/collapsible/index.js.map +1 -0
- package/dist/combobox/index.d.ts +287 -0
- package/dist/combobox/index.js +2588 -0
- package/dist/combobox/index.js.map +1 -0
- package/dist/dialog/index.d.ts +33 -0
- package/dist/dialog/index.js +1389 -0
- package/dist/dialog/index.js.map +1 -0
- package/dist/divider/index.d.ts +61 -0
- package/dist/divider/index.js +224 -0
- package/dist/divider/index.js.map +1 -0
- package/dist/drawer/index.d.ts +152 -0
- package/dist/drawer/index.js +1400 -0
- package/dist/drawer/index.js.map +1 -0
- package/dist/dropdown/index.d.ts +233 -0
- package/dist/dropdown/index.js +2051 -0
- package/dist/dropdown/index.js.map +1 -0
- package/dist/form-field/index.d.ts +186 -0
- package/dist/form-field/index.js +553 -0
- package/dist/form-field/index.js.map +1 -0
- package/dist/icon/index.d.ts +28 -0
- package/dist/icon/index.js +127 -0
- package/dist/icon/index.js.map +1 -0
- package/dist/icon-button/index.d.ts +16 -0
- package/dist/icon-button/index.js +980 -0
- package/dist/icon-button/index.js.map +1 -0
- package/dist/input/index.d.ts +78 -0
- package/dist/input/index.js +724 -0
- package/dist/input/index.js.map +1 -0
- package/dist/kbd/index.d.ts +9 -0
- package/dist/kbd/index.js +47 -0
- package/dist/kbd/index.js.map +1 -0
- package/dist/label/index.d.ts +11 -0
- package/dist/label/index.js +78 -0
- package/dist/label/index.js.map +1 -0
- package/dist/link-box/index.d.ts +34 -0
- package/dist/link-box/index.js +92 -0
- package/dist/link-box/index.js.map +1 -0
- package/dist/pagination/index.d.ts +143 -0
- package/dist/pagination/index.js +1353 -0
- package/dist/pagination/index.js.map +1 -0
- package/dist/popover/index.d.ts +93 -0
- package/dist/popover/index.js +1339 -0
- package/dist/popover/index.js.map +1 -0
- package/dist/portal/index.d.ts +13 -0
- package/dist/portal/index.js +37 -0
- package/dist/portal/index.js.map +1 -0
- package/dist/progress/index.d.ts +48 -0
- package/dist/progress/index.js +223 -0
- package/dist/progress/index.js.map +1 -0
- package/dist/progress-tracker/index.d.ts +80 -0
- package/dist/progress-tracker/index.js +571 -0
- package/dist/progress-tracker/index.js.map +1 -0
- package/dist/radio-group/index.d.ts +100 -0
- package/dist/radio-group/index.js +318 -0
- package/dist/radio-group/index.js.map +1 -0
- package/dist/rating/index.d.ts +78 -0
- package/dist/rating/index.js +363 -0
- package/dist/rating/index.js.map +1 -0
- package/dist/scrolling-list/index.d.ts +118 -0
- package/dist/scrolling-list/index.js +1426 -0
- package/dist/scrolling-list/index.js.map +1 -0
- package/dist/segmented-gauge/index.d.ts +100 -0
- package/dist/segmented-gauge/index.js +277 -0
- package/dist/segmented-gauge/index.js.map +1 -0
- package/dist/select/index.d.ts +167 -0
- package/dist/select/index.js +581 -0
- package/dist/select/index.js.map +1 -0
- package/dist/skeleton/index.d.ts +67 -0
- package/dist/skeleton/index.js +206 -0
- package/dist/skeleton/index.js.map +1 -0
- package/dist/slider/index.d.ts +97 -0
- package/dist/slider/index.js +220 -0
- package/dist/slider/index.js.map +1 -0
- package/dist/slot/index.d.ts +16 -0
- package/dist/slot/index.js +51 -0
- package/dist/slot/index.js.map +1 -0
- package/dist/snackbar/index.d.ts +158 -0
- package/dist/snackbar/index.js +1756 -0
- package/dist/snackbar/index.js.map +1 -0
- package/dist/spinner/index.d.mts +1 -1
- package/dist/spinner/index.d.ts +21 -0
- package/dist/spinner/index.js +139 -0
- package/dist/spinner/index.js.map +1 -0
- package/dist/stepper/index.d.ts +81 -0
- package/dist/stepper/index.js +1847 -0
- package/dist/stepper/index.js.map +1 -0
- package/dist/switch/index.d.ts +64 -0
- package/dist/switch/index.js +327 -0
- package/dist/switch/index.js.map +1 -0
- package/dist/tabs/index.d.ts +103 -0
- package/dist/tabs/index.js +1376 -0
- package/dist/tabs/index.js.map +1 -0
- package/dist/tag/index.d.ts +29 -0
- package/dist/tag/index.js +283 -0
- package/dist/tag/index.js.map +1 -0
- package/dist/text-link/index.d.ts +20 -0
- package/dist/text-link/index.js +100 -0
- package/dist/text-link/index.js.map +1 -0
- package/dist/textarea/index.d.ts +57 -0
- package/dist/textarea/index.js +797 -0
- package/dist/textarea/index.js.map +1 -0
- package/dist/toast/index.d.ts +56 -0
- package/dist/toast/index.js +1412 -0
- package/dist/toast/index.js.map +1 -0
- package/dist/toast/index.mjs +1 -1
- package/dist/toast/index.mjs.map +1 -1
- package/dist/visually-hidden/index.d.ts +16 -0
- package/dist/visually-hidden/index.js +67 -0
- package/dist/visually-hidden/index.js.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/slot/index.ts
|
|
21
|
+
var slot_exports = {};
|
|
22
|
+
__export(slot_exports, {
|
|
23
|
+
Slot: () => Slot,
|
|
24
|
+
Slottable: () => Slottable,
|
|
25
|
+
wrapPolymorphicSlot: () => wrapPolymorphicSlot
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(slot_exports);
|
|
28
|
+
|
|
29
|
+
// src/slot/Slot.tsx
|
|
30
|
+
var import_radix_ui = require("radix-ui");
|
|
31
|
+
var import_react = require("react");
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
+
var Slottable = import_radix_ui.Slot.Slottable;
|
|
34
|
+
var Slot = ({ ref, ...props }) => {
|
|
35
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Slot.Root, { ref, ...props });
|
|
36
|
+
};
|
|
37
|
+
var wrapPolymorphicSlot = (asChild, children, callback) => {
|
|
38
|
+
if (!asChild) return callback(children);
|
|
39
|
+
return (0, import_react.isValidElement)(children) ? (0, import_react.cloneElement)(
|
|
40
|
+
children,
|
|
41
|
+
void 0,
|
|
42
|
+
callback(children.props.children)
|
|
43
|
+
) : null;
|
|
44
|
+
};
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
Slot,
|
|
48
|
+
Slottable,
|
|
49
|
+
wrapPolymorphicSlot
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/slot/index.ts","../../src/slot/Slot.tsx"],"sourcesContent":["export * from './Slot'\n","import { Slot as RadixSlot } from 'radix-ui'\nimport {\n cloneElement,\n HTMLAttributes,\n isValidElement,\n PropsWithChildren,\n ReactNode,\n Ref,\n} from 'react'\n\nexport const Slottable: typeof RadixSlot.Slottable = RadixSlot.Slottable\n\nexport type SlotProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Slot = ({ ref, ...props }: SlotProps) => {\n return <RadixSlot.Root ref={ref} {...props} />\n}\n\n/**\n * When using Radix `Slot` component, it will consider its first child to merge its props with.\n * In some cases, you might need to wrap the top child with additional markup without breaking this behaviour.\n */\nexport const wrapPolymorphicSlot = (\n asChild: boolean | undefined,\n children: ReactNode,\n callback: (children: ReactNode) => ReactNode\n) => {\n if (!asChild) return callback(children) // If polymorphic behaviour is not used, we keep the original children\n\n return isValidElement(children)\n ? cloneElement(\n children,\n undefined,\n callback((children.props as { children: ReactNode }).children)\n )\n : null\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,sBAAkC;AAClC,mBAOO;AASE;AAPF,IAAM,YAAwC,gBAAAA,KAAU;AAMxD,IAAM,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,MAAiB;AACpD,SAAO,4CAAC,gBAAAA,KAAU,MAAV,EAAe,KAAW,GAAG,OAAO;AAC9C;AAMO,IAAM,sBAAsB,CACjC,SACA,UACA,aACG;AACH,MAAI,CAAC,QAAS,QAAO,SAAS,QAAQ;AAEtC,aAAO,6BAAe,QAAQ,QAC1B;AAAA,IACE;AAAA,IACA;AAAA,IACA,SAAU,SAAS,MAAkC,QAAQ;AAAA,EAC/D,IACA;AACN;","names":["RadixSlot"]}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { QueuedToast, ToastState, ToastOptions } from '@react-stately/toast';
|
|
2
|
+
import { ReactNode, ComponentPropsWithRef, PropsWithChildren, ReactElement, Ref } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
|
+
import { VariantProps } from 'class-variance-authority';
|
|
6
|
+
import { AriaToastRegionProps } from '@react-aria/toast';
|
|
7
|
+
import { ButtonProps } from '../button/index.js';
|
|
8
|
+
import { IconButtonProps } from '../icon-button/index.js';
|
|
9
|
+
import { IconProps } from '../icon/index.js';
|
|
10
|
+
|
|
11
|
+
declare const snackbarItemVariant: (props?: ({
|
|
12
|
+
design?: "filled" | "tinted" | null | undefined;
|
|
13
|
+
intent?: "main" | "success" | "alert" | "error" | "info" | "neutral" | "basic" | "support" | "accent" | "inverse" | null | undefined;
|
|
14
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
|
+
declare const snackbarItemVariantContent: (props?: ({
|
|
16
|
+
actionOnNewline?: boolean | null | undefined;
|
|
17
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
18
|
+
type SnackbarItemVariantProps = VariantProps<typeof snackbarItemVariant>;
|
|
19
|
+
type SnackbarItemVariantContentProps = VariantProps<typeof snackbarItemVariantContent>;
|
|
20
|
+
|
|
21
|
+
interface SnackbarItemValue extends SnackbarItemVariantProps {
|
|
22
|
+
/**
|
|
23
|
+
* Icon that will be prepended before snackbar message
|
|
24
|
+
*/
|
|
25
|
+
icon?: ReactNode;
|
|
26
|
+
message: ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* If `true` snackbar will display a close button
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
isClosable?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* A label for the action button within the toast.
|
|
34
|
+
*/
|
|
35
|
+
actionLabel?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Handler that is called when the action button is pressed.
|
|
38
|
+
*/
|
|
39
|
+
onAction?: () => void;
|
|
40
|
+
/**
|
|
41
|
+
* If `true` the action button will be displayed on a new line.
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
actionOnNewline?: boolean;
|
|
45
|
+
}
|
|
46
|
+
interface SnackbarItemProps extends ComponentPropsWithRef<'div'>, SnackbarItemVariantProps, SnackbarItemVariantContentProps {
|
|
47
|
+
/**
|
|
48
|
+
* Defines a string value that labels the current element.
|
|
49
|
+
*/
|
|
50
|
+
'aria-label'?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Identifies the element (or elements) that labels the current element.
|
|
53
|
+
*/
|
|
54
|
+
'aria-labelledby'?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Identifies the element (or elements) that describes the object.
|
|
57
|
+
*/
|
|
58
|
+
'aria-describedby'?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Identifies the element (or elements) that provide a detailed, extended description for the object.
|
|
61
|
+
*/
|
|
62
|
+
'aria-details'?: string;
|
|
63
|
+
}
|
|
64
|
+
declare const SnackbarItem: {
|
|
65
|
+
({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-details": ariaDetails, design: designProp, intent: intentProp, actionOnNewline: actionOnNewlineProp, className, children, ref: forwardedRef, ...rest }: PropsWithChildren<SnackbarItemProps>): react_jsx_runtime.JSX.Element;
|
|
66
|
+
displayName: string;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
interface SnackbarItemState<T = SnackbarItemValue> {
|
|
70
|
+
toast: QueuedToast<T>;
|
|
71
|
+
state: ToastState<T>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
declare const snackbarRegionVariant: (props?: ({
|
|
75
|
+
position?: "top" | "top-right" | "top-left" | "bottom" | "bottom-right" | "bottom-left" | null | undefined;
|
|
76
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
77
|
+
type SnackbarRegionVariantProps = VariantProps<typeof snackbarRegionVariant>;
|
|
78
|
+
|
|
79
|
+
interface SnackbarRegionProps extends ComponentPropsWithRef<'div'>, AriaToastRegionProps, SnackbarRegionVariantProps, Pick<SnackbarItemState, 'state'> {
|
|
80
|
+
/**
|
|
81
|
+
* An accessibility label for the snackbar region.
|
|
82
|
+
* @default 'Notifications'
|
|
83
|
+
*/
|
|
84
|
+
'aria-label'?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Identifies the element (or elements) that labels the current element.
|
|
87
|
+
*/
|
|
88
|
+
'aria-labelledby'?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Identifies the element (or elements) that describes the object.
|
|
91
|
+
*/
|
|
92
|
+
'aria-describedby'?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Identifies the element (or elements) that provide a detailed, extended description for the object.
|
|
95
|
+
*/
|
|
96
|
+
'aria-details'?: string;
|
|
97
|
+
/**
|
|
98
|
+
* The component/template used to display each snackbar from the queue
|
|
99
|
+
* @default 'Snackbar.Item'
|
|
100
|
+
*/
|
|
101
|
+
children?: ReactElement<SnackbarItemProps, typeof SnackbarItem>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
declare const clearSnackbarQueue: () => void;
|
|
105
|
+
type SnackbarProps = Omit<SnackbarRegionProps, 'state'> & {
|
|
106
|
+
ref?: Ref<HTMLDivElement>;
|
|
107
|
+
};
|
|
108
|
+
declare const Snackbar$1: {
|
|
109
|
+
({ ref: forwardedRef, ...props }: SnackbarProps): ReactElement | null;
|
|
110
|
+
displayName: string;
|
|
111
|
+
};
|
|
112
|
+
interface AddSnackbarArgs extends SnackbarItemValue, Omit<ToastOptions, 'timeout'> {
|
|
113
|
+
/**
|
|
114
|
+
* Handler that is called when the snackbar is closed, either by the user
|
|
115
|
+
* or after a timeout.
|
|
116
|
+
*/
|
|
117
|
+
onClose?: () => void;
|
|
118
|
+
/**
|
|
119
|
+
* A timeout to automatically close the snackbar after, in milliseconds.
|
|
120
|
+
* @default 5000
|
|
121
|
+
*/
|
|
122
|
+
timeout?: number | null;
|
|
123
|
+
/**
|
|
124
|
+
* The priority of the snackbar relative to other snackbars. Larger numbers indicate higher priority.
|
|
125
|
+
*/
|
|
126
|
+
priority?: number;
|
|
127
|
+
}
|
|
128
|
+
declare const addSnackbar: ({ onClose, timeout, priority, ...content }: AddSnackbarArgs) => void;
|
|
129
|
+
|
|
130
|
+
type SnackbarItemActionProps = Omit<ButtonProps, 'size' | 'shape' | 'intent'> & SnackbarItemVariantProps & {
|
|
131
|
+
ref?: Ref<HTMLButtonElement>;
|
|
132
|
+
};
|
|
133
|
+
declare const SnackbarItemAction: {
|
|
134
|
+
({ design: designProp, intent: intentProp, onClick, children, className, ref, ...rest }: SnackbarItemActionProps): react_jsx_runtime.JSX.Element;
|
|
135
|
+
displayName: string;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
interface SnackbarItemCloseProps extends Omit<ComponentPropsWithRef<'button'>, 'aria-label' | 'disabled'>, Pick<IconButtonProps, 'aria-label'>, SnackbarItemVariantProps {
|
|
139
|
+
}
|
|
140
|
+
declare const SnackbarItemClose: {
|
|
141
|
+
({ design: designProp, intent: intentProp, "aria-label": ariaLabel, onClick, className, ref, ...rest }: SnackbarItemCloseProps): react_jsx_runtime.JSX.Element;
|
|
142
|
+
displayName: string;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
type SnackbarItemIconProps = IconProps;
|
|
146
|
+
declare const SnackbarItemIcon: {
|
|
147
|
+
({ children, className, ...rest }: SnackbarItemIconProps): ReactElement;
|
|
148
|
+
displayName: string;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
declare const Snackbar: typeof Snackbar$1 & {
|
|
152
|
+
Item: typeof SnackbarItem;
|
|
153
|
+
ItemAction: typeof SnackbarItemAction;
|
|
154
|
+
ItemClose: typeof SnackbarItemClose;
|
|
155
|
+
ItemIcon: typeof SnackbarItemIcon;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export { type AddSnackbarArgs, Snackbar, type SnackbarItemActionProps, type SnackbarItemCloseProps, type SnackbarItemIconProps, type SnackbarItemProps, type SnackbarProps, addSnackbar, clearSnackbarQueue };
|