@vanduo-oss/framework 1.5.0 → 1.5.1

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.
@@ -45,7 +45,14 @@
45
45
  };
46
46
 
47
47
  const onKeydown = function (e) {
48
- if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight' && e.key !== 'Home' && e.key !== 'End') {
48
+ if (
49
+ e.key !== 'ArrowLeft' &&
50
+ e.key !== 'ArrowRight' &&
51
+ e.key !== 'ArrowUp' &&
52
+ e.key !== 'ArrowDown' &&
53
+ e.key !== 'Home' &&
54
+ e.key !== 'End'
55
+ ) {
49
56
  return;
50
57
  }
51
58
  const cards = getCards().filter(function (c) {
@@ -61,10 +68,15 @@
61
68
  }
62
69
  if (idx < 0) idx = 0;
63
70
 
64
- if (e.key === 'ArrowLeft') {
71
+ const isVertical = window.getComputedStyle(container).flexDirection === 'column';
72
+ if (!isVertical && (e.key === 'ArrowUp' || e.key === 'ArrowDown')) {
73
+ return;
74
+ }
75
+
76
+ if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {
65
77
  e.preventDefault();
66
78
  setActive(cards[Math.max(0, idx - 1)]);
67
- } else if (e.key === 'ArrowRight') {
79
+ } else if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {
68
80
  e.preventDefault();
69
81
  setActive(cards[Math.min(cards.length - 1, idx + 1)]);
70
82
  } else if (e.key === 'Home') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vanduo-oss/framework",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Zero-dependency CSS/JS framework built on Fibonacci/Golden Ratio design system with Open Color integration",
5
5
  "keywords": [
6
6
  "css",