@spark-web/button 1.1.1 → 1.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.
@@ -5,5 +5,5 @@ export declare type ButtonLinkProps = LinkComponentProps & CommonButtonProps;
5
5
  /** The appearance of a `Button`, with the semantics of a link. */
6
6
  export declare const ButtonLink: <Comp extends import("react").ElementType<any> = "a">(props: {
7
7
  as?: Comp | undefined;
8
- ref?: import("react").Ref<Comp extends "symbol" | "text" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap | "set" ? (HTMLElementTagNameMap & Pick<SVGElementTagNameMap, "symbol" | "text" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "textPath" | "tspan" | "use" | "view" | "set">)[Comp] : Comp extends new (...args: any) => any ? InstanceType<Comp> : undefined> | undefined;
8
+ ref?: import("react").Ref<Comp extends "symbol" | "clipPath" | "filter" | "mask" | "marker" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap | "set" ? (HTMLElementTagNameMap & Pick<SVGElementTagNameMap, "symbol" | "clipPath" | "filter" | "mask" | "marker" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | "set">)[Comp] : Comp extends new (...args: any) => any ? InstanceType<Comp> : undefined> | undefined;
9
9
  } & Omit<import("react").PropsWithoutRef<import("react").ComponentProps<Comp>>, "as"> & ButtonLinkProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
@@ -9,9 +9,9 @@ var box = require('@spark-web/box');
9
9
  var spinner = require('@spark-web/spinner');
10
10
  var internal = require('@spark-web/utils/internal');
11
11
  var react = require('react');
12
- var css = require('@emotion/css');
13
12
  var text = require('@spark-web/text');
14
13
  var jsxRuntime = require('react/jsx-runtime');
14
+ var css = require('@emotion/css');
15
15
  var theme = require('@spark-web/theme');
16
16
  var link = require('@spark-web/link');
17
17
  var ts = require('@spark-web/utils/ts');
@@ -203,10 +203,12 @@ var resolveButtonChildren = function resolveButtonChildren(_ref) {
203
203
  function HiddenWhenLoading(_ref2) {
204
204
  var children = _ref2.children,
205
205
  isLoading = _ref2.isLoading;
206
- return /*#__PURE__*/jsxRuntime.jsx("span", {
207
- className: isLoading ? css.css({
208
- opacity: 0
209
- }) : undefined,
206
+ return /*#__PURE__*/jsxRuntime.jsx(box.Box, {
207
+ as: "span",
208
+ display: "inline-flex",
209
+ alignItems: "center",
210
+ justifyContent: "center",
211
+ opacity: isLoading ? 0 : undefined,
210
212
  children: children
211
213
  });
212
214
  }
@@ -9,9 +9,9 @@ var box = require('@spark-web/box');
9
9
  var spinner = require('@spark-web/spinner');
10
10
  var internal = require('@spark-web/utils/internal');
11
11
  var react = require('react');
12
- var css = require('@emotion/css');
13
12
  var text = require('@spark-web/text');
14
13
  var jsxRuntime = require('react/jsx-runtime');
14
+ var css = require('@emotion/css');
15
15
  var theme = require('@spark-web/theme');
16
16
  var link = require('@spark-web/link');
17
17
  var ts = require('@spark-web/utils/ts');
@@ -203,10 +203,12 @@ var resolveButtonChildren = function resolveButtonChildren(_ref) {
203
203
  function HiddenWhenLoading(_ref2) {
204
204
  var children = _ref2.children,
205
205
  isLoading = _ref2.isLoading;
206
- return /*#__PURE__*/jsxRuntime.jsx("span", {
207
- className: isLoading ? css.css({
208
- opacity: 0
209
- }) : undefined,
206
+ return /*#__PURE__*/jsxRuntime.jsx(box.Box, {
207
+ as: "span",
208
+ display: "inline-flex",
209
+ alignItems: "center",
210
+ justifyContent: "center",
211
+ opacity: isLoading ? 0 : undefined,
210
212
  children: children
211
213
  });
212
214
  }
@@ -5,9 +5,9 @@ import { Box } from '@spark-web/box';
5
5
  import { Spinner } from '@spark-web/spinner';
6
6
  import { buildDataAttributes } from '@spark-web/utils/internal';
7
7
  import { Children, isValidElement, cloneElement, forwardRef } from 'react';
8
- import { css } from '@emotion/css';
9
8
  import { Text } from '@spark-web/text';
10
9
  import { jsx, jsxs } from 'react/jsx-runtime';
10
+ import { css } from '@emotion/css';
11
11
  import { useTheme } from '@spark-web/theme';
12
12
  import { useLinkComponent } from '@spark-web/link';
13
13
  import { forwardRefWithAs } from '@spark-web/utils/ts';
@@ -199,10 +199,12 @@ var resolveButtonChildren = function resolveButtonChildren(_ref) {
199
199
  function HiddenWhenLoading(_ref2) {
200
200
  var children = _ref2.children,
201
201
  isLoading = _ref2.isLoading;
202
- return /*#__PURE__*/jsx("span", {
203
- className: isLoading ? css({
204
- opacity: 0
205
- }) : undefined,
202
+ return /*#__PURE__*/jsx(Box, {
203
+ as: "span",
204
+ display: "inline-flex",
205
+ alignItems: "center",
206
+ justifyContent: "center",
207
+ opacity: isLoading ? 0 : undefined,
206
208
  children: children
207
209
  });
208
210
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spark-web/button",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "license": "MIT",
5
5
  "main": "dist/spark-web-button.cjs.js",
6
6
  "module": "dist/spark-web-button.esm.js",
@@ -14,7 +14,7 @@
14
14
  "@spark-web/box": "^1.0.5",
15
15
  "@spark-web/icon": "^1.1.3",
16
16
  "@spark-web/link": "^1.0.5",
17
- "@spark-web/spinner": "^1.0.2",
17
+ "@spark-web/spinner": "^1.0.3",
18
18
  "@spark-web/text": "^1.0.5",
19
19
  "@spark-web/theme": "^3.0.1",
20
20
  "@spark-web/utils": "^1.1.3"