@bysages/react 0.3.1 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ai-response-BfKTmtCt.mjs → ai-response-nhDOlELQ.mjs} +4 -2
- package/dist/chevron-a2nIZKN4.mjs +6 -0
- package/dist/components/accordion/index.d.mts +22 -4
- package/dist/components/accordion/index.mjs +32 -2
- package/dist/components/affix/index.d.mts +4 -1
- package/dist/components/affix/index.mjs +6 -4
- package/dist/components/ai/index.d.mts +1 -1
- package/dist/components/ai/index.mjs +6 -4
- package/dist/components/ai-action/index.d.mts +4 -1
- package/dist/components/ai-action/index.mjs +4 -2
- package/dist/components/ai-attachments/index.d.mts +10 -4
- package/dist/components/ai-attachments/index.mjs +17 -45
- package/dist/components/ai-message/index.d.mts +4 -1
- package/dist/components/ai-message/index.mjs +4 -2
- package/dist/components/ai-prompt-input/index.d.mts +5 -2
- package/dist/components/ai-prompt-input/index.mjs +11 -15
- package/dist/components/ai-reasoning/index.d.mts +4 -1
- package/dist/components/ai-reasoning/index.mjs +5 -3
- 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 +6 -3
- package/dist/components/ai-suggestion/index.d.mts +4 -1
- package/dist/components/ai-suggestion/index.mjs +4 -2
- package/dist/components/ai-tool/index.d.mts +4 -1
- package/dist/components/ai-tool/index.mjs +5 -3
- package/dist/components/alert/index.d.mts +2 -0
- package/dist/components/alert/index.mjs +12 -19
- package/dist/components/angle-slider/index.d.mts +19 -2
- package/dist/components/angle-slider/index.mjs +32 -9
- package/dist/components/aspect-ratio/index.d.mts +4 -1
- package/dist/components/aspect-ratio/index.mjs +4 -2
- package/dist/components/autocomplete/index.d.mts +3 -1
- package/dist/components/autocomplete/index.mjs +15 -3
- package/dist/components/avatar/index.d.mts +2 -2
- package/dist/components/avatar/index.mjs +10 -3
- package/dist/components/avatar-group/index.d.mts +4 -1
- package/dist/components/avatar-group/index.mjs +4 -2
- package/dist/components/back-top/index.d.mts +7 -1
- package/dist/components/back-top/index.mjs +13 -18
- package/dist/components/badge/index.d.mts +4 -1
- package/dist/components/badge/index.mjs +4 -2
- package/dist/components/banner/index.mjs +3 -12
- package/dist/components/bento/index.mjs +1 -1
- package/dist/components/block-ui/index.d.mts +4 -1
- package/dist/components/block-ui/index.mjs +4 -2
- package/dist/components/breadcrumb/index.mjs +1 -1
- package/dist/components/browser/index.mjs +1 -1
- package/dist/components/button/index.d.mts +4 -1
- package/dist/components/button/index.mjs +4 -2
- package/dist/components/button-group/index.mjs +1 -1
- package/dist/components/calendar/index.d.mts +3 -1
- package/dist/components/calendar/index.mjs +10 -11
- package/dist/components/card/index.mjs +1 -1
- package/dist/components/carousel/index.d.mts +21 -1
- package/dist/components/carousel/index.mjs +44 -3
- package/dist/components/cascade-select/index.d.mts +6 -1
- package/dist/components/cascade-select/index.mjs +13 -36
- package/dist/components/checkbox/index.d.mts +20 -2
- package/dist/components/checkbox/index.mjs +29 -9
- package/dist/components/checkbox-group/index.d.mts +8 -6
- package/dist/components/checkbox-group/index.mjs +45 -49
- package/dist/components/chip/index.d.mts +4 -1
- package/dist/components/chip/index.mjs +4 -2
- 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 +34 -6
- package/dist/components/collapsible/index.d.mts +16 -4
- package/dist/components/collapsible/index.mjs +26 -2
- package/dist/components/color-picker/index.d.mts +20 -4
- package/dist/components/color-picker/index.mjs +57 -15
- package/dist/components/combobox/index.d.mts +27 -1
- package/dist/components/combobox/index.mjs +63 -6
- package/dist/components/command/index.d.mts +4 -1
- package/dist/components/command/index.mjs +8 -2
- package/dist/components/comment/index.d.mts +4 -1
- package/dist/components/comment/index.mjs +4 -2
- 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 +4 -2
- package/dist/components/data-view/index.d.mts +4 -1
- package/dist/components/data-view/index.mjs +4 -2
- package/dist/components/date-input/index.d.mts +19 -4
- package/dist/components/date-input/index.mjs +34 -10
- package/dist/components/date-picker/index.d.mts +21 -4
- package/dist/components/date-picker/index.mjs +59 -12
- package/dist/components/deferred-content/index.d.mts +4 -1
- package/dist/components/deferred-content/index.mjs +4 -2
- package/dist/components/descriptions/index.d.mts +10 -2
- package/dist/components/descriptions/index.mjs +14 -9
- package/dist/components/dialog/index.d.mts +18 -5
- package/dist/components/dialog/index.mjs +44 -2
- package/dist/components/dock/index.mjs +1 -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 +41 -2
- package/dist/components/dynamic-input/index.d.mts +4 -1
- package/dist/components/dynamic-input/index.mjs +11 -19
- package/dist/components/editable/index.d.mts +28 -7
- package/dist/components/editable/index.mjs +44 -5
- package/dist/components/ellipsis/index.d.mts +4 -1
- package/dist/components/ellipsis/index.mjs +4 -2
- package/dist/components/empty/index.mjs +1 -1
- package/dist/components/field/index.d.mts +30 -5
- package/dist/components/field/index.mjs +37 -4
- package/dist/components/fieldset/index.d.mts +19 -4
- package/dist/components/fieldset/index.mjs +29 -4
- package/dist/components/file-upload/index.d.mts +29 -9
- package/dist/components/file-upload/index.mjs +47 -11
- package/dist/components/float-button/index.mjs +1 -1
- package/dist/components/floating-panel/index.d.mts +18 -6
- package/dist/components/floating-panel/index.mjs +56 -2
- 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 +6 -3
- 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 +4 -2
- package/dist/components/highlight/index.d.mts +3 -5
- package/dist/components/highlight/index.mjs +7 -2
- package/dist/components/hover-card/index.d.mts +20 -4
- package/dist/components/hover-card/index.mjs +33 -2
- package/dist/components/icon/index.d.mts +10 -8
- package/dist/components/icon/index.mjs +6 -4
- package/dist/components/image/index.d.mts +5 -2
- package/dist/components/image/index.mjs +15 -30
- package/dist/components/image-cropper/index.d.mts +13 -2
- package/dist/components/image-cropper/index.mjs +35 -3
- 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/input-group/index.mjs +1 -1
- package/dist/components/json-tree-view/index.d.mts +17 -1
- package/dist/components/json-tree-view/index.mjs +27 -6
- package/dist/components/kbd/index.d.mts +4 -1
- package/dist/components/kbd/index.mjs +4 -2
- package/dist/components/layout/index.d.mts +25 -7
- package/dist/components/layout/index.mjs +158 -64
- package/dist/components/link/index.d.mts +4 -1
- package/dist/components/link/index.mjs +4 -2
- package/dist/components/list/index.mjs +1 -1
- package/dist/components/listbox/index.d.mts +22 -1
- package/dist/components/listbox/index.mjs +37 -5
- package/dist/components/marquee/index.d.mts +18 -1
- package/dist/components/marquee/index.mjs +35 -3
- package/dist/components/masonry/index.d.mts +4 -1
- package/dist/components/masonry/index.mjs +4 -2
- 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 +35 -13
- package/dist/components/menubar/index.d.mts +3 -1
- package/dist/components/menubar/index.mjs +7 -2
- package/dist/components/meter/index.mjs +1 -1
- package/dist/components/navigation-menu/index.d.mts +25 -1
- package/dist/components/navigation-menu/index.mjs +37 -2
- package/dist/components/number-input/index.d.mts +28 -6
- package/dist/components/number-input/index.mjs +34 -9
- package/dist/components/order-list/index.d.mts +4 -1
- package/dist/components/order-list/index.mjs +27 -25
- package/dist/components/page-header/index.mjs +1 -1
- package/dist/components/pagination/index.d.mts +23 -3
- package/dist/components/pagination/index.mjs +58 -13
- package/dist/components/password-input/index.d.mts +24 -6
- package/dist/components/password-input/index.mjs +32 -9
- package/dist/components/pin-input/index.d.mts +23 -5
- package/dist/components/pin-input/index.mjs +30 -8
- package/dist/components/popconfirm/index.d.mts +9 -5
- package/dist/components/popconfirm/index.mjs +24 -19
- package/dist/components/popover/index.d.mts +2 -8
- package/dist/components/popover/index.mjs +45 -5
- 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 +35 -10
- package/dist/components/progress-group/index.d.mts +4 -1
- package/dist/components/progress-group/index.mjs +5 -3
- package/dist/components/qr-code/index.d.mts +14 -1
- package/dist/components/qr-code/index.mjs +27 -3
- package/dist/components/radio-group/index.d.mts +27 -2
- package/dist/components/radio-group/index.mjs +33 -9
- package/dist/components/rating-group/index.d.mts +20 -3
- package/dist/components/rating-group/index.mjs +27 -9
- package/dist/components/result/index.d.mts +1 -1
- package/dist/components/result/index.mjs +3 -3
- package/dist/components/scroll-area/index.d.mts +14 -1
- package/dist/components/scroll-area/index.mjs +33 -3
- package/dist/components/segment-group/index.d.mts +28 -2
- package/dist/components/segment-group/index.mjs +35 -8
- 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 +4 -2
- package/dist/components/signature-pad/index.d.mts +25 -5
- package/dist/components/signature-pad/index.mjs +38 -4
- package/dist/components/skeleton/index.d.mts +4 -1
- package/dist/components/skeleton/index.mjs +4 -2
- package/dist/components/slider/index.d.mts +21 -2
- package/dist/components/slider/index.mjs +32 -9
- package/dist/components/spinner/index.d.mts +4 -1
- package/dist/components/spinner/index.mjs +4 -2
- package/dist/components/split-button/index.d.mts +3 -1
- package/dist/components/split-button/index.mjs +13 -18
- package/dist/components/splitter/index.d.mts +17 -4
- package/dist/components/splitter/index.mjs +36 -2
- package/dist/components/spotlight/index.d.mts +4 -1
- package/dist/components/spotlight/index.mjs +4 -2
- package/dist/components/stack/index.d.mts +4 -1
- package/dist/components/stack/index.mjs +7 -5
- package/dist/components/stat/index.mjs +1 -1
- package/dist/components/steps/index.d.mts +26 -6
- package/dist/components/steps/index.mjs +27 -12
- package/dist/components/swap/index.d.mts +11 -5
- package/dist/components/swap/index.mjs +31 -4
- package/dist/components/switch/index.d.mts +20 -2
- package/dist/components/switch/index.mjs +28 -9
- package/dist/components/table/index.d.mts +4 -1
- package/dist/components/table/index.mjs +38 -60
- package/dist/components/tabs/index.d.mts +24 -2
- package/dist/components/tabs/index.mjs +26 -10
- package/dist/components/tags-input/index.d.mts +33 -8
- package/dist/components/tags-input/index.mjs +42 -10
- package/dist/components/terminal/index.d.mts +4 -1
- package/dist/components/terminal/index.mjs +4 -2
- package/dist/components/textarea/index.d.mts +4 -1
- package/dist/components/textarea/index.mjs +4 -2
- package/dist/components/timeline/index.mjs +1 -1
- package/dist/components/timer/index.d.mts +18 -1
- package/dist/components/timer/index.mjs +52 -3
- package/dist/components/toast/index.d.mts +3 -6
- package/dist/components/toast/index.mjs +23 -3
- package/dist/components/toc/index.d.mts +19 -5
- package/dist/components/toc/index.mjs +32 -6
- package/dist/components/toggle/index.d.mts +11 -4
- package/dist/components/toggle/index.mjs +22 -2
- package/dist/components/toggle-group/index.d.mts +26 -2
- package/dist/components/toggle-group/index.mjs +32 -7
- package/dist/components/toolbar/index.d.mts +4 -1
- package/dist/components/toolbar/index.mjs +4 -2
- package/dist/components/tooltip/index.d.mts +17 -4
- package/dist/components/tooltip/index.mjs +29 -2
- package/dist/components/tour/index.d.mts +18 -9
- package/dist/components/tour/index.mjs +45 -3
- package/dist/components/transfer/index.d.mts +3 -1
- package/dist/components/transfer/index.mjs +15 -27
- package/dist/components/tree-select/index.d.mts +3 -1
- package/dist/components/tree-select/index.mjs +12 -23
- package/dist/components/tree-view/index.d.mts +22 -2
- package/dist/components/tree-view/index.mjs +51 -9
- package/dist/components/typography/index.d.mts +4 -0
- package/dist/components/typography/index.mjs +2 -1
- package/dist/components/user/index.d.mts +4 -1
- package/dist/components/user/index.mjs +4 -2
- package/dist/components/virtual-list/index.d.mts +4 -1
- package/dist/components/virtual-list/index.mjs +11 -13
- package/dist/components/watermark/index.d.mts +4 -1
- package/dist/components/watermark/index.mjs +5 -3
- 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-B-hKFkEw.mjs +141 -0
- package/dist/{index-Dn5mHf1g.d.mts → index-B4twHAQC.d.mts} +194 -106
- 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-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-BDpQ0e6G.mjs} +4 -2
- package/dist/media-player-DjVvo1_7.mjs +554 -0
- package/dist/{mentions-DMIBCBOd.mjs → mentions-BwnyvdXz.mjs} +75 -43
- package/dist/select-i9UZsQCU.mjs +121 -0
- package/package.json +9 -81
- package/dist/chevron-BeHvt46K.mjs +0 -17
- package/dist/glyph-VI989p8H.mjs +0 -14
- package/dist/select-eAHutw56.mjs +0 -70
|
@@ -1,10 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
2
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { isValidElement } from "react";
|
|
2
5
|
import { Tooltip as Tooltip$1 } from "@ark-ui/react/tooltip";
|
|
3
6
|
//#region src/components/tooltip/index.tsx
|
|
4
7
|
/** Ark's Tooltip, dressed in the paper-and-ink system: the smallest
|
|
5
8
|
* vessel — a tight chip of ink that dissolves in over its anchor. The
|
|
6
9
|
* API is Ark's own — Root, Trigger, Positioner, Content, Arrow, ArrowTip. */
|
|
7
|
-
|
|
10
|
+
function TooltipRoot(props) {
|
|
11
|
+
const id = useElementId("tooltip", props);
|
|
12
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Root, {
|
|
13
|
+
...props,
|
|
14
|
+
id
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function TooltipFacade({ open, defaultOpen, trigger, content, disabled = false, placement, onOpenChange }) {
|
|
18
|
+
return /* @__PURE__ */ jsxs(TooltipRoot, {
|
|
19
|
+
...placement === void 0 ? {} : { positioning: { placement } },
|
|
20
|
+
...open === void 0 ? {} : { open },
|
|
21
|
+
...defaultOpen === void 0 ? {} : { defaultOpen },
|
|
22
|
+
onOpenChange: (details) => onOpenChange?.(details.open),
|
|
23
|
+
children: [/* @__PURE__ */ jsx(Tooltip$1.Trigger, {
|
|
24
|
+
asChild: isValidElement(trigger),
|
|
25
|
+
disabled,
|
|
26
|
+
children: trigger
|
|
27
|
+
}), /* @__PURE__ */ jsx(Tooltip$1.Positioner, { children: /* @__PURE__ */ jsxs(Tooltip$1.Content, { children: [/* @__PURE__ */ jsx(Tooltip$1.Arrow, { children: /* @__PURE__ */ jsx(Tooltip$1.ArrowTip, {}) }), content] }) })]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
TooltipFacade.displayName = "STooltip";
|
|
31
|
+
const Tooltip = Object.assign(TooltipFacade, {
|
|
32
|
+
...Tooltip$1,
|
|
33
|
+
Root: TooltipRoot
|
|
34
|
+
});
|
|
8
35
|
injectComponentStyle("tooltip");
|
|
9
36
|
//#endregion
|
|
10
37
|
export { Tooltip };
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { Tour as Tour$1, TourInteractOutsideEvent, TourPointerDownOutsideEvent, TourStepDetails, UseTourProps, UseTourReturn } from "@ark-ui/react/tour";
|
|
2
3
|
//#region src/components/tour/index.d.ts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
export interface TourFacadeProps {
|
|
5
|
+
tour: UseTourReturn;
|
|
6
|
+
trigger?: string;
|
|
7
|
+
/** Replaces the standard card body when supplied. */
|
|
8
|
+
content?: ReactNode;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare function TourFacade({ tour, trigger, content, children }: TourFacadeProps): import("react").JSX.Element;
|
|
12
|
+
declare namespace TourFacade {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
type TourParts = typeof Tour$1;
|
|
16
|
+
export declare const Tour: typeof TourFacade & TourParts;
|
|
17
|
+
/** Tour machines are created by useTour, so the stable id belongs there. */
|
|
18
|
+
export declare function useTour(props?: UseTourProps): UseTourReturn;
|
|
10
19
|
//#endregion
|
|
11
|
-
export {
|
|
20
|
+
export type { TourInteractOutsideEvent, TourPointerDownOutsideEvent, TourStepDetails };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
2
|
+
import { Button } from "../button/index.mjs";
|
|
3
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Tour as Tour$1, useTour as useTour$1 } from "@ark-ui/react/tour";
|
|
3
6
|
//#region src/components/tour/index.tsx
|
|
4
7
|
/** Ark's Tour, dressed in the paper-and-ink system: a dimmed page where
|
|
5
8
|
* the spotlight alone keeps the focus halo, and the anchored card rides
|
|
@@ -7,7 +10,46 @@ import { Tour as Tour$1, useTour } from "@ark-ui/react/tour";
|
|
|
7
10
|
* Spotlight, Positioner, Content, Arrow, ArrowTip, Title, Description,
|
|
8
11
|
* ProgressText, Control, Actions, ActionTrigger, CloseTrigger, plus
|
|
9
12
|
* useTour. */
|
|
10
|
-
|
|
13
|
+
function TourRoot(props) {
|
|
14
|
+
return /* @__PURE__ */ jsx(Tour$1.Root, { ...props });
|
|
15
|
+
}
|
|
16
|
+
function TourFacade({ tour, trigger = "Start tour", content, children }) {
|
|
17
|
+
return /* @__PURE__ */ jsxs(TourRoot, {
|
|
18
|
+
tour,
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ jsx(Button, {
|
|
21
|
+
size: "sm",
|
|
22
|
+
onClick: () => tour.start(),
|
|
23
|
+
children: trigger
|
|
24
|
+
}),
|
|
25
|
+
children,
|
|
26
|
+
/* @__PURE__ */ jsx(Tour$1.Backdrop, {}),
|
|
27
|
+
/* @__PURE__ */ jsx(Tour$1.Spotlight, {}),
|
|
28
|
+
/* @__PURE__ */ jsx(Tour$1.Positioner, { children: /* @__PURE__ */ jsx(Tour$1.Content, { children: content ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
29
|
+
/* @__PURE__ */ jsx(Tour$1.ProgressText, {}),
|
|
30
|
+
/* @__PURE__ */ jsx(Tour$1.Title, {}),
|
|
31
|
+
/* @__PURE__ */ jsx(Tour$1.Description, {}),
|
|
32
|
+
/* @__PURE__ */ jsx(Tour$1.Control, { children: /* @__PURE__ */ jsx(Tour$1.Actions, { children: (actions) => actions.map((action) => /* @__PURE__ */ jsx(Tour$1.ActionTrigger, {
|
|
33
|
+
action,
|
|
34
|
+
children: action.label
|
|
35
|
+
}, action.label)) }) })
|
|
36
|
+
] }) }) })
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
TourFacade.displayName = "STour";
|
|
41
|
+
const Tour = Object.assign(TourFacade, {
|
|
42
|
+
...Tour$1,
|
|
43
|
+
Root: TourRoot
|
|
44
|
+
});
|
|
45
|
+
/** Tour machines are created by useTour, so the stable id belongs there. */
|
|
46
|
+
function useTour(props = {}) {
|
|
47
|
+
const id = useElementId("tour", props);
|
|
48
|
+
return useTour$1({
|
|
49
|
+
id,
|
|
50
|
+
...props
|
|
51
|
+
});
|
|
52
|
+
}
|
|
11
53
|
injectComponentStyle("tour");
|
|
12
54
|
//#endregion
|
|
13
55
|
export { Tour, useTour };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Checkbox } from "../checkbox/index.mjs";
|
|
1
2
|
import { HTMLAttributes } from "react";
|
|
2
3
|
//#region src/components/transfer/index.d.ts
|
|
3
4
|
export interface TransferItem {
|
|
@@ -19,5 +20,6 @@ export interface TransferProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
19
20
|
* `value` is the target column's value list; everything else in `data`
|
|
20
21
|
* stays on the left. `searchable` adds a filter line to each panel.
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
|
+
declare function TransferImpl({ value, data, titles, searchable, disabled, onValueChange, ...rest }: TransferProps): import("react").JSX.Element;
|
|
24
|
+
export declare const Transfer: typeof TransferImpl & typeof Checkbox;
|
|
23
25
|
//#endregion
|
|
@@ -1,32 +1,17 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
3
|
import { n as useComponentMessages, t as formatMessage } from "../../messages-1jJWtaYU.mjs";
|
|
2
4
|
import { Button } from "../button/index.mjs";
|
|
3
|
-
import { t as Input } from "../../input-
|
|
4
|
-
import {
|
|
5
|
+
import { t as Input } from "../../input-BDpQ0e6G.mjs";
|
|
6
|
+
import { Checkbox as Checkbox$1 } from "../checkbox/index.mjs";
|
|
7
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
5
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
9
|
import { useState } from "react";
|
|
7
10
|
import { Checkbox } from "@ark-ui/react/checkbox";
|
|
8
11
|
//#region src/components/transfer/index.tsx
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
stroke: "currentColor",
|
|
13
|
-
strokeWidth: 3,
|
|
14
|
-
strokeLinecap: "round",
|
|
15
|
-
strokeLinejoin: "round",
|
|
16
|
-
"aria-hidden": "true",
|
|
17
|
-
children: /* @__PURE__ */ jsx("path", { d: "m5 12.5 5 5L19 7" })
|
|
18
|
-
});
|
|
19
|
-
function arrowGlyph(direction) {
|
|
20
|
-
return /* @__PURE__ */ jsx("svg", {
|
|
21
|
-
viewBox: "0 0 24 24",
|
|
22
|
-
fill: "none",
|
|
23
|
-
stroke: "currentColor",
|
|
24
|
-
strokeWidth: 1.75,
|
|
25
|
-
strokeLinecap: "round",
|
|
26
|
-
strokeLinejoin: "round",
|
|
27
|
-
"aria-hidden": "true",
|
|
28
|
-
children: /* @__PURE__ */ jsx("path", { d: direction === "right" ? "M5 12h14m-6-6 6 6-6 6" : "M19 12H5m6-6-6 6 6 6" })
|
|
29
|
-
});
|
|
12
|
+
const checkIcon = iconNode("check");
|
|
13
|
+
function arrowIcon(direction) {
|
|
14
|
+
return iconNode(direction === "right" ? "arrow-right" : "arrow-left");
|
|
30
15
|
}
|
|
31
16
|
/**
|
|
32
17
|
* Two ledgers and a crossing: items sit in the source column until the
|
|
@@ -34,9 +19,10 @@ function arrowGlyph(direction) {
|
|
|
34
19
|
* `value` is the target column's value list; everything else in `data`
|
|
35
20
|
* stays on the left. `searchable` adds a filter line to each panel.
|
|
36
21
|
*/
|
|
37
|
-
function
|
|
22
|
+
function TransferImpl({ value = [], data, titles = ["Source", "Target"], searchable = false, disabled = false, onValueChange, ...rest }) {
|
|
38
23
|
injectComponentStyle("transfer");
|
|
39
24
|
injectComponentStyle("checkbox");
|
|
25
|
+
const id = useElementId("transfer", rest);
|
|
40
26
|
const messages = useComponentMessages();
|
|
41
27
|
const [checkedSource, setCheckedSource] = useState(() => /* @__PURE__ */ new Set());
|
|
42
28
|
const [checkedTarget, setCheckedTarget] = useState(() => /* @__PURE__ */ new Set());
|
|
@@ -102,11 +88,12 @@ function Transfer({ value = [], data, titles = ["Source", "Target"], searchable
|
|
|
102
88
|
}) : items.map((item) => {
|
|
103
89
|
const locked = disabled || item.disabled === true;
|
|
104
90
|
return /* @__PURE__ */ jsxs(Checkbox.Root, {
|
|
91
|
+
id: `${id}-${side}-${item.value}`,
|
|
105
92
|
checked: checked.has(item.value),
|
|
106
93
|
disabled: locked,
|
|
107
94
|
onCheckedChange: () => toggle(side, item.value),
|
|
108
95
|
children: [
|
|
109
|
-
/* @__PURE__ */ jsx(Checkbox.Control, { children: /* @__PURE__ */ jsx(Checkbox.Indicator, { children:
|
|
96
|
+
/* @__PURE__ */ jsx(Checkbox.Control, { children: /* @__PURE__ */ jsx(Checkbox.Indicator, { children: checkIcon }) }),
|
|
110
97
|
/* @__PURE__ */ jsx(Checkbox.Label, {
|
|
111
98
|
"data-part": "label",
|
|
112
99
|
children: item.label
|
|
@@ -137,7 +124,7 @@ function Transfer({ value = [], data, titles = ["Source", "Target"], searchable
|
|
|
137
124
|
disabled: checkedSource.size === 0 || disabled,
|
|
138
125
|
"aria-label": messages.transfer.moveRight,
|
|
139
126
|
onClick: () => move(true),
|
|
140
|
-
children:
|
|
127
|
+
children: arrowIcon("right")
|
|
141
128
|
}), /* @__PURE__ */ jsx(Button, {
|
|
142
129
|
variant: "outline",
|
|
143
130
|
size: "sm",
|
|
@@ -145,12 +132,13 @@ function Transfer({ value = [], data, titles = ["Source", "Target"], searchable
|
|
|
145
132
|
disabled: checkedTarget.size === 0 || disabled,
|
|
146
133
|
"aria-label": messages.transfer.moveLeft,
|
|
147
134
|
onClick: () => move(false),
|
|
148
|
-
children:
|
|
135
|
+
children: arrowIcon("left")
|
|
149
136
|
})]
|
|
150
137
|
}),
|
|
151
138
|
panel("target", titles[1], targetQuery, setTargetQuery, checkedTarget, targetItems)
|
|
152
139
|
]
|
|
153
140
|
});
|
|
154
141
|
}
|
|
142
|
+
const Transfer = Object.assign(TransferImpl, Checkbox$1);
|
|
155
143
|
//#endregion
|
|
156
144
|
export { Transfer };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as Popover } from "../../index-Eu-Bttta.mjs";
|
|
1
2
|
import { HTMLAttributes } from "react";
|
|
2
3
|
//#region src/components/tree-select/index.d.ts
|
|
3
4
|
export interface TreeSelectNode {
|
|
@@ -24,5 +25,6 @@ export interface TreeSelectProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
24
25
|
size?: "sm" | "md" | "lg";
|
|
25
26
|
onValueChange?: (value: string) => void;
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
+
declare function TreeSelectImpl({ value, data, placeholder, filterable, disabled, size, onValueChange, ...rest }: TreeSelectProps): import("react").JSX.Element;
|
|
29
|
+
export declare const TreeSelect: typeof TreeSelectImpl & typeof Popover;
|
|
28
30
|
//#endregion
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
3
|
import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
+
import { Popover as Popover$1 } from "../popover/index.mjs";
|
|
5
|
+
import { t as Input } from "../../input-BDpQ0e6G.mjs";
|
|
6
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
4
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
8
|
import { useMemo, useState } from "react";
|
|
6
9
|
import { Popover } from "@ark-ui/react/popover";
|
|
@@ -8,16 +11,7 @@ import { Portal } from "@ark-ui/react/portal";
|
|
|
8
11
|
import { useFilter } from "@ark-ui/react/locale";
|
|
9
12
|
import { TreeView, createTreeCollection } from "@ark-ui/react/tree-view";
|
|
10
13
|
//#region src/components/tree-select/index.tsx
|
|
11
|
-
const chevron =
|
|
12
|
-
viewBox: "0 0 24 24",
|
|
13
|
-
fill: "none",
|
|
14
|
-
stroke: "currentColor",
|
|
15
|
-
strokeWidth: 2,
|
|
16
|
-
strokeLinecap: "round",
|
|
17
|
-
strokeLinejoin: "round",
|
|
18
|
-
"aria-hidden": "true",
|
|
19
|
-
children: /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" })
|
|
20
|
-
});
|
|
14
|
+
const chevron = iconNode("chevron-right");
|
|
21
15
|
const chevronDown = /* @__PURE__ */ jsx("span", {
|
|
22
16
|
"data-part": "chevron",
|
|
23
17
|
"aria-hidden": "true",
|
|
@@ -30,21 +24,13 @@ function TreeSelectRow({ node, indexPath }) {
|
|
|
30
24
|
children: node.children ? /* @__PURE__ */ jsxs(TreeView.Branch, { children: [/* @__PURE__ */ jsxs(TreeView.BranchControl, { children: [/* @__PURE__ */ jsx(TreeView.BranchIndicator, { children: chevron }), /* @__PURE__ */ jsx(TreeView.BranchText, { children: node.label })] }), /* @__PURE__ */ jsxs(TreeView.BranchContent, { children: [/* @__PURE__ */ jsx(TreeView.BranchIndentGuide, {}), node.children.map((child, index) => /* @__PURE__ */ jsx(TreeSelectRow, {
|
|
31
25
|
node: child,
|
|
32
26
|
indexPath: [...indexPath, index]
|
|
33
|
-
}, child.value))] })] }) : /* @__PURE__ */ jsx(TreeView.Item, {
|
|
34
|
-
asChild: true,
|
|
35
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
36
|
-
style: {
|
|
37
|
-
display: "flex",
|
|
38
|
-
inlineSize: "100%"
|
|
39
|
-
},
|
|
40
|
-
children: /* @__PURE__ */ jsx(TreeView.ItemText, { children: node.label })
|
|
41
|
-
})
|
|
42
|
-
})
|
|
27
|
+
}, child.value))] })] }) : /* @__PURE__ */ jsx(TreeView.Item, { children: /* @__PURE__ */ jsx(TreeView.ItemText, { children: node.label }) })
|
|
43
28
|
});
|
|
44
29
|
}
|
|
45
|
-
function
|
|
30
|
+
function TreeSelectImpl({ value, data, placeholder = "Select…", filterable = false, disabled = false, size = "md", onValueChange, ...rest }) {
|
|
46
31
|
injectComponentStyle("tree-select");
|
|
47
32
|
injectComponentStyle("tree-view");
|
|
33
|
+
const hostId = useElementId("tree-select", rest);
|
|
48
34
|
const messages = useComponentMessages();
|
|
49
35
|
const [open, setOpen] = useState(false);
|
|
50
36
|
const [query, setQuery] = useState("");
|
|
@@ -97,6 +83,7 @@ function TreeSelect({ value, data, placeholder = "Select…", filterable = false
|
|
|
97
83
|
}
|
|
98
84
|
return /* @__PURE__ */ jsxs(Popover.Root, {
|
|
99
85
|
...rest,
|
|
86
|
+
id: `${hostId}:popover`,
|
|
100
87
|
open,
|
|
101
88
|
onOpenChange: (details) => {
|
|
102
89
|
setOpen(details.open);
|
|
@@ -141,6 +128,7 @@ function TreeSelect({ value, data, placeholder = "Select…", filterable = false
|
|
|
141
128
|
"data-part": "empty",
|
|
142
129
|
children: "Nothing matches"
|
|
143
130
|
}) : /* @__PURE__ */ jsx(TreeView.Root, {
|
|
131
|
+
id: `${hostId}:tree`,
|
|
144
132
|
collection: visibleCollection,
|
|
145
133
|
selectionMode: "single",
|
|
146
134
|
selectedValue: value ? [value] : [],
|
|
@@ -155,5 +143,6 @@ function TreeSelect({ value, data, placeholder = "Select…", filterable = false
|
|
|
155
143
|
}) }) })]
|
|
156
144
|
});
|
|
157
145
|
}
|
|
146
|
+
const TreeSelect = Object.assign(TreeSelectImpl, Popover$1);
|
|
158
147
|
//#endregion
|
|
159
148
|
export { TreeSelect };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentProps } from "react";
|
|
1
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
2
2
|
import { CollectionItem } from "@ark-ui/react/collection";
|
|
3
3
|
import { TreeView as TreeView$1, TreeViewRootComponentProps } from "@ark-ui/react/tree-view";
|
|
4
4
|
//#region src/components/tree-view/index.d.ts
|
|
@@ -20,7 +20,27 @@ declare function TreeViewNodeCheckbox(props: ComponentProps<typeof TreeView$1.No
|
|
|
20
20
|
/** A branch is born with its chevron — the indicator stays a consumer's
|
|
21
21
|
* children to override, never a chore to remember. */
|
|
22
22
|
declare function TreeViewBranchIndicator(props: ComponentProps<typeof TreeView$1.BranchIndicator>): import("react").JSX.Element;
|
|
23
|
-
|
|
23
|
+
type TreeOption = {
|
|
24
|
+
label: string;
|
|
25
|
+
value: string;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
children?: TreeOption[];
|
|
28
|
+
};
|
|
29
|
+
type TreeViewFacadeProps = {
|
|
30
|
+
value?: string[];
|
|
31
|
+
defaultValue?: string[];
|
|
32
|
+
options: TreeOption[];
|
|
33
|
+
multiple?: boolean;
|
|
34
|
+
label?: string;
|
|
35
|
+
size?: "sm" | "md" | "lg";
|
|
36
|
+
className?: string;
|
|
37
|
+
style?: CSSProperties;
|
|
38
|
+
onValueChange?: (value: string[]) => void;
|
|
39
|
+
};
|
|
40
|
+
/** The complete tree behind selected values: nested options render their own
|
|
41
|
+
* branches and leaves, while async and checkbox trees remain anatomy work. */
|
|
42
|
+
declare function TreeViewFacade(props: TreeViewFacadeProps): import("react").JSX.Element;
|
|
43
|
+
export declare const TreeView: typeof TreeViewFacade & Omit<typeof TreeView$1, "Root" | "NodeCheckbox" | "BranchIndicator"> & {
|
|
24
44
|
Root: typeof TreeViewRoot;
|
|
25
45
|
NodeCheckbox: typeof TreeViewNodeCheckbox;
|
|
26
46
|
BranchIndicator: typeof TreeViewBranchIndicator;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { TreeView as TreeView$1 } from "@ark-ui/react/tree-view";
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
3
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { TreeView as TreeView$1, createTreeCollection } from "@ark-ui/react/tree-view";
|
|
6
6
|
//#region src/components/tree-view/index.tsx
|
|
7
7
|
function TreeViewRoot(props) {
|
|
8
|
+
injectComponentStyle("tree-view");
|
|
9
|
+
const id = useElementId("tree-view", props);
|
|
8
10
|
const { size = "md", ...rest } = props;
|
|
9
11
|
return /* @__PURE__ */ jsx(TreeView$1.Root, {
|
|
10
12
|
...rest,
|
|
13
|
+
id,
|
|
11
14
|
"data-size": size
|
|
12
15
|
});
|
|
13
16
|
}
|
|
@@ -22,18 +25,57 @@ function TreeViewNodeCheckbox(props) {
|
|
|
22
25
|
/** A branch is born with its chevron — the indicator stays a consumer's
|
|
23
26
|
* children to override, never a chore to remember. */
|
|
24
27
|
function TreeViewBranchIndicator(props) {
|
|
25
|
-
const { children =
|
|
28
|
+
const { children = iconNode("chevron-right"), ...rest } = props;
|
|
26
29
|
return /* @__PURE__ */ jsx(TreeView$1.BranchIndicator, {
|
|
27
30
|
...rest,
|
|
28
31
|
children
|
|
29
32
|
});
|
|
30
33
|
}
|
|
31
|
-
|
|
34
|
+
function treeNodes(items, path = []) {
|
|
35
|
+
return items.map((node, index) => {
|
|
36
|
+
const indexPath = [...path, index];
|
|
37
|
+
const row = node.children?.length ? /* @__PURE__ */ jsxs(TreeView$1.Branch, { children: [/* @__PURE__ */ jsxs(TreeView$1.BranchControl, { children: [/* @__PURE__ */ jsx(TreeView$1.BranchIndicator, { children: iconNode("chevron-right") }), /* @__PURE__ */ jsx(TreeView$1.BranchText, { children: node.label })] }), /* @__PURE__ */ jsx(TreeView$1.BranchContent, { children: treeNodes(node.children, indexPath) })] }) : /* @__PURE__ */ jsx(TreeView$1.Item, { children: /* @__PURE__ */ jsx(TreeView$1.ItemText, { children: node.label }) });
|
|
38
|
+
return /* @__PURE__ */ jsx(TreeView$1.NodeProvider, {
|
|
39
|
+
node,
|
|
40
|
+
indexPath,
|
|
41
|
+
children: row
|
|
42
|
+
}, node.value);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/** The complete tree behind selected values: nested options render their own
|
|
46
|
+
* branches and leaves, while async and checkbox trees remain anatomy work. */
|
|
47
|
+
function TreeViewFacade(props) {
|
|
48
|
+
const { value, defaultValue, options, multiple, label, size = "md", className, style, onValueChange } = props;
|
|
49
|
+
const branchValues = options.filter((option) => option.children?.length).map((option) => option.value);
|
|
50
|
+
const collection = createTreeCollection({
|
|
51
|
+
nodeToValue: (node) => node.value,
|
|
52
|
+
nodeToString: (node) => node.label,
|
|
53
|
+
isNodeDisabled: (node) => !!node.disabled,
|
|
54
|
+
rootNode: {
|
|
55
|
+
value: "root",
|
|
56
|
+
label: "",
|
|
57
|
+
children: options
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return /* @__PURE__ */ jsx(TreeViewRoot, {
|
|
61
|
+
size,
|
|
62
|
+
collection,
|
|
63
|
+
defaultExpandedValue: branchValues,
|
|
64
|
+
defaultSelectedValue: defaultValue,
|
|
65
|
+
selectedValue: value,
|
|
66
|
+
selectionMode: multiple ? "multiple" : "single",
|
|
67
|
+
"aria-label": label,
|
|
68
|
+
className,
|
|
69
|
+
style,
|
|
70
|
+
onSelectionChange: (event) => onValueChange?.(event.selectedValue),
|
|
71
|
+
children: /* @__PURE__ */ jsx(TreeView$1.Tree, { children: treeNodes(options) })
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
const TreeView = Object.assign(TreeViewFacade, {
|
|
32
75
|
...TreeView$1,
|
|
33
76
|
Root: TreeViewRoot,
|
|
34
77
|
NodeCheckbox: TreeViewNodeCheckbox,
|
|
35
78
|
BranchIndicator: TreeViewBranchIndicator
|
|
36
|
-
};
|
|
37
|
-
injectComponentStyle("tree-view");
|
|
79
|
+
});
|
|
38
80
|
//#endregion
|
|
39
81
|
export { TreeView };
|
|
@@ -4,6 +4,10 @@ export declare const Typography: {
|
|
|
4
4
|
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
} & {
|
|
7
|
+
Root: {
|
|
8
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
7
11
|
Display: {
|
|
8
12
|
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
9
13
|
displayName: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { injectComponentStyle } from "@bysages/core";
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/typography/index.tsx
|
|
4
4
|
/** The typographic voices, named so prose can ask for one: display and
|
|
@@ -22,6 +22,7 @@ const Body = part("Body", "p");
|
|
|
22
22
|
const Muted = part("Muted", "p");
|
|
23
23
|
const Label = part("Label", "p");
|
|
24
24
|
const Typography = Object.assign(Display, {
|
|
25
|
+
Root: Display,
|
|
25
26
|
Display,
|
|
26
27
|
Heading,
|
|
27
28
|
Lead,
|
|
@@ -16,5 +16,8 @@ export interface UserProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
16
16
|
* quiet echo beneath. The mark is the Avatar itself — one component
|
|
17
17
|
* renders it here, so every size and shape the Avatar knows the user
|
|
18
18
|
* inherits; this row only lays the words out beside it. */
|
|
19
|
-
|
|
19
|
+
declare function UserImpl({ name, description, size, src, shape, children, ...rest }: UserProps): import("react").JSX.Element;
|
|
20
|
+
export declare const User: typeof UserImpl & {
|
|
21
|
+
Root: typeof UserImpl;
|
|
22
|
+
};
|
|
20
23
|
//#endregion
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
2
|
import { Avatar } from "../avatar/index.mjs";
|
|
2
|
-
import { injectComponentStyle } from "@bysages/core";
|
|
3
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
//#region src/components/user/index.tsx
|
|
5
6
|
function initialsOf(name) {
|
|
@@ -9,7 +10,7 @@ function initialsOf(name) {
|
|
|
9
10
|
* quiet echo beneath. The mark is the Avatar itself — one component
|
|
10
11
|
* renders it here, so every size and shape the Avatar knows the user
|
|
11
12
|
* inherits; this row only lays the words out beside it. */
|
|
12
|
-
function
|
|
13
|
+
function UserImpl({ name, description, size, src, shape = "circle", children, ...rest }) {
|
|
13
14
|
injectComponentStyle("user");
|
|
14
15
|
return /* @__PURE__ */ jsxs("div", {
|
|
15
16
|
...rest,
|
|
@@ -38,5 +39,6 @@ function User({ name, description, size, src, shape = "circle", children, ...res
|
|
|
38
39
|
})]
|
|
39
40
|
});
|
|
40
41
|
}
|
|
42
|
+
const User = withSelfRoot(UserImpl);
|
|
41
43
|
//#endregion
|
|
42
44
|
export { User };
|
|
@@ -13,5 +13,8 @@ export interface VirtualListProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
13
13
|
* scroll length by a spacer sized from the row height, the rows
|
|
14
14
|
* themselves are positioned against it — a ten-thousand-row list
|
|
15
15
|
* costs the DOM a window, not the ledger. */
|
|
16
|
-
|
|
16
|
+
declare function VirtualListImpl({ items, itemHeight, height, renderItem, ...rest }: VirtualListProps): import("react").JSX.Element;
|
|
17
|
+
export declare const VirtualList: typeof VirtualListImpl & {
|
|
18
|
+
Root: typeof VirtualListImpl;
|
|
19
|
+
};
|
|
17
20
|
//#endregion
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
2
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { useRef } from "react";
|
|
4
5
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
5
6
|
//#region src/components/virtual-list/index.tsx
|
|
7
|
+
function toCssLength(length) {
|
|
8
|
+
return typeof length === "number" ? `${length}px` : length;
|
|
9
|
+
}
|
|
6
10
|
/** A ledger that only mounts the rows on stage: the viewport keeps its
|
|
7
11
|
* scroll length by a spacer sized from the row height, the rows
|
|
8
12
|
* themselves are positioned against it — a ten-thousand-row list
|
|
9
13
|
* costs the DOM a window, not the ledger. */
|
|
10
|
-
function
|
|
14
|
+
function VirtualListImpl({ items, itemHeight = 40, height = 320, renderItem, ...rest }) {
|
|
11
15
|
injectComponentStyle("virtual-list");
|
|
12
16
|
const viewport = useRef(null);
|
|
13
17
|
const virtualizer = useVirtualizer({
|
|
@@ -24,30 +28,24 @@ function VirtualList({ items, itemHeight = 40, height = 320, renderItem, ...rest
|
|
|
24
28
|
"data-part": "root",
|
|
25
29
|
style: {
|
|
26
30
|
...rest.style,
|
|
27
|
-
|
|
31
|
+
"--bs-virtual-list-height": toCssLength(height)
|
|
28
32
|
},
|
|
29
33
|
children: /* @__PURE__ */ jsx("div", {
|
|
30
34
|
"data-scope": "virtual-list",
|
|
31
35
|
"data-part": "inner",
|
|
32
|
-
style: {
|
|
33
|
-
blockSize: virtualizer.getTotalSize(),
|
|
34
|
-
position: "relative"
|
|
35
|
-
},
|
|
36
|
+
style: { "--bs-virtual-list-total": `${virtualizer.getTotalSize()}px` },
|
|
36
37
|
children: virtualizer.getVirtualItems().map((row) => /* @__PURE__ */ jsx("div", {
|
|
37
38
|
"data-scope": "virtual-list",
|
|
38
39
|
"data-part": "row",
|
|
39
40
|
style: {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
insetInlineStart: 0,
|
|
43
|
-
inlineSize: "100%",
|
|
44
|
-
transform: `translateY(${row.start}px)`,
|
|
45
|
-
blockSize: row.size
|
|
41
|
+
"--bs-virtual-list-row-start": `${row.start}px`,
|
|
42
|
+
"--bs-virtual-list-row-size": `${row.size}px`
|
|
46
43
|
},
|
|
47
44
|
children: renderItem?.(items[row.index], row.index)
|
|
48
45
|
}, String(row.key)))
|
|
49
46
|
})
|
|
50
47
|
});
|
|
51
48
|
}
|
|
49
|
+
const VirtualList = withSelfRoot(VirtualListImpl);
|
|
52
50
|
//#endregion
|
|
53
51
|
export { VirtualList };
|
|
@@ -12,5 +12,8 @@ export interface WatermarkProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
12
12
|
* density) and the marks layer repeats it over the children. The seal
|
|
13
13
|
* redraws itself when a prop turns — and it never takes a pointer.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
declare function WatermarkImpl({ content, opacity, rotate, fontSize, children, ...rest }: WatermarkProps): import("react").JSX.Element;
|
|
16
|
+
export declare const Watermark: typeof WatermarkImpl & {
|
|
17
|
+
Root: typeof WatermarkImpl;
|
|
18
|
+
};
|
|
16
19
|
//#endregion
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
2
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
2
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { useEffect, useState } from "react";
|
|
4
5
|
//#region src/components/watermark/index.tsx
|
|
@@ -17,7 +18,7 @@ function toPx(size) {
|
|
|
17
18
|
* density) and the marks layer repeats it over the children. The seal
|
|
18
19
|
* redraws itself when a prop turns — and it never takes a pointer.
|
|
19
20
|
*/
|
|
20
|
-
function
|
|
21
|
+
function WatermarkImpl({ content, opacity = .06, rotate = -20, fontSize = "0.875rem", children, ...rest }) {
|
|
21
22
|
injectComponentStyle("watermark");
|
|
22
23
|
const [root, setRoot] = useState(null);
|
|
23
24
|
const [tile, setTile] = useState("");
|
|
@@ -72,9 +73,10 @@ function Watermark({ content, opacity = .06, rotate = -20, fontSize = "0.875rem"
|
|
|
72
73
|
"data-scope": "watermark",
|
|
73
74
|
"data-part": "marks",
|
|
74
75
|
"aria-hidden": "true",
|
|
75
|
-
style: {
|
|
76
|
+
style: { "--bs-watermark-image": tile }
|
|
76
77
|
})]
|
|
77
78
|
});
|
|
78
79
|
}
|
|
80
|
+
const Watermark = withSelfRoot(WatermarkImpl);
|
|
79
81
|
//#endregion
|
|
80
82
|
export { Watermark };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/internal/family.ts
|
|
2
|
+
/** Gives a single-component family the same callable + Root surface. */
|
|
3
|
+
function withSelfRoot(component) {
|
|
4
|
+
const family = component;
|
|
5
|
+
family.Root = component;
|
|
6
|
+
return family;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { withSelfRoot as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getIcon } from "@bysages/core/icons";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/internal/icon.tsx
|
|
4
|
+
/** Render a curated registry icon as a bare svg element — the components
|
|
5
|
+
* own default icons. No span shell: the part rules size the svg directly.
|
|
6
|
+
* Extra body appends after the icon's own body, for composed marks. */
|
|
7
|
+
function iconNode(name, attrs = {}, extraBody = "") {
|
|
8
|
+
const icon = getIcon(name);
|
|
9
|
+
if (!icon) throw new Error(`Unknown icon "${name}" in the curated core registry`);
|
|
10
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
11
|
+
viewBox: `0 0 ${icon.width} ${icon.height}`,
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
...attrs,
|
|
14
|
+
dangerouslySetInnerHTML: { __html: icon.body + extraBody }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { iconNode as t };
|