@cleartrip/ct-design-field 1.1.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 (64) hide show
  1. package/dist/ct-design-field.browser.cjs.js +2 -0
  2. package/dist/ct-design-field.browser.cjs.js.map +1 -0
  3. package/dist/ct-design-field.browser.esm.js +2 -0
  4. package/dist/ct-design-field.browser.esm.js.map +1 -0
  5. package/dist/ct-design-field.cjs.js +347 -0
  6. package/dist/ct-design-field.cjs.js.map +1 -0
  7. package/dist/ct-design-field.esm.js +336 -0
  8. package/dist/ct-design-field.esm.js.map +1 -0
  9. package/dist/ct-design-field.umd.js +1074 -0
  10. package/dist/ct-design-field.umd.js.map +1 -0
  11. package/dist/src/CardField/CardField.d.ts +6 -0
  12. package/dist/src/CardField/CardField.d.ts.map +1 -0
  13. package/dist/src/CardField/index.d.ts +3 -0
  14. package/dist/src/CardField/index.d.ts.map +1 -0
  15. package/dist/src/CardField/type.d.ts +15 -0
  16. package/dist/src/CardField/type.d.ts.map +1 -0
  17. package/dist/src/Field.d.ts +6 -0
  18. package/dist/src/Field.d.ts.map +1 -0
  19. package/dist/src/FieldAction/index.d.ts +5 -0
  20. package/dist/src/FieldAction/index.d.ts.map +1 -0
  21. package/dist/src/FieldAction/type.d.ts +12 -0
  22. package/dist/src/FieldAction/type.d.ts.map +1 -0
  23. package/dist/src/FieldIcon/index.d.ts +5 -0
  24. package/dist/src/FieldIcon/index.d.ts.map +1 -0
  25. package/dist/src/FieldIcon/type.d.ts +8 -0
  26. package/dist/src/FieldIcon/type.d.ts.map +1 -0
  27. package/dist/src/PhoneField/PhoneField.d.ts +6 -0
  28. package/dist/src/PhoneField/PhoneField.d.ts.map +1 -0
  29. package/dist/src/PhoneField/index.d.ts +3 -0
  30. package/dist/src/PhoneField/index.d.ts.map +1 -0
  31. package/dist/src/PhoneField/type.d.ts +10 -0
  32. package/dist/src/PhoneField/type.d.ts.map +1 -0
  33. package/dist/src/PhoneFieldPrefix/index.d.ts +5 -0
  34. package/dist/src/PhoneFieldPrefix/index.d.ts.map +1 -0
  35. package/dist/src/PhoneFieldPrefix/type.d.ts +9 -0
  36. package/dist/src/PhoneFieldPrefix/type.d.ts.map +1 -0
  37. package/dist/src/StyledField/StyledField.d.ts +4 -0
  38. package/dist/src/StyledField/StyledField.d.ts.map +1 -0
  39. package/dist/src/StyledField/index.d.ts +2 -0
  40. package/dist/src/StyledField/index.d.ts.map +1 -0
  41. package/dist/src/StyledField/type.d.ts +7 -0
  42. package/dist/src/StyledField/type.d.ts.map +1 -0
  43. package/dist/src/StyledFieldContainer/StyledFieldContainer.d.ts +7 -0
  44. package/dist/src/StyledFieldContainer/StyledFieldContainer.d.ts.map +1 -0
  45. package/dist/src/StyledFieldContainer/index.d.ts +2 -0
  46. package/dist/src/StyledFieldContainer/index.d.ts.map +1 -0
  47. package/dist/src/StyledFieldContainer/type.d.ts +11 -0
  48. package/dist/src/StyledFieldContainer/type.d.ts.map +1 -0
  49. package/dist/src/StyledFieldPlaceholder/StyledFieldPlaceholder.d.ts +4 -0
  50. package/dist/src/StyledFieldPlaceholder/StyledFieldPlaceholder.d.ts.map +1 -0
  51. package/dist/src/StyledFieldPlaceholder/index.d.ts +2 -0
  52. package/dist/src/StyledFieldPlaceholder/index.d.ts.map +1 -0
  53. package/dist/src/StyledFieldPlaceholder/type.d.ts +6 -0
  54. package/dist/src/StyledFieldPlaceholder/type.d.ts.map +1 -0
  55. package/dist/src/index.d.ts +10 -0
  56. package/dist/src/index.d.ts.map +1 -0
  57. package/dist/src/style.d.ts +81 -0
  58. package/dist/src/style.d.ts.map +1 -0
  59. package/dist/src/type.d.ts +31 -0
  60. package/dist/src/type.d.ts.map +1 -0
  61. package/dist/stats.html +4838 -0
  62. package/dist/stories/Field.stories.d.ts +6 -0
  63. package/dist/stories/Field.stories.d.ts.map +1 -0
  64. package/package.json +46 -0
@@ -0,0 +1,1074 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('react'), require('@cleartrip/ct-design-use-theme'), require('@cleartrip/ct-design-typography'), require('@cleartrip/ct-design-box'), require('@cleartrip/ct-design-container'), require('@cleartrip/ct-design-outside-click-handler'), require('styled-components'), require('@cleartrip/ct-design-common-constants'), require('@cleartrip/ct-design-common-utils')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'react', '@cleartrip/ct-design-use-theme', '@cleartrip/ct-design-typography', '@cleartrip/ct-design-box', '@cleartrip/ct-design-container', '@cleartrip/ct-design-outside-click-handler', 'styled-components', '@cleartrip/ct-design-common-constants', '@cleartrip/ct-design-common-utils'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.CTDesignSystemField = {}, global.require$$1, global.React, global.useTheme, global.ctDesignTypography, global.ctDesignBox, global.ctDesignContainer, global.ctDesignOutsideClickHandler, global.styled, global.ctDesignCommonConstants, global.ctDesignCommonUtils));
5
+ })(this, (function (exports, require$$1, react, useTheme, ctDesignTypography, ctDesignBox, ctDesignContainer, ctDesignOutsideClickHandler, styled, ctDesignCommonConstants, ctDesignCommonUtils) { 'use strict';
6
+
7
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
+
9
+ var require$$1__default = /*#__PURE__*/_interopDefault(require$$1);
10
+ var useTheme__default = /*#__PURE__*/_interopDefault(useTheme);
11
+ var styled__default = /*#__PURE__*/_interopDefault(styled);
12
+
13
+ /******************************************************************************
14
+ Copyright (c) Microsoft Corporation.
15
+
16
+ Permission to use, copy, modify, and/or distribute this software for any
17
+ purpose with or without fee is hereby granted.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
20
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
21
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
22
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
23
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
24
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25
+ PERFORMANCE OF THIS SOFTWARE.
26
+ ***************************************************************************** */
27
+ /* global Reflect, Promise, SuppressedError, Symbol */
28
+
29
+ var extendStatics = function (d, b) {
30
+ extendStatics = Object.setPrototypeOf || {
31
+ __proto__: []
32
+ } instanceof Array && function (d, b) {
33
+ d.__proto__ = b;
34
+ } || function (d, b) {
35
+ for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
36
+ };
37
+ return extendStatics(d, b);
38
+ };
39
+ function __extends(d, b) {
40
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
41
+ extendStatics(d, b);
42
+ function __() {
43
+ this.constructor = d;
44
+ }
45
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
46
+ }
47
+ var __assign = function () {
48
+ __assign = Object.assign || function __assign(t) {
49
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
50
+ s = arguments[i];
51
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
52
+ }
53
+ return t;
54
+ };
55
+ return __assign.apply(this, arguments);
56
+ };
57
+ function __rest(s, e) {
58
+ var t = {};
59
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
60
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
61
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
62
+ }
63
+ return t;
64
+ }
65
+ function __decorate(decorators, target, key, desc) {
66
+ var c = arguments.length,
67
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
68
+ d;
69
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
70
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
71
+ }
72
+ function __param(paramIndex, decorator) {
73
+ return function (target, key) {
74
+ decorator(target, key, paramIndex);
75
+ };
76
+ }
77
+ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
78
+ function accept(f) {
79
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
80
+ return f;
81
+ }
82
+ var kind = contextIn.kind,
83
+ key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
84
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
85
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
86
+ var _,
87
+ done = false;
88
+ for (var i = decorators.length - 1; i >= 0; i--) {
89
+ var context = {};
90
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
91
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
92
+ context.addInitializer = function (f) {
93
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
94
+ extraInitializers.push(accept(f || null));
95
+ };
96
+ var result = (0, decorators[i])(kind === "accessor" ? {
97
+ get: descriptor.get,
98
+ set: descriptor.set
99
+ } : descriptor[key], context);
100
+ if (kind === "accessor") {
101
+ if (result === void 0) continue;
102
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
103
+ if (_ = accept(result.get)) descriptor.get = _;
104
+ if (_ = accept(result.set)) descriptor.set = _;
105
+ if (_ = accept(result.init)) initializers.unshift(_);
106
+ } else if (_ = accept(result)) {
107
+ if (kind === "field") initializers.unshift(_);else descriptor[key] = _;
108
+ }
109
+ }
110
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
111
+ done = true;
112
+ }
113
+ function __runInitializers(thisArg, initializers, value) {
114
+ var useValue = arguments.length > 2;
115
+ for (var i = 0; i < initializers.length; i++) {
116
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
117
+ }
118
+ return useValue ? value : void 0;
119
+ }
120
+ function __propKey(x) {
121
+ return typeof x === "symbol" ? x : "".concat(x);
122
+ }
123
+ function __setFunctionName(f, name, prefix) {
124
+ if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
125
+ return Object.defineProperty(f, "name", {
126
+ configurable: true,
127
+ value: prefix ? "".concat(prefix, " ", name) : name
128
+ });
129
+ }
130
+ function __metadata(metadataKey, metadataValue) {
131
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
132
+ }
133
+ function __awaiter(thisArg, _arguments, P, generator) {
134
+ function adopt(value) {
135
+ return value instanceof P ? value : new P(function (resolve) {
136
+ resolve(value);
137
+ });
138
+ }
139
+ return new (P || (P = Promise))(function (resolve, reject) {
140
+ function fulfilled(value) {
141
+ try {
142
+ step(generator.next(value));
143
+ } catch (e) {
144
+ reject(e);
145
+ }
146
+ }
147
+ function rejected(value) {
148
+ try {
149
+ step(generator["throw"](value));
150
+ } catch (e) {
151
+ reject(e);
152
+ }
153
+ }
154
+ function step(result) {
155
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
156
+ }
157
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
158
+ });
159
+ }
160
+ function __generator(thisArg, body) {
161
+ var _ = {
162
+ label: 0,
163
+ sent: function () {
164
+ if (t[0] & 1) throw t[1];
165
+ return t[1];
166
+ },
167
+ trys: [],
168
+ ops: []
169
+ },
170
+ f,
171
+ y,
172
+ t,
173
+ g;
174
+ return g = {
175
+ next: verb(0),
176
+ "throw": verb(1),
177
+ "return": verb(2)
178
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
179
+ return this;
180
+ }), g;
181
+ function verb(n) {
182
+ return function (v) {
183
+ return step([n, v]);
184
+ };
185
+ }
186
+ function step(op) {
187
+ if (f) throw new TypeError("Generator is already executing.");
188
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
189
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
190
+ if (y = 0, t) op = [op[0] & 2, t.value];
191
+ switch (op[0]) {
192
+ case 0:
193
+ case 1:
194
+ t = op;
195
+ break;
196
+ case 4:
197
+ _.label++;
198
+ return {
199
+ value: op[1],
200
+ done: false
201
+ };
202
+ case 5:
203
+ _.label++;
204
+ y = op[1];
205
+ op = [0];
206
+ continue;
207
+ case 7:
208
+ op = _.ops.pop();
209
+ _.trys.pop();
210
+ continue;
211
+ default:
212
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
213
+ _ = 0;
214
+ continue;
215
+ }
216
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
217
+ _.label = op[1];
218
+ break;
219
+ }
220
+ if (op[0] === 6 && _.label < t[1]) {
221
+ _.label = t[1];
222
+ t = op;
223
+ break;
224
+ }
225
+ if (t && _.label < t[2]) {
226
+ _.label = t[2];
227
+ _.ops.push(op);
228
+ break;
229
+ }
230
+ if (t[2]) _.ops.pop();
231
+ _.trys.pop();
232
+ continue;
233
+ }
234
+ op = body.call(thisArg, _);
235
+ } catch (e) {
236
+ op = [6, e];
237
+ y = 0;
238
+ } finally {
239
+ f = t = 0;
240
+ }
241
+ if (op[0] & 5) throw op[1];
242
+ return {
243
+ value: op[0] ? op[1] : void 0,
244
+ done: true
245
+ };
246
+ }
247
+ }
248
+ var __createBinding = Object.create ? function (o, m, k, k2) {
249
+ if (k2 === undefined) k2 = k;
250
+ var desc = Object.getOwnPropertyDescriptor(m, k);
251
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
252
+ desc = {
253
+ enumerable: true,
254
+ get: function () {
255
+ return m[k];
256
+ }
257
+ };
258
+ }
259
+ Object.defineProperty(o, k2, desc);
260
+ } : function (o, m, k, k2) {
261
+ if (k2 === undefined) k2 = k;
262
+ o[k2] = m[k];
263
+ };
264
+ function __exportStar(m, o) {
265
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
266
+ }
267
+ function __values(o) {
268
+ var s = typeof Symbol === "function" && Symbol.iterator,
269
+ m = s && o[s],
270
+ i = 0;
271
+ if (m) return m.call(o);
272
+ if (o && typeof o.length === "number") return {
273
+ next: function () {
274
+ if (o && i >= o.length) o = void 0;
275
+ return {
276
+ value: o && o[i++],
277
+ done: !o
278
+ };
279
+ }
280
+ };
281
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
282
+ }
283
+ function __read(o, n) {
284
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
285
+ if (!m) return o;
286
+ var i = m.call(o),
287
+ r,
288
+ ar = [],
289
+ e;
290
+ try {
291
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
292
+ } catch (error) {
293
+ e = {
294
+ error: error
295
+ };
296
+ } finally {
297
+ try {
298
+ if (r && !r.done && (m = i["return"])) m.call(i);
299
+ } finally {
300
+ if (e) throw e.error;
301
+ }
302
+ }
303
+ return ar;
304
+ }
305
+
306
+ /** @deprecated */
307
+ function __spread() {
308
+ for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
309
+ return ar;
310
+ }
311
+
312
+ /** @deprecated */
313
+ function __spreadArrays() {
314
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
315
+ for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
316
+ return r;
317
+ }
318
+ function __spreadArray(to, from, pack) {
319
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
320
+ if (ar || !(i in from)) {
321
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
322
+ ar[i] = from[i];
323
+ }
324
+ }
325
+ return to.concat(ar || Array.prototype.slice.call(from));
326
+ }
327
+ function __await(v) {
328
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
329
+ }
330
+ function __asyncGenerator(thisArg, _arguments, generator) {
331
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
332
+ var g = generator.apply(thisArg, _arguments || []),
333
+ i,
334
+ q = [];
335
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {
336
+ return this;
337
+ }, i;
338
+ function verb(n) {
339
+ if (g[n]) i[n] = function (v) {
340
+ return new Promise(function (a, b) {
341
+ q.push([n, v, a, b]) > 1 || resume(n, v);
342
+ });
343
+ };
344
+ }
345
+ function resume(n, v) {
346
+ try {
347
+ step(g[n](v));
348
+ } catch (e) {
349
+ settle(q[0][3], e);
350
+ }
351
+ }
352
+ function step(r) {
353
+ r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
354
+ }
355
+ function fulfill(value) {
356
+ resume("next", value);
357
+ }
358
+ function reject(value) {
359
+ resume("throw", value);
360
+ }
361
+ function settle(f, v) {
362
+ if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
363
+ }
364
+ }
365
+ function __asyncDelegator(o) {
366
+ var i, p;
367
+ return i = {}, verb("next"), verb("throw", function (e) {
368
+ throw e;
369
+ }), verb("return"), i[Symbol.iterator] = function () {
370
+ return this;
371
+ }, i;
372
+ function verb(n, f) {
373
+ i[n] = o[n] ? function (v) {
374
+ return (p = !p) ? {
375
+ value: __await(o[n](v)),
376
+ done: false
377
+ } : f ? f(v) : v;
378
+ } : f;
379
+ }
380
+ }
381
+ function __asyncValues(o) {
382
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
383
+ var m = o[Symbol.asyncIterator],
384
+ i;
385
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {
386
+ return this;
387
+ }, i);
388
+ function verb(n) {
389
+ i[n] = o[n] && function (v) {
390
+ return new Promise(function (resolve, reject) {
391
+ v = o[n](v), settle(resolve, reject, v.done, v.value);
392
+ });
393
+ };
394
+ }
395
+ function settle(resolve, reject, d, v) {
396
+ Promise.resolve(v).then(function (v) {
397
+ resolve({
398
+ value: v,
399
+ done: d
400
+ });
401
+ }, reject);
402
+ }
403
+ }
404
+ function __makeTemplateObject(cooked, raw) {
405
+ if (Object.defineProperty) {
406
+ Object.defineProperty(cooked, "raw", {
407
+ value: raw
408
+ });
409
+ } else {
410
+ cooked.raw = raw;
411
+ }
412
+ return cooked;
413
+ }
414
+ var __setModuleDefault = Object.create ? function (o, v) {
415
+ Object.defineProperty(o, "default", {
416
+ enumerable: true,
417
+ value: v
418
+ });
419
+ } : function (o, v) {
420
+ o["default"] = v;
421
+ };
422
+ function __importStar(mod) {
423
+ if (mod && mod.__esModule) return mod;
424
+ var result = {};
425
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
426
+ __setModuleDefault(result, mod);
427
+ return result;
428
+ }
429
+ function __importDefault(mod) {
430
+ return mod && mod.__esModule ? mod : {
431
+ default: mod
432
+ };
433
+ }
434
+ function __classPrivateFieldGet(receiver, state, kind, f) {
435
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
436
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
437
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
438
+ }
439
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
440
+ if (kind === "m") throw new TypeError("Private method is not writable");
441
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
442
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
443
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
444
+ }
445
+ function __classPrivateFieldIn(state, receiver) {
446
+ if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object");
447
+ return typeof state === "function" ? receiver === state : state.has(receiver);
448
+ }
449
+ function __addDisposableResource(env, value, async) {
450
+ if (value !== null && value !== void 0) {
451
+ if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
452
+ var dispose;
453
+ if (async) {
454
+ if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
455
+ dispose = value[Symbol.asyncDispose];
456
+ }
457
+ if (dispose === void 0) {
458
+ if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
459
+ dispose = value[Symbol.dispose];
460
+ }
461
+ if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
462
+ env.stack.push({
463
+ value: value,
464
+ dispose: dispose,
465
+ async: async
466
+ });
467
+ } else if (async) {
468
+ env.stack.push({
469
+ async: true
470
+ });
471
+ }
472
+ return value;
473
+ }
474
+ var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
475
+ var e = new Error(message);
476
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
477
+ };
478
+ function __disposeResources(env) {
479
+ function fail(e) {
480
+ env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
481
+ env.hasError = true;
482
+ }
483
+ function next() {
484
+ while (env.stack.length) {
485
+ var rec = env.stack.pop();
486
+ try {
487
+ var result = rec.dispose && rec.dispose.call(rec.value);
488
+ if (rec.async) return Promise.resolve(result).then(next, function (e) {
489
+ fail(e);
490
+ return next();
491
+ });
492
+ } catch (e) {
493
+ fail(e);
494
+ }
495
+ }
496
+ if (env.hasError) throw env.error;
497
+ }
498
+ return next();
499
+ }
500
+ var tslib_es6 = {
501
+ __extends: __extends,
502
+ __assign: __assign,
503
+ __rest: __rest,
504
+ __decorate: __decorate,
505
+ __param: __param,
506
+ __metadata: __metadata,
507
+ __awaiter: __awaiter,
508
+ __generator: __generator,
509
+ __createBinding: __createBinding,
510
+ __exportStar: __exportStar,
511
+ __values: __values,
512
+ __read: __read,
513
+ __spread: __spread,
514
+ __spreadArrays: __spreadArrays,
515
+ __spreadArray: __spreadArray,
516
+ __await: __await,
517
+ __asyncGenerator: __asyncGenerator,
518
+ __asyncDelegator: __asyncDelegator,
519
+ __asyncValues: __asyncValues,
520
+ __makeTemplateObject: __makeTemplateObject,
521
+ __importStar: __importStar,
522
+ __importDefault: __importDefault,
523
+ __classPrivateFieldGet: __classPrivateFieldGet,
524
+ __classPrivateFieldSet: __classPrivateFieldSet,
525
+ __classPrivateFieldIn: __classPrivateFieldIn,
526
+ __addDisposableResource: __addDisposableResource,
527
+ __disposeResources: __disposeResources
528
+ };
529
+
530
+ var tslib_es6$1 = /*#__PURE__*/Object.freeze({
531
+ __proto__: null,
532
+ __addDisposableResource: __addDisposableResource,
533
+ get __assign () { return __assign; },
534
+ __asyncDelegator: __asyncDelegator,
535
+ __asyncGenerator: __asyncGenerator,
536
+ __asyncValues: __asyncValues,
537
+ __await: __await,
538
+ __awaiter: __awaiter,
539
+ __classPrivateFieldGet: __classPrivateFieldGet,
540
+ __classPrivateFieldIn: __classPrivateFieldIn,
541
+ __classPrivateFieldSet: __classPrivateFieldSet,
542
+ __createBinding: __createBinding,
543
+ __decorate: __decorate,
544
+ __disposeResources: __disposeResources,
545
+ __esDecorate: __esDecorate,
546
+ __exportStar: __exportStar,
547
+ __extends: __extends,
548
+ __generator: __generator,
549
+ __importDefault: __importDefault,
550
+ __importStar: __importStar,
551
+ __makeTemplateObject: __makeTemplateObject,
552
+ __metadata: __metadata,
553
+ __param: __param,
554
+ __propKey: __propKey,
555
+ __read: __read,
556
+ __rest: __rest,
557
+ __runInitializers: __runInitializers,
558
+ __setFunctionName: __setFunctionName,
559
+ __spread: __spread,
560
+ __spreadArray: __spreadArray,
561
+ __spreadArrays: __spreadArrays,
562
+ __values: __values,
563
+ default: tslib_es6
564
+ });
565
+
566
+ var StyledFieldContainer = styled__default.default.div(function (_a) {
567
+ var height = _a.height, borderColor = _a.borderColor, borderWidth = _a.borderWidth, paddingBottom = _a.paddingBottom, paddingTop = _a.paddingTop, theme = _a.theme, backgroundColor = _a.backgroundColor, cursor = _a.cursor, css = _a.css;
568
+ return (__assign({ height: height, borderColor: borderColor, borderWidth: borderWidth, borderStyle: theme.border.style.solid, borderRadius: theme.border.radius[8], paddingBottom: paddingBottom, paddingTop: paddingTop, paddingLeft: theme.spacing[4], paddingRight: theme.spacing[4], backgroundColor: backgroundColor, cursor: "".concat(cursor, " !important"), boxSizing: 'border-box', position: 'relative', display: 'flex', alignItems: 'center' }, css));
569
+ });
570
+
571
+ var StyledFieldPlaceholder = styled__default.default.label(function (_a) {
572
+ var position = _a.position, cursor = _a.cursor;
573
+ return ({
574
+ position: position || 'absolute',
575
+ display: 'flex',
576
+ alignItems: 'center',
577
+ transition: 'position 1s ease-in-out',
578
+ cursor: "".concat(cursor, " !important"),
579
+ });
580
+ });
581
+
582
+ var StyledField = styled__default.default.input(function (_a) {
583
+ var theme = _a.theme, cursor = _a.cursor, color = _a.color, backgroundColor = _a.backgroundColor;
584
+ return ({
585
+ width: '100%',
586
+ border: 'none',
587
+ outline: 'none',
588
+ backgroundColor: backgroundColor,
589
+ cursor: cursor,
590
+ color: color,
591
+ fontSize: theme.typography.size[16],
592
+ fontWeight: theme.typography.weight.medium,
593
+ lineHeight: theme.typography.lineHeight[24],
594
+ });
595
+ });
596
+
597
+ exports.FieldVariant = void 0;
598
+ (function (FieldVariant) {
599
+ FieldVariant["SM"] = "sm";
600
+ FieldVariant["MD"] = "md";
601
+ })(exports.FieldVariant || (exports.FieldVariant = {}));
602
+ exports.FieldType = void 0;
603
+ (function (FieldType) {
604
+ FieldType["TEXT"] = "text";
605
+ FieldType["NUMBER"] = "number";
606
+ FieldType["PHONE"] = "phone";
607
+ })(exports.FieldType || (exports.FieldType = {}));
608
+
609
+ var getFieldContainerBorderStyle = function (_a) {
610
+ var theme = _a.theme, hasError = _a.hasError, focus = _a.focus, disabled = _a.disabled;
611
+ if (hasError) {
612
+ return {
613
+ borderColor: theme.color.border.warning,
614
+ borderWidth: theme.border.width.md,
615
+ };
616
+ }
617
+ if (focus && !disabled) {
618
+ return {
619
+ borderColor: theme.color.border.primary,
620
+ borderWidth: theme.border.width.md,
621
+ };
622
+ }
623
+ return {
624
+ borderColor: theme.color.border.disabledDark,
625
+ borderWidth: theme.border.width.sm,
626
+ };
627
+ };
628
+ var getFieldContainerSpacingAndHeight = function (_a) {
629
+ var theme = _a.theme, variant = _a.variant, focus = _a.focus, value = _a.value;
630
+ var isFieldNotEmpty = focus || value.length > 0;
631
+ switch (variant) {
632
+ case exports.FieldVariant.SM: {
633
+ return {
634
+ height: theme.size[10],
635
+ paddingTop: theme.spacing[2],
636
+ paddingBottom: theme.spacing[2],
637
+ };
638
+ }
639
+ case exports.FieldVariant.MD: {
640
+ return {
641
+ height: theme.size[14],
642
+ paddingTop: isFieldNotEmpty ? theme.spacing[2] : theme.spacing[4],
643
+ paddingBottom: isFieldNotEmpty ? theme.spacing[2] : theme.spacing[4],
644
+ };
645
+ }
646
+ default: {
647
+ return {
648
+ height: theme.size[14],
649
+ paddingTop: isFieldNotEmpty ? theme.spacing[2] : theme.spacing[4],
650
+ paddingBottom: isFieldNotEmpty ? theme.spacing[2] : theme.spacing[4],
651
+ };
652
+ }
653
+ }
654
+ };
655
+ var getFieldContainerStyles = function (_a) {
656
+ var variant = _a.variant, hasError = _a.hasError, theme = _a.theme, focus = _a.focus, _b = _a.value, value = _b === void 0 ? '' : _b, disabled = _a.disabled;
657
+ var fieldContainerBorderStyle = getFieldContainerBorderStyle({
658
+ theme: theme,
659
+ hasError: hasError,
660
+ focus: focus,
661
+ disabled: disabled,
662
+ });
663
+ var fieldContainerSpacingAndHeight = getFieldContainerSpacingAndHeight({
664
+ theme: theme,
665
+ variant: variant,
666
+ focus: focus,
667
+ value: value,
668
+ });
669
+ return __assign(__assign(__assign({}, fieldContainerBorderStyle), fieldContainerSpacingAndHeight), { backgroundColor: disabled ? theme.color.background.disabled : theme.color.background.neutral, cursor: disabled ? 'not-allowed' : 'auto' });
670
+ };
671
+ var getFieldPlaceholderStyles = function (_a) {
672
+ var isFocused = _a.isFocused, disabled = _a.disabled, variant = _a.variant, fieldType = _a.fieldType;
673
+ var fieldPlaceholderStyles = {
674
+ cursor: disabled ? 'not-allowed' : 'auto',
675
+ };
676
+ if (variant === exports.FieldVariant.SM || fieldType === exports.FieldType.PHONE) {
677
+ return fieldPlaceholderStyles;
678
+ }
679
+ if (isFocused) {
680
+ fieldPlaceholderStyles = __assign(__assign({}, fieldPlaceholderStyles), { position: 'relative', display: 'block' });
681
+ }
682
+ return fieldPlaceholderStyles;
683
+ };
684
+ var getFieldStyles = function (_a) {
685
+ var disabled = _a.disabled, theme = _a.theme;
686
+ return {
687
+ cursor: disabled ? 'not-allowed' : 'auto',
688
+ color: disabled ? theme.color.text.disabled : theme.color.text.primary,
689
+ backgroundColor: disabled ? theme.color.background.disabled : 'transparent',
690
+ };
691
+ };
692
+
693
+ var Field = react.forwardRef(function (_a, forwardedRef) {
694
+ var _b = _a.value, value = _b === void 0 ? '' : _b, _c = _a.placeholder, placeholder = _c === void 0 ? '' : _c, onChange = _a.onChange, prefix = _a.prefix, suffix = _a.suffix, _d = _a.variant, variant = _d === void 0 ? exports.FieldVariant.MD : _d, _e = _a.type, type = _e === void 0 ? exports.FieldType.TEXT : _e, prompt = _a.prompt, _f = _a.disabled, disabled = _f === void 0 ? false : _f, prefixGap = _a.prefixGap, suffixGap = _a.suffixGap, css = _a.css, id = _a.id, autoFocus = _a.autoFocus, rootCss = _a.rootCss, rest = __rest(_a, ["value", "placeholder", "onChange", "prefix", "suffix", "variant", "type", "prompt", "disabled", "prefixGap", "suffixGap", "css", "id", "autoFocus", "rootCss"]);
695
+ var theme = useTheme__default.default();
696
+ var _g = react.useState(autoFocus || false), focus = _g[0], setFocus = _g[1];
697
+ var _h = prompt || {}, _j = _h.hasError, hasError = _j === void 0 ? false : _j, promptIcon = _h.Icon, promptMessage = _h.message;
698
+ var isFocused = focus || value.length > 0;
699
+ var fieldContainerStyles = getFieldContainerStyles({
700
+ variant: variant,
701
+ theme: theme,
702
+ hasError: hasError,
703
+ focus: focus,
704
+ value: value,
705
+ disabled: disabled,
706
+ });
707
+ var fieldPlaceholderStyles = getFieldPlaceholderStyles({
708
+ isFocused: isFocused,
709
+ disabled: disabled,
710
+ variant: variant,
711
+ fieldType: type,
712
+ });
713
+ var fieldStyles = getFieldStyles({
714
+ disabled: disabled,
715
+ theme: theme,
716
+ });
717
+ var onFieldChange = function (e) {
718
+ var value = e.target.value;
719
+ var isValidValue = true;
720
+ switch (type) {
721
+ case exports.FieldType.NUMBER:
722
+ case exports.FieldType.PHONE: {
723
+ if (value && !ctDesignCommonConstants.ONLY_NUMERIC.test(value)) {
724
+ isValidValue = false;
725
+ }
726
+ break;
727
+ }
728
+ }
729
+ if (isValidValue) {
730
+ onChange(e);
731
+ }
732
+ };
733
+ var onOutsideClick = function () {
734
+ setFocus(false);
735
+ };
736
+ var onFieldContainerClick = function () {
737
+ if (disabled)
738
+ return;
739
+ setFocus(true);
740
+ };
741
+ var getFieldPlaceholder = function () {
742
+ switch (variant) {
743
+ case exports.FieldVariant.SM: {
744
+ if (!value.length) {
745
+ return (require$$1.jsx(StyledFieldPlaceholder, __assign({}, fieldPlaceholderStyles, { htmlFor: id }, { children: require$$1.jsx(ctDesignTypography.Typography, __assign({ variant: 'B1', color: 'tertiary' }, { children: placeholder })) })));
746
+ }
747
+ break;
748
+ }
749
+ case exports.FieldVariant.MD: {
750
+ if (type === exports.FieldType.PHONE && value.length)
751
+ return;
752
+ return (require$$1.jsx(StyledFieldPlaceholder, __assign({}, fieldPlaceholderStyles, { htmlFor: id }, { children: require$$1.jsx(ctDesignTypography.Typography, __assign({ variant: type === exports.FieldType.PHONE ? 'B1' : isFocused ? 'B3' : 'B1', color: 'tertiary' }, { children: placeholder })) })));
753
+ }
754
+ default: {
755
+ if (type === exports.FieldType.PHONE && value.length)
756
+ return;
757
+ return (require$$1.jsx(StyledFieldPlaceholder, __assign({}, fieldPlaceholderStyles, { htmlFor: id }, { children: require$$1.jsx(ctDesignTypography.Typography, __assign({ variant: type === exports.FieldType.PHONE ? 'B1' : isFocused ? 'B3' : 'B1', color: 'tertiary' }, { children: placeholder })) })));
758
+ }
759
+ }
760
+ };
761
+ return (require$$1.jsxs(ctDesignBox.Box, __assign({ boxSize: 'micro', css: rootCss }, { children: [require$$1.jsx(ctDesignOutsideClickHandler.OutsideClickHandler, __assign({ onOutsideClick: onOutsideClick }, { children: require$$1.jsxs(StyledFieldContainer, __assign({}, fieldContainerStyles, { onClick: onFieldContainerClick, css: css }, { children: [react.isValidElement(prefix) && react.cloneElement(prefix, { focus: focus }), require$$1.jsxs(ctDesignContainer.Container, __assign({ display: isFocused ? 'block' : 'flex', flex: 1, marginLeft: prefix ? prefixGap || theme.spacing[3] : '', marginRight: suffix ? suffixGap || theme.spacing[3] : '' }, { children: [getFieldPlaceholder(), require$$1.jsx(StyledField, __assign({}, fieldStyles, { id: id, value: value, onChange: onFieldChange, autoComplete: 'off', disabled: disabled, ref: forwardedRef, autoFocus: autoFocus }, rest))] })), react.isValidElement(suffix) && react.cloneElement(suffix, { focus: focus })] })) })), (promptIcon || promptMessage) && (require$$1.jsxs(ctDesignBox.Box, __assign({ boxSize: 'pico', horizontal: true, css: {
762
+ paddingLeft: theme.spacing[4],
763
+ paddingRight: theme.spacing[4],
764
+ display: 'flex',
765
+ alignItems: 'center',
766
+ } }, { children: [promptIcon && (require$$1.jsx(ctDesignContainer.Container, __assign({ css: {
767
+ height: theme.size[4],
768
+ width: theme.size[4],
769
+ paddingRight: theme.spacing[1],
770
+ display: 'flex',
771
+ justifyContent: 'center',
772
+ alignItems: 'center',
773
+ } }, { children: promptIcon }))), promptMessage && (require$$1.jsx(ctDesignTypography.Typography, __assign({ variant: 'B3', color: hasError ? 'warning' : 'success' }, { children: promptMessage })))] })))] })));
774
+ });
775
+
776
+ exports.CURSOR_OPERATION = void 0;
777
+ (function (CURSOR_OPERATION) {
778
+ CURSOR_OPERATION["NONE"] = "NONE";
779
+ CURSOR_OPERATION["ADD"] = "ADD";
780
+ CURSOR_OPERATION["SUBSTRACT"] = "SUBSTRACT";
781
+ })(exports.CURSOR_OPERATION || (exports.CURSOR_OPERATION = {}));
782
+
783
+ var CardField = react.forwardRef(function (_a, forwardedRef) {
784
+ var onChange = _a.onChange, _b = _a.gap, gap = _b === void 0 ? 4 : _b, value = _a.value, rest = __rest(_a, ["onChange", "gap", "value"]);
785
+ var cursorRef = react.useRef({
786
+ cursorPos: 0,
787
+ operation: exports.CURSOR_OPERATION.NONE,
788
+ });
789
+ react.useEffect(function () {
790
+ var _a;
791
+ (_a = forwardedRef === null || forwardedRef === void 0 ? void 0 : forwardedRef.current) === null || _a === void 0 ? void 0 : _a.setSelectionRange(cursorRef.current.cursorPos, cursorRef.current.cursorPos);
792
+ cursorRef.current = {
793
+ cursorPos: cursorRef.current.cursorPos,
794
+ operation: exports.CURSOR_OPERATION.NONE,
795
+ };
796
+ }, [value]);
797
+ var onFieldChange = function (e) {
798
+ onChange(ctDesignCommonUtils.removeNonNumerals(ctDesignCommonUtils.removeSpace(e.target.value)));
799
+ var selectionStart = e.target.selectionStart || 0;
800
+ switch (cursorRef.current.operation) {
801
+ case exports.CURSOR_OPERATION.SUBSTRACT: {
802
+ --selectionStart;
803
+ break;
804
+ }
805
+ case exports.CURSOR_OPERATION.ADD: {
806
+ ++selectionStart;
807
+ break;
808
+ }
809
+ }
810
+ cursorRef.current = {
811
+ cursorPos: selectionStart,
812
+ operation: exports.CURSOR_OPERATION.NONE,
813
+ };
814
+ setTimeout(function () {
815
+ var _a;
816
+ (_a = forwardedRef === null || forwardedRef === void 0 ? void 0 : forwardedRef.current) === null || _a === void 0 ? void 0 : _a.setSelectionRange(cursorRef.current.cursorPos, cursorRef.current.cursorPos);
817
+ }, 0);
818
+ };
819
+ var onKeyDown = function (e) {
820
+ var _a;
821
+ var oldValues = ctDesignCommonUtils.removeNonNumerals(ctDesignCommonUtils.removeSpace(e.target.value));
822
+ var cursorOpration = {
823
+ cursorPos: cursorRef.current.cursorPos,
824
+ operation: exports.CURSOR_OPERATION.NONE,
825
+ };
826
+ switch (e.code) {
827
+ case 'Backspace': {
828
+ cursorOpration.operation = exports.CURSOR_OPERATION.NONE;
829
+ break;
830
+ }
831
+ case 'Space': {
832
+ cursorOpration.operation = exports.CURSOR_OPERATION.SUBSTRACT;
833
+ break;
834
+ }
835
+ default: {
836
+ if (oldValues.length % gap === 0) {
837
+ cursorOpration.operation = exports.CURSOR_OPERATION.ADD;
838
+ }
839
+ }
840
+ }
841
+ cursorRef.current = cursorOpration;
842
+ (_a = rest === null || rest === void 0 ? void 0 : rest.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(rest, e);
843
+ };
844
+ return (require$$1.jsx(Field, __assign({}, rest, { type: exports.FieldType.TEXT, ref: forwardedRef, onChange: onFieldChange, onKeyDown: onKeyDown, value: ctDesignCommonUtils.addSpaceAtInterval(value, gap) })));
845
+ });
846
+
847
+ function getAugmentedNamespace(n) {
848
+ if (n.__esModule) return n;
849
+ var f = n.default;
850
+ if (typeof f == "function") {
851
+ var a = function a () {
852
+ if (this instanceof a) {
853
+ var args = [null];
854
+ args.push.apply(args, arguments);
855
+ var Ctor = Function.bind.apply(f, args);
856
+ return new Ctor();
857
+ }
858
+ return f.apply(this, arguments);
859
+ };
860
+ a.prototype = f.prototype;
861
+ } else a = {};
862
+ Object.defineProperty(a, '__esModule', {value: true});
863
+ Object.keys(n).forEach(function (k) {
864
+ var d = Object.getOwnPropertyDescriptor(n, k);
865
+ Object.defineProperty(a, k, d.get ? d : {
866
+ enumerable: true,
867
+ get: function () {
868
+ return n[k];
869
+ }
870
+ });
871
+ });
872
+ return a;
873
+ }
874
+
875
+ var require$$0 = /*@__PURE__*/getAugmentedNamespace(tslib_es6$1);
876
+
877
+ var tslib = require$$0;
878
+ var jsxRuntime = require$$1__default.default;
879
+ var Back = function (_a) {
880
+ var height = _a.height,
881
+ width = _a.width;
882
+ return jsxRuntime.jsxs("svg", tslib.__assign({
883
+ xmlns: 'http://www.w3.org/2000/svg',
884
+ width: width,
885
+ height: height,
886
+ fill: 'none',
887
+ viewBox: '0 0 24 24'
888
+ }, {
889
+ children: [jsxRuntime.jsx("mask", tslib.__assign({
890
+ id: 'mask0_2275_17759',
891
+ style: {
892
+ maskType: 'alpha'
893
+ },
894
+ width: '24',
895
+ height: '24',
896
+ x: '0',
897
+ y: '0',
898
+ maskUnits: 'userSpaceOnUse'
899
+ }, {
900
+ children: jsxRuntime.jsx("path", {
901
+ fill: '#D9D9D9',
902
+ d: 'M0 0H24V24H0z'
903
+ })
904
+ })), jsxRuntime.jsx("g", tslib.__assign({
905
+ mask: 'url(#mask0_2275_17759)'
906
+ }, {
907
+ children: jsxRuntime.jsx("path", {
908
+ fill: '#1C1B1F',
909
+ d: 'M11.1 19.1l-6.45-6.476a.697.697 0 01-.212-.288.922.922 0 010-.675.697.697 0 01.212-.287L11.1 4.9a.822.822 0 01.525-.213c.2-.008.375.063.525.213a.753.753 0 01.025 1.075l-5.3 5.275H18.5c.2 0 .375.07.525.212a.71.71 0 01.225.538.706.706 0 01-.225.537.74.74 0 01-.525.213H6.875l5.3 5.3a.736.736 0 01.212.512.69.69 0 01-.212.538.733.733 0 01-.537.225.734.734 0 01-.538-.225z'
910
+ })
911
+ }))]
912
+ }));
913
+ };
914
+ Back.defaultProps = {
915
+ height: 24,
916
+ width: 24
917
+ };
918
+ var Dustbin = function (_a) {
919
+ var height = _a.height,
920
+ width = _a.width,
921
+ fill = _a.fill;
922
+ return jsxRuntime.jsxs("svg", tslib.__assign({
923
+ xmlns: 'http://www.w3.org/2000/svg',
924
+ width: width,
925
+ height: height,
926
+ fill: 'none',
927
+ viewBox: '0 0 24 24'
928
+ }, {
929
+ children: [jsxRuntime.jsx("mask", tslib.__assign({
930
+ id: 'mask0_906_85730',
931
+ style: {
932
+ maskType: 'alpha'
933
+ },
934
+ width: '24',
935
+ height: '24',
936
+ x: '0',
937
+ y: '0',
938
+ maskUnits: 'userSpaceOnUse'
939
+ }, {
940
+ children: jsxRuntime.jsx("path", {
941
+ fill: '#D9D9D9',
942
+ d: 'M0 0H24V24H0z'
943
+ })
944
+ })), jsxRuntime.jsx("g", tslib.__assign({
945
+ mask: 'url(#mask0_906_85730)'
946
+ }, {
947
+ children: jsxRuntime.jsx("path", {
948
+ fill: fill,
949
+ d: 'M7.3 20.5c-.5 0-.925-.175-1.275-.525A1.736 1.736 0 015.5 18.7V6h-1V4.5H9v-.875h6V4.5h4.5V6h-1v12.7c0 .5-.175.925-.525 1.275-.35.35-.775.525-1.275.525H7.3zM17 6H7v12.7c0 .067.033.133.1.2s.133.1.2.1h9.4c.067 0 .133-.033.2-.1s.1-.133.1-.2V6zM9.4 17h1.5V8H9.4v9zm3.7 0h1.5V8h-1.5v9zM7 6v13V6z'
950
+ })
951
+ }))]
952
+ }));
953
+ };
954
+ Dustbin.defaultProps = {
955
+ height: 24,
956
+ width: 24,
957
+ fill: '#3366CC'
958
+ };
959
+ var FeaturedImages = function (_a) {
960
+ var height = _a.height,
961
+ width = _a.width;
962
+ return jsxRuntime.jsxs("svg", tslib.__assign({
963
+ xmlns: 'http://www.w3.org/2000/svg',
964
+ width: width,
965
+ height: height,
966
+ fill: 'none',
967
+ viewBox: '0 0 24 24'
968
+ }, {
969
+ children: [jsxRuntime.jsx("rect", {
970
+ width: '24',
971
+ height: '24',
972
+ y: '0.234',
973
+ fill: '#FCF7F0',
974
+ opacity: '0.8',
975
+ rx: '2'
976
+ }), jsxRuntime.jsx("mask", tslib.__assign({
977
+ id: 'mask0_1088_279757',
978
+ style: {
979
+ maskType: 'alpha'
980
+ },
981
+ width: '21',
982
+ height: '21',
983
+ x: '1',
984
+ y: '2',
985
+ maskUnits: 'userSpaceOnUse'
986
+ }, {
987
+ children: jsxRuntime.jsx("path", {
988
+ fill: '#D9D9D9',
989
+ d: 'M1.998 2.232H21.998V22.232H1.998z'
990
+ })
991
+ })), jsxRuntime.jsx("g", tslib.__assign({
992
+ mask: 'url(#mask0_1088_279757)'
993
+ }, {
994
+ children: jsxRuntime.jsx("path", {
995
+ fill: '#DF9641',
996
+ d: 'M6.434 20.233l1.461-6.27-4.897-4.23 6.462-.561 2.538-5.939 2.539 5.939 6.461.56-4.897 4.232 1.461 6.27-5.564-3.314-5.564 3.313z'
997
+ })
998
+ }))]
999
+ }));
1000
+ };
1001
+ FeaturedImages.defaultProps = {
1002
+ height: 24,
1003
+ width: 24
1004
+ };
1005
+ var DownChevron = function (_a) {
1006
+ var _b = _a.color,
1007
+ color = _b === void 0 ? '#1A1A1A' : _b,
1008
+ rest = tslib.__rest(_a, ["color"]);
1009
+ return jsxRuntime.jsx("svg", tslib.__assign({
1010
+ xmlns: 'http://www.w3.org/2000/svg',
1011
+ width: '12',
1012
+ height: '12',
1013
+ fill: 'none',
1014
+ viewBox: '0 0 12 12'
1015
+ }, rest, {
1016
+ children: jsxRuntime.jsx("path", {
1017
+ stroke: color,
1018
+ strokeLinecap: 'round',
1019
+ strokeLinejoin: 'round',
1020
+ strokeWidth: '2',
1021
+ d: 'M2 4l4 4 4-4'
1022
+ })
1023
+ }));
1024
+ };
1025
+ var DownChevron_1 = DownChevron;
1026
+
1027
+ var PhoneFieldPrefix = function (_a) {
1028
+ var countryCode = _a.countryCode, _b = _a.disabled, disabled = _b === void 0 ? false : _b, flagIcon = _a.flagIcon, onDropdownClick = _a.onDropdownClick, showDropdownIcon = _a.showDropdownIcon;
1029
+ var theme = useTheme__default.default();
1030
+ var onClick = function () {
1031
+ if (disabled)
1032
+ return;
1033
+ onDropdownClick === null || onDropdownClick === void 0 ? void 0 : onDropdownClick();
1034
+ };
1035
+ return (require$$1.jsxs(ctDesignBox.Box, __assign({ boxSize: 'micro', horizontal: true, css: { alignItems: 'center', justifyContent: 'center', cursor: disabled ? 'not-allowed' : 'pointer' }, onClick: onClick }, { children: [flagIcon && (require$$1.jsx(ctDesignContainer.Container, __assign({ display: 'flex', alignItems: 'center', justifyContent: 'center', height: theme.size[6], width: theme.size[6] }, { children: flagIcon }))), require$$1.jsx(ctDesignTypography.Typography, __assign({ variant: 'B1', color: disabled ? 'disabled' : 'primary', isClickable: true }, { children: countryCode })), showDropdownIcon && require$$1.jsx(DownChevron_1, { color: disabled ? theme.color.text.disabled : theme.color.text.primary })] })));
1036
+ };
1037
+
1038
+ var PhoneField = react.forwardRef(function (_a, forwardedRef) {
1039
+ var max = _a.max, flagIcon = _a.flagIcon, countryCode = _a.countryCode, showDropdownIcon = _a.showDropdownIcon, onChange = _a.onChange, onDropdownClick = _a.onDropdownClick, disabled = _a.disabled, rest = __rest(_a, ["max", "flagIcon", "countryCode", "showDropdownIcon", "onChange", "onDropdownClick", "disabled"]);
1040
+ var onFieldChange = function (event) {
1041
+ var value = event.target.value;
1042
+ if (value.length <= max) {
1043
+ onChange(event);
1044
+ }
1045
+ };
1046
+ return (require$$1.jsx(Field, __assign({}, rest, { type: exports.FieldType.PHONE, ref: forwardedRef, onChange: onFieldChange, disabled: disabled, prefix: require$$1.jsx(PhoneFieldPrefix, { flagIcon: flagIcon, countryCode: countryCode, showDropdownIcon: showDropdownIcon, onDropdownClick: onDropdownClick, disabled: disabled }) })));
1047
+ });
1048
+
1049
+ var FieldIcon = function (_a) {
1050
+ var icon = _a.icon, onClick = _a.onClick, focus = _a.focus, focusedIcon = _a.focusedIcon;
1051
+ var theme = useTheme__default.default();
1052
+ var iconPrefix = icon;
1053
+ if (focus && focusedIcon) {
1054
+ iconPrefix = focusedIcon;
1055
+ }
1056
+ return (require$$1.jsx(ctDesignContainer.Container, __assign({ height: theme.size[6], width: theme.size[6], display: 'flex', alignItems: 'center', justifyContent: 'center', cursor: 'pointer', onClick: onClick }, { children: iconPrefix })));
1057
+ };
1058
+
1059
+ var FieldAction = function (_a) {
1060
+ var _b = _a.actionsList, actionsList = _b === void 0 ? [] : _b;
1061
+ return (require$$1.jsx(ctDesignBox.Box, __assign({ boxSize: 'tiny', horizontal: true }, { children: actionsList.map(function (actionItem) {
1062
+ var _a = actionItem || {}, label = _a.label, color = _a.color, onClick = _a.onClick, isDisabled = _a.isDisabled; _a.isLoading;
1063
+ return (require$$1.jsx(ctDesignTypography.Typography, __assign({ variant: 'HM4', color: isDisabled ? ctDesignTypography.TypographyColor.DISABLED : color, onClick: !isDisabled ? onClick : function () { }, isClickable: true, isDisabled: isDisabled }, { children: label })));
1064
+ }) })));
1065
+ };
1066
+
1067
+ exports.CardField = CardField;
1068
+ exports.FieldAction = FieldAction;
1069
+ exports.FieldIcon = FieldIcon;
1070
+ exports.FieldV2 = Field;
1071
+ exports.PhoneField = PhoneField;
1072
+
1073
+ }));
1074
+ //# sourceMappingURL=ct-design-field.umd.js.map