@antadesign/anta 0.3.6 → 0.3.8
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/anta_helpers.d.ts +20 -0
- package/dist/anta_helpers.js +5 -1
- package/dist/components/Button.js +2 -2
- package/dist/components/Card.d.ts +100 -0
- package/dist/components/Card.js +104 -0
- package/dist/components/Card.module.css +35 -0
- package/dist/components/Checkbox.js +2 -2
- package/dist/components/Dialog.js +4 -4
- package/dist/components/Expander.js +4 -4
- package/dist/components/Input.js +2 -2
- package/dist/components/InputDate.js +1 -2
- package/dist/components/InputTime.js +2 -2
- package/dist/components/Menu.js +4 -4
- package/dist/components/Progress.js +2 -2
- package/dist/components/Select.js +0 -6
- package/dist/components/Tabs.js +3 -3
- package/dist/components/Tag.js +3 -2
- package/dist/components/Text.d.ts +5 -3
- package/dist/components/Text.js +8 -2
- package/dist/components/Title.d.ts +5 -3
- package/dist/components/Title.js +4 -2
- package/dist/components/Tooltip.js +2 -2
- package/dist/elements/a-card.css +1 -0
- package/dist/elements/a-card.d.ts +10 -0
- package/dist/elements/a-card.js +185 -0
- package/dist/elements/a-checkbox.css +1 -1
- package/dist/elements/a-checkbox.js +0 -2
- package/dist/elements/a-input.d.ts +2 -0
- package/dist/elements/a-input.js +34 -1
- package/dist/elements/a-menu.js +21 -9
- package/dist/elements/a-radio-group.d.ts +3 -1
- package/dist/elements/a-radio-group.js +3 -3
- package/dist/elements/a-radio.css +1 -1
- package/dist/elements/a-tabs.d.ts +3 -1
- package/dist/elements/a-tabs.js +3 -3
- package/dist/elements/a-text.css +1 -1
- package/dist/elements/a-title.css +1 -1
- package/dist/elements/index.d.ts +1 -0
- package/dist/elements/index.js +3 -0
- package/dist/general_types.d.ts +55 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/jsx-runtime.d.ts +2 -1
- package/package.json +1 -1
package/dist/general_types.d.ts
CHANGED
|
@@ -11,6 +11,9 @@ export interface BaseProps {
|
|
|
11
11
|
id?: string;
|
|
12
12
|
/** HTML `title` attribute — native browser tooltip on hover. */
|
|
13
13
|
title?: string;
|
|
14
|
+
/** Assigns the element to a named `<slot>` of a parent web component (e.g.
|
|
15
|
+
* `slot="header"` inside a `<Card>`, `slot="footer"` inside a `<Dialog>`). */
|
|
16
|
+
slot?: string;
|
|
14
17
|
/** Tab order. Set to `-1` to skip the element when tabbing. */
|
|
15
18
|
tabIndex?: number;
|
|
16
19
|
/** React/Preact reconciliation key when rendered inside a list. Consumed by the
|
|
@@ -171,9 +174,10 @@ export interface AProgressAttributes extends BaseAttributes {
|
|
|
171
174
|
export interface ATextAttributes extends BaseAttributes {
|
|
172
175
|
/** Visual priority. Maps to text-1..text-5. */
|
|
173
176
|
priority?: 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'quinary';
|
|
174
|
-
/** Color tint. `neutral` (default) is the untinted `--text-{N}` scale;
|
|
175
|
-
*
|
|
176
|
-
|
|
177
|
+
/** Color tint. `neutral` (default) is the untinted `--text-{N}` scale; a named
|
|
178
|
+
* tone applies the matching `--text-{N}-{tone}` palette; any literal CSS color
|
|
179
|
+
* is a custom tone (hue kept, lightness/chroma pinned per priority in oklch). */
|
|
180
|
+
tone?: 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'critical' | (string & {});
|
|
177
181
|
/** Type scale. `small` = 13/16, `medium` (default) = 15/20, `large` = 17/24. */
|
|
178
182
|
size?: 'small' | 'medium' | 'large';
|
|
179
183
|
/** Render as inline-block instead of the default block. */
|
|
@@ -205,9 +209,10 @@ export interface ATitleAttributes extends BaseAttributes {
|
|
|
205
209
|
level?: string;
|
|
206
210
|
/** Visual priority. Maps to text-1..text-5. */
|
|
207
211
|
priority?: 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'quinary';
|
|
208
|
-
/** Color tint. `neutral` (default) is the untinted `--text-{N}` scale;
|
|
209
|
-
*
|
|
210
|
-
|
|
212
|
+
/** Color tint. `neutral` (default) is the untinted `--text-{N}` scale; a named
|
|
213
|
+
* tone applies the matching `--text-{N}-{tone}` palette; any literal CSS color
|
|
214
|
+
* is a custom tone (hue kept, lightness/chroma pinned per priority in oklch). */
|
|
215
|
+
tone?: 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'critical' | (string & {});
|
|
211
216
|
/** ARIA role — the JSX wrapper sets this to `'heading'`. */
|
|
212
217
|
role?: string;
|
|
213
218
|
/** ARIA heading level — the JSX wrapper sets this to match `level`. */
|
|
@@ -995,3 +1000,47 @@ export interface ATabpanelAttributes extends BaseAttributes {
|
|
|
995
1000
|
* `internals.ariaLabelledByElements`. */
|
|
996
1001
|
role?: 'tabpanel';
|
|
997
1002
|
}
|
|
1003
|
+
/**
|
|
1004
|
+
* Attributes for the `<a-card>` custom element — a surface container that lays out
|
|
1005
|
+
* an optional `media` region plus a `header` / body / `footer` stack, and becomes a
|
|
1006
|
+
* link when given `href`. Slots (light-DOM children): `media`, `icon`, `header`,
|
|
1007
|
+
* `footer`, and the default slot for the body. The element exposes
|
|
1008
|
+
* `::part(container | media | content | icon | header | body | footer)`. In link
|
|
1009
|
+
* mode it names the shadow anchor from `aria-label` → header text → body text →
|
|
1010
|
+
* `href`. Low-level attributes; for the typed JSX wrapper use `Card` from
|
|
1011
|
+
* `@antadesign/anta`.
|
|
1012
|
+
*/
|
|
1013
|
+
export interface ACardAttributes extends BaseAttributes {
|
|
1014
|
+
/** Semantic tone, or any literal CSS color for a one-off custom tone. Named tones
|
|
1015
|
+
* re-point the surface + text; a custom color keeps its hue with lightness/chroma
|
|
1016
|
+
* pinned. `'neutral'` is the default (same as omitting it). */
|
|
1017
|
+
tone?: 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'critical' | (string & {});
|
|
1018
|
+
/** Surface emphasis. `primary` (default) is a clean sheet; `secondary` a subtle
|
|
1019
|
+
* fill; `tertiary` a frosted, semi-transparent panel with a backdrop blur. */
|
|
1020
|
+
priority?: 'primary' | 'secondary' | 'tertiary';
|
|
1021
|
+
/** Size variant — scales the padding. `medium` is the default. */
|
|
1022
|
+
size?: 'small' | 'medium' | 'large';
|
|
1023
|
+
/** Which edge the full-bleed `media` slot sits on. `top` is the default. */
|
|
1024
|
+
'media-position'?: 'top' | 'bottom' | 'left' | 'right';
|
|
1025
|
+
/** Selected / chosen state — an inset ring in the tone colour. Presence-based
|
|
1026
|
+
* (`''` on, omit off). */
|
|
1027
|
+
selected?: boolean | '';
|
|
1028
|
+
/** Loading state — skeleton pulse, `aria-busy`, and (in link mode) navigation is
|
|
1029
|
+
* blocked (the anchor drops its `href`). Presence-based (`''` on, omit off). */
|
|
1030
|
+
loading?: boolean | '';
|
|
1031
|
+
/** Fully-round corners (`border-radius: 999px`), or a custom radius via a length
|
|
1032
|
+
* value (`round="16px"`). Presence-based for the boolean form. */
|
|
1033
|
+
round?: boolean | number | string;
|
|
1034
|
+
/** Turn the whole card into a link — the shadow container becomes a focusable
|
|
1035
|
+
* anchor with this URL. */
|
|
1036
|
+
href?: string;
|
|
1037
|
+
/** Anchor target (only with `href`). */
|
|
1038
|
+
target?: string;
|
|
1039
|
+
/** Anchor rel (only with `href`). */
|
|
1040
|
+
rel?: string;
|
|
1041
|
+
/** Space-separated URLs pinged on navigation (only with `href`). */
|
|
1042
|
+
ping?: string;
|
|
1043
|
+
/** Explicit accessible name for the link — overrides the header → body → href
|
|
1044
|
+
* chain the element derives in link mode. */
|
|
1045
|
+
'aria-label'?: string;
|
|
1046
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -67,6 +67,8 @@ export { TabPanel } from './components/TabPanel';
|
|
|
67
67
|
export type { TabPanelProps } from './components/TabPanel';
|
|
68
68
|
export { Dialog } from './components/Dialog';
|
|
69
69
|
export type { DialogProps } from './components/Dialog';
|
|
70
|
+
export { Card } from './components/Card';
|
|
71
|
+
export type { CardProps } from './components/Card';
|
|
70
72
|
export type { BaseProps, BaseAttributes } from './general_types';
|
|
71
73
|
export { configure } from './jsx-runtime';
|
|
72
74
|
export type { AntaIntrinsicElements } from './jsx-runtime';
|
package/dist/index.js
CHANGED
|
@@ -39,10 +39,12 @@ import { SelectFaceted } from "./components/SelectFaceted";
|
|
|
39
39
|
import { Tabs } from "./components/Tabs";
|
|
40
40
|
import { TabPanel } from "./components/TabPanel";
|
|
41
41
|
import { Dialog } from "./components/Dialog";
|
|
42
|
+
import { Card } from "./components/Card";
|
|
42
43
|
import { configure } from "./jsx-runtime";
|
|
43
44
|
export {
|
|
44
45
|
Button,
|
|
45
46
|
Calendar,
|
|
47
|
+
Card,
|
|
46
48
|
Checkbox,
|
|
47
49
|
Dialog,
|
|
48
50
|
Expander,
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export declare function useMemo<T>(factory: () => T, deps: unknown[]): T;
|
|
|
41
41
|
export declare function jsx(type: ComponentType, props: Record<string, unknown> | null, key?: string | number): unknown;
|
|
42
42
|
export declare function jsxs(type: ComponentType, props: Record<string, unknown> | null, key?: string | number): unknown;
|
|
43
43
|
export { _Fragment as Fragment };
|
|
44
|
-
import type { AProgressAttributes, ATextAttributes, ATitleAttributes, ATagAttributes, AExpanderAttributes, AIconAttributes, AButtonAttributes, ACheckboxAttributes, ATooltipAttributes, AInputAttributes, AInputTimeAttributes, ACalendarAttributes, ARadioAttributes, ARadioGroupAttributes, AMenuAttributes, AMenuItemAttributes, AMenuGroupAttributes, ATabsAttributes, ATabAttributes, ATabpanelAttributes, ADialogAttributes, BaseAttributes } from './general_types';
|
|
44
|
+
import type { AProgressAttributes, ATextAttributes, ATitleAttributes, ATagAttributes, AExpanderAttributes, AIconAttributes, AButtonAttributes, ACheckboxAttributes, ATooltipAttributes, AInputAttributes, AInputTimeAttributes, ACalendarAttributes, ARadioAttributes, ARadioGroupAttributes, AMenuAttributes, AMenuItemAttributes, AMenuGroupAttributes, ATabsAttributes, ATabAttributes, ATabpanelAttributes, ADialogAttributes, ACardAttributes, BaseAttributes } from './general_types';
|
|
45
45
|
export declare namespace JSX {
|
|
46
46
|
interface IntrinsicElements extends React.JSX.IntrinsicElements, AntaIntrinsicElements {
|
|
47
47
|
}
|
|
@@ -92,4 +92,5 @@ export interface AntaIntrinsicElements {
|
|
|
92
92
|
'a-tab-label': BaseAttributes;
|
|
93
93
|
'a-tabpanel': ATabpanelAttributes;
|
|
94
94
|
'a-dialog': ADialogAttributes;
|
|
95
|
+
'a-card': ACardAttributes;
|
|
95
96
|
}
|