id
stringlengths 12
53
| messages
listlengths 3
3
|
|---|---|
code_affirm-qa-theme_1d6dac6e
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/styles/css/vtex.product-highlights.css from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.productHighlightWrapper--collection {\n position: absolute;\n top: 10px;\n left: 5px;\n width: 200px;\n}\n\n.productHighlightText {\n background: antiquewhite;\n border-radius: 20px;\n padding: 5px 10px;\n}\n\n```"
}
] |
code_affirm-qa-theme_08a7fc1e
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/styles/css/vtex.flex-layout.css from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.flexRowContent--menu-link,\n.flexRowContent--main-header {\n padding: 0 0.5rem;\n}\n\n@media screen and (min-width: 40em) {\n .flexRowContent--menu-link,\n .flexRowContent--main-header {\n padding: 0 1rem;\n }\n}\n\n@media screen and (min-width: 80rem) {\n .flexRowContent--menu-link,\n .flexRowContent--main-header {\n padding: 0 0.25rem;\n }\n}\n\n.flexRowContent--menu-link {\n background-color: #03044e;\n color: #fff;\n}\n\n.flexRowContent--main-header {\n background-color: #f0f0f0;\n}\n\n.flexRowContent--main-header-mobile {\n align-items: center;\n padding: 0.625rem 0.5rem;\n background-color: #f0f0f0;\n}\n\n.flexRowContent--menu-link :global(.vtex-menu-2-x-styledLink) {\n color: #ffffff;\n font-size: 14px;\n}\n\n.flexRowContent--main-header :global(.vtex-menu-2-x-styledLink) {\n color: #727273;\n font-size: 14px;\n}\n\n.flexRow--deals {\n background-color: #0F3E99;\n padding: 14px 0px;\n}\n\n.flexRow--deals .stretchChildrenWidth {\n align-items: center;\n}\n\n.flexRow--deals .flexCol {\n align-items: center;\n margin-bottom: 5px;\n padding-top: 5px;\n}\n\n.flexCol--filterCol {\n max-width: 500px;\n min-width: 230px;\n}\n\n.flexCol--productCountCol {\n align-items: flex-start;\n}\n\n.flexCol--orderByCol {\n align-items: flex-end;\n}\n\n.flexCol--orderByMobileCol {\n width: 42%;\n}\n\n.flexCol--filterMobileCol {\n width: 38%;\n}\n\n.flexRow--quickviewMainRow {\n display: flex;\n max-height: 100%;\n}\n\n.flexColChild--quickviewDetails:first-child {\n overflow-y: auto;\n height: 66% !important;\n overflow-x: hidden;\n}\n\n.flexColChild--quickviewDetails:last-child {\n height: 34% !important;\n}\n\n.flexRow--addToCartRow {\n padding-bottom: 1rem;\n}\n\n```"
}
] |
code_affirm-qa-theme_456602d8
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/styles/css/vtex.carousel.css from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.containerImg {\n background-color: #f0f0f0;\n}\n\n.containerImg .img {\n max-width: 100%;\n}\n\n```"
}
] |
code_affirm-qa-theme_1d198db1
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/styles/css/vtex.search-result.css from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.galleryLayoutOptionButton {\n background-color: #F0F0F0;\n color: #3F3F40;\n padding: 0.375rem 0.75rem 0.375rem 0.75rem;\n}\n\n.galleryLayoutOptionButton--selected {\n background-color: #3F3F40;\n color: #FFFFFF;\n}\n\n.galleryLayoutSwitcher {\n border-radius: 4px 4px 4px 4px;\n justify-content: center;\n overflow: hidden;\n width: auto !important;\n align-self: center\n}\n\n.galleryItem--list {\n border-bottom: 1px #E7E9EE solid;\n}\n\n```"
}
] |
code_affirm-qa-theme_c5817f26
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/styles/css/vtex.slider-layout.css from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.sliderLayoutContainer {\n justify-content: center;\n}\n\n.sliderLayoutContainer--carousel {\n background-color: #F0F0F0;\n min-height: 450px;\n}\n\n.sliderTrackContainer {\n max-width: 100%;\n}\n\n.paginationDotsContainer {\n margin-top: .5rem;\n margin-bottom: .5rem;\n}\n\n.layoutContainer--shelf {\n margin-top: 20px;\n margin-bottom: 20px;\n max-width: 96rem;\n min-height: 550px;\n}\n\n.slide--shelf {\n margin-bottom: 25px;\n padding-left: .5rem;\n padding-right: .5rem;\n min-height: 550px;\n}\n\n```"
}
] |
code_affirm-qa-theme_a6f3186e
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/styles/css/vtex.stack-layout.css from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.stackItem--product {\n width: 100%;\n min-height: 257px\n}\n\n.stackItem--quickview {\n right: 0;\n top: 0;\n left: auto;\n}\n\n```"
}
] |
code_affirm-qa-theme_733b6a33
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/styles/configs/style.json from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"typeScale\": [\n 3, 2.25, 1.5, 1.25, 1, 0.875, 0.75\n ],\n \"spacing\": [0.125, 0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4, 8, 16],\n \"customMedia\": [\n { \"s\": 20 },\n { \"ns\": {\n \"value\": 40,\n \"minWidth\": true\n }\n },\n { \"m\": {\n \"value\": 40,\n \"minWidth\": true\n }\n },\n { \"l\": {\n \"value\": 64,\n \"minWidth\": true\n }\n },\n { \"xl\": {\n \"value\": 80,\n \"minWidth\": true\n }\n }\n ],\n \"colors\": {\n \"black-90\": \"rgba(0,0,0,.9)\",\n \"black-80\": \"rgba(0,0,0,.8)\",\n \"black-70\": \"rgba(0,0,0,.7)\",\n \"black-60\": \"rgba(0,0,0,.6)\",\n \"black-50\": \"rgba(0,0,0,.5)\",\n \"black-40\": \"rgba(0,0,0,.4)\",\n \"black-30\": \"rgba(0,0,0,.3)\",\n \"black-20\": \"rgba(0,0,0,.2)\",\n \"black-10\": \"rgba(0,0,0,.1)\",\n \"black-05\": \"rgba(0,0,0,.05)\",\n \"black-025\": \"rgba(0,0,0,.025)\",\n \"black-0125\": \"rgba(0,0,0,.0125)\",\n\n \"white-90\": \"rgba(255,255,255,.9)\",\n \"white-80\": \"rgba(255,255,255,.8)\",\n \"white-70\": \"rgba(255,255,255,.7)\",\n \"white-60\": \"rgba(255,255,255,.6)\",\n \"white-50\": \"rgba(255,255,255,.5)\",\n \"white-40\": \"rgba(255,255,255,.4)\",\n \"white-30\": \"rgba(255,255,255,.3)\",\n \"white-20\": \"rgba(255,255,255,.2)\",\n \"white-10\": \"rgba(255,255,255,.1)\",\n \"white-05\": \"rgba(255,255,255,.05)\",\n \"white-025\": \"rgba(255,255,255,.025)\",\n \"white-0125\": \"rgba(255,255,255,.0125)\"\n },\n \"semanticColors\": {\n \"background\": {\n \"base\": \"#ffffff\",\n \"base--inverted\": \"#03044e\",\n \"action-primary\": \"#0F3E99\",\n \"action-secondary\": \"#eef3f7\",\n \"emphasis\": \"#f71963\",\n \"disabled\": \"#f2f4f5\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"hover-background\": {\n \"action-primary\": \"#072c75\",\n \"action-secondary\": \"#dbe9fd\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"active-background\": {\n \"action-primary\": \"#0c389f\",\n \"action-secondary\": \"#d2defc\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"text\": {\n \"action-primary\": \"#0F3E99\",\n \"action-secondary\": \"#eef3f7\",\n \"link\": \"#0F3E99\",\n \"emphasis\": \"#f71963\",\n \"disabled\": \"#979899\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"visited-text\": {\n \"link\": \"#0c389f\"\n },\n \"hover-text\": {\n \"action-primary\": \"#072c75\",\n \"action-secondary\": \"#dbe9fd\",\n \"link\": \"#0c389f\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\"\n },\n \"active-text\": {\n \"link\": \"#0c389f\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\"\n },\n \"border\": {\n \"action-primary\": \"#0F3E99\",\n \"action-secondary\": \"#eef3f7\",\n \"emphasis\": \"#f71963\",\n \"disabled\": \"#e3e4e6\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"hover-border\": {\n \"action-primary\": \"#072c75\",\n \"action-secondary\": \"#dbe9fd\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"active-border\": {\n \"action-primary\": \"#0c389f\",\n \"action-secondary\": \"#d2defc\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"on\": {\n \"base\": \"#3f3f40\",\n \"base--inverted\": \"#ffffff\",\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#0F3E99\",\n \"emphasis\": \"#ffffff\",\n \"disabled\": \"#979899\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\",\n \"muted-1\": \"#ffffff\",\n \"muted-2\": \"#ffffff\",\n \"muted-3\": \"#3f3f40\",\n \"muted-4\": \"#3f3f40\",\n \"muted-5\": \"#3f3f40\"\n },\n \"hover-on\": {\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#0F3E99\",\n \"emphasis\": \"#ffffff\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\"\n },\n \"active-on\": {\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#0F3E99\",\n \"emphasis\": \"#ffffff\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\"\n }\n },\n \"borderWidths\": [0, 0.125, 0.25, 0.5, 1, 2],\n \"borderRadius\": [0, 0.125, 0.25, 0.5, 1],\n \"widths\": [1, 2, 4, 8, 16],\n \"maxWidths\": [1, 2, 4, 8, 16, 32, 48, 64, 96],\n \"heights\": [1, 2, 4, 8, 16],\n \"sizes\": [\n {\"name\": \"small\", \"value\": 2},\n {\"name\": \"regular\", \"value\": 2.5},\n {\"name\": \"large\", \"value\": 3}\n ],\n \"typography\":{\n \"measure\": [30, 34, 20],\n \"styles\": {\n \"heading-1\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"700\",\n \"fontSize\": \"3rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-2\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"700\",\n \"fontSize\": \"2.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-3\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"700\",\n \"fontSize\": \"1.75rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-4\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.5rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-5\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-6\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"body\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"small\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"0.875rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"mini\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"0.75rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"action\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"action--small\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"0.875rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"action--large\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"code\": {\n \"fontFamily\": \"Consolas, monaco, monospace\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n }\n }\n },\n \"opacity\": [1, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.05, 0.025, 0]\n}\n\n```"
}
] |
code_affirm-qa-theme_483dffa6
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/styles/css/contact/vtex.flex-layout.css from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.flexRowContent--contact {\n max-width: 700px;\n margin: auto;\n}\n\n.flexRowContent--contact :global(.vtex-input__label),\n.flexRowContent--contact :global(.vtex-textarea__label) {\n font-size: 1rem;\n color: #3f3f40;\n}\n\n.flexRowContent--contact :global(.vtex-input),\n.flexRowContent--contact :global(.vtex-textarea) {\n display: block;\n margin-bottom: 1rem;\n}\n\n```"
}
] |
code_affirm-qa-theme_54f8bc09
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/styles/css/faq/vtex.flex-layout.css from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.flexRowContent--faq {\n max-width: 700px;\n margin: auto;\n}\n\n```"
}
] |
code_affirm-qa-theme_034bbd0c
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/styles/css/faq/vtex.disclosure-layout.css from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.trigger--question {\n display: flex;\n align-items: center;\n cursor: pointer;\n outline: none;\n}\n\n.trigger--question :global(.vtex-rich-text-0-x-paragraph) {\n font-weight: bold;\n}\n\n.trigger--question:focus,\n.trigger--question:focus :global(.vtex-rich-text-0-x-paragraph) {\n color: #0F3E99;\n}\n\n.trigger :global(.vtex-store-icons-0-x-caretIcon) {\n margin-right: 1rem;\n}\n\n.content--answer {\n transition: opacity 250ms ease-in-out, height 250ms ease-in-out, transform 250ms ease-in-out;\n opacity: 0;\n height: 0;\n transform: translate3d(0, -10%, 0);\n}\n\n.content--answer[data-enter] {\n opacity: 1;\n height: fit-content;\n transform: translate3d(0, 0, 0);\n}\n\n.content--answer[data-leave] {\n height: 0;\n overflow: hidden;\n}\n\n```"
}
] |
code_affirm-qa-theme_d68faee2
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/styles/css/search/vtex.rich-text.css from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.container--layout-option {\n margin-left: 0.3em;\n}\n\n.paragraph--layout-option {\n margin: 0;\n}\n\n.paragraph--summarySpecificationBullet {\n margin: 0;\n line-height: initial;\n font-size: 1.25rem;\n line-height: 1.15rem;\n}\n\n```"
}
] |
code_affirm-qa-theme_ca84423b
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/styles/css/search/vtex.product-summary.css from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.nameContainer--summaryListDesktop {\n padding-top: 0.25rem;\n padding-bottom: 0.75rem;\n justify-content: start;\n}\n\n.nameContainer--summaryListMobile {\n padding-top: 0.25rem;\n padding-bottom: 0.5rem;\n justify-content: start;\n}\n\n.brandName--summaryListMobile {\n font-weight: 400;\n font-size: 0.875rem;\n color: black;\n}\n\n.container--listLayout {\n max-width: none !important;\n}\n\n.image--summaryListDesktop {\n width: 180px !important;\n}\n\n.image--summaryListMobile {\n width: 140px !important;\n min-width: 140px;\n height: inherit !important;\n}\n\n```"
}
] |
code_affirm-qa-theme_d0348e0b
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/styles/css/search/vtex.store-components.css from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.productBrandName--summaryListDesktop {\n text-decoration: none;\n font-weight: 500;\n color: #0067C7;\n font-size: .875rem;\n}\n\n.productBrandName--summaryListMobile {\n text-decoration: none;\n color: #0067C7;\n font-size: .875rem;\n}\n\n```"
}
] |
code_affirm-qa-theme_3cad3792
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/styles/css/search/vtex.flex-layout.css from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.flexRow--orderByAndSwitcher {\n padding-right: 1.5em;\n}\n\n.flexRowContent--savingsSummaryListDesktop {\n justify-content: flex-start;\n}\n\n.flexCol--summaryRightListDesktop {\n justify-content: space-around;\n}\n\n.flexRow--buyNowButton :global(.vtex-button) {\n background: #eef3f7;\n border-color:#eef3f7;\n color: #0f3e99;\n}\n\n.flexRow--buyNowButton:hover :global(.vtex-button) {\n background: #dbe9fd;\n border-color:#dbe9fd;\n}\n\n.flexCol--productRating {\n margin-bottom: 3rem;\n}\n\n.flexCol--summaryDetailsListMobile {\n justify-content: space-between;\n}\n\n.flexCol--summaryUpDetailsListMobile {\n margin-bottom: 0.25rem\n}\n\n```"
}
] |
code_affirm-qa-theme_2c55db20
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/styles/css/product-specification-table/vtex.flex-layout.css from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.flexRow--productSpecificationGroup:not(:first-child) {\n margin-top: 1.5rem;\n}\n\n.flexRow--productSpecificationGroupName {\n background-color: #eaeaea;\n padding: 0.5rem 1rem;\n}\n\n.flexCol--productSpecificationName {\n padding: 1rem;\n}\n\n.flexCol--productSpecificationValue {\n padding: 1rem 1rem 1rem 0;\n}\n\n.flexRow--productSpecification:nth-child(even) {\n background-color: #f9f9f9;\n}\n\n```"
}
] |
code_affirm-qa-theme_a4bf208a
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/styles/css/product-specification-table/vtex.product-specifications.css from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.groupName {\n font-size: 1.25rem;\n}\n\n.specificationName {\n font-weight: bold;\n}\n\n```"
}
] |
code_affirm-qa-theme_fb821bbf
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/about-us.json from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"store.custom#about-us\": {\n \"blocks\": [\n \"flex-layout.row#about-us\",\n \"video#about-us\"\n ]\n },\n\n \"flex-layout.row#about-us\": {\n \"children\": [\n \"image#mobile-phone\",\n \"flex-layout.col#text-about-us\"\n ]\n },\n\n \"flex-layout.col#text-about-us\": {\n \"children\": [\n \"rich-text#title-about-us\",\n \"rich-text#about-us\"\n ],\n \"props\": {\n \"blockclass\": \"textColumn\",\n \"preventVerticalStretch\": true\n }\n },\n\n \"rich-text#title-about-us\": {\n \"props\": {\n \"text\":\n \"# Create meaningful and relevant experiences.\",\n \"blockClass\": \"title\"\n }\n },\n\n \"image#mobile-phone\": {\n \"props\": {\n \"src\": \"https://storecomponents.vteximg.com.br/arquivos/mobile-phone.png\",\n \"maxHeight\": \"\",\n \"maxWidth\": \"\",\n \"blockClass\": \"storePrint\"\n }\n },\n \"video#about-us\": {\n \"props\": {\n \"src\": \"https://www.youtube.com/embed/JgkrlaF52WQ\",\n \"width\": \"100%\",\n \"height\": \"100%\"\n }\n },\n \"rich-text#about-us\": {\n \"props\": {\n \"text\": \"**Optimized store framework** \\n Free your front-end with our React + Node store framework. Improve usability and SEO, while driving more conversion with modular components, single page applications, and a ready-for-PWA structure. \\n **Multi-currency and language** \\n Go international with multiple storefronts to support different languages and easily manage local currencies and payment conditions. \\n **Serverless development platform** \\n Reduce loading time, improve usability, and make the best out of SEO. Developing scalable components with a comprehensive, easy-to-use toolset, you can build stores faster than ever.\",\n \"blockClass\": \"about\"\n }\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_6647875f
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/product-price.jsonc from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"flex-layout.row#selling-price\": {\n \"props\": {\n \"colGap\": 2,\n \"preserveLayoutOnMobile\": true,\n \"preventHorizontalStretch\": true,\n \"marginBottom\": 4\n },\n \"children\": [\n \"product-selling-price\"\n ]\n },\n\n \"flex-layout.row#list-price-savings\": {\n \"props\": {\n \"colGap\": 2,\n \"preserveLayoutOnMobile\": true,\n \"preventHorizontalStretch\": true,\n \"marginBottom\": 2,\n \"marginTop\": 5\n },\n \"children\": [\n \"product-list-price\",\n \"product-price-savings\"\n ]\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_93b4b121
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/minicart.jsonc from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"add-to-cart-button\": {\n \"props\": {\n \"addToCartFeedback\": \"customEvent\",\n \"customPixelEventId\": \"add-to-cart-button\"\n }\n },\n\n \"minicart.v2\": {\n \"props\": {\n \"customPixelEventId\": \"add-to-cart-button\"\n },\n \"children\": [\"minicart-base-content\"]\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_dfcf1f3d
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/search.jsonc from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"store.search\": {\n \"blocks\": [\"search-result-layout\"],\n \"props\": {\n \"context\": {\n \"skusFilter\": \"ALL\",\n \"simulationBehavior\": \"skip\"\n }\n }\n },\n\n \"store.search#brand\": {\n \"blocks\": [\"search-result-layout\"],\n \"props\": {\n \"context\": {\n \"orderByField\": \"OrderByReleaseDateDESC\",\n \"hideUnavailableItems\": true,\n \"maxItemsPerPage\": 10,\n \"skusFilter\": \"ALL\",\n \"simulationBehavior\": \"skip\"\n }\n }\n },\n\n \"store.search#department\": {\n \"blocks\": [\"search-result-layout\"],\n \"props\": {\n \"context\": {\n \"skusFilter\": \"ALL\",\n \"simulationBehavior\": \"skip\"\n }\n }\n },\n\n \"store.search#category\": {\n \"blocks\": [\"search-result-layout\"],\n \"props\": {\n \"context\": {\n \"skusFilter\": \"ALL\",\n \"simulationBehavior\": \"skip\"\n }\n }\n },\n\n \"store.search#subcategory\": {\n \"blocks\": [\"search-result-layout\"],\n \"props\": {\n \"context\": {\n \"skusFilter\": \"ALL\",\n \"simulationBehavior\": \"skip\"\n }\n }\n },\n\n \"search-result-layout\": {\n \"blocks\": [\n \"search-result-layout.desktop\",\n \"search-result-layout.mobile\",\n \"search-not-found-layout\"\n ]\n },\n\n \"search-result-layout.desktop\": {\n \"children\": [\n \"flex-layout.row#searchbread\",\n \"flex-layout.row#searchtitle\",\n \"flex-layout.row#result\"\n ],\n \"props\": {\n \"pagination\": \"show-more\",\n \"preventRouteChange\": false,\n \"defaultGalleryLayout\": \"grid\"\n }\n },\n \"flex-layout.row#searchbread\": {\n \"children\": [\"breadcrumb.search\"],\n \"props\": {\n \"preserveLayoutOnMobile\": true,\n \"fullWidth\": true\n }\n },\n \"flex-layout.row#searchtitle\": {\n \"children\": [\"search-title.v2\"]\n },\n \"flex-layout.row#result\": {\n \"children\": [\"flex-layout.col#filter\", \"flex-layout.col#content\"],\n \"props\": {\n \"preventHorizontalStretch\": true,\n \"fullWidth\": true\n }\n },\n \"flex-layout.col#filter\": {\n \"children\": [\"filter-navigator.v3\"],\n \"props\": {\n \"blockClass\": \"filterCol\"\n }\n },\n \"flex-layout.col#content\": {\n \"children\": [\n \"flex-layout.row#searchinfo\",\n \"flex-layout.row#fetchprevious\",\n \"flex-layout.row#products\",\n \"flex-layout.row#fetchmore\"\n ],\n \"props\": {\n \"width\": \"grow\",\n \"preventVerticalStretch\": true\n }\n },\n \"flex-layout.row#searchinfo\": {\n \"children\": [\"flex-layout.col#productCount\", \"flex-layout.row#orderByAndSwitcher\"]\n },\n \"flex-layout.row#orderByAndSwitcher\": {\n \"children\": [\"order-by.v2\", \"gallery-layout-switcher\"],\n \"props\": {\n \"horizontalAlign\": \"right\",\n \"preventHorizontalStretch\": true,\n \"blockClass\": \"orderByAndSwitcher\",\n \"colGap\": 3\n }\n },\n \"flex-layout.col#productCount\": {\n \"children\": [\"total-products.v2\"],\n \"props\": {\n \"blockClass\": \"productCountCol\"\n }\n },\n \"flex-layout.row#fetchprevious\": {\n \"props\": {\n \"marginBottom\": 3\n },\n \"children\": [\"search-fetch-previous\"]\n },\n \"flex-layout.row#fetchmore\": {\n \"props\": {\n \"marginTop\": 3\n },\n \"children\": [\"search-fetch-more\"]\n },\n \"search-fetch-previous\": {\n \"props\": {\n \"htmlElementForButton\": \"a\"\n }\n },\n \"search-fetch-more\": {\n \"props\": {\n \"htmlElementForButton\": \"a\"\n }\n },\n \"flex-layout.row#products\": {\n \"children\": [\"search-content\"]\n },\n \"search-content\": {\n \"blocks\": [\"gallery\", \"not-found\"]\n },\n\n \"search-result-layout.mobile\": {\n \"children\": [\n \"flex-layout.row#searchinfomobile\",\n \"flex-layout.row#searchbread\",\n \"flex-layout.row#productCountMobile\",\n \"flex-layout.row#fetchprevious\",\n \"flex-layout.row#contentmobile\",\n \"flex-layout.row#fetchmore\"\n ],\n \"props\": {\n \"pagination\": \"show-more\",\n \"mobileLayout\": {\n \"mode1\": \"small\",\n \"mode2\": \"normal\"\n },\n \"defaultGalleryLayout\": \"grid\"\n }\n },\n \"flex-layout.row#contentmobile\": {\n \"children\": [\"search-content\"],\n \"props\": {\n \"preserveLayoutOnMobile\": true\n }\n },\n\n \"flex-layout.row#searchinfomobile\": {\n \"children\": [\n \"flex-layout.col#orderByMobile\",\n \"flex-layout.col#filterMobile\",\n \"flex-layout.col#switcherMobile\"\n ],\n \"props\": {\n \"preserveLayoutOnMobile\": true,\n \"colSizing\": \"auto\",\n \"colJustify\": \"around\"\n }\n },\n\n \"flex-layout.col#orderByMobile\": {\n \"children\": [\"order-by.v2\"],\n \"props\": {\n \"blockClass\": \"orderByMobileCol\"\n }\n },\n\n \"flex-layout.row#productCountMobile\": {\n \"children\": [\"total-products.v2\"],\n \"props\": {\n \"blockClass\": \"productCountMobileRow\"\n }\n },\n\n \"flex-layout.col#filterMobile\": {\n \"children\": [\"filter-navigator.v3\"],\n \"props\": {\n \"blockClass\": \"filterMobileCol\"\n }\n },\n \"flex-layout.col#switcherMobile\": {\n \"children\": [\"gallery-layout-switcher\"],\n \"props\": {\n \"verticalAlign\": \"middle\"\n }\n },\n \"search-not-found-layout\": {\n \"children\": [\"flex-layout.row#searchbread\", \"flex-layout.row#notfound\"]\n },\n\n \"flex-layout.row#notfound\": {\n \"children\": [\"not-found\"],\n \"props\": {\n \"fullWidth\": true\n }\n },\n\n \"breadcrumb\": {\n \"props\": {\n \"showOnMobile\": true\n }\n },\n\n \"gallery\": {\n \"props\": {\n \"layouts\": [\n {\n \"name\": \"grid\",\n \"component\": \"GridSummary\",\n \"itemsPerRow\": {\n \"(min-width:1300px)\": 4,\n \"desktop\": 3,\n \"tablet\": 3,\n \"phone\": 2\n }\n },\n {\n \"name\": \"list\",\n \"component\": \"ListSummary\",\n \"itemsPerRow\": 1\n }\n ],\n \"ListSummary\": \"product-summary.shelf#listLayout\",\n \"GridSummary\": \"product-summary.shelf\"\n }\n },\n \"gallery-layout-switcher\": {\n \"children\": [\n /*\n * For accessbility to work properly,\n * It's important to define the options in the same order as the layouts\n */\n \"gallery-layout-option#grid\",\n \"gallery-layout-option#list\"\n ]\n },\n \"gallery-layout-option#grid\": {\n \"props\": {\n \"name\": \"grid\"\n },\n \"children\": [\n \"icon-grid\",\n \"responsive-layout.desktop#textOptionGrid\"\n ]\n },\n \"gallery-layout-option#list\": {\n \"props\": {\n \"name\": \"list\"\n },\n \"children\": [\n \"icon-inline-grid\",\n \"responsive-layout.desktop#textOptionList\"\n ]\n },\n \"responsive-layout.desktop#textOptionGrid\": {\n \"children\": [\n \"rich-text#option-grid\"\n ]\n },\n \"responsive-layout.desktop#textOptionList\": {\n \"children\": [\n \"rich-text#option-list\"\n ]\n },\n \"rich-text#option-grid\": {\n \"props\": {\n \"text\": \"Grid\",\n \"textColor\": \"c-auto\",\n \"blockClass\": \"layout-option\"\n }\n },\n \"rich-text#option-list\": {\n \"props\": {\n \"text\": \"List\",\n \"textColor\": \"c-auto\",\n \"blockClass\": \"layout-option\"\n }\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_30b0d25a
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/contact.jsonc from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"store.custom#contact-us\": {\n \"children\": [\n \"flex-layout.row#contact-us\"\n ]\n },\n\n \"flex-layout.row#contact-us\": {\n \"props\": {\n \"blockClass\": \"contact\"\n },\n \"children\": [\n \"flex-layout.col#contact-us\"\n ]\n },\n\n \"flex-layout.col#contact-us\": {\n \"children\": [\n \"rich-text#contact-us\",\n \"form#contact-us\"\n ]\n },\n \"rich-text#contact-us\": {\n \"props\": {\n \"text\": \"## Contact Us\"\n }\n },\n\n \"form#contact-us\": {\n \"props\": {\n \"entity\": \"contact\",\n \"schema\": \"site-contact\"\n },\n \"blocks\": [\n \"form-success#contact-us\"\n ],\n \"children\": [\n \"form-input.text#title\",\n \"form-input.text#name\",\n \"form-input.text#email\",\n \"form-input.textarea#message\",\n \"form-submit#contact\"\n ]\n },\n\n \"form-success#contact-us\": {\n \"children\": [\n \"rich-text#success-submit\"\n ]\n },\n \"rich-text#success-submit\": {\n \"props\": {\n \"text\": \"Thanks for reaching out! We will come back shortly.\",\n \"textAlignment\": \"CENTER\",\n \"textPosition\": \"CENTER\"\n }\n },\n\n \"form-input.text#title\": {\n \"props\": {\n \"pointer\": \"#/properties/title\"\n }\n },\n \"form-input.text#name\": {\n \"props\": {\n \"pointer\": \"#/properties/name\"\n }\n },\n \"form-input.text#email\": {\n \"props\": {\n \"pointer\": \"#/properties/email\"\n }\n },\n \"form-input.textarea#message\": {\n \"props\": {\n \"pointer\": \"#/properties/message\"\n }\n },\n\n \"form-submit#contact\": {\n \"props\": {\n \"label\": \"Submit\"\n }\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_1aebf5ba
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/orderplaced.jsonc from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"order-placed\": {\n \"blocks\": [\"op-header\", \"op-order\"]\n },\n \"op-header\": {\n \"children\": [\n \"op-section#confirmation\",\n \"op-section#notices\",\n \"op-summary-section\",\n \"op-bank-invoice-section\"\n ]\n },\n \"op-section#confirmation\": {\n \"props\": {\n \"name\": \"confirmation\",\n \"marginBottom\": 9,\n \"borderless\": true\n },\n \"children\": [\n \"op-confirmation-icon\",\n \"op-confirmation-title\",\n \"op-confirmation-message\",\n \"flex-layout.row#confirmation-buttons\"\n ]\n },\n \"flex-layout.row#confirmation-buttons\": {\n \"props\": {\n \"blockClass\": \"confirmationButtons\",\n \"marginTop\": 8,\n \"marginBottom\": 8,\n \"horizontalAlign\": \"center\",\n \"preventHorizontalStretch\": true,\n \"preserveLayoutOnMobile\": true\n },\n \"children\": [\"flex-layout.col#confirmation-buttons\"]\n },\n \"flex-layout.col#confirmation-buttons\": {\n \"children\": [\"op-print-button\"]\n },\n \"op-section#notices\": {\n \"props\": {\n \"name\": \"notices\",\n \"marginBottom\": 9,\n \"borderless\": true\n },\n \"children\": [\"op-notices\"]\n },\n // each order section\n \"op-order\": {\n \"children\": [\n \"flex-layout.row#order-header\",\n \"op-order-split-notice\",\n \"op-order-customer\",\n \"op-section#payments\",\n \"op-section#pickup-packages\",\n \"op-section#delivery-packages\",\n \"op-order-takeaway-packages\",\n \"op-order-total\"\n ]\n },\n // each order header\n \"flex-layout.row#order-header\": {\n \"props\": {\n \"fullWidth\": true,\n \"colSizing\": \"auto\",\n \"colGap\": 5,\n \"marginBottom\": 5\n },\n \"children\": [\n \"flex-layout.col#order-header-info\",\n \"flex-layout.col#order-header-options\"\n ]\n },\n \"flex-layout.col#order-header-info\": {\n \"children\": [\"op-order-number\", \"op-order-datetime\", \"op-order-seller\"]\n },\n \"flex-layout.col#order-header-options\": {\n \"children\": [\"responsive-layout.desktop#order-options-desktop\"]\n },\n \"responsive-layout.desktop#order-options-desktop\": {\n \"children\": [\"op-order-options\"]\n },\n // payment section\n \"op-section#payments\": {\n \"props\": {\n \"name\": \"paymentMethods\"\n },\n \"children\": [\n \"op-order-payment\",\n \"responsive-layout.mobile#order-options-mobile\"\n ]\n },\n // bottom of top section of order header\n \"responsive-layout.mobile#order-options-mobile\": {\n \"children\": [\"op-order-options#mobile\"]\n },\n \"op-order-options#mobile\": {\n \"props\": {\n \"blockClass\": \"mobile\",\n \"fullWidth\": true\n }\n },\n \"op-section#pickup-packages\": {\n \"props\": {\n \"name\": \"pickupPackages\"\n },\n \"children\": [\"op-order-pickup-packages\"]\n },\n \"op-section#delivery-packages\": {\n \"props\": {\n \"name\": \"deliveryPackages\"\n },\n \"children\": [\"op-order-delivery-packages\"]\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_4266cc37
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/faq.jsonc from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"store.custom#faq\": {\n \"children\": [\n \"flex-layout.row#faq\"\n ]\n },\n\n \"flex-layout.row#faq\": {\n \"props\": {\n \"blockClass\": \"faq\"\n },\n \"children\": [\n \"flex-layout.col#faq\"\n ]\n },\n\n \"flex-layout.col#faq\": {\n \"children\": [\n \"rich-text#faq\",\n \"disclosure-layout-group#group\"\n ]\n },\n \"rich-text#faq\": {\n \"props\": {\n \"text\": \"## FAQ\"\n }\n },\n\n \"disclosure-layout-group#group\": {\n \"children\": [\n \"disclosure-layout#first\",\n \"disclosure-layout#second\",\n \"disclosure-layout#third\",\n \"disclosure-layout#fourth\"\n ]\n },\n\n \"disclosure-layout#first\": {\n \"props\": {\n \"animated\": true\n },\n \"children\": [\"disclosure-trigger#first\", \"disclosure-content#first\"]\n },\n \"disclosure-trigger#first\": {\n \"props\": {\n \"blockClass\": \"question\",\n \"as\": \"div\"\n },\n \"children\": [\"disclosure-state-indicator\", \"rich-text#question1\"]\n },\n \"disclosure-content#first\": {\n \"props\": {\n \"blockClass\": \"answer\"\n },\n \"children\": [\"rich-text#answer1\"]\n },\n \"rich-text#question1\": {\n \"props\": {\n \"text\": \"How can I change my shipping address?\"\n }\n },\n \"rich-text#answer1\": {\n \"props\": {\n \"text\": \"Call us at the number (212) 1234-1234.\"\n }\n },\n\n \"disclosure-layout#second\": {\n \"props\": {\n \"animated\": true\n },\n \"children\": [\"disclosure-trigger#second\", \"disclosure-content#second\"]\n },\n \"disclosure-trigger#second\": {\n \"props\": {\n \"blockClass\": \"question\",\n \"as\": \"div\"\n },\n \"children\": [\"disclosure-state-indicator\", \"rich-text#question2\"]\n },\n \"disclosure-content#second\": {\n \"props\": {\n \"blockClass\": \"answer\"\n },\n \"children\": [\"rich-text#answer2\"]\n },\n \"rich-text#question2\": {\n \"props\": {\n \"text\": \"How can I track my order?\"\n }\n },\n \"rich-text#answer2\": {\n \"props\": {\n \"text\": \"After logging into your account, you can find this info at the link Orders.\"\n }\n },\n\n\n \"disclosure-layout#third\": {\n \"props\": {\n \"animated\": true\n },\n \"children\": [\"disclosure-trigger#third\", \"disclosure-content#third\"]\n },\n \"disclosure-trigger#third\": {\n \"props\": {\n \"blockClass\": \"question\",\n \"as\": \"div\"\n },\n \"children\": [\"disclosure-state-indicator\", \"rich-text#question3\"]\n },\n \"disclosure-content#third\": {\n \"props\": {\n \"blockClass\": \"answer\"\n },\n \"children\": [\"rich-text#answer3\"]\n },\n \"rich-text#question3\": {\n \"props\": {\n \"text\": \"How can I change my shipping address?\"\n }\n },\n \"rich-text#answer3\": {\n \"props\": {\n \"text\": \"Call us at the number (212) 1234-1234.\"\n }\n },\n\n\n \"disclosure-layout#fourth\": {\n \"props\": {\n \"animated\": true\n },\n \"children\": [\"disclosure-trigger#fourth\", \"disclosure-content#fourth\"]\n },\n \"disclosure-trigger#fourth\": {\n \"props\": {\n \"blockClass\": \"question\",\n \"as\": \"div\"\n },\n \"children\": [\"disclosure-state-indicator\", \"rich-text#question4\"]\n },\n \"disclosure-content#fourth\": {\n \"props\": {\n \"blockClass\": \"answer\"\n },\n \"children\": [\"rich-text#answer2\"]\n },\n \"rich-text#question4\": {\n \"props\": {\n \"text\": \"How can I track my order?\"\n }\n },\n \"rich-text#answer4\": {\n \"props\": {\n \"text\": \"After logging into your account, you can find this info at the link Orders.\"\n }\n },\n\n\n \"disclosure-state-indicator\": {\n \"props\": {\n \"Show\": \"icon-caret#down\",\n \"Hide\": \"icon-caret#up\"\n }\n },\n \"icon-caret#down\": {\n \"props\": {\n \"orientation\": \"down\"\n }\n },\n \"icon-caret#up\": {\n \"props\": {\n \"orientation\": \"up\"\n }\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_589a3fc1
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/home/home.jsonc from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"store.home\": {\n \"blocks\": [\n \"list-context.image-list#demo\",\n /* You can make references to blocks defined in other files.\n * For example, `flex-layout.row#deals` is defined in the `deals.json` file. */\n \"flex-layout.row#deals\",\n \"__fold__\",\n \"rich-text#shelf-title\",\n \"flex-layout.row#shelf\",\n \"info-card#home\",\n \"rich-text#question\",\n \"rich-text#link\",\n \"newsletter\"\n ]\n },\n\n \"list-context.image-list#demo\": {\n \"children\": [\"slider-layout#demo-images\"],\n \"props\": {\n \"height\": 570,\n \"preload\": true,\n \"images\": [\n {\n \"image\": \"https://storecomponents.vteximg.com.br/arquivos/Class&Style-desktop.png\",\n \"mobileImage\": \"https://storecomponents.vteximg.com.br/arquivos/Class&Style-mobile.png\"\n },\n {\n \"image\": \"https://storecomponents.vteximg.com.br/arquivos/banner-decoration.png\",\n \"mobileImage\": \"https://storecomponents.vteximg.com.br/arquivos/banner-decoration-mobile.png\"\n }\n ]\n }\n },\n \"slider-layout#demo-images\": {\n \"props\": {\n \"itemsPerPage\": {\n \"desktop\": 1,\n \"tablet\": 1,\n \"phone\": 1\n },\n \"infinite\": true,\n \"showNavigationArrows\": \"desktopOnly\",\n \"blockClass\": \"carousel\"\n }\n },\n\n \"rich-text#shelf-title\": {\n \"props\": {\n \"text\": \"## Summer\",\n \"blockClass\": \"shelfTitle\"\n }\n },\n \"flex-layout.row#shelf\": {\n \"children\": [\"list-context.product-list#demo1\"]\n },\n \"list-context.product-list#demo1\": {\n \"blocks\": [\"product-summary.shelf\"],\n \"children\": [\"slider-layout#demo-products\"],\n \"props\": {\n \"orderBy\": \"OrderByTopSaleDESC\"\n }\n },\n \"slider-layout#demo-products\": {\n \"props\": {\n \"itemsPerPage\": {\n \"desktop\": 4,\n \"tablet\": 3,\n \"phone\": 1\n },\n \"infinite\": true,\n \"fullWidth\": false,\n \"blockClass\": \"shelf\"\n }\n },\n\n \"info-card#home\": {\n \"props\": {\n \"id\": \"info-card-home\",\n \"isFullModeStyle\": false,\n \"textPosition\": \"left\",\n \"imageUrl\": \"https://storecomponents.vteximg.com.br/arquivos/banner-infocard2.png\",\n \"headline\": \"Clearance Sale\",\n \"callToActionText\": \"DISCOVER\",\n \"callToActionUrl\": \"/sale/d\",\n \"blockClass\": \"info-card-home\",\n \"textAlignment\": \"center\"\n }\n },\n\n \"rich-text#question\": {\n \"props\": {\n \"text\": \"**This is an example store built using the VTEX platform.\\nWant to know more?**\",\n \"blockClass\": \"question\"\n }\n },\n\n \"rich-text#link\": {\n \"props\": {\n \"text\": \"\\n**Reach us at**\\nwww.vtex.com.br\",\n \"blockClass\": \"link\"\n }\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_43a45345
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/home/deals.json from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"flex-layout.row#deals\": {\n \"children\": [\n \"flex-layout.col#deals1\",\n \"flex-layout.col#deals2\",\n \"flex-layout.col#deals3\",\n \"flex-layout.col#deals4\"\n ],\n \"props\": {\n \"blockClass\": \"deals\"\n }\n },\n\n \"flex-layout.col#deals1\": {\n \"children\": [\n \"image#deal1\",\n \"rich-text#deal1\"\n ]\n },\n \"image#deal1\": {\n \"props\": {\n \"src\": \"https://storecomponents.vteximg.com.br/arquivos/box.png\",\n \"maxHeight\": \"24px\"\n }\n },\n \"rich-text#deal1\": {\n \"props\": {\n \"text\": \"Free shipping\",\n \"blockClass\": \"deals\"\n }\n },\n \"flex-layout.col#deals2\": {\n \"children\": [\n \"image#deal2\",\n \"rich-text#deal2\"\n ]\n },\n \"image#deal2\": {\n \"props\": {\n \"src\": \"https://storecomponents.vteximg.com.br/arquivos/delivery-fast.png\",\n \"maxHeight\": \"24px\"\n }\n },\n \"rich-text#deal2\": {\n \"props\": {\n \"text\": \"One day delivery\",\n \"blockClass\": \"deals\"\n }\n },\n \"flex-layout.col#deals3\": {\n \"children\": [\n \"image#deal3\",\n \"rich-text#deal3\"\n ]\n },\n \"image#deal3\": {\n \"props\": {\n \"src\": \"https://storecomponents.vteximg.com.br/arquivos/store.png\",\n \"maxHeight\": \"24px\"\n }\n },\n \"rich-text#deal3\": {\n \"props\": {\n \"text\": \"Pick up in store\",\n \"blockClass\": \"deals\"\n }\n },\n \"flex-layout.col#deals4\": {\n \"children\": [\n \"image#deal4\",\n \"rich-text#deal4\"\n ]\n },\n \"image#deal4\": {\n \"props\": {\n \"src\": \"https://storecomponents.vteximg.com.br/arquivos/coupon.png\",\n \"maxHeight\": \"24px\"\n }\n },\n \"rich-text#deal4\": {\n \"props\": {\n \"text\": \"Exclusive deals\",\n \"blockClass\": \"deals\"\n }\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_a2a287a4
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/footer/footer.json from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"footer\": {\n \"blocks\": [\"footer-layout.desktop\", \"footer-layout.mobile\"]\n },\n \"footer-layout.desktop\": {\n \"children\": [\n \"flex-layout.row#footer-1-desktop\",\n \"flex-layout.row#footer-2-desktop\",\n \"flex-layout.row#footer-3-desktop\"\n ]\n },\n \"flex-layout.row#footer-1-desktop\": {\n \"children\": [\n \"vtex.menu@2.x:menu#Products\",\n \"vtex.menu@2.x:menu#footer-clothing\",\n \"vtex.menu@2.x:menu#footer-decoration\",\n \"vtex.menu@2.x:menu#footer-bags\",\n \"footer-spacer\",\n \"social-networks\"\n ],\n \"props\": {\n \"blockClass\": \"menu-row\",\n \"paddingTop\": 6,\n \"paddingBottom\": 3\n }\n },\n\n \"social-networks\": {\n \"props\": {\n \"socialNetworks\": [\n {\n \"name\": \"Facebook\",\n \"url\": \"https://www.facebook.com/vtexonline/\"\n },\n {\n \"name\": \"Instagram\",\n \"url\": \"https://www.instagram.com/vtextruecloud/\"\n },\n {\n \"name\": \"Twitter\",\n \"url\": \"https://twitter.com/vtexonline\"\n },\n {\n \"name\": \"Youtube\",\n \"url\": \"https://www.youtube.com/user/VTEXTV\"\n }\n ]\n }\n },\n\n \"flex-layout.row#footer-2-desktop\": {\n \"children\": [\"accepted-payment-methods\"],\n \"props\": {\n \"blockClass\": \"payment-methods\"\n }\n },\n \"accepted-payment-methods\": {\n \"props\": {\n \"paymentMethods\": [\"MasterCard\", \"Visa\", \"Diners Club\"]\n }\n },\n\n \"flex-layout.row#footer-3-desktop\": {\n \"children\": [\"rich-text#footer\"],\n \"props\": {\n \"blockClass\": \"credits\"\n }\n },\n \"rich-text#footer\": {\n \"props\": {\n \"text\": \"All stock and product photos are from photos.icons8.com\",\n \"blockClass\": \"footer\"\n }\n },\n\n \"footer-layout.mobile\": {\n \"children\": [\n \"flex-layout.row#1-footer-mobile\",\n \"flex-layout.row#2-footer-mobile\"\n ]\n },\n \"flex-layout.row#2-footer-mobile\": {\n \"children\": [\"flex-layout.col#footer-1-mobile\"],\n \"props\": {\n \"blockClass\": \"payment-methods\",\n \"paddingTop\": 4,\n \"paddingBottom\": 4\n }\n },\n \"flex-layout.col#footer-1-mobile\": {\n \"children\": [\n \"accepted-payment-methods\",\n \"social-networks\",\n \"rich-text#footer-mobile\"\n ],\n \"props\": {\n \"blockClass\": \"payment-methods\",\n \"paddingTop\": 4,\n \"paddingBottom\": 4,\n \"rowGap\": 4\n }\n },\n \"flex-layout.row#1-footer-mobile\": {\n \"props\": {\n \"paddingTop\": 4,\n \"paddingBottom\": 4\n },\n \"children\": [\"vtex.menu@2.x:menu#footer-mobile\"]\n },\n \"rich-text#footer-mobile\": {\n \"props\": {\n \"text\": \"All stock and product photos are from photos.icons8.com\",\n \"blockClass\": \"footer\"\n }\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_87f4f681
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/footer/menu.json from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"vtex.menu@2.x:menu#Products\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#news\",\n \"menu-item#blackfriday\",\n \"menu-item#sale\",\n \"menu-item#personalization\"\n ]\n },\n \"menu-item#news\": {\n \"props\": {\n \"id\": \"menu-item-news\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"News\",\n \"text\": \"News\"\n }\n }\n },\n \"menu-item#blackfriday\": {\n \"props\": {\n \"id\": \"menu-item-black-friday\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"BlackFriday\",\n \"text\": \"Black Friday\"\n }\n }\n },\n \"menu-item#sale\": {\n \"props\": {\n \"id\": \"menu-item-sale\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"Sale\",\n \"text\": \"Sale\"\n }\n }\n },\n \"menu-item#personalization\": {\n \"props\": {\n \"id\": \"menu-item-personalization\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"Personalization\",\n \"text\": \"Personalization\"\n }\n }\n },\n\n \"vtex.menu@2.x:menu#footer-decoration\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#smartphones\",\n \"menu-item#videogames\",\n \"menu-item#tvs\"\n ]\n },\n\n \"menu-item#smartphones\": {\n \"props\": {\n \"id\": \"menu-item-smartphones\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/decoration/smartphones\",\n \"noFollow\": true,\n \"tagTitle\": \"Smartphones\",\n \"text\": \"Smartphones\"\n }\n }\n },\n\n \"menu-item#videogames\": {\n \"props\": {\n \"id\": \"menu-item-videogames\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/decoration/videogames\",\n \"noFollow\": true,\n \"tagTitle\": \"Videogames\",\n \"text\": \"Videogames\"\n }\n }\n },\n\n \"menu-item#tvs\": {\n \"props\": {\n \"id\": \"menu-item-tvs\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/decoration/tvs\",\n \"noFollow\": true,\n \"tagTitle\": \"TVs\",\n \"text\": \"TVs\"\n }\n }\n },\n\n \"vtex.menu@2.x:menu#footer-bags\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#bags\",\n \"menu-item#backpacks\",\n \"menu-item#necessaire\"\n ]\n },\n\n \"menu-item#bags\": {\n \"props\": {\n \"id\": \"menu-item-bags\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/bags/d\",\n \"noFollow\": true,\n \"tagTitle\": \"Bags\",\n \"text\": \"Bags\"\n }\n }\n },\n\n \"menu-item#backpacks\": {\n \"props\": {\n \"id\": \"menu-item-backpacks\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/bags/backpacks\",\n \"noFollow\": true,\n \"tagTitle\": \"Backpacks\",\n \"text\": \"Backpacks\"\n }\n }\n },\n\n \"menu-item#necessaire\": {\n \"props\": {\n \"id\": \"menu-item-necessaire\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/bags/necessaire\",\n \"noFollow\": true,\n \"tagTitle\": \"Necessaire\",\n \"text\": \"Necessaire\"\n }\n }\n },\n\n \"vtex.menu@2.x:menu#footer-clothing\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#clothing\",\n \"menu-item#shorts\",\n \"menu-item#tank-tops\",\n \"menu-item#shirts\",\n \"menu-item#sweatshirt\",\n \"menu-item#cropped\"\n ]\n },\n\n \"vtex.menu@2.x:menu#footer-mobile\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#clothing-mobile\",\n \"menu-item#decoration-mobile\",\n \"menu-item#sale-mobile\"\n ]\n },\n\n \"menu-item#clothing-mobile\": {\n \"props\": {\n \"id\": \"menu-item-category-clothing\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/d\",\n \"noFollow\": true,\n \"tagTitle\": \"Clothing\",\n \"text\": \"Clothing\"\n }\n },\n \"blocks\": [\"vtex.menu@2.x:submenu.accordion#clothing\"]\n },\n \"vtex.menu@2.x:submenu.accordion#clothing\": {\n \"children\": [\"vtex.menu@2.x:menu#clothing-accordion\"]\n },\n\n \"vtex.menu@2.x:menu#clothing-accordion\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#shorts\",\n \"menu-item#tank-tops\",\n \"menu-item#shirts\",\n \"menu-item#sweatshirt\",\n \"menu-item#cropped\"\n ]\n },\n\n \"menu-item#decoration-mobile\": {\n \"props\": {\n \"itemProps\": {\n \"tagTitle\": \"Decoration\",\n \"text\": \"Decoration\"\n }\n },\n \"blocks\": [\"vtex.menu@2.x:submenu.accordion#decoration\"]\n },\n \"vtex.menu@2.x:submenu.accordion#decoration\": {\n \"children\": [\"vtex.menu@2.x:menu#footer-decoration-mobile\"]\n },\n\n \"vtex.menu@2.x:menu#footer-decoration-mobile\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#smartphones\",\n \"menu-item#videogames\",\n \"menu-item#tvs\"\n ]\n },\n\n \"menu-item#sale-mobile\": {\n \"props\": {\n \"itemProps\": {\n \"tagTitle\": \"Sale\",\n \"text\": \"Sale\"\n }\n },\n \"blocks\": [\"vtex.menu@2.x:submenu.accordion#sale\"]\n },\n \"vtex.menu@2.x:submenu.accordion#sale\": {\n \"children\": [\"vtex.menu@2.x:menu#footer-sale-mobile\"]\n },\n\n \"vtex.menu@2.x:menu#footer-sale-mobile\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#smartphones\",\n \"menu-item#videogames\",\n \"menu-item#tvs\"\n ]\n },\n\n \"menu-item#clothing\": {\n \"props\": {\n \"id\": \"menu-item-category-clothing\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/d\",\n \"noFollow\": true,\n \"tagTitle\": \"Clothing\",\n \"text\": \"Clothing\"\n }\n }\n },\n\n \"menu-item#shorts\": {\n \"props\": {\n \"id\": \"menu-item-shorts\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/shorts\",\n \"noFollow\": false,\n \"tagTitle\": \"Shorts\",\n \"text\": \"Shorts\"\n }\n }\n },\n\n \"menu-item#tank-tops\": {\n \"props\": {\n \"id\": \"menu-item-tank-tops\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/tank-tops\",\n \"noFollow\": false,\n \"tagTitle\": \"Tank tops\",\n \"text\": \"Tank tops\"\n }\n }\n },\n\n \"menu-item#shirts\": {\n \"props\": {\n \"id\": \"menu-item-shirts\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/shirts\",\n \"noFollow\": false,\n \"tagTitle\": \"Shirts\",\n \"text\": \"Shirts\"\n }\n }\n },\n\n \"menu-item#sweatshirt\": {\n \"props\": {\n \"id\": \"menu-item-sweat-shirts\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/sweatshirt\",\n \"noFollow\": false,\n \"tagTitle\": \"Sweatshirt\",\n \"text\": \"Sweatshirt\"\n }\n }\n },\n\n \"menu-item#cropped\": {\n \"props\": {\n \"id\": \"menu-item-cropped\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/cropped\",\n \"noFollow\": false,\n \"tagTitle\": \"Cropped\",\n \"text\": \"Cropped\"\n }\n }\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_4bc4b328
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/product-summary/product-summary.jsonc from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"product-summary.shelf\": {\n \"children\": [\n \"stack-layout#prodsum\",\n \"product-summary-name\",\n \"flex-layout.col#productRating\",\n \"product-summary-space\",\n \"product-list-price#summary\",\n \"flex-layout.row#selling-price-savings\",\n \"product-teaser.summary.affirm\",\n \"product-installments#summary\",\n \"add-to-cart-button\"\n ]\n },\n \"flex-layout.col#productRating\": {\n \"props\": {\n \"blockClass\": \"productRating\"\n },\n \"children\": [\"product-rating-inline\"]\n },\n\n \"stack-layout#prodsum\": {\n \"children\": [\n \"product-summary-image#shelf\",\n \"vtex.product-highlights@2.x:product-highlights#collection\",\n \"modal-trigger#quickview\" // Check quickview.jsonc\n ]\n },\n\n \"product-summary-image#shelf\": {\n \"props\": {\n \"showBadge\": false,\n \"aspectRatio\": \"1:1\",\n \"maxHeight\": 300\n }\n },\n\n \"vtex.product-highlights@2.x:product-highlights#collection\": {\n \"props\": {\n \"type\": \"collection\"\n },\n \"children\": [\"product-highlight-wrapper\"]\n },\n \"product-highlight-wrapper\": {\n \"props\": {\n \"blockClass\": \"collection\"\n },\n \"children\": [\"product-highlight-text\"]\n },\n \"product-highlight-text\": {\n \"props\": {\n \"message\": \"{highlightName}\"\n }\n },\n\n \"product-list-price#summary\": {\n \"props\": {\n \"blockClass\": \"summary\"\n }\n },\n \"flex-layout.row#selling-price-savings\": {\n \"props\": {\n \"colGap\": 2,\n \"preserveLayoutOnMobile\": true,\n \"preventHorizontalStretch\": true,\n \"marginBottom\": 4\n },\n \"children\": [\n \"product-selling-price#summary\",\n \"product-price-savings#summary\"\n ]\n },\n \"product-installments#summary\": {\n \"props\": {\n \"blockClass\": \"summary\"\n }\n },\n \"product-selling-price#summary\": {\n \"props\": {\n \"blockClass\": \"summary\"\n }\n },\n \"product-price-savings#summary\": {\n \"props\": {\n \"markers\": [\n \"discount\"\n ],\n \"blockClass\": \"summary\"\n }\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_3236b357
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/product-summary/quickview.json from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"modal-trigger#quickview\": {\n \"children\": [\n \"icon-expand\",\n \"modal-layout#quickview\"\n ],\n \"props\": {\n \"blockClass\": \"quickview\"\n }\n },\n\n \"modal-layout#quickview\": {\n \"children\": [\n \"modal-header#quickview\",\n \"flex-layout.row#quickview-main-row\"\n ],\n \"props\": {\n \"blockClass\": \"quickview\"\n }\n },\n \"modal-header#quickview\": {\n \"props\": {\n \"blockClass\": \"quickview\"\n }\n },\n\n \"modal-content#quickview\": {\n \"children\": [\n \"vtex.store-components:product-name\",\n \"flex-layout.col#quickviewPrice\",\n \"product-summary-sku-selector#quickview\"\n ],\n \"props\": {\n \"blockClass\": \"quickviewContent\"\n }\n },\n \"flex-layout.col#quickviewPrice\": {\n \"children\": [\n \"flex-layout.row#list-price-savings\",\n \"flex-layout.row#selling-price\",\n \"product-installments\"\n ]\n },\n \"modal-actions#quickview\": {\n \"props\": {\n \"blockClass\": \"quickview\"\n },\n \"children\": [\n \"flex-layout.row#quickview-actions-1\",\n \"flex-layout.row#quickview-actions-2\"\n ]\n },\n \"flex-layout.row#quickview-actions-1\": {\n \"children\": [\n \"flex-layout.col#quickview-product-quantity\",\n \"flex-layout.col#quickview-add-to-card-button\"\n ],\n \"props\": {\n \"colSizing\": \"auto\",\n \"colGap\": 6,\n \"blockClass\": \"addToCartRow\"\n }\n },\n\n \"flex-layout.col#quickview-product-quantity\": {\n \"children\": [\n \"product-summary-quantity#quickview\"\n ]\n },\n \"product-summary-quantity#quickview\": {\n \"props\": {\n \"showLabel\": false,\n \"size\": \"regular\"\n }\n },\n \"flex-layout.col#quickview-add-to-card-button\": {\n \"children\": [\n \"add-to-cart-button\"\n ],\n \"props\": {\n \"width\": \"grow\"\n }\n },\n\n \"flex-layout.row#quickview-actions-2\": {\n \"children\": [\n \"link.product#button-pdp\"\n ]\n },\n \"link.product#button-pdp\": {\n \"props\": {\n \"buttonProps\": {\n \"variant\": \"secondary\"\n },\n \"displayMode\": \"button\",\n \"label\": \"View details\",\n \"href\": \"/{slug}/p\"\n }\n },\n \"flex-layout.row#quickview-main-row\": {\n \"children\": [\n \"flex-layout.col#quickview-images\",\n \"flex-layout.col#quickview-product-details\"\n ],\n \"props\": {\n \"blockClass\": \"quickviewMainRow\"\n }\n },\n \"flex-layout.col#quickview-images\": {\n \"children\": [\n \"product-images#quickview\"\n ]\n },\n \"flex-layout.col#quickview-product-details\": {\n \"children\": [\n \"modal-content#quickview\",\n \"modal-actions#quickview\"\n ],\n \"props\": {\n \"preventVerticalStretch\": true,\n \"blockClass\": \"quickviewDetails\"\n }\n },\n \"product-summary-sku-selector#quickview\": {\n \"props\": {\n \"thumbnailImage\": \"skuvariation\",\n \"imageHeight\": 28,\n \"blockClass\": \"quickview\",\n \"visibility\": \"more-than-one\"\n }\n },\n \"vtex.store-components:product-name\": {\n \"props\": {\n \"blockClass\": \"quickview\"\n }\n },\n \"product-images#quickview\" : {\n \"props\": {\n \"blockClass\": \"quickview\",\n \"showNavigationArrows\": true\n }\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_486361dd
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/product-summary/product-summary-list.jsonc from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"product-summary.shelf#listLayout\": {\n \"props\": {\n \"blockClass\": \"listLayout\"\n },\n \"children\": [\n \"responsive-layout.desktop#productSummaryList\",\n \"responsive-layout.mobile#productSummaryList\"\n ]\n },\n \"responsive-layout.desktop#productSummaryList\": {\n \"children\": [\n \"flex-layout.row#summaryListDesktop\"\n ]\n },\n \"responsive-layout.mobile#productSummaryList\": {\n \"children\": [\n \"flex-layout.row#summaryListMobile\"\n ]\n },\n \"product-price-savings#summaryPercentage\": {\n \"props\": {\n \"message\": \"{savingsPercentage}\",\n \"blockClass\": \"summaryPercentage\"\n }\n },\n \"flex-layout.row#savingsSummaryListDesktop\": {\n \"props\": {\n \"colSizing\": \"auto\",\n \"colGap\": 3,\n \"blockClass\": \"savingsSummaryListDesktop\"\n },\n \"children\": [\n \"product-price-savings#summaryPercentage\",\n \"product-price-savings#summary\"\n ]\n },\n \"flex-layout.row#summaryListDesktop\": {\n \"props\":{\n \"fullWidth\": true,\n \"colSizing\": \"auto\",\n \"blockClass\": \"summaryListDesktop\"\n },\n \"children\": [\n \"flex-layout.row#summaryLeftListDesktop\",\n \"flex-layout.col#summaryRightListDesktop\"\n ]\n },\n \"flex-layout.row#summaryLeftListDesktop\": {\n \"props\": {\n \"blockClass\": \"summaryLeftListDesktop\",\n \"colSizing\": \"auto\",\n \"colGap\": 7\n },\n \"children\": [\n \"stack-layout#summaryListDesktop\",\n \"flex-layout.col#summaryDetailsListDesktop\"\n ]\n },\n \"flex-layout.col#summaryDetailsListDesktop\": {\n \"props\": {\n \"preventVerticalStretch\": true\n },\n \"children\": [\n \"vtex.store-components:product-brand#summaryListDesktop\",\n \"product-summary-name#summaryListDesktop\",\n \"flex-layout.col#productRating\",\n \"flex-layout.row#productSpecifications\"\n ]\n },\n \"flex-layout.row#productSpecifications\": {\n \"children\": [\n \"product-specification-group#summary\"\n ]\n },\n \"product-summary-name#summaryListDesktop\": {\n \"props\": {\n \"blockClass\": \"summaryListDesktop\"\n }\n },\n \"vtex.store-components:product-brand#summaryListDesktop\": {\n \"props\": {\n \"displayMode\": \"text\",\n \"blockClass\": \"summaryListDesktop\"\n }\n },\n \"flex-layout.col#summaryRightListDesktop\": {\n \"props\": {\n \"blockClass\": \"summaryRightListDesktop\",\n \"preventVerticalStretch\": true\n },\n \"children\": [\n \"flex-layout.row#savingsSummaryListDesktop\",\n \"flex-layout.col#priceSummaryListDesktop\",\n \"flex-layout.row#buyButtonsSummaryListDesktop\"\n ]\n },\n \"flex-layout.row#buyButtonsSummaryListDesktop\": {\n \"props\": {\n \"colSizing\": \"auto\",\n \"colGap\": 5\n },\n \"children\": [\n \"add-to-cart-button\",\n \"flex-layout.row#buyNowButton\"\n ]\n },\n \"flex-layout.row#buyNowButton\": {\n \"props\": {\n \"blockClass\": \"buyNowButton\"\n },\n \"children\": [\n \"add-to-cart-button#buyNow\"\n ]\n },\n\n \"add-to-cart-button#buyNow\": {\n \"props\": {\n \"text\": \"BUY NOW\",\n \"isOneClickBuy\": true,\n \"onClickEventPropagation\": \"enabled\",\n \"blockClass\": \"buyNow\"\n }\n },\n \"flex-layout.col#priceSummaryListDesktop\": {\n \"children\": [\n \"product-selling-price#summary\",\n \"product-list-price#summary\"\n ]\n },\n \"stack-layout#summaryListDesktop\": {\n \"children\": [\n \"product-summary-image#summaryListDesktop\",\n \"vtex.product-highlights@2.x:product-highlights#collection\",\n \"modal-trigger#quickview\" // Check quickview.jsonc\n ]\n },\n \"product-summary-image#summaryListDesktop\": {\n \"props\": {\n \"showBadge\": false,\n \"aspectRatio\": \"1:1\",\n \"maxHeight\": 180,\n \"blockClass\": \"summaryListDesktop\"\n }\n },\n \"flex-layout.row#summaryListMobile\": {\n \"props\":{\n \"preserveLayoutOnMobile\": true,\n \"colSizing\": \"auto\",\n \"blockClass\": \"summaryListMobile\",\n \"colGap\": 5\n },\n \"children\": [\n \"stack-layout#summaryListMobile\",\n \"flex-layout.col#summaryDetailsListMobile\"\n ]\n },\n \"stack-layout#summaryListMobile\": {\n \"children\": [\n \"product-summary-image#summaryListMobile\",\n \"vtex.product-highlights@2.x:product-highlights#collection\",\n \"modal-trigger#quickview\" // Check quickview.jsonc\n ]\n },\n \"product-summary-image#summaryListMobile\": {\n \"props\": {\n \"showBadge\": false,\n \"aspectRatio\": \"1:1\",\n \"maxHeight\": 220,\n \"blockClass\": \"summaryListMobile\"\n }\n },\n \"flex-layout.col#summaryDetailsListMobile\": {\n \"props\": {\n \"preventVerticalStretch\": true,\n \"width\": \"grow\",\n \"blockClass\": \"summaryDetailsListMobile\"\n },\n \"children\": [\n \"flex-layout.col#summaryUpDetailsListMobile\",\n \"flex-layout.col#summaryDownDetailsListMobile\"\n ]\n },\n \"flex-layout.col#summaryUpDetailsListMobile\": {\n \"props\": {\n \"preventVerticalStretch\": true,\n \"blockClass\": \"summaryUpDetailsListMobile\"\n },\n \"children\": [\n \"vtex.store-components:product-brand#summaryListMobile\",\n \"product-summary-name#summaryListMobile\",\n \"product-rating-inline\"\n ]\n },\n \"flex-layout.col#summaryDownDetailsListMobile\": {\n \"props\": {\n \"preventVerticalStretch\": true\n },\n \"children\": [\n \"product-selling-price#summary\",\n \"product-installments#summary\"\n ]\n },\n \"vtex.store-components:product-brand#summaryListMobile\": {\n \"props\": {\n \"displayMode\": \"text\",\n \"blockClass\": \"summaryListMobile\"\n }\n },\n \"product-summary-name#summaryListMobile\": {\n \"props\": {\n \"tag\": \"div\",\n \"blockClass\": \"summaryListMobile\"\n }\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_03cf17a9
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/product-summary/product-specification-list.jsonc from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"product-specification-group#summary\": {\n \"children\": [\n \"product-specification#summary\"\n ]\n },\n \"product-specification#summary\": {\n \"children\": [\n \"flex-layout.row#summarySpecificationValues\"\n ]\n },\n \"flex-layout.row#summarySpecificationValues\": {\n \"props\": {\n \"preventHorizontalStretch\": true,\n \"colGap\": 3\n },\n \"children\": [\n \"rich-text#summarySpecificationBullet\",\n \"product-specification-values\"\n ]\n },\n \"rich-text#summarySpecificationBullet\": {\n \"props\": {\n \"text\": \"•\",\n \"textColor\": \"c-action-primary\",\n \"blockClass\": \"summarySpecificationBullet\"\n }\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_7d5767b8
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/pdp/product-assembly.jsonc from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"sticky-layout#buy-button\": {\n \"props\": {\n \"position\": \"bottom\"\n },\n \"children\": [\"flex-layout.row#buy-button\"]\n },\n \"product-assembly-options\": {\n \"children\": [\n \"flex-layout.row#product-assembly-options\",\n \"assembly-option-input-values\"\n ]\n },\n \"assembly-option-input-values\": {\n \"props\": {\n \"optionsDisplay\": \"box\"\n }\n },\n \"flex-layout.row#product-assembly-options\": {\n \"props\": {\n \"colGap\": 2,\n \"preserveLayoutOnMobile\": true,\n \"colSizing\": \"auto\"\n },\n \"children\": [\n \"flex-layout.col#product-assembly-image\",\n \"flex-layout.col#product-assembly-middle\",\n \"flex-layout.col#product-assembly-quantity\"\n ]\n },\n \"flex-layout.col#product-assembly-quantity\": {\n \"props\": {\n \"verticalAlign\": \"middle\"\n },\n \"children\": [\n \"assembly-option-item-quantity-selector\"\n ]\n },\n \"flex-layout.col#product-assembly-image\": {\n \"props\": {\n \"marginRight\": 4\n },\n \"children\": [\n \"assembly-option-item-image\"\n ]\n },\n \"flex-layout.col#product-assembly-middle\": {\n \"props\": {\n \"width\": \"grow\",\n \"verticalAlignment\": \"middle\"\n },\n \"children\": [\n \"assembly-option-item-name\",\n \"assembly-option-item-price\",\n \"assembly-option-item-children-description\",\n \"assembly-option-item-customize#first-level\"\n ]\n },\n \"assembly-option-item-customize#first-level\": {\n \"props\": {\n \"buttonProps\": {\n \"collapse\": \"left\"\n }\n },\n \"children\": [\n \"flex-layout.row#item-customize\",\n \"assembly-option-input-values\"\n ]\n },\n \"flex-layout.row#item-customize\": {\n \"props\": {\n \"colGap\": 2,\n \"preserveLayoutOnMobile\": true,\n \"colSizing\": \"auto\"\n },\n \"children\": [\n \"flex-layout.col#product-assembly-image\",\n \"flex-layout.col#item-customize-middle\",\n \"flex-layout.col#item-customize-quantity\"\n ]\n },\n \"flex-layout.col#item-customize-middle\": {\n \"props\": {\n \"width\": \"grow\",\n \"verticalAlignment\": \"middle\"\n },\n \"children\": [\n \"assembly-option-item-name\",\n \"assembly-option-item-price\",\n \"assembly-option-item-children-description\",\n \"assembly-option-item-customize#sec-level\"\n ]\n },\n \"flex-layout.col#item-customize-quantity\": {\n \"props\": {\n \"horizontalAlign\": \"right\",\n \"verticalAlign\": \"middle\"\n },\n \"children\": [\n \"assembly-option-item-quantity-selector\"\n ]\n },\n \"assembly-option-item-customize#sec-level\": {\n \"props\": {\n \"buttonProps\": {\n \"collapse\": \"left\"\n }\n },\n \"children\": [\n \"assembly-option-item-image\",\n \"assembly-option-item-name\",\n \"assembly-option-item-price\",\n \"assembly-option-item-quantity-selector\"\n ]\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_b557897d
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/pdp/product-gifts.jsonc from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"product-gifts\": {\n \"props\": {\n \"maxVisibleItems\": {\n \"desktop\": 1,\n \"mobile\": 1\n }\n },\n \"children\": [\"flex-layout.row#product-gifts-text\", \"product-gift-list\"]\n },\n\n \"flex-layout.row#product-gifts-text\": {\n \"props\": {\n \"verticalAlign\": \"middle\",\n \"colSizing\": \"auto\",\n \"preserveLayoutOnMobile\": true\n },\n \"children\": [\n \"rich-text#product-gifts\",\n \"flex-layout.col#product-gifts-text\"\n ]\n },\n \"flex-layout.col#product-gifts-text\": {\n \"children\": [\"modal-trigger#product-gifts\"],\n \"props\": {\n \"verticalAlign\": \"middle\"\n }\n },\n \"rich-text#product-gifts\": {\n \"props\": {\n \"text\": \"**+ GIFT**\"\n }\n },\n \"gift-text\": {\n \"props\": {\n \"blockClass\": \"default\",\n \"text\": \"{exceedingItems, plural, =0{} one {+ # gift} other {+ # gifts}}\"\n }\n },\n \"product-gift-list\": {\n \"children\": [\"flex-layout.row#gift\"]\n },\n \"flex-layout.row#gift\": {\n \"props\": {\n \"fullWidth\": true\n },\n \"children\": [\"flex-layout.col#gift-name-description\", \"gift-image\"]\n },\n \"flex-layout.col#gift-name-description\": {\n \"props\": {\n \"verticalAlign\": \"middle\",\n \"rowGap\": 3\n },\n \"children\": [\"gift-name\", \"gift-description\"]\n },\n\n \"modal-trigger#product-gifts\": {\n \"children\": [\"modal-layout#product-gifts\", \"gift-text\"],\n \"props\": {\n \"blockClass\": \"product-gifts\"\n }\n },\n \"modal-layout#product-gifts\": {\n \"props\": {\n \"blockClass\": \"product-gifts\",\n \"fullScreen\": {\n \"phone\": true,\n \"desktop\": false,\n \"tablet\": false\n }\n },\n \"children\": [\"product-gifts#modal\"]\n },\n\n \"product-gifts#modal\": {\n \"children\": [\"product-gift-list\"]\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_64cbada9
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/pdp/product.jsonc from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"store.product\": {\n \"children\": [\n \"flex-layout.row#product-breadcrumb\",\n \"condition-layout.product#availability\",\n \"flex-layout.row#description\",\n \"flex-layout.row#specifications-title\",\n \"product-specification-group#table\",\n \"shelf.relatedProducts\",\n \"product-reviews\",\n \"product-questions-and-answers\"\n ]\n },\n \"flex-layout.row#specifications-title\": {\n \"children\": [\"rich-text#specifications\"]\n },\n \"rich-text#specifications\": {\n \"props\": {\n \"text\": \"##### Product Specifications\"\n }\n },\n \"flex-layout.row#product-breadcrumb\": {\n \"props\": {\n \"marginTop\": 4\n },\n \"children\": [\"breadcrumb\"]\n },\n \"flex-layout.row#description\": {\n \"props\": {\n \"marginBottom\": 7\n },\n \"children\": [\"product-description\"]\n },\n \"condition-layout.product#availability\": {\n \"props\": {\n \"conditions\": [\n {\n \"subject\": \"isProductAvailable\"\n }\n ],\n \"Then\": \"flex-layout.row#product-main\",\n \"Else\": \"flex-layout.row#product-availability\"\n }\n },\n \"flex-layout.row#product-main\": {\n \"props\": {\n \"colGap\": 7,\n \"rowGap\": 7,\n \"marginTop\": 4,\n \"marginBottom\": 7,\n \"paddingTop\": 7,\n \"paddingBottom\": 7\n },\n \"children\": [\"flex-layout.col#stack\", \"flex-layout.col#right-col\"]\n },\n\n \"stack-layout\": {\n \"props\": {\n \"blockClass\": \"product\"\n },\n \"children\": [\n \"flex-layout.row#product-image\",\n \"product-bookmark\",\n \"product-specification-badges\"\n ]\n },\n\n \"product-specification-badges\": {\n \"props\": {\n \"specificationGroupName\": \"Group\",\n \"specificationName\": \"On Sale\",\n \"visibleWhen\": \"True\",\n \"displayValue\": \"SPECIFICATION_NAME\"\n }\n },\n\n \"flex-layout.col#stack\": {\n \"children\": [\"stack-layout\"],\n \"props\": {\n \"width\": \"60%\",\n \"rowGap\": 0\n }\n },\n \"flex-layout.row#product-image\": {\n \"children\": [\"product-images\"]\n },\n \"product-images\": {\n \"props\": {\n \"aspectRatio\": {\n \"desktop\": \"auto\",\n \"phone\": \"16:9\"\n },\n \"displayThumbnailsArrows\": true\n }\n },\n \"flex-layout.col#right-col\": {\n \"props\": {\n \"preventVerticalStretch\": true,\n \"rowGap\": 0\n },\n \"children\": [\n \"flex-layout.row#product-name\",\n \"product-rating-summary\",\n \"flex-layout.row#list-price-savings\",\n \"flex-layout.row#selling-price\",\n \"product-teaser.product.affirm\",\n \"product-installments\",\n \"product-separator\",\n \"product-identifier.product\",\n \"sku-selector\",\n \"product-quantity\",\n \"product-assembly-options\",\n \"product-gifts\",\n \"flex-layout.row#buy-button\",\n \"availability-subscriber\",\n \"shipping-simulator\",\n \"share#default\"\n ]\n },\n\n \"flex-layout.row#product-name\": {\n \"props\": {\n \"marginBottom\": 3\n },\n \"children\": [\"vtex.store-components:product-name\"]\n },\n\n \"sku-selector\": {\n \"props\": {\n \"variationsSpacing\": 3,\n \"showValueNameForImageVariation\": true\n }\n },\n\n \"flex-layout.row#buy-button\": {\n \"props\": {\n \"marginTop\": 4,\n \"marginBottom\": 7\n },\n \"children\": [\n \"add-to-cart-button\"\n ]\n },\n\n \"flex-layout.row#product-availability\": {\n \"props\": {\n \"colGap\": 7,\n \"marginTop\": 4,\n \"marginBottom\": 7,\n \"paddingTop\": 7\n },\n \"children\": [\n \"product-teaser.summary.affirm\",\n \"flex-layout.col#stack\",\n \"flex-layout.col#right-col-availability\"\n ]\n },\n \"flex-layout.col#right-col-availability\": {\n \"props\": {\n \"preventVerticalStretch\": true,\n \"rowGap\": 0,\n \"blockClass\": \"info-availability\"\n },\n \"children\": [\n \"flex-layout.row#product-name\",\n \"product-identifier.product\",\n \"sku-selector\",\n \"flex-layout.row#availability\"\n ]\n },\n \"flex-layout.row#availability\": {\n \"props\": {\n \"blockClass\": \"message-availability\"\n },\n \"children\": [\"availability-subscriber\"]\n },\n\n \"share#default\": {\n \"props\": {\n \"social\": {\n \"Facebook\": true,\n \"WhatsApp\": true,\n \"Twitter\": false,\n \"Pinterest\": true\n }\n }\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_260b4b1b
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/pdp/product-specifications-table.jsonc from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"product-specification-group#table\": {\n \"children\": [\n \"flex-layout.row#spec-group\"\n ]\n },\n \"flex-layout.row#spec-group\": {\n \"props\": {\n \"blockClass\": \"productSpecificationGroup\"\n },\n \"children\": [\n \"flex-layout.col#spec-group\"\n ]\n },\n \"flex-layout.col#spec-group\": {\n \"children\": [\n \"flex-layout.row#spec-group-name\",\n \"product-specification\"\n ]\n },\n \"flex-layout.row#spec-group-name\": {\n \"props\": {\n \"blockClass\": \"productSpecificationGroupName\"\n },\n \"children\": [\n \"product-specification-text#group\"\n ]\n },\n \"product-specification\": {\n \"children\": [\n \"flex-layout.row#spec-item\"\n ]\n },\n \"flex-layout.row#spec-item\": {\n \"props\": {\n \"blockClass\": \"productSpecification\"\n },\n \"children\": [\n \"flex-layout.col#spec-name\",\n \"flex-layout.col#spec-value\"\n ]\n },\n \"flex-layout.col#spec-name\": {\n \"props\": {\n \"blockClass\": \"productSpecificationName\",\n \"width\": {\n \"mobile\": \"50%\",\n \"desktop\": \"25%\"\n }\n },\n \"children\": [\n \"product-specification-text#specification\"\n ]\n },\n \"flex-layout.col#spec-value\": {\n \"props\": {\n \"blockClass\": \"productSpecificationValue\"\n },\n \"children\": [\n \"product-specification-values\"\n ]\n },\n \"product-specification-values\": {\n \"children\": [\n \"product-specification-text#value\"\n ]\n },\n \"product-specification-text#group\": {\n \"props\": {\n \"message\": \"{groupName}\"\n }\n },\n \"product-specification-text#specification\": {\n \"props\": {\n \"message\": \"{specificationName}\"\n }\n },\n \"product-specification-text#value\": {\n \"props\": {\n \"message\": \"{specificationValue}\"\n }\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_f6224693
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/header/category-menu.json from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"vtex.menu@2.x:menu#category-menu\": {\n \"props\": {\n \"experimentalOptimizeRendering\": true\n },\n \"children\": [\n \"menu-item#category-apparel\",\n \"menu-item#category-home\",\n \"menu-item#more\"\n ]\n },\n \"menu-item#category-apparel\": {\n \"props\": {\n \"id\": \"menu-item-category-apparel\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/apparel---accessories/\",\n \"noFollow\": false,\n \"tagTitle\": \"Apparel & Accessories\",\n \"text\": \"Apparel & Accessories\"\n }\n },\n \"blocks\": [\n \"vtex.menu@2.x:submenu#category-apparel\"\n ]\n },\n \"vtex.menu@2.x:submenu#category-apparel\": {\n \"props\": {\n \"width\": \"auto\"\n },\n \"children\": [\n \"vtex.menu@2.x:menu#category-apparel\"\n ]\n },\n \"vtex.menu@2.x:menu#category-apparel\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#category-apparel-clothing\",\n \"menu-item#category-apparel-accessories\",\n \"menu-item#category-apparel-eyeglasses\"\n ]\n },\n \"menu-item#category-apparel-clothing\": {\n \"props\": {\n \"id\": \"menu-item-category-apparel-clothing\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/apparel---accessories/clothing/\",\n \"noFollow\": false,\n \"tagTitle\": \"Clothing\",\n \"text\": \"Clothing\"\n }\n }\n },\n \"menu-item#category-apparel-accessories\": {\n \"props\": {\n \"id\": \"menu-item-category-apparel-accessories\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/apparel---accessories/accessories/\",\n \"noFollow\": false,\n \"tagTitle\": \"Accessories\",\n \"text\": \"Accessories\"\n }\n }\n },\n \"menu-item#category-apparel-eyeglasses\": {\n \"props\": {\n \"id\": \"menu-item-category-apparel-eyeglasses\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/apparel---accessories/eyeglasses/\",\n \"noFollow\": false,\n \"tagTitle\": \"Eyeglasses\",\n \"text\": \"Eyeglasses\"\n }\n }\n },\n \"menu-item#category-home\": {\n \"props\": {\n \"id\": \"menu-item-category-home\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/home---decor/\",\n \"noFollow\": false,\n \"tagTitle\": \"Home & Decor\",\n \"text\": \"Home & Decor\"\n }\n }\n },\n \"menu-item#more\": {\n \"props\": {\n \"id\": \"menu-item-custom-sale\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": true,\n \"tagTitle\": \"More\",\n \"text\": \"More\"\n }\n },\n \"blocks\": [\n \"vtex.menu@2.x:submenu#more\"\n ]\n },\n \"vtex.menu@2.x:submenu#more\": {\n \"props\": {\n \"width\": \"100%\"\n },\n \"children\": [\n \"flex-layout.row#menu-more\"\n ]\n },\n \"flex-layout.row#menu-more\": {\n \"children\": [\n \"flex-layout.col#menu-more-1\",\n \"flex-layout.col#menu-more-2\"\n ]\n },\n \"flex-layout.col#menu-more-1\": {\n \"children\": [\n \"vtex.menu@2.x:menu#more\"\n ]\n },\n \"flex-layout.col#menu-more-2\": {\n \"children\": [\n \"info-card#home\"\n ]\n },\n \"vtex.menu@2.x:menu#more\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#about-us\",\n \"menu-item#faq\"\n ]\n },\n \"menu-item#about-us\": {\n \"props\": {\n \"id\": \"menu-item-about-us\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/about-us\",\n \"noFollow\": true,\n \"tagTitle\": \"About us\",\n \"text\": \"About us\"\n }\n }\n },\n \"menu-item#faq\": {\n \"props\": {\n \"id\": \"menu-item-faq\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/faq\",\n \"noFollow\": true,\n \"tagTitle\": \"FAQ\",\n \"text\": \"FAQ\"\n }\n }\n },\n \"menu-item#contact-us\": {\n \"props\": {\n \"id\": \"menu-item-contact-us\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/contact-us\",\n \"noFollow\": true,\n \"tagTitle\": \"Contact Us\",\n \"text\": \"Contact Us\"\n }\n }\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_250c1a55
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/header/header.jsonc from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"header\": {\n \"blocks\": [\"header-layout.desktop\", \"header-layout.mobile\"]\n },\n \"header.full\": {\n \"blocks\": [\"header-layout.desktop\", \"header-layout.mobile\"]\n },\n \"header-layout.desktop\": {\n \"children\": [\n \"flex-layout.row#1-desktop\",\n \"flex-layout.row#3-desktop\",\n \"sticky-layout#4-desktop\"\n ]\n },\n\n \"flex-layout.row#1-desktop\": {\n \"children\": [\"telemarketing\"],\n \"props\": {\n \"fullWidth\": true\n }\n },\n \n \"flex-layout.row#3-desktop\": {\n \"props\": {\n \"blockClass\": \"menu-link\",\n \"horizontalAlign\": \"center\",\n \"preventHorizontalStretch\": true,\n \"preventVerticalStretch\": true,\n \"fullWidth\": true\n },\n \"children\": [\n \"vtex.menu@2.x:menu#websites\",\n \"flex-layout.col#spacer\",\n \"vtex.menu@2.x:menu#institutional\"\n ]\n },\n \"flex-layout.col#spacer\": {\n \"props\": {\n \"width\": \"grow\"\n }\n },\n \"sticky-layout#4-desktop\": {\n \"props\": {\n \"blockClass\": \"sticky-header\"\n },\n \"children\": [\"flex-layout.row#4-desktop\"]\n },\n \"flex-layout.row#4-desktop\": {\n \"props\": {\n \"blockClass\": \"main-header\",\n \"horizontalAlign\": \"center\",\n \"verticalAlign\": \"center\",\n \"preventHorizontalStretch\": true,\n \"preventVerticalStretch\": true,\n \"fullWidth\": true\n },\n \"children\": [\n \"flex-layout.col#logo-desktop\",\n \"flex-layout.col#category-menu\",\n \"flex-layout.col#spacer\",\n \"search-bar\",\n \"locale-switcher\",\n \"login\",\n \"minicart.v2\"\n ]\n },\n \"flex-layout.col#logo-desktop\": {\n \"props\": {\n \"verticalAlign\": \"middle\"\n },\n \"children\": [\"logo#desktop\"]\n },\n \"flex-layout.col#category-menu\": {\n \"props\": {\n \"verticalAlign\": \"middle\"\n },\n \"children\": [\"vtex.menu@2.x:menu#category-menu\"]\n },\n \"logo#desktop\": {\n \"props\": {\n \"title\": \"Logo\",\n \"href\": \"/\",\n \"url\": \"https://storecomponents.vteximg.com.br/arquivos/store-theme-logo.png\",\n \"width\": \"180\",\n \"height\": \"12\"\n }\n },\n \"header-layout.mobile\": {\n \"children\": [\"sticky-layout#1-mobile\"]\n },\n \"sticky-layout#1-mobile\": {\n \"children\": [\"flex-layout.row#1-mobile\"]\n },\n \"flex-layout.row#1-mobile\": {\n \"children\": [\n \"drawer\",\n \"logo#mobile\",\n \"flex-layout.col#spacer\",\n \"login\",\n \"minicart.v2\"\n ],\n \"props\": {\n \"blockClass\": \"main-header-mobile\",\n \"preventHorizontalStretch\": true,\n \"preserveLayoutOnMobile\": true,\n \"fullWidth\": true\n }\n },\n \"drawer\": {\n \"children\": [\"menu#drawer\"]\n },\n\n \"menu#drawer\": {\n \"children\": [\n \"menu-item#category-apparel\",\n \"menu-item#category-home\",\n \"menu-item#more\"\n ],\n \"props\": {\n \"orientation\": \"vertical\"\n }\n },\n\n \"logo#mobile\": {\n \"props\": {\n \"title\": \"Logo\",\n \"href\": \"/\",\n \"url\": \"https://storecomponents.vteximg.com.br/arquivos/store-theme-logo-mobile.png\",\n \"width\": \"77.5\",\n \"height\": \"27.5\"\n }\n }\n}\n\n```"
}
] |
code_affirm-qa-theme_3d6af674
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of affirm-qa-theme/store/blocks/header/top-menu.json from the affirm-qa-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"vtex.menu@2.x:menu#websites\": {\n \"children\": [\n \"menu-item#shop\",\n \"menu-item#about-us\"\n ]\n },\n \"menu-item#shop\": {\n \"props\": {\n \"id\": \"menu-item-shop\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"Shop\",\n \"text\": \"Shop\"\n }\n }\n },\n \"vtex.menu@2.x:menu#institutional\": {\n \"children\": [\n \"menu-item#vtex-website\"\n ]\n },\n \"menu-item#vtex-website\": {\n \"props\": {\n \"id\": \"menu-item-vtex-website\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"external\",\n \"href\": \"http://vtex.com\",\n \"noFollow\": false,\n \"tagTitle\": \"visit vtex.com\",\n \"text\": \"visit vtex.com\"\n }\n }\n }\n}\n\n```"
}
] |
code_instore-profile_50fdcf44
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/messages/de.json from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"profile-form.optional\": \"Wahlweise\",\n \"profile-form.include-business\": \"Geschäftsfelder einbeziehen\",\n \"profile-form.exclude-business\": \"Nicht Geschäftsfelder umfassend\",\n \"profile-form.save-changes\": \"Änderungen speichern\",\n \"profile-form.field.firstName\": \"Vorname\",\n \"profile-form.field.lastName\": \"Nachname\",\n \"profile-form.field.email\": \"E-Мail\",\n \"profile-form.field.changeIdentifiedClient\": \"Den identifizierten Kunden ändern\",\n \"profile-form.field.gender\": \"Geschlecht\",\n \"profile-form.field.custom-gender\": \"vom Benutzer definiertes Geschlecht\",\n \"profile-form.field.document\": \"Dokument\",\n \"profile-form.field.birthDate\": \"Geburtstag\",\n \"profile-form.field.homePhone\": \"Festnetztelefon\",\n \"profile-form.field.businessPhone\": \"Unternehmenstelefon\",\n \"profile-form.field.corporateDocument\": \"Unternehmensdokument\",\n \"profile-form.field.corporateName\": \"Firmenname\",\n \"profile-form.field.stateRegistration\": \"Staatliche Registrierung\",\n \"profile-form.field.noStateRegistration\": \"Von der staatlichen Registrierung ausgenommen\",\n \"profile-form.field.exemptStateRegistration\": \"Excento\",\n \"profile-form.field.tradeName\": \"Handelsname\",\n \"profile-form.field.ARG_cuit\": \"CUIT\",\n \"profile-form.field.ARG_dni\": \"DNI\",\n \"profile-form.field.BRA_cnpj\": \"CNPJ\",\n \"profile-form.field.BRA_cpf\": \"CPF\",\n \"profile-form.field.CHL_rut\": \"RUT\",\n \"profile-form.field.COL_cedula\": \"Staatsbürgerschaftskarte\",\n \"profile-form.field.COL_rut\": \"RUT\",\n \"profile-form.field.CRI_cedula\": \"Gesetzliche Nummer\",\n \"profile-form.field.ECU_cedula\": \"Ausweis\",\n \"profile-form.field.ECU_ruc\": \"RUC\",\n \"profile-form.field.ESP_cif\": \"CIF\",\n \"profile-form.field.ESP_dni\": \"DNI\",\n \"profile-form.field.GTM_dpi\": \"DPI\",\n \"profile-form.field.GTM_nit\": \"NIT\",\n \"profile-form.field.MEX_rfc_corporate\": \"RFC (korporativ)\",\n \"profile-form.field.MEX_rfc\": \"RFC\",\n \"profile-form.field.PAN_cip\": \"CIP\",\n \"profile-form.field.PAN_ruc\": \"RUC\",\n \"profile-form.field.PER_document\": \"Ausweisdokument\",\n \"profile-form.field.PER_ruc\": \"RUC\",\n \"profile-form.field.PRT_nif\": \"NIF\",\n \"profile-form.field.PRT_nipc\": \"NIPC\",\n \"profile-form.field.PRY_cedula\": \"Ausweis\",\n \"profile-form.field.PRY_ruc\": \"RUC\",\n \"profile-form.field.URY_cedula\": \"Ausweis\",\n \"profile-form.field.URY_rut\": \"RUT\",\n \"profile-form.field.USA_ssn\": \"SSN\",\n \"profile-form.field.VEN_cedula\": \"Ausweis\",\n \"profile-form.field.VEN_rif\": \"RIF\",\n \"profile-form.error.EMPTY_FIELD\": \"Das Feld ist verpflichtend.\",\n \"profile-form.error.INVALID_FIELD\": \"Ungültiger Wert.\",\n \"profile-form.gender.custom\": \"Personalisiert\",\n \"profile-form.gender.male\": \"Mann\",\n \"profile-form.gender.female\": \"Frau\",\n \"profile-form.gender.agender\": \"A-Geschlecht\",\n \"profile-form.gender.androgyne\": \"Androgyne\",\n \"profile-form.gender.bigender\": \"Bigeschlecht\",\n \"profile-form.gender.genderfluid\": \"Genderfluid\",\n \"profile-form.gender.nonconforming\": \"Nicht konformes Geschlecht\",\n \"profile-form.gender.questioning\": \"Geschlecht-Befragung\",\n \"profile-form.gender.variant\": \"Geschlecht-Variante\",\n \"profile-form.gender.genderqueer\": \"Genderqueer\",\n \"profile-form.gender.neutrois\": \"Neutrois\",\n \"profile-form.gender.other\": \"Andere\",\n \"profile-form.gender.pangender\": \"Pangeschlecht\",\n \"profile-form.gender.transgender\": \"Transgender\",\n \"profile-form.gender.transsexual\": \"Transsexuelle\",\n \"profile-form.button.submit\": \"Submit\"\n}\n```"
}
] |
code_instore-profile_ca96796e
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/messages/pt.json from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"profile-form.optional\": \"Opcional\",\n \"profile-form.include-business\": \"Incluir campos de pessoa jurídica\",\n \"profile-form.exclude-business\": \"Não incluir campos de pessoa jurídica\",\n \"profile-form.save-changes\": \"Salvar alterações\",\n \"profile-form.field.firstName\": \"Nome\",\n \"profile-form.field.lastName\": \"Sobrenome\",\n \"profile-form.field.email\": \"E-mail\",\n \"profile-form.field.changeIdentifiedClient\": \"Mudar o cliente identificado\",\n \"profile-form.field.gender\": \"Gênero\",\n \"profile-form.field.custom-gender\": \"Gênero Personalizado\",\n \"profile-form.field.document\": \"Documento\",\n \"profile-form.field.birthDate\": \"Data de Nascimento\",\n \"profile-form.field.homePhone\": \"Telefone\",\n \"profile-form.field.businessPhone\": \"Telefone Corporativo\",\n \"profile-form.field.corporateDocument\": \"Documento Corporativo\",\n \"profile-form.field.corporateName\": \"Razão Social\",\n \"profile-form.field.stateRegistration\": \"Inscrição Estadual\",\n \"profile-form.field.noStateRegistration\": \"Isento de Inscrição Estadual\",\n \"profile-form.field.exemptStateRegistration\": \"Isento\",\n \"profile-form.field.tradeName\": \"Nome Fantasia\",\n \"profile-form.field.ARG_cuit\": \"CUIT\",\n \"profile-form.field.ARG_dni\": \"DNI\",\n \"profile-form.field.BRA_cnpj\": \"CNPJ\",\n \"profile-form.field.BRA_cpf\": \"CPF\",\n \"profile-form.field.CHL_rut\": \"RUT\",\n \"profile-form.field.COL_cedula\": \"Cédula de Ciudadanía\",\n \"profile-form.field.COL_rut\": \"RUT\",\n \"profile-form.field.CRI_cedula\": \"Cédula Jurídica\",\n \"profile-form.field.ECU_cedula\": \"Cédula\",\n \"profile-form.field.ECU_ruc\": \"RUC\",\n \"profile-form.field.ESP_cif\": \"CIF\",\n \"profile-form.field.ESP_dni\": \"DNI\",\n \"profile-form.field.GTM_dpi\": \"DPI\",\n \"profile-form.field.GTM_nit\": \"NIT\",\n \"profile-form.field.MEX_rfc_corporate\": \"RFC (empresa)\",\n \"profile-form.field.MEX_rfc\": \"RFC\",\n \"profile-form.field.PAN_cip\": \"CIP\",\n \"profile-form.field.PAN_ruc\": \"RUC\",\n \"profile-form.field.PER_document\": \"Documento de Identidad\",\n \"profile-form.field.PER_ruc\": \"RUC\",\n \"profile-form.field.PRT_nif\": \"NIF\",\n \"profile-form.field.PRT_nipc\": \"NIPC\",\n \"profile-form.field.PRY_cedula\": \"Cédula de Identidad\",\n \"profile-form.field.PRY_ruc\": \"RUC\",\n \"profile-form.field.URY_cedula\": \"Cédula\",\n \"profile-form.field.URY_rut\": \"RUT\",\n \"profile-form.field.USA_ssn\": \"SSN\",\n \"profile-form.field.VEN_cedula\": \"Cédula de Identidad\",\n \"profile-form.field.VEN_rif\": \"RIF\",\n \"profile-form.error.EMPTY_FIELD\": \"Este campo é obrigatório.\",\n \"profile-form.error.INVALID_FIELD\": \"Valor inválido.\",\n \"profile-form.gender.custom\": \"Personalizado\",\n \"profile-form.gender.male\": \"Masculino\",\n \"profile-form.gender.female\": \"Feminino\",\n \"profile-form.gender.agender\": \"Agênero\",\n \"profile-form.gender.androgyne\": \"Andrógino\",\n \"profile-form.gender.bigender\": \"Bigênero\",\n \"profile-form.gender.genderfluid\": \"Gênero Fluido\",\n \"profile-form.gender.nonconforming\": \"Gênero Não-conformante\",\n \"profile-form.gender.questioning\": \"Questionador de Gênero\",\n \"profile-form.gender.variant\": \"Variante de Gênero\",\n \"profile-form.gender.genderqueer\": \"Não-binário\",\n \"profile-form.gender.neutrois\": \"Neutro\",\n \"profile-form.gender.other\": \"Outros\",\n \"profile-form.gender.pangender\": \"Pangênero\",\n \"profile-form.gender.transgender\": \"Transgênero\",\n \"profile-form.gender.transsexual\": \"Transsexual\",\n \"profile-form.button.submit\": \"Enviar\"\n}\n```"
}
] |
code_instore-profile_b948aadc
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/messages/en.json from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"profile-form.optional\": \"Optional\",\n \"profile-form.include-business\": \"Include business fields\",\n \"profile-form.exclude-business\": \"Do not include business fields\",\n \"profile-form.save-changes\": \"Save changes\",\n \"profile-form.field.firstName\": \"First Name\",\n \"profile-form.field.lastName\": \"Last Name\",\n \"profile-form.field.email\": \"E-mail\",\n \"profile-form.field.changeIdentifiedClient\": \"Change identified client\",\n \"profile-form.field.gender\": \"Gender\",\n \"profile-form.field.custom-gender\": \"Custom gender\",\n \"profile-form.field.document\": \"Document\",\n \"profile-form.field.birthDate\": \"Birth date\",\n \"profile-form.field.homePhone\": \"Phone\",\n \"profile-form.field.businessPhone\": \"Corporate Phone\",\n \"profile-form.field.corporateDocument\": \"Coporate Document\",\n \"profile-form.field.corporateName\": \"Corporate Name\",\n \"profile-form.field.stateRegistration\": \"State Registration\",\n \"profile-form.field.noStateRegistration\": \"No State Registration\",\n \"profile-form.field.exemptStateRegistration\": \"Exempt\",\n \"profile-form.field.tradeName\": \"Trade Name\",\n \"profile-form.field.ARG_cuit\": \"CUIT\",\n \"profile-form.field.ARG_dni\": \"DNI\",\n \"profile-form.field.BRA_cnpj\": \"CNPJ\",\n \"profile-form.field.BRA_cpf\": \"CPF\",\n \"profile-form.field.CHL_rut\": \"RUT\",\n \"profile-form.field.COL_cedula\": \"Cédula de Ciudadanía\",\n \"profile-form.field.COL_rut\": \"RUT\",\n \"profile-form.field.CRI_cedula\": \"Cédula Jurídica\",\n \"profile-form.field.ECU_cedula\": \"Cédula\",\n \"profile-form.field.ECU_ruc\": \"RUC\",\n \"profile-form.field.ESP_cif\": \"CIF\",\n \"profile-form.field.ESP_dni\": \"DNI\",\n \"profile-form.field.GTM_dpi\": \"DPI\",\n \"profile-form.field.GTM_nit\": \"NIT\",\n \"profile-form.field.MEX_rfc_corporate\": \"RFC (corporate)\",\n \"profile-form.field.MEX_rfc\": \"RFC\",\n \"profile-form.field.PAN_cip\": \"CIP\",\n \"profile-form.field.PAN_ruc\": \"RUC\",\n \"profile-form.field.PER_document\": \"Documento de Identidad\",\n \"profile-form.field.PER_ruc\": \"RUC\",\n \"profile-form.field.PRT_nif\": \"NIF\",\n \"profile-form.field.PRT_nipc\": \"NIPC\",\n \"profile-form.field.PRY_cedula\": \"Cédula de Identidad\",\n \"profile-form.field.PRY_ruc\": \"RUC\",\n \"profile-form.field.URY_cedula\": \"Cédula\",\n \"profile-form.field.URY_rut\": \"RUT\",\n \"profile-form.field.USA_ssn\": \"SSN\",\n \"profile-form.field.VEN_cedula\": \"Cédula de Identidad\",\n \"profile-form.field.VEN_rif\": \"RIF\",\n \"profile-form.error.EMPTY_FIELD\": \"This field is mandatory.\",\n \"profile-form.error.INVALID_FIELD\": \"Invalid value.\",\n \"profile-form.gender.custom\": \"Custom\",\n \"profile-form.gender.male\": \"Male\",\n \"profile-form.gender.female\": \"Female\",\n \"profile-form.gender.agender\": \"Agender\",\n \"profile-form.gender.androgyne\": \"Androgyne\",\n \"profile-form.gender.bigender\": \"Bigender\",\n \"profile-form.gender.genderfluid\": \"Genderfluid\",\n \"profile-form.gender.nonconforming\": \"Gender nonconforming\",\n \"profile-form.gender.questioning\": \"Gender questioning\",\n \"profile-form.gender.variant\": \"Gender variant\",\n \"profile-form.gender.genderqueer\": \"Genderqueer\",\n \"profile-form.gender.neutrois\": \"Neutrois\",\n \"profile-form.gender.other\": \"Other\",\n \"profile-form.gender.pangender\": \"Pangender\",\n \"profile-form.gender.transgender\": \"Transgender\",\n \"profile-form.gender.transsexual\": \"Transsexual\",\n \"profile-form.button.submit\": \"Submit\"\n}\n```"
}
] |
code_instore-profile_e25337d8
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/messages/pt-PT.json from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"profile-form.save-changes\": \"Guardar alterações\",\n \"profile-form.field.firstName\": \"Nome\",\n \"profile-form.field.lastName\": \"Apelido\",\n \"profile-form.field.gender\": \"Género\",\n \"profile-form.field.custom-gender\": \"Género Personalizado\",\n \"profile-form.field.birthDate\": \"Data de nascimento\",\n \"profile-form.field.homePhone\": \"Telefone de casa\",\n \"profile-form.field.businessPhone\": \"Telefone do Trabalho\",\n \"profile-form.field.corporateDocument\": \"Documento Comprovativo de Trabalho\",\n \"profile-form.field.corporateName\": \"Nome da Entidade Empregadora\",\n \"profile-form.field.stateRegistration\": \"Registro Civil\",\n \"profile-form.field.tradeName\": \"Nome fantasia\",\n \"profile-form.error.INVALID_FIELD\": \"Conteúdo de Campo Inválido.\"\n}\n\n```"
}
] |
code_instore-profile_d0d013a0
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/messages/it.json from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"profile-form.optional\": \"Opzionale\",\n \"profile-form.include-business\": \"Includere i campi aziendali\",\n \"profile-form.exclude-business\": \"Non includere i campi aziendali\",\n \"profile-form.save-changes\": \"Salva le modifiche\",\n \"profile-form.field.firstName\": \"Nome\",\n \"profile-form.field.lastName\": \"Cognome\",\n \"profile-form.field.email\": \"E-mail\",\n \"profile-form.field.changeIdentifiedClient\": \"Cambia il cliente identificato\",\n \"profile-form.field.gender\": \"Sesso\",\n \"profile-form.field.custom-gender\": \"Sesso personalizzato\",\n \"profile-form.field.document\": \"Documento\",\n \"profile-form.field.birthDate\": \"Data di nascita\",\n \"profile-form.field.homePhone\": \"Telefono di casa\",\n \"profile-form.field.businessPhone\": \"Telefono aziendale\",\n \"profile-form.field.corporateDocument\": \"Documento aziendale\",\n \"profile-form.field.corporateName\": \"Nome aziendale\",\n \"profile-form.field.stateRegistration\": \"Registrazione statale\",\n \"profile-form.field.noStateRegistration\": \"Esente dalla registrazione statale\",\n \"profile-form.field.exemptStateRegistration\": \"Excento\",\n \"profile-form.field.tradeName\": \"Nome commerciale\",\n \"profile-form.field.ARG_cuit\": \"CUIT\",\n \"profile-form.field.ARG_dni\": \"DNI\",\n \"profile-form.field.BRA_cnpj\": \"CNPJ\",\n \"profile-form.field.BRA_cpf\": \"CPF\",\n \"profile-form.field.CHL_rut\": \"RUT\",\n \"profile-form.field.COL_cedula\": \"Carta d'identità\",\n \"profile-form.field.COL_rut\": \"RUT\",\n \"profile-form.field.CRI_cedula\": \"Codice Identificativo dell'azienda\",\n \"profile-form.field.ECU_cedula\": \"Carta d'identità\",\n \"profile-form.field.ECU_ruc\": \"RUC\",\n \"profile-form.field.ESP_cif\": \"CIF\",\n \"profile-form.field.ESP_dni\": \"DNI\",\n \"profile-form.field.GTM_dpi\": \"DPI\",\n \"profile-form.field.GTM_nit\": \"NIT\",\n \"profile-form.field.MEX_rfc_corporate\": \"RFC (aziendale)\",\n \"profile-form.field.MEX_rfc\": \"RFC\",\n \"profile-form.field.PAN_cip\": \"CIP\",\n \"profile-form.field.PAN_ruc\": \"RUC\",\n \"profile-form.field.PER_document\": \"Documento di identità\",\n \"profile-form.field.PER_ruc\": \"RUC\",\n \"profile-form.field.PRT_nif\": \"NIF\",\n \"profile-form.field.PRT_nipc\": \"NIPC\",\n \"profile-form.field.PRY_cedula\": \"Carta d'identità\",\n \"profile-form.field.PRY_ruc\": \"RUC\",\n \"profile-form.field.URY_cedula\": \"Carta d'identità\",\n \"profile-form.field.URY_rut\": \"RUT\",\n \"profile-form.field.USA_ssn\": \"SSN\",\n \"profile-form.field.VEN_cedula\": \"Carta d'identità\",\n \"profile-form.field.VEN_rif\": \"RIF\",\n \"profile-form.error.EMPTY_FIELD\": \"Questo campo è obbligatorio.\",\n \"profile-form.error.INVALID_FIELD\": \"Valore non valido.\",\n \"profile-form.gender.custom\": \"Personalizzato\",\n \"profile-form.gender.male\": \"Uomo\",\n \"profile-form.gender.female\": \"Donna\",\n \"profile-form.gender.agender\": \"Senza genere\",\n \"profile-form.gender.androgyne\": \"Androgeno\",\n \"profile-form.gender.bigender\": \"Bigender\",\n \"profile-form.gender.genderfluid\": \"Genderfluid\",\n \"profile-form.gender.nonconforming\": \"Nessuna conformità al genere\",\n \"profile-form.gender.questioning\": \"Interrogativo sul genere\",\n \"profile-form.gender.variant\": \"Genere variabile\",\n \"profile-form.gender.genderqueer\": \"Genderqueer\",\n \"profile-form.gender.neutrois\": \"Neutrois\",\n \"profile-form.gender.other\": \"Altro\",\n \"profile-form.gender.pangender\": \"Pangender\",\n \"profile-form.gender.transgender\": \"Transgender\",\n \"profile-form.gender.transsexual\": \"Transessuale\",\n \"profile-form.button.submit\": \"Submit\"\n}\n```"
}
] |
code_instore-profile_fa9b4e91
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/messages/fr.json from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"profile-form.optional\": \"Optionnel\",\n \"profile-form.include-business\": \"Inclure les champs commerciaux\",\n \"profile-form.exclude-business\": \"Ne pas inclure les champs commerciaux\",\n \"profile-form.save-changes\": \"Sauvegarder les modifications\",\n \"profile-form.field.firstName\": \"Prénom\",\n \"profile-form.field.lastName\": \"Nom de famille\",\n \"profile-form.field.email\": \"E-mail\",\n \"profile-form.field.changeIdentifiedClient\": \"Changer le client identifié\",\n \"profile-form.field.gender\": \"Genre\",\n \"profile-form.field.custom-gender\": \"Genre personnalisé\",\n \"profile-form.field.document\": \"Document\",\n \"profile-form.field.birthDate\": \"Date de naissance\",\n \"profile-form.field.homePhone\": \"Téléphone fixe\",\n \"profile-form.field.businessPhone\": \"Téléphone commercial\",\n \"profile-form.field.corporateDocument\": \"Document commercial\",\n \"profile-form.field.corporateName\": \"Nom de l'entreprise\",\n \"profile-form.field.stateRegistration\": \"Enregistrement d'état\",\n \"profile-form.field.noStateRegistration\": \"Exempt of State Registration\",\n \"profile-form.field.exemptStateRegistration\": \"Excento\",\n \"profile-form.field.tradeName\": \"Nom commercial\",\n \"profile-form.field.ARG_cuit\": \"CUIT\",\n \"profile-form.field.ARG_dni\": \"DNI\",\n \"profile-form.field.BRA_cnpj\": \"CNPJ\",\n \"profile-form.field.BRA_cpf\": \"CPF\",\n \"profile-form.field.CHL_rut\": \"RUT\",\n \"profile-form.field.COL_cedula\": \"Cédula de Ciudadanía\",\n \"profile-form.field.COL_rut\": \"RUT\",\n \"profile-form.field.CRI_cedula\": \"Cédula Jurídica\",\n \"profile-form.field.ECU_cedula\": \"Cédula\",\n \"profile-form.field.ECU_ruc\": \"RUC\",\n \"profile-form.field.ESP_cif\": \"CIF\",\n \"profile-form.field.ESP_dni\": \"DNI\",\n \"profile-form.field.GTM_dpi\": \"DPI\",\n \"profile-form.field.GTM_nit\": \"NIT\",\n \"profile-form.field.MEX_rfc_corporate\": \"RFC (corporate)\",\n \"profile-form.field.MEX_rfc\": \"RFC\",\n \"profile-form.field.PAN_cip\": \"CIP\",\n \"profile-form.field.PAN_ruc\": \"RUC\",\n \"profile-form.field.PER_document\": \"Documento de Identidad\",\n \"profile-form.field.PER_ruc\": \"RUC\",\n \"profile-form.field.PRT_nif\": \"NIF\",\n \"profile-form.field.PRT_nipc\": \"NIPC\",\n \"profile-form.field.PRY_cedula\": \"Cédula de Identidad\",\n \"profile-form.field.PRY_ruc\": \"RUC\",\n \"profile-form.field.URY_cedula\": \"Cédula\",\n \"profile-form.field.URY_rut\": \"RUT\",\n \"profile-form.field.USA_ssn\": \"SSN\",\n \"profile-form.field.VEN_cedula\": \"Cédula de Identidad\",\n \"profile-form.field.VEN_rif\": \"RIF\",\n \"profile-form.error.EMPTY_FIELD\": \"Ce champ est obligatoire.\",\n \"profile-form.error.INVALID_FIELD\": \"Valeur invalide.\",\n \"profile-form.gender.custom\": \"Personnalisé\",\n \"profile-form.gender.male\": \"Homme\",\n \"profile-form.gender.female\": \"Femme\",\n \"profile-form.gender.agender\": \"Agenre\",\n \"profile-form.gender.androgyne\": \"Androgyne\",\n \"profile-form.gender.bigender\": \"Bigenre\",\n \"profile-form.gender.genderfluid\": \"Genre fluide\",\n \"profile-form.gender.nonconforming\": \"Personne non-conforme à un genre\",\n \"profile-form.gender.questioning\": \"En questionnement sur son genre\",\n \"profile-form.gender.variant\": \"Genre variable\",\n \"profile-form.gender.genderqueer\": \"Genderqueer\",\n \"profile-form.gender.neutrois\": \"Neutrois\",\n \"profile-form.gender.other\": \"Autre\",\n \"profile-form.gender.pangender\": \"Pangender\",\n \"profile-form.gender.transgender\": \"Personne transgenre\",\n \"profile-form.gender.transsexual\": \"Personne transsexuelle\",\n \"profile-form.button.submit\": \"Submit\"\n}\n```"
}
] |
code_instore-profile_7fca71f7
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/messages/ro.json from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"profile-form.optional\": \"Facultativ\",\n \"profile-form.include-business\": \"Includeți datele companiei\",\n \"profile-form.exclude-business\": \"Nu includeți datele companiei\",\n \"profile-form.save-changes\": \"Salvează modificările\",\n \"profile-form.field.firstName\": \"Prenume\",\n \"profile-form.field.lastName\": \"Nume\",\n \"profile-form.field.email\": \"E-mail\",\n \"profile-form.field.changeIdentifiedClient\": \"Schimbați clientul identificat\",\n \"profile-form.field.gender\": \"Gen\",\n \"profile-form.field.custom-gender\": \"Gen personalizat\",\n \"profile-form.field.document\": \"Document\",\n \"profile-form.field.birthDate\": \"Data nasterii\",\n \"profile-form.field.homePhone\": \"Telefon fix\",\n \"profile-form.field.businessPhone\": \"Telefon corporativ\",\n \"profile-form.field.corporateDocument\": \"Documentul companiei\",\n \"profile-form.field.corporateName\": \"Nume Companie\",\n \"profile-form.field.stateRegistration\": \"Inscriptia de stat\",\n \"profile-form.field.noStateRegistration\": \"Excepție de la înregistrarea de stat\",\n \"profile-form.field.exemptStateRegistration\": \"Excento\",\n \"profile-form.field.tradeName\": \"Denumire comerciala\",\n \"profile-form.field.ARG_cuit\": \"CUIT\",\n \"profile-form.field.ARG_dni\": \"DNI\",\n \"profile-form.field.BRA_cnpj\": \"CNPJ\",\n \"profile-form.field.BRA_cpf\": \"CPF\",\n \"profile-form.field.CHL_rut\": \"RUT\",\n \"profile-form.field.COL_cedula\": \"Cédula de Ciudadanía\",\n \"profile-form.field.COL_rut\": \"RUT\",\n \"profile-form.field.CRI_cedula\": \"Cédula Jurídica\",\n \"profile-form.field.ECU_cedula\": \"Cédula\",\n \"profile-form.field.ECU_ruc\": \"RUC\",\n \"profile-form.field.ESP_cif\": \"CIF\",\n \"profile-form.field.ESP_dni\": \"DNI\",\n \"profile-form.field.GTM_dpi\": \"DPI\",\n \"profile-form.field.GTM_nit\": \"NIT\",\n \"profile-form.field.MEX_rfc_corporate\": \"RFC (corporate)\",\n \"profile-form.field.MEX_rfc\": \"RFC\",\n \"profile-form.field.PAN_cip\": \"CIP\",\n \"profile-form.field.PAN_ruc\": \"RUC\",\n \"profile-form.field.PER_document\": \"Documento de Identidad\",\n \"profile-form.field.PER_ruc\": \"RUC\",\n \"profile-form.field.PRT_nif\": \"NIF\",\n \"profile-form.field.PRT_nipc\": \"NIPC\",\n \"profile-form.field.PRY_cedula\": \"Cédula de Identidad\",\n \"profile-form.field.PRY_ruc\": \"RUC\",\n \"profile-form.field.URY_cedula\": \"Cédula\",\n \"profile-form.field.URY_rut\": \"RUT\",\n \"profile-form.field.USA_ssn\": \"SSN\",\n \"profile-form.field.VEN_cedula\": \"Cédula de Identidad\",\n \"profile-form.field.VEN_rif\": \"RIF\",\n \"profile-form.error.EMPTY_FIELD\": \"Acest câmp este obligatoriu.\",\n \"profile-form.error.INVALID_FIELD\": \"Valoare invalida.\",\n \"profile-form.gender.custom\": \"Personalizat\",\n \"profile-form.gender.male\": \"Masculin\",\n \"profile-form.gender.female\": \"Feminin\",\n \"profile-form.gender.agender\": \"Agender\",\n \"profile-form.gender.androgyne\": \"Androgyne\",\n \"profile-form.gender.bigender\": \"Bigender\",\n \"profile-form.gender.genderfluid\": \"Genderfluid\",\n \"profile-form.gender.nonconforming\": \"Gender nonconforming\",\n \"profile-form.gender.questioning\": \"Gender questioning\",\n \"profile-form.gender.variant\": \"Gender variant\",\n \"profile-form.gender.genderqueer\": \"Genderqueer\",\n \"profile-form.gender.neutrois\": \"Neutrois\",\n \"profile-form.gender.other\": \"Alte\",\n \"profile-form.gender.pangender\": \"Pangender\",\n \"profile-form.gender.transgender\": \"Transgender\",\n \"profile-form.gender.transsexual\": \"Transsexual\",\n \"profile-form.button.submit\": \"Submit\"\n}\n```"
}
] |
code_instore-profile_e3066345
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/messages/ca.json from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"profile-form.optional\": \"Opcional\",\n \"profile-form.include-business\": \"Afegir dades d'empresa\",\n \"profile-form.exclude-business\": \"No incloeu dades de l'empresa\",\n \"profile-form.save-changes\": \"Guardar canvis\",\n \"profile-form.field.firstName\": \"Nom\",\n \"profile-form.field.lastName\": \"Cognoms\",\n \"profile-form.field.email\": \"Correu\",\n \"profile-form.field.changeIdentifiedClient\": \"Cambiar el cliente identificado\",\n \"profile-form.field.gender\": \"Gènere\",\n \"profile-form.field.custom-gender\": \"Gènere personalitzat\",\n \"profile-form.field.document\": \"Document\",\n \"profile-form.field.birthDate\": \"Data de naixement\",\n \"profile-form.field.homePhone\": \"Telèfon\",\n \"profile-form.field.businessPhone\": \"Telèfon comercial\",\n \"profile-form.field.corporateDocument\": \"Document corporatiu\",\n \"profile-form.field.corporateName\": \"Raó social\",\n \"profile-form.field.stateRegistration\": \"Registre estatal\",\n \"profile-form.field.noStateRegistration\": \"Excento de Inscripción Estatal\",\n \"profile-form.field.exemptStateRegistration\": \"Excento\",\n \"profile-form.field.tradeName\": \"Nom de l'empresa\",\n \"profile-form.field.ARG_cuit\": \"CUIT\",\n \"profile-form.field.ARG_dni\": \"DNI\",\n \"profile-form.field.BRA_cnpj\": \"CNPJ\",\n \"profile-form.field.BRA_cpf\": \"CPF\",\n \"profile-form.field.CHL_rut\": \"RUT\",\n \"profile-form.field.COL_cedula\": \"Cédula de Ciudadanía\",\n \"profile-form.field.COL_rut\": \"RUT\",\n \"profile-form.field.CRI_cedula\": \"Cédula Jurídica\",\n \"profile-form.field.ECU_cedula\": \"Cédula\",\n \"profile-form.field.ECU_ruc\": \"RUC\",\n \"profile-form.field.ESP_cif\": \"CIF\",\n \"profile-form.field.ESP_dni\": \"DNI\",\n \"profile-form.field.GTM_dpi\": \"DPI\",\n \"profile-form.field.GTM_nit\": \"NIT\",\n \"profile-form.field.MEX_rfc_corporate\": \"RFC (empresa)\",\n \"profile-form.field.MEX_rfc\": \"RFC\",\n \"profile-form.field.PAN_cip\": \"CIP\",\n \"profile-form.field.PAN_ruc\": \"RUC\",\n \"profile-form.field.PER_document\": \"Documento de Identidad\",\n \"profile-form.field.PER_ruc\": \"RUC\",\n \"profile-form.field.PRT_nif\": \"NIF\",\n \"profile-form.field.PRT_nipc\": \"NIPC\",\n \"profile-form.field.PRY_cedula\": \"Cédula de Identidad\",\n \"profile-form.field.PRY_ruc\": \"RUC\",\n \"profile-form.field.URY_cedula\": \"Cédula\",\n \"profile-form.field.URY_rut\": \"RUT\",\n \"profile-form.field.USA_ssn\": \"SSN\",\n \"profile-form.field.VEN_cedula\": \"Cédula de Identidad\",\n \"profile-form.field.VEN_rif\": \"RIF\",\n \"profile-form.error.EMPTY_FIELD\": \"Aquest camp és obligatori.\",\n \"profile-form.error.INVALID_FIELD\": \"No vàlid.\",\n \"profile-form.gender.custom\": \"Personalitzat\",\n \"profile-form.gender.male\": \"Home\",\n \"profile-form.gender.female\": \"Dona\",\n \"profile-form.gender.agender\": \"Envelliment\",\n \"profile-form.gender.androgyne\": \"Androgyne\",\n \"profile-form.gender.bigender\": \"Gran gènere\",\n \"profile-form.gender.genderfluid\": \"Gènere fluid\",\n \"profile-form.gender.nonconforming\": \"Gènere no conforme\",\n \"profile-form.gender.questioning\": \"Qüestionament de gènere\",\n \"profile-form.gender.variant\": \"Variant de gènere\",\n \"profile-form.gender.genderqueer\": \"Genderqueer\",\n \"profile-form.gender.neutrois\": \"Neutrois\",\n \"profile-form.gender.other\": \"Un altre\",\n \"profile-form.gender.pangender\": \"Pangender\",\n \"profile-form.gender.transgender\": \"Transgénero\",\n \"profile-form.gender.transsexual\": \"Transsexual\",\n \"profile-form.button.submit\": \"Submit\"\n}\n```"
}
] |
code_instore-profile_5ef8cefb
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/messages/context.json from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"profile-form.optional\": \"profile-form.optional\",\n \"profile-form.include-business\": \"profile-form.include-business\",\n \"profile-form.exclude-business\": \"profile-form.exclude-business\",\n \"profile-form.save-changes\": \"profile-form.save-changes\",\n \"profile-form.field.firstName\": \"profile-form.field.firstName\",\n \"profile-form.field.lastName\": \"profile-form.field.lastName\",\n \"profile-form.field.email\": \"profile-form.field.email\",\n \"profile-form.field.changeIdentifiedClient\": \"profile-form.field.changeIdentifiedClient\",\n \"profile-form.field.gender\": \"profile-form.field.gender\",\n \"profile-form.field.custom-gender\": \"profile-form.field.custom-gender\",\n \"profile-form.field.document\": \"profile-form.field.document\",\n \"profile-form.field.birthDate\": \"profile-form.field.birthDate\",\n \"profile-form.field.homePhone\": \"profile-form.field.homePhone\",\n \"profile-form.field.businessPhone\": \"profile-form.field.businessPhone\",\n \"profile-form.field.corporateDocument\": \"profile-form.field.corporateDocument\",\n \"profile-form.field.corporateName\": \"profile-form.field.corporateName\",\n \"profile-form.field.stateRegistration\": \"profile-form.field.stateRegistration\",\n \"profile-form.field.noStateRegistration\": \"profile-form.field.noStateRegistration\",\n \"profile-form.field.exemptStateRegistration\": \"profile-form.field.exemptStateRegistration\",\n \"profile-form.field.tradeName\": \"profile-form.field.tradeName\",\n \"profile-form.field.ARG_cuit\": \"profile-form.field.ARG_cuit\",\n \"profile-form.field.ARG_dni\": \"profile-form.field.ARG_dni\",\n \"profile-form.field.BRA_cnpj\": \"profile-form.field.BRA_cnpj\",\n \"profile-form.field.BRA_cpf\": \"profile-form.field.BRA_cpf\",\n \"profile-form.field.CHL_rut\": \"profile-form.field.CHL_rut\",\n \"profile-form.field.COL_cedula\": \"profile-form.field.COL_cedula\",\n \"profile-form.field.COL_rut\": \"profile-form.field.COL_rut\",\n \"profile-form.field.CRI_cedula\": \"profile-form.field.CRI_cedula\",\n \"profile-form.field.ECU_cedula\": \"profile-form.field.ECU_cedula\",\n \"profile-form.field.ECU_ruc\": \"profile-form.field.ECU_ruc\",\n \"profile-form.field.ESP_cif\": \"profile-form.field.ESP_cif\",\n \"profile-form.field.ESP_dni\": \"profile-form.field.ESP_dni\",\n \"profile-form.field.GTM_dpi\": \"profile-form.field.GTM_dpi\",\n \"profile-form.field.GTM_nit\": \"profile-form.field.GTM_nit\",\n \"profile-form.field.MEX_rfc_corporate\": \"profile-form.field.MEX_rfc_corporate\",\n \"profile-form.field.MEX_rfc\": \"profile-form.field.MEX_rfc\",\n \"profile-form.field.PAN_cip\": \"profile-form.field.PAN_cip\",\n \"profile-form.field.PAN_ruc\": \"profile-form.field.PAN_ruc\",\n \"profile-form.field.PER_document\": \"profile-form.field.PER_document\",\n \"profile-form.field.PER_ruc\": \"profile-form.field.PER_ruc\",\n \"profile-form.field.PRT_nif\": \"profile-form.field.PRT_nif\",\n \"profile-form.field.PRT_nipc\": \"profile-form.field.PRT_nipc\",\n \"profile-form.field.PRY_cedula\": \"profile-form.field.PRY_cedula\",\n \"profile-form.field.PRY_ruc\": \"profile-form.field.PRY_ruc\",\n \"profile-form.field.URY_cedula\": \"profile-form.field.URY_cedula\",\n \"profile-form.field.URY_rut\": \"profile-form.field.URY_rut\",\n \"profile-form.field.USA_ssn\": \"profile-form.field.USA_ssn\",\n \"profile-form.field.VEN_cedula\": \"profile-form.field.VEN_cedula\",\n \"profile-form.field.VEN_rif\": \"profile-form.field.VEN_rif\",\n \"profile-form.error.EMPTY_FIELD\": \"profile-form.error.EMPTY_FIELD\",\n \"profile-form.error.INVALID_FIELD\": \"profile-form.error.INVALID_FIELD\",\n \"profile-form.gender.custom\": \"profile-form.gender.custom\",\n \"profile-form.gender.male\": \"profile-form.gender.male\",\n \"profile-form.gender.female\": \"profile-form.gender.female\",\n \"profile-form.gender.agender\": \"profile-form.gender.agender\",\n \"profile-form.gender.androgyne\": \"profile-form.gender.androgyne\",\n \"profile-form.gender.bigender\": \"profile-form.gender.bigender\",\n \"profile-form.gender.genderfluid\": \"profile-form.gender.genderfluid\",\n \"profile-form.gender.nonconforming\": \"profile-form.gender.nonconforming\",\n \"profile-form.gender.questioning\": \"profile-form.gender.questioning\",\n \"profile-form.gender.variant\": \"profile-form.gender.variant\",\n \"profile-form.gender.genderqueer\": \"profile-form.gender.genderqueer\",\n \"profile-form.gender.neutrois\": \"profile-form.gender.neutrois\",\n \"profile-form.gender.other\": \"profile-form.gender.other\",\n \"profile-form.gender.pangender\": \"profile-form.gender.pangender\",\n \"profile-form.gender.transgender\": \"profile-form.gender.transgender\",\n \"profile-form.gender.transsexual\": \"profile-form.gender.transsexual\",\n \"profile-form.button.submit\": \"profile-form.button.submit\"\n}\n```"
}
] |
code_instore-profile_05b84a7d
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/messages/es.json from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"profile-form.optional\": \"Opcional\",\n \"profile-form.include-business\": \"Incluir campos corporativos\",\n \"profile-form.exclude-business\": \"No incluir campos corporativos\",\n \"profile-form.save-changes\": \"Guardar cambios\",\n \"profile-form.field.firstName\": \"Nombre\",\n \"profile-form.field.lastName\": \"Apellido\",\n \"profile-form.field.email\": \"E-mail\",\n \"profile-form.field.changeIdentifiedClient\": \"Cambiar el cliente identificado\",\n \"profile-form.field.gender\": \"Género\",\n \"profile-form.field.custom-gender\": \"Género personalizado\",\n \"profile-form.field.document\": \"Documento\",\n \"profile-form.field.birthDate\": \"Fecha de Nacimiento\",\n \"profile-form.field.homePhone\": \"Teléfono Personal\",\n \"profile-form.field.businessPhone\": \"Teléfono Corporativo\",\n \"profile-form.field.corporateDocument\": \"Documento Corporativo\",\n \"profile-form.field.corporateName\": \"Nombre Corporativo\",\n \"profile-form.field.stateRegistration\": \"Registro Estatal\",\n \"profile-form.field.noStateRegistration\": \"Excento de Inscripción Estatal\",\n \"profile-form.field.exemptStateRegistration\": \"Excento\",\n \"profile-form.field.tradeName\": \"Nombre Comercial\",\n \"profile-form.field.ARG_cuit\": \"CUIT\",\n \"profile-form.field.ARG_dni\": \"DNI\",\n \"profile-form.field.BRA_cnpj\": \"CNPJ\",\n \"profile-form.field.BRA_cpf\": \"CPF\",\n \"profile-form.field.CHL_rut\": \"RUT\",\n \"profile-form.field.COL_cedula\": \"Cédula de Ciudadanía\",\n \"profile-form.field.COL_rut\": \"RUT\",\n \"profile-form.field.CRI_cedula\": \"Cédula Jurídica\",\n \"profile-form.field.ECU_cedula\": \"Cédula\",\n \"profile-form.field.ECU_ruc\": \"RUC\",\n \"profile-form.field.ESP_cif\": \"CIF\",\n \"profile-form.field.ESP_dni\": \"DNI\",\n \"profile-form.field.GTM_dpi\": \"DPI\",\n \"profile-form.field.GTM_nit\": \"NIT\",\n \"profile-form.field.MEX_rfc_corporate\": \"RFC (empresa)\",\n \"profile-form.field.MEX_rfc\": \"RFC\",\n \"profile-form.field.PAN_cip\": \"CIP\",\n \"profile-form.field.PAN_ruc\": \"RUC\",\n \"profile-form.field.PER_document\": \"Documento de Identidad\",\n \"profile-form.field.PER_ruc\": \"RUC\",\n \"profile-form.field.PRT_nif\": \"NIF\",\n \"profile-form.field.PRT_nipc\": \"NIPC\",\n \"profile-form.field.PRY_cedula\": \"Cédula de Identidad\",\n \"profile-form.field.PRY_ruc\": \"RUC\",\n \"profile-form.field.URY_cedula\": \"Cédula\",\n \"profile-form.field.URY_rut\": \"RUT\",\n \"profile-form.field.USA_ssn\": \"SSN\",\n \"profile-form.field.VEN_cedula\": \"Cédula de Identidad\",\n \"profile-form.field.VEN_rif\": \"RIF\",\n \"profile-form.error.EMPTY_FIELD\": \"Este campo es obligatorio.\",\n \"profile-form.error.INVALID_FIELD\": \"Valor no válido.\",\n \"profile-form.gender.custom\": \"Personalizado\",\n \"profile-form.gender.male\": \"Masculino\",\n \"profile-form.gender.female\": \"Femenino\",\n \"profile-form.gender.agender\": \"Agénero\",\n \"profile-form.gender.androgyne\": \"Andrógine\",\n \"profile-form.gender.bigender\": \"Bigénero\",\n \"profile-form.gender.genderfluid\": \"Género fluido\",\n \"profile-form.gender.nonconforming\": \"No conformes con el género\",\n \"profile-form.gender.questioning\": \"Género cuestionado\",\n \"profile-form.gender.variant\": \"Género variante\",\n \"profile-form.gender.genderqueer\": \"Genderqueer\",\n \"profile-form.gender.neutrois\": \"Neutrois\",\n \"profile-form.gender.other\": \"Otros\",\n \"profile-form.gender.pangender\": \"Pangénero\",\n \"profile-form.gender.transgender\": \"Transgénero\",\n \"profile-form.gender.transsexual\": \"Transexual\",\n \"profile-form.button.submit\": \"Enviar\"\n}\n```"
}
] |
code_instore-profile_6a181580
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/.vtex/deployment.json from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n[\n {\n \"name\": \"profile-form\",\n \"description\": \"\",\n \"source\": \"https://github.com/vtex/profile-form.git\",\n \"script\": {\n \"deploy\": \".vtex/deploy.yml\",\n \"ci\": \".vtex/ci.yml\"\n },\n \"build\": {\n \"type\": \"codebuild\",\n \"image\":\n \"053131491888.dkr.ecr.us-east-1.amazonaws.com/awsbuild/ubuntu/node:8\",\n \"vpc\": {\n \"id\": \"vpc-d4f109b1\",\n \"subnets\": [\"subnet-955f63d3\", \"subnet-245f030c\", \"subnet-0e35267a\"],\n \"securityGroups\": [\"sg-c84127b3\"]\n }\n },\n \"service\": {\n \"type\": \"front\"\n },\n \"tags\": [\n {\n \"key\": \"Product\",\n \"value\": \"profile-form\"\n },\n {\n \"key\": \"Owner\",\n \"value\": \"Post Purchase XP\"\n },\n {\n \"key\": \"Team\",\n \"value\": \"Post Purchase XP\"\n }\n ]\n }\n]\n```"
}
] |
code_instore-profile_acc36343
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/ProfileFieldShape.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport PropTypes from 'prop-types'\n\nexport default PropTypes.shape({\n /** The value for that field */\n value: PropTypes.any,\n /** i18n code for the error this value is presenting */\n error: PropTypes.string,\n /** Whether the input should receive focus */\n focus: PropTypes.bool,\n /** Whether the input has already been touched by the user */\n touched: PropTypes.bool,\n})\n\n```"
}
] |
code_instore-profile_6dec9446
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/ProfileShape.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport PropTypes from 'prop-types'\n\nexport default PropTypes.shape({\n /** Date of the user's birth */\n birthDate: PropTypes.string,\n /** User's business phone */\n businessPhone: PropTypes.string,\n /** User's corporate document */\n corporateDocument: PropTypes.string,\n /** User's corporate name */\n corporateName: PropTypes.string,\n /** User's personal document */\n document: PropTypes.string,\n /** User's email */\n email: PropTypes.string,\n /** User's personal name */\n firstName: PropTypes.string,\n /** User's gender */\n gender: PropTypes.string,\n /** User's personal phone */\n homePhone: PropTypes.string,\n /** User's surname */\n lastName: PropTypes.string,\n /** User's corporate state registration */\n stateRegistration: PropTypes.string,\n /** User's corporate trade name */\n tradeName: PropTypes.string,\n /** Whether the user is a corporation or not */\n isCorporate: PropTypes.bool,\n})\n\n```"
}
] |
code_instore-profile_d2298053
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/RuleFieldShape.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport PropTypes from 'prop-types'\n\nexport default PropTypes.shape({\n /** Name for both the field and the profile object property */\n name: PropTypes.string.isRequired,\n /** Maximum length of the field */\n maxLength: PropTypes.number,\n /** i18n code for the label to be displayed over the field */\n label: PropTypes.string.isRequired,\n /** Whether the field is required or not */\n required: PropTypes.bool,\n /** Whether the field should be hidden or not */\n hidden: PropTypes.bool,\n /** Function returning a mask to be applied on the value */\n mask: PropTypes.func,\n /** A function to evaluate if the value is valid */\n validate: PropTypes.func,\n /** A function to transform received data before displaying */\n display: PropTypes.func,\n /** A function to transform input data before submitting */\n submit: PropTypes.func,\n /** If the input should be disabled or not */\n disabled: PropTypes.bool,\n})\n\n```"
}
] |
code_instore-profile_9592de5a
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/ProfileContainer.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport React, { Component } from 'react'\nimport { intlShape, injectIntl } from 'react-intl'\nimport PropTypes from 'prop-types'\nimport Button from '@vtex/styleguide/lib/Button'\nimport RuleShape from './RuleShape'\nimport ProfileShape from './ProfileShape'\nimport ProfileField from './ProfileField'\nimport { applyFullValidation, isProfileValid } from './modules/validateProfile'\nimport addValidation from './modules/addValidation'\nimport removeValidation from './modules/removeValidation'\nimport emptyProfile from './modules/emptyProfile'\nimport defaultRules from './rules/default'\nimport StyleguideInput from './inputs/StyleguideInput'\n\nclass ProfileContainer extends Component {\n constructor(props) {\n super(props)\n this.state = {\n profile: null,\n isCorporate: false,\n }\n }\n\n componentDidMount() {\n const { defaultProfile, rules } = this.props\n this.setState({\n profile: addValidation(defaultProfile, rules),\n isCorporate: defaultProfile.isCorporate,\n })\n }\n\n handleFieldUpdate = field => {\n this.setState(prevState => ({\n profile: { ...prevState.profile, ...field },\n }))\n }\n\n handleSubmit = event => {\n event.preventDefault()\n const { rules, onSubmit } = this.props\n const { profile, isCorporate } = this.state\n\n const validatedProfile = applyFullValidation(rules, profile, isCorporate)\n this.setState({\n profile: validatedProfile,\n })\n\n onSubmit({\n valid: isProfileValid(validatedProfile),\n profile: { ...removeValidation(validatedProfile, rules), isCorporate },\n })\n }\n\n toggleBusinessFields = () => {\n this.setState(prevState => ({\n isCorporate: !prevState.isCorporate,\n }))\n }\n\n render() {\n const {\n rules,\n Input,\n ToggleBusinessButton,\n SubmitButton,\n shouldShowExtendedGenders,\n children,\n intl,\n } = this.props\n const { profile, isCorporate } = this.state\n\n const businessButtonMessage = isCorporate\n ? 'profile-form.exclude-business'\n : 'profile-form.include-business'\n\n const options = { gender: { shouldShowExtendedGenders } }\n\n if (!profile) return null\n\n return (\n <form\n className=\"vtex-profile-form__profile-container__wrapper\"\n onSubmit={this.handleSubmit}\n >\n <div className=\"vtex-profile-form__personal-fields\">\n {rules.personalFields.map(field => (\n <ProfileField\n key={field.name}\n field={field}\n data={profile[field.name]}\n options={options[field.name]}\n onFieldUpdate={this.handleFieldUpdate}\n Input={Input}\n />\n ))}\n </div>\n {children && (\n <div className=\"vtex-profile-form__extended-fields\">{children}</div>\n )}\n <div className=\"vtex-profile-form__toggle-business-btn__wrapper mb7\">\n {ToggleBusinessButton ? (\n React.cloneElement(ToggleBusinessButton, {\n onClick: this.toggleBusinessFields,\n children: intl.formatMessage({ id: businessButtonMessage }),\n })\n ) : (\n <Button\n size=\"small\"\n block\n variation=\"secondary\"\n onClick={this.toggleBusinessFields}\n >\n {intl.formatMessage({ id: businessButtonMessage })}\n </Button>\n )}\n </div>\n {isCorporate && (\n <div className=\"vtex-profile-form__business-fields\">\n {rules.businessFields.map(field => (\n <ProfileField\n key={field.name}\n field={field}\n data={profile[field.name]}\n onFieldUpdate={this.handleFieldUpdate}\n Input={Input}\n />\n ))}\n </div>\n )}\n {SubmitButton ? (\n React.cloneElement(SubmitButton, {\n onClick: this.handleSubmit,\n })\n ) : (\n <Button block size=\"small\" type=\"submit\">\n {intl.formatMessage({ id: 'profile-form.save-changes' })}\n </Button>\n )}\n </form>\n )\n }\n}\n\nProfileContainer.defaultProps = {\n defaultProfile: emptyProfile,\n rules: defaultRules,\n Input: StyleguideInput,\n shouldShowExtendedGenders: false,\n}\n\nProfileContainer.propTypes = {\n /** Set of rules for this form */\n rules: RuleShape.isRequired,\n /** Initial data for the profile object */\n defaultProfile: ProfileShape,\n /** Function to be called upon form submission */\n onSubmit: PropTypes.func.isRequired,\n /** Component to be used as input for the form fields */\n Input: PropTypes.func,\n /** Component to be used as a button for toggling business fields */\n ToggleBusinessButton: PropTypes.element,\n /** Component to be used as a submit button */\n SubmitButton: PropTypes.element,\n /** Whether to display extended genders or just M/F */\n shouldShowExtendedGenders: PropTypes.bool,\n /** Other components to be displayed before the business toggle button */\n children: PropTypes.node,\n /** React-intl utility */\n intl: intlShape.isRequired,\n}\n\nexport default injectIntl(ProfileContainer)\n\n```"
}
] |
code_instore-profile_6bd191a2
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/ProfileRules.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport React, { Component } from 'react'\nimport { injectIntl, intlShape } from 'react-intl'\nimport PropTypes from 'prop-types'\nimport { prepareDateRules } from './utils/dateRules'\n\nimport defaultRules from './rules/default'\n\nclass ProfileRules extends Component {\n constructor(props) {\n super(props)\n this.state = {\n rules: null,\n }\n }\n\n componentDidMount() {\n return this.updateRules()\n }\n\n updateRules() {\n const { shouldUseIOFetching, fetch, country, intl } = this.props\n\n const rulePromise = shouldUseIOFetching\n ? import(`./rules/${country}`)\n : fetch(country)\n return this.fetchRules(rulePromise, intl)\n }\n\n async fetchRules(rulePromise, intl) {\n try {\n const ruleData = await rulePromise\n const rules = ruleData.default || ruleData\n\n const enhancedDateRules = prepareDateRules(rules, intl)\n\n this.setState({ rules: enhancedDateRules })\n\n return rules\n } catch (error) {\n const errorType = this.parseError(error)\n if (errorType) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Couldn't load rules for country ${errorType}, using default rules instead.`,\n )\n }\n\n const enhancedDateRules = prepareDateRules(defaultRules, intl)\n\n this.setState({ rules: enhancedDateRules })\n return defaultRules\n }\n if (process.env.NODE_ENV !== 'production') {\n console.error('An unknown error occurred.', error)\n }\n }\n }\n\n parseError(e) {\n const regex = new RegExp(\n process.env.NODE_ENV === 'test'\n ? /Cannot find module '\\.\\.\\/(rules\\/)?([A-z-]{1,7})'/\n : /Cannot find module '\\.\\/([A-z-]{1,7})'/,\n )\n const result = regex.exec(e.message)\n if (!result) return false\n return result[1]\n }\n\n render() {\n const { children } = this.props\n const { rules } = this.state\n\n return rules ? React.cloneElement(children, { rules }) : null\n }\n}\n\nProfileRules.propTypes = {\n /** React-intl utility */\n intl: intlShape.isRequired,\n /** Components that will receive the rules */\n children: PropTypes.element.isRequired,\n /** The country whose rules will be fetched and applied */\n country: PropTypes.string.isRequired,\n /** Whether to use IO built-in file fetching */\n shouldUseIOFetching: PropTypes.bool,\n /** Functionality for importing the rule files outside of IO */\n fetch: PropTypes.func,\n}\n\nexport default injectIntl(ProfileRules)\n\n```"
}
] |
code_instore-profile_3981b4a7
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/ProfileWithValidationShape.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport PropTypes from 'prop-types'\nimport ProfileFieldShape from './ProfileFieldShape'\nimport ProfileShape from './ProfileShape'\n\n/** Same fields as ProfileShape, but content is of shape ProfileFieldShape */\nexport default Object.keys(ProfileShape)\n .map(field => ({ [field]: ProfileFieldShape }))\n .reduce((acc, cur) => ({ ...acc, ...cur }), {})\n\n```"
}
] |
code_instore-profile_b0791af9
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/package.json from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"name\": \"@vtex/profile-form\",\n \"version\": \"2.9.6\",\n \"description\": \"React component for managing user profiles\",\n \"main\": \"lib/index.js\",\n \"files\": [\n \"lib\"\n ],\n \"scripts\": {\n \"build\": \"npm run symlinks && nwb build-react-component --no-demo && npm run removeMocks && npm run addLocales\",\n \"build:link\": \"npm link && watch 'npm run build' src\",\n \"removeMocks\": \"rm -rf lib/**/__mocks__ && rm -rf lib/__mocks__\",\n \"addLocales\": \"cp -R -f messages/ lib/locales/\",\n \"clean\": \"nwb clean-module && nwb clean-demo\",\n \"start\": \"npm run symlinks && nwb serve-react-demo\",\n \"symlinks\": \"rm -rf src && ln -sf react src\",\n \"test\": \"cd .. && jest --env=jsdom\",\n \"test:coverage\": \"jest --env=jsdom --coverage\",\n \"test:watch\": \"jest --env=jsdom --watch\",\n \"vtex:link\": \"npm run symlinks && vtex link\",\n \"prepublishOnly\": \"npm run build\",\n \"lint:messages\": \"intl-equalizer\"\n },\n \"repository\": \"https://github.com/vtex/profile-form\",\n \"author\": \"Gustavo Silva (@akafts)\",\n \"license\": \"AGPL-3.0-only\",\n \"homepage\": \"https://github.com/vtex/profile-form\",\n \"keywords\": [\n \"react-component\",\n \"vtex\",\n \"profile\"\n ],\n \"intl-equalizer\": {\n \"localeDirectory\": \"../messages/\"\n },\n \"husky\": {\n \"hooks\": {\n \"pre-push\": \"yarn lint:messages && yarn test\"\n }\n },\n \"jest\": {\n \"setupTestFrameworkScriptFile\": \"./__tests__/setupTests.js\",\n \"testURL\": \"http://localhost\",\n \"testPathIgnorePatterns\": [\n \"/node_modules/\",\n \"<rootDir>/es/\",\n \"<rootDir>/lib/\",\n \"<rootDir>/umd/\",\n \"<rootDir>/src/\",\n \"setupTests\"\n ],\n \"modulePathIgnorePatterns\": [\n \"<rootDir>/es/\",\n \"<rootDir>/lib/\",\n \"<rootDir>/umd/\",\n \"<rootDir>/src/\"\n ],\n \"transformIgnorePatterns\": [\n \"[/\\\\\\\\]lib[/\\\\\\\\].+\\\\.(js|jsx)$\",\n \"[/\\\\\\\\]umd[/\\\\\\\\].+\\\\.(js|jsx)$\",\n \"[/\\\\\\\\]es[/\\\\\\\\].+\\\\.(js|jsx)$\",\n \"[/\\\\\\\\]node_modules[/\\\\\\\\].+\\\\.(js|jsx)$\"\n ],\n \"moduleNameMapper\": {\n \"\\\\.(css|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)(\\\\?.*)?$\": \"identity-obj-proxy\"\n },\n \"transform\": {\n \"^.+\\\\.js$\": \"../jest.transform.js\"\n }\n },\n \"devDependencies\": {\n \"react\": \"^16.4.1\",\n \"@vtex/intl-equalizer\": \"^2.3.0\",\n \"babel-jest\": \"^23.6.0\",\n \"babel-plugin-add-react-displayname\": \"0.0.5\",\n \"babel-preset-react-app\": \"^3.1.2\",\n \"enzyme\": \"^3.3.0\",\n \"enzyme-adapter-react-16\": \"^1.1.1\",\n \"enzyme-react-intl\": \"^2.0.0\",\n \"husky\": \"^2.3.0\",\n \"jest\": \"^22.4.4\",\n \"jest-enzyme\": \"^6.0.2\",\n \"nwb\": \"^0.21.5\",\n \"react-dom\": \"^16.4.1\",\n \"react-hot-loader\": \"^4.3.4\",\n \"react-test-renderer\": \"^16.4.1\",\n \"vtex.render-runtime\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.render-runtime@7.42.0/public/@types/vtex.render-runtime\"\n },\n \"dependencies\": {\n \"@vtex/phone\": \"^4.8.0\",\n \"@vtex/styleguide\": \"^5.4.4\",\n \"downshift\": \"^2.0.20\",\n \"match-sorter\": \"^2.2.3\",\n \"moment\": \"^2.22.2\",\n \"msk\": \"^1.0.3\",\n \"react-intl\": \"^2.4.0\"\n },\n \"peerDependencies\": {\n \"react\": \"^16.4.1\",\n \"vtex-tachyons\": \"^2.5.0\"\n }\n}\n\n```"
}
] |
code_instore-profile_4fdfd6ff
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/modules.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport addValidation from './modules/addValidation'\nimport removeValidation from './modules/removeValidation'\n\nexport default { addValidation, removeValidation }\n\n```"
}
] |
code_instore-profile_e7c69373
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/ProfileField.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport React, { Component } from 'react'\nimport PropTypes from 'prop-types'\nimport { applyMask, applyValidation } from './modules/validateProfile'\nimport RuleFieldShape from './RuleFieldShape'\nimport ProfileFieldShape from './ProfileFieldShape'\n\nclass ProfileField extends Component {\n componentDidUpdate() {\n const { field, data, onFieldUpdate } = this.props\n if (data.focus && this.el) {\n this.el.focus()\n onFieldUpdate({ [field.name]: { ...data, focus: false } })\n }\n }\n\n handleChange = e => {\n const { field, data, onFieldUpdate } = this.props\n const { value } = e.target\n\n const error = data.touched ? applyValidation(field, value) : null\n const maskedValue = applyMask(field, value)\n\n onFieldUpdate({ [field.name]: { ...data, value: maskedValue, error } })\n }\n\n handleBlur = () => {\n const { field, data, onFieldUpdate } = this.props\n const error = applyValidation(field, data.value)\n\n onFieldUpdate({ [field.name]: { ...data, touched: true, error } })\n }\n\n inputRef = el => {\n this.el = el\n }\n\n render() {\n const { field, data, options, Input } = this.props\n return (\n <Input\n field={field}\n data={data}\n options={options}\n inputRef={this.inputRef}\n onChange={this.handleChange}\n onBlur={this.handleBlur}\n />\n )\n }\n}\n\nProfileField.propTypes = {\n /** Rules for the field this component represents */\n field: RuleFieldShape.isRequired,\n /** Data to be displayed by this component */\n data: ProfileFieldShape.isRequired,\n /** Additional options to modify this input */\n options: PropTypes.object,\n /** Function to be called when data changes */\n onFieldUpdate: PropTypes.func.isRequired,\n /** Component to be used as input for the field */\n Input: PropTypes.func.isRequired,\n}\n\nexport default ProfileField\n\n```"
}
] |
code_instore-profile_bcba2adb
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/ProfileSummary.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport React, { Component } from 'react'\nimport PropTypes from 'prop-types'\nimport { intlShape, injectIntl } from 'react-intl'\nimport ProfileShape from './ProfileShape'\nimport RuleShape from './RuleShape'\n\nclass ProfileSummary extends Component {\n mapFields(fields) {\n const { profile, intl } = this.props\n\n return fields\n .map(field => {\n const data = profile[field.name]\n return {\n [field.name]: {\n label: intl.formatMessage({\n id: 'profile-form.field.' + field.label,\n }),\n value: field.display && data ? field.display(data) : data,\n hidden: field.hidden,\n },\n }\n })\n .reduce((acc, cur) => ({ ...acc, ...cur }), {})\n }\n\n translateGender(mappedData) {\n const gender = mappedData.gender.value\n return {\n ...mappedData,\n gender: {\n ...mappedData.gender,\n value:\n gender &&\n this.props.intl.formatMessage({\n id: `profile-form.gender.${gender}`,\n // fallback to whatever came from the master data\n defaultMessage: gender,\n }),\n },\n }\n }\n\n render() {\n const { rules, children } = this.props\n const { isCorporate } = this.props.profile\n const personalData = this.translateGender(\n this.mapFields(rules.personalFields),\n )\n const businessData = this.mapFields(rules.businessFields)\n\n return (\n <div className=\"vtex-profile-form__profile-summary\">\n {children({ personalData, businessData, isCorporate })}\n </div>\n )\n }\n}\n\nProfileSummary.propTypes = {\n /** Profile to be displayed */\n profile: ProfileShape.isRequired,\n /** Rules to be applied over the profile */\n rules: RuleShape.isRequired,\n /** Render prop that receives all display data */\n children: PropTypes.func.isRequired,\n /** React-intl injected utility */\n intl: intlShape.isRequired,\n}\n\nexport default injectIntl(ProfileSummary)\n\n```"
}
] |
code_instore-profile_9425c755
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/RuleShape.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport PropTypes from 'prop-types'\nimport RuleFieldShape from './RuleFieldShape'\n\nexport default PropTypes.shape({\n /** The country this rule refers to */\n country: PropTypes.string,\n /** Configuration for the personal fields */\n personalFields: PropTypes.arrayOf(RuleFieldShape).isRequired,\n /** Configuration for the business fields */\n businessFields: PropTypes.arrayOf(RuleFieldShape).isRequired,\n})\n\n```"
}
] |
code_instore-profile_5018e479
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/demo/src/DisplaySlice.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport React from 'react'\nimport PropTypes from 'prop-types'\n\nconst DisplaySlice = ({ slice }) => {\n return (\n <div className={`mb6 ${slice.hidden ? 'dn' : ''}`}>\n <label className=\"db fw5 black-90 mb2\">{slice.label}</label>\n <span className=\"light black-40\">{slice.value}</span>\n </div>\n )\n}\n\nDisplaySlice.propTypes = {\n /** Piece of display data to show */\n slice: PropTypes.object.isRequired,\n}\n\nexport default DisplaySlice\n\n```"
}
] |
code_instore-profile_a54a6a05
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/demo/src/index.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { AppContainer } from 'react-hot-loader'\nimport App from './App'\n\nconst root = document.getElementById('demo')\nconst renderApp = Root => {\n ReactDOM.render(\n <AppContainer>\n <Root />\n </AppContainer>,\n root,\n )\n}\n\nrenderApp(App)\n\nif (module.hot) {\n module.hot.accept('./App', () => {\n const NewApp = require('./App').default\n renderApp(NewApp)\n })\n}\n\n```"
}
] |
code_instore-profile_1922eec1
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/demo/src/App.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport React, { Component } from 'react'\nimport { IntlProvider, addLocaleData } from 'react-intl'\nimport ptLocaleData from 'react-intl/locale-data/pt'\nimport Button from '@vtex/styleguide/lib/Button'\nimport ptTranslations from '../../messages/pt'\nimport ProfileContainer from '../../react/ProfileContainer'\nimport ProfileRules from '../../react/ProfileRules'\nimport ProfileSummary from '../../react/ProfileSummary'\nimport DisplaySlice from './DisplaySlice'\nimport emptyProfile from '../../react/modules/emptyProfile'\nimport 'vtex-tachyons'\n\nclass App extends Component {\n constructor(props) {\n super(props)\n addLocaleData(ptLocaleData)\n\n this.state = {\n profile: emptyProfile,\n profileCountry: 'BRA',\n submitted: false,\n }\n }\n\n toggleLocale = () => {\n this.setState(prevState => ({\n profileCountry: prevState.profileCountry === 'BRA' ? 'USA' : 'BRA',\n }))\n }\n\n handleSubmit = ({ valid, profile }) => {\n if (!valid) return\n this.setState({ profile, submitted: true })\n }\n\n render() {\n const { profile, profileCountry, submitted } = this.state\n\n return (\n <div className=\"pa4\">\n <h2 className=\"dark-gray\">ProfileForm demo:</h2>\n {!submitted && (\n <div className=\"mb6\">\n <Button\n size=\"small\"\n variation=\"secondary\"\n onClick={this.toggleLocale}\n >\n Set rules to {profileCountry === 'BRA' ? 'USA' : 'BRA'}\n </Button>\n </div>\n )}\n <IntlProvider locale={'pt-BR'} messages={ptTranslations}>\n <div>\n <ProfileRules\n key={profileCountry}\n country={profileCountry}\n fetch={country => import('../../src/rules/' + country)}\n >\n {submitted ? (\n <ProfileSummary profile={profile}>\n {({ personalData, businessData, isCorporate }) => (\n <div>\n <h3 className=\"heavy-rebel-pink\">Personal Data:</h3>\n {Object.keys(personalData).map(fieldName => (\n <DisplaySlice\n key={fieldName}\n slice={personalData[fieldName]}\n />\n ))}\n <h3 className=\"heavy-rebel-pink\">Business Data:</h3>\n {Object.keys(businessData).map(fieldName => (\n <DisplaySlice\n key={fieldName}\n slice={businessData[fieldName]}\n />\n ))}\n <h3 className=\"heavy-rebel-pink\">\n Is corporate?\n <span className=\"near-black ml3\">\n {isCorporate ? 'yes' : 'no'}\n </span>\n </h3>\n </div>\n )}\n </ProfileSummary>\n ) : (\n <ProfileContainer\n defaultProfile={profile}\n onSubmit={this.handleSubmit}\n shouldShowExtendedGenders={true}\n />\n )}\n </ProfileRules>\n </div>\n </IntlProvider>\n </div>\n )\n }\n}\n\nexport default App\n\n```"
}
] |
code_instore-profile_6fd50f6d
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/utils/dateRules.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport moment from 'moment'\nimport msk from 'msk'\n\nexport function filterDateType(fields) {\n return fields.filter(rule => rule.type === 'date')\n}\n\n// merge the arr2 into arr1 based on a rule name\n// considering the arr2 value over the arr1\nfunction mergeArrays(arr1, arr2) {\n const aux = {}\n arr2.forEach(rule => (aux[rule.name] = rule))\n\n return arr1.map(rule => {\n return aux[rule.name] ? aux[rule.name] : rule\n })\n}\n\nexport function prepareDateRules(rules, intl) {\n return {\n ...rules,\n personalFields: mergeArrays(\n rules.personalFields,\n setDateRuleValidations(filterDateType(rules.personalFields), intl),\n ),\n }\n}\n\nfunction setDateRuleValidations(rules, intl) {\n if (rules) {\n return rules.map(rule => {\n const ruleCopy = { ...rule }\n ruleCopy.mask = value => msk.fit(value, '99/99/9999')\n ruleCopy.validate = value => {\n const mom = moment.utc(value, 'L', intl.locale.toLowerCase())\n\n return mom.isValid() && rule.validate(mom.unix())\n }\n ruleCopy.display = value =>\n moment\n .utc(value, [moment.ISO_8601, 'L'], intl.locale.toLowerCase())\n .format('L')\n ruleCopy.submit = value => {\n if (!value) return null\n\n const date = moment.utc(value, 'L', intl.locale.toLowerCase(), true)\n if (!date.isValid()) return null\n\n return date.format()\n }\n return ruleCopy\n })\n }\n return rules\n}\n\nexport function isPastDate(unixTimestamp) {\n const nowMS = Date.now() / 1000\n\n return unixTimestamp - nowMS < 0\n}\n\n```"
}
] |
code_instore-profile_f3eb82a5
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/__tests__/ProfileRules.test.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport { IntlProvider } from 'react-intl'\n\nimport { prepareDateRules, filterDateType } from '../utils/dateRules'\nimport defaultRules from '../rules/default'\n\nconst intlProvider = new IntlProvider({ locale: 'pt-br' }, {})\nconst { intl } = intlProvider.getChildContext()\n\nfunction getBirthDate(rules) {\n const preparedRules = prepareDateRules(rules, intl)\n const birthDateInitialized = preparedRules.personalFields.find(\n rule => rule.name === 'birthDate',\n )\n return birthDateInitialized\n}\n\ndescribe('ProfileRules aux functions', () => {\n it('should filter the correct rules', () => {\n const rules = defaultRules\n const filteredFields = filterDateType(rules.personalFields)\n\n expect(filteredFields.length).toBe(1)\n expect(filteredFields[0].name).toBe('birthDate')\n })\n\n it('should set the functions to the rules of type date', () => {\n const rules = defaultRules\n const birthDate = filterDateType(rules.personalFields)[0]\n\n expect(birthDate.mask).toBeUndefined()\n expect(birthDate.validate).toBeDefined()\n expect(birthDate.display).toBeUndefined()\n expect(birthDate.submit).toBeUndefined()\n\n const birthDateInitialized = getBirthDate(rules)\n\n expect(birthDateInitialized.mask).toBeDefined()\n expect(birthDateInitialized.validate).toBeDefined()\n expect(birthDateInitialized.display).toBeDefined()\n expect(birthDateInitialized.submit).toBeDefined()\n })\n\n it('should mask correctly', () => {\n const rules = defaultRules\n const birthDateInitialized = getBirthDate(rules)\n\n expect(birthDateInitialized.mask('100')).toBe('10/0')\n expect(birthDateInitialized.mask('10/09')).toBe('10/09')\n expect(birthDateInitialized.mask('10/091994')).toBe('10/09/1994')\n })\n\n it('should validate correctly', () => {\n const rules = defaultRules\n const birthDateInitialized = getBirthDate(rules)\n\n expect(birthDateInitialized.validate('100')).toBeFalsy()\n expect(birthDateInitialized.validate('10/09/1994')).toBeTruthy()\n expect(birthDateInitialized.validate('29/02/1000')).toBeFalsy()\n })\n\n it('should display correctly', () => {\n const rules = defaultRules\n const birthDateInitialized = getBirthDate(rules)\n\n expect(birthDateInitialized.display('10/09/1994')).toBe('10/09/1994')\n expect(birthDateInitialized.display('2018-11-25T00:00:00')).toBe(\n '25/11/2018',\n )\n })\n\n it('should submit correctly', () => {\n const rules = defaultRules\n const birthDateInitialized = getBirthDate(rules)\n\n expect(birthDateInitialized.submit('25/11/2018')).toMatch(\n new RegExp('2018-11-25T([0-9])([0-9]):00:00Z'),\n )\n })\n\n describe('date', () => {\n it('empty date should be submitted as null', () => {\n const rules = defaultRules\n const birthDateInitialized = getBirthDate(rules)\n\n expect(birthDateInitialized.submit()).toBe(null)\n })\n\n it('invalid date should be submitted as null', () => {\n const rules = defaultRules\n const birthDateInitialized = getBirthDate(rules)\n\n expect(birthDateInitialized.submit('30/28/19501')).toBe(null)\n expect(birthDateInitialized.submit('not-a-date')).toBe(null)\n })\n })\n})\n\n```"
}
] |
code_instore-profile_843677d8
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/__tests__/StyleguideInput.test.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport React from 'react'\nimport { shallowWithIntl, loadTranslation } from 'enzyme-react-intl'\nimport StyleguideInput from '../inputs/StyleguideInput'\nimport mockField from '../__mocks__/ruleField'\nimport mockData from '../__mocks__/profileField'\n\nloadTranslation('../messages/pt.json')\n\ndescribe('StyleguideInput', () => {\n let wrapper\n let mockChange\n let mockBlur\n beforeEach(() => {\n // Arrange\n mockChange = jest.fn()\n mockBlur = jest.fn()\n wrapper = shallowWithIntl(\n <StyleguideInput\n field={mockField}\n data={mockData}\n onChange={mockChange}\n onBlur={mockBlur}\n />,\n ).dive()\n })\n\n it('should render input based on rules', () => {\n // Act\n const result = wrapper.children().props().name\n\n // Assert\n expect(result).toBe(mockField.name)\n })\n\n it('should fill input with received data', () => {\n // Act\n const result = wrapper.children().props().value\n\n // Assert\n expect(result).toBe(mockData.value)\n })\n\n it('should display error if said so', () => {\n // Arrange\n const errorWrapper = shallowWithIntl(\n <StyleguideInput\n field={mockField}\n data={{ value: 'John', error: 'EMPTY_FIELD' }}\n onChange={mockChange}\n onBlur={mockBlur}\n />,\n ).dive()\n\n // Act\n const result = errorWrapper.children().props().errorMessage\n\n // Assert\n expect(result).toBeTruthy()\n })\n\n it('should not display hidden fields', () => {\n // Arrange\n const emptyWrapper = shallowWithIntl(\n <StyleguideInput\n field={{ name: 'firstName', label: 'firstName', hidden: true }}\n data={mockData}\n onChange={mockChange}\n onBlur={mockBlur}\n />,\n ).dive()\n\n // Assert\n expect(emptyWrapper).toHaveClassName('dn')\n })\n})\n\n```"
}
] |
code_instore-profile_b38158d4
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/__tests__/ProfileContainer.test.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport React from 'react'\nimport { shallowWithIntl, loadTranslation } from 'enzyme-react-intl'\nimport ProfileContainer from '../ProfileContainer'\nimport ProfileField from '../ProfileField'\nimport mockRules from '../__mocks__/rules'\nimport mockProfile from '../__mocks__/profile'\n\nloadTranslation('../messages/pt.json')\n\ndescribe('ProfileContainer', () => {\n let wrapper\n let mockSubmit\n beforeEach(() => {\n // Arrange\n mockSubmit = jest.fn()\n wrapper = shallowWithIntl(\n <ProfileContainer\n rules={mockRules}\n defaultProfile={mockProfile}\n onSubmit={mockSubmit}\n />,\n ).dive()\n })\n\n it('should render fields based on rules', () => {\n // Act\n const result = wrapper.find(ProfileField)\n\n // Assert\n expect(result).toHaveLength(4)\n })\n\n it('should pass down profile data to fields', () => {\n // Act\n const firstName = wrapper\n .find(ProfileField)\n .first()\n .props().data.value\n const lastName = wrapper\n .find(ProfileField)\n .last()\n .props().data.value\n\n // Assert\n expect(firstName).toBe('John')\n expect(lastName).toBe('Appleseed')\n })\n\n it('should update its state when receives changes', () => {\n // Act\n wrapper.instance().handleFieldUpdate({\n firstName: {\n value: 'Jack',\n },\n })\n wrapper.update()\n const result = wrapper.state().profile.firstName.value\n\n // Assert\n expect(result).toBe('Jack')\n })\n\n it('should call onSubmit with a validated profile when necessary', () => {\n // Arrange\n const subRules = {\n ...mockRules,\n personalFields: [\n ...mockRules.personalFields,\n {\n name: 'document',\n maxLength: 30,\n label: 'document',\n required: true,\n },\n ],\n }\n const instance = shallowWithIntl(\n <ProfileContainer\n rules={subRules}\n defaultProfile={mockProfile}\n onSubmit={mockSubmit}\n />,\n )\n .dive()\n .instance()\n\n // Act\n instance.handleSubmit({\n preventDefault() {},\n })\n\n // Assert\n expect(mockSubmit).toHaveBeenCalledWith({\n profile: {\n birthDate: '23/05/92',\n firstName: 'John',\n gender: null,\n lastName: 'Appleseed',\n tradeName: null,\n document: null,\n isCorporate: false,\n },\n valid: false,\n })\n })\n\n it('should include isCorporate in profile object when submitting', () => {\n // Arrange\n const corpProfile = {\n isCorporate: true,\n }\n const instance = shallowWithIntl(\n <ProfileContainer\n rules={mockRules}\n defaultProfile={corpProfile}\n onSubmit={mockSubmit}\n />,\n )\n .dive()\n .instance()\n\n // Act\n instance.handleSubmit({\n preventDefault() {},\n })\n\n // Assert\n expect(mockSubmit).toHaveBeenCalledWith({\n profile: { isCorporate: true },\n valid: false,\n })\n })\n})\n\n```"
}
] |
code_instore-profile_2b52b63a
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/__tests__/setupTests.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport 'jest-enzyme'\nimport Enzyme from 'enzyme'\nimport Adapter from 'enzyme-adapter-react-16'\n\nEnzyme.configure({ adapter: new Adapter() })\n\nglobal.console.warn = warn => {\n throw new Error(warn)\n}\n\n```"
}
] |
code_instore-profile_721084d1
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/__tests__/ProfileSummary.test.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport React from 'react'\nimport { shallowWithIntl, loadTranslation } from 'enzyme-react-intl'\nimport ProfileSummary from '../ProfileSummary'\nimport mockRules from '../__mocks__/rules'\nimport mockProfile from '../__mocks__/profile'\n\nloadTranslation('../messages/pt.json')\n\ndescribe('ProfileSummary', () => {\n let wrapper\n beforeEach(() => {\n // Arrange\n wrapper = shallowWithIntl(\n <ProfileSummary profile={mockProfile} rules={mockRules}>\n {displayData => <span displayData={displayData}>It works!</span>}\n </ProfileSummary>,\n ).dive()\n })\n\n it('should render its children', () => {\n // Act\n const result = wrapper.find('span')\n\n // Assert\n expect(result).toHaveLength(1)\n })\n\n it('should pass down the data in the correct structure', () => {\n // Act\n const result = wrapper.find('span').props().displayData\n\n // Assert\n expect(result.personalData).toBeTruthy()\n expect(result.personalData.firstName).toBeTruthy()\n expect(result.businessData).toBeTruthy()\n })\n\n it('should correctly signal hidden fields in the data', () => {\n // Arrange\n const hiddenRules = {\n ...mockRules,\n businessFields: [\n {\n name: 'tradeName',\n label: 'tradeName',\n hidden: true,\n },\n ],\n }\n const hiddenWrapper = shallowWithIntl(\n <ProfileSummary profile={mockProfile} rules={hiddenRules}>\n {displayData => <span displayData={displayData}>It works!</span>}\n </ProfileSummary>,\n ).dive()\n\n // Act\n const result = hiddenWrapper.find('span').props().displayData.businessData\n .tradeName\n\n // Assert\n expect(result.hidden).toBe(true)\n })\n\n it('should translate the gender before serving', () => {\n // Arrange\n const panProfile = { ...mockProfile, gender: 'pangender' }\n const panWrapper = shallowWithIntl(\n <ProfileSummary profile={panProfile} rules={mockRules}>\n {displayData => <span displayData={displayData}>It works!</span>}\n </ProfileSummary>,\n ).dive()\n\n // Act\n const result = panWrapper.find('span').props().displayData.personalData\n .gender\n\n // Assert\n expect(result.value).toBe('Pangênero')\n })\n\n it('should apply pre-display transformation to data if necessary', () => {\n // Arrange\n const preProfile = { ...mockProfile, tradeName: 'Apple Inc.' }\n const preRules = {\n ...mockRules,\n businessFields: [\n {\n name: 'tradeName',\n label: 'tradeName',\n display: value => value.toUpperCase(),\n },\n ],\n }\n const preWrapper = shallowWithIntl(\n <ProfileSummary profile={preProfile} rules={preRules}>\n {displayData => <span displayData={displayData}>It works!</span>}\n </ProfileSummary>,\n ).dive()\n\n // Act\n const result = preWrapper.find('span').props().displayData.businessData\n .tradeName\n\n // Assert\n expect(result.value).toBe('APPLE INC.')\n })\n\n it('should pass down the isCorporate profile attribute', () => {\n // Arrange\n const corpProfile = { ...mockProfile, isCorporate: true }\n const preWrapper = shallowWithIntl(\n <ProfileSummary profile={corpProfile} rules={mockRules}>\n {displayData => <span displayData={displayData}>It works!</span>}\n </ProfileSummary>,\n ).dive()\n\n // Act\n const result = preWrapper.find('span').props().displayData.isCorporate\n\n // Assert\n expect(result).toBe(true)\n })\n})\n\n```"
}
] |
code_instore-profile_11e76573
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/__tests__/validateProfile.test.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport {\n applyMask,\n applyValidation,\n addFocusToFirstInvalidInput,\n isProfileValid,\n applyFullValidation,\n} from '../modules/validateProfile'\nimport addValidation from '../modules/addValidation'\nimport removeValidation from '../modules/removeValidation'\nimport cleanProfile from '../__mocks__/profile'\nimport validatedProfile from '../__mocks__/validatedProfile'\nimport invalidProfile from '../__mocks__/invalidProfile'\nimport mockRules from '../__mocks__/rules'\n\ndescribe('validateProfile', () => {\n it('should add validation data to a clean profile', () => {\n // Act\n const result = addValidation(cleanProfile, mockRules)\n\n // Assert\n expect(result).toEqual({\n birthDate: { value: '23/05/92' },\n firstName: { value: 'John' },\n gender: { value: null },\n lastName: { value: 'Appleseed' },\n tradeName: { value: null },\n })\n })\n\n it('should apply pre-display transformation to data if necessary', () => {\n // Arrange\n const displayRules = {\n ...mockRules,\n businessFields: [\n {\n name: 'tradeName',\n display: value => value.toUpperCase(),\n },\n ],\n }\n const displayProfile = { ...cleanProfile, tradeName: 'Apple Inc.' }\n\n // Act\n const result = addValidation(displayProfile, displayRules)\n\n // Assert\n expect(result).toEqual({\n birthDate: { value: '23/05/92' },\n firstName: { value: 'John' },\n gender: { value: null },\n lastName: { value: 'Appleseed' },\n tradeName: { value: 'APPLE INC.' },\n })\n })\n\n it('should remove validation data from a validated profile', () => {\n // Act\n const result = removeValidation(validatedProfile, mockRules)\n\n // Assert\n expect(result).toEqual({\n birthDate: '23/05/92',\n firstName: 'John',\n gender: null,\n lastName: 'Appleseed',\n tradeName: null,\n })\n })\n\n it('should apply pre-submit transformation to data if necessary', () => {\n // Arrange\n const submitRules = {\n ...mockRules,\n businessFields: [\n {\n name: 'tradeName',\n submit: value => value.toUpperCase(),\n },\n ],\n }\n const submitProfile = {\n ...validatedProfile,\n tradeName: { value: 'Apple Inc.' },\n }\n\n // Act\n const result = removeValidation(submitProfile, submitRules)\n\n // Assert\n expect(result).toEqual({\n birthDate: '23/05/92',\n firstName: 'John',\n gender: null,\n lastName: 'Appleseed',\n tradeName: 'APPLE INC.',\n })\n })\n\n it('should apply a given mask to a value', () => {\n // Arrange\n const mockField = { mask: value => '**' + value + '**' }\n\n // Act\n const result = applyMask(mockField, 'hello')\n\n // Assert\n expect(result).toBe('**hello**')\n })\n\n it('should validate a required field', () => {\n // Arrange\n const mockField = { required: true }\n\n // Act\n const result = applyValidation(mockField, '')\n\n // Assert\n expect(result).toBe('EMPTY_FIELD')\n })\n\n it('should validate a field according to rules', () => {\n // Arrange\n const mockField = { validate: value => value.length === 3 }\n\n // Act\n const validResult = applyValidation(mockField, 'AAA')\n const invalidResult = applyValidation(mockField, 'AAAA')\n\n // Assert\n expect(validResult).toBeNull()\n expect(invalidResult).toBe('INVALID_FIELD')\n })\n\n it('should check if a profile is valid', () => {\n // Act\n const result = isProfileValid(invalidProfile)\n\n // Assert\n expect(result).toBe(false)\n })\n\n it('should apply focus to the first invalid input', () => {\n // Arrange\n const focusRules = {\n personalFields: [\n ...mockRules.personalFields,\n { name: 'gender', required: true },\n ],\n }\n\n // Act\n const focusedProfile = addFocusToFirstInvalidInput(\n focusRules,\n invalidProfile,\n )\n\n // Assert\n expect(focusedProfile.gender.focus).toBe(true)\n })\n\n it('should not validate business fields if the profile is not corporate', () => {\n // Arrange\n const corpRules = {\n personalFields: [...mockRules.personalFields],\n businessFields: [\n ...mockRules.businessFields,\n {\n name: 'stateRegistration',\n required: true,\n },\n ],\n }\n\n // Act\n const checkedProfile = applyFullValidation(\n corpRules,\n validatedProfile,\n false,\n )\n\n // Assert\n expect(checkedProfile.stateRegistration.error).not.toBeTruthy()\n })\n\n it('should validate business fields if the profile is corporate', () => {\n // Arrange\n const corpRules = {\n personalFields: [...mockRules.personalFields],\n businessFields: [\n ...mockRules.businessFields,\n {\n name: 'stateRegistration',\n required: true,\n },\n ],\n }\n\n // Act\n const checkedProfile = applyFullValidation(\n corpRules,\n validatedProfile,\n true,\n )\n\n // Assert\n expect(checkedProfile.stateRegistration.error).toBeTruthy()\n })\n it('should check for emojis', () => {\n const rules = {\n personalFields: [...mockRules.personalFields],\n businessFields: [],\n }\n\n const profile = { ...validatedProfile }\n\n const validProfile = applyFullValidation(rules, profile, false)\n\n expect(validProfile.firstName.error).toBeFalsy()\n\n profile.firstName.value = '🥰'\n\n const inValidProfile = applyFullValidation(rules, profile, false)\n\n expect(inValidProfile.firstName.error).toBeTruthy()\n })\n})\n\n```"
}
] |
code_instore-profile_58c61a36
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/__tests__/ProfileField.test.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport React from 'react'\nimport { shallow } from 'enzyme'\nimport ProfileField from '../ProfileField'\nimport mockField from '../__mocks__/ruleField'\nimport mockData from '../__mocks__/profileField'\nimport StyleguideInput from '../inputs/StyleguideInput'\n\ndescribe('ProfileField', () => {\n let wrapper\n let mockChange\n beforeEach(() => {\n // Arrange\n mockChange = jest.fn()\n wrapper = shallow(\n <ProfileField\n field={mockField}\n data={mockData}\n onFieldUpdate={mockChange}\n Input={StyleguideInput}\n />,\n )\n })\n\n it('should pass down received rules and data', () => {\n // Act\n const fieldResult = wrapper.find(StyleguideInput).props().field\n const dataResult = wrapper.find(StyleguideInput).props().data\n\n // Assert\n expect(fieldResult).toBe(mockField)\n expect(dataResult).toBe(mockData)\n })\n\n it('should call onFieldUpdate when receives new data', () => {\n // Act\n wrapper.instance().handleChange({ target: { value: 'Joe' } })\n\n // Assert\n expect(mockChange).toHaveBeenCalled()\n })\n\n it('should mask data if necessary before passing up', () => {\n // Arrange\n const maskField = {\n ...mockField,\n mask: value => '-' + value + '-',\n }\n const maskWrapper = shallow(\n <ProfileField\n field={maskField}\n data={mockData}\n onFieldUpdate={mockChange}\n Input={StyleguideInput}\n />,\n )\n\n // Act\n maskWrapper.instance().handleChange({ target: { value: '123456789' } })\n\n // Assert\n expect(mockChange).toHaveBeenCalledWith({\n [maskField.name]: {\n ...mockData,\n value: '-123456789-',\n error: null,\n },\n })\n })\n\n it('should validate touched fields before passing up', () => {\n // Arrange\n const valField = { ...mockField, required: true }\n const valData = { ...mockData, touched: true }\n const valWrapper = shallow(\n <ProfileField\n field={valField}\n data={valData}\n onFieldUpdate={mockChange}\n Input={StyleguideInput}\n />,\n )\n\n // Act\n valWrapper.instance().handleChange({ target: { value: '' } })\n\n // Assert\n expect(mockChange).toHaveBeenCalledWith({\n [valField.name]: {\n ...valData,\n value: '',\n error: 'EMPTY_FIELD',\n },\n })\n })\n\n it('should not validate pristine fields before passing up', () => {\n // Arrange\n const valField = { ...mockField, required: true }\n const valData = { ...mockData, touched: false }\n const valWrapper = shallow(\n <ProfileField\n field={valField}\n data={valData}\n onFieldUpdate={mockChange}\n Input={StyleguideInput}\n />,\n )\n\n // Act\n valWrapper.instance().handleChange({ target: { value: '' } })\n\n // Assert\n expect(mockChange).toHaveBeenCalledWith({\n [valField.name]: {\n ...valData,\n value: '',\n error: null,\n },\n })\n })\n})\n\n```"
}
] |
code_instore-profile_9fd656d0
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/CRI.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport costarica from '@vtex/phone/countries/CRI'\n\nimport { getPhoneFields } from '../modules/phone'\nimport regexValidation from '../modules/regexValidation'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\n\nconst phoneCountryCode = initialize(costarica)\n\nexport default {\n country: 'CRI',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n hidden: true,\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'CRI_cedula',\n hidden: true,\n validate: regexValidation(/^\\d{10}$/),\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n hidden: true,\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'CRI_cedula',\n hidden: true,\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_56c8c580
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/FRA.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport france from '@vtex/phone/countries/FRA'\n\nimport { getPhoneFields } from '../modules/phone'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\n\nconst phoneCountryCode = initialize(france)\n\nexport default {\n country: 'FRA',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n hidden: true,\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_453c4201
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/GBR.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport gbr from '@vtex/phone/countries/GBR' // Used for initialization purposes, do not remove it!\n\nimport { getPhoneFields } from '../modules/phone'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\n\nconst phoneCountryCode = initialize(gbr)\n\nexport default {\n country: 'GBR',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n hidden: true,\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_9c1deb9d
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/ROU.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport { isPastDate } from '../utils/dateRules'\n\nexport default {\n country: 'ROU',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n hidden: true,\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'corporateDocument',\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_e065c91f
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/ESP.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport spain from '@vtex/phone/countries/ESP'\n\nimport { getPhoneFields } from '../modules/phone'\nimport regexValidation from '../modules/regexValidation'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\n\nconst phoneCountryCode = initialize(spain)\n\nexport default {\n country: 'ESP',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n hidden: true,\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'ESP_dni',\n required: false,\n validate: regexValidation(/^(?:\\d{8}|[A-z]\\d{7})-?[A-z]{1}$/),\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n required: false,\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'ESP_cif',\n validate: regexValidation(/^[A-z]{1}\\d{8}$/),\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_82d1a962
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/USA.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport usa from '@vtex/phone/countries/USA' // Used for initialization purposes, do not remove it!\n\nimport { getPhoneFields } from '../modules/phone'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\nimport regexValidation, { regexEmail } from '../modules/regexValidation'\n\nconst phoneCountryCode = initialize(usa)\n\nexport default {\n country: 'USA',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'document',\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n required: true,\n validate: regexValidation(regexEmail),\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n required: true,\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n required: true,\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n required: true,\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'corporateDocument',\n required: true,\n },\n {\n name: 'stateRegistration',\n maxLength: 50,\n label: 'stateRegistration',\n required: true,\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_b788ea36
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/URY.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport uruguay from '@vtex/phone/countries/URY' // Used for initialization purposes, do not remove it!\n\nimport { getPhoneFields } from '../modules/phone'\nimport regexValidation from '../modules/regexValidation'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\n\nconst phoneCountryCode = initialize(uruguay)\n\nfunction validateCedulaURY(value) {\n var baseArray, c, i, intArray, j, k, len, len1, verifiyDigit\n value = value.replace(/\\-|\\./g, '')\n intArray = []\n for (j = 0, len = value.length; j < len; j++) {\n c = value[j]\n intArray.push(parseInt(c))\n }\n //array base para validação no Uruguai\n baseArray = [8, 1, 2, 3, 4, 7, 6]\n verifiyDigit = 0\n //executa o cálculo para criação do dígito verificador\n for (i = k = 0, len1 = baseArray.length; k < len1; i = ++k) {\n value = baseArray[i]\n verifiyDigit += baseArray[i] * intArray[i]\n }\n verifiyDigit %= 10\n //valida o dígito verificador\n return verifiyDigit === intArray[intArray.length - 1]\n}\n\nexport default {\n country: 'URY',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n hidden: true,\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'URY_cedula',\n required: true,\n validate: validateCedulaURY,\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'URY_rut',\n validate: regexValidation(/^\\d{12}$/),\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_a93080aa
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/ECU.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport ecuador from '@vtex/phone/countries/ECU'\n\nimport { getPhoneFields } from '../modules/phone'\nimport regexValidation from '../modules/regexValidation'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\n\nconst phoneCountryCode = initialize(ecuador)\n\nfunction validateCedulaECU(value) {\n var c,\n calculatedVerifyDigit,\n documentWithOnlyNumbers,\n evenDigitsSum,\n i,\n intArray,\n j,\n len,\n nextDozen,\n oddDigitMultiplied,\n oddDigitsSum,\n provinceCode,\n sum,\n temp\n // o número é formado por 10 dígitos, podendo ter um '-' entre o nono e o décimo\n if (RegExp(/^[0-9]{9}-[0-9]{1}$|^[0-9]{10}$/).test(value)) {\n // remove traços contidos no documento\n documentWithOnlyNumbers = value.replace('-', '')\n // converte o array de caracteres em um array de inteiros\n intArray = []\n for (j = 0, len = documentWithOnlyNumbers.length; j < len; j++) {\n c = documentWithOnlyNumbers[j]\n intArray.push(parseInt(c))\n }\n // os dois primeiros dígitos correspondem à província e devem ser um número de 01 a 24\n provinceCode = intArray[0] * 10 + intArray[1]\n if (provinceCode < 1 || provinceCode > 24) {\n return false\n }\n evenDigitsSum = 0\n oddDigitsSum = 0\n // percorre o array de dígitos desconsiderando o dígito verificador\n i = 0\n while (i < intArray.length - 1) {\n // soma-se todos os dígitos de posição par do array\n // verifica se a posição atual é par (+1 é devido ao fato do array começar na posição zero)\n if ((i + 1) % 2 === 0) {\n evenDigitsSum += intArray[i]\n } else {\n // os dígitos da posição ímpar devem ser multiplicador por 2. Se o resultado da multiplicação der um número maior que 9, subtrair 9 a esse número.\n // Ao final, somar o resultado de todas essas contas\n oddDigitMultiplied = intArray[i] * 2\n if (oddDigitMultiplied > 9) {\n oddDigitMultiplied -= 9\n }\n oddDigitsSum += oddDigitMultiplied\n }\n i++\n }\n // o dígito verificador é calculado pela subtração da próxima dezena da soma dos cálculos acima pelo resultado da soma\n\n // cálcula a soma dos resultados acima\n sum = oddDigitsSum + evenDigitsSum\n // calcula a próxima dezena\n temp = sum / 10.0\n temp = Math.ceil(temp)\n nextDozen = temp * 10\n // calcula o dígito verificador\n calculatedVerifyDigit = nextDozen - sum\n // verifica se o calculado é igual ao passado\n return calculatedVerifyDigit === intArray[intArray.length - 1]\n }\n\n return false\n}\n\nexport default {\n country: 'ECU',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n hidden: true,\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'ECU_cedula',\n required: true,\n validate: validateCedulaECU,\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'ECU_ruc',\n validate: regexValidation(/^\\d{13}$/),\n },\n {\n name: 'stateRegistration',\n maxLength: 50,\n label: 'stateRegistration',\n required: true,\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_510e1b15
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/PRT.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport regexValidation from '../modules/regexValidation'\nimport { isPastDate } from '../utils/dateRules'\n\nexport default {\n country: 'PRT',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n hidden: true,\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'PRT_nif',\n validate: regexValidation(/^\\d+$/),\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'PRT_nipc',\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_3328512e
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/MEX.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport mexico from '@vtex/phone/countries/MEX'\n\nimport { getPhoneFields } from '../modules/phone'\nimport regexValidation, { regexEmail } from '../modules/regexValidation'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\n\nconst phoneCountryCode = initialize(mexico)\n\nexport default {\n country: 'MEX',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n required: true,\n validate: regexValidation(regexEmail),\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n required: true,\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'MEX_rfc',\n validate: regexValidation(/^[a-zA-Z]{4}[0-9]{6}(?:[a-zA-Z0-9]{3}|)$/),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n required: true,\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'MEX_rfc',\n required: true,\n validate: regexValidation(/^[a-zA-Z]{4}[0-9]{6}(?:[a-zA-Z0-9]{3}|)$/),\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'MEX_rfc_corporate',\n required: true,\n validate: regexValidation(/^[a-zA-Z]{3}[0-9]{6}[a-zA-Z0-9]{3}$/),\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n required: true,\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'stateRegistration',\n maxLength: 50,\n label: 'stateRegistration',\n required: true,\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_441007fb
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/PAN.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport panama from '@vtex/phone/countries/PAN'\n\nimport { getPhoneFields } from '../modules/phone'\nimport regexValidation from '../modules/regexValidation'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\n\nconst phoneCountryCode = initialize(panama)\n\nexport default {\n country: 'PAN',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n hidden: true,\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'PAN_cip',\n required: true,\n validate: regexValidation(/^[a-zA-Z0-9]{5,30}$/),\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'PAN_ruc',\n validate: regexValidation(/^(\\w{6,12})$/),\n },\n {\n name: 'stateRegistration',\n maxLength: 50,\n label: 'stateRegistration',\n required: true,\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_e07c96f8
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/ARG.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport argentina from '@vtex/phone/countries/ARG'\n\nimport { getPhoneFields } from '../modules/phone'\nimport regexValidation, { regexEmail } from '../modules/regexValidation'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\n\nconst phoneCountryCode = initialize(argentina)\n\nexport default {\n country: 'ARG',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n required: true,\n validate: regexValidation(regexEmail),\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'ARG_dni',\n required: true,\n validate: regexValidation(/^[A-z]?\\d{6,8}$/),\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n required: true,\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n required: true,\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n required: true,\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'ARG_cuit',\n required: true,\n validate: regexValidation(/^([\\d]{2})?([\\d]{8})?([\\d]{1})$/),\n },\n {\n name: 'stateRegistration',\n maxLength: 50,\n label: 'stateRegistration',\n required: true,\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_618ca1e4
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/BRA.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport msk from 'msk'\nimport brazil from '@vtex/phone/countries/BRA'\n\nimport { getPhoneFields } from '../modules/phone'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\nimport regexValidation, { regexEmail } from '../modules/regexValidation'\n\nconst phoneCountryCode = initialize(brazil)\n\nexport default {\n country: 'BRA',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n required: true,\n validate: regexValidation(regexEmail),\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'BRA_cpf',\n required: true,\n mask: value => msk.fit(value, '999.999.999-99'),\n validate: cpf => {\n if (!cpf) {\n return false\n }\n\n let remainder\n\n cpf = !cpf || typeof cpf !== 'string' ? '' : cpf.replace(/[^\\d]+/g, '')\n\n if (\n cpf === '00000000000' ||\n cpf === '11111111111' ||\n cpf === '22222222222' ||\n cpf === '33333333333' ||\n cpf === '44444444444' ||\n cpf === '55555555555' ||\n cpf === '66666666666' ||\n cpf === '77777777777' ||\n cpf === '88888888888' ||\n cpf === '99999999999'\n ) {\n return false\n }\n\n const cpfDigits = cpf.split('').map(Number)\n const firstElement = 0\n const cpfDigitsArray = [firstElement].concat(cpfDigits)\n\n const sum1 = cpfDigitsArray.reduce(function(acc, value, index) {\n if (index < 10) {\n return acc + value * (11 - index)\n }\n\n return acc\n })\n\n remainder = (sum1 * 10) % 11\n\n if (remainder === 10 || remainder === 11) remainder = 0\n if (remainder !== parseInt(cpf.substring(9, 10), 10)) return false\n\n const sum2 = cpfDigitsArray.reduce(function(acc, value, index) {\n if (index < 11) {\n return acc + value * (12 - index)\n }\n\n return acc\n })\n\n remainder = (sum2 * 10) % 11\n\n if (remainder === 10 || remainder === 11) remainder = 0\n if (remainder !== parseInt(cpf.substring(10, 11), 10)) return false\n\n return true\n },\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n required: true,\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n required: true,\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'BRA_cnpj',\n required: true,\n mask: value => msk.fit(value, '99.999.999/9999-99'),\n validate: cnpj => {\n if (!cnpj) {\n return false\n }\n\n cnpj = cnpj.replace(/[^\\d]+/g, '')\n\n if (cnpj.length !== 14) {\n return false\n }\n\n if (\n cnpj === '00000000000000' ||\n cnpj === '11111111111111' ||\n cnpj === '22222222222222' ||\n cnpj === '33333333333333' ||\n cnpj === '44444444444444' ||\n cnpj === '55555555555555' ||\n cnpj === '66666666666666' ||\n cnpj === '77777777777777' ||\n cnpj === '88888888888888' ||\n cnpj === '99999999999999'\n ) {\n return false\n }\n\n // Validate DVs\n let size = cnpj.length - 2\n let numbers = cnpj.substring(0, size)\n const digits = cnpj.substring(size)\n let sum = 0\n let pos = size - 7\n\n for (let i = size; i >= 1; i--) {\n sum += parseInt(numbers.charAt(size - i), 10) * pos--\n if (pos < 2) {\n pos = 9\n }\n }\n\n let result = sum % 11 < 2 ? 0 : 11 - (sum % 11)\n\n if (result !== parseInt(digits.charAt(0), 10)) {\n return false\n }\n\n size += 1\n numbers = cnpj.substring(0, size)\n sum = 0\n pos = size - 7\n for (let i = size; i >= 1; i--) {\n sum += parseInt(numbers.charAt(size - i), 10) * pos--\n if (pos < 2) {\n pos = 9\n }\n }\n\n result = sum % 11 < 2 ? 0 : 11 - (sum % 11)\n if (result !== parseInt(digits.charAt(1), 10)) {\n return false\n }\n\n return true\n },\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'stateRegistration',\n maxLength: 50,\n label: 'stateRegistration',\n required: true,\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n required: true,\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_3fda15e0
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/GTM.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport guatemala from '@vtex/phone/countries/GTM'\n\nimport { getPhoneFields } from '../modules/phone'\nimport regexValidation from '../modules/regexValidation'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\n\nconst phoneCountryCode = initialize(guatemala)\n\nexport default {\n country: 'GTM',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n hidden: true,\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'GTM_dpi',\n required: true,\n validate: regexValidation(\n /^[\\d]{8}(?:\\-|)[\\d]{1}(?:\\-|)[\\d]{2}(?:\\-|)[\\d]{2}$/,\n ),\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'GTM_nit',\n validate: regexValidation(/^[\\d]{7}(?:\\-|)[\\dkK]{1}$/),\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_1e5fabf2
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/KOR.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport korea from '@vtex/phone/countries/KOR'\n\nimport { getPhoneFields } from '../modules/phone'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\n\nconst phoneCountryCode = initialize(korea)\n\nexport default {\n country: 'KOR',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n hidden: true,\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'document',\n required: true,\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'corporateDocument',\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_4c28d370
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/PER.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport peru from '@vtex/phone/countries/PER'\n\nimport { getPhoneFields } from '../modules/phone'\nimport regexValidation from '../modules/regexValidation'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\n\nconst phoneCountryCode = initialize(peru)\n\nexport default {\n country: 'PER',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n hidden: true,\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'PER_document',\n required: true,\n validate: regexValidation(/^[a-zA-Z0-9]{8,12}$/),\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'PER_ruc',\n validate: regexValidation(/^[0-9]{11}$|^[0-9]{8}$/),\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_f4bbc57e
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/PRY.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport paraguay from '@vtex/phone/countries/PRY'\n\nimport { getPhoneFields } from '../modules/phone'\nimport regexValidation from '../modules/regexValidation'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\n\nconst phoneCountryCode = initialize(paraguay)\n\nexport default {\n country: 'PRY',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n hidden: true,\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'PRY_cedula',\n required: true,\n validate: regexValidation(/^(\\w{4,8}(?:\\-|)\\w{1})$/),\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'PRY_ruc',\n validate: regexValidation(/^(\\w{4,8}(?:\\-|)\\w{1})$/),\n },\n {\n name: 'stateRegistration',\n maxLength: 50,\n label: 'stateRegistration',\n required: true,\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_ffe504f0
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/CAN.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport canada from '@vtex/phone/countries/CAN'\n\nimport { getPhoneFields } from '../modules/phone'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\n\nconst phoneCountryCode = initialize(canada)\n\nexport default {\n country: 'CAN',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n hidden: true,\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_69df7a59
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/initializeCountryPhone.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport Phone from '@vtex/phone'\n\nexport default function initialize(country) {\n const phoneCountryCode = country.countryCode\n Phone.countries[phoneCountryCode] = country\n\n return phoneCountryCode\n}\n\n```"
}
] |
code_instore-profile_0d47e077
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/default.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport { isPastDate } from '../utils/dateRules'\nimport regexValidation, { regexEmail } from '../modules/regexValidation'\n\nexport default {\n country: 'UNI',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n required: true,\n validate: regexValidation(regexEmail),\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'document',\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n required: true,\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n required: true,\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'corporateDocument',\n required: true,\n },\n {\n name: 'stateRegistration',\n maxLength: 50,\n label: 'stateRegistration',\n required: true,\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_38ecdd83
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/CHL.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport chile from '@vtex/phone/countries/CHL'\n\nimport { getPhoneFields } from '../modules/phone'\nimport regexValidation from '../modules/regexValidation'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\n\nconst phoneCountryCode = initialize(chile)\n\nfunction validateRUT(rut) {\n var caracteres, dig, dv, i, j, k, resto, serie, sumatoria\n // Codigo inspirado de http://metaltux.cl/2014/06/12/script-de-validacion-de-rut-chileno-en-javascript/\n if (/^\\d{1,2}\\.?\\d{3}\\.?\\d{3}\\-?[\\dkK]$/.test(rut)) {\n rut = rut.replace(/[.-]/g, '')\n if (rut.length === 8) {\n rut = '0' + rut\n }\n rut = rut.substr(0, 8) + '-' + rut.substr(8, 1)\n caracteres = []\n serie = [2, 3, 4, 5, 6, 7]\n dig = rut.toString().substr(rut.toString().length - 1, 1)\n rut = rut.toString().substr(0, rut.toString().length - 2)\n i = 0\n while (i < rut.length) {\n caracteres[i] = parseInt(rut.charAt(rut.length - (i + 1)))\n i++\n }\n sumatoria = 0\n k = 0\n resto = 0\n j = 0\n while (j < caracteres.length) {\n if (parseInt(k, 10) === 6) {\n k = 0\n }\n sumatoria += parseInt(caracteres[j]) * parseInt(serie[k])\n k++\n j++\n }\n resto = sumatoria % 11\n dv = 11 - resto\n if (parseInt(dv, 10) === 10) {\n dv = 'K'\n } else if (parseInt(dv, 10) === 11) {\n dv = 0\n }\n\n if (\n dv\n .toString()\n .trim()\n .toUpperCase() ===\n dig\n .toString()\n .trim()\n .toUpperCase()\n ) {\n return true\n }\n\n return false\n }\n\n return false\n}\n\nexport default {\n country: 'CHL',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n hidden: true,\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'CHL_rut',\n required: false,\n validate: validateRUT,\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'CHL_rut',\n validate: regexValidation(/^0*(\\d{1,3}(\\.?\\d{3})*)\\-?([\\dkK])$/),\n },\n {\n name: 'stateRegistration',\n maxLength: 50,\n label: 'stateRegistration',\n required: true,\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_0036fa1d
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/COL.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport colombia from '@vtex/phone/countries/COL'\n\nimport { getPhoneFields } from '../modules/phone'\nimport regexValidation, { regexEmail } from '../modules/regexValidation'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\n\nconst phoneCountryCode = initialize(colombia)\n\nexport default {\n country: 'COL',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n required: true,\n validate: regexValidation(regexEmail),\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'COL_cedula',\n required: true,\n validate: regexValidation(/^[\\d]{6,12}$/),\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n required: true,\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n required: true,\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n required: true,\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'COL_rut',\n required: true,\n validate: regexValidation(/^[\\d]{5,}$/),\n },\n {\n name: 'stateRegistration',\n maxLength: 50,\n label: 'stateRegistration',\n required: true,\n },\n {\n name: 'stateRegistration',\n maxLength: 50,\n label: 'stateRegistration',\n required: true,\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_7e019f62
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/rules/VEN.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport venezuela from '@vtex/phone/countries/VEN'\n\nimport { getPhoneFields } from '../modules/phone'\nimport regexValidation from '../modules/regexValidation'\nimport initialize from './initializeCountryPhone'\nimport { isPastDate } from '../utils/dateRules'\n\nconst phoneCountryCode = initialize(venezuela)\n\nexport default {\n country: 'VEN',\n personalFields: [\n {\n name: 'firstName',\n maxLength: 100,\n label: 'firstName',\n required: true,\n },\n {\n name: 'lastName',\n maxLength: 100,\n label: 'lastName',\n required: true,\n },\n {\n name: 'email',\n maxLength: 100,\n label: 'email',\n hidden: true,\n },\n {\n name: 'document',\n maxLength: 50,\n label: 'VEN_cedula',\n required: true,\n validate: regexValidation(/^[VvJjEe]-?\\d{6,8}$/),\n },\n {\n name: 'homePhone',\n maxLength: 30,\n label: 'homePhone',\n ...getPhoneFields(phoneCountryCode),\n },\n {\n name: 'gender',\n maxLength: 30,\n label: 'gender',\n },\n {\n name: 'birthDate',\n maxLength: 30,\n label: 'birthDate',\n type: 'date',\n validate: isPastDate,\n },\n ],\n businessFields: [\n {\n name: 'corporateName',\n maxLength: 100,\n label: 'corporateName',\n },\n {\n name: 'tradeName',\n maxLength: 100,\n label: 'tradeName',\n },\n {\n name: 'corporateDocument',\n maxLength: 30,\n label: 'VEN_rif',\n validate: regexValidation(/^[VvJjEe]-?\\d{6,8}-?\\d$/),\n },\n {\n name: 'businessPhone',\n maxLength: 30,\n label: 'businessPhone',\n ...getPhoneFields(phoneCountryCode),\n },\n ],\n}\n\n```"
}
] |
code_instore-profile_f833cf6a
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/modules/validateProfile.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nexport function applyMask(field, value) {\n return field.mask ? field.mask(value) : value\n}\n\nexport function applyValidation(field, value) {\n if (!value || !value.trim()) {\n return field.required ? 'EMPTY_FIELD' : null\n }\n\n return (field.validate && !field.validate(value)) || containsEmoji(value)\n ? 'INVALID_FIELD'\n : null\n}\n\nexport function applyFullValidation(rules, profile, isCorporate) {\n const validatedProfile = Object.keys(profile)\n .map(field => {\n const rule =\n rules.personalFields.find(rule => rule.name === field) ||\n rules.businessFields.find(rule => rule.name === field && isCorporate)\n\n if (rule) {\n const error = applyValidation(rule, profile[field].value)\n\n return { [field]: { ...profile[field], error } }\n }\n\n return { [field]: { value: null } }\n })\n .reduce((acc, cur) => ({ ...acc, ...cur }), {})\n\n return addFocusToFirstInvalidInput(rules, validatedProfile)\n}\n\nexport function isProfileValid(profile) {\n return !Object.keys(profile).some(field => profile[field].error != null)\n}\n\nexport function addFocusToFirstInvalidInput(rules, profile) {\n const firstInvalidInput =\n rules.personalFields.find(field => profile[field.name].error != null) ||\n rules.businessFields.find(field => profile[field.name].error != null)\n\n if (firstInvalidInput == null) return profile\n\n const focusedInput = { ...profile[firstInvalidInput.name], focus: true }\n\n return { ...profile, [firstInvalidInput.name]: focusedInput }\n}\n\nfunction containsEmoji(input) {\n // Emojis until version 11.0\n const EMOJIS_REGEX = /(\\u00a9|\\u00ae|[\\u2000-\\u3300]|\\ud83c[\\ud000-\\udfff]|\\ud83d[\\ud000-\\udfff]|\\ud83e[\\ud000-\\udfff])/\n\n return EMOJIS_REGEX.test(input)\n}\n\n```"
}
] |
code_instore-profile_6b14ccaa
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/modules/emptyProfile.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nexport default {\n birthDate: null,\n businessPhone: null,\n corporateDocument: null,\n corporateName: null,\n document: null,\n email: null,\n firstName: null,\n gender: null,\n homePhone: null,\n lastName: null,\n stateRegistration: null,\n tradeName: null,\n isCorporate: false,\n}\n\n```"
}
] |
code_instore-profile_a502c80b
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/modules/phone.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nimport Phone from '@vtex/phone'\n\nexport function validatePhone(countryCode) {\n return value => Phone.validate(value, countryCode)\n}\n\nexport function formatPhone(countryCode) {\n return value => {\n const phoneDigits = value.replace(/[^\\d]+/g, '')\n const phone =\n value.indexOf('+') === 0\n ? Phone.getPhoneInternational(phoneDigits, countryCode)\n : Phone.getPhoneNational(phoneDigits, countryCode)\n\n if (!phone) return value.replace(/[^\\d]+/g, '')\n\n return Phone.format(phone, Phone.NATIONAL)\n }\n}\n\nexport function cleanPhone(countryCode) {\n return value => {\n const numbers = value.replace(/[^\\d]/g, '')\n\n try {\n const phone = Phone.getPhoneNational(numbers, countryCode)\n\n if (!phone) return value\n\n return Phone.format(phone, Phone.INTERNATIONAL)\n } catch (err) {\n return numbers\n }\n }\n}\n\nexport function getPhoneFields(phoneCountryCode) {\n return {\n mask: formatPhone(phoneCountryCode),\n validate: validatePhone(phoneCountryCode),\n display: formatPhone(phoneCountryCode),\n submit: cleanPhone(phoneCountryCode),\n }\n}\n\n```"
}
] |
code_instore-profile_8b4cae8d
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/modules/addValidation.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nexport default function addValidation(profile, rules) {\n const allRules = [...rules.personalFields, ...rules.businessFields]\n\n return allRules\n .map(field => ({\n [field.name]: {\n value:\n field.display && profile[field.name]\n ? field.display(profile[field.name])\n : profile[field.name],\n },\n }))\n .reduce((acc, cur) => ({ ...acc, ...cur }), {})\n}\n\n```"
}
] |
code_instore-profile_82bfd1fb
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/modules/removeValidation.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nexport default function removeValidation(profile, rules) {\n const allRules = [...rules.personalFields, ...rules.businessFields]\n\n return allRules.reduce((acc, field) => {\n const fieldValue = profile[field.name].value\n\n if (field.submit && fieldValue != null) {\n acc[field.name] = field.submit(fieldValue)\n } else {\n acc[field.name] = fieldValue\n }\n\n return acc\n }, {})\n}\n\n```"
}
] |
code_instore-profile_99d3d95d
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of instore-profile/react/modules/regexValidation.js from the instore-profile VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```javascript\nexport default function regexValidation(customRegex) {\n const regex = new RegExp(customRegex)\n\n return value => regex.test(value)\n}\n\nexport const regexEmail = /^(([^<>()[\\]\\\\.,;:\\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\n```"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.