@skygraph/styles 0.0.0-placeholder.0 → 0.2.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.
Files changed (75) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +92 -6
  3. package/components/autocomplete.css +33 -0
  4. package/components/avatar.css +37 -0
  5. package/components/badge.css +102 -0
  6. package/components/breadcrumb.css +29 -0
  7. package/components/button.css +181 -0
  8. package/components/calendar.css +408 -0
  9. package/components/carousel.css +102 -0
  10. package/components/cascader.css +354 -0
  11. package/components/charts.css +408 -0
  12. package/components/checkbox.css +114 -0
  13. package/components/collapse.css +166 -0
  14. package/components/colorpicker.css +252 -0
  15. package/components/context-menu.css +95 -0
  16. package/components/dashboard.css +299 -0
  17. package/components/datagrid.css +86 -0
  18. package/components/datepicker.css +601 -0
  19. package/components/descriptions.css +82 -0
  20. package/components/diagram.css +435 -0
  21. package/components/drawer.css +103 -0
  22. package/components/dropdown.css +93 -0
  23. package/components/empty.css +25 -0
  24. package/components/event-timeline.css +100 -0
  25. package/components/field.css +35 -0
  26. package/components/form.css +115 -0
  27. package/components/gantt.css +166 -0
  28. package/components/inline-edit.css +113 -0
  29. package/components/input-group.css +79 -0
  30. package/components/input-number.css +76 -0
  31. package/components/input-password.css +104 -0
  32. package/components/input.css +185 -0
  33. package/components/list.css +357 -0
  34. package/components/mentions.css +54 -0
  35. package/components/menu.css +309 -0
  36. package/components/modal.css +77 -0
  37. package/components/notification.css +128 -0
  38. package/components/pagination.css +162 -0
  39. package/components/pin-input.css +71 -0
  40. package/components/popconfirm.css +95 -0
  41. package/components/progress.css +116 -0
  42. package/components/radio.css +95 -0
  43. package/components/rate.css +34 -0
  44. package/components/resource-calendar.css +224 -0
  45. package/components/result.css +45 -0
  46. package/components/schema-form-editor.css +433 -0
  47. package/components/search-input.css +112 -0
  48. package/components/segmented.css +76 -0
  49. package/components/select.css +172 -0
  50. package/components/skeleton.css +68 -0
  51. package/components/slider.css +51 -0
  52. package/components/spin.css +86 -0
  53. package/components/steps.css +185 -0
  54. package/components/switch.css +75 -0
  55. package/components/table.css +1023 -0
  56. package/components/tabs.css +117 -0
  57. package/components/tag-input.css +94 -0
  58. package/components/tag.css +61 -0
  59. package/components/textarea.css +22 -0
  60. package/components/timeline.css +169 -0
  61. package/components/timepicker.css +213 -0
  62. package/components/tooltip.css +91 -0
  63. package/components/transfer.css +140 -0
  64. package/components/tree.css +574 -0
  65. package/components/treeselect.css +219 -0
  66. package/components/upload.css +124 -0
  67. package/index.css +69 -3
  68. package/index.d.ts +9 -0
  69. package/package.json +102 -18
  70. package/print.css +88 -0
  71. package/reset.css +17 -0
  72. package/themes/dark.css +17 -0
  73. package/themes/default.css +14 -0
  74. package/tokens.css +312 -0
  75. package/transitions.css +158 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SkyGraph Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,12 +1,98 @@
1
1
  # @skygraph/styles
2
2
 
3
- > Placeholder package. **Do not install yet.**
3
+ Framework-agnostic CSS for SkyGraph design tokens, themes, transitions, print
4
+ layer and 60+ component stylesheets. Zero JS, no runtime, just CSS Variables.
4
5
 
5
- `@skygraph/styles` is the framework-agnostic CSS for [SkyGraph](https://skygraph.ruslansinkevich.ru) design tokens, themes, transitions, component stylesheets.
6
+ This package is the styling foundation shared by **all** SkyGraph adapters
7
+ (`@skygraph/react`, future `@skygraph/vue`, `@skygraph/angular`, …). The CSS
8
+ selectors target `.sg-*` class names, which are emitted identically by every
9
+ adapter — so a single import gives you consistent visuals regardless of the
10
+ framework you ship the components in.
6
11
 
7
- This release is a name-reservation stub (`0.0.0-placeholder.0`, dist-tag `placeholder`). The first usable version will be published under the `latest` tag.
12
+ ## Install
8
13
 
9
- - Live demos: <https://skygraph.ruslansinkevich.ru>
10
- - Repository: <https://github.com/RuslanSinkevich/skygraph>
14
+ ```bash
15
+ pnpm add @skygraph/styles
16
+ # or: npm install @skygraph/styles
17
+ ```
11
18
 
12
- MIT © Ruslan Sinkevich
19
+ If you install one of the meta-packages (`skygraph-react`, `skygraph-vue`)
20
+ or an adapter directly (`@skygraph/react`, `@skygraph/vue`,
21
+ `@skygraph/angular`), this package is a transitive dependency — you don't
22
+ need to install or import it separately.
23
+
24
+ ## Usage
25
+
26
+ The simplest path is to import the bundle once at the entry of your app:
27
+
28
+ ```ts
29
+ import '@skygraph/styles'
30
+ ```
31
+
32
+ That ships tokens, reset, themes, transitions, print layer and every component
33
+ stylesheet (≈ one CSS file per component).
34
+
35
+ ### Cherry-pick component stylesheets
36
+
37
+ If you only use a subset of components and want a smaller payload, import per
38
+ slice:
39
+
40
+ ```ts
41
+ import '@skygraph/styles/tokens'
42
+ import '@skygraph/styles/reset'
43
+ import '@skygraph/styles/components/button'
44
+ import '@skygraph/styles/components/input'
45
+ import '@skygraph/styles/components/table'
46
+ import '@skygraph/styles/transitions'
47
+ import '@skygraph/styles/print'
48
+ ```
49
+
50
+ ### Themes
51
+
52
+ Both light and dark semantic tokens live in `tokens.css` — switch by setting a
53
+ data attribute on any wrapper element:
54
+
55
+ ```html
56
+ <html data-sg-theme="dark"> ... </html>
57
+ ```
58
+
59
+ The dedicated `./themes/default` and `./themes/dark` entrypoints are
60
+ convenience re-exports of the same `tokens.css` (kept for parity with older
61
+ docs and tutorials).
62
+
63
+ ## Subpath exports
64
+
65
+ | Subpath | What it ships |
66
+ | -------------------------------- | ----------------------------------- |
67
+ | `@skygraph/styles` | full bundle (`index.css`) |
68
+ | `@skygraph/styles/tokens` | design tokens only |
69
+ | `@skygraph/styles/reset` | minimal CSS reset |
70
+ | `@skygraph/styles/transitions` | transition keyframes / classes |
71
+ | `@skygraph/styles/print` | global `@media print` layer |
72
+ | `@skygraph/styles/themes/*` | theme presets (`default`, `dark`) |
73
+ | `@skygraph/styles/components/*` | one stylesheet per component |
74
+
75
+ ## Customisation
76
+
77
+ Stylesheets only read CSS Variables — override tokens to re-skin globally or
78
+ per-component, no `!important` wars:
79
+
80
+ ```css
81
+ :root {
82
+ --sg-color-primary: #7c3aed;
83
+ --sg-border-radius: 8px;
84
+ }
85
+
86
+ .dashboard-area {
87
+ /* component-scoped override */
88
+ --sg-table-row-hover-bg: rgba(124, 58, 237, 0.06);
89
+ }
90
+ ```
91
+
92
+ Full reference of stable tokens, slot classes and `classNames` / `styles` API
93
+ contract lives in the root repo:
94
+ [`docs/styling-contract.md`](../../docs/styling-contract.md).
95
+
96
+ ## License
97
+
98
+ MIT — same as the rest of SkyGraph.
@@ -0,0 +1,33 @@
1
+ .sg-autocomplete {
2
+ position: relative;
3
+ display: inline-block;
4
+ width: 100%;
5
+ }
6
+
7
+ .sg-autocomplete-loading {
8
+ --sg-spin-color: var(--sg-color-text-tertiary);
9
+ }
10
+
11
+ .sg-autocomplete-dropdown {
12
+ position: absolute;
13
+ top: 100%;
14
+ left: 0;
15
+ right: 0;
16
+ z-index: 100;
17
+ margin-top: 4px;
18
+ padding: var(--sg-padding-xs) 0;
19
+ background: var(--sg-color-bg-elevated);
20
+ border-radius: var(--sg-border-radius);
21
+ box-shadow: var(--sg-shadow-lg);
22
+ max-height: 256px;
23
+ overflow-y: auto;
24
+ }
25
+
26
+ .sg-autocomplete-option {
27
+ padding: var(--sg-padding-xs) var(--sg-padding-md);
28
+ cursor: pointer;
29
+ color: var(--sg-color-text);
30
+ transition: background var(--sg-transition-duration);
31
+ }
32
+
33
+ .sg-autocomplete-option:hover { background: var(--sg-color-bg-hover); }
@@ -0,0 +1,37 @@
1
+ .sg-avatar {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ overflow: hidden;
6
+ background: var(--sg-color-text-disabled);
7
+ color: var(--sg-color-white, #fff);
8
+ font-weight: 500;
9
+ vertical-align: middle;
10
+ white-space: nowrap;
11
+ }
12
+
13
+ .sg-avatar-circle {
14
+ border-radius: 50%;
15
+ }
16
+
17
+ .sg-avatar-square {
18
+ border-radius: var(--sg-border-radius);
19
+ }
20
+
21
+ .sg-avatar-image {
22
+ width: 100%;
23
+ height: 100%;
24
+ object-fit: cover;
25
+ display: block;
26
+ }
27
+
28
+ .sg-avatar-icon {
29
+ display: flex;
30
+ align-items: center;
31
+ justify-content: center;
32
+ }
33
+
34
+ .sg-avatar-text {
35
+ white-space: nowrap;
36
+ user-select: none;
37
+ }
@@ -0,0 +1,102 @@
1
+ .sg-badge {
2
+ position: relative;
3
+ display: inline-block;
4
+ line-height: 1;
5
+ }
6
+
7
+ /* Standalone mode: count/dot rendered without a wrapped child.
8
+ Lays out the indicator inline instead of as an absolute overlay so it
9
+ does not get clipped by parents (table cells, flex rows, etc.). */
10
+ .sg-badge-standalone {
11
+ display: inline-flex;
12
+ align-items: center;
13
+ vertical-align: middle;
14
+ line-height: var(--sg-line-height);
15
+ }
16
+
17
+ .sg-badge-standalone > .sg-badge-count,
18
+ .sg-badge-standalone > .sg-badge-dot {
19
+ position: static;
20
+ transform: none;
21
+ box-shadow: none;
22
+ }
23
+
24
+ .sg-badge-count {
25
+ position: absolute;
26
+ top: 0;
27
+ right: 0;
28
+ transform: translate(50%, -50%);
29
+ min-width: 20px;
30
+ height: 20px;
31
+ padding: 0 6px;
32
+ font-size: var(--sg-font-size-sm);
33
+ font-weight: 500;
34
+ line-height: 20px;
35
+ text-align: center;
36
+ white-space: nowrap;
37
+ color: var(--sg-color-white, #fff);
38
+ background: var(--sg-color-error);
39
+ border-radius: 10px;
40
+ box-shadow: 0 0 0 1px var(--sg-color-bg);
41
+ z-index: var(--sg-z-base);
42
+ }
43
+
44
+ .sg-badge-dot {
45
+ position: absolute;
46
+ top: 0;
47
+ right: 0;
48
+ transform: translate(50%, -50%);
49
+ width: 8px;
50
+ height: 8px;
51
+ background: var(--sg-color-error);
52
+ border-radius: 50%;
53
+ box-shadow: 0 0 0 1px var(--sg-color-bg);
54
+ z-index: var(--sg-z-base);
55
+ }
56
+
57
+ /* Status badge (standalone) */
58
+ .sg-badge-status {
59
+ display: inline-flex;
60
+ align-items: center;
61
+ gap: var(--sg-padding-sm);
62
+ line-height: var(--sg-line-height);
63
+ }
64
+
65
+ .sg-badge-status-dot {
66
+ width: 6px;
67
+ height: 6px;
68
+ border-radius: 50%;
69
+ flex-shrink: 0;
70
+ }
71
+
72
+ .sg-badge-status-success {
73
+ background: var(--sg-color-success);
74
+ }
75
+ .sg-badge-status-error {
76
+ background: var(--sg-color-error);
77
+ }
78
+ .sg-badge-status-warning {
79
+ background: var(--sg-color-warning);
80
+ }
81
+ .sg-badge-status-default {
82
+ background: var(--sg-color-text-disabled);
83
+ }
84
+
85
+ .sg-badge-status-processing {
86
+ background: var(--sg-color-primary);
87
+ animation: sg-badge-processing 1.2s ease-in-out infinite;
88
+ }
89
+
90
+ @keyframes sg-badge-processing {
91
+ 0% {
92
+ box-shadow: 0 0 0 0 var(--sg-color-primary);
93
+ }
94
+ 100% {
95
+ box-shadow: 0 0 0 4px transparent;
96
+ }
97
+ }
98
+
99
+ .sg-badge-status-text {
100
+ font-size: var(--sg-font-size);
101
+ color: var(--sg-color-text);
102
+ }
@@ -0,0 +1,29 @@
1
+ .sg-breadcrumb {
2
+ display: flex;
3
+ align-items: center;
4
+ flex-wrap: wrap;
5
+ font-size: var(--sg-font-size);
6
+ color: var(--sg-color-text);
7
+ line-height: var(--sg-line-height);
8
+ }
9
+
10
+ .sg-breadcrumb-link {
11
+ color: var(--sg-color-text-secondary);
12
+ text-decoration: none;
13
+ cursor: pointer;
14
+ transition: color var(--sg-transition-duration) var(--sg-transition-timing);
15
+ }
16
+
17
+ .sg-breadcrumb-link:hover {
18
+ color: var(--sg-color-primary);
19
+ }
20
+
21
+ .sg-breadcrumb-current {
22
+ color: var(--sg-color-text);
23
+ font-weight: 500;
24
+ }
25
+
26
+ .sg-breadcrumb-separator {
27
+ margin: 0 var(--sg-padding-sm);
28
+ color: var(--sg-color-text-tertiary);
29
+ }
@@ -0,0 +1,181 @@
1
+ .sg-button {
2
+ --sg-btn-bg: transparent;
3
+ --sg-btn-color: var(--sg-color-text);
4
+ --sg-btn-border: var(--sg-color-border);
5
+ --sg-btn-height: var(--sg-height-md);
6
+ --sg-btn-padding: 0 var(--sg-padding-md);
7
+ --sg-btn-radius: var(--sg-border-radius);
8
+ --sg-btn-font-size: var(--sg-font-size);
9
+
10
+ display: inline-flex;
11
+ align-items: center;
12
+ justify-content: center;
13
+ gap: var(--sg-padding-xs);
14
+ height: var(--sg-btn-height);
15
+ padding: var(--sg-btn-padding);
16
+ font-size: var(--sg-btn-font-size);
17
+ line-height: var(--sg-line-height);
18
+ color: var(--sg-btn-color);
19
+ background: var(--sg-btn-bg);
20
+ border: 1px solid var(--sg-btn-border);
21
+ border-radius: var(--sg-btn-radius);
22
+ cursor: pointer;
23
+ transition: color var(--sg-transition-duration) var(--sg-transition-timing),
24
+ background var(--sg-transition-duration) var(--sg-transition-timing),
25
+ border-color var(--sg-transition-duration) var(--sg-transition-timing),
26
+ box-shadow var(--sg-transition-duration) var(--sg-transition-timing);
27
+ user-select: none;
28
+ white-space: nowrap;
29
+ font-family: inherit;
30
+ }
31
+
32
+ .sg-button:hover {
33
+ --sg-btn-color: var(--sg-color-primary-hover);
34
+ --sg-btn-border: var(--sg-color-primary-hover);
35
+ }
36
+
37
+ .sg-button:active {
38
+ --sg-btn-color: var(--sg-color-primary-active);
39
+ --sg-btn-border: var(--sg-color-primary-active);
40
+ }
41
+
42
+ .sg-button:focus-visible {
43
+ outline: none;
44
+ --sg-btn-border: var(--sg-color-primary);
45
+ box-shadow: 0 0 0 2px var(--sg-color-primary-bg);
46
+ }
47
+
48
+ .sg-button:disabled {
49
+ --sg-btn-color: var(--sg-color-text-disabled);
50
+ --sg-btn-border: var(--sg-color-border);
51
+ --sg-btn-bg: var(--sg-color-bg-disabled);
52
+ cursor: not-allowed;
53
+ }
54
+
55
+ .sg-button-primary {
56
+ --sg-btn-bg: var(--sg-color-primary);
57
+ --sg-btn-color: var(--sg-color-white);
58
+ --sg-btn-border: var(--sg-color-primary);
59
+ }
60
+ .sg-button-primary:hover {
61
+ --sg-btn-bg: var(--sg-color-primary-hover);
62
+ --sg-btn-color: var(--sg-color-white);
63
+ --sg-btn-border: var(--sg-color-primary-hover);
64
+ }
65
+ .sg-button-primary:active {
66
+ --sg-btn-bg: var(--sg-color-primary-active);
67
+ --sg-btn-color: var(--sg-color-white);
68
+ --sg-btn-border: var(--sg-color-primary-active);
69
+ }
70
+
71
+ .sg-button-dashed {
72
+ border-style: dashed;
73
+ }
74
+
75
+ .sg-button-text {
76
+ --sg-btn-border: transparent;
77
+ --sg-btn-bg: transparent;
78
+ }
79
+ .sg-button-text:hover {
80
+ --sg-btn-bg: var(--sg-color-bg-hover);
81
+ --sg-btn-border: transparent;
82
+ }
83
+
84
+ .sg-button-link {
85
+ --sg-btn-color: var(--sg-color-primary);
86
+ --sg-btn-border: transparent;
87
+ --sg-btn-bg: transparent;
88
+ }
89
+ .sg-button-link:hover {
90
+ --sg-btn-color: var(--sg-color-primary-hover);
91
+ }
92
+
93
+ .sg-button-small {
94
+ --sg-btn-height: var(--sg-height-sm);
95
+ --sg-btn-padding: 0 var(--sg-padding-sm);
96
+ --sg-btn-font-size: var(--sg-font-size-sm);
97
+ }
98
+ .sg-button-large {
99
+ --sg-btn-height: var(--sg-height-lg);
100
+ --sg-btn-padding: 0 var(--sg-padding-lg);
101
+ --sg-btn-font-size: var(--sg-font-size-lg);
102
+ }
103
+
104
+ .sg-button-loading {
105
+ cursor: default;
106
+ opacity: 0.65;
107
+ --sg-spin-color: currentColor;
108
+ }
109
+
110
+ /* === Danger variant ===
111
+ * Combines with `type`:
112
+ * default → red text + red border
113
+ * primary → solid red fill
114
+ * dashed → red dashed border + red text
115
+ * text → red text, transparent bg (red bg on hover)
116
+ * link → red text, no border
117
+ */
118
+ .sg-button-danger {
119
+ --sg-btn-color: var(--sg-color-error);
120
+ --sg-btn-border: var(--sg-color-error);
121
+ }
122
+ .sg-button-danger:hover {
123
+ --sg-btn-color: var(--sg-red-6);
124
+ --sg-btn-border: var(--sg-red-6);
125
+ }
126
+ .sg-button-danger:active {
127
+ --sg-btn-color: var(--sg-red-6);
128
+ --sg-btn-border: var(--sg-red-6);
129
+ }
130
+ .sg-button-danger:focus-visible {
131
+ --sg-btn-border: var(--sg-color-error);
132
+ box-shadow: 0 0 0 2px var(--sg-color-error-bg);
133
+ }
134
+
135
+ .sg-button-primary.sg-button-danger {
136
+ --sg-btn-bg: var(--sg-color-error);
137
+ --sg-btn-color: var(--sg-color-white);
138
+ --sg-btn-border: var(--sg-color-error);
139
+ }
140
+ .sg-button-primary.sg-button-danger:hover {
141
+ --sg-btn-bg: var(--sg-red-6);
142
+ --sg-btn-color: var(--sg-color-white);
143
+ --sg-btn-border: var(--sg-red-6);
144
+ }
145
+ .sg-button-primary.sg-button-danger:active {
146
+ --sg-btn-bg: var(--sg-red-6);
147
+ --sg-btn-color: var(--sg-color-white);
148
+ --sg-btn-border: var(--sg-red-6);
149
+ }
150
+
151
+ .sg-button-text.sg-button-danger {
152
+ --sg-btn-bg: transparent;
153
+ --sg-btn-border: transparent;
154
+ --sg-btn-color: var(--sg-color-error);
155
+ }
156
+ .sg-button-text.sg-button-danger:hover {
157
+ --sg-btn-bg: var(--sg-color-error-bg);
158
+ --sg-btn-border: transparent;
159
+ --sg-btn-color: var(--sg-color-error);
160
+ }
161
+
162
+ .sg-button-link.sg-button-danger {
163
+ --sg-btn-bg: transparent;
164
+ --sg-btn-border: transparent;
165
+ --sg-btn-color: var(--sg-color-error);
166
+ }
167
+ .sg-button-link.sg-button-danger:hover {
168
+ --sg-btn-color: var(--sg-red-6);
169
+ }
170
+
171
+ .sg-button-danger:disabled {
172
+ --sg-btn-color: var(--sg-color-text-disabled);
173
+ --sg-btn-border: var(--sg-color-border);
174
+ --sg-btn-bg: var(--sg-color-bg-disabled);
175
+ }
176
+
177
+ /* === Block: stretch to parent width === */
178
+ .sg-button-block {
179
+ display: flex;
180
+ width: 100%;
181
+ }