@aortl/admin-react 0.9.0 → 0.11.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.
package/dist/index.cjs CHANGED
@@ -100,7 +100,7 @@ function renderIcon(icon, size = "1em") {
100
100
  }
101
101
  //#endregion
102
102
  //#region src/Alert.tsx
103
- function AlertRoot({ variant = "info", icon, title, description, className, role, children, ...rest }) {
103
+ function AlertRoot({ variant, icon, title, description, className, role, children, ...rest }) {
104
104
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
105
105
  role: role ?? (variant === "danger" || variant === "warning" ? "alert" : "status"),
106
106
  className: cn(["alert", `alert-${variant}`], className),
@@ -183,7 +183,7 @@ function Badge({ variant = "neutral", size = "md", icon, className, children, ..
183
183
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
184
184
  className: cn([
185
185
  "badge",
186
- `badge-${variant}`,
186
+ variant !== "neutral" && `badge-${variant}`,
187
187
  size !== "md" && `badge-${size}`
188
188
  ], className),
189
189
  ...rest,
@@ -447,7 +447,7 @@ function useHotkey(keys, handler, options) {
447
447
  }
448
448
  //#endregion
449
449
  //#region src/Button.tsx
450
- function Button({ variant = "primary", size = "md", fullWidth, loading, icon, iconTrailing, hotkey, className, type = "button", disabled, children, onClick, ...rest }) {
450
+ function Button({ variant = "default", size = "md", fullWidth, loading, icon, iconTrailing, hotkey, className, type = "button", disabled, children, onClick, ...rest }) {
451
451
  const { ariaKeyShortcuts, primaryChord } = useHotkey(hotkey, (e) => onClick?.(e), { enabled: !disabled && !loading });
452
452
  const iconOnly = children == null && (icon != null || iconTrailing != null);
453
453
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react_button.Button, {
@@ -458,7 +458,7 @@ function Button({ variant = "primary", size = "md", fullWidth, loading, icon, ic
458
458
  "aria-keyshortcuts": ariaKeyShortcuts,
459
459
  className: cn([
460
460
  "btn",
461
- `btn-${variant}`,
461
+ variant !== "default" && `btn-${variant}`,
462
462
  size !== "md" && `btn-${size}`,
463
463
  fullWidth && "btn-full-width",
464
464
  loading && "btn-loading",
@@ -531,7 +531,7 @@ function Input({ variant = "bordered", inputSize = "md", className, type = "text
531
531
  type,
532
532
  className: cn([
533
533
  "input",
534
- `input-${variant}`,
534
+ variant !== "bordered" && `input-${variant}`,
535
535
  inputSize !== "md" && `input-${inputSize}`
536
536
  ], className),
537
537
  ...rest
@@ -544,7 +544,7 @@ function FileInput({ variant = "bordered", inputSize = "md", className, ...rest
544
544
  type: "file",
545
545
  className: cn([
546
546
  "file-input",
547
- `file-input-${variant}`,
547
+ variant !== "bordered" && `file-input-${variant}`,
548
548
  inputSize !== "md" && `file-input-${inputSize}`
549
549
  ], className),
550
550
  ...rest
@@ -763,7 +763,7 @@ function Textarea({ variant = "bordered", textareaSize = "md", className, ...res
763
763
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
764
764
  className: cn([
765
765
  "textarea",
766
- `textarea-${variant}`,
766
+ variant !== "bordered" && `textarea-${variant}`,
767
767
  textareaSize !== "md" && `textarea-${textareaSize}`
768
768
  ], className),
769
769
  ...rest
@@ -879,7 +879,7 @@ function SelectTrigger({ variant = "bordered", triggerSize = "md", className, ..
879
879
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_select.Select.Trigger, {
880
880
  className: cn([
881
881
  "select",
882
- `select-${variant}`,
882
+ variant !== "bordered" && `select-${variant}`,
883
883
  triggerSize !== "md" && `select-${triggerSize}`
884
884
  ], className),
885
885
  ...rest
@@ -975,6 +975,24 @@ var Select = Object.assign(SelectRoot, {
975
975
  GroupLabel: SelectGroupLabel
976
976
  });
977
977
  //#endregion
978
+ //#region src/Container.tsx
979
+ /**
980
+ * Page content region: a centered, max-width column that also owns the
981
+ * vertical gap between stacked sections. Place inside `<AppShell.Main>`,
982
+ * which provides no padding of its own. Distinct from the `.Container`
983
+ * escape hatch (e.g. `Card.Container`) — this is a standalone page region.
984
+ */
985
+ function Container({ size = "md", compact, className, ...rest }) {
986
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
987
+ className: cn([
988
+ "container",
989
+ size !== "md" && `container-${size}`,
990
+ compact && "container-compact"
991
+ ], className),
992
+ ...rest
993
+ });
994
+ }
995
+ //#endregion
978
996
  //#region src/Card.tsx
979
997
  /**
980
998
  * The bare `.card` container — no body, no title. Use this when you need to
@@ -1060,6 +1078,40 @@ var Card = Object.assign(CardRoot, {
1060
1078
  Actions: CardActions
1061
1079
  });
1062
1080
  //#endregion
1081
+ //#region src/StatCard.tsx
1082
+ /**
1083
+ * Compact KPI tile — `label / value / detail`. Outer chrome matches `<Card>`
1084
+ * (border, radius, shadow) but the inner shape inverts the visual hierarchy:
1085
+ * value dominates, label is the small annotation. For free-form tiles, use
1086
+ * `<Card>`; for label/value tables, use `<PropertyList>`.
1087
+ */
1088
+ function StatCard({ label, value, detail, icon, compact, bordered, className, children, ...rest }) {
1089
+ const hasLabel = icon !== void 0 || label !== void 0;
1090
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1091
+ className: cn([
1092
+ "stat-card",
1093
+ compact && "stat-card-compact",
1094
+ bordered && "stat-card-bordered"
1095
+ ], className),
1096
+ ...rest,
1097
+ children: [
1098
+ hasLabel ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
1099
+ className: cn("stat-card-label", void 0),
1100
+ children: [renderIcon(icon), label]
1101
+ }) : null,
1102
+ value !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1103
+ className: cn("stat-card-value", void 0),
1104
+ children: value
1105
+ }) : null,
1106
+ detail !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1107
+ className: cn("stat-card-detail", void 0),
1108
+ children: detail
1109
+ }) : null,
1110
+ children
1111
+ ]
1112
+ });
1113
+ }
1114
+ //#endregion
1063
1115
  //#region src/Dialog.tsx
1064
1116
  var DialogContext = (0, react.createContext)(null);
1065
1117
  function DefaultCloseIcon() {
@@ -1189,12 +1241,43 @@ var Dialog = Object.assign(DialogRoot, {
1189
1241
  });
1190
1242
  //#endregion
1191
1243
  //#region src/Field.tsx
1192
- function FieldRoot({ className, ...rest }) {
1244
+ /**
1245
+ * The bare `.field` container. Use this when the default layout doesn't fit —
1246
+ * multiple validity-keyed `<Field.Error>` messages, a control that needs to
1247
+ * sit between description and error, etc.
1248
+ */
1249
+ function FieldContainer({ className, ...rest }) {
1193
1250
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Root, {
1194
1251
  className: cn("field", className),
1195
1252
  ...rest
1196
1253
  });
1197
1254
  }
1255
+ /**
1256
+ * Standard field: a `.field` container that lays out an optional label, the
1257
+ * control passed as `children`, an optional description, and an optional
1258
+ * single-message error. For anything outside that shape, use
1259
+ * `<Field.Container>` and compose by hand.
1260
+ */
1261
+ function FieldRoot({ label, description, error, required, inline, className, children, ...rest }) {
1262
+ const labelEl = label !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldLabel, {
1263
+ required,
1264
+ children: label
1265
+ }) : null;
1266
+ const descriptionEl = description !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldDescription, { children: description }) : null;
1267
+ const errorEl = error !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldError, {
1268
+ match: true,
1269
+ children: error
1270
+ }) : null;
1271
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(FieldContainer, {
1272
+ className: cn(inline && "field-row", className),
1273
+ ...rest,
1274
+ children: [
1275
+ inline ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [children, labelEl] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [labelEl, children] }),
1276
+ descriptionEl,
1277
+ errorEl
1278
+ ]
1279
+ });
1280
+ }
1198
1281
  function FieldLabel({ className, required, ...rest }) {
1199
1282
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Label, {
1200
1283
  "data-required": required ? "" : void 0,
@@ -1215,6 +1298,7 @@ function FieldError({ className, ...rest }) {
1215
1298
  });
1216
1299
  }
1217
1300
  var Field = Object.assign(FieldRoot, {
1301
+ Container: FieldContainer,
1218
1302
  Label: FieldLabel,
1219
1303
  Description: FieldDescription,
1220
1304
  Error: FieldError
@@ -1403,7 +1487,7 @@ function TabsRoot({ variant = "bordered", size = "md", fullWidth = false, classN
1403
1487
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tabs.Tabs.Root, {
1404
1488
  className: cn([
1405
1489
  "tabs",
1406
- `tabs-${variant}`,
1490
+ variant !== "bordered" && `tabs-${variant}`,
1407
1491
  size !== "md" && `tabs-${size}`,
1408
1492
  fullWidth && "tabs-full-width"
1409
1493
  ], className),
@@ -1441,6 +1525,20 @@ var Tabs = Object.assign(TabsRoot, {
1441
1525
  Indicator: TabsIndicator
1442
1526
  });
1443
1527
  //#endregion
1528
+ //#region src/CodeBlock.tsx
1529
+ /**
1530
+ * Styled `<pre>` for logs, JSON dumps, terminal output, raw model output.
1531
+ * Theme-following surface via `--color-code-surface` / `--color-code-text`.
1532
+ * Wraps by default; opt out with `nowrap`. No syntax highlighting — layer
1533
+ * Shiki/Prism on a nested `<code>` if needed.
1534
+ */
1535
+ function CodeBlock({ nowrap, className, ...rest }) {
1536
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
1537
+ className: cn(["code-block", nowrap && "code-block-nowrap"], className),
1538
+ ...rest
1539
+ });
1540
+ }
1541
+ //#endregion
1444
1542
  //#region src/Tooltip.tsx
1445
1543
  function TooltipProvider(props) {
1446
1544
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tooltip.Tooltip.Provider, { ...props });
@@ -1838,6 +1936,8 @@ exports.Button = Button;
1838
1936
  exports.ButtonGroup = ButtonGroup;
1839
1937
  exports.Card = Card;
1840
1938
  exports.Checkbox = Checkbox;
1939
+ exports.CodeBlock = CodeBlock;
1940
+ exports.Container = Container;
1841
1941
  exports.Dialog = Dialog;
1842
1942
  exports.Field = Field;
1843
1943
  exports.FileInput = FileInput;
@@ -1856,6 +1956,7 @@ exports.RadioGroup = RadioGroup;
1856
1956
  exports.Select = Select;
1857
1957
  exports.Sidebar = Sidebar;
1858
1958
  exports.Spinner = Spinner;
1959
+ exports.StatCard = StatCard;
1859
1960
  exports.Switch = Switch;
1860
1961
  exports.Table = Table;
1861
1962
  exports.Tabs = Tabs;