singularity-components 0.1.5 → 0.1.6

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.
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "default" | "secondary" | "destructive" | "outline" | null | undefined;
5
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
6
+ export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
7
+ }
8
+ declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
9
+ export { Badge, badgeVariants };
@@ -0,0 +1,34 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import * as React from "react";
13
+ import { cva } from "class-variance-authority";
14
+ import { cn } from "lib/utils";
15
+ // import { cn } from "@/lib/utils"
16
+ var badgeVariants = cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
17
+ variants: {
18
+ variant: {
19
+ default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
20
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
21
+ destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
22
+ outline: "text-foreground",
23
+ },
24
+ },
25
+ defaultVariants: {
26
+ variant: "default",
27
+ },
28
+ });
29
+ function Badge(_a) {
30
+ var className = _a.className, variant = _a.variant, props = __rest(_a, ["className", "variant"]);
31
+ return (<div className={cn(badgeVariants({ variant: variant }), className)} {...props}/>);
32
+ }
33
+ export { Badge, badgeVariants };
34
+ //# sourceMappingURL=badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.js","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAE/B,mCAAmC;AAEnC,IAAM,aAAa,GAAG,GAAG,CACvB,sKAAsK,EACtK;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EACL,kFAAkF;YACpF,SAAS,EACP,iFAAiF;YACnF,WAAW,EACT,8FAA8F;YAChG,OAAO,EAAE,iBAAiB;SAC3B;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;KACnB;CACF,CACF,CAAC;AAMF,SAAS,KAAK,CAAC,EAA4C;IAA1C,IAAA,SAAS,eAAA,EAAE,OAAO,aAAA,EAAK,KAAK,cAA9B,wBAAgC,CAAF;IAC3C,OAAO,CACL,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,SAAA,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,EAAG,CACzE,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
@@ -1,3 +1,2 @@
1
- import { Badge } from "components/ui/badge";
2
-
3
- export { Badge };
1
+ import { Badge } from "components/ui/badge";
2
+ export { Badge };
@@ -0,0 +1,3 @@
1
+ import { Badge } from "components/ui/badge";
2
+ export { Badge };
3
+ //# sourceMappingURL=exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.js","sourceRoot":"","sources":["../src/exports.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Badge } from "components/ui/badge";
2
+ export { Badge };
3
+ export declare const sayHello: (name: string) => string;
package/dist/index.js ADDED
@@ -0,0 +1,83 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var classVarianceAuthority = require('class-variance-authority');
5
+ var clsx = require('clsx');
6
+ var tailwindMerge = require('tailwind-merge');
7
+
8
+ /******************************************************************************
9
+ Copyright (c) Microsoft Corporation.
10
+
11
+ Permission to use, copy, modify, and/or distribute this software for any
12
+ purpose with or without fee is hereby granted.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
15
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
17
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
18
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20
+ PERFORMANCE OF THIS SOFTWARE.
21
+ ***************************************************************************** */
22
+
23
+ var __assign = function() {
24
+ __assign = Object.assign || function __assign(t) {
25
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
26
+ s = arguments[i];
27
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
28
+ }
29
+ return t;
30
+ };
31
+ return __assign.apply(this, arguments);
32
+ };
33
+
34
+ function __rest(s, e) {
35
+ var t = {};
36
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
37
+ t[p] = s[p];
38
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
39
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
40
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
41
+ t[p[i]] = s[p[i]];
42
+ }
43
+ return t;
44
+ }
45
+
46
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
47
+ var e = new Error(message);
48
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
49
+ };
50
+
51
+ function cn() {
52
+ var inputs = [];
53
+ for (var _i = 0; _i < arguments.length; _i++) {
54
+ inputs[_i] = arguments[_i];
55
+ }
56
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
57
+ }
58
+
59
+ // import { cn } from "@/lib/utils"
60
+ var badgeVariants = classVarianceAuthority.cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
61
+ variants: {
62
+ variant: {
63
+ default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
64
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
65
+ destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
66
+ outline: "text-foreground",
67
+ },
68
+ },
69
+ defaultVariants: {
70
+ variant: "default",
71
+ },
72
+ });
73
+ function Badge(_a) {
74
+ var className = _a.className, variant = _a.variant, props = __rest(_a, ["className", "variant"]);
75
+ return (jsxRuntime.jsx("div", __assign({ className: cn(badgeVariants({ variant: variant }), className) }, props)));
76
+ }
77
+
78
+ console.log("Hello world");
79
+ var sayHello = function (name) { return "Hello, ".concat(name); };
80
+
81
+ exports.Badge = Badge;
82
+ exports.sayHello = sayHello;
83
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/lib/utils.ts","../src/components/ui/badge.tsx","../src/index.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs));\r\n}\r\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"lib/utils\";\n\n// import { cn } from \"@/lib/utils\"\n\nconst badgeVariants = cva(\n \"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n destructive:\n \"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80\",\n outline: \"text-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return (\n <div className={cn(badgeVariants({ variant }), className)} {...props} />\n );\n}\n\nexport { Badge, badgeVariants };\n","import { Badge } from \"components/ui/badge\";\n\nexport { Badge };\n\nconsole.log(\"Hello world\");\n\nexport const sayHello = (name: string) => `Hello, ${name}`;\n"],"names":["twMerge","clsx","cva","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAGgB,EAAE,GAAA;IAAC,IAAuB,MAAA,GAAA,EAAA,CAAA;SAAvB,IAAuB,EAAA,GAAA,CAAA,EAAvB,EAAuB,GAAA,SAAA,CAAA,MAAA,EAAvB,EAAuB,EAAA,EAAA;QAAvB,MAAuB,CAAA,EAAA,CAAA,GAAA,SAAA,CAAA,EAAA,CAAA,CAAA;;AACxC,IAAA,OAAOA,qBAAO,CAACC,SAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/B;;ACDA;AAEA,IAAM,aAAa,GAAGC,0BAAG,CACvB,sKAAsK,EACtK;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EACL,kFAAkF;AACpF,YAAA,SAAS,EACP,iFAAiF;AACnF,YAAA,WAAW,EACT,8FAA8F;AAChG,YAAA,OAAO,EAAE,iBAAiB;AAC3B,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,OAAO,EAAE,SAAS;AACnB,KAAA;AACF,CAAA,CACF,CAAC;AAMF,SAAS,KAAK,CAAC,EAA4C,EAAA;IAA1C,IAAA,SAAS,eAAA,EAAE,OAAO,aAAA,EAAK,KAAK,GAA9B,MAAA,CAAA,EAAA,EAAA,CAAA,WAAA,EAAA,SAAA,CAAgC,CAAF,CAAA;IAC3C,QACEC,iCAAK,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,SAAA,EAAE,CAAC,EAAE,SAAS,CAAC,IAAM,KAAK,CAAA,CAAI,EACxE;AACJ;;AC9BA,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAEpB,IAAM,QAAQ,GAAG,UAAC,IAAY,EAAK,EAAA,OAAA,SAAU,CAAA,MAAA,CAAA,IAAI,CAAE,CAAA;;;;;"}
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,10 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ export function cn() {
4
+ var inputs = [];
5
+ for (var _i = 0; _i < arguments.length; _i++) {
6
+ inputs[_i] = arguments[_i];
7
+ }
8
+ return twMerge(clsx(inputs));
9
+ }
10
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,MAAM,UAAU,EAAE;IAAC,gBAAuB;SAAvB,UAAuB,EAAvB,qBAAuB,EAAvB,IAAuB;QAAvB,2BAAuB;;IACxC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
package/jest.config.js ADDED
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ preset: "ts-jest",
3
+ testMatch: ["**/__tests__/**/*.test.ts"],
4
+ };
package/package.json CHANGED
@@ -1,30 +1,36 @@
1
1
  {
2
2
  "name": "singularity-components",
3
3
  "author": "John Doe",
4
- "version": "0.1.5",
5
- "main": "index.tsx",
4
+ "version": "0.1.6",
5
+ "main": "dist/index.js",
6
6
  "dependencies": {
7
7
  "@testing-library/react": "^13.4.0",
8
8
  "@testing-library/user-event": "^13.5.0",
9
+ "@types/jest": "^29.5.14",
9
10
  "@types/node": "^16.18.119",
10
11
  "@types/react": "^18.3.12",
11
12
  "@types/react-dom": "^18.3.1",
12
13
  "class-variance-authority": "^0.7.0",
13
14
  "clsx": "^2.1.1",
15
+ "concurrently": "^9.1.0",
16
+ "jest": "^29.7.0",
14
17
  "lucide-react": "^0.461.0",
18
+ "nodemon": "^3.1.7",
15
19
  "react": "^18.3.1",
16
20
  "react-dom": "^18.3.1",
17
21
  "react-scripts": "5.0.1",
22
+ "rollup": "^2.79.2",
23
+ "rollup-plugin-typescript2": "^0.36.0",
18
24
  "tailwind-merge": "^2.5.5",
19
25
  "tailwindcss-animate": "^1.0.7",
26
+ "ts-jest": "^29.2.5",
20
27
  "typescript": "^4.9.5",
21
28
  "web-vitals": "^2.1.4"
22
29
  },
23
30
  "scripts": {
24
- "start": "react-scripts start",
25
- "build": "react-scripts build",
26
- "test": "react-scripts test",
27
- "eject": "react-scripts eject"
31
+ "build": "rollup -c",
32
+ "dev": "concurrently \"tsc --watch\" \"nodemon ./dist/index.js\"",
33
+ "prepare": "npm run build"
28
34
  },
29
35
  "eslintConfig": {
30
36
  "extends": [
@@ -0,0 +1,16 @@
1
+ const typescript = require("rollup-plugin-typescript2");
2
+ const pkg = require("./package.json");
3
+
4
+ module.exports = {
5
+ input: "src/index.ts",
6
+ output: [
7
+ {
8
+ file: pkg.main,
9
+ format: "cjs",
10
+ exports: "named",
11
+ sourcemap: true,
12
+ strict: false,
13
+ },
14
+ ],
15
+ plugins: [typescript()],
16
+ };
package/src/index.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { Badge } from "components/ui/badge";
2
+
3
+ export { Badge };
4
+
5
+ console.log("Hello world");
6
+
7
+ export const sayHello = (name: string) => `Hello, ${name}`;
@@ -0,0 +1,21 @@
1
+ import { sayHello } from "index";
2
+
3
+ describe("sayHello", () => {
4
+ it("should return a greeting message with the provided name", () => {
5
+ const name = "John";
6
+ const result = sayHello(name);
7
+ expect(result).toBe("Hello, John");
8
+ });
9
+
10
+ it("should handle an empty string as the name", () => {
11
+ const name = "";
12
+ const result = sayHello(name);
13
+ expect(result).toBe("Hello, ");
14
+ });
15
+
16
+ it("should handle a name with special characters", () => {
17
+ const name = "@#$%^";
18
+ const result = sayHello(name);
19
+ expect(result).toBe("Hello, @#$%^");
20
+ });
21
+ });
package/tsconfig.json CHANGED
@@ -1,24 +1,35 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "es5",
4
- "lib": ["dom", "dom.iterable", "esnext"],
5
- "allowJs": true,
3
+ // "jsx": "react",
4
+ // // "target": "es5",
5
+ // // "lib": ["dom", "dom.iterable", "esnext"],
6
+ // // "allowJs": true,
6
7
  "skipLibCheck": true,
7
8
  "esModuleInterop": true,
8
9
  "allowSyntheticDefaultImports": true,
9
10
  "strict": true,
10
- "forceConsistentCasingInFileNames": true,
11
+ // // "forceConsistentCasingInFileNames": true,
11
12
  "noFallthroughCasesInSwitch": true,
12
- "module": "esnext",
13
- "moduleResolution": "node",
13
+ // // "module": "esnext",
14
+ // // "moduleResolution": "node",
14
15
  "resolveJsonModule": true,
15
- "isolatedModules": true,
16
+ // "isolatedModules": true,
16
17
  "noEmit": true,
17
18
  "jsx": "react-jsx",
18
19
  "baseUrl": "./src",
19
20
  "paths": {
20
21
  "@/*": ["/*"]
21
- }
22
+ },
23
+ "outDir": "dist",
24
+ "module": "esnext",
25
+ "target": "es5",
26
+ "lib": ["es6", "dom", "es2016", "es2017"],
27
+ "sourceMap": true,
28
+ "allowJs": false,
29
+ "declaration": true,
30
+ "moduleResolution": "node",
31
+ "forceConsistentCasingInFileNames": true
22
32
  },
23
- "include": ["src"]
33
+ "include": ["src"],
34
+ "exclude": ["node_modules", "dist", "rollup.config.js"]
24
35
  }