@sharadox/interface-web-library 0.0.0-stage → 0.1.0-development.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/LICENCA.md +76 -0
- package/LICENSE.md +76 -0
- package/NOTICE.md +3 -0
- package/README.md +68 -2
- package/distribution/button/index.d.ts +10 -0
- package/distribution/button/index.d.ts.map +1 -0
- package/distribution/button/index.js +15 -0
- package/distribution/button/index.js.map +1 -0
- package/distribution/button/index.module.css +1 -0
- package/distribution/button/index.module.scss +78 -0
- package/distribution/button/type.d.ts +12 -0
- package/distribution/button/type.d.ts.map +1 -0
- package/distribution/button/type.js +2 -0
- package/distribution/button/type.js.map +1 -0
- package/distribution/card/index.d.ts +10 -0
- package/distribution/card/index.d.ts.map +1 -0
- package/distribution/card/index.js +14 -0
- package/distribution/card/index.js.map +1 -0
- package/distribution/card/index.module.css +1 -0
- package/distribution/card/index.module.scss +31 -0
- package/distribution/card/type.d.ts +9 -0
- package/distribution/card/type.d.ts.map +1 -0
- package/distribution/card/type.js +2 -0
- package/distribution/card/type.js.map +1 -0
- package/distribution/code-boxes/index.d.ts +11 -0
- package/distribution/code-boxes/index.d.ts.map +1 -0
- package/distribution/code-boxes/index.js +57 -0
- package/distribution/code-boxes/index.js.map +1 -0
- package/distribution/code-boxes/index.module.css +1 -0
- package/distribution/code-boxes/index.module.scss +35 -0
- package/distribution/code-boxes/type.d.ts +17 -0
- package/distribution/code-boxes/type.d.ts.map +1 -0
- package/distribution/code-boxes/type.js +2 -0
- package/distribution/code-boxes/type.js.map +1 -0
- package/distribution/copy-button/index.d.ts +9 -0
- package/distribution/copy-button/index.d.ts.map +1 -0
- package/distribution/copy-button/index.js +26 -0
- package/distribution/copy-button/index.js.map +1 -0
- package/distribution/copy-button/index.module.css +1 -0
- package/distribution/copy-button/index.module.scss +24 -0
- package/distribution/copy-button/type.d.ts +11 -0
- package/distribution/copy-button/type.d.ts.map +1 -0
- package/distribution/copy-button/type.js +2 -0
- package/distribution/copy-button/type.js.map +1 -0
- package/distribution/dialog/index.d.ts +10 -0
- package/distribution/dialog/index.d.ts.map +1 -0
- package/distribution/dialog/index.js +31 -0
- package/distribution/dialog/index.js.map +1 -0
- package/distribution/dialog/index.module.css +1 -0
- package/distribution/dialog/index.module.scss +75 -0
- package/distribution/dialog/type.d.ts +11 -0
- package/distribution/dialog/type.d.ts.map +1 -0
- package/distribution/dialog/type.js +2 -0
- package/distribution/dialog/type.js.map +1 -0
- package/distribution/interface-theme/index.d.ts +18 -0
- package/distribution/interface-theme/index.d.ts.map +1 -0
- package/distribution/interface-theme/index.js +23 -0
- package/distribution/interface-theme/index.js.map +1 -0
- package/distribution/interface-theme/type.d.ts +43 -0
- package/distribution/interface-theme/type.d.ts.map +1 -0
- package/distribution/interface-theme/type.js +2 -0
- package/distribution/interface-theme/type.js.map +1 -0
- package/distribution/pending-mark/index.d.ts +10 -0
- package/distribution/pending-mark/index.d.ts.map +1 -0
- package/distribution/pending-mark/index.js +13 -0
- package/distribution/pending-mark/index.js.map +1 -0
- package/distribution/pending-mark/index.module.css +1 -0
- package/distribution/pending-mark/index.module.scss +30 -0
- package/distribution/pending-mark/type.d.ts +5 -0
- package/distribution/pending-mark/type.d.ts.map +1 -0
- package/distribution/pending-mark/type.js +2 -0
- package/distribution/pending-mark/type.js.map +1 -0
- package/distribution/skeleton/index.d.ts +10 -0
- package/distribution/skeleton/index.d.ts.map +1 -0
- package/distribution/skeleton/index.js +15 -0
- package/distribution/skeleton/index.js.map +1 -0
- package/distribution/skeleton/index.module.css +1 -0
- package/distribution/skeleton/index.module.scss +86 -0
- package/distribution/skeleton/type.d.ts +16 -0
- package/distribution/skeleton/type.d.ts.map +1 -0
- package/distribution/skeleton/type.js +2 -0
- package/distribution/skeleton/type.js.map +1 -0
- package/distribution/style/_interface.scss +108 -0
- package/distribution/switch/index.d.ts +10 -0
- package/distribution/switch/index.d.ts.map +1 -0
- package/distribution/switch/index.js +28 -0
- package/distribution/switch/index.js.map +1 -0
- package/distribution/switch/index.module.css +1 -0
- package/distribution/switch/index.module.scss +69 -0
- package/distribution/switch/type.d.ts +12 -0
- package/distribution/switch/type.d.ts.map +1 -0
- package/distribution/switch/type.js +2 -0
- package/distribution/switch/type.js.map +1 -0
- package/distribution/text-field/index.d.ts +11 -0
- package/distribution/text-field/index.d.ts.map +1 -0
- package/distribution/text-field/index.js +23 -0
- package/distribution/text-field/index.js.map +1 -0
- package/distribution/text-field/index.module.css +1 -0
- package/distribution/text-field/index.module.scss +81 -0
- package/distribution/text-field/type.d.ts +18 -0
- package/distribution/text-field/type.d.ts.map +1 -0
- package/distribution/text-field/type.js +2 -0
- package/distribution/text-field/type.js.map +1 -0
- package/distribution/tip/index.d.ts +10 -0
- package/distribution/tip/index.d.ts.map +1 -0
- package/distribution/tip/index.js +21 -0
- package/distribution/tip/index.js.map +1 -0
- package/distribution/tip/index.module.css +1 -0
- package/distribution/tip/index.module.scss +47 -0
- package/distribution/tip/type.d.ts +7 -0
- package/distribution/tip/type.d.ts.map +1 -0
- package/distribution/tip/type.js +2 -0
- package/distribution/tip/type.js.map +1 -0
- package/distribution/toast/index.d.ts +18 -0
- package/distribution/toast/index.d.ts.map +1 -0
- package/distribution/toast/index.js +45 -0
- package/distribution/toast/index.js.map +1 -0
- package/distribution/toast/index.module.css +1 -0
- package/distribution/toast/index.module.scss +74 -0
- package/distribution/toast/type.d.ts +20 -0
- package/distribution/toast/type.d.ts.map +1 -0
- package/distribution/toast/type.js +2 -0
- package/distribution/toast/type.js.map +1 -0
- package/package.json +99 -4
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
@use "style/interface" as *;
|
|
2
|
+
|
|
3
|
+
.region {
|
|
4
|
+
position: fixed;
|
|
5
|
+
top: calc(#{$bar} + 12px);
|
|
6
|
+
right: 16px;
|
|
7
|
+
z-index: 60;
|
|
8
|
+
display: grid;
|
|
9
|
+
gap: 8px;
|
|
10
|
+
width: min(360px, calc(100vw - 32px));
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
}
|
|
13
|
+
.toast {
|
|
14
|
+
display: grid;
|
|
15
|
+
grid-template-columns: auto 1fr auto;
|
|
16
|
+
align-items: start;
|
|
17
|
+
gap: 10px;
|
|
18
|
+
padding: 12px 12px 12px 14px;
|
|
19
|
+
border: 1px solid $line;
|
|
20
|
+
border-radius: $radius;
|
|
21
|
+
background: $raised;
|
|
22
|
+
box-shadow: $shadow;
|
|
23
|
+
color: $text;
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
line-height: 1.5;
|
|
26
|
+
pointer-events: auto;
|
|
27
|
+
animation: arrive 0.35s $ease;
|
|
28
|
+
> svg {
|
|
29
|
+
margin-top: 2px;
|
|
30
|
+
font-size: 18px;
|
|
31
|
+
}
|
|
32
|
+
p {
|
|
33
|
+
margin: 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
.success > svg {
|
|
37
|
+
color: $success;
|
|
38
|
+
}
|
|
39
|
+
.info > svg {
|
|
40
|
+
color: $accent;
|
|
41
|
+
}
|
|
42
|
+
.error {
|
|
43
|
+
border-color: $danger;
|
|
44
|
+
> svg {
|
|
45
|
+
color: $danger;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
.close {
|
|
49
|
+
display: grid;
|
|
50
|
+
place-items: center;
|
|
51
|
+
width: 24px;
|
|
52
|
+
height: 24px;
|
|
53
|
+
padding: 0;
|
|
54
|
+
border: 0;
|
|
55
|
+
border-radius: 50%;
|
|
56
|
+
background: transparent;
|
|
57
|
+
color: $soft;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
@include focus;
|
|
60
|
+
&:hover {
|
|
61
|
+
color: $text;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
@keyframes arrive {
|
|
65
|
+
from {
|
|
66
|
+
opacity: 0;
|
|
67
|
+
transform: translateY(-8px);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
@media (prefers-reduced-motion: reduce) {
|
|
71
|
+
.toast {
|
|
72
|
+
animation: none;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/** A notification after an action: `success` and `info` are polite, `error` is an alert. */
|
|
3
|
+
export interface Toast {
|
|
4
|
+
id: number;
|
|
5
|
+
message: string;
|
|
6
|
+
tone: "success" | "info" | "error";
|
|
7
|
+
}
|
|
8
|
+
export interface ToastContextValue {
|
|
9
|
+
/** Shows a notification for a few seconds (`error`s stay twice as long). */
|
|
10
|
+
notify(message: string, tone?: Toast["tone"]): void;
|
|
11
|
+
}
|
|
12
|
+
export interface ToastProviderProperties {
|
|
13
|
+
/** The region's name and the close buttons' ("Notifications", "Dismiss"). */
|
|
14
|
+
label: string;
|
|
15
|
+
dismissLabel: string;
|
|
16
|
+
/** How long a notification stays, in milliseconds (5 seconds by default). */
|
|
17
|
+
duration?: number;
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/toast/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,4FAA4F;AAC5F,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;CACpC;AAED,MAAM,WAAW,iBAAiB;IAChC,4EAA4E;IAC5E,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;CACrD;AAED,MAAM,WAAW,uBAAuB;IACtC,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/toast/type.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,101 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sharadox/interface-web-library",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-development.0",
|
|
4
|
+
"description": "Accessible, themable interface pieces for web applications: buttons, cards, dialogs, one-time code boxes, switches, text fields with prefixes, tips, copy buttons, skeletons and notifications.",
|
|
5
|
+
"private": false,
|
|
6
|
+
"license": "SEE LICENSE IN LICENCA.md",
|
|
7
|
+
"author": "Sharadox <contact@sharadox.com>",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./*/type": {
|
|
11
|
+
"sharadox-source": "./source/*/type.ts",
|
|
12
|
+
"types": "./distribution/*/type.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./*": {
|
|
15
|
+
"sharadox-source": [
|
|
16
|
+
"./source/*/index.ts",
|
|
17
|
+
"./source/*/index.tsx"
|
|
18
|
+
],
|
|
19
|
+
"types": "./distribution/*/index.d.ts",
|
|
20
|
+
"default": "./distribution/*/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"distribution",
|
|
25
|
+
"LICENCA.md",
|
|
26
|
+
"LICENSE.md",
|
|
27
|
+
"NOTICE.md"
|
|
28
|
+
],
|
|
29
|
+
"sideEffects": [
|
|
30
|
+
"**/*.css"
|
|
31
|
+
],
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=26"
|
|
34
|
+
},
|
|
35
|
+
"packageManager": "pnpm@10.34.9",
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"react": ">=19"
|
|
41
|
+
},
|
|
42
|
+
"peerDependenciesMeta": {
|
|
43
|
+
"react": {
|
|
44
|
+
"optional": true
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "library-build",
|
|
49
|
+
"lint": "eslint --max-warnings=0 .",
|
|
50
|
+
"format": "prettier --write .",
|
|
51
|
+
"format:check": "prettier --check .",
|
|
52
|
+
"type-check": "tsc --noEmit",
|
|
53
|
+
"test:unit": "vitest run --coverage",
|
|
54
|
+
"test:benchmark": "vitest bench --run --passWithNoTests",
|
|
55
|
+
"documentation": "typedoc",
|
|
56
|
+
"verify": "turbo run format:check lint type-check test:unit test:benchmark build",
|
|
57
|
+
"prepare": "turborepo-configuration library && (husky || true)"
|
|
58
|
+
},
|
|
59
|
+
"lint-staged": {
|
|
60
|
+
"*.{ts,tsx,js,mjs,cjs}": [
|
|
61
|
+
"prettier --write",
|
|
62
|
+
"eslint --fix --max-warnings=0"
|
|
63
|
+
],
|
|
64
|
+
"*.{json,md,yml,yaml,scss}": "prettier --write"
|
|
65
|
+
},
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"@sharadox/icon-web-library": "0.7.0-development.36",
|
|
68
|
+
"@sharadox/web-library": "0.12.0-development.49"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"@sharadox/es-lint-configuration-web-library": "^0.1.3",
|
|
72
|
+
"@sharadox/library-build-web-library": "^0.2.1",
|
|
73
|
+
"@sharadox/prettier-configuration-web-library": "^0.1.2",
|
|
74
|
+
"@sharadox/turborepo-configuration-web-library": "^0.1.4",
|
|
75
|
+
"@sharadox/type-script-configuration-web-library": "^0.2.3",
|
|
76
|
+
"@sharadox/vitest-configuration-web-library": "^0.2.1",
|
|
77
|
+
"@testing-library/dom": "^10.4.2",
|
|
78
|
+
"@testing-library/react": "^16.3.3",
|
|
79
|
+
"@types/node": "^26.6.6",
|
|
80
|
+
"@types/react": "^19.3.0",
|
|
81
|
+
"@types/react-dom": "^19.3.0",
|
|
82
|
+
"@vitest/coverage-v8": "^5.1.1",
|
|
83
|
+
"eslint": "9.39.5",
|
|
84
|
+
"happy-dom": "^21.0.4",
|
|
85
|
+
"husky": "^9.1.7",
|
|
86
|
+
"lint-staged": "^17.6.2",
|
|
87
|
+
"prettier": "^3.10.1",
|
|
88
|
+
"react": "^19.3.1",
|
|
89
|
+
"react-dom": "^19.3.1",
|
|
90
|
+
"sass": "^1.108.2",
|
|
91
|
+
"turbo": "^2.11.13",
|
|
92
|
+
"typedoc": "^0.28.20",
|
|
93
|
+
"typescript": "6.0.3",
|
|
94
|
+
"vitest": "^5.1.1"
|
|
95
|
+
},
|
|
96
|
+
"repository": {
|
|
97
|
+
"type": "git",
|
|
98
|
+
"url": "git+https://github.com/Sharadox/interface-web-library.git"
|
|
99
|
+
},
|
|
100
|
+
"homepage": "https://github.com/Sharadox/interface-web-library#readme"
|
|
101
|
+
}
|