@skygraph/styles 0.2.2 → 0.2.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,67 @@
1
+ /* AutoField — schema-driven field renderer.
2
+ *
3
+ * Inputs are plain native elements (no Input wrapping) so the control stays
4
+ * framework-agnostic and round-trips native form behaviour. This sheet is the
5
+ * single source of truth for both adapters (`AutoField.tsx` / `AutoField.vue`)
6
+ * so the rendered look is identical across React and Vue. */
7
+
8
+ .sg-autofield {
9
+ display: flex;
10
+ flex-direction: column;
11
+ gap: 4px;
12
+ }
13
+
14
+ .sg-autofield-label {
15
+ font-weight: 500;
16
+ font-size: 14px;
17
+ }
18
+
19
+ .sg-autofield-input {
20
+ width: 100%;
21
+ padding: 6px 12px;
22
+ border: 1px solid var(--sg-color-border, #d9d9d9);
23
+ border-radius: var(--sg-border-radius, 6px);
24
+ background: var(--sg-color-bg-container, #fff);
25
+ color: var(--sg-color-text);
26
+ font-size: 14px;
27
+ font-family: inherit;
28
+ line-height: 1.4;
29
+ box-sizing: border-box;
30
+ outline: none;
31
+ transition: border-color var(--sg-transition-duration) var(--sg-transition-timing);
32
+ }
33
+
34
+ .sg-autofield-input:disabled {
35
+ background: var(--sg-color-bg-disabled, #f5f5f5);
36
+ color: var(--sg-color-text-disabled);
37
+ cursor: not-allowed;
38
+ }
39
+
40
+ .sg-autofield-input:focus,
41
+ .sg-autofield-input:focus-visible {
42
+ border-color: var(--sg-color-primary);
43
+ box-shadow: 0 0 0 2px var(--sg-color-primary-bg);
44
+ }
45
+
46
+ .sg-autofield-input-error {
47
+ border-color: var(--sg-color-error, #ff4d4f);
48
+ }
49
+
50
+ .sg-autofield-input-warning {
51
+ border-color: var(--sg-color-warning, #faad14);
52
+ }
53
+
54
+ .sg-autofield-input-textarea {
55
+ min-height: 80px;
56
+ resize: vertical;
57
+ }
58
+
59
+ .sg-autofield-input-multiple {
60
+ min-height: 80px;
61
+ }
62
+
63
+ .sg-autofield-input-color {
64
+ width: 48px;
65
+ height: 32px;
66
+ padding: 2px;
67
+ }
@@ -18,11 +18,14 @@
18
18
  display: flex;
19
19
  align-items: center;
20
20
  justify-content: space-between;
21
- min-height: var(--sg-height-md);
21
+ /* Shares the `--sg-input-*` family with `Input` so scoped overrides
22
+ * (height / radius / bg / border) re-skin the trigger. */
23
+ min-height: var(--sg-input-height, var(--sg-height-md));
22
24
  padding: var(--sg-padding-xs) var(--sg-padding-md);
23
- background: var(--sg-color-bg-container);
24
- border: 1px solid var(--sg-color-border);
25
- border-radius: var(--sg-border-radius);
25
+ color: var(--sg-input-color, var(--sg-color-text));
26
+ background: var(--sg-input-bg, var(--sg-color-bg-container));
27
+ border: 1px solid var(--sg-input-border, var(--sg-color-border));
28
+ border-radius: var(--sg-input-radius, var(--sg-border-radius));
26
29
  cursor: pointer;
27
30
  transition: border-color var(--sg-transition-duration) var(--sg-transition-timing);
28
31
  gap: var(--sg-padding-xs);
@@ -67,7 +70,7 @@
67
70
  }
68
71
 
69
72
  .sg-cascader-selection-item {
70
- color: var(--sg-color-text);
73
+ color: var(--sg-input-color, var(--sg-color-text));
71
74
  white-space: nowrap;
72
75
  overflow: hidden;
73
76
  text-overflow: ellipsis;
@@ -244,6 +247,11 @@
244
247
  background: transparent;
245
248
  }
246
249
 
250
+ .sg-cascader-option-loading {
251
+ color: var(--sg-color-text-tertiary);
252
+ cursor: wait;
253
+ }
254
+
247
255
  .sg-cascader-option-label {
248
256
  flex: 1;
249
257
  overflow: hidden;
@@ -261,8 +269,12 @@
261
269
  }
262
270
 
263
271
  @keyframes sg-cascader-spin {
264
- from { transform: rotate(0deg); }
265
- to { transform: rotate(360deg); }
272
+ from {
273
+ transform: rotate(0deg);
274
+ }
275
+ to {
276
+ transform: rotate(360deg);
277
+ }
266
278
  }
267
279
 
268
280
  .sg-cascader-option-check {
@@ -51,6 +51,32 @@
51
51
  box-shadow: 0 0 0 2px var(--sg-color-primary-bg);
52
52
  }
53
53
 
54
+ .sg-input-status-error,
55
+ .sg-input-wrapper-status-error .sg-input {
56
+ --sg-input-border: var(--sg-color-error);
57
+ }
58
+
59
+ .sg-input-status-error:focus,
60
+ .sg-input-status-error:focus-visible,
61
+ .sg-input-wrapper-status-error .sg-input:focus,
62
+ .sg-input-wrapper-status-error .sg-input:focus-visible {
63
+ --sg-input-border: var(--sg-color-error);
64
+ box-shadow: 0 0 0 2px var(--sg-color-error-bg);
65
+ }
66
+
67
+ .sg-input-status-warning,
68
+ .sg-input-wrapper-status-warning .sg-input {
69
+ --sg-input-border: var(--sg-color-warning);
70
+ }
71
+
72
+ .sg-input-status-warning:focus,
73
+ .sg-input-status-warning:focus-visible,
74
+ .sg-input-wrapper-status-warning .sg-input:focus,
75
+ .sg-input-wrapper-status-warning .sg-input:focus-visible {
76
+ --sg-input-border: var(--sg-color-warning);
77
+ box-shadow: 0 0 0 2px var(--sg-color-warning-bg);
78
+ }
79
+
54
80
  .sg-input:disabled {
55
81
  --sg-input-bg: var(--sg-color-bg-disabled);
56
82
  --sg-input-color: var(--sg-color-text-disabled);
@@ -3,7 +3,8 @@
3
3
  * emoji ignore CSS `color`, so opacity is the only signal that
4
4
  * separates active vs inactive characters. Override globally for
5
5
  * monochrome glyphs by setting it to `1`. */
6
- --sg-rate-symbol-empty-opacity: 0.42;
6
+ --sg-rate-symbol-empty-color: var(--sg-color-text-tertiary);
7
+ --sg-rate-symbol-empty-opacity: 0.72;
7
8
 
8
9
  display: inline-flex;
9
10
  gap: var(--sg-padding-xs);
@@ -17,7 +18,7 @@
17
18
 
18
19
  .sg-rate-star {
19
20
  cursor: pointer;
20
- color: var(--sg-color-border);
21
+ color: var(--sg-rate-symbol-empty-color, var(--sg-color-text-tertiary));
21
22
  opacity: var(--sg-rate-symbol-empty-opacity);
22
23
  transition:
23
24
  color var(--sg-transition-duration),
@@ -26,9 +27,14 @@
26
27
  user-select: none;
27
28
  }
28
29
 
29
- .sg-rate-star:hover { transform: scale(1.15); }
30
+ .sg-rate-star:hover {
31
+ transform: scale(1.15);
32
+ }
30
33
  .sg-rate-star-full {
31
34
  color: var(--sg-color-star);
32
35
  opacity: 1;
33
36
  }
34
- .sg-rate-star-half { color: var(--sg-color-star); opacity: 0.5; }
37
+ .sg-rate-star-half {
38
+ color: var(--sg-color-star);
39
+ opacity: 0.76;
40
+ }
@@ -14,11 +14,14 @@
14
14
  display: flex;
15
15
  align-items: center;
16
16
  justify-content: space-between;
17
- height: var(--sg-height-md);
17
+ /* Honour the shared `--sg-input-*` family (same as `Input`) so a scoped
18
+ * override re-skins the trigger, falling back to the semantic palette. */
19
+ height: var(--sg-input-height, var(--sg-height-md));
18
20
  padding: 0 var(--sg-padding-md);
19
- background: var(--sg-color-bg-container);
20
- border: 1px solid var(--sg-color-border);
21
- border-radius: var(--sg-border-radius);
21
+ color: var(--sg-input-color, var(--sg-color-text));
22
+ background: var(--sg-input-bg, var(--sg-color-bg-container));
23
+ border: 1px solid var(--sg-input-border, var(--sg-color-border));
24
+ border-radius: var(--sg-input-radius, var(--sg-border-radius));
22
25
  cursor: pointer;
23
26
  transition: border-color var(--sg-transition-duration);
24
27
  }
@@ -47,7 +50,7 @@
47
50
  }
48
51
 
49
52
  .sg-select-selection-item {
50
- color: var(--sg-color-text);
53
+ color: var(--sg-input-color, var(--sg-color-text));
51
54
  }
52
55
 
53
56
  .sg-select-arrow {
@@ -82,6 +85,10 @@
82
85
  background: var(--sg-color-bg-hover);
83
86
  }
84
87
 
88
+ .sg-select-option-focused {
89
+ background: var(--sg-color-bg-hover);
90
+ }
91
+
85
92
  .sg-select-option-selected {
86
93
  font-weight: 600;
87
94
  background: var(--sg-color-primary-bg);
@@ -163,7 +170,9 @@
163
170
  border: none;
164
171
  border-radius: 2px;
165
172
  cursor: pointer;
166
- transition: color var(--sg-transition-duration), background var(--sg-transition-duration);
173
+ transition:
174
+ color var(--sg-transition-duration),
175
+ background var(--sg-transition-duration);
167
176
  }
168
177
 
169
178
  .sg-select-tag-remove:hover {
@@ -18,11 +18,14 @@
18
18
  display: flex;
19
19
  align-items: center;
20
20
  justify-content: space-between;
21
- min-height: var(--sg-height-md);
21
+ /* Shares the `--sg-input-*` family with `Input` so scoped overrides
22
+ * (height / radius / bg / border) re-skin the trigger. */
23
+ min-height: var(--sg-input-height, var(--sg-height-md));
22
24
  padding: var(--sg-padding-xs) var(--sg-padding-md);
23
- background: var(--sg-color-bg-container);
24
- border: 1px solid var(--sg-color-border);
25
- border-radius: var(--sg-border-radius);
25
+ color: var(--sg-input-color, var(--sg-color-text));
26
+ background: var(--sg-input-bg, var(--sg-color-bg-container));
27
+ border: 1px solid var(--sg-input-border, var(--sg-color-border));
28
+ border-radius: var(--sg-input-radius, var(--sg-border-radius));
26
29
  cursor: pointer;
27
30
  transition: border-color var(--sg-transition-duration) var(--sg-transition-timing);
28
31
  gap: var(--sg-padding-xs);
@@ -67,7 +70,7 @@
67
70
  }
68
71
 
69
72
  .sg-treeselect-selection-item {
70
- color: var(--sg-color-text);
73
+ color: var(--sg-input-color, var(--sg-color-text));
71
74
  white-space: nowrap;
72
75
  overflow: hidden;
73
76
  text-overflow: ellipsis;
@@ -216,4 +219,3 @@
216
219
  padding: 1px 0;
217
220
  min-height: 26px;
218
221
  }
219
-
package/index.css CHANGED
@@ -7,6 +7,7 @@
7
7
  @import './components/input-number.css';
8
8
  @import './components/form.css';
9
9
  @import './components/field.css';
10
+ @import './components/autofield.css';
10
11
  @import './components/spin.css';
11
12
  @import './components/modal.css';
12
13
  @import './components/checkbox.css';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skygraph/styles",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "SkyGraph framework-agnostic CSS — tokens, themes, transitions, print and 60+ component stylesheets",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/tokens.css CHANGED
@@ -87,6 +87,17 @@
87
87
 
88
88
  /* === Component tokens === */
89
89
  --sg-color-star: #fadb14;
90
+
91
+ /* Input-family aliases shared by Input / Select / TreeSelect / Cascader.
92
+ * These are public component tokens, so scoped overrides work consistently
93
+ * across all trigger-like controls. */
94
+ --sg-input-height: var(--sg-height-md);
95
+ --sg-input-padding: var(--sg-padding-xs) var(--sg-padding-md);
96
+ --sg-input-font-size: var(--sg-font-size);
97
+ --sg-input-color: var(--sg-color-text);
98
+ --sg-input-bg: var(--sg-color-bg-container);
99
+ --sg-input-border: var(--sg-color-border);
100
+ --sg-input-radius: var(--sg-border-radius);
90
101
  }
91
102
 
92
103
  /* === Semantic tokens — Light theme (default) === */