@spark-web/box 5.2.2 → 6.0.0

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,20 @@
1
1
  # @spark-web/box
2
2
 
3
+ ## 6.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#667](https://github.com/brighte-labs/spark-web/pull/667)
8
+ [`80d9c15`](https://github.com/brighte-labs/spark-web/commit/80d9c156a40bbcd2b1a91a2d0403b3c8e9b47b4e)
9
+ Thanks [@Leo704099](https://github.com/Leo704099)! - Support react 17 to 19
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+ [[`80d9c15`](https://github.com/brighte-labs/spark-web/commit/80d9c156a40bbcd2b1a91a2d0403b3c8e9b47b4e)]:
15
+ - @spark-web/theme@5.13.0
16
+ - @spark-web/utils@5.1.0
17
+
3
18
  ## 5.2.2
4
19
 
5
20
  ### Patch Changes
@@ -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
24
  ref?: import("react").Ref<Comp extends "symbol" | "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" | "text" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap ? (HTMLElementTagNameMap & Pick<SVGElementTagNameMap, "symbol" | "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" | "text" | "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" | "scroll" | "auto" | "visible" | undefined;
47
- shadow?: string | null | 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.
@@ -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
  /**
@@ -201,7 +201,7 @@ declare type UnresponsiveBoxProps = {
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=
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spark-web/box",
3
- "version": "5.2.2",
3
+ "version": "6.0.0",
4
4
  "homepage": "https://github.com/brighte-labs/spark-web#readme",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,16 +17,16 @@
17
17
  "dependencies": {
18
18
  "@babel/runtime": "^7.25.0",
19
19
  "@emotion/react": "^11.14.0",
20
- "@spark-web/utils": "^5.0.0"
20
+ "@spark-web/utils": "^5.1.0"
21
21
  },
22
22
  "devDependencies": {
23
- "@spark-web/theme": "^5.12.1",
24
- "@types/react": "^18.2.0",
25
- "react": "^18.2.0"
23
+ "@spark-web/theme": "^5.13.0",
24
+ "@types/react": "^19.1.0",
25
+ "react": "^19.1.0"
26
26
  },
27
27
  "peerDependencies": {
28
- "@spark-web/theme": "^5.12.1",
29
- "react": ">=17.0.2"
28
+ "@spark-web/theme": "^5.13.0",
29
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0"
30
30
  },
31
31
  "engines": {
32
32
  "node": ">=14"