@lmb-it/kitsconcerto-native 0.1.252 → 0.1.253
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/components/Banner/banner.cjs +16 -6
- package/components/Banner/banner.cjs.map +1 -1
- package/components/Banner/banner.js +17 -7
- package/components/Banner/banner.js.map +1 -1
- package/components/Chip/index.cjs +13 -1
- package/components/Chip/index.cjs.map +1 -1
- package/components/Chip/index.js +13 -1
- package/components/Chip/index.js.map +1 -1
- package/index.d.ts +2 -0
- package/locale/ar.json.cjs +4 -1
- package/locale/ar.json.cjs.map +1 -1
- package/locale/ar.json.js +4 -2
- package/locale/ar.json.js.map +1 -1
- package/locale/en.json.cjs +4 -1
- package/locale/en.json.cjs.map +1 -1
- package/locale/en.json.js +4 -2
- package/locale/en.json.js.map +1 -1
- package/package.json +1 -1
- package/primitives/Text/index.cjs +6 -2
- package/primitives/Text/index.cjs.map +1 -1
- package/primitives/Text/index.js +6 -2
- package/primitives/Text/index.js.map +1 -1
|
@@ -5,6 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var lucideReactNative = require('lucide-react-native');
|
|
7
7
|
var useSeverityColors = require('../../hooks/useSeverityColors.cjs');
|
|
8
|
+
require('react');
|
|
9
|
+
var locale = require('../../hooks/locale.cjs');
|
|
10
|
+
require('../../contexts/DialogContext.cjs');
|
|
8
11
|
var reactNative = require('react-native');
|
|
9
12
|
var KitsThemeProvider_native = require('../../contexts/Theme/KitsThemeProvider.cjs');
|
|
10
13
|
var index_native = require('../../primitives/Icon/index.cjs');
|
|
@@ -32,16 +35,19 @@ const Banner = ({
|
|
|
32
35
|
onDismiss,
|
|
33
36
|
children,
|
|
34
37
|
className,
|
|
35
|
-
textDirection
|
|
38
|
+
textDirection
|
|
36
39
|
}) => {
|
|
37
40
|
const { theme } = KitsThemeProvider_native.useKitsTheme();
|
|
41
|
+
const { t, isRTL, isKeyExists } = locale.useLanguage();
|
|
38
42
|
const hasActions = actions.length > 0;
|
|
39
43
|
const status = statusProp ?? (hasActions ? "error" : "info");
|
|
40
44
|
const sev = useSeverityColors.useSeverityColors(statusToSeverity(status));
|
|
41
|
-
const
|
|
45
|
+
const actionRequiredLabel = isKeyExists?.("actionRequired") ? t("actionRequired") : "Action required";
|
|
46
|
+
const computedHeaderTitle = hasActions ? headerTitle ?? `${actionRequiredLabel}${actions.length > 1 ? ` (${actions.length})` : ""}` : headerTitle;
|
|
42
47
|
const hasHeader = !!computedHeaderTitle;
|
|
43
48
|
const hasBody = !!(title || description || children);
|
|
44
|
-
const
|
|
49
|
+
const resolvedDirection = textDirection ?? (isRTL ? "rtl" : "ltr");
|
|
50
|
+
const rowDirection = resolvedDirection === "rtl" ? "row-reverse" : "row";
|
|
45
51
|
const headerIconNode = (() => {
|
|
46
52
|
if (!headerIcon) return null;
|
|
47
53
|
if (status === "brand" && theme.config.logo) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: theme.config.logo });
|
|
@@ -97,7 +103,11 @@ const Banner = ({
|
|
|
97
103
|
borderRadius: 999,
|
|
98
104
|
paddingHorizontal: 12,
|
|
99
105
|
paddingVertical: 7,
|
|
100
|
-
|
|
106
|
+
// ⛔ `rowDirection`, NOT a hardcoded "row". This was the
|
|
107
|
+
// one row in the component that ignored the direction
|
|
108
|
+
// every other row obeyed, so even a caller that DID
|
|
109
|
+
// pass textDirection="rtl" got this pill backwards.
|
|
110
|
+
flexDirection: rowDirection,
|
|
101
111
|
alignItems: "center",
|
|
102
112
|
gap: 4,
|
|
103
113
|
flexShrink: 0
|
|
@@ -112,7 +122,7 @@ const Banner = ({
|
|
|
112
122
|
children: bannerAction.cta
|
|
113
123
|
}
|
|
114
124
|
),
|
|
115
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReactNative.ArrowRight, { size: 12, color: sev.solidText })
|
|
125
|
+
resolvedDirection === "rtl" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReactNative.ArrowLeft, { size: 12, color: sev.solidText }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReactNative.ArrowRight, { size: 12, color: sev.solidText })
|
|
116
126
|
]
|
|
117
127
|
}
|
|
118
128
|
)
|
|
@@ -128,7 +138,7 @@ const Banner = ({
|
|
|
128
138
|
style: {
|
|
129
139
|
borderRadius: 8,
|
|
130
140
|
overflow: "hidden",
|
|
131
|
-
writingDirection:
|
|
141
|
+
writingDirection: resolvedDirection
|
|
132
142
|
},
|
|
133
143
|
children: [
|
|
134
144
|
hasHeader && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.cjs","sources":["../../../../src/components/Banner/banner.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { Flex, Text, Icon } from \"../../_compat\";\nimport {\n AlertTriangle,\n ArrowRight,\n CheckCircle2,\n Info,\n CircleX,\n X,\n} from \"lucide-react-native\";\nimport { useSeverityColors } from \"../../hooks/useSeverityColors\";\nimport { useKitsTheme } from \"../../contexts/Theme\";\nimport type { BannerAction, IBannerProps, BannerStatus } from \"@lmb-it/kitsconcerto-types\";\nimport type { Severity } from \"@lmb-it/kitsconcerto-types\";\nimport { Pressable } from \"react-native\";\n\nconst icons: Record<string, any> = {\n error: CircleX,\n success: CheckCircle2,\n warning: AlertTriangle,\n info: Info,\n};\n\nfunction statusToSeverity(status: BannerStatus): Severity {\n if (status === \"error\") return \"danger\";\n return status;\n}\n\nconst Banner: React.FC<IBannerProps> = ({\n status: statusProp,\n headerTitle,\n headerIcon = true,\n title,\n description,\n withIcon = true,\n actions = [],\n onDismiss,\n children,\n className,\n textDirection = \"ltr\",\n}) => {\n const { theme } = useKitsTheme();\n const hasActions = actions.length > 0;\n const status = statusProp ?? (hasActions ? \"error\" : \"info\");\n const sev = useSeverityColors(statusToSeverity(status));\n const computedHeaderTitle = hasActions\n ? `Action required${actions.length > 1 ? ` (${actions.length})` : \"\"}`\n : headerTitle;\n const hasHeader = !!computedHeaderTitle;\n const hasBody = !!(title || description || children);\n const rowDirection = textDirection === \"rtl\" ? \"row-reverse\" : \"row\";\n\n const headerIconNode = (() => {\n if (!headerIcon) return null;\n if (status === \"brand\" && theme.config.logo) return <>{theme.config.logo}</>;\n if (hasActions) return <Icon name={AlertTriangle} color={sev.solidText} size=\"sm\" />;\n const IconComp = icons[status];\n return IconComp ? <Icon name={IconComp} color={sev.solidText} size=\"sm\" /> : null;\n })();\n\n const bodyIconNode = (() => {\n if (!withIcon) return null;\n if (status === \"brand\" && theme.config.logo) return <>{theme.config.logo}</>;\n const IconComp = icons[status];\n return IconComp ? <Icon name={IconComp} color={sev.iconFg} size=\"sm\" /> : null;\n })();\n\n const renderActionRow = (bannerAction: BannerAction, index: number) => (\n <Flex\n key={bannerAction.id}\n flexDirection={rowDirection}\n alignItems=\"flex-start\"\n gap={10}\n style={{\n padding: 12,\n borderTopWidth: index > 0 ? 1 : 0,\n borderTopColor: sev.border,\n }}\n >\n <Flex\n alignItems=\"center\"\n justifyContent=\"center\"\n style={{\n width: 28,\n height: 28,\n borderRadius: 8,\n backgroundColor: \"#fff\",\n borderWidth: 1,\n borderColor: sev.border,\n flexShrink: 0,\n }}\n >\n {bannerAction.icon ?? <Icon name={AlertTriangle} color={sev.iconFg} size=\"sm\" />}\n </Flex>\n <Flex flexDirection=\"column\" gap={2} style={{ flex: 1 }}>\n <Text fontWeight=\"bold\" size=\"sm\" style={{ color: sev.text }}>\n {bannerAction.label}\n </Text>\n {bannerAction.detail && (\n <Text size=\"xs\" style={{ color: sev.text, lineHeight: 17 }}>\n {bannerAction.detail}\n </Text>\n )}\n </Flex>\n {bannerAction.cta && (\n <Pressable\n onPress={bannerAction.onCta}\n style={{\n backgroundColor: sev.solid,\n borderRadius: 999,\n paddingHorizontal: 12,\n paddingVertical: 7,\n flexDirection: \"row\",\n alignItems: \"center\",\n gap: 4,\n flexShrink: 0,\n }}\n >\n <Text\n fontWeight=\"bold\"\n size=\"xs\"\n style={{ color: sev.solidText }}\n >\n {bannerAction.cta}\n </Text>\n <ArrowRight size={12} color={sev.solidText} />\n </Pressable>\n )}\n </Flex>\n );\n\n return (\n <Flex\n flexDirection=\"column\"\n className={className}\n style={{\n borderRadius: 8,\n overflow: \"hidden\",\n writingDirection: textDirection,\n }}\n >\n {/* Header bar */}\n {hasHeader && (\n <Flex\n flexDirection={rowDirection}\n alignItems=\"center\"\n gap={6}\n style={{\n backgroundColor: sev.solid,\n paddingVertical: 8,\n paddingHorizontal: 12,\n }}\n >\n {headerIconNode}\n <Text fontWeight=\"bold\" size=\"sm\" style={{ color: sev.solidText, flex: 1 }}>\n {computedHeaderTitle}\n </Text>\n {onDismiss && (\n <Pressable\n accessibilityLabel=\"Dismiss\"\n onPress={onDismiss}\n style={{\n width: 24,\n height: 24,\n borderRadius: 999,\n backgroundColor: \"rgba(255, 255, 255, 0.2)\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <X size={14} color={sev.solidText} />\n </Pressable>\n )}\n </Flex>\n )}\n\n {/* Body section */}\n {hasActions ? (\n <Flex\n flexDirection=\"column\"\n style={{\n backgroundColor: sev.bgTint,\n }}\n >\n {actions.map(renderActionRow)}\n </Flex>\n ) : hasBody && (\n <Flex\n flexDirection={rowDirection}\n alignItems=\"center\"\n gap={12}\n style={{\n backgroundColor: sev.bgTint,\n padding: 12,\n justifyContent: \"space-between\",\n }}\n >\n <Flex flexDirection=\"column\" gap={4} style={{ flex: 1 }}>\n {(withIcon || title) && (\n <Flex flexDirection={rowDirection} alignItems=\"center\" gap={6}>\n {bodyIconNode}\n {title && (\n <Text fontWeight=\"bold\" size=\"sm\" style={{ color: sev.text }}>\n {title}\n </Text>\n )}\n </Flex>\n )}\n {description && (\n <Text size=\"xs\" style={{ color: sev.text }}>\n {description}\n </Text>\n )}\n {children}\n </Flex>\n </Flex>\n )}\n </Flex>\n );\n};\n\nexport default Banner;\n"],"names":["CircleX","CheckCircle2","AlertTriangle","Info","useKitsTheme","useSeverityColors","jsx","Fragment","Icon","index","jsxs","Flex","Text","Pressable","ArrowRight","X"],"mappings":";;;;;;;;;;;;;AAgBA,MAAM,KAAA,GAA6B;AAAA,EAC/B,KAAA,EAAOA,yBAAA;AAAA,EACP,OAAA,EAASC,8BAAA;AAAA,EACT,OAAA,EAASC,+BAAA;AAAA,EACT,IAAA,EAAMC;AACV,CAAA;AAEA,SAAS,iBAAiB,MAAA,EAAgC;AACtD,EAAA,IAAI,MAAA,KAAW,SAAS,OAAO,QAAA;AAC/B,EAAA,OAAO,MAAA;AACX;AAEA,MAAM,SAAiC,CAAC;AAAA,EACpC,MAAA,EAAQ,UAAA;AAAA,EACR,WAAA;AAAA,EACA,UAAA,GAAa,IAAA;AAAA,EACb,KAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA,GAAW,IAAA;AAAA,EACX,UAAU,EAAC;AAAA,EACX,SAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,aAAA,GAAgB;AACpB,CAAA,KAAM;AACF,EAAA,MAAM,EAAE,KAAA,EAAM,GAAIC,qCAAA,EAAa;AAC/B,EAAA,MAAM,UAAA,GAAa,QAAQ,MAAA,GAAS,CAAA;AACpC,EAAA,MAAM,MAAA,GAAS,UAAA,KAAe,UAAA,GAAa,OAAA,GAAU,MAAA,CAAA;AACrD,EAAA,MAAM,GAAA,GAAMC,mCAAA,CAAkB,gBAAA,CAAiB,MAAM,CAAC,CAAA;AACtD,EAAA,MAAM,mBAAA,GAAsB,UAAA,GACtB,CAAA,eAAA,EAAkB,OAAA,CAAQ,MAAA,GAAS,CAAA,GAAI,CAAA,EAAA,EAAK,OAAA,CAAQ,MAAM,CAAA,CAAA,CAAA,GAAM,EAAE,CAAA,CAAA,GAClE,WAAA;AACN,EAAA,MAAM,SAAA,GAAY,CAAC,CAAC,mBAAA;AACpB,EAAA,MAAM,OAAA,GAAU,CAAC,EAAE,KAAA,IAAS,WAAA,IAAe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AAA;AAAA,UAACK,aAAA;AAAA,UAAA;AAAA,YACG,aAAA,EAAe,YAAA;AAAA,YACf,UAAA,EAAW,QAAA;AAAA,YACX,GAAA,EAAK,EAAA;AAAA,YACL,KAAA,EAAO;AAAA,cACH,iBAAiB,GAAA,CAAI,MAAA;AAAA,cACrB,OAAA,EAAS,EAAA;AAAA,cACT,cAAA,EAAgB;AAAA,aACpB;AAAA,YAEA,QAAA,kBAAAD,eAAA,CAACC,aAAA,EAAA,EAAK,aAAA,EAAc,QAAA,EAAS,GAAA,EAAK,GAAG,KAAA,EAAO,EAAE,IAAA,EAAM,CAAA,EAAE,EAChD,QAAA,EAAA;AAAA,cAAA,CAAA,QAAA,IAAY,KAAA,qCACTA,aAAA,EAAA,EAAK,aAAA,EAAe,cAAc,UAAA,EAAW,QAAA,EAAS,KAAK,CAAA,EACvD,QAAA,EAAA;AAAA,gBAAA,YAAA;AAAA,gBACA,KAAA,oBACGL,cAAA,CAACM,sBAAA,EAAA,EAAK,UAAA,EAAW,MAAA,EAAO,IAAA,EAAK,IAAA,EAAK,KAAA,EAAO,EAAE,KAAA,EAAO,GAAA,CAAI,IAAA,IACjD,QAAA,EAAA,KAAA,EACL;AAAA,eAAA,EAER,CAAA;AAAA,cAEH,WAAA,oBACGN,cAAA,CAACM,sBAAA,EAAA,EAAK,IAAA,EAAK,IAAA,EAAK,KAAA,EAAO,EAAE,KAAA,EAAO,GAAA,CAAI,IAAA,EAAK,EACpC,QAAA,EAAA,WAAA,EACL,CAAA;AAAA,cAEH;AAAA,aAAA,EACL;AAAA;AAAA;AACJ;AAAA;AAAA,GAER;AAER;;;;"}
|
|
1
|
+
{"version":3,"file":"banner.cjs","sources":["../../../../src/components/Banner/banner.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { Flex, Text, Icon } from \"../../_compat\";\nimport {\n AlertTriangle,\n ArrowLeft,\n ArrowRight,\n CheckCircle2,\n Info,\n CircleX,\n X,\n} from \"lucide-react-native\";\nimport { useSeverityColors } from \"../../hooks/useSeverityColors\";\nimport { useKitsTheme } from \"../../contexts/Theme\";\nimport { useLanguage } from \"../../hooks\";\nimport type { BannerAction, IBannerProps, BannerStatus } from \"@lmb-it/kitsconcerto-types\";\nimport type { Severity } from \"@lmb-it/kitsconcerto-types\";\nimport { Pressable } from \"react-native\";\n\nconst icons: Record<string, any> = {\n error: CircleX,\n success: CheckCircle2,\n warning: AlertTriangle,\n info: Info,\n};\n\nfunction statusToSeverity(status: BannerStatus): Severity {\n if (status === \"error\") return \"danger\";\n return status;\n}\n\nconst Banner: React.FC<IBannerProps> = ({\n status: statusProp,\n headerTitle,\n headerIcon = true,\n title,\n description,\n withIcon = true,\n actions = [],\n onDismiss,\n children,\n className,\n textDirection,\n}) => {\n const { theme } = useKitsTheme();\n const { t, isRTL, isKeyExists } = useLanguage();\n const hasActions = actions.length > 0;\n const status = statusProp ?? (hasActions ? \"error\" : \"info\");\n const sev = useSeverityColors(statusToSeverity(status));\n\n /*\n * ⛔ THE HEADING IS THE CONSUMER'S TO WRITE. This read\n * `hasActions ? \"Action required…\" : headerTitle`, so a caller that passed\n * a translated `headerTitle` AND any actions had it thrown away and an\n * ENGLISH LITERAL rendered instead — with no prop, theme value or locale\n * key able to reach it.\n *\n * ⛔ FOUND IN AN ARABIC APP, 19 September 2026: AlphaMatch's Me tab showed\n * \"Action required\" in English on an otherwise fully Arabic screen, while\n * the app's OWN translated string for it sat unused one call away. Grepping\n * the app for the English text finds only its locale file, which is exactly\n * why it reads as an app bug and is not one.\n *\n * ⚠️ THE FALLBACK IS LOCALISED, BUT ONLY WHERE A TRANSLATION EXISTS.\n * `isKeyExists` is checked first so a language without the key keeps\n * today's English rather than rendering the raw key at a user — 38 of this\n * library's 40 locale files have not been given this string, and a visible\n * `actionRequired` would be a worse defect than the one being fixed.\n *\n * ⚠️ THE COUNT SUFFIX BELONGS TO THE FALLBACK, NOT TO THE CONSUMER. A title\n * someone wrote is a complete sentence; appending \"(3)\" to it is the\n * library talking over them.\n */\n const actionRequiredLabel = isKeyExists?.(\"actionRequired\")\n ? t(\"actionRequired\")\n : \"Action required\";\n const computedHeaderTitle = hasActions\n ? headerTitle ??\n `${actionRequiredLabel}${actions.length > 1 ? ` (${actions.length})` : \"\"}`\n : headerTitle;\n\n const hasHeader = !!computedHeaderTitle;\n const hasBody = !!(title || description || children);\n\n /*\n * ⛔ THE DIRECTION DEFAULTS TO THE ACTIVE LANGUAGE, NOT TO ENGLISH. This\n * prop defaulted to `\"ltr\"`, so every caller that did not pass it — which\n * was all of them — got a left-to-right banner in an Arabic app, and none\n * of them could find out. A library shipping to an RTL product reads the\n * direction itself; the prop stays, for the caller that needs to override.\n */\n const resolvedDirection = textDirection ?? (isRTL ? \"rtl\" : \"ltr\");\n const rowDirection = resolvedDirection === \"rtl\" ? \"row-reverse\" : \"row\";\n\n const headerIconNode = (() => {\n if (!headerIcon) return null;\n if (status === \"brand\" && theme.config.logo) return <>{theme.config.logo}</>;\n if (hasActions) return <Icon name={AlertTriangle} color={sev.solidText} size=\"sm\" />;\n const IconComp = icons[status];\n return IconComp ? <Icon name={IconComp} color={sev.solidText} size=\"sm\" /> : null;\n })();\n\n const bodyIconNode = (() => {\n if (!withIcon) return null;\n if (status === \"brand\" && theme.config.logo) return <>{theme.config.logo}</>;\n const IconComp = icons[status];\n return IconComp ? <Icon name={IconComp} color={sev.iconFg} size=\"sm\" /> : null;\n })();\n\n const renderActionRow = (bannerAction: BannerAction, index: number) => (\n <Flex\n key={bannerAction.id}\n flexDirection={rowDirection}\n alignItems=\"flex-start\"\n gap={10}\n style={{\n padding: 12,\n borderTopWidth: index > 0 ? 1 : 0,\n borderTopColor: sev.border,\n }}\n >\n <Flex\n alignItems=\"center\"\n justifyContent=\"center\"\n style={{\n width: 28,\n height: 28,\n borderRadius: 8,\n backgroundColor: \"#fff\",\n borderWidth: 1,\n borderColor: sev.border,\n flexShrink: 0,\n }}\n >\n {bannerAction.icon ?? <Icon name={AlertTriangle} color={sev.iconFg} size=\"sm\" />}\n </Flex>\n <Flex flexDirection=\"column\" gap={2} style={{ flex: 1 }}>\n <Text fontWeight=\"bold\" size=\"sm\" style={{ color: sev.text }}>\n {bannerAction.label}\n </Text>\n {bannerAction.detail && (\n <Text size=\"xs\" style={{ color: sev.text, lineHeight: 17 }}>\n {bannerAction.detail}\n </Text>\n )}\n </Flex>\n {bannerAction.cta && (\n <Pressable\n onPress={bannerAction.onCta}\n style={{\n backgroundColor: sev.solid,\n borderRadius: 999,\n paddingHorizontal: 12,\n paddingVertical: 7,\n // ⛔ `rowDirection`, NOT a hardcoded \"row\". This was the\n // one row in the component that ignored the direction\n // every other row obeyed, so even a caller that DID\n // pass textDirection=\"rtl\" got this pill backwards.\n flexDirection: rowDirection,\n alignItems: \"center\",\n gap: 4,\n flexShrink: 0,\n }}\n >\n <Text\n fontWeight=\"bold\"\n size=\"xs\"\n style={{ color: sev.solidText }}\n >\n {bannerAction.cta}\n </Text>\n {/* ⛔ THE ARROW MEANS \"ONWARDS\", SO IT FOLLOWS THE READER.\n It was always ArrowRight, which in Arabic points back\n the way the eye came — on the one control the banner\n exists to get pressed. */}\n {resolvedDirection === \"rtl\" ? (\n <ArrowLeft size={12} color={sev.solidText} />\n ) : (\n <ArrowRight size={12} color={sev.solidText} />\n )}\n </Pressable>\n )}\n </Flex>\n );\n\n return (\n <Flex\n flexDirection=\"column\"\n className={className}\n style={{\n borderRadius: 8,\n overflow: \"hidden\",\n writingDirection: resolvedDirection,\n }}\n >\n {/* Header bar */}\n {hasHeader && (\n <Flex\n flexDirection={rowDirection}\n alignItems=\"center\"\n gap={6}\n style={{\n backgroundColor: sev.solid,\n paddingVertical: 8,\n paddingHorizontal: 12,\n }}\n >\n {headerIconNode}\n <Text fontWeight=\"bold\" size=\"sm\" style={{ color: sev.solidText, flex: 1 }}>\n {computedHeaderTitle}\n </Text>\n {onDismiss && (\n <Pressable\n accessibilityLabel=\"Dismiss\"\n onPress={onDismiss}\n style={{\n width: 24,\n height: 24,\n borderRadius: 999,\n backgroundColor: \"rgba(255, 255, 255, 0.2)\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <X size={14} color={sev.solidText} />\n </Pressable>\n )}\n </Flex>\n )}\n\n {/* Body section */}\n {hasActions ? (\n <Flex\n flexDirection=\"column\"\n style={{\n backgroundColor: sev.bgTint,\n }}\n >\n {actions.map(renderActionRow)}\n </Flex>\n ) : hasBody && (\n <Flex\n flexDirection={rowDirection}\n alignItems=\"center\"\n gap={12}\n style={{\n backgroundColor: sev.bgTint,\n padding: 12,\n justifyContent: \"space-between\",\n }}\n >\n <Flex flexDirection=\"column\" gap={4} style={{ flex: 1 }}>\n {(withIcon || title) && (\n <Flex flexDirection={rowDirection} alignItems=\"center\" gap={6}>\n {bodyIconNode}\n {title && (\n <Text fontWeight=\"bold\" size=\"sm\" style={{ color: sev.text }}>\n {title}\n </Text>\n )}\n </Flex>\n )}\n {description && (\n <Text size=\"xs\" style={{ color: sev.text }}>\n {description}\n </Text>\n )}\n {children}\n </Flex>\n </Flex>\n )}\n </Flex>\n );\n};\n\nexport default Banner;\n"],"names":["CircleX","CheckCircle2","AlertTriangle","Info","useKitsTheme","useLanguage","useSeverityColors","jsx","Fragment","Icon","index","jsxs","Flex","Text","Pressable","ArrowLeft","ArrowRight","X"],"mappings":";;;;;;;;;;;;;;;;AAkBA,MAAM,KAAA,GAA6B;AAAA,EAC/B,KAAA,EAAOA,yBAAA;AAAA,EACP,OAAA,EAASC,8BAAA;AAAA,EACT,OAAA,EAASC,+BAAA;AAAA,EACT,IAAA,EAAMC;AACV,CAAA;AAEA,SAAS,iBAAiB,MAAA,EAAgC;AACtD,EAAA,IAAI,MAAA,KAAW,SAAS,OAAO,QAAA;AAC/B,EAAA,OAAO,MAAA;AACX;AAEA,MAAM,SAAiC,CAAC;AAAA,EACpC,MAAA,EAAQ,UAAA;AAAA,EACR,WAAA;AAAA,EACA,UAAA,GAAa,IAAA;AAAA,EACb,KAAA;AAAA,EACA,WAAA;AAAA,EAC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ACX,GAAA,EAAK,EAAA;AAAA,YACL,KAAA,EAAO;AAAA,cACH,iBAAiB,GAAA,CAAI,MAAA;AAAA,cACrB,OAAA,EAAS,EAAA;AAAA,cACT,cAAA,EAAgB;AAAA,aACpB;AAAA,YAEA,QAAA,kBAAAD,eAAA,CAACC,aAAA,EAAA,EAAK,aAAA,EAAc,QAAA,EAAS,GAAA,EAAK,GAAG,KAAA,EAAO,EAAE,IAAA,EAAM,CAAA,EAAE,EAChD,QAAA,EAAA;AAAA,cAAA,CAAA,QAAA,IAAY,KAAA,qCACTA,aAAA,EAAA,EAAK,aAAA,EAAe,cAAc,UAAA,EAAW,QAAA,EAAS,KAAK,CAAA,EACvD,QAAA,EAAA;AAAA,gBAAA,YAAA;AAAA,gBACA,KAAA,oBACGL,cAAA,CAACM,sBAAA,EAAA,EAAK,UAAA,EAAW,MAAA,EAAO,IAAA,EAAK,IAAA,EAAK,KAAA,EAAO,EAAE,KAAA,EAAO,GAAA,CAAI,IAAA,IACjD,QAAA,EAAA,KAAA,EACL;AAAA,eAAA,EAER,CAAA;AAAA,cAEH,WAAA,oBACGN,cAAA,CAACM,sBAAA,EAAA,EAAK,IAAA,EAAK,IAAA,EAAK,KAAA,EAAO,EAAE,KAAA,EAAO,GAAA,CAAI,IAAA,EAAK,EACpC,QAAA,EAAA,WAAA,EACL,CAAA;AAAA,cAEH;AAAA,aAAA,EACL;AAAA;AAAA;AACJ;AAAA;AAAA,GAER;AAER;;;;"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { AlertTriangle, Info, CheckCircle2, CircleX, X, ArrowRight } from 'lucide-react-native';
|
|
2
|
+
import { AlertTriangle, Info, CheckCircle2, CircleX, X, ArrowLeft, ArrowRight } from 'lucide-react-native';
|
|
3
3
|
import { useSeverityColors } from '../../hooks/useSeverityColors.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import { useLanguage } from '../../hooks/locale.js';
|
|
6
|
+
import '../../contexts/DialogContext.js';
|
|
4
7
|
import { Pressable } from 'react-native';
|
|
5
8
|
import { useKitsTheme } from '../../contexts/Theme/KitsThemeProvider.js';
|
|
6
9
|
import { Icon } from '../../primitives/Icon/index.js';
|
|
@@ -28,16 +31,19 @@ const Banner = ({
|
|
|
28
31
|
onDismiss,
|
|
29
32
|
children,
|
|
30
33
|
className,
|
|
31
|
-
textDirection
|
|
34
|
+
textDirection
|
|
32
35
|
}) => {
|
|
33
36
|
const { theme } = useKitsTheme();
|
|
37
|
+
const { t, isRTL, isKeyExists } = useLanguage();
|
|
34
38
|
const hasActions = actions.length > 0;
|
|
35
39
|
const status = statusProp ?? (hasActions ? "error" : "info");
|
|
36
40
|
const sev = useSeverityColors(statusToSeverity(status));
|
|
37
|
-
const
|
|
41
|
+
const actionRequiredLabel = isKeyExists?.("actionRequired") ? t("actionRequired") : "Action required";
|
|
42
|
+
const computedHeaderTitle = hasActions ? headerTitle ?? `${actionRequiredLabel}${actions.length > 1 ? ` (${actions.length})` : ""}` : headerTitle;
|
|
38
43
|
const hasHeader = !!computedHeaderTitle;
|
|
39
44
|
const hasBody = !!(title || description || children);
|
|
40
|
-
const
|
|
45
|
+
const resolvedDirection = textDirection ?? (isRTL ? "rtl" : "ltr");
|
|
46
|
+
const rowDirection = resolvedDirection === "rtl" ? "row-reverse" : "row";
|
|
41
47
|
const headerIconNode = (() => {
|
|
42
48
|
if (!headerIcon) return null;
|
|
43
49
|
if (status === "brand" && theme.config.logo) return /* @__PURE__ */ jsx(Fragment, { children: theme.config.logo });
|
|
@@ -93,7 +99,11 @@ const Banner = ({
|
|
|
93
99
|
borderRadius: 999,
|
|
94
100
|
paddingHorizontal: 12,
|
|
95
101
|
paddingVertical: 7,
|
|
96
|
-
|
|
102
|
+
// ⛔ `rowDirection`, NOT a hardcoded "row". This was the
|
|
103
|
+
// one row in the component that ignored the direction
|
|
104
|
+
// every other row obeyed, so even a caller that DID
|
|
105
|
+
// pass textDirection="rtl" got this pill backwards.
|
|
106
|
+
flexDirection: rowDirection,
|
|
97
107
|
alignItems: "center",
|
|
98
108
|
gap: 4,
|
|
99
109
|
flexShrink: 0
|
|
@@ -108,7 +118,7 @@ const Banner = ({
|
|
|
108
118
|
children: bannerAction.cta
|
|
109
119
|
}
|
|
110
120
|
),
|
|
111
|
-
/* @__PURE__ */ jsx(ArrowRight, { size: 12, color: sev.solidText })
|
|
121
|
+
resolvedDirection === "rtl" ? /* @__PURE__ */ jsx(ArrowLeft, { size: 12, color: sev.solidText }) : /* @__PURE__ */ jsx(ArrowRight, { size: 12, color: sev.solidText })
|
|
112
122
|
]
|
|
113
123
|
}
|
|
114
124
|
)
|
|
@@ -124,7 +134,7 @@ const Banner = ({
|
|
|
124
134
|
style: {
|
|
125
135
|
borderRadius: 8,
|
|
126
136
|
overflow: "hidden",
|
|
127
|
-
writingDirection:
|
|
137
|
+
writingDirection: resolvedDirection
|
|
128
138
|
},
|
|
129
139
|
children: [
|
|
130
140
|
hasHeader && /* @__PURE__ */ jsxs(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.js","sources":["../../../../src/components/Banner/banner.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { Flex, Text, Icon } from \"../../_compat\";\nimport {\n AlertTriangle,\n ArrowRight,\n CheckCircle2,\n Info,\n CircleX,\n X,\n} from \"lucide-react-native\";\nimport { useSeverityColors } from \"../../hooks/useSeverityColors\";\nimport { useKitsTheme } from \"../../contexts/Theme\";\nimport type { BannerAction, IBannerProps, BannerStatus } from \"@lmb-it/kitsconcerto-types\";\nimport type { Severity } from \"@lmb-it/kitsconcerto-types\";\nimport { Pressable } from \"react-native\";\n\nconst icons: Record<string, any> = {\n error: CircleX,\n success: CheckCircle2,\n warning: AlertTriangle,\n info: Info,\n};\n\nfunction statusToSeverity(status: BannerStatus): Severity {\n if (status === \"error\") return \"danger\";\n return status;\n}\n\nconst Banner: React.FC<IBannerProps> = ({\n status: statusProp,\n headerTitle,\n headerIcon = true,\n title,\n description,\n withIcon = true,\n actions = [],\n onDismiss,\n children,\n className,\n textDirection = \"ltr\",\n}) => {\n const { theme } = useKitsTheme();\n const hasActions = actions.length > 0;\n const status = statusProp ?? (hasActions ? \"error\" : \"info\");\n const sev = useSeverityColors(statusToSeverity(status));\n const computedHeaderTitle = hasActions\n ? `Action required${actions.length > 1 ? ` (${actions.length})` : \"\"}`\n : headerTitle;\n const hasHeader = !!computedHeaderTitle;\n const hasBody = !!(title || description || children);\n const rowDirection = textDirection === \"rtl\" ? \"row-reverse\" : \"row\";\n\n const headerIconNode = (() => {\n if (!headerIcon) return null;\n if (status === \"brand\" && theme.config.logo) return <>{theme.config.logo}</>;\n if (hasActions) return <Icon name={AlertTriangle} color={sev.solidText} size=\"sm\" />;\n const IconComp = icons[status];\n return IconComp ? <Icon name={IconComp} color={sev.solidText} size=\"sm\" /> : null;\n })();\n\n const bodyIconNode = (() => {\n if (!withIcon) return null;\n if (status === \"brand\" && theme.config.logo) return <>{theme.config.logo}</>;\n const IconComp = icons[status];\n return IconComp ? <Icon name={IconComp} color={sev.iconFg} size=\"sm\" /> : null;\n })();\n\n const renderActionRow = (bannerAction: BannerAction, index: number) => (\n <Flex\n key={bannerAction.id}\n flexDirection={rowDirection}\n alignItems=\"flex-start\"\n gap={10}\n style={{\n padding: 12,\n borderTopWidth: index > 0 ? 1 : 0,\n borderTopColor: sev.border,\n }}\n >\n <Flex\n alignItems=\"center\"\n justifyContent=\"center\"\n style={{\n width: 28,\n height: 28,\n borderRadius: 8,\n backgroundColor: \"#fff\",\n borderWidth: 1,\n borderColor: sev.border,\n flexShrink: 0,\n }}\n >\n {bannerAction.icon ?? <Icon name={AlertTriangle} color={sev.iconFg} size=\"sm\" />}\n </Flex>\n <Flex flexDirection=\"column\" gap={2} style={{ flex: 1 }}>\n <Text fontWeight=\"bold\" size=\"sm\" style={{ color: sev.text }}>\n {bannerAction.label}\n </Text>\n {bannerAction.detail && (\n <Text size=\"xs\" style={{ color: sev.text, lineHeight: 17 }}>\n {bannerAction.detail}\n </Text>\n )}\n </Flex>\n {bannerAction.cta && (\n <Pressable\n onPress={bannerAction.onCta}\n style={{\n backgroundColor: sev.solid,\n borderRadius: 999,\n paddingHorizontal: 12,\n paddingVertical: 7,\n flexDirection: \"row\",\n alignItems: \"center\",\n gap: 4,\n flexShrink: 0,\n }}\n >\n <Text\n fontWeight=\"bold\"\n size=\"xs\"\n style={{ color: sev.solidText }}\n >\n {bannerAction.cta}\n </Text>\n <ArrowRight size={12} color={sev.solidText} />\n </Pressable>\n )}\n </Flex>\n );\n\n return (\n <Flex\n flexDirection=\"column\"\n className={className}\n style={{\n borderRadius: 8,\n overflow: \"hidden\",\n writingDirection: textDirection,\n }}\n >\n {/* Header bar */}\n {hasHeader && (\n <Flex\n flexDirection={rowDirection}\n alignItems=\"center\"\n gap={6}\n style={{\n backgroundColor: sev.solid,\n paddingVertical: 8,\n paddingHorizontal: 12,\n }}\n >\n {headerIconNode}\n <Text fontWeight=\"bold\" size=\"sm\" style={{ color: sev.solidText, flex: 1 }}>\n {computedHeaderTitle}\n </Text>\n {onDismiss && (\n <Pressable\n accessibilityLabel=\"Dismiss\"\n onPress={onDismiss}\n style={{\n width: 24,\n height: 24,\n borderRadius: 999,\n backgroundColor: \"rgba(255, 255, 255, 0.2)\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <X size={14} color={sev.solidText} />\n </Pressable>\n )}\n </Flex>\n )}\n\n {/* Body section */}\n {hasActions ? (\n <Flex\n flexDirection=\"column\"\n style={{\n backgroundColor: sev.bgTint,\n }}\n >\n {actions.map(renderActionRow)}\n </Flex>\n ) : hasBody && (\n <Flex\n flexDirection={rowDirection}\n alignItems=\"center\"\n gap={12}\n style={{\n backgroundColor: sev.bgTint,\n padding: 12,\n justifyContent: \"space-between\",\n }}\n >\n <Flex flexDirection=\"column\" gap={4} style={{ flex: 1 }}>\n {(withIcon || title) && (\n <Flex flexDirection={rowDirection} alignItems=\"center\" gap={6}>\n {bodyIconNode}\n {title && (\n <Text fontWeight=\"bold\" size=\"sm\" style={{ color: sev.text }}>\n {title}\n </Text>\n )}\n </Flex>\n )}\n {description && (\n <Text size=\"xs\" style={{ color: sev.text }}>\n {description}\n </Text>\n )}\n {children}\n </Flex>\n </Flex>\n )}\n </Flex>\n );\n};\n\nexport default Banner;\n"],"names":[],"mappings":";;;;;;;;;AAgBA,MAAM,KAAA,GAA6B;AAAA,EAC/B,KAAA,EAAO,OAAA;AAAA,EACP,OAAA,EAAS,YAAA;AAAA,EACT,OAAA,EAAS,aAAA;AAAA,EACT,IAAA,EAAM;AACV,CAAA;AAEA,SAAS,iBAAiB,MAAA,EAAgC;AACtD,EAAA,IAAI,MAAA,KAAW,SAAS,OAAO,QAAA;AAC/B,EAAA,OAAO,MAAA;AACX;AAEA,MAAM,SAAiC,CAAC;AAAA,EACpC,MAAA,EAAQ,UAAA;AAAA,EACR,WAAA;AAAA,EACA,UAAA,GAAa,IAAA;AAAA,EACb,KAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA,GAAW,IAAA;AAAA,EACX,UAAU,EAAC;AAAA,EACX,SAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,aAAA,GAAgB;AACpB,CAAA,KAAM;AACF,EAAA,MAAM,EAAE,KAAA,EAAM,GAAI,YAAA,EAAa;AAC/B,EAAA,MAAM,UAAA,GAAa,QAAQ,MAAA,GAAS,CAAA;AACpC,EAAA,MAAM,MAAA,GAAS,UAAA,KAAe,UAAA,GAAa,OAAA,GAAU,MAAA,CAAA;AACrD,EAAA,MAAM,GAAA,GAAM,iBAAA,CAAkB,gBAAA,CAAiB,MAAM,CAAC,CAAA;AACtD,EAAA,MAAM,mBAAA,GAAsB,UAAA,GACtB,CAAA,eAAA,EAAkB,OAAA,CAAQ,MAAA,GAAS,CAAA,GAAI,CAAA,EAAA,EAAK,OAAA,CAAQ,MAAM,CAAA,CAAA,CAAA,GAAM,EAAE,CAAA,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AA,YAEC,QAAA,EAAA,OAAA,CAAQ,IAAI,eAAe;AAAA;AAAA,YAEhC,OAAA,oBACA,GAAA;AAAA,UAAC,IAAA;AAAA,UAAA;AAAA,YACG,aAAA,EAAe,YAAA;AAAA,YACf,UAAA,EAAW,QAAA;AAAA,YACX,GAAA,EAAK,EAAA;AAAA,YACL,KAAA,EAAO;AAAA,cACH,iBAAiB,GAAA,CAAI,MAAA;AAAA,cACrB,OAAA,EAAS,EAAA;AAAA,cACT,cAAA,EAAgB;AAAA,aACpB;AAAA,YAEA,QAAA,kBAAA,IAAA,CAAC,IAAA,EAAA,EAAK,aAAA,EAAc,QAAA,EAAS,GAAA,EAAK,GAAG,KAAA,EAAO,EAAE,IAAA,EAAM,CAAA,EAAE,EAChD,QAAA,EAAA;AAAA,cAAA,CAAA,QAAA,IAAY,KAAA,0BACT,IAAA,EAAA,EAAK,aAAA,EAAe,cAAc,UAAA,EAAW,QAAA,EAAS,KAAK,CAAA,EACvD,QAAA,EAAA;AAAA,gBAAA,YAAA;AAAA,gBACA,KAAA,oBACG,GAAA,CAAC,IAAA,EAAA,EAAK,UAAA,EAAW,MAAA,EAAO,IAAA,EAAK,IAAA,EAAK,KAAA,EAAO,EAAE,KAAA,EAAO,GAAA,CAAI,IAAA,IACjD,QAAA,EAAA,KAAA,EACL;AAAA,eAAA,EAER,CAAA;AAAA,cAEH,WAAA,oBACG,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAK,IAAA,EAAK,KAAA,EAAO,EAAE,KAAA,EAAO,GAAA,CAAI,IAAA,EAAK,EACpC,QAAA,EAAA,WAAA,EACL,CAAA;AAAA,cAEH;AAAA,aAAA,EACL;AAAA;AAAA;AACJ;AAAA;AAAA,GAER;AAER;;;;"}
|
|
1
|
+
{"version":3,"file":"banner.js","sources":["../../../../src/components/Banner/banner.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { Flex, Text, Icon } from \"../../_compat\";\nimport {\n AlertTriangle,\n ArrowLeft,\n ArrowRight,\n CheckCircle2,\n Info,\n CircleX,\n X,\n} from \"lucide-react-native\";\nimport { useSeverityColors } from \"../../hooks/useSeverityColors\";\nimport { useKitsTheme } from \"../../contexts/Theme\";\nimport { useLanguage } from \"../../hooks\";\nimport type { BannerAction, IBannerProps, BannerStatus } from \"@lmb-it/kitsconcerto-types\";\nimport type { Severity } from \"@lmb-it/kitsconcerto-types\";\nimport { Pressable } from \"react-native\";\n\nconst icons: Record<string, any> = {\n error: CircleX,\n success: CheckCircle2,\n warning: AlertTriangle,\n info: Info,\n};\n\nfunction statusToSeverity(status: BannerStatus): Severity {\n if (status === \"error\") return \"danger\";\n return status;\n}\n\nconst Banner: React.FC<IBannerProps> = ({\n status: statusProp,\n headerTitle,\n headerIcon = true,\n title,\n description,\n withIcon = true,\n actions = [],\n onDismiss,\n children,\n className,\n textDirection,\n}) => {\n const { theme } = useKitsTheme();\n const { t, isRTL, isKeyExists } = useLanguage();\n const hasActions = actions.length > 0;\n const status = statusProp ?? (hasActions ? \"error\" : \"info\");\n const sev = useSeverityColors(statusToSeverity(status));\n\n /*\n * ⛔ THE HEADING IS THE CONSUMER'S TO WRITE. This read\n * `hasActions ? \"Action required…\" : headerTitle`, so a caller that passed\n * a translated `headerTitle` AND any actions had it thrown away and an\n * ENGLISH LITERAL rendered instead — with no prop, theme value or locale\n * key able to reach it.\n *\n * ⛔ FOUND IN AN ARABIC APP, 19 September 2026: AlphaMatch's Me tab showed\n * \"Action required\" in English on an otherwise fully Arabic screen, while\n * the app's OWN translated string for it sat unused one call away. Grepping\n * the app for the English text finds only its locale file, which is exactly\n * why it reads as an app bug and is not one.\n *\n * ⚠️ THE FALLBACK IS LOCALISED, BUT ONLY WHERE A TRANSLATION EXISTS.\n * `isKeyExists` is checked first so a language without the key keeps\n * today's English rather than rendering the raw key at a user — 38 of this\n * library's 40 locale files have not been given this string, and a visible\n * `actionRequired` would be a worse defect than the one being fixed.\n *\n * ⚠️ THE COUNT SUFFIX BELONGS TO THE FALLBACK, NOT TO THE CONSUMER. A title\n * someone wrote is a complete sentence; appending \"(3)\" to it is the\n * library talking over them.\n */\n const actionRequiredLabel = isKeyExists?.(\"actionRequired\")\n ? t(\"actionRequired\")\n : \"Action required\";\n const computedHeaderTitle = hasActions\n ? headerTitle ??\n `${actionRequiredLabel}${actions.length > 1 ? ` (${actions.length})` : \"\"}`\n : headerTitle;\n\n const hasHeader = !!computedHeaderTitle;\n const hasBody = !!(title || description || children);\n\n /*\n * ⛔ THE DIRECTION DEFAULTS TO THE ACTIVE LANGUAGE, NOT TO ENGLISH. This\n * prop defaulted to `\"ltr\"`, so every caller that did not pass it — which\n * was all of them — got a left-to-right banner in an Arabic app, and none\n * of them could find out. A library shipping to an RTL product reads the\n * direction itself; the prop stays, for the caller that needs to override.\n */\n const resolvedDirection = textDirection ?? (isRTL ? \"rtl\" : \"ltr\");\n const rowDirection = resolvedDirection === \"rtl\" ? \"row-reverse\" : \"row\";\n\n const headerIconNode = (() => {\n if (!headerIcon) return null;\n if (status === \"brand\" && theme.config.logo) return <>{theme.config.logo}</>;\n if (hasActions) return <Icon name={AlertTriangle} color={sev.solidText} size=\"sm\" />;\n const IconComp = icons[status];\n return IconComp ? <Icon name={IconComp} color={sev.solidText} size=\"sm\" /> : null;\n })();\n\n const bodyIconNode = (() => {\n if (!withIcon) return null;\n if (status === \"brand\" && theme.config.logo) return <>{theme.config.logo}</>;\n const IconComp = icons[status];\n return IconComp ? <Icon name={IconComp} color={sev.iconFg} size=\"sm\" /> : null;\n })();\n\n const renderActionRow = (bannerAction: BannerAction, index: number) => (\n <Flex\n key={bannerAction.id}\n flexDirection={rowDirection}\n alignItems=\"flex-start\"\n gap={10}\n style={{\n padding: 12,\n borderTopWidth: index > 0 ? 1 : 0,\n borderTopColor: sev.border,\n }}\n >\n <Flex\n alignItems=\"center\"\n justifyContent=\"center\"\n style={{\n width: 28,\n height: 28,\n borderRadius: 8,\n backgroundColor: \"#fff\",\n borderWidth: 1,\n borderColor: sev.border,\n flexShrink: 0,\n }}\n >\n {bannerAction.icon ?? <Icon name={AlertTriangle} color={sev.iconFg} size=\"sm\" />}\n </Flex>\n <Flex flexDirection=\"column\" gap={2} style={{ flex: 1 }}>\n <Text fontWeight=\"bold\" size=\"sm\" style={{ color: sev.text }}>\n {bannerAction.label}\n </Text>\n {bannerAction.detail && (\n <Text size=\"xs\" style={{ color: sev.text, lineHeight: 17 }}>\n {bannerAction.detail}\n </Text>\n )}\n </Flex>\n {bannerAction.cta && (\n <Pressable\n onPress={bannerAction.onCta}\n style={{\n backgroundColor: sev.solid,\n borderRadius: 999,\n paddingHorizontal: 12,\n paddingVertical: 7,\n // ⛔ `rowDirection`, NOT a hardcoded \"row\". This was the\n // one row in the component that ignored the direction\n // every other row obeyed, so even a caller that DID\n // pass textDirection=\"rtl\" got this pill backwards.\n flexDirection: rowDirection,\n alignItems: \"center\",\n gap: 4,\n flexShrink: 0,\n }}\n >\n <Text\n fontWeight=\"bold\"\n size=\"xs\"\n style={{ color: sev.solidText }}\n >\n {bannerAction.cta}\n </Text>\n {/* ⛔ THE ARROW MEANS \"ONWARDS\", SO IT FOLLOWS THE READER.\n It was always ArrowRight, which in Arabic points back\n the way the eye came — on the one control the banner\n exists to get pressed. */}\n {resolvedDirection === \"rtl\" ? (\n <ArrowLeft size={12} color={sev.solidText} />\n ) : (\n <ArrowRight size={12} color={sev.solidText} />\n )}\n </Pressable>\n )}\n </Flex>\n );\n\n return (\n <Flex\n flexDirection=\"column\"\n className={className}\n style={{\n borderRadius: 8,\n overflow: \"hidden\",\n writingDirection: resolvedDirection,\n }}\n >\n {/* Header bar */}\n {hasHeader && (\n <Flex\n flexDirection={rowDirection}\n alignItems=\"center\"\n gap={6}\n style={{\n backgroundColor: sev.solid,\n paddingVertical: 8,\n paddingHorizontal: 12,\n }}\n >\n {headerIconNode}\n <Text fontWeight=\"bold\" size=\"sm\" style={{ color: sev.solidText, flex: 1 }}>\n {computedHeaderTitle}\n </Text>\n {onDismiss && (\n <Pressable\n accessibilityLabel=\"Dismiss\"\n onPress={onDismiss}\n style={{\n width: 24,\n height: 24,\n borderRadius: 999,\n backgroundColor: \"rgba(255, 255, 255, 0.2)\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <X size={14} color={sev.solidText} />\n </Pressable>\n )}\n </Flex>\n )}\n\n {/* Body section */}\n {hasActions ? (\n <Flex\n flexDirection=\"column\"\n style={{\n backgroundColor: sev.bgTint,\n }}\n >\n {actions.map(renderActionRow)}\n </Flex>\n ) : hasBody && (\n <Flex\n flexDirection={rowDirection}\n alignItems=\"center\"\n gap={12}\n style={{\n backgroundColor: sev.bgTint,\n padding: 12,\n justifyContent: \"space-between\",\n }}\n >\n <Flex flexDirection=\"column\" gap={4} style={{ flex: 1 }}>\n {(withIcon || title) && (\n <Flex flexDirection={rowDirection} alignItems=\"center\" gap={6}>\n {bodyIconNode}\n {title && (\n <Text fontWeight=\"bold\" size=\"sm\" style={{ color: sev.text }}>\n {title}\n </Text>\n )}\n </Flex>\n )}\n {description && (\n <Text size=\"xs\" style={{ color: sev.text }}>\n {description}\n </Text>\n )}\n {children}\n </Flex>\n </Flex>\n )}\n </Flex>\n );\n};\n\nexport default Banner;\n"],"names":[],"mappings":";;;;;;;;;;;;AAkBA,MAAM,KAAA,GAA6B;AAAA,EAC/B,KAAA,EAAO,OAAA;AAAA,EACP,OAAA,EAAS,YAAA;AAAA,EACT,OAAA,EAAS,aAAA;AAAA,EACT,IAAA,EAAM;AACV,CAAA;AAEA,SAAS,iBAAiB,MAAA,EAAgC;AACtD,EAAA,IAAI,MAAA,KAAW,SAAS,OAAO,QAAA;AAC/B,EAAA,OAAO,MAAA;AACX;AAEA,MAAM,SAAiC,CAAC;AAAA,EACpC,MAAA,EAAQ,UAAA;AAAA,EACR,WAAA;AAAA,EACA,UAAA,GAAa,IAAA;AAAA,EACb,KAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA,GAAW,IAAA;AAAA,EACX,UAAU,EAAC;AAAA,EACX,S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AA,cACT,cAAA,EAAgB;AAAA,aACpB;AAAA,YAEA,QAAA,kBAAA,IAAA,CAAC,IAAA,EAAA,EAAK,aAAA,EAAc,QAAA,EAAS,GAAA,EAAK,GAAG,KAAA,EAAO,EAAE,IAAA,EAAM,CAAA,EAAE,EAChD,QAAA,EAAA;AAAA,cAAA,CAAA,QAAA,IAAY,KAAA,0BACT,IAAA,EAAA,EAAK,aAAA,EAAe,cAAc,UAAA,EAAW,QAAA,EAAS,KAAK,CAAA,EACvD,QAAA,EAAA;AAAA,gBAAA,YAAA;AAAA,gBACA,KAAA,oBACG,GAAA,CAAC,IAAA,EAAA,EAAK,UAAA,EAAW,MAAA,EAAO,IAAA,EAAK,IAAA,EAAK,KAAA,EAAO,EAAE,KAAA,EAAO,GAAA,CAAI,IAAA,IACjD,QAAA,EAAA,KAAA,EACL;AAAA,eAAA,EAER,CAAA;AAAA,cAEH,WAAA,oBACG,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAK,IAAA,EAAK,KAAA,EAAO,EAAE,KAAA,EAAO,GAAA,CAAI,IAAA,EAAK,EACpC,QAAA,EAAA,WAAA,EACL,CAAA;AAAA,cAEH;AAAA,aAAA,EACL;AAAA;AAAA;AACJ;AAAA;AAAA,GAER;AAER;;;;"}
|
|
@@ -7,6 +7,7 @@ var index_native = require('../../assets/Icons/index.cjs');
|
|
|
7
7
|
var useSeverityColors = require('../../hooks/useSeverityColors.cjs');
|
|
8
8
|
require('../../contexts/DialogContext.cjs');
|
|
9
9
|
var useResolvedStyle = require('../../hooks/useResolvedStyle.cjs');
|
|
10
|
+
var useRtlLineHeight = require('../../hooks/useRtlLineHeight.cjs');
|
|
10
11
|
|
|
11
12
|
const SIZE_MAP = {
|
|
12
13
|
sm: { fontSize: 12, px: 8, py: 4, gap: 6, iconSize: 12, height: 24, removeSize: 12 },
|
|
@@ -55,6 +56,7 @@ function Chip(props) {
|
|
|
55
56
|
const sizeStr = String(rawSize ?? "md");
|
|
56
57
|
const size = sizeStr === "sm" || sizeStr === "lg" ? sizeStr : "md";
|
|
57
58
|
const sizeConfig = SIZE_MAP[size];
|
|
59
|
+
const rtlLineHeight = useRtlLineHeight.default(size, sizeConfig.fontSize);
|
|
58
60
|
const sevColors = useSeverityColors.useSeverityColors(severity);
|
|
59
61
|
const visual = React.useMemo(() => {
|
|
60
62
|
if (selected && !outlined) {
|
|
@@ -105,7 +107,17 @@ function Chip(props) {
|
|
|
105
107
|
style: {
|
|
106
108
|
fontSize: sizeConfig.fontSize,
|
|
107
109
|
fontWeight: "500",
|
|
108
|
-
color: visual.textColor
|
|
110
|
+
color: visual.textColor,
|
|
111
|
+
/* ⛔ ARABIC CLIPS WITHOUT AN EXPLICIT LINE BOX, AND THE
|
|
112
|
+
CHIP'S OWN HEIGHT DOES NOT SAVE IT. Every SIZE_MAP
|
|
113
|
+
row is already tall enough — 24/32/40 against font
|
|
114
|
+
sizes 12/14/16, all above the 1.5x this script needs.
|
|
115
|
+
The container was never the problem: React Native
|
|
116
|
+
gives this raw <Text> the FONT'S natural line box,
|
|
117
|
+
and NotoKufiArabic's is too short for its own
|
|
118
|
+
ascenders, so the glyph is cut inside a box with room
|
|
119
|
+
to spare. undefined in LTR — English is unchanged. */
|
|
120
|
+
...rtlLineHeight != null ? { lineHeight: rtlLineHeight } : {}
|
|
109
121
|
},
|
|
110
122
|
numberOfLines: 1,
|
|
111
123
|
children: content
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/Chip/index.native.tsx"],"sourcesContent":["import React, {useMemo} from \"react\";\nimport {Pressable, Text, View, StyleSheet} from \"react-native\";\nimport type {IChipProps, IconName} from \"@lmb-it/kitsconcerto-types\";\nimport {IconMap} from \"../../assets/Icons\";\nimport {useSeverityColors} from \"../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../hooks\";\n\nconst SIZE_MAP = {\n sm: {fontSize: 12, px: 8, py: 4, gap: 6, iconSize: 12, height: 24, removeSize: 12},\n md: {fontSize: 14, px: 12, py: 6, gap: 6, iconSize: 14, height: 32, removeSize: 14},\n lg: {fontSize: 16, px: 14, py: 8, gap: 8, iconSize: 16, height: 40, removeSize: 16},\n} as const;\n\nfunction resolveIcon(icon: unknown, color: string, iconSize: number): React.ReactNode {\n if (!icon) return null;\n if (icon === \"dot\") {\n return (\n <View\n style={{\n width: 6,\n height: 6,\n borderRadius: 3,\n backgroundColor: color,\n }}\n />\n );\n }\n if (React.isValidElement(icon)) return icon;\n if (typeof icon !== \"string\") return null;\n const Component = IconMap[icon as IconName];\n if (Component) return <Component size={iconSize} color={color}/>;\n return null;\n}\n\nexport function Chip(props: IChipProps) {\n const {\n label,\n children,\n icon,\n selected = false,\n onPress,\n disabled = false,\n onRemove,\n severity = \"secondary\",\n size: rawSize,\n outlined,\n testID,\n style,\n // LEGIT-PLATFORM-ONLY (web): className is a CSS class hook with no\n // native equivalent — use `style` for cross-platform overrides.\n } = props;\n const resolvedStyle = useResolvedStyle(style || {});\n\n const sizeStr = String(rawSize ?? \"md\");\n const size: \"sm\" | \"md\" | \"lg\" = sizeStr === \"sm\" || sizeStr === \"lg\" ? sizeStr : \"md\";\n const sizeConfig = SIZE_MAP[size];\n\n const sevColors = useSeverityColors(severity as any);\n\n const visual = useMemo(() => {\n if (selected && !outlined) {\n return {\n backgroundColor: sevColors.solid,\n textColor: sevColors.solidText,\n borderColor: sevColors.border || sevColors.solid,\n };\n }\n if (outlined) {\n return {\n backgroundColor: \"transparent\",\n textColor: sevColors.solid,\n borderColor: sevColors.solid,\n };\n }\n return {\n backgroundColor: sevColors.bgTint,\n textColor: sevColors.text,\n borderColor: sevColors.border,\n };\n }, [selected, outlined, sevColors]);\n\n const resolvedIcon = resolveIcon(icon, visual.textColor, sizeConfig.iconSize);\n const content = label ?? children;\n const isInteractive = !!onPress && !disabled;\n\n const containerStyle = {\n flexDirection: \"row\" as const,\n alignItems: \"center\" as const,\n justifyContent: \"center\" as const,\n gap: sizeConfig.gap,\n height: sizeConfig.height,\n paddingHorizontal: sizeConfig.px,\n paddingRight: onRemove ? sizeConfig.gap : sizeConfig.px,\n borderRadius: 9999,\n borderWidth: 1,\n borderStyle: \"solid\" as const,\n backgroundColor: visual.backgroundColor,\n borderColor: visual.borderColor,\n opacity: disabled ? 0.5 : 1,\n // Consumer `style` wins last — mirrors web's computedCss merge order.\n ...(resolvedStyle as object),\n };\n\n const inner = (\n <>\n {resolvedIcon}\n {content != null && (\n <Text\n style={{\n fontSize: sizeConfig.fontSize,\n fontWeight: \"500\",\n color: visual.textColor,\n }}\n numberOfLines={1}\n >\n {content}\n </Text>\n )}\n {onRemove && (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel=\"Remove\"\n onPress={(e) => {\n e.stopPropagation?.();\n if (!disabled) onRemove();\n }}\n hitSlop={6}\n style={{\n marginLeft: 2,\n width: sizeConfig.removeSize + 4,\n height: sizeConfig.removeSize + 4,\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: (sizeConfig.removeSize + 4) / 2,\n }}\n >\n <Text style={{fontSize: sizeConfig.removeSize, color: visual.textColor, lineHeight: sizeConfig.removeSize + 2}}>×</Text>\n </Pressable>\n )}\n </>\n );\n\n if (isInteractive) {\n return (\n <Pressable\n onPress={onPress}\n disabled={disabled}\n accessibilityRole=\"button\"\n accessibilityState={{selected, disabled}}\n testID={testID}\n style={({pressed}) => [containerStyle, pressed && styles.pressed]}\n >\n {inner}\n </Pressable>\n );\n }\n\n return (\n <View style={containerStyle} testID={testID}>\n {inner}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n pressed: {\n opacity: 0.7,\n },\n});\n\nexport default Chip;\n"],"names":["jsx","View","IconMap","useResolvedStyle","useSeverityColors","useMemo","jsxs","Fragment","Text","Pressable","StyleSheet"],"mappings":";;;;;;;;;;AAOA,MAAM,QAAA,GAAW;AAAA,EACb,EAAA,EAAI,EAAC,QAAA,EAAU,EAAA,EAAI,IAAI,CAAA,EAAG,EAAA,EAAI,CAAA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A,CAAO;AAAA,EAC7B,OAAA,EAAS;AAAA,IACL,OAAA,EAAS;AAAA;AAEjB,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/Chip/index.native.tsx"],"sourcesContent":["import React, {useMemo} from \"react\";\nimport {Pressable, Text, View, StyleSheet} from \"react-native\";\nimport type {IChipProps, IconName} from \"@lmb-it/kitsconcerto-types\";\nimport {IconMap} from \"../../assets/Icons\";\nimport {useSeverityColors} from \"../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../hooks\";\nimport useRtlLineHeight from \"../../hooks/useRtlLineHeight\";\n\nconst SIZE_MAP = {\n sm: {fontSize: 12, px: 8, py: 4, gap: 6, iconSize: 12, height: 24, removeSize: 12},\n md: {fontSize: 14, px: 12, py: 6, gap: 6, iconSize: 14, height: 32, removeSize: 14},\n lg: {fontSize: 16, px: 14, py: 8, gap: 8, iconSize: 16, height: 40, removeSize: 16},\n} as const;\n\nfunction resolveIcon(icon: unknown, color: string, iconSize: number): React.ReactNode {\n if (!icon) return null;\n if (icon === \"dot\") {\n return (\n <View\n style={{\n width: 6,\n height: 6,\n borderRadius: 3,\n backgroundColor: color,\n }}\n />\n );\n }\n if (React.isValidElement(icon)) return icon;\n if (typeof icon !== \"string\") return null;\n const Component = IconMap[icon as IconName];\n if (Component) return <Component size={iconSize} color={color}/>;\n return null;\n}\n\nexport function Chip(props: IChipProps) {\n const {\n label,\n children,\n icon,\n selected = false,\n onPress,\n disabled = false,\n onRemove,\n severity = \"secondary\",\n size: rawSize,\n outlined,\n testID,\n style,\n // LEGIT-PLATFORM-ONLY (web): className is a CSS class hook with no\n // native equivalent — use `style` for cross-platform overrides.\n } = props;\n const resolvedStyle = useResolvedStyle(style || {});\n\n const sizeStr = String(rawSize ?? \"md\");\n const size: \"sm\" | \"md\" | \"lg\" = sizeStr === \"sm\" || sizeStr === \"lg\" ? sizeStr : \"md\";\n const sizeConfig = SIZE_MAP[size];\n\n // RTL only: NotoKufiArabic needs a taller line box than its own metrics\n // give it. `undefined` in LTR, so English chips are byte-identical.\n const rtlLineHeight = useRtlLineHeight(size as string, sizeConfig.fontSize);\n\n const sevColors = useSeverityColors(severity as any);\n\n const visual = useMemo(() => {\n if (selected && !outlined) {\n return {\n backgroundColor: sevColors.solid,\n textColor: sevColors.solidText,\n borderColor: sevColors.border || sevColors.solid,\n };\n }\n if (outlined) {\n return {\n backgroundColor: \"transparent\",\n textColor: sevColors.solid,\n borderColor: sevColors.solid,\n };\n }\n return {\n backgroundColor: sevColors.bgTint,\n textColor: sevColors.text,\n borderColor: sevColors.border,\n };\n }, [selected, outlined, sevColors]);\n\n const resolvedIcon = resolveIcon(icon, visual.textColor, sizeConfig.iconSize);\n const content = label ?? children;\n const isInteractive = !!onPress && !disabled;\n\n const containerStyle = {\n flexDirection: \"row\" as const,\n alignItems: \"center\" as const,\n justifyContent: \"center\" as const,\n gap: sizeConfig.gap,\n height: sizeConfig.height,\n paddingHorizontal: sizeConfig.px,\n paddingRight: onRemove ? sizeConfig.gap : sizeConfig.px,\n borderRadius: 9999,\n borderWidth: 1,\n borderStyle: \"solid\" as const,\n backgroundColor: visual.backgroundColor,\n borderColor: visual.borderColor,\n opacity: disabled ? 0.5 : 1,\n // Consumer `style` wins last — mirrors web's computedCss merge order.\n ...(resolvedStyle as object),\n };\n\n const inner = (\n <>\n {resolvedIcon}\n {content != null && (\n <Text\n style={{\n fontSize: sizeConfig.fontSize,\n fontWeight: \"500\",\n color: visual.textColor,\n /* ⛔ ARABIC CLIPS WITHOUT AN EXPLICIT LINE BOX, AND THE\n CHIP'S OWN HEIGHT DOES NOT SAVE IT. Every SIZE_MAP\n row is already tall enough — 24/32/40 against font\n sizes 12/14/16, all above the 1.5x this script needs.\n The container was never the problem: React Native\n gives this raw <Text> the FONT'S natural line box,\n and NotoKufiArabic's is too short for its own\n ascenders, so the glyph is cut inside a box with room\n to spare. undefined in LTR — English is unchanged. */\n ...(rtlLineHeight != null ? {lineHeight: rtlLineHeight} : {}),\n }}\n numberOfLines={1}\n >\n {content}\n </Text>\n )}\n {onRemove && (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel=\"Remove\"\n onPress={(e) => {\n e.stopPropagation?.();\n if (!disabled) onRemove();\n }}\n hitSlop={6}\n style={{\n marginLeft: 2,\n width: sizeConfig.removeSize + 4,\n height: sizeConfig.removeSize + 4,\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: (sizeConfig.removeSize + 4) / 2,\n }}\n >\n <Text style={{fontSize: sizeConfig.removeSize, color: visual.textColor, lineHeight: sizeConfig.removeSize + 2}}>×</Text>\n </Pressable>\n )}\n </>\n );\n\n if (isInteractive) {\n return (\n <Pressable\n onPress={onPress}\n disabled={disabled}\n accessibilityRole=\"button\"\n accessibilityState={{selected, disabled}}\n testID={testID}\n style={({pressed}) => [containerStyle, pressed && styles.pressed]}\n >\n {inner}\n </Pressable>\n );\n }\n\n return (\n <View style={containerStyle} testID={testID}>\n {inner}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n pressed: {\n opacity: 0.7,\n },\n});\n\nexport default Chip;\n"],"names":["jsx","View","IconMap","useResolvedStyle","useRtlLineHeight","useSeverityColors","useMemo","jsxs","Fragment","Text","Pressable","StyleSheet"],"mappings":";;;;;;;;;;;AAQA,MAAM,QAAA,GAAW;AAAA,EACb,EAAA,EAAI,EAAC,QAAA,EAAU,EAAA,EAAI,IAAI,CAAA,EAAG,EAAA,EAAI,CAAA,EAAG,GAAA,EAAK,GAAG,QAAA,EAAU,EAAA,EAAI,MAAA,EAAQ,EAAA,EAAI,YAAY,EAAA,EAAE;AAAA,EACjF,EAAA,EAAI,EAAC,QAAA,EAAU,EAAA,EAAI,IAAI,EAAA,EAAI,EAAA,EAAI,CAAA,EAAG,GAAA,EAAK,GAAG,QAAA,EAAU,EAAA,EAAI,MAAA,EAAQ,EAAA,EAAI,YAAY,EAAA,EAAE;AAAA,EAClF,EAAA,EAAI,EAAC,QAAA,EA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/components/Chip/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { IconMap } from '../../assets/Icons/index.js';
|
|
|
5
5
|
import { useSeverityColors } from '../../hooks/useSeverityColors.js';
|
|
6
6
|
import '../../contexts/DialogContext.js';
|
|
7
7
|
import useResolvedStyle from '../../hooks/useResolvedStyle.js';
|
|
8
|
+
import useRtlLineHeight from '../../hooks/useRtlLineHeight.js';
|
|
8
9
|
|
|
9
10
|
const SIZE_MAP = {
|
|
10
11
|
sm: { fontSize: 12, px: 8, py: 4, gap: 6, iconSize: 12, height: 24, removeSize: 12 },
|
|
@@ -53,6 +54,7 @@ function Chip(props) {
|
|
|
53
54
|
const sizeStr = String(rawSize ?? "md");
|
|
54
55
|
const size = sizeStr === "sm" || sizeStr === "lg" ? sizeStr : "md";
|
|
55
56
|
const sizeConfig = SIZE_MAP[size];
|
|
57
|
+
const rtlLineHeight = useRtlLineHeight(size, sizeConfig.fontSize);
|
|
56
58
|
const sevColors = useSeverityColors(severity);
|
|
57
59
|
const visual = useMemo(() => {
|
|
58
60
|
if (selected && !outlined) {
|
|
@@ -103,7 +105,17 @@ function Chip(props) {
|
|
|
103
105
|
style: {
|
|
104
106
|
fontSize: sizeConfig.fontSize,
|
|
105
107
|
fontWeight: "500",
|
|
106
|
-
color: visual.textColor
|
|
108
|
+
color: visual.textColor,
|
|
109
|
+
/* ⛔ ARABIC CLIPS WITHOUT AN EXPLICIT LINE BOX, AND THE
|
|
110
|
+
CHIP'S OWN HEIGHT DOES NOT SAVE IT. Every SIZE_MAP
|
|
111
|
+
row is already tall enough — 24/32/40 against font
|
|
112
|
+
sizes 12/14/16, all above the 1.5x this script needs.
|
|
113
|
+
The container was never the problem: React Native
|
|
114
|
+
gives this raw <Text> the FONT'S natural line box,
|
|
115
|
+
and NotoKufiArabic's is too short for its own
|
|
116
|
+
ascenders, so the glyph is cut inside a box with room
|
|
117
|
+
to spare. undefined in LTR — English is unchanged. */
|
|
118
|
+
...rtlLineHeight != null ? { lineHeight: rtlLineHeight } : {}
|
|
107
119
|
},
|
|
108
120
|
numberOfLines: 1,
|
|
109
121
|
children: content
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Chip/index.native.tsx"],"sourcesContent":["import React, {useMemo} from \"react\";\nimport {Pressable, Text, View, StyleSheet} from \"react-native\";\nimport type {IChipProps, IconName} from \"@lmb-it/kitsconcerto-types\";\nimport {IconMap} from \"../../assets/Icons\";\nimport {useSeverityColors} from \"../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../hooks\";\n\nconst SIZE_MAP = {\n sm: {fontSize: 12, px: 8, py: 4, gap: 6, iconSize: 12, height: 24, removeSize: 12},\n md: {fontSize: 14, px: 12, py: 6, gap: 6, iconSize: 14, height: 32, removeSize: 14},\n lg: {fontSize: 16, px: 14, py: 8, gap: 8, iconSize: 16, height: 40, removeSize: 16},\n} as const;\n\nfunction resolveIcon(icon: unknown, color: string, iconSize: number): React.ReactNode {\n if (!icon) return null;\n if (icon === \"dot\") {\n return (\n <View\n style={{\n width: 6,\n height: 6,\n borderRadius: 3,\n backgroundColor: color,\n }}\n />\n );\n }\n if (React.isValidElement(icon)) return icon;\n if (typeof icon !== \"string\") return null;\n const Component = IconMap[icon as IconName];\n if (Component) return <Component size={iconSize} color={color}/>;\n return null;\n}\n\nexport function Chip(props: IChipProps) {\n const {\n label,\n children,\n icon,\n selected = false,\n onPress,\n disabled = false,\n onRemove,\n severity = \"secondary\",\n size: rawSize,\n outlined,\n testID,\n style,\n // LEGIT-PLATFORM-ONLY (web): className is a CSS class hook with no\n // native equivalent — use `style` for cross-platform overrides.\n } = props;\n const resolvedStyle = useResolvedStyle(style || {});\n\n const sizeStr = String(rawSize ?? \"md\");\n const size: \"sm\" | \"md\" | \"lg\" = sizeStr === \"sm\" || sizeStr === \"lg\" ? sizeStr : \"md\";\n const sizeConfig = SIZE_MAP[size];\n\n const sevColors = useSeverityColors(severity as any);\n\n const visual = useMemo(() => {\n if (selected && !outlined) {\n return {\n backgroundColor: sevColors.solid,\n textColor: sevColors.solidText,\n borderColor: sevColors.border || sevColors.solid,\n };\n }\n if (outlined) {\n return {\n backgroundColor: \"transparent\",\n textColor: sevColors.solid,\n borderColor: sevColors.solid,\n };\n }\n return {\n backgroundColor: sevColors.bgTint,\n textColor: sevColors.text,\n borderColor: sevColors.border,\n };\n }, [selected, outlined, sevColors]);\n\n const resolvedIcon = resolveIcon(icon, visual.textColor, sizeConfig.iconSize);\n const content = label ?? children;\n const isInteractive = !!onPress && !disabled;\n\n const containerStyle = {\n flexDirection: \"row\" as const,\n alignItems: \"center\" as const,\n justifyContent: \"center\" as const,\n gap: sizeConfig.gap,\n height: sizeConfig.height,\n paddingHorizontal: sizeConfig.px,\n paddingRight: onRemove ? sizeConfig.gap : sizeConfig.px,\n borderRadius: 9999,\n borderWidth: 1,\n borderStyle: \"solid\" as const,\n backgroundColor: visual.backgroundColor,\n borderColor: visual.borderColor,\n opacity: disabled ? 0.5 : 1,\n // Consumer `style` wins last — mirrors web's computedCss merge order.\n ...(resolvedStyle as object),\n };\n\n const inner = (\n <>\n {resolvedIcon}\n {content != null && (\n <Text\n style={{\n fontSize: sizeConfig.fontSize,\n fontWeight: \"500\",\n color: visual.textColor,\n }}\n numberOfLines={1}\n >\n {content}\n </Text>\n )}\n {onRemove && (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel=\"Remove\"\n onPress={(e) => {\n e.stopPropagation?.();\n if (!disabled) onRemove();\n }}\n hitSlop={6}\n style={{\n marginLeft: 2,\n width: sizeConfig.removeSize + 4,\n height: sizeConfig.removeSize + 4,\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: (sizeConfig.removeSize + 4) / 2,\n }}\n >\n <Text style={{fontSize: sizeConfig.removeSize, color: visual.textColor, lineHeight: sizeConfig.removeSize + 2}}>×</Text>\n </Pressable>\n )}\n </>\n );\n\n if (isInteractive) {\n return (\n <Pressable\n onPress={onPress}\n disabled={disabled}\n accessibilityRole=\"button\"\n accessibilityState={{selected, disabled}}\n testID={testID}\n style={({pressed}) => [containerStyle, pressed && styles.pressed]}\n >\n {inner}\n </Pressable>\n );\n }\n\n return (\n <View style={containerStyle} testID={testID}>\n {inner}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n pressed: {\n opacity: 0.7,\n },\n});\n\nexport default Chip;\n"],"names":[],"mappings":";;;;;;;;AAOA,MAAM,QAAA,GAAW;AAAA,EACb,EAAA,EAAI,EAAC,QAAA,EAAU,EAAA,EAAI,IAAI,CAAA,EAAG,EAAA,EAAI,CAAA,EAAG,GAAA,EAAK,GAAG,QAAA,EAAU,EAAA,EAAI,MAAA,EAAQ,EAAA,EAAI,YAAY,EAAA,EAAE;AAAA,EACjF,EAAA,EAAI,EAAC,QAAA,EAAU,EAAA,EAAI,IAAI,EAAA,EAAI,EAAA,EAAI,CAAA,EAAG,GAAA,EAAK,GAAG,QAAA,EAAU,EAAA,EAAI,MAAA,EAAQ,EAAA,EAAI,YAAY,EAAA,EAAE;AAAA,EAClF,EAAA,EAAI,EAAC,QAAA,EAAU,EAAA,EAAI,IAAI,EAAA,EAAI,EAAA,EAAI,CAAA,EAAG,GAAA,EAAK,GAAG,QAAA,EAAU,EAAA,EAAI,MAAA,EAAQ,EAAA,EAAI,YAAY,EAAA;AACpF,CAAA;AAEA,SAAS,WAAA,CAAY,IAAA,EAAe,KAAA,EAAe,QAAA,EAAmC;AAClF,EAAA,IAAI,CAAC,MAAM,OAAO,IAAA;AAClB,EAAA,IAAI,SAAS,KAAA,EAAO;AAChB,IAAA,uBACI,GAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACG,KAAA,EAAO;AAAA,UACH,KAAA,EAAO,CAAA;AAAA,UACP,MAAA,EAAQ,CAAA;AAAA,UACR,YAAA,EAAc,CAAA;AAAA,UACd,eAAA,EAAiB;AAAA;AACrB;AAAA,KACJ;AAAA,EAER;AACA,EAAA,IAAI,KAAA,CAAM,cAAA,CAAe,IAA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,QAAA,EAAQ;AAAA,QACvC,MAAA;AAAA,QACA,KAAA,EAAO,CAAC,EAAC,OAAA,OAAa,CAAC,cAAA,EAAgB,OAAA,IAAW,MAAA,CAAO,OAAO,CAAA;AAAA,QAE/D,QAAA,EAAA;AAAA;AAAA,KACL;AAAA,EAER;AAEA,EAAA,uBACI,GAAA,CAAC,IAAA,EAAA,EAAK,KAAA,EAAO,cAAA,EAAgB,QACxB,QAAA,EAAA,KAAA,EACL,CAAA;AAER;AAEA,MAAM,MAAA,GAAS,WAAW,MAAA,CAAO;AAAA,EAC7B,OAAA,EAAS;AAAA,IACL,OAAA,EAAS;AAAA;AAEjB,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Chip/index.native.tsx"],"sourcesContent":["import React, {useMemo} from \"react\";\nimport {Pressable, Text, View, StyleSheet} from \"react-native\";\nimport type {IChipProps, IconName} from \"@lmb-it/kitsconcerto-types\";\nimport {IconMap} from \"../../assets/Icons\";\nimport {useSeverityColors} from \"../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../hooks\";\nimport useRtlLineHeight from \"../../hooks/useRtlLineHeight\";\n\nconst SIZE_MAP = {\n sm: {fontSize: 12, px: 8, py: 4, gap: 6, iconSize: 12, height: 24, removeSize: 12},\n md: {fontSize: 14, px: 12, py: 6, gap: 6, iconSize: 14, height: 32, removeSize: 14},\n lg: {fontSize: 16, px: 14, py: 8, gap: 8, iconSize: 16, height: 40, removeSize: 16},\n} as const;\n\nfunction resolveIcon(icon: unknown, color: string, iconSize: number): React.ReactNode {\n if (!icon) return null;\n if (icon === \"dot\") {\n return (\n <View\n style={{\n width: 6,\n height: 6,\n borderRadius: 3,\n backgroundColor: color,\n }}\n />\n );\n }\n if (React.isValidElement(icon)) return icon;\n if (typeof icon !== \"string\") return null;\n const Component = IconMap[icon as IconName];\n if (Component) return <Component size={iconSize} color={color}/>;\n return null;\n}\n\nexport function Chip(props: IChipProps) {\n const {\n label,\n children,\n icon,\n selected = false,\n onPress,\n disabled = false,\n onRemove,\n severity = \"secondary\",\n size: rawSize,\n outlined,\n testID,\n style,\n // LEGIT-PLATFORM-ONLY (web): className is a CSS class hook with no\n // native equivalent — use `style` for cross-platform overrides.\n } = props;\n const resolvedStyle = useResolvedStyle(style || {});\n\n const sizeStr = String(rawSize ?? \"md\");\n const size: \"sm\" | \"md\" | \"lg\" = sizeStr === \"sm\" || sizeStr === \"lg\" ? sizeStr : \"md\";\n const sizeConfig = SIZE_MAP[size];\n\n // RTL only: NotoKufiArabic needs a taller line box than its own metrics\n // give it. `undefined` in LTR, so English chips are byte-identical.\n const rtlLineHeight = useRtlLineHeight(size as string, sizeConfig.fontSize);\n\n const sevColors = useSeverityColors(severity as any);\n\n const visual = useMemo(() => {\n if (selected && !outlined) {\n return {\n backgroundColor: sevColors.solid,\n textColor: sevColors.solidText,\n borderColor: sevColors.border || sevColors.solid,\n };\n }\n if (outlined) {\n return {\n backgroundColor: \"transparent\",\n textColor: sevColors.solid,\n borderColor: sevColors.solid,\n };\n }\n return {\n backgroundColor: sevColors.bgTint,\n textColor: sevColors.text,\n borderColor: sevColors.border,\n };\n }, [selected, outlined, sevColors]);\n\n const resolvedIcon = resolveIcon(icon, visual.textColor, sizeConfig.iconSize);\n const content = label ?? children;\n const isInteractive = !!onPress && !disabled;\n\n const containerStyle = {\n flexDirection: \"row\" as const,\n alignItems: \"center\" as const,\n justifyContent: \"center\" as const,\n gap: sizeConfig.gap,\n height: sizeConfig.height,\n paddingHorizontal: sizeConfig.px,\n paddingRight: onRemove ? sizeConfig.gap : sizeConfig.px,\n borderRadius: 9999,\n borderWidth: 1,\n borderStyle: \"solid\" as const,\n backgroundColor: visual.backgroundColor,\n borderColor: visual.borderColor,\n opacity: disabled ? 0.5 : 1,\n // Consumer `style` wins last — mirrors web's computedCss merge order.\n ...(resolvedStyle as object),\n };\n\n const inner = (\n <>\n {resolvedIcon}\n {content != null && (\n <Text\n style={{\n fontSize: sizeConfig.fontSize,\n fontWeight: \"500\",\n color: visual.textColor,\n /* ⛔ ARABIC CLIPS WITHOUT AN EXPLICIT LINE BOX, AND THE\n CHIP'S OWN HEIGHT DOES NOT SAVE IT. Every SIZE_MAP\n row is already tall enough — 24/32/40 against font\n sizes 12/14/16, all above the 1.5x this script needs.\n The container was never the problem: React Native\n gives this raw <Text> the FONT'S natural line box,\n and NotoKufiArabic's is too short for its own\n ascenders, so the glyph is cut inside a box with room\n to spare. undefined in LTR — English is unchanged. */\n ...(rtlLineHeight != null ? {lineHeight: rtlLineHeight} : {}),\n }}\n numberOfLines={1}\n >\n {content}\n </Text>\n )}\n {onRemove && (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel=\"Remove\"\n onPress={(e) => {\n e.stopPropagation?.();\n if (!disabled) onRemove();\n }}\n hitSlop={6}\n style={{\n marginLeft: 2,\n width: sizeConfig.removeSize + 4,\n height: sizeConfig.removeSize + 4,\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: (sizeConfig.removeSize + 4) / 2,\n }}\n >\n <Text style={{fontSize: sizeConfig.removeSize, color: visual.textColor, lineHeight: sizeConfig.removeSize + 2}}>×</Text>\n </Pressable>\n )}\n </>\n );\n\n if (isInteractive) {\n return (\n <Pressable\n onPress={onPress}\n disabled={disabled}\n accessibilityRole=\"button\"\n accessibilityState={{selected, disabled}}\n testID={testID}\n style={({pressed}) => [containerStyle, pressed && styles.pressed]}\n >\n {inner}\n </Pressable>\n );\n }\n\n return (\n <View style={containerStyle} testID={testID}>\n {inner}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n pressed: {\n opacity: 0.7,\n },\n});\n\nexport default Chip;\n"],"names":[],"mappings":";;;;;;;;;AAQA,MAAM,QAAA,GAAW;AAAA,EACb,EAAA,EAAI,EAAC,QAAA,EAAU,EAAA,EAAI,IAAI,CAAA,EAAG,EAAA,EAAI,CAAA,EAAG,GAAA,EAAK,GAAG,QAAA,EAAU,EAAA,EAAI,MAAA,EAAQ,EA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GAAA,CAAC,IAAA,EAAA,EAAK,KAAA,EAAO,cAAA,EAAgB,QACxB,QAAA,EAAA,KAAA,EACL,CAAA;AAER;AAEA,MAAM,MAAA,GAAS,WAAW,MAAA,CAAO;AAAA,EAC7B,OAAA,EAAS;AAAA,IACL,OAAA,EAAS;AAAA;AAEjB,CAAC,CAAA;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -9536,6 +9536,7 @@ declare const localeFiles: {
|
|
|
9536
9536
|
rotateRight: string;
|
|
9537
9537
|
rotateLeft: string;
|
|
9538
9538
|
};
|
|
9539
|
+
actionRequired: string;
|
|
9539
9540
|
};
|
|
9540
9541
|
bg: {
|
|
9541
9542
|
accept: string;
|
|
@@ -10309,6 +10310,7 @@ declare const localeFiles: {
|
|
|
10309
10310
|
rotateRight: string;
|
|
10310
10311
|
rotateLeft: string;
|
|
10311
10312
|
};
|
|
10313
|
+
actionRequired: string;
|
|
10312
10314
|
};
|
|
10313
10315
|
es: {
|
|
10314
10316
|
startsWith: string;
|
package/locale/ar.json.cjs
CHANGED
|
@@ -217,6 +217,7 @@ var aria = {
|
|
|
217
217
|
rotateRight: "تدوير بإتجاه اليمين",
|
|
218
218
|
rotateLeft: "تدوير بأتجاه اليسار"
|
|
219
219
|
};
|
|
220
|
+
var actionRequired = "إجراء مطلوب";
|
|
220
221
|
var ar = {
|
|
221
222
|
startsWith: startsWith,
|
|
222
223
|
contains: contains,
|
|
@@ -323,10 +324,12 @@ var ar = {
|
|
|
323
324
|
after: after,
|
|
324
325
|
before: before,
|
|
325
326
|
not: not,
|
|
326
|
-
aria: aria
|
|
327
|
+
aria: aria,
|
|
328
|
+
actionRequired: actionRequired
|
|
327
329
|
};
|
|
328
330
|
|
|
329
331
|
exports.accept = accept;
|
|
332
|
+
exports.actionRequired = actionRequired;
|
|
330
333
|
exports.addCategory = addCategory;
|
|
331
334
|
exports.addImages = addImages;
|
|
332
335
|
exports.addItem = addItem;
|
package/locale/ar.json.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ar.json.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ar.json.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/locale/ar.json.js
CHANGED
|
@@ -213,6 +213,7 @@ var aria = {
|
|
|
213
213
|
rotateRight: "تدوير بإتجاه اليمين",
|
|
214
214
|
rotateLeft: "تدوير بأتجاه اليسار"
|
|
215
215
|
};
|
|
216
|
+
var actionRequired = "إجراء مطلوب";
|
|
216
217
|
var ar = {
|
|
217
218
|
startsWith: startsWith,
|
|
218
219
|
contains: contains,
|
|
@@ -319,8 +320,9 @@ var ar = {
|
|
|
319
320
|
after: after,
|
|
320
321
|
before: before,
|
|
321
322
|
not: not,
|
|
322
|
-
aria: aria
|
|
323
|
+
aria: aria,
|
|
324
|
+
actionRequired: actionRequired
|
|
323
325
|
};
|
|
324
326
|
|
|
325
|
-
export { accept, addCategory, addImages, addItem, addRule, after, am, any, apply, aria, before, between, cancel, changeImage, choose, chooseDate, chooseFile, chooseImage, chooseMonth, chooseYear, clear, clickOrDragToUpload, completed, contains, custom, dateAfter, dateBefore, dateFormat, dateIs, dateIsNot, dayNames, dayNamesMin, dayNamesShort, ar as default, _arbitrary0 as delete, dragFilesHere, edit, emptyFileUploadMessage, emptyFilterMessage, emptyMessage, emptySearchMessage, emptySelectionMessage, endsWith, equal, equals, fileSizeTypes, filesBeingDropped, filesSelected, filter, firstDayOfWeek, generatePhoto, greaterThan, greaterThanOrEqualTo, gt, gte, include, lessThan, lessThanOrEqualTo, lt, lte, matchAll, matchAny, maximumAllowedFiles, medium, monthNames, monthNamesShort, nextDecade, nextHour, nextMinute, nextMonth, nextSecond, nextYear, noFilter, not, notContains, notEquals, now, openMenu, password, passwordPrompt, pending, pm, prevDecade, prevHour, prevMinute, prevMonth, prevSecond, prevYear, profile, reject, remove, removeRule, save, searchMessage, selectionMessage, settings, showMonthAfterYear, signOut, startsWith, strong, tapToUpload, today, toggleColorMode, typeNotSupported, upload, weak, weekHeader };
|
|
327
|
+
export { accept, actionRequired, addCategory, addImages, addItem, addRule, after, am, any, apply, aria, before, between, cancel, changeImage, choose, chooseDate, chooseFile, chooseImage, chooseMonth, chooseYear, clear, clickOrDragToUpload, completed, contains, custom, dateAfter, dateBefore, dateFormat, dateIs, dateIsNot, dayNames, dayNamesMin, dayNamesShort, ar as default, _arbitrary0 as delete, dragFilesHere, edit, emptyFileUploadMessage, emptyFilterMessage, emptyMessage, emptySearchMessage, emptySelectionMessage, endsWith, equal, equals, fileSizeTypes, filesBeingDropped, filesSelected, filter, firstDayOfWeek, generatePhoto, greaterThan, greaterThanOrEqualTo, gt, gte, include, lessThan, lessThanOrEqualTo, lt, lte, matchAll, matchAny, maximumAllowedFiles, medium, monthNames, monthNamesShort, nextDecade, nextHour, nextMinute, nextMonth, nextSecond, nextYear, noFilter, not, notContains, notEquals, now, openMenu, password, passwordPrompt, pending, pm, prevDecade, prevHour, prevMinute, prevMonth, prevSecond, prevYear, profile, reject, remove, removeRule, save, searchMessage, selectionMessage, settings, showMonthAfterYear, signOut, startsWith, strong, tapToUpload, today, toggleColorMode, typeNotSupported, upload, weak, weekHeader };
|
|
326
328
|
//# sourceMappingURL=ar.json.js.map
|
package/locale/ar.json.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ar.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ar.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/locale/en.json.cjs
CHANGED
|
@@ -217,6 +217,7 @@ var aria = {
|
|
|
217
217
|
rotateRight: "Rotate Right",
|
|
218
218
|
rotateLeft: "Rotate Left"
|
|
219
219
|
};
|
|
220
|
+
var actionRequired = "Action required";
|
|
220
221
|
var en = {
|
|
221
222
|
startsWith: startsWith,
|
|
222
223
|
contains: contains,
|
|
@@ -323,10 +324,12 @@ var en = {
|
|
|
323
324
|
after: after,
|
|
324
325
|
before: before,
|
|
325
326
|
not: not,
|
|
326
|
-
aria: aria
|
|
327
|
+
aria: aria,
|
|
328
|
+
actionRequired: actionRequired
|
|
327
329
|
};
|
|
328
330
|
|
|
329
331
|
exports.accept = accept;
|
|
332
|
+
exports.actionRequired = actionRequired;
|
|
330
333
|
exports.addCategory = addCategory;
|
|
331
334
|
exports.addImages = addImages;
|
|
332
335
|
exports.addItem = addItem;
|
package/locale/en.json.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.json.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"en.json.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/locale/en.json.js
CHANGED
|
@@ -213,6 +213,7 @@ var aria = {
|
|
|
213
213
|
rotateRight: "Rotate Right",
|
|
214
214
|
rotateLeft: "Rotate Left"
|
|
215
215
|
};
|
|
216
|
+
var actionRequired = "Action required";
|
|
216
217
|
var en = {
|
|
217
218
|
startsWith: startsWith,
|
|
218
219
|
contains: contains,
|
|
@@ -319,8 +320,9 @@ var en = {
|
|
|
319
320
|
after: after,
|
|
320
321
|
before: before,
|
|
321
322
|
not: not,
|
|
322
|
-
aria: aria
|
|
323
|
+
aria: aria,
|
|
324
|
+
actionRequired: actionRequired
|
|
323
325
|
};
|
|
324
326
|
|
|
325
|
-
export { accept, addCategory, addImages, addItem, addRule, after, am, any, apply, aria, before, between, cancel, changeImage, choose, chooseDate, chooseFile, chooseImage, chooseMonth, chooseYear, clear, clickOrDragToUpload, completed, contains, custom, dateAfter, dateBefore, dateFormat, dateIs, dateIsNot, dayNames, dayNamesMin, dayNamesShort, en as default, _arbitrary0 as delete, dragFilesHere, edit, emptyFileUploadMessage, emptyFilterMessage, emptyMessage, emptySearchMessage, emptySelectionMessage, endsWith, equal, equals, fileSizeTypes, filesBeingDropped, filesSelected, filter, firstDayOfWeek, generatePhoto, greaterThan, greaterThanOrEqualTo, gt, gte, include, lessThan, lessThanOrEqualTo, lt, lte, matchAll, matchAny, maximumAllowedFiles, medium, monthNames, monthNamesShort, nextDecade, nextHour, nextMinute, nextMonth, nextSecond, nextYear, noFilter, not, notContains, notEquals, now, openMenu, password, passwordPrompt, pending, pm, prevDecade, prevHour, prevMinute, prevMonth, prevSecond, prevYear, profile, reject, remove, removeRule, save, searchMessage, selectionMessage, settings, showMonthAfterYear, signOut, startsWith, strong, tapToUpload, today, toggleColorMode, typeNotSupported, upload, weak, weekHeader };
|
|
327
|
+
export { accept, actionRequired, addCategory, addImages, addItem, addRule, after, am, any, apply, aria, before, between, cancel, changeImage, choose, chooseDate, chooseFile, chooseImage, chooseMonth, chooseYear, clear, clickOrDragToUpload, completed, contains, custom, dateAfter, dateBefore, dateFormat, dateIs, dateIsNot, dayNames, dayNamesMin, dayNamesShort, en as default, _arbitrary0 as delete, dragFilesHere, edit, emptyFileUploadMessage, emptyFilterMessage, emptyMessage, emptySearchMessage, emptySelectionMessage, endsWith, equal, equals, fileSizeTypes, filesBeingDropped, filesSelected, filter, firstDayOfWeek, generatePhoto, greaterThan, greaterThanOrEqualTo, gt, gte, include, lessThan, lessThanOrEqualTo, lt, lte, matchAll, matchAny, maximumAllowedFiles, medium, monthNames, monthNamesShort, nextDecade, nextHour, nextMinute, nextMonth, nextSecond, nextYear, noFilter, not, notContains, notEquals, now, openMenu, password, passwordPrompt, pending, pm, prevDecade, prevHour, prevMinute, prevMonth, prevSecond, prevYear, profile, reject, remove, removeRule, save, searchMessage, selectionMessage, settings, showMonthAfterYear, signOut, startsWith, strong, tapToUpload, today, toggleColorMode, typeNotSupported, upload, weak, weekHeader };
|
|
326
328
|
//# sourceMappingURL=en.json.js.map
|
package/locale/en.json.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var reactNative = require('react-native');
|
|
6
7
|
require('../../apps/mobile/src/ui/accordion/index.cjs');
|
|
7
8
|
require('../../apps/mobile/src/ui/actionsheet/index.cjs');
|
|
8
9
|
require('../../apps/mobile/src/ui/alert/index.cjs');
|
|
@@ -18,7 +19,6 @@ require('../../apps/mobile/src/ui/checkbox/index.cjs');
|
|
|
18
19
|
require('../../apps/mobile/src/ui/divider/index.cjs');
|
|
19
20
|
require('../../apps/mobile/src/ui/drawer/index.cjs');
|
|
20
21
|
require('../../apps/mobile/src/ui/fab/index.cjs');
|
|
21
|
-
require('react-native');
|
|
22
22
|
require('../../apps/mobile/src/ui/form-control/index.cjs');
|
|
23
23
|
require('react');
|
|
24
24
|
require('../../apps/mobile/src/ui/gluestack-ui-provider/config.cjs');
|
|
@@ -126,9 +126,13 @@ const Text = (props) => {
|
|
|
126
126
|
const resolvedSize = size || mapAsToSize[as] || "md";
|
|
127
127
|
const overflowProps = mapTextOverflowProps(props);
|
|
128
128
|
const fontFamily = typeof theme.fonts.body === "string" ? theme.fonts.body : void 0;
|
|
129
|
+
const styleFontSize = (() => {
|
|
130
|
+
const flat = reactNative.StyleSheet.flatten(nativeProps?.style);
|
|
131
|
+
return typeof flat?.fontSize === "number" ? flat.fontSize : void 0;
|
|
132
|
+
})();
|
|
129
133
|
const rtlLineHeight = useRtlLineHeight.default(
|
|
130
134
|
resolvedSize,
|
|
131
|
-
typeof cssProps?.fontSize === "number" ? cssProps.fontSize :
|
|
135
|
+
typeof cssProps?.fontSize === "number" ? cssProps.fontSize : styleFontSize
|
|
132
136
|
);
|
|
133
137
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
134
138
|
ResponsiveElement.default,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/primitives/Text/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { ResponsiveElement, useSeparator } from \"../../factory\";\nimport type {ITextComponent} from \"@lmb-it/kitsconcerto-types\";\nimport { useKitsTheme } from \"../../contexts/Theme\";\nimport useRtlLineHeight from \"../../hooks/useRtlLineHeight\";\n\nconst mapAsToSize: Record<string, ITextComponent[\"size\"]> = {\n small: \"sm\",\n label: \"sm\",\n span: \"md\",\n p: \"md\",\n};\n\n/**\n * ⛔ IT RETURNS ONLY THE KEYS IT ACTUALLY SETS, AND THAT IS THE WHOLE FIX.\n *\n * This built an object literal holding BOTH keys every time — `undefined` when\n * the prop that drives them was absent — and it is spread LAST into\n * `nativeProps`, after `...rest`. So a consumer writing\n * `<Text numberOfLines={1}>` had its value silently OVERWRITTEN WITH\n * `undefined` on every render. The prop was accepted by the types, passed\n * through `useSeparator`, and destroyed one line before it reached React\n * Native.\n *\n * ⛔ IT IS A SILENT FAILURE, WHICH IS WHY IT SURVIVED. Nothing warns, nothing\n * throws, and the call site reads correctly — so a header that says\n * `numberOfLines={1}` wraps to two lines and the only way to find out is to\n * look at a device. AlphaMatch's client job-detail header did exactly that: a\n * two-line title overlapping its own subtitle and the bar beneath it, on a\n * screen whose source caps the title at one line. Two sessions read that source\n * and concluded a wrap was impossible.\n *\n * ⚠️ `whiteSpace: \"nowrap\"` AND `textOverflow` STILL WIN, deliberately. They are\n * this library's own way of asking for the same thing, and a consumer using both\n * is asking twice; the library prop is the more specific statement and stays\n * last. What changes is that ABSENT no longer means `undefined` — it means the\n * key is not there at all, so the consumer's value survives.\n *\n * ⚠️ NATIVE ONLY. The web twin writes CSS `textOverflow`/`whiteSpace` straight\n * into `style` and has no `numberOfLines` to clobber, so it never had this.\n */\nconst mapTextOverflowProps = (props: ITextComponent) => {\n const overflow: {\n numberOfLines?: number;\n ellipsizeMode?: \"head\" | \"middle\" | \"tail\" | \"clip\";\n } = {};\n\n if (props.whiteSpace === \"nowrap\") {\n overflow.numberOfLines = 1;\n }\n\n if (props.textOverflow === \"ellipsis\") {\n overflow.ellipsizeMode = \"tail\";\n }\n\n if (props.textOverflow === \"clip\") {\n overflow.ellipsizeMode = \"clip\";\n }\n\n return overflow;\n};\n\nconst Text: React.FC<ITextComponent> = (props) => {\n const { theme } = useKitsTheme();\n const { cssProps, nativeProps } = useSeparator<any>(props);\n const {\n as = \"p\",\n size,\n children,\n isTruncated,\n bold,\n underline,\n strikeThrough,\n sub,\n italic,\n highlight,\n ...rest\n } = nativeProps;\n\n const resolvedSize = size || mapAsToSize[as] || \"md\";\n\n const overflowProps = mapTextOverflowProps(props);\n\n // App-wide font: read from theme.fonts.body so consumers overriding\n // via `extendTheme({ fonts: { body: 'SpaceMono' } })` see the font on\n // every Text without per-call wiring. RN does not propagate fontFamily\n // through View parents, so this default is applied at the Text element\n // itself. Per-instance `style.fontFamily` (passed through cssProps via\n // useSeparator) takes precedence because ResponsiveElement merges in\n // user style after additionalStyles.\n // TODO: apply the same default to Heading (theme.fonts.heading), and\n // to any RN <Text> rendered outside this primitive (e.g. inside\n // Button labels, FormControlHelperText, custom widgets).\n const fontFamily = typeof theme.fonts.body === 'string' ? theme.fonts.body : undefined;\n\n // RTL: give Arabic glyphs vertical headroom so they aren't clipped at the\n // top. undefined in LTR — the font's natural line-height (English unchanged).\n const rtlLineHeight = useRtlLineHeight(\n resolvedSize as string,\n typeof (cssProps as any)?.fontSize === 'number'
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/primitives/Text/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { StyleSheet } from \"react-native\";\nimport { ResponsiveElement, useSeparator } from \"../../factory\";\nimport type {ITextComponent} from \"@lmb-it/kitsconcerto-types\";\nimport { useKitsTheme } from \"../../contexts/Theme\";\nimport useRtlLineHeight from \"../../hooks/useRtlLineHeight\";\n\nconst mapAsToSize: Record<string, ITextComponent[\"size\"]> = {\n small: \"sm\",\n label: \"sm\",\n span: \"md\",\n p: \"md\",\n};\n\n/**\n * ⛔ IT RETURNS ONLY THE KEYS IT ACTUALLY SETS, AND THAT IS THE WHOLE FIX.\n *\n * This built an object literal holding BOTH keys every time — `undefined` when\n * the prop that drives them was absent — and it is spread LAST into\n * `nativeProps`, after `...rest`. So a consumer writing\n * `<Text numberOfLines={1}>` had its value silently OVERWRITTEN WITH\n * `undefined` on every render. The prop was accepted by the types, passed\n * through `useSeparator`, and destroyed one line before it reached React\n * Native.\n *\n * ⛔ IT IS A SILENT FAILURE, WHICH IS WHY IT SURVIVED. Nothing warns, nothing\n * throws, and the call site reads correctly — so a header that says\n * `numberOfLines={1}` wraps to two lines and the only way to find out is to\n * look at a device. AlphaMatch's client job-detail header did exactly that: a\n * two-line title overlapping its own subtitle and the bar beneath it, on a\n * screen whose source caps the title at one line. Two sessions read that source\n * and concluded a wrap was impossible.\n *\n * ⚠️ `whiteSpace: \"nowrap\"` AND `textOverflow` STILL WIN, deliberately. They are\n * this library's own way of asking for the same thing, and a consumer using both\n * is asking twice; the library prop is the more specific statement and stays\n * last. What changes is that ABSENT no longer means `undefined` — it means the\n * key is not there at all, so the consumer's value survives.\n *\n * ⚠️ NATIVE ONLY. The web twin writes CSS `textOverflow`/`whiteSpace` straight\n * into `style` and has no `numberOfLines` to clobber, so it never had this.\n */\nconst mapTextOverflowProps = (props: ITextComponent) => {\n const overflow: {\n numberOfLines?: number;\n ellipsizeMode?: \"head\" | \"middle\" | \"tail\" | \"clip\";\n } = {};\n\n if (props.whiteSpace === \"nowrap\") {\n overflow.numberOfLines = 1;\n }\n\n if (props.textOverflow === \"ellipsis\") {\n overflow.ellipsizeMode = \"tail\";\n }\n\n if (props.textOverflow === \"clip\") {\n overflow.ellipsizeMode = \"clip\";\n }\n\n return overflow;\n};\n\nconst Text: React.FC<ITextComponent> = (props) => {\n const { theme } = useKitsTheme();\n const { cssProps, nativeProps } = useSeparator<any>(props);\n const {\n as = \"p\",\n size,\n children,\n isTruncated,\n bold,\n underline,\n strikeThrough,\n sub,\n italic,\n highlight,\n ...rest\n } = nativeProps;\n\n const resolvedSize = size || mapAsToSize[as] || \"md\";\n\n const overflowProps = mapTextOverflowProps(props);\n\n // App-wide font: read from theme.fonts.body so consumers overriding\n // via `extendTheme({ fonts: { body: 'SpaceMono' } })` see the font on\n // every Text without per-call wiring. RN does not propagate fontFamily\n // through View parents, so this default is applied at the Text element\n // itself. Per-instance `style.fontFamily` (passed through cssProps via\n // useSeparator) takes precedence because ResponsiveElement merges in\n // user style after additionalStyles.\n // TODO: apply the same default to Heading (theme.fonts.heading), and\n // to any RN <Text> rendered outside this primitive (e.g. inside\n // Button labels, FormControlHelperText, custom widgets).\n const fontFamily = typeof theme.fonts.body === 'string' ? theme.fonts.body : undefined;\n\n /*\n * ⛔ THE FONT SIZE IS READ FROM THE `style` PROP TOO, AND THAT IS THE FIX.\n * Device-reported in Arabic, 19 September 2026: the confirm dialog's bold\n * heading was CLIPPED ALONG ITS TOP EDGE while the body and button beneath\n * it read perfectly.\n *\n * ⛔ THE OLD LINE ASKED ONLY `cssProps.fontSize` — the font size passed as a\n * PROP. A consumer that sizes its text through `style={{fontSize: 22}}`,\n * which is how every StyleSheet in this library does it, was invisible to\n * it. The hook then fell back to the SIZE TOKEN, which with no `size` prop\n * is `md` (~16px), and returned a line height of about 24.\n *\n * ⛔ SO IT DID NOT FAIL TO HELP — IT MADE THINGS WORSE, CONFIDENTLY. 24px of\n * line box was written into `additionalStyles` for text actually rendering\n * at 22px and 24px. `ConfirmDialog.sheetHeader` is fontSize 24, so its\n * ratio came out at exactly 1.0 — TIGHTER than the natural line box the\n * code was there to loosen.\n *\n * ⚠️ AND THAT IS PRECISELY WHY ONE DIALOG SHOWED BOTH BEHAVIOURS AT ONCE.\n * `ResponsiveElement` appends the consumer's `style` AFTER these\n * `additionalStyles`, so a style that names its own `lineHeight` wins and a\n * style that does not inherits the wrong number. In that file both MESSAGE\n * styles set a lineHeight and neither HEADER style does — messages legible,\n * headings clipped, one component, one render.\n *\n * ⚠️ IT IS STILL `undefined` IN LTR, so no English layout moves. A flatten\n * is needed because `style` may be an array, a StyleSheet id, or a plain\n * object, and only `StyleSheet.flatten` reads all three.\n */\n const styleFontSize = (() => {\n const flat = StyleSheet.flatten((nativeProps as any)?.style) as\n | {fontSize?: unknown}\n | undefined;\n return typeof flat?.fontSize === 'number' ? flat.fontSize : undefined;\n })();\n\n // RTL: give Arabic glyphs vertical headroom so they aren't clipped at the\n // top. undefined in LTR — the font's natural line-height (English unchanged).\n const rtlLineHeight = useRtlLineHeight(\n resolvedSize as string,\n typeof (cssProps as any)?.fontSize === 'number'\n ? (cssProps as any).fontSize\n : styleFontSize,\n );\n\n return (\n <ResponsiveElement\n as=\"Text\"\n cssProps={{...cssProps}}\n additionalStyles={{\n padding: 0,\n ...(fontFamily ? { fontFamily } : {}),\n ...(rtlLineHeight != null ? { lineHeight: rtlLineHeight } : {}),\n }}\n nativeProps={{\n ...rest,\n as,\n size: resolvedSize,\n isTruncated,\n bold,\n underline,\n strikeThrough,\n sub,\n italic,\n highlight,\n ...overflowProps\n }}\n >\n {children}\n </ResponsiveElement>\n );\n};\n\nexport default Text;\n"],"names":["useKitsTheme","useSeparator","StyleSheet","useRtlLineHeight","jsx","ResponsiveElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,WAAA,GAAsD;AAAA,EACxD,KAAA,EAAO,IAAA;AAAA,EACP,KAAA,EAAO,IAAA;AAAA,EACP,IAAA,EAAM,IAAA;AAAA,EACN,CAAA,EAAG;AACP,CAAA;AA8BA,MAAM,oBAAA,GAAuB,CAAC,KAAA,KAA0B;AACpD,EAAA,MAAM,WAGF,EAAC;AAEL,EAAA,IAAI,KAAA,CAAM,eAAe,QAAA,EAAU;AAC/B,IAAA,QAAA,CAAS,aAAA,GAAgB,CAAA;AAAA,EAC7B;AAEA,EAAA,IAAI,KAAA,CAAM,iBAAiB,UAAA,EAAY;AACnC,IAAA,QAAA,CAAS,aAAA,GAAgB,MAAA;AAAA,EAC7B;AAEA,EAAA,IAAI,KAAA,CAAM,iBAAiB,MAAA,EAAQ;AAC/B,IAAA,QAAA,CAAS,aAAA,GAAgB,MAAA;AAAA,EAC7B;AAEA,EAAA,OAAO,QAAA;AACX,CAAA;AAEA,MAAM,IAAA,GAAiC,CAAC,KAAA,KAAU;AAC9C,EAAA,MAAM,EAAE,KAAA,EAAM,GAAIA,qCAAA,EAAa;AAC/B,EAAA,MAAM,EAAE,QAAA,EAAU,WAAA,EAAY,GAAIC,qBAAkB,KAAK,CAAA;AACzD,EAAA,MAAM;AAAA,IACF,EAAA,GAAK,GAAA;AAAA,IACL,IAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA,IAAA;AAAA,IACA,SAAA;AAAA,IACA,aAAA;AAAA,IACA,GAAA;AAAA,IACA,MAAA;AAAA,IACA,SAAA;AAAA,I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A;AAAA,GACL;AAER;;;;"}
|
package/primitives/Text/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
2
3
|
import '../../apps/mobile/src/ui/accordion/index.js';
|
|
3
4
|
import '../../apps/mobile/src/ui/actionsheet/index.js';
|
|
4
5
|
import '../../apps/mobile/src/ui/alert/index.js';
|
|
@@ -14,7 +15,6 @@ import '../../apps/mobile/src/ui/checkbox/index.js';
|
|
|
14
15
|
import '../../apps/mobile/src/ui/divider/index.js';
|
|
15
16
|
import '../../apps/mobile/src/ui/drawer/index.js';
|
|
16
17
|
import '../../apps/mobile/src/ui/fab/index.js';
|
|
17
|
-
import 'react-native';
|
|
18
18
|
import '../../apps/mobile/src/ui/form-control/index.js';
|
|
19
19
|
import 'react';
|
|
20
20
|
import '../../apps/mobile/src/ui/gluestack-ui-provider/config.js';
|
|
@@ -122,9 +122,13 @@ const Text = (props) => {
|
|
|
122
122
|
const resolvedSize = size || mapAsToSize[as] || "md";
|
|
123
123
|
const overflowProps = mapTextOverflowProps(props);
|
|
124
124
|
const fontFamily = typeof theme.fonts.body === "string" ? theme.fonts.body : void 0;
|
|
125
|
+
const styleFontSize = (() => {
|
|
126
|
+
const flat = StyleSheet.flatten(nativeProps?.style);
|
|
127
|
+
return typeof flat?.fontSize === "number" ? flat.fontSize : void 0;
|
|
128
|
+
})();
|
|
125
129
|
const rtlLineHeight = useRtlLineHeight(
|
|
126
130
|
resolvedSize,
|
|
127
|
-
typeof cssProps?.fontSize === "number" ? cssProps.fontSize :
|
|
131
|
+
typeof cssProps?.fontSize === "number" ? cssProps.fontSize : styleFontSize
|
|
128
132
|
);
|
|
129
133
|
return /* @__PURE__ */ jsx(
|
|
130
134
|
ResponsiveElement,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/primitives/Text/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { ResponsiveElement, useSeparator } from \"../../factory\";\nimport type {ITextComponent} from \"@lmb-it/kitsconcerto-types\";\nimport { useKitsTheme } from \"../../contexts/Theme\";\nimport useRtlLineHeight from \"../../hooks/useRtlLineHeight\";\n\nconst mapAsToSize: Record<string, ITextComponent[\"size\"]> = {\n small: \"sm\",\n label: \"sm\",\n span: \"md\",\n p: \"md\",\n};\n\n/**\n * ⛔ IT RETURNS ONLY THE KEYS IT ACTUALLY SETS, AND THAT IS THE WHOLE FIX.\n *\n * This built an object literal holding BOTH keys every time — `undefined` when\n * the prop that drives them was absent — and it is spread LAST into\n * `nativeProps`, after `...rest`. So a consumer writing\n * `<Text numberOfLines={1}>` had its value silently OVERWRITTEN WITH\n * `undefined` on every render. The prop was accepted by the types, passed\n * through `useSeparator`, and destroyed one line before it reached React\n * Native.\n *\n * ⛔ IT IS A SILENT FAILURE, WHICH IS WHY IT SURVIVED. Nothing warns, nothing\n * throws, and the call site reads correctly — so a header that says\n * `numberOfLines={1}` wraps to two lines and the only way to find out is to\n * look at a device. AlphaMatch's client job-detail header did exactly that: a\n * two-line title overlapping its own subtitle and the bar beneath it, on a\n * screen whose source caps the title at one line. Two sessions read that source\n * and concluded a wrap was impossible.\n *\n * ⚠️ `whiteSpace: \"nowrap\"` AND `textOverflow` STILL WIN, deliberately. They are\n * this library's own way of asking for the same thing, and a consumer using both\n * is asking twice; the library prop is the more specific statement and stays\n * last. What changes is that ABSENT no longer means `undefined` — it means the\n * key is not there at all, so the consumer's value survives.\n *\n * ⚠️ NATIVE ONLY. The web twin writes CSS `textOverflow`/`whiteSpace` straight\n * into `style` and has no `numberOfLines` to clobber, so it never had this.\n */\nconst mapTextOverflowProps = (props: ITextComponent) => {\n const overflow: {\n numberOfLines?: number;\n ellipsizeMode?: \"head\" | \"middle\" | \"tail\" | \"clip\";\n } = {};\n\n if (props.whiteSpace === \"nowrap\") {\n overflow.numberOfLines = 1;\n }\n\n if (props.textOverflow === \"ellipsis\") {\n overflow.ellipsizeMode = \"tail\";\n }\n\n if (props.textOverflow === \"clip\") {\n overflow.ellipsizeMode = \"clip\";\n }\n\n return overflow;\n};\n\nconst Text: React.FC<ITextComponent> = (props) => {\n const { theme } = useKitsTheme();\n const { cssProps, nativeProps } = useSeparator<any>(props);\n const {\n as = \"p\",\n size,\n children,\n isTruncated,\n bold,\n underline,\n strikeThrough,\n sub,\n italic,\n highlight,\n ...rest\n } = nativeProps;\n\n const resolvedSize = size || mapAsToSize[as] || \"md\";\n\n const overflowProps = mapTextOverflowProps(props);\n\n // App-wide font: read from theme.fonts.body so consumers overriding\n // via `extendTheme({ fonts: { body: 'SpaceMono' } })` see the font on\n // every Text without per-call wiring. RN does not propagate fontFamily\n // through View parents, so this default is applied at the Text element\n // itself. Per-instance `style.fontFamily` (passed through cssProps via\n // useSeparator) takes precedence because ResponsiveElement merges in\n // user style after additionalStyles.\n // TODO: apply the same default to Heading (theme.fonts.heading), and\n // to any RN <Text> rendered outside this primitive (e.g. inside\n // Button labels, FormControlHelperText, custom widgets).\n const fontFamily = typeof theme.fonts.body === 'string' ? theme.fonts.body : undefined;\n\n // RTL: give Arabic glyphs vertical headroom so they aren't clipped at the\n // top. undefined in LTR — the font's natural line-height (English unchanged).\n const rtlLineHeight = useRtlLineHeight(\n resolvedSize as string,\n typeof (cssProps as any)?.fontSize === 'number'
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/primitives/Text/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { StyleSheet } from \"react-native\";\nimport { ResponsiveElement, useSeparator } from \"../../factory\";\nimport type {ITextComponent} from \"@lmb-it/kitsconcerto-types\";\nimport { useKitsTheme } from \"../../contexts/Theme\";\nimport useRtlLineHeight from \"../../hooks/useRtlLineHeight\";\n\nconst mapAsToSize: Record<string, ITextComponent[\"size\"]> = {\n small: \"sm\",\n label: \"sm\",\n span: \"md\",\n p: \"md\",\n};\n\n/**\n * ⛔ IT RETURNS ONLY THE KEYS IT ACTUALLY SETS, AND THAT IS THE WHOLE FIX.\n *\n * This built an object literal holding BOTH keys every time — `undefined` when\n * the prop that drives them was absent — and it is spread LAST into\n * `nativeProps`, after `...rest`. So a consumer writing\n * `<Text numberOfLines={1}>` had its value silently OVERWRITTEN WITH\n * `undefined` on every render. The prop was accepted by the types, passed\n * through `useSeparator`, and destroyed one line before it reached React\n * Native.\n *\n * ⛔ IT IS A SILENT FAILURE, WHICH IS WHY IT SURVIVED. Nothing warns, nothing\n * throws, and the call site reads correctly — so a header that says\n * `numberOfLines={1}` wraps to two lines and the only way to find out is to\n * look at a device. AlphaMatch's client job-detail header did exactly that: a\n * two-line title overlapping its own subtitle and the bar beneath it, on a\n * screen whose source caps the title at one line. Two sessions read that source\n * and concluded a wrap was impossible.\n *\n * ⚠️ `whiteSpace: \"nowrap\"` AND `textOverflow` STILL WIN, deliberately. They are\n * this library's own way of asking for the same thing, and a consumer using both\n * is asking twice; the library prop is the more specific statement and stays\n * last. What changes is that ABSENT no longer means `undefined` — it means the\n * key is not there at all, so the consumer's value survives.\n *\n * ⚠️ NATIVE ONLY. The web twin writes CSS `textOverflow`/`whiteSpace` straight\n * into `style` and has no `numberOfLines` to clobber, so it never had this.\n */\nconst mapTextOverflowProps = (props: ITextComponent) => {\n const overflow: {\n numberOfLines?: number;\n ellipsizeMode?: \"head\" | \"middle\" | \"tail\" | \"clip\";\n } = {};\n\n if (props.whiteSpace === \"nowrap\") {\n overflow.numberOfLines = 1;\n }\n\n if (props.textOverflow === \"ellipsis\") {\n overflow.ellipsizeMode = \"tail\";\n }\n\n if (props.textOverflow === \"clip\") {\n overflow.ellipsizeMode = \"clip\";\n }\n\n return overflow;\n};\n\nconst Text: React.FC<ITextComponent> = (props) => {\n const { theme } = useKitsTheme();\n const { cssProps, nativeProps } = useSeparator<any>(props);\n const {\n as = \"p\",\n size,\n children,\n isTruncated,\n bold,\n underline,\n strikeThrough,\n sub,\n italic,\n highlight,\n ...rest\n } = nativeProps;\n\n const resolvedSize = size || mapAsToSize[as] || \"md\";\n\n const overflowProps = mapTextOverflowProps(props);\n\n // App-wide font: read from theme.fonts.body so consumers overriding\n // via `extendTheme({ fonts: { body: 'SpaceMono' } })` see the font on\n // every Text without per-call wiring. RN does not propagate fontFamily\n // through View parents, so this default is applied at the Text element\n // itself. Per-instance `style.fontFamily` (passed through cssProps via\n // useSeparator) takes precedence because ResponsiveElement merges in\n // user style after additionalStyles.\n // TODO: apply the same default to Heading (theme.fonts.heading), and\n // to any RN <Text> rendered outside this primitive (e.g. inside\n // Button labels, FormControlHelperText, custom widgets).\n const fontFamily = typeof theme.fonts.body === 'string' ? theme.fonts.body : undefined;\n\n /*\n * ⛔ THE FONT SIZE IS READ FROM THE `style` PROP TOO, AND THAT IS THE FIX.\n * Device-reported in Arabic, 19 September 2026: the confirm dialog's bold\n * heading was CLIPPED ALONG ITS TOP EDGE while the body and button beneath\n * it read perfectly.\n *\n * ⛔ THE OLD LINE ASKED ONLY `cssProps.fontSize` — the font size passed as a\n * PROP. A consumer that sizes its text through `style={{fontSize: 22}}`,\n * which is how every StyleSheet in this library does it, was invisible to\n * it. The hook then fell back to the SIZE TOKEN, which with no `size` prop\n * is `md` (~16px), and returned a line height of about 24.\n *\n * ⛔ SO IT DID NOT FAIL TO HELP — IT MADE THINGS WORSE, CONFIDENTLY. 24px of\n * line box was written into `additionalStyles` for text actually rendering\n * at 22px and 24px. `ConfirmDialog.sheetHeader` is fontSize 24, so its\n * ratio came out at exactly 1.0 — TIGHTER than the natural line box the\n * code was there to loosen.\n *\n * ⚠️ AND THAT IS PRECISELY WHY ONE DIALOG SHOWED BOTH BEHAVIOURS AT ONCE.\n * `ResponsiveElement` appends the consumer's `style` AFTER these\n * `additionalStyles`, so a style that names its own `lineHeight` wins and a\n * style that does not inherits the wrong number. In that file both MESSAGE\n * styles set a lineHeight and neither HEADER style does — messages legible,\n * headings clipped, one component, one render.\n *\n * ⚠️ IT IS STILL `undefined` IN LTR, so no English layout moves. A flatten\n * is needed because `style` may be an array, a StyleSheet id, or a plain\n * object, and only `StyleSheet.flatten` reads all three.\n */\n const styleFontSize = (() => {\n const flat = StyleSheet.flatten((nativeProps as any)?.style) as\n | {fontSize?: unknown}\n | undefined;\n return typeof flat?.fontSize === 'number' ? flat.fontSize : undefined;\n })();\n\n // RTL: give Arabic glyphs vertical headroom so they aren't clipped at the\n // top. undefined in LTR — the font's natural line-height (English unchanged).\n const rtlLineHeight = useRtlLineHeight(\n resolvedSize as string,\n typeof (cssProps as any)?.fontSize === 'number'\n ? (cssProps as any).fontSize\n : styleFontSize,\n );\n\n return (\n <ResponsiveElement\n as=\"Text\"\n cssProps={{...cssProps}}\n additionalStyles={{\n padding: 0,\n ...(fontFamily ? { fontFamily } : {}),\n ...(rtlLineHeight != null ? { lineHeight: rtlLineHeight } : {}),\n }}\n nativeProps={{\n ...rest,\n as,\n size: resolvedSize,\n isTruncated,\n bold,\n underline,\n strikeThrough,\n sub,\n italic,\n highlight,\n ...overflowProps\n }}\n >\n {children}\n </ResponsiveElement>\n );\n};\n\nexport default Text;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,WAAA,GAAsD;AAAA,EACxD,KAAA,EAAO,IAAA;AAAA,EACP,KAAA,EAAO,IAAA;AAAA,EACP,IAAA,EAAM,IAAA;AAAA,EACN,CAAA,EAAG;AACP,CAAA;AA8BA,MAAM,oBAAA,GAAuB,CAAC,KAAA,KAA0B;AACpD,EAAA,MAAM,WAGF,EAAC;AAEL,EAAA,IAAI,KAAA,CAAM,eAAe,QAAA,EAAU;AAC/B,IAAA,QAAA,CAAS,aAAA,GAAgB,CAAA;AAAA,EAC7B;AAEA,EAAA,IAAI,KAAA,CAAM,iBAAiB,UAAA,EAAY;AACnC,IAAA,QAAA,CAAS,aAAA,GAAgB,MAAA;AAAA,EAC7B;AAEA,EAAA,IAAI,KAAA,CAAM,iBA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