@eqtylab/equality 3.3.1 → 3.5.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.
- package/dist/code-block.module.module.css.module.css +209 -96
- package/dist/generated/color-vars.css +10 -0
- package/dist/generated/global-light-tokens.css +10 -0
- package/dist/generated/light-tokens.css +10 -0
- package/dist/generated/tailwind-tokens.css +10 -0
- package/dist/index.cjs +60 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -3
- package/dist/index.d.ts +28 -3
- package/dist/index.js +59 -15
- package/dist/index.js.map +1 -1
- package/dist/theme.module.module.css.module.css +10 -0
- package/package.json +2 -3
|
@@ -49,103 +49,124 @@
|
|
|
49
49
|
flex-direction: column;
|
|
50
50
|
overflow: auto;
|
|
51
51
|
min-width: calc(0.25rem * 0);
|
|
52
|
+
&:focus-visible {
|
|
53
|
+
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
54
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
55
|
+
}
|
|
56
|
+
&:focus-visible {
|
|
57
|
+
--tw-ring-color: var(--color-focus-ring, color(display-p3 0.5242 0.2903 0.7705));
|
|
58
|
+
}
|
|
59
|
+
&:focus-visible {
|
|
60
|
+
--tw-ring-inset: inset;
|
|
61
|
+
}
|
|
62
|
+
font-family: var(--font-mono);
|
|
63
|
+
}
|
|
64
|
+
:global([data-equality-code-block]) {
|
|
52
65
|
font-family: var(--font-mono);
|
|
53
|
-
--syntax-comment:
|
|
54
|
-
--syntax-punctuation: #
|
|
55
|
-
--syntax-tag: #
|
|
56
|
-
--syntax-
|
|
57
|
-
--syntax-
|
|
58
|
-
--syntax-
|
|
59
|
-
--syntax-
|
|
60
|
-
--syntax-
|
|
61
|
-
--syntax-
|
|
62
|
-
--syntax-
|
|
63
|
-
--syntax-
|
|
64
|
-
--syntax-
|
|
66
|
+
--syntax-comment: #008000;
|
|
67
|
+
--syntax-punctuation: #000000;
|
|
68
|
+
--syntax-tag: #800000;
|
|
69
|
+
--syntax-property: #001080;
|
|
70
|
+
--syntax-constant: #098658;
|
|
71
|
+
--syntax-string: #a31515;
|
|
72
|
+
--syntax-selector: #800000;
|
|
73
|
+
--syntax-inserted: #795e26;
|
|
74
|
+
--syntax-deleted: #af00db;
|
|
75
|
+
--syntax-operator: #000000;
|
|
76
|
+
--syntax-variable: #001080;
|
|
77
|
+
--syntax-regexp: #811f3f;
|
|
78
|
+
--syntax-keyword: #af00db;
|
|
79
|
+
--syntax-function: #795e26;
|
|
80
|
+
--syntax-type: #267f99;
|
|
65
81
|
&:where(html[data-equality-theme=dark], html[data-equality-theme=dark] *, [data-equality-theme=dark] .root, [data-equality-theme=dark] .root *) {
|
|
66
|
-
--syntax-comment: #
|
|
67
|
-
--syntax-punctuation: #
|
|
68
|
-
--syntax-tag: #
|
|
69
|
-
--syntax-
|
|
70
|
-
--syntax-
|
|
71
|
-
--syntax-
|
|
72
|
-
--syntax-
|
|
73
|
-
--syntax-
|
|
74
|
-
--syntax-
|
|
75
|
-
--syntax-
|
|
76
|
-
--syntax-
|
|
77
|
-
--syntax-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
82
|
+
--syntax-comment: #6a9955;
|
|
83
|
+
--syntax-punctuation: #d4d4d4;
|
|
84
|
+
--syntax-tag: #569cd6;
|
|
85
|
+
--syntax-property: #9cdcfe;
|
|
86
|
+
--syntax-constant: #b5cea8;
|
|
87
|
+
--syntax-string: #ce9178;
|
|
88
|
+
--syntax-selector: #d7ba7d;
|
|
89
|
+
--syntax-inserted: #dcdcaa;
|
|
90
|
+
--syntax-deleted: #c586c0;
|
|
91
|
+
--syntax-operator: #d4d4d4;
|
|
92
|
+
--syntax-variable: #9cdcfe;
|
|
93
|
+
--syntax-regexp: #d16969;
|
|
94
|
+
--syntax-keyword: #c586c0;
|
|
95
|
+
--syntax-function: #dcdcaa;
|
|
96
|
+
--syntax-type: #4ec9b0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
:global(pre[data-equality-code-block] > code) {
|
|
100
|
+
font: inherit;
|
|
101
|
+
color: inherit;
|
|
102
|
+
background: none;
|
|
103
|
+
text-shadow: none;
|
|
104
|
+
&::highlight(comment),
|
|
105
|
+
&::highlight(quote) {
|
|
106
|
+
color: var(--syntax-comment);
|
|
107
|
+
}
|
|
108
|
+
&::highlight(punctuation) {
|
|
109
|
+
color: var(--syntax-punctuation);
|
|
110
|
+
}
|
|
111
|
+
&::highlight(keyword),
|
|
112
|
+
&::highlight(storage),
|
|
113
|
+
&::highlight(at-rule),
|
|
114
|
+
&::highlight(doctype),
|
|
115
|
+
&::highlight(important),
|
|
116
|
+
&::highlight(section) {
|
|
117
|
+
color: var(--syntax-keyword);
|
|
118
|
+
}
|
|
119
|
+
&::highlight(operator) {
|
|
120
|
+
color: var(--syntax-operator);
|
|
121
|
+
}
|
|
122
|
+
&::highlight(string),
|
|
123
|
+
&::highlight(attribute-value),
|
|
124
|
+
&::highlight(link),
|
|
125
|
+
&::highlight(raw) {
|
|
126
|
+
color: var(--syntax-string);
|
|
127
|
+
}
|
|
128
|
+
&::highlight(regexp) {
|
|
129
|
+
color: var(--syntax-regexp);
|
|
130
|
+
}
|
|
131
|
+
&::highlight(numeric),
|
|
132
|
+
&::highlight(boolean),
|
|
133
|
+
&::highlight(constant),
|
|
134
|
+
&::highlight(symbol),
|
|
135
|
+
&::highlight(character-entity),
|
|
136
|
+
&::highlight(anchor),
|
|
137
|
+
&::highlight(entity) {
|
|
138
|
+
color: var(--syntax-constant);
|
|
139
|
+
}
|
|
140
|
+
&::highlight(function),
|
|
141
|
+
&::highlight(decorator),
|
|
142
|
+
&::highlight(animation) {
|
|
143
|
+
color: var(--syntax-function);
|
|
144
|
+
}
|
|
145
|
+
&::highlight(type),
|
|
146
|
+
&::highlight(support) {
|
|
147
|
+
color: var(--syntax-type);
|
|
148
|
+
}
|
|
149
|
+
&::highlight(variable),
|
|
150
|
+
&::highlight(interpolation) {
|
|
151
|
+
color: var(--syntax-variable);
|
|
152
|
+
}
|
|
153
|
+
&::highlight(property),
|
|
154
|
+
&::highlight(key),
|
|
155
|
+
&::highlight(attribute-name) {
|
|
156
|
+
color: var(--syntax-property);
|
|
157
|
+
}
|
|
158
|
+
&::highlight(tag) {
|
|
159
|
+
color: var(--syntax-tag);
|
|
160
|
+
}
|
|
161
|
+
&::highlight(selector) {
|
|
162
|
+
color: var(--syntax-selector);
|
|
163
|
+
}
|
|
164
|
+
&::highlight(inserted) {
|
|
165
|
+
color: var(--syntax-inserted);
|
|
166
|
+
}
|
|
167
|
+
&::highlight(deleted) {
|
|
168
|
+
color: var(--syntax-deleted);
|
|
169
|
+
}
|
|
149
170
|
}
|
|
150
171
|
.neutral {
|
|
151
172
|
border-color: var(--color-border, color(display-p3 0.7432 0.7432 0.7432));
|
|
@@ -174,10 +195,37 @@
|
|
|
174
195
|
line-height: var(--tw-leading, calc(1 / 0.75));
|
|
175
196
|
font-family: var(--font-mono);
|
|
176
197
|
}
|
|
198
|
+
.body {
|
|
199
|
+
display: flex;
|
|
200
|
+
min-width: calc(0.25rem * 0);
|
|
201
|
+
--code-line-height: 1.5;
|
|
202
|
+
}
|
|
203
|
+
.body.numbered {
|
|
204
|
+
width: max-content;
|
|
205
|
+
min-width: 100%;
|
|
206
|
+
}
|
|
207
|
+
.gutter {
|
|
208
|
+
border-right-color: var(--color-border, color(display-p3 0.7432 0.7432 0.7432));
|
|
209
|
+
background-color: var(--color-card-background, color(display-p3 1 1 1));
|
|
210
|
+
color: var(--color-text-tertiary, color(display-p3 0.5021 0.5021 0.5021));
|
|
211
|
+
position: sticky;
|
|
212
|
+
left: calc(0.25rem * 0);
|
|
213
|
+
margin-block: calc(0.25rem * 0);
|
|
214
|
+
flex-shrink: 0;
|
|
215
|
+
border-right-style: var(--tw-border-style);
|
|
216
|
+
border-right-width: 1px;
|
|
217
|
+
padding: calc(0.25rem * 3);
|
|
218
|
+
text-align: right;
|
|
219
|
+
-webkit-user-select: none;
|
|
220
|
+
user-select: none;
|
|
221
|
+
font-family: var(--font-mono);
|
|
222
|
+
line-height: var(--code-line-height);
|
|
223
|
+
}
|
|
177
224
|
.pre {
|
|
178
225
|
margin-block: calc(0.25rem * 0);
|
|
179
226
|
padding: calc(0.25rem * 3);
|
|
180
|
-
|
|
227
|
+
min-width: calc(0.25rem * 0);
|
|
228
|
+
line-height: var(--code-line-height);
|
|
181
229
|
tab-size: 4;
|
|
182
230
|
}
|
|
183
231
|
.code.wrap {
|
|
@@ -192,3 +240,68 @@
|
|
|
192
240
|
syntax: "*";
|
|
193
241
|
inherits: false;
|
|
194
242
|
}
|
|
243
|
+
@property --tw-shadow {
|
|
244
|
+
syntax: "*";
|
|
245
|
+
inherits: false;
|
|
246
|
+
initial-value: 0 0 #0000;
|
|
247
|
+
}
|
|
248
|
+
@property --tw-shadow-color {
|
|
249
|
+
syntax: "*";
|
|
250
|
+
inherits: false;
|
|
251
|
+
}
|
|
252
|
+
@property --tw-shadow-alpha {
|
|
253
|
+
syntax: "<percentage>";
|
|
254
|
+
inherits: false;
|
|
255
|
+
initial-value: 100%;
|
|
256
|
+
}
|
|
257
|
+
@property --tw-inset-shadow {
|
|
258
|
+
syntax: "*";
|
|
259
|
+
inherits: false;
|
|
260
|
+
initial-value: 0 0 #0000;
|
|
261
|
+
}
|
|
262
|
+
@property --tw-inset-shadow-color {
|
|
263
|
+
syntax: "*";
|
|
264
|
+
inherits: false;
|
|
265
|
+
}
|
|
266
|
+
@property --tw-inset-shadow-alpha {
|
|
267
|
+
syntax: "<percentage>";
|
|
268
|
+
inherits: false;
|
|
269
|
+
initial-value: 100%;
|
|
270
|
+
}
|
|
271
|
+
@property --tw-ring-color {
|
|
272
|
+
syntax: "*";
|
|
273
|
+
inherits: false;
|
|
274
|
+
}
|
|
275
|
+
@property --tw-ring-shadow {
|
|
276
|
+
syntax: "*";
|
|
277
|
+
inherits: false;
|
|
278
|
+
initial-value: 0 0 #0000;
|
|
279
|
+
}
|
|
280
|
+
@property --tw-inset-ring-color {
|
|
281
|
+
syntax: "*";
|
|
282
|
+
inherits: false;
|
|
283
|
+
}
|
|
284
|
+
@property --tw-inset-ring-shadow {
|
|
285
|
+
syntax: "*";
|
|
286
|
+
inherits: false;
|
|
287
|
+
initial-value: 0 0 #0000;
|
|
288
|
+
}
|
|
289
|
+
@property --tw-ring-inset {
|
|
290
|
+
syntax: "*";
|
|
291
|
+
inherits: false;
|
|
292
|
+
}
|
|
293
|
+
@property --tw-ring-offset-width {
|
|
294
|
+
syntax: "<length>";
|
|
295
|
+
inherits: false;
|
|
296
|
+
initial-value: 0px;
|
|
297
|
+
}
|
|
298
|
+
@property --tw-ring-offset-color {
|
|
299
|
+
syntax: "*";
|
|
300
|
+
inherits: false;
|
|
301
|
+
initial-value: #fff;
|
|
302
|
+
}
|
|
303
|
+
@property --tw-ring-offset-shadow {
|
|
304
|
+
syntax: "*";
|
|
305
|
+
inherits: false;
|
|
306
|
+
initial-value: 0 0 #0000;
|
|
307
|
+
}
|
|
@@ -87,6 +87,16 @@
|
|
|
87
87
|
--color-button-warning-text: color(display-p3 1 1 1);
|
|
88
88
|
--color-card-background: color(display-p3 1 1 1);
|
|
89
89
|
--color-card-border: color(display-p3 0.8698 0.8698 0.8698);
|
|
90
|
+
--color-control-accepted: color(display-p3 0.4378 0.2639 0.9228);
|
|
91
|
+
--color-control-comment: color(display-p3 0.4378 0.2639 0.9228);
|
|
92
|
+
--color-control-compliant: color(display-p3 0.2946 0.5328 0.2433);
|
|
93
|
+
--color-control-in-progress: color(display-p3 0.7481 0.374 0.214);
|
|
94
|
+
--color-control-in-review: color(display-p3 0.4378 0.2639 0.9228);
|
|
95
|
+
--color-control-non-compliant: color(display-p3 0.7365 0.2216 0.2026);
|
|
96
|
+
--color-control-not-applicable: color(display-p3 0.5021 0.5021 0.5021);
|
|
97
|
+
--color-control-not-started: color(display-p3 0.5021 0.5021 0.5021);
|
|
98
|
+
--color-control-question: color(display-p3 0.4378 0.2639 0.9228);
|
|
99
|
+
--color-control-ready-for-review: color(display-p3 0.2366 0.3261 0.7513);
|
|
90
100
|
--color-cyan-100: color(display-p3 0.8736 0.9466 0.9942);
|
|
91
101
|
--color-cyan-200: color(display-p3 0.7072 0.8271 0.9059);
|
|
92
102
|
--color-cyan-300: color(display-p3 0.5438 0.7094 0.8183);
|
|
@@ -91,6 +91,16 @@ html {
|
|
|
91
91
|
--color-button-warning-text: color(display-p3 1 1 1);
|
|
92
92
|
--color-card-background: color(display-p3 1 1 1);
|
|
93
93
|
--color-card-border: color(display-p3 0.8698 0.8698 0.8698);
|
|
94
|
+
--color-control-accepted: color(display-p3 0.4378 0.2639 0.9228);
|
|
95
|
+
--color-control-comment: color(display-p3 0.4378 0.2639 0.9228);
|
|
96
|
+
--color-control-compliant: color(display-p3 0.2946 0.5328 0.2433);
|
|
97
|
+
--color-control-in-progress: color(display-p3 0.7481 0.374 0.214);
|
|
98
|
+
--color-control-in-review: color(display-p3 0.4378 0.2639 0.9228);
|
|
99
|
+
--color-control-non-compliant: color(display-p3 0.7365 0.2216 0.2026);
|
|
100
|
+
--color-control-not-applicable: color(display-p3 0.5021 0.5021 0.5021);
|
|
101
|
+
--color-control-not-started: color(display-p3 0.5021 0.5021 0.5021);
|
|
102
|
+
--color-control-question: color(display-p3 0.4378 0.2639 0.9228);
|
|
103
|
+
--color-control-ready-for-review: color(display-p3 0.2366 0.3261 0.7513);
|
|
94
104
|
--color-cyan-100: color(display-p3 0.8736 0.9466 0.9942);
|
|
95
105
|
--color-cyan-200: color(display-p3 0.7072 0.8271 0.9059);
|
|
96
106
|
--color-cyan-300: color(display-p3 0.5438 0.7094 0.8183);
|
|
@@ -91,6 +91,16 @@
|
|
|
91
91
|
--color-button-warning-text: color(display-p3 1 1 1);
|
|
92
92
|
--color-card-background: color(display-p3 1 1 1);
|
|
93
93
|
--color-card-border: color(display-p3 0.8698 0.8698 0.8698);
|
|
94
|
+
--color-control-accepted: color(display-p3 0.4378 0.2639 0.9228);
|
|
95
|
+
--color-control-comment: color(display-p3 0.4378 0.2639 0.9228);
|
|
96
|
+
--color-control-compliant: color(display-p3 0.2946 0.5328 0.2433);
|
|
97
|
+
--color-control-in-progress: color(display-p3 0.7481 0.374 0.214);
|
|
98
|
+
--color-control-in-review: color(display-p3 0.4378 0.2639 0.9228);
|
|
99
|
+
--color-control-non-compliant: color(display-p3 0.7365 0.2216 0.2026);
|
|
100
|
+
--color-control-not-applicable: color(display-p3 0.5021 0.5021 0.5021);
|
|
101
|
+
--color-control-not-started: color(display-p3 0.5021 0.5021 0.5021);
|
|
102
|
+
--color-control-question: color(display-p3 0.4378 0.2639 0.9228);
|
|
103
|
+
--color-control-ready-for-review: color(display-p3 0.2366 0.3261 0.7513);
|
|
94
104
|
--color-cyan-100: color(display-p3 0.8736 0.9466 0.9942);
|
|
95
105
|
--color-cyan-200: color(display-p3 0.7072 0.8271 0.9059);
|
|
96
106
|
--color-cyan-300: color(display-p3 0.5438 0.7094 0.8183);
|
|
@@ -91,6 +91,16 @@
|
|
|
91
91
|
--color-button-warning-text: color(display-p3 1 1 1);
|
|
92
92
|
--color-card-background: color(display-p3 1 1 1);
|
|
93
93
|
--color-card-border: color(display-p3 0.8698 0.8698 0.8698);
|
|
94
|
+
--color-control-accepted: color(display-p3 0.4378 0.2639 0.9228);
|
|
95
|
+
--color-control-comment: color(display-p3 0.4378 0.2639 0.9228);
|
|
96
|
+
--color-control-compliant: color(display-p3 0.2946 0.5328 0.2433);
|
|
97
|
+
--color-control-in-progress: color(display-p3 0.7481 0.374 0.214);
|
|
98
|
+
--color-control-in-review: color(display-p3 0.4378 0.2639 0.9228);
|
|
99
|
+
--color-control-non-compliant: color(display-p3 0.7365 0.2216 0.2026);
|
|
100
|
+
--color-control-not-applicable: color(display-p3 0.5021 0.5021 0.5021);
|
|
101
|
+
--color-control-not-started: color(display-p3 0.5021 0.5021 0.5021);
|
|
102
|
+
--color-control-question: color(display-p3 0.4378 0.2639 0.9228);
|
|
103
|
+
--color-control-ready-for-review: color(display-p3 0.2366 0.3261 0.7513);
|
|
94
104
|
--color-cyan-100: color(display-p3 0.8736 0.9466 0.9942);
|
|
95
105
|
--color-cyan-200: color(display-p3 0.7072 0.8271 0.9059);
|
|
96
106
|
--color-cyan-300: color(display-p3 0.5438 0.7094 0.8183);
|
package/dist/index.cjs
CHANGED
|
@@ -24,9 +24,9 @@ var styles11 = require('./card-content-header.module.module.css.module.css');
|
|
|
24
24
|
var styles12 = require('./card.module.module.css.module.css');
|
|
25
25
|
var CheckboxPrimitive = require('@radix-ui/react-checkbox');
|
|
26
26
|
var styles13 = require('./checkbox.module.module.css.module.css');
|
|
27
|
-
var reactSyntaxHighlighter = require('react-syntax-highlighter');
|
|
28
27
|
var styles15 = require('./code-block.module.module.css.module.css');
|
|
29
28
|
var styles14 = require('./icon-button.module.module.css.module.css');
|
|
29
|
+
var microlighter = require('microlighter');
|
|
30
30
|
var cmdk = require('cmdk');
|
|
31
31
|
var styles17 = require('./command.module.module.css.module.css');
|
|
32
32
|
var DialogPrimitive = require('@radix-ui/react-dialog');
|
|
@@ -712,6 +712,7 @@ var equality_tokens_default = {
|
|
|
712
712
|
color: {
|
|
713
713
|
brand: {
|
|
714
714
|
green: {
|
|
715
|
+
$deprecated: true,
|
|
715
716
|
$type: "color",
|
|
716
717
|
$value: {
|
|
717
718
|
colorSpace: "display-p3",
|
|
@@ -720,6 +721,7 @@ var equality_tokens_default = {
|
|
|
720
721
|
}
|
|
721
722
|
},
|
|
722
723
|
primary: {
|
|
724
|
+
$deprecated: true,
|
|
723
725
|
$type: "color",
|
|
724
726
|
$value: {
|
|
725
727
|
colorSpace: "display-p3",
|
|
@@ -728,6 +730,7 @@ var equality_tokens_default = {
|
|
|
728
730
|
}
|
|
729
731
|
},
|
|
730
732
|
red: {
|
|
733
|
+
$deprecated: true,
|
|
731
734
|
$type: "color",
|
|
732
735
|
$value: {
|
|
733
736
|
colorSpace: "display-p3",
|
|
@@ -736,6 +739,7 @@ var equality_tokens_default = {
|
|
|
736
739
|
}
|
|
737
740
|
},
|
|
738
741
|
secondary: {
|
|
742
|
+
$deprecated: true,
|
|
739
743
|
$type: "color",
|
|
740
744
|
$value: {
|
|
741
745
|
colorSpace: "display-p3",
|
|
@@ -744,6 +748,7 @@ var equality_tokens_default = {
|
|
|
744
748
|
}
|
|
745
749
|
},
|
|
746
750
|
yellow: {
|
|
751
|
+
$deprecated: true,
|
|
747
752
|
$type: "color",
|
|
748
753
|
$value: {
|
|
749
754
|
colorSpace: "display-p3",
|
|
@@ -1219,7 +1224,29 @@ function CopyButton({
|
|
|
1219
1224
|
}
|
|
1220
1225
|
);
|
|
1221
1226
|
}
|
|
1222
|
-
var
|
|
1227
|
+
var CODE_BLOCK_ATTRIBUTE = "data-equality-code-block";
|
|
1228
|
+
var SELECTOR = `pre[${CODE_BLOCK_ATTRIBUTE}] > code`;
|
|
1229
|
+
var tail = Promise.resolve();
|
|
1230
|
+
var queued = null;
|
|
1231
|
+
var isSupported = () => typeof window !== "undefined" && typeof CSS !== "undefined" && Boolean(CSS.highlights);
|
|
1232
|
+
var scheduleHighlight = () => {
|
|
1233
|
+
if (!isSupported()) return Promise.resolve();
|
|
1234
|
+
if (queued) return queued;
|
|
1235
|
+
const pass = tail.then(
|
|
1236
|
+
() => new Promise((resolve) => {
|
|
1237
|
+
window.requestAnimationFrame(() => {
|
|
1238
|
+
queued = null;
|
|
1239
|
+
microlighter.highlightAll({ selector: SELECTOR }).then(
|
|
1240
|
+
() => resolve(),
|
|
1241
|
+
() => resolve()
|
|
1242
|
+
);
|
|
1243
|
+
});
|
|
1244
|
+
})
|
|
1245
|
+
);
|
|
1246
|
+
queued = pass;
|
|
1247
|
+
tail = pass;
|
|
1248
|
+
return pass;
|
|
1249
|
+
};
|
|
1223
1250
|
var CodeBlock = ({
|
|
1224
1251
|
className,
|
|
1225
1252
|
title,
|
|
@@ -1227,28 +1254,45 @@ var CodeBlock = ({
|
|
|
1227
1254
|
language = "text",
|
|
1228
1255
|
variant = "neutral",
|
|
1229
1256
|
codeLabel,
|
|
1230
|
-
copy
|
|
1257
|
+
copy,
|
|
1258
|
+
lineNumbers = false
|
|
1231
1259
|
}) => {
|
|
1260
|
+
React15.useEffect(() => {
|
|
1261
|
+
void scheduleHighlight();
|
|
1262
|
+
return () => void scheduleHighlight();
|
|
1263
|
+
}, [code, language]);
|
|
1264
|
+
const gutter = React15.useMemo(() => {
|
|
1265
|
+
if (!lineNumbers) return null;
|
|
1266
|
+
const lines = code.replace(/\n$/, "").split("\n").length;
|
|
1267
|
+
return Array.from({ length: lines }, (_, index) => index + 1).join("\n");
|
|
1268
|
+
}, [code, lineNumbers]);
|
|
1232
1269
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(styles15__default.default["code-block"], styles15__default.default[variant], className), children: [
|
|
1233
1270
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles15__default.default.header, children: [
|
|
1234
1271
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles15__default.default["header-left"], children: [
|
|
1235
1272
|
title && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles15__default.default.title, children: title }),
|
|
1236
|
-
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "neutral", className: styles15__default.default
|
|
1273
|
+
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "neutral", className: styles15__default.default.badge, children: language })
|
|
1237
1274
|
] }),
|
|
1238
1275
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles15__default.default["header-right"], children: /* @__PURE__ */ jsxRuntime.jsx(CopyButton, { value: copy || code, size: "sm" }) })
|
|
1239
1276
|
] }),
|
|
1240
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1241
|
-
|
|
1277
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1278
|
+
"div",
|
|
1242
1279
|
{
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
className: styles15__default.default.
|
|
1248
|
-
|
|
1249
|
-
|
|
1280
|
+
className: styles15__default.default.content,
|
|
1281
|
+
tabIndex: 0,
|
|
1282
|
+
role: "group",
|
|
1283
|
+
"aria-label": title ? `${title}, code block` : "Code block",
|
|
1284
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(styles15__default.default.body, { [styles15__default.default.numbered]: lineNumbers }), children: [
|
|
1285
|
+
gutter && /* @__PURE__ */ jsxRuntime.jsx("pre", { "aria-hidden": "true", className: styles15__default.default.gutter, children: gutter }),
|
|
1286
|
+
/* @__PURE__ */ jsxRuntime.jsx("pre", { className: styles15__default.default.pre, ...{ [CODE_BLOCK_ATTRIBUTE]: "" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1287
|
+
"code",
|
|
1288
|
+
{
|
|
1289
|
+
className: cn(styles15__default.default.code, `language-${language}`, { [styles15__default.default.wrap]: !lineNumbers }),
|
|
1290
|
+
children: code
|
|
1291
|
+
}
|
|
1292
|
+
) })
|
|
1293
|
+
] })
|
|
1250
1294
|
}
|
|
1251
|
-
)
|
|
1295
|
+
),
|
|
1252
1296
|
codeLabel && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles15__default.default["code-label"], children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: styles15__default.default["code-label-text"], children: codeLabel }) })
|
|
1253
1297
|
] });
|
|
1254
1298
|
};
|
|
@@ -4310,6 +4354,7 @@ exports.BarGraph = BarGraph;
|
|
|
4310
4354
|
exports.BarGraphSegment = BarGraphSegment;
|
|
4311
4355
|
exports.BgGradient = BgGradient;
|
|
4312
4356
|
exports.Button = Button;
|
|
4357
|
+
exports.CODE_BLOCK_ATTRIBUTE = CODE_BLOCK_ATTRIBUTE;
|
|
4313
4358
|
exports.Card = Card;
|
|
4314
4359
|
exports.CardContent = CardContent;
|
|
4315
4360
|
exports.CardContentHeader = CardContentHeader;
|
|
@@ -4476,6 +4521,7 @@ exports.TruncatedDescription = TruncatedDescription;
|
|
|
4476
4521
|
exports.badgeVariants = badgeVariants;
|
|
4477
4522
|
exports.buttonVariants = buttonVariants;
|
|
4478
4523
|
exports.reducer = reducer;
|
|
4524
|
+
exports.scheduleHighlight = scheduleHighlight;
|
|
4479
4525
|
exports.toast = toast;
|
|
4480
4526
|
exports.useFormField = useFormField;
|
|
4481
4527
|
exports.usePortalContainer = usePortalContainer;
|