@harismawan/stamp-ui 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/LICENSE +21 -0
- package/README.md +83 -0
- package/dist/GlobalStyles.d.ts +1 -0
- package/dist/GlobalStyles.js +96 -0
- package/dist/components/Accordion.d.ts +12 -0
- package/dist/components/Accordion.js +85 -0
- package/dist/components/Alert.d.ts +9 -0
- package/dist/components/Alert.js +88 -0
- package/dist/components/Avatar.d.ts +12 -0
- package/dist/components/Avatar.js +67 -0
- package/dist/components/Badge.d.ts +7 -0
- package/dist/components/Badge.js +40 -0
- package/dist/components/Breadcrumb.d.ts +10 -0
- package/dist/components/Breadcrumb.js +50 -0
- package/dist/components/Button.d.ts +6 -0
- package/dist/components/Button.js +95 -0
- package/dist/components/Card.d.ts +8 -0
- package/dist/components/Card.js +55 -0
- package/dist/components/Checkbox.d.ts +8 -0
- package/dist/components/Checkbox.js +49 -0
- package/dist/components/ColorPicker.d.ts +7 -0
- package/dist/components/ColorPicker.js +61 -0
- package/dist/components/ConfirmDialog.d.ts +9 -0
- package/dist/components/ConfirmDialog.js +58 -0
- package/dist/components/Divider.d.ts +6 -0
- package/dist/components/Divider.js +45 -0
- package/dist/components/Drawer.d.ts +10 -0
- package/dist/components/Drawer.js +92 -0
- package/dist/components/DropdownMenu.d.ts +20 -0
- package/dist/components/DropdownMenu.js +139 -0
- package/dist/components/EmptyState.d.ts +8 -0
- package/dist/components/EmptyState.js +43 -0
- package/dist/components/IconPicker.d.ts +7 -0
- package/dist/components/IconPicker.js +45 -0
- package/dist/components/Input.d.ts +6 -0
- package/dist/components/Input.js +63 -0
- package/dist/components/Modal.d.ts +8 -0
- package/dist/components/Modal.js +104 -0
- package/dist/components/NumberInput.d.ts +23 -0
- package/dist/components/NumberInput.js +83 -0
- package/dist/components/Pagination.d.ts +7 -0
- package/dist/components/Pagination.js +81 -0
- package/dist/components/Popover.d.ts +8 -0
- package/dist/components/Popover.js +39 -0
- package/dist/components/Progress.d.ts +9 -0
- package/dist/components/Progress.js +41 -0
- package/dist/components/Radio.d.ts +14 -0
- package/dist/components/Radio.js +72 -0
- package/dist/components/Skeleton.d.ts +34 -0
- package/dist/components/Skeleton.js +39 -0
- package/dist/components/Slider.d.ts +10 -0
- package/dist/components/Slider.js +47 -0
- package/dist/components/Spinner.d.ts +6 -0
- package/dist/components/Spinner.js +52 -0
- package/dist/components/Stat.d.ts +9 -0
- package/dist/components/Stat.js +44 -0
- package/dist/components/Stepper.d.ts +11 -0
- package/dist/components/Stepper.js +97 -0
- package/dist/components/Switch.d.ts +8 -0
- package/dist/components/Switch.js +58 -0
- package/dist/components/Table.d.ts +6 -0
- package/dist/components/Table.js +41 -0
- package/dist/components/Tabs.d.ts +21 -0
- package/dist/components/Tabs.js +174 -0
- package/dist/components/Tag.d.ts +6 -0
- package/dist/components/Tag.js +47 -0
- package/dist/components/Toast.d.ts +26 -0
- package/dist/components/Toast.js +74 -0
- package/dist/components/Tooltip.d.ts +8 -0
- package/dist/components/Tooltip.js +43 -0
- package/dist/components/layout/index.d.ts +56 -0
- package/dist/components/layout/index.js +72 -0
- package/dist/hooks/useClickOutside.d.ts +2 -0
- package/dist/hooks/useClickOutside.js +25 -0
- package/dist/hooks/useDisclosure.d.ts +8 -0
- package/dist/hooks/useDisclosure.js +9 -0
- package/dist/hooks/useThemeStore.d.ts +20 -0
- package/dist/hooks/useThemeStore.js +7 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +43 -0
- package/dist/provider.d.ts +14 -0
- package/dist/provider.js +14 -0
- package/dist/theme.d.ts +193 -0
- package/dist/theme.js +156 -0
- package/package.json +48 -0
package/dist/theme.js
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stamp theme — saweria-flat. Solid yellow primary, white surfaces, hard
|
|
3
|
+
* offset "stamp" shadows instead of blurry diffusion, thin definite borders,
|
|
4
|
+
* no gradients on UI chrome.
|
|
5
|
+
*/
|
|
6
|
+
const palette = {
|
|
7
|
+
// Saweria-bright sunflower yellow.
|
|
8
|
+
yellow: '#FFDE15',
|
|
9
|
+
yellowHover: '#FFCB05',
|
|
10
|
+
yellowActive: '#E6B800',
|
|
11
|
+
yellowSoft: '#FFF6BF',
|
|
12
|
+
yellowSofter: '#FFFCE0',
|
|
13
|
+
// Coral accent (fun callouts, error).
|
|
14
|
+
coral: '#FF6B6B',
|
|
15
|
+
coralSoft: '#FFE0E0',
|
|
16
|
+
// Deep coral for links on the light cream bg — #A33636 hits ~6.5:1 against
|
|
17
|
+
// cream (#FFFCF0), clearing WCAG AA for normal text. The lighter #D94F4F
|
|
18
|
+
// only reaches ~3.9:1 on cream and is reserved for the dark theme.
|
|
19
|
+
coralLink: '#A33636',
|
|
20
|
+
// Mint income.
|
|
21
|
+
mint: '#1FAB6E',
|
|
22
|
+
mintSoft: '#D7F5E5',
|
|
23
|
+
// Ink + neutrals.
|
|
24
|
+
ink: '#111111',
|
|
25
|
+
inkSoft: '#3A3A3A',
|
|
26
|
+
inkMute: '#6E6E6E',
|
|
27
|
+
inkFaint: '#A3A3A3',
|
|
28
|
+
cream: '#FFFCF0',
|
|
29
|
+
creamAlt: '#FFF8E1',
|
|
30
|
+
off: '#FFFFFF',
|
|
31
|
+
line: '#1A1A1A',
|
|
32
|
+
lineSoft: '#E5E5E5',
|
|
33
|
+
};
|
|
34
|
+
const radii = {
|
|
35
|
+
xs: '4px',
|
|
36
|
+
sm: '8px',
|
|
37
|
+
md: '12px',
|
|
38
|
+
lg: '16px',
|
|
39
|
+
xl: '20px',
|
|
40
|
+
pill: '999px',
|
|
41
|
+
};
|
|
42
|
+
const space = {
|
|
43
|
+
0: '0',
|
|
44
|
+
1: '4px',
|
|
45
|
+
2: '8px',
|
|
46
|
+
3: '12px',
|
|
47
|
+
4: '16px',
|
|
48
|
+
5: '20px',
|
|
49
|
+
6: '24px',
|
|
50
|
+
7: '32px',
|
|
51
|
+
8: '40px',
|
|
52
|
+
9: '56px',
|
|
53
|
+
10: '72px',
|
|
54
|
+
};
|
|
55
|
+
const font = {
|
|
56
|
+
body: '"Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif',
|
|
57
|
+
mono: '"JetBrains Mono", "SF Mono", Menlo, monospace',
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Saweria's signature is the "hard stamp" — solid offset shadow with no blur.
|
|
61
|
+
* Use shadow.stamp for buttons/cards that should feel chunky.
|
|
62
|
+
*/
|
|
63
|
+
const shadow = {
|
|
64
|
+
none: 'none',
|
|
65
|
+
stamp: '4px 4px 0 #111111',
|
|
66
|
+
stampSm: '2px 2px 0 #111111',
|
|
67
|
+
stampLg: '6px 6px 0 #111111',
|
|
68
|
+
};
|
|
69
|
+
const easing = {
|
|
70
|
+
out: 'cubic-bezier(0.22, 1, 0.36, 1)',
|
|
71
|
+
inOut: 'cubic-bezier(0.65, 0, 0.35, 1)',
|
|
72
|
+
};
|
|
73
|
+
export const lightTheme = {
|
|
74
|
+
mode: 'light',
|
|
75
|
+
colors: {
|
|
76
|
+
primary: palette.yellow,
|
|
77
|
+
primaryHover: palette.yellowHover,
|
|
78
|
+
primaryActive: palette.yellowActive,
|
|
79
|
+
primarySoft: palette.yellowSoft,
|
|
80
|
+
primaryInk: palette.ink,
|
|
81
|
+
accent: palette.coral,
|
|
82
|
+
accentDark: palette.coralLink,
|
|
83
|
+
income: palette.mint,
|
|
84
|
+
incomeSoft: palette.mintSoft,
|
|
85
|
+
expense: palette.coral,
|
|
86
|
+
expenseSoft: palette.coralSoft,
|
|
87
|
+
bg: palette.cream,
|
|
88
|
+
bgAlt: palette.creamAlt,
|
|
89
|
+
surface: palette.off,
|
|
90
|
+
surfaceMuted: palette.yellowSofter,
|
|
91
|
+
surfaceSunken: palette.cream,
|
|
92
|
+
text: palette.ink,
|
|
93
|
+
textMuted: palette.inkSoft,
|
|
94
|
+
textSubtle: palette.inkMute,
|
|
95
|
+
border: palette.line,
|
|
96
|
+
borderSoft: palette.lineSoft,
|
|
97
|
+
borderStrong: palette.line,
|
|
98
|
+
success: palette.mint,
|
|
99
|
+
danger: palette.coral,
|
|
100
|
+
warning: palette.yellowActive,
|
|
101
|
+
overlay: 'rgba(17, 17, 17, 0.55)',
|
|
102
|
+
},
|
|
103
|
+
radii,
|
|
104
|
+
space,
|
|
105
|
+
font,
|
|
106
|
+
shadow,
|
|
107
|
+
easing,
|
|
108
|
+
};
|
|
109
|
+
export const darkTheme = {
|
|
110
|
+
mode: 'dark',
|
|
111
|
+
colors: {
|
|
112
|
+
primary: palette.yellow,
|
|
113
|
+
primaryHover: palette.yellowHover,
|
|
114
|
+
primaryActive: palette.yellowActive,
|
|
115
|
+
primarySoft: 'rgba(255, 222, 21, 0.18)',
|
|
116
|
+
primaryInk: palette.ink,
|
|
117
|
+
accent: palette.coral,
|
|
118
|
+
accentDark: '#D94F4F',
|
|
119
|
+
income: '#3FD18C',
|
|
120
|
+
incomeSoft: 'rgba(63, 209, 140, 0.15)',
|
|
121
|
+
expense: '#FF8B8B',
|
|
122
|
+
expenseSoft: 'rgba(255, 139, 139, 0.15)',
|
|
123
|
+
bg: '#161310',
|
|
124
|
+
bgAlt: '#1B1714',
|
|
125
|
+
surface: '#211C18',
|
|
126
|
+
surfaceMuted: '#2A241E',
|
|
127
|
+
surfaceSunken: '#1A1612',
|
|
128
|
+
text: '#FFF5E1',
|
|
129
|
+
textMuted: '#C8B89E',
|
|
130
|
+
textSubtle: '#88795F',
|
|
131
|
+
border: '#FFF5E1',
|
|
132
|
+
borderSoft: '#3A2E22',
|
|
133
|
+
borderStrong: '#FFF5E1',
|
|
134
|
+
success: '#3FD18C',
|
|
135
|
+
danger: '#FF8B8B',
|
|
136
|
+
warning: palette.yellow,
|
|
137
|
+
overlay: 'rgba(0, 0, 0, 0.7)',
|
|
138
|
+
},
|
|
139
|
+
radii,
|
|
140
|
+
space,
|
|
141
|
+
font,
|
|
142
|
+
shadow: {
|
|
143
|
+
none: 'none',
|
|
144
|
+
stamp: '4px 4px 0 #FFF5E1',
|
|
145
|
+
stampSm: '2px 2px 0 #FFF5E1',
|
|
146
|
+
stampLg: '6px 6px 0 #FFF5E1',
|
|
147
|
+
},
|
|
148
|
+
easing,
|
|
149
|
+
};
|
|
150
|
+
// Lock the contract: both exports must structurally satisfy `Theme`. These
|
|
151
|
+
// static assertions fail `tsc` if either theme drifts from the shared shape
|
|
152
|
+
// (the regression the literal-narrowing `typeof lightTheme` could not catch).
|
|
153
|
+
const _lightContract = lightTheme;
|
|
154
|
+
const _darkContract = darkTheme;
|
|
155
|
+
void _lightContract;
|
|
156
|
+
void _darkContract;
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@harismawan/stamp-ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Stamp-aesthetic React component library — chunky borders, hard offset shadows, no gradients.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Harismawan <mail@harismawan.com>",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"files": ["dist"],
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc -p tsconfig.build.json",
|
|
18
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
19
|
+
"test": "bun test",
|
|
20
|
+
"prepublishOnly": "bun run build"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"react": ">=18",
|
|
24
|
+
"react-dom": ">=18",
|
|
25
|
+
"styled-components": "^6"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"lucide-react": "^1.16",
|
|
29
|
+
"zustand": "^5",
|
|
30
|
+
"@floating-ui/react": "^0.27"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@biomejs/biome": "^1.9.4",
|
|
34
|
+
"@happy-dom/global-registrator": "^16.0.0",
|
|
35
|
+
"@testing-library/react": "^16.1.0",
|
|
36
|
+
"@testing-library/user-event": "^14.5.2",
|
|
37
|
+
"@types/react": "^19.0.0",
|
|
38
|
+
"@types/react-dom": "^19.0.0",
|
|
39
|
+
"@vitejs/plugin-react": "^6.0.2",
|
|
40
|
+
"bun-types": "^1.3.14",
|
|
41
|
+
"happy-dom": "^16.0.0",
|
|
42
|
+
"react": "^19.0.0",
|
|
43
|
+
"react-dom": "^19.0.0",
|
|
44
|
+
"styled-components": "^6.1.0",
|
|
45
|
+
"typescript": "^5.7.0",
|
|
46
|
+
"vite": "^8.0.14"
|
|
47
|
+
}
|
|
48
|
+
}
|