@blenx-dev/core 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.
Files changed (172) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/LICENSE +21 -0
  3. package/package.json +49 -0
  4. package/src/DataTable/data-table-column-toggle.tsx +73 -0
  5. package/src/DataTable/data-table-empty.tsx +27 -0
  6. package/src/DataTable/data-table-error.tsx +25 -0
  7. package/src/DataTable/data-table-infinite-loader.tsx +73 -0
  8. package/src/DataTable/data-table-loading.tsx +67 -0
  9. package/src/DataTable/data-table-pagination.tsx +80 -0
  10. package/src/DataTable/data-table-toolbar.tsx +62 -0
  11. package/src/DataTable/data-table.css.ts +420 -0
  12. package/src/DataTable/data-table.tsx +507 -0
  13. package/src/DataTable/index.ts +24 -0
  14. package/src/DataTable/types.ts +169 -0
  15. package/src/DataTable/use-infinite-scroll.ts +67 -0
  16. package/src/components/Accordion/accordion.css.ts +84 -0
  17. package/src/components/Accordion/accordion.tsx +87 -0
  18. package/src/components/Accordion/index.ts +8 -0
  19. package/src/components/Alert/alert.css.ts +29 -0
  20. package/src/components/Alert/alert.tsx +40 -0
  21. package/src/components/Alert/index.ts +1 -0
  22. package/src/components/AlertDialog/alert-dialog.css.ts +62 -0
  23. package/src/components/AlertDialog/alert-dialog.tsx +199 -0
  24. package/src/components/AlertDialog/index.ts +1 -0
  25. package/src/components/AspectRatio/aspect-ratio.css.ts +7 -0
  26. package/src/components/AspectRatio/aspect-ratio.tsx +20 -0
  27. package/src/components/AspectRatio/index.ts +1 -0
  28. package/src/components/Autocomplete/autocomplete.css.ts +167 -0
  29. package/src/components/Autocomplete/autocomplete.tsx +226 -0
  30. package/src/components/Autocomplete/index.ts +1 -0
  31. package/src/components/Avatar/avatar.css.ts +65 -0
  32. package/src/components/Avatar/avatar.tsx +44 -0
  33. package/src/components/Avatar/index.ts +1 -0
  34. package/src/components/Badge/badge.css.ts +180 -0
  35. package/src/components/Badge/badge.tsx +47 -0
  36. package/src/components/Badge/index.ts +1 -0
  37. package/src/components/Box/box.css.ts +5 -0
  38. package/src/components/Box/box.tsx +21 -0
  39. package/src/components/Box/index.ts +1 -0
  40. package/src/components/Breadcrumbs/breadcrumbs.css.ts +72 -0
  41. package/src/components/Breadcrumbs/breadcrumbs.tsx +79 -0
  42. package/src/components/Breadcrumbs/index.ts +9 -0
  43. package/src/components/Button/button.css.ts +200 -0
  44. package/src/components/Button/button.tsx +55 -0
  45. package/src/components/Button/index.ts +1 -0
  46. package/src/components/Calendar/calendar.css.ts +187 -0
  47. package/src/components/Calendar/calendar.tsx +143 -0
  48. package/src/components/Calendar/index.ts +1 -0
  49. package/src/components/Card/card.tsx +32 -0
  50. package/src/components/Card/index.ts +1 -0
  51. package/src/components/Checkbox/checkbox.css.ts +76 -0
  52. package/src/components/Checkbox/checkbox.tsx +94 -0
  53. package/src/components/Checkbox/index.ts +1 -0
  54. package/src/components/CloseButton/close-button.css.ts +11 -0
  55. package/src/components/CloseButton/close-button.tsx +15 -0
  56. package/src/components/CloseButton/index.ts +2 -0
  57. package/src/components/ColorPicker/color-picker.tsx +123 -0
  58. package/src/components/ColorPicker/index.ts +1 -0
  59. package/src/components/ColorSwatch/color-swatch.tsx +21 -0
  60. package/src/components/ColorSwatch/index.ts +1 -0
  61. package/src/components/Combobox/combobox.css.ts +333 -0
  62. package/src/components/Combobox/combobox.tsx +350 -0
  63. package/src/components/Combobox/index.ts +1 -0
  64. package/src/components/Command/command.css.ts +130 -0
  65. package/src/components/Command/command.tsx +413 -0
  66. package/src/components/Command/index.ts +7 -0
  67. package/src/components/Container/container.css.ts +41 -0
  68. package/src/components/Container/container.tsx +25 -0
  69. package/src/components/Container/index.ts +1 -0
  70. package/src/components/CopyButton/copy-button.css.ts +11 -0
  71. package/src/components/CopyButton/copy-button.tsx +45 -0
  72. package/src/components/CopyButton/index.ts +2 -0
  73. package/src/components/DatePicker/date-picker.tsx +75 -0
  74. package/src/components/DatePicker/index.ts +1 -0
  75. package/src/components/Dialog/dialog.css.ts +57 -0
  76. package/src/components/Dialog/dialog.tsx +181 -0
  77. package/src/components/Dialog/index.ts +1 -0
  78. package/src/components/Drawer/drawer.css.ts +404 -0
  79. package/src/components/Drawer/drawer.tsx +573 -0
  80. package/src/components/Drawer/index.ts +1 -0
  81. package/src/components/Field/field.css.ts +35 -0
  82. package/src/components/Field/field.tsx +101 -0
  83. package/src/components/Field/index.ts +1 -0
  84. package/src/components/Grid/grid.css.ts +12 -0
  85. package/src/components/Grid/grid.tsx +32 -0
  86. package/src/components/Grid/index.ts +1 -0
  87. package/src/components/Icon/icon.css.ts +10 -0
  88. package/src/components/Icon/icon.tsx +15 -0
  89. package/src/components/Icon/index.ts +1 -0
  90. package/src/components/IconButton/icon-button.css.ts +6 -0
  91. package/src/components/IconButton/icon-button.tsx +11 -0
  92. package/src/components/IconButton/index.ts +2 -0
  93. package/src/components/Input/index.ts +1 -0
  94. package/src/components/Input/input.css.ts +72 -0
  95. package/src/components/Input/input.tsx +50 -0
  96. package/src/components/InputGroup/index.ts +1 -0
  97. package/src/components/InputGroup/input-group.css.ts +156 -0
  98. package/src/components/InputGroup/input-group.tsx +133 -0
  99. package/src/components/Menu/index.ts +1 -0
  100. package/src/components/Menu/menu.css.ts +121 -0
  101. package/src/components/Menu/menu.tsx +115 -0
  102. package/src/components/OTPField/index.ts +1 -0
  103. package/src/components/OTPField/otp-field.css.ts +54 -0
  104. package/src/components/OTPField/otp-field.tsx +46 -0
  105. package/src/components/Popover/index.ts +1 -0
  106. package/src/components/Popover/popover.css.ts +81 -0
  107. package/src/components/Popover/popover.tsx +113 -0
  108. package/src/components/Progress/index.ts +7 -0
  109. package/src/components/Progress/progress.css.ts +37 -0
  110. package/src/components/Progress/progress.tsx +62 -0
  111. package/src/components/Radio/index.ts +1 -0
  112. package/src/components/Radio/radio.css.ts +72 -0
  113. package/src/components/Radio/radio.tsx +49 -0
  114. package/src/components/ScrollArea/index.ts +1 -0
  115. package/src/components/ScrollArea/scroll-area.css.ts +79 -0
  116. package/src/components/ScrollArea/scroll-area.tsx +96 -0
  117. package/src/components/SegmentedControl/index.ts +1 -0
  118. package/src/components/SegmentedControl/segmented-control.tsx +42 -0
  119. package/src/components/Select/index.ts +1 -0
  120. package/src/components/Select/select.css.ts +182 -0
  121. package/src/components/Select/select.tsx +165 -0
  122. package/src/components/Separator/index.ts +1 -0
  123. package/src/components/Separator/separator.css.ts +59 -0
  124. package/src/components/Separator/separator.tsx +34 -0
  125. package/src/components/Sheet/index.ts +1 -0
  126. package/src/components/Sheet/sheet.css.ts +184 -0
  127. package/src/components/Sheet/sheet.tsx +215 -0
  128. package/src/components/Slider/index.ts +1 -0
  129. package/src/components/Slider/slider.css.ts +81 -0
  130. package/src/components/Slider/slider.tsx +100 -0
  131. package/src/components/Spinner/index.ts +1 -0
  132. package/src/components/Spinner/spinner.css.ts +17 -0
  133. package/src/components/Spinner/spinner.tsx +15 -0
  134. package/src/components/Splitter/index.ts +1 -0
  135. package/src/components/Splitter/splitter.css.ts +69 -0
  136. package/src/components/Splitter/splitter.tsx +521 -0
  137. package/src/components/Stack/index.ts +1 -0
  138. package/src/components/Stack/stack.css.ts +42 -0
  139. package/src/components/Stack/stack.tsx +32 -0
  140. package/src/components/Surface/index.ts +1 -0
  141. package/src/components/Surface/surface.css.ts +40 -0
  142. package/src/components/Surface/surface.tsx +19 -0
  143. package/src/components/Switch/index.ts +1 -0
  144. package/src/components/Switch/switch.css.ts +46 -0
  145. package/src/components/Switch/switch.tsx +25 -0
  146. package/src/components/Table/index.ts +2 -0
  147. package/src/components/Table/table.css.ts +71 -0
  148. package/src/components/Table/table.tsx +117 -0
  149. package/src/components/Tabs/index.ts +1 -0
  150. package/src/components/Tabs/tabs.css.ts +250 -0
  151. package/src/components/Tabs/tabs.tsx +119 -0
  152. package/src/components/Text/index.ts +2 -0
  153. package/src/components/Text/text.css.ts +118 -0
  154. package/src/components/Text/text.tsx +66 -0
  155. package/src/components/Textarea/index.ts +1 -0
  156. package/src/components/Textarea/textarea.css.ts +66 -0
  157. package/src/components/Textarea/textarea.tsx +48 -0
  158. package/src/components/Toggle/index.ts +1 -0
  159. package/src/components/Toggle/toggle.css.ts +91 -0
  160. package/src/components/Toggle/toggle.tsx +44 -0
  161. package/src/components/ToggleGroup/index.ts +1 -0
  162. package/src/components/ToggleGroup/toggle-group.css.ts +77 -0
  163. package/src/components/ToggleGroup/toggle-group.tsx +131 -0
  164. package/src/components/index.ts +54 -0
  165. package/src/index.ts +3 -0
  166. package/src/utils/drawer-styles.css.ts +85 -0
  167. package/src/utils/heights.ts +16 -0
  168. package/src/utils/sprinkles.css.ts +197 -0
  169. package/src/utils/sprinkles.tokens.ts +74 -0
  170. package/src/utils/types.ts +10 -0
  171. package/src/utils/ve-style.utils.ts +51 -0
  172. package/tsconfig.json +10 -0
@@ -0,0 +1,420 @@
1
+ import { style, keyframes } from "@vanilla-extract/css";
2
+ import { semanticVars, tokenVars } from "@blenx-dev/theme/contract";
3
+
4
+ const pulse = keyframes({
5
+ "0%, 100%": { opacity: 0.4 },
6
+ "50%": { opacity: 0.8 },
7
+ });
8
+
9
+ export const actionsCell = style({
10
+ display: "flex",
11
+ gap: 4,
12
+ });
13
+
14
+ export const checkbox = style({
15
+ cursor: "pointer",
16
+ });
17
+
18
+ export const fetchingBar = style({
19
+ display: "flex",
20
+ justifyContent: "center",
21
+ alignItems: "center",
22
+ padding: tokenVars.spacing.sm,
23
+ gap: tokenVars.spacing.sm,
24
+ });
25
+
26
+ export const fetchingText = style({
27
+ color: semanticVars.text.secondary,
28
+ fontSize: "13px",
29
+ });
30
+
31
+ export const tableContainer = style({
32
+ overflowX: "auto",
33
+ overflowY: "auto",
34
+ borderRadius: tokenVars.borderRadius.md,
35
+ borderWidth: 1,
36
+ borderStyle: "solid",
37
+ borderColor: semanticVars.border.default,
38
+ position: "relative",
39
+ });
40
+
41
+ export const table = style({
42
+ width: "100%",
43
+ borderCollapse: "collapse",
44
+ tableLayout: "auto",
45
+ });
46
+
47
+ export const theadStatic = style({});
48
+
49
+ export const theadSticky = style({
50
+ position: "sticky",
51
+ top: 0,
52
+ zIndex: 1,
53
+ });
54
+
55
+ export const theadStickyScrolled = style({
56
+ position: "sticky",
57
+ top: 0,
58
+ zIndex: 1,
59
+ boxShadow: tokenVars.shadow.sm,
60
+ });
61
+
62
+ export const headRow = style({
63
+ backgroundColor: semanticVars.background.subtle,
64
+ });
65
+
66
+ export const th = style({
67
+ paddingTop: 10,
68
+ paddingBottom: 10,
69
+ paddingLeft: 12,
70
+ paddingRight: 12,
71
+ fontSize: "12px",
72
+ fontWeight: tokenVars.fontWeight.semibold,
73
+ color: semanticVars.text.secondary,
74
+ textAlign: "left",
75
+ textTransform: "uppercase",
76
+ letterSpacing: "0.05em",
77
+ borderBottomWidth: 1,
78
+ borderBottomStyle: "solid",
79
+ borderBottomColor: semanticVars.border.default,
80
+ whiteSpace: "nowrap",
81
+ userSelect: "none",
82
+ });
83
+
84
+ export const thSm = style({
85
+ fontSize: "11px",
86
+ paddingTop: 6,
87
+ paddingBottom: 6,
88
+ paddingLeft: 8,
89
+ paddingRight: 8,
90
+ });
91
+
92
+ export const thLg = style({
93
+ fontSize: "13px",
94
+ paddingTop: 14,
95
+ paddingBottom: 14,
96
+ paddingLeft: 16,
97
+ paddingRight: 16,
98
+ });
99
+
100
+ export const thSortable = style({
101
+ cursor: "pointer",
102
+ });
103
+
104
+ export const thContent = style({
105
+ display: "flex",
106
+ alignItems: "center",
107
+ gap: 4,
108
+ });
109
+
110
+ export const td = style({
111
+ paddingTop: 10,
112
+ paddingBottom: 10,
113
+ paddingLeft: 12,
114
+ paddingRight: 12,
115
+ fontSize: tokenVars.fontSize.sm,
116
+ color: semanticVars.text.primary,
117
+ borderBottomWidth: 1,
118
+ borderBottomStyle: "solid",
119
+ borderBottomColor: semanticVars.border.subtle,
120
+ whiteSpace: "nowrap",
121
+ overflow: "hidden",
122
+ textOverflow: "ellipsis",
123
+ });
124
+
125
+ export const tdSm = style({
126
+ paddingTop: 6,
127
+ paddingBottom: 6,
128
+ paddingLeft: 8,
129
+ paddingRight: 8,
130
+ });
131
+
132
+ export const tdLg = style({
133
+ paddingTop: 14,
134
+ paddingBottom: 14,
135
+ paddingLeft: 16,
136
+ paddingRight: 16,
137
+ });
138
+
139
+ export const tr = style({
140
+ transition: "background-color 0.15s ease",
141
+ });
142
+
143
+ export const trSm = style({ height: 36 });
144
+
145
+ export const trLg = style({ height: 60 });
146
+
147
+ export const trSelected = style({
148
+ backgroundColor: semanticVars.background.subtle,
149
+ });
150
+
151
+ export const emptyTd = style({
152
+ padding: 0,
153
+ borderBottomWidth: 1,
154
+ borderBottomStyle: "solid",
155
+ borderBottomColor: semanticVars.border.default,
156
+ });
157
+
158
+ // ─── Loading skeleton ────────────────────────────────────────────────────────
159
+
160
+ export const loadingWrapper = style({
161
+ width: "100%",
162
+ });
163
+
164
+ export const loadingTable = style({
165
+ width: "100%",
166
+ borderCollapse: "collapse",
167
+ });
168
+
169
+ export const headerCell = style({
170
+ paddingTop: 12,
171
+ paddingBottom: 12,
172
+ paddingLeft: 16,
173
+ paddingRight: 16,
174
+ borderBottomColor: semanticVars.border.default,
175
+ borderBottomStyle: "solid",
176
+ borderBottomWidth: 1,
177
+ });
178
+
179
+ export const skeletonBar = style({
180
+ borderRadius: 4,
181
+ backgroundColor: semanticVars.surface.raised,
182
+ animationName: pulse,
183
+ animationDuration: "1.5s",
184
+ animationTimingFunction: "ease-in-out",
185
+ animationIterationCount: "infinite",
186
+ });
187
+
188
+ export const cell = style({
189
+ paddingTop: 12,
190
+ paddingBottom: 12,
191
+ paddingLeft: 16,
192
+ paddingRight: 16,
193
+ borderBottomColor: semanticVars.border.subtle,
194
+ borderBottomStyle: "solid",
195
+ borderBottomWidth: 1,
196
+ });
197
+
198
+ export const loadingFooter = style({
199
+ display: "flex",
200
+ justifyContent: "center",
201
+ alignItems: "center",
202
+ padding: 16,
203
+ gap: 8,
204
+ });
205
+
206
+ export const loadingText = style({
207
+ color: semanticVars.text.secondary,
208
+ fontSize: tokenVars.fontSize.sm,
209
+ });
210
+
211
+ // ─── Column toggle ───────────────────────────────────────────────────────────
212
+
213
+ export const itemLabel = style({
214
+ fontSize: 14,
215
+ });
216
+
217
+ export const deselectLabel = style({
218
+ color: semanticVars.text.secondary,
219
+ fontSize: 13,
220
+ });
221
+
222
+ export const checkboxChecked = style({
223
+ marginLeft: "auto",
224
+ width: 16,
225
+ height: 16,
226
+ borderRadius: 3,
227
+ borderWidth: 1.5,
228
+ borderStyle: "solid",
229
+ borderColor: semanticVars.interactive.primary,
230
+ display: "inline-flex",
231
+ alignItems: "center",
232
+ justifyContent: "center",
233
+ backgroundColor: semanticVars.interactive.primary,
234
+ });
235
+
236
+ export const checkboxUnchecked = style({
237
+ marginLeft: "auto",
238
+ width: 16,
239
+ height: 16,
240
+ borderRadius: 3,
241
+ borderWidth: 1.5,
242
+ borderStyle: "solid",
243
+ borderColor: semanticVars.border.default,
244
+ display: "inline-flex",
245
+ alignItems: "center",
246
+ justifyContent: "center",
247
+ backgroundColor: "transparent",
248
+ });
249
+
250
+ export const partial = style({
251
+ width: 8,
252
+ height: 2,
253
+ borderRadius: 1,
254
+ backgroundColor: semanticVars.text.secondary,
255
+ });
256
+
257
+ // ─── Empty state ─────────────────────────────────────────────────────────────
258
+
259
+ export const emptyContainer = style({
260
+ display: "flex",
261
+ flexDirection: "column",
262
+ alignItems: "center",
263
+ justifyContent: "center",
264
+ paddingTop: tokenVars.spacing.xxxl,
265
+ paddingBottom: tokenVars.spacing.xxxl,
266
+ paddingLeft: tokenVars.spacing.md,
267
+ paddingRight: tokenVars.spacing.md,
268
+ gap: 12,
269
+ });
270
+
271
+ export const iconWrap = style({
272
+ opacity: 0.5,
273
+ });
274
+
275
+ export const message = style({
276
+ color: semanticVars.text.secondary,
277
+ fontSize: tokenVars.fontSize.sm,
278
+ lineHeight: 1.5,
279
+ textAlign: "center",
280
+ margin: 0,
281
+ });
282
+
283
+ export const actionWrap = style({
284
+ marginTop: tokenVars.spacing.xs,
285
+ });
286
+
287
+ // ─── Error state ─────────────────────────────────────────────────────────────
288
+
289
+ export const errorContainer = style({
290
+ display: "flex",
291
+ flexDirection: "column",
292
+ alignItems: "center",
293
+ justifyContent: "center",
294
+ paddingTop: tokenVars.spacing.xxxl,
295
+ paddingBottom: tokenVars.spacing.xxxl,
296
+ paddingLeft: tokenVars.spacing.md,
297
+ paddingRight: tokenVars.spacing.md,
298
+ gap: 12,
299
+ });
300
+
301
+ export const errorMessage = style({
302
+ color: semanticVars.status.danger,
303
+ fontSize: tokenVars.fontSize.sm,
304
+ lineHeight: 1.5,
305
+ textAlign: "center",
306
+ margin: 0,
307
+ });
308
+
309
+ // ─── Infinite loader ─────────────────────────────────────────────────────────
310
+
311
+ export const sentinel = style({
312
+ display: "flex",
313
+ justifyContent: "center",
314
+ alignItems: "center",
315
+ padding: tokenVars.spacing.md,
316
+ minHeight: 48,
317
+ });
318
+
319
+ export const loadingInline = style({
320
+ display: "flex",
321
+ alignItems: "center",
322
+ gap: tokenVars.spacing.sm,
323
+ });
324
+
325
+ export const loaderLoadingText = style({
326
+ color: semanticVars.text.secondary,
327
+ fontSize: tokenVars.fontSize.sm,
328
+ });
329
+
330
+ export const noMore = style({
331
+ color: semanticVars.text.disabled,
332
+ fontSize: tokenVars.fontSize.sm,
333
+ });
334
+
335
+ export const center = style({
336
+ display: "flex",
337
+ justifyContent: "center",
338
+ alignItems: "center",
339
+ padding: tokenVars.spacing.md,
340
+ });
341
+
342
+ // ─── Pagination ──────────────────────────────────────────────────────────────
343
+
344
+ export const nav = style({
345
+ display: "flex",
346
+ alignItems: "center",
347
+ justifyContent: "space-between",
348
+ paddingTop: tokenVars.spacing.sm,
349
+ paddingBottom: tokenVars.spacing.sm,
350
+ });
351
+
352
+ export const info = style({
353
+ color: semanticVars.text.secondary,
354
+ fontSize: tokenVars.fontSize.sm,
355
+ });
356
+
357
+ export const controls = style({
358
+ display: "flex",
359
+ alignItems: "center",
360
+ gap: tokenVars.spacing.sm,
361
+ });
362
+
363
+ export const range = style({
364
+ color: semanticVars.text.secondary,
365
+ fontSize: tokenVars.fontSize.sm,
366
+ whiteSpace: "nowrap",
367
+ });
368
+
369
+ export const buttonGroup = style({
370
+ display: "flex",
371
+ alignItems: "center",
372
+ gap: tokenVars.spacing.xs,
373
+ });
374
+
375
+ export const pageWrap = style({
376
+ display: "flex",
377
+ alignItems: "center",
378
+ gap: 2,
379
+ });
380
+
381
+ export const ellipsis = style({
382
+ color: semanticVars.text.disabled,
383
+ fontSize: tokenVars.fontSize.sm,
384
+ paddingLeft: tokenVars.spacing.xs,
385
+ paddingRight: tokenVars.spacing.xs,
386
+ });
387
+
388
+ export const pageButton = style({
389
+ minWidth: 32,
390
+ height: 32,
391
+ });
392
+
393
+ // ─── Toolbar ─────────────────────────────────────────────────────────────────
394
+
395
+ export const toolbarContainer = style({
396
+ display: "flex",
397
+ alignItems: "center",
398
+ justifyContent: "space-between",
399
+ gap: tokenVars.spacing.md,
400
+ paddingTop: tokenVars.spacing.sm,
401
+ paddingBottom: tokenVars.spacing.sm,
402
+ });
403
+
404
+ export const leftGroup = style({
405
+ display: "flex",
406
+ alignItems: "center",
407
+ gap: tokenVars.spacing.sm,
408
+ flex: 1,
409
+ });
410
+
411
+ export const rightGroup = style({
412
+ display: "flex",
413
+ alignItems: "center",
414
+ gap: tokenVars.spacing.sm,
415
+ });
416
+
417
+ export const searchWrap = style({
418
+ flex: 1,
419
+ maxWidth: 320,
420
+ });