@kolkrabbi/kol-framework 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/README.md +30 -0
- package/kol-brand-color.css +151 -0
- package/kol-framework.css +1225 -0
- package/package.json +46 -0
- package/src/AppShell.jsx +46 -0
- package/src/BrandHero.jsx +14 -0
- package/src/Layout.jsx +20 -0
- package/src/PageSection.jsx +24 -0
- package/src/PortalFooter.jsx +22 -0
- package/src/ScrollToTop.jsx +17 -0
- package/src/SideNav.jsx +205 -0
- package/src/SubPageHero.jsx +27 -0
- package/src/ThemeToggle.jsx +95 -0
- package/src/index.js +18 -0
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @kolkrabbi/kol-framework
|
|
2
|
+
|
|
3
|
+
The KOL app shell — sidenav, layout, theme toggle, footer, and heroes, plus the brand color layer. Site chrome shared across KOL apps.
|
|
4
|
+
|
|
5
|
+
`SideNav` takes its nav data as props (`navTree` + `getActivePage`) so the navigation tree stays app-local.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm i @kolkrabbi/kol-framework @kolkrabbi/kol-component @kolkrabbi/kol-theme
|
|
11
|
+
# react, react-dom, react-router-dom are peers
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Use
|
|
15
|
+
|
|
16
|
+
```css
|
|
17
|
+
@import "tailwindcss";
|
|
18
|
+
@import "@kolkrabbi/kol-theme";
|
|
19
|
+
@import "@kolkrabbi/kol-framework/kol-brand-color.css";
|
|
20
|
+
@import "@kolkrabbi/kol-framework/kol-framework.css";
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```jsx
|
|
24
|
+
import { AppShell } from '@kolkrabbi/kol-framework'
|
|
25
|
+
import { NAV_TREE, getActivePage } from './sidebars.config'
|
|
26
|
+
|
|
27
|
+
<AppShell navTree={NAV_TREE} getActivePage={getActivePage} />
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Exports: `AppShell`, `SideNav`, `ThemeToggle`, `Layout`, `PageSection`, `PortalFooter`, `ScrollToTop`, `BrandHero`, `SubPageHero`.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* kol-brand-color.css — Kolkrabbi brand color layer (the `apps/brand` identity).
|
|
3
|
+
*
|
|
4
|
+
* Layers ON TOP of `kol-color.css` (the DS theme): the DS ships brand-neutral
|
|
5
|
+
* (accent defaults to ink-on-surface), this file binds the Kolkrabbi identity.
|
|
6
|
+
* Imported explicitly by `index.css` after the theme umbrella.
|
|
7
|
+
*
|
|
8
|
+
* Token naming: "brand" is the APP (`apps/brand`), never a token prefix. Hue
|
|
9
|
+
* ramps are DS palette primitives (`--kol-color-{hue}-*`); the identity roles
|
|
10
|
+
* are the DS accent (`--kol-accent-*`), rebound here from neutral to Kolkrabbi
|
|
11
|
+
* yellow. In a scaffolded project this file is added by `init-client`.
|
|
12
|
+
*
|
|
13
|
+
* Anchors: ★ marks the canonical stop matching the source design references.
|
|
14
|
+
* Anchors vary per ramp — intentional, not a symmetry rule.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/* =============================================================================
|
|
18
|
+
* PALETTE PRIMITIVES — hue ramps (DS palette layer)
|
|
19
|
+
*
|
|
20
|
+
* Five hue families, 5 stops each (100-500). Cream is a utility neutral, not
|
|
21
|
+
* identity but project-flavored. Grey lives here too as the project's fixed
|
|
22
|
+
* neutral ramp (theme-independent — used by the slide-deck system); consumers
|
|
23
|
+
* that need a theme-aware opaque grey use the canonical `--kol-oq-*` scale.
|
|
24
|
+
* ============================================================================= */
|
|
25
|
+
|
|
26
|
+
:root {
|
|
27
|
+
/* Yellow — pure-yellow lock, no orange contamination. ★ anchor at 300. */
|
|
28
|
+
--kol-color-yellow-100: #FFEA57;
|
|
29
|
+
--kol-color-yellow-200: #FFDF43;
|
|
30
|
+
--kol-color-yellow-300: #FFCF33; /* anchor */
|
|
31
|
+
--kol-color-yellow-400: #FFBC1F;
|
|
32
|
+
--kol-color-yellow-500: #FFA113;
|
|
33
|
+
|
|
34
|
+
/* Red — rust / terracotta. ★ anchor at 200 (light-side). */
|
|
35
|
+
--kol-color-red-100: #CC7762;
|
|
36
|
+
--kol-color-red-200: #AD5038; /* anchor */
|
|
37
|
+
--kol-color-red-300: #913F2B;
|
|
38
|
+
--kol-color-red-400: #662C1E;
|
|
39
|
+
--kol-color-red-500: #522418;
|
|
40
|
+
|
|
41
|
+
/* Blue — saturated steel into deep navy. ★ anchor at 400. */
|
|
42
|
+
--kol-color-blue-100: #497DA2;
|
|
43
|
+
--kol-color-blue-200: #3F6485;
|
|
44
|
+
--kol-color-blue-300: #314152;
|
|
45
|
+
--kol-color-blue-400: #222D3D; /* anchor */
|
|
46
|
+
--kol-color-blue-500: #181F29;
|
|
47
|
+
|
|
48
|
+
/* Orange — hybrid: light tints + canonical anchor at 300. */
|
|
49
|
+
--kol-color-orange-100: #F5CF81;
|
|
50
|
+
--kol-color-orange-200: #E3A054;
|
|
51
|
+
--kol-color-orange-300: #DF760B; /* anchor */
|
|
52
|
+
--kol-color-orange-400: #A54209;
|
|
53
|
+
--kol-color-orange-500: #7C2900;
|
|
54
|
+
|
|
55
|
+
/* Teal — cool counterpoint. ★ anchor at 300. */
|
|
56
|
+
--kol-color-teal-100: #9BCCCD;
|
|
57
|
+
--kol-color-teal-200: #6FB6B7;
|
|
58
|
+
--kol-color-teal-300: #49A0A2; /* anchor */
|
|
59
|
+
--kol-color-teal-400: #387E7F;
|
|
60
|
+
--kol-color-teal-500: #275A5B;
|
|
61
|
+
|
|
62
|
+
/* Cream — utility neutral, project-flavored. */
|
|
63
|
+
--kol-color-cream-100: #FAF7F0;
|
|
64
|
+
--kol-color-cream-200: #F5F0E6;
|
|
65
|
+
--kol-color-cream-300: #F5EBD8;
|
|
66
|
+
--kol-color-cream-400: #F0E0C0;
|
|
67
|
+
--kol-color-cream-500: #EBD5A9;
|
|
68
|
+
|
|
69
|
+
/* Grey — fixed 10-stop neutral (theme-independent; slide-deck scale). */
|
|
70
|
+
--grey-50: #FCFBFB;
|
|
71
|
+
--grey-100: #EBEBEB;
|
|
72
|
+
--grey-200: #DBDBDB;
|
|
73
|
+
--grey-300: #A3A3A4;
|
|
74
|
+
--grey-400: #5B5B5D;
|
|
75
|
+
--grey-500: #363639;
|
|
76
|
+
--grey-600: #2E2E30;
|
|
77
|
+
--grey-700: #242427;
|
|
78
|
+
--grey-800: #1B1B1E;
|
|
79
|
+
--grey-900: #131316;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* =============================================================================
|
|
83
|
+
* IDENTITY — DS accent rebind (theme pairs)
|
|
84
|
+
*
|
|
85
|
+
* kol-color.css defaults --kol-accent-* to ink-on-surface (brand-neutral).
|
|
86
|
+
* This file rebinds the accent role to the Kolkrabbi yellow identity. Edit
|
|
87
|
+
* these lines to rebrand without touching any consumer — buttons, focus rings,
|
|
88
|
+
* sidenav active dots all switch from ink to brand once this loads.
|
|
89
|
+
* Pairs ensure ink-on-fill contrast holds across the system.
|
|
90
|
+
* ============================================================================= */
|
|
91
|
+
|
|
92
|
+
:root {
|
|
93
|
+
--kol-accent-primary: var(--kol-color-yellow-300); /* dominant identity color */
|
|
94
|
+
--kol-accent-on-primary: var(--kol-color-blue-400); /* ink on accent-primary */
|
|
95
|
+
--kol-accent-primary-strong: var(--kol-color-yellow-400); /* hover/active */
|
|
96
|
+
--kol-accent-secondary: var(--kol-color-red-200); /* secondary identity color */
|
|
97
|
+
--kol-accent-on-secondary: var(--kol-color-cream-100); /* ink on accent-secondary */
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* =============================================================================
|
|
101
|
+
* TAILWIND CONTRACT — palette + accent exposures
|
|
102
|
+
*
|
|
103
|
+
* Tailwind v4 reads @theme blocks from any imported CSS. Generates
|
|
104
|
+
* `bg-kol-yellow-300`, `bg-kol-accent-primary`, etc.
|
|
105
|
+
* ============================================================================= */
|
|
106
|
+
|
|
107
|
+
@theme {
|
|
108
|
+
/* Identity (accent) */
|
|
109
|
+
--color-kol-accent-primary: var(--kol-accent-primary);
|
|
110
|
+
--color-kol-accent-on-primary: var(--kol-accent-on-primary);
|
|
111
|
+
--color-kol-accent-secondary: var(--kol-accent-secondary);
|
|
112
|
+
--color-kol-accent-on-secondary: var(--kol-accent-on-secondary);
|
|
113
|
+
|
|
114
|
+
/* Palette ramp access — direct stops for one-off / data-viz / chart needs. */
|
|
115
|
+
--color-kol-yellow-100: var(--kol-color-yellow-100);
|
|
116
|
+
--color-kol-yellow-200: var(--kol-color-yellow-200);
|
|
117
|
+
--color-kol-yellow-300: var(--kol-color-yellow-300);
|
|
118
|
+
--color-kol-yellow-400: var(--kol-color-yellow-400);
|
|
119
|
+
--color-kol-yellow-500: var(--kol-color-yellow-500);
|
|
120
|
+
|
|
121
|
+
--color-kol-red-100: var(--kol-color-red-100);
|
|
122
|
+
--color-kol-red-200: var(--kol-color-red-200);
|
|
123
|
+
--color-kol-red-300: var(--kol-color-red-300);
|
|
124
|
+
--color-kol-red-400: var(--kol-color-red-400);
|
|
125
|
+
--color-kol-red-500: var(--kol-color-red-500);
|
|
126
|
+
|
|
127
|
+
--color-kol-blue-100: var(--kol-color-blue-100);
|
|
128
|
+
--color-kol-blue-200: var(--kol-color-blue-200);
|
|
129
|
+
--color-kol-blue-300: var(--kol-color-blue-300);
|
|
130
|
+
--color-kol-blue-400: var(--kol-color-blue-400);
|
|
131
|
+
--color-kol-blue-500: var(--kol-color-blue-500);
|
|
132
|
+
|
|
133
|
+
--color-kol-orange-100: var(--kol-color-orange-100);
|
|
134
|
+
--color-kol-orange-200: var(--kol-color-orange-200);
|
|
135
|
+
--color-kol-orange-300: var(--kol-color-orange-300);
|
|
136
|
+
--color-kol-orange-400: var(--kol-color-orange-400);
|
|
137
|
+
--color-kol-orange-500: var(--kol-color-orange-500);
|
|
138
|
+
|
|
139
|
+
--color-kol-teal-100: var(--kol-color-teal-100);
|
|
140
|
+
--color-kol-teal-200: var(--kol-color-teal-200);
|
|
141
|
+
--color-kol-teal-300: var(--kol-color-teal-300);
|
|
142
|
+
--color-kol-teal-400: var(--kol-color-teal-400);
|
|
143
|
+
--color-kol-teal-500: var(--kol-color-teal-500);
|
|
144
|
+
|
|
145
|
+
/* Cream — utility neutral. */
|
|
146
|
+
--color-kol-cream-100: var(--kol-color-cream-100);
|
|
147
|
+
--color-kol-cream-200: var(--kol-color-cream-200);
|
|
148
|
+
--color-kol-cream-300: var(--kol-color-cream-300);
|
|
149
|
+
--color-kol-cream-400: var(--kol-color-cream-400);
|
|
150
|
+
--color-kol-cream-500: var(--kol-color-cream-500);
|
|
151
|
+
}
|