@tipp/ui 0.1.4 → 0.1.6
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/dist/atoms/alert-dialog.js +1 -1
- package/dist/atoms/aspect-ratio.js +1 -1
- package/dist/atoms/avatar.cjs +53 -1
- package/dist/atoms/avatar.cjs.map +1 -1
- package/dist/atoms/avatar.d.cts +11 -1
- package/dist/atoms/avatar.d.ts +11 -1
- package/dist/atoms/avatar.js +2 -2
- package/dist/atoms/badge.cjs +62 -1
- package/dist/atoms/badge.cjs.map +1 -1
- package/dist/atoms/badge.d.cts +13 -1
- package/dist/atoms/badge.d.ts +13 -1
- package/dist/atoms/badge.js +2 -2
- package/dist/atoms/blockquote.js +1 -1
- package/dist/atoms/box.js +1 -1
- package/dist/atoms/button.cjs +51 -1
- package/dist/atoms/button.cjs.map +1 -1
- package/dist/atoms/button.d.cts +11 -1
- package/dist/atoms/button.d.ts +11 -1
- package/dist/atoms/button.js +2 -2
- package/dist/atoms/call-out.js +1 -1
- package/dist/atoms/card.js +1 -1
- package/dist/atoms/check-box-card.js +1 -1
- package/dist/atoms/check-box-group.cjs +52 -1
- package/dist/atoms/check-box-group.cjs.map +1 -1
- package/dist/atoms/check-box-group.d.cts +11 -1
- package/dist/atoms/check-box-group.d.ts +11 -1
- package/dist/atoms/check-box-group.js +2 -2
- package/dist/atoms/check-box.cjs +49 -1
- package/dist/atoms/check-box.cjs.map +1 -1
- package/dist/atoms/check-box.d.cts +11 -1
- package/dist/atoms/check-box.d.ts +11 -1
- package/dist/atoms/check-box.js +2 -2
- package/dist/atoms/code.js +1 -1
- package/dist/atoms/container.js +1 -1
- package/dist/atoms/data-list.js +1 -1
- package/dist/atoms/date-picker/index.d.cts +2 -2
- package/dist/atoms/date-picker/index.d.ts +2 -2
- package/dist/atoms/date-picker/index.js +2 -2
- package/dist/atoms/dialog.js +1 -1
- package/dist/atoms/dropdown-menu.js +1 -1
- package/dist/atoms/em.js +1 -1
- package/dist/atoms/flex.js +1 -1
- package/dist/atoms/grid.js +1 -1
- package/dist/atoms/heading.cjs +54 -2
- package/dist/atoms/heading.cjs.map +1 -1
- package/dist/atoms/heading.d.cts +9 -1
- package/dist/atoms/heading.d.ts +9 -1
- package/dist/atoms/heading.js +6 -4
- package/dist/atoms/hover-card.js +1 -1
- package/dist/atoms/icon-button.js +1 -1
- package/dist/atoms/inset.js +1 -1
- package/dist/atoms/kbd.js +1 -1
- package/dist/atoms/link.cjs +52 -2
- package/dist/atoms/link.cjs.map +1 -1
- package/dist/atoms/link.d.cts +9 -1
- package/dist/atoms/link.d.ts +9 -1
- package/dist/atoms/link.js +5 -3
- package/dist/atoms/popover.js +1 -1
- package/dist/atoms/progress.js +1 -1
- package/dist/atoms/quote.js +1 -1
- package/dist/atoms/radio-cards.js +1 -1
- package/dist/atoms/radio-group.js +1 -1
- package/dist/atoms/radio.js +1 -1
- package/dist/atoms/scroll-area.js +1 -1
- package/dist/atoms/section.js +1 -1
- package/dist/atoms/segmented-control.js +1 -1
- package/dist/atoms/select.js +1 -1
- package/dist/atoms/separator.js +1 -1
- package/dist/atoms/skeleton.js +1 -1
- package/dist/atoms/strong.js +1 -1
- package/dist/atoms/switch.js +1 -1
- package/dist/atoms/tab-nav.js +1 -1
- package/dist/atoms/tabs.js +1 -1
- package/dist/atoms/text-area.js +1 -1
- package/dist/atoms/text-field.js +1 -1
- package/dist/atoms/text.cjs +48 -1
- package/dist/atoms/text.cjs.map +1 -1
- package/dist/atoms/text.d.cts +9 -1
- package/dist/atoms/text.d.ts +9 -1
- package/dist/atoms/text.js +2 -2
- package/dist/atoms/tooltip.js +1 -1
- package/dist/chart/chart.cjs +12 -2
- package/dist/chart/chart.cjs.map +1 -1
- package/dist/chart/chart.d.cts +3 -2
- package/dist/chart/chart.d.ts +3 -2
- package/dist/chart/chart.js +3 -3
- package/dist/chart/chart.js.map +1 -1
- package/dist/chunk-ALOPZ54P.js +47 -0
- package/dist/chunk-ALOPZ54P.js.map +1 -0
- package/dist/chunk-CZEGRZBK.js +38 -0
- package/dist/chunk-CZEGRZBK.js.map +1 -0
- package/dist/chunk-HLOY6BIP.js +37 -0
- package/dist/chunk-HLOY6BIP.js.map +1 -0
- package/dist/{chunk-D5QWAVBB.js → chunk-IIBITN2G.js} +2 -2
- package/dist/chunk-IQEEPHOY.js +35 -0
- package/dist/chunk-IQEEPHOY.js.map +1 -0
- package/dist/chunk-JEHDCZQU.js +34 -0
- package/dist/chunk-JEHDCZQU.js.map +1 -0
- package/dist/{chunk-LGTAQGUA.js → chunk-N552FDTV.js} +15 -2
- package/dist/{chunk-LREYUDKD.js → chunk-PL3Q4UVY.js} +3 -3
- package/dist/{chunk-LREYUDKD.js.map → chunk-PL3Q4UVY.js.map} +1 -1
- package/dist/chunk-RET725VL.js +36 -0
- package/dist/chunk-RET725VL.js.map +1 -0
- package/dist/chunk-XJJDE4YP.js +31 -0
- package/dist/chunk-XJJDE4YP.js.map +1 -0
- package/dist/chunk-XQOZWYUA.js +35 -0
- package/dist/chunk-XQOZWYUA.js.map +1 -0
- package/dist/icon.js +1 -1
- package/dist/index.cjs +252 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +40 -40
- package/dist/theme/theme-provider.cjs +1 -1
- package/dist/theme/theme-provider.cjs.map +1 -1
- package/dist/theme/theme-provider.d.cts +4 -4
- package/dist/theme/theme-provider.d.ts +4 -4
- package/dist/theme/theme-provider.js +2 -2
- package/dist/theme/use-theme.js +1 -1
- package/dist/ui-props/index.js +1 -1
- package/package.json +4 -2
- package/src/atoms/avatar.tsx +37 -1
- package/src/atoms/badge.tsx +47 -1
- package/src/atoms/button.tsx +32 -1
- package/src/atoms/check-box-group.tsx +38 -1
- package/src/atoms/check-box.tsx +30 -1
- package/src/atoms/heading.tsx +35 -1
- package/src/atoms/link.tsx +33 -1
- package/src/atoms/text.tsx +30 -1
- package/src/chart/chart.tsx +3 -4
- package/src/theme/theme-provider.tsx +1 -1
- package/dist/chunk-3566LFAS.js +0 -7
- package/dist/chunk-3566LFAS.js.map +0 -1
- package/dist/chunk-4PP245MS.js +0 -7
- package/dist/chunk-4PP245MS.js.map +0 -1
- package/dist/chunk-DYUKDKUS.js +0 -7
- package/dist/chunk-DYUKDKUS.js.map +0 -1
- package/dist/chunk-LFJCZVNE.js +0 -7
- package/dist/chunk-LFJCZVNE.js.map +0 -1
- package/dist/chunk-M4P36WOR.js +0 -7
- package/dist/chunk-M4P36WOR.js.map +0 -1
- package/dist/chunk-MLMWFOEE.js +0 -7
- package/dist/chunk-MLMWFOEE.js.map +0 -1
- package/dist/chunk-MYTJIEMB.js +0 -7
- package/dist/chunk-MYTJIEMB.js.map +0 -1
- package/dist/chunk-W4KST6UY.js +0 -7
- package/dist/chunk-W4KST6UY.js.map +0 -1
- /package/dist/{chunk-D5QWAVBB.js.map → chunk-IIBITN2G.js.map} +0 -0
- /package/dist/{chunk-LGTAQGUA.js.map → chunk-N552FDTV.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
TextField
|
|
3
|
+
} from "./chunk-JPIZP2PZ.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
Text
|
|
6
|
+
} from "./chunk-XJJDE4YP.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
} from "./chunk-
|
|
8
|
+
Tooltip
|
|
9
|
+
} from "./chunk-ACVANQJ4.js";
|
|
10
10
|
import {
|
|
11
11
|
uiProps
|
|
12
12
|
} from "./chunk-NVKNDAIN.js";
|
|
13
13
|
import {
|
|
14
14
|
DatePicker
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-IIBITN2G.js";
|
|
16
|
+
import {
|
|
17
|
+
Select
|
|
18
|
+
} from "./chunk-355MU6BH.js";
|
|
19
|
+
import {
|
|
20
|
+
Separator
|
|
21
|
+
} from "./chunk-HYITAA4J.js";
|
|
16
22
|
import {
|
|
17
23
|
Skeleton
|
|
18
24
|
} from "./chunk-5H3YPCZK.js";
|
|
@@ -32,11 +38,11 @@ import {
|
|
|
32
38
|
TextArea
|
|
33
39
|
} from "./chunk-ILRUXI2E.js";
|
|
34
40
|
import {
|
|
35
|
-
|
|
36
|
-
} from "./chunk-
|
|
41
|
+
Progress
|
|
42
|
+
} from "./chunk-365QMK4D.js";
|
|
37
43
|
import {
|
|
38
|
-
|
|
39
|
-
} from "./chunk-
|
|
44
|
+
Quote
|
|
45
|
+
} from "./chunk-YO3BQW6S.js";
|
|
40
46
|
import {
|
|
41
47
|
RadioCards
|
|
42
48
|
} from "./chunk-6IVCARWS.js";
|
|
@@ -56,11 +62,11 @@ import {
|
|
|
56
62
|
SegmentedControl
|
|
57
63
|
} from "./chunk-TVDKGMBI.js";
|
|
58
64
|
import {
|
|
59
|
-
|
|
60
|
-
} from "./chunk-
|
|
65
|
+
Grid
|
|
66
|
+
} from "./chunk-EGEQY3KT.js";
|
|
61
67
|
import {
|
|
62
|
-
|
|
63
|
-
} from "./chunk-
|
|
68
|
+
Heading
|
|
69
|
+
} from "./chunk-HLOY6BIP.js";
|
|
64
70
|
import {
|
|
65
71
|
HoverCard
|
|
66
72
|
} from "./chunk-O3T3TM3V.js";
|
|
@@ -75,16 +81,16 @@ import {
|
|
|
75
81
|
} from "./chunk-TULWX7D6.js";
|
|
76
82
|
import {
|
|
77
83
|
Link
|
|
78
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-XQOZWYUA.js";
|
|
79
85
|
import {
|
|
80
86
|
Popover
|
|
81
87
|
} from "./chunk-5AVBYDPB.js";
|
|
82
88
|
import {
|
|
83
|
-
|
|
84
|
-
} from "./chunk-
|
|
89
|
+
Checkbox
|
|
90
|
+
} from "./chunk-JEHDCZQU.js";
|
|
85
91
|
import {
|
|
86
|
-
|
|
87
|
-
} from "./chunk-
|
|
92
|
+
Code
|
|
93
|
+
} from "./chunk-OHMOP5PV.js";
|
|
88
94
|
import {
|
|
89
95
|
Container
|
|
90
96
|
} from "./chunk-Q37G2GS6.js";
|
|
@@ -104,17 +110,17 @@ import {
|
|
|
104
110
|
Flex
|
|
105
111
|
} from "./chunk-25HMMI7R.js";
|
|
106
112
|
import {
|
|
107
|
-
|
|
108
|
-
} from "./chunk-
|
|
113
|
+
Badge
|
|
114
|
+
} from "./chunk-ALOPZ54P.js";
|
|
109
115
|
import {
|
|
110
|
-
|
|
111
|
-
} from "./chunk-
|
|
116
|
+
Blockquote
|
|
117
|
+
} from "./chunk-YGL6SWKN.js";
|
|
112
118
|
import {
|
|
113
119
|
Box
|
|
114
120
|
} from "./chunk-4Y5BEXVN.js";
|
|
115
121
|
import {
|
|
116
122
|
Button
|
|
117
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-RET725VL.js";
|
|
118
124
|
import {
|
|
119
125
|
Callout
|
|
120
126
|
} from "./chunk-B6XJN6EC.js";
|
|
@@ -126,13 +132,7 @@ import {
|
|
|
126
132
|
} from "./chunk-MIMJ7LON.js";
|
|
127
133
|
import {
|
|
128
134
|
CheckboxGroup
|
|
129
|
-
} from "./chunk-
|
|
130
|
-
import {
|
|
131
|
-
Checkbox
|
|
132
|
-
} from "./chunk-3566LFAS.js";
|
|
133
|
-
import {
|
|
134
|
-
Code
|
|
135
|
-
} from "./chunk-OHMOP5PV.js";
|
|
135
|
+
} from "./chunk-IQEEPHOY.js";
|
|
136
136
|
import {
|
|
137
137
|
BookmarkIcon,
|
|
138
138
|
ChatBubbleIcon,
|
|
@@ -143,6 +143,12 @@ import {
|
|
|
143
143
|
MagnifyingGlassIcon,
|
|
144
144
|
PlusIcon
|
|
145
145
|
} from "./chunk-UVZ6CCUI.js";
|
|
146
|
+
import {
|
|
147
|
+
ThemeProvider
|
|
148
|
+
} from "./chunk-PL3Q4UVY.js";
|
|
149
|
+
import {
|
|
150
|
+
useThemeContext
|
|
151
|
+
} from "./chunk-MMGP4GEQ.js";
|
|
146
152
|
import {
|
|
147
153
|
AlertDialog
|
|
148
154
|
} from "./chunk-J242TTFH.js";
|
|
@@ -151,14 +157,8 @@ import {
|
|
|
151
157
|
} from "./chunk-EAXUQEO5.js";
|
|
152
158
|
import {
|
|
153
159
|
Avatar
|
|
154
|
-
} from "./chunk-
|
|
155
|
-
import
|
|
156
|
-
Badge
|
|
157
|
-
} from "./chunk-W4KST6UY.js";
|
|
158
|
-
import {
|
|
159
|
-
Blockquote
|
|
160
|
-
} from "./chunk-YGL6SWKN.js";
|
|
161
|
-
import "./chunk-LGTAQGUA.js";
|
|
160
|
+
} from "./chunk-CZEGRZBK.js";
|
|
161
|
+
import "./chunk-N552FDTV.js";
|
|
162
162
|
export {
|
|
163
163
|
AlertDialog,
|
|
164
164
|
AspectRatio,
|
|
@@ -40,7 +40,7 @@ module.exports = __toCommonJS(theme_provider_exports);
|
|
|
40
40
|
var import_themes = require("@radix-ui/themes");
|
|
41
41
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
42
|
function ThemeProvider(props) {
|
|
43
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Theme, __spreadValues({ accentColor: "iris" }, props));
|
|
43
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Theme, __spreadValues({ accentColor: "iris", radius: "large" }, props));
|
|
44
44
|
}
|
|
45
45
|
// Annotate the CommonJS export names for ESM import in node:
|
|
46
46
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/theme/theme-provider.tsx"],"sourcesContent":["import React from 'react';\nimport { Theme } from '@radix-ui/themes';\n\ntype ThemeProps = React.ComponentProps<typeof Theme>;\n\ninterface ThemeProviderProps extends ThemeProps {\n children: React.ReactNode;\n}\n\nexport function ThemeProvider(props: ThemeProviderProps): React.ReactNode {\n return <Theme accentColor=\"iris\" {...props} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAsB;AASb;AADF,SAAS,cAAc,OAA4C;AACxE,SAAO,4CAAC,sCAAM,aAAY,
|
|
1
|
+
{"version":3,"sources":["../../src/theme/theme-provider.tsx"],"sourcesContent":["import React from 'react';\nimport { Theme } from '@radix-ui/themes';\n\ntype ThemeProps = React.ComponentProps<typeof Theme>;\n\ninterface ThemeProviderProps extends ThemeProps {\n children: React.ReactNode;\n}\n\nexport function ThemeProvider(props: ThemeProviderProps): React.ReactNode {\n return <Theme accentColor=\"iris\" radius=\"large\" {...props} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAsB;AASb;AADF,SAAS,cAAc,OAA4C;AACxE,SAAO,4CAAC,sCAAM,aAAY,QAAO,QAAO,WAAY,MAAO;AAC7D;","names":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { Theme } from '@radix-ui/themes';
|
|
3
3
|
|
|
4
|
-
type ThemeProps =
|
|
4
|
+
type ThemeProps = React__default.ComponentProps<typeof Theme>;
|
|
5
5
|
interface ThemeProviderProps extends ThemeProps {
|
|
6
|
-
children:
|
|
6
|
+
children: React__default.ReactNode;
|
|
7
7
|
}
|
|
8
|
-
declare function ThemeProvider(props: ThemeProviderProps):
|
|
8
|
+
declare function ThemeProvider(props: ThemeProviderProps): React__default.ReactNode;
|
|
9
9
|
|
|
10
10
|
export { ThemeProvider };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { Theme } from '@radix-ui/themes';
|
|
3
3
|
|
|
4
|
-
type ThemeProps =
|
|
4
|
+
type ThemeProps = React__default.ComponentProps<typeof Theme>;
|
|
5
5
|
interface ThemeProviderProps extends ThemeProps {
|
|
6
|
-
children:
|
|
6
|
+
children: React__default.ReactNode;
|
|
7
7
|
}
|
|
8
|
-
declare function ThemeProvider(props: ThemeProviderProps):
|
|
8
|
+
declare function ThemeProvider(props: ThemeProviderProps): React__default.ReactNode;
|
|
9
9
|
|
|
10
10
|
export { ThemeProvider };
|
package/dist/theme/use-theme.js
CHANGED
package/dist/ui-props/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tipp/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -54,9 +54,11 @@
|
|
|
54
54
|
"dist/**"
|
|
55
55
|
],
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@kbox-labs/react-echarts": "^1.2.0",
|
|
58
57
|
"@radix-ui/react-icons": "^1.3.0",
|
|
59
58
|
"@radix-ui/themes": "^3.1.1",
|
|
59
|
+
"echarts-for-react": "^3.0.2",
|
|
60
|
+
"i": "^0.3.7",
|
|
61
|
+
"npm": "^10.8.2",
|
|
60
62
|
"react": "^18.3.1",
|
|
61
63
|
"react-datepicker": "^7.3.0",
|
|
62
64
|
"react-dom": "^18.3.1",
|
package/src/atoms/avatar.tsx
CHANGED
|
@@ -1 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
Avatar as RadixAvatar,
|
|
3
|
+
type AvatarProps as RadixAvatarProps,
|
|
4
|
+
} from '@radix-ui/themes';
|
|
5
|
+
import { useMemo, forwardRef } from 'react';
|
|
6
|
+
|
|
7
|
+
export type AvatarProps = Omit<RadixAvatarProps, 'size'> & {
|
|
8
|
+
size?: 'small' | 'medium' | 'large' | 'full';
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Avatar = forwardRef<HTMLImageElement, AvatarProps>(
|
|
12
|
+
(props: AvatarProps, ref): React.ReactNode => {
|
|
13
|
+
const { children, size, variant = 'soft', ...rest } = props;
|
|
14
|
+
const radixSize = useMemo<RadixAvatarProps['size']>(() => {
|
|
15
|
+
switch (size) {
|
|
16
|
+
case 'small':
|
|
17
|
+
return '1';
|
|
18
|
+
case 'medium':
|
|
19
|
+
return '2';
|
|
20
|
+
case 'large':
|
|
21
|
+
return '3';
|
|
22
|
+
case 'full':
|
|
23
|
+
return '4';
|
|
24
|
+
default:
|
|
25
|
+
return size;
|
|
26
|
+
}
|
|
27
|
+
}, [size]);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<RadixAvatar {...rest} ref={ref} size={radixSize} variant={variant}>
|
|
31
|
+
{children}
|
|
32
|
+
</RadixAvatar>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
Avatar.displayName = 'Avatar';
|
package/src/atoms/badge.tsx
CHANGED
|
@@ -1 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
Badge as RadixBadge,
|
|
3
|
+
type BadgeProps as RadixBadgeProps,
|
|
4
|
+
} from '@radix-ui/themes';
|
|
5
|
+
import { useMemo, forwardRef } from 'react';
|
|
6
|
+
|
|
7
|
+
export type BadgeProps = Omit<RadixBadgeProps, 'color'> & {
|
|
8
|
+
size: 'small' | 'large';
|
|
9
|
+
color: 'error' | 'accent' | 'neutral' | 'success';
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const Badge = forwardRef<HTMLSpanElement, BadgeProps>(
|
|
13
|
+
(props: BadgeProps, ref): React.ReactNode => {
|
|
14
|
+
const { size, color, ...rest } = props;
|
|
15
|
+
|
|
16
|
+
const radixSize = useMemo(() => {
|
|
17
|
+
switch (size) {
|
|
18
|
+
case 'small':
|
|
19
|
+
return '1';
|
|
20
|
+
case 'large':
|
|
21
|
+
return '3';
|
|
22
|
+
default:
|
|
23
|
+
return '1';
|
|
24
|
+
}
|
|
25
|
+
}, [size]);
|
|
26
|
+
|
|
27
|
+
const radixColor = useMemo(() => {
|
|
28
|
+
switch (color) {
|
|
29
|
+
case 'error':
|
|
30
|
+
return 'red';
|
|
31
|
+
case 'neutral':
|
|
32
|
+
return 'gray';
|
|
33
|
+
case 'success':
|
|
34
|
+
return 'green';
|
|
35
|
+
case 'accent':
|
|
36
|
+
default:
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
}, [color]);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<RadixBadge {...rest} color={radixColor} ref={ref} size={radixSize} />
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
Badge.displayName = 'Badge';
|
package/src/atoms/button.tsx
CHANGED
|
@@ -1 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
Button as RadixButton,
|
|
3
|
+
type ButtonProps as RadixButtonProps,
|
|
4
|
+
} from '@radix-ui/themes';
|
|
5
|
+
import React, { forwardRef, useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
export type ButtonProps = Omit<RadixButtonProps, 'size'> & {
|
|
8
|
+
size: 'small' | 'medium' | 'large';
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
12
|
+
(props, ref): React.ReactNode => {
|
|
13
|
+
const { size, ...restProps } = props;
|
|
14
|
+
|
|
15
|
+
const radixSize = useMemo(() => {
|
|
16
|
+
switch (size) {
|
|
17
|
+
case 'small':
|
|
18
|
+
return '2';
|
|
19
|
+
case 'medium':
|
|
20
|
+
return '3';
|
|
21
|
+
case 'large':
|
|
22
|
+
return '4';
|
|
23
|
+
default:
|
|
24
|
+
return '3';
|
|
25
|
+
}
|
|
26
|
+
}, [size]);
|
|
27
|
+
|
|
28
|
+
return <RadixButton {...restProps} ref={ref} size={radixSize} />;
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
Button.displayName = 'Button';
|
|
@@ -1 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
import { CheckboxGroup as RadixCheckboxGroup } from '@radix-ui/themes';
|
|
2
|
+
import React, { forwardRef, useMemo } from 'react';
|
|
3
|
+
|
|
4
|
+
type RadixCheckboxGroupProps = React.ComponentPropsWithoutRef<
|
|
5
|
+
typeof RadixCheckboxGroup.Root
|
|
6
|
+
>;
|
|
7
|
+
type CheckboxGroupProps = Omit<RadixCheckboxGroupProps, 'size'> & {
|
|
8
|
+
size: 'small' | 'medium' | 'large';
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const Root = forwardRef<HTMLDivElement, CheckboxGroupProps>((props, ref) => {
|
|
12
|
+
const { children, size, ...rest } = props;
|
|
13
|
+
|
|
14
|
+
const groupSize = useMemo<RadixCheckboxGroupProps['size']>(() => {
|
|
15
|
+
switch (size) {
|
|
16
|
+
case 'small':
|
|
17
|
+
return '1';
|
|
18
|
+
case 'large':
|
|
19
|
+
return '3';
|
|
20
|
+
case 'medium':
|
|
21
|
+
default:
|
|
22
|
+
return '2';
|
|
23
|
+
}
|
|
24
|
+
}, [size]);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<RadixCheckboxGroup.Root {...rest} ref={ref} size={groupSize}>
|
|
28
|
+
{children}
|
|
29
|
+
</RadixCheckboxGroup.Root>
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
Root.displayName = 'CheckboxGroup.Root';
|
|
34
|
+
|
|
35
|
+
export const CheckboxGroup = {
|
|
36
|
+
Root,
|
|
37
|
+
Item: RadixCheckboxGroup.Item,
|
|
38
|
+
};
|
package/src/atoms/check-box.tsx
CHANGED
|
@@ -1 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
Checkbox as RadixCheckbox,
|
|
3
|
+
type CheckboxProps as RadixCheckboxProps,
|
|
4
|
+
} from '@radix-ui/themes';
|
|
5
|
+
import { useMemo, forwardRef } from 'react';
|
|
6
|
+
|
|
7
|
+
export type CheckboxProps = Omit<RadixCheckboxProps, 'size'> & {
|
|
8
|
+
size?: 'small' | 'medium' | 'large';
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Checkbox = forwardRef<HTMLButtonElement, CheckboxProps>(
|
|
12
|
+
(props, ref): React.ReactNode => {
|
|
13
|
+
const { size = 'medium', ...rest } = props;
|
|
14
|
+
|
|
15
|
+
const radixSize = useMemo<RadixCheckboxProps['size']>(() => {
|
|
16
|
+
switch (size) {
|
|
17
|
+
case 'small':
|
|
18
|
+
return '1';
|
|
19
|
+
case 'medium':
|
|
20
|
+
return '2';
|
|
21
|
+
case 'large':
|
|
22
|
+
return '3';
|
|
23
|
+
}
|
|
24
|
+
}, [size]);
|
|
25
|
+
|
|
26
|
+
return <RadixCheckbox {...rest} ref={ref} size={radixSize} />;
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
Checkbox.displayName = 'Checkbox';
|
package/src/atoms/heading.tsx
CHANGED
|
@@ -1 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
Heading as RadixHeading,
|
|
3
|
+
type HeadingProps as RadixHeadingProps,
|
|
4
|
+
} from '@radix-ui/themes';
|
|
5
|
+
import { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
export { Heading as RadixHeading } from '@radix-ui/themes';
|
|
8
|
+
|
|
9
|
+
export type HeadingProps = RadixHeadingProps & {
|
|
10
|
+
variant?: 'subtitle1' | 'heading1' | 'heading2' | 'heading3';
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export function Heading(props: HeadingProps): React.ReactNode {
|
|
14
|
+
const { size, children, variant, ...rest } = props;
|
|
15
|
+
const radixSize = useMemo<RadixHeadingProps['size']>(() => {
|
|
16
|
+
switch (variant) {
|
|
17
|
+
case 'subtitle1':
|
|
18
|
+
return '4';
|
|
19
|
+
case 'heading1':
|
|
20
|
+
return '7';
|
|
21
|
+
case 'heading2':
|
|
22
|
+
return '6';
|
|
23
|
+
case 'heading3':
|
|
24
|
+
return '5';
|
|
25
|
+
default:
|
|
26
|
+
return size;
|
|
27
|
+
}
|
|
28
|
+
}, [size, variant]);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<RadixHeading {...rest} size={radixSize}>
|
|
32
|
+
{children}
|
|
33
|
+
</RadixHeading>
|
|
34
|
+
);
|
|
35
|
+
}
|
package/src/atoms/link.tsx
CHANGED
|
@@ -1 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
Link as RadixLink,
|
|
3
|
+
type LinkProps as RadixLinkProps,
|
|
4
|
+
} from '@radix-ui/themes';
|
|
5
|
+
import { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
export { Heading as RadixHeading } from '@radix-ui/themes';
|
|
8
|
+
|
|
9
|
+
export type LinkProps = RadixLinkProps & {
|
|
10
|
+
variant?: 'caption' | 'body' | 'subtitle';
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export function Link(props: LinkProps): React.ReactNode {
|
|
14
|
+
const { size, children, variant, ...rest } = props;
|
|
15
|
+
const radixSize = useMemo<RadixLinkProps['size']>(() => {
|
|
16
|
+
switch (variant) {
|
|
17
|
+
case 'caption':
|
|
18
|
+
return '1';
|
|
19
|
+
case 'body':
|
|
20
|
+
return '2';
|
|
21
|
+
case 'subtitle':
|
|
22
|
+
return '3';
|
|
23
|
+
default:
|
|
24
|
+
return size;
|
|
25
|
+
}
|
|
26
|
+
}, [size, variant]);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<RadixLink {...rest} size={radixSize}>
|
|
30
|
+
{children}
|
|
31
|
+
</RadixLink>
|
|
32
|
+
);
|
|
33
|
+
}
|
package/src/atoms/text.tsx
CHANGED
|
@@ -1 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
import type { TextProps as RadixTextProps } from '@radix-ui/themes';
|
|
2
|
+
import { Text as RadixText } from '@radix-ui/themes';
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
|
+
|
|
5
|
+
export type TextProps = RadixTextProps & {
|
|
6
|
+
variant?: 'body' | 'caption' | 'subtitle';
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export function Text(props: TextProps): React.ReactNode {
|
|
10
|
+
const { size, variant, children, ...rest } = props;
|
|
11
|
+
|
|
12
|
+
const radixSize = useMemo<RadixTextProps['size']>(() => {
|
|
13
|
+
switch (variant) {
|
|
14
|
+
case 'caption':
|
|
15
|
+
return '1';
|
|
16
|
+
case 'subtitle':
|
|
17
|
+
return '3';
|
|
18
|
+
case 'body':
|
|
19
|
+
return '2';
|
|
20
|
+
default:
|
|
21
|
+
return size;
|
|
22
|
+
}
|
|
23
|
+
}, [size, variant]);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<RadixText {...rest} size={radixSize}>
|
|
27
|
+
{children}
|
|
28
|
+
</RadixText>
|
|
29
|
+
);
|
|
30
|
+
}
|
package/src/chart/chart.tsx
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { EChart } from '@kbox-labs/react-echarts';
|
|
3
|
-
import type { EChartProps } from '@kbox-labs/react-echarts';
|
|
4
2
|
import { useResizeDetector } from 'react-resize-detector';
|
|
3
|
+
import ReactECharts from 'echarts-for-react';
|
|
5
4
|
|
|
6
|
-
export type ChartProps =
|
|
5
|
+
export type ChartProps = React.ComponentProps<typeof ReactECharts>;
|
|
7
6
|
|
|
8
7
|
export function Chart(props: ChartProps): JSX.Element {
|
|
9
8
|
const { width, height, ref } = useResizeDetector({
|
|
@@ -14,7 +13,7 @@ export function Chart(props: ChartProps): JSX.Element {
|
|
|
14
13
|
|
|
15
14
|
return (
|
|
16
15
|
<div ref={ref} style={{ width: '100%', height: '100%' }}>
|
|
17
|
-
<
|
|
16
|
+
<ReactECharts style={{ width, height }} {...props} />
|
|
18
17
|
</div>
|
|
19
18
|
);
|
|
20
19
|
}
|
package/dist/chunk-3566LFAS.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/atoms/check-box.tsx"],"sourcesContent":["export { Checkbox, type CheckboxProps } from '@radix-ui/themes';\n"],"mappings":";AAAA,SAAS,gBAAoC;","names":[]}
|
package/dist/chunk-4PP245MS.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/atoms/check-box-group.tsx"],"sourcesContent":["export { CheckboxGroup } from '@radix-ui/themes';\n"],"mappings":";AAAA,SAAS,qBAAqB;","names":[]}
|
package/dist/chunk-DYUKDKUS.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/atoms/text.tsx"],"sourcesContent":["export { Text, type TextProps } from '@radix-ui/themes';\n"],"mappings":";AAAA,SAAS,YAA4B;","names":[]}
|
package/dist/chunk-LFJCZVNE.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/atoms/button.tsx"],"sourcesContent":["export { Button, type ButtonProps } from '@radix-ui/themes';\n"],"mappings":";AAAA,SAAS,cAAgC;","names":[]}
|
package/dist/chunk-M4P36WOR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/atoms/avatar.tsx"],"sourcesContent":["export { Avatar, type AvatarProps } from '@radix-ui/themes';\n"],"mappings":";AAAA,SAAS,cAAgC;","names":[]}
|
package/dist/chunk-MLMWFOEE.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/atoms/link.tsx"],"sourcesContent":["export { Link, type LinkProps } from '@radix-ui/themes';\n"],"mappings":";AAAA,SAAS,YAA4B;","names":[]}
|
package/dist/chunk-MYTJIEMB.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/atoms/heading.tsx"],"sourcesContent":["export { Heading, type HeadingProps } from '@radix-ui/themes';\n"],"mappings":";AAAA,SAAS,eAAkC;","names":[]}
|