@stll/ui 0.18.0 → 0.20.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/components/button-variants.d.ts +2 -2
- package/dist/components/composer.d.ts +108 -0
- package/dist/components/composer.js +132 -0
- package/dist/components/landing.d.ts +61 -0
- package/dist/components/landing.js +97 -0
- package/dist/components/sidebar.d.ts +109 -0
- package/dist/components/sidebar.js +361 -0
- package/dist/components/sidebar.logic.d.ts +34 -0
- package/dist/components/sidebar.logic.js +27 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.js +6 -3
- package/dist/inspector/entity-tab.d.ts +54 -0
- package/dist/inspector/entity-tab.js +56 -0
- package/dist/inspector/entity-tab.logic.d.ts +28 -0
- package/dist/inspector/entity-tab.logic.js +32 -0
- package/dist/inspector/facet-bar.d.ts +46 -0
- package/dist/inspector/facet-bar.js +166 -0
- package/dist/inspector/facet-bar.logic.d.ts +51 -0
- package/dist/inspector/facet-bar.logic.js +53 -0
- package/dist/inspector/index.d.ts +3 -1
- package/dist/inspector/index.js +3 -1
- package/dist/inspector/tabs.d.ts +1 -1
- package/dist/kanban/band-peek.d.ts +26 -33
- package/dist/kanban/band-peek.js +24 -30
- package/dist/kanban/column-header.d.ts +8 -1
- package/dist/kanban/column-header.js +9 -2
- package/dist/kanban/drag-interactions.d.ts +9 -1
- package/dist/kanban/drag-interactions.js +10 -1
- package/dist/kanban/index.d.ts +2 -2
- package/dist/kanban/index.js +2 -2
- package/dist/kanban/sortable-interactions.d.ts +12 -0
- package/dist/kanban/subgroup-board.d.ts +33 -6
- package/dist/kanban/subgroup-board.js +75 -22
- package/dist/kanban/virtual-cell.d.ts +10 -1
- package/dist/kanban/virtual-cell.js +25 -3
- package/dist/lib/control-size.d.ts +1 -1
- package/dist/lib/slot.d.ts +28 -0
- package/dist/lib/slot.js +64 -0
- package/package.json +17 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/lib/slot.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Minimal replacement for `@radix-ui/react-slot`.
|
|
4
|
+
*
|
|
5
|
+
* Renders its single child element with the parent's props
|
|
6
|
+
* (className, style, event handlers, ref, data-* attributes)
|
|
7
|
+
* merged onto it. Used by the sidebar shell for the `asChild`
|
|
8
|
+
* pattern.
|
|
9
|
+
*
|
|
10
|
+
* Ref composition logic adapted from the MIT-licensed
|
|
11
|
+
* `@radix-ui/react-compose-refs` (v1.1.2).
|
|
12
|
+
*
|
|
13
|
+
* This module intentionally uses `Children.only` and
|
|
14
|
+
* `cloneElement`: it is a low-level composition primitive
|
|
15
|
+
* that merges props onto a single child, which is exactly
|
|
16
|
+
* the use case React documents for these APIs.
|
|
17
|
+
*
|
|
18
|
+
* Several lint suppressions are necessary because prop
|
|
19
|
+
* merging is inherently dynamic; the types of child props
|
|
20
|
+
* are not statically known.
|
|
21
|
+
*/
|
|
22
|
+
type SlotProps = React.HTMLAttributes<HTMLElement> & {
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
25
|
+
};
|
|
26
|
+
declare const Slot: ({ ref: parentRef, children, className, style, ...rest }: SlotProps) => React.ReactNode;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { Slot };
|
package/dist/lib/slot.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { cn } from "./utils.js";
|
|
2
|
+
import { Children, Fragment, cloneElement, isValidElement } from "react";
|
|
3
|
+
//#region src/lib/slot.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Minimal replacement for `@radix-ui/react-slot`.
|
|
6
|
+
*
|
|
7
|
+
* Renders its single child element with the parent's props
|
|
8
|
+
* (className, style, event handlers, ref, data-* attributes)
|
|
9
|
+
* merged onto it. Used by the sidebar shell for the `asChild`
|
|
10
|
+
* pattern.
|
|
11
|
+
*
|
|
12
|
+
* Ref composition logic adapted from the MIT-licensed
|
|
13
|
+
* `@radix-ui/react-compose-refs` (v1.1.2).
|
|
14
|
+
*
|
|
15
|
+
* This module intentionally uses `Children.only` and
|
|
16
|
+
* `cloneElement`: it is a low-level composition primitive
|
|
17
|
+
* that merges props onto a single child, which is exactly
|
|
18
|
+
* the use case React documents for these APIs.
|
|
19
|
+
*
|
|
20
|
+
* Several lint suppressions are necessary because prop
|
|
21
|
+
* merging is inherently dynamic; the types of child props
|
|
22
|
+
* are not statically known.
|
|
23
|
+
*/
|
|
24
|
+
const Slot = ({ ref: parentRef, children, className, style, ...rest }) => {
|
|
25
|
+
const child = Children.only(children);
|
|
26
|
+
if (!isValidElement(child)) return child;
|
|
27
|
+
if (child.type === Fragment) return child;
|
|
28
|
+
const childProps = child.props;
|
|
29
|
+
const mergedProps = {
|
|
30
|
+
...rest,
|
|
31
|
+
...childProps
|
|
32
|
+
};
|
|
33
|
+
const childRef = childProps["ref"];
|
|
34
|
+
if (parentRef !== void 0 || childRef !== void 0) mergedProps["ref"] = composeSlotRefs(parentRef, childRef);
|
|
35
|
+
const childClassName = childProps["className"];
|
|
36
|
+
if (className || typeof childClassName === "string") mergedProps["className"] = cn(className, typeof childClassName === "string" ? childClassName : void 0);
|
|
37
|
+
const childStyle = childProps["style"];
|
|
38
|
+
if (style || typeof childStyle === "object" && childStyle !== null) mergedProps["style"] = {
|
|
39
|
+
...style,
|
|
40
|
+
...typeof childStyle === "object" && childStyle !== null ? childStyle : {}
|
|
41
|
+
};
|
|
42
|
+
const restEntries = Object.entries(rest);
|
|
43
|
+
for (const [key, parentValue] of restEntries) if (key.startsWith("on") && typeof parentValue === "function") {
|
|
44
|
+
const childValue = childProps[key];
|
|
45
|
+
if (typeof childValue === "function") mergedProps[key] = (...args) => {
|
|
46
|
+
Reflect.apply(childValue, void 0, args);
|
|
47
|
+
Reflect.apply(parentValue, void 0, args);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return cloneElement(child, mergedProps);
|
|
51
|
+
};
|
|
52
|
+
const composeSlotRefs = (parentRef, childRef) => (node) => {
|
|
53
|
+
setSlotRef(parentRef, node);
|
|
54
|
+
setSlotRef(childRef, node);
|
|
55
|
+
};
|
|
56
|
+
const setSlotRef = (ref, node) => {
|
|
57
|
+
if (typeof ref === "function") {
|
|
58
|
+
Reflect.apply(ref, void 0, [node]);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (typeof ref === "object" && ref !== null && "current" in ref) ref.current = node;
|
|
62
|
+
};
|
|
63
|
+
//#endregion
|
|
64
|
+
export { Slot };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Stella's design system: bidi-aware React primitives built on Base UI, the dockable inspector pane, and the Tailwind v4 theme they are styled with.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"base-ui",
|
|
@@ -89,6 +89,10 @@
|
|
|
89
89
|
"types": "./dist/components/command.d.ts",
|
|
90
90
|
"import": "./dist/components/command.js"
|
|
91
91
|
},
|
|
92
|
+
"./composer": {
|
|
93
|
+
"types": "./dist/components/composer.d.ts",
|
|
94
|
+
"import": "./dist/components/composer.js"
|
|
95
|
+
},
|
|
92
96
|
"./control-size": {
|
|
93
97
|
"types": "./dist/lib/control-size.d.ts",
|
|
94
98
|
"import": "./dist/lib/control-size.js"
|
|
@@ -157,6 +161,10 @@
|
|
|
157
161
|
"types": "./dist/components/label.d.ts",
|
|
158
162
|
"import": "./dist/components/label.js"
|
|
159
163
|
},
|
|
164
|
+
"./landing": {
|
|
165
|
+
"types": "./dist/components/landing.d.ts",
|
|
166
|
+
"import": "./dist/components/landing.js"
|
|
167
|
+
},
|
|
160
168
|
"./menu": {
|
|
161
169
|
"types": "./dist/components/menu.d.ts",
|
|
162
170
|
"import": "./dist/components/menu.js"
|
|
@@ -249,6 +257,10 @@
|
|
|
249
257
|
"types": "./dist/components/sheet.d.ts",
|
|
250
258
|
"import": "./dist/components/sheet.js"
|
|
251
259
|
},
|
|
260
|
+
"./sidebar": {
|
|
261
|
+
"types": "./dist/components/sidebar.d.ts",
|
|
262
|
+
"import": "./dist/components/sidebar.js"
|
|
263
|
+
},
|
|
252
264
|
"./loader": {
|
|
253
265
|
"types": "./dist/components/loader.d.ts",
|
|
254
266
|
"import": "./dist/components/loader.js"
|
|
@@ -486,6 +498,10 @@
|
|
|
486
498
|
"types": "./dist/components/sheet.d.ts",
|
|
487
499
|
"import": "./dist/components/sheet.js"
|
|
488
500
|
},
|
|
501
|
+
"./components/sidebar": {
|
|
502
|
+
"types": "./dist/components/sidebar.d.ts",
|
|
503
|
+
"import": "./dist/components/sidebar.js"
|
|
504
|
+
},
|
|
489
505
|
"./components/skeleton": {
|
|
490
506
|
"types": "./dist/components/skeleton.d.ts",
|
|
491
507
|
"import": "./dist/components/skeleton.js"
|