@multiplatform.one/config 7.73.0 → 7.75.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.
Files changed (2) hide show
  1. package/design-lint.mjs +40 -0
  2. package/package.json +2 -2
package/design-lint.mjs CHANGED
@@ -187,6 +187,7 @@ export const designRules = [
187
187
  "phosphor-import",
188
188
  "raw-control",
189
189
  "raw-icon",
190
+ "sheet-action-row",
190
191
  "styled-mpo",
191
192
  "token-file",
192
193
  ...harvestRules,
@@ -923,6 +924,44 @@ export function inspectDesign(source, filename, projectRoot = process.cwd(), opt
923
924
  `"${label}" is a standard action spelled as a word; draw its icon and put the word in the accessibility label (LC-260).`,
924
925
  );
925
926
  }
927
+ // FZ-8439 (LC-262): a sheet's Cancel and confirm live in its header,
928
+ // OverlayHeader's ✕ and accent ✓. Its body holds no action row and no word
929
+ // in an accent pill.
930
+ function checkSheetActionRow(element) {
931
+ if (!ts.isJsxElement(element) || !/(?:^|\.)SheetModal$/.test(tagText(opening(element).tagName)))
932
+ return;
933
+ const walk = (node) => {
934
+ if (ts.isJsxElement(node) || ts.isJsxSelfClosingElement(node)) {
935
+ const tag = opening(node);
936
+ if (tag.getText(file).includes("sheet-action-row-escape:")) return;
937
+ const tagName = tagText(tag.tagName);
938
+ const accent = attribute(node, "accent");
939
+ const theme = attribute(node, "theme")?.initializer;
940
+ const accentOn =
941
+ (accent &&
942
+ !(
943
+ accent.initializer &&
944
+ ts.isJsxExpression(accent.initializer) &&
945
+ accent.initializer.expression?.kind === ts.SyntaxKind.FalseKeyword
946
+ )) ||
947
+ (theme && ts.isStringLiteral(theme) && theme.text === "accent");
948
+ if (/(?:^|\.)ActionBar$/.test(tagName))
949
+ report(
950
+ node,
951
+ "sheet-action-row",
952
+ "A sheet's Cancel and confirm go in its header as OverlayHeader (✕ leading, accent ✓ trailing), not an ActionBar in the body (FZ-8439, LC-262).",
953
+ );
954
+ else if (wordControl.test(tagName) && accentOn && !iconOnly(node))
955
+ report(
956
+ node,
957
+ "sheet-action-row",
958
+ `"${actionLabel(node) || tagName}" is a confirm word in an accent pill inside a sheet; make it OverlayHeader's ✓ named by the action (FZ-8439, LC-260).`,
959
+ );
960
+ }
961
+ ts.forEachChild(node, walk);
962
+ };
963
+ for (const child of element.children) walk(child);
964
+ }
926
965
  // LC-181 LINK-CHROME and LC-207 ART-NEVER-TINTED at a JSX use site.
927
966
  function checkElement(element) {
928
967
  const tag = tagText(element.tagName);
@@ -1079,6 +1118,7 @@ export function inspectDesign(source, filename, projectRoot = process.cwd(), opt
1079
1118
  if (ts.isJsxElement(node) || ts.isJsxSelfClosingElement(node)) {
1080
1119
  checkActionWord(node);
1081
1120
  checkIconButton(node);
1121
+ checkSheetActionRow(node);
1082
1122
  }
1083
1123
  if (
1084
1124
  !tokenFile &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/config",
3
- "version": "7.73.0",
3
+ "version": "7.75.0",
4
4
  "description": "Shared build and test configuration presets for multiplatform.one",
5
5
  "keywords": [
6
6
  "config",
@@ -114,7 +114,7 @@
114
114
  "access": "public"
115
115
  },
116
116
  "dependencies": {
117
- "@multiplatform.one/utils": "^7.73.0",
117
+ "@multiplatform.one/utils": "^7.75.0",
118
118
  "@tamagui/vite-plugin": "2.7.6",
119
119
  "@vitejs/plugin-react": "^6.1.2",
120
120
  "dotenv": "^17.4.2",