@zag-js/anatomy
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -1,12 +0,1 @@ | ||
type Part = { | ||
selector: string; | ||
attrs: Record<"data-scope" | "data-part", string>; | ||
}; | ||
type Anatomy<T extends string> = { | ||
parts: <U extends string>(...parts: U[]) => Omit<Anatomy<U>, "parts">; | ||
extendWith: <V extends string>(...parts: V[]) => Omit<Anatomy<T | V>, "parts">; | ||
build: () => Record<T, Part>; | ||
}; | ||
declare const createAnatomy: <T extends string>(name: string, parts?: T[]) => Anatomy<T>; | ||
export { createAnatomy }; | ||
export { Anatomy, AnatomyInstance, AnatomyPart, AnatomyPartName, createAnatomy } from './create-anatomy.js'; |
@@ -33,3 +33,3 @@ "use strict"; | ||
} | ||
throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extend(...) ?"); | ||
throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?"); | ||
}, | ||
@@ -40,3 +40,6 @@ extendWith: (...values) => createAnatomy(name, [...parts, ...values]), | ||
[part]: { | ||
selector: `[data-scope="${toKebabCase(name)}"][data-part="${toKebabCase(part)}"]`, | ||
selector: [ | ||
`&[data-scope="${toKebabCase(name)}"][data-part="${toKebabCase(part)}"]`, | ||
`& [data-scope="${toKebabCase(name)}"][data-part="${toKebabCase(part)}"]` | ||
].join(", "), | ||
attrs: { "data-scope": toKebabCase(name), "data-part": toKebabCase(part) } | ||
@@ -43,0 +46,0 @@ } |
{ | ||
"name": "@zag-js/anatomy", | ||
"version": "0.1.2", | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"version": "0.1.3", | ||
"keywords": [ | ||
@@ -29,6 +26,21 @@ "ui-machines", | ||
}, | ||
"clean-package": "../../clean-package.config.json", | ||
"main": "dist/index.js", | ||
"devDependencies": { | ||
"clean-package": "2.2.0" | ||
}, | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"scripts": { | ||
"build-fast": "tsup src/index.ts --format=esm,cjs", | ||
"build-fast": "tsup src", | ||
"start": "pnpm build --watch", | ||
"build": "tsup src/index.ts --format=esm,cjs --dts", | ||
"build": "tsup src --dts", | ||
"test": "jest --config ../../jest.config.js --rootDir . --passWithNoTests", | ||
@@ -35,0 +47,0 @@ "lint": "eslint src --ext .ts,.tsx", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16694
12
390
1
1