@lmb-it/kitsconcerto-native 0.1.250 → 0.1.252
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/Button/Button.cjs +9 -4
- package/components/Button/Button.cjs.map +1 -1
- package/components/Button/Button.js +9 -4
- package/components/Button/Button.js.map +1 -1
- package/form-renderer/components/layout/FieldWrapper.cjs +1 -1
- package/form-renderer/components/layout/FieldWrapper.cjs.map +1 -1
- package/form-renderer/components/layout/FieldWrapper.js +1 -1
- package/form-renderer/components/layout/FieldWrapper.js.map +1 -1
- package/index.d.ts +26 -1
- package/package.json +13 -2
- package/packages/types/src/Theme/defaultTheme.cjs +3 -0
- package/packages/types/src/Theme/defaultTheme.cjs.map +1 -1
- package/packages/types/src/Theme/defaultTheme.js +3 -0
- package/packages/types/src/Theme/defaultTheme.js.map +1 -1
- package/packages/types/src/Theme/shadows.cjs +12 -2
- package/packages/types/src/Theme/shadows.cjs.map +1 -1
- package/packages/types/src/Theme/shadows.js +12 -2
- package/packages/types/src/Theme/shadows.js.map +1 -1
- package/primitives/Text/index.cjs +5 -6
- package/primitives/Text/index.cjs.map +1 -1
- package/primitives/Text/index.js +5 -6
- package/primitives/Text/index.js.map +1 -1
|
@@ -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\nconst mapTextOverflowProps = (props: ITextComponent) => {\n
|
|
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' ? (cssProps as any).fontSize : undefined,\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","useRtlLineHeight","jsx","ResponsiveElement"],"mappings":";;;;;;;;;;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D,EAAA,MAAM,UAAA,GAAa,OAAO,KAAA,CAAM,KAAA,CAAM,SAAS,QAAA,GAAW,KAAA,CAAM,MAAM,IAAA,GAAO,MAAA;AAI7E,EAAA,MAAM,aAAA,GAAgBC,wBAAA;AAAA,IAClB,YAAA;AAAA,IACA,OAAQ,QAAA,EAAkB,QAAA,KAAa,QAAA,GAAY,SAAiB,QAAA,GAAW;AAAA,GACnF;AAEA,EAAA,uBACIC,cAAA;AAAA,IAACC,yBAAA;AAAA,IAAA;AAAA,MACG,EAAA,EAAG,MAAA;AAAA,MACH,QAAA,EAAU,EAAC,GAAG,QAAA,EAAQ;AAAA,MACtB,gBAAA,EAAkB;AAAA,QACd,OAAA,EAAS,CAAA;AAAA,QACT,GAAI,UAAA,GAAa,EAAE,UAAA,KAAe,EAAC;AAAA,QACnC,GAAI,aAAA,IAAiB,IAAA,GAAO,EAAE,UAAA,EAAY,aAAA,KAAkB;AAAC,OACjE;AAAA,MACA,WAAA,EAAa;AAAA,QACT,GAAG,IAAA;AAAA,QACH,EAAA;AAAA,QACA,IAAA,EAAM,YAAA;AAAA,QACN,WAAA;AAAA,QACA,IAAA;AAAA,QACA,SAAA;AAAA,QACA,aAAA;AAAA,QACA,GAAA;AAAA,QACA,MAAA;AAAA,QACA,SAAA;AAAA,QACA,GAAG;AAAA,OACP;AAAA,MAEC;AAAA;AAAA,GACL;AAER;;;;"}
|
package/primitives/Text/index.js
CHANGED
|
@@ -91,18 +91,17 @@ const mapAsToSize = {
|
|
|
91
91
|
p: "md"
|
|
92
92
|
};
|
|
93
93
|
const mapTextOverflowProps = (props) => {
|
|
94
|
-
|
|
95
|
-
let ellipsizeMode;
|
|
94
|
+
const overflow = {};
|
|
96
95
|
if (props.whiteSpace === "nowrap") {
|
|
97
|
-
numberOfLines = 1;
|
|
96
|
+
overflow.numberOfLines = 1;
|
|
98
97
|
}
|
|
99
98
|
if (props.textOverflow === "ellipsis") {
|
|
100
|
-
ellipsizeMode = "tail";
|
|
99
|
+
overflow.ellipsizeMode = "tail";
|
|
101
100
|
}
|
|
102
101
|
if (props.textOverflow === "clip") {
|
|
103
|
-
ellipsizeMode = "clip";
|
|
102
|
+
overflow.ellipsizeMode = "clip";
|
|
104
103
|
}
|
|
105
|
-
return
|
|
104
|
+
return overflow;
|
|
106
105
|
};
|
|
107
106
|
const Text = (props) => {
|
|
108
107
|
const { theme } = useKitsTheme();
|
|
@@ -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\nconst mapTextOverflowProps = (props: ITextComponent) => {\n
|
|
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' ? (cssProps as any).fontSize : undefined,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,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,E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