@ternarytech-io/gears-ui 0.0.0-stage → 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.
- package/LICENSE +373 -0
- package/README.md +160 -2
- package/package.json +104 -6
- package/src/code-editor.ts +25 -0
- package/src/components/TAccentPicker.vue +41 -0
- package/src/components/TAdvancedSelect.vue +128 -0
- package/src/components/TAdvancedTable.vue +130 -0
- package/src/components/TAlert.vue +41 -0
- package/src/components/TAuthLayout.vue +32 -0
- package/src/components/TAvatar.vue +28 -0
- package/src/components/TBadge.vue +29 -0
- package/src/components/TButton.vue +60 -0
- package/src/components/TCard.vue +40 -0
- package/src/components/TCheckbox.vue +29 -0
- package/src/components/TCodeEditor.vue +128 -0
- package/src/components/TColorModeButton.vue +14 -0
- package/src/components/TColorPicker.vue +61 -0
- package/src/components/TCommandPalette.vue +109 -0
- package/src/components/TCopyButton.vue +72 -0
- package/src/components/TDatePicker.vue +83 -0
- package/src/components/TDropdown.vue +76 -0
- package/src/components/TDropzone.vue +76 -0
- package/src/components/TEmpty.vue +21 -0
- package/src/components/TFieldGroup.vue +11 -0
- package/src/components/TFileUpload.vue +92 -0
- package/src/components/TFontPicker.vue +23 -0
- package/src/components/TFormField.vue +40 -0
- package/src/components/TIcon.vue +12 -0
- package/src/components/TImageUpload.vue +131 -0
- package/src/components/TInput.vue +52 -0
- package/src/components/TInputMask.vue +70 -0
- package/src/components/TInputNumber.vue +62 -0
- package/src/components/TInputTags.vue +53 -0
- package/src/components/TLogView.vue +39 -0
- package/src/components/TModal.vue +54 -0
- package/src/components/TNav.vue +75 -0
- package/src/components/TPage.vue +48 -0
- package/src/components/TPagination.vue +44 -0
- package/src/components/TPanelList.vue +29 -0
- package/src/components/TProgress.vue +18 -0
- package/src/components/TRadioGroup.vue +68 -0
- package/src/components/TRadiusPicker.vue +21 -0
- package/src/components/TRangeSlider.vue +63 -0
- package/src/components/TRichEditor.vue +82 -0
- package/src/components/TSearchButton.vue +20 -0
- package/src/components/TSectionLayout.vue +37 -0
- package/src/components/TSelect.vue +60 -0
- package/src/components/TSelectMenu.vue +126 -0
- package/src/components/TSeparator.vue +10 -0
- package/src/components/TShell.vue +72 -0
- package/src/components/TSkeleton.vue +17 -0
- package/src/components/TSlideover.vue +47 -0
- package/src/components/TSortable.vue +61 -0
- package/src/components/TSpinner.vue +14 -0
- package/src/components/TSplitter.vue +85 -0
- package/src/components/TStatCard.vue +26 -0
- package/src/components/TSteps.vue +19 -0
- package/src/components/TSwitch.vue +18 -0
- package/src/components/TTable.vue +134 -0
- package/src/components/TTabs.vue +38 -0
- package/src/components/TTextarea.vue +42 -0
- package/src/components/TThemeBasePicker.vue +22 -0
- package/src/components/TThemeScope.vue +22 -0
- package/src/components/TToaster.vue +27 -0
- package/src/components/TTooltip.vue +33 -0
- package/src/components/TTopbar.vue +17 -0
- package/src/components/TVectorMap.vue +74 -0
- package/src/composables/useColorMode.ts +41 -0
- package/src/composables/useCommandPalette.ts +11 -0
- package/src/composables/useField.ts +26 -0
- package/src/composables/useOverlay.ts +55 -0
- package/src/composables/useToast.ts +33 -0
- package/src/index.ts +199 -0
- package/src/monaco.ts +27 -0
- package/src/plugins/coloris.ts +8 -0
- package/src/plugins/datepicker.ts +7 -0
- package/src/plugins/dropzone.ts +5 -0
- package/src/plugins/index.ts +49 -0
- package/src/plugins/inputMask.ts +7 -0
- package/src/plugins/once.ts +8 -0
- package/src/plugins/richEditor.ts +37 -0
- package/src/plugins/slider.ts +4 -0
- package/src/plugins/sortable.ts +7 -0
- package/src/plugins/tomSelect.ts +4 -0
- package/src/shims.d.ts +17 -0
- package/src/styles/gears.css +560 -0
- package/src/styles/plugins.css +10 -0
- package/src/theme.ts +28 -0
- package/src/types.ts +160 -0
- package/src/vectorMap.ts +14 -0
|
@@ -0,0 +1,560 @@
|
|
|
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 black circle with a light grey outline, on the sidebar's edge. */
|
|
68
|
+
.t-fold-toggle {
|
|
69
|
+
position: absolute;
|
|
70
|
+
top: 1.375rem;
|
|
71
|
+
inset-inline-end: -12px;
|
|
72
|
+
z-index: 1031;
|
|
73
|
+
place-items: center;
|
|
74
|
+
width: 24px;
|
|
75
|
+
height: 24px;
|
|
76
|
+
padding: 0;
|
|
77
|
+
color: #fff;
|
|
78
|
+
background: #1c1d1d;
|
|
79
|
+
border: 1px solid var(--tblr-navbar-border-color, #2f3232);
|
|
80
|
+
border-radius: 50%;
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
}
|
|
83
|
+
.t-fold-toggle:hover { border-color: #5d6470; }
|
|
84
|
+
.t-fold-toggle:focus-visible { outline: 2px solid var(--tblr-primary); outline-offset: 2px; }
|
|
85
|
+
.t-fold-toggle .ti { font-size: 14px; width: 14px; height: 14px; line-height: 14px; vertical-align: 0; }
|
|
86
|
+
|
|
87
|
+
/* The top bar beside the sidebar keeps clear of the fold toggle on the sidebar's edge. */
|
|
88
|
+
@media (min-width: 992px) {
|
|
89
|
+
.t-topbar > .container-fluid { padding-inline-start: 1.75rem; }
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* A page that fills the height under the top bar and scrolls inside its own panels. */
|
|
93
|
+
.t-fill {
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
min-height: 0;
|
|
97
|
+
flex: 1 1 auto;
|
|
98
|
+
}
|
|
99
|
+
/* The shell is at least the window's height; a filling page takes what the top bar leaves (its
|
|
100
|
+
basis is 0, so it never grows the page past the window) and scrolls inside. */
|
|
101
|
+
.t-shell { min-height: 100svh; }
|
|
102
|
+
.t-page-fill { flex: 1 1 0; overflow: hidden; }
|
|
103
|
+
|
|
104
|
+
/* A work section: a secondary panel on the left and a large work area. */
|
|
105
|
+
.t-section {
|
|
106
|
+
display: flex;
|
|
107
|
+
flex: 1 1 auto;
|
|
108
|
+
min-height: 0;
|
|
109
|
+
}
|
|
110
|
+
.t-section-panel {
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
width: 16rem;
|
|
114
|
+
flex-shrink: 0;
|
|
115
|
+
background: var(--tblr-bg-surface);
|
|
116
|
+
border-inline-end: var(--tblr-border-width) solid var(--tblr-border-color);
|
|
117
|
+
}
|
|
118
|
+
.t-section-panel-header {
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
justify-content: space-between;
|
|
122
|
+
gap: 0.25rem;
|
|
123
|
+
height: 3rem;
|
|
124
|
+
flex-shrink: 0;
|
|
125
|
+
padding-inline: 1rem 0.5rem;
|
|
126
|
+
border-bottom: var(--tblr-border-width) solid var(--tblr-border-color);
|
|
127
|
+
}
|
|
128
|
+
.t-section-work {
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-direction: column;
|
|
131
|
+
flex: 1 1 auto;
|
|
132
|
+
gap: 0.75rem;
|
|
133
|
+
min-width: 0;
|
|
134
|
+
min-height: 0;
|
|
135
|
+
padding: 1rem;
|
|
136
|
+
}
|
|
137
|
+
@media (max-width: 767.98px) {
|
|
138
|
+
.t-section-panel { display: none; }
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Log output: monospaced, on a slightly sunken surface. */
|
|
142
|
+
.t-log {
|
|
143
|
+
overflow: auto;
|
|
144
|
+
padding: 0.75rem;
|
|
145
|
+
margin: 0;
|
|
146
|
+
font-family: var(--tblr-font-monospace);
|
|
147
|
+
font-size: 0.75rem;
|
|
148
|
+
line-height: 1.25rem;
|
|
149
|
+
white-space: pre-wrap;
|
|
150
|
+
overflow-wrap: anywhere;
|
|
151
|
+
/* Tabler gives a pre light text, for its dark background; this one sits on the surface. */
|
|
152
|
+
color: var(--tblr-body-color);
|
|
153
|
+
background: var(--tblr-bg-surface-secondary);
|
|
154
|
+
border: var(--tblr-border-width) solid var(--tblr-border-color);
|
|
155
|
+
border-radius: var(--tblr-border-radius);
|
|
156
|
+
}
|
|
157
|
+
.t-log-line { display: flex; gap: 0.75rem; }
|
|
158
|
+
.t-log-time { flex-shrink: 0; color: var(--tblr-tertiary-color); user-select: none; }
|
|
159
|
+
|
|
160
|
+
/* A stat card's tinted icon square. */
|
|
161
|
+
.t-stat-icon {
|
|
162
|
+
display: grid;
|
|
163
|
+
place-items: center;
|
|
164
|
+
width: 2.5rem;
|
|
165
|
+
height: 2.5rem;
|
|
166
|
+
flex-shrink: 0;
|
|
167
|
+
border-radius: var(--tblr-border-radius);
|
|
168
|
+
font-size: 1.25rem;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* A small segmented switch (Tabler has one size). */
|
|
172
|
+
.nav-segmented-sm {
|
|
173
|
+
--tblr-nav-height: 2rem;
|
|
174
|
+
--tblr-nav-link-padding-x: 0.625rem;
|
|
175
|
+
--tblr-nav-link-icon-size: 1rem;
|
|
176
|
+
font-size: 0.8125rem;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* A dropdown joined to the controls before or after it in a TFieldGroup (a split Save button). */
|
|
180
|
+
.input-group > .dropdown:not(:first-child) .btn {
|
|
181
|
+
margin-inline-start: calc(-1 * var(--tblr-border-width));
|
|
182
|
+
border-start-start-radius: 0;
|
|
183
|
+
border-end-start-radius: 0;
|
|
184
|
+
}
|
|
185
|
+
.input-group > .dropdown:not(:last-child) .btn {
|
|
186
|
+
border-start-end-radius: 0;
|
|
187
|
+
border-end-end-radius: 0;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/*
|
|
191
|
+
* A sortable header's button. Tabler's inherits the cell's background color, but a cell shows its
|
|
192
|
+
* color through a box shadow, so in dark mode the button painted a box of a different shade.
|
|
193
|
+
*/
|
|
194
|
+
.table-sort { background: transparent; }
|
|
195
|
+
|
|
196
|
+
/* TAdvancedTable: a heading with its filter icon at the right, and the filter opened under it. */
|
|
197
|
+
.t-table-heading { display: flex; align-items: center; gap: 0.25rem; }
|
|
198
|
+
/* The label takes the room, aligned as the column is (start, center or end). */
|
|
199
|
+
.t-table-heading-label { flex: 1 1 auto; min-width: 0; }
|
|
200
|
+
.t-table-heading .table-sort { width: auto; margin: 0; padding: 0; }
|
|
201
|
+
.t-table-heading .t-table-filter-toggle { flex-shrink: 0; margin-block: -0.25rem; }
|
|
202
|
+
.t-table-filter {
|
|
203
|
+
display: flex;
|
|
204
|
+
align-items: center;
|
|
205
|
+
gap: 0.25rem;
|
|
206
|
+
min-width: 15rem;
|
|
207
|
+
margin-top: 0.375rem;
|
|
208
|
+
font-weight: var(--tblr-font-weight-normal);
|
|
209
|
+
text-transform: none;
|
|
210
|
+
letter-spacing: normal;
|
|
211
|
+
}
|
|
212
|
+
.t-table-filter > select { flex: 0 0 7.5rem; }
|
|
213
|
+
.t-table-filter > div { flex: 1 1 auto; min-width: 5rem; }
|
|
214
|
+
|
|
215
|
+
/* A table whose header stays in view while it scrolls in its container. */
|
|
216
|
+
.t-table-sticky {
|
|
217
|
+
min-height: 0;
|
|
218
|
+
overflow: auto;
|
|
219
|
+
}
|
|
220
|
+
.t-table-sticky thead th {
|
|
221
|
+
position: sticky;
|
|
222
|
+
top: 0;
|
|
223
|
+
z-index: 1;
|
|
224
|
+
background-color: var(--tblr-bg-surface);
|
|
225
|
+
box-shadow: inset 0 -1px 0 var(--tblr-border-color);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* Code editor (TCodeEditor): Monaco fills the box; the box has the input's border. */
|
|
229
|
+
.t-code-editor {
|
|
230
|
+
position: relative;
|
|
231
|
+
min-height: 10rem;
|
|
232
|
+
overflow: hidden;
|
|
233
|
+
border: var(--tblr-border-width) solid var(--tblr-border-color);
|
|
234
|
+
border-radius: var(--tblr-border-radius);
|
|
235
|
+
}
|
|
236
|
+
.t-code-editor-flush {
|
|
237
|
+
border: 0;
|
|
238
|
+
border-radius: 0;
|
|
239
|
+
}
|
|
240
|
+
.t-code-editor-host,
|
|
241
|
+
.t-code-editor-loading {
|
|
242
|
+
position: absolute;
|
|
243
|
+
inset: 0;
|
|
244
|
+
}
|
|
245
|
+
.t-code-editor-loading {
|
|
246
|
+
display: grid;
|
|
247
|
+
place-items: center;
|
|
248
|
+
background: var(--tblr-bg-surface);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/* Splitter (TSplitter): two flex-column panes and a handle with a grip. */
|
|
252
|
+
.t-splitter {
|
|
253
|
+
display: flex;
|
|
254
|
+
flex: 1 1 auto;
|
|
255
|
+
min-width: 0;
|
|
256
|
+
min-height: 0;
|
|
257
|
+
}
|
|
258
|
+
.t-splitter-vertical { flex-direction: column; }
|
|
259
|
+
.t-splitter-pane {
|
|
260
|
+
display: flex;
|
|
261
|
+
flex-direction: column;
|
|
262
|
+
flex: 0 0 auto;
|
|
263
|
+
min-width: 0;
|
|
264
|
+
min-height: 0;
|
|
265
|
+
overflow: hidden;
|
|
266
|
+
}
|
|
267
|
+
.t-splitter-pane-end { flex: 1 1 0; }
|
|
268
|
+
.t-splitter-handle {
|
|
269
|
+
display: flex;
|
|
270
|
+
flex-shrink: 0;
|
|
271
|
+
align-items: center;
|
|
272
|
+
justify-content: center;
|
|
273
|
+
outline: none;
|
|
274
|
+
touch-action: none;
|
|
275
|
+
}
|
|
276
|
+
.t-splitter-horizontal > .t-splitter-handle { width: 0.75rem; cursor: col-resize; }
|
|
277
|
+
.t-splitter-vertical > .t-splitter-handle { height: 0.75rem; cursor: row-resize; }
|
|
278
|
+
.t-splitter-grip {
|
|
279
|
+
border-radius: 1rem;
|
|
280
|
+
background: var(--tblr-border-color);
|
|
281
|
+
transition: background-color 0.15s;
|
|
282
|
+
}
|
|
283
|
+
.t-splitter-horizontal .t-splitter-grip { width: 0.25rem; height: 3rem; }
|
|
284
|
+
.t-splitter-vertical .t-splitter-grip { width: 3rem; height: 0.25rem; }
|
|
285
|
+
.t-splitter-handle:hover .t-splitter-grip,
|
|
286
|
+
.t-splitter-handle:focus-visible .t-splitter-grip,
|
|
287
|
+
.t-splitter-dragging .t-splitter-grip { background: var(--tblr-primary); }
|
|
288
|
+
.t-splitter-dragging { user-select: none; }
|
|
289
|
+
|
|
290
|
+
/* Select menu (TSelectMenu). */
|
|
291
|
+
.t-select-menu-panel { min-width: 14rem; max-width: 100vw; }
|
|
292
|
+
.t-select-menu-items { max-height: 16rem; overflow-y: auto; padding-block: 0.25rem; }
|
|
293
|
+
.t-select-menu-items .dropdown-item { display: flex; align-items: center; }
|
|
294
|
+
|
|
295
|
+
/* Tags input (TInputTags). */
|
|
296
|
+
.t-tags {
|
|
297
|
+
display: flex;
|
|
298
|
+
flex-wrap: wrap;
|
|
299
|
+
align-items: center;
|
|
300
|
+
gap: 0.25rem;
|
|
301
|
+
height: auto;
|
|
302
|
+
cursor: text;
|
|
303
|
+
}
|
|
304
|
+
.t-tags.disabled { background: var(--tblr-bg-surface-secondary); cursor: default; }
|
|
305
|
+
.t-tag { display: inline-flex; align-items: center; gap: 0.25rem; }
|
|
306
|
+
.t-tag .btn-close { width: 0.5rem; height: 0.5rem; padding: 0; background-size: 0.5rem; }
|
|
307
|
+
.t-tags-input {
|
|
308
|
+
flex: 1 1 4rem;
|
|
309
|
+
min-width: 4rem;
|
|
310
|
+
padding: 0;
|
|
311
|
+
color: inherit;
|
|
312
|
+
background: transparent;
|
|
313
|
+
border: 0;
|
|
314
|
+
outline: 0;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/* Panel list (TPanelList): compact items in a section's side panel. */
|
|
318
|
+
.t-panel-list { display: flex; flex-direction: column; gap: 2px; padding: 0.5rem; }
|
|
319
|
+
.t-panel-list-heading {
|
|
320
|
+
padding: 0.5rem 0.5rem 0.25rem;
|
|
321
|
+
font-size: 0.6875rem;
|
|
322
|
+
font-weight: var(--tblr-font-weight-semibold);
|
|
323
|
+
letter-spacing: 0.06em;
|
|
324
|
+
text-transform: uppercase;
|
|
325
|
+
color: var(--tblr-tertiary-color);
|
|
326
|
+
}
|
|
327
|
+
.t-panel-list-empty { margin: 0; padding: 0.25rem 0.5rem; font-size: 0.75rem; color: var(--tblr-secondary-color); }
|
|
328
|
+
.t-panel-list-item {
|
|
329
|
+
display: flex;
|
|
330
|
+
align-items: center;
|
|
331
|
+
gap: 0.5rem;
|
|
332
|
+
width: 100%;
|
|
333
|
+
padding: 0.375rem 0.5rem;
|
|
334
|
+
font-size: 0.875rem;
|
|
335
|
+
color: inherit;
|
|
336
|
+
text-align: start;
|
|
337
|
+
background: transparent;
|
|
338
|
+
border: 0;
|
|
339
|
+
border-radius: var(--tblr-border-radius);
|
|
340
|
+
}
|
|
341
|
+
.t-panel-list-item:hover { background: color-mix(in oklab, var(--tblr-body-color) 6%, transparent); }
|
|
342
|
+
.t-panel-list-item.active { color: var(--tblr-primary); background: color-mix(in oklab, var(--tblr-primary) 10%, transparent); }
|
|
343
|
+
.t-panel-list-item.invalid { color: var(--tblr-danger); }
|
|
344
|
+
.t-panel-list-icon { flex-shrink: 0; opacity: 0.7; }
|
|
345
|
+
.t-panel-list-trailing { flex-shrink: 0; font-size: 0.625rem; text-transform: uppercase; color: var(--tblr-secondary-color); }
|
|
346
|
+
|
|
347
|
+
/* Color picker (TColorPicker): the color beside the value. */
|
|
348
|
+
.t-color-swatch {
|
|
349
|
+
display: block;
|
|
350
|
+
width: 1.75rem;
|
|
351
|
+
height: 100%;
|
|
352
|
+
min-height: 1.5rem;
|
|
353
|
+
border-radius: calc(var(--tblr-border-radius) - 2px);
|
|
354
|
+
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
355
|
+
background-image: none;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/* Range slider (TRangeSlider): room for the handles, and above them for tooltips. */
|
|
359
|
+
.t-range-slider { margin: 0.75rem 0.5rem; }
|
|
360
|
+
.t-range-slider-tooltips { margin-top: 2.75rem; }
|
|
361
|
+
|
|
362
|
+
/* Sortable (TSortable): handles show they can be dragged. */
|
|
363
|
+
.t-sortable .sortable-handle { cursor: grab; touch-action: none; }
|
|
364
|
+
.t-sortable:not(.t-sortable-handles) > * { cursor: grab; }
|
|
365
|
+
|
|
366
|
+
/* The rich text editor (TRichEditor) keeps its corners with the inputs'. */
|
|
367
|
+
.t-rich-editor .tox-hugerte { border-radius: var(--tblr-border-radius); }
|
|
368
|
+
|
|
369
|
+
/* Copy button (TCopyButton): Tabler's clipboard plugin hides one label and shows the other. */
|
|
370
|
+
.t-copy-part { display: inline-flex; align-items: center; }
|
|
371
|
+
.t-copy-part[hidden] { display: none; }
|
|
372
|
+
|
|
373
|
+
/* Command palette (TCommandPalette): a search field, grouped results and key hints. */
|
|
374
|
+
.t-command { margin: calc(-1 * var(--tblr-modal-padding, 1.5rem)); }
|
|
375
|
+
.t-command .input-icon { border-bottom: var(--tblr-border-width) solid var(--tblr-border-color); }
|
|
376
|
+
.t-command .form-control:focus { box-shadow: none; }
|
|
377
|
+
.t-command-list { max-height: min(24rem, 60vh); overflow-y: auto; padding: 0.5rem; }
|
|
378
|
+
.t-command-group {
|
|
379
|
+
padding: 0.5rem 0.75rem 0.25rem;
|
|
380
|
+
font-size: 0.6875rem;
|
|
381
|
+
font-weight: var(--tblr-font-weight-semibold);
|
|
382
|
+
letter-spacing: 0.06em;
|
|
383
|
+
text-transform: uppercase;
|
|
384
|
+
color: var(--tblr-tertiary-color);
|
|
385
|
+
}
|
|
386
|
+
.t-command-item {
|
|
387
|
+
display: flex;
|
|
388
|
+
align-items: center;
|
|
389
|
+
gap: 0.625rem;
|
|
390
|
+
width: 100%;
|
|
391
|
+
padding: 0.5rem 0.75rem;
|
|
392
|
+
color: inherit;
|
|
393
|
+
text-align: start;
|
|
394
|
+
background: transparent;
|
|
395
|
+
border: 0;
|
|
396
|
+
border-radius: var(--tblr-border-radius);
|
|
397
|
+
}
|
|
398
|
+
.t-command-item.active { color: var(--tblr-primary); background: color-mix(in oklab, var(--tblr-primary) 10%, transparent); }
|
|
399
|
+
.t-command-footer {
|
|
400
|
+
display: flex;
|
|
401
|
+
gap: 1rem;
|
|
402
|
+
padding: 0.5rem 1rem;
|
|
403
|
+
font-size: 0.75rem;
|
|
404
|
+
color: var(--tblr-secondary-color);
|
|
405
|
+
border-top: var(--tblr-border-width) solid var(--tblr-border-color);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/* Search button (TSearchButton): looks like a search field. */
|
|
409
|
+
.t-search-button {
|
|
410
|
+
display: inline-flex;
|
|
411
|
+
align-items: center;
|
|
412
|
+
gap: 0.5rem;
|
|
413
|
+
width: 14rem;
|
|
414
|
+
height: 2.25rem;
|
|
415
|
+
padding: 0 0.5rem 0 0.75rem;
|
|
416
|
+
font-size: 0.875rem;
|
|
417
|
+
color: inherit;
|
|
418
|
+
background: var(--tblr-bg-forms, var(--tblr-bg-surface));
|
|
419
|
+
border: var(--tblr-border-width) solid var(--tblr-border-color);
|
|
420
|
+
border-radius: var(--tblr-border-radius);
|
|
421
|
+
}
|
|
422
|
+
.t-search-button:hover { border-color: color-mix(in oklab, var(--tblr-primary) 40%, var(--tblr-border-color)); }
|
|
423
|
+
.t-search-button kbd, .t-command-footer kbd {
|
|
424
|
+
padding: 0.0625rem 0.375rem;
|
|
425
|
+
font-size: 0.6875rem;
|
|
426
|
+
color: var(--tblr-secondary-color);
|
|
427
|
+
background: var(--tblr-bg-surface-secondary);
|
|
428
|
+
border: var(--tblr-border-width) solid var(--tblr-border-color);
|
|
429
|
+
box-shadow: none;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/* File upload (TFileUpload): a dashed area to drop files on or click. */
|
|
433
|
+
.t-file-upload-area {
|
|
434
|
+
display: flex;
|
|
435
|
+
flex-direction: column;
|
|
436
|
+
align-items: center;
|
|
437
|
+
gap: 0.25rem;
|
|
438
|
+
padding: 1.5rem 1rem;
|
|
439
|
+
text-align: center;
|
|
440
|
+
cursor: pointer;
|
|
441
|
+
background: var(--tblr-bg-surface);
|
|
442
|
+
border: 1px dashed var(--tblr-border-color);
|
|
443
|
+
border-radius: var(--tblr-border-radius);
|
|
444
|
+
transition: border-color 0.15s, background-color 0.15s;
|
|
445
|
+
}
|
|
446
|
+
.t-file-upload-area:hover,
|
|
447
|
+
.t-file-upload-area.over { border-color: var(--tblr-primary); background: color-mix(in oklab, var(--tblr-primary) 5%, var(--tblr-bg-surface)); }
|
|
448
|
+
.t-file-upload-area:focus-within { box-shadow: 0 0 0 0.25rem var(--tblr-focus-ring-color); }
|
|
449
|
+
.t-file-upload-area.is-invalid { border-color: var(--tblr-danger); }
|
|
450
|
+
.t-file-upload-area.disabled { cursor: default; opacity: 0.6; }
|
|
451
|
+
|
|
452
|
+
/* Toasts (TToaster): slide in from the side, and a colored edge for success and errors. */
|
|
453
|
+
.t-toast { min-width: 18rem; }
|
|
454
|
+
.t-toast-enter-active, .t-toast-leave-active { transition: opacity 0.2s, transform 0.2s; }
|
|
455
|
+
.t-toast-enter-from, .t-toast-leave-to { opacity: 0; transform: translateX(1rem); }
|
|
456
|
+
|
|
457
|
+
/* Tiles (TRadioGroup variant="tiles"): a picture of each choice, its label under it, and a radio
|
|
458
|
+
dot in the corner. The selected tile has a primary border. */
|
|
459
|
+
.t-radio-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--t-tile-width, 7rem), 1fr)); gap: 0.75rem; }
|
|
460
|
+
.t-radio-tile {
|
|
461
|
+
position: relative;
|
|
462
|
+
display: flex;
|
|
463
|
+
flex-direction: column;
|
|
464
|
+
gap: 0.375rem;
|
|
465
|
+
padding: 0.5rem;
|
|
466
|
+
cursor: pointer;
|
|
467
|
+
border: 1px solid var(--tblr-border-color);
|
|
468
|
+
border-radius: var(--tblr-border-radius);
|
|
469
|
+
transition: border-color 0.15s, background-color 0.15s;
|
|
470
|
+
}
|
|
471
|
+
.t-radio-tile:hover { border-color: color-mix(in oklab, var(--tblr-primary) 50%, var(--tblr-border-color)); }
|
|
472
|
+
.t-radio-tile.active { border-color: var(--tblr-primary); background: color-mix(in oklab, var(--tblr-primary) 6%, transparent); }
|
|
473
|
+
.t-radio-tile.disabled { cursor: default; opacity: 0.55; }
|
|
474
|
+
.t-radio-tile-input { position: absolute; opacity: 0; pointer-events: none; }
|
|
475
|
+
.t-radio-tile:has(.t-radio-tile-input:focus-visible) { box-shadow: 0 0 0 0.25rem var(--tblr-focus-ring-color); }
|
|
476
|
+
.t-radio-tile-check {
|
|
477
|
+
position: absolute;
|
|
478
|
+
top: 0.375rem;
|
|
479
|
+
left: 0.375rem;
|
|
480
|
+
z-index: 1;
|
|
481
|
+
width: 1rem;
|
|
482
|
+
height: 1rem;
|
|
483
|
+
border-radius: 50%;
|
|
484
|
+
background: var(--tblr-bg-surface);
|
|
485
|
+
border: 1px solid var(--tblr-border-color);
|
|
486
|
+
}
|
|
487
|
+
.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); }
|
|
488
|
+
.t-radio-tile-preview {
|
|
489
|
+
display: flex;
|
|
490
|
+
align-items: center;
|
|
491
|
+
justify-content: center;
|
|
492
|
+
min-height: 4.5rem;
|
|
493
|
+
overflow: hidden;
|
|
494
|
+
color: var(--tblr-secondary-color);
|
|
495
|
+
background: var(--tblr-bg-surface-secondary);
|
|
496
|
+
border-radius: var(--tblr-border-radius-sm);
|
|
497
|
+
}
|
|
498
|
+
.t-radio-tile.active .t-radio-tile-preview { color: var(--tblr-body-color); }
|
|
499
|
+
.t-radio-tile-label { font-size: 0.8125rem; color: var(--tblr-secondary-color); }
|
|
500
|
+
.t-radio-tile.active .t-radio-tile-label { color: var(--tblr-body-color); font-weight: var(--tblr-font-weight-medium); }
|
|
501
|
+
|
|
502
|
+
/* Theme previews: what each theme choice looks like. */
|
|
503
|
+
.t-theme-font { font-size: 2rem; line-height: 1; }
|
|
504
|
+
.t-theme-radius { width: 2.25rem; height: 2.25rem; background: var(--tblr-primary); opacity: 0.85; }
|
|
505
|
+
.t-theme-swatches { display: flex; gap: 3px; }
|
|
506
|
+
.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); }
|
|
507
|
+
.t-accent-swatches { display: flex; flex-wrap: wrap; gap: 0.5rem; }
|
|
508
|
+
.t-accent-custom { position: relative; }
|
|
509
|
+
.t-accent-custom .form-colorinput-color { background: var(--tblr-bg-surface-secondary); border: 1px dashed var(--tblr-border-color); }
|
|
510
|
+
.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); }
|
|
511
|
+
.t-accent-custom-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
|
|
512
|
+
|
|
513
|
+
/* A theme scope (TThemeScope): Tabler's theme settings for part of a page, such as a preview of an
|
|
514
|
+
application. Tabler works out radii, the primary's shades and (in the dark theme) the surfaces
|
|
515
|
+
once, at the root, and the Gears palette sets its own surfaces there; they're worked out again
|
|
516
|
+
here from the scope's base grays, as Tabler's defaults do, so they follow the scope's settings. */
|
|
517
|
+
.t-theme-scope {
|
|
518
|
+
--tblr-body-bg: light-dark(var(--tblr-gray-50), var(--tblr-gray-900));
|
|
519
|
+
--tblr-body-color: light-dark(var(--tblr-gray-700), var(--tblr-gray-200));
|
|
520
|
+
--tblr-secondary-color: color-mix(in oklab, var(--tblr-body-color) 75%, transparent);
|
|
521
|
+
--tblr-secondary: light-dark(var(--tblr-gray-500), var(--tblr-gray-400));
|
|
522
|
+
--tblr-muted: light-dark(var(--tblr-gray-500), var(--tblr-gray-400));
|
|
523
|
+
--tblr-bg-surface: light-dark(var(--tblr-white), var(--tblr-gray-800));
|
|
524
|
+
--tblr-bg-surface-secondary: light-dark(var(--tblr-gray-50), var(--tblr-gray-900));
|
|
525
|
+
--tblr-bg-surface-dark: var(--tblr-gray-900);
|
|
526
|
+
--tblr-bg-forms: light-dark(var(--tblr-bg-surface), var(--tblr-gray-900));
|
|
527
|
+
--tblr-border-color: light-dark(var(--tblr-gray-200), var(--tblr-gray-700));
|
|
528
|
+
--tblr-disabled-color: color-mix(in oklab, var(--tblr-body-color) 40%, transparent);
|
|
529
|
+
--tblr-border-radius-0: calc(0 * var(--tblr-border-radius-scale, 1));
|
|
530
|
+
--tblr-border-radius-xs: calc(2px * var(--tblr-border-radius-scale, 1));
|
|
531
|
+
--tblr-border-radius-sm: calc(4px * var(--tblr-border-radius-scale, 1));
|
|
532
|
+
--tblr-border-radius-md: calc(6px * var(--tblr-border-radius-scale, 1));
|
|
533
|
+
--tblr-border-radius-lg: calc(8px * var(--tblr-border-radius-scale, 1));
|
|
534
|
+
--tblr-border-radius-xl: calc(1rem * var(--tblr-border-radius-scale, 1));
|
|
535
|
+
--tblr-border-radius-xxl: calc(2rem * var(--tblr-border-radius-scale, 1));
|
|
536
|
+
--tblr-border-radius: var(--tblr-border-radius-md);
|
|
537
|
+
--tblr-primary-darken: oklch(from var(--tblr-primary) calc(l - 0.06) c h);
|
|
538
|
+
--tblr-primary-lt: color-mix(in oklab, var(--tblr-primary) 10%, transparent);
|
|
539
|
+
--tblr-control-checked-bg: var(--tblr-primary);
|
|
540
|
+
--tblr-link-color: light-dark(var(--tblr-primary), color-mix(in oklab, var(--tblr-white) 40%, var(--tblr-primary)));
|
|
541
|
+
--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)));
|
|
542
|
+
font-family: var(--tblr-body-font-family);
|
|
543
|
+
color: var(--tblr-body-color);
|
|
544
|
+
background: var(--tblr-body-bg);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/* Image upload (TImageUpload): the image beside what the area takes. */
|
|
548
|
+
.t-image-upload-area { flex-direction: row; justify-content: flex-start; gap: 1rem; padding: 1rem; text-align: start; }
|
|
549
|
+
.t-image-upload-preview {
|
|
550
|
+
display: flex;
|
|
551
|
+
flex-shrink: 0;
|
|
552
|
+
align-items: center;
|
|
553
|
+
justify-content: center;
|
|
554
|
+
width: 4.5rem;
|
|
555
|
+
height: 4.5rem;
|
|
556
|
+
overflow: hidden;
|
|
557
|
+
background: var(--tblr-bg-surface-secondary);
|
|
558
|
+
border-radius: var(--tblr-border-radius);
|
|
559
|
+
}
|
|
560
|
+
.t-image-upload-preview img { width: 100%; height: 100%; object-fit: contain; }
|
|
@@ -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,28 @@
|
|
|
1
|
+
// The choices Tabler's theme settings offer (tabler-themes.css), with their labels, in the order its
|
|
2
|
+
// own theme settings list them.
|
|
3
|
+
import type { SelectItem, ThemeBase, ThemeFont, 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
|
+
/** Whether an accent is a custom color (#rrggbb) rather than one of Tabler's named colors. */
|
|
28
|
+
export const isCustomAccent = (accent: string | undefined) => !!accent && accent.startsWith('#')
|