@vobs/ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/dist/app-shell-dom.d.ts +24 -0
  3. package/dist/app-shell-dom.js +573 -0
  4. package/dist/app-shell.d.ts +199 -0
  5. package/dist/app-shell.js +370 -0
  6. package/dist/base.css +52 -0
  7. package/dist/calendar-picker.d.ts +45 -0
  8. package/dist/calendar-picker.js +217 -0
  9. package/dist/calendar.d.ts +95 -0
  10. package/dist/calendar.js +194 -0
  11. package/dist/complex-inputs.d.ts +300 -0
  12. package/dist/complex-inputs.js +862 -0
  13. package/dist/components.css +4568 -0
  14. package/dist/data-display.d.ts +1063 -0
  15. package/dist/data-display.js +2298 -0
  16. package/dist/feedback.d.ts +88 -0
  17. package/dist/feedback.js +281 -0
  18. package/dist/forms.d.ts +378 -0
  19. package/dist/forms.js +1015 -0
  20. package/dist/icons-config.d.ts +25 -0
  21. package/dist/icons-config.js +14 -0
  22. package/dist/icons.d.ts +41 -0
  23. package/dist/icons.js +185 -0
  24. package/dist/index.d.ts +22 -0
  25. package/dist/index.js +32 -0
  26. package/dist/locale/en-US.d.ts +31 -0
  27. package/dist/locale/en-US.js +20 -0
  28. package/dist/locale/zh-CN.d.ts +31 -0
  29. package/dist/locale/zh-CN.js +20 -0
  30. package/dist/navigation.d.ts +609 -0
  31. package/dist/navigation.js +1707 -0
  32. package/dist/overlay.d.ts +304 -0
  33. package/dist/overlay.js +969 -0
  34. package/dist/primitives.d.ts +268 -0
  35. package/dist/primitives.js +764 -0
  36. package/dist/styles.css +3 -0
  37. package/dist/theme-data.d.ts +363 -0
  38. package/dist/theme-data.js +374 -0
  39. package/dist/theme.d.ts +79 -0
  40. package/dist/theme.js +262 -0
  41. package/dist/tokens.css +449 -0
  42. package/dist/tree.d.ts +144 -0
  43. package/dist/tree.js +469 -0
  44. package/dist/virtual-list.d.ts +190 -0
  45. package/dist/virtual-list.js +521 -0
  46. package/dist/workbench.d.ts +136 -0
  47. package/dist/workbench.js +156 -0
  48. package/package.json +113 -0
@@ -0,0 +1,156 @@
1
+ /** @license MIT
2
+ * Copyright (c) 2026 vobsjs
3
+ * @vobs/ui
4
+ */
5
+ import { createUiDomPlan } from './primitives.js';
6
+ export function createStatusBarPlans(options) {
7
+ return {
8
+ root: createUiDomPlan('div', 'status-bar', {
9
+ ...(options.className === undefined ? {} : { className: options.className }),
10
+ attrs: { id: `${options.id}-statusbar`, ...options.attrs },
11
+ }),
12
+ groups: options.groups.map((group) => ({
13
+ groupId: group.id,
14
+ items: group.items.map((item) => {
15
+ const plan = createUiDomPlan('span', 'status-bar-item', {
16
+ ...(item.tone === undefined ? {} : { state: item.tone }),
17
+ attrs: {
18
+ id: `${options.id}-${group.id}-${item.id}`,
19
+ ...(item.icon === undefined ? {} : { 'data-icon': item.icon }),
20
+ ...(item.tone === undefined ? {} : { 'data-tone': item.tone }),
21
+ 'data-label': item.label,
22
+ },
23
+ });
24
+ return {
25
+ ...plan,
26
+ itemId: item.id,
27
+ label: item.label,
28
+ ...(item.icon === undefined ? {} : { icon: item.icon }),
29
+ ...(item.tone === undefined ? {} : { tone: item.tone }),
30
+ };
31
+ }),
32
+ })),
33
+ };
34
+ }
35
+ export function createActivityRailPlans(options) {
36
+ const entries = options.entries.map((entry) => {
37
+ const base = { entryId: entry.id };
38
+ switch (entry.kind) {
39
+ case 'button':
40
+ return {
41
+ ...createUiDomPlan('button', 'activity-rail-button', {
42
+ state: entry.active === true ? 'active' : 'idle',
43
+ ...(entry.disabled === undefined ? {} : { disabled: entry.disabled }),
44
+ attrs: {
45
+ id: `${options.id}-${entry.id}`,
46
+ type: 'button',
47
+ ...(entry.icon === undefined ? {} : { 'data-icon': entry.icon }),
48
+ 'aria-pressed': entry.active === true ? 'true' : undefined,
49
+ },
50
+ }),
51
+ ...base,
52
+ kind: 'button',
53
+ icon: entry.icon ?? '',
54
+ active: entry.active === true,
55
+ };
56
+ case 'divider':
57
+ return {
58
+ ...createUiDomPlan('div', 'activity-rail-divider', {
59
+ attrs: { id: `${options.id}-${entry.id}` },
60
+ }),
61
+ ...base,
62
+ kind: 'divider',
63
+ };
64
+ default:
65
+ return {
66
+ ...createUiDomPlan('span', 'activity-rail-spacer', {
67
+ attrs: { id: `${options.id}-${entry.id}` },
68
+ }),
69
+ ...base,
70
+ kind: 'spacer',
71
+ };
72
+ }
73
+ });
74
+ return {
75
+ root: createUiDomPlan('nav', 'activity-rail', {
76
+ ...(options.className === undefined ? {} : { className: options.className }),
77
+ attrs: { id: `${options.id}-activityrail`, ...options.attrs },
78
+ }),
79
+ entries,
80
+ };
81
+ }
82
+ export function createWorkbenchTitlebarPlans(options) {
83
+ const lights = ['close', 'min', 'max'].map((kind) => createUiDomPlan('span', 'workbench-titlebar-light', {
84
+ state: kind,
85
+ attrs: { id: `${options.id}-light-${kind}`, 'data-light': kind, 'aria-hidden': 'true' },
86
+ }));
87
+ return {
88
+ root: createUiDomPlan('div', 'workbench-titlebar', {
89
+ ...(options.className === undefined ? {} : { className: options.className }),
90
+ attrs: { id: `${options.id}-titlebar`, ...options.attrs },
91
+ }),
92
+ left: createUiDomPlan('div', 'workbench-titlebar-left', {
93
+ attrs: { id: `${options.id}-left` },
94
+ }),
95
+ lights,
96
+ modeChip: createUiDomPlan('span', 'workbench-titlebar-mode-chip', {
97
+ attrs: {
98
+ id: `${options.id}-mode`,
99
+ ...(options.mode === undefined ? {} : { 'data-label': options.mode }),
100
+ },
101
+ }),
102
+ projectSelector: createUiDomPlan('button', 'workbench-titlebar-project-selector', {
103
+ attrs: {
104
+ id: `${options.id}-project`,
105
+ type: 'button',
106
+ ...(options.project === undefined ? {} : { 'data-label': options.project }),
107
+ },
108
+ }),
109
+ right: createUiDomPlan('div', 'workbench-titlebar-right', {
110
+ attrs: { id: `${options.id}-right` },
111
+ }),
112
+ actions: (options.actions ?? []).map((icon, index) => createUiDomPlan('button', 'workbench-titlebar-action', {
113
+ attrs: { id: `${options.id}-action-${index}`, type: 'button', 'data-icon': icon },
114
+ })),
115
+ };
116
+ }
117
+ export function createChatComposerPlans(options) {
118
+ const toolButtons = (options.tools ?? ['plus', 'link', 'image']).map((icon, index) => createUiDomPlan('button', 'chat-composer-tool', {
119
+ attrs: { id: `${options.id}-tool-${index}`, type: 'button', 'data-icon': icon },
120
+ }));
121
+ const actionButtons = (options.actions ?? ['mic']).map((icon, index) => createUiDomPlan('button', 'chat-composer-action', {
122
+ attrs: { id: `${options.id}-action-${index}`, type: 'button', 'data-icon': icon },
123
+ }));
124
+ return {
125
+ root: createUiDomPlan('div', 'chat-composer', {
126
+ ...(options.className === undefined ? {} : { className: options.className }),
127
+ attrs: { id: `${options.id}-composer`, ...options.attrs },
128
+ }),
129
+ input: createUiDomPlan('textarea', 'chat-composer-input', {
130
+ ...(options.disabled === undefined ? {} : { disabled: options.disabled }),
131
+ attrs: {
132
+ id: `${options.id}-input`,
133
+ ...(options.placeholder === undefined ? {} : { placeholder: options.placeholder }),
134
+ rows: '1',
135
+ },
136
+ }),
137
+ toolbar: createUiDomPlan('div', 'chat-composer-toolbar', {
138
+ attrs: { id: `${options.id}-toolbar` },
139
+ }),
140
+ tools: createUiDomPlan('div', 'chat-composer-tools', {
141
+ attrs: { id: `${options.id}-tools` },
142
+ }),
143
+ toolButtons,
144
+ modelSelector: createUiDomPlan('button', 'chat-composer-model', {
145
+ attrs: {
146
+ id: `${options.id}-model`,
147
+ type: 'button',
148
+ ...(options.model === undefined ? {} : { 'data-label': options.model }),
149
+ },
150
+ }),
151
+ actions: createUiDomPlan('div', 'chat-composer-actions', {
152
+ attrs: { id: `${options.id}-actions` },
153
+ }),
154
+ actionButtons,
155
+ };
156
+ }
package/package.json ADDED
@@ -0,0 +1,113 @@
1
+ {
2
+ "name": "@vobs/ui",
3
+ "version": "0.1.0",
4
+ "description": "Optional design tokens, layouts and UI components for vobs.",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "license": "MIT",
10
+ "author": "vobsjs",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/vobsjs/vobs.git",
14
+ "directory": "packages/features/ui"
15
+ },
16
+ "bugs": {
17
+ "url": "https://github.com/vobsjs/vobs/issues"
18
+ },
19
+ "homepage": "https://github.com/vobsjs/vobs#readme",
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "exports": {
24
+ ".": {
25
+ "types": "./dist/index.d.ts",
26
+ "import": "./dist/index.js"
27
+ },
28
+ "./feedback": {
29
+ "types": "./dist/feedback.d.ts",
30
+ "import": "./dist/feedback.js"
31
+ },
32
+ "./app-shell": {
33
+ "types": "./dist/app-shell.d.ts",
34
+ "import": "./dist/app-shell.js"
35
+ },
36
+ "./complex-inputs": {
37
+ "types": "./dist/complex-inputs.d.ts",
38
+ "import": "./dist/complex-inputs.js"
39
+ },
40
+ "./data-display": {
41
+ "types": "./dist/data-display.d.ts",
42
+ "import": "./dist/data-display.js"
43
+ },
44
+ "./icons": {
45
+ "types": "./dist/icons.d.ts",
46
+ "import": "./dist/icons.js"
47
+ },
48
+ "./icons/config": {
49
+ "types": "./dist/icons-config.d.ts",
50
+ "import": "./dist/icons-config.js"
51
+ },
52
+ "./forms": {
53
+ "types": "./dist/forms.d.ts",
54
+ "import": "./dist/forms.js"
55
+ },
56
+ "./overlay": {
57
+ "types": "./dist/overlay.d.ts",
58
+ "import": "./dist/overlay.js"
59
+ },
60
+ "./navigation": {
61
+ "types": "./dist/navigation.d.ts",
62
+ "import": "./dist/navigation.js"
63
+ },
64
+ "./primitives": {
65
+ "types": "./dist/primitives.d.ts",
66
+ "import": "./dist/primitives.js"
67
+ },
68
+ "./locale/en-US": {
69
+ "types": "./dist/locale/en-US.d.ts",
70
+ "import": "./dist/locale/en-US.js"
71
+ },
72
+ "./locale/zh-CN": {
73
+ "types": "./dist/locale/zh-CN.d.ts",
74
+ "import": "./dist/locale/zh-CN.js"
75
+ },
76
+ "./theme": {
77
+ "types": "./dist/theme.d.ts",
78
+ "import": "./dist/theme.js"
79
+ },
80
+ "./tree": {
81
+ "types": "./dist/tree.d.ts",
82
+ "import": "./dist/tree.js"
83
+ },
84
+ "./virtual-list": {
85
+ "types": "./dist/virtual-list.d.ts",
86
+ "import": "./dist/virtual-list.js"
87
+ },
88
+ "./tokens.css": "./dist/tokens.css",
89
+ "./base.css": "./dist/base.css",
90
+ "./components.css": "./dist/components.css",
91
+ "./styles.css": "./dist/styles.css",
92
+ "./package.json": "./package.json"
93
+ },
94
+ "types": "./dist/index.d.ts",
95
+ "module": "./dist/index.js",
96
+ "main": "./dist/index.js",
97
+ "dependencies": {
98
+ "@tanstack/virtual-core": "^3.17.7",
99
+ "@vobs/forms": "0.1.0",
100
+ "@vobs/i18n": "0.1.0",
101
+ "@vobs/icons": "0.1.0",
102
+ "@vobs/runtime-dom": "0.1.0",
103
+ "@vobs/router": "0.1.0",
104
+ "@vobs/server-renderer": "0.1.0",
105
+ "@vobs/reactivity": "0.1.0"
106
+ },
107
+ "sideEffects": [
108
+ "./dist/*.css"
109
+ ],
110
+ "engines": {
111
+ "node": ">=20.19.0"
112
+ }
113
+ }