@oxyhq/bloom 0.73.0 → 0.73.1
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/lib/commonjs/button/Button.js +104 -42
- package/lib/commonjs/button/Button.js.map +1 -1
- package/lib/commonjs/button/Button.web.js +11 -3
- package/lib/commonjs/button/Button.web.js.map +1 -1
- package/lib/module/button/Button.js +104 -42
- package/lib/module/button/Button.js.map +1 -1
- package/lib/module/button/Button.web.js +11 -3
- package/lib/module/button/Button.web.js.map +1 -1
- package/lib/typescript/commonjs/button/Button.d.ts.map +1 -1
- package/lib/typescript/commonjs/button/Button.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/button/types.d.ts +8 -0
- package/lib/typescript/commonjs/button/types.d.ts.map +1 -1
- package/lib/typescript/module/button/Button.d.ts.map +1 -1
- package/lib/typescript/module/button/Button.web.d.ts.map +1 -1
- package/lib/typescript/module/button/types.d.ts +8 -0
- package/lib/typescript/module/button/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/Button.test.tsx +166 -1
- package/src/__tests__/Button.web.test.tsx +16 -0
- package/src/button/Button.tsx +123 -40
- package/src/button/Button.web.tsx +11 -3
- package/src/button/types.ts +8 -0
- package/lib/commonjs/fonts/font-data.web.js +0 -22
- package/lib/commonjs/fonts/font-data.web.js.map +0 -1
- package/lib/module/fonts/font-data.web.js +0 -18
- package/lib/module/fonts/font-data.web.js.map +0 -1
- package/lib/typescript/commonjs/fonts/font-data.web.d.ts +0 -5
- package/lib/typescript/commonjs/fonts/font-data.web.d.ts.map +0 -1
- package/lib/typescript/module/fonts/font-data.web.d.ts +0 -5
- package/lib/typescript/module/fonts/font-data.web.d.ts.map +0 -1
- package/src/fonts/font-data.web.ts +0 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","memo","useCallback","useEffect","useId","useMemo","useTheme","SpinnerIcon","flattenWebStyle","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","SIZE_CONFIG","small","paddingVertical","paddingHorizontal","fontSize","minHeight","medium","large","SIZE_ALIAS","sm","md","lg","icon","PILL_RADIUS","ICON_RADIUS","PRESS_SCALE","SCALE_VARIANTS","Set","STYLE_ID","BLOOM_BUTTON_CSS","useButtonCss","document","getElementById","style","createElement","id","textContent","head","appendChild","resolveVariantStyle","variant","size","theme","c","colors","sizeConfig","container","backgroundColor","primary","borderRadius","textColor","primaryForeground","ringColor","negative","negativeForeground","borderWidth","borderStyle","borderColor","border","text","background","padding","width","height","ButtonWebComponent","onPress","onClick","children","disabled","sizeProp","iconPosition","loading","loadingColor","accessibilityLabel","ariaLabelProp","accessibilityHint","testID","className","type","asChild","name","value","title","autoFocus","tabIndex","fullWidth","reactId","resolvedId","resolvedVariant","isIcon","isInteractionBlocked","variantStyle","containerStyle","base","fontWeight","color","undefined","has","paddingTop","paddingBottom","paddingLeft","paddingRight","handleClick","event","preventDefault","ariaLabel","composedClassName","concat","join","spinnerColor","resolvedStyle","content","body","display","alignItems","justifyContent","gap","opacity","pointerEvents","position","inset","Math","round","isValidElement","child","childProps","props","cloneElement","filter","Boolean","Button","displayName","PrimaryButton","SecondaryButton","IconButton","GhostButton","InverseButton","TextButton","OutlineButton","LinkButton","DestructiveButton"],"sourceRoot":"../../../src","sources":["button/Button.web.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IACVC,IAAI,EACJC,WAAW,EACXC,SAAS,EACTC,KAAK,EACLC,OAAO,QAIF,OAAO;AAEd,SAASC,QAAQ,QAAQ,uBAAoB;AAE7C,SAASC,WAAW,QAAQ,+BAA4B;AACxD,SAASC,eAAe,QAAQ,gCAA6B;;AAK7D;AACA;AACA;AACA;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAWA,MAAMC,WAA2C,GAAG;EAClDC,KAAK,EAAE;IAAEC,eAAe,EAAE,CAAC;IAAEC,iBAAiB,EAAE,EAAE;I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OAAO,EAAC;AAAO,CAAE,CACrC,CAAC;AACF+F,WAAW,CAACJ,WAAW,GAAG,aAAa;AAEvC,OAAO,MAAMK,aAAa,gBAAG5I,IAAI,CAAEkI,KAAmC,iBACpEzH,IAAA,CAAC6H,MAAM;EAAA,GAAKJ,KAAK;EAAEtF,OAAO,EAAC;AAAS,CAAE,CACvC,CAAC;AACFgG,aAAa,CAACL,WAAW,GAAG,eAAe;AAE3C,OAAO,MAAMM,UAAU,gBAAG7I,IAAI,CAAEkI,KAAmC,iBACjEzH,IAAA,CAAC6H,MAAM;EAAA,GAAKJ,KAAK;EAAEtF,OAAO,EAAC;AAAM,CAAE,CACpC,CAAC;AACFiG,UAAU,CAACN,WAAW,GAAG,YAAY;AAErC,OAAO,MAAMO,aAAa,gBAAG9I,IAAI,CAAEkI,KAAmC,iBACpEzH,IAAA,CAAC6H,MAAM;EAAA,GAAKJ,KAAK;EAAEtF,OAAO,EAAC;AAAS,CAAE,CACvC,CAAC;AACFkG,aAAa,CAACP,WAAW,GAAG,eAAe;AAE3C,OAAO,MAAMQ,UAAU,gBAAG/I,IAAI,CAAEkI,KAAmC,iBACjEzH,IAAA,CAAC6H,MAAM;EAAA,GAAKJ,KAAK;EAAEtF,OAAO,EAAC;AAAM,CAAE,CACpC,CAAC;AACFmG,UAAU,CAACR,WAAW,GAAG,YAAY;AAErC,OAAO,MAAMS,iBAAiB,gBAAGhJ,IAAI,CAAEkI,KAAmC,iBACxEzH,IAAA,CAAC6H,MAAM;EAAA,GAAKJ,KAAK;EAAEtF,OAAO,EAAC;AAAa,CAAE,CAC3C,CAAC;AACFoG,iBAAiB,CAACT,WAAW,GAAG,mBAAmB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","memo","useCallback","useEffect","useId","useMemo","useTheme","SpinnerIcon","flattenWebStyle","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","SIZE_CONFIG","small","paddingVertical","paddingHorizontal","fontSize","minHeight","medium","large","SIZE_ALIAS","sm","md","lg","icon","PILL_RADIUS","ICON_RADIUS","PRESS_SCALE","SCALE_VARIANTS","Set","STYLE_ID","BLOOM_BUTTON_CSS","useButtonCss","document","getElementById","style","createElement","id","textContent","head","appendChild","resolveVariantStyle","variant","size","theme","c","colors","sizeConfig","container","backgroundColor","primary","borderRadius","textColor","primaryForeground","ringColor","negative","negativeForeground","borderWidth","borderStyle","borderColor","border","text","background","padding","width","height","ButtonWebComponent","onPress","onClick","children","disabled","sizeProp","iconPosition","loading","loadingColor","accessibilityLabel","ariaLabelProp","accessibilityHint","testID","className","type","asChild","name","value","title","autoFocus","tabIndex","fullWidth","reactId","resolvedId","resolvedVariant","isIcon","isInteractionBlocked","variantStyle","containerStyle","base","fontWeight","color","undefined","has","paddingTop","paddingBottom","paddingLeft","paddingRight","handleClick","event","preventDefault","ariaLabel","composedClassName","concat","join","spinnerColor","resolvedStyle","content","body","display","alignItems","justifyContent","gap","opacity","pointerEvents","position","inset","Math","round","isValidElement","child","childProps","props","cloneElement","filter","Boolean","Button","displayName","PrimaryButton","SecondaryButton","IconButton","GhostButton","InverseButton","TextButton","OutlineButton","LinkButton","DestructiveButton"],"sourceRoot":"../../../src","sources":["button/Button.web.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IACVC,IAAI,EACJC,WAAW,EACXC,SAAS,EACTC,KAAK,EACLC,OAAO,QAIF,OAAO;AAEd,SAASC,QAAQ,QAAQ,uBAAoB;AAE7C,SAASC,WAAW,QAAQ,+BAA4B;AACxD,SAASC,eAAe,QAAQ,gCAA6B;;AAK7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAWA,MAAMC,WAA2C,GAAG;EAClDC,KAAK,EAAE;IAAEC,eAAe,EAAE,CAAC;IAAEC,iBAAiB,EAAE,EAAE;IAAEC,QAAQ,EAAE,EAAE;IAAEC,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AC;AACF+F,WAAW,CAACJ,WAAW,GAAG,aAAa;AAEvC,OAAO,MAAMK,aAAa,gBAAG5I,IAAI,CAAEkI,KAAmC,iBACpEzH,IAAA,CAAC6H,MAAM;EAAA,GAAKJ,KAAK;EAAEtF,OAAO,EAAC;AAAS,CAAE,CACvC,CAAC;AACFgG,aAAa,CAACL,WAAW,GAAG,eAAe;AAE3C,OAAO,MAAMM,UAAU,gBAAG7I,IAAI,CAAEkI,KAAmC,iBACjEzH,IAAA,CAAC6H,MAAM;EAAA,GAAKJ,KAAK;EAAEtF,OAAO,EAAC;AAAM,CAAE,CACpC,CAAC;AACFiG,UAAU,CAACN,WAAW,GAAG,YAAY;AAErC,OAAO,MAAMO,aAAa,gBAAG9I,IAAI,CAAEkI,KAAmC,iBACpEzH,IAAA,CAAC6H,MAAM;EAAA,GAAKJ,KAAK;EAAEtF,OAAO,EAAC;AAAS,CAAE,CACvC,CAAC;AACFkG,aAAa,CAACP,WAAW,GAAG,eAAe;AAE3C,OAAO,MAAMQ,UAAU,gBAAG/I,IAAI,CAAEkI,KAAmC,iBACjEzH,IAAA,CAAC6H,MAAM;EAAA,GAAKJ,KAAK;EAAEtF,OAAO,EAAC;AAAM,CAAE,CACpC,CAAC;AACFmG,UAAU,CAACR,WAAW,GAAG,YAAY;AAErC,OAAO,MAAMS,iBAAiB,gBAAGhJ,IAAI,CAAEkI,KAAmC,iBACxEzH,IAAA,CAAC6H,MAAM;EAAA,GAAKJ,KAAK;EAAEtF,OAAO,EAAC;AAAa,CAAE,CAC3C,CAAC;AACFoG,iBAAiB,CAACT,WAAW,GAAG,mBAAmB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,M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"file":"Button.web.d.ts","sourceRoot":"","sources":["../../../../src/button/Button.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,WAAW,EAA6B,MAAM,SAAS,CAAC;AAEtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAuatE,eAAO,MAAM,MAAM,yCAA2B,CAAC;AAG/C,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH,eAAO,MAAM,eAAe,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEtE,CAAC;AAGH,eAAO,MAAM,UAAU,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEjE,CAAC;AAGH,eAAO,MAAM,WAAW,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAElE,CAAC;AAGH,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH,eAAO,MAAM,UAAU,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEjE,CAAC;AAGH,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH,eAAO,MAAM,UAAU,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEjE,CAAC;AAGH,eAAO,MAAM,iBAAiB,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAExE,CAAC"}
|
|
@@ -10,6 +10,14 @@ import type { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
|
10
10
|
* the set. On native they fall back to a sensible equivalent
|
|
11
11
|
* (`outline → secondary`, `link → text`, `destructive → primary` tinted with
|
|
12
12
|
* the negative token) so passing them never crashes a native consumer.
|
|
13
|
+
*
|
|
14
|
+
* `text` (and its web alias `link`) is DELIBERATELY not a transparent `ghost`:
|
|
15
|
+
* it is the compact inline affordance, so it overrides the size config's padding
|
|
16
|
+
* down to 4/8 on BOTH platforms. `ghost` keeps the full padding — it is a
|
|
17
|
+
* regular button that happens to have no background. The one geometry that does
|
|
18
|
+
* differ by platform is `minHeight`: web clears it for `text`/`link` so the
|
|
19
|
+
* control hugs its label and sits inline, native keeps the size config's value
|
|
20
|
+
* because a finger needs the target and a cursor does not.
|
|
13
21
|
*/
|
|
14
22
|
export type ButtonVariant = 'primary' | 'secondary' | 'inverse' | 'icon' | 'ghost' | 'text' | 'outline' | 'link' | 'destructive';
|
|
15
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,WAAW,GACX,SAAS,GACT,MAAM,GACN,OAAO,GACP,MAAM,GACN,SAAS,GACT,MAAM,GACN,aAAa,CAAC;AAElB;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAClB,OAAO,GACP,QAAQ,GACR,OAAO,GACP,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,MAAM,CAAC;AAEX,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,OAAO,CAAC,EAAE,aAA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;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAmBjE,OAAO,KAAK,EAAE,WAAW,EAA6B,MAAM,SAAS,CAAC;AAEtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAkWtE,eAAO,MAAM,MAAM,yCAAwB,CAAC;AAG5C,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH,eAAO,MAAM,eAAe,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEtE,CAAC;AAGH,eAAO,MAAM,UAAU,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEjE,CAAC;AAGH,eAAO,MAAM,WAAW,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAElE,CAAC;AAGH,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH,eAAO,MAAM,UAAU,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEjE,CAAC;AAMH,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH,eAAO,MAAM,UAAU,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEjE,CAAC;AAGH,eAAO,MAAM,iBAAiB,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAExE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.web.d.ts","sourceRoot":"","sources":["../../../../src/button/Button.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,WAAW,EAA6B,MAAM,SAAS,CAAC;AAEtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.web.d.ts","sourceRoot":"","sources":["../../../../src/button/Button.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,WAAW,EAA6B,MAAM,SAAS,CAAC;AAEtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAuatE,eAAO,MAAM,MAAM,yCAA2B,CAAC;AAG/C,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH,eAAO,MAAM,eAAe,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEtE,CAAC;AAGH,eAAO,MAAM,UAAU,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEjE,CAAC;AAGH,eAAO,MAAM,WAAW,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAElE,CAAC;AAGH,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH,eAAO,MAAM,UAAU,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEjE,CAAC;AAGH,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH,eAAO,MAAM,UAAU,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEjE,CAAC;AAGH,eAAO,MAAM,iBAAiB,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAExE,CAAC"}
|
|
@@ -10,6 +10,14 @@ import type { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
|
10
10
|
* the set. On native they fall back to a sensible equivalent
|
|
11
11
|
* (`outline → secondary`, `link → text`, `destructive → primary` tinted with
|
|
12
12
|
* the negative token) so passing them never crashes a native consumer.
|
|
13
|
+
*
|
|
14
|
+
* `text` (and its web alias `link`) is DELIBERATELY not a transparent `ghost`:
|
|
15
|
+
* it is the compact inline affordance, so it overrides the size config's padding
|
|
16
|
+
* down to 4/8 on BOTH platforms. `ghost` keeps the full padding — it is a
|
|
17
|
+
* regular button that happens to have no background. The one geometry that does
|
|
18
|
+
* differ by platform is `minHeight`: web clears it for `text`/`link` so the
|
|
19
|
+
* control hugs its label and sits inline, native keeps the size config's value
|
|
20
|
+
* because a finger needs the target and a cursor does not.
|
|
13
21
|
*/
|
|
14
22
|
export type ButtonVariant = 'primary' | 'secondary' | 'inverse' | 'icon' | 'ghost' | 'text' | 'outline' | 'link' | 'destructive';
|
|
15
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,WAAW,GACX,SAAS,GACT,MAAM,GACN,OAAO,GACP,MAAM,GACN,SAAS,GACT,MAAM,GACN,aA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,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Text } from 'react-native';
|
|
2
|
+
import { Text, View } from 'react-native';
|
|
3
3
|
import { render, fireEvent } from '@testing-library/react-native';
|
|
4
4
|
|
|
5
5
|
import { BloomThemeProvider } from '../theme/BloomThemeProvider';
|
|
6
|
+
import { useTheme } from '../theme/use-theme';
|
|
7
|
+
import type { ThemeColors } from '../theme/types';
|
|
6
8
|
import { Button, PrimaryButton, SecondaryButton, IconButton, GhostButton, TextButton } from '../button';
|
|
7
9
|
|
|
8
10
|
function renderWithTheme(ui: React.ReactElement) {
|
|
@@ -13,6 +15,71 @@ function renderWithTheme(ui: React.ReactElement) {
|
|
|
13
15
|
);
|
|
14
16
|
}
|
|
15
17
|
|
|
18
|
+
type StyleEntry = Record<string, unknown>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Deep-flatten an RN `style` prop (nested arrays, `false`/`null` holes) into the
|
|
22
|
+
* list of style objects that actually reached the node — including the
|
|
23
|
+
* `{ $$css: true, className }` descriptor react-native-css merges in.
|
|
24
|
+
*/
|
|
25
|
+
function styleEntries(style: unknown, out: StyleEntry[] = []): StyleEntry[] {
|
|
26
|
+
if (!style || typeof style !== 'object') return out;
|
|
27
|
+
if (Array.isArray(style)) {
|
|
28
|
+
for (const entry of style) styleEntries(entry, out);
|
|
29
|
+
return out;
|
|
30
|
+
}
|
|
31
|
+
out.push(style as StyleEntry);
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Every style key/value that landed on a node, later entries winning. */
|
|
36
|
+
function resolvedStyle(style: unknown): StyleEntry {
|
|
37
|
+
return Object.assign({}, ...styleEntries(style)) as StyleEntry;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** The class tokens react-native-css accepted for a node, in arrival order. */
|
|
41
|
+
function classNamesOn(style: unknown): string[] {
|
|
42
|
+
return styleEntries(style)
|
|
43
|
+
.filter((entry) => entry.$$css === true && typeof entry.className === 'string')
|
|
44
|
+
.map((entry) => String(entry.className));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface HostNode {
|
|
48
|
+
type: string;
|
|
49
|
+
props: Record<string, unknown>;
|
|
50
|
+
children: Array<HostNode | string> | null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function isHostNode(value: unknown): value is HostNode {
|
|
54
|
+
return typeof value === 'object' && value !== null && typeof (value as HostNode).type === 'string';
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Walk the HOST tree (composites are absent from `toJSON()`) for a testID. */
|
|
58
|
+
function findHost(node: unknown, testID: string): HostNode | null {
|
|
59
|
+
if (Array.isArray(node)) {
|
|
60
|
+
for (const child of node) {
|
|
61
|
+
const hit = findHost(child, testID);
|
|
62
|
+
if (hit) return hit;
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
if (!isHostNode(node)) return null;
|
|
67
|
+
if (node.props.testID === testID) return node;
|
|
68
|
+
return findHost(node.children, testID);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Read the live resolved theme colors the same way `Button` does. */
|
|
72
|
+
function captureThemeColors(): ThemeColors {
|
|
73
|
+
let captured: ThemeColors | undefined;
|
|
74
|
+
function Probe() {
|
|
75
|
+
captured = useTheme().colors;
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
renderWithTheme(<Probe />);
|
|
79
|
+
if (!captured) throw new Error('theme probe never rendered');
|
|
80
|
+
return captured;
|
|
81
|
+
}
|
|
82
|
+
|
|
16
83
|
describe('Button', () => {
|
|
17
84
|
it('renders children as text', () => {
|
|
18
85
|
const { getByText } = renderWithTheme(<Button>Click me</Button>);
|
|
@@ -95,6 +162,104 @@ describe('Button', () => {
|
|
|
95
162
|
});
|
|
96
163
|
});
|
|
97
164
|
|
|
165
|
+
// Regression: the native button used to render its `Pressable` inside an
|
|
166
|
+
// unstyled `Animated.View` that existed only to hold the press-scale transform.
|
|
167
|
+
// That wrapper — not the pressable — was the flex child of whatever laid the
|
|
168
|
+
// button out, and it hugged its content, so `className="flex-1"` (and every
|
|
169
|
+
// other layout the caller expressed) applied inside a box that never grew. The
|
|
170
|
+
// web fork renders one real `<button>` and has always behaved. Nothing errored;
|
|
171
|
+
// consumers wrapped each Bloom `Button` in their own `<View>` to compensate.
|
|
172
|
+
describe('layout: the button IS the node its parent lays out', () => {
|
|
173
|
+
it('renders the pressable as its outermost node — no wrapper in between', () => {
|
|
174
|
+
const { toJSON } = renderWithTheme(
|
|
175
|
+
<View testID="host">
|
|
176
|
+
<Button testID="btn" className="flex-1">
|
|
177
|
+
Wide
|
|
178
|
+
</Button>
|
|
179
|
+
</View>,
|
|
180
|
+
);
|
|
181
|
+
const host = findHost(toJSON(), 'host');
|
|
182
|
+
expect(host).not.toBeNull();
|
|
183
|
+
const rendered = (host?.children ?? []).filter(isHostNode);
|
|
184
|
+
expect(rendered).toHaveLength(1);
|
|
185
|
+
// The single node the parent lays out is the pressable itself — the one
|
|
186
|
+
// carrying the a11y role, the handlers and the button's own box.
|
|
187
|
+
expect(rendered[0]?.props.testID).toBe('btn');
|
|
188
|
+
expect(rendered[0]?.props.accessibilityRole).toBe('button');
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
it('lands the caller className on that same node, beside the button box', () => {
|
|
192
|
+
const { getByTestId } = renderWithTheme(
|
|
193
|
+
<Button testID="btn" className="flex-1">
|
|
194
|
+
Wide
|
|
195
|
+
</Button>,
|
|
196
|
+
);
|
|
197
|
+
const style = getByTestId('btn').props.style;
|
|
198
|
+
expect(classNamesOn(style)).toContain('flex-1');
|
|
199
|
+
// Same node, so a layout class and the button's visuals cannot diverge.
|
|
200
|
+
expect(resolvedStyle(style).borderRadius).toBe(999);
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
it('applies the press-scale transform to that node too, not to a wrapper', () => {
|
|
204
|
+
const { getByTestId } = renderWithTheme(<Button testID="btn">Press</Button>);
|
|
205
|
+
expect(resolvedStyle(getByTestId('btn').props.style).transform).toBeDefined();
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
it('keeps the caller style winning over the button box', () => {
|
|
209
|
+
const { getByTestId } = renderWithTheme(
|
|
210
|
+
<Button testID="btn" style={{ minHeight: 0, paddingHorizontal: 2 }}>
|
|
211
|
+
Tight
|
|
212
|
+
</Button>,
|
|
213
|
+
);
|
|
214
|
+
const style = resolvedStyle(getByTestId('btn').props.style);
|
|
215
|
+
expect(style.minHeight).toBe(0);
|
|
216
|
+
expect(style.paddingHorizontal).toBe(2);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
// Regression: the icon variant used to get its chrome from a DEFAULT
|
|
220
|
+
// `className` that the caller's own `className` replaced outright, so
|
|
221
|
+
// `<IconButton className="flex-1" />` shipped transparent and borderless. It
|
|
222
|
+
// now comes from the same resolved tokens `Button.web.tsx` already used.
|
|
223
|
+
it('keeps the icon variant chrome when the caller passes a className', () => {
|
|
224
|
+
const colors = captureThemeColors();
|
|
225
|
+
const { getByTestId } = renderWithTheme(<IconButton testID="icon" className="flex-1" />);
|
|
226
|
+
const style = resolvedStyle(getByTestId('icon').props.style);
|
|
227
|
+
expect(style.backgroundColor).toBe(colors.background);
|
|
228
|
+
expect(style.borderColor).toBe(colors.border);
|
|
229
|
+
expect(style.borderWidth).toBe(1);
|
|
230
|
+
expect(classNamesOn(getByTestId('icon').props.style)).toContain('flex-1');
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
// `variant="text"` was reported as "shrinks horizontal padding on native but is
|
|
235
|
+
// byte-identical to ghost on web". The padding is real and DELIBERATE — `text`
|
|
236
|
+
// (and its web alias `link`) is a compact inline affordance, `ghost` is a
|
|
237
|
+
// full-size button without a background — and web applies exactly the same 4/8
|
|
238
|
+
// override in `Button.web.tsx`'s `containerStyle`; only the variant COLOR table
|
|
239
|
+
// entry is shared with ghost there. The one genuine divergence left is
|
|
240
|
+
// `minHeight`, which web clears for text/link and native deliberately keeps: a
|
|
241
|
+
// finger needs the target, a cursor does not.
|
|
242
|
+
describe('variant="text" geometry', () => {
|
|
243
|
+
it('is a compact affordance, not a ghost button', () => {
|
|
244
|
+
const { getByTestId } = renderWithTheme(<TextButton testID="txt">Text</TextButton>);
|
|
245
|
+
const style = resolvedStyle(getByTestId('txt').props.style);
|
|
246
|
+
expect(style.paddingVertical).toBe(4);
|
|
247
|
+
expect(style.paddingHorizontal).toBe(8);
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
it('ghost keeps the full size-config padding', () => {
|
|
251
|
+
const { getByTestId } = renderWithTheme(<GhostButton testID="ghost">Ghost</GhostButton>);
|
|
252
|
+
const style = resolvedStyle(getByTestId('ghost').props.style);
|
|
253
|
+
expect(style.paddingVertical).toBe(8);
|
|
254
|
+
expect(style.paddingHorizontal).toBe(16);
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it('keeps the size-config minHeight so the touch target survives', () => {
|
|
258
|
+
const { getByTestId } = renderWithTheme(<TextButton testID="txt">Text</TextButton>);
|
|
259
|
+
expect(resolvedStyle(getByTestId('txt').props.style).minHeight).toBe(40);
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
|
|
98
263
|
describe('Button variants', () => {
|
|
99
264
|
it('PrimaryButton renders without crashing', () => {
|
|
100
265
|
const { getByText } = renderWithTheme(
|
|
@@ -129,6 +129,22 @@ describe('Button.web', () => {
|
|
|
129
129
|
expect(btn).toHaveClass('custom');
|
|
130
130
|
});
|
|
131
131
|
|
|
132
|
+
// Parity with the native fork's "the button IS the node its parent lays out"
|
|
133
|
+
// suite in `Button.test.tsx`. Both platforms render ONE node, so a caller's
|
|
134
|
+
// layout class reaches the box the parent actually lays out; a wrapper element
|
|
135
|
+
// added here would scope it away exactly the way native's `Animated.View` did.
|
|
136
|
+
it('renders the classed button as the outermost node — no wrapper element', () => {
|
|
137
|
+
const c = mount(
|
|
138
|
+
<div data-testid="host">
|
|
139
|
+
<Button className="flex-1">Wide</Button>
|
|
140
|
+
</div>,
|
|
141
|
+
);
|
|
142
|
+
const host = c.querySelector('[data-testid="host"]');
|
|
143
|
+
expect(host?.children).toHaveLength(1);
|
|
144
|
+
expect(host?.firstElementChild?.tagName).toBe('BUTTON');
|
|
145
|
+
expect(host?.firstElementChild).toHaveClass('flex-1');
|
|
146
|
+
});
|
|
147
|
+
|
|
132
148
|
it('applies aria-label from accessibilityLabel', () => {
|
|
133
149
|
const c = mount(<Button accessibilityLabel="Save changes">Save</Button>);
|
|
134
150
|
expect(getByLabelText(c, 'Save changes')).toBeTruthy();
|
package/src/button/Button.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo, memo } from 'react';
|
|
1
|
+
import React, { useMemo, memo, type ComponentType } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
ActivityIndicator,
|
|
4
4
|
Animated,
|
|
@@ -7,9 +7,12 @@ import {
|
|
|
7
7
|
StyleSheet,
|
|
8
8
|
Text,
|
|
9
9
|
View,
|
|
10
|
+
type PressableProps,
|
|
11
|
+
type StyleProp,
|
|
10
12
|
type TextStyle,
|
|
11
13
|
type ViewStyle,
|
|
12
14
|
} from 'react-native';
|
|
15
|
+
import { styled } from 'react-native-css';
|
|
13
16
|
|
|
14
17
|
import { useTheme } from '../theme/use-theme';
|
|
15
18
|
import { usePressAnimation } from '../hooks/usePressAnimation';
|
|
@@ -69,6 +72,73 @@ const PILL_RADIUS = 999;
|
|
|
69
72
|
const PRESS_SCALE = 0.97;
|
|
70
73
|
const SCALE_VARIANTS = new Set<string>(['primary', 'secondary', 'inverse']);
|
|
71
74
|
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
// The button renders ONE node — the same shape the web fork renders (one
|
|
77
|
+
// `<button>`).
|
|
78
|
+
//
|
|
79
|
+
// It used to be two: an unstyled `Animated.View` holding the press-scale
|
|
80
|
+
// transform, wrapping the `Pressable` that carried `className`, `style` and
|
|
81
|
+
// every visual. That wrapper — not the pressable — was the flex child of
|
|
82
|
+
// whatever laid the button out, and it hugged its content, so a caller's
|
|
83
|
+
// `className="flex-1"` (and `style={{ alignSelf }}`, and every other layout
|
|
84
|
+
// declaration) applied INSIDE a box that never grew. Nothing errored; the same
|
|
85
|
+
// call site behaved on web and did nothing on native, and consumers worked
|
|
86
|
+
// around it by wrapping every Bloom `Button` in their own `<View>`.
|
|
87
|
+
//
|
|
88
|
+
// Collapsing the two nodes settles "which node does a class belong on?" by
|
|
89
|
+
// removing the choice: layout and visuals are one box here exactly as they are
|
|
90
|
+
// in the DOM, so a layout class and a visual class cannot land in different
|
|
91
|
+
// places. The touch target now scales with the press (0.97 — ~1px on a 40dp
|
|
92
|
+
// button, and the press is registered before it starts), the same trade
|
|
93
|
+
// `PressableScale` made when it dropped its own two-node structure.
|
|
94
|
+
//
|
|
95
|
+
// `styled()` comes from Bloom's own `react-native-css` dependency rather than
|
|
96
|
+
// passing `className` as a bare prop and hoping the consumer's NativeWind
|
|
97
|
+
// interop recognises a component Bloom built at module scope. Same reasoning,
|
|
98
|
+
// and the same silent failure if skipped, as `typography/styled-text.ts`.
|
|
99
|
+
//
|
|
100
|
+
// Both wrappers are built ONCE at module scope so the element type is stable
|
|
101
|
+
// across renders — one built during render remounts the subtree every time.
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Exactly the prop surface `Button` hands to the pressable, and no wider.
|
|
106
|
+
* `Animated.createAnimatedComponent` maps `WithAnimatedValue` over every prop of
|
|
107
|
+
* the component it wraps, and doing that to the whole of `PressableProps`
|
|
108
|
+
* overflows the checker (`TS2590: union type that is too complex to represent`).
|
|
109
|
+
* Narrowing is also honest: the function form of `style` is deliberately
|
|
110
|
+
* excluded — see the `useInteractionState` comment in the component body for why
|
|
111
|
+
* Bloom never uses it.
|
|
112
|
+
*/
|
|
113
|
+
type ButtonPressableProps = Pick<
|
|
114
|
+
PressableProps,
|
|
115
|
+
| 'accessibilityHint'
|
|
116
|
+
| 'accessibilityLabel'
|
|
117
|
+
| 'accessibilityRole'
|
|
118
|
+
| 'accessibilityState'
|
|
119
|
+
| 'children'
|
|
120
|
+
| 'className'
|
|
121
|
+
| 'disabled'
|
|
122
|
+
| 'hitSlop'
|
|
123
|
+
| 'onPress'
|
|
124
|
+
| 'onPressIn'
|
|
125
|
+
| 'onPressOut'
|
|
126
|
+
| 'testID'
|
|
127
|
+
> & { style?: StyleProp<ViewStyle> };
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* The same `Pressable` object, typed down to {@link ButtonPressableProps}.
|
|
131
|
+
* `styled()` derives its mapping type from a dot-path union over the wrapped
|
|
132
|
+
* component's ENTIRE prop type, and the one over `PressableProps` also overflows
|
|
133
|
+
* the checker. Nothing changes at runtime — this is the identical component.
|
|
134
|
+
*/
|
|
135
|
+
const ButtonPressable: ComponentType<ButtonPressableProps> = Pressable;
|
|
136
|
+
|
|
137
|
+
const StyledPressable: ComponentType<ButtonPressableProps> = styled(ButtonPressable, {
|
|
138
|
+
className: 'style',
|
|
139
|
+
});
|
|
140
|
+
const AnimatedPressable = Animated.createAnimatedComponent(StyledPressable);
|
|
141
|
+
|
|
72
142
|
const ButtonComponent: React.FC<ButtonProps> = ({
|
|
73
143
|
onPress,
|
|
74
144
|
children,
|
|
@@ -170,6 +240,16 @@ const ButtonComponent: React.FC<ButtonProps> = ({
|
|
|
170
240
|
styles.borderRadius = PILL_RADIUS;
|
|
171
241
|
break;
|
|
172
242
|
case 'icon':
|
|
243
|
+
// Resolved tokens, not `className="bg-background border border-border"`.
|
|
244
|
+
// The class form made the caller's `className` and the icon's own chrome
|
|
245
|
+
// compete for one slot — `<IconButton className="flex-1" />` replaced the
|
|
246
|
+
// default and shipped a transparent, borderless icon button — and it left
|
|
247
|
+
// the chrome dependent on the consumer's Tailwind pipeline resolving
|
|
248
|
+
// Bloom's color names. These are the SAME tokens `Button.web.tsx`'s
|
|
249
|
+
// `resolveVariantStyle('icon')` already writes inline.
|
|
250
|
+
styles.backgroundColor = theme.colors.background;
|
|
251
|
+
styles.borderWidth = 1;
|
|
252
|
+
styles.borderColor = theme.colors.border;
|
|
173
253
|
styles.borderRadius = PILL_RADIUS;
|
|
174
254
|
styles.padding = 8;
|
|
175
255
|
styles.width = sizeConfig.minHeight;
|
|
@@ -220,7 +300,6 @@ const ButtonComponent: React.FC<ButtonProps> = ({
|
|
|
220
300
|
|
|
221
301
|
const defaultHitSlop = variant === 'icon' ? ICON_HIT_SLOP : undefined;
|
|
222
302
|
const resolvedActiveOpacity = activeOpacity ?? (variant === 'icon' ? 0.7 : 0.8);
|
|
223
|
-
const resolvedClassName = className ?? (variant === 'icon' ? 'bg-background border border-border' : undefined);
|
|
224
303
|
|
|
225
304
|
const content = (
|
|
226
305
|
<>
|
|
@@ -233,44 +312,48 @@ const ButtonComponent: React.FC<ButtonProps> = ({
|
|
|
233
312
|
);
|
|
234
313
|
|
|
235
314
|
return (
|
|
236
|
-
<
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
315
|
+
<AnimatedPressable
|
|
316
|
+
className={className}
|
|
317
|
+
style={[
|
|
318
|
+
baseStyles,
|
|
319
|
+
disabled && !loading && { opacity: 0.5 },
|
|
320
|
+
pressed && !hasScaleFeedback && !isInteractionBlocked && { opacity: resolvedActiveOpacity },
|
|
321
|
+
// Before the caller's `style`, so `style` keeps winning the whole array
|
|
322
|
+
// the way it always has (and the way the web fork spreads it last). The
|
|
323
|
+
// cost is that a caller who sets `transform` on a scale variant replaces
|
|
324
|
+
// the press scale instead of composing with it — when the transform sat
|
|
325
|
+
// on a separate wrapper node the two multiplied.
|
|
326
|
+
hasScaleFeedback ? { transform: [{ scale: scaleAnim }] } : null,
|
|
327
|
+
style,
|
|
328
|
+
]}
|
|
329
|
+
onPress={isInteractionBlocked ? undefined : onPress}
|
|
330
|
+
onPressIn={handlePressIn}
|
|
331
|
+
onPressOut={handlePressOut}
|
|
332
|
+
disabled={isInteractionBlocked}
|
|
333
|
+
hitSlop={hitSlop ?? defaultHitSlop}
|
|
334
|
+
accessibilityLabel={accessibilityLabel}
|
|
335
|
+
accessibilityHint={accessibilityHint}
|
|
336
|
+
accessibilityRole="button"
|
|
337
|
+
accessibilityState={loading ? { disabled: isInteractionBlocked, busy: true } : { disabled: isInteractionBlocked }}
|
|
338
|
+
testID={testID}
|
|
339
|
+
>
|
|
340
|
+
{loading ? (
|
|
341
|
+
<>
|
|
342
|
+
<View
|
|
343
|
+
style={styles.loadingHiddenContent}
|
|
344
|
+
importantForAccessibility="no-hide-descendants"
|
|
345
|
+
accessibilityElementsHidden
|
|
346
|
+
>
|
|
347
|
+
{content}
|
|
348
|
+
</View>
|
|
349
|
+
<View style={styles.loadingOverlay}>
|
|
350
|
+
<ActivityIndicator size="small" color={loadingColor ?? resolvedTextColor} />
|
|
351
|
+
</View>
|
|
352
|
+
</>
|
|
353
|
+
) : (
|
|
354
|
+
content
|
|
355
|
+
)}
|
|
356
|
+
</AnimatedPressable>
|
|
274
357
|
);
|
|
275
358
|
};
|
|
276
359
|
|
|
@@ -18,9 +18,17 @@ import type { ButtonProps, ButtonSize, ButtonVariant } from './types';
|
|
|
18
18
|
export type { ButtonProps, ButtonVariant, ButtonSize } from './types';
|
|
19
19
|
|
|
20
20
|
// ---------------------------------------------------------------------------
|
|
21
|
-
// Geometry — mirrors the native (`Button.tsx`) impl
|
|
22
|
-
//
|
|
23
|
-
//
|
|
21
|
+
// Geometry — mirrors the native (`Button.tsx`) impl so the web button is
|
|
22
|
+
// pixel-consistent with native. Sizes below are the resolved primitives; the
|
|
23
|
+
// shadcn-style aliases (`sm | md | lg | icon`) are normalized first.
|
|
24
|
+
//
|
|
25
|
+
// ONE deliberate exception, in `containerStyle`: `text`/`link` clear
|
|
26
|
+
// `minHeight` here so the control hugs its label and sits inline (which is what
|
|
27
|
+
// makes `asChild` anchors work), while native keeps the size config's value to
|
|
28
|
+
// preserve the touch target. The 4/8 padding override those variants get is NOT
|
|
29
|
+
// an exception — native applies exactly the same one, so `text` is a compact
|
|
30
|
+
// affordance and `ghost` a full-size button without a background on both
|
|
31
|
+
// platforms. Only the variant COLOR table below is shared between them.
|
|
24
32
|
// ---------------------------------------------------------------------------
|
|
25
33
|
|
|
26
34
|
type NativeSize = 'small' | 'medium' | 'large';
|
package/src/button/types.ts
CHANGED
|
@@ -11,6 +11,14 @@ import type { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
|
11
11
|
* the set. On native they fall back to a sensible equivalent
|
|
12
12
|
* (`outline → secondary`, `link → text`, `destructive → primary` tinted with
|
|
13
13
|
* the negative token) so passing them never crashes a native consumer.
|
|
14
|
+
*
|
|
15
|
+
* `text` (and its web alias `link`) is DELIBERATELY not a transparent `ghost`:
|
|
16
|
+
* it is the compact inline affordance, so it overrides the size config's padding
|
|
17
|
+
* down to 4/8 on BOTH platforms. `ghost` keeps the full padding — it is a
|
|
18
|
+
* regular button that happens to have no background. The one geometry that does
|
|
19
|
+
* differ by platform is `minHeight`: web clears it for `text`/`link` so the
|
|
20
|
+
* control hugs its label and sits inline, native keeps the size config's value
|
|
21
|
+
* because a finger needs the target and a cursor does not.
|
|
14
22
|
*/
|
|
15
23
|
export type ButtonVariant =
|
|
16
24
|
| 'primary'
|