webadwaita 0.0.15 → 0.0.16
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/.eslintrc.js +8 -0
- package/.turbo/turbo-build.log +30 -0
- package/CHANGELOG.md +7 -0
- package/dist/button.d.mts +9 -0
- package/dist/button.d.ts +9 -0
- package/dist/button.js +64 -0
- package/dist/button.mjs +42 -0
- package/dist/chunk-APFHYC4L.mjs +54 -0
- package/dist/components/atoms/index.css +32 -0
- package/dist/components/atoms/index.d.mts +10 -0
- package/dist/components/atoms/index.d.ts +10 -0
- package/dist/components/atoms/index.js +77 -0
- package/dist/components/atoms/index.mjs +6 -0
- package/dist/index.css +32 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +77 -0
- package/dist/index.mjs +6 -0
- package/package.json +31 -35
- package/src/components/atoms/Button/Button.module.scss +32 -0
- package/src/components/atoms/Button/Button.stories.tsx +40 -0
- package/src/components/atoms/Button/Button.tsx +16 -0
- package/src/components/atoms/Button/Button.types.ts +4 -0
- package/src/components/atoms/Button/index.ts +2 -0
- package/src/components/atoms/index.ts +1 -0
- package/src/components/index.ts +1 -0
- package/src/global.d.ts +10 -0
- package/src/index.ts +1 -0
- package/tsconfig.json +5 -0
- package/tsup.config.ts +11 -0
- package/dist/webadwaita.css +0 -1
- package/dist/webadwaita.js +0 -21
- package/dist/webadwaita.umd.cjs +0 -1
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @type {import("eslint").Linter.Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
extends: ["@repo/eslint-config/react.js"],
|
|
4
|
+
// Resolve tsconfig.json relative to this package, not the workspace root.
|
|
5
|
+
parserOptions: {
|
|
6
|
+
project: require("node:path").resolve(__dirname, "tsconfig.json"),
|
|
7
|
+
},
|
|
8
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
npm warn Unknown project config "auto-install-peers". This will stop working in the next major version of npm.
|
|
2
|
+
npm warn Unknown project config "public-hoist-pattern". This will stop working in the next major version of npm.
|
|
3
|
+
|
|
4
|
+
> webadwaita@0.0.16 build
|
|
5
|
+
> tsup
|
|
6
|
+
|
|
7
|
+
[34mCLI[39m Building entry: src/index.ts, src/components/atoms/index.ts
|
|
8
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
9
|
+
[34mCLI[39m tsup v8.5.1
|
|
10
|
+
[34mCLI[39m Using tsup config: C:\Users\micha\repos\webadwaita\packages\ui\tsup.config.ts
|
|
11
|
+
[34mCLI[39m Target: es6
|
|
12
|
+
[34mCJS[39m Build start
|
|
13
|
+
[34mESM[39m Build start
|
|
14
|
+
[34mDTS[39m Build start
|
|
15
|
+
[32mCJS[39m [1mdist\index.css [22m[32m688.00 B[39m
|
|
16
|
+
[32mCJS[39m [1mdist\index.js [22m[32m2.76 KB[39m
|
|
17
|
+
[32mCJS[39m [1mdist\components\atoms\index.css [22m[32m688.00 B[39m
|
|
18
|
+
[32mCJS[39m [1mdist\components\atoms\index.js [22m[32m2.78 KB[39m
|
|
19
|
+
[32mCJS[39m ⚡️ Build success in 1324ms
|
|
20
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m70.00 B[39m
|
|
21
|
+
[32mESM[39m [1mdist\components\atoms\index.mjs [22m[32m74.00 B[39m
|
|
22
|
+
[32mESM[39m [1mdist\chunk-APFHYC4L.mjs [22m[32m1.82 KB[39m
|
|
23
|
+
[32mESM[39m [1mdist\components\atoms\index.css [22m[32m688.00 B[39m
|
|
24
|
+
[32mESM[39m [1mdist\index.css [22m[32m688.00 B[39m
|
|
25
|
+
[32mESM[39m ⚡️ Build success in 1330ms
|
|
26
|
+
[32mDTS[39m ⚡️ Build success in 3352ms
|
|
27
|
+
[32mDTS[39m [1mdist\components\atoms\index.d.ts [22m[32m294.00 B[39m
|
|
28
|
+
[32mDTS[39m [1mdist\index.d.ts [22m[32m67.00 B[39m
|
|
29
|
+
[32mDTS[39m [1mdist\components\atoms\index.d.mts [22m[32m294.00 B[39m
|
|
30
|
+
[32mDTS[39m [1mdist\index.d.mts [22m[32m68.00 B[39m
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
}
|
|
4
|
+
declare function Button({ children, ...other }: ButtonProps): JSX.Element;
|
|
5
|
+
declare namespace Button {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { Button, type ButtonProps };
|
package/dist/button.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
}
|
|
4
|
+
declare function Button({ children, ...other }: ButtonProps): JSX.Element;
|
|
5
|
+
declare namespace Button {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { Button, type ButtonProps };
|
package/dist/button.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __objRest = (source, exclude) => {
|
|
24
|
+
var target = {};
|
|
25
|
+
for (var prop in source)
|
|
26
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
+
target[prop] = source[prop];
|
|
28
|
+
if (source != null && __getOwnPropSymbols)
|
|
29
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
+
target[prop] = source[prop];
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
};
|
|
35
|
+
var __export = (target, all) => {
|
|
36
|
+
for (var name in all)
|
|
37
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
38
|
+
};
|
|
39
|
+
var __copyProps = (to, from, except, desc) => {
|
|
40
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
41
|
+
for (let key of __getOwnPropNames(from))
|
|
42
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
43
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
44
|
+
}
|
|
45
|
+
return to;
|
|
46
|
+
};
|
|
47
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
48
|
+
|
|
49
|
+
// src/button.tsx
|
|
50
|
+
var button_exports = {};
|
|
51
|
+
__export(button_exports, {
|
|
52
|
+
Button: () => Button
|
|
53
|
+
});
|
|
54
|
+
module.exports = __toCommonJS(button_exports);
|
|
55
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
56
|
+
function Button(_a) {
|
|
57
|
+
var _b = _a, { children } = _b, other = __objRest(_b, ["children"]);
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", __spreadProps(__spreadValues({ type: "button" }, other), { children }));
|
|
59
|
+
}
|
|
60
|
+
Button.displayName = "Button";
|
|
61
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
+
0 && (module.exports = {
|
|
63
|
+
Button
|
|
64
|
+
});
|
package/dist/button.mjs
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/button.tsx
|
|
34
|
+
import { jsx } from "react/jsx-runtime";
|
|
35
|
+
function Button(_a) {
|
|
36
|
+
var _b = _a, { children } = _b, other = __objRest(_b, ["children"]);
|
|
37
|
+
return /* @__PURE__ */ jsx("button", __spreadProps(__spreadValues({ type: "button" }, other), { children }));
|
|
38
|
+
}
|
|
39
|
+
Button.displayName = "Button";
|
|
40
|
+
export {
|
|
41
|
+
Button
|
|
42
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/components/atoms/Button/Button.module.scss
|
|
34
|
+
var Button_module_default = {};
|
|
35
|
+
|
|
36
|
+
// src/components/atoms/Button/Button.tsx
|
|
37
|
+
import { jsx } from "react/jsx-runtime";
|
|
38
|
+
function Button(_a) {
|
|
39
|
+
var _b = _a, { children, className } = _b, other = __objRest(_b, ["children", "className"]);
|
|
40
|
+
return /* @__PURE__ */ jsx(
|
|
41
|
+
"button",
|
|
42
|
+
__spreadProps(__spreadValues({
|
|
43
|
+
type: "button",
|
|
44
|
+
className: className ? `${Button_module_default.button} ${className}` : Button_module_default.button
|
|
45
|
+
}, other), {
|
|
46
|
+
children
|
|
47
|
+
})
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
Button.displayName = "Button";
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
Button
|
|
54
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* src/components/atoms/Button/Button.module.scss */
|
|
2
|
+
.button {
|
|
3
|
+
padding: 0.5rem 1rem;
|
|
4
|
+
font-size: 1rem;
|
|
5
|
+
line-height: 1.5;
|
|
6
|
+
border: 1px solid #0052a3;
|
|
7
|
+
border-radius: 0.25rem;
|
|
8
|
+
background-color: #0066cc;
|
|
9
|
+
color: #fff;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
outline: none;
|
|
12
|
+
transition:
|
|
13
|
+
background-color 0.15s ease-in-out,
|
|
14
|
+
border-color 0.15s ease-in-out,
|
|
15
|
+
box-shadow 0.15s ease-in-out;
|
|
16
|
+
}
|
|
17
|
+
.button:hover {
|
|
18
|
+
background-color: #0052a3;
|
|
19
|
+
border-color: #004080;
|
|
20
|
+
}
|
|
21
|
+
.button:focus {
|
|
22
|
+
border-color: #004080;
|
|
23
|
+
box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.25);
|
|
24
|
+
}
|
|
25
|
+
.button:active {
|
|
26
|
+
background-color: #004080;
|
|
27
|
+
}
|
|
28
|
+
.button:disabled {
|
|
29
|
+
background-color: #99c2e6;
|
|
30
|
+
cursor: not-allowed;
|
|
31
|
+
opacity: 0.6;
|
|
32
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
declare function Button({ children, className, ...other }: ButtonProps): JSX.Element;
|
|
6
|
+
declare namespace Button {
|
|
7
|
+
var displayName: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { Button, type ButtonProps };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
declare function Button({ children, className, ...other }: ButtonProps): JSX.Element;
|
|
6
|
+
declare namespace Button {
|
|
7
|
+
var displayName: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { Button, type ButtonProps };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __objRest = (source, exclude) => {
|
|
24
|
+
var target = {};
|
|
25
|
+
for (var prop in source)
|
|
26
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
+
target[prop] = source[prop];
|
|
28
|
+
if (source != null && __getOwnPropSymbols)
|
|
29
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
+
target[prop] = source[prop];
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
};
|
|
35
|
+
var __export = (target, all) => {
|
|
36
|
+
for (var name in all)
|
|
37
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
38
|
+
};
|
|
39
|
+
var __copyProps = (to, from, except, desc) => {
|
|
40
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
41
|
+
for (let key of __getOwnPropNames(from))
|
|
42
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
43
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
44
|
+
}
|
|
45
|
+
return to;
|
|
46
|
+
};
|
|
47
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
48
|
+
|
|
49
|
+
// src/components/atoms/index.ts
|
|
50
|
+
var atoms_exports = {};
|
|
51
|
+
__export(atoms_exports, {
|
|
52
|
+
Button: () => Button
|
|
53
|
+
});
|
|
54
|
+
module.exports = __toCommonJS(atoms_exports);
|
|
55
|
+
|
|
56
|
+
// src/components/atoms/Button/Button.module.scss
|
|
57
|
+
var Button_module_default = {};
|
|
58
|
+
|
|
59
|
+
// src/components/atoms/Button/Button.tsx
|
|
60
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
61
|
+
function Button(_a) {
|
|
62
|
+
var _b = _a, { children, className } = _b, other = __objRest(_b, ["children", "className"]);
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
"button",
|
|
65
|
+
__spreadProps(__spreadValues({
|
|
66
|
+
type: "button",
|
|
67
|
+
className: className ? `${Button_module_default.button} ${className}` : Button_module_default.button
|
|
68
|
+
}, other), {
|
|
69
|
+
children
|
|
70
|
+
})
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
Button.displayName = "Button";
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
Button
|
|
77
|
+
});
|
package/dist/index.css
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* src/components/atoms/Button/Button.module.scss */
|
|
2
|
+
.button {
|
|
3
|
+
padding: 0.5rem 1rem;
|
|
4
|
+
font-size: 1rem;
|
|
5
|
+
line-height: 1.5;
|
|
6
|
+
border: 1px solid #0052a3;
|
|
7
|
+
border-radius: 0.25rem;
|
|
8
|
+
background-color: #0066cc;
|
|
9
|
+
color: #fff;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
outline: none;
|
|
12
|
+
transition:
|
|
13
|
+
background-color 0.15s ease-in-out,
|
|
14
|
+
border-color 0.15s ease-in-out,
|
|
15
|
+
box-shadow 0.15s ease-in-out;
|
|
16
|
+
}
|
|
17
|
+
.button:hover {
|
|
18
|
+
background-color: #0052a3;
|
|
19
|
+
border-color: #004080;
|
|
20
|
+
}
|
|
21
|
+
.button:focus {
|
|
22
|
+
border-color: #004080;
|
|
23
|
+
box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.25);
|
|
24
|
+
}
|
|
25
|
+
.button:active {
|
|
26
|
+
background-color: #004080;
|
|
27
|
+
}
|
|
28
|
+
.button:disabled {
|
|
29
|
+
background-color: #99c2e6;
|
|
30
|
+
cursor: not-allowed;
|
|
31
|
+
opacity: 0.6;
|
|
32
|
+
}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button, ButtonProps } from './components/atoms/index.mjs';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button, ButtonProps } from './components/atoms/index.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __objRest = (source, exclude) => {
|
|
24
|
+
var target = {};
|
|
25
|
+
for (var prop in source)
|
|
26
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
+
target[prop] = source[prop];
|
|
28
|
+
if (source != null && __getOwnPropSymbols)
|
|
29
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
+
target[prop] = source[prop];
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
};
|
|
35
|
+
var __export = (target, all) => {
|
|
36
|
+
for (var name in all)
|
|
37
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
38
|
+
};
|
|
39
|
+
var __copyProps = (to, from, except, desc) => {
|
|
40
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
41
|
+
for (let key of __getOwnPropNames(from))
|
|
42
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
43
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
44
|
+
}
|
|
45
|
+
return to;
|
|
46
|
+
};
|
|
47
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
48
|
+
|
|
49
|
+
// src/index.ts
|
|
50
|
+
var index_exports = {};
|
|
51
|
+
__export(index_exports, {
|
|
52
|
+
Button: () => Button
|
|
53
|
+
});
|
|
54
|
+
module.exports = __toCommonJS(index_exports);
|
|
55
|
+
|
|
56
|
+
// src/components/atoms/Button/Button.module.scss
|
|
57
|
+
var Button_module_default = {};
|
|
58
|
+
|
|
59
|
+
// src/components/atoms/Button/Button.tsx
|
|
60
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
61
|
+
function Button(_a) {
|
|
62
|
+
var _b = _a, { children, className } = _b, other = __objRest(_b, ["children", "className"]);
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
"button",
|
|
65
|
+
__spreadProps(__spreadValues({
|
|
66
|
+
type: "button",
|
|
67
|
+
className: className ? `${Button_module_default.button} ${className}` : Button_module_default.button
|
|
68
|
+
}, other), {
|
|
69
|
+
children
|
|
70
|
+
})
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
Button.displayName = "Button";
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
Button
|
|
77
|
+
});
|
package/dist/index.mjs
ADDED
package/package.json
CHANGED
|
@@ -1,48 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webadwaita",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "https://github.com/michalshelenberg/webadwaita.git"
|
|
9
|
-
},
|
|
10
|
-
"type": "module",
|
|
11
|
-
"files": [
|
|
12
|
-
"dist"
|
|
3
|
+
"version": "0.0.16",
|
|
4
|
+
"sideEffects": [
|
|
5
|
+
"**/*.css",
|
|
6
|
+
"**/*.scss"
|
|
13
7
|
],
|
|
14
|
-
"
|
|
15
|
-
"module": "./dist/webadwaita.js",
|
|
8
|
+
"license": "MIT",
|
|
16
9
|
"exports": {
|
|
17
10
|
".": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
11
|
+
"types": "./src/index.ts",
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"require": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./atoms": {
|
|
16
|
+
"types": "./src/components/atoms/index.ts",
|
|
17
|
+
"import": "./dist/atoms.mjs",
|
|
18
|
+
"require": "./dist/atoms.js"
|
|
20
19
|
}
|
|
21
20
|
},
|
|
22
21
|
"scripts": {
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
22
|
+
"build": "tsup",
|
|
23
|
+
"dev": "tsup --watch",
|
|
24
|
+
"lint": "eslint . --max-warnings 0",
|
|
25
|
+
"clean": "rm -rf .turbo node_modules dist"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@repo/eslint-config": "*",
|
|
29
|
+
"@repo/typescript-config": "*",
|
|
30
|
+
"@types/react": "^18.2.61",
|
|
31
|
+
"@types/react-dom": "^18.2.19",
|
|
32
|
+
"esbuild-sass-plugin": "^3.6.0",
|
|
33
|
+
"eslint": "^8.57.0",
|
|
34
|
+
"sass": "^1.97.3",
|
|
35
|
+
"tsup": "^8.0.2",
|
|
36
|
+
"typescript": "5.5.4"
|
|
28
37
|
},
|
|
29
38
|
"dependencies": {
|
|
30
|
-
"react": "^
|
|
31
|
-
"react-dom": "^19.2.0",
|
|
32
|
-
"vite-tsconfig-paths": "^6.0.4"
|
|
39
|
+
"react": "^18.2.0"
|
|
33
40
|
},
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"@types/node": "^24.10.1",
|
|
37
|
-
"@types/react": "^19.2.5",
|
|
38
|
-
"@types/react-dom": "^19.2.3",
|
|
39
|
-
"@vitejs/plugin-react": "^5.1.1",
|
|
40
|
-
"eslint": "^9.39.1",
|
|
41
|
-
"eslint-plugin-react-hooks": "^7.0.1",
|
|
42
|
-
"eslint-plugin-react-refresh": "^0.4.24",
|
|
43
|
-
"globals": "^16.5.0",
|
|
44
|
-
"typescript": "~5.9.3",
|
|
45
|
-
"typescript-eslint": "^8.46.4",
|
|
46
|
-
"vite": "^7.2.4"
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
47
43
|
}
|
|
48
44
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.button {
|
|
2
|
+
padding: 0.5rem 1rem;
|
|
3
|
+
font-size: 1rem;
|
|
4
|
+
line-height: 1.5;
|
|
5
|
+
border: 1px solid #0052a3;
|
|
6
|
+
border-radius: 0.25rem;
|
|
7
|
+
background-color: #0066cc;
|
|
8
|
+
color: #fff;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
outline: none;
|
|
11
|
+
transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
12
|
+
|
|
13
|
+
&:hover {
|
|
14
|
+
background-color: #0052a3;
|
|
15
|
+
border-color: #004080;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&:focus {
|
|
19
|
+
border-color: #004080;
|
|
20
|
+
box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.25);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:active {
|
|
24
|
+
background-color: #004080;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&:disabled {
|
|
28
|
+
background-color: #99c2e6;
|
|
29
|
+
cursor: not-allowed;
|
|
30
|
+
opacity: 0.6;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Button } from "./Button";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Button> = {
|
|
5
|
+
component: Button,
|
|
6
|
+
argTypes: {
|
|
7
|
+
type: {
|
|
8
|
+
control: { type: "radio" },
|
|
9
|
+
options: ["button", "submit", "reset"],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
type Story = StoryObj<typeof Button>;
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
|
|
20
|
+
* See https://storybook.js.org/docs/react/api/csf
|
|
21
|
+
* to learn how to use render functions.
|
|
22
|
+
*/
|
|
23
|
+
export const Primary: Story = {
|
|
24
|
+
render: (props) => (
|
|
25
|
+
<Button
|
|
26
|
+
{...props}
|
|
27
|
+
onClick={(): void => {
|
|
28
|
+
// eslint-disable-next-line no-alert -- alert for demo
|
|
29
|
+
alert("Hello from Turborepo!");
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
Hello
|
|
33
|
+
</Button>
|
|
34
|
+
),
|
|
35
|
+
name: "Button",
|
|
36
|
+
args: {
|
|
37
|
+
children: "Hello",
|
|
38
|
+
type: "button",
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import styles from "./Button.module.scss";
|
|
2
|
+
import type { ButtonProps } from "./Button.types";
|
|
3
|
+
|
|
4
|
+
export function Button({ children, className, ...other }: ButtonProps): JSX.Element {
|
|
5
|
+
return (
|
|
6
|
+
<button
|
|
7
|
+
type="button"
|
|
8
|
+
className={className ? `${styles.button} ${className}` : styles.button}
|
|
9
|
+
{...other}
|
|
10
|
+
>
|
|
11
|
+
{children}
|
|
12
|
+
</button>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
Button.displayName = "Button";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Button";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./atoms";
|
package/src/global.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* eslint-disable no-restricted-syntax */
|
|
2
|
+
declare module '*.module.scss' {
|
|
3
|
+
const classes: Readonly<Record<string, string>>;
|
|
4
|
+
export default classes;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
declare module '*.module.css' {
|
|
8
|
+
const classes: Readonly<Record<string, string>>;
|
|
9
|
+
export default classes;
|
|
10
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./components";
|
package/tsconfig.json
ADDED
package/tsup.config.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineConfig } from "tsup";
|
|
2
|
+
import { sassPlugin } from "esbuild-sass-plugin";
|
|
3
|
+
|
|
4
|
+
export default defineConfig((options) => ({
|
|
5
|
+
entryPoints: ["src/index.ts", "src/components/atoms/index.ts", "src/components/molecules/index.ts"],
|
|
6
|
+
format: ["cjs", "esm"],
|
|
7
|
+
dts: true,
|
|
8
|
+
external: ["react"],
|
|
9
|
+
esbuildPlugins: [sassPlugin()],
|
|
10
|
+
...options,
|
|
11
|
+
}));
|
package/dist/webadwaita.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._button_j9o65_1{--button-align-items: center;--button-border: none;--button-cursor: pointer;--button-display: flex;--button-font-family: inherit;--button-font-size: .875rem;--button-font-weight: 600;--button-justify-content: center;--button-letter-spacing: .04em;--button-line-height: 1rem;--button-transition: all .3s ease;align-items:var(--button-align-items);background-color:var(--button-background-color);border:var(--button-border);border-radius:var(--button-border-radius);color:var(--button-color);cursor:var(--button-cursor);display:var(--button-display);font-family:var(--button-font-family);font-size:var(--button-font-size);font-weight:var(--button-font-weight);justify-content:var(--button-justify-content);letter-spacing:var(--button-letter-spacing);line-height:var(--button-line-height);padding-block:var(--button-padding-block);padding-inline:var(--button-padding-inline);transition:var(--button-transition)}._button--variant-regular_j9o65_63{--button-border-radius: .5rem;--button-min-width: 7.125rem;--button-padding-block: .5625rem;--button-padding-inline: 1.0625rem}._button--variant-pill_j9o65_77{--button-border-radius: 9999px;--button-min-width: auto;--button-padding-block: .875rem;--button-padding-inline: 2rem}._button--color-gray_j9o65_91{--button-background-color: #e6e6e7;--button-color: #2e2e33}._button--color-gray_j9o65_91:hover{--button-background-color: #dcdcdd;--button-color: #2c2c31}._button--color-gray_j9o65_91:active{--button-background-color: #bebec0;--button-color: #26262b}._button--color-suggested_j9o65_121{--button-background-color: #3584e4;--button-color: #ffffff}._button--color-suggested_j9o65_121:hover{--button-background-color: #4a91e7}._button--color-suggested_j9o65_121:active{--button-background-color: #2a6ab7}._button--color-destructive_j9o65_147{--button-background-color: #f2d5d6;--button-color: #c30000}._button--color-destructive_j9o65_147:hover{--button-background-color: #efc8c9}._button--color-destructive_j9o65_147:active{--button-background-color: #e7a3a3}
|
package/dist/webadwaita.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
const _ = "_button_j9o65_1", t = {
|
|
3
|
-
button: _,
|
|
4
|
-
"button--variant-regular": "_button--variant-regular_j9o65_63",
|
|
5
|
-
"button--variant-pill": "_button--variant-pill_j9o65_77",
|
|
6
|
-
"button--color-gray": "_button--color-gray_j9o65_91",
|
|
7
|
-
"button--color-suggested": "_button--color-suggested_j9o65_121",
|
|
8
|
-
"button--color-destructive": "_button--color-destructive_j9o65_147"
|
|
9
|
-
};
|
|
10
|
-
function e(o) {
|
|
11
|
-
const { variant: n, color: r, children: u, className: a, ...c } = o, s = [
|
|
12
|
-
t.button,
|
|
13
|
-
t[`button--variant-${n}`],
|
|
14
|
-
t[`button--color-${r}`],
|
|
15
|
-
a
|
|
16
|
-
].join(" ");
|
|
17
|
-
return /* @__PURE__ */ l("button", { ...c, className: s, children: u });
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
e as Button
|
|
21
|
-
};
|
package/dist/webadwaita.umd.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(t,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime"],o):(t=typeof globalThis<"u"?globalThis:t||self,o(t.webadwaita={},t["react/jsx-runtime"]))})(this,(function(t,o){"use strict";const n={button:"_button_j9o65_1","button--variant-regular":"_button--variant-regular_j9o65_63","button--variant-pill":"_button--variant-pill_j9o65_77","button--color-gray":"_button--color-gray_j9o65_91","button--color-suggested":"_button--color-suggested_j9o65_121","button--color-destructive":"_button--color-destructive_j9o65_147"};function e(u){const{variant:r,color:i,children:s,className:a,...c}=u,b=[n.button,n[`button--variant-${r}`],n[`button--color-${i}`],a].join(" ");return o.jsx("button",{...c,className:b,children:s})}t.Button=e,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|