@goliapkg/gds 0.9.9 → 1.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.
- package/README.md +90 -42
- package/dist/{gesture-BCGijGek.js → gesture-irjS0hVM.js} +3 -3
- package/dist/gesture-irjS0hVM.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/l4-molecules/category-tag.d.ts.map +1 -1
- package/dist/l4-molecules/copy-to-clipboard.d.ts.map +1 -1
- package/dist/l4-molecules/drawer.d.ts.map +1 -1
- package/dist/l4-molecules/index.js +1 -1
- package/dist/l4-molecules/popover.d.ts.map +1 -1
- package/dist/l4-molecules/sheet.d.ts.map +1 -1
- package/dist/{l4-molecules-COd1j_d8.js → l4-molecules-DXTNnybm.js} +18 -6
- package/dist/l4-molecules-DXTNnybm.js.map +1 -0
- package/dist/l5-organisms/index.js +1 -1
- package/dist/{l5-organisms-DTAGRTeh.js → l5-organisms-z8mU4eoy.js} +2 -2
- package/dist/{l5-organisms-DTAGRTeh.js.map → l5-organisms-z8mU4eoy.js.map} +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +2 -2
- package/dist/gesture-BCGijGek.js.map +0 -1
- package/dist/l4-molecules-COd1j_d8.js.map +0 -1
package/dist/utils/index.js
CHANGED
|
@@ -3,5 +3,5 @@ import { i as r, n as i, r as a, t as o } from "../motion-DUPegem-.js";
|
|
|
3
3
|
import { t as s } from "../portal-Bbl6F_Wj.js";
|
|
4
4
|
import { i as c, n as l, r as u, t as d } from "../dom-17XgfxMq.js";
|
|
5
5
|
import { a as f, i as p, n as m, o as h, r as g, s as _, t as v } from "../hooks-BE-_EmDI.js";
|
|
6
|
-
import { i as y, n as b, r as x, t as S } from "../gesture-
|
|
6
|
+
import { i as y, n as b, r as x, t as S } from "../gesture-irjS0hVM.js";
|
|
7
7
|
export { S as applyInertia, d as clamp, t as cx, a as focusCls, n as glassClass, e as glassSurface, l as isActivationKey, u as mergeRefs, o as motionClass, i as motionClassWithSpeed, s as renderPortal, r as srOnly, c as uid, v as useClickOutside, b as useDrag, m as useEscapeKey, g as useFocusTrap, p as useIsDesktop, f as useIsMobile, x as useLongPress, h as useMediaQuery, _ as useScrollLock, y as useSwipe };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goliapkg/gds",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "GOLIA Design System — enterprise-grade UI component library with contextual depth, glass materials, AI-native structure, and 10 design principles",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -110,7 +110,6 @@
|
|
|
110
110
|
"clsx": "^2.1.1",
|
|
111
111
|
"jotai": "^2.18.1",
|
|
112
112
|
"lucide-react": "^0.577.0",
|
|
113
|
-
"react-router": "^7.13.2",
|
|
114
113
|
"recharts": "^3.8.0",
|
|
115
114
|
"shiki": "^4.0.2",
|
|
116
115
|
"tailwind-merge": "^3.5.0",
|
|
@@ -118,6 +117,7 @@
|
|
|
118
117
|
},
|
|
119
118
|
"devDependencies": {
|
|
120
119
|
"@eslint/js": "^10.0.1",
|
|
120
|
+
"react-router": "^7.13.2",
|
|
121
121
|
"@tailwindcss/vite": "^4.2.2",
|
|
122
122
|
"@testing-library/jest-dom": "^6.9.1",
|
|
123
123
|
"@testing-library/react": "^16.3.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gesture-BCGijGek.js","names":[],"sources":["../src/utils/gesture.ts"],"sourcesContent":["// L-dep — gesture hooks\n// consumes L0 gesture-system thresholds\n// provides touch/pointer gesture recognition for components\n\nimport { useCallback, useRef } from 'react'\n\nimport type { GestureDirection } from '../l0-tokens/gesture-system'\nimport { drag, inertia, longPress, swipe } from '../l0-tokens/gesture-system'\n\n// shared pointer state tracked during gestures\ntype PointerState = {\n startX: number\n startY: number\n startTime: number\n currentX: number\n currentY: number\n pointerId: number\n}\n\n// === useSwipe ===\n// detects swipe gestures on an element\n// returns handlers to spread on the target element\nexport type SwipeHandler = (dir: GestureDirection, velocity: number) => void\n\nexport function useSwipe(onSwipe: SwipeHandler) {\n const stateRef = useRef<PointerState | null>(null)\n\n const onPointerDown = useCallback((e: React.PointerEvent) => {\n stateRef.current = {\n startX: e.clientX,\n startY: e.clientY,\n startTime: Date.now(),\n currentX: e.clientX,\n currentY: e.clientY,\n pointerId: e.pointerId,\n }\n ;(e.target as HTMLElement).setPointerCapture(e.pointerId)\n }, [])\n\n const onPointerMove = useCallback((e: React.PointerEvent) => {\n if (stateRef.current === null) return\n stateRef.current.currentX = e.clientX\n stateRef.current.currentY = e.clientY\n }, [])\n\n const onPointerUp = useCallback(() => {\n const s = stateRef.current\n if (s === null) return\n stateRef.current = null\n\n const dx = s.currentX - s.startX\n const dy = s.currentY - s.startY\n const dt = Math.max(1, Date.now() - s.startTime)\n const absDx = Math.abs(dx)\n const absDy = Math.abs(dy)\n\n // determine if it's a horizontal or vertical swipe\n const isHorizontal = absDx > absDy\n const distance = isHorizontal ? absDx : absDy\n const crossDeviation = isHorizontal ? absDy : absDx\n const velocity = distance / dt\n\n // must meet thresholds\n if (distance < swipe.minDistance) return\n if (velocity < swipe.minVelocity) return\n if (crossDeviation > swipe.maxCrossDeviation) return\n\n let dir: GestureDirection\n if (isHorizontal) {\n dir = dx > 0 ? 'right' : 'left'\n } else {\n dir = dy > 0 ? 'down' : 'up'\n }\n\n onSwipe(dir, velocity)\n }, [onSwipe])\n\n return { onPointerDown, onPointerMove, onPointerUp }\n}\n\n// === useLongPress ===\n// detects long press on an element\nexport function useLongPress(onLongPress: () => void) {\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n const startRef = useRef<{ x: number, y: number } | null>(null)\n\n const onPointerDown = useCallback((e: React.PointerEvent) => {\n startRef.current = { x: e.clientX, y: e.clientY }\n timerRef.current = setTimeout(() => {\n onLongPress()\n timerRef.current = null\n }, longPress.duration)\n }, [onLongPress])\n\n const onPointerMove = useCallback((e: React.PointerEvent) => {\n if (startRef.current === null || timerRef.current === null) return\n const dx = Math.abs(e.clientX - startRef.current.x)\n const dy = Math.abs(e.clientY - startRef.current.y)\n if (dx > longPress.maxMovement || dy > longPress.maxMovement) {\n clearTimeout(timerRef.current)\n timerRef.current = null\n }\n }, [])\n\n const onPointerUp = useCallback(() => {\n if (timerRef.current !== null) {\n clearTimeout(timerRef.current)\n timerRef.current = null\n }\n startRef.current = null\n }, [])\n\n return { onPointerDown, onPointerMove, onPointerUp }\n}\n\n// === useDrag ===\n// provides drag position tracking with start threshold\nexport type DragState = {\n dx: number\n dy: number\n isDragging: boolean\n}\n\nexport type DragHandler = (state: DragState) => void\n\nexport function useDrag(onDrag: DragHandler, onDragEnd?: (state: DragState) => void) {\n const stateRef = useRef<PointerState | null>(null)\n const isDragging = useRef(false)\n\n const onPointerDown = useCallback((e: React.PointerEvent) => {\n stateRef.current = {\n startX: e.clientX,\n startY: e.clientY,\n startTime: Date.now(),\n currentX: e.clientX,\n currentY: e.clientY,\n pointerId: e.pointerId,\n }\n isDragging.current = false\n ;(e.target as HTMLElement).setPointerCapture(e.pointerId)\n }, [])\n\n const onPointerMove = useCallback((e: React.PointerEvent) => {\n const s = stateRef.current\n if (s === null) return\n\n const dx = e.clientX - s.startX\n const dy = e.clientY - s.startY\n\n // start threshold — prevent accidental drag on tap\n if (!isDragging.current) {\n if (Math.abs(dx) < drag.startThreshold && Math.abs(dy) < drag.startThreshold) return\n isDragging.current = true\n }\n\n s.currentX = e.clientX\n s.currentY = e.clientY\n onDrag({ dx, dy, isDragging: true })\n }, [onDrag])\n\n const onPointerUp = useCallback(() => {\n const s = stateRef.current\n if (s === null) return\n\n const dx = s.currentX - s.startX\n const dy = s.currentY - s.startY\n\n if (isDragging.current && onDragEnd) {\n onDragEnd({ dx, dy, isDragging: false })\n }\n\n stateRef.current = null\n isDragging.current = false\n }, [onDragEnd])\n\n return { onPointerDown, onPointerMove, onPointerUp }\n}\n\n// === useInertia ===\n// applies momentum to a value after drag release\nexport function applyInertia(\n velocity: number,\n position: number,\n onFrame: (pos: number) => void,\n onEnd?: () => void,\n): () => void {\n let vel = Math.min(Math.abs(velocity), inertia.maxVelocity) * Math.sign(velocity)\n let pos = position\n let frame: number\n\n const step = () => {\n vel *= inertia.friction\n pos += vel\n\n if (Math.abs(vel) < inertia.minVelocity) {\n onFrame(pos)\n onEnd?.()\n return\n }\n\n onFrame(pos)\n frame = requestAnimationFrame(step)\n }\n\n frame = requestAnimationFrame(step)\n\n // return cancel function\n return () => cancelAnimationFrame(frame)\n}\n"],"mappings":";;;AAwBA,SAAgB,EAAS,GAAuB;CAC9C,IAAM,IAAW,EAA4B,KAAK;AAoDlD,QAAO;EAAE,eAlDa,GAAa,MAA0B;AASzD,GARF,EAAS,UAAU;IACjB,QAAQ,EAAE;IACV,QAAQ,EAAE;IACV,WAAW,KAAK,KAAK;IACrB,UAAU,EAAE;IACZ,UAAU,EAAE;IACZ,WAAW,EAAE;IACd,EACC,EAAE,OAAuB,kBAAkB,EAAE,UAAU;KACxD,EAAE,CAAC;EAwCkB,eAtCF,GAAa,MAA0B;AACvD,KAAS,YAAY,SACzB,EAAS,QAAQ,WAAW,EAAE,SAC9B,EAAS,QAAQ,WAAW,EAAE;KAC7B,EAAE,CAAC;EAkCiC,aAhCnB,QAAkB;GACpC,IAAM,IAAI,EAAS;AACnB,OAAI,MAAM,KAAM;AAChB,KAAS,UAAU;GAEnB,IAAM,IAAK,EAAE,WAAW,EAAE,QACpB,IAAK,EAAE,WAAW,EAAE,QACpB,IAAK,KAAK,IAAI,GAAG,KAAK,KAAK,GAAG,EAAE,UAAU,EAC1C,IAAQ,KAAK,IAAI,EAAG,EACpB,IAAQ,KAAK,IAAI,EAAG,EAGpB,IAAe,IAAQ,GACvB,IAAW,IAAe,IAAQ,GAClC,IAAiB,IAAe,IAAQ,GACxC,IAAW,IAAW;AAK5B,OAFI,IAAW,EAAM,eACjB,IAAW,EAAM,eACjB,IAAiB,E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