@sprawlify/react 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/dist/{collapsible-Nbt3Sequ.mjs → collapsible-vqmKK3px.mjs} +7 -7
  2. package/dist/{collection-DQWWySNV.mjs → collection-BYYMj_V8.mjs} +2 -2
  3. package/dist/components/accordion/index.d.cts +11 -11
  4. package/dist/components/accordion/index.d.mts +11 -11
  5. package/dist/components/accordion/index.mjs +10 -10
  6. package/dist/components/angle-slider/index.d.cts +13 -13
  7. package/dist/components/angle-slider/index.d.mts +13 -13
  8. package/dist/components/angle-slider/index.mjs +8 -8
  9. package/dist/components/avatar/index.d.cts +8 -8
  10. package/dist/components/avatar/index.d.mts +8 -8
  11. package/dist/components/avatar/index.mjs +8 -8
  12. package/dist/components/bottom-sheet/index.d.cts +15 -15
  13. package/dist/components/bottom-sheet/index.d.mts +16 -16
  14. package/dist/components/bottom-sheet/index.mjs +12 -12
  15. package/dist/components/carousel/index.d.cts +18 -18
  16. package/dist/components/carousel/index.d.mts +18 -18
  17. package/dist/components/carousel/index.mjs +8 -8
  18. package/dist/components/checkbox/index.d.cts +14 -14
  19. package/dist/components/checkbox/index.d.mts +14 -14
  20. package/dist/components/checkbox/index.mjs +13 -13
  21. package/dist/components/clipboard/index.d.cts +12 -12
  22. package/dist/components/clipboard/index.d.mts +12 -12
  23. package/dist/components/clipboard/index.mjs +6 -6
  24. package/dist/components/collapsible/index.d.cts +10 -10
  25. package/dist/components/collapsible/index.d.mts +10 -10
  26. package/dist/components/collapsible/index.mjs +7 -7
  27. package/dist/components/collection/index.d.cts +1 -1
  28. package/dist/components/collection/index.d.mts +1 -1
  29. package/dist/components/collection/index.mjs +3 -3
  30. package/dist/components/color-picker/index.d.cts +35 -35
  31. package/dist/components/color-picker/index.d.mts +36 -36
  32. package/dist/components/color-picker/index.mjs +14 -14
  33. package/dist/components/combobox/index.d.cts +22 -22
  34. package/dist/components/combobox/index.d.mts +22 -22
  35. package/dist/components/combobox/index.mjs +15 -15
  36. package/dist/components/date-picker/index.d.cts +32 -32
  37. package/dist/components/date-picker/index.d.mts +33 -33
  38. package/dist/components/date-picker/index.mjs +11 -11
  39. package/dist/components/dialog/index.d.cts +15 -15
  40. package/dist/components/dialog/index.d.mts +13 -13
  41. package/dist/components/dialog/index.mjs +11 -11
  42. package/dist/components/download-trigger/index.d.cts +4 -4
  43. package/dist/components/download-trigger/index.d.mts +4 -4
  44. package/dist/components/download-trigger/index.mjs +5 -5
  45. package/dist/components/editable/index.d.cts +13 -13
  46. package/dist/components/editable/index.d.mts +13 -13
  47. package/dist/components/editable/index.mjs +11 -11
  48. package/dist/components/field/index.d.cts +14 -14
  49. package/dist/components/field/index.d.mts +12 -12
  50. package/dist/components/field/index.mjs +9 -9
  51. package/dist/components/fieldset/index.d.cts +10 -10
  52. package/dist/components/fieldset/index.d.mts +8 -8
  53. package/dist/components/fieldset/index.mjs +9 -9
  54. package/dist/components/file-upload/index.d.cts +3 -3
  55. package/dist/components/file-upload/index.d.mts +18 -18
  56. package/dist/components/file-upload/index.mjs +11 -11
  57. package/dist/components/floating-panel/index.d.cts +19 -19
  58. package/dist/components/floating-panel/index.d.mts +20 -20
  59. package/dist/components/floating-panel/index.mjs +11 -11
  60. package/dist/components/focus-trap/index.d.cts +4 -4
  61. package/dist/components/focus-trap/index.d.mts +4 -4
  62. package/dist/components/focus-trap/index.mjs +4 -4
  63. package/dist/components/format/index.d.cts +4 -4
  64. package/dist/components/format/index.d.mts +4 -4
  65. package/dist/components/format/index.mjs +3 -3
  66. package/dist/components/frame/index.d.cts +3 -3
  67. package/dist/components/frame/index.d.mts +3 -3
  68. package/dist/components/frame/index.mjs +6 -6
  69. package/dist/components/highlight/index.d.cts +3 -3
  70. package/dist/components/highlight/index.d.mts +3 -3
  71. package/dist/components/highlight/index.mjs +1 -1
  72. package/dist/components/hover-card/index.cjs +165 -0
  73. package/dist/components/hover-card/index.d.cts +70 -0
  74. package/dist/components/hover-card/index.d.mts +71 -0
  75. package/dist/components/hover-card/index.mjs +143 -0
  76. package/dist/components/image-cropper/index.cjs +197 -0
  77. package/dist/components/image-cropper/index.d.cts +64 -0
  78. package/dist/components/image-cropper/index.d.mts +64 -0
  79. package/dist/components/image-cropper/index.mjs +175 -0
  80. package/dist/components/json-tree-view/index.cjs +246 -0
  81. package/dist/components/json-tree-view/index.d.cts +43 -0
  82. package/dist/components/json-tree-view/index.d.mts +48 -0
  83. package/dist/components/json-tree-view/index.mjs +237 -0
  84. package/dist/components/listbox/index.cjs +314 -0
  85. package/dist/components/listbox/index.d.cts +110 -0
  86. package/dist/components/listbox/index.d.mts +110 -0
  87. package/dist/components/listbox/index.mjs +289 -0
  88. package/dist/components/marquee/index.cjs +176 -0
  89. package/dist/components/marquee/index.d.cts +61 -0
  90. package/dist/components/marquee/index.d.mts +61 -0
  91. package/dist/components/marquee/index.mjs +155 -0
  92. package/dist/components/menu/index.cjs +548 -0
  93. package/dist/components/menu/index.d.cts +159 -0
  94. package/dist/components/menu/index.d.mts +162 -0
  95. package/dist/components/menu/index.mjs +512 -0
  96. package/dist/components/navigation-menu/index.cjs +339 -0
  97. package/dist/components/navigation-menu/index.d.cts +90 -0
  98. package/dist/components/navigation-menu/index.d.mts +90 -0
  99. package/dist/components/navigation-menu/index.mjs +312 -0
  100. package/dist/components/number-input/index.cjs +237 -0
  101. package/dist/components/number-input/index.d.cts +74 -0
  102. package/dist/components/number-input/index.d.mts +74 -0
  103. package/dist/components/number-input/index.mjs +213 -0
  104. package/dist/components/pagination/index.cjs +197 -0
  105. package/dist/components/pagination/index.d.cts +69 -0
  106. package/dist/components/pagination/index.d.mts +69 -0
  107. package/dist/components/pagination/index.mjs +174 -0
  108. package/dist/components/password-input/index.cjs +193 -0
  109. package/dist/components/password-input/index.d.cts +66 -0
  110. package/dist/components/password-input/index.d.mts +66 -0
  111. package/dist/components/password-input/index.mjs +171 -0
  112. package/dist/components/pin-input/index.cjs +192 -0
  113. package/dist/components/pin-input/index.d.cts +59 -0
  114. package/dist/components/pin-input/index.d.mts +59 -0
  115. package/dist/components/pin-input/index.mjs +171 -0
  116. package/dist/components/popover/index.cjs +237 -0
  117. package/dist/components/popover/index.d.cts +95 -0
  118. package/dist/components/popover/index.d.mts +96 -0
  119. package/dist/components/popover/index.mjs +210 -0
  120. package/dist/components/portal/index.cjs +3 -29
  121. package/dist/components/portal/index.d.cts +2 -2
  122. package/dist/components/portal/index.d.mts +2 -2
  123. package/dist/components/portal/index.mjs +5 -30
  124. package/dist/components/presence/index.d.cts +1 -1
  125. package/dist/components/presence/index.d.mts +3 -3
  126. package/dist/components/presence/index.mjs +5 -5
  127. package/dist/components/select/index.d.cts +21 -21
  128. package/dist/components/select/index.d.mts +22 -22
  129. package/dist/components/select/index.mjs +15 -15
  130. package/dist/components/tree-view/index.cjs +51 -0
  131. package/dist/components/tree-view/index.d.cts +3 -0
  132. package/dist/components/tree-view/index.d.mts +6 -0
  133. package/dist/components/tree-view/index.mjs +13 -0
  134. package/dist/{environment-Ded7DkGr.mjs → environment-Cc02I6aF.mjs} +1 -1
  135. package/dist/{factory-Bi8oEg8i.mjs → factory-7ydMApfi.mjs} +1 -1
  136. package/dist/{field-B-6qoKdn.mjs → field-BXY6su53.mjs} +9 -9
  137. package/dist/{fieldset-gaVneDYh.mjs → fieldset-BeHm9oxe.mjs} +8 -8
  138. package/dist/index-BcXWsxRa.d.mts +40 -0
  139. package/dist/{index-BhGgEHWc.d.cts → index-Bkxp7VrU.d.mts} +7 -7
  140. package/dist/index-Cquz7y70.d.cts +52 -0
  141. package/dist/index-DTzLUoop.d.cts +150 -0
  142. package/dist/{index-Cp1i1zbg.d.mts → index-aYGfRRLA.d.cts} +7 -7
  143. package/dist/index-wlpTZGhs.d.mts +150 -0
  144. package/dist/index.d.cts +6 -56
  145. package/dist/index.d.mts +6 -44
  146. package/dist/index.mjs +7 -7
  147. package/dist/{locale-Coin-d7R.mjs → locale-D4LX0eEq.mjs} +1 -1
  148. package/dist/portal-BOhFScBS.mjs +29 -0
  149. package/dist/portal-DRyJqgA1.cjs +35 -0
  150. package/dist/{presence-Bc6Bxe5i.mjs → presence-C9BcvdTf.mjs} +6 -6
  151. package/dist/{render-strategy-FiPgAp1U.mjs → render-strategy-BgIBKraZ.mjs} +2 -2
  152. package/dist/tree-view-CzJvwlYQ.mjs +365 -0
  153. package/dist/tree-view-DsOPEocd.cjs +509 -0
  154. package/dist/{use-fieldset-context-LwveT1OS.mjs → use-fieldset-context-6GRSrrlt.mjs} +1 -1
  155. package/dist/utils/index.d.cts +1 -1
  156. package/dist/utils/index.d.mts +1 -1
  157. package/dist/utils/index.mjs +2 -2
  158. package/package.json +132 -2
  159. /package/dist/{chunk-BXPHTOwk.mjs → chunk-BU8PiJgx.mjs} +0 -0
  160. /package/dist/{compose-refs-BEptPEkE.mjs → compose-refs-Cl5LpASY.mjs} +0 -0
  161. /package/dist/{core-Ba4IEjhK.mjs → core-79NSyZp-.mjs} +0 -0
  162. /package/dist/{create-context-CCXzjEv8.mjs → create-context-DbhrVE2B.mjs} +0 -0
  163. /package/dist/{create-split-props-CBL0m-GX.mjs → create-split-props-BJdRM9I_.mjs} +0 -0
  164. /package/dist/{factory-C-EBNsCW.d.mts → factory-DaVlp4Ba.d.mts} +0 -0
  165. /package/dist/{factory-C4cfTHs7.d.cts → factory-fcFI3pbG.d.cts} +0 -0
  166. /package/dist/{index-BJvW7OpY.d.mts → index-BLd57Y0z.d.mts} +0 -0
  167. /package/dist/{index-CureNJdc.d.mts → index-BoLg0FWF.d.mts} +0 -0
  168. /package/dist/{index-CumJbg8V.d.cts → index-CReeoTjv.d.cts} +0 -0
  169. /package/dist/{index-ByIsf4E7.d.mts → index-DPoOdvOg.d.mts} +0 -0
  170. /package/dist/{index-dbTyAXLy.d.cts → index-r8rv70-L.d.cts} +0 -0
  171. /package/dist/{normalize-props-skGwa8Dk.d.cts → normalize-props-Dw0EepzR.d.cts} +0 -0
  172. /package/dist/{providers-Dm2P3F2_.mjs → providers-CoJceYkV.mjs} +0 -0
  173. /package/dist/{render-strategy-C8IyLw0O.d.mts → render-strategy-CRwPcG33.d.mts} +0 -0
  174. /package/dist/{render-strategy-rA4C5NUX.d.cts → render-strategy-M8NkD01w.d.cts} +0 -0
  175. /package/dist/{types-B4tvWlDb.d.cts → types-CrwpJrFp.d.mts} +0 -0
  176. /package/dist/{types-BmBABPZb.d.mts → types-DcUAwTQC.d.cts} +0 -0
  177. /package/dist/{use-event-4J5QFFqK.mjs → use-event-B4e6iJDK.mjs} +0 -0
  178. /package/dist/{use-safe-layout-effect-CLjnuJFb.mjs → use-safe-layout-effect-DPn_9-dD.mjs} +0 -0
  179. /package/dist/{utils-C-m3mZWI.mjs → utils-BQJFlkDE.mjs} +0 -0
@@ -0,0 +1,192 @@
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_pin_input = require("@sprawlify/primitives/machines/pin-input");
15
+ __sprawlify_primitives_machines_pin_input = require_chunk.__toESM(__sprawlify_primitives_machines_pin_input);
16
+ let __sprawlify_primitives_core = require("@sprawlify/primitives/core");
17
+
18
+ //#region src/components/pin-input/use-pin-input-context.ts
19
+ const [PinInputProvider, usePinInputContext] = require_create_context.createContext({
20
+ name: "PinInputContext",
21
+ hookName: "usePinInputContext",
22
+ providerName: "<PinInputProvider />"
23
+ });
24
+
25
+ //#endregion
26
+ //#region src/components/pin-input/pin-input-context.tsx
27
+ const PinInputContext = (props) => props.children(usePinInputContext());
28
+
29
+ //#endregion
30
+ //#region src/components/pin-input/pin-input-control.tsx
31
+ const PinInputControl = (0, react.forwardRef)((props, ref) => {
32
+ const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(usePinInputContext().getControlProps(), props);
33
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
34
+ ...mergedProps,
35
+ ref
36
+ });
37
+ });
38
+ PinInputControl.displayName = "PinInputControl";
39
+
40
+ //#endregion
41
+ //#region src/components/pin-input/pin-input-hidden-input.tsx
42
+ const PinInputHiddenInput = (0, react.forwardRef)((props, ref) => {
43
+ const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(usePinInputContext().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
+ PinInputHiddenInput.displayName = "PinInputHiddenInput";
52
+
53
+ //#endregion
54
+ //#region src/components/pin-input/pin-input-input.tsx
55
+ const splitInputProps = require_create_split_props.createSplitProps();
56
+ const PinInputInput = (0, react.forwardRef)((props, ref) => {
57
+ const [inputProps, localProps] = splitInputProps(props, ["index"]);
58
+ const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(usePinInputContext().getInputProps(inputProps), localProps);
59
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.input, {
60
+ ...mergedProps,
61
+ ref
62
+ });
63
+ });
64
+ PinInputInput.displayName = "PinInputInput";
65
+
66
+ //#endregion
67
+ //#region src/components/pin-input/pin-input-label.tsx
68
+ const PinInputLabel = (0, react.forwardRef)((props, ref) => {
69
+ const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(usePinInputContext().getLabelProps(), props);
70
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.label, {
71
+ ...mergedProps,
72
+ ref
73
+ });
74
+ });
75
+ PinInputLabel.displayName = "PinInputLabel";
76
+
77
+ //#endregion
78
+ //#region src/components/pin-input/use-pin-input.ts
79
+ const usePinInput = (props) => {
80
+ const id = (0, react.useId)();
81
+ const { getRootNode } = require_environment.useEnvironmentContext();
82
+ const { dir } = require_locale.useLocaleContext();
83
+ const field = require_field.useFieldContext();
84
+ const machineProps = {
85
+ id,
86
+ ids: {
87
+ label: field?.ids.label,
88
+ hiddenInput: field?.ids.control
89
+ },
90
+ disabled: field?.disabled,
91
+ readOnly: field?.readOnly,
92
+ required: field?.required,
93
+ invalid: field?.invalid,
94
+ dir,
95
+ getRootNode,
96
+ ...props
97
+ };
98
+ const service = require_core.useMachine(__sprawlify_primitives_machines_pin_input.machine, machineProps);
99
+ return __sprawlify_primitives_machines_pin_input.connect(service, require_core.normalizeProps);
100
+ };
101
+
102
+ //#endregion
103
+ //#region src/components/pin-input/pin-input-root.tsx
104
+ const splitRootProps = require_create_split_props.createSplitProps();
105
+ const PinInputRoot = (0, react.forwardRef)((props, ref) => {
106
+ const [usePinInputProps, localProps] = splitRootProps(props, [
107
+ "autoFocus",
108
+ "blurOnComplete",
109
+ "count",
110
+ "defaultValue",
111
+ "disabled",
112
+ "form",
113
+ "id",
114
+ "ids",
115
+ "invalid",
116
+ "mask",
117
+ "name",
118
+ "onValueChange",
119
+ "onValueComplete",
120
+ "onValueInvalid",
121
+ "otp",
122
+ "pattern",
123
+ "placeholder",
124
+ "readOnly",
125
+ "required",
126
+ "selectOnFocus",
127
+ "translations",
128
+ "type",
129
+ "value"
130
+ ]);
131
+ const pinInput = usePinInput(usePinInputProps);
132
+ const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(pinInput.getRootProps(), localProps);
133
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PinInputProvider, {
134
+ value: pinInput,
135
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
136
+ ...mergedProps,
137
+ ref
138
+ })
139
+ });
140
+ });
141
+ PinInputRoot.displayName = "PinInputRoot";
142
+
143
+ //#endregion
144
+ //#region src/components/pin-input/pin-input-root-provider.tsx
145
+ const splitRootProviderProps = require_create_split_props.createSplitProps();
146
+ const PinInputRootProvider = (0, react.forwardRef)((props, ref) => {
147
+ const [{ value: pinInput }, localProps] = splitRootProviderProps(props, ["value"]);
148
+ const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(pinInput.getRootProps(), localProps);
149
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PinInputProvider, {
150
+ value: pinInput,
151
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
152
+ ...mergedProps,
153
+ ref
154
+ })
155
+ });
156
+ });
157
+ PinInputRootProvider.displayName = "PinInputRootProvider";
158
+
159
+ //#endregion
160
+ //#region src/components/pin-input/pin-input.ts
161
+ var pin_input_exports = /* @__PURE__ */ require_chunk.__export({
162
+ Context: () => PinInputContext,
163
+ Control: () => PinInputControl,
164
+ HiddenInput: () => PinInputHiddenInput,
165
+ Input: () => PinInputInput,
166
+ Label: () => PinInputLabel,
167
+ Root: () => PinInputRoot,
168
+ RootProvider: () => PinInputRootProvider
169
+ });
170
+
171
+ //#endregion
172
+ Object.defineProperty(exports, 'PinInput', {
173
+ enumerable: true,
174
+ get: function () {
175
+ return pin_input_exports;
176
+ }
177
+ });
178
+ exports.PinInputContext = PinInputContext;
179
+ exports.PinInputControl = PinInputControl;
180
+ exports.PinInputHiddenInput = PinInputHiddenInput;
181
+ exports.PinInputInput = PinInputInput;
182
+ exports.PinInputLabel = PinInputLabel;
183
+ exports.PinInputRoot = PinInputRoot;
184
+ exports.PinInputRootProvider = PinInputRootProvider;
185
+ Object.defineProperty(exports, 'pinInputAnatomy', {
186
+ enumerable: true,
187
+ get: function () {
188
+ return __sprawlify_primitives_machines_pin_input.anatomy;
189
+ }
190
+ });
191
+ exports.usePinInput = usePinInput;
192
+ exports.usePinInputContext = usePinInputContext;
@@ -0,0 +1,59 @@
1
+ import { t as PropTypes } from "../../normalize-props-Dw0EepzR.cjs";
2
+ import { r as Optional, t as Assign } from "../../types-DcUAwTQC.cjs";
3
+ import { r as PolymorphicProps, t as HTMLProps } from "../../factory-fcFI3pbG.cjs";
4
+ import * as react220 from "react";
5
+ import { ReactNode } from "react";
6
+ import * as pinInput from "@sprawlify/primitives/machines/pin-input";
7
+ import { InputProps, ValueChangeDetails, ValueChangeDetails as PinInputValueChangeDetails, ValueInvalidDetails, ValueInvalidDetails as PinInputValueInvalidDetails, anatomy as pinInputAnatomy } from "@sprawlify/primitives/machines/pin-input";
8
+
9
+ //#region src/components/pin-input/use-pin-input.d.ts
10
+ interface UsePinInputProps extends Optional<Omit<pinInput.Props, "dir" | "getRootNode">, "id"> {}
11
+ interface UsePinInputReturn extends pinInput.Api<PropTypes> {}
12
+ declare const usePinInput: (props?: UsePinInputProps) => UsePinInputReturn;
13
+ //#endregion
14
+ //#region src/components/pin-input/use-pin-input-context.d.ts
15
+ interface UsePinInputContext extends UsePinInputReturn {}
16
+ //#endregion
17
+ //#region src/components/pin-input/pin-input-context.d.ts
18
+ interface PinInputContextProps {
19
+ children: (context: UsePinInputContext) => ReactNode;
20
+ }
21
+ declare const PinInputContext: (props: PinInputContextProps) => ReactNode;
22
+ //#endregion
23
+ //#region src/components/pin-input/pin-input-control.d.ts
24
+ interface PinInputControlBaseProps extends PolymorphicProps {}
25
+ interface PinInputControlProps extends HTMLProps<"div">, PinInputControlBaseProps {}
26
+ declare const PinInputControl: react220.ForwardRefExoticComponent<PinInputControlProps & react220.RefAttributes<HTMLDivElement>>;
27
+ //#endregion
28
+ //#region src/components/pin-input/pin-input-hidden-input.d.ts
29
+ interface PinInputHiddenInputBaseProps extends PolymorphicProps {}
30
+ interface PinInputHiddenInputProps extends HTMLProps<"input">, PinInputHiddenInputBaseProps {}
31
+ declare const PinInputHiddenInput: react220.ForwardRefExoticComponent<PinInputHiddenInputProps & react220.RefAttributes<HTMLInputElement>>;
32
+ //#endregion
33
+ //#region src/components/pin-input/pin-input-input.d.ts
34
+ interface PinInputInputBaseProps extends InputProps, PolymorphicProps {}
35
+ interface PinInputInputProps extends HTMLProps<"input">, PinInputInputBaseProps {}
36
+ declare const PinInputInput: react220.ForwardRefExoticComponent<PinInputInputProps & react220.RefAttributes<HTMLInputElement>>;
37
+ //#endregion
38
+ //#region src/components/pin-input/pin-input-label.d.ts
39
+ interface PinInputLabelBaseProps extends PolymorphicProps {}
40
+ interface PinInputLabelProps extends HTMLProps<"label">, PinInputLabelBaseProps {}
41
+ declare const PinInputLabel: react220.ForwardRefExoticComponent<PinInputLabelProps & react220.RefAttributes<HTMLLabelElement>>;
42
+ //#endregion
43
+ //#region src/components/pin-input/pin-input-root.d.ts
44
+ interface PinInputRootBaseProps extends UsePinInputProps, PolymorphicProps {}
45
+ interface PinInputRootProps extends Assign<HTMLProps<"div">, PinInputRootBaseProps> {}
46
+ declare const PinInputRoot: react220.ForwardRefExoticComponent<PinInputRootProps & react220.RefAttributes<HTMLDivElement>>;
47
+ //#endregion
48
+ //#region src/components/pin-input/pin-input-root-provider.d.ts
49
+ interface RootProviderProps {
50
+ value: UsePinInputReturn;
51
+ }
52
+ interface PinInputRootProviderBaseProps extends RootProviderProps, PolymorphicProps {}
53
+ interface PinInputRootProviderProps extends HTMLProps<"div">, PinInputRootProviderBaseProps {}
54
+ declare const PinInputRootProvider: react220.ForwardRefExoticComponent<PinInputRootProviderProps & react220.RefAttributes<HTMLDivElement>>;
55
+ declare namespace pin_input_d_exports {
56
+ export { PinInputContext as Context, PinInputContextProps as ContextProps, PinInputControl as Control, PinInputControlBaseProps as ControlBaseProps, PinInputControlProps as ControlProps, PinInputHiddenInput as HiddenInput, PinInputHiddenInputBaseProps as HiddenInputBaseProps, PinInputHiddenInputProps as HiddenInputProps, PinInputInput as Input, PinInputInputBaseProps as InputBaseProps, PinInputInputProps as InputProps, PinInputLabel as Label, PinInputLabelBaseProps as LabelBaseProps, PinInputLabelProps as LabelProps, PinInputRoot as Root, PinInputRootBaseProps as RootBaseProps, PinInputRootProps as RootProps, PinInputRootProvider as RootProvider, PinInputRootProviderBaseProps as RootProviderBaseProps, PinInputRootProviderProps as RootProviderProps, ValueChangeDetails, ValueInvalidDetails };
57
+ }
58
+ //#endregion
59
+ export { pin_input_d_exports as PinInput, PinInputContext, type PinInputContextProps, PinInputControl, type PinInputControlBaseProps, type PinInputControlProps, PinInputHiddenInput, type PinInputHiddenInputBaseProps, type PinInputHiddenInputProps, PinInputInput, type PinInputInputBaseProps, type PinInputInputProps, PinInputLabel, type PinInputLabelBaseProps, type PinInputLabelProps, PinInputRoot, type PinInputRootBaseProps, type PinInputRootProps, PinInputRootProvider, type PinInputRootProviderBaseProps, type PinInputRootProviderProps, type PinInputValueChangeDetails, type PinInputValueInvalidDetails, type UsePinInputContext, type UsePinInputProps, type UsePinInputReturn, pinInputAnatomy, usePinInput, usePinInputContext };
@@ -0,0 +1,59 @@
1
+ import { r as PropTypes } from "../../index-BLd57Y0z.mjs";
2
+ import { r as Optional, t as Assign } from "../../types-CrwpJrFp.mjs";
3
+ import { r as PolymorphicProps, t as HTMLProps } from "../../factory-DaVlp4Ba.mjs";
4
+ import * as react228 from "react";
5
+ import { ReactNode } from "react";
6
+ import * as pinInput from "@sprawlify/primitives/machines/pin-input";
7
+ import { InputProps, ValueChangeDetails, ValueChangeDetails as PinInputValueChangeDetails, ValueInvalidDetails, ValueInvalidDetails as PinInputValueInvalidDetails, anatomy as pinInputAnatomy } from "@sprawlify/primitives/machines/pin-input";
8
+
9
+ //#region src/components/pin-input/use-pin-input.d.ts
10
+ interface UsePinInputProps extends Optional<Omit<pinInput.Props, "dir" | "getRootNode">, "id"> {}
11
+ interface UsePinInputReturn extends pinInput.Api<PropTypes> {}
12
+ declare const usePinInput: (props?: UsePinInputProps) => UsePinInputReturn;
13
+ //#endregion
14
+ //#region src/components/pin-input/use-pin-input-context.d.ts
15
+ interface UsePinInputContext extends UsePinInputReturn {}
16
+ //#endregion
17
+ //#region src/components/pin-input/pin-input-context.d.ts
18
+ interface PinInputContextProps {
19
+ children: (context: UsePinInputContext) => ReactNode;
20
+ }
21
+ declare const PinInputContext: (props: PinInputContextProps) => ReactNode;
22
+ //#endregion
23
+ //#region src/components/pin-input/pin-input-control.d.ts
24
+ interface PinInputControlBaseProps extends PolymorphicProps {}
25
+ interface PinInputControlProps extends HTMLProps<"div">, PinInputControlBaseProps {}
26
+ declare const PinInputControl: react228.ForwardRefExoticComponent<PinInputControlProps & react228.RefAttributes<HTMLDivElement>>;
27
+ //#endregion
28
+ //#region src/components/pin-input/pin-input-hidden-input.d.ts
29
+ interface PinInputHiddenInputBaseProps extends PolymorphicProps {}
30
+ interface PinInputHiddenInputProps extends HTMLProps<"input">, PinInputHiddenInputBaseProps {}
31
+ declare const PinInputHiddenInput: react228.ForwardRefExoticComponent<PinInputHiddenInputProps & react228.RefAttributes<HTMLInputElement>>;
32
+ //#endregion
33
+ //#region src/components/pin-input/pin-input-input.d.ts
34
+ interface PinInputInputBaseProps extends InputProps, PolymorphicProps {}
35
+ interface PinInputInputProps extends HTMLProps<"input">, PinInputInputBaseProps {}
36
+ declare const PinInputInput: react228.ForwardRefExoticComponent<PinInputInputProps & react228.RefAttributes<HTMLInputElement>>;
37
+ //#endregion
38
+ //#region src/components/pin-input/pin-input-label.d.ts
39
+ interface PinInputLabelBaseProps extends PolymorphicProps {}
40
+ interface PinInputLabelProps extends HTMLProps<"label">, PinInputLabelBaseProps {}
41
+ declare const PinInputLabel: react228.ForwardRefExoticComponent<PinInputLabelProps & react228.RefAttributes<HTMLLabelElement>>;
42
+ //#endregion
43
+ //#region src/components/pin-input/pin-input-root.d.ts
44
+ interface PinInputRootBaseProps extends UsePinInputProps, PolymorphicProps {}
45
+ interface PinInputRootProps extends Assign<HTMLProps<"div">, PinInputRootBaseProps> {}
46
+ declare const PinInputRoot: react228.ForwardRefExoticComponent<PinInputRootProps & react228.RefAttributes<HTMLDivElement>>;
47
+ //#endregion
48
+ //#region src/components/pin-input/pin-input-root-provider.d.ts
49
+ interface RootProviderProps {
50
+ value: UsePinInputReturn;
51
+ }
52
+ interface PinInputRootProviderBaseProps extends RootProviderProps, PolymorphicProps {}
53
+ interface PinInputRootProviderProps extends HTMLProps<"div">, PinInputRootProviderBaseProps {}
54
+ declare const PinInputRootProvider: react228.ForwardRefExoticComponent<PinInputRootProviderProps & react228.RefAttributes<HTMLDivElement>>;
55
+ declare namespace pin_input_d_exports {
56
+ export { PinInputContext as Context, PinInputContextProps as ContextProps, PinInputControl as Control, PinInputControlBaseProps as ControlBaseProps, PinInputControlProps as ControlProps, PinInputHiddenInput as HiddenInput, PinInputHiddenInputBaseProps as HiddenInputBaseProps, PinInputHiddenInputProps as HiddenInputProps, PinInputInput as Input, PinInputInputBaseProps as InputBaseProps, PinInputInputProps as InputProps, PinInputLabel as Label, PinInputLabelBaseProps as LabelBaseProps, PinInputLabelProps as LabelProps, PinInputRoot as Root, PinInputRootBaseProps as RootBaseProps, PinInputRootProps as RootProps, PinInputRootProvider as RootProvider, PinInputRootProviderBaseProps as RootProviderBaseProps, PinInputRootProviderProps as RootProviderProps, ValueChangeDetails, ValueInvalidDetails };
57
+ }
58
+ //#endregion
59
+ export { pin_input_d_exports as PinInput, PinInputContext, type PinInputContextProps, PinInputControl, type PinInputControlBaseProps, type PinInputControlProps, PinInputHiddenInput, type PinInputHiddenInputBaseProps, type PinInputHiddenInputProps, PinInputInput, type PinInputInputBaseProps, type PinInputInputProps, PinInputLabel, type PinInputLabelBaseProps, type PinInputLabelProps, PinInputRoot, type PinInputRootBaseProps, type PinInputRootProps, PinInputRootProvider, type PinInputRootProviderBaseProps, type PinInputRootProviderProps, type PinInputValueChangeDetails, type PinInputValueInvalidDetails, type UsePinInputContext, type UsePinInputProps, type UsePinInputReturn, pinInputAnatomy, usePinInput, usePinInputContext };
@@ -0,0 +1,171 @@
1
+ import { t as __export } from "../../chunk-BU8PiJgx.mjs";
2
+ import { i as useMachine, r as normalizeProps, t as mergeProps } from "../../core-79NSyZp-.mjs";
3
+ import { t as createContext$1 } from "../../create-context-DbhrVE2B.mjs";
4
+ import { n as useEnvironmentContext } from "../../environment-Cc02I6aF.mjs";
5
+ import { i as useLocaleContext } from "../../locale-D4LX0eEq.mjs";
6
+ import "../../providers-CoJceYkV.mjs";
7
+ import { n as sprawlify } from "../../factory-7ydMApfi.mjs";
8
+ import { t as createSplitProps } from "../../create-split-props-BJdRM9I_.mjs";
9
+ import "../../use-fieldset-context-6GRSrrlt.mjs";
10
+ import "../../use-safe-layout-effect-DPn_9-dD.mjs";
11
+ import { m as useFieldContext } from "../../field-BXY6su53.mjs";
12
+ import { forwardRef, useId } from "react";
13
+ import { jsx } from "react/jsx-runtime";
14
+ import * as pinInput from "@sprawlify/primitives/machines/pin-input";
15
+ import { anatomy as pinInputAnatomy } from "@sprawlify/primitives/machines/pin-input";
16
+
17
+ //#region src/components/pin-input/use-pin-input-context.ts
18
+ const [PinInputProvider, usePinInputContext] = createContext$1({
19
+ name: "PinInputContext",
20
+ hookName: "usePinInputContext",
21
+ providerName: "<PinInputProvider />"
22
+ });
23
+
24
+ //#endregion
25
+ //#region src/components/pin-input/pin-input-context.tsx
26
+ const PinInputContext = (props) => props.children(usePinInputContext());
27
+
28
+ //#endregion
29
+ //#region src/components/pin-input/pin-input-control.tsx
30
+ const PinInputControl = forwardRef((props, ref) => {
31
+ const mergedProps = mergeProps(usePinInputContext().getControlProps(), props);
32
+ return /* @__PURE__ */ jsx(sprawlify.div, {
33
+ ...mergedProps,
34
+ ref
35
+ });
36
+ });
37
+ PinInputControl.displayName = "PinInputControl";
38
+
39
+ //#endregion
40
+ //#region src/components/pin-input/pin-input-hidden-input.tsx
41
+ const PinInputHiddenInput = forwardRef((props, ref) => {
42
+ const mergedProps = mergeProps(usePinInputContext().getHiddenInputProps(), props);
43
+ const field = useFieldContext();
44
+ return /* @__PURE__ */ jsx(sprawlify.input, {
45
+ "aria-describedby": field?.ariaDescribedby,
46
+ ...mergedProps,
47
+ ref
48
+ });
49
+ });
50
+ PinInputHiddenInput.displayName = "PinInputHiddenInput";
51
+
52
+ //#endregion
53
+ //#region src/components/pin-input/pin-input-input.tsx
54
+ const splitInputProps = createSplitProps();
55
+ const PinInputInput = forwardRef((props, ref) => {
56
+ const [inputProps, localProps] = splitInputProps(props, ["index"]);
57
+ const mergedProps = mergeProps(usePinInputContext().getInputProps(inputProps), localProps);
58
+ return /* @__PURE__ */ jsx(sprawlify.input, {
59
+ ...mergedProps,
60
+ ref
61
+ });
62
+ });
63
+ PinInputInput.displayName = "PinInputInput";
64
+
65
+ //#endregion
66
+ //#region src/components/pin-input/pin-input-label.tsx
67
+ const PinInputLabel = forwardRef((props, ref) => {
68
+ const mergedProps = mergeProps(usePinInputContext().getLabelProps(), props);
69
+ return /* @__PURE__ */ jsx(sprawlify.label, {
70
+ ...mergedProps,
71
+ ref
72
+ });
73
+ });
74
+ PinInputLabel.displayName = "PinInputLabel";
75
+
76
+ //#endregion
77
+ //#region src/components/pin-input/use-pin-input.ts
78
+ const usePinInput = (props) => {
79
+ const id = useId();
80
+ const { getRootNode } = useEnvironmentContext();
81
+ const { dir } = useLocaleContext();
82
+ const field = useFieldContext();
83
+ const machineProps = {
84
+ id,
85
+ ids: {
86
+ label: field?.ids.label,
87
+ hiddenInput: field?.ids.control
88
+ },
89
+ disabled: field?.disabled,
90
+ readOnly: field?.readOnly,
91
+ required: field?.required,
92
+ invalid: field?.invalid,
93
+ dir,
94
+ getRootNode,
95
+ ...props
96
+ };
97
+ const service = useMachine(pinInput.machine, machineProps);
98
+ return pinInput.connect(service, normalizeProps);
99
+ };
100
+
101
+ //#endregion
102
+ //#region src/components/pin-input/pin-input-root.tsx
103
+ const splitRootProps = createSplitProps();
104
+ const PinInputRoot = forwardRef((props, ref) => {
105
+ const [usePinInputProps, localProps] = splitRootProps(props, [
106
+ "autoFocus",
107
+ "blurOnComplete",
108
+ "count",
109
+ "defaultValue",
110
+ "disabled",
111
+ "form",
112
+ "id",
113
+ "ids",
114
+ "invalid",
115
+ "mask",
116
+ "name",
117
+ "onValueChange",
118
+ "onValueComplete",
119
+ "onValueInvalid",
120
+ "otp",
121
+ "pattern",
122
+ "placeholder",
123
+ "readOnly",
124
+ "required",
125
+ "selectOnFocus",
126
+ "translations",
127
+ "type",
128
+ "value"
129
+ ]);
130
+ const pinInput$1 = usePinInput(usePinInputProps);
131
+ const mergedProps = mergeProps(pinInput$1.getRootProps(), localProps);
132
+ return /* @__PURE__ */ jsx(PinInputProvider, {
133
+ value: pinInput$1,
134
+ children: /* @__PURE__ */ jsx(sprawlify.div, {
135
+ ...mergedProps,
136
+ ref
137
+ })
138
+ });
139
+ });
140
+ PinInputRoot.displayName = "PinInputRoot";
141
+
142
+ //#endregion
143
+ //#region src/components/pin-input/pin-input-root-provider.tsx
144
+ const splitRootProviderProps = createSplitProps();
145
+ const PinInputRootProvider = forwardRef((props, ref) => {
146
+ const [{ value: pinInput$1 }, localProps] = splitRootProviderProps(props, ["value"]);
147
+ const mergedProps = mergeProps(pinInput$1.getRootProps(), localProps);
148
+ return /* @__PURE__ */ jsx(PinInputProvider, {
149
+ value: pinInput$1,
150
+ children: /* @__PURE__ */ jsx(sprawlify.div, {
151
+ ...mergedProps,
152
+ ref
153
+ })
154
+ });
155
+ });
156
+ PinInputRootProvider.displayName = "PinInputRootProvider";
157
+
158
+ //#endregion
159
+ //#region src/components/pin-input/pin-input.ts
160
+ var pin_input_exports = /* @__PURE__ */ __export({
161
+ Context: () => PinInputContext,
162
+ Control: () => PinInputControl,
163
+ HiddenInput: () => PinInputHiddenInput,
164
+ Input: () => PinInputInput,
165
+ Label: () => PinInputLabel,
166
+ Root: () => PinInputRoot,
167
+ RootProvider: () => PinInputRootProvider
168
+ });
169
+
170
+ //#endregion
171
+ export { pin_input_exports as PinInput, PinInputContext, PinInputControl, PinInputHiddenInput, PinInputInput, PinInputLabel, PinInputRoot, PinInputRootProvider, pinInputAnatomy, usePinInput, usePinInputContext };