@hamster-note/components 0.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/LICENSE +21 -0
- package/README.md +411 -0
- package/dist/badge-BxBwSGqN.js +16 -0
- package/dist/badge.d.ts +2 -0
- package/dist/badge.js +2 -0
- package/dist/button-DRz0VTkf.js +18 -0
- package/dist/button.d.ts +2 -0
- package/dist/button.js +2 -0
- package/dist/components/badge/Badge.d.ts +7 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/button/Button.d.ts +9 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/confirm/Confirm.d.ts +24 -0
- package/dist/components/confirm/confirm.d.ts +3 -0
- package/dist/components/confirm/index.d.ts +3 -0
- package/dist/components/dialog/Dialog.d.ts +11 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/dialog/use-modal.d.ts +22 -0
- package/dist/components/drawer/Drawer.d.ts +14 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/icon/Icon.d.ts +28 -0
- package/dist/components/icon/icon-names.d.ts +15 -0
- package/dist/components/icon/index.d.ts +4 -0
- package/dist/components/kbd/Kbd.d.ts +6 -0
- package/dist/components/kbd/index.d.ts +2 -0
- package/dist/components/loading/Loading.d.ts +12 -0
- package/dist/components/loading/index.d.ts +3 -0
- package/dist/components/loading/loading.d.ts +3 -0
- package/dist/components/menu/Menu.d.ts +25 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/note-card/NoteCard.d.ts +9 -0
- package/dist/components/note-card/index.d.ts +2 -0
- package/dist/components/popover/Popover.d.ts +21 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/use-anchor-position.d.ts +14 -0
- package/dist/components/text-field/TextField.d.ts +7 -0
- package/dist/components/text-field/index.d.ts +2 -0
- package/dist/components/theme/ThemeProvider.d.ts +77 -0
- package/dist/components/theme/index.d.ts +4 -0
- package/dist/components/theme/theme.d.ts +87 -0
- package/dist/confirm-3eBmopl8.js +109 -0
- package/dist/confirm.d.ts +2 -0
- package/dist/confirm.js +2 -0
- package/dist/dialog-B4xS5zlK.js +53 -0
- package/dist/dialog.d.ts +2 -0
- package/dist/dialog.js +2 -0
- package/dist/drawer-DoeuGAHD.js +60 -0
- package/dist/drawer.d.ts +2 -0
- package/dist/drawer.js +2 -0
- package/dist/hamster-note-components.css +2 -0
- package/dist/icon-C40ONpMt.js +451 -0
- package/dist/icon.d.ts +2 -0
- package/dist/icon.js +2 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +14 -0
- package/dist/kbd-D9XXd3qf.js +39 -0
- package/dist/kbd.d.ts +2 -0
- package/dist/kbd.js +2 -0
- package/dist/loading-BpykjzMR.js +88 -0
- package/dist/loading.d.ts +2 -0
- package/dist/loading.js +2 -0
- package/dist/menu-B6uuZFif.js +142 -0
- package/dist/menu.d.ts +2 -0
- package/dist/menu.js +2 -0
- package/dist/note-card-Dm-WbNTO.js +50 -0
- package/dist/note-card.d.ts +2 -0
- package/dist/note-card.js +2 -0
- package/dist/popover-Qg_fA2A_.js +165 -0
- package/dist/popover.d.ts +2 -0
- package/dist/popover.js +2 -0
- package/dist/text-field-B8Scu04G.js +31 -0
- package/dist/text-field.d.ts +2 -0
- package/dist/text-field.js +2 -0
- package/dist/theme-C0p_hpKk.js +67 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +2 -0
- package/dist/use-modal-K9L8aPS0.js +82 -0
- package/package.json +111 -0
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/icon/Icon.tsx
|
|
4
|
+
var r = {
|
|
5
|
+
file: /* @__PURE__ */ n(e, { children: [
|
|
6
|
+
/* @__PURE__ */ t("path", { d: "M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" }),
|
|
7
|
+
/* @__PURE__ */ t("path", { d: "M14 3v5h5" }),
|
|
8
|
+
/* @__PURE__ */ t("path", { d: "M9 13h6" }),
|
|
9
|
+
/* @__PURE__ */ t("path", { d: "M9 17h6" })
|
|
10
|
+
] }),
|
|
11
|
+
save: /* @__PURE__ */ n(e, { children: [
|
|
12
|
+
/* @__PURE__ */ t("path", { d: "M5 4h11l3 3v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1z" }),
|
|
13
|
+
/* @__PURE__ */ t("path", { d: "M8 4v5h7V4" }),
|
|
14
|
+
/* @__PURE__ */ t("path", { d: "M8 14h8v7H8z" })
|
|
15
|
+
] }),
|
|
16
|
+
study: /* @__PURE__ */ n(e, { children: [
|
|
17
|
+
/* @__PURE__ */ t("path", { d: "M12 6c-1.5-1.2-3.5-2-6-2H3v13h3c2.5 0 4.5.8 6 2 1.5-1.2 3.5-2 6-2h3V4h-3c-2.5 0-4.5.8-6 2z" }),
|
|
18
|
+
/* @__PURE__ */ t("path", { d: "M12 6v13" }),
|
|
19
|
+
/* @__PURE__ */ t("path", { d: "M5.5 8.5h3" }),
|
|
20
|
+
/* @__PURE__ */ t("path", { d: "M5.5 11.5h3" }),
|
|
21
|
+
/* @__PURE__ */ t("path", { d: "M15.5 8.5h3" }),
|
|
22
|
+
/* @__PURE__ */ t("path", { d: "M15.5 11.5h3" })
|
|
23
|
+
] }),
|
|
24
|
+
switch: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("rect", {
|
|
25
|
+
height: "12",
|
|
26
|
+
rx: "6",
|
|
27
|
+
width: "18",
|
|
28
|
+
x: "3",
|
|
29
|
+
y: "6"
|
|
30
|
+
}), /* @__PURE__ */ t("circle", {
|
|
31
|
+
cx: "15",
|
|
32
|
+
cy: "12",
|
|
33
|
+
r: "3.2"
|
|
34
|
+
})] }),
|
|
35
|
+
mouse: /* @__PURE__ */ n(e, { children: [
|
|
36
|
+
/* @__PURE__ */ t("rect", {
|
|
37
|
+
height: "16",
|
|
38
|
+
rx: "8",
|
|
39
|
+
width: "11",
|
|
40
|
+
x: "6.5",
|
|
41
|
+
y: "4"
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ t("path", { d: "M12 7v4" }),
|
|
44
|
+
/* @__PURE__ */ t("path", { d: "M12 7a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0V8a1 1 0 0 1 1-1z" })
|
|
45
|
+
] }),
|
|
46
|
+
line: /* @__PURE__ */ n(e, { children: [
|
|
47
|
+
/* @__PURE__ */ t("path", { d: "M5 19L19 5" }),
|
|
48
|
+
/* @__PURE__ */ t("circle", {
|
|
49
|
+
cx: "5",
|
|
50
|
+
cy: "19",
|
|
51
|
+
r: "1.2"
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ t("circle", {
|
|
54
|
+
cx: "19",
|
|
55
|
+
cy: "5",
|
|
56
|
+
r: "1.2"
|
|
57
|
+
})
|
|
58
|
+
] }),
|
|
59
|
+
curve: /* @__PURE__ */ n(e, { children: [
|
|
60
|
+
/* @__PURE__ */ t("path", { d: "M4 18C8 18 8 6 12 6S16 18 20 18" }),
|
|
61
|
+
/* @__PURE__ */ t("circle", {
|
|
62
|
+
cx: "4",
|
|
63
|
+
cy: "18",
|
|
64
|
+
r: "1.2"
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ t("circle", {
|
|
67
|
+
cx: "20",
|
|
68
|
+
cy: "18",
|
|
69
|
+
r: "1.2"
|
|
70
|
+
})
|
|
71
|
+
] }),
|
|
72
|
+
rectangle: /* @__PURE__ */ t(e, { children: /* @__PURE__ */ t("rect", {
|
|
73
|
+
height: "12",
|
|
74
|
+
rx: "1.5",
|
|
75
|
+
width: "16",
|
|
76
|
+
x: "4",
|
|
77
|
+
y: "6"
|
|
78
|
+
}) }),
|
|
79
|
+
ellipse: /* @__PURE__ */ t(e, { children: /* @__PURE__ */ t("ellipse", {
|
|
80
|
+
cx: "12",
|
|
81
|
+
cy: "12",
|
|
82
|
+
rx: "8",
|
|
83
|
+
ry: "6"
|
|
84
|
+
}) }),
|
|
85
|
+
pen: /* @__PURE__ */ n(e, { children: [
|
|
86
|
+
/* @__PURE__ */ t("path", { d: "M4 20l3.5-1 11-11-2.5-2.5-11 11-1 3.5z" }),
|
|
87
|
+
/* @__PURE__ */ t("path", { d: "M14.5 6.5l3 3" }),
|
|
88
|
+
/* @__PURE__ */ t("path", { d: "M4 20l1-3.5" })
|
|
89
|
+
] }),
|
|
90
|
+
eraser: /* @__PURE__ */ n(e, { children: [
|
|
91
|
+
/* @__PURE__ */ t("path", { d: "M15 4l5 5-9 9H6l-2-2 9-9z" }),
|
|
92
|
+
/* @__PURE__ */ t("path", { d: "M9 10l5 5" }),
|
|
93
|
+
/* @__PURE__ */ t("path", { d: "M13 20h7" })
|
|
94
|
+
] }),
|
|
95
|
+
magnet: /* @__PURE__ */ n(e, { children: [
|
|
96
|
+
/* @__PURE__ */ t("path", { d: "M4 10v3a6 6 0 0 0 12 0V5a1 1 0 0 0-1-1h-3a1 1 0 0 0-1 1v8a1 1 0 0 1-2 0V5a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1z" }),
|
|
97
|
+
/* @__PURE__ */ t("path", { d: "M11 4h4" }),
|
|
98
|
+
/* @__PURE__ */ t("path", { d: "M4 10h4" })
|
|
99
|
+
] }),
|
|
100
|
+
locate: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("path", { d: "M12 21s-7-6.2-7-11a7 7 0 0 1 14 0c0 4.8-7 11-7 11z" }), /* @__PURE__ */ t("circle", {
|
|
101
|
+
cx: "12",
|
|
102
|
+
cy: "10",
|
|
103
|
+
r: "2.5"
|
|
104
|
+
})] }),
|
|
105
|
+
delete: /* @__PURE__ */ n(e, { children: [
|
|
106
|
+
/* @__PURE__ */ t("path", { d: "M4 7h16" }),
|
|
107
|
+
/* @__PURE__ */ t("path", { d: "M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2" }),
|
|
108
|
+
/* @__PURE__ */ t("path", { d: "M6 7l1 13a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1l1-13" }),
|
|
109
|
+
/* @__PURE__ */ t("path", { d: "M10 11v6" }),
|
|
110
|
+
/* @__PURE__ */ t("path", { d: "M14 11v6" })
|
|
111
|
+
] }),
|
|
112
|
+
add: /* @__PURE__ */ n(e, { children: [
|
|
113
|
+
/* @__PURE__ */ t("circle", {
|
|
114
|
+
cx: "12",
|
|
115
|
+
cy: "12",
|
|
116
|
+
r: "9"
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ t("path", { d: "M12 8v8" }),
|
|
119
|
+
/* @__PURE__ */ t("path", { d: "M8 12h8" })
|
|
120
|
+
] }),
|
|
121
|
+
copy: /* @__PURE__ */ n(e, { children: [
|
|
122
|
+
/* @__PURE__ */ t("rect", {
|
|
123
|
+
height: "13",
|
|
124
|
+
rx: "1.5",
|
|
125
|
+
width: "10",
|
|
126
|
+
x: "8",
|
|
127
|
+
y: "8"
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ t("path", { d: "M11 8V5a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1h-3" }),
|
|
130
|
+
/* @__PURE__ */ t("path", { d: "M11 12h4" }),
|
|
131
|
+
/* @__PURE__ */ t("path", { d: "M11 15h4" })
|
|
132
|
+
] }),
|
|
133
|
+
paste: /* @__PURE__ */ n(e, { children: [
|
|
134
|
+
/* @__PURE__ */ t("rect", {
|
|
135
|
+
height: "15",
|
|
136
|
+
rx: "1.5",
|
|
137
|
+
width: "12",
|
|
138
|
+
x: "6",
|
|
139
|
+
y: "5"
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ t("path", { d: "M9 5V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v1" }),
|
|
142
|
+
/* @__PURE__ */ t("path", { d: "M11 11h2" }),
|
|
143
|
+
/* @__PURE__ */ t("path", { d: "M11 14h2" })
|
|
144
|
+
] }),
|
|
145
|
+
info: /* @__PURE__ */ n(e, { children: [
|
|
146
|
+
/* @__PURE__ */ t("circle", {
|
|
147
|
+
cx: "12",
|
|
148
|
+
cy: "12",
|
|
149
|
+
r: "9"
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ t("path", { d: "M12 11v5" }),
|
|
152
|
+
/* @__PURE__ */ t("circle", {
|
|
153
|
+
cx: "12",
|
|
154
|
+
cy: "8",
|
|
155
|
+
r: "0.5",
|
|
156
|
+
fill: "currentColor",
|
|
157
|
+
stroke: "none"
|
|
158
|
+
})
|
|
159
|
+
] }),
|
|
160
|
+
touch: /* @__PURE__ */ n(e, { children: [
|
|
161
|
+
/* @__PURE__ */ t("path", { d: "M9 11V5.5a1.5 1.5 0 0 1 3 0V11" }),
|
|
162
|
+
/* @__PURE__ */ t("path", { d: "M12 11v-.5a1.5 1.5 0 0 1 3 0V12" }),
|
|
163
|
+
/* @__PURE__ */ t("path", { d: "M15 12v-.5a1.5 1.5 0 0 1 3 0v5.5a5 5 0 0 1-5 5h-2a5 5 0 0 1-4-2l-3-4a1.5 1.5 0 0 1 2.4-1.8L9 16V9a1.5 1.5 0 0 1 0 0v2" }),
|
|
164
|
+
/* @__PURE__ */ t("path", { d: "M6 4.5a3 3 0 0 1 1-3" })
|
|
165
|
+
] }),
|
|
166
|
+
edit: /* @__PURE__ */ n(e, { children: [
|
|
167
|
+
/* @__PURE__ */ t("path", { d: "M14 5l5 5L8 21H3v-5z" }),
|
|
168
|
+
/* @__PURE__ */ t("path", { d: "M12 7l5 5" }),
|
|
169
|
+
/* @__PURE__ */ t("path", { d: "M3 21h18" })
|
|
170
|
+
] }),
|
|
171
|
+
keyboard: /* @__PURE__ */ n(e, { children: [
|
|
172
|
+
/* @__PURE__ */ t("rect", {
|
|
173
|
+
height: "12",
|
|
174
|
+
rx: "1.5",
|
|
175
|
+
width: "20",
|
|
176
|
+
x: "2",
|
|
177
|
+
y: "6"
|
|
178
|
+
}),
|
|
179
|
+
/* @__PURE__ */ t("path", { d: "M6 10h0" }),
|
|
180
|
+
/* @__PURE__ */ t("path", { d: "M10 10h0" }),
|
|
181
|
+
/* @__PURE__ */ t("path", { d: "M14 10h0" }),
|
|
182
|
+
/* @__PURE__ */ t("path", { d: "M18 10h0" }),
|
|
183
|
+
/* @__PURE__ */ t("path", { d: "M6 14h12" })
|
|
184
|
+
] }),
|
|
185
|
+
type: /* @__PURE__ */ n(e, { children: [
|
|
186
|
+
/* @__PURE__ */ t("path", { d: "M5 6h14" }),
|
|
187
|
+
/* @__PURE__ */ t("path", { d: "M12 6v13" }),
|
|
188
|
+
/* @__PURE__ */ t("path", { d: "M9 19h6" }),
|
|
189
|
+
/* @__PURE__ */ t("path", { d: "M16 13l1.5 4 .3.8a2 2 0 0 0 1.7 1.2c1.2 0 2-1 2-2.2 0-.8-.4-1.6-1-2.4L18 12" })
|
|
190
|
+
] }),
|
|
191
|
+
handle: /* @__PURE__ */ n(e, { children: [
|
|
192
|
+
/* @__PURE__ */ t("circle", {
|
|
193
|
+
cx: "9",
|
|
194
|
+
cy: "6",
|
|
195
|
+
r: "1.4",
|
|
196
|
+
fill: "currentColor",
|
|
197
|
+
stroke: "none"
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ t("circle", {
|
|
200
|
+
cx: "15",
|
|
201
|
+
cy: "6",
|
|
202
|
+
r: "1.4",
|
|
203
|
+
fill: "currentColor",
|
|
204
|
+
stroke: "none"
|
|
205
|
+
}),
|
|
206
|
+
/* @__PURE__ */ t("circle", {
|
|
207
|
+
cx: "9",
|
|
208
|
+
cy: "12",
|
|
209
|
+
r: "1.4",
|
|
210
|
+
fill: "currentColor",
|
|
211
|
+
stroke: "none"
|
|
212
|
+
}),
|
|
213
|
+
/* @__PURE__ */ t("circle", {
|
|
214
|
+
cx: "15",
|
|
215
|
+
cy: "12",
|
|
216
|
+
r: "1.4",
|
|
217
|
+
fill: "currentColor",
|
|
218
|
+
stroke: "none"
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ t("circle", {
|
|
221
|
+
cx: "9",
|
|
222
|
+
cy: "18",
|
|
223
|
+
r: "1.4",
|
|
224
|
+
fill: "currentColor",
|
|
225
|
+
stroke: "none"
|
|
226
|
+
}),
|
|
227
|
+
/* @__PURE__ */ t("circle", {
|
|
228
|
+
cx: "15",
|
|
229
|
+
cy: "18",
|
|
230
|
+
r: "1.4",
|
|
231
|
+
fill: "currentColor",
|
|
232
|
+
stroke: "none"
|
|
233
|
+
})
|
|
234
|
+
] }),
|
|
235
|
+
card: /* @__PURE__ */ n(e, { children: [
|
|
236
|
+
/* @__PURE__ */ t("rect", {
|
|
237
|
+
height: "14",
|
|
238
|
+
rx: "2",
|
|
239
|
+
width: "18",
|
|
240
|
+
x: "3",
|
|
241
|
+
y: "5"
|
|
242
|
+
}),
|
|
243
|
+
/* @__PURE__ */ t("path", { d: "M3 10h18" }),
|
|
244
|
+
/* @__PURE__ */ t("path", { d: "M7 14h6" }),
|
|
245
|
+
/* @__PURE__ */ t("path", { d: "M7 17h4" })
|
|
246
|
+
] }),
|
|
247
|
+
search: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("circle", {
|
|
248
|
+
cx: "11",
|
|
249
|
+
cy: "11",
|
|
250
|
+
r: "7"
|
|
251
|
+
}), /* @__PURE__ */ t("path", { d: "M21 21l-4.3-4.3" })] }),
|
|
252
|
+
close: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("path", { d: "M6 6l12 12" }), /* @__PURE__ */ t("path", { d: "M18 6L6 18" })] }),
|
|
253
|
+
check: /* @__PURE__ */ t(e, { children: /* @__PURE__ */ t("path", { d: "M5 12.5l4.5 4.5L19 7.5" }) }),
|
|
254
|
+
"chevron-down": /* @__PURE__ */ t(e, { children: /* @__PURE__ */ t("path", { d: "M6 9l6 6 6-6" }) }),
|
|
255
|
+
"chevron-up": /* @__PURE__ */ t(e, { children: /* @__PURE__ */ t("path", { d: "M6 15l6-6 6 6" }) }),
|
|
256
|
+
"chevron-left": /* @__PURE__ */ t(e, { children: /* @__PURE__ */ t("path", { d: "M15 6l-6 6 6 6" }) }),
|
|
257
|
+
"chevron-right": /* @__PURE__ */ t(e, { children: /* @__PURE__ */ t("path", { d: "M9 6l6 6-6 6" }) }),
|
|
258
|
+
"arrow-up": /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("path", { d: "M12 19V5" }), /* @__PURE__ */ t("path", { d: "M6 11l6-6 6 6" })] }),
|
|
259
|
+
"arrow-down": /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("path", { d: "M12 5v14" }), /* @__PURE__ */ t("path", { d: "M6 13l6 6 6-6" })] }),
|
|
260
|
+
"arrow-left": /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("path", { d: "M19 12H5" }), /* @__PURE__ */ t("path", { d: "M11 6l-6 6 6 6" })] }),
|
|
261
|
+
"arrow-right": /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("path", { d: "M5 12h14" }), /* @__PURE__ */ t("path", { d: "M13 6l6 6-6 6" })] }),
|
|
262
|
+
settings: /* @__PURE__ */ n(e, { children: [
|
|
263
|
+
/* @__PURE__ */ t("circle", {
|
|
264
|
+
cx: "12",
|
|
265
|
+
cy: "12",
|
|
266
|
+
r: "3"
|
|
267
|
+
}),
|
|
268
|
+
/* @__PURE__ */ t("path", { d: "M12 2.5v3" }),
|
|
269
|
+
/* @__PURE__ */ t("path", { d: "M12 18.5v3" }),
|
|
270
|
+
/* @__PURE__ */ t("path", { d: "M21.5 12h-3" }),
|
|
271
|
+
/* @__PURE__ */ t("path", { d: "M5.5 12h-3" }),
|
|
272
|
+
/* @__PURE__ */ t("path", { d: "M18.7 5.3l-2.1 2.1" }),
|
|
273
|
+
/* @__PURE__ */ t("path", { d: "M7.4 16.6l-2.1 2.1" }),
|
|
274
|
+
/* @__PURE__ */ t("path", { d: "M18.7 18.7l-2.1-2.1" }),
|
|
275
|
+
/* @__PURE__ */ t("path", { d: "M7.4 7.4L5.3 5.3" })
|
|
276
|
+
] }),
|
|
277
|
+
user: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("circle", {
|
|
278
|
+
cx: "12",
|
|
279
|
+
cy: "8",
|
|
280
|
+
r: "4"
|
|
281
|
+
}), /* @__PURE__ */ t("path", { d: "M4 20c0-4 4-6 8-6s8 2 8 6" })] }),
|
|
282
|
+
home: /* @__PURE__ */ n(e, { children: [
|
|
283
|
+
/* @__PURE__ */ t("path", { d: "M4 11l8-7 8 7" }),
|
|
284
|
+
/* @__PURE__ */ t("path", { d: "M6 10v9a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-9" }),
|
|
285
|
+
/* @__PURE__ */ t("path", { d: "M10 20v-5h4v5" })
|
|
286
|
+
] }),
|
|
287
|
+
star: /* @__PURE__ */ t(e, { children: /* @__PURE__ */ t("path", { d: "M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8L12 17.9l-5.2 2.6 1-5.8L3.5 9.7l5.9-.9z" }) }),
|
|
288
|
+
bookmark: /* @__PURE__ */ t(e, { children: /* @__PURE__ */ t("path", { d: "M6 4h12a1 1 0 0 1 1 1v15l-7-4-7 4V5a1 1 0 0 1 1-1z" }) }),
|
|
289
|
+
link: /* @__PURE__ */ n(e, { children: [
|
|
290
|
+
/* @__PURE__ */ t("path", { d: "M9 15l6-6" }),
|
|
291
|
+
/* @__PURE__ */ t("path", { d: "M10.5 6.5l1-1a3.5 3.5 0 0 1 5 5l-1 1" }),
|
|
292
|
+
/* @__PURE__ */ t("path", { d: "M13.5 17.5l-1 1a3.5 3.5 0 0 1-5-5l1-1" })
|
|
293
|
+
] }),
|
|
294
|
+
image: /* @__PURE__ */ n(e, { children: [
|
|
295
|
+
/* @__PURE__ */ t("rect", {
|
|
296
|
+
height: "16",
|
|
297
|
+
rx: "1.5",
|
|
298
|
+
width: "18",
|
|
299
|
+
x: "3",
|
|
300
|
+
y: "4"
|
|
301
|
+
}),
|
|
302
|
+
/* @__PURE__ */ t("circle", {
|
|
303
|
+
cx: "8.5",
|
|
304
|
+
cy: "9.5",
|
|
305
|
+
r: "1.5"
|
|
306
|
+
}),
|
|
307
|
+
/* @__PURE__ */ t("path", { d: "M4 17l5-5 4 4 3-3 4 4" })
|
|
308
|
+
] }),
|
|
309
|
+
calendar: /* @__PURE__ */ n(e, { children: [
|
|
310
|
+
/* @__PURE__ */ t("rect", {
|
|
311
|
+
height: "16",
|
|
312
|
+
rx: "1.5",
|
|
313
|
+
width: "18",
|
|
314
|
+
x: "3",
|
|
315
|
+
y: "5"
|
|
316
|
+
}),
|
|
317
|
+
/* @__PURE__ */ t("path", { d: "M3 9h18" }),
|
|
318
|
+
/* @__PURE__ */ t("path", { d: "M8 3v4" }),
|
|
319
|
+
/* @__PURE__ */ t("path", { d: "M16 3v4" }),
|
|
320
|
+
/* @__PURE__ */ t("path", { d: "M7 13h2" }),
|
|
321
|
+
/* @__PURE__ */ t("path", { d: "M11 13h2" }),
|
|
322
|
+
/* @__PURE__ */ t("path", { d: "M15 13h2" })
|
|
323
|
+
] }),
|
|
324
|
+
clock: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("circle", {
|
|
325
|
+
cx: "12",
|
|
326
|
+
cy: "12",
|
|
327
|
+
r: "9"
|
|
328
|
+
}), /* @__PURE__ */ t("path", { d: "M12 7v5l3.5 2" })] }),
|
|
329
|
+
bell: /* @__PURE__ */ n(e, { children: [
|
|
330
|
+
/* @__PURE__ */ t("path", { d: "M6 17h12l-1.2-2V11a4.8 4.8 0 0 0-9.6 0v4z" }),
|
|
331
|
+
/* @__PURE__ */ t("path", { d: "M10 17a2 2 0 0 0 4 0" }),
|
|
332
|
+
/* @__PURE__ */ t("path", { d: "M12 5v1.5" })
|
|
333
|
+
] }),
|
|
334
|
+
download: /* @__PURE__ */ n(e, { children: [
|
|
335
|
+
/* @__PURE__ */ t("path", { d: "M12 4v10" }),
|
|
336
|
+
/* @__PURE__ */ t("path", { d: "M8 10l4 4 4-4" }),
|
|
337
|
+
/* @__PURE__ */ t("path", { d: "M4 19h16" })
|
|
338
|
+
] }),
|
|
339
|
+
upload: /* @__PURE__ */ n(e, { children: [
|
|
340
|
+
/* @__PURE__ */ t("path", { d: "M12 16V6" }),
|
|
341
|
+
/* @__PURE__ */ t("path", { d: "M8 10l4-4 4 4" }),
|
|
342
|
+
/* @__PURE__ */ t("path", { d: "M4 19h16" })
|
|
343
|
+
] }),
|
|
344
|
+
share: /* @__PURE__ */ n(e, { children: [
|
|
345
|
+
/* @__PURE__ */ t("circle", {
|
|
346
|
+
cx: "6",
|
|
347
|
+
cy: "12",
|
|
348
|
+
r: "2.5"
|
|
349
|
+
}),
|
|
350
|
+
/* @__PURE__ */ t("circle", {
|
|
351
|
+
cx: "18",
|
|
352
|
+
cy: "6",
|
|
353
|
+
r: "2.5"
|
|
354
|
+
}),
|
|
355
|
+
/* @__PURE__ */ t("circle", {
|
|
356
|
+
cx: "18",
|
|
357
|
+
cy: "18",
|
|
358
|
+
r: "2.5"
|
|
359
|
+
}),
|
|
360
|
+
/* @__PURE__ */ t("path", { d: "M8.2 10.8l7.6-3.6" }),
|
|
361
|
+
/* @__PURE__ */ t("path", { d: "M8.2 13.2l7.6 3.6" })
|
|
362
|
+
] }),
|
|
363
|
+
undo: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("path", { d: "M9 7L4 12l5 5" }), /* @__PURE__ */ t("path", { d: "M4 12h11a5 5 0 0 1 0 10h-3" })] }),
|
|
364
|
+
redo: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("path", { d: "M15 7l5 5-5 5" }), /* @__PURE__ */ t("path", { d: "M20 12H9a5 5 0 0 0 0 10h3" })] }),
|
|
365
|
+
"zoom-in": /* @__PURE__ */ n(e, { children: [
|
|
366
|
+
/* @__PURE__ */ t("circle", {
|
|
367
|
+
cx: "11",
|
|
368
|
+
cy: "11",
|
|
369
|
+
r: "7"
|
|
370
|
+
}),
|
|
371
|
+
/* @__PURE__ */ t("path", { d: "M21 21l-4.3-4.3" }),
|
|
372
|
+
/* @__PURE__ */ t("path", { d: "M11 8v6" }),
|
|
373
|
+
/* @__PURE__ */ t("path", { d: "M8 11h6" })
|
|
374
|
+
] }),
|
|
375
|
+
"zoom-out": /* @__PURE__ */ n(e, { children: [
|
|
376
|
+
/* @__PURE__ */ t("circle", {
|
|
377
|
+
cx: "11",
|
|
378
|
+
cy: "11",
|
|
379
|
+
r: "7"
|
|
380
|
+
}),
|
|
381
|
+
/* @__PURE__ */ t("path", { d: "M21 21l-4.3-4.3" }),
|
|
382
|
+
/* @__PURE__ */ t("path", { d: "M8 11h6" })
|
|
383
|
+
] }),
|
|
384
|
+
menu: /* @__PURE__ */ n(e, { children: [
|
|
385
|
+
/* @__PURE__ */ t("path", { d: "M4 7h16" }),
|
|
386
|
+
/* @__PURE__ */ t("path", { d: "M4 12h16" }),
|
|
387
|
+
/* @__PURE__ */ t("path", { d: "M4 17h16" })
|
|
388
|
+
] }),
|
|
389
|
+
more: /* @__PURE__ */ n(e, { children: [
|
|
390
|
+
/* @__PURE__ */ t("circle", {
|
|
391
|
+
cx: "12",
|
|
392
|
+
cy: "5",
|
|
393
|
+
r: "1.4",
|
|
394
|
+
fill: "currentColor",
|
|
395
|
+
stroke: "none"
|
|
396
|
+
}),
|
|
397
|
+
/* @__PURE__ */ t("circle", {
|
|
398
|
+
cx: "12",
|
|
399
|
+
cy: "12",
|
|
400
|
+
r: "1.4",
|
|
401
|
+
fill: "currentColor",
|
|
402
|
+
stroke: "none"
|
|
403
|
+
}),
|
|
404
|
+
/* @__PURE__ */ t("circle", {
|
|
405
|
+
cx: "12",
|
|
406
|
+
cy: "19",
|
|
407
|
+
r: "1.4",
|
|
408
|
+
fill: "currentColor",
|
|
409
|
+
stroke: "none"
|
|
410
|
+
})
|
|
411
|
+
] }),
|
|
412
|
+
filter: /* @__PURE__ */ t(e, { children: /* @__PURE__ */ t("path", { d: "M4 5h16l-6 8v6l-4-2v-4z" }) }),
|
|
413
|
+
sort: /* @__PURE__ */ n(e, { children: [
|
|
414
|
+
/* @__PURE__ */ t("path", { d: "M8 4v16" }),
|
|
415
|
+
/* @__PURE__ */ t("path", { d: "M5 7l3-3 3 3" }),
|
|
416
|
+
/* @__PURE__ */ t("path", { d: "M11 17l-3 3-3-3" }),
|
|
417
|
+
/* @__PURE__ */ t("path", { d: "M14 8h6" }),
|
|
418
|
+
/* @__PURE__ */ t("path", { d: "M14 12h6" }),
|
|
419
|
+
/* @__PURE__ */ t("path", { d: "M14 16h6" })
|
|
420
|
+
] })
|
|
421
|
+
};
|
|
422
|
+
function i({ label: e, name: n, className: i, ...a }) {
|
|
423
|
+
return /* @__PURE__ */ t("svg", {
|
|
424
|
+
className: [
|
|
425
|
+
"hn-icon",
|
|
426
|
+
`hn-icon--${n}`,
|
|
427
|
+
i
|
|
428
|
+
].filter(Boolean).join(" "),
|
|
429
|
+
fill: "none",
|
|
430
|
+
focusable: "false",
|
|
431
|
+
height: "1em",
|
|
432
|
+
stroke: "currentColor",
|
|
433
|
+
strokeLinecap: "round",
|
|
434
|
+
strokeLinejoin: "round",
|
|
435
|
+
strokeWidth: 1.5,
|
|
436
|
+
viewBox: "0 0 24 24",
|
|
437
|
+
width: "1em",
|
|
438
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
439
|
+
...e === void 0 ? { "aria-hidden": !0 } : {
|
|
440
|
+
"aria-label": e,
|
|
441
|
+
role: "img"
|
|
442
|
+
},
|
|
443
|
+
...a,
|
|
444
|
+
children: r[n]
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
//#endregion
|
|
448
|
+
//#region src/components/icon/icon-names.ts
|
|
449
|
+
var a = /* @__PURE__ */ "file.save.study.switch.mouse.line.curve.rectangle.ellipse.pen.eraser.magnet.locate.delete.add.copy.paste.info.touch.edit.keyboard.type.handle.card.search.close.check.chevron-down.chevron-up.chevron-left.chevron-right.arrow-up.arrow-down.arrow-left.arrow-right.settings.user.home.star.bookmark.link.image.calendar.clock.bell.download.upload.share.undo.redo.zoom-in.zoom-out.menu.more.filter.sort".split(".");
|
|
450
|
+
//#endregion
|
|
451
|
+
export { i as n, a as t };
|
package/dist/icon.d.ts
ADDED
package/dist/icon.js
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type { BadgeProps, BadgeTone } from './components/badge';
|
|
2
|
+
export { Badge } from './components/badge';
|
|
3
|
+
export type { ButtonProps, ButtonSize, ButtonVariant } from './components/button';
|
|
4
|
+
export { Button } from './components/button';
|
|
5
|
+
export type { ConfirmFunction, ConfirmOptions, ConfirmProps, ConfirmTone, } from './components/confirm';
|
|
6
|
+
export { Confirm, ConfirmProvider, confirm, confirmDialog, useConfirm } from './components/confirm';
|
|
7
|
+
export type { DialogProps } from './components/dialog';
|
|
8
|
+
export { Dialog } from './components/dialog';
|
|
9
|
+
export type { DrawerPlacement, DrawerProps } from './components/drawer';
|
|
10
|
+
export { Drawer } from './components/drawer';
|
|
11
|
+
export type { IconName, IconProps } from './components/icon';
|
|
12
|
+
export { Icon, ICON_NAMES } from './components/icon';
|
|
13
|
+
export type { KbdProps } from './components/kbd';
|
|
14
|
+
export { Kbd } from './components/kbd';
|
|
15
|
+
export type { LoadingOptions, LoadingProps, LoadingSize } from './components/loading';
|
|
16
|
+
export { Loading, hideLoading, showLoading } from './components/loading';
|
|
17
|
+
export type { MenuItemProps, MenuItemTone, MenuLabelProps, MenuProps, MenuSeparatorProps, MenuSubmenuProps, } from './components/menu';
|
|
18
|
+
export { Menu, MenuItem, MenuLabel, MenuSeparator, MenuSubmenu } from './components/menu';
|
|
19
|
+
export type { NoteCardProps } from './components/note-card';
|
|
20
|
+
export { NoteCard } from './components/note-card';
|
|
21
|
+
export type { PopoverEdge, PopoverOrientation, PopoverPlacement, PopoverProps, PopoverSeparatorProps, PopoverTheme, } from './components/popover';
|
|
22
|
+
export { Popover, PopoverSeparator } from './components/popover';
|
|
23
|
+
export type { TextFieldProps } from './components/text-field';
|
|
24
|
+
export { TextField } from './components/text-field';
|
|
25
|
+
export type { ThemeAccent, ThemeAccentPreset, ThemeMode, ThemeProviderProps, } from './components/theme';
|
|
26
|
+
export { THEME_ACCENTS, ThemeProvider, isThemeAccentPreset } from './components/theme';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { t as e } from "./badge-BxBwSGqN.js";
|
|
2
|
+
import { t } from "./button-DRz0VTkf.js";
|
|
3
|
+
import { i as n, n as r, r as i, t as a } from "./confirm-3eBmopl8.js";
|
|
4
|
+
import { t as o } from "./dialog-B4xS5zlK.js";
|
|
5
|
+
import { t as s } from "./drawer-DoeuGAHD.js";
|
|
6
|
+
import { n as c, t as l } from "./icon-C40ONpMt.js";
|
|
7
|
+
import { t as u } from "./kbd-D9XXd3qf.js";
|
|
8
|
+
import { n as d, r as f, t as p } from "./loading-BpykjzMR.js";
|
|
9
|
+
import { a as m, i as h, n as g, r as _, t as v } from "./menu-B6uuZFif.js";
|
|
10
|
+
import { n as y, t as b } from "./popover-Qg_fA2A_.js";
|
|
11
|
+
import { t as x } from "./note-card-Dm-WbNTO.js";
|
|
12
|
+
import { t as S } from "./text-field-B8Scu04G.js";
|
|
13
|
+
import { n as C, r as w, t as T } from "./theme-C0p_hpKk.js";
|
|
14
|
+
export { e as Badge, t as Button, r as Confirm, i as ConfirmProvider, o as Dialog, s as Drawer, l as ICON_NAMES, c as Icon, u as Kbd, f as Loading, v as Menu, g as MenuItem, _ as MenuLabel, h as MenuSeparator, m as MenuSubmenu, x as NoteCard, b as Popover, y as PopoverSeparator, C as THEME_ACCENTS, S as TextField, T as ThemeProvider, a as confirm, a as confirmDialog, p as hideLoading, w as isThemeAccentPreset, d as showLoading, n as useConfirm };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/kbd/Kbd.tsx
|
|
4
|
+
function t(t) {
|
|
5
|
+
let n = /* @__PURE__ */ new Map(), r = [];
|
|
6
|
+
return t.forEach((t) => {
|
|
7
|
+
let i = (n.get(t) ?? 0) + 1;
|
|
8
|
+
if (n.set(t, i), r.length > 0) {
|
|
9
|
+
let t = r.length.toString();
|
|
10
|
+
r.push(/* @__PURE__ */ e("span", {
|
|
11
|
+
"aria-hidden": "true",
|
|
12
|
+
className: "hn-kbd__plus",
|
|
13
|
+
children: "+"
|
|
14
|
+
}, `plus-${t}`));
|
|
15
|
+
}
|
|
16
|
+
let a = i.toString();
|
|
17
|
+
r.push(/* @__PURE__ */ e("kbd", {
|
|
18
|
+
className: "hn-kbd__key",
|
|
19
|
+
children: t
|
|
20
|
+
}, `${t}-${a}`));
|
|
21
|
+
}), r;
|
|
22
|
+
}
|
|
23
|
+
function n({ children: n, className: r, keys: i, ...a }) {
|
|
24
|
+
let o = ["hn-kbd", r].filter(Boolean).join(" ");
|
|
25
|
+
return i !== void 0 && i.length > 0 ? /* @__PURE__ */ e("kbd", {
|
|
26
|
+
className: o,
|
|
27
|
+
...a,
|
|
28
|
+
children: t(i)
|
|
29
|
+
}) : /* @__PURE__ */ e("kbd", {
|
|
30
|
+
className: o,
|
|
31
|
+
...a,
|
|
32
|
+
children: /* @__PURE__ */ e("kbd", {
|
|
33
|
+
className: "hn-kbd__key",
|
|
34
|
+
children: n
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { n as t };
|
package/dist/kbd.d.ts
ADDED
package/dist/kbd.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
3
|
+
import { createElement as n } from "react";
|
|
4
|
+
import { createRoot as r } from "react-dom/client";
|
|
5
|
+
//#region src/components/loading/Loading.tsx
|
|
6
|
+
function i({ size: t }) {
|
|
7
|
+
let n = t === "small" ? 16 : t === "large" ? 28 : 20, r = t === "small" ? 2 : t === "large" ? 3 : 2.5, i = (n - r) / 2, a = 2 * Math.PI * i, o = a * .7, s = n.toString();
|
|
8
|
+
return /* @__PURE__ */ e("svg", {
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
className: "hn-loading__spinner",
|
|
11
|
+
fill: "none",
|
|
12
|
+
focusable: "false",
|
|
13
|
+
height: n,
|
|
14
|
+
viewBox: `0 0 ${s} ${s}`,
|
|
15
|
+
width: n,
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
+
children: /* @__PURE__ */ e("circle", {
|
|
18
|
+
cx: n / 2,
|
|
19
|
+
cy: n / 2,
|
|
20
|
+
r: i,
|
|
21
|
+
stroke: "currentColor",
|
|
22
|
+
strokeDasharray: `${o.toString()} ${a.toString()}`,
|
|
23
|
+
strokeDashoffset: (a * .25).toString(),
|
|
24
|
+
strokeLinecap: "round",
|
|
25
|
+
strokeWidth: r
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function a({ size: n = "medium", text: r, cover: a = !1, className: o, children: s, ...c }) {
|
|
30
|
+
let l = [
|
|
31
|
+
"hn-loading",
|
|
32
|
+
`hn-loading--${n}`,
|
|
33
|
+
a ? "hn-loading--cover" : null,
|
|
34
|
+
o
|
|
35
|
+
].filter(Boolean).join(" "), u = r ?? "加载中", d = r ?? s;
|
|
36
|
+
return /* @__PURE__ */ t("div", {
|
|
37
|
+
...c,
|
|
38
|
+
"aria-label": u,
|
|
39
|
+
className: l,
|
|
40
|
+
role: "status",
|
|
41
|
+
children: [/* @__PURE__ */ e(i, { size: n }), d === void 0 ? null : /* @__PURE__ */ e("span", {
|
|
42
|
+
className: "hn-loading__text",
|
|
43
|
+
children: d
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/components/loading/loading.ts
|
|
49
|
+
var o = null;
|
|
50
|
+
function s() {
|
|
51
|
+
if (typeof document > "u") return console.warn("[hamster-note/components] showLoading() 在非浏览器环境(无 document)下被调用,已 no-op。请在客户端副作用中调用。"), null;
|
|
52
|
+
if (o !== null) return o;
|
|
53
|
+
let e = document.createElement("div");
|
|
54
|
+
return document.body.appendChild(e), o = {
|
|
55
|
+
container: e,
|
|
56
|
+
root: r(e),
|
|
57
|
+
text: void 0,
|
|
58
|
+
size: void 0
|
|
59
|
+
}, o;
|
|
60
|
+
}
|
|
61
|
+
function c(e, t) {
|
|
62
|
+
let r = t?.text, i = t?.size ?? "medium";
|
|
63
|
+
e.text = r, e.size = i;
|
|
64
|
+
let o = r === void 0 ? { size: i } : {
|
|
65
|
+
size: i,
|
|
66
|
+
text: r
|
|
67
|
+
};
|
|
68
|
+
e.root.render(n("div", {
|
|
69
|
+
className: "hn-loading-overlay",
|
|
70
|
+
role: "status"
|
|
71
|
+
}, n(a, o)));
|
|
72
|
+
}
|
|
73
|
+
function l(e) {
|
|
74
|
+
e.root.unmount(), Promise.resolve().then(() => {
|
|
75
|
+
e.container.parentNode !== null && e.container.parentNode.removeChild(e.container);
|
|
76
|
+
}), o = null;
|
|
77
|
+
}
|
|
78
|
+
function u(e) {
|
|
79
|
+
let t = s();
|
|
80
|
+
return t === null ? () => {} : (c(t, e), () => {
|
|
81
|
+
o === t && l(t);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function d() {
|
|
85
|
+
o !== null && l(o);
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
export { u as n, a as r, d as t };
|
package/dist/loading.js
ADDED