@moises.ai/design-system 4.17.13 → 4.17.15

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.
@@ -1,7 +1,7 @@
1
1
  import * as a from "react";
2
2
  import j from "react";
3
- import { R as Vo, u as Te, C as _r, P as F, a as te, b as wr, T as Ir, c as se, d as Go, e as Pe, f as ne, g as B, h as Ee, i as N, A as Tr, j as Ar, k as Sr, G as xr, I as Nr, l as Pr, L as Fr, m as Or, n as ct, o as Dr, p as kr, q as Lr, S as Vr, r as Gr, s as Kr, t as $r, v as Fe, w as Br, x as pe, y as zr, z as Oe, B as Ao, D as jr, E as ie, F as Hr, H as Ur, J as Wr, K as Ko, M as $o, N as qr, O as Yr, Q as Zr, U as Bo } from "./index-Dwaw5zqT.js";
4
- import { V as Ni, W as Pi, X as Fi, Y as Oi, Z as Di, _ as ki, $ as Li, a0 as Vi, a1 as Gi, a2 as Ki, a3 as $i, a4 as Bi, a5 as zi, a6 as ji, a7 as Hi, a8 as Ui, a9 as Wi, aa as qi, ab as Yi, ac as Zi, ad as Xi, ae as Ji, af as Qi } from "./index-Dwaw5zqT.js";
3
+ import { R as Vo, u as Te, C as _r, P as F, a as te, b as wr, T as Ir, c as se, d as Go, e as Pe, f as ne, g as B, h as Ee, i as N, A as Tr, j as Ar, k as Sr, G as xr, I as Nr, l as Pr, L as Fr, m as Or, n as ct, o as Dr, p as kr, q as Lr, S as Vr, r as Gr, s as Kr, t as $r, v as Fe, w as Br, x as pe, y as zr, z as Oe, B as Ao, D as jr, E as ie, F as Hr, H as Ur, J as Wr, K as Ko, M as $o, N as qr, O as Yr, Q as Zr, U as Bo } from "./index-O6YxrN1Z.js";
4
+ import { V as Ni, W as Pi, X as Fi, Y as Oi, Z as Di, _ as ki, $ as Li, a0 as Vi, a1 as Gi, a2 as Ki, a3 as $i, a4 as Bi, a5 as zi, a6 as ji, a7 as Hi, a8 as Ui, a9 as Wi, aa as qi, ab as Yi, ac as Zi, ad as Xi, ae as Ji, af as Qi } from "./index-O6YxrN1Z.js";
5
5
  import { jsxs as je, Fragment as Ae, jsx as s } from "react/jsx-runtime";
6
6
  import Xr, { flushSync as de } from "react-dom";
7
7
  var Jr = "AccessibleIcon", lt = ({ children: e, label: t }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moises.ai/design-system",
3
- "version": "4.17.13",
3
+ "version": "4.17.15",
4
4
  "description": "Design System package based on @radix-ui/themes with custom defaults",
5
5
  "private": false,
6
6
  "type": "module",
@@ -75,6 +75,8 @@ export const SliderLibrary = forwardRef(function SliderLibrary(
75
75
  const stateRef = useRef({ value, min, max, step, disabled, onValueChange })
76
76
  stateRef.current = { value, min, max, step, disabled, onValueChange }
77
77
 
78
+ const wheelRef = useRef({ accum: 0, axis: null, lastTime: 0 })
79
+
78
80
  useEffect(() => {
79
81
  const onKey = () => {
80
82
  lastInteractionRef.current = 'keyboard'
@@ -94,15 +96,50 @@ export const SliderLibrary = forwardRef(function SliderLibrary(
94
96
  const node = internalRef.current
95
97
  if (!node) return undefined
96
98
 
99
+ const WHEEL_STEP_THRESHOLD = 24
100
+ const WHEEL_GESTURE_GAP = 150
101
+ const MOUSE_NOTCH_MIN_DELTA = 50
102
+
97
103
  const handleWheel = (event) => {
98
104
  const state = stateRef.current
99
105
  if (state.disabled) return
100
106
  event.preventDefault()
101
- const direction = event.deltaY < 0 ? 1 : -1
102
- const next = Math.min(
103
- state.max,
104
- Math.max(state.min, state.value + direction * state.step),
105
- )
107
+
108
+ const { deltaX, deltaY, deltaMode } = event
109
+ const w = wheelRef.current
110
+ const clamp = (v) => Math.min(state.max, Math.max(state.min, v))
111
+
112
+ const isMouseNotch =
113
+ deltaMode !== 0 ||
114
+ Math.max(Math.abs(deltaX), Math.abs(deltaY)) >= MOUSE_NOTCH_MIN_DELTA
115
+ if (isMouseNotch) {
116
+ w.accum = 0
117
+ w.axis = null
118
+ const primary =
119
+ Math.abs(deltaX) > Math.abs(deltaY) ? deltaX : -deltaY
120
+ if (primary === 0) return
121
+ const next = clamp(state.value + Math.sign(primary) * state.step)
122
+ if (next !== state.value) state.onValueChange?.(next)
123
+ return
124
+ }
125
+
126
+ if (event.timeStamp - w.lastTime > WHEEL_GESTURE_GAP) {
127
+ w.accum = 0
128
+ w.axis = null
129
+ }
130
+ w.lastTime = event.timeStamp
131
+
132
+ if (w.axis === null) {
133
+ if (deltaX === 0 && deltaY === 0) return
134
+ w.axis = Math.abs(deltaX) > Math.abs(deltaY) ? 'x' : 'y'
135
+ }
136
+ w.accum += w.axis === 'x' ? deltaX : -deltaY
137
+
138
+ const steps = Math.trunc(w.accum / WHEEL_STEP_THRESHOLD)
139
+ if (steps === 0) return
140
+ w.accum -= steps * WHEEL_STEP_THRESHOLD
141
+
142
+ const next = clamp(state.value + steps * state.step)
106
143
  if (next !== state.value) state.onValueChange?.(next)
107
144
  }
108
145
 
@@ -0,0 +1,11 @@
1
+ export const Sections2Icon = ({ width = 16, height = 16, className, ...props }) => (
2
+ <svg xmlns="http://www.w3.org/2000/svg" width={width} height={height} viewBox="0 0 16 16" fill="none" className={className} {...props}>
3
+ <path
4
+ d="M1.3335 10.3337H14.6668M1.3335 14.3337H14.6668M10.6668 1.66699H2.66683C1.93045 1.66699 1.3335 2.26395 1.3335 3.00033V5.00033C1.3335 5.73671 1.93045 6.33366 2.66683 6.33366H10.6668C11.4032 6.33366 12.0002 5.73671 12.0002 5.00033V3.00033C12.0002 2.26395 11.4032 1.66699 10.6668 1.66699Z"
5
+ stroke="currentColor"
6
+ strokeLinecap="round"
7
+ />
8
+ </svg>
9
+ )
10
+
11
+ Sections2Icon.displayName = 'Sections2Icon'
package/src/icons.jsx CHANGED
@@ -446,3 +446,4 @@ export { ForwardBarFillIcon } from './icons/ForwardBarFillIcon'
446
446
  export { ChordGrid3Icon } from './icons/ChordGrid3Icon'
447
447
  export { ChordDiagramGridIcon } from './icons/ChordDiagramGridIcon'
448
448
  export { DynamicMicrophone2Icon } from './icons/DynamicMicrophone2Icon'
449
+ export { Sections2Icon } from './icons/Sections2Icon'