@stll/ui 0.37.1 → 0.39.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/README.md +40 -75
- package/dist/components/button.d.ts +1 -1
- package/dist/components/composer.d.ts +9 -1
- package/dist/components/composer.js +19 -2
- package/dist/components/copy-button.d.ts +19 -0
- package/dist/components/copy-button.js +64 -0
- package/dist/components/list.d.ts +58 -0
- package/dist/components/list.js +160 -0
- package/dist/components/menu.js +3 -3
- package/dist/components/search-field.d.ts +20 -0
- package/dist/components/search-field.js +53 -0
- package/dist/components/sidebar.d.ts +2 -2
- package/dist/components/workspace-shell.js +4 -4
- package/dist/icons.d.ts +2 -2
- package/dist/icons.js +2 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -4
- package/dist/kanban/index.d.ts +2 -5
- package/dist/kanban/index.js +1 -4
- package/dist/kanban/subgroup-board.d.ts +2 -27
- package/dist/kanban/subgroup-board.js +1 -25
- package/dist/kanban/virtual-cell.d.ts +1 -18
- package/dist/kanban/virtual-cell.js +5 -47
- package/dist/lib/control-size.d.ts +1 -1
- package/dist/styles/theme.css +7 -0
- package/package.json +13 -5
- package/dist/kanban/sortable-edge.d.ts +0 -38
- package/dist/kanban/sortable-edge.js +0 -27
- package/dist/kanban/sortable-interactions.d.ts +0 -151
- package/dist/kanban/sortable-interactions.js +0 -527
- package/dist/kanban/sortable-interactions.logic.d.ts +0 -78
- package/dist/kanban/sortable-interactions.logic.js +0 -205
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.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",
|
|
@@ -105,6 +105,10 @@
|
|
|
105
105
|
"types": "./dist/lib/control-size.d.ts",
|
|
106
106
|
"import": "./dist/lib/control-size.js"
|
|
107
107
|
},
|
|
108
|
+
"./copy-button": {
|
|
109
|
+
"types": "./dist/components/copy-button.d.ts",
|
|
110
|
+
"import": "./dist/components/copy-button.js"
|
|
111
|
+
},
|
|
108
112
|
"./calendar": {
|
|
109
113
|
"types": "./dist/calendar/index.d.ts",
|
|
110
114
|
"import": "./dist/calendar/index.js"
|
|
@@ -169,6 +173,10 @@
|
|
|
169
173
|
"types": "./dist/components/input-otp.d.ts",
|
|
170
174
|
"import": "./dist/components/input-otp.js"
|
|
171
175
|
},
|
|
176
|
+
"./list": {
|
|
177
|
+
"types": "./dist/components/list.d.ts",
|
|
178
|
+
"import": "./dist/components/list.js"
|
|
179
|
+
},
|
|
172
180
|
"./label": {
|
|
173
181
|
"types": "./dist/components/label.d.ts",
|
|
174
182
|
"import": "./dist/components/label.js"
|
|
@@ -261,6 +269,10 @@
|
|
|
261
269
|
"types": "./dist/components/scroll-to-top.d.ts",
|
|
262
270
|
"import": "./dist/components/scroll-to-top.js"
|
|
263
271
|
},
|
|
272
|
+
"./search-field": {
|
|
273
|
+
"types": "./dist/components/search-field.d.ts",
|
|
274
|
+
"import": "./dist/components/search-field.js"
|
|
275
|
+
},
|
|
264
276
|
"./secret-input": {
|
|
265
277
|
"types": "./dist/components/secret-input.d.ts",
|
|
266
278
|
"import": "./dist/components/secret-input.js"
|
|
@@ -637,8 +649,6 @@
|
|
|
637
649
|
"@atlaskit/pragmatic-drag-and-drop": "^3.1.0",
|
|
638
650
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.2.0",
|
|
639
651
|
"@base-ui/react": "1.8.0",
|
|
640
|
-
"@dnd-kit/core": "^6.3.1",
|
|
641
|
-
"@dnd-kit/sortable": "^10.0.0",
|
|
642
652
|
"@playwright/test": "^1.63.0",
|
|
643
653
|
"@stll/typescript-config": "0.0.0",
|
|
644
654
|
"@tailwindcss/vite": "4.3.3",
|
|
@@ -656,8 +666,6 @@
|
|
|
656
666
|
"@atlaskit/pragmatic-drag-and-drop": "^3.1.0",
|
|
657
667
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.2.0",
|
|
658
668
|
"@base-ui/react": "^1.7.0",
|
|
659
|
-
"@dnd-kit/core": "^6.3.1",
|
|
660
|
-
"@dnd-kit/sortable": "^10.0.0",
|
|
661
669
|
"@tanstack/react-virtual": "^3.14.13",
|
|
662
670
|
"react": ">=19",
|
|
663
671
|
"react-dom": ">=19",
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ClientRect } from "@dnd-kit/core";
|
|
2
|
-
//#region src/kanban/sortable-edge.d.ts
|
|
3
|
-
export declare const KANBAN_HORIZONTAL_EDGES: {
|
|
4
|
-
readonly before: "before";
|
|
5
|
-
readonly after: "after";
|
|
6
|
-
};
|
|
7
|
-
export type KanbanHorizontalEdge = (typeof KANBAN_HORIZONTAL_EDGES)[keyof typeof KANBAN_HORIZONTAL_EDGES];
|
|
8
|
-
export declare const KANBAN_DIRECTIONS: {
|
|
9
|
-
readonly ltr: "ltr";
|
|
10
|
-
readonly rtl: "rtl";
|
|
11
|
-
};
|
|
12
|
-
export type KanbanDirection = (typeof KANBAN_DIRECTIONS)[keyof typeof KANBAN_DIRECTIONS];
|
|
13
|
-
type KanbanPointerHorizontalEdgeOptions = {
|
|
14
|
-
input: "pointer";
|
|
15
|
-
/** The drag's current viewport x coordinate for mouse or touch input. */
|
|
16
|
-
currentClientX: number;
|
|
17
|
-
overRect: ClientRect;
|
|
18
|
-
/** Maps physical mouse and touch positions to the board's logical order. */
|
|
19
|
-
direction?: KanbanDirection | undefined;
|
|
20
|
-
};
|
|
21
|
-
type KanbanKeyboardHorizontalEdgeOptions = {
|
|
22
|
-
input: "keyboard";
|
|
23
|
-
/** The source item's position in logical board order. */
|
|
24
|
-
sourceIndex: number;
|
|
25
|
-
/** The target item's position in logical board order. */
|
|
26
|
-
targetIndex: number;
|
|
27
|
-
};
|
|
28
|
-
export type KanbanHorizontalEdgeOptions = KanbanPointerHorizontalEdgeOptions | KanbanKeyboardHorizontalEdgeOptions;
|
|
29
|
-
/**
|
|
30
|
-
* Resolves a horizontal insertion edge without consulting application data.
|
|
31
|
-
*
|
|
32
|
-
* Mouse and touch callers pass their current viewport coordinate. Keyboard
|
|
33
|
-
* callers pass source and target indices, making every logical move
|
|
34
|
-
* unambiguous. This deliberately avoids drag deltas, which include scroll
|
|
35
|
-
* reconciliation and are not viewport coordinates.
|
|
36
|
-
*/
|
|
37
|
-
export declare const getKanbanHorizontalEdge: ({ ...options }: KanbanHorizontalEdgeOptions) => KanbanHorizontalEdge;
|
|
38
|
-
//#endregion
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
//#region src/kanban/sortable-edge.ts
|
|
2
|
-
const KANBAN_HORIZONTAL_EDGES = {
|
|
3
|
-
before: "before",
|
|
4
|
-
after: "after"
|
|
5
|
-
};
|
|
6
|
-
const KANBAN_DIRECTIONS = {
|
|
7
|
-
ltr: "ltr",
|
|
8
|
-
rtl: "rtl"
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Resolves a horizontal insertion edge without consulting application data.
|
|
12
|
-
*
|
|
13
|
-
* Mouse and touch callers pass their current viewport coordinate. Keyboard
|
|
14
|
-
* callers pass source and target indices, making every logical move
|
|
15
|
-
* unambiguous. This deliberately avoids drag deltas, which include scroll
|
|
16
|
-
* reconciliation and are not viewport coordinates.
|
|
17
|
-
*/
|
|
18
|
-
const getKanbanHorizontalEdge = ({ ...options }) => {
|
|
19
|
-
if (options.input === "keyboard") return options.sourceIndex < options.targetIndex ? KANBAN_HORIZONTAL_EDGES.after : KANBAN_HORIZONTAL_EDGES.before;
|
|
20
|
-
const { currentClientX, direction = KANBAN_DIRECTIONS.ltr, overRect } = options;
|
|
21
|
-
const physicalEdge = currentClientX < getRectCenterX(overRect) ? KANBAN_HORIZONTAL_EDGES.before : KANBAN_HORIZONTAL_EDGES.after;
|
|
22
|
-
if (direction === KANBAN_DIRECTIONS.rtl) return physicalEdge === KANBAN_HORIZONTAL_EDGES.before ? KANBAN_HORIZONTAL_EDGES.after : KANBAN_HORIZONTAL_EDGES.before;
|
|
23
|
-
return physicalEdge;
|
|
24
|
-
};
|
|
25
|
-
const getRectCenterX = ({ left, width }) => left + width / 2;
|
|
26
|
-
//#endregion
|
|
27
|
-
export { KANBAN_DIRECTIONS, KANBAN_HORIZONTAL_EDGES, getKanbanHorizontalEdge };
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { Button } from "../components/button.js";
|
|
2
|
-
import { KANBAN_BOARD_COLLISION_DETECTION, KanbanCellVirtualNavigation, KanbanSortableCellPosition, KanbanVirtualScrollRequest, kanbanKeyboardCoordinates } from "./sortable-interactions.logic.js";
|
|
3
|
-
import * as React$1 from "react";
|
|
4
|
-
import { AutoScrollActivator, AutoScrollOptions, CollisionDetection, DndContextProps, DragCancelEvent, DragEndEvent, DragOverEvent, DragOverlayProps, DragStartEvent, KeyboardCoordinateGetter, UniqueIdentifier } from "@dnd-kit/core";
|
|
5
|
-
import { SortableContextProps, useSortable } from "@dnd-kit/sortable";
|
|
6
|
-
//#region src/kanban/sortable-interactions.d.ts
|
|
7
|
-
export declare const KANBAN_MOUSE_ACTIVATION_DISTANCE = 8;
|
|
8
|
-
/** Above sticky board chrome, below app-level floating surfaces. */
|
|
9
|
-
export declare const KANBAN_DRAG_OVERLAY_Z_INDEX = 75;
|
|
10
|
-
export declare const KANBAN_BOARD_AUTO_SCROLL_OPTIONS: {
|
|
11
|
-
readonly acceleration: 10;
|
|
12
|
-
readonly activator: AutoScrollActivator.Pointer;
|
|
13
|
-
readonly threshold: {
|
|
14
|
-
readonly x: 0.15;
|
|
15
|
-
readonly y: 0.15;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export declare const KANBAN_SORTABLE_ACTIVATION_MODES: {
|
|
19
|
-
readonly CARD: "card";
|
|
20
|
-
readonly HANDLE: "handle";
|
|
21
|
-
readonly ITEM: "item";
|
|
22
|
-
};
|
|
23
|
-
export declare const KANBAN_TOUCH_ACTIVATION_CONSTRAINT: {
|
|
24
|
-
readonly delay: 150;
|
|
25
|
-
readonly tolerance: 8;
|
|
26
|
-
};
|
|
27
|
-
export type KanbanDragCancelEvent = DragCancelEvent;
|
|
28
|
-
export type KanbanDragEndEvent = DragEndEvent;
|
|
29
|
-
export type KanbanDragOverEvent = DragOverEvent;
|
|
30
|
-
export type KanbanDragStartEvent = DragStartEvent;
|
|
31
|
-
export type KanbanSortableBoardProps = {
|
|
32
|
-
children: React$1.ReactNode;
|
|
33
|
-
onDragEnd: (event: KanbanDragEndEvent) => void;
|
|
34
|
-
/** Minimum pointer movement before a mouse drag activates. */
|
|
35
|
-
mouseActivationDistance?: number | undefined;
|
|
36
|
-
collisionDetection?: CollisionDetection | undefined;
|
|
37
|
-
keyboardCoordinates?: KeyboardCoordinateGetter | undefined;
|
|
38
|
-
autoScroll?: boolean | AutoScrollOptions | undefined;
|
|
39
|
-
/** Replaces the default mouse, touch, and keyboard sensors when supplied. */
|
|
40
|
-
sensors?: DndContextProps["sensors"] | undefined;
|
|
41
|
-
/** Overrides dnd-kit's screen-reader announcements when supplied. */
|
|
42
|
-
accessibility?: DndContextProps["accessibility"] | undefined;
|
|
43
|
-
/**
|
|
44
|
-
* Fires on drag start and on every drag end or cancel; a board over a
|
|
45
|
-
* `KanbanSubgroupBoard` combines the two into that board's `isDragging`
|
|
46
|
-
* (`true` here, `false` on `onDragEnd`/`onDragCancel`).
|
|
47
|
-
*/
|
|
48
|
-
onDragStart?: ((event: KanbanDragStartEvent) => void) | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* Fires whenever dnd-kit's collision detection changes the drop target
|
|
51
|
-
* the drag is over, `event.over` included when it becomes none. A board
|
|
52
|
-
* over a `KanbanSubgroupBoard` maps `event.over?.id ?? null` to a band id
|
|
53
|
-
* (via `KanbanSubgroupCellContext.band`, or a droppable registered for a
|
|
54
|
-
* folded band's slot) to drive that board's `dragOverBandId`.
|
|
55
|
-
*/
|
|
56
|
-
onDragOver?: ((event: KanbanDragOverEvent) => void) | undefined;
|
|
57
|
-
onDragCancel?: ((event: KanbanDragCancelEvent) => void) | undefined;
|
|
58
|
-
/** Called once mounted child drop targets can safely receive input. */
|
|
59
|
-
onInteractionReady?: (() => void) | undefined;
|
|
60
|
-
/** Rendered in document.body while an item is active. */
|
|
61
|
-
overlay?: ((activeId: UniqueIdentifier | null) => React$1.ReactNode) | undefined;
|
|
62
|
-
overlayProps?: Omit<DragOverlayProps, "children"> | undefined;
|
|
63
|
-
};
|
|
64
|
-
export type UseKanbanDropTargetOptions = {
|
|
65
|
-
disabled?: boolean | undefined;
|
|
66
|
-
id: string;
|
|
67
|
-
itemIds: readonly UniqueIdentifier[];
|
|
68
|
-
navigation: KanbanCellVirtualNavigation;
|
|
69
|
-
position: KanbanSortableCellPosition;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Register a board-level drop target such as an empty cell or terminal lane.
|
|
73
|
-
*
|
|
74
|
-
* Board consumers should not need to couple their presentation code to the
|
|
75
|
-
* underlying drag-and-drop library just to receive an item from a sortable
|
|
76
|
-
* context.
|
|
77
|
-
*/
|
|
78
|
-
export declare const useKanbanDropTarget: ({ disabled, id, itemIds, navigation, position }: UseKanbanDropTargetOptions) => {
|
|
79
|
-
isOver: boolean;
|
|
80
|
-
setNodeRef: (element: HTMLElement | null) => void;
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Input-complete drag context for sortable boards.
|
|
84
|
-
*
|
|
85
|
-
* The consumer owns identifiers and the result of a drop; this component owns
|
|
86
|
-
* the sensor activation rules, keyboard navigation, auto-scroll configuration,
|
|
87
|
-
* and overlay lifecycle shared by sortable board UIs.
|
|
88
|
-
*/
|
|
89
|
-
export declare const KanbanSortableBoard: ({ children, onDragEnd, mouseActivationDistance, collisionDetection, keyboardCoordinates, autoScroll, sensors, accessibility, onDragStart, onDragOver, onDragCancel, onInteractionReady, overlay, overlayProps }: KanbanSortableBoardProps) => React$1.JSX.Element;
|
|
90
|
-
export declare const useKanbanSortableSensors: (keyboardCoordinates?: KeyboardCoordinateGetter, mouseActivationDistance?: number) => import("@dnd-kit/core").SensorDescriptor<import("@dnd-kit/core").SensorOptions>[];
|
|
91
|
-
export type KanbanSortableListProps = SortableContextProps & React$1.ComponentProps<"div">;
|
|
92
|
-
/** A vertical card list that preserves native vertical touch scrolling. */
|
|
93
|
-
export declare const KanbanSortableList: ({ className, children, id, items, strategy, disabled, ...props }: KanbanSortableListProps) => React$1.JSX.Element;
|
|
94
|
-
export type KanbanSortableColumnsProps = SortableContextProps & React$1.ComponentProps<"div">;
|
|
95
|
-
/** A horizontal column list that keeps the board pan gesture available. */
|
|
96
|
-
export declare const KanbanSortableColumns: ({ className, children, id, items, strategy, disabled, ...props }: KanbanSortableColumnsProps) => React$1.JSX.Element;
|
|
97
|
-
export type KanbanSortableBindings = Pick<ReturnType<typeof useSortable>, "attributes" | "listeners" | "setActivatorNodeRef">;
|
|
98
|
-
export type KanbanSortableActivationMode = {
|
|
99
|
-
type: "card";
|
|
100
|
-
} | {
|
|
101
|
-
type: "handle";
|
|
102
|
-
} | {
|
|
103
|
-
type: "item";
|
|
104
|
-
};
|
|
105
|
-
export type UseKanbanSortableOptions = {
|
|
106
|
-
activation: KanbanSortableActivationMode;
|
|
107
|
-
id: UniqueIdentifier;
|
|
108
|
-
disabled?: boolean | undefined;
|
|
109
|
-
};
|
|
110
|
-
type KanbanSortableActivator = {
|
|
111
|
-
bindings: KanbanSortableBindings;
|
|
112
|
-
type: typeof KANBAN_SORTABLE_ACTIVATION_MODES.HANDLE;
|
|
113
|
-
} | {
|
|
114
|
-
bindings: KanbanSortableBindings;
|
|
115
|
-
type: typeof KANBAN_SORTABLE_ACTIVATION_MODES.CARD;
|
|
116
|
-
} | {
|
|
117
|
-
attributes: ReturnType<typeof useSortable>["attributes"];
|
|
118
|
-
listeners: ReturnType<typeof useSortable>["listeners"];
|
|
119
|
-
type: typeof KANBAN_SORTABLE_ACTIVATION_MODES.ITEM;
|
|
120
|
-
};
|
|
121
|
-
/**
|
|
122
|
-
* Connect a sortable item and its separate drag handle without making the
|
|
123
|
-
* item's content a touch-none activation surface.
|
|
124
|
-
*/
|
|
125
|
-
export declare const useKanbanSortable: ({ activation, id, disabled }: UseKanbanSortableOptions) => {
|
|
126
|
-
activator: KanbanSortableActivator;
|
|
127
|
-
isDragging: boolean;
|
|
128
|
-
setNodeRef: (element: HTMLElement | null) => void;
|
|
129
|
-
style: {
|
|
130
|
-
touchAction: string | undefined;
|
|
131
|
-
transform: string | undefined;
|
|
132
|
-
transition: string | undefined;
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
export type KanbanDragHandleProps = {
|
|
136
|
-
bindings: KanbanSortableBindings;
|
|
137
|
-
label: string;
|
|
138
|
-
} & Omit<React$1.ComponentProps<typeof Button>, "aria-label" | "children" | "ref" | "tooltip" | "type">;
|
|
139
|
-
/**
|
|
140
|
-
* A 44px keyboard-accessible drag activator. The handle is the only board
|
|
141
|
-
* surface that disables touch panning, leaving cards and scroll regions free
|
|
142
|
-
* for ordinary scrolling.
|
|
143
|
-
*/
|
|
144
|
-
export declare const KanbanDragHandle: ({ bindings, label, className, ...props }: KanbanDragHandleProps) => React$1.JSX.Element;
|
|
145
|
-
export type KanbanCardDragSurfaceProps = {
|
|
146
|
-
bindings: KanbanSortableBindings;
|
|
147
|
-
} & Omit<React$1.ComponentProps<"div">, "ref">;
|
|
148
|
-
/** A whole-card drag activator that preserves descendant controls and scrolling. */
|
|
149
|
-
export declare const KanbanCardDragSurface: ({ bindings, className, ...props }: KanbanCardDragSurfaceProps) => React$1.JSX.Element;
|
|
150
|
-
//#endregion
|
|
151
|
-
export { KANBAN_BOARD_COLLISION_DETECTION, type KanbanCellVirtualNavigation, type KanbanSortableCellPosition, type KanbanVirtualScrollRequest, kanbanKeyboardCoordinates };
|