@ganttloom/gantt-core 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.
@@ -0,0 +1,167 @@
1
+ /*
2
+ * Color fallbacks below are used only until GanttChart sets its resolved
3
+ * theme as inline --gantt-* custom properties on .gantt-root (which happens
4
+ * on first render and wins once present). They exist so the chart still
5
+ * looks correct in dark mode before JS runs, and so a consumer can theme
6
+ * purely via CSS (no JS theme object) by overriding these variables directly.
7
+ */
8
+ .gantt-root {
9
+ --gantt-background-color: #ffffff;
10
+ --gantt-text-color: #1f2937;
11
+ --gantt-grid-color: #e5e7eb;
12
+ --gantt-weekend-color: #f3f4f6;
13
+ --gantt-today-color: #ef4444;
14
+ --gantt-bar-color: #3b82f6;
15
+ --gantt-bar-progress-color: #2563eb;
16
+ --gantt-group-bar-color: #64748b;
17
+ --gantt-link-color: #94a3b8;
18
+ --gantt-critical-color: #dc2626;
19
+ --gantt-baseline-color: #9ca3af;
20
+ --gantt-deadline-color: #f59e0b;
21
+ --gantt-marker-color: #8b5cf6;
22
+ --gantt-selection-color: #0ea5e9;
23
+
24
+ display: flex;
25
+ flex-direction: row;
26
+ width: 100%;
27
+ height: 100%;
28
+ background: var(--gantt-background-color);
29
+ color: var(--gantt-text-color);
30
+ font-family: var(--gantt-font-family, sans-serif);
31
+ font-size: var(--gantt-font-size, 12px);
32
+ border: 1px solid var(--gantt-grid-color);
33
+ box-sizing: border-box;
34
+ overflow: hidden;
35
+ }
36
+
37
+ @media (prefers-color-scheme: dark) {
38
+ .gantt-root:not([data-gantt-theme="light"]) {
39
+ --gantt-background-color: #181c24;
40
+ --gantt-text-color: #e5e7eb;
41
+ --gantt-grid-color: #2d3341;
42
+ --gantt-weekend-color: #252a35;
43
+ --gantt-today-color: #f87171;
44
+ --gantt-bar-color: #60a5fa;
45
+ --gantt-bar-progress-color: #3b82f6;
46
+ --gantt-group-bar-color: #94a3b8;
47
+ --gantt-link-color: #64748b;
48
+ --gantt-critical-color: #f87171;
49
+ --gantt-baseline-color: #4b5563;
50
+ --gantt-deadline-color: #fbbf24;
51
+ --gantt-marker-color: #a78bfa;
52
+ --gantt-selection-color: #38bdf8;
53
+ }
54
+ }
55
+
56
+ .gantt-root[data-gantt-theme="dark"] {
57
+ --gantt-background-color: #181c24;
58
+ --gantt-text-color: #e5e7eb;
59
+ --gantt-grid-color: #2d3341;
60
+ --gantt-weekend-color: #252a35;
61
+ --gantt-today-color: #f87171;
62
+ --gantt-bar-color: #60a5fa;
63
+ --gantt-bar-progress-color: #3b82f6;
64
+ --gantt-group-bar-color: #94a3b8;
65
+ --gantt-link-color: #64748b;
66
+ --gantt-critical-color: #f87171;
67
+ --gantt-baseline-color: #4b5563;
68
+ --gantt-deadline-color: #fbbf24;
69
+ --gantt-marker-color: #a78bfa;
70
+ --gantt-selection-color: #38bdf8;
71
+ }
72
+
73
+ .gantt-grid-panel {
74
+ flex: 0 0 var(--gantt-grid-panel-width, 260px);
75
+ width: var(--gantt-grid-panel-width, 260px);
76
+ border-right: 1px solid var(--gantt-grid-color, #e5e7eb);
77
+ overflow-y: auto;
78
+ overflow-x: hidden;
79
+ position: relative;
80
+ background: var(--gantt-background-color, #ffffff);
81
+ }
82
+
83
+ .gantt-grid-header-row {
84
+ display: flex;
85
+ align-items: center;
86
+ position: sticky;
87
+ top: 0;
88
+ background: var(--gantt-background-color, #ffffff);
89
+ border-bottom: 1px solid var(--gantt-grid-color, #e5e7eb);
90
+ font-weight: 600;
91
+ z-index: 2;
92
+ }
93
+
94
+ .gantt-grid-header-cell,
95
+ .gantt-grid-cell {
96
+ padding: 0 8px;
97
+ white-space: nowrap;
98
+ overflow: hidden;
99
+ text-overflow: ellipsis;
100
+ flex: 1 1 auto;
101
+ display: flex;
102
+ align-items: center;
103
+ }
104
+
105
+ .gantt-grid-body {
106
+ position: relative;
107
+ }
108
+
109
+ .gantt-grid-row {
110
+ display: flex;
111
+ align-items: stretch;
112
+ width: 100%;
113
+ border-bottom: 1px solid var(--gantt-grid-color, #e5e7eb);
114
+ box-sizing: border-box;
115
+ }
116
+
117
+ .gantt-grid-row:hover {
118
+ background: color-mix(in srgb, var(--gantt-grid-color, #e5e7eb) 40%, transparent);
119
+ }
120
+
121
+ .gantt-indent {
122
+ display: inline-block;
123
+ flex: 0 0 auto;
124
+ }
125
+
126
+ .gantt-toggle {
127
+ border: none;
128
+ background: transparent;
129
+ cursor: pointer;
130
+ color: inherit;
131
+ font-size: inherit;
132
+ padding: 0 4px;
133
+ flex: 0 0 auto;
134
+ }
135
+
136
+ .gantt-rename-input {
137
+ width: 100%;
138
+ font: inherit;
139
+ color: inherit;
140
+ border: 1px solid var(--gantt-bar-color, #3b82f6);
141
+ border-radius: 2px;
142
+ padding: 0 4px;
143
+ box-sizing: border-box;
144
+ }
145
+
146
+ .gantt-timeline-scroll {
147
+ flex: 1 1 auto;
148
+ overflow: auto;
149
+ position: relative;
150
+ }
151
+
152
+ .gantt-svg {
153
+ display: block;
154
+ }
155
+
156
+ .gantt-bar rect {
157
+ transition: fill 0.15s ease;
158
+ }
159
+
160
+ .gantt-bar:focus {
161
+ outline: 2px solid var(--gantt-bar-color, #3b82f6);
162
+ outline-offset: 2px;
163
+ }
164
+
165
+ .gantt-temp-link {
166
+ pointer-events: none;
167
+ }
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@ganttloom/gantt-core",
3
+ "version": "0.2.0",
4
+ "description": "Framework-agnostic, fully customizable Gantt chart engine: grouping, drag-drop, dependency linking, expand/collapse, theming.",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ },
15
+ "./styles.css": "./dist/styles.css"
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "sideEffects": [
21
+ "*.css"
22
+ ],
23
+ "keywords": [
24
+ "gantt",
25
+ "chart",
26
+ "gantt-chart",
27
+ "scheduling",
28
+ "timeline",
29
+ "project-management"
30
+ ],
31
+ "license": "MIT",
32
+ "author": "Santhoshkumar Hariharan",
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/santhoshkumarhari/ganttLoom.git",
36
+ "directory": "packages/gantt-core"
37
+ },
38
+ "homepage": "https://github.com/santhoshkumarhari/ganttLoom/tree/master/packages/gantt-core#readme",
39
+ "bugs": "https://github.com/santhoshkumarhari/ganttLoom/issues",
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "devDependencies": {
44
+ "tsup": "^8.3.5",
45
+ "typescript": "^5.7.2",
46
+ "vitest": "^2.1.8",
47
+ "cpy-cli": "^5.0.0"
48
+ },
49
+ "scripts": {
50
+ "build": "tsup src/index.ts --format esm,cjs --dts --sourcemap --clean && cpy src/styles.css dist --flat",
51
+ "dev": "tsup src/index.ts --format esm,cjs --dts --watch",
52
+ "typecheck": "tsc --noEmit -p tsconfig.json",
53
+ "test": "vitest run"
54
+ }
55
+ }