react-native-tinyui 0.4.0 → 0.5.0

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 (34) hide show
  1. package/README.md +32 -31
  2. package/ios/LiquidGlassText/TinyuiLiquidGlassTextProvider.swift +64 -79
  3. package/ios/LiquidGlassText/TinyuiLiquidGlassTextShadowNode.h +46 -0
  4. package/ios/LiquidGlassText/TinyuiLiquidGlassTextShadowNode.mm +159 -0
  5. package/ios/LiquidGlassText/TinyuiLiquidGlassTextView.mm +6 -27
  6. package/ios/LiquidGlassText/TinyuiTextOutlineShape.swift +5 -2
  7. package/ios/Menu/TinyuiMenuProvider.swift +2 -2
  8. package/ios/Menu/TinyuiMenuView.mm +2 -1
  9. package/ios/Menu/TinyuiMenuViewSwift.swift +42 -124
  10. package/lib/module/LiquidGlassText/LiquidGlassTextNativeComponent.ts +2 -12
  11. package/lib/module/LiquidGlassText/index.js +60 -35
  12. package/lib/module/LiquidGlassText/index.js.map +1 -1
  13. package/lib/module/Menu/MenuNativeComponent.ts +6 -2
  14. package/lib/module/Menu/options.js +2 -2
  15. package/lib/module/Menu/options.js.map +1 -1
  16. package/lib/typescript/src/LiquidGlassText/LiquidGlassTextNativeComponent.d.ts +2 -8
  17. package/lib/typescript/src/LiquidGlassText/LiquidGlassTextNativeComponent.d.ts.map +1 -1
  18. package/lib/typescript/src/LiquidGlassText/index.d.ts +1 -1
  19. package/lib/typescript/src/LiquidGlassText/index.d.ts.map +1 -1
  20. package/lib/typescript/src/LiquidGlassText/types.d.ts +13 -22
  21. package/lib/typescript/src/LiquidGlassText/types.d.ts.map +1 -1
  22. package/lib/typescript/src/Menu/MenuNativeComponent.d.ts +2 -2
  23. package/lib/typescript/src/Menu/MenuNativeComponent.d.ts.map +1 -1
  24. package/lib/typescript/src/Menu/options.d.ts +41 -1
  25. package/lib/typescript/src/Menu/options.d.ts.map +1 -1
  26. package/lib/typescript/src/index.d.ts +1 -1
  27. package/lib/typescript/src/index.d.ts.map +1 -1
  28. package/package.json +1 -1
  29. package/src/LiquidGlassText/LiquidGlassTextNativeComponent.ts +2 -12
  30. package/src/LiquidGlassText/index.tsx +73 -39
  31. package/src/LiquidGlassText/types.ts +24 -50
  32. package/src/Menu/MenuNativeComponent.ts +6 -2
  33. package/src/Menu/options.ts +6 -2
  34. package/src/index.tsx +2 -4
@@ -1,3 +1,4 @@
1
+ import React
1
2
  import SwiftUI
2
3
  import UIKit
3
4
 
@@ -6,7 +7,7 @@ import UIKit
6
7
  * SwiftUI `Menu` implementation. Mirror of `TinyuiMenuProps` in codegen.
7
8
  */
8
9
  class TinyuiMenuProps: ObservableObject {
9
- @Published var menuConfig: String = "{}"
10
+ @Published var menuConfig: [String: Any] = [:]
10
11
  @Published var title: String = ""
11
12
  @Published var disabled: Bool = false
12
13
  @Published var hasPrimaryAction: Bool = false
@@ -18,7 +19,7 @@ class TinyuiMenuProps: ObservableObject {
18
19
  *
19
20
  * The React Native trigger (a UIView) is embedded as the menu label through
20
21
  * `RepresentableView`, so the tap target remains the native RN subtree while
21
- * the menu content is built natively from the JSON config.
22
+ * the menu content is built natively from the configuration object.
22
23
  *
23
24
  * Named distinctly from the Fabric component view `TinyuiMenuView`.
24
25
  */
@@ -74,13 +75,9 @@ struct TinyuiMenuSwiftUIView: View {
74
75
  }
75
76
  }
76
77
 
77
- /// Parses the JSON menu config into a list of SwiftUI element builders.
78
- private func buildElements(from json: String) -> [TinyuiMenuElement] {
79
- guard
80
- let data = json.data(using: .utf8),
81
- let root = try? JSONSerialization.jsonObject(with: data) as? [String: Any],
82
- let items = root["items"] as? [[String: Any]]
83
- else {
78
+ /// Converts the menu config into a list of SwiftUI element builders.
79
+ private func buildElements(from config: [String: Any]) -> [TinyuiMenuElement] {
80
+ guard let items = config["items"] as? [[String: Any]] else {
84
81
  return []
85
82
  }
86
83
  return items.map { TinyuiMenuElement(dictionary: $0) }
@@ -88,8 +85,8 @@ struct TinyuiMenuSwiftUIView: View {
88
85
  }
89
86
 
90
87
  /**
91
- * Lightweight representation of a single UIMenu element parsed from the JSON
92
- * config. Used to build SwiftUI menu content without resolving all elements
88
+ * Lightweight representation of a single UIMenu element read from the config.
89
+ * Used to build SwiftUI menu content without resolving all elements
93
90
  * eagerly. Returns `AnyView` to avoid recursive opaque return type errors.
94
91
  */
95
92
  struct TinyuiMenuElement: Identifiable {
@@ -226,19 +223,41 @@ private struct TinyuiMenuLabel: View {
226
223
  let destructive: Bool
227
224
  let showsState: Bool
228
225
 
226
+ @ViewBuilder
229
227
  var body: some View {
230
- // SwiftUI only extracts a proper title from a menu Button's label when
231
- // the label is a single `Text` (optionally with an icon). Rendering the
232
- // title through a computed @ViewBuilder property or wrapping it in
233
- // nested containers breaks that extraction, so the title must be a
234
- // direct `Text` in the label hierarchy.
235
- HStack(spacing: 6) {
236
- menuIcon
237
- title
238
- if showsState {
239
- stateIndicator
228
+ // Menu controls interpret the first text as the title and the second as
229
+ // the subtitle. When an icon is present, `Label` replaces the first Text,
230
+ // matching SwiftUI's native menu-item representation.
231
+ if hasIcon {
232
+ Label {
233
+ title
234
+ } icon: {
235
+ menuIcon
240
236
  }
237
+ } else {
238
+ title
239
+ }
240
+
241
+ if let subtitle {
242
+ Text(subtitle)
243
+ }
244
+
245
+ if showsState {
246
+ stateIndicator
247
+ }
248
+ }
249
+
250
+ private var subtitle: String? {
251
+ (dictionary["subtitle"] as? String).flatMap {
252
+ $0.isEmpty ? nil : $0
253
+ }
254
+ }
255
+
256
+ private var hasIcon: Bool {
257
+ if let icon = dictionary["icon"] as? String, !icon.isEmpty {
258
+ return UIImage(named: icon) != nil
241
259
  }
260
+ return !(dictionary["systemImage"] as? String ?? "").isEmpty
242
261
  }
243
262
 
244
263
  private var stateIndicator: some View {
@@ -254,13 +273,7 @@ private struct TinyuiMenuLabel: View {
254
273
  }
255
274
 
256
275
  private var title: Text {
257
- let title = dictionary["title"] as? String ?? ""
258
- let subtitle = (dictionary["subtitle"] as? String).flatMap {
259
- $0.isEmpty ? nil : $0
260
- }
261
- let text = subtitle.map { subtitle in
262
- Text("\(title)\n\(subtitle)")
263
- } ?? Text(title)
276
+ let text = Text(dictionary["title"] as? String ?? "")
264
277
 
265
278
  if destructive {
266
279
  return text.foregroundColor(.red)
@@ -303,102 +316,7 @@ private struct TinyuiMenuLabel: View {
303
316
  /** Converts React Native's processed ColorValue JSON into a dynamic UIColor. */
304
317
  private enum TinyuiMenuColor {
305
318
  static func uiColor(from value: Any?) -> UIColor? {
306
- if let number = value as? NSNumber {
307
- let argb = number.uint32Value
308
- return UIColor(
309
- red: CGFloat((argb >> 16) & 0xff) / 255,
310
- green: CGFloat((argb >> 8) & 0xff) / 255,
311
- blue: CGFloat(argb & 0xff) / 255,
312
- alpha: CGFloat((argb >> 24) & 0xff) / 255
313
- )
314
- }
315
-
316
- guard let object = value as? [String: Any] else {
317
- return nil
318
- }
319
-
320
- if let semanticNames = object["semantic"] as? [String] {
321
- for name in semanticNames {
322
- if let color = semanticColor(named: name) {
323
- return color
324
- }
325
- }
326
- }
327
-
328
- if let dynamic = object["dynamic"] as? [String: Any] {
329
- return UIColor { traits in
330
- let highContrast = traits.accessibilityContrast == .high
331
- let dark = traits.userInterfaceStyle == .dark
332
- let preferredKey: String
333
-
334
- switch (dark, highContrast) {
335
- case (true, true):
336
- preferredKey = "highContrastDark"
337
- case (false, true):
338
- preferredKey = "highContrastLight"
339
- case (true, false):
340
- preferredKey = "dark"
341
- case (false, false):
342
- preferredKey = "light"
343
- }
344
-
345
- return uiColor(from: dynamic[preferredKey])
346
- ?? uiColor(from: dynamic[dark ? "dark" : "light"])
347
- ?? UIColor.clear
348
- }
349
- }
350
-
351
- return nil
352
- }
353
-
354
- private static func semanticColor(named name: String) -> UIColor? {
355
- if let color = UIColor(named: name) {
356
- return color
357
- }
358
-
359
- let normalizedName = name.hasSuffix("Color")
360
- ? String(name.dropLast("Color".count))
361
- : name
362
-
363
- switch normalizedName {
364
- case "label": return .label
365
- case "secondaryLabel": return .secondaryLabel
366
- case "tertiaryLabel": return .tertiaryLabel
367
- case "quaternaryLabel": return .quaternaryLabel
368
- case "placeholderText": return .placeholderText
369
- case "separator": return .separator
370
- case "opaqueSeparator": return .opaqueSeparator
371
- case "link": return .link
372
- case "systemBackground": return .systemBackground
373
- case "secondarySystemBackground": return .secondarySystemBackground
374
- case "tertiarySystemBackground": return .tertiarySystemBackground
375
- case "systemGroupedBackground": return .systemGroupedBackground
376
- case "secondarySystemGroupedBackground": return .secondarySystemGroupedBackground
377
- case "tertiarySystemGroupedBackground": return .tertiarySystemGroupedBackground
378
- case "systemFill": return .systemFill
379
- case "secondarySystemFill": return .secondarySystemFill
380
- case "tertiarySystemFill": return .tertiarySystemFill
381
- case "quaternarySystemFill": return .quaternarySystemFill
382
- case "systemRed": return .systemRed
383
- case "systemOrange": return .systemOrange
384
- case "systemYellow": return .systemYellow
385
- case "systemGreen": return .systemGreen
386
- case "systemMint": return .systemMint
387
- case "systemTeal": return .systemTeal
388
- case "systemCyan": return .systemCyan
389
- case "systemBlue": return .systemBlue
390
- case "systemIndigo": return .systemIndigo
391
- case "systemPurple": return .systemPurple
392
- case "systemPink": return .systemPink
393
- case "systemBrown": return .systemBrown
394
- case "systemGray": return .systemGray
395
- case "systemGray2": return .systemGray2
396
- case "systemGray3": return .systemGray3
397
- case "systemGray4": return .systemGray4
398
- case "systemGray5": return .systemGray5
399
- case "systemGray6": return .systemGray6
400
- default: return nil
401
- }
319
+ value.flatMap(RCTConvert.uiColor)
402
320
  }
403
321
  }
404
322
 
@@ -1,23 +1,13 @@
1
1
  import {
2
2
  codegenNativeComponent,
3
+ type CodegenTypes,
3
4
  type ColorValue,
4
5
  type ViewProps,
5
6
  } from 'react-native';
6
- import type {
7
- DirectEventHandler,
8
- Double,
9
- } from 'react-native/Libraries/Types/CodegenTypes';
10
7
 
11
8
  export interface NativeLiquidGlassTextProps extends ViewProps {
12
- configuration: string;
9
+ configuration: CodegenTypes.UnsafeMixed;
13
10
  tintColor?: ColorValue;
14
- onContentSizeChange?: DirectEventHandler<
15
- Readonly<{
16
- width: Double;
17
- height: Double;
18
- configuration: string;
19
- }>
20
- >;
21
11
  }
22
12
 
23
13
  export default codegenNativeComponent<NativeLiquidGlassTextProps>(
@@ -1,16 +1,52 @@
1
1
  "use strict";
2
2
 
3
- import { forwardRef, useState } from 'react';
3
+ import { forwardRef } from 'react';
4
+ import { StyleSheet } from 'react-native';
4
5
  import { assertComponentEnabled } from "../utils/index.js";
5
6
  import NativeLiquidGlassTextView from './LiquidGlassTextNativeComponent';
6
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
+ function normalizeFontWeight(fontWeight) {
9
+ if (fontWeight == null) {
10
+ return undefined;
11
+ }
12
+ const value = String(fontWeight);
13
+ const aliases = {
14
+ 'normal': 'regular',
15
+ 'ultralight': 'ultraLight',
16
+ 'condensed': 'regular',
17
+ 'condensedBold': 'bold',
18
+ '100': 'ultraLight',
19
+ '200': 'thin',
20
+ '300': 'light',
21
+ '400': 'regular',
22
+ '500': 'medium',
23
+ '600': 'semibold',
24
+ '700': 'bold',
25
+ '800': 'heavy',
26
+ '900': 'black'
27
+ };
28
+ return aliases[value] ?? value;
29
+ }
30
+ function resolveAlignment(textAlign) {
31
+ switch (textAlign) {
32
+ case 'center':
33
+ return 'center';
34
+ case 'right':
35
+ return 'trailing';
36
+ case 'left':
37
+ return 'leading';
38
+ default:
39
+ return undefined;
40
+ }
41
+ }
7
42
  export const LiquidGlassText = /*#__PURE__*/forwardRef(function LiquidGlassTextRoot({
8
43
  text,
9
- glass = 'clear',
10
- font = 'body',
11
- fontWeight,
44
+ effect = 'clear',
45
+ tint,
46
+ interactive = false,
12
47
  fontDesign,
13
- multilineTextAlignment = 'leading',
48
+ textStyle,
49
+ multilineTextAlignment,
14
50
  style,
15
51
  accessibilityLabel,
16
52
  accessible = true,
@@ -18,21 +54,25 @@ export const LiquidGlassText = /*#__PURE__*/forwardRef(function LiquidGlassTextR
18
54
  ...viewProps
19
55
  }, ref) {
20
56
  assertComponentEnabled('LiquidGlassText');
21
- const [measurement, setMeasurement] = useState({
22
- width: 0,
23
- height: 0
24
- });
25
- const configuration = JSON.stringify({
57
+ const flattenedTextStyle = StyleSheet.flatten(textStyle);
58
+ const normalizedTextStyle = flattenedTextStyle ? {
59
+ fontSize: flattenedTextStyle.fontSize,
60
+ fontFamily: flattenedTextStyle.fontFamily,
61
+ fontWeight: normalizeFontWeight(flattenedTextStyle.fontWeight),
62
+ fontStyle: flattenedTextStyle.fontStyle,
63
+ letterSpacing: flattenedTextStyle.letterSpacing
64
+ } : undefined;
65
+ const resolvedAlignment = multilineTextAlignment ?? resolveAlignment(flattenedTextStyle?.textAlign) ?? 'leading';
66
+ const configuration = {
26
67
  text,
27
- glass: typeof glass === 'string' ? glass : glass.effect ?? 'clear',
28
- interactive: typeof glass === 'object' && (glass.interactive ?? false),
29
- font: typeof font === 'string' ? {
30
- style: font
31
- } : font,
32
- fontWeight,
68
+ effect,
69
+ interactive,
33
70
  fontDesign,
34
- multilineTextAlignment
35
- });
71
+ ...(normalizedTextStyle ? {
72
+ textStyle: normalizedTextStyle
73
+ } : {}),
74
+ multilineTextAlignment: resolvedAlignment
75
+ };
36
76
  return /*#__PURE__*/_jsx(NativeLiquidGlassTextView, {
37
77
  ...viewProps,
38
78
  ref: ref,
@@ -40,23 +80,8 @@ export const LiquidGlassText = /*#__PURE__*/forwardRef(function LiquidGlassTextR
40
80
  accessibilityRole: accessibilityRole,
41
81
  accessibilityLabel: accessibilityLabel ?? text,
42
82
  configuration: configuration,
43
- tintColor: typeof glass === 'object' ? glass.tint : undefined,
44
- style: [{
45
- width: measurement.width,
46
- height: measurement.height
47
- }, style],
48
- onContentSizeChange: ({
49
- nativeEvent
50
- }) => {
51
- // Ignore measurements queued before a newer text/font update.
52
- if (nativeEvent.configuration !== configuration) {
53
- return;
54
- }
55
- setMeasurement(previous => previous.width === nativeEvent.width && previous.height === nativeEvent.height ? previous : {
56
- width: nativeEvent.width,
57
- height: nativeEvent.height
58
- });
59
- }
83
+ tintColor: tint ?? flattenedTextStyle?.color,
84
+ style: style
60
85
  });
61
86
  });
62
87
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["forwardRef","useState","assertComponentEnabled","NativeLiquidGlassTextView","jsx","_jsx","LiquidGlassText","LiquidGlassTextRoot","text","glass","font","fontWeight","fontDesign","multilineTextAlignment","style","accessibilityLabel","accessible","accessibilityRole","viewProps","ref","measurement","setMeasurement","width","height","configuration","JSON","stringify","effect","interactive","tintColor","tint","undefined","onContentSizeChange","nativeEvent","previous"],"sourceRoot":"../../../src","sources":["LiquidGlassText/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,QAAQ,QAA2B,OAAO;AAG/D,SAASC,sBAAsB,QAAQ,mBAAU;AAEjD,OAAOC,yBAAyB,MAAM,kCAAkC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzE,OAAO,MAAMC,eAAe,gBAAGN,UAAU,CAGvC,SAASO,mBAAmBA,CAC5B;EACEC,IAAI;EACJC,KAAK,GAAG,OAAO;EACfC,IAAI,GAAG,MAAM;EACbC,UAAU;EACVC,UAAU;EACVC,sBAAsB,GAAG,SAAS;EAClCC,KAAK;EACLC,kBAAkB;EAClBC,UAAU,GAAG,IAAI;EACjBC,iBAAiB,GAAG,MAAM;EAC1B,GAAGC;AACL,CAAC,EACDC,GAAG,EACH;EACAjB,sBAAsB,CAAC,iBAAiB,CAAC;EAEzC,MAAM,CAACkB,WAAW,EAAEC,cAAc,CAAC,GAAGpB,QAAQ,CAAC;IAC7CqB,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACV,CAAC,CAAC;EACF,MAAMC,aAAa,GAAGC,IAAI,CAACC,SAAS,CAAC;IACnClB,IAAI;IACJC,KAAK,EAAE,OAAOA,KAAK,KAAK,QAAQ,GAAGA,KAAK,GAAIA,KAAK,CAACkB,MAAM,IAAI,OAAQ;IACpEC,WAAW,EAAE,OAAOnB,KAAK,KAAK,QAAQ,KAAKA,KAAK,CAACmB,WAAW,IAAI,KAAK,CAAC;IACtElB,IAAI,EAAE,OAAOA,IAAI,KAAK,QAAQ,GAAG;MAAEI,KAAK,EAAEJ;IAAK,CAAC,GAAGA,IAAI;IACvDC,UAAU;IACVC,UAAU;IACVC;EACF,CAAC,CAAC;EAEF,oBACER,IAAA,CAACF,yBAAyB;IAAA,GACpBe,SAAS;IACbC,GAAG,EAAEA,GAAI;IACTH,UAAU,EAAEA,UAAW;IACvBC,iBAAiB,EAAEA,iBAAkB;IACrCF,kBAAkB,EAAEA,kBAAkB,IAAIP,IAAK;IAC/CgB,aAAa,EAAEA,aAAc;IAC7BK,SAAS,EAAE,OAAOpB,KAAK,KAAK,QAAQ,GAAGA,KAAK,CAACqB,IAAI,GAAGC,SAAU;IAC9DjB,KAAK,EAAE,CAAC;MAAEQ,KAAK,EAAEF,WAAW,CAACE,KAAK;MAAEC,MAAM,EAAEH,WAAW,CAACG;IAAO,CAAC,EAAET,KAAK,CAAE;IACzEkB,mBAAmB,EAAEA,CAAC;MAAEC;IAAY,CAAC,KAAK;MACxC;MACA,IAAIA,WAAW,CAACT,aAAa,KAAKA,aAAa,EAAE;QAC/C;MACF;MACAH,cAAc,CAAEa,QAAQ,IACtBA,QAAQ,CAACZ,KAAK,KAAKW,WAAW,CAACX,KAAK,IACpCY,QAAQ,CAACX,MAAM,KAAKU,WAAW,CAACV,MAAM,GAClCW,QAAQ,GACR;QACEZ,KAAK,EAAEW,WAAW,CAACX,KAAK;QACxBC,MAAM,EAAEU,WAAW,CAACV;MACtB,CACN,CAAC;IACH;EAAE,CACH,CAAC;AAEN,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["forwardRef","StyleSheet","assertComponentEnabled","NativeLiquidGlassTextView","jsx","_jsx","normalizeFontWeight","fontWeight","undefined","value","String","aliases","resolveAlignment","textAlign","LiquidGlassText","LiquidGlassTextRoot","text","effect","tint","interactive","fontDesign","textStyle","multilineTextAlignment","style","accessibilityLabel","accessible","accessibilityRole","viewProps","ref","flattenedTextStyle","flatten","normalizedTextStyle","fontSize","fontFamily","fontStyle","letterSpacing","resolvedAlignment","configuration","tintColor","color"],"sourceRoot":"../../../src","sources":["LiquidGlassText/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAA2B,OAAO;AACrD,SAASC,UAAU,QAAmC,cAAc;AAEpE,SAASC,sBAAsB,QAAQ,mBAAU;AAEjD,OAAOC,yBAAyB,MAAM,kCAAkC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzE,SAASC,mBAAmBA,CAC1BC,UAAmC,EACf;EACpB,IAAIA,UAAU,IAAI,IAAI,EAAE;IACtB,OAAOC,SAAS;EAClB;EAEA,MAAMC,KAAK,GAAGC,MAAM,CAACH,UAAU,CAAC;EAChC,MAAMI,OAAyC,GAAG;IAChD,QAAQ,EAAE,SAAS;IACnB,YAAY,EAAE,YAAY;IAC1B,WAAW,EAAE,SAAS;IACtB,eAAe,EAAE,MAAM;IACvB,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,OAAO;IACd,KAAK,EAAE;EACT,CAAC;EACD,OAAOA,OAAO,CAACF,KAAK,CAAC,IAAIA,KAAK;AAChC;AAEA,SAASG,gBAAgBA,CACvBC,SAAiC,EACc;EAC/C,QAAQA,SAAS;IACf,KAAK,QAAQ;MACX,OAAO,QAAQ;IACjB,KAAK,OAAO;MACV,OAAO,UAAU;IACnB,KAAK,MAAM;MACT,OAAO,SAAS;IAClB;MACE,OAAOL,SAAS;EACpB;AACF;AAEA,OAAO,MAAMM,eAAe,gBAAGd,UAAU,CAGvC,SAASe,mBAAmBA,CAC5B;EACEC,IAAI;EACJC,MAAM,GAAG,OAAO;EAChBC,IAAI;EACJC,WAAW,GAAG,K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egenNativeComponent, type ViewProps } from 'react-native';
1
+ import {
2
+ codegenNativeComponent,
3
+ type CodegenTypes,
4
+ type ViewProps,
5
+ } from 'react-native';
2
6
  import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
3
7
 
4
8
  export interface NativeMenuProps extends ViewProps {
5
- menuConfig: string;
9
+ menuConfig: CodegenTypes.UnsafeMixed;
6
10
  title?: string;
7
11
  disabled?: boolean;
8
12
  hasPrimaryAction?: boolean;
@@ -9,9 +9,9 @@ export function serializeMenuOptions(options) {
9
9
  const items = serializeOptions(options, callbacks, new Set(), 'root');
10
10
  return {
11
11
  callbacks,
12
- config: JSON.stringify({
12
+ config: {
13
13
  items
14
- })
14
+ }
15
15
  };
16
16
  }
17
17
  function serializeOptions(options, callbacks, usedIds, path) {
@@ -1 +1 @@
1
- {"version":3,"names":["processColor","serializeColor","color","undefined","serializeMenuOptions","options","callbacks","Map","items","serializeOptions","Set","config","JSON","stringify","usedIds","path","map","option","index","optionPath","type","title","subtitle","systemImage","icon","iconColor","titleColor","destructive","disabled","hidden","displayInline","children","id","has","Error","add","onSelect","set","state","keepOpen"],"sourceRoot":"../../../src","sources":["Menu/options.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAyB,cAAc;AAuD5D,SAASC,cAAcA,CAACC,KAA6B,EAAmB;EACtE,OAAOA,KAAK,KAAKC,SAAS,GAAGA,SAAS,GAAGH,YAAY,CAACE,KAAK,CAAC;AAC9D;AAEA,OAAO,SAASE,oBAAoBA,CAClCC,OAA8B,EACP;EACvB,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAqB,CAAC;EAC/C,MAAMC,KAAK,GAAGC,gBAAgB,CAACJ,OAAO,EAAEC,SAAS,EAAE,IAAII,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC;EAErE,OAAO;IACLJ,SAAS;IACTK,MAAM,EAAEC,IAAI,CAACC,SAAS,CAAC;MAAEL;IAAM,CAAC;EAClC,CAAC;AACH;AAEA,SAASC,gBAAg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C;IACH;IAEA,MAAMa,EAAE,GAAGf,MAAM,CAACe,EAAE,IAAI,QAAQb,UAAU,EAAE;IAC5C,IAAIL,OAAO,CAACmB,GAAG,CAACD,EAAE,CAAC,EAAE;MACnB,MAAM,IAAIE,KAAK,CAAC,mBAAmBF,EAAE,iCAAiC,CAAC;IACzE;IACAlB,OAAO,CAACqB,GAAG,CAACH,EAAE,CAAC;IAEf,IAAIf,MAAM,CAACmB,QAAQ,EAAE;MACnB9B,SAAS,CAAC+B,GAAG,CAACL,EAAE,EAAEf,MAAM,CAACmB,QAAQ,CAAC;IACpC;IAEA,OAAO;MACLhB,IAAI,EAAE,QAAQ;MACdY,EAAE;MACFX,KAAK,EAAEJ,MAAM,CAACI,KAAK;MACnBC,QAAQ,EAAEL,MAAM,CAACK,QAAQ;MACzBC,WAAW,EAAEN,MAAM,CAACM,WAAW;MAC/BC,IAAI,EAAEP,MAAM,CAACO,IAAI;MACjBC,SAAS,EAAExB,cAAc,CAACgB,MAAM,CAACQ,SAAS,CAAC;MAC3CC,UAAU,EAAEzB,cAAc,CAACgB,MAAM,CAACS,UAAU,CAAC;MAC7CY,KAAK,EAAErB,MAAM,CAACqB,KAAK,IAAI,KAAK;MAC5BX,WAAW,EAAEV,MAAM,CAACU,WAAW,IAAI,KAAK;MACxCC,QAAQ,EAAEX,MAAM,CAACW,QAAQ,IAAI,KAAK;MAClCC,MAAM,EAAEZ,MAAM,CAACY,MAAM,IAAI,KAAK;MAC9BU,QAAQ,EAAEtB,MAAM,CAACsB,QAAQ,IAAI;IAC/B,CAAC;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["processColor","serializeColor","color","undefined","serializeMenuOptions","options","callbacks","Map","items","serializeOptions","Set","config","usedIds","path","map","option","index","optionPath","type","title","subtitle","systemImage","icon","iconColor","titleColor","destructive","disabled","hidden","displayInline","children","id","has","Error","add","onSelect","set","state","keepOpen"],"sourceRoot":"../../../src","sources":["Menu/options.ts"],"mappings":";;AAA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AAI,KAAK;MACxCC,QAAQ,EAAEX,MAAM,CAACW,QAAQ,IAAI,KAAK;MAClCC,MAAM,EAAEZ,MAAM,CAACY,MAAM,IAAI,KAAK;MAC9BU,QAAQ,EAAEtB,MAAM,CAACsB,QAAQ,IAAI;IAC/B,CAAC;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -1,13 +1,7 @@
1
- import { type ColorValue, type ViewProps } from 'react-native';
2
- import type { DirectEventHandler, Double } from 'react-native/Libraries/Types/CodegenTypes';
1
+ import { type CodegenTypes, type ColorValue, type ViewProps } from 'react-native';
3
2
  export interface NativeLiquidGlassTextProps extends ViewProps {
4
- configuration: string;
3
+ configuration: CodegenTypes.UnsafeMixed;
5
4
  tintColor?: ColorValue;
6
- onContentSizeChange?: DirectEventHandler<Readonly<{
7
- width: Double;
8
- height: Double;
9
- configuration: string;
10
- }>>;
11
5
  }
12
6
  declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeLiquidGlassTextProps>;
13
7
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"LiquidGlassTextNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/LiquidGlassText/LiquidGlassTextNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,kBAAkB,EAClB,MAAM,EACP,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,0BAA2B,SAAQ,SAAS;IAC3D,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,mBAAmB,CAAC,EAAE,kBAAkB,CACtC,QAAQ,CAAC;QACP,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC,CACH,CAAC;CACH;;AAED,wBAGE"}
1
+ {"version":3,"file":"LiquidGlassTextNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/LiquidGlassText/LiquidGlassTextNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,0BAA2B,SAAQ,SAAS;IAC3D,aAAa,EAAE,YAAY,CAAC,WAAW,CAAC;IACxC,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB;;AAED,wBAGE"}
@@ -1,4 +1,4 @@
1
1
  import type { LiquidGlassTextProps } from './types.js';
2
2
  export declare const LiquidGlassText: import("react").ForwardRefExoticComponent<LiquidGlassTextProps & import("react").RefAttributes<import("react-native/types_generated/src/private/webapis/dom/nodes/ReactNativeElement").default>>;
3
- export type { LiquidGlassTextFont, LiquidGlassTextFontDesign, LiquidGlassTextFontStyle, LiquidGlassTextFontWeight, LiquidGlassTextGlass, LiquidGlassTextProps, } from './types.js';
3
+ export type { LiquidGlassTextFontDesign, LiquidGlassTextEffect, LiquidGlassTextProps, LiquidGlassTextStyle, } from './types.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/LiquidGlassText/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAS,CAAC;AAGpD,eAAO,MAAM,eAAe,kMA8D1B,CAAC;AAEH,YAAY,EACV,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,YAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/LiquidGlassText/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAS,CAAC;AA4CpD,eAAO,MAAM,eAAe,kMAyD1B,CAAC;AAEH,YAAY,EACV,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,YAAS,CAAC"}
@@ -1,30 +1,21 @@
1
- import type { ColorValue, ViewProps } from 'react-native';
1
+ import type { ColorValue, StyleProp, TextStyle, ViewProps } from 'react-native';
2
2
  export type LiquidGlassTextFontDesign = 'default' | 'serif' | 'monospaced' | 'rounded';
3
- export type LiquidGlassTextFontWeight = 'ultraLight' | 'thin' | 'light' | 'regular' | 'medium' | 'semibold' | 'bold' | 'heavy' | 'black';
4
- export type LiquidGlassTextFontStyle = 'largeTitle' | 'title' | 'title2' | 'title3' | 'headline' | 'subheadline' | 'body' | 'callout' | 'footnote' | 'caption' | 'caption2';
5
- export type LiquidGlassTextFont = LiquidGlassTextFontStyle | Readonly<{
6
- size: number;
7
- weight?: LiquidGlassTextFontWeight;
8
- design?: LiquidGlassTextFontDesign;
9
- /** PostScript name of a font installed in the containing app. */
10
- family?: string;
11
- }>;
12
- export type LiquidGlassTextGlass = 'clear' | 'regular' | 'identity' | Readonly<{
13
- effect?: 'clear' | 'regular' | 'identity';
14
- tint?: ColorValue;
15
- interactive?: boolean;
16
- }>;
3
+ export type LiquidGlassTextEffect = 'clear' | 'regular' | 'identity';
4
+ /** React Native text styles supported by the native glass renderer. */
5
+ export type LiquidGlassTextStyle = Readonly<Pick<TextStyle, 'color' | 'fontFamily' | 'fontSize' | 'fontStyle' | 'fontWeight' | 'letterSpacing' | 'textAlign'>>;
17
6
  export interface LiquidGlassTextProps extends Omit<ViewProps, 'children'> {
18
7
  /** Text to display. Pass translated strings from JavaScript if needed. */
19
8
  text: string;
20
- /** Defaults to clear. Native glass requires iOS 26+. */
21
- glass?: LiquidGlassTextGlass;
22
- /** SwiftUI text style or an explicit system/custom font. Defaults to body. */
23
- font?: LiquidGlassTextFont;
24
- /** Overrides the weight specified in font. */
25
- fontWeight?: LiquidGlassTextFontWeight;
26
- /** Overrides the design specified in font. */
9
+ /** Glass effect. Defaults to clear. Native glass requires iOS 26+. */
10
+ effect?: LiquidGlassTextEffect;
11
+ /** Glass tint and fallback text color. */
12
+ tint?: ColorValue;
13
+ /** Whether the glass responds to pointer and touch interaction. */
14
+ interactive?: boolean;
15
+ /** Overrides the system font design. */
27
16
  fontDesign?: LiquidGlassTextFontDesign;
17
+ /** Familiar React Native text styles. Explicit alignment takes precedence. */
18
+ textStyle?: StyleProp<LiquidGlassTextStyle>;
28
19
  /** Aligns explicit newline-separated lines. Defaults to leading. */
29
20
  multilineTextAlignment?: 'leading' | 'center' | 'trailing';
30
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/LiquidGlassText/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,MAAM,yBAAyB,GACnC,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,SAAS,CAAC;AAEjD,MAAM,MAAM,yBAAyB,GACjC,YAAY,GACZ,MAAM,GACN,OAAO,GACP,SAAS,GACT,QAAQ,GACR,UAAU,GACV,MAAM,GACN,OAAO,GACP,OAAO,CAAC;AAEZ,MAAM,MAAM,wBAAwB,GAChC,YAAY,GACZ,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,aAAa,GACb,MAAM,GACN,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,CAAC;AAEf,MAAM,MAAM,mBAAmB,GAC3B,wBAAwB,GACxB,QAAQ,CAAC;IACP,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAEP,MAAM,MAAM,oBAAoB,GAC5B,OAAO,GACP,SAAS,GACT,UAAU,GACV,QAAQ,CAAC;IACP,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,UAAU,C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B,mEAAmE;IACnE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wCAAwC;IACxC,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC,8EAA8E;IAC9E,SAAS,CAAC,EAAE,SAAS,CAAC,oBAAoB,CAAC,CAAC;IAC5C,oEAAoE;IACpE,sBAAsB,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;CAC5D"}
@@ -1,7 +1,7 @@
1
- import { type ViewProps } from 'react-native';
1
+ import { type CodegenTypes, type ViewProps } from 'react-native';
2
2
  import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
3
3
  export interface NativeMenuProps extends ViewProps {
4
- menuConfig: string;
4
+ menuConfig: CodegenTypes.UnsafeMixed;
5
5
  title?: string;
6
6
  disabled?: boolean;
7
7
  hasPrimaryAction?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"MenuNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/Menu/MenuNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAEpF,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IAC3D,eAAe,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;CAC5C;;AAED,wBAEG"}
1
+ {"version":3,"file":"MenuNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/Menu/MenuNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAEpF,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,UAAU,EAAE,YAAY,CAAC,WAAW,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IAC3D,eAAe,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;CAC5C;;AAED,wBAEG"}
@@ -1,7 +1,47 @@
1
+ import { processColor } from 'react-native';
1
2
  import type { MenuOption } from './types.js';
3
+ type NativeMenuColor = ReturnType<typeof processColor>;
4
+ interface NativeMenuLabel {
5
+ title: string;
6
+ subtitle?: string;
7
+ systemImage?: string;
8
+ icon?: string;
9
+ iconColor?: NativeMenuColor;
10
+ titleColor?: NativeMenuColor;
11
+ }
12
+ interface NativeMenuAction extends NativeMenuLabel {
13
+ type: 'action';
14
+ id: string;
15
+ state: 'off' | 'on' | 'mixed';
16
+ destructive: boolean;
17
+ disabled: boolean;
18
+ hidden: boolean;
19
+ keepOpen: boolean;
20
+ }
21
+ interface NativeMenuSubmenu extends NativeMenuLabel {
22
+ type: 'submenu';
23
+ destructive: boolean;
24
+ disabled: boolean;
25
+ hidden: boolean;
26
+ displayInline: boolean;
27
+ children: NativeMenuElement[];
28
+ }
29
+ interface NativeMenuSection {
30
+ type: 'section';
31
+ title?: string;
32
+ children: NativeMenuElement[];
33
+ }
34
+ interface NativeMenuSeparator {
35
+ type: 'separator';
36
+ }
37
+ type NativeMenuElement = NativeMenuAction | NativeMenuSubmenu | NativeMenuSection | NativeMenuSeparator;
38
+ interface NativeMenuConfiguration {
39
+ items: NativeMenuElement[];
40
+ }
2
41
  export interface SerializedMenuOptions {
3
- config: string;
42
+ config: NativeMenuConfiguration;
4
43
  callbacks: Map<string, () => void>;
5
44
  }
6
45
  export declare function serializeMenuOptions(options: readonly MenuOption[]): SerializedMenuOptions;
46
+ export {};
7
47
  //# sourceMappingURL=options.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../src/Menu/options.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAS,CAAC;AAgD1C,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC;CACpC;AAMD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,SAAS,UAAU,EAAE,GAC7B,qBAAqB,CAQvB"}
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../src/Menu/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAS,CAAC;AAE1C,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAEvD,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED,UAAU,gBAAiB,SAAQ,eAAe;IAChD,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,GAAG,IAAI,GAAG,OAAO,CAAC;IAC9B,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,iBAAkB,SAAQ,eAAe;IACjD,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,UAAU,iBAAiB;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,UAAU,mBAAmB;IAC3B,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,KAAK,iBAAiB,GAClB,gBAAgB,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,CAAC;AAExB,UAAU,uBAAuB;IAC/B,KAAK,EAAE,iBAAiB,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,uBAAuB,CAAC;IAChC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC;CACpC;AAMD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,SAAS,UAAU,EAAE,GAC7B,qBAAqB,CAQvB"}
@@ -5,5 +5,5 @@ export type { PopoverArrowEdge, PopoverAttachmentAnchor, PopoverCloseProps, Popo
5
5
  export { getNativeTinyui, assertComponentEnabled } from './utils/index.js';
6
6
  export type { TinyuiComponent } from './utils/index.js';
7
7
  export { LiquidGlassText } from './LiquidGlassText/index.js';
8
- export type { LiquidGlassTextFont, LiquidGlassTextFontDesign, LiquidGlassTextFontStyle, LiquidGlassTextFontWeight, LiquidGlassTextGlass, LiquidGlassTextProps, } from './LiquidGlassText/index.js';
8
+ export type { LiquidGlassTextFontDesign, LiquidGlassTextEffect, LiquidGlassTextProps, LiquidGlassTextStyle, } from './LiquidGlassText/index.js';
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAQ,CAAC;AAC9B,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,iBAAQ,CAAC;AAEhB,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAW,CAAC;AAClD,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,wBAAwB,EACxB,YAAY,GACb,MAAM,oBAAW,CAAC;AAEnB,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,kBAAS,CAAC;AAClE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAS,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,4BAAmB,CAAC;AACpD,YAAY,EACV,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,4BAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAQ,CAAC;AAC9B,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,iBAAQ,CAAC;AAEhB,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAW,CAAC;AAClD,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,wBAAwB,EACxB,YAAY,GACb,MAAM,oBAAW,CAAC;AAEnB,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,kBAAS,CAAC;AAClE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAS,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,4BAAmB,CAAC;AACpD,YAAY,EACV,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,4BAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tinyui",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Dependency-free native iOS Menu, Popover and LiquidGlassText components for React Native",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",