@capillarytech/blaze-ui 6.1.4 → 6.1.6-beta.1

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 (87) hide show
  1. package/CapDragReorder/Card.d.ts +2 -2
  2. package/CapDragReorder/Card.d.ts.map +1 -1
  3. package/CapDragReorder/Card.js +53 -51
  4. package/CapDragReorder/index.d.ts +2 -9
  5. package/CapDragReorder/index.d.ts.map +1 -1
  6. package/CapDragReorder/index.js +26 -15
  7. package/CapDragReorder/styles.css +12 -2
  8. package/CapDragReorder/styles.d.ts +2 -12
  9. package/CapDragReorder/styles.d.ts.map +1 -1
  10. package/CapDragReorder/styles.js +1 -1
  11. package/CapDragReorder/styles.module.scss.js +29 -0
  12. package/CapDragReorder/styles.scss +23 -10
  13. package/CapDragReorder/tests/CapDragReorder.mockData.d.ts +4 -0
  14. package/CapDragReorder/tests/CapDragReorder.mockData.d.ts.map +1 -0
  15. package/CapDragReorder/types.d.ts +32 -0
  16. package/CapDragReorder/types.d.ts.map +1 -0
  17. package/CapDragReorder/types.js +1 -0
  18. package/CapNavigationSPA/CapNavigationSPASidebar/index.d.ts +10 -0
  19. package/CapNavigationSPA/CapNavigationSPASidebar/index.d.ts.map +1 -0
  20. package/CapNavigationSPA/CapNavigationSPASidebar/index.js +373 -0
  21. package/CapNavigationSPA/CapNavigationSPASidebar/styles.css +318 -0
  22. package/CapNavigationSPA/CapNavigationSPASidebar/styles.module.scss.js +56 -0
  23. package/CapNavigationSPA/CapNavigationSPASidebar/styles.scss +385 -0
  24. package/CapNavigationSPA/CapNavigationSPASidebar/types.d.ts +31 -0
  25. package/CapNavigationSPA/CapNavigationSPASidebar/types.d.ts.map +1 -0
  26. package/CapNavigationSPA/CapNavigationSPASidebar/types.js +1 -0
  27. package/CapNavigationSPA/CapNavigationSPATopBar/index.d.ts +10 -0
  28. package/CapNavigationSPA/CapNavigationSPATopBar/index.d.ts.map +1 -0
  29. package/CapNavigationSPA/CapNavigationSPATopBar/index.js +119 -0
  30. package/CapNavigationSPA/CapNavigationSPATopBar/styles.css +141 -0
  31. package/CapNavigationSPA/CapNavigationSPATopBar/styles.module.scss.js +19 -0
  32. package/CapNavigationSPA/CapNavigationSPATopBar/styles.scss +163 -0
  33. package/CapNavigationSPA/CapNavigationSPATopBar/types.d.ts +28 -0
  34. package/CapNavigationSPA/CapNavigationSPATopBar/types.d.ts.map +1 -0
  35. package/CapNavigationSPA/CapNavigationSPATopBar/types.js +1 -0
  36. package/CapNavigationSPA/constants.d.ts +2 -0
  37. package/CapNavigationSPA/constants.d.ts.map +1 -0
  38. package/CapNavigationSPA/constants.js +4 -0
  39. package/CapNavigationSPA/index.d.ts +10 -0
  40. package/CapNavigationSPA/index.d.ts.map +1 -0
  41. package/CapNavigationSPA/index.js +436 -0
  42. package/CapNavigationSPA/messages.d.ts +13 -0
  43. package/CapNavigationSPA/messages.d.ts.map +1 -0
  44. package/CapNavigationSPA/messages.js +16 -0
  45. package/CapNavigationSPA/mockdata.d.ts +6 -0
  46. package/CapNavigationSPA/mockdata.d.ts.map +1 -0
  47. package/CapNavigationSPA/mockdata.js +4 -0
  48. package/CapNavigationSPA/styles.css +59 -0
  49. package/CapNavigationSPA/styles.module.scss.js +10 -0
  50. package/CapNavigationSPA/styles.scss +60 -0
  51. package/CapNavigationSPA/tests/CapNavigationSPA.mockData.d.ts +31 -0
  52. package/CapNavigationSPA/tests/CapNavigationSPA.mockData.d.ts.map +1 -0
  53. package/CapNavigationSPA/types.d.ts +39 -0
  54. package/CapNavigationSPA/types.d.ts.map +1 -0
  55. package/CapNavigationSPA/types.js +1 -0
  56. package/CapSelectFilter/index.js +2 -2
  57. package/CapTreeView/index.d.ts +6 -28
  58. package/CapTreeView/index.d.ts.map +1 -1
  59. package/CapTreeView/index.js +63 -78
  60. package/CapTreeView/styles.css +12 -22
  61. package/CapTreeView/styles.module.scss.js +16 -0
  62. package/CapTreeView/styles.scss +26 -39
  63. package/CapTreeView/tests/CapTreeView.mockData.d.ts +5 -0
  64. package/CapTreeView/tests/CapTreeView.mockData.d.ts.map +1 -0
  65. package/CapTreeView/types.d.ts +16 -0
  66. package/CapTreeView/types.d.ts.map +1 -0
  67. package/CapTreeView/types.js +1 -0
  68. package/assets/svgIcons/Icons/AiraNav.js +23 -0
  69. package/assets/svgIcons/Icons/CreativesNav.js +22 -0
  70. package/assets/svgIcons/Icons/DataManagement.js +22 -0
  71. package/assets/svgIcons/Icons/EngageNav.js +23 -0
  72. package/assets/svgIcons/Icons/InsightsNav.js +22 -0
  73. package/assets/svgIcons/Icons/LoyaltyTag.js +22 -0
  74. package/assets/svgIcons/Icons/Members.js +22 -0
  75. package/assets/svgIcons/Icons/RewardsOutline.js +4 -6
  76. package/assets/svgIcons/Icons/SidebarCollapse.js +17 -0
  77. package/assets/svgIcons/Icons/SidebarExpand.js +22 -0
  78. package/assets/svgIcons/Icons/ThreeStars.js +36 -18
  79. package/assets/svgIcons/component.js +27 -0
  80. package/assets/svgIcons/index.js +612 -594
  81. package/index.d.ts +6 -0
  82. package/index.d.ts.map +1 -1
  83. package/index.js +195 -189
  84. package/package.json +1 -1
  85. package/utils/getCapThemeConfig.d.ts.map +1 -1
  86. package/utils/getCapThemeConfig.js +11 -2
  87. package/.npmrc +0 -3
@@ -0,0 +1,56 @@
1
+ import './styles.css';const styles = {
2
+ "cap-navigation-spa-sidebar__wrapper": "cap-navigation-spa-sidebar__wrapper",
3
+ "cap-navigation-spa-sidebar": "cap-navigation-spa-sidebar",
4
+ "cap-navigation-spa-sidebar--collapsed": "cap-navigation-spa-sidebar--collapsed",
5
+ "cap-navigation-spa-sidebar__logo": "cap-navigation-spa-sidebar__logo",
6
+ "cap-navigation-spa-sidebar__logo-icon": "cap-navigation-spa-sidebar__logo-icon",
7
+ "cap-navigation-spa-sidebar__logo-text": "cap-navigation-spa-sidebar__logo-text",
8
+ "cap-navigation-spa-sidebar__nav": "cap-navigation-spa-sidebar__nav",
9
+ "cap-navigation-spa-sidebar__item": "cap-navigation-spa-sidebar__item",
10
+ "cap-navigation-spa-sidebar__item-icon": "cap-navigation-spa-sidebar__item-icon",
11
+ "cap-navigation-spa-sidebar__item-dot": "cap-navigation-spa-sidebar__item-dot",
12
+ "cap-navigation-spa-sidebar__item-label": "cap-navigation-spa-sidebar__item-label",
13
+ "cap-navigation-spa-sidebar__item--expanded": "cap-navigation-spa-sidebar__item--expanded",
14
+ "cap-navigation-spa-sidebar__item--expanded-loyalty": "cap-navigation-spa-sidebar__item--expanded-loyalty",
15
+ "cap-navigation-spa-sidebar__item--expanded-engage": "cap-navigation-spa-sidebar__item--expanded-engage",
16
+ "cap-navigation-spa-sidebar__item--expanded-insights": "cap-navigation-spa-sidebar__item--expanded-insights",
17
+ "cap-navigation-spa-sidebar__item--expanded-members": "cap-navigation-spa-sidebar__item--expanded-members",
18
+ "cap-navigation-spa-sidebar__item--expanded-rewards": "cap-navigation-spa-sidebar__item--expanded-rewards",
19
+ "cap-navigation-spa-sidebar__item--expanded-audiences": "cap-navigation-spa-sidebar__item--expanded-audiences",
20
+ "cap-navigation-spa-sidebar__item--expanded-data-management": "cap-navigation-spa-sidebar__item--expanded-data-management",
21
+ "cap-navigation-spa-sidebar__item--expanded-extensions": "cap-navigation-spa-sidebar__item--expanded-extensions",
22
+ "cap-navigation-spa-sidebar__item--expanded-settings": "cap-navigation-spa-sidebar__item--expanded-settings",
23
+ "cap-navigation-spa-sidebar__item-chevron": "cap-navigation-spa-sidebar__item-chevron",
24
+ "cap-navigation-spa-sidebar__l2-wrapper": "cap-navigation-spa-sidebar__l2-wrapper",
25
+ "cap-navigation-spa-sidebar__l2-divider": "cap-navigation-spa-sidebar__l2-divider",
26
+ "cap-navigation-spa-sidebar__l2-inline": "cap-navigation-spa-sidebar__l2-inline",
27
+ "cap-navigation-spa-sidebar__l2-inline-item": "cap-navigation-spa-sidebar__l2-inline-item",
28
+ "cap-navigation-spa-sidebar__l2-inline-item--selected": "cap-navigation-spa-sidebar__l2-inline-item--selected",
29
+ "cap-navigation-spa-sidebar__l2-inline-item--selected-loyalty": "cap-navigation-spa-sidebar__l2-inline-item--selected-loyalty",
30
+ "cap-navigation-spa-sidebar__l2-inline-item--selected-engage": "cap-navigation-spa-sidebar__l2-inline-item--selected-engage",
31
+ "cap-navigation-spa-sidebar__l2-inline-item--selected-insights": "cap-navigation-spa-sidebar__l2-inline-item--selected-insights",
32
+ "cap-navigation-spa-sidebar__l2-inline-item--selected-members": "cap-navigation-spa-sidebar__l2-inline-item--selected-members",
33
+ "cap-navigation-spa-sidebar__l2-inline-item--selected-rewards": "cap-navigation-spa-sidebar__l2-inline-item--selected-rewards",
34
+ "cap-navigation-spa-sidebar__l2-inline-item--selected-audiences": "cap-navigation-spa-sidebar__l2-inline-item--selected-audiences",
35
+ "cap-navigation-spa-sidebar__l2-inline-item--selected-data-management": "cap-navigation-spa-sidebar__l2-inline-item--selected-data-management",
36
+ "cap-navigation-spa-sidebar__l2-inline-item--selected-extensions": "cap-navigation-spa-sidebar__l2-inline-item--selected-extensions",
37
+ "cap-navigation-spa-sidebar__l2-inline-item--selected-settings": "cap-navigation-spa-sidebar__l2-inline-item--selected-settings",
38
+ "cap-navigation-spa-sidebar__divider": "cap-navigation-spa-sidebar__divider",
39
+ "cap-navigation-spa-sidebar__footer": "cap-navigation-spa-sidebar__footer",
40
+ "cap-navigation-spa-sidebar__collapse-btn": "cap-navigation-spa-sidebar__collapse-btn",
41
+ "cap-navigation-spa-sidebar__collapse-btn-icon": "cap-navigation-spa-sidebar__collapse-btn-icon",
42
+ "cap-navigation-spa-sidebar__collapse-wrap": "cap-navigation-spa-sidebar__collapse-wrap",
43
+ "cap-navigation-spa-sidebar__item-flyout-wrap": "cap-navigation-spa-sidebar__item-flyout-wrap",
44
+ "cap-navigation-spa-sidebar__l2-flyout": "cap-navigation-spa-sidebar__l2-flyout",
45
+ "cap-navigation-spa-sidebar__l2-flyout-arrow": "cap-navigation-spa-sidebar__l2-flyout-arrow",
46
+ "cap-navigation-spa-sidebar__l2-flyout-card": "cap-navigation-spa-sidebar__l2-flyout-card",
47
+ "cap-navigation-spa-sidebar__l2-flyout-parent": "cap-navigation-spa-sidebar__l2-flyout-parent",
48
+ "cap-navigation-spa-sidebar__l2-flyout-item": "cap-navigation-spa-sidebar__l2-flyout-item",
49
+ "cap-navigation-spa-sidebar__l2-flyout-item--selected": "cap-navigation-spa-sidebar__l2-flyout-item--selected",
50
+ "cap-navigation-spa-sidebar__l1-tooltip-flyout": "cap-navigation-spa-sidebar__l1-tooltip-flyout",
51
+ "cap-navigation-spa-sidebar__l1-tooltip-card": "cap-navigation-spa-sidebar__l1-tooltip-card",
52
+ "cap-navigation-spa-sidebar__l1-tooltip-label": "cap-navigation-spa-sidebar__l1-tooltip-label"
53
+ };
54
+ export {
55
+ styles as default
56
+ };
@@ -0,0 +1,385 @@
1
+ @import '../../styles/_variables.scss';
2
+
3
+ // BEM: Block = cap-navigation-spa-sidebar | Elements = __wrapper, __logo, __nav, __item, ... | Modifiers = --collapsed, __item--expanded, ...
4
+ // Wrapper for sidebar + L2 flyout (position relative for flyout)
5
+ .cap-navigation-spa-sidebar__wrapper {
6
+ position: relative;
7
+ display: flex;
8
+ flex-shrink: 0;
9
+ }
10
+
11
+ // Figma 646-56222: Navigation 240px, bg #FAFBFC (Neutral/1), border-right #dfe2e7, items 40px height, 20px pl, 14px text #091e42
12
+ .cap-navigation-spa-sidebar {
13
+ width: 17.143rem; // 240px
14
+ min-width: 17.143rem;
15
+ height: 100%;
16
+ background-color: $CAP_G10; // #FAFBFC – same as L2 dropdown (Figma 646-56222)
17
+ border-right: 1px solid $CAP_G07; // #dfe2e7
18
+ display: flex;
19
+ flex-direction: column;
20
+ flex-shrink: 0;
21
+ transition:
22
+ width 0.2s ease,
23
+ min-width 0.2s ease;
24
+ }
25
+
26
+ // Collapsed state: 80px width, icons only (per Figma collapsed sidebar design)
27
+ .cap-navigation-spa-sidebar--collapsed {
28
+ width: 5.714rem; // 80px
29
+ min-width: 5.714rem;
30
+ background-color: $CAP_G10; // #fafbfc
31
+ }
32
+
33
+ // Figma 583:6904 – logo left-aligned with module icons (same 20px left as nav items)
34
+ .cap-navigation-spa-sidebar__logo {
35
+ height: 5rem; // 80px – increased for clearer branding area
36
+ padding: 1rem 0.857rem 1rem 1.429rem; // 16px 12px 16px 20px – left 20px to align with nav
37
+ display: flex;
38
+ align-items: center;
39
+ gap: 0.5rem;
40
+ flex-shrink: 0;
41
+ }
42
+
43
+ .cap-navigation-spa-sidebar--collapsed .cap-navigation-spa-sidebar__logo {
44
+ padding: 1rem 0.571rem; // center logo when collapsed
45
+ justify-content: center;
46
+ }
47
+
48
+ .cap-navigation-spa-sidebar__logo-icon {
49
+ flex-shrink: 0;
50
+ display: flex;
51
+ align-items: center;
52
+ justify-content: center;
53
+ }
54
+
55
+ .cap-navigation-spa-sidebar__logo-text {
56
+ font-family: $FONT_FAMILY;
57
+ font-size: $FONT_SIZE_L;
58
+ font-weight: $FONT_WEIGHT_MEDIUM;
59
+ color: $CAP_G01; // #091e42
60
+ }
61
+
62
+ .cap-navigation-spa-sidebar__nav {
63
+ display: flex;
64
+ flex-direction: column;
65
+ flex: 1 1 auto;
66
+ min-height: 0;
67
+ padding: 0;
68
+ }
69
+
70
+ // Figma: all nav items same style – text #091e42, icon 16px, pl 20px, height 40px, gap 16px
71
+ .cap-navigation-spa-sidebar__item {
72
+ display: flex;
73
+ align-items: center;
74
+ height: 2.857rem; // 40px
75
+ padding: 0 1.429rem 0 1.429rem; // 20px
76
+ gap: 1rem; // 16px – Figma left 36px for text after 20px pl + 16px icon
77
+ width: 100%;
78
+ border: none;
79
+ background: transparent;
80
+ cursor: pointer;
81
+ font-family: $FONT_FAMILY;
82
+ font-size: $FONT_SIZE_M; // 14px
83
+ font-weight: $FONT_WEIGHT_REGULAR;
84
+ color: $CAP_G01; // #091e42 – same for all items (no blue active in Figma)
85
+ text-align: left;
86
+ transition: background-color 0.15s ease;
87
+
88
+ &:hover {
89
+ background-color: $CAP_G08; // #ebecf0
90
+ }
91
+ }
92
+
93
+ .cap-navigation-spa-sidebar--collapsed .cap-navigation-spa-sidebar__item {
94
+ padding: 0 0.571rem; // center icon when collapsed
95
+ justify-content: center;
96
+ }
97
+
98
+ .cap-navigation-spa-sidebar__item-icon {
99
+ display: flex;
100
+ align-items: center;
101
+ justify-content: center;
102
+ width: 1rem; // 16px – Figma icon size
103
+ height: 1rem;
104
+ flex-shrink: 0;
105
+ color: $CAP_G01; // #091e42 – same as label per Figma
106
+ }
107
+
108
+ .cap-navigation-spa-sidebar__item-dot {
109
+ width: 0.25rem;
110
+ height: 0.25rem;
111
+ border-radius: 50%;
112
+ background-color: currentColor;
113
+ }
114
+
115
+ .cap-navigation-spa-sidebar__item-label {
116
+ white-space: nowrap;
117
+ overflow: hidden;
118
+ text-overflow: ellipsis;
119
+ flex: 1 1 auto;
120
+ min-width: 0;
121
+ }
122
+
123
+ // Figma: parent with children when flyout is open – bg #EBECF0 (Loyalty); Engage uses #E9F0FE
124
+ .cap-navigation-spa-sidebar__item--expanded {
125
+ background-color: $CAP_G08; // #ebecf0
126
+ }
127
+
128
+ .cap-navigation-spa-sidebar__item--expanded-loyalty,
129
+ .cap-navigation-spa-sidebar__item--expanded-engage,
130
+ .cap-navigation-spa-sidebar__item--expanded-insights,
131
+ .cap-navigation-spa-sidebar__item--expanded-members,
132
+ .cap-navigation-spa-sidebar__item--expanded-rewards,
133
+ .cap-navigation-spa-sidebar__item--expanded-audiences,
134
+ .cap-navigation-spa-sidebar__item--expanded-data-management,
135
+ .cap-navigation-spa-sidebar__item--expanded-extensions,
136
+ .cap-navigation-spa-sidebar__item--expanded-settings {
137
+ background-color: $CAP_PALE_GREY; // #E9F0FE – Figma Loyalty/Engage/Insights/Member profiles/Rewards/Audience/Data management/Extensions/Settings expanded
138
+ }
139
+
140
+ .cap-navigation-spa-sidebar__item-chevron {
141
+ flex-shrink: 0;
142
+ margin-left: auto;
143
+ color: $CAP_G01;
144
+ }
145
+
146
+ // L2 wrapper: holds horizontal divider + L2 block (image: thin line beneath header)
147
+ .cap-navigation-spa-sidebar__l2-wrapper {
148
+ display: flex;
149
+ flex-direction: column;
150
+ width: 100%;
151
+ }
152
+
153
+ // Horizontal separator between parent row and L2 items – image: 1px light grey spanning content width
154
+ .cap-navigation-spa-sidebar__l2-divider {
155
+ height: 1px;
156
+ background-color: $CAP_G07; // #DFE2E7
157
+ width: 100%;
158
+ flex-shrink: 0;
159
+ }
160
+
161
+ // L2 inline – same background as sidebar (Figma 646-56222)
162
+ .cap-navigation-spa-sidebar__l2-inline {
163
+ display: flex;
164
+ flex-direction: column;
165
+ margin-left: 2.286rem; // 32px – indent so bar aligns
166
+ padding: 0;
167
+ border-left: 2px solid $CAP_G07; // ~2px vertical bar per image (slightly darker light grey)
168
+ background-color: $CAP_G10; // #FAFBFC – same as sidebar
169
+ }
170
+
171
+ // Parent text starts at 20+16+16 = 52px; L2 content starts at 32+2 = 34px → padding-left 18px for alignment; bg same as sidebar (Figma 646-56222)
172
+ .cap-navigation-spa-sidebar__l2-inline-item {
173
+ display: flex;
174
+ align-items: center;
175
+ height: 2.857rem; // 40px
176
+ padding: 0 1.714rem 0 1.286rem; // 4px 24px right, 18px left – align "P" with "L" of Loyalty
177
+ width: 100%;
178
+ border: none;
179
+ background-color: $CAP_G10; // #FAFBFC – same as sidebar
180
+ cursor: pointer;
181
+ font-family: $FONT_FAMILY;
182
+ font-size: $FONT_SIZE_M;
183
+ font-weight: $FONT_WEIGHT_REGULAR;
184
+ color: $CAP_G01; // #091E42
185
+ text-align: left;
186
+ transition: background-color 0.15s ease;
187
+
188
+ &:hover {
189
+ background-color: $CAP_G08; // #EBECF0
190
+ }
191
+ }
192
+
193
+ .cap-navigation-spa-sidebar__l2-inline-item--selected {
194
+ background-color: #e9f0fe; // Figma – selected L2 item (Loyalty)
195
+ }
196
+
197
+ // Loyalty / Engage / Insights / Member profiles / Rewards / Audience / Data management / Extensions / Settings L2 selected – Figma: bg #EBECF0, blue left edge #2466EA
198
+ // Pull selected item 2px left so blue bar overlays container grey bar (only blue shows for selected row)
199
+ .cap-navigation-spa-sidebar__l2-inline-item--selected-loyalty,
200
+ .cap-navigation-spa-sidebar__l2-inline-item--selected-engage,
201
+ .cap-navigation-spa-sidebar__l2-inline-item--selected-insights,
202
+ .cap-navigation-spa-sidebar__l2-inline-item--selected-members,
203
+ .cap-navigation-spa-sidebar__l2-inline-item--selected-rewards,
204
+ .cap-navigation-spa-sidebar__l2-inline-item--selected-audiences,
205
+ .cap-navigation-spa-sidebar__l2-inline-item--selected-data-management,
206
+ .cap-navigation-spa-sidebar__l2-inline-item--selected-extensions,
207
+ .cap-navigation-spa-sidebar__l2-inline-item--selected-settings {
208
+ margin-left: -2px; // overlay container’s 2px grey border so blue draws on top
209
+ background-color: $CAP_G08; // #EBECF0
210
+ box-shadow: inset 2px 0 0 map-get($CAP_SECONDARY, base); // #2466EA – blue vertical bar
211
+ }
212
+
213
+ // Figma 672-86680: 16px gap above and below horizontal dividers (same as section gap)
214
+ .cap-navigation-spa-sidebar__divider {
215
+ height: 1px;
216
+ background-color: $CAP_G07; // #dfe2e7
217
+ margin: 1rem 0.857rem; // 16px top/bottom, 12px left/right
218
+ flex-shrink: 0;
219
+ }
220
+
221
+ .cap-navigation-spa-sidebar__footer {
222
+ padding: 0.571rem 0 1rem;
223
+ flex-shrink: 0;
224
+ display: flex;
225
+ flex-direction: column;
226
+ gap: 1rem; // 16px between settings row and collapse button (same in both states)
227
+ }
228
+
229
+ // Figma collapsed: same 16px gap, tighter horizontal padding
230
+ .cap-navigation-spa-sidebar--collapsed .cap-navigation-spa-sidebar__footer {
231
+ padding: 0.571rem 0.571rem 1rem;
232
+ }
233
+
234
+ // Collapse/expand toggle – background matches navigation bar (no white block); icon #091E42 (Figma 640-46050)
235
+ .cap-navigation-spa-sidebar__collapse-btn {
236
+ display: flex;
237
+ align-items: center;
238
+ justify-content: center;
239
+ width: 5.714rem; // 80px – same as collapsed sidebar width
240
+ height: 2.857rem; // 40px
241
+ padding: 0;
242
+ margin-top: 0;
243
+ border: none;
244
+ background-color: transparent; // same as navigation bar (Figma – no separate white block)
245
+ cursor: pointer;
246
+ color: $CAP_G01; // #091e42
247
+ border-radius: 0;
248
+ transition: background-color 0.15s ease;
249
+ flex-shrink: 0;
250
+
251
+ &:hover {
252
+ background-color: $CAP_G08; // #EBECF0 – subtle hover
253
+ }
254
+ }
255
+
256
+ // Figma 640-46050: expand/collapse icon exactly 16×16px (override CapIcon size)
257
+ .cap-navigation-spa-sidebar__collapse-btn-icon {
258
+ font-size: 16px;
259
+ }
260
+
261
+ // Wrapper for collapse button – expanded: right-aligned; collapsed: centered (Figma 638-43461)
262
+ .cap-navigation-spa-sidebar__collapse-wrap {
263
+ width: 100%;
264
+ display: flex;
265
+ justify-content: flex-end;
266
+ }
267
+
268
+ .cap-navigation-spa-sidebar--collapsed .cap-navigation-spa-sidebar__collapse-wrap {
269
+ justify-content: center;
270
+ }
271
+
272
+ // Collapsed L2 flyout – wrapper so flyout is positioned to the right of the hovered item (Figma 640-45225)
273
+ .cap-navigation-spa-sidebar__item-flyout-wrap {
274
+ position: relative;
275
+ }
276
+
277
+ // Flyout container – absolute to the right of the sidebar icon; vertically centered so arrow points at parent (Figma 640-47376)
278
+ .cap-navigation-spa-sidebar__l2-flyout {
279
+ position: absolute;
280
+ left: 100%;
281
+ top: 50%;
282
+ transform: translateY(-50%);
283
+ display: flex;
284
+ align-items: center; // arrow aligns to center of flyout = center of parent row
285
+ padding-left: 4px; // small gap so arrow sits between icon and card
286
+ z-index: 10;
287
+ pointer-events: auto;
288
+ }
289
+
290
+ // Left-pointing arrow (white triangle) connecting flyout to sidebar (Figma: 7.07×7.071 rotated 135° = diamond)
291
+ .cap-navigation-spa-sidebar__l2-flyout-arrow {
292
+ width: 0;
293
+ height: 0;
294
+ border-top: 5px solid transparent;
295
+ border-bottom: 5px solid transparent;
296
+ border-right: 5px solid $CAP_WHITE;
297
+ align-self: center;
298
+ margin-left: -3px; // overlap card border so arrow touches card
299
+ filter: drop-shadow(0 0 1px rgba(9, 30, 66, 0.15));
300
+ }
301
+
302
+ // Card: white bg, rounded corners, border, shadow (Figma 640-45225)
303
+ .cap-navigation-spa-sidebar__l2-flyout-card {
304
+ background-color: $CAP_WHITE;
305
+ border: 1px solid $CAP_G07; // #DFE2E7
306
+ border-radius: 6px;
307
+ box-shadow:
308
+ 0 4px 4px rgba(9, 30, 66, 0.15),
309
+ 0 0 1px rgba(9, 30, 66, 0.15);
310
+ min-width: 200px;
311
+ overflow: hidden;
312
+ display: flex;
313
+ flex-direction: column;
314
+ }
315
+
316
+ // Parent title row (e.g. "Loyalty") – header style, border below
317
+ .cap-navigation-spa-sidebar__l2-flyout-parent {
318
+ padding: 8px 16px 10px;
319
+ font-family: $FONT_FAMILY;
320
+ font-size: $FONT_SIZE_M;
321
+ font-weight: $FONT_WEIGHT_MEDIUM;
322
+ color: $CAP_G01; // #091E42
323
+ border-bottom: 1px solid $CAP_G07; // #DFE2E7
324
+ flex-shrink: 0;
325
+ }
326
+
327
+ // L2 flyout item row – default #FAFBFC, selected #E9F0FE (Figma 640-45225)
328
+ .cap-navigation-spa-sidebar__l2-flyout-item {
329
+ display: flex;
330
+ align-items: center;
331
+ height: 2.857rem; // 40px
332
+ padding: 0 1rem; // 16px
333
+ width: 100%;
334
+ border: none;
335
+ background-color: #fafbfc; // Figma default row – variable absent
336
+ cursor: pointer;
337
+ font-family: $FONT_FAMILY;
338
+ font-size: $FONT_SIZE_M;
339
+ font-weight: $FONT_WEIGHT_REGULAR;
340
+ color: $CAP_G01; // #091E42
341
+ text-align: left;
342
+ transition: background-color 0.15s ease;
343
+
344
+ &:hover {
345
+ background-color: $CAP_G08; // #EBECF0
346
+ }
347
+ }
348
+
349
+ .cap-navigation-spa-sidebar__l2-flyout-item--selected {
350
+ background-color: $CAP_PALE_GREY; // #E9F0FE – Figma selected L2 row
351
+ }
352
+
353
+ // L1 tooltip flyout – collapsed state, modules without L2: show module name on hover (Figma 642-48287)
354
+ .cap-navigation-spa-sidebar__l1-tooltip-flyout {
355
+ position: absolute;
356
+ left: 100%;
357
+ top: 50%;
358
+ transform: translateY(-50%);
359
+ display: flex;
360
+ align-items: center;
361
+ padding-left: 4px;
362
+ z-index: 10;
363
+ pointer-events: auto;
364
+ }
365
+
366
+ .cap-navigation-spa-sidebar__l1-tooltip-card {
367
+ background-color: $CAP_WHITE;
368
+ border: 1px solid $CAP_G07; // #DFE2E7
369
+ border-radius: 6px;
370
+ box-shadow:
371
+ 0 4px 4px rgba(9, 30, 66, 0.15),
372
+ 0 0 1px rgba(9, 30, 66, 0.15);
373
+ overflow: hidden;
374
+ display: flex;
375
+ flex-direction: column;
376
+ }
377
+
378
+ .cap-navigation-spa-sidebar__l1-tooltip-label {
379
+ padding: 8px 16px 10px;
380
+ font-family: $FONT_FAMILY;
381
+ font-size: $FONT_SIZE_M;
382
+ font-weight: $FONT_WEIGHT_REGULAR;
383
+ color: $CAP_G01; // #091E42 – Figma 642-48287
384
+ white-space: nowrap;
385
+ }
@@ -0,0 +1,31 @@
1
+ import type React from 'react';
2
+ export interface CapNavigationSPASidebarItem {
3
+ key: string;
4
+ title: string;
5
+ link?: string;
6
+ target?: string;
7
+ iconType?: string;
8
+ /** Child items shown in L2 flyout (e.g. Programs, Promotions under Loyalty) */
9
+ children?: CapNavigationSPASidebarItem[];
10
+ }
11
+ export interface CapNavigationSPASidebarProps {
12
+ /** Sidebar nav items (icon + label) */
13
+ items: CapNavigationSPASidebarItem[];
14
+ /** Key of the currently selected item */
15
+ selectedKey?: string;
16
+ /** Callback when a nav item is clicked */
17
+ onItemClick?: (item: CapNavigationSPASidebarItem) => void;
18
+ /** Settings label; rendered at bottom */
19
+ settingsLabel?: string;
20
+ /** Optional logo node (e.g. Capillary logo) */
21
+ logo?: React.ReactNode;
22
+ /** Optional className */
23
+ className?: string;
24
+ /** When true, sidebar is collapsed (icons only, 80px width) */
25
+ collapsed?: boolean;
26
+ /** Callback when user clicks collapse/expand toggle at bottom */
27
+ onCollapseExpand?: () => void;
28
+ /** When false, do not set window.location on item click (e.g. for Storybook). Default true */
29
+ navigateToLink?: boolean;
30
+ }
31
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../components/CapNavigationSPA/CapNavigationSPASidebar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,2BAA2B;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,2BAA2B,EAAE,CAAC;CAC1C;AAED,MAAM,WAAW,4BAA4B;IAC3C,uCAAuC;IACvC,KAAK,EAAE,2BAA2B,EAAE,CAAC;IACrC,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,2BAA2B,KAAK,IAAI,CAAC;IAC1D,yCAAyC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,8FAA8F;IAC9F,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * CapNavigationSPATopBar – Top bar matching New navigation Figma design.
3
+ * Search "Search in org" + ⌘+K, org name + green Production pill, help, bell, user.
4
+ */
5
+ import React from 'react';
6
+ import type { CapNavigationSPATopBarProps } from './types';
7
+ declare const CapNavigationSPATopBar: React.FC<CapNavigationSPATopBarProps>;
8
+ export default CapNavigationSPATopBar;
9
+ export type { CapNavigationSPATopBarProps } from './types';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/CapNavigationSPA/CapNavigationSPATopBar/index.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,QAAA,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAyGjE,CAAC;AAEF,eAAe,sBAAsB,CAAC;AACtC,YAAY,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,119 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import classNames from "classnames";
3
+ import { useState } from "react";
4
+ import CapIcon from "../../CapIcon/index.js";
5
+ import styles from "./styles.module.scss.js";
6
+ const CapNavigationSPATopBar = ({
7
+ searchPlaceholder = "Search in org",
8
+ searchShortcut = "⌘+K",
9
+ orgName,
10
+ environmentLabel = "Production",
11
+ onSearch,
12
+ onOrgEnvClick,
13
+ onHelpClick,
14
+ onNotificationClick,
15
+ showNotificationBadge = false,
16
+ onUserClick,
17
+ userDisplay,
18
+ className
19
+ }) => {
20
+ const [searchValue, setSearchValue] = useState("");
21
+ const handleSearchSubmit = () => {
22
+ onSearch == null ? void 0 : onSearch(searchValue);
23
+ };
24
+ return /* @__PURE__ */ jsx(
25
+ "header",
26
+ {
27
+ className: classNames(styles["cap-navigation-spa-topbar"], className),
28
+ "data-testid": "cap-navigation-spa-topbar",
29
+ children: /* @__PURE__ */ jsxs("div", { className: styles["cap-navigation-spa-topbar__inner"], children: [
30
+ /* @__PURE__ */ jsxs(
31
+ "div",
32
+ {
33
+ className: styles["cap-navigation-spa-topbar__search"],
34
+ role: "button",
35
+ tabIndex: 0,
36
+ onClick: () => {
37
+ var _a;
38
+ return (_a = document.getElementById("cap-navigation-spa-search-input")) == null ? void 0 : _a.focus();
39
+ },
40
+ onKeyDown: (e) => e.key === "Enter" && e.target.click(),
41
+ children: [
42
+ /* @__PURE__ */ jsx("span", { className: styles["cap-navigation-spa-topbar__search-icon"], children: /* @__PURE__ */ jsx(CapIcon, { type: "search", size: "s" }) }),
43
+ /* @__PURE__ */ jsx(
44
+ "input",
45
+ {
46
+ id: "cap-navigation-spa-search-input",
47
+ type: "text",
48
+ className: styles["cap-navigation-spa-topbar__search-input"],
49
+ placeholder: searchPlaceholder,
50
+ value: searchValue,
51
+ onChange: (e) => setSearchValue(e.target.value),
52
+ onKeyDown: (e) => e.key === "Enter" && handleSearchSubmit(),
53
+ "aria-label": searchPlaceholder
54
+ }
55
+ ),
56
+ /* @__PURE__ */ jsx("kbd", { className: styles["cap-navigation-spa-topbar__search-kbd"], children: searchShortcut })
57
+ ]
58
+ }
59
+ ),
60
+ /* @__PURE__ */ jsxs("div", { className: styles["cap-navigation-spa-topbar__right"], children: [
61
+ /* @__PURE__ */ jsx("div", { className: styles["cap-navigation-spa-topbar__divider"] }),
62
+ /* @__PURE__ */ jsxs(
63
+ "button",
64
+ {
65
+ type: "button",
66
+ className: styles["cap-navigation-spa-topbar__org-button"],
67
+ onClick: onOrgEnvClick,
68
+ "aria-label": "Organization and environment",
69
+ children: [
70
+ /* @__PURE__ */ jsx("span", { className: styles["cap-navigation-spa-topbar__org-name"], children: orgName ?? "Organization" }),
71
+ /* @__PURE__ */ jsx("span", { className: styles["cap-navigation-spa-topbar__env-pill"], children: environmentLabel }),
72
+ /* @__PURE__ */ jsx("span", { className: styles["cap-navigation-spa-topbar__org-chevron"], children: /* @__PURE__ */ jsx(CapIcon, { type: "down", size: "s" }) })
73
+ ]
74
+ }
75
+ ),
76
+ /* @__PURE__ */ jsx(
77
+ "button",
78
+ {
79
+ type: "button",
80
+ className: styles["cap-navigation-spa-topbar__icon-btn"],
81
+ onClick: onHelpClick,
82
+ "aria-label": "Help",
83
+ children: /* @__PURE__ */ jsx(CapIcon, { type: "question-circle", size: "s" })
84
+ }
85
+ ),
86
+ /* @__PURE__ */ jsxs(
87
+ "button",
88
+ {
89
+ type: "button",
90
+ className: classNames(
91
+ styles["cap-navigation-spa-topbar__icon-btn"],
92
+ styles["cap-navigation-spa-topbar__icon-btn--has-badge"]
93
+ ),
94
+ onClick: onNotificationClick,
95
+ "aria-label": "Notifications",
96
+ children: [
97
+ /* @__PURE__ */ jsx(CapIcon, { type: "bell", size: "s" }),
98
+ showNotificationBadge && /* @__PURE__ */ jsx("span", { className: styles["cap-navigation-spa-topbar__notification-badge"] })
99
+ ]
100
+ }
101
+ ),
102
+ userDisplay !== void 0 ? /* @__PURE__ */ jsx("div", { className: styles["cap-navigation-spa-topbar__icon-btn"], children: userDisplay }) : /* @__PURE__ */ jsx(
103
+ "button",
104
+ {
105
+ type: "button",
106
+ className: styles["cap-navigation-spa-topbar__icon-btn"],
107
+ onClick: onUserClick,
108
+ "aria-label": "User menu",
109
+ children: /* @__PURE__ */ jsx(CapIcon, { type: "user", size: "s" })
110
+ }
111
+ )
112
+ ] })
113
+ ] })
114
+ }
115
+ );
116
+ };
117
+ export {
118
+ CapNavigationSPATopBar as default
119
+ };