glints-aries 4.0.140 → 4.0.144
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/es/Display/Slider/Slider.d.ts +4 -4
- package/es/Display/Swipeable/Swipeable.d.ts +1 -1
- package/es/Display/Swipeable/Swipeable.js +1 -1
- package/es/Display/Tooltip/Tooltip.d.ts +11 -6
- package/es/Display/Tooltip/Tooltip.js +5 -2
- package/es/Display/Tooltip/Tooltip.stories.d.ts +1 -0
- package/es/Display/Tooltip/Tooltip.stories.js +17 -3
- package/es/General/Divider/Divider.d.ts +1 -1
- package/es/General/Divider/Divider.js +1 -1
- package/es/General/Icon/components/StarCircleIcon.d.ts +4 -0
- package/es/General/Icon/components/StarCircleIcon.js +31 -0
- package/es/General/Icon/components/index.d.ts +1 -0
- package/es/General/Icon/components/index.js +1 -0
- package/es/General/Loading/Loading.d.ts +1 -1
- package/es/General/Loading/Loading.js +1 -1
- package/es/General/Tag/Tag.d.ts +2 -2
- package/es/Input/DownshiftSelect/Select.d.ts +1 -1
- package/es/Input/DownshiftSelect/Select.stories.js +18 -18
- package/es/Input/NumberInput/NumberInput.d.ts +4 -4
- package/es/Input/NumberInput/NumberInput.js +4 -4
- package/es/Input/PhoneNumberInput/PhoneNumberInput.d.ts +29 -0
- package/es/Input/PhoneNumberInput/PhoneNumberInput.js +153 -0
- package/es/Input/PhoneNumberInput/PhoneNumberInput.stories.d.ts +8 -0
- package/es/Input/PhoneNumberInput/PhoneNumberInput.stories.js +130 -0
- package/es/Input/PhoneNumberInput/PhoneNumberInput.test.d.ts +1 -0
- package/es/Input/PhoneNumberInput/PhoneNumberInputStyles.d.ts +25 -0
- package/es/Input/PhoneNumberInput/PhoneNumberInputStyles.js +90 -0
- package/es/Input/RadioButton/RadioButton.d.ts +2 -2
- package/es/Input/RadioButton/RadioButton.js +2 -2
- package/es/Input/TextField/TextField.d.ts +4 -4
- package/es/Input/TextField/TextField.js +4 -4
- package/es/Input/Textarea/Textarea.d.ts +5 -5
- package/es/Input/Textarea/Textarea.js +5 -5
- package/es/Input/ToggleSwitch/ToggleSwitch.d.ts +1 -1
- package/es/Input/ToggleSwitch/ToggleSwitch.js +1 -1
- package/es/Utils/Icon/IconLibrary.d.ts +1 -0
- package/es/Utils/Icon/IconLibrary.js +22 -0
- package/es/Utils/useOutsideAlerter.d.ts +5 -0
- package/es/Utils/useOutsideAlerter.js +19 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -0
- package/lib/Display/Slider/Slider.d.ts +4 -4
- package/lib/Display/Swipeable/Swipeable.d.ts +1 -1
- package/lib/Display/Swipeable/Swipeable.js +1 -1
- package/lib/Display/Tooltip/Tooltip.d.ts +11 -6
- package/lib/Display/Tooltip/Tooltip.js +5 -2
- package/lib/Display/Tooltip/Tooltip.stories.d.ts +1 -0
- package/lib/Display/Tooltip/Tooltip.stories.js +18 -4
- package/lib/General/Divider/Divider.d.ts +1 -1
- package/lib/General/Divider/Divider.js +1 -1
- package/lib/General/Icon/components/StarCircleIcon.d.ts +4 -0
- package/lib/General/Icon/components/StarCircleIcon.js +42 -0
- package/lib/General/Icon/components/index.d.ts +1 -0
- package/lib/General/Icon/components/index.js +5 -1
- package/lib/General/Loading/Loading.d.ts +1 -1
- package/lib/General/Loading/Loading.js +1 -1
- package/lib/General/Tag/Tag.d.ts +2 -2
- package/lib/Input/DownshiftSelect/Select.d.ts +1 -1
- package/lib/Input/DownshiftSelect/Select.stories.js +18 -18
- package/lib/Input/NumberInput/NumberInput.d.ts +4 -4
- package/lib/Input/NumberInput/NumberInput.js +4 -4
- package/lib/Input/PhoneNumberInput/PhoneNumberInput.d.ts +29 -0
- package/lib/Input/PhoneNumberInput/PhoneNumberInput.js +174 -0
- package/lib/Input/PhoneNumberInput/PhoneNumberInput.stories.d.ts +8 -0
- package/lib/Input/PhoneNumberInput/PhoneNumberInput.stories.js +150 -0
- package/lib/Input/PhoneNumberInput/PhoneNumberInput.test.d.ts +1 -0
- package/lib/Input/PhoneNumberInput/PhoneNumberInputStyles.d.ts +25 -0
- package/lib/Input/PhoneNumberInput/PhoneNumberInputStyles.js +151 -0
- package/lib/Input/RadioButton/RadioButton.d.ts +2 -2
- package/lib/Input/RadioButton/RadioButton.js +2 -2
- package/lib/Input/TextField/TextField.d.ts +4 -4
- package/lib/Input/TextField/TextField.js +4 -4
- package/lib/Input/Textarea/Textarea.d.ts +5 -5
- package/lib/Input/Textarea/Textarea.js +5 -5
- package/lib/Input/ToggleSwitch/ToggleSwitch.d.ts +1 -1
- package/lib/Input/ToggleSwitch/ToggleSwitch.js +1 -1
- package/lib/Utils/Icon/IconLibrary.d.ts +1 -0
- package/lib/Utils/Icon/IconLibrary.js +22 -0
- package/lib/Utils/useOutsideAlerter.d.ts +5 -0
- package/lib/Utils/useOutsideAlerter.js +26 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +12 -2
- package/package.json +1 -1
|
@@ -8,11 +8,11 @@ export interface Props {
|
|
|
8
8
|
className?: string;
|
|
9
9
|
/** The index of the page that will be shown initally (before the first manual- or auto-scroll). Note that the index starts at 1. */
|
|
10
10
|
initialItem?: number;
|
|
11
|
-
/** If
|
|
11
|
+
/** If true, the dot controls will be superimposed on the current page */
|
|
12
12
|
fullContent?: boolean;
|
|
13
|
-
/** If
|
|
13
|
+
/** If true, the arrow controls will have a white color */
|
|
14
14
|
arrowWhite?: boolean;
|
|
15
|
-
/** If
|
|
15
|
+
/** If true, dot controls will be removed */
|
|
16
16
|
removeDots?: boolean;
|
|
17
17
|
/** Sets the left icon. Receives the "disabled" flag as an argument. */
|
|
18
18
|
renderLeftIcon?: (disabled: boolean) => React.ReactElement;
|
|
@@ -20,7 +20,7 @@ export interface Props {
|
|
|
20
20
|
renderRightIcon?: (disabled: boolean) => React.ReactElement;
|
|
21
21
|
/** Called with the new index after a new Slider page has been shown */
|
|
22
22
|
afterChange?: Function;
|
|
23
|
-
/** If
|
|
23
|
+
/** If true, the Slider will flip through its pages at a regular interval */
|
|
24
24
|
autoplay?: boolean;
|
|
25
25
|
containerRef?: React.RefObject<HTMLDivElement>;
|
|
26
26
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import SwipeableItem from './SwipeableItem';
|
|
3
|
-
/** You can add any number of
|
|
3
|
+
/** You can add any number of <Swipeable.Item /> components as children of the Swipeable component, controlling the behavior of an individual swipeable item. */
|
|
4
4
|
export declare const Swipeable: Swipeable;
|
|
5
5
|
declare type Swipeable = React.FunctionComponent<Props> & {
|
|
6
6
|
Item: typeof SwipeableItem;
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { SwipeableContainer } from './SwipeableStyle';
|
|
4
4
|
import SwipeableItem from './SwipeableItem';
|
|
5
|
-
/** You can add any number of
|
|
5
|
+
/** You can add any number of <Swipeable.Item /> components as children of the Swipeable component, controlling the behavior of an individual swipeable item. */
|
|
6
6
|
|
|
7
7
|
export var Swipeable = function Swipeable(_ref) {
|
|
8
8
|
var children = _ref.children,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLAttributes, FC } from 'react';
|
|
1
|
+
import React, { HTMLAttributes, FC } from 'react';
|
|
2
2
|
export declare const Tooltip: FC<Props>;
|
|
3
3
|
export interface Classes {
|
|
4
4
|
container?: string;
|
|
@@ -6,12 +6,17 @@ export interface Classes {
|
|
|
6
6
|
message?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare type Position = 'top' | 'right' | 'bottom' | 'left';
|
|
9
|
-
|
|
10
|
-
/** This is an object with three keys: <code>container</code>,
|
|
11
|
-
* <code>content</code> and <code>message</code>. Use them to attach
|
|
12
|
-
* additional classes to the respective elements. */
|
|
9
|
+
interface BaseProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
13
10
|
classes?: Classes;
|
|
14
|
-
text: string;
|
|
15
11
|
position?: Position;
|
|
16
12
|
}
|
|
13
|
+
export interface StringTooltip extends BaseProps {
|
|
14
|
+
text: string;
|
|
15
|
+
textAsString?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface HtmlTooltip extends BaseProps {
|
|
18
|
+
text: React.ReactNode;
|
|
19
|
+
textAsString: string;
|
|
20
|
+
}
|
|
21
|
+
export declare type Props = StringTooltip | HtmlTooltip;
|
|
17
22
|
export default Tooltip;
|
|
@@ -8,9 +8,10 @@ export var Tooltip = function Tooltip(_ref) {
|
|
|
8
8
|
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
|
9
9
|
children = _ref.children,
|
|
10
10
|
text = _ref.text,
|
|
11
|
+
textAsString = _ref.textAsString,
|
|
11
12
|
_ref$position = _ref.position,
|
|
12
13
|
position = _ref$position === void 0 ? 'top' : _ref$position,
|
|
13
|
-
defaultProps = _objectWithoutPropertiesLoose(_ref, ["classes", "children", "text", "position"]);
|
|
14
|
+
defaultProps = _objectWithoutPropertiesLoose(_ref, ["classes", "children", "text", "textAsString", "position"]);
|
|
14
15
|
|
|
15
16
|
var contentRef = useRef(null);
|
|
16
17
|
|
|
@@ -42,11 +43,12 @@ export var Tooltip = function Tooltip(_ref) {
|
|
|
42
43
|
}
|
|
43
44
|
};
|
|
44
45
|
|
|
46
|
+
var arialLabel = typeof text === 'string' ? text : textAsString;
|
|
45
47
|
return /*#__PURE__*/React.createElement(TooltipContainer, _extends({
|
|
46
48
|
className: classNames('aries-tooltip', classes.container),
|
|
47
49
|
role: "tooltip",
|
|
48
50
|
"aria-hidden": isShow ? 'false' : 'true',
|
|
49
|
-
"aria-label":
|
|
51
|
+
"aria-label": arialLabel // The tooltip does not close on iOS devices because of this issue https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event#Safari_Mobile
|
|
50
52
|
// Adding onTouchStart and onTouchEnd as a workaround
|
|
51
53
|
// On mobile, it shows the tooltip on touch and hides the tooltip when the touch is released
|
|
52
54
|
,
|
|
@@ -57,6 +59,7 @@ export var Tooltip = function Tooltip(_ref) {
|
|
|
57
59
|
ref: contentRef,
|
|
58
60
|
className: classNames('aries-tooltip-content', classes.content),
|
|
59
61
|
text: text,
|
|
62
|
+
textAsString: textAsString,
|
|
60
63
|
position: position
|
|
61
64
|
}, /*#__PURE__*/React.createElement(TooltipMessage, {
|
|
62
65
|
className: classNames('aries-tooltip-message', classes.message)
|
|
@@ -18,7 +18,7 @@ export default {
|
|
|
18
18
|
}]
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var StringTooltipTemplate = function StringTooltipTemplate(_ref) {
|
|
22
22
|
var text = _ref.text,
|
|
23
23
|
args = _objectWithoutPropertiesLoose(_ref, ["text"]);
|
|
24
24
|
|
|
@@ -27,12 +27,26 @@ var Template = function Template(_ref) {
|
|
|
27
27
|
}), /*#__PURE__*/React.createElement(Tag, null, "Glints Aries"));
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
var HtmlTooltipTemplate = function HtmlTooltipTemplate(_ref2) {
|
|
31
|
+
var text = _ref2.text,
|
|
32
|
+
args = _objectWithoutPropertiesLoose(_ref2, ["text"]);
|
|
33
|
+
|
|
34
|
+
return /*#__PURE__*/React.createElement(Tooltip, _extends({}, args, {
|
|
35
|
+
text: text || defaultText
|
|
36
|
+
}), /*#__PURE__*/React.createElement(Tag, null, "Glints Aries"));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export var Interactive = StringTooltipTemplate.bind({});
|
|
31
40
|
Interactive.args = {
|
|
32
41
|
text: defaultText,
|
|
33
42
|
position: 'top'
|
|
34
43
|
};
|
|
35
|
-
export var DifferentPosition =
|
|
44
|
+
export var DifferentPosition = StringTooltipTemplate.bind({});
|
|
36
45
|
DifferentPosition.args = {
|
|
37
46
|
position: 'left'
|
|
47
|
+
};
|
|
48
|
+
export var WithHtmlContent = HtmlTooltipTemplate.bind({});
|
|
49
|
+
WithHtmlContent.args = {
|
|
50
|
+
text: /*#__PURE__*/React.createElement("b", null, "Hello World"),
|
|
51
|
+
textAsString: 'Hello World'
|
|
38
52
|
};
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { DividerContainer } from './DividerStyle';
|
|
6
6
|
/**
|
|
7
|
-
* Use
|
|
7
|
+
* Use className or style to change the divider's
|
|
8
8
|
* height
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// GENERATE BY ./src/General/Icon/generateIcons.js
|
|
2
|
+
// DO NOT EDIT IT MANUALLY
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import Icon from '../Icon';
|
|
5
|
+
|
|
6
|
+
var StarCircleIcon = function StarCircleIcon(props) {
|
|
7
|
+
return /*#__PURE__*/React.createElement(Icon, props, /*#__PURE__*/React.createElement("g", {
|
|
8
|
+
transform: "scale(5)"
|
|
9
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
10
|
+
cx: "10",
|
|
11
|
+
cy: "10",
|
|
12
|
+
r: "10"
|
|
13
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
14
|
+
cx: "10",
|
|
15
|
+
cy: "10",
|
|
16
|
+
r: "10.5",
|
|
17
|
+
fill: "#FFFFFFE6"
|
|
18
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
19
|
+
cx: "10",
|
|
20
|
+
cy: "10",
|
|
21
|
+
r: "7.5"
|
|
22
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
23
|
+
d: "M11.6272 8.82618L10.5174 6.0625L9.39618 8.8261L6.5625 9.06981L8.74292 10.9834L8.03427 13.9375L10.5114 12.3705L12.924 13.9151L12.3003 10.9865L14.4375 9.06683L11.6272 8.82618Z",
|
|
24
|
+
fill: "#098BBD"
|
|
25
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
26
|
+
d: "M11.1272 8.82618L10.0174 6.0625L8.89618 8.8261L6.0625 9.06981L8.24292 10.9834L7.53427 13.9375L10.0114 12.3705L12.424 13.9151L11.8003 10.9865L13.9375 9.06683L11.1272 8.82618Z",
|
|
27
|
+
fill: "white"
|
|
28
|
+
})));
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default StarCircleIcon;
|
|
@@ -140,6 +140,7 @@ export { default as SpeechBubbleOutlineIcon } from './SpeechBubbleOutlineIcon';
|
|
|
140
140
|
export { default as SpinnerIcon } from './SpinnerIcon';
|
|
141
141
|
export { default as StackIcon } from './StackIcon';
|
|
142
142
|
export { default as StarOutlineIcon } from './StarOutlineIcon';
|
|
143
|
+
export { default as StarCircleIcon } from './StarCircleIcon';
|
|
143
144
|
export { default as StarIcon } from './StarIcon';
|
|
144
145
|
export { default as TagIcon } from './TagIcon';
|
|
145
146
|
export { default as TaskIcon } from './TaskIcon';
|
|
@@ -140,6 +140,7 @@ export { default as SpeechBubbleOutlineIcon } from './SpeechBubbleOutlineIcon';
|
|
|
140
140
|
export { default as SpinnerIcon } from './SpinnerIcon';
|
|
141
141
|
export { default as StackIcon } from './StackIcon';
|
|
142
142
|
export { default as StarOutlineIcon } from './StarOutlineIcon';
|
|
143
|
+
export { default as StarCircleIcon } from './StarCircleIcon';
|
|
143
144
|
export { default as StarIcon } from './StarIcon';
|
|
144
145
|
export { default as TagIcon } from './TagIcon';
|
|
145
146
|
export { default as TaskIcon } from './TaskIcon';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC, HTMLAttributes } from 'react';
|
|
2
|
-
/** The loading spinner does not support resizing at the moment, but as a workaround you can use the
|
|
2
|
+
/** The loading spinner does not support resizing at the moment, but as a workaround you can use the className attribute to change it's styles manually. */
|
|
3
3
|
export declare const Loading: FC<Props>;
|
|
4
4
|
export declare type Props = HTMLAttributes<HTMLDivElement>;
|
|
5
5
|
export default Loading;
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { LoadingContainer, Spinner } from './LoadingStyle';
|
|
5
|
-
/** The loading spinner does not support resizing at the moment, but as a workaround you can use the
|
|
5
|
+
/** The loading spinner does not support resizing at the moment, but as a workaround you can use the className attribute to change it's styles manually. */
|
|
6
6
|
|
|
7
7
|
export var Loading = function Loading(props) {
|
|
8
8
|
var className = props.className;
|
package/es/General/Tag/Tag.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ interface ButtonTagProps {
|
|
|
11
11
|
}
|
|
12
12
|
export declare type TagActionType = 'add' | 'reset';
|
|
13
13
|
interface ActionTagProps {
|
|
14
|
-
/** (Only for tags with
|
|
14
|
+
/** (Only for tags with variant=action). Chooses which kind of action the tag will indicate. */
|
|
15
15
|
action?: TagActionType;
|
|
16
16
|
/** A function triggered when icon or action tag is clicked. */
|
|
17
17
|
onClick?(e: React.MouseEvent<HTMLDivElement, MouseEvent>): void;
|
|
@@ -19,7 +19,7 @@ interface ActionTagProps {
|
|
|
19
19
|
export declare type TagVariantType = 'button' | 'action';
|
|
20
20
|
export interface Props extends BasicTagProps, ButtonTagProps, ActionTagProps {
|
|
21
21
|
children: React.ReactNode;
|
|
22
|
-
/**
|
|
22
|
+
/** button tags usually show a single piece of information, while action tags are elements in a list (e.g. a list of selected options). */
|
|
23
23
|
variant?: TagVariantType;
|
|
24
24
|
}
|
|
25
25
|
export default Tag;
|
|
@@ -84,7 +84,7 @@ export interface Props {
|
|
|
84
84
|
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
85
85
|
/** Called each time the text input loses focus */
|
|
86
86
|
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
87
|
-
/** Text to be displayed in
|
|
87
|
+
/** Text to be displayed in EmptyList when transformFunction returns an empty list */
|
|
88
88
|
emptyListText?: string;
|
|
89
89
|
}
|
|
90
90
|
export declare const Select: React.FC<Props> & {
|
|
@@ -91,7 +91,7 @@ Interactive.args = {
|
|
|
91
91
|
Interactive.parameters = {
|
|
92
92
|
docs: {
|
|
93
93
|
description: {
|
|
94
|
-
story: "You can pass a transformFunction to make the combobox filter the provided items according to custom logic. In the example above, the filter function uses
|
|
94
|
+
story: "You can pass a transformFunction to make the combobox filter the provided items according to custom logic. In the example above, the filter function uses String.includes instead of the default String.startsWith."
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
};
|
|
@@ -127,7 +127,7 @@ TransformFunctionForCustomFilter.args = {
|
|
|
127
127
|
TransformFunctionForCustomFilter.parameters = {
|
|
128
128
|
docs: {
|
|
129
129
|
description: {
|
|
130
|
-
story: "You can pass a transformFunction to make the combobox filter the provided items according to custom logic. In the example above, the filter function uses
|
|
130
|
+
story: "You can pass a transformFunction to make the combobox filter the provided items according to custom logic. In the example above, the filter function uses String.startsWith instead of the default String.includes."
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
};
|
|
@@ -155,7 +155,7 @@ CustomComponents.parameters = {
|
|
|
155
155
|
docs: {
|
|
156
156
|
description: {
|
|
157
157
|
story: "You can override the components that comprise the Combobox. These components are available at the moment: " + componentNames.map(function (name) {
|
|
158
|
-
return "
|
|
158
|
+
return "" + name;
|
|
159
159
|
})
|
|
160
160
|
}
|
|
161
161
|
}
|
|
@@ -171,7 +171,7 @@ RemoveToggleButton.args = {
|
|
|
171
171
|
RemoveToggleButton.parameters = {
|
|
172
172
|
docs: {
|
|
173
173
|
description: {
|
|
174
|
-
story: 'Remove the toggle button by passing
|
|
174
|
+
story: 'Remove the toggle button by passing components={{ ToggleButton: () => null }}'
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
};
|
|
@@ -186,7 +186,7 @@ InitiallyOpen.args = {
|
|
|
186
186
|
InitiallyOpen.parameters = {
|
|
187
187
|
docs: {
|
|
188
188
|
description: {
|
|
189
|
-
story: 'Pass
|
|
189
|
+
story: 'Pass isOpenInitially=true to open and focus the Select on render. (Set to false in this story because it would steal focus from the other stories otherwise).'
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
};
|
|
@@ -211,7 +211,7 @@ DownshiftOptions.args = {
|
|
|
211
211
|
DownshiftOptions.parameters = {
|
|
212
212
|
docs: {
|
|
213
213
|
description: {
|
|
214
|
-
story: 'If the options afforded by the Select component are not enough, you can also use the
|
|
214
|
+
story: 'If the options afforded by the Select component are not enough, you can also use the downshift prop to pass custom options to the internal useCombobox hook. You can read the documentation <a href="https://github.com/downshift-js/downshift/blob/master/src/hooks/useCombobox/README.md">here</a>. Use this with caution, future versions of this component might break your custom functionality.'
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
};
|
|
@@ -230,7 +230,7 @@ DisableTyping.args = {
|
|
|
230
230
|
DisableTyping.parameters = {
|
|
231
231
|
docs: {
|
|
232
232
|
description: {
|
|
233
|
-
story: "With
|
|
233
|
+
story: "With disableTyping=true, the internal input will be set to readonly. This is helpful when there's only a small or fixed amount of items. This can be combined with setting transformFunction to the identity function to disable the filtering after an option has been chosen."
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
};
|
|
@@ -245,7 +245,7 @@ DisabledOptions.args = {
|
|
|
245
245
|
DisabledOptions.parameters = {
|
|
246
246
|
docs: {
|
|
247
247
|
description: {
|
|
248
|
-
story: "Use the items'
|
|
248
|
+
story: "Use the items' disabled prop to disable individual items."
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
};
|
|
@@ -277,7 +277,7 @@ export var ControlledSelectedItem = function ControlledSelectedItem() {
|
|
|
277
277
|
ControlledSelectedItem.parameters = {
|
|
278
278
|
docs: {
|
|
279
279
|
description: {
|
|
280
|
-
story: 'Use
|
|
280
|
+
story: 'Use selectedItem and setSelectedItem to control the currently selected item. <strong>In many cases, you will want to use this to react to selections made by the user.</strong> Use null as the controlled selectedItem when no item is selected: So if you want to have a controlled Select with no item selected by default, use useState(null).'
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
};
|
|
@@ -304,7 +304,7 @@ export var ControlledIsOpen = function ControlledIsOpen() {
|
|
|
304
304
|
ControlledIsOpen.parameters = {
|
|
305
305
|
docs: {
|
|
306
306
|
description: {
|
|
307
|
-
story: "Use
|
|
307
|
+
story: "Use isOpen and onIsOpenChange to control the state of the Select's menu. Note that clicking outside of the Select closes the select (calls onIsOpenChange with false) so if you're trying to build a 'toggle' button, clicking that button will first close the menu."
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
};
|
|
@@ -334,7 +334,7 @@ export var ControlledInputValue = function ControlledInputValue() {
|
|
|
334
334
|
ControlledInputValue.parameters = {
|
|
335
335
|
docs: {
|
|
336
336
|
description: {
|
|
337
|
-
story: "Use
|
|
337
|
+
story: "Use inputValue and setInputValue to control the input value (this value is used for the search function, don't confuse it with selectedItem"
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
};
|
|
@@ -347,7 +347,7 @@ Invalid.args = {
|
|
|
347
347
|
Invalid.parameters = {
|
|
348
348
|
docs: {
|
|
349
349
|
description: {
|
|
350
|
-
story: 'Use
|
|
350
|
+
story: 'Use invalid=true to toggle the Select into an error state. It is recommended that you use helperText to describe the error when you do this.'
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
};
|
|
@@ -358,7 +358,7 @@ DisableAutocomplete.args = {
|
|
|
358
358
|
DisableAutocomplete.parameters = {
|
|
359
359
|
docs: {
|
|
360
360
|
description: {
|
|
361
|
-
story: "Intrinsic props are usually passed down to the internal
|
|
361
|
+
story: "Intrinsic props are usually passed down to the internal input element, so to disable autocompletion just pass autocomplete='off'."
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
};
|
|
@@ -389,7 +389,7 @@ export var FocusCallbacks = function FocusCallbacks() {
|
|
|
389
389
|
FocusCallbacks.parameters = {
|
|
390
390
|
docs: {
|
|
391
391
|
description: {
|
|
392
|
-
story: 'Intrinsic props are usually passed down to the internal
|
|
392
|
+
story: 'Intrinsic props are usually passed down to the internal input element, so you can simply use onFocus and onBlur to capture those events.'
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
};
|
|
@@ -410,7 +410,7 @@ export var OnClearCallback = function OnClearCallback() {
|
|
|
410
410
|
OnClearCallback.parameters = {
|
|
411
411
|
docs: {
|
|
412
412
|
description: {
|
|
413
|
-
story: 'Use
|
|
413
|
+
story: 'Use onClear to capture the when the clear-button is clicked.'
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
};
|
|
@@ -430,7 +430,7 @@ ConfigurableWidth.args = {
|
|
|
430
430
|
ConfigurableWidth.parameters = {
|
|
431
431
|
docs: {
|
|
432
432
|
description: {
|
|
433
|
-
story: "By default, the select has a 100% width. To change the width, just pass a custom
|
|
433
|
+
story: "By default, the select has a 100% width. To change the width, just pass a custom Container subcomponent. Note that you might also have to adjust other subcomponent's styles if you want to make it really short (less than 300px)."
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
};
|
|
@@ -450,7 +450,7 @@ Small.args = {
|
|
|
450
450
|
Small.parameters = {
|
|
451
451
|
docs: {
|
|
452
452
|
description: {
|
|
453
|
-
story: "<p>By default, the Select dictates a font-size of 16px that cascades through (almost) all sub-components. Appropriate spaces are defined using
|
|
453
|
+
story: "<p>By default, the Select dictates a font-size of 16px that cascades through (almost) all sub-components. Appropriate spaces are defined using em, so if you want to resize the Select, just change the container's font-size.</p><p>The exception to the 16px default is the helper text, which also just uses an em relative value.</p>"
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
456
|
};
|
|
@@ -468,7 +468,7 @@ EmptyListText.args = {
|
|
|
468
468
|
EmptyListText.parameters = {
|
|
469
469
|
docs: {
|
|
470
470
|
description: {
|
|
471
|
-
story: 'When, after applying the
|
|
471
|
+
story: 'When, after applying the transformFunction the list of items is empty, a special message will be shown in the dropdown. This message can be customized with emptyListText. You can also style this'
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
474
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { TextFieldInput } from '../TextField/TextFieldStyle';
|
|
3
|
-
/** Use
|
|
4
|
-
* Use
|
|
3
|
+
/** Use onChange to listen to input changes.
|
|
4
|
+
* Use onBlur to listen to focus loss.
|
|
5
5
|
* <br/>
|
|
6
|
-
* Use
|
|
6
|
+
* Use status to set different styles for the Input Field based on status.
|
|
7
7
|
* <br/>
|
|
8
|
-
* Use
|
|
8
|
+
* Use small to set the size of the input field. The ...rest is passed to the
|
|
9
9
|
* internal field input. */
|
|
10
10
|
export declare const NumberInput: (props: Props) => JSX.Element;
|
|
11
11
|
export interface Props extends React.ComponentPropsWithoutRef<typeof TextFieldInput> {
|
|
@@ -2,12 +2,12 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import TextField from '../TextField';
|
|
4
4
|
|
|
5
|
-
/** Use
|
|
6
|
-
* Use
|
|
5
|
+
/** Use onChange to listen to input changes.
|
|
6
|
+
* Use onBlur to listen to focus loss.
|
|
7
7
|
* <br/>
|
|
8
|
-
* Use
|
|
8
|
+
* Use status to set different styles for the Input Field based on status.
|
|
9
9
|
* <br/>
|
|
10
|
-
* Use
|
|
10
|
+
* Use small to set the size of the input field. The ...rest is passed to the
|
|
11
11
|
* internal field input. */
|
|
12
12
|
export var NumberInput = function NumberInput(props) {
|
|
13
13
|
return /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
export declare const PhoneNumberInput: ({ value, onChange, onFocus, onBlur, callingCodeOptions: callingCodeOptionsExternal, onInputChange, filterValue, isLoadingCallingCodeOptions, label, featuredOptionsLabel, otherOptionsLabel, callingCodeFilterInputPlaceholder, callingCodeNoOptionsLabel, error, addon, ...restProps }: Props) => JSX.Element;
|
|
3
|
+
export interface Props {
|
|
4
|
+
value: PhoneNumber;
|
|
5
|
+
onChange: (value: PhoneNumber) => void;
|
|
6
|
+
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
7
|
+
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
8
|
+
error?: ReactNode;
|
|
9
|
+
addon?: ReactNode;
|
|
10
|
+
callingCodeOptions: CallingCodeOption[];
|
|
11
|
+
filterValue?: string | null;
|
|
12
|
+
onInputChange?: (inputValue: string | null) => void;
|
|
13
|
+
isLoadingCallingCodeOptions?: boolean;
|
|
14
|
+
callingCodeInputRootId?: string;
|
|
15
|
+
label: string;
|
|
16
|
+
featuredOptionsLabel: string;
|
|
17
|
+
otherOptionsLabel: string;
|
|
18
|
+
callingCodeFilterInputPlaceholder: string;
|
|
19
|
+
callingCodeNoOptionsLabel: string;
|
|
20
|
+
}
|
|
21
|
+
export interface PhoneNumber {
|
|
22
|
+
callingCode: number;
|
|
23
|
+
significantNumber: string | null;
|
|
24
|
+
}
|
|
25
|
+
export interface CallingCodeOption {
|
|
26
|
+
label: string;
|
|
27
|
+
callingCode: number;
|
|
28
|
+
isFeatured: boolean;
|
|
29
|
+
}
|