@spark-ui/divider 7.3.6 → 8.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
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [8.0.0](https://github.com/adevinta/spark/compare/v7.3.7...v8.0.0) (2025-01-13)
7
+
8
+ ### Code Refactoring
9
+
10
+ - fixing remaining TS errors ([918544c](https://github.com/adevinta/spark/commit/918544c278a370ec82384842cc8f60b59982eb9f))
11
+
12
+ ### BREAKING CHANGES
13
+
14
+ - forwardRef has been removed from all packages
15
+
16
+ ## [7.3.7](https://github.com/adevinta/spark/compare/v7.3.6...v7.3.7) (2025-01-08)
17
+
18
+ **Note:** Version bump only for package @spark-ui/divider
19
+
6
20
  ## [7.3.6](https://github.com/adevinta/spark/compare/v7.3.5...v7.3.6) (2025-01-08)
7
21
 
8
22
  ### Bug Fixes
package/dist/Divider.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { HTMLAttributes, PropsWithRef, ReactElement } from 'react';
1
+ import { HTMLAttributes, ReactElement, Ref } from 'react';
2
2
  import { type DividerStylesProps } from './Divider.styles';
3
- export interface DividerProps extends PropsWithRef<HTMLAttributes<HTMLDivElement>>, Omit<DividerStylesProps, 'isEmpty'> {
3
+ export interface DividerProps extends HTMLAttributes<HTMLDivElement>, Omit<DividerStylesProps, 'isEmpty'> {
4
4
  /**
5
5
  * Change the component to the HTML tag or custom component of the only child.
6
6
  */
@@ -22,5 +22,9 @@ export interface DividerProps extends PropsWithRef<HTMLAttributes<HTMLDivElement
22
22
  * Color scheme of the divider.
23
23
  */
24
24
  intent?: 'outline' | 'current';
25
+ ref?: Ref<HTMLDivElement>;
25
26
  }
26
- export declare const Divider: import("react").ForwardRefExoticComponent<DividerProps & import("react").RefAttributes<HTMLDivElement>>;
27
+ export declare const Divider: {
28
+ ({ asChild, className, isDecorative, children, orientation, alignment, intent, ref, ...props }: DividerProps): import("react").JSX.Element;
29
+ displayName: string;
30
+ };
@@ -1,9 +1,13 @@
1
- import { HTMLAttributes, PropsWithRef, ReactNode } from 'react';
2
- export interface DividerContentProps extends PropsWithRef<HTMLAttributes<HTMLSpanElement>> {
1
+ import { HTMLAttributes, ReactNode, Ref } from 'react';
2
+ export interface DividerContentProps extends HTMLAttributes<HTMLSpanElement> {
3
3
  /**
4
4
  * Change the component to the HTML tag or custom component of the only child.
5
5
  */
6
6
  asChild?: boolean;
7
7
  children?: ReactNode;
8
+ ref?: Ref<HTMLSpanElement>;
8
9
  }
9
- export declare const DividerContent: import("react").ForwardRefExoticComponent<DividerContentProps & import("react").RefAttributes<HTMLSpanElement>>;
10
+ export declare const DividerContent: {
11
+ ({ children, ref, ...props }: DividerContentProps): import("react").JSX.Element | null;
12
+ displayName: string;
13
+ };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),g=require("@radix-ui/react-separator"),l=require("class-variance-authority"),e=require("@spark-ui/internal-utils"),u=[{intent:"current",isEmpty:!0,class:e.tw(["border-current"])},{intent:"current",isEmpty:!1,class:e.tw(["before:border-current after:border-current"])},{intent:"outline",isEmpty:!0,class:e.tw(["border-outline"])},{intent:"outline",isEmpty:!1,class:e.tw(["before:border-outline after:border-outline"])}],p=l.cva(["overflow-hidden"],{variants:{isEmpty:{true:["border-solid"],false:["inline-flex items-center","after:border-solid before:border-solid"]},orientation:{vertical:["w-fit inline-flex"],horizontal:["w-full"]},alignment:{start:[],end:[],center:[]},intent:{current:[],outline:[]}},defaultVariants:{orientation:"horizontal",alignment:"center",intent:"outline"},compoundVariants:[{isEmpty:!0,orientation:"horizontal",class:e.tw(["my-lg border-t-sm"])},{isEmpty:!0,orientation:"vertical",class:e.tw(["mx-lg min-h-sz-24 border-l-sm"])},{isEmpty:!1,orientation:"horizontal",class:e.tw(["flex-row my-sm grow-0","before:border-t-sm","after:border-t-sm","[&>*]:px-lg"])},{isEmpty:!1,orientation:"vertical",class:e.tw(["flex-col mx-sm","before:border-l-sm","after:border-l-sm","[&>*]:py-lg"])},{isEmpty:!1,orientation:"horizontal",alignment:"end",class:e.tw(["after:w-sz-40 before:grow after:grow-0"])},{isEmpty:!1,orientation:"horizontal",alignment:"start",class:e.tw(["before:w-sz-40 before:grow-0 after:grow"])},{isEmpty:!1,orientation:"horizontal",alignment:"center",class:e.tw(["justify-center before:grow after:grow"])},{isEmpty:!1,orientation:"vertical",alignment:"end",class:e.tw(["after:h-sz-40 before:grow after:grow-0 before:min-h-sz-40"])},{isEmpty:!1,orientation:"vertical",alignment:"start",class:e.tw(["before:h-sz-40 before:grow-0 after:grow after:min-h-sz-40"])},{isEmpty:!1,orientation:"vertical",alignment:"center",class:e.tw(["justify-center before:grow after:grow before:min-h-sz-40 after:min-h-sz-40"])},...u]}),y=r.forwardRef(({asChild:t,className:n,isDecorative:i=!1,children:o,orientation:s="horizontal",alignment:m="center",intent:f="outline",...d},w)=>{const b=t?!o?.props?.children:!o;return r.createElement(g.Root,{"data-spark-component":"divider",asChild:t,className:l.cx(p({isEmpty:b,orientation:s,alignment:m,intent:f}),n),orientation:s,ref:w,decorative:i,...d},o)}),c=r.forwardRef(({children:t,...n},i)=>t?r.createElement("span",{ref:i,...n},t):null);c.displayName="Divider.Content";const a=Object.assign(y,{Content:c});a.displayName="Divider",a.Content.displayName="Divider.Content",exports.Divider=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),p=require("@radix-ui/react-separator"),l=require("class-variance-authority"),e=require("@spark-ui/internal-utils"),u=[{intent:"current",isEmpty:!0,class:e.tw(["border-current"])},{intent:"current",isEmpty:!1,class:e.tw(["before:border-current after:border-current"])},{intent:"outline",isEmpty:!0,class:e.tw(["border-outline"])},{intent:"outline",isEmpty:!1,class:e.tw(["before:border-outline after:border-outline"])}],y=l.cva(["overflow-hidden"],{variants:{isEmpty:{true:["border-solid"],false:["inline-flex items-center","after:border-solid before:border-solid"]},orientation:{vertical:["w-fit inline-flex"],horizontal:["w-full"]},alignment:{start:[],end:[],center:[]},intent:{current:[],outline:[]}},defaultVariants:{orientation:"horizontal",alignment:"center",intent:"outline"},compoundVariants:[{isEmpty:!0,orientation:"horizontal",class:e.tw(["my-lg border-t-sm"])},{isEmpty:!0,orientation:"vertical",class:e.tw(["mx-lg min-h-sz-24 border-l-sm"])},{isEmpty:!1,orientation:"horizontal",class:e.tw(["flex-row my-sm grow-0","before:border-t-sm","after:border-t-sm","[&>*]:px-lg"])},{isEmpty:!1,orientation:"vertical",class:e.tw(["flex-col mx-sm","before:border-l-sm","after:border-l-sm","[&>*]:py-lg"])},{isEmpty:!1,orientation:"horizontal",alignment:"end",class:e.tw(["after:w-sz-40 before:grow after:grow-0"])},{isEmpty:!1,orientation:"horizontal",alignment:"start",class:e.tw(["before:w-sz-40 before:grow-0 after:grow"])},{isEmpty:!1,orientation:"horizontal",alignment:"center",class:e.tw(["justify-center before:grow after:grow"])},{isEmpty:!1,orientation:"vertical",alignment:"end",class:e.tw(["after:h-sz-40 before:grow after:grow-0 before:min-h-sz-40"])},{isEmpty:!1,orientation:"vertical",alignment:"start",class:e.tw(["before:h-sz-40 before:grow-0 after:grow after:min-h-sz-40"])},{isEmpty:!1,orientation:"vertical",alignment:"center",class:e.tw(["justify-center before:grow after:grow before:min-h-sz-40 after:min-h-sz-40"])},...u]}),c=({asChild:t,className:r,isDecorative:n=!1,children:i,orientation:a="horizontal",alignment:f="center",intent:d="outline",ref:b,...w})=>{const g=t?!i?.props?.children:!i;return s.createElement(p.Root,{"data-spark-component":"divider",asChild:t,className:l.cx(y({isEmpty:g,orientation:a,alignment:f,intent:d}),r),orientation:a,ref:b,decorative:n,...w},i)};c.displayName="Divider";const m=({children:t,ref:r,...n})=>t?s.createElement("span",{ref:r,...n},t):null;m.displayName="Divider.Content";const o=Object.assign(c,{Content:m});o.displayName="Divider",o.Content.displayName="Divider.Content",exports.Divider=o;
package/dist/index.mjs CHANGED
@@ -1,13 +1,15 @@
1
- import s, { forwardRef as l } from "react";
1
+ import s from "react";
2
2
  import { Root as g } from "@radix-ui/react-separator";
3
3
  import { cva as y, cx as u } from "class-variance-authority";
4
4
  import { tw as e } from "@spark-ui/internal-utils";
5
- const h = [{ intent: "current", isEmpty: !0, class: e(["border-current"]) }, { intent: "current", isEmpty: !1, class: e(["before:border-current after:border-current"]) }, { intent: "outline", isEmpty: !0, class: e(["border-outline"]) }, { intent: "outline", isEmpty: !1, class: e(["before:border-outline after:border-outline"]) }], w = y(["overflow-hidden"], { variants: { isEmpty: { true: ["border-solid"], false: ["inline-flex items-center", "after:border-solid before:border-solid"] }, orientation: { vertical: ["w-fit inline-flex"], horizontal: ["w-full"] }, alignment: { start: [], end: [], center: [] }, intent: { current: [], outline: [] } }, defaultVariants: { orientation: "horizontal", alignment: "center", intent: "outline" }, compoundVariants: [{ isEmpty: !0, orientation: "horizontal", class: e(["my-lg border-t-sm"]) }, { isEmpty: !0, orientation: "vertical", class: e(["mx-lg min-h-sz-24 border-l-sm"]) }, { isEmpty: !1, orientation: "horizontal", class: e(["flex-row my-sm grow-0", "before:border-t-sm", "after:border-t-sm", "[&>*]:px-lg"]) }, { isEmpty: !1, orientation: "vertical", class: e(["flex-col mx-sm", "before:border-l-sm", "after:border-l-sm", "[&>*]:py-lg"]) }, { isEmpty: !1, orientation: "horizontal", alignment: "end", class: e(["after:w-sz-40 before:grow after:grow-0"]) }, { isEmpty: !1, orientation: "horizontal", alignment: "start", class: e(["before:w-sz-40 before:grow-0 after:grow"]) }, { isEmpty: !1, orientation: "horizontal", alignment: "center", class: e(["justify-center before:grow after:grow"]) }, { isEmpty: !1, orientation: "vertical", alignment: "end", class: e(["after:h-sz-40 before:grow after:grow-0 before:min-h-sz-40"]) }, { isEmpty: !1, orientation: "vertical", alignment: "start", class: e(["before:h-sz-40 before:grow-0 after:grow after:min-h-sz-40"]) }, { isEmpty: !1, orientation: "vertical", alignment: "center", class: e(["justify-center before:grow after:grow before:min-h-sz-40 after:min-h-sz-40"]) }, ...h] }), E = l(({ asChild: t, className: r, isDecorative: n = !1, children: i, orientation: o = "horizontal", alignment: c = "center", intent: f = "outline", ...d }, p) => {
5
+ const h = [{ intent: "current", isEmpty: !0, class: e(["border-current"]) }, { intent: "current", isEmpty: !1, class: e(["before:border-current after:border-current"]) }, { intent: "outline", isEmpty: !0, class: e(["border-outline"]) }, { intent: "outline", isEmpty: !1, class: e(["before:border-outline after:border-outline"]) }], w = y(["overflow-hidden"], { variants: { isEmpty: { true: ["border-solid"], false: ["inline-flex items-center", "after:border-solid before:border-solid"] }, orientation: { vertical: ["w-fit inline-flex"], horizontal: ["w-full"] }, alignment: { start: [], end: [], center: [] }, intent: { current: [], outline: [] } }, defaultVariants: { orientation: "horizontal", alignment: "center", intent: "outline" }, compoundVariants: [{ isEmpty: !0, orientation: "horizontal", class: e(["my-lg border-t-sm"]) }, { isEmpty: !0, orientation: "vertical", class: e(["mx-lg min-h-sz-24 border-l-sm"]) }, { isEmpty: !1, orientation: "horizontal", class: e(["flex-row my-sm grow-0", "before:border-t-sm", "after:border-t-sm", "[&>*]:px-lg"]) }, { isEmpty: !1, orientation: "vertical", class: e(["flex-col mx-sm", "before:border-l-sm", "after:border-l-sm", "[&>*]:py-lg"]) }, { isEmpty: !1, orientation: "horizontal", alignment: "end", class: e(["after:w-sz-40 before:grow after:grow-0"]) }, { isEmpty: !1, orientation: "horizontal", alignment: "start", class: e(["before:w-sz-40 before:grow-0 after:grow"]) }, { isEmpty: !1, orientation: "horizontal", alignment: "center", class: e(["justify-center before:grow after:grow"]) }, { isEmpty: !1, orientation: "vertical", alignment: "end", class: e(["after:h-sz-40 before:grow after:grow-0 before:min-h-sz-40"]) }, { isEmpty: !1, orientation: "vertical", alignment: "start", class: e(["before:h-sz-40 before:grow-0 after:grow after:min-h-sz-40"]) }, { isEmpty: !1, orientation: "vertical", alignment: "center", class: e(["justify-center before:grow after:grow before:min-h-sz-40 after:min-h-sz-40"]) }, ...h] }), l = ({ asChild: t, className: r, isDecorative: n = !1, children: i, orientation: o = "horizontal", alignment: c = "center", intent: f = "outline", ref: d, ...p }) => {
6
6
  const b = t ? !i?.props?.children : !i;
7
- return s.createElement(g, { "data-spark-component": "divider", asChild: t, className: u(w({ isEmpty: b, orientation: o, alignment: c, intent: f }), r), orientation: o, ref: p, decorative: n, ...d }, i);
8
- }), m = l(({ children: t, ...r }, n) => t ? s.createElement("span", { ref: n, ...r }, t) : null);
7
+ return s.createElement(g, { "data-spark-component": "divider", asChild: t, className: u(w({ isEmpty: b, orientation: o, alignment: c, intent: f }), r), orientation: o, ref: d, decorative: n, ...p }, i);
8
+ };
9
+ l.displayName = "Divider";
10
+ const m = ({ children: t, ref: r, ...n }) => t ? s.createElement("span", { ref: r, ...n }, t) : null;
9
11
  m.displayName = "Divider.Content";
10
- const a = Object.assign(E, { Content: m });
12
+ const a = Object.assign(l, { Content: m });
11
13
  a.displayName = "Divider", a.Content.displayName = "Divider.Content";
12
14
  export {
13
15
  a as Divider
@@ -129,6 +129,25 @@
129
129
  }
130
130
  ]
131
131
  }
132
+ },
133
+ "ref": {
134
+ "defaultValue": null,
135
+ "description": "",
136
+ "name": "ref",
137
+ "parent": {
138
+ "fileName": "divider/src/Divider.tsx",
139
+ "name": "DividerProps"
140
+ },
141
+ "declarations": [
142
+ {
143
+ "fileName": "divider/src/Divider.tsx",
144
+ "name": "DividerProps"
145
+ }
146
+ ],
147
+ "required": false,
148
+ "type": {
149
+ "name": "Ref<HTMLDivElement>"
150
+ }
132
151
  }
133
152
  }
134
153
  },
@@ -156,6 +175,25 @@
156
175
  "type": {
157
176
  "name": "boolean"
158
177
  }
178
+ },
179
+ "ref": {
180
+ "defaultValue": null,
181
+ "description": "",
182
+ "name": "ref",
183
+ "parent": {
184
+ "fileName": "divider/src/DividerContent.tsx",
185
+ "name": "DividerContentProps"
186
+ },
187
+ "declarations": [
188
+ {
189
+ "fileName": "divider/src/DividerContent.tsx",
190
+ "name": "DividerContentProps"
191
+ }
192
+ ],
193
+ "required": false,
194
+ "type": {
195
+ "name": "Ref<HTMLSpanElement>"
196
+ }
159
197
  }
160
198
  }
161
199
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spark-ui/divider",
3
- "version": "7.3.6",
3
+ "version": "8.0.0",
4
4
  "description": "A separator between two elements, usually consisting of a horizontal line.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@radix-ui/react-separator": "1.1.0",
27
- "@spark-ui/internal-utils": "^7.3.6"
27
+ "@spark-ui/internal-utils": "^8.0.0"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "react": "^19.0",
@@ -45,5 +45,5 @@
45
45
  },
46
46
  "homepage": "https://sparkui.vercel.app",
47
47
  "license": "MIT",
48
- "gitHead": "969983868f32c57cf6d6ffc838de66b51fa4163d"
48
+ "gitHead": "309903aa55f44ebd43d2a1fe43691f110a5036ea"
49
49
  }