@scbt-ecom/ui 0.64.1 → 0.65.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.
@@ -1 +1,2 @@
1
1
  export { Button, type ButtonProps } from './Button';
2
+ export { buttonPrimitiveIntent, buttonPrimitiveTextFormat, buttonPrimitiveSize } from './model/helpers';
@@ -1,8 +1,25 @@
1
1
  import { ButtonConfig } from '../Button';
2
2
  export declare const setButtonLoaderIntent: (intent: ButtonConfig["intent"]) => "primary" | "secondary" | null | undefined;
3
+ export declare const buttonPrimitiveSize: {
4
+ readonly sm: "h-10";
5
+ readonly md: "h-12";
6
+ readonly lg: "h-14";
7
+ };
8
+ export declare const buttonPrimitiveTextFormat: {
9
+ readonly capitalize: "capitalize";
10
+ readonly uppercase: "uppercase";
11
+ readonly lowercase: "lowercase";
12
+ readonly initial: "initial";
13
+ };
14
+ export declare const buttonPrimitiveIntent: {
15
+ readonly primary: "bg-color-primary-default text-color-white outline-offset-[3px] hover:bg-color-primary-hover active:bg-color-primary-hover focus:bg-color-primary-default focus:outline-primary-focus disabled:bg-color-primary-disabled";
16
+ readonly secondary: "bg-transparent text-color-primary-default border border-solid border-primary-default hover:bg-color-primary-tr-hover active:bg-color-primary-tr-pressed active:border-primary-hover focus:outline-primary-focus focus:bg-color-primary-tr-focus disabled:bg-color-blue-grey-200 disabled:text-color-primary-disabled disabled:border-transparent";
17
+ readonly ghost: "bg-transparent text-color-primary-default hover:bg-color-primary-tr-hover hover:text-color-primary-hover focus:bg-color-primary-tr-focus focus:outline-primary-focus active:bg-color-primary-tr-pressed active:text-color-primary-hover disabled:text-color-primary-disabled disabled:bg-transparent";
18
+ readonly negative: "bg-color-secondary-default text-color-white outline-offset-[3px] hover:bg-color-secondary-hover disabled:bg-color-secondary-disabled active:bg-color-secondary-hover focus:bg-color-secondary-default focus:outline-primary-focus";
19
+ };
3
20
  export declare const buttonConfig: (props?: ({
4
21
  intent?: "primary" | "secondary" | "ghost" | "negative" | null | undefined;
5
- size?: "sm" | "md" | "lg" | null | undefined;
22
+ size?: "md" | "sm" | "lg" | null | undefined;
6
23
  textFormat?: "capitalize" | "uppercase" | "lowercase" | "initial" | null | undefined;
7
24
  isFull?: boolean | null | undefined;
8
25
  isLoading?: boolean | null | undefined;
@@ -6,7 +6,7 @@ type ButtonClasses = {
6
6
  };
7
7
  declare const buttonConfig: (props?: ({
8
8
  intent?: "primary" | "secondary" | "ghost" | null | undefined;
9
- size?: "sm" | "md" | "lg" | null | undefined;
9
+ size?: "md" | "sm" | "lg" | null | undefined;
10
10
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
11
11
  type ButtonProps = VariantProps<typeof buttonConfig>;
12
12
  export interface IButtonIconProps extends Omit<ComponentProps<'button'>, 'className'>, ButtonProps {
@@ -2,7 +2,7 @@ export declare const customLinkConfig: (props?: ({
2
2
  intent?: "blue" | "white" | "dark" | null | undefined;
3
3
  withUnderline?: boolean | null | undefined;
4
4
  disabled?: boolean | null | undefined;
5
- size?: "sm" | "md" | null | undefined;
5
+ size?: "md" | "sm" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  export declare const linkArrowConfig: (props?: ({
8
8
  intent?: "blue" | "white" | "dark" | null | undefined;
@@ -3,5 +3,5 @@ export declare const wrapperConfig: (props?: ({
3
3
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
4
4
  export declare const loaderConfig: (props?: ({
5
5
  intent?: "primary" | "secondary" | null | undefined;
6
- size?: "sm" | "md" | "lg" | null | undefined;
6
+ size?: "md" | "sm" | "lg" | null | undefined;
7
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
package/dist/ui.js CHANGED
@@ -1,9 +1,9 @@
1
- import { j as p, c as tt, R as nt, B as D, u as ot, a as rt, b as it, d as lt, P as U, e as ye, f as ut, I as st, g as X, h as at, A as gt, H as dt, i as N, k as ct, m as Ce, D as ft, V as pt, O as mt } from "./index-B00qeS0W.js";
2
- import { n as io, C as lo, t as uo, s as so, o as ao, K as go, L as co, N as fo, l as po, p as mo, q as ho, U as So, r as wo, v as Co } from "./index-B00qeS0W.js";
1
+ import { j as p, c as tt, R as nt, B as D, u as ot, a as rt, b as it, d as lt, P as U, e as ye, f as ut, I as st, g as X, h as at, A as gt, H as dt, i as N, k as ct, m as Ce, D as ft, V as pt, O as mt } from "./index-BC0CWE5w.js";
2
+ import { q as io, C as lo, x as uo, w as so, r as ao, K as go, L as co, N as fo, p as po, s as mo, t as ho, U as So, v as wo, l as Co, o as Ro, n as vo, y as xo } from "./index-BC0CWE5w.js";
3
3
  import * as E from "react";
4
4
  import { forwardRef as V, useState as ne, useEffect as $e, useRef as ht, isValidElement as k, cloneElement as Ve, Children as G } from "react";
5
5
  import { c as C, T as Re } from "./typeGuards-Bhdr9KYW.js";
6
- import { D as vo, d as xo, f as _o, b as Fo, a as yo } from "./utils-DaXd4sci.js";
6
+ import { D as Fo, d as yo, f as $o, b as Vo, a as Mo } from "./utils-DaXd4sci.js";
7
7
  import { createPortal as ve } from "react-dom";
8
8
  import { a as Me } from "./useDebounce-i1sdXecI.js";
9
9
  import { m as St } from "./mergeRefs-qDToYXtM.js";
@@ -239,9 +239,9 @@ var Ee = "TabsList", De = E.forwardRef(
239
239
  }
240
240
  );
241
241
  De.displayName = Ee;
242
- var Le = "TabsTrigger", be = E.forwardRef(
242
+ var be = "TabsTrigger", Le = E.forwardRef(
243
243
  (e, o) => {
244
- const { __scopeTabs: t, value: n, disabled: r = !1, ...i } = e, l = de(Le, t), u = Ie(t), s = Ge(l.baseId, n), g = je(l.baseId, n), d = n === l.value;
244
+ const { __scopeTabs: t, value: n, disabled: r = !1, ...i } = e, l = de(be, t), u = Ie(t), s = Ge(l.baseId, n), g = je(l.baseId, n), d = n === l.value;
245
245
  return /* @__PURE__ */ p.jsx(
246
246
  st,
247
247
  {
@@ -278,7 +278,7 @@ var Le = "TabsTrigger", be = E.forwardRef(
278
278
  );
279
279
  }
280
280
  );
281
- be.displayName = Le;
281
+ Le.displayName = be;
282
282
  var Ae = "TabsContent", He = E.forwardRef(
283
283
  (e, o) => {
284
284
  const { __scopeTabs: t, value: n, forceMount: r, children: i, ...l } = e, u = de(Ae, t), s = Ge(u.baseId, n), g = je(u.baseId, n), d = n === u.value, f = E.useRef(d);
@@ -313,7 +313,7 @@ function Ge(e, o) {
313
313
  function je(e, o) {
314
314
  return `${e}-content-${o}`;
315
315
  }
316
- var vt = Pe, xt = De, _t = be, xe = He;
316
+ var vt = Pe, xt = De, _t = Le, xe = He;
317
317
  const Ft = ({ classes: e, contents: o }) => /* @__PURE__ */ p.jsx("div", { className: C("flex flex-col gap-4", e == null ? void 0 : e.contentsWrapper), children: o == null ? void 0 : o.map(({ id: t, body: n, accordion: r }) => r && (r != null && r.title) ? /* @__PURE__ */ p.jsx(xe, { value: t, className: C("py-8", e == null ? void 0 : e.content), children: /* @__PURE__ */ p.jsx(gt, { label: r == null ? void 0 : r.title, children: n }) }, t) : /* @__PURE__ */ p.jsx(xe, { value: t, className: C("py-8", e == null ? void 0 : e.content), children: n }, t)) }), Zn = ({ renderContent: e, defaultActiveTabId: o = "1", value: t, onChangeTab: n, classes: r }) => {
318
318
  var i;
319
319
  return /* @__PURE__ */ p.jsxs(
@@ -491,24 +491,24 @@ function Dt() {
491
491
  group: (e) => e
492
492
  };
493
493
  }
494
- function L(e, o) {
494
+ function b(e, o) {
495
495
  return typeof e == "function" ? e(o) : e;
496
496
  }
497
497
  function $(e, o) {
498
498
  return (t) => {
499
499
  o.setState((n) => ({
500
500
  ...n,
501
- [e]: L(t, n[e])
501
+ [e]: b(t, n[e])
502
502
  }));
503
503
  };
504
504
  }
505
505
  function K(e) {
506
506
  return e instanceof Function;
507
507
  }
508
- function Lt(e) {
508
+ function bt(e) {
509
509
  return Array.isArray(e) && e.every((o) => typeof o == "number");
510
510
  }
511
- function bt(e, o) {
511
+ function Lt(e, o) {
512
512
  const t = [], n = (r) => {
513
513
  r.forEach((i) => {
514
514
  t.push(i);
@@ -758,7 +758,7 @@ const ce = (e, o, t, n, r, i, l) => {
758
758
  return (g = u.getValue(s)) != null ? g : e.options.renderFallbackValue;
759
759
  },
760
760
  subRows: [],
761
- getLeafRows: () => bt(u.subRows, (s) => s.subRows),
761
+ getLeafRows: () => Lt(u.subRows, (s) => s.subRows),
762
762
  getParentRow: () => u.parentId ? e.getRow(u.parentId, !0) : void 0,
763
763
  getParentRows: () => {
764
764
  let s = [], g = u;
@@ -881,7 +881,7 @@ const Nt = {
881
881
  return (t = (n = o.getState().columnFilters) == null ? void 0 : n.findIndex((r) => r.id === e.id)) != null ? t : -1;
882
882
  }, e.setFilterValue = (t) => {
883
883
  o.setColumnFilters((n) => {
884
- const r = e.getFilterFn(), i = n == null ? void 0 : n.find((d) => d.id === e.id), l = L(t, i ? i.value : void 0);
884
+ const r = e.getFilterFn(), i = n == null ? void 0 : n.find((d) => d.id === e.id), l = b(t, i ? i.value : void 0);
885
885
  if (Fe(r, l, e)) {
886
886
  var u;
887
887
  return (u = n == null ? void 0 : n.filter((d) => d.id !== e.id)) != null ? u : [];
@@ -905,7 +905,7 @@ const Nt = {
905
905
  e.setColumnFilters = (o) => {
906
906
  const t = e.getAllLeafColumns(), n = (r) => {
907
907
  var i;
908
- return (i = L(o, r)) == null ? void 0 : i.filter((l) => {
908
+ return (i = b(o, r)) == null ? void 0 : i.filter((l) => {
909
909
  const u = t.find((s) => s.id === l.id);
910
910
  if (u) {
911
911
  const s = u.getFilterFn();
@@ -956,7 +956,7 @@ const zt = (e, o, t) => t.reduce((n, r) => {
956
956
  if (!o.length)
957
957
  return;
958
958
  const t = o.map((i) => i.getValue(e));
959
- if (!Lt(t))
959
+ if (!bt(t))
960
960
  return;
961
961
  if (t.length === 1)
962
962
  return t[0];
@@ -1526,14 +1526,14 @@ const nn = {
1526
1526
  });
1527
1527
  }
1528
1528
  }, e.setPagination = (n) => {
1529
- const r = (i) => L(n, i);
1529
+ const r = (i) => b(n, i);
1530
1530
  return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(r);
1531
1531
  }, e.resetPagination = (n) => {
1532
1532
  var r;
1533
1533
  e.setPagination(n ? Q() : (r = e.initialState.pagination) != null ? r : Q());
1534
1534
  }, e.setPageIndex = (n) => {
1535
1535
  e.setPagination((r) => {
1536
- let i = L(n, r.pageIndex);
1536
+ let i = b(n, r.pageIndex);
1537
1537
  const l = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
1538
1538
  return i = Math.max(0, Math.min(i, l)), {
1539
1539
  ...r,
@@ -1548,7 +1548,7 @@ const nn = {
1548
1548
  e.setPageSize(n ? ie : (r = (i = e.initialState) == null || (i = i.pagination) == null ? void 0 : i.pageSize) != null ? r : ie);
1549
1549
  }, e.setPageSize = (n) => {
1550
1550
  e.setPagination((r) => {
1551
- const i = Math.max(1, L(n, r.pageSize)), l = r.pageSize * r.pageIndex, u = Math.floor(l / i);
1551
+ const i = Math.max(1, b(n, r.pageSize)), l = r.pageSize * r.pageIndex, u = Math.floor(l / i);
1552
1552
  return {
1553
1553
  ...r,
1554
1554
  pageIndex: u,
@@ -1557,7 +1557,7 @@ const nn = {
1557
1557
  });
1558
1558
  }, e.setPageCount = (n) => e.setPagination((r) => {
1559
1559
  var i;
1560
- let l = L(n, (i = e.options.pageCount) != null ? i : -1);
1560
+ let l = b(n, (i = e.options.pageCount) != null ? i : -1);
1561
1561
  return typeof l == "number" && (l = Math.max(-1, l)), {
1562
1562
  ...r,
1563
1563
  pageCount: l
@@ -1838,14 +1838,14 @@ function ue(e, o, t) {
1838
1838
  }
1839
1839
  }), r ? "all" : i ? "some" : !1;
1840
1840
  }
1841
- const se = /([0-9]+)/gm, an = (e, o, t) => Ze(b(e.getValue(t)).toLowerCase(), b(o.getValue(t)).toLowerCase()), gn = (e, o, t) => Ze(b(e.getValue(t)), b(o.getValue(t))), dn = (e, o, t) => me(b(e.getValue(t)).toLowerCase(), b(o.getValue(t)).toLowerCase()), cn = (e, o, t) => me(b(e.getValue(t)), b(o.getValue(t))), fn = (e, o, t) => {
1841
+ const se = /([0-9]+)/gm, an = (e, o, t) => Ze(L(e.getValue(t)).toLowerCase(), L(o.getValue(t)).toLowerCase()), gn = (e, o, t) => Ze(L(e.getValue(t)), L(o.getValue(t))), dn = (e, o, t) => me(L(e.getValue(t)).toLowerCase(), L(o.getValue(t)).toLowerCase()), cn = (e, o, t) => me(L(e.getValue(t)), L(o.getValue(t))), fn = (e, o, t) => {
1842
1842
  const n = e.getValue(t), r = o.getValue(t);
1843
1843
  return n > r ? 1 : n < r ? -1 : 0;
1844
1844
  }, pn = (e, o, t) => me(e.getValue(t), o.getValue(t));
1845
1845
  function me(e, o) {
1846
1846
  return e === o ? 0 : e > o ? 1 : -1;
1847
1847
  }
1848
- function b(e) {
1848
+ function L(e) {
1849
1849
  return typeof e == "number" ? isNaN(e) || e === 1 / 0 || e === -1 / 0 ? "" : String(e) : typeof e == "string" ? e : "";
1850
1850
  }
1851
1851
  function Ze(e, o) {
@@ -2025,7 +2025,7 @@ function Sn(e) {
2025
2025
  r.setState(r.initialState);
2026
2026
  },
2027
2027
  setOptions: (c) => {
2028
- const a = L(c, r.options);
2028
+ const a = b(c, r.options);
2029
2029
  r.options = l(a);
2030
2030
  },
2031
2031
  getState: () => r.options.state,
@@ -2530,7 +2530,7 @@ const En = ({
2530
2530
  }
2531
2531
  )
2532
2532
  ] });
2533
- }, Ln = ({ mode: e, enableHeaders: o, table: t, classes: n, pagination: r }) => {
2533
+ }, bn = ({ mode: e, enableHeaders: o, table: t, classes: n, pagination: r }) => {
2534
2534
  const i = r !== !1 && t.getPageCount() > 1, l = {
2535
2535
  pageCount: t.getPageCount(),
2536
2536
  rowsCount: t.getCoreRowModel().rows.length,
@@ -2600,7 +2600,7 @@ const En = ({
2600
2600
  ] }),
2601
2601
  i ? typeof r == "function" ? r(l) : /* @__PURE__ */ p.jsx(Dn, { ...l }) : null
2602
2602
  ] });
2603
- }, bn = ({
2603
+ }, Ln = ({
2604
2604
  mode: e,
2605
2605
  enableHeaders: o,
2606
2606
  table: t,
@@ -2660,7 +2660,7 @@ const En = ({
2660
2660
  getFacetedUniqueValues: _n(),
2661
2661
  getPaginationRowModel: yn()
2662
2662
  }), { isMobile: f } = Me();
2663
- return f ? /* @__PURE__ */ p.jsx(bn, { table: d, enableHeaders: t, mode: n, classes: r }) : /* @__PURE__ */ p.jsx(Ln, { table: d, enableHeaders: t, mode: n, pagination: i, classes: r });
2663
+ return f ? /* @__PURE__ */ p.jsx(Ln, { table: d, enableHeaders: t, mode: n, classes: r }) : /* @__PURE__ */ p.jsx(bn, { table: d, enableHeaders: t, mode: n, pagination: i, classes: r });
2664
2664
  };
2665
2665
  class eo {
2666
2666
  static getColumnHelper() {
@@ -2784,7 +2784,7 @@ export {
2784
2784
  lo as Calendar,
2785
2785
  uo as Controlled,
2786
2786
  so as CustomLink,
2787
- vo as DATE_VISIBLE_PATTERN,
2787
+ Fo as DATE_VISIBLE_PATTERN,
2788
2788
  Qn as DataTable,
2789
2789
  Et as DataTableColumnHeader,
2790
2790
  Xn as FloatButton,
@@ -2816,10 +2816,13 @@ export {
2816
2816
  So as Uncontrolled,
2817
2817
  Wn as allowedIcons,
2818
2818
  wo as brandLogos,
2819
- xo as defaultClassNames,
2820
- _o as formatDateToLocaleString,
2821
- Fo as formatDateToMonthString,
2822
- yo as formatDateToYearString,
2823
- Co as isSingleOption
2819
+ Co as buttonPrimitiveIntent,
2820
+ Ro as buttonPrimitiveSize,
2821
+ vo as buttonPrimitiveTextFormat,
2822
+ yo as defaultClassNames,
2823
+ $o as formatDateToLocaleString,
2824
+ Vo as formatDateToMonthString,
2825
+ Mo as formatDateToYearString,
2826
+ xo as isSingleOption
2824
2827
  };
2825
2828
  //# sourceMappingURL=ui.js.map
package/dist/widget.js CHANGED
@@ -13,7 +13,7 @@ var mt = (e, t, r, n) => ({
13
13
  return h(e, t, n);
14
14
  }
15
15
  });
16
- import { S as Vt, w as Wt, Q as le, x as M, y as Mt, z as ue, E as pe, F as Et, G as P, J as me, M as he, T as xe, W as fe, X as Ot, Y as St, Z as ce, _ as Ft, $ as Bt, a0 as be, j as o, B as vt, c as E, R as _, l as Gt, r as ge, H as W, i as c, s as ct, p as je, L as ye, n as Nt, A as ot, t as ke, a1 as we, q as ve, U as Kt, m as st, k as Ne } from "./index-B00qeS0W.js";
16
+ import { S as Vt, z as Wt, Q as le, E as M, F as Mt, G as ue, J as pe, M as Et, T as P, W as me, X as he, Y as xe, Z as fe, _ as Ot, $ as St, a0 as ce, a1 as Ft, a2 as Bt, a3 as be, j as o, B as vt, c as E, R as _, p as Gt, v as ge, H as W, i as c, w as ct, s as je, L as ye, q as Nt, A as ot, x as ke, a4 as we, t as ve, U as Kt, m as st, k as Ne } from "./index-BC0CWE5w.js";
17
17
  import { c as a, T as k } from "./typeGuards-Bhdr9KYW.js";
18
18
  import * as at from "react";
19
19
  import { useCallback as $t, useState as G, useMemo as Ct, createElement as Zt, Fragment as se, useEffect as Xt, useRef as Tt, useReducer as Ce, memo as Jt, forwardRef as Te } from "react";