@stll/ui 0.51.0 → 0.52.1
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/alert-dialog.d.ts +1 -1
- package/dist/components/bidi-text.d.ts +1 -1
- package/dist/components/button.d.ts +2 -2
- package/dist/components/dialog.d.ts +1 -1
- package/dist/components/input-group.d.ts +1 -1
- package/dist/components/menu.d.ts +1 -1
- package/dist/components/prose.d.ts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/steps.d.ts +18 -0
- package/dist/components/steps.js +34 -0
- package/dist/components/toast.d.ts +7 -1
- package/dist/components/toast.js +39 -15
- package/dist/lib/control-size.d.ts +1 -1
- package/dist/lib/matter-colors.d.ts +1 -1
- package/package.json +7 -3
|
@@ -4,7 +4,7 @@ import * as React$1 from "react";
|
|
|
4
4
|
//#region src/components/alert-dialog.d.ts
|
|
5
5
|
declare const AlertDialogCreateHandle: typeof AlertDialog$1.createHandle;
|
|
6
6
|
declare const AlertDialog: typeof AlertDialog$1.Root;
|
|
7
|
-
declare const AlertDialogPortal: React$1.ForwardRefExoticComponent<Omit<import("@base-ui/react").
|
|
7
|
+
declare const AlertDialogPortal: React$1.ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
declare function AlertDialogTrigger({ tooltip, ...props }: AlertDialog$1.Trigger.Props & {
|
|
9
9
|
tooltip?: React$1.ReactNode;
|
|
10
10
|
}): React$1.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
2
|
//#region src/components/bidi-text.d.ts
|
|
3
3
|
export declare const BidiText: (props: BidiTextProps) => React$1.JSX.Element;
|
|
4
|
-
export declare const UserText:
|
|
4
|
+
export declare const UserText: (props: BidiTextProps) => React$1.JSX.Element;
|
|
5
5
|
type BidiDirection = "auto" | "ltr" | "rtl";
|
|
6
6
|
type BdiElementProps = Omit<React$1.ComponentPropsWithoutRef<"bdi">, "dir"> & {
|
|
7
7
|
as?: "bdi";
|
|
@@ -13,8 +13,8 @@ import { VariantProps } from "class-variance-authority";
|
|
|
13
13
|
*/
|
|
14
14
|
declare const buttonAccessibleDisabledClass = "cursor-not-allowed opacity-64";
|
|
15
15
|
declare const buttonVariants: (props?: ({
|
|
16
|
-
size?: "
|
|
17
|
-
variant?: "
|
|
16
|
+
size?: "default" | "sm" | "lg" | "icon" | "chip" | "icon-lg" | "icon-sm" | "icon-xl" | "icon-xs" | "row" | "xl" | "xs" | null | undefined;
|
|
17
|
+
variant?: "link" | "default" | "destructive" | "destructive-outline" | "destructive-ghost" | "ghost" | "muted" | "outline" | "secondary" | null | undefined;
|
|
18
18
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
19
19
|
type ButtonProps = {
|
|
20
20
|
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
@@ -14,7 +14,7 @@ declare const DialogProvider: ({ labels, children }: React$1.PropsWithChildren<{
|
|
|
14
14
|
declare const Dialog: <Payload>({ dirty, onOpenChange, onOpenChangeComplete, ...props }: Dialog$1.Root.Props<Payload> & {
|
|
15
15
|
dirty?: boolean;
|
|
16
16
|
}) => React$1.JSX.Element;
|
|
17
|
-
declare const DialogPortal: React$1.ForwardRefExoticComponent<Omit<import("@base-ui/react").
|
|
17
|
+
declare const DialogPortal: React$1.ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
18
18
|
declare function DialogTrigger({ tooltip, ...props }: Dialog$1.Trigger.Props & {
|
|
19
19
|
tooltip?: React$1.ReactNode;
|
|
20
20
|
}): React$1.JSX.Element;
|
|
@@ -5,7 +5,7 @@ import { VariantProps } from "class-variance-authority";
|
|
|
5
5
|
//#region src/components/input-group.d.ts
|
|
6
6
|
declare const InputGroup: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
|
|
7
7
|
declare const inputGroupAddonVariants: (props?: ({
|
|
8
|
-
align?: "
|
|
8
|
+
align?: "inline-end" | "inline-start" | "block-end" | "block-start" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
declare const InputGroupAddon: ({ className, align, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) => React$1.JSX.Element;
|
|
11
11
|
declare const InputGroupText: ({ className, ...props }: React$1.ComponentProps<"span">) => React$1.JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { Menu as Menu$1 } from "@base-ui/react/menu";
|
|
|
3
3
|
//#region src/components/menu.d.ts
|
|
4
4
|
declare const MenuCreateHandle: typeof Menu$1.createHandle;
|
|
5
5
|
declare const Menu: <Payload>(props: Menu$1.Root.Props<Payload>) => React$1.JSX.Element;
|
|
6
|
-
declare const MenuPortal: React$1.ForwardRefExoticComponent<Omit<import("@base-ui/react").
|
|
6
|
+
declare const MenuPortal: React$1.ForwardRefExoticComponent<Omit<import("@base-ui/react").ContextMenuPortalProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
declare function MenuTrigger({ tooltip, ...props }: Menu$1.Trigger.Props & {
|
|
8
8
|
tooltip?: React$1.ReactNode;
|
|
9
9
|
}): React$1.JSX.Element;
|
|
@@ -2,7 +2,7 @@ import * as React$1 from "react";
|
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
//#region src/components/prose.d.ts
|
|
4
4
|
declare const proseVariants: (props?: ({
|
|
5
|
-
size?: "default" | "
|
|
5
|
+
size?: "default" | "sm" | "lede" | null | undefined;
|
|
6
6
|
tone?: "default" | "muted" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
/** A readable measure for narrative copy; task-shaped text should not use it. */
|
|
@@ -2,7 +2,7 @@ import * as React$1 from "react";
|
|
|
2
2
|
import { Dialog } from "@base-ui/react/dialog";
|
|
3
3
|
//#region src/components/sheet.d.ts
|
|
4
4
|
declare const Sheet: <Payload>(props: Dialog.Root.Props<Payload>) => React$1.JSX.Element;
|
|
5
|
-
declare const SheetPortal: React$1.ForwardRefExoticComponent<Omit<import("@base-ui/react").
|
|
5
|
+
declare const SheetPortal: React$1.ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
type SheetSide = "inline-start" | "inline-end" | "block-start" | "block-end";
|
|
7
7
|
declare function SheetTrigger({ tooltip, ...props }: Dialog.Trigger.Props & {
|
|
8
8
|
tooltip?: React$1.ReactNode;
|
|
@@ -86,7 +86,7 @@ declare const SidebarMenu: ({ className, ...props }: React.ComponentProps<"ul">)
|
|
|
86
86
|
declare const SidebarMenuItem: ({ className, ...props }: React.ComponentProps<"li">) => import("react").JSX.Element;
|
|
87
87
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
88
88
|
variant?: "default" | "outline" | null | undefined;
|
|
89
|
-
size?: "default" | "
|
|
89
|
+
size?: "default" | "sm" | "lg" | "rail" | null | undefined;
|
|
90
90
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
91
91
|
/**
|
|
92
92
|
* The footer's avatar trigger, signed in (user menu) or not (sign-in): a
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
//#region src/components/steps.d.ts
|
|
4
|
+
declare const stepsVariants: (props?: ({
|
|
5
|
+
variant?: "progress" | "default" | "compact" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
type StepsProps = React$1.ComponentProps<"ol"> & VariantProps<typeof stepsVariants> & {
|
|
8
|
+
markerStyle: NonNullable<React$1.CSSProperties["listStyleType"]>;
|
|
9
|
+
};
|
|
10
|
+
/** A meaningful procedure, timeline, or ranking. The list owns its numbers. */
|
|
11
|
+
declare const Steps: ({ className, variant, markerStyle, style, ...props }: StepsProps) => React$1.JSX.Element;
|
|
12
|
+
declare const stepVariants: (props?: ({
|
|
13
|
+
status?: "current" | "completed" | "upcoming" | null | undefined;
|
|
14
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
|
+
type StepProps = React$1.ComponentProps<"li"> & VariantProps<typeof stepVariants>;
|
|
16
|
+
declare const Step: ({ className, status, ...props }: StepProps) => React$1.JSX.Element;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Step, Steps };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
//#region src/components/steps.tsx
|
|
5
|
+
const stepsVariants = cva("list-decimal ps-6 marker:font-medium", {
|
|
6
|
+
variants: { variant: {
|
|
7
|
+
default: "space-y-4",
|
|
8
|
+
compact: "space-y-0.5",
|
|
9
|
+
progress: "grid grid-cols-4 gap-2"
|
|
10
|
+
} },
|
|
11
|
+
defaultVariants: { variant: "default" }
|
|
12
|
+
});
|
|
13
|
+
/** A meaningful procedure, timeline, or ranking. The list owns its numbers. */
|
|
14
|
+
const Steps = ({ className, variant, markerStyle, style, ...props }) => /* @__PURE__ */ jsx("ol", {
|
|
15
|
+
className: cn(stepsVariants({ variant }), className),
|
|
16
|
+
"data-slot": "steps",
|
|
17
|
+
style: {
|
|
18
|
+
...style,
|
|
19
|
+
listStyleType: markerStyle
|
|
20
|
+
},
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
const stepVariants = cva("ps-2", { variants: { status: {
|
|
24
|
+
current: "border-foreground border-t-2 pt-2 text-sm font-medium",
|
|
25
|
+
completed: "border-foreground border-t-2 pt-2 text-sm font-medium",
|
|
26
|
+
upcoming: "border-muted text-muted-foreground border-t-2 pt-2 text-sm"
|
|
27
|
+
} } });
|
|
28
|
+
const Step = ({ className, status, ...props }) => /* @__PURE__ */ jsx("li", {
|
|
29
|
+
className: cn(stepVariants({ status }), className),
|
|
30
|
+
"data-slot": "step",
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
33
|
+
//#endregion
|
|
34
|
+
export { Step, Steps };
|
|
@@ -3,6 +3,12 @@ import { Toast, ToastManagerAddOptions } from "@base-ui/react/toast";
|
|
|
3
3
|
//#region src/components/toast.d.ts
|
|
4
4
|
type ToastData = {
|
|
5
5
|
tooltipStyle?: boolean;
|
|
6
|
+
timeoutPolicy?: {
|
|
7
|
+
type: "automatic";
|
|
8
|
+
} | {
|
|
9
|
+
type: "explicit";
|
|
10
|
+
timeout: number;
|
|
11
|
+
};
|
|
6
12
|
};
|
|
7
13
|
declare const TOAST_RIGHT_OFFSET_VAR = "--stella-toast-right-offset";
|
|
8
14
|
declare const TOAST_ICONS: {
|
|
@@ -20,7 +26,7 @@ type ToastAction = {
|
|
|
20
26
|
};
|
|
21
27
|
type ToastActionProps = ToastManagerAddOptions<ToastData>["actionProps"];
|
|
22
28
|
type ToastOptions = Omit<ToastManagerAddOptions<ToastData>, "actionProps" | "title" | "type"> & {
|
|
23
|
-
action?: ToastAction;
|
|
29
|
+
action?: ToastAction | undefined;
|
|
24
30
|
actionProps?: ToastActionProps;
|
|
25
31
|
};
|
|
26
32
|
type ToastUpdateOptions = Partial<ToastOptions> & {
|
package/dist/components/toast.js
CHANGED
|
@@ -12,6 +12,7 @@ import { Toast } from "@base-ui/react/toast";
|
|
|
12
12
|
const toastManager = Toast.createToastManager();
|
|
13
13
|
const anchoredToastManager = Toast.createToastManager();
|
|
14
14
|
const TOAST_RIGHT_OFFSET_VAR = "--stella-toast-right-offset";
|
|
15
|
+
const ERROR_TOAST_TIMEOUT_MS = 8e3;
|
|
15
16
|
const TOAST_ICONS = {
|
|
16
17
|
error: /* @__PURE__ */ jsx(CircleAlertIcon, { className: "text-destructive" }),
|
|
17
18
|
info: /* @__PURE__ */ jsx(InfoIcon, { className: "text-info" }),
|
|
@@ -51,7 +52,7 @@ const stellaToast = Object.assign((title, options) => addToast(title, void 0, op
|
|
|
51
52
|
},
|
|
52
53
|
success: (title, options) => addToast(title, "success", options),
|
|
53
54
|
update: (id, options) => {
|
|
54
|
-
toastManager.update(id, normalizeToastUpdateOptions(options));
|
|
55
|
+
toastManager.update(id, (previous) => normalizeToastUpdateOptions(options, previous));
|
|
55
56
|
},
|
|
56
57
|
warning: (title, options) => addToast(title, "warning", options)
|
|
57
58
|
});
|
|
@@ -242,34 +243,51 @@ const subscribeWindowFocus = (onChange) => {
|
|
|
242
243
|
};
|
|
243
244
|
const readWindowFocus = () => document.hasFocus();
|
|
244
245
|
const readServerWindowFocus = () => true;
|
|
245
|
-
function normalizeToastAddOptions(
|
|
246
|
+
function normalizeToastAddOptions(options) {
|
|
247
|
+
const { action, actionProps, data, timeout, type, ...addOptions } = options;
|
|
246
248
|
return {
|
|
247
|
-
...
|
|
249
|
+
...addOptions,
|
|
248
250
|
...normalizeToastActionProps({
|
|
249
251
|
action,
|
|
250
252
|
actionProps
|
|
251
253
|
}),
|
|
252
|
-
|
|
254
|
+
data: {
|
|
255
|
+
...data,
|
|
256
|
+
timeoutPolicy: toastTimeoutPolicy(timeout)
|
|
257
|
+
},
|
|
258
|
+
timeout: normalizeToastTimeout(timeout ?? getDefaultToastTimeout(options)),
|
|
253
259
|
type
|
|
254
260
|
};
|
|
255
261
|
}
|
|
256
|
-
function normalizeToastUpdateOptions(options) {
|
|
257
|
-
const { action, actionProps, timeout, type, ...updateOptions } = options;
|
|
258
|
-
const
|
|
259
|
-
return {
|
|
262
|
+
function normalizeToastUpdateOptions(options, previous) {
|
|
263
|
+
const { action, actionProps, data, timeout, type, ...updateOptions } = options;
|
|
264
|
+
const update = {
|
|
260
265
|
...updateOptions,
|
|
261
266
|
...normalizeToastActionProps({
|
|
262
267
|
action,
|
|
263
268
|
actionProps,
|
|
264
269
|
includeEmptyActionProps: Object.hasOwn(options, "action") || Object.hasOwn(options, "actionProps")
|
|
265
270
|
}),
|
|
266
|
-
...type === void 0 ? {} : { type }
|
|
267
|
-
|
|
271
|
+
...type === void 0 ? {} : { type }
|
|
272
|
+
};
|
|
273
|
+
const timeoutPolicy = timeout === void 0 ? previous.data?.timeoutPolicy ?? toastTimeoutPolicy(void 0) : toastTimeoutPolicy(timeout);
|
|
274
|
+
return {
|
|
275
|
+
...update,
|
|
276
|
+
data: {
|
|
277
|
+
...Object.hasOwn(options, "data") ? data : previous.data,
|
|
278
|
+
timeoutPolicy
|
|
279
|
+
},
|
|
280
|
+
timeout: timeoutPolicy.type === "explicit" ? timeoutPolicy.timeout : getDefaultToastTimeout({
|
|
281
|
+
...previous,
|
|
282
|
+
...update
|
|
283
|
+
})
|
|
268
284
|
};
|
|
269
285
|
}
|
|
270
|
-
function
|
|
271
|
-
|
|
272
|
-
|
|
286
|
+
function toastTimeoutPolicy(timeout) {
|
|
287
|
+
return timeout === void 0 ? { type: "automatic" } : {
|
|
288
|
+
type: "explicit",
|
|
289
|
+
timeout: normalizeToastTimeout(timeout)
|
|
290
|
+
};
|
|
273
291
|
}
|
|
274
292
|
function normalizeToastActionProps({ action, actionProps, includeEmptyActionProps = false }) {
|
|
275
293
|
if (action === void 0) return actionProps === void 0 && !includeEmptyActionProps ? {} : { actionProps };
|
|
@@ -279,8 +297,14 @@ function normalizeToastActionProps({ action, actionProps, includeEmptyActionProp
|
|
|
279
297
|
onClick: action.onClick
|
|
280
298
|
} };
|
|
281
299
|
}
|
|
282
|
-
|
|
283
|
-
|
|
300
|
+
/**
|
|
301
|
+
* A short plain error closes on its own like any notice. An error that carries
|
|
302
|
+
* detail (a description, rich content such as a provider reason to copy) or an
|
|
303
|
+
* action stays until dismissed, so it is never gone before it can be read.
|
|
304
|
+
*/
|
|
305
|
+
function getDefaultToastTimeout({ action, actionProps, description, title, type }) {
|
|
306
|
+
if (type === "loading") return 0;
|
|
307
|
+
if (type === "error") return typeof title === "string" && (description === void 0 || description === null) && action === void 0 && actionProps === void 0 ? ERROR_TOAST_TIMEOUT_MS : 0;
|
|
284
308
|
if (type === "warning") return 6e3;
|
|
285
309
|
return 4e3;
|
|
286
310
|
}
|
|
@@ -5,6 +5,6 @@ declare const CONTROL_SIZE: Readonly<{
|
|
|
5
5
|
readonly lg: "lg";
|
|
6
6
|
}>;
|
|
7
7
|
type ControlSize = (typeof CONTROL_SIZE)[keyof typeof CONTROL_SIZE];
|
|
8
|
-
declare const CONTROL_SIZES: readonly ("default" | "
|
|
8
|
+
declare const CONTROL_SIZES: readonly ("default" | "sm" | "lg")[];
|
|
9
9
|
//#endregion
|
|
10
10
|
export { CONTROL_SIZE, CONTROL_SIZES, type ControlSize };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties } from "react";
|
|
2
2
|
//#region src/lib/matter-colors.d.ts
|
|
3
3
|
export declare const MATTER_SWATCHES: readonly ["--option-blue", "--option-emerald", "--option-amber", "--option-violet", "--option-red", "--option-cyan", "--option-orange", "--option-teal"];
|
|
4
|
-
export declare const getMatterSwatch: (id: string) => "--option-
|
|
4
|
+
export declare const getMatterSwatch: (id: string) => "--option-blue" | "--option-emerald" | "--option-amber" | "--option-violet" | "--option-red" | "--option-cyan" | "--option-orange" | "--option-teal";
|
|
5
5
|
export declare const getMatterColor: (id: string) => string;
|
|
6
6
|
export declare const getMatterPickerColor: (id: string, color: string | null) => string;
|
|
7
7
|
export declare const toStoredMatterColor: (color: string) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.1",
|
|
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",
|
|
@@ -269,6 +269,10 @@
|
|
|
269
269
|
"types": "./dist/components/popover.d.ts",
|
|
270
270
|
"import": "./dist/components/popover.js"
|
|
271
271
|
},
|
|
272
|
+
"./steps": {
|
|
273
|
+
"types": "./dist/components/steps.d.ts",
|
|
274
|
+
"import": "./dist/components/steps.js"
|
|
275
|
+
},
|
|
272
276
|
"./positioner-sizing": {
|
|
273
277
|
"types": "./dist/lib/positioner-sizing.d.ts",
|
|
274
278
|
"import": "./dist/lib/positioner-sizing.js"
|
|
@@ -748,11 +752,11 @@
|
|
|
748
752
|
"@atlaskit/pragmatic-drag-and-drop": "^4.0.0",
|
|
749
753
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.2.1",
|
|
750
754
|
"@base-ui/react": "1.8.0",
|
|
751
|
-
"@happy-dom/global-registrator": "21.0.
|
|
755
|
+
"@happy-dom/global-registrator": "21.0.4",
|
|
752
756
|
"@playwright/test": "^1.63.0",
|
|
753
757
|
"@stll/typescript-config": "0.0.0",
|
|
754
758
|
"@tailwindcss/vite": "4.3.3",
|
|
755
|
-
"@tanstack/react-virtual": "^3.14.
|
|
759
|
+
"@tanstack/react-virtual": "^3.14.21",
|
|
756
760
|
"@testing-library/dom": "10.4.2",
|
|
757
761
|
"@testing-library/react": "16.3.3",
|
|
758
762
|
"@types/react": "^19.3.0",
|