@alphakits/ui 2.5.5 → 2.5.8

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 (44) hide show
  1. package/dist/amount/component.js +39 -39
  2. package/dist/amount-input/component.js +124 -101
  3. package/dist/amount-input/index.css +1 -1
  4. package/dist/amount-input/index.module.css.js +12 -8
  5. package/dist/amount-input/utils/index.d.ts +5 -0
  6. package/dist/amount-input/utils/index.js +40 -12
  7. package/dist/calendar/components/days-table/index.css +1 -1
  8. package/dist/calendar/components/header/index.css +1 -1
  9. package/dist/calendar/components/months-table/index.css +1 -1
  10. package/dist/calendar/components/select-button/index.css +1 -1
  11. package/dist/calendar/components/years-table/index.css +1 -1
  12. package/dist/calendar/index.css +1 -1
  13. package/dist/calendar-input/index.css +1 -1
  14. package/dist/form/templates/base-form/index.js +8 -8
  15. package/dist/form/templates/filters-form/index.js +13 -13
  16. package/dist/form/templates/rest-form/form.js +28 -28
  17. package/dist/form/templates/rest-form/index.js +12 -12
  18. package/dist/form-control/component.d.ts +8 -0
  19. package/dist/form-control/component.js +49 -28
  20. package/dist/index.js +43 -42
  21. package/dist/input/component.d.ts +4 -0
  22. package/dist/input/component.js +159 -105
  23. package/dist/input/index.css +1 -1
  24. package/dist/input/index.module.css.js +16 -8
  25. package/dist/input/utils/get-default-input-mode.d.ts +3 -0
  26. package/dist/input/utils/get-default-input-mode.js +14 -0
  27. package/dist/input-autocomplete/component.d.ts +4 -0
  28. package/dist/masked-input/component.d.ts +2 -0
  29. package/dist/modal/components/modals/modal.js +59 -51
  30. package/dist/select/component.d.ts +4 -0
  31. package/dist/select/components/arrow/index.css +1 -1
  32. package/dist/select/components/checkmark/index.css +1 -1
  33. package/dist/select/components/field/index.css +1 -1
  34. package/dist/select/components/optgroup/index.css +1 -1
  35. package/dist/select/components/option/index.css +1 -1
  36. package/dist/select/components/options-list/index.css +1 -1
  37. package/dist/select/components/virtual-options-list/index.css +1 -1
  38. package/dist/toast-notifier/component.js +51 -49
  39. package/dist/utils/data/currency-codes.js +2 -2
  40. package/dist/utils/format-amount/util.d.ts +1 -0
  41. package/dist/utils/format-amount/util.js +31 -26
  42. package/dist/utils/index.js +33 -32
  43. package/dist/with-suffix/component.d.ts +2 -0
  44. package/package.json +3 -2
@@ -1,40 +1,45 @@
1
- import { currency as P } from "../data/currency-codes.js";
2
- import { getCurrencySymbol as A } from "../get-currency-symbol/util.js";
3
- import { splitAmount as M } from "../split-amount/util.js";
4
- const S = 3, _ = 4, O = "−", s = " ", u = ",", R = (t) => t ? t.length > 2 ? t.slice(0, 2) : t.length < 2 ? `${t}0` : t : "00", T = (t, o, n) => {
5
- const r = R(t);
6
- return !n && r === "00" ? null : !n && r[1] === "0" ? r.slice(0, 1) : r === "00" && !o ? null : r;
7
- }, p = ({
1
+ import { currency as M } from "../data/currency-codes.js";
2
+ import { getCurrencySymbol as _ } from "../get-currency-symbol/util.js";
3
+ import { splitAmount as C } from "../split-amount/util.js";
4
+ const O = 3, R = 4, T = "−", a = " ", l = ",", S = (t) => t === "EUR" || t === "USD" || t === "CHF" || t === "GBP" || t === "CAD" || t === "AUD" || t === "TRY" || t === "GEL" || t === "ILS" || t === "UAH", U = (t, r, n) => r ? t ? S(n) ? `${r}${a}${t}` : `${t}${a}${r}` : "" : t, E = (t) => t ? t.length > 2 ? t.slice(0, 2) : t.length < 2 ? `${t}0` : t : "00", N = (t, r, n) => {
5
+ const o = E(t);
6
+ return !n && o === "00" ? null : !n && o[1] === "0" ? o.slice(0, 1) : o === "00" && !r ? null : o;
7
+ }, d = ({
8
8
  value: t,
9
- currency: o,
9
+ currency: r,
10
10
  showMinorPart: n,
11
- type: r
11
+ type: o
12
12
  }) => {
13
- const c = !!o && !!P.CURRENCY_SYMBOLS[o], e = c ? A(o) : o;
13
+ const e = !!r && !!M.CURRENCY_SYMBOLS[r], i = e ? _(r) : r;
14
14
  if (t === null)
15
15
  return {
16
16
  majorPart: "",
17
17
  minorPart: "",
18
18
  formatted: "",
19
- currencySymbol: e,
20
- formattedWithCurrency: s + e
19
+ currencySymbol: i,
20
+ formattedWithCurrency: ""
21
21
  };
22
- const [l, i] = r === "default" ? `${t}`.split(".") : [`${t}`.slice(0, -2), `${t}`.slice(-2)], m = M(
23
- `${Math.abs(+l || 0)}`,
24
- S,
25
- s,
26
- _
27
- ), a = t < 0 ? O + m : m, f = i ? a + u + i : a;
22
+ const [P, s] = o === "default" ? `${t}`.split(".") : [`${t}`.slice(0, -2), `${t}`.slice(-2)], m = C(
23
+ `${Math.abs(+P || 0)}`,
24
+ O,
25
+ a,
26
+ R
27
+ ), f = t < 0 ? T + m : m, A = s ? f + l + s : f;
28
28
  return {
29
- majorPart: a,
30
- minorPart: T(i, n, c),
31
- currencySymbol: e,
32
- formatted: f,
33
- formattedWithCurrency: f + s + e
29
+ majorPart: f,
30
+ minorPart: N(s, n, e),
31
+ currencySymbol: i,
32
+ formatted: A,
33
+ formattedWithCurrency: U(
34
+ A,
35
+ i || "",
36
+ r
37
+ )
34
38
  };
35
39
  };
36
40
  export {
37
- u as AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR,
38
- s as THINSP,
39
- p as formatAmount
41
+ l as AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR,
42
+ a as THINSP,
43
+ d as formatAmount,
44
+ S as isCurrencyFirst
40
45
  };
@@ -1,60 +1,61 @@
1
- import { add as t, addDays as r, addMonths as s, addYears as o, eachDayOfInterval as f, eachMonthOfInterval as n, eachYearOfInterval as i, endOfDay as O, endOfISOWeek as m, endOfWeek as h, endOfYear as d, format as p, isAfter as S, isBefore as c, isEqual as y, isLastDayOfMonth as M, isSameDay as l, isSameMonth as u, isSameYear as D, isThisMonth as x, isThisYear as I, isToday as A, isWithinInterval as T, lastDayOfMonth as Y, max as k, min as W, parse as b, parseISO as R, startOfDay as v, startOfISOWeek as w, startOfMonth as _, startOfWeek as E, startOfYear as N, subDays as P, subMonths as g, subWeeks as q, subYears as z, weekDaysShort as B } from "./date/index.js";
2
- import { debounce as H } from "./debounce.js";
3
- import { AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR as L, THINSP as U, formatAmount as j } from "./format-amount/util.js";
4
- import { formatDate as G, locales as K } from "./format-date/index.js";
5
- import { safeStringify as V } from "./safe-stringify.js";
6
- import { showCompactSuccess as Z, showError as $, showSuccess as ee } from "./show-toast/index.js";
7
- import { splitAmount as te } from "./split-amount/util.js";
8
- import { capitalize as se } from "./string.js";
1
+ import { add as r, addDays as s, addMonths as t, addYears as o, eachDayOfInterval as f, eachMonthOfInterval as i, eachYearOfInterval as n, endOfDay as O, endOfISOWeek as m, endOfWeek as h, endOfYear as d, format as p, isAfter as S, isBefore as c, isEqual as y, isLastDayOfMonth as u, isSameDay as M, isSameMonth as l, isSameYear as D, isThisMonth as x, isThisYear as I, isToday as A, isWithinInterval as T, lastDayOfMonth as Y, max as k, min as W, parse as b, parseISO as R, startOfDay as v, startOfISOWeek as w, startOfMonth as _, startOfWeek as E, startOfYear as N, subDays as P, subMonths as C, subWeeks as g, subYears as q, weekDaysShort as z } from "./date/index.js";
2
+ import { debounce as F } from "./debounce.js";
3
+ import { AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR as J, THINSP as L, formatAmount as U, isCurrencyFirst as j } from "./format-amount/util.js";
4
+ import { formatDate as K, locales as Q } from "./format-date/index.js";
5
+ import { safeStringify as X } from "./safe-stringify.js";
6
+ import { showCompactSuccess as $, showError as ee, showSuccess as ae } from "./show-toast/index.js";
7
+ import { splitAmount as se } from "./split-amount/util.js";
8
+ import { capitalize as oe } from "./string.js";
9
9
  export {
10
- L as AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR,
11
- U as THINSP,
12
- t as add,
13
- r as addDays,
14
- s as addMonths,
10
+ J as AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR,
11
+ L as THINSP,
12
+ r as add,
13
+ s as addDays,
14
+ t as addMonths,
15
15
  o as addYears,
16
- se as capitalize,
17
- H as debounce,
16
+ oe as capitalize,
17
+ F as debounce,
18
18
  f as eachDayOfInterval,
19
- n as eachMonthOfInterval,
20
- i as eachYearOfInterval,
19
+ i as eachMonthOfInterval,
20
+ n as eachYearOfInterval,
21
21
  O as endOfDay,
22
22
  m as endOfISOWeek,
23
23
  h as endOfWeek,
24
24
  d as endOfYear,
25
25
  p as format,
26
- j as formatAmount,
27
- G as formatDate,
26
+ U as formatAmount,
27
+ K as formatDate,
28
28
  S as isAfter,
29
29
  c as isBefore,
30
+ j as isCurrencyFirst,
30
31
  y as isEqual,
31
- M as isLastDayOfMonth,
32
- l as isSameDay,
33
- u as isSameMonth,
32
+ u as isLastDayOfMonth,
33
+ M as isSameDay,
34
+ l as isSameMonth,
34
35
  D as isSameYear,
35
36
  x as isThisMonth,
36
37
  I as isThisYear,
37
38
  A as isToday,
38
39
  T as isWithinInterval,
39
40
  Y as lastDayOfMonth,
40
- K as locales,
41
+ Q as locales,
41
42
  k as max,
42
43
  W as min,
43
44
  b as parse,
44
45
  R as parseISO,
45
- V as safeStringify,
46
- Z as showCompactSuccess,
47
- $ as showError,
48
- ee as showSuccess,
49
- te as splitAmount,
46
+ X as safeStringify,
47
+ $ as showCompactSuccess,
48
+ ee as showError,
49
+ ae as showSuccess,
50
+ se as splitAmount,
50
51
  v as startOfDay,
51
52
  w as startOfISOWeek,
52
53
  _ as startOfMonth,
53
54
  E as startOfWeek,
54
55
  N as startOfYear,
55
56
  P as subDays,
56
- g as subMonths,
57
- q as subWeeks,
58
- z as subYears,
59
- B as weekDaysShort
57
+ C as subMonths,
58
+ g as subWeeks,
59
+ q as subYears,
60
+ z as weekDaysShort
60
61
  };
@@ -14,8 +14,10 @@ export declare const withSuffix: (Input: FC<InputProps & RefAttributes<HTMLInput
14
14
  error?: string | boolean | undefined;
15
15
  success?: boolean | undefined;
16
16
  hint?: string | undefined;
17
+ showCount?: boolean | undefined;
17
18
  label?: ReactNode;
18
19
  type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
20
+ passwordReveal?: boolean | undefined;
19
21
  wrapperRef?: import('react').Ref<HTMLDivElement> | undefined;
20
22
  leftAddons?: ReactNode;
21
23
  rightAddons?: ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alphakits/ui",
3
- "version": "2.5.5",
3
+ "version": "2.5.8",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -19,8 +19,9 @@
19
19
  "build:clean": "rm -rf dist",
20
20
  "build:index": "node tools/generate-index.cjs",
21
21
  "build:js": "vite build",
22
+ "build:icons": "node tools/generate-icon-urls.cjs",
22
23
  "build:vars": "node tools/build-vars.cjs",
23
- "build": "yarn build:clean && yarn build:index && yarn build:js && yarn build:vars",
24
+ "build": "yarn build:clean && yarn build:index && yarn build:icons && yarn build:js && yarn build:vars",
24
25
  "test": "echo \"no tests\"",
25
26
  "start": "vite",
26
27
  "storybook": "storybook dev -p 6006 --no-open",