@spark-web/box 1.2.1 → 2.0.0-rc.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @spark-web/box
2
2
 
3
+ ## 2.0.0-rc.1
4
+
5
+ ### Major Changes
6
+
7
+ - rc
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies []:
12
+ - @spark-web/theme@4.0.0-rc.1
13
+ - @spark-web/utils@2.0.0-rc.1
14
+
15
+ ## 2.0.0-rc.0
16
+
17
+ ### Major Changes
18
+
19
+ - rc versio
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies []:
24
+ - @spark-web/theme@4.0.0-rc.0
25
+ - @spark-web/utils@2.0.0-rc.0
26
+
3
27
  ## 1.2.1
4
28
 
5
29
  ### Patch Changes
@@ -4,4 +4,4 @@ export declare type BackgroundProviderProps = {
4
4
  children: ReactElement;
5
5
  };
6
6
  /** Enforce background "lightness" without applying a background color. */
7
- export declare const BackgroundProvider: ({ type, children, }: BackgroundProviderProps) => import("react/jsx-runtime").JSX.Element | null;
7
+ export declare const BackgroundProvider: ({ type, children, }: BackgroundProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element | null;
@@ -20,7 +20,7 @@ export declare type BoxProps = {
20
20
  /** Exposes a prop-based API for adding styles to a view, within the constraints of the theme. */
21
21
  export declare const Box: <Comp extends import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> = "div">(props: {
22
22
  as?: Comp | undefined;
23
- ref?: import("react").Ref<Comp extends "symbol" | "switch" | "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" | "set" | "stop" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap ? (HTMLElementTagNameMap & Pick<SVGElementTagNameMap, "symbol" | "switch" | "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" | "set" | "stop" | "textPath" | "tspan" | "use" | "view">)[Comp] : Comp extends new (...args: any) => any ? InstanceType<Comp> : undefined> | undefined;
23
+ 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" | "set" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap ? (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" | "set" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view">)[Comp] : Comp extends new (...args: any) => any ? InstanceType<Comp> : undefined> | undefined;
24
24
  } & Omit<import("react").PropsWithoutRef<import("react").ComponentProps<Comp>>, "as"> & {
25
25
  /** Children element to be rendered inside the component. */
26
26
  children?: ReactNode;
@@ -37,11 +37,11 @@ export declare const Box: <Comp extends import("react").ElementType<any, keyof i
37
37
  */
38
38
  asElement?: keyof HTMLElementTagNameMap | undefined;
39
39
  } & {
40
- background?: "infoLight" | "criticalLight" | "positiveLight" | "cautionLight" | "muted" | "disabled" | "backdrop" | "body" | "surface" | "surfaceMuted" | "surfacePressed" | "fieldAccent" | "input" | "inputPressed" | "inputDisabled" | "accent" | "accentMuted" | "neutral" | "neutralLow" | "primary" | "primaryLow" | "primaryMuted" | "secondary" | "secondaryLow" | "secondaryMuted" | "caution" | "cautionLow" | "cautionMuted" | "critical" | "criticalLow" | "criticalMuted" | "info" | "infoLow" | "infoMuted" | "positive" | "positiveLow" | "positiveMuted" | undefined;
40
+ background?: "body" | "input" | "disabled" | "infoLight" | "criticalLight" | "positiveLight" | "cautionLight" | "muted" | "backdrop" | "surface" | "surfaceMuted" | "surfacePressed" | "fieldAccent" | "inputPressed" | "inputDisabled" | "accent" | "accentMuted" | "neutral" | "neutralLow" | "primary" | "primaryLow" | "primaryMuted" | "secondary" | "secondaryLow" | "secondaryMuted" | "caution" | "cautionLow" | "cautionMuted" | "critical" | "criticalLow" | "criticalMuted" | "info" | "infoLow" | "infoMuted" | "positive" | "positiveLow" | "positiveMuted" | undefined;
41
41
  cursor?: "default" | "pointer" | undefined;
42
42
  minHeight?: 0 | undefined;
43
43
  minWidth?: 0 | undefined;
44
- overflow?: "scroll" | "hidden" | "auto" | "visible" | undefined;
44
+ overflow?: "auto" | "hidden" | "scroll" | "visible" | undefined;
45
45
  shadow?: "small" | "large" | "medium" | undefined;
46
46
  userSelect?: "none" | undefined;
47
47
  } & import("./use-box-styles.js").ResponsiveBoxProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
@@ -3,5 +3,5 @@ import type { BoxStyleProps } from "./use-box-styles.js";
3
3
  export declare type BackgroundVariant = NonNullable<BoxStyleProps['background']> | 'UNKNOWN_DARK' | 'UNKNOWN_LIGHT';
4
4
  export declare const InternalBackgroundProvider: import("react").Provider<BackgroundVariant>;
5
5
  export declare const useBackground: () => BackgroundVariant;
6
- export declare function renderBackgroundProvider(background: BackgroundVariant | undefined, element: ReactElement | null): import("react/jsx-runtime").JSX.Element | null;
6
+ export declare function renderBackgroundProvider(background: BackgroundVariant | undefined, element: ReactElement | null): import("@emotion/react/jsx-runtime").JSX.Element | null;
7
7
  export declare const useBackgroundLightness: (backgroundOverride?: ReturnType<typeof useBackground>) => "light" | "dark";
@@ -7,7 +7,7 @@ var react = require('react');
7
7
  var jsxRuntime = require('react/jsx-runtime');
8
8
  var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
9
9
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
10
- var css = require('@emotion/css');
10
+ var react$1 = require('@emotion/react');
11
11
  var internal = require('@spark-web/utils/internal');
12
12
  var ts = require('@spark-web/utils/ts');
13
13
 
@@ -327,11 +327,17 @@ var Box = ts.forwardRefWithAs(function (_ref, forwardedRef) {
327
327
  styles = _useBoxProps.styles,
328
328
  attributes = _useBoxProps.attributes;
329
329
  var resetStyles = internal.resetElementStyles(asElement !== null && asElement !== void 0 ? asElement : Tag);
330
- var element = /*#__PURE__*/jsxRuntime.jsx(Tag, _objectSpread(_objectSpread({}, data ? internal.buildDataAttributes(data) : undefined), {}, {
331
- ref: forwardedRef,
332
- id: id,
333
- className: css.cx(css.css(resetStyles), css.css(styles), className)
334
- }, attributes));
330
+ var element = /*#__PURE__*/jsxRuntime.jsx(react$1.ClassNames, {
331
+ children: function children(_ref2) {
332
+ var css = _ref2.css,
333
+ cx = _ref2.cx;
334
+ return /*#__PURE__*/jsxRuntime.jsx(Tag, _objectSpread(_objectSpread({}, data ? internal.buildDataAttributes(data) : undefined), {}, {
335
+ ref: forwardedRef,
336
+ id: id,
337
+ className: cx(css(resetStyles), css(styles), className)
338
+ }, attributes));
339
+ }
340
+ });
335
341
  return renderBackgroundProvider(props.background, element);
336
342
  });
337
343
 
@@ -7,7 +7,7 @@ var react = require('react');
7
7
  var jsxRuntime = require('react/jsx-runtime');
8
8
  var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
9
9
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
10
- var css = require('@emotion/css');
10
+ var react$1 = require('@emotion/react');
11
11
  var internal = require('@spark-web/utils/internal');
12
12
  var ts = require('@spark-web/utils/ts');
13
13
 
@@ -327,11 +327,17 @@ var Box = ts.forwardRefWithAs(function (_ref, forwardedRef) {
327
327
  styles = _useBoxProps.styles,
328
328
  attributes = _useBoxProps.attributes;
329
329
  var resetStyles = internal.resetElementStyles(asElement !== null && asElement !== void 0 ? asElement : Tag);
330
- var element = /*#__PURE__*/jsxRuntime.jsx(Tag, _objectSpread(_objectSpread({}, data ? internal.buildDataAttributes(data) : undefined), {}, {
331
- ref: forwardedRef,
332
- id: id,
333
- className: css.cx(css.css(resetStyles), css.css(styles), className)
334
- }, attributes));
330
+ var element = /*#__PURE__*/jsxRuntime.jsx(react$1.ClassNames, {
331
+ children: function children(_ref2) {
332
+ var css = _ref2.css,
333
+ cx = _ref2.cx;
334
+ return /*#__PURE__*/jsxRuntime.jsx(Tag, _objectSpread(_objectSpread({}, data ? internal.buildDataAttributes(data) : undefined), {}, {
335
+ ref: forwardedRef,
336
+ id: id,
337
+ className: cx(css(resetStyles), css(styles), className)
338
+ }, attributes));
339
+ }
340
+ });
335
341
  return renderBackgroundProvider(props.background, element);
336
342
  });
337
343
 
@@ -3,7 +3,7 @@ import { createContext, useContext } from 'react';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
  import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';
5
5
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
6
- import { cx, css } from '@emotion/css';
6
+ import { ClassNames } from '@emotion/react';
7
7
  import { resetElementStyles, buildDataAttributes } from '@spark-web/utils/internal';
8
8
  import { forwardRefWithAs } from '@spark-web/utils/ts';
9
9
 
@@ -323,11 +323,17 @@ var Box = forwardRefWithAs(function (_ref, forwardedRef) {
323
323
  styles = _useBoxProps.styles,
324
324
  attributes = _useBoxProps.attributes;
325
325
  var resetStyles = resetElementStyles(asElement !== null && asElement !== void 0 ? asElement : Tag);
326
- var element = /*#__PURE__*/jsx(Tag, _objectSpread(_objectSpread({}, data ? buildDataAttributes(data) : undefined), {}, {
327
- ref: forwardedRef,
328
- id: id,
329
- className: cx(css(resetStyles), css(styles), className)
330
- }, attributes));
326
+ var element = /*#__PURE__*/jsx(ClassNames, {
327
+ children: function children(_ref2) {
328
+ var css = _ref2.css,
329
+ cx = _ref2.cx;
330
+ return /*#__PURE__*/jsx(Tag, _objectSpread(_objectSpread({}, data ? buildDataAttributes(data) : undefined), {}, {
331
+ ref: forwardedRef,
332
+ id: id,
333
+ className: cx(css(resetStyles), css(styles), className)
334
+ }, attributes));
335
+ }
336
+ });
331
337
  return renderBackgroundProvider(props.background, element);
332
338
  });
333
339
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spark-web/box",
3
- "version": "1.2.1",
3
+ "version": "2.0.0-rc.1",
4
4
  "homepage": "https://github.com/brighte-labs/spark-web#readme",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,9 +16,9 @@
16
16
  ],
17
17
  "dependencies": {
18
18
  "@babel/runtime": "^7.25.0",
19
- "@emotion/css": "^11.11.2",
20
- "@spark-web/theme": "^3.2.0",
21
- "@spark-web/utils": "^1.3.1"
19
+ "@emotion/react": "^11.13.5",
20
+ "@spark-web/theme": "^4.0.0-rc.1",
21
+ "@spark-web/utils": "^2.0.0-rc.1"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/react": "^18.2.0",