@ecohouse/ui 0.1.54 → 0.1.56

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/dist/index.cjs CHANGED
@@ -28541,9 +28541,10 @@ var colors = {
28541
28541
  whiteAlpha40: "#FFFFFF66",
28542
28542
  whiteAlpha20: "#FFFFFF33",
28543
28543
  whiteAlpha1: "#FFFFFF03",
28544
+ whiteAlpha5: "#FFFFFF0D",
28544
28545
  whiteAlpha6: "#FFFFFF0F",
28546
+ whiteAlpha7: "#FFFFFF12",
28545
28547
  whiteAlpha10: "#FFFFFF1A",
28546
- whiteAlpha5: "#FFFFFF0D",
28547
28548
  dark: "#090909",
28548
28549
  red: "#A63E3E",
28549
28550
  lightGrey: "#B7B7B7",
@@ -31301,10 +31302,19 @@ function BrandLogo({
31301
31302
  );
31302
31303
  }
31303
31304
  var IMAGE_SIZE = 48;
31305
+ var CONTAINER_HEIGHT = 56;
31304
31306
  var CONTAINER_RADIUS = 71;
31305
31307
  var CHEVRON_SIZE = 20;
31306
31308
  var FALLBACK_ICON_SIZE = 20;
31307
31309
  var MENU_RADIUS = 16;
31310
+ var triggerWebBlurStyle = reactNative.Platform.OS === "web" ? {
31311
+ backdropFilter: "blur(40px)",
31312
+ WebkitBackdropFilter: "blur(40px)"
31313
+ } : {};
31314
+ var menuWebBlurStyle = reactNative.Platform.OS === "web" ? {
31315
+ backdropFilter: "blur(40px)",
31316
+ WebkitBackdropFilter: "blur(40px)"
31317
+ } : {};
31308
31318
  var Avatar = react.forwardRef(function Avatar2({
31309
31319
  name,
31310
31320
  email,
@@ -31312,6 +31322,7 @@ var Avatar = react.forwardRef(function Avatar2({
31312
31322
  onPress,
31313
31323
  disabled = false,
31314
31324
  showChevron = true,
31325
+ variant = "light",
31315
31326
  menuItems,
31316
31327
  open: openProp,
31317
31328
  defaultOpen = false,
@@ -31333,6 +31344,7 @@ var Avatar = react.forwardRef(function Avatar2({
31333
31344
  const isOpenControlled = typeof openProp === "boolean";
31334
31345
  const [uncontrolledOpen, setUncontrolledOpen] = react.useState(defaultOpen);
31335
31346
  const isOpen = hasMenu && (isOpenControlled ? openProp : uncontrolledOpen);
31347
+ const isLightVariant = variant === "light";
31336
31348
  useApplyWebClassName(containerRef, className);
31337
31349
  const setOpen = react.useCallback(
31338
31350
  (next) => {
@@ -31402,7 +31414,13 @@ var Avatar = react.forwardRef(function Avatar2({
31402
31414
  accessibilityRole: isInteractive ? "button" : void 0,
31403
31415
  accessibilityLabel: resolvedAccessibilityLabel,
31404
31416
  accessibilityState: isInteractive ? { disabled, expanded: hasMenu ? isOpen : void 0 } : void 0,
31405
- style: [styles6.root, disabled && styles6.disabled, style],
31417
+ style: [
31418
+ styles6.root,
31419
+ isLightVariant ? styles6.rootLight : styles6.rootDark,
31420
+ isLightVariant && triggerWebBlurStyle,
31421
+ disabled && styles6.disabled,
31422
+ style
31423
+ ],
31406
31424
  children: [
31407
31425
  /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles6.imageWrap, children: hasImage ? /* @__PURE__ */ jsxRuntime.jsx(
31408
31426
  reactNative.Image,
@@ -31411,30 +31429,71 @@ var Avatar = react.forwardRef(function Avatar2({
31411
31429
  style: styles6.image,
31412
31430
  onError: () => setImageFailed(true)
31413
31431
  }
31414
- ) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles6.imageFallback, children: /* @__PURE__ */ jsxRuntime.jsx(UserIcon, { size: FALLBACK_ICON_SIZE, color: colors.primary }) }) }),
31432
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
31433
+ reactNative.View,
31434
+ {
31435
+ style: [
31436
+ styles6.imageFallback,
31437
+ isLightVariant ? styles6.imageFallbackLight : styles6.imageFallbackDark
31438
+ ],
31439
+ children: /* @__PURE__ */ jsxRuntime.jsx(
31440
+ UserIcon,
31441
+ {
31442
+ size: FALLBACK_ICON_SIZE,
31443
+ color: isLightVariant ? colors.white : colors.primary
31444
+ }
31445
+ )
31446
+ }
31447
+ ) }),
31415
31448
  /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles6.textColumn, children: [
31416
31449
  /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles6.name, numberOfLines: 1, children: name }),
31417
- email ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles6.email, numberOfLines: 1, children: email }) : null
31450
+ email ? /* @__PURE__ */ jsxRuntime.jsx(
31451
+ reactNative.Text,
31452
+ {
31453
+ style: [styles6.email, isLightVariant ? styles6.emailLight : styles6.emailDark],
31454
+ numberOfLines: 1,
31455
+ children: email
31456
+ }
31457
+ ) : null
31418
31458
  ] }),
31419
- showChevron ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles6.chevronSlot, isOpen && styles6.chevronOpen], children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDownIcon, { size: CHEVRON_SIZE, color: isOpen ? colors.primary : colors.grey100 }) }) : null
31459
+ showChevron ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles6.chevronSlot, isOpen && styles6.chevronOpen], children: /* @__PURE__ */ jsxRuntime.jsx(
31460
+ ChevronDownIcon,
31461
+ {
31462
+ size: CHEVRON_SIZE,
31463
+ color: isLightVariant ? colors.white : isOpen ? colors.primary : colors.grey100
31464
+ }
31465
+ ) }) : null
31420
31466
  ]
31421
31467
  }
31422
31468
  ),
31423
- hasMenu && isOpen ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles6.menu, menuWidth != null && { right: void 0, width: menuWidth }], children: resolvedMenuItems.map((item) => {
31424
- const itemKey = item.key ?? item.label;
31425
- return /* @__PURE__ */ jsxRuntime.jsx(
31426
- MenuItem,
31427
- {
31428
- icon: item.icon,
31429
- label: item.label,
31430
- disabled: item.disabled,
31431
- backgroundColor: item.backgroundColor,
31432
- hoverColor: item.hoverColor,
31433
- onPress: () => handleItemPress(item)
31434
- },
31435
- itemKey
31436
- );
31437
- }) }) : null
31469
+ hasMenu && isOpen ? /* @__PURE__ */ jsxRuntime.jsx(
31470
+ reactNative.View,
31471
+ {
31472
+ style: [
31473
+ styles6.menu,
31474
+ isLightVariant ? styles6.menuLight : styles6.menuDark,
31475
+ isLightVariant && menuWebBlurStyle,
31476
+ menuWidth != null && { right: void 0, width: menuWidth }
31477
+ ],
31478
+ children: resolvedMenuItems.map((item) => {
31479
+ const itemKey = item.key ?? item.label;
31480
+ return /* @__PURE__ */ jsxRuntime.jsx(
31481
+ MenuItem,
31482
+ {
31483
+ icon: item.icon,
31484
+ label: item.label,
31485
+ disabled: item.disabled,
31486
+ backgroundColor: item.backgroundColor,
31487
+ hoverColor: item.hoverColor ?? (isLightVariant ? colors.whiteAlpha7 : void 0),
31488
+ labelStyle: item.labelStyle,
31489
+ onPress: () => handleItemPress(item),
31490
+ style: isLightVariant ? item.backgroundColor ? styles6.emphasizedMenuItem : styles6.menuItem : void 0
31491
+ },
31492
+ itemKey
31493
+ );
31494
+ })
31495
+ }
31496
+ ) : null
31438
31497
  ] });
31439
31498
  });
31440
31499
  var styles6 = reactNative.StyleSheet.create({
@@ -31446,6 +31505,7 @@ var styles6 = reactNative.StyleSheet.create({
31446
31505
  zIndex: 20
31447
31506
  },
31448
31507
  root: {
31508
+ height: CONTAINER_HEIGHT,
31449
31509
  flexDirection: "row",
31450
31510
  alignItems: "center",
31451
31511
  alignSelf: "flex-start",
@@ -31454,7 +31514,12 @@ var styles6 = reactNative.StyleSheet.create({
31454
31514
  paddingBottom: 4,
31455
31515
  paddingLeft: 4,
31456
31516
  paddingRight: 12,
31457
- borderRadius: CONTAINER_RADIUS,
31517
+ borderRadius: CONTAINER_RADIUS
31518
+ },
31519
+ rootLight: {
31520
+ backgroundColor: colors.whiteAlpha5
31521
+ },
31522
+ rootDark: {
31458
31523
  backgroundColor: colors.grey700
31459
31524
  },
31460
31525
  disabled: {
@@ -31475,7 +31540,15 @@ var styles6 = reactNative.StyleSheet.create({
31475
31540
  width: IMAGE_SIZE,
31476
31541
  height: IMAGE_SIZE,
31477
31542
  alignItems: "center",
31478
- justifyContent: "center",
31543
+ justifyContent: "center"
31544
+ },
31545
+ imageFallbackLight: {
31546
+ borderRadius: IMAGE_SIZE / 2,
31547
+ backgroundColor: "transparent",
31548
+ borderWidth: 1,
31549
+ borderColor: colors.whiteAlpha10
31550
+ },
31551
+ imageFallbackDark: {
31479
31552
  backgroundColor: colors.grey600
31480
31553
  },
31481
31554
  textColumn: {
@@ -31488,7 +31561,12 @@ var styles6 = reactNative.StyleSheet.create({
31488
31561
  color: colors.white
31489
31562
  },
31490
31563
  email: {
31491
- ...avatarTypography.email,
31564
+ ...avatarTypography.email
31565
+ },
31566
+ emailLight: {
31567
+ color: colors.whiteAlpha60
31568
+ },
31569
+ emailDark: {
31492
31570
  color: colors.grey0
31493
31571
  },
31494
31572
  chevronSlot: {
@@ -31510,7 +31588,15 @@ var styles6 = reactNative.StyleSheet.create({
31510
31588
  zIndex: 10,
31511
31589
  borderRadius: MENU_RADIUS,
31512
31590
  padding: 8,
31513
- gap: 8,
31591
+ gap: 8
31592
+ },
31593
+ menuLight: {
31594
+ borderWidth: 1,
31595
+ borderColor: colors.whiteAlpha10,
31596
+ backgroundColor: colors.whiteAlpha5,
31597
+ overflow: "hidden"
31598
+ },
31599
+ menuDark: {
31514
31600
  backgroundColor: colors.grey700,
31515
31601
  ...reactNative.Platform.select({
31516
31602
  web: {
@@ -31520,6 +31606,16 @@ var styles6 = reactNative.StyleSheet.create({
31520
31606
  elevation: 8
31521
31607
  }
31522
31608
  })
31609
+ },
31610
+ menuItem: {
31611
+ height: 32,
31612
+ minHeight: 32,
31613
+ paddingVertical: 6
31614
+ },
31615
+ emphasizedMenuItem: {
31616
+ height: 46,
31617
+ minHeight: 46,
31618
+ paddingVertical: 11
31523
31619
  }
31524
31620
  });
31525
31621
  var IMAGE_SIZE2 = 32;
@@ -33265,6 +33361,7 @@ var Sidebar = react.forwardRef(function Sidebar2({
33265
33361
  items,
33266
33362
  user,
33267
33363
  onLogOut,
33364
+ onLogoPress,
33268
33365
  logoAccessibilityLabel = "Cortel Booking",
33269
33366
  navigationAccessibilityLabel = "Account navigation",
33270
33367
  collapseAccessibilityLabel = "Collapse sidebar",
@@ -33341,7 +33438,24 @@ var Sidebar = react.forwardRef(function Sidebar2({
33341
33438
  ],
33342
33439
  accessibilityElementsHidden: collapsed,
33343
33440
  importantForAccessibility: collapsed ? "no-hide-descendants" : "auto",
33344
- children: /* @__PURE__ */ jsxRuntime.jsx(
33441
+ children: onLogoPress ? /* @__PURE__ */ jsxRuntime.jsx(
33442
+ reactNative.Pressable,
33443
+ {
33444
+ accessibilityRole: "link",
33445
+ accessibilityLabel: logoAccessibilityLabel,
33446
+ hitSlop: 8,
33447
+ onPress: onLogoPress,
33448
+ children: /* @__PURE__ */ jsxRuntime.jsx(
33449
+ BrandLogo,
33450
+ {
33451
+ accessibilityLabel: logoAccessibilityLabel,
33452
+ height: LOGO_HEIGHT,
33453
+ variant: "brand",
33454
+ width: LOGO_WIDTH
33455
+ }
33456
+ )
33457
+ }
33458
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
33345
33459
  BrandLogo,
33346
33460
  {
33347
33461
  accessibilityLabel: logoAccessibilityLabel,
@@ -33529,6 +33643,7 @@ var defaultLanguageOptions = [
33529
33643
  ];
33530
33644
  var CONTROL_WIDTH = 96;
33531
33645
  var CONTROL_HEIGHT = 35;
33646
+ var MENU_WIDTH = 90;
33532
33647
  var ICON_SIZE9 = 16;
33533
33648
  var ICON_BUTTON_SIZE2 = 32;
33534
33649
  var ICON_MENU_WIDTH = 67;
@@ -33536,6 +33651,10 @@ var ICON_MENU_HEIGHT = 129;
33536
33651
  var ICON_MENU_TOP = 39;
33537
33652
  var ITEM_HEIGHT = 35;
33538
33653
  var ACTIVE_ITEM_BACKGROUND = "#E38E5E12";
33654
+ var menuWebBlurStyle2 = reactNative.Platform.OS === "web" ? {
33655
+ backdropFilter: "blur(40px)",
33656
+ WebkitBackdropFilter: "blur(40px)"
33657
+ } : {};
33539
33658
  var LanguageSwitcher = react.forwardRef(
33540
33659
  function LanguageSwitcher2({
33541
33660
  options = defaultLanguageOptions,
@@ -33640,7 +33759,7 @@ var LanguageSwitcher = react.forwardRef(
33640
33759
  onHoverOut: () => setTriggerHovered(false),
33641
33760
  style: ({ pressed }) => [
33642
33761
  isIconVariant ? styles22.triggerIcon : styles22.trigger,
33643
- !isIconVariant && (triggerHovered || pressed || isOpen) && styles22.triggerActive
33762
+ !isIconVariant && (triggerHovered || pressed) && styles22.triggerActive
33644
33763
  ],
33645
33764
  children: [
33646
33765
  /* @__PURE__ */ jsxRuntime.jsx(GlobeIcon, { size: ICON_SIZE9, color: colors.white, strokeWidth: isIconVariant ? 1.5 : 2 }),
@@ -33654,7 +33773,11 @@ var LanguageSwitcher = react.forwardRef(
33654
33773
  isOpen && options.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
33655
33774
  reactNative.View,
33656
33775
  {
33657
- style: [styles22.menu, isIconVariant ? styles22.menuIcon : styles22.menuDefault],
33776
+ style: [
33777
+ styles22.menu,
33778
+ !isIconVariant && menuWebBlurStyle2,
33779
+ isIconVariant ? styles22.menuIcon : styles22.menuDefault
33780
+ ],
33658
33781
  accessibilityRole: "menu",
33659
33782
  children: options.map((option) => {
33660
33783
  const selected = option.value === selectedValue;
@@ -33669,15 +33792,15 @@ var LanguageSwitcher = react.forwardRef(
33669
33792
  onHoverOut: () => setHoveredValue(null),
33670
33793
  style: ({ pressed }) => [
33671
33794
  styles22.item,
33672
- isIconVariant ? styles22.itemIcon : null,
33795
+ isIconVariant ? styles22.itemIcon : styles22.itemDefault,
33673
33796
  selected ? isIconVariant ? styles22.itemSelectedIcon : styles22.itemSelected : (hoveredValue === option.value || pressed) && styles22.itemHovered
33674
33797
  ],
33675
- children: /* @__PURE__ */ jsxRuntime.jsx(
33798
+ children: ({ pressed }) => /* @__PURE__ */ jsxRuntime.jsx(
33676
33799
  reactNative.Text,
33677
33800
  {
33678
33801
  style: [
33679
33802
  styles22.itemLabel,
33680
- selected && (isIconVariant ? styles22.itemLabelSelectedIcon : styles22.itemLabelSelected)
33803
+ (selected || hoveredValue === option.value || pressed) && styles22.itemLabelActive
33681
33804
  ],
33682
33805
  children: option.label
33683
33806
  }
@@ -33762,10 +33885,14 @@ var styles22 = reactNative.StyleSheet.create({
33762
33885
  },
33763
33886
  menuDefault: {
33764
33887
  top: CONTROL_HEIGHT + 8,
33765
- left: 0,
33766
- width: CONTROL_WIDTH,
33767
- gap: 8,
33768
- backgroundColor: colors.whiteAlpha6
33888
+ left: (CONTROL_WIDTH - MENU_WIDTH) / 2,
33889
+ width: MENU_WIDTH,
33890
+ height: 129,
33891
+ gap: 4,
33892
+ backgroundColor: colors.whiteAlpha5,
33893
+ borderWidth: 1,
33894
+ borderColor: colors.whiteAlpha10,
33895
+ borderRadius: 16
33769
33896
  },
33770
33897
  menuIcon: {
33771
33898
  top: ICON_MENU_TOP,
@@ -33793,11 +33920,15 @@ var styles22 = reactNative.StyleSheet.create({
33793
33920
  width: 51,
33794
33921
  alignSelf: "stretch"
33795
33922
  },
33923
+ itemDefault: {
33924
+ width: 74,
33925
+ alignSelf: "center"
33926
+ },
33796
33927
  itemHovered: {
33797
- backgroundColor: colors.whiteAlpha6
33928
+ backgroundColor: colors.whiteAlpha7
33798
33929
  },
33799
33930
  itemSelected: {
33800
- backgroundColor: colors.whiteAlpha6
33931
+ backgroundColor: colors.whiteAlpha7
33801
33932
  },
33802
33933
  itemSelectedIcon: {
33803
33934
  backgroundColor: ACTIVE_ITEM_BACKGROUND
@@ -33805,13 +33936,10 @@ var styles22 = reactNative.StyleSheet.create({
33805
33936
  itemLabel: {
33806
33937
  ...languageSwitcherTypography,
33807
33938
  ...reactNative.Platform.select({ web: { fontFamily: `${fonts.sans}, sans-serif` } }),
33808
- color: colors.white
33809
- },
33810
- itemLabelSelected: {
33811
- color: colors.primary
33939
+ color: colors.whiteAlpha60
33812
33940
  },
33813
- itemLabelSelectedIcon: {
33814
- color: colors.primary
33941
+ itemLabelActive: {
33942
+ color: colors.white
33815
33943
  }
33816
33944
  });
33817
33945
  var ICON_SIZE10 = 25.63181;