@antadesign/anta 0.3.26 → 0.3.27
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/README.md +26 -28
- package/dist/anta_helpers.d.ts +4 -0
- package/dist/anta_helpers.js +14 -0
- package/dist/box-types.d.ts +1 -1
- package/dist/bundle.css +1 -1
- package/dist/bundle.js +25 -25
- package/dist/capture-types.d.ts +156 -0
- package/dist/capture-types.js +0 -0
- package/dist/components/Box.d.ts +15 -0
- package/dist/components/Box.js +3 -11
- package/dist/components/Capture.d.ts +39 -0
- package/dist/components/Capture.js +36 -0
- package/dist/components/capture-props.d.ts +30 -0
- package/dist/components/capture-props.js +44 -0
- package/dist/elements/a-box.d.ts +1 -1
- package/dist/elements/a-box.js +11 -3
- package/dist/elements/a-capture.css +1 -0
- package/dist/elements/a-capture.d.ts +10 -0
- package/dist/elements/a-capture.js +24 -0
- package/dist/elements/a-checkbox.js +4 -4
- package/dist/elements/a-slider.js +6 -6
- package/dist/elements/capture-input.d.ts +5 -0
- package/dist/elements/capture-input.js +609 -0
- package/dist/elements/index.d.ts +1 -0
- package/dist/elements/index.js +3 -0
- package/dist/general_types.d.ts +34 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/jsx-runtime.d.ts +2 -1
- package/docs/accessibility.md +24 -0
- package/docs/changelog.md +22 -0
- package/docs/colors.md +141 -0
- package/docs/comparison.md +463 -28
- package/docs/components/avatar.md +13 -17
- package/docs/components/banner.md +13 -27
- package/docs/components/box.md +226 -154
- package/docs/components/breadcrumbs.md +7 -6
- package/docs/components/button.md +48 -37
- package/docs/components/capture.md +345 -0
- package/docs/components/card.md +17 -38
- package/docs/components/checkbox.md +16 -39
- package/docs/components/dialog.md +14 -36
- package/docs/components/expander.md +15 -40
- package/docs/components/icon.md +111 -9
- package/docs/components/input-autocomplete.md +9 -11
- package/docs/components/input-date.md +33 -23
- package/docs/components/input-time.md +15 -23
- package/docs/components/input.md +27 -76
- package/docs/components/loader.md +7 -5
- package/docs/components/menu.md +73 -77
- package/docs/components/progress.md +10 -14
- package/docs/components/radio.md +17 -36
- package/docs/components/select-faceted.md +7 -25
- package/docs/components/select.md +24 -97
- package/docs/components/slider.md +16 -21
- package/docs/components/steps.md +38 -8
- package/docs/components/switch.md +11 -14
- package/docs/components/tabs.md +52 -40
- package/docs/components/tag.md +11 -22
- package/docs/components/text.md +10 -23
- package/docs/components/title.md +7 -8
- package/docs/components/toaster.md +6 -3
- package/docs/components/tooltip.md +13 -23
- package/docs/index.md +3 -1
- package/docs/install-config.md +24 -0
- package/docs/normalization.md +45 -0
- package/docs/packages/stickers.md +56 -0
- package/docs/theming.md +270 -0
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -7,34 +7,32 @@ components in React, Preact via compat, plain HTML, and custom JSX runtimes via
|
|
|
7
7
|
|
|
8
8
|
## Documentation for coding agents
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
│ ├── button.md
|
|
29
|
-
│ ├── dialog.md
|
|
30
|
-
│ └── ...
|
|
31
|
-
└── dist/
|
|
10
|
+
The package includes version-matched Markdown documentation. Start with the
|
|
11
|
+
[documentation index](./docs/index.md) and open the pages relevant to your task.
|
|
12
|
+
Agents with filesystem access can read these files offline.
|
|
13
|
+
|
|
14
|
+
### AI setup
|
|
15
|
+
|
|
16
|
+
Append this section to your application's agent instruction file, such as
|
|
17
|
+
`AGENTS.md`, `CLAUDE.md`, or your tool's equivalent. Keep existing project rules:
|
|
18
|
+
|
|
19
|
+
```md
|
|
20
|
+
## Anta
|
|
21
|
+
|
|
22
|
+
Before Anta UI work, read
|
|
23
|
+
`node_modules/@antadesign/anta/docs/index.md`
|
|
24
|
+
and the pages relevant to the task.
|
|
25
|
+
Verify component names, imports, props, and event signatures against the
|
|
26
|
+
installed documentation and TypeScript declarations. Do not infer Anta APIs
|
|
27
|
+
from similarly named components in other libraries.
|
|
32
28
|
```
|
|
33
29
|
|
|
34
|
-
|
|
30
|
+
The path is relative to the application directory where Anta is installed.
|
|
31
|
+
Adjust it for your workspace or package-manager layout. Installing Anta does
|
|
32
|
+
not modify your agent configuration.
|
|
33
|
+
|
|
34
|
+
If a documented type differs from the installed `.d.ts` declarations, use the
|
|
35
|
+
declarations for the installed API.
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
3. Do **not** guess component names, props, or behavior from similarly named component libraries (e.g. MUI, Chakra UI, Radix UI, Mantine, shadcn/ui, Ant Design, etc.).
|
|
39
|
-
4. Use the installed package's TypeScript declarations (`*.d.ts`) as the source of truth for the installed package version.
|
|
40
|
-
5. If the Markdown documentation and TypeScript declarations disagree, prefer the TypeScript declarations, as they always correspond to the installed version.
|
|
37
|
+
For tools without local file access, provide the [web documentation index](https://anta.design/llms.txt)
|
|
38
|
+
and your installed Anta version. Web documentation may describe a newer release.
|
package/dist/anta_helpers.d.ts
CHANGED
|
@@ -53,6 +53,10 @@ export declare function nativeStateChange<D>(e: StateChangeEvent<D>): {
|
|
|
53
53
|
detail?: D;
|
|
54
54
|
isOwn: boolean;
|
|
55
55
|
};
|
|
56
|
+
/** Adapt a callback to native or renderer-wrapped custom events with non-null detail. */
|
|
57
|
+
export declare function customEventHandler<D>(handler?: (event: CustomEvent<D>, detail: D) => void): ((input: StateChangeEvent<D>) => void) | undefined;
|
|
58
|
+
/** Parse a finite number, falling back for missing, empty, or invalid values. */
|
|
59
|
+
export declare function finiteNumber(value: string | number | null, fallback: number): number;
|
|
56
60
|
export declare const IS_MAC: boolean;
|
|
57
61
|
/** Default row hint teaching the Alt/⌥-click "select only this" accelerator on
|
|
58
62
|
* bulk-select rows (`Select` multiple, `SelectFaceted` multiple facets). Shared
|
package/dist/anta_helpers.js
CHANGED
|
@@ -24,6 +24,18 @@ function nativeStateChange(e) {
|
|
|
24
24
|
const event = "nativeEvent" in e ? e.nativeEvent : e;
|
|
25
25
|
return { event, detail: event?.detail, isOwn: !event || event.target === event.currentTarget };
|
|
26
26
|
}
|
|
27
|
+
function customEventHandler(handler) {
|
|
28
|
+
if (!handler) return void 0;
|
|
29
|
+
return (input) => {
|
|
30
|
+
const { event, detail } = nativeStateChange(input);
|
|
31
|
+
if (detail != null) handler(event, detail);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function finiteNumber(value, fallback) {
|
|
35
|
+
if (value == null || value === "") return fallback;
|
|
36
|
+
const number = Number(value);
|
|
37
|
+
return Number.isFinite(number) ? number : fallback;
|
|
38
|
+
}
|
|
27
39
|
const IS_MAC = typeof navigator !== "undefined" && /Mac|iPhone|iPad/i.test(navigator.userAgent || "");
|
|
28
40
|
const ISOLATE_HINT = IS_MAC ? "\u2325+Click to select only this" : "Alt+Click to select only this";
|
|
29
41
|
function parseOpenState(v) {
|
|
@@ -160,6 +172,8 @@ export {
|
|
|
160
172
|
SelectableChildElement,
|
|
161
173
|
anchorRect,
|
|
162
174
|
cssLength,
|
|
175
|
+
customEventHandler,
|
|
176
|
+
finiteNumber,
|
|
163
177
|
hasChildren,
|
|
164
178
|
installDismissTrigger,
|
|
165
179
|
isInsideOpenMenu,
|
package/dist/box-types.d.ts
CHANGED
|
@@ -152,7 +152,7 @@ export interface BoxMeasurement {
|
|
|
152
152
|
hiddenStartY: boolean;
|
|
153
153
|
hiddenEndY: boolean;
|
|
154
154
|
}
|
|
155
|
-
/**
|
|
155
|
+
/** Box observation events include changed fields and a complete current snapshot. */
|
|
156
156
|
export interface BoxChange<T> {
|
|
157
157
|
changed: Partial<T>;
|
|
158
158
|
current: T;
|