foundry-component-library 0.2.26 → 0.2.28

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.
@@ -19,11 +19,6 @@
19
19
 
20
20
  .left {
21
21
  font-size: 0;
22
- margin-left: -65px;
23
-
24
- @media #{$QUERY-sm} {
25
- margin-left: -68px;
26
- }
27
22
 
28
23
  video {
29
24
  width: 250px;
@@ -34,17 +34,23 @@ const Dropdown = ({
34
34
  };
35
35
 
36
36
  if (!items) return;
37
- const currentDisplay = displayLabels?.[selected.tag] ?? selected.tag;
37
+ let currentDisplay = heading;
38
+
39
+ if (displayLabels && selected.category === heading.toLowerCase()) {
40
+ currentDisplay = displayLabels[selected.tag];
41
+ } else if (selected.category === heading.toLowerCase()) {
42
+ currentDisplay = selected.tag;
43
+ }
44
+
45
+ console.log("pp", displayLabels);
38
46
 
39
47
  return (
40
48
  <div
41
49
  className={`${styles.dropdown} ${isOpen ? styles.active : ""}`}
42
- ref={ref}
43
- >
50
+ ref={ref}>
44
51
  <button
45
52
  onClick={toggleOpen}
46
- className={`${styles.dropdownHeading} ${isOpen ? styles.active : ""}`}
47
- >
53
+ className={`${styles.dropdownHeading} ${isOpen ? styles.active : ""}`}>
48
54
  <span>{currentDisplay}</span>
49
55
  <CaretDown />
50
56
  </button>
@@ -56,25 +62,23 @@ const Dropdown = ({
56
62
  animate={{ opacity: 1, y: 0 }}
57
63
  exit={{ opacity: 0, y: -5 }}
58
64
  transition={{ duration: 0.2 }}
59
- className={styles.dropdownInner}
60
- >
61
- {items.map((option) => (
62
- <motion.li
63
- key={option}
64
- onClick={() => {
65
- setSelected({
66
- category: heading.toLocaleLowerCase(),
67
- tag: option,
68
- });
69
- setIsOpen(false);
70
- }}
71
- className={`${styles.option} ${
72
- selected.tag === option ? styles.active : ""
73
- }`}
74
- >
65
+ className={styles.dropdownInner}>
66
+ {items.map((option) => (
67
+ <motion.li
68
+ key={option}
69
+ onClick={() => {
70
+ setSelected({
71
+ category: heading.toLocaleLowerCase(),
72
+ tag: option,
73
+ });
74
+ setIsOpen(false);
75
+ }}
76
+ className={`${styles.option} ${
77
+ selected.tag === option ? styles.active : ""
78
+ }`}>
75
79
  {displayLabels?.[option] ?? option}
76
- </motion.li>
77
- ))}
80
+ </motion.li>
81
+ ))}
78
82
  </motion.ul>
79
83
  )}
80
84
  </AnimatePresence>
@@ -93,6 +93,8 @@ const Logos = ({
93
93
  }
94
94
  }, [selected]);
95
95
 
96
+ console.log("qwe", selected);
97
+
96
98
  return (
97
99
  <Container>
98
100
  {!withoutFilters && (
@@ -78,7 +78,20 @@ const Dropdown = ({
78
78
  <button
79
79
  onClick={toggleOpen}
80
80
  className={`${styles.dropdownHeading} ${isOpen ? styles.active : ""}`}>
81
- <span>{items.includes(selected.tag) ? selected.tag : heading}</span>
81
+ {heading === "Industry" && (
82
+ <span>
83
+ {items.includes(selected.tag)
84
+ ? industriesDisplayLabels[selected.tag]
85
+ : heading}
86
+ </span>
87
+ )}
88
+ {heading === "Service" && (
89
+ <span>
90
+ {items.includes(selected.tag)
91
+ ? servicesDisplayLabels[selected.tag]
92
+ : heading}
93
+ </span>
94
+ )}
82
95
  <CaretDown />
83
96
  </button>
84
97
 
@@ -104,11 +117,10 @@ const Dropdown = ({
104
117
  className={`${styles.option} ${
105
118
  selected.tag === option ? styles.active : ""
106
119
  }`}>
107
- {displayLabels?.[option] ?? (
108
- heading === "Industry"
120
+ {displayLabels?.[option] ??
121
+ (heading === "Industry"
109
122
  ? industriesDisplayLabels[option]
110
- : servicesDisplayLabels[option]
111
- )}
123
+ : servicesDisplayLabels[option])}
112
124
  </motion.li>
113
125
  ))}
114
126
  </motion.ul>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foundry-component-library",
3
- "version": "0.2.26",
3
+ "version": "0.2.28",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",