fernwell 0.1.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/CHANGELOG.md +49 -0
- package/LICENSE +21 -0
- package/README.md +265 -0
- package/dist/combobox.d.ts +28 -0
- package/dist/fernwell.cjs +4 -0
- package/dist/fernwell.cjs.map +7 -0
- package/dist/fernwell.css +1548 -0
- package/dist/fernwell.esm.js +4 -0
- package/dist/fernwell.esm.js.map +7 -0
- package/dist/fernwell.iife.js +5 -0
- package/dist/fernwell.iife.js.map +7 -0
- package/dist/fernwell.min.css +2 -0
- package/dist/fernwell.tokens.css +105 -0
- package/dist/iife.d.ts +2 -0
- package/dist/index.d.ts +36 -0
- package/dist/loading.d.ts +5 -0
- package/dist/modal.d.ts +13 -0
- package/dist/nav.d.ts +3 -0
- package/dist/theme.d.ts +52 -0
- package/dist/toast.d.ts +14 -0
- package/dist/tokens.json +199 -0
- package/package.json +61 -0
package/dist/toast.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toast — a single, reused, bottom-right notice.
|
|
3
|
+
*
|
|
4
|
+
* toast.show('Invoice sent');
|
|
5
|
+
* toast.show('That card was declined', { variant: 'error', duration: 6000 });
|
|
6
|
+
*/
|
|
7
|
+
export type ToastVariant = 'success' | 'error' | 'info' | 'pending';
|
|
8
|
+
export interface ToastOptions {
|
|
9
|
+
variant?: ToastVariant;
|
|
10
|
+
/** ms before it hides; 0 keeps it until `hide()` or the next `show()`. */
|
|
11
|
+
duration?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function show(message: string, { variant, duration }?: ToastOptions): HTMLElement;
|
|
14
|
+
export declare function hide(): void;
|
package/dist/tokens.json
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
{
|
|
2
|
+
"prefix": "fw",
|
|
3
|
+
"$schema-notes": [
|
|
4
|
+
"Each token has either `value` (same in both themes) or `light` + optional `dark`.",
|
|
5
|
+
"`{name}` inside a value references another token in the same group and is emitted as var(--fw-name).",
|
|
6
|
+
"Tokens whose value references another token are derived: override the seed, and they follow in both themes."
|
|
7
|
+
],
|
|
8
|
+
"color": {
|
|
9
|
+
"text": {
|
|
10
|
+
"light": "#1F2430",
|
|
11
|
+
"dark": "#F2F1EA",
|
|
12
|
+
"comment": "primary text — dark neutral in light, warm off-white in dark (never pure white)"
|
|
13
|
+
},
|
|
14
|
+
"text-soft": {
|
|
15
|
+
"light": "#565D6E",
|
|
16
|
+
"dark": "#9CA1B0",
|
|
17
|
+
"comment": "secondary text — never pure gray"
|
|
18
|
+
},
|
|
19
|
+
"bg": {
|
|
20
|
+
"light": "#F5F6F1",
|
|
21
|
+
"dark": "#14161C",
|
|
22
|
+
"comment": "page background — dark is near-black with a trace of Plum, never pure black"
|
|
23
|
+
},
|
|
24
|
+
"bg-dim": {
|
|
25
|
+
"light": "#EAEBE4",
|
|
26
|
+
"dark": "#2B2F3B",
|
|
27
|
+
"comment": "dividers, input borders, recessed surfaces"
|
|
28
|
+
},
|
|
29
|
+
"surface": {
|
|
30
|
+
"light": "#FFFFFF",
|
|
31
|
+
"dark": "#1D2029",
|
|
32
|
+
"comment": "card / panel surface"
|
|
33
|
+
},
|
|
34
|
+
"primary": {
|
|
35
|
+
"value": "#FFC145",
|
|
36
|
+
"comment": "primary brand / CTA (default: Marigold) — same hex in both themes"
|
|
37
|
+
},
|
|
38
|
+
"primary-hover": {
|
|
39
|
+
"value": "color-mix(in srgb, {primary}, {text} 12%)",
|
|
40
|
+
"comment": "derived: darkens in light, brightens in dark"
|
|
41
|
+
},
|
|
42
|
+
"primary-soft": {
|
|
43
|
+
"value": "color-mix(in srgb, {primary}, white 35%)",
|
|
44
|
+
"comment": "derived: highlight (empty-state blob gradient)"
|
|
45
|
+
},
|
|
46
|
+
"secondary": {
|
|
47
|
+
"light": "#4C3A73",
|
|
48
|
+
"dark": "#6B54A3",
|
|
49
|
+
"comment": "secondary brand, nav, headers (default: Plum) — lifted a step in dark so it stays legible"
|
|
50
|
+
},
|
|
51
|
+
"secondary-hover": {
|
|
52
|
+
"value": "color-mix(in srgb, {secondary}, {text} 15%)",
|
|
53
|
+
"comment": "derived"
|
|
54
|
+
},
|
|
55
|
+
"secondary-bg": {
|
|
56
|
+
"light": "color-mix(in srgb, {secondary} 10%, {surface})",
|
|
57
|
+
"dark": "color-mix(in srgb, {secondary} 16%, transparent)",
|
|
58
|
+
"comment": "derived: tint — opaque pastel in light, low-opacity wash in dark"
|
|
59
|
+
},
|
|
60
|
+
"success": {
|
|
61
|
+
"light": "#3FA672",
|
|
62
|
+
"dark": "#55D194",
|
|
63
|
+
"comment": "success (default: Meadow) — status colours lift 1–2 steps lighter in dark to hold contrast"
|
|
64
|
+
},
|
|
65
|
+
"success-bg": {
|
|
66
|
+
"light": "color-mix(in srgb, {success} 12%, {surface})",
|
|
67
|
+
"dark": "color-mix(in srgb, {success} 14%, transparent)",
|
|
68
|
+
"comment": "derived"
|
|
69
|
+
},
|
|
70
|
+
"warning": {
|
|
71
|
+
"light": "#E8A521",
|
|
72
|
+
"dark": "#FFD166",
|
|
73
|
+
"comment": "pending / waiting (default: deep Marigold) — independent of primary so it stays amber when primary changes"
|
|
74
|
+
},
|
|
75
|
+
"warning-bg": {
|
|
76
|
+
"light": "color-mix(in srgb, {warning} 14%, {surface})",
|
|
77
|
+
"dark": "color-mix(in srgb, {warning} 16%, transparent)",
|
|
78
|
+
"comment": "derived"
|
|
79
|
+
},
|
|
80
|
+
"danger": {
|
|
81
|
+
"light": "#E85B4F",
|
|
82
|
+
"dark": "#FF8478",
|
|
83
|
+
"comment": "error / danger (default: Coral)"
|
|
84
|
+
},
|
|
85
|
+
"danger-bg": {
|
|
86
|
+
"light": "color-mix(in srgb, {danger} 13%, {surface})",
|
|
87
|
+
"dark": "color-mix(in srgb, {danger} 14%, transparent)",
|
|
88
|
+
"comment": "derived"
|
|
89
|
+
},
|
|
90
|
+
"info": {
|
|
91
|
+
"light": "#3E8FD0",
|
|
92
|
+
"dark": "#6BB3E8",
|
|
93
|
+
"comment": "info (default: Sky)"
|
|
94
|
+
},
|
|
95
|
+
"info-bg": {
|
|
96
|
+
"light": "color-mix(in srgb, {info} 12%, {surface})",
|
|
97
|
+
"dark": "color-mix(in srgb, {info} 14%, transparent)",
|
|
98
|
+
"comment": "derived"
|
|
99
|
+
},
|
|
100
|
+
"on-primary": {
|
|
101
|
+
"value": "#1F2430",
|
|
102
|
+
"comment": "text on primary surfaces (buttons, avatars); never flips with the theme"
|
|
103
|
+
},
|
|
104
|
+
"on-secondary": {
|
|
105
|
+
"value": "#FFFFFF",
|
|
106
|
+
"comment": "text on secondary / text-coloured surfaces (nav, footer, banners)"
|
|
107
|
+
},
|
|
108
|
+
"on-secondary-soft": {
|
|
109
|
+
"value": "color-mix(in srgb, {on-secondary} 72%, transparent)",
|
|
110
|
+
"comment": "derived: secondary text on the nav bar"
|
|
111
|
+
},
|
|
112
|
+
"on-secondary-fill": {
|
|
113
|
+
"value": "color-mix(in srgb, {on-secondary} 10%, transparent)",
|
|
114
|
+
"comment": "derived: translucent control fill on the nav bar"
|
|
115
|
+
},
|
|
116
|
+
"on-secondary-line": {
|
|
117
|
+
"value": "color-mix(in srgb, {on-secondary} 16%, transparent)",
|
|
118
|
+
"comment": "derived: translucent border on the nav bar"
|
|
119
|
+
},
|
|
120
|
+
"overlay": {
|
|
121
|
+
"light": "rgba(31, 36, 48, 0.55)",
|
|
122
|
+
"dark": "rgba(0, 0, 0, 0.6)",
|
|
123
|
+
"comment": "modal backdrop"
|
|
124
|
+
},
|
|
125
|
+
"overlay-soft": {
|
|
126
|
+
"light": "rgba(31, 36, 48, 0.32)",
|
|
127
|
+
"dark": "rgba(0, 0, 0, 0.4)",
|
|
128
|
+
"comment": "drawer backdrop"
|
|
129
|
+
},
|
|
130
|
+
"focus-ring": {
|
|
131
|
+
"value": "0 0 0 4px color-mix(in srgb, {primary} 25%, transparent)",
|
|
132
|
+
"comment": "derived: box-shadow focus ring, primary wash"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"font": {
|
|
136
|
+
"display": {
|
|
137
|
+
"value": "'Plus Jakarta Sans', system-ui, sans-serif",
|
|
138
|
+
"comment": "anything that should feel like a voice — headlines, empty states, onboarding"
|
|
139
|
+
},
|
|
140
|
+
"body": {
|
|
141
|
+
"value": "'Inter', system-ui, sans-serif",
|
|
142
|
+
"comment": "anything read quickly and often — tables, forms, nav"
|
|
143
|
+
},
|
|
144
|
+
"mono": {
|
|
145
|
+
"value": "'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
146
|
+
"comment": "numbers, IDs, anywhere precision matters more than warmth"
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"space": {
|
|
150
|
+
"1": { "value": "4px" },
|
|
151
|
+
"2": { "value": "8px" },
|
|
152
|
+
"3": { "value": "12px" },
|
|
153
|
+
"4": { "value": "16px" },
|
|
154
|
+
"5": { "value": "24px" },
|
|
155
|
+
"6": { "value": "32px" },
|
|
156
|
+
"7": { "value": "48px" },
|
|
157
|
+
"8": { "value": "64px" },
|
|
158
|
+
"9": { "value": "96px" }
|
|
159
|
+
},
|
|
160
|
+
"radius": {
|
|
161
|
+
"sm": { "value": "10px", "comment": "inputs, small badges" },
|
|
162
|
+
"md": { "value": "16px", "comment": "buttons, tags" },
|
|
163
|
+
"lg": { "value": "24px", "comment": "cards" },
|
|
164
|
+
"xl": { "value": "32px", "comment": "modals, hero panels" },
|
|
165
|
+
"full": { "value": "999px", "comment": "avatars, pills" }
|
|
166
|
+
},
|
|
167
|
+
"shadow": {
|
|
168
|
+
"sm": {
|
|
169
|
+
"light": "0 1px 2px rgba(31, 36, 48, 0.06), 0 1px 1px rgba(31, 36, 48, 0.04)",
|
|
170
|
+
"dark": "0 1px 2px rgba(0, 0, 0, 0.3)"
|
|
171
|
+
},
|
|
172
|
+
"md": {
|
|
173
|
+
"light": "0 4px 12px rgba(31, 36, 48, 0.08), 0 2px 4px rgba(31, 36, 48, 0.04)",
|
|
174
|
+
"dark": "0 4px 12px rgba(0, 0, 0, 0.35)"
|
|
175
|
+
},
|
|
176
|
+
"lg": {
|
|
177
|
+
"light": "0 12px 32px rgba(31, 36, 48, 0.12), 0 4px 8px rgba(31, 36, 48, 0.06)",
|
|
178
|
+
"dark": "0 12px 32px rgba(0, 0, 0, 0.45)"
|
|
179
|
+
},
|
|
180
|
+
"primary": {
|
|
181
|
+
"light": "0 6px 16px color-mix(in srgb, {primary} 35%, transparent)",
|
|
182
|
+
"dark": "0 6px 16px color-mix(in srgb, {primary} 22%, transparent)",
|
|
183
|
+
"comment": "derived: CTA glow"
|
|
184
|
+
},
|
|
185
|
+
"success": {
|
|
186
|
+
"light": "0 6px 16px color-mix(in srgb, {success} 28%, transparent)",
|
|
187
|
+
"dark": "0 6px 16px color-mix(in srgb, {success} 22%, transparent)",
|
|
188
|
+
"comment": "derived"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"border": {
|
|
192
|
+
"w": { "value": "1.5px", "comment": "the system's one border weight" }
|
|
193
|
+
},
|
|
194
|
+
"motion": {
|
|
195
|
+
"fast": { "value": "120ms", "comment": "buttons & controls" },
|
|
196
|
+
"base": { "value": "180ms", "comment": "cards, modals, dropdowns entering" },
|
|
197
|
+
"ease": { "value": "ease" }
|
|
198
|
+
}
|
|
199
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fernwell",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Fernwell — the HunnyDo design system. Design tokens, CSS components, and small vanilla JS enhancers that work in any web app, with or without a build step.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Jacob Knaack",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/JacobKnaack/fernwell.git"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"design-system",
|
|
14
|
+
"design-tokens",
|
|
15
|
+
"css",
|
|
16
|
+
"ui",
|
|
17
|
+
"components",
|
|
18
|
+
"hunnydo",
|
|
19
|
+
"fernwell"
|
|
20
|
+
],
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"CHANGELOG.md"
|
|
24
|
+
],
|
|
25
|
+
"sideEffects": [
|
|
26
|
+
"*.css"
|
|
27
|
+
],
|
|
28
|
+
"main": "./dist/fernwell.cjs",
|
|
29
|
+
"module": "./dist/fernwell.esm.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"style": "./dist/fernwell.css",
|
|
32
|
+
"unpkg": "./dist/fernwell.iife.js",
|
|
33
|
+
"jsdelivr": "./dist/fernwell.iife.js",
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"import": "./dist/fernwell.esm.js",
|
|
38
|
+
"require": "./dist/fernwell.cjs"
|
|
39
|
+
},
|
|
40
|
+
"./css": "./dist/fernwell.css",
|
|
41
|
+
"./css/min": "./dist/fernwell.min.css",
|
|
42
|
+
"./tokens.css": "./dist/fernwell.tokens.css",
|
|
43
|
+
"./tokens.json": "./dist/tokens.json",
|
|
44
|
+
"./package.json": "./package.json"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"tokens": "node scripts/gen-tokens.mjs",
|
|
48
|
+
"lint": "node scripts/lint-tokens.mjs",
|
|
49
|
+
"build": "npm run tokens && npm run lint && node scripts/build.mjs && tsc",
|
|
50
|
+
"docs": "serve docs/",
|
|
51
|
+
"prepublishOnly": "npm run build"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=18"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"esbuild": "^0.25.12",
|
|
58
|
+
"serve": "^14.2.6",
|
|
59
|
+
"typescript": "^5.9.3"
|
|
60
|
+
}
|
|
61
|
+
}
|