@bysages/react 0.4.1 → 0.4.3
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/{ai-response-nhDOlELQ.mjs → ai-response-CjjjprMY.mjs} +10 -3
- package/dist/{chevron-a2nIZKN4.mjs → chevron-BA7kV9m7.mjs} +1 -1
- package/dist/components/accordion/index.mjs +1 -1
- package/dist/components/ai/index.mjs +1 -1
- package/dist/components/ai-attachments/index.mjs +1 -1
- package/dist/components/ai-prompt-input/index.mjs +3 -12
- package/dist/components/ai-reasoning/index.mjs +1 -1
- package/dist/components/ai-response/index.mjs +1 -1
- package/dist/components/ai-tool/index.mjs +1 -1
- package/dist/components/alert/index.mjs +1 -1
- package/dist/components/back-top/index.mjs +1 -1
- package/dist/components/banner/index.mjs +1 -1
- package/dist/components/calendar/index.d.mts +18 -7
- package/dist/components/calendar/index.mjs +79 -43
- package/dist/components/carousel/index.mjs +1 -1
- package/dist/components/cascade-select/index.mjs +1 -1
- package/dist/components/checkbox/index.mjs +1 -1
- package/dist/components/checkbox-group/index.mjs +1 -1
- package/dist/components/chip/index.d.mts +1 -1
- package/dist/components/clipboard/index.mjs +1 -1
- package/dist/components/collapsible/index.mjs +1 -1
- package/dist/components/color-picker/index.mjs +1 -1
- package/dist/components/combobox/index.mjs +1 -1
- package/dist/components/date-picker/index.mjs +1 -1
- package/dist/components/dialog/index.mjs +1 -1
- package/dist/components/drawer/index.mjs +1 -1
- package/dist/components/dynamic-input/index.mjs +1 -1
- package/dist/components/editable/index.mjs +1 -1
- package/dist/components/file-upload/index.mjs +1 -1
- package/dist/components/floating-panel/index.mjs +1 -1
- package/dist/components/form/index.d.mts +48 -2
- package/dist/components/image/index.mjs +1 -1
- package/dist/components/image-viewer/index.mjs +1 -1
- package/dist/components/json-tree-view/index.mjs +1 -1
- package/dist/components/listbox/index.mjs +1 -1
- package/dist/components/media-player/index.mjs +1 -1
- package/dist/components/menu/index.mjs +1 -1
- package/dist/components/number-input/index.mjs +1 -1
- package/dist/components/order-list/index.mjs +1 -1
- package/dist/components/pagination/index.d.mts +2 -0
- package/dist/components/pagination/index.mjs +31 -6
- package/dist/components/password-input/index.mjs +1 -1
- package/dist/components/popover/index.mjs +1 -1
- package/dist/components/progress/index.d.mts +2 -2
- package/dist/components/progress/index.mjs +20 -4
- package/dist/components/rating-group/index.mjs +1 -1
- package/dist/components/result/index.mjs +2 -1
- package/dist/components/select/index.mjs +1 -1
- package/dist/components/signature-pad/index.mjs +1 -1
- package/dist/components/split-button/index.mjs +1 -1
- package/dist/components/steps/index.d.mts +5 -1
- package/dist/components/steps/index.mjs +6 -4
- package/dist/components/swap/index.mjs +1 -1
- package/dist/components/table/index.d.mts +2 -0
- package/dist/components/table/index.mjs +3 -2
- package/dist/components/tag/index.d.mts +33 -0
- package/dist/components/tag/index.mjs +75 -0
- package/dist/components/tags-input/index.mjs +1 -1
- package/dist/components/toggle-group/index.mjs +1 -1
- package/dist/components/transfer/index.mjs +1 -1
- package/dist/components/tree-select/index.mjs +1 -1
- package/dist/components/tree-view/index.mjs +1 -1
- package/dist/generative/index.d.mts +53 -0
- package/dist/generative/index.mjs +670 -0
- package/dist/icon-Cri0-7-x.mjs +38 -0
- package/dist/{image-viewer-B-hKFkEw.mjs → image-viewer-D4FuYrk6.mjs} +1 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +6 -5
- package/dist/{media-player-DjVvo1_7.mjs → media-player-C0WcjVI-.mjs} +2 -2
- package/dist/{select-i9UZsQCU.mjs → select-D_soVdWK.mjs} +1 -1
- package/package.json +2 -2
- package/dist/icon-BALgGtNK.mjs +0 -18
- package/dist/index-PsgGWW3m.d.mts +0 -1819
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
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
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { Pagination as Pagination$1 } from "@ark-ui/react/pagination";
|
|
6
6
|
//#region src/components/pagination/index.tsx
|
|
7
7
|
function PaginationRoot(props) {
|
|
@@ -19,8 +19,8 @@ const PaginationNextTrigger = Pagination$1.NextTrigger;
|
|
|
19
19
|
/** The complete pagination bar behind one page: count and page size become
|
|
20
20
|
* the visible ladder, with edge semantics left to anatomy. */
|
|
21
21
|
function PaginationFacade(props) {
|
|
22
|
-
const { value, defaultValue, count = 0, pageSize, defaultPageSize, siblingCount = 1, label, size = "md", className, style, onValueChange } = props;
|
|
23
|
-
return /* @__PURE__ */
|
|
22
|
+
const { value, defaultValue, count = 0, pageSize, defaultPageSize, siblingCount = 1, label, size = "md", variant = "default", className, style, onValueChange } = props;
|
|
23
|
+
return /* @__PURE__ */ jsx(PaginationRoot, {
|
|
24
24
|
size,
|
|
25
25
|
"aria-label": label,
|
|
26
26
|
count,
|
|
@@ -29,10 +29,35 @@ function PaginationFacade(props) {
|
|
|
29
29
|
...pageSize === void 0 ? {} : { pageSize },
|
|
30
30
|
...defaultPageSize === void 0 ? {} : { defaultPageSize },
|
|
31
31
|
siblingCount,
|
|
32
|
+
"data-variant": variant === "simple" ? variant : void 0,
|
|
32
33
|
className,
|
|
33
34
|
style,
|
|
34
35
|
onPageChange: (event) => onValueChange?.(event.page),
|
|
35
|
-
children: [
|
|
36
|
+
children: variant === "simple" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37
|
+
/* @__PURE__ */ jsx(PaginationPrevTrigger, {
|
|
38
|
+
"aria-label": "Previous page",
|
|
39
|
+
children: iconNode("chevron-left", {
|
|
40
|
+
width: 14,
|
|
41
|
+
height: 14
|
|
42
|
+
})
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ jsx(Pagination$1.Context, { children: (pagination) => /* @__PURE__ */ jsxs("span", {
|
|
45
|
+
"data-scope": "pagination",
|
|
46
|
+
"data-part": "status",
|
|
47
|
+
children: [
|
|
48
|
+
pagination.page,
|
|
49
|
+
" / ",
|
|
50
|
+
pagination.totalPages
|
|
51
|
+
]
|
|
52
|
+
}) }),
|
|
53
|
+
/* @__PURE__ */ jsx(PaginationNextTrigger, {
|
|
54
|
+
"aria-label": "Next page",
|
|
55
|
+
children: iconNode("chevron-right", {
|
|
56
|
+
width: 14,
|
|
57
|
+
height: 14
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
36
61
|
/* @__PURE__ */ jsx(PaginationPrevTrigger, {
|
|
37
62
|
"aria-label": "Previous page",
|
|
38
63
|
children: iconNode("chevron-left", {
|
|
@@ -55,7 +80,7 @@ function PaginationFacade(props) {
|
|
|
55
80
|
height: 14
|
|
56
81
|
})
|
|
57
82
|
})
|
|
58
|
-
]
|
|
83
|
+
] })
|
|
59
84
|
});
|
|
60
85
|
}
|
|
61
86
|
const Pagination = Object.assign(PaginationFacade, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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 {
|
|
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";
|
|
@@ -16,14 +16,14 @@ type ProgressFacadeProps = {
|
|
|
16
16
|
min?: number;
|
|
17
17
|
max?: number;
|
|
18
18
|
label?: string;
|
|
19
|
-
variant?: "linear" | "circle";
|
|
19
|
+
variant?: "linear" | "circle" | "dashboard";
|
|
20
20
|
size?: "sm" | "md" | "lg";
|
|
21
21
|
className?: string;
|
|
22
22
|
style?: CSSProperties;
|
|
23
23
|
onValueChange?: (value: number | null) => void;
|
|
24
24
|
};
|
|
25
25
|
/** The complete progress behind one value: a labelled linear groove by
|
|
26
|
-
* default, with
|
|
26
|
+
* default, with circular and dashboard dials for compact status. */
|
|
27
27
|
declare function ProgressFacade(props: ProgressFacadeProps): import("react").JSX.Element;
|
|
28
28
|
export declare const Progress: typeof ProgressFacade & Omit<typeof Progress$1, "Root"> & {
|
|
29
29
|
Root: typeof ProgressRoot;
|
|
@@ -15,9 +15,15 @@ function ProgressRoot(props) {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
/** The complete progress behind one value: a labelled linear groove by
|
|
18
|
-
* default, with
|
|
18
|
+
* default, with circular and dashboard dials for compact status. */
|
|
19
19
|
function ProgressFacade(props) {
|
|
20
20
|
const { value, defaultValue, min, max, label, variant = "linear", size = "md", className, style, onValueChange } = props;
|
|
21
|
+
const dashboardPercent = (() => {
|
|
22
|
+
const lower = min ?? 0;
|
|
23
|
+
const upper = max ?? 100;
|
|
24
|
+
const percent = ((value ?? defaultValue ?? lower + (upper - lower) / 2) - lower) / (upper - lower) * 100;
|
|
25
|
+
return !Number.isFinite(percent) ? 0 : Math.min(100, Math.max(0, percent));
|
|
26
|
+
})();
|
|
21
27
|
return /* @__PURE__ */ jsxs(ProgressRoot, {
|
|
22
28
|
size,
|
|
23
29
|
"data-variant": variant,
|
|
@@ -30,11 +36,21 @@ function ProgressFacade(props) {
|
|
|
30
36
|
onValueChange: (event) => onValueChange?.(event.value),
|
|
31
37
|
children: [
|
|
32
38
|
label ? /* @__PURE__ */ jsx(Progress$1.Label, { children: label }) : null,
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
|
|
39
|
+
variant === "dashboard" ? /* @__PURE__ */ jsxs("div", {
|
|
40
|
+
"data-scope": "progress",
|
|
41
|
+
"data-part": "view",
|
|
42
|
+
"data-view": "dashboard",
|
|
43
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
44
|
+
"aria-hidden": "true",
|
|
45
|
+
"data-scope": "progress",
|
|
46
|
+
"data-part": "dash-ring",
|
|
47
|
+
style: { "--percent": String(dashboardPercent) }
|
|
48
|
+
}), /* @__PURE__ */ jsx(Progress$1.ValueText, {})]
|
|
49
|
+
}) : variant === "circle" ? /* @__PURE__ */ jsx(ProgressView, {
|
|
35
50
|
view: "circle",
|
|
36
51
|
children: /* @__PURE__ */ jsx(Progress$1.Circle, { children: /* @__PURE__ */ jsx(Progress$1.CircleRange, {}) })
|
|
37
|
-
}) : /* @__PURE__ */ jsx(Progress$1.Track, { children: /* @__PURE__ */ jsx(Progress$1.Range, {}) })
|
|
52
|
+
}) : /* @__PURE__ */ jsx(Progress$1.Track, { children: /* @__PURE__ */ jsx(Progress$1.Range, {}) }),
|
|
53
|
+
variant !== "dashboard" ? /* @__PURE__ */ jsx(Progress$1.ValueText, {}) : null
|
|
38
54
|
]
|
|
39
55
|
});
|
|
40
56
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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,7 +1,8 @@
|
|
|
1
|
+
import { t as iconBody } from "../../icon-Cri0-7-x.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core/styling";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/result/index.tsx
|
|
4
|
-
const MARK =
|
|
5
|
+
const MARK = `<g data-for="success">${iconBody("check")}</g><g data-for="warning">${iconBody("triangle-alert")}</g><g data-for="danger">${iconBody("circle-x")}</g><g data-for="info">${iconBody("info")}</g>`;
|
|
5
6
|
function ResultRoot({ status = "info", children, ...rest }) {
|
|
6
7
|
injectComponentStyle("result");
|
|
7
8
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as NativeSelect, t as Select } from "../../select-
|
|
1
|
+
import { n as NativeSelect, t as Select } from "../../select-D_soVdWK.mjs";
|
|
2
2
|
export { NativeSelect, Select };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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 {
|
|
1
|
+
import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
|
|
2
2
|
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
3
3
|
import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
|
|
4
4
|
import { Button } from "../button/index.mjs";
|
|
@@ -4,6 +4,8 @@ import { Steps as Steps$1 } from "@ark-ui/react/steps";
|
|
|
4
4
|
type StepsRootProps = ComponentProps<typeof Steps$1.Root> & {
|
|
5
5
|
/** One rung of the control-height ladder every indicator stands on. */
|
|
6
6
|
size?: "sm" | "md" | "lg";
|
|
7
|
+
/** Default renders numbered seals; dot reduces each step to a bead. */
|
|
8
|
+
variant?: "default" | "dot";
|
|
7
9
|
};
|
|
8
10
|
declare function StepsRoot(props: StepsRootProps): import("react").JSX.Element;
|
|
9
11
|
type StepsItem = {
|
|
@@ -17,10 +19,12 @@ export interface StepsFacadeProps {
|
|
|
17
19
|
orientation?: "horizontal" | "vertical";
|
|
18
20
|
/** One rung of the control-height ladder every indicator stands on. */
|
|
19
21
|
size?: "sm" | "md" | "lg";
|
|
22
|
+
/** Default renders numbered seals; dot reduces each step to a bead. */
|
|
23
|
+
variant?: "default" | "dot";
|
|
20
24
|
className?: string;
|
|
21
25
|
onStepChange?: (step: number) => void;
|
|
22
26
|
}
|
|
23
|
-
declare function StepsFacade({ items, step, defaultStep, linear, orientation, size, className, onStepChange }: StepsFacadeProps): import("react").JSX.Element;
|
|
27
|
+
declare function StepsFacade({ items, step, defaultStep, linear, orientation, size, variant, className, onStepChange }: StepsFacadeProps): import("react").JSX.Element;
|
|
24
28
|
declare namespace StepsFacade {
|
|
25
29
|
var displayName: string;
|
|
26
30
|
}
|
|
@@ -5,27 +5,29 @@ import { Steps as Steps$1 } from "@ark-ui/react/steps";
|
|
|
5
5
|
//#region src/components/steps/index.tsx
|
|
6
6
|
function StepsRoot(props) {
|
|
7
7
|
const id = useElementId("steps", props);
|
|
8
|
-
const { size = "md", ...rest } = props;
|
|
8
|
+
const { size = "md", variant = "default", ...rest } = props;
|
|
9
9
|
return /* @__PURE__ */ jsx(Steps$1.Root, {
|
|
10
10
|
...rest,
|
|
11
11
|
id,
|
|
12
|
-
"data-size": size
|
|
12
|
+
"data-size": size,
|
|
13
|
+
"data-variant": variant === "dot" ? variant : void 0
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
|
-
function StepsFacade({ items, step, defaultStep = 0, linear = false, orientation = "horizontal", size = "md", className, onStepChange }) {
|
|
16
|
+
function StepsFacade({ items, step, defaultStep = 0, linear = false, orientation = "horizontal", size = "md", variant = "default", className, onStepChange }) {
|
|
16
17
|
return /* @__PURE__ */ jsx(StepsRoot, {
|
|
17
18
|
className,
|
|
18
19
|
size,
|
|
19
20
|
count: items.length,
|
|
20
21
|
linear,
|
|
21
22
|
orientation,
|
|
23
|
+
variant,
|
|
22
24
|
defaultStep,
|
|
23
25
|
...step === void 0 ? {} : { step },
|
|
24
26
|
onStepChange: (details) => onStepChange?.(details.step),
|
|
25
27
|
children: /* @__PURE__ */ jsx(Steps$1.List, { children: items.map((item, index) => /* @__PURE__ */ jsxs(Steps$1.Item, {
|
|
26
28
|
index,
|
|
27
29
|
role: "presentation",
|
|
28
|
-
children: [/* @__PURE__ */ jsxs(Steps$1.Trigger, { children: [/* @__PURE__ */ jsx(Steps$1.Indicator, { children: String(index + 1) }), item.title] }), /* @__PURE__ */ jsx(Steps$1.Separator, {})]
|
|
30
|
+
children: [/* @__PURE__ */ jsxs(Steps$1.Trigger, { children: [/* @__PURE__ */ jsx(Steps$1.Indicator, { children: variant === "dot" ? null : String(index + 1) }), item.title] }), /* @__PURE__ */ jsx(Steps$1.Separator, {})]
|
|
29
31
|
}, item.title)) })
|
|
30
32
|
});
|
|
31
33
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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";
|
|
@@ -61,6 +61,8 @@ export interface DataTableProps {
|
|
|
61
61
|
initialSorting?: SortingState;
|
|
62
62
|
globalFilterPlaceholder?: string;
|
|
63
63
|
emptyText?: string;
|
|
64
|
+
/** Band every other body row so wide measures keep the eye on line. */
|
|
65
|
+
striped?: boolean;
|
|
64
66
|
/** Allow dragging header cells onto each other to reorder columns and
|
|
65
67
|
* body rows onto each other to reorder data — with `tree`, row drops
|
|
66
68
|
* read as before / inside / after, so a drop can also nest a branch
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
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 { Pagination } from "../pagination/index.mjs";
|
|
5
|
-
import { t as Select$1 } from "../../select-
|
|
5
|
+
import { t as Select$1 } from "../../select-D_soVdWK.mjs";
|
|
6
6
|
import { injectComponentStyle } from "@bysages/core/styling";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
@@ -638,6 +638,7 @@ function DataTableImpl(rawProps) {
|
|
|
638
638
|
"data-scope": "table",
|
|
639
639
|
"data-part": "root",
|
|
640
640
|
"data-reorderable": reorderable || void 0,
|
|
641
|
+
"data-striped": props.striped || void 0,
|
|
641
642
|
style: {
|
|
642
643
|
"--bs-table-row-height": `calc(${rowHeight}px * var(--bs-density-scale, 1))`,
|
|
643
644
|
...props.style
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
//#region src/components/tag/index.d.ts
|
|
3
|
+
export interface TagProps extends Omit<HTMLAttributes<HTMLElement>, "defaultValue"> {
|
|
4
|
+
/** The pigment the tag is inked with; ink is the solemn default,
|
|
5
|
+
* and the fixed pigments speak for their meaning. */
|
|
6
|
+
tone?: "ink" | "primary" | "success" | "warning" | "danger" | "info";
|
|
7
|
+
/** How the tag rests: a solid fill, an outline shell, a subtle
|
|
8
|
+
* wash. The pressed state always reads as solid. */
|
|
9
|
+
variant?: "solid" | "outline" | "subtle";
|
|
10
|
+
/** Render the tag as a pressed button the consumer can toggle. */
|
|
11
|
+
checkable?: boolean;
|
|
12
|
+
/** The pressed state held from outside; omit it and the tag keeps
|
|
13
|
+
* its own state from `defaultValue`. */
|
|
14
|
+
value?: boolean;
|
|
15
|
+
defaultValue?: boolean;
|
|
16
|
+
/** Render the quiet removal seal. */
|
|
17
|
+
closable?: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
onValueChange?: (checked: boolean) => void;
|
|
20
|
+
onClose?: () => void;
|
|
21
|
+
}
|
|
22
|
+
/** A small named seal for filtering and cataloguing. The resting shape
|
|
23
|
+
* is a span; `checkable` raises it to a pressed button, and `closable`
|
|
24
|
+
* hangs the removal seal inside — dismissal stays the consumer's state,
|
|
25
|
+
* the way the banner's does. */
|
|
26
|
+
declare function TagImpl({ tone, variant, checkable, value, defaultValue, closable, disabled, onValueChange, onClose, children, ...rest }: TagProps): import("react").JSX.Element;
|
|
27
|
+
declare namespace TagImpl {
|
|
28
|
+
var displayName: string;
|
|
29
|
+
}
|
|
30
|
+
export declare const Tag: typeof TagImpl & {
|
|
31
|
+
Root: typeof TagImpl;
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
|
|
2
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
3
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
//#region src/components/tag/index.tsx
|
|
7
|
+
/** A small named seal for filtering and cataloguing. The resting shape
|
|
8
|
+
* is a span; `checkable` raises it to a pressed button, and `closable`
|
|
9
|
+
* hangs the removal seal inside — dismissal stays the consumer's state,
|
|
10
|
+
* the way the banner's does. */
|
|
11
|
+
function TagImpl({ tone = "ink", variant = "solid", checkable = false, value, defaultValue = false, closable = false, disabled = false, onValueChange, onClose, children, ...rest }) {
|
|
12
|
+
injectComponentStyle("tag");
|
|
13
|
+
const [internalChecked, setInternalChecked] = useState(defaultValue);
|
|
14
|
+
const checked = value ?? internalChecked;
|
|
15
|
+
const toggle = () => {
|
|
16
|
+
if (disabled) return;
|
|
17
|
+
const next = !checked;
|
|
18
|
+
setInternalChecked(next);
|
|
19
|
+
onValueChange?.(next);
|
|
20
|
+
};
|
|
21
|
+
const dismiss = (event) => {
|
|
22
|
+
event.stopPropagation();
|
|
23
|
+
if (disabled) return;
|
|
24
|
+
onClose?.();
|
|
25
|
+
};
|
|
26
|
+
const pressed = checkable && checked;
|
|
27
|
+
const closeControl = closable ? /* @__PURE__ */ jsx("button", {
|
|
28
|
+
"data-scope": "tag",
|
|
29
|
+
"data-part": "close",
|
|
30
|
+
type: "button",
|
|
31
|
+
"aria-label": "Remove",
|
|
32
|
+
disabled,
|
|
33
|
+
onClick: dismiss,
|
|
34
|
+
children: iconNode("x")
|
|
35
|
+
}) : null;
|
|
36
|
+
const partProps = {
|
|
37
|
+
...rest,
|
|
38
|
+
"data-scope": "tag",
|
|
39
|
+
"data-part": "root",
|
|
40
|
+
"data-tone": tone,
|
|
41
|
+
"data-variant": variant,
|
|
42
|
+
...checkable ? { "data-checkable": "true" } : {},
|
|
43
|
+
...pressed ? { "data-checked": "true" } : {},
|
|
44
|
+
...disabled ? { "data-disabled": "true" } : {}
|
|
45
|
+
};
|
|
46
|
+
if (checkable && closable) return /* @__PURE__ */ jsxs("span", {
|
|
47
|
+
...partProps,
|
|
48
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
49
|
+
"data-scope": "tag",
|
|
50
|
+
"data-part": "check",
|
|
51
|
+
type: "button",
|
|
52
|
+
"aria-pressed": checked,
|
|
53
|
+
disabled,
|
|
54
|
+
onClick: toggle,
|
|
55
|
+
children
|
|
56
|
+
}), closeControl]
|
|
57
|
+
});
|
|
58
|
+
if (checkable) return /* @__PURE__ */ jsxs("button", {
|
|
59
|
+
...partProps,
|
|
60
|
+
type: "button",
|
|
61
|
+
"aria-pressed": checked,
|
|
62
|
+
disabled,
|
|
63
|
+
onClick: toggle,
|
|
64
|
+
children: [children, closeControl]
|
|
65
|
+
});
|
|
66
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
67
|
+
...partProps,
|
|
68
|
+
...disabled ? { "aria-disabled": "true" } : {},
|
|
69
|
+
children: [children, closeControl]
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
TagImpl.displayName = "STag";
|
|
73
|
+
const Tag = withSelfRoot(TagImpl);
|
|
74
|
+
//#endregion
|
|
75
|
+
export { Tag };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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 {
|
|
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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
|
|
2
2
|
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
3
3
|
import { n as useComponentMessages, t as formatMessage } from "../../messages-1jJWtaYU.mjs";
|
|
4
4
|
import { Button } from "../button/index.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as iconNode } from "../../icon-Cri0-7-x.mjs";
|
|
2
2
|
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
3
3
|
import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
|
|
4
4
|
import { Popover as Popover$1 } from "../popover/index.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/generative/index.d.ts
|
|
3
|
+
export declare const catalog: import("@json-render/core").Catalog<{
|
|
4
|
+
spec: import("@json-render/core").SchemaType<"object", {
|
|
5
|
+
root: import("@json-render/core").SchemaType<"string", unknown>;
|
|
6
|
+
elements: import("@json-render/core").SchemaType<"record", import("@json-render/core").SchemaType<"object", {
|
|
7
|
+
type: import("@json-render/core").SchemaType<"ref", string>;
|
|
8
|
+
props: import("@json-render/core").SchemaType<"propsOf", string>;
|
|
9
|
+
children: import("@json-render/core").SchemaType<"array", import("@json-render/core").SchemaType<"string", unknown>>;
|
|
10
|
+
slots: {
|
|
11
|
+
optional: true;
|
|
12
|
+
kind: "record";
|
|
13
|
+
inner?: import("@json-render/core").SchemaType<"array", import("@json-render/core").SchemaType<"string", unknown>> | undefined;
|
|
14
|
+
};
|
|
15
|
+
visible: {
|
|
16
|
+
optional: true;
|
|
17
|
+
kind: "any";
|
|
18
|
+
inner?: unknown;
|
|
19
|
+
};
|
|
20
|
+
repeat: {
|
|
21
|
+
optional: true;
|
|
22
|
+
kind: "any";
|
|
23
|
+
inner?: unknown;
|
|
24
|
+
};
|
|
25
|
+
}>>;
|
|
26
|
+
}>;
|
|
27
|
+
catalog: import("@json-render/core").SchemaType<"object", {
|
|
28
|
+
components: import("@json-render/core").SchemaType<"map", {
|
|
29
|
+
props: import("@json-render/core").SchemaType<"zod", unknown>;
|
|
30
|
+
slots: import("@json-render/core").SchemaType<"array", import("@json-render/core").SchemaType<"string", unknown>>;
|
|
31
|
+
description: import("@json-render/core").SchemaType<"string", unknown>;
|
|
32
|
+
example: import("@json-render/core").SchemaType<"any", unknown>;
|
|
33
|
+
}>;
|
|
34
|
+
actions: import("@json-render/core").SchemaType<"map", {
|
|
35
|
+
params: import("@json-render/core").SchemaType<"zod", unknown>;
|
|
36
|
+
description: import("@json-render/core").SchemaType<"string", unknown>;
|
|
37
|
+
}>;
|
|
38
|
+
}>;
|
|
39
|
+
}, {
|
|
40
|
+
components: Record<string, {
|
|
41
|
+
props: z.ZodObject;
|
|
42
|
+
slots?: string[];
|
|
43
|
+
description: string;
|
|
44
|
+
}>;
|
|
45
|
+
actions: {};
|
|
46
|
+
}>;
|
|
47
|
+
declare const registry: import("@json-render/react").ComponentRegistry;
|
|
48
|
+
/** Which family each face came home from. A family may speak under
|
|
49
|
+
* several names - Layout plus its parts, Bento plus its cell - and the
|
|
50
|
+
* palette groups by provenance, never by guessing from the name. */
|
|
51
|
+
export declare const faceFamilies: Record<string, string>;
|
|
52
|
+
//#endregion
|
|
53
|
+
export { registry };
|