@nxgt/material 1.0.2 → 1.0.4

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/dist/styles.css CHANGED
@@ -162,6 +162,19 @@
162
162
  grid-column-start: 1;
163
163
  }
164
164
 
165
+ @utility h-fill {
166
+ height: -webkit-fill-available;
167
+ }
168
+
169
+ @utility w-fill {
170
+ width: -webkit-fill-available;
171
+ }
172
+
173
+ @utility size-fill {
174
+ height: -webkit-fill-available;
175
+ width: -webkit-fill-available;
176
+ }
177
+
165
178
  @utility dropdown-mark {
166
179
  position: absolute;
167
180
  width: 1rem;
package/lib/styles.css ADDED
@@ -0,0 +1,468 @@
1
+ @import "tailwindcss";
2
+ @import "tw-animate-css";
3
+
4
+ @custom-variant dark (
5
+ &:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *)
6
+ );
7
+
8
+ :root {
9
+ --radius: 0.625rem;
10
+ --background: oklch(1 0 0);
11
+ --foreground: oklch(0.14 0.036 258.53);
12
+ --card: oklch(1 0 0);
13
+ --card-foreground: oklch(0.129 0.042 264.695);
14
+ --strix: oklch(45.91% 0.1864 310.75);
15
+ --popover: oklch(1 0 0);
16
+ --popover-foreground: oklch(0.129 0.042 264.695);
17
+ --primary: oklch(46% 0.1135 276.35);
18
+ --primary-foreground: oklch(0.984 0.003 247.858);
19
+ --secondary: oklch(56.67% 0.1135 245.65);
20
+ --secondary-foreground: oklch(0.984 0.003 247.858);
21
+ --muted: oklch(0.968 0.007 247.896);
22
+ --muted-foreground: oklch(0.554 0.046 257.417);
23
+ --tooltip: oklch(0.446 0.043 257.281);
24
+ --tooltip-foreground: oklch(1 0 0);
25
+ --accent: oklch(0.9182 0.0077 228.86);
26
+ --accent-foreground: oklch(0.216 0.006 56.043);
27
+ --error: oklch(0.577 0.245 27.325);
28
+ --error-foreground: oklch(0.984 0.003 247.858);
29
+ --success: oklch(0.6 0.118 184.704);
30
+ --success-foreground: oklch(0.984 0.003 247.858);
31
+ --info: oklch(0.707 0.165 254.624);
32
+ --info-foreground: oklch(0.984 0.003 247.858);
33
+ --warning: oklch(0.646 0.222 41.116);
34
+ --warning-foreground: oklch(0.984 0.003 247.858);
35
+ --destructive: oklch(0.577 0.245 27.325);
36
+ --border: oklch(0.929 0.013 255.508);
37
+ --input: oklch(0.929 0.013 255.508);
38
+ --ring: oklch(0.704 0.04 256.788);
39
+ --chart-1: oklch(0.646 0.222 41.116);
40
+ --chart-2: oklch(0.6 0.118 184.704);
41
+ --chart-3: oklch(0.398 0.07 227.392);
42
+ --chart-4: oklch(0.828 0.189 84.429);
43
+ --chart-5: oklch(0.769 0.188 70.08);
44
+ --sidebar: oklch(0.984 0.003 247.858);
45
+ --sidebar-foreground: oklch(0.129 0.042 264.695);
46
+ --sidebar-primary: oklch(0.208 0.042 265.755);
47
+ --sidebar-primary-foreground: oklch(0.984 0.003 247.858);
48
+ --sidebar-accent: oklch(0.968 0.007 247.896);
49
+ --sidebar-accent-foreground: oklch(0.208 0.042 265.755);
50
+ --sidebar-border: oklch(0.929 0.013 255.508);
51
+ --sidebar-ring: oklch(0.704 0.04 256.788);
52
+ }
53
+
54
+ .dark,
55
+ [data-theme="dark"] {
56
+ --background: oklch(0.14 0.036 258.53);
57
+ --foreground: oklch(0.984 0.003 247.858);
58
+ --card: oklch(0.208 0.042 265.755);
59
+ --card-foreground: oklch(0.984 0.003 247.858);
60
+ --popover: oklch(0.208 0.042 265.755);
61
+ --popover-foreground: oklch(0.984 0.003 247.858);
62
+ --primary: oklch(46% 0.1135 276.35);
63
+ --primary-foreground: oklch(0.984 0.003 247.858);
64
+ --secondary: oklch(56.67% 0.1135 245.65);
65
+ --secondary-foreground: oklch(0.984 0.003 247.858);
66
+ --muted: oklch(0.968 0.007 247.896);
67
+ --muted-foreground: oklch(0.554 0.046 257.417);
68
+ --tooltip: oklch(0.929 0.013 255.508);
69
+ --tooltip-foreground: oklch(0.446 0.043 257.281);
70
+ --accent: oklch(0.268 0.007 34.298);
71
+ --accent-foreground: oklch(0.985 0.001 106.423);
72
+ --error: oklch(0.577 0.245 27.325);
73
+ --error-foreground: oklch(0.984 0.003 247.858);
74
+ --destructive: oklch(0.704 0.191 22.216);
75
+ --border: oklch(1 0 0 / 10%);
76
+ --input: oklch(1 0 0 / 15%);
77
+ --ring: oklch(0.551 0.027 264.364);
78
+ --chart-1: oklch(0.488 0.243 264.376);
79
+ --chart-2: oklch(0.696 0.17 162.48);
80
+ --chart-3: oklch(0.769 0.188 70.08);
81
+ --chart-4: oklch(0.627 0.265 303.9);
82
+ --chart-5: oklch(0.645 0.246 16.439);
83
+ --sidebar: oklch(0.208 0.042 265.755);
84
+ --sidebar-foreground: oklch(0.984 0.003 247.858);
85
+ --sidebar-primary: oklch(0.488 0.243 264.376);
86
+ --sidebar-primary-foreground: oklch(0.984 0.003 247.858);
87
+ --sidebar-accent: oklch(0.279 0.041 260.031);
88
+ --sidebar-accent-foreground: oklch(0.984 0.003 247.858);
89
+ --sidebar-border: oklch(1 0 0 / 10%);
90
+ --sidebar-ring: oklch(0.551 0.027 264.364);
91
+ }
92
+
93
+ @theme {
94
+ --radius-sm: calc(var(--radius) - 4px);
95
+ --radius-md: calc(var(--radius) - 2px);
96
+ --radius-lg: var(--radius);
97
+ --radius-xl: calc(var(--radius) + 4px);
98
+
99
+ --color-paper: --alpha(var(--primary) / 0.5%);
100
+ --color-strix: var(--strix);
101
+ --color-background: var(--background);
102
+ --color-background-paper: --alpha(var(--primary) / 5%);
103
+ --color-background-light: --alpha(var(--background) / 30%);
104
+ --color-foreground: var(--foreground);
105
+ --color-card: var(--card);
106
+ --color-card-foreground: var(--card-foreground);
107
+ --color-popover: var(--popover);
108
+ --color-popover-foreground: var(--popover-foreground);
109
+ --color-primary: var(--primary);
110
+ --color-primary-foreground: var(--primary-foreground);
111
+ --color-primary-container: --alpha(var(--primary-foreground) / 20%);
112
+ --color-secondary: var(--secondary);
113
+ --color-secondary-foreground: var(--secondary-foreground);
114
+ --color-secondary-container: --alpha(var(--secondary-foreground) / 20%);
115
+ --color-muted: var(--muted);
116
+ --color-muted-foreground: var(--muted-foreground);
117
+ --color-tooltip: var(--tooltip);
118
+ --color-tooltip-foreground: var(--tooltip-foreground);
119
+ --color-accent: var(--accent);
120
+ --color-accent-foreground: var(--accent-foreground);
121
+ --color-accent-container: --alpha(var(--accent-foreground) / 20%);
122
+ --color-error: var(--error);
123
+ --color-error-foreground: var(--error-foreground);
124
+ --color-error-container: --alpha(var(--error-foreground) / 20%);
125
+ --color-success: var(--success);
126
+ --color-success-foreground: var(--success-foreground);
127
+ --color-info: var(--info);
128
+ --color-info-foreground: var(--info-foreground);
129
+ --color-warning: var(--warning);
130
+ --color-warning-foreground: var(--warning-foreground);
131
+ --color-destructive: var(--destructive);
132
+ --color-border: var(--border);
133
+ --color-input: var(--input);
134
+ --color-ring: var(--ring);
135
+ --color-chart-1: var(--chart-1);
136
+ --color-chart-2: var(--chart-2);
137
+ --color-chart-3: var(--chart-3);
138
+ --color-chart-4: var(--chart-4);
139
+ --color-chart-5: var(--chart-5);
140
+ --color-sidebar: var(--sidebar);
141
+ --color-sidebar-foreground: var(--sidebar-foreground);
142
+ --color-sidebar-primary: var(--sidebar-primary);
143
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
144
+ --color-sidebar-accent: var(--sidebar-accent);
145
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
146
+ --color-sidebar-border: var(--sidebar-border);
147
+ --color-sidebar-ring: var(--sidebar-ring);
148
+ }
149
+
150
+ @utility center {
151
+ justify-content: center;
152
+ align-items: center;
153
+ }
154
+
155
+ @utility size-lv {
156
+ width: 100lvw;
157
+ height: 100lvh;
158
+ }
159
+
160
+ @utility col-start-full {
161
+ grid-column: 1 / -1;
162
+ grid-column-start: 1;
163
+ }
164
+
165
+ @utility h-fill {
166
+ height: -webkit-fill-available;
167
+ }
168
+
169
+ @utility w-fill {
170
+ width: -webkit-fill-available;
171
+ }
172
+
173
+ @utility size-fill {
174
+ height: -webkit-fill-available;
175
+ width: -webkit-fill-available;
176
+ }
177
+
178
+ @utility dropdown-mark {
179
+ position: absolute;
180
+ width: 1rem;
181
+ height: 1rem;
182
+ right: -0.1875rem;
183
+ bottom: -0.1875rem;
184
+ transform: rotate(-45deg) scale(0.75);
185
+ }
186
+
187
+ @layer base {
188
+ * {
189
+ @apply border-border outline-ring/50 selection:bg-primary selection:text-primary-foreground;
190
+ &::-webkit-scrollbar {
191
+ @apply w-1 gap-4 h-1 md:w-1.5 md:h-1.5 cursor-pointer;
192
+ }
193
+ &::-webkit-scrollbar-track {
194
+ @apply rounded bg-primary/20;
195
+ }
196
+ &::-webkit-scrollbar-thumb {
197
+ @apply rounded bg-muted-foreground;
198
+ }
199
+
200
+ input::-webkit-outer-spin-button,
201
+ ::-webkit-inner-spin-button {
202
+ -webkit-appearance: none;
203
+ margin: 0;
204
+ }
205
+ }
206
+ body {
207
+ @apply bg-background text-foreground;
208
+
209
+ input[type="number"] {
210
+ -moz-appearance: textfield;
211
+ }
212
+
213
+ [data-slot="icon"] {
214
+ @apply dark:fill-foreground;
215
+ }
216
+
217
+ h1 {
218
+ font-size: var(--text-2xl);
219
+ font-weight: var(--font-weight-medium);
220
+ }
221
+ h2 {
222
+ font-size: var(--text-xl);
223
+ font-weight: var(--font-weight-medium);
224
+ }
225
+ h3 {
226
+ font-size: var(--text-lg);
227
+ font-weight: var(--font-weight-medium);
228
+ }
229
+ h4 {
230
+ font-size: var(--text-base);
231
+ font-weight: var(--font-weight-medium);
232
+ }
233
+ h5 {
234
+ font-size: var(--text-sm);
235
+ font-weight: var(--font-weight-medium);
236
+ }
237
+ h6 {
238
+ font-size: var(--text-xs);
239
+ font-weight: var(--font-weight-medium);
240
+ }
241
+ a:not(:has(> button)) {
242
+ @apply focus:underline underline-offset-4 hover:underline cursor-pointer;
243
+ @apply text-info [&_svg]:data-[slot=icon]:text-info hover:bg-info/10 active:bg-info/5 focus:bg-info/15;
244
+ }
245
+
246
+ code {
247
+ @apply rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono mx-0.5;
248
+ }
249
+
250
+ blockquote {
251
+ @apply border-l-2 border-primary/40 pl-4 italic text-muted-foreground my-1;
252
+ }
253
+ pre {
254
+ @apply bg-muted rounded p-4 overflow-x-auto my-1;
255
+ code {
256
+ @apply text-sm;
257
+ }
258
+ }
259
+
260
+ ul li p,
261
+ ol li p {
262
+ display: inline;
263
+ }
264
+
265
+ ul[data-type="taskList"] {
266
+ list-style-type: disc;
267
+ }
268
+ ol[data-type="taskList"] {
269
+ list-style-type: decimal;
270
+ }
271
+
272
+ ul[data-type="taskList"] li {
273
+ @apply flex gap-2 items-center;
274
+ }
275
+
276
+ ul,
277
+ ol {
278
+ @apply list-inside marker:text-muted-foreground;
279
+ }
280
+
281
+ [data-type="emoji"] {
282
+ img {
283
+ @apply size-4;
284
+ }
285
+ }
286
+
287
+ input[type="checkbox"] {
288
+ display: grid;
289
+ place-content: center;
290
+ -webkit-appearance: none;
291
+ appearance: none;
292
+ font: inherit;
293
+ color: ---value(--color-primary);
294
+ width: 1.05em;
295
+ height: 1.05em;
296
+ border: 0.13em solid var(--muted-foreground);
297
+ border-radius: 0.15em;
298
+ }
299
+ input[type="checkbox"]::before {
300
+ content: "";
301
+ width: 0.55em;
302
+ height: 0.55em;
303
+ transform: scale(0);
304
+ transition: 120ms transform ease-in-out;
305
+ box-shadow: inset 1em 1em var(--color-primary);
306
+ }
307
+ input[type="checkbox"]:checked::before {
308
+ transform: scale(1);
309
+ }
310
+ input[type="checkbox"]:indeterminate::before {
311
+ height: 0.15em;
312
+ }
313
+
314
+ table {
315
+ overflow: hidden;
316
+ table-layout: fixed;
317
+ @apply border-collapse w-full overflow-hidden rounded;
318
+
319
+ tr {
320
+ @apply even:bg-primary/5;
321
+ }
322
+
323
+ td,
324
+ th {
325
+ @apply border-0 p-1 py-2;
326
+ }
327
+
328
+ th {
329
+ @apply bg-primary/15 text-left text-muted-foreground dark:text-primary-foreground;
330
+ }
331
+ }
332
+
333
+ .tiptap {
334
+ ul li p,
335
+ ol li p {
336
+ display: inline;
337
+ }
338
+
339
+ ul:not([data-type="taskList"]) {
340
+ list-style-type: disc;
341
+ }
342
+ ol {
343
+ list-style-type: decimal;
344
+ }
345
+
346
+ ul:not([data-type="taskList"]),
347
+ ol {
348
+ @apply list-inside marker:text-muted-foreground;
349
+ }
350
+
351
+ ul[data-type="taskList"] li {
352
+ @apply flex gap-2 items-center;
353
+ }
354
+
355
+ :first-child {
356
+ margin-top: 0;
357
+ }
358
+
359
+ table {
360
+ /* Override the global `body table { width: w-full }` base rule
361
+ (see @layer base above) — it fights TipTap's resizable colgroup
362
+ widths, which only get applied as an inline table width once
363
+ every column has an explicit pixel width. Letting the table size
364
+ itself (still table-layout: fixed) makes resizing and
365
+ center/right alignment actually visible. */
366
+ width: auto;
367
+
368
+ .selectedCell {
369
+ @apply bg-primary/20;
370
+ }
371
+
372
+ .column-resize-handle {
373
+ background-color: var(--color-primary);
374
+ bottom: -2px;
375
+ pointer-events: none;
376
+ position: absolute;
377
+ right: -2px;
378
+ top: 0;
379
+ width: 4px;
380
+ }
381
+
382
+ &[data-table-caption]::before {
383
+ content: attr(data-table-caption);
384
+ display: block;
385
+ margin-bottom: 0.5rem;
386
+ @apply text-sm text-muted-foreground text-center;
387
+ }
388
+ }
389
+
390
+ .tableWrapper {
391
+ margin: 1.5rem 0;
392
+ overflow-x: auto;
393
+
394
+ &:has(table[data-table-align="center"]) {
395
+ width: fit-content;
396
+ margin-inline: auto;
397
+ }
398
+
399
+ &:has(table[data-table-align="right"]) {
400
+ width: fit-content;
401
+ margin-left: auto;
402
+ margin-right: 0;
403
+ }
404
+ }
405
+
406
+ &.resize-cursor {
407
+ cursor: col-resize;
408
+ }
409
+
410
+ .is-empty::before {
411
+ content: attr(data-placeholder);
412
+ float: left;
413
+ height: 0;
414
+ pointer-events: none;
415
+ @apply text-muted-foreground;
416
+ }
417
+
418
+ .has-focus {
419
+ @apply bg-accent/40 rounded;
420
+ }
421
+ }
422
+ }
423
+
424
+ .form-grid-layout {
425
+ @apply relative flex flex-col gap-2 @container;
426
+ [data-slot="form-fields"] {
427
+ @apply grid @2xl:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-2 bg-background/80 p-4 place-items-start overflow-auto;
428
+
429
+ [data-slot="separator"] {
430
+ @apply col-start-full;
431
+ }
432
+
433
+ [data-slot*="text-field"],
434
+ [data-slot*="autocomplete-field"][data-mode="single"],
435
+ [data-slot*="currency-form-field"],
436
+ [data-slot*="time-field"],
437
+ [data-slot*="image-field"],
438
+ [data-slot*="select-field"] {
439
+ @apply w-full;
440
+ }
441
+
442
+ [data-slot="switch-field"],
443
+ [data-slot="textarea-field"],
444
+ [data-slot="autocomplete-field"][data-mode="multiple"],
445
+ [data-slot="select-chip-field"],
446
+ [data-slot="file-picker-field"] {
447
+ @apply col-start-full @6xl:col-span-2;
448
+ }
449
+
450
+ [data-slot="files-form-field"],
451
+ [data-slot="rich-text-editor"] {
452
+ @apply col-start-full;
453
+ }
454
+ }
455
+ [data-slot="form-actions"] {
456
+ @apply flex w-full justify-end gap-2 bottom-2 p-4 max-sm:*:flex-1;
457
+ }
458
+ }
459
+
460
+ .form-grid-layout,
461
+ [data-slot="data-table"] {
462
+ @apply max-h-[calc(100lvh-184px)] md:max-h-[calc(100lvh-242px)] lg:max-h-[calc(100lvh-280px)];
463
+ }
464
+
465
+ [data-slot="table-wrapper"] {
466
+ @apply max-h-[calc(100vh-432px)] md:max-h-[calc(100vh-490px)] lg:max-h-[calc(100vh-528px)];
467
+ }
468
+ }
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@nxgt/material",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
7
7
  "!dist/assets",
8
+ "lib/styles.css",
8
9
  "README.md",
9
10
  "package.json"
10
11
  ],
@@ -51,7 +52,8 @@
51
52
  "require": "./dist/types.js"
52
53
  },
53
54
  "./styles.css": {
54
- "style": "./dist/styles.css"
55
+ "style": "./lib/styles.css",
56
+ "default": "./lib/styles.css"
55
57
  }
56
58
  },
57
59
  "module": "./dist/main.js",
@@ -59,7 +61,7 @@
59
61
  "scripts": {
60
62
  "dev": "bun storybook",
61
63
  "build": "tsc -b && vite build",
62
- "postbuild": "cp lib/styles.css dist/",
64
+ "postbuild": "bun scripts/copy-styles.ts",
63
65
  "storybook": "storybook dev -p 6006",
64
66
  "build-storybook": "storybook build",
65
67
  "test": "vitest run",
@@ -153,7 +155,7 @@
153
155
  "zod": "^4.4.3"
154
156
  },
155
157
  "devDependencies": {
156
- "@biomejs/biome": "2.5.5",
158
+ "@biomejs/biome": "2.5.13",
157
159
  "@changesets/changelog-github": "^1.0.1",
158
160
  "@changesets/cli": "^3.0.1",
159
161
  "@chromatic-com/storybook": "^5.3.1",
@@ -163,7 +165,7 @@
163
165
  "@storybook/react-vite": "10.6.0",
164
166
  "@tailwindcss/vite": "^4.3.3",
165
167
  "@tanstack/react-table": "^9.1.2",
166
- "@types/bun": "^1.4.0",
168
+ "@types/bun": "^1.4.2",
167
169
  "@types/leaflet": "^1.9.21",
168
170
  "@types/lodash-es": "^4.17.12",
169
171
  "@types/node": "^26.1.1",