@spark-ui/components 11.5.0 → 11.5.1

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 (36) hide show
  1. package/dist/alert-dialog/index.mjs +4 -4
  2. package/dist/avatar/index.d.mts +2 -2
  3. package/dist/avatar/index.d.ts +2 -2
  4. package/dist/avatar/index.mjs +3 -3
  5. package/dist/button/index.mjs +1 -1
  6. package/dist/carousel/index.mjs +3 -3
  7. package/dist/{chunk-HEKSVWYW.mjs → chunk-2YM6GKWW.mjs} +2 -1
  8. package/dist/{chunk-XYK6V3JF.mjs → chunk-DCXWGQVZ.mjs} +2 -2
  9. package/dist/{chunk-D7YBYT5H.mjs → chunk-GPJMLIHC.mjs} +2 -2
  10. package/dist/{chunk-2BSBKLHG.mjs → chunk-WLI4EPS6.mjs} +2 -2
  11. package/dist/combobox/index.mjs +6 -6
  12. package/dist/dialog/index.mjs +4 -4
  13. package/dist/docgen.json +13 -2
  14. package/dist/drawer/index.mjs +3 -3
  15. package/dist/dropdown/index.mjs +4 -4
  16. package/dist/file-upload/index.d.mts +1 -1
  17. package/dist/file-upload/index.d.ts +1 -1
  18. package/dist/file-upload/index.js +52 -24
  19. package/dist/file-upload/index.js.map +1 -1
  20. package/dist/file-upload/index.mjs +59 -30
  21. package/dist/file-upload/index.mjs.map +1 -1
  22. package/dist/icon-button/index.mjs +2 -2
  23. package/dist/pagination/index.mjs +5 -5
  24. package/dist/popover/index.mjs +4 -4
  25. package/dist/scrolling-list/index.mjs +5 -5
  26. package/dist/snackbar/index.mjs +5 -5
  27. package/dist/stepper/index.mjs +3 -3
  28. package/dist/tabs/index.mjs +4 -4
  29. package/dist/toast/index.d.mts +6 -6
  30. package/dist/toast/index.d.ts +6 -6
  31. package/dist/toast/index.mjs +5 -5
  32. package/package.json +5 -5
  33. /package/dist/{chunk-HEKSVWYW.mjs.map → chunk-2YM6GKWW.mjs.map} +0 -0
  34. /package/dist/{chunk-XYK6V3JF.mjs.map → chunk-DCXWGQVZ.mjs.map} +0 -0
  35. /package/dist/{chunk-D7YBYT5H.mjs.map → chunk-GPJMLIHC.mjs.map} +0 -0
  36. /package/dist/{chunk-2BSBKLHG.mjs.map → chunk-WLI4EPS6.mjs.map} +0 -0
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Dialog
3
- } from "../chunk-2BSBKLHG.mjs";
4
- import "../chunk-XYK6V3JF.mjs";
5
- import "../chunk-UMUMFMFB.mjs";
6
- import "../chunk-HEKSVWYW.mjs";
3
+ } from "../chunk-WLI4EPS6.mjs";
4
+ import "../chunk-DCXWGQVZ.mjs";
5
+ import "../chunk-2YM6GKWW.mjs";
7
6
  import "../chunk-GAK4SC2F.mjs";
7
+ import "../chunk-UMUMFMFB.mjs";
8
8
  import "../chunk-KEGAAGJW.mjs";
9
9
  import "../chunk-6QCEPQ3U.mjs";
10
10
 
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React$1 from 'react';
2
+ import * as react from 'react';
3
3
  import { ComponentPropsWithoutRef } from 'react';
4
4
 
5
5
  interface AvatarImageProps$1 extends React.ImgHTMLAttributes<HTMLImageElement> {
@@ -45,7 +45,7 @@ declare const AvatarPlaceholder: {
45
45
  displayName: string;
46
46
  };
47
47
 
48
- interface AvatarProps extends React$1.HTMLAttributes<HTMLDivElement> {
48
+ interface AvatarProps extends react.HTMLAttributes<HTMLDivElement> {
49
49
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
50
50
  isOnline?: boolean;
51
51
  onlineText?: string;
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React$1 from 'react';
2
+ import * as react from 'react';
3
3
  import { ComponentPropsWithoutRef } from 'react';
4
4
 
5
5
  interface AvatarImageProps$1 extends React.ImgHTMLAttributes<HTMLImageElement> {
@@ -45,7 +45,7 @@ declare const AvatarPlaceholder: {
45
45
  displayName: string;
46
46
  };
47
47
 
48
- interface AvatarProps extends React$1.HTMLAttributes<HTMLDivElement> {
48
+ interface AvatarProps extends react.HTMLAttributes<HTMLDivElement> {
49
49
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
50
50
  isOnline?: boolean;
51
51
  onlineText?: string;
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  IconButton
3
- } from "../chunk-XYK6V3JF.mjs";
3
+ } from "../chunk-DCXWGQVZ.mjs";
4
+ import "../chunk-2YM6GKWW.mjs";
5
+ import "../chunk-GAK4SC2F.mjs";
4
6
  import {
5
7
  Icon
6
8
  } from "../chunk-UMUMFMFB.mjs";
7
- import "../chunk-HEKSVWYW.mjs";
8
- import "../chunk-GAK4SC2F.mjs";
9
9
  import "../chunk-KEGAAGJW.mjs";
10
10
  import {
11
11
  Slot
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Button
3
- } from "../chunk-HEKSVWYW.mjs";
3
+ } from "../chunk-2YM6GKWW.mjs";
4
4
  import "../chunk-GAK4SC2F.mjs";
5
5
  import "../chunk-KEGAAGJW.mjs";
6
6
  import "../chunk-6QCEPQ3U.mjs";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  IconButton
3
- } from "../chunk-XYK6V3JF.mjs";
3
+ } from "../chunk-DCXWGQVZ.mjs";
4
+ import "../chunk-2YM6GKWW.mjs";
5
+ import "../chunk-GAK4SC2F.mjs";
4
6
  import {
5
7
  Icon
6
8
  } from "../chunk-UMUMFMFB.mjs";
7
- import "../chunk-HEKSVWYW.mjs";
8
- import "../chunk-GAK4SC2F.mjs";
9
9
  import "../chunk-KEGAAGJW.mjs";
10
10
  import "../chunk-6QCEPQ3U.mjs";
11
11
 
@@ -795,6 +795,7 @@ var Button = ({
795
795
  Button.displayName = "Button";
796
796
 
797
797
  export {
798
+ buttonStyles,
798
799
  Button
799
800
  };
800
- //# sourceMappingURL=chunk-HEKSVWYW.mjs.map
801
+ //# sourceMappingURL=chunk-2YM6GKWW.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Button
3
- } from "./chunk-HEKSVWYW.mjs";
3
+ } from "./chunk-2YM6GKWW.mjs";
4
4
 
5
5
  // src/icon-button/IconButton.styles.tsx
6
6
  import { makeVariants } from "@spark-ui/internal-utils";
@@ -50,4 +50,4 @@ IconButton.displayName = "IconButton";
50
50
  export {
51
51
  IconButton
52
52
  };
53
- //# sourceMappingURL=chunk-XYK6V3JF.mjs.map
53
+ //# sourceMappingURL=chunk-DCXWGQVZ.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  IconButton
3
- } from "./chunk-XYK6V3JF.mjs";
3
+ } from "./chunk-DCXWGQVZ.mjs";
4
4
  import {
5
5
  Icon
6
6
  } from "./chunk-UMUMFMFB.mjs";
@@ -305,4 +305,4 @@ Trigger.displayName = "Popover.Trigger";
305
305
  export {
306
306
  Popover2 as Popover
307
307
  };
308
- //# sourceMappingURL=chunk-D7YBYT5H.mjs.map
308
+ //# sourceMappingURL=chunk-GPJMLIHC.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  IconButton
3
- } from "./chunk-XYK6V3JF.mjs";
3
+ } from "./chunk-DCXWGQVZ.mjs";
4
4
  import {
5
5
  Icon
6
6
  } from "./chunk-UMUMFMFB.mjs";
@@ -355,4 +355,4 @@ Description.displayName = "Dialog.Description";
355
355
  export {
356
356
  Dialog2 as Dialog
357
357
  };
358
- //# sourceMappingURL=chunk-2BSBKLHG.mjs.map
358
+ //# sourceMappingURL=chunk-WLI4EPS6.mjs.map
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  Popover
3
- } from "../chunk-D7YBYT5H.mjs";
3
+ } from "../chunk-GPJMLIHC.mjs";
4
4
  import {
5
5
  IconButton
6
- } from "../chunk-XYK6V3JF.mjs";
7
- import {
8
- Icon
9
- } from "../chunk-UMUMFMFB.mjs";
10
- import "../chunk-HEKSVWYW.mjs";
6
+ } from "../chunk-DCXWGQVZ.mjs";
7
+ import "../chunk-2YM6GKWW.mjs";
11
8
  import {
12
9
  Spinner
13
10
  } from "../chunk-GAK4SC2F.mjs";
11
+ import {
12
+ Icon
13
+ } from "../chunk-UMUMFMFB.mjs";
14
14
  import {
15
15
  VisuallyHidden
16
16
  } from "../chunk-KEGAAGJW.mjs";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Dialog
3
- } from "../chunk-2BSBKLHG.mjs";
4
- import "../chunk-XYK6V3JF.mjs";
5
- import "../chunk-UMUMFMFB.mjs";
6
- import "../chunk-HEKSVWYW.mjs";
3
+ } from "../chunk-WLI4EPS6.mjs";
4
+ import "../chunk-DCXWGQVZ.mjs";
5
+ import "../chunk-2YM6GKWW.mjs";
7
6
  import "../chunk-GAK4SC2F.mjs";
7
+ import "../chunk-UMUMFMFB.mjs";
8
8
  import "../chunk-KEGAAGJW.mjs";
9
9
  import "../chunk-6QCEPQ3U.mjs";
10
10
  export {
package/dist/docgen.json CHANGED
@@ -30728,6 +30728,13 @@
30728
30728
  }
30729
30729
  }
30730
30730
  },
30731
+ "DropzoneContext": {
30732
+ "tags": {},
30733
+ "description": "",
30734
+ "displayName": "DropzoneContext",
30735
+ "methods": [],
30736
+ "props": {}
30737
+ },
30731
30738
  "FileUpload.ItemDeleteTrigger": {
30732
30739
  "tags": {},
30733
30740
  "description": "",
@@ -31596,7 +31603,9 @@
31596
31603
  }
31597
31604
  },
31598
31605
  "size": {
31599
- "defaultValue": null,
31606
+ "defaultValue": {
31607
+ "value": "md"
31608
+ },
31600
31609
  "description": "Size of the button.",
31601
31610
  "name": "size",
31602
31611
  "declarations": [],
@@ -31666,7 +31675,9 @@
31666
31675
  }
31667
31676
  },
31668
31677
  "shape": {
31669
- "defaultValue": null,
31678
+ "defaultValue": {
31679
+ "value": "rounded"
31680
+ },
31670
31681
  "description": "Shape of the button.",
31671
31682
  "name": "shape",
31672
31683
  "declarations": [],
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  IconButton
3
- } from "../chunk-XYK6V3JF.mjs";
3
+ } from "../chunk-DCXWGQVZ.mjs";
4
+ import "../chunk-2YM6GKWW.mjs";
5
+ import "../chunk-GAK4SC2F.mjs";
4
6
  import {
5
7
  Icon
6
8
  } from "../chunk-UMUMFMFB.mjs";
7
- import "../chunk-HEKSVWYW.mjs";
8
- import "../chunk-GAK4SC2F.mjs";
9
9
  import "../chunk-KEGAAGJW.mjs";
10
10
  import "../chunk-6QCEPQ3U.mjs";
11
11
 
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  Popover
3
- } from "../chunk-D7YBYT5H.mjs";
4
- import "../chunk-XYK6V3JF.mjs";
3
+ } from "../chunk-GPJMLIHC.mjs";
4
+ import "../chunk-DCXWGQVZ.mjs";
5
+ import "../chunk-2YM6GKWW.mjs";
6
+ import "../chunk-GAK4SC2F.mjs";
5
7
  import {
6
8
  Icon
7
9
  } from "../chunk-UMUMFMFB.mjs";
8
- import "../chunk-HEKSVWYW.mjs";
9
- import "../chunk-GAK4SC2F.mjs";
10
10
  import {
11
11
  VisuallyHidden
12
12
  } from "../chunk-KEGAAGJW.mjs";
@@ -233,7 +233,7 @@ interface FileUploadTriggerProps extends Omit<ButtonProps, 'children' | 'disable
233
233
  unstyled?: boolean;
234
234
  }
235
235
  declare const Trigger: {
236
- ({ className, children, asChild, unstyled, design, intent, ref, ...props }: FileUploadTriggerProps): react_jsx_runtime.JSX.Element;
236
+ ({ className, children, asChild, unstyled, design, intent, size, shape, ref, ...props }: FileUploadTriggerProps): react_jsx_runtime.JSX.Element;
237
237
  displayName: string;
238
238
  };
239
239
 
@@ -233,7 +233,7 @@ interface FileUploadTriggerProps extends Omit<ButtonProps, 'children' | 'disable
233
233
  unstyled?: boolean;
234
234
  }
235
235
  declare const Trigger: {
236
- ({ className, children, asChild, unstyled, design, intent, ref, ...props }: FileUploadTriggerProps): react_jsx_runtime.JSX.Element;
236
+ ({ className, children, asChild, unstyled, design, intent, size, shape, ref, ...props }: FileUploadTriggerProps): react_jsx_runtime.JSX.Element;
237
237
  displayName: string;
238
238
  };
239
239
 
@@ -157,7 +157,8 @@ var FileUpload = ({
157
157
  isRequired,
158
158
  description,
159
159
  disabled: fieldDisabled,
160
- readOnly: fieldReadOnly
160
+ readOnly: fieldReadOnly,
161
+ labelId
161
162
  } = field;
162
163
  const defaultLocale = locale || (typeof navigator !== "undefined" && navigator.language ? navigator.language : "en");
163
164
  const internalId = (0, import_react2.useId)();
@@ -376,6 +377,7 @@ var FileUpload = ({
376
377
  required: isRequired,
377
378
  "aria-invalid": isInvalid,
378
379
  "aria-describedby": description,
380
+ "aria-label": !labelId ? "Upload files test" : void 0,
379
381
  className: "sr-only",
380
382
  onChange: (e) => {
381
383
  if (e.target.files && !disabled && !readOnly) {
@@ -1732,6 +1734,8 @@ Context.displayName = "FileUpload.Context";
1732
1734
  var import_class_variance_authority11 = require("class-variance-authority");
1733
1735
  var import_react10 = require("react");
1734
1736
  var import_jsx_runtime15 = require("react/jsx-runtime");
1737
+ var DropzoneContext = (0, import_react10.createContext)(false);
1738
+ var useDropzoneContext = () => (0, import_react10.useContext)(DropzoneContext);
1735
1739
  function Dropzone({
1736
1740
  children,
1737
1741
  className,
@@ -1770,7 +1774,7 @@ function Dropzone({
1770
1774
  }
1771
1775
  };
1772
1776
  const isDisabled = ctx.disabled || ctx.readOnly;
1773
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1777
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropzoneContext.Provider, { value: true, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1774
1778
  "div",
1775
1779
  {
1776
1780
  ref: (node) => {
@@ -1814,7 +1818,7 @@ function Dropzone({
1814
1818
  },
1815
1819
  children
1816
1820
  }
1817
- );
1821
+ ) });
1818
1822
  }
1819
1823
  Dropzone.displayName = "FileUploadDropzone";
1820
1824
 
@@ -1978,10 +1982,13 @@ var Trigger = ({
1978
1982
  unstyled = false,
1979
1983
  design = "filled",
1980
1984
  intent = "basic",
1985
+ size = "md",
1986
+ shape = "rounded",
1981
1987
  ref,
1982
1988
  ...props
1983
1989
  }) => {
1984
1990
  const { inputRef, triggerRef, disabled, readOnly, description, isInvalid, isRequired } = useFileUploadContext();
1991
+ const isInsideDropzone = useDropzoneContext();
1985
1992
  const handleClick = (e) => {
1986
1993
  e.stopPropagation();
1987
1994
  e.preventDefault();
@@ -1989,26 +1996,47 @@ var Trigger = ({
1989
1996
  inputRef.current?.click();
1990
1997
  }
1991
1998
  };
1992
- const buttonComponent = unstyled ? "button" : Button;
1993
- const Comp = asChild ? Slot : buttonComponent;
1994
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1995
- Comp,
1996
- {
1999
+ const handleRef = (node) => {
2000
+ if (triggerRef) {
2001
+ triggerRef.current = node;
2002
+ }
2003
+ if (ref) {
2004
+ if (typeof ref === "function") {
2005
+ ref(node);
2006
+ } else {
2007
+ ref.current = node;
2008
+ }
2009
+ }
2010
+ };
2011
+ let Component;
2012
+ let componentProps;
2013
+ if (isInsideDropzone) {
2014
+ Component = "span";
2015
+ const spanStyles = unstyled ? className : buttonStyles({
2016
+ design,
2017
+ intent,
2018
+ size,
2019
+ shape,
2020
+ disabled: disabled || readOnly,
2021
+ className
2022
+ });
2023
+ componentProps = {
2024
+ ref: handleRef,
2025
+ "data-spark-component": "file-upload-trigger",
2026
+ className: spanStyles
2027
+ // No onClick, no role, no tabIndex - Dropzone handles interaction
2028
+ // No aria attributes here - they're on the Dropzone
2029
+ };
2030
+ } else {
2031
+ const buttonComponent = unstyled ? "button" : Button;
2032
+ Component = asChild ? Slot : buttonComponent;
2033
+ componentProps = {
2034
+ ref: handleRef,
1997
2035
  type: "button",
1998
- ref: (node) => {
1999
- if (triggerRef) {
2000
- triggerRef.current = node;
2001
- }
2002
- if (ref) {
2003
- if (typeof ref === "function") {
2004
- ref(node);
2005
- } else {
2006
- ref.current = node;
2007
- }
2008
- }
2009
- },
2010
2036
  design,
2011
2037
  intent,
2038
+ size,
2039
+ shape,
2012
2040
  "data-spark-component": "file-upload-trigger",
2013
2041
  className: (0, import_class_variance_authority15.cx)(className),
2014
2042
  disabled: disabled || readOnly,
@@ -2016,10 +2044,10 @@ var Trigger = ({
2016
2044
  "aria-describedby": description,
2017
2045
  "aria-invalid": isInvalid,
2018
2046
  "aria-required": isRequired,
2019
- ...props,
2020
- children
2021
- }
2022
- );
2047
+ ...props
2048
+ };
2049
+ }
2050
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Component, { ...componentProps, children });
2023
2051
  };
2024
2052
  Trigger.displayName = "FileUpload.Trigger";
2025
2053