@swan-admin/swan-web-component 1.0.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.
package/dist/index.css ADDED
@@ -0,0 +1,3 @@
1
+ @layer properties;.visible{visibility:visible}.mx-auto{margin-inline:auto}.my-\[1\.5rem\]{margin-block:1.5rem}.mt-\[\.5rem\]{margin-top:.5rem}.mt-\[0\.2rem\]{margin-top:.2rem}.mt-\[3\.5rem\]{margin-top:3.5rem}.mb-\[\.75rem\]{margin-bottom:.75rem}.flex{display:flex}.h-\[3px\]{height:3px}.h-\[38px\]{height:38px}.h-\[40px\]{height:40px}.h-full{height:100%}.w-\[30px\]{width:30px}.w-\[50px\]{width:50px}.w-full{width:100%}.max-w-\[28rem\]{max-width:28rem}.max-w-\[210px\]{max-width:210px}.max-w-\[276px\]{max-width:276px}.min-w-\[120px\]{min-width:120px}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-\[4px\]{gap:4px}.gap-\[5px\]{gap:5px}.rounded-\[4px\]{border-radius:4px}.rounded-\[8px\]{border-radius:8px}.rounded-full{border-radius:calc(infinity * 1px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-none{--tw-border-style: none;border-style:none}.border-transparent{border-color:transparent}.p-\[15px\]{padding:15px}.px-\[\.75rem\]{padding-inline:.75rem}.py-\[6px\]{padding-block:6px}.pt-\[1\.5rem\]{padding-top:1.5rem}.pr-\[2\.5rem\]{padding-right:2.5rem}.pl-\[1rem\]{padding-left:1rem}.text-center{text-align:center}.text-\[14px\]{font-size:14px}.text-\[16px\]{font-size:16px}.text-\[18px\]{font-size:18px}.leading-none{--tw-leading: 1;line-height:1}.\!shadow-none{--tw-shadow: 0 0 #0000 !important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.shadow-\[0_1px_1px_rgba\(0\,0\,0\,0\.251\)\]{--tw-shadow: 0 1px 1px var(--tw-shadow-color, rgba(0,0,0,.251));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease, ease);transition-duration:var(--tw-duration, 0s)}.duration-200{--tw-duration: .2s;transition-duration:.2s}.duration-300{--tw-duration: .3s;transition-duration:.3s}.\!outline-none{--tw-outline-style: none !important;outline-style:none!important}.file\:border-0{&::file-selector-button{border-style:var(--tw-border-style);border-width:0px}}.file\:bg-transparent{&::file-selector-button{background-color:transparent}}.focus\:ring-1{&:focus{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:outline-none{&:focus{--tw-outline-style: none;outline-style:none}}.focus-visible\:ring-2{&:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus-visible\:ring-offset-2{&:focus-visible{--tw-ring-offset-width: 2px;--tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}}.focus-visible\:outline-none{&:focus-visible{--tw-outline-style: none;outline-style:none}}.disabled\:cursor-not-allowed{&:disabled{cursor:not-allowed}}.disabled\:shadow-none{&:disabled{--tw-shadow: 0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.\[\&_svg\]\:shrink-0{& svg{flex-shrink:0}}html,body,#root{height:100%;width:100%;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}*{box-sizing:border-box}@import url(https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap);@import url(https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap);@font-face{font-family:SeriouslyNostalgic Fn;src:url("./SeriouslyNostalgicFn-SemiCond-AJHVASLK.eot");src:url("./SeriouslyNostalgicFn-SemiCond-AJHVASLK.eot?#iefix") format("embedded-opentype"),url("./SeriouslyNostalgicFn-SemiCond-IFFRICVL.woff2") format("woff2"),url("./SeriouslyNostalgicFn-SemiCond-Z3GGXSY5.woff") format("woff"),url("./SeriouslyNostalgicFn-SemiCond-SHCMZABI.ttf") format("truetype"),url("./SeriouslyNostalgicFn-SemiCond-XYHOCG7O.svg#SeriouslyNostalgicFn-SemiCond") format("svg");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:SeriouslyNostalgic Fn;src:url("./SeriouslyNostalgicFnIt-SmCn-SL36MC4T.eot");src:url("./SeriouslyNostalgicFnIt-SmCn-SL36MC4T.eot?#iefix") format("embedded-opentype"),url("./SeriouslyNostalgicFnIt-SmCn-7R3OSECA.woff2") format("woff2"),url("./SeriouslyNostalgicFnIt-SmCn-XCIR2AMB.woff") format("woff"),url("./SeriouslyNostalgicFnIt-SmCn-5X45YSDH.ttf") format("truetype"),url("./SeriouslyNostalgicFnIt-SmCn-IHWOZCJM.svg#SeriouslyNostalgicFnIt-SmCn") format("svg");font-weight:400;font-style:italic;font-display:swap}@font-face{font-family:Switzer;src:url("./Switzer-Regular-Y4FID5TH.eot");src:url("./Switzer-Regular-Y4FID5TH.eot?#iefix") format("embedded-opentype"),url("./Switzer-Regular-HQV7EZCN.woff2") format("woff2"),url("./Switzer-Regular-PMUXPWI5.woff") format("woff"),url("./Switzer-Regular-ZQ4EHIY6.ttf") format("truetype"),url("./Switzer-Regular-FYQK3A2R.svg#Switzer-Regular") format("svg");font-weight:400;font-style:normal;font-display:swap}h1,h2,h3,h4,p{margin:0;padding:0;line-height:1.5}@property --tw-border-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-leading{syntax: "*"; inherits: false;}@property --tw-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: "*"; inherits: false;}@property --tw-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: "*"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: "*"; inherits: false;}@property --tw-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: "*"; inherits: false;}@property --tw-inset-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: "*"; inherits: false;}@property --tw-ring-offset-width{syntax: "<length>"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: "*"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-duration{syntax: "*"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-leading: initial;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-duration: initial}}}
2
+ /*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */
3
+ /*# sourceMappingURL=index.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/styles/tailwind.css"],"sourcesContent":["/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */\n@layer properties;\n.visible {\n visibility: visible;\n}\n.mx-auto {\n margin-inline: auto;\n}\n.my-\\[1\\.5rem\\] {\n margin-block: 1.5rem;\n}\n.mt-\\[\\.5rem\\] {\n margin-top: .5rem;\n}\n.mt-\\[0\\.2rem\\] {\n margin-top: 0.2rem;\n}\n.mt-\\[3\\.5rem\\] {\n margin-top: 3.5rem;\n}\n.mb-\\[\\.75rem\\] {\n margin-bottom: .75rem;\n}\n.flex {\n display: flex;\n}\n.h-\\[3px\\] {\n height: 3px;\n}\n.h-\\[38px\\] {\n height: 38px;\n}\n.h-\\[40px\\] {\n height: 40px;\n}\n.h-full {\n height: 100%;\n}\n.w-\\[30px\\] {\n width: 30px;\n}\n.w-\\[50px\\] {\n width: 50px;\n}\n.w-full {\n width: 100%;\n}\n.max-w-\\[28rem\\] {\n max-width: 28rem;\n}\n.max-w-\\[210px\\] {\n max-width: 210px;\n}\n.max-w-\\[276px\\] {\n max-width: 276px;\n}\n.min-w-\\[120px\\] {\n min-width: 120px;\n}\n.cursor-pointer {\n cursor: pointer;\n}\n.flex-col {\n flex-direction: column;\n}\n.items-center {\n align-items: center;\n}\n.items-start {\n align-items: flex-start;\n}\n.justify-center {\n justify-content: center;\n}\n.justify-end {\n justify-content: flex-end;\n}\n.gap-\\[4px\\] {\n gap: 4px;\n}\n.gap-\\[5px\\] {\n gap: 5px;\n}\n.rounded-\\[4px\\] {\n border-radius: 4px;\n}\n.rounded-\\[8px\\] {\n border-radius: 8px;\n}\n.rounded-full {\n border-radius: calc(infinity * 1px);\n}\n.border {\n border-style: var(--tw-border-style);\n border-width: 1px;\n}\n.border-none {\n --tw-border-style: none;\n border-style: none;\n}\n.border-transparent {\n border-color: transparent;\n}\n.p-\\[15px\\] {\n padding: 15px;\n}\n.px-\\[\\.75rem\\] {\n padding-inline: .75rem;\n}\n.py-\\[6px\\] {\n padding-block: 6px;\n}\n.pt-\\[1\\.5rem\\] {\n padding-top: 1.5rem;\n}\n.pr-\\[2\\.5rem\\] {\n padding-right: 2.5rem;\n}\n.pl-\\[1rem\\] {\n padding-left: 1rem;\n}\n.text-center {\n text-align: center;\n}\n.text-\\[14px\\] {\n font-size: 14px;\n}\n.text-\\[16px\\] {\n font-size: 16px;\n}\n.text-\\[18px\\] {\n font-size: 18px;\n}\n.leading-none {\n --tw-leading: 1;\n line-height: 1;\n}\n.\\!shadow-none {\n --tw-shadow: 0 0 #0000 !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n}\n.shadow-\\[0_1px_1px_rgba\\(0\\,0\\,0\\,0\\.251\\)\\] {\n --tw-shadow: 0 1px 1px var(--tw-shadow-color, rgba(0,0,0,0.251));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n}\n.ring {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n}\n.transition-all {\n transition-property: all;\n transition-timing-function: var(--tw-ease, ease);\n transition-duration: var(--tw-duration, 0s);\n}\n.duration-200 {\n --tw-duration: 200ms;\n transition-duration: 200ms;\n}\n.duration-300 {\n --tw-duration: 300ms;\n transition-duration: 300ms;\n}\n.\\!outline-none {\n --tw-outline-style: none !important;\n outline-style: none !important;\n}\n.file\\:border-0 {\n &::file-selector-button {\n border-style: var(--tw-border-style);\n border-width: 0px;\n }\n}\n.file\\:bg-transparent {\n &::file-selector-button {\n background-color: transparent;\n }\n}\n.focus\\:ring-1 {\n &:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n}\n.focus\\:outline-none {\n &:focus {\n --tw-outline-style: none;\n outline-style: none;\n }\n}\n.focus-visible\\:ring-2 {\n &:focus-visible {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n}\n.focus-visible\\:ring-offset-2 {\n &:focus-visible {\n --tw-ring-offset-width: 2px;\n --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n }\n}\n.focus-visible\\:outline-none {\n &:focus-visible {\n --tw-outline-style: none;\n outline-style: none;\n }\n}\n.disabled\\:cursor-not-allowed {\n &:disabled {\n cursor: not-allowed;\n }\n}\n.disabled\\:shadow-none {\n &:disabled {\n --tw-shadow: 0 0 #0000;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n}\n.\\[\\&_svg\\]\\:shrink-0 {\n & svg {\n flex-shrink: 0;\n }\n}\nhtml, body, #root {\n height: 100%;\n width: 100%;\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n}\n* {\n box-sizing: border-box;\n}\n@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');\n@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');\n@font-face {\n font-family: 'SeriouslyNostalgic Fn';\n src: url('fonts/SeriouslyNostalgicFn-SemiCond.eot');\n src: url('fonts/SeriouslyNostalgicFn-SemiCond.eot?#iefix') format('embedded-opentype'),\n url('fonts/SeriouslyNostalgicFn-SemiCond.woff2') format('woff2'),\n url('fonts/SeriouslyNostalgicFn-SemiCond.woff') format('woff'),\n url('fonts/SeriouslyNostalgicFn-SemiCond.ttf') format('truetype'),\n url('fonts/SeriouslyNostalgicFn-SemiCond.svg#SeriouslyNostalgicFn-SemiCond') format('svg');\n font-weight: normal;\n font-style: normal;\n font-display: swap;\n}\n@font-face {\n font-family: 'SeriouslyNostalgic Fn';\n src: url('fonts/SeriouslyNostalgicFnIt-SmCn.eot');\n src: url('fonts/SeriouslyNostalgicFnIt-SmCn.eot?#iefix') format('embedded-opentype'),\n url('fonts/SeriouslyNostalgicFnIt-SmCn.woff2') format('woff2'),\n url('fonts/SeriouslyNostalgicFnIt-SmCn.woff') format('woff'),\n url('fonts/SeriouslyNostalgicFnIt-SmCn.ttf') format('truetype'),\n url('fonts/SeriouslyNostalgicFnIt-SmCn.svg#SeriouslyNostalgicFnIt-SmCn') format('svg');\n font-weight: normal;\n font-style: italic;\n font-display: swap;\n}\n@font-face {\n font-family: 'Switzer';\n src: url('fonts/Switzer-Regular.eot');\n src: url('fonts/Switzer-Regular.eot?#iefix') format('embedded-opentype'),\n url('fonts/Switzer-Regular.woff2') format('woff2'),\n url('fonts/Switzer-Regular.woff') format('woff'),\n url('fonts/Switzer-Regular.ttf') format('truetype'),\n url('fonts/Switzer-Regular.svg#Switzer-Regular') format('svg');\n font-weight: normal;\n font-style: normal;\n font-display: swap;\n}\nh1,h2,h3,h4,p {\n margin: 0;\n padding: 0;\n line-height: 1.5;\n}\n@property --tw-border-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-leading {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-inset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-ring-inset {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-offset-width {\n syntax: \"<length>\";\n inherits: false;\n initial-value: 0px;\n}\n@property --tw-ring-offset-color {\n syntax: \"*\";\n inherits: false;\n initial-value: #fff;\n}\n@property --tw-ring-offset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-duration {\n syntax: \"*\";\n inherits: false;\n}\n@layer properties {\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n *, ::before, ::after, ::backdrop {\n --tw-border-style: solid;\n --tw-leading: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-duration: initial;\n }\n }\n}\n"],"mappings":"AACA,kBACA,CAAC,QACC,WAAY,OACd,CACA,CAAC,QACC,cAAe,IACjB,CACA,CAAC,eACC,aAAc,MAChB,CACA,CAAC,cACC,WAAY,KACd,CACA,CAAC,eACC,WAAY,KACd,CACA,CAAC,eACC,WAAY,MACd,CACA,CAAC,eACC,cAAe,MACjB,CACA,CAAC,KACC,QAAS,IACX,CACA,CAAC,UACC,OAAQ,GACV,CACA,CAAC,WACC,OAAQ,IACV,CACA,CAAC,WACC,OAAQ,IACV,CACA,CAAC,OACC,OAAQ,IACV,CACA,CAAC,WACC,MAAO,IACT,CACA,CAAC,WACC,MAAO,IACT,CACA,CAAC,OACC,MAAO,IACT,CACA,CAAC,gBACC,UAAW,KACb,CACA,CAAC,gBACC,UAAW,KACb,CACA,CAAC,gBACC,UAAW,KACb,CACA,CAAC,gBACC,UAAW,KACb,CACA,CAAC,eACC,OAAQ,OACV,CACA,CAAC,SACC,eAAgB,MAClB,CACA,CAAC,aACC,YAAa,MACf,CACA,CAAC,YACC,YAAa,UACf,CACA,CAAC,eACC,gBAAiB,MACnB,CACA,CAAC,YACC,gBAAiB,QACnB,CACA,CAAC,YACC,IAAK,GACP,CACA,CAAC,YACC,IAAK,GACP,CACA,CAAC,gBAnFD,cAoFiB,GACjB,CACA,CAAC,gBAtFD,cAuFiB,GACjB,CACA,CAAC,aACC,cAAe,KAAK,SAAS,EAAE,IACjC,CACA,CAAC,OACC,aAAc,IAAI,mBAClB,aAAc,GAChB,CACA,CAAC,YACC,mBAAmB,KACnB,aAAc,IAChB,CACA,CAAC,mBACC,aAAc,WAChB,CACA,CAAC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wBAAwB,KACxB,yBAAyB,EAAE,EAAE,MAC7B,eAAe,OACjB,CACF,CACF","names":[]}
@@ -0,0 +1,67 @@
1
+ import React from 'react';
2
+
3
+ interface Step {
4
+ type: StepType;
5
+ value?: any;
6
+ order?: number;
7
+ isVisible?: boolean;
8
+ onStepComplete?: (value: any) => void;
9
+ }
10
+ type StepType = "email" | "name" | "height" | "gender" | "focalLength";
11
+ interface StyleConfig {
12
+ base?: {
13
+ brandColor?: string;
14
+ backgroundColor?: string;
15
+ primaryColor?: string;
16
+ secondaryColor?: string;
17
+ baseTextColor?: string;
18
+ baseFontSize?: string;
19
+ baseFontFamily?: string;
20
+ };
21
+ logo?: {
22
+ logoWidth?: string;
23
+ logoHeight?: string;
24
+ };
25
+ heading?: {
26
+ headingColor?: string;
27
+ headingFontSize?: string;
28
+ headingFontWeight?: string;
29
+ headingFontFamily?: string;
30
+ };
31
+ button?: {
32
+ buttonBackground?: string;
33
+ buttonDisabledBackground?: string;
34
+ buttonDisabledTextColor?: string;
35
+ buttonTextColor?: string;
36
+ buttonFontSize?: string;
37
+ buttonFontFamily?: string;
38
+ };
39
+ input?: {
40
+ inputBackgroundColor?: string;
41
+ inputTextColor?: string;
42
+ inputPlaceholderColor?: string;
43
+ inputBorderColor?: string;
44
+ inputFontSize?: string;
45
+ inputFontWeight?: string;
46
+ };
47
+ }
48
+ interface OnboardingProps {
49
+ steps: Step[];
50
+ config?: Config;
51
+ onComplete?: (values: Record<string, any>) => void;
52
+ }
53
+ interface Config {
54
+ style?: StyleConfig;
55
+ logo?: string;
56
+ loader?: string;
57
+ }
58
+
59
+ declare const Onboarding: React.FC<OnboardingProps>;
60
+
61
+ /**
62
+ * Ensures default style values are available even when config or nested properties are missing.
63
+ * Merges deeply and memoizes the result for consistent performance.
64
+ */
65
+ declare const useLocalConfig: (config?: Config) => Required<Config>;
66
+
67
+ export { Onboarding, type OnboardingProps, useLocalConfig };
@@ -0,0 +1,67 @@
1
+ import React from 'react';
2
+
3
+ interface Step {
4
+ type: StepType;
5
+ value?: any;
6
+ order?: number;
7
+ isVisible?: boolean;
8
+ onStepComplete?: (value: any) => void;
9
+ }
10
+ type StepType = "email" | "name" | "height" | "gender" | "focalLength";
11
+ interface StyleConfig {
12
+ base?: {
13
+ brandColor?: string;
14
+ backgroundColor?: string;
15
+ primaryColor?: string;
16
+ secondaryColor?: string;
17
+ baseTextColor?: string;
18
+ baseFontSize?: string;
19
+ baseFontFamily?: string;
20
+ };
21
+ logo?: {
22
+ logoWidth?: string;
23
+ logoHeight?: string;
24
+ };
25
+ heading?: {
26
+ headingColor?: string;
27
+ headingFontSize?: string;
28
+ headingFontWeight?: string;
29
+ headingFontFamily?: string;
30
+ };
31
+ button?: {
32
+ buttonBackground?: string;
33
+ buttonDisabledBackground?: string;
34
+ buttonDisabledTextColor?: string;
35
+ buttonTextColor?: string;
36
+ buttonFontSize?: string;
37
+ buttonFontFamily?: string;
38
+ };
39
+ input?: {
40
+ inputBackgroundColor?: string;
41
+ inputTextColor?: string;
42
+ inputPlaceholderColor?: string;
43
+ inputBorderColor?: string;
44
+ inputFontSize?: string;
45
+ inputFontWeight?: string;
46
+ };
47
+ }
48
+ interface OnboardingProps {
49
+ steps: Step[];
50
+ config?: Config;
51
+ onComplete?: (values: Record<string, any>) => void;
52
+ }
53
+ interface Config {
54
+ style?: StyleConfig;
55
+ logo?: string;
56
+ loader?: string;
57
+ }
58
+
59
+ declare const Onboarding: React.FC<OnboardingProps>;
60
+
61
+ /**
62
+ * Ensures default style values are available even when config or nested properties are missing.
63
+ * Merges deeply and memoizes the result for consistent performance.
64
+ */
65
+ declare const useLocalConfig: (config?: Config) => Required<Config>;
66
+
67
+ export { Onboarding, type OnboardingProps, useLocalConfig };
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ 'use strict';var T=require('react'),lucideReact=require('lucide-react'),jsxRuntime=require('react/jsx-runtime');require('tailwind-merge'),require('clsx');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var T__namespace=/*#__PURE__*/_interopNamespace(T);var N=n=>{let e={logo:"../swan-logo-black-icon.svg",loader:"../loader-black.gif",style:{base:{brandColor:"#5932F3",backgroundColor:"#FFFFFF",primaryColor:"#000000",secondaryColor:"#D9D9D9",baseTextColor:"#1E1E1E",baseFontSize:"16px",baseFontFamily:"'Inter', sans-serif"},logo:{logoWidth:"30px",logoHeight:"30px"},heading:{headingColor:"#000000",headingFontSize:"32px",headingFontWeight:"normal",headingFontFamily:"'SeriouslyNostalgic Fn', serif"},button:{buttonBackground:"#220B12",buttonFontSize:"14px",buttonFontFamily:"'Inter', sans-serif",buttonDisabledBackground:"#D9D9D9",buttonDisabledTextColor:"#000000",buttonTextColor:"#FFFFFF"},input:{inputBackgroundColor:"#F9FAFC",inputTextColor:"#000000",inputPlaceholderColor:"#000000",inputBorderColor:"#F9FAFC",inputFontSize:"14px",inputFontWeight:"500"}}};return T.useMemo(()=>({logo:n?.logo??e.logo,loader:n?.loader??e.loader,style:{...e.style,...n?.style||{}}}),[n])};var J=(...n)=>n.filter(Boolean).join(" "),E=T__namespace.forwardRef(({className:n,resolvedConfig:e,type:o,...t},i)=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("input",{type:o,className:`${n||""} customInput `+J("flex w-full border-none px-[.75rem] h-[40px] text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed backdrop-blur-sm bg-btn font-medium rounded-[4px] pl-[1rem] pr-[2.5rem] focus:ring-1 focus:outline-none transition-all duration-200"),autoCapitalize:"off",autoCorrect:"off",ref:i,...t,style:{background:e?.style?.input?.inputBackgroundColor||"#F9FAFC",color:e?.style?.input?.inputTextColor||"#000",fontSize:e?.style?.input?.inputFontSize||"16px",fontWeight:e?.style?.input?.inputFontWeight||"400",border:`1px solid ${e?.style?.input?.inputBorderColor||"#D9D9D9"}`,fontFamily:e?.style?.base?.baseFontFamily||"Inter, sans-serif"}}),jsxRuntime.jsx("style",{children:`
2
+ .customInput::placeholder {
3
+ color: ${e?.style?.input?.inputPlaceholderColor||"#A0A0A0"};
4
+ font-weight: ${e?.style?.input?.inputPlaceholderFontWeight||"400"};
5
+ opacity: 1;
6
+ }
7
+ `})]}));E.displayName="CustomInput";var c=E;var X=({buttonFunc:n,prefix:e,postfixIcon:o,className:t="",buttonText:i,btnSecondary:s,loading:r=false,disabled:a=false,type:p="button",id:d="button",resolvedConfig:l,...x})=>jsxRuntime.jsxs("button",{...x,id:d,type:p,disabled:a,onClick:n,className:`${t} flex gap-[5px] border-none cursor-pointer items-center shadow-[0_1px_1px_rgba(0,0,0,0.251)] justify-center [&_svg]:size-4 [&_svg]:shrink-0 rounded-full min-w-[120px] text-[14px] px-6 disabled:shadow-none py-[6px]`,style:{fontFamily:l?.style?.button?.buttonFontFamily||"Inter, sans-serif",fontSize:l?.style?.button?.buttonFontSize||"22px",background:a?l?.style?.button?.buttonDisabledBackground:l?.style?.button?.buttonBackground||"#000",color:a?l?.style?.button?.buttonDisabledTextColor:l?.style?.button?.buttonTextColor||"#fff",fontWeight:l?.style?.button?.headingFontWeight||"normal",pointerEvents:a?"none":"auto"},children:[e&&jsxRuntime.jsx("img",{src:e,alt:"icon"}),i,o&&o]}),g=X;var ot=({onComplete:n,initialValue:e,resolvedConfig:o})=>{let[t,i]=T__namespace.default.useState(e||""),[s,r]=T__namespace.default.useState(void 0);return jsxRuntime.jsx("div",{className:"w-full max-w-md",children:jsxRuntime.jsxs("form",{onSubmit:()=>{if(t.trim())n?.(t);else {r("Name is required.");return}},className:"mt-[3.5rem] mb-[.75rem]",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(c,{required:true,type:"text",id:"name",placeholder:"Enter your name",resolvedConfig:o,onChange:p=>{i(p.target.value);}}),s&&jsxRuntime.jsx("p",{className:"mt-[0.2rem] text-[16px]",children:s})]}),jsxRuntime.jsx("div",{className:"flex justify-end mt-[.5rem]",children:jsxRuntime.jsx(g,{resolvedConfig:o,buttonText:"Next",btnSecondary:true,type:"submit",postfixIcon:jsxRuntime.jsx(lucideReact.ArrowRight,{size:14})})})]})})},M=ot;var H=n=>{if(!n.length)throw new Error("\u274C Onboarding requires at least one step.");let o=["name","email","height","gender","focalLength"].filter(r=>!n.some(a=>a.type===r));if(o.length>0)throw new Error(`\u274C Missing required steps: ${o.join(", ")}`);let t=n.filter(r=>r.isVisible!==false),i=t.filter(r=>typeof r.order=="number"),s=t.filter(r=>typeof r.order!="number");return [...i.sort((r,a)=>r.order-a.order),...s]},B=n=>/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n);function k(n,e){let o=(n&&+n*30.48)??0,t=(e&&+e*2.54)??0;return o+t}var rt=({onComplete:n,initialValue:e,resolvedConfig:o})=>{let[t,i]=T__namespace.default.useState(e||""),[s,r]=T__namespace.default.useState(void 0);return jsxRuntime.jsx("div",{className:"w-full max-w-md",children:jsxRuntime.jsxs("form",{className:"mt-[3.5rem] mb-[.75rem]",onSubmit:()=>{if(t.trim())B(t.trim())?n?.(t):r("Please enter a valid email address.");else {r("Email is required.");return}},children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(c,{required:true,type:"text",id:"name",placeholder:"Enter your email",resolvedConfig:o,value:t,onChange:p=>{r(void 0),i(p.target.value);}}),s&&jsxRuntime.jsx("p",{className:"mt-[0.2rem] text-[16px]",children:s})]}),jsxRuntime.jsx("div",{className:"flex justify-end mt-[.5rem]",children:jsxRuntime.jsx(g,{type:"submit",resolvedConfig:o,buttonText:"Next",btnSecondary:true,postfixIcon:jsxRuntime.jsx(lucideReact.ArrowRight,{size:14})})})]})})},V=rt;var lt=({onComplete:n,initialValue:e})=>{let[o,t]=T.useState({cm:e||"",ft:"",inch:""}),[i,s]=T.useState(false),[r,a]=T.useState("cm"),p=T.useCallback(u=>{i&&s(false),r==="cm"?t(h=>({...h,cm:u.target.value,ft:"",inch:""})):u.target.id==="ft"?t(h=>({...h,ft:u.target.value,cm:""})):t(h=>({...h,inch:u.target.value,cm:""}));},[i,r]),d=T.useCallback(u=>{let h=u.target.value;a(h),t({cm:"",ft:"",inch:""}),s(false);},[]),l=T.useCallback(u=>r==="cm"?!(+u.cm<152.4||+u.cm>213.36):!(k(+u.ft,+u.inch)<152.4||k(+u.ft,+u.inch)>213.36),[r]),x=T.useCallback(()=>{if(!l(o)){s(true);return}},[o,l]),C=T.useMemo(()=>!o.cm&&!o.ft&&!o.inch||i,[o,i]);T.useEffect(()=>{o.cm===""&&o.ft!==""&&a("ft");},[o]);let F=T.useCallback(()=>r==="cm"?jsxRuntime.jsx("div",{className:"w-full",children:jsxRuntime.jsx(c,{required:true,type:"number",id:"cm",placeholder:"Height in cm",inputMode:"numeric",value:o.cm,onChange:p})}):jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx("div",{children:jsxRuntime.jsx(c,{required:true,type:"number",id:"ft",className:"!pr-2",placeholder:"Height in ft",value:o.ft,onChange:p})}),jsxRuntime.jsx("div",{children:jsxRuntime.jsx(c,{required:true,type:"number",id:"inch",className:"!pr-2",placeholder:"Height in inch",value:o.inch,onChange:p})})]}),[]);return jsxRuntime.jsxs("div",{className:"h-full pt-4 px-4 w-full flex justify-center items-start text-center",children:[jsxRuntime.jsxs("div",{className:"mt-14 mb-3",children:[jsxRuntime.jsxs("div",{className:"w-full flex gap-2",children:[F(),jsxRuntime.jsxs("select",{className:"bg-btn h-[40px] [&_svg]:text-base !shadow-none !outline-none !text-base",value:r,onChange:d,children:[jsxRuntime.jsx("option",{value:"cm",children:"cm"}),jsxRuntime.jsx("option",{value:"ft",children:"ft"})]})]}),jsxRuntime.jsx("div",{className:"mt-2",children:i&&"We're sorry, we currently don't support this heights outside of 5 ft & 7 ft. We're working on new models that do"})]}),jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsx(g,{disabled:C,buttonFunc:x,buttonText:"Next",btnSecondary:true,postfixIcon:jsxRuntime.jsx(lucideReact.ArrowRight,{})})})]})},A=lt;var dt=({onComplete:n,initialValue:e})=>jsxRuntime.jsx("div",{children:"FocalLengthStep"}),_=dt;var ft=({onComplete:n,initialValue:e,resolvedConfig:o})=>{let[t,i]=T.useState(e);return jsxRuntime.jsxs("div",{className:"h-full w-full flex justify-center items-start text-center pt-4 px-4",children:[jsxRuntime.jsxs("div",{className:" w-full max-w-md",children:[jsxRuntime.jsx("button",{className:` text-btnSize font-btnFont bg-btn text-base text-sm border font-medium leading-none rounded-md border-transparent !outline-secondary focus-visible:ring-secondary p-4 ${t==="male"?"!border-black shadow-[0_1px_1px_rgba(0,0,0,0.251)]":"border-black"}`,onClick:()=>{i("male");},children:"Men's"}),jsxRuntime.jsx("button",{className:`text-btnSize font-btnFont bg-btn text-base text-sm border font-medium leading-none rounded-md border-transparent !outline-secondary focus-visible:ring-secondary p-4 ${t==="female"?"!border-black shadow-[0_1px_1px_rgba(0,0,0,0.251)]":"border-black"}`,onClick:()=>{i("female");},children:"Female's"})]}),jsxRuntime.jsx("div",{className:"flex justify-end mt-[.5rem]",children:jsxRuntime.jsx(g,{type:"submit",resolvedConfig:o,buttonText:"Next",btnSecondary:true,postfixIcon:jsxRuntime.jsx(lucideReact.ArrowRight,{size:14}),disabled:!t,buttonFunc:()=>n?.(t)})})]})},q=ft;var gt=({totalSteps:n,currentStepIndex:e,resolvedConfig:o})=>{let t=o?.style?.brandColor||"#000",i=o?.style?.secondaryColor||"#D9D9D9",s=T.useMemo(()=>Array.from({length:n},(r,a)=>({index:a,isActive:a===e,isCompleted:a<e})),[n,e]);return jsxRuntime.jsx("div",{className:"flex justify-center items-center gap-[4px] my-[1.5rem]",children:s.map(({index:r,isActive:a,isCompleted:p})=>jsxRuntime.jsx("div",{className:`h-[3px] rounded-full transition-all duration-300 ${a?"w-[50px]":"w-[30px]"}`,style:{backgroundColor:p||a?t:i}},r))})},O=gt;var j={email:"What is your email?",name:"Enter your name",height:"Hpw tall are you?",gender:"Whom do you shop?",focalLength:"Adjust focal length"};var wt=({steps:n,config:e,onComplete:o})=>{let t=N(e),i=T.useMemo(()=>H(n),[n]),[s,r]=T.useState(0),[a,p]=T.useState({}),d=i[s],l=C=>{let F={...a,[d.type]:C};p(F),d.onStepComplete?.(C),s+1<i.length?r(s+1):o?.(F);},x=()=>{switch(d?.type){case "name":return jsxRuntime.jsx(M,{resolvedConfig:t,onComplete:l,initialValue:d.value});case "email":return jsxRuntime.jsx(V,{resolvedConfig:t,onComplete:l,initialValue:d.value});case "height":return jsxRuntime.jsx(A,{onComplete:l,initialValue:d.value});case "gender":return jsxRuntime.jsx(q,{onComplete:l,initialValue:d.value});case "focalLength":return jsxRuntime.jsx(_,{onComplete:l,initialValue:d.value});default:return jsxRuntime.jsxs("div",{children:["Unsupported step type: ",d?.type]})}};return jsxRuntime.jsx("div",{className:"h-full p-[15px] pt-4 px-4 w-full flex items-center flex-col",style:{background:t?.style?.base?.backgroundColor},children:jsxRuntime.jsxs("div",{className:"max-w-[28rem] mx-auto w-full",children:[t?.logo&&jsxRuntime.jsx("div",{className:"text-center mb-4 flex justify-center",children:jsxRuntime.jsx("img",{src:t.logo,alt:"logo",style:{height:t?.style?.logo?.logoHeight,width:t?.style?.logo?.logoWidth},className:"h-10 mx-auto mb-3"})}),jsxRuntime.jsx(O,{resolvedConfig:t,totalSteps:i.length,currentStepIndex:s}),jsxRuntime.jsx("h1",{style:{fontFamily:t?.style?.heading?.headingFontFamily||"SeriouslyNostalgic Fn",fontSize:t?.style?.heading?.headingFontSize||"32px",color:t?.style?.heading?.headingColor||"#000",fontWeight:t?.style?.heading?.headingFontWeight||"normal"},className:"text-center pt-[1.5rem]",children:d?.type&&j[d?.type]||"Onboarding"}),x()]})})};exports.Onboarding=wt;exports.useLocalConfig=N;//# sourceMappingURL=index.js.map
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/config/useLocalConfig.ts","../src/atoms/customInput/CustomInput.tsx","../src/atoms/specificButton/SpecificButton.tsx","../src/components/onboarding/NameStep.tsx","../src/utils/utils.ts","../src/components/onboarding/EmailStep.tsx","../src/components/onboarding/HeightStep.tsx","../src/components/onboarding/FocalLengthStep.tsx","../src/components/onboarding/GenderStep.tsx","../src/atoms/progressDots/ProgressDots.tsx","../src/utils/constants.ts","../src/components/onboarding/Onboarding.tsx"],"names":["useLocalConfig","config","defaultConfig","useMemo","cn","classes","CustomInput","z","className","resolvedConfig","type","props","ref","jsxs","Fragment","jsx","CustomInput_default","SpecificButton","buttonFunc","prefix","postfixIcon","buttonText","btnSecondary","loading","disabled","id","SpecificButton_default","NameStep","onComplete","initialValue","value","setValue","React","message","setMessage","e","ArrowRight","NameStep_default","resolveSteps","steps","missing","s","visible","withOrder","withoutOrder","a","b","isValidEmail","email","convertToCentimeters","feet","inches","feetToCentimeters","inchesToCentimeters","EmailStep","EmailStep_default","HeightStep","localHeight","setLocalHeight","useState","error","setError","measurementUnit","setMeasurementUnit","handleSetHeight","useCallback","event","prev","handleMeasurementUnit","val","validateHeight","height","checkMeasurement","isButtonDisabled","useEffect","renderHeightInput","HeightStep_default","FocalLengthStep","FocalLengthStep_default","GenderStep","genderType","setGenderType","GenderStep_default","ProgressDots","totalSteps","currentStepIndex","activeColor","inactiveColor","dots","_","i","index","isActive","isCompleted","ProgressDots_default","STEPS","Onboarding","visibleSteps","stepIndex","setStepIndex","values","setValues","currentStep","handleStepComplete","updated","renderStep"],"mappings":"ggBAQO,IAAMA,CAAAA,CAAkBC,CAAAA,EAAsC,C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AAA,EAAM,WACrC,KAAA,CAAOA,CAAAA,EAAgB,OAAO,IAAA,EAAM,SACrC,EACA,SAAA,CAAU,mBAAA,CACX,EACD,CAAA,CAEDM,cAAAA,CAAC+E,EAAA,CAAa,cAAA,CAAgBrF,EAAgB,UAAA,CAAYwF,CAAAA,CAAa,OAAQ,gBAAA,CAAkBC,CAAAA,CAAW,CAAA,CAE5GnF,cAAAA,CAAC,MACA,KAAA,CAAO,CACN,WAAYN,CAAAA,EAAgB,KAAA,EAAO,SAAS,iBAAA,EAAqB,uBAAA,CACjE,SAAUA,CAAAA,EAAgB,KAAA,EAAO,SAAS,eAAA,EAAmB,MAAA,CAC7D,MAAOA,CAAAA,EAAgB,KAAA,EAAO,SAAS,YAAA,EAAgB,MAAA,CACvD,UAAA,CAAYA,CAAAA,EAAgB,OAAO,OAAA,EAAS,iBAAA,EAAuB,QACpE,CAAA,CACA,SAAA,CAAU,0BAER,QAAA,CAAA6F,CAAAA,EAAa,MAAQP,CAAAA,CAAMO,CAAAA,EAAa,IAAI,CAAA,EAAM,YAAA,CACrD,EACCG,CAAAA,EAAW,CAAA,CACb,EACD,CAEF","file":"index.js","sourcesContent":["import { useMemo } from \"react\";\nimport { Config } from \"../types/interfaces\";\n\n\n/**\n * Ensures default style values are available even when config or nested properties are missing.\n * Merges deeply and memoizes the result for consistent performance.\n */\nexport const useLocalConfig = (config?: Config): Required<Config> => {\n const defaultConfig: Required<Config> = {\n logo: \"../swan-logo-black-icon.svg\",\n loader: \"../loader-black.gif\",\n style: {\n base:{\n brandColor: \"#5932F3\",\n backgroundColor: \"#FFFFFF\",\n primaryColor: \"#000000\",\n secondaryColor: \"#D9D9D9\",\n baseTextColor: \"#1E1E1E\",\n baseFontSize: \"16px\",\n baseFontFamily: \"'Inter', sans-serif\",\n },\n logo:{\n logoWidth: \"30px\",\n logoHeight: \"30px\",\n },\n heading:{\n headingColor: \"#000000\",\n headingFontSize: \"32px\",\n headingFontWeight: \"normal\",\n headingFontFamily: \"'SeriouslyNostalgic Fn', serif\",\n },\n button:{\n buttonBackground: \"#220B12\",\n buttonFontSize: \"14px\",\n buttonFontFamily: \"'Inter', sans-serif\",\n buttonDisabledBackground: \"#D9D9D9\",\n buttonDisabledTextColor: \"#000000\",\n buttonTextColor: \"#FFFFFF\",\n },\n input:{\n inputBackgroundColor: \"#F9FAFC\",\n inputTextColor: \"#000000\",\n inputPlaceholderColor: \"#000000\",\n inputBorderColor: \"#F9FAFC\",\n inputFontSize: \"14px\",\n inputFontWeight: \"500\",\n },\n },\n };\n\n return useMemo(() => ({\n logo: config?.logo ?? defaultConfig.logo,\n loader: config?.loader ?? defaultConfig.loader,\n style: {\n ...defaultConfig.style,\n ...(config?.style || {}),\n },\n }), [config]);\n};\n","import * as React from \"react\";\n\n/** Lightweight classnames helper to avoid depending on ../../utils/utils */\nconst cn = (...classes: Array<string | false | null | undefined>) =>\n classes.filter(Boolean).join(\" \");\n\nexport interface CustomInputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n className?: string;\n type?: string;\n resolvedConfig?: any;\n}\n\nconst CustomInput = React.forwardRef<HTMLInputElement, CustomInputProps>(\n ({ className, resolvedConfig, type, ...props }, ref) => (\n <>\n <input\n type={type}\n className={`${className ? className : ''} customInput ` + cn(\n \"flex w-full border-none px-[.75rem] h-[40px] text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed backdrop-blur-sm bg-btn font-medium rounded-[4px] pl-[1rem] pr-[2.5rem] focus:ring-1 focus:outline-none transition-all duration-200\",\n \n )}\n autoCapitalize=\"off\"\n autoCorrect=\"off\"\n ref={ref}\n {...props}\n style={{\n background: resolvedConfig?.style?.input?.inputBackgroundColor || '#F9FAFC',\n color: resolvedConfig?.style?.input?.inputTextColor || '#000',\n fontSize: resolvedConfig?.style?.input?.inputFontSize || '16px',\n fontWeight: resolvedConfig?.style?.input?.inputFontWeight || '400',\n border: `1px solid ${resolvedConfig?.style?.input?.inputBorderColor || '#D9D9D9'}`,\n fontFamily: resolvedConfig?.style?.base?.baseFontFamily || 'Inter, sans-serif',\n }}\n />\n <style>\n {`\n .customInput::placeholder {\n color: ${resolvedConfig?.style?.input?.inputPlaceholderColor || '#A0A0A0'};\n font-weight: ${resolvedConfig?.style?.input?.inputPlaceholderFontWeight || '400'};\n opacity: 1;\n }\n `}\n </style>\n </>\n )\n );\n\n CustomInput.displayName = \"CustomInput\";\n\n export default CustomInput;\n","/* eslint-disable react/button-has-type */\n// import { CircularProgress } from \"@mui/material\";\nimport React from \"react\";\n\ninterface SpecificButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n buttonFunc?: React.MouseEventHandler<HTMLButtonElement>;\n prefix?: string;\n postfixIcon?: React.ReactNode;\n className?: string;\n buttonText?: string;\n btnSecondary?: boolean;\n loading?: boolean;\n disabled?: boolean;\n type?: \"button\" | \"submit\" | \"reset\";\n id?: string;\n resolvedConfig?: any;\n}\n\nconst SpecificButton: React.FC<SpecificButtonProps> = ({\n buttonFunc,\n prefix,\n postfixIcon,\n className = \"\",\n buttonText,\n btnSecondary,\n loading = false,\n disabled = false,\n type = \"button\",\n id = \"button\",\n resolvedConfig,\n ...props\n}) => {\n return (\n <button\n {...props}\n id={id}\n type={type}\n disabled={disabled}\n onClick={buttonFunc}\n className={`${className} ${\"flex gap-[5px] border-none cursor-pointer items-center shadow-[0_1px_1px_rgba(0,0,0,0.251)] justify-center [&_svg]:size-4 [&_svg]:shrink-0 rounded-full min-w-[120px] text-[14px] px-6 disabled:shadow-none py-[6px]\"\n }`}\n style={{\n fontFamily: resolvedConfig?.style?.button?.buttonFontFamily || 'Inter, sans-serif',\n fontSize: resolvedConfig?.style?.button?.buttonFontSize || '22px',\n background:disabled?resolvedConfig?.style?.button?.buttonDisabledBackground :resolvedConfig?.style?.button?.buttonBackground || '#000',\n color:disabled?resolvedConfig?.style?.button?.buttonDisabledTextColor : resolvedConfig?.style?.button?.buttonTextColor || '#fff',\n fontWeight: resolvedConfig?.style?.button?.headingFontWeight || 'normal',\n pointerEvents: disabled ? 'none' : 'auto',\n }}\n >\n {prefix && <img src={prefix} alt=\"icon\" />}\n {buttonText}\n {postfixIcon && postfixIcon}\n {/* {loading && disabled && <CircularProgress size={15} />} */}\n </button>\n );\n};\n\nexport default SpecificButton;\n","import { ArrowRight } from 'lucide-react';\nimport React from 'react'\nimport CustomInput from 'swan-web-components/src/atoms/customInput/CustomInput';\nimport SpecificButton from 'swan-web-components/src/atoms/specificButton/SpecificButton';\n\ninterface NameStepProps {\n onComplete: (value: any) => void;\n initialValue?: any;\n resolvedConfig?: any;\n}\nconst NameStep = ({ onComplete, initialValue, resolvedConfig }: NameStepProps) => {\n const [value, setValue] = React.useState(initialValue || \"\");\n const [message, setMessage] = React.useState<string | undefined>(undefined);\n const handleNext = () => {\n if (!value.trim()) {\n setMessage(\"Name is required.\");\n return; \n }else{\n onComplete?.(value);\n }\n }\n return (\n <div className=\"w-full max-w-md\">\n \n\n <form onSubmit={handleNext} className=\"mt-[3.5rem] mb-[.75rem]\">\n <div>\n <CustomInput\n required\n type=\"text\"\n id=\"name\"\n placeholder=\"Enter your name\"\n resolvedConfig={resolvedConfig}\n // className={` w-full mx-auto rounded-full font-btnFont bg-white text-black text-[18px] py-0 h-[38px] placeholder:text-black/50`}\n //value={whatEmail}\n onChange={(e)=>{\n setValue(e.target.value)\n }}\n />\n {message && <p className=\"mt-[0.2rem] text-[16px]\">{message}</p>}\n </div>\n <div className=\"flex justify-end mt-[.5rem]\">\n <SpecificButton resolvedConfig={resolvedConfig} buttonText={\"Next\"} btnSecondary \n type='submit'\n postfixIcon={<ArrowRight size={14} />}\n />\n </div>\n </form>\n \n </div>\n )\n}\n\nexport default NameStep","\nimport { twMerge } from \"tailwind-merge\";\nimport clsx from \"clsx\";\nimport { Step } from \"../types/interfaces\";\n\nexport const resolveSteps = (steps: Step[]): Step[] => {\n if (!steps.length) throw new Error(\"❌ Onboarding requires at least one step.\");\n\n // Validate all required types are present\n const required = [\"name\", \"email\", \"height\", \"gender\", \"focalLength\"];\n const missing = required.filter(r => !steps.some(s => s.type === r));\n if (missing.length > 0) {\n throw new Error(`❌ Missing required steps: ${missing.join(\", \")}`);\n }\n\n const visible = steps.filter(s => s.isVisible !== false);\n\n const withOrder = visible.filter(s => typeof s.order === \"number\");\n const withoutOrder = visible.filter(s => typeof s.order !== \"number\");\n\n return [\n ...withOrder.sort((a, b) => (a.order! - b.order!)),\n ...withoutOrder\n ];\n};\nexport const isValidEmail = (email:string) => {\n\tconst checkEmailValidation = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n\treturn checkEmailValidation.test(email);\n};\nexport function cn(...inputs:string[]) {\n\treturn twMerge(clsx(inputs));\n}\n\nexport function convertToCentimeters(feet: number, inches: number ) {\n\tconst feetToCentimeters = (feet && +feet * 30.48) ?? 0;\n\tconst inchesToCentimeters = (inches && +inches * 2.54) ?? 0;\n\tconst totalCentimeters = feetToCentimeters + inchesToCentimeters;\n\treturn totalCentimeters;\n}","import { ArrowRight } from \"lucide-react\";\nimport React from \"react\";\nimport CustomInput from \"swan-web-components/src/atoms/customInput/CustomInput\";\nimport SpecificButton from \"swan-web-components/src/atoms/specificButton/SpecificButton\";\nimport { isValidEmail } from \"swan-web-components/src/utils/utils\";\n\ninterface EmailStepProps {\n\tonComplete: (value: any) => void;\n\tinitialValue?: any;\n\tresolvedConfig?: any;\n}\n\nconst EmailStep = ({ onComplete, initialValue, resolvedConfig }: EmailStepProps) => {\n const [value, setValue] = React.useState(initialValue || \"\");\n const [message, setMessage] = React.useState<string | undefined>(undefined);\n const handleNext = () => {\n if (!value.trim()) {\n setMessage(\"Email is required.\");\n return; \n }else if (!isValidEmail(value.trim())){\n setMessage(\"Please enter a valid email address.\")\n }else{\n onComplete?.(value);\n }\n }\n\treturn (\n\t\t<div className=\"w-full max-w-md\">\n\t\t\t<form className=\"mt-[3.5rem] mb-[.75rem]\" onSubmit={handleNext}>\n\t\t\t\t<div>\n\t\t\t\t\t<CustomInput\n\t\t\t\t\t\trequired\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tid=\"name\"\n\t\t\t\t\t\tplaceholder=\"Enter your email\"\n\t\t\t\t\t\tresolvedConfig={resolvedConfig}\n\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\tonChange={(e) => {\n setMessage(undefined);\n setValue(e.target.value);\n }}\n\t\t\t\t\t/>\n\t\t\t\t\t{message && <p className=\"mt-[0.2rem] text-[16px]\">{message}</p>}\n\t\t\t\t</div>\n <div className=\"flex justify-end mt-[.5rem]\">\n <SpecificButton type=\"submit\" resolvedConfig={resolvedConfig} buttonText={\"Next\"} btnSecondary \n postfixIcon={<ArrowRight size={14} />}\n />\n </div>\n\t\t\t</form>\n\t\t</div>\n\t);\n};\n\nexport default EmailStep;\n","import { ArrowRight } from \"lucide-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport CustomInput from \"swan-web-components/src/atoms/customInput/CustomInput\";\nimport SpecificButton from \"swan-web-components/src/atoms/specificButton/SpecificButton\";\nimport { convertToCentimeters } from \"swan-web-components/src/utils/utils\";\n\ninterface HeightStepProps {\n\tonComplete: (value: any) => void;\n\tinitialValue?: any;\n}\n\nconst HeightStep = ({ onComplete, initialValue }: HeightStepProps) => {\n\tconst [localHeight, setLocalHeight] = useState({ cm: initialValue ? initialValue : \"\", ft: \"\", inch: \"\" });\n\tconst [error, setError] = useState(false);\n\tconst [measurementUnit, setMeasurementUnit] = useState(\"cm\");\n\n\tconst handleSetHeight = useCallback(\n\t\t(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tif (error) {\n\t\t\t\tsetError(false);\n\t\t\t}\n\t\t\tif (measurementUnit === \"cm\") {\n\t\t\t\tsetLocalHeight((prev) => ({ ...prev, cm: event.target.value, ft: \"\", inch: \"\" }));\n\t\t\t} else if (event.target.id === \"ft\") {\n\t\t\t\tsetLocalHeight((prev) => ({ ...prev, ft: event.target.value, cm: \"\" }));\n\t\t\t} else {\n\t\t\t\tsetLocalHeight((prev) => ({ ...prev, inch: event.target.value, cm: \"\" }));\n\t\t\t}\n\t\t},\n\t\t[error, measurementUnit],\n\t);\n\tconst handleMeasurementUnit = useCallback((event: React.ChangeEvent<HTMLSelectElement>) => {\n\t\tconst val = event.target.value;\n\t\tsetMeasurementUnit(val);\n\t\tsetLocalHeight({ cm: \"\", ft: \"\", inch: \"\" });\n\t\tsetError(false);\n\t}, []);\n\tconst validateHeight = useCallback(\n\t\t(height: { cm: string; ft: string; inch: string }) => {\n\t\t\tif (measurementUnit === \"cm\") {\n\t\t\t\treturn !(+height.cm < 152.4 || +height.cm > 213.36);\n\t\t\t}\n\t\t\treturn !(convertToCentimeters(+height.ft, +height.inch) < 152.4 || convertToCentimeters(+height.ft, +height.inch) > 213.36);\n\t\t},\n\t\t[measurementUnit],\n\t);\n\n\tconst checkMeasurement = useCallback(() => {\n\t\tif (!validateHeight(localHeight)) {\n\t\t\tsetError(true);\n\t\t\treturn;\n\t\t}\n\n\t\t// setSessionStorage(SESSION_STORAGE_KEY.HEIGHT, localHeight?.cm || convertToCentimeters(localHeight?.ft, localHeight?.inch));\n\t\t// setUserInfo(prev => ({ ...prev, height: localHeight }));\n\t}, [localHeight, validateHeight]);\n\tconst isButtonDisabled = useMemo(() => (!localHeight.cm && !localHeight.ft && !localHeight.inch) || error, [localHeight, error]);\n\tuseEffect(() => {\n\t\tif (localHeight.cm === \"\" && localHeight.ft !== \"\") {\n\t\t\tsetMeasurementUnit(\"ft\");\n\t\t}\n\t}, [localHeight]);\n\tconst renderHeightInput = useCallback(() => {\n\t\tif (measurementUnit === \"cm\") {\n\t\t\treturn (\n\t\t\t\t<div className={`w-full`}>\n\t\t\t\t\t<CustomInput\n\t\t\t\t\t\trequired\n\t\t\t\t\t\t// variant=\"filled\"\n\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\tid=\"cm\"\n\t\t\t\t\t\tplaceholder={\"Height in cm\"}\n\t\t\t\t\t\t// className={`${isIdntfy && `max-w-[276px] mx-auto rounded-[8px] font-btnFont text-[18px] py-0 h-[38px]`}`}\n\t\t\t\t\t\tinputMode=\"numeric\"\n\t\t\t\t\t\tvalue={localHeight.cm}\n\t\t\t\t\t\tonChange={handleSetHeight}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t<div className=\"flex gap-2\">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<CustomInput\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t// variant=\"filled\"\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tid=\"ft\"\n\t\t\t\t\t\t\t// error={error}\n\t\t\t\t\t\t\tclassName={`!pr-2`}\n\t\t\t\t\t\t\tplaceholder={\"Height in ft\"}\n\t\t\t\t\t\t\tvalue={localHeight.ft}\n\t\t\t\t\t\t\tonChange={handleSetHeight}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<CustomInput\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t// variant=\"filled\"\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tid=\"inch\"\n\t\t\t\t\t\t\t// error={error}\n\t\t\t\t\t\t\tclassName={`!pr-2`}\n\t\t\t\t\t\t\tplaceholder={\"Height in inch\"}\n\t\t\t\t\t\t\tvalue={localHeight.inch}\n\t\t\t\t\t\t\tonChange={handleSetHeight}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t}, []);\n\treturn (\n\t\t<div className=\"h-full pt-4 px-4 w-full flex justify-center items-start text-center\">\n\t\t\t<div className=\"mt-14 mb-3\">\n\t\t\t\t<div className=\"w-full flex gap-2\">\n\t\t\t\t\t{renderHeightInput()}\n\t\t\t\t\t<select className=\"bg-btn h-[40px] [&_svg]:text-base !shadow-none !outline-none !text-base\" value={measurementUnit} onChange={handleMeasurementUnit}>\n\t\t\t\t\t\t<option value=\"cm\">cm</option>\n\t\t\t\t\t\t<option value=\"ft\">ft</option>\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"mt-2\">{error && \"We're sorry, we currently don't support this heights outside of 5 ft & 7 ft. We're working on new models that do\"}</div>\n\t\t\t</div>\n\t\t\t<div className=\"flex justify-end\">\n\t\t\t\t<SpecificButton disabled={isButtonDisabled} buttonFunc={checkMeasurement} buttonText={\"Next\"} btnSecondary postfixIcon={<ArrowRight />} />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default HeightStep;\n","import React from 'react'\n\ninterface FocalLengthStepProps {\n onComplete: (value: any) => void;\n initialValue?: any;\n}\n\nconst FocalLengthStep = ({onComplete,initialValue}: FocalLengthStepProps) => {\n return (\n <div>FocalLengthStep</div>\n )\n}\n\nexport default FocalLengthStep","import { ArrowRight } from 'lucide-react';\nimport React, { useState } from 'react'\nimport SpecificButton from 'swan-web-components/src/atoms/specificButton/SpecificButton';\nimport { GenderType } from 'swan-web-components/src/utils/enums';\n\ninterface GenderStepProps {\n onComplete: (value: any) => void;\n initialValue?: any;\n resolvedConfig?: any;\n}\n\nconst GenderStep = ({ onComplete, initialValue, resolvedConfig }: GenderStepProps) => {\n const [genderType, setGenderType] = useState<GenderType>(initialValue);\n return (\n <div className=\"h-full w-full flex justify-center items-start text-center pt-4 px-4\">\n <div className=\" w-full max-w-md\">\n <button\n\t\t\t\t\t\t\tclassName={` text-btnSize font-btnFont bg-btn text-base text-sm border font-medium leading-none rounded-md border-transparent !outline-secondary focus-visible:ring-secondary p-4 ${genderType === GenderType.Male ? `!border-black shadow-[0_1px_1px_rgba(0,0,0,0.251)]` : \"border-black\"}`}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tsetGenderType(GenderType.Male);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tMen's\n\t\t\t\t\t\t</button>\n <button\n\t\t\t\t\t\t\tclassName={`text-btnSize font-btnFont bg-btn text-base text-sm border font-medium leading-none rounded-md border-transparent !outline-secondary focus-visible:ring-secondary p-4 ${genderType === GenderType.Female ? `!border-black shadow-[0_1px_1px_rgba(0,0,0,0.251)]` : \"border-black\"}`}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tsetGenderType(GenderType.Female);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tFemale's\n\t\t\t\t\t\t</button>\n </div>\n <div className=\"flex justify-end mt-[.5rem]\">\n <SpecificButton type=\"submit\" resolvedConfig={resolvedConfig} buttonText={\"Next\"} btnSecondary \n postfixIcon={<ArrowRight size={14} />}\n disabled={!genderType}\n buttonFunc={() => onComplete?.(genderType)}\n />\n </div>\n </div>\n )\n}\n\nexport default GenderStep","import React, { useMemo } from \"react\";\n\ninterface ProgressDotsProps {\n totalSteps: number;\n currentStepIndex: number;\n resolvedConfig?: any;\n}\n\nconst ProgressDots: React.FC<ProgressDotsProps> = ({\n totalSteps,\n currentStepIndex,\n resolvedConfig\n}) => {\n const activeColor = resolvedConfig?.style?.brandColor || \"#000\";\n const inactiveColor = resolvedConfig?.style?.secondaryColor || \"#D9D9D9\";\n\n const dots = useMemo(\n () =>\n Array.from({ length: totalSteps }, (_, i) => ({\n index: i,\n isActive: i === currentStepIndex,\n isCompleted: i < currentStepIndex\n })),\n [totalSteps, currentStepIndex]\n );\n\n return (\n <div className=\"flex justify-center items-center gap-[4px] my-[1.5rem]\">\n {dots.map(({ index, isActive, isCompleted }) => (\n <div\n key={index}\n className={`h-[3px] rounded-full transition-all duration-300 ${\n isActive ? \"w-[50px]\" : \"w-[30px]\"\n }`}\n style={{\n backgroundColor: isCompleted || isActive ? activeColor : inactiveColor\n }}\n />\n ))}\n </div>\n );\n};\n\nexport default ProgressDots;\n","import { StepType } from \"../types/interfaces\";\n\nexport const STEPS: Record<StepType, string> = {\n email: \"What is your email?\",\n name: \"Enter your name\",\n height: \"Hpw tall are you?\",\n gender: \"Whom do you shop?\",\n focalLength: \"Adjust focal length\",\n}\n\n","import React, { useState, useMemo } from \"react\";\nimport { useLocalConfig } from \"../../config/useLocalConfig\";\nimport { OnboardingProps, Step } from \"../../types/interfaces\";\nimport NameStep from \"./NameStep\";\nimport EmailStep from \"./EmailStep\";\nimport HeightStep from \"./HeightStep\";\nimport FocalLengthStep from \"./FocalLengthStep\";\nimport GenderStep from \"./GenderStep\";\nimport ProgressDots from \"swan-web-components/src/atoms/progressDots/ProgressDots\";\nimport { resolveSteps } from \"swan-web-components/src/utils/utils\";\nimport { STEPS } from \"swan-web-components/src/utils/constants\";\n\nexport const Onboarding: React.FC<OnboardingProps> = ({ steps, config, onComplete }) => {\n\tconst resolvedConfig = useLocalConfig(config);\n\tconst visibleSteps = useMemo(() => resolveSteps(steps), [steps]);\n\tconst [stepIndex, setStepIndex] = useState(0);\n\tconst [values, setValues] = useState<Record<string, any>>({});\n\tconst currentStep: Step = visibleSteps[stepIndex];\n\n\tconst handleStepComplete = (value?: any) => {\n\t\tconst updated = { ...values, [currentStep.type]: value };\n\t\tsetValues(updated);\n\t\tcurrentStep.onStepComplete?.(value);\n\n\t\tif (stepIndex + 1 < visibleSteps.length) setStepIndex(stepIndex + 1);\n\t\telse onComplete?.(updated);\n\t};\n\n\tconst renderStep = () => {\n\t\tswitch (currentStep?.type) {\n\t\t\tcase \"name\":\n\t\t\t\treturn <NameStep resolvedConfig={resolvedConfig} onComplete={handleStepComplete} initialValue={currentStep.value} />;\n\t\t\tcase \"email\":\n\t\t\t\treturn <EmailStep resolvedConfig={resolvedConfig} onComplete={handleStepComplete} initialValue={currentStep.value} />;\n\t\t\tcase \"height\":\n\t\t\t\treturn <HeightStep onComplete={handleStepComplete} initialValue={currentStep.value} />;\n\t\t\tcase \"gender\":\n\t\t\t\treturn <GenderStep onComplete={handleStepComplete} initialValue={currentStep.value} />;\n\t\t\tcase \"focalLength\":\n\t\t\t\treturn <FocalLengthStep onComplete={handleStepComplete} initialValue={currentStep.value} />;\n\t\t\tdefault:\n\t\t\t\treturn <div>Unsupported step type: {currentStep?.type}</div>;\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className=\"h-full p-[15px] pt-4 px-4 w-full flex items-center flex-col\" style={{ background: resolvedConfig?.style?.base?.backgroundColor }}>\n\t\t\t<div className=\"max-w-[28rem] mx-auto w-full\">\n\t\t\t\t{resolvedConfig?.logo && (\n\t\t\t\t\t<div className=\"text-center mb-4 flex justify-center\">\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tsrc={resolvedConfig.logo}\n\t\t\t\t\t\t\talt=\"logo\"\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\theight: resolvedConfig?.style?.logo?.logoHeight,\n\t\t\t\t\t\t\t\twidth: resolvedConfig?.style?.logo?.logoWidth,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tclassName=\"h-10 mx-auto mb-3\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t<ProgressDots resolvedConfig={resolvedConfig} totalSteps={visibleSteps.length} currentStepIndex={stepIndex} />\n\n\t\t\t\t<h1\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tfontFamily: resolvedConfig?.style?.heading?.headingFontFamily || \"SeriouslyNostalgic Fn\",\n\t\t\t\t\t\tfontSize: resolvedConfig?.style?.heading?.headingFontSize || \"32px\",\n\t\t\t\t\t\tcolor: resolvedConfig?.style?.heading?.headingColor || \"#000\",\n\t\t\t\t\t\tfontWeight: resolvedConfig?.style?.heading?.headingFontWeight || \"normal\",\n\t\t\t\t\t}}\n\t\t\t\t\tclassName=\"text-center pt-[1.5rem]\"\n\t\t\t\t>\n\t\t\t\t\t{(currentStep?.type && STEPS[currentStep?.type]) || \"Onboarding\"}\n\t\t\t\t</h1>\n\t\t\t\t{renderStep()}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n"]}
package/dist/index.mjs ADDED
@@ -0,0 +1,8 @@
1
+ import*as T from'react';import T__default,{useMemo,useState,useCallback,useEffect}from'react';import {ArrowRight}from'lucide-react';import {jsxs,Fragment,jsx}from'react/jsx-runtime';import'tailwind-merge';import'clsx';var N=n=>{let e={logo:"../swan-logo-black-icon.svg",loader:"../loader-black.gif",style:{base:{brandColor:"#5932F3",backgroundColor:"#FFFFFF",primaryColor:"#000000",secondaryColor:"#D9D9D9",baseTextColor:"#1E1E1E",baseFontSize:"16px",baseFontFamily:"'Inter', sans-serif"},logo:{logoWidth:"30px",logoHeight:"30px"},heading:{headingColor:"#000000",headingFontSize:"32px",headingFontWeight:"normal",headingFontFamily:"'SeriouslyNostalgic Fn', serif"},button:{buttonBackground:"#220B12",buttonFontSize:"14px",buttonFontFamily:"'Inter', sans-serif",buttonDisabledBackground:"#D9D9D9",buttonDisabledTextColor:"#000000",buttonTextColor:"#FFFFFF"},input:{inputBackgroundColor:"#F9FAFC",inputTextColor:"#000000",inputPlaceholderColor:"#000000",inputBorderColor:"#F9FAFC",inputFontSize:"14px",inputFontWeight:"500"}}};return useMemo(()=>({logo:n?.logo??e.logo,loader:n?.loader??e.loader,style:{...e.style,...n?.style||{}}}),[n])};var J=(...n)=>n.filter(Boolean).join(" "),E=T.forwardRef(({className:n,resolvedConfig:e,type:o,...t},i)=>jsxs(Fragment,{children:[jsx("input",{type:o,className:`${n||""} customInput `+J("flex w-full border-none px-[.75rem] h-[40px] text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed backdrop-blur-sm bg-btn font-medium rounded-[4px] pl-[1rem] pr-[2.5rem] focus:ring-1 focus:outline-none transition-all duration-200"),autoCapitalize:"off",autoCorrect:"off",ref:i,...t,style:{background:e?.style?.input?.inputBackgroundColor||"#F9FAFC",color:e?.style?.input?.inputTextColor||"#000",fontSize:e?.style?.input?.inputFontSize||"16px",fontWeight:e?.style?.input?.inputFontWeight||"400",border:`1px solid ${e?.style?.input?.inputBorderColor||"#D9D9D9"}`,fontFamily:e?.style?.base?.baseFontFamily||"Inter, sans-serif"}}),jsx("style",{children:`
2
+ .customInput::placeholder {
3
+ color: ${e?.style?.input?.inputPlaceholderColor||"#A0A0A0"};
4
+ font-weight: ${e?.style?.input?.inputPlaceholderFontWeight||"400"};
5
+ opacity: 1;
6
+ }
7
+ `})]}));E.displayName="CustomInput";var c=E;var X=({buttonFunc:n,prefix:e,postfixIcon:o,className:t="",buttonText:i,btnSecondary:s,loading:r=false,disabled:a=false,type:p="button",id:d="button",resolvedConfig:l,...x})=>jsxs("button",{...x,id:d,type:p,disabled:a,onClick:n,className:`${t} flex gap-[5px] border-none cursor-pointer items-center shadow-[0_1px_1px_rgba(0,0,0,0.251)] justify-center [&_svg]:size-4 [&_svg]:shrink-0 rounded-full min-w-[120px] text-[14px] px-6 disabled:shadow-none py-[6px]`,style:{fontFamily:l?.style?.button?.buttonFontFamily||"Inter, sans-serif",fontSize:l?.style?.button?.buttonFontSize||"22px",background:a?l?.style?.button?.buttonDisabledBackground:l?.style?.button?.buttonBackground||"#000",color:a?l?.style?.button?.buttonDisabledTextColor:l?.style?.button?.buttonTextColor||"#fff",fontWeight:l?.style?.button?.headingFontWeight||"normal",pointerEvents:a?"none":"auto"},children:[e&&jsx("img",{src:e,alt:"icon"}),i,o&&o]}),g=X;var ot=({onComplete:n,initialValue:e,resolvedConfig:o})=>{let[t,i]=T__default.useState(e||""),[s,r]=T__default.useState(void 0);return jsx("div",{className:"w-full max-w-md",children:jsxs("form",{onSubmit:()=>{if(t.trim())n?.(t);else {r("Name is required.");return}},className:"mt-[3.5rem] mb-[.75rem]",children:[jsxs("div",{children:[jsx(c,{required:true,type:"text",id:"name",placeholder:"Enter your name",resolvedConfig:o,onChange:p=>{i(p.target.value);}}),s&&jsx("p",{className:"mt-[0.2rem] text-[16px]",children:s})]}),jsx("div",{className:"flex justify-end mt-[.5rem]",children:jsx(g,{resolvedConfig:o,buttonText:"Next",btnSecondary:true,type:"submit",postfixIcon:jsx(ArrowRight,{size:14})})})]})})},M=ot;var H=n=>{if(!n.length)throw new Error("\u274C Onboarding requires at least one step.");let o=["name","email","height","gender","focalLength"].filter(r=>!n.some(a=>a.type===r));if(o.length>0)throw new Error(`\u274C Missing required steps: ${o.join(", ")}`);let t=n.filter(r=>r.isVisible!==false),i=t.filter(r=>typeof r.order=="number"),s=t.filter(r=>typeof r.order!="number");return [...i.sort((r,a)=>r.order-a.order),...s]},B=n=>/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n);function k(n,e){let o=(n&&+n*30.48)??0,t=(e&&+e*2.54)??0;return o+t}var rt=({onComplete:n,initialValue:e,resolvedConfig:o})=>{let[t,i]=T__default.useState(e||""),[s,r]=T__default.useState(void 0);return jsx("div",{className:"w-full max-w-md",children:jsxs("form",{className:"mt-[3.5rem] mb-[.75rem]",onSubmit:()=>{if(t.trim())B(t.trim())?n?.(t):r("Please enter a valid email address.");else {r("Email is required.");return}},children:[jsxs("div",{children:[jsx(c,{required:true,type:"text",id:"name",placeholder:"Enter your email",resolvedConfig:o,value:t,onChange:p=>{r(void 0),i(p.target.value);}}),s&&jsx("p",{className:"mt-[0.2rem] text-[16px]",children:s})]}),jsx("div",{className:"flex justify-end mt-[.5rem]",children:jsx(g,{type:"submit",resolvedConfig:o,buttonText:"Next",btnSecondary:true,postfixIcon:jsx(ArrowRight,{size:14})})})]})})},V=rt;var lt=({onComplete:n,initialValue:e})=>{let[o,t]=useState({cm:e||"",ft:"",inch:""}),[i,s]=useState(false),[r,a]=useState("cm"),p=useCallback(u=>{i&&s(false),r==="cm"?t(h=>({...h,cm:u.target.value,ft:"",inch:""})):u.target.id==="ft"?t(h=>({...h,ft:u.target.value,cm:""})):t(h=>({...h,inch:u.target.value,cm:""}));},[i,r]),d=useCallback(u=>{let h=u.target.value;a(h),t({cm:"",ft:"",inch:""}),s(false);},[]),l=useCallback(u=>r==="cm"?!(+u.cm<152.4||+u.cm>213.36):!(k(+u.ft,+u.inch)<152.4||k(+u.ft,+u.inch)>213.36),[r]),x=useCallback(()=>{if(!l(o)){s(true);return}},[o,l]),C=useMemo(()=>!o.cm&&!o.ft&&!o.inch||i,[o,i]);useEffect(()=>{o.cm===""&&o.ft!==""&&a("ft");},[o]);let F=useCallback(()=>r==="cm"?jsx("div",{className:"w-full",children:jsx(c,{required:true,type:"number",id:"cm",placeholder:"Height in cm",inputMode:"numeric",value:o.cm,onChange:p})}):jsxs("div",{className:"flex gap-2",children:[jsx("div",{children:jsx(c,{required:true,type:"number",id:"ft",className:"!pr-2",placeholder:"Height in ft",value:o.ft,onChange:p})}),jsx("div",{children:jsx(c,{required:true,type:"number",id:"inch",className:"!pr-2",placeholder:"Height in inch",value:o.inch,onChange:p})})]}),[]);return jsxs("div",{className:"h-full pt-4 px-4 w-full flex justify-center items-start text-center",children:[jsxs("div",{className:"mt-14 mb-3",children:[jsxs("div",{className:"w-full flex gap-2",children:[F(),jsxs("select",{className:"bg-btn h-[40px] [&_svg]:text-base !shadow-none !outline-none !text-base",value:r,onChange:d,children:[jsx("option",{value:"cm",children:"cm"}),jsx("option",{value:"ft",children:"ft"})]})]}),jsx("div",{className:"mt-2",children:i&&"We're sorry, we currently don't support this heights outside of 5 ft & 7 ft. We're working on new models that do"})]}),jsx("div",{className:"flex justify-end",children:jsx(g,{disabled:C,buttonFunc:x,buttonText:"Next",btnSecondary:true,postfixIcon:jsx(ArrowRight,{})})})]})},A=lt;var dt=({onComplete:n,initialValue:e})=>jsx("div",{children:"FocalLengthStep"}),_=dt;var ft=({onComplete:n,initialValue:e,resolvedConfig:o})=>{let[t,i]=useState(e);return jsxs("div",{className:"h-full w-full flex justify-center items-start text-center pt-4 px-4",children:[jsxs("div",{className:" w-full max-w-md",children:[jsx("button",{className:` text-btnSize font-btnFont bg-btn text-base text-sm border font-medium leading-none rounded-md border-transparent !outline-secondary focus-visible:ring-secondary p-4 ${t==="male"?"!border-black shadow-[0_1px_1px_rgba(0,0,0,0.251)]":"border-black"}`,onClick:()=>{i("male");},children:"Men's"}),jsx("button",{className:`text-btnSize font-btnFont bg-btn text-base text-sm border font-medium leading-none rounded-md border-transparent !outline-secondary focus-visible:ring-secondary p-4 ${t==="female"?"!border-black shadow-[0_1px_1px_rgba(0,0,0,0.251)]":"border-black"}`,onClick:()=>{i("female");},children:"Female's"})]}),jsx("div",{className:"flex justify-end mt-[.5rem]",children:jsx(g,{type:"submit",resolvedConfig:o,buttonText:"Next",btnSecondary:true,postfixIcon:jsx(ArrowRight,{size:14}),disabled:!t,buttonFunc:()=>n?.(t)})})]})},q=ft;var gt=({totalSteps:n,currentStepIndex:e,resolvedConfig:o})=>{let t=o?.style?.brandColor||"#000",i=o?.style?.secondaryColor||"#D9D9D9",s=useMemo(()=>Array.from({length:n},(r,a)=>({index:a,isActive:a===e,isCompleted:a<e})),[n,e]);return jsx("div",{className:"flex justify-center items-center gap-[4px] my-[1.5rem]",children:s.map(({index:r,isActive:a,isCompleted:p})=>jsx("div",{className:`h-[3px] rounded-full transition-all duration-300 ${a?"w-[50px]":"w-[30px]"}`,style:{backgroundColor:p||a?t:i}},r))})},O=gt;var j={email:"What is your email?",name:"Enter your name",height:"Hpw tall are you?",gender:"Whom do you shop?",focalLength:"Adjust focal length"};var wt=({steps:n,config:e,onComplete:o})=>{let t=N(e),i=useMemo(()=>H(n),[n]),[s,r]=useState(0),[a,p]=useState({}),d=i[s],l=C=>{let F={...a,[d.type]:C};p(F),d.onStepComplete?.(C),s+1<i.length?r(s+1):o?.(F);},x=()=>{switch(d?.type){case "name":return jsx(M,{resolvedConfig:t,onComplete:l,initialValue:d.value});case "email":return jsx(V,{resolvedConfig:t,onComplete:l,initialValue:d.value});case "height":return jsx(A,{onComplete:l,initialValue:d.value});case "gender":return jsx(q,{onComplete:l,initialValue:d.value});case "focalLength":return jsx(_,{onComplete:l,initialValue:d.value});default:return jsxs("div",{children:["Unsupported step type: ",d?.type]})}};return jsx("div",{className:"h-full p-[15px] pt-4 px-4 w-full flex items-center flex-col",style:{background:t?.style?.base?.backgroundColor},children:jsxs("div",{className:"max-w-[28rem] mx-auto w-full",children:[t?.logo&&jsx("div",{className:"text-center mb-4 flex justify-center",children:jsx("img",{src:t.logo,alt:"logo",style:{height:t?.style?.logo?.logoHeight,width:t?.style?.logo?.logoWidth},className:"h-10 mx-auto mb-3"})}),jsx(O,{resolvedConfig:t,totalSteps:i.length,currentStepIndex:s}),jsx("h1",{style:{fontFamily:t?.style?.heading?.headingFontFamily||"SeriouslyNostalgic Fn",fontSize:t?.style?.heading?.headingFontSize||"32px",color:t?.style?.heading?.headingColor||"#000",fontWeight:t?.style?.heading?.headingFontWeight||"normal"},className:"text-center pt-[1.5rem]",children:d?.type&&j[d?.type]||"Onboarding"}),x()]})})};export{wt as Onboarding,N as useLocalConfig};//# sourceMappingURL=index.mjs.map
8
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/config/useLocalConfig.ts","../src/atoms/customInput/CustomInput.tsx","../src/atoms/specificButton/SpecificButton.tsx","../src/components/onboarding/NameStep.tsx","../src/utils/utils.ts","../src/components/onboarding/EmailStep.tsx","../src/components/onboarding/HeightStep.tsx","../src/components/onboarding/FocalLengthStep.tsx","../src/components/onboarding/GenderStep.tsx","../src/atoms/progressDots/ProgressDots.tsx","../src/utils/constants.ts","../src/components/onboarding/Onboarding.tsx"],"names":["useLocalConfig","config","defaultConfig","useMemo","cn","classes","CustomInput","z","className","resolvedConfig","type","props","ref","jsxs","Fragment","jsx","CustomInput_default","SpecificButton","buttonFunc","prefix","postfixIcon","buttonText","btnSecondary","loading","disabled","id","SpecificButton_default","NameStep","onComplete","initialValue","value","setValue","React","message","setMessage","e","ArrowRight","NameStep_default","resolveSteps","steps","missing","s","visible","withOrder","withoutOrder","a","b","isValidEmail","email","convertToCentimeters","feet","inches","feetToCentimeters","inchesToCentimeters","EmailStep","EmailStep_default","HeightStep","localHeight","setLocalHeight","useState","error","setError","measurementUnit","setMeasurementUnit","handleSetHeight","useCallback","event","prev","handleMeasurementUnit","val","validateHeight","height","checkMeasurement","isButtonDisabled","useEffect","renderHeightInput","HeightStep_default","FocalLengthStep","FocalLengthStep_default","GenderStep","genderType","setGenderType","GenderStep_default","ProgressDots","totalSteps","currentStepIndex","activeColor","inactiveColor","dots","_","i","index","isActive","isCompleted","ProgressDots_default","STEPS","Onboarding","visibleSteps","stepIndex","setStepIndex","values","setValues","currentStep","handleStepComplete","updated","renderStep"],"mappings":"0NAQO,IAAMA,CAAAA,CAAkBC,CAAAA,EAAsC,CACnE,IAAMC,CAAAA,CAAkC,CACtC,IAAA,CAAM,6BAAA,CACN,MAAA,CAAQ,qBAAA,CACR,KAAA,CAAO,CACH,IAAA,CAAK,CACD,UAAA,CAAY,SAAA,CACZ,eAAA,CAAiB,UACjB,YAAA,CAAc,SAAA,CACd,cAAA,CAAgB,SAAA,CAChB,aAAA,CAAe,SAAA,CACf,aAAc,MAAA,CACd,cAAA,CAAgB,qBACpB,CAAA,CACC,IAAA,CAAK,CACF,UAAW,MAAA,CACX,UAAA,CAAY,MAChB,CAAA,CACA,OAAA,CAAQ,CACJ,YAAA,CAAc,SAAA,CACd,eAAA,CAAiB,MAAA,CACjB,iBAAA,CAAmB,QAAA,CACnB,iBAAA,CAAmB,gCACvB,EACA,MAAA,CAAO,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AAYA,CAAAA,EAAgB,OAAO,OAAA,EAAS,iBAAA,EAAuB,QACpE,CAAA,CACA,SAAA,CAAU,0BAER,QAAA,CAAA6F,CAAAA,EAAa,MAAQP,CAAAA,CAAMO,CAAAA,EAAa,IAAI,CAAA,EAAM,YAAA,CACrD,EACCG,CAAAA,EAAW,CAAA,CACb,EACD,CAEF","file":"index.mjs","sourcesContent":["import { useMemo } from \"react\";\nimport { Config } from \"../types/interfaces\";\n\n\n/**\n * Ensures default style values are available even when config or nested properties are missing.\n * Merges deeply and memoizes the result for consistent performance.\n */\nexport const useLocalConfig = (config?: Config): Required<Config> => {\n const defaultConfig: Required<Config> = {\n logo: \"../swan-logo-black-icon.svg\",\n loader: \"../loader-black.gif\",\n style: {\n base:{\n brandColor: \"#5932F3\",\n backgroundColor: \"#FFFFFF\",\n primaryColor: \"#000000\",\n secondaryColor: \"#D9D9D9\",\n baseTextColor: \"#1E1E1E\",\n baseFontSize: \"16px\",\n baseFontFamily: \"'Inter', sans-serif\",\n },\n logo:{\n logoWidth: \"30px\",\n logoHeight: \"30px\",\n },\n heading:{\n headingColor: \"#000000\",\n headingFontSize: \"32px\",\n headingFontWeight: \"normal\",\n headingFontFamily: \"'SeriouslyNostalgic Fn', serif\",\n },\n button:{\n buttonBackground: \"#220B12\",\n buttonFontSize: \"14px\",\n buttonFontFamily: \"'Inter', sans-serif\",\n buttonDisabledBackground: \"#D9D9D9\",\n buttonDisabledTextColor: \"#000000\",\n buttonTextColor: \"#FFFFFF\",\n },\n input:{\n inputBackgroundColor: \"#F9FAFC\",\n inputTextColor: \"#000000\",\n inputPlaceholderColor: \"#000000\",\n inputBorderColor: \"#F9FAFC\",\n inputFontSize: \"14px\",\n inputFontWeight: \"500\",\n },\n },\n };\n\n return useMemo(() => ({\n logo: config?.logo ?? defaultConfig.logo,\n loader: config?.loader ?? defaultConfig.loader,\n style: {\n ...defaultConfig.style,\n ...(config?.style || {}),\n },\n }), [config]);\n};\n","import * as React from \"react\";\n\n/** Lightweight classnames helper to avoid depending on ../../utils/utils */\nconst cn = (...classes: Array<string | false | null | undefined>) =>\n classes.filter(Boolean).join(\" \");\n\nexport interface CustomInputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n className?: string;\n type?: string;\n resolvedConfig?: any;\n}\n\nconst CustomInput = React.forwardRef<HTMLInputElement, CustomInputProps>(\n ({ className, resolvedConfig, type, ...props }, ref) => (\n <>\n <input\n type={type}\n className={`${className ? className : ''} customInput ` + cn(\n \"flex w-full border-none px-[.75rem] h-[40px] text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed backdrop-blur-sm bg-btn font-medium rounded-[4px] pl-[1rem] pr-[2.5rem] focus:ring-1 focus:outline-none transition-all duration-200\",\n \n )}\n autoCapitalize=\"off\"\n autoCorrect=\"off\"\n ref={ref}\n {...props}\n style={{\n background: resolvedConfig?.style?.input?.inputBackgroundColor || '#F9FAFC',\n color: resolvedConfig?.style?.input?.inputTextColor || '#000',\n fontSize: resolvedConfig?.style?.input?.inputFontSize || '16px',\n fontWeight: resolvedConfig?.style?.input?.inputFontWeight || '400',\n border: `1px solid ${resolvedConfig?.style?.input?.inputBorderColor || '#D9D9D9'}`,\n fontFamily: resolvedConfig?.style?.base?.baseFontFamily || 'Inter, sans-serif',\n }}\n />\n <style>\n {`\n .customInput::placeholder {\n color: ${resolvedConfig?.style?.input?.inputPlaceholderColor || '#A0A0A0'};\n font-weight: ${resolvedConfig?.style?.input?.inputPlaceholderFontWeight || '400'};\n opacity: 1;\n }\n `}\n </style>\n </>\n )\n );\n\n CustomInput.displayName = \"CustomInput\";\n\n export default CustomInput;\n","/* eslint-disable react/button-has-type */\n// import { CircularProgress } from \"@mui/material\";\nimport React from \"react\";\n\ninterface SpecificButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n buttonFunc?: React.MouseEventHandler<HTMLButtonElement>;\n prefix?: string;\n postfixIcon?: React.ReactNode;\n className?: string;\n buttonText?: string;\n btnSecondary?: boolean;\n loading?: boolean;\n disabled?: boolean;\n type?: \"button\" | \"submit\" | \"reset\";\n id?: string;\n resolvedConfig?: any;\n}\n\nconst SpecificButton: React.FC<SpecificButtonProps> = ({\n buttonFunc,\n prefix,\n postfixIcon,\n className = \"\",\n buttonText,\n btnSecondary,\n loading = false,\n disabled = false,\n type = \"button\",\n id = \"button\",\n resolvedConfig,\n ...props\n}) => {\n return (\n <button\n {...props}\n id={id}\n type={type}\n disabled={disabled}\n onClick={buttonFunc}\n className={`${className} ${\"flex gap-[5px] border-none cursor-pointer items-center shadow-[0_1px_1px_rgba(0,0,0,0.251)] justify-center [&_svg]:size-4 [&_svg]:shrink-0 rounded-full min-w-[120px] text-[14px] px-6 disabled:shadow-none py-[6px]\"\n }`}\n style={{\n fontFamily: resolvedConfig?.style?.button?.buttonFontFamily || 'Inter, sans-serif',\n fontSize: resolvedConfig?.style?.button?.buttonFontSize || '22px',\n background:disabled?resolvedConfig?.style?.button?.buttonDisabledBackground :resolvedConfig?.style?.button?.buttonBackground || '#000',\n color:disabled?resolvedConfig?.style?.button?.buttonDisabledTextColor : resolvedConfig?.style?.button?.buttonTextColor || '#fff',\n fontWeight: resolvedConfig?.style?.button?.headingFontWeight || 'normal',\n pointerEvents: disabled ? 'none' : 'auto',\n }}\n >\n {prefix && <img src={prefix} alt=\"icon\" />}\n {buttonText}\n {postfixIcon && postfixIcon}\n {/* {loading && disabled && <CircularProgress size={15} />} */}\n </button>\n );\n};\n\nexport default SpecificButton;\n","import { ArrowRight } from 'lucide-react';\nimport React from 'react'\nimport CustomInput from 'swan-web-components/src/atoms/customInput/CustomInput';\nimport SpecificButton from 'swan-web-components/src/atoms/specificButton/SpecificButton';\n\ninterface NameStepProps {\n onComplete: (value: any) => void;\n initialValue?: any;\n resolvedConfig?: any;\n}\nconst NameStep = ({ onComplete, initialValue, resolvedConfig }: NameStepProps) => {\n const [value, setValue] = React.useState(initialValue || \"\");\n const [message, setMessage] = React.useState<string | undefined>(undefined);\n const handleNext = () => {\n if (!value.trim()) {\n setMessage(\"Name is required.\");\n return; \n }else{\n onComplete?.(value);\n }\n }\n return (\n <div className=\"w-full max-w-md\">\n \n\n <form onSubmit={handleNext} className=\"mt-[3.5rem] mb-[.75rem]\">\n <div>\n <CustomInput\n required\n type=\"text\"\n id=\"name\"\n placeholder=\"Enter your name\"\n resolvedConfig={resolvedConfig}\n // className={` w-full mx-auto rounded-full font-btnFont bg-white text-black text-[18px] py-0 h-[38px] placeholder:text-black/50`}\n //value={whatEmail}\n onChange={(e)=>{\n setValue(e.target.value)\n }}\n />\n {message && <p className=\"mt-[0.2rem] text-[16px]\">{message}</p>}\n </div>\n <div className=\"flex justify-end mt-[.5rem]\">\n <SpecificButton resolvedConfig={resolvedConfig} buttonText={\"Next\"} btnSecondary \n type='submit'\n postfixIcon={<ArrowRight size={14} />}\n />\n </div>\n </form>\n \n </div>\n )\n}\n\nexport default NameStep","\nimport { twMerge } from \"tailwind-merge\";\nimport clsx from \"clsx\";\nimport { Step } from \"../types/interfaces\";\n\nexport const resolveSteps = (steps: Step[]): Step[] => {\n if (!steps.length) throw new Error(\"❌ Onboarding requires at least one step.\");\n\n // Validate all required types are present\n const required = [\"name\", \"email\", \"height\", \"gender\", \"focalLength\"];\n const missing = required.filter(r => !steps.some(s => s.type === r));\n if (missing.length > 0) {\n throw new Error(`❌ Missing required steps: ${missing.join(\", \")}`);\n }\n\n const visible = steps.filter(s => s.isVisible !== false);\n\n const withOrder = visible.filter(s => typeof s.order === \"number\");\n const withoutOrder = visible.filter(s => typeof s.order !== \"number\");\n\n return [\n ...withOrder.sort((a, b) => (a.order! - b.order!)),\n ...withoutOrder\n ];\n};\nexport const isValidEmail = (email:string) => {\n\tconst checkEmailValidation = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n\treturn checkEmailValidation.test(email);\n};\nexport function cn(...inputs:string[]) {\n\treturn twMerge(clsx(inputs));\n}\n\nexport function convertToCentimeters(feet: number, inches: number ) {\n\tconst feetToCentimeters = (feet && +feet * 30.48) ?? 0;\n\tconst inchesToCentimeters = (inches && +inches * 2.54) ?? 0;\n\tconst totalCentimeters = feetToCentimeters + inchesToCentimeters;\n\treturn totalCentimeters;\n}","import { ArrowRight } from \"lucide-react\";\nimport React from \"react\";\nimport CustomInput from \"swan-web-components/src/atoms/customInput/CustomInput\";\nimport SpecificButton from \"swan-web-components/src/atoms/specificButton/SpecificButton\";\nimport { isValidEmail } from \"swan-web-components/src/utils/utils\";\n\ninterface EmailStepProps {\n\tonComplete: (value: any) => void;\n\tinitialValue?: any;\n\tresolvedConfig?: any;\n}\n\nconst EmailStep = ({ onComplete, initialValue, resolvedConfig }: EmailStepProps) => {\n const [value, setValue] = React.useState(initialValue || \"\");\n const [message, setMessage] = React.useState<string | undefined>(undefined);\n const handleNext = () => {\n if (!value.trim()) {\n setMessage(\"Email is required.\");\n return; \n }else if (!isValidEmail(value.trim())){\n setMessage(\"Please enter a valid email address.\")\n }else{\n onComplete?.(value);\n }\n }\n\treturn (\n\t\t<div className=\"w-full max-w-md\">\n\t\t\t<form className=\"mt-[3.5rem] mb-[.75rem]\" onSubmit={handleNext}>\n\t\t\t\t<div>\n\t\t\t\t\t<CustomInput\n\t\t\t\t\t\trequired\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tid=\"name\"\n\t\t\t\t\t\tplaceholder=\"Enter your email\"\n\t\t\t\t\t\tresolvedConfig={resolvedConfig}\n\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\tonChange={(e) => {\n setMessage(undefined);\n setValue(e.target.value);\n }}\n\t\t\t\t\t/>\n\t\t\t\t\t{message && <p className=\"mt-[0.2rem] text-[16px]\">{message}</p>}\n\t\t\t\t</div>\n <div className=\"flex justify-end mt-[.5rem]\">\n <SpecificButton type=\"submit\" resolvedConfig={resolvedConfig} buttonText={\"Next\"} btnSecondary \n postfixIcon={<ArrowRight size={14} />}\n />\n </div>\n\t\t\t</form>\n\t\t</div>\n\t);\n};\n\nexport default EmailStep;\n","import { ArrowRight } from \"lucide-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport CustomInput from \"swan-web-components/src/atoms/customInput/CustomInput\";\nimport SpecificButton from \"swan-web-components/src/atoms/specificButton/SpecificButton\";\nimport { convertToCentimeters } from \"swan-web-components/src/utils/utils\";\n\ninterface HeightStepProps {\n\tonComplete: (value: any) => void;\n\tinitialValue?: any;\n}\n\nconst HeightStep = ({ onComplete, initialValue }: HeightStepProps) => {\n\tconst [localHeight, setLocalHeight] = useState({ cm: initialValue ? initialValue : \"\", ft: \"\", inch: \"\" });\n\tconst [error, setError] = useState(false);\n\tconst [measurementUnit, setMeasurementUnit] = useState(\"cm\");\n\n\tconst handleSetHeight = useCallback(\n\t\t(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tif (error) {\n\t\t\t\tsetError(false);\n\t\t\t}\n\t\t\tif (measurementUnit === \"cm\") {\n\t\t\t\tsetLocalHeight((prev) => ({ ...prev, cm: event.target.value, ft: \"\", inch: \"\" }));\n\t\t\t} else if (event.target.id === \"ft\") {\n\t\t\t\tsetLocalHeight((prev) => ({ ...prev, ft: event.target.value, cm: \"\" }));\n\t\t\t} else {\n\t\t\t\tsetLocalHeight((prev) => ({ ...prev, inch: event.target.value, cm: \"\" }));\n\t\t\t}\n\t\t},\n\t\t[error, measurementUnit],\n\t);\n\tconst handleMeasurementUnit = useCallback((event: React.ChangeEvent<HTMLSelectElement>) => {\n\t\tconst val = event.target.value;\n\t\tsetMeasurementUnit(val);\n\t\tsetLocalHeight({ cm: \"\", ft: \"\", inch: \"\" });\n\t\tsetError(false);\n\t}, []);\n\tconst validateHeight = useCallback(\n\t\t(height: { cm: string; ft: string; inch: string }) => {\n\t\t\tif (measurementUnit === \"cm\") {\n\t\t\t\treturn !(+height.cm < 152.4 || +height.cm > 213.36);\n\t\t\t}\n\t\t\treturn !(convertToCentimeters(+height.ft, +height.inch) < 152.4 || convertToCentimeters(+height.ft, +height.inch) > 213.36);\n\t\t},\n\t\t[measurementUnit],\n\t);\n\n\tconst checkMeasurement = useCallback(() => {\n\t\tif (!validateHeight(localHeight)) {\n\t\t\tsetError(true);\n\t\t\treturn;\n\t\t}\n\n\t\t// setSessionStorage(SESSION_STORAGE_KEY.HEIGHT, localHeight?.cm || convertToCentimeters(localHeight?.ft, localHeight?.inch));\n\t\t// setUserInfo(prev => ({ ...prev, height: localHeight }));\n\t}, [localHeight, validateHeight]);\n\tconst isButtonDisabled = useMemo(() => (!localHeight.cm && !localHeight.ft && !localHeight.inch) || error, [localHeight, error]);\n\tuseEffect(() => {\n\t\tif (localHeight.cm === \"\" && localHeight.ft !== \"\") {\n\t\t\tsetMeasurementUnit(\"ft\");\n\t\t}\n\t}, [localHeight]);\n\tconst renderHeightInput = useCallback(() => {\n\t\tif (measurementUnit === \"cm\") {\n\t\t\treturn (\n\t\t\t\t<div className={`w-full`}>\n\t\t\t\t\t<CustomInput\n\t\t\t\t\t\trequired\n\t\t\t\t\t\t// variant=\"filled\"\n\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\tid=\"cm\"\n\t\t\t\t\t\tplaceholder={\"Height in cm\"}\n\t\t\t\t\t\t// className={`${isIdntfy && `max-w-[276px] mx-auto rounded-[8px] font-btnFont text-[18px] py-0 h-[38px]`}`}\n\t\t\t\t\t\tinputMode=\"numeric\"\n\t\t\t\t\t\tvalue={localHeight.cm}\n\t\t\t\t\t\tonChange={handleSetHeight}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t<div className=\"flex gap-2\">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<CustomInput\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t// variant=\"filled\"\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tid=\"ft\"\n\t\t\t\t\t\t\t// error={error}\n\t\t\t\t\t\t\tclassName={`!pr-2`}\n\t\t\t\t\t\t\tplaceholder={\"Height in ft\"}\n\t\t\t\t\t\t\tvalue={localHeight.ft}\n\t\t\t\t\t\t\tonChange={handleSetHeight}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<CustomInput\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t// variant=\"filled\"\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tid=\"inch\"\n\t\t\t\t\t\t\t// error={error}\n\t\t\t\t\t\t\tclassName={`!pr-2`}\n\t\t\t\t\t\t\tplaceholder={\"Height in inch\"}\n\t\t\t\t\t\t\tvalue={localHeight.inch}\n\t\t\t\t\t\t\tonChange={handleSetHeight}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t}, []);\n\treturn (\n\t\t<div className=\"h-full pt-4 px-4 w-full flex justify-center items-start text-center\">\n\t\t\t<div className=\"mt-14 mb-3\">\n\t\t\t\t<div className=\"w-full flex gap-2\">\n\t\t\t\t\t{renderHeightInput()}\n\t\t\t\t\t<select className=\"bg-btn h-[40px] [&_svg]:text-base !shadow-none !outline-none !text-base\" value={measurementUnit} onChange={handleMeasurementUnit}>\n\t\t\t\t\t\t<option value=\"cm\">cm</option>\n\t\t\t\t\t\t<option value=\"ft\">ft</option>\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"mt-2\">{error && \"We're sorry, we currently don't support this heights outside of 5 ft & 7 ft. We're working on new models that do\"}</div>\n\t\t\t</div>\n\t\t\t<div className=\"flex justify-end\">\n\t\t\t\t<SpecificButton disabled={isButtonDisabled} buttonFunc={checkMeasurement} buttonText={\"Next\"} btnSecondary postfixIcon={<ArrowRight />} />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default HeightStep;\n","import React from 'react'\n\ninterface FocalLengthStepProps {\n onComplete: (value: any) => void;\n initialValue?: any;\n}\n\nconst FocalLengthStep = ({onComplete,initialValue}: FocalLengthStepProps) => {\n return (\n <div>FocalLengthStep</div>\n )\n}\n\nexport default FocalLengthStep","import { ArrowRight } from 'lucide-react';\nimport React, { useState } from 'react'\nimport SpecificButton from 'swan-web-components/src/atoms/specificButton/SpecificButton';\nimport { GenderType } from 'swan-web-components/src/utils/enums';\n\ninterface GenderStepProps {\n onComplete: (value: any) => void;\n initialValue?: any;\n resolvedConfig?: any;\n}\n\nconst GenderStep = ({ onComplete, initialValue, resolvedConfig }: GenderStepProps) => {\n const [genderType, setGenderType] = useState<GenderType>(initialValue);\n return (\n <div className=\"h-full w-full flex justify-center items-start text-center pt-4 px-4\">\n <div className=\" w-full max-w-md\">\n <button\n\t\t\t\t\t\t\tclassName={` text-btnSize font-btnFont bg-btn text-base text-sm border font-medium leading-none rounded-md border-transparent !outline-secondary focus-visible:ring-secondary p-4 ${genderType === GenderType.Male ? `!border-black shadow-[0_1px_1px_rgba(0,0,0,0.251)]` : \"border-black\"}`}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tsetGenderType(GenderType.Male);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tMen's\n\t\t\t\t\t\t</button>\n <button\n\t\t\t\t\t\t\tclassName={`text-btnSize font-btnFont bg-btn text-base text-sm border font-medium leading-none rounded-md border-transparent !outline-secondary focus-visible:ring-secondary p-4 ${genderType === GenderType.Female ? `!border-black shadow-[0_1px_1px_rgba(0,0,0,0.251)]` : \"border-black\"}`}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tsetGenderType(GenderType.Female);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tFemale's\n\t\t\t\t\t\t</button>\n </div>\n <div className=\"flex justify-end mt-[.5rem]\">\n <SpecificButton type=\"submit\" resolvedConfig={resolvedConfig} buttonText={\"Next\"} btnSecondary \n postfixIcon={<ArrowRight size={14} />}\n disabled={!genderType}\n buttonFunc={() => onComplete?.(genderType)}\n />\n </div>\n </div>\n )\n}\n\nexport default GenderStep","import React, { useMemo } from \"react\";\n\ninterface ProgressDotsProps {\n totalSteps: number;\n currentStepIndex: number;\n resolvedConfig?: any;\n}\n\nconst ProgressDots: React.FC<ProgressDotsProps> = ({\n totalSteps,\n currentStepIndex,\n resolvedConfig\n}) => {\n const activeColor = resolvedConfig?.style?.brandColor || \"#000\";\n const inactiveColor = resolvedConfig?.style?.secondaryColor || \"#D9D9D9\";\n\n const dots = useMemo(\n () =>\n Array.from({ length: totalSteps }, (_, i) => ({\n index: i,\n isActive: i === currentStepIndex,\n isCompleted: i < currentStepIndex\n })),\n [totalSteps, currentStepIndex]\n );\n\n return (\n <div className=\"flex justify-center items-center gap-[4px] my-[1.5rem]\">\n {dots.map(({ index, isActive, isCompleted }) => (\n <div\n key={index}\n className={`h-[3px] rounded-full transition-all duration-300 ${\n isActive ? \"w-[50px]\" : \"w-[30px]\"\n }`}\n style={{\n backgroundColor: isCompleted || isActive ? activeColor : inactiveColor\n }}\n />\n ))}\n </div>\n );\n};\n\nexport default ProgressDots;\n","import { StepType } from \"../types/interfaces\";\n\nexport const STEPS: Record<StepType, string> = {\n email: \"What is your email?\",\n name: \"Enter your name\",\n height: \"Hpw tall are you?\",\n gender: \"Whom do you shop?\",\n focalLength: \"Adjust focal length\",\n}\n\n","import React, { useState, useMemo } from \"react\";\nimport { useLocalConfig } from \"../../config/useLocalConfig\";\nimport { OnboardingProps, Step } from \"../../types/interfaces\";\nimport NameStep from \"./NameStep\";\nimport EmailStep from \"./EmailStep\";\nimport HeightStep from \"./HeightStep\";\nimport FocalLengthStep from \"./FocalLengthStep\";\nimport GenderStep from \"./GenderStep\";\nimport ProgressDots from \"swan-web-components/src/atoms/progressDots/ProgressDots\";\nimport { resolveSteps } from \"swan-web-components/src/utils/utils\";\nimport { STEPS } from \"swan-web-components/src/utils/constants\";\n\nexport const Onboarding: React.FC<OnboardingProps> = ({ steps, config, onComplete }) => {\n\tconst resolvedConfig = useLocalConfig(config);\n\tconst visibleSteps = useMemo(() => resolveSteps(steps), [steps]);\n\tconst [stepIndex, setStepIndex] = useState(0);\n\tconst [values, setValues] = useState<Record<string, any>>({});\n\tconst currentStep: Step = visibleSteps[stepIndex];\n\n\tconst handleStepComplete = (value?: any) => {\n\t\tconst updated = { ...values, [currentStep.type]: value };\n\t\tsetValues(updated);\n\t\tcurrentStep.onStepComplete?.(value);\n\n\t\tif (stepIndex + 1 < visibleSteps.length) setStepIndex(stepIndex + 1);\n\t\telse onComplete?.(updated);\n\t};\n\n\tconst renderStep = () => {\n\t\tswitch (currentStep?.type) {\n\t\t\tcase \"name\":\n\t\t\t\treturn <NameStep resolvedConfig={resolvedConfig} onComplete={handleStepComplete} initialValue={currentStep.value} />;\n\t\t\tcase \"email\":\n\t\t\t\treturn <EmailStep resolvedConfig={resolvedConfig} onComplete={handleStepComplete} initialValue={currentStep.value} />;\n\t\t\tcase \"height\":\n\t\t\t\treturn <HeightStep onComplete={handleStepComplete} initialValue={currentStep.value} />;\n\t\t\tcase \"gender\":\n\t\t\t\treturn <GenderStep onComplete={handleStepComplete} initialValue={currentStep.value} />;\n\t\t\tcase \"focalLength\":\n\t\t\t\treturn <FocalLengthStep onComplete={handleStepComplete} initialValue={currentStep.value} />;\n\t\t\tdefault:\n\t\t\t\treturn <div>Unsupported step type: {currentStep?.type}</div>;\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className=\"h-full p-[15px] pt-4 px-4 w-full flex items-center flex-col\" style={{ background: resolvedConfig?.style?.base?.backgroundColor }}>\n\t\t\t<div className=\"max-w-[28rem] mx-auto w-full\">\n\t\t\t\t{resolvedConfig?.logo && (\n\t\t\t\t\t<div className=\"text-center mb-4 flex justify-center\">\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tsrc={resolvedConfig.logo}\n\t\t\t\t\t\t\talt=\"logo\"\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\theight: resolvedConfig?.style?.logo?.logoHeight,\n\t\t\t\t\t\t\t\twidth: resolvedConfig?.style?.logo?.logoWidth,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tclassName=\"h-10 mx-auto mb-3\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t<ProgressDots resolvedConfig={resolvedConfig} totalSteps={visibleSteps.length} currentStepIndex={stepIndex} />\n\n\t\t\t\t<h1\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tfontFamily: resolvedConfig?.style?.heading?.headingFontFamily || \"SeriouslyNostalgic Fn\",\n\t\t\t\t\t\tfontSize: resolvedConfig?.style?.heading?.headingFontSize || \"32px\",\n\t\t\t\t\t\tcolor: resolvedConfig?.style?.heading?.headingColor || \"#000\",\n\t\t\t\t\t\tfontWeight: resolvedConfig?.style?.heading?.headingFontWeight || \"normal\",\n\t\t\t\t\t}}\n\t\t\t\t\tclassName=\"text-center pt-[1.5rem]\"\n\t\t\t\t>\n\t\t\t\t\t{(currentStep?.type && STEPS[currentStep?.type]) || \"Onboarding\"}\n\t\t\t\t</h1>\n\t\t\t\t{renderStep()}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n"]}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@swan-admin/swan-web-component",
3
+ "version": "1.0.1",
4
+ "description": "Cross-framework Onboarding component (React + Angular compatible)",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.mjs",
14
+ "require": "./dist/index.js",
15
+ "types": "./dist/index.d.ts"
16
+ },
17
+ "./index.css": "./dist/index.css"
18
+ },
19
+ "scripts": {
20
+ "build:js": "tsup src/index.ts --format cjs,esm --dts --external react,react-dom",
21
+ "build:css": "npx @tailwindcss/cli -i ./src/styles/tailwind.css -o ./dist/index.css --minify",
22
+ "build": "npm run build:js && npm run build:css",
23
+ "pack": "npm run build && npm pack",
24
+ "dev": "tsup src/index.ts --watch",
25
+ "release": "npm version patch --no-git-tag-version && npm run build && npm publish --access public"
26
+ },
27
+ "peerDependencies": {
28
+ "react": ">=18",
29
+ "react-dom": ">=18"
30
+ },
31
+ "dependencies": {
32
+ "clsx": "^2.1.1",
33
+ "lucide-react": "^0.553.0",
34
+ "react-to-webcomponent": "^2.0.1",
35
+ "tailwind-merge": "^3.4.0"
36
+ },
37
+ "devDependencies": {
38
+ "@tailwindcss/cli": "^4.1.17",
39
+ "@tailwindcss/postcss": "^4.1.17",
40
+ "@types/react": "^19.2.2",
41
+ "@types/react-dom": "^19.2.2",
42
+ "autoprefixer": "^10.4.22",
43
+ "postcss": "^8.5.6",
44
+ "tailwindcss": "^4.1.17",
45
+ "tsup": "^8.5.0",
46
+ "typescript": "^5.9.3"
47
+ }
48
+ }