@sanvika/ui 0.1.5 → 0.3.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.
- package/dist/index.js +129 -101
- package/package.json +15 -29
- package/src/components/buttons/Button.jsx +97 -0
- package/src/components/buttons/Button.stories.jsx +110 -0
- package/src/components/buttons/FavoriteHeartButton.jsx +41 -0
- package/src/components/buttons/FavoriteHeartButton.stories.jsx +48 -0
- package/src/components/buttons/ScrollButton.jsx +36 -0
- package/src/components/buttons/ScrollButton.stories.jsx +21 -0
- package/src/components/buttons/ThreeDotButton.jsx +36 -0
- package/src/components/buttons/ThreeDotButton.stories.jsx +14 -0
- package/src/components/common/Container.jsx +38 -0
- package/src/components/common/Section.jsx +60 -0
- package/src/components/common/Section.stories.jsx +64 -0
- package/src/components/icons/BellIcon.jsx +10 -0
- package/src/components/icons/ChevronDown.jsx +20 -0
- package/src/components/icons/EmailIcon.jsx +9 -0
- package/src/components/icons/FaAngleDown.jsx +9 -0
- package/src/components/icons/FaAngleRight.jsx +9 -0
- package/src/components/icons/FaArrowDown.jsx +9 -0
- package/src/components/icons/FaArrowLeft.jsx +9 -0
- package/src/components/icons/FaArrowUp.jsx +9 -0
- package/src/components/icons/FaBell.jsx +9 -0
- package/src/components/icons/FaBullhorn.jsx +10 -0
- package/src/components/icons/FaCalendarAlt.jsx +9 -0
- package/src/components/icons/FaCheck.jsx +9 -0
- package/src/components/icons/FaCheckCircle.jsx +9 -0
- package/src/components/icons/FaCheckDouble.jsx +9 -0
- package/src/components/icons/FaChevronDown.jsx +9 -0
- package/src/components/icons/FaChevronRight.jsx +9 -0
- package/src/components/icons/FaCircle.jsx +9 -0
- package/src/components/icons/FaComments.jsx +9 -0
- package/src/components/icons/FaEye.jsx +9 -0
- package/src/components/icons/FaEyeSlash.jsx +9 -0
- package/src/components/icons/FaHome.jsx +9 -0
- package/src/components/icons/FaKeyboard.jsx +9 -0
- package/src/components/icons/FaLocationArrow.jsx +9 -0
- package/src/components/icons/FaMapMarkerAlt.jsx +9 -0
- package/src/components/icons/FaMoon.jsx +9 -0
- package/src/components/icons/FaPaperPlane.jsx +9 -0
- package/src/components/icons/FaPaperclip.jsx +9 -0
- package/src/components/icons/FaSignInAlt.jsx +9 -0
- package/src/components/icons/FaSmile.jsx +9 -0
- package/src/components/icons/FaStar.jsx +9 -0
- package/src/components/icons/FaTag.jsx +9 -0
- package/src/components/icons/FaThumbsDown.jsx +9 -0
- package/src/components/icons/FaThumbsUp.jsx +9 -0
- package/src/components/icons/FaTrash.jsx +9 -0
- package/src/components/icons/FaUser.jsx +9 -0
- package/src/components/icons/FaUserCircle.jsx +9 -0
- package/src/components/icons/FacebookIcon.jsx +9 -0
- package/src/components/icons/HalfMoonIcon.jsx +18 -0
- package/src/components/icons/HeartIcon.jsx +9 -0
- package/src/components/icons/InstagramIcon.jsx +9 -0
- package/src/components/icons/LinkedInIcon.jsx +9 -0
- package/src/components/icons/MapMarkerIcon.jsx +9 -0
- package/src/components/icons/MdWbSunny.jsx +9 -0
- package/src/components/icons/ReFreshIcon.jsx +49 -0
- package/src/components/icons/SearchIcon.jsx +20 -0
- package/src/components/icons/StarIcon.jsx +9 -0
- package/src/components/icons/TelegramIcon.jsx +9 -0
- package/src/components/icons/TwitterIcon.jsx +9 -0
- package/src/components/icons/UserIcon.jsx +9 -0
- package/src/components/icons/WhatsappIcon.jsx +9 -0
- package/src/components/icons/YoutubeIcon.jsx +9 -0
- package/src/components/icons/index.js +60 -0
- package/src/components/layout/Footer.jsx +53 -0
- package/src/components/layout/Footer.stories.jsx +28 -0
- package/src/components/layout/Navbar.jsx +50 -0
- package/src/components/layout/Navbar.stories.jsx +42 -0
- package/src/components/layout/SubNavbar.jsx +36 -0
- package/src/components/modals/Modal.jsx +74 -0
- package/src/components/modals/Modal.stories.jsx +93 -0
- package/src/components/progressBar/ProgressBar.jsx +113 -0
- package/src/components/progressBar/ProgressBar.stories.jsx +67 -0
- package/src/context/ThemeContext.jsx +100 -0
- package/src/index.js +33 -0
- package/src/layouts/Layout.jsx +24 -0
- package/src/server/index.js +173 -0
- package/README.md +0 -36
- package/dist/EmailIcon-DumDw7u2.js +0 -781
package/dist/index.js
CHANGED
|
@@ -6,15 +6,14 @@ export { B as BellIcon, C as ChevronDown, E as EmailIcon, F as FaAngleDown, a as
|
|
|
6
6
|
import { createPortal } from 'react-dom';
|
|
7
7
|
|
|
8
8
|
function styleInject(css, ref) {
|
|
9
|
-
if (
|
|
9
|
+
if (ref === void 0) ref = {};
|
|
10
10
|
var insertAt = ref.insertAt;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
if (!css || typeof document === 'undefined') {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
14
|
var head = document.head || document.getElementsByTagName('head')[0];
|
|
15
15
|
var style = document.createElement('style');
|
|
16
16
|
style.type = 'text/css';
|
|
17
|
-
|
|
18
17
|
if (insertAt === 'top') {
|
|
19
18
|
if (head.firstChild) {
|
|
20
19
|
head.insertBefore(style, head.firstChild);
|
|
@@ -24,7 +23,6 @@ function styleInject(css, ref) {
|
|
|
24
23
|
} else {
|
|
25
24
|
head.appendChild(style);
|
|
26
25
|
}
|
|
27
|
-
|
|
28
26
|
if (style.styleSheet) {
|
|
29
27
|
style.styleSheet.cssText = css;
|
|
30
28
|
} else {
|
|
@@ -32,9 +30,9 @@ function styleInject(css, ref) {
|
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
32
|
|
|
35
|
-
var css_248z$
|
|
36
|
-
var styles$
|
|
37
|
-
styleInject(css_248z$
|
|
33
|
+
var css_248z$a = ".Navbar-module_navbar__2NTiG{align-items:center;background-color:var(--card-bg);border-bottom:1px solid var(--border-color);border-top:1px solid var(--border-color);box-shadow:0 2px 4px rgba(0,0,0,.1);column-gap:clamp(4px,1vw,12px);display:grid;grid-template-columns:auto 1fr auto;left:0;min-height:clamp(40px,10vw,60px);overflow:visible;padding:clamp(4px,1vw,10px) clamp(6px,2vw,18px);position:fixed;right:0;top:0;transition:background-color .3s ease;width:100%;z-index:1000}.Navbar-module_navSectionLeft__zH0WR{align-items:center;color:inherit;cursor:pointer;display:flex;height:100%;justify-content:flex-start;min-width:clamp(48px,16vw,88px);text-decoration:none;user-select:none}.Navbar-module_navSectionCenter__j0wpK{align-items:center;display:flex;height:100%;justify-content:center;min-width:0;width:100%}.Navbar-module_menu__QQfPq{align-items:center;display:flex;flex-wrap:nowrap;gap:clamp(4px,1.2vw,12px);justify-content:center;list-style:none;margin:0;padding:0;width:100%}.Navbar-module_navSectionRight__A4Egv{align-items:center;display:flex;height:100%;justify-content:flex-end;min-width:clamp(48px,16vw,88px);overflow:visible}";
|
|
34
|
+
var styles$a = {"navbar":"Navbar-module_navbar__2NTiG","navSectionLeft":"Navbar-module_navSectionLeft__zH0WR","navSectionCenter":"Navbar-module_navSectionCenter__j0wpK","menu":"Navbar-module_menu__QQfPq","navSectionRight":"Navbar-module_navSectionRight__A4Egv"};
|
|
35
|
+
styleInject(css_248z$a);
|
|
38
36
|
|
|
39
37
|
// src/components/layout/Navbar.jsx
|
|
40
38
|
const Navbar = ({
|
|
@@ -45,27 +43,27 @@ const Navbar = ({
|
|
|
45
43
|
ariaLabel = "Main navigation"
|
|
46
44
|
}) => {
|
|
47
45
|
return /*#__PURE__*/jsxs("nav", {
|
|
48
|
-
className: `${styles$
|
|
46
|
+
className: `${styles$a.navbar} ${className}`.trim(),
|
|
49
47
|
"aria-label": ariaLabel,
|
|
50
48
|
children: [/*#__PURE__*/jsx("div", {
|
|
51
|
-
className: styles$
|
|
49
|
+
className: styles$a.navSectionLeft,
|
|
52
50
|
children: leftSlot
|
|
53
51
|
}), /*#__PURE__*/jsx("div", {
|
|
54
|
-
className: styles$
|
|
52
|
+
className: styles$a.navSectionCenter,
|
|
55
53
|
children: centerSlot && /*#__PURE__*/jsx("ul", {
|
|
56
|
-
className: styles$
|
|
54
|
+
className: styles$a.menu,
|
|
57
55
|
children: centerSlot
|
|
58
56
|
})
|
|
59
57
|
}), /*#__PURE__*/jsx("div", {
|
|
60
|
-
className: styles$
|
|
58
|
+
className: styles$a.navSectionRight,
|
|
61
59
|
children: rightSlot
|
|
62
60
|
})]
|
|
63
61
|
});
|
|
64
62
|
};
|
|
65
63
|
|
|
66
|
-
var css_248z$
|
|
67
|
-
var styles$
|
|
68
|
-
styleInject(css_248z$
|
|
64
|
+
var css_248z$9 = ".SubNavbar-module_subNavbar__1hd8N{align-items:center;background-color:var(--card-bg);border-bottom:.5px solid var(--border-color);box-shadow:0 2px 4px rgba(0,0,0,.1);display:flex;justify-content:center;left:0;min-height:clamp(48px,10vw,60px);overflow:visible;padding:clamp(6px,1.5vw,10px) clamp(6px,2vw,18px);position:fixed;right:0;top:clamp(48px,10vw,60px);transition:background-color .3s ease;width:100%;z-index:999}.SubNavbar-module_menu__ejJKq{align-items:center;display:flex;flex-wrap:nowrap;gap:clamp(4px,1.5vw,16px);justify-content:space-evenly;list-style:none;margin:0;max-width:500px;padding:0 clamp(4px,1vw,12px);width:100%}";
|
|
65
|
+
var styles$9 = {"subNavbar":"SubNavbar-module_subNavbar__1hd8N","menu":"SubNavbar-module_menu__ejJKq"};
|
|
66
|
+
styleInject(css_248z$9);
|
|
69
67
|
|
|
70
68
|
// src/components/layout/SubNavbar.jsx
|
|
71
69
|
const SubNavbar = ({
|
|
@@ -76,19 +74,19 @@ const SubNavbar = ({
|
|
|
76
74
|
}) => {
|
|
77
75
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
78
76
|
children: [/*#__PURE__*/jsx("nav", {
|
|
79
|
-
className: `${styles$
|
|
77
|
+
className: `${styles$9.subNavbar} ${className}`.trim(),
|
|
80
78
|
"aria-label": ariaLabel,
|
|
81
79
|
children: /*#__PURE__*/jsx("ul", {
|
|
82
|
-
className: styles$
|
|
80
|
+
className: styles$9.menu,
|
|
83
81
|
children: children
|
|
84
82
|
})
|
|
85
83
|
}), afterContent]
|
|
86
84
|
});
|
|
87
85
|
};
|
|
88
86
|
|
|
89
|
-
var css_248z$
|
|
90
|
-
var styles$
|
|
91
|
-
styleInject(css_248z$
|
|
87
|
+
var css_248z$8 = ".Footer-module_footer__1gTBc{background-color:var(--card-bg);border-bottom:clamp(.5px,.2vw,1px) solid var(--border-color);border-top:clamp(.5px,.2vw,1px) solid var(--border-color);box-shadow:0 -1px 0 0 var(--border-color) inset;display:flex;justify-content:center;min-height:clamp(24px,6vw,36px);padding:clamp(2px,.5vw,4px) clamp(5px,1.5vw,10px);position:relative;text-align:center;transition:background-color .3s ease,color .3s ease;width:100%;z-index:900}.Footer-module_footerContent__sC89p{align-items:center;display:flex;flex-direction:column;gap:clamp(1px,.2vw,2px);max-width:clamp(300px,90vw,400px);width:100%}.Footer-module_topLine__NNJXQ{align-items:center;display:flex;justify-content:center;width:100%}.Footer-module_socialIconsContainer__kNCBG{align-items:center;display:flex;flex:0 0 auto;justify-content:center;padding:clamp(2px,1vw,4px) clamp(4px,1.5vw,6px)}.Footer-module_socialIcons__O-HxQ{align-items:center;display:flex;gap:clamp(8px,2vw,16px);justify-content:center}.Footer-module_legalLinks__fJAsq{align-items:center;display:flex;flex-wrap:nowrap;gap:clamp(4px,1.5vw,8px);justify-content:center;width:100%}.Footer-module_dunsContainer__-mj-b{align-items:center;display:flex;justify-content:center;margin-top:clamp(2px,.5vw,4px);width:100%}";
|
|
88
|
+
var styles$8 = {"footer":"Footer-module_footer__1gTBc","footerContent":"Footer-module_footerContent__sC89p","topLine":"Footer-module_topLine__NNJXQ","socialIconsContainer":"Footer-module_socialIconsContainer__kNCBG","socialIcons":"Footer-module_socialIcons__O-HxQ","legalLinks":"Footer-module_legalLinks__fJAsq","dunsContainer":"Footer-module_dunsContainer__-mj-b"};
|
|
89
|
+
styleInject(css_248z$8);
|
|
92
90
|
|
|
93
91
|
// src/components/layout/Footer.jsx
|
|
94
92
|
const Footer = ({
|
|
@@ -98,32 +96,32 @@ const Footer = ({
|
|
|
98
96
|
className = ""
|
|
99
97
|
}) => {
|
|
100
98
|
return /*#__PURE__*/jsx("footer", {
|
|
101
|
-
className: `${styles$
|
|
99
|
+
className: `${styles$8.footer} ${className}`.trim(),
|
|
102
100
|
children: /*#__PURE__*/jsxs("div", {
|
|
103
|
-
className: styles$
|
|
101
|
+
className: styles$8.footerContent,
|
|
104
102
|
children: [socialSlot && /*#__PURE__*/jsx("div", {
|
|
105
|
-
className: styles$
|
|
103
|
+
className: styles$8.topLine,
|
|
106
104
|
children: /*#__PURE__*/jsx("div", {
|
|
107
|
-
className: styles$
|
|
105
|
+
className: styles$8.socialIconsContainer,
|
|
108
106
|
children: /*#__PURE__*/jsx("div", {
|
|
109
|
-
className: styles$
|
|
107
|
+
className: styles$8.socialIcons,
|
|
110
108
|
children: socialSlot
|
|
111
109
|
})
|
|
112
110
|
})
|
|
113
111
|
}), legalSlot && /*#__PURE__*/jsx("div", {
|
|
114
|
-
className: styles$
|
|
112
|
+
className: styles$8.legalLinks,
|
|
115
113
|
children: legalSlot
|
|
116
114
|
}), trustSlot && /*#__PURE__*/jsx("div", {
|
|
117
|
-
className: styles$
|
|
115
|
+
className: styles$8.dunsContainer,
|
|
118
116
|
children: trustSlot
|
|
119
117
|
})]
|
|
120
118
|
})
|
|
121
119
|
});
|
|
122
120
|
};
|
|
123
121
|
|
|
124
|
-
var css_248z$
|
|
125
|
-
var styles$
|
|
126
|
-
styleInject(css_248z$
|
|
122
|
+
var css_248z$7 = ".Button-module_button__uvxtU{align-items:center;background-color:var(--button-bg,var(--btn-primary-bg));border:1px solid var(--button-border,transparent);border-radius:var(--radius-md);color:var(--button-text,var(--btn-primary-text));cursor:pointer;display:inline-flex;flex-shrink:0;font-family:var(--font-sans);font-size:clamp(.8rem,2.5vw,.9rem);font-weight:500;gap:clamp(4px,.5vw,6px);justify-content:center;line-height:1.2;min-height:clamp(32px,8vw,40px);overflow:hidden;padding:clamp(6px,1.2vw,10px) clamp(12px,2.5vw,20px);position:relative;text-decoration:none;transition:background-color .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease;user-select:none;white-space:nowrap}.Button-module_button__uvxtU:hover{background-color:var(--button-hover-bg,var(--btn-primary-hover-bg));box-shadow:0 2px 8px var(--shadow-color);color:var(--button-hover-text,var(--btn-primary-hover-text))}.Button-module_button__uvxtU:active{box-shadow:none}.Button-module_button__uvxtU:focus-visible{outline:2px solid var(--focus-border-color);outline-offset:2px}.Button-module_button__uvxtU:disabled{box-shadow:none;cursor:not-allowed;opacity:.55;pointer-events:none}.Button-module_primary__xPba2{--button-bg:var(--btn-primary-bg);--button-text:var(--btn-primary-text);--button-hover-bg:var(--btn-primary-hover-bg);--button-hover-text:var(--btn-primary-hover-text)}.Button-module_secondary__hn72M{--button-bg:var(--btn-secondary-bg);--button-text:var(--btn-secondary-text);--button-hover-bg:var(--btn-secondary-hover-bg);--button-hover-text:var(--btn-secondary-hover-text)}.Button-module_danger__6UD-N{--button-bg:var(--btn-danger-bg);--button-text:var(--btn-danger-text);--button-hover-bg:var(--btn-danger-hover-bg);--button-hover-text:var(--btn-danger-hover-text)}.Button-module_success__B0AQp{--button-bg:var(--btn-success-bg);--button-text:var(--btn-success-text);--button-hover-bg:var(--btn-success-hover-bg);--button-hover-text:var(--btn-success-hover-text)}.Button-module_outline__zE2nr{--button-bg:transparent;--button-hover-bg:var(--hover-color);--button-text:var(--text-color);--button-hover-text:var(--text-color);--button-border:var(--border-color-light)}.Button-module_ghost__Lw5bx{--button-bg:transparent;--button-hover-bg:var(--hover-color);--button-text:var(--text-color);--button-hover-text:var(--text-color);--button-border:transparent;box-shadow:none}.Button-module_ghost__Lw5bx:hover{box-shadow:none}.Button-module_sm__hHCp3{border-radius:var(--radius-sm);font-size:var(--text-xs);min-height:clamp(24px,6vw,32px);padding:clamp(3px,.8vw,5px) clamp(8px,2vw,12px)}.Button-module_lg__8-o98{border-radius:var(--radius-lg);font-size:var(--text-base);min-height:clamp(40px,10vw,56px);padding:clamp(10px,2vw,14px) clamp(20px,5vw,32px)}.Button-module_full__GaUHE{width:100%}.Button-module_icon__bd--q{align-items:center;color:inherit;display:flex;flex-shrink:0}.Button-module_text__NGnws{color:inherit}.Button-module_badge__64QnL{align-items:center;background-color:var(--error-color);border-radius:var(--radius-full);color:var(--btn-primary-text);display:inline-flex;font-size:.65rem;font-weight:700;height:18px;justify-content:center;margin-left:clamp(2px,.5vw,4px);min-width:18px;padding:0 clamp(2px,.5vw,4px)}";
|
|
123
|
+
var styles$7 = {"button":"Button-module_button__uvxtU","primary":"Button-module_primary__xPba2","secondary":"Button-module_secondary__hn72M","danger":"Button-module_danger__6UD-N","success":"Button-module_success__B0AQp","outline":"Button-module_outline__zE2nr","ghost":"Button-module_ghost__Lw5bx","sm":"Button-module_sm__hHCp3","lg":"Button-module_lg__8-o98","full":"Button-module_full__GaUHE","icon":"Button-module_icon__bd--q","text":"Button-module_text__NGnws","badge":"Button-module_badge__64QnL"};
|
|
124
|
+
styleInject(css_248z$7);
|
|
127
125
|
|
|
128
126
|
// src/components/buttons/Button.jsx
|
|
129
127
|
const Button = ({
|
|
@@ -145,20 +143,20 @@ const Button = ({
|
|
|
145
143
|
...props
|
|
146
144
|
}) => {
|
|
147
145
|
const label = children ?? text;
|
|
148
|
-
const intentClass = styles$
|
|
149
|
-
const appearanceClass = appearance === "outline" ? styles$
|
|
150
|
-
const sizeClass = size === "sm" ? styles$
|
|
151
|
-
const cls = [styles$
|
|
146
|
+
const intentClass = styles$7[intent] ?? styles$7.primary;
|
|
147
|
+
const appearanceClass = appearance === "outline" ? styles$7.outline : appearance === "ghost" ? styles$7.ghost : "";
|
|
148
|
+
const sizeClass = size === "sm" ? styles$7.sm : size === "lg" ? styles$7.lg : "";
|
|
149
|
+
const cls = [styles$7.button, intentClass, appearanceClass, sizeClass, fullWidth ? styles$7.full : "", className ?? ""].filter(Boolean).join(" ");
|
|
152
150
|
const content = /*#__PURE__*/jsxs(Fragment, {
|
|
153
151
|
children: [icon && /*#__PURE__*/jsx("span", {
|
|
154
|
-
className: styles$
|
|
152
|
+
className: styles$7.icon,
|
|
155
153
|
"aria-hidden": "true",
|
|
156
154
|
children: icon
|
|
157
155
|
}), label && /*#__PURE__*/jsx("span", {
|
|
158
|
-
className: styles$
|
|
156
|
+
className: styles$7.text,
|
|
159
157
|
children: label
|
|
160
158
|
}), badge != null && /*#__PURE__*/jsx("span", {
|
|
161
|
-
className: `${styles$
|
|
159
|
+
className: `${styles$7.badge} ${badgeClassName ?? ""}`.trim(),
|
|
162
160
|
children: badge
|
|
163
161
|
})]
|
|
164
162
|
});
|
|
@@ -182,9 +180,9 @@ const Button = ({
|
|
|
182
180
|
});
|
|
183
181
|
};
|
|
184
182
|
|
|
185
|
-
var css_248z$
|
|
186
|
-
var styles$
|
|
187
|
-
styleInject(css_248z$
|
|
183
|
+
var css_248z$6 = ".FavoriteHeartButton-module_favoriteHeartButton__ml-Uu{align-items:center;background-color:transparent!important;border:none!important;cursor:pointer;display:flex;gap:0!important;height:clamp(32px,8vw,48px)!important;justify-content:center;max-width:clamp(32px,8vw,48px)!important;min-width:clamp(32px,8vw,48px)!important;padding:clamp(4px,1.5vw,8px)!important;transition:opacity .2s ease}.FavoriteHeartButton-module_favorited__01bVq{color:var(--danger-color,#dc3545)!important}.FavoriteHeartButton-module_notFavorited__gU-Ng{color:var(--secondary-text-color)!important}.FavoriteHeartButton-module_favoriteHeartButton__ml-Uu:disabled{cursor:not-allowed;opacity:.6}.FavoriteHeartButton-module_favoriteHeartButton__ml-Uu:hover:not(:disabled){background-color:transparent!important;border:none!important;opacity:.75}";
|
|
184
|
+
var styles$6 = {"favoriteHeartButton":"FavoriteHeartButton-module_favoriteHeartButton__ml-Uu","favorited":"FavoriteHeartButton-module_favorited__01bVq","notFavorited":"FavoriteHeartButton-module_notFavorited__gU-Ng"};
|
|
185
|
+
styleInject(css_248z$6);
|
|
188
186
|
|
|
189
187
|
// src/components/buttons/FavoriteHeartButton.jsx
|
|
190
188
|
const FavoriteHeartButton = ({
|
|
@@ -199,7 +197,7 @@ const FavoriteHeartButton = ({
|
|
|
199
197
|
return /*#__PURE__*/jsx(Button, {
|
|
200
198
|
onClick: onClick,
|
|
201
199
|
disabled: disabled,
|
|
202
|
-
className: `${styles$
|
|
200
|
+
className: `${styles$6.favoriteHeartButton} ${isFavorited ? styles$6.favorited : styles$6.notFavorited} ${className}`,
|
|
203
201
|
style: style,
|
|
204
202
|
"aria-label": isFavorited ? "Unfavorite" : "Favorite",
|
|
205
203
|
title: isFavorited ? "Unfavorite" : "Favorite",
|
|
@@ -235,9 +233,9 @@ const ScrollButton = ({
|
|
|
235
233
|
});
|
|
236
234
|
};
|
|
237
235
|
|
|
238
|
-
var css_248z$
|
|
239
|
-
var styles$
|
|
240
|
-
styleInject(css_248z$
|
|
236
|
+
var css_248z$5 = ".ThreeDotButton-module_threeDotButton__yBrhU{gap:0!important;height:44px!important;max-width:44px!important;min-width:44px!important;padding:6px!important;width:44px!important}.ThreeDotButton-module_threeDotButton__yBrhU,.ThreeDotButton-module_threeDotButton__yBrhU:active,.ThreeDotButton-module_threeDotButton__yBrhU:hover{background:transparent!important;background-color:transparent!important;border:none!important}.ThreeDotButton-module_threeDotButton__yBrhU:focus-visible{border-radius:var(--radius-sm,4px);outline:2px solid var(--accent-color,#007bff)}.ThreeDotButton-module_dotsWrapper__mDkka{align-items:center;display:inline-flex;flex-direction:column;gap:3px;justify-content:center}.ThreeDotButton-module_dot__pzOIM{background:currentColor;border-radius:50%;display:inline-block;height:4px;width:4px}";
|
|
237
|
+
var styles$5 = {"threeDotButton":"ThreeDotButton-module_threeDotButton__yBrhU","dotsWrapper":"ThreeDotButton-module_dotsWrapper__mDkka","dot":"ThreeDotButton-module_dot__pzOIM"};
|
|
238
|
+
styleInject(css_248z$5);
|
|
241
239
|
|
|
242
240
|
// src/components/buttons/ThreeDotButton.jsx
|
|
243
241
|
const ThreeDotButton = ({
|
|
@@ -246,27 +244,27 @@ const ThreeDotButton = ({
|
|
|
246
244
|
onClick
|
|
247
245
|
}) => {
|
|
248
246
|
return /*#__PURE__*/jsx(Button, {
|
|
249
|
-
className: `${styles$
|
|
247
|
+
className: `${styles$5.threeDotButton} ${className}`,
|
|
250
248
|
onClick: onClick,
|
|
251
249
|
"aria-label": ariaLabel,
|
|
252
250
|
title: ariaLabel,
|
|
253
251
|
icon: /*#__PURE__*/jsxs("span", {
|
|
254
|
-
className: styles$
|
|
252
|
+
className: styles$5.dotsWrapper,
|
|
255
253
|
"aria-hidden": "true",
|
|
256
254
|
children: [/*#__PURE__*/jsx("span", {
|
|
257
|
-
className: styles$
|
|
255
|
+
className: styles$5.dot
|
|
258
256
|
}), /*#__PURE__*/jsx("span", {
|
|
259
|
-
className: styles$
|
|
257
|
+
className: styles$5.dot
|
|
260
258
|
}), /*#__PURE__*/jsx("span", {
|
|
261
|
-
className: styles$
|
|
259
|
+
className: styles$5.dot
|
|
262
260
|
})]
|
|
263
261
|
})
|
|
264
262
|
});
|
|
265
263
|
};
|
|
266
264
|
|
|
267
|
-
var css_248z$
|
|
268
|
-
var styles$
|
|
269
|
-
styleInject(css_248z$
|
|
265
|
+
var css_248z$4 = ".Container-module_container__d-oB8{margin-left:auto;margin-right:auto;max-width:var(--container-max-width,1280px);padding-left:var(--section-padding-x);padding-right:var(--section-padding-x);width:100%}.Container-module_narrow__mC8nM{max-width:768px}.Container-module_wide__kBARu{max-width:1536px}.Container-module_full__fv2YK{max-width:none}";
|
|
266
|
+
var styles$4 = {"container":"Container-module_container__d-oB8","narrow":"Container-module_narrow__mC8nM","wide":"Container-module_wide__kBARu","full":"Container-module_full__fv2YK"};
|
|
267
|
+
styleInject(css_248z$4);
|
|
270
268
|
|
|
271
269
|
// src/components/common/Container.jsx
|
|
272
270
|
const Container = ({
|
|
@@ -277,8 +275,8 @@ const Container = ({
|
|
|
277
275
|
as: Tag = "div",
|
|
278
276
|
...props
|
|
279
277
|
}) => {
|
|
280
|
-
const sizeClass = size === "narrow" ? styles$
|
|
281
|
-
const cls = [styles$
|
|
278
|
+
const sizeClass = size === "narrow" ? styles$4.narrow : size === "wide" ? styles$4.wide : size === "full" ? styles$4.full : "";
|
|
279
|
+
const cls = [styles$4.container, sizeClass, className ?? ""].filter(Boolean).join(" ");
|
|
282
280
|
return /*#__PURE__*/jsx(Tag, {
|
|
283
281
|
className: cls,
|
|
284
282
|
style: style,
|
|
@@ -287,9 +285,9 @@ const Container = ({
|
|
|
287
285
|
});
|
|
288
286
|
};
|
|
289
287
|
|
|
290
|
-
var css_248z$
|
|
291
|
-
var styles$
|
|
292
|
-
styleInject(css_248z$
|
|
288
|
+
var css_248z$3 = ".Section-module_section__fir88{background-color:var(--bg-color);padding-bottom:var(--section-padding-y);padding-top:var(--section-padding-y);width:100%}.Section-module_alternate__Y1rWg{background-color:var(--section-bg)}.Section-module_card__p-Uae{background-color:var(--card-bg);border:1px solid var(--border-color-light);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm)}.Section-module_tight__MBRrm{padding-bottom:calc(var(--section-padding-y)*.5);padding-top:calc(var(--section-padding-y)*.5)}.Section-module_flush__kPYbL{padding-bottom:0;padding-top:0}.Section-module_header__4Xl-D{margin-bottom:var(--space-8);text-align:center}.Section-module_title__XCRy8{color:var(--heading-color);font-size:clamp(var(--text-xl),4vw,var(--text-3xl));font-weight:700;line-height:1.2;margin-bottom:var(--space-3)}.Section-module_subtitle__qJc4y{color:var(--secondary-text-color);font-size:clamp(var(--text-sm),2vw,var(--text-base));margin-left:auto;margin-right:auto;max-width:640px}";
|
|
289
|
+
var styles$3 = {"section":"Section-module_section__fir88","alternate":"Section-module_alternate__Y1rWg","card":"Section-module_card__p-Uae","tight":"Section-module_tight__MBRrm","flush":"Section-module_flush__kPYbL","header":"Section-module_header__4Xl-D","title":"Section-module_title__XCRy8","subtitle":"Section-module_subtitle__qJc4y"};
|
|
290
|
+
styleInject(css_248z$3);
|
|
293
291
|
|
|
294
292
|
// src/components/common/Section.jsx
|
|
295
293
|
const Section = ({
|
|
@@ -304,9 +302,9 @@ const Section = ({
|
|
|
304
302
|
as: Tag = "section",
|
|
305
303
|
...props
|
|
306
304
|
}) => {
|
|
307
|
-
const variantClass = variant === "alternate" ? styles$
|
|
308
|
-
const paddingClass = padding === "tight" ? styles$
|
|
309
|
-
const cls = [styles$
|
|
305
|
+
const variantClass = variant === "alternate" ? styles$3.alternate : variant === "card" ? styles$3.card : "";
|
|
306
|
+
const paddingClass = padding === "tight" ? styles$3.tight : padding === "flush" ? styles$3.flush : "";
|
|
307
|
+
const cls = [styles$3.section, variantClass, paddingClass, className ?? ""].filter(Boolean).join(" ");
|
|
310
308
|
return /*#__PURE__*/jsx(Tag, {
|
|
311
309
|
className: cls,
|
|
312
310
|
style: style,
|
|
@@ -314,12 +312,12 @@ const Section = ({
|
|
|
314
312
|
children: /*#__PURE__*/jsxs(Container, {
|
|
315
313
|
size: containerSize,
|
|
316
314
|
children: [(title || subtitle) && /*#__PURE__*/jsxs("div", {
|
|
317
|
-
className: styles$
|
|
315
|
+
className: styles$3.header,
|
|
318
316
|
children: [title && /*#__PURE__*/jsx("h2", {
|
|
319
|
-
className: styles$
|
|
317
|
+
className: styles$3.title,
|
|
320
318
|
children: title
|
|
321
319
|
}), subtitle && /*#__PURE__*/jsx("p", {
|
|
322
|
-
className: styles$
|
|
320
|
+
className: styles$3.subtitle,
|
|
323
321
|
children: subtitle
|
|
324
322
|
})]
|
|
325
323
|
}), children]
|
|
@@ -327,9 +325,9 @@ const Section = ({
|
|
|
327
325
|
});
|
|
328
326
|
};
|
|
329
327
|
|
|
330
|
-
var css_248z$
|
|
331
|
-
var styles$
|
|
332
|
-
styleInject(css_248z$
|
|
328
|
+
var css_248z$2 = ".Modal-module_modalOverlay__ZH3r4{align-items:center;animation:Modal-module_fadeIn__qc5Zc .25s ease;background-color:rgba(0,0,0,.7);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:10000}.Modal-module_modalContent__qNq5W{animation:Modal-module_slideIn__1Jc8w .25s ease;background-color:var(--card-bg);border:1px solid var(--border-color-light);border-radius:var(--radius-md,8px);box-shadow:0 4px 20px var(--shadow-color,rgba(0,0,0,.2));max-height:90vh;overflow-y:auto;padding:clamp(16px,4vw,24px);position:relative;transition:background-color .3s ease;width:clamp(300px,90vw,480px)}@keyframes Modal-module_fadeIn__qc5Zc{0%{opacity:0}to{opacity:1}}@keyframes Modal-module_slideIn__1Jc8w{0%{opacity:0;transform:translateY(-12px)}to{opacity:1;transform:translateY(0)}}";
|
|
329
|
+
var styles$2 = {"modalOverlay":"Modal-module_modalOverlay__ZH3r4","modalContent":"Modal-module_modalContent__qNq5W"};
|
|
330
|
+
styleInject(css_248z$2);
|
|
333
331
|
|
|
334
332
|
const emptySubscribe = () => () => {};
|
|
335
333
|
const useIsMounted = () => useSyncExternalStore(emptySubscribe, () => true, () => false);
|
|
@@ -372,20 +370,20 @@ const Modal = ({
|
|
|
372
370
|
if (e.target === e.currentTarget) onClose();
|
|
373
371
|
};
|
|
374
372
|
return /*#__PURE__*/createPortal(/*#__PURE__*/jsx("div", {
|
|
375
|
-
className: styles$
|
|
373
|
+
className: styles$2.modalOverlay,
|
|
376
374
|
onClick: handleBackdropClick,
|
|
377
375
|
role: "dialog",
|
|
378
376
|
"aria-modal": "true",
|
|
379
377
|
children: /*#__PURE__*/jsx("div", {
|
|
380
|
-
className: `${styles$
|
|
378
|
+
className: `${styles$2.modalContent} ${className ?? ""}`,
|
|
381
379
|
children: children
|
|
382
380
|
})
|
|
383
381
|
}), document.body);
|
|
384
382
|
};
|
|
385
383
|
|
|
386
|
-
var css_248z = ".ProgressBar-module_wrapper__Sbkwa{display:flex;flex-direction:column;gap:4px;width:100%}.ProgressBar-module_track__-FjJA{background-color:var(--progress-bg,rgba(0,0,0,.1));border-radius:var(--radius-full,9999px);overflow:hidden;width:100%}.ProgressBar-module_bar__zrEy7{background:var(--primary-color,#007bff);border-radius:var(--radius-full,9999px);height:100%;transition:width 0ms}.ProgressBar-module_label__RpKiv{color:var(--secondary-text-color);font-size:var(--text-xs,11px);text-align:right}";
|
|
387
|
-
var styles = {"wrapper":"ProgressBar-module_wrapper__Sbkwa","track":"ProgressBar-module_track__-FjJA","bar":"ProgressBar-module_bar__zrEy7","label":"ProgressBar-module_label__RpKiv"};
|
|
388
|
-
styleInject(css_248z);
|
|
384
|
+
var css_248z$1 = ".ProgressBar-module_wrapper__Sbkwa{display:flex;flex-direction:column;gap:4px;width:100%}.ProgressBar-module_track__-FjJA{background-color:var(--progress-bg,rgba(0,0,0,.1));border-radius:var(--radius-full,9999px);overflow:hidden;width:100%}.ProgressBar-module_bar__zrEy7{background:var(--primary-color,#007bff);border-radius:var(--radius-full,9999px);height:100%;transition:width 0ms}.ProgressBar-module_label__RpKiv{color:var(--secondary-text-color);font-size:var(--text-xs,11px);text-align:right}";
|
|
385
|
+
var styles$1 = {"wrapper":"ProgressBar-module_wrapper__Sbkwa","track":"ProgressBar-module_track__-FjJA","bar":"ProgressBar-module_bar__zrEy7","label":"ProgressBar-module_label__RpKiv"};
|
|
386
|
+
styleInject(css_248z$1);
|
|
389
387
|
|
|
390
388
|
const ProgressBar = ({
|
|
391
389
|
progress = 0,
|
|
@@ -446,30 +444,30 @@ const ProgressBar = ({
|
|
|
446
444
|
const clampedProgress = Math.max(0, Math.min(100, animate ? animatedProgress : progress));
|
|
447
445
|
const label = `${Math.round(clampedProgress)}%`;
|
|
448
446
|
return /*#__PURE__*/jsxs("div", {
|
|
449
|
-
className: `${styles.wrapper} ${className}`,
|
|
447
|
+
className: `${styles$1.wrapper} ${className}`,
|
|
450
448
|
style: style,
|
|
451
449
|
role: "progressbar",
|
|
452
450
|
"aria-valuenow": Math.round(clampedProgress),
|
|
453
451
|
"aria-valuemin": 0,
|
|
454
452
|
"aria-valuemax": 100,
|
|
455
453
|
children: [showLabel && labelPosition === "top" && /*#__PURE__*/jsx("span", {
|
|
456
|
-
className: styles.label,
|
|
454
|
+
className: styles$1.label,
|
|
457
455
|
children: label
|
|
458
456
|
}), /*#__PURE__*/jsx("div", {
|
|
459
|
-
className: styles.track,
|
|
457
|
+
className: styles$1.track,
|
|
460
458
|
style: {
|
|
461
459
|
height,
|
|
462
460
|
backgroundColor
|
|
463
461
|
},
|
|
464
462
|
children: /*#__PURE__*/jsx("div", {
|
|
465
|
-
className: styles.bar,
|
|
463
|
+
className: styles$1.bar,
|
|
466
464
|
style: {
|
|
467
465
|
width: `${clampedProgress}%`,
|
|
468
466
|
background: color
|
|
469
467
|
}
|
|
470
468
|
})
|
|
471
469
|
}), showLabel && labelPosition === "bottom" && /*#__PURE__*/jsx("span", {
|
|
472
|
-
className: styles.label,
|
|
470
|
+
className: styles$1.label,
|
|
473
471
|
children: label
|
|
474
472
|
})]
|
|
475
473
|
});
|
|
@@ -483,29 +481,36 @@ const ThemeProvider = ({
|
|
|
483
481
|
const [theme, setTheme] = useState("light"); // SSR fallback
|
|
484
482
|
|
|
485
483
|
// Step 1: On mount, load theme from localStorage. Default = dark.
|
|
484
|
+
// Defer state updates so this effect is not classified as synchronous setState-in-effect (react-hooks/set-state-in-effect).
|
|
486
485
|
useEffect(() => {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
486
|
+
let cancelled = false;
|
|
487
|
+
const mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
488
|
+
const onSystemChange = e => {
|
|
489
|
+
if (!localStorage.getItem("theme")) {
|
|
490
|
+
const sys = e.matches ? "dark" : "light";
|
|
491
|
+
setTheme(sys);
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
queueMicrotask(() => {
|
|
495
|
+
if (cancelled) return;
|
|
496
|
+
try {
|
|
497
|
+
const saved = localStorage.getItem("theme");
|
|
498
|
+
const resolved = saved ?? "dark"; // First visit = dark
|
|
499
|
+
setTheme(resolved);
|
|
500
|
+
document.documentElement.setAttribute("data-theme", resolved);
|
|
501
|
+
mq.addEventListener("change", onSystemChange);
|
|
502
|
+
setMounted(true);
|
|
503
|
+
} catch {
|
|
504
|
+
if (cancelled) return;
|
|
505
|
+
setTheme("dark");
|
|
506
|
+
document.documentElement.setAttribute("data-theme", "dark");
|
|
507
|
+
setMounted(true);
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
return () => {
|
|
511
|
+
cancelled = true;
|
|
512
|
+
mq.removeEventListener("change", onSystemChange);
|
|
513
|
+
};
|
|
509
514
|
}, []);
|
|
510
515
|
|
|
511
516
|
// Step 2: Apply theme with smooth transition class
|
|
@@ -552,4 +557,27 @@ const useTheme = () => {
|
|
|
552
557
|
return ctx;
|
|
553
558
|
};
|
|
554
559
|
|
|
555
|
-
|
|
560
|
+
var css_248z = ".Layout-module_wrapper__NiDzy{display:flex;flex-direction:column;min-height:100vh}.Layout-module_content__JaQFC{flex:1 0 auto;margin-top:clamp(48px,10vw,64px)}.Layout-module_main__cP0Rc{width:100%}.Layout-module_footerWrapper__oYfqA{flex-shrink:0}";
|
|
561
|
+
var styles = {"wrapper":"Layout-module_wrapper__NiDzy","content":"Layout-module_content__JaQFC","main":"Layout-module_main__cP0Rc","footerWrapper":"Layout-module_footerWrapper__oYfqA"};
|
|
562
|
+
styleInject(css_248z);
|
|
563
|
+
|
|
564
|
+
// src/layouts/Layout.jsx
|
|
565
|
+
const Layout = ({
|
|
566
|
+
children
|
|
567
|
+
}) => {
|
|
568
|
+
return /*#__PURE__*/jsxs("div", {
|
|
569
|
+
className: styles.wrapper,
|
|
570
|
+
children: [/*#__PURE__*/jsx(Navbar, {}), /*#__PURE__*/jsx("div", {
|
|
571
|
+
className: styles.content,
|
|
572
|
+
children: /*#__PURE__*/jsx("main", {
|
|
573
|
+
className: styles.main,
|
|
574
|
+
children: children
|
|
575
|
+
})
|
|
576
|
+
}), /*#__PURE__*/jsx("div", {
|
|
577
|
+
className: styles.footerWrapper,
|
|
578
|
+
children: /*#__PURE__*/jsx(Footer, {})
|
|
579
|
+
})]
|
|
580
|
+
});
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
export { Button, Container, FaArrowDown, FaArrowUp, FavoriteHeartButton, Footer, HeartIcon, Layout, Modal, Navbar, ProgressBar, ScrollButton, Section, SubNavbar, ThemeProvider, ThreeDotButton, useTheme };
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanvika/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
|
-
"description": "Sanvika Production — shared UI component library for 50+ projects
|
|
6
|
+
"description": "Sanvika Production — shared UI component library for 50+ projects (pure JS, CSS Modules, props-driven) + cloud-driven Navbar/Theme presets via ui.sanvikaproduction.com",
|
|
7
7
|
"author": "Shyam Bharteey <shyam@sanvikaproduction.com>",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"repository": {
|
|
@@ -18,46 +18,32 @@
|
|
|
18
18
|
"sanvika",
|
|
19
19
|
"classified-ads"
|
|
20
20
|
],
|
|
21
|
-
"main": "./
|
|
22
|
-
"module": "./
|
|
21
|
+
"main": "./src/index.js",
|
|
22
|
+
"module": "./src/index.js",
|
|
23
23
|
"exports": {
|
|
24
|
-
".": "./
|
|
25
|
-
"./icons": "./
|
|
26
|
-
"./styles": "./src/styles/index.css"
|
|
24
|
+
".": "./src/index.js",
|
|
25
|
+
"./icons": "./src/components/icons/index.js",
|
|
26
|
+
"./styles": "./src/styles/index.css",
|
|
27
|
+
"./server": "./src/server/index.js"
|
|
27
28
|
},
|
|
28
29
|
"files": [
|
|
29
30
|
"dist",
|
|
30
|
-
"src
|
|
31
|
+
"src"
|
|
31
32
|
],
|
|
32
33
|
"peerDependencies": {
|
|
33
34
|
"react": ">=18.0.0",
|
|
34
35
|
"react-dom": ">=18.0.0"
|
|
35
36
|
},
|
|
36
|
-
"scripts": {
|
|
37
|
-
"build": "rollup -c rollup.config.js",
|
|
38
|
-
"prepublishOnly": "npm run build",
|
|
39
|
-
"storybook": "storybook dev -p 6006",
|
|
40
|
-
"build-storybook": "storybook build"
|
|
41
|
-
},
|
|
42
|
-
"pnpm": {
|
|
43
|
-
"onlyBuiltDependencies": [
|
|
44
|
-
"core-js-pure",
|
|
45
|
-
"esbuild"
|
|
46
|
-
]
|
|
47
|
-
},
|
|
48
37
|
"devDependencies": {
|
|
49
38
|
"@babel/core": "^7.29.0",
|
|
50
39
|
"@babel/preset-react": "^7.28.5",
|
|
51
40
|
"@rollup/plugin-babel": "^7.0.0",
|
|
52
41
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
53
|
-
"@storybook/nextjs": "^10.3.2",
|
|
54
|
-
"eslint": "^9",
|
|
55
|
-
"eslint-config-next": "16.2.2",
|
|
56
|
-
"next": "16.2.2",
|
|
57
|
-
"react": "19.2.4",
|
|
58
|
-
"react-dom": "19.2.4",
|
|
59
42
|
"rollup": "^4.60.1",
|
|
60
|
-
"rollup-plugin-postcss": "^4.0.2"
|
|
61
|
-
|
|
43
|
+
"rollup-plugin-postcss": "^4.0.2"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "rollup -c rollup.config.js",
|
|
47
|
+
"build:lib": "rollup -c rollup.config.js"
|
|
62
48
|
}
|
|
63
|
-
}
|
|
49
|
+
}
|