@creativecodeco/ui 0.0.1

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/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # @creativecodeco/ui
2
+
3
+ > System Design CreativeCode.com.co
4
+
5
+ ![NPM](https://img.shields.io/badge/NPM-%23CB3837.svg?style=for-the-badge&logo=npm&logoColor=white) ![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white) ![React](https://img.shields.io/badge/react-%2320232a.svg?style=for-the-badge&logo=react&logoColor=%2361DAFB)
6
+
7
+ ## Chromatic
8
+
9
+ [View Components](https://master--658273f7c6c3c10a909dea3b.chromatic.com/)
package/lib/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from "./ui/forms";
2
+ export * from "./ui/provider";
3
+ export * from "./types";
package/lib/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from "./ui/forms";
2
+ export * from "./ui/provider";
3
+ export * from "./types";
@@ -0,0 +1,10 @@
1
+ export declare const creativeCodeTheme: {
2
+ content: string[];
3
+ theme: {
4
+ extend: {};
5
+ };
6
+ daisyui: {
7
+ themes: string[];
8
+ };
9
+ plugins: any[];
10
+ };
@@ -0,0 +1,13 @@
1
+ export const creativeCodeTheme = {
2
+ content: [
3
+ "./src/**/*.{html,js,ts,jsx,tsx,mdx}",
4
+ "./node_modules/creativecodeco/ui/lib/**/*.{js,jsx,ts,tsx}",
5
+ ],
6
+ theme: {
7
+ extend: {},
8
+ },
9
+ daisyui: {
10
+ themes: ["light"],
11
+ },
12
+ plugins: [require("daisyui")],
13
+ };
@@ -0,0 +1,3 @@
1
+ .input-john {
2
+ @apply bg-primary;
3
+ }
@@ -0,0 +1,5 @@
1
+ @import "tailwindcss/base";
2
+ @import "tailwindcss/components";
3
+ @import "tailwindcss/utilities";
4
+
5
+ @import "./input.css";
@@ -0,0 +1,2 @@
1
+ import { TextBoxType, TextBoxRef } from "./ui/forms";
2
+ export type { TextBoxType, TextBoxRef };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { TextBoxType, TextBoxRef } from "./text-box.types";
2
+ export type { TextBoxType, TextBoxRef };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface TextBoxType extends React.InputHTMLAttributes<HTMLInputElement> {
2
+ name: string;
3
+ label?: string;
4
+ isError?: boolean;
5
+ error?: string;
6
+ disabled?: boolean;
7
+ }
8
+ export type TextBoxRef = HTMLInputElement;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { TextBox } from "../../ui/forms/text-box";
2
+ export { TextBox };
@@ -0,0 +1,2 @@
1
+ import { TextBox } from "../../ui/forms/text-box";
2
+ export { TextBox };
@@ -0,0 +1,2 @@
1
+ import TextBox from "./text-box.component";
2
+ export { TextBox };
@@ -0,0 +1,2 @@
1
+ import TextBox from "./text-box.component";
2
+ export { TextBox };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { TextBoxType } from "../../../types/ui/forms";
3
+ declare const TextBox: React.ForwardRefExoticComponent<TextBoxType & React.RefAttributes<HTMLInputElement>>;
4
+ export default TextBox;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useImperativeHandle, useRef } from "react";
3
+ const TextBox = forwardRef(({ name, label, isError, error, disabled, ...otherProps }, ref) => {
4
+ const inputRef = useRef(null);
5
+ useImperativeHandle(ref, () => inputRef.current);
6
+ return (_jsxs("div", { className: "form-control w-full", children: [label && (_jsx("div", { className: "label", children: _jsx("label", { htmlFor: name, className: "label-text", children: label }) })), _jsx("input", { ref: inputRef, id: name, name: name, ...otherProps, className: "input input-bordered w-full", disabled: disabled }), isError && _jsx("p", { className: "text-red-500", children: error })] }));
7
+ });
8
+ export default TextBox;
@@ -0,0 +1,2 @@
1
+ import { PropsWithChildren } from "react";
2
+ export default function CreativeCodeUIProvider({ children, }: PropsWithChildren<unknown>): JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Fragment } from "react";
3
+ export default function CreativeCodeUIProvider({ children, }) {
4
+ return _jsx(Fragment, { children: children });
5
+ }
@@ -0,0 +1,2 @@
1
+ import CreativeCodeUIProvider from "./creativecode-ui.provider";
2
+ export default CreativeCodeUIProvider;
@@ -0,0 +1,2 @@
1
+ import CreativeCodeUIProvider from "./creativecode-ui.provider";
2
+ export default CreativeCodeUIProvider;
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "@creativecodeco/ui",
3
+ "description": "CreativeCode.com.co UI",
4
+ "version": "0.0.1",
5
+ "homepage": "https://github.com/creativecodeco/ui",
6
+ "author": {
7
+ "name": "John Toro",
8
+ "email": "joaltoroc@creativecode.com.co"
9
+ },
10
+ "license": "MIT",
11
+ "main": "lib/index.js",
12
+ "source": "src/index.ts",
13
+ "scripts": {
14
+ "build-storybook": "npm run build; storybook build",
15
+ "build:alias": "tsc-alias -p tsconfig.build.json",
16
+ "build:css": "postcss src/theme/main.css -o dist/theme/main.css --minify; cpx 'src/theme/*[.]css' 'lib/theme/tailwindcss'",
17
+ "build": "rm -rf lib; tsc -p tsconfig.build.json; npm run build:alias; npm run build:css",
18
+ "chromatic": "chromatic --only-changed true",
19
+ "dev:css": "postcss src/theme/main.css -o dist/theme/main.css --watch",
20
+ "prepack": "npm run build",
21
+ "release": "npm publish --access public",
22
+ "storybook": "storybook dev -p 6006"
23
+ },
24
+ "peerDependencies": {
25
+ "react": "18.2.0"
26
+ },
27
+ "devDependencies": {
28
+ "@storybook/addon-essentials": "7.6.6",
29
+ "@storybook/addon-interactions": "7.6.6",
30
+ "@storybook/addon-links": "7.6.6",
31
+ "@storybook/addon-onboarding": "1.0.10",
32
+ "@storybook/blocks": "7.6.6",
33
+ "@storybook/react": "7.6.6",
34
+ "@storybook/react-webpack5": "7.6.6",
35
+ "@storybook/test": "7.6.6",
36
+ "@types/node": "20.10.5",
37
+ "@types/react": "18.2.45",
38
+ "@types/react-dom": "18.2.18",
39
+ "autoprefixer": "^10.4.16",
40
+ "chromatic": "^10.1.0",
41
+ "cpx2": "6.0.1",
42
+ "daisyui": "4.4.21",
43
+ "eslint": "8.56.0",
44
+ "eslint-config-prettier": "9.1.0",
45
+ "eslint-config-standard": "17.1.0",
46
+ "eslint-config-standard-react": "13.0.0",
47
+ "eslint-config-standard-with-typescript": "43.0.0",
48
+ "eslint-plugin-import": "2.29.1",
49
+ "eslint-plugin-n": "16.4.0",
50
+ "eslint-plugin-node": "11.1.0",
51
+ "eslint-plugin-prettier": "5.1.0",
52
+ "eslint-plugin-promise": "6.1.1",
53
+ "eslint-plugin-react": "7.33.2",
54
+ "eslint-plugin-standard": "5.0.0",
55
+ "eslint-plugin-storybook": "0.6.15",
56
+ "eslint-plugin-unused-imports": "3.0.0",
57
+ "postcss": "8.4.32",
58
+ "postcss-cli": "11.0.0",
59
+ "postcss-import": "15.1.0",
60
+ "prettier": "3.1.1",
61
+ "prop-types": "15.8.1",
62
+ "react": "18.2.0",
63
+ "react-dom": "18.2.0",
64
+ "storybook": "7.6.6",
65
+ "storybook-addon-themes": "^6.1.0",
66
+ "string-width": "^7.0.0",
67
+ "tailwindcss": "3.4.0",
68
+ "tsc-alias": "1.8.8",
69
+ "tsconfig-paths-webpack-plugin": "^4.1.0",
70
+ "typescript": "5.3.3"
71
+ },
72
+ "files": [
73
+ "lib"
74
+ ]
75
+ }