@sprawlify/solid 0.0.18 → 0.0.19
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/{collapsible-BT7AHLQr.js → collapsible-ACshHp__.js} +8 -8
- package/dist/{collapsible-14K1NkX_.jsx → collapsible-CKkCMXuJ.jsx} +8 -8
- package/dist/{collection-BVSLJ8Vb.js → collection-CJLbf7-L.js} +2 -2
- package/dist/{collection-CIXQG-Ne.jsx → collection-DpPs7_vA.jsx} +2 -2
- package/dist/components/accordion/index.d.ts +11 -11
- package/dist/components/accordion/index.js +9 -9
- package/dist/components/accordion/index.jsx +9 -9
- package/dist/components/angle-slider/index.d.ts +13 -13
- package/dist/components/angle-slider/index.js +7 -7
- package/dist/components/angle-slider/index.jsx +7 -7
- package/dist/components/avatar/index.d.ts +8 -8
- package/dist/components/avatar/index.js +7 -7
- package/dist/components/avatar/index.jsx +7 -7
- package/dist/components/bottom-sheet/index.d.ts +13 -13
- package/dist/components/bottom-sheet/index.js +10 -10
- package/dist/components/bottom-sheet/index.jsx +10 -10
- package/dist/components/carousel/index.d.ts +16 -16
- package/dist/components/carousel/index.js +7 -7
- package/dist/components/carousel/index.jsx +7 -7
- package/dist/components/checkbox/index.d.ts +14 -14
- package/dist/components/checkbox/index.js +10 -10
- package/dist/components/checkbox/index.jsx +10 -10
- package/dist/components/clipboard/index.d.ts +11 -11
- package/dist/components/clipboard/index.js +7 -7
- package/dist/components/clipboard/index.jsx +7 -7
- package/dist/components/collapsible/index.d.ts +10 -10
- package/dist/components/collapsible/index.js +7 -7
- package/dist/components/collapsible/index.jsx +7 -7
- package/dist/components/collection/index.d.ts +2 -2
- package/dist/components/collection/index.js +2 -2
- package/dist/components/collection/index.jsx +2 -2
- package/dist/components/color-picker/index.d.ts +36 -36
- package/dist/components/color-picker/index.js +12 -12
- package/dist/components/color-picker/index.jsx +12 -12
- package/dist/components/combobox/index.d.ts +23 -23
- package/dist/components/combobox/index.js +13 -13
- package/dist/components/combobox/index.jsx +13 -13
- package/dist/components/date-picker/index.d.ts +33 -33
- package/dist/components/date-picker/index.js +10 -10
- package/dist/components/date-picker/index.jsx +10 -10
- package/dist/components/dialog/index.d.ts +13 -13
- package/dist/components/dialog/index.js +10 -10
- package/dist/components/dialog/index.jsx +10 -10
- package/dist/components/download-trigger/index.d.ts +2 -2
- package/dist/components/download-trigger/index.js +4 -4
- package/dist/components/download-trigger/index.jsx +4 -4
- package/dist/components/editable/index.d.ts +14 -14
- package/dist/components/editable/index.js +10 -10
- package/dist/components/editable/index.jsx +10 -10
- package/dist/components/field/index.d.ts +15 -15
- package/dist/components/field/index.js +8 -8
- package/dist/components/field/index.jsx +8 -8
- package/dist/components/fieldset/index.d.ts +12 -12
- package/dist/components/fieldset/index.js +7 -7
- package/dist/components/fieldset/index.jsx +7 -7
- package/dist/components/file-upload/index.d.ts +18 -18
- package/dist/components/file-upload/index.js +10 -10
- package/dist/components/file-upload/index.jsx +10 -10
- package/dist/components/floating-panel/index.d.ts +17 -17
- package/dist/components/floating-panel/index.js +10 -10
- package/dist/components/floating-panel/index.jsx +10 -10
- package/dist/components/focus-trap/index.d.ts +4 -4
- package/dist/components/focus-trap/index.js +4 -4
- package/dist/components/focus-trap/index.jsx +4 -4
- package/dist/components/format/index.d.ts +4 -4
- package/dist/components/format/index.js +3 -3
- package/dist/components/format/index.jsx +3 -3
- package/dist/components/frame/index.d.ts +1 -1
- package/dist/components/frame/index.js +3 -3
- package/dist/components/frame/index.jsx +3 -3
- package/dist/components/highlight/index.d.ts +3 -3
- package/dist/components/highlight/index.js +2 -2
- package/dist/components/highlight/index.jsx +2 -2
- package/dist/components/hover-card/index.d.ts +11 -11
- package/dist/components/hover-card/index.js +10 -10
- package/dist/components/hover-card/index.jsx +10 -10
- package/dist/components/image-cropper/index.d.ts +11 -11
- package/dist/components/image-cropper/index.js +7 -7
- package/dist/components/image-cropper/index.jsx +7 -7
- package/dist/components/json-tree-view/index.d.ts +6 -6
- package/dist/components/json-tree-view/index.js +10 -10
- package/dist/components/json-tree-view/index.jsx +10 -10
- package/dist/components/listbox/index.d.ts +18 -18
- package/dist/components/listbox/index.js +8 -8
- package/dist/components/listbox/index.jsx +8 -8
- package/dist/components/marquee/index.d.ts +9 -9
- package/dist/components/marquee/index.js +7 -7
- package/dist/components/marquee/index.jsx +7 -7
- package/dist/components/menu/index.d.ts +25 -25
- package/dist/components/menu/index.js +10 -10
- package/dist/components/menu/index.jsx +10 -10
- package/dist/components/navigation-menu/index.d.ts +17 -17
- package/dist/components/navigation-menu/index.js +10 -10
- package/dist/components/navigation-menu/index.jsx +10 -10
- package/dist/components/number-input/index.d.ts +13 -13
- package/dist/components/number-input/index.js +10 -10
- package/dist/components/number-input/index.jsx +10 -10
- package/dist/components/pagination/index.d.ts +12 -12
- package/dist/components/pagination/index.js +7 -7
- package/dist/components/pagination/index.jsx +7 -7
- package/dist/components/password-input/index.d.ts +9 -9
- package/dist/components/password-input/index.js +10 -10
- package/dist/components/password-input/index.jsx +10 -10
- package/dist/components/pin-input/index.d.ts +10 -10
- package/dist/components/pin-input/index.js +10 -10
- package/dist/components/pin-input/index.jsx +10 -10
- package/dist/components/popover/index.d.ts +16 -16
- package/dist/components/popover/index.js +10 -10
- package/dist/components/popover/index.jsx +10 -10
- package/dist/components/presence/index.d.ts +4 -4
- package/dist/components/presence/index.js +7 -7
- package/dist/components/presence/index.jsx +7 -7
- package/dist/components/progress/index.d.ts +79 -0
- package/dist/components/progress/index.js +163 -0
- package/dist/components/progress/index.jsx +154 -0
- package/dist/components/qr-code/index.d.ts +59 -0
- package/dist/components/qr-code/index.js +124 -0
- package/dist/components/qr-code/index.jsx +117 -0
- package/dist/components/radio-group/index.d.ts +78 -0
- package/dist/components/radio-group/index.js +189 -0
- package/dist/components/radio-group/index.jsx +176 -0
- package/dist/components/rating-group/index.d.ts +68 -0
- package/dist/components/rating-group/index.js +159 -0
- package/dist/components/rating-group/index.jsx +148 -0
- package/dist/components/scroll-area/index.d.ts +63 -0
- package/dist/components/scroll-area/index.js +134 -0
- package/dist/components/scroll-area/index.jsx +124 -0
- package/dist/components/segment-group/index.d.ts +82 -0
- package/dist/components/segment-group/index.js +185 -0
- package/dist/components/segment-group/index.jsx +172 -0
- package/dist/components/select/index.d.ts +22 -22
- package/dist/components/select/index.js +13 -13
- package/dist/components/select/index.jsx +13 -13
- package/dist/components/tree-view/index.d.ts +6 -6
- package/dist/components/tree-view/index.js +9 -9
- package/dist/components/tree-view/index.jsx +9 -9
- package/dist/{factory-BIJk1mK6.jsx → factory-CaQWQo9S.jsx} +1 -1
- package/dist/{factory-k8EbNZ7r.js → factory-Cw0jOohn.js} +1 -1
- package/dist/{factory-srnAQg4A.d.ts → factory-JAbO6zq9.d.ts} +1 -1
- package/dist/{field-CZv3v7K-.js → field-CF9yh37t.js} +8 -8
- package/dist/{field-CtkmPUb0.jsx → field-HJX3--SZ.jsx} +8 -8
- package/dist/{fieldset-aYQsMWX2.jsx → fieldset-GRdimTgu.jsx} +8 -8
- package/dist/{fieldset-B2nK8dL5.js → fieldset-QCHS-iMi.js} +8 -8
- package/dist/{index-Dl22eiVf.d.ts → index-BGVwqZq5.d.ts} +20 -20
- package/dist/{index-utxtRaDW.d.ts → index-BIlfNQle.d.ts} +2 -2
- package/dist/index-BRkEGZOE.d.ts +41 -0
- package/dist/{index-w0NPbRP3.d.ts → index-CWs-F296.d.ts} +7 -7
- package/dist/{index-BwthXhaG.d.ts → index-CXTRMyIJ.d.ts} +1 -1
- package/dist/{index-DylIyeqd.d.ts → index-DD3lUYha.d.ts} +7 -7
- package/dist/{index-Dqmtlqpz.d.ts → index-PYTR4Rcx.d.ts} +20 -20
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/index.jsx +5 -5
- package/dist/{presence-Clrs1hmS.js → presence-DghVNXji.js} +7 -7
- package/dist/{presence-H4-8_5_s.jsx → presence-w97672yk.jsx} +7 -7
- package/dist/{providers-C6VPiSrB.jsx → providers--4jSRiKF.jsx} +2 -2
- package/dist/{providers-DgUckEdb.js → providers-DU0gn4Pj.js} +2 -2
- package/dist/{render-strategy-KJFIjVVG.jsx → render-strategy-Bv1Mb0YK.jsx} +2 -2
- package/dist/{render-strategy-BlHCR8sl.js → render-strategy-CDrX5Nbw.js} +2 -2
- package/dist/{tree-view-CyvT0V14.js → tree-view-DdWaaT-E.js} +9 -9
- package/dist/{tree-view-DJgvku6y.jsx → tree-view-Z565ZOf5.jsx} +9 -9
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.jsx +2 -2
- package/package.json +37 -7
- /package/dist/{chunk-BJ7z6UrO.jsx → chunk-D5dGY5zD.jsx} +0 -0
- /package/dist/{chunk-Bn8mXcTA.js → chunk-Dcpub2IO.js} +0 -0
- /package/dist/{compose-refs-Cp4AShsY.jsx → compose-refs-D9EoLzZW.js} +0 -0
- /package/dist/{compose-refs-tCBI7PRJ.js → compose-refs-DhhUBbcq.jsx} +0 -0
- /package/dist/{core-CRjuRw95.js → core-7JOW6ue9.jsx} +0 -0
- /package/dist/{core-C_FYj4uc.jsx → core-D7Nb-duK.js} +0 -0
- /package/dist/{create-context-BwqlrMqL.jsx → create-context-BxYEOGb8.js} +0 -0
- /package/dist/{create-context-DlXBVMoq.js → create-context-CnA1wNMK.jsx} +0 -0
- /package/dist/{create-split-props-BHmgTHSf.js → create-split-props-CdETNVwB.jsx} +0 -0
- /package/dist/{create-split-props-CKwjjjkD.jsx → create-split-props-u4BuKc2i.js} +0 -0
- /package/dist/{index-DiANe65S.d.ts → index-BF_h-dhb.d.ts} +0 -0
- /package/dist/{index-BLALA3BS.d.ts → index-tbMcVIMv.d.ts} +0 -0
- /package/dist/{render-strategy-BmTDUy3U.d.ts → render-strategy-BYpcY4CF.d.ts} +0 -0
- /package/dist/{run-if-fn-C80kt4dU.js → run-if-fn-B-2chXMn.js} +0 -0
- /package/dist/{run-if-fn-CrJzzDIM.jsx → run-if-fn-D59uI-12.jsx} +0 -0
- /package/dist/{types-mGUbKy2h.d.ts → types-DPhuMU2R.d.ts} +0 -0
- /package/dist/{utils-DSmVDqW7.js → utils-CM1Hmr0J.js} +0 -0
- /package/dist/{utils-DhhcJyG-.jsx → utils-DWEfyavN.jsx} +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { n as PropTypes } from "../../index-tbMcVIMv.js";
|
|
2
|
+
import { i as Optional, n as MaybeAccessor } from "../../types-DPhuMU2R.js";
|
|
3
|
+
import { r as PolymorphicProps, t as HTMLProps } from "../../factory-JAbO6zq9.js";
|
|
4
|
+
import * as solid_js376 from "solid-js";
|
|
5
|
+
import { Accessor, JSX } from "solid-js";
|
|
6
|
+
import * as radio from "@sprawlify/primitives/machines/radio-group";
|
|
7
|
+
import { ItemProps, ItemState, ValueChangeDetails, ValueChangeDetails as RadioGroupValueChangeDetails, anatomy as radioGroupAnatomy } from "@sprawlify/primitives/machines/radio-group";
|
|
8
|
+
|
|
9
|
+
//#region src/components/radio-group/use-radio-group.d.ts
|
|
10
|
+
interface UseRadioGroupProps extends Optional<Omit<radio.Props, 'dir' | 'getRootNode'>, 'id'> {}
|
|
11
|
+
interface UseRadioGroupReturn extends Accessor<radio.Api<PropTypes>> {}
|
|
12
|
+
declare const useRadioGroup: (props?: MaybeAccessor<UseRadioGroupProps>) => UseRadioGroupReturn;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/components/radio-group/use-radio-group-context.d.ts
|
|
15
|
+
interface UseRadioGroupContext extends UseRadioGroupReturn {}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/radio-group/radio-group-context.d.ts
|
|
18
|
+
interface RadioGroupContextProps {
|
|
19
|
+
children: (context: UseRadioGroupContext) => JSX.Element;
|
|
20
|
+
}
|
|
21
|
+
declare const RadioGroupContext: (props: RadioGroupContextProps) => JSX.Element;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/radio-group/radio-group-indicator.d.ts
|
|
24
|
+
interface RadioGroupIndicatorBaseProps extends PolymorphicProps<'div'> {}
|
|
25
|
+
interface RadioGroupIndicatorProps extends HTMLProps<'div'>, RadioGroupIndicatorBaseProps {}
|
|
26
|
+
declare const RadioGroupIndicator: (props: RadioGroupIndicatorProps) => solid_js376.JSX.Element;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/radio-group/radio-group-item.d.ts
|
|
29
|
+
interface RadioGroupItemBaseProps extends ItemProps, PolymorphicProps<'label'> {}
|
|
30
|
+
interface RadioGroupItemProps extends HTMLProps<'label'>, RadioGroupItemBaseProps {}
|
|
31
|
+
declare const RadioGroupItem: (props: RadioGroupItemProps) => solid_js376.JSX.Element;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/radio-group/use-radio-group-item-context.d.ts
|
|
34
|
+
interface UseRadioGroupItemContext extends Accessor<ItemState> {}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/components/radio-group/radio-group-item-context.d.ts
|
|
37
|
+
interface RadioGroupItemContextProps {
|
|
38
|
+
children: (context: UseRadioGroupItemContext) => JSX.Element;
|
|
39
|
+
}
|
|
40
|
+
declare const RadioGroupItemContext: (props: RadioGroupItemContextProps) => JSX.Element;
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/components/radio-group/radio-group-item-control.d.ts
|
|
43
|
+
interface RadioGroupItemControlBaseProps extends PolymorphicProps<'div'> {}
|
|
44
|
+
interface RadioGroupItemControlProps extends HTMLProps<'div'>, RadioGroupItemControlBaseProps {}
|
|
45
|
+
declare const RadioGroupItemControl: (props: RadioGroupItemControlProps) => solid_js376.JSX.Element;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/radio-group/radio-group-item-hidden-input.d.ts
|
|
48
|
+
interface RadioGroupItemHiddenInputBaseProps extends PolymorphicProps<'input'> {}
|
|
49
|
+
interface RadioGroupItemHiddenInputProps extends HTMLProps<'input'>, RadioGroupItemHiddenInputBaseProps {}
|
|
50
|
+
declare const RadioGroupItemHiddenInput: (props: RadioGroupItemHiddenInputProps) => solid_js376.JSX.Element;
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/components/radio-group/radio-group-item-text.d.ts
|
|
53
|
+
interface RadioGroupItemTextBaseProps extends PolymorphicProps<'span'> {}
|
|
54
|
+
interface RadioGroupItemTextProps extends HTMLProps<'span'>, RadioGroupItemTextBaseProps {}
|
|
55
|
+
declare const RadioGroupItemText: (props: RadioGroupItemTextProps) => solid_js376.JSX.Element;
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/components/radio-group/radio-group-label.d.ts
|
|
58
|
+
interface RadioGroupLabelBaseProps extends PolymorphicProps<'label'> {}
|
|
59
|
+
interface RadioGroupLabelProps extends HTMLProps<'label'>, RadioGroupLabelBaseProps {}
|
|
60
|
+
declare const RadioGroupLabel: (props: RadioGroupLabelProps) => solid_js376.JSX.Element;
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/components/radio-group/radio-group-root.d.ts
|
|
63
|
+
interface RadioGroupRootBaseProps extends UseRadioGroupProps, PolymorphicProps<'div'> {}
|
|
64
|
+
interface RadioGroupRootProps extends HTMLProps<'div'>, RadioGroupRootBaseProps {}
|
|
65
|
+
declare const RadioGroupRoot: (props: RadioGroupRootProps) => solid_js376.JSX.Element;
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/components/radio-group/radio-group-root-provider.d.ts
|
|
68
|
+
interface RootProviderProps {
|
|
69
|
+
value: UseRadioGroupReturn;
|
|
70
|
+
}
|
|
71
|
+
interface RadioGroupRootProviderBaseProps extends PolymorphicProps<'div'> {}
|
|
72
|
+
interface RadioGroupRootProviderProps extends HTMLProps<'div'>, RootProviderProps, RadioGroupRootProviderBaseProps {}
|
|
73
|
+
declare const RadioGroupRootProvider: (props: RadioGroupRootProviderProps) => solid_js376.JSX.Element;
|
|
74
|
+
declare namespace radio_group_d_exports {
|
|
75
|
+
export { RadioGroupContext as Context, RadioGroupContext as ContextProps, RadioGroupIndicator as Indicator, RadioGroupIndicatorBaseProps as IndicatorBaseProps, RadioGroupIndicatorProps as IndicatorProps, RadioGroupItem as Item, RadioGroupItemBaseProps as ItemBaseProps, RadioGroupItemContext as ItemContext, RadioGroupItemContext as ItemContextProps, RadioGroupItemControl as ItemControl, RadioGroupItemControlBaseProps as ItemControlBaseProps, RadioGroupItemControlProps as ItemControlProps, RadioGroupItemHiddenInput as ItemHiddenInput, RadioGroupItemHiddenInputBaseProps as ItemHiddenInputBaseProps, RadioGroupItemHiddenInputProps as ItemHiddenInputProps, RadioGroupItemProps as ItemProps, RadioGroupItemText as ItemText, RadioGroupItemTextBaseProps as ItemTextBaseProps, RadioGroupItemTextProps as ItemTextProps, RadioGroupLabel as Label, RadioGroupLabelBaseProps as LabelBaseProps, RadioGroupLabelProps as LabelProps, RadioGroupRoot as Root, RadioGroupRootBaseProps as RootBaseProps, RadioGroupRootProps as RootProps, RadioGroupRootProvider as RootProvider, RadioGroupRootProviderBaseProps as RootProviderBaseProps, RadioGroupRootProviderProps as RootProviderProps, ValueChangeDetails };
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { radio_group_d_exports as RadioGroup, RadioGroupContext, type RadioGroupContextProps, RadioGroupIndicator, type RadioGroupIndicatorBaseProps, type RadioGroupIndicatorProps, RadioGroupItem, type RadioGroupItemBaseProps, RadioGroupItemContext, type RadioGroupItemContextProps, RadioGroupItemControl, type RadioGroupItemControlBaseProps, type RadioGroupItemControlProps, RadioGroupItemHiddenInput, type RadioGroupItemHiddenInputBaseProps, type RadioGroupItemHiddenInputProps, type RadioGroupItemProps, RadioGroupItemText, type RadioGroupItemTextBaseProps, type RadioGroupItemTextProps, RadioGroupLabel, type RadioGroupLabelBaseProps, type RadioGroupLabelProps, RadioGroupRoot, type RadioGroupRootBaseProps, type RadioGroupRootProps, RadioGroupRootProvider, type RadioGroupRootProviderBaseProps, type RadioGroupRootProviderProps, type RadioGroupValueChangeDetails, type UseRadioGroupContext, type UseRadioGroupItemContext, type UseRadioGroupProps, type UseRadioGroupReturn, radioGroupAnatomy, useRadioGroup, useRadioGroupContext, useRadioGroupItemContext };
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { t as __export } from "../../chunk-Dcpub2IO.js";
|
|
2
|
+
import { i as useMachine, n as normalizeProps, r as mergeProps$2 } from "../../core-D7Nb-duK.js";
|
|
3
|
+
import { t as runIfFn } from "../../run-if-fn-B-2chXMn.js";
|
|
4
|
+
import { t as createContext$1 } from "../../create-context-BxYEOGb8.js";
|
|
5
|
+
import { i as useLocaleContext, o as useEnvironmentContext } from "../../providers-DU0gn4Pj.js";
|
|
6
|
+
import { t as sprawlify } from "../../factory-Cw0jOohn.js";
|
|
7
|
+
import { t as createSplitProps } from "../../create-split-props-u4BuKc2i.js";
|
|
8
|
+
import "../../compose-refs-D9EoLzZW.js";
|
|
9
|
+
import { u as useFieldsetContext } from "../../fieldset-QCHS-iMi.js";
|
|
10
|
+
import { createMemo, createUniqueId } from "solid-js";
|
|
11
|
+
import { createComponent } from "solid-js/web";
|
|
12
|
+
import * as radio from "@sprawlify/primitives/machines/radio-group";
|
|
13
|
+
import { anatomy as radioGroupAnatomy } from "@sprawlify/primitives/machines/radio-group";
|
|
14
|
+
|
|
15
|
+
//#region src/components/radio-group/use-radio-group-context.ts
|
|
16
|
+
const [RadioGroupProvider, useRadioGroupContext] = createContext$1({
|
|
17
|
+
hookName: "useRadioGroupContext",
|
|
18
|
+
providerName: "<RadioGroupProvider />"
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/components/radio-group/radio-group-context.tsx
|
|
23
|
+
const RadioGroupContext = (props) => props.children(useRadioGroupContext());
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/radio-group/radio-group-indicator.tsx
|
|
27
|
+
const RadioGroupIndicator = (props) => {
|
|
28
|
+
const radioGroup = useRadioGroupContext();
|
|
29
|
+
const mergedProps = mergeProps$2(() => radioGroup().getIndicatorProps(), props);
|
|
30
|
+
return createComponent(sprawlify.div, mergedProps);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/components/radio-group/use-radio-group-item-context.ts
|
|
35
|
+
const [RadioGroupItemProvider, useRadioGroupItemContext] = createContext$1({
|
|
36
|
+
hookName: "useRadioGroupItemContext",
|
|
37
|
+
providerName: "<RadioGroupItemProvider />"
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/components/radio-group/use-radio-group-item-props-context.ts
|
|
42
|
+
const [RadioGroupItemPropsProvider, useRadioGroupItemPropsContext] = createContext$1({
|
|
43
|
+
hookName: "useRadioGroupItemPropsContext",
|
|
44
|
+
providerName: "<RadioGroupItemPropsProvider />"
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/components/radio-group/radio-group-item.tsx
|
|
49
|
+
const RadioGroupItem = (props) => {
|
|
50
|
+
const [itemProps, localProps] = createSplitProps()(props, [
|
|
51
|
+
"value",
|
|
52
|
+
"disabled",
|
|
53
|
+
"invalid"
|
|
54
|
+
]);
|
|
55
|
+
const radioGroup = useRadioGroupContext();
|
|
56
|
+
const mergedProps = mergeProps$2(() => radioGroup().getItemProps(itemProps), localProps);
|
|
57
|
+
const itemState = createMemo(() => radioGroup().getItemState(itemProps));
|
|
58
|
+
return createComponent(RadioGroupItemPropsProvider, {
|
|
59
|
+
value: itemProps,
|
|
60
|
+
get children() {
|
|
61
|
+
return createComponent(RadioGroupItemProvider, {
|
|
62
|
+
value: itemState,
|
|
63
|
+
get children() {
|
|
64
|
+
return createComponent(sprawlify.label, mergedProps);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/components/radio-group/radio-group-item-context.tsx
|
|
73
|
+
const RadioGroupItemContext = (props) => props.children(useRadioGroupItemContext());
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/components/radio-group/radio-group-item-control.tsx
|
|
77
|
+
const RadioGroupItemControl = (props) => {
|
|
78
|
+
const radioGroup = useRadioGroupContext();
|
|
79
|
+
const itemProps = useRadioGroupItemPropsContext();
|
|
80
|
+
const mergedProps = mergeProps$2(() => radioGroup().getItemControlProps(itemProps), props);
|
|
81
|
+
return createComponent(sprawlify.div, mergedProps);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/components/radio-group/radio-group-item-hidden-input.tsx
|
|
86
|
+
const RadioGroupItemHiddenInput = (props) => {
|
|
87
|
+
const radioGroup = useRadioGroupContext();
|
|
88
|
+
const itemProps = useRadioGroupItemPropsContext();
|
|
89
|
+
const mergedProps = mergeProps$2(() => radioGroup().getItemHiddenInputProps(itemProps), props);
|
|
90
|
+
return createComponent(sprawlify.input, mergedProps);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/components/radio-group/radio-group-item-text.tsx
|
|
95
|
+
const RadioGroupItemText = (props) => {
|
|
96
|
+
const radioGroup = useRadioGroupContext();
|
|
97
|
+
const itemProps = useRadioGroupItemPropsContext();
|
|
98
|
+
const mergedProps = mergeProps$2(() => radioGroup().getItemTextProps(itemProps), props);
|
|
99
|
+
return createComponent(sprawlify.span, mergedProps);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/components/radio-group/radio-group-label.tsx
|
|
104
|
+
const RadioGroupLabel = (props) => {
|
|
105
|
+
const radioGroup = useRadioGroupContext();
|
|
106
|
+
const mergedProps = mergeProps$2(() => radioGroup().getLabelProps(), props);
|
|
107
|
+
return createComponent(sprawlify.label, mergedProps);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/components/radio-group/use-radio-group.ts
|
|
112
|
+
const useRadioGroup = (props) => {
|
|
113
|
+
const id = createUniqueId();
|
|
114
|
+
const locale = useLocaleContext();
|
|
115
|
+
const environment = useEnvironmentContext();
|
|
116
|
+
const fieldset = useFieldsetContext();
|
|
117
|
+
const machineProps = createMemo(() => {
|
|
118
|
+
const fieldsetContext = fieldset?.();
|
|
119
|
+
return {
|
|
120
|
+
id,
|
|
121
|
+
ids: { label: fieldsetContext?.ids?.legend },
|
|
122
|
+
dir: locale().dir,
|
|
123
|
+
disabled: fieldsetContext?.disabled,
|
|
124
|
+
invalid: fieldsetContext?.invalid,
|
|
125
|
+
getRootNode: environment().getRootNode,
|
|
126
|
+
...runIfFn(props)
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
const service = useMachine(radio.machine, machineProps);
|
|
130
|
+
return createMemo(() => radio.connect(service, normalizeProps));
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/components/radio-group/radio-group-root.tsx
|
|
135
|
+
const RadioGroupRoot = (props) => {
|
|
136
|
+
const [useRadioGroupProps, localProps] = createSplitProps()(props, [
|
|
137
|
+
"defaultValue",
|
|
138
|
+
"disabled",
|
|
139
|
+
"form",
|
|
140
|
+
"id",
|
|
141
|
+
"ids",
|
|
142
|
+
"invalid",
|
|
143
|
+
"name",
|
|
144
|
+
"onValueChange",
|
|
145
|
+
"orientation",
|
|
146
|
+
"readOnly",
|
|
147
|
+
"required",
|
|
148
|
+
"value"
|
|
149
|
+
]);
|
|
150
|
+
const radioGroup = useRadioGroup(useRadioGroupProps);
|
|
151
|
+
const mergedProps = mergeProps$2(() => radioGroup().getRootProps(), localProps);
|
|
152
|
+
return createComponent(RadioGroupProvider, {
|
|
153
|
+
value: radioGroup,
|
|
154
|
+
get children() {
|
|
155
|
+
return createComponent(sprawlify.div, mergedProps);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region src/components/radio-group/radio-group-root-provider.tsx
|
|
162
|
+
const RadioGroupRootProvider = (props) => {
|
|
163
|
+
const [{ value: radioGroup }, localProps] = createSplitProps()(props, ["value"]);
|
|
164
|
+
const mergedProps = mergeProps$2(() => radioGroup().getRootProps(), localProps);
|
|
165
|
+
return createComponent(RadioGroupProvider, {
|
|
166
|
+
value: radioGroup,
|
|
167
|
+
get children() {
|
|
168
|
+
return createComponent(sprawlify.div, mergedProps);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/components/radio-group/radio-group.ts
|
|
175
|
+
var radio_group_exports = /* @__PURE__ */ __export({
|
|
176
|
+
Context: () => RadioGroupContext,
|
|
177
|
+
Indicator: () => RadioGroupIndicator,
|
|
178
|
+
Item: () => RadioGroupItem,
|
|
179
|
+
ItemContext: () => RadioGroupItemContext,
|
|
180
|
+
ItemControl: () => RadioGroupItemControl,
|
|
181
|
+
ItemHiddenInput: () => RadioGroupItemHiddenInput,
|
|
182
|
+
ItemText: () => RadioGroupItemText,
|
|
183
|
+
Label: () => RadioGroupLabel,
|
|
184
|
+
Root: () => RadioGroupRoot,
|
|
185
|
+
RootProvider: () => RadioGroupRootProvider
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
//#endregion
|
|
189
|
+
export { radio_group_exports as RadioGroup, RadioGroupContext, RadioGroupIndicator, RadioGroupItem, RadioGroupItemContext, RadioGroupItemControl, RadioGroupItemHiddenInput, RadioGroupItemText, RadioGroupLabel, RadioGroupRoot, RadioGroupRootProvider, radioGroupAnatomy, useRadioGroup, useRadioGroupContext, useRadioGroupItemContext };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { t as __export } from "../../chunk-D5dGY5zD.jsx";
|
|
2
|
+
import { i as useMachine, n as normalizeProps, r as mergeProps$1 } from "../../core-7JOW6ue9.jsx";
|
|
3
|
+
import { t as runIfFn } from "../../run-if-fn-D59uI-12.jsx";
|
|
4
|
+
import { t as createContext$1 } from "../../create-context-CnA1wNMK.jsx";
|
|
5
|
+
import { i as useLocaleContext, o as useEnvironmentContext } from "../../providers--4jSRiKF.jsx";
|
|
6
|
+
import { t as sprawlify } from "../../factory-CaQWQo9S.jsx";
|
|
7
|
+
import { t as createSplitProps } from "../../create-split-props-CdETNVwB.jsx";
|
|
8
|
+
import "../../compose-refs-DhhUBbcq.jsx";
|
|
9
|
+
import { u as useFieldsetContext } from "../../fieldset-GRdimTgu.jsx";
|
|
10
|
+
import { createMemo, createUniqueId } from "solid-js";
|
|
11
|
+
import * as radio from "@sprawlify/primitives/machines/radio-group";
|
|
12
|
+
import { anatomy as radioGroupAnatomy } from "@sprawlify/primitives/machines/radio-group";
|
|
13
|
+
|
|
14
|
+
//#region src/components/radio-group/use-radio-group-context.ts
|
|
15
|
+
const [RadioGroupProvider, useRadioGroupContext] = createContext$1({
|
|
16
|
+
hookName: "useRadioGroupContext",
|
|
17
|
+
providerName: "<RadioGroupProvider />"
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/components/radio-group/radio-group-context.tsx
|
|
22
|
+
const RadioGroupContext = (props) => props.children(useRadioGroupContext());
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/components/radio-group/radio-group-indicator.tsx
|
|
26
|
+
const RadioGroupIndicator = (props) => {
|
|
27
|
+
const radioGroup = useRadioGroupContext();
|
|
28
|
+
const mergedProps = mergeProps$1(() => radioGroup().getIndicatorProps(), props);
|
|
29
|
+
return <sprawlify.div {...mergedProps} />;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/radio-group/use-radio-group-item-context.ts
|
|
34
|
+
const [RadioGroupItemProvider, useRadioGroupItemContext] = createContext$1({
|
|
35
|
+
hookName: "useRadioGroupItemContext",
|
|
36
|
+
providerName: "<RadioGroupItemProvider />"
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/components/radio-group/use-radio-group-item-props-context.ts
|
|
41
|
+
const [RadioGroupItemPropsProvider, useRadioGroupItemPropsContext] = createContext$1({
|
|
42
|
+
hookName: "useRadioGroupItemPropsContext",
|
|
43
|
+
providerName: "<RadioGroupItemPropsProvider />"
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/radio-group/radio-group-item.tsx
|
|
48
|
+
const RadioGroupItem = (props) => {
|
|
49
|
+
const [itemProps, localProps] = createSplitProps()(props, [
|
|
50
|
+
"value",
|
|
51
|
+
"disabled",
|
|
52
|
+
"invalid"
|
|
53
|
+
]);
|
|
54
|
+
const radioGroup = useRadioGroupContext();
|
|
55
|
+
const mergedProps = mergeProps$1(() => radioGroup().getItemProps(itemProps), localProps);
|
|
56
|
+
const itemState = createMemo(() => radioGroup().getItemState(itemProps));
|
|
57
|
+
return <RadioGroupItemPropsProvider value={itemProps}>
|
|
58
|
+
<RadioGroupItemProvider value={itemState}>
|
|
59
|
+
<sprawlify.label {...mergedProps} />
|
|
60
|
+
</RadioGroupItemProvider>
|
|
61
|
+
</RadioGroupItemPropsProvider>;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/components/radio-group/radio-group-item-context.tsx
|
|
66
|
+
const RadioGroupItemContext = (props) => props.children(useRadioGroupItemContext());
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/components/radio-group/radio-group-item-control.tsx
|
|
70
|
+
const RadioGroupItemControl = (props) => {
|
|
71
|
+
const radioGroup = useRadioGroupContext();
|
|
72
|
+
const itemProps = useRadioGroupItemPropsContext();
|
|
73
|
+
const mergedProps = mergeProps$1(() => radioGroup().getItemControlProps(itemProps), props);
|
|
74
|
+
return <sprawlify.div {...mergedProps} />;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/components/radio-group/radio-group-item-hidden-input.tsx
|
|
79
|
+
const RadioGroupItemHiddenInput = (props) => {
|
|
80
|
+
const radioGroup = useRadioGroupContext();
|
|
81
|
+
const itemProps = useRadioGroupItemPropsContext();
|
|
82
|
+
const mergedProps = mergeProps$1(() => radioGroup().getItemHiddenInputProps(itemProps), props);
|
|
83
|
+
return <sprawlify.input {...mergedProps} />;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/components/radio-group/radio-group-item-text.tsx
|
|
88
|
+
const RadioGroupItemText = (props) => {
|
|
89
|
+
const radioGroup = useRadioGroupContext();
|
|
90
|
+
const itemProps = useRadioGroupItemPropsContext();
|
|
91
|
+
const mergedProps = mergeProps$1(() => radioGroup().getItemTextProps(itemProps), props);
|
|
92
|
+
return <sprawlify.span {...mergedProps} />;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/components/radio-group/radio-group-label.tsx
|
|
97
|
+
const RadioGroupLabel = (props) => {
|
|
98
|
+
const radioGroup = useRadioGroupContext();
|
|
99
|
+
const mergedProps = mergeProps$1(() => radioGroup().getLabelProps(), props);
|
|
100
|
+
return <sprawlify.label {...mergedProps} />;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/components/radio-group/use-radio-group.ts
|
|
105
|
+
const useRadioGroup = (props) => {
|
|
106
|
+
const id = createUniqueId();
|
|
107
|
+
const locale = useLocaleContext();
|
|
108
|
+
const environment = useEnvironmentContext();
|
|
109
|
+
const fieldset = useFieldsetContext();
|
|
110
|
+
const machineProps = createMemo(() => {
|
|
111
|
+
const fieldsetContext = fieldset?.();
|
|
112
|
+
return {
|
|
113
|
+
id,
|
|
114
|
+
ids: { label: fieldsetContext?.ids?.legend },
|
|
115
|
+
dir: locale().dir,
|
|
116
|
+
disabled: fieldsetContext?.disabled,
|
|
117
|
+
invalid: fieldsetContext?.invalid,
|
|
118
|
+
getRootNode: environment().getRootNode,
|
|
119
|
+
...runIfFn(props)
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
const service = useMachine(radio.machine, machineProps);
|
|
123
|
+
return createMemo(() => radio.connect(service, normalizeProps));
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/components/radio-group/radio-group-root.tsx
|
|
128
|
+
const RadioGroupRoot = (props) => {
|
|
129
|
+
const [useRadioGroupProps, localProps] = createSplitProps()(props, [
|
|
130
|
+
"defaultValue",
|
|
131
|
+
"disabled",
|
|
132
|
+
"form",
|
|
133
|
+
"id",
|
|
134
|
+
"ids",
|
|
135
|
+
"invalid",
|
|
136
|
+
"name",
|
|
137
|
+
"onValueChange",
|
|
138
|
+
"orientation",
|
|
139
|
+
"readOnly",
|
|
140
|
+
"required",
|
|
141
|
+
"value"
|
|
142
|
+
]);
|
|
143
|
+
const radioGroup = useRadioGroup(useRadioGroupProps);
|
|
144
|
+
const mergedProps = mergeProps$1(() => radioGroup().getRootProps(), localProps);
|
|
145
|
+
return <RadioGroupProvider value={radioGroup}>
|
|
146
|
+
<sprawlify.div {...mergedProps} />
|
|
147
|
+
</RadioGroupProvider>;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/components/radio-group/radio-group-root-provider.tsx
|
|
152
|
+
const RadioGroupRootProvider = (props) => {
|
|
153
|
+
const [{ value: radioGroup }, localProps] = createSplitProps()(props, ["value"]);
|
|
154
|
+
const mergedProps = mergeProps$1(() => radioGroup().getRootProps(), localProps);
|
|
155
|
+
return <RadioGroupProvider value={radioGroup}>
|
|
156
|
+
<sprawlify.div {...mergedProps} />
|
|
157
|
+
</RadioGroupProvider>;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region src/components/radio-group/radio-group.ts
|
|
162
|
+
var radio_group_exports = /* @__PURE__ */ __export({
|
|
163
|
+
Context: () => RadioGroupContext,
|
|
164
|
+
Indicator: () => RadioGroupIndicator,
|
|
165
|
+
Item: () => RadioGroupItem,
|
|
166
|
+
ItemContext: () => RadioGroupItemContext,
|
|
167
|
+
ItemControl: () => RadioGroupItemControl,
|
|
168
|
+
ItemHiddenInput: () => RadioGroupItemHiddenInput,
|
|
169
|
+
ItemText: () => RadioGroupItemText,
|
|
170
|
+
Label: () => RadioGroupLabel,
|
|
171
|
+
Root: () => RadioGroupRoot,
|
|
172
|
+
RootProvider: () => RadioGroupRootProvider
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
//#endregion
|
|
176
|
+
export { radio_group_exports as RadioGroup, RadioGroupContext, RadioGroupIndicator, RadioGroupItem, RadioGroupItemContext, RadioGroupItemControl, RadioGroupItemHiddenInput, RadioGroupItemText, RadioGroupLabel, RadioGroupRoot, RadioGroupRootProvider, radioGroupAnatomy, useRadioGroup, useRadioGroupContext, useRadioGroupItemContext };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { n as PropTypes } from "../../index-tbMcVIMv.js";
|
|
2
|
+
import { i as Optional, n as MaybeAccessor } from "../../types-DPhuMU2R.js";
|
|
3
|
+
import { r as PolymorphicProps, t as HTMLProps } from "../../factory-JAbO6zq9.js";
|
|
4
|
+
import * as solid_js0 from "solid-js";
|
|
5
|
+
import { Accessor, JSX } from "solid-js";
|
|
6
|
+
import * as ratingGroup from "@sprawlify/primitives/machines/rating-group";
|
|
7
|
+
import { HoverChangeDetails, HoverChangeDetails as RatingGroupHoverChangeDetails, ItemProps, ItemState, ValueChangeDetails, ValueChangeDetails as RatingGroupValueChangeDetails, anatomy as ratingGroupAnatomy } from "@sprawlify/primitives/machines/rating-group";
|
|
8
|
+
|
|
9
|
+
//#region src/components/rating-group/use-rating-group.d.ts
|
|
10
|
+
interface UseRatingGroupProps extends Optional<Omit<ratingGroup.Props, 'dir' | 'getRootNode'>, 'id'> {}
|
|
11
|
+
interface UseRatingGroupReturn extends Accessor<ratingGroup.Api<PropTypes>> {}
|
|
12
|
+
declare const useRatingGroup: (props?: MaybeAccessor<UseRatingGroupProps>) => UseRatingGroupReturn;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/components/rating-group/use-rating-group-context.d.ts
|
|
15
|
+
interface UseRatingGroupContext extends UseRatingGroupReturn {}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/rating-group/rating-group-context.d.ts
|
|
18
|
+
interface RatingGroupContextProps {
|
|
19
|
+
children: (context: UseRatingGroupContext) => JSX.Element;
|
|
20
|
+
}
|
|
21
|
+
declare const RatingGroupContext: (props: RatingGroupContextProps) => JSX.Element;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/rating-group/rating-group-control.d.ts
|
|
24
|
+
interface RatingGroupControlBaseProps extends PolymorphicProps<'div'> {}
|
|
25
|
+
interface RatingGroupControlProps extends HTMLProps<'div'>, RatingGroupControlBaseProps {}
|
|
26
|
+
declare const RatingGroupControl: (props: RatingGroupControlProps) => solid_js0.JSX.Element;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/rating-group/rating-group-hidden-input.d.ts
|
|
29
|
+
interface RatingGroupHiddenInputBaseProps extends PolymorphicProps<'input'> {}
|
|
30
|
+
interface RatingGroupHiddenInputProps extends HTMLProps<'input'>, RatingGroupHiddenInputBaseProps {}
|
|
31
|
+
declare const RatingGroupHiddenInput: (props: RatingGroupHiddenInputProps) => solid_js0.JSX.Element;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/rating-group/rating-group-item.d.ts
|
|
34
|
+
interface RatingGroupItemBaseProps extends ItemProps, PolymorphicProps<'span'> {}
|
|
35
|
+
interface RatingGroupItemProps extends HTMLProps<'span'>, RatingGroupItemBaseProps {}
|
|
36
|
+
declare const RatingGroupItem: (props: RatingGroupItemProps) => solid_js0.JSX.Element;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/rating-group/use-rating-group-item-context.d.ts
|
|
39
|
+
interface UseRatingGroupItemContext extends Accessor<ItemState> {}
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/components/rating-group/rating-group-item-context.d.ts
|
|
42
|
+
interface RatingGroupItemContextProps {
|
|
43
|
+
children: (context: UseRatingGroupItemContext) => JSX.Element;
|
|
44
|
+
}
|
|
45
|
+
declare const RatingGroupItemContext: (props: RatingGroupItemContextProps) => JSX.Element;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/rating-group/rating-group-label.d.ts
|
|
48
|
+
interface RatingGroupLabelBaseProps extends PolymorphicProps<'label'> {}
|
|
49
|
+
interface RatingGroupLabelProps extends HTMLProps<'label'>, RatingGroupLabelBaseProps {}
|
|
50
|
+
declare const RatingGroupLabel: (props: RatingGroupLabelProps) => solid_js0.JSX.Element;
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/components/rating-group/rating-group-root.d.ts
|
|
53
|
+
interface RatingGroupRootBaseProps extends UseRatingGroupProps, PolymorphicProps<'div'> {}
|
|
54
|
+
interface RatingGroupRootProps extends HTMLProps<'div'>, RatingGroupRootBaseProps {}
|
|
55
|
+
declare const RatingGroupRoot: (props: RatingGroupRootProps) => solid_js0.JSX.Element;
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/components/rating-group/rating-group-root-provider.d.ts
|
|
58
|
+
interface RootProviderProps {
|
|
59
|
+
value: UseRatingGroupReturn;
|
|
60
|
+
}
|
|
61
|
+
interface RatingGroupRootProviderBaseProps extends PolymorphicProps<'div'> {}
|
|
62
|
+
interface RatingGroupRootProviderProps extends HTMLProps<'div'>, RootProviderProps, RatingGroupRootProviderBaseProps {}
|
|
63
|
+
declare const RatingGroupRootProvider: (props: RatingGroupRootProviderProps) => solid_js0.JSX.Element;
|
|
64
|
+
declare namespace rating_group_d_exports {
|
|
65
|
+
export { RatingGroupContext as Context, RatingGroupContextProps as ContextProps, RatingGroupControl as Control, RatingGroupControlBaseProps as ControlBaseProps, RatingGroupControlProps as ControlProps, RatingGroupHiddenInput as HiddenInput, RatingGroupHiddenInputBaseProps as HiddenInputBaseProps, RatingGroupHiddenInputProps as HiddenInputProps, HoverChangeDetails, RatingGroupItem as Item, RatingGroupItemBaseProps as ItemBaseProps, RatingGroupItemContext as ItemContext, RatingGroupItemContextProps as ItemContextProps, RatingGroupItemProps as ItemProps, RatingGroupLabel as Label, RatingGroupLabelBaseProps as LabelBaseProps, RatingGroupLabelProps as LabelProps, RatingGroupRoot as Root, RatingGroupRootBaseProps as RootBaseProps, RatingGroupRootProps as RootProps, RatingGroupRootProvider as RootProvider, RatingGroupRootProviderBaseProps as RootProviderBaseProps, RatingGroupRootProviderProps as RootProviderProps, ValueChangeDetails };
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { rating_group_d_exports as RatingGroup, RatingGroupContext, type RatingGroupContextProps, RatingGroupControl, type RatingGroupControlBaseProps, type RatingGroupControlProps, RatingGroupHiddenInput, type RatingGroupHiddenInputBaseProps, type RatingGroupHiddenInputProps, type RatingGroupHoverChangeDetails, RatingGroupItem, type RatingGroupItemBaseProps, RatingGroupItemContext, type RatingGroupItemContextProps, type RatingGroupItemProps, RatingGroupLabel, type RatingGroupLabelBaseProps, type RatingGroupLabelProps, RatingGroupRoot, type RatingGroupRootBaseProps, type RatingGroupRootProps, RatingGroupRootProvider, type RatingGroupRootProviderBaseProps, type RatingGroupRootProviderProps, type RatingGroupValueChangeDetails, type UseRatingGroupContext, type UseRatingGroupItemContext, type UseRatingGroupProps, type UseRatingGroupReturn, ratingGroupAnatomy, useRatingGroup, useRatingGroupContext, useRatingGroupItemContext };
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { t as __export } from "../../chunk-Dcpub2IO.js";
|
|
2
|
+
import { i as useMachine, n as normalizeProps, r as mergeProps$2 } from "../../core-D7Nb-duK.js";
|
|
3
|
+
import { t as runIfFn } from "../../run-if-fn-B-2chXMn.js";
|
|
4
|
+
import { t as createContext$1 } from "../../create-context-BxYEOGb8.js";
|
|
5
|
+
import { i as useLocaleContext, o as useEnvironmentContext } from "../../providers-DU0gn4Pj.js";
|
|
6
|
+
import { t as sprawlify } from "../../factory-Cw0jOohn.js";
|
|
7
|
+
import { t as createSplitProps } from "../../create-split-props-u4BuKc2i.js";
|
|
8
|
+
import "../../compose-refs-D9EoLzZW.js";
|
|
9
|
+
import "../../fieldset-QCHS-iMi.js";
|
|
10
|
+
import { m as useFieldContext } from "../../field-CF9yh37t.js";
|
|
11
|
+
import { createMemo, createUniqueId } from "solid-js";
|
|
12
|
+
import { createComponent, mergeProps as mergeProps$1 } from "solid-js/web";
|
|
13
|
+
import * as ratingGroup from "@sprawlify/primitives/machines/rating-group";
|
|
14
|
+
import { anatomy as ratingGroupAnatomy } from "@sprawlify/primitives/machines/rating-group";
|
|
15
|
+
|
|
16
|
+
//#region src/components/rating-group/use-rating-group-context.ts
|
|
17
|
+
const [RatingGroupProvider, useRatingGroupContext] = createContext$1({
|
|
18
|
+
hookName: "useRatingGroupContext",
|
|
19
|
+
providerName: "<RatingGroupProvider />"
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/rating-group/rating-group-context.tsx
|
|
24
|
+
const RatingGroupContext = (props) => props.children(useRatingGroupContext());
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/components/rating-group/rating-group-control.tsx
|
|
28
|
+
const RatingGroupControl = (props) => {
|
|
29
|
+
const ratingGroup$1 = useRatingGroupContext();
|
|
30
|
+
const mergedProps = mergeProps$2(() => ratingGroup$1().getControlProps(), props);
|
|
31
|
+
return createComponent(sprawlify.div, mergedProps);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/components/rating-group/rating-group-hidden-input.tsx
|
|
36
|
+
const RatingGroupHiddenInput = (props) => {
|
|
37
|
+
const ratingGroup$1 = useRatingGroupContext();
|
|
38
|
+
const mergedProps = mergeProps$2(() => ratingGroup$1().getHiddenInputProps(), props);
|
|
39
|
+
const field = useFieldContext();
|
|
40
|
+
return createComponent(sprawlify.input, mergeProps$1({ get ["aria-describedby"]() {
|
|
41
|
+
return field?.().ariaDescribedby;
|
|
42
|
+
} }, mergedProps));
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/components/rating-group/use-rating-group-item-context.ts
|
|
47
|
+
const [RatingGroupItemProvider, useRatingGroupItemContext] = createContext$1({
|
|
48
|
+
hookName: "useRatingGroupItemContext",
|
|
49
|
+
providerName: "<RatingGroupItemProvider />"
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/rating-group/rating-group-item.tsx
|
|
54
|
+
const RatingGroupItem = (props) => {
|
|
55
|
+
const [itemProps, localProps] = createSplitProps()(props, ["index"]);
|
|
56
|
+
const api = useRatingGroupContext();
|
|
57
|
+
const mergedProps = mergeProps$2(() => api().getItemProps(itemProps), localProps);
|
|
58
|
+
return createComponent(RatingGroupItemProvider, {
|
|
59
|
+
value: createMemo(() => api().getItemState(itemProps)),
|
|
60
|
+
get children() {
|
|
61
|
+
return createComponent(sprawlify.span, mergedProps);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/components/rating-group/rating-group-item-context.tsx
|
|
68
|
+
const RatingGroupItemContext = (props) => props.children(useRatingGroupItemContext());
|
|
69
|
+
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/components/rating-group/rating-group-label.tsx
|
|
72
|
+
const RatingGroupLabel = (props) => {
|
|
73
|
+
const api = useRatingGroupContext();
|
|
74
|
+
const mergedProps = mergeProps$2(() => api().getLabelProps(), props);
|
|
75
|
+
return createComponent(sprawlify.label, mergedProps);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/components/rating-group/use-rating-group.ts
|
|
80
|
+
const useRatingGroup = (props) => {
|
|
81
|
+
const id = createUniqueId();
|
|
82
|
+
const locale = useLocaleContext();
|
|
83
|
+
const environment = useEnvironmentContext();
|
|
84
|
+
const field = useFieldContext();
|
|
85
|
+
const machineProps = createMemo(() => ({
|
|
86
|
+
id,
|
|
87
|
+
ids: {
|
|
88
|
+
label: field?.().ids.label,
|
|
89
|
+
hiddenInput: field?.().ids.control
|
|
90
|
+
},
|
|
91
|
+
disabled: field?.().disabled,
|
|
92
|
+
readOnly: field?.().readOnly,
|
|
93
|
+
required: field?.().required,
|
|
94
|
+
dir: locale().dir,
|
|
95
|
+
getRootNode: environment().getRootNode,
|
|
96
|
+
...runIfFn(props)
|
|
97
|
+
}));
|
|
98
|
+
const service = useMachine(ratingGroup.machine, machineProps);
|
|
99
|
+
return createMemo(() => ratingGroup.connect(service, normalizeProps));
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/components/rating-group/rating-group-root.tsx
|
|
104
|
+
const RatingGroupRoot = (props) => {
|
|
105
|
+
const [useRatingProps, localProps] = createSplitProps()(props, [
|
|
106
|
+
"allowHalf",
|
|
107
|
+
"autoFocus",
|
|
108
|
+
"count",
|
|
109
|
+
"defaultValue",
|
|
110
|
+
"disabled",
|
|
111
|
+
"form",
|
|
112
|
+
"id",
|
|
113
|
+
"ids",
|
|
114
|
+
"name",
|
|
115
|
+
"onHoverChange",
|
|
116
|
+
"onValueChange",
|
|
117
|
+
"readOnly",
|
|
118
|
+
"required",
|
|
119
|
+
"translations",
|
|
120
|
+
"value"
|
|
121
|
+
]);
|
|
122
|
+
const api = useRatingGroup(useRatingProps);
|
|
123
|
+
const mergedProps = mergeProps$2(() => api().getRootProps(), localProps);
|
|
124
|
+
return createComponent(RatingGroupProvider, {
|
|
125
|
+
value: api,
|
|
126
|
+
get children() {
|
|
127
|
+
return createComponent(sprawlify.div, mergedProps);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/components/rating-group/rating-group-root-provider.tsx
|
|
134
|
+
const RatingGroupRootProvider = (props) => {
|
|
135
|
+
const [{ value: ratingGroup$1 }, localProps] = createSplitProps()(props, ["value"]);
|
|
136
|
+
const mergedProps = mergeProps$2(() => ratingGroup$1().getRootProps(), localProps);
|
|
137
|
+
return createComponent(RatingGroupProvider, {
|
|
138
|
+
value: ratingGroup$1,
|
|
139
|
+
get children() {
|
|
140
|
+
return createComponent(sprawlify.div, mergedProps);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region src/components/rating-group/rating-group.ts
|
|
147
|
+
var rating_group_exports = /* @__PURE__ */ __export({
|
|
148
|
+
Context: () => RatingGroupContext,
|
|
149
|
+
Control: () => RatingGroupControl,
|
|
150
|
+
HiddenInput: () => RatingGroupHiddenInput,
|
|
151
|
+
Item: () => RatingGroupItem,
|
|
152
|
+
ItemContext: () => RatingGroupItemContext,
|
|
153
|
+
Label: () => RatingGroupLabel,
|
|
154
|
+
Root: () => RatingGroupRoot,
|
|
155
|
+
RootProvider: () => RatingGroupRootProvider
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
//#endregion
|
|
159
|
+
export { rating_group_exports as RatingGroup, RatingGroupContext, RatingGroupControl, RatingGroupHiddenInput, RatingGroupItem, RatingGroupItemContext, RatingGroupLabel, RatingGroupRoot, RatingGroupRootProvider, ratingGroupAnatomy, useRatingGroup, useRatingGroupContext, useRatingGroupItemContext };
|