@columenlabs/lumen-ui 0.1.90 → 0.1.91
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/lumen-bulk-bar.d.ts +14 -0
- package/dist/lumen-bulk-bar.js +13 -0
- package/dist/people/lumen-people.js +4 -3
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { type CardOnScreen, cardsOnScreen, kindName, onScreen, pointAt, pointAtC
|
|
|
8
8
|
export { LinkDot, LinkPicker, type LinkColor, linkVar } from './lumen-links.js';
|
|
9
9
|
export { CardSegments, CardSwitch } from './card-switch.js';
|
|
10
10
|
export { PageInput, PageInputs } from './page-inputs.js';
|
|
11
|
+
export { LumenBulkBar } from './lumen-bulk-bar.js';
|
|
11
12
|
export { type LumenTab, LumenTabs } from './lumen-tabs.js';
|
|
12
13
|
export { LumenTabDrawer, TAB_NAME_MAX } from './lumen-tab-drawer.js';
|
|
13
14
|
export { IconPicker } from './icon-picker.js';
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export { cardsOnScreen, kindName, onScreen, pointAt, pointAtCard, sectionsOnScre
|
|
|
15
15
|
export { LinkDot, LinkPicker, linkVar } from './lumen-links.js';
|
|
16
16
|
export { CardSegments, CardSwitch } from './card-switch.js';
|
|
17
17
|
export { PageInput, PageInputs } from './page-inputs.js';
|
|
18
|
+
export { LumenBulkBar } from './lumen-bulk-bar.js';
|
|
18
19
|
export { LumenTabs } from './lumen-tabs.js';
|
|
19
20
|
export { LumenTabDrawer, TAB_NAME_MAX } from './lumen-tab-drawer.js';
|
|
20
21
|
export { IconPicker } from './icon-picker.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The bar over a table while rows are ticked: how many, the actions that apply to them, and a ✕
|
|
4
|
+
* that clears the ticks. Each action clears the selection when it applies and offers Undo in a
|
|
5
|
+
* toast (the change comes back, not the ticks). Pair it with LumenLayout's `selection`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function LumenBulkBar({ count, label, onClear, children, }: {
|
|
8
|
+
count: number;
|
|
9
|
+
/** The toolbar's name for screen readers ("Change the ticked people"). */
|
|
10
|
+
label?: string;
|
|
11
|
+
onClear: () => void;
|
|
12
|
+
/** The actions, small outline buttons or a chip picker. */
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { XIcon } from 'lucide-react';
|
|
3
|
+
import { Button } from './ui/button.js';
|
|
4
|
+
/**
|
|
5
|
+
* The bar over a table while rows are ticked: how many, the actions that apply to them, and a ✕
|
|
6
|
+
* that clears the ticks. Each action clears the selection when it applies and offers Undo in a
|
|
7
|
+
* toast (the change comes back, not the ticks). Pair it with LumenLayout's `selection`.
|
|
8
|
+
*/
|
|
9
|
+
export function LumenBulkBar({ count, label = 'Change the ticked rows', onClear, children, }) {
|
|
10
|
+
if (count < 1)
|
|
11
|
+
return null;
|
|
12
|
+
return (_jsxs("div", { role: "toolbar", "aria-label": label, className: "flex flex-wrap items-center gap-2 rounded-lg border bg-muted px-3 py-2 text-sm", children: [_jsxs("span", { className: "num font-medium", children: [count, " selected"] }), children, _jsx(Button, { size: "icon-sm", variant: "ghost", "aria-label": "Clear the selection", className: "ml-auto", onClick: onClear, children: _jsx(XIcon, {}) })] }));
|
|
13
|
+
}
|
|
@@ -2,10 +2,11 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
// LumenPeople: who may sign in, what each person may open, invites and the audit log, as one block
|
|
3
3
|
// an app drops in with an adapter (`peopleClient(url)` over `@columenlabs/lumen-people`'s routes).
|
|
4
4
|
import { levelLabel, levelOf, levelsOf, } from '@columenlabs/lumen-ui-types/people';
|
|
5
|
-
import { AppWindowIcon, BanIcon, CircleDotIcon, ClockIcon, HistoryIcon, KeyRoundIcon, MailIcon, ShieldCheckIcon, Trash2Icon, TriangleAlertIcon, UserPlusIcon, UserRoundIcon, UsersIcon,
|
|
5
|
+
import { AppWindowIcon, BanIcon, CircleDotIcon, ClockIcon, HistoryIcon, KeyRoundIcon, MailIcon, ShieldCheckIcon, Trash2Icon, TriangleAlertIcon, UserPlusIcon, UserRoundIcon, UsersIcon, } from 'lucide-react';
|
|
6
6
|
import { useMemo, useState } from 'react';
|
|
7
7
|
import { LumenConfirm } from '../confirm.js';
|
|
8
8
|
import { LumenBoundary } from '../lumen-boundary.js';
|
|
9
|
+
import { LumenBulkBar } from '../lumen-bulk-bar.js';
|
|
9
10
|
import { LumenLayout } from '../lumen-layout.js';
|
|
10
11
|
import { LumenPageState } from '../lumen-page-state.js';
|
|
11
12
|
import { LumenSelector } from '../lumen-selector.js';
|
|
@@ -231,10 +232,10 @@ function BulkBar({ frame, ids, onClear, }) {
|
|
|
231
232
|
onClear();
|
|
232
233
|
void act(() => each({ op: 'status', status: 'disabled' }, list), `${many(list.length)} disabled`, () => each({ op: 'status', status: 'active' }, list));
|
|
233
234
|
};
|
|
234
|
-
return (_jsxs(
|
|
235
|
+
return (_jsxs(LumenBulkBar, { count: n, label: "Change the ticked people", onClear: onClear, children: [_jsx(LumenSelector, { trigger: "chip", size: "sm", label: "Set level on\u2026", placeholder: "Set level on\u2026", value: null, options: levelOptions, onChange: setLevel }), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => setRole('admin'), children: [_jsx(ShieldCheckIcon, {}), " Make admin"] }), invites.length > 0 && (_jsxs(Button, { size: "sm", variant: "outline", onClick: () => {
|
|
235
236
|
onClear();
|
|
236
237
|
void act(() => each({ op: 'resend' }, invites), `New invites sent to ${many(invites.length)}`);
|
|
237
|
-
}, children: [_jsx(MailIcon, {}), " Resend invites"] })), _jsxs(Button, { size: "sm", variant: "outline", onClick: disable, children: [_jsx(BanIcon, {}), " Disable"] }), _jsxs(Button, { size: "sm", variant: "outline", className: "text-destructive", onClick: () => setRemoving(true), children: [_jsx(Trash2Icon, {}), " Remove"] }), _jsx(
|
|
238
|
+
}, children: [_jsx(MailIcon, {}), " Resend invites"] })), _jsxs(Button, { size: "sm", variant: "outline", onClick: disable, children: [_jsx(BanIcon, {}), " Disable"] }), _jsxs(Button, { size: "sm", variant: "outline", className: "text-destructive", onClick: () => setRemoving(true), children: [_jsx(Trash2Icon, {}), " Remove"] }), _jsx(LumenConfirm, { open: removing, onOpenChange: setRemoving, title: `Remove ${many(n)}?`, description: "Each part of the app deletes their data first, then they leave People. This cannot be undone.", typeToConfirm: "REMOVE", action: "Remove for good", busyAction: "Removing\u2026", onConfirm: async () => {
|
|
238
239
|
const r = await act(() => each({ op: 'remove' }, chosen), `Removed ${many(n)}`);
|
|
239
240
|
if (!r)
|
|
240
241
|
throw new Error('Some people were not removed.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@columenlabs/lumen-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.91",
|
|
4
4
|
"description": "Lumen: shared React components (frame, views, widgets, charts, drawers).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@codemirror/lang-javascript": "6.2.5",
|
|
50
50
|
"@codemirror/lang-json": "6.0.2",
|
|
51
51
|
"@codemirror/lang-sql": "6.10.0",
|
|
52
|
-
"@columenlabs/lumen-ui-types": "0.1.
|
|
52
|
+
"@columenlabs/lumen-ui-types": "0.1.91",
|
|
53
53
|
"@dnd-kit/core": "6.3.1",
|
|
54
54
|
"@dnd-kit/sortable": "10.0.0",
|
|
55
55
|
"@dnd-kit/utilities": "3.2.2",
|