@aveonline/ui-react 1.0.0 → 1.0.2
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/README.md +13 -16
- package/dist/components/atoms/Avatar/Avatar.d.ts +7 -0
- package/dist/components/atoms/Avatar/IAvatar.d.ts +3 -0
- package/dist/components/atoms/Badge/Badge.d.ts +7 -0
- package/dist/components/atoms/Badge/IBadge.d.ts +6 -0
- package/dist/components/atoms/Button/Button.d.ts +7 -0
- package/dist/components/atoms/Button/IButton.d.ts +27 -0
- package/dist/components/atoms/Button/IsLoading.d.ts +3 -0
- package/dist/components/atoms/Heading/Heading.d.ts +8 -0
- package/dist/components/atoms/Heading/IHeading.d.ts +6 -0
- package/dist/components/atoms/Icon/IIcon.d.ts +18 -0
- package/dist/components/atoms/Icon/Icon.d.ts +2 -0
- package/dist/components/atoms/Icon/Svg.d.ts +3 -0
- package/dist/components/atoms/RadioButton/IRadioButton.d.ts +24 -0
- package/dist/components/atoms/RadioButton/RadioButton.d.ts +7 -0
- package/dist/components/atoms/Switch/ISwitch.d.ts +12 -0
- package/dist/components/atoms/Switch/Switch.d.ts +7 -0
- package/dist/components/atoms/Text/IText.d.ts +6 -0
- package/dist/components/atoms/Text/Text.d.ts +8 -0
- package/dist/components/atoms/Tooltip/Tooltip.d.ts +7 -0
- package/dist/components/atoms/Tooltip/TooltipAnchor.d.ts +8 -0
- package/dist/components/atoms/Tooltip/TooltipFloat.d.ts +8 -0
- package/dist/components/atoms/Tracker/Tracker.d.ts +7 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/molecules/Card/Select/ISelect.d.ts +9 -0
- package/dist/components/molecules/Card/Select/Select.d.ts +7 -0
- package/dist/components/molecules/Dropdown/Dropdown.d.ts +8 -0
- package/dist/components/molecules/EmptyState/BoxSvg.d.ts +1 -0
- package/dist/components/molecules/EmptyState/EmptyState.d.ts +7 -0
- package/dist/components/molecules/EmptyState/PadlockSvg.d.ts +1 -0
- package/dist/components/molecules/Field/Container.d.ts +15 -0
- package/dist/components/molecules/Field/Field.d.ts +7 -0
- package/dist/components/molecules/Field/Footer.d.ts +2 -0
- package/dist/components/molecules/Field/IField.d.ts +66 -0
- package/dist/components/molecules/Field/index.d.ts +1 -0
- package/dist/components/molecules/Field/useField.d.ts +16 -0
- package/dist/components/molecules/Header/Header.d.ts +7 -0
- package/dist/components/molecules/InlineError/IInlineError.d.ts +9 -0
- package/dist/components/molecules/InlineError/InlineError.d.ts +7 -0
- package/dist/components/molecules/Modal/IModal.d.ts +24 -0
- package/dist/components/molecules/Modal/Modal.d.ts +7 -0
- package/dist/components/molecules/Selectable/AsyncSelect/AsyncSelect.d.ts +7 -0
- package/dist/components/molecules/Selectable/AsyncSelect/IAsyncSelect.d.ts +3 -0
- package/dist/components/molecules/Selectable/Select/ISelect.d.ts +36 -0
- package/dist/components/molecules/Selectable/Select/Select.d.ts +7 -0
- package/dist/components/molecules/Selectable/SelectButton/ISelectButton.d.ts +9 -0
- package/dist/components/molecules/Selectable/SelectButton/Option.d.ts +4 -0
- package/dist/components/molecules/Selectable/SelectButton/SelectButton.d.ts +7 -0
- package/dist/components/molecules/Selectable/SelectCountry/Option.d.ts +2 -0
- package/dist/components/molecules/Selectable/SelectCountry/Prefix.d.ts +3 -0
- package/dist/components/molecules/Selectable/SelectCountry/SelectCountry.d.ts +7 -0
- package/dist/components/molecules/Selectable/SelectCountry/SingleValue.d.ts +3 -0
- package/dist/components/molecules/Selectable/atoms/ClearIndicator.d.ts +2 -0
- package/dist/components/molecules/Selectable/atoms/Container.d.ts +7 -0
- package/dist/components/molecules/Selectable/atoms/DropdownIndicator.d.ts +2 -0
- package/dist/components/molecules/Selectable/atoms/Option.d.ts +2 -0
- package/dist/components/molecules/Selectable/atoms/Placeholder.d.ts +2 -0
- package/dist/components/molecules/Selectable/atoms/SingleValue.d.ts +3 -0
- package/dist/components/molecules/Summary/Summary.d.ts +16 -0
- package/dist/components/molecules/Tab/ITab.d.ts +6 -0
- package/dist/components/molecules/Tab/Tab.d.ts +7 -0
- package/dist/components/molecules/TabNav/TabNav.d.ts +6 -0
- package/dist/components/organisms/Navigation/Navigation.d.ts +6 -0
- package/dist/components/templates/Main/Main.d.ts +11 -0
- package/dist/components/templates/Main/index.d.ts +1 -1
- package/dist/components/templates/Shipment/Shipment.d.ts +13 -0
- package/dist/components/templates/Shipment/index.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/tailwind.css +1 -1
- package/dist/types/Template.d.ts +3 -0
- package/dist/types/Tokens.d.ts +24 -0
- package/dist/ui-react.mjs +3286 -2870
- package/dist/ui-react.umd.js +23 -23
- package/package.json +10 -6
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
For usage with tailwind config, install:
|
|
11
11
|
|
|
12
12
|
```shell
|
|
13
|
-
npm i
|
|
13
|
+
npm i @tailwindcss/forms
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Getting started
|
|
@@ -32,24 +32,21 @@ import { Button } from '@aveonline/ui-react'
|
|
|
32
32
|
`tailwind.config.js`
|
|
33
33
|
|
|
34
34
|
```ts
|
|
35
|
-
|
|
36
|
-
const config = { ...tailwindConfig }
|
|
37
|
-
module.exports = config
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
or
|
|
35
|
+
/** @type {import('tailwindcss').Config} */
|
|
41
36
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
const tailwindConfig = require('@aveonline/ui-react/tailwind.config.js')
|
|
38
|
+
const { content, ...all } = tailwindConfig
|
|
39
|
+
|
|
40
|
+
const config = {
|
|
41
|
+
content: [
|
|
42
|
+
...content,
|
|
43
|
+
'./pages/**/*.{ts,tsx}',
|
|
44
|
+
'./components/**/*.{ts,tsx}',
|
|
45
|
+
'./node_modules/@aveonline/ui-react/dist/*.{mjs,js}'
|
|
46
|
+
],
|
|
47
|
+
...all
|
|
45
48
|
}
|
|
46
|
-
```
|
|
47
49
|
|
|
48
|
-
`postcss.config.js`
|
|
49
|
-
|
|
50
|
-
```ts
|
|
51
|
-
const postcssConfig = require('@aveonline/ui-react/postcss.config.js')
|
|
52
|
-
const config = { ...postcssConfig }
|
|
53
50
|
module.exports = config
|
|
54
51
|
```
|
|
55
52
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IButton } from './IButton';
|
|
2
|
+
/**
|
|
3
|
+
* Atoms: Button
|
|
4
|
+
* Buttons are used primarily for actions, such as 'Add', 'Close', 'Cancel', or 'Save'. Plain buttons, which look similar to links, are used for less important or less commonly used actions, such as 'view shipping settings'.
|
|
5
|
+
*/
|
|
6
|
+
declare function Button({ variant, size, fullWidth, isLoading, isDisabled, align, onlyOneIcon, children, ...allProps }: IButton): JSX.Element;
|
|
7
|
+
export default Button;
|
|
@@ -3,14 +3,41 @@ export declare type Variant = 'primary' | 'basic' | 'destructive' | 'plain' | 'p
|
|
|
3
3
|
declare type Size = 'md' | 'sm';
|
|
4
4
|
export declare type Align = 'start' | 'center' | 'end';
|
|
5
5
|
interface IButton {
|
|
6
|
+
/**
|
|
7
|
+
* Is this the principal call to action on the page?
|
|
8
|
+
*/
|
|
6
9
|
variant?: Variant;
|
|
10
|
+
/**
|
|
11
|
+
* Button contents how label or label + icons
|
|
12
|
+
*/
|
|
7
13
|
children?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Adjust size
|
|
16
|
+
*/
|
|
8
17
|
size?: Size;
|
|
18
|
+
/**
|
|
19
|
+
* How large should the button be?
|
|
20
|
+
*/
|
|
9
21
|
fullWidth?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* State load
|
|
24
|
+
*/
|
|
10
25
|
isLoading?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* State disabled
|
|
28
|
+
*/
|
|
11
29
|
isDisabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Position align children elements
|
|
32
|
+
*/
|
|
12
33
|
align?: Align;
|
|
34
|
+
/**
|
|
35
|
+
* When only have one icon, not children string
|
|
36
|
+
*/
|
|
13
37
|
onlyOneIcon?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Emit event handle click
|
|
40
|
+
*/
|
|
14
41
|
onClick?: MouseEventHandler<HTMLButtonElement | HTMLDivElement> | (() => void);
|
|
15
42
|
}
|
|
16
43
|
interface ILoading {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IHeading } from './IHeading';
|
|
2
|
+
/**
|
|
3
|
+
* Atoms: Heading
|
|
4
|
+
* You can select the semantic html tag you need. h1, h2, h3, h4, h5, h6.
|
|
5
|
+
* Default h2
|
|
6
|
+
*/
|
|
7
|
+
declare function Heading({ variant, children, lineHeight, weight, color, size, className, as: ElementHeading }: IHeading): JSX.Element;
|
|
8
|
+
export default Heading;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { IColorText, IWeight, ILineHeightHeading, IFontSizeHeading, IClassName, IChildren } from '../../../types';
|
|
2
2
|
export interface IHeading extends IChildren, IClassName, IWeight, ILineHeightHeading, IColorText, IFontSizeHeading {
|
|
3
|
+
/**
|
|
4
|
+
* Variant heading
|
|
5
|
+
*/
|
|
3
6
|
variant?: 'subheading' | 'heading' | 'sm' | 'md' | 'lg' | 'xl';
|
|
7
|
+
/**
|
|
8
|
+
* Tag html heading availables
|
|
9
|
+
*/
|
|
4
10
|
as?: Extract<keyof JSX.IntrinsicElements, 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'>;
|
|
5
11
|
}
|
|
@@ -2,11 +2,29 @@ export declare type ISize = 'sm' | 'md' | 'lg';
|
|
|
2
2
|
export declare type IColor = 'success' | 'warning' | 'disabled' | 'active' | 'hovered' | 'subdued' | 'default' | 'critical' | 'primary';
|
|
3
3
|
export declare type IKind = 'shipping' | 'home' | 'menu' | 'notifications' | 'novelty' | 'help' | 'see-more' | 'info' | 'alert' | 'eye' | 'date' | 'search' | 'delete' | 'more-less' | 'down' | 'up' | 'back' | 'front' | 'major-minor' | 'minor-major' | 'create' | 'success' | 'error' | 'more' | 'less' | undefined;
|
|
4
4
|
interface IconProps {
|
|
5
|
+
/**
|
|
6
|
+
* Sizes availables
|
|
7
|
+
*/
|
|
5
8
|
size?: ISize;
|
|
9
|
+
/**
|
|
10
|
+
* Color icons
|
|
11
|
+
*/
|
|
6
12
|
color?: IColor;
|
|
13
|
+
/**
|
|
14
|
+
* Name icon svg
|
|
15
|
+
*/
|
|
7
16
|
kind?: IKind;
|
|
17
|
+
/**
|
|
18
|
+
* Type cursor
|
|
19
|
+
*/
|
|
8
20
|
cursor?: 'pointer' | 'default';
|
|
21
|
+
/**
|
|
22
|
+
* Optional event click
|
|
23
|
+
*/
|
|
9
24
|
onClick?: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* More class optional container
|
|
27
|
+
*/
|
|
10
28
|
className?: string;
|
|
11
29
|
}
|
|
12
30
|
export type { IconProps };
|
|
@@ -3,13 +3,37 @@ declare type Change = {
|
|
|
3
3
|
checked: boolean;
|
|
4
4
|
};
|
|
5
5
|
declare type IPropsRadio = {
|
|
6
|
+
/**
|
|
7
|
+
* ID unique
|
|
8
|
+
*/
|
|
6
9
|
id?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Name unique
|
|
12
|
+
*/
|
|
7
13
|
name?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Control for disabled radio
|
|
16
|
+
*/
|
|
8
17
|
isDisabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Value radio
|
|
20
|
+
*/
|
|
9
21
|
value?: string | number;
|
|
22
|
+
/**
|
|
23
|
+
* Option for checked default
|
|
24
|
+
*/
|
|
10
25
|
defaultChecked?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Label string link with radio
|
|
28
|
+
*/
|
|
11
29
|
label?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Help text for more info
|
|
32
|
+
*/
|
|
12
33
|
helpText?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Event for control to checked and value
|
|
36
|
+
*/
|
|
13
37
|
onChange?: (value: Change) => void;
|
|
14
38
|
[rest: string]: any;
|
|
15
39
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IPropsRadio } from './IRadioButton';
|
|
2
|
+
/**
|
|
3
|
+
* Atom: RadioButton
|
|
4
|
+
* Use radio buttons to present each item in a list of options where merchants must make a single selection.
|
|
5
|
+
*/
|
|
6
|
+
declare function RadioButton({ id, name, isDisabled, value, label, helpText, onChange, ...rest }: IPropsRadio): JSX.Element;
|
|
7
|
+
export default RadioButton;
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
interface ISwitch {
|
|
2
|
+
/**
|
|
3
|
+
* Whether or not the switch is checked.
|
|
4
|
+
*/
|
|
2
5
|
isSelected: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Disabled switch.
|
|
8
|
+
*/
|
|
3
9
|
isDisabled?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The name used when using this component inside a form.
|
|
12
|
+
*/
|
|
4
13
|
name?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The function to call when the switch is toggled.
|
|
16
|
+
*/
|
|
5
17
|
onChange(checked: boolean): void;
|
|
6
18
|
}
|
|
7
19
|
export type { ISwitch };
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { IColorText, IWeight, ILineHeightText, IFontSizeText, IChildren, IClassName } from '../../../types';
|
|
2
2
|
export interface IText extends IColorText, IWeight, ILineHeightText, IFontSizeText, IChildren, IClassName {
|
|
3
|
+
/**
|
|
4
|
+
* Variant heading
|
|
5
|
+
*/
|
|
3
6
|
variant?: 'button' | 'body' | 'highlight' | 'caption';
|
|
7
|
+
/**
|
|
8
|
+
* Tag html availables
|
|
9
|
+
*/
|
|
4
10
|
as?: Extract<keyof JSX.IntrinsicElements, 'span' | 'p' | 'label'>;
|
|
5
11
|
[rest: string]: any;
|
|
6
12
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IText } from './IText';
|
|
2
|
+
/**
|
|
3
|
+
* Atoms: Text
|
|
4
|
+
* Paragraphs. Tags availables p, span.
|
|
5
|
+
* Default p
|
|
6
|
+
*/
|
|
7
|
+
declare function Text({ variant, children, lineHeight, weight, color, size, className, as: ElementText, ...rest }: IText): JSX.Element;
|
|
8
|
+
export default Text;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ITooltipProps } from './ITooltip';
|
|
2
|
+
/**
|
|
3
|
+
* Atom: Tooltip
|
|
4
|
+
* Tooltips are floating labels that briefly explain the function of a user interface element. They can be triggered when merchants hover.
|
|
5
|
+
*/
|
|
6
|
+
declare function Tooltip({ placement, title, description, initialOpen, children }: ITooltipProps): JSX.Element;
|
|
7
|
+
export default Tooltip;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TooltipState } from './ITooltip';
|
|
3
|
+
declare type PropsType = React.HTMLProps<HTMLElement> & {
|
|
4
|
+
state: TooltipState;
|
|
5
|
+
asChild?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const TooltipAnchor: React.ForwardRefExoticComponent<Pick<PropsType, "size" | "className" | "color" | "disabled" | "default" | "children" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "start" | "onClick" | "type" | "as" | "kind" | "id" | "name" | "value" | "defaultChecked" | "onChange" | "target" | "checked" | "hidden" | "htmlFor" | "role" | "tabIndex" | "aria-checked" | "aria-labelledby" | "aria-describedby" | "onKeyUp" | "onKeyPress" | "key" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPressCapture" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "list" | "open" | "state" | "asChild" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "useMap" | "width" | "wmode" | "wrap"> & React.RefAttributes<HTMLElement>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IChildren } from '../../../types';
|
|
3
|
+
import { TooltipState } from './ITooltip';
|
|
4
|
+
declare type PropsType = React.HTMLProps<HTMLDivElement> & {
|
|
5
|
+
state: TooltipState;
|
|
6
|
+
} & IChildren;
|
|
7
|
+
export declare const TooltipFloat: React.ForwardRefExoticComponent<Pick<PropsType, "size" | "className" | "color" | "disabled" | "default" | "children" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "start" | "onClick" | "type" | "as" | "kind" | "id" | "name" | "value" | "defaultChecked" | "onChange" | "target" | "checked" | "hidden" | "htmlFor" | "role" | "tabIndex" | "aria-checked" | "aria-labelledby" | "aria-describedby" | "onKeyUp" | "onKeyPress" | "key" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPressCapture" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "list" | "open" | "state" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "useMap" | "width" | "wmode" | "wrap"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IPropsTracker } from './ITracker';
|
|
2
|
+
/**
|
|
3
|
+
* Atom: Tracker
|
|
4
|
+
* Use in processes that have more than one step, so the user can know exactly how much is left.
|
|
5
|
+
*/
|
|
6
|
+
declare function Tracker({ track, isDisabled, isSelected, title, ...rest }: IPropsTracker): JSX.Element;
|
|
7
|
+
export default Tracker;
|
|
@@ -20,6 +20,7 @@ export * from './molecules/EmptyState';
|
|
|
20
20
|
export * from './molecules/TabNav';
|
|
21
21
|
export * from './molecules/Header';
|
|
22
22
|
export * from './molecules/Summary';
|
|
23
|
+
export * from './molecules/Field';
|
|
23
24
|
export * from './molecules/Card/Select';
|
|
24
25
|
export * from './organisms/Navigation';
|
|
25
26
|
export * from './templates/Main';
|
|
@@ -10,8 +10,17 @@ interface ICardSelect {
|
|
|
10
10
|
error?: string;
|
|
11
11
|
}
|
|
12
12
|
declare type IPropsCardSelect = {
|
|
13
|
+
/**
|
|
14
|
+
* Array items with content for card
|
|
15
|
+
*/
|
|
13
16
|
items: ICardSelect[];
|
|
17
|
+
/**
|
|
18
|
+
* Checked item
|
|
19
|
+
*/
|
|
14
20
|
checkedItem: ICardSelect | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Event handler for change selection
|
|
23
|
+
*/
|
|
15
24
|
onChange: (value: ICardSelect) => void;
|
|
16
25
|
};
|
|
17
26
|
export type { IPropsCardSelect, ICardSelect };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IPropsCardSelect } from './ISelect';
|
|
2
|
+
/**
|
|
3
|
+
* Molecule: CardSelect
|
|
4
|
+
* Use radio cards in items where users must make a single selection, and need of a visual element or more than one text to be explained.
|
|
5
|
+
*/
|
|
6
|
+
declare function CardSelect({ items, checkedItem, onChange }: IPropsCardSelect): JSX.Element;
|
|
7
|
+
export default CardSelect;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IPropsDropdown } from './IDropdown';
|
|
2
|
+
import { IClassName } from '@/types';
|
|
3
|
+
/**
|
|
4
|
+
* Molecule: Dropdown
|
|
5
|
+
* Page actions let merchants take key actions at the bottom of specific pages in the interface. This is important because sometimes the primary call to action is hard to access when merchants are at the bottom of a page, that’s why this component is fixed.
|
|
6
|
+
*/
|
|
7
|
+
declare function Dropdown({ title, subtitle, defaultOpen, isDisabled, content, className, children }: IPropsDropdown & IClassName): JSX.Element;
|
|
8
|
+
export default Dropdown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function BoxSvg(): JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IPropsEmptyState } from './IEmptyState';
|
|
2
|
+
/**
|
|
3
|
+
* Molecule: EmptyState
|
|
4
|
+
* Empty states are used when a list, table, or chart has no items or data to show. This is an opportunity to provide explanation or guidance to help merchants progress. The empty state component is intended for use when a full page in the admin is empty, and not for individual elements or areas in the interface.
|
|
5
|
+
*/
|
|
6
|
+
declare function EmptyState({ title, description, img, className, children }: IPropsEmptyState): JSX.Element;
|
|
7
|
+
export default EmptyState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PadlockSvg(): JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IChildren } from '../../../types';
|
|
2
|
+
export declare function Container({ children }: IChildren): JSX.Element;
|
|
3
|
+
export declare namespace Container {
|
|
4
|
+
var Icon: ({ children, position }: IChildren & {
|
|
5
|
+
position: "right" | "left";
|
|
6
|
+
}) => JSX.Element;
|
|
7
|
+
var Special: ({ children, isNumber, isPassword }: IChildren & {
|
|
8
|
+
isNumber?: boolean | undefined;
|
|
9
|
+
isPassword?: boolean | undefined;
|
|
10
|
+
}) => JSX.Element;
|
|
11
|
+
var Delete: ({ children, inputValue, hasIconRight }: IChildren & {
|
|
12
|
+
inputValue: string | number | undefined;
|
|
13
|
+
hasIconRight: boolean;
|
|
14
|
+
}) => JSX.Element;
|
|
15
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IField } from './IField';
|
|
2
|
+
/**
|
|
3
|
+
* Molecule: Field
|
|
4
|
+
* A text field is an input field that merchants can type into. It has a range of options and supports several text formats including numbers. The compound fields apply to all the types of field (text, number, password).
|
|
5
|
+
*/
|
|
6
|
+
declare function Field({ id, name, isDisabled, isReadOnly, placeholder, autoComplete, type, iconLeft, iconRight, helpText, logo, error, onChange, value, tooltip }: IField): JSX.Element;
|
|
7
|
+
export default Field;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { IKind } from '../../atoms/Icon';
|
|
2
|
+
import { ITooltipProps } from '../../atoms/Tooltip/ITooltip';
|
|
3
|
+
export interface IField {
|
|
4
|
+
/**
|
|
5
|
+
* ID available for link form
|
|
6
|
+
*/
|
|
7
|
+
id?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Name available for link form
|
|
10
|
+
*/
|
|
11
|
+
name?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Value for default
|
|
14
|
+
*/
|
|
15
|
+
value?: string | number;
|
|
16
|
+
/**
|
|
17
|
+
* For disabled input with attribute disabled
|
|
18
|
+
*/
|
|
19
|
+
isDisabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* For inactive input with attribute readonly
|
|
22
|
+
*/
|
|
23
|
+
isReadOnly?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Text for show description input
|
|
26
|
+
*/
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Attribute autocomplete for default 'nope' no show info
|
|
30
|
+
*/
|
|
31
|
+
autoComplete?: 'on' | 'off' | 'nope';
|
|
32
|
+
/**
|
|
33
|
+
* Message error
|
|
34
|
+
*/
|
|
35
|
+
error?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Name icon for position left
|
|
38
|
+
*/
|
|
39
|
+
iconLeft?: IKind;
|
|
40
|
+
/**
|
|
41
|
+
* Name icon for position right
|
|
42
|
+
*/
|
|
43
|
+
iconRight?: IKind;
|
|
44
|
+
/**
|
|
45
|
+
* Message for help to user
|
|
46
|
+
*/
|
|
47
|
+
helpText?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Custom logo
|
|
50
|
+
*/
|
|
51
|
+
logo?: 'google-maps' | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Types availables for input - text for default
|
|
54
|
+
*/
|
|
55
|
+
type?: 'text' | 'number' | 'password';
|
|
56
|
+
/**
|
|
57
|
+
* Event handler for emit value from input
|
|
58
|
+
*/
|
|
59
|
+
onChange?: (value: string | number) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Active tooltip for icon right
|
|
62
|
+
*/
|
|
63
|
+
tooltip?: ITooltipProps & {
|
|
64
|
+
isActive?: boolean;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Field } from './Field';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ChangeEvent } from 'react';
|
|
2
|
+
import { IField } from './IField';
|
|
3
|
+
export declare function useField({ isDisabled, type, iconRight, error, iconLeft, onChange, value }: IField): {
|
|
4
|
+
inputValue: string | number;
|
|
5
|
+
inputRef: import("react").RefObject<HTMLInputElement>;
|
|
6
|
+
handleChange: ({ target: { value } }: ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
subtractValue: () => void;
|
|
8
|
+
addMoreValue: () => void;
|
|
9
|
+
getColorIcon: () => 'disabled' | 'default' | 'subdued';
|
|
10
|
+
getColorIconPassword: () => 'disabled' | 'default' | 'subdued';
|
|
11
|
+
showPassword: boolean;
|
|
12
|
+
setShowPassword: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
13
|
+
clearInput: () => void;
|
|
14
|
+
hasIconRight: boolean;
|
|
15
|
+
getClassInput: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IHeader } from './IHeader';
|
|
2
|
+
/**
|
|
3
|
+
* Atom: Header
|
|
4
|
+
* The top bar is a header component that allows merchants to access menus, and navigate by clicking on the logo. It’s always visible at the top of interfaces.
|
|
5
|
+
*/
|
|
6
|
+
declare function Header({ hasLogo, className, ...rest }: IHeader): JSX.Element;
|
|
7
|
+
export default Header;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import type { IChildren, IClassName } from '../../../types';
|
|
2
2
|
import { IColor, IKind } from '../../atoms/Icon';
|
|
3
3
|
export interface IInlineError extends IChildren, IClassName {
|
|
4
|
+
/**
|
|
5
|
+
* Sizes availables
|
|
6
|
+
*/
|
|
4
7
|
size?: 'lg' | 'sm';
|
|
8
|
+
/**
|
|
9
|
+
* Icons availables
|
|
10
|
+
*/
|
|
5
11
|
icon?: IKind;
|
|
12
|
+
/**
|
|
13
|
+
* Colors icons
|
|
14
|
+
*/
|
|
6
15
|
colorIcon?: IColor;
|
|
7
16
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IInlineError } from './IInlineError';
|
|
2
|
+
/**
|
|
3
|
+
* Atom: InlineError
|
|
4
|
+
* Inline errors are brief, in-context messages that tell merchants something went wrong with a single or group of inputs in a form. Use inline errors to help merchants understand why a form input may not be valid and how to fix it.
|
|
5
|
+
*/
|
|
6
|
+
declare function InlineError({ children, size, icon, colorIcon, className, ...props }: IInlineError): JSX.Element;
|
|
7
|
+
export default InlineError;
|
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
import { IChildren } from '../../../types';
|
|
2
2
|
interface IPropsModal extends IChildren {
|
|
3
|
+
/**
|
|
4
|
+
* Crontol open and close modal
|
|
5
|
+
*/
|
|
3
6
|
isOpen?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Title main
|
|
9
|
+
*/
|
|
4
10
|
title?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Reference to icon with onclick on the header
|
|
13
|
+
*/
|
|
5
14
|
iconTitle?: JSX.Element;
|
|
15
|
+
/**
|
|
16
|
+
* Subtitle secondary
|
|
17
|
+
*/
|
|
6
18
|
subtitle?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Container for elements align to x end
|
|
21
|
+
*/
|
|
7
22
|
footer?: JSX.Element;
|
|
23
|
+
/**
|
|
24
|
+
* Control border for children
|
|
25
|
+
*/
|
|
8
26
|
hasBorder?: Array<'top' | 'bottom'>;
|
|
27
|
+
/**
|
|
28
|
+
* Show icon delete from header
|
|
29
|
+
*/
|
|
9
30
|
showClose?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Event for close modal
|
|
33
|
+
*/
|
|
10
34
|
onClose?: (value: boolean) => void;
|
|
11
35
|
}
|
|
12
36
|
export type { IPropsModal };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IPropsModal } from './IModal';
|
|
2
|
+
/**
|
|
3
|
+
* Molecule: Modal
|
|
4
|
+
* Modals are overlays that require merchants to take an action before they can continue interacting with the rest of Shopify. They can be disruptive and should be used thoughtfully and sparingly.
|
|
5
|
+
*/
|
|
6
|
+
declare function Modal({ title, iconTitle, subtitle, footer, isOpen, hasBorder, showClose, onClose, children }: IPropsModal): JSX.Element;
|
|
7
|
+
export default Modal;
|