bleam 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/ai.cjs +5 -4
  2. package/dist/ai.d.ts +1 -1
  3. package/dist/ai.js +4 -3
  4. package/dist/app-storage-D8W4n8ey.cjs +39 -0
  5. package/dist/app-storage-Isi5Bo0R.js +34 -0
  6. package/dist/cli.cjs +148 -22
  7. package/dist/cli.d.cts +13 -0
  8. package/dist/cli.d.ts +14 -1
  9. package/dist/cli.js +148 -22
  10. package/dist/config.d.ts +1 -1
  11. package/dist/elements-CFk0QHw0.d.cts +127 -0
  12. package/dist/elements-ClGQ41Sc.d.ts +127 -0
  13. package/dist/{ui.cjs → elements.cjs} +307 -168
  14. package/dist/elements.d.cts +2 -0
  15. package/dist/elements.d.ts +2 -0
  16. package/dist/{ui.js → elements.js} +306 -169
  17. package/dist/{files-BXVkPrPN.js → files-DErLhzCB.js} +5 -11
  18. package/dist/{files-DxaQ-Nv0.cjs → files-lMk-CpL_.cjs} +5 -11
  19. package/dist/files.cjs +1 -1
  20. package/dist/files.d.ts +1 -1
  21. package/dist/files.js +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/schema.cjs +1 -1
  24. package/dist/schema.d.cts +1 -1
  25. package/dist/schema.d.ts +1 -1
  26. package/dist/schema.js +1 -1
  27. package/dist/secrets.cjs +146 -0
  28. package/dist/secrets.d.cts +14 -0
  29. package/dist/secrets.d.ts +14 -0
  30. package/dist/secrets.js +142 -0
  31. package/dist/{state-LssDgpff.cjs → state-BZYyrE2-.cjs} +4 -41
  32. package/dist/{state-Dh3HLixb.js → state-DkaRFkZJ.js} +4 -35
  33. package/dist/state.cjs +3 -2
  34. package/dist/state.d.cts +1 -1
  35. package/dist/state.d.ts +1 -1
  36. package/dist/state.js +3 -2
  37. package/dist/window.d.cts +1 -1
  38. package/dist/window.d.ts +3 -3
  39. package/package.json +11 -6
  40. package/templates/basic/app/index.tsx +2 -2
  41. package/templates/foundation-models/app/index.tsx +4 -4
  42. package/templates/image-generation/app/index.tsx +2 -2
  43. package/templates/native/modules/bleam-runtime/ios/AIModule.swift +7 -8
  44. package/templates/state/app/index.tsx +2 -2
  45. package/templates/text-generation/app/index.tsx +4 -4
  46. package/templates/updates/README.md +1 -1
  47. package/dist/ui-1WepaMS4.d.cts +0 -92
  48. package/dist/ui-D7bRLYee.d.ts +0 -92
  49. package/dist/ui.d.cts +0 -2
  50. package/dist/ui.d.ts +0 -2
  51. /package/dist/{config-Chi-flpJ.d.ts → config-Cms0rvqg.d.ts} +0 -0
  52. /package/dist/{files-VrkQlKIT.d.ts → files-4ZEoAWiv.d.ts} +0 -0
  53. /package/dist/{native-sqlite-yQLD5s9i.cjs → native-sqlite-Dw--FI9a.cjs} +0 -0
  54. /package/dist/{native-sqlite-xcGdamRD.js → native-sqlite-WzRNzCSh.js} +0 -0
  55. /package/dist/{schema-B5BfdswF.js → schema-B7ELMpuI.js} +0 -0
  56. /package/dist/{schema-BnVZOXfu.cjs → schema-B7SLUBLN.cjs} +0 -0
  57. /package/dist/{schema-D5eImHxu.d.cts → schema-BWsDPc6c.d.cts} +0 -0
  58. /package/dist/{schema-SSjokbtw.d.ts → schema-LxnzAfgw.d.ts} +0 -0
@@ -2,8 +2,10 @@ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
2
  const require_native_runtime = require('./native-runtime-CsXnXkQn.cjs');
3
3
  let react_native = require("react-native");
4
4
  react_native = require_chunk.__toESM(react_native);
5
+ let react_jsx_runtime = require("react/jsx-runtime");
6
+ react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
5
7
 
6
- //#region src/ui/shared.ts
8
+ //#region src/elements/shared.ts
7
9
  function textFromChildren(children) {
8
10
  if (typeof children === "string" || typeof children === "number") return String(children);
9
11
  if (Array.isArray(children)) return children.filter((child) => typeof child === "string" || typeof child === "number").join("");
@@ -42,142 +44,90 @@ function fontFromStyle(style) {
42
44
  }
43
45
 
44
46
  //#endregion
45
- //#region src/ui/button.tsx
46
- function buttonTitle(props) {
47
- return props.title ?? textFromChildren(props.children) ?? "";
48
- }
49
- function buttonConfiguration(variant) {
50
- if (variant === "secondary") return UIButtonConfiguration.borderedButtonConfiguration();
51
- if (variant === "plain") return UIButtonConfiguration.plainButtonConfiguration();
52
- return UIButtonConfiguration.borderedProminentButtonConfiguration();
47
+ //#region src/elements/blur-view.tsx
48
+ function blurStyle(intensity, colorScheme) {
49
+ const scheme = colorScheme ?? "auto";
50
+ const level = intensity ?? "regular";
51
+ if (scheme === "light") switch (level) {
52
+ case "ultraThin": return UIBlurEffectStyle.SystemUltraThinMaterialLight;
53
+ case "thin": return UIBlurEffectStyle.SystemThinMaterialLight;
54
+ case "thick": return UIBlurEffectStyle.SystemThickMaterialLight;
55
+ case "chrome": return UIBlurEffectStyle.SystemChromeMaterialLight;
56
+ default: return UIBlurEffectStyle.SystemMaterialLight;
57
+ }
58
+ if (scheme === "dark") switch (level) {
59
+ case "ultraThin": return UIBlurEffectStyle.SystemUltraThinMaterialDark;
60
+ case "thin": return UIBlurEffectStyle.SystemThinMaterialDark;
61
+ case "thick": return UIBlurEffectStyle.SystemThickMaterialDark;
62
+ case "chrome": return UIBlurEffectStyle.SystemChromeMaterialDark;
63
+ default: return UIBlurEffectStyle.SystemMaterialDark;
64
+ }
65
+ switch (level) {
66
+ case "ultraThin": return UIBlurEffectStyle.SystemUltraThinMaterial;
67
+ case "thin": return UIBlurEffectStyle.SystemThinMaterial;
68
+ case "thick": return UIBlurEffectStyle.SystemThickMaterial;
69
+ case "chrome": return UIBlurEffectStyle.SystemChromeMaterial;
70
+ default: return UIBlurEffectStyle.SystemMaterial;
71
+ }
53
72
  }
54
- function buttonSize(size) {
55
- if (size === "small") return UIButtonConfigurationSize.Small;
56
- if (size === "large") return UIButtonConfigurationSize.Large;
57
- return UIButtonConfigurationSize.Medium;
73
+ function createEffectHost(effect) {
74
+ const rootView = UIVisualEffectView.alloc().initWithEffect(effect);
75
+ rootView.backgroundColor = UIColor.clearColor;
76
+ rootView.contentView.backgroundColor = UIColor.clearColor;
77
+ rootView.autoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
78
+ rootView.contentView.autoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
79
+ return {
80
+ rootView,
81
+ childrenView: rootView.contentView
82
+ };
58
83
  }
59
- const Button = require_native_runtime.ensureNativeScript().defineUIKitView({
60
- name: "Button",
61
- layout: {
62
- sizing: "intrinsic",
63
- defaultSize: {
64
- width: 1,
65
- height: 34
66
- }
67
- },
68
- create(ctx) {
69
- const button = UIButton.buttonWithType(UIButtonType.System);
70
- ctx.targetAction(button, UIControlEvents.TouchUpInside, () => {
71
- ctx.emit("onPress");
72
- });
73
- return button;
74
- },
75
- update(button, props, _previousProps, ctx) {
76
- const style = styleFromProps(props.style);
77
- const configuration = buttonConfiguration(props.variant);
78
- configuration.title = buttonTitle(props);
79
- configuration.buttonSize = buttonSize(props.size);
80
- configuration.showsActivityIndicator = props.loading ?? false;
81
- const foregroundColor = colorFromStyle(style?.color);
82
- if (foregroundColor) configuration.baseForegroundColor = foregroundColor;
83
- const backgroundColor = colorFromStyle(style?.backgroundColor);
84
- if (backgroundColor) configuration.baseBackgroundColor = backgroundColor;
85
- button.configuration = configuration;
86
- button.enabled = !(props.disabled || props.loading);
87
- ctx?.invalidateLayout();
88
- }
89
- });
90
-
91
- //#endregion
92
- //#region src/ui/label.tsx
93
- function labelText(props) {
94
- return props.text ?? textFromChildren(props.children) ?? "";
84
+ function applyContainerStyle(view, style) {
85
+ const borderRadius = style?.borderRadius;
86
+ if (typeof borderRadius === "number") view.layer.cornerRadius = borderRadius;
87
+ view.clipsToBounds = style?.overflow === "hidden" || typeof borderRadius === "number";
95
88
  }
96
- function defaultLabelColor(tone) {
97
- if (tone === "secondary") return UIColor.secondaryLabelColor;
98
- if (tone === "tertiary") return UIColor.tertiaryLabelColor;
99
- return UIColor.labelColor;
89
+ function updateBlurEffect(view, props) {
90
+ view.effect = UIBlurEffect.effectWithStyle(blurStyle(props.intensity, props.colorScheme));
100
91
  }
101
- const Label = require_native_runtime.ensureNativeScript().defineUIKitView({
102
- name: "Label",
92
+ const BlurView = require_native_runtime.ensureNativeScript().defineUIKitContainer({
93
+ name: "BlurView",
103
94
  layout: {
104
- sizing: "intrinsic",
95
+ sizing: "fill",
105
96
  defaultSize: {
106
- width: 1,
107
- height: 24
97
+ width: 0,
98
+ height: 0
108
99
  }
109
100
  },
110
101
  create() {
111
- const label = UILabel.new();
112
- label.adjustsFontForContentSizeCategory = true;
113
- return label;
102
+ return createEffectHost(UIBlurEffect.effectWithStyle(UIBlurEffectStyle.SystemMaterial));
114
103
  },
115
- update(label, props, _previousProps, ctx) {
116
- const style = styleFromProps(props.style);
117
- label.text = labelText(props);
118
- label.textColor = colorFromStyle(style?.color) ?? defaultLabelColor(props.tone);
119
- label.font = fontFromStyle(style) ?? UIFont.preferredFontForTextStyle(UIFontTextStyleBody);
120
- label.numberOfLines = props.numberOfLines ?? 0;
121
- if (style?.textAlign === "center") label.textAlignment = NSTextAlignment.Center;
122
- else if (style?.textAlign === "right") label.textAlignment = NSTextAlignment.Right;
123
- else label.textAlignment = NSTextAlignment.Left;
104
+ update(view, props, _previousProps, ctx) {
105
+ updateBlurEffect(view.rootView, props);
106
+ applyContainerStyle(view.rootView, styleFromProps(props.style));
124
107
  ctx?.invalidateLayout();
125
108
  }
126
109
  });
127
110
 
128
111
  //#endregion
129
- //#region src/ui/symbol.tsx
130
- function symbolWeight(weight) {
131
- switch (weight) {
132
- case "ultraLight": return UIImageSymbolWeight.UltraLight;
133
- case "thin": return UIImageSymbolWeight.Thin;
134
- case "light": return UIImageSymbolWeight.Light;
135
- case "medium": return UIImageSymbolWeight.Medium;
136
- case "semibold": return UIImageSymbolWeight.Semibold;
137
- case "bold": return UIImageSymbolWeight.Bold;
138
- case "heavy": return UIImageSymbolWeight.Heavy;
139
- case "black": return UIImageSymbolWeight.Black;
140
- default: return UIImageSymbolWeight.Regular;
141
- }
142
- }
143
- function symbolScale(scale) {
144
- if (scale === "small") return UIImageSymbolScale.Small;
145
- if (scale === "large") return UIImageSymbolScale.Large;
146
- return UIImageSymbolScale.Medium;
112
+ //#region src/elements/button-state.ts
113
+ function buttonDisabled(disabled, loading) {
114
+ return disabled || loading;
147
115
  }
148
- function symbolConfiguration(props, style) {
149
- const size = props.size ?? style?.fontSize ?? 17;
150
- return UIImageSymbolConfiguration.configurationWithPointSizeWeightScale(size, symbolWeight(props.weight), symbolScale(props.scale));
116
+ function buttonOpacity(options) {
117
+ if (buttonDisabled(options.disabled, options.loading)) return .45;
118
+ if (!options.pressed) return 1;
119
+ return Math.min(1, Math.max(0, options.activeOpacity));
151
120
  }
152
- function symbolImage(name, configuration) {
153
- if (configuration) return UIImage.systemImageNamedWithConfiguration(name, configuration);
154
- return UIImage.systemImageNamed(name);
121
+ function buttonAccessibilityState(state, disabled, loading) {
122
+ return {
123
+ ...state,
124
+ disabled: buttonDisabled(disabled, loading),
125
+ busy: loading
126
+ };
155
127
  }
156
- const Symbol = require_native_runtime.ensureNativeScript().defineUIKitView({
157
- name: "Symbol",
158
- layout: {
159
- sizing: "intrinsic",
160
- defaultSize: {
161
- width: 17,
162
- height: 17
163
- }
164
- },
165
- create() {
166
- const imageView = UIImageView.new();
167
- imageView.contentMode = UIViewContentMode.ScaleAspectFit;
168
- return imageView;
169
- },
170
- update(imageView, props, _previousProps, ctx) {
171
- const style = styleFromProps(props.style);
172
- const configuration = symbolConfiguration(props, style);
173
- imageView.image = symbolImage(props.symbol, configuration);
174
- imageView.tintColor = colorFromStyle(props.color) ?? colorFromStyle(style?.tintColor) ?? colorFromStyle(style?.color) ?? UIColor.labelColor;
175
- ctx?.invalidateLayout();
176
- }
177
- });
178
128
 
179
129
  //#endregion
180
- //#region src/ui/glass-shared.ts
130
+ //#region src/elements/glass-shared.ts
181
131
  function glassStyleValue(style) {
182
132
  return typeof style === "object" ? style.style : style ?? "regular";
183
133
  }
@@ -247,7 +197,7 @@ function updateGlassContainerEffect(view, spacing) {
247
197
  }
248
198
 
249
199
  //#endregion
250
- //#region src/ui/glass-view.tsx
200
+ //#region src/elements/glass-view.tsx
251
201
  const GlassView = require_native_runtime.ensureNativeScript().defineUIKitContainer({
252
202
  name: "GlassView",
253
203
  layout: {
@@ -268,7 +218,172 @@ const GlassView = require_native_runtime.ensureNativeScript().defineUIKitContain
268
218
  });
269
219
 
270
220
  //#endregion
271
- //#region src/ui/glass-container.tsx
221
+ //#region src/elements/button.tsx
222
+ const sizeStyles = {
223
+ small: {
224
+ minHeight: 28,
225
+ minWidth: 28,
226
+ paddingHorizontal: 10
227
+ },
228
+ regular: {
229
+ minHeight: 36,
230
+ minWidth: 36,
231
+ paddingHorizontal: 14
232
+ },
233
+ large: {
234
+ minHeight: 44,
235
+ minWidth: 44,
236
+ paddingHorizontal: 18
237
+ }
238
+ };
239
+ const labelSizeStyles = {
240
+ small: { fontSize: 13 },
241
+ regular: { fontSize: 15 },
242
+ large: { fontSize: 17 }
243
+ };
244
+ const glassCornerRadius = {
245
+ small: 8,
246
+ regular: 10,
247
+ large: 12
248
+ };
249
+ function resolveStyle(style, state) {
250
+ return typeof style === "function" ? style(state) : style;
251
+ }
252
+ function ButtonContent({ icon, label, labelStyle, loading, size, variant }) {
253
+ const indicatorColor = variant === "primary" ? "#ffffff" : (0, react_native.PlatformColor)("systemBlue");
254
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.ActivityIndicator, {
255
+ accessibilityElementsHidden: true,
256
+ color: indicatorColor,
257
+ size: "small"
258
+ }) : icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
259
+ accessibilityElementsHidden: true,
260
+ children: icon
261
+ }) : null, label ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Text, {
262
+ numberOfLines: 1,
263
+ style: [
264
+ styles.label,
265
+ labelSizeStyles[size],
266
+ variant ? labelVariantStyles[variant] : styles.glassLabel,
267
+ labelStyle
268
+ ],
269
+ children: label
270
+ }) : null] });
271
+ }
272
+ function Button({ accessibilityRole = "button", accessibilityState, activeOpacity = .2, disabled = false, icon, label, labelStyle, loading = false, size = "regular", style, variant = "primary",...props }) {
273
+ const inactive = buttonDisabled(disabled, loading);
274
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Pressable, {
275
+ ...props,
276
+ accessibilityRole,
277
+ accessibilityState: buttonAccessibilityState(accessibilityState, disabled, loading),
278
+ disabled: inactive,
279
+ style: (state) => [
280
+ styles.button,
281
+ sizeStyles[size],
282
+ buttonVariantStyles[variant],
283
+ resolveStyle(style, state),
284
+ { opacity: buttonOpacity({
285
+ ...state,
286
+ disabled,
287
+ loading,
288
+ activeOpacity
289
+ }) }
290
+ ],
291
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
292
+ pointerEvents: "none",
293
+ style: styles.content,
294
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonContent, {
295
+ icon,
296
+ label,
297
+ labelStyle,
298
+ loading,
299
+ size,
300
+ variant
301
+ })
302
+ })
303
+ });
304
+ }
305
+ function GlassButton({ accessibilityRole = "button", accessibilityState, activeOpacity = .2, disabled = false, glassEffectStyle, glassStyle, icon, label, labelStyle, loading = false, size = "regular", style, tintColor,...props }) {
306
+ const inactive = buttonDisabled(disabled, loading);
307
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_native.Pressable, {
308
+ ...props,
309
+ accessibilityRole,
310
+ accessibilityState: buttonAccessibilityState(accessibilityState, disabled, loading),
311
+ disabled: inactive,
312
+ style: (state) => [
313
+ styles.button,
314
+ sizeStyles[size],
315
+ styles.glassButton,
316
+ resolveStyle(style, state),
317
+ { opacity: buttonOpacity({
318
+ ...state,
319
+ disabled,
320
+ loading,
321
+ activeOpacity
322
+ }) }
323
+ ],
324
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
325
+ pointerEvents: "none",
326
+ style: styles.glassBackground,
327
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GlassView, {
328
+ glassEffectStyle,
329
+ glassStyle: {
330
+ cornerRadius: glassCornerRadius[size],
331
+ ...glassStyle
332
+ },
333
+ isInteractive: false,
334
+ style: styles.glass,
335
+ tintColor
336
+ })
337
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
338
+ pointerEvents: "none",
339
+ style: styles.content,
340
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonContent, {
341
+ icon,
342
+ label,
343
+ labelStyle,
344
+ loading,
345
+ size
346
+ })
347
+ })]
348
+ });
349
+ }
350
+ const styles = react_native.StyleSheet.create({
351
+ button: {
352
+ alignItems: "center",
353
+ borderRadius: 10,
354
+ justifyContent: "center"
355
+ },
356
+ glassButton: { backgroundColor: "transparent" },
357
+ glass: { flex: 1 },
358
+ glassBackground: {
359
+ bottom: 0,
360
+ left: 0,
361
+ position: "absolute",
362
+ right: 0,
363
+ top: 0
364
+ },
365
+ content: {
366
+ alignItems: "center",
367
+ flexDirection: "row",
368
+ gap: 7,
369
+ justifyContent: "center"
370
+ },
371
+ label: { fontWeight: "600" },
372
+ glassLabel: { color: (0, react_native.PlatformColor)("label") }
373
+ });
374
+ const buttonVariantStyles = react_native.StyleSheet.create({
375
+ primary: { backgroundColor: (0, react_native.PlatformColor)("systemBlue") },
376
+ secondary: { backgroundColor: (0, react_native.PlatformColor)("secondarySystemFill") },
377
+ plain: { backgroundColor: "transparent" }
378
+ });
379
+ const labelVariantStyles = react_native.StyleSheet.create({
380
+ primary: { color: "#ffffff" },
381
+ secondary: { color: (0, react_native.PlatformColor)("label") },
382
+ plain: { color: (0, react_native.PlatformColor)("systemBlue") }
383
+ });
384
+
385
+ //#endregion
386
+ //#region src/elements/glass-container.tsx
272
387
  const GlassContainer = require_native_runtime.ensureNativeScript().defineUIKitContainer({
273
388
  name: "GlassContainer",
274
389
  layout: {
@@ -291,66 +406,89 @@ const GlassContainer = require_native_runtime.ensureNativeScript().defineUIKitCo
291
406
  });
292
407
 
293
408
  //#endregion
294
- //#region src/ui/blur-view.tsx
295
- function blurStyle(intensity, colorScheme) {
296
- const scheme = colorScheme ?? "auto";
297
- const level = intensity ?? "regular";
298
- if (scheme === "light") switch (level) {
299
- case "ultraThin": return UIBlurEffectStyle.SystemUltraThinMaterialLight;
300
- case "thin": return UIBlurEffectStyle.SystemThinMaterialLight;
301
- case "thick": return UIBlurEffectStyle.SystemThickMaterialLight;
302
- case "chrome": return UIBlurEffectStyle.SystemChromeMaterialLight;
303
- default: return UIBlurEffectStyle.SystemMaterialLight;
304
- }
305
- if (scheme === "dark") switch (level) {
306
- case "ultraThin": return UIBlurEffectStyle.SystemUltraThinMaterialDark;
307
- case "thin": return UIBlurEffectStyle.SystemThinMaterialDark;
308
- case "thick": return UIBlurEffectStyle.SystemThickMaterialDark;
309
- case "chrome": return UIBlurEffectStyle.SystemChromeMaterialDark;
310
- default: return UIBlurEffectStyle.SystemMaterialDark;
409
+ //#region src/elements/label.tsx
410
+ function labelText(props) {
411
+ return props.text ?? textFromChildren(props.children) ?? "";
412
+ }
413
+ function defaultLabelColor(tone) {
414
+ if (tone === "secondary") return UIColor.secondaryLabelColor;
415
+ if (tone === "tertiary") return UIColor.tertiaryLabelColor;
416
+ return UIColor.labelColor;
417
+ }
418
+ const Label = require_native_runtime.ensureNativeScript().defineUIKitView({
419
+ name: "Label",
420
+ layout: {
421
+ sizing: "intrinsic",
422
+ defaultSize: {
423
+ width: 1,
424
+ height: 24
425
+ }
426
+ },
427
+ create() {
428
+ const label = UILabel.new();
429
+ label.adjustsFontForContentSizeCategory = true;
430
+ return label;
431
+ },
432
+ update(label, props, _previousProps, ctx) {
433
+ const style = styleFromProps(props.style);
434
+ label.text = labelText(props);
435
+ label.textColor = colorFromStyle(style?.color) ?? defaultLabelColor(props.tone);
436
+ label.font = fontFromStyle(style) ?? UIFont.preferredFontForTextStyle(UIFontTextStyleBody);
437
+ label.numberOfLines = props.numberOfLines ?? 0;
438
+ if (style?.textAlign === "center") label.textAlignment = NSTextAlignment.Center;
439
+ else if (style?.textAlign === "right") label.textAlignment = NSTextAlignment.Right;
440
+ else label.textAlignment = NSTextAlignment.Left;
441
+ ctx?.invalidateLayout();
311
442
  }
312
- switch (level) {
313
- case "ultraThin": return UIBlurEffectStyle.SystemUltraThinMaterial;
314
- case "thin": return UIBlurEffectStyle.SystemThinMaterial;
315
- case "thick": return UIBlurEffectStyle.SystemThickMaterial;
316
- case "chrome": return UIBlurEffectStyle.SystemChromeMaterial;
317
- default: return UIBlurEffectStyle.SystemMaterial;
443
+ });
444
+
445
+ //#endregion
446
+ //#region src/elements/symbol.tsx
447
+ function symbolWeight(weight) {
448
+ switch (weight) {
449
+ case "ultraLight": return UIImageSymbolWeight.UltraLight;
450
+ case "thin": return UIImageSymbolWeight.Thin;
451
+ case "light": return UIImageSymbolWeight.Light;
452
+ case "medium": return UIImageSymbolWeight.Medium;
453
+ case "semibold": return UIImageSymbolWeight.Semibold;
454
+ case "bold": return UIImageSymbolWeight.Bold;
455
+ case "heavy": return UIImageSymbolWeight.Heavy;
456
+ case "black": return UIImageSymbolWeight.Black;
457
+ default: return UIImageSymbolWeight.Regular;
318
458
  }
319
459
  }
320
- function createEffectHost(effect) {
321
- const rootView = UIVisualEffectView.alloc().initWithEffect(effect);
322
- rootView.backgroundColor = UIColor.clearColor;
323
- rootView.contentView.backgroundColor = UIColor.clearColor;
324
- rootView.autoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
325
- rootView.contentView.autoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
326
- return {
327
- rootView,
328
- childrenView: rootView.contentView
329
- };
460
+ function symbolScale(scale) {
461
+ if (scale === "small") return UIImageSymbolScale.Small;
462
+ if (scale === "large") return UIImageSymbolScale.Large;
463
+ return UIImageSymbolScale.Medium;
330
464
  }
331
- function applyContainerStyle(view, style) {
332
- const borderRadius = style?.borderRadius;
333
- if (typeof borderRadius === "number") view.layer.cornerRadius = borderRadius;
334
- view.clipsToBounds = style?.overflow === "hidden" || typeof borderRadius === "number";
465
+ function symbolConfiguration(props, style) {
466
+ const size = props.size ?? style?.fontSize ?? 17;
467
+ return UIImageSymbolConfiguration.configurationWithPointSizeWeightScale(size, symbolWeight(props.weight), symbolScale(props.scale));
335
468
  }
336
- function updateBlurEffect(view, props) {
337
- view.effect = UIBlurEffect.effectWithStyle(blurStyle(props.intensity, props.colorScheme));
469
+ function symbolImage(name, configuration) {
470
+ if (configuration) return UIImage.systemImageNamedWithConfiguration(name, configuration);
471
+ return UIImage.systemImageNamed(name);
338
472
  }
339
- const BlurView = require_native_runtime.ensureNativeScript().defineUIKitContainer({
340
- name: "BlurView",
473
+ const SFSymbol = require_native_runtime.ensureNativeScript().defineUIKitView({
474
+ name: "Symbol",
341
475
  layout: {
342
- sizing: "fill",
476
+ sizing: "intrinsic",
343
477
  defaultSize: {
344
- width: 0,
345
- height: 0
478
+ width: 17,
479
+ height: 17
346
480
  }
347
481
  },
348
482
  create() {
349
- return createEffectHost(UIBlurEffect.effectWithStyle(UIBlurEffectStyle.SystemMaterial));
483
+ const imageView = UIImageView.new();
484
+ imageView.contentMode = UIViewContentMode.ScaleAspectFit;
485
+ return imageView;
350
486
  },
351
- update(view, props, _previousProps, ctx) {
352
- updateBlurEffect(view.rootView, props);
353
- applyContainerStyle(view.rootView, styleFromProps(props.style));
487
+ update(imageView, props, _previousProps, ctx) {
488
+ const style = styleFromProps(props.style);
489
+ const configuration = symbolConfiguration(props, style);
490
+ imageView.image = symbolImage(props.symbol, configuration);
491
+ imageView.tintColor = colorFromStyle(props.color) ?? colorFromStyle(style?.tintColor) ?? colorFromStyle(style?.color) ?? UIColor.labelColor;
354
492
  ctx?.invalidateLayout();
355
493
  }
356
494
  });
@@ -358,7 +496,8 @@ const BlurView = require_native_runtime.ensureNativeScript().defineUIKitContaine
358
496
  //#endregion
359
497
  exports.BlurView = BlurView;
360
498
  exports.Button = Button;
499
+ exports.GlassButton = GlassButton;
361
500
  exports.GlassContainer = GlassContainer;
362
501
  exports.GlassView = GlassView;
363
502
  exports.Label = Label;
364
- exports.Symbol = Symbol;
503
+ exports.Symbol = SFSymbol;
@@ -0,0 +1,2 @@
1
+ import { C as BlurIntensity, S as BlurColorScheme, T as BlurViewProps, _ as GlassContainerProps, a as SymbolWeight, b as GlassViewProps, c as LabelTone, d as ButtonProps, f as ButtonSize, g as GlassView, h as GlassButtonProps, i as SymbolScale, l as GlassContainer, m as GlassButton, n as SymbolName, o as Label, p as ButtonVariant, r as SymbolProps, s as LabelProps, t as SFSymbol, u as Button, v as GlassEffectStyleConfig, w as BlurView, x as GlassVisualStyle, y as GlassStyle } from "./elements-CFk0QHw0.cjs";
2
+ export { BlurColorScheme, BlurIntensity, BlurView, BlurViewProps, Button, ButtonProps, ButtonSize, ButtonVariant, GlassButton, GlassButtonProps, GlassContainer, GlassContainerProps, GlassEffectStyleConfig, GlassStyle, GlassView, GlassViewProps, GlassVisualStyle, Label, LabelProps, LabelTone, SFSymbol as Symbol, SymbolName, SymbolProps, SymbolScale, SymbolWeight };
@@ -0,0 +1,2 @@
1
+ import { C as BlurIntensity, S as BlurColorScheme, T as BlurViewProps, _ as GlassContainerProps, a as SymbolWeight, b as GlassViewProps, c as LabelTone, d as ButtonProps, f as ButtonSize, g as GlassView, h as GlassButtonProps, i as SymbolScale, l as GlassContainer, m as GlassButton, n as SymbolName, o as Label, p as ButtonVariant, r as SymbolProps, s as LabelProps, t as SFSymbol, u as Button, v as GlassEffectStyleConfig, w as BlurView, x as GlassVisualStyle, y as GlassStyle } from "./elements-ClGQ41Sc.js";
2
+ export { BlurColorScheme, BlurIntensity, BlurView, BlurViewProps, Button, ButtonProps, ButtonSize, ButtonVariant, GlassButton, GlassButtonProps, GlassContainer, GlassContainerProps, GlassEffectStyleConfig, GlassStyle, GlassView, GlassViewProps, GlassVisualStyle, Label, LabelProps, LabelTone, SFSymbol as Symbol, SymbolName, SymbolProps, SymbolScale, SymbolWeight };