@omerdlw/base-framework 1.0.5 → 2.0.0

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 (232) hide show
  1. package/dist/atoms/index.js +1 -103
  2. package/dist/atoms/index.js.map +1 -1
  3. package/dist/chunk-3BUP64Q6.js +105 -0
  4. package/dist/chunk-3BUP64Q6.js.map +1 -0
  5. package/dist/chunk-3MSK4XGK.js +9888 -0
  6. package/dist/chunk-3MSK4XGK.js.map +1 -0
  7. package/dist/chunk-4GMQKD6F.js +353 -0
  8. package/dist/chunk-4GMQKD6F.js.map +1 -0
  9. package/dist/chunk-65ZB4QTQ.js +888 -0
  10. package/dist/chunk-65ZB4QTQ.js.map +1 -0
  11. package/dist/chunk-6SG7V77J.js +577 -0
  12. package/dist/chunk-6SG7V77J.js.map +1 -0
  13. package/dist/chunk-7HQMXTNP.js +419 -0
  14. package/dist/chunk-7HQMXTNP.js.map +1 -0
  15. package/dist/chunk-7TAVYJ3A.js +371 -0
  16. package/dist/chunk-7TAVYJ3A.js.map +1 -0
  17. package/dist/chunk-AQ4BNXA2.js +349 -0
  18. package/dist/chunk-AQ4BNXA2.js.map +1 -0
  19. package/dist/chunk-CGHZSSFR.js +2166 -0
  20. package/dist/chunk-CGHZSSFR.js.map +1 -0
  21. package/dist/chunk-DGCQWQLZ.js +61 -0
  22. package/dist/chunk-DGCQWQLZ.js.map +1 -0
  23. package/dist/chunk-FIMPHODX.js +67 -0
  24. package/dist/chunk-FIMPHODX.js.map +1 -0
  25. package/dist/chunk-GF7TUX5I.js +1889 -0
  26. package/dist/chunk-GF7TUX5I.js.map +1 -0
  27. package/dist/chunk-JELG4JLT.js +454 -0
  28. package/dist/chunk-JELG4JLT.js.map +1 -0
  29. package/dist/chunk-K676GL7Z.js +51 -0
  30. package/dist/chunk-K676GL7Z.js.map +1 -0
  31. package/dist/chunk-KKQT46TP.js +26 -0
  32. package/dist/chunk-KKQT46TP.js.map +1 -0
  33. package/dist/chunk-QI3ALLIB.js +38 -0
  34. package/dist/chunk-QI3ALLIB.js.map +1 -0
  35. package/dist/chunk-QXR55VVS.js +1139 -0
  36. package/dist/chunk-QXR55VVS.js.map +1 -0
  37. package/dist/chunk-R2YGFJDJ.js +408 -0
  38. package/dist/chunk-R2YGFJDJ.js.map +1 -0
  39. package/dist/chunk-RFZQWLC5.js +27 -0
  40. package/dist/chunk-RFZQWLC5.js.map +1 -0
  41. package/dist/chunk-SYAVGTOX.js +521 -0
  42. package/dist/chunk-SYAVGTOX.js.map +1 -0
  43. package/dist/chunk-TV3WEF5G.js +784 -0
  44. package/dist/chunk-TV3WEF5G.js.map +1 -0
  45. package/dist/chunk-XASQT4CQ.js +280 -0
  46. package/dist/chunk-XASQT4CQ.js.map +1 -0
  47. package/dist/error/index.js +5 -682
  48. package/dist/error/index.js.map +1 -1
  49. package/dist/error/reporter.d.ts.map +1 -1
  50. package/dist/error/theme.d.ts +1 -1
  51. package/dist/error/theme.d.ts.map +1 -1
  52. package/dist/events.js +1 -7
  53. package/dist/events.js.map +1 -1
  54. package/dist/hooks/index.js +1 -358
  55. package/dist/hooks/index.js.map +1 -1
  56. package/dist/hooks/use-global-event.d.ts +1 -1
  57. package/dist/index.js +18 -20019
  58. package/dist/index.js.map +1 -1
  59. package/dist/kernel/index.js +2 -2035
  60. package/dist/kernel/index.js.map +1 -1
  61. package/dist/kernel/types.d.ts +1 -1
  62. package/dist/modules/ambient/analyze.d.ts +46 -0
  63. package/dist/modules/ambient/analyze.d.ts.map +1 -0
  64. package/dist/modules/ambient/constants.d.ts +1 -5
  65. package/dist/modules/ambient/constants.d.ts.map +1 -1
  66. package/dist/modules/ambient/context.d.ts.map +1 -1
  67. package/dist/modules/ambient/dom.d.ts +11 -12
  68. package/dist/modules/ambient/dom.d.ts.map +1 -1
  69. package/dist/modules/ambient/extractor.d.ts +12 -4
  70. package/dist/modules/ambient/extractor.d.ts.map +1 -1
  71. package/dist/modules/ambient/hooks.d.ts +1 -1
  72. package/dist/modules/ambient/hooks.d.ts.map +1 -1
  73. package/dist/modules/ambient/index.d.ts +6 -4
  74. package/dist/modules/ambient/index.d.ts.map +1 -1
  75. package/dist/modules/ambient/index.js +7 -753
  76. package/dist/modules/ambient/index.js.map +1 -1
  77. package/dist/modules/ambient/module.d.ts +1 -1
  78. package/dist/modules/ambient/module.d.ts.map +1 -1
  79. package/dist/modules/ambient/oklab.d.ts +36 -0
  80. package/dist/modules/ambient/oklab.d.ts.map +1 -0
  81. package/dist/modules/ambient/pipeline.d.ts +28 -0
  82. package/dist/modules/ambient/pipeline.d.ts.map +1 -0
  83. package/dist/modules/ambient/quantize.d.ts +22 -0
  84. package/dist/modules/ambient/quantize.d.ts.map +1 -0
  85. package/dist/modules/ambient/server/address.d.ts +8 -0
  86. package/dist/modules/ambient/server/address.d.ts.map +1 -0
  87. package/dist/modules/ambient/server/index.d.ts +53 -0
  88. package/dist/modules/ambient/server/index.d.ts.map +1 -0
  89. package/dist/modules/ambient/server/index.js +221 -0
  90. package/dist/modules/ambient/server/index.js.map +1 -0
  91. package/dist/modules/ambient/settings.d.ts +19 -0
  92. package/dist/modules/ambient/settings.d.ts.map +1 -0
  93. package/dist/modules/ambient/types.d.ts +105 -9
  94. package/dist/modules/ambient/types.d.ts.map +1 -1
  95. package/dist/modules/ambient/worker/index.d.ts +15 -0
  96. package/dist/modules/ambient/worker/index.d.ts.map +1 -0
  97. package/dist/modules/ambient/worker/index.js +114 -0
  98. package/dist/modules/ambient/worker/index.js.map +1 -0
  99. package/dist/modules/background/constants.d.ts +2 -2
  100. package/dist/modules/background/constants.d.ts.map +1 -1
  101. package/dist/modules/background/hooks.d.ts +1 -1
  102. package/dist/modules/background/index.js +6 -3078
  103. package/dist/modules/background/index.js.map +1 -1
  104. package/dist/modules/background/motion.d.ts +9 -7
  105. package/dist/modules/background/motion.d.ts.map +1 -1
  106. package/dist/modules/background/overlay.d.ts +3 -8
  107. package/dist/modules/background/overlay.d.ts.map +1 -1
  108. package/dist/modules/background/types.d.ts +16 -2
  109. package/dist/modules/background/types.d.ts.map +1 -1
  110. package/dist/modules/context-menu/constants.d.ts +2 -2
  111. package/dist/modules/context-menu/constants.d.ts.map +1 -1
  112. package/dist/modules/context-menu/hooks.d.ts +1 -1
  113. package/dist/modules/context-menu/index.js +10 -1896
  114. package/dist/modules/context-menu/index.js.map +1 -1
  115. package/dist/modules/context-menu/motion.d.ts +1 -8
  116. package/dist/modules/context-menu/motion.d.ts.map +1 -1
  117. package/dist/modules/context-menu/overlay.d.ts.map +1 -1
  118. package/dist/modules/context-menu/types.d.ts +16 -2
  119. package/dist/modules/context-menu/types.d.ts.map +1 -1
  120. package/dist/modules/controls/constants.d.ts +1 -1
  121. package/dist/modules/controls/constants.d.ts.map +1 -1
  122. package/dist/modules/controls/entries.d.ts +1 -1
  123. package/dist/modules/controls/hooks.d.ts +1 -1
  124. package/dist/modules/controls/index.js +4 -1110
  125. package/dist/modules/controls/index.js.map +1 -1
  126. package/dist/modules/controls/overlay.d.ts +1 -1
  127. package/dist/modules/controls/types.d.ts +2 -2
  128. package/dist/modules/dock/cards.d.ts +708 -24
  129. package/dist/modules/dock/cards.d.ts.map +1 -1
  130. package/dist/modules/dock/constants.d.ts +2 -2
  131. package/dist/modules/dock/constants.d.ts.map +1 -1
  132. package/dist/modules/dock/helpers.d.ts +2 -2
  133. package/dist/modules/dock/hooks.d.ts +2 -2
  134. package/dist/modules/dock/index.d.ts +1 -1
  135. package/dist/modules/dock/index.d.ts.map +1 -1
  136. package/dist/modules/dock/index.js +9 -12130
  137. package/dist/modules/dock/index.js.map +1 -1
  138. package/dist/modules/dock/module.d.ts +1 -1
  139. package/dist/modules/dock/motion.d.ts +41 -915
  140. package/dist/modules/dock/motion.d.ts.map +1 -1
  141. package/dist/modules/dock/overlay.d.ts.map +1 -1
  142. package/dist/modules/dock/runtime/dock.d.ts +1 -23
  143. package/dist/modules/dock/runtime/dock.d.ts.map +1 -1
  144. package/dist/modules/dock/styles.d.ts +4 -4
  145. package/dist/modules/dock/surface/context.d.ts.map +1 -1
  146. package/dist/modules/dock/surface/hooks.d.ts +10 -23
  147. package/dist/modules/dock/surface/hooks.d.ts.map +1 -1
  148. package/dist/modules/dock/surface/machine.d.ts +4 -3
  149. package/dist/modules/dock/surface/machine.d.ts.map +1 -1
  150. package/dist/modules/dock/surface/stack.d.ts.map +1 -1
  151. package/dist/modules/dock/types.d.ts +158 -3
  152. package/dist/modules/dock/types.d.ts.map +1 -1
  153. package/dist/modules/index.js +16 -17873
  154. package/dist/modules/index.js.map +1 -1
  155. package/dist/modules/loading/constants.d.ts +1 -1
  156. package/dist/modules/loading/constants.d.ts.map +1 -1
  157. package/dist/modules/loading/context.d.ts +1 -1
  158. package/dist/modules/loading/hooks.d.ts +1 -1
  159. package/dist/modules/loading/index.js +5 -1153
  160. package/dist/modules/loading/index.js.map +1 -1
  161. package/dist/modules/loading/types.d.ts +2 -2
  162. package/dist/modules/media/context.d.ts +1 -1
  163. package/dist/modules/media/index.js +3 -570
  164. package/dist/modules/media/index.js.map +1 -1
  165. package/dist/modules/media/types.d.ts +2 -2
  166. package/dist/modules/modal/constants.d.ts +2 -2
  167. package/dist/modules/modal/constants.d.ts.map +1 -1
  168. package/dist/modules/modal/context.d.ts +1 -1
  169. package/dist/modules/modal/hooks.d.ts +3 -3
  170. package/dist/modules/modal/index.js +8 -2355
  171. package/dist/modules/modal/index.js.map +1 -1
  172. package/dist/modules/modal/motion.d.ts +3 -8
  173. package/dist/modules/modal/motion.d.ts.map +1 -1
  174. package/dist/modules/modal/overlay.d.ts.map +1 -1
  175. package/dist/modules/modal/types.d.ts +21 -0
  176. package/dist/modules/modal/types.d.ts.map +1 -1
  177. package/dist/modules/notification/constants.d.ts +2 -2
  178. package/dist/modules/notification/constants.d.ts.map +1 -1
  179. package/dist/modules/notification/context.d.ts +1 -1
  180. package/dist/modules/notification/hooks.d.ts +1 -1
  181. package/dist/modules/notification/index.js +4 -828
  182. package/dist/modules/notification/index.js.map +1 -1
  183. package/dist/modules/notification/motion.d.ts +1 -7
  184. package/dist/modules/notification/motion.d.ts.map +1 -1
  185. package/dist/modules/notification/overlay.d.ts.map +1 -1
  186. package/dist/modules/notification/types.d.ts +9 -1
  187. package/dist/modules/notification/types.d.ts.map +1 -1
  188. package/dist/overlay-TZ6L52A5.js +9 -0
  189. package/dist/overlay-TZ6L52A5.js.map +1 -0
  190. package/dist/provider.d.ts +1 -1
  191. package/dist/provider.d.ts.map +1 -1
  192. package/dist/provider.js +6 -1968
  193. package/dist/provider.js.map +1 -1
  194. package/dist/result.js +2 -63
  195. package/dist/result.js.map +1 -1
  196. package/dist/theme.d.ts +45 -8
  197. package/dist/theme.d.ts.map +1 -1
  198. package/dist/theme.js +3 -41
  199. package/dist/theme.js.map +1 -1
  200. package/dist/tokens/index.d.ts +1 -0
  201. package/dist/tokens/index.d.ts.map +1 -1
  202. package/dist/tokens/index.js +126 -155
  203. package/dist/tokens/index.js.map +1 -1
  204. package/dist/tokens/motion-config.d.ts +44 -0
  205. package/dist/tokens/motion-config.d.ts.map +1 -0
  206. package/dist/tokens/motion.d.ts +23 -174
  207. package/dist/tokens/motion.d.ts.map +1 -1
  208. package/dist/utils/index.js +4 -82
  209. package/dist/utils/index.js.map +1 -1
  210. package/dist/utils/report.d.ts.map +1 -1
  211. package/docs/README.md +1 -0
  212. package/docs/architecture-and-rules.md +4 -3
  213. package/docs/core-engine.md +7 -10
  214. package/docs/getting-started.md +4 -2
  215. package/docs/modules/ambient.md +194 -80
  216. package/docs/modules/background.md +3 -3
  217. package/docs/modules/context-menu.md +2 -2
  218. package/docs/modules/dock.md +8 -5
  219. package/docs/modules/modal.md +2 -2
  220. package/docs/modules/notification.md +2 -2
  221. package/docs/theming.md +81 -9
  222. package/package.json +22 -5
  223. package/templates/AGENTS.md +1 -1
  224. package/templates/motion/background.ts +17 -0
  225. package/templates/motion/context-menu.ts +63 -0
  226. package/templates/motion/dock.ts +327 -0
  227. package/templates/motion/modal.ts +79 -0
  228. package/templates/motion/notification.ts +27 -0
  229. package/templates/motion/tokens.ts +47 -0
  230. package/templates/tsconfig.json +7 -0
  231. package/dist/modules/ambient/color.d.ts +0 -16
  232. package/dist/modules/ambient/color.d.ts.map +0 -1
@@ -0,0 +1,79 @@
1
+ import type { ModalMotion, ModalPositionMotion } from "@omerdlw/base-framework/modules/modal";
2
+ import { motion, tween } from "./tokens";
3
+
4
+ const { durations, easings, springs } = motion;
5
+
6
+ const REST = "translate3d(0, 0px, 0) scale(1)";
7
+
8
+ const surfaceEnter = tween(durations.slow, easings.enter);
9
+ const surfaceExit = tween(durations.fast, easings.exit);
10
+
11
+ // Edge sheets slide fully in from their edge.
12
+ const sheet = (offset: string): ModalPositionMotion => ({
13
+ variants: {
14
+ hidden: { opacity: 0, transform: offset },
15
+ visible: { opacity: 1, transform: REST, transition: surfaceEnter },
16
+ exit: { opacity: 0, transform: offset, transition: surfaceExit },
17
+ },
18
+ });
19
+
20
+ // A header or footer row settles a little after the dialog, from its own side.
21
+ const row = (offset: string, delay: number) => ({
22
+ hidden: { opacity: 0, transform: offset },
23
+ visible: {
24
+ opacity: 1,
25
+ transform: REST,
26
+ transition: { delay, duration: durations.base, ease: easings.enter },
27
+ },
28
+ exit: {
29
+ opacity: 0,
30
+ transform: offset,
31
+ transition: { duration: durations.micro, ease: easings.exit },
32
+ },
33
+ });
34
+
35
+ // defineTheme(modalTheme, { slots, motion: modalMotion })
36
+ export const modalMotion: ModalMotion = {
37
+ backdrop: {
38
+ hidden: { opacity: 0 },
39
+ visible: { opacity: 1, transition: tween(durations.slow, easings.enter) },
40
+ exit: { opacity: 0, transition: tween(durations.fast, easings.enter) },
41
+ },
42
+ content: {
43
+ hidden: { opacity: 0, transform: "translate3d(0px, 12px, 0) scale(0.98)" },
44
+ visible: {
45
+ opacity: 1,
46
+ transform: REST,
47
+ transition: { delay: 0.04, ...tween(durations.base, easings.enter) },
48
+ },
49
+ exit: {
50
+ opacity: 0,
51
+ transform: "translate3d(0px, 12px, 0) scale(0.98)",
52
+ transition: tween(durations.fast, easings.exit),
53
+ },
54
+ },
55
+ header: row("translate3d(0px, -6px, 0) scale(0.99)", 0.02),
56
+ footer: row("translate3d(0px, 6px, 0) scale(0.99)", 0.06),
57
+ positions: {
58
+ center: {
59
+ variants: {
60
+ hidden: { opacity: 0, transform: "translate3d(0px, 12px, 0) scale(0.95)" },
61
+ visible: {
62
+ opacity: 1,
63
+ transform: REST,
64
+ transition: { duration: durations.moderate, ease: easings.enter },
65
+ },
66
+ exit: {
67
+ opacity: 0,
68
+ transform: "translate3d(0px, 8px, 0) scale(0.96)",
69
+ transition: { duration: durations.fast, ease: easings.exit },
70
+ },
71
+ },
72
+ transition: springs.panel,
73
+ },
74
+ top: sheet("translate3d(0px, -100%, 0) scale(1)"),
75
+ right: sheet("translate3d(100%, 0px, 0) scale(1)"),
76
+ bottom: sheet("translate3d(0px, 100%, 0) scale(1)"),
77
+ left: sheet("translate3d(-100%, 0px, 0) scale(1)"),
78
+ },
79
+ };
@@ -0,0 +1,27 @@
1
+ import type { NotificationMotion } from "@omerdlw/base-framework/modules/notification";
2
+ import { motion, tween } from "./tokens";
3
+
4
+ const { durations, easings } = motion;
5
+
6
+ const enter = tween(durations.moderate, easings.emphasized);
7
+
8
+ // defineTheme(notificationTheme, { slots, motion: notificationMotion })
9
+ export const notificationMotion: NotificationMotion = {
10
+ transition: enter,
11
+ toast: {
12
+ hidden: {
13
+ opacity: 0,
14
+ transform: "translate3d(0, -10px, 0) scale(0.96)",
15
+ },
16
+ visible: {
17
+ opacity: 1,
18
+ transform: "translate3d(0, 0px, 0) scale(1)",
19
+ transition: enter,
20
+ },
21
+ exit: {
22
+ opacity: 0,
23
+ transform: "translate3d(0, -6px, 0) scale(0.98)",
24
+ transition: tween(durations.fast, easings.exit),
25
+ },
26
+ },
27
+ };
@@ -0,0 +1,47 @@
1
+ import { defineMotion } from "@omerdlw/base-framework/tokens";
2
+
3
+ // Your app's motion vocabulary. The framework ships no animation of its own:
4
+ // every module plays what your theme files give it, written with these words.
5
+ // This folder is the framework's original motion, as a starting point; copy it
6
+ // into your app (e.g. src/config/theme/motion/) and make it yours.
7
+ //
8
+ // tempo stretches everything a module animates (durations, delays, staggers,
9
+ // choreography timers, springs). Write values at tempo 1.
10
+ export const motion = defineMotion({
11
+ tempo: 1,
12
+ reducedMotion: "user",
13
+ durations: {
14
+ instant: 0.08,
15
+ micro: 0.18,
16
+ fast: 0.28,
17
+ base: 0.36,
18
+ moderate: 0.44,
19
+ slow: 0.58,
20
+ cinematic: 0.86,
21
+ },
22
+ easings: {
23
+ // How things arrive.
24
+ enter: [0.25, 1, 0.5, 1],
25
+ // Arrivals that should read as a reveal.
26
+ emphasized: [0.16, 1, 0.3, 1],
27
+ // Heavy surfaces settling.
28
+ weighted: [0.22, 1, 0.36, 1],
29
+ // A move between two resting points.
30
+ move: [0.65, 0, 0.35, 1],
31
+ // How things leave.
32
+ exit: [0.5, 0, 1, 1],
33
+ // A landing that slightly overshoots.
34
+ overshoot: [0.34, 1.56, 0.64, 1],
35
+ },
36
+ springs: {
37
+ press: { type: "spring", stiffness: 420, damping: 34, mass: 0.35 },
38
+ tap: { type: "spring", stiffness: 520, damping: 30, mass: 0.28 },
39
+ badge: { type: "spring", stiffness: 360, damping: 30, mass: 0.45 },
40
+ tooltip: { damping: 28, stiffness: 350 },
41
+ deck: { type: "spring", stiffness: 210, damping: 34, mass: 1.2 },
42
+ panel: { type: "spring", stiffness: 240, damping: 28, mass: 0.85 },
43
+ },
44
+ });
45
+
46
+ export const tween = (duration: number, ease: readonly [number, number, number, number]) =>
47
+ ({ type: "tween", duration, ease }) as const;
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "noEmit": true
5
+ },
6
+ "include": ["./**/*.ts", "../src/**/*"]
7
+ }
@@ -1,16 +0,0 @@
1
- import type { AmbientPalette, OklchColor } from "./types";
2
- export declare const COLOR_EXTRACT_CONFIG: Readonly<{
3
- readonly blackChromaFactor: 0.35;
4
- readonly primaryLightness: 0.74;
5
- readonly maxBlackChroma: 0.055;
6
- readonly blackLightness: 0.15;
7
- readonly cacheLimit: 100;
8
- readonly maxChroma: 0.28;
9
- readonly minChroma: 0.03;
10
- readonly sampleSize: 32;
11
- }>;
12
- export declare function srgbToLinear(c: number): number;
13
- export declare function rgbToOklch(r: number, g: number, b: number): OklchColor;
14
- export declare function oklchToString(l: number | string, c: number | string, h: number | string, alpha?: number | string): string;
15
- export declare function derivePalette(sampled: OklchColor): AmbientPalette;
16
- //# sourceMappingURL=color.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/modules/ambient/color.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1D,eAAO,MAAM,oBAAoB;;;;;;;;;EAStB,CAAC;AAEZ,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAG9C;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,UAAU,CAyBtE;AAED,wBAAgB,aAAa,CAC3B,CAAC,EAAE,MAAM,GAAG,MAAM,EAClB,CAAC,EAAE,MAAM,GAAG,MAAM,EAClB,CAAC,EAAE,MAAM,GAAG,MAAM,EAClB,KAAK,GAAE,MAAM,GAAG,MAAU,GACzB,MAAM,CASR;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,cAAc,CAuBjE"}