tinywidgets 0.0.0 → 0.0.1
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/.eslintrc.json +91 -0
- package/.prettierrc +5 -0
- package/bun.lockb +0 -0
- package/index.css.ts +1 -0
- package/index.ts +11 -0
- package/media.ts +1 -0
- package/package.json +27 -2
- package/src/Avatar/index.css.ts +17 -0
- package/src/Avatar/index.tsx +28 -0
- package/src/Axis/index.css.ts +19 -0
- package/src/Axis/index.tsx +38 -0
- package/src/Button/index.css.ts +57 -0
- package/src/Button/index.tsx +65 -0
- package/src/Card/index.css.ts +9 -0
- package/src/Card/index.tsx +15 -0
- package/src/Collapsible/index.css.ts +34 -0
- package/src/Collapsible/index.tsx +69 -0
- package/src/Detail/index.css.ts +19 -0
- package/src/Detail/index.tsx +28 -0
- package/src/Hr/index.css.ts +10 -0
- package/src/Hr/index.tsx +10 -0
- package/src/Metric/index.css.ts +18 -0
- package/src/Metric/index.tsx +28 -0
- package/src/Summary/index.css.ts +17 -0
- package/src/Summary/index.tsx +34 -0
- package/src/Tag/index.css.ts +22 -0
- package/src/Tag/index.tsx +29 -0
- package/src/Ui/Layout/Header/DarkButton/index.tsx +20 -0
- package/src/Ui/Layout/Header/SideNav/index.css.ts +23 -0
- package/src/Ui/Layout/Header/SideNav/index.tsx +16 -0
- package/src/Ui/Layout/Header/SideNavButton/index.css.ts +4 -0
- package/src/Ui/Layout/Header/SideNavButton/index.tsx +17 -0
- package/src/Ui/Layout/Header/Title/index.css.ts +10 -0
- package/src/Ui/Layout/Header/Title/index.tsx +10 -0
- package/src/Ui/Layout/Header/TopNav/index.css.ts +9 -0
- package/src/Ui/Layout/Header/TopNav/index.tsx +19 -0
- package/src/Ui/Layout/Header/index.css.ts +18 -0
- package/src/Ui/Layout/Header/index.tsx +33 -0
- package/src/Ui/Layout/Main/Article/index.css.ts +13 -0
- package/src/Ui/Layout/Main/Article/index.tsx +10 -0
- package/src/Ui/Layout/Main/Footer/index.css.ts +12 -0
- package/src/Ui/Layout/Main/Footer/index.tsx +10 -0
- package/src/Ui/Layout/Main/index.css.ts +16 -0
- package/src/Ui/Layout/Main/index.tsx +26 -0
- package/src/Ui/Layout/index.css.ts +9 -0
- package/src/Ui/Layout/index.tsx +52 -0
- package/src/Ui/LocalStore.tsx +55 -0
- package/src/Ui/SessionStore.tsx +60 -0
- package/src/Ui/index.tsx +26 -0
- package/src/index.css.ts +125 -0
- package/src/index.ts +12 -0
package/src/index.css.ts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createTheme,
|
|
3
|
+
createThemeContract,
|
|
4
|
+
createVar,
|
|
5
|
+
fallbackVar,
|
|
6
|
+
globalStyle,
|
|
7
|
+
style,
|
|
8
|
+
} from '@vanilla-extract/css';
|
|
9
|
+
|
|
10
|
+
export const accent = createVar();
|
|
11
|
+
export const accentContrast = createVar();
|
|
12
|
+
|
|
13
|
+
export const theme = createThemeContract({
|
|
14
|
+
accent: null,
|
|
15
|
+
accentContrast: null,
|
|
16
|
+
underneath: null,
|
|
17
|
+
background: null,
|
|
18
|
+
background2: null,
|
|
19
|
+
backgroundHaze: null,
|
|
20
|
+
backgroundHover: null,
|
|
21
|
+
foreground: null,
|
|
22
|
+
foreground2: null,
|
|
23
|
+
border: null,
|
|
24
|
+
shadow: null,
|
|
25
|
+
accentHover: null,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const light = {
|
|
29
|
+
accent: fallbackVar(accent, '#d81b60'),
|
|
30
|
+
accentContrast: fallbackVar(accentContrast, `#fff`),
|
|
31
|
+
underneath: '#fff',
|
|
32
|
+
background: `oklch(from ${theme.accent} 98% 1% calc(h + 180))`,
|
|
33
|
+
background2: `oklch(from ${theme.accent} 95% 1% calc(h + 180))`,
|
|
34
|
+
backgroundHaze: `oklch(from ${theme.background} l c h / .5)`,
|
|
35
|
+
backgroundHover: `oklch(from ${theme.accent} 90% 1% calc(h + 180))`,
|
|
36
|
+
foreground: `oklch(from ${theme.accent} 30% 1% h)`,
|
|
37
|
+
foreground2: `oklch(from ${theme.accent} 50% 1% h)`,
|
|
38
|
+
border: `oklch(from ${theme.accent} 90% 1% calc(h + 180))`,
|
|
39
|
+
shadow: '0 1px 4px 0 hsl(0 0 20 / .1)',
|
|
40
|
+
accentHover: `oklch(from ${theme.accent} calc(l * 90%) c h)`,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const dark = {
|
|
44
|
+
accent: fallbackVar(accent, '#d81b60'),
|
|
45
|
+
accentContrast: fallbackVar(accentContrast, `#fff`),
|
|
46
|
+
underneath: '#000',
|
|
47
|
+
background: `oklch(from ${theme.accent} 20% 1% calc(h + 180))`,
|
|
48
|
+
background2: `oklch(from ${theme.accent} 15% 1% calc(h + 180))`,
|
|
49
|
+
backgroundHaze: `oklch(from ${theme.background} 21% 0% h / .5)`,
|
|
50
|
+
backgroundHover: `oklch(from ${theme.accent} 25% 1% calc(h + 180))`,
|
|
51
|
+
foreground: `oklch(from ${theme.accent} 90% 1% h)`,
|
|
52
|
+
foreground2: `oklch(from ${theme.accent} 50% 1% h)`,
|
|
53
|
+
border: `oklch(from ${theme.accent} 30% 1% calc(h + 180))`,
|
|
54
|
+
shadow: '0 1px 4px 0 #000',
|
|
55
|
+
accentHover: `oklch(from ${theme.accent} calc(l * 90%) c h)`,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const dimensions = {
|
|
59
|
+
padding: '1rem',
|
|
60
|
+
radius: '0.5rem',
|
|
61
|
+
titleWidth: '18rem',
|
|
62
|
+
sideNavWidth: '20rem',
|
|
63
|
+
topNavHeight: '4rem',
|
|
64
|
+
articleWidth: '60rem',
|
|
65
|
+
footerHeight: '10rem',
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const shadowLike = {
|
|
69
|
+
boxShadow: theme.shadow,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const borderLike = {
|
|
73
|
+
...shadowLike,
|
|
74
|
+
border: `1px solid ${theme.border}`,
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const radiusLike = {
|
|
78
|
+
borderRadius: dimensions.radius,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const paddingLike = {
|
|
82
|
+
padding: dimensions.padding,
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const axisLike = {
|
|
86
|
+
display: 'flex',
|
|
87
|
+
justifyContent: 'space-between',
|
|
88
|
+
alignItems: 'center',
|
|
89
|
+
gap: dimensions.padding,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
globalStyle('*', {
|
|
93
|
+
margin: 0,
|
|
94
|
+
padding: 0,
|
|
95
|
+
boxSizing: 'border-box',
|
|
96
|
+
scrollbarWidth: 'thin',
|
|
97
|
+
color: 'inherit',
|
|
98
|
+
fontSize: 'inherit',
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
globalStyle('html', {
|
|
102
|
+
fontSize: '14px',
|
|
103
|
+
lineHeight: '1.5em',
|
|
104
|
+
textRendering: 'optimizeLegibility',
|
|
105
|
+
fontWeight: 400,
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
globalStyle('h1', {fontSize: '1.5rem'});
|
|
109
|
+
|
|
110
|
+
globalStyle('h2', {fontSize: '1.25rem'});
|
|
111
|
+
|
|
112
|
+
export const themeLight = createTheme(theme, light);
|
|
113
|
+
globalStyle(`html:has(${themeLight})`, {
|
|
114
|
+
backgroundColor: light.underneath,
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
export const themeDark = createTheme(theme, dark);
|
|
118
|
+
globalStyle(`html:has(${themeDark})`, {
|
|
119
|
+
backgroundColor: dark.underneath,
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
export const iconSize = style({
|
|
123
|
+
width: '1rem',
|
|
124
|
+
height: '1rem',
|
|
125
|
+
});
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type {StyleRule} from '@vanilla-extract/css';
|
|
2
|
+
|
|
3
|
+
const LARGE = 'screen and (min-width: 1000px)';
|
|
4
|
+
|
|
5
|
+
export const large = (style: StyleRule) => ({
|
|
6
|
+
'@media': {
|
|
7
|
+
[LARGE]: style,
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const classNames = (...classes: (string | boolean | undefined)[]) =>
|
|
12
|
+
classes.filter(Boolean).join(' ');
|