@bysages/react 0.3.1 → 0.4.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/dist/{ai-response-BfKTmtCt.mjs → ai-response-B4DX7nmJ.mjs} +3 -1
- package/dist/chevron-a2nIZKN4.mjs +6 -0
- package/dist/components/accordion/index.d.mts +22 -4
- package/dist/components/accordion/index.mjs +31 -1
- package/dist/components/affix/index.d.mts +4 -1
- package/dist/components/affix/index.mjs +5 -3
- package/dist/components/ai/index.d.mts +1 -1
- package/dist/components/ai/index.mjs +5 -3
- package/dist/components/ai-action/index.d.mts +4 -1
- package/dist/components/ai-action/index.mjs +3 -1
- package/dist/components/ai-attachments/index.d.mts +10 -4
- package/dist/components/ai-attachments/index.mjs +16 -44
- package/dist/components/ai-message/index.d.mts +4 -1
- package/dist/components/ai-message/index.mjs +3 -1
- package/dist/components/ai-prompt-input/index.d.mts +5 -2
- package/dist/components/ai-prompt-input/index.mjs +10 -14
- package/dist/components/ai-reasoning/index.d.mts +4 -1
- package/dist/components/ai-reasoning/index.mjs +4 -2
- package/dist/components/ai-response/index.d.mts +4 -1
- package/dist/components/ai-response/index.mjs +1 -1
- package/dist/components/ai-source/index.d.mts +8 -2
- package/dist/components/ai-source/index.mjs +5 -2
- package/dist/components/ai-suggestion/index.d.mts +4 -1
- package/dist/components/ai-suggestion/index.mjs +3 -1
- package/dist/components/ai-tool/index.d.mts +4 -1
- package/dist/components/ai-tool/index.mjs +4 -2
- package/dist/components/alert/index.d.mts +2 -0
- package/dist/components/alert/index.mjs +11 -18
- package/dist/components/angle-slider/index.d.mts +19 -2
- package/dist/components/angle-slider/index.mjs +31 -8
- package/dist/components/aspect-ratio/index.d.mts +4 -1
- package/dist/components/aspect-ratio/index.mjs +3 -1
- package/dist/components/autocomplete/index.d.mts +3 -1
- package/dist/components/autocomplete/index.mjs +6 -1
- package/dist/components/avatar/index.d.mts +2 -2
- package/dist/components/avatar/index.mjs +9 -2
- package/dist/components/avatar-group/index.d.mts +4 -1
- package/dist/components/avatar-group/index.mjs +3 -1
- package/dist/components/back-top/index.d.mts +7 -1
- package/dist/components/back-top/index.mjs +12 -17
- package/dist/components/badge/index.d.mts +4 -1
- package/dist/components/badge/index.mjs +3 -1
- package/dist/components/banner/index.mjs +2 -11
- package/dist/components/block-ui/index.d.mts +4 -1
- package/dist/components/block-ui/index.mjs +3 -1
- package/dist/components/button/index.d.mts +4 -1
- package/dist/components/button/index.mjs +3 -1
- package/dist/components/calendar/index.d.mts +3 -1
- package/dist/components/calendar/index.mjs +9 -10
- package/dist/components/carousel/index.d.mts +21 -1
- package/dist/components/carousel/index.mjs +43 -2
- package/dist/components/cascade-select/index.d.mts +6 -1
- package/dist/components/cascade-select/index.mjs +12 -35
- package/dist/components/checkbox/index.d.mts +20 -2
- package/dist/components/checkbox/index.mjs +28 -8
- package/dist/components/checkbox-group/index.d.mts +8 -6
- package/dist/components/checkbox-group/index.mjs +44 -48
- package/dist/components/chip/index.d.mts +4 -1
- package/dist/components/chip/index.mjs +3 -1
- package/dist/components/client-only/index.d.mts +7 -2
- package/dist/components/client-only/index.mjs +5 -1
- package/dist/components/clipboard/index.d.mts +17 -4
- package/dist/components/clipboard/index.mjs +33 -5
- package/dist/components/collapsible/index.d.mts +16 -4
- package/dist/components/collapsible/index.mjs +25 -1
- package/dist/components/color-picker/index.d.mts +20 -4
- package/dist/components/color-picker/index.mjs +56 -14
- package/dist/components/combobox/index.d.mts +27 -1
- package/dist/components/combobox/index.mjs +62 -5
- package/dist/components/command/index.d.mts +4 -1
- package/dist/components/command/index.mjs +7 -1
- package/dist/components/comment/index.d.mts +4 -1
- package/dist/components/comment/index.mjs +3 -1
- package/dist/components/config-provider/index.d.mts +4 -1
- package/dist/components/config-provider/index.mjs +3 -1
- package/dist/components/container/index.d.mts +4 -1
- package/dist/components/container/index.mjs +3 -1
- package/dist/components/data-view/index.d.mts +4 -1
- package/dist/components/data-view/index.mjs +3 -1
- package/dist/components/date-input/index.d.mts +19 -4
- package/dist/components/date-input/index.mjs +33 -9
- package/dist/components/date-picker/index.d.mts +21 -4
- package/dist/components/date-picker/index.mjs +58 -11
- package/dist/components/deferred-content/index.d.mts +4 -1
- package/dist/components/deferred-content/index.mjs +3 -1
- package/dist/components/descriptions/index.d.mts +10 -2
- package/dist/components/descriptions/index.mjs +13 -8
- package/dist/components/dialog/index.d.mts +18 -5
- package/dist/components/dialog/index.mjs +43 -1
- package/dist/components/download-trigger/index.d.mts +7 -2
- package/dist/components/download-trigger/index.mjs +5 -1
- package/dist/components/drawer/index.d.mts +18 -6
- package/dist/components/drawer/index.mjs +40 -1
- package/dist/components/dynamic-input/index.d.mts +4 -1
- package/dist/components/dynamic-input/index.mjs +10 -18
- package/dist/components/editable/index.d.mts +28 -7
- package/dist/components/editable/index.mjs +43 -4
- package/dist/components/ellipsis/index.d.mts +4 -1
- package/dist/components/ellipsis/index.mjs +3 -1
- package/dist/components/field/index.d.mts +30 -5
- package/dist/components/field/index.mjs +36 -3
- package/dist/components/fieldset/index.d.mts +19 -4
- package/dist/components/fieldset/index.mjs +28 -3
- package/dist/components/file-upload/index.d.mts +29 -9
- package/dist/components/file-upload/index.mjs +46 -10
- package/dist/components/floating-panel/index.d.mts +18 -6
- package/dist/components/floating-panel/index.mjs +55 -1
- package/dist/components/focus-trap/index.d.mts +7 -2
- package/dist/components/focus-trap/index.mjs +5 -1
- package/dist/components/form/index.d.mts +1 -1
- package/dist/components/form/index.mjs +5 -2
- package/dist/components/frame/index.d.mts +4 -8
- package/dist/components/frame/index.mjs +13 -1
- package/dist/components/grid/index.d.mts +4 -1
- package/dist/components/grid/index.mjs +3 -1
- package/dist/components/highlight/index.d.mts +3 -5
- package/dist/components/highlight/index.mjs +6 -1
- package/dist/components/hover-card/index.d.mts +20 -4
- package/dist/components/hover-card/index.mjs +32 -1
- package/dist/components/icon/index.d.mts +10 -8
- package/dist/components/icon/index.mjs +5 -3
- package/dist/components/image/index.d.mts +5 -2
- package/dist/components/image/index.mjs +14 -29
- package/dist/components/image-cropper/index.d.mts +13 -2
- package/dist/components/image-cropper/index.mjs +34 -2
- package/dist/components/image-viewer/index.d.mts +2 -24
- package/dist/components/image-viewer/index.mjs +3 -113
- package/dist/components/input/index.d.mts +3 -1
- package/dist/components/input/index.mjs +1 -1
- package/dist/components/json-tree-view/index.d.mts +17 -1
- package/dist/components/json-tree-view/index.mjs +26 -5
- package/dist/components/kbd/index.d.mts +4 -1
- package/dist/components/kbd/index.mjs +3 -1
- package/dist/components/layout/index.d.mts +25 -7
- package/dist/components/layout/index.mjs +157 -63
- package/dist/components/link/index.d.mts +4 -1
- package/dist/components/link/index.mjs +3 -1
- package/dist/components/listbox/index.d.mts +22 -1
- package/dist/components/listbox/index.mjs +36 -4
- package/dist/components/marquee/index.d.mts +18 -1
- package/dist/components/marquee/index.mjs +34 -2
- package/dist/components/masonry/index.d.mts +4 -1
- package/dist/components/masonry/index.mjs +3 -1
- package/dist/components/media-player/index.d.mts +2 -0
- package/dist/components/media-player/index.mjs +2 -0
- package/dist/components/mentions/index.d.mts +1 -1
- package/dist/components/mentions/index.mjs +1 -1
- package/dist/components/menu/index.d.mts +29 -11
- package/dist/components/menu/index.mjs +34 -12
- package/dist/components/menubar/index.d.mts +3 -1
- package/dist/components/menubar/index.mjs +6 -1
- package/dist/components/navigation-menu/index.d.mts +25 -1
- package/dist/components/navigation-menu/index.mjs +36 -1
- package/dist/components/number-input/index.d.mts +28 -6
- package/dist/components/number-input/index.mjs +33 -8
- package/dist/components/order-list/index.d.mts +4 -1
- package/dist/components/order-list/index.mjs +26 -24
- package/dist/components/pagination/index.d.mts +23 -3
- package/dist/components/pagination/index.mjs +57 -12
- package/dist/components/password-input/index.d.mts +24 -6
- package/dist/components/password-input/index.mjs +31 -8
- package/dist/components/pin-input/index.d.mts +23 -5
- package/dist/components/pin-input/index.mjs +29 -7
- package/dist/components/popconfirm/index.d.mts +9 -5
- package/dist/components/popconfirm/index.mjs +23 -18
- package/dist/components/popover/index.d.mts +2 -8
- package/dist/components/popover/index.mjs +44 -4
- package/dist/components/presence/index.d.mts +10 -2
- package/dist/components/presence/index.mjs +6 -1
- package/dist/components/progress/index.d.mts +18 -3
- package/dist/components/progress/index.mjs +34 -9
- package/dist/components/progress-group/index.d.mts +4 -1
- package/dist/components/progress-group/index.mjs +4 -2
- package/dist/components/qr-code/index.d.mts +14 -1
- package/dist/components/qr-code/index.mjs +26 -2
- package/dist/components/radio-group/index.d.mts +27 -2
- package/dist/components/radio-group/index.mjs +32 -8
- package/dist/components/rating-group/index.d.mts +20 -3
- package/dist/components/rating-group/index.mjs +26 -8
- package/dist/components/result/index.d.mts +1 -1
- package/dist/components/result/index.mjs +2 -2
- package/dist/components/scroll-area/index.d.mts +14 -1
- package/dist/components/scroll-area/index.mjs +32 -2
- package/dist/components/segment-group/index.d.mts +28 -2
- package/dist/components/segment-group/index.mjs +34 -7
- package/dist/components/select/index.d.mts +2 -2
- package/dist/components/select/index.mjs +1 -1
- package/dist/components/separator/index.d.mts +4 -1
- package/dist/components/separator/index.mjs +3 -1
- package/dist/components/signature-pad/index.d.mts +25 -5
- package/dist/components/signature-pad/index.mjs +37 -3
- package/dist/components/skeleton/index.d.mts +4 -1
- package/dist/components/skeleton/index.mjs +3 -1
- package/dist/components/slider/index.d.mts +21 -2
- package/dist/components/slider/index.mjs +31 -8
- package/dist/components/spinner/index.d.mts +4 -1
- package/dist/components/spinner/index.mjs +3 -1
- package/dist/components/split-button/index.d.mts +3 -1
- package/dist/components/split-button/index.mjs +12 -17
- package/dist/components/splitter/index.d.mts +17 -4
- package/dist/components/splitter/index.mjs +35 -1
- package/dist/components/spotlight/index.d.mts +4 -1
- package/dist/components/spotlight/index.mjs +3 -1
- package/dist/components/stack/index.d.mts +4 -1
- package/dist/components/stack/index.mjs +6 -4
- package/dist/components/steps/index.d.mts +26 -6
- package/dist/components/steps/index.mjs +26 -11
- package/dist/components/swap/index.d.mts +11 -5
- package/dist/components/swap/index.mjs +30 -3
- package/dist/components/switch/index.d.mts +20 -2
- package/dist/components/switch/index.mjs +27 -8
- package/dist/components/table/index.d.mts +4 -1
- package/dist/components/table/index.mjs +26 -56
- package/dist/components/tabs/index.d.mts +24 -2
- package/dist/components/tabs/index.mjs +25 -9
- package/dist/components/tags-input/index.d.mts +33 -8
- package/dist/components/tags-input/index.mjs +41 -9
- package/dist/components/terminal/index.d.mts +4 -1
- package/dist/components/terminal/index.mjs +3 -1
- package/dist/components/textarea/index.d.mts +4 -1
- package/dist/components/textarea/index.mjs +3 -1
- package/dist/components/timer/index.d.mts +18 -1
- package/dist/components/timer/index.mjs +51 -2
- package/dist/components/toast/index.d.mts +3 -6
- package/dist/components/toast/index.mjs +22 -2
- package/dist/components/toc/index.d.mts +19 -5
- package/dist/components/toc/index.mjs +31 -5
- package/dist/components/toggle/index.d.mts +11 -4
- package/dist/components/toggle/index.mjs +21 -1
- package/dist/components/toggle-group/index.d.mts +26 -2
- package/dist/components/toggle-group/index.mjs +31 -6
- package/dist/components/toolbar/index.d.mts +4 -1
- package/dist/components/toolbar/index.mjs +3 -1
- package/dist/components/tooltip/index.d.mts +17 -4
- package/dist/components/tooltip/index.mjs +28 -1
- package/dist/components/tour/index.d.mts +18 -9
- package/dist/components/tour/index.mjs +44 -2
- package/dist/components/transfer/index.d.mts +3 -1
- package/dist/components/transfer/index.mjs +14 -26
- package/dist/components/tree-select/index.d.mts +3 -1
- package/dist/components/tree-select/index.mjs +11 -22
- package/dist/components/tree-view/index.d.mts +22 -2
- package/dist/components/tree-view/index.mjs +50 -8
- package/dist/components/typography/index.d.mts +4 -0
- package/dist/components/typography/index.mjs +1 -0
- package/dist/components/user/index.d.mts +4 -1
- package/dist/components/user/index.mjs +3 -1
- package/dist/components/virtual-list/index.d.mts +4 -1
- package/dist/components/virtual-list/index.mjs +10 -12
- package/dist/components/watermark/index.d.mts +4 -1
- package/dist/components/watermark/index.mjs +4 -2
- package/dist/family-DE_GQeeM.mjs +9 -0
- package/dist/icon-BALgGtNK.mjs +18 -0
- package/dist/id-C37UYLwJ.mjs +13 -0
- package/dist/image-viewer-Cf6thHax.mjs +141 -0
- package/dist/{index-Uefyw7Im.d.mts → index-Bbg4heDO.d.mts} +12 -7
- package/dist/index-BcRdWGY-.d.mts +115 -0
- package/dist/{index-Iy8m0Qev.d.mts → index-D_iKc2Uw.d.mts} +31 -2
- package/dist/{index-Dn5mHf1g.d.mts → index-DdNKngUQ.d.mts} +56 -17
- package/dist/index-Dj8S4eyJ.d.mts +41 -0
- package/dist/index-Eu-Bttta.d.mts +24 -0
- package/dist/{index-uPyYiWaL.d.mts → index-PsgGWW3m.d.mts} +8 -2
- package/dist/index.d.mts +36 -35
- package/dist/index.mjs +11 -10
- package/dist/{input-2oezH-dY.mjs → input-C21Zzuy6.mjs} +3 -1
- package/dist/media-player-gQrnxU52.mjs +554 -0
- package/dist/{mentions-DMIBCBOd.mjs → mentions-BuWibdci.mjs} +74 -42
- package/dist/select-ozUFq0zd.mjs +121 -0
- package/package.json +3 -3
- package/dist/chevron-BeHvt46K.mjs +0 -17
- package/dist/glyph-VI989p8H.mjs +0 -14
- package/dist/select-eAHutw56.mjs +0 -70
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
3
|
import { n as useComponentMessages, t as formatMessage } from "../../messages-1jJWtaYU.mjs";
|
|
2
4
|
import { Pagination } from "../pagination/index.mjs";
|
|
3
|
-
import { t as Select$1 } from "../../select-
|
|
5
|
+
import { t as Select$1 } from "../../select-ozUFq0zd.mjs";
|
|
4
6
|
import { injectComponentStyle } from "@bysages/core";
|
|
5
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
8
|
import { useEffect, useLayoutEffect, useMemo, useReducer, useRef } from "react";
|
|
@@ -8,36 +10,16 @@ import { createListCollection } from "@ark-ui/react/select";
|
|
|
8
10
|
import { FlexRender, cellSpanningFeature, columnFilteringFeature, columnOrderingFeature, columnPinningFeature, columnSizingFeature, columnVisibilityFeature, createColumnHelper, createExpandedRowModel, createFilteredRowModel, createPaginatedRowModel, createSortedRowModel, filterFn_arrIncludes, filterFn_equals, filterFn_inDateRange, filterFn_inNumberRange, filterFn_includesString, filterFn_weakEquals, globalFilteringFeature, rowExpandingFeature, rowPaginationFeature, rowSelectionFeature, rowSortingFeature, sortFn_alphanumeric, sortFn_alphanumericCaseSensitive, sortFn_basic, sortFn_datetime, sortFn_text, sortFn_textCaseSensitive, tableFeatures, useTable } from "@tanstack/react-table";
|
|
9
11
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
10
12
|
//#region src/components/table/index.tsx
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return /* @__PURE__ */ jsx("svg", {
|
|
14
|
-
viewBox: "0 0 24 24",
|
|
13
|
+
function pageIcon(direction) {
|
|
14
|
+
return iconNode(direction === "start" ? "chevron-left" : "chevron-right", {
|
|
15
15
|
width: 14,
|
|
16
|
-
height: 14
|
|
17
|
-
fill: "none",
|
|
18
|
-
stroke: "currentColor",
|
|
19
|
-
strokeWidth: 2,
|
|
20
|
-
strokeLinecap: "round",
|
|
21
|
-
strokeLinejoin: "round",
|
|
22
|
-
"aria-hidden": "true",
|
|
23
|
-
children: /* @__PURE__ */ jsx("path", { d: direction === "start" ? "m15 18-6-6 6-6" : "m9 18 6-6-6-6" })
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
/** The page-size select's pointing chevron. */
|
|
27
|
-
function chevronDownGlyph() {
|
|
28
|
-
return /* @__PURE__ */ jsx("svg", {
|
|
29
|
-
viewBox: "0 0 24 24",
|
|
30
|
-
width: 14,
|
|
31
|
-
height: 14,
|
|
32
|
-
fill: "none",
|
|
33
|
-
stroke: "currentColor",
|
|
34
|
-
strokeWidth: 2.5,
|
|
35
|
-
strokeLinecap: "round",
|
|
36
|
-
strokeLinejoin: "round",
|
|
37
|
-
"aria-hidden": "true",
|
|
38
|
-
children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
|
|
16
|
+
height: 14
|
|
39
17
|
});
|
|
40
18
|
}
|
|
19
|
+
const chevronDownIcon = iconNode("chevron-down", {
|
|
20
|
+
width: 14,
|
|
21
|
+
height: 14
|
|
22
|
+
});
|
|
41
23
|
const SELECT_COL_ID = "__select";
|
|
42
24
|
const SELECT_COL_WIDTH = 48;
|
|
43
25
|
/** The list holding `id` and the index inside it, or null when absent. */
|
|
@@ -88,18 +70,7 @@ function mark(el, attr, on) {
|
|
|
88
70
|
if (on) el.setAttribute(attr, "");
|
|
89
71
|
else el.removeAttribute(attr);
|
|
90
72
|
}
|
|
91
|
-
|
|
92
|
-
return /* @__PURE__ */ jsx("svg", {
|
|
93
|
-
viewBox: "0 0 24 24",
|
|
94
|
-
fill: "none",
|
|
95
|
-
stroke: "currentColor",
|
|
96
|
-
strokeWidth: 2.5,
|
|
97
|
-
strokeLinecap: "round",
|
|
98
|
-
strokeLinejoin: "round",
|
|
99
|
-
"aria-hidden": true,
|
|
100
|
-
children: /* @__PURE__ */ jsx("path", { d: "m9 6 6 6-6 6" })
|
|
101
|
-
});
|
|
102
|
-
}
|
|
73
|
+
const chevronIcon = iconNode("chevron-right");
|
|
103
74
|
/** React keeps `indeterminate` off the JSX types; the DOM property is the
|
|
104
75
|
* only channel, so the checkbox owns its ref. */
|
|
105
76
|
function SelectBox(props) {
|
|
@@ -115,7 +86,7 @@ function SelectBox(props) {
|
|
|
115
86
|
onChange: props.onToggle
|
|
116
87
|
});
|
|
117
88
|
}
|
|
118
|
-
function
|
|
89
|
+
function DataTableImpl(rawProps) {
|
|
119
90
|
injectComponentStyle("table");
|
|
120
91
|
const props = rawProps;
|
|
121
92
|
const { selectable = false, sortable = true, filterable = false, showToolbar = true, tree = false, virtual: virtualProp = false, rowHeight = 40, paginated = false, pageSize = 10, pageSizeOptions = [
|
|
@@ -431,7 +402,7 @@ function DataTable(rawProps) {
|
|
|
431
402
|
const style = { ...pin.style };
|
|
432
403
|
delete pin.style;
|
|
433
404
|
const rowSpan = cell.getRowSpan();
|
|
434
|
-
if (rowSpan > 1) style
|
|
405
|
+
if (rowSpan > 1) style["--bs-table-row-span"] = String(rowSpan);
|
|
435
406
|
const spanned = rowSpan > 1 ? { "data-spanned": "" } : {};
|
|
436
407
|
let content;
|
|
437
408
|
if (column.id === SELECT_COL_ID) content = /* @__PURE__ */ jsx(SelectBox, {
|
|
@@ -452,7 +423,7 @@ function DataTable(rawProps) {
|
|
|
452
423
|
"data-leaf": !row.getCanExpand() || void 0,
|
|
453
424
|
"aria-label": row.getIsExpanded() ? messages.table.collapseRow : messages.table.expandRow,
|
|
454
425
|
onClick: () => row.toggleExpanded(),
|
|
455
|
-
children:
|
|
426
|
+
children: chevronIcon
|
|
456
427
|
}), /* @__PURE__ */ jsx(FlexRender, { cell })]
|
|
457
428
|
});
|
|
458
429
|
else content = /* @__PURE__ */ jsx(FlexRender, { cell });
|
|
@@ -509,11 +480,8 @@ function DataTable(rawProps) {
|
|
|
509
480
|
const style = {};
|
|
510
481
|
if (virtual) {
|
|
511
482
|
const item = virtualRows[virtualIndex];
|
|
512
|
-
style
|
|
513
|
-
style
|
|
514
|
-
style.inlineSize = "100%";
|
|
515
|
-
style.transform = `translateY(${item.start}px)`;
|
|
516
|
-
style.blockSize = `${item.size}px`;
|
|
483
|
+
style["--bs-table-virtual-row-start"] = `${item.start}px`;
|
|
484
|
+
style["--bs-table-virtual-row-size"] = `${item.size}px`;
|
|
517
485
|
}
|
|
518
486
|
return /* @__PURE__ */ jsx("div", {
|
|
519
487
|
role: "row",
|
|
@@ -564,10 +532,8 @@ function DataTable(rawProps) {
|
|
|
564
532
|
"data-scope": "table",
|
|
565
533
|
"data-part": "body",
|
|
566
534
|
"data-merge": mergeMode || void 0,
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
blockSize: `${totalSize}px`
|
|
570
|
-
} : void 0,
|
|
535
|
+
"data-virtual": virtual || void 0,
|
|
536
|
+
style: virtual ? { "--bs-table-virtual-total": `${totalSize}px` } : void 0,
|
|
571
537
|
children: [virtual ? virtualRows.map((_, index) => renderRow(rows[index], index)) : rows.map((row) => renderRow(row, -1)), rows.length === 0 ? /* @__PURE__ */ jsx("div", {
|
|
572
538
|
"data-scope": "table",
|
|
573
539
|
"data-part": "empty",
|
|
@@ -609,10 +575,13 @@ function DataTable(rawProps) {
|
|
|
609
575
|
positioning: { placement: "top-start" },
|
|
610
576
|
children: [/* @__PURE__ */ jsx(Select$1.Control, { children: /* @__PURE__ */ jsxs(Select$1.Trigger, {
|
|
611
577
|
"aria-label": messages.table.rowsPerPage,
|
|
612
|
-
children: [/* @__PURE__ */ jsx(Select$1.ValueText, {}), /* @__PURE__ */ jsx(Select$1.Indicator, { children:
|
|
578
|
+
children: [/* @__PURE__ */ jsx(Select$1.ValueText, {}), /* @__PURE__ */ jsx(Select$1.Indicator, { children: chevronDownIcon })]
|
|
613
579
|
}) }), /* @__PURE__ */ jsx(Select$1.Positioner, { children: /* @__PURE__ */ jsx(Select$1.Content, { children: sizeItems.items.map((item) => /* @__PURE__ */ jsxs(Select$1.Item, {
|
|
614
580
|
item,
|
|
615
|
-
children: [/* @__PURE__ */ jsx(Select$1.ItemText, { children: item.label }), /* @__PURE__ */ jsx(Select$1.ItemIndicator, { children: "
|
|
581
|
+
children: [/* @__PURE__ */ jsx(Select$1.ItemText, { children: item.label }), /* @__PURE__ */ jsx(Select$1.ItemIndicator, { children: iconNode("check", {
|
|
582
|
+
width: 14,
|
|
583
|
+
height: 14
|
|
584
|
+
}) })]
|
|
616
585
|
}, item.value)) }) })]
|
|
617
586
|
});
|
|
618
587
|
const pager = /* @__PURE__ */ jsxs(Pagination.Root, {
|
|
@@ -621,13 +590,13 @@ function DataTable(rawProps) {
|
|
|
621
590
|
page: pagination.pageIndex + 1,
|
|
622
591
|
onPageChange: (details) => table.setPageIndex(details.page - 1),
|
|
623
592
|
children: [
|
|
624
|
-
/* @__PURE__ */ jsx(Pagination.PrevTrigger, { children:
|
|
593
|
+
/* @__PURE__ */ jsx(Pagination.PrevTrigger, { children: pageIcon("start") }),
|
|
625
594
|
/* @__PURE__ */ jsx(Pagination.Context, { children: (scope) => scope.pages.map((page, index) => page.type === "ellipsis" ? /* @__PURE__ */ jsx(Pagination.Ellipsis, { index }, `e${index}`) : /* @__PURE__ */ jsx(Pagination.Item, {
|
|
626
595
|
type: "page",
|
|
627
596
|
value: page.value,
|
|
628
597
|
children: String(page.value)
|
|
629
598
|
}, page.value)) }),
|
|
630
|
-
/* @__PURE__ */ jsx(Pagination.NextTrigger, { children:
|
|
599
|
+
/* @__PURE__ */ jsx(Pagination.NextTrigger, { children: pageIcon("end") })
|
|
631
600
|
]
|
|
632
601
|
});
|
|
633
602
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -688,5 +657,6 @@ function DataTable(rawProps) {
|
|
|
688
657
|
]
|
|
689
658
|
});
|
|
690
659
|
}
|
|
660
|
+
const DataTable = withSelfRoot(DataTableImpl);
|
|
691
661
|
//#endregion
|
|
692
662
|
export { DataTable, FlexRender, createColumnHelper };
|
|
@@ -1,6 +1,27 @@
|
|
|
1
|
-
import { ComponentProps } from "react";
|
|
1
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
2
|
import { Tabs as Tabs$1 } from "@ark-ui/react/tabs";
|
|
3
3
|
//#region src/components/tabs/index.d.ts
|
|
4
|
+
export type TabsItem = {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
content?: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export interface TabsFacadeProps {
|
|
10
|
+
value?: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
items: TabsItem[];
|
|
13
|
+
/** The register: a ruled line (default), or each tab its own card. */
|
|
14
|
+
variant?: "line" | "card";
|
|
15
|
+
orientation?: "horizontal" | "vertical";
|
|
16
|
+
/** One rung of the control-height ladder for the tab rows. */
|
|
17
|
+
size?: "sm" | "md" | "lg";
|
|
18
|
+
className?: string;
|
|
19
|
+
onValueChange?: (value: string) => void;
|
|
20
|
+
}
|
|
21
|
+
declare function TabsFacade({ value, defaultValue, items, variant, orientation, size, className, onValueChange }: TabsFacadeProps): import("react").JSX.Element;
|
|
22
|
+
declare namespace TabsFacade {
|
|
23
|
+
var displayName: string;
|
|
24
|
+
}
|
|
4
25
|
type TabsRootProps = ComponentProps<typeof Tabs$1.Root> & {
|
|
5
26
|
/** One rung of the control-height ladder for the tab rows. */
|
|
6
27
|
size?: "sm" | "md" | "lg";
|
|
@@ -14,7 +35,8 @@ declare function TabsRoot({ size, variant, ...rest }: TabsRootProps): import("re
|
|
|
14
35
|
* Parts: Root, List, Trigger, Content, Indicator (machine-positioned ink
|
|
15
36
|
* bar on the list rule).
|
|
16
37
|
*/
|
|
17
|
-
|
|
38
|
+
type TabsParts = Omit<typeof Tabs$1, "Root"> & {
|
|
18
39
|
Root: typeof TabsRoot;
|
|
19
40
|
};
|
|
41
|
+
export declare const Tabs: typeof TabsFacade & TabsParts;
|
|
20
42
|
//#endregion
|
|
@@ -1,24 +1,40 @@
|
|
|
1
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { Tabs as Tabs$1 } from "@ark-ui/react/tabs";
|
|
4
5
|
//#region src/components/tabs/index.tsx
|
|
6
|
+
function TabsFacade({ value, defaultValue, items, variant = "line", orientation = "horizontal", size = "md", className, onValueChange }) {
|
|
7
|
+
return /* @__PURE__ */ jsxs(TabsRoot, {
|
|
8
|
+
className,
|
|
9
|
+
size,
|
|
10
|
+
variant,
|
|
11
|
+
orientation,
|
|
12
|
+
defaultValue,
|
|
13
|
+
...value === void 0 ? {} : { value },
|
|
14
|
+
onValueChange: (details) => onValueChange?.(details.value),
|
|
15
|
+
children: [/* @__PURE__ */ jsxs(Tabs$1.List, { children: [items.map((item) => /* @__PURE__ */ jsx(Tabs$1.Trigger, {
|
|
16
|
+
value: item.value,
|
|
17
|
+
children: item.label
|
|
18
|
+
}, item.value)), /* @__PURE__ */ jsx(Tabs$1.Indicator, {})] }), items.map((item) => /* @__PURE__ */ jsx(Tabs$1.Content, {
|
|
19
|
+
value: item.value,
|
|
20
|
+
children: item.content
|
|
21
|
+
}, item.value))]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
TabsFacade.displayName = "STabs";
|
|
5
25
|
function TabsRoot({ size = "md", variant = "line", ...rest }) {
|
|
26
|
+
const id = useElementId("tabs", rest);
|
|
6
27
|
return /* @__PURE__ */ jsx(Tabs$1.Root, {
|
|
7
28
|
...rest,
|
|
29
|
+
id,
|
|
8
30
|
"data-size": size,
|
|
9
31
|
"data-variant": variant
|
|
10
32
|
});
|
|
11
33
|
}
|
|
12
|
-
|
|
13
|
-
* Tabs — tabbed navigation.
|
|
14
|
-
*
|
|
15
|
-
* Parts: Root, List, Trigger, Content, Indicator (machine-positioned ink
|
|
16
|
-
* bar on the list rule).
|
|
17
|
-
*/
|
|
18
|
-
const Tabs = {
|
|
34
|
+
const Tabs = Object.assign(TabsFacade, {
|
|
19
35
|
...Tabs$1,
|
|
20
36
|
Root: TabsRoot
|
|
21
|
-
};
|
|
37
|
+
});
|
|
22
38
|
injectComponentStyle("tabs");
|
|
23
39
|
//#endregion
|
|
24
40
|
export { Tabs };
|
|
@@ -1,17 +1,42 @@
|
|
|
1
|
-
import { ComponentProps } from "react";
|
|
1
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
2
|
import { TagsInput as TagsInput$1 } from "@ark-ui/react/tags-input";
|
|
3
3
|
//#region src/components/tags-input/index.d.ts
|
|
4
4
|
type TagsInputRootProps = ComponentProps<typeof TagsInput$1.Root> & {
|
|
5
5
|
/** One rung of the control-height ladder for the vessel at rest. */
|
|
6
6
|
size?: "sm" | "md" | "lg";
|
|
7
7
|
};
|
|
8
|
-
declare function TagsInputRoot(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
declare function TagsInputRoot(props: TagsInputRootProps): import("react").JSX.Element;
|
|
9
|
+
interface TagsInputFacadeProps {
|
|
10
|
+
value?: string[];
|
|
11
|
+
defaultValue?: string[];
|
|
12
|
+
label?: string;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
invalid?: boolean;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
/** Show the clear-all control when values exist. */
|
|
18
|
+
clearable?: boolean;
|
|
19
|
+
size?: "sm" | "md" | "lg";
|
|
20
|
+
onValueChange?: (value: string[]) => void;
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/** The one-tag path: one labelled vessel whose values become editable
|
|
24
|
+
* chips. Delimiters, limits, and custom validation stay on the anatomy. */
|
|
25
|
+
declare function TagsInputFacade({ value, defaultValue, label, placeholder, disabled, invalid, required, clearable, size, onValueChange }: TagsInputFacadeProps): import("react").JSX.Element;
|
|
26
|
+
export declare const TagsInput: typeof TagsInputFacade & {
|
|
15
27
|
Root: typeof TagsInputRoot;
|
|
28
|
+
ClearTrigger: import("react").ForwardRefExoticComponent<TagsInput$1.ClearTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
29
|
+
Context: (props: TagsInput$1.ContextProps) => ReactNode;
|
|
30
|
+
Control: import("react").ForwardRefExoticComponent<TagsInput$1.ControlProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
31
|
+
HiddenInput: import("react").ForwardRefExoticComponent<TagsInput$1.HiddenInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
32
|
+
Input: import("react").ForwardRefExoticComponent<TagsInput$1.InputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
33
|
+
Item: import("react").ForwardRefExoticComponent<TagsInput$1.ItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
34
|
+
ItemContext: (props: TagsInput$1.ItemContextProps) => ReactNode;
|
|
35
|
+
ItemDeleteTrigger: import("react").ForwardRefExoticComponent<TagsInput$1.ItemDeleteTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
36
|
+
ItemInput: import("react").ForwardRefExoticComponent<TagsInput$1.ItemInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
37
|
+
ItemPreview: import("react").ForwardRefExoticComponent<TagsInput$1.ItemPreviewProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
38
|
+
ItemText: import("react").ForwardRefExoticComponent<TagsInput$1.ItemTextProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
39
|
+
Label: import("react").ForwardRefExoticComponent<TagsInput$1.LabelProps & import("react").RefAttributes<HTMLLabelElement>>;
|
|
40
|
+
RootProvider: import("react").ForwardRefExoticComponent<TagsInput$1.RootProviderProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
41
|
};
|
|
17
42
|
//#endregion
|
|
@@ -1,22 +1,54 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
5
|
import { TagsInput as TagsInput$1 } from "@ark-ui/react/tags-input";
|
|
4
6
|
//#region src/components/tags-input/index.tsx
|
|
5
|
-
function TagsInputRoot(
|
|
7
|
+
function TagsInputRoot(props) {
|
|
8
|
+
const id = useElementId("tags-input", props);
|
|
9
|
+
const { size = "md", ...rest } = props;
|
|
6
10
|
return /* @__PURE__ */ jsx(TagsInput$1.Root, {
|
|
7
11
|
...rest,
|
|
12
|
+
id,
|
|
8
13
|
"data-size": size
|
|
9
14
|
});
|
|
10
15
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
const closeIcon = iconNode("x", {
|
|
17
|
+
width: 14,
|
|
18
|
+
height: 14
|
|
19
|
+
});
|
|
20
|
+
/** The one-tag path: one labelled vessel whose values become editable
|
|
21
|
+
* chips. Delimiters, limits, and custom validation stay on the anatomy. */
|
|
22
|
+
function TagsInputFacade({ value, defaultValue, label, placeholder, disabled = false, invalid = false, required = false, clearable = true, size = "md", onValueChange }) {
|
|
23
|
+
return /* @__PURE__ */ jsxs(TagsInputRoot, {
|
|
24
|
+
size,
|
|
25
|
+
disabled,
|
|
26
|
+
invalid,
|
|
27
|
+
required,
|
|
28
|
+
defaultValue,
|
|
29
|
+
...value === void 0 ? {} : {
|
|
30
|
+
value,
|
|
31
|
+
onValueChange: (details) => onValueChange?.(details.value)
|
|
32
|
+
},
|
|
33
|
+
children: [
|
|
34
|
+
label ? /* @__PURE__ */ jsx(TagsInput$1.Label, { children: label }) : null,
|
|
35
|
+
/* @__PURE__ */ jsxs(TagsInput$1.Control, { children: [
|
|
36
|
+
/* @__PURE__ */ jsx(TagsInput$1.Context, { children: (tagsInput) => tagsInput.value.map((tag, index) => /* @__PURE__ */ jsxs(TagsInput$1.Item, {
|
|
37
|
+
index,
|
|
38
|
+
value: tag,
|
|
39
|
+
children: [/* @__PURE__ */ jsxs(TagsInput$1.ItemPreview, { children: [/* @__PURE__ */ jsx(TagsInput$1.ItemText, { children: tag }), /* @__PURE__ */ jsx(TagsInput$1.ItemDeleteTrigger, { children: closeIcon })] }), /* @__PURE__ */ jsx(TagsInput$1.ItemInput, {})]
|
|
40
|
+
}, `${tag}-${index}`)) }),
|
|
41
|
+
/* @__PURE__ */ jsx(TagsInput$1.Input, { placeholder }),
|
|
42
|
+
clearable ? /* @__PURE__ */ jsx(TagsInput$1.ClearTrigger, { children: closeIcon }) : null
|
|
43
|
+
] }),
|
|
44
|
+
/* @__PURE__ */ jsx(TagsInput$1.HiddenInput, {})
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const TagsInput = Object.assign(TagsInputFacade, {
|
|
17
49
|
...TagsInput$1,
|
|
18
50
|
Root: TagsInputRoot
|
|
19
|
-
};
|
|
51
|
+
});
|
|
20
52
|
injectComponentStyle("tags-input");
|
|
21
53
|
//#endregion
|
|
22
54
|
export { TagsInput };
|
|
@@ -13,5 +13,8 @@ export interface TerminalProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
13
13
|
* component owns only the reading and the caret — each entered line
|
|
14
14
|
* leaves as an event, and the caller answers through the lines prop,
|
|
15
15
|
* so history stays theirs to shape. */
|
|
16
|
-
|
|
16
|
+
declare function TerminalImpl({ lines, prompt, placeholder, label, onCommand, ...rest }: TerminalProps): import("react").JSX.Element;
|
|
17
|
+
export declare const Terminal: typeof TerminalImpl & {
|
|
18
|
+
Root: typeof TerminalImpl;
|
|
19
|
+
};
|
|
17
20
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
2
|
import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
|
|
2
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -7,7 +8,7 @@ import { useEffect, useRef, useState } from "react";
|
|
|
7
8
|
* component owns only the reading and the caret — each entered line
|
|
8
9
|
* leaves as an event, and the caller answers through the lines prop,
|
|
9
10
|
* so history stays theirs to shape. */
|
|
10
|
-
function
|
|
11
|
+
function TerminalImpl({ lines = [], prompt = "$", placeholder, label, onCommand, ...rest }) {
|
|
11
12
|
injectComponentStyle("terminal");
|
|
12
13
|
const messages = useComponentMessages();
|
|
13
14
|
const commandLineLabel = label ?? messages.terminal.commandLine;
|
|
@@ -64,5 +65,6 @@ function Terminal({ lines = [], prompt = "$", placeholder, label, onCommand, ...
|
|
|
64
65
|
})]
|
|
65
66
|
});
|
|
66
67
|
}
|
|
68
|
+
const Terminal = withSelfRoot(TerminalImpl);
|
|
67
69
|
//#endregion
|
|
68
70
|
export { Terminal };
|
|
@@ -10,5 +10,8 @@ export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElemen
|
|
|
10
10
|
invalid?: boolean;
|
|
11
11
|
onValueChange?: (value: string) => void;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
declare function TextareaImpl({ value, invalid, onValueChange, ...rest }: TextareaProps): import("react").JSX.Element;
|
|
14
|
+
export declare const Textarea: typeof TextareaImpl & {
|
|
15
|
+
Root: typeof TextareaImpl;
|
|
16
|
+
};
|
|
14
17
|
//#endregion
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { useFieldContext } from "@ark-ui/react/field";
|
|
4
5
|
//#region src/components/textarea/index.tsx
|
|
5
|
-
function
|
|
6
|
+
function TextareaImpl({ value, invalid = false, onValueChange, ...rest }) {
|
|
6
7
|
injectComponentStyle("textarea");
|
|
7
8
|
const field = useFieldContext();
|
|
8
9
|
const fieldProps = field?.getTextareaProps() ?? {};
|
|
@@ -16,5 +17,6 @@ function Textarea({ value, invalid = false, onValueChange, ...rest }) {
|
|
|
16
17
|
onChange: (event) => onValueChange?.(event.target.value)
|
|
17
18
|
});
|
|
18
19
|
}
|
|
20
|
+
const Textarea = withSelfRoot(TextareaImpl);
|
|
19
21
|
//#endregion
|
|
20
22
|
export { Textarea };
|
|
@@ -1,8 +1,25 @@
|
|
|
1
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
1
2
|
import { Timer as Timer$1 } from "@ark-ui/react/timer";
|
|
2
3
|
//#region src/components/timer/index.d.ts
|
|
3
4
|
/** Ark's Timer, dressed in the paper-and-ink system: monospaced digits
|
|
4
5
|
* that never jitter, quiet action triggers on the control recipe. The API
|
|
5
6
|
* is Ark's own — Root, Area, Control, Item, Separator, ActionTrigger,
|
|
6
7
|
* Context. Unit labels are plain content, not a machine part. */
|
|
7
|
-
|
|
8
|
+
declare function TimerRoot(props: ComponentProps<typeof Timer$1.Root>): import("react").JSX.Element;
|
|
9
|
+
type TimerFacadeProps = {
|
|
10
|
+
startMs?: number;
|
|
11
|
+
targetMs?: number;
|
|
12
|
+
countdown?: boolean;
|
|
13
|
+
autoStart?: boolean;
|
|
14
|
+
label?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
style?: CSSProperties;
|
|
17
|
+
};
|
|
18
|
+
/** The complete timer behind one duration: minute and second digits with
|
|
19
|
+
* start, pause, resume, and reset. Finer intervals and custom faces remain
|
|
20
|
+
* anatomy work. */
|
|
21
|
+
declare function TimerFacade(props: TimerFacadeProps): import("react").JSX.Element;
|
|
22
|
+
export declare const Timer: typeof TimerFacade & Omit<typeof Timer$1, "Root"> & {
|
|
23
|
+
Root: typeof TimerRoot;
|
|
24
|
+
};
|
|
8
25
|
//#endregion
|
|
@@ -1,11 +1,60 @@
|
|
|
1
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
4
|
import { Timer as Timer$1 } from "@ark-ui/react/timer";
|
|
3
5
|
//#region src/components/timer/index.tsx
|
|
4
6
|
/** Ark's Timer, dressed in the paper-and-ink system: monospaced digits
|
|
5
7
|
* that never jitter, quiet action triggers on the control recipe. The API
|
|
6
8
|
* is Ark's own — Root, Area, Control, Item, Separator, ActionTrigger,
|
|
7
9
|
* Context. Unit labels are plain content, not a machine part. */
|
|
8
|
-
|
|
9
|
-
injectComponentStyle("timer");
|
|
10
|
+
function TimerRoot(props) {
|
|
11
|
+
injectComponentStyle("timer");
|
|
12
|
+
const id = useElementId("timer", props);
|
|
13
|
+
return /* @__PURE__ */ jsx(Timer$1.Root, {
|
|
14
|
+
...props,
|
|
15
|
+
id
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/** The complete timer behind one duration: minute and second digits with
|
|
19
|
+
* start, pause, resume, and reset. Finer intervals and custom faces remain
|
|
20
|
+
* anatomy work. */
|
|
21
|
+
function TimerFacade(props) {
|
|
22
|
+
const { startMs = 0, targetMs, countdown, autoStart, label, className, style } = props;
|
|
23
|
+
return /* @__PURE__ */ jsxs(TimerRoot, {
|
|
24
|
+
"aria-label": label,
|
|
25
|
+
startMs,
|
|
26
|
+
targetMs,
|
|
27
|
+
countdown,
|
|
28
|
+
autoStart,
|
|
29
|
+
className,
|
|
30
|
+
style,
|
|
31
|
+
children: [/* @__PURE__ */ jsxs(Timer$1.Area, { children: [
|
|
32
|
+
/* @__PURE__ */ jsx(Timer$1.Item, { type: "minutes" }),
|
|
33
|
+
/* @__PURE__ */ jsx(Timer$1.Separator, { children: ":" }),
|
|
34
|
+
/* @__PURE__ */ jsx(Timer$1.Item, { type: "seconds" })
|
|
35
|
+
] }), /* @__PURE__ */ jsxs(Timer$1.Control, { children: [
|
|
36
|
+
/* @__PURE__ */ jsx(Timer$1.ActionTrigger, {
|
|
37
|
+
action: "start",
|
|
38
|
+
children: "Start"
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ jsx(Timer$1.ActionTrigger, {
|
|
41
|
+
action: "pause",
|
|
42
|
+
children: "Pause"
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ jsx(Timer$1.ActionTrigger, {
|
|
45
|
+
action: "resume",
|
|
46
|
+
children: "Resume"
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ jsx(Timer$1.ActionTrigger, {
|
|
49
|
+
action: "reset",
|
|
50
|
+
children: "Reset"
|
|
51
|
+
})
|
|
52
|
+
] })]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const Timer = Object.assign(TimerFacade, {
|
|
56
|
+
...Timer$1,
|
|
57
|
+
Root: TimerRoot
|
|
58
|
+
});
|
|
10
59
|
//#endregion
|
|
11
60
|
export { Timer };
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { CreateToasterReturn, Toast as Toast$1, createToaster } from "@ark-ui/react/toast";
|
|
2
2
|
//#region src/components/toast/index.d.ts
|
|
3
|
-
/** Ark's Toast, dressed in the paper-and-ink system: each notice rides the
|
|
4
|
-
* popup vessel while a pigment accents the title by type, and the machine's
|
|
5
|
-
* translate variables carry the slide. The API is Ark's own — Toaster,
|
|
6
|
-
* Root, Title, Description, ActionTrigger, CloseTrigger, plus
|
|
7
|
-
* createToaster. */
|
|
8
3
|
export declare const Toast: typeof Toast$1;
|
|
9
|
-
export declare const Toaster: import("react").ForwardRefExoticComponent<import("@ark-ui/react/toast").ToasterProps & import("react").RefAttributes<HTMLDivElement
|
|
4
|
+
export declare const Toaster: import("react").ForwardRefExoticComponent<import("@ark-ui/react/toast").ToasterProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
5
|
+
Root: import("react").ForwardRefExoticComponent<import("@ark-ui/react/toast").ToasterProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
};
|
|
10
7
|
//#endregion
|
|
11
8
|
export { type CreateToasterReturn, createToaster };
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
2
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { forwardRef } from "react";
|
|
2
6
|
import { Toast as Toast$1, Toaster as Toaster$1, createToaster } from "@ark-ui/react/toast";
|
|
3
7
|
//#region src/components/toast/index.tsx
|
|
4
8
|
/** Ark's Toast, dressed in the paper-and-ink system: each notice rides the
|
|
@@ -6,8 +10,24 @@ import { Toast as Toast$1, Toaster as Toaster$1, createToaster } from "@ark-ui/r
|
|
|
6
10
|
* translate variables carry the slide. The API is Ark's own — Toaster,
|
|
7
11
|
* Root, Title, Description, ActionTrigger, CloseTrigger, plus
|
|
8
12
|
* createToaster. */
|
|
9
|
-
|
|
10
|
-
const
|
|
13
|
+
function ToastRoot(props) {
|
|
14
|
+
const id = useElementId("toast", props);
|
|
15
|
+
return /* @__PURE__ */ jsx(Toast$1.Root, {
|
|
16
|
+
...props,
|
|
17
|
+
id
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
const Toast = {
|
|
21
|
+
...Toast$1,
|
|
22
|
+
Root: ToastRoot
|
|
23
|
+
};
|
|
24
|
+
const ToasterRoot = forwardRef(function ToasterRoot(props, ref) {
|
|
25
|
+
return /* @__PURE__ */ jsx(Toaster$1, {
|
|
26
|
+
ref,
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
const Toaster = withSelfRoot(ToasterRoot);
|
|
11
31
|
injectComponentStyle("toast");
|
|
12
32
|
//#endregion
|
|
13
33
|
export { Toast, Toaster, createToaster };
|
|
@@ -1,13 +1,27 @@
|
|
|
1
|
-
import { ComponentProps } from "react";
|
|
2
|
-
import { Toc as Toc$1 } from "@ark-ui/react/toc";
|
|
1
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
2
|
+
import { Toc as Toc$1, TocItemData } from "@ark-ui/react/toc";
|
|
3
3
|
//#region src/components/toc/index.d.ts
|
|
4
|
-
/**
|
|
4
|
+
/** Toc, dressed in the paper-and-ink system: a quiet rail of links
|
|
5
5
|
* beside the scroll, one stroke of primary ink marking where the reader
|
|
6
|
-
* stands. The
|
|
6
|
+
* stands. The parts — Root, Title, List, Item, Link, Indicator. */
|
|
7
|
+
declare function TocRoot(props: ComponentProps<typeof Toc$1.Root>): import("react").JSX.Element;
|
|
7
8
|
/** The active stroke is decoration; hidden so the list reads as links
|
|
8
9
|
* alone. */
|
|
9
10
|
declare function TocIndicator(props: ComponentProps<typeof Toc$1.Indicator>): import("react").JSX.Element;
|
|
10
|
-
export
|
|
11
|
+
export interface TocFacadeProps {
|
|
12
|
+
items: Array<TocItemData & {
|
|
13
|
+
label: string;
|
|
14
|
+
}>;
|
|
15
|
+
scrollEl?: () => HTMLElement | null;
|
|
16
|
+
title?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
style?: CSSProperties;
|
|
19
|
+
}
|
|
20
|
+
/** The complete rail behind one page: items become anchor rows, the
|
|
21
|
+
* title names the list, and the active stroke follows the scroller. */
|
|
22
|
+
declare function TocFacade({ items, scrollEl, title, className, style }: TocFacadeProps): import("react").JSX.Element;
|
|
23
|
+
export declare const Toc: typeof TocFacade & Omit<typeof Toc$1, "Root" | "Indicator"> & {
|
|
24
|
+
Root: typeof TocRoot;
|
|
11
25
|
Indicator: typeof TocIndicator;
|
|
12
26
|
};
|
|
13
27
|
//#endregion
|