@faststore/ui 2.0.4-alpha.0 → 2.0.6-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/components/molecules/Modal/Modal.js +2 -2
- package/dist/components/molecules/Modal/Modal.js.map +1 -1
- package/dist/components/molecules/QuantitySelector/QuantitySelector.d.ts +1 -2
- package/dist/components/molecules/QuantitySelector/QuantitySelector.js +1 -2
- package/dist/components/molecules/QuantitySelector/QuantitySelector.js.map +1 -1
- package/dist/components/molecules/SearchInput/SearchInput.js +1 -2
- package/dist/components/molecules/SearchInput/SearchInput.js.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/atoms/Input/Input.stories.mdx +34 -0
- package/src/components/atoms/Input/styles.scss +61 -0
- package/src/components/atoms/Overlay/styles.scss +14 -0
- package/src/components/atoms/Popover/stories/Popover.stories.tsx +1 -1
- package/src/components/molecules/Alert/stories/Alert.stories.tsx +1 -1
- package/src/components/molecules/IconButton/IconButton.stories.mdx +1 -1
- package/src/components/molecules/InputField/InputField.stories.mdx +116 -0
- package/src/components/molecules/InputField/styles.scss +139 -0
- package/src/components/molecules/Modal/Modal.tsx +2 -3
- package/src/components/molecules/Modal/stories/Modal.mdx +0 -2
- package/src/components/molecules/QuantitySelector/QuantitySelector.tsx +2 -4
- package/src/components/molecules/SearchInput/SearchInput.tsx +1 -2
- package/src/components/organisms/OutOfStock/stories/OutOfStock.stories.tsx +1 -2
- package/src/index.ts +0 -6
- package/src/styles/components.scss +3 -0
- package/dist/assets/ShoppingCart.d.ts +0 -3
- package/dist/assets/ShoppingCart.js +0 -10
- package/dist/assets/ShoppingCart.js.map +0 -1
- package/dist/assets/X.d.ts +0 -3
- package/dist/assets/X.js +0 -8
- package/dist/assets/X.js.map +0 -1
- package/dist/components/atoms/Input/Input.d.ts +0 -14
- package/dist/components/atoms/Input/Input.js +0 -10
- package/dist/components/atoms/Input/Input.js.map +0 -1
- package/dist/components/atoms/Input/index.d.ts +0 -2
- package/dist/components/atoms/Input/index.js +0 -2
- package/dist/components/atoms/Input/index.js.map +0 -1
- package/dist/components/atoms/Overlay/Overlay.d.ts +0 -10
- package/dist/components/atoms/Overlay/Overlay.js +0 -6
- package/dist/components/atoms/Overlay/Overlay.js.map +0 -1
- package/dist/components/atoms/Overlay/index.d.ts +0 -2
- package/dist/components/atoms/Overlay/index.js +0 -2
- package/dist/components/atoms/Overlay/index.js.map +0 -1
- package/src/assets/ShoppingCart.tsx +0 -50
- package/src/assets/X.tsx +0 -38
- package/src/components/atoms/Input/Input.tsx +0 -36
- package/src/components/atoms/Input/index.ts +0 -2
- package/src/components/atoms/Input/stories/Input.mdx +0 -22
- package/src/components/atoms/Input/stories/Input.stories.tsx +0 -35
- package/src/components/atoms/Overlay/Overlay.tsx +0 -26
- package/src/components/atoms/Overlay/index.ts +0 -2
- package/src/components/atoms/Overlay/stories/Overlay.mdx +0 -18
- package/src/components/atoms/Overlay/stories/Overlay.stories.tsx +0 -48
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.0.6-alpha.0](https://github.com/vtex/faststore/compare/v2.0.5-alpha.0...v2.0.6-alpha.0) (2022-12-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Adds `Input` & `InputField` components ([#1545](https://github.com/vtex/faststore/issues/1545)) ([f89ec49](https://github.com/vtex/faststore/commit/f89ec4930dbcc7179f0fac484e16b0981540b6df))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [2.0.5-alpha.0](https://github.com/vtex/faststore/compare/v2.0.4-alpha.0...v2.0.5-alpha.0) (2022-12-07)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* `Overlay` Component. ([#1544](https://github.com/vtex/faststore/issues/1544)) ([dad6872](https://github.com/vtex/faststore/commit/dad6872654faaa4411d1f5949e5beab609e2ca36))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [2.0.4-alpha.0](https://github.com/vtex/faststore/compare/v2.0.3-alpha.0...v2.0.4-alpha.0) (2022-12-07)
|
|
7
25
|
|
|
8
26
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
|
-
import Overlay from '
|
|
3
|
+
import { Overlay } from '@faststore/components';
|
|
4
4
|
import ModalContent from './ModalContent';
|
|
5
5
|
/*
|
|
6
6
|
* This component is based on @reach/dialog.
|
|
@@ -23,7 +23,7 @@ const Modal = ({ isOpen, children, onDismiss, testId = 'store-modal', ...otherPr
|
|
|
23
23
|
onDismiss?.(event);
|
|
24
24
|
};
|
|
25
25
|
return isOpen
|
|
26
|
-
? createPortal(React.createElement(Overlay, {
|
|
26
|
+
? createPortal(React.createElement(Overlay, { onClick: handleBackdropClick, onKeyDown: handleBackdropKeyDown },
|
|
27
27
|
React.createElement(ModalContent, Object.assign({}, otherProps, { testId: testId }), children)), document.body)
|
|
28
28
|
: null;
|
|
29
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../../src/components/molecules/Modal/Modal.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,OAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../../src/components/molecules/Modal/Modal.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE/C,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAwBzC;;;;GAIG;AAEH,MAAM,KAAK,GAAG,CAAC,EACb,MAAM,EACN,QAAQ,EACR,SAAS,EACT,MAAM,GAAG,aAAa,EACtB,GAAG,UAAU,EACiB,EAAE,EAAE;IAClC,MAAM,mBAAmB,GAAG,CAAC,KAAiB,EAAE,EAAE;QAChD,IAAI,KAAK,CAAC,gBAAgB,EAAE;YAC1B,OAAM;SACP;QAED,KAAK,CAAC,eAAe,EAAE,CAAA;QACvB,SAAS,EAAE,CAAC,KAAK,CAAC,CAAA;IACpB,CAAC,CAAA;IAED,MAAM,qBAAqB,GAAG,CAAC,KAAoB,EAAE,EAAE;QACrD,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,gBAAgB,EAAE;YACpD,OAAM;SACP;QAED,KAAK,CAAC,eAAe,EAAE,CAAA;QACvB,SAAS,EAAE,CAAC,KAAK,CAAC,CAAA;IACpB,CAAC,CAAA;IAED,OAAO,MAAM;QACX,CAAC,CAAC,YAAY,CACV,oBAAC,OAAO,IACN,OAAO,EAAE,mBAAmB,EAC5B,SAAS,EAAE,qBAAqB;YAEhC,oBAAC,YAAY,oBAAK,UAAU,IAAE,MAAM,EAAE,MAAM,KACzC,QAAQ,CACI,CACP,EACV,QAAQ,CAAC,IAAI,CACd;QACH,CAAC,CAAC,IAAI,CAAA;AACV,CAAC,CAAA;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { InputHTMLAttributes } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type { InputProps } from '
|
|
4
|
-
import type { IconButtonProps } from '../../../index';
|
|
3
|
+
import type { IconButtonProps, InputProps } from '@faststore/components';
|
|
5
4
|
export interface QuantitySelectorProps extends InputHTMLAttributes<HTMLDivElement> {
|
|
6
5
|
/**
|
|
7
6
|
* Sets the current value that should be displayed on the input at the center of the quantity selector.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import Input from '
|
|
3
|
-
import { IconButton } from '../../../index';
|
|
2
|
+
import { IconButton, Input } from '@faststore/components';
|
|
4
3
|
const QuantitySelector = forwardRef(function QuantitySelector({ quantity, testId = 'store-quantity-selector', leftButtonProps, inputProps, rightButtonProps, ...otherProps }, ref) {
|
|
5
4
|
return (React.createElement("div", Object.assign({ "data-fs-quantity-selector": true, "data-testid": testId, ref: ref }, otherProps),
|
|
6
5
|
React.createElement(IconButton, Object.assign({ "aria-controls": "quantity-selector-input", "aria-label": "Decrement Quantity", "data-quantity-selector-button": "left" }, leftButtonProps)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuantitySelector.js","sourceRoot":"","sources":["../../../../src/components/molecules/QuantitySelector/QuantitySelector.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAGzC,OAAO,
|
|
1
|
+
{"version":3,"file":"QuantitySelector.js","sourceRoot":"","sources":["../../../../src/components/molecules/QuantitySelector/QuantitySelector.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAGzC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAgCzD,MAAM,gBAAgB,GAAG,UAAU,CACjC,SAAS,gBAAgB,CACvB,EACE,QAAQ,EACR,MAAM,GAAG,yBAAyB,EAClC,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,GAAG,UAAU,EACS,EACxB,GAAG;IAEH,OAAO,CACL,6FAEe,MAAM,EACnB,GAAG,EAAE,GAAG,IACJ,UAAU;QAEd,oBAAC,UAAU,mCACK,yBAAyB,gBAC5B,oBAAoB,mCACD,MAAM,IAChC,eAAe,EACnB;QACF,oBAAC,KAAK,gCACO,UAAU,wCAErB,EAAE,EAAC,yBAAyB,EAC5B,KAAK,EAAE,QAAQ,IACX,UAAU,EACd;QACF,oBAAC,UAAU,mCACK,yBAAyB,gBAC5B,oBAAoB,mCACD,OAAO,IACjC,gBAAgB,EACpB,CACE,CACP,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef, useImperativeHandle, useRef } from 'react';
|
|
2
|
-
import { Icon, Button } from '@faststore/components';
|
|
3
|
-
import Input from '../../atoms/Input';
|
|
2
|
+
import { Icon, Button, Input } from '@faststore/components';
|
|
4
3
|
import Form from '../Form';
|
|
5
4
|
const SearchIcon = () => (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" },
|
|
6
5
|
React.createElement("circle", { cx: "11", cy: "11", r: "8" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../../../src/components/molecules/SearchInput/SearchInput.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEtE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../../../src/components/molecules/SearchInput/SearchInput.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEtE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,IAAI,MAAM,SAAS,CAAA;AAE1B,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,CACvB,6BACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,KAAK,EACX,MAAM,EAAC,KAAK,EACZ,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO;IAEtB,gCAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,GAAG;IAChC,8BAAM,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,OAAO,EAAC,EAAE,EAAC,OAAO,GAAG,CAC1C,CACP,CAAA;AA6BD,MAAM,WAAW,GAAG,UAAU,CAC5B,SAAS,WAAW,CAClB,EACE,QAAQ,EACR,IAAI,EACJ,YAAY,EAAE,SAAS,GAAG,QAAQ,EAClC,MAAM,GAAG,oBAAoB,EAC7B,GAAG,UAAU,EACd,EACD,GAAG;IAEH,MAAM,QAAQ,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAA;IAC/C,MAAM,OAAO,GAAG,MAAM,CAAkB,IAAI,CAAC,CAAA;IAE7C,MAAM,YAAY,GAAG,CAAC,KAAgB,EAAE,EAAE;QACxC,KAAK,CAAC,cAAc,EAAE,CAAA;QAEtB,IAAI,QAAQ,CAAC,OAAO,EAAE,KAAK,KAAK,EAAE,EAAE;YAClC,QAAQ,CAAC,QAAQ,CAAC,OAAQ,CAAC,KAAK,CAAC,CAAA;SAClC;IACH,CAAC,CAAA;IAED,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;QAC9B,QAAQ,EAAE,QAAQ,CAAC,OAAO;QAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC,CAAC,CAAA;IAEH,OAAO,CACL,oBAAC,IAAI,IACH,GAAG,EAAE,OAAO,oDAEC,MAAM,EACnB,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAC,QAAQ;QAEb,oBAAC,KAAK,kBAAC,GAAG,EAAE,QAAQ,gBAAc,SAAS,IAAM,UAAU,EAAI;QAC/D,oBAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,gBAAY,eAAe;YAC9C,oBAAC,IAAI,IAAC,SAAS,EAAE,IAAI,IAAI,oBAAC,UAAU,OAAG,GAAI,CACpC,CACJ,CACR,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,WAAW,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
export * from '@faststore/components';
|
|
2
2
|
export { default as Link } from './components/atoms/Link';
|
|
3
3
|
export type { LinkProps } from './components/atoms/Link';
|
|
4
|
-
export { default as Input } from './components/atoms/Input';
|
|
5
|
-
export type { InputProps } from './components/atoms/Input';
|
|
6
4
|
export { default as Popover } from './components/atoms/Popover';
|
|
7
5
|
export type { PopoverProps } from './components/atoms/Popover';
|
|
8
6
|
export { default as Price } from './components/atoms/Price';
|
|
9
7
|
export type { PriceProps } from './components/atoms/Price';
|
|
10
8
|
export { default as TextArea } from './components/atoms/TextArea';
|
|
11
9
|
export type { TextAreaProps } from './components/atoms/TextArea';
|
|
12
|
-
export { default as Overlay } from './components/atoms/Overlay';
|
|
13
|
-
export type { OverlayProps } from './components/atoms/Overlay';
|
|
14
10
|
export { default as Select } from './components/atoms/Select';
|
|
15
11
|
export type { SelectProps } from './components/atoms/Select';
|
|
16
12
|
export { default as Slider } from './components/atoms/Slider';
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export * from '@faststore/components';
|
|
2
2
|
// Atoms
|
|
3
3
|
export { default as Link } from './components/atoms/Link';
|
|
4
|
-
export { default as Input } from './components/atoms/Input';
|
|
5
4
|
export { default as Popover } from './components/atoms/Popover';
|
|
6
5
|
export { default as Price } from './components/atoms/Price';
|
|
7
6
|
export { default as TextArea } from './components/atoms/TextArea';
|
|
8
|
-
export { default as Overlay } from './components/atoms/Overlay';
|
|
9
7
|
export { default as Select } from './components/atoms/Select';
|
|
10
8
|
export { default as Slider } from './components/atoms/Slider';
|
|
11
9
|
export { default as List } from './components/atoms/List';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AAErC,QAAQ;AACR,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAGzD,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6-alpha.0",
|
|
4
4
|
"description": "A lightweight, framework agnostic component library for React",
|
|
5
5
|
"author": "emersonlaurentino",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@babel/core": "^7.19.6",
|
|
52
52
|
"@faststore/shared": "^2.0.3-alpha.0",
|
|
53
|
-
"@faststore/styles": "^2.0.
|
|
53
|
+
"@faststore/styles": "^2.0.6-alpha.0",
|
|
54
54
|
"@size-limit/preset-small-lib": "^7.0.8",
|
|
55
55
|
"@storybook/addon-a11y": "^6.5.13",
|
|
56
56
|
"@storybook/addon-actions": "^6.5.13",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"node": "16.18.0",
|
|
79
79
|
"yarn": "1.19.1"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "ee9301dc7f42f9f5f6e8ccb5521078e8601fa728"
|
|
82
82
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
|
|
2
|
+
|
|
3
|
+
import { Input } from '@faststore/components'
|
|
4
|
+
|
|
5
|
+
<Meta title="Atoms/Input" component={Input} argTypes={{}} />
|
|
6
|
+
|
|
7
|
+
export const Template = ({ args }) => <Input {...args} />
|
|
8
|
+
|
|
9
|
+
<header>
|
|
10
|
+
|
|
11
|
+
# Input
|
|
12
|
+
|
|
13
|
+
Inputs are text fields used to get user inputs. // Update this!!!!!
|
|
14
|
+
|
|
15
|
+
</header>
|
|
16
|
+
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
<Canvas>
|
|
20
|
+
<Story name="default">{Template.bind({})}</Story>
|
|
21
|
+
</Canvas>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```jsx
|
|
28
|
+
import { Input } from '@faststore/ui'
|
|
29
|
+
|
|
30
|
+
// Styles
|
|
31
|
+
import @faststore/ui/src/components/atoms/Input/styles.scss
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
<ArgsTable story="default" />
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
[data-fs-input] {
|
|
2
|
+
// --------------------------------------------------------
|
|
3
|
+
// Design Tokens for Input
|
|
4
|
+
// --------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
// Default properties
|
|
7
|
+
--fs-input-padding : var(--fs-spacing-1) var(--fs-spacing-2);
|
|
8
|
+
--fs-input-height : var(--fs-control-tap-size);
|
|
9
|
+
|
|
10
|
+
--fs-input-box-shadow : none;
|
|
11
|
+
--fs-input-box-shadow-hover : 0 0 0 var(--fs-border-width) var(--fs-border-color-active);
|
|
12
|
+
|
|
13
|
+
--fs-input-border-radius : var(--fs-border-radius);
|
|
14
|
+
--fs-input-border-width : var(--fs-border-width);
|
|
15
|
+
--fs-input-border-color : var(--fs-border-color);
|
|
16
|
+
--fs-input-border-color-hover : var(--fs-border-color-active);
|
|
17
|
+
|
|
18
|
+
--fs-input-text-color : var(--fs-color-text);
|
|
19
|
+
--fs-input-text-size : var(--fs-text-size-body);
|
|
20
|
+
|
|
21
|
+
--fs-input-line-height : 1.25;
|
|
22
|
+
|
|
23
|
+
--fs-input-transition-function : var(--fs-transition-function);
|
|
24
|
+
--fs-input-transition-property : var(--fs-transition-property);
|
|
25
|
+
--fs-input-transition-timing : var(--fs-transition-timing);
|
|
26
|
+
|
|
27
|
+
// Disabled properties
|
|
28
|
+
--fs-input-disabled-bkg-color : var(--fs-color-disabled-bkg);
|
|
29
|
+
--fs-input-disabled-text-color : var(--fs-color-disabled-text);
|
|
30
|
+
--fs-input-disabled-border-width : var(--fs-border-width);
|
|
31
|
+
--fs-input-disabled-border-color : var(--fs-border-color);
|
|
32
|
+
|
|
33
|
+
// --------------------------------------------------------
|
|
34
|
+
// Structural Styles
|
|
35
|
+
// --------------------------------------------------------
|
|
36
|
+
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: var(--fs-input-height);
|
|
39
|
+
padding: var(--fs-input-padding);
|
|
40
|
+
font-size: var(--fs-input-text-size);
|
|
41
|
+
line-height: var(--fs-input-line-height);
|
|
42
|
+
color: var(--fs-input-text-color);
|
|
43
|
+
border: var(--fs-input-border-width) solid var(--fs-input-border-color);
|
|
44
|
+
border-radius: var(--fs-input-border-radius);
|
|
45
|
+
box-shadow: var(--fs-input-box-shadow);
|
|
46
|
+
transition: var(--fs-input-transition-property) var(--fs-input-transition-timing) var(--fs-input-transition-function);
|
|
47
|
+
|
|
48
|
+
@include input-focus-ring;
|
|
49
|
+
|
|
50
|
+
&:hover:not(:disabled):not(:focus-visible):not(:focus) {
|
|
51
|
+
border-color: var(--fs-input-border-color-hover);
|
|
52
|
+
box-shadow: var(--fs-input-box-shadow-hover);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:disabled {
|
|
56
|
+
cursor: not-allowed;
|
|
57
|
+
color: var(--fs-input-disabled-text-color);
|
|
58
|
+
background-color: var(--fs-input-disabled-bkg-color);
|
|
59
|
+
border: var(--fs-input-disabled-border-width) solid var(--fs-input-disabled-border-color);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[data-fs-overlay] {
|
|
2
|
+
// --------------------------------------------------------
|
|
3
|
+
// Design Tokens for Overlay
|
|
4
|
+
// --------------------------------------------------------
|
|
5
|
+
--fs-overlay-bkg-color: rgb(0 0 0 / 20%);
|
|
6
|
+
|
|
7
|
+
position: fixed;
|
|
8
|
+
top: 0;
|
|
9
|
+
right: 0;
|
|
10
|
+
bottom: 0;
|
|
11
|
+
left: 0;
|
|
12
|
+
z-index: var(--fs-z-index-highest);
|
|
13
|
+
background-color: var(--fs-overlay-bkg-color);
|
|
14
|
+
}
|
|
@@ -2,7 +2,7 @@ import React, { useRef, useState } from 'react'
|
|
|
2
2
|
import type { Story } from '@storybook/react'
|
|
3
3
|
|
|
4
4
|
import Component from '../Popover'
|
|
5
|
-
import Input from '
|
|
5
|
+
import { Input } from '@faststore/components'
|
|
6
6
|
import type { PopoverProps } from '../Popover'
|
|
7
7
|
import mdx from './Popover.mdx'
|
|
8
8
|
import type { ComponentArgTypes } from '../../../../typings/utils'
|
|
@@ -3,7 +3,7 @@ import React from 'react'
|
|
|
3
3
|
|
|
4
4
|
import type { AlertProps } from '../Alert'
|
|
5
5
|
import Component from '../Alert'
|
|
6
|
-
import { ShoppingCart } from '
|
|
6
|
+
import { ShoppingCart } from '@faststore/components/src/assets'
|
|
7
7
|
import mdx from './Alert.mdx'
|
|
8
8
|
import { Icon } from '../../../../'
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
|
|
2
2
|
|
|
3
3
|
import { IconButton } from '@faststore/components'
|
|
4
|
-
import { ShoppingCart } from '
|
|
4
|
+
import { ShoppingCart } from '@faststore/components/src/assets'
|
|
5
5
|
|
|
6
6
|
<Meta
|
|
7
7
|
title="Molecules/IconButton"
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
|
|
2
|
+
|
|
3
|
+
import { InputField } from '@faststore/components'
|
|
4
|
+
|
|
5
|
+
<Meta
|
|
6
|
+
title="Molecules/InputField"
|
|
7
|
+
component={InputField}
|
|
8
|
+
argTypes={{
|
|
9
|
+
actionable: {
|
|
10
|
+
type: { name: 'boolean' },
|
|
11
|
+
},
|
|
12
|
+
disabled: {
|
|
13
|
+
type: { name: 'boolean' },
|
|
14
|
+
},
|
|
15
|
+
id: {
|
|
16
|
+
type: { name: 'string', required: true },
|
|
17
|
+
},
|
|
18
|
+
inputRef: {
|
|
19
|
+
control: { disable: true },
|
|
20
|
+
},
|
|
21
|
+
}}
|
|
22
|
+
/>
|
|
23
|
+
|
|
24
|
+
export const Template = (args) => {
|
|
25
|
+
return <InputField {...args} />
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
<header>
|
|
29
|
+
|
|
30
|
+
# Input Field
|
|
31
|
+
|
|
32
|
+
Input Field are text fields used to get user inputs.
|
|
33
|
+
|
|
34
|
+
</header>
|
|
35
|
+
|
|
36
|
+
## Overview
|
|
37
|
+
|
|
38
|
+
The `InputField` component uses [FastStore UI Input](https://www.faststore.dev/reference/ui/atoms/Input) as base.
|
|
39
|
+
|
|
40
|
+
<Canvas>
|
|
41
|
+
<Story
|
|
42
|
+
name="overview-default"
|
|
43
|
+
args={{
|
|
44
|
+
id: 'overview-default',
|
|
45
|
+
label: 'Label',
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
{Template.bind({})}
|
|
49
|
+
</Story>
|
|
50
|
+
<Story
|
|
51
|
+
name="overview-error"
|
|
52
|
+
args={{
|
|
53
|
+
id: 'overview-error',
|
|
54
|
+
label: 'Input w/ Error Message',
|
|
55
|
+
error: 'Error Message',
|
|
56
|
+
disabled: false,
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
{Template.bind({})}
|
|
60
|
+
</Story>
|
|
61
|
+
<Story
|
|
62
|
+
name="overview-actionable"
|
|
63
|
+
args={{
|
|
64
|
+
id: 'overview-actionable',
|
|
65
|
+
label: 'Input w/ Action',
|
|
66
|
+
actionable: true,
|
|
67
|
+
disabled: false,
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
{Template.bind({})}
|
|
71
|
+
</Story>
|
|
72
|
+
<Story
|
|
73
|
+
name="overview-actionable-error"
|
|
74
|
+
args={{
|
|
75
|
+
id: 'overview-actionable-error',
|
|
76
|
+
label: 'Input w/ Action and Error',
|
|
77
|
+
actionable: true,
|
|
78
|
+
error: 'Error Message',
|
|
79
|
+
disabled: false,
|
|
80
|
+
}}
|
|
81
|
+
>
|
|
82
|
+
{Template.bind({})}
|
|
83
|
+
</Story>
|
|
84
|
+
<Story
|
|
85
|
+
name="overview-disabled"
|
|
86
|
+
args={{
|
|
87
|
+
id: 'overview-disabled',
|
|
88
|
+
label: 'Input Disabled',
|
|
89
|
+
actionable: false,
|
|
90
|
+
disabled: true,
|
|
91
|
+
value: 'Input Text',
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
{Template.bind({})}
|
|
95
|
+
</Story>
|
|
96
|
+
</Canvas>
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Usage
|
|
101
|
+
|
|
102
|
+
`import InputField from '../components/ui/InputField'`
|
|
103
|
+
|
|
104
|
+
<Canvas>
|
|
105
|
+
<Story
|
|
106
|
+
name="input-default"
|
|
107
|
+
args={{
|
|
108
|
+
id: 'input-default',
|
|
109
|
+
label: 'Label',
|
|
110
|
+
}}
|
|
111
|
+
>
|
|
112
|
+
{Template.bind({})}
|
|
113
|
+
</Story>
|
|
114
|
+
</Canvas>
|
|
115
|
+
|
|
116
|
+
<ArgsTable story="input-default" />
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
[data-fs-input-field] {
|
|
2
|
+
// --------------------------------------------------------
|
|
3
|
+
// Design Tokens for Input Field
|
|
4
|
+
// --------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
// Default properties
|
|
7
|
+
--fs-input-field-padding : var(--fs-spacing-2) var(--fs-spacing-2) 0;
|
|
8
|
+
--fs-input-field-color : var(--fs-color-text);
|
|
9
|
+
--fs-input-field-size : var(--fs-text-size-body);
|
|
10
|
+
--fs-input-field-border-color : var(--fs-border-color);
|
|
11
|
+
|
|
12
|
+
--fs-input-field-transition-function : var(--fs-transition-function);
|
|
13
|
+
--fs-input-field-transition-property : var(--fs-transition-property);
|
|
14
|
+
--fs-input-field-transition-timing : var(--fs-transition-timing);
|
|
15
|
+
|
|
16
|
+
// Label
|
|
17
|
+
--fs-input-field-label-padding : 0 var(--fs-spacing-2);
|
|
18
|
+
--fs-input-field-label-color : var(--fs-color-text-light);
|
|
19
|
+
--fs-input-field-label-size : var(--fs-text-size-tiny);
|
|
20
|
+
|
|
21
|
+
// Error
|
|
22
|
+
--fs-input-field-error-message-size : var(--fs-text-size-legend);
|
|
23
|
+
--fs-input-field-error-message-line-height : 1.1;
|
|
24
|
+
--fs-input-field-error-message-margin-top : var(--fs-spacing-0);
|
|
25
|
+
--fs-input-field-error-message-color : var(--fs-color-danger-text);
|
|
26
|
+
--fs-input-field-error-border-color : var(--fs-color-danger-border);
|
|
27
|
+
--fs-input-field-error-box-shadow : 0 0 0 var(--fs-border-width) var(--fs-input-field-error-border-color);
|
|
28
|
+
--fs-input-field-error-focus-ring : var(--fs-color-focus-ring-danger);
|
|
29
|
+
|
|
30
|
+
// Disabled
|
|
31
|
+
--fs-input-field-disabled-bkg-color : var(--fs-color-disabled-bkg);
|
|
32
|
+
--fs-input-field-disabled-text-color : var(--fs-color-disabled-text);
|
|
33
|
+
--fs-input-field-disabled-border-width : var(--fs-border-width);
|
|
34
|
+
--fs-input-field-disabled-border-color : var(--fs-border-color);
|
|
35
|
+
|
|
36
|
+
// --------------------------------------------------------
|
|
37
|
+
// Structural Styles
|
|
38
|
+
// --------------------------------------------------------
|
|
39
|
+
|
|
40
|
+
position: relative;
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-flow: column;
|
|
43
|
+
|
|
44
|
+
input,
|
|
45
|
+
label {
|
|
46
|
+
transition: var(--fs-input-field-transition-property) var(--fs-input-field-transition-timing) var(--fs-input-field-transition-function);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
input {
|
|
50
|
+
padding: var(--fs-input-field-padding);
|
|
51
|
+
color: var(--fs-input-field-color);
|
|
52
|
+
|
|
53
|
+
&:placeholder-shown + label {
|
|
54
|
+
top: calc(1.5 * (var(--fs-input-field-size) / 2));
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&::placeholder {
|
|
59
|
+
opacity: 0;
|
|
60
|
+
transition: inherit;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&:focus::placeholder {
|
|
64
|
+
opacity: 1;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:not(:placeholder-shown) + label,
|
|
68
|
+
&:focus + label {
|
|
69
|
+
top: rem(6px);
|
|
70
|
+
font-size: var(--fs-input-field-label-size);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&:disabled + label {
|
|
74
|
+
cursor: not-allowed;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
label {
|
|
79
|
+
position: absolute;
|
|
80
|
+
padding: var(--fs-input-field-label-padding);
|
|
81
|
+
font-size: var(--fs-input-field-size);
|
|
82
|
+
line-height: 1.5;
|
|
83
|
+
color: var(--fs-input-field-label-color);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// --------------------------------------------------------
|
|
87
|
+
// Variants Styles
|
|
88
|
+
// --------------------------------------------------------
|
|
89
|
+
|
|
90
|
+
&[data-fs-input-field-error="true"] {
|
|
91
|
+
input {
|
|
92
|
+
border-color: var(--fs-input-field-error-border-color);
|
|
93
|
+
|
|
94
|
+
@include input-focus-ring($outline: #{var(--fs-input-field-error-focus-ring)},
|
|
95
|
+
$border: #{var(--fs-input-field-error-border-color)});
|
|
96
|
+
|
|
97
|
+
&:hover:not(:disabled):not(:focus-visible):not(:focus) {
|
|
98
|
+
border-color: var(--fs-input-field-error-border-color);
|
|
99
|
+
box-shadow: var(--fs-input-field-error-box-shadow);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
[data-fs-input-field-error-message] {
|
|
104
|
+
margin-top: var(--fs-input-field-error-message-margin-top);
|
|
105
|
+
font-size: var(--fs-input-field-error-message-size);
|
|
106
|
+
line-height: var(--fs-input-field-error-message-line-height);
|
|
107
|
+
color: var(--fs-input-field-error-message-color);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&[data-fs-input-field-actionable="true"] {
|
|
112
|
+
min-width: rem(250px);
|
|
113
|
+
|
|
114
|
+
input {
|
|
115
|
+
padding-right: var(--fs-spacing-13);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
[data-fs-button] {
|
|
119
|
+
position: absolute;
|
|
120
|
+
top: var(--fs-spacing-1);
|
|
121
|
+
right: var(--fs-spacing-1);
|
|
122
|
+
|
|
123
|
+
&::before {
|
|
124
|
+
position: absolute;
|
|
125
|
+
left: calc(-1 * var(--fs-spacing-1));
|
|
126
|
+
width: 1px;
|
|
127
|
+
height: 80%;
|
|
128
|
+
content: "";
|
|
129
|
+
background-color: var(--fs-input-field-border-color);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
[data-fs-button][data-fs-icon-button] {
|
|
134
|
+
&::before {
|
|
135
|
+
left: calc(-1 * var(--fs-spacing-1));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -7,9 +7,9 @@ import type {
|
|
|
7
7
|
import React from 'react'
|
|
8
8
|
import { createPortal } from 'react-dom'
|
|
9
9
|
|
|
10
|
-
import Overlay from '
|
|
11
|
-
import ModalContent from './ModalContent'
|
|
10
|
+
import { Overlay } from '@faststore/components'
|
|
12
11
|
import type { ModalContentProps } from './ModalContent'
|
|
12
|
+
import ModalContent from './ModalContent'
|
|
13
13
|
|
|
14
14
|
export interface ModalProps extends ModalContentProps {
|
|
15
15
|
/**
|
|
@@ -67,7 +67,6 @@ const Modal = ({
|
|
|
67
67
|
return isOpen
|
|
68
68
|
? createPortal(
|
|
69
69
|
<Overlay
|
|
70
|
-
data-modal-overlay
|
|
71
70
|
onClick={handleBackdropClick}
|
|
72
71
|
onKeyDown={handleBackdropKeyDown}
|
|
73
72
|
>
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { InputHTMLAttributes } from 'react'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
3
|
|
|
4
|
-
import type { InputProps } from '
|
|
5
|
-
import Input from '
|
|
6
|
-
import type { IconButtonProps } from '../../../index'
|
|
7
|
-
import { IconButton } from '../../../index'
|
|
4
|
+
import type { IconButtonProps, InputProps } from '@faststore/components'
|
|
5
|
+
import { IconButton, Input } from '@faststore/components'
|
|
8
6
|
|
|
9
7
|
export interface QuantitySelectorProps
|
|
10
8
|
extends InputHTMLAttributes<HTMLDivElement> {
|
|
@@ -6,8 +6,7 @@ import type {
|
|
|
6
6
|
} from 'react'
|
|
7
7
|
import React, { forwardRef, useImperativeHandle, useRef } from 'react'
|
|
8
8
|
|
|
9
|
-
import { Icon, Button } from '@faststore/components'
|
|
10
|
-
import Input from '../../atoms/Input'
|
|
9
|
+
import { Icon, Button, Input } from '@faststore/components'
|
|
11
10
|
import Form from '../Form'
|
|
12
11
|
|
|
13
12
|
const SearchIcon = () => (
|
|
@@ -7,8 +7,7 @@ import type {
|
|
|
7
7
|
OutOfStockProps,
|
|
8
8
|
} from '..'
|
|
9
9
|
import Component, { OutOfStockTitle, OutOfStockMessage } from '..'
|
|
10
|
-
import { Button } from '@faststore/components'
|
|
11
|
-
import Input from '../../../atoms/Input'
|
|
10
|
+
import { Button, Input } from '@faststore/components'
|
|
12
11
|
import mdx from './OutOfStock.mdx'
|
|
13
12
|
|
|
14
13
|
type OutOfStockTemplateProps = {
|
package/src/index.ts
CHANGED
|
@@ -4,9 +4,6 @@ export * from '@faststore/components'
|
|
|
4
4
|
export { default as Link } from './components/atoms/Link'
|
|
5
5
|
export type { LinkProps } from './components/atoms/Link'
|
|
6
6
|
|
|
7
|
-
export { default as Input } from './components/atoms/Input'
|
|
8
|
-
export type { InputProps } from './components/atoms/Input'
|
|
9
|
-
|
|
10
7
|
export { default as Popover } from './components/atoms/Popover'
|
|
11
8
|
export type { PopoverProps } from './components/atoms/Popover'
|
|
12
9
|
|
|
@@ -16,9 +13,6 @@ export type { PriceProps } from './components/atoms/Price'
|
|
|
16
13
|
export { default as TextArea } from './components/atoms/TextArea'
|
|
17
14
|
export type { TextAreaProps } from './components/atoms/TextArea'
|
|
18
15
|
|
|
19
|
-
export { default as Overlay } from './components/atoms/Overlay'
|
|
20
|
-
export type { OverlayProps } from './components/atoms/Overlay'
|
|
21
|
-
|
|
22
16
|
export { default as Select } from './components/atoms/Select'
|
|
23
17
|
export type { SelectProps } from './components/atoms/Select'
|
|
24
18
|
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
@import "../components/atoms/Badge/styles";
|
|
3
3
|
@import "../components/atoms/Button/styles";
|
|
4
4
|
@import "../components/atoms/Checkbox/styles";
|
|
5
|
+
@import "../components/atoms/Input/styles";
|
|
6
|
+
@import "../components/atoms/Overlay/styles";
|
|
5
7
|
@import "../components/atoms/Radio/styles";
|
|
6
8
|
|
|
7
9
|
// Molecules
|
|
8
10
|
@import "../components/molecules/CheckboxField/styles";
|
|
11
|
+
@import "../components/molecules/InputField/styles";
|
|
9
12
|
@import "../components/molecules/RadioField/styles";
|
|
10
13
|
@import "../components/molecules/Tag/styles";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
// Icon from Phosphor Icons
|
|
3
|
-
const ShoppingCart = () => (React.createElement("svg", { id: "ShoppingCart", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", viewBox: "0 0 256 256", strokeWidth: "16", width: 24, height: 24 },
|
|
4
|
-
React.createElement("rect", { width: "256", height: "256", fill: "none" }),
|
|
5
|
-
React.createElement("path", { d: "M184,184H69.81818L41.92162,30.56892A8,8,0,0,0,34.05066,24H16", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
6
|
-
React.createElement("circle", { cx: "80", cy: "204", r: "20", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
7
|
-
React.createElement("circle", { cx: "184", cy: "204", r: "20", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
8
|
-
React.createElement("path", { d: "M62.54543,144H188.10132a16,16,0,0,0,15.74192-13.13783L216,64H48", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
9
|
-
export default ShoppingCart;
|
|
10
|
-
//# sourceMappingURL=ShoppingCart.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ShoppingCart.js","sourceRoot":"","sources":["../../src/assets/ShoppingCart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,2BAA2B;AAC3B,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,CACzB,6BACE,EAAE,EAAC,cAAc,EACjB,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,cAAc,EACnB,OAAO,EAAC,aAAa,EACrB,WAAW,EAAC,IAAI,EAChB,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE;IAEV,8BAAM,KAAK,EAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,GAAQ;IAClD,8BACE,CAAC,EAAC,8DAA8D,EAChE,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GAChB;IACR,gCACE,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,KAAK,EACR,CAAC,EAAC,IAAI,EACN,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACd;IACV,gCACE,EAAE,EAAC,KAAK,EACR,EAAE,EAAC,KAAK,EACR,CAAC,EAAC,IAAI,EACN,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACd;IACV,8BACE,CAAC,EAAC,iEAAiE,EACnE,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GAChB,CACJ,CACP,CAAA;AAED,eAAe,YAAY,CAAA"}
|
package/dist/assets/X.d.ts
DELETED
package/dist/assets/X.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
// Icon from Phosphor Icons
|
|
3
|
-
const X = () => (React.createElement("svg", { id: "X", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", viewBox: "0 0 256 256", strokeWidth: "16", width: 24, height: 24 },
|
|
4
|
-
React.createElement("rect", { width: "256", height: "256", fill: "none" }),
|
|
5
|
-
React.createElement("line", { x1: "200", y1: "56", x2: "56", y2: "200", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
6
|
-
React.createElement("line", { x1: "200", y1: "200", x2: "56", y2: "56", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
7
|
-
export default X;
|
|
8
|
-
//# sourceMappingURL=X.js.map
|
package/dist/assets/X.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"X.js","sourceRoot":"","sources":["../../src/assets/X.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,2BAA2B;AAC3B,MAAM,CAAC,GAAG,GAAG,EAAE,CAAC,CACd,6BACE,EAAE,EAAC,GAAG,EACN,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,cAAc,EACnB,OAAO,EAAC,aAAa,EACrB,WAAW,EAAC,IAAI,EAChB,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE;IAEV,8BAAM,KAAK,EAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,GAAQ;IAClD,8BACE,EAAE,EAAC,KAAK,EACR,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,KAAK,EACR,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GAChB;IACR,8BACE,EAAE,EAAC,KAAK,EACR,EAAE,EAAC,KAAK,EACR,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,EACP,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GAChB,CACJ,CACP,CAAA;AAED,eAAe,CAAC,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { InputHTMLAttributes } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
-
/**
|
|
5
|
-
* Current variant of the input.
|
|
6
|
-
*/
|
|
7
|
-
variant?: 'success' | 'error';
|
|
8
|
-
/**
|
|
9
|
-
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
10
|
-
*/
|
|
11
|
-
testId?: string;
|
|
12
|
-
}
|
|
13
|
-
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
14
|
-
export default Input;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
2
|
-
const Input = forwardRef(function Input({ variant, testId = 'store-input', ...otherProps }, ref) {
|
|
3
|
-
const variants = {
|
|
4
|
-
'data-error': variant === 'error' || undefined,
|
|
5
|
-
'data-success': variant === 'success' || undefined,
|
|
6
|
-
};
|
|
7
|
-
return (React.createElement("input", Object.assign({ ref: ref, "data-fs-input": true, "data-testid": testId }, variants, otherProps)));
|
|
8
|
-
});
|
|
9
|
-
export default Input;
|
|
10
|
-
//# sourceMappingURL=Input.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../../src/components/atoms/Input/Input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAazC,MAAM,KAAK,GAAG,UAAU,CAA+B,SAAS,KAAK,CACnE,EAAE,OAAO,EAAE,MAAM,GAAG,aAAa,EAAE,GAAG,UAAU,EAAE,EAClD,GAAG;IAEH,MAAM,QAAQ,GAAG;QACf,YAAY,EAAE,OAAO,KAAK,OAAO,IAAI,SAAS;QAC9C,cAAc,EAAE,OAAO,KAAK,SAAS,IAAI,SAAS;KACnD,CAAA;IAED,OAAO,CACL,6CACE,GAAG,EAAE,GAAG,wCAEK,MAAM,IACf,QAAQ,EACR,UAAU,EACd,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,KAAK,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/atoms/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
/**
|
|
5
|
-
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
6
|
-
*/
|
|
7
|
-
testId?: string;
|
|
8
|
-
}
|
|
9
|
-
declare const Overlay: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
-
export default Overlay;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
2
|
-
const Overlay = forwardRef(function Overlay({ testId = 'store-overlay', ...otherProps }, ref) {
|
|
3
|
-
return (React.createElement("div", Object.assign({ role: "presentation", "data-fs-overlay": true, "data-testid": testId, ref: ref }, otherProps)));
|
|
4
|
-
});
|
|
5
|
-
export default Overlay;
|
|
6
|
-
//# sourceMappingURL=Overlay.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.js","sourceRoot":"","sources":["../../../../src/components/atoms/Overlay/Overlay.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AASzC,MAAM,OAAO,GAAG,UAAU,CAAwB,SAAS,OAAO,CAChE,EAAE,MAAM,GAAG,eAAe,EAAE,GAAG,UAAU,EAAE,EAC3C,GAAG;IAEH,OAAO,CACL,2CACE,IAAI,EAAC,cAAc,0CAEN,MAAM,EACnB,GAAG,EAAE,GAAG,IACJ,UAAU,EACd,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,OAAO,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/atoms/Overlay/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
// Icon from Phosphor Icons
|
|
4
|
-
const ShoppingCart = () => (
|
|
5
|
-
<svg
|
|
6
|
-
id="ShoppingCart"
|
|
7
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
-
fill="currentColor"
|
|
9
|
-
viewBox="0 0 256 256"
|
|
10
|
-
strokeWidth="16"
|
|
11
|
-
width={24}
|
|
12
|
-
height={24}
|
|
13
|
-
>
|
|
14
|
-
<rect width="256" height="256" fill="none"></rect>
|
|
15
|
-
<path
|
|
16
|
-
d="M184,184H69.81818L41.92162,30.56892A8,8,0,0,0,34.05066,24H16"
|
|
17
|
-
fill="none"
|
|
18
|
-
stroke="currentColor"
|
|
19
|
-
strokeLinecap="round"
|
|
20
|
-
strokeLinejoin="round"
|
|
21
|
-
></path>
|
|
22
|
-
<circle
|
|
23
|
-
cx="80"
|
|
24
|
-
cy="204"
|
|
25
|
-
r="20"
|
|
26
|
-
fill="none"
|
|
27
|
-
stroke="currentColor"
|
|
28
|
-
strokeLinecap="round"
|
|
29
|
-
strokeLinejoin="round"
|
|
30
|
-
></circle>
|
|
31
|
-
<circle
|
|
32
|
-
cx="184"
|
|
33
|
-
cy="204"
|
|
34
|
-
r="20"
|
|
35
|
-
fill="none"
|
|
36
|
-
stroke="currentColor"
|
|
37
|
-
strokeLinecap="round"
|
|
38
|
-
strokeLinejoin="round"
|
|
39
|
-
></circle>
|
|
40
|
-
<path
|
|
41
|
-
d="M62.54543,144H188.10132a16,16,0,0,0,15.74192-13.13783L216,64H48"
|
|
42
|
-
fill="none"
|
|
43
|
-
stroke="currentColor"
|
|
44
|
-
strokeLinecap="round"
|
|
45
|
-
strokeLinejoin="round"
|
|
46
|
-
></path>
|
|
47
|
-
</svg>
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
export default ShoppingCart
|
package/src/assets/X.tsx
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
// Icon from Phosphor Icons
|
|
4
|
-
const X = () => (
|
|
5
|
-
<svg
|
|
6
|
-
id="X"
|
|
7
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
-
fill="currentColor"
|
|
9
|
-
viewBox="0 0 256 256"
|
|
10
|
-
strokeWidth="16"
|
|
11
|
-
width={24}
|
|
12
|
-
height={24}
|
|
13
|
-
>
|
|
14
|
-
<rect width="256" height="256" fill="none"></rect>
|
|
15
|
-
<line
|
|
16
|
-
x1="200"
|
|
17
|
-
y1="56"
|
|
18
|
-
x2="56"
|
|
19
|
-
y2="200"
|
|
20
|
-
fill="none"
|
|
21
|
-
stroke="currentColor"
|
|
22
|
-
strokeLinecap="round"
|
|
23
|
-
strokeLinejoin="round"
|
|
24
|
-
></line>
|
|
25
|
-
<line
|
|
26
|
-
x1="200"
|
|
27
|
-
y1="200"
|
|
28
|
-
x2="56"
|
|
29
|
-
y2="56"
|
|
30
|
-
fill="none"
|
|
31
|
-
stroke="currentColor"
|
|
32
|
-
strokeLinecap="round"
|
|
33
|
-
strokeLinejoin="round"
|
|
34
|
-
></line>
|
|
35
|
-
</svg>
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
export default X
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
|
2
|
-
import type { InputHTMLAttributes } from 'react'
|
|
3
|
-
import React, { forwardRef } from 'react'
|
|
4
|
-
|
|
5
|
-
export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
6
|
-
/**
|
|
7
|
-
* Current variant of the input.
|
|
8
|
-
*/
|
|
9
|
-
variant?: 'success' | 'error'
|
|
10
|
-
/**
|
|
11
|
-
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
12
|
-
*/
|
|
13
|
-
testId?: string
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const Input = forwardRef<HTMLInputElement, InputProps>(function Input(
|
|
17
|
-
{ variant, testId = 'store-input', ...otherProps },
|
|
18
|
-
ref
|
|
19
|
-
) {
|
|
20
|
-
const variants = {
|
|
21
|
-
'data-error': variant === 'error' || undefined,
|
|
22
|
-
'data-success': variant === 'success' || undefined,
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<input
|
|
27
|
-
ref={ref}
|
|
28
|
-
data-fs-input
|
|
29
|
-
data-testid={testId}
|
|
30
|
-
{...variants}
|
|
31
|
-
{...otherProps}
|
|
32
|
-
/>
|
|
33
|
-
)
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
export default Input
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'
|
|
2
|
-
import Input from '../Input'
|
|
3
|
-
|
|
4
|
-
# Input
|
|
5
|
-
|
|
6
|
-
<Canvas>
|
|
7
|
-
<Story id="atoms-input--input" />
|
|
8
|
-
</Canvas>
|
|
9
|
-
|
|
10
|
-
## Props
|
|
11
|
-
|
|
12
|
-
<ArgsTable of={Input} />
|
|
13
|
-
|
|
14
|
-
## CSS Selectors
|
|
15
|
-
|
|
16
|
-
```css
|
|
17
|
-
[data-fs-input] {}
|
|
18
|
-
|
|
19
|
-
[data-success] {}
|
|
20
|
-
|
|
21
|
-
[data-error] {}
|
|
22
|
-
```
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Story } from '@storybook/react'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
import type { ComponentArgTypes } from '../../../../typings/utils'
|
|
5
|
-
import type { InputProps } from '../Input'
|
|
6
|
-
import Component from '../Input'
|
|
7
|
-
import mdx from './Input.mdx'
|
|
8
|
-
|
|
9
|
-
const InputTemplate: Story<InputProps> = ({ placeholder, variant }) => (
|
|
10
|
-
<Component placeholder={placeholder} variant={variant} />
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
export const Input = InputTemplate.bind({})
|
|
14
|
-
|
|
15
|
-
const argTypes: ComponentArgTypes<InputProps> = {
|
|
16
|
-
variant: {
|
|
17
|
-
options: ['default', 'success', 'error'],
|
|
18
|
-
defaultValue: 'default',
|
|
19
|
-
control: { type: 'select' },
|
|
20
|
-
},
|
|
21
|
-
placeholder: {
|
|
22
|
-
control: { type: 'text' },
|
|
23
|
-
defaultValue: 'Input',
|
|
24
|
-
},
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default {
|
|
28
|
-
title: 'Atoms/Input',
|
|
29
|
-
argTypes,
|
|
30
|
-
parameters: {
|
|
31
|
-
docs: {
|
|
32
|
-
page: mdx,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'react'
|
|
2
|
-
import React, { forwardRef } from 'react'
|
|
3
|
-
|
|
4
|
-
export interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
/**
|
|
6
|
-
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
7
|
-
*/
|
|
8
|
-
testId?: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const Overlay = forwardRef<HTMLDivElement, Props>(function Overlay(
|
|
12
|
-
{ testId = 'store-overlay', ...otherProps },
|
|
13
|
-
ref
|
|
14
|
-
) {
|
|
15
|
-
return (
|
|
16
|
-
<div
|
|
17
|
-
role="presentation"
|
|
18
|
-
data-fs-overlay
|
|
19
|
-
data-testid={testId}
|
|
20
|
-
ref={ref}
|
|
21
|
-
{...otherProps}
|
|
22
|
-
/>
|
|
23
|
-
)
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
export default Overlay
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'
|
|
2
|
-
import Overlay from '../Overlay'
|
|
3
|
-
|
|
4
|
-
# Overlay
|
|
5
|
-
|
|
6
|
-
<Canvas>
|
|
7
|
-
<Story id="atoms-overlay" />
|
|
8
|
-
</Canvas>
|
|
9
|
-
|
|
10
|
-
## Props
|
|
11
|
-
|
|
12
|
-
<ArgsTable of={Overlay} />
|
|
13
|
-
|
|
14
|
-
## CSS Selectors
|
|
15
|
-
|
|
16
|
-
```css
|
|
17
|
-
[data-fs-overlay] {}
|
|
18
|
-
```
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { Story, Meta } from '@storybook/react'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
import type { ComponentArgTypes } from '../../../../typings/utils'
|
|
5
|
-
import type { Props as OverlayProps } from '../Overlay'
|
|
6
|
-
import Component from '../Overlay'
|
|
7
|
-
import mdx from './Overlay.mdx'
|
|
8
|
-
|
|
9
|
-
type ColorType = 'black' | 'green'
|
|
10
|
-
type OverlayStoryProps = OverlayProps & { color: ColorType }
|
|
11
|
-
|
|
12
|
-
const OverlayTemplate: Story<OverlayStoryProps> = ({
|
|
13
|
-
color = 'black',
|
|
14
|
-
...otherProps
|
|
15
|
-
}) => {
|
|
16
|
-
const dataColor =
|
|
17
|
-
color === 'black' ? { 'data-black': true } : { 'data-green': true }
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<div data-story-overlay-out-container>
|
|
21
|
-
A content outside me
|
|
22
|
-
<Component {...otherProps} {...dataColor} />
|
|
23
|
-
</div>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const Overlay = OverlayTemplate.bind({})
|
|
28
|
-
|
|
29
|
-
const controls: ComponentArgTypes<OverlayStoryProps> = {
|
|
30
|
-
color: {
|
|
31
|
-
options: ['green', 'black'],
|
|
32
|
-
control: {
|
|
33
|
-
type: 'select',
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export default {
|
|
39
|
-
title: 'Atoms/Overlay',
|
|
40
|
-
argTypes: {
|
|
41
|
-
...controls,
|
|
42
|
-
},
|
|
43
|
-
parameters: {
|
|
44
|
-
docs: {
|
|
45
|
-
page: mdx,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
} as Meta
|