@moda/om 17.14.2 → 18.0.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 +12 -0
- package/dist/index.cjs.js +95 -135
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +95 -135
- package/dist/index.esm.js.map +1 -1
- package/dist/src/components/AspectRatioBox/AspectRatioBox.d.ts +1 -1
- package/dist/src/components/Badge/Badge.d.ts +2 -2
- package/dist/src/components/Breadcrumbs/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/src/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/src/components/Breakpoint/Breakpoint.d.ts +4 -4
- package/dist/src/components/Breakpoint/BreakpointProvider.d.ts +1 -1
- package/dist/src/components/Breakpoint/generateMediaQuery.d.ts +2 -2
- package/dist/src/components/Button/Button.d.ts +1 -1
- package/dist/src/components/Checkbox/Checkbox.d.ts +2 -2
- package/dist/src/components/Clickable/Clickable.d.ts +3 -3
- package/dist/src/components/ColorSwatch/ColorSwatch.d.ts +2 -2
- package/dist/src/components/ColorSwatch/skuColors.d.ts +1 -1
- package/dist/src/components/Constrain/Constrain.d.ts +1 -1
- package/dist/src/components/Constrain/ExceedConstrain.d.ts +1 -1
- package/dist/src/components/ControlLink/ControlLink.d.ts +1 -1
- package/dist/src/components/CreditCardNumberInput/CreditCardNumberInput.d.ts +1 -1
- package/dist/src/components/CreditCardNumberInput/CreditCardNumberInputField.d.ts +1 -1
- package/dist/src/components/DefinitionList/DefinitionList.d.ts +1 -1
- package/dist/src/components/Divider/Divider.d.ts +1 -1
- package/dist/src/components/Expandable/Expandable.d.ts +1 -1
- package/dist/src/components/Field/Field.d.ts +1 -1
- package/dist/src/components/Label/Label.d.ts +1 -1
- package/dist/src/components/Loading/Loading.d.ts +1 -1
- package/dist/src/components/Modal/Modal.d.ts +1 -1
- package/dist/src/components/ModalOverlay/ModalOverlay.d.ts +1 -1
- package/dist/src/components/Overlay/Overlay.d.ts +1 -1
- package/dist/src/components/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/src/components/Popover/Popover.d.ts +1 -1
- package/dist/src/components/PromoBanner/PromoBanner.d.ts +1 -1
- package/dist/src/components/RadioButton/RadioButton.d.ts +1 -1
- package/dist/src/components/SearchInput/SearchInput.d.ts +1 -2
- package/dist/src/components/Select/MultiSelect.d.ts +1 -1
- package/dist/src/components/Select/Select.d.ts +2 -2
- package/dist/src/components/Select/SelectLabel.d.ts +1 -1
- package/dist/src/components/Select/SelectOption.d.ts +1 -1
- package/dist/src/components/Select/SelectOptions.d.ts +1 -1
- package/dist/src/components/Select/useSelect.d.ts +1 -1
- package/dist/src/components/SelectableButton/SelectableButton.d.ts +1 -1
- package/dist/src/components/Shape/Shape.d.ts +1 -1
- package/dist/src/components/SlidingPane/SlidingPane.d.ts +1 -1
- package/dist/src/components/Stack/Stack.d.ts +1 -1
- package/dist/src/components/Tabs/Tab.d.ts +2 -2
- package/dist/src/components/Tabs/TabList.d.ts +1 -1
- package/dist/src/components/Tabs/TabPanel.d.ts +1 -1
- package/dist/src/components/Tabs/TabPanels.d.ts +1 -1
- package/dist/src/components/Tabs/Tabs.d.ts +1 -1
- package/dist/src/components/Tag/Tag.d.ts +1 -1
- package/dist/src/components/Text/Text.d.ts +4 -4
- package/dist/src/components/TextInput/TextInput.d.ts +2 -2
- package/dist/src/components/Textarea/Textarea.d.ts +1 -1
- package/dist/src/components/Toast/Toast.d.ts +1 -1
- package/dist/src/components/VerticalDivider/VerticalDivider.d.ts +1 -1
- package/dist/src/hooks/useBreakpoint.d.ts +3 -3
- package/dist/src/hooks/useKeyboardListNavigation.d.ts +3 -3
- package/dist/src/utilities/States/isRenderProps.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/SearchInput/SearchInput.stories.tsx +2 -6
- package/src/components/SearchInput/SearchInput.test.tsx +14 -0
- package/src/components/SearchInput/SearchInput.tsx +6 -13
|
@@ -3,7 +3,7 @@ import './AspectRatioBox.scss';
|
|
|
3
3
|
export declare const DEFAULT_PRODUCT_ASPECT_WIDTH = 128;
|
|
4
4
|
export declare const DEFAULT_PRODUCT_ASPECT_HEIGHT = 205;
|
|
5
5
|
export declare const DEFAULT_PRODUCT_ASPECT_RATIO: number;
|
|
6
|
-
export
|
|
6
|
+
export type AspectRatioBoxProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
7
7
|
aspectWidth?: number;
|
|
8
8
|
aspectHeight?: number;
|
|
9
9
|
maxWidth: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './Badge.scss';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type BadgeTheme = 'forest-green' | 'klein-blue' | 'brick' | 'dark-fuchsia' | 'noise';
|
|
4
|
+
export type BadgeProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
5
5
|
theme?: BadgeTheme;
|
|
6
6
|
};
|
|
7
7
|
export declare const Badge: React.FC<BadgeProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ControlLinkProps } from '../../ControlLink';
|
|
3
3
|
import './Breadcrumb.scss';
|
|
4
|
-
export
|
|
4
|
+
export type BreadcrumbProps = ControlLinkProps & {
|
|
5
5
|
position?: number;
|
|
6
6
|
to?: string;
|
|
7
7
|
href?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './Breadcrumbs.scss';
|
|
3
|
-
export
|
|
3
|
+
export type BreadcrumbsProps = React.OlHTMLAttributes<HTMLOListElement>;
|
|
4
4
|
export declare const Breadcrumbs: React.FC<BreadcrumbsProps>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
2
|
import './Breakpoint.scss';
|
|
3
|
-
|
|
3
|
+
type At = {
|
|
4
4
|
at: string;
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
type GreaterThan = {
|
|
7
7
|
gt: string;
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
type LessThan = {
|
|
10
10
|
lt: string;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type BreakpointProps = (At | GreaterThan | LessThan) & HTMLAttributes<HTMLDivElement>;
|
|
13
13
|
export declare const Breakpoint: React.FC<BreakpointProps>;
|
|
14
14
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { breakpoints } from '@moda/tokens';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type Mode = 'at' | 'gt' | 'lt';
|
|
3
|
+
export type Breakpoint = keyof typeof breakpoints;
|
|
4
4
|
export interface GenerateMediaQuery {
|
|
5
5
|
mode: Mode;
|
|
6
6
|
breakpoint: Breakpoint;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './Checkbox.scss';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type ShowCheckedUsing = 'checkmark' | 'circle';
|
|
4
|
+
export type CheckboxProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
5
5
|
children?: JSX.Element | string;
|
|
6
6
|
checkIcon?: ShowCheckedUsing;
|
|
7
7
|
dataTestId?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinkProps } from 'react-router-dom';
|
|
3
3
|
import './Clickable.scss';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
4
|
+
type ButtonElProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
5
|
+
type AnchorElProps = React.AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
6
|
+
export type ClickableProps = {
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
styleless?: boolean;
|
|
9
9
|
} & (ButtonElProps | AnchorElProps | LinkProps);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SkuColor } from './skuColors';
|
|
3
3
|
import './ColorSwatch.scss';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type ColorSwatchSize = 'default' | 'small';
|
|
5
|
+
export type ColorSwatchProps = Omit<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'>, 'onMouseEnter'> & {
|
|
6
6
|
size?: ColorSwatchSize;
|
|
7
7
|
color: SkuColor | string;
|
|
8
8
|
backgroundUrl?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './ExceedConstrain.scss';
|
|
3
|
-
export
|
|
3
|
+
export type ExceedConstrainProps = React.HTMLAttributes<HTMLDivElement>;
|
|
4
4
|
export declare const ExceedConstrain: React.FC<ExceedConstrainProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ClickableProps } from '../Clickable';
|
|
3
3
|
import './ControlLink.scss';
|
|
4
|
-
export
|
|
4
|
+
export type ControlLinkProps = ClickableProps & {
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
underlined?: boolean;
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Props as InputMaskProps } from 'react-input-mask';
|
|
3
3
|
import { FieldProps } from '../Field';
|
|
4
|
-
export
|
|
4
|
+
export type CreditCardNumberInputProps = Omit<InputMaskProps & FieldProps, 'mask' | 'value' | 'defaultValue'> & {
|
|
5
5
|
value?: string;
|
|
6
6
|
defaultValue?: string;
|
|
7
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FieldProps } from '../Field';
|
|
3
|
-
export
|
|
3
|
+
export type CreditCardNumberInputFieldProps = Omit<FieldProps, 'onChange'> & {
|
|
4
4
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
5
5
|
};
|
|
6
6
|
export declare const CreditCardNumberInputField: React.FC<CreditCardNumberInputFieldProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './DefinitionList.scss';
|
|
3
|
-
export
|
|
3
|
+
export type DefinitionListProps = React.HTMLAttributes<HTMLDListElement> & {
|
|
4
4
|
term: string;
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextTreatment, TextColor, TextFontFamily } from '../Text';
|
|
3
3
|
import './Divider.scss';
|
|
4
|
-
export
|
|
4
|
+
export type DividerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
5
5
|
text?: string;
|
|
6
6
|
treatment?: TextTreatment;
|
|
7
7
|
color?: TextColor;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import './Expandable.scss';
|
|
3
|
-
export
|
|
3
|
+
export type ExpandableProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
4
|
name: string | ReactNode;
|
|
5
5
|
defaultExpanded?: boolean;
|
|
6
6
|
expanded?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextInputProps } from '../TextInput';
|
|
3
3
|
import './Field.scss';
|
|
4
|
-
export
|
|
4
|
+
export type FieldProps = TextInputProps & {
|
|
5
5
|
children?: JSX.Element;
|
|
6
6
|
};
|
|
7
7
|
export declare const Field: React.ForwardRefExoticComponent<import("../TextInput").InputProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange"> & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './Label.scss';
|
|
3
|
-
export
|
|
3
|
+
export type LabelProps = React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
4
4
|
hidden?: boolean;
|
|
5
5
|
};
|
|
6
6
|
export declare const Label: React.FC<LabelProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ComponentProps } from 'react';
|
|
2
2
|
import { FocusOn } from 'react-focus-on';
|
|
3
3
|
import './Modal.scss';
|
|
4
|
-
export
|
|
4
|
+
export type ModalProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
5
5
|
onClose(): void;
|
|
6
6
|
shards?: ComponentProps<typeof FocusOn>['shards'];
|
|
7
7
|
autoFocus?: boolean;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { ModalProps } from '../Modal';
|
|
3
3
|
import { OverlayProps } from '../Overlay';
|
|
4
4
|
import './ModalOverlay.scss';
|
|
5
|
-
export
|
|
5
|
+
export type ModalOverlayProps = ModalProps & OverlayProps & {
|
|
6
6
|
overlayClassName?: string;
|
|
7
7
|
contentClassName?: string;
|
|
8
8
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './Overlay.scss';
|
|
3
3
|
export declare const UNMOUNT_DELAY_MS = 500;
|
|
4
|
-
export
|
|
4
|
+
export type OverlayProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
5
5
|
show?: boolean;
|
|
6
6
|
};
|
|
7
7
|
export declare const Overlay: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FieldProps } from '../Field';
|
|
3
3
|
import './PasswordInput.scss';
|
|
4
|
-
export
|
|
4
|
+
export type PasswordInputProps = FieldProps;
|
|
5
5
|
export declare const PasswordInput: React.ForwardRefExoticComponent<import("..").InputProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange"> & {
|
|
6
6
|
children?: JSX.Element | undefined;
|
|
7
7
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './Popover.scss';
|
|
3
|
-
export
|
|
3
|
+
export type PopoverProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
4
|
content: JSX.Element;
|
|
5
5
|
children: JSX.Element;
|
|
6
6
|
open?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './PromoBanner.scss';
|
|
3
|
-
export
|
|
3
|
+
export type PromoBannerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
4
|
children: JSX.Element | [JSX.Element, JSX.Element] | [JSX.Element, JSX.Element, JSX.Element];
|
|
5
5
|
};
|
|
6
6
|
export declare const PromoBanner: React.FC<PromoBannerProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './RadioButton.scss';
|
|
3
|
-
export
|
|
3
|
+
export type RadioButtonProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
4
4
|
children?: JSX.Element | string;
|
|
5
5
|
};
|
|
6
6
|
export declare const RadioButton: React.FC<RadioButtonProps>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextInputProps } from '../TextInput';
|
|
3
3
|
import './SearchInput.scss';
|
|
4
|
-
export
|
|
4
|
+
export type SearchInputProps = TextInputProps & {
|
|
5
5
|
value?: string;
|
|
6
6
|
onClear?(): void;
|
|
7
|
-
onChangeValue?(value: string): void;
|
|
8
7
|
};
|
|
9
8
|
export declare const SearchInput: React.FC<SearchInputProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SelectableOption } from '.';
|
|
3
3
|
import './MultiSelect.scss';
|
|
4
|
-
|
|
4
|
+
type Props = Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'value' | 'onChange'> & {
|
|
5
5
|
defaultValue?: string[] | undefined;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
dropDirection?: 'down' | 'up';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './Select.scss';
|
|
3
|
-
export
|
|
3
|
+
export type SelectableOption = {
|
|
4
4
|
value: string;
|
|
5
5
|
label: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type SelectProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'value' | 'onChange'> & {
|
|
9
9
|
allowAutoFill?: boolean;
|
|
10
10
|
autoSelect?: boolean;
|
|
11
11
|
defaultValue?: string | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SelectableOption } from './Select';
|
|
3
3
|
import './SelectOption.scss';
|
|
4
|
-
export
|
|
4
|
+
export type SelectOptionProps = Omit<React.HTMLAttributes<HTMLLIElement>, 'onClick'> & {
|
|
5
5
|
active: boolean;
|
|
6
6
|
selected: boolean;
|
|
7
7
|
option: SelectableOption;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SelectableOption } from './Select';
|
|
3
3
|
import './SelectOptions.scss';
|
|
4
|
-
export
|
|
4
|
+
export type SelectOptionsProps = Omit<React.HTMLAttributes<HTMLUListElement>, 'onSelect' | 'onFocus'> & {
|
|
5
5
|
idRef: string;
|
|
6
6
|
searchable?: boolean;
|
|
7
7
|
autoFocus?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ClickableProps } from '../Clickable';
|
|
3
3
|
import './SelectableButton.scss';
|
|
4
|
-
export
|
|
4
|
+
export type SelectableButtonProps = ClickableProps & {
|
|
5
5
|
hover?: boolean;
|
|
6
6
|
selected?: boolean;
|
|
7
7
|
unavailable?: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type ShapeProps = React.HTMLAttributes<HTMLOrSVGElement>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './SlidingPane.scss';
|
|
3
|
-
export
|
|
3
|
+
export type SlidingPaneProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
title: string;
|
|
6
6
|
visible: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './Stack.scss';
|
|
3
3
|
import * as CSS from 'csstype';
|
|
4
|
-
export
|
|
4
|
+
export type StackProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
5
5
|
space: number;
|
|
6
6
|
direction?: 'vertical' | 'horizontal';
|
|
7
7
|
alignItems?: CSS.Properties['alignItems'];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './Tab.scss';
|
|
3
|
-
export
|
|
3
|
+
export type Tab = {
|
|
4
4
|
name: string;
|
|
5
5
|
title: string;
|
|
6
6
|
panel: JSX.Element;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type TabProps = {
|
|
9
9
|
tab: Tab;
|
|
10
10
|
activeTab: string;
|
|
11
11
|
onTabChosen(tabName: string): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Tab } from '.';
|
|
3
3
|
import './Tabs.scss';
|
|
4
|
-
export
|
|
4
|
+
export type TabsProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
5
5
|
tabs: Tab[];
|
|
6
6
|
onTabClicked?: (tabName: string) => void;
|
|
7
7
|
activeTab?: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { typography, colors } from '@moda/tokens';
|
|
3
3
|
import './Text.scss';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
4
|
+
export type TextTreatment = keyof typeof typography['text-treatments'];
|
|
5
|
+
export type TextColor = keyof typeof colors.all;
|
|
6
|
+
export type TextFontFamily = keyof typeof typography.fonts;
|
|
7
|
+
export type TextProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
8
8
|
treatment?: TextTreatment;
|
|
9
9
|
color?: TextColor;
|
|
10
10
|
family?: TextFontFamily;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './TextInput.scss';
|
|
3
|
-
export
|
|
3
|
+
export type InputProps = {
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
error?: boolean | string;
|
|
6
6
|
focus?: boolean;
|
|
@@ -8,5 +8,5 @@ export declare type InputProps = {
|
|
|
8
8
|
onChange?: (value: string) => void;
|
|
9
9
|
onChangeEvent?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type TextInputProps = InputProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'>;
|
|
12
12
|
export declare const TextInput: React.ForwardRefExoticComponent<InputProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { InputProps } from '../TextInput';
|
|
3
3
|
import './Textarea.scss';
|
|
4
|
-
export
|
|
4
|
+
export type TextareaProps = InputProps & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange'>;
|
|
5
5
|
export declare const Textarea: React.ForwardRefExoticComponent<InputProps & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StackProps } from '../Stack';
|
|
3
3
|
import './Toast.scss';
|
|
4
|
-
export
|
|
4
|
+
export type ToastProps = {
|
|
5
5
|
theme: 'success' | 'warning' | 'error';
|
|
6
6
|
onRemove?: () => void;
|
|
7
7
|
} & Omit<StackProps, 'direction' | 'space'>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './VerticalDivider.scss';
|
|
3
|
-
export
|
|
3
|
+
export type VerticalDividerProps = {
|
|
4
4
|
double?: boolean;
|
|
5
5
|
} & React.HTMLAttributes<HTMLDivElement>;
|
|
6
6
|
export declare const VerticalDivider: React.FC<VerticalDividerProps>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Mode as ModeType, Breakpoint as BreakpointType } from '../components/Breakpoint/generateMediaQuery';
|
|
2
|
-
|
|
2
|
+
type At = {
|
|
3
3
|
at: string;
|
|
4
4
|
};
|
|
5
|
-
|
|
5
|
+
type GreaterThan = {
|
|
6
6
|
gt: string;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type LessThan = {
|
|
9
9
|
lt: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const discriminate: (props: At | GreaterThan | LessThan) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export
|
|
2
|
+
export type UseKeyboardListNavigationAction = {
|
|
3
3
|
type: 'RESET';
|
|
4
4
|
payload: {
|
|
5
5
|
defaultCursor: number;
|
|
@@ -20,12 +20,12 @@ export declare type UseKeyboardListNavigationAction = {
|
|
|
20
20
|
cursor: number;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export type UseKeyboardListNavigationState = {
|
|
24
24
|
cursor: number;
|
|
25
25
|
length: number;
|
|
26
26
|
interactive: boolean;
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type UseKeyboardListNavigationProps<T> = {
|
|
29
29
|
list: T[];
|
|
30
30
|
defaultSelected?: T;
|
|
31
31
|
waitForInteractive?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moda/om",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.0",
|
|
4
4
|
"description": "Moda Operandi design system",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"typescript": "^4.0.2",
|
|
142
142
|
"waait": "^1.0.5",
|
|
143
143
|
"webpack": "^5.72.1",
|
|
144
|
-
"webpack-cli": "^
|
|
144
|
+
"webpack-cli": "^5.0.0"
|
|
145
145
|
},
|
|
146
146
|
"config": {
|
|
147
147
|
"commitizen": {
|
|
@@ -8,11 +8,7 @@ export default { title: 'Components/SearchInput' };
|
|
|
8
8
|
|
|
9
9
|
export const Default = () => (
|
|
10
10
|
<States<SearchInputProps> states={[{}, { value: 'prada' }, { autoFocus: true }]}>
|
|
11
|
-
<SearchInput
|
|
12
|
-
placeholder='Search'
|
|
13
|
-
onChange={action('onChange')}
|
|
14
|
-
onChangeValue={action('onChangeValue')}
|
|
15
|
-
/>
|
|
11
|
+
<SearchInput placeholder='Search' onChange={action('onChange')} />
|
|
16
12
|
</States>
|
|
17
13
|
);
|
|
18
14
|
|
|
@@ -34,7 +30,7 @@ export const DropdownExample = () => {
|
|
|
34
30
|
|
|
35
31
|
return (
|
|
36
32
|
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
|
37
|
-
<SearchInput placeholder='Search'
|
|
33
|
+
<SearchInput placeholder='Search' onChange={setQuery} value={query} autoFocus />
|
|
38
34
|
|
|
39
35
|
{query && (
|
|
40
36
|
<Text style={{ border: '1px solid gray', marginTop: '-1px', padding: '1rem' }}>
|