@dss-kit/ui-kit 0.3.9 → 1.0.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 (65) hide show
  1. package/dist/components/builders/Modal/Modal.js +3 -3
  2. package/dist/components/builders/Modal/ModalFooter/ModalFooter.js +7 -7
  3. package/dist/components/builders/Modal/ModalHeader/ModalHeader.js +15 -15
  4. package/dist/components/builders/Modal/ModalMain/styles.js +3 -3
  5. package/dist/components/builders/Modal/styles.js +2 -2
  6. package/dist/components/builders/Table/Table.js +66 -58
  7. package/dist/components/builders/Table/Table.utils.js +5 -5
  8. package/dist/components/builders/Table/TableBodyRow/TableBodyRow.js +5 -5
  9. package/dist/components/builders/Table/TableHeadRow/TableHeadRow.js +4 -4
  10. package/dist/components/builders/Table/TablePagination/TablePagination.js +44 -44
  11. package/dist/components/builders/Table/TableWrapper/TableWrapper.js +19 -19
  12. package/dist/components/charts/LineChart/constants.js +16 -16
  13. package/dist/components/charts/LineChart/utils.js +2 -2
  14. package/dist/components/charts/PieProgressChart/constants.js +16 -10
  15. package/dist/components/controls/Button/Button.js +56 -53
  16. package/dist/components/controls/Button/styles.js +4 -4
  17. package/dist/components/controls/Button/types.d.ts +2 -1
  18. package/dist/components/controls/Checkbox/styles.js +7 -7
  19. package/dist/components/controls/IconButton/styles.js +27 -27
  20. package/dist/components/controls/Input/styles.js +10 -10
  21. package/dist/components/controls/MarkdownTextEditor/MarkdownTextEditor.js +28 -28
  22. package/dist/components/controls/MarkdownTextEditor/components/EditorToolbar/ActionMenuButton/ActionMenuButton.js +13 -13
  23. package/dist/components/controls/MarkdownTextEditor/components/EditorToolbar/ActionMenuButton/ActionMenuButton.styles.js +2 -2
  24. package/dist/components/controls/MarkdownTextEditor/components/EditorToolbar/EditorToolbar.js +43 -43
  25. package/dist/components/controls/MarkdownTextEditor/nodes/CustomLinkNode/parts/CustomLinkNodeComponent/CustomLinkNodeComponent.styles.js +3 -3
  26. package/dist/components/controls/MarkdownTextEditor/nodes/ImageRowNode/parts/ImageRowNodeComponent/ImageRowNodeComponent.styles.js +2 -2
  27. package/dist/components/controls/MarkdownTextEditor/themes/editor.theme.js +1 -1
  28. package/dist/components/controls/OtpInput/styles.js +11 -11
  29. package/dist/components/controls/RadioGroup/Radio.d.ts +10 -1
  30. package/dist/components/controls/RadioGroup/Radio.js +78 -73
  31. package/dist/components/controls/SegmentControl/SegmentControl.js +12 -12
  32. package/dist/components/controls/SegmentControl/styles.js +8 -8
  33. package/dist/components/controls/Select/styles.js +19 -19
  34. package/dist/components/controls/Switch/styles.js +12 -12
  35. package/dist/components/controls/Tabs/Tabs.js +10 -10
  36. package/dist/components/shared/Avatar/Avatar.js +8 -8
  37. package/dist/components/shared/Badge/Badge.d.ts +1 -1
  38. package/dist/components/shared/Badge/Badge.js +75 -66
  39. package/dist/components/shared/Hint/styles.js +6 -6
  40. package/dist/components/shared/MarkdownText/MarkdownText.styles.js +4 -4
  41. package/dist/components/shared/Popover/PopoverContent/PopoverContent.js +2 -2
  42. package/dist/components/shared/Skeleton/Skeleton.js +11 -11
  43. package/dist/components/shared/Tag/Tag.js +14 -14
  44. package/dist/components/shared/Toast/Toast.js +30 -30
  45. package/dist/components/shared/Tooltip/Tooltip.js +28 -28
  46. package/dist/components/shared/Tooltip/constants.js +3 -3
  47. package/dist/index.js +37 -34
  48. package/dist/providers/ThemeProviderScoped/ThemeProviderScoped.const.d.ts +8 -0
  49. package/dist/providers/ThemeProviderScoped/ThemeProviderScoped.context.d.ts +12 -0
  50. package/dist/providers/ThemeProviderScoped/ThemeProviderScoped.context.js +12 -0
  51. package/dist/providers/ThemeProviderScoped/ThemeProviderScoped.d.ts +1 -1
  52. package/dist/providers/ThemeProviderScoped/ThemeProviderScoped.js +37 -26
  53. package/dist/providers/ThemeProviderScoped/ThemeProviderScoped.types.d.ts +30 -5
  54. package/dist/providers/ThemeProviderScoped/index.d.ts +1 -0
  55. package/dist/root.css +1 -1
  56. package/dist/ui-kit.cjs +8 -8
  57. package/dist/ui-kit.css +1 -1
  58. package/dist/utils/theme/index.d.ts +141 -141
  59. package/dist/utils/theme/index.js +14 -14
  60. package/dist/utils/theme/palette.d.ts +184 -0
  61. package/dist/utils/theme/palette.js +187 -0
  62. package/package.json +1 -1
  63. package/dist/providers/ThemeProviderScoped/styles.module.scss.js +0 -7
  64. package/dist/utils/theme/color.d.ts +0 -184
  65. package/dist/utils/theme/color.js +0 -187
@@ -1,17 +1,17 @@
1
1
  import { jsxs as v, jsx as e } from "react/jsx-runtime";
2
2
  import { css as R, cx as G } from "@emotion/css";
3
- import { useRef as J, useState as K, useEffect as Q } from "react";
3
+ import { useRef as H, useState as J, useEffect as K } from "react";
4
4
  import z from "../../../../assets/svg/table/chevron-left.svg.js";
5
- import B from "../../../../assets/svg/table/chevron-right.svg.js";
6
- import U from "../../../../assets/svg/table/dots.svg.js";
7
- import { getPageNumbers as X } from "./TablePagination.utils.js";
8
- import { Button as M } from "../../../controls/Button/Button.js";
9
- import { IconButton as j } from "../../../controls/IconButton/IconButton.js";
5
+ import M from "../../../../assets/svg/table/chevron-right.svg.js";
6
+ import Q from "../../../../assets/svg/table/dots.svg.js";
7
+ import { getPageNumbers as U } from "./TablePagination.utils.js";
8
+ import { Button as _ } from "../../../controls/Button/Button.js";
9
+ import { IconButton as B } from "../../../controls/IconButton/IconButton.js";
10
10
  import { Box as r } from "../../Box/Box.js";
11
- import { Select as Y } from "../../../controls/Select/Select.js";
12
- import { theme as Z } from "../../../../utils/theme/index.js";
13
- import { Text as _ } from "../../Text/Text.js";
14
- const { color: i, cornerRadius: tt, spacing: b } = Z, bt = ({
11
+ import { Select as X } from "../../../controls/Select/Select.js";
12
+ import { theme as Y } from "../../../../utils/theme/index.js";
13
+ import { Text as Z } from "../../Text/Text.js";
14
+ const { color: i, cornerRadius: tt, spacing: b } = Y, bt = ({
15
15
  pageIndex: o,
16
16
  pageSize: n,
17
17
  totalCount: a,
@@ -21,20 +21,20 @@ const { color: i, cornerRadius: tt, spacing: b } = Z, bt = ({
21
21
  labels: d,
22
22
  pageSizeOptions: m = [10, 20, 50, 100],
23
23
  showPageSizeSelector: h = !0,
24
- renderPageSizeSelectorDropdownItem: T = (u) => u.label,
25
- renderPageSizeSelectorInputItem: V,
26
- className: D,
24
+ renderPageSizeSelectorDropdownItem: L = (u) => u.label,
25
+ renderPageSizeSelectorInputItem: T,
26
+ className: V,
27
27
  itemClassName: x,
28
- activeItemClassName: S,
29
- pageSizeSelectorClassName: I
28
+ activeItemClassName: w,
29
+ pageSizeSelectorClassName: D
30
30
  }) => {
31
- const { prev: u = "Previous", next: O = "Next" } = d ?? {}, w = J(null), [$, A] = K(0), y = Math.ceil(a / n), f = o > 0, g = o < y - 1;
32
- Q(() => {
33
- const t = w.current;
31
+ const { prev: u = "Previous", next: I = "Next" } = d ?? {}, S = H(null), [O, $] = J(0), y = Math.ceil(a / n), f = o > 0, g = o < y - 1;
32
+ K(() => {
33
+ const t = S.current;
34
34
  if (!t) return;
35
35
  const p = new ResizeObserver((W) => {
36
36
  for (const C of W)
37
- A(C.contentRect.width);
37
+ $(C.contentRect.width);
38
38
  });
39
39
  return p.observe(t), () => {
40
40
  p.disconnect();
@@ -48,7 +48,7 @@ const { color: i, cornerRadius: tt, spacing: b } = Z, bt = ({
48
48
  return 1;
49
49
  const F = Math.floor((k + 8) / 48);
50
50
  return Math.max(1, Math.min(10, F));
51
- })($), H = X({
51
+ })(O), q = U({
52
52
  page: o + 1,
53
53
  count: y,
54
54
  maxVisiblePages: E
@@ -56,7 +56,7 @@ const { color: i, cornerRadius: tt, spacing: b } = Z, bt = ({
56
56
  f && s(o - 1);
57
57
  }, P = () => {
58
58
  g && s(o + 1);
59
- }, q = (t) => {
59
+ }, A = (t) => {
60
60
  c(Number(t));
61
61
  };
62
62
  return a === 0 ? null : /* @__PURE__ */ v(r, { flex: 1, row: !0, justifyContent: "space-between", children: [
@@ -67,10 +67,10 @@ const { color: i, cornerRadius: tt, spacing: b } = Z, bt = ({
67
67
  row: !0,
68
68
  gap: b.sm,
69
69
  alignItems: "center",
70
- className: D,
70
+ className: V,
71
71
  children: [
72
72
  /* @__PURE__ */ e(
73
- M,
73
+ _,
74
74
  {
75
75
  width: "auto",
76
76
  size: "sm",
@@ -82,23 +82,23 @@ const { color: i, cornerRadius: tt, spacing: b } = Z, bt = ({
82
82
  }
83
83
  ),
84
84
  /* @__PURE__ */ e(
85
- L,
85
+ j,
86
86
  {
87
87
  className: x,
88
- activeClassName: S,
88
+ activeClassName: w,
89
89
  children: o + 1
90
90
  }
91
91
  ),
92
92
  /* @__PURE__ */ e(
93
- M,
93
+ _,
94
94
  {
95
95
  width: "auto",
96
96
  size: "sm",
97
97
  color: "neutral",
98
- iconRight: /* @__PURE__ */ e(B, { width: 20, height: 20 }),
98
+ iconRight: /* @__PURE__ */ e(M, { width: 20, height: 20 }),
99
99
  disabled: !g,
100
100
  onClick: P,
101
- children: O
101
+ children: I
102
102
  }
103
103
  )
104
104
  ]
@@ -106,14 +106,14 @@ const { color: i, cornerRadius: tt, spacing: b } = Z, bt = ({
106
106
  ) : /* @__PURE__ */ v(
107
107
  r,
108
108
  {
109
- ref: w,
109
+ ref: S,
110
110
  flex: 1,
111
111
  row: !0,
112
112
  overflow: "hidden",
113
113
  gap: b.sm,
114
114
  children: [
115
115
  /* @__PURE__ */ e(
116
- j,
116
+ B,
117
117
  {
118
118
  onClick: N,
119
119
  disabled: !f,
@@ -122,34 +122,34 @@ const { color: i, cornerRadius: tt, spacing: b } = Z, bt = ({
122
122
  children: /* @__PURE__ */ e(z, {})
123
123
  }
124
124
  ),
125
- /* @__PURE__ */ e(r, { row: !0, gap: b.sm, children: H.map((t) => /* @__PURE__ */ e(
126
- L,
125
+ /* @__PURE__ */ e(r, { row: !0, gap: b.sm, children: q.map((t) => /* @__PURE__ */ e(
126
+ j,
127
127
  {
128
128
  isDots: t === "start-dots" || t === "end-dots",
129
129
  isCurrentPage: t === o + 1,
130
130
  disabled: t === "start-dots" || t === "end-dots",
131
131
  onClick: () => s(t - 1),
132
132
  className: x,
133
- activeClassName: S,
133
+ activeClassName: w,
134
134
  children: t
135
135
  },
136
136
  t
137
137
  )) }),
138
138
  /* @__PURE__ */ e(
139
- j,
139
+ B,
140
140
  {
141
141
  color: "neutral",
142
142
  size: "sm",
143
143
  onClick: P,
144
144
  disabled: !g,
145
- children: /* @__PURE__ */ e(B, {})
145
+ children: /* @__PURE__ */ e(M, {})
146
146
  }
147
147
  )
148
148
  ]
149
149
  }
150
150
  ),
151
- h && /* @__PURE__ */ e(r, { alignItems: "flex-end", className: I, children: /* @__PURE__ */ e(
152
- Y,
151
+ h && /* @__PURE__ */ e(r, { alignItems: "flex-end", className: D, children: /* @__PURE__ */ e(
152
+ X,
153
153
  {
154
154
  width: "fit-content",
155
155
  value: n.toString(),
@@ -159,13 +159,13 @@ const { color: i, cornerRadius: tt, spacing: b } = Z, bt = ({
159
159
  label: t.toString()
160
160
  })),
161
161
  returnedValue: (t) => t.value,
162
- renderDropdownItem: T,
163
- renderSingleInputItem: V,
164
- onChange: (t) => q(t)
162
+ renderDropdownItem: L,
163
+ renderSingleInputItem: T,
164
+ onChange: (t) => A(t)
165
165
  }
166
166
  ) })
167
167
  ] });
168
- }, L = ({
168
+ }, j = ({
169
169
  children: o,
170
170
  isCurrentPage: n = !1,
171
171
  onClick: a,
@@ -182,9 +182,9 @@ const { color: i, cornerRadius: tt, spacing: b } = Z, bt = ({
182
182
  display: "flex",
183
183
  alignItems: "center",
184
184
  justifyContent: "center",
185
- backgroundColor: n ? i.fill.accentSecondary : i.fill.bgSecondary,
185
+ backgroundColor: n ? i.fill.accent_secondary : i.fill.bg_secondary,
186
186
  borderRadius: tt.sm,
187
- border: n ? `1px solid ${i.fill.accentSecondaryHover}` : `1px solid ${i.border.neutralAlphaBasic}`
187
+ border: n ? `1px solid ${i.fill.accent_secondary_hover}` : `1px solid ${i.border.neutral_alpha_basic}`
188
188
  }), h = R({
189
189
  width: "24px",
190
190
  height: "24px",
@@ -199,7 +199,7 @@ const { color: i, cornerRadius: tt, spacing: b } = Z, bt = ({
199
199
  n && d
200
200
  ),
201
201
  onClick: c ? void 0 : a,
202
- children: s ? /* @__PURE__ */ e(U, { className: h }) : /* @__PURE__ */ e(_, { center: !0, variant: "body-2", fontWeight: "medium", children: o })
202
+ children: s ? /* @__PURE__ */ e(Q, { className: h }) : /* @__PURE__ */ e(Z, { center: !0, variant: "body-2", fontWeight: "medium", children: o })
203
203
  }
204
204
  );
205
205
  };
@@ -1,11 +1,11 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
2
  import { css as n, cx as f } from "@emotion/css";
3
- import { memo as k, useState as d, useRef as x, useCallback as E, useEffect as W } from "react";
4
- import { theme as $ } from "../../../../utils/theme/index.js";
5
- import { Box as m } from "../../Box/Box.js";
6
- const { color: o, cornerRadius: C } = $, P = n({
3
+ import { memo as k, useState as d, useRef as x, useCallback as E, useEffect as L } from "react";
4
+ import { theme as W } from "../../../../utils/theme/index.js";
5
+ import { Box as p } from "../../Box/Box.js";
6
+ const { color: o, cornerRadius: $ } = W, C = n({
7
7
  position: "relative",
8
- borderRadius: C.md,
8
+ borderRadius: $.md,
9
9
  overflow: "hidden",
10
10
  "&::before, &::after": {
11
11
  content: '""',
@@ -18,21 +18,21 @@ const { color: o, cornerRadius: C } = $, P = n({
18
18
  },
19
19
  "&::before": {
20
20
  left: 0,
21
- background: `linear-gradient(to left, transparent 0%, ${o.fill.bgPrimary} 100%)`
21
+ background: `linear-gradient(to left, transparent 0%, ${o.fill.bg_primary} 100%)`
22
22
  },
23
23
  "&::after": {
24
24
  right: 0,
25
- background: `linear-gradient(to right, transparent 0%, ${o.fill.bgPrimary} 100%)`
25
+ background: `linear-gradient(to right, transparent 0%, ${o.fill.bg_primary} 100%)`
26
26
  }
27
27
  }), N = n({
28
28
  overflowX: "auto",
29
29
  scrollbarWidth: "thin",
30
- scrollbarColor: `${o.scrollbar.thumbPrimary} ${o.scrollbar.trackPrimary}`
30
+ scrollbarColor: `${o.scrollbar.thumb_primary} ${o.scrollbar.track_primary}`
31
31
  }), T = k(
32
32
  ({
33
- data: b,
34
- children: h,
35
- className: p,
33
+ data: m,
34
+ children: b,
35
+ className: h,
36
36
  scrollContainerClassName: u,
37
37
  showBorders: w = !1,
38
38
  ...y
@@ -45,7 +45,7 @@ const { color: o, cornerRadius: C } = $, P = n({
45
45
  i && t < a - l - 1
46
46
  );
47
47
  }, []);
48
- W(() => {
48
+ L(() => {
49
49
  const r = s.current;
50
50
  if (!r) return;
51
51
  e();
@@ -53,9 +53,9 @@ const { color: o, cornerRadius: C } = $, P = n({
53
53
  return t.observe(r), r.addEventListener("scroll", e), () => {
54
54
  t.disconnect(), r.removeEventListener("scroll", e);
55
55
  };
56
- }, [e, b]);
57
- const L = n({
58
- border: w ? `1px solid ${o.border.neutralAlphaLow}` : "transparent",
56
+ }, [e, m]);
57
+ const _ = n({
58
+ border: w ? `1px solid ${o.border.neutral_alpha_low}` : "transparent",
59
59
  "&::before": {
60
60
  opacity: S ? 1 : 0
61
61
  },
@@ -64,16 +64,16 @@ const { color: o, cornerRadius: C } = $, P = n({
64
64
  }
65
65
  });
66
66
  return /* @__PURE__ */ c(
67
- m,
67
+ p,
68
68
  {
69
- className: f(P, L, p),
69
+ className: f(C, _, h),
70
70
  ...y,
71
71
  children: /* @__PURE__ */ c(
72
- m,
72
+ p,
73
73
  {
74
74
  ref: s,
75
75
  className: f(N, u),
76
- children: h
76
+ children: b
77
77
  }
78
78
  )
79
79
  }
@@ -1,5 +1,5 @@
1
1
  import { theme as l } from "../../../utils/theme/index.js";
2
- const { color: i } = l, e = {
2
+ const { color: i } = l, r = {
3
3
  chart: {
4
4
  type: "areaspline",
5
5
  backgroundColor: "transparent",
@@ -34,44 +34,44 @@ const { color: i } = l, e = {
34
34
  credits: {
35
35
  enabled: !1
36
36
  }
37
- }, t = {
37
+ }, e = {
38
38
  positive: {
39
- color: i.fill.positivePrimary,
39
+ color: i.fill.positive_primary,
40
40
  fillColor: {
41
41
  linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
42
42
  stops: [
43
- [0, i.fill.positiveTintHigh],
44
- [1, i.fill.positiveTransparent]
43
+ [0, i.fill.positive_tint_high],
44
+ [1, i.fill.positive_transparent]
45
45
  ]
46
46
  }
47
47
  },
48
48
  negative: {
49
- color: i.fill.negativePrimary,
49
+ color: i.fill.negative_primary,
50
50
  fillColor: {
51
51
  linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
52
52
  stops: [
53
- [0, i.fill.negativeTintHigh],
54
- [1, i.fill.negativeTransparent]
53
+ [0, i.fill.negative_tint_high],
54
+ [1, i.fill.negative_transparent]
55
55
  ]
56
56
  }
57
57
  },
58
58
  accent: {
59
- color: i.fill.accentPrimary,
59
+ color: i.fill.accent_primary,
60
60
  fillColor: {
61
61
  linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
62
62
  stops: [
63
- [0, i.fill.accentTintHigh],
64
- [1, i.fill.accentTransparent]
63
+ [0, i.fill.accent_tint_high],
64
+ [1, i.fill.accent_transparent]
65
65
  ]
66
66
  }
67
67
  },
68
68
  warning: {
69
- color: i.fill.warningPrimary,
69
+ color: i.fill.warning_primary,
70
70
  fillColor: {
71
71
  linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
72
72
  stops: [
73
- [0, i.fill.warningTintHigh],
74
- [1, i.fill.warningTransparent]
73
+ [0, i.fill.warning_tint_high],
74
+ [1, i.fill.warning_transparent]
75
75
  ]
76
76
  }
77
77
  },
@@ -87,6 +87,6 @@ const { color: i } = l, e = {
87
87
  }
88
88
  };
89
89
  export {
90
- t as lineChartColorPreset,
91
- e as lineChartPreset
90
+ e as lineChartColorPreset,
91
+ r as lineChartPreset
92
92
  };
@@ -38,12 +38,12 @@ const { color: r } = n, f = (e, s, t, a, i) => ({
38
38
  alignByTranslate: !0
39
39
  },
40
40
  shadow: {
41
- color: r.effect.shadowM,
41
+ color: r.effect.shadow_m,
42
42
  offsetX: 0,
43
43
  offsetY: 0
44
44
  },
45
45
  borderRadius: 8,
46
- backgroundColor: r.fill.bgPrimary,
46
+ backgroundColor: r.fill.bg_primary,
47
47
  useHTML: !0,
48
48
  ...e
49
49
  });
@@ -1,5 +1,5 @@
1
1
  import { theme as i } from "../../../utils/theme/index.js";
2
- const { color: e } = i, r = {
2
+ const { color: e } = i, l = {
3
3
  chart: {
4
4
  type: "pie",
5
5
  backgroundColor: "transparent",
@@ -53,30 +53,36 @@ const { color: e } = i, r = {
53
53
  credits: {
54
54
  enabled: !1
55
55
  }
56
- }, t = {
56
+ }, r = {
57
57
  positive: {
58
58
  colors: [
59
- e.fill.positivePrimary,
60
- e.fill.positiveTintHigh
59
+ e.fill.positive_primary,
60
+ e.fill.positive_tint_high
61
61
  ]
62
62
  },
63
63
  negative: {
64
64
  colors: [
65
- e.fill.negativePrimary,
66
- e.fill.negativeTintHigh
65
+ e.fill.negative_primary,
66
+ e.fill.negative_tint_high
67
67
  ]
68
68
  },
69
69
  accent: {
70
- colors: [e.fill.accentPrimary, e.fill.accentTintHigh]
70
+ colors: [
71
+ e.fill.accent_primary,
72
+ e.fill.accent_tint_high
73
+ ]
71
74
  },
72
75
  warning: {
73
- colors: [e.fill.warningPrimary, e.fill.warningTintHigh]
76
+ colors: [
77
+ e.fill.warning_primary,
78
+ e.fill.warning_tint_high
79
+ ]
74
80
  },
75
81
  transfer: {
76
82
  colors: ["var(--fill-transfer-primary)", "var(--fill-transfer-tint-high)"]
77
83
  }
78
84
  };
79
85
  export {
80
- t as pieProgressChartColorPreset,
81
- r as pieProgressChartPreset
86
+ r as pieProgressChartColorPreset,
87
+ l as pieProgressChartPreset
82
88
  };
@@ -1,31 +1,31 @@
1
- import { jsx as a, jsxs as w, Fragment as O } from "react/jsx-runtime";
2
- import { cx as y, css as k } from "@emotion/css";
1
+ import { jsx as o, jsxs as b, Fragment as O } from "react/jsx-runtime";
2
+ import { cx as _, css as k } from "@emotion/css";
3
3
  import { motion as q } from "framer-motion";
4
- import { useMemo as o } from "react";
5
- import { cornerRadiusValues as u, baseButton as D, getVariantStyles as E, typeStyles as G, sizeValues as H } from "./styles.js";
4
+ import { useMemo as n } from "react";
5
+ import { cornerRadiusValues as m, baseButton as D, getVariantStyles as E, typeStyles as G, sizeValues as H } from "./styles.js";
6
6
  import { Loader as I } from "../../builders/Loader/Loader.js";
7
7
  import { AnimatedText as J } from "../../builders/Text/Text.js";
8
8
  import { theme as K } from "../../../utils/theme/index.js";
9
9
  import { Box as P } from "../../builders/Box/Box.js";
10
10
  import { Ripple as Q } from "../../builders/Ripple/Ripple.js";
11
- const { color: m } = K, ue = ({
12
- disabled: n,
11
+ const { color: u } = K, sr = ({
12
+ disabled: a,
13
13
  loading: l,
14
- className: g,
15
- wrapperClassName: S,
16
- buttonClassName: _,
17
- buttonDisabledClassName: $,
18
- textClassName: N,
14
+ className: w,
15
+ wrapperClassName: g,
16
+ buttonClassName: $,
17
+ buttonDisabledClassName: N,
18
+ textClassName: S,
19
19
  children: v,
20
- variant: r = "filled",
20
+ variant: e = "filled",
21
21
  backgroundColor: f,
22
22
  textColor: d,
23
23
  textFontWeight: U,
24
- borderColor: c,
25
- color: e = "accent",
24
+ borderColor: i,
25
+ color: r = "accent",
26
26
  opacity: p,
27
27
  borderRadius: x,
28
- width: i = "auto",
28
+ width: c = "auto",
29
29
  size: s = "md",
30
30
  iconLeft: B,
31
31
  iconRight: R,
@@ -34,55 +34,58 @@ const { color: m } = K, ue = ({
34
34
  type: V = "button",
35
35
  ...j
36
36
  }) => {
37
- const h = o(() => {
38
- switch (i) {
37
+ const h = n(() => {
38
+ switch (c) {
39
39
  case "full":
40
40
  return "100%";
41
41
  case "auto":
42
42
  return "fit-content";
43
43
  default:
44
- return i;
44
+ return c;
45
45
  }
46
- }, [i]), F = o(() => f || (r === "filled" ? e === "neutral" ? m.fill.neutralSecondary : `var(--fill-${e}-${t})` : "transparent"), [r, f, e, t]), W = o(() => {
46
+ }, [c]), F = n(() => f || (e === "filled" ? r === "neutral" ? u.fill.neutral_secondary : r === "neutral-primary" ? u.fill.neutral_primary : `var(--fill-${r}-${t})` : "transparent"), [e, f, r, t]), W = n(() => {
47
47
  if (t === "primary") {
48
- if (e === "neutral") return m.text.secondary;
49
- if (r === "filled") return m.text.inverse;
50
- } else if (e === "neutral") return m.text.secondary;
51
- return `var(--text-${e})`;
52
- }, [t, e, r]), b = o(() => {
48
+ if (r === "neutral" || r === "neutral-primary")
49
+ return u.text.secondary;
50
+ if (e === "filled") return u.text.inverse;
51
+ } else if (r === "neutral") return u.text.secondary;
52
+ return `var(--text-${r})`;
53
+ }, [t, r, e]), y = n(() => {
53
54
  if (t === "primary") {
54
- if (e === "neutral") return "secondary";
55
- if (r === "filled") return "inverse";
56
- } else if (e === "neutral") return "secondary";
57
- return e;
58
- }, [r, e, t]), A = o(() => c || (r === "outline" ? `var(--border-${e}-${t})` : "transparent"), [r, c, e, t]), C = o(() => {
55
+ if (r === "neutral" || r === "neutral-primary")
56
+ return "secondary";
57
+ if (e === "filled") return "inverse";
58
+ } else if (r === "neutral" || r === "neutral-primary")
59
+ return "secondary";
60
+ return r;
61
+ }, [e, r, t]), A = n(() => i || (e === "outline" ? r === "neutral-primary" ? u.border.neutral_alpha_basic : `var(--border-${r}-${t})` : "transparent"), [e, i, r, t]), C = n(() => {
59
62
  switch (s) {
60
63
  case "lg":
61
- return u.lg;
64
+ return m.lg;
62
65
  case "md":
63
66
  case "sm":
64
- return u.md;
67
+ return m.md;
65
68
  case "xs":
66
- return u.sm;
69
+ return m.sm;
67
70
  default:
68
- return u.md;
71
+ return m.md;
69
72
  }
70
- }, [s]), L = y(
73
+ }, [s]), L = _(
71
74
  D,
72
- E(r, e, t, n),
73
- G[r],
74
- n ? $ : void 0,
75
+ E(e, r, t, a),
76
+ G[e],
77
+ a ? N : void 0,
75
78
  k({
76
- borderRadius: x ? u[x] : C,
79
+ borderRadius: x ? m[x] : C,
77
80
  backgroundColor: F,
78
81
  borderColor: A,
79
- color: d ?? `var(--text-${b})`,
82
+ color: d ?? `var(--text-${y})`,
80
83
  width: h,
81
84
  height: H[s],
82
- opacity: p || (n ? 0.7 : 1)
85
+ opacity: p || (a ? 0.7 : 1)
83
86
  }),
84
- _
85
- ), M = o(() => {
87
+ $
88
+ ), M = n(() => {
86
89
  switch (s) {
87
90
  case "lg":
88
91
  case "md":
@@ -94,36 +97,36 @@ const { color: m } = K, ue = ({
94
97
  return "body-1";
95
98
  }
96
99
  }, [s]);
97
- return /* @__PURE__ */ a(
100
+ return /* @__PURE__ */ o(
98
101
  P,
99
102
  {
100
- className: y(S, g),
103
+ className: _(g, w),
101
104
  w: h,
102
105
  flex: T,
103
106
  relative: !0,
104
107
  overflow: "hidden",
105
- children: /* @__PURE__ */ w(
108
+ children: /* @__PURE__ */ b(
106
109
  q.button,
107
110
  {
108
111
  ...j,
109
- whileTap: !n && !l ? {
112
+ whileTap: !a && !l ? {
110
113
  scale: 0.99,
111
114
  boxShadow: "inset 0 0 0 10000px rgba(0,0,0,0.1)",
112
115
  transition: { duration: 0 }
113
116
  } : {},
114
- disabled: n || l,
117
+ disabled: a || l,
115
118
  className: L,
116
119
  type: V,
117
120
  children: [
118
- l ? /* @__PURE__ */ a(I, { color: W }) : /* @__PURE__ */ w(O, { children: [
121
+ l ? /* @__PURE__ */ o(I, { color: W }) : /* @__PURE__ */ b(O, { children: [
119
122
  B,
120
- /* @__PURE__ */ a(
123
+ /* @__PURE__ */ o(
121
124
  J,
122
125
  {
123
126
  style: { color: d },
124
- colorName: b,
127
+ colorName: y,
125
128
  variant: M,
126
- className: N,
129
+ className: S,
127
130
  textOverflow: "ellipsis",
128
131
  overflow: "hidden",
129
132
  children: v
@@ -131,7 +134,7 @@ const { color: m } = K, ue = ({
131
134
  ),
132
135
  R
133
136
  ] }),
134
- /* @__PURE__ */ a(Q, {})
137
+ /* @__PURE__ */ o(Q, {})
135
138
  ]
136
139
  }
137
140
  )
@@ -139,5 +142,5 @@ const { color: m } = K, ue = ({
139
142
  );
140
143
  };
141
144
  export {
142
- ue as Button
145
+ sr as Button
143
146
  };
@@ -38,15 +38,15 @@ const { color: t, cornerRadius: r, height: n, transition: i } = d, v = o({
38
38
  border: "none"
39
39
  }),
40
40
  filled: o({
41
- backgroundColor: t.fill.accentPrimary,
41
+ backgroundColor: t.fill.accent_primary,
42
42
  color: "white",
43
43
  border: "none"
44
44
  }),
45
45
  outline: o({
46
46
  backgroundColor: "transparent",
47
- border: `1px solid ${t.border.accentPrimary}`
47
+ border: `1px solid ${t.border.accent_primary}`
48
48
  })
49
- }, h = (s, e, l, c) => {
49
+ }, p = (s, e, l, c) => {
50
50
  if (c)
51
51
  return o({
52
52
  cursor: "not-allowed",
@@ -100,7 +100,7 @@ const { color: t, cornerRadius: r, height: n, transition: i } = d, v = o({
100
100
  export {
101
101
  v as baseButton,
102
102
  x as cornerRadiusValues,
103
- h as getVariantStyles,
103
+ p as getVariantStyles,
104
104
  f as sizeValues,
105
105
  b as typeStyles
106
106
  };