@bysages/react 0.2.3 → 0.3.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/README.md +16 -2
- package/dist/{ai-response-jZy-0Tvv.mjs → ai-response-BfKTmtCt.mjs} +8 -4
- package/dist/components/ai/index.d.mts +2 -2
- package/dist/components/ai/index.mjs +32 -17
- package/dist/components/ai-attachments/index.mjs +3 -1
- package/dist/components/ai-prompt-input/index.d.mts +1 -1
- package/dist/components/ai-prompt-input/index.mjs +8 -4
- package/dist/components/ai-response/index.d.mts +4 -2
- package/dist/components/ai-response/index.mjs +1 -1
- package/dist/components/autocomplete/index.mjs +3 -1
- package/dist/components/avatar/index.d.mts +4 -1
- package/dist/components/avatar/index.mjs +3 -2
- package/dist/components/banner/index.mjs +21 -17
- 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 +3 -8
- package/dist/components/breadcrumb/index.mjs +11 -1
- package/dist/components/browser/index.d.mts +23 -0
- package/dist/components/browser/index.mjs +70 -0
- package/dist/components/cascade-select/index.mjs +15 -5
- package/dist/components/command/index.mjs +9 -3
- package/dist/components/config-provider/index.d.mts +5 -2
- package/dist/components/config-provider/index.mjs +3 -2
- package/dist/components/data-view/index.d.mts +18 -0
- package/dist/components/data-view/index.mjs +66 -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 +13 -5
- package/dist/components/descriptions/index.mjs +20 -2
- package/dist/components/dock/index.d.mts +25 -0
- package/dist/components/dock/index.mjs +51 -0
- package/dist/components/dynamic-input/index.mjs +4 -2
- package/dist/components/file-upload/index.d.mts +8 -1
- package/dist/components/file-upload/index.mjs +20 -1
- package/dist/components/float-button/index.mjs +3 -1
- package/dist/components/form/index.mjs +1 -1
- package/dist/components/icon/index.d.mts +10 -5
- package/dist/components/icon/index.mjs +7 -7
- package/dist/components/image/index.d.mts +7 -1
- package/dist/components/image/index.mjs +3 -1
- package/dist/components/image-viewer/index.d.mts +7 -1
- package/dist/components/image-viewer/index.mjs +8 -4
- package/dist/components/input/index.d.mts +4 -1
- package/dist/components/input/index.mjs +1 -20
- package/dist/components/json-tree-view/index.d.mts +3 -3
- package/dist/components/json-tree-view/index.mjs +17 -4
- package/dist/components/layout/index.mjs +3 -1
- package/dist/components/list/index.d.mts +5 -4
- package/dist/components/list/index.mjs +10 -1
- package/dist/components/menubar/index.mjs +1 -0
- package/dist/components/order-list/index.d.mts +21 -0
- package/dist/components/order-list/index.mjs +161 -0
- package/dist/components/result/index.d.mts +31 -0
- package/dist/components/result/index.mjs +59 -0
- package/dist/components/select/index.d.mts +2 -17
- package/dist/components/select/index.mjs +2 -18
- package/dist/components/spinner/index.mjs +3 -1
- package/dist/components/split-button/index.mjs +3 -1
- package/dist/components/spotlight/index.d.mts +12 -0
- package/dist/components/spotlight/index.mjs +33 -0
- package/dist/components/steps/index.d.mts +5 -1
- package/dist/components/steps/index.mjs +10 -1
- package/dist/components/table/index.mjs +19 -15
- package/dist/components/tabs/index.d.mts +3 -1
- package/dist/components/tabs/index.mjs +3 -2
- package/dist/components/terminal/index.d.mts +17 -0
- package/dist/components/terminal/index.mjs +68 -0
- package/dist/components/timeline/index.d.mts +13 -11
- package/dist/components/timeline/index.mjs +11 -1
- package/dist/components/toc/index.d.mts +7 -1
- package/dist/components/toc/index.mjs +13 -1
- package/dist/components/toolbar/index.d.mts +17 -0
- package/dist/components/toolbar/index.mjs +29 -0
- package/dist/components/transfer/index.mjs +7 -5
- package/dist/components/tree-select/index.mjs +5 -3
- package/dist/components/tree-view/index.d.mts +10 -1
- package/dist/components/tree-view/index.mjs +22 -1
- 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 +53 -0
- package/dist/glyph-VI989p8H.mjs +14 -0
- package/dist/{index-DaAbbSz9.d.mts → index-Dn5mHf1g.d.mts} +738 -3786
- package/dist/index-Iy8m0Qev.d.mts +42 -0
- package/dist/index.d.mts +16 -3
- package/dist/index.mjs +28 -15
- package/dist/input-2oezH-dY.mjs +58 -0
- package/dist/messages-1jJWtaYU.mjs +16 -0
- package/dist/select-eAHutw56.mjs +70 -0
- package/package.json +30 -9
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import { CollectionItem } from "@ark-ui/react/collection";
|
|
3
|
+
import { Select, SelectRootComponentProps } from "@ark-ui/react/select";
|
|
4
|
+
//#region src/components/select/native.d.ts
|
|
5
|
+
/** One row of the platform's own list. */
|
|
6
|
+
interface NativeSelectOption {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** The native select wearing the field recipe: the platform's own list
|
|
12
|
+
* behind the same hairline shell the framed select wears. The shell is
|
|
13
|
+
* a wrapper so the indicator rides beside the value as a real stroke —
|
|
14
|
+
* the same chevron the framed trigger shows. */
|
|
15
|
+
interface NativeSelectProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
16
|
+
value?: string;
|
|
17
|
+
options: NativeSelectOption[];
|
|
18
|
+
/** One rung of the control-height ladder. */
|
|
19
|
+
size?: "sm" | "md" | "lg";
|
|
20
|
+
invalid?: boolean;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
onValueChange?: (value: string) => void;
|
|
24
|
+
}
|
|
25
|
+
declare function NativeSelect({ value, options, size, invalid, placeholder, disabled, onValueChange, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...rest }: NativeSelectProps): import("react").JSX.Element;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/components/select/index.d.ts
|
|
28
|
+
/** Ark's Select, dressed in the paper-and-ink system: the trigger is the
|
|
29
|
+
* whole control and its list dissolves open as a paper vessel, the checked
|
|
30
|
+
* row taking the flat ink fill. The API is Ark's own — Root, Label, Control,
|
|
31
|
+
* Trigger, ValueText, Indicator, ClearTrigger, HiddenSelect, Positioner,
|
|
32
|
+
* Content, List, Item, ItemText, ItemIndicator, ItemGroup, ItemGroupLabel. */
|
|
33
|
+
type SelectOwnProps = {
|
|
34
|
+
/** One rung of the control-height ladder for the trigger. */
|
|
35
|
+
size?: "sm" | "md" | "lg";
|
|
36
|
+
};
|
|
37
|
+
declare function SelectRoot<T extends CollectionItem>(props: SelectRootComponentProps<T, SelectOwnProps>): import("react").JSX.Element;
|
|
38
|
+
declare const Select$1: Omit<typeof Select, "Root"> & {
|
|
39
|
+
Root: typeof SelectRoot;
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { NativeSelectProps as i, NativeSelect as n, NativeSelectOption as r, Select$1 as t };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { a as SourceDocumentUIPart, c as TextUIPart, d as UIMessagePart, i as ReasoningUIPart, l as ToolUIPart, n as DataUIPart, o as SourceUrlUIPart, r as FileUIPart, s as StepStartUIPart, t as Ai, u as UIMessage } from "./index-DaAbbSz9.mjs";
|
|
2
1
|
import { Accordion } from "./components/accordion/index.mjs";
|
|
3
2
|
import { Affix, AffixProps } from "./components/affix/index.mjs";
|
|
4
3
|
import { Action, ActionProps } from "./components/ai-action/index.mjs";
|
|
@@ -11,6 +10,7 @@ import { AiResponse as Response, ResponseProps } from "./components/ai-response/
|
|
|
11
10
|
import { AiSource as Source, AiSources as Sources, SourceProps, SourcesProps } from "./components/ai-source/index.mjs";
|
|
12
11
|
import { AiSuggestion as Suggestion, SuggestionProps } from "./components/ai-suggestion/index.mjs";
|
|
13
12
|
import { AiTool as Tool, ToolProps, ToolStatus } from "./components/ai-tool/index.mjs";
|
|
13
|
+
import { a as FileUIPart, c as SourceUrlUIPart, d as ToolUIPart, f as UIMessage, i as DataUIPart, l as StepStartUIPart, n as AiActions, o as ReasoningUIPart, p as UIMessagePart, r as AiContent, s as SourceDocumentUIPart, t as Ai, u as TextUIPart } from "./index-Dn5mHf1g.mjs";
|
|
14
14
|
import { Alert, AlertProps, AlertStatus } from "./components/alert/index.mjs";
|
|
15
15
|
import { AngleSlider } from "./components/angle-slider/index.mjs";
|
|
16
16
|
import { AspectRatio, AspectRatioProps } from "./components/aspect-ratio/index.mjs";
|
|
@@ -20,7 +20,10 @@ import { Avatar, AvatarProps, AvatarSize } from "./components/avatar/index.mjs";
|
|
|
20
20
|
import { BackTop, BackTopProps } from "./components/back-top/index.mjs";
|
|
21
21
|
import { Badge, BadgeProps } from "./components/badge/index.mjs";
|
|
22
22
|
import { Banner, BannerRootProps, BannerStatus } from "./components/banner/index.mjs";
|
|
23
|
+
import { Bento, BentoCell, BentoCellProps, BentoProps, BentoRoot } from "./components/bento/index.mjs";
|
|
24
|
+
import { BlockUI, BlockUIProps } from "./components/block-ui/index.mjs";
|
|
23
25
|
import { Breadcrumb } from "./components/breadcrumb/index.mjs";
|
|
26
|
+
import { Browser, BrowserBody, BrowserDots, BrowserPartProps, BrowserRoot, BrowserTitleBar, BrowserUrlBar } from "./components/browser/index.mjs";
|
|
24
27
|
import { ButtonGroup, ButtonGroupProps } from "./components/button-group/index.mjs";
|
|
25
28
|
import { Button, ButtonProps } from "./components/button/index.mjs";
|
|
26
29
|
import { Calendar, CalendarProps } from "./components/calendar/index.mjs";
|
|
@@ -40,10 +43,13 @@ import { Command, CommandEntry, CommandProps } from "./components/command/index.
|
|
|
40
43
|
import { Comment, CommentProps } from "./components/comment/index.mjs";
|
|
41
44
|
import { ConfigContext, ConfigDensity, ConfigProvider, ConfigProviderProps, ConfigScene, useConfig } from "./components/config-provider/index.mjs";
|
|
42
45
|
import { Container, ContainerProps } from "./components/container/index.mjs";
|
|
46
|
+
import { DataView, DataViewProps } from "./components/data-view/index.mjs";
|
|
43
47
|
import { DateInput, DateInputFocusChangeDetails, DateInputValueChangeDetails } from "./components/date-input/index.mjs";
|
|
44
48
|
import { DatePicker, DatePickerFocusChangeDetails, DatePickerOpenChangeDetails, DatePickerValueChangeDetails, DatePickerViewChangeDetails, DatePickerVisibleRangeChangeDetails } from "./components/date-picker/index.mjs";
|
|
49
|
+
import { DeferredContent, DeferredContentProps } from "./components/deferred-content/index.mjs";
|
|
45
50
|
import { Descriptions, DescriptionsRoot, DescriptionsRootProps } from "./components/descriptions/index.mjs";
|
|
46
51
|
import { Dialog, DialogOpenChangeDetails } from "./components/dialog/index.mjs";
|
|
52
|
+
import { Dock, DockItem, DockItemProps, DockProps, DockRoot } from "./components/dock/index.mjs";
|
|
47
53
|
import { DownloadTrigger, DownloadTriggerBaseProps, DownloadTriggerProps, DownloadableData, UseDownloadProps, UseDownloadReturn, useDownload } from "./components/download-trigger/index.mjs";
|
|
48
54
|
import { Drawer } from "./components/drawer/index.mjs";
|
|
49
55
|
import { DynamicInput, DynamicInputProps } from "./components/dynamic-input/index.mjs";
|
|
@@ -81,6 +87,7 @@ import { Menubar, MenubarEntry, MenubarGroup, MenubarProps } from "./components/
|
|
|
81
87
|
import { Meter, MeterRootProps } from "./components/meter/index.mjs";
|
|
82
88
|
import { NavigationMenu } from "./components/navigation-menu/index.mjs";
|
|
83
89
|
import { NumberInput } from "./components/number-input/index.mjs";
|
|
90
|
+
import { OrderList, OrderListProps, OrderOption } from "./components/order-list/index.mjs";
|
|
84
91
|
import { PageHeader } from "./components/page-header/index.mjs";
|
|
85
92
|
import { Pagination } from "./components/pagination/index.mjs";
|
|
86
93
|
import { PasswordInput } from "./components/password-input/index.mjs";
|
|
@@ -93,9 +100,10 @@ import { Progress } from "./components/progress/index.mjs";
|
|
|
93
100
|
import { QrCode } from "./components/qr-code/index.mjs";
|
|
94
101
|
import { RadioGroup } from "./components/radio-group/index.mjs";
|
|
95
102
|
import { RatingGroup } from "./components/rating-group/index.mjs";
|
|
103
|
+
import { Result, ResultIcon, ResultRoot, ResultRootProps } from "./components/result/index.mjs";
|
|
96
104
|
import { ScrollArea } from "./components/scroll-area/index.mjs";
|
|
97
105
|
import { SegmentGroup } from "./components/segment-group/index.mjs";
|
|
98
|
-
import { Select } from "./
|
|
106
|
+
import { i as NativeSelectProps, n as NativeSelect, r as NativeSelectOption, t as Select } from "./index-Iy8m0Qev.mjs";
|
|
99
107
|
import { Separator, SeparatorProps } from "./components/separator/index.mjs";
|
|
100
108
|
import { SignaturePad } from "./components/signature-pad/index.mjs";
|
|
101
109
|
import { Skeleton, SkeletonProps } from "./components/skeleton/index.mjs";
|
|
@@ -103,6 +111,7 @@ import { Slider } from "./components/slider/index.mjs";
|
|
|
103
111
|
import { Spinner, SpinnerProps } from "./components/spinner/index.mjs";
|
|
104
112
|
import { SplitButton, SplitButtonEntry, SplitButtonProps } from "./components/split-button/index.mjs";
|
|
105
113
|
import { Splitter } from "./components/splitter/index.mjs";
|
|
114
|
+
import { Spotlight, SpotlightProps } from "./components/spotlight/index.mjs";
|
|
106
115
|
import { Stack, StackProps } from "./components/stack/index.mjs";
|
|
107
116
|
import { Stat, StatDeltaProps } from "./components/stat/index.mjs";
|
|
108
117
|
import { Steps } from "./components/steps/index.mjs";
|
|
@@ -111,6 +120,7 @@ import { Switch } from "./components/switch/index.mjs";
|
|
|
111
120
|
import { ColumnDef, DataTable, DataTableProps, FlexRender, SortingState, createColumnHelper } from "./components/table/index.mjs";
|
|
112
121
|
import { Tabs } from "./components/tabs/index.mjs";
|
|
113
122
|
import { TagsInput } from "./components/tags-input/index.mjs";
|
|
123
|
+
import { Terminal, TerminalProps } from "./components/terminal/index.mjs";
|
|
114
124
|
import { Textarea, TextareaProps } from "./components/textarea/index.mjs";
|
|
115
125
|
import { Timeline } from "./components/timeline/index.mjs";
|
|
116
126
|
import { Timer } from "./components/timer/index.mjs";
|
|
@@ -118,12 +128,15 @@ import { CreateToasterReturn, Toast, Toaster, createToaster } from "./components
|
|
|
118
128
|
import { Toc } from "./components/toc/index.mjs";
|
|
119
129
|
import { ToggleGroup } from "./components/toggle-group/index.mjs";
|
|
120
130
|
import { Toggle } from "./components/toggle/index.mjs";
|
|
131
|
+
import { Toolbar, ToolbarProps } from "./components/toolbar/index.mjs";
|
|
121
132
|
import { Tooltip } from "./components/tooltip/index.mjs";
|
|
122
133
|
import { Tour, TourInteractOutsideEvent, TourPointerDownOutsideEvent, TourStepDetails, useTour } from "./components/tour/index.mjs";
|
|
123
134
|
import { Transfer, TransferItem, TransferProps } from "./components/transfer/index.mjs";
|
|
124
135
|
import { TreeSelect, TreeSelectNode, TreeSelectProps } from "./components/tree-select/index.mjs";
|
|
125
136
|
import { TreeView } from "./components/tree-view/index.mjs";
|
|
126
137
|
import { Typography } from "./components/typography/index.mjs";
|
|
138
|
+
import { User, UserProps } from "./components/user/index.mjs";
|
|
139
|
+
import { VirtualList, VirtualListProps } from "./components/virtual-list/index.mjs";
|
|
127
140
|
import { Watermark, WatermarkProps } from "./components/watermark/index.mjs";
|
|
128
141
|
export * from "@bysages/core";
|
|
129
|
-
export { Accordion, Action, Action as AiAction, ActionProps, Affix, AffixProps, Ai, Attachment as AiAttachment, Attachment, Attachments as AiAttachments, Attachments, Message as AiMessage, Message, PromptInput as AiPromptInput, PromptInput, Reasoning as AiReasoning, Reasoning, Response as AiResponse, Response, Source as AiSource, Source, Sources as AiSources, Sources, Suggestion as AiSuggestion, Suggestion, Tool as AiTool, Tool, Alert, AlertProps, AlertStatus, AngleSlider, AspectRatio, AspectRatioProps, AttachmentProps, AutoComplete, AutoCompleteProps, Avatar, AvatarGroup, AvatarGroupProps, AvatarProps, AvatarSize, BackTop, BackTopProps, Badge, BadgeProps, Banner, BannerRootProps, BannerStatus, Breadcrumb, Button, ButtonGroup, ButtonGroupProps, ButtonProps, Calendar, CalendarProps, Card, Carousel, CascadeSelect, CascadeSelectNode, CascadeSelectProps, Checkbox, CheckboxGroup, CheckboxGroupProps, CheckboxOption, Chip, ChipProps, ClientOnly, type ClientOnlyProps, Clipboard, Collapsible, type CollectionItem, type CollectionOptions, ColorPicker, type ColumnDef, Combobox, Command, CommandEntry, CommandProps, Comment, CommentProps, ConfigContext, ConfigDensity, ConfigProvider, ConfigProviderProps, ConfigScene, Container, ContainerProps, type CreateToasterReturn, DataTable, DataTableProps, type DataUIPart, DateInput, type DateInputFocusChangeDetails, type DateInputValueChangeDetails, DatePicker, type DatePickerFocusChangeDetails, type DatePickerOpenChangeDetails, type DatePickerValueChangeDetails, type DatePickerViewChangeDetails, type DatePickerVisibleRangeChangeDetails, Descriptions, DescriptionsRoot, DescriptionsRootProps, Dialog, type DialogOpenChangeDetails, DownloadTrigger, type DownloadTriggerBaseProps, type DownloadTriggerProps, type DownloadableData, Drawer, DynamicInput, DynamicInputProps, Editable, Ellipsis, EllipsisProps, Empty, FLOAT_BUTTON_CONTEXT, Field, type FieldApi, Fieldset, type FilePathTreeNode, type FileUIPart, FileUpload, type FlatTreeNode, FlexRender, FloatButton, FloatButtonContextValue, FloatButtonPlacement, FloatButtonRootProps, FloatButtonSize, FloatingPanel, FocusTrap, type FocusTrapBaseProps, type FocusTrapProps, Form, type FormApi, FormField, FormFieldProps, FormProps, Format, Frame, Grid, type GridCollection, type GridCollectionOptions, GridProps, Highlight, HoverCard, Icon, IconProps, Image, ImageCropper, ImageProps, ImageViewer, ImageViewerProps, Input, InputGroup, InputGroupPartProps, InputProps, JsonTreeView, Kbd, KbdProps, Layout, LayoutContextValue, LayoutRootProps, LayoutSiderProps, Link, LinkProps, List, type ListCollection, ListContentProps, ListRootProps, Listbox, Marquee, Masonry, MasonryProps, MentionEntry, Mentions, MentionsProps, MentionsVessel, MentionsVesselProps, Menu, Menubar, MenubarEntry, MenubarGroup, MenubarProps, MessageProps, Meter, MeterRootProps, NavigationMenu, NumberInput, PageHeader, Pagination, PasswordInput, PinInput, Popconfirm, PopconfirmProps, Popover, Presence, type PresenceBaseProps, type PresenceProps, PresenceProvider, Progress, ProgressGroup, ProgressGroupProps, ProgressSegment, PromptInputProps, QrCode, RadioGroup, RatingGroup, ReasoningProps, type ReasoningUIPart, ResponseProps, ScrollArea, SegmentGroup, Select, Separator, SeparatorProps, SignaturePad, Skeleton, SkeletonProps, Slider, type SortingState, type SourceDocumentUIPart, SourceProps, type SourceUrlUIPart, SourcesProps, Spinner, SpinnerProps, SplitButton, SplitButtonEntry, SplitButtonProps, Splitter, Stack, StackProps, Stat, StatDeltaProps, type StepStartUIPart, Steps, SuggestionProps, Swap, Switch, Tabs, TagsInput, type TextUIPart, Textarea, TextareaProps, Timeline, Timer, Toast, Toaster, Toc, Toggle, ToggleGroup, ToolProps, ToolStatus, type ToolUIPart, Tooltip, Tour, type TourInteractOutsideEvent, type TourPointerDownOutsideEvent, type TourStepDetails, Transfer, TransferItem, TransferProps, type TreeCollection, type TreeCollectionOptions, type TreeNode, TreeSelect, TreeSelectNode, TreeSelectProps, TreeView, Typography, type UIMessage, type UIMessagePart, type UseAsyncListProps, type UseAsyncListReturn, type UseDownloadProps, type UseDownloadReturn, type UseListCollectionProps, type UseListCollectionReturn, type UseListSelectionProps, type UseListSelectionReturn, type UseMentionsHandlers, type UseMentionsOptions, type UsePresenceContext, type UsePresenceProps, type UsePresenceReturn, Watermark, WatermarkProps, createColumnHelper, createFileTreeCollection, createGridCollection, createToaster, createTreeCollection, useAsyncList, useConfig, useDownload, useField, useForm, useListCollection, useListSelection, useMentions, usePresence, usePresenceContext, useTour };
|
|
142
|
+
export { Accordion, Action, Action as AiAction, ActionProps, Affix, AffixProps, Ai, AiActions, Attachment as AiAttachment, Attachment, Attachments as AiAttachments, Attachments, AiContent, Message as AiMessage, Message, PromptInput as AiPromptInput, PromptInput, Reasoning as AiReasoning, Reasoning, Response as AiResponse, Response, Source as AiSource, Source, Sources as AiSources, Sources, Suggestion as AiSuggestion, Suggestion, Tool as AiTool, Tool, Alert, AlertProps, AlertStatus, AngleSlider, AspectRatio, AspectRatioProps, AttachmentProps, AutoComplete, AutoCompleteProps, Avatar, AvatarGroup, AvatarGroupProps, AvatarProps, AvatarSize, BackTop, BackTopProps, Badge, BadgeProps, Banner, BannerRootProps, BannerStatus, Bento, BentoCell, BentoCellProps, BentoProps, BentoRoot, BlockUI, BlockUIProps, Breadcrumb, Browser, BrowserBody, BrowserDots, BrowserPartProps, BrowserRoot, BrowserTitleBar, BrowserUrlBar, Button, ButtonGroup, ButtonGroupProps, ButtonProps, Calendar, CalendarProps, Card, Carousel, CascadeSelect, CascadeSelectNode, CascadeSelectProps, Checkbox, CheckboxGroup, CheckboxGroupProps, CheckboxOption, Chip, ChipProps, ClientOnly, type ClientOnlyProps, Clipboard, Collapsible, type CollectionItem, type CollectionOptions, ColorPicker, type ColumnDef, Combobox, Command, CommandEntry, CommandProps, Comment, CommentProps, ConfigContext, ConfigDensity, ConfigProvider, ConfigProviderProps, ConfigScene, Container, ContainerProps, type CreateToasterReturn, DataTable, DataTableProps, type DataUIPart, DataView, DataViewProps, DateInput, type DateInputFocusChangeDetails, type DateInputValueChangeDetails, DatePicker, type DatePickerFocusChangeDetails, type DatePickerOpenChangeDetails, type DatePickerValueChangeDetails, type DatePickerViewChangeDetails, type DatePickerVisibleRangeChangeDetails, DeferredContent, DeferredContentProps, Descriptions, DescriptionsRoot, DescriptionsRootProps, Dialog, type DialogOpenChangeDetails, Dock, DockItem, DockItemProps, DockProps, DockRoot, DownloadTrigger, type DownloadTriggerBaseProps, type DownloadTriggerProps, type DownloadableData, Drawer, DynamicInput, DynamicInputProps, Editable, Ellipsis, EllipsisProps, Empty, FLOAT_BUTTON_CONTEXT, Field, type FieldApi, Fieldset, type FilePathTreeNode, type FileUIPart, FileUpload, type FlatTreeNode, FlexRender, FloatButton, FloatButtonContextValue, FloatButtonPlacement, FloatButtonRootProps, FloatButtonSize, FloatingPanel, FocusTrap, type FocusTrapBaseProps, type FocusTrapProps, Form, type FormApi, FormField, FormFieldProps, FormProps, Format, Frame, Grid, type GridCollection, type GridCollectionOptions, GridProps, Highlight, HoverCard, Icon, IconProps, Image, ImageCropper, ImageProps, ImageViewer, ImageViewerProps, Input, InputGroup, InputGroupPartProps, InputProps, JsonTreeView, Kbd, KbdProps, Layout, LayoutContextValue, LayoutRootProps, LayoutSiderProps, Link, LinkProps, List, type ListCollection, ListContentProps, ListRootProps, Listbox, Marquee, Masonry, MasonryProps, MentionEntry, Mentions, MentionsProps, MentionsVessel, MentionsVesselProps, Menu, Menubar, MenubarEntry, MenubarGroup, MenubarProps, MessageProps, Meter, MeterRootProps, NativeSelect, type NativeSelectOption, type NativeSelectProps, NavigationMenu, NumberInput, OrderList, OrderListProps, OrderOption, PageHeader, Pagination, PasswordInput, PinInput, Popconfirm, PopconfirmProps, Popover, Presence, type PresenceBaseProps, type PresenceProps, PresenceProvider, Progress, ProgressGroup, ProgressGroupProps, ProgressSegment, PromptInputProps, QrCode, RadioGroup, RatingGroup, ReasoningProps, type ReasoningUIPart, ResponseProps, Result, ResultIcon, ResultRoot, ResultRootProps, ScrollArea, SegmentGroup, Select, Separator, SeparatorProps, SignaturePad, Skeleton, SkeletonProps, Slider, type SortingState, type SourceDocumentUIPart, SourceProps, type SourceUrlUIPart, SourcesProps, Spinner, SpinnerProps, SplitButton, SplitButtonEntry, SplitButtonProps, Splitter, Spotlight, SpotlightProps, Stack, StackProps, Stat, StatDeltaProps, type StepStartUIPart, Steps, SuggestionProps, Swap, Switch, Tabs, TagsInput, Terminal, TerminalProps, type TextUIPart, Textarea, TextareaProps, Timeline, Timer, Toast, Toaster, Toc, Toggle, ToggleGroup, ToolProps, ToolStatus, type ToolUIPart, Toolbar, ToolbarProps, Tooltip, Tour, type TourInteractOutsideEvent, type TourPointerDownOutsideEvent, type TourStepDetails, Transfer, TransferItem, TransferProps, type TreeCollection, type TreeCollectionOptions, type TreeNode, TreeSelect, TreeSelectNode, TreeSelectProps, TreeView, Typography, type UIMessage, type UIMessagePart, type UseAsyncListProps, type UseAsyncListReturn, type UseDownloadProps, type UseDownloadReturn, type UseListCollectionProps, type UseListCollectionReturn, type UseListSelectionProps, type UseListSelectionReturn, type UseMentionsHandlers, type UseMentionsOptions, type UsePresenceContext, type UsePresenceProps, type UsePresenceReturn, User, UserProps, VirtualList, VirtualListProps, Watermark, WatermarkProps, createColumnHelper, createFileTreeCollection, createGridCollection, createToaster, createTreeCollection, useAsyncList, useConfig, useDownload, useField, useForm, useListCollection, useListSelection, useMentions, usePresence, usePresenceContext, useTour };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Accordion } from "./components/accordion/index.mjs";
|
|
2
2
|
import { Affix } from "./components/affix/index.mjs";
|
|
3
|
+
import { ConfigProvider, useConfig } from "./components/config-provider/index.mjs";
|
|
3
4
|
import { Button } from "./components/button/index.mjs";
|
|
4
5
|
import { Action } from "./components/ai-action/index.mjs";
|
|
5
6
|
import { AiMessage as Message } from "./components/ai-message/index.mjs";
|
|
@@ -8,11 +9,11 @@ import { n as MentionsVessel, r as useMentions, t as Mentions } from "./mentions
|
|
|
8
9
|
import { AiPromptInput as PromptInput } from "./components/ai-prompt-input/index.mjs";
|
|
9
10
|
import { Collapsible } from "./components/collapsible/index.mjs";
|
|
10
11
|
import { AiReasoning as Reasoning } from "./components/ai-reasoning/index.mjs";
|
|
11
|
-
import { t as Response } from "./ai-response-
|
|
12
|
+
import { t as Response } from "./ai-response-BfKTmtCt.mjs";
|
|
12
13
|
import { AiSource as Source, AiSources as Sources } from "./components/ai-source/index.mjs";
|
|
13
14
|
import { AiSuggestion as Suggestion } from "./components/ai-suggestion/index.mjs";
|
|
14
15
|
import { AiTool as Tool } from "./components/ai-tool/index.mjs";
|
|
15
|
-
import { Ai } from "./components/ai/index.mjs";
|
|
16
|
+
import { Ai, AiActions, AiContent } from "./components/ai/index.mjs";
|
|
16
17
|
import { AiAttachment as Attachment, AiAttachments as Attachments } from "./components/ai-attachments/index.mjs";
|
|
17
18
|
import { Alert } from "./components/alert/index.mjs";
|
|
18
19
|
import { AngleSlider } from "./components/angle-slider/index.mjs";
|
|
@@ -22,30 +23,37 @@ import { Avatar } from "./components/avatar/index.mjs";
|
|
|
22
23
|
import { AvatarGroup } from "./components/avatar-group/index.mjs";
|
|
23
24
|
import { BackTop } from "./components/back-top/index.mjs";
|
|
24
25
|
import { Badge } from "./components/badge/index.mjs";
|
|
26
|
+
import { Banner } from "./components/banner/index.mjs";
|
|
27
|
+
import { Bento, BentoCell, BentoRoot } from "./components/bento/index.mjs";
|
|
28
|
+
import { Spinner } from "./components/spinner/index.mjs";
|
|
29
|
+
import { BlockUI } from "./components/block-ui/index.mjs";
|
|
25
30
|
import { Breadcrumb } from "./components/breadcrumb/index.mjs";
|
|
31
|
+
import { Browser, BrowserBody, BrowserDots, BrowserRoot, BrowserTitleBar, BrowserUrlBar } from "./components/browser/index.mjs";
|
|
26
32
|
import { ButtonGroup } from "./components/button-group/index.mjs";
|
|
27
|
-
import { Banner } from "./components/banner/index.mjs";
|
|
28
33
|
import { Calendar } from "./components/calendar/index.mjs";
|
|
29
34
|
import { Card } from "./components/card/index.mjs";
|
|
30
|
-
import { Input } from "./components/input/index.mjs";
|
|
31
|
-
import { CascadeSelect } from "./components/cascade-select/index.mjs";
|
|
32
35
|
import { Carousel } from "./components/carousel/index.mjs";
|
|
36
|
+
import { t as Input } from "./input-2oezH-dY.mjs";
|
|
37
|
+
import { CascadeSelect } from "./components/cascade-select/index.mjs";
|
|
33
38
|
import { Checkbox } from "./components/checkbox/index.mjs";
|
|
34
39
|
import { CheckboxGroup } from "./components/checkbox-group/index.mjs";
|
|
35
40
|
import { Chip } from "./components/chip/index.mjs";
|
|
36
|
-
import { Clipboard } from "./components/clipboard/index.mjs";
|
|
37
41
|
import { ClientOnly } from "./components/client-only/index.mjs";
|
|
38
|
-
import {
|
|
42
|
+
import { Clipboard } from "./components/clipboard/index.mjs";
|
|
39
43
|
import { createFileTreeCollection, createGridCollection, createTreeCollection, useAsyncList, useListCollection, useListSelection } from "./components/collection/index.mjs";
|
|
44
|
+
import { ColorPicker } from "./components/color-picker/index.mjs";
|
|
40
45
|
import { Combobox } from "./components/combobox/index.mjs";
|
|
41
46
|
import { Command } from "./components/command/index.mjs";
|
|
42
47
|
import { Comment } from "./components/comment/index.mjs";
|
|
43
|
-
import { ConfigProvider, useConfig } from "./components/config-provider/index.mjs";
|
|
44
48
|
import { Container } from "./components/container/index.mjs";
|
|
49
|
+
import { Pagination } from "./components/pagination/index.mjs";
|
|
50
|
+
import { DataView } from "./components/data-view/index.mjs";
|
|
45
51
|
import { DateInput } from "./components/date-input/index.mjs";
|
|
46
52
|
import { DatePicker } from "./components/date-picker/index.mjs";
|
|
53
|
+
import { DeferredContent } from "./components/deferred-content/index.mjs";
|
|
47
54
|
import { Descriptions, DescriptionsRoot } from "./components/descriptions/index.mjs";
|
|
48
55
|
import { Dialog } from "./components/dialog/index.mjs";
|
|
56
|
+
import { Dock, DockItem, DockRoot } from "./components/dock/index.mjs";
|
|
49
57
|
import { DownloadTrigger, useDownload } from "./components/download-trigger/index.mjs";
|
|
50
58
|
import { Drawer } from "./components/drawer/index.mjs";
|
|
51
59
|
import { DynamicInput } from "./components/dynamic-input/index.mjs";
|
|
@@ -81,7 +89,8 @@ import { Menubar } from "./components/menubar/index.mjs";
|
|
|
81
89
|
import { Meter } from "./components/meter/index.mjs";
|
|
82
90
|
import { NavigationMenu } from "./components/navigation-menu/index.mjs";
|
|
83
91
|
import { NumberInput } from "./components/number-input/index.mjs";
|
|
84
|
-
import {
|
|
92
|
+
import { OrderList } from "./components/order-list/index.mjs";
|
|
93
|
+
import { PageHeader } from "./components/page-header/index.mjs";
|
|
85
94
|
import { PasswordInput } from "./components/password-input/index.mjs";
|
|
86
95
|
import { PinInput } from "./components/pin-input/index.mjs";
|
|
87
96
|
import { Popconfirm } from "./components/popconfirm/index.mjs";
|
|
@@ -92,38 +101,42 @@ import { ProgressGroup } from "./components/progress-group/index.mjs";
|
|
|
92
101
|
import { QrCode } from "./components/qr-code/index.mjs";
|
|
93
102
|
import { RadioGroup } from "./components/radio-group/index.mjs";
|
|
94
103
|
import { RatingGroup } from "./components/rating-group/index.mjs";
|
|
104
|
+
import { Result, ResultIcon, ResultRoot } from "./components/result/index.mjs";
|
|
95
105
|
import { ScrollArea } from "./components/scroll-area/index.mjs";
|
|
96
106
|
import { SegmentGroup } from "./components/segment-group/index.mjs";
|
|
97
|
-
import { Select } from "./
|
|
107
|
+
import { n as NativeSelect, t as Select } from "./select-eAHutw56.mjs";
|
|
98
108
|
import { Separator } from "./components/separator/index.mjs";
|
|
99
109
|
import { SignaturePad } from "./components/signature-pad/index.mjs";
|
|
100
110
|
import { Skeleton } from "./components/skeleton/index.mjs";
|
|
101
111
|
import { Slider } from "./components/slider/index.mjs";
|
|
102
112
|
import { SplitButton } from "./components/split-button/index.mjs";
|
|
103
113
|
import { Splitter } from "./components/splitter/index.mjs";
|
|
114
|
+
import { Spotlight } from "./components/spotlight/index.mjs";
|
|
104
115
|
import { Stack } from "./components/stack/index.mjs";
|
|
105
|
-
import { PageHeader } from "./components/page-header/index.mjs";
|
|
106
|
-
import { Spinner } from "./components/spinner/index.mjs";
|
|
107
116
|
import { Stat } from "./components/stat/index.mjs";
|
|
108
117
|
import { Steps } from "./components/steps/index.mjs";
|
|
109
118
|
import { Swap } from "./components/swap/index.mjs";
|
|
110
119
|
import { Switch } from "./components/switch/index.mjs";
|
|
120
|
+
import { DataTable, FlexRender, createColumnHelper } from "./components/table/index.mjs";
|
|
111
121
|
import { Tabs } from "./components/tabs/index.mjs";
|
|
112
122
|
import { TagsInput } from "./components/tags-input/index.mjs";
|
|
113
|
-
import {
|
|
123
|
+
import { Terminal } from "./components/terminal/index.mjs";
|
|
114
124
|
import { Textarea } from "./components/textarea/index.mjs";
|
|
115
125
|
import { Timeline } from "./components/timeline/index.mjs";
|
|
116
126
|
import { Timer } from "./components/timer/index.mjs";
|
|
117
127
|
import { Toast, Toaster, createToaster } from "./components/toast/index.mjs";
|
|
118
128
|
import { Toc } from "./components/toc/index.mjs";
|
|
119
129
|
import { Toggle } from "./components/toggle/index.mjs";
|
|
120
|
-
import { Typography } from "./components/typography/index.mjs";
|
|
121
130
|
import { ToggleGroup } from "./components/toggle-group/index.mjs";
|
|
131
|
+
import { Toolbar } from "./components/toolbar/index.mjs";
|
|
122
132
|
import { Tooltip } from "./components/tooltip/index.mjs";
|
|
123
133
|
import { Tour, useTour } from "./components/tour/index.mjs";
|
|
124
134
|
import { Transfer } from "./components/transfer/index.mjs";
|
|
125
135
|
import { TreeSelect } from "./components/tree-select/index.mjs";
|
|
126
136
|
import { TreeView } from "./components/tree-view/index.mjs";
|
|
137
|
+
import { Typography } from "./components/typography/index.mjs";
|
|
138
|
+
import { User } from "./components/user/index.mjs";
|
|
139
|
+
import { VirtualList } from "./components/virtual-list/index.mjs";
|
|
127
140
|
import { Watermark } from "./components/watermark/index.mjs";
|
|
128
141
|
export * from "@bysages/core";
|
|
129
|
-
export { Accordion, Action, Action as AiAction, Affix, Ai, Attachment as AiAttachment, Attachment, Attachments as AiAttachments, Attachments, Message as AiMessage, Message, PromptInput as AiPromptInput, PromptInput, Reasoning as AiReasoning, Reasoning, Response as AiResponse, Response, Source as AiSource, Source, Sources as AiSources, Sources, Suggestion as AiSuggestion, Suggestion, Tool as AiTool, Tool, Alert, AngleSlider, AspectRatio, AutoComplete, Avatar, AvatarGroup, BackTop, Badge, Banner, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, CascadeSelect, Checkbox, CheckboxGroup, Chip, ClientOnly, Clipboard, Collapsible, ColorPicker, Combobox, Command, Comment, ConfigProvider, Container, DataTable, DateInput, DatePicker, Descriptions, DescriptionsRoot, Dialog, DownloadTrigger, Drawer, DynamicInput, Editable, Ellipsis, Empty, FLOAT_BUTTON_CONTEXT, Field, Fieldset, FileUpload, FlexRender, FloatButton, FloatingPanel, FocusTrap, Form, FormField, Format, Frame, Grid, Highlight, HoverCard, Icon, Image, ImageCropper, ImageViewer, Input, InputGroup, JsonTreeView, Kbd, Layout, Link, List, Listbox, Marquee, Masonry, Mentions, MentionsVessel, Menu, Menubar, Meter, NavigationMenu, NumberInput, PageHeader, Pagination, PasswordInput, PinInput, Popconfirm, Popover, Presence, PresenceProvider, Progress, ProgressGroup, QrCode, RadioGroup, RatingGroup, ScrollArea, SegmentGroup, Select, Separator, SignaturePad, Skeleton, Slider, Spinner, SplitButton, Splitter, Stack, Stat, Steps, Swap, Switch, Tabs, TagsInput, Textarea, Timeline, Timer, Toast, Toaster, Toc, Toggle, ToggleGroup, Tooltip, Tour, Transfer, TreeSelect, TreeView, Typography, Watermark, createColumnHelper, createFileTreeCollection, createGridCollection, createToaster, createTreeCollection, useAsyncList, useConfig, useDownload, useField, useForm, useListCollection, useListSelection, useMentions, usePresence, usePresenceContext, useTour };
|
|
142
|
+
export { Accordion, Action, Action as AiAction, Affix, Ai, AiActions, Attachment as AiAttachment, Attachment, Attachments as AiAttachments, Attachments, AiContent, Message as AiMessage, Message, PromptInput as AiPromptInput, PromptInput, Reasoning as AiReasoning, Reasoning, Response as AiResponse, Response, Source as AiSource, Source, Sources as AiSources, Sources, Suggestion as AiSuggestion, Suggestion, Tool as AiTool, Tool, Alert, AngleSlider, AspectRatio, AutoComplete, Avatar, AvatarGroup, BackTop, Badge, Banner, Bento, BentoCell, BentoRoot, BlockUI, Breadcrumb, Browser, BrowserBody, BrowserDots, BrowserRoot, BrowserTitleBar, BrowserUrlBar, Button, ButtonGroup, Calendar, Card, Carousel, CascadeSelect, Checkbox, CheckboxGroup, Chip, ClientOnly, Clipboard, Collapsible, ColorPicker, Combobox, Command, Comment, ConfigProvider, Container, DataTable, DataView, DateInput, DatePicker, DeferredContent, Descriptions, DescriptionsRoot, Dialog, Dock, DockItem, DockRoot, DownloadTrigger, Drawer, DynamicInput, Editable, Ellipsis, Empty, FLOAT_BUTTON_CONTEXT, Field, Fieldset, FileUpload, FlexRender, FloatButton, FloatingPanel, FocusTrap, Form, FormField, Format, Frame, Grid, Highlight, HoverCard, Icon, Image, ImageCropper, ImageViewer, Input, InputGroup, JsonTreeView, Kbd, Layout, Link, List, Listbox, Marquee, Masonry, Mentions, MentionsVessel, Menu, Menubar, Meter, NativeSelect, NavigationMenu, NumberInput, OrderList, PageHeader, Pagination, PasswordInput, PinInput, Popconfirm, Popover, Presence, PresenceProvider, Progress, ProgressGroup, QrCode, RadioGroup, RatingGroup, Result, ResultIcon, ResultRoot, ScrollArea, SegmentGroup, Select, Separator, SignaturePad, Skeleton, Slider, Spinner, SplitButton, Splitter, Spotlight, Stack, Stat, Steps, Swap, Switch, Tabs, TagsInput, Terminal, Textarea, Timeline, Timer, Toast, Toaster, Toc, Toggle, ToggleGroup, Toolbar, Tooltip, Tour, Transfer, TreeSelect, TreeView, Typography, User, VirtualList, Watermark, createColumnHelper, createFileTreeCollection, createGridCollection, createToaster, createTreeCollection, useAsyncList, useConfig, useDownload, useField, useForm, useListCollection, useListSelection, useMentions, usePresence, usePresenceContext, useTour };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { useFieldContext } from "@ark-ui/react/field";
|
|
5
|
+
//#region src/components/input/mask.ts
|
|
6
|
+
function accepts(slot, ch) {
|
|
7
|
+
if (slot === "9") return /\d/.test(ch);
|
|
8
|
+
if (slot === "a") return /[a-zA-Z]/.test(ch);
|
|
9
|
+
return /[\da-zA-Z]/.test(ch);
|
|
10
|
+
}
|
|
11
|
+
/** Apply the entry mask: `9` takes a digit, `a` a letter, `*` either;
|
|
12
|
+
* every other character is literal. A literal already typed is consumed,
|
|
13
|
+
* not duplicated; a literal met out of place holds the walk and lets its
|
|
14
|
+
* own slot claim it — so deleting through the middle reflows the shape
|
|
15
|
+
* instead of corrupting it. */
|
|
16
|
+
function applyMask(raw, mask) {
|
|
17
|
+
const literals = new Set(mask.split("").filter((s) => s !== "9" && s !== "a" && s !== "*"));
|
|
18
|
+
let out = "";
|
|
19
|
+
let at = 0;
|
|
20
|
+
slots: for (const slot of mask) {
|
|
21
|
+
if (at >= raw.length) break;
|
|
22
|
+
if (slot === "9" || slot === "a" || slot === "*") {
|
|
23
|
+
let ch = raw[at];
|
|
24
|
+
while (ch !== void 0 && !accepts(slot, ch)) {
|
|
25
|
+
if (literals.has(ch)) continue slots;
|
|
26
|
+
at += 1;
|
|
27
|
+
ch = raw[at];
|
|
28
|
+
}
|
|
29
|
+
if (ch === void 0) break;
|
|
30
|
+
out += ch;
|
|
31
|
+
at += 1;
|
|
32
|
+
} else if (raw[at] === slot) {
|
|
33
|
+
at += 1;
|
|
34
|
+
out += slot;
|
|
35
|
+
} else out += slot;
|
|
36
|
+
}
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/components/input/index.tsx
|
|
41
|
+
const Input = forwardRef(function Input({ value, size = "md", invalid = false, mask, onValueChange, ...rest }, ref) {
|
|
42
|
+
injectComponentStyle("input");
|
|
43
|
+
const field = useFieldContext();
|
|
44
|
+
const fieldProps = field?.getInputProps() ?? {};
|
|
45
|
+
return /* @__PURE__ */ jsx("input", {
|
|
46
|
+
...fieldProps,
|
|
47
|
+
...rest,
|
|
48
|
+
...value !== void 0 ? { value } : {},
|
|
49
|
+
"data-scope": "input",
|
|
50
|
+
"data-part": "root",
|
|
51
|
+
"data-size": size,
|
|
52
|
+
ref,
|
|
53
|
+
"data-invalid": invalid || field?.invalid ? "" : void 0,
|
|
54
|
+
onChange: (event) => onValueChange?.(mask ? applyMask(event.target.value, mask) : event.target.value)
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
//#endregion
|
|
58
|
+
export { Input as t };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useConfig } from "./components/config-provider/index.mjs";
|
|
2
|
+
import { resolveComponentMessages } from "@bysages/core";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
//#region src/internal/messages.ts
|
|
5
|
+
/** Complete wrapper-owned copy for the nearest ConfigProvider, resolved
|
|
6
|
+
* from its locale and partial message overrides. */
|
|
7
|
+
function useComponentMessages() {
|
|
8
|
+
const config = useConfig();
|
|
9
|
+
return useMemo(() => resolveComponentMessages(config.locale ?? "en", config.messages), [config.locale, config.messages]);
|
|
10
|
+
}
|
|
11
|
+
/** Fill a core message's `{name}`-shaped slots. */
|
|
12
|
+
function formatMessage(template, values) {
|
|
13
|
+
return template.replace(/\{(\w+)\}/g, (match, key) => key in values ? String(values[key]) : match);
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { useComponentMessages as n, formatMessage as t };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useFieldContext } from "@ark-ui/react/field";
|
|
4
|
+
import { Select } from "@ark-ui/react/select";
|
|
5
|
+
//#region src/components/select/native.tsx
|
|
6
|
+
function NativeSelect({ value, options, size = "md", invalid = false, placeholder, disabled = false, onValueChange, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...rest }) {
|
|
7
|
+
injectComponentStyle("select");
|
|
8
|
+
const field = useFieldContext();
|
|
9
|
+
const fieldProps = field?.getInputProps() ?? {};
|
|
10
|
+
const empty = value == null || value === "";
|
|
11
|
+
const off = disabled || field?.disabled;
|
|
12
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
13
|
+
...rest,
|
|
14
|
+
"data-scope": "select",
|
|
15
|
+
"data-part": "native-root",
|
|
16
|
+
"data-size": size,
|
|
17
|
+
"data-invalid": invalid || field?.invalid ? "" : void 0,
|
|
18
|
+
"data-disabled": off ? "" : void 0,
|
|
19
|
+
"data-placeholder-shown": empty ? "" : void 0,
|
|
20
|
+
children: [/* @__PURE__ */ jsxs("select", {
|
|
21
|
+
...fieldProps,
|
|
22
|
+
"aria-label": ariaLabel,
|
|
23
|
+
"aria-labelledby": ariaLabelledby,
|
|
24
|
+
value: value ?? "",
|
|
25
|
+
"data-scope": "select",
|
|
26
|
+
"data-part": "native",
|
|
27
|
+
disabled: off || void 0,
|
|
28
|
+
onChange: (event) => onValueChange?.(event.target.value),
|
|
29
|
+
children: [placeholder ? /* @__PURE__ */ jsx("option", {
|
|
30
|
+
value: "",
|
|
31
|
+
disabled: true,
|
|
32
|
+
hidden: empty ? void 0 : true,
|
|
33
|
+
children: placeholder
|
|
34
|
+
}) : null, options.map((option) => /* @__PURE__ */ jsx("option", {
|
|
35
|
+
value: option.value,
|
|
36
|
+
disabled: option.disabled,
|
|
37
|
+
children: option.label
|
|
38
|
+
}, option.value))]
|
|
39
|
+
}), /* @__PURE__ */ jsx("svg", {
|
|
40
|
+
"data-scope": "select",
|
|
41
|
+
"data-part": "native-icon",
|
|
42
|
+
viewBox: "0 0 16 16",
|
|
43
|
+
"aria-hidden": "true",
|
|
44
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
45
|
+
d: "M4 6l4 4 4-4",
|
|
46
|
+
fill: "none",
|
|
47
|
+
stroke: "currentColor",
|
|
48
|
+
strokeWidth: 1.5,
|
|
49
|
+
strokeLinecap: "round",
|
|
50
|
+
strokeLinejoin: "round"
|
|
51
|
+
})
|
|
52
|
+
})]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/components/select/index.tsx
|
|
57
|
+
function SelectRoot(props) {
|
|
58
|
+
const { size = "md", ...rest } = props;
|
|
59
|
+
return /* @__PURE__ */ jsx(Select.Root, {
|
|
60
|
+
...rest,
|
|
61
|
+
"data-size": size
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
const Select$1 = {
|
|
65
|
+
...Select,
|
|
66
|
+
Root: SelectRoot
|
|
67
|
+
};
|
|
68
|
+
injectComponentStyle("select");
|
|
69
|
+
//#endregion
|
|
70
|
+
export { NativeSelect as n, Select$1 as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bysages/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "By Sages Elements components for React — styled by the paper-and-ink design tokens",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessible",
|
|
@@ -110,37 +110,58 @@
|
|
|
110
110
|
".": {
|
|
111
111
|
"types": "./dist/index.d.mts",
|
|
112
112
|
"import": "./dist/index.mjs"
|
|
113
|
+
},
|
|
114
|
+
"./generative": {
|
|
115
|
+
"types": "./dist/generative/index.d.mts",
|
|
116
|
+
"import": "./dist/generative/index.mjs"
|
|
113
117
|
}
|
|
114
118
|
},
|
|
115
119
|
"dependencies": {
|
|
116
120
|
"@ark-ui/react": "5.39.2",
|
|
117
|
-
"@tanstack/markdown": "0.0
|
|
121
|
+
"@tanstack/markdown": "1.0.0",
|
|
118
122
|
"@tanstack/react-form": "1.33.5",
|
|
119
123
|
"@tanstack/react-table": "9.2.4",
|
|
120
124
|
"@tanstack/react-virtual": "3.14.13",
|
|
121
125
|
"@zag-js/cascade-select": "1.44.0",
|
|
122
126
|
"@zag-js/react": "1.44.0",
|
|
123
|
-
"@bysages/core": "0.
|
|
124
|
-
"@bysages/icons": "0.
|
|
127
|
+
"@bysages/core": "0.3.1",
|
|
128
|
+
"@bysages/icons": "0.3.1"
|
|
125
129
|
},
|
|
126
130
|
"devDependencies": {
|
|
127
|
-
"@
|
|
128
|
-
"@
|
|
131
|
+
"@json-render/core": "0.21.0",
|
|
132
|
+
"@json-render/react": "0.21.0",
|
|
133
|
+
"@storybook/addon-a11y": "10.6.1",
|
|
134
|
+
"@storybook/react-vite": "10.6.1",
|
|
129
135
|
"@types/react": "19.3.0",
|
|
130
136
|
"@types/react-dom": "19.3.0",
|
|
131
|
-
"ai": "7.0.
|
|
137
|
+
"ai": "7.0.126",
|
|
132
138
|
"react": "19.3.0",
|
|
133
139
|
"react-dom": "19.3.0",
|
|
134
|
-
"storybook": "10.6.
|
|
140
|
+
"storybook": "10.6.1",
|
|
135
141
|
"zod": "4.6.5"
|
|
136
142
|
},
|
|
137
143
|
"peerDependencies": {
|
|
144
|
+
"@json-render/core": "^0.21.0",
|
|
145
|
+
"@json-render/react": "^0.21.0",
|
|
138
146
|
"react": ">=18",
|
|
139
|
-
"react-dom": ">=18"
|
|
147
|
+
"react-dom": ">=18",
|
|
148
|
+
"zod": "^4.0"
|
|
149
|
+
},
|
|
150
|
+
"peerDependenciesMeta": {
|
|
151
|
+
"@json-render/core": {
|
|
152
|
+
"optional": true
|
|
153
|
+
},
|
|
154
|
+
"@json-render/react": {
|
|
155
|
+
"optional": true
|
|
156
|
+
},
|
|
157
|
+
"zod": {
|
|
158
|
+
"optional": true
|
|
159
|
+
}
|
|
140
160
|
},
|
|
141
161
|
"scripts": {
|
|
142
162
|
"dev": "storybook dev -p 6006",
|
|
143
163
|
"build": "vp pack",
|
|
164
|
+
"build:workbench": "storybook build -o ../../docs/public/storybook/react",
|
|
144
165
|
"release": "basis publish"
|
|
145
166
|
}
|
|
146
167
|
}
|