@ternarytech-io/gears-ui 0.0.0-stage → 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.
Files changed (98) hide show
  1. package/LICENSE +373 -0
  2. package/README.md +161 -3
  3. package/package.json +111 -6
  4. package/src/code-editor.ts +25 -0
  5. package/src/components/TAccentPicker.vue +41 -0
  6. package/src/components/TAdvancedSelect.vue +128 -0
  7. package/src/components/TAdvancedTable.vue +130 -0
  8. package/src/components/TAlert.vue +41 -0
  9. package/src/components/TAppLayout.vue +76 -0
  10. package/src/components/TAuthLayout.vue +32 -0
  11. package/src/components/TAvatar.vue +28 -0
  12. package/src/components/TBadge.vue +29 -0
  13. package/src/components/TButton.vue +60 -0
  14. package/src/components/TCard.vue +40 -0
  15. package/src/components/TCheckbox.vue +29 -0
  16. package/src/components/TCodeEditor.vue +128 -0
  17. package/src/components/TColorModeButton.vue +14 -0
  18. package/src/components/TColorPicker.vue +61 -0
  19. package/src/components/TCommandPalette.vue +109 -0
  20. package/src/components/TContainerPicker.vue +22 -0
  21. package/src/components/TCopyButton.vue +72 -0
  22. package/src/components/TDatePicker.vue +83 -0
  23. package/src/components/TDensityPicker.vue +19 -0
  24. package/src/components/TDropdown.vue +76 -0
  25. package/src/components/TDropzone.vue +76 -0
  26. package/src/components/TEmpty.vue +21 -0
  27. package/src/components/TFieldGroup.vue +11 -0
  28. package/src/components/TFileUpload.vue +92 -0
  29. package/src/components/TFontPicker.vue +23 -0
  30. package/src/components/TFormField.vue +40 -0
  31. package/src/components/TIcon.vue +12 -0
  32. package/src/components/TImageUpload.vue +131 -0
  33. package/src/components/TInput.vue +52 -0
  34. package/src/components/TInputMask.vue +70 -0
  35. package/src/components/TInputNumber.vue +62 -0
  36. package/src/components/TInputTags.vue +53 -0
  37. package/src/components/TLogView.vue +39 -0
  38. package/src/components/TModal.vue +54 -0
  39. package/src/components/TNav.vue +75 -0
  40. package/src/components/TNavPositionPicker.vue +22 -0
  41. package/src/components/TPage.vue +48 -0
  42. package/src/components/TPagination.vue +44 -0
  43. package/src/components/TPanelList.vue +29 -0
  44. package/src/components/TProgress.vue +18 -0
  45. package/src/components/TRadioGroup.vue +68 -0
  46. package/src/components/TRadiusPicker.vue +21 -0
  47. package/src/components/TRangeSlider.vue +63 -0
  48. package/src/components/TRichEditor.vue +82 -0
  49. package/src/components/TScaledFrame.vue +36 -0
  50. package/src/components/TSearchButton.vue +20 -0
  51. package/src/components/TSectionLayout.vue +37 -0
  52. package/src/components/TSelect.vue +60 -0
  53. package/src/components/TSelectMenu.vue +126 -0
  54. package/src/components/TSeparator.vue +10 -0
  55. package/src/components/TShell.vue +72 -0
  56. package/src/components/TSkeleton.vue +17 -0
  57. package/src/components/TSlideover.vue +47 -0
  58. package/src/components/TSortable.vue +61 -0
  59. package/src/components/TSortableTree.vue +73 -0
  60. package/src/components/TSortableTreeList.vue +60 -0
  61. package/src/components/TSpinner.vue +14 -0
  62. package/src/components/TSplitter.vue +85 -0
  63. package/src/components/TStatCard.vue +26 -0
  64. package/src/components/TSteps.vue +19 -0
  65. package/src/components/TSwitch.vue +18 -0
  66. package/src/components/TTable.vue +134 -0
  67. package/src/components/TTabs.vue +38 -0
  68. package/src/components/TTextarea.vue +42 -0
  69. package/src/components/TThemeBasePicker.vue +22 -0
  70. package/src/components/TThemeScope.vue +23 -0
  71. package/src/components/TToaster.vue +27 -0
  72. package/src/components/TTooltip.vue +33 -0
  73. package/src/components/TTopbar.vue +17 -0
  74. package/src/components/TVectorMap.vue +74 -0
  75. package/src/components/sortableTree.ts +19 -0
  76. package/src/composables/useColorMode.ts +41 -0
  77. package/src/composables/useCommandPalette.ts +11 -0
  78. package/src/composables/useField.ts +26 -0
  79. package/src/composables/useOverlay.ts +55 -0
  80. package/src/composables/useToast.ts +33 -0
  81. package/src/index.ts +215 -0
  82. package/src/monaco.ts +27 -0
  83. package/src/plugins/coloris.ts +8 -0
  84. package/src/plugins/datepicker.ts +7 -0
  85. package/src/plugins/dropzone.ts +5 -0
  86. package/src/plugins/index.ts +52 -0
  87. package/src/plugins/inputMask.ts +7 -0
  88. package/src/plugins/once.ts +8 -0
  89. package/src/plugins/richEditor.ts +37 -0
  90. package/src/plugins/slider.ts +4 -0
  91. package/src/plugins/sortable.ts +7 -0
  92. package/src/plugins/tomSelect.ts +4 -0
  93. package/src/shims.d.ts +17 -0
  94. package/src/styles/gears.css +625 -0
  95. package/src/styles/plugins.css +10 -0
  96. package/src/theme.ts +45 -0
  97. package/src/types.ts +177 -0
  98. package/src/vectorMap.ts +14 -0
@@ -0,0 +1,625 @@
1
+ /* Gears UI: Tabler (with its theme settings), the Tabler Icons webfont (self-hosted: a Gears server may have no internet),
2
+ and the Gears palette and the few classes Tabler doesn't have. Import it once in the app's entry. */
3
+ @import '@tabler/core/dist/css/tabler.min.css';
4
+ @import '@tabler/core/dist/css/tabler-themes.min.css';
5
+ @import '@tabler/icons-webfont/dist/tabler-icons.min.css';
6
+
7
+ /* The palette: primary #3673d1, darkest black #1c1d1d. Tabler builds its shades, subtle
8
+ backgrounds and focus rings from these, in both themes (light-dark() picks the side). */
9
+ :root {
10
+ --tblr-primary: #3673d1;
11
+ --tblr-primary-rgb: 54, 115, 209;
12
+ --tblr-link-color: light-dark(#3673d1, #5c90de);
13
+ --tblr-link-hover-color: light-dark(#2b5fae, #8bb2e9);
14
+ --tblr-font-sans-serif: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
15
+ --tblr-font-monospace: ui-monospace, 'Cascadia Code', Consolas, monospace;
16
+ --tblr-border-radius: 0.5rem;
17
+
18
+ /* Pages are a shade off white (darkest black in the dark theme); cards sit on them. */
19
+ --tblr-body-bg: light-dark(#f6f7f9, #1c1d1d);
20
+ --tblr-bg-surface: light-dark(#fff, #232525);
21
+ --tblr-bg-surface-secondary: light-dark(#f6f7f9, #1c1d1d);
22
+ --tblr-bg-surface-dark: #1c1d1d;
23
+ --tblr-border-color: light-dark(#e3e6eb, #2f3232);
24
+ }
25
+
26
+ /* The sidebar is dark in both themes, in the darkest black. */
27
+ .navbar-vertical[data-bs-theme=dark] {
28
+ --tblr-navbar-bg: #1c1d1d;
29
+ --tblr-bg-surface: #1c1d1d;
30
+ --tblr-navbar-border-color: #2f3232;
31
+ }
32
+
33
+ /* An extra-small button size, under Tabler's btn-sm. */
34
+ .btn-xs {
35
+ --tblr-btn-padding-y: 0.125rem;
36
+ --tblr-btn-padding-x: 0.375rem;
37
+ --tblr-btn-font-size: 0.75rem;
38
+ --tblr-btn-icon-size: 0.875rem;
39
+ --tblr-btn-line-height: 1.25rem;
40
+ }
41
+
42
+ /* Soft buttons: tinted, like Tabler's `-lt` backgrounds, with hover and active shades. */
43
+ .btn-soft {
44
+ --tblr-btn-color: var(--t-tint);
45
+ --tblr-btn-bg: color-mix(in oklab, var(--t-tint) 12%, transparent);
46
+ --tblr-btn-border-color: transparent;
47
+ --tblr-btn-hover-color: var(--t-tint);
48
+ --tblr-btn-hover-bg: color-mix(in oklab, var(--t-tint) 20%, transparent);
49
+ --tblr-btn-hover-border-color: transparent;
50
+ --tblr-btn-active-color: var(--t-tint);
51
+ --tblr-btn-active-bg: color-mix(in oklab, var(--t-tint) 28%, transparent);
52
+ --tblr-btn-active-border-color: transparent;
53
+ --tblr-btn-icon-color: var(--t-tint);
54
+ }
55
+ .btn-soft-primary { --t-tint: var(--tblr-primary); }
56
+ .btn-soft-secondary { --t-tint: var(--tblr-secondary); }
57
+ .btn-soft-success { --t-tint: var(--tblr-success); }
58
+ .btn-soft-warning { --t-tint: var(--tblr-warning); }
59
+ .btn-soft-danger { --t-tint: var(--tblr-danger); }
60
+ .btn-soft-info { --t-tint: var(--tblr-info); }
61
+
62
+ /* Icons from the webfont take the size of the text around them unless told otherwise. */
63
+ .ti.icon { line-height: 1; vertical-align: -0.125em; }
64
+ .ti-spin { animation: t-spin 1s linear infinite; }
65
+ @keyframes t-spin { to { transform: rotate(360deg); } }
66
+
67
+ /* The sidebar's fold toggle: a small circle on the sidebar's edge, in the sidebar's colors (its
68
+ background, its border, and its menu icons' color), so it suits a dark sidebar or a light one. */
69
+ .t-fold-toggle {
70
+ position: absolute;
71
+ top: 1.375rem;
72
+ inset-inline-end: -12px;
73
+ z-index: 1031;
74
+ place-items: center;
75
+ width: 24px;
76
+ height: 24px;
77
+ padding: 0;
78
+ color: color-mix(in oklab, var(--tblr-navbar-color, var(--tblr-body-color)) 70%, transparent);
79
+ background: var(--tblr-navbar-bg, var(--tblr-bg-surface));
80
+ border: 1px solid var(--tblr-navbar-border-color, var(--tblr-border-color));
81
+ border-radius: 50%;
82
+ cursor: pointer;
83
+ }
84
+ .t-fold-toggle:hover { color: var(--tblr-navbar-hover-color, var(--tblr-body-color)); border-color: color-mix(in oklab, var(--tblr-navbar-color, var(--tblr-body-color)) 45%, transparent); }
85
+ .t-fold-toggle:focus-visible { outline: 2px solid var(--tblr-primary); outline-offset: 2px; }
86
+ .t-fold-toggle .ti { font-size: 14px; width: 14px; height: 14px; line-height: 14px; vertical-align: 0; }
87
+
88
+ /* The top bar beside the sidebar keeps clear of the fold toggle on the sidebar's edge. */
89
+ @media (min-width: 992px) {
90
+ .t-topbar > .container-fluid { padding-inline-start: 1.75rem; }
91
+ }
92
+
93
+ /* A page that fills the height under the top bar and scrolls inside its own panels. */
94
+ .t-fill {
95
+ display: flex;
96
+ flex-direction: column;
97
+ min-height: 0;
98
+ flex: 1 1 auto;
99
+ }
100
+ /* The shell is at least the window's height; a filling page takes what the top bar leaves (its
101
+ basis is 0, so it never grows the page past the window) and scrolls inside. */
102
+ .t-shell { min-height: 100svh; }
103
+ .t-page-fill { flex: 1 1 0; overflow: hidden; }
104
+
105
+ /* A work section: a secondary panel on the left and a large work area. */
106
+ .t-section {
107
+ display: flex;
108
+ flex: 1 1 auto;
109
+ min-height: 0;
110
+ }
111
+ .t-section-panel {
112
+ display: flex;
113
+ flex-direction: column;
114
+ width: 16rem;
115
+ flex-shrink: 0;
116
+ background: var(--tblr-bg-surface);
117
+ border-inline-end: var(--tblr-border-width) solid var(--tblr-border-color);
118
+ }
119
+ .t-section-panel-header {
120
+ display: flex;
121
+ align-items: center;
122
+ justify-content: space-between;
123
+ gap: 0.25rem;
124
+ height: 3rem;
125
+ flex-shrink: 0;
126
+ padding-inline: 1rem 0.5rem;
127
+ border-bottom: var(--tblr-border-width) solid var(--tblr-border-color);
128
+ }
129
+ .t-section-work {
130
+ display: flex;
131
+ flex-direction: column;
132
+ flex: 1 1 auto;
133
+ gap: 0.75rem;
134
+ min-width: 0;
135
+ min-height: 0;
136
+ padding: 1rem;
137
+ }
138
+ @media (max-width: 767.98px) {
139
+ .t-section-panel { display: none; }
140
+ }
141
+
142
+ /* Log output: monospaced, on a slightly sunken surface. */
143
+ .t-log {
144
+ overflow: auto;
145
+ padding: 0.75rem;
146
+ margin: 0;
147
+ font-family: var(--tblr-font-monospace);
148
+ font-size: 0.75rem;
149
+ line-height: 1.25rem;
150
+ white-space: pre-wrap;
151
+ overflow-wrap: anywhere;
152
+ /* Tabler gives a pre light text, for its dark background; this one sits on the surface. */
153
+ color: var(--tblr-body-color);
154
+ background: var(--tblr-bg-surface-secondary);
155
+ border: var(--tblr-border-width) solid var(--tblr-border-color);
156
+ border-radius: var(--tblr-border-radius);
157
+ }
158
+ .t-log-line { display: flex; gap: 0.75rem; }
159
+ .t-log-time { flex-shrink: 0; color: var(--tblr-tertiary-color); user-select: none; }
160
+
161
+ /* A stat card's tinted icon square. */
162
+ .t-stat-icon {
163
+ display: grid;
164
+ place-items: center;
165
+ width: 2.5rem;
166
+ height: 2.5rem;
167
+ flex-shrink: 0;
168
+ border-radius: var(--tblr-border-radius);
169
+ font-size: 1.25rem;
170
+ }
171
+
172
+ /* A small segmented switch (Tabler has one size). */
173
+ .nav-segmented-sm {
174
+ --tblr-nav-height: 2rem;
175
+ --tblr-nav-link-padding-x: 0.625rem;
176
+ --tblr-nav-link-icon-size: 1rem;
177
+ font-size: 0.8125rem;
178
+ }
179
+
180
+ /* A dropdown joined to the controls before or after it in a TFieldGroup (a split Save button). */
181
+ .input-group > .dropdown:not(:first-child) .btn {
182
+ margin-inline-start: calc(-1 * var(--tblr-border-width));
183
+ border-start-start-radius: 0;
184
+ border-end-start-radius: 0;
185
+ }
186
+ .input-group > .dropdown:not(:last-child) .btn {
187
+ border-start-end-radius: 0;
188
+ border-end-end-radius: 0;
189
+ }
190
+
191
+ /*
192
+ * A sortable header's button. Tabler's inherits the cell's background color, but a cell shows its
193
+ * color through a box shadow, so in dark mode the button painted a box of a different shade.
194
+ */
195
+ .table-sort { background: transparent; }
196
+
197
+ /* TAdvancedTable: a heading with its filter icon at the right, and the filter opened under it. */
198
+ .t-table-heading { display: flex; align-items: center; gap: 0.25rem; }
199
+ /* The label takes the room, aligned as the column is (start, center or end). */
200
+ .t-table-heading-label { flex: 1 1 auto; min-width: 0; }
201
+ .t-table-heading .table-sort { width: auto; margin: 0; padding: 0; }
202
+ .t-table-heading .t-table-filter-toggle { flex-shrink: 0; margin-block: -0.25rem; }
203
+ .t-table-filter {
204
+ display: flex;
205
+ align-items: center;
206
+ gap: 0.25rem;
207
+ min-width: 15rem;
208
+ margin-top: 0.375rem;
209
+ font-weight: var(--tblr-font-weight-normal);
210
+ text-transform: none;
211
+ letter-spacing: normal;
212
+ }
213
+ .t-table-filter > select { flex: 0 0 7.5rem; }
214
+ .t-table-filter > div { flex: 1 1 auto; min-width: 5rem; }
215
+
216
+ /* A table whose header stays in view while it scrolls in its container. */
217
+ .t-table-sticky {
218
+ min-height: 0;
219
+ overflow: auto;
220
+ }
221
+ .t-table-sticky thead th {
222
+ position: sticky;
223
+ top: 0;
224
+ z-index: 1;
225
+ background-color: var(--tblr-bg-surface);
226
+ box-shadow: inset 0 -1px 0 var(--tblr-border-color);
227
+ }
228
+
229
+ /* Code editor (TCodeEditor): Monaco fills the box; the box has the input's border. */
230
+ .t-code-editor {
231
+ position: relative;
232
+ min-height: 10rem;
233
+ overflow: hidden;
234
+ border: var(--tblr-border-width) solid var(--tblr-border-color);
235
+ border-radius: var(--tblr-border-radius);
236
+ }
237
+ .t-code-editor-flush {
238
+ border: 0;
239
+ border-radius: 0;
240
+ }
241
+ .t-code-editor-host,
242
+ .t-code-editor-loading {
243
+ position: absolute;
244
+ inset: 0;
245
+ }
246
+ .t-code-editor-loading {
247
+ display: grid;
248
+ place-items: center;
249
+ background: var(--tblr-bg-surface);
250
+ }
251
+
252
+ /* Splitter (TSplitter): two flex-column panes and a handle with a grip. */
253
+ .t-splitter {
254
+ display: flex;
255
+ flex: 1 1 auto;
256
+ min-width: 0;
257
+ min-height: 0;
258
+ }
259
+ .t-splitter-vertical { flex-direction: column; }
260
+ .t-splitter-pane {
261
+ display: flex;
262
+ flex-direction: column;
263
+ flex: 0 0 auto;
264
+ min-width: 0;
265
+ min-height: 0;
266
+ overflow: hidden;
267
+ }
268
+ .t-splitter-pane-end { flex: 1 1 0; }
269
+ .t-splitter-handle {
270
+ display: flex;
271
+ flex-shrink: 0;
272
+ align-items: center;
273
+ justify-content: center;
274
+ outline: none;
275
+ touch-action: none;
276
+ }
277
+ .t-splitter-horizontal > .t-splitter-handle { width: 0.75rem; cursor: col-resize; }
278
+ .t-splitter-vertical > .t-splitter-handle { height: 0.75rem; cursor: row-resize; }
279
+ .t-splitter-grip {
280
+ border-radius: 1rem;
281
+ background: var(--tblr-border-color);
282
+ transition: background-color 0.15s;
283
+ }
284
+ .t-splitter-horizontal .t-splitter-grip { width: 0.25rem; height: 3rem; }
285
+ .t-splitter-vertical .t-splitter-grip { width: 3rem; height: 0.25rem; }
286
+ .t-splitter-handle:hover .t-splitter-grip,
287
+ .t-splitter-handle:focus-visible .t-splitter-grip,
288
+ .t-splitter-dragging .t-splitter-grip { background: var(--tblr-primary); }
289
+ .t-splitter-dragging { user-select: none; }
290
+
291
+ /* Select menu (TSelectMenu). */
292
+ .t-select-menu-panel { min-width: 14rem; max-width: 100vw; }
293
+ .t-select-menu-items { max-height: 16rem; overflow-y: auto; padding-block: 0.25rem; }
294
+ .t-select-menu-items .dropdown-item { display: flex; align-items: center; }
295
+
296
+ /* Tags input (TInputTags). */
297
+ .t-tags {
298
+ display: flex;
299
+ flex-wrap: wrap;
300
+ align-items: center;
301
+ gap: 0.25rem;
302
+ height: auto;
303
+ cursor: text;
304
+ }
305
+ .t-tags.disabled { background: var(--tblr-bg-surface-secondary); cursor: default; }
306
+ .t-tag { display: inline-flex; align-items: center; gap: 0.25rem; }
307
+ .t-tag .btn-close { width: 0.5rem; height: 0.5rem; padding: 0; background-size: 0.5rem; }
308
+ .t-tags-input {
309
+ flex: 1 1 4rem;
310
+ min-width: 4rem;
311
+ padding: 0;
312
+ color: inherit;
313
+ background: transparent;
314
+ border: 0;
315
+ outline: 0;
316
+ }
317
+
318
+ /* Panel list (TPanelList): compact items in a section's side panel. */
319
+ .t-panel-list { display: flex; flex-direction: column; gap: 2px; padding: 0.5rem; }
320
+ .t-panel-list-heading {
321
+ padding: 0.5rem 0.5rem 0.25rem;
322
+ font-size: 0.6875rem;
323
+ font-weight: var(--tblr-font-weight-semibold);
324
+ letter-spacing: 0.06em;
325
+ text-transform: uppercase;
326
+ color: var(--tblr-tertiary-color);
327
+ }
328
+ .t-panel-list-empty { margin: 0; padding: 0.25rem 0.5rem; font-size: 0.75rem; color: var(--tblr-secondary-color); }
329
+ .t-panel-list-item {
330
+ display: flex;
331
+ align-items: center;
332
+ gap: 0.5rem;
333
+ width: 100%;
334
+ padding: 0.375rem 0.5rem;
335
+ font-size: 0.875rem;
336
+ color: inherit;
337
+ text-align: start;
338
+ background: transparent;
339
+ border: 0;
340
+ border-radius: var(--tblr-border-radius);
341
+ }
342
+ .t-panel-list-item:hover { background: color-mix(in oklab, var(--tblr-body-color) 6%, transparent); }
343
+ .t-panel-list-item.active { color: var(--tblr-primary); background: color-mix(in oklab, var(--tblr-primary) 10%, transparent); }
344
+ .t-panel-list-item.invalid { color: var(--tblr-danger); }
345
+ .t-panel-list-icon { flex-shrink: 0; opacity: 0.7; }
346
+ .t-panel-list-trailing { flex-shrink: 0; font-size: 0.625rem; text-transform: uppercase; color: var(--tblr-secondary-color); }
347
+
348
+ /* Color picker (TColorPicker): the color beside the value. */
349
+ .t-color-swatch {
350
+ display: block;
351
+ width: 1.75rem;
352
+ height: 100%;
353
+ min-height: 1.5rem;
354
+ border-radius: calc(var(--tblr-border-radius) - 2px);
355
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
356
+ background-image: none;
357
+ }
358
+
359
+ /* Range slider (TRangeSlider): room for the handles, and above them for tooltips. */
360
+ .t-range-slider { margin: 0.75rem 0.5rem; }
361
+ .t-range-slider-tooltips { margin-top: 2.75rem; }
362
+
363
+ /* Sortable (TSortable): handles show they can be dragged. */
364
+ .t-sortable .sortable-handle { cursor: grab; touch-action: none; }
365
+ .t-sortable:not(.t-sortable-handles) > * { cursor: grab; }
366
+
367
+ /* The rich text editor (TRichEditor) keeps its corners with the inputs'. */
368
+ .t-rich-editor .tox-hugerte { border-radius: var(--tblr-border-radius); }
369
+
370
+ /* Copy button (TCopyButton): Tabler's clipboard plugin hides one label and shows the other. */
371
+ .t-copy-part { display: inline-flex; align-items: center; }
372
+ .t-copy-part[hidden] { display: none; }
373
+
374
+ /* Command palette (TCommandPalette): a search field, grouped results and key hints. */
375
+ .t-command { margin: calc(-1 * var(--tblr-modal-padding, 1.5rem)); }
376
+ .t-command .input-icon { border-bottom: var(--tblr-border-width) solid var(--tblr-border-color); }
377
+ .t-command .form-control:focus { box-shadow: none; }
378
+ .t-command-list { max-height: min(24rem, 60vh); overflow-y: auto; padding: 0.5rem; }
379
+ .t-command-group {
380
+ padding: 0.5rem 0.75rem 0.25rem;
381
+ font-size: 0.6875rem;
382
+ font-weight: var(--tblr-font-weight-semibold);
383
+ letter-spacing: 0.06em;
384
+ text-transform: uppercase;
385
+ color: var(--tblr-tertiary-color);
386
+ }
387
+ .t-command-item {
388
+ display: flex;
389
+ align-items: center;
390
+ gap: 0.625rem;
391
+ width: 100%;
392
+ padding: 0.5rem 0.75rem;
393
+ color: inherit;
394
+ text-align: start;
395
+ background: transparent;
396
+ border: 0;
397
+ border-radius: var(--tblr-border-radius);
398
+ }
399
+ .t-command-item.active { color: var(--tblr-primary); background: color-mix(in oklab, var(--tblr-primary) 10%, transparent); }
400
+ .t-command-footer {
401
+ display: flex;
402
+ gap: 1rem;
403
+ padding: 0.5rem 1rem;
404
+ font-size: 0.75rem;
405
+ color: var(--tblr-secondary-color);
406
+ border-top: var(--tblr-border-width) solid var(--tblr-border-color);
407
+ }
408
+
409
+ /* Search button (TSearchButton): looks like a search field. */
410
+ .t-search-button {
411
+ display: inline-flex;
412
+ align-items: center;
413
+ gap: 0.5rem;
414
+ width: 14rem;
415
+ height: 2.25rem;
416
+ padding: 0 0.5rem 0 0.75rem;
417
+ font-size: 0.875rem;
418
+ color: inherit;
419
+ background: var(--tblr-bg-forms, var(--tblr-bg-surface));
420
+ border: var(--tblr-border-width) solid var(--tblr-border-color);
421
+ border-radius: var(--tblr-border-radius);
422
+ }
423
+ .t-search-button:hover { border-color: color-mix(in oklab, var(--tblr-primary) 40%, var(--tblr-border-color)); }
424
+ .t-search-button kbd, .t-command-footer kbd {
425
+ padding: 0.0625rem 0.375rem;
426
+ font-size: 0.6875rem;
427
+ color: var(--tblr-secondary-color);
428
+ background: var(--tblr-bg-surface-secondary);
429
+ border: var(--tblr-border-width) solid var(--tblr-border-color);
430
+ box-shadow: none;
431
+ }
432
+
433
+ /* File upload (TFileUpload): a dashed area to drop files on or click. */
434
+ .t-file-upload-area {
435
+ display: flex;
436
+ flex-direction: column;
437
+ align-items: center;
438
+ gap: 0.25rem;
439
+ padding: 1.5rem 1rem;
440
+ text-align: center;
441
+ cursor: pointer;
442
+ background: var(--tblr-bg-surface);
443
+ border: 1px dashed var(--tblr-border-color);
444
+ border-radius: var(--tblr-border-radius);
445
+ transition: border-color 0.15s, background-color 0.15s;
446
+ }
447
+ .t-file-upload-area:hover,
448
+ .t-file-upload-area.over { border-color: var(--tblr-primary); background: color-mix(in oklab, var(--tblr-primary) 5%, var(--tblr-bg-surface)); }
449
+ .t-file-upload-area:focus-within { box-shadow: 0 0 0 0.25rem var(--tblr-focus-ring-color); }
450
+ .t-file-upload-area.is-invalid { border-color: var(--tblr-danger); }
451
+ .t-file-upload-area.disabled { cursor: default; opacity: 0.6; }
452
+
453
+ /* Toasts (TToaster): slide in from the side, and a colored edge for success and errors. */
454
+ .t-toast { min-width: 18rem; }
455
+ .t-toast-enter-active, .t-toast-leave-active { transition: opacity 0.2s, transform 0.2s; }
456
+ .t-toast-enter-from, .t-toast-leave-to { opacity: 0; transform: translateX(1rem); }
457
+
458
+ /* Tiles (TRadioGroup variant="tiles"): a picture of each choice, its label under it, and a radio
459
+ dot in the corner. The selected tile has a primary border. */
460
+ .t-radio-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--t-tile-width, 7rem), 1fr)); gap: 0.75rem; }
461
+ .t-radio-tile {
462
+ position: relative;
463
+ display: flex;
464
+ flex-direction: column;
465
+ gap: 0.375rem;
466
+ padding: 0.5rem;
467
+ cursor: pointer;
468
+ border: 1px solid var(--tblr-border-color);
469
+ border-radius: var(--tblr-border-radius);
470
+ transition: border-color 0.15s, background-color 0.15s;
471
+ }
472
+ .t-radio-tile:hover { border-color: color-mix(in oklab, var(--tblr-primary) 50%, var(--tblr-border-color)); }
473
+ .t-radio-tile.active { border-color: var(--tblr-primary); background: color-mix(in oklab, var(--tblr-primary) 6%, transparent); }
474
+ .t-radio-tile.disabled { cursor: default; opacity: 0.55; }
475
+ .t-radio-tile-input { position: absolute; opacity: 0; pointer-events: none; }
476
+ .t-radio-tile:has(.t-radio-tile-input:focus-visible) { box-shadow: 0 0 0 0.25rem var(--tblr-focus-ring-color); }
477
+ .t-radio-tile-check {
478
+ position: absolute;
479
+ top: 0.375rem;
480
+ left: 0.375rem;
481
+ z-index: 1;
482
+ width: 1rem;
483
+ height: 1rem;
484
+ border-radius: 50%;
485
+ background: var(--tblr-bg-surface);
486
+ border: 1px solid var(--tblr-border-color);
487
+ }
488
+ .t-radio-tile.active .t-radio-tile-check { background: var(--tblr-primary); border-color: var(--tblr-primary); box-shadow: inset 0 0 0 0.25rem var(--tblr-primary), inset 0 0 0 0.5rem var(--tblr-primary-fg, #fff); }
489
+ .t-radio-tile-preview {
490
+ display: flex;
491
+ align-items: center;
492
+ justify-content: center;
493
+ min-height: 4.5rem;
494
+ overflow: hidden;
495
+ color: var(--tblr-secondary-color);
496
+ background: var(--tblr-bg-surface-secondary);
497
+ border-radius: var(--tblr-border-radius-sm);
498
+ }
499
+ .t-radio-tile.active .t-radio-tile-preview { color: var(--tblr-body-color); }
500
+ .t-radio-tile-label { font-size: 0.8125rem; color: var(--tblr-secondary-color); }
501
+ .t-radio-tile.active .t-radio-tile-label { color: var(--tblr-body-color); font-weight: var(--tblr-font-weight-medium); }
502
+
503
+ /* Theme previews: what each theme choice looks like. */
504
+ .t-theme-font { font-size: 2rem; line-height: 1; }
505
+ .t-theme-radius { width: 2.25rem; height: 2.25rem; background: var(--tblr-primary); opacity: 0.85; }
506
+ .t-theme-swatches { display: flex; gap: 3px; }
507
+ .t-theme-swatches span { width: 0.75rem; height: 1rem; border-radius: 2px; box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--tblr-body-color) 15%, transparent); }
508
+ .t-accent-swatches { display: flex; flex-wrap: wrap; gap: 0.5rem; }
509
+ .t-accent-custom { position: relative; }
510
+ .t-accent-custom .form-colorinput-color { background: var(--tblr-bg-surface-secondary); border: 1px dashed var(--tblr-border-color); }
511
+ .t-accent-custom.active .form-colorinput-color { border: 0; box-shadow: 0 0 0 2px var(--tblr-bg-surface), 0 0 0 4px var(--tblr-primary); }
512
+ .t-accent-custom-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
513
+
514
+ /* A theme scope (TThemeScope): Tabler's theme settings for part of a page, such as a preview of an
515
+ application. Tabler works out radii, the primary's shades and (in the dark theme) the surfaces
516
+ once, at the root, and the Gears palette sets its own surfaces there; they're worked out again
517
+ here from the scope's base grays, as Tabler's defaults do, so they follow the scope's settings. */
518
+ .t-theme-scope {
519
+ --tblr-body-bg: light-dark(var(--tblr-gray-50), var(--tblr-gray-900));
520
+ --tblr-body-color: light-dark(var(--tblr-gray-700), var(--tblr-gray-200));
521
+ --tblr-secondary-color: color-mix(in oklab, var(--tblr-body-color) 75%, transparent);
522
+ --tblr-secondary: light-dark(var(--tblr-gray-500), var(--tblr-gray-400));
523
+ --tblr-muted: light-dark(var(--tblr-gray-500), var(--tblr-gray-400));
524
+ --tblr-bg-surface: light-dark(var(--tblr-white), var(--tblr-gray-800));
525
+ --tblr-bg-surface-secondary: light-dark(var(--tblr-gray-50), var(--tblr-gray-900));
526
+ --tblr-bg-surface-dark: var(--tblr-gray-900);
527
+ --tblr-bg-forms: light-dark(var(--tblr-bg-surface), var(--tblr-gray-900));
528
+ --tblr-border-color: light-dark(var(--tblr-gray-200), var(--tblr-gray-700));
529
+ --tblr-disabled-color: color-mix(in oklab, var(--tblr-body-color) 40%, transparent);
530
+ --tblr-border-radius-0: calc(0 * var(--tblr-border-radius-scale, 1));
531
+ --tblr-border-radius-xs: calc(2px * var(--tblr-border-radius-scale, 1));
532
+ --tblr-border-radius-sm: calc(4px * var(--tblr-border-radius-scale, 1));
533
+ --tblr-border-radius-md: calc(6px * var(--tblr-border-radius-scale, 1));
534
+ --tblr-border-radius-lg: calc(8px * var(--tblr-border-radius-scale, 1));
535
+ --tblr-border-radius-xl: calc(1rem * var(--tblr-border-radius-scale, 1));
536
+ --tblr-border-radius-xxl: calc(2rem * var(--tblr-border-radius-scale, 1));
537
+ --tblr-border-radius: var(--tblr-border-radius-md);
538
+ --tblr-primary-darken: oklch(from var(--tblr-primary) calc(l - 0.06) c h);
539
+ --tblr-primary-lt: color-mix(in oklab, var(--tblr-primary) 10%, transparent);
540
+ --tblr-control-checked-bg: var(--tblr-primary);
541
+ --tblr-link-color: light-dark(var(--tblr-primary), color-mix(in oklab, var(--tblr-white) 40%, var(--tblr-primary)));
542
+ --tblr-link-hover-color: light-dark(color-mix(in oklab, var(--tblr-black) 20%, var(--tblr-link-color)), color-mix(in oklab, var(--tblr-white) 20%, var(--tblr-link-color)));
543
+ font-family: var(--tblr-body-font-family);
544
+ color: var(--tblr-body-color);
545
+ background: var(--tblr-body-bg);
546
+ }
547
+
548
+ /* Image upload (TImageUpload): the image beside what the area takes. */
549
+ .t-image-upload-area { flex-direction: row; justify-content: flex-start; gap: 1rem; padding: 1rem; text-align: start; }
550
+ .t-image-upload-preview {
551
+ display: flex;
552
+ flex-shrink: 0;
553
+ align-items: center;
554
+ justify-content: center;
555
+ width: 4.5rem;
556
+ height: 4.5rem;
557
+ overflow: hidden;
558
+ background: var(--tblr-bg-surface-secondary);
559
+ border-radius: var(--tblr-border-radius);
560
+ }
561
+ .t-image-upload-preview img { width: 100%; height: 100%; object-fit: contain; }
562
+
563
+ /* Density (TThemeScope's theme.density, or data-t-density on any element): the padding inside
564
+ cards, tables, buttons and fields, and the page's gaps (--t-gap, for layouts to use).
565
+ Comfortable is Tabler's own spacing. */
566
+ [data-t-density] { --t-gap: 1rem; }
567
+ [data-t-density=compact] { --t-gap: 0.625rem; --tblr-page-padding-y: 0.75rem; }
568
+ [data-t-density=spacious] { --t-gap: 1.5rem; --tblr-page-padding-y: 2rem; }
569
+ [data-t-density=compact] .card { --tblr-card-spacer-y: 0.75rem; --tblr-card-spacer-x: 0.875rem; --tblr-card-cap-padding-y: 0.625rem; --tblr-card-cap-padding-x: 0.875rem; --tblr-card-title-spacer-y: 0.625rem; }
570
+ [data-t-density=spacious] .card { --tblr-card-spacer-y: 1.75rem; --tblr-card-spacer-x: 1.75rem; --tblr-card-cap-padding-y: 1.5rem; --tblr-card-cap-padding-x: 1.75rem; --tblr-card-title-spacer-y: 1.5rem; }
571
+ [data-t-density=compact] .table:not(.table-sm) > :not(caption) > * > * { padding: 0.375rem 0.625rem; }
572
+ [data-t-density=spacious] .table:not(.table-sm) > :not(caption) > * > * { padding: 1rem 1.25rem; }
573
+ [data-t-density=compact] .btn:not(.btn-sm, .btn-lg, .btn-xs, .btn-icon) { --tblr-btn-padding-y: 0.3125rem; --tblr-btn-padding-x: 0.75rem; }
574
+ [data-t-density=spacious] .btn:not(.btn-sm, .btn-lg, .btn-xs, .btn-icon) { --tblr-btn-padding-y: 0.75rem; --tblr-btn-padding-x: 1.375rem; }
575
+ [data-t-density=compact] :is(.form-control, .form-select):not(.form-control-sm, .form-select-sm, .form-control-lg, .form-select-lg) { --tblr-control-padding-y: 0.3125rem; --tblr-control-padding-x: 0.625rem; }
576
+ [data-t-density=spacious] :is(.form-control, .form-select):not(.form-control-sm, .form-select-sm, .form-control-lg, .form-select-lg) { --tblr-control-padding-y: 0.75rem; --tblr-control-padding-x: 1.125rem; }
577
+ [data-t-density=compact] .navbar-vertical .nav-link { padding-block: 0.3125rem; }
578
+ [data-t-density=spacious] .navbar-vertical .nav-link { padding-block: 0.75rem; }
579
+
580
+ /* Layout sketches (TNavPositionPicker, TContainerPicker, TDensityPicker): a page drawn in a tile. */
581
+ .t-sketch { display: flex; gap: 3px; width: 5.5rem; height: 3.5rem; padding: 3px; border-radius: 4px; }
582
+ .t-sketch-top { flex-direction: column; }
583
+ .t-sketch-nav { flex-shrink: 0; border-radius: 2px; background: color-mix(in oklab, var(--tblr-body-color) 35%, transparent); }
584
+ .t-sketch-left .t-sketch-nav { width: 0.875rem; }
585
+ .t-sketch-top .t-sketch-nav { height: 0.5rem; }
586
+ .t-sketch-page { display: flex; flex: 1; flex-direction: column; gap: 3px; padding: 3px; border-radius: 2px; background: var(--tblr-bg-surface); }
587
+ .t-sketch-page span { height: 0.375rem; border-radius: 1px; background: color-mix(in oklab, var(--tblr-body-color) 15%, transparent); }
588
+ .t-sketch-page span:first-child { width: 60%; background: var(--tblr-primary); opacity: 0.7; }
589
+ .t-sketch-boxed { padding: 3px 0.75rem; background: color-mix(in oklab, var(--tblr-body-color) 18%, transparent); }
590
+ .t-sketch-rows { display: flex; flex-direction: column; justify-content: center; width: 5.5rem; height: 3.5rem; }
591
+ .t-sketch-rows span { height: 0.3125rem; border-radius: 1px; background: color-mix(in oklab, var(--tblr-body-color) 25%, transparent); }
592
+ .t-sketch-compact { gap: 2px; }
593
+ .t-sketch-comfortable { gap: 5px; }
594
+ .t-sketch-spacious { gap: 9px; }
595
+ .t-sketch-rows span:first-child { background: var(--tblr-primary); opacity: 0.7; }
596
+
597
+ /* An application's frame (TAppLayout). The sidebar follows the theme (the Studio's is always
598
+ dark); a floating top bar sits apart from the page's edges, rounded, with a shadow. */
599
+ .t-app { min-height: 100%; display: flex; flex-direction: column; }
600
+ .t-app > .page { flex: 1; width: 100%; }
601
+ .t-app-logo { width: 2rem; height: 2rem; object-fit: contain; border-radius: var(--tblr-border-radius-sm); }
602
+ .t-app .navbar-brand { display: flex; align-items: center; gap: 0.5rem; min-width: 0; font-weight: var(--tblr-font-weight-bold); }
603
+ /* Tabler spreads a vertical navbar's brand across it; keep the name beside the logo. */
604
+ .t-app .t-app-sidebar.navbar-vertical .navbar-brand { justify-content: flex-start; }
605
+ .t-app-floating { margin: var(--t-gap, 1rem) var(--t-gap, 1rem) 0; border: var(--tblr-border-width) solid var(--tblr-border-color); border-radius: var(--tblr-border-radius-lg); box-shadow: var(--tblr-shadow-card, 0 4px 16px rgba(0, 0, 0, 0.08)); }
606
+ .t-app-floating.sticky-top { top: var(--t-gap, 1rem); }
607
+ .layout-boxed .t-app-floating { margin-inline: 0; }
608
+
609
+ /* A scaled frame (TScaledFrame): a whole screen, scaled down to fit. The screen is the containing
610
+ block for fixed parts, so a fixed sidebar stays in the frame. */
611
+ .t-scaled-frame { position: relative; height: 100%; min-height: 0; overflow: hidden; }
612
+ .t-scaled-screen { position: absolute; top: 0; left: 0; overflow: hidden; transform-origin: top left; }
613
+ .t-scaled-scroll { height: 100%; overflow: auto; }
614
+
615
+ /* A sortable tree (TSortableTree): children indented under their item. While something is dragged,
616
+ each empty child list opens to a dashed slot, to drop into. */
617
+ .t-tree-children { margin-inline-start: 1.75rem; }
618
+ .t-tree-dragging .t-tree-children.t-tree-empty {
619
+ min-height: 0.875rem;
620
+ margin-block: 2px;
621
+ border: 1px dashed color-mix(in oklab, var(--tblr-primary) 45%, var(--tblr-border-color));
622
+ border-radius: var(--tblr-border-radius-sm);
623
+ }
624
+ .t-tree .sortable-ghost { opacity: 0.4; }
625
+ .t-tree .sortable-chosen > :first-child { background: color-mix(in oklab, var(--tblr-primary) 6%, transparent); }
@@ -0,0 +1,10 @@
1
+ /* The plugin components' styles: each library's own CSS, then Tabler's restyling of them
2
+ (tabler-vendors), which has to come after. Import it once, after styles.css, in apps that use
3
+ TAdvancedSelect, TColorPicker, TDropzone or TRangeSlider. The other plugins are styled by
4
+ Tabler's main CSS (date picker, vector map, clipboard, sortable) or bring their own skin (the
5
+ rich text editor). */
6
+ @import 'tom-select/dist/css/tom-select.bootstrap5.min.css';
7
+ @import '@melloware/coloris/dist/coloris.css';
8
+ @import 'dropzone/dist/dropzone.css';
9
+ @import 'nouislider/dist/nouislider.min.css';
10
+ @import '@tabler/core/dist/css/tabler-vendors.min.css';
package/src/theme.ts ADDED
@@ -0,0 +1,45 @@
1
+ // The choices an application's theme offers, with their labels: Tabler's theme settings
2
+ // (tabler-themes.css) in the order its own theme settings list them, then layout.
3
+ import type { SelectItem, ThemeBase, ThemeContainer, ThemeDensity, ThemeFont, ThemeNav, ThemeRadius } from './types'
4
+
5
+ export const themeAccents = [
6
+ 'blue', 'azure', 'indigo', 'purple', 'pink', 'red', 'orange', 'yellow', 'lime', 'green', 'teal', 'cyan'
7
+ ] as const
8
+
9
+ export const themeFonts: SelectItem<ThemeFont>[] = [
10
+ { label: 'Sans-serif', value: 'sans-serif' },
11
+ { label: 'Serif', value: 'serif' },
12
+ { label: 'Monospace', value: 'monospace' },
13
+ { label: 'Comic', value: 'comic' }
14
+ ]
15
+
16
+ export const themeBases: SelectItem<ThemeBase>[] = [
17
+ { label: 'Slate', value: 'slate' },
18
+ { label: 'Gray', value: 'gray' },
19
+ { label: 'Zinc', value: 'zinc' },
20
+ { label: 'Neutral', value: 'neutral' },
21
+ { label: 'Stone', value: 'stone' },
22
+ { label: 'Mist', value: 'mist' }
23
+ ]
24
+
25
+ export const themeRadii: SelectItem<ThemeRadius>[] = ['0', '0.5', '1', '1.5', '2'].map(r => ({ label: r, value: r as ThemeRadius }))
26
+
27
+ // Layout choices (not Tabler theme settings; TThemeScope and TAppLayout apply them).
28
+ export const themeNavs: SelectItem<ThemeNav>[] = [
29
+ { label: 'Left', value: 'left' },
30
+ { label: 'Top', value: 'top' }
31
+ ]
32
+
33
+ export const themeDensities: SelectItem<ThemeDensity>[] = [
34
+ { label: 'Compact', value: 'compact' },
35
+ { label: 'Comfortable', value: 'comfortable' },
36
+ { label: 'Spacious', value: 'spacious' }
37
+ ]
38
+
39
+ export const themeContainers: SelectItem<ThemeContainer>[] = [
40
+ { label: 'Boxed', value: 'boxed' },
41
+ { label: 'Fluid', value: 'fluid' }
42
+ ]
43
+
44
+ /** Whether an accent is a custom color (#rrggbb) rather than one of Tabler's named colors. */
45
+ export const isCustomAccent = (accent: string | undefined) => !!accent && accent.startsWith('#')