@dbcdk/react-components 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/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +2 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +64 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var r=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var r__namespace=/*#__PURE__*/_interopNamespace(r);var c=r__namespace.forwardRef(({variant:t="primary",size:o="md",className:e="",...n},a)=>jsxRuntime.jsx("button",{ref:a,className:["dbc-btn",`dbc-btn--${t}`,`dbc-btn--${o}`,e].join(" "),...n}));c.displayName="Button";exports.Button=c;//# sourceMappingURL=index.cjs.map
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Button.tsx"],"names":["Button","r","variant","size","className","rest","ref","jsx"],"mappings":"kbAOO,IAAMA,CAAAA,CAAeC,wBAC1B,CAAC,CAAE,QAAAC,CAAAA,CAAU,SAAA,CAAW,KAAAC,CAAAA,CAAO,IAAA,CAAM,UAAAC,CAAAA,CAAY,EAAA,CAAI,GAAGC,CAAK,CAAA,CAAGC,CAAAA,GAC9DC,eAAC,QAAA,CAAA,CACC,GAAA,CAAKD,EACL,SAAA,CAAW,CAAC,UAAW,CAAA,SAAA,EAAYJ,CAAO,GAAI,CAAA,SAAA,EAAYC,CAAI,GAAIC,CAAS,CAAA,CAAE,KAAK,GAAG,CAAA,CACpF,GAAGC,CAAAA,CACN,CAEJ,EACAL,CAAAA,CAAO,WAAA,CAAc,QAAA","file":"index.cjs","sourcesContent":["import * as React from \"react\";\n\nexport type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n variant?: \"primary\" | \"secondary\" | \"ghost\";\n size?: \"sm\" | \"md\" | \"lg\";\n};\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ variant = \"primary\", size = \"md\", className = \"\", ...rest }, ref) => (\n <button\n ref={ref}\n className={[\"dbc-btn\", `dbc-btn--${variant}`, `dbc-btn--${size}`, className].join(\" \")}\n {...rest}\n />\n )\n);\nButton.displayName = \"Button\";\n"]}
|
package/dist/index.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
:root{--color-brand-600: #0ea5e9;--color-brand-700: #0284c7;--surface-2: #f4f4f5;--surface-3: #e4e4e7;--text-1: #111827;--radius-md: 10px;--focus-ring: 2px solid var(--color-brand-600)}.dbc-btn{display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-md);font:inherit;padding:0 1rem;height:2.5rem;transition:background-color .15s ease,color .15s ease,opacity .15s ease;outline:none}.dbc-btn:focus-visible{box-shadow:0 0 0 var(--focus-ring)}.dbc-btn:disabled{opacity:.5;pointer-events:none}.dbc-btn--primary{background:var(--color-brand-600);color:#fff}.dbc-btn--primary:hover{background:var(--color-brand-700)}.dbc-btn--secondary{background:var(--surface-2);color:var(--text-1)}.dbc-btn--secondary:hover{background:var(--surface-3)}.dbc-btn--ghost{background:transparent;color:var(--color-brand-700)}.dbc-btn--sm{height:2rem;padding:0 .75rem;font-size:.875rem}.dbc-btn--md{height:2.5rem}.dbc-btn--lg{height:3rem;padding:0 1.25rem;font-size:1.125rem}
|
|
2
|
+
/*# sourceMappingURL=index.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/styles/tokens.css","../src/styles/styles.css"],"sourcesContent":[":root {\n --color-brand-600: #0ea5e9;\n --color-brand-700: #0284c7;\n --surface-2: #f4f4f5;\n --surface-3: #e4e4e7;\n --text-1: #111827;\n --radius-md: 10px;\n --focus-ring: 2px solid var(--color-brand-600);\n}\n","@import \"./tokens.css\";\n.dbc-btn {\n display: inline-flex; align-items:center; justify-content:center;\n border-radius: var(--radius-md); font: inherit; padding: 0 1rem; height: 2.5rem;\n transition: background-color .15s ease, color .15s ease, opacity .15s ease; outline: none;\n}\n.dbc-btn:focus-visible { box-shadow: 0 0 0 var(--focus-ring); }\n.dbc-btn:disabled { opacity: .5; pointer-events: none; }\n.dbc-btn--primary { background: var(--color-brand-600); color: white; }\n.dbc-btn--primary:hover { background: var(--color-brand-700); }\n.dbc-btn--secondary { background: var(--surface-2); color: var(--text-1); }\n.dbc-btn--secondary:hover { background: var(--surface-3); }\n.dbc-btn--ghost { background: transparent; color: var(--color-brand-700); }\n.dbc-btn--sm { height: 2rem; padding: 0 .75rem; font-size: .875rem; }\n.dbc-btn--md { height: 2.5rem; }\n.dbc-btn--lg { height: 3rem; padding: 0 1.25rem; font-size: 1.125rem; }\n"],"mappings":"AAAA,MACE,mBAAmB,QACnB,mBAAmB,QACnB,aAAa,QACb,aAAa,QACb,UAAU,QACV,aAAa,KACb,cAAc,IAAI,MAAM,IAAI,kBAC9B,CCPA,CAAC,QACC,QAAS,YAAa,YAAY,OAAQ,gBAAgB,OAC1D,cAAe,IAAI,aAAc,KAAM,QAHzC,QAG2D,EAAE,KAAM,OAAQ,OACzE,WAAY,iBAAiB,KAAK,IAAI,CAAE,MAAM,KAAK,IAAI,CAAE,QAAQ,KAAK,KAAM,QAAS,IACvF,CACA,CALC,OAKO,eAAiB,WAAY,EAAE,EAAE,EAAE,IAAI,aAAe,CAC9D,CANC,OAMO,UAAY,QAAS,GAAI,eAAgB,IAAM,CACvD,CAAC,iBAAmB,WAAY,IAAI,mBAAoB,MAAO,IAAO,CACtE,CADC,gBACgB,OAAS,WAAY,IAAI,kBAAoB,CAC9D,CAAC,mBAAqB,WAAY,IAAI,aAAc,MAAO,IAAI,SAAW,CAC1E,CADC,kBACkB,OAAS,WAAY,IAAI,YAAc,CAC1D,CAAC,eAAiB,WAAY,YAAa,MAAO,IAAI,kBAAoB,CAC1E,CAAC,YAAc,OAAQ,KAbvB,QAasC,EAAE,OAAQ,UAAW,OAAS,CACpE,CAAC,YAAc,OAAQ,MAAQ,CAC/B,CAAC,YAAc,OAAQ,KAfvB,QAesC,EAAE,QAAS,UAAW,QAAU","names":[]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
4
|
+
variant?: "primary" | "secondary" | "ghost";
|
|
5
|
+
size?: "sm" | "md" | "lg";
|
|
6
|
+
};
|
|
7
|
+
declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
8
|
+
variant?: "primary" | "secondary" | "ghost";
|
|
9
|
+
size?: "sm" | "md" | "lg";
|
|
10
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
|
|
12
|
+
export { Button, type ButtonProps };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
4
|
+
variant?: "primary" | "secondary" | "ghost";
|
|
5
|
+
size?: "sm" | "md" | "lg";
|
|
6
|
+
};
|
|
7
|
+
declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
8
|
+
variant?: "primary" | "secondary" | "ghost";
|
|
9
|
+
size?: "sm" | "md" | "lg";
|
|
10
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
|
|
12
|
+
export { Button, type ButtonProps };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as r from'react';import {jsx}from'react/jsx-runtime';var c=r.forwardRef(({variant:t="primary",size:o="md",className:e="",...n},a)=>jsx("button",{ref:a,className:["dbc-btn",`dbc-btn--${t}`,`dbc-btn--${o}`,e].join(" "),...n}));c.displayName="Button";export{c as Button};//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Button.tsx"],"names":["Button","variant","size","className","rest","ref","jsx"],"mappings":"4DAOO,IAAMA,CAAAA,CAAe,aAC1B,CAAC,CAAE,QAAAC,CAAAA,CAAU,SAAA,CAAW,KAAAC,CAAAA,CAAO,IAAA,CAAM,UAAAC,CAAAA,CAAY,EAAA,CAAI,GAAGC,CAAK,CAAA,CAAGC,CAAAA,GAC9DC,IAAC,QAAA,CAAA,CACC,GAAA,CAAKD,EACL,SAAA,CAAW,CAAC,UAAW,CAAA,SAAA,EAAYJ,CAAO,GAAI,CAAA,SAAA,EAAYC,CAAI,GAAIC,CAAS,CAAA,CAAE,KAAK,GAAG,CAAA,CACpF,GAAGC,CAAAA,CACN,CAEJ,EACAJ,CAAAA,CAAO,WAAA,CAAc,QAAA","file":"index.js","sourcesContent":["import * as React from \"react\";\n\nexport type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n variant?: \"primary\" | \"secondary\" | \"ghost\";\n size?: \"sm\" | \"md\" | \"lg\";\n};\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ variant = \"primary\", size = \"md\", className = \"\", ...rest }, ref) => (\n <button\n ref={ref}\n className={[\"dbc-btn\", `dbc-btn--${variant}`, `dbc-btn--${size}`, className].join(\" \")}\n {...rest}\n />\n )\n);\nButton.displayName = \"Button\";\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dbcdk/react-components",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.mjs",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.cjs"
|
|
12
|
+
},
|
|
13
|
+
"./styles.css": "./dist/styles.css"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsup",
|
|
20
|
+
"dev": "tsup --watch",
|
|
21
|
+
"test": "vitest",
|
|
22
|
+
"lint": "eslint \"src/**/*.{ts,tsx}\" --max-warnings=0",
|
|
23
|
+
"storybook": "storybook dev -p 6006",
|
|
24
|
+
"build:storybook": "storybook build",
|
|
25
|
+
"changeset": "changeset",
|
|
26
|
+
"version-packages": "changeset version"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [],
|
|
29
|
+
"author": "",
|
|
30
|
+
"license": "ISC",
|
|
31
|
+
"type": "module",
|
|
32
|
+
"sideEffects": false,
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"react": "^18.2.0 || ^19.0.0",
|
|
35
|
+
"react-dom": "^18.2.0 || ^19.0.0"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"react": "^18.2.0 || ^19.0.0",
|
|
39
|
+
"react-dom": "^18.2.0 || ^19.0.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@changesets/cli": "^2.29.6",
|
|
43
|
+
"@storybook/addon-a11y": "^9.1.3",
|
|
44
|
+
"@storybook/addon-docs": "^9.1.3",
|
|
45
|
+
"@storybook/addon-viewport": "^9.0.8",
|
|
46
|
+
"@storybook/react-vite": "^9.1.3",
|
|
47
|
+
"@testing-library/jest-dom": "^6.8.0",
|
|
48
|
+
"@testing-library/react": "^16.3.0",
|
|
49
|
+
"@types/react": "^19.1.12",
|
|
50
|
+
"@types/react-dom": "^19.1.9",
|
|
51
|
+
"@types/testing-library__jest-dom": "^6.0.0",
|
|
52
|
+
"@typescript-eslint/eslint-plugin": "^8.41.0",
|
|
53
|
+
"@typescript-eslint/parser": "^8.41.0",
|
|
54
|
+
"eslint": "^9.34.0",
|
|
55
|
+
"eslint-plugin-react": "^7.37.5",
|
|
56
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
57
|
+
"jsdom": "^26.1.0",
|
|
58
|
+
"storybook": "^9.1.3",
|
|
59
|
+
"tsup": "^8.5.0",
|
|
60
|
+
"typescript": "^5.9.2",
|
|
61
|
+
"vite": "^6.3.5",
|
|
62
|
+
"vitest": "^3.2.4"
|
|
63
|
+
}
|
|
64
|
+
}
|