database-devtools 0.1.4 → 0.1.5

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.
@@ -32,8 +32,12 @@ type DatabaseDevToolsProps = {
32
32
  onFloatingPositionChange?: (position: FloatingButtonPosition) => void;
33
33
  /** Optional style for the floating button database icon. */
34
34
  style?: StyleProp<TextStyle>;
35
+ /** Floating button background color. */
36
+ buttonColor?: string;
37
+ /** Database icon color. */
38
+ iconColor?: string;
35
39
  onConnectionStateChange?: (state: ConnectionState) => void;
36
40
  };
37
- declare function DatabaseDevTools({ database, type, adapter, serverUrl, enabled, position, draggable, snapToEdges, floatingPosition, onFloatingPositionChange, style, onConnectionStateChange, }: DatabaseDevToolsProps): react_jsx_runtime.JSX.Element | null;
41
+ declare function DatabaseDevTools({ database, type, adapter, serverUrl, enabled, position, draggable, snapToEdges, floatingPosition, onFloatingPositionChange, style, buttonColor, iconColor, onConnectionStateChange, }: DatabaseDevToolsProps): react_jsx_runtime.JSX.Element | null;
38
42
 
39
43
  export { DatabaseDevTools as D, type FloatingButtonPosition as F, type DatabaseDevToolsProps as a, type DatabaseDialect as b };
@@ -32,8 +32,12 @@ type DatabaseDevToolsProps = {
32
32
  onFloatingPositionChange?: (position: FloatingButtonPosition) => void;
33
33
  /** Optional style for the floating button database icon. */
34
34
  style?: StyleProp<TextStyle>;
35
+ /** Floating button background color. */
36
+ buttonColor?: string;
37
+ /** Database icon color. */
38
+ iconColor?: string;
35
39
  onConnectionStateChange?: (state: ConnectionState) => void;
36
40
  };
37
- declare function DatabaseDevTools({ database, type, adapter, serverUrl, enabled, position, draggable, snapToEdges, floatingPosition, onFloatingPositionChange, style, onConnectionStateChange, }: DatabaseDevToolsProps): react_jsx_runtime.JSX.Element | null;
41
+ declare function DatabaseDevTools({ database, type, adapter, serverUrl, enabled, position, draggable, snapToEdges, floatingPosition, onFloatingPositionChange, style, buttonColor, iconColor, onConnectionStateChange, }: DatabaseDevToolsProps): react_jsx_runtime.JSX.Element | null;
38
42
 
39
43
  export { DatabaseDevTools as D, type FloatingButtonPosition as F, type DatabaseDevToolsProps as a, type DatabaseDialect as b };
@@ -1344,9 +1344,12 @@ function isFloatingButtonTap(totalMovement) {
1344
1344
  }
1345
1345
  var DEFAULT_ICON_SIZE = 22;
1346
1346
  var DEFAULT_ICON_COLOR = "#f8fafc";
1347
+ var DEFAULT_BUTTON_COLOR = "#1e293b";
1347
1348
  function FloatingDevToolsButton({
1348
1349
  position = "bottom-right",
1349
1350
  iconStyle,
1351
+ buttonColor,
1352
+ iconColor,
1350
1353
  draggable = true,
1351
1354
  snapToEdges = true,
1352
1355
  floatingPosition,
@@ -1450,22 +1453,24 @@ function FloatingDevToolsButton({
1450
1453
  if (!renderedPosition) {
1451
1454
  return null;
1452
1455
  }
1456
+ const resolvedButtonColor = buttonColor ?? DEFAULT_BUTTON_COLOR;
1457
+ const resolvedIconColor = iconColor ?? StyleSheet.flatten(iconStyle)?.color ?? DEFAULT_ICON_COLOR;
1458
+ const buttonStyle = { backgroundColor: resolvedButtonColor };
1459
+ const statusDotStyle = {
1460
+ backgroundColor: getConnectionDotColor(connectionState),
1461
+ borderColor: resolvedButtonColor
1462
+ };
1453
1463
  const buttonContent = /* @__PURE__ */ jsxs(Fragment, { children: [
1454
1464
  /* @__PURE__ */ jsx(
1455
1465
  MaterialCommunityIcons,
1456
1466
  {
1457
- color: DEFAULT_ICON_COLOR,
1467
+ color: resolvedIconColor,
1458
1468
  name: "database",
1459
1469
  size: DEFAULT_ICON_SIZE,
1460
1470
  style: iconStyle
1461
1471
  }
1462
1472
  ),
1463
- /* @__PURE__ */ jsx(
1464
- View,
1465
- {
1466
- style: [styles4.statusDot, { backgroundColor: getConnectionDotColor(connectionState) }]
1467
- }
1468
- )
1473
+ /* @__PURE__ */ jsx(View, { style: [styles4.statusDot, statusDotStyle] })
1469
1474
  ] });
1470
1475
  if (!draggable) {
1471
1476
  const positionStyle = position === "bottom-left" ? styles4.bottomLeft : styles4.bottomRight;
@@ -1475,7 +1480,11 @@ function FloatingDevToolsButton({
1475
1480
  accessibilityLabel: "Open Database DevTools",
1476
1481
  accessibilityRole: "button",
1477
1482
  onPress: openLauncher,
1478
- style: ({ pressed }) => [styles4.button, pressed && styles4.buttonPressed],
1483
+ style: ({ pressed }) => [
1484
+ styles4.button,
1485
+ buttonStyle,
1486
+ pressed && styles4.buttonPressed
1487
+ ],
1479
1488
  children: buttonContent
1480
1489
  }
1481
1490
  ) });
@@ -1500,7 +1509,7 @@ function FloatingDevToolsButton({
1500
1509
  accessibilityHint: "Drag to move. Tap to open DevTools launcher.",
1501
1510
  accessibilityLabel: "Open Database DevTools",
1502
1511
  accessibilityRole: "button",
1503
- style: [styles4.button, dragPosition && styles4.buttonDragging],
1512
+ style: [styles4.button, buttonStyle, dragPosition && styles4.buttonDragging],
1504
1513
  children: buttonContent
1505
1514
  }
1506
1515
  )
@@ -1529,7 +1538,6 @@ var styles4 = StyleSheet.create({
1529
1538
  width: FLOATING_BUTTON_SIZE,
1530
1539
  height: FLOATING_BUTTON_SIZE,
1531
1540
  borderRadius: FLOATING_BUTTON_SIZE / 2,
1532
- backgroundColor: "#1e293b",
1533
1541
  alignItems: "center",
1534
1542
  justifyContent: "center",
1535
1543
  shadowColor: "#000",
@@ -1552,8 +1560,7 @@ var styles4 = StyleSheet.create({
1552
1560
  width: 10,
1553
1561
  height: 10,
1554
1562
  borderRadius: 5,
1555
- borderWidth: 2,
1556
- borderColor: "#1e293b"
1563
+ borderWidth: 2
1557
1564
  }
1558
1565
  });
1559
1566
  var explorerColors = {
@@ -2696,6 +2703,8 @@ function DatabaseDevTools({
2696
2703
  floatingPosition,
2697
2704
  onFloatingPositionChange,
2698
2705
  style,
2706
+ buttonColor,
2707
+ iconColor,
2699
2708
  onConnectionStateChange
2700
2709
  }) {
2701
2710
  if (!isDevToolsEnabled(enabled)) {
@@ -2713,8 +2722,10 @@ function DatabaseDevTools({
2713
2722
  /* @__PURE__ */ jsx(
2714
2723
  FloatingDevToolsButton,
2715
2724
  {
2725
+ buttonColor,
2716
2726
  draggable,
2717
2727
  floatingPosition,
2728
+ iconColor,
2718
2729
  iconStyle: style,
2719
2730
  onFloatingPositionChange,
2720
2731
  position,
@@ -2730,5 +2741,5 @@ function DatabaseDevTools({
2730
2741
  }
2731
2742
 
2732
2743
  export { DatabaseDevTools, createExpoSqliteInspector, handleBeginTransaction, handleCommitTransaction, handleExecuteWrite, handleRollbackTransaction, isEditableDatabaseAdapter, isWritableDatabaseAdapter };
2733
- //# sourceMappingURL=chunk-KIQ3TEVO.js.map
2734
- //# sourceMappingURL=chunk-KIQ3TEVO.js.map
2744
+ //# sourceMappingURL=chunk-SFLXGLHQ.js.map
2745
+ //# sourceMappingURL=chunk-SFLXGLHQ.js.map