@faststore/ui 2.0.5-alpha.0 → 2.0.7-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.
Files changed (42) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/components/molecules/QuantitySelector/QuantitySelector.d.ts +1 -2
  3. package/dist/components/molecules/QuantitySelector/QuantitySelector.js +1 -2
  4. package/dist/components/molecules/QuantitySelector/QuantitySelector.js.map +1 -1
  5. package/dist/components/molecules/SearchInput/SearchInput.js +1 -2
  6. package/dist/components/molecules/SearchInput/SearchInput.js.map +1 -1
  7. package/dist/index.d.ts +0 -2
  8. package/dist/index.js +0 -1
  9. package/dist/index.js.map +1 -1
  10. package/package.json +3 -3
  11. package/src/components/atoms/Input/Input.stories.mdx +34 -0
  12. package/src/components/atoms/Input/styles.scss +61 -0
  13. package/src/components/atoms/Popover/stories/Popover.stories.tsx +1 -1
  14. package/src/components/molecules/Alert/stories/Alert.stories.tsx +1 -1
  15. package/src/components/molecules/DiscountBadge/DiscountBadge.stories.mdx +38 -0
  16. package/src/components/molecules/DiscountBadge/styles.scss +57 -0
  17. package/src/components/molecules/IconButton/IconButton.stories.mdx +1 -1
  18. package/src/components/molecules/InputField/InputField.stories.mdx +116 -0
  19. package/src/components/molecules/InputField/styles.scss +139 -0
  20. package/src/components/molecules/QuantitySelector/QuantitySelector.tsx +2 -4
  21. package/src/components/molecules/SearchInput/SearchInput.tsx +1 -2
  22. package/src/components/organisms/OutOfStock/stories/OutOfStock.stories.tsx +1 -2
  23. package/src/index.ts +0 -3
  24. package/src/styles/components.scss +3 -0
  25. package/dist/assets/ShoppingCart.d.ts +0 -3
  26. package/dist/assets/ShoppingCart.js +0 -10
  27. package/dist/assets/ShoppingCart.js.map +0 -1
  28. package/dist/assets/X.d.ts +0 -3
  29. package/dist/assets/X.js +0 -8
  30. package/dist/assets/X.js.map +0 -1
  31. package/dist/components/atoms/Input/Input.d.ts +0 -14
  32. package/dist/components/atoms/Input/Input.js +0 -10
  33. package/dist/components/atoms/Input/Input.js.map +0 -1
  34. package/dist/components/atoms/Input/index.d.ts +0 -2
  35. package/dist/components/atoms/Input/index.js +0 -2
  36. package/dist/components/atoms/Input/index.js.map +0 -1
  37. package/src/assets/ShoppingCart.tsx +0 -50
  38. package/src/assets/X.tsx +0 -38
  39. package/src/components/atoms/Input/Input.tsx +0 -36
  40. package/src/components/atoms/Input/index.ts +0 -2
  41. package/src/components/atoms/Input/stories/Input.mdx +0 -22
  42. package/src/components/atoms/Input/stories/Input.stories.tsx +0 -35
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.7-alpha.0](https://github.com/vtex/faststore/compare/v2.0.6-alpha.0...v2.0.7-alpha.0) (2022-12-09)
7
+
8
+
9
+ ### Features
10
+
11
+ * Adds `DiscountBadge` component ([#1546](https://github.com/vtex/faststore/issues/1546)) ([9b2e279](https://github.com/vtex/faststore/commit/9b2e27940ffa9b52c9a62541a07e1f593a0bcfb7)), closes [#313](https://github.com/vtex/faststore/issues/313)
12
+
13
+
14
+
15
+ ## [2.0.6-alpha.0](https://github.com/vtex/faststore/compare/v2.0.5-alpha.0...v2.0.6-alpha.0) (2022-12-08)
16
+
17
+
18
+ ### Features
19
+
20
+ * Adds `Input` & `InputField` components ([#1545](https://github.com/vtex/faststore/issues/1545)) ([f89ec49](https://github.com/vtex/faststore/commit/f89ec4930dbcc7179f0fac484e16b0981540b6df))
21
+
22
+
23
+
6
24
  ## [2.0.5-alpha.0](https://github.com/vtex/faststore/compare/v2.0.4-alpha.0...v2.0.5-alpha.0) (2022-12-07)
7
25
 
8
26
 
@@ -1,7 +1,6 @@
1
1
  import type { InputHTMLAttributes } from 'react';
2
2
  import React from 'react';
3
- import type { InputProps } from '../../atoms/Input';
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 '../../atoms/Input';
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,KAAK,MAAM,mBAAmB,CAAA;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAgC3C,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
+ {"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" }),
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ACH,CAAC,CACF,CAAA;AAED,eAAe,WAAW,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,6 @@
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';
package/dist/index.js CHANGED
@@ -1,7 +1,6 @@
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';
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,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAG3D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAG/D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAG3D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAGjE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAG7D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAG7D,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAGzD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6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O,EACL,OAAO,IAAI,UAAU,EACrB,eAAe,EACf,iBAAiB,GAClB,MAAM,mCAAmC,CAAA;AAO1C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAA;AAG1D,OAAO,EACL,OAAO,IAAI,IAAI,EACf,WAAW,EACX,SAAS,GACV,MAAM,6BAA6B,CAAA;AAOpC,QAAQ;AACR,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/ui",
3
- "version": "2.0.5-alpha.0",
3
+ "version": "2.0.7-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.5-alpha.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": "7ac374bab91528184e27381e7dc3be8bf5524e76"
81
+ "gitHead": "f740d9f405309548f33c81d061131de9905c95bf"
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
+ }
@@ -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 '../../Input'
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 '../../../../assets'
6
+ import { ShoppingCart } from '@faststore/components/src/assets'
7
7
  import mdx from './Alert.mdx'
8
8
  import { Icon } from '../../../../'
9
9
 
@@ -0,0 +1,38 @@
1
+ import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
2
+
3
+ import { DiscountBadge } from '@faststore/components'
4
+
5
+ <Meta title="Molecules/DiscountBadge" component={DiscountBadge} argTypes={{}} />
6
+
7
+ export const Template = (args) => (
8
+ <DiscountBadge id="discount-badge-id" listPrice={65} spotPrice={40} />
9
+ )
10
+
11
+ <header>
12
+
13
+ # DiscountBadge
14
+
15
+ A custom `Badge` that display product's discounts.
16
+
17
+ </header>
18
+
19
+ ## Usage
20
+
21
+ ```jsx
22
+ import { DiscountBadge } from '@faststore/ui'
23
+ // Styles
24
+ import '@faststore/ui/src/components/molecules/DiscountBadge/styles.scss'
25
+ ```
26
+
27
+ <Canvas>
28
+ <Story
29
+ name="default"
30
+ args={{
31
+ id: 'discount-badge-default',
32
+ }}
33
+ >
34
+ {Template.bind({})}
35
+ </Story>
36
+ </Canvas>
37
+
38
+ <ArgsTable story="default" />
@@ -0,0 +1,57 @@
1
+ [data-fs-discount-badge] {
2
+ // --------------------------------------------------------
3
+ // Design Tokens for Discount Badge
4
+ // --------------------------------------------------------
5
+
6
+ // Low
7
+ --fs-discount-badge-low-bkg-color : var(--fs-badge-success-bkg-color);
8
+ --fs-discount-badge-low-text-color : var(--fs-badge-success-text-color);
9
+ --fs-discount-badge-low-border-color : var(--fs-badge-success-border-color);
10
+
11
+ // Medium
12
+ --fs-discount-badge-medium-bkg-color : var(--fs-badge-warning-bkg-color);
13
+ --fs-discount-badge-medium-text-color : var(--fs-badge-warning-text-color);
14
+ --fs-discount-badge-medium-border-color : var(--fs-badge-warning-border-color);
15
+
16
+ // High
17
+ --fs-discount-badge-high-bkg-color : var(--fs-badge-danger-bkg-color);
18
+ --fs-discount-badge-high-text-color : var(--fs-badge-danger-text-color);
19
+ --fs-discount-badge-high-border-color : var(--fs-badge-danger-border-color);
20
+
21
+ // --------------------------------------------------------
22
+ // Variants Styles
23
+ // --------------------------------------------------------
24
+
25
+ &[data-fs-discount-badge-variant="low"] {
26
+ color: var(--fs-discount-badge-low-text-color);
27
+
28
+ [data-fs-badge-wrapper] {
29
+ background-color: var(--fs-discount-badge-low-bkg-color);
30
+ border-color: var(--fs-discount-badge-low-border-color);
31
+
32
+ &::after {
33
+ background-color: var(--fs-discount-badge-low-bkg-color);
34
+ }
35
+ }
36
+ }
37
+
38
+ &[data-fs-discount-badge-variant="medium"] {
39
+ color: var(--fs-discount-badge-medium-text-color);
40
+
41
+ [data-fs-badge-wrapper] {
42
+ background-color: var(--fs-discount-badge-medium-bkg-color);
43
+ border-color: var(--fs-discount-badge-medium-border-color);
44
+ &::after { background-color: var(--fs-discount-badge-medium-bkg-color); }
45
+ }
46
+ }
47
+
48
+ &[data-fs-discount-badge-variant="high"] {
49
+ color: var(--fs-discount-badge-high-text-color);
50
+
51
+ [data-fs-badge-wrapper] {
52
+ background-color: var(--fs-discount-badge-high-bkg-color);
53
+ border-color: var(--fs-discount-badge-high-border-color);
54
+ &::after { background-color: var(--fs-discount-badge-high-bkg-color); }
55
+ }
56
+ }
57
+ }
@@ -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 '../../../assets'
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
+ }
@@ -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 '../../atoms/Input'
5
- import Input from '../../atoms/Input'
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
 
@@ -2,10 +2,13 @@
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";
5
6
  @import "../components/atoms/Overlay/styles";
6
7
  @import "../components/atoms/Radio/styles";
7
8
 
8
9
  // Molecules
9
10
  @import "../components/molecules/CheckboxField/styles";
11
+ @import "../components/molecules/DiscountBadge/styles";
12
+ @import "../components/molecules/InputField/styles";
10
13
  @import "../components/molecules/RadioField/styles";
11
14
  @import "../components/molecules/Tag/styles";
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- declare const ShoppingCart: () => JSX.Element;
3
- export default ShoppingCart;
@@ -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"}
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- declare const X: () => JSX.Element;
3
- export default X;
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
@@ -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,2 +0,0 @@
1
- export { default } from './Input';
2
- export type { InputProps } from './Input';
@@ -1,2 +0,0 @@
1
- export { default } from './Input';
2
- //# sourceMappingURL=index.js.map
@@ -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,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,2 +0,0 @@
1
- export { default } from './Input'
2
- export type { InputProps } from './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
- }