@houssemdi2000/design-system 1.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/dist/components/Button/Button.d.ts +10 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Card/Card.d.ts +6 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +38 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "./Button.css";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface ButtonProps {
|
|
4
|
+
label: string;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
variant?: "primary" | "secondary" | "danger";
|
|
7
|
+
size?: "small" | "medium" | "large";
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const Button: React.FC<ButtonProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Button';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Card';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Button';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
function styleInject(css, ref) {
|
|
4
|
+
if ( ref === void 0 ) ref = {};
|
|
5
|
+
var insertAt = ref.insertAt;
|
|
6
|
+
|
|
7
|
+
if (typeof document === 'undefined') { return; }
|
|
8
|
+
|
|
9
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
10
|
+
var style = document.createElement('style');
|
|
11
|
+
style.type = 'text/css';
|
|
12
|
+
|
|
13
|
+
if (insertAt === 'top') {
|
|
14
|
+
if (head.firstChild) {
|
|
15
|
+
head.insertBefore(style, head.firstChild);
|
|
16
|
+
} else {
|
|
17
|
+
head.appendChild(style);
|
|
18
|
+
}
|
|
19
|
+
} else {
|
|
20
|
+
head.appendChild(style);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (style.styleSheet) {
|
|
24
|
+
style.styleSheet.cssText = css;
|
|
25
|
+
} else {
|
|
26
|
+
style.appendChild(document.createTextNode(css));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var css_248z = ".btn{border:none;border-radius:4px;cursor:pointer;font-size:16px;font-weight:500;padding:10px 20px;transition:all .3s ease}.btn-primary{background-color:#007bff;color:#fff}.btn-primary:hover{background-color:#0056b3}.btn-secondary{background-color:#6c757d;color:#fff}.btn-danger{background-color:#dc3545;color:#fff}.btn-small{font-size:14px;padding:5px 10px}.btn-medium{font-size:16px;padding:10px 20px}.btn-large{font-size:18px;padding:15px 30px}.btn:disabled{cursor:not-allowed;opacity:.5}";
|
|
31
|
+
styleInject(css_248z);
|
|
32
|
+
|
|
33
|
+
const Button = ({ label, onClick, variant = "primary", size = "medium", disabled = false, }) => {
|
|
34
|
+
return (jsx(Fragment, { children: jsx("button", { className: `btn btn-${variant} btn-${size}`, onClick: onClick, disabled: disabled, children: label }) }));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { Button };
|
|
38
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/components/Button/Button.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import \"./Button.css\";\r\nimport React from \"react\";\r\n\r\n\r\nexport interface ButtonProps {\r\n label: string;\r\n onClick?: () => void;\r\n variant?: \"primary\" | \"secondary\" | \"danger\";\r\n size?: \"small\" | \"medium\" | \"large\";\r\n disabled?: boolean;\r\n}\r\n\r\nexport const Button: React.FC<ButtonProps> = ({\r\n label,\r\n onClick,\r\n variant = \"primary\",\r\n size = \"medium\",\r\n disabled = false,\r\n}) => {\r\n return (\r\n <>\r\n <button\r\n className={`btn btn-${variant} btn-${size}`}\r\n onClick={onClick}\r\n disabled={disabled}\r\n >\r\n {label}\r\n </button>\r\n </>\r\n );\r\n};\r\n"],"names":["_jsx"],"mappings":";;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,MAAM,GAAG,GAAG,GAAG,EAAE;AAChC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ;;AAE7B,EAAE,IAAY,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,CAAC;;AAEzD,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AAC7C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU;;AAEzB,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC;AAC/C,IAAI,CAAC,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC7B,IAAI;AACJ,EAAE,CAAC,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC3B,EAAE;;AAEF,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG;AAClC,EAAE,CAAC,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AACnD,EAAE;AACF;;;;;MCba,MAAM,GAA0B,CAAC,EAC5C,KAAK,EACL,OAAO,EACP,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,QAAQ,EACf,QAAQ,GAAG,KAAK,GACjB,KAAI;IACH,QACEA,0BACEA,GAAA,CAAA,QAAA,EAAA,EACE,SAAS,EAAE,CAAA,QAAA,EAAW,OAAO,CAAA,KAAA,EAAQ,IAAI,CAAA,CAAE,EAC3C,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,YAEjB,KAAK,EAAA,CACC,EAAA,CACR;AAEP;;;;","x_google_ignoreList":[0]}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
|
|
5
|
+
function styleInject(css, ref) {
|
|
6
|
+
if ( ref === void 0 ) ref = {};
|
|
7
|
+
var insertAt = ref.insertAt;
|
|
8
|
+
|
|
9
|
+
if (typeof document === 'undefined') { return; }
|
|
10
|
+
|
|
11
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
12
|
+
var style = document.createElement('style');
|
|
13
|
+
style.type = 'text/css';
|
|
14
|
+
|
|
15
|
+
if (insertAt === 'top') {
|
|
16
|
+
if (head.firstChild) {
|
|
17
|
+
head.insertBefore(style, head.firstChild);
|
|
18
|
+
} else {
|
|
19
|
+
head.appendChild(style);
|
|
20
|
+
}
|
|
21
|
+
} else {
|
|
22
|
+
head.appendChild(style);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (style.styleSheet) {
|
|
26
|
+
style.styleSheet.cssText = css;
|
|
27
|
+
} else {
|
|
28
|
+
style.appendChild(document.createTextNode(css));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var css_248z = ".btn{border:none;border-radius:4px;cursor:pointer;font-size:16px;font-weight:500;padding:10px 20px;transition:all .3s ease}.btn-primary{background-color:#007bff;color:#fff}.btn-primary:hover{background-color:#0056b3}.btn-secondary{background-color:#6c757d;color:#fff}.btn-danger{background-color:#dc3545;color:#fff}.btn-small{font-size:14px;padding:5px 10px}.btn-medium{font-size:16px;padding:10px 20px}.btn-large{font-size:18px;padding:15px 30px}.btn:disabled{cursor:not-allowed;opacity:.5}";
|
|
33
|
+
styleInject(css_248z);
|
|
34
|
+
|
|
35
|
+
const Button = ({ label, onClick, variant = "primary", size = "medium", disabled = false, }) => {
|
|
36
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("button", { className: `btn btn-${variant} btn-${size}`, onClick: onClick, disabled: disabled, children: label }) }));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
exports.Button = Button;
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/components/Button/Button.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import \"./Button.css\";\r\nimport React from \"react\";\r\n\r\n\r\nexport interface ButtonProps {\r\n label: string;\r\n onClick?: () => void;\r\n variant?: \"primary\" | \"secondary\" | \"danger\";\r\n size?: \"small\" | \"medium\" | \"large\";\r\n disabled?: boolean;\r\n}\r\n\r\nexport const Button: React.FC<ButtonProps> = ({\r\n label,\r\n onClick,\r\n variant = \"primary\",\r\n size = \"medium\",\r\n disabled = false,\r\n}) => {\r\n return (\r\n <>\r\n <button\r\n className={`btn btn-${variant} btn-${size}`}\r\n onClick={onClick}\r\n disabled={disabled}\r\n >\r\n {label}\r\n </button>\r\n </>\r\n );\r\n};\r\n"],"names":["_jsx"],"mappings":";;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,MAAM,GAAG,GAAG,GAAG,EAAE;AAChC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ;;AAE7B,EAAE,IAAY,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,CAAC;;AAEzD,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AAC7C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU;;AAEzB,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC;AAC/C,IAAI,CAAC,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC7B,IAAI;AACJ,EAAE,CAAC,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC3B,EAAE;;AAEF,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG;AAClC,EAAE,CAAC,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AACnD,EAAE;AACF;;;;;MCba,MAAM,GAA0B,CAAC,EAC5C,KAAK,EACL,OAAO,EACP,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,QAAQ,EACf,QAAQ,GAAG,KAAK,GACjB,KAAI;IACH,QACEA,gDACEA,cAAA,CAAA,QAAA,EAAA,EACE,SAAS,EAAE,CAAA,QAAA,EAAW,OAAO,CAAA,KAAA,EAAQ,IAAI,CAAA,CAAE,EAC3C,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,YAEjB,KAAK,EAAA,CACC,EAAA,CACR;AAEP;;;;","x_google_ignoreList":[0]}
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@houssemdi2000/design-system",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Mon système de design React",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "rollup -c",
|
|
13
|
+
"prepublishOnly": "npm run build"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"react": "^18.0.0",
|
|
17
|
+
"react-dom": "^18.0.0"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"react",
|
|
21
|
+
"components",
|
|
22
|
+
"design-system",
|
|
23
|
+
"ui"
|
|
24
|
+
],
|
|
25
|
+
"author": "HOUSSEM",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
29
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
30
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
31
|
+
"@types/react": "^19.2.7",
|
|
32
|
+
"@types/react-dom": "^19.2.3",
|
|
33
|
+
"rollup": "^4.53.3",
|
|
34
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
35
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
36
|
+
"tslib": "^2.8.1",
|
|
37
|
+
"typescript": "^5.9.3"
|
|
38
|
+
}
|
|
39
|
+
}
|