aeon-ui-engine 1.3.1 → 1.4.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 (153) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/package.json +1 -1
  3. package/packages/cli/README.md +13 -1
  4. package/packages/cli/dist/bin.js +23 -5
  5. package/packages/cli/dist/chunk-5L47SLNV.js +247 -0
  6. package/packages/cli/dist/index.d.ts +17 -1
  7. package/packages/cli/dist/index.js +5 -3
  8. package/packages/cli/src/bin.ts +21 -3
  9. package/packages/cli/src/index.ts +1 -0
  10. package/packages/cli/src/migrate.ts +170 -0
  11. package/packages/core/dist/index.d.ts +35 -7
  12. package/packages/core/dist/index.js +102 -2
  13. package/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  14. package/packages/core/src/anatomy.ts +39 -3
  15. package/packages/core/src/identicon.test.ts +39 -0
  16. package/packages/core/src/identicon.ts +79 -0
  17. package/packages/core/src/index.ts +1 -0
  18. package/packages/panda/panda.config.ts +4 -0
  19. package/packages/panda/src/recipes/composer.ts +58 -4
  20. package/packages/panda/src/recipes/file-upload.ts +100 -0
  21. package/packages/panda/src/recipes/index.ts +2 -0
  22. package/packages/panda/src/recipes/range-slider.ts +59 -0
  23. package/packages/panda/src/recipes/thread.ts +77 -2
  24. package/packages/panda/styled-system/recipes/aeon-composer.d.ts +1 -1
  25. package/packages/panda/styled-system/recipes/aeon-composer.mjs +12 -0
  26. package/packages/panda/styled-system/recipes/aeon-file-upload.d.ts +31 -0
  27. package/packages/panda/styled-system/recipes/aeon-file-upload.mjs +61 -0
  28. package/packages/panda/styled-system/recipes/aeon-range-slider.d.ts +31 -0
  29. package/packages/panda/styled-system/recipes/aeon-range-slider.mjs +49 -0
  30. package/packages/panda/styled-system/recipes/aeon-thread.d.ts +1 -1
  31. package/packages/panda/styled-system/recipes/aeon-thread.mjs +20 -0
  32. package/packages/panda/styled-system/recipes/index.d.ts +2 -0
  33. package/packages/panda/styled-system/recipes/index.mjs +2 -0
  34. package/packages/panda/styled-system/styles.css +292 -0
  35. package/packages/primitives/dist/chunk-CV4UXXZF.js +44 -0
  36. package/packages/primitives/dist/chunk-IZKQSCYU.js +164 -0
  37. package/packages/primitives/dist/index.d.ts +2 -0
  38. package/packages/primitives/dist/index.js +22 -6
  39. package/packages/primitives/dist/machines/file-upload.d.ts +39 -0
  40. package/packages/primitives/dist/machines/file-upload.js +8 -0
  41. package/packages/primitives/dist/machines/range-slider.d.ts +129 -0
  42. package/packages/primitives/dist/machines/range-slider.js +12 -0
  43. package/packages/primitives/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  44. package/packages/primitives/src/__tests__/file-upload.test.ts +25 -0
  45. package/packages/primitives/src/__tests__/range-slider.test.ts +39 -0
  46. package/packages/primitives/src/index.ts +2 -0
  47. package/packages/primitives/src/machines/file-upload.ts +55 -0
  48. package/packages/primitives/src/machines/range-slider.ts +209 -0
  49. package/packages/react/dist/index.d.ts +117 -25
  50. package/packages/react/dist/index.js +1731 -1006
  51. package/packages/react/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  52. package/packages/react/src/button/index.tsx +50 -15
  53. package/packages/react/src/combobox/index.tsx +13 -8
  54. package/packages/react/src/composer/index.tsx +58 -3
  55. package/packages/react/src/file-upload/index.tsx +322 -0
  56. package/packages/react/src/index.ts +3 -0
  57. package/packages/react/src/prompt/index.tsx +45 -0
  58. package/packages/react/src/range-slider/index.tsx +322 -0
  59. package/packages/react/src/thread/index.tsx +74 -3
  60. package/packages/react/src/tooltip/index.tsx +48 -22
  61. package/packages/react/src/utils/slot.tsx +47 -0
  62. package/packages/schemas/dist/index.d.ts +73 -24
  63. package/packages/schemas/dist/index.js +514 -50
  64. package/packages/schemas/json/appNav.json +146 -0
  65. package/packages/schemas/json/appShell.json +151 -0
  66. package/packages/schemas/json/avatar.json +130 -0
  67. package/packages/schemas/json/bar.json +126 -0
  68. package/packages/schemas/json/button.json +6 -0
  69. package/packages/schemas/json/catalog.json +3496 -15
  70. package/packages/schemas/json/combobox.json +19 -7
  71. package/packages/schemas/json/composer.json +125 -0
  72. package/packages/schemas/json/content.json +167 -0
  73. package/packages/schemas/json/conversation.json +166 -0
  74. package/packages/schemas/json/entry.json +182 -0
  75. package/packages/schemas/json/fileUpload.json +168 -0
  76. package/packages/schemas/json/identity.json +147 -0
  77. package/packages/schemas/json/listRow.json +131 -0
  78. package/packages/schemas/json/metricStrip.json +132 -0
  79. package/packages/schemas/json/nav.json +136 -0
  80. package/packages/schemas/json/panel.json +143 -0
  81. package/packages/schemas/json/pinInput.json +112 -0
  82. package/packages/schemas/json/profileHeader.json +138 -0
  83. package/packages/schemas/json/prompt.json +155 -0
  84. package/packages/schemas/json/radioGroup.json +130 -0
  85. package/packages/schemas/json/rangeSlider.json +157 -0
  86. package/packages/schemas/json/separator.json +105 -0
  87. package/packages/schemas/json/slider.json +147 -0
  88. package/packages/schemas/json/statusBanner.json +149 -0
  89. package/packages/schemas/json/stickyBar.json +153 -0
  90. package/packages/schemas/json/thread.json +129 -0
  91. package/packages/schemas/json/tooltip.json +21 -7
  92. package/packages/schemas/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  93. package/packages/schemas/prompts/cursorrules.md +6 -4
  94. package/packages/schemas/prompts/statecharts.md +23 -2
  95. package/packages/schemas/prompts/system.md +2 -2
  96. package/packages/schemas/registry/catalog.json +313 -4
  97. package/packages/schemas/registry/components/appNav.json +146 -0
  98. package/packages/schemas/registry/components/appShell.json +151 -0
  99. package/packages/schemas/registry/components/avatar.json +130 -0
  100. package/packages/schemas/registry/components/bar.json +126 -0
  101. package/packages/schemas/registry/components/button.json +6 -0
  102. package/packages/schemas/registry/components/combobox.json +19 -7
  103. package/packages/schemas/registry/components/composer.json +125 -0
  104. package/packages/schemas/registry/components/content.json +167 -0
  105. package/packages/schemas/registry/components/conversation.json +166 -0
  106. package/packages/schemas/registry/components/entry.json +182 -0
  107. package/packages/schemas/registry/components/fileUpload.json +168 -0
  108. package/packages/schemas/registry/components/identity.json +147 -0
  109. package/packages/schemas/registry/components/listRow.json +131 -0
  110. package/packages/schemas/registry/components/metricStrip.json +132 -0
  111. package/packages/schemas/registry/components/nav.json +136 -0
  112. package/packages/schemas/registry/components/panel.json +143 -0
  113. package/packages/schemas/registry/components/pinInput.json +112 -0
  114. package/packages/schemas/registry/components/profileHeader.json +138 -0
  115. package/packages/schemas/registry/components/prompt.json +155 -0
  116. package/packages/schemas/registry/components/radioGroup.json +130 -0
  117. package/packages/schemas/registry/components/rangeSlider.json +157 -0
  118. package/packages/schemas/registry/components/separator.json +105 -0
  119. package/packages/schemas/registry/components/slider.json +147 -0
  120. package/packages/schemas/registry/components/statusBanner.json +149 -0
  121. package/packages/schemas/registry/components/stickyBar.json +153 -0
  122. package/packages/schemas/registry/components/thread.json +129 -0
  123. package/packages/schemas/registry/components/tooltip.json +21 -7
  124. package/packages/schemas/registry/machines/accordion.json +58 -0
  125. package/packages/schemas/registry/machines/appNav.json +108 -0
  126. package/packages/schemas/registry/machines/appShell.json +128 -0
  127. package/packages/schemas/registry/machines/contentRegion.json +314 -0
  128. package/packages/schemas/registry/machines/fileUpload.json +182 -0
  129. package/packages/schemas/registry/machines/panel.json +131 -0
  130. package/packages/schemas/registry/machines/popover.json +143 -0
  131. package/packages/schemas/registry/machines/rangeSlider.json +201 -0
  132. package/packages/schemas/registry/machines/slider.json +151 -0
  133. package/packages/schemas/registry/machines/stickyBar.json +261 -0
  134. package/packages/schemas/registry/machines/tabs.json +58 -0
  135. package/packages/schemas/registry/machines/toast.json +89 -0
  136. package/packages/schemas/registry/machines/toggle.json +134 -0
  137. package/packages/schemas/scripts/emit.ts +27 -0
  138. package/packages/schemas/src/components.ts +499 -6
  139. package/packages/schemas/src/index.test.ts +83 -0
  140. package/packages/schemas/src/index.ts +1 -0
  141. package/packages/schemas/src/machine-id.ts +7 -0
  142. package/packages/schemas/src/prompts.ts +25 -4
  143. package/packages/schemas/src/registry.ts +28 -39
  144. package/packages/schemas/tsconfig.json +1 -1
  145. package/packages/ui/dist/index.d.ts +100 -46
  146. package/packages/ui/dist/index.js +463 -341
  147. package/packages/ui/src/composer.tsx +37 -11
  148. package/packages/ui/src/file-upload.tsx +36 -0
  149. package/packages/ui/src/index.ts +2 -0
  150. package/packages/ui/src/prompt.tsx +3 -0
  151. package/packages/ui/src/range-slider.tsx +24 -0
  152. package/packages/ui/src/thread.tsx +40 -0
  153. package/packages/cli/dist/chunk-IW5NT2Z2.js +0 -103
@@ -1696,6 +1696,7 @@
1696
1696
  grid-template-columns: minmax(0, 1fr) auto;
1697
1697
  align-items: end;
1698
1698
  column-gap: 0.4rem;
1699
+ position: relative;
1699
1700
  width: 100%;
1700
1701
  padding-top: 0.45rem;
1701
1702
  padding-bottom: 0.75rem;
@@ -1716,6 +1717,14 @@
1716
1717
  border-top-color: var(--colors-danger);
1717
1718
  }
1718
1719
 
1720
+ .aeonComposer__root[data-aeon-state=command] {
1721
+ border-top-color: var(--colors-accent);
1722
+ }
1723
+
1724
+ .aeonComposer__root[data-aeon-state=lookup] {
1725
+ border-top-color: var(--colors-border);
1726
+ }
1727
+
1719
1728
  .aeonComposer__input {
1720
1729
  background: var(--colors-surface);
1721
1730
  font: inherit;
@@ -1763,6 +1772,53 @@
1763
1772
  height: controlMinHSm;
1764
1773
  }
1765
1774
 
1775
+ .aeonComposer__suggestions {
1776
+ margin: var(--spacing-0);
1777
+ padding: 0.25rem;
1778
+ background: var(--colors-surface);
1779
+ list-style: none;
1780
+ gap: 0.15rem;
1781
+ grid-column: 1 / -1;
1782
+ border-radius: var(--radii-lg);
1783
+ border-width: 1px;
1784
+ border-color: var(--colors-border);
1785
+ display: grid;
1786
+ order: -1;
1787
+ margin-bottom: 0.35rem;
1788
+ max-height: 10rem;
1789
+ overflow-y: auto;
1790
+ }
1791
+
1792
+ .aeonComposer__suggestion {
1793
+ background: var(--colors-transparent);
1794
+ font: inherit;
1795
+ gap: 0.5rem;
1796
+ padding-inline: 0.55rem;
1797
+ padding-block: 0.4rem;
1798
+ border-radius: var(--radii-md);
1799
+ border-width: 0;
1800
+ display: flex;
1801
+ align-items: baseline;
1802
+ text-align: left;
1803
+ color: var(--colors-fg);
1804
+ font-size: var(--font-sizes-sm);
1805
+ cursor: pointer;
1806
+ width: 100%;
1807
+ }
1808
+
1809
+ .aeonComposer__suggestion:is(:hover, [data-hover]) {
1810
+ background: var(--colors-surface-raised);
1811
+ }
1812
+
1813
+ .aeonComposer__toolbar {
1814
+ gap: 0.25rem;
1815
+ grid-column: 1 / -1;
1816
+ display: flex;
1817
+ align-items: center;
1818
+ order: -1;
1819
+ margin-bottom: 0.25rem;
1820
+ }
1821
+
1766
1822
  .aeonContent__root {
1767
1823
  gap: 1rem;
1768
1824
  flex: 1 1 auto;
@@ -2314,6 +2370,102 @@
2314
2370
  color: var(--colors-muted);
2315
2371
  }
2316
2372
 
2373
+ .aeonFileUpload__root,.aeonFileUpload__dropzone {
2374
+ gap: var(--spacing-gap-sm);
2375
+ display: flex;
2376
+ flex-direction: column;
2377
+ width: 100%;
2378
+ }
2379
+
2380
+ .aeonFileUpload__dropzone {
2381
+ background: var(--colors-surface);
2382
+ padding-inline: var(--spacing-4);
2383
+ padding-block: var(--spacing-6);
2384
+ border-width: 1px;
2385
+ border-style: dashed;
2386
+ border-color: var(--colors-border);
2387
+ border-radius: var(--radii-lg);
2388
+ align-items: center;
2389
+ justify-content: center;
2390
+ cursor: pointer;
2391
+ --transition-prop: border-color, background;
2392
+ transition-property: border-color, background;
2393
+ --transition-duration: var(--durations-fast);
2394
+ transition-duration: var(--durations-fast);
2395
+ min-height: 8rem;
2396
+ }
2397
+
2398
+ .aeonFileUpload__dropzone[data-aeon-state=dragging] {
2399
+ background: var(--colors-accent-dim);
2400
+ border-color: var(--colors-accent);
2401
+ }
2402
+
2403
+ .aeonFileUpload__dropzone[data-aeon-state=rejected] {
2404
+ border-color: var(--colors-danger);
2405
+ }
2406
+
2407
+ .aeonFileUpload__dropzone[data-disabled] {
2408
+ opacity: 0.5;
2409
+ cursor: not-allowed;
2410
+ }
2411
+
2412
+ .aeonFileUpload__dropzone:is(:focus-visible, [data-focus-visible]) {
2413
+ box-shadow: var(--shadows-focus-ring);
2414
+ }
2415
+
2416
+ .aeonFileUpload__input {
2417
+ padding: var(--spacing-0);
2418
+ margin: -1px;
2419
+ overflow: hidden;
2420
+ border-width: 0;
2421
+ position: absolute;
2422
+ clip: rect(0, 0, 0, 0);
2423
+ white-space: nowrap;
2424
+ width: 1px;
2425
+ height: 1px;
2426
+ }
2427
+
2428
+ .aeonFileUpload__label {
2429
+ font-size: var(--font-sizes-sm);
2430
+ font-family: var(--fonts-ui);
2431
+ font-weight: var(--font-weights-medium);
2432
+ color: var(--colors-fg);
2433
+ }
2434
+
2435
+ .aeonFileUpload__hint {
2436
+ font-size: var(--font-sizes-xs);
2437
+ font-family: var(--fonts-ui);
2438
+ color: var(--colors-muted);
2439
+ text-align: center;
2440
+ }
2441
+
2442
+ .aeonFileUpload__preview {
2443
+ gap: var(--spacing-gap-sm);
2444
+ font-size: var(--font-sizes-sm);
2445
+ font-family: var(--fonts-ui);
2446
+ color: var(--colors-fg);
2447
+ display: flex;
2448
+ align-items: center;
2449
+ }
2450
+
2451
+ .aeonFileUpload__clearTrigger {
2452
+ background: var(--colors-transparent);
2453
+ padding: var(--spacing-0);
2454
+ text-decoration: underline;
2455
+ border-width: 0;
2456
+ color: var(--colors-muted);
2457
+ cursor: pointer;
2458
+ }
2459
+
2460
+ .aeonFileUpload__clearTrigger,.aeonFileUpload__rejectionMessage {
2461
+ font-size: var(--font-sizes-xs);
2462
+ font-family: var(--fonts-ui);
2463
+ }
2464
+
2465
+ .aeonFileUpload__rejectionMessage {
2466
+ color: var(--colors-danger);
2467
+ }
2468
+
2317
2469
  .aeonIdentity__root {
2318
2470
  gap: 0.625rem;
2319
2471
  display: flex;
@@ -3155,6 +3307,70 @@
3155
3307
  cursor: pointer;
3156
3308
  }
3157
3309
 
3310
+ .aeonRangeSlider__root {
3311
+ gap: gapXs;
3312
+ position: relative;
3313
+ display: flex;
3314
+ flex-direction: column;
3315
+ width: 100%;
3316
+ min-width: 8rem;
3317
+ }
3318
+
3319
+ .aeonRangeSlider__track {
3320
+ background: var(--colors-surface);
3321
+ border-radius: var(--radii-full);
3322
+ border-width: 1px;
3323
+ border-style: solid;
3324
+ border-color: var(--colors-border);
3325
+ position: relative;
3326
+ cursor: pointer;
3327
+ touch-action: none;
3328
+ width: 100%;
3329
+ height: 0.5rem;
3330
+ }
3331
+
3332
+ .aeonRangeSlider__range {
3333
+ background: var(--colors-accent-dim);
3334
+ pointer-events: none;
3335
+ top: var(--spacing-0);
3336
+ height: 100%;
3337
+ }
3338
+
3339
+ .aeonRangeSlider__range,.aeonRangeSlider__thumb {
3340
+ border-radius: var(--radii-full);
3341
+ position: absolute;
3342
+ }
3343
+
3344
+ .aeonRangeSlider__thumb {
3345
+ background: var(--colors-accent);
3346
+ border-width: 2px;
3347
+ border-style: solid;
3348
+ border-color: var(--colors-surface-raised);
3349
+ transform: translate(-50%, -50%);
3350
+ cursor: grab;
3351
+ box-shadow: var(--shadows-panel);
3352
+ z-index: 1;
3353
+ top: 50%;
3354
+ width: 1.125rem;
3355
+ height: 1.125rem;
3356
+ }
3357
+
3358
+ .aeonRangeSlider__thumb[data-aeon-state=dragging] {
3359
+ cursor: grabbing;
3360
+ z-index: 2;
3361
+ }
3362
+
3363
+ .aeonRangeSlider__thumb:is(:focus-visible, [data-focus-visible]) {
3364
+ box-shadow: var(--shadows-focus-ring);
3365
+ }
3366
+
3367
+ .aeonRangeSlider__valueText {
3368
+ font-size: var(--font-sizes-xs);
3369
+ font-family: var(--fonts-ui);
3370
+ color: var(--colors-muted);
3371
+ text-align: center;
3372
+ }
3373
+
3158
3374
  .aeonScroll__root {
3159
3375
  gap: var(--spacing-gap-sm);
3160
3376
  display: flex;
@@ -3612,6 +3828,12 @@
3612
3828
  opacity: 0.9;
3613
3829
  }
3614
3830
 
3831
+ .aeonThread__item[data-aeon-state~=command-result] {
3832
+ align-self: center;
3833
+ align-items: stretch;
3834
+ max-width: 92%;
3835
+ }
3836
+
3615
3837
  .aeonThread__bubble {
3616
3838
  background: var(--colors-surface-raised);
3617
3839
  padding-inline: 0.85rem;
@@ -3658,6 +3880,76 @@
3658
3880
  text-transform: uppercase;
3659
3881
  }
3660
3882
 
3883
+ .aeonThread__bind {
3884
+ background: var(--colors-transparent);
3885
+ padding-inline: 0.55rem;
3886
+ padding-block: 0.25rem;
3887
+ border-radius: var(--radii-md);
3888
+ border-width: 1px;
3889
+ border-color: var(--colors-border);
3890
+ align-self: flex-start;
3891
+ color: var(--colors-muted);
3892
+ font-size: 0.7rem;
3893
+ cursor: pointer;
3894
+ margin-top: 0.15rem;
3895
+ min-height: 2rem;
3896
+ }
3897
+
3898
+ .aeonThread__bind:is(:hover, [data-hover]) {
3899
+ border-color: var(--colors-accent);
3900
+ color: var(--colors-fg);
3901
+ }
3902
+
3903
+ .aeonThread__card {
3904
+ background: var(--colors-surface);
3905
+ gap: 0.35rem;
3906
+ padding-inline: 0.85rem;
3907
+ padding-block: 0.7rem;
3908
+ border-radius: var(--radii-xl);
3909
+ border-width: 1px;
3910
+ border-color: var(--colors-border);
3911
+ display: grid;
3912
+ width: 100%;
3913
+ }
3914
+
3915
+ [data-aeon-state~=command-result] > .aeonThread__card {
3916
+ background: var(--colors-surface-raised);
3917
+ }
3918
+
3919
+ [data-aeon-state~=payment-card] > .aeonThread__card {
3920
+ border-color: var(--colors-accent);
3921
+ }
3922
+
3923
+ [data-aeon-state~=request-card] > .aeonThread__card {
3924
+ border-color: var(--colors-border);
3925
+ }
3926
+
3927
+ .aeonThread__cardTitle {
3928
+ gap: 0.5rem;
3929
+ display: flex;
3930
+ align-items: center;
3931
+ justify-content: space-between;
3932
+ font-size: 0.72rem;
3933
+ font-weight: 600;
3934
+ letter-spacing: 0.04em;
3935
+ text-transform: uppercase;
3936
+ color: var(--colors-muted);
3937
+ }
3938
+
3939
+ .aeonThread__cardBody {
3940
+ gap: 0.2rem;
3941
+ display: grid;
3942
+ font-size: var(--font-sizes-sm);
3943
+ color: var(--colors-fg);
3944
+ }
3945
+
3946
+ .aeonThread__cardActions {
3947
+ gap: 0.35rem;
3948
+ display: flex;
3949
+ flex-wrap: wrap;
3950
+ margin-top: 0.25rem;
3951
+ }
3952
+
3661
3953
  .aeonToast__viewport {
3662
3954
  gap: var(--spacing-gap-sm);
3663
3955
  outline: var(--borders-none);
@@ -0,0 +1,44 @@
1
+ // src/machines/file-upload.ts
2
+ import { setup } from "xstate";
3
+ var fileUploadMachine = setup({
4
+ types: {}
5
+ }).createMachine({
6
+ id: "fileUpload",
7
+ initial: "idle",
8
+ states: {
9
+ idle: {
10
+ on: {
11
+ DRAG_OVER: "dragging",
12
+ DROP_REJECT: "rejected",
13
+ RESET: "idle"
14
+ }
15
+ },
16
+ dragging: {
17
+ on: {
18
+ DRAG_OVER: "dragging",
19
+ DRAG_LEAVE: "idle",
20
+ DROP_ACCEPT: "idle",
21
+ DROP_REJECT: "rejected"
22
+ }
23
+ },
24
+ rejected: {
25
+ on: {
26
+ DRAG_OVER: "dragging",
27
+ DROP_ACCEPT: "idle",
28
+ DROP_REJECT: "rejected",
29
+ RESET: "idle"
30
+ }
31
+ }
32
+ }
33
+ });
34
+ function getFileUploadPhase(value) {
35
+ if (value === "idle" || value === "dragging" || value === "rejected") {
36
+ return value;
37
+ }
38
+ return "idle";
39
+ }
40
+
41
+ export {
42
+ fileUploadMachine,
43
+ getFileUploadPhase
44
+ };
@@ -0,0 +1,164 @@
1
+ // src/machines/range-slider.ts
2
+ import { assign, setup } from "xstate";
3
+ function clamp(value, min, max) {
4
+ return Math.min(max, Math.max(min, value));
5
+ }
6
+ function snap(value, min, max, step) {
7
+ if (step <= 0) return clamp(value, min, max);
8
+ const snapped = min + Math.round((value - min) / step) * step;
9
+ return clamp(snapped, min, max);
10
+ }
11
+ function normalizePair(raw, min, max, step, minStepsBetween) {
12
+ const gap = Math.max(0, minStepsBetween) * (step > 0 ? step : 1);
13
+ let a = snap(raw[0], min, max, step);
14
+ let b = snap(raw[1], min, max, step);
15
+ if (a > b) [a, b] = [b, a];
16
+ if (b - a < gap) {
17
+ if (a + gap <= max) b = snap(a + gap, min, max, step);
18
+ else a = snap(b - gap, min, max, step);
19
+ if (a > b) [a, b] = [b, a];
20
+ }
21
+ return [a, b];
22
+ }
23
+ function moveThumb(context, thumb, nextRaw) {
24
+ const { min, max, step, minStepsBetween, values } = context;
25
+ const gap = Math.max(0, minStepsBetween) * (step > 0 ? step : 1);
26
+ const next = snap(nextRaw, min, max, step);
27
+ if (thumb === 0) {
28
+ const maxStart = values[1] - gap;
29
+ return [clamp(next, min, maxStart), values[1]];
30
+ }
31
+ const minEnd = values[0] + gap;
32
+ return [values[0], clamp(next, minEnd, max)];
33
+ }
34
+ var rangeSliderMachine = setup({
35
+ types: {
36
+ context: {},
37
+ events: {},
38
+ input: {}
39
+ },
40
+ guards: {
41
+ notDisabled: ({ context }) => !context.disabled
42
+ },
43
+ actions: {
44
+ setValues: assign({
45
+ values: ({ context, event }) => {
46
+ if (event.type !== "SET_VALUES") return context.values;
47
+ return normalizePair(
48
+ event.values,
49
+ context.min,
50
+ context.max,
51
+ context.step,
52
+ context.minStepsBetween
53
+ );
54
+ }
55
+ }),
56
+ setBounds: assign(({ context, event }) => {
57
+ if (event.type !== "SET_BOUNDS") return {};
58
+ const next = {
59
+ min: event.min,
60
+ max: event.max,
61
+ step: event.step,
62
+ minStepsBetween: event.minStepsBetween
63
+ };
64
+ return {
65
+ ...next,
66
+ values: normalizePair(
67
+ context.values,
68
+ next.min,
69
+ next.max,
70
+ next.step,
71
+ next.minStepsBetween
72
+ )
73
+ };
74
+ }),
75
+ setDisabled: assign({
76
+ disabled: ({ context, event }) => event.type === "SET_DISABLED" ? event.disabled : context.disabled
77
+ }),
78
+ pointerDown: assign({
79
+ activeThumb: ({ event }) => event.type === "POINTER_DOWN" ? event.thumb : null
80
+ }),
81
+ pointerMove: assign({
82
+ values: ({ context, event }) => {
83
+ if (event.type !== "POINTER_MOVE" || context.activeThumb == null) {
84
+ return context.values;
85
+ }
86
+ return moveThumb(context, context.activeThumb, event.value);
87
+ }
88
+ }),
89
+ pointerUp: assign({
90
+ activeThumb: null
91
+ }),
92
+ stepThumb: assign({
93
+ values: ({ context, event }) => {
94
+ if (event.type !== "STEP") return context.values;
95
+ const current = context.values[event.thumb];
96
+ return moveThumb(context, event.thumb, current + event.delta);
97
+ }
98
+ }),
99
+ homeThumb: assign({
100
+ values: ({ context, event }) => {
101
+ if (event.type !== "HOME") return context.values;
102
+ return moveThumb(context, event.thumb, context.min);
103
+ }
104
+ }),
105
+ endThumb: assign({
106
+ values: ({ context, event }) => {
107
+ if (event.type !== "END") return context.values;
108
+ return moveThumb(context, event.thumb, context.max);
109
+ }
110
+ })
111
+ }
112
+ }).createMachine({
113
+ id: "rangeSlider",
114
+ context: ({ input }) => {
115
+ const min = input.min;
116
+ const max = input.max;
117
+ const step = input.step;
118
+ const minStepsBetween = input.minStepsBetween ?? 0;
119
+ return {
120
+ values: normalizePair(input.values, min, max, step, minStepsBetween),
121
+ min,
122
+ max,
123
+ step,
124
+ minStepsBetween,
125
+ disabled: input.disabled ?? false,
126
+ activeThumb: null
127
+ };
128
+ },
129
+ initial: "interaction",
130
+ states: {
131
+ interaction: {
132
+ initial: "idle",
133
+ states: {
134
+ idle: {
135
+ on: {
136
+ SET_VALUES: { actions: "setValues", guard: "notDisabled" },
137
+ SET_BOUNDS: { actions: "setBounds" },
138
+ SET_DISABLED: { actions: "setDisabled" },
139
+ POINTER_DOWN: { target: "dragging", actions: "pointerDown", guard: "notDisabled" },
140
+ STEP: { actions: "stepThumb", guard: "notDisabled" },
141
+ HOME: { actions: "homeThumb", guard: "notDisabled" },
142
+ END: { actions: "endThumb", guard: "notDisabled" }
143
+ }
144
+ },
145
+ dragging: {
146
+ on: {
147
+ POINTER_MOVE: { actions: "pointerMove" },
148
+ POINTER_UP: { target: "idle", actions: "pointerUp" },
149
+ SET_VALUES: { actions: "setValues" },
150
+ SET_BOUNDS: { actions: "setBounds" },
151
+ SET_DISABLED: { actions: "setDisabled" }
152
+ }
153
+ }
154
+ }
155
+ }
156
+ }
157
+ });
158
+
159
+ export {
160
+ clamp,
161
+ snap,
162
+ normalizePair,
163
+ rangeSliderMachine
164
+ };
@@ -9,6 +9,8 @@ export { FIELD_INTERACTION_STATES, FIELD_SUBMISSION_STATES, FIELD_VALIDATION_STA
9
9
  export { PopoverContext, PopoverEvent, popoverMachine } from './machines/popover.js';
10
10
  export { ToastContext, ToastEvent, toastMachine } from './machines/toast.js';
11
11
  export { SliderContext, SliderEvent, clampSliderValue, sliderMachine, snapSliderValue } from './machines/slider.js';
12
+ export { RangeSliderContext, RangeSliderEvent, RangeSliderInput, clampRangeSliderValue, normalizeRangeSliderValues, rangeSliderMachine, snapRangeSliderValue } from './machines/range-slider.js';
13
+ export { FileUploadEvent, FileUploadPhase, fileUploadMachine, getFileUploadPhase } from './machines/file-upload.js';
12
14
  export { APP_SHELL_STATES, AppShellContext, AppShellEvent, AppShellState, appShellMachine } from './machines/app-shell.js';
13
15
  export { AppNavChild, AppNavContext, AppNavEvent, appNavChild, appNavDepth, appNavMachine, appNavStateAttr } from './machines/app-nav.js';
14
16
  export { STICKY_BAR_STATES, StickyBarContext, StickyBarEvent, StickyBarState, stickyBarMachine } from './machines/sticky-bar.js';
@@ -1,15 +1,31 @@
1
+ import {
2
+ toastMachine
3
+ } from "./chunk-5S4DIRL4.js";
4
+ import {
5
+ toggleMachine
6
+ } from "./chunk-H4KOEPYC.js";
1
7
  import {
2
8
  FIELD_INTERACTION_STATES,
3
9
  FIELD_SUBMISSION_STATES,
4
10
  FIELD_VALIDATION_STATES,
5
11
  fieldMachine
6
12
  } from "./chunk-ZMGRX64G.js";
13
+ import {
14
+ fileUploadMachine,
15
+ getFileUploadPhase
16
+ } from "./chunk-CV4UXXZF.js";
7
17
  import {
8
18
  panelMachine
9
19
  } from "./chunk-V5D7LS4J.js";
10
20
  import {
11
21
  popoverMachine
12
22
  } from "./chunk-LVNCD5F2.js";
23
+ import {
24
+ clamp as clamp2,
25
+ normalizePair,
26
+ rangeSliderMachine,
27
+ snap as snap2
28
+ } from "./chunk-IZKQSCYU.js";
13
29
  import {
14
30
  clamp,
15
31
  sliderMachine,
@@ -22,12 +38,6 @@ import {
22
38
  import {
23
39
  tabsMachine
24
40
  } from "./chunk-HONROWUG.js";
25
- import {
26
- toastMachine
27
- } from "./chunk-5S4DIRL4.js";
28
- import {
29
- toggleMachine
30
- } from "./chunk-H4KOEPYC.js";
31
41
  import {
32
42
  accordionMachine
33
43
  } from "./chunk-JBAG5E6W.js";
@@ -75,15 +85,21 @@ export {
75
85
  appShellMachine,
76
86
  asyncMachine,
77
87
  buttonLifecycleMachine,
88
+ clamp2 as clampRangeSliderValue,
78
89
  clamp as clampSliderValue,
79
90
  contentRegionMachine,
80
91
  createAsyncMachine,
81
92
  dialogMachine,
82
93
  fieldMachine,
94
+ fileUploadMachine,
95
+ getFileUploadPhase,
83
96
  isEmptyAsyncData,
97
+ normalizePair as normalizeRangeSliderValues,
84
98
  panelMachine,
85
99
  popoverMachine,
100
+ rangeSliderMachine,
86
101
  sliderMachine,
102
+ snap2 as snapRangeSliderValue,
87
103
  snap as snapSliderValue,
88
104
  stickyBarMachine,
89
105
  tabsMachine,
@@ -0,0 +1,39 @@
1
+ import * as xstate from 'xstate';
2
+
3
+ type FileUploadPhase = 'idle' | 'dragging' | 'rejected';
4
+ type FileUploadEvent = {
5
+ type: 'DRAG_OVER';
6
+ } | {
7
+ type: 'DRAG_LEAVE';
8
+ } | {
9
+ type: 'DROP_ACCEPT';
10
+ } | {
11
+ type: 'DROP_REJECT';
12
+ } | {
13
+ type: 'RESET';
14
+ };
15
+ /**
16
+ * Drag-and-drop surface lifecycle. Selected file bytes stay in React
17
+ * (or parent callbacks); idle / dragging / rejected are chart-owned.
18
+ */
19
+ declare const fileUploadMachine: xstate.StateMachine<xstate.MachineContext, {
20
+ type: "DRAG_OVER";
21
+ } | {
22
+ type: "DRAG_LEAVE";
23
+ } | {
24
+ type: "DROP_ACCEPT";
25
+ } | {
26
+ type: "DROP_REJECT";
27
+ } | {
28
+ type: "RESET";
29
+ }, {}, never, never, never, never, "idle" | "dragging" | "rejected", string, xstate.NonReducibleUnknown, xstate.NonReducibleUnknown, xstate.EventObject, xstate.MetaObject, {
30
+ id: "fileUpload";
31
+ states: {
32
+ readonly idle: {};
33
+ readonly dragging: {};
34
+ readonly rejected: {};
35
+ };
36
+ }>;
37
+ declare function getFileUploadPhase(value: unknown): FileUploadPhase;
38
+
39
+ export { type FileUploadEvent, type FileUploadPhase, fileUploadMachine, getFileUploadPhase };
@@ -0,0 +1,8 @@
1
+ import {
2
+ fileUploadMachine,
3
+ getFileUploadPhase
4
+ } from "../chunk-CV4UXXZF.js";
5
+ export {
6
+ fileUploadMachine,
7
+ getFileUploadPhase
8
+ };