@abpjs/ui 0.2.0-next.23 → 0.2.0-next.25

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/ai.js CHANGED
@@ -18,7 +18,7 @@ import { Button as Button2, CheckboxField, DataTable, FormDialog, HostSlot, Inli
18
18
  import { useState } from "react";
19
19
  import { HStack, Input, Stack, Text } from "@chakra-ui/react";
20
20
  import { Trash2 } from "lucide-react";
21
- import { Button, Field, IconButton, InlineAlert, SelectField, useFormatters } from "@abpjs/ui";
21
+ import { AddButton, Button, Field, IconButton, InlineAlert, SelectField, useFormatters } from "@abpjs/ui";
22
22
 
23
23
  // src/areas/ai/texts.ts
24
24
  import { createAreaTexts } from "@abpjs/ui";
@@ -410,11 +410,11 @@ function LimitsEditor({ limits, onSave, onChange, busy, error }) {
410
410
  ) }),
411
411
  /* @__PURE__ */ jsx(Field, { label: i === 0 ? t("limitPeriod") : void 0, flex: "1", children: r.kind === "call-tokens" ? /* @__PURE__ */ jsx(Text, { textStyle: "sm", color: "fg.muted", py: "2", children: t("perReply") }) : /* @__PURE__ */ jsx(SelectField, { value: r.period, options: periods, "aria-label": t("limitPeriod"), onChange: (e) => set(i, { period: e.target.value }) }) }),
412
412
  /* @__PURE__ */ jsx(Field, { label: i === 0 ? t("limitAmount") : void 0, flex: "1", children: /* @__PURE__ */ jsx(Input, { type: "number", min: 0, step: "any", value: r.amount, dir: "ltr", "aria-label": t("limitAmount"), onChange: (e) => set(i, { amount: e.target.value }) }) }),
413
- /* @__PURE__ */ jsx(IconButton, { "aria-label": t("removeLimit"), size: "sm", onClick: () => setDraft(rows.filter((_, j) => j !== i)), children: /* @__PURE__ */ jsx(Trash2, {}) })
413
+ /* @__PURE__ */ jsx(IconButton, { remove: true, "aria-label": t("removeLimit"), size: "sm", onClick: () => setDraft(rows.filter((_, j) => j !== i)), children: /* @__PURE__ */ jsx(Trash2, {}) })
414
414
  ] }, i)),
415
415
  rows.length === 0 && /* @__PURE__ */ jsx(Text, { textStyle: "sm", color: "fg.muted", children: t("noLimits") }),
416
416
  /* @__PURE__ */ jsxs(HStack, { children: [
417
- /* @__PURE__ */ jsx(Button, { size: "sm", variant: "secondary", onClick: () => setDraft([...rows, { kind: "cost", period: "day", amount: "" }]), children: t("addLimit") }),
417
+ /* @__PURE__ */ jsx(AddButton, { onClick: () => setDraft([...rows, { kind: "cost", period: "day", amount: "" }]), children: t("addLimit") }),
418
418
  onSave && /* @__PURE__ */ jsx(Button, { size: "sm", loading: busy, disabled: draft === null, onClick: () => void save(), children: t("save") })
419
419
  ] })
420
420
  ] });
@@ -685,7 +685,7 @@ function AccessEditor({ scope, models, onClose, onSaved }) {
685
685
  import { useMemo as useMemo2, useState as useState3 } from "react";
686
686
  import { HStack as HStack2, Input as Input2, Stack as Stack3, Text as Text3 } from "@chakra-ui/react";
687
687
  import { Trash2 as Trash22 } from "lucide-react";
688
- import { Button as Button3, Field as Field2, IconButton as IconButton2, InlineAlert as InlineAlert3, notify as notify2, Panel as Panel2, SelectField as SelectField2, useApiAction as useApiAction2, useAreaRequest as useAreaRequest2 } from "@abpjs/ui";
688
+ import { AddButton as AddButton2, Button as Button3, Field as Field2, IconButton as IconButton2, InlineAlert as InlineAlert3, notify as notify2, Panel as Panel2, SelectField as SelectField2, useApiAction as useApiAction2, useAreaRequest as useAreaRequest2 } from "@abpjs/ui";
689
689
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
690
690
  var target = (key) => {
691
691
  const at = key.indexOf(":");
@@ -755,11 +755,11 @@ function AliasesPanel({ scopeId, aliases, inherited, models, onSaved }) {
755
755
  onChange: (e) => setDraft(rows.map((x, j) => j === i ? { ...x, key: e.target.value } : x))
756
756
  }
757
757
  ) }),
758
- /* @__PURE__ */ jsx3(IconButton2, { "aria-label": t("removeAlias", { name: r.name || "\u2026" }), size: "sm", onClick: () => setDraft(rows.filter((_, j) => j !== i)), children: /* @__PURE__ */ jsx3(Trash22, {}) })
758
+ /* @__PURE__ */ jsx3(IconButton2, { remove: true, "aria-label": t("removeAlias", { name: r.name || "\u2026" }), size: "sm", onClick: () => setDraft(rows.filter((_, j) => j !== i)), children: /* @__PURE__ */ jsx3(Trash22, {}) })
759
759
  ] }, i)),
760
760
  rows.length === 0 && /* @__PURE__ */ jsx3(Text3, { textStyle: "sm", color: "fg.muted", children: t("noAliases") }),
761
761
  /* @__PURE__ */ jsxs3(HStack2, { children: [
762
- /* @__PURE__ */ jsx3(Button3, { size: "sm", variant: "secondary", onClick: () => setDraft([...rows, { name: "", key: usable[0]?.key ?? "", rest: [] }]), disabled: usable.length === 0, children: t("addAlias") }),
762
+ /* @__PURE__ */ jsx3(AddButton2, { onClick: () => setDraft([...rows, { name: "", key: usable[0]?.key ?? "", rest: [] }]), disabled: usable.length === 0, children: t("addAlias") }),
763
763
  usable.length === 0 && /* @__PURE__ */ jsx3(Text3, { textStyle: "sm", color: "fg.muted", children: t("noUsable") })
764
764
  ] }),
765
765
  shownInherited.length > 0 && /* @__PURE__ */ jsxs3(Stack3, { gap: "1", children: [