bits-lab 0.1.0 → 0.1.2
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 +13 -7
- package/dist/SignalText.js +1 -1
- package/package.json +28 -4
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Bits Lab
|
|
2
2
|
|
|
3
|
-
159 original React components
|
|
3
|
+
**Game feel for real products.** 159 original React components that bring game design to everyday software: onboarding as a quest, milestones as achievements, progress bars, combos, streaks, loading screens with tips and hold-to-confirm for risky actions, plus everything around them (inputs, overlays, navigation, data and motion), in a playful 8-bit style. Every component brings its own styles, so there is nothing else to import or configure.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Play with them all, tweak their props and copy the code at **https://bits-lab.vercel.app**.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -23,14 +23,20 @@ import GravityBox from "bits-lab/GravityBox";
|
|
|
23
23
|
## Use
|
|
24
24
|
|
|
25
25
|
```jsx
|
|
26
|
-
import {
|
|
26
|
+
import { AchievementToast, HoldToConfirm, QuestLog, achievement } from "bits-lab";
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
const quests = [
|
|
29
|
+
{ id: "profile", title: "Create your profile", xp: 50 },
|
|
30
|
+
{ id: "invite", title: "Invite a teammate", xp: 100, requires: ["profile"] }
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
// Onboarding as a quest: finishing a task pops an achievement.
|
|
34
|
+
export function Onboarding({ onDeleteDraft }) {
|
|
29
35
|
return (
|
|
30
36
|
<>
|
|
31
|
-
<
|
|
32
|
-
<HoldToConfirm onConfirm={
|
|
33
|
-
<
|
|
37
|
+
<QuestLog quests={quests} onQuestComplete={quest => achievement({ title: quest.title, xp: quest.xp, tier: "gold" })} />
|
|
38
|
+
<HoldToConfirm onConfirm={onDeleteDraft}>Hold to delete draft</HoldToConfirm>
|
|
39
|
+
<AchievementToast />
|
|
34
40
|
</>
|
|
35
41
|
);
|
|
36
42
|
}
|
package/dist/SignalText.js
CHANGED
|
@@ -5,7 +5,7 @@ const STYLE_ID = "bl-signal-text";
|
|
|
5
5
|
const CSS = `
|
|
6
6
|
.bl-signal { position: relative; margin: 0; color: var(--bl-ink); }
|
|
7
7
|
.bl-signal__glyphs { display: inline; }
|
|
8
|
-
.bl-signal__ch { white-space: pre; }
|
|
8
|
+
.bl-signal__ch { white-space: pre-wrap; }
|
|
9
9
|
.bl-signal__ch[data-noise] { color: var(--bl-noise); }
|
|
10
10
|
.bl-signal[data-mode="flap"] .bl-signal__glyphs { display: inline-flex; flex-wrap: wrap; gap: var(--bl-cell-gap); }
|
|
11
11
|
.bl-signal[data-mode="flap"] .bl-signal__word { display: inline-flex; gap: var(--bl-cell-gap); }
|
package/package.json
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bits-lab",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "159 original
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Game feel for real products: 159 original React components for quests, achievements, progress, combos, streaks and hold-to-confirm, in a playful 8-bit style. Zero dependencies, styles included.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Steven Phung",
|
|
7
7
|
"homepage": "https://bits-lab.vercel.app",
|
|
8
|
-
"
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/stevenphung/bits-lab.git",
|
|
11
|
+
"directory": "packages/bits-lab"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/stevenphung/bits-lab/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"react",
|
|
18
|
+
"components",
|
|
19
|
+
"gamification",
|
|
20
|
+
"game-ui",
|
|
21
|
+
"onboarding",
|
|
22
|
+
"achievements",
|
|
23
|
+
"micro-interactions",
|
|
24
|
+
"animation",
|
|
25
|
+
"pixel",
|
|
26
|
+
"8-bit",
|
|
27
|
+
"ui"
|
|
28
|
+
],
|
|
9
29
|
"type": "module",
|
|
10
30
|
"sideEffects": false,
|
|
11
31
|
"main": "./dist/index.js",
|
|
@@ -22,7 +42,11 @@
|
|
|
22
42
|
},
|
|
23
43
|
"./package.json": "./package.json"
|
|
24
44
|
},
|
|
25
|
-
"files": [
|
|
45
|
+
"files": [
|
|
46
|
+
"dist",
|
|
47
|
+
"README.md",
|
|
48
|
+
"LICENSE"
|
|
49
|
+
],
|
|
26
50
|
"peerDependencies": {
|
|
27
51
|
"matter-js": ">=0.19",
|
|
28
52
|
"react": "^19.0.0",
|