@moises.ai/design-system 3.10.8 → 3.10.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moises.ai/design-system",
3
- "version": "3.10.8",
3
+ "version": "3.10.9",
4
4
  "description": "Design System package based on @radix-ui/themes with custom defaults",
5
5
  "private": false,
6
6
  "type": "module",
@@ -36,10 +36,6 @@
36
36
  "extract": "lingui extract"
37
37
  },
38
38
  "dependencies": {
39
- "@dnd-kit/core": "^6.3.1",
40
- "@dnd-kit/modifiers": "^9.0.0",
41
- "@dnd-kit/sortable": "^10.0.0",
42
- "@dnd-kit/utilities": "^3.2.2",
43
39
  "@radix-ui/react-icons": "1.3.2",
44
40
  "@radix-ui/themes": "3.2.1",
45
41
  "@wavesurfer/react": "^1.0.11",
@@ -47,10 +43,26 @@
47
43
  "wavesurfer.js": "^7.11.1"
48
44
  },
49
45
  "peerDependencies": {
46
+ "@dnd-kit/core": "^6.3.1",
47
+ "@dnd-kit/modifiers": "^9.0.0",
48
+ "@dnd-kit/sortable": "^10.0.0",
49
+ "@dnd-kit/utilities": "^3.2.2",
50
50
  "react": "^19.0.0",
51
51
  "react-dom": "^19.0.0"
52
52
  },
53
53
  "peerDependenciesMeta": {
54
+ "@dnd-kit/core": {
55
+ "optional": false
56
+ },
57
+ "@dnd-kit/modifiers": {
58
+ "optional": false
59
+ },
60
+ "@dnd-kit/sortable": {
61
+ "optional": false
62
+ },
63
+ "@dnd-kit/utilities": {
64
+ "optional": false
65
+ },
54
66
  "react": {
55
67
  "optional": false
56
68
  },
@@ -59,6 +71,10 @@
59
71
  }
60
72
  },
61
73
  "devDependencies": {
74
+ "@dnd-kit/core": "^6.3.1",
75
+ "@dnd-kit/modifiers": "^9.0.0",
76
+ "@dnd-kit/sortable": "^10.0.0",
77
+ "@dnd-kit/utilities": "^3.2.2",
62
78
  "@lingui/cli": "^5.6.0",
63
79
  "@storybook/addon-essentials": "^8.6.14",
64
80
  "@storybook/addon-interactions": "^8.6.14",
@@ -137,6 +137,7 @@
137
137
 
138
138
  .selectColumn {
139
139
  cursor: pointer;
140
+ touch-action: manipulation;
140
141
  }
141
142
 
142
143
  .checkboxCell {
@@ -284,6 +285,7 @@
284
285
 
285
286
  .projectCell:not(.dropdownColumn) {
286
287
  cursor: pointer;
288
+ touch-action: manipulation;
287
289
  }
288
290
 
289
291
  .DataTable :global(.rt-TableRow:hover) .projectCell:not(.dropdownColumn) :not(.artistText) {
@@ -380,6 +380,7 @@ const SelectableTemplate = (args) => {
380
380
  const sortedRows = sortRows(rows, sorting)
381
381
 
382
382
  const handleClick = (row) => {
383
+ console.log('Row clicked:', row)
383
384
  alert(`Row clicked: ${row.title}`)
384
385
  }
385
386
 
@@ -29,6 +29,8 @@ export const DataTableRowSortable = React.memo(function DataTableRowSortable({
29
29
  dndScopeId,
30
30
  }) {
31
31
  const shiftClickRef = useRef(false)
32
+ const touchHandledRef = useRef(false)
33
+ const checkboxTouchHandledRef = useRef(false)
32
34
  const {
33
35
  attributes,
34
36
  listeners,
@@ -57,6 +59,10 @@ export const DataTableRowSortable = React.memo(function DataTableRowSortable({
57
59
  : sortableStyle
58
60
 
59
61
  const handleRowClick = (e) => {
62
+ if (touchHandledRef.current) {
63
+ touchHandledRef.current = false
64
+ return
65
+ }
60
66
  if (e.shiftKey) {
61
67
  e.preventDefault()
62
68
  onShiftClickRow?.(row, rowIndex)
@@ -65,6 +71,16 @@ export const DataTableRowSortable = React.memo(function DataTableRowSortable({
65
71
  }
66
72
  }
67
73
 
74
+ const handleRowPointerUp = (e) => {
75
+ if (e.pointerType !== 'touch') return
76
+ touchHandledRef.current = true
77
+ if (e.shiftKey) {
78
+ onShiftClickRow?.(row, rowIndex)
79
+ } else {
80
+ onRowClick?.(row)
81
+ }
82
+ }
83
+
68
84
  const handleCheckboxClick = (e) => {
69
85
  e.stopPropagation()
70
86
  if (e.shiftKey) {
@@ -79,6 +95,10 @@ export const DataTableRowSortable = React.memo(function DataTableRowSortable({
79
95
 
80
96
  const handleCheckboxCellClick = (e) => {
81
97
  e.stopPropagation()
98
+ if (checkboxTouchHandledRef.current) {
99
+ checkboxTouchHandledRef.current = false
100
+ return
101
+ }
82
102
  if (e.shiftKey) {
83
103
  e.preventDefault()
84
104
  onShiftClickRow?.(row, rowIndex)
@@ -87,11 +107,26 @@ export const DataTableRowSortable = React.memo(function DataTableRowSortable({
87
107
  }
88
108
  }
89
109
 
110
+ const handleCheckboxCellPointerUp = (e) => {
111
+ if (e.pointerType !== 'touch') return
112
+ e.stopPropagation()
113
+ checkboxTouchHandledRef.current = true
114
+ if (e.shiftKey) {
115
+ onShiftClickRow?.(row, rowIndex)
116
+ } else if (rowId != null) {
117
+ onSelectRow?.(rowId, !isSelected)
118
+ }
119
+ }
120
+
90
121
  const handleCheckedChange = (value) => {
91
122
  if (shiftClickRef.current) {
92
123
  shiftClickRef.current = false
93
124
  return
94
125
  }
126
+ if (checkboxTouchHandledRef.current) {
127
+ checkboxTouchHandledRef.current = false
128
+ return
129
+ }
95
130
  if (rowId != null) onSelectRow?.(rowId, value === true)
96
131
  }
97
132
 
@@ -119,6 +154,7 @@ export const DataTableRowSortable = React.memo(function DataTableRowSortable({
119
154
  data-column-id="select"
120
155
  data-sorted="false"
121
156
  onClick={handleCheckboxCellClick}
157
+ onPointerUp={handleCheckboxCellPointerUp}
122
158
  >
123
159
  <Checkbox
124
160
  size="1"
@@ -145,6 +181,7 @@ export const DataTableRowSortable = React.memo(function DataTableRowSortable({
145
181
  data-column-id={column.id}
146
182
  data-sorted={sortedKey === column.id}
147
183
  onClick={handleRowClick}
184
+ onPointerUp={handleRowPointerUp}
148
185
  >
149
186
  {index === 0 ? renderProjectCell(row) : renderDataCell(row, column, index)}
150
187
  </Table.Cell>
@@ -11,7 +11,7 @@
11
11
  margin: 0;
12
12
  padding: 0;
13
13
  list-style: none;
14
- z-index: 2000;
14
+ z-index: 9999;
15
15
  outline: none;
16
16
  }
17
17