@loykin/cron-input 0.0.1-dev.3

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,476 @@
1
+ /*
2
+ * @loykin/cron-input
3
+ *
4
+ * Plain CSS, no Tailwind dependency.
5
+ * Override with --basekit-* custom properties or .ci-* class names.
6
+ */
7
+
8
+ :root {
9
+ --basekit-background: var(--background, oklch(1 0 0));
10
+ --basekit-foreground: var(--foreground, oklch(0.145 0 0));
11
+ --basekit-popover: var(--popover, oklch(1 0 0));
12
+ --basekit-popover-foreground: var(--popover-foreground, oklch(0.145 0 0));
13
+ --basekit-muted: var(--muted, oklch(0.97 0 0));
14
+ --basekit-muted-foreground: var(--muted-foreground, oklch(0.556 0 0));
15
+ --basekit-border: var(--border, oklch(0.922 0 0));
16
+ --basekit-input: var(--input, oklch(0.922 0 0));
17
+ --basekit-ring: var(--ring, oklch(0.708 0 0));
18
+ --basekit-primary: var(--primary, oklch(0.488 0.243 264.376));
19
+ --basekit-primary-foreground: var(--primary-foreground, oklch(0.97 0.014 254.604));
20
+ --basekit-secondary: var(--secondary, oklch(0.967 0.001 286.375));
21
+ --basekit-secondary-foreground: var(--secondary-foreground, oklch(0.21 0.006 285.885));
22
+ --basekit-accent: var(--accent, oklch(0.97 0 0));
23
+ --basekit-accent-foreground: var(--accent-foreground, oklch(0.205 0 0));
24
+ --basekit-destructive: var(--destructive, oklch(0.577 0.245 27.325));
25
+ --basekit-radius: var(--radius, 0px);
26
+ }
27
+
28
+ .dark {
29
+ --basekit-background: var(--background, oklch(0.145 0 0));
30
+ --basekit-foreground: var(--foreground, oklch(0.985 0 0));
31
+ --basekit-popover: var(--popover, oklch(0.205 0 0));
32
+ --basekit-popover-foreground: var(--popover-foreground, oklch(0.985 0 0));
33
+ --basekit-muted: var(--muted, oklch(0.269 0 0));
34
+ --basekit-muted-foreground: var(--muted-foreground, oklch(0.708 0 0));
35
+ --basekit-border: var(--border, oklch(1 0 0 / 10%));
36
+ --basekit-input: var(--input, oklch(1 0 0 / 15%));
37
+ --basekit-ring: var(--ring, oklch(0.556 0 0));
38
+ --basekit-secondary: var(--secondary, oklch(0.274 0.006 286.033));
39
+ --basekit-secondary-foreground: var(--secondary-foreground, oklch(0.985 0 0));
40
+ --basekit-accent: var(--accent, oklch(0.269 0 0));
41
+ --basekit-accent-foreground: var(--accent-foreground, oklch(0.985 0 0));
42
+ }
43
+
44
+ /* ── Animations ─────────────────────────────────────────────────────────────── */
45
+
46
+ @keyframes ci-enter {
47
+ from {
48
+ opacity: var(--ci-enter-opacity, 1);
49
+ transform: translate(var(--ci-enter-tx, 0), var(--ci-enter-ty, 0)) scale(var(--ci-enter-scale, 1));
50
+ }
51
+ }
52
+ @keyframes ci-exit {
53
+ to {
54
+ opacity: var(--ci-exit-opacity, 1);
55
+ transform: translate(var(--ci-exit-tx, 0), var(--ci-exit-ty, 0)) scale(var(--ci-exit-scale, 1));
56
+ }
57
+ }
58
+
59
+ /* ── Button ─────────────────────────────────────────────────────────────────── */
60
+
61
+ .ci-btn {
62
+ display: inline-flex;
63
+ align-items: center;
64
+ justify-content: center;
65
+ gap: 6px;
66
+ height: 28px;
67
+ border: 1px solid transparent;
68
+ border-radius: var(--basekit-radius);
69
+ background: transparent;
70
+ color: inherit;
71
+ padding: 0 10px;
72
+ font-size: 12px;
73
+ font-weight: 500;
74
+ white-space: nowrap;
75
+ cursor: pointer;
76
+ outline: none;
77
+ user-select: none;
78
+ flex-shrink: 0;
79
+ }
80
+ .ci-btn:disabled { pointer-events: none; opacity: 0.5; }
81
+ .ci-btn:focus-visible {
82
+ border-color: var(--basekit-ring);
83
+ box-shadow: 0 0 0 1px color-mix(in oklab, var(--basekit-ring) 50%, transparent);
84
+ }
85
+ .ci-btn[data-variant="default"] { background: var(--basekit-primary); color: var(--basekit-primary-foreground); }
86
+ .ci-btn[data-variant="outline"] { border-color: var(--basekit-border); background: var(--basekit-background); color: var(--basekit-foreground); }
87
+ .ci-btn[data-variant="outline"]:hover { background: var(--basekit-muted); }
88
+ .ci-btn[data-variant="ghost"]:hover { background: var(--basekit-muted); }
89
+ .ci-btn[data-size="sm"] { height: 26px; padding: 0 8px; font-size: 11px; }
90
+
91
+ /* ── Positioner / Popover ───────────────────────────────────────────────────── */
92
+
93
+ .ci-positioner { isolation: isolate; z-index: 50; }
94
+
95
+ .ci-popover-content {
96
+ z-index: 50;
97
+ width: 300px;
98
+ border-radius: var(--basekit-radius);
99
+ background: var(--basekit-popover);
100
+ color: var(--basekit-popover-foreground);
101
+ box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1),
102
+ 0 0 0 1px color-mix(in oklab, var(--basekit-foreground) 10%, transparent);
103
+ outline: none;
104
+ overflow: hidden;
105
+ transform-origin: var(--transform-origin);
106
+ }
107
+ .ci-popover-content[data-open] {
108
+ --ci-enter-opacity: 0; --ci-enter-scale: 0.97;
109
+ animation: ci-enter 120ms ease both;
110
+ }
111
+ .ci-popover-content[data-closed] {
112
+ --ci-exit-opacity: 0; --ci-exit-scale: 0.97;
113
+ animation: ci-exit 100ms ease both;
114
+ }
115
+ .ci-popover-content[data-open][data-side="bottom"] { --ci-enter-ty: -4px; }
116
+ .ci-popover-content[data-open][data-side="top"] { --ci-enter-ty: 4px; }
117
+
118
+ /* ── Tabs ───────────────────────────────────────────────────────────────────── */
119
+
120
+ .ci-tabs { display: flex; flex-direction: column; }
121
+
122
+ .ci-tabs-list {
123
+ display: grid;
124
+ grid-template-columns: repeat(5, 1fr);
125
+ border-bottom: 1px solid var(--basekit-border);
126
+ background: var(--basekit-muted);
127
+ }
128
+
129
+ .ci-tabs-trigger {
130
+ display: inline-flex;
131
+ align-items: center;
132
+ justify-content: center;
133
+ height: 34px;
134
+ padding: 0 4px;
135
+ font-size: 11px;
136
+ font-weight: 500;
137
+ color: var(--basekit-muted-foreground);
138
+ background: none;
139
+ border: none;
140
+ border-bottom: 2px solid transparent;
141
+ cursor: pointer;
142
+ white-space: nowrap;
143
+ outline: none;
144
+ transition: color 150ms, border-color 150ms, background 150ms;
145
+ user-select: none;
146
+ }
147
+ .ci-tabs-trigger:hover { color: var(--basekit-foreground); background: color-mix(in oklab, var(--basekit-foreground) 5%, transparent); }
148
+ .ci-tabs-trigger[data-active] {
149
+ color: var(--basekit-foreground);
150
+ border-bottom-color: var(--basekit-primary);
151
+ background: var(--basekit-background);
152
+ }
153
+ .ci-tabs-trigger:focus-visible {
154
+ outline: 2px solid var(--basekit-ring);
155
+ outline-offset: -2px;
156
+ }
157
+
158
+ .ci-tabs-content { font-size: 12px; outline: none; }
159
+
160
+ /* ── Tab body ───────────────────────────────────────────────────────────────── */
161
+
162
+ .ci-tab-body {
163
+ display: flex;
164
+ flex-direction: column;
165
+ gap: 0;
166
+ padding: 16px;
167
+ min-height: 88px;
168
+ }
169
+
170
+ .ci-label {
171
+ font-size: 12px;
172
+ color: var(--basekit-muted-foreground);
173
+ white-space: nowrap;
174
+ flex-shrink: 0;
175
+ }
176
+
177
+ .ci-field-row {
178
+ display: flex;
179
+ align-items: center;
180
+ gap: 8px;
181
+ flex-wrap: wrap;
182
+ }
183
+ .ci-field-row--col { flex-direction: column; align-items: flex-start; gap: 6px; }
184
+ .ci-field-row--mt { margin-top: 12px; }
185
+
186
+ /* ── NumberStepper ──────────────────────────────────────────────────────────── */
187
+
188
+ .ci-stepper {
189
+ display: inline-flex;
190
+ align-items: center;
191
+ border: 1px solid var(--basekit-input);
192
+ border-radius: var(--basekit-radius);
193
+ background: var(--basekit-background);
194
+ overflow: hidden;
195
+ height: 28px;
196
+ }
197
+
198
+ .ci-stepper-btn {
199
+ display: flex;
200
+ align-items: center;
201
+ justify-content: center;
202
+ width: 26px;
203
+ height: 100%;
204
+ background: none;
205
+ border: none;
206
+ color: var(--basekit-muted-foreground);
207
+ font-size: 14px;
208
+ cursor: pointer;
209
+ flex-shrink: 0;
210
+ outline: none;
211
+ transition: background 100ms, color 100ms;
212
+ user-select: none;
213
+ line-height: 1;
214
+ }
215
+ .ci-stepper-btn:hover { background: var(--basekit-muted); color: var(--basekit-foreground); }
216
+ .ci-stepper-btn:active { background: var(--basekit-accent); }
217
+
218
+ .ci-stepper-input {
219
+ width: 36px;
220
+ height: 100%;
221
+ border: none;
222
+ border-left: 1px solid var(--basekit-border);
223
+ border-right: 1px solid var(--basekit-border);
224
+ background: transparent;
225
+ color: var(--basekit-foreground);
226
+ font-size: 12px;
227
+ font-weight: 500;
228
+ text-align: center;
229
+ outline: none;
230
+ padding: 0;
231
+ font-variant-numeric: tabular-nums;
232
+ }
233
+ .ci-stepper-input:focus { background: color-mix(in oklab, var(--basekit-primary) 8%, transparent); }
234
+
235
+ /* ── TimePicker ─────────────────────────────────────────────────────────────── */
236
+
237
+ .ci-time {
238
+ display: flex;
239
+ align-items: center;
240
+ gap: 4px;
241
+ }
242
+
243
+ .ci-time-sep {
244
+ font-size: 14px;
245
+ font-weight: 600;
246
+ color: var(--basekit-muted-foreground);
247
+ line-height: 1;
248
+ margin-bottom: 1px;
249
+ user-select: none;
250
+ }
251
+
252
+ /* ── Interval tab extras ────────────────────────────────────────────────────── */
253
+
254
+ .ci-interval-row {
255
+ display: flex;
256
+ align-items: center;
257
+ gap: 8px;
258
+ flex-wrap: wrap;
259
+ }
260
+
261
+ .ci-unit-seg {
262
+ display: flex;
263
+ border: 1px solid var(--basekit-input);
264
+ border-radius: var(--basekit-radius);
265
+ overflow: hidden;
266
+ height: 28px;
267
+ }
268
+
269
+ .ci-unit-btn {
270
+ display: flex;
271
+ align-items: center;
272
+ justify-content: center;
273
+ padding: 0 10px;
274
+ height: 100%;
275
+ font-size: 11px;
276
+ font-weight: 500;
277
+ background: none;
278
+ border: none;
279
+ border-left: 1px solid var(--basekit-border);
280
+ color: var(--basekit-muted-foreground);
281
+ cursor: pointer;
282
+ outline: none;
283
+ user-select: none;
284
+ transition: background 100ms, color 100ms;
285
+ white-space: nowrap;
286
+ }
287
+ .ci-unit-btn:first-child { border-left: none; }
288
+ .ci-unit-btn:hover { background: var(--basekit-muted); color: var(--basekit-foreground); }
289
+ .ci-unit-btn--active {
290
+ background: var(--basekit-primary);
291
+ color: var(--basekit-primary-foreground);
292
+ }
293
+ .ci-unit-btn--active:hover {
294
+ background: var(--basekit-primary);
295
+ color: var(--basekit-primary-foreground);
296
+ }
297
+ .ci-unit-btn:focus-visible { outline: 2px solid var(--basekit-ring); outline-offset: -2px; }
298
+
299
+ /* ── DayChips ───────────────────────────────────────────────────────────────── */
300
+
301
+ .ci-day-chips {
302
+ display: flex;
303
+ gap: 4px;
304
+ }
305
+
306
+ .ci-day-chip {
307
+ display: flex;
308
+ align-items: center;
309
+ justify-content: center;
310
+ width: 30px;
311
+ height: 28px;
312
+ border-radius: var(--basekit-radius);
313
+ border: 1px solid var(--basekit-input);
314
+ background: var(--basekit-background);
315
+ color: var(--basekit-muted-foreground);
316
+ font-size: 11px;
317
+ font-weight: 500;
318
+ cursor: pointer;
319
+ outline: none;
320
+ transition: background 100ms, color 100ms, border-color 100ms;
321
+ user-select: none;
322
+ }
323
+ .ci-day-chip:hover { border-color: var(--basekit-ring); color: var(--basekit-foreground); }
324
+ .ci-day-chip--active {
325
+ background: var(--basekit-primary);
326
+ border-color: var(--basekit-primary);
327
+ color: var(--basekit-primary-foreground);
328
+ }
329
+ .ci-day-chip--active:hover {
330
+ background: var(--basekit-primary);
331
+ border-color: var(--basekit-primary);
332
+ color: var(--basekit-primary-foreground);
333
+ }
334
+ .ci-day-chip:focus-visible { outline: 2px solid var(--basekit-ring); outline-offset: 1px; }
335
+
336
+ /* ── Custom tab ─────────────────────────────────────────────────────────────── */
337
+
338
+ .ci-custom { gap: 10px; }
339
+
340
+ .ci-custom-wrap {
341
+ position: relative;
342
+ display: flex;
343
+ align-items: center;
344
+ }
345
+
346
+ .ci-custom-input {
347
+ width: 100%;
348
+ height: 32px;
349
+ border: 1px solid var(--basekit-input);
350
+ border-radius: var(--basekit-radius);
351
+ background: transparent;
352
+ color: var(--basekit-foreground);
353
+ padding: 0 32px 0 10px;
354
+ font-size: 12px;
355
+ font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
356
+ outline: none;
357
+ transition: border-color 150ms;
358
+ }
359
+ .ci-custom-input:focus {
360
+ border-color: var(--basekit-ring);
361
+ box-shadow: 0 0 0 1px color-mix(in oklab, var(--basekit-ring) 50%, transparent);
362
+ }
363
+ .ci-custom-wrap--error .ci-custom-input {
364
+ border-color: var(--basekit-destructive);
365
+ box-shadow: 0 0 0 1px color-mix(in oklab, var(--basekit-destructive) 20%, transparent);
366
+ }
367
+ .ci-custom-input::placeholder { color: var(--basekit-muted-foreground); }
368
+
369
+ .ci-custom-badge {
370
+ position: absolute;
371
+ right: 8px;
372
+ font-size: 12px;
373
+ font-weight: 600;
374
+ pointer-events: none;
375
+ line-height: 1;
376
+ }
377
+ .ci-custom-badge--ok { color: oklch(0.6 0.15 145); }
378
+ .ci-custom-badge--err { color: var(--basekit-destructive); }
379
+
380
+ .ci-custom-desc {
381
+ font-size: 11px;
382
+ color: var(--basekit-muted-foreground);
383
+ margin: 0;
384
+ }
385
+
386
+ .ci-custom-fields {
387
+ display: flex;
388
+ gap: 4px;
389
+ margin-top: 4px;
390
+ }
391
+
392
+ .ci-custom-field {
393
+ flex: 1;
394
+ display: flex;
395
+ flex-direction: column;
396
+ align-items: center;
397
+ gap: 2px;
398
+ background: var(--basekit-muted);
399
+ border-radius: var(--basekit-radius);
400
+ padding: 5px 4px;
401
+ }
402
+
403
+ .ci-custom-field-val {
404
+ font-size: 11px;
405
+ font-weight: 600;
406
+ font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
407
+ color: var(--basekit-foreground);
408
+ line-height: 1;
409
+ }
410
+
411
+ .ci-custom-field-lbl {
412
+ font-size: 9px;
413
+ font-weight: 500;
414
+ color: var(--basekit-muted-foreground);
415
+ text-transform: uppercase;
416
+ letter-spacing: 0.04em;
417
+ line-height: 1;
418
+ }
419
+
420
+ /* ── Footer ─────────────────────────────────────────────────────────────────── */
421
+
422
+ .ci-footer {
423
+ display: flex;
424
+ align-items: center;
425
+ justify-content: space-between;
426
+ gap: 8px;
427
+ padding: 8px 12px;
428
+ border-top: 1px solid var(--basekit-border);
429
+ background: color-mix(in oklab, var(--basekit-muted) 40%, transparent);
430
+ }
431
+
432
+ .ci-preview {
433
+ font-size: 11px;
434
+ color: var(--basekit-muted-foreground);
435
+ min-width: 0;
436
+ overflow: hidden;
437
+ text-overflow: ellipsis;
438
+ white-space: nowrap;
439
+ flex: 1;
440
+ }
441
+
442
+ .ci-footer-actions {
443
+ display: flex;
444
+ gap: 6px;
445
+ flex-shrink: 0;
446
+ }
447
+
448
+ /* ── Trigger button ─────────────────────────────────────────────────────────── */
449
+
450
+ .ci-trigger {
451
+ display: inline-flex;
452
+ align-items: center;
453
+ gap: 6px;
454
+ height: 32px;
455
+ padding: 0 10px;
456
+ border: 1px solid var(--basekit-border);
457
+ border-radius: var(--basekit-radius);
458
+ background: var(--basekit-background);
459
+ color: var(--basekit-foreground);
460
+ font-size: 12px;
461
+ cursor: pointer;
462
+ outline: none;
463
+ transition: border-color 150ms, background 150ms;
464
+ user-select: none;
465
+ white-space: nowrap;
466
+ }
467
+ .ci-trigger:hover { background: var(--basekit-muted); }
468
+ .ci-trigger--open { border-color: var(--basekit-foreground); }
469
+ .ci-trigger:disabled { pointer-events: none; opacity: 0.5; }
470
+ .ci-trigger:focus-visible {
471
+ border-color: var(--basekit-ring);
472
+ box-shadow: 0 0 0 1px color-mix(in oklab, var(--basekit-ring) 50%, transparent);
473
+ }
474
+
475
+ .ci-trigger-icon { color: var(--basekit-muted-foreground); flex-shrink: 0; }
476
+ .ci-trigger-label { flex: 1; text-align: left; }
@@ -0,0 +1 @@
1
+ declare const styles: string; export default styles;
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@loykin/cron-input",
3
+ "version": "0.0.1-dev.3",
4
+ "description": "Cron expression builder component with visual schedule editor and raw expression fallback.",
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": {
16
+ "types": "./dist/styles.d.ts",
17
+ "default": "./dist/styles.css"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "sideEffects": [
24
+ "./dist/styles.css"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "dependencies": {
30
+ "@base-ui/react": "^1.3.0",
31
+ "clsx": "^2.1.1",
32
+ "lucide-react": "^0.546.0"
33
+ },
34
+ "peerDependencies": {
35
+ "react": "^18.0.0 || ^19.0.0",
36
+ "react-dom": "^18.0.0 || ^19.0.0"
37
+ },
38
+ "devDependencies": {
39
+ "@types/react": "^19.0.0",
40
+ "@types/react-dom": "^19.0.0",
41
+ "tsup": "^8.4.0",
42
+ "typescript": "^5.9.3"
43
+ },
44
+ "keywords": [
45
+ "react",
46
+ "cron",
47
+ "schedule",
48
+ "cron-expression",
49
+ "headless"
50
+ ],
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "https://github.com/loykin/basekit.git",
54
+ "directory": "packages/cron-input"
55
+ },
56
+ "homepage": "https://loykin.github.io/basekit/",
57
+ "bugs": {
58
+ "url": "https://github.com/loykin/basekit/issues"
59
+ },
60
+ "license": "MIT",
61
+ "scripts": {
62
+ "build": "tsc --noEmit && tsup && node scripts/build-css.mjs && echo 'declare const styles: string; export default styles;' > dist/styles.d.ts",
63
+ "build:css": "node scripts/build-css.mjs",
64
+ "dev": "tsup --watch",
65
+ "type-check": "tsc --noEmit"
66
+ }
67
+ }