@omnigrid/style 0.1.1 → 0.1.2

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,20 +1,23 @@
1
1
  # @omnigrid/style
2
2
 
3
- Shared CSS styles for OmniGrid. Provides base styles and CSS variables that all themes extend.
3
+ Required structural CSS for OmniGrid. It provides the layout and component rules;
4
+ color values come from a separate theme package.
4
5
 
5
6
  ## What it provides
6
7
 
7
- - `index.css` — base grid styles, CSS variables for theming, and default class names
8
+ - `index.css` — grid layout and component styles using theme CSS variables
8
9
  - `index.js` — re-exports the CSS for `import` usage
9
10
 
10
11
  ## Usage
11
12
 
12
13
  ```ts
13
- import "@omnigrid/style/index.css";
14
- // or
15
14
  import "@omnigrid/style";
16
15
  ```
17
16
 
17
+ `@omnigrid/react` includes this package automatically. When using another
18
+ adapter, install a theme package as well; for example,
19
+ `@omnigrid/default-theme`.
20
+
18
21
  ## Links
19
22
 
20
23
  - **Source:** https://github.com/KRZK-Apps/omnigrid/tree/main/style
package/dist/index.css CHANGED
@@ -1,256 +1,167 @@
1
- :root {
2
- font-family: system-ui, sans-serif;
3
- color: #182230;
4
- background: #f4f7fb;
5
- }
6
-
7
- .dark {
8
- color: #e8ebe9;
9
- background: #1a1d1e;
10
- }
11
-
12
- * {
13
- box-sizing: border-box;
14
- }
15
- .omnigrid {
16
- border-collapse: collapse;
17
- border: 1px solid #d9e0ea;
18
- scrollbar-gutter: stable;
19
- }
20
-
21
- [role="cell"] {
22
- align-items: center;
23
- background: transparent;
24
- border-bottom: 1px solid #d9e0ea;
25
- border-right: 1px solid #d9e0ea;
26
- display: flex;
27
- padding: 0 12px;
28
- white-space: nowrap;
29
- }
30
-
31
- .dark [role="cell"] {
32
- background: transparent;
33
- border-bottom: 1px solid #3a3f40;
34
- border-right: 1px solid #3a3f40;
35
- color: #e8ebe9;
36
- }
37
-
38
- [role="cell"]:hover {
39
- background: #eef5ff;
40
- }
41
-
42
- .dark [role="cell"]:hover {
43
- background: #2a2f30;
44
- }
45
-
46
- .omnigrid-row:hover [role="cell"] {
47
- background: #eef5ff !important;
48
- }
49
-
50
- .dark .omnigrid-row:hover [role="cell"] {
51
- background: #2a2f30 !important;
52
- }
53
-
54
- .omnigrid-no-row-hover [role="cell"]:hover {
55
- background: unset;
56
- }
57
-
58
- .omnigrid-no-row-hover .omnigrid-row:hover [role="cell"] {
59
- background: unset !important;
60
- }
61
-
62
- .omnigrid-row {
63
- user-select: none;
64
- }
65
-
66
- .omnigrid {
67
- background: #ffffff;
68
- }
69
-
70
- .dark .omnigrid {
71
- background: #1a1d1e;
72
- }
73
-
74
- /* Pinned panes are opaque by default. Cells are transparent, so without a
75
- background the scrollable columns sliding underneath the sticky panes would
76
- be visible through them. Use the same background as the table. */
77
- .omnigrid-pinned-left,
78
- .omnigrid-pinned-right {
79
- background: #ffffff;
80
- }
81
-
82
- .dark .omnigrid-pinned-left,
83
- .dark .omnigrid-pinned-right {
84
- background: #1a1d1e;
85
- }
86
-
87
- .omnigrid-header-row {
88
- background: #e9eef5;
89
- }
90
-
91
- .dark .omnigrid-header-row {
92
- background: #2a2f30;
93
- }
94
-
95
- [role="columnheader"] {
96
- background: #e9eef5;
97
- border-bottom: 1px solid #c5cfdd;
98
- border-right: 1px solid #c5cfdd;
99
- color: #334155;
100
- }
101
-
102
- /* The pinned panes intentionally have NO border: the pinned columns are
103
- positioned so their pixels land exactly on the core-computed offsets, and
104
- the pane boxes are sized to the full pinned width. Any border would shrink
105
- the content box by its width (box-sizing: border-box) while the header-row
106
- and rows-layer inside still span the full border-box width, making the layer
107
- stick out 1px past the pane and creating a phantom horizontal scrollbar
108
- (scrollWidth > clientWidth).
109
-
110
- Separators between the pinned zones and the scrollable zone are drawn by
111
- cell borders instead:
112
- - left edge of the right-pinned block -> the FIRST right-pinned column
113
- gets border-left (below). The scrollable area flex-grows, so the last
114
- scrollable column does NOT touch the right pane; without this border the
115
- block would have no left edge line.
116
- - right edge of the left-pinned block -> the last left-pinned column
117
- already carries border-right from the base [role="cell"] /
118
- [role="columnheader"] rules, which sits exactly on the pane boundary.
119
- A 1px border on a cell extends LEFT inside the pane and can never extend
120
- the container's right edge, so it cannot produce a phantom scrollbar. */
121
-
122
- .omnigrid-pinned-right [role="cell"]:first-child,
123
- .omnigrid-pinned-right [role="columnheader"]:first-child {
124
- border-left: 1px solid #d9e0ea;
125
- }
126
-
127
- .dark .omnigrid-pinned-right [role="cell"]:first-child,
128
- .dark .omnigrid-pinned-right [role="columnheader"]:first-child {
129
- border-left: 1px solid #3a3f40;
130
- }
131
-
132
- /* ------------------------------------------------------------------ */
133
- /* Slot Architecture */
134
- /* ------------------------------------------------------------------ */
135
-
136
- .omnigrid-layout {
137
- display: flex;
138
- flex-direction: column;
139
- min-width: 0;
140
- }
141
-
142
- .omnigrid-layout-body {
143
- display: flex;
144
- flex: 1 1 auto;
145
- min-height: 0;
146
- min-width: 0;
147
- }
148
-
149
- .omnigrid-slot {
150
- display: flex;
151
- }
152
-
153
- .omnigrid-slot-top,
154
- .omnigrid-slot-bottom {
155
- width: 100%;
156
- padding: 4px 8px;
157
- background: #f4f7fb;
158
- }
159
-
160
- .dark .omnigrid-slot-top,
161
- .dark .omnigrid-slot-bottom {
162
- background: #1a1d1e;
163
- }
164
-
165
- .omnigrid-slot-left,
166
- .omnigrid-slot-right {
167
- flex-shrink: 0;
168
- padding: 0 8px;
169
- background: #f4f7fb;
170
- align-self: stretch;
171
- }
172
-
173
- .dark .omnigrid-slot-left,
174
- .dark .omnigrid-slot-right {
175
- background: #1a1d1e;
176
- }
177
-
178
- .omnigrid-slot-item-group {
179
- display: flex;
180
- gap: 8px;
181
- }
182
-
183
- .omnigrid-slot-pos-center {
184
- justify-content: center;
185
- }
186
-
187
- .omnigrid-slot-pos-end {
188
- justify-content: flex-end;
189
- }
190
-
191
- .omnigrid-slot-item {
192
- display: flex;
193
- align-items: center;
194
- }
195
-
196
- /* Headless pager (PaginationPlugin). */
197
- .omnigrid-pagination {
198
- align-items: center;
199
- display: flex;
200
- gap: 8px;
201
- }
202
-
203
- .omnigrid-pagination-btn {
204
- background: #ffffff;
205
- border: 1px solid #c5cfdd;
206
- border-radius: 4px;
207
- color: #334155;
208
- cursor: pointer;
209
- font-size: 12px;
210
- line-height: 1.4;
211
- padding: 3px 10px;
212
- }
213
-
214
- .omnigrid-pagination-btn:disabled {
215
- cursor: default;
216
- opacity: 0.5;
217
- }
218
-
219
- .dark .omnigrid-pagination-btn {
220
- background: #2a2f30;
221
- border-color: #3a3f40;
222
- color: #e8ebe9;
223
- }
224
-
225
- .dark [role="columnheader"] {
226
- background: #2a2f30;
227
- border-bottom: 1px solid #3a3f40;
228
- border-right: 1px solid #3a3f40;
229
- color: #e8ebe9;
230
- }
231
-
232
- .omnigrid-sort-indicator {
233
- font-size: 10px;
234
- }
235
-
236
- .omnigrid-header-label {
237
- overflow: hidden;
238
- text-overflow: ellipsis;
239
- }
240
-
241
- .omnigrid-header-tools {
242
- align-items: center;
243
- display: flex;
244
- flex-shrink: 0;
245
- gap: 6px;
246
- margin-left: auto;
247
- }
248
-
249
- .omnigrid-header-cell[data-sortable="true"] {
250
- cursor: pointer;
251
- }
252
-
253
- .omnigrid:not(:has(.omnigrid-pinned-right)) .omnigrid-scrollable [role="columnheader"]:last-child,
254
- .omnigrid-pinned-right [role="columnheader"]:last-child {
255
- border-right: 0;
256
- }
1
+ * {
2
+ box-sizing: border-box;
3
+ }
4
+
5
+ .omnigrid {
6
+ background: var(--omnigrid-grid-background);
7
+ border-collapse: collapse;
8
+ border: 1px solid var(--omnigrid-grid-border);
9
+ scrollbar-gutter: stable;
10
+ }
11
+
12
+ [role="cell"] {
13
+ align-items: center;
14
+ background: var(--omnigrid-cell-background);
15
+ border-bottom: 1px solid var(--omnigrid-cell-border);
16
+ border-right: 1px solid var(--omnigrid-cell-border);
17
+ color: var(--omnigrid-cell-color);
18
+ display: flex;
19
+ padding: 0 12px;
20
+ white-space: nowrap;
21
+ }
22
+
23
+ [role="cell"]:hover {
24
+ background: var(--omnigrid-cell-hover-background);
25
+ }
26
+
27
+ .omnigrid-row:hover [role="cell"] {
28
+ background: var(--omnigrid-cell-hover-background) !important;
29
+ }
30
+
31
+ .omnigrid-no-row-hover [role="cell"]:hover {
32
+ background: unset;
33
+ }
34
+
35
+ .omnigrid-no-row-hover .omnigrid-row:hover [role="cell"] {
36
+ background: unset !important;
37
+ }
38
+
39
+ .omnigrid-row {
40
+ user-select: none;
41
+ }
42
+
43
+ /* Pinned panes are opaque so the scrollable columns underneath do not show through. */
44
+ .omnigrid-pinned-left,
45
+ .omnigrid-pinned-right {
46
+ background: var(--omnigrid-grid-background);
47
+ }
48
+
49
+ .omnigrid-header-row {
50
+ background: var(--omnigrid-header-background);
51
+ }
52
+
53
+ [role="columnheader"] {
54
+ background: var(--omnigrid-header-background);
55
+ border-bottom: 1px solid var(--omnigrid-header-border);
56
+ border-right: 1px solid var(--omnigrid-header-border);
57
+ color: var(--omnigrid-header-color);
58
+ }
59
+
60
+ /* Pinned panes have no border so their contents stay aligned to core-computed offsets. */
61
+ .omnigrid-pinned-right [role="cell"]:first-child,
62
+ .omnigrid-pinned-right [role="columnheader"]:first-child {
63
+ border-left: 1px solid var(--omnigrid-grid-border);
64
+ }
65
+
66
+ /* ------------------------------------------------------------------ */
67
+ /* Slot Architecture */
68
+ /* ------------------------------------------------------------------ */
69
+
70
+ .omnigrid-layout {
71
+ display: flex;
72
+ flex-direction: column;
73
+ min-width: 0;
74
+ }
75
+
76
+ .omnigrid-layout-body {
77
+ display: flex;
78
+ flex: 1 1 auto;
79
+ min-height: 0;
80
+ min-width: 0;
81
+ }
82
+
83
+ .omnigrid-slot {
84
+ display: flex;
85
+ }
86
+
87
+ .omnigrid-slot-top,
88
+ .omnigrid-slot-bottom {
89
+ width: 100%;
90
+ padding: 4px 8px;
91
+ background: var(--omnigrid-slot-background);
92
+ }
93
+
94
+ .omnigrid-slot-left,
95
+ .omnigrid-slot-right {
96
+ flex-shrink: 0;
97
+ padding: 0 8px;
98
+ background: var(--omnigrid-slot-background);
99
+ align-self: stretch;
100
+ }
101
+
102
+ .omnigrid-slot-item-group {
103
+ display: flex;
104
+ gap: 8px;
105
+ }
106
+
107
+ .omnigrid-slot-pos-center {
108
+ justify-content: center;
109
+ }
110
+
111
+ .omnigrid-slot-pos-end {
112
+ justify-content: flex-end;
113
+ }
114
+
115
+ .omnigrid-slot-item {
116
+ display: flex;
117
+ align-items: center;
118
+ }
119
+
120
+ /* Headless pager (PaginationPlugin). */
121
+ .omnigrid-pagination {
122
+ align-items: center;
123
+ display: flex;
124
+ gap: 8px;
125
+ }
126
+
127
+ .omnigrid-pagination-btn {
128
+ background: var(--omnigrid-button-background);
129
+ border: 1px solid var(--omnigrid-button-border);
130
+ border-radius: 4px;
131
+ color: var(--omnigrid-button-color);
132
+ cursor: pointer;
133
+ font-size: 12px;
134
+ line-height: 1.4;
135
+ padding: 3px 10px;
136
+ }
137
+
138
+ .omnigrid-pagination-btn:disabled {
139
+ cursor: default;
140
+ opacity: 0.5;
141
+ }
142
+
143
+ .omnigrid-sort-indicator {
144
+ font-size: 10px;
145
+ }
146
+
147
+ .omnigrid-header-label {
148
+ overflow: hidden;
149
+ text-overflow: ellipsis;
150
+ }
151
+
152
+ .omnigrid-header-tools {
153
+ align-items: center;
154
+ display: flex;
155
+ flex-shrink: 0;
156
+ gap: 6px;
157
+ margin-left: auto;
158
+ }
159
+
160
+ .omnigrid-header-cell[data-sortable="true"] {
161
+ cursor: pointer;
162
+ }
163
+
164
+ .omnigrid:not(:has(.omnigrid-pinned-right)) .omnigrid-scrollable [role="columnheader"]:last-child,
165
+ .omnigrid-pinned-right [role="columnheader"]:last-child {
166
+ border-right: 0;
167
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,22 +1,35 @@
1
1
  {
2
2
  "name": "@omnigrid/style",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Shared styles for OmniGrid",
5
- "keywords": ["omnigrid", "grid", "table", "styles", "css"],
5
+ "keywords": [
6
+ "omnigrid",
7
+ "grid",
8
+ "table",
9
+ "styles",
10
+ "css"
11
+ ],
6
12
  "repository": {
7
13
  "type": "git",
8
14
  "url": "https://github.com/KRZK-Apps/omnigrid.git",
9
15
  "directory": "style"
10
16
  },
11
17
  "homepage": "https://github.com/KRZK-Apps/omnigrid/tree/main/style#readme",
12
- "bugs": { "url": "https://github.com/KRZK-Apps/omnigrid/issues" },
18
+ "bugs": {
19
+ "url": "https://github.com/KRZK-Apps/omnigrid/issues"
20
+ },
13
21
  "license": "MIT",
22
+ "type": "module",
14
23
  "main": "dist/index.js",
24
+ "types": "dist/index.d.ts",
15
25
  "files": [
16
26
  "dist"
17
27
  ],
18
28
  "exports": {
19
- ".": "./dist/index.js",
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.js"
32
+ },
20
33
  "./index.css": "./dist/index.css"
21
34
  },
22
35
  "scripts": {