@bysages/react 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ai-response-jZy-0Tvv.mjs → ai-response-B4DX7nmJ.mjs} +10 -4
- package/dist/chevron-a2nIZKN4.mjs +6 -0
- package/dist/components/accordion/index.d.mts +22 -4
- package/dist/components/accordion/index.mjs +31 -1
- package/dist/components/affix/index.d.mts +4 -1
- package/dist/components/affix/index.mjs +5 -3
- package/dist/components/ai/index.d.mts +2 -2
- package/dist/components/ai/index.mjs +29 -12
- package/dist/components/ai-action/index.d.mts +4 -1
- package/dist/components/ai-action/index.mjs +3 -1
- package/dist/components/ai-attachments/index.d.mts +10 -4
- package/dist/components/ai-attachments/index.mjs +19 -45
- package/dist/components/ai-message/index.d.mts +4 -1
- package/dist/components/ai-message/index.mjs +3 -1
- package/dist/components/ai-prompt-input/index.d.mts +5 -2
- package/dist/components/ai-prompt-input/index.mjs +17 -17
- package/dist/components/ai-reasoning/index.d.mts +4 -1
- package/dist/components/ai-reasoning/index.mjs +4 -2
- package/dist/components/ai-response/index.d.mts +8 -3
- package/dist/components/ai-response/index.mjs +1 -1
- package/dist/components/ai-source/index.d.mts +8 -2
- package/dist/components/ai-source/index.mjs +5 -2
- package/dist/components/ai-suggestion/index.d.mts +4 -1
- package/dist/components/ai-suggestion/index.mjs +3 -1
- package/dist/components/ai-tool/index.d.mts +4 -1
- package/dist/components/ai-tool/index.mjs +4 -2
- package/dist/components/alert/index.d.mts +2 -0
- package/dist/components/alert/index.mjs +11 -18
- package/dist/components/angle-slider/index.d.mts +19 -2
- package/dist/components/angle-slider/index.mjs +31 -8
- package/dist/components/aspect-ratio/index.d.mts +4 -1
- package/dist/components/aspect-ratio/index.mjs +3 -1
- package/dist/components/autocomplete/index.d.mts +3 -1
- package/dist/components/autocomplete/index.mjs +9 -2
- package/dist/components/avatar/index.d.mts +2 -2
- package/dist/components/avatar/index.mjs +9 -2
- package/dist/components/avatar-group/index.d.mts +4 -1
- package/dist/components/avatar-group/index.mjs +3 -1
- package/dist/components/back-top/index.d.mts +7 -1
- package/dist/components/back-top/index.mjs +12 -17
- package/dist/components/badge/index.d.mts +4 -1
- package/dist/components/badge/index.mjs +3 -1
- package/dist/components/banner/index.mjs +13 -18
- package/dist/components/block-ui/index.d.mts +4 -1
- package/dist/components/block-ui/index.mjs +3 -1
- package/dist/components/breadcrumb/index.d.mts +3 -8
- package/dist/components/breadcrumb/index.mjs +11 -1
- package/dist/components/button/index.d.mts +4 -1
- package/dist/components/button/index.mjs +3 -1
- package/dist/components/calendar/index.d.mts +3 -1
- package/dist/components/calendar/index.mjs +9 -10
- package/dist/components/carousel/index.d.mts +21 -1
- package/dist/components/carousel/index.mjs +43 -2
- package/dist/components/cascade-select/index.d.mts +6 -1
- package/dist/components/cascade-select/index.mjs +18 -37
- package/dist/components/checkbox/index.d.mts +20 -2
- package/dist/components/checkbox/index.mjs +28 -8
- package/dist/components/checkbox-group/index.d.mts +8 -6
- package/dist/components/checkbox-group/index.mjs +44 -48
- package/dist/components/chip/index.d.mts +4 -1
- package/dist/components/chip/index.mjs +3 -1
- package/dist/components/client-only/index.d.mts +7 -2
- package/dist/components/client-only/index.mjs +5 -1
- package/dist/components/clipboard/index.d.mts +17 -4
- package/dist/components/clipboard/index.mjs +33 -5
- package/dist/components/collapsible/index.d.mts +16 -4
- package/dist/components/collapsible/index.mjs +25 -1
- package/dist/components/color-picker/index.d.mts +20 -4
- package/dist/components/color-picker/index.mjs +56 -14
- package/dist/components/combobox/index.d.mts +27 -1
- package/dist/components/combobox/index.mjs +62 -5
- package/dist/components/command/index.d.mts +4 -1
- package/dist/components/command/index.mjs +15 -3
- package/dist/components/comment/index.d.mts +4 -1
- package/dist/components/comment/index.mjs +3 -1
- package/dist/components/config-provider/index.d.mts +8 -2
- package/dist/components/config-provider/index.mjs +5 -2
- package/dist/components/container/index.d.mts +4 -1
- package/dist/components/container/index.mjs +3 -1
- package/dist/components/data-view/index.d.mts +4 -1
- package/dist/components/data-view/index.mjs +7 -3
- package/dist/components/date-input/index.d.mts +19 -4
- package/dist/components/date-input/index.mjs +33 -9
- package/dist/components/date-picker/index.d.mts +21 -4
- package/dist/components/date-picker/index.mjs +58 -11
- package/dist/components/deferred-content/index.d.mts +4 -1
- package/dist/components/deferred-content/index.mjs +3 -1
- package/dist/components/descriptions/index.d.mts +10 -2
- package/dist/components/descriptions/index.mjs +13 -8
- package/dist/components/dialog/index.d.mts +18 -5
- package/dist/components/dialog/index.mjs +43 -1
- package/dist/components/download-trigger/index.d.mts +7 -2
- package/dist/components/download-trigger/index.mjs +5 -1
- package/dist/components/drawer/index.d.mts +18 -6
- package/dist/components/drawer/index.mjs +40 -1
- package/dist/components/dynamic-input/index.d.mts +4 -1
- package/dist/components/dynamic-input/index.mjs +13 -19
- package/dist/components/editable/index.d.mts +28 -7
- package/dist/components/editable/index.mjs +43 -4
- package/dist/components/ellipsis/index.d.mts +4 -1
- package/dist/components/ellipsis/index.mjs +3 -1
- package/dist/components/field/index.d.mts +30 -5
- package/dist/components/field/index.mjs +36 -3
- package/dist/components/fieldset/index.d.mts +19 -4
- package/dist/components/fieldset/index.mjs +28 -3
- package/dist/components/file-upload/index.d.mts +36 -9
- package/dist/components/file-upload/index.mjs +66 -11
- package/dist/components/float-button/index.mjs +3 -1
- package/dist/components/floating-panel/index.d.mts +18 -6
- package/dist/components/floating-panel/index.mjs +55 -1
- package/dist/components/focus-trap/index.d.mts +7 -2
- package/dist/components/focus-trap/index.mjs +5 -1
- package/dist/components/form/index.d.mts +1 -1
- package/dist/components/form/index.mjs +5 -2
- package/dist/components/frame/index.d.mts +4 -8
- package/dist/components/frame/index.mjs +13 -1
- package/dist/components/grid/index.d.mts +4 -1
- package/dist/components/grid/index.mjs +3 -1
- package/dist/components/highlight/index.d.mts +3 -5
- package/dist/components/highlight/index.mjs +6 -1
- package/dist/components/hover-card/index.d.mts +20 -4
- package/dist/components/hover-card/index.mjs +32 -1
- package/dist/components/icon/index.d.mts +10 -8
- package/dist/components/icon/index.mjs +5 -3
- package/dist/components/image/index.d.mts +11 -2
- package/dist/components/image/index.mjs +16 -29
- package/dist/components/image-cropper/index.d.mts +13 -2
- package/dist/components/image-cropper/index.mjs +34 -2
- package/dist/components/image-viewer/index.d.mts +2 -18
- package/dist/components/image-viewer/index.mjs +3 -109
- package/dist/components/input/index.d.mts +3 -1
- package/dist/components/input/index.mjs +1 -1
- package/dist/components/json-tree-view/index.d.mts +20 -4
- package/dist/components/json-tree-view/index.mjs +38 -4
- package/dist/components/kbd/index.d.mts +4 -1
- package/dist/components/kbd/index.mjs +3 -1
- package/dist/components/layout/index.d.mts +25 -7
- package/dist/components/layout/index.mjs +159 -63
- package/dist/components/link/index.d.mts +4 -1
- package/dist/components/link/index.mjs +3 -1
- package/dist/components/list/index.d.mts +5 -4
- package/dist/components/list/index.mjs +10 -1
- package/dist/components/listbox/index.d.mts +22 -1
- package/dist/components/listbox/index.mjs +36 -4
- package/dist/components/marquee/index.d.mts +18 -1
- package/dist/components/marquee/index.mjs +34 -2
- package/dist/components/masonry/index.d.mts +4 -1
- package/dist/components/masonry/index.mjs +3 -1
- package/dist/components/media-player/index.d.mts +2 -0
- package/dist/components/media-player/index.mjs +2 -0
- package/dist/components/mentions/index.d.mts +1 -1
- package/dist/components/mentions/index.mjs +1 -1
- package/dist/components/menu/index.d.mts +29 -11
- package/dist/components/menu/index.mjs +34 -12
- package/dist/components/menubar/index.d.mts +3 -1
- package/dist/components/menubar/index.mjs +7 -1
- package/dist/components/navigation-menu/index.d.mts +25 -1
- package/dist/components/navigation-menu/index.mjs +36 -1
- package/dist/components/number-input/index.d.mts +28 -6
- package/dist/components/number-input/index.mjs +33 -8
- package/dist/components/order-list/index.d.mts +4 -1
- package/dist/components/order-list/index.mjs +34 -33
- package/dist/components/pagination/index.d.mts +23 -3
- package/dist/components/pagination/index.mjs +57 -12
- package/dist/components/password-input/index.d.mts +24 -6
- package/dist/components/password-input/index.mjs +31 -8
- package/dist/components/pin-input/index.d.mts +23 -5
- package/dist/components/pin-input/index.mjs +29 -7
- package/dist/components/popconfirm/index.d.mts +9 -5
- package/dist/components/popconfirm/index.mjs +23 -18
- package/dist/components/popover/index.d.mts +2 -8
- package/dist/components/popover/index.mjs +44 -4
- package/dist/components/presence/index.d.mts +10 -2
- package/dist/components/presence/index.mjs +6 -1
- package/dist/components/progress/index.d.mts +18 -3
- package/dist/components/progress/index.mjs +34 -9
- package/dist/components/progress-group/index.d.mts +4 -1
- package/dist/components/progress-group/index.mjs +4 -2
- package/dist/components/qr-code/index.d.mts +14 -1
- package/dist/components/qr-code/index.mjs +26 -2
- package/dist/components/radio-group/index.d.mts +27 -2
- package/dist/components/radio-group/index.mjs +32 -8
- package/dist/components/rating-group/index.d.mts +20 -3
- package/dist/components/rating-group/index.mjs +26 -8
- package/dist/components/result/index.d.mts +1 -1
- package/dist/components/result/index.mjs +2 -2
- package/dist/components/scroll-area/index.d.mts +14 -1
- package/dist/components/scroll-area/index.mjs +32 -2
- package/dist/components/segment-group/index.d.mts +28 -2
- package/dist/components/segment-group/index.mjs +34 -7
- package/dist/components/select/index.d.mts +2 -2
- package/dist/components/select/index.mjs +1 -1
- package/dist/components/separator/index.d.mts +4 -1
- package/dist/components/separator/index.mjs +3 -1
- package/dist/components/signature-pad/index.d.mts +25 -5
- package/dist/components/signature-pad/index.mjs +37 -3
- package/dist/components/skeleton/index.d.mts +4 -1
- package/dist/components/skeleton/index.mjs +3 -1
- package/dist/components/slider/index.d.mts +21 -2
- package/dist/components/slider/index.mjs +31 -8
- package/dist/components/spinner/index.d.mts +4 -1
- package/dist/components/spinner/index.mjs +6 -2
- package/dist/components/split-button/index.d.mts +3 -1
- package/dist/components/split-button/index.mjs +15 -18
- package/dist/components/splitter/index.d.mts +17 -4
- package/dist/components/splitter/index.mjs +35 -1
- package/dist/components/spotlight/index.d.mts +4 -1
- package/dist/components/spotlight/index.mjs +3 -1
- package/dist/components/stack/index.d.mts +4 -1
- package/dist/components/stack/index.mjs +6 -4
- package/dist/components/steps/index.d.mts +27 -3
- package/dist/components/steps/index.mjs +36 -12
- package/dist/components/swap/index.d.mts +11 -5
- package/dist/components/swap/index.mjs +30 -3
- package/dist/components/switch/index.d.mts +20 -2
- package/dist/components/switch/index.mjs +27 -8
- package/dist/components/table/index.d.mts +4 -1
- package/dist/components/table/index.mjs +44 -70
- package/dist/components/tabs/index.d.mts +24 -2
- package/dist/components/tabs/index.mjs +25 -9
- package/dist/components/tags-input/index.d.mts +33 -8
- package/dist/components/tags-input/index.mjs +41 -9
- package/dist/components/terminal/index.d.mts +4 -1
- package/dist/components/terminal/index.mjs +8 -3
- package/dist/components/textarea/index.d.mts +4 -1
- package/dist/components/textarea/index.mjs +3 -1
- package/dist/components/timer/index.d.mts +18 -1
- package/dist/components/timer/index.mjs +51 -2
- package/dist/components/toast/index.d.mts +3 -6
- package/dist/components/toast/index.mjs +22 -2
- package/dist/components/toc/index.d.mts +24 -4
- package/dist/components/toc/index.mjs +41 -3
- package/dist/components/toggle/index.d.mts +11 -4
- package/dist/components/toggle/index.mjs +21 -1
- package/dist/components/toggle-group/index.d.mts +26 -2
- package/dist/components/toggle-group/index.mjs +31 -6
- package/dist/components/toolbar/index.d.mts +4 -1
- package/dist/components/toolbar/index.mjs +3 -1
- package/dist/components/tooltip/index.d.mts +17 -4
- package/dist/components/tooltip/index.mjs +28 -1
- package/dist/components/tour/index.d.mts +18 -9
- package/dist/components/tour/index.mjs +44 -2
- package/dist/components/transfer/index.d.mts +3 -1
- package/dist/components/transfer/index.mjs +20 -30
- package/dist/components/tree-select/index.d.mts +3 -1
- package/dist/components/tree-select/index.mjs +15 -24
- package/dist/components/tree-view/index.d.mts +30 -1
- package/dist/components/tree-view/index.mjs +69 -6
- package/dist/components/typography/index.d.mts +4 -0
- package/dist/components/typography/index.mjs +1 -0
- package/dist/components/user/index.d.mts +4 -1
- package/dist/components/user/index.mjs +3 -1
- package/dist/components/virtual-list/index.d.mts +4 -1
- package/dist/components/virtual-list/index.mjs +11 -12
- package/dist/components/watermark/index.d.mts +4 -1
- package/dist/components/watermark/index.mjs +4 -2
- package/dist/family-DE_GQeeM.mjs +9 -0
- package/dist/icon-BALgGtNK.mjs +18 -0
- package/dist/id-C37UYLwJ.mjs +13 -0
- package/dist/image-viewer-Cf6thHax.mjs +141 -0
- package/dist/{index-Uefyw7Im.d.mts → index-Bbg4heDO.d.mts} +12 -7
- package/dist/index-BcRdWGY-.d.mts +115 -0
- package/dist/{index-DFN9F5Zt.d.mts → index-D_iKc2Uw.d.mts} +32 -3
- package/dist/{index-CsfxYv6J.d.mts → index-DdNKngUQ.d.mts} +63 -39
- package/dist/index-Dj8S4eyJ.d.mts +41 -0
- package/dist/index-Eu-Bttta.d.mts +24 -0
- package/dist/{index-uPyYiWaL.d.mts → index-PsgGWW3m.d.mts} +8 -2
- package/dist/index.d.mts +36 -35
- package/dist/index.mjs +13 -12
- package/dist/{input-2oezH-dY.mjs → input-C21Zzuy6.mjs} +3 -1
- package/dist/media-player-gQrnxU52.mjs +554 -0
- package/dist/{mentions-DMIBCBOd.mjs → mentions-BuWibdci.mjs} +74 -42
- package/dist/messages-1jJWtaYU.mjs +16 -0
- package/dist/select-ozUFq0zd.mjs +121 -0
- package/package.json +3 -3
- package/dist/chevron-BeHvt46K.mjs +0 -17
- package/dist/select-D1xiT1oJ.mjs +0 -68
|
@@ -1,10 +1,34 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
5
|
import { Collapsible as Collapsible$1 } from "@ark-ui/react/collapsible";
|
|
3
6
|
//#region src/components/collapsible/index.tsx
|
|
4
7
|
/** Ark's Collapsible, dressed in the paper-and-ink system: one control on
|
|
5
8
|
* the paper, its panel dissolving open to the machine's measured height.
|
|
6
9
|
* The API is Ark's own — Root, Trigger, Content, Indicator. */
|
|
7
|
-
|
|
10
|
+
function CollapsibleRoot(props) {
|
|
11
|
+
const id = useElementId("collapsible", props);
|
|
12
|
+
return /* @__PURE__ */ jsx(Collapsible$1.Root, {
|
|
13
|
+
...props,
|
|
14
|
+
id
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function CollapsibleFacade({ open, defaultOpen = false, label, disabled = false, className, children, onOpenChange }) {
|
|
18
|
+
return /* @__PURE__ */ jsxs(CollapsibleRoot, {
|
|
19
|
+
className,
|
|
20
|
+
disabled,
|
|
21
|
+
defaultOpen,
|
|
22
|
+
...open === void 0 ? {} : { open },
|
|
23
|
+
onOpenChange: (details) => onOpenChange?.(details.open),
|
|
24
|
+
children: [/* @__PURE__ */ jsxs(Collapsible$1.Trigger, { children: [label, /* @__PURE__ */ jsx(Collapsible$1.Indicator, { children: iconNode("chevron-right") })] }), /* @__PURE__ */ jsx(Collapsible$1.Content, { children })]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
CollapsibleFacade.displayName = "SCollapsible";
|
|
28
|
+
const Collapsible = Object.assign(CollapsibleFacade, {
|
|
29
|
+
...Collapsible$1,
|
|
30
|
+
Root: CollapsibleRoot
|
|
31
|
+
});
|
|
8
32
|
injectComponentStyle("collapsible");
|
|
9
33
|
//#endregion
|
|
10
34
|
export { Collapsible };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ComponentProps } from "react";
|
|
2
|
-
import { ColorPicker as ColorPicker$1 } from "@ark-ui/react/color-picker";
|
|
1
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
2
|
+
import { Color, ColorPicker as ColorPicker$1 } from "@ark-ui/react/color-picker";
|
|
3
3
|
//#region src/components/color-picker/index.d.ts
|
|
4
4
|
type ColorPickerRootProps = ComponentProps<typeof ColorPicker$1.Root> & {
|
|
5
5
|
/** One rung of the control-height ladder for the swatch seal. */
|
|
6
6
|
size?: "sm" | "md" | "lg";
|
|
7
7
|
};
|
|
8
|
-
declare function ColorPickerRoot(
|
|
8
|
+
declare function ColorPickerRoot(props: ColorPickerRootProps): import("react").JSX.Element;
|
|
9
9
|
/** Ark's ColorPicker, dressed in the paper-and-ink system: a seal-sized swatch
|
|
10
10
|
* on the paper, opening into an area and channel sliders where pigment is
|
|
11
11
|
* picked. The API is Ark's own — Root, Label, Control, Trigger, Positioner,
|
|
@@ -14,7 +14,23 @@ declare function ColorPickerRoot({ size, ...rest }: ColorPickerRootProps): impor
|
|
|
14
14
|
* ChannelSliderValueText, ChannelInput, TransparencyGrid, SwatchGroup,
|
|
15
15
|
* SwatchTrigger, SwatchIndicator, Swatch, EyeDropperTrigger, FormatTrigger,
|
|
16
16
|
* FormatSelect, HiddenInput, Context. */
|
|
17
|
-
|
|
17
|
+
type ColorPickerFacadeProps = {
|
|
18
|
+
value?: string | Color;
|
|
19
|
+
defaultValue?: string | Color;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
invalid?: boolean;
|
|
22
|
+
required?: boolean;
|
|
23
|
+
label?: string;
|
|
24
|
+
size?: "sm" | "md" | "lg";
|
|
25
|
+
className?: string;
|
|
26
|
+
style?: CSSProperties;
|
|
27
|
+
onValueChange?: (value: unknown) => void;
|
|
28
|
+
};
|
|
29
|
+
/** The complete picker behind one color: the hex input rides beside the
|
|
30
|
+
* swatch trigger, while the popup carries the area and hue/alpha tracks.
|
|
31
|
+
* Saved swatches and format switches remain anatomy work. */
|
|
32
|
+
declare function ColorPickerFacade(props: ColorPickerFacadeProps): import("react").JSX.Element;
|
|
33
|
+
export declare const ColorPicker: typeof ColorPickerFacade & Omit<typeof ColorPicker$1, "Root"> & {
|
|
18
34
|
Root: typeof ColorPickerRoot;
|
|
19
35
|
};
|
|
20
36
|
//#endregion
|
|
@@ -1,25 +1,67 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { ColorPicker as ColorPicker$1 } from "@ark-ui/react/color-picker";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { ColorPicker as ColorPicker$1, parseColor } from "@ark-ui/react/color-picker";
|
|
4
6
|
//#region src/components/color-picker/index.tsx
|
|
5
|
-
function ColorPickerRoot(
|
|
7
|
+
function ColorPickerRoot(props) {
|
|
8
|
+
injectComponentStyle("color-picker");
|
|
9
|
+
const id = useElementId("color-picker", props);
|
|
10
|
+
const { size = "md", ...rest } = props;
|
|
6
11
|
return /* @__PURE__ */ jsx(ColorPicker$1.Root, {
|
|
7
12
|
...rest,
|
|
13
|
+
id,
|
|
8
14
|
"data-size": size
|
|
9
15
|
});
|
|
10
16
|
}
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
/** The complete picker behind one color: the hex input rides beside the
|
|
18
|
+
* swatch trigger, while the popup carries the area and hue/alpha tracks.
|
|
19
|
+
* Saved swatches and format switches remain anatomy work. */
|
|
20
|
+
function ColorPickerFacade(props) {
|
|
21
|
+
const { value, defaultValue, disabled, invalid, required, label, size = "md", className, style, onValueChange } = props;
|
|
22
|
+
const toColor = (color) => typeof color === "string" ? parseColor(color) : color;
|
|
23
|
+
return /* @__PURE__ */ jsxs(ColorPickerRoot, {
|
|
24
|
+
size,
|
|
25
|
+
defaultValue: toColor(defaultValue),
|
|
26
|
+
value: toColor(value),
|
|
27
|
+
disabled,
|
|
28
|
+
invalid,
|
|
29
|
+
required,
|
|
30
|
+
className,
|
|
31
|
+
style,
|
|
32
|
+
onValueChange: (event) => onValueChange?.(event.value),
|
|
33
|
+
children: [
|
|
34
|
+
label ? /* @__PURE__ */ jsx(ColorPicker$1.Label, { children: label }) : null,
|
|
35
|
+
/* @__PURE__ */ jsxs(ColorPicker$1.Control, { children: [/* @__PURE__ */ jsx(ColorPicker$1.ChannelInput, { channel: "hex" }), /* @__PURE__ */ jsxs(ColorPicker$1.Trigger, { children: [/* @__PURE__ */ jsx(ColorPicker$1.TransparencyGrid, {}), /* @__PURE__ */ jsx(ColorPicker$1.ValueSwatch, {})] })] }),
|
|
36
|
+
/* @__PURE__ */ jsx(ColorPicker$1.Positioner, { children: /* @__PURE__ */ jsxs(ColorPicker$1.Content, { children: [/* @__PURE__ */ jsxs(ColorPicker$1.Area, { children: [/* @__PURE__ */ jsx(ColorPicker$1.AreaBackground, {}), /* @__PURE__ */ jsx(ColorPicker$1.AreaThumb, {})] }), /* @__PURE__ */ jsxs("div", {
|
|
37
|
+
"data-scope": "color-picker",
|
|
38
|
+
"data-part": "channel-controls",
|
|
39
|
+
children: [/* @__PURE__ */ jsx(ColorPicker$1.EyeDropperTrigger, { children: iconNode("pipette", {
|
|
40
|
+
width: 14,
|
|
41
|
+
height: 14
|
|
42
|
+
}) }), /* @__PURE__ */ jsxs("div", {
|
|
43
|
+
"data-scope": "color-picker",
|
|
44
|
+
"data-part": "channel-sliders",
|
|
45
|
+
children: [/* @__PURE__ */ jsxs(ColorPicker$1.ChannelSlider, {
|
|
46
|
+
channel: "hue",
|
|
47
|
+
children: [/* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderTrack, {}), /* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderThumb, {})]
|
|
48
|
+
}), /* @__PURE__ */ jsxs(ColorPicker$1.ChannelSlider, {
|
|
49
|
+
channel: "alpha",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx(ColorPicker$1.TransparencyGrid, {}),
|
|
52
|
+
/* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderTrack, {}),
|
|
53
|
+
/* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderThumb, {})
|
|
54
|
+
]
|
|
55
|
+
})]
|
|
56
|
+
})]
|
|
57
|
+
})] }) }),
|
|
58
|
+
/* @__PURE__ */ jsx(ColorPicker$1.HiddenInput, {})
|
|
59
|
+
]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const ColorPicker = Object.assign(ColorPickerFacade, {
|
|
20
63
|
...ColorPicker$1,
|
|
21
64
|
Root: ColorPickerRoot
|
|
22
|
-
};
|
|
23
|
-
injectComponentStyle("color-picker");
|
|
65
|
+
});
|
|
24
66
|
//#endregion
|
|
25
67
|
export { ColorPicker };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CSSProperties } from "react";
|
|
1
2
|
import { CollectionItem } from "@ark-ui/react/collection";
|
|
2
3
|
import { Combobox as Combobox$1, ComboboxRootComponentProps } from "@ark-ui/react/combobox";
|
|
3
4
|
//#region src/components/combobox/index.d.ts
|
|
@@ -11,7 +12,32 @@ type ComboboxOwnProps = {
|
|
|
11
12
|
size?: "sm" | "md" | "lg";
|
|
12
13
|
};
|
|
13
14
|
declare function ComboboxRoot<T extends CollectionItem>(props: ComboboxRootComponentProps<T, ComboboxOwnProps>): import("react").JSX.Element;
|
|
14
|
-
|
|
15
|
+
type ComboboxOption = {
|
|
16
|
+
label: string;
|
|
17
|
+
value: string;
|
|
18
|
+
};
|
|
19
|
+
type ComboboxFacadeValue = string | string[];
|
|
20
|
+
type ComboboxFacadeProps = {
|
|
21
|
+
value?: ComboboxFacadeValue;
|
|
22
|
+
defaultValue?: ComboboxFacadeValue;
|
|
23
|
+
options: ComboboxOption[];
|
|
24
|
+
multiple?: boolean;
|
|
25
|
+
/** Show the clear-value control when the machine allows it. */
|
|
26
|
+
clearable?: boolean;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
invalid?: boolean;
|
|
29
|
+
required?: boolean;
|
|
30
|
+
label?: string;
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
size?: "sm" | "md" | "lg";
|
|
33
|
+
className?: string;
|
|
34
|
+
style?: CSSProperties;
|
|
35
|
+
onValueChange?: (value?: ComboboxFacadeValue) => void;
|
|
36
|
+
};
|
|
37
|
+
/** The complete combobox behind one model value: options become the vessel's
|
|
38
|
+
* rows while typing, clearing, and selection stay on the common field path. */
|
|
39
|
+
declare function ComboboxFacade(props: ComboboxFacadeProps): import("react").JSX.Element;
|
|
40
|
+
export declare const Combobox: typeof ComboboxFacade & Omit<typeof Combobox$1, "Root"> & {
|
|
15
41
|
Root: typeof ComboboxRoot;
|
|
16
42
|
};
|
|
17
43
|
//#endregion
|
|
@@ -1,18 +1,75 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Combobox as Combobox$1 } from "@ark-ui/react/combobox";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Combobox as Combobox$1, createListCollection } from "@ark-ui/react/combobox";
|
|
4
6
|
//#region src/components/combobox/index.tsx
|
|
5
7
|
function ComboboxRoot(props) {
|
|
8
|
+
injectComponentStyle("combobox");
|
|
9
|
+
const id = useElementId("combobox", props);
|
|
6
10
|
const { size = "md", ...rest } = props;
|
|
7
11
|
return /* @__PURE__ */ jsx(Combobox$1.Root, {
|
|
8
12
|
...rest,
|
|
13
|
+
id,
|
|
9
14
|
"data-size": size
|
|
10
15
|
});
|
|
11
16
|
}
|
|
12
|
-
|
|
17
|
+
function toComboboxValue(value) {
|
|
18
|
+
if (value === void 0) return void 0;
|
|
19
|
+
return Array.isArray(value) ? value : [value];
|
|
20
|
+
}
|
|
21
|
+
function fromComboboxValue(value, multiple) {
|
|
22
|
+
return multiple ? value : value.at(0);
|
|
23
|
+
}
|
|
24
|
+
/** The complete combobox behind one model value: options become the vessel's
|
|
25
|
+
* rows while typing, clearing, and selection stay on the common field path. */
|
|
26
|
+
function ComboboxFacade(props) {
|
|
27
|
+
const { value, defaultValue, options, multiple, clearable = true, disabled, invalid, required, label, placeholder, size = "md", className, style, onValueChange } = props;
|
|
28
|
+
const collection = createListCollection({ items: options });
|
|
29
|
+
return /* @__PURE__ */ jsxs(ComboboxRoot, {
|
|
30
|
+
size,
|
|
31
|
+
collection,
|
|
32
|
+
defaultValue: toComboboxValue(defaultValue),
|
|
33
|
+
value: toComboboxValue(value),
|
|
34
|
+
disabled,
|
|
35
|
+
invalid,
|
|
36
|
+
multiple,
|
|
37
|
+
placeholder,
|
|
38
|
+
required,
|
|
39
|
+
lazyMount: true,
|
|
40
|
+
unmountOnExit: true,
|
|
41
|
+
className,
|
|
42
|
+
style,
|
|
43
|
+
onValueChange: (event) => onValueChange?.(fromComboboxValue(event.value, multiple)),
|
|
44
|
+
children: [
|
|
45
|
+
label ? /* @__PURE__ */ jsx(Combobox$1.Label, { children: label }) : null,
|
|
46
|
+
/* @__PURE__ */ jsxs(Combobox$1.Control, { children: [
|
|
47
|
+
/* @__PURE__ */ jsx(Combobox$1.Input, {
|
|
48
|
+
placeholder,
|
|
49
|
+
"aria-label": label ? void 0 : placeholder
|
|
50
|
+
}),
|
|
51
|
+
clearable ? /* @__PURE__ */ jsx(Combobox$1.ClearTrigger, { children: iconNode("x", {
|
|
52
|
+
width: 14,
|
|
53
|
+
height: 14
|
|
54
|
+
}) }) : null,
|
|
55
|
+
/* @__PURE__ */ jsx(Combobox$1.Trigger, { children: iconNode("chevron-down", {
|
|
56
|
+
width: 16,
|
|
57
|
+
height: 16
|
|
58
|
+
}) })
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ jsx(Combobox$1.Positioner, { children: /* @__PURE__ */ jsxs(Combobox$1.Content, { children: [/* @__PURE__ */ jsx(Combobox$1.Empty, { children: "No results found" }), /* @__PURE__ */ jsx(Combobox$1.List, { children: collection.items.map((item) => /* @__PURE__ */ jsxs(Combobox$1.Item, {
|
|
61
|
+
item,
|
|
62
|
+
children: [/* @__PURE__ */ jsx(Combobox$1.ItemText, { children: item.label }), /* @__PURE__ */ jsx(Combobox$1.ItemIndicator, { children: iconNode("check", {
|
|
63
|
+
width: 14,
|
|
64
|
+
height: 14
|
|
65
|
+
}) })]
|
|
66
|
+
}, item.value)) })] }) })
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
const Combobox = Object.assign(ComboboxFacade, {
|
|
13
71
|
...Combobox$1,
|
|
14
72
|
Root: ComboboxRoot
|
|
15
|
-
};
|
|
16
|
-
injectComponentStyle("combobox");
|
|
73
|
+
});
|
|
17
74
|
//#endregion
|
|
18
75
|
export { Combobox };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Dialog } from "../dialog/index.mjs";
|
|
1
2
|
//#region src/components/command/index.d.ts
|
|
2
3
|
export interface CommandEntry {
|
|
3
4
|
label: string;
|
|
@@ -17,6 +18,7 @@ export interface CommandEntry {
|
|
|
17
18
|
* grafts onto the sheet's list.
|
|
18
19
|
*/
|
|
19
20
|
export interface CommandProps {
|
|
21
|
+
id?: string;
|
|
20
22
|
/** The commands on offer, grouped as they arrive. */
|
|
21
23
|
items?: CommandEntry[];
|
|
22
24
|
placeholder?: string;
|
|
@@ -39,5 +41,6 @@ export interface CommandProps {
|
|
|
39
41
|
/** Reports the field's live text. */
|
|
40
42
|
onInputValueChange?: (value: string) => void;
|
|
41
43
|
}
|
|
42
|
-
|
|
44
|
+
declare function CommandImpl({ items, placeholder, open, autoFilter, inputValue, emptyText, onSelect, onOpenChange, onInputValueChange, id }: CommandProps): import("react").JSX.Element;
|
|
45
|
+
export declare const Command: typeof CommandImpl & typeof Dialog;
|
|
43
46
|
//#endregion
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
2
|
+
import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
|
|
3
|
+
import { Dialog as Dialog$1 } from "../dialog/index.mjs";
|
|
1
4
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
6
|
import { useEffect, useState } from "react";
|
|
@@ -6,9 +9,13 @@ import { useListCollection } from "@ark-ui/react/collection";
|
|
|
6
9
|
import { Combobox } from "@ark-ui/react/combobox";
|
|
7
10
|
import { Dialog } from "@ark-ui/react/dialog";
|
|
8
11
|
//#region src/components/command/index.tsx
|
|
9
|
-
function
|
|
12
|
+
function CommandImpl({ items = [], placeholder, open, autoFilter = true, inputValue, emptyText, onSelect, onOpenChange, onInputValueChange, id }) {
|
|
10
13
|
injectComponentStyle("command");
|
|
11
14
|
injectComponentStyle("dialog");
|
|
15
|
+
const hostId = useElementId("command", { id });
|
|
16
|
+
const messages = useComponentMessages();
|
|
17
|
+
const resolvedPlaceholder = placeholder ?? messages.command.search;
|
|
18
|
+
const resolvedEmptyText = emptyText ?? messages.command.noMatches;
|
|
12
19
|
const [internalOpen, setInternalOpen] = useState(false);
|
|
13
20
|
const [listOpen, setListOpen] = useState(true);
|
|
14
21
|
const [fieldText, setFieldText] = useState("");
|
|
@@ -62,6 +69,7 @@ function Command({ items = [], placeholder, open, autoFilter = true, inputValue,
|
|
|
62
69
|
})
|
|
63
70
|
}, entry.value);
|
|
64
71
|
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
72
|
+
id: `${hostId}:dialog`,
|
|
65
73
|
open: currentOpen,
|
|
66
74
|
onOpenChange: (details) => setOpen(details.open),
|
|
67
75
|
children: /* @__PURE__ */ jsxs(Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, {}), /* @__PURE__ */ jsx(Dialog.Positioner, {
|
|
@@ -74,7 +82,9 @@ function Command({ items = [], placeholder, open, autoFilter = true, inputValue,
|
|
|
74
82
|
children: /* @__PURE__ */ jsx("div", {
|
|
75
83
|
"data-scope": "command",
|
|
76
84
|
"data-part": "content",
|
|
85
|
+
"aria-label": messages.command.palette,
|
|
77
86
|
children: /* @__PURE__ */ jsxs(Combobox.Root, {
|
|
87
|
+
id: `${hostId}:combobox`,
|
|
78
88
|
collection,
|
|
79
89
|
inputValue,
|
|
80
90
|
open: listOpen,
|
|
@@ -96,7 +106,8 @@ function Command({ items = [], placeholder, open, autoFilter = true, inputValue,
|
|
|
96
106
|
asChild: true,
|
|
97
107
|
children: /* @__PURE__ */ jsx("input", {
|
|
98
108
|
type: "text",
|
|
99
|
-
placeholder,
|
|
109
|
+
placeholder: resolvedPlaceholder,
|
|
110
|
+
"aria-label": resolvedPlaceholder,
|
|
100
111
|
"data-scope": "command",
|
|
101
112
|
"data-part": "input"
|
|
102
113
|
})
|
|
@@ -122,7 +133,7 @@ function Command({ items = [], placeholder, open, autoFilter = true, inputValue,
|
|
|
122
133
|
}, group)), groups.size === 0 ? /* @__PURE__ */ jsx("div", {
|
|
123
134
|
"data-scope": "command",
|
|
124
135
|
"data-part": "empty",
|
|
125
|
-
children:
|
|
136
|
+
children: resolvedEmptyText
|
|
126
137
|
}) : null]
|
|
127
138
|
})
|
|
128
139
|
})]
|
|
@@ -133,5 +144,6 @@ function Command({ items = [], placeholder, open, autoFilter = true, inputValue,
|
|
|
133
144
|
})] })
|
|
134
145
|
});
|
|
135
146
|
}
|
|
147
|
+
const Command = Object.assign(CommandImpl, Dialog$1);
|
|
136
148
|
//#endregion
|
|
137
149
|
export { Command };
|
|
@@ -13,5 +13,8 @@ export interface CommentProps extends HTMLAttributes<HTMLElement> {
|
|
|
13
13
|
/** The row of answers beneath the ink. */
|
|
14
14
|
actions?: ReactNode;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
declare function CommentImpl({ author, datetime, avatar, actions, children, ...rest }: CommentProps): import("react").JSX.Element;
|
|
17
|
+
export declare const Comment: typeof CommentImpl & {
|
|
18
|
+
Root: typeof CommentImpl;
|
|
19
|
+
};
|
|
17
20
|
//#endregion
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/comment/index.tsx
|
|
4
|
-
function
|
|
5
|
+
function CommentImpl({ author, datetime, avatar, actions, children, ...rest }) {
|
|
5
6
|
injectComponentStyle("comment");
|
|
6
7
|
return /* @__PURE__ */ jsxs("article", {
|
|
7
8
|
...rest,
|
|
@@ -43,5 +44,6 @@ function Comment({ author, datetime, avatar, actions, children, ...rest }) {
|
|
|
43
44
|
})]
|
|
44
45
|
});
|
|
45
46
|
}
|
|
47
|
+
const Comment = withSelfRoot(CommentImpl);
|
|
46
48
|
//#endregion
|
|
47
49
|
export { Comment };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ThemeScene } from "@bysages/core";
|
|
1
|
+
import { ComponentMessagesOverride, ThemeScene } from "@bysages/core";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
3
|
//#region src/components/config-provider/index.d.ts
|
|
4
4
|
/** The four density tiers the token layer's `[data-density]` selectors
|
|
@@ -22,6 +22,8 @@ export interface ConfigContext {
|
|
|
22
22
|
dir?: "ltr" | "rtl";
|
|
23
23
|
/** BCP-47 locale, landing as the native `lang` attribute. */
|
|
24
24
|
locale?: string;
|
|
25
|
+
/** Partial leaf overrides for wrapper-owned runtime copy. */
|
|
26
|
+
messages?: ComponentMessagesOverride;
|
|
25
27
|
}
|
|
26
28
|
/** The nearest provider's snapshot, or an empty one when no provider
|
|
27
29
|
* wraps the caller — the hook the date and format families will consume
|
|
@@ -33,6 +35,7 @@ export interface ConfigProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
33
35
|
accent?: string;
|
|
34
36
|
dir?: "ltr" | "rtl";
|
|
35
37
|
locale?: string;
|
|
38
|
+
messages?: ComponentMessagesOverride;
|
|
36
39
|
children?: ReactNode;
|
|
37
40
|
}
|
|
38
41
|
/**
|
|
@@ -42,5 +45,8 @@ export interface ConfigProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
42
45
|
* descendants through `useConfig`, so interactive behavior (formatting,
|
|
43
46
|
* messages) and visual theming stay one decision.
|
|
44
47
|
*/
|
|
45
|
-
|
|
48
|
+
declare function ConfigProviderImpl({ density, scene, accent, dir, locale, messages, children, ...rest }: ConfigProviderProps): import("react").JSX.Element;
|
|
49
|
+
export declare const ConfigProvider: typeof ConfigProviderImpl & {
|
|
50
|
+
Root: typeof ConfigProviderImpl;
|
|
51
|
+
};
|
|
46
52
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import { createContext, useContext } from "react";
|
|
3
4
|
//#region src/components/config-provider/index.tsx
|
|
@@ -15,14 +16,15 @@ function useConfig() {
|
|
|
15
16
|
* descendants through `useConfig`, so interactive behavior (formatting,
|
|
16
17
|
* messages) and visual theming stay one decision.
|
|
17
18
|
*/
|
|
18
|
-
function
|
|
19
|
+
function ConfigProviderImpl({ density, scene, accent, dir, locale, messages, children, ...rest }) {
|
|
19
20
|
return /* @__PURE__ */ jsx(ConfigContextImpl.Provider, {
|
|
20
21
|
value: {
|
|
21
22
|
density,
|
|
22
23
|
scene,
|
|
23
24
|
accent,
|
|
24
25
|
dir,
|
|
25
|
-
locale
|
|
26
|
+
locale,
|
|
27
|
+
messages
|
|
26
28
|
},
|
|
27
29
|
children: /* @__PURE__ */ jsx("div", {
|
|
28
30
|
...rest,
|
|
@@ -37,5 +39,6 @@ function ConfigProvider({ density, scene, accent, dir, locale, children, ...rest
|
|
|
37
39
|
})
|
|
38
40
|
});
|
|
39
41
|
}
|
|
42
|
+
const ConfigProvider = withSelfRoot(ConfigProviderImpl);
|
|
40
43
|
//#endregion
|
|
41
44
|
export { ConfigProvider, useConfig };
|
|
@@ -9,5 +9,8 @@ export interface ContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
9
9
|
* than the measure. */
|
|
10
10
|
padding?: boolean;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
declare function ContainerImpl({ size, padding, ...rest }: ContainerProps): import("react").JSX.Element;
|
|
13
|
+
export declare const Container: typeof ContainerImpl & {
|
|
14
|
+
Root: typeof ContainerImpl;
|
|
15
|
+
};
|
|
13
16
|
//#endregion
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/container/index.tsx
|
|
4
|
-
function
|
|
5
|
+
function ContainerImpl({ size = "readable", padding = true, ...rest }) {
|
|
5
6
|
injectComponentStyle("container");
|
|
6
7
|
return /* @__PURE__ */ jsx("div", {
|
|
7
8
|
...rest,
|
|
@@ -11,5 +12,6 @@ function Container({ size = "readable", padding = true, ...rest }) {
|
|
|
11
12
|
"data-padding": padding ? "" : void 0
|
|
12
13
|
});
|
|
13
14
|
}
|
|
15
|
+
const Container = withSelfRoot(ContainerImpl);
|
|
14
16
|
//#endregion
|
|
15
17
|
export { Container };
|
|
@@ -14,5 +14,8 @@ export interface DataViewProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
14
14
|
* renderItem, the view lays the records out as a ledger or a lattice
|
|
15
15
|
* and — when a page size is given — pages them with the pagination
|
|
16
16
|
* family's own parts rather than a second implementation. */
|
|
17
|
-
|
|
17
|
+
declare function DataViewImpl({ items, layout, pageSize, renderItem, header, ...rest }: DataViewProps): import("react").JSX.Element;
|
|
18
|
+
export declare const DataView: typeof DataViewImpl & {
|
|
19
|
+
Root: typeof DataViewImpl;
|
|
20
|
+
};
|
|
18
21
|
//#endregion
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
2
|
+
import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
|
|
1
3
|
import { Pagination } from "../pagination/index.mjs";
|
|
2
4
|
import { injectComponentStyle } from "@bysages/core";
|
|
3
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -7,9 +9,10 @@ import { useState } from "react";
|
|
|
7
9
|
* renderItem, the view lays the records out as a ledger or a lattice
|
|
8
10
|
* and — when a page size is given — pages them with the pagination
|
|
9
11
|
* family's own parts rather than a second implementation. */
|
|
10
|
-
function
|
|
12
|
+
function DataViewImpl({ items, layout = "list", pageSize, renderItem, header, ...rest }) {
|
|
11
13
|
injectComponentStyle("data-view");
|
|
12
14
|
const [page, setPage] = useState(1);
|
|
15
|
+
const messages = useComponentMessages();
|
|
13
16
|
const pageCount = pageSize ? Math.max(1, Math.ceil(items.length / pageSize)) : 1;
|
|
14
17
|
const visible = pageSize ? items.slice((page - 1) * pageSize, page * pageSize) : items;
|
|
15
18
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -39,7 +42,7 @@ function DataView({ items, layout = "list", pageSize, renderItem, header, ...res
|
|
|
39
42
|
onPageChange: (details) => setPage(details.page),
|
|
40
43
|
children: [
|
|
41
44
|
/* @__PURE__ */ jsx(Pagination.PrevTrigger, {
|
|
42
|
-
"aria-label":
|
|
45
|
+
"aria-label": messages.pagination.previous,
|
|
43
46
|
children: "‹"
|
|
44
47
|
}),
|
|
45
48
|
/* @__PURE__ */ jsx(Pagination.Context, { children: (pagination) => pagination.pages.map((entry, index) => entry.type === "ellipsis" ? /* @__PURE__ */ jsx(Pagination.Ellipsis, {
|
|
@@ -51,7 +54,7 @@ function DataView({ items, layout = "list", pageSize, renderItem, header, ...res
|
|
|
51
54
|
children: entry.value
|
|
52
55
|
}, entry.value)) }),
|
|
53
56
|
/* @__PURE__ */ jsx(Pagination.NextTrigger, {
|
|
54
|
-
"aria-label":
|
|
57
|
+
"aria-label": messages.pagination.next,
|
|
55
58
|
children: "›"
|
|
56
59
|
})
|
|
57
60
|
]
|
|
@@ -60,5 +63,6 @@ function DataView({ items, layout = "list", pageSize, renderItem, header, ...res
|
|
|
60
63
|
]
|
|
61
64
|
});
|
|
62
65
|
}
|
|
66
|
+
const DataView = withSelfRoot(DataViewImpl);
|
|
63
67
|
//#endregion
|
|
64
68
|
export { DataView };
|
|
@@ -1,16 +1,31 @@
|
|
|
1
|
-
import { ComponentProps } from "react";
|
|
2
|
-
import { DateInput as DateInput$1, DateInputFocusChangeDetails, DateInputValueChangeDetails } from "@ark-ui/react/date-input";
|
|
1
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
2
|
+
import { DateInput as DateInput$1, DateInputDateValue, DateInputFocusChangeDetails, DateInputValueChangeDetails } from "@ark-ui/react/date-input";
|
|
3
3
|
//#region src/components/date-input/index.d.ts
|
|
4
4
|
type DateInputRootProps = ComponentProps<typeof DateInput$1.Root> & {
|
|
5
5
|
/** One rung of the control-height ladder for the segmented field. */
|
|
6
6
|
size?: "sm" | "md" | "lg";
|
|
7
7
|
};
|
|
8
|
-
declare function DateInputRoot(
|
|
8
|
+
declare function DateInputRoot(props: DateInputRootProps): import("react").JSX.Element;
|
|
9
9
|
/** Ark's DateInput, dressed in the paper-and-ink system: a segmented
|
|
10
10
|
* field where the focused segment takes the flat ink fill. The API is
|
|
11
11
|
* Ark's own — Root, Label, Control, SegmentGroup, Segment, SegmentContext,
|
|
12
12
|
* HiddenInput. */
|
|
13
|
-
|
|
13
|
+
type DateInputFacadeValue = DateInputDateValue | DateInputDateValue[];
|
|
14
|
+
type DateInputFacadeProps = {
|
|
15
|
+
value?: DateInputFacadeValue;
|
|
16
|
+
defaultValue?: DateInputFacadeValue;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
invalid?: boolean;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
label?: string;
|
|
21
|
+
size?: "sm" | "md" | "lg";
|
|
22
|
+
className?: string;
|
|
23
|
+
style?: CSSProperties;
|
|
24
|
+
onValueChange?: (value: DateInputDateValue[]) => void;
|
|
25
|
+
};
|
|
26
|
+
/** The complete segmented date field behind one model value. */
|
|
27
|
+
declare function DateInputFacade(props: DateInputFacadeProps): import("react").JSX.Element;
|
|
28
|
+
export declare const DateInput: typeof DateInputFacade & Omit<typeof DateInput$1, "Root"> & {
|
|
14
29
|
Root: typeof DateInputRoot;
|
|
15
30
|
};
|
|
16
31
|
//#endregion
|
|
@@ -1,21 +1,45 @@
|
|
|
1
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { DateInput as DateInput$1 } from "@ark-ui/react/date-input";
|
|
4
5
|
//#region src/components/date-input/index.tsx
|
|
5
|
-
function DateInputRoot(
|
|
6
|
+
function DateInputRoot(props) {
|
|
7
|
+
injectComponentStyle("date-input");
|
|
8
|
+
const id = useElementId("date-input", props);
|
|
9
|
+
const { size = "md", ...rest } = props;
|
|
6
10
|
return /* @__PURE__ */ jsx(DateInput$1.Root, {
|
|
7
11
|
...rest,
|
|
12
|
+
id,
|
|
8
13
|
"data-size": size
|
|
9
14
|
});
|
|
10
15
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
function toDateInputValue(value) {
|
|
17
|
+
if (value === void 0) return void 0;
|
|
18
|
+
return Array.isArray(value) ? value : [value];
|
|
19
|
+
}
|
|
20
|
+
/** The complete segmented date field behind one model value. */
|
|
21
|
+
function DateInputFacade(props) {
|
|
22
|
+
const { value, defaultValue, disabled, invalid, required, label, size = "md", className, style, onValueChange } = props;
|
|
23
|
+
return /* @__PURE__ */ jsxs(DateInputRoot, {
|
|
24
|
+
size,
|
|
25
|
+
defaultValue: toDateInputValue(defaultValue),
|
|
26
|
+
value: toDateInputValue(value),
|
|
27
|
+
disabled,
|
|
28
|
+
invalid,
|
|
29
|
+
required,
|
|
30
|
+
className,
|
|
31
|
+
style,
|
|
32
|
+
onValueChange: (event) => onValueChange?.(event.value),
|
|
33
|
+
children: [
|
|
34
|
+
label ? /* @__PURE__ */ jsx(DateInput$1.Label, { children: label }) : null,
|
|
35
|
+
/* @__PURE__ */ jsx(DateInput$1.Control, { children: /* @__PURE__ */ jsx(DateInput$1.SegmentGroup, { children: /* @__PURE__ */ jsx(DateInput$1.SegmentContext, { children: (segmentProps) => /* @__PURE__ */ jsx(DateInput$1.Segment, { segment: segmentProps }) }) }) }),
|
|
36
|
+
/* @__PURE__ */ jsx(DateInput$1.HiddenInput, {})
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const DateInput = Object.assign(DateInputFacade, {
|
|
16
41
|
...DateInput$1,
|
|
17
42
|
Root: DateInputRoot
|
|
18
|
-
};
|
|
19
|
-
injectComponentStyle("date-input");
|
|
43
|
+
});
|
|
20
44
|
//#endregion
|
|
21
45
|
export { DateInput };
|