@nadicodeai/ui 0.16.0 → 0.17.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/components/automation-section.d.ts +4 -2
- package/dist/components/automation-section.d.ts.map +1 -1
- package/dist/components/automation-section.js +1 -1
- package/dist/components/settings-section.d.ts.map +1 -1
- package/dist/components/settings-section.js +0 -10
- package/docs/component-classification.md +1 -1
- package/docs/product-compositions.md +3 -3
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Input } from "./input";
|
|
3
|
-
import {
|
|
3
|
+
import { type SettingsFieldControlProps, SettingsSection } from "./settings-section";
|
|
4
4
|
type AutomationStatus = "ready" | "running" | "paused" | "error" | "disabled";
|
|
5
5
|
type AutomationItem = {
|
|
6
6
|
id: string;
|
|
@@ -34,7 +34,9 @@ type AutomationSettingsField = {
|
|
|
34
34
|
value?: string;
|
|
35
35
|
placeholder?: string;
|
|
36
36
|
type?: React.ComponentProps<typeof Input>["type"];
|
|
37
|
-
control?:
|
|
37
|
+
control?: (props: {
|
|
38
|
+
controlProps: SettingsFieldControlProps;
|
|
39
|
+
}) => React.ReactNode;
|
|
38
40
|
};
|
|
39
41
|
type ProviderSettingsProps = Omit<React.ComponentProps<typeof SettingsSection>, "children"> & {
|
|
40
42
|
fields: AutomationSettingsField[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automation-section.d.ts","sourceRoot":"","sources":["../../src/components/automation-section.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAU3C,OAAO,
|
|
1
|
+
{"version":3,"file":"automation-section.d.ts","sourceRoot":"","sources":["../../src/components/automation-section.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,EAAE,KA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,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;AAChG,YAAY,EACV,cAAc,EACd,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,0BAA0B,EAC1B,wBAAwB,EACxB,iCAAiC,EACjC,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,qBAAqB,GACtB,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { Badge } from "./badge.js";
|
|
|
6
6
|
import { FeedbackState } from "./feedback-state.js";
|
|
7
7
|
import { Input } from "./input.js";
|
|
8
8
|
import { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemMedia, ItemTitle, } from "./item.js";
|
|
9
|
-
import { SettingsField, SettingsSection } from "./settings-section.js";
|
|
9
|
+
import { SettingsField, SettingsSection, } from "./settings-section.js";
|
|
10
10
|
import { Switch } from "./switch.js";
|
|
11
11
|
const automationStatusMeta = {
|
|
12
12
|
ready: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-section.d.ts","sourceRoot":"","sources":["../../src/components/settings-section.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,KAAK,EAMN,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,yBAAyB,GAAG;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,KAAK,qBAAqB,GACtB,KAAK,CAAC,SAAS,GACf,CAAC,CAAC,KAAK,EAAE;IAAE,YAAY,EAAE,yBAAyB,CAAA;CAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"settings-section.d.ts","sourceRoot":"","sources":["../../src/components/settings-section.tsx"],"names":[],"mappings":"AAEA,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AO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,qBAAqB,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,qBAsCA;AAED,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as React from "react";
|
|
4
3
|
import { cn } from "../lib/utils.js";
|
|
5
4
|
import { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, } from "./field.js";
|
|
6
5
|
function renderSettingsFieldChildren(children, controlProps) {
|
|
7
6
|
if (typeof children === "function") {
|
|
8
7
|
return children({ controlProps });
|
|
9
8
|
}
|
|
10
|
-
if (React.isValidElement(children)) {
|
|
11
|
-
const childProps = children.props;
|
|
12
|
-
return React.cloneElement(children, {
|
|
13
|
-
...controlProps,
|
|
14
|
-
...childProps,
|
|
15
|
-
"aria-invalid": controlProps["aria-invalid"] ?? childProps["aria-invalid"],
|
|
16
|
-
"aria-describedby": controlProps["aria-describedby"] ?? childProps["aria-describedby"],
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
9
|
return children;
|
|
20
10
|
}
|
|
21
11
|
function SettingsSection({ title, description, actions, children, className, ...props }) {
|
|
@@ -20,7 +20,7 @@ copy, and behavior.
|
|
|
20
20
|
| Component | Classification | Built on | Required states | Package-owned accessibility | Fixture |
|
|
21
21
|
| --- | --- | --- | --- | --- | --- |
|
|
22
22
|
| `SettingsSection` | Net-new NadicodeAI product composition. | shadcn `FieldGroup` plus standard section markup. | header with optional actions; field group content. | section structure; no form behavior. | `../tests/guards/product-compositions.test.ts` |
|
|
23
|
-
| `SettingsField` | Net-new NadicodeAI product composition. | shadcn `Field`, `FieldLabel`, `FieldDescription`, and `FieldError`. | valid and invalid field rows; disabled rows. | `
|
|
23
|
+
| `SettingsField` | Net-new NadicodeAI product composition. | shadcn `Field`, `FieldLabel`, `FieldDescription`, and `FieldError`. | valid and invalid field rows; disabled rows. | Label `htmlFor`; render props receive control attributes; element controls require an explicit matching `id` and described-by wiring. | `../tests/guards/product-compositions.test.ts` |
|
|
24
24
|
| `FeedbackState` | Net-new central product state composition adapted from shadcn empty-state patterns. | shadcn `Empty` and lucide status icons. | `empty`, `loading`, `saving`, `error`, `permission`, `offline`, `no-results`, `fatal`. | `role="status"` for loading/saving; `role="alert"` for error, permission, offline, and fatal. | `../tests/guards/product-compositions.test.ts` |
|
|
25
25
|
|
|
26
26
|
## App-Owned Boundaries
|
|
@@ -24,7 +24,7 @@ Fixtures live in:
|
|
|
24
24
|
|
|
25
25
|
| Component | Package owns | Consumer owns |
|
|
26
26
|
| --- | --- | --- |
|
|
27
|
-
| `SettingsSection` / `SettingsField` | Horizontal settings layout, `Field` composition, labels, descriptions, errors, `data-invalid`, and
|
|
27
|
+
| `SettingsSection` / `SettingsField` | Horizontal settings layout, `Field` composition, labels, descriptions, errors, deterministic description and error ids, `data-invalid`, and render-prop control wiring. | Form state, validation rules, submission, persistence, settings taxonomy, save/cancel behavior, and explicit control wiring for element children. |
|
|
28
28
|
| `FeedbackState` | Shared empty, loading, saving, error, permission, offline, no-results, and fatal state presentation. | Recovery actions, retry behavior, permission escalation, app-specific state language. |
|
|
29
29
|
|
|
30
30
|
## SettingsSection
|
|
@@ -55,9 +55,9 @@ Use `SettingsSection` and `SettingsField` for horizontal settings rows that need
|
|
|
55
55
|
| `title` / `description` / `actions` | Section header content and right-side action slot. |
|
|
56
56
|
| `id` / `label` | Required field identity and accessible label. |
|
|
57
57
|
| `description` / `error` / `invalid` | Field helper text, error text, and invalid state. |
|
|
58
|
-
| `children` |
|
|
58
|
+
| `children` | A render function receives `controlProps` for the real control and requires a client-component consumer. An element child renders unchanged and must put an explicit `id` matching the field `id` on its control. |
|
|
59
59
|
|
|
60
|
-
Accessibility:
|
|
60
|
+
Accessibility: `FieldLabel` uses the field `id` as `htmlFor`. The render-prop form passes `id`, `aria-invalid`, `aria-describedby`, `disabled`, and `required` to the consumer for placement on the real control. Functions cannot cross the React Server Component boundary, so this form requires a client-component consumer. Element children render unchanged; the consumer must put the matching `id` on the control and add `aria-describedby` when needed. Descriptions render with `${id}-description`, and errors render with `${id}-error`.
|
|
61
61
|
|
|
62
62
|
## FeedbackState
|
|
63
63
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadicodeai/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@base-ui/react": "^1.6.0",
|
|
66
|
-
"@nadicodeai/design-system": "0.
|
|
66
|
+
"@nadicodeai/design-system": "0.17.0",
|
|
67
67
|
"@rive-app/react-webgl2": "^4.29.1",
|
|
68
68
|
"@streamdown/cjk": "^1.0.3",
|
|
69
69
|
"@streamdown/code": "^1.1.1",
|