@box-kite/react 2.2.3 → 2.2.5
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 +8 -0
- package/.claude/skills/box-kite/SKILL.md +8 -0
- package/.claude/skills/box-kite/references/components.md +49 -3
- package/.cursor/rules/box-kite.mdc +8 -0
- package/AGENTS.md +8 -0
- package/BOX_AI_CONTEXT.md +276 -20
- package/BOX_KITE_AI_CONTEXT.md +276 -20
- package/behavior.cjs +1 -1
- package/behavior.mjs +57 -57
- package/box.cjs +1 -1
- package/box.d.ts +5 -0
- package/box.mjs +17 -17
- package/catalog.cjs +1 -1
- package/catalog.mjs +385 -0
- package/client.cjs +1 -1
- package/client.mjs +113 -87
- package/components/dashboard.cjs +1 -1
- package/components/dashboard.mjs +1 -1
- package/components/dataGrid/components/dataGridList.d.ts +12 -0
- package/components/dataGrid/components/dataGridListAggregate.d.ts +7 -0
- package/components/dataGrid/components/dataGridListFilter.d.ts +7 -0
- package/components/dataGrid/components/dataGridListFilterSheet.d.ts +11 -0
- package/components/dataGrid/components/dataGridListFooter.d.ts +13 -0
- package/components/dataGrid/components/dataGridListGroup.d.ts +13 -0
- package/components/dataGrid/components/dataGridListItem.d.ts +21 -0
- package/components/dataGrid/components/dataGridListLayout.d.ts +20 -0
- package/components/dataGrid/components/dataGridListRecord.d.ts +11 -0
- package/components/dataGrid/components/dataGridListSelectionBar.d.ts +11 -0
- package/components/dataGrid/components/dataGridListSheet.d.ts +30 -0
- package/components/dataGrid/components/dataGridListSortSheet.d.ts +10 -0
- package/components/dataGrid/components/dataGridListToolbar.d.ts +10 -0
- package/components/dataGrid/components/dataGridListValue.d.ts +12 -0
- package/components/dataGrid/contracts/dataGridContract.d.ts +32 -0
- package/components/dataGrid/models/gridModel.d.ts +3 -0
- package/components/dataGrid/models/listModel.d.ts +129 -0
- package/components/dataGrid/models/localeText.d.ts +32 -0
- package/components/dataGrid/models/viewportModel.d.ts +0 -2
- package/components/dataGrid/useListLayout.d.ts +13 -0
- package/components/dataGrid.cjs +3 -3
- package/components/dataGrid.mjs +1052 -788
- package/components/dialog.cjs +1 -1
- package/components/dialog.mjs +85 -97
- package/components/list/listItemParts.d.ts +9 -0
- package/components/list.cjs +1 -0
- package/components/list.d.ts +118 -0
- package/components/list.mjs +391 -0
- package/components/menu.cjs +1 -1
- package/components/menu.mjs +25 -25
- package/components/overlay.cjs +1 -1
- package/components/overlay.mjs +12 -12
- package/components/semantics.d.ts +29 -29
- package/components/slider.cjs +1 -1
- package/components/slider.mjs +1 -1
- package/components/sortableList.cjs +1 -0
- package/components/sortableList.d.ts +49 -0
- package/components/sortableList.mjs +384 -0
- package/components/swipeItem.cjs +1 -0
- package/components/swipeItem.d.ts +52 -0
- package/components/swipeItem.mjs +321 -0
- package/components/tabs.cjs +1 -1
- package/components/tabs.mjs +1 -1
- package/components/toaster.cjs +1 -1
- package/components/toaster.mjs +24 -24
- package/components/virtualList.cjs +1 -0
- package/components/virtualList.d.ts +32 -0
- package/components/virtualList.mjs +188 -0
- package/dataGridList.cjs +1 -0
- package/dataGridList.mjs +1351 -0
- package/docs/components.md +5 -1
- package/icons/closeIcon.d.ts +2 -0
- package/icons/filterIcon.d.ts +2 -0
- package/layer.cjs +1 -1
- package/layer.mjs +1 -1
- package/mcp/src/data.d.ts +2 -0
- package/package.json +86 -22
- package/placement.cjs +1 -1
- package/placement.mjs +10 -10
- package/platform.cjs +1 -1
- package/platform.mjs +4 -1
- package/react/a11y/useControllableState.d.ts +2 -1
- package/react/componentsContext.d.ts +4 -0
- package/react/componentsProvider.d.ts +10 -0
- package/react/resolveStyles.d.ts +2 -1
- package/react/theme/theme.d.ts +6 -1
- package/react-shared.cjs +1 -1
- package/react-shared.mjs +40 -29
- package/registry/blocks/dashboard-shell/dashboard-shell.d.ts +3 -1
- package/registry/designs/store/address-form.d.ts +11 -0
- package/registry/designs/store/cart-items.d.ts +10 -0
- package/registry/designs/store/cart-page.d.ts +4 -0
- package/registry/designs/store/checkout-page.d.ts +7 -0
- package/registry/designs/store/credit-card-form.d.ts +10 -0
- package/registry/designs/store/form-field.d.ts +19 -0
- package/registry/designs/store/order-summary.d.ts +18 -0
- package/registry/designs/store/product-art.d.ts +26 -0
- package/registry/designs/store/product-card.d.ts +11 -0
- package/registry/designs/store/product-gallery.d.ts +11 -0
- package/registry/designs/store/product-grid.d.ts +10 -0
- package/registry/designs/store/product-page.d.ts +5 -0
- package/registry/designs/store/quantity-stepper.d.ts +13 -0
- package/registry/designs/store/shipping-method.d.ts +14 -0
- package/registry/designs/store/store-data.d.ts +53 -0
- package/registry/designs/store/store-design.d.ts +63 -0
- package/registry/designs/store/store-shell.d.ts +12 -0
- package/registry/designs/store/storefront-page.d.ts +4 -0
- package/registry/designs/store/variant-picker.d.ts +15 -0
- package/rsc.cjs +1 -1
- package/rsc.d.ts +2 -0
- package/rsc.mjs +1 -1
- package/scrolling.cjs +1 -0
- package/scrolling.mjs +22 -0
- package/ssg.cjs +1 -1
- package/ssg.mjs +1 -1
- package/utils/scroll/scrollUtils.d.ts +6 -0
- package/utils/sortable/sortableUtils.d.ts +25 -0
- package/utils/swipe/swipeUtils.d.ts +53 -0
- package/utils/virtual/measuredWindow.d.ts +28 -0
- package/utils/virtual/rowSearch.d.ts +11 -0
package/docs/components.md
CHANGED
|
@@ -14,6 +14,7 @@ No hook, no effect, no DOM: a React Server Component can render these directly.
|
|
|
14
14
|
| `@box-kite/react/components/flex` | `Flex` (default) | |
|
|
15
15
|
| `@box-kite/react/components/grid` | `Grid` (default) | |
|
|
16
16
|
| `@box-kite/react/components/icon` | `Icon` (default) | |
|
|
17
|
+
| `@box-kite/react/components/list` | `List` (default), `i`, `n`, `r`, `t` | |
|
|
17
18
|
| `@box-kite/react/components/markdown` | `markdown` (default), `markdownComponents` | |
|
|
18
19
|
| `@box-kite/react/components/progress` | `Progress` (default) | |
|
|
19
20
|
| `@box-kite/react/components/radioButton` | `RadioButton` (default) | |
|
|
@@ -35,7 +36,7 @@ These hold state, measure the DOM or portal into it. A Server Component may impo
|
|
|
35
36
|
| `@box-kite/react/components/checkbox` | `Checkbox` (default) | |
|
|
36
37
|
| `@box-kite/react/components/combobox` | `Combobox` (default), `ComboboxUtils` | |
|
|
37
38
|
| `@box-kite/react/components/dashboard` | `DashboardGrid` (default), `DashboardUtils`, `Widget` | |
|
|
38
|
-
| `@box-kite/react/components/dataGrid` | `dataGrid` (default), `DATA_GRID_LOCALE_TEXT` | |
|
|
39
|
+
| `@box-kite/react/components/dataGrid` | `dataGrid` (default), `DATA_GRID_LOCALE_TEXT`, `a`, `c`, `d`, `i`, `l`, `n`, `o`, `r`, `s`, `t`, `u` | |
|
|
39
40
|
| `@box-kite/react/components/dialog` | `Dialog` (default), `AlertDialog` | |
|
|
40
41
|
| `@box-kite/react/components/dropdown` | `Dropdown` (default) | **deprecated** |
|
|
41
42
|
| `@box-kite/react/components/form` | `Form` (default) | |
|
|
@@ -46,7 +47,10 @@ These hold state, measure the DOM or portal into it. A Server Component may impo
|
|
|
46
47
|
| `@box-kite/react/components/radioGroup` | `RadioGroup` (default) | **deprecated** |
|
|
47
48
|
| `@box-kite/react/components/select` | `Select` (default) | **deprecated** |
|
|
48
49
|
| `@box-kite/react/components/slider` | `Slider` (default) | |
|
|
50
|
+
| `@box-kite/react/components/sortableList` | `SortableList` (default), `SortableUtils` | |
|
|
51
|
+
| `@box-kite/react/components/swipeItem` | `SwipeItem` (default), `SwipeUtils` | |
|
|
49
52
|
| `@box-kite/react/components/switch` | `Switch` (default) | |
|
|
50
53
|
| `@box-kite/react/components/tabs` | `Tabs` (default) | |
|
|
51
54
|
| `@box-kite/react/components/toaster` | `Toaster` (default), `createToastStore`, `defaultToastStore`, `toast` | |
|
|
52
55
|
| `@box-kite/react/components/tooltip` | `Tooltip` (default) | |
|
|
56
|
+
| `@box-kite/react/components/virtualList` | `VirtualList` (default) | |
|
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.
|
|
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.o,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.o()||!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.u(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
package/mcp/src/data.d.ts
CHANGED
|
@@ -75,6 +75,8 @@ export declare const rules: readonly RuleRecord[];
|
|
|
75
75
|
export declare const priorFacts: readonly string[];
|
|
76
76
|
export declare const blocks: readonly RegistryItem[];
|
|
77
77
|
export declare const blockInstall: (name: string) => string;
|
|
78
|
+
/** The page a registry item is shown on — running in light and dark, with every file — if it has one. */
|
|
79
|
+
export declare const blockPage: (name: string) => string | undefined;
|
|
78
80
|
/**
|
|
79
81
|
* A fresh engine with readable class names, no DOM and no console: what `check_styles` judges a value with. One
|
|
80
82
|
* per call rather than one for the process, so a caller's `vars` or `css` cannot leak into the next
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box-kite/react",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"pages/**"
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
"smoke:next-app": "npm --prefix examples/next-app run smoke",
|
|
72
72
|
"build:pages": "vite build ./pages --config ./pages.vite.config.ts --outDir ../dist-pages --mode production && npm run prerender:pages",
|
|
73
73
|
"prerender:pages": "node scripts/prerender-pages.mjs",
|
|
74
|
+
"snapshot:templates": "node scripts/snapshot-templates.mjs",
|
|
74
75
|
"preview": "vite preview ./pages --config ./pages.vite.config.ts --outDir ../dist-pages",
|
|
75
76
|
"build": "npm run build:core && vite build",
|
|
76
77
|
"build:core": "vite build --config vite.core.config.ts && node scripts/postbuild-core.mjs",
|
|
@@ -116,7 +117,7 @@
|
|
|
116
117
|
"./themeReveal-*"
|
|
117
118
|
],
|
|
118
119
|
"gzip": true,
|
|
119
|
-
"limit": "
|
|
120
|
+
"limit": "39.07 KB"
|
|
120
121
|
},
|
|
121
122
|
{
|
|
122
123
|
"name": "Box in a Server Component (react-server entry)",
|
|
@@ -128,7 +129,7 @@
|
|
|
128
129
|
"./themeReveal-*"
|
|
129
130
|
],
|
|
130
131
|
"gzip": true,
|
|
131
|
-
"limit": "
|
|
132
|
+
"limit": "37.10 KB"
|
|
132
133
|
},
|
|
133
134
|
{
|
|
134
135
|
"name": "Behavior primitives (a11y entry)",
|
|
@@ -164,7 +165,7 @@
|
|
|
164
165
|
"./themeReveal-*"
|
|
165
166
|
],
|
|
166
167
|
"gzip": true,
|
|
167
|
-
"limit": "
|
|
168
|
+
"limit": "58.71 KB"
|
|
168
169
|
},
|
|
169
170
|
{
|
|
170
171
|
"name": "Spec renderer (spec entry)",
|
|
@@ -194,7 +195,7 @@
|
|
|
194
195
|
"name": "Core engine (@box-kite/core, no React)",
|
|
195
196
|
"path": "dist-core/core.mjs",
|
|
196
197
|
"gzip": true,
|
|
197
|
-
"limit": "
|
|
198
|
+
"limit": "38.31 KB",
|
|
198
199
|
"ignore": [
|
|
199
200
|
"./diagnostics-*",
|
|
200
201
|
"./themeReveal-*"
|
|
@@ -210,7 +211,7 @@
|
|
|
210
211
|
"./themeReveal-*"
|
|
211
212
|
],
|
|
212
213
|
"gzip": true,
|
|
213
|
-
"limit": "
|
|
214
|
+
"limit": "41.14 KB"
|
|
214
215
|
},
|
|
215
216
|
{
|
|
216
217
|
"name": "Popover",
|
|
@@ -222,7 +223,7 @@
|
|
|
222
223
|
"./themeReveal-*"
|
|
223
224
|
],
|
|
224
225
|
"gzip": true,
|
|
225
|
-
"limit": "
|
|
226
|
+
"limit": "42.68 KB"
|
|
226
227
|
},
|
|
227
228
|
{
|
|
228
229
|
"name": "Menu",
|
|
@@ -234,7 +235,7 @@
|
|
|
234
235
|
"./themeReveal-*"
|
|
235
236
|
],
|
|
236
237
|
"gzip": true,
|
|
237
|
-
"limit": "
|
|
238
|
+
"limit": "44.94 KB"
|
|
238
239
|
},
|
|
239
240
|
{
|
|
240
241
|
"name": "Accordion",
|
|
@@ -246,7 +247,7 @@
|
|
|
246
247
|
"./themeReveal-*"
|
|
247
248
|
],
|
|
248
249
|
"gzip": true,
|
|
249
|
-
"limit": "
|
|
250
|
+
"limit": "40.41 KB"
|
|
250
251
|
},
|
|
251
252
|
{
|
|
252
253
|
"name": "Agent",
|
|
@@ -258,7 +259,7 @@
|
|
|
258
259
|
"./themeReveal-*"
|
|
259
260
|
],
|
|
260
261
|
"gzip": true,
|
|
261
|
-
"limit": "
|
|
262
|
+
"limit": "41.19 KB"
|
|
262
263
|
},
|
|
263
264
|
{
|
|
264
265
|
"name": "Markdown",
|
|
@@ -270,7 +271,55 @@
|
|
|
270
271
|
"./themeReveal-*"
|
|
271
272
|
],
|
|
272
273
|
"gzip": true,
|
|
273
|
-
"limit": "
|
|
274
|
+
"limit": "39.66 KB"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"name": "List",
|
|
278
|
+
"path": "dist/components/list.mjs",
|
|
279
|
+
"ignore": [
|
|
280
|
+
"react",
|
|
281
|
+
"react-dom",
|
|
282
|
+
"./diagnostics-*",
|
|
283
|
+
"./themeReveal-*"
|
|
284
|
+
],
|
|
285
|
+
"gzip": true,
|
|
286
|
+
"limit": "40.98 KB"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"name": "SwipeItem",
|
|
290
|
+
"path": "dist/components/swipeItem.mjs",
|
|
291
|
+
"ignore": [
|
|
292
|
+
"react",
|
|
293
|
+
"react-dom",
|
|
294
|
+
"./diagnostics-*",
|
|
295
|
+
"./themeReveal-*"
|
|
296
|
+
],
|
|
297
|
+
"gzip": true,
|
|
298
|
+
"limit": "44.06 KB"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"name": "SortableList",
|
|
302
|
+
"path": "dist/components/sortableList.mjs",
|
|
303
|
+
"ignore": [
|
|
304
|
+
"react",
|
|
305
|
+
"react-dom",
|
|
306
|
+
"./diagnostics-*",
|
|
307
|
+
"./themeReveal-*"
|
|
308
|
+
],
|
|
309
|
+
"gzip": true,
|
|
310
|
+
"limit": "44.33 KB"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"name": "VirtualList",
|
|
314
|
+
"path": "dist/components/virtualList.mjs",
|
|
315
|
+
"ignore": [
|
|
316
|
+
"react",
|
|
317
|
+
"react-dom",
|
|
318
|
+
"./diagnostics-*",
|
|
319
|
+
"./themeReveal-*"
|
|
320
|
+
],
|
|
321
|
+
"gzip": true,
|
|
322
|
+
"limit": "43.16 KB"
|
|
274
323
|
},
|
|
275
324
|
{
|
|
276
325
|
"name": "Skeleton",
|
|
@@ -282,7 +331,7 @@
|
|
|
282
331
|
"./themeReveal-*"
|
|
283
332
|
],
|
|
284
333
|
"gzip": true,
|
|
285
|
-
"limit": "
|
|
334
|
+
"limit": "38.98 KB"
|
|
286
335
|
},
|
|
287
336
|
{
|
|
288
337
|
"name": "Tabs",
|
|
@@ -294,7 +343,7 @@
|
|
|
294
343
|
"./themeReveal-*"
|
|
295
344
|
],
|
|
296
345
|
"gzip": true,
|
|
297
|
-
"limit": "
|
|
346
|
+
"limit": "41.62 KB"
|
|
298
347
|
},
|
|
299
348
|
{
|
|
300
349
|
"name": "Slider",
|
|
@@ -306,7 +355,7 @@
|
|
|
306
355
|
"./themeReveal-*"
|
|
307
356
|
],
|
|
308
357
|
"gzip": true,
|
|
309
|
-
"limit": "
|
|
358
|
+
"limit": "40.77 KB"
|
|
310
359
|
},
|
|
311
360
|
{
|
|
312
361
|
"name": "Progress",
|
|
@@ -318,7 +367,7 @@
|
|
|
318
367
|
"./themeReveal-*"
|
|
319
368
|
],
|
|
320
369
|
"gzip": true,
|
|
321
|
-
"limit": "
|
|
370
|
+
"limit": "38.96 KB"
|
|
322
371
|
},
|
|
323
372
|
{
|
|
324
373
|
"name": "Toaster",
|
|
@@ -330,7 +379,7 @@
|
|
|
330
379
|
"./themeReveal-*"
|
|
331
380
|
],
|
|
332
381
|
"gzip": true,
|
|
333
|
-
"limit": "40
|
|
382
|
+
"limit": "42.40 KB"
|
|
334
383
|
},
|
|
335
384
|
{
|
|
336
385
|
"name": "Combobox",
|
|
@@ -342,7 +391,7 @@
|
|
|
342
391
|
"./themeReveal-*"
|
|
343
392
|
],
|
|
344
393
|
"gzip": true,
|
|
345
|
-
"limit": "
|
|
394
|
+
"limit": "48.21 KB"
|
|
346
395
|
},
|
|
347
396
|
{
|
|
348
397
|
"name": "Dashboard",
|
|
@@ -354,7 +403,7 @@
|
|
|
354
403
|
"./themeReveal-*"
|
|
355
404
|
],
|
|
356
405
|
"gzip": true,
|
|
357
|
-
"limit": "
|
|
406
|
+
"limit": "44.62 KB"
|
|
358
407
|
},
|
|
359
408
|
{
|
|
360
409
|
"name": "DataGrid",
|
|
@@ -363,10 +412,11 @@
|
|
|
363
412
|
"react",
|
|
364
413
|
"react-dom",
|
|
365
414
|
"./diagnostics-*",
|
|
366
|
-
"./themeReveal-*"
|
|
415
|
+
"./themeReveal-*",
|
|
416
|
+
"../dataGridList.mjs"
|
|
367
417
|
],
|
|
368
418
|
"gzip": true,
|
|
369
|
-
"limit": "
|
|
419
|
+
"limit": "93.23 KB"
|
|
370
420
|
},
|
|
371
421
|
{
|
|
372
422
|
"name": "DataGrid export, the chunk fetched on the first press",
|
|
@@ -380,6 +430,20 @@
|
|
|
380
430
|
"gzip": true,
|
|
381
431
|
"limit": "3.8 KB"
|
|
382
432
|
},
|
|
433
|
+
{
|
|
434
|
+
"name": "DataGrid list layout, the chunk a narrow grid fetches on top of the grid",
|
|
435
|
+
"path": "dist/dataGridList.mjs",
|
|
436
|
+
"ignore": [
|
|
437
|
+
"react",
|
|
438
|
+
"react-dom",
|
|
439
|
+
"./diagnostics-*",
|
|
440
|
+
"./themeReveal-*",
|
|
441
|
+
"./box.mjs",
|
|
442
|
+
"./components/*"
|
|
443
|
+
],
|
|
444
|
+
"gzip": true,
|
|
445
|
+
"limit": "7.83 KB"
|
|
446
|
+
},
|
|
383
447
|
{
|
|
384
448
|
"name": "Full library (Box + ssg + every component)",
|
|
385
449
|
"path": "dev/size-full.mjs",
|
|
@@ -390,7 +454,7 @@
|
|
|
390
454
|
"./themeReveal-*"
|
|
391
455
|
],
|
|
392
456
|
"gzip": true,
|
|
393
|
-
"limit": "
|
|
457
|
+
"limit": "140.38 KB"
|
|
394
458
|
}
|
|
395
459
|
],
|
|
396
460
|
"repository": {
|
|
@@ -430,7 +494,7 @@
|
|
|
430
494
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
431
495
|
},
|
|
432
496
|
"dependencies": {
|
|
433
|
-
"@box-kite/core": "2.2.
|
|
497
|
+
"@box-kite/core": "2.2.5",
|
|
434
498
|
"csstype": "^3.2.3",
|
|
435
499
|
"use-sync-external-store": "^1.6.0"
|
|
436
500
|
},
|
package/placement.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./platform.cjs"),t=require("./effects.cjs"),n=require("./identity.cjs");let r=require("react");var i={top:`bottom`,bottom:`top`,start:`end`,end:`start`};function a(e){return e===`top`||e===`bottom`}function o(e,t){let n=a(e),r=n?e===`top`?`block-start`:`block-end`:e===`start`?`inline-start`:`inline-end`,i=t===`center`?`span-all`:`span-${n?`inline`:`block`}-${t===`start`?`end`:`start`}`;return n?`${r} ${i}`:`${i} ${r}`}function s(e){let[t,n]=e.trim().split(` `);return n===void 0?t===`block-start`?`top`:t===`block-end`?`bottom`:t===`inline-start`?`start`:t===`inline-end`?`end`:null:t===`start`?`top`:t===`end`?`bottom`:n===`start`?`start`:n===`end`?`end`:null}function c(e){return a(e)?`flip-block, flip-inline, flip-block flip-inline`:`flip-inline, flip-block, flip-inline flip-block`}function l(e,t,n,r){let i=u(t,r);return i===`top`?e.top-n.top:i===`bottom`?n.top+n.height-(e.top+e.height):i===`left`?e.left-n.left:n.left+n.width-(e.left+e.width)}function u(e,t){return e===`top`||e===`bottom`?e:e===`start`===t?`right`:`left`}function d(e,t,n,r){return Math.max(n,Math.min(e,n+r-t))}function f(e,t,n,r){let{align:o,offset:s,flip:c,rtl:f}=r,p=(a(r.side)?t.height:t.width)+s,m=c&&l(e,r.side,n,f)<p&&l(e,i[r.side],n,f)>=p?i[r.side]:r.side,h=u(m,f),g={top:e.top-t.height-s,bottom:e.top+e.height+s,left:e.left-t.width-s,right:e.left+e.width+s}[h],_=a(m),v=_?e.left:e.top,y=_?e.width:e.height,b=_?t.width:t.height,x=o===`center`?v+y/2-b/2:o===`start`===(_&&f)?v+y-b:v,S=_?d(x,t.width,n.left,n.width):d(x,t.height,n.top,n.height);return _?{top:g,left:S,side:m}:{top:S,left:g,side:m}}var p=4,m=16,h={top:`mb`,bottom:`mt`,start:`me`,end:`ms`};function g(){return typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`anchor-name: --a`)}function _(){let e=typeof document>`u`?null:document.documentElement,t=e?parseFloat(getComputedStyle(e).fontSize):NaN;return Number.isFinite(t)&&t>0?t:m}function v(e){let{top:t,left:n,width:r,height:i}=e.getBoundingClientRect();return{top:t,left:n,width:r,height:i}}function y(e,t){return e!==null&&e.top===t.top&&e.left===t.left&&e.side===t.side&&e.anchorWidth===t.anchorWidth}function b(i={}){let{side:a=`bottom`,align:l=`center`,offset:u=0,flip:d=!0,matchWidth:m=!1,name:b,anchor:x,trackSide:S=!1}=i,C=n.t(`anchor`),w=`--${(b??C).replace(/^--/,``)}`,[T,E]=(0,r.useState)(!0),[D,O]=(0,r.useState)(null),[k,A]=(0,r.useState)(null),[j,M]=(0,r.useState)(null),[N,P]=(0,r.useState)(null);t.n(()=>{g()||E(!1)},[]),t.n(()=>{let t=e.
|
|
1
|
+
const e=require("./platform.cjs"),t=require("./effects.cjs"),n=require("./identity.cjs");let r=require("react");var i={top:`bottom`,bottom:`top`,start:`end`,end:`start`};function a(e){return e===`top`||e===`bottom`}function o(e,t){let n=a(e),r=n?e===`top`?`block-start`:`block-end`:e===`start`?`inline-start`:`inline-end`,i=t===`center`?`span-all`:`span-${n?`inline`:`block`}-${t===`start`?`end`:`start`}`;return n?`${r} ${i}`:`${i} ${r}`}function s(e){let[t,n]=e.trim().split(` `);return n===void 0?t===`block-start`?`top`:t===`block-end`?`bottom`:t===`inline-start`?`start`:t===`inline-end`?`end`:null:t===`start`?`top`:t===`end`?`bottom`:n===`start`?`start`:n===`end`?`end`:null}function c(e){return a(e)?`flip-block, flip-inline, flip-block flip-inline`:`flip-inline, flip-block, flip-inline flip-block`}function l(e,t,n,r){let i=u(t,r);return i===`top`?e.top-n.top:i===`bottom`?n.top+n.height-(e.top+e.height):i===`left`?e.left-n.left:n.left+n.width-(e.left+e.width)}function u(e,t){return e===`top`||e===`bottom`?e:e===`start`===t?`right`:`left`}function d(e,t,n,r){return Math.max(n,Math.min(e,n+r-t))}function f(e,t,n,r){let{align:o,offset:s,flip:c,rtl:f}=r,p=(a(r.side)?t.height:t.width)+s,m=c&&l(e,r.side,n,f)<p&&l(e,i[r.side],n,f)>=p?i[r.side]:r.side,h=u(m,f),g={top:e.top-t.height-s,bottom:e.top+e.height+s,left:e.left-t.width-s,right:e.left+e.width+s}[h],_=a(m),v=_?e.left:e.top,y=_?e.width:e.height,b=_?t.width:t.height,x=o===`center`?v+y/2-b/2:o===`start`===(_&&f)?v+y-b:v,S=_?d(x,t.width,n.left,n.width):d(x,t.height,n.top,n.height);return _?{top:g,left:S,side:m}:{top:S,left:g,side:m}}var p=4,m=16,h={top:`mb`,bottom:`mt`,start:`me`,end:`ms`};function g(){return typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`anchor-name: --a`)}function _(){let e=typeof document>`u`?null:document.documentElement,t=e?parseFloat(getComputedStyle(e).fontSize):NaN;return Number.isFinite(t)&&t>0?t:m}function v(e){let{top:t,left:n,width:r,height:i}=e.getBoundingClientRect();return{top:t,left:n,width:r,height:i}}function y(e,t){return e!==null&&e.top===t.top&&e.left===t.left&&e.side===t.side&&e.anchorWidth===t.anchorWidth}function b(i={}){let{side:a=`bottom`,align:l=`center`,offset:u=0,flip:d=!0,matchWidth:m=!1,name:b,anchor:x,trackSide:S=!1}=i,C=n.t(`anchor`),w=`--${(b??C).replace(/^--/,``)}`,[T,E]=(0,r.useState)(!0),[D,O]=(0,r.useState)(null),[k,A]=(0,r.useState)(null),[j,M]=(0,r.useState)(null),[N,P]=(0,r.useState)(null);t.n(()=>{g()||E(!1)},[]),t.n(()=>{let t=e.l(x);if(t)return t.style.setProperty(`anchor-name`,w),()=>{t.style.removeProperty(`anchor-name`)}},[x,w]),t.n(()=>{!T||!S||!k||P(s(getComputedStyle(k).getPropertyValue(`position-area`)))},[T,S,k,a,l,d]),t.n(()=>{let t=e.l(x)??D;if(T||!t||!k)return;let n=()=>{let n=v(t),r=v(k),i={top:0,left:0,width:window.innerWidth,height:window.innerHeight},o=m?Math.max(r.width,n.width):r.width,s={...f(n,{...r,width:o},i,{side:a,align:l,offset:u/p*_(),flip:d,rtl:e.d(t)}),anchorWidth:n.width};M(e=>y(e,s)?e:s)};n();let r=new AbortController;return document.addEventListener(`scroll`,n,{signal:r.signal,capture:!0,passive:!0}),window.addEventListener(`resize`,n,{signal:r.signal,passive:!0}),()=>r.abort()},[T,x,D,k,a,l,u,d,m]);let F=(0,r.useCallback)(e=>O(e),[]),I=(0,r.useCallback)(e=>A(e),[]),L={ref:T?void 0:F,style:{anchorName:w}};return T?{css:T,side:N??a,anchorProps:L,layerProps:{...S?{ref:I}:{},position:`fixed`,positionArea:o(a,l),...d?{positionTryFallbacks:c(a)}:{},...m?{minWidth:`anchor-size(width)`}:{},...u?{[h[a]]:u}:{},style:{positionAnchor:w}}}:{css:T,side:j?.side??a,anchorProps:L,layerProps:{ref:I,position:`fixed`,style:j?{top:`${j.top}px`,left:`${j.left}px`,...m?{minWidth:`${j.anchorWidth}px`}:{}}:{top:0,left:0,visibility:`hidden`}}}}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return b}});
|
package/placement.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as e, l as t } from "./platform.mjs";
|
|
2
2
|
import { n } from "./effects.mjs";
|
|
3
3
|
import { t as r } from "./identity.mjs";
|
|
4
4
|
import { useCallback as i, useState as a } from "react";
|
|
@@ -82,9 +82,9 @@ function S(o = {}) {
|
|
|
82
82
|
n(() => {
|
|
83
83
|
v() || O(!1);
|
|
84
84
|
}, []), n(() => {
|
|
85
|
-
let
|
|
86
|
-
if (
|
|
87
|
-
|
|
85
|
+
let e = t(C);
|
|
86
|
+
if (e) return e.style.setProperty("anchor-name", E), () => {
|
|
87
|
+
e.style.removeProperty("anchor-name");
|
|
88
88
|
};
|
|
89
89
|
}, [C, E]), n(() => {
|
|
90
90
|
!D || !w || !j || I(l(getComputedStyle(j).getPropertyValue("position-area")));
|
|
@@ -96,16 +96,16 @@ function S(o = {}) {
|
|
|
96
96
|
d,
|
|
97
97
|
p
|
|
98
98
|
]), n(() => {
|
|
99
|
-
let n =
|
|
99
|
+
let n = t(C) ?? k;
|
|
100
100
|
if (D || !n || !j) return;
|
|
101
101
|
let r = () => {
|
|
102
|
-
let
|
|
102
|
+
let t = b(n), r = b(j), i = {
|
|
103
103
|
top: 0,
|
|
104
104
|
left: 0,
|
|
105
105
|
width: window.innerWidth,
|
|
106
106
|
height: window.innerHeight
|
|
107
|
-
}, a = g ? Math.max(r.width,
|
|
108
|
-
...m(
|
|
107
|
+
}, a = g ? Math.max(r.width, t.width) : r.width, o = {
|
|
108
|
+
...m(t, {
|
|
109
109
|
...r,
|
|
110
110
|
width: a
|
|
111
111
|
}, i, {
|
|
@@ -113,9 +113,9 @@ function S(o = {}) {
|
|
|
113
113
|
align: d,
|
|
114
114
|
offset: f / h * y(),
|
|
115
115
|
flip: p,
|
|
116
|
-
rtl:
|
|
116
|
+
rtl: e(n)
|
|
117
117
|
}),
|
|
118
|
-
anchorWidth:
|
|
118
|
+
anchorWidth: t.width
|
|
119
119
|
};
|
|
120
120
|
P((e) => x(e, o) ? e : o);
|
|
121
121
|
};
|
package/platform.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){return e?`current`in e?e.current:e:null}function t(t){let n=e(t);return n instanceof HTMLElement?n:null}function n(t,n){let r=typeof t.composedPath==`function`?t.composedPath():[];return n.some(n=>{let i=e(n);return i?r.includes(i)||t.target instanceof Node&&i.contains(t.target):!1})}function r(t){let n=e(t),r=n?.ownerDocument?.defaultView;return!!n&&!!r&&r.getComputedStyle(n).direction===`rtl`}function i(t){let n=e(t)?.ownerDocument?.defaultView?.getSelection();n&&!n.isCollapsed&&n.removeAllRanges()}function a(){return typeof window<`u`&&window.document!==void 0}function o(){return typeof document<`u`}function s(){return o()?document:null}function c(){return s()?.documentElement??null}function l(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`}function u(){return typeof HTMLDialogElement<`u`&&`closedBy`in HTMLDialogElement.prototype}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return
|
|
1
|
+
function e(e){return e?`current`in e?e.current:e:null}function t(t){let n=e(t);return n instanceof HTMLElement?n:null}function n(t,n){let r=typeof t.composedPath==`function`?t.composedPath():[];return n.some(n=>{let i=e(n);return i?r.includes(i)||t.target instanceof Node&&i.contains(t.target):!1})}function r(t){let n=e(t),r=n?.ownerDocument?.defaultView;return!!n&&!!r&&r.getComputedStyle(n).direction===`rtl`}function i(t){let n=e(t)?.ownerDocument?.defaultView?.getSelection();n&&!n.isCollapsed&&n.removeAllRanges()}function a(){return typeof window<`u`&&window.document!==void 0}function o(){return typeof document<`u`}function s(){return o()?document:null}function c(){return s()?.documentElement??null}function l(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`}function u(){return typeof HTMLDialogElement<`u`&&`closedBy`in HTMLDialogElement.prototype}function d(e){return typeof window>`u`||typeof window.matchMedia!=`function`?null:window.matchMedia(e)}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return n}});
|
package/platform.mjs
CHANGED
|
@@ -41,5 +41,8 @@ function l() {
|
|
|
41
41
|
function u() {
|
|
42
42
|
return typeof HTMLDialogElement < "u" && "closedBy" in HTMLDialogElement.prototype;
|
|
43
43
|
}
|
|
44
|
+
function d(e) {
|
|
45
|
+
return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia(e);
|
|
46
|
+
}
|
|
44
47
|
//#endregion
|
|
45
|
-
export {
|
|
48
|
+
export { u as a, e as c, r as d, d as i, t as l, c as n, l as o, a as r, i as s, s as t, n as u };
|
|
@@ -8,7 +8,8 @@ export interface ChangeDetails<TReason extends string = string> {
|
|
|
8
8
|
/** The DOM or React event behind the change, when there was one. */
|
|
9
9
|
event?: Event | React.SyntheticEvent;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
/** `TDetails` is for a change that says more than its reason — which item moved, and from where. */
|
|
12
|
+
export type ChangeHandler<T, TReason extends string = string, TDetails extends ChangeDetails<TReason> = ChangeDetails<TReason>> = (value: T, details: TDetails) => void;
|
|
12
13
|
export interface ControllableStateOptions<T, TReason extends string = string> {
|
|
13
14
|
/** Present (not `undefined`) means the consumer owns the value: state here is ignored. */
|
|
14
15
|
value?: T;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ComponentsRegistry } from '@box-kite/core';
|
|
3
|
+
interface ComponentsProps {
|
|
4
|
+
/** A registry from `Box.createComponents()`. Create it at module scope, or memoise it: its identity is the context value. */
|
|
5
|
+
value: ComponentsRegistry | undefined;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/** Every Box below resolves its `component` against `value` instead of the app's `Box.components()`. Renders no element. */
|
|
9
|
+
export default function Components({ value, children }: ComponentsProps): React.JSX.Element;
|
|
10
|
+
export {};
|
package/react/resolveStyles.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { ComponentsRegistry } from '@box-kite/core';
|
|
2
3
|
import { BoxStyleProps } from '@box-kite/core/types';
|
|
3
4
|
export interface ResolvedBoxStyles {
|
|
4
5
|
classNames: string[];
|
|
@@ -13,6 +14,6 @@ export interface ResolvedBoxStyles {
|
|
|
13
14
|
* what those classes need comes back as elements to render, so there is nothing to flush. Its own module
|
|
14
15
|
* for that reason: the RSC entry must reach this without pulling in `useStyles` and its flush effect.
|
|
15
16
|
*/
|
|
16
|
-
export default function resolveStyles(props: BoxStyleProps<any>, isSvg: boolean): ResolvedBoxStyles & {
|
|
17
|
+
export default function resolveStyles(props: BoxStyleProps<any>, isSvg: boolean, components?: ComponentsRegistry): ResolvedBoxStyles & {
|
|
17
18
|
signature: string | null;
|
|
18
19
|
};
|
package/react/theme/theme.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { ThemeTransition } from '@box-kite/core';
|
|
2
|
+
import { ComponentsRegistry, ThemeTransition } from '@box-kite/core';
|
|
3
3
|
import { BoxStyleProps } from '@box-kite/core/types';
|
|
4
4
|
interface ThemeProps {
|
|
5
5
|
children: React.ReactNode;
|
|
@@ -24,6 +24,11 @@ interface ThemeProps {
|
|
|
24
24
|
* update inside the callback. Reduced motion skips the transition and keeps the theme change.
|
|
25
25
|
*/
|
|
26
26
|
viewTransition?: boolean | ThemeTransition;
|
|
27
|
+
/**
|
|
28
|
+
* A design for this subtree from `Box.createComponents()` — `<Box.Components value>` inside the theme,
|
|
29
|
+
* since one wrapper holding a design in both light and dark is what a themed section usually is.
|
|
30
|
+
*/
|
|
31
|
+
components?: ComponentsRegistry;
|
|
27
32
|
}
|
|
28
33
|
/**
|
|
29
34
|
* The React binding for the theme system. Everything that actually touches the platform — reading
|
package/react-shared.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime.cjs");let t=require("react");t=e.t(t,1);let n=require("@box-kite/core");function r({classNames:e,styleElements:t},r){return{className:(0,n.classNames)(e,r).join(` `),styles:t}}var i=parseInt(t.default.version,10)>=19;function a(e,n){let r=i?t=>e(t,t.ref??null):(0,t.forwardRef)(e),a=(0,t.memo)(r);return r.displayName=n,a.displayName=n,a}var o={selected:`aria-selected`},s;(function(e){function t(e,t,n){e!==void 0&&e!=null&&(n[o[t]??t]=Array.isArray(e)?e[0]:e)}e.assignBooleanProp=t})(s||={});var c=s;function l(e,t){let r=e,{props:i,className:a,disabled:o,required:s,checked:l,selected:u}=r,d={...i,className:(0,n.classNames)(t,a).join(` `)};return c.assignBooleanProp(o,`disabled`,d),c.assignBooleanProp(s,`required`,d),c.assignBooleanProp(l,`checked`,d),c.assignBooleanProp(u,`selected`,d),`style`in r&&(d.style=r.style),`id`in r&&(d.id=r.id),d}var u=parseInt(t.default.version,10)>=19,d=!1;function f(e){if(e?.length)return
|
|
1
|
+
const e=require("./rolldown-runtime.cjs");let t=require("react");t=e.t(t,1);let n=require("@box-kite/core");function r({classNames:e,styleElements:t},r){return{className:(0,n.classNames)(e,r).join(` `),styles:t}}var i=parseInt(t.default.version,10)>=19;function a(e,n){let r=i?t=>e(t,t.ref??null):(0,t.forwardRef)(e),a=(0,t.memo)(r);return r.displayName=n,a.displayName=n,a}var o={selected:`aria-selected`},s;(function(e){function t(e,t,n){e!==void 0&&e!=null&&(n[o[t]??t]=Array.isArray(e)?e[0]:e)}e.assignBooleanProp=t})(s||={});var c=s;function l(e,t){let r=e,{props:i,className:a,disabled:o,required:s,checked:l,selected:u}=r,d={...i,className:(0,n.classNames)(t,a).join(` `)};return c.assignBooleanProp(o,`disabled`,d),c.assignBooleanProp(s,`required`,d),c.assignBooleanProp(l,`checked`,d),c.assignBooleanProp(u,`selected`,d),`style`in r&&(d.style=r.style),`id`in r&&(d.id=r.id),d}var u=parseInt(t.default.version,10)>=19,d=!1,f=new WeakMap,p=new WeakMap;function m(e){let n=f.get(e);if(!n){let{href:r,css:i,precedence:a}=e;n=t.default.createElement(`style`,{key:r,href:r,precedence:a,dangerouslySetInnerHTML:{__html:i}}),f.set(e,n)}return n}function h(e){if(!e?.length)return;!u&&!d&&(d=!0,console.warn(`[box-kite] Box.configure({ sink: 'element' }) needs React 19 to hoist and dedupe its <style> elements; React ${t.default.version} will render them inline. Use the default sink instead.`));let n=p.get(e);return n||(n=e.map(m),p.set(e,n)),n}function g(e,t,r){let{classNames:i,signature:a,styleElements:o}=(0,n.getDefaultEngine)().resolveClassNames(e,t,r);return{classNames:i,signature:a,styleElements:h(o)}}var _=`__boxAttributesInProps`;function v(e){return e[_]=!0,e}function y(e){return typeof e==`function`||typeof e==`object`&&e?e[_]===!0:!1}var b=[`role`,`aria-label`,`aria-labelledby`,`aria-hidden`];function x(e,t){if(e!==void 0)return{role:`img`,"aria-label":e};if(!(t&&b.some(e=>e in t)))return{"aria-hidden":!0}}var S;(function(e){function t(e){return e.charAt(0).toUpperCase()+e.slice(1)}e.capitalize=t})(S||={});var C=S,w;(function(e){function t(e,t,n){let r={...e},i=r.props||{};return t.forEach(e=>{e in r&&(i[e]=r[e],delete r[e])}),n&&Object.entries(n).forEach(([e,t])=>{i[e]=t}),r.props=i,r}e.buildProps=t;function n(e){return!!e&&typeof e==`object`}e.isObject=n;function r(e,t){return e in t}e.isKeyOf=r})(w||={});var T=w,E=[`sky-500`,`emerald-500`,`amber-500`,`violet-500`,`rose-500`,`cyan-500`],D=[`sky-400`,`emerald-400`,`amber-400`,`violet-400`,`rose-400`,`cyan-400`];function O(e){return e.reduce((e,t,n)=>(e[`chart-${n+1}`]=t,e),{})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return h}});
|
package/react-shared.mjs
CHANGED
|
@@ -35,59 +35,70 @@ function d(e, t) {
|
|
|
35
35
|
}
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/react/styleElements.ts
|
|
38
|
-
var f = parseInt(e.version, 10) >= 19, p = !1;
|
|
39
|
-
function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
href: t
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
var f = parseInt(e.version, 10) >= 19, p = !1, m = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap();
|
|
39
|
+
function g(t) {
|
|
40
|
+
let n = m.get(t);
|
|
41
|
+
if (!n) {
|
|
42
|
+
let { href: r, css: i, precedence: a } = t;
|
|
43
|
+
n = e.createElement("style", {
|
|
44
|
+
key: r,
|
|
45
|
+
href: r,
|
|
46
|
+
precedence: a,
|
|
47
|
+
dangerouslySetInnerHTML: { __html: i }
|
|
48
|
+
}), m.set(t, n);
|
|
49
|
+
}
|
|
50
|
+
return n;
|
|
51
|
+
}
|
|
52
|
+
function _(t) {
|
|
53
|
+
if (!t?.length) return;
|
|
54
|
+
!f && !p && (p = !0, console.warn(`[box-kite] Box.configure({ sink: 'element' }) needs React 19 to hoist and dedupe its <style> elements; React ${e.version} will render them inline. Use the default sink instead.`));
|
|
55
|
+
let n = h.get(t);
|
|
56
|
+
return n || (n = t.map(g), h.set(t, n)), n;
|
|
46
57
|
}
|
|
47
58
|
//#endregion
|
|
48
59
|
//#region src/react/resolveStyles.ts
|
|
49
|
-
function
|
|
50
|
-
let { classNames:
|
|
60
|
+
function v(e, t, n) {
|
|
61
|
+
let { classNames: r, signature: a, styleElements: o } = i().resolveClassNames(e, t, n);
|
|
51
62
|
return {
|
|
52
|
-
classNames:
|
|
53
|
-
signature:
|
|
54
|
-
styleElements:
|
|
63
|
+
classNames: r,
|
|
64
|
+
signature: a,
|
|
65
|
+
styleElements: _(o)
|
|
55
66
|
};
|
|
56
67
|
}
|
|
57
68
|
//#endregion
|
|
58
69
|
//#region src/react/svg/attributesInProps.ts
|
|
59
|
-
var
|
|
60
|
-
function
|
|
61
|
-
return e[
|
|
70
|
+
var y = "__boxAttributesInProps";
|
|
71
|
+
function b(e) {
|
|
72
|
+
return e[y] = !0, e;
|
|
62
73
|
}
|
|
63
|
-
function
|
|
64
|
-
return typeof e == "function" || typeof e == "object" && e ? e[
|
|
74
|
+
function x(e) {
|
|
75
|
+
return typeof e == "function" || typeof e == "object" && e ? e[y] === !0 : !1;
|
|
65
76
|
}
|
|
66
77
|
//#endregion
|
|
67
78
|
//#region src/react/svg/svgNaming.ts
|
|
68
|
-
var
|
|
79
|
+
var S = [
|
|
69
80
|
"role",
|
|
70
81
|
"aria-label",
|
|
71
82
|
"aria-labelledby",
|
|
72
83
|
"aria-hidden"
|
|
73
84
|
];
|
|
74
|
-
function
|
|
85
|
+
function C(e, t) {
|
|
75
86
|
if (e !== void 0) return {
|
|
76
87
|
role: "img",
|
|
77
88
|
"aria-label": e
|
|
78
89
|
};
|
|
79
|
-
if (!(t &&
|
|
90
|
+
if (!(t && S.some((e) => e in t))) return { "aria-hidden": !0 };
|
|
80
91
|
}
|
|
81
92
|
//#endregion
|
|
82
93
|
//#region src/utils/string/stringUtils.ts
|
|
83
|
-
var
|
|
94
|
+
var w;
|
|
84
95
|
(function(e) {
|
|
85
96
|
function t(e) {
|
|
86
97
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
87
98
|
}
|
|
88
99
|
e.capitalize = t;
|
|
89
|
-
})(
|
|
90
|
-
var
|
|
100
|
+
})(w ||= {});
|
|
101
|
+
var T = w, E;
|
|
91
102
|
(function(e) {
|
|
92
103
|
function t(e, t, n) {
|
|
93
104
|
let r = { ...e }, i = r.props || {};
|
|
@@ -106,15 +117,15 @@ var S = x, C;
|
|
|
106
117
|
return e in t;
|
|
107
118
|
}
|
|
108
119
|
e.isKeyOf = r;
|
|
109
|
-
})(
|
|
110
|
-
var
|
|
120
|
+
})(E ||= {});
|
|
121
|
+
var D = E, O = [
|
|
111
122
|
"sky-500",
|
|
112
123
|
"emerald-500",
|
|
113
124
|
"amber-500",
|
|
114
125
|
"violet-500",
|
|
115
126
|
"rose-500",
|
|
116
127
|
"cyan-500"
|
|
117
|
-
],
|
|
128
|
+
], k = [
|
|
118
129
|
"sky-400",
|
|
119
130
|
"emerald-400",
|
|
120
131
|
"amber-400",
|
|
@@ -122,8 +133,8 @@ var w = C, T = [
|
|
|
122
133
|
"rose-400",
|
|
123
134
|
"cyan-400"
|
|
124
135
|
];
|
|
125
|
-
function
|
|
136
|
+
function A(e) {
|
|
126
137
|
return e.reduce((e, t, n) => (e[`chart-${n + 1}`] = t, e), {});
|
|
127
138
|
}
|
|
128
139
|
//#endregion
|
|
129
|
-
export {
|
|
140
|
+
export { T as a, b as c, d, s as f, D as i, v as l, O as n, C as o, a as p, A as r, x as s, k as t, _ as u };
|
|
@@ -17,6 +17,8 @@ export interface DashboardShellProps {
|
|
|
17
17
|
/** The heading above the page, and the `id` of the nav item that is marked as current. */
|
|
18
18
|
title: string;
|
|
19
19
|
current?: string;
|
|
20
|
+
/** The theme to open in. Without it the shell follows the reader's saved choice, then their system. */
|
|
21
|
+
theme?: string;
|
|
20
22
|
children: ReactNode;
|
|
21
23
|
}
|
|
22
|
-
export default function DashboardShell({ title, current, children }: DashboardShellProps): import("react").JSX.Element;
|
|
24
|
+
export default function DashboardShell({ title, current, theme, children }: DashboardShellProps): import("react").JSX.Element;
|