@bysages/react 0.2.2 → 0.3.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/README.md +16 -2
- package/dist/ai-response-jZy-0Tvv.mjs +127 -0
- package/dist/chevron-BeHvt46K.mjs +17 -0
- package/dist/components/accordion/index.d.mts +7 -0
- package/dist/components/accordion/index.mjs +10 -0
- package/dist/components/affix/index.d.mts +20 -0
- package/dist/components/affix/index.mjs +18 -0
- package/dist/components/ai/index.d.mts +2 -0
- package/dist/components/ai/index.mjs +65 -0
- package/dist/components/ai-action/index.d.mts +14 -0
- package/dist/components/ai-action/index.mjs +18 -0
- package/dist/components/ai-attachments/index.d.mts +19 -0
- package/dist/components/ai-attachments/index.mjs +106 -0
- package/dist/components/ai-message/index.d.mts +11 -0
- package/dist/components/ai-message/index.mjs +15 -0
- package/dist/components/ai-prompt-input/index.d.mts +47 -0
- package/dist/components/ai-prompt-input/index.mjs +135 -0
- package/dist/components/ai-reasoning/index.d.mts +13 -0
- package/dist/components/ai-reasoning/index.mjs +19 -0
- package/dist/components/ai-response/index.d.mts +22 -0
- package/dist/components/ai-response/index.mjs +2 -0
- package/dist/components/ai-source/index.d.mts +17 -0
- package/dist/components/ai-source/index.mjs +27 -0
- package/dist/components/ai-suggestion/index.d.mts +13 -0
- package/dist/components/ai-suggestion/index.mjs +16 -0
- package/dist/components/ai-tool/index.d.mts +21 -0
- package/dist/components/ai-tool/index.mjs +36 -0
- package/dist/components/alert/index.d.mts +23 -0
- package/dist/components/alert/index.mjs +80 -0
- package/dist/components/angle-slider/index.d.mts +16 -0
- package/dist/components/angle-slider/index.mjs +21 -0
- package/dist/components/aspect-ratio/index.d.mts +10 -0
- package/dist/components/aspect-ratio/index.mjs +17 -0
- package/dist/components/autocomplete/index.d.mts +21 -0
- package/dist/components/autocomplete/index.mjs +35 -0
- package/dist/components/avatar/index.d.mts +23 -0
- package/dist/components/avatar/index.mjs +15 -0
- package/dist/components/avatar-group/index.d.mts +11 -0
- package/dist/components/avatar-group/index.mjs +15 -0
- package/dist/components/back-top/index.d.mts +29 -0
- package/dist/components/back-top/index.mjs +82 -0
- package/dist/components/badge/index.d.mts +10 -0
- package/dist/components/badge/index.mjs +15 -0
- package/dist/components/banner/index.d.mts +31 -0
- package/dist/components/banner/index.mjs +63 -0
- package/dist/components/bento/index.d.mts +26 -0
- package/dist/components/bento/index.mjs +41 -0
- package/dist/components/block-ui/index.d.mts +12 -0
- package/dist/components/block-ui/index.mjs +24 -0
- package/dist/components/breadcrumb/index.d.mts +32 -0
- package/dist/components/breadcrumb/index.mjs +35 -0
- package/dist/components/browser/index.d.mts +23 -0
- package/dist/components/browser/index.mjs +70 -0
- package/dist/components/button/index.d.mts +19 -0
- package/dist/components/button/index.mjs +29 -0
- package/dist/components/button-group/index.d.mts +24 -0
- package/dist/components/button-group/index.mjs +25 -0
- package/dist/components/calendar/index.d.mts +17 -0
- package/dist/components/calendar/index.mjs +96 -0
- package/dist/components/card/index.d.mts +46 -0
- package/dist/components/card/index.mjs +44 -0
- package/dist/components/carousel/index.d.mts +9 -0
- package/dist/components/carousel/index.mjs +12 -0
- package/dist/components/cascade-select/index.d.mts +31 -0
- package/dist/components/cascade-select/index.mjs +229 -0
- package/dist/components/checkbox/index.d.mts +16 -0
- package/dist/components/checkbox/index.mjs +21 -0
- package/dist/components/checkbox-group/index.d.mts +28 -0
- package/dist/components/checkbox-group/index.mjs +65 -0
- package/dist/components/chip/index.d.mts +12 -0
- package/dist/components/chip/index.mjs +17 -0
- package/dist/components/client-only/index.d.mts +2 -0
- package/dist/components/client-only/index.mjs +2 -0
- package/dist/components/clipboard/index.d.mts +17 -0
- package/dist/components/clipboard/index.mjs +17 -0
- package/dist/components/collapsible/index.d.mts +7 -0
- package/dist/components/collapsible/index.mjs +10 -0
- package/dist/components/collection/index.d.mts +2 -0
- package/dist/components/collection/index.mjs +2 -0
- package/dist/components/color-picker/index.d.mts +20 -0
- package/dist/components/color-picker/index.mjs +25 -0
- package/dist/components/combobox/index.d.mts +17 -0
- package/dist/components/combobox/index.mjs +18 -0
- package/dist/components/command/index.d.mts +43 -0
- package/dist/components/command/index.mjs +137 -0
- package/dist/components/comment/index.d.mts +17 -0
- package/dist/components/comment/index.mjs +47 -0
- package/dist/components/config-provider/index.d.mts +46 -0
- package/dist/components/config-provider/index.mjs +41 -0
- package/dist/components/container/index.d.mts +13 -0
- package/dist/components/container/index.mjs +15 -0
- package/dist/components/data-view/index.d.mts +18 -0
- package/dist/components/data-view/index.mjs +64 -0
- package/dist/components/date-input/index.d.mts +17 -0
- package/dist/components/date-input/index.mjs +21 -0
- package/dist/components/date-picker/index.d.mts +19 -0
- package/dist/components/date-picker/index.mjs +23 -0
- package/dist/components/deferred-content/index.d.mts +16 -0
- package/dist/components/deferred-content/index.mjs +34 -0
- package/dist/components/descriptions/index.d.mts +33 -0
- package/dist/components/descriptions/index.mjs +50 -0
- package/dist/components/dialog/index.d.mts +9 -0
- package/dist/components/dialog/index.mjs +11 -0
- package/dist/components/dock/index.d.mts +25 -0
- package/dist/components/dock/index.mjs +51 -0
- package/dist/components/download-trigger/index.d.mts +2 -0
- package/dist/components/download-trigger/index.mjs +2 -0
- package/dist/components/drawer/index.d.mts +9 -0
- package/dist/components/drawer/index.mjs +12 -0
- package/dist/components/dynamic-input/index.d.mts +28 -0
- package/dist/components/dynamic-input/index.mjs +83 -0
- package/dist/components/editable/index.d.mts +16 -0
- package/dist/components/editable/index.mjs +17 -0
- package/dist/components/ellipsis/index.d.mts +10 -0
- package/dist/components/ellipsis/index.mjs +19 -0
- package/dist/components/empty/index.d.mts +28 -0
- package/dist/components/empty/index.mjs +32 -0
- package/dist/components/field/index.d.mts +8 -0
- package/dist/components/field/index.mjs +11 -0
- package/dist/components/fieldset/index.d.mts +7 -0
- package/dist/components/fieldset/index.mjs +10 -0
- package/dist/components/file-upload/index.d.mts +18 -0
- package/dist/components/file-upload/index.mjs +23 -0
- package/dist/components/float-button/index.d.mts +59 -0
- package/dist/components/float-button/index.mjs +90 -0
- package/dist/components/floating-panel/index.d.mts +9 -0
- package/dist/components/floating-panel/index.mjs +12 -0
- package/dist/components/focus-trap/index.d.mts +2 -0
- package/dist/components/focus-trap/index.mjs +2 -0
- package/dist/components/form/index.d.mts +2 -0
- package/dist/components/form/index.mjs +67 -0
- package/dist/components/format/index.d.mts +9 -0
- package/dist/components/format/index.mjs +10 -0
- package/dist/components/frame/index.d.mts +10 -0
- package/dist/components/frame/index.mjs +12 -0
- package/dist/components/grid/index.d.mts +13 -0
- package/dist/components/grid/index.mjs +31 -0
- package/dist/components/highlight/index.d.mts +7 -0
- package/dist/components/highlight/index.mjs +11 -0
- package/dist/components/hover-card/index.d.mts +7 -0
- package/dist/components/hover-card/index.mjs +10 -0
- package/dist/components/icon/index.d.mts +24 -0
- package/dist/components/icon/index.mjs +26 -0
- package/dist/components/image/index.d.mts +17 -0
- package/dist/components/image/index.mjs +57 -0
- package/dist/components/image-cropper/index.d.mts +8 -0
- package/dist/components/image-cropper/index.mjs +11 -0
- package/dist/components/image-viewer/index.d.mts +18 -0
- package/dist/components/image-viewer/index.mjs +110 -0
- package/dist/components/input/index.d.mts +19 -0
- package/dist/components/input/index.mjs +2 -0
- package/dist/components/input-group/index.d.mts +17 -0
- package/dist/components/input-group/index.mjs +31 -0
- package/dist/components/json-tree-view/index.d.mts +7 -0
- package/dist/components/json-tree-view/index.mjs +10 -0
- package/dist/components/kbd/index.d.mts +6 -0
- package/dist/components/kbd/index.mjs +14 -0
- package/dist/components/layout/index.d.mts +63 -0
- package/dist/components/layout/index.mjs +133 -0
- package/dist/components/link/index.d.mts +10 -0
- package/dist/components/link/index.mjs +18 -0
- package/dist/components/list/index.d.mts +39 -0
- package/dist/components/list/index.mjs +66 -0
- package/dist/components/listbox/index.d.mts +18 -0
- package/dist/components/listbox/index.mjs +18 -0
- package/dist/components/marquee/index.d.mts +7 -0
- package/dist/components/marquee/index.mjs +10 -0
- package/dist/components/masonry/index.d.mts +11 -0
- package/dist/components/masonry/index.mjs +29 -0
- package/dist/components/mentions/index.d.mts +2 -0
- package/dist/components/mentions/index.mjs +2 -0
- package/dist/components/menu/index.d.mts +20 -0
- package/dist/components/menu/index.mjs +37 -0
- package/dist/components/menubar/index.d.mts +32 -0
- package/dist/components/menubar/index.mjs +35 -0
- package/dist/components/meter/index.d.mts +26 -0
- package/dist/components/meter/index.mjs +59 -0
- package/dist/components/navigation-menu/index.d.mts +8 -0
- package/dist/components/navigation-menu/index.mjs +11 -0
- package/dist/components/number-input/index.d.mts +16 -0
- package/dist/components/number-input/index.mjs +21 -0
- package/dist/components/order-list/index.d.mts +21 -0
- package/dist/components/order-list/index.mjs +162 -0
- package/dist/components/page-header/index.d.mts +32 -0
- package/dist/components/page-header/index.mjs +34 -0
- package/dist/components/pagination/index.d.mts +18 -0
- package/dist/components/pagination/index.mjs +23 -0
- package/dist/components/password-input/index.d.mts +16 -0
- package/dist/components/password-input/index.mjs +21 -0
- package/dist/components/pin-input/index.d.mts +15 -0
- package/dist/components/pin-input/index.mjs +20 -0
- package/dist/components/popconfirm/index.d.mts +20 -0
- package/dist/components/popconfirm/index.mjs +44 -0
- package/dist/components/popover/index.d.mts +8 -0
- package/dist/components/popover/index.mjs +11 -0
- package/dist/components/presence/index.d.mts +2 -0
- package/dist/components/presence/index.mjs +2 -0
- package/dist/components/progress/index.d.mts +16 -0
- package/dist/components/progress/index.mjs +21 -0
- package/dist/components/progress-group/index.d.mts +22 -0
- package/dist/components/progress-group/index.mjs +56 -0
- package/dist/components/qr-code/index.d.mts +8 -0
- package/dist/components/qr-code/index.mjs +11 -0
- package/dist/components/radio-group/index.d.mts +16 -0
- package/dist/components/radio-group/index.mjs +21 -0
- package/dist/components/rating-group/index.d.mts +16 -0
- package/dist/components/rating-group/index.mjs +21 -0
- package/dist/components/result/index.d.mts +31 -0
- package/dist/components/result/index.mjs +59 -0
- package/dist/components/scroll-area/index.d.mts +7 -0
- package/dist/components/scroll-area/index.mjs +10 -0
- package/dist/components/segment-group/index.d.mts +18 -0
- package/dist/components/segment-group/index.mjs +20 -0
- package/dist/components/select/index.d.mts +2 -0
- package/dist/components/select/index.mjs +2 -0
- package/dist/components/separator/index.d.mts +11 -0
- package/dist/components/separator/index.mjs +16 -0
- package/dist/components/signature-pad/index.d.mts +8 -0
- package/dist/components/signature-pad/index.mjs +11 -0
- package/dist/components/skeleton/index.d.mts +7 -0
- package/dist/components/skeleton/index.mjs +13 -0
- package/dist/components/slider/index.d.mts +16 -0
- package/dist/components/slider/index.mjs +21 -0
- package/dist/components/spinner/index.d.mts +9 -0
- package/dist/components/spinner/index.mjs +36 -0
- package/dist/components/split-button/index.d.mts +36 -0
- package/dist/components/split-button/index.mjs +71 -0
- package/dist/components/splitter/index.d.mts +7 -0
- package/dist/components/splitter/index.mjs +10 -0
- package/dist/components/spotlight/index.d.mts +12 -0
- package/dist/components/spotlight/index.mjs +33 -0
- package/dist/components/stack/index.d.mts +11 -0
- package/dist/components/stack/index.mjs +32 -0
- package/dist/components/stat/index.d.mts +29 -0
- package/dist/components/stat/index.mjs +37 -0
- package/dist/components/steps/index.d.mts +19 -0
- package/dist/components/steps/index.mjs +24 -0
- package/dist/components/swap/index.d.mts +8 -0
- package/dist/components/swap/index.mjs +11 -0
- package/dist/components/switch/index.d.mts +16 -0
- package/dist/components/switch/index.mjs +21 -0
- package/dist/components/table/index.d.mts +79 -0
- package/dist/components/table/index.mjs +688 -0
- package/dist/components/tabs/index.d.mts +20 -0
- package/dist/components/tabs/index.mjs +24 -0
- package/dist/components/tags-input/index.d.mts +17 -0
- package/dist/components/tags-input/index.mjs +22 -0
- package/dist/components/terminal/index.d.mts +17 -0
- package/dist/components/terminal/index.mjs +65 -0
- package/dist/components/textarea/index.d.mts +14 -0
- package/dist/components/textarea/index.mjs +20 -0
- package/dist/components/timeline/index.d.mts +26 -0
- package/dist/components/timeline/index.mjs +40 -0
- package/dist/components/timer/index.d.mts +8 -0
- package/dist/components/timer/index.mjs +11 -0
- package/dist/components/toast/index.d.mts +11 -0
- package/dist/components/toast/index.mjs +13 -0
- package/dist/components/toc/index.d.mts +7 -0
- package/dist/components/toc/index.mjs +10 -0
- package/dist/components/toggle/index.d.mts +7 -0
- package/dist/components/toggle/index.mjs +10 -0
- package/dist/components/toggle-group/index.d.mts +15 -0
- package/dist/components/toggle-group/index.mjs +20 -0
- package/dist/components/toolbar/index.d.mts +17 -0
- package/dist/components/toolbar/index.mjs +29 -0
- package/dist/components/tooltip/index.d.mts +7 -0
- package/dist/components/tooltip/index.mjs +10 -0
- package/dist/components/tour/index.d.mts +11 -0
- package/dist/components/tour/index.mjs +13 -0
- package/dist/components/transfer/index.d.mts +23 -0
- package/dist/components/transfer/index.mjs +154 -0
- package/dist/components/tree-select/index.d.mts +28 -0
- package/dist/components/tree-select/index.mjs +157 -0
- package/dist/components/tree-view/index.d.mts +19 -0
- package/dist/components/tree-view/index.mjs +18 -0
- package/dist/components/typography/index.d.mts +32 -0
- package/dist/components/typography/index.mjs +34 -0
- package/dist/components/user/index.d.mts +20 -0
- package/dist/components/user/index.mjs +42 -0
- package/dist/components/virtual-list/index.d.mts +17 -0
- package/dist/components/virtual-list/index.mjs +52 -0
- package/dist/components/watermark/index.d.mts +16 -0
- package/dist/components/watermark/index.mjs +80 -0
- package/dist/index-CsfxYv6J.d.mts +10383 -0
- package/dist/index-DFN9F5Zt.d.mts +42 -0
- package/dist/index-Uefyw7Im.d.mts +108 -0
- package/dist/index-uPyYiWaL.d.mts +1813 -0
- package/dist/index.d.mts +141 -15446
- package/dist/index.mjs +141 -4871
- package/dist/input-2oezH-dY.mjs +58 -0
- package/dist/mentions-DMIBCBOd.mjs +181 -0
- package/dist/select-D1xiT1oJ.mjs +68 -0
- package/package.json +103 -9
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Clipboard as Clipboard$1 } from "@ark-ui/react/clipboard";
|
|
4
|
+
//#region src/components/clipboard/index.tsx
|
|
5
|
+
function ClipboardRoot({ size = "md", ...rest }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(Clipboard$1.Root, {
|
|
7
|
+
...rest,
|
|
8
|
+
"data-size": size
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
const Clipboard = {
|
|
12
|
+
...Clipboard$1,
|
|
13
|
+
Root: ClipboardRoot
|
|
14
|
+
};
|
|
15
|
+
injectComponentStyle("clipboard");
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Clipboard };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Collapsible as Collapsible$1 } from "@ark-ui/react/collapsible";
|
|
2
|
+
//#region src/components/collapsible/index.d.ts
|
|
3
|
+
/** Ark's Collapsible, dressed in the paper-and-ink system: one control on
|
|
4
|
+
* the paper, its panel dissolving open to the machine's measured height.
|
|
5
|
+
* The API is Ark's own — Root, Trigger, Content, Indicator. */
|
|
6
|
+
export declare const Collapsible: typeof Collapsible$1;
|
|
7
|
+
//#endregion
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { Collapsible as Collapsible$1 } from "@ark-ui/react/collapsible";
|
|
3
|
+
//#region src/components/collapsible/index.tsx
|
|
4
|
+
/** Ark's Collapsible, dressed in the paper-and-ink system: one control on
|
|
5
|
+
* the paper, its panel dissolving open to the machine's measured height.
|
|
6
|
+
* The API is Ark's own — Root, Trigger, Content, Indicator. */
|
|
7
|
+
const Collapsible = Collapsible$1;
|
|
8
|
+
injectComponentStyle("collapsible");
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Collapsible };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { CollectionItem, CollectionOptions, FilePathTreeNode, FlatTreeNode, GridCollection, GridCollectionOptions, ListCollection, TreeCollection, TreeCollectionOptions, TreeNode, UseAsyncListProps, UseAsyncListReturn, UseListCollectionProps, UseListCollectionReturn, UseListSelectionProps, UseListSelectionReturn, createFileTreeCollection, createGridCollection, createListCollection, createTreeCollection, useAsyncList, useListCollection, useListSelection } from "@ark-ui/react/collection";
|
|
2
|
+
export { type CollectionItem, type CollectionOptions, type FilePathTreeNode, type FlatTreeNode, type GridCollection, type GridCollectionOptions, type ListCollection, type TreeCollection, type TreeCollectionOptions, type TreeNode, type UseAsyncListProps, type UseAsyncListReturn, type UseListCollectionProps, type UseListCollectionReturn, type UseListSelectionProps, type UseListSelectionReturn, createFileTreeCollection, createGridCollection, createListCollection, createTreeCollection, useAsyncList, useListCollection, useListSelection };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createFileTreeCollection, createGridCollection, createListCollection, createTreeCollection, useAsyncList, useListCollection, useListSelection } from "@ark-ui/react/collection";
|
|
2
|
+
export { createFileTreeCollection, createGridCollection, createListCollection, createTreeCollection, useAsyncList, useListCollection, useListSelection };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { ColorPicker as ColorPicker$1 } from "@ark-ui/react/color-picker";
|
|
3
|
+
//#region src/components/color-picker/index.d.ts
|
|
4
|
+
type ColorPickerRootProps = ComponentProps<typeof ColorPicker$1.Root> & {
|
|
5
|
+
/** One rung of the control-height ladder for the swatch seal. */
|
|
6
|
+
size?: "sm" | "md" | "lg";
|
|
7
|
+
};
|
|
8
|
+
declare function ColorPickerRoot({ size, ...rest }: ColorPickerRootProps): import("react").JSX.Element;
|
|
9
|
+
/** Ark's ColorPicker, dressed in the paper-and-ink system: a seal-sized swatch
|
|
10
|
+
* on the paper, opening into an area and channel sliders where pigment is
|
|
11
|
+
* picked. The API is Ark's own — Root, Label, Control, Trigger, Positioner,
|
|
12
|
+
* Content, Area, AreaThumb, AreaBackground, ValueText, ValueSwatch,
|
|
13
|
+
* ChannelSlider, ChannelSliderLabel, ChannelSliderTrack, ChannelSliderThumb,
|
|
14
|
+
* ChannelSliderValueText, ChannelInput, TransparencyGrid, SwatchGroup,
|
|
15
|
+
* SwatchTrigger, SwatchIndicator, Swatch, EyeDropperTrigger, FormatTrigger,
|
|
16
|
+
* FormatSelect, HiddenInput, Context. */
|
|
17
|
+
export declare const ColorPicker: Omit<typeof ColorPicker$1, "Root"> & {
|
|
18
|
+
Root: typeof ColorPickerRoot;
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { ColorPicker as ColorPicker$1 } from "@ark-ui/react/color-picker";
|
|
4
|
+
//#region src/components/color-picker/index.tsx
|
|
5
|
+
function ColorPickerRoot({ size = "md", ...rest }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(ColorPicker$1.Root, {
|
|
7
|
+
...rest,
|
|
8
|
+
"data-size": size
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
/** Ark's ColorPicker, dressed in the paper-and-ink system: a seal-sized swatch
|
|
12
|
+
* on the paper, opening into an area and channel sliders where pigment is
|
|
13
|
+
* picked. The API is Ark's own — Root, Label, Control, Trigger, Positioner,
|
|
14
|
+
* Content, Area, AreaThumb, AreaBackground, ValueText, ValueSwatch,
|
|
15
|
+
* ChannelSlider, ChannelSliderLabel, ChannelSliderTrack, ChannelSliderThumb,
|
|
16
|
+
* ChannelSliderValueText, ChannelInput, TransparencyGrid, SwatchGroup,
|
|
17
|
+
* SwatchTrigger, SwatchIndicator, Swatch, EyeDropperTrigger, FormatTrigger,
|
|
18
|
+
* FormatSelect, HiddenInput, Context. */
|
|
19
|
+
const ColorPicker = {
|
|
20
|
+
...ColorPicker$1,
|
|
21
|
+
Root: ColorPickerRoot
|
|
22
|
+
};
|
|
23
|
+
injectComponentStyle("color-picker");
|
|
24
|
+
//#endregion
|
|
25
|
+
export { ColorPicker };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CollectionItem } from "@ark-ui/react/collection";
|
|
2
|
+
import { Combobox as Combobox$1, ComboboxRootComponentProps } from "@ark-ui/react/combobox";
|
|
3
|
+
//#region src/components/combobox/index.d.ts
|
|
4
|
+
/** Ark's Combobox, dressed in the paper-and-ink system: the field carries
|
|
5
|
+
* the control recipe and its matches dissolve open as a paper vessel, the
|
|
6
|
+
* checked row taking the flat ink fill. The API is Ark's own — Root, Label,
|
|
7
|
+
* Control, Input, Trigger, ClearTrigger, Positioner, Content, List, Empty,
|
|
8
|
+
* Item, ItemText, ItemIndicator, ItemGroup, ItemGroupLabel. */
|
|
9
|
+
type ComboboxOwnProps = {
|
|
10
|
+
/** One rung of the control-height ladder for the field row. */
|
|
11
|
+
size?: "sm" | "md" | "lg";
|
|
12
|
+
};
|
|
13
|
+
declare function ComboboxRoot<T extends CollectionItem>(props: ComboboxRootComponentProps<T, ComboboxOwnProps>): import("react").JSX.Element;
|
|
14
|
+
export declare const Combobox: Omit<typeof Combobox$1, "Root"> & {
|
|
15
|
+
Root: typeof ComboboxRoot;
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Combobox as Combobox$1 } from "@ark-ui/react/combobox";
|
|
4
|
+
//#region src/components/combobox/index.tsx
|
|
5
|
+
function ComboboxRoot(props) {
|
|
6
|
+
const { size = "md", ...rest } = props;
|
|
7
|
+
return /* @__PURE__ */ jsx(Combobox$1.Root, {
|
|
8
|
+
...rest,
|
|
9
|
+
"data-size": size
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
const Combobox = {
|
|
13
|
+
...Combobox$1,
|
|
14
|
+
Root: ComboboxRoot
|
|
15
|
+
};
|
|
16
|
+
injectComponentStyle("combobox");
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Combobox };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//#region src/components/command/index.d.ts
|
|
2
|
+
export interface CommandEntry {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
/** Entries sharing a group are listed under one heading. */
|
|
6
|
+
group?: string;
|
|
7
|
+
/** A short affordance note, set as a keycap at the row's end. */
|
|
8
|
+
hint?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The command palette: a modal sheet at the top of the page carrying a
|
|
12
|
+
* search field over the caller's commands, grouped as a ledger with a
|
|
13
|
+
* keycap hint at each row. The shell is the dialog machinery — scrim,
|
|
14
|
+
* focus trap, Escape — and the searching is the combobox machinery
|
|
15
|
+
* driving our own list: the vessel and the list live inside the sheet,
|
|
16
|
+
* so the combobox renders no separate popup and the machine's content
|
|
17
|
+
* grafts onto the sheet's list.
|
|
18
|
+
*/
|
|
19
|
+
export interface CommandProps {
|
|
20
|
+
/** The commands on offer, grouped as they arrive. */
|
|
21
|
+
items?: CommandEntry[];
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
/** Whether the palette is up. Supply it to control the palette;
|
|
24
|
+
* changes are reported via `onOpenChange`. */
|
|
25
|
+
open?: boolean;
|
|
26
|
+
/** Whether the shell narrows `items` as the reader types. Turn it off
|
|
27
|
+
* when the caller owns the searching — a ranked engine or a remote
|
|
28
|
+
* source — and hands down the already-narrowed list. */
|
|
29
|
+
autoFilter?: boolean;
|
|
30
|
+
/** The field's text under the caller's control; changes are reported
|
|
31
|
+
* via `onInputValueChange`. */
|
|
32
|
+
inputValue?: string;
|
|
33
|
+
/** What the list whispers when nothing matches. */
|
|
34
|
+
emptyText?: string;
|
|
35
|
+
/** Called with the chosen entry's `value`; the palette closes after. */
|
|
36
|
+
onSelect?: (value: string) => void;
|
|
37
|
+
/** Reports the palette's next state. */
|
|
38
|
+
onOpenChange?: (open: boolean) => void;
|
|
39
|
+
/** Reports the field's live text. */
|
|
40
|
+
onInputValueChange?: (value: string) => void;
|
|
41
|
+
}
|
|
42
|
+
export declare function Command({ items, placeholder, open, autoFilter, inputValue, emptyText, onSelect, onOpenChange, onInputValueChange }: CommandProps): import("react").JSX.Element;
|
|
43
|
+
//#endregion
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { Portal } from "@ark-ui/react/portal";
|
|
5
|
+
import { useListCollection } from "@ark-ui/react/collection";
|
|
6
|
+
import { Combobox } from "@ark-ui/react/combobox";
|
|
7
|
+
import { Dialog } from "@ark-ui/react/dialog";
|
|
8
|
+
//#region src/components/command/index.tsx
|
|
9
|
+
function Command({ items = [], placeholder, open, autoFilter = true, inputValue, emptyText = "No matching commands", onSelect, onOpenChange, onInputValueChange }) {
|
|
10
|
+
injectComponentStyle("command");
|
|
11
|
+
injectComponentStyle("dialog");
|
|
12
|
+
const [internalOpen, setInternalOpen] = useState(false);
|
|
13
|
+
const [listOpen, setListOpen] = useState(true);
|
|
14
|
+
const [fieldText, setFieldText] = useState("");
|
|
15
|
+
const { collection, set, filter } = useListCollection({
|
|
16
|
+
initialItems: items.map((entry) => entry.value),
|
|
17
|
+
filter: (value, input) => {
|
|
18
|
+
const entry = items.find((candidate) => candidate.value === value);
|
|
19
|
+
if (!entry) return false;
|
|
20
|
+
const query = input.toLowerCase();
|
|
21
|
+
return entry.label.toLowerCase().includes(query) || value.toLowerCase().includes(query);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
set(items.map((entry) => entry.value));
|
|
26
|
+
if (autoFilter) filter(fieldText);
|
|
27
|
+
}, [items]);
|
|
28
|
+
const currentOpen = open ?? internalOpen;
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (currentOpen) setListOpen(true);
|
|
31
|
+
}, [currentOpen]);
|
|
32
|
+
const setOpen = (value) => {
|
|
33
|
+
if (open === void 0) setInternalOpen(value);
|
|
34
|
+
onOpenChange?.(value);
|
|
35
|
+
};
|
|
36
|
+
const available = new Set(collection.items);
|
|
37
|
+
const groups = /* @__PURE__ */ new Map();
|
|
38
|
+
for (const entry of items) {
|
|
39
|
+
if (!available.has(entry.value)) continue;
|
|
40
|
+
const key = entry.group ?? "";
|
|
41
|
+
if (!groups.has(key)) groups.set(key, []);
|
|
42
|
+
groups.get(key).push(entry);
|
|
43
|
+
}
|
|
44
|
+
const row = (entry) => /* @__PURE__ */ jsx(Combobox.Item, {
|
|
45
|
+
item: entry.value,
|
|
46
|
+
asChild: true,
|
|
47
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
48
|
+
"data-scope": "command",
|
|
49
|
+
"data-part": "item",
|
|
50
|
+
children: [/* @__PURE__ */ jsx(Combobox.ItemText, {
|
|
51
|
+
asChild: true,
|
|
52
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
53
|
+
"data-scope": "command",
|
|
54
|
+
"data-part": "item-label",
|
|
55
|
+
children: entry.label
|
|
56
|
+
})
|
|
57
|
+
}), entry.hint ? /* @__PURE__ */ jsx("span", {
|
|
58
|
+
"data-scope": "command",
|
|
59
|
+
"data-part": "item-hint",
|
|
60
|
+
children: entry.hint
|
|
61
|
+
}) : void 0]
|
|
62
|
+
})
|
|
63
|
+
}, entry.value);
|
|
64
|
+
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
65
|
+
open: currentOpen,
|
|
66
|
+
onOpenChange: (details) => setOpen(details.open),
|
|
67
|
+
children: /* @__PURE__ */ jsxs(Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, {}), /* @__PURE__ */ jsx(Dialog.Positioner, {
|
|
68
|
+
asChild: true,
|
|
69
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
70
|
+
"data-scope": "command",
|
|
71
|
+
"data-part": "positioner",
|
|
72
|
+
children: /* @__PURE__ */ jsx(Dialog.Content, {
|
|
73
|
+
asChild: true,
|
|
74
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
75
|
+
"data-scope": "command",
|
|
76
|
+
"data-part": "content",
|
|
77
|
+
children: /* @__PURE__ */ jsxs(Combobox.Root, {
|
|
78
|
+
collection,
|
|
79
|
+
inputValue,
|
|
80
|
+
open: listOpen,
|
|
81
|
+
onOpenChange: (details) => setListOpen(details.open),
|
|
82
|
+
inputBehavior: "autohighlight",
|
|
83
|
+
loopFocus: true,
|
|
84
|
+
onInputValueChange: (details) => {
|
|
85
|
+
setFieldText(details.inputValue);
|
|
86
|
+
if (autoFilter) filter(details.inputValue);
|
|
87
|
+
onInputValueChange?.(details.inputValue);
|
|
88
|
+
},
|
|
89
|
+
onValueChange: (details) => {
|
|
90
|
+
const [first] = details.value;
|
|
91
|
+
if (first == null) return;
|
|
92
|
+
onSelect?.(first);
|
|
93
|
+
setOpen(false);
|
|
94
|
+
},
|
|
95
|
+
children: [/* @__PURE__ */ jsx(Combobox.Input, {
|
|
96
|
+
asChild: true,
|
|
97
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
98
|
+
type: "text",
|
|
99
|
+
placeholder,
|
|
100
|
+
"data-scope": "command",
|
|
101
|
+
"data-part": "input"
|
|
102
|
+
})
|
|
103
|
+
}), /* @__PURE__ */ jsx(Combobox.Content, {
|
|
104
|
+
asChild: true,
|
|
105
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
106
|
+
"data-scope": "command",
|
|
107
|
+
"data-part": "list",
|
|
108
|
+
children: [Array.from(groups, ([group, entries]) => group === "" ? entries.map(row) : /* @__PURE__ */ jsx(Combobox.ItemGroup, {
|
|
109
|
+
asChild: true,
|
|
110
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
111
|
+
"data-scope": "command",
|
|
112
|
+
"data-part": "group",
|
|
113
|
+
children: [/* @__PURE__ */ jsx(Combobox.ItemGroupLabel, {
|
|
114
|
+
asChild: true,
|
|
115
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
116
|
+
"data-scope": "command",
|
|
117
|
+
"data-part": "group-label",
|
|
118
|
+
children: group
|
|
119
|
+
})
|
|
120
|
+
}), entries.map(row)]
|
|
121
|
+
})
|
|
122
|
+
}, group)), groups.size === 0 ? /* @__PURE__ */ jsx("div", {
|
|
123
|
+
"data-scope": "command",
|
|
124
|
+
"data-part": "empty",
|
|
125
|
+
children: emptyText
|
|
126
|
+
}) : null]
|
|
127
|
+
})
|
|
128
|
+
})]
|
|
129
|
+
})
|
|
130
|
+
})
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
})] })
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
//#endregion
|
|
137
|
+
export { Command };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
//#region src/components/comment/index.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* A voice on the record: the portrait hangs left (the `avatar` prop),
|
|
5
|
+
* the body carries the byline from `author` and `datetime`, the ink is
|
|
6
|
+
* the children, and `actions` is the row of answers.
|
|
7
|
+
*/
|
|
8
|
+
export interface CommentProps extends HTMLAttributes<HTMLElement> {
|
|
9
|
+
author?: string;
|
|
10
|
+
datetime?: string;
|
|
11
|
+
/** The portrait at the row's head. */
|
|
12
|
+
avatar?: ReactNode;
|
|
13
|
+
/** The row of answers beneath the ink. */
|
|
14
|
+
actions?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare function Comment({ author, datetime, avatar, actions, children, ...rest }: CommentProps): import("react").JSX.Element;
|
|
17
|
+
//#endregion
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/comment/index.tsx
|
|
4
|
+
function Comment({ author, datetime, avatar, actions, children, ...rest }) {
|
|
5
|
+
injectComponentStyle("comment");
|
|
6
|
+
return /* @__PURE__ */ jsxs("article", {
|
|
7
|
+
...rest,
|
|
8
|
+
"data-scope": "comment",
|
|
9
|
+
"data-part": "root",
|
|
10
|
+
children: [avatar ? /* @__PURE__ */ jsx("div", {
|
|
11
|
+
"data-scope": "comment",
|
|
12
|
+
"data-part": "avatar",
|
|
13
|
+
children: avatar
|
|
14
|
+
}) : null, /* @__PURE__ */ jsxs("div", {
|
|
15
|
+
"data-scope": "comment",
|
|
16
|
+
"data-part": "body",
|
|
17
|
+
children: [
|
|
18
|
+
author || datetime ? /* @__PURE__ */ jsxs("header", {
|
|
19
|
+
"data-scope": "comment",
|
|
20
|
+
"data-part": "header",
|
|
21
|
+
children: [author ? /* @__PURE__ */ jsx("span", {
|
|
22
|
+
"data-scope": "comment",
|
|
23
|
+
"data-part": "author",
|
|
24
|
+
children: author
|
|
25
|
+
}) : null, datetime ? /* @__PURE__ */ jsx("time", {
|
|
26
|
+
"data-scope": "comment",
|
|
27
|
+
"data-part": "datetime",
|
|
28
|
+
dateTime: datetime,
|
|
29
|
+
children: datetime
|
|
30
|
+
}) : null]
|
|
31
|
+
}) : null,
|
|
32
|
+
/* @__PURE__ */ jsx("div", {
|
|
33
|
+
"data-scope": "comment",
|
|
34
|
+
"data-part": "content",
|
|
35
|
+
children
|
|
36
|
+
}),
|
|
37
|
+
actions ? /* @__PURE__ */ jsx("div", {
|
|
38
|
+
"data-scope": "comment",
|
|
39
|
+
"data-part": "actions",
|
|
40
|
+
children: actions
|
|
41
|
+
}) : null
|
|
42
|
+
]
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { Comment };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ThemeScene } from "@bysages/core";
|
|
2
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
3
|
+
//#region src/components/config-provider/index.d.ts
|
|
4
|
+
/** The four density tiers the token layer's `[data-density]` selectors
|
|
5
|
+
* name — whitespace and control heights compress, readability never
|
|
6
|
+
* does. */
|
|
7
|
+
export type ConfigDensity = "compact" | "default" | "comfortable" | "spacious";
|
|
8
|
+
/** The named scene registers the token layer's `[data-scene]` selectors
|
|
9
|
+
* retune — "auto" is the engine's own resolution and stays off the
|
|
10
|
+
* subtree vocabulary. */
|
|
11
|
+
export type ConfigScene = Exclude<ThemeScene, "auto">;
|
|
12
|
+
/** The configuration a provider lays over its subtree. Every field is
|
|
13
|
+
* optional: an absent field changes nothing, and the page's own
|
|
14
|
+
* attributes keep ruling. */
|
|
15
|
+
export interface ConfigContext {
|
|
16
|
+
density?: ConfigDensity;
|
|
17
|
+
scene?: ConfigScene;
|
|
18
|
+
/** A mineral pigment theme (qinghua, celadon, zhusha, …) landing as
|
|
19
|
+
* `[data-accent]` on the host element. */
|
|
20
|
+
accent?: string;
|
|
21
|
+
/** Writing direction, landing as the native `dir` attribute. */
|
|
22
|
+
dir?: "ltr" | "rtl";
|
|
23
|
+
/** BCP-47 locale, landing as the native `lang` attribute. */
|
|
24
|
+
locale?: string;
|
|
25
|
+
}
|
|
26
|
+
/** The nearest provider's snapshot, or an empty one when no provider
|
|
27
|
+
* wraps the caller — the hook the date and format families will consume
|
|
28
|
+
* to localize their output. */
|
|
29
|
+
export declare function useConfig(): ConfigContext;
|
|
30
|
+
export interface ConfigProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
31
|
+
density?: ConfigDensity;
|
|
32
|
+
scene?: ConfigScene;
|
|
33
|
+
accent?: string;
|
|
34
|
+
dir?: "ltr" | "rtl";
|
|
35
|
+
locale?: string;
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The declarative host for global configuration: one element that both
|
|
40
|
+
* carries the token layer's attributes — `[data-density]` and
|
|
41
|
+
* `[data-accent]` fire on any element — and provides the same values to
|
|
42
|
+
* descendants through `useConfig`, so interactive behavior (formatting,
|
|
43
|
+
* messages) and visual theming stay one decision.
|
|
44
|
+
*/
|
|
45
|
+
export declare function ConfigProvider({ density, scene, accent, dir, locale, children, ...rest }: ConfigProviderProps): import("react").JSX.Element;
|
|
46
|
+
//#endregion
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
//#region src/components/config-provider/index.tsx
|
|
4
|
+
const ConfigContextImpl = createContext({});
|
|
5
|
+
/** The nearest provider's snapshot, or an empty one when no provider
|
|
6
|
+
* wraps the caller — the hook the date and format families will consume
|
|
7
|
+
* to localize their output. */
|
|
8
|
+
function useConfig() {
|
|
9
|
+
return useContext(ConfigContextImpl);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The declarative host for global configuration: one element that both
|
|
13
|
+
* carries the token layer's attributes — `[data-density]` and
|
|
14
|
+
* `[data-accent]` fire on any element — and provides the same values to
|
|
15
|
+
* descendants through `useConfig`, so interactive behavior (formatting,
|
|
16
|
+
* messages) and visual theming stay one decision.
|
|
17
|
+
*/
|
|
18
|
+
function ConfigProvider({ density, scene, accent, dir, locale, children, ...rest }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(ConfigContextImpl.Provider, {
|
|
20
|
+
value: {
|
|
21
|
+
density,
|
|
22
|
+
scene,
|
|
23
|
+
accent,
|
|
24
|
+
dir,
|
|
25
|
+
locale
|
|
26
|
+
},
|
|
27
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
28
|
+
...rest,
|
|
29
|
+
"data-scope": "config-provider",
|
|
30
|
+
"data-part": "root",
|
|
31
|
+
...density != null ? { "data-density": density } : {},
|
|
32
|
+
...scene != null ? { "data-scene": scene } : {},
|
|
33
|
+
...accent != null ? { "data-accent": accent } : {},
|
|
34
|
+
...dir != null ? { dir } : {},
|
|
35
|
+
...locale != null ? { lang: locale } : {},
|
|
36
|
+
children
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { ConfigProvider, useConfig };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
//#region src/components/container/index.d.ts
|
|
3
|
+
/** The reading frame: content held to a measure and centered on the
|
|
4
|
+
* page. The sizes name typographic measures, not breakpoints — the page
|
|
5
|
+
* owns its edges, the container only owns how long a line of ink runs. */
|
|
6
|
+
export interface ContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
size?: "narrow" | "readable" | "wide" | "full";
|
|
8
|
+
/** Keep the ink off the page edges when the viewport runs narrower
|
|
9
|
+
* than the measure. */
|
|
10
|
+
padding?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function Container({ size, padding, ...rest }: ContainerProps): import("react").JSX.Element;
|
|
13
|
+
//#endregion
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/container/index.tsx
|
|
4
|
+
function Container({ size = "readable", padding = true, ...rest }) {
|
|
5
|
+
injectComponentStyle("container");
|
|
6
|
+
return /* @__PURE__ */ jsx("div", {
|
|
7
|
+
...rest,
|
|
8
|
+
"data-scope": "container",
|
|
9
|
+
"data-part": "root",
|
|
10
|
+
"data-size": size,
|
|
11
|
+
"data-padding": padding ? "" : void 0
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Container };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
//#region src/components/data-view/index.d.ts
|
|
3
|
+
export interface DataViewProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
items: unknown[];
|
|
5
|
+
/** Ledger rows or a lattice of cards. */
|
|
6
|
+
layout?: "list" | "grid";
|
|
7
|
+
/** Records per page; leave unset to show everything at once. */
|
|
8
|
+
pageSize?: number;
|
|
9
|
+
/** Renders one record; the view lays the returned nodes out. */
|
|
10
|
+
renderItem?: (item: unknown, index: number) => ReactNode;
|
|
11
|
+
header?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/** One vessel, two layouts: the caller renders each record through
|
|
14
|
+
* renderItem, the view lays the records out as a ledger or a lattice
|
|
15
|
+
* and — when a page size is given — pages them with the pagination
|
|
16
|
+
* family's own parts rather than a second implementation. */
|
|
17
|
+
export declare function DataView({ items, layout, pageSize, renderItem, header, ...rest }: DataViewProps): import("react").JSX.Element;
|
|
18
|
+
//#endregion
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Pagination } from "../pagination/index.mjs";
|
|
2
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
//#region src/components/data-view/index.tsx
|
|
6
|
+
/** One vessel, two layouts: the caller renders each record through
|
|
7
|
+
* renderItem, the view lays the records out as a ledger or a lattice
|
|
8
|
+
* and — when a page size is given — pages them with the pagination
|
|
9
|
+
* family's own parts rather than a second implementation. */
|
|
10
|
+
function DataView({ items, layout = "list", pageSize, renderItem, header, ...rest }) {
|
|
11
|
+
injectComponentStyle("data-view");
|
|
12
|
+
const [page, setPage] = useState(1);
|
|
13
|
+
const pageCount = pageSize ? Math.max(1, Math.ceil(items.length / pageSize)) : 1;
|
|
14
|
+
const visible = pageSize ? items.slice((page - 1) * pageSize, page * pageSize) : items;
|
|
15
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
16
|
+
...rest,
|
|
17
|
+
"data-scope": "data-view",
|
|
18
|
+
"data-part": "root",
|
|
19
|
+
children: [
|
|
20
|
+
header,
|
|
21
|
+
/* @__PURE__ */ jsx("div", {
|
|
22
|
+
"data-scope": "data-view",
|
|
23
|
+
"data-part": "content",
|
|
24
|
+
"data-layout": layout,
|
|
25
|
+
children: visible.map((item, index) => /* @__PURE__ */ jsx("div", {
|
|
26
|
+
"data-scope": "data-view",
|
|
27
|
+
"data-part": "cell",
|
|
28
|
+
children: renderItem?.(item, index)
|
|
29
|
+
}, index))
|
|
30
|
+
}),
|
|
31
|
+
pageSize && pageCount > 1 ? /* @__PURE__ */ jsx("div", {
|
|
32
|
+
"data-scope": "data-view",
|
|
33
|
+
"data-part": "pager",
|
|
34
|
+
children: /* @__PURE__ */ jsxs(Pagination.Root, {
|
|
35
|
+
count: items.length,
|
|
36
|
+
pageSize,
|
|
37
|
+
page,
|
|
38
|
+
siblingCount: 1,
|
|
39
|
+
onPageChange: (details) => setPage(details.page),
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsx(Pagination.PrevTrigger, {
|
|
42
|
+
"aria-label": "Previous page",
|
|
43
|
+
children: "‹"
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ jsx(Pagination.Context, { children: (pagination) => pagination.pages.map((entry, index) => entry.type === "ellipsis" ? /* @__PURE__ */ jsx(Pagination.Ellipsis, {
|
|
46
|
+
index,
|
|
47
|
+
children: "…"
|
|
48
|
+
}, `e${index}`) : /* @__PURE__ */ jsx(Pagination.Item, {
|
|
49
|
+
type: "page",
|
|
50
|
+
value: entry.value,
|
|
51
|
+
children: entry.value
|
|
52
|
+
}, entry.value)) }),
|
|
53
|
+
/* @__PURE__ */ jsx(Pagination.NextTrigger, {
|
|
54
|
+
"aria-label": "Next page",
|
|
55
|
+
children: "›"
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
})
|
|
59
|
+
}) : null
|
|
60
|
+
]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
export { DataView };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { DateInput as DateInput$1, DateInputFocusChangeDetails, DateInputValueChangeDetails } from "@ark-ui/react/date-input";
|
|
3
|
+
//#region src/components/date-input/index.d.ts
|
|
4
|
+
type DateInputRootProps = ComponentProps<typeof DateInput$1.Root> & {
|
|
5
|
+
/** One rung of the control-height ladder for the segmented field. */
|
|
6
|
+
size?: "sm" | "md" | "lg";
|
|
7
|
+
};
|
|
8
|
+
declare function DateInputRoot({ size, ...rest }: DateInputRootProps): import("react").JSX.Element;
|
|
9
|
+
/** Ark's DateInput, dressed in the paper-and-ink system: a segmented
|
|
10
|
+
* field where the focused segment takes the flat ink fill. The API is
|
|
11
|
+
* Ark's own — Root, Label, Control, SegmentGroup, Segment, SegmentContext,
|
|
12
|
+
* HiddenInput. */
|
|
13
|
+
export declare const DateInput: Omit<typeof DateInput$1, "Root"> & {
|
|
14
|
+
Root: typeof DateInputRoot;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export type { DateInputFocusChangeDetails, DateInputValueChangeDetails };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { DateInput as DateInput$1 } from "@ark-ui/react/date-input";
|
|
4
|
+
//#region src/components/date-input/index.tsx
|
|
5
|
+
function DateInputRoot({ size = "md", ...rest }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(DateInput$1.Root, {
|
|
7
|
+
...rest,
|
|
8
|
+
"data-size": size
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
/** Ark's DateInput, dressed in the paper-and-ink system: a segmented
|
|
12
|
+
* field where the focused segment takes the flat ink fill. The API is
|
|
13
|
+
* Ark's own — Root, Label, Control, SegmentGroup, Segment, SegmentContext,
|
|
14
|
+
* HiddenInput. */
|
|
15
|
+
const DateInput = {
|
|
16
|
+
...DateInput$1,
|
|
17
|
+
Root: DateInputRoot
|
|
18
|
+
};
|
|
19
|
+
injectComponentStyle("date-input");
|
|
20
|
+
//#endregion
|
|
21
|
+
export { DateInput };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { DatePicker as DatePicker$1, DatePickerFocusChangeDetails, DatePickerOpenChangeDetails, DatePickerValueChangeDetails, DatePickerViewChangeDetails, DatePickerVisibleRangeChangeDetails } from "@ark-ui/react/date-picker";
|
|
3
|
+
//#region src/components/date-picker/index.d.ts
|
|
4
|
+
type DatePickerRootProps$1 = ComponentProps<typeof DatePicker$1.Root> & {
|
|
5
|
+
/** One rung of the control-height ladder for the field row. */
|
|
6
|
+
size?: "sm" | "md" | "lg";
|
|
7
|
+
};
|
|
8
|
+
declare function DatePickerRoot({ size, ...rest }: DatePickerRootProps$1): import("react").JSX.Element;
|
|
9
|
+
/** Ark's DatePicker, dressed in the paper-and-ink system: the popup
|
|
10
|
+
* dissolves in on elevation, selected days take the flat ink fill, and
|
|
11
|
+
* range middles run subtle with cut corners. The API is Ark's own —
|
|
12
|
+
* Root, Label, Control, Input, Trigger, ClearTrigger, Positioner,
|
|
13
|
+
* Content, View, ViewControl, ViewTrigger, RangeText, PrevTrigger,
|
|
14
|
+
* NextTrigger, Table*, MonthSelect, YearSelect, PresetTrigger. */
|
|
15
|
+
export declare const DatePicker: Omit<typeof DatePicker$1, "Root"> & {
|
|
16
|
+
Root: typeof DatePickerRoot;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export type { DatePickerFocusChangeDetails, DatePickerOpenChangeDetails, DatePickerValueChangeDetails, DatePickerViewChangeDetails, DatePickerVisibleRangeChangeDetails };
|