@artsy/palette 35.0.0 → 36.0.0-canary.1250.28474.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 (62) hide show
  1. package/dist/elements/AutocompleteInput/AutocompleteInput.d.ts +3 -1
  2. package/dist/elements/AutocompleteInput/AutocompleteInput.js +3 -2
  3. package/dist/elements/AutocompleteInput/AutocompleteInput.js.map +1 -1
  4. package/dist/elements/AutocompleteInput/AutocompleteInput.story.d.ts +1 -0
  5. package/dist/elements/AutocompleteInput/AutocompleteInput.story.js +25 -1
  6. package/dist/elements/AutocompleteInput/AutocompleteInput.story.js.map +1 -1
  7. package/dist/elements/BorderedRadio/BorderedRadio.d.ts +20 -20
  8. package/dist/elements/Input/Input.d.ts +3 -0
  9. package/dist/elements/Input/Input.js +59 -15
  10. package/dist/elements/Input/Input.js.map +1 -1
  11. package/dist/elements/Input/Input.story.js +14 -0
  12. package/dist/elements/Input/Input.story.js.map +1 -1
  13. package/dist/elements/Input/tokens.js +7 -6
  14. package/dist/elements/Input/tokens.js.map +1 -1
  15. package/dist/elements/Input/types.d.ts +1 -1
  16. package/dist/elements/Input/types.js.map +1 -1
  17. package/dist/elements/Label/Label.js +2 -2
  18. package/dist/elements/Label/Label.js.map +1 -1
  19. package/dist/elements/LabeledInput/LabeledInput.d.ts +2 -1
  20. package/dist/elements/LabeledInput/LabeledInput.js +12 -10
  21. package/dist/elements/LabeledInput/LabeledInput.js.map +1 -1
  22. package/dist/elements/LabeledInput/LabeledInput.story.js +12 -0
  23. package/dist/elements/LabeledInput/LabeledInput.story.js.map +1 -1
  24. package/dist/elements/PhoneInput/PhoneInput.d.ts +33 -0
  25. package/dist/elements/PhoneInput/PhoneInput.js +319 -0
  26. package/dist/elements/PhoneInput/PhoneInput.js.map +1 -0
  27. package/dist/elements/PhoneInput/PhoneInput.story.d.ts +5 -0
  28. package/dist/elements/PhoneInput/PhoneInput.story.js +207 -0
  29. package/dist/elements/PhoneInput/PhoneInput.story.js.map +1 -0
  30. package/dist/elements/PhoneInput/index.d.ts +1 -0
  31. package/dist/elements/PhoneInput/index.js +17 -0
  32. package/dist/elements/PhoneInput/index.js.map +1 -0
  33. package/dist/elements/PhoneInput/tokens.d.ts +9 -0
  34. package/dist/elements/PhoneInput/tokens.js +19 -0
  35. package/dist/elements/PhoneInput/tokens.js.map +1 -0
  36. package/dist/elements/Select/Select.d.ts +0 -2
  37. package/dist/elements/Select/Select.js +25 -28
  38. package/dist/elements/Select/Select.js.map +1 -1
  39. package/dist/elements/Select/Select.story.d.ts +0 -1
  40. package/dist/elements/Select/Select.story.js +16 -34
  41. package/dist/elements/Select/Select.story.js.map +1 -1
  42. package/dist/elements/Select/tokens.d.ts +2 -7
  43. package/dist/elements/Select/tokens.js +6 -5
  44. package/dist/elements/Select/tokens.js.map +1 -1
  45. package/dist/elements/Select/types.d.ts +1 -2
  46. package/dist/elements/Select/types.js.map +1 -1
  47. package/dist/elements/TextArea/TextArea.d.ts +1 -1
  48. package/dist/elements/TextArea/TextArea.js +34 -26
  49. package/dist/elements/TextArea/TextArea.js.map +1 -1
  50. package/dist/elements/TextArea/tokens.js +7 -6
  51. package/dist/elements/TextArea/tokens.js.map +1 -1
  52. package/dist/elements/TextArea/types.d.ts +1 -1
  53. package/dist/elements/TextArea/types.js.map +1 -1
  54. package/dist/elements/index.d.ts +1 -0
  55. package/dist/elements/index.js +11 -0
  56. package/dist/elements/index.js.map +1 -1
  57. package/dist/shared/RequiredField.d.ts +3 -0
  58. package/dist/shared/RequiredField.js +20 -0
  59. package/dist/shared/RequiredField.js.map +1 -0
  60. package/dist/themes/Themes.story.js +0 -38
  61. package/dist/themes/Themes.story.js.map +1 -1
  62. package/package.json +3 -3
@@ -0,0 +1,33 @@
1
+ import React from "react";
2
+ import { InputProps } from "../Input";
3
+ /**
4
+ * The option structure for the list in the dropdown menu
5
+ *
6
+ * @interface Option
7
+ * @property {string} `text` is the content that will be displayed as selected option
8
+ * @property {string} `name` is the content that will be displayed in the dropdown list
9
+ * @property {string} `value` is the value that will be passed to onSelect
10
+ */
11
+ interface Option {
12
+ text: string;
13
+ name: string;
14
+ value: string;
15
+ countryCode?: string;
16
+ flag?: string;
17
+ }
18
+ export interface PhoneInputProps extends Omit<InputProps, "onSelect"> {
19
+ options: Option[];
20
+ onSelect: (option: Option) => void;
21
+ active?: boolean;
22
+ disabled?: boolean;
23
+ error?: string | boolean;
24
+ focus?: boolean;
25
+ hover?: boolean;
26
+ required?: boolean;
27
+ dropdownValue?: string;
28
+ inputValue?: string;
29
+ }
30
+ export declare const PhoneInput: React.ForwardRefExoticComponent<PhoneInputProps & {
31
+ ref?: React.Ref<HTMLInputElement>;
32
+ }>;
33
+ export {};
@@ -0,0 +1,319 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.PhoneInput = void 0;
8
+ var _composeReactRefs = _interopRequireDefault(require("@seznam/compose-react-refs"));
9
+ var _themeGet = require("@styled-system/theme-get");
10
+ var _react = _interopRequireWildcard(require("react"));
11
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
12
+ var _styledSystem = require("styled-system");
13
+ var _helpers = require("../../helpers");
14
+ var _utils = require("../../utils");
15
+ var _Box = require("../Box");
16
+ var _Input = require("../Input");
17
+ var _Text = require("../Text");
18
+ var _tokens = require("./tokens");
19
+ var _useKeyboardListNavigation = require("use-keyboard-list-navigation");
20
+ var _RequiredField = require("../../shared/RequiredField");
21
+ var _excluded = ["className", "options", "disabled", "error", "focus", "hover", "required", "onSelect", "dropdownValue", "inputValue"];
22
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
26
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
27
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
28
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
29
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
30
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
31
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
32
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
33
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
34
+ /**
35
+ * The option structure for the list in the dropdown menu
36
+ *
37
+ * @interface Option
38
+ * @property {string} `text` is the content that will be displayed as selected option
39
+ * @property {string} `name` is the content that will be displayed in the dropdown list
40
+ * @property {string} `value` is the value that will be passed to onSelect
41
+ */
42
+
43
+ var PhoneInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, forwardedRef) {
44
+ var className = _ref.className,
45
+ options = _ref.options,
46
+ disabled = _ref.disabled,
47
+ error = _ref.error,
48
+ focus = _ref.focus,
49
+ hover = _ref.hover,
50
+ required = _ref.required,
51
+ onSelect = _ref.onSelect,
52
+ dropdownValue = _ref.dropdownValue,
53
+ inputValue = _ref.inputValue,
54
+ rest = _objectWithoutProperties(_ref, _excluded);
55
+ if (options.length === 0) {
56
+ throw new Error("Palette PhoneInput requires at least 1 option in the options prop");
57
+ }
58
+ var inputRef = (0, _react.useRef)(null);
59
+ var searchInputRef = (0, _react.useRef)(null);
60
+ var containerRef = (0, _react.useRef)(null);
61
+ var countryPickerRef = (0, _react.useRef)(null);
62
+ var defaultOption = (0, _react.useMemo)(function () {
63
+ return dropdownValue && options.find(function (option) {
64
+ return option.value === dropdownValue;
65
+ });
66
+ }, [dropdownValue, options]);
67
+ var _splitBoxProps = (0, _Box.splitBoxProps)(rest),
68
+ _splitBoxProps2 = _slicedToArray(_splitBoxProps, 2),
69
+ boxProps = _splitBoxProps2[0],
70
+ inputProps = _splitBoxProps2[1];
71
+ var _useState = (0, _react.useState)(false),
72
+ _useState2 = _slicedToArray(_useState, 2),
73
+ isDropdownVisible = _useState2[0],
74
+ setDropdownVisible = _useState2[1];
75
+ var _useState3 = (0, _react.useState)(""),
76
+ _useState4 = _slicedToArray(_useState3, 2),
77
+ searchQuery = _useState4[0],
78
+ setSearchQuery = _useState4[1];
79
+ var _useState5 = (0, _react.useState)(defaultOption || options[0]),
80
+ _useState6 = _slicedToArray(_useState5, 2),
81
+ selectedOption = _useState6[0],
82
+ setSelectedOption = _useState6[1];
83
+ var filteredOptions = options.filter(function (option) {
84
+ if (searchQuery !== "") {
85
+ var filteredCountry = option.text.toLowerCase().includes(searchQuery.toLowerCase()) || option.name.toLowerCase().includes(searchQuery.toLowerCase());
86
+ return filteredCountry;
87
+ }
88
+ return true;
89
+ });
90
+ var _usePosition = (0, _utils.usePosition)({
91
+ key: filteredOptions.length,
92
+ position: "bottom",
93
+ offset: 10,
94
+ active: isDropdownVisible,
95
+ flip: false
96
+ }),
97
+ anchorRef = _usePosition.anchorRef,
98
+ tooltipRef = _usePosition.tooltipRef;
99
+ var _useKeyboardListNavig = (0, _useKeyboardListNavigation.useKeyboardListNavigation)({
100
+ ref: containerRef,
101
+ list: filteredOptions,
102
+ waitForInteractive: true,
103
+ onEnter: function onEnter(_ref2) {
104
+ var option = _ref2.element,
105
+ event = _ref2.event;
106
+ event.preventDefault();
107
+ event.stopPropagation();
108
+ if (option) {
109
+ handleSelect(option);
110
+ }
111
+ resetUI();
112
+ }
113
+ }),
114
+ reset = _useKeyboardListNavig.reset,
115
+ set = _useKeyboardListNavig.set;
116
+ var _useWidthOf = (0, _utils.useWidthOf)({
117
+ ref: anchorRef
118
+ }),
119
+ width = _useWidthOf.width;
120
+ var inputName = inputProps.name || "palette-phone-input";
121
+ var optionsWithRefs = (0, _react.useMemo)(function () {
122
+ return filteredOptions.map(function (option) {
123
+ return {
124
+ option: option,
125
+ ref: /*#__PURE__*/(0, _react.createRef)()
126
+ };
127
+ });
128
+ }, [filteredOptions]);
129
+ var resetUI = function resetUI() {
130
+ setTimeout(function () {
131
+ var _inputRef$current;
132
+ (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
133
+ reset();
134
+ setDropdownVisible(false);
135
+ }, 100);
136
+ };
137
+ var handleSelect = function handleSelect(option) {
138
+ var _inputRef$current2;
139
+ (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.focus();
140
+ setSearchQuery("");
141
+ setSelectedOption(option);
142
+ setDropdownVisible(false);
143
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(option);
144
+ };
145
+ var handleFocusChange = (0, _react.useCallback)(function (focused) {
146
+ if (focused || !isDropdownVisible) return;
147
+ setDropdownVisible(false);
148
+ }, [isDropdownVisible]);
149
+
150
+ // Handle closing the dropdown when clicking outside of the input
151
+ // or when focus leaves the input completely
152
+ var _useContainsFocus = (0, _utils.useContainsFocus)({
153
+ onChange: handleFocusChange
154
+ }),
155
+ containsFocusRef = _useContainsFocus.ref;
156
+ var handleCountryPickerKeydown = function handleCountryPickerKeydown(event) {
157
+ var _countryPickerRef$cur;
158
+ switch (event.key) {
159
+ case "Escape":
160
+ event.preventDefault();
161
+ event.stopPropagation();
162
+ setDropdownVisible(false);
163
+ (_countryPickerRef$cur = countryPickerRef.current) === null || _countryPickerRef$cur === void 0 ? void 0 : _countryPickerRef$cur.blur();
164
+ reset();
165
+ return;
166
+ case "Enter":
167
+ case " ":
168
+ event.preventDefault();
169
+ event.stopPropagation();
170
+ if (!disabled) {
171
+ setDropdownVisible(true);
172
+ }
173
+ return;
174
+ }
175
+ };
176
+ var handleSearchInputKeydown = function handleSearchInputKeydown(event) {
177
+ var _searchInputRef$curre;
178
+ switch (event.key) {
179
+ case "Tab":
180
+ if (event.shiftKey) {
181
+ // ignore
182
+ } else {
183
+ // move down to the list
184
+ event.preventDefault();
185
+ event.stopPropagation();
186
+ reset();
187
+ set({
188
+ cursor: 0,
189
+ interactive: true
190
+ });
191
+ }
192
+ return;
193
+ case "Enter":
194
+ event.preventDefault();
195
+ event.stopPropagation();
196
+ if (filteredOptions.length) {
197
+ handleSelect(filteredOptions[0]);
198
+ }
199
+ return;
200
+ default:
201
+ (_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 ? void 0 : _searchInputRef$curre.focus();
202
+ }
203
+ };
204
+ return /*#__PURE__*/_react.default.createElement(_Box.Box, _extends({
205
+ ref: (0, _composeReactRefs.default)(containerRef, containsFocusRef),
206
+ width: "100%",
207
+ className: className
208
+ }, boxProps), /*#__PURE__*/_react.default.createElement(ContainerBox, {
209
+ ref: anchorRef,
210
+ isDropdownVisible: isDropdownVisible,
211
+ hover: hover,
212
+ focus: focus,
213
+ error: error,
214
+ disabled: disabled,
215
+ placeholder: inputProps.placeholder
216
+ }, /*#__PURE__*/_react.default.createElement(SelectContainer, {
217
+ "data-testid": "country-picker",
218
+ ref: countryPickerRef,
219
+ disabled: disabled,
220
+ onClick: function onClick() {
221
+ setDropdownVisible(!disabled && !isDropdownVisible);
222
+ },
223
+ tabIndex: disabled ? -1 : 0,
224
+ onKeyDown: handleCountryPickerKeydown
225
+ }, selectedOption.text), /*#__PURE__*/_react.default.createElement(StyledInput, _extends({
226
+ disabled: disabled,
227
+ ref: (0, _composeReactRefs.default)(inputRef, forwardedRef),
228
+ type: "tel",
229
+ autoComplete: "tel-national",
230
+ required: required,
231
+ name: inputName,
232
+ maxLength: 25,
233
+ placeholder: inputProps.placeholder,
234
+ value: inputValue
235
+ }, inputProps)), /*#__PURE__*/_react.default.createElement(StyledLabel, {
236
+ htmlFor: inputName
237
+ }, "Phone Number")), isDropdownVisible && /*#__PURE__*/_react.default.createElement(SelectDropdown, {
238
+ ref: tooltipRef,
239
+ role: "listbox",
240
+ width: width
241
+ }, /*#__PURE__*/_react.default.createElement(_Input.Input, {
242
+ ref: searchInputRef,
243
+ p: 1,
244
+ pb: 0,
245
+ autoFocus: true,
246
+ placeholder: "Search",
247
+ value: searchQuery,
248
+ onChange: function onChange(e) {
249
+ return setSearchQuery(e.target.value);
250
+ },
251
+ onKeyDown: handleSearchInputKeydown
252
+ }), /*#__PURE__*/_react.default.createElement(SelectOptions, null, optionsWithRefs.map(function (_ref3, i) {
253
+ var option = _ref3.option,
254
+ ref = _ref3.ref;
255
+ return /*#__PURE__*/_react.default.createElement(SelectOption, {
256
+ key: i,
257
+ ref: ref,
258
+ role: "option",
259
+ "aria-selected": option.value === selectedOption.value,
260
+ "aria-posinset": i + 1,
261
+ "aria-setsize": options.length,
262
+ selected: option.value === selectedOption.value,
263
+ onClick: function onClick() {
264
+ return handleSelect(option);
265
+ },
266
+ tabIndex: -1
267
+ }, /*#__PURE__*/_react.default.createElement(_Text.Text, {
268
+ minWidth: 80
269
+ }, option.text), /*#__PURE__*/_react.default.createElement(_Text.Text, null, option.name));
270
+ }))), required && !(error && typeof error === "string") && /*#__PURE__*/_react.default.createElement(_RequiredField.RequiredField, {
271
+ mt: 0.5,
272
+ ml: 1
273
+ }), error && typeof error === "string" && /*#__PURE__*/_react.default.createElement(_Text.Text, {
274
+ variant: "xs",
275
+ mt: 0.5,
276
+ mr: 1,
277
+ color: "red100",
278
+ textAlign: "right"
279
+ }, error));
280
+ });
281
+ exports.PhoneInput = PhoneInput;
282
+ PhoneInput.displayName = "PhoneInput";
283
+ var caretMixin = (0, _styledComponents.css)(["&::after{content:\"\";cursor:inherit;width:0;height:0;position:absolute;top:50%;transform:translateY(-50%);right:", ";pointer-events:none;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid ", ";}"], (0, _themeGet.themeGet)("space.1"), function (_ref4) {
284
+ var disabled = _ref4.disabled;
285
+ return disabled ? (0, _themeGet.themeGet)("colors.black10") : (0, _themeGet.themeGet)("colors.black60");
286
+ });
287
+ var ContainerBox = (0, _styledComponents.default)(_Box.Box).withConfig({
288
+ displayName: "PhoneInput__ContainerBox",
289
+ componentId: "lj1bt9-0"
290
+ })(["position:relative;display:flex;flex-direction:row;", ""], function (props) {
291
+ return (0, _styledComponents.css)(["", " ", " ", " ", " ", " &:hover{", "}&:focus-within{", " &:has(input:not(:placeholder-shown)){", " ", ";}}&:has(input:not(:placeholder-shown)){", " ", ";}"], _tokens.PHONE_INPUT_STATES.default, props.hover && _tokens.PHONE_INPUT_STATES.hover, (props.focus || props.isDropdownVisible) && _tokens.PHONE_INPUT_STATES.focus, props.disabled && _tokens.PHONE_INPUT_STATES.disabled, props.error && _tokens.PHONE_INPUT_STATES.error, !props.isDropdownVisible && !props.disabled && _tokens.PHONE_INPUT_STATES.hover, !props.disabled && _tokens.PHONE_INPUT_STATES.focus, _tokens.PHONE_INPUT_STATES.active, props.error && _tokens.PHONE_INPUT_STATES.error, !!props.placeholder && _tokens.PHONE_INPUT_STATES.completed, props.error && _tokens.PHONE_INPUT_STATES.error);
292
+ });
293
+ var SelectContainer = (0, _styledComponents.default)(_Box.Box).withConfig({
294
+ displayName: "PhoneInput__SelectContainer",
295
+ componentId: "lj1bt9-1"
296
+ })(["display:flex;align-items:center;position:relative;min-width:120px;border:1px solid;border-right:0;padding:0 24px 0 ", ";font-family:", ";border-radius:3px 0 0 3px;border-color:", ";cursor:pointer;line-height:1;transition:color 0.25s,border-color 0.25s;height:50px;font-size:", ";color:", ";", ""], (0, _themeGet.themeGet)("space.1"), (0, _themeGet.themeGet)("fonts.sans"), (0, _themeGet.themeGet)("colors.black30"), (0, _themeGet.themeGet)("textVariants.sm-display.fontSize"), (0, _themeGet.themeGet)("colors.black100"), caretMixin);
297
+ var SelectDropdown = (0, _styledComponents.default)(_Box.Box).withConfig({
298
+ displayName: "PhoneInput__SelectDropdown",
299
+ componentId: "lj1bt9-2"
300
+ })(["box-shadow:", ";z-index:1;background:", ";"], _helpers.DROP_SHADOW, (0, _themeGet.themeGet)("colors.white100"));
301
+ var SelectOptions = (0, _styledComponents.default)(_Box.Box).withConfig({
302
+ displayName: "PhoneInput__SelectOptions",
303
+ componentId: "lj1bt9-3"
304
+ })(["max-height:308px;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:", ";"], (0, _themeGet.themeGet)("space.1"));
305
+ var SelectOption = (0, _styledComponents.default)(_Box.Box).withConfig({
306
+ displayName: "PhoneInput__SelectOption",
307
+ componentId: "lj1bt9-4"
308
+ })(["padding:", " 0;cursor:pointer;display:flex;flex-direction:row;align-items:center;text-decoration:none;color:", ";transition:color 0.25s,text-decoration 0.25s;&:hover{color:", ";text-decoration:underline;}&:focus,&:active{color:", ";text-decoration:none;}", ""], (0, _themeGet.themeGet)("space.1"), (0, _themeGet.themeGet)("colors.black60"), (0, _themeGet.themeGet)("colors.blue100"), (0, _themeGet.themeGet)("colors.black100"), function (props) {
309
+ return props.selected && (0, _styledComponents.css)(["color:", ";text-decoration:none;"], (0, _themeGet.themeGet)("colors.black100"));
310
+ });
311
+ var StyledInput = _styledComponents.default.input.withConfig({
312
+ displayName: "PhoneInput__StyledInput",
313
+ componentId: "lj1bt9-5"
314
+ })(["width:100%;padding:0 ", ";appearance:none;outline:none;line-height:1;border:1px solid;border-radius:0 3px 3px 0;transition:color 0.25s,border-color 0.25s;font-family:", ";font-size:", ";color:", ";border-color:", ";", " &:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus{-webkit-box-shadow:0 0 0px 100px ", " inset;}::placeholder{color:", ";transition:color 0.25s;}"], (0, _themeGet.themeGet)("space.1"), (0, _themeGet.themeGet)("fonts.sans"), (0, _themeGet.themeGet)("textVariants.sm-display.fontSize"), (0, _themeGet.themeGet)("colors.black100"), (0, _themeGet.themeGet)("colors.black30"), _styledSystem.height, (0, _themeGet.themeGet)("colors.white100"), (0, _themeGet.themeGet)("colors.black60"));
315
+ var StyledLabel = _styledComponents.default.label.withConfig({
316
+ displayName: "PhoneInput__StyledLabel",
317
+ componentId: "lj1bt9-6"
318
+ })(["position:absolute;top:0;left:5px;padding:0 5px;background-color:", ";transform:translateY(-50%);transition:color 0.25s;font-family:", ";pointer-events:none;font-size:", ";color:", ";"], (0, _themeGet.themeGet)("colors.white100"), (0, _themeGet.themeGet)("fonts.sans"), (0, _themeGet.themeGet)("textVariants.xs.fontSize"), (0, _themeGet.themeGet)("colors.black60"));
319
+ //# sourceMappingURL=PhoneInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhoneInput.js","names":["_composeReactRefs","_interopRequireDefault","require","_themeGet","_react","_interopRequireWildcard","_styledComponents","_styledSystem","_helpers","_utils","_Box","_Input","_Text","_tokens","_useKeyboardListNavigation","_RequiredField","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","PhoneInput","React","forwardRef","_ref","forwardedRef","className","options","disabled","error","focus","hover","required","onSelect","dropdownValue","inputValue","rest","Error","inputRef","useRef","searchInputRef","containerRef","countryPickerRef","defaultOption","useMemo","find","option","_splitBoxProps","splitBoxProps","_splitBoxProps2","boxProps","inputProps","_useState","useState","_useState2","isDropdownVisible","setDropdownVisible","_useState3","_useState4","searchQuery","setSearchQuery","_useState5","_useState6","selectedOption","setSelectedOption","filteredOptions","filter","filteredCountry","text","toLowerCase","includes","_usePosition","usePosition","position","offset","active","flip","anchorRef","tooltipRef","_useKeyboardListNavig","useKeyboardListNavigation","ref","list","waitForInteractive","onEnter","_ref2","element","event","preventDefault","stopPropagation","handleSelect","resetUI","reset","_useWidthOf","useWidthOf","width","inputName","optionsWithRefs","map","createRef","setTimeout","_inputRef$current","current","_inputRef$current2","handleFocusChange","useCallback","focused","_useContainsFocus","useContainsFocus","onChange","containsFocusRef","handleCountryPickerKeydown","_countryPickerRef$cur","blur","handleSearchInputKeydown","_searchInputRef$curre","shiftKey","cursor","interactive","createElement","Box","composeRefs","ContainerBox","placeholder","SelectContainer","onClick","tabIndex","onKeyDown","StyledInput","type","autoComplete","maxLength","StyledLabel","htmlFor","SelectDropdown","role","Input","p","pb","autoFocus","e","SelectOptions","_ref3","SelectOption","selected","Text","minWidth","RequiredField","mt","ml","variant","mr","color","textAlign","exports","displayName","caretMixin","css","themeGet","_ref4","styled","withConfig","componentId","props","PHONE_INPUT_STATES","completed","DROP_SHADOW","input","systemHeight","label"],"sources":["../../../src/elements/PhoneInput/PhoneInput.tsx"],"sourcesContent":["import composeRefs from \"@seznam/compose-react-refs\"\nimport { themeGet } from \"@styled-system/theme-get\"\nimport React, { createRef, useCallback, useMemo, useRef, useState } from \"react\"\nimport styled, { css } from \"styled-components\"\nimport { height as systemHeight } from \"styled-system\"\nimport { DROP_SHADOW } from \"../../helpers\"\nimport { useContainsFocus, usePosition, useWidthOf } from \"../../utils\"\nimport { Box, splitBoxProps } from \"../Box\"\nimport { Input, InputProps } from \"../Input\"\nimport { Text } from \"../Text\"\nimport { PHONE_INPUT_STATES } from \"./tokens\"\nimport { useKeyboardListNavigation } from \"use-keyboard-list-navigation\"\nimport { RequiredField } from \"../../shared/RequiredField\"\n\n/**\n * The option structure for the list in the dropdown menu\n *\n * @interface Option\n * @property {string} `text` is the content that will be displayed as selected option\n * @property {string} `name` is the content that will be displayed in the dropdown list\n * @property {string} `value` is the value that will be passed to onSelect\n */\ninterface Option {\n text: string\n name: string\n value: string\n countryCode?: string\n flag?: string\n}\n\nexport interface PhoneInputProps extends Omit<InputProps, \"onSelect\"> {\n options: Option[]\n onSelect: (option: Option) => void\n active?: boolean\n disabled?: boolean\n error?: string | boolean\n focus?: boolean\n hover?: boolean\n required?: boolean\n dropdownValue?: string\n inputValue?: string\n}\n\nexport const PhoneInput: React.ForwardRefExoticComponent<\n PhoneInputProps & { ref?: React.Ref<HTMLInputElement> }\n> = React.forwardRef(\n (\n {\n className,\n options,\n disabled,\n error,\n focus,\n hover,\n required,\n onSelect,\n dropdownValue,\n inputValue,\n ...rest\n },\n forwardedRef\n ) => {\n if (options.length === 0) {\n throw new Error(\n \"Palette PhoneInput requires at least 1 option in the options prop\"\n )\n }\n\n const inputRef = useRef<HTMLInputElement | null>(null)\n const searchInputRef = useRef<HTMLInputElement | null>(null)\n const containerRef = useRef<HTMLDivElement | null>(null)\n const countryPickerRef = useRef<HTMLDivElement | null>(null)\n\n const defaultOption = useMemo(\n () =>\n dropdownValue &&\n options.find((option) => option.value === dropdownValue),\n [dropdownValue, options]\n )\n\n const [boxProps, inputProps] = splitBoxProps(rest)\n const [isDropdownVisible, setDropdownVisible] = useState(false)\n const [searchQuery, setSearchQuery] = useState(\"\")\n const [selectedOption, setSelectedOption] = useState(\n defaultOption || options[0]\n )\n\n const filteredOptions = options.filter((option) => {\n if (searchQuery !== \"\") {\n const filteredCountry =\n option.text.toLowerCase().includes(searchQuery.toLowerCase()) ||\n option.name.toLowerCase().includes(searchQuery.toLowerCase())\n return filteredCountry\n }\n return true\n })\n\n const { anchorRef, tooltipRef } = usePosition({\n key: filteredOptions.length,\n position: \"bottom\",\n offset: 10,\n active: isDropdownVisible,\n flip: false,\n })\n\n const { reset, set } = useKeyboardListNavigation({\n ref: containerRef,\n list: filteredOptions,\n waitForInteractive: true,\n onEnter: ({ element: option, event }) => {\n event.preventDefault()\n event.stopPropagation()\n if (option) {\n handleSelect(option)\n }\n resetUI()\n },\n })\n\n const { width } = useWidthOf({ ref: anchorRef })\n\n const inputName = inputProps.name || \"palette-phone-input\"\n\n const optionsWithRefs = useMemo(() => {\n return filteredOptions.map((option) => ({\n option,\n ref: createRef<HTMLDivElement>(),\n }))\n }, [filteredOptions])\n\n const resetUI = () => {\n setTimeout(() => {\n inputRef.current?.focus()\n reset()\n setDropdownVisible(false)\n }, 100)\n }\n\n const handleSelect = (option: Option) => {\n inputRef.current?.focus()\n setSearchQuery(\"\")\n setSelectedOption(option)\n setDropdownVisible(false)\n onSelect?.(option)\n }\n\n const handleFocusChange = useCallback(\n (focused: boolean) => {\n if (focused || !isDropdownVisible) return\n\n setDropdownVisible(false)\n },\n [isDropdownVisible]\n )\n\n // Handle closing the dropdown when clicking outside of the input\n // or when focus leaves the input completely\n const { ref: containsFocusRef } = useContainsFocus({\n onChange: handleFocusChange,\n })\n\n const handleCountryPickerKeydown = (\n event: React.KeyboardEvent<HTMLDivElement>\n ) => {\n switch (event.key) {\n case \"Escape\":\n event.preventDefault()\n event.stopPropagation()\n\n setDropdownVisible(false)\n countryPickerRef.current?.blur()\n reset()\n\n return\n\n case \"Enter\":\n case \" \":\n event.preventDefault()\n event.stopPropagation()\n\n if (!disabled) {\n setDropdownVisible(true)\n }\n return\n }\n }\n\n const handleSearchInputKeydown = (\n event: React.KeyboardEvent<HTMLInputElement>\n ) => {\n switch (event.key) {\n case \"Tab\":\n if (event.shiftKey) {\n // ignore\n } else {\n // move down to the list\n event.preventDefault()\n event.stopPropagation()\n reset()\n\n set({ cursor: 0, interactive: true })\n }\n return\n\n case \"Enter\":\n event.preventDefault()\n event.stopPropagation()\n if (filteredOptions.length) {\n handleSelect(filteredOptions[0])\n }\n return\n\n default:\n searchInputRef.current?.focus()\n }\n }\n\n return (\n <Box\n ref={composeRefs(containerRef, containsFocusRef) as any}\n width=\"100%\"\n className={className}\n {...boxProps}\n >\n <ContainerBox\n ref={anchorRef as any}\n isDropdownVisible={isDropdownVisible}\n hover={hover}\n focus={focus}\n error={error}\n disabled={disabled}\n placeholder={inputProps.placeholder}\n >\n <SelectContainer\n data-testid=\"country-picker\"\n ref={countryPickerRef as any}\n disabled={disabled}\n onClick={() => {\n setDropdownVisible(!disabled && !isDropdownVisible)\n }}\n tabIndex={disabled ? -1 : 0}\n onKeyDown={handleCountryPickerKeydown}\n >\n {selectedOption.text}\n </SelectContainer>\n\n <StyledInput\n disabled={disabled}\n ref={composeRefs(inputRef, forwardedRef) as any}\n type=\"tel\"\n autoComplete=\"tel-national\"\n required={required}\n name={inputName}\n maxLength={25}\n placeholder={inputProps.placeholder}\n value={inputValue}\n {...inputProps}\n />\n\n <StyledLabel htmlFor={inputName}>Phone Number</StyledLabel>\n </ContainerBox>\n\n {isDropdownVisible && (\n <SelectDropdown ref={tooltipRef as any} role=\"listbox\" width={width}>\n <Input\n ref={searchInputRef}\n p={1}\n pb={0}\n autoFocus\n placeholder=\"Search\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n onKeyDown={handleSearchInputKeydown}\n />\n\n <SelectOptions>\n {optionsWithRefs.map(({ option, ref }, i) => {\n return (\n <SelectOption\n key={i}\n ref={ref as any}\n role=\"option\"\n aria-selected={option.value === selectedOption.value}\n aria-posinset={i + 1}\n aria-setsize={options.length}\n selected={option.value === selectedOption.value}\n onClick={() => handleSelect(option)}\n tabIndex={-1}\n >\n <Text minWidth={80}>{option.text}</Text>\n <Text>{option.name}</Text>\n </SelectOption>\n )\n })}\n </SelectOptions>\n </SelectDropdown>\n )}\n\n {required && !(error && typeof error === \"string\") && (\n <RequiredField mt={0.5} ml={1} />\n )}\n\n {error && typeof error === \"string\" && (\n <Text variant=\"xs\" mt={0.5} mr={1} color=\"red100\" textAlign=\"right\">\n {error}\n </Text>\n )}\n </Box>\n )\n }\n)\n\nPhoneInput.displayName = \"PhoneInput\"\n\nconst caretMixin = css`\n &::after {\n content: \"\";\n cursor: inherit;\n width: 0;\n height: 0;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: ${themeGet(\"space.1\")};\n pointer-events: none;\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-top: 4px solid\n ${({ disabled }) => {\n return disabled\n ? themeGet(\"colors.black10\")\n : themeGet(\"colors.black60\")\n }};\n }\n`\n\ntype ContainerProps = Pick<\n PhoneInputProps,\n \"disabled\" | \"error\" | \"hover\" | \"focus\" | \"placeholder\"\n> & { isDropdownVisible: boolean }\n\nconst ContainerBox = styled(Box)<ContainerProps>`\n position: relative;\n display: flex;\n flex-direction: row;\n\n ${(props) => {\n return css`\n ${PHONE_INPUT_STATES.default}\n ${props.hover && PHONE_INPUT_STATES.hover}\n ${(props.focus || props.isDropdownVisible) && PHONE_INPUT_STATES.focus}\n ${props.disabled && PHONE_INPUT_STATES.disabled}\n ${props.error && PHONE_INPUT_STATES.error}\n\n &:hover {\n /* Applies hover style if the dropdown is not visible or the input is disabled */\n ${!props.isDropdownVisible &&\n !props.disabled &&\n PHONE_INPUT_STATES.hover}\n }\n\n &:focus-within {\n ${!props.disabled && PHONE_INPUT_STATES.focus}\n\n &:has(input:not(:placeholder-shown)) {\n ${PHONE_INPUT_STATES.active}\n ${props.error && PHONE_INPUT_STATES.error};\n }\n }\n\n &:has(input:not(:placeholder-shown)) {\n ${!!props.placeholder && PHONE_INPUT_STATES.completed}\n ${props.error && PHONE_INPUT_STATES.error};\n }\n `\n }}\n`\n\nconst SelectContainer = styled(Box)<{ disabled?: boolean }>`\n display: flex;\n align-items: center;\n position: relative;\n min-width: 120px;\n border: 1px solid;\n border-right: 0;\n /* 24px = space.1 + 4px-wide caret + space.1 */\n padding: 0 24px 0 ${themeGet(\"space.1\")};\n font-family: ${themeGet(\"fonts.sans\")};\n border-radius: 3px 0 0 3px;\n border-color: ${themeGet(\"colors.black30\")};\n cursor: pointer;\n line-height: 1;\n transition: color 0.25s, border-color 0.25s;\n height: 50px;\n font-size: ${themeGet(\"textVariants.sm-display.fontSize\")};\n color: ${themeGet(\"colors.black100\")};\n\n ${caretMixin}\n`\n\nconst SelectDropdown = styled(Box)`\n box-shadow: ${DROP_SHADOW};\n z-index: 1;\n background: ${themeGet(\"colors.white100\")};\n`\n\nconst SelectOptions = styled(Box)`\n /* 308 = Roughly, 5.5 default sized options */\n max-height: 308px;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n padding: ${themeGet(\"space.1\")};\n`\n\nconst SelectOption = styled(Box)<{ selected?: boolean }>`\n padding: ${themeGet(\"space.1\")} 0;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n align-items: center;\n text-decoration: none;\n color: ${themeGet(\"colors.black60\")};\n transition: color 0.25s, text-decoration 0.25s;\n\n &:hover {\n color: ${themeGet(\"colors.blue100\")};\n text-decoration: underline;\n }\n\n &:focus,\n &:active {\n color: ${themeGet(\"colors.black100\")};\n text-decoration: none;\n }\n\n ${(props) =>\n props.selected &&\n css`\n color: ${themeGet(\"colors.black100\")};\n text-decoration: none;\n `}\n`\n\nconst StyledInput = styled.input`\n width: 100%;\n padding: 0 ${themeGet(\"space.1\")};\n appearance: none;\n outline: none;\n line-height: 1;\n border: 1px solid;\n border-radius: 0 3px 3px 0;\n transition: color 0.25s, border-color 0.25s;\n font-family: ${themeGet(\"fonts.sans\")};\n font-size: ${themeGet(\"textVariants.sm-display.fontSize\")};\n color: ${themeGet(\"colors.black100\")};\n border-color: ${themeGet(\"colors.black30\")};\n ${systemHeight}\n\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus {\n -webkit-box-shadow: 0 0 0px 100px ${themeGet(\"colors.white100\")} inset;\n }\n\n ::placeholder {\n color: ${themeGet(\"colors.black60\")};\n transition: color 0.25s;\n }\n`\n\nconst StyledLabel = styled.label`\n position: absolute;\n top: 0;\n left: 5px;\n padding: 0 5px;\n background-color: ${themeGet(\"colors.white100\")};\n transform: translateY(-50%);\n transition: color 0.25s;\n font-family: ${themeGet(\"fonts.sans\")};\n pointer-events: none;\n font-size: ${themeGet(\"textVariants.xs.fontSize\")};\n color: ${themeGet(\"colors.black60\")};\n`\n"],"mappings":";;;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAD,uBAAA,CAAAH,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,IAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,KAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,0BAAA,GAAAZ,OAAA;AACA,IAAAa,cAAA,GAAAb,OAAA;AAA0D,IAAAc,SAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAb,wBAAAiB,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA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AGhC,IAAAA,kBAAQ,EAAC,YAAY,CAAC,EAExB,IAAAA,kBAAQ,EAAC,0BAA0B,CAAC,EACxC,IAAAA,kBAAQ,EAAC,gBAAgB,CAAC,CACpC"}
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ title: string;
3
+ };
4
+ export default _default;
5
+ export declare const Default: () => JSX.Element;
@@ -0,0 +1,207 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.Default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _storybookStates = require("storybook-states");
9
+ var _PhoneInput = require("./PhoneInput");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ var _default = {
12
+ title: "Components/PhoneInput"
13
+ };
14
+ exports.default = _default;
15
+ var countriesExample = [{
16
+ text: "🇦🇫 +93",
17
+ name: "Afghanistan",
18
+ value: "af",
19
+ countryCode: "+93",
20
+ flag: "🇦🇫"
21
+ }, {
22
+ text: "🇦🇽 +358",
23
+ name: "Aland Islands",
24
+ value: "ax",
25
+ countryCode: "+358",
26
+ flag: "🇦🇽"
27
+ }, {
28
+ text: "🇦🇱 +355",
29
+ name: "Albania",
30
+ value: "al",
31
+ countryCode: "+355",
32
+ flag: "🇦🇱"
33
+ }, {
34
+ text: "🇩🇿 +213",
35
+ name: "Algeria",
36
+ value: "dz",
37
+ countryCode: "+213",
38
+ flag: "🇩🇿"
39
+ }, {
40
+ text: "🇦🇸 +1684",
41
+ name: "American Samoa",
42
+ value: "as",
43
+ countryCode: "+1684",
44
+ flag: "🇦🇸"
45
+ }, {
46
+ text: "🇦🇩 +376",
47
+ name: "Andorra",
48
+ value: "ad",
49
+ countryCode: "+376",
50
+ flag: "🇦🇩"
51
+ }, {
52
+ text: "🇦🇴 +244",
53
+ name: "Angola",
54
+ value: "ao",
55
+ countryCode: "+244",
56
+ flag: "🇦🇴"
57
+ }, {
58
+ text: "🇦🇮 +1264",
59
+ name: "Anguilla",
60
+ value: "ai",
61
+ countryCode: "+1264",
62
+ flag: "🇦🇮"
63
+ }, {
64
+ text: "🇦🇶 +672",
65
+ name: "Antarctica",
66
+ value: "aq",
67
+ countryCode: "+672",
68
+ flag: "🇦🇶"
69
+ }, {
70
+ text: "🇦🇬 +1268",
71
+ name: "Antigua and Barbuda",
72
+ value: "ag",
73
+ countryCode: "+1268",
74
+ flag: "🇦🇬"
75
+ }, {
76
+ text: "🇦🇷 +54",
77
+ name: "Argentina",
78
+ value: "ar",
79
+ countryCode: "+54",
80
+ flag: "🇦🇷"
81
+ }, {
82
+ text: "🇦🇲 +374",
83
+ name: "Armenia",
84
+ value: "am",
85
+ countryCode: "+374",
86
+ flag: "🇦🇲"
87
+ }, {
88
+ text: "🇦🇼 +297",
89
+ name: "Aruba",
90
+ value: "aw",
91
+ countryCode: "+297",
92
+ flag: "🇦🇼"
93
+ }, {
94
+ text: "🇦🇺 +61",
95
+ name: "Australia",
96
+ value: "au",
97
+ countryCode: "+61",
98
+ flag: "🇦🇺"
99
+ }, {
100
+ text: "🇦🇹 +43",
101
+ name: "Austria",
102
+ value: "at",
103
+ countryCode: "+43",
104
+ flag: "🇦🇹"
105
+ }, {
106
+ text: "🇦🇿 +994",
107
+ name: "Azerbaijan",
108
+ value: "az",
109
+ countryCode: "+994",
110
+ flag: "🇦🇿"
111
+ }, {
112
+ text: "🇧🇸 +1242",
113
+ name: "Bahamas",
114
+ value: "bs",
115
+ countryCode: "+1242",
116
+ flag: "🇧🇸"
117
+ }, {
118
+ text: "🇧🇭 +973",
119
+ name: "Bahrain",
120
+ value: "bh",
121
+ countryCode: "+973",
122
+ flag: "🇧🇭"
123
+ }, {
124
+ text: "🇧🇩 +880",
125
+ name: "Bangladesh",
126
+ value: "bd",
127
+ countryCode: "+880",
128
+ flag: "🇧🇩"
129
+ }, {
130
+ text: "🇧🇧 +1246",
131
+ name: "Barbados",
132
+ value: "bb",
133
+ countryCode: "+1246",
134
+ flag: "🇧🇧"
135
+ }, {
136
+ text: "🇧🇾 +375",
137
+ name: "Belarus",
138
+ value: "by",
139
+ countryCode: "+375",
140
+ flag: "🇧🇾"
141
+ }, {
142
+ text: "🇧🇪 +32",
143
+ name: "Belgium",
144
+ value: "be",
145
+ countryCode: "+32",
146
+ flag: "🇧🇪"
147
+ }, {
148
+ text: "🇧🇿 +501",
149
+ name: "Belize",
150
+ value: "bz",
151
+ countryCode: "+501",
152
+ flag: "🇧🇿"
153
+ }, {
154
+ text: "🇧🇯 +229",
155
+ name: "Benin",
156
+ value: "bj",
157
+ countryCode: "+229",
158
+ flag: "🇧🇯"
159
+ }, {
160
+ text: "🇧🇲 +1441",
161
+ name: "Bermuda",
162
+ value: "bm",
163
+ countryCode: "+1441",
164
+ flag: "🇧🇲"
165
+ }, {
166
+ text: "🇧🇹 +975",
167
+ name: "Bhutan",
168
+ value: "bt",
169
+ countryCode: "+975",
170
+ flag: "🇧🇹"
171
+ }, {
172
+ text: "🇧🇴 +591",
173
+ name: "Bolivia",
174
+ value: "bo",
175
+ countryCode: "+591",
176
+ flag: "🇧🇴"
177
+ }, {
178
+ text: "🇧🇦 +387",
179
+ name: "Bosnia and Herzegovina",
180
+ value: "ba",
181
+ countryCode: "+387",
182
+ flag: "🇧🇦"
183
+ }];
184
+ var Default = function Default() {
185
+ return /*#__PURE__*/_react.default.createElement(_storybookStates.States, {
186
+ states: [{}, {
187
+ placeholder: "(000) 000 0000"
188
+ }, {
189
+ placeholder: "(000) 000 0000",
190
+ required: true
191
+ }, {
192
+ placeholder: "(000) 000 0000",
193
+ disabled: true
194
+ }, {
195
+ placeholder: "(000) 000 0000",
196
+ error: "Something is wrong"
197
+ }]
198
+ }, /*#__PURE__*/_react.default.createElement(_PhoneInput.PhoneInput, {
199
+ options: countriesExample,
200
+ onSelect: function onSelect(option) {
201
+ return console.log(option);
202
+ }
203
+ }));
204
+ };
205
+ exports.Default = Default;
206
+ Default.displayName = "Default";
207
+ //# sourceMappingURL=PhoneInput.story.js.map