@sprawlify/primitives 0.1.5 → 0.1.7

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 (218) hide show
  1. package/dist/core-Bw_czdwX.cjs +383 -0
  2. package/dist/core-CTtbW9qh.mjs +288 -0
  3. package/dist/core.cjs +9 -1
  4. package/dist/core.d.cts +25 -2
  5. package/dist/core.d.mts +25 -2
  6. package/dist/core.mjs +2 -2
  7. package/dist/{index-BLh1IiOx.d.mts → index-fMh0VDkR.d.mts} +1 -1
  8. package/dist/machines/accordion/index.cjs +1 -1
  9. package/dist/machines/accordion/index.d.cts +1 -1
  10. package/dist/machines/accordion/index.d.mts +1 -1
  11. package/dist/machines/accordion/index.mjs +1 -1
  12. package/dist/machines/angle-slider/index.cjs +1 -1
  13. package/dist/machines/angle-slider/index.d.cts +2 -2
  14. package/dist/machines/angle-slider/index.d.mts +2 -2
  15. package/dist/machines/angle-slider/index.mjs +1 -1
  16. package/dist/machines/aspect-ratio/index.cjs +1 -1
  17. package/dist/machines/aspect-ratio/index.d.cts +1 -1
  18. package/dist/machines/aspect-ratio/index.d.mts +1 -1
  19. package/dist/machines/aspect-ratio/index.mjs +1 -1
  20. package/dist/machines/async-list/index.cjs +1 -1
  21. package/dist/machines/async-list/index.d.cts +1 -1
  22. package/dist/machines/async-list/index.d.mts +1 -1
  23. package/dist/machines/async-list/index.mjs +1 -1
  24. package/dist/machines/avatar/index.cjs +1 -1
  25. package/dist/machines/avatar/index.d.cts +1 -1
  26. package/dist/machines/avatar/index.d.mts +1 -1
  27. package/dist/machines/avatar/index.mjs +1 -1
  28. package/dist/machines/carousel/index.cjs +1 -1
  29. package/dist/machines/carousel/index.d.cts +2 -2
  30. package/dist/machines/carousel/index.d.mts +2 -2
  31. package/dist/machines/carousel/index.mjs +1 -1
  32. package/dist/machines/cascade-select/index.cjs +1 -1
  33. package/dist/machines/cascade-select/index.d.cts +3 -3
  34. package/dist/machines/cascade-select/index.d.mts +4 -4
  35. package/dist/machines/cascade-select/index.mjs +1 -1
  36. package/dist/machines/checkbox/index.cjs +1 -1
  37. package/dist/machines/checkbox/index.d.cts +2 -2
  38. package/dist/machines/checkbox/index.d.mts +2 -2
  39. package/dist/machines/checkbox/index.mjs +1 -1
  40. package/dist/machines/clipboard/index.cjs +1 -1
  41. package/dist/machines/clipboard/index.d.cts +2 -2
  42. package/dist/machines/clipboard/index.d.mts +2 -2
  43. package/dist/machines/clipboard/index.mjs +1 -1
  44. package/dist/machines/collapsible/index.cjs +1 -1
  45. package/dist/machines/collapsible/index.d.cts +2 -2
  46. package/dist/machines/collapsible/index.d.mts +2 -2
  47. package/dist/machines/collapsible/index.mjs +1 -1
  48. package/dist/machines/color-picker/index.cjs +76 -102
  49. package/dist/machines/color-picker/index.d.cts +3 -3
  50. package/dist/machines/color-picker/index.d.mts +4 -4
  51. package/dist/machines/color-picker/index.mjs +76 -102
  52. package/dist/machines/combobox/index.cjs +1 -1
  53. package/dist/machines/combobox/index.d.cts +2 -2
  54. package/dist/machines/combobox/index.d.mts +3 -3
  55. package/dist/machines/combobox/index.mjs +1 -1
  56. package/dist/machines/date-picker/index.cjs +1 -1
  57. package/dist/machines/date-picker/index.d.cts +2 -2
  58. package/dist/machines/date-picker/index.d.mts +3 -3
  59. package/dist/machines/date-picker/index.mjs +1 -1
  60. package/dist/machines/dialog/index.cjs +1 -1
  61. package/dist/machines/dialog/index.d.cts +2 -2
  62. package/dist/machines/dialog/index.d.mts +2 -2
  63. package/dist/machines/dialog/index.mjs +1 -1
  64. package/dist/machines/drawer/index.cjs +1 -1
  65. package/dist/machines/drawer/index.d.cts +2 -2
  66. package/dist/machines/drawer/index.d.mts +2 -2
  67. package/dist/machines/drawer/index.mjs +1 -1
  68. package/dist/machines/dropdown-menu/index.cjs +1 -1
  69. package/dist/machines/dropdown-menu/index.d.cts +2 -2
  70. package/dist/machines/dropdown-menu/index.d.mts +3 -3
  71. package/dist/machines/dropdown-menu/index.mjs +1 -1
  72. package/dist/machines/editable/index.cjs +1 -1
  73. package/dist/machines/editable/index.d.cts +2 -2
  74. package/dist/machines/editable/index.d.mts +2 -2
  75. package/dist/machines/editable/index.mjs +1 -1
  76. package/dist/machines/file-upload/index.cjs +1 -1
  77. package/dist/machines/file-upload/index.d.cts +2 -2
  78. package/dist/machines/file-upload/index.d.mts +2 -2
  79. package/dist/machines/file-upload/index.mjs +1 -1
  80. package/dist/machines/floating-panel/index.cjs +96 -93
  81. package/dist/machines/floating-panel/index.d.cts +3 -3
  82. package/dist/machines/floating-panel/index.d.mts +3 -3
  83. package/dist/machines/floating-panel/index.mjs +96 -93
  84. package/dist/machines/hover-card/index.cjs +1 -1
  85. package/dist/machines/hover-card/index.d.cts +1 -1
  86. package/dist/machines/hover-card/index.d.mts +2 -2
  87. package/dist/machines/hover-card/index.mjs +1 -1
  88. package/dist/machines/image-cropper/index.cjs +1 -1
  89. package/dist/machines/image-cropper/index.d.cts +1 -1
  90. package/dist/machines/image-cropper/index.d.mts +1 -1
  91. package/dist/machines/image-cropper/index.mjs +1 -1
  92. package/dist/machines/listbox/index.cjs +1 -1
  93. package/dist/machines/listbox/index.d.cts +2 -2
  94. package/dist/machines/listbox/index.d.mts +2 -2
  95. package/dist/machines/listbox/index.mjs +1 -1
  96. package/dist/machines/marquee/index.cjs +1 -1
  97. package/dist/machines/marquee/index.d.cts +4 -4
  98. package/dist/machines/marquee/index.d.mts +4 -4
  99. package/dist/machines/marquee/index.mjs +1 -1
  100. package/dist/machines/navigation-menu/index.cjs +1 -1
  101. package/dist/machines/navigation-menu/index.d.cts +2 -2
  102. package/dist/machines/navigation-menu/index.d.mts +2 -2
  103. package/dist/machines/navigation-menu/index.mjs +1 -1
  104. package/dist/machines/number-input/index.cjs +1 -1
  105. package/dist/machines/number-input/index.d.cts +2 -2
  106. package/dist/machines/number-input/index.d.mts +2 -2
  107. package/dist/machines/number-input/index.mjs +1 -1
  108. package/dist/machines/pagination/index.cjs +1 -1
  109. package/dist/machines/pagination/index.d.cts +1 -1
  110. package/dist/machines/pagination/index.d.mts +1 -1
  111. package/dist/machines/pagination/index.mjs +1 -1
  112. package/dist/machines/password-input/index.cjs +1 -1
  113. package/dist/machines/password-input/index.d.cts +2 -2
  114. package/dist/machines/password-input/index.d.mts +2 -2
  115. package/dist/machines/password-input/index.mjs +1 -1
  116. package/dist/machines/pin-input/index.cjs +1 -1
  117. package/dist/machines/pin-input/index.d.cts +2 -2
  118. package/dist/machines/pin-input/index.d.mts +2 -2
  119. package/dist/machines/pin-input/index.mjs +1 -1
  120. package/dist/machines/popover/index.cjs +2 -2
  121. package/dist/machines/popover/index.d.cts +2 -2
  122. package/dist/machines/popover/index.d.mts +3 -3
  123. package/dist/machines/popover/index.mjs +2 -2
  124. package/dist/machines/presence/index.cjs +1 -1
  125. package/dist/machines/presence/index.d.cts +1 -1
  126. package/dist/machines/presence/index.d.mts +1 -1
  127. package/dist/machines/presence/index.mjs +1 -1
  128. package/dist/machines/progress/index.cjs +1 -1
  129. package/dist/machines/progress/index.d.cts +2 -2
  130. package/dist/machines/progress/index.d.mts +2 -2
  131. package/dist/machines/progress/index.mjs +1 -1
  132. package/dist/machines/qr-code/index.cjs +1 -1
  133. package/dist/machines/qr-code/index.d.cts +1 -1
  134. package/dist/machines/qr-code/index.d.mts +1 -1
  135. package/dist/machines/qr-code/index.mjs +1 -1
  136. package/dist/machines/radio-group/index.cjs +1 -1
  137. package/dist/machines/radio-group/index.d.cts +1 -1
  138. package/dist/machines/radio-group/index.d.mts +1 -1
  139. package/dist/machines/radio-group/index.mjs +1 -1
  140. package/dist/machines/rating-group/index.cjs +1 -1
  141. package/dist/machines/rating-group/index.d.cts +2 -2
  142. package/dist/machines/rating-group/index.d.mts +2 -2
  143. package/dist/machines/rating-group/index.mjs +1 -1
  144. package/dist/machines/scroll-area/index.cjs +1 -1
  145. package/dist/machines/scroll-area/index.d.cts +1 -1
  146. package/dist/machines/scroll-area/index.d.mts +1 -1
  147. package/dist/machines/scroll-area/index.mjs +1 -1
  148. package/dist/machines/select/index.cjs +1 -1
  149. package/dist/machines/select/index.d.cts +2 -2
  150. package/dist/machines/select/index.d.mts +3 -3
  151. package/dist/machines/select/index.mjs +1 -1
  152. package/dist/machines/separator/index.cjs +1 -1
  153. package/dist/machines/separator/index.d.cts +1 -1
  154. package/dist/machines/separator/index.d.mts +1 -1
  155. package/dist/machines/separator/index.mjs +1 -1
  156. package/dist/machines/signature-pad/index.cjs +1 -1
  157. package/dist/machines/signature-pad/index.d.cts +2 -2
  158. package/dist/machines/signature-pad/index.d.mts +2 -2
  159. package/dist/machines/signature-pad/index.mjs +1 -1
  160. package/dist/machines/slider/index.cjs +1 -1
  161. package/dist/machines/slider/index.d.cts +2 -2
  162. package/dist/machines/slider/index.d.mts +2 -2
  163. package/dist/machines/slider/index.mjs +1 -1
  164. package/dist/machines/splitter/index.cjs +1 -1
  165. package/dist/machines/splitter/index.d.cts +1 -1
  166. package/dist/machines/splitter/index.d.mts +1 -1
  167. package/dist/machines/splitter/index.mjs +1 -1
  168. package/dist/machines/steps/index.cjs +1 -1
  169. package/dist/machines/steps/index.d.cts +2 -2
  170. package/dist/machines/steps/index.d.mts +2 -2
  171. package/dist/machines/steps/index.mjs +1 -1
  172. package/dist/machines/switch/index.cjs +1 -1
  173. package/dist/machines/switch/index.d.cts +2 -2
  174. package/dist/machines/switch/index.d.mts +2 -2
  175. package/dist/machines/switch/index.mjs +1 -1
  176. package/dist/machines/tabs/index.cjs +1 -1
  177. package/dist/machines/tabs/index.d.cts +2 -2
  178. package/dist/machines/tabs/index.d.mts +2 -2
  179. package/dist/machines/tabs/index.mjs +1 -1
  180. package/dist/machines/tags-input/index.cjs +1 -1
  181. package/dist/machines/tags-input/index.d.cts +2 -2
  182. package/dist/machines/tags-input/index.d.mts +2 -2
  183. package/dist/machines/tags-input/index.mjs +1 -1
  184. package/dist/machines/timer/index.cjs +1 -1
  185. package/dist/machines/timer/index.d.cts +2 -2
  186. package/dist/machines/timer/index.d.mts +2 -2
  187. package/dist/machines/timer/index.mjs +1 -1
  188. package/dist/machines/toast/index.cjs +1 -1
  189. package/dist/machines/toast/index.d.cts +2 -2
  190. package/dist/machines/toast/index.d.mts +2 -2
  191. package/dist/machines/toast/index.mjs +1 -1
  192. package/dist/machines/toggle/index.cjs +1 -1
  193. package/dist/machines/toggle/index.d.cts +1 -1
  194. package/dist/machines/toggle/index.d.mts +1 -1
  195. package/dist/machines/toggle/index.mjs +1 -1
  196. package/dist/machines/toggle-group/index.cjs +1 -1
  197. package/dist/machines/toggle-group/index.d.cts +1 -1
  198. package/dist/machines/toggle-group/index.d.mts +1 -1
  199. package/dist/machines/toggle-group/index.mjs +1 -1
  200. package/dist/machines/tooltip/index.cjs +1 -1
  201. package/dist/machines/tooltip/index.d.cts +1 -1
  202. package/dist/machines/tooltip/index.d.mts +2 -2
  203. package/dist/machines/tooltip/index.mjs +1 -1
  204. package/dist/machines/tour/index.cjs +51 -49
  205. package/dist/machines/tour/index.d.cts +3 -3
  206. package/dist/machines/tour/index.d.mts +4 -4
  207. package/dist/machines/tour/index.mjs +51 -49
  208. package/dist/machines/tree-view/index.cjs +1 -1
  209. package/dist/machines/tree-view/index.d.cts +2 -2
  210. package/dist/machines/tree-view/index.d.mts +2 -2
  211. package/dist/machines/tree-view/index.mjs +1 -1
  212. package/dist/popper.d.cts +1 -1
  213. package/dist/popper.d.mts +1 -1
  214. package/dist/{types-DUM9rzfD.d.mts → types-DvUmCWsb.d.mts} +28 -12
  215. package/dist/{types-B24gMTKq.d.cts → types-u-LWCSDE.d.cts} +28 -12
  216. package/package.json +1 -1
  217. package/dist/core-Ci9Yu6QI.mjs +0 -123
  218. package/dist/core-DwdPztGA.cjs +0 -170
@@ -1,123 +0,0 @@
1
- import { en as getActiveElement, sn as isActiveElement, tn as getDocument } from "./dom-query-BFuRs3l4.mjs";
2
- import { W as callAll, dt as isString, ft as isEqual } from "./utils-VVoZ_v29.mjs";
3
- //#region src/shared/core/merge-props.ts
4
- const clsx = (...args) => args.map((str) => str?.trim?.()).filter(Boolean).join(" ");
5
- const CSS_REGEX = /((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;
6
- const serialize = (style) => {
7
- const res = {};
8
- let match;
9
- while (match = CSS_REGEX.exec(style)) res[match[1]] = match[2];
10
- return res;
11
- };
12
- const css = (a, b) => {
13
- if (isString(a)) {
14
- if (isString(b)) return `${a};${b}`;
15
- a = serialize(a);
16
- } else if (isString(b)) b = serialize(b);
17
- return Object.assign({}, a ?? {}, b ?? {});
18
- };
19
- function mergeProps(...args) {
20
- let result = {};
21
- for (let props of args) {
22
- if (!props) continue;
23
- for (let key in result) {
24
- if (key.startsWith("on") && typeof result[key] === "function" && typeof props[key] === "function") {
25
- result[key] = callAll(props[key], result[key]);
26
- continue;
27
- }
28
- if (key === "className" || key === "class") {
29
- result[key] = clsx(result[key], props[key]);
30
- continue;
31
- }
32
- if (key === "style") {
33
- result[key] = css(result[key], props[key]);
34
- continue;
35
- }
36
- result[key] = props[key] !== void 0 ? props[key] : result[key];
37
- }
38
- for (let key in props) if (result[key] === void 0) result[key] = props[key];
39
- const symbols = Object.getOwnPropertySymbols(props);
40
- for (let symbol of symbols) result[symbol] = props[symbol];
41
- }
42
- return result;
43
- }
44
- //#endregion
45
- //#region src/shared/core/memo.ts
46
- function memo(getDeps, fn, opts) {
47
- let deps = [];
48
- let result;
49
- return (depArgs) => {
50
- const newDeps = getDeps(depArgs);
51
- if (!(newDeps.length !== deps.length || newDeps.some((dep, index) => !isEqual(deps[index], dep)))) return result;
52
- deps = newDeps;
53
- result = fn(newDeps, depArgs);
54
- opts?.onChange?.(result);
55
- return result;
56
- };
57
- }
58
- //#endregion
59
- //#region src/shared/core/create-machine.ts
60
- function createGuards() {
61
- return {
62
- and: (...guards) => {
63
- return function andGuard(params) {
64
- return guards.every((str) => params.guard(str));
65
- };
66
- },
67
- or: (...guards) => {
68
- return function orGuard(params) {
69
- return guards.some((str) => params.guard(str));
70
- };
71
- },
72
- not: (guard) => {
73
- return function notGuard(params) {
74
- return !params.guard(guard);
75
- };
76
- }
77
- };
78
- }
79
- function createMachine(config) {
80
- return config;
81
- }
82
- function setup() {
83
- return {
84
- guards: createGuards(),
85
- createMachine: (config) => {
86
- return createMachine(config);
87
- },
88
- choose: (transitions) => {
89
- return function chooseFn({ choose }) {
90
- return choose(transitions)?.actions;
91
- };
92
- }
93
- };
94
- }
95
- //#endregion
96
- //#region src/shared/core/types.ts
97
- let MachineStatus = /* @__PURE__ */ function(MachineStatus) {
98
- MachineStatus["NotStarted"] = "Not Started";
99
- MachineStatus["Started"] = "Started";
100
- MachineStatus["Stopped"] = "Stopped";
101
- return MachineStatus;
102
- }({});
103
- const INIT_STATE = "__init__";
104
- //#endregion
105
- //#region src/shared/core/scope.ts
106
- function createScope(props) {
107
- const getRootNode = () => props.getRootNode?.() ?? document;
108
- const getDoc = () => getDocument(getRootNode());
109
- const getWin = () => getDoc().defaultView ?? window;
110
- const getActiveElementFn = () => getActiveElement(getRootNode());
111
- const getById = (id) => getRootNode().getElementById(id);
112
- return {
113
- ...props,
114
- getRootNode,
115
- getDoc,
116
- getWin,
117
- getActiveElement: getActiveElementFn,
118
- isActiveElement,
119
- getById
120
- };
121
- }
122
- //#endregion
123
- export { createMachine as a, mergeProps as c, createGuards as i, INIT_STATE as n, setup as o, MachineStatus as r, memo as s, createScope as t };
@@ -1,170 +0,0 @@
1
- const require_dom_query = require("./dom-query-BUO7rGsg.cjs");
2
- const require_utils = require("./utils-ByNiZU8f.cjs");
3
- //#region src/shared/core/merge-props.ts
4
- const clsx = (...args) => args.map((str) => str?.trim?.()).filter(Boolean).join(" ");
5
- const CSS_REGEX = /((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;
6
- const serialize = (style) => {
7
- const res = {};
8
- let match;
9
- while (match = CSS_REGEX.exec(style)) res[match[1]] = match[2];
10
- return res;
11
- };
12
- const css = (a, b) => {
13
- if (require_utils.isString(a)) {
14
- if (require_utils.isString(b)) return `${a};${b}`;
15
- a = serialize(a);
16
- } else if (require_utils.isString(b)) b = serialize(b);
17
- return Object.assign({}, a ?? {}, b ?? {});
18
- };
19
- function mergeProps(...args) {
20
- let result = {};
21
- for (let props of args) {
22
- if (!props) continue;
23
- for (let key in result) {
24
- if (key.startsWith("on") && typeof result[key] === "function" && typeof props[key] === "function") {
25
- result[key] = require_utils.callAll(props[key], result[key]);
26
- continue;
27
- }
28
- if (key === "className" || key === "class") {
29
- result[key] = clsx(result[key], props[key]);
30
- continue;
31
- }
32
- if (key === "style") {
33
- result[key] = css(result[key], props[key]);
34
- continue;
35
- }
36
- result[key] = props[key] !== void 0 ? props[key] : result[key];
37
- }
38
- for (let key in props) if (result[key] === void 0) result[key] = props[key];
39
- const symbols = Object.getOwnPropertySymbols(props);
40
- for (let symbol of symbols) result[symbol] = props[symbol];
41
- }
42
- return result;
43
- }
44
- //#endregion
45
- //#region src/shared/core/memo.ts
46
- function memo(getDeps, fn, opts) {
47
- let deps = [];
48
- let result;
49
- return (depArgs) => {
50
- const newDeps = getDeps(depArgs);
51
- if (!(newDeps.length !== deps.length || newDeps.some((dep, index) => !require_utils.isEqual(deps[index], dep)))) return result;
52
- deps = newDeps;
53
- result = fn(newDeps, depArgs);
54
- opts?.onChange?.(result);
55
- return result;
56
- };
57
- }
58
- //#endregion
59
- //#region src/shared/core/create-machine.ts
60
- function createGuards() {
61
- return {
62
- and: (...guards) => {
63
- return function andGuard(params) {
64
- return guards.every((str) => params.guard(str));
65
- };
66
- },
67
- or: (...guards) => {
68
- return function orGuard(params) {
69
- return guards.some((str) => params.guard(str));
70
- };
71
- },
72
- not: (guard) => {
73
- return function notGuard(params) {
74
- return !params.guard(guard);
75
- };
76
- }
77
- };
78
- }
79
- function createMachine(config) {
80
- return config;
81
- }
82
- function setup() {
83
- return {
84
- guards: createGuards(),
85
- createMachine: (config) => {
86
- return createMachine(config);
87
- },
88
- choose: (transitions) => {
89
- return function chooseFn({ choose }) {
90
- return choose(transitions)?.actions;
91
- };
92
- }
93
- };
94
- }
95
- //#endregion
96
- //#region src/shared/core/types.ts
97
- let MachineStatus = /* @__PURE__ */ function(MachineStatus) {
98
- MachineStatus["NotStarted"] = "Not Started";
99
- MachineStatus["Started"] = "Started";
100
- MachineStatus["Stopped"] = "Stopped";
101
- return MachineStatus;
102
- }({});
103
- const INIT_STATE = "__init__";
104
- //#endregion
105
- //#region src/shared/core/scope.ts
106
- function createScope(props) {
107
- const getRootNode = () => props.getRootNode?.() ?? document;
108
- const getDoc = () => require_dom_query.getDocument(getRootNode());
109
- const getWin = () => getDoc().defaultView ?? window;
110
- const getActiveElementFn = () => require_dom_query.getActiveElement(getRootNode());
111
- const getById = (id) => getRootNode().getElementById(id);
112
- return {
113
- ...props,
114
- getRootNode,
115
- getDoc,
116
- getWin,
117
- getActiveElement: getActiveElementFn,
118
- isActiveElement: require_dom_query.isActiveElement,
119
- getById
120
- };
121
- }
122
- //#endregion
123
- Object.defineProperty(exports, "INIT_STATE", {
124
- enumerable: true,
125
- get: function() {
126
- return INIT_STATE;
127
- }
128
- });
129
- Object.defineProperty(exports, "MachineStatus", {
130
- enumerable: true,
131
- get: function() {
132
- return MachineStatus;
133
- }
134
- });
135
- Object.defineProperty(exports, "createGuards", {
136
- enumerable: true,
137
- get: function() {
138
- return createGuards;
139
- }
140
- });
141
- Object.defineProperty(exports, "createMachine", {
142
- enumerable: true,
143
- get: function() {
144
- return createMachine;
145
- }
146
- });
147
- Object.defineProperty(exports, "createScope", {
148
- enumerable: true,
149
- get: function() {
150
- return createScope;
151
- }
152
- });
153
- Object.defineProperty(exports, "memo", {
154
- enumerable: true,
155
- get: function() {
156
- return memo;
157
- }
158
- });
159
- Object.defineProperty(exports, "mergeProps", {
160
- enumerable: true,
161
- get: function() {
162
- return mergeProps;
163
- }
164
- });
165
- Object.defineProperty(exports, "setup", {
166
- enumerable: true,
167
- get: function() {
168
- return setup;
169
- }
170
- });