tinywidgets 1.1.4 → 1.2.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/bun.lock +778 -0
- package/eslint.config.js +0 -41
- package/package.json +14 -14
- package/src/common/functions.tsx +2 -2
- package/src/components/App/index.css.ts +22 -1
- package/src/components/App/index.tsx +26 -6
- package/src/components/Button/index.css.ts +1 -1
- package/src/components/Button/index.tsx +99 -102
- package/src/components/Card/index.css.ts +1 -1
- package/src/components/Card/index.tsx +1 -2
- package/src/components/Code/index.css.ts +1 -1
- package/src/components/Code/index.tsx +0 -1
- package/src/components/Collapsible/index.css.ts +1 -1
- package/src/components/Collapsible/index.tsx +3 -3
- package/src/components/Detail/index.css.ts +1 -1
- package/src/components/Detail/index.tsx +1 -2
- package/src/components/Hr/index.css.ts +1 -1
- package/src/components/Hr/index.tsx +0 -1
- package/src/components/Image/index.css.ts +1 -1
- package/src/components/Image/index.tsx +1 -1
- package/src/components/Metric/index.tsx +1 -2
- package/src/components/Row/index.css.ts +1 -1
- package/src/components/Row/index.tsx +1 -2
- package/src/components/Summary/index.css.ts +1 -1
- package/src/components/Summary/index.tsx +1 -2
- package/src/components/Tag/index.css.ts +1 -1
- package/src/components/Tag/index.tsx +1 -2
- package/src/css/dimensions.css.ts +2 -0
- package/src/css/global.css.ts +1 -1
- package/src/index.css.ts +1 -1
- package/src/index.ts +2 -8
- package/src/stores/LocalStore.tsx +1 -1
- package/src/stores/RouteStore.tsx +1 -1
- package/src/stores/SessionStore.tsx +1 -1
- package/tsconfig.json +1 -1
- package/bun.lockb +0 -0
- package/src/components/TasksProvider/index.tsx +0 -309
package/eslint.config.js
CHANGED
|
@@ -138,47 +138,6 @@ export default tsLint.config(
|
|
|
138
138
|
},
|
|
139
139
|
},
|
|
140
140
|
|
|
141
|
-
{
|
|
142
|
-
files: ['src/@types/**/*.js'],
|
|
143
|
-
settings: {jsdoc: {mode: 'typescript', contexts: ['any']}},
|
|
144
|
-
rules: {
|
|
145
|
-
'jsdoc/check-tag-names': [
|
|
146
|
-
2,
|
|
147
|
-
{definedTags: ['category', 'packageDocumentation']},
|
|
148
|
-
],
|
|
149
|
-
'jsdoc/no-restricted-syntax': [
|
|
150
|
-
2,
|
|
151
|
-
{
|
|
152
|
-
contexts: [
|
|
153
|
-
{
|
|
154
|
-
comment:
|
|
155
|
-
// eslint-disable-next-line max-len
|
|
156
|
-
'JsdocBlock:not(:has(JsdocTag[tag=/category|packageDocumentation/]))',
|
|
157
|
-
message: 'Every non-module block requires a @category tag',
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
comment: 'JsdocBlock:not(:has(JsdocTag[tag=since]))',
|
|
161
|
-
message: 'Every block requires a @since tag',
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
comment:
|
|
165
|
-
'JsdocBlock:has(JsdocTag[tag=since] ~ JsdocTag[tag=since])',
|
|
166
|
-
message: 'Every block must have only one @since tag',
|
|
167
|
-
},
|
|
168
|
-
],
|
|
169
|
-
},
|
|
170
|
-
],
|
|
171
|
-
'jsdoc/require-jsdoc': 2,
|
|
172
|
-
'jsdoc/require-description': 2,
|
|
173
|
-
'jsdoc/require-description-complete-sentence': 2,
|
|
174
|
-
'jsdoc/require-returns-description': 2,
|
|
175
|
-
'jsdoc/no-blank-blocks': 2,
|
|
176
|
-
'jsdoc/require-param-type': 0,
|
|
177
|
-
'jsdoc/require-returns-type': 0,
|
|
178
|
-
'jsdoc/check-param-names': 0,
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
|
|
182
141
|
{
|
|
183
142
|
files: ['eslint.config.js'],
|
|
184
143
|
extends: [tsLint.configs.disableTypeChecked],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinywidgets",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"author": "jamesgpearce",
|
|
5
5
|
"repository": "github:tinyplex/tinywidgets",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,31 +16,31 @@
|
|
|
16
16
|
],
|
|
17
17
|
"type": "module",
|
|
18
18
|
"scripts": {
|
|
19
|
-
"prePublishPackage": "prettier
|
|
19
|
+
"prePublishPackage": "prettier --check . && eslint . && cspell --quiet . && tsc && cp ../README.md ./README.md"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"eslint
|
|
22
|
+
"@eslint/js": "^9.25.1",
|
|
23
|
+
"@types/react": "^19.1.2",
|
|
24
|
+
"cspell": "^8.19.3",
|
|
25
|
+
"eslint": "^9.25.1",
|
|
26
|
+
"eslint-plugin-import": "^2.31.0",
|
|
27
|
+
"eslint-plugin-react": "^7.37.5",
|
|
26
28
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
29
|
+
"globals": "^16.0.0",
|
|
27
30
|
"prettier": "^3.5.3",
|
|
28
|
-
"
|
|
31
|
+
"prettier-plugin-organize-imports": "^4.1.0",
|
|
32
|
+
"typescript": "^5.8.3",
|
|
33
|
+
"typescript-eslint": "^8.31.0"
|
|
29
34
|
},
|
|
30
35
|
"exports": {
|
|
31
36
|
".": "./src/index.ts",
|
|
32
37
|
"./css": "./src/index.css.ts"
|
|
33
38
|
},
|
|
34
39
|
"dependencies": {
|
|
35
|
-
"@eslint/js": "^9.23.0",
|
|
36
|
-
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
|
|
37
40
|
"@vanilla-extract/css": "^1.17.1",
|
|
38
|
-
"
|
|
39
|
-
"globals": "^16.0.0",
|
|
40
|
-
"lucide-react": "^0.485.0",
|
|
41
|
+
"lucide-react": "^0.503.0",
|
|
41
42
|
"react": "^19.1.0",
|
|
42
43
|
"react-dom": "^19.1.0",
|
|
43
|
-
"tinybase": "^6.0.
|
|
44
|
-
"typescript-eslint": "^8.28.0"
|
|
44
|
+
"tinybase": "^6.0.4"
|
|
45
45
|
}
|
|
46
46
|
}
|
package/src/common/functions.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {screens} from '../css/screens';
|
|
2
1
|
import type {StyleRule} from '@vanilla-extract/css';
|
|
3
|
-
import
|
|
2
|
+
import {type ComponentType, type ReactNode} from 'react';
|
|
3
|
+
import {screens} from '../css/screens';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The `classNames` function returns a concatenated list of class names,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import {style} from '@vanilla-extract/css';
|
|
1
2
|
import {large} from '../../common/functions.tsx';
|
|
2
3
|
import {colors} from '../../css/colors.css.ts';
|
|
3
4
|
import {dimensions, dimensionsClass} from '../../css/dimensions.css.ts';
|
|
4
|
-
import {style} from '@vanilla-extract/css';
|
|
5
5
|
|
|
6
6
|
export const app = style([dimensionsClass, {color: colors.foreground}]);
|
|
7
7
|
|
|
@@ -78,3 +78,24 @@ export const mainHasSideNav = style(
|
|
|
78
78
|
paddingLeft: `calc(${dimensions.sideNavWidth} + ${dimensions.padding})`,
|
|
79
79
|
}),
|
|
80
80
|
);
|
|
81
|
+
|
|
82
|
+
export const mainHasFooter = style({
|
|
83
|
+
paddingBottom: `calc(${dimensions.footerHeight} + ${dimensions.padding})`,
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
export const footer = style({
|
|
87
|
+
display: 'flex',
|
|
88
|
+
justifyContent: 'right',
|
|
89
|
+
alignItems: 'center',
|
|
90
|
+
gap: dimensions.padding,
|
|
91
|
+
padding: dimensions.padding,
|
|
92
|
+
position: 'fixed',
|
|
93
|
+
bottom: 0,
|
|
94
|
+
left: 0,
|
|
95
|
+
right: 0,
|
|
96
|
+
height: dimensions.footerHeight,
|
|
97
|
+
backgroundColor: colors.backgroundHaze,
|
|
98
|
+
borderTop: colors.border,
|
|
99
|
+
boxShadow: colors.shadow,
|
|
100
|
+
backdropFilter: 'blur(8px)',
|
|
101
|
+
});
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {Menu, Moon, Sun, SunMoon, X} from 'lucide-react';
|
|
2
|
+
import type {ComponentType, ReactNode} from 'react';
|
|
3
|
+
import * as UiReact from 'tinybase/ui-react/with-schemas';
|
|
4
|
+
import type {OptionalSchemas} from 'tinybase/with-schemas';
|
|
1
5
|
import {classNames, renderComponentOrNode} from '../../common/functions.tsx';
|
|
2
6
|
import {codeDark, codeLight} from '../../css/code.css.ts';
|
|
3
7
|
import {colorsDark, colorsLight} from '../../css/colors.css.ts';
|
|
@@ -19,8 +23,10 @@ import {Button} from '../Button/index.tsx';
|
|
|
19
23
|
import {
|
|
20
24
|
app,
|
|
21
25
|
appLayout,
|
|
26
|
+
footer,
|
|
22
27
|
header,
|
|
23
28
|
main,
|
|
29
|
+
mainHasFooter,
|
|
24
30
|
mainHasSideNav,
|
|
25
31
|
sideNav,
|
|
26
32
|
sideNavButton,
|
|
@@ -28,11 +34,6 @@ import {
|
|
|
28
34
|
title,
|
|
29
35
|
topNav,
|
|
30
36
|
} from './index.css.ts';
|
|
31
|
-
import {Menu, Moon, Sun, SunMoon, X} from 'lucide-react';
|
|
32
|
-
import type {ComponentType, ReactNode} from 'react';
|
|
33
|
-
import React from 'react';
|
|
34
|
-
import * as UiReact from 'tinybase/ui-react/with-schemas';
|
|
35
|
-
import type {OptionalSchemas} from 'tinybase/with-schemas';
|
|
36
37
|
|
|
37
38
|
const {Provider} = UiReact as UiReact.WithSchemas<OptionalSchemas>;
|
|
38
39
|
|
|
@@ -84,6 +85,11 @@ export const App = (props: {
|
|
|
84
85
|
* the application.
|
|
85
86
|
*/
|
|
86
87
|
readonly main?: ComponentType | ReactNode;
|
|
88
|
+
/**
|
|
89
|
+
* An optional component, element, or string which renders the footer of
|
|
90
|
+
* the application.
|
|
91
|
+
*/
|
|
92
|
+
readonly footer?: ComponentType | ReactNode;
|
|
87
93
|
/**
|
|
88
94
|
* An extra CSS class name for the component.
|
|
89
95
|
*/
|
|
@@ -105,6 +111,7 @@ const Layout = ({
|
|
|
105
111
|
topNavRight: topNavRightComponentOrNode,
|
|
106
112
|
sideNav: sideNavComponentOrNode,
|
|
107
113
|
main: mainComponentOrNode,
|
|
114
|
+
footer: footerComponentOrNode,
|
|
108
115
|
className,
|
|
109
116
|
}: Parameters<typeof App>[0]) => {
|
|
110
117
|
const sessionStoreIsReady = useSessionStoreIsReady();
|
|
@@ -125,8 +132,10 @@ const Layout = ({
|
|
|
125
132
|
topNavRightComponentOrNode,
|
|
126
133
|
sideNavComponentOrNode,
|
|
127
134
|
mainComponentOrNode,
|
|
135
|
+
footerComponentOrNode,
|
|
128
136
|
].some((componentOrNode) => componentOrNode);
|
|
129
137
|
const hasSideNav = sideNavComponentOrNode != null;
|
|
138
|
+
const hasFooter = footerComponentOrNode != null;
|
|
130
139
|
|
|
131
140
|
return sessionStoreIsReady && routeStoreIsReady && localStoreIsReady ? (
|
|
132
141
|
<div
|
|
@@ -170,9 +179,20 @@ const Layout = ({
|
|
|
170
179
|
</nav>
|
|
171
180
|
) : null}
|
|
172
181
|
</header>
|
|
173
|
-
<main
|
|
182
|
+
<main
|
|
183
|
+
className={classNames(
|
|
184
|
+
main,
|
|
185
|
+
hasSideNav && mainHasSideNav,
|
|
186
|
+
hasFooter && mainHasFooter,
|
|
187
|
+
)}
|
|
188
|
+
>
|
|
174
189
|
{renderComponentOrNode(mainComponentOrNode)}
|
|
175
190
|
</main>
|
|
191
|
+
{hasFooter ? (
|
|
192
|
+
<footer className={footer}>
|
|
193
|
+
{renderComponentOrNode(footerComponentOrNode)}
|
|
194
|
+
</footer>
|
|
195
|
+
) : null}
|
|
176
196
|
</>
|
|
177
197
|
) : null}
|
|
178
198
|
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import {style, styleVariants} from '@vanilla-extract/css';
|
|
1
2
|
import {colors} from '../../css/colors.css';
|
|
2
3
|
import {dimensions} from '../../css/dimensions.css';
|
|
3
|
-
import {style, styleVariants} from '@vanilla-extract/css';
|
|
4
4
|
|
|
5
5
|
export const button = style({
|
|
6
6
|
display: 'inline-flex',
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type {ComponentType, ReactNode} from 'react';
|
|
2
|
+
import {useCallback} from 'react';
|
|
1
3
|
import {classNames, renderComponentOrNode} from '../../common/functions.tsx';
|
|
2
4
|
import {iconSize} from '../../css/dimensions.css.ts';
|
|
3
5
|
import {
|
|
@@ -7,8 +9,6 @@ import {
|
|
|
7
9
|
titleStyle,
|
|
8
10
|
titleStyleRight,
|
|
9
11
|
} from './index.css.ts';
|
|
10
|
-
import type {ComponentType, ReactNode, Ref} from 'react';
|
|
11
|
-
import React, {forwardRef, useCallback} from 'react';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* The `Button` component displays an button, with a number of common variants.
|
|
@@ -103,104 +103,101 @@ import React, {forwardRef, useCallback} from 'react';
|
|
|
103
103
|
* 'current'.
|
|
104
104
|
* @icon Lucide.RectangleHorizontal
|
|
105
105
|
*/
|
|
106
|
-
export const Button =
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
[href],
|
|
177
|
-
);
|
|
106
|
+
export const Button = ({
|
|
107
|
+
icon: Icon,
|
|
108
|
+
title: titleComponentOrNode,
|
|
109
|
+
titleRight: titleRightComponentOrNode,
|
|
110
|
+
iconRight: IconRight,
|
|
111
|
+
onClick,
|
|
112
|
+
variant = 'default',
|
|
113
|
+
current,
|
|
114
|
+
href,
|
|
115
|
+
alt,
|
|
116
|
+
className,
|
|
117
|
+
ref,
|
|
118
|
+
}: {
|
|
119
|
+
/**
|
|
120
|
+
* An optional component which renders an icon for the button, and which
|
|
121
|
+
* must accept a className prop.
|
|
122
|
+
*/
|
|
123
|
+
readonly icon?: ComponentType<{className?: string}>;
|
|
124
|
+
/**
|
|
125
|
+
* An optional component, element, or string which renders the title of
|
|
126
|
+
* the button.
|
|
127
|
+
*/
|
|
128
|
+
readonly title?: ComponentType | ReactNode;
|
|
129
|
+
/**
|
|
130
|
+
* An optional component, element, or string which renders a second title
|
|
131
|
+
* on the right side of the button.
|
|
132
|
+
*/
|
|
133
|
+
readonly titleRight?: ComponentType | ReactNode;
|
|
134
|
+
/**
|
|
135
|
+
* An optional component which renders a second icon for the button, and
|
|
136
|
+
* which must accept a className prop.
|
|
137
|
+
*/
|
|
138
|
+
readonly iconRight?: ComponentType<{className?: string}>;
|
|
139
|
+
/**
|
|
140
|
+
* A handler called when the user clicks on the button.
|
|
141
|
+
*/
|
|
142
|
+
readonly onClick?: () => void;
|
|
143
|
+
/**
|
|
144
|
+
* A variant of the button, one of:
|
|
145
|
+
* - `default`
|
|
146
|
+
* - `icon`
|
|
147
|
+
* - `accent`
|
|
148
|
+
* - `ghost`
|
|
149
|
+
* - `item`
|
|
150
|
+
*/
|
|
151
|
+
readonly variant?: keyof typeof buttonVariants;
|
|
152
|
+
/**
|
|
153
|
+
* A flag that indicates that an `item` button is 'current' and therefore
|
|
154
|
+
* highlighted.
|
|
155
|
+
*/
|
|
156
|
+
readonly current?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* A URL that can be used instead of an `onClick` to launch a new web
|
|
159
|
+
* page, much like a link.
|
|
160
|
+
*/
|
|
161
|
+
readonly href?: string;
|
|
162
|
+
/**
|
|
163
|
+
* Alternative text shown when the user hovers over the button.
|
|
164
|
+
*/
|
|
165
|
+
readonly alt?: string;
|
|
166
|
+
/**
|
|
167
|
+
* An extra CSS class name for the component.
|
|
168
|
+
*/
|
|
169
|
+
readonly className?: string;
|
|
170
|
+
ref?: React.RefObject<HTMLButtonElement>;
|
|
171
|
+
}) => {
|
|
172
|
+
const hrefClick = useCallback(
|
|
173
|
+
() => (href ? open(href, '_blank', 'noreferrer') : null),
|
|
174
|
+
[href],
|
|
175
|
+
);
|
|
178
176
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
);
|
|
177
|
+
return (
|
|
178
|
+
<button
|
|
179
|
+
className={classNames(
|
|
180
|
+
button,
|
|
181
|
+
buttonVariants[variant],
|
|
182
|
+
current && currentStyle,
|
|
183
|
+
className,
|
|
184
|
+
)}
|
|
185
|
+
onClick={onClick ?? hrefClick}
|
|
186
|
+
title={alt}
|
|
187
|
+
ref={ref}
|
|
188
|
+
>
|
|
189
|
+
{Icon ? <Icon className={iconSize} /> : null}
|
|
190
|
+
{titleComponentOrNode ? (
|
|
191
|
+
<span className={titleStyle}>
|
|
192
|
+
{renderComponentOrNode(titleComponentOrNode)}
|
|
193
|
+
</span>
|
|
194
|
+
) : null}
|
|
195
|
+
{titleRightComponentOrNode ? (
|
|
196
|
+
<span className={titleStyleRight}>
|
|
197
|
+
{renderComponentOrNode(titleRightComponentOrNode)}
|
|
198
|
+
</span>
|
|
199
|
+
) : null}
|
|
200
|
+
{IconRight ? <IconRight className={iconSize} /> : null}
|
|
201
|
+
</button>
|
|
202
|
+
);
|
|
203
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import type {ReactNode} from 'react';
|
|
1
2
|
import {classNames} from '../../common/functions';
|
|
2
3
|
import {card} from './index.css';
|
|
3
|
-
import type {ReactNode} from 'react';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* The `Card` component displays a simple rectangular container.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import {globalStyle, style} from '@vanilla-extract/css';
|
|
1
2
|
import {code} from '../../css/code.css';
|
|
2
3
|
import {colors} from '../../css/colors.css';
|
|
3
4
|
import {dimensions} from '../../css/dimensions.css';
|
|
4
|
-
import {globalStyle, style} from '@vanilla-extract/css';
|
|
5
5
|
|
|
6
6
|
export const pre = style({
|
|
7
7
|
padding: dimensions.padding,
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {ChevronDown, ChevronRight} from 'lucide-react';
|
|
2
|
+
import type {ComponentType, ReactNode} from 'react';
|
|
3
|
+
import {useCallback, useRef, useState} from 'react';
|
|
1
4
|
import {classNames} from '../../common/functions.tsx';
|
|
2
5
|
import {
|
|
3
6
|
useCollapsibleIsOpen,
|
|
@@ -11,9 +14,6 @@ import {
|
|
|
11
14
|
collapsibleOpen,
|
|
12
15
|
content,
|
|
13
16
|
} from './index.css.ts';
|
|
14
|
-
import {ChevronDown, ChevronRight} from 'lucide-react';
|
|
15
|
-
import type {ComponentType, ReactNode} from 'react';
|
|
16
|
-
import React, {useCallback, useRef, useState} from 'react';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* The `Collapsible` component displays a titled box that can be expanded or
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import type {ReactNode} from 'react';
|
|
1
2
|
import {classNames} from '../../common/functions';
|
|
2
3
|
import {detailCell, detailRow, detailTable} from './index.css';
|
|
3
|
-
import type {ReactNode} from 'react';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* The `Detail` component displays a set of key-value pairs in a two-column
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import {style, styleVariants} from '@vanilla-extract/css';
|
|
1
2
|
import {colors} from '../../css/colors.css';
|
|
2
3
|
import {dimensions} from '../../css/dimensions.css';
|
|
3
|
-
import {style, styleVariants} from '@vanilla-extract/css';
|
|
4
4
|
|
|
5
5
|
export const image = style({
|
|
6
6
|
display: 'inline-block',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import {useCallback} from 'react';
|
|
1
2
|
import {classNames} from '../../common/functions.tsx';
|
|
2
3
|
import {clickable, image, imageVariants} from './index.css.ts';
|
|
3
|
-
import React, {useCallback} from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The `Image` component displays an image, with a number of common variants.
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import type {ComponentType, ReactNode} from 'react';
|
|
1
2
|
import {classNames, renderComponentOrNode} from '../../common/functions';
|
|
2
3
|
import {iconSize} from '../../css/dimensions.css';
|
|
3
4
|
import {metric, metricLabel, metricNumber} from './index.css';
|
|
4
|
-
import type {ComponentType, ReactNode} from 'react';
|
|
5
|
-
import React from 'react';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* The `Metric` component displays a metric as a prominent numerical value with
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import {style, styleVariants} from '@vanilla-extract/css';
|
|
1
2
|
import {notLarge} from '../../common/functions.tsx';
|
|
2
3
|
import {dimensions} from '../../css/dimensions.css.ts';
|
|
3
|
-
import {style, styleVariants} from '@vanilla-extract/css';
|
|
4
4
|
|
|
5
5
|
export const row = style({
|
|
6
6
|
display: 'grid',
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import type {ReactNode} from 'react';
|
|
1
2
|
import {classNames} from '../../common/functions';
|
|
2
3
|
import {row, rowVariants} from './index.css';
|
|
3
|
-
import type {ReactNode} from 'react';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* The `Row` component displays a row of 'cell' components, with a number of
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import type {ComponentType, ReactNode} from 'react';
|
|
1
2
|
import {classNames} from '../../common/functions';
|
|
2
3
|
import {Image} from '../Image';
|
|
3
4
|
import {image, summary} from './index.css';
|
|
4
|
-
import type {ComponentType, ReactNode} from 'react';
|
|
5
|
-
import React from 'react';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* The `Summary` component displays an image on the left, and other content
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import type {ComponentType, ReactNode} from 'react';
|
|
1
2
|
import {classNames, renderComponentOrNode} from '../../common/functions';
|
|
2
3
|
import {tag, tagIcon, tagVariants} from './index.css';
|
|
3
|
-
import type {ComponentType, ReactNode} from 'react';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* The `Tag` component displays a small rectangular tag, suitable for minimal
|
|
@@ -8,6 +8,7 @@ const classAndObject = createTheme({
|
|
|
8
8
|
radius: fallbackVar('var(--tinyWidgets-radius)', '0.5rem'),
|
|
9
9
|
sideNavWidth: fallbackVar('var(--tinyWidgets-sideNavWidth)', '20rem'),
|
|
10
10
|
topNavHeight: fallbackVar('var(--tinyWidgets-topNavHeight)', '4rem'),
|
|
11
|
+
footerHeight: fallbackVar('var(--tinyWidgets-footerHeight)', '2rem'),
|
|
11
12
|
});
|
|
12
13
|
export const dimensionsClass = classAndObject[0];
|
|
13
14
|
|
|
@@ -24,6 +25,7 @@ export const dimensionsClass = classAndObject[0];
|
|
|
24
25
|
* - `radius`
|
|
25
26
|
* - `sideNavWidth`
|
|
26
27
|
* - `topNavHeight`
|
|
28
|
+
* - `footerHeight`
|
|
27
29
|
*
|
|
28
30
|
* You can use these variables directly in React components that take style
|
|
29
31
|
* attributes, like this:
|