nn-widgets 0.1.13 → 0.1.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nn-widgets",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "Expo config plugin for adding native widgets (iOS WidgetKit & Android App Widgets)",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -1 +1 @@
1
- {"version":3,"file":"withIosWidget.d.ts","sourceRoot":"","sources":["../src/withIosWidget.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAIb,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EAEpB,MAAM,SAAS,CAAC;AA8mDjB,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,oBAAoB,CAugB5D,CAAC;AAMF,wBAAgB,eAAe,CAC7B,KAAK,EAAE,oBAAoB,EAC3B,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,GACvB,mBAAmB,CA2GrB;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"withIosWidget.d.ts","sourceRoot":"","sources":["../src/withIosWidget.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAIb,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EAEpB,MAAM,SAAS,CAAC;AA4oDjB,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,oBAAoB,CAugB5D,CAAC;AAMF,wBAAgB,eAAe,CAC7B,KAAK,EAAE,oBAAoB,EAC3B,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,GACvB,mBAAmB,CA2GrB;AAED,eAAe,aAAa,CAAC"}
@@ -139,6 +139,15 @@ struct WidgetIconConfig {
139
139
  self.borderWidth = 0
140
140
  self.borderColor = nil
141
141
  }
142
+
143
+ init(url: String, size: CGFloat, radius: CGFloat, backgroundColor: String?, borderWidth: CGFloat, borderColor: String?) {
144
+ self.url = url
145
+ self.size = size
146
+ self.radius = radius
147
+ self.backgroundColor = backgroundColor
148
+ self.borderWidth = borderWidth
149
+ self.borderColor = borderColor
150
+ }
142
151
  }
143
152
 
144
153
  struct WidgetTextConfig {
@@ -989,19 +998,40 @@ struct ${w.name}FlexCell: View {
989
998
  } else if isIconOnly {
990
999
  // Icon only mode - centered in cell
991
1000
  if let icon = item.icon {
992
- WidgetIconView(config: icon, accentColor: defaultAccentColor)
1001
+ let scaledIcon = WidgetIconConfig(
1002
+ url: icon.url,
1003
+ size: icon.size * 1.3,
1004
+ radius: icon.radius * 1.3,
1005
+ backgroundColor: icon.backgroundColor,
1006
+ borderWidth: icon.borderWidth,
1007
+ borderColor: icon.borderColor
1008
+ )
1009
+ WidgetIconView(config: scaledIcon, accentColor: defaultAccentColor)
993
1010
  }
994
1011
  } else {
995
1012
  // Card style: icon on top, small title below
996
1013
  VStack(spacing: 4) {
997
1014
  if let icon = item.icon {
998
- WidgetIconView(config: icon, accentColor: defaultAccentColor)
1015
+ // Scale up icon for card style (1.3x larger)
1016
+ let scaledIcon = WidgetIconConfig(
1017
+ url: icon.url,
1018
+ size: icon.size * 1.3,
1019
+ radius: icon.radius * 1.3,
1020
+ backgroundColor: icon.backgroundColor,
1021
+ borderWidth: icon.borderWidth,
1022
+ borderColor: icon.borderColor
1023
+ )
1024
+ WidgetIconView(config: scaledIcon, accentColor: defaultAccentColor)
999
1025
  }
1000
1026
 
1001
1027
  Text(item.title.text)
1002
- .font(.caption2)
1003
- .fontWeight(.medium)
1004
- .foregroundColor(defaultTitleColor)
1028
+ .font(item.title.resolvedFont(default: .caption2))
1029
+ .fontWeight(item.title.resolvedWeight(default: .medium))
1030
+ .foregroundColor(
1031
+ item.title.color != nil
1032
+ ? Color(hex: item.title.color!)
1033
+ : defaultTitleColor
1034
+ )
1005
1035
  .lineLimit(2)
1006
1036
  .multilineTextAlignment(.center)
1007
1037
  .truncationMode(.tail)