@multiplatform.one/components 9.0.1 → 9.0.2

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 (108) hide show
  1. package/dist/cjs/DropdownMenu/index.cjs +44 -25
  2. package/dist/cjs/DropdownMenu/index.native.js +42 -21
  3. package/dist/cjs/DropdownMenu/index.native.js.map +1 -1
  4. package/dist/cjs/SheetModal/index.cjs +4 -3
  5. package/dist/cjs/appShell/AppShell.cjs +17 -12
  6. package/dist/cjs/appShell/AppShell.native.js +17 -12
  7. package/dist/cjs/appShell/AppShell.native.js.map +1 -1
  8. package/dist/cjs/code/PayloadView/index.cjs +4 -1
  9. package/dist/cjs/code/PayloadView/index.native.js +4 -1
  10. package/dist/cjs/code/PayloadView/index.native.js.map +1 -1
  11. package/dist/cjs/images/RemoteArt/index.native.js +3 -1
  12. package/dist/cjs/images/RemoteArt/index.native.js.map +1 -1
  13. package/dist/cjs/layouts/AsyncBoundary.cjs +9 -8
  14. package/dist/cjs/layouts/AsyncBoundary.native.js +9 -8
  15. package/dist/cjs/layouts/AsyncBoundary.native.js.map +1 -1
  16. package/dist/cjs/views/Dashboard.cjs +5 -1
  17. package/dist/cjs/views/Dashboard.native.js +3 -1
  18. package/dist/cjs/views/Dashboard.native.js.map +1 -1
  19. package/dist/cjs/views/ListGroup.cjs +2 -2
  20. package/dist/cjs/views/ListGroup.native.js +8 -6
  21. package/dist/cjs/views/ListGroup.native.js.map +1 -1
  22. package/dist/cjs/views/ListRow.cjs +2 -1
  23. package/dist/cjs/views/ListRow.native.js +2 -1
  24. package/dist/cjs/views/ListRow.native.js.map +1 -1
  25. package/dist/esm/DropdownMenu/index.mjs +44 -25
  26. package/dist/esm/DropdownMenu/index.mjs.map +1 -1
  27. package/dist/esm/DropdownMenu/index.native.js +42 -21
  28. package/dist/esm/DropdownMenu/index.native.js.map +1 -1
  29. package/dist/esm/SheetModal/index.mjs +4 -3
  30. package/dist/esm/SheetModal/index.mjs.map +1 -1
  31. package/dist/esm/appShell/AppShell.mjs +17 -12
  32. package/dist/esm/appShell/AppShell.mjs.map +1 -1
  33. package/dist/esm/appShell/AppShell.native.js +17 -12
  34. package/dist/esm/appShell/AppShell.native.js.map +1 -1
  35. package/dist/esm/code/PayloadView/index.mjs +4 -1
  36. package/dist/esm/code/PayloadView/index.mjs.map +1 -1
  37. package/dist/esm/code/PayloadView/index.native.js +4 -1
  38. package/dist/esm/code/PayloadView/index.native.js.map +1 -1
  39. package/dist/esm/images/RemoteArt/index.native.js +3 -1
  40. package/dist/esm/images/RemoteArt/index.native.js.map +1 -1
  41. package/dist/esm/layouts/AsyncBoundary.mjs +9 -8
  42. package/dist/esm/layouts/AsyncBoundary.mjs.map +1 -1
  43. package/dist/esm/layouts/AsyncBoundary.native.js +9 -8
  44. package/dist/esm/layouts/AsyncBoundary.native.js.map +1 -1
  45. package/dist/esm/views/Dashboard.mjs +5 -1
  46. package/dist/esm/views/Dashboard.mjs.map +1 -1
  47. package/dist/esm/views/Dashboard.native.js +3 -1
  48. package/dist/esm/views/Dashboard.native.js.map +1 -1
  49. package/dist/esm/views/ListGroup.mjs +3 -3
  50. package/dist/esm/views/ListGroup.mjs.map +1 -1
  51. package/dist/esm/views/ListGroup.native.js +9 -7
  52. package/dist/esm/views/ListGroup.native.js.map +1 -1
  53. package/dist/esm/views/ListRow.mjs +2 -1
  54. package/dist/esm/views/ListRow.mjs.map +1 -1
  55. package/dist/esm/views/ListRow.native.js +2 -1
  56. package/dist/esm/views/ListRow.native.js.map +1 -1
  57. package/dist/jsx/DropdownMenu/index.mjs +44 -25
  58. package/dist/jsx/DropdownMenu/index.mjs.map +1 -1
  59. package/dist/jsx/DropdownMenu/index.native.js +42 -21
  60. package/dist/jsx/DropdownMenu/index.native.js.map +1 -1
  61. package/dist/jsx/SheetModal/index.mjs +4 -3
  62. package/dist/jsx/SheetModal/index.mjs.map +1 -1
  63. package/dist/jsx/appShell/AppShell.mjs +17 -12
  64. package/dist/jsx/appShell/AppShell.mjs.map +1 -1
  65. package/dist/jsx/appShell/AppShell.native.js +17 -12
  66. package/dist/jsx/appShell/AppShell.native.js.map +1 -1
  67. package/dist/jsx/code/PayloadView/index.mjs +4 -1
  68. package/dist/jsx/code/PayloadView/index.mjs.map +1 -1
  69. package/dist/jsx/code/PayloadView/index.native.js +4 -1
  70. package/dist/jsx/code/PayloadView/index.native.js.map +1 -1
  71. package/dist/jsx/images/RemoteArt/index.native.js +3 -1
  72. package/dist/jsx/images/RemoteArt/index.native.js.map +1 -1
  73. package/dist/jsx/layouts/AsyncBoundary.mjs +9 -8
  74. package/dist/jsx/layouts/AsyncBoundary.mjs.map +1 -1
  75. package/dist/jsx/layouts/AsyncBoundary.native.js +9 -8
  76. package/dist/jsx/layouts/AsyncBoundary.native.js.map +1 -1
  77. package/dist/jsx/views/Dashboard.mjs +5 -1
  78. package/dist/jsx/views/Dashboard.mjs.map +1 -1
  79. package/dist/jsx/views/Dashboard.native.js +3 -1
  80. package/dist/jsx/views/Dashboard.native.js.map +1 -1
  81. package/dist/jsx/views/ListGroup.mjs +3 -3
  82. package/dist/jsx/views/ListGroup.mjs.map +1 -1
  83. package/dist/jsx/views/ListGroup.native.js +8 -6
  84. package/dist/jsx/views/ListGroup.native.js.map +1 -1
  85. package/dist/jsx/views/ListRow.mjs +2 -1
  86. package/dist/jsx/views/ListRow.mjs.map +1 -1
  87. package/dist/jsx/views/ListRow.native.js +2 -1
  88. package/dist/jsx/views/ListRow.native.js.map +1 -1
  89. package/package.json +7 -7
  90. package/src/DropdownMenu/index.tsx +39 -26
  91. package/src/SheetModal/index.tsx +2 -1
  92. package/src/SwipeDismissRow/SwipeDismissRow.stories.tsx +2 -1
  93. package/src/appShell/AppShell.stories.tsx +8 -11
  94. package/src/appShell/AppShell.tsx +8 -6
  95. package/src/code/PayloadView/index.tsx +4 -2
  96. package/src/images/RemoteArt/index.native.tsx +1 -1
  97. package/src/layouts/AsyncBoundary.tsx +9 -5
  98. package/src/views/Dashboard.tsx +5 -9
  99. package/src/views/ListGroup.stories.tsx +1 -1
  100. package/src/views/ListGroup.tsx +13 -2
  101. package/src/views/ListRow.tsx +2 -1
  102. package/types/DropdownMenu/index.d.ts.map +1 -1
  103. package/types/SheetModal/index.d.ts.map +1 -1
  104. package/types/appShell/AppShell.d.ts.map +1 -1
  105. package/types/layouts/AsyncBoundary.d.ts.map +1 -1
  106. package/types/views/Dashboard.d.ts.map +1 -1
  107. package/types/views/ListGroup.d.ts.map +1 -1
  108. package/types/views/ListRow.d.ts.map +1 -1
@@ -163,28 +163,40 @@ function decorateTrigger(trigger, open, onArrow) {
163
163
  });
164
164
  }
165
165
  function renderEntries(items) {
166
- return items.map((entry, index) => "separator" in entry && entry.separator ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuSeparator, {}, `separator-${index}`) : entry.items ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(DropdownMenuSub, {
167
- stayOnPick: entry.stayOnPick,
168
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuSubTrigger, {
166
+ return items.map((entry, index) => renderEntry(entry, index));
167
+ }
168
+ function renderEntry(entry, index) {
169
+ if ("separator" in entry && entry.separator) {
170
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuSeparator, {}, `separator-${index}`);
171
+ }
172
+ if (entry.items) {
173
+ return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(DropdownMenuSub, {
174
+ stayOnPick: entry.stayOnPick,
175
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuSubTrigger, {
176
+ icon: entry.icon,
177
+ value: entry.value,
178
+ disabled: entry.disabled,
179
+ disabledReason: entry.disabledReason,
180
+ children: entry.label
181
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuSubContent, {
182
+ children: renderEntries(entry.items)
183
+ })]
184
+ }, entry.key ?? index);
185
+ }
186
+ if ("checked" in entry && entry.checked !== void 0) {
187
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuCheckboxItem, {
188
+ checked: entry.checked,
169
189
  icon: entry.icon,
170
- value: entry.value,
190
+ onCheckedChange: entry.onCheckedChange,
191
+ onSelect: entry.onSelect,
192
+ closeOnSelect: entry.closeOnSelect,
171
193
  disabled: entry.disabled,
172
194
  disabledReason: entry.disabledReason,
195
+ shortcut: entry.shortcut,
173
196
  children: entry.label
174
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuSubContent, {
175
- children: renderEntries(entry.items)
176
- })]
177
- }, entry.key ?? index) : "checked" in entry && entry.checked !== void 0 ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuCheckboxItem, {
178
- checked: entry.checked,
179
- icon: entry.icon,
180
- onCheckedChange: entry.onCheckedChange,
181
- onSelect: entry.onSelect,
182
- closeOnSelect: entry.closeOnSelect,
183
- disabled: entry.disabled,
184
- disabledReason: entry.disabledReason,
185
- shortcut: entry.shortcut,
186
- children: entry.label
187
- }, entry.key ?? index) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuItem, {
197
+ }, entry.key ?? index);
198
+ }
199
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuItem, {
188
200
  icon: entry.icon,
189
201
  shortcut: entry.shortcut,
190
202
  disabled: entry.disabled,
@@ -193,7 +205,7 @@ function renderEntries(items) {
193
205
  closeOnSelect: entry.closeOnSelect,
194
206
  onSelect: entry.onSelect,
195
207
  children: entry.label
196
- }, entry.key ?? index));
208
+ }, entry.key ?? index);
197
209
  }
198
210
  function DropdownMenuRoot({
199
211
  children,
@@ -368,6 +380,14 @@ function DropdownMenuContent({
368
380
  children
369
381
  });
370
382
  }
383
+ function menuLabel(levelTitle, ariaLabel) {
384
+ if (levelTitle) return {
385
+ "aria-label": levelTitle
386
+ };
387
+ return ariaLabel ? {
388
+ "aria-label": ariaLabel
389
+ } : {};
390
+ }
371
391
  function DropdownMenuList({
372
392
  children,
373
393
  maxHeight,
@@ -503,11 +523,7 @@ function DropdownMenuList({
503
523
  children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
504
524
  ref: innerRef,
505
525
  role: "menu",
506
- ...(levelTitle ? {
507
- "aria-label": levelTitle
508
- } : ariaLabel ? {
509
- "aria-label": ariaLabel
510
- } : {}),
526
+ ...menuLabel(levelTitle, ariaLabel),
511
527
  "data-dismiss-class": "commit",
512
528
  "data-mp-width-mode": "at-least-trigger",
513
529
  width: "100%",
@@ -797,6 +813,9 @@ function subTitle(children) {
797
813
  }
798
814
  return null;
799
815
  }
816
+ function levelFace(ctx, id) {
817
+ return ctx.levels.some(level => level.id === id) ? "level" : null;
818
+ }
800
819
  function DropdownMenuSub({
801
820
  children,
802
821
  stayOnPick = false
@@ -806,7 +825,7 @@ function DropdownMenuSub({
806
825
  const id = (0, import_react2.useId)();
807
826
  const title = subTitle(children);
808
827
  const active = activeLevelId(ctx);
809
- const face = active === owner ? "trigger" : ctx.levels.some(level => level.id === id) ? "level" : null;
828
+ const face = active === owner ? "trigger" : levelFace(ctx, id);
810
829
  const sub = (0, import_react2.useMemo)(() => face ? {
811
830
  id,
812
831
  title,
@@ -169,8 +169,17 @@ function decorateTrigger(trigger, open, onArrow) {
169
169
  }
170
170
  function renderEntries(items) {
171
171
  return items.map(function (entry, index) {
172
- var _entry_key, _entry_key1, _entry_key2;
173
- return "separator" in entry && entry.separator ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuSeparator, {}, `separator-${index}`) : entry.items ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(DropdownMenuSub, {
172
+ return renderEntry(entry, index);
173
+ });
174
+ }
175
+ function renderEntry(entry, index) {
176
+ var _entry_key;
177
+ if ("separator" in entry && entry.separator) {
178
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuSeparator, {}, `separator-${index}`);
179
+ }
180
+ if (entry.items) {
181
+ var _entry_key1;
182
+ return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(DropdownMenuSub, {
174
183
  stayOnPick: entry.stayOnPick,
175
184
  children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuSubTrigger, {
176
185
  icon: entry.icon,
@@ -181,7 +190,11 @@ function renderEntries(items) {
181
190
  }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuSubContent, {
182
191
  children: renderEntries(entry.items)
183
192
  })]
184
- }, (_entry_key = entry.key) !== null && _entry_key !== void 0 ? _entry_key : index) : "checked" in entry && entry.checked !== void 0 ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuCheckboxItem, {
193
+ }, (_entry_key1 = entry.key) !== null && _entry_key1 !== void 0 ? _entry_key1 : index);
194
+ }
195
+ if ("checked" in entry && entry.checked !== void 0) {
196
+ var _entry_key2;
197
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuCheckboxItem, {
185
198
  checked: entry.checked,
186
199
  icon: entry.icon,
187
200
  onCheckedChange: entry.onCheckedChange,
@@ -191,17 +204,18 @@ function renderEntries(items) {
191
204
  disabledReason: entry.disabledReason,
192
205
  shortcut: entry.shortcut,
193
206
  children: entry.label
194
- }, (_entry_key1 = entry.key) !== null && _entry_key1 !== void 0 ? _entry_key1 : index) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuItem, {
195
- icon: entry.icon,
196
- shortcut: entry.shortcut,
197
- disabled: entry.disabled,
198
- disabledReason: entry.disabledReason,
199
- destructive: entry.destructive,
200
- closeOnSelect: entry.closeOnSelect,
201
- onSelect: entry.onSelect,
202
- children: entry.label
203
207
  }, (_entry_key2 = entry.key) !== null && _entry_key2 !== void 0 ? _entry_key2 : index);
204
- });
208
+ }
209
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuItem, {
210
+ icon: entry.icon,
211
+ shortcut: entry.shortcut,
212
+ disabled: entry.disabled,
213
+ disabledReason: entry.disabledReason,
214
+ destructive: entry.destructive,
215
+ closeOnSelect: entry.closeOnSelect,
216
+ onSelect: entry.onSelect,
217
+ children: entry.label
218
+ }, (_entry_key = entry.key) !== null && _entry_key !== void 0 ? _entry_key : index);
205
219
  }
206
220
  function DropdownMenuRoot(param) {
207
221
  var {
@@ -416,6 +430,14 @@ function DropdownMenuContent(param) {
416
430
  children
417
431
  });
418
432
  }
433
+ function menuLabel(levelTitle, ariaLabel) {
434
+ if (levelTitle) return {
435
+ "aria-label": levelTitle
436
+ };
437
+ return ariaLabel ? {
438
+ "aria-label": ariaLabel
439
+ } : {};
440
+ }
419
441
  function DropdownMenuList(param) {
420
442
  var {
421
443
  children,
@@ -564,11 +586,7 @@ function DropdownMenuList(param) {
564
586
  children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
565
587
  ref: innerRef,
566
588
  role: "menu",
567
- ...(levelTitle ? {
568
- "aria-label": levelTitle
569
- } : ariaLabel ? {
570
- "aria-label": ariaLabel
571
- } : {}),
589
+ ...menuLabel(levelTitle, ariaLabel),
572
590
  "data-dismiss-class": "commit",
573
591
  "data-mp-width-mode": "at-least-trigger",
574
592
  width: "100%",
@@ -882,6 +900,11 @@ function subTitle(children) {
882
900
  }
883
901
  return null;
884
902
  }
903
+ function levelFace(ctx, id) {
904
+ return ctx.levels.some(function (level) {
905
+ return level.id === id;
906
+ }) ? "level" : null;
907
+ }
885
908
  function DropdownMenuSub(param) {
886
909
  var {
887
910
  children,
@@ -892,9 +915,7 @@ function DropdownMenuSub(param) {
892
915
  var id = (0, import_react2.useId)();
893
916
  var title = subTitle(children);
894
917
  var active = activeLevelId(ctx);
895
- var face = active === owner ? "trigger" : ctx.levels.some(function (level) {
896
- return level.id === id;
897
- }) ? "level" : null;
918
+ var face = active === owner ? "trigger" : levelFace(ctx, id);
898
919
  var sub = (0, import_react2.useMemo)(function () {
899
920
  return face ? {
900
921
  id,