@bysages/react 0.4.2 → 0.4.4

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.
Files changed (71) hide show
  1. package/dist/{ai-response-nhDOlELQ.mjs → ai-response-CjjjprMY.mjs} +10 -3
  2. package/dist/{chevron-a2nIZKN4.mjs → chevron-BA7kV9m7.mjs} +1 -1
  3. package/dist/components/accordion/index.mjs +1 -1
  4. package/dist/components/ai/index.mjs +1 -1
  5. package/dist/components/ai-attachments/index.mjs +1 -1
  6. package/dist/components/ai-prompt-input/index.mjs +1 -1
  7. package/dist/components/ai-reasoning/index.mjs +1 -1
  8. package/dist/components/ai-response/index.mjs +1 -1
  9. package/dist/components/ai-tool/index.mjs +1 -1
  10. package/dist/components/alert/index.mjs +1 -1
  11. package/dist/components/avatar/index.d.mts +12 -2
  12. package/dist/components/avatar/index.mjs +18 -3
  13. package/dist/components/back-top/index.mjs +1 -1
  14. package/dist/components/banner/index.d.mts +16 -2
  15. package/dist/components/banner/index.mjs +19 -3
  16. package/dist/components/breadcrumb/index.d.mts +15 -1
  17. package/dist/components/breadcrumb/index.mjs +20 -2
  18. package/dist/components/calendar/index.mjs +1 -1
  19. package/dist/components/carousel/index.mjs +1 -1
  20. package/dist/components/cascade-select/index.mjs +1 -1
  21. package/dist/components/checkbox/index.mjs +1 -1
  22. package/dist/components/checkbox-group/index.mjs +1 -1
  23. package/dist/components/clipboard/index.mjs +1 -1
  24. package/dist/components/collapsible/index.mjs +1 -1
  25. package/dist/components/color-picker/index.d.mts +2 -0
  26. package/dist/components/color-picker/index.mjs +36 -22
  27. package/dist/components/combobox/index.mjs +1 -1
  28. package/dist/components/date-picker/index.mjs +1 -1
  29. package/dist/components/dialog/index.mjs +1 -1
  30. package/dist/components/drawer/index.mjs +1 -1
  31. package/dist/components/dynamic-input/index.mjs +1 -1
  32. package/dist/components/editable/index.mjs +1 -1
  33. package/dist/components/file-upload/index.mjs +2 -6
  34. package/dist/components/float-button/index.d.mts +22 -1
  35. package/dist/components/float-button/index.mjs +28 -2
  36. package/dist/components/floating-panel/index.mjs +6 -1
  37. package/dist/components/image/index.mjs +1 -1
  38. package/dist/components/image-viewer/index.mjs +1 -1
  39. package/dist/components/json-tree-view/index.mjs +1 -1
  40. package/dist/components/listbox/index.mjs +1 -1
  41. package/dist/components/media-player/index.mjs +1 -1
  42. package/dist/components/menu/index.mjs +1 -1
  43. package/dist/components/number-input/index.mjs +1 -1
  44. package/dist/components/order-list/index.mjs +1 -1
  45. package/dist/components/pagination/index.mjs +1 -1
  46. package/dist/components/password-input/index.mjs +1 -1
  47. package/dist/components/popover/index.mjs +1 -1
  48. package/dist/components/rating-group/index.mjs +1 -1
  49. package/dist/components/result/index.mjs +2 -1
  50. package/dist/components/select/index.mjs +1 -1
  51. package/dist/components/signature-pad/index.mjs +1 -1
  52. package/dist/components/split-button/index.mjs +1 -1
  53. package/dist/components/swap/index.mjs +1 -1
  54. package/dist/components/table/index.mjs +2 -2
  55. package/dist/components/tag/index.mjs +14 -8
  56. package/dist/components/tags-input/index.mjs +1 -1
  57. package/dist/components/toast/index.mjs +15 -2
  58. package/dist/components/toggle-group/index.mjs +1 -1
  59. package/dist/components/transfer/index.mjs +1 -1
  60. package/dist/components/tree-select/index.mjs +1 -1
  61. package/dist/components/tree-view/index.mjs +1 -1
  62. package/dist/generative/index.d.mts +53 -0
  63. package/dist/generative/index.mjs +735 -0
  64. package/dist/icon-Cri0-7-x.mjs +38 -0
  65. package/dist/{image-viewer-B-hKFkEw.mjs → image-viewer-D4FuYrk6.mjs} +1 -1
  66. package/dist/index.d.mts +5 -5
  67. package/dist/index.mjs +4 -4
  68. package/dist/{media-player-DjVvo1_7.mjs → media-player-C0WcjVI-.mjs} +2 -2
  69. package/dist/{select-i9UZsQCU.mjs → select-D_soVdWK.mjs} +1 -1
  70. package/package.json +2 -2
  71. package/dist/icon-BALgGtNK.mjs +0 -18
@@ -1,3 +1,4 @@
1
+ import { n as iconHtml } from "./icon-Cri0-7-x.mjs";
1
2
  import { t as withSelfRoot } from "./family-DE_GQeeM.mjs";
2
3
  import { n as useComponentMessages } from "./messages-1jJWtaYU.mjs";
3
4
  import { injectComponentStyle } from "@bysages/core/styling";
@@ -5,11 +6,17 @@ import { jsx } from "react/jsx-runtime";
5
6
  import { useEffect, useRef } from "react";
6
7
  import { renderHtml } from "@tanstack/markdown/html";
7
8
  //#region src/components/ai-response/code-copy.ts
8
- /** The two glyphs a copy affordance needs: the stamp and its
9
+ /** The two curated icons a copy affordance needs: the stamp and its
9
10
  * confirmation. Inline SVG keeps the enhancement framework-agnostic —
10
11
  * it lives beside the renderer's generated code HTML. */
11
- const COPY_CODE_ICON = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>`;
12
- const COPIED_CODE_ICON = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>`;
12
+ const COPY_CODE_ICON = iconHtml("copy", {
13
+ width: "14",
14
+ height: "14"
15
+ });
16
+ const COPIED_CODE_ICON = iconHtml("check", {
17
+ width: "14",
18
+ height: "14"
19
+ });
13
20
  /** How long the confirmation stays before the stamp returns. */
14
21
  const REVERT_MS = 1500;
15
22
  /** Make sure every fenced block under `host` carries its copy stamp.
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "./icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "./icon-Cri0-7-x.mjs";
2
2
  //#region src/components/ai/chevron.tsx
3
3
  /** The folding chevron the shared indicator turns. */
4
4
  const chevron = iconNode("chevron-right");
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
3
3
  import { Accordion as Accordion$1 } from "@ark-ui/react/accordion";
4
4
  import { injectComponentStyle } from "@bysages/core/styling";
@@ -4,7 +4,7 @@ import { Action } from "../ai-action/index.mjs";
4
4
  import { AiMessage as Message } from "../ai-message/index.mjs";
5
5
  import { AiPromptInput as PromptInput } from "../ai-prompt-input/index.mjs";
6
6
  import { AiReasoning as Reasoning } from "../ai-reasoning/index.mjs";
7
- import { t as Response } from "../../ai-response-nhDOlELQ.mjs";
7
+ import { t as Response } from "../../ai-response-CjjjprMY.mjs";
8
8
  import { AiSource as Source, AiSources as Sources } from "../ai-source/index.mjs";
9
9
  import { AiSuggestion as Suggestion } from "../ai-suggestion/index.mjs";
10
10
  import { AiTool as Tool } from "../ai-tool/index.mjs";
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
3
3
  import { n as useComponentMessages, t as formatMessage } from "../../messages-1jJWtaYU.mjs";
4
4
  import { injectComponentStyle } from "@bysages/core/styling";
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
3
3
  import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
4
4
  import { Button } from "../button/index.mjs";
@@ -1,5 +1,5 @@
1
1
  import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
2
- import { t as chevron } from "../../chevron-a2nIZKN4.mjs";
2
+ import { t as chevron } from "../../chevron-BA7kV9m7.mjs";
3
3
  import { Collapsible } from "../collapsible/index.mjs";
4
4
  import { injectComponentStyle } from "@bysages/core/styling";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,2 +1,2 @@
1
- import { t as Response } from "../../ai-response-nhDOlELQ.mjs";
1
+ import { t as Response } from "../../ai-response-CjjjprMY.mjs";
2
2
  export { Response as AiResponse, Response };
@@ -1,5 +1,5 @@
1
1
  import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
2
- import { t as chevron } from "../../chevron-a2nIZKN4.mjs";
2
+ import { t as chevron } from "../../chevron-BA7kV9m7.mjs";
3
3
  import { Collapsible } from "../collapsible/index.mjs";
4
4
  import { injectComponentStyle } from "@bysages/core/styling";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { injectComponentStyle } from "@bysages/core/styling";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { createContext, useContext } from "react";
@@ -9,7 +9,7 @@ import { Avatar as Avatar$1 } from "@ark-ui/react/avatar";
9
9
  export type AvatarSize = "sm" | "md" | "lg";
10
10
  export interface AvatarProps extends ComponentProps<typeof Avatar$1.Root> {
11
11
  /** Seal diameter: the small, medium, or large control rung. The
12
- * default (large) stands as tall as the biggest control so an avatar
12
+ * default (medium) stands as tall as the biggest control so an avatar
13
13
  * rides a row without stretching it. */
14
14
  size?: AvatarSize;
15
15
  /** The corner: round by default; square cuts it sharp, a stamp
@@ -17,7 +17,17 @@ export interface AvatarProps extends ComponentProps<typeof Avatar$1.Root> {
17
17
  shape?: "circle" | "square";
18
18
  }
19
19
  declare function AvatarRoot(props: AvatarProps): import("react").JSX.Element;
20
- export declare const Avatar: typeof AvatarRoot & typeof Avatar$1 & {
20
+ export interface AvatarFacadeProps extends AvatarProps {
21
+ /** The person's name; its first two initials wait beneath an image. */
22
+ name?: string;
23
+ /** The portrait to load over the name's initials. */
24
+ src?: string;
25
+ }
26
+ declare function AvatarFacade({ name, src, size, shape, children, ...rest }: AvatarFacadeProps): import("react").JSX.Element;
27
+ declare namespace AvatarFacade {
28
+ var displayName: string;
29
+ }
30
+ export declare const Avatar: typeof AvatarFacade & typeof Avatar$1 & {
21
31
  Root: typeof AvatarRoot;
22
32
  };
23
33
  //#endregion
@@ -1,11 +1,14 @@
1
1
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
2
2
  import { injectComponentStyle } from "@bysages/core/styling";
3
- import { jsx } from "react/jsx-runtime";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
4
  import { Avatar as Avatar$1 } from "@ark-ui/react/avatar";
5
5
  //#region src/components/avatar/index.tsx
6
+ function initials(name) {
7
+ return name?.trim().split(/\s+/).filter(Boolean).slice(0, 2).map((part) => part[0]?.toUpperCase() ?? "").join("") ?? "";
8
+ }
6
9
  function AvatarRoot(props) {
7
10
  const id = useElementId("avatar", props);
8
- const { size, shape = "circle", ...rest } = props;
11
+ const { size = "md", shape = "circle", ...rest } = props;
9
12
  return /* @__PURE__ */ jsx(Avatar$1.Root, {
10
13
  ...rest,
11
14
  id,
@@ -13,7 +16,19 @@ function AvatarRoot(props) {
13
16
  "data-shape": shape
14
17
  });
15
18
  }
16
- const Avatar = Object.assign(AvatarRoot, {
19
+ function AvatarFacade({ name, src, size = "md", shape, children, ...rest }) {
20
+ return /* @__PURE__ */ jsx(AvatarRoot, {
21
+ size,
22
+ shape,
23
+ ...rest,
24
+ children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [src ? /* @__PURE__ */ jsx(Avatar$1.Image, {
25
+ src,
26
+ alt: name
27
+ }) : null, name ? /* @__PURE__ */ jsx(Avatar$1.Fallback, { children: initials(name) }) : null] })
28
+ });
29
+ }
30
+ AvatarFacade.displayName = "SAvatar";
31
+ const Avatar = Object.assign(AvatarFacade, {
17
32
  ...Avatar$1,
18
33
  Root: AvatarRoot
19
34
  });
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
3
3
  import { Button } from "../button/index.mjs";
4
4
  import { injectComponentStyle } from "@bysages/core/styling";
@@ -1,10 +1,24 @@
1
- import { ButtonHTMLAttributes, HTMLAttributes } from "react";
1
+ import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from "react";
2
2
  //#region src/components/banner/index.d.ts
3
3
  export type BannerStatus = "ink" | "info" | "success" | "warning" | "danger";
4
4
  export interface BannerRootProps extends HTMLAttributes<HTMLElement> {
5
5
  status?: BannerStatus;
6
6
  }
7
- export declare const Banner: (({ status, children, ...rest }: BannerRootProps) => import("react").JSX.Element) & {
7
+ export interface BannerFacadeProps extends Omit<BannerRootProps, "title"> {
8
+ /** The glance line, set in the serif. */
9
+ title?: string;
10
+ /** The supporting line beneath the title. */
11
+ message?: string;
12
+ /** Adds the close control and lets the facade own dismissal. */
13
+ dismissible?: boolean;
14
+ /** The reader's answers, laid beside the notice's prose. */
15
+ actions?: ReactNode;
16
+ }
17
+ declare function BannerFacade({ status, title, message, dismissible, actions, children, ...rest }: BannerFacadeProps): import("react").JSX.Element | null;
18
+ declare namespace BannerFacade {
19
+ var displayName: string;
20
+ }
21
+ export declare const Banner: typeof BannerFacade & {
8
22
  Root: ({ status, children, ...rest }: BannerRootProps) => import("react").JSX.Element;
9
23
  Icon: {
10
24
  ({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
@@ -1,7 +1,8 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
3
3
  import { injectComponentStyle } from "@bysages/core/styling";
4
- import { jsx } from "react/jsx-runtime";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { useState } from "react";
5
6
  //#region src/components/banner/index.tsx
6
7
  /** A page-level notice, spoken across the full measure: a wash of the
7
8
  * status pigment, one heavier hairline on the leading edge, and room
@@ -44,7 +45,22 @@ const Close = (rest) => {
44
45
  children: iconNode("x")
45
46
  });
46
47
  };
47
- const Banner = Object.assign(Root, {
48
+ function BannerFacade({ status = "ink", title, message, dismissible = false, actions, children, ...rest }) {
49
+ const [open, setOpen] = useState(true);
50
+ if (!open) return null;
51
+ return /* @__PURE__ */ jsxs(Root, {
52
+ status,
53
+ ...rest,
54
+ children: [/* @__PURE__ */ jsxs(Body, { children: [
55
+ title ? /* @__PURE__ */ jsx(Title, { children: title }) : null,
56
+ message ? /* @__PURE__ */ jsx(Description, { children: message }) : null,
57
+ children,
58
+ actions ? /* @__PURE__ */ jsx(Actions, { children: actions }) : null
59
+ ] }), dismissible ? /* @__PURE__ */ jsx(Close, { onClick: () => setOpen(false) }) : null]
60
+ });
61
+ }
62
+ BannerFacade.displayName = "SBanner";
63
+ const Banner = Object.assign(BannerFacade, {
48
64
  Root,
49
65
  Icon,
50
66
  Body,
@@ -1,7 +1,21 @@
1
1
  import { AnchorHTMLAttributes, HTMLAttributes } from "react";
2
2
  //#region src/components/breadcrumb/index.d.ts
3
3
  declare function Root({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
4
- export declare const Breadcrumb: typeof Root & {
4
+ export type BreadcrumbItem = string | {
5
+ label: string;
6
+ href?: string;
7
+ };
8
+ export interface BreadcrumbFacadeProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
9
+ /** The trail, ordered from its origin to the current page. */
10
+ items: BreadcrumbItem[];
11
+ /** Replaces the shared accessible name for the trail. */
12
+ label?: string;
13
+ }
14
+ declare function BreadcrumbFacade({ items, label, className, ...rest }: BreadcrumbFacadeProps): import("react").JSX.Element;
15
+ declare namespace BreadcrumbFacade {
16
+ var displayName: string;
17
+ }
18
+ export declare const Breadcrumb: typeof BreadcrumbFacade & {
5
19
  Root: typeof Root;
6
20
  List: {
7
21
  ({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
2
2
  import { injectComponentStyle } from "@bysages/core/styling";
3
- import { jsx } from "react/jsx-runtime";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { Fragment as Fragment$1 } from "react";
4
5
  //#region src/components/breadcrumb/index.tsx
5
6
  /** A trail of waymarks: Root wraps the nav, List the ordered trail, and
6
7
  * each Item carries a Link — or the Current page — parted by a quiet
@@ -32,7 +33,24 @@ const Item = part("Item", "li");
32
33
  const Link = part("Link", "a");
33
34
  const Current = part("Current", "span", { "aria-current": "page" });
34
35
  const Separator = part("Separator", "span", { "aria-hidden": "true" }, "/");
35
- const Breadcrumb = Object.assign(Root, {
36
+ function BreadcrumbFacade({ items, label, className, ...rest }) {
37
+ const last = items.length - 1;
38
+ return /* @__PURE__ */ jsx(Root, {
39
+ className,
40
+ ...rest,
41
+ "aria-label": rest["aria-label"] ?? label,
42
+ children: /* @__PURE__ */ jsx(List, { children: items.map((item, index) => {
43
+ const text = typeof item === "string" ? item : item.label;
44
+ const href = typeof item === "string" ? void 0 : item.href;
45
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Item, { children: index === last ? /* @__PURE__ */ jsx(Current, { children: text }) : /* @__PURE__ */ jsx(Link, {
46
+ href,
47
+ children: text
48
+ }) }), index < last ? /* @__PURE__ */ jsx(Separator, {}) : null] }, `${text}-${index}`);
49
+ }) })
50
+ });
51
+ }
52
+ BreadcrumbFacade.displayName = "SBreadcrumb";
53
+ const Breadcrumb = Object.assign(BreadcrumbFacade, {
36
54
  Root,
37
55
  List,
38
56
  Item,
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
3
3
  import { DatePicker as DatePicker$1 } from "../date-picker/index.mjs";
4
4
  import { injectComponentStyle } from "@bysages/core/styling";
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
3
3
  import { injectComponentStyle } from "@bysages/core/styling";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
3
3
  import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
4
4
  import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
3
3
  import { injectComponentStyle } from "@bysages/core/styling";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
3
3
  import { Checkbox as Checkbox$1 } from "../checkbox/index.mjs";
4
4
  import { injectComponentStyle } from "@bysages/core/styling";
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
3
3
  import { injectComponentStyle } from "@bysages/core/styling";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
3
3
  import { injectComponentStyle } from "@bysages/core/styling";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -21,6 +21,8 @@ type ColorPickerFacadeProps = {
21
21
  invalid?: boolean;
22
22
  required?: boolean;
23
23
  label?: string;
24
+ /** Saved colors rendered as a flat swatch row. */
25
+ swatches?: string[];
24
26
  size?: "sm" | "md" | "lg";
25
27
  className?: string;
26
28
  style?: CSSProperties;
@@ -1,9 +1,13 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
3
3
  import { injectComponentStyle } from "@bysages/core/styling";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { ColorPicker as ColorPicker$1, parseColor } from "@ark-ui/react/color-picker";
6
6
  //#region src/components/color-picker/index.tsx
7
+ const checkIcon = iconNode("check", {
8
+ width: 12,
9
+ height: 12
10
+ });
7
11
  function ColorPickerRoot(props) {
8
12
  injectComponentStyle("color-picker");
9
13
  const id = useElementId("color-picker", props);
@@ -18,7 +22,7 @@ function ColorPickerRoot(props) {
18
22
  * swatch trigger, while the popup carries the area and hue/alpha tracks.
19
23
  * Saved swatches and format switches remain anatomy work. */
20
24
  function ColorPickerFacade(props) {
21
- const { value, defaultValue, disabled, invalid, required, label, size = "md", className, style, onValueChange } = props;
25
+ const { value, defaultValue, disabled, invalid, required, label, swatches = [], size = "md", className, style, onValueChange } = props;
22
26
  const toColor = (color) => typeof color === "string" ? parseColor(color) : color;
23
27
  return /* @__PURE__ */ jsxs(ColorPickerRoot, {
24
28
  size,
@@ -33,28 +37,38 @@ function ColorPickerFacade(props) {
33
37
  children: [
34
38
  label ? /* @__PURE__ */ jsx(ColorPicker$1.Label, { children: label }) : null,
35
39
  /* @__PURE__ */ jsxs(ColorPicker$1.Control, { children: [/* @__PURE__ */ jsx(ColorPicker$1.ChannelInput, { channel: "hex" }), /* @__PURE__ */ jsxs(ColorPicker$1.Trigger, { children: [/* @__PURE__ */ jsx(ColorPicker$1.TransparencyGrid, {}), /* @__PURE__ */ jsx(ColorPicker$1.ValueSwatch, {})] })] }),
36
- /* @__PURE__ */ jsx(ColorPicker$1.Positioner, { children: /* @__PURE__ */ jsxs(ColorPicker$1.Content, { children: [/* @__PURE__ */ jsxs(ColorPicker$1.Area, { children: [/* @__PURE__ */ jsx(ColorPicker$1.AreaBackground, {}), /* @__PURE__ */ jsx(ColorPicker$1.AreaThumb, {})] }), /* @__PURE__ */ jsxs("div", {
37
- "data-scope": "color-picker",
38
- "data-part": "channel-controls",
39
- children: [/* @__PURE__ */ jsx(ColorPicker$1.EyeDropperTrigger, { children: iconNode("pipette", {
40
- width: 14,
41
- height: 14
42
- }) }), /* @__PURE__ */ jsxs("div", {
40
+ /* @__PURE__ */ jsx(ColorPicker$1.Positioner, { children: /* @__PURE__ */ jsxs(ColorPicker$1.Content, { children: [
41
+ /* @__PURE__ */ jsxs(ColorPicker$1.Area, { children: [/* @__PURE__ */ jsx(ColorPicker$1.AreaBackground, {}), /* @__PURE__ */ jsx(ColorPicker$1.AreaThumb, {})] }),
42
+ /* @__PURE__ */ jsxs("div", {
43
43
  "data-scope": "color-picker",
44
- "data-part": "channel-sliders",
45
- children: [/* @__PURE__ */ jsxs(ColorPicker$1.ChannelSlider, {
46
- channel: "hue",
47
- children: [/* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderTrack, {}), /* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderThumb, {})]
48
- }), /* @__PURE__ */ jsxs(ColorPicker$1.ChannelSlider, {
49
- channel: "alpha",
50
- children: [
51
- /* @__PURE__ */ jsx(ColorPicker$1.TransparencyGrid, {}),
52
- /* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderTrack, {}),
53
- /* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderThumb, {})
54
- ]
44
+ "data-part": "channel-controls",
45
+ children: [/* @__PURE__ */ jsx(ColorPicker$1.EyeDropperTrigger, { children: iconNode("pipette", {
46
+ width: 14,
47
+ height: 14
48
+ }) }), /* @__PURE__ */ jsxs("div", {
49
+ "data-scope": "color-picker",
50
+ "data-part": "channel-sliders",
51
+ children: [/* @__PURE__ */ jsxs(ColorPicker$1.ChannelSlider, {
52
+ channel: "hue",
53
+ children: [/* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderTrack, {}), /* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderThumb, {})]
54
+ }), /* @__PURE__ */ jsxs(ColorPicker$1.ChannelSlider, {
55
+ channel: "alpha",
56
+ children: [
57
+ /* @__PURE__ */ jsx(ColorPicker$1.TransparencyGrid, {}),
58
+ /* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderTrack, {}),
59
+ /* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderThumb, {})
60
+ ]
61
+ })]
55
62
  })]
56
- })]
57
- })] }) }),
63
+ }),
64
+ swatches.length > 0 ? /* @__PURE__ */ jsx(ColorPicker$1.SwatchGroup, { children: swatches.map((color) => /* @__PURE__ */ jsx(ColorPicker$1.SwatchTrigger, {
65
+ value: color,
66
+ children: /* @__PURE__ */ jsx(ColorPicker$1.Swatch, {
67
+ value: color,
68
+ children: /* @__PURE__ */ jsx(ColorPicker$1.SwatchIndicator, { children: checkIcon })
69
+ })
70
+ }, color)) }) : null
71
+ ] }) }),
58
72
  /* @__PURE__ */ jsx(ColorPicker$1.HiddenInput, {})
59
73
  ]
60
74
  });
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
3
3
  import { injectComponentStyle } from "@bysages/core/styling";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
3
3
  import { injectComponentStyle } from "@bysages/core/styling";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
3
3
  import { injectComponentStyle } from "@bysages/core/styling";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
3
3
  import { injectComponentStyle } from "@bysages/core/styling";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
3
3
  import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
4
4
  import { Button } from "../button/index.mjs";
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
3
3
  import { injectComponentStyle } from "@bysages/core/styling";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
3
3
  import { injectComponentStyle } from "@bysages/core/styling";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -35,10 +35,6 @@ const fileIcon = iconNode("file", {
35
35
  width: 16,
36
36
  height: 16
37
37
  });
38
- const uploadIcon = iconNode("upload", {
39
- width: 28,
40
- height: 28
41
- });
42
38
  const closeIcon = iconNode("x", {
43
39
  width: 14,
44
40
  height: 14
@@ -54,7 +50,7 @@ function FileUploadFacade({ label, placeholder, disabled = false, invalid = fals
54
50
  maxFiles,
55
51
  children: [
56
52
  label ? /* @__PURE__ */ jsx(FileUpload$1.Label, { children: label }) : null,
57
- /* @__PURE__ */ jsx(FileUpload$1.Dropzone, { children: /* @__PURE__ */ jsxs(FileUploadTrigger, { children: [uploadIcon, placeholder ?? "Choose files"] }) }),
53
+ /* @__PURE__ */ jsx(FileUpload$1.Dropzone, { children: /* @__PURE__ */ jsx(FileUploadTrigger, { children: placeholder ?? "Choose files" }) }),
58
54
  /* @__PURE__ */ jsx(FileUpload$1.ItemGroup, { children: /* @__PURE__ */ jsx(FileUpload$1.Context, { children: (api) => api.acceptedFiles.map((file) => /* @__PURE__ */ jsxs(FileUpload$1.Item, {
59
55
  file,
60
56
  children: [
@@ -51,7 +51,28 @@ interface FloatButtonItemProps {
51
51
  children?: ReactNode;
52
52
  }
53
53
  declare function Item({ label, disabled, onClick, children }: FloatButtonItemProps): import("react").JSX.Element;
54
- export declare const FloatButton: typeof Root & {
54
+ export interface FloatButtonAction {
55
+ /** The action's accessible name and its surfaced annotation. */
56
+ label: string;
57
+ /** A curated core icon; pencil is the fallback mark. */
58
+ icon?: string;
59
+ disabled?: boolean;
60
+ /** The action fires before the fan folds. */
61
+ onClick?: () => void;
62
+ }
63
+ export interface FloatButtonFacadeProps extends FloatButtonRootProps {
64
+ /** The trigger's accessible name. */
65
+ label?: string;
66
+ /** The fanned actions behind the trigger. */
67
+ actions?: FloatButtonAction[];
68
+ /** Starts the speed dial open before the reader touches it. */
69
+ defaultOpen?: boolean;
70
+ }
71
+ declare function FloatButtonFacade({ label, actions, placement, size, defaultOpen, children, open: openProp, onOpenChange, ...rest }: FloatButtonFacadeProps): import("react").JSX.Element;
72
+ declare namespace FloatButtonFacade {
73
+ var displayName: string;
74
+ }
75
+ export declare const FloatButton: typeof FloatButtonFacade & {
55
76
  Root: typeof Root;
56
77
  Trigger: typeof Trigger;
57
78
  Item: typeof Item;
@@ -1,7 +1,8 @@
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
1
2
  import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
2
3
  import { Button } from "../button/index.mjs";
3
4
  import { injectComponentStyle } from "@bysages/core/styling";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
6
  import { createContext, useContext, useState } from "react";
6
7
  //#region src/components/float-button/index.tsx
7
8
  /** Context for {@link FloatButtonContextValue}, exported so a custom
@@ -82,7 +83,32 @@ function Item({ label, disabled = false, onClick, children }) {
82
83
  })]
83
84
  });
84
85
  }
85
- const FloatButton = Object.assign(Root, {
86
+ function FloatButtonFacade({ label, actions = [], placement, size, defaultOpen = false, children, open: openProp, onOpenChange, ...rest }) {
87
+ const [innerOpen, setInnerOpen] = useState(defaultOpen);
88
+ const open = openProp ?? innerOpen;
89
+ const setOpen = (value) => {
90
+ setInnerOpen(value);
91
+ onOpenChange?.(value);
92
+ };
93
+ return /* @__PURE__ */ jsx(Root, {
94
+ open,
95
+ onOpenChange: setOpen,
96
+ placement,
97
+ size,
98
+ ...rest,
99
+ children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Trigger, {
100
+ label,
101
+ children: iconNode("plus")
102
+ }), actions.map((action) => /* @__PURE__ */ jsx(Item, {
103
+ label: action.label,
104
+ disabled: action.disabled,
105
+ onClick: action.onClick,
106
+ children: iconNode(action.icon ?? "pencil")
107
+ }, action.label))] })
108
+ });
109
+ }
110
+ FloatButtonFacade.displayName = "SFloatButton";
111
+ const FloatButton = Object.assign(FloatButtonFacade, {
86
112
  Root,
87
113
  Trigger,
88
114
  Item
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
3
3
  import { injectComponentStyle } from "@bysages/core/styling";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -42,6 +42,11 @@ function FloatingPanelFacade({ open, defaultOpen, trigger, content, label, descr
42
42
  stage: "maximized",
43
43
  children: iconNode("maximize-2")
44
44
  }),
45
+ /* @__PURE__ */ jsx(FloatingPanel$1.StageTrigger, {
46
+ stage: "default",
47
+ "aria-label": "Restore",
48
+ children: iconNode("minimize-2")
49
+ }),
45
50
  /* @__PURE__ */ jsx(FloatingPanel$1.CloseTrigger, {
46
51
  "aria-label": "Close",
47
52
  children: iconNode("x")
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
3
3
  import { injectComponentStyle } from "@bysages/core/styling";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
1
  import "../button-group/index.mjs";
2
2
  import "../dialog/index.mjs";
3
- import { t as ImageViewer } from "../../image-viewer-B-hKFkEw.mjs";
3
+ import { t as ImageViewer } from "../../image-viewer-D4FuYrk6.mjs";
4
4
  export { ImageViewer };
@@ -1,4 +1,4 @@
1
- import { t as iconNode } from "../../icon-BALgGtNK.mjs";
1
+ import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
2
2
  import { t as useElementId } from "../../id-C37UYLwJ.mjs";
3
3
  import { injectComponentStyle } from "@bysages/core/styling";
4
4
  import { jsx } from "react/jsx-runtime";