Socket
Socket
Sign inDemoInstall

@zag-js/anatomy

Package Overview
Dependencies
Maintainers
1
Versions
674
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zag-js/anatomy - npm Package Compare versions

Comparing version 0.0.0-dev-20230601120732 to 0.0.0-dev-20230605130234

12

dist/create-anatomy.d.ts

@@ -1,8 +0,8 @@

interface AnatomyPart {
export interface AnatomyPart {
selector: string;
attrs: Record<"data-scope" | "data-part", string>;
}
type AnatomyInstance<T extends string> = Omit<Anatomy<T>, "parts">;
type AnatomyPartName<T> = T extends AnatomyInstance<infer U> ? U : never;
interface Anatomy<T extends string> {
export type AnatomyInstance<T extends string> = Omit<Anatomy<T>, "parts">;
export type AnatomyPartName<T> = T extends AnatomyInstance<infer U> ? U : never;
export interface Anatomy<T extends string> {
parts: <U extends string>(...parts: U[]) => AnatomyInstance<U>;

@@ -14,4 +14,2 @@ extendWith: <V extends string>(...parts: V[]) => AnatomyInstance<T | V>;

}
declare const createAnatomy: <T extends string>(name: string, parts?: T[]) => Anatomy<T>;
export { Anatomy, AnatomyInstance, AnatomyPart, AnatomyPartName, createAnatomy };
export declare const createAnatomy: <T extends string>(name: string, parts?: T[]) => Anatomy<T>;

@@ -1,27 +0,6 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/create-anatomy.ts
var create_anatomy_exports = {};
__export(create_anatomy_exports, {
createAnatomy: () => createAnatomy
});
module.exports = __toCommonJS(create_anatomy_exports);
var createAnatomy = (name, parts = []) => ({
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const createAnatomy = (name, parts = []) => ({
parts: (...values) => {

@@ -49,7 +28,5 @@ if (isEmpty(parts)) {

});
var toKebabCase = (value) => value.replace(/([A-Z])([A-Z])/g, "$1-$2").replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
var isEmpty = (v) => v.length === 0;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
createAnatomy
});
const toKebabCase = (value) => value.replace(/([A-Z])([A-Z])/g, "$1-$2").replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
const isEmpty = (v) => v.length === 0;
exports.createAnatomy = createAnatomy;

@@ -1,1 +0,2 @@

export { Anatomy, AnatomyInstance, AnatomyPart, AnatomyPartName, createAnatomy } from './create-anatomy.js';
export { createAnatomy } from "./create-anatomy";
export type { Anatomy, AnatomyPart, AnatomyInstance, AnatomyPartName } from "./create-anatomy";

@@ -1,56 +0,9 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/index.ts
var src_exports = {};
__export(src_exports, {
createAnatomy: () => createAnatomy
});
module.exports = __toCommonJS(src_exports);
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
// src/create-anatomy.ts
var createAnatomy = (name, parts = []) => ({
parts: (...values) => {
if (isEmpty(parts)) {
return createAnatomy(name, values);
}
throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?");
},
extendWith: (...values) => createAnatomy(name, [...parts, ...values]),
rename: (newName) => createAnatomy(newName, parts),
keys: () => parts,
build: () => [...new Set(parts)].reduce(
(prev, part) => Object.assign(prev, {
[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) }
}
}),
{}
)
});
var toKebabCase = (value) => value.replace(/([A-Z])([A-Z])/g, "$1-$2").replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
var isEmpty = (v) => v.length === 0;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
createAnatomy
});
const createAnatomy = require('./create-anatomy.js');
exports.createAnatomy = createAnatomy.createAnatomy;
{
"name": "@zag-js/anatomy",
"version": "0.0.0-dev-20230601120732",
"version": "0.0.0-dev-20230605130234",
"keywords": [

@@ -43,11 +43,7 @@ "ui-machines",

"scripts": {
"build-fast": "tsup src",
"start": "pnpm build --watch",
"build": "tsup src --dts",
"build": "vite build -c ../../vite.config.ts",
"test": "jest --config ../../jest.config.js --rootDir . --passWithNoTests",
"lint": "eslint src --ext .ts,.tsx",
"test-ci": "pnpm test --ci --runInBand",
"test-watch": "pnpm test --watch -u",
"typecheck": "tsc --noEmit"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc