@box-kite/react 2.2.1 → 2.2.2
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/.claude/rules/box-kite-rules.md +1 -1
- package/.claude/skills/box-kite/SKILL.md +1 -1
- package/.claude/skills/box-kite/references/components.md +1 -1
- package/.claude/skills/box-kite/references/styling.md +2 -1
- package/.cursor/rules/box-kite.mdc +1 -1
- package/AGENTS.md +1 -1
- package/BOX_AI_CONTEXT.md +18 -4
- package/BOX_KITE_AI_CONTEXT.md +18 -4
- package/client.cjs +1 -1
- package/client.mjs +61 -51
- package/components/dataGrid/components/dataGridColumnsPanel.d.ts +10 -0
- package/components/dataGrid/models/columnModel.d.ts +2 -0
- package/components/dataGrid/models/columnVisibilityModel.d.ts +16 -2
- package/components/dataGrid/models/gridModel.d.ts +5 -0
- package/components/dataGrid/models/groupRowModel.d.ts +2 -2
- package/components/dataGrid/models/headerCellModel.d.ts +5 -0
- package/components/dataGrid/models/localeText.d.ts +7 -1
- package/components/dataGrid/models/rowModel.d.ts +1 -1
- package/components/dataGrid.cjs +3 -3
- package/components/dataGrid.mjs +839 -732
- package/components/semantics.d.ts +29 -29
- package/docs/props.md +1 -1
- package/layer.cjs +1 -1
- package/layer.mjs +4 -1
- package/package.json +69 -45
- package/react/theme/theme.d.ts +5 -3
- package/components/dataGrid/components/dataGridTopBarContextMenu.d.ts +0 -6
package/docs/props.md
CHANGED
|
@@ -613,7 +613,7 @@ What a `::before`/`::after` renders — and whether it renders at all: a generat
|
|
|
613
613
|
The content-visibility CSS property controls whether or not an element renders its contents at all, along with forcing a strong set of containments, allowing user agents to potentially omit large swathes of layout and rendering work until it becomes needed. It enables the user agent to skip an element's rendering work (including layout and painting) until it is needed — which makes the initial page load much faster.
|
|
614
614
|
|
|
615
615
|
- Writes: `content-visibility`
|
|
616
|
-
- Values: `visible` · `hidden`
|
|
616
|
+
- Values: `visible` · `hidden` · `auto`
|
|
617
617
|
- Example: `contentVisibility="visible"` → `content-visibility: visible`
|
|
618
618
|
|
|
619
619
|
### `contrast`
|
package/layer.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./platform.cjs"),t=require("./effects.cjs"),n=require("./behavior.cjs"),r=require("./identity.cjs");let i=require("react");var a=()=>()=>{},o=()=>!0;function s(){return(0,i.useSyncExternalStore)(a,e.a,o)}function c(a){let{haspopup:o,id:c,idPrefix:l,open:u,defaultOpen:d=!1,onOpenChange:f,onOpened:p,onClosing:m,inside:h}=a,g=r.t(l),_=c??g,[v,y]=n.i({value:u,defaultValue:d,onChange:f}),[b,x]=(0,i.useState)(null),[S,C]=(0,i.useState)(null),w=s(),[T,E]=(0,i.useState)(!1),[D,O]=(0,i.useState)(),k=(0,i.useRef)(`imperative`),A=(0,i.useRef)(!1),j=n.a(p),M=n.a(m),N=n.a(e=>{let t=e.newState===`open`,n=e.currentTarget;if(t&&u===!1){e.preventDefault();return}t||(A.current=n.contains(document.activeElement),M(A.current,b)),E(t);let r=t?`trigger`:k.current;k.current=`imperative`,y(t,{reason:r,event:e})}),P=n.a(e=>{let t=e.currentTarget;e.newState===`open`&&j(t)});t.n(()=>{if(!w||!S)return;let e=new AbortController;return S.addEventListener(`beforetoggle`,N,{signal:e.signal}),S.addEventListener(`toggle`,P,{signal:e.signal}),()=>e.abort()},[w,S,N,P]),t.n(()=>{!w||!e.a()||!S||v===T||(v?S.showPopover():S.hidePopover())},[v,T,S,w]),t.n(()=>{if(!w||!v)return;let t=new AbortController,n=(e,n)=>document.addEventListener(e,n,{signal:t.signal,capture:!0});return n(`keydown`,e=>{e.key===`Escape`&&(k.current=`escape`)}),n(`pointerdown`,t=>{let n=!!b&&e.l(t,[b]);k.current=n?`trigger`:`outside-pointer`}),()=>t.abort()},[w,v,b]),t.n(()=>{b&&(b.id||b.setAttribute(`id`,`${_}-trigger`),O(b.id))},[b,_]),t.n(()=>{if(!(!w||!b))return b.setAttribute(`popovertarget`,_),()=>b.removeAttribute(`popovertarget`)},[w,b,_]),t.n(()=>{w||!v||!S||j(S)},[w,v,S,j]),n.r({enabled:!w&&v,inside:[S,b,...h??[]],onDismiss:(e,t)=>y(!1,{reason:e,event:t})}),n.n({enabled:!w&&v,returnTo:b});let F=n.a(e=>{y(e=>!e,{reason:`trigger`,event:e})});return{platform:w,isOpen:v,setOpen:y,id:_,trigger:(0,i.useMemo)(()=>({ref:x,props:{"aria-expanded":v,"aria-haspopup":o,"aria-controls":v?_:void 0,...w?{}:{onClick:F}}}),[F,o,v,_,w]),triggerElement:b,triggerId:D,setPanel:C,panelElement:S}}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
|
|
1
|
+
const e=require("./platform.cjs"),t=require("./effects.cjs"),n=require("./behavior.cjs"),r=require("./identity.cjs");let i=require("react");var a=()=>()=>{},o=()=>!0;function s(){return(0,i.useSyncExternalStore)(a,e.a,o)}function c(a){let{haspopup:o,id:c,idPrefix:l,open:u,defaultOpen:d=!1,onOpenChange:f,onOpened:p,onClosing:m,inside:h}=a,g=r.t(l),_=c??g,[v,y]=n.i({value:u,defaultValue:d,onChange:f}),[b,x]=(0,i.useState)(null),[S,C]=(0,i.useState)(null),w=s(),[T,E]=(0,i.useState)(!1),[D,O]=(0,i.useState)(),k=(0,i.useRef)(`imperative`),A=(0,i.useRef)(!1),j=n.a(p),M=n.a(m),N=n.a(e=>{let t=e.newState===`open`,n=e.currentTarget;if(t&&u===!1){e.preventDefault(),setTimeout(()=>y(!0,{reason:`trigger`,event:e}));return}t||(A.current=n.contains(document.activeElement),M(A.current,b)),E(t);let r=t?`trigger`:k.current;k.current=`imperative`,y(t,{reason:r,event:e})}),P=n.a(e=>{let t=e.currentTarget;e.newState===`open`&&j(t)});t.n(()=>{if(!w||!S)return;let e=new AbortController;return S.addEventListener(`beforetoggle`,N,{signal:e.signal}),S.addEventListener(`toggle`,P,{signal:e.signal}),()=>e.abort()},[w,S,N,P]),t.n(()=>{!w||!e.a()||!S||v===T||(v?S.showPopover():S.hidePopover())},[v,T,S,w]),t.n(()=>{if(!w||!v)return;let t=new AbortController,n=(e,n)=>document.addEventListener(e,n,{signal:t.signal,capture:!0});return n(`keydown`,e=>{e.key===`Escape`&&(k.current=`escape`)}),n(`pointerdown`,t=>{let n=!!b&&e.l(t,[b]);k.current=n?`trigger`:`outside-pointer`}),()=>t.abort()},[w,v,b]),t.n(()=>{b&&(b.id||b.setAttribute(`id`,`${_}-trigger`),O(b.id))},[b,_]),t.n(()=>{if(!(!w||!b))return b.setAttribute(`popovertarget`,_),()=>b.removeAttribute(`popovertarget`)},[w,b,_]),t.n(()=>{w||!v||!S||j(S)},[w,v,S,j]),n.r({enabled:!w&&v,inside:[S,b,...h??[]],onDismiss:(e,t)=>y(!1,{reason:e,event:t})}),n.n({enabled:!w&&v,returnTo:b});let F=n.a(e=>{y(e=>!e,{reason:`trigger`,event:e})});return{platform:w,isOpen:v,setOpen:y,id:_,trigger:(0,i.useMemo)(()=>({ref:x,props:{"aria-expanded":v,"aria-haspopup":o,"aria-controls":v?_:void 0,...w?{}:{onClick:F}}}),[F,o,v,_,w]),triggerElement:b,triggerId:D,setPanel:C,panelElement:S}}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
|
package/layer.mjs
CHANGED
|
@@ -18,7 +18,10 @@ function h(d) {
|
|
|
18
18
|
}), [E, D] = u(null), [O, k] = u(null), A = m(), [j, M] = u(!1), [N, P] = u(), F = l("imperative"), I = l(!1), L = r(y), R = r(b), z = r((e) => {
|
|
19
19
|
let t = e.newState === "open", n = e.currentTarget;
|
|
20
20
|
if (t && g === !1) {
|
|
21
|
-
e.preventDefault()
|
|
21
|
+
e.preventDefault(), setTimeout(() => T(!0, {
|
|
22
|
+
reason: "trigger",
|
|
23
|
+
event: e
|
|
24
|
+
}));
|
|
22
25
|
return;
|
|
23
26
|
}
|
|
24
27
|
t || (I.current = n.contains(document.activeElement), R(I.current, E)), M(t);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box-kite/react",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"pages/**"
|
|
@@ -113,10 +113,11 @@
|
|
|
113
113
|
"ignore": [
|
|
114
114
|
"react",
|
|
115
115
|
"react-dom",
|
|
116
|
-
"./diagnostics-*"
|
|
116
|
+
"./diagnostics-*",
|
|
117
|
+
"./themeReveal-*"
|
|
117
118
|
],
|
|
118
119
|
"gzip": true,
|
|
119
|
-
"limit": "
|
|
120
|
+
"limit": "37.54 KB"
|
|
120
121
|
},
|
|
121
122
|
{
|
|
122
123
|
"name": "Box in a Server Component (react-server entry)",
|
|
@@ -124,10 +125,11 @@
|
|
|
124
125
|
"ignore": [
|
|
125
126
|
"react",
|
|
126
127
|
"react-dom",
|
|
127
|
-
"./diagnostics-*"
|
|
128
|
+
"./diagnostics-*",
|
|
129
|
+
"./themeReveal-*"
|
|
128
130
|
],
|
|
129
131
|
"gzip": true,
|
|
130
|
-
"limit": "35.
|
|
132
|
+
"limit": "35.63 KB"
|
|
131
133
|
},
|
|
132
134
|
{
|
|
133
135
|
"name": "Behavior primitives (a11y entry)",
|
|
@@ -135,7 +137,8 @@
|
|
|
135
137
|
"ignore": [
|
|
136
138
|
"react",
|
|
137
139
|
"react-dom",
|
|
138
|
-
"./diagnostics-*"
|
|
140
|
+
"./diagnostics-*",
|
|
141
|
+
"./themeReveal-*"
|
|
139
142
|
],
|
|
140
143
|
"gzip": true,
|
|
141
144
|
"limit": "3.2 KB"
|
|
@@ -146,7 +149,8 @@
|
|
|
146
149
|
"ignore": [
|
|
147
150
|
"react",
|
|
148
151
|
"react-dom",
|
|
149
|
-
"./diagnostics-*"
|
|
152
|
+
"./diagnostics-*",
|
|
153
|
+
"./themeReveal-*"
|
|
150
154
|
],
|
|
151
155
|
"gzip": true,
|
|
152
156
|
"limit": "2.25 KB"
|
|
@@ -157,10 +161,11 @@
|
|
|
157
161
|
"ignore": [
|
|
158
162
|
"react",
|
|
159
163
|
"react-dom",
|
|
160
|
-
"./diagnostics-*"
|
|
164
|
+
"./diagnostics-*",
|
|
165
|
+
"./themeReveal-*"
|
|
161
166
|
],
|
|
162
167
|
"gzip": true,
|
|
163
|
-
"limit": "55.
|
|
168
|
+
"limit": "55.64 KB"
|
|
164
169
|
},
|
|
165
170
|
{
|
|
166
171
|
"name": "Spec renderer (spec entry)",
|
|
@@ -168,7 +173,8 @@
|
|
|
168
173
|
"ignore": [
|
|
169
174
|
"react",
|
|
170
175
|
"react-dom",
|
|
171
|
-
"./diagnostics-*"
|
|
176
|
+
"./diagnostics-*",
|
|
177
|
+
"./themeReveal-*"
|
|
172
178
|
],
|
|
173
179
|
"gzip": true,
|
|
174
180
|
"limit": "4.7 KB"
|
|
@@ -179,7 +185,8 @@
|
|
|
179
185
|
"ignore": [
|
|
180
186
|
"react",
|
|
181
187
|
"react-dom",
|
|
182
|
-
"./diagnostics-*"
|
|
188
|
+
"./diagnostics-*",
|
|
189
|
+
"./themeReveal-*"
|
|
183
190
|
],
|
|
184
191
|
"gzip": true,
|
|
185
192
|
"limit": "4 KB"
|
|
@@ -188,9 +195,10 @@
|
|
|
188
195
|
"name": "Core engine (@box-kite/core, no React)",
|
|
189
196
|
"path": "dist-core/core.mjs",
|
|
190
197
|
"gzip": true,
|
|
191
|
-
"limit": "36.
|
|
198
|
+
"limit": "36.90 KB",
|
|
192
199
|
"ignore": [
|
|
193
|
-
"./diagnostics-*"
|
|
200
|
+
"./diagnostics-*",
|
|
201
|
+
"./themeReveal-*"
|
|
194
202
|
]
|
|
195
203
|
},
|
|
196
204
|
{
|
|
@@ -199,10 +207,11 @@
|
|
|
199
207
|
"ignore": [
|
|
200
208
|
"react",
|
|
201
209
|
"react-dom",
|
|
202
|
-
"./diagnostics-*"
|
|
210
|
+
"./diagnostics-*",
|
|
211
|
+
"./themeReveal-*"
|
|
203
212
|
],
|
|
204
213
|
"gzip": true,
|
|
205
|
-
"limit": "
|
|
214
|
+
"limit": "39.61 KB"
|
|
206
215
|
},
|
|
207
216
|
{
|
|
208
217
|
"name": "Popover",
|
|
@@ -210,10 +219,11 @@
|
|
|
210
219
|
"ignore": [
|
|
211
220
|
"react",
|
|
212
221
|
"react-dom",
|
|
213
|
-
"./diagnostics-*"
|
|
222
|
+
"./diagnostics-*",
|
|
223
|
+
"./themeReveal-*"
|
|
214
224
|
],
|
|
215
225
|
"gzip": true,
|
|
216
|
-
"limit": "
|
|
226
|
+
"limit": "41.15 KB"
|
|
217
227
|
},
|
|
218
228
|
{
|
|
219
229
|
"name": "Menu",
|
|
@@ -221,10 +231,11 @@
|
|
|
221
231
|
"ignore": [
|
|
222
232
|
"react",
|
|
223
233
|
"react-dom",
|
|
224
|
-
"./diagnostics-*"
|
|
234
|
+
"./diagnostics-*",
|
|
235
|
+
"./themeReveal-*"
|
|
225
236
|
],
|
|
226
237
|
"gzip": true,
|
|
227
|
-
"limit": "
|
|
238
|
+
"limit": "43.41 KB"
|
|
228
239
|
},
|
|
229
240
|
{
|
|
230
241
|
"name": "Accordion",
|
|
@@ -232,10 +243,11 @@
|
|
|
232
243
|
"ignore": [
|
|
233
244
|
"react",
|
|
234
245
|
"react-dom",
|
|
235
|
-
"./diagnostics-*"
|
|
246
|
+
"./diagnostics-*",
|
|
247
|
+
"./themeReveal-*"
|
|
236
248
|
],
|
|
237
249
|
"gzip": true,
|
|
238
|
-
"limit": "38.
|
|
250
|
+
"limit": "38.88 KB"
|
|
239
251
|
},
|
|
240
252
|
{
|
|
241
253
|
"name": "Agent",
|
|
@@ -243,10 +255,11 @@
|
|
|
243
255
|
"ignore": [
|
|
244
256
|
"react",
|
|
245
257
|
"react-dom",
|
|
246
|
-
"./diagnostics-*"
|
|
258
|
+
"./diagnostics-*",
|
|
259
|
+
"./themeReveal-*"
|
|
247
260
|
],
|
|
248
261
|
"gzip": true,
|
|
249
|
-
"limit": "
|
|
262
|
+
"limit": "39.63 KB"
|
|
250
263
|
},
|
|
251
264
|
{
|
|
252
265
|
"name": "Markdown",
|
|
@@ -254,10 +267,11 @@
|
|
|
254
267
|
"ignore": [
|
|
255
268
|
"react",
|
|
256
269
|
"react-dom",
|
|
257
|
-
"./diagnostics-*"
|
|
270
|
+
"./diagnostics-*",
|
|
271
|
+
"./themeReveal-*"
|
|
258
272
|
],
|
|
259
273
|
"gzip": true,
|
|
260
|
-
"limit": "
|
|
274
|
+
"limit": "38.10 KB"
|
|
261
275
|
},
|
|
262
276
|
{
|
|
263
277
|
"name": "Skeleton",
|
|
@@ -265,10 +279,11 @@
|
|
|
265
279
|
"ignore": [
|
|
266
280
|
"react",
|
|
267
281
|
"react-dom",
|
|
268
|
-
"./diagnostics-*"
|
|
282
|
+
"./diagnostics-*",
|
|
283
|
+
"./themeReveal-*"
|
|
269
284
|
],
|
|
270
285
|
"gzip": true,
|
|
271
|
-
"limit": "
|
|
286
|
+
"limit": "37.44 KB"
|
|
272
287
|
},
|
|
273
288
|
{
|
|
274
289
|
"name": "Tabs",
|
|
@@ -276,10 +291,11 @@
|
|
|
276
291
|
"ignore": [
|
|
277
292
|
"react",
|
|
278
293
|
"react-dom",
|
|
279
|
-
"./diagnostics-*"
|
|
294
|
+
"./diagnostics-*",
|
|
295
|
+
"./themeReveal-*"
|
|
280
296
|
],
|
|
281
297
|
"gzip": true,
|
|
282
|
-
"limit": "
|
|
298
|
+
"limit": "40.06 KB"
|
|
283
299
|
},
|
|
284
300
|
{
|
|
285
301
|
"name": "Slider",
|
|
@@ -287,10 +303,11 @@
|
|
|
287
303
|
"ignore": [
|
|
288
304
|
"react",
|
|
289
305
|
"react-dom",
|
|
290
|
-
"./diagnostics-*"
|
|
306
|
+
"./diagnostics-*",
|
|
307
|
+
"./themeReveal-*"
|
|
291
308
|
],
|
|
292
309
|
"gzip": true,
|
|
293
|
-
"limit": "
|
|
310
|
+
"limit": "39.22 KB"
|
|
294
311
|
},
|
|
295
312
|
{
|
|
296
313
|
"name": "Progress",
|
|
@@ -298,10 +315,11 @@
|
|
|
298
315
|
"ignore": [
|
|
299
316
|
"react",
|
|
300
317
|
"react-dom",
|
|
301
|
-
"./diagnostics-*"
|
|
318
|
+
"./diagnostics-*",
|
|
319
|
+
"./themeReveal-*"
|
|
302
320
|
],
|
|
303
321
|
"gzip": true,
|
|
304
|
-
"limit": "
|
|
322
|
+
"limit": "37.41 KB"
|
|
305
323
|
},
|
|
306
324
|
{
|
|
307
325
|
"name": "Toaster",
|
|
@@ -309,10 +327,11 @@
|
|
|
309
327
|
"ignore": [
|
|
310
328
|
"react",
|
|
311
329
|
"react-dom",
|
|
312
|
-
"./diagnostics-*"
|
|
330
|
+
"./diagnostics-*",
|
|
331
|
+
"./themeReveal-*"
|
|
313
332
|
],
|
|
314
333
|
"gzip": true,
|
|
315
|
-
"limit": "40.
|
|
334
|
+
"limit": "40.84 KB"
|
|
316
335
|
},
|
|
317
336
|
{
|
|
318
337
|
"name": "Combobox",
|
|
@@ -320,10 +339,11 @@
|
|
|
320
339
|
"ignore": [
|
|
321
340
|
"react",
|
|
322
341
|
"react-dom",
|
|
323
|
-
"./diagnostics-*"
|
|
342
|
+
"./diagnostics-*",
|
|
343
|
+
"./themeReveal-*"
|
|
324
344
|
],
|
|
325
345
|
"gzip": true,
|
|
326
|
-
"limit": "
|
|
346
|
+
"limit": "46.65 KB"
|
|
327
347
|
},
|
|
328
348
|
{
|
|
329
349
|
"name": "Dashboard",
|
|
@@ -331,10 +351,11 @@
|
|
|
331
351
|
"ignore": [
|
|
332
352
|
"react",
|
|
333
353
|
"react-dom",
|
|
334
|
-
"./diagnostics-*"
|
|
354
|
+
"./diagnostics-*",
|
|
355
|
+
"./themeReveal-*"
|
|
335
356
|
],
|
|
336
357
|
"gzip": true,
|
|
337
|
-
"limit": "
|
|
358
|
+
"limit": "43.06 KB"
|
|
338
359
|
},
|
|
339
360
|
{
|
|
340
361
|
"name": "DataGrid",
|
|
@@ -342,10 +363,11 @@
|
|
|
342
363
|
"ignore": [
|
|
343
364
|
"react",
|
|
344
365
|
"react-dom",
|
|
345
|
-
"./diagnostics-*"
|
|
366
|
+
"./diagnostics-*",
|
|
367
|
+
"./themeReveal-*"
|
|
346
368
|
],
|
|
347
369
|
"gzip": true,
|
|
348
|
-
"limit": "
|
|
370
|
+
"limit": "89.79 KB"
|
|
349
371
|
},
|
|
350
372
|
{
|
|
351
373
|
"name": "DataGrid export, the chunk fetched on the first press",
|
|
@@ -353,7 +375,8 @@
|
|
|
353
375
|
"ignore": [
|
|
354
376
|
"react",
|
|
355
377
|
"react-dom",
|
|
356
|
-
"./diagnostics-*"
|
|
378
|
+
"./diagnostics-*",
|
|
379
|
+
"./themeReveal-*"
|
|
357
380
|
],
|
|
358
381
|
"gzip": true,
|
|
359
382
|
"limit": "3.8 KB"
|
|
@@ -364,10 +387,11 @@
|
|
|
364
387
|
"ignore": [
|
|
365
388
|
"react",
|
|
366
389
|
"react-dom",
|
|
367
|
-
"./diagnostics-*"
|
|
390
|
+
"./diagnostics-*",
|
|
391
|
+
"./themeReveal-*"
|
|
368
392
|
],
|
|
369
393
|
"gzip": true,
|
|
370
|
-
"limit": "
|
|
394
|
+
"limit": "120.52 KB"
|
|
371
395
|
}
|
|
372
396
|
],
|
|
373
397
|
"repository": {
|
|
@@ -407,7 +431,7 @@
|
|
|
407
431
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
408
432
|
},
|
|
409
433
|
"dependencies": {
|
|
410
|
-
"@box-kite/core": "2.2.
|
|
434
|
+
"@box-kite/core": "2.2.2",
|
|
411
435
|
"csstype": "^3.2.3",
|
|
412
436
|
"use-sync-external-store": "^1.6.0"
|
|
413
437
|
},
|
package/react/theme/theme.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { ThemeTransition } from '@box-kite/core';
|
|
2
3
|
import { BoxStyleProps } from '@box-kite/core/types';
|
|
3
4
|
interface ThemeProps {
|
|
4
5
|
children: React.ReactNode;
|
|
@@ -13,15 +14,16 @@ interface ThemeProps {
|
|
|
13
14
|
*/
|
|
14
15
|
globalStyles?: BoxStyleProps;
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
17
|
+
* Animate a theme change where the browser has view transitions: `true` or `'fade'` cross-fades the page,
|
|
18
|
+
* `'reveal'` grows the new theme out of the control that was pressed (or focused) as a circle. Off by
|
|
19
|
+
* default, because a transition is a decision about the app rather than about theming.
|
|
18
20
|
*
|
|
19
21
|
* It exists as a prop rather than a recipe because the recipe has a trap in it: `startViewTransition`
|
|
20
22
|
* screenshots the page the moment its callback returns, and a `setState` has not rendered by then — so
|
|
21
23
|
* a hand-rolled version captures the old theme twice and nothing appears to change. This flushes the
|
|
22
24
|
* update inside the callback. Reduced motion skips the transition and keeps the theme change.
|
|
23
25
|
*/
|
|
24
|
-
viewTransition?: boolean;
|
|
26
|
+
viewTransition?: boolean | ThemeTransition;
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
29
|
* The React binding for the theme system. Everything that actually touches the platform — reading
|