@anas_hameed/edly-saas-widget 0.1.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.
@@ -0,0 +1,349 @@
1
+ @use "sass:color";
2
+ $primary-color: #de2025;
3
+ $text-color: #0d1321;
4
+ $background-color: #ffffff;
5
+ $submenu-bg: #ffffff;
6
+ $submenu-border: #d1d5db;
7
+ $submenu-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
8
+ $hover-bg: color.adjust($primary-color, $lightness: 45%);
9
+ $transition-speed: 0.25s;
10
+ $font-family: "Inter", sans-serif;
11
+ $mobile-breakpoint: 1230px;
12
+ $icon-size: 0.95em;
13
+
14
+ /* Header and logo */
15
+ .header-holder {
16
+ padding: 15px 20px 14px;
17
+ display: flex;
18
+ align-items: center;
19
+ flex-direction: row;
20
+ }
21
+
22
+ .site-header {
23
+ width: 100%;
24
+ flex: inherit !important;
25
+ }
26
+
27
+ .custom-logo-link img {
28
+ margin: auto;
29
+ max-width: 200px;
30
+ max-height: 70px;
31
+ height: auto;
32
+ width: auto;
33
+ }
34
+
35
+ /* Desktop Menu */
36
+ #menu-primary-menu {
37
+ display: flex;
38
+ align-items: center;
39
+ list-style: none;
40
+ margin: 0;
41
+ padding: 0;
42
+
43
+ > li {
44
+ position: relative;
45
+ padding: 10px;
46
+
47
+ a {
48
+ color: $text-color;
49
+ text-decoration: none;
50
+ font-weight: 600;
51
+ display: block;
52
+ border-bottom: 1px solid transparent;
53
+ transition: color $transition-speed ease,
54
+ border-color $transition-speed ease;
55
+ position: relative;
56
+ display: block;
57
+ padding-bottom: 0px;
58
+ border: 0px;
59
+ text-decoration: none;
60
+ &:before {
61
+ content: "";
62
+ background-color: $primary-color;
63
+ width: auto;
64
+ height: 1px;
65
+ position: absolute;
66
+ bottom: -5px;
67
+ left: 0;
68
+ right: 0;
69
+ opacity: 0;
70
+ }
71
+ }
72
+
73
+ &:hover,
74
+ &.menu-active {
75
+ > a {
76
+ color: $primary-color;
77
+ &:before {
78
+ @media (min-width: $mobile-breakpoint + 1) {
79
+ opacity: 1;
80
+ }
81
+ }
82
+ }
83
+ }
84
+
85
+ &.menu-item-has-children > a::after,
86
+ &.menu-item-object-custom_link_filter > a::after,
87
+ &.submenu-item-class > a::after {
88
+ content: "›";
89
+ font-size: $icon-size;
90
+ margin-left: 0.4em;
91
+ display: inline-block;
92
+ transform: rotate(90deg);
93
+ transition: transform $transition-speed ease;
94
+ }
95
+
96
+ &:hover > a::after {
97
+ transform: rotate(90deg) translateX(2px);
98
+ }
99
+
100
+ > .sub-menu {
101
+ display: none;
102
+ position: absolute;
103
+ top: 100%;
104
+ left: 0;
105
+ background: $submenu-bg;
106
+ border: 1px solid $submenu-border;
107
+ border-radius: 6px;
108
+ box-shadow: $submenu-shadow;
109
+ list-style: none;
110
+ min-width: 230px;
111
+ padding: 0.5rem 0;
112
+ z-index: 10;
113
+
114
+ > li {
115
+ position: relative;
116
+ list-style: none;
117
+
118
+ a {
119
+ display: block;
120
+ padding: 0.6rem 1rem;
121
+ color: $text-color;
122
+ transition: background $transition-speed ease,
123
+ color $transition-speed ease;
124
+
125
+ &:hover {
126
+ background: $hover-bg;
127
+ color: $primary-color;
128
+ @media (max-width: $mobile-breakpoint) {
129
+ background: transparent;
130
+ }
131
+ }
132
+ }
133
+
134
+ &.submenu-item-class > a::after {
135
+ content: "›";
136
+ float: right;
137
+ font-size: $icon-size;
138
+ }
139
+
140
+ .sub-menu {
141
+ display: none;
142
+ position: absolute;
143
+ top: -5px;
144
+ left: 94%;
145
+ margin-left: 0.5rem;
146
+ border: 1px solid $submenu-border;
147
+ border-radius: 6px;
148
+ box-shadow: $submenu-shadow;
149
+ background: $submenu-bg;
150
+ min-width: 200px;
151
+ padding: 0.5rem 0;
152
+ list-style: none;
153
+ }
154
+
155
+ &:hover > .sub-menu {
156
+ display: block;
157
+ }
158
+ }
159
+ }
160
+
161
+ &:hover > .sub-menu {
162
+ display: block;
163
+ }
164
+ }
165
+ }
166
+
167
+ .mobile-menu {
168
+ .site-header {
169
+ background: white;
170
+ flex: inherit;
171
+ position: absolute;
172
+ top: 100px;
173
+ left: 0;
174
+ box-sizing: border-box;
175
+ #menu-primary-menu {
176
+ flex-direction: column;
177
+ text-align: left;
178
+ }
179
+ }
180
+ .site-header {
181
+ opacity: 1;
182
+ visibility: visible;
183
+ max-height: 4000px;
184
+ transition: all 0.3s ease;
185
+ max-height: 200px;
186
+ overflow-y: auto;
187
+ overflow-x: hidden;
188
+ }
189
+ &.mobile-hide {
190
+ .site-header {
191
+ opacity: 0;
192
+ visibility: hidden;
193
+ max-height: 0;
194
+ }
195
+ }
196
+ }
197
+
198
+ .menuOpner {
199
+ position: absolute;
200
+ top: 50%;
201
+ right: 20px;
202
+ transform: translateY(-50%);
203
+ }
204
+
205
+ .header-frame {
206
+ z-index: 9;
207
+ position: relative;
208
+ }
209
+
210
+ /* Desktop: Keep Sign In button on the right */
211
+ @media (min-width: $mobile-breakpoint + 1) {
212
+ #menu-primary-menu {
213
+ display: flex;
214
+ justify-content: flex-start;
215
+ align-items: center;
216
+
217
+ > li.menu-item-object-signin_openedx {
218
+ margin-left: auto; // Push to far right
219
+ order: 999; // Ensure last
220
+ padding-right: 10px !important;
221
+
222
+ a {
223
+ color: #fff;
224
+ background: $primary-color;
225
+ padding: 8px 16px;
226
+ border-radius: 6px;
227
+ &:before {
228
+ display: none;
229
+ }
230
+ }
231
+ }
232
+ }
233
+ }
234
+
235
+ /* Mobile Menu */
236
+ @media (max-width: $mobile-breakpoint) {
237
+ .custom-logo-link img {
238
+ max-width: 160px;
239
+ max-height: 50px;
240
+ }
241
+ .mobile-menu {
242
+ .site-header {
243
+ top: 70px;
244
+ padding: 0 30px;
245
+ }
246
+ }
247
+ #menu-primary-menu {
248
+ > li {
249
+ display: block;
250
+ width: 100%;
251
+ border-top: 1px solid #ccc;
252
+ &:first-child {
253
+ border-top: none;
254
+ }
255
+ > .sub-menu {
256
+ position: static;
257
+ display: block;
258
+ padding: 0 0 0 10px;
259
+ border-radius: 0;
260
+ border: 0;
261
+ box-shadow: none;
262
+ li {
263
+ a {
264
+ font-size: 12px;
265
+ }
266
+ }
267
+ }
268
+ }
269
+ }
270
+ #menu-primary-menu {
271
+ > li {
272
+ > .sub-menu {
273
+ > li {
274
+ .sub-menu {
275
+ position: static;
276
+ display: block;
277
+ padding: 0 0 0 20px;
278
+ border-radius: 0;
279
+ border: 0;
280
+ box-shadow: none;
281
+ }
282
+ }
283
+ }
284
+ }
285
+ }
286
+ .main-navigation {
287
+ .menu-toggle {
288
+ display: flex;
289
+ }
290
+
291
+ #menu-primary-menu {
292
+ flex-direction: column;
293
+ width: 100%;
294
+ background: $background-color;
295
+ position: absolute;
296
+ top: 100%;
297
+ left: 0;
298
+ padding: 1rem 0;
299
+ display: none;
300
+ box-shadow: $submenu-shadow;
301
+ border-top: 1px solid $submenu-border;
302
+
303
+ &.open {
304
+ display: flex;
305
+ }
306
+
307
+ > li {
308
+ width: 100%;
309
+ padding: 0.75rem 1rem;
310
+ border-bottom: 1px solid $submenu-border;
311
+
312
+ a {
313
+ display: flex;
314
+ justify-content: space-between;
315
+ align-items: center;
316
+ }
317
+
318
+ .sub-menu {
319
+ position: relative;
320
+ top: 0;
321
+ left: 0;
322
+ margin: 0;
323
+ border: none;
324
+ border-radius: 0;
325
+ box-shadow: none;
326
+ background: $submenu-bg;
327
+ padding-left: 1rem;
328
+ display: none;
329
+ list-style: none;
330
+
331
+ li a {
332
+ padding: 0.5rem 1rem;
333
+ transition: background $transition-speed ease,
334
+ color $transition-speed ease;
335
+
336
+ &:hover {
337
+ background: $hover-bg;
338
+ color: $primary-color;
339
+ }
340
+ }
341
+ }
342
+
343
+ &:hover > .sub-menu {
344
+ display: block;
345
+ }
346
+ }
347
+ }
348
+ }
349
+ }
package/dist/index.js ADDED
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "HeaderWidget", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _HeaderWidget.default;
10
+ }
11
+ });
12
+ var _HeaderWidget = _interopRequireDefault(require("./HeaderWidget"));
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_HeaderWidget","_interopRequireDefault","require","e","__esModule","default"],"sources":["../src/index.jsx"],"sourcesContent":["import HeaderWidget from \"./HeaderWidget\";\n\nexport { HeaderWidget };\n\n// import \"core-js/stable\";\n// import \"regenerator-runtime/runtime\";\n\n// import {\n// APP_INIT_ERROR,\n// APP_READY,\n// subscribe,\n// initialize,\n// } from \"@edx/frontend-platform\";\n// import { AppProvider, ErrorPage } from \"@edx/frontend-platform/react\";\n// import ReactDOM from \"react-dom\";\n\n// subscribe(APP_READY, () => {\n// ReactDOM.render(\n// <AppProvider>\n// <h1>Hello World</h1>\n// <HeaderWidget />\n// </AppProvider>,\n// document.getElementById(\"root\")\n// );\n// });\n\n// subscribe(APP_INIT_ERROR, (error) => {\n// ReactDOM.render(\n// <ErrorPage message={error.message} />,\n// document.getElementById(\"root\")\n// );\n// });\n\n// const messages = [];\n// initialize({ messages }).then(() => {\n// console.log(\"Frontend Platform initialized.\");\n// });\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@anas_hameed/edly-saas-widget",
3
+ "version": "0.1.0",
4
+ "description": "Frontend application template",
5
+ "main": "dist/index.js",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/edly-io/frontend-saas-widgets.git"
9
+ },
10
+ "browserslist": [
11
+ "extends @edx/browserslist-config"
12
+ ],
13
+ "scripts": {
14
+ "build": "make build",
15
+ "i18n_extract": "fedx-scripts formatjs extract",
16
+ "lint": "fedx-scripts eslint --ext .js --ext .jsx .",
17
+ "lint:fix": "fedx-scripts eslint --fix --ext .js --ext .jsx .",
18
+ "snapshot": "fedx-scripts jest --updateSnapshot",
19
+ "dev": "MFE_CONFIG_API_URL='http://edly.local.openedx.io:8000/api/mfe_config/v1' fedx-scripts webpack-dev-server --progress --host apps.local.openedx.io",
20
+ "start": "fedx-scripts webpack-dev-server --progress",
21
+ "start:with-theme": "paragon install-theme && npm start && npm install",
22
+ "test": "fedx-scripts jest --coverage --passWithNoTests"
23
+ },
24
+ "files": [
25
+ "/dist"
26
+ ],
27
+ "husky": {
28
+ "hooks": {
29
+ "pre-commit": "npm run lint"
30
+ }
31
+ },
32
+ "author": "anas_hameed",
33
+ "license": "AGPL-3.0",
34
+ "homepage": "https://github.com/edly-io/frontend-saas-widgets#readme",
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "bugs": {
39
+ "url": "https://github.com/edly-io/frontend-saas-widgets/issues"
40
+ },
41
+ "peerDependencies": {
42
+ "@edx/frontend-platform": "^8.3.1",
43
+ "@openedx/paragon": ">= 21.5.7 < 24.0.0",
44
+ "prop-types": "^15.5.10",
45
+ "react": "^16.9.0 || ^17.0.0 || ^18.0.0",
46
+ "react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0",
47
+ "react-router-dom": "^6.14.2"
48
+ },
49
+ "devDependencies": {
50
+ "@edx/browserslist-config": "^1.1.1",
51
+ "@edx/reactifex": "^2.1.1",
52
+ "@openedx/frontend-build": "14.6.0",
53
+ "glob": "7.2.3",
54
+ "husky": "7.0.4",
55
+ "jest": "29.7.0",
56
+ "sass": "^1.94.0",
57
+ "webpack-cli": "^6.0.1"
58
+ },
59
+ "dependencies": {
60
+ "copy-webpack-plugin": "^13.0.1"
61
+ },
62
+ "directories": {
63
+ "doc": "docs"
64
+ }
65
+ }