gbs-add-block 2.0.4 → 2.1.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 (30) hide show
  1. package/.gbs/skills/gbs-components/references/styling.md +21 -15
  2. package/README.md +22 -7
  3. package/package.json +1 -1
  4. package/source/beta-components/accordion/styles.css +5 -5
  5. package/source/beta-components/alert/styles.css +4 -4
  6. package/source/beta-components/avatar/styles.css +226 -227
  7. package/source/beta-components/badge/styles.css +7 -7
  8. package/source/beta-components/breadcrumb/styles.css +5 -4
  9. package/source/beta-components/button/styles.css +5 -4
  10. package/source/beta-components/card/styles.css +5 -4
  11. package/source/beta-components/checkbox/styles.css +5 -4
  12. package/source/beta-components/combobox/styles.css +4 -4
  13. package/source/beta-components/data-grid/styles.css +7 -8
  14. package/source/beta-components/date-picker/styles.css +4 -4
  15. package/source/beta-components/dialog/styles.css +5 -4
  16. package/source/beta-components/file-uploader/styles.css +5 -4
  17. package/source/beta-components/input/styles.css +5 -4
  18. package/source/beta-components/menu/styles.css +5 -4
  19. package/source/beta-components/modal/styles.css +5 -4
  20. package/source/beta-components/number-input/styles.css +5 -5
  21. package/source/beta-components/popover/styles.css +5 -4
  22. package/source/beta-components/progress/styles.css +1 -2
  23. package/source/beta-components/radio-group/styles.css +270 -270
  24. package/source/beta-components/skeleton/styles.css +5 -4
  25. package/source/beta-components/spinner/styles.css +174 -174
  26. package/source/beta-components/switch/styles.css +229 -229
  27. package/source/beta-components/tabs/styles.css +264 -264
  28. package/source/beta-components/textarea/styles.css +5 -4
  29. package/source/beta-components/toaster/styles.css +1 -2
  30. package/source/beta-components/tooltip/styles.css +5 -4
@@ -1,229 +1,229 @@
1
- /*
2
- * Switch styles.
3
- *
4
- * The control is the native <input type="checkbox" role="switch"> with
5
- * `appearance: none`, drawn as a track and a thumb, so it keeps native
6
- * behavior and posts with forms. Tokens read the shared --gbs-* variables when
7
- * they are set on an ancestor (set them on :root to theme every component at
8
- * once). Rules live in the `components` layer, so utility classes passed
9
- * through `className` / `classNames` override them.
10
- */
11
- @layer theme, base, components, utilities;
12
-
13
- @layer components {
14
- .sw-root {
15
- --sw-fg: var(--gbs-fg, var(--dg-fg, light-dark(#18181b, #f4f4f5)));
16
- --sw-muted: var(--gbs-muted, var(--dg-muted, light-dark(#71717a, #a1a1aa)));
17
- --sw-track: var(--gbs-subtle, light-dark(#d4d4d8, #3f3f46));
18
- --sw-thumb: var(--gbs-bg, var(--dg-bg, light-dark(#ffffff, #f4f4f5)));
19
- --sw-accent: var(--gbs-accent, var(--dg-accent, light-dark(#2563eb, #60a5fa)));
20
- --sw-focus: var(--gbs-focus, var(--dg-focus, light-dark(#2563eb, #60a5fa)));
21
- --sw-danger: var(--gbs-danger, var(--dg-danger, light-dark(#dc2626, #f87171)));
22
- --sw-font-size: var(--gbs-font-size, var(--dg-font-size, 13px));
23
- --sw-height: 20px;
24
- --sw-width: 36px;
25
- --sw-gap: 3px;
26
- --sw-duration: 160ms;
27
-
28
- color-scheme: inherit;
29
- display: flex;
30
- align-items: flex-start;
31
- gap: 8px;
32
- min-width: 0;
33
- font-size: var(--sw-font-size);
34
- line-height: 1.4;
35
- color: var(--sw-fg);
36
- }
37
-
38
- :where(.dark, [data-theme="dark"]) .sw-root {
39
- color-scheme: dark;
40
- }
41
- :where(.light, [data-theme="light"]) .sw-root {
42
- color-scheme: light;
43
- }
44
-
45
- :where(.sw-root) *,
46
- :where(.sw-root) *::before,
47
- :where(.sw-root) *::after {
48
- box-sizing: border-box;
49
- }
50
-
51
- .sw-root[data-size="sm"] {
52
- --sw-height: 16px;
53
- --sw-width: 28px;
54
- --sw-gap: 2px;
55
- --sw-font-size: 12px;
56
- }
57
- .sw-root[data-size="lg"] {
58
- --sw-height: 24px;
59
- --sw-width: 44px;
60
- --sw-font-size: 14px;
61
- }
62
-
63
- /* The label first, the track pushed to the far edge: a settings row. */
64
- .sw-root[data-label-position="start"] {
65
- flex-direction: row-reverse;
66
- justify-content: space-between;
67
- }
68
-
69
- /* -------------------------------------------------------------- control */
70
-
71
- .sw-control {
72
- position: relative;
73
- display: inline-flex;
74
- flex: none;
75
- /* Line the track up with the first line of the label. */
76
- align-items: center;
77
- height: calc(var(--sw-font-size) * 1.4);
78
- }
79
-
80
- .sw-input {
81
- position: absolute;
82
- inset: 0;
83
- width: 100%;
84
- height: 100%;
85
- margin: 0;
86
- padding: 0;
87
- border: 0;
88
- appearance: none;
89
- background: none;
90
- cursor: pointer;
91
- }
92
- .sw-input:disabled {
93
- cursor: not-allowed;
94
- }
95
- .sw-root[data-readonly] .sw-input {
96
- cursor: default;
97
- }
98
-
99
- .sw-track {
100
- display: inline-flex;
101
- align-items: center;
102
- width: var(--sw-width);
103
- height: var(--sw-height);
104
- padding: var(--sw-gap);
105
- border-radius: 999px;
106
- background: var(--sw-track);
107
- transition: background-color var(--sw-duration) ease;
108
- }
109
-
110
- .sw-thumb {
111
- width: calc(var(--sw-height) - var(--sw-gap) * 2);
112
- height: calc(var(--sw-height) - var(--sw-gap) * 2);
113
- border-radius: 50%;
114
- background: var(--sw-thumb);
115
- box-shadow: 0 1px 2px light-dark(rgb(0 0 0 / 0.25), rgb(0 0 0 / 0.5));
116
- /* `translate` rather than `margin-inline-start`, so it animates on the
117
- compositor and mirrors itself in right-to-left layouts. */
118
- translate: 0;
119
- transition: translate var(--sw-duration) ease;
120
- }
121
-
122
- .sw-input:checked + .sw-track {
123
- background: var(--sw-accent);
124
- }
125
- .sw-input:checked + .sw-track .sw-thumb {
126
- translate: calc(var(--sw-width) - var(--sw-height)) 0;
127
- }
128
- .sw-control:dir(rtl) .sw-input:checked + .sw-track .sw-thumb {
129
- translate: calc((var(--sw-width) - var(--sw-height)) * -1) 0;
130
- }
131
-
132
- .sw-input:focus-visible + .sw-track {
133
- outline: 2px solid var(--sw-focus);
134
- outline-offset: 2px;
135
- }
136
- .sw-input:hover:not(:disabled) + .sw-track {
137
- background: color-mix(in oklab, var(--sw-track) 88%, var(--sw-fg));
138
- }
139
- .sw-input:checked:hover:not(:disabled) + .sw-track {
140
- background: color-mix(in oklab, var(--sw-accent) 88%, black);
141
- }
142
-
143
- .sw-root[data-invalid] .sw-track {
144
- outline: 1px solid var(--sw-danger);
145
- outline-offset: 1px;
146
- }
147
- /* Only the track dims; the label keeps its contrast, as the Checkbox's does. */
148
- .sw-input:disabled + .sw-track {
149
- opacity: 0.5;
150
- }
151
-
152
- /* The thumb keeps turning while the change is being saved. */
153
- .sw-root[data-saving] .sw-thumb {
154
- border: 2px solid transparent;
155
- border-top-color: var(--sw-accent);
156
- animation: sw-spin 700ms linear infinite;
157
- }
158
- .sw-root[data-saving] .sw-input {
159
- cursor: progress;
160
- }
161
-
162
- @keyframes sw-spin {
163
- to {
164
- rotate: 1turn;
165
- }
166
- }
167
-
168
- /* ----------------------------------------------------------------- text */
169
-
170
- .sw-text {
171
- display: flex;
172
- flex-direction: column;
173
- gap: 2px;
174
- min-width: 0;
175
- }
176
- .sw-label {
177
- font-weight: 500;
178
- cursor: pointer;
179
- }
180
- .sw-root[data-disabled] .sw-label {
181
- color: var(--sw-muted);
182
- cursor: not-allowed;
183
- }
184
- .sw-label[data-required]::after {
185
- content: " *";
186
- color: var(--sw-danger);
187
- }
188
- .sw-description {
189
- color: var(--sw-muted);
190
- text-wrap: pretty;
191
- }
192
- .sw-error {
193
- color: var(--sw-danger);
194
- text-wrap: pretty;
195
- }
196
-
197
- .sw-sr-only {
198
- position: absolute;
199
- width: 1px;
200
- height: 1px;
201
- margin: -1px;
202
- padding: 0;
203
- border: 0;
204
- overflow: hidden;
205
- clip-path: inset(50%);
206
- white-space: nowrap;
207
- }
208
-
209
- @media (prefers-reduced-motion: reduce) {
210
- .sw-root {
211
- --sw-duration: 0s;
212
- }
213
- .sw-root[data-saving] .sw-thumb {
214
- animation-duration: 2s;
215
- }
216
- }
217
-
218
- @media (forced-colors: active) {
219
- .sw-track {
220
- border: 1px solid CanvasText;
221
- }
222
- .sw-input:checked + .sw-track {
223
- background: Highlight;
224
- }
225
- .sw-thumb {
226
- background: CanvasText;
227
- }
228
- }
229
- }
1
+ /*
2
+ * Switch styles.
3
+ *
4
+ * The control is the native <input type="checkbox" role="switch"> with
5
+ * `appearance: none`, drawn as a track and a thumb, so it keeps native
6
+ * behavior and posts with forms. Tokens read the shared --gbs-* variables when
7
+ * they are set on an ancestor (set them on :root to theme every component at
8
+ * once). Rules live in the `gbs` layer. Declare where that sits in your global
9
+ * CSS — e.g. `@layer reset, gbs, app, utilities;` — and anything in a later
10
+ * layer, Tailwind utilities included, overrides them.
11
+ */
12
+
13
+ @layer gbs {
14
+ .sw-root {
15
+ --sw-fg: var(--gbs-fg, var(--dg-fg, light-dark(#18181b, #f4f4f5)));
16
+ --sw-muted: var(--gbs-muted, var(--dg-muted, light-dark(#71717a, #a1a1aa)));
17
+ --sw-track: var(--gbs-subtle, light-dark(#d4d4d8, #3f3f46));
18
+ --sw-thumb: var(--gbs-bg, var(--dg-bg, light-dark(#ffffff, #f4f4f5)));
19
+ --sw-accent: var(--gbs-accent, var(--dg-accent, light-dark(#2563eb, #60a5fa)));
20
+ --sw-focus: var(--gbs-focus, var(--dg-focus, light-dark(#2563eb, #60a5fa)));
21
+ --sw-danger: var(--gbs-danger, var(--dg-danger, light-dark(#dc2626, #f87171)));
22
+ --sw-font-size: var(--gbs-font-size, var(--dg-font-size, 13px));
23
+ --sw-height: 20px;
24
+ --sw-width: 36px;
25
+ --sw-gap: 3px;
26
+ --sw-duration: 160ms;
27
+
28
+ color-scheme: inherit;
29
+ display: flex;
30
+ align-items: flex-start;
31
+ gap: 8px;
32
+ min-width: 0;
33
+ font-size: var(--sw-font-size);
34
+ line-height: 1.4;
35
+ color: var(--sw-fg);
36
+ }
37
+
38
+ :where(.dark, [data-theme="dark"]) .sw-root {
39
+ color-scheme: dark;
40
+ }
41
+ :where(.light, [data-theme="light"]) .sw-root {
42
+ color-scheme: light;
43
+ }
44
+
45
+ :where(.sw-root) *,
46
+ :where(.sw-root) *::before,
47
+ :where(.sw-root) *::after {
48
+ box-sizing: border-box;
49
+ }
50
+
51
+ .sw-root[data-size="sm"] {
52
+ --sw-height: 16px;
53
+ --sw-width: 28px;
54
+ --sw-gap: 2px;
55
+ --sw-font-size: 12px;
56
+ }
57
+ .sw-root[data-size="lg"] {
58
+ --sw-height: 24px;
59
+ --sw-width: 44px;
60
+ --sw-font-size: 14px;
61
+ }
62
+
63
+ /* The label first, the track pushed to the far edge: a settings row. */
64
+ .sw-root[data-label-position="start"] {
65
+ flex-direction: row-reverse;
66
+ justify-content: space-between;
67
+ }
68
+
69
+ /* -------------------------------------------------------------- control */
70
+
71
+ .sw-control {
72
+ position: relative;
73
+ display: inline-flex;
74
+ flex: none;
75
+ /* Line the track up with the first line of the label. */
76
+ align-items: center;
77
+ height: calc(var(--sw-font-size) * 1.4);
78
+ }
79
+
80
+ .sw-input {
81
+ position: absolute;
82
+ inset: 0;
83
+ width: 100%;
84
+ height: 100%;
85
+ margin: 0;
86
+ padding: 0;
87
+ border: 0;
88
+ appearance: none;
89
+ background: none;
90
+ cursor: pointer;
91
+ }
92
+ .sw-input:disabled {
93
+ cursor: not-allowed;
94
+ }
95
+ .sw-root[data-readonly] .sw-input {
96
+ cursor: default;
97
+ }
98
+
99
+ .sw-track {
100
+ display: inline-flex;
101
+ align-items: center;
102
+ width: var(--sw-width);
103
+ height: var(--sw-height);
104
+ padding: var(--sw-gap);
105
+ border-radius: 999px;
106
+ background: var(--sw-track);
107
+ transition: background-color var(--sw-duration) ease;
108
+ }
109
+
110
+ .sw-thumb {
111
+ width: calc(var(--sw-height) - var(--sw-gap) * 2);
112
+ height: calc(var(--sw-height) - var(--sw-gap) * 2);
113
+ border-radius: 50%;
114
+ background: var(--sw-thumb);
115
+ box-shadow: 0 1px 2px light-dark(rgb(0 0 0 / 0.25), rgb(0 0 0 / 0.5));
116
+ /* `translate` rather than `margin-inline-start`, so it animates on the
117
+ compositor and mirrors itself in right-to-left layouts. */
118
+ translate: 0;
119
+ transition: translate var(--sw-duration) ease;
120
+ }
121
+
122
+ .sw-input:checked + .sw-track {
123
+ background: var(--sw-accent);
124
+ }
125
+ .sw-input:checked + .sw-track .sw-thumb {
126
+ translate: calc(var(--sw-width) - var(--sw-height)) 0;
127
+ }
128
+ .sw-control:dir(rtl) .sw-input:checked + .sw-track .sw-thumb {
129
+ translate: calc((var(--sw-width) - var(--sw-height)) * -1) 0;
130
+ }
131
+
132
+ .sw-input:focus-visible + .sw-track {
133
+ outline: 2px solid var(--sw-focus);
134
+ outline-offset: 2px;
135
+ }
136
+ .sw-input:hover:not(:disabled) + .sw-track {
137
+ background: color-mix(in oklab, var(--sw-track) 88%, var(--sw-fg));
138
+ }
139
+ .sw-input:checked:hover:not(:disabled) + .sw-track {
140
+ background: color-mix(in oklab, var(--sw-accent) 88%, black);
141
+ }
142
+
143
+ .sw-root[data-invalid] .sw-track {
144
+ outline: 1px solid var(--sw-danger);
145
+ outline-offset: 1px;
146
+ }
147
+ /* Only the track dims; the label keeps its contrast, as the Checkbox's does. */
148
+ .sw-input:disabled + .sw-track {
149
+ opacity: 0.5;
150
+ }
151
+
152
+ /* The thumb keeps turning while the change is being saved. */
153
+ .sw-root[data-saving] .sw-thumb {
154
+ border: 2px solid transparent;
155
+ border-top-color: var(--sw-accent);
156
+ animation: sw-spin 700ms linear infinite;
157
+ }
158
+ .sw-root[data-saving] .sw-input {
159
+ cursor: progress;
160
+ }
161
+
162
+ @keyframes sw-spin {
163
+ to {
164
+ rotate: 1turn;
165
+ }
166
+ }
167
+
168
+ /* ----------------------------------------------------------------- text */
169
+
170
+ .sw-text {
171
+ display: flex;
172
+ flex-direction: column;
173
+ gap: 2px;
174
+ min-width: 0;
175
+ }
176
+ .sw-label {
177
+ font-weight: 500;
178
+ cursor: pointer;
179
+ }
180
+ .sw-root[data-disabled] .sw-label {
181
+ color: var(--sw-muted);
182
+ cursor: not-allowed;
183
+ }
184
+ .sw-label[data-required]::after {
185
+ content: " *";
186
+ color: var(--sw-danger);
187
+ }
188
+ .sw-description {
189
+ color: var(--sw-muted);
190
+ text-wrap: pretty;
191
+ }
192
+ .sw-error {
193
+ color: var(--sw-danger);
194
+ text-wrap: pretty;
195
+ }
196
+
197
+ .sw-sr-only {
198
+ position: absolute;
199
+ width: 1px;
200
+ height: 1px;
201
+ margin: -1px;
202
+ padding: 0;
203
+ border: 0;
204
+ overflow: hidden;
205
+ clip-path: inset(50%);
206
+ white-space: nowrap;
207
+ }
208
+
209
+ @media (prefers-reduced-motion: reduce) {
210
+ .sw-root {
211
+ --sw-duration: 0s;
212
+ }
213
+ .sw-root[data-saving] .sw-thumb {
214
+ animation-duration: 2s;
215
+ }
216
+ }
217
+
218
+ @media (forced-colors: active) {
219
+ .sw-track {
220
+ border: 1px solid CanvasText;
221
+ }
222
+ .sw-input:checked + .sw-track {
223
+ background: Highlight;
224
+ }
225
+ .sw-thumb {
226
+ background: CanvasText;
227
+ }
228
+ }
229
+ }