@sprawlify/react 0.0.9 → 0.0.10
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-vqmKK3px.mjs → collapsible-DCBcxJA8.mjs} +7 -7
- package/dist/{collection-BYYMj_V8.mjs → collection-XVYHjcEl.mjs} +2 -2
- 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 -10
- 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 -8
- 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 -8
- 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 -12
- 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 -8
- 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 -13
- 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.d.cts +10 -10
- package/dist/components/collapsible/index.d.mts +10 -10
- package/dist/components/collapsible/index.mjs +7 -7
- 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.d.cts +35 -35
- package/dist/components/color-picker/index.d.mts +36 -36
- package/dist/components/color-picker/index.mjs +14 -14
- 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 -15
- package/dist/components/date-picker/index.d.cts +32 -32
- package/dist/components/date-picker/index.d.mts +33 -33
- package/dist/components/date-picker/index.mjs +11 -11
- package/dist/components/dialog/index.d.cts +15 -15
- package/dist/components/dialog/index.d.mts +16 -16
- package/dist/components/dialog/index.mjs +11 -11
- package/dist/components/download-trigger/index.d.cts +4 -4
- package/dist/components/download-trigger/index.d.mts +4 -4
- package/dist/components/download-trigger/index.mjs +5 -5
- package/dist/components/editable/index.d.cts +13 -13
- package/dist/components/editable/index.d.mts +13 -13
- package/dist/components/editable/index.mjs +11 -11
- package/dist/components/field/index.d.cts +14 -14
- package/dist/components/field/index.d.mts +14 -14
- package/dist/components/field/index.mjs +9 -9
- 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 -9
- package/dist/components/file-upload/index.d.cts +18 -18
- package/dist/components/file-upload/index.d.mts +18 -18
- package/dist/components/file-upload/index.mjs +11 -11
- package/dist/components/floating-panel/index.d.cts +19 -19
- package/dist/components/floating-panel/index.d.mts +20 -20
- package/dist/components/floating-panel/index.mjs +11 -11
- package/dist/components/focus-trap/index.d.cts +4 -4
- package/dist/components/focus-trap/index.d.mts +4 -4
- package/dist/components/focus-trap/index.mjs +4 -4
- package/dist/components/format/index.d.cts +4 -4
- package/dist/components/format/index.d.mts +4 -4
- package/dist/components/format/index.mjs +3 -3
- package/dist/components/frame/index.d.cts +3 -3
- package/dist/components/frame/index.d.mts +3 -3
- package/dist/components/frame/index.mjs +6 -6
- 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.d.cts +13 -13
- package/dist/components/hover-card/index.d.mts +14 -14
- package/dist/components/hover-card/index.mjs +10 -10
- package/dist/components/image-cropper/index.d.cts +11 -11
- package/dist/components/image-cropper/index.d.mts +11 -11
- package/dist/components/image-cropper/index.mjs +8 -8
- package/dist/components/json-tree-view/index.d.cts +5 -5
- package/dist/components/json-tree-view/index.d.mts +9 -9
- package/dist/components/json-tree-view/index.mjs +13 -13
- package/dist/components/listbox/index.d.cts +17 -17
- package/dist/components/listbox/index.d.mts +17 -17
- package/dist/components/listbox/index.mjs +10 -10
- package/dist/components/marquee/index.d.cts +10 -10
- package/dist/components/marquee/index.d.mts +10 -10
- package/dist/components/marquee/index.mjs +8 -8
- package/dist/components/menu/index.d.cts +25 -25
- package/dist/components/menu/index.d.mts +28 -28
- package/dist/components/menu/index.mjs +11 -11
- package/dist/components/navigation-menu/index.d.cts +17 -17
- package/dist/components/navigation-menu/index.d.mts +17 -17
- package/dist/components/navigation-menu/index.mjs +13 -13
- package/dist/components/number-input/index.d.cts +13 -13
- package/dist/components/number-input/index.d.mts +13 -13
- package/dist/components/number-input/index.mjs +11 -11
- package/dist/components/pagination/index.d.cts +12 -12
- package/dist/components/pagination/index.d.mts +12 -12
- package/dist/components/pagination/index.mjs +8 -8
- package/dist/components/password-input/index.d.cts +11 -11
- package/dist/components/password-input/index.d.mts +11 -11
- package/dist/components/password-input/index.mjs +11 -11
- package/dist/components/pin-input/index.d.cts +10 -10
- package/dist/components/pin-input/index.d.mts +10 -10
- package/dist/components/pin-input/index.mjs +11 -11
- package/dist/components/popover/index.d.cts +18 -18
- package/dist/components/popover/index.d.mts +19 -19
- package/dist/components/popover/index.mjs +10 -10
- 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 -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/progress/index.cjs +222 -0
- package/dist/components/progress/index.d.cts +79 -0
- package/dist/components/progress/index.d.mts +79 -0
- package/dist/components/progress/index.mjs +197 -0
- package/dist/components/qr-code/index.cjs +166 -0
- package/dist/components/qr-code/index.d.cts +59 -0
- package/dist/components/qr-code/index.d.mts +59 -0
- package/dist/components/qr-code/index.mjs +145 -0
- package/dist/components/radio-group/index.cjs +240 -0
- package/dist/components/radio-group/index.d.cts +78 -0
- package/dist/components/radio-group/index.d.mts +78 -0
- package/dist/components/radio-group/index.mjs +215 -0
- package/dist/components/rating-group/index.cjs +202 -0
- package/dist/components/rating-group/index.d.cts +68 -0
- package/dist/components/rating-group/index.d.mts +68 -0
- package/dist/components/rating-group/index.mjs +179 -0
- package/dist/components/scroll-area/index.cjs +180 -0
- package/dist/components/scroll-area/index.d.cts +68 -0
- package/dist/components/scroll-area/index.d.mts +68 -0
- package/dist/components/scroll-area/index.mjs +158 -0
- package/dist/components/segment-group/index.cjs +233 -0
- package/dist/components/segment-group/index.d.cts +82 -0
- package/dist/components/segment-group/index.d.mts +82 -0
- package/dist/components/segment-group/index.mjs +213 -0
- 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 -15
- package/dist/components/tree-view/index.d.cts +2 -2
- package/dist/components/tree-view/index.d.mts +5 -5
- package/dist/components/tree-view/index.mjs +11 -11
- package/dist/{environment-Cc02I6aF.mjs → environment-Cnx9ZBbN.mjs} +1 -1
- package/dist/{factory-7ydMApfi.mjs → factory-BwIiMV5g.mjs} +1 -1
- package/dist/{field-BXY6su53.mjs → field-BuPxh7ZO.mjs} +9 -9
- package/dist/{fieldset-BeHm9oxe.mjs → fieldset-UIFriN0i.mjs} +8 -8
- package/dist/{index-wlpTZGhs.d.mts → index-BoKwZUuR.d.mts} +25 -25
- package/dist/{index-Bkxp7VrU.d.mts → index-C-uklBbh.d.cts} +7 -7
- package/dist/{index-DTzLUoop.d.cts → index-IQMPWCzE.d.cts} +25 -25
- package/dist/{index-aYGfRRLA.d.cts → index-tmg3Dc0S.d.mts} +7 -7
- package/dist/index.d.cts +5 -5
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +7 -7
- package/dist/{locale-D4LX0eEq.mjs → locale-BheNIyu4.mjs} +1 -1
- package/dist/{portal-BOhFScBS.mjs → portal-Cf1DNJ7L.mjs} +1 -1
- package/dist/{presence-C9BcvdTf.mjs → presence-D-rmmMDm.mjs} +6 -6
- package/dist/{render-strategy-BgIBKraZ.mjs → render-strategy-D2htg_Zz.mjs} +2 -2
- package/dist/{tree-view-CzJvwlYQ.mjs → tree-view-Br67rmuK.mjs} +9 -9
- package/dist/{use-fieldset-context-6GRSrrlt.mjs → use-fieldset-context-DPgRcctn.mjs} +1 -1
- 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 +62 -2
- /package/dist/{chunk-BU8PiJgx.mjs → chunk-tPcuhsU6.mjs} +0 -0
- /package/dist/{compose-refs-Cl5LpASY.mjs → compose-refs-ymQahgeo.mjs} +0 -0
- /package/dist/{core-79NSyZp-.mjs → core-BrQa5x6H.mjs} +0 -0
- /package/dist/{create-context-DbhrVE2B.mjs → create-context-aizX7yAt.mjs} +0 -0
- /package/dist/{create-split-props-BJdRM9I_.mjs → create-split-props-BHHQqbKs.mjs} +0 -0
- /package/dist/{factory-DaVlp4Ba.d.mts → factory-Bv0JsGLd.d.cts} +0 -0
- /package/dist/{factory-fcFI3pbG.d.cts → factory-DcDjbYQq.d.mts} +0 -0
- /package/dist/{index-DPoOdvOg.d.mts → index-BH0zbKp3.d.mts} +0 -0
- /package/dist/{index-BcXWsxRa.d.mts → index-CQrt31Vz.d.mts} +0 -0
- /package/dist/{index-CReeoTjv.d.cts → index-CsVbgeF4.d.cts} +0 -0
- /package/dist/{index-r8rv70-L.d.cts → index-D2T5b4fK.d.cts} +0 -0
- /package/dist/{index-BLd57Y0z.d.mts → index-DJx_8PSR.d.mts} +0 -0
- /package/dist/{index-BoLg0FWF.d.mts → index-WJ-tNaCp.d.mts} +0 -0
- /package/dist/{index-Cquz7y70.d.cts → index-YjtX6_Hn.d.cts} +0 -0
- /package/dist/{normalize-props-Dw0EepzR.d.cts → normalize-props-EzaAUPva.d.cts} +0 -0
- /package/dist/{providers-CoJceYkV.mjs → providers-B1DbplwV.mjs} +0 -0
- /package/dist/{render-strategy-CRwPcG33.d.mts → render-strategy-C5J78Qs-.d.mts} +0 -0
- /package/dist/{render-strategy-M8NkD01w.d.cts → render-strategy-DEUBHfUP.d.cts} +0 -0
- /package/dist/{types-CrwpJrFp.d.mts → types-C2LNTNCl.d.cts} +0 -0
- /package/dist/{types-DcUAwTQC.d.cts → types-CdhepaRC.d.mts} +0 -0
- /package/dist/{use-event-B4e6iJDK.mjs → use-event-qKb6UUEI.mjs} +0 -0
- /package/dist/{use-safe-layout-effect-DPn_9-dD.mjs → use-safe-layout-effect-BHE-Ll-k.mjs} +0 -0
- /package/dist/{utils-BQJFlkDE.mjs → utils-Bx4WJ5W9.mjs} +0 -0
|
@@ -0,0 +1,202 @@
|
|
|
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
|
+
require('../../use-fieldset-context-CCQLmNLL.cjs');
|
|
10
|
+
require('../../use-safe-layout-effect-C2GgvNT3.cjs');
|
|
11
|
+
const require_field = require('../../field-C-57Gj2E.cjs');
|
|
12
|
+
let react = require("react");
|
|
13
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
14
|
+
let __sprawlify_primitives_machines_rating_group = require("@sprawlify/primitives/machines/rating-group");
|
|
15
|
+
__sprawlify_primitives_machines_rating_group = require_chunk.__toESM(__sprawlify_primitives_machines_rating_group);
|
|
16
|
+
let __sprawlify_primitives_core = require("@sprawlify/primitives/core");
|
|
17
|
+
|
|
18
|
+
//#region src/components/rating-group/use-rating-group-context.ts
|
|
19
|
+
const [RatingGroupProvider, useRatingGroupContext] = require_create_context.createContext({
|
|
20
|
+
name: "RatingGroupContext",
|
|
21
|
+
hookName: "useRatingGroupContext",
|
|
22
|
+
providerName: "<RatingGroupProvider />"
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/rating-group/rating-group-context.tsx
|
|
27
|
+
const RatingGroupContext = (props) => props.children(useRatingGroupContext());
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/components/rating-group/rating-group-control.tsx
|
|
31
|
+
const RatingGroupControl = (0, react.forwardRef)((props, ref) => {
|
|
32
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(useRatingGroupContext().getControlProps(), props);
|
|
33
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
34
|
+
...mergedProps,
|
|
35
|
+
ref
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
RatingGroupControl.displayName = "RatingGroupControl";
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/components/rating-group/rating-group-hidden-input.tsx
|
|
42
|
+
const RatingGroupHiddenInput = (0, react.forwardRef)((props, ref) => {
|
|
43
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(useRatingGroupContext().getHiddenInputProps(), props);
|
|
44
|
+
const field = require_field.useFieldContext();
|
|
45
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.input, {
|
|
46
|
+
"aria-describedby": field?.ariaDescribedby,
|
|
47
|
+
...mergedProps,
|
|
48
|
+
ref
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
RatingGroupHiddenInput.displayName = "RatingGroupHiddenInput";
|
|
52
|
+
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/components/rating-group/use-rating-group-item-context.ts
|
|
55
|
+
const [RatingGroupItemProvider, useRatingGroupItemContext] = require_create_context.createContext({
|
|
56
|
+
name: "RatingGroupItemContext",
|
|
57
|
+
hookName: "useRatingGroupItemContext",
|
|
58
|
+
providerName: "<RatingGroupItemProvider />"
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/components/rating-group/rating-group-item.tsx
|
|
63
|
+
const splitItemProps = require_create_split_props.createSplitProps();
|
|
64
|
+
const RatingGroupItem = (0, react.forwardRef)((props, ref) => {
|
|
65
|
+
const [itemProps, localProps] = splitItemProps(props, ["index"]);
|
|
66
|
+
const ratingGroup = useRatingGroupContext();
|
|
67
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(ratingGroup.getItemProps(itemProps), localProps);
|
|
68
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RatingGroupItemProvider, {
|
|
69
|
+
value: ratingGroup.getItemState(itemProps),
|
|
70
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.span, {
|
|
71
|
+
...mergedProps,
|
|
72
|
+
ref
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
RatingGroupItem.displayName = "RatingGroupItem";
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/components/rating-group/rating-group-item-context.tsx
|
|
80
|
+
const RatingGroupItemContext = (props) => props.children(useRatingGroupItemContext());
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/components/rating-group/rating-group-label.tsx
|
|
84
|
+
const RatingGroupLabel = (0, react.forwardRef)((props, ref) => {
|
|
85
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(useRatingGroupContext().getLabelProps(), props);
|
|
86
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.label, {
|
|
87
|
+
...mergedProps,
|
|
88
|
+
ref
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
RatingGroupLabel.displayName = "RatingGroupLabel";
|
|
92
|
+
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/components/rating-group/use-rating-group.ts
|
|
95
|
+
const useRatingGroup = (props) => {
|
|
96
|
+
const id = (0, react.useId)();
|
|
97
|
+
const { getRootNode } = require_environment.useEnvironmentContext();
|
|
98
|
+
const { dir } = require_locale.useLocaleContext();
|
|
99
|
+
const field = require_field.useFieldContext();
|
|
100
|
+
const machineProps = {
|
|
101
|
+
id,
|
|
102
|
+
ids: {
|
|
103
|
+
label: field?.ids.label,
|
|
104
|
+
hiddenInput: field?.ids.control
|
|
105
|
+
},
|
|
106
|
+
dir,
|
|
107
|
+
disabled: field?.disabled,
|
|
108
|
+
readOnly: field?.readOnly,
|
|
109
|
+
required: field?.required,
|
|
110
|
+
getRootNode,
|
|
111
|
+
...props
|
|
112
|
+
};
|
|
113
|
+
const service = require_core.useMachine(__sprawlify_primitives_machines_rating_group.machine, machineProps);
|
|
114
|
+
return __sprawlify_primitives_machines_rating_group.connect(service, require_core.normalizeProps);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/components/rating-group/rating-group-root.tsx
|
|
119
|
+
const splitRootProps = require_create_split_props.createSplitProps();
|
|
120
|
+
const RatingGroupRoot = (0, react.forwardRef)((props, ref) => {
|
|
121
|
+
const [useRatingProps, localProps] = splitRootProps(props, [
|
|
122
|
+
"allowHalf",
|
|
123
|
+
"autoFocus",
|
|
124
|
+
"count",
|
|
125
|
+
"defaultValue",
|
|
126
|
+
"disabled",
|
|
127
|
+
"form",
|
|
128
|
+
"id",
|
|
129
|
+
"ids",
|
|
130
|
+
"name",
|
|
131
|
+
"onHoverChange",
|
|
132
|
+
"onValueChange",
|
|
133
|
+
"readOnly",
|
|
134
|
+
"required",
|
|
135
|
+
"translations",
|
|
136
|
+
"value"
|
|
137
|
+
]);
|
|
138
|
+
const ratingGroup = useRatingGroup(useRatingProps);
|
|
139
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(ratingGroup.getRootProps(), localProps);
|
|
140
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RatingGroupProvider, {
|
|
141
|
+
value: ratingGroup,
|
|
142
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
143
|
+
...mergedProps,
|
|
144
|
+
ref
|
|
145
|
+
})
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
RatingGroupRoot.displayName = "RatingGroupRoot";
|
|
149
|
+
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/components/rating-group/rating-group-root-provider.tsx
|
|
152
|
+
const splitRootProviderProps = require_create_split_props.createSplitProps();
|
|
153
|
+
const RatingGroupRootProvider = (0, react.forwardRef)((props, ref) => {
|
|
154
|
+
const [{ value: ratingGroup }, localProps] = splitRootProviderProps(props, ["value"]);
|
|
155
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(ratingGroup.getRootProps(), localProps);
|
|
156
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RatingGroupProvider, {
|
|
157
|
+
value: ratingGroup,
|
|
158
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
159
|
+
...mergedProps,
|
|
160
|
+
ref
|
|
161
|
+
})
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
RatingGroupRootProvider.displayName = "RatingGroupRootProvider";
|
|
165
|
+
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/components/rating-group/rating-group.ts
|
|
168
|
+
var rating_group_exports = /* @__PURE__ */ require_chunk.__export({
|
|
169
|
+
Context: () => RatingGroupContext,
|
|
170
|
+
Control: () => RatingGroupControl,
|
|
171
|
+
HiddenInput: () => RatingGroupHiddenInput,
|
|
172
|
+
Item: () => RatingGroupItem,
|
|
173
|
+
ItemContext: () => RatingGroupItemContext,
|
|
174
|
+
Label: () => RatingGroupLabel,
|
|
175
|
+
Root: () => RatingGroupRoot,
|
|
176
|
+
RootProvider: () => RatingGroupRootProvider
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
//#endregion
|
|
180
|
+
Object.defineProperty(exports, 'RatingGroup', {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function () {
|
|
183
|
+
return rating_group_exports;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
exports.RatingGroupContext = RatingGroupContext;
|
|
187
|
+
exports.RatingGroupControl = RatingGroupControl;
|
|
188
|
+
exports.RatingGroupHiddenInput = RatingGroupHiddenInput;
|
|
189
|
+
exports.RatingGroupItem = RatingGroupItem;
|
|
190
|
+
exports.RatingGroupItemContext = RatingGroupItemContext;
|
|
191
|
+
exports.RatingGroupLabel = RatingGroupLabel;
|
|
192
|
+
exports.RatingGroupRoot = RatingGroupRoot;
|
|
193
|
+
exports.RatingGroupRootProvider = RatingGroupRootProvider;
|
|
194
|
+
Object.defineProperty(exports, 'ratingGroupAnatomy', {
|
|
195
|
+
enumerable: true,
|
|
196
|
+
get: function () {
|
|
197
|
+
return __sprawlify_primitives_machines_rating_group.anatomy;
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
exports.useRatingGroup = useRatingGroup;
|
|
201
|
+
exports.useRatingGroupContext = useRatingGroupContext;
|
|
202
|
+
exports.useRatingGroupItemContext = useRatingGroupItemContext;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { t as PropTypes } from "../../normalize-props-EzaAUPva.cjs";
|
|
2
|
+
import { r as Optional, t as Assign } from "../../types-C2LNTNCl.cjs";
|
|
3
|
+
import { r as PolymorphicProps, t as HTMLProps } from "../../factory-Bv0JsGLd.cjs";
|
|
4
|
+
import * as react124 from "react";
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
import * as rating 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<rating.Props, "dir" | "getRootNode">, "id"> {}
|
|
11
|
+
interface UseRatingGroupReturn extends rating.Api<PropTypes> {}
|
|
12
|
+
declare const useRatingGroup: (props?: 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) => ReactNode;
|
|
20
|
+
}
|
|
21
|
+
declare const RatingGroupContext: (props: RatingGroupContextProps) => ReactNode;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/rating-group/rating-group-control.d.ts
|
|
24
|
+
interface RatingGroupControlBaseProps extends PolymorphicProps {}
|
|
25
|
+
interface RatingGroupControlProps extends HTMLProps<"div">, RatingGroupControlBaseProps {}
|
|
26
|
+
declare const RatingGroupControl: react124.ForwardRefExoticComponent<RatingGroupControlProps & react124.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/rating-group/rating-group-hidden-input.d.ts
|
|
29
|
+
interface RatingGroupHiddenInputBaseProps extends PolymorphicProps {}
|
|
30
|
+
interface RatingGroupHiddenInputProps extends HTMLProps<"input">, RatingGroupHiddenInputBaseProps {}
|
|
31
|
+
declare const RatingGroupHiddenInput: react124.ForwardRefExoticComponent<RatingGroupHiddenInputProps & react124.RefAttributes<HTMLInputElement>>;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/rating-group/rating-group-item.d.ts
|
|
34
|
+
interface RatingGroupItemBaseProps extends ItemProps, PolymorphicProps {}
|
|
35
|
+
interface RatingGroupItemProps extends HTMLProps<"span">, RatingGroupItemBaseProps {}
|
|
36
|
+
declare const RatingGroupItem: react124.ForwardRefExoticComponent<RatingGroupItemProps & react124.RefAttributes<HTMLSpanElement>>;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/rating-group/use-rating-group-item-context.d.ts
|
|
39
|
+
interface UseRatingGroupItemContext extends ItemState {}
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/components/rating-group/rating-group-item-context.d.ts
|
|
42
|
+
interface RatingGroupItemContextProps {
|
|
43
|
+
children: (context: UseRatingGroupItemContext) => ReactNode;
|
|
44
|
+
}
|
|
45
|
+
declare const RatingGroupItemContext: (props: RatingGroupItemContextProps) => ReactNode;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/rating-group/rating-group-label.d.ts
|
|
48
|
+
interface RatingGroupLabelBaseProps extends PolymorphicProps {}
|
|
49
|
+
interface RatingGroupLabelProps extends HTMLProps<"label">, RatingGroupLabelBaseProps {}
|
|
50
|
+
declare const RatingGroupLabel: react124.ForwardRefExoticComponent<RatingGroupLabelProps & react124.RefAttributes<HTMLLabelElement>>;
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/components/rating-group/rating-group-root.d.ts
|
|
53
|
+
interface RatingGroupRootBaseProps extends UseRatingGroupProps, PolymorphicProps {}
|
|
54
|
+
interface RatingGroupRootProps extends Assign<HTMLProps<"div">, RatingGroupRootBaseProps> {}
|
|
55
|
+
declare const RatingGroupRoot: react124.ForwardRefExoticComponent<RatingGroupRootProps & react124.RefAttributes<HTMLDivElement>>;
|
|
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 RootProviderProps, PolymorphicProps {}
|
|
62
|
+
interface RatingGroupRootProviderProps extends HTMLProps<"div">, RatingGroupRootProviderBaseProps {}
|
|
63
|
+
declare const RatingGroupRootProvider: react124.ForwardRefExoticComponent<RatingGroupRootProviderProps & react124.RefAttributes<HTMLDivElement>>;
|
|
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,68 @@
|
|
|
1
|
+
import { r as PropTypes } from "../../index-DJx_8PSR.mjs";
|
|
2
|
+
import { r as Optional, t as Assign } from "../../types-CdhepaRC.mjs";
|
|
3
|
+
import { r as PolymorphicProps, t as HTMLProps } from "../../factory-DcDjbYQq.mjs";
|
|
4
|
+
import * as react322 from "react";
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
import * as rating 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<rating.Props, "dir" | "getRootNode">, "id"> {}
|
|
11
|
+
interface UseRatingGroupReturn extends rating.Api<PropTypes> {}
|
|
12
|
+
declare const useRatingGroup: (props?: 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) => ReactNode;
|
|
20
|
+
}
|
|
21
|
+
declare const RatingGroupContext: (props: RatingGroupContextProps) => ReactNode;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/rating-group/rating-group-control.d.ts
|
|
24
|
+
interface RatingGroupControlBaseProps extends PolymorphicProps {}
|
|
25
|
+
interface RatingGroupControlProps extends HTMLProps<"div">, RatingGroupControlBaseProps {}
|
|
26
|
+
declare const RatingGroupControl: react322.ForwardRefExoticComponent<RatingGroupControlProps & react322.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/rating-group/rating-group-hidden-input.d.ts
|
|
29
|
+
interface RatingGroupHiddenInputBaseProps extends PolymorphicProps {}
|
|
30
|
+
interface RatingGroupHiddenInputProps extends HTMLProps<"input">, RatingGroupHiddenInputBaseProps {}
|
|
31
|
+
declare const RatingGroupHiddenInput: react322.ForwardRefExoticComponent<RatingGroupHiddenInputProps & react322.RefAttributes<HTMLInputElement>>;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/rating-group/rating-group-item.d.ts
|
|
34
|
+
interface RatingGroupItemBaseProps extends ItemProps, PolymorphicProps {}
|
|
35
|
+
interface RatingGroupItemProps extends HTMLProps<"span">, RatingGroupItemBaseProps {}
|
|
36
|
+
declare const RatingGroupItem: react322.ForwardRefExoticComponent<RatingGroupItemProps & react322.RefAttributes<HTMLSpanElement>>;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/rating-group/use-rating-group-item-context.d.ts
|
|
39
|
+
interface UseRatingGroupItemContext extends ItemState {}
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/components/rating-group/rating-group-item-context.d.ts
|
|
42
|
+
interface RatingGroupItemContextProps {
|
|
43
|
+
children: (context: UseRatingGroupItemContext) => ReactNode;
|
|
44
|
+
}
|
|
45
|
+
declare const RatingGroupItemContext: (props: RatingGroupItemContextProps) => ReactNode;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/rating-group/rating-group-label.d.ts
|
|
48
|
+
interface RatingGroupLabelBaseProps extends PolymorphicProps {}
|
|
49
|
+
interface RatingGroupLabelProps extends HTMLProps<"label">, RatingGroupLabelBaseProps {}
|
|
50
|
+
declare const RatingGroupLabel: react322.ForwardRefExoticComponent<RatingGroupLabelProps & react322.RefAttributes<HTMLLabelElement>>;
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/components/rating-group/rating-group-root.d.ts
|
|
53
|
+
interface RatingGroupRootBaseProps extends UseRatingGroupProps, PolymorphicProps {}
|
|
54
|
+
interface RatingGroupRootProps extends Assign<HTMLProps<"div">, RatingGroupRootBaseProps> {}
|
|
55
|
+
declare const RatingGroupRoot: react322.ForwardRefExoticComponent<RatingGroupRootProps & react322.RefAttributes<HTMLDivElement>>;
|
|
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 RootProviderProps, PolymorphicProps {}
|
|
62
|
+
interface RatingGroupRootProviderProps extends HTMLProps<"div">, RatingGroupRootProviderBaseProps {}
|
|
63
|
+
declare const RatingGroupRootProvider: react322.ForwardRefExoticComponent<RatingGroupRootProviderProps & react322.RefAttributes<HTMLDivElement>>;
|
|
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,179 @@
|
|
|
1
|
+
import { t as __export } from "../../chunk-tPcuhsU6.mjs";
|
|
2
|
+
import { i as useMachine, r as normalizeProps, t as mergeProps } from "../../core-BrQa5x6H.mjs";
|
|
3
|
+
import { t as createContext$1 } from "../../create-context-aizX7yAt.mjs";
|
|
4
|
+
import { n as useEnvironmentContext } from "../../environment-Cnx9ZBbN.mjs";
|
|
5
|
+
import { i as useLocaleContext } from "../../locale-BheNIyu4.mjs";
|
|
6
|
+
import "../../providers-B1DbplwV.mjs";
|
|
7
|
+
import { n as sprawlify } from "../../factory-BwIiMV5g.mjs";
|
|
8
|
+
import { t as createSplitProps } from "../../create-split-props-BHHQqbKs.mjs";
|
|
9
|
+
import "../../use-fieldset-context-DPgRcctn.mjs";
|
|
10
|
+
import "../../use-safe-layout-effect-BHE-Ll-k.mjs";
|
|
11
|
+
import { m as useFieldContext } from "../../field-BuPxh7ZO.mjs";
|
|
12
|
+
import { forwardRef, useId } from "react";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
import * as rating from "@sprawlify/primitives/machines/rating-group";
|
|
15
|
+
import { anatomy as ratingGroupAnatomy } from "@sprawlify/primitives/machines/rating-group";
|
|
16
|
+
|
|
17
|
+
//#region src/components/rating-group/use-rating-group-context.ts
|
|
18
|
+
const [RatingGroupProvider, useRatingGroupContext] = createContext$1({
|
|
19
|
+
name: "RatingGroupContext",
|
|
20
|
+
hookName: "useRatingGroupContext",
|
|
21
|
+
providerName: "<RatingGroupProvider />"
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/components/rating-group/rating-group-context.tsx
|
|
26
|
+
const RatingGroupContext = (props) => props.children(useRatingGroupContext());
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/rating-group/rating-group-control.tsx
|
|
30
|
+
const RatingGroupControl = forwardRef((props, ref) => {
|
|
31
|
+
const mergedProps = mergeProps(useRatingGroupContext().getControlProps(), props);
|
|
32
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
33
|
+
...mergedProps,
|
|
34
|
+
ref
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
RatingGroupControl.displayName = "RatingGroupControl";
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/components/rating-group/rating-group-hidden-input.tsx
|
|
41
|
+
const RatingGroupHiddenInput = forwardRef((props, ref) => {
|
|
42
|
+
const mergedProps = mergeProps(useRatingGroupContext().getHiddenInputProps(), props);
|
|
43
|
+
const field = useFieldContext();
|
|
44
|
+
return /* @__PURE__ */ jsx(sprawlify.input, {
|
|
45
|
+
"aria-describedby": field?.ariaDescribedby,
|
|
46
|
+
...mergedProps,
|
|
47
|
+
ref
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
RatingGroupHiddenInput.displayName = "RatingGroupHiddenInput";
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/rating-group/use-rating-group-item-context.ts
|
|
54
|
+
const [RatingGroupItemProvider, useRatingGroupItemContext] = createContext$1({
|
|
55
|
+
name: "RatingGroupItemContext",
|
|
56
|
+
hookName: "useRatingGroupItemContext",
|
|
57
|
+
providerName: "<RatingGroupItemProvider />"
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/components/rating-group/rating-group-item.tsx
|
|
62
|
+
const splitItemProps = createSplitProps();
|
|
63
|
+
const RatingGroupItem = forwardRef((props, ref) => {
|
|
64
|
+
const [itemProps, localProps] = splitItemProps(props, ["index"]);
|
|
65
|
+
const ratingGroup = useRatingGroupContext();
|
|
66
|
+
const mergedProps = mergeProps(ratingGroup.getItemProps(itemProps), localProps);
|
|
67
|
+
return /* @__PURE__ */ jsx(RatingGroupItemProvider, {
|
|
68
|
+
value: ratingGroup.getItemState(itemProps),
|
|
69
|
+
children: /* @__PURE__ */ jsx(sprawlify.span, {
|
|
70
|
+
...mergedProps,
|
|
71
|
+
ref
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
RatingGroupItem.displayName = "RatingGroupItem";
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/components/rating-group/rating-group-item-context.tsx
|
|
79
|
+
const RatingGroupItemContext = (props) => props.children(useRatingGroupItemContext());
|
|
80
|
+
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/components/rating-group/rating-group-label.tsx
|
|
83
|
+
const RatingGroupLabel = forwardRef((props, ref) => {
|
|
84
|
+
const mergedProps = mergeProps(useRatingGroupContext().getLabelProps(), props);
|
|
85
|
+
return /* @__PURE__ */ jsx(sprawlify.label, {
|
|
86
|
+
...mergedProps,
|
|
87
|
+
ref
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
RatingGroupLabel.displayName = "RatingGroupLabel";
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/components/rating-group/use-rating-group.ts
|
|
94
|
+
const useRatingGroup = (props) => {
|
|
95
|
+
const id = useId();
|
|
96
|
+
const { getRootNode } = useEnvironmentContext();
|
|
97
|
+
const { dir } = useLocaleContext();
|
|
98
|
+
const field = useFieldContext();
|
|
99
|
+
const machineProps = {
|
|
100
|
+
id,
|
|
101
|
+
ids: {
|
|
102
|
+
label: field?.ids.label,
|
|
103
|
+
hiddenInput: field?.ids.control
|
|
104
|
+
},
|
|
105
|
+
dir,
|
|
106
|
+
disabled: field?.disabled,
|
|
107
|
+
readOnly: field?.readOnly,
|
|
108
|
+
required: field?.required,
|
|
109
|
+
getRootNode,
|
|
110
|
+
...props
|
|
111
|
+
};
|
|
112
|
+
const service = useMachine(rating.machine, machineProps);
|
|
113
|
+
return rating.connect(service, normalizeProps);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/components/rating-group/rating-group-root.tsx
|
|
118
|
+
const splitRootProps = createSplitProps();
|
|
119
|
+
const RatingGroupRoot = forwardRef((props, ref) => {
|
|
120
|
+
const [useRatingProps, localProps] = splitRootProps(props, [
|
|
121
|
+
"allowHalf",
|
|
122
|
+
"autoFocus",
|
|
123
|
+
"count",
|
|
124
|
+
"defaultValue",
|
|
125
|
+
"disabled",
|
|
126
|
+
"form",
|
|
127
|
+
"id",
|
|
128
|
+
"ids",
|
|
129
|
+
"name",
|
|
130
|
+
"onHoverChange",
|
|
131
|
+
"onValueChange",
|
|
132
|
+
"readOnly",
|
|
133
|
+
"required",
|
|
134
|
+
"translations",
|
|
135
|
+
"value"
|
|
136
|
+
]);
|
|
137
|
+
const ratingGroup = useRatingGroup(useRatingProps);
|
|
138
|
+
const mergedProps = mergeProps(ratingGroup.getRootProps(), localProps);
|
|
139
|
+
return /* @__PURE__ */ jsx(RatingGroupProvider, {
|
|
140
|
+
value: ratingGroup,
|
|
141
|
+
children: /* @__PURE__ */ jsx(sprawlify.div, {
|
|
142
|
+
...mergedProps,
|
|
143
|
+
ref
|
|
144
|
+
})
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
RatingGroupRoot.displayName = "RatingGroupRoot";
|
|
148
|
+
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/components/rating-group/rating-group-root-provider.tsx
|
|
151
|
+
const splitRootProviderProps = createSplitProps();
|
|
152
|
+
const RatingGroupRootProvider = forwardRef((props, ref) => {
|
|
153
|
+
const [{ value: ratingGroup }, localProps] = splitRootProviderProps(props, ["value"]);
|
|
154
|
+
const mergedProps = mergeProps(ratingGroup.getRootProps(), localProps);
|
|
155
|
+
return /* @__PURE__ */ jsx(RatingGroupProvider, {
|
|
156
|
+
value: ratingGroup,
|
|
157
|
+
children: /* @__PURE__ */ jsx(sprawlify.div, {
|
|
158
|
+
...mergedProps,
|
|
159
|
+
ref
|
|
160
|
+
})
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
RatingGroupRootProvider.displayName = "RatingGroupRootProvider";
|
|
164
|
+
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region src/components/rating-group/rating-group.ts
|
|
167
|
+
var rating_group_exports = /* @__PURE__ */ __export({
|
|
168
|
+
Context: () => RatingGroupContext,
|
|
169
|
+
Control: () => RatingGroupControl,
|
|
170
|
+
HiddenInput: () => RatingGroupHiddenInput,
|
|
171
|
+
Item: () => RatingGroupItem,
|
|
172
|
+
ItemContext: () => RatingGroupItemContext,
|
|
173
|
+
Label: () => RatingGroupLabel,
|
|
174
|
+
Root: () => RatingGroupRoot,
|
|
175
|
+
RootProvider: () => RatingGroupRootProvider
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
//#endregion
|
|
179
|
+
export { rating_group_exports as RatingGroup, RatingGroupContext, RatingGroupControl, RatingGroupHiddenInput, RatingGroupItem, RatingGroupItemContext, RatingGroupLabel, RatingGroupRoot, RatingGroupRootProvider, ratingGroupAnatomy, useRatingGroup, useRatingGroupContext, useRatingGroupItemContext };
|