@marianmeres/stuic 3.45.3 → 3.47.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,221 @@
1
+ /* ============================================================================
2
+ CRON INPUT COMPONENT TOKENS
3
+ Override globally: :root { --stuic-cron-input-fields-gap: 1rem; }
4
+ Override locally: <CronInput style="--stuic-cron-input-fields-gap: 1rem;">
5
+ ============================================================================ */
6
+
7
+ /* prettier-ignore */
8
+ :root {
9
+ --stuic-cron-input-fields-gap: 0.375rem;
10
+ --stuic-cron-input-section-gap: 0.25rem;
11
+ --stuic-cron-input-field-label-text: var(--stuic-color-muted-foreground);
12
+ --stuic-cron-input-summary-text: var(--stuic-color-muted-foreground);
13
+ --stuic-cron-input-error-text: var(--stuic-color-destructive);
14
+ --stuic-cron-input-field-bg: var(--stuic-color-background);
15
+ --stuic-cron-input-field-border: var(--stuic-color-border);
16
+ --stuic-cron-input-field-border-focus: var(--stuic-color-primary);
17
+ }
18
+
19
+ @layer components {
20
+ /* Content wrapper inside InputWrap — must fill the flex parent (.input-wrap > .flex) */
21
+ .stuic-cron-input-content {
22
+ display: flex;
23
+ flex-direction: column;
24
+ gap: var(--stuic-cron-input-section-gap);
25
+ flex: 1;
26
+ min-width: 0;
27
+ padding: 0.5rem;
28
+ }
29
+
30
+ /* No padding in presets-only mode (the select handles its own) */
31
+ .stuic-cron-input-content[data-presets-only] {
32
+ padding: 0;
33
+ }
34
+
35
+ /* Preset select — styled as inner sub-input by default */
36
+ .stuic-cron-input-preset {
37
+ display: block;
38
+ width: 100%;
39
+ appearance: none;
40
+ -webkit-appearance: none;
41
+ border: 1px solid var(--stuic-cron-input-field-border);
42
+ border-radius: var(--stuic-input-radius);
43
+ background: var(--stuic-cron-input-field-bg);
44
+ color: var(--stuic-input-text);
45
+ font-family: var(--stuic-input-font-family);
46
+ font-size: var(--stuic-input-font-size-sm);
47
+ padding: 0.375rem 2rem 0.375rem 0.5rem;
48
+ cursor: pointer;
49
+ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
50
+ background-position: right 0.5rem center;
51
+ background-repeat: no-repeat;
52
+ background-size: 1.5em 1.5em;
53
+ transition: border-color var(--stuic-input-transition);
54
+ }
55
+
56
+ .stuic-cron-input-preset:focus {
57
+ outline: none;
58
+ border-color: var(--stuic-cron-input-field-border-focus);
59
+ }
60
+
61
+ .stuic-cron-input-preset:disabled {
62
+ cursor: not-allowed;
63
+ opacity: 0.5;
64
+ }
65
+
66
+ /* Presets-only mode: select renders like a native FieldSelect (no inner border) */
67
+ .stuic-cron-input-content[data-presets-only] .stuic-cron-input-preset {
68
+ border: 0;
69
+ border-radius: 0;
70
+ background-color: transparent;
71
+ background-position: right 0.5rem center;
72
+ background-size: 1.5em 1.5em;
73
+ padding: var(--stuic-input-padding-y-md) var(--stuic-input-padding-x-md);
74
+ padding-right: 2.5rem;
75
+ font-size: var(--stuic-input-font-size-md);
76
+ min-height: var(--stuic-input-min-height-md);
77
+ }
78
+
79
+ .stuic-input[data-size="sm"]
80
+ .stuic-cron-input-content[data-presets-only]
81
+ .stuic-cron-input-preset {
82
+ padding: var(--stuic-input-padding-y-sm) var(--stuic-input-padding-x-sm);
83
+ padding-right: 2.5rem;
84
+ font-size: var(--stuic-input-font-size-sm);
85
+ min-height: var(--stuic-input-min-height-sm);
86
+ }
87
+
88
+ .stuic-input[data-size="lg"]
89
+ .stuic-cron-input-content[data-presets-only]
90
+ .stuic-cron-input-preset {
91
+ padding: var(--stuic-input-padding-y-lg) var(--stuic-input-padding-x-lg);
92
+ padding-right: 2.5rem;
93
+ font-size: var(--stuic-input-font-size-lg);
94
+ min-height: var(--stuic-input-min-height-lg);
95
+ }
96
+
97
+ .stuic-cron-input-content[data-presets-only] .stuic-cron-input-preset:focus {
98
+ border: 0;
99
+ }
100
+
101
+ /* 5-column grid for fields */
102
+ .stuic-cron-input-fields {
103
+ display: grid;
104
+ grid-template-columns: repeat(5, 1fr);
105
+ gap: var(--stuic-cron-input-fields-gap);
106
+ }
107
+
108
+ /* Individual field */
109
+ .stuic-cron-input-field {
110
+ display: flex;
111
+ flex-direction: column;
112
+ gap: 0.125rem;
113
+ }
114
+
115
+ /* Field label */
116
+ .stuic-cron-input-field-label {
117
+ font-size: 0.6875rem;
118
+ color: var(--stuic-cron-input-field-label-text);
119
+ text-transform: uppercase;
120
+ text-align: center;
121
+ letter-spacing: 0.05em;
122
+ }
123
+
124
+ /* Field input — must match base specificity of .stuic-input input:not(…)×4 */
125
+ .stuic-input
126
+ input.stuic-cron-input-field-input:not([type="checkbox"]):not([type="radio"]):not(
127
+ [type="range"]
128
+ ):not([type="file"]) {
129
+ display: block;
130
+ width: 100%;
131
+ border: 1px solid var(--stuic-cron-input-field-border);
132
+ border-radius: var(--stuic-input-radius);
133
+ background: var(--stuic-cron-input-field-bg);
134
+ color: var(--stuic-input-text);
135
+ font-family: var(--font-mono, monospace);
136
+ font-size: var(--stuic-input-font-size-sm);
137
+ padding: 0.25rem;
138
+ min-height: 0;
139
+ text-align: center;
140
+ transition: border-color var(--stuic-input-transition);
141
+ }
142
+
143
+ .stuic-cron-input-field-input:focus {
144
+ outline: none;
145
+ border-color: var(--stuic-cron-input-field-border-focus);
146
+ }
147
+
148
+ .stuic-cron-input-field-input:disabled {
149
+ cursor: not-allowed;
150
+ opacity: 0.5;
151
+ }
152
+
153
+ .stuic-cron-input-field-input::placeholder {
154
+ color: var(--stuic-input-placeholder);
155
+ opacity: 0.5;
156
+ font-family: var(--stuic-input-font-family);
157
+ }
158
+
159
+ /* Raw expression input */
160
+ .stuic-cron-input-raw {
161
+ display: block;
162
+ width: 100%;
163
+ border: 1px solid var(--stuic-cron-input-field-border);
164
+ border-radius: var(--stuic-input-radius);
165
+ background: var(--stuic-cron-input-field-bg);
166
+ color: var(--stuic-input-text);
167
+ font-family: var(--font-mono, monospace);
168
+ font-size: var(--stuic-input-font-size-sm);
169
+ padding: 0.375rem 0.5rem;
170
+ transition: border-color var(--stuic-input-transition);
171
+ }
172
+
173
+ .stuic-cron-input-raw:focus {
174
+ outline: none;
175
+ border-color: var(--stuic-cron-input-field-border-focus);
176
+ }
177
+
178
+ .stuic-cron-input-raw:disabled {
179
+ cursor: not-allowed;
180
+ opacity: 0.5;
181
+ }
182
+
183
+ .stuic-cron-input-raw::placeholder {
184
+ color: var(--stuic-input-placeholder);
185
+ opacity: 0.5;
186
+ }
187
+
188
+ /* Summary / human description */
189
+ .stuic-cron-input-summary {
190
+ color: var(--stuic-cron-input-summary-text);
191
+ font-size: 0.8125rem;
192
+ line-height: 1.4;
193
+ }
194
+
195
+ /* Error message */
196
+ .stuic-cron-input-error {
197
+ color: var(--stuic-cron-input-error-text);
198
+ font-size: 0.8125rem;
199
+ line-height: 1.4;
200
+ }
201
+
202
+ /* Mode toggle button */
203
+ .stuic-cron-input-content + .toggle-btn {
204
+ color: var(--stuic-input-localized-toggle-text);
205
+ transition:
206
+ background var(--stuic-input-transition),
207
+ color var(--stuic-input-transition);
208
+ }
209
+
210
+ .stuic-cron-input-content + .toggle-btn:hover:not(:disabled) {
211
+ color: var(--stuic-input-localized-toggle-text-hover);
212
+ background: var(--stuic-input-localized-toggle-hover-bg);
213
+ }
214
+
215
+ /* Responsive: stack on narrow */
216
+ @media (max-width: 400px) {
217
+ .stuic-cron-input-fields {
218
+ grid-template-columns: repeat(3, 1fr);
219
+ }
220
+ }
221
+ }
@@ -0,0 +1,2 @@
1
+ export { default as CronInput, type Props as CronInputProps, type CronPreset, type CronInputMode, DEFAULT_PRESETS as CRON_DEFAULT_PRESETS, } from "./CronInput.svelte";
2
+ export { CronNextRun } from "./cron-next-run.svelte.js";
@@ -0,0 +1,2 @@
1
+ export { default as CronInput, DEFAULT_PRESETS as CRON_DEFAULT_PRESETS, } from "./CronInput.svelte";
2
+ export { CronNextRun } from "./cron-next-run.svelte.js";