@sprawlify/react 0.0.7 → 0.0.9
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/chunk-BYnRvbsk.cjs +53 -0
- package/dist/{collapsible-D5kle6Bc.cjs → collapsible-aFKYmVbP.cjs} +10 -9
- package/dist/{collapsible-B06GGGE7.mjs → collapsible-vqmKK3px.mjs} +7 -7
- package/dist/{collection-DEsp9z6X.mjs → collection-BYYMj_V8.mjs} +2 -2
- package/dist/{collection-BKabYqpE.cjs → collection-DGEUORi5.cjs} +4 -3
- package/dist/components/accordion/index.cjs +13 -11
- package/dist/components/accordion/index.d.cts +11 -11
- package/dist/components/accordion/index.d.mts +11 -11
- package/dist/components/accordion/index.mjs +10 -9
- package/dist/components/angle-slider/index.cjs +11 -9
- package/dist/components/angle-slider/index.d.cts +13 -13
- package/dist/components/angle-slider/index.d.mts +13 -13
- package/dist/components/angle-slider/index.mjs +8 -7
- package/dist/components/avatar/index.cjs +11 -9
- package/dist/components/avatar/index.d.cts +8 -8
- package/dist/components/avatar/index.d.mts +8 -8
- package/dist/components/avatar/index.mjs +8 -7
- package/dist/components/bottom-sheet/index.cjs +17 -14
- package/dist/components/bottom-sheet/index.d.cts +15 -15
- package/dist/components/bottom-sheet/index.d.mts +13 -13
- package/dist/components/bottom-sheet/index.mjs +12 -10
- package/dist/components/carousel/index.cjs +11 -9
- package/dist/components/carousel/index.d.cts +18 -18
- package/dist/components/carousel/index.d.mts +18 -18
- package/dist/components/carousel/index.mjs +8 -7
- package/dist/components/checkbox/index.cjs +17 -14
- package/dist/components/checkbox/index.d.cts +14 -14
- package/dist/components/checkbox/index.d.mts +14 -14
- package/dist/components/checkbox/index.mjs +13 -11
- package/dist/components/client-only/index.cjs +1 -1
- package/dist/components/clipboard/index.cjs +8 -7
- package/dist/components/clipboard/index.d.cts +12 -12
- package/dist/components/clipboard/index.d.mts +12 -12
- package/dist/components/clipboard/index.mjs +6 -6
- package/dist/components/collapsible/index.cjs +8 -6
- package/dist/components/collapsible/index.d.cts +10 -10
- package/dist/components/collapsible/index.d.mts +10 -10
- package/dist/components/collapsible/index.mjs +7 -6
- package/dist/components/collection/index.cjs +3 -3
- package/dist/components/collection/index.d.cts +1 -1
- package/dist/components/collection/index.d.mts +1 -1
- package/dist/components/collection/index.mjs +3 -3
- package/dist/components/color-picker/index.cjs +19 -15
- package/dist/components/color-picker/index.d.cts +35 -35
- package/dist/components/color-picker/index.d.mts +36 -36
- package/dist/components/color-picker/index.mjs +14 -11
- package/dist/components/combobox/index.cjs +19 -15
- package/dist/components/combobox/index.d.cts +22 -22
- package/dist/components/combobox/index.d.mts +23 -23
- package/dist/components/combobox/index.mjs +15 -12
- package/dist/components/date-picker/index.cjs +567 -0
- package/dist/components/date-picker/index.d.cts +164 -0
- package/dist/components/date-picker/index.d.mts +165 -0
- package/dist/components/date-picker/index.mjs +526 -0
- package/dist/components/dialog/index.cjs +211 -0
- package/dist/components/dialog/index.d.cts +80 -0
- package/dist/components/dialog/index.d.mts +81 -0
- package/dist/components/dialog/index.mjs +187 -0
- package/dist/components/download-trigger/index.cjs +43 -0
- package/dist/components/download-trigger/index.d.cts +16 -0
- package/dist/components/download-trigger/index.d.mts +16 -0
- package/dist/components/download-trigger/index.mjs +42 -0
- package/dist/components/editable/index.cjs +246 -0
- package/dist/components/editable/index.d.cts +79 -0
- package/dist/components/editable/index.d.mts +79 -0
- package/dist/components/editable/index.mjs +221 -0
- package/dist/components/field/index.cjs +9 -7
- package/dist/components/field/index.d.cts +12 -12
- package/dist/components/field/index.d.mts +14 -14
- package/dist/components/field/index.mjs +9 -7
- package/dist/components/fieldset/index.cjs +10 -8
- package/dist/components/fieldset/index.d.cts +10 -10
- package/dist/components/fieldset/index.d.mts +10 -10
- package/dist/components/fieldset/index.mjs +9 -7
- package/dist/components/file-upload/index.cjs +351 -0
- package/dist/components/file-upload/index.d.cts +102 -0
- package/dist/components/file-upload/index.d.mts +102 -0
- package/dist/components/file-upload/index.mjs +322 -0
- package/dist/components/floating-panel/index.cjs +287 -0
- package/dist/components/floating-panel/index.d.cts +100 -0
- package/dist/components/floating-panel/index.d.mts +101 -0
- package/dist/components/floating-panel/index.mjs +259 -0
- package/dist/components/focus-trap/index.cjs +36 -0
- package/dist/components/focus-trap/index.d.cts +14 -0
- package/dist/components/focus-trap/index.d.mts +14 -0
- package/dist/components/focus-trap/index.mjs +35 -0
- package/dist/components/format/index.cjs +57 -0
- package/dist/components/format/index.d.cts +36 -0
- package/dist/components/format/index.d.mts +36 -0
- package/dist/components/format/index.mjs +49 -0
- package/dist/components/frame/index.cjs +90 -0
- package/dist/components/frame/index.d.cts +13 -0
- package/dist/components/frame/index.d.mts +13 -0
- package/dist/components/frame/index.mjs +89 -0
- package/dist/components/highlight/index.cjs +2 -2
- package/dist/components/highlight/index.d.cts +3 -3
- package/dist/components/highlight/index.d.mts +3 -3
- package/dist/components/highlight/index.mjs +1 -1
- package/dist/components/hover-card/index.cjs +165 -0
- package/dist/components/hover-card/index.d.cts +70 -0
- package/dist/components/hover-card/index.d.mts +71 -0
- package/dist/components/hover-card/index.mjs +143 -0
- package/dist/components/image-cropper/index.cjs +197 -0
- package/dist/components/image-cropper/index.d.cts +64 -0
- package/dist/components/image-cropper/index.d.mts +64 -0
- package/dist/components/image-cropper/index.mjs +175 -0
- package/dist/components/json-tree-view/index.cjs +246 -0
- package/dist/components/json-tree-view/index.d.cts +43 -0
- package/dist/components/json-tree-view/index.d.mts +48 -0
- package/dist/components/json-tree-view/index.mjs +237 -0
- package/dist/components/listbox/index.cjs +314 -0
- package/dist/components/listbox/index.d.cts +110 -0
- package/dist/components/listbox/index.d.mts +110 -0
- package/dist/components/listbox/index.mjs +289 -0
- package/dist/components/marquee/index.cjs +176 -0
- package/dist/components/marquee/index.d.cts +61 -0
- package/dist/components/marquee/index.d.mts +61 -0
- package/dist/components/marquee/index.mjs +155 -0
- package/dist/components/menu/index.cjs +548 -0
- package/dist/components/menu/index.d.cts +159 -0
- package/dist/components/menu/index.d.mts +162 -0
- package/dist/components/menu/index.mjs +512 -0
- package/dist/components/navigation-menu/index.cjs +339 -0
- package/dist/components/navigation-menu/index.d.cts +90 -0
- package/dist/components/navigation-menu/index.d.mts +90 -0
- package/dist/components/navigation-menu/index.mjs +312 -0
- package/dist/components/number-input/index.cjs +237 -0
- package/dist/components/number-input/index.d.cts +74 -0
- package/dist/components/number-input/index.d.mts +74 -0
- package/dist/components/number-input/index.mjs +213 -0
- package/dist/components/pagination/index.cjs +197 -0
- package/dist/components/pagination/index.d.cts +69 -0
- package/dist/components/pagination/index.d.mts +69 -0
- package/dist/components/pagination/index.mjs +174 -0
- package/dist/components/password-input/index.cjs +193 -0
- package/dist/components/password-input/index.d.cts +66 -0
- package/dist/components/password-input/index.d.mts +66 -0
- package/dist/components/password-input/index.mjs +171 -0
- package/dist/components/pin-input/index.cjs +192 -0
- package/dist/components/pin-input/index.d.cts +59 -0
- package/dist/components/pin-input/index.d.mts +59 -0
- package/dist/components/pin-input/index.mjs +171 -0
- package/dist/components/popover/index.cjs +237 -0
- package/dist/components/popover/index.d.cts +95 -0
- package/dist/components/popover/index.d.mts +96 -0
- package/dist/components/popover/index.mjs +210 -0
- package/dist/components/portal/index.cjs +6 -31
- package/dist/components/portal/index.d.cts +2 -2
- package/dist/components/portal/index.d.mts +2 -2
- package/dist/components/portal/index.mjs +5 -29
- package/dist/components/presence/index.cjs +5 -5
- package/dist/components/presence/index.d.cts +1 -1
- package/dist/components/presence/index.d.mts +3 -3
- package/dist/components/presence/index.mjs +5 -5
- package/dist/components/select/index.cjs +19 -15
- package/dist/components/select/index.d.cts +21 -21
- package/dist/components/select/index.d.mts +22 -22
- package/dist/components/select/index.mjs +15 -12
- package/dist/components/tree-view/index.cjs +51 -0
- package/dist/components/tree-view/index.d.cts +3 -0
- package/dist/components/tree-view/index.d.mts +6 -0
- package/dist/components/tree-view/index.mjs +13 -0
- package/dist/compose-refs-C5QNDywq.cjs +22 -0
- package/dist/compose-refs-Cl5LpASY.mjs +16 -0
- package/dist/{core-CPLjF6nm.cjs → core-DCWyxy9D.cjs} +2 -53
- package/dist/{create-context-D6DyFRSf.cjs → create-context-CQ4U0lLj.cjs} +1 -1
- package/dist/{environment-BXkWNF2O.mjs → environment-Cc02I6aF.mjs} +1 -1
- package/dist/{environment-DLPiALpf.cjs → environment-CvilmfQt.cjs} +2 -2
- package/dist/{factory-DQlmCPH2.mjs → factory-7ydMApfi.mjs} +2 -16
- package/dist/{factory-CDX-oCN5.cjs → factory-C166evrS.cjs} +3 -23
- package/dist/{field-CGCTFCx2.mjs → field-BXY6su53.mjs} +9 -7
- package/dist/{field-CXhpW6zO.cjs → field-C-57Gj2E.cjs} +12 -10
- package/dist/{fieldset-CuSSYZxV.cjs → fieldset-B-MkM2Ms.cjs} +15 -13
- package/dist/{fieldset-poJ8RDvB.mjs → fieldset-BeHm9oxe.mjs} +8 -6
- package/dist/{index-DtdZfcpz.d.mts → index-BLd57Y0z.d.mts} +3 -3
- package/dist/index-BcXWsxRa.d.mts +40 -0
- package/dist/{index-BUN9wyVM.d.mts → index-Bkxp7VrU.d.mts} +7 -7
- package/dist/index-Cquz7y70.d.cts +52 -0
- package/dist/index-DTzLUoop.d.cts +150 -0
- package/dist/{index-DqRXPiW_.d.cts → index-aYGfRRLA.d.cts} +7 -7
- package/dist/index-wlpTZGhs.d.mts +150 -0
- package/dist/index.cjs +12 -10
- package/dist/index.d.cts +6 -56
- package/dist/index.d.mts +6 -44
- package/dist/index.mjs +7 -6
- package/dist/{providers-Bk3ALTxZ.cjs → locale-BcnWD1Hf.cjs} +2 -2
- package/dist/{providers-CyTYcOU1.mjs → locale-D4LX0eEq.mjs} +1 -1
- package/dist/{normalize-props-sqcs77GC.d.cts → normalize-props-Dw0EepzR.d.cts} +3 -3
- package/dist/portal-BOhFScBS.mjs +29 -0
- package/dist/portal-DRyJqgA1.cjs +35 -0
- package/dist/{presence-2A4loEJY.mjs → presence-C9BcvdTf.mjs} +6 -5
- package/dist/{presence-BX1tNsGA.cjs → presence-CPov8wyU.cjs} +9 -7
- package/dist/providers-BNAArubQ.cjs +0 -0
- package/dist/providers-CoJceYkV.mjs +1 -0
- package/dist/{render-strategy-D3w8btTD.mjs → render-strategy-BgIBKraZ.mjs} +2 -2
- package/dist/{render-strategy-k1JmEGnq.cjs → render-strategy-BywM_IvB.cjs} +2 -2
- package/dist/tree-view-CzJvwlYQ.mjs +365 -0
- package/dist/tree-view-DsOPEocd.cjs +509 -0
- package/dist/{types-FLvjyw__.d.mts → types-CrwpJrFp.d.mts} +2 -1
- package/dist/{types-DYWV3uAj.d.cts → types-DcUAwTQC.d.cts} +2 -1
- package/dist/{use-event-CGMgV6xB.cjs → use-event-CLH8zHoJ.cjs} +1 -1
- package/dist/use-fieldset-context-6GRSrrlt.mjs +12 -0
- package/dist/{use-safe-layout-effect-vuYaDIpT.cjs → use-fieldset-context-CCQLmNLL.cjs} +1 -13
- package/dist/use-safe-layout-effect-C2GgvNT3.cjs +13 -0
- package/dist/use-safe-layout-effect-DPn_9-dD.mjs +7 -0
- package/dist/utils/index.cjs +3 -3
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.mjs +2 -2
- package/package.json +222 -2
- package/dist/use-safe-layout-effect-BlOhFUAp.mjs +0 -17
- /package/dist/{chunk-DLP0tNsH.mjs → chunk-BU8PiJgx.mjs} +0 -0
- /package/dist/{core-C0F-4KYH.mjs → core-79NSyZp-.mjs} +0 -0
- /package/dist/{create-context-CdjrBhu7.mjs → create-context-DbhrVE2B.mjs} +0 -0
- /package/dist/{create-split-props-BJQdOyld.mjs → create-split-props-BJdRM9I_.mjs} +0 -0
- /package/dist/{create-split-props-CSkzaUOy.cjs → create-split-props-Dp4TWOyM.cjs} +0 -0
- /package/dist/{factory-BbbIuDqa.d.mts → factory-DaVlp4Ba.d.mts} +0 -0
- /package/dist/{factory-DaNWFLLN.d.cts → factory-fcFI3pbG.d.cts} +0 -0
- /package/dist/{index-BwTxN5vG.d.mts → index-BoLg0FWF.d.mts} +0 -0
- /package/dist/{index-DsZldSch.d.cts → index-CReeoTjv.d.cts} +0 -0
- /package/dist/{index-Dhthtdz_.d.mts → index-DPoOdvOg.d.mts} +0 -0
- /package/dist/{index-zOmANnUL.d.cts → index-r8rv70-L.d.cts} +0 -0
- /package/dist/{render-strategy-GetMScNK.d.mts → render-strategy-CRwPcG33.d.mts} +0 -0
- /package/dist/{render-strategy-CdpAg9jb.d.cts → render-strategy-M8NkD01w.d.cts} +0 -0
- /package/dist/{use-event-BcyNH29h.mjs → use-event-B4e6iJDK.mjs} +0 -0
- /package/dist/{utils-DflO0-3U.mjs → utils-BQJFlkDE.mjs} +0 -0
- /package/dist/{utils-Cb5K29pi.cjs → utils-B_Ojepvp.cjs} +0 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { r as PropTypes } from "../../index-BLd57Y0z.mjs";
|
|
2
|
+
import { r as Optional, t as Assign } from "../../types-CrwpJrFp.mjs";
|
|
3
|
+
import { r as PolymorphicProps, t as HTMLProps } from "../../factory-DaVlp4Ba.mjs";
|
|
4
|
+
import { _ as CollectionItem, b as createListCollection, y as ListCollection } from "../../index-DPoOdvOg.mjs";
|
|
5
|
+
import * as react284 from "react";
|
|
6
|
+
import { JSX, ReactNode } from "react";
|
|
7
|
+
import * as _sprawlify_primitives_anatomy5 from "@sprawlify/primitives/anatomy";
|
|
8
|
+
import * as listbox from "@sprawlify/primitives/machines/listbox";
|
|
9
|
+
import { HighlightChangeDetails, HighlightChangeDetails as ListboxHighlightChangeDetails, InputProps, ItemProps, ItemState, ScrollToIndexDetails, ScrollToIndexDetails as ListboxScrollToIndexDetails, SelectionDetails, SelectionDetails as ListboxSelectionDetails, SelectionMode, SelectionMode as ListboxSelectionMode, ValueChangeDetails, ValueChangeDetails as ListboxValueChangeDetails } from "@sprawlify/primitives/machines/listbox";
|
|
10
|
+
|
|
11
|
+
//#region src/components/listbox/listbox-content.d.ts
|
|
12
|
+
interface ListboxContentBaseProps extends PolymorphicProps {}
|
|
13
|
+
interface ListboxContentProps extends HTMLProps<"div">, ListboxContentBaseProps {}
|
|
14
|
+
declare const ListboxContent: react284.ForwardRefExoticComponent<ListboxContentProps & react284.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/components/listbox/use-listbox.d.ts
|
|
17
|
+
interface UseListboxProps<T extends CollectionItem> extends Optional<Omit<listbox.Props<T>, "dir" | "getRootNode" | "collection">, "id"> {
|
|
18
|
+
collection: ListCollection<T>;
|
|
19
|
+
}
|
|
20
|
+
interface UseListboxReturn<T extends CollectionItem> extends listbox.Api<PropTypes, T> {}
|
|
21
|
+
declare const useListbox: <T extends CollectionItem>(props: UseListboxProps<T>) => UseListboxReturn<T>;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/listbox/use-listbox-context.d.ts
|
|
24
|
+
interface UseListboxContext<T extends CollectionItem> extends UseListboxReturn<T> {}
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/listbox/listbox-context.d.ts
|
|
27
|
+
interface ListboxContextProps<T extends CollectionItem> {
|
|
28
|
+
children: (context: UseListboxContext<T>) => ReactNode;
|
|
29
|
+
}
|
|
30
|
+
declare const ListboxContext: <T extends CollectionItem>(props: ListboxContextProps<T>) => ReactNode;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/listbox/listbox-empty.d.ts
|
|
33
|
+
interface ListboxEmptyBaseProps extends PolymorphicProps {}
|
|
34
|
+
interface ListboxEmptyProps extends HTMLProps<"div">, ListboxEmptyBaseProps {}
|
|
35
|
+
declare const ListboxEmpty: react284.ForwardRefExoticComponent<ListboxEmptyProps & react284.RefAttributes<HTMLDivElement>>;
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/components/listbox/listbox-input.d.ts
|
|
38
|
+
interface ListboxInputBaseProps extends InputProps, PolymorphicProps {}
|
|
39
|
+
interface ListboxInputProps extends HTMLProps<"input">, ListboxInputBaseProps {}
|
|
40
|
+
declare const ListboxInput: react284.ForwardRefExoticComponent<ListboxInputProps & react284.RefAttributes<HTMLInputElement>>;
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/components/listbox/listbox-item.d.ts
|
|
43
|
+
interface ListboxItemBaseProps extends ItemProps, PolymorphicProps {}
|
|
44
|
+
interface ListboxItemProps extends HTMLProps<"div">, ListboxItemBaseProps {}
|
|
45
|
+
declare const ListboxItem: react284.ForwardRefExoticComponent<ListboxItemProps & react284.RefAttributes<HTMLDivElement>>;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/listbox/use-listbox-item-context.d.ts
|
|
48
|
+
interface UseListboxItemContext extends ItemState {}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/components/listbox/listbox-item-context.d.ts
|
|
51
|
+
interface ListboxItemContextProps {
|
|
52
|
+
children: (context: UseListboxItemContext) => ReactNode;
|
|
53
|
+
}
|
|
54
|
+
declare const ListboxItemContext: (props: ListboxItemContextProps) => ReactNode;
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/components/listbox/listbox-item-group.d.ts
|
|
57
|
+
interface ListboxItemGroupBaseProps extends PolymorphicProps {}
|
|
58
|
+
interface ListboxItemGroupProps extends HTMLProps<"div">, ListboxItemGroupBaseProps {}
|
|
59
|
+
declare const ListboxItemGroup: react284.ForwardRefExoticComponent<ListboxItemGroupProps & react284.RefAttributes<HTMLDivElement>>;
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/components/listbox/listbox-item-group-label.d.ts
|
|
62
|
+
interface ListboxItemGroupLabelBaseProps extends PolymorphicProps {}
|
|
63
|
+
interface ListboxItemGroupLabelProps extends HTMLProps<"div">, ListboxItemGroupLabelBaseProps {}
|
|
64
|
+
declare const ListboxItemGroupLabel: react284.ForwardRefExoticComponent<ListboxItemGroupLabelProps & react284.RefAttributes<HTMLDivElement>>;
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/components/listbox/listbox-item-indicator.d.ts
|
|
67
|
+
interface ListboxItemIndicatorBaseProps extends PolymorphicProps {}
|
|
68
|
+
interface ListboxItemIndicatorProps extends HTMLProps<"div">, ListboxItemIndicatorBaseProps {}
|
|
69
|
+
declare const ListboxItemIndicator: react284.ForwardRefExoticComponent<ListboxItemIndicatorProps & react284.RefAttributes<HTMLDivElement>>;
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/components/listbox/listbox-item-text.d.ts
|
|
72
|
+
interface ListboxItemTextBaseProps extends PolymorphicProps {}
|
|
73
|
+
interface ListboxItemTextProps extends HTMLProps<"div">, ListboxItemTextBaseProps {}
|
|
74
|
+
declare const ListboxItemText: react284.ForwardRefExoticComponent<ListboxItemTextProps & react284.RefAttributes<HTMLDivElement>>;
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/components/listbox/listbox-label.d.ts
|
|
77
|
+
interface ListboxLabelBaseProps extends PolymorphicProps {}
|
|
78
|
+
interface ListboxLabelProps extends HTMLProps<"label">, ListboxLabelBaseProps {}
|
|
79
|
+
declare const ListboxLabel: react284.ForwardRefExoticComponent<ListboxLabelProps & react284.RefAttributes<HTMLLabelElement>>;
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/components/listbox/listbox-root.d.ts
|
|
82
|
+
interface ListboxRootBaseProps<T extends CollectionItem> extends UseListboxProps<T>, PolymorphicProps {}
|
|
83
|
+
interface ListboxRootProps<T extends CollectionItem> extends Assign<HTMLProps<"div">, ListboxRootBaseProps<T>> {}
|
|
84
|
+
type ListboxRootComponentProps<T extends CollectionItem = CollectionItem, P = {}> = Assign<ListboxRootProps<T>, P> & React.RefAttributes<HTMLDivElement>;
|
|
85
|
+
type ListboxRootComponent<P = {}> = <T extends CollectionItem>(props: ListboxRootComponentProps<T, P>) => JSX.Element;
|
|
86
|
+
declare const ListboxRoot: ListboxRootComponent;
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/components/listbox/listbox-root-provider.d.ts
|
|
89
|
+
interface RootProviderProps<T extends CollectionItem> {
|
|
90
|
+
value: UseListboxReturn<T>;
|
|
91
|
+
}
|
|
92
|
+
interface ListboxRootProviderBaseProps<T extends CollectionItem> extends RootProviderProps<T>, PolymorphicProps {}
|
|
93
|
+
interface ListboxRootProviderProps<T extends CollectionItem> extends HTMLProps<"div">, ListboxRootProviderBaseProps<T> {}
|
|
94
|
+
type ListboxRootProviderComponent<P = {}> = <T extends CollectionItem>(props: Assign<ListboxRootProviderProps<T>, P> & React.RefAttributes<HTMLDivElement>) => JSX.Element;
|
|
95
|
+
declare const ListboxRootProvider: ListboxRootProviderComponent;
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/components/listbox/listbox-value-text.d.ts
|
|
98
|
+
interface ListboxValueTextBaseProps extends PolymorphicProps {
|
|
99
|
+
placeholder?: string | undefined;
|
|
100
|
+
}
|
|
101
|
+
interface ListboxValueTextProps extends HTMLProps<"span">, ListboxValueTextBaseProps {}
|
|
102
|
+
declare const ListboxValueText: react284.ForwardRefExoticComponent<ListboxValueTextProps & react284.RefAttributes<HTMLSpanElement>>;
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/components/listbox/listbox-anatomy.d.ts
|
|
105
|
+
declare const listboxAnatomy: _sprawlify_primitives_anatomy5.AnatomyInstance<"input" | "label" | "content" | "root" | "item" | "itemGroup" | "valueText" | "itemIndicator" | "itemText" | "itemGroupLabel" | "empty">;
|
|
106
|
+
declare namespace listbox_d_exports {
|
|
107
|
+
export { ListboxContent as Content, ListboxContentBaseProps as ContentBaseProps, ListboxContentProps as ContentProps, ListboxContext as Context, ListboxContextProps as ContextProps, ListboxEmpty as Empty, ListboxEmptyBaseProps as EmptyBaseProps, ListboxEmptyProps as EmptyProps, HighlightChangeDetails, ListboxInput as Input, ListboxInputBaseProps as InputBaseProps, ListboxInputProps as InputProps, ListboxItem as Item, ListboxItemBaseProps as ItemBaseProps, ListboxItemContext as ItemContext, ListboxItemContextProps as ItemContextProps, ListboxItemGroup as ItemGroup, ListboxItemGroupBaseProps as ItemGroupBaseProps, ListboxItemGroupLabel as ItemGroupLabel, ListboxItemGroupLabelBaseProps as ItemGroupLabelBaseProps, ListboxItemGroupLabelProps as ItemGroupLabelProps, ListboxItemGroupProps as ItemGroupProps, ListboxItemIndicator as ItemIndicator, ListboxItemIndicatorBaseProps as ItemIndicatorBaseProps, ListboxItemIndicatorProps as ItemIndicatorProps, ListboxItemProps as ItemProps, ListboxItemText as ItemText, ListboxItemTextBaseProps as ItemTextBaseProps, ListboxItemTextProps as ItemTextProps, ListboxLabel as Label, ListboxLabelBaseProps as LabelBaseProps, ListboxLabelProps as LabelProps, ListboxRoot as Root, ListboxRootBaseProps as RootBaseProps, ListboxRootComponent as RootComponent, ListboxRootComponentProps as RootComponentProps, ListboxRootProps as RootProps, ListboxRootProvider as RootProvider, ListboxRootProviderBaseProps as RootProviderBaseProps, ListboxRootProviderComponent as RootProviderComponent, ListboxRootProviderProps as RootProviderProps, ScrollToIndexDetails, SelectionDetails, SelectionMode, ValueChangeDetails, ListboxValueText as ValueText, ListboxValueTextBaseProps as ValueTextBaseProps, ListboxValueTextProps as ValueTextProps };
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { type CollectionItem, type ListCollection, listbox_d_exports as Listbox, ListboxContent, type ListboxContentBaseProps, type ListboxContentProps, ListboxContext, type ListboxContextProps, ListboxEmpty, type ListboxEmptyBaseProps, type ListboxEmptyProps, type ListboxHighlightChangeDetails, ListboxInput, type ListboxInputBaseProps, type ListboxInputProps, ListboxItem, type ListboxItemBaseProps, ListboxItemContext, type ListboxItemContextProps, ListboxItemGroup, type ListboxItemGroupBaseProps, ListboxItemGroupLabel, type ListboxItemGroupLabelBaseProps, type ListboxItemGroupLabelProps, type ListboxItemGroupProps, ListboxItemIndicator, type ListboxItemIndicatorBaseProps, type ListboxItemIndicatorProps, type ListboxItemProps, ListboxItemText, type ListboxItemTextBaseProps, type ListboxItemTextProps, ListboxLabel, type ListboxLabelBaseProps, type ListboxLabelProps, ListboxRoot, type ListboxRootBaseProps, type ListboxRootComponent, type ListboxRootComponentProps, type ListboxRootProps, ListboxRootProvider, type ListboxRootProviderBaseProps, type ListboxRootProviderComponent, type ListboxRootProviderProps, type ListboxScrollToIndexDetails, type ListboxSelectionDetails, type ListboxSelectionMode, type ListboxValueChangeDetails, ListboxValueText, type ListboxValueTextBaseProps, type ListboxValueTextProps, type UseListboxContext, type UseListboxItemContext, type UseListboxProps, type UseListboxReturn, createListCollection, listboxAnatomy, useListbox, useListboxContext, useListboxItemContext };
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { t as __export } from "../../chunk-BU8PiJgx.mjs";
|
|
2
|
+
import { i as useMachine, r as normalizeProps, t as mergeProps } from "../../core-79NSyZp-.mjs";
|
|
3
|
+
import { t as createContext$1 } from "../../create-context-DbhrVE2B.mjs";
|
|
4
|
+
import { n as useEnvironmentContext } from "../../environment-Cc02I6aF.mjs";
|
|
5
|
+
import { i as useLocaleContext } from "../../locale-D4LX0eEq.mjs";
|
|
6
|
+
import "../../providers-CoJceYkV.mjs";
|
|
7
|
+
import { n as sprawlify } from "../../factory-7ydMApfi.mjs";
|
|
8
|
+
import { t as createSplitProps } from "../../create-split-props-BJdRM9I_.mjs";
|
|
9
|
+
import "../../use-event-B4e6iJDK.mjs";
|
|
10
|
+
import { o as createListCollection } from "../../collection-BYYMj_V8.mjs";
|
|
11
|
+
import { forwardRef, useId } from "react";
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as listbox from "@sprawlify/primitives/machines/listbox";
|
|
14
|
+
import { anatomy } from "@sprawlify/primitives/machines/listbox";
|
|
15
|
+
|
|
16
|
+
//#region src/components/listbox/use-listbox-context.ts
|
|
17
|
+
const [ListboxProvider, useListboxContext] = createContext$1({
|
|
18
|
+
name: "ListboxContext",
|
|
19
|
+
hookName: "useListboxContext",
|
|
20
|
+
providerName: "<ListboxProvider />"
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/components/listbox/listbox-content.tsx
|
|
25
|
+
const ListboxContent = forwardRef((props, ref) => {
|
|
26
|
+
const mergedProps = mergeProps(useListboxContext().getContentProps(), props);
|
|
27
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
28
|
+
...mergedProps,
|
|
29
|
+
ref
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
ListboxContent.displayName = "ListboxContent";
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/components/listbox/listbox-context.ts
|
|
36
|
+
const ListboxContext = (props) => props.children(useListboxContext());
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/components/listbox/listbox-anatomy.ts
|
|
40
|
+
const listboxAnatomy = anatomy.extendWith("empty");
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/components/listbox/listbox-empty.tsx
|
|
44
|
+
const parts = listboxAnatomy.build();
|
|
45
|
+
const ListboxEmpty = forwardRef((props, ref) => {
|
|
46
|
+
if (useListboxContext().collection.size !== 0) return null;
|
|
47
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
48
|
+
...parts.empty.attrs,
|
|
49
|
+
...props,
|
|
50
|
+
role: "presentation",
|
|
51
|
+
ref
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
ListboxEmpty.displayName = "ListboxEmpty";
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/components/listbox/listbox-input.tsx
|
|
58
|
+
const splitInputProps = createSplitProps();
|
|
59
|
+
const ListboxInput = forwardRef((props, ref) => {
|
|
60
|
+
const [inputProps, localProps] = splitInputProps(props, ["autoHighlight"]);
|
|
61
|
+
const mergedProps = mergeProps(useListboxContext().getInputProps(inputProps), localProps);
|
|
62
|
+
return /* @__PURE__ */ jsx(sprawlify.input, {
|
|
63
|
+
...mergedProps,
|
|
64
|
+
ref
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
ListboxInput.displayName = "ListboxInput";
|
|
68
|
+
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/components/listbox/use-listbox-item-context.ts
|
|
71
|
+
const [ListboxItemProvider, useListboxItemContext] = createContext$1({
|
|
72
|
+
name: "ListboxItemContext",
|
|
73
|
+
hookName: "useListboxItemContext",
|
|
74
|
+
providerName: "<ListboxItemProvider />"
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/components/listbox/use-listbox-item-props-context.ts
|
|
79
|
+
const [ListboxItemPropsProvider, useListboxItemPropsContext] = createContext$1({
|
|
80
|
+
name: "ListboxItemPropsContext",
|
|
81
|
+
hookName: "useListboxItemPropsContext",
|
|
82
|
+
providerName: "<ListboxItemPropsProvider />"
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/components/listbox/listbox-item.tsx
|
|
87
|
+
const splitItemProps = createSplitProps();
|
|
88
|
+
const ListboxItem = forwardRef((props, ref) => {
|
|
89
|
+
const [itemProps, localProps] = splitItemProps(props, ["item", "highlightOnHover"]);
|
|
90
|
+
const listbox$1 = useListboxContext();
|
|
91
|
+
const mergedProps = mergeProps(listbox$1.getItemProps(itemProps), localProps);
|
|
92
|
+
return /* @__PURE__ */ jsx(ListboxItemPropsProvider, {
|
|
93
|
+
value: itemProps,
|
|
94
|
+
children: /* @__PURE__ */ jsx(ListboxItemProvider, {
|
|
95
|
+
value: listbox$1.getItemState(itemProps),
|
|
96
|
+
children: /* @__PURE__ */ jsx(sprawlify.div, {
|
|
97
|
+
...mergedProps,
|
|
98
|
+
ref
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
ListboxItem.displayName = "ListboxItem";
|
|
104
|
+
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/components/listbox/listbox-item-context.tsx
|
|
107
|
+
const ListboxItemContext = (props) => props.children(useListboxItemContext());
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/components/listbox/use-listbox-item-group-props.ts
|
|
111
|
+
const [ListboxItemGroupPropsProvider, useListboxItemGroupPropsContext] = createContext$1({
|
|
112
|
+
name: "ListboxItemGroupPropsContext",
|
|
113
|
+
hookName: "useListboxItemGroupPropsContext",
|
|
114
|
+
providerName: "<ListboxItemGroupPropsProvider />"
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/components/listbox/listbox-item-group.tsx
|
|
119
|
+
const splitItemGroupProps = createSplitProps();
|
|
120
|
+
const ListboxItemGroup = forwardRef((props, ref) => {
|
|
121
|
+
const id = useId();
|
|
122
|
+
const [_itemGroupProps, localProps] = splitItemGroupProps(props, ["id"]);
|
|
123
|
+
const itemGroupProps = {
|
|
124
|
+
id,
|
|
125
|
+
..._itemGroupProps
|
|
126
|
+
};
|
|
127
|
+
const mergedProps = mergeProps(useListboxContext().getItemGroupProps(itemGroupProps), localProps);
|
|
128
|
+
return /* @__PURE__ */ jsx(ListboxItemGroupPropsProvider, {
|
|
129
|
+
value: itemGroupProps,
|
|
130
|
+
children: /* @__PURE__ */ jsx(sprawlify.div, {
|
|
131
|
+
...mergedProps,
|
|
132
|
+
ref
|
|
133
|
+
})
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
ListboxItemGroup.displayName = "ListboxItemGroup";
|
|
137
|
+
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region src/components/listbox/listbox-item-group-label.tsx
|
|
140
|
+
const ListboxItemGroupLabel = forwardRef((props, ref) => {
|
|
141
|
+
const listbox$1 = useListboxContext();
|
|
142
|
+
const itemGroupProps = useListboxItemGroupPropsContext();
|
|
143
|
+
const mergedProps = mergeProps(listbox$1.getItemGroupLabelProps({ htmlFor: itemGroupProps.id }), props);
|
|
144
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
145
|
+
...mergedProps,
|
|
146
|
+
ref
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
ListboxItemGroupLabel.displayName = "ListboxItemGroupLabel";
|
|
150
|
+
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/components/listbox/listbox-item-indicator.tsx
|
|
153
|
+
const ListboxItemIndicator = forwardRef((props, ref) => {
|
|
154
|
+
const listbox$1 = useListboxContext();
|
|
155
|
+
const itemProps = useListboxItemPropsContext();
|
|
156
|
+
const mergedProps = mergeProps(listbox$1.getItemIndicatorProps(itemProps), props);
|
|
157
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
158
|
+
...mergedProps,
|
|
159
|
+
ref
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
ListboxItemIndicator.displayName = "ListboxItemIndicator";
|
|
163
|
+
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/components/listbox/listbox-item-text.tsx
|
|
166
|
+
const ListboxItemText = forwardRef((props, ref) => {
|
|
167
|
+
const listbox$1 = useListboxContext();
|
|
168
|
+
const itemProps = useListboxItemPropsContext();
|
|
169
|
+
const mergedProps = mergeProps(listbox$1.getItemTextProps(itemProps), props);
|
|
170
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
171
|
+
...mergedProps,
|
|
172
|
+
ref
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
ListboxItemText.displayName = "ListboxItemText";
|
|
176
|
+
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/components/listbox/listbox-label.tsx
|
|
179
|
+
const ListboxLabel = forwardRef((props, ref) => {
|
|
180
|
+
const mergedProps = mergeProps(useListboxContext().getLabelProps(), props);
|
|
181
|
+
return /* @__PURE__ */ jsx(sprawlify.label, {
|
|
182
|
+
...mergedProps,
|
|
183
|
+
ref
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
ListboxLabel.displayName = "ListboxLabel";
|
|
187
|
+
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/components/listbox/use-listbox.ts
|
|
190
|
+
const useListbox = (props) => {
|
|
191
|
+
const id = useId();
|
|
192
|
+
const { dir } = useLocaleContext();
|
|
193
|
+
const { getRootNode } = useEnvironmentContext();
|
|
194
|
+
const machineProps = {
|
|
195
|
+
id,
|
|
196
|
+
dir,
|
|
197
|
+
getRootNode,
|
|
198
|
+
...props
|
|
199
|
+
};
|
|
200
|
+
const service = useMachine(listbox.machine, machineProps);
|
|
201
|
+
return listbox.connect(service, normalizeProps);
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region src/components/listbox/listbox-root.tsx
|
|
206
|
+
const ListboxImpl$1 = (props, ref) => {
|
|
207
|
+
const [useListboxProps, localProps] = createSplitProps()(props, [
|
|
208
|
+
"collection",
|
|
209
|
+
"defaultHighlightedValue",
|
|
210
|
+
"defaultValue",
|
|
211
|
+
"deselectable",
|
|
212
|
+
"disabled",
|
|
213
|
+
"disallowSelectAll",
|
|
214
|
+
"highlightedValue",
|
|
215
|
+
"id",
|
|
216
|
+
"ids",
|
|
217
|
+
"loopFocus",
|
|
218
|
+
"onHighlightChange",
|
|
219
|
+
"onSelect",
|
|
220
|
+
"onValueChange",
|
|
221
|
+
"orientation",
|
|
222
|
+
"scrollToIndexFn",
|
|
223
|
+
"selectionMode",
|
|
224
|
+
"selectOnHighlight",
|
|
225
|
+
"typeahead",
|
|
226
|
+
"value"
|
|
227
|
+
]);
|
|
228
|
+
const listbox$1 = useListbox(useListboxProps);
|
|
229
|
+
const mergedProps = mergeProps(listbox$1.getRootProps(), localProps);
|
|
230
|
+
return /* @__PURE__ */ jsx(ListboxProvider, {
|
|
231
|
+
value: listbox$1,
|
|
232
|
+
children: /* @__PURE__ */ jsx(sprawlify.div, {
|
|
233
|
+
...mergedProps,
|
|
234
|
+
ref
|
|
235
|
+
})
|
|
236
|
+
});
|
|
237
|
+
};
|
|
238
|
+
const ListboxRoot = forwardRef(ListboxImpl$1);
|
|
239
|
+
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region src/components/listbox/listbox-root-provider.tsx
|
|
242
|
+
const ListboxImpl = (props, ref) => {
|
|
243
|
+
const [{ value: listbox$1 }, localProps] = createSplitProps()(props, ["value"]);
|
|
244
|
+
const mergedProps = mergeProps(listbox$1.getRootProps(), localProps);
|
|
245
|
+
return /* @__PURE__ */ jsx(ListboxProvider, {
|
|
246
|
+
value: listbox$1,
|
|
247
|
+
children: /* @__PURE__ */ jsx(sprawlify.div, {
|
|
248
|
+
...mergedProps,
|
|
249
|
+
ref
|
|
250
|
+
})
|
|
251
|
+
});
|
|
252
|
+
};
|
|
253
|
+
const ListboxRootProvider = forwardRef(ListboxImpl);
|
|
254
|
+
|
|
255
|
+
//#endregion
|
|
256
|
+
//#region src/components/listbox/listbox-value-text.tsx
|
|
257
|
+
const ListboxValueText = forwardRef((props, ref) => {
|
|
258
|
+
const { children, placeholder, ...localprops } = props;
|
|
259
|
+
const listbox$1 = useListboxContext();
|
|
260
|
+
const mergedProps = mergeProps(listbox$1.getValueTextProps(), localprops);
|
|
261
|
+
return /* @__PURE__ */ jsx(sprawlify.span, {
|
|
262
|
+
...mergedProps,
|
|
263
|
+
ref,
|
|
264
|
+
children: children || listbox$1.valueAsString || placeholder
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
ListboxValueText.displayName = "ListboxValueText";
|
|
268
|
+
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region src/components/listbox/listbox.ts
|
|
271
|
+
var listbox_exports = /* @__PURE__ */ __export({
|
|
272
|
+
Content: () => ListboxContent,
|
|
273
|
+
Context: () => ListboxContext,
|
|
274
|
+
Empty: () => ListboxEmpty,
|
|
275
|
+
Input: () => ListboxInput,
|
|
276
|
+
Item: () => ListboxItem,
|
|
277
|
+
ItemContext: () => ListboxItemContext,
|
|
278
|
+
ItemGroup: () => ListboxItemGroup,
|
|
279
|
+
ItemGroupLabel: () => ListboxItemGroupLabel,
|
|
280
|
+
ItemIndicator: () => ListboxItemIndicator,
|
|
281
|
+
ItemText: () => ListboxItemText,
|
|
282
|
+
Label: () => ListboxLabel,
|
|
283
|
+
Root: () => ListboxRoot,
|
|
284
|
+
RootProvider: () => ListboxRootProvider,
|
|
285
|
+
ValueText: () => ListboxValueText
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
//#endregion
|
|
289
|
+
export { listbox_exports as Listbox, ListboxContent, ListboxContext, ListboxEmpty, ListboxInput, ListboxItem, ListboxItemContext, ListboxItemGroup, ListboxItemGroupLabel, ListboxItemIndicator, ListboxItemText, ListboxLabel, ListboxRoot, ListboxRootProvider, ListboxValueText, createListCollection, listboxAnatomy, useListbox, useListboxContext, useListboxItemContext };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
const require_chunk = require('../../chunk-BYnRvbsk.cjs');
|
|
2
|
+
const require_core = require('../../core-DCWyxy9D.cjs');
|
|
3
|
+
const require_create_context = require('../../create-context-CQ4U0lLj.cjs');
|
|
4
|
+
const require_environment = require('../../environment-CvilmfQt.cjs');
|
|
5
|
+
const require_locale = require('../../locale-BcnWD1Hf.cjs');
|
|
6
|
+
require('../../providers-BNAArubQ.cjs');
|
|
7
|
+
const require_factory = require('../../factory-C166evrS.cjs');
|
|
8
|
+
const require_create_split_props = require('../../create-split-props-Dp4TWOyM.cjs');
|
|
9
|
+
let react = require("react");
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
let __sprawlify_primitives_machines_marquee = require("@sprawlify/primitives/machines/marquee");
|
|
12
|
+
__sprawlify_primitives_machines_marquee = require_chunk.__toESM(__sprawlify_primitives_machines_marquee);
|
|
13
|
+
let __sprawlify_primitives_core = require("@sprawlify/primitives/core");
|
|
14
|
+
|
|
15
|
+
//#region src/components/marquee/use-marquee-context.ts
|
|
16
|
+
const [MarqueeProvider, useMarqueeContext] = require_create_context.createContext({
|
|
17
|
+
name: "MarqueeContext",
|
|
18
|
+
hookName: "useMarqueeContext",
|
|
19
|
+
providerName: "<MarqueeProvider />"
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/marquee/marquee-content.tsx
|
|
24
|
+
const MarqueeContent = (0, react.forwardRef)((props, ref) => {
|
|
25
|
+
const { children, ...localProps } = props;
|
|
26
|
+
const marquee = useMarqueeContext();
|
|
27
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: Array.from({ length: marquee.contentCount }).map((_, index) => {
|
|
28
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(marquee.getContentProps({ index }), localProps);
|
|
29
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
30
|
+
...mergedProps,
|
|
31
|
+
ref: index === 0 ? ref : void 0,
|
|
32
|
+
children
|
|
33
|
+
}, index);
|
|
34
|
+
}) });
|
|
35
|
+
});
|
|
36
|
+
MarqueeContent.displayName = "MarqueeContent";
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/components/marquee/marquee-context.tsx
|
|
40
|
+
const MarqueeContext = (props) => props.children(useMarqueeContext());
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/components/marquee/marquee-edge.tsx
|
|
44
|
+
const splitEdgeProps = require_create_split_props.createSplitProps();
|
|
45
|
+
const MarqueeEdge = (0, react.forwardRef)((props, ref) => {
|
|
46
|
+
const [edgeProps, localProps] = splitEdgeProps(props, ["side"]);
|
|
47
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(useMarqueeContext().getEdgeProps(edgeProps), localProps);
|
|
48
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
49
|
+
...mergedProps,
|
|
50
|
+
ref
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
MarqueeEdge.displayName = "MarqueeEdge";
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/components/marquee/marquee-item.tsx
|
|
57
|
+
const MarqueeItem = (0, react.forwardRef)((props, ref) => {
|
|
58
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(useMarqueeContext().getItemProps(), props);
|
|
59
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
60
|
+
...mergedProps,
|
|
61
|
+
ref
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
MarqueeItem.displayName = "MarqueeItem";
|
|
65
|
+
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/components/marquee/use-marquee.ts
|
|
68
|
+
const useMarquee = (props) => {
|
|
69
|
+
const id = (0, react.useId)();
|
|
70
|
+
const { getRootNode } = require_environment.useEnvironmentContext();
|
|
71
|
+
const { dir } = require_locale.useLocaleContext();
|
|
72
|
+
const context = {
|
|
73
|
+
id,
|
|
74
|
+
dir,
|
|
75
|
+
getRootNode,
|
|
76
|
+
...props
|
|
77
|
+
};
|
|
78
|
+
const service = require_core.useMachine(__sprawlify_primitives_machines_marquee.machine, context);
|
|
79
|
+
return __sprawlify_primitives_machines_marquee.connect(service, require_core.normalizeProps);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/components/marquee/marquee-root.tsx
|
|
84
|
+
const splitRootProps = require_create_split_props.createSplitProps();
|
|
85
|
+
const MarqueeRoot = (0, react.forwardRef)((props, ref) => {
|
|
86
|
+
const [useMarqueeProps, localProps] = splitRootProps(props, [
|
|
87
|
+
"autoFill",
|
|
88
|
+
"defaultPaused",
|
|
89
|
+
"delay",
|
|
90
|
+
"id",
|
|
91
|
+
"ids",
|
|
92
|
+
"loopCount",
|
|
93
|
+
"onComplete",
|
|
94
|
+
"onLoopComplete",
|
|
95
|
+
"onPauseChange",
|
|
96
|
+
"paused",
|
|
97
|
+
"pauseOnInteraction",
|
|
98
|
+
"reverse",
|
|
99
|
+
"side",
|
|
100
|
+
"spacing",
|
|
101
|
+
"speed",
|
|
102
|
+
"translations"
|
|
103
|
+
]);
|
|
104
|
+
const marqueeApi = useMarquee(useMarqueeProps);
|
|
105
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(marqueeApi.getRootProps(), localProps);
|
|
106
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarqueeProvider, {
|
|
107
|
+
value: marqueeApi,
|
|
108
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
109
|
+
...mergedProps,
|
|
110
|
+
ref
|
|
111
|
+
})
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
MarqueeRoot.displayName = "MarqueeRoot";
|
|
115
|
+
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/components/marquee/marquee-root-provider.tsx
|
|
118
|
+
const splitRootProviderProps = require_create_split_props.createSplitProps();
|
|
119
|
+
const MarqueeRootProvider = (0, react.forwardRef)((props, ref) => {
|
|
120
|
+
const [{ value: marquee }, localProps] = splitRootProviderProps(props, ["value"]);
|
|
121
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(marquee.getRootProps(), localProps);
|
|
122
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarqueeProvider, {
|
|
123
|
+
value: marquee,
|
|
124
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
125
|
+
...mergedProps,
|
|
126
|
+
ref
|
|
127
|
+
})
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
MarqueeRootProvider.displayName = "MarqueeRootProvider";
|
|
131
|
+
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/components/marquee/marquee-viewport.tsx
|
|
134
|
+
const MarqueeViewport = (0, react.forwardRef)((props, ref) => {
|
|
135
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(useMarqueeContext().getViewportProps(), props);
|
|
136
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
137
|
+
...mergedProps,
|
|
138
|
+
ref
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
MarqueeViewport.displayName = "MarqueeViewport";
|
|
142
|
+
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/components/marquee/marquee.ts
|
|
145
|
+
var marquee_exports = /* @__PURE__ */ require_chunk.__export({
|
|
146
|
+
Content: () => MarqueeContent,
|
|
147
|
+
Context: () => MarqueeContext,
|
|
148
|
+
Edge: () => MarqueeEdge,
|
|
149
|
+
Item: () => MarqueeItem,
|
|
150
|
+
Root: () => MarqueeRoot,
|
|
151
|
+
RootProvider: () => MarqueeRootProvider,
|
|
152
|
+
Viewport: () => MarqueeViewport
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
//#endregion
|
|
156
|
+
Object.defineProperty(exports, 'Marquee', {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function () {
|
|
159
|
+
return marquee_exports;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
exports.MarqueeContent = MarqueeContent;
|
|
163
|
+
exports.MarqueeContext = MarqueeContext;
|
|
164
|
+
exports.MarqueeEdge = MarqueeEdge;
|
|
165
|
+
exports.MarqueeItem = MarqueeItem;
|
|
166
|
+
exports.MarqueeRoot = MarqueeRoot;
|
|
167
|
+
exports.MarqueeRootProvider = MarqueeRootProvider;
|
|
168
|
+
exports.MarqueeViewport = MarqueeViewport;
|
|
169
|
+
Object.defineProperty(exports, 'marqueeAnatomy', {
|
|
170
|
+
enumerable: true,
|
|
171
|
+
get: function () {
|
|
172
|
+
return __sprawlify_primitives_machines_marquee.anatomy;
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
exports.useMarquee = useMarquee;
|
|
176
|
+
exports.useMarqueeContext = useMarqueeContext;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { t as PropTypes } from "../../normalize-props-Dw0EepzR.cjs";
|
|
2
|
+
import { r as Optional } from "../../types-DcUAwTQC.cjs";
|
|
3
|
+
import { r as PolymorphicProps, t as HTMLProps } from "../../factory-fcFI3pbG.cjs";
|
|
4
|
+
import * as react134 from "react";
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
import * as marquee from "@sprawlify/primitives/machines/marquee";
|
|
7
|
+
import { EdgeProps, PauseStatusDetails, PauseStatusDetails as MarqueePauseStatusDetails, Side, Side as MarqueeSide, anatomy as marqueeAnatomy } from "@sprawlify/primitives/machines/marquee";
|
|
8
|
+
|
|
9
|
+
//#region src/components/marquee/marquee-content.d.ts
|
|
10
|
+
interface MarqueeContentBaseProps extends PolymorphicProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
interface MarqueeContentProps extends Omit<HTMLProps<"div">, "children">, MarqueeContentBaseProps {}
|
|
14
|
+
declare const MarqueeContent: react134.ForwardRefExoticComponent<MarqueeContentProps & react134.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/components/marquee/use-marquee.d.ts
|
|
17
|
+
interface UseMarqueeProps extends Optional<Omit<marquee.Props, "dir" | "getRootNode">, "id"> {}
|
|
18
|
+
interface UseMarqueeReturn extends marquee.Api<PropTypes> {}
|
|
19
|
+
declare const useMarquee: (props?: UseMarqueeProps) => UseMarqueeReturn;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/components/marquee/use-marquee-context.d.ts
|
|
22
|
+
interface UseMarqueeContext extends UseMarqueeReturn {}
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/components/marquee/marquee-context.d.ts
|
|
25
|
+
interface MarqueeContextProps {
|
|
26
|
+
children: (context: UseMarqueeContext) => ReactNode;
|
|
27
|
+
}
|
|
28
|
+
declare const MarqueeContext: (props: MarqueeContextProps) => ReactNode;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/components/marquee/marquee-edge.d.ts
|
|
31
|
+
interface MarqueeEdgeBaseProps extends EdgeProps, PolymorphicProps {}
|
|
32
|
+
interface MarqueeEdgeProps extends HTMLProps<"div">, MarqueeEdgeBaseProps {}
|
|
33
|
+
declare const MarqueeEdge: react134.ForwardRefExoticComponent<MarqueeEdgeProps & react134.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/components/marquee/marquee-item.d.ts
|
|
36
|
+
interface MarqueeItemBaseProps extends PolymorphicProps {}
|
|
37
|
+
interface MarqueeItemProps extends HTMLProps<"div">, MarqueeItemBaseProps {}
|
|
38
|
+
declare const MarqueeItem: react134.ForwardRefExoticComponent<MarqueeItemProps & react134.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/components/marquee/marquee-root.d.ts
|
|
41
|
+
interface MarqueeRootBaseProps extends UseMarqueeProps, PolymorphicProps {}
|
|
42
|
+
interface MarqueeRootProps extends HTMLProps<"div">, MarqueeRootBaseProps {}
|
|
43
|
+
declare const MarqueeRoot: react134.ForwardRefExoticComponent<MarqueeRootProps & react134.RefAttributes<HTMLDivElement>>;
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/components/marquee/marquee-root-provider.d.ts
|
|
46
|
+
interface RootProviderProps {
|
|
47
|
+
value: UseMarqueeReturn;
|
|
48
|
+
}
|
|
49
|
+
interface MarqueeRootProviderBaseProps extends RootProviderProps, PolymorphicProps {}
|
|
50
|
+
interface MarqueeRootProviderProps extends HTMLProps<"div">, MarqueeRootProviderBaseProps {}
|
|
51
|
+
declare const MarqueeRootProvider: react134.ForwardRefExoticComponent<MarqueeRootProviderProps & react134.RefAttributes<HTMLDivElement>>;
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/marquee/marquee-viewport.d.ts
|
|
54
|
+
interface MarqueeViewportBaseProps extends PolymorphicProps {}
|
|
55
|
+
interface MarqueeViewportProps extends HTMLProps<"div">, MarqueeViewportBaseProps {}
|
|
56
|
+
declare const MarqueeViewport: react134.ForwardRefExoticComponent<MarqueeViewportProps & react134.RefAttributes<HTMLDivElement>>;
|
|
57
|
+
declare namespace marquee_d_exports {
|
|
58
|
+
export { MarqueeContent as Content, MarqueeContentBaseProps as ContentBaseProps, MarqueeContentProps as ContentProps, MarqueeContext as Context, MarqueeContextProps as ContextProps, MarqueeEdge as Edge, MarqueeEdgeBaseProps as EdgeBaseProps, MarqueeEdgeProps as EdgeProps, MarqueeItem as Item, MarqueeItemBaseProps as ItemBaseProps, MarqueeItemProps as ItemProps, PauseStatusDetails, MarqueeRoot as Root, MarqueeRootBaseProps as RootBaseProps, MarqueeRootProps as RootProps, MarqueeRootProvider as RootProvider, MarqueeRootProviderBaseProps as RootProviderBaseProps, MarqueeRootProviderProps as RootProviderProps, Side, MarqueeViewport as Viewport, MarqueeViewportBaseProps as ViewportBaseProps, MarqueeViewportProps as ViewportProps };
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { marquee_d_exports as Marquee, MarqueeContent, type MarqueeContentBaseProps, type MarqueeContentProps, MarqueeContext, type MarqueeContextProps, MarqueeEdge, type MarqueeEdgeBaseProps, type MarqueeEdgeProps, MarqueeItem, type MarqueeItemBaseProps, type MarqueeItemProps, type MarqueePauseStatusDetails, MarqueeRoot, type MarqueeRootBaseProps, type MarqueeRootProps, MarqueeRootProvider, type MarqueeRootProviderBaseProps, type MarqueeRootProviderProps, type MarqueeSide, MarqueeViewport, type MarqueeViewportBaseProps, type MarqueeViewportProps, type UseMarqueeContext, type UseMarqueeProps, type UseMarqueeReturn, marqueeAnatomy, useMarquee, useMarqueeContext };
|