@spark-ui/internal-utils 2.3.1 → 5.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 +34 -0
- package/dist/create-split-props/index.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +20 -15
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,40 @@
|
|
|
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
|
+
# 5.0.0 (2024-07-18)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- doc ([5506203](https://github.com/adevinta/spark/commit/55062039dc67c3532be42a4661540052094163d9))
|
|
11
|
+
- force new release to all packages ([d7f5136](https://github.com/adevinta/spark/commit/d7f513698cf48dd9c102fafaeb336096818c6b2b))
|
|
12
|
+
- **internal-utils:** doc ([0014463](https://github.com/adevinta/spark/commit/00144635922cfc8a082a137070a758261e9fa162))
|
|
13
|
+
- **internal-utils:** meta-tags ([c2b0855](https://github.com/adevinta/spark/commit/c2b08556bf583af152c1b59faeb15bb0252ed896))
|
|
14
|
+
- **internal-utils:** props table ([3552bc8](https://github.com/adevinta/spark/commit/3552bc8ec8b7012a2cbdb74317f9fb531e43f585))
|
|
15
|
+
- **internal-utils:** update rollup conf, include ext peerDeps to avoid deps mismatches at call site ([fc4ec83](https://github.com/adevinta/spark/commit/fc4ec8360965735e148316304e1e2cf3c769d2b3))
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
- **icon:** added xl size for icon package ([5fb352a](https://github.com/adevinta/spark/commit/5fb352aae839a4d9e0c642624fcf05126d4ac7e5))
|
|
20
|
+
- **internal-utils:** add basic and accent as available intent values ([2e38632](https://github.com/adevinta/spark/commit/2e3863247c8a6eedd723ad30af623a7d1a8c2f7a))
|
|
21
|
+
- **internal-utils:** add comment ([fde9ab5](https://github.com/adevinta/spark/commit/fde9ab550895a0d362aaf7edb3975bf89560f965))
|
|
22
|
+
- **internal-utils:** add current values and make variants partial ([5b1eb81](https://github.com/adevinta/spark/commit/5b1eb817fcbf1f05143e919fb4d37864828c257c))
|
|
23
|
+
- **internal-utils:** add dashed design to internal utils constants ([e814c5e](https://github.com/adevinta/spark/commit/e814c5e142dd51285e05a88783b135153f03e78d))
|
|
24
|
+
- **internal-utils:** add deepFind internal util ([597d534](https://github.com/adevinta/spark/commit/597d53412aeac6fcb5cdf890ba6c1f86e4f540c9))
|
|
25
|
+
- **internal-utils:** add new createSplitProps util ([7e6827a](https://github.com/adevinta/spark/commit/7e6827a7ee556edb1288b38a7eb1a6bd033b9816))
|
|
26
|
+
- **internal-utils:** add variants folder ([c286382](https://github.com/adevinta/spark/commit/c28638297833ce50db909e1d43bdfd94bdb92ab8))
|
|
27
|
+
- **internal-utils:** clean up code (variants folder) ([9f62a0f](https://github.com/adevinta/spark/commit/9f62a0f876d37c4962704c107eb0567bef2eeb1c))
|
|
28
|
+
- **internal-utils:** create internal-utils package ([d24e079](https://github.com/adevinta/spark/commit/d24e0799908f3342ac745b4ae10a6452cbccb914)), closes [#497](https://github.com/adevinta/spark/issues/497)
|
|
29
|
+
- **internal-utils:** doc ([a25de3f](https://github.com/adevinta/spark/commit/a25de3ffcb2c83eef835cd42e9811a5f17f88cd6))
|
|
30
|
+
- **internal-utils:** make package publicly accessible on npm ([db002a9](https://github.com/adevinta/spark/commit/db002a9a779f36fd0cdb21117f2c9f9ef66c3c25))
|
|
31
|
+
- **internal-utils:** replace "primary", "secondary" intents with "main" & "support" ([b737a14](https://github.com/adevinta/spark/commit/b737a143c595e033a3b52b0f1b9a1eac496bf6bd))
|
|
32
|
+
- set inner deps as latest ([bb1180a](https://github.com/adevinta/spark/commit/bb1180abc8a112b12a65108e53df5f3a6481659f))
|
|
33
|
+
|
|
34
|
+
# [2.4.0](https://github.com/adevinta/spark/compare/@spark-ui/internal-utils@2.3.1...@spark-ui/internal-utils@2.4.0) (2024-06-15)
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
- **internal-utils:** add new createSplitProps util ([7e6827a](https://github.com/adevinta/spark/commit/7e6827a7ee556edb1288b38a7eb1a6bd033b9816))
|
|
39
|
+
|
|
6
40
|
## [2.3.1](https://github.com/adevinta/spark/compare/@spark-ui/internal-utils@2.3.0...@spark-ui/internal-utils@2.3.1) (2024-05-30)
|
|
7
41
|
|
|
8
42
|
### Bug Fixes
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
type EnsureKeys<ExpectedKeys extends (keyof Target)[], Target> = keyof Target extends ExpectedKeys[number] ? unknown : `Missing required keys: ${Exclude<keyof Target, ExpectedKeys[number]> & string}`;
|
|
2
|
+
export declare const createSplitProps: <Target>() => <Keys extends (keyof Target)[], Props extends Target = Target>(props: Props, keys: Keys & EnsureKeys<Keys, Target>) => [Target, Omit<Props, Extract<(Keys & EnsureKeys<Keys, Target>)[number], string>>];
|
|
3
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export { makeVariants } from './variants';
|
|
|
3
3
|
export * as VariantTypes from './variants/types';
|
|
4
4
|
export * as variantConstants from './variants/constants';
|
|
5
5
|
export { deepFind } from './react-children-utilities/deepFind';
|
|
6
|
+
export { createSplitProps } from './create-split-props';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),a=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),d=Object.freeze(Object.defineProperty({__proto__:null,designs:["filled","outlined","tinted","ghost","contrast","dashed"],intents:["current","main","support","success","error","info","alert","danger","neutral","surface","accent","basic"],shapes:["rounded","square","pill"],sizes:["current","sm","md","lg","xl"]},Symbol.toStringTag,{value:"Module"}));function u(e){return s.isValidElement(e)&&function(r){return s.isValidElement(r)&&!!r.props.children}(e)&&s.Children.toArray(e.props.children).reduce((r,t)=>r||s.isValidElement(t),!1)}exports.VariantTypes=a,exports.createSplitProps=()=>(e,r)=>r.reduce((t,i)=>{const[n,o]=t,l=i;return o[l]!==void 0&&(n[l]=o[l]),delete o[l],[n,o]},[{},{...e}]),exports.deepFind=function e(r,t){let i;return s.Children.toArray(r).find((n,o,l)=>t(n,o,l)?(i=n,!0):!(!s.isValidElement(n)||!u(n))&&(i=e(n.props.children,t),i!==void 0)),i},exports.makeVariants=function(e){return e},exports.tw=function(e){return e},exports.variantConstants=d;
|
package/dist/index.mjs
CHANGED
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
import { isValidElement as
|
|
2
|
-
function
|
|
1
|
+
import { isValidElement as i, Children as l } from "react";
|
|
2
|
+
function p(e) {
|
|
3
3
|
return e;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function f(e) {
|
|
6
6
|
return e;
|
|
7
7
|
}
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
return
|
|
11
|
-
return
|
|
12
|
-
}(e) &&
|
|
8
|
+
const m = Object.freeze(Object.defineProperty({ __proto__: null }, Symbol.toStringTag, { value: "Module" })), g = Object.freeze(Object.defineProperty({ __proto__: null, designs: ["filled", "outlined", "tinted", "ghost", "contrast", "dashed"], intents: ["current", "main", "support", "success", "error", "info", "alert", "danger", "neutral", "surface", "accent", "basic"], shapes: ["rounded", "square", "pill"], sizes: ["current", "sm", "md", "lg", "xl"] }, Symbol.toStringTag, { value: "Module" }));
|
|
9
|
+
function u(e) {
|
|
10
|
+
return i(e) && function(t) {
|
|
11
|
+
return i(t) && !!t.props.children;
|
|
12
|
+
}(e) && l.toArray(e.props.children).reduce((t, r) => t || i(r), !1);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function c(e, t) {
|
|
15
15
|
let r;
|
|
16
|
-
return
|
|
16
|
+
return l.toArray(e).find((n, s, o) => t(n, s, o) ? (r = n, !0) : !(!i(n) || !u(n)) && (r = c(n.props.children, t), r !== void 0)), r;
|
|
17
17
|
}
|
|
18
|
+
const _ = () => (e, t) => t.reduce((r, n) => {
|
|
19
|
+
const [s, o] = r, a = n;
|
|
20
|
+
return o[a] !== void 0 && (s[a] = o[a]), delete o[a], [s, o];
|
|
21
|
+
}, [{}, { ...e }]);
|
|
18
22
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
m as VariantTypes,
|
|
24
|
+
_ as createSplitProps,
|
|
25
|
+
c as deepFind,
|
|
26
|
+
f as makeVariants,
|
|
27
|
+
p as tw,
|
|
28
|
+
g as variantConstants
|
|
24
29
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spark-ui/internal-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "package for sharing reusable code and resources across the codebase",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://sparkui.vercel.app",
|
|
36
36
|
"license": "MIT",
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "cda68c4d65aa3f6f1bd4c47c42e8e72aadb263fd"
|
|
38
38
|
}
|