@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.
Files changed (146) hide show
  1. package/dist/DialogTrigger-woU7vsJi.d.ts +142 -0
  2. package/dist/Input-N8AWWSmt.d.ts +41 -0
  3. package/dist/InputTrailingIcon-ZZx8PoJy.d.ts +20 -0
  4. package/dist/LabelRequiredIndicator-DRnCzHMU.d.ts +19 -0
  5. package/dist/accordion/index.d.ts +73 -0
  6. package/dist/accordion/index.js +325 -0
  7. package/dist/accordion/index.js.map +1 -0
  8. package/dist/alert-dialog/index.d.ts +119 -0
  9. package/dist/alert-dialog/index.js +1554 -0
  10. package/dist/alert-dialog/index.js.map +1 -0
  11. package/dist/avatar/index.d.ts +66 -0
  12. package/dist/avatar/index.js +1303 -0
  13. package/dist/avatar/index.js.map +1 -0
  14. package/dist/badge/index.d.ts +47 -0
  15. package/dist/badge/index.js +122 -0
  16. package/dist/badge/index.js.map +1 -0
  17. package/dist/breadcrumb/index.d.ts +64 -0
  18. package/dist/breadcrumb/index.js +327 -0
  19. package/dist/breadcrumb/index.js.map +1 -0
  20. package/dist/button/index.d.ts +41 -0
  21. package/dist/button/index.js +935 -0
  22. package/dist/button/index.js.map +1 -0
  23. package/dist/card/index.d.ts +61 -0
  24. package/dist/card/index.js +502 -0
  25. package/dist/card/index.js.map +1 -0
  26. package/dist/carousel/index.d.ts +261 -0
  27. package/dist/carousel/index.js +1801 -0
  28. package/dist/carousel/index.js.map +1 -0
  29. package/dist/checkbox/index.d.ts +120 -0
  30. package/dist/checkbox/index.js +511 -0
  31. package/dist/checkbox/index.js.map +1 -0
  32. package/dist/chip/index.d.ts +97 -0
  33. package/dist/chip/index.js +908 -0
  34. package/dist/chip/index.js.map +1 -0
  35. package/dist/collapsible/index.d.ts +43 -0
  36. package/dist/collapsible/index.js +109 -0
  37. package/dist/collapsible/index.js.map +1 -0
  38. package/dist/combobox/index.d.ts +287 -0
  39. package/dist/combobox/index.js +2588 -0
  40. package/dist/combobox/index.js.map +1 -0
  41. package/dist/dialog/index.d.ts +33 -0
  42. package/dist/dialog/index.js +1389 -0
  43. package/dist/dialog/index.js.map +1 -0
  44. package/dist/divider/index.d.ts +61 -0
  45. package/dist/divider/index.js +224 -0
  46. package/dist/divider/index.js.map +1 -0
  47. package/dist/drawer/index.d.ts +152 -0
  48. package/dist/drawer/index.js +1400 -0
  49. package/dist/drawer/index.js.map +1 -0
  50. package/dist/dropdown/index.d.ts +233 -0
  51. package/dist/dropdown/index.js +2051 -0
  52. package/dist/dropdown/index.js.map +1 -0
  53. package/dist/form-field/index.d.ts +186 -0
  54. package/dist/form-field/index.js +553 -0
  55. package/dist/form-field/index.js.map +1 -0
  56. package/dist/icon/index.d.ts +28 -0
  57. package/dist/icon/index.js +127 -0
  58. package/dist/icon/index.js.map +1 -0
  59. package/dist/icon-button/index.d.ts +16 -0
  60. package/dist/icon-button/index.js +980 -0
  61. package/dist/icon-button/index.js.map +1 -0
  62. package/dist/input/index.d.ts +78 -0
  63. package/dist/input/index.js +724 -0
  64. package/dist/input/index.js.map +1 -0
  65. package/dist/kbd/index.d.ts +9 -0
  66. package/dist/kbd/index.js +47 -0
  67. package/dist/kbd/index.js.map +1 -0
  68. package/dist/label/index.d.ts +11 -0
  69. package/dist/label/index.js +78 -0
  70. package/dist/label/index.js.map +1 -0
  71. package/dist/link-box/index.d.ts +34 -0
  72. package/dist/link-box/index.js +92 -0
  73. package/dist/link-box/index.js.map +1 -0
  74. package/dist/pagination/index.d.ts +143 -0
  75. package/dist/pagination/index.js +1353 -0
  76. package/dist/pagination/index.js.map +1 -0
  77. package/dist/popover/index.d.ts +93 -0
  78. package/dist/popover/index.js +1339 -0
  79. package/dist/popover/index.js.map +1 -0
  80. package/dist/portal/index.d.ts +13 -0
  81. package/dist/portal/index.js +37 -0
  82. package/dist/portal/index.js.map +1 -0
  83. package/dist/progress/index.d.ts +48 -0
  84. package/dist/progress/index.js +223 -0
  85. package/dist/progress/index.js.map +1 -0
  86. package/dist/progress-tracker/index.d.ts +80 -0
  87. package/dist/progress-tracker/index.js +571 -0
  88. package/dist/progress-tracker/index.js.map +1 -0
  89. package/dist/radio-group/index.d.ts +100 -0
  90. package/dist/radio-group/index.js +318 -0
  91. package/dist/radio-group/index.js.map +1 -0
  92. package/dist/rating/index.d.ts +78 -0
  93. package/dist/rating/index.js +363 -0
  94. package/dist/rating/index.js.map +1 -0
  95. package/dist/scrolling-list/index.d.ts +118 -0
  96. package/dist/scrolling-list/index.js +1426 -0
  97. package/dist/scrolling-list/index.js.map +1 -0
  98. package/dist/segmented-gauge/index.d.ts +100 -0
  99. package/dist/segmented-gauge/index.js +277 -0
  100. package/dist/segmented-gauge/index.js.map +1 -0
  101. package/dist/select/index.d.ts +167 -0
  102. package/dist/select/index.js +581 -0
  103. package/dist/select/index.js.map +1 -0
  104. package/dist/skeleton/index.d.ts +67 -0
  105. package/dist/skeleton/index.js +206 -0
  106. package/dist/skeleton/index.js.map +1 -0
  107. package/dist/slider/index.d.ts +97 -0
  108. package/dist/slider/index.js +220 -0
  109. package/dist/slider/index.js.map +1 -0
  110. package/dist/slot/index.d.ts +16 -0
  111. package/dist/slot/index.js +51 -0
  112. package/dist/slot/index.js.map +1 -0
  113. package/dist/snackbar/index.d.ts +158 -0
  114. package/dist/snackbar/index.js +1756 -0
  115. package/dist/snackbar/index.js.map +1 -0
  116. package/dist/spinner/index.d.mts +1 -1
  117. package/dist/spinner/index.d.ts +21 -0
  118. package/dist/spinner/index.js +139 -0
  119. package/dist/spinner/index.js.map +1 -0
  120. package/dist/stepper/index.d.ts +81 -0
  121. package/dist/stepper/index.js +1847 -0
  122. package/dist/stepper/index.js.map +1 -0
  123. package/dist/switch/index.d.ts +64 -0
  124. package/dist/switch/index.js +327 -0
  125. package/dist/switch/index.js.map +1 -0
  126. package/dist/tabs/index.d.ts +103 -0
  127. package/dist/tabs/index.js +1376 -0
  128. package/dist/tabs/index.js.map +1 -0
  129. package/dist/tag/index.d.ts +29 -0
  130. package/dist/tag/index.js +283 -0
  131. package/dist/tag/index.js.map +1 -0
  132. package/dist/text-link/index.d.ts +20 -0
  133. package/dist/text-link/index.js +100 -0
  134. package/dist/text-link/index.js.map +1 -0
  135. package/dist/textarea/index.d.ts +57 -0
  136. package/dist/textarea/index.js +797 -0
  137. package/dist/textarea/index.js.map +1 -0
  138. package/dist/toast/index.d.ts +56 -0
  139. package/dist/toast/index.js +1412 -0
  140. package/dist/toast/index.js.map +1 -0
  141. package/dist/toast/index.mjs +1 -1
  142. package/dist/toast/index.mjs.map +1 -1
  143. package/dist/visually-hidden/index.d.ts +16 -0
  144. package/dist/visually-hidden/index.js +67 -0
  145. package/dist/visually-hidden/index.js.map +1 -0
  146. 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 };