diff --git a/packages/react/.storybook/preview-head.html b/packages/react/.storybook/preview-head.html index 238f8b42f..14fa374ab 100644 --- a/packages/react/.storybook/preview-head.html +++ b/packages/react/.storybook/preview-head.html @@ -1,5 +1,5 @@ - + diff --git a/packages/react/.storybook/preview.js b/packages/react/.storybook/preview.js index ded220168..e92a7a13d 100644 --- a/packages/react/.storybook/preview.js +++ b/packages/react/.storybook/preview.js @@ -1,13 +1,62 @@ import ThemeDecorator from "./decorators/themeDecorator"; import { dark, light } from "./theme"; +const viewportDS = { + ["Extra small"]: { + name: 'Extra small', + styles: { + width: '576px', + height: '100vh' + } + }, + small: { + name: 'Small', + styles: { + width: '768px', + height: '100vh' + } + }, + Medium: { + name: 'Medium', + styles: { + width: '1024px', + height: '100vh' + } + }, + Large: { + name: 'Large', + styles: { + width: '1280px', + height: '100vh' + } + }, + ["Extra Large"]: { + name: 'Extra Large', + styles: { + width: '1440px', + height: '100vh' + } + }, + ["Extra extra Large"]: { + name: 'Extra extra Large', + styles: { + width: '100%', + height: '100vh' + } + }, +} + export { globalTypes } from "./globalTypes"; export const decorators = [ThemeDecorator] export const parameters = { actions: { argTypesRegex: "^on[A-Z].*" }, backgrounds: { disable: true, grid: { disable: true } }, - viewport: { disable: true }, + viewport: { + disable: false, + viewports: viewportDS + + }, darkMode: { dark, light diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index ae0a66dd3..736f036f9 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.53.0](https://github.com/natura-cosmeticos/natds-js/compare/@naturacosmeticos/natds-react@2.52.0-alpha.DSY-3710.3.0...@naturacosmeticos/natds-react@2.53.0) (2023-09-18) + +* **natds-react:** Add template Login + # [2.52.0](https://github.com/natura-cosmeticos/natds-js/compare/@naturacosmeticos/natds-react@2.52.0-alpha.DSY-3710.3.0...@naturacosmeticos/natds-react@2.52.0) (2023-09-05) * **natds-react:** Add stories search IconButton diff --git a/packages/react/package.json b/packages/react/package.json index 3d5b32971..35fbafd4e 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -2,7 +2,7 @@ "name": "@naturacosmeticos/natds-react", "displayName": "NatDS-React", "description": "A collection of components from Natura Design System for React", - "version": "2.52.0", + "version": "2.53.0-alpha.DSY-3330.5.0", "private": false, "keywords": [ "design-system", @@ -57,8 +57,8 @@ "generate": "yarn plop --plopfile ./generators/plopfile.js" }, "dependencies": { - "@naturacosmeticos/natds-icons": "1.16.1", - "@naturacosmeticos/natds-themes": "0.59.11", + "@naturacosmeticos/natds-icons": "1.16.5", + "@naturacosmeticos/natds-themes": "0.59.24", "react-jss": "10.9.0" }, "devDependencies": { diff --git a/packages/react/src/Templates/GlobalTypes/index.ts b/packages/react/src/Templates/GlobalTypes/index.ts index 85b500da2..fd6b89f2c 100644 --- a/packages/react/src/Templates/GlobalTypes/index.ts +++ b/packages/react/src/Templates/GlobalTypes/index.ts @@ -1,7 +1,6 @@ export type BrandProps = 'aesop' | 'avon' | 'avon_v2' - | 'biome' | 'natura' | 'theBodyShop' | 'consultoriaDeBeleza' diff --git a/packages/react/src/Templates/Login/Login.stories.tsx b/packages/react/src/Templates/Login/Login.stories.tsx new file mode 100644 index 000000000..41950716b --- /dev/null +++ b/packages/react/src/Templates/Login/Login.stories.tsx @@ -0,0 +1,36 @@ +import React from 'react' +import { Story, Meta } from '@storybook/react' +import Login, { openIMG } from './Login' + +const componentStatus = ` +- - - + +**NOTE FOR UXs**: This is exemplo template: +- - - +` + +export default { + title: 'Templates/Login', + component: Login, + parameters: { + componentSubtitle: 'This is an example of implementing the theme on a Login page', + docs: { description: { component: componentStatus } } + } +} as Meta + +export const Playground: Story = (args) => ( + + + +) +Playground.args = { + openIMG: false +} + +// export const TemplateCheckoutMobile: Story = () => ( +//
+ +// +//
+ +// ) diff --git a/packages/react/src/Templates/Login/Login.style.ts b/packages/react/src/Templates/Login/Login.style.ts new file mode 100644 index 000000000..128b2e304 --- /dev/null +++ b/packages/react/src/Templates/Login/Login.style.ts @@ -0,0 +1,118 @@ +/* eslint-disable max-len */ +import { createUseStyles } from 'react-jss' +import { Theme } from '@naturacosmeticos/natds-themes' + +const styles = createUseStyles((theme: Theme) => ({ + + container: { + display: 'flex', + position: 'relative', + fontFamily: [theme.tag.label.primary.fontFamily, theme.tag.label.fallback.fontFamily], + alignItems: 'center', + justifyContent: 'center', + flexDirection: 'column', + border: ' 1px solid #0000001F', + gap: theme.size.micro, + boxSizing: '-moz-initial', + minWidth: 360, + width: '100%', + fontWeight: theme.typography.fontWeight.medium, + fontSize: theme.typography.fontSize.level2 + }, + wrapper: { + width: '100%', + maxWidth: 328, + minHeight: '90px' + }, + wrapperBTN: { + display: 'flex', + flexDirection: 'column', + width: '100%', + marginBottom: '80px', + maxWidth: 328, + gap: 16 + }, + wrapperLogo: { + display: 'flex', + width: '100%', + marginBottom: '40px', + alignItems: 'center', + flexDirection: 'column' + }, + wrapperLogin: { + display: 'flex', + alignItems: 'center', + flexDirection: 'column', + width: '100%', + minHeight: '200px', + marginBottom: '13px', + gap: '24px' + }, + wrapperChecks: { + display: 'flex', + alignItems: 'center', + justifyContent: 'space-between', + width: '100%', + marginBottom: '67px', + maxWidth: 328 + }, + row: { + display: 'flex', + alignContent: 'center', + justifyContent: 'center', + width: '100%' + }, + colLeft: { + display: 'flex', + alignItems: 'center', + flexDirection: 'column', + paddingTop: '150px', + width: '100%' + }, + colRight: { + overflow: 'hidden', + width: '100%', + height: '900px' + }, + btnOpenIMG: { + display: 'flex', + position: 'absolute', + // border: '1px solid red', + top: 5, + left: 5 + }, + + '@media screen and (max-width: 1280px)': { + containerStep: { + display: 'flex', + justifyContent: 'center', + flexDirection: 'column', + // border: '1px solid yellow', + minHeight: '80px', + width: '100%', + gap: 24, + overflow: 'hidden' + }, + containerSection: { + display: 'flex', + width: '100%', + gap: 16, + flexDirection: 'column-reverse', + justifyContent: 'center', + alignItems: 'center' + }, + summaryContainer: { + display: 'flex', + width: '100%', + // alignItems: 'start', + maxWidth: 'unset', + minHeight: 'unset', + flexDirection: 'column', + justifyContent: 'start', + backgroundColor: theme.color.surface, + gap: 4 + } + } +})) + +export default styles diff --git a/packages/react/src/Templates/Login/Login.tsx b/packages/react/src/Templates/Login/Login.tsx new file mode 100644 index 000000000..f7bed950e --- /dev/null +++ b/packages/react/src/Templates/Login/Login.tsx @@ -0,0 +1,94 @@ +/* eslint-disable no-shadow */ +/* eslint-disable complexity */ +import React, { useEffect, useState } from 'react' +import styles from './Login.style' +import TextField from '../../components/TextField/TextField' +import Logo from '../../components/Logo/Logo' +import Icon from '../../components/Icon' +import CheckBox from '../../components/Checkbox' +import Link from '../../components/Link' +import Button from '../../components/Button' +// import Image from '../../components/Image' +import useMedia from '../hookMedia/useMedia' + +const URLIMG = 'https://www.naturaeco.com/wp-content/uploads/sites/428/2021/06/NET-ZERO-scaled.jpg' +export interface openIMG { + openIMG: boolean +} +const Login: React.FC = ({ openIMG }) => { + const [password, setPassword] = useState('Hello World') + const [email, setEmail] = useState('') + const [passwordTrans, setPasswordTrans] = useState(false) + const [check, setCheck] = useState(false) + const [openImg, setOpenImg] = useState(false) + const { mediaOn } = useMedia(768) + const { + container, wrapper, wrapperLogin, + wrapperLogo, wrapperChecks, wrapperBTN, row, colLeft, colRight + } = styles() + + useEffect(() => { + setOpenImg(openIMG) + }, [openIMG]) + + return ( +
+
+
+
+ +
+
+
+ setPasswordTrans(!passwordTrans)} + onChange={(e) => setEmail(e.target.value)} + value={email} + type="text" + label="Login" + /> + +
+
+ setPasswordTrans(!passwordTrans)} + onChange={(e) => setPassword(e.target.value)} + value={password} + type={`${passwordTrans ? 'text' : 'password'}`} + label="Password" + action="icon" + IconComponent={passwordTrans ? : } + /> +
+
+
+ setCheck(!check)} /> + +
+
+ + +
+
+ { + !mediaOn && openImg && ( +
+ {/* */} + + +
+ ) + } + +
+ +
+ ) +} + +export default Login diff --git a/packages/react/src/components/Snackbar/Snackbar.styles.ts b/packages/react/src/components/Snackbar/Snackbar.styles.ts index 981d4768d..beb2967c2 100644 --- a/packages/react/src/components/Snackbar/Snackbar.styles.ts +++ b/packages/react/src/components/Snackbar/Snackbar.styles.ts @@ -129,7 +129,7 @@ const styles = createUseStyles((theme: The }, wrapperRow: { display: 'flex', - alignItems: 'start', + alignItems: 'center', width: '100%', gap: '8px' }, diff --git a/packages/react/src/components/Snackbar/__snapshots__/Snackbar.test.tsx.snap b/packages/react/src/components/Snackbar/__snapshots__/Snackbar.test.tsx.snap index 2ea4673aa..e154e7659 100644 --- a/packages/react/src/components/Snackbar/__snapshots__/Snackbar.test.tsx.snap +++ b/packages/react/src/components/Snackbar/__snapshots__/Snackbar.test.tsx.snap @@ -31,7 +31,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; @@ -214,7 +214,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; @@ -539,7 +539,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; @@ -753,7 +753,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; @@ -934,7 +934,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; @@ -1115,7 +1115,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; @@ -1296,7 +1296,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; @@ -1477,7 +1477,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; @@ -1659,7 +1659,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; @@ -1840,7 +1840,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; @@ -2022,7 +2022,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; @@ -2204,7 +2204,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; @@ -2386,7 +2386,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; @@ -2567,7 +2567,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; @@ -2748,7 +2748,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; @@ -2929,7 +2929,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; @@ -3110,7 +3110,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; @@ -3297,7 +3297,7 @@ Array [ gap: 8px; width: 100%; display: flex; - align-items: start; + align-items: center; } .wrapperColumm-0-2-4 { gap: 8px; diff --git a/yarn.lock b/yarn.lock index 121ff0d18..7c5dc640c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2693,10 +2693,10 @@ resolved "https://registry.yarnpkg.com/@naturacosmeticos/natds-icons/-/natds-icons-1.11.3.tgz#e7de13d8fde2c44f9c68e73de75f02906fefdfb8" integrity sha512-NQVrs5aUaCc7eyrPRh5TlgRYZqT0SXDHq/VVcWUG/R7j9wzFFvCs/IbcAjeNJR4cVNDqq2ruAIl9ZnHanw5Qpw== -"@naturacosmeticos/natds-icons@1.16.1": - version "1.16.1" - resolved "https://registry.yarnpkg.com/@naturacosmeticos/natds-icons/-/natds-icons-1.16.1.tgz#b7c98999ca811fd57a1e31c702deec0f6a04ecbc" - integrity sha512-d8vBZ0rebrS64e9WRCaPr5wPN0peOX/bcineXo/rQg8HAmwwDew3FlXeEOOWXw+N0lGpFkIescs5yuaEIERjfg== +"@naturacosmeticos/natds-icons@1.16.5": + version "1.16.5" + resolved "https://registry.yarnpkg.com/@naturacosmeticos/natds-icons/-/natds-icons-1.16.5.tgz#92ba8094e5a4611eafa06d301dd19ed5524a40bf" + integrity sha512-JNDMoces+b9I+5XZ5NFIPtCuvRvIwa7+MCEjnAWqVbpauPVvbo9GbnWgdRtQMqkZqRUy9WH/n6Ph8A6Fj7+xZQ== "@naturacosmeticos/natds-themes@0.58.5": version "0.58.5" @@ -2707,10 +2707,10 @@ svg2vectordrawable "2.6.26" webp-converter "^2.3.3" -"@naturacosmeticos/natds-themes@0.59.11": - version "0.59.11" - resolved "https://registry.yarnpkg.com/@naturacosmeticos/natds-themes/-/natds-themes-0.59.11.tgz#21a008541179a6651476f7d14ccd97494cc89cd0" - integrity sha512-QjBZn1tDIrhIqYHUy3QOBUKPl2DozDS01uIedJlgfoUFNSgx5QLg8a2qYFxOEoONUXRK7Qyw8Z0w32uDmBwkkw== +"@naturacosmeticos/natds-themes@0.59.24": + version "0.59.24" + resolved "https://registry.yarnpkg.com/@naturacosmeticos/natds-themes/-/natds-themes-0.59.24.tgz#b48ceee2e71eb348a8c67b4f1037745db6b545c7" + integrity sha512-eoKhmI191x1oxK2bd/nqA1eHQHI6SHCCA/KGrXTFnQfEPCpr/vOP2Hp1Q/Dksol6jm0udOlRrJjvDalXdvtbgA== dependencies: open-color "^1.8.0" svg2vectordrawable "2.6.26"