@spark-web/box 6.0.0-rc.0 → 6.0.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,16 +1,49 @@
1
1
  # @spark-web/box
2
2
 
3
- ## 6.0.0-rc.0
3
+ ## 6.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#782](https://github.com/brighte-labs/spark-web/pull/782)
8
+ [`bb41800`](https://github.com/brighte-labs/spark-web/commit/bb418004d21165f72f4bf2456afea844ee04a21c)
9
+ Thanks [@jacobporci-brighte](https://github.com/jacobporci-brighte)! -
10
+ **docs:** add CLAUDE.md AI context files to foundation and form packages;
11
+ patch data-table with manual sort and spinner overlay patterns
12
+
13
+ ## 6.0.0
4
14
 
5
15
  ### Minor Changes
6
16
 
7
- - update react version and other packages
17
+ - [#667](https://github.com/brighte-labs/spark-web/pull/667)
18
+ [`80d9c15`](https://github.com/brighte-labs/spark-web/commit/80d9c156a40bbcd2b1a91a2d0403b3c8e9b47b4e)
19
+ Thanks [@Leo704099](https://github.com/Leo704099)! - Support react 17 to 19
8
20
 
9
21
  ### Patch Changes
10
22
 
11
- - Updated dependencies []:
12
- - @spark-web/theme@5.12.0-rc.0
13
- - @spark-web/utils@5.1.0-rc.0
23
+ - Updated dependencies
24
+ [[`80d9c15`](https://github.com/brighte-labs/spark-web/commit/80d9c156a40bbcd2b1a91a2d0403b3c8e9b47b4e)]:
25
+ - @spark-web/theme@5.13.0
26
+ - @spark-web/utils@5.1.0
27
+
28
+ ## 5.2.2
29
+
30
+ ### Patch Changes
31
+
32
+ - [#698](https://github.com/brighte-labs/spark-web/pull/698)
33
+ [`814b373`](https://github.com/brighte-labs/spark-web/commit/814b373cbe9fcf0757738c78eef6b516624df62c)
34
+ Thanks [@michtntbrighte](https://github.com/michtntbrighte)! - Bump version
35
+
36
+ - Updated dependencies
37
+ [[`814b373`](https://github.com/brighte-labs/spark-web/commit/814b373cbe9fcf0757738c78eef6b516624df62c)]:
38
+ - @spark-web/theme@5.12.1
39
+
40
+ ## 5.2.1
41
+
42
+ ### Patch Changes
43
+
44
+ - Updated dependencies
45
+ [[`1995db7`](https://github.com/brighte-labs/spark-web/commit/1995db7f4342803732c7648ab3ca6d32442cc347)]:
46
+ - @spark-web/theme@5.12.0
14
47
 
15
48
  ## 5.2.0
16
49
 
package/CLAUDE.md ADDED
@@ -0,0 +1,87 @@
1
+ # @spark-web/box — AI Context
2
+
3
+ ## What this is
4
+
5
+ The foundational layout primitive. Every Spark component is built on `Box`. It
6
+ exposes a prop-based API for applying theme-constrained styles to any HTML
7
+ element. Use it when no higher-level layout component (`Stack`, `Row`,
8
+ `Columns`) fits the shape of what you need.
9
+
10
+ ## What this is NOT
11
+
12
+ - Not a text component — use `Text` for any rendered text content
13
+ - Not a layout shorthand — for vertical stacks use `Stack`, for horizontal rows
14
+ use `Row`, for CSS grid use `Columns`
15
+ - Not a button — use `Button` or `ButtonLink` for interactive elements
16
+
17
+ ## Props interface
18
+
19
+ `Box` accepts all `BoxStyleProps` (see below) plus:
20
+
21
+ | Prop | Type | Notes |
22
+ | ----------- | ----------------------------- | ------------------------------------------------ |
23
+ | `as` | `keyof HTMLElementTagNameMap` | Changes the rendered element; defaults to `div` |
24
+ | `asElement` | `keyof HTMLElementTagNameMap` | Tells the reset system what element `as` renders |
25
+ | `children` | `ReactNode` | — |
26
+ | `data` | `DataAttributeMap` | Test/analytics attributes |
27
+ | `id` | `string` | — |
28
+ | `css` | `CSSObject` | Escape hatch for styles not covered by props |
29
+
30
+ ### BoxStyleProps — commonly used
31
+
32
+ Spacing values map to `SparkTheme['spacing']` keys:
33
+ `none | xsmall | small | medium | large | xlarge | xxlarge`
34
+
35
+ Sizing values map to `SparkTheme['sizing']` keys:
36
+ `xxsmall | xsmall | small | medium | large | xlarge | xxlarge | full`
37
+
38
+ | Prop | Values |
39
+ | --------------------------------- | ---------------------------------------------------------------------------- |
40
+ | `padding` | spacing token (responsive) |
41
+ | `paddingX` | spacing token (responsive) |
42
+ | `paddingY` | spacing token (responsive) |
43
+ | `paddingTop/Bottom/Left/Right` | spacing token (responsive) |
44
+ | `margin` | spacing token (responsive) |
45
+ | `marginX/Y/Top/Bottom/Left/Right` | spacing token (responsive) |
46
+ | `gap` | spacing token (responsive, excludes `none` and `full`) |
47
+ | `width` | sizing token or `'full'` (responsive) |
48
+ | `height` | sizing token (responsive) |
49
+ | `display` | `'block' \| 'inline' \| 'inline-block' \| 'inline-flex' \| 'flex' \| 'none'` |
50
+ | `flexDirection` | `'row' \| 'rowReverse' \| 'column' \| 'columnReverse'` |
51
+ | `flexWrap` | `'wrap' \| 'nowrap'` |
52
+ | `alignItems` | `'center' \| 'flexStart' \| 'flexEnd' \| 'stretch'` |
53
+ | `justifyContent` | `'start' \| 'center' \| 'end' \| 'spaceBetween' \| 'stretch'` |
54
+ | `flexShrink` | `0 \| 1` |
55
+ | `position` | `'relative' \| 'absolute' \| 'fixed' \| 'sticky'` |
56
+ | `top/bottom/left/right` | `number` (responsive) |
57
+ | `overflow` | `'hidden' \| 'auto' \| 'scroll' \| 'visible'` |
58
+ | `background` | background token (e.g. `'surface' \| 'primary' \| 'primarySoft'`) |
59
+ | `border` | border color token (e.g. `'standard' \| 'primary'`) |
60
+ | `borderRadius` | `'small' \| 'medium' \| 'large' \| 'full'` |
61
+ | `cursor` | `'default' \| 'pointer'` |
62
+
63
+ ## Token usage
64
+
65
+ All values come from the theme — never raw hex, px, or Tailwind. Use
66
+ `useTheme()` from `@spark-web/theme` for any value not expressible as a Box prop
67
+ (e.g. inline color from `theme.color.foreground.muted`).
68
+
69
+ The `background` prop automatically pushes a background context so child `Text`
70
+ components can invert their color tone when placed on dark backgrounds.
71
+
72
+ ## Composition
73
+
74
+ `Box` is the leaf — it does not compose other Spark components. Every other
75
+ Spark component composes `Box` internally.
76
+
77
+ ## Do NOTs
78
+
79
+ - NEVER use raw hex, px, em, rem, or Tailwind classes
80
+ - NEVER use `Box` for text content — use `Text`
81
+ - NEVER use `Box` when `Stack`, `Row`, or `Columns` fits the layout — those
82
+ components encode the correct flex/grid setup automatically
83
+ - NEVER pass `display`, `alignItems`, `flexDirection`, or `justifyContent` to
84
+ `Stack` or `Row` — those are locked internally; use `Box` if you need custom
85
+ flex control
86
+ - NEVER use `style={{}}` for theme values — use Box props or `css` prop with
87
+ theme tokens
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
- export declare type BackgroundProviderProps = {
2
+ export type BackgroundProviderProps = {
3
3
  type: 'light' | 'dark';
4
4
  children: ReactElement;
5
5
  };
@@ -1,9 +1,8 @@
1
- /** @jsxImportSource @emotion/react */
2
1
  import type { CSSObject } from '@emotion/react';
3
2
  import type { DataAttributeMap } from '@spark-web/utils/internal';
4
3
  import type { ReactNode } from 'react';
5
4
  import type { BoxStyleProps } from "./use-box-styles.js";
6
- export declare type BoxProps = {
5
+ export type BoxProps = {
7
6
  /** Children element to be rendered inside the component. */
8
7
  children?: ReactNode;
9
8
  /** Sets data attributes on the component. */
@@ -20,30 +19,30 @@ export declare type BoxProps = {
20
19
  asElement?: keyof HTMLElementTagNameMap;
21
20
  } & BoxStyleProps;
22
21
  /** Exposes a prop-based API for adding styles to a view, within the constraints of the theme. */
23
- export declare const Box: <Comp extends import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> = "div">(props: {
22
+ export declare const Box: <Comp extends import("react").ElementType = "div">(props: {
24
23
  as?: Comp | undefined;
25
- 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" | "set" | "stop" | "switch" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap ? (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" | "set" | "stop" | "switch" | "textPath" | "tspan" | "use" | "view">)[Comp] : Comp extends new (...args: any) => any ? InstanceType<Comp> : undefined> | undefined;
24
+ ref?: import("react").Ref<Comp extends "symbol" | "text" | "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" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap ? (HTMLElementTagNameMap & Pick<SVGElementTagNameMap, "symbol" | "text" | "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" | "textPath" | "tspan" | "use" | "view">)[Comp] : Comp extends new (...args: any) => any ? InstanceType<Comp> : undefined> | undefined;
26
25
  } & Omit<import("react").PropsWithoutRef<import("react").ComponentProps<Comp>>, "as"> & {
27
26
  /** Children element to be rendered inside the component. */
28
27
  children?: ReactNode;
29
28
  /** Sets data attributes on the component. */
30
- data?: DataAttributeMap | undefined;
29
+ data?: DataAttributeMap;
31
30
  /** An identifier which must be unique in the whole document. */
32
- id?: string | undefined;
31
+ id?: string;
33
32
  /** Custom css styles. */
34
- css?: CSSObject | undefined;
33
+ css?: CSSObject;
35
34
  /**
36
35
  * When providing a component using the "as" prop, optionally tell the system
37
36
  * what the underlying element will be. Used internally to manage reset
38
37
  * styles.
39
38
  */
40
- asElement?: keyof HTMLElementTagNameMap | undefined;
39
+ asElement?: keyof HTMLElementTagNameMap;
41
40
  } & {
42
- background?: string | number | undefined;
43
- cursor?: "default" | "pointer" | undefined;
44
- minHeight?: 0 | undefined;
45
- minWidth?: 0 | undefined;
46
- overflow?: "hidden" | "auto" | "scroll" | "visible" | undefined;
47
- shadow?: "small" | "medium" | "large" | undefined;
48
- userSelect?: "none" | undefined;
49
- } & import("./use-box-styles.js").ResponsiveBoxProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
41
+ background?: keyof import("@spark-web/theme").SparkTheme["color"]["background"];
42
+ cursor?: "default" | "pointer";
43
+ minHeight?: 0;
44
+ minWidth?: 0;
45
+ overflow?: "hidden" | "scroll" | "visible" | "auto";
46
+ shadow?: keyof import("@spark-web/theme").SparkTheme["shadow"] | string | null;
47
+ userSelect?: "none";
48
+ } & import("./use-box-styles.js").ResponsiveBoxProps) => import("react").ReactElement;
@@ -1,6 +1,6 @@
1
1
  import type { ReactElement } from 'react';
2
2
  import type { BoxStyleProps } from "./use-box-styles.js";
3
- export declare type BackgroundVariant = NonNullable<BoxStyleProps['background']> | 'UNKNOWN_DARK' | 'UNKNOWN_LIGHT';
3
+ export 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
6
  export declare function renderBackgroundProvider(background: BackgroundVariant | undefined, element: ReactElement | null): import("@emotion/react/jsx-runtime").JSX.Element | null;
@@ -1,8 +1,8 @@
1
1
  import type { ResponsiveProp, SparkTheme } from '@spark-web/theme';
2
- declare type ValidGapKeys = keyof Omit<SparkTheme['spacing'], 'none' | 'full'>;
3
- declare type ResponsiveSpacing = ResponsiveProp<keyof SparkTheme['spacing']>;
4
- declare type ResponsiveSizing = ResponsiveProp<keyof SparkTheme['sizing']>;
5
- export declare type ResponsiveBoxProps = {
2
+ type ValidGapKeys = keyof Omit<SparkTheme['spacing'], 'none' | 'full'>;
3
+ type ResponsiveSpacing = ResponsiveProp<keyof SparkTheme['spacing']>;
4
+ type ResponsiveSizing = ResponsiveProp<keyof SparkTheme['sizing']>;
5
+ export type ResponsiveBoxProps = {
6
6
  /**
7
7
  * The `margin` shorthand property sets the margin area on all four sides of
8
8
  * an element at once.
@@ -87,7 +87,7 @@ export declare type ResponsiveBoxProps = {
87
87
  * The `borderRadius` property rounds the corners of an element's outer
88
88
  * border edge.
89
89
  */
90
- borderRadius?: ResponsiveProp<keyof SparkTheme['border']['radius']>;
90
+ borderRadius?: ResponsiveProp<keyof SparkTheme['border']['radius']> | number;
91
91
  /**
92
92
  * The `borderWidth` property sets the width of an element's border.
93
93
  */
@@ -137,22 +137,22 @@ export declare type ResponsiveBoxProps = {
137
137
  * The `top` property participates in specifying the vertical position of a
138
138
  * positioned element. It has no effect on non-positioned elements.
139
139
  */
140
- top?: ResponsiveProp<0>;
140
+ top?: ResponsiveProp<number>;
141
141
  /**
142
142
  * The `right` property participates in specifying the horizontal position of
143
143
  * a positioned element. It has no effect on non-positioned elements.
144
144
  */
145
- right?: ResponsiveProp<0>;
145
+ right?: ResponsiveProp<number>;
146
146
  /**
147
147
  * The `bottom` property participates in setting the vertical position of a
148
148
  * positioned element. It has no effect on non-positioned elements.
149
149
  */
150
- bottom?: ResponsiveProp<0>;
150
+ bottom?: ResponsiveProp<number>;
151
151
  /**
152
152
  * The `left` property participates in specifying the horizontal position of a
153
153
  * positioned element. It has no effect on non-positioned elements.
154
154
  */
155
- left?: ResponsiveProp<0>;
155
+ left?: ResponsiveProp<number>;
156
156
  /**
157
157
  * The `zIndex` property sets the "z-order" of a positioned element and its
158
158
  * descendants or flex items. Overlapping elements with a larger z-index cover
@@ -170,7 +170,7 @@ export declare type ResponsiveBoxProps = {
170
170
  */
171
171
  opacity?: ResponsiveProp<number>;
172
172
  };
173
- declare type UnresponsiveBoxProps = {
173
+ type UnresponsiveBoxProps = {
174
174
  /** The `background` property sets the background color of an element. */
175
175
  background?: keyof SparkTheme['color']['background'];
176
176
  /**
@@ -197,11 +197,11 @@ declare type UnresponsiveBoxProps = {
197
197
  */
198
198
  overflow?: 'hidden' | 'scroll' | 'visible' | 'auto';
199
199
  /** The `boxShadow` property adds shadow effects around an element's frame. */
200
- shadow?: keyof SparkTheme['shadow'];
200
+ shadow?: keyof SparkTheme['shadow'] | string | null;
201
201
  /** The `userSelect` property controls whether the user can select text. */
202
202
  userSelect?: 'none';
203
203
  };
204
- export declare type BoxStyleProps = UnresponsiveBoxProps & ResponsiveBoxProps;
204
+ export type BoxStyleProps = UnresponsiveBoxProps & ResponsiveBoxProps;
205
205
  export declare const useBoxStyles: ({ alignItems, alignSelf, background, border, borderTop, borderBottom, borderLeft, borderRight, borderRadius, borderWidth, bottom, cursor, display, flex, flexDirection, flexGrow, flexShrink, flexWrap, gap, height, justifyContent, left, margin, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, minHeight, minWidth, opacity, overflow, padding, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, position, right, shadow, top, userSelect, width, zIndex, }: BoxStyleProps) => import("facepaint").DynamicStyle[];
206
206
  declare const flexMap: {
207
207
  readonly alignItems: {
@@ -1,2 +1,2 @@
1
- export * from "./declarations/src/index";
1
+ export * from "./declarations/src/index.js";
2
2
  //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Bhcmstd2ViLWJveC5janMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4vZGVjbGFyYXRpb25zL3NyYy9pbmRleC5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=
@@ -53,6 +53,10 @@ var BackgroundProvider = function BackgroundProvider(_ref) {
53
53
  return renderBackgroundProvider(type === 'dark' ? 'UNKNOWN_DARK' : 'UNKNOWN_LIGHT', children);
54
54
  };
55
55
 
56
+ function isObjKey(key, obj) {
57
+ return key in obj;
58
+ }
59
+
56
60
  // TODO perf review
57
61
  // TODO: review responsive props! Now that we're using object syntax, un-mapped properties don't behave as expected
58
62
 
@@ -111,9 +115,18 @@ var useBoxStyles = function useBoxStyles(_ref) {
111
115
  width = _ref.width,
112
116
  zIndex = _ref.zIndex;
113
117
  var theme$1 = theme.useTheme();
118
+ var convertShadowValue = function convertShadowValue(shadow) {
119
+ if (!shadow) {
120
+ return undefined;
121
+ }
122
+ if (isObjKey(shadow, theme$1.shadow)) {
123
+ return theme$1.shadow[shadow];
124
+ }
125
+ return shadow;
126
+ };
114
127
  var unresponsiveProps = {
115
128
  background: background ? theme$1.color.background[background] : undefined,
116
- boxShadow: shadow ? theme$1.shadow[shadow] : undefined,
129
+ boxShadow: convertShadowValue(shadow),
117
130
  cursor: cursor,
118
131
  minHeight: minHeight,
119
132
  minWidth: minWidth,
@@ -162,7 +175,7 @@ var useBoxStyles = function useBoxStyles(_ref) {
162
175
  paddingLeft: theme$1.utils.mapResponsiveScale(paddingLeft || paddingX || padding, theme$1.spacing),
163
176
  paddingRight: theme$1.utils.mapResponsiveScale(paddingRight || paddingX || padding, theme$1.spacing),
164
177
  // border
165
- borderRadius: theme$1.utils.mapResponsiveScale(borderRadius, theme$1.border.radius),
178
+ borderRadius: typeof borderRadius === 'number' ? borderRadius : theme$1.utils.mapResponsiveScale(borderRadius, theme$1.border.radius),
166
179
  // flex: parent
167
180
  alignItems: theme$1.utils.mapResponsiveScale(alignItems, flexMap.alignItems),
168
181
  gap: theme$1.utils.mapResponsiveScale(gap, theme$1.spacing),
@@ -53,6 +53,10 @@ var BackgroundProvider = function BackgroundProvider(_ref) {
53
53
  return renderBackgroundProvider(type === 'dark' ? 'UNKNOWN_DARK' : 'UNKNOWN_LIGHT', children);
54
54
  };
55
55
 
56
+ function isObjKey(key, obj) {
57
+ return key in obj;
58
+ }
59
+
56
60
  // TODO perf review
57
61
  // TODO: review responsive props! Now that we're using object syntax, un-mapped properties don't behave as expected
58
62
 
@@ -111,9 +115,18 @@ var useBoxStyles = function useBoxStyles(_ref) {
111
115
  width = _ref.width,
112
116
  zIndex = _ref.zIndex;
113
117
  var theme$1 = theme.useTheme();
118
+ var convertShadowValue = function convertShadowValue(shadow) {
119
+ if (!shadow) {
120
+ return undefined;
121
+ }
122
+ if (isObjKey(shadow, theme$1.shadow)) {
123
+ return theme$1.shadow[shadow];
124
+ }
125
+ return shadow;
126
+ };
114
127
  var unresponsiveProps = {
115
128
  background: background ? theme$1.color.background[background] : undefined,
116
- boxShadow: shadow ? theme$1.shadow[shadow] : undefined,
129
+ boxShadow: convertShadowValue(shadow),
117
130
  cursor: cursor,
118
131
  minHeight: minHeight,
119
132
  minWidth: minWidth,
@@ -162,7 +175,7 @@ var useBoxStyles = function useBoxStyles(_ref) {
162
175
  paddingLeft: theme$1.utils.mapResponsiveScale(paddingLeft || paddingX || padding, theme$1.spacing),
163
176
  paddingRight: theme$1.utils.mapResponsiveScale(paddingRight || paddingX || padding, theme$1.spacing),
164
177
  // border
165
- borderRadius: theme$1.utils.mapResponsiveScale(borderRadius, theme$1.border.radius),
178
+ borderRadius: typeof borderRadius === 'number' ? borderRadius : theme$1.utils.mapResponsiveScale(borderRadius, theme$1.border.radius),
166
179
  // flex: parent
167
180
  alignItems: theme$1.utils.mapResponsiveScale(alignItems, flexMap.alignItems),
168
181
  gap: theme$1.utils.mapResponsiveScale(gap, theme$1.spacing),
@@ -49,6 +49,10 @@ var BackgroundProvider = function BackgroundProvider(_ref) {
49
49
  return renderBackgroundProvider(type === 'dark' ? 'UNKNOWN_DARK' : 'UNKNOWN_LIGHT', children);
50
50
  };
51
51
 
52
+ function isObjKey(key, obj) {
53
+ return key in obj;
54
+ }
55
+
52
56
  // TODO perf review
53
57
  // TODO: review responsive props! Now that we're using object syntax, un-mapped properties don't behave as expected
54
58
 
@@ -107,9 +111,18 @@ var useBoxStyles = function useBoxStyles(_ref) {
107
111
  width = _ref.width,
108
112
  zIndex = _ref.zIndex;
109
113
  var theme = useTheme();
114
+ var convertShadowValue = function convertShadowValue(shadow) {
115
+ if (!shadow) {
116
+ return undefined;
117
+ }
118
+ if (isObjKey(shadow, theme.shadow)) {
119
+ return theme.shadow[shadow];
120
+ }
121
+ return shadow;
122
+ };
110
123
  var unresponsiveProps = {
111
124
  background: background ? theme.color.background[background] : undefined,
112
- boxShadow: shadow ? theme.shadow[shadow] : undefined,
125
+ boxShadow: convertShadowValue(shadow),
113
126
  cursor: cursor,
114
127
  minHeight: minHeight,
115
128
  minWidth: minWidth,
@@ -158,7 +171,7 @@ var useBoxStyles = function useBoxStyles(_ref) {
158
171
  paddingLeft: theme.utils.mapResponsiveScale(paddingLeft || paddingX || padding, theme.spacing),
159
172
  paddingRight: theme.utils.mapResponsiveScale(paddingRight || paddingX || padding, theme.spacing),
160
173
  // border
161
- borderRadius: theme.utils.mapResponsiveScale(borderRadius, theme.border.radius),
174
+ borderRadius: typeof borderRadius === 'number' ? borderRadius : theme.utils.mapResponsiveScale(borderRadius, theme.border.radius),
162
175
  // flex: parent
163
176
  alignItems: theme.utils.mapResponsiveScale(alignItems, flexMap.alignItems),
164
177
  gap: theme.utils.mapResponsiveScale(gap, theme.spacing),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spark-web/box",
3
- "version": "6.0.0-rc.0",
3
+ "version": "6.0.1",
4
4
  "homepage": "https://github.com/brighte-labs/spark-web#readme",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,22 +11,23 @@
11
11
  "module": "dist/spark-web-box.esm.js",
12
12
  "files": [
13
13
  "CHANGELOG.md",
14
+ "CLAUDE.md",
14
15
  "dist",
15
16
  "README.md"
16
17
  ],
17
18
  "dependencies": {
18
19
  "@babel/runtime": "^7.25.0",
19
20
  "@emotion/react": "^11.14.0",
20
- "@spark-web/utils": "^5.1.0-rc.0"
21
+ "@spark-web/utils": "^5.1.0"
21
22
  },
22
23
  "devDependencies": {
23
- "@spark-web/theme": "^5.12.0-rc.0",
24
+ "@spark-web/theme": "^5.13.0",
24
25
  "@types/react": "^19.1.0",
25
26
  "react": "^19.1.0"
26
27
  },
27
28
  "peerDependencies": {
28
- "@spark-web/theme": "^5.12.0-rc.0",
29
- "react": ">=19.1.0"
29
+ "@spark-web/theme": "^5.13.0",
30
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0"
30
31
  },
31
32
  "engines": {
32
33
  "node": ">=14"