@aortl/admin-react 0.9.0 → 0.10.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/CodeBlock.d.ts +14 -0
- package/dist/CodeBlock.d.ts.map +1 -0
- package/dist/Field.d.ts +36 -11
- package/dist/Field.d.ts.map +1 -1
- package/dist/StatCard.d.ts +22 -0
- package/dist/StatCard.d.ts.map +1 -0
- package/dist/admin.scoped.css +70 -2
- package/dist/index.cjs +83 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +82 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
export interface CodeBlockProps extends ComponentProps<"pre"> {
|
|
3
|
+
/** Don't wrap long lines — let them overflow horizontally instead. Pair
|
|
4
|
+
* with an inline `max-height` to clamp vertical growth. */
|
|
5
|
+
nowrap?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Styled `<pre>` for logs, JSON dumps, terminal output, raw model output.
|
|
9
|
+
* Theme-following surface via `--color-code-surface` / `--color-code-text`.
|
|
10
|
+
* Wraps by default; opt out with `nowrap`. No syntax highlighting — layer
|
|
11
|
+
* Shiki/Prism on a nested `<code>` if needed.
|
|
12
|
+
*/
|
|
13
|
+
export declare function CodeBlock({ nowrap, className, ...rest }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=CodeBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../src/CodeBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC3D;gEAC4D;IAC5D,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,2CAEvE"}
|
package/dist/Field.d.ts
CHANGED
|
@@ -1,18 +1,42 @@
|
|
|
1
1
|
import { Field as BaseField } from '@base-ui/react/field';
|
|
2
|
-
import { ComponentProps } from 'react';
|
|
2
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Thin wrappers around Base UI's Field primitives that apply the design
|
|
5
|
-
* system's class names.
|
|
6
|
-
*
|
|
7
|
-
* <Field name="email">
|
|
8
|
-
* <Field.Label>Email</Field.Label>
|
|
9
|
-
* <Input type="email" required />
|
|
10
|
-
* <Field.Description>We'll never share your email.</Field.Description>
|
|
11
|
-
* <Field.Error match="valueMissing">Email is required.</Field.Error>
|
|
12
|
-
* </Field>
|
|
5
|
+
* system's class names.
|
|
13
6
|
*/
|
|
14
|
-
export type
|
|
15
|
-
|
|
7
|
+
export type FieldContainerProps = ComponentProps<typeof BaseField.Root>;
|
|
8
|
+
/**
|
|
9
|
+
* The bare `.field` container. Use this when the default layout doesn't fit —
|
|
10
|
+
* multiple validity-keyed `<Field.Error>` messages, a control that needs to
|
|
11
|
+
* sit between description and error, etc.
|
|
12
|
+
*/
|
|
13
|
+
declare function FieldContainer({ className, ...rest }: FieldContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export interface FieldProps extends FieldContainerProps {
|
|
15
|
+
/** Renders as `<Field.Label>`. */
|
|
16
|
+
label?: ReactNode;
|
|
17
|
+
/** Renders as `<Field.Description>`. */
|
|
18
|
+
description?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Single-message error. Renders as `<Field.Error match={true}>` — shown
|
|
21
|
+
* whenever the contained control fails validation. For per-`ValidityState`
|
|
22
|
+
* messages, use `<Field.Container>` and compose `<Field.Error>` directly.
|
|
23
|
+
*/
|
|
24
|
+
error?: ReactNode;
|
|
25
|
+
/** Marks the label with a red asterisk via `data-required`. */
|
|
26
|
+
required?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Inline layout — control sits beside its label rather than above it.
|
|
29
|
+
* Pairs with switches and single checkboxes. Applies `.field-row`.
|
|
30
|
+
*/
|
|
31
|
+
inline?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Standard field: a `.field` container that lays out an optional label, the
|
|
35
|
+
* control passed as `children`, an optional description, and an optional
|
|
36
|
+
* single-message error. For anything outside that shape, use
|
|
37
|
+
* `<Field.Container>` and compose by hand.
|
|
38
|
+
*/
|
|
39
|
+
declare function FieldRoot({ label, description, error, required, inline, className, children, ...rest }: FieldProps): import("react/jsx-runtime").JSX.Element;
|
|
16
40
|
export type FieldLabelProps = ComponentProps<typeof BaseField.Label> & {
|
|
17
41
|
/** Renders a red asterisk after the label text via `data-required`. */
|
|
18
42
|
required?: boolean;
|
|
@@ -23,6 +47,7 @@ declare function FieldDescription({ className, ...rest }: FieldDescriptionProps)
|
|
|
23
47
|
export type FieldErrorProps = ComponentProps<typeof BaseField.Error>;
|
|
24
48
|
declare function FieldError({ className, ...rest }: FieldErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
25
49
|
export declare const Field: typeof FieldRoot & {
|
|
50
|
+
Container: typeof FieldContainer;
|
|
26
51
|
Label: typeof FieldLabel;
|
|
27
52
|
Description: typeof FieldDescription;
|
|
28
53
|
Error: typeof FieldError;
|
package/dist/Field.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../src/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../src/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD;;;GAGG;AAEH,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;AAExE;;;;GAIG;AACH,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,mBAAmB,2CAElE;AAED,MAAM,WAAW,UAAW,SAAQ,mBAAmB;IACrD,kCAAkC;IAClC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,wCAAwC;IACxC,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,WAAW,EACX,KAAK,EACL,QAAQ,EACR,MAAM,EACN,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,UAAU,2CAsBZ;AAED,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,GAAG;IACrE,uEAAuE;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,eAAe,2CAQpE;AAED,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,WAAW,CAAC,CAAC;AAEjF,iBAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,qBAAqB,2CAEtE;AAED,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;AAErE,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,eAAe,2CAE1D;AAED,eAAO,MAAM,KAAK;;;;;CAKhB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { IconProp } from './icon';
|
|
3
|
+
export interface StatCardProps extends Omit<ComponentProps<"div">, "label"> {
|
|
4
|
+
/** Small annotation above the value (e.g. "Total Generations"). */
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
/** The headline metric. Rendered with `tabular-nums` so digits don't shift between values. */
|
|
7
|
+
value?: ReactNode;
|
|
8
|
+
/** Subordinate line under the value (e.g. "42 completed / 12 pending"). */
|
|
9
|
+
detail?: ReactNode;
|
|
10
|
+
/** Leading icon in the label row. */
|
|
11
|
+
icon?: IconProp;
|
|
12
|
+
compact?: boolean;
|
|
13
|
+
bordered?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Compact KPI tile — `label / value / detail`. Outer chrome matches `<Card>`
|
|
17
|
+
* (border, radius, shadow) but the inner shape inverts the visual hierarchy:
|
|
18
|
+
* value dominates, label is the small annotation. For free-form tiles, use
|
|
19
|
+
* `<Card>`; for label/value tables, use `<PropertyList>`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function StatCard({ label, value, detail, icon, compact, bordered, className, children, ...rest }: StatCardProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=StatCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatCard.d.ts","sourceRoot":"","sources":["../src/StatCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEnD,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzE,mEAAmE;IACnE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,8FAA8F;IAC9F,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,qCAAqC;IACrC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,KAAK,EACL,MAAM,EACN,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,aAAa,2CAqBf"}
|
package/dist/admin.scoped.css
CHANGED
|
@@ -275,6 +275,8 @@
|
|
|
275
275
|
--text-lg--line-height: calc(1.75 / 1.125);
|
|
276
276
|
--text-xl: 1.25rem;
|
|
277
277
|
--text-xl--line-height: calc(1.75 / 1.25);
|
|
278
|
+
--text-2xl: 1.5rem;
|
|
279
|
+
--text-2xl--line-height: calc(2 / 1.5);
|
|
278
280
|
--font-weight-medium: 500;
|
|
279
281
|
--font-weight-semibold: 600;
|
|
280
282
|
--font-weight-bold: 700;
|
|
@@ -416,6 +418,8 @@
|
|
|
416
418
|
--color-text-muted: light-dark(var(--color-base-600), var(--color-base-500));
|
|
417
419
|
--color-border: light-dark(var(--color-base-150), var(--color-base-850));
|
|
418
420
|
--color-border-strong: light-dark(var(--color-base-300), var(--color-base-700));
|
|
421
|
+
--color-code-surface: light-dark(var(--color-base-150), var(--color-base-950));
|
|
422
|
+
--color-code-text: light-dark(var(--color-base-800), var(--color-base-200));
|
|
419
423
|
--color-primary: light-dark(var(--color-blue-600), var(--color-blue-400));
|
|
420
424
|
--color-primary-hover: light-dark(var(--color-blue-700), var(--color-blue-300));
|
|
421
425
|
--color-primary-muted: light-dark(var(--color-blue-50), var(--color-blue-950));
|
|
@@ -797,7 +801,7 @@
|
|
|
797
801
|
color: var(--color-success);
|
|
798
802
|
}
|
|
799
803
|
:scope._ao-alert-warning ._ao-alert-title, :scope ._ao-alert-warning ._ao-alert-title, :scope._ao-alert-warning > :is(i, svg):first-child, :scope ._ao-alert-warning > :is(i, svg):first-child {
|
|
800
|
-
color: var(--color-
|
|
804
|
+
color: var(--color-text);
|
|
801
805
|
}
|
|
802
806
|
:scope._ao-alert-danger ._ao-alert-title, :scope ._ao-alert-danger ._ao-alert-title, :scope._ao-alert-danger > :is(i, svg):first-child, :scope ._ao-alert-danger > :is(i, svg):first-child {
|
|
803
807
|
color: var(--color-danger);
|
|
@@ -879,7 +883,7 @@
|
|
|
879
883
|
:scope._ao-badge-warning, :scope ._ao-badge-warning {
|
|
880
884
|
border-color: var(--color-warning-muted);
|
|
881
885
|
background-color: var(--color-warning-muted);
|
|
882
|
-
color: var(--color-
|
|
886
|
+
color: var(--color-text);
|
|
883
887
|
}
|
|
884
888
|
:scope._ao-badge-danger, :scope ._ao-badge-danger {
|
|
885
889
|
border-color: var(--color-danger-muted);
|
|
@@ -2293,6 +2297,54 @@
|
|
|
2293
2297
|
--tw-shadow: 0 0 #0000;
|
|
2294
2298
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
2295
2299
|
}
|
|
2300
|
+
:scope._ao-stat-card, :scope ._ao-stat-card {
|
|
2301
|
+
display: flex;
|
|
2302
|
+
flex-direction: column;
|
|
2303
|
+
gap: calc(var(--spacing) * 1);
|
|
2304
|
+
border-radius: var(--radius-xl);
|
|
2305
|
+
border-style: var(--tw-border-style);
|
|
2306
|
+
border-width: 1px;
|
|
2307
|
+
border-color: var(--color-border);
|
|
2308
|
+
background-color: var(--color-surface);
|
|
2309
|
+
padding: calc(var(--spacing) * 4);
|
|
2310
|
+
color: var(--color-text);
|
|
2311
|
+
--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.05));
|
|
2312
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
2313
|
+
}
|
|
2314
|
+
:scope._ao-stat-card-label, :scope ._ao-stat-card-label {
|
|
2315
|
+
display: flex;
|
|
2316
|
+
align-items: center;
|
|
2317
|
+
gap: calc(var(--spacing) * 2);
|
|
2318
|
+
font-size: var(--text-sm);
|
|
2319
|
+
line-height: var(--tw-leading, var(--text-sm--line-height));
|
|
2320
|
+
--tw-font-weight: var(--font-weight-medium);
|
|
2321
|
+
font-weight: var(--font-weight-medium);
|
|
2322
|
+
color: var(--color-text-muted);
|
|
2323
|
+
}
|
|
2324
|
+
:scope._ao-stat-card-value, :scope ._ao-stat-card-value {
|
|
2325
|
+
font-size: var(--text-2xl);
|
|
2326
|
+
line-height: var(--tw-leading, var(--text-2xl--line-height));
|
|
2327
|
+
--tw-leading: var(--leading-tight);
|
|
2328
|
+
line-height: var(--leading-tight);
|
|
2329
|
+
--tw-font-weight: var(--font-weight-bold);
|
|
2330
|
+
font-weight: var(--font-weight-bold);
|
|
2331
|
+
--tw-numeric-spacing: tabular-nums;
|
|
2332
|
+
font-variant-numeric: var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);
|
|
2333
|
+
}
|
|
2334
|
+
:scope._ao-stat-card-detail, :scope ._ao-stat-card-detail {
|
|
2335
|
+
font-size: var(--text-sm);
|
|
2336
|
+
line-height: var(--tw-leading, var(--text-sm--line-height));
|
|
2337
|
+
color: var(--color-text-muted);
|
|
2338
|
+
}
|
|
2339
|
+
:scope._ao-stat-card-compact, :scope ._ao-stat-card-compact {
|
|
2340
|
+
gap: calc(var(--spacing) * 0.5);
|
|
2341
|
+
padding: calc(var(--spacing) * 3);
|
|
2342
|
+
}
|
|
2343
|
+
:scope._ao-stat-card-bordered, :scope ._ao-stat-card-bordered {
|
|
2344
|
+
border-color: var(--color-border-strong);
|
|
2345
|
+
--tw-shadow: 0 0 #0000;
|
|
2346
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
2347
|
+
}
|
|
2296
2348
|
:scope._ao-dialog, :scope ._ao-dialog {
|
|
2297
2349
|
margin: auto;
|
|
2298
2350
|
flex-direction: column;
|
|
@@ -3701,6 +3753,22 @@
|
|
|
3701
3753
|
opacity: 100%;
|
|
3702
3754
|
transition: opacity 150ms ease-out 200ms, visibility 0s linear 200ms;
|
|
3703
3755
|
}
|
|
3756
|
+
:scope._ao-code-block, :scope ._ao-code-block {
|
|
3757
|
+
border-radius: var(--radius-lg);
|
|
3758
|
+
background-color: var(--color-code-surface);
|
|
3759
|
+
padding: calc(var(--spacing) * 3);
|
|
3760
|
+
font-family: var(--font-mono);
|
|
3761
|
+
font-size: var(--text-sm);
|
|
3762
|
+
line-height: var(--tw-leading, var(--text-sm--line-height));
|
|
3763
|
+
color: var(--color-code-text);
|
|
3764
|
+
white-space: pre-wrap;
|
|
3765
|
+
word-wrap: break-word;
|
|
3766
|
+
overflow: auto;
|
|
3767
|
+
}
|
|
3768
|
+
:scope._ao-code-block-nowrap, :scope ._ao-code-block-nowrap {
|
|
3769
|
+
white-space: pre;
|
|
3770
|
+
word-wrap: normal;
|
|
3771
|
+
}
|
|
3704
3772
|
:scope._ao-collapse, :scope ._ao-collapse {
|
|
3705
3773
|
visibility: collapse;
|
|
3706
3774
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -1060,6 +1060,40 @@ var Card = Object.assign(CardRoot, {
|
|
|
1060
1060
|
Actions: CardActions
|
|
1061
1061
|
});
|
|
1062
1062
|
//#endregion
|
|
1063
|
+
//#region src/StatCard.tsx
|
|
1064
|
+
/**
|
|
1065
|
+
* Compact KPI tile — `label / value / detail`. Outer chrome matches `<Card>`
|
|
1066
|
+
* (border, radius, shadow) but the inner shape inverts the visual hierarchy:
|
|
1067
|
+
* value dominates, label is the small annotation. For free-form tiles, use
|
|
1068
|
+
* `<Card>`; for label/value tables, use `<PropertyList>`.
|
|
1069
|
+
*/
|
|
1070
|
+
function StatCard({ label, value, detail, icon, compact, bordered, className, children, ...rest }) {
|
|
1071
|
+
const hasLabel = icon !== void 0 || label !== void 0;
|
|
1072
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1073
|
+
className: cn([
|
|
1074
|
+
"stat-card",
|
|
1075
|
+
compact && "stat-card-compact",
|
|
1076
|
+
bordered && "stat-card-bordered"
|
|
1077
|
+
], className),
|
|
1078
|
+
...rest,
|
|
1079
|
+
children: [
|
|
1080
|
+
hasLabel ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
1081
|
+
className: cn("stat-card-label", void 0),
|
|
1082
|
+
children: [renderIcon(icon), label]
|
|
1083
|
+
}) : null,
|
|
1084
|
+
value !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1085
|
+
className: cn("stat-card-value", void 0),
|
|
1086
|
+
children: value
|
|
1087
|
+
}) : null,
|
|
1088
|
+
detail !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1089
|
+
className: cn("stat-card-detail", void 0),
|
|
1090
|
+
children: detail
|
|
1091
|
+
}) : null,
|
|
1092
|
+
children
|
|
1093
|
+
]
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
//#endregion
|
|
1063
1097
|
//#region src/Dialog.tsx
|
|
1064
1098
|
var DialogContext = (0, react.createContext)(null);
|
|
1065
1099
|
function DefaultCloseIcon() {
|
|
@@ -1189,12 +1223,43 @@ var Dialog = Object.assign(DialogRoot, {
|
|
|
1189
1223
|
});
|
|
1190
1224
|
//#endregion
|
|
1191
1225
|
//#region src/Field.tsx
|
|
1192
|
-
|
|
1226
|
+
/**
|
|
1227
|
+
* The bare `.field` container. Use this when the default layout doesn't fit —
|
|
1228
|
+
* multiple validity-keyed `<Field.Error>` messages, a control that needs to
|
|
1229
|
+
* sit between description and error, etc.
|
|
1230
|
+
*/
|
|
1231
|
+
function FieldContainer({ className, ...rest }) {
|
|
1193
1232
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Root, {
|
|
1194
1233
|
className: cn("field", className),
|
|
1195
1234
|
...rest
|
|
1196
1235
|
});
|
|
1197
1236
|
}
|
|
1237
|
+
/**
|
|
1238
|
+
* Standard field: a `.field` container that lays out an optional label, the
|
|
1239
|
+
* control passed as `children`, an optional description, and an optional
|
|
1240
|
+
* single-message error. For anything outside that shape, use
|
|
1241
|
+
* `<Field.Container>` and compose by hand.
|
|
1242
|
+
*/
|
|
1243
|
+
function FieldRoot({ label, description, error, required, inline, className, children, ...rest }) {
|
|
1244
|
+
const labelEl = label !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldLabel, {
|
|
1245
|
+
required,
|
|
1246
|
+
children: label
|
|
1247
|
+
}) : null;
|
|
1248
|
+
const descriptionEl = description !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldDescription, { children: description }) : null;
|
|
1249
|
+
const errorEl = error !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldError, {
|
|
1250
|
+
match: true,
|
|
1251
|
+
children: error
|
|
1252
|
+
}) : null;
|
|
1253
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(FieldContainer, {
|
|
1254
|
+
className: cn(inline && "field-row", className),
|
|
1255
|
+
...rest,
|
|
1256
|
+
children: [
|
|
1257
|
+
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] }),
|
|
1258
|
+
descriptionEl,
|
|
1259
|
+
errorEl
|
|
1260
|
+
]
|
|
1261
|
+
});
|
|
1262
|
+
}
|
|
1198
1263
|
function FieldLabel({ className, required, ...rest }) {
|
|
1199
1264
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Label, {
|
|
1200
1265
|
"data-required": required ? "" : void 0,
|
|
@@ -1215,6 +1280,7 @@ function FieldError({ className, ...rest }) {
|
|
|
1215
1280
|
});
|
|
1216
1281
|
}
|
|
1217
1282
|
var Field = Object.assign(FieldRoot, {
|
|
1283
|
+
Container: FieldContainer,
|
|
1218
1284
|
Label: FieldLabel,
|
|
1219
1285
|
Description: FieldDescription,
|
|
1220
1286
|
Error: FieldError
|
|
@@ -1441,6 +1507,20 @@ var Tabs = Object.assign(TabsRoot, {
|
|
|
1441
1507
|
Indicator: TabsIndicator
|
|
1442
1508
|
});
|
|
1443
1509
|
//#endregion
|
|
1510
|
+
//#region src/CodeBlock.tsx
|
|
1511
|
+
/**
|
|
1512
|
+
* Styled `<pre>` for logs, JSON dumps, terminal output, raw model output.
|
|
1513
|
+
* Theme-following surface via `--color-code-surface` / `--color-code-text`.
|
|
1514
|
+
* Wraps by default; opt out with `nowrap`. No syntax highlighting — layer
|
|
1515
|
+
* Shiki/Prism on a nested `<code>` if needed.
|
|
1516
|
+
*/
|
|
1517
|
+
function CodeBlock({ nowrap, className, ...rest }) {
|
|
1518
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
1519
|
+
className: cn(["code-block", nowrap && "code-block-nowrap"], className),
|
|
1520
|
+
...rest
|
|
1521
|
+
});
|
|
1522
|
+
}
|
|
1523
|
+
//#endregion
|
|
1444
1524
|
//#region src/Tooltip.tsx
|
|
1445
1525
|
function TooltipProvider(props) {
|
|
1446
1526
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tooltip.Tooltip.Provider, { ...props });
|
|
@@ -1838,6 +1918,7 @@ exports.Button = Button;
|
|
|
1838
1918
|
exports.ButtonGroup = ButtonGroup;
|
|
1839
1919
|
exports.Card = Card;
|
|
1840
1920
|
exports.Checkbox = Checkbox;
|
|
1921
|
+
exports.CodeBlock = CodeBlock;
|
|
1841
1922
|
exports.Dialog = Dialog;
|
|
1842
1923
|
exports.Field = Field;
|
|
1843
1924
|
exports.FileInput = FileInput;
|
|
@@ -1856,6 +1937,7 @@ exports.RadioGroup = RadioGroup;
|
|
|
1856
1937
|
exports.Select = Select;
|
|
1857
1938
|
exports.Sidebar = Sidebar;
|
|
1858
1939
|
exports.Spinner = Spinner;
|
|
1940
|
+
exports.StatCard = StatCard;
|
|
1859
1941
|
exports.Switch = Switch;
|
|
1860
1942
|
exports.Table = Table;
|
|
1861
1943
|
exports.Tabs = Tabs;
|