@moises.ai/design-system 4.17.10 → 4.17.11

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.
package/dist/index.js CHANGED
@@ -8429,33 +8429,34 @@ const nI = ({
8429
8429
  loading: l = !1,
8430
8430
  failed: c = !1,
8431
8431
  children: d,
8432
- ...u
8432
+ labels: u = {},
8433
+ ...p
8433
8434
  }) => {
8434
8435
  const {
8435
- projects: p,
8436
- onInsertAllTracks: h,
8437
- onProjectClick: g,
8438
- openedItem: C,
8439
- setOpenedItem: m
8440
- } = gt(ts), [f, k] = V(!1), y = se(() => f ? i : i.slice(0, 6), [i, f]), w = D(() => {
8436
+ projects: h,
8437
+ onInsertAllTracks: g,
8438
+ onProjectClick: C,
8439
+ openedItem: m,
8440
+ setOpenedItem: f
8441
+ } = gt(ts), [k, y] = V(!1), w = se(() => k ? i : i.slice(0, 6), [i, k]), I = D(() => {
8441
8442
  if (c) return;
8442
- k(!1);
8443
- const E = p.find((R) => R.id === n);
8444
- C === n ? (m(null), g == null || g(E, !1)) : (m(n), g == null || g(E, !0));
8445
- }, [n, C, m, g, p, c]), I = D((E) => {
8446
- E.preventDefault(), E.stopPropagation(), k(!f);
8447
- }, [f]), N = D((E) => {
8448
- E.stopPropagation(), h == null || h(i);
8449
- }, [h, i]);
8443
+ y(!1);
8444
+ const R = h.find((B) => B.id === n);
8445
+ m === n ? (f(null), C == null || C(R, !1)) : (f(n), C == null || C(R, !0));
8446
+ }, [n, m, f, C, h, c]), N = D((R) => {
8447
+ R.preventDefault(), R.stopPropagation(), y(!k);
8448
+ }, [k]), E = D((R) => {
8449
+ R.stopPropagation(), g == null || g(i);
8450
+ }, [g, i]);
8450
8451
  return /* @__PURE__ */ v(
8451
8452
  S,
8452
8453
  {
8453
8454
  direction: "column",
8454
8455
  gap: "2",
8455
8456
  p: "1",
8456
- className: `${Gt.item} ${C === n ? Gt.opened : ""} ${c ? Gt.failed : ""}`,
8457
- onClick: w,
8458
- ...u,
8457
+ className: `${Gt.item} ${m === n ? Gt.opened : ""} ${c ? Gt.failed : ""}`,
8458
+ onClick: I,
8459
+ ...p,
8459
8460
  children: [
8460
8461
  /* @__PURE__ */ v(S, { direction: "row", gap: "3", children: [
8461
8462
  /* @__PURE__ */ a(S, { className: Gt.projectCover, children: /* @__PURE__ */ a(es, { type: o, cover: s, title: t, size: "48px" }) }),
@@ -8477,7 +8478,7 @@ const nI = ({
8477
8478
  }
8478
8479
  )
8479
8480
  ] }),
8480
- C === n && /* @__PURE__ */ v(S, { direction: "column", children: [
8481
+ m === n && /* @__PURE__ */ v(S, { direction: "column", children: [
8481
8482
  i.length === 0 && !l && /* @__PURE__ */ v(S, { direction: "row", gap: "3", p: "5", pt: "2", align: "center", justify: "center", children: [
8482
8483
  /* @__PURE__ */ a(Bd, { width: 16, height: 16, style: { color: "var(--neutral-alpha-10)" } }),
8483
8484
  /* @__PURE__ */ a(W, { size: "2", style: { color: "var(--neutral-alpha-10)" }, children: "This file has no tracks" })
@@ -8487,7 +8488,7 @@ const nI = ({
8487
8488
  /* @__PURE__ */ a(W, { size: "2", style: { color: "var(--neutral-alpha-10)" }, children: "Loading tracks..." })
8488
8489
  ] }),
8489
8490
  i.length > 0 && /* @__PURE__ */ v(S, { direction: "column", gap: "1", children: [
8490
- typeof d == "function" ? d({ projectId: n, tracks: y }) : d,
8491
+ typeof d == "function" ? d({ projectId: n, tracks: w }) : d,
8491
8492
  /* @__PURE__ */ v(S, { direction: "row", gap: "3", p: "2", align: "center", justify: "center", children: [
8492
8493
  /* @__PURE__ */ v(
8493
8494
  Ir,
@@ -8495,18 +8496,19 @@ const nI = ({
8495
8496
  variant: "ghost",
8496
8497
  color: "gray",
8497
8498
  style: { flex: "1" },
8498
- onClick: N,
8499
+ onClick: E,
8499
8500
  children: [
8500
8501
  /* @__PURE__ */ a(Dr, { width: 16, height: 16 }),
8501
- " Insert all"
8502
+ " ",
8503
+ u.insertAll || "Insert all"
8502
8504
  ]
8503
8505
  }
8504
8506
  ),
8505
8507
  i.length > 6 && /* @__PURE__ */ v(be, { children: [
8506
8508
  /* @__PURE__ */ a(ot, { orientation: "vertical" }),
8507
- /* @__PURE__ */ v(Ir, { variant: "ghost", color: "gray", style: { flex: "1" }, onClick: I, children: [
8508
- f ? "Show less" : "Show more",
8509
- f ? /* @__PURE__ */ a(xd, { width: 16, height: 16 }) : /* @__PURE__ */ a(Xs, { width: 16, height: 16 })
8509
+ /* @__PURE__ */ v(Ir, { variant: "ghost", color: "gray", style: { flex: "1" }, onClick: N, children: [
8510
+ k ? u.showLess || "Show less" : u.showMore || "Show more",
8511
+ k ? /* @__PURE__ */ a(xd, { width: 16, height: 16 }) : /* @__PURE__ */ a(Xs, { width: 16, height: 16 })
8510
8512
  ] })
8511
8513
  ] })
8512
8514
  ] })
@@ -8738,9 +8740,10 @@ const nI = ({
8738
8740
  projects: t = [],
8739
8741
  onClickTrack: r,
8740
8742
  onInsertAllTracks: s,
8741
- onProjectClick: o
8743
+ onProjectClick: o,
8744
+ labels: i = {}
8742
8745
  }) => {
8743
- const [i, l] = V(null);
8746
+ const [l, c] = V(null);
8744
8747
  return /* @__PURE__ */ a(
8745
8748
  ts.Provider,
8746
8749
  {
@@ -8749,10 +8752,10 @@ const nI = ({
8749
8752
  onClickTrack: r,
8750
8753
  onInsertAllTracks: s,
8751
8754
  onProjectClick: o,
8752
- openedItem: i,
8753
- setOpenedItem: l
8755
+ openedItem: l,
8756
+ setOpenedItem: c
8754
8757
  },
8755
- children: /* @__PURE__ */ a(S, { direction: "column", width: "100%", children: t.map((c) => /* @__PURE__ */ a(dI, { ...c, children: n }, c.id)) })
8758
+ children: /* @__PURE__ */ a(S, { direction: "column", width: "100%", children: t.map((d) => /* @__PURE__ */ a(dI, { ...d, labels: i, children: n }, d.id)) })
8756
8759
  }
8757
8760
  );
8758
8761
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moises.ai/design-system",
3
- "version": "4.17.10",
3
+ "version": "4.17.11",
4
4
  "description": "Design System package based on @radix-ui/themes with custom defaults",
5
5
  "private": false,
6
6
  "type": "module",
@@ -15,6 +15,7 @@ const ProjectItem = ({
15
15
  loading = false,
16
16
  failed = false,
17
17
  children,
18
+ labels = {},
18
19
  ...props
19
20
  }) => {
20
21
  const {
@@ -121,7 +122,7 @@ const ProjectItem = ({
121
122
  <Button variant="ghost" color="gray" style={{ flex: '1' }}
122
123
  onClick={handleInsertAllTracks}
123
124
  >
124
- <ArrowLeftIcon width={16} height={16} /> Insert all
125
+ <ArrowLeftIcon width={16} height={16} /> {labels.insertAll || 'Insert all'}
125
126
  </Button>
126
127
 
127
128
  {allTracks.length > 6 && (
@@ -129,7 +130,7 @@ const ProjectItem = ({
129
130
  <Separator orientation="vertical" />
130
131
 
131
132
  <Button variant="ghost" color="gray" style={{ flex: '1' }} onClick={handleClickShowAllTracks}>
132
- {showAllTracks ? 'Show less' : 'Show more'}
133
+ {showAllTracks ? labels.showLess || 'Show less' : labels.showMore || 'Show more'}
133
134
  {showAllTracks ? <ChevronUpIcon width={16} height={16} /> : <ChevronDownIcon width={16} height={16} />}
134
135
  </Button>
135
136
  </>
@@ -10,7 +10,8 @@ export const ProjectsList = ({
10
10
  projects = [],
11
11
  onClickTrack,
12
12
  onInsertAllTracks,
13
- onProjectClick
13
+ onProjectClick,
14
+ labels = {}
14
15
  }) => {
15
16
  const [openedItem, setOpenedItem] = useState(null)
16
17
 
@@ -27,7 +28,7 @@ export const ProjectsList = ({
27
28
  >
28
29
  <Flex direction="column" width="100%">
29
30
  {projects.map((project) => (
30
- <ProjectItem key={project.id} {...project}>
31
+ <ProjectItem key={project.id} {...project} labels={labels}>
31
32
  {children}
32
33
  </ProjectItem>
33
34
  ))}