@ternarytech-io/gears-ui 0.5.0 → 0.6.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/README.md CHANGED
@@ -1,163 +1,164 @@
1
- # Gears UI
2
-
3
- Vue 3 components on [Tabler](https://docs.tabler.io/ui) (Bootstrap 5 underneath), for the Gears Studio
4
- and the apps Gears builds, plus a site that previews them.
5
-
6
- ```shell
7
- npm install
8
- npm run dev # the preview site at http://localhost:5175
9
- npm run typecheck
10
- npm run build # type-checks, then builds the preview site into dist/
11
- ```
12
-
13
- Or run the preview site in Docker, at <http://localhost:5175>:
14
-
15
- ```shell
16
- docker compose up -d # builds the image every time (pull_policy: build), then serves it with nginx
17
- docker compose down
18
- ```
19
-
20
- ## Installing
21
-
22
- ```shell
23
- npm install @ternarytech-io/gears-ui vue vue-router
24
- ```
25
-
26
- The package ships its Vue and TypeScript source, not a build: the app's bundler compiles it. That
27
- needs Vite (or another bundler) with `@vitejs/plugin-vue`, and in Vite the package left out of
28
- dependency pre-bundling, so its `.vue` files are compiled with the app's:
29
-
30
- ```ts
31
- // vite.config.ts
32
- export default defineConfig({
33
- plugins: [vue()],
34
- optimizeDeps: { exclude: ['@ternarytech-io/gears-ui'] }
35
- })
36
- ```
37
-
38
- ## Using it
39
-
40
- ```ts
41
- // main.ts
42
- import '@ternarytech-io/gears-ui/styles.css'
43
- import { createApp } from 'vue'
44
- import GearsUI, { useColorMode } from '@ternarytech-io/gears-ui'
45
-
46
- useColorMode() // applies the saved light/dark choice to <html>
47
- createApp(App).use(router).use(GearsUI).mount('#app')
48
- ```
49
-
50
- Apps that use the plugin components also import `@ternarytech-io/gears-ui/plugins.css`, after `styles.css`.
51
-
52
- The plugin registers every component globally (typed for templates). Components can also be imported
53
- one by one: `import { TButton } from '@ternarytech-io/gears-ui'`. `vue` and `vue-router` are peer dependencies.
54
-
55
- Components that need an optional library have entry points of their own, so an app installs only what
56
- it uses:
57
-
58
- | Entry | Components | Needs |
59
- | --- | --- | --- |
60
- | `@ternarytech-io/gears-ui` | Everything else | Nothing more |
61
- | `@ternarytech-io/gears-ui/code-editor` | `TCodeEditor` (install with `GearsUICodeEditor`) | `monaco-editor` |
62
- | `@ternarytech-io/gears-ui/plugins` | `TAdvancedSelect`, `TColorPicker`, `TDatePicker`, `TDropzone`, `TInputMask`, `TRangeSlider`, `TRichEditor`, `TSortable`, `TSortableTree` (install with `GearsUIPlugins`) | Each one's library; and `@ternarytech-io/gears-ui/plugins.css` |
63
- | `@ternarytech-io/gears-ui/components/T….vue` | Any one component on its own | Only that component's library |
64
-
65
- `GearsUIPlugins` and `plugins.css` need all eight libraries. To use only some plugins, import those
66
- components directly (`import TSortable from '@ternarytech-io/gears-ui/components/TSortable.vue'`; each loads only its
67
- own library) and the CSS they need: Tom Select's `tom-select.bootstrap5.min.css`, and
68
- `@tabler/core/dist/css/tabler-vendors.min.css` after it for the select, color picker, dropzone and slider.
69
-
70
- From another repo, depend on a pinned commit: `"@ternarytech-io/gears-ui": "github:TernaryTech-io/Gears.UI#<commit>"`. The
71
- package ships its sources, so the app's Vite compiles them; exclude it from pre-bundling with
72
- `optimizeDeps: { exclude: ['@ternarytech-io/gears-ui'] }`.
73
-
74
- The package ships its sources (`exports` points at `src/`), so it's consumed by a Vite app, as the Studio is.
75
-
76
- ## How it's built
77
-
78
- - **Styles.** `src/styles/gears.css` imports Tabler's CSS and the Tabler Icons webfont (self-hosted: a
79
- Gears server may have no internet), then sets the Gears palette through Tabler's CSS variables: primary
80
- #3673d1, darkest black #1c1d1d, pages a shade off white, cards white (#232525 dark). Tabler 1.7 builds its
81
- shades and dark mode from those variables with `light-dark()`, so there's no SCSS build.
82
- - **Dark mode.** `data-bs-theme` on `<html>`, set by `useColorMode()` (light, dark or system; remembered).
83
- The sidebar is dark in both themes.
84
- - **Interactive components** (tooltip, dropdown, modal, slideover) drive Tabler's bundled Bootstrap JS
85
- from Vue: created on mount, disposed on unmount, opened and closed through `v-model`.
86
- - **Props follow Nuxt UI** (`color`, `variant`, `size`, `icon`, `trailingIcon`, `label`, `v-model:open`), so the
87
- Studio's components move over mostly by renaming. Colors are `primary`, `neutral`, `success`, `warning`,
88
- `error` and `info`; `toTabler()` maps them to Tabler's names (`neutral` → `secondary`, `error` → `danger`).
89
- - **Icons** are Tabler Icons by name: `icon="plus"`. Browse them at <https://tabler.io/icons>.
90
- - Tabler's own classes work alongside the components: the grid, spacing, `btn-list`, `row-cards`,
91
- `list-group`, `datagrid`, `text-secondary`, …
92
-
93
- ## The preview site
94
-
95
- `preview/` is a Vite app that uses the library the way an app does. Each component page lists the
96
- examples in `preview/examples/{slug}/`, in file name order, live with their source under them; the file
97
- name gives the title (`02-colors.vue` → "Colors") and a leading `<!-- comment -->` the description. To
98
- add a page, add an entry to `preview/registry.ts` and a folder of examples.
99
-
100
- ## Components
101
-
102
- | Group | Components |
103
- | --- | --- |
104
- | Elements | `TButton`, `TBadge`, `TAvatar`, `TAlert`, `TCard`, `TIcon`, `TTooltip`, `TEmpty`, `TSpinner`, `TSkeleton`, `TProgress`, `TSeparator` (a label at the start, center or end; color, style, thickness) |
105
- | Forms | `TFormField`, `TInput`, `TInputNumber`, `TTextarea`, `TSelect`, `TSelectMenu`, `TInputTags`, `TCheckbox`, `TSwitch`, `TRadioGroup` (list, cards or tiles with a picture), `TFieldGroup`, `TFileUpload`, `TImageUpload` (one image, checked for shape and size), `TIconPicker` (any Tabler icon, by name, with a search; the list is generated by `npm run icons`), `TRating` (stars, hearts or circles; no library), `TListBox` (always shown; one or several; a search), `TCheckboxTree` (parents check their children; partly checked; folding), `TCodeEditor` |
106
- | Theme | `TAccentPicker`, `TFontPicker`, `TRadiusPicker`, `TThemeBasePicker` (Tabler's theme settings as pickers), `TNavPositionPicker`, `TDensityPicker`, `TContainerPicker` (layout), `TThemeScope` (applies a `ThemeSettings`' look and density to what's inside it); `themeAccents`, `themeFonts`, `themeBases`, `themeRadii`, `themeNavs`, `themeDensities`, `themeContainers` |
107
- | Overlays | `TModal`, `TSlideover`, `TDropdown`, `TToaster` (with `useToast()`), `TLightbox` (images shown large: previous and next, arrow keys, swipes, captions) |
108
- | Navigation | `TTabs`, `TPagination`, `TSteps`, `TNav`, `TPanelList`, `TCommandPalette`, `TSearchButton` |
109
- | Data | `TTable` (sorting, `selectable` rows), `TAdvancedTable` (filters by column), `TEditableTable` (editing in place, bulk actions, search, pages, column kinds; client-side or `manual`), `TDataGrid` and `TDataGridItem` (Tabler's datagrid: labels and values for detail panels), `TStatCard` (with a trend and a sparkline; `loading`, `clickable`), `TSparkline` (Tabler's, no library), `TLogView` |
110
- | Layout | `TAppLayout` (an application's frame, laid out by its theme, with a menu button on small screens), `TScaledFrame` (a whole screen scaled to fit), `TShell`, `TTopbar`, `TPage`, `TSectionLayout`, `TSplitter`, `TAuthLayout`, `TColorModeButton` |
111
- | Plugins | `TAdvancedSelect`, `TChart`, `TPdfViewer`, `TCopyButton`, `TColorPicker`, `TDatePicker`, `TDropzone`, `TInputMask`, `TRangeSlider`, `TSortable`, `TSortableTree`, `TVectorMap`, `TRichEditor` |
112
-
113
- ### Plugins
114
-
115
- The components for [Tabler's plugins](https://docs.tabler.io/ui/plugins). Each library is an optional peer
116
- dependency and loads the first time its component is shown (`src/plugins.ts`), so an app installs and
117
- downloads only what it uses. Their CSS is in `@ternarytech-io/gears-ui/plugins.css`: each library's own styles, then
118
- Tabler's restyling of them (`tabler-vendors.css`), which must come after.
119
-
120
- | Component | Library | Notes |
121
- | --- | --- | --- |
122
- | `TAdvancedSelect` | Tom Select | One or several (`multiple`, as chips); `create` adds new values; icons and avatars beside labels. Overlaps `TSelectMenu`, which has no dependency. |
123
- | `TChart` | Apache ECharts (Apache-2.0) | `line`, `area`, `bar` (across), `column`, `pie`, `donut`; `series` along `categories`, `stacked`, `format`, `point-click`. Colors follow the theme (and a `TThemeScope`), light or dark; `options` (ECharts options) is merged over everything for anything else. SVG by default, `renderer="canvas"` for very many points; it follows its box's size. Only the charts it uses are bundled. Before 0.4.0 it was ApexCharts, whose license no longer suits apps others use. |
124
- | `TPdfViewer` | PDF.js (Mozilla, Apache-2.0) | A PDF's pages, drawn as they scroll into view; `zoom` (fit width, fit page, a percent), `v-model:page`, a toolbar with download and open in a new tab; `setPage`, `download`. Its worker is loaded with Vite's `?url`. |
125
- | `TCopyButton` | Tabler's clipboard | Copies `text`, or the field `target` selects. Needs https or localhost. |
126
- | `TColorPicker` | Coloris | `format`, `alpha`, `swatches`, `swatchesOnly`. The field isn't wrapped by Coloris (Vue owns it); the swatch is ours. |
127
- | `TDatePicker` | Tabler's date picker, on Vanilla Calendar Pro | `single`, `multiple` or `range`; `inline`; the model is `YYYY-MM-DD`, `format` only changes the display. |
128
- | `TDropzone` | Dropzone | With `url`, uploads; without, v-model collects the files. |
129
- | `TInputMask` | Tabler's input mask, on IMask | `mask` like "(000) 000-0000"; `unmasked`; `showMask`. |
130
- | `TRangeSlider` | noUiSlider | A number, or a range with `[from, to]`. |
131
- | `TSortable` | Tabler's sortable, on SortableJS | Reorders v-model's array. Lists within one container; dragging between lists isn't wired up yet. |
132
- | `TVectorMap` | Tabler's vector map | The world map: `values`, `markers`, `lines`, `legend`, `select` with v-model:selected, `zoom`. |
133
- | `TRichEditor` | HugeRTE (open-source TinyMCE fork) | v-model is HTML. Bundled skins and plugins, nothing fetched; follows the theme by rebuilding the editor. |
134
-
135
- ### From the Studio's components
136
-
137
- | Studio (Nuxt UI) | Gears UI |
138
- | --- | --- |
139
- | `UButton`, `UBadge`, `UAvatar`, `UAlert`, `UCard`, `UIcon`, `UTooltip`, `UEmpty`, `USkeleton`, `USeparator`, `UProgress` | `T…` with the same name. Icons change from `i-lucide-*` to Tabler names. `UCard`'s header slot content moves to `title`/`subtitle`/`#actions`. |
140
- | `UFormField`, `UInput`, `UTextarea`, `USelect`, `UCheckbox`, `USwitch`, `URadioGroup`, `UFieldGroup` | `TFormField` (`help` → `description`), `TInput`, `TTextarea`, `TSelect`, `TCheckbox`, `TSwitch`, `TRadioGroup`, `TFieldGroup` |
141
- | `UModal`, `USlideover`, `UDropdownMenu` | `TModal`, `TSlideover`, `TDropdown` (same item groups; `onSelect`, `to`, `type: 'label'`) |
142
- | `UTabs`, `UPagination`, `UStepper`, `UTable` | `TTabs` (`:content="false"` switches become `variant="segmented"`), `TPagination`, `TSteps`, `TTable` (cell slots get the row itself, not `row.original`; `#cell` draws any cell, `sticky` keeps the header) |
143
- | `UInputNumber`, `UFileUpload` | `TInputNumber` (Tabler's number input: minus and plus, `min`, `max`, `step`), `TFileUpload` (`accept`, `multiple`; v-model holds the File, nothing uploads) |
144
- | `UDashboardSearch`, `UDashboardSearchButton` | `TCommandPalette` (`groups` of items with `to` or `onSelect`; Ctrl+K / ⌘K) and `TSearchButton` (`collapsed` for the icon only). They share their open state; `useCommandPalette()` opens it from code |
145
- | `USelectMenu`, `UInputTags`, `USplitter` | `TSelectMenu` (`multiple`; items take a `group` instead of `type: 'label'` rows; `v-model:search-term` with `ignore-filter` becomes `v-model:search` with `:filter="false"`), `TInputTags`, `TSplitter` (`#start` and `#end` slots, `storageKey`) |
146
- | `UDashboardGroup` + `UDashboardSidebar` + `UNavigationMenu` | `TShell` with `nav` items (`TNav`) |
147
- | `UDashboardPanel` + `UDashboardNavbar` | `TTopbar` + `TPage` |
148
- | `UColorModeButton` | `TColorModeButton` |
149
- | `useToast()` (with `UApp`) | `useToast()` from `@ternarytech-io/gears-ui`, the same `add({ title, description, color, icon })`, and a `TToaster` in the frame |
150
- | `StatCard`, `AuthCard`, `SectionLayout` | `TStatCard`, `TAuthLayout` (brand and logo are props), `TSectionLayout` |
151
- | `BuildLog`, `AppLog` | Their polling stays in the Studio; the display is `TLogView` (`text`, or `lines` with times and levels, and `v-model:follow`) |
152
- | `CodeEditor` | `TCodeEditor` (same props; `Completion` is `CodeCompletion`; `flush` replaces the border overrides). Monaco's setup moves to `src/monaco.ts`, with themes `gears-light` and `gears-dark` |
153
- | `CodePanel`, `QueryPanel`, `FilterGroupEditor` | Stay in the Studio (they call its API). Rebuilt on Gears UI in the preview's Studio pages, against mock data in `preview/studio/`: the side-panel lists are `TPanelList`, and the results card is a component of its own instead of VueUse's reusable template |
154
- | `StudioPage`, `ProjectSwitcher`, user menu | Compositions of `TTopbar`, `TDropdown`, `TAvatar` and `TPage`: see the Top bar and Dropdown pages |
155
-
156
- ### Still to do
157
-
158
- Every Nuxt UI component the Studio uses now has a Gears UI version. The preview site has no generated
159
- props tables yet; the examples are the reference.
160
-
161
- ## License
162
-
163
- [Mozilla Public License 2.0](LICENSE), as Ternary.Data.
1
+ # Gears UI
2
+
3
+ Vue 3 components on [Tabler](https://docs.tabler.io/ui) (Bootstrap 5 underneath), for the Gears Studio
4
+ and the apps Gears builds, plus a site that previews them.
5
+
6
+ ```shell
7
+ npm install
8
+ npm run dev # the preview site at http://localhost:5175
9
+ npm run typecheck
10
+ npm run build # type-checks, then builds the preview site into dist/
11
+ ```
12
+
13
+ Or run the preview site in Docker, at <http://localhost:5175>:
14
+
15
+ ```shell
16
+ docker compose up -d # builds the image every time (pull_policy: build), then serves it with nginx
17
+ docker compose down
18
+ ```
19
+
20
+ ## Installing
21
+
22
+ ```shell
23
+ npm install @ternarytech-io/gears-ui vue vue-router
24
+ ```
25
+
26
+ The package ships its Vue and TypeScript source, not a build: the app's bundler compiles it. That
27
+ needs Vite (or another bundler) with `@vitejs/plugin-vue`, and in Vite the package left out of
28
+ dependency pre-bundling, so its `.vue` files are compiled with the app's:
29
+
30
+ ```ts
31
+ // vite.config.ts
32
+ export default defineConfig({
33
+ plugins: [vue()],
34
+ optimizeDeps: { exclude: ['@ternarytech-io/gears-ui'] }
35
+ })
36
+ ```
37
+
38
+ ## Using it
39
+
40
+ ```ts
41
+ // main.ts
42
+ import '@ternarytech-io/gears-ui/styles.css'
43
+ import { createApp } from 'vue'
44
+ import GearsUI, { useColorMode } from '@ternarytech-io/gears-ui'
45
+
46
+ useColorMode() // applies the saved light/dark choice to <html>
47
+ createApp(App).use(router).use(GearsUI).mount('#app')
48
+ ```
49
+
50
+ Apps that use the plugin components also import `@ternarytech-io/gears-ui/plugins.css`, after `styles.css`.
51
+
52
+ The plugin registers every component globally (typed for templates). Components can also be imported
53
+ one by one: `import { TButton } from '@ternarytech-io/gears-ui'`. `vue` and `vue-router` are peer dependencies.
54
+
55
+ Components that need an optional library have entry points of their own, so an app installs only what
56
+ it uses:
57
+
58
+ | Entry | Components | Needs |
59
+ | --- | --- | --- |
60
+ | `@ternarytech-io/gears-ui` | Everything else | Nothing more |
61
+ | `@ternarytech-io/gears-ui/code-editor` | `TCodeEditor` (install with `GearsUICodeEditor`) | `monaco-editor` |
62
+ | `@ternarytech-io/gears-ui/plugins` | `TAdvancedSelect`, `TColorPicker`, `TDatePicker`, `TDropzone`, `TInputMask`, `TRangeSlider`, `TRichEditor`, `TSortable`, `TSortableTree` (install with `GearsUIPlugins`) | Each one's library; and `@ternarytech-io/gears-ui/plugins.css` |
63
+ | `@ternarytech-io/gears-ui/components/T….vue` | Any one component on its own | Only that component's library |
64
+
65
+ `GearsUIPlugins` and `plugins.css` need all eight libraries. To use only some plugins, import those
66
+ components directly (`import TSortable from '@ternarytech-io/gears-ui/components/TSortable.vue'`; each loads only its
67
+ own library) and the CSS they need: Tom Select's `tom-select.bootstrap5.min.css`, and
68
+ `@tabler/core/dist/css/tabler-vendors.min.css` after it for the select, color picker, dropzone and slider.
69
+
70
+ From another repo, depend on a pinned commit: `"@ternarytech-io/gears-ui": "github:TernaryTech-io/Gears.UI#<commit>"`. The
71
+ package ships its sources, so the app's Vite compiles them; exclude it from pre-bundling with
72
+ `optimizeDeps: { exclude: ['@ternarytech-io/gears-ui'] }`.
73
+
74
+ The package ships its sources (`exports` points at `src/`), so it's consumed by a Vite app, as the Studio is.
75
+
76
+ ## How it's built
77
+
78
+ - **Styles.** `src/styles/gears.css` imports Tabler's CSS and the Tabler Icons webfont (self-hosted: a
79
+ Gears server may have no internet), then sets the Gears palette through Tabler's CSS variables: primary
80
+ #3673d1, darkest black #1c1d1d, pages a shade off white, cards white (#232525 dark). Tabler 1.7 builds its
81
+ shades and dark mode from those variables with `light-dark()`, so there's no SCSS build.
82
+ - **Dark mode.** `data-bs-theme` on `<html>`, set by `useColorMode()` (light, dark or system; remembered).
83
+ The sidebar is dark in both themes.
84
+ - **Interactive components** (tooltip, dropdown, modal, slideover) drive Tabler's bundled Bootstrap JS
85
+ from Vue: created on mount, disposed on unmount, opened and closed through `v-model`.
86
+ - **Props follow Nuxt UI** (`color`, `variant`, `size`, `icon`, `trailingIcon`, `label`, `v-model:open`), so the
87
+ Studio's components move over mostly by renaming. Colors are `primary`, `neutral`, `success`, `warning`,
88
+ `error` and `info`; `toTabler()` maps them to Tabler's names (`neutral` → `secondary`, `error` → `danger`).
89
+ - **Icons** are Tabler Icons by name: `icon="plus"`. Browse them at <https://tabler.io/icons>.
90
+ - Tabler's own classes work alongside the components: the grid, spacing, `btn-list`, `row-cards`,
91
+ `list-group`, `datagrid`, `text-secondary`, …
92
+
93
+ ## The preview site
94
+
95
+ `preview/` is a Vite app that uses the library the way an app does. Each component page lists the
96
+ examples in `preview/examples/{slug}/`, in file name order, live with their source under them; the file
97
+ name gives the title (`02-colors.vue` → "Colors") and a leading `<!-- comment -->` the description. To
98
+ add a page, add an entry to `preview/registry.ts` and a folder of examples.
99
+
100
+ ## Components
101
+
102
+ | Group | Components |
103
+ | --- | --- |
104
+ | Elements | `TButton`, `TButtonGroup` (joined buttons, across or down; a tooltip each; `click` names the button), `TBadge`, `TAvatar`, `TAlert`, `TCard`, `TIcon`, `TTooltip`, `TEmpty`, `TSpinner`, `TSkeleton`, `TProgress`, `TSeparator` (a label at the start, center or end; color, style, thickness) |
105
+ | Forms | `TFormField`, `TInput`, `TInputNumber`, `TTextarea`, `TSelect`, `TSelectMenu`, `TInputTags`, `TCheckbox`, `TSwitch`, `TRadioGroup` (list, cards or tiles with a picture), `TFieldGroup`, `TFileUpload`, `TImageUpload` (one image, checked for shape and size), `TIconPicker` (any Tabler icon, by name, with a search; the list is generated by `npm run icons`), `TRating` (stars, hearts or circles; no library), `TListBox` (always shown; one or several; a search), `TCheckboxTree` (parents check their children; partly checked; folding), `TCodeEditor` |
106
+ | Theme | `TAccentPicker`, `TFontPicker`, `TRadiusPicker`, `TThemeBasePicker` (Tabler's theme settings as pickers), `TNavPositionPicker`, `TDensityPicker`, `TContainerPicker` (layout), `TThemeScope` (applies a `ThemeSettings`' look and density to what's inside it); `themeAccents`, `themeFonts`, `themeBases`, `themeRadii`, `themeNavs`, `themeDensities`, `themeContainers` |
107
+ | Overlays | `TModal`, `TSlideover`, `TDropdown`, `TSplitButton` (a main action and a menu of others), `TToaster` (with `useToast()`: neutral, success, warning, error or a custom `accent` color; a corner or the middle of the top or bottom, per toast or for all; `onClick`, `onClose`), `TLightbox` (images shown large: previous and next, arrow keys, swipes, captions) |
108
+ | Navigation | `TTabs`, `TPagination`, `TSteps`, `TNav`, `TPanelList`, `TCommandPalette`, `TSearchButton` |
109
+ | Data | `TTable` (sorting, `selectable` rows), `TAdvancedTable` (filters by column), `TEditableTable` (editing in place, bulk actions, search, pages, column kinds; client-side or `manual`), `TDataGrid` and `TDataGridItem` (Tabler's datagrid: labels and values for detail panels), `TStatCard` (with a trend and a sparkline; `loading`, `clickable`), `TSparkline` (Tabler's, no library), `TLogView` |
110
+ | Layout | `TAppLayout` (an application's frame, laid out by its theme, with a menu button on small screens), `TScaledFrame` (a whole screen scaled to fit), `TShell`, `TTopbar`, `TPage`, `TSectionLayout`, `TSplitter`, `TAuthLayout`, `TColorModeButton` |
111
+ | Plugins | `TAdvancedSelect`, `TChart`, `TPdfViewer`, `TCopyButton`, `TColorPicker`, `TDatePicker`, `TDropzone`, `TInputMask`, `TRangeSlider`, `TSortable`, `TSortableTree`, `TTimeInput`, `TVectorMap`, `TRichEditor` |
112
+
113
+ ### Plugins
114
+
115
+ The components for [Tabler's plugins](https://docs.tabler.io/ui/plugins). Each library is an optional peer
116
+ dependency and loads the first time its component is shown (`src/plugins.ts`), so an app installs and
117
+ downloads only what it uses. Their CSS is in `@ternarytech-io/gears-ui/plugins.css`: each library's own styles, then
118
+ Tabler's restyling of them (`tabler-vendors.css`), which must come after.
119
+
120
+ | Component | Library | Notes |
121
+ | --- | --- | --- |
122
+ | `TAdvancedSelect` | Tom Select | One or several (`multiple`, as chips); `create` adds new values; icons and avatars beside labels. Overlaps `TSelectMenu`, which has no dependency. |
123
+ | `TChart` | Apache ECharts (Apache-2.0) | `line`, `area`, `bar` (across), `column`, `pie`, `donut`; `series` along `categories`, `stacked`, `format`, `point-click`. Colors follow the theme (and a `TThemeScope`), light or dark; `options` (ECharts options) is merged over everything for anything else. SVG by default, `renderer="canvas"` for very many points; it follows its box's size. Only the charts it uses are bundled. Before 0.4.0 it was ApexCharts, whose license no longer suits apps others use. |
124
+ | `TPdfViewer` | PDF.js (Mozilla, Apache-2.0) | A PDF's pages, drawn as they scroll into view; `zoom` (fit width, fit page, a percent), `v-model:page`, a toolbar with download and open in a new tab; `setPage`, `download`. Its worker is loaded with Vite's `?url`. |
125
+ | `TCopyButton` | Tabler's clipboard | Copies `text`, or the field `target` selects. Needs https or localhost. |
126
+ | `TColorPicker` | Coloris | `format`, `alpha`, `swatches`, `swatchesOnly`. The field isn't wrapped by Coloris (Vue owns it); the swatch is ours. |
127
+ | `TDatePicker` | Tabler's date picker, on Vanilla Calendar Pro | `single`, `multiple` or `range`; `inline`; the model is `YYYY-MM-DD`, `format` only changes the display. |
128
+ | `TDropzone` | Dropzone | With `url`, uploads; without, v-model collects the files. |
129
+ | `TInputMask` | Tabler's input mask, on IMask | `mask` like "(000) 000-0000"; `unmasked`; `showMask`. |
130
+ | `TTimeInput` | IMask | A time of day, typed or picked from a list at `step` minutes; `hour12`, `seconds`, `min`, `max`. The model is always 24-hour `HH:mm` (`HH:mm:ss`). |
131
+ | `TRangeSlider` | noUiSlider | A number, or a range with `[from, to]`. |
132
+ | `TSortable` | Tabler's sortable, on SortableJS | Reorders v-model's array. Lists within one container; dragging between lists isn't wired up yet. |
133
+ | `TVectorMap` | Tabler's vector map | The world map: `values`, `markers`, `lines`, `legend`, `select` with v-model:selected, `zoom`. |
134
+ | `TRichEditor` | HugeRTE (open-source TinyMCE fork) | v-model is HTML. Bundled skins and plugins, nothing fetched; follows the theme by rebuilding the editor. |
135
+
136
+ ### From the Studio's components
137
+
138
+ | Studio (Nuxt UI) | Gears UI |
139
+ | --- | --- |
140
+ | `UButton`, `UBadge`, `UAvatar`, `UAlert`, `UCard`, `UIcon`, `UTooltip`, `UEmpty`, `USkeleton`, `USeparator`, `UProgress` | `T…` with the same name. Icons change from `i-lucide-*` to Tabler names. `UCard`'s header slot content moves to `title`/`subtitle`/`#actions`. |
141
+ | `UFormField`, `UInput`, `UTextarea`, `USelect`, `UCheckbox`, `USwitch`, `URadioGroup`, `UFieldGroup` | `TFormField` (`help` → `description`), `TInput`, `TTextarea`, `TSelect`, `TCheckbox`, `TSwitch`, `TRadioGroup`, `TFieldGroup` |
142
+ | `UModal`, `USlideover`, `UDropdownMenu` | `TModal`, `TSlideover`, `TDropdown` (same item groups; `onSelect`, `to`, `type: 'label'`) |
143
+ | `UTabs`, `UPagination`, `UStepper`, `UTable` | `TTabs` (`:content="false"` switches become `variant="segmented"`), `TPagination`, `TSteps`, `TTable` (cell slots get the row itself, not `row.original`; `#cell` draws any cell, `sticky` keeps the header) |
144
+ | `UInputNumber`, `UFileUpload` | `TInputNumber` (Tabler's number input: minus and plus, `min`, `max`, `step`), `TFileUpload` (`accept`, `multiple`; v-model holds the File, nothing uploads) |
145
+ | `UDashboardSearch`, `UDashboardSearchButton` | `TCommandPalette` (`groups` of items with `to` or `onSelect`; Ctrl+K / ⌘K) and `TSearchButton` (`collapsed` for the icon only). They share their open state; `useCommandPalette()` opens it from code |
146
+ | `USelectMenu`, `UInputTags`, `USplitter` | `TSelectMenu` (`multiple`; items take a `group` instead of `type: 'label'` rows; `v-model:search-term` with `ignore-filter` becomes `v-model:search` with `:filter="false"`), `TInputTags`, `TSplitter` (`#start` and `#end` slots, `storageKey`) |
147
+ | `UDashboardGroup` + `UDashboardSidebar` + `UNavigationMenu` | `TShell` with `nav` items (`TNav`) |
148
+ | `UDashboardPanel` + `UDashboardNavbar` | `TTopbar` + `TPage` |
149
+ | `UColorModeButton` | `TColorModeButton` |
150
+ | `useToast()` (with `UApp`) | `useToast()` from `@ternarytech-io/gears-ui`, the same `add({ title, description, color, icon })`, and a `TToaster` in the frame |
151
+ | `StatCard`, `AuthCard`, `SectionLayout` | `TStatCard`, `TAuthLayout` (brand and logo are props), `TSectionLayout` |
152
+ | `BuildLog`, `AppLog` | Their polling stays in the Studio; the display is `TLogView` (`text`, or `lines` with times and levels, and `v-model:follow`) |
153
+ | `CodeEditor` | `TCodeEditor` (same props; `Completion` is `CodeCompletion`; `flush` replaces the border overrides). Monaco's setup moves to `src/monaco.ts`, with themes `gears-light` and `gears-dark` |
154
+ | `CodePanel`, `QueryPanel`, `FilterGroupEditor` | Stay in the Studio (they call its API). Rebuilt on Gears UI in the preview's Studio pages, against mock data in `preview/studio/`: the side-panel lists are `TPanelList`, and the results card is a component of its own instead of VueUse's reusable template |
155
+ | `StudioPage`, `ProjectSwitcher`, user menu | Compositions of `TTopbar`, `TDropdown`, `TAvatar` and `TPage`: see the Top bar and Dropdown pages |
156
+
157
+ ### Still to do
158
+
159
+ Every Nuxt UI component the Studio uses now has a Gears UI version. The preview site has no generated
160
+ props tables yet; the examples are the reference.
161
+
162
+ ## License
163
+
164
+ [Mozilla Public License 2.0](LICENSE), as Ternary.Data.
package/package.json CHANGED
@@ -1,122 +1,122 @@
1
- {
2
- "name": "@ternarytech-io/gears-ui",
3
- "version": "0.5.0",
4
- "type": "module",
5
- "description": "Gears UI: Vue 3 components on Tabler, used by the Gears Studio and the applications it builds.",
6
- "license": "MPL-2.0",
7
- "author": "Ternary Tech",
8
- "homepage": "https://github.com/TernaryTech-io/Gears.UI#readme",
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/TernaryTech-io/Gears.UI.git"
12
- },
13
- "bugs": "https://github.com/TernaryTech-io/Gears.UI/issues",
14
- "keywords": [
15
- "vue",
16
- "vue3",
17
- "tabler",
18
- "components",
19
- "ui",
20
- "gears"
21
- ],
22
- "files": [
23
- "src",
24
- "README.md",
25
- "LICENSE"
26
- ],
27
- "sideEffects": [
28
- "*.css"
29
- ],
30
- "publishConfig": {
31
- "access": "public"
32
- },
33
- "exports": {
34
- ".": "./src/index.ts",
35
- "./plugins": "./src/plugins/index.ts",
36
- "./code-editor": "./src/code-editor.ts",
37
- "./styles.css": "./src/styles/gears.css",
38
- "./plugins.css": "./src/styles/plugins.css",
39
- "./components/*": "./src/components/*"
40
- },
41
- "scripts": {
42
- "dev": "vite",
43
- "build": "vue-tsc --noEmit && vite build",
44
- "typecheck": "vue-tsc --noEmit",
45
- "icons": "node scripts/generate-icons.mjs",
46
- "preview": "vite preview"
47
- },
48
- "peerDependencies": {
49
- "@melloware/coloris": "^0.25.0",
50
- "dropzone": "^6.3.0",
51
- "echarts": "^6.1.0",
52
- "hugerte": "^1.0.0",
53
- "imask": "^7.6.0",
54
- "monaco-editor": "^0.57.0",
55
- "nouislider": "^15.8.0",
56
- "pdfjs-dist": "^6.4.0",
57
- "sortablejs": "^1.15.0",
58
- "tom-select": "^2.6.0",
59
- "vanilla-calendar-pro": "^3.3.2",
60
- "vue": "^3.5.0",
61
- "vue-router": "^4.6.0"
62
- },
63
- "dependencies": {
64
- "@tabler/core": "1.7.1",
65
- "@tabler/icons-webfont": "3.49.0"
66
- },
67
- "devDependencies": {
68
- "@melloware/coloris": "0.25.0",
69
- "@types/sortablejs": "1.15.9",
70
- "@vitejs/plugin-vue": "6.0.10",
71
- "dropzone": "6.3.5",
72
- "echarts": "6.1.0",
73
- "hugerte": "1.0.14",
74
- "imask": "7.6.1",
75
- "monaco-editor": "0.57.0",
76
- "nouislider": "15.8.1",
77
- "pdfjs-dist": "6.4.299",
78
- "sortablejs": "1.15.7",
79
- "tom-select": "2.6.2",
80
- "typescript": "5.9.3",
81
- "vanilla-calendar-pro": "3.4.0",
82
- "vite": "7.3.7",
83
- "vue": "3.5.44",
84
- "vue-router": "4.6.4",
85
- "vue-tsc": "3.3.13"
86
- },
87
- "peerDependenciesMeta": {
88
- "monaco-editor": {
89
- "optional": true
90
- },
91
- "tom-select": {
92
- "optional": true
93
- },
94
- "@melloware/coloris": {
95
- "optional": true
96
- },
97
- "vanilla-calendar-pro": {
98
- "optional": true
99
- },
100
- "dropzone": {
101
- "optional": true
102
- },
103
- "echarts": {
104
- "optional": true
105
- },
106
- "imask": {
107
- "optional": true
108
- },
109
- "nouislider": {
110
- "optional": true
111
- },
112
- "pdfjs-dist": {
113
- "optional": true
114
- },
115
- "sortablejs": {
116
- "optional": true
117
- },
118
- "hugerte": {
119
- "optional": true
120
- }
121
- }
122
- }
1
+ {
2
+ "name": "@ternarytech-io/gears-ui",
3
+ "version": "0.6.0",
4
+ "type": "module",
5
+ "description": "Gears UI: Vue 3 components on Tabler, used by the Gears Studio and the applications it builds.",
6
+ "license": "MPL-2.0",
7
+ "author": "Ternary Tech",
8
+ "homepage": "https://github.com/TernaryTech-io/Gears.UI#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/TernaryTech-io/Gears.UI.git"
12
+ },
13
+ "bugs": "https://github.com/TernaryTech-io/Gears.UI/issues",
14
+ "keywords": [
15
+ "vue",
16
+ "vue3",
17
+ "tabler",
18
+ "components",
19
+ "ui",
20
+ "gears"
21
+ ],
22
+ "files": [
23
+ "src",
24
+ "README.md",
25
+ "LICENSE"
26
+ ],
27
+ "sideEffects": [
28
+ "*.css"
29
+ ],
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "exports": {
34
+ ".": "./src/index.ts",
35
+ "./plugins": "./src/plugins/index.ts",
36
+ "./code-editor": "./src/code-editor.ts",
37
+ "./styles.css": "./src/styles/gears.css",
38
+ "./plugins.css": "./src/styles/plugins.css",
39
+ "./components/*": "./src/components/*"
40
+ },
41
+ "scripts": {
42
+ "dev": "vite",
43
+ "build": "vue-tsc --noEmit && vite build",
44
+ "typecheck": "vue-tsc --noEmit",
45
+ "icons": "node scripts/generate-icons.mjs",
46
+ "preview": "vite preview"
47
+ },
48
+ "peerDependencies": {
49
+ "@melloware/coloris": "^0.25.0",
50
+ "dropzone": "^6.3.0",
51
+ "echarts": "^6.1.0",
52
+ "hugerte": "^1.0.0",
53
+ "imask": "^7.6.0",
54
+ "monaco-editor": "^0.57.0",
55
+ "nouislider": "^15.8.0",
56
+ "pdfjs-dist": "^6.4.0",
57
+ "sortablejs": "^1.15.0",
58
+ "tom-select": "^2.6.0",
59
+ "vanilla-calendar-pro": "^3.3.2",
60
+ "vue": "^3.5.0",
61
+ "vue-router": "^4.6.0"
62
+ },
63
+ "dependencies": {
64
+ "@tabler/core": "1.7.1",
65
+ "@tabler/icons-webfont": "3.49.0"
66
+ },
67
+ "devDependencies": {
68
+ "@melloware/coloris": "0.25.0",
69
+ "@types/sortablejs": "1.15.9",
70
+ "@vitejs/plugin-vue": "6.0.10",
71
+ "dropzone": "6.3.5",
72
+ "echarts": "6.1.0",
73
+ "hugerte": "1.0.14",
74
+ "imask": "7.6.1",
75
+ "monaco-editor": "0.57.0",
76
+ "nouislider": "15.8.1",
77
+ "pdfjs-dist": "6.4.299",
78
+ "sortablejs": "1.15.7",
79
+ "tom-select": "2.6.2",
80
+ "typescript": "5.9.3",
81
+ "vanilla-calendar-pro": "3.4.0",
82
+ "vite": "7.3.7",
83
+ "vue": "3.5.44",
84
+ "vue-router": "4.6.4",
85
+ "vue-tsc": "3.3.13"
86
+ },
87
+ "peerDependenciesMeta": {
88
+ "monaco-editor": {
89
+ "optional": true
90
+ },
91
+ "tom-select": {
92
+ "optional": true
93
+ },
94
+ "@melloware/coloris": {
95
+ "optional": true
96
+ },
97
+ "vanilla-calendar-pro": {
98
+ "optional": true
99
+ },
100
+ "dropzone": {
101
+ "optional": true
102
+ },
103
+ "echarts": {
104
+ "optional": true
105
+ },
106
+ "imask": {
107
+ "optional": true
108
+ },
109
+ "nouislider": {
110
+ "optional": true
111
+ },
112
+ "pdfjs-dist": {
113
+ "optional": true
114
+ },
115
+ "sortablejs": {
116
+ "optional": true
117
+ },
118
+ "hugerte": {
119
+ "optional": true
120
+ }
121
+ }
122
+ }