@antadesign/anta 0.3.7 → 0.3.9

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.
Files changed (47) hide show
  1. package/dist/anta_helpers.d.ts +20 -0
  2. package/dist/anta_helpers.js +5 -1
  3. package/dist/components/Button.js +2 -2
  4. package/dist/components/Card.d.ts +28 -14
  5. package/dist/components/Card.js +51 -19
  6. package/dist/components/Card.module.css +35 -0
  7. package/dist/components/Checkbox.js +2 -2
  8. package/dist/components/Dialog.js +4 -4
  9. package/dist/components/Expander.js +4 -4
  10. package/dist/components/Input.js +2 -2
  11. package/dist/components/InputTime.js +2 -2
  12. package/dist/components/Menu.js +4 -4
  13. package/dist/components/MenuItem.d.ts +60 -32
  14. package/dist/components/MenuItem.js +35 -9
  15. package/dist/components/Progress.js +2 -2
  16. package/dist/components/Tabs.js +3 -3
  17. package/dist/components/Tag.js +3 -2
  18. package/dist/components/Text.d.ts +5 -3
  19. package/dist/components/Text.js +8 -2
  20. package/dist/components/Title.d.ts +5 -3
  21. package/dist/components/Title.js +4 -2
  22. package/dist/components/Tooltip.js +2 -2
  23. package/dist/elements/a-button.css +1 -1
  24. package/dist/elements/a-card.css +1 -211
  25. package/dist/elements/a-card.js +44 -72
  26. package/dist/elements/a-checkbox.js +0 -2
  27. package/dist/elements/a-icon.shapes.css +1 -1
  28. package/dist/elements/a-icon.shapes.d.ts +2 -1
  29. package/dist/elements/a-icon.shapes.js +1 -0
  30. package/dist/elements/a-menu-item.css +1 -1
  31. package/dist/elements/a-menu-item.d.ts +13 -0
  32. package/dist/elements/a-menu-item.js +14 -6
  33. package/dist/elements/a-menu.d.ts +6 -0
  34. package/dist/elements/a-menu.js +14 -4
  35. package/dist/elements/a-radio-group.d.ts +3 -1
  36. package/dist/elements/a-radio-group.js +3 -3
  37. package/dist/elements/a-tabs.d.ts +3 -1
  38. package/dist/elements/a-tabs.js +3 -3
  39. package/dist/elements/a-text.css +1 -1
  40. package/dist/elements/a-title.css +1 -1
  41. package/dist/elements/index.d.ts +1 -0
  42. package/dist/elements/index.js +3 -0
  43. package/dist/general_types.d.ts +55 -6
  44. package/dist/index.d.ts +2 -0
  45. package/dist/index.js +2 -0
  46. package/dist/jsx-runtime.d.ts +2 -1
  47. package/package.json +1 -1
@@ -1 +1 @@
1
- @layer anta{a-title{display:block;color:var(--text-1);font-weight:584.62;letter-spacing:0;text-wrap:balance;font-feature-settings:"ss02","ss05","tnum"}a-title a-icon{transform:translateY(-.05em)}a-title[level="1"]{font-size:28px;line-height:32px;margin-block-start:0;margin-block-end:16px}a-title[level="2"]{font-size:24px;line-height:28px;margin-block-start:32px;margin-block-end:12px}a-title[level="3"]{font-size:20px;line-height:24px;margin-block-start:24px;margin-block-end:12px}a-title[level="4"]{font-size:17px;line-height:20px;margin-block-start:20px;margin-block-end:8px}a-title[level="5"]{font-size:15px;line-height:20px;margin-block-start:16px;margin-block-end:8px}a-title[level="6"]{font-size:13px;line-height:16px;margin-block-start:16px;margin-block-end:4px}a-title[priority=secondary]{color:var(--text-2)}a-title[priority=tertiary]{color:var(--text-3)}a-title[priority=quaternary]{color:var(--text-4)}a-title[priority=quinary]{color:var(--text-5)}a-title[tone=brand]{color:var(--text-1-brand)}a-title[tone=brand][priority=secondary]{color:var(--text-2-brand)}a-title[tone=brand][priority=tertiary]{color:var(--text-3-brand)}a-title[tone=brand][priority=quaternary]{color:var(--text-4-brand)}a-title[tone=brand][priority=quinary]{color:var(--text-5-brand)}a-title[tone=success]{color:var(--text-1-success)}a-title[tone=success][priority=secondary]{color:var(--text-2-success)}a-title[tone=success][priority=tertiary]{color:var(--text-3-success)}a-title[tone=success][priority=quaternary]{color:var(--text-4-success)}a-title[tone=success][priority=quinary]{color:var(--text-5-success)}a-title[tone=critical]{color:var(--text-1-critical)}a-title[tone=critical][priority=secondary]{color:var(--text-2-critical)}a-title[tone=critical][priority=tertiary]{color:var(--text-3-critical)}a-title[tone=critical][priority=quaternary]{color:var(--text-4-critical)}a-title[tone=critical][priority=quinary]{color:var(--text-5-critical)}a-title[tone=warning]{color:var(--text-1-warning)}a-title[tone=warning][priority=secondary]{color:var(--text-2-warning)}a-title[tone=warning][priority=tertiary]{color:var(--text-3-warning)}a-title[tone=warning][priority=quaternary]{color:var(--text-4-warning)}a-title[tone=warning][priority=quinary]{color:var(--text-5-warning)}a-title[tone=info]{color:var(--text-1-info)}a-title[tone=info][priority=secondary]{color:var(--text-2-info)}a-title[tone=info][priority=tertiary]{color:var(--text-3-info)}a-title[tone=info][priority=quaternary]{color:var(--text-4-info)}a-title[tone=info][priority=quinary]{color:var(--text-5-info)}}
1
+ @layer anta{a-title{display:block;color:var(--text-1);font-weight:584.62;letter-spacing:0;text-wrap:balance;font-feature-settings:"ss02","ss05","tnum"}a-title a-icon{transform:translateY(-.05em)}a-title[level="1"]{font-size:28px;line-height:32px;margin-block-start:0;margin-block-end:16px}a-title[level="2"]{font-size:24px;line-height:28px;margin-block-start:32px;margin-block-end:12px}a-title[level="3"]{font-size:20px;line-height:24px;margin-block-start:24px;margin-block-end:12px}a-title[level="4"]{font-size:17px;line-height:20px;margin-block-start:20px;margin-block-end:8px}a-title[level="5"]{font-size:15px;line-height:20px;margin-block-start:16px;margin-block-end:8px}a-title[level="6"]{font-size:13px;line-height:16px;margin-block-start:16px;margin-block-end:4px}a-title[priority=secondary]{color:var(--text-2)}a-title[priority=tertiary]{color:var(--text-3)}a-title[priority=quaternary]{color:var(--text-4)}a-title[priority=quinary]{color:var(--text-5)}a-title[tone=brand]{color:var(--text-1-brand)}a-title[tone=brand][priority=secondary]{color:var(--text-2-brand)}a-title[tone=brand][priority=tertiary]{color:var(--text-3-brand)}a-title[tone=brand][priority=quaternary]{color:var(--text-4-brand)}a-title[tone=brand][priority=quinary]{color:var(--text-5-brand)}a-title[tone=success]{color:var(--text-1-success)}a-title[tone=success][priority=secondary]{color:var(--text-2-success)}a-title[tone=success][priority=tertiary]{color:var(--text-3-success)}a-title[tone=success][priority=quaternary]{color:var(--text-4-success)}a-title[tone=success][priority=quinary]{color:var(--text-5-success)}a-title[tone=critical]{color:var(--text-1-critical)}a-title[tone=critical][priority=secondary]{color:var(--text-2-critical)}a-title[tone=critical][priority=tertiary]{color:var(--text-3-critical)}a-title[tone=critical][priority=quaternary]{color:var(--text-4-critical)}a-title[tone=critical][priority=quinary]{color:var(--text-5-critical)}a-title[tone=warning]{color:var(--text-1-warning)}a-title[tone=warning][priority=secondary]{color:var(--text-2-warning)}a-title[tone=warning][priority=tertiary]{color:var(--text-3-warning)}a-title[tone=warning][priority=quaternary]{color:var(--text-4-warning)}a-title[tone=warning][priority=quinary]{color:var(--text-5-warning)}a-title[tone=info]{color:var(--text-1-info)}a-title[tone=info][priority=secondary]{color:var(--text-2-info)}a-title[tone=info][priority=tertiary]{color:var(--text-3-info)}a-title[tone=info][priority=quaternary]{color:var(--text-4-info)}a-title[tone=info][priority=quinary]{color:var(--text-5-info)}a-title[tone]:not([tone=neutral],[tone=brand],[tone=info],[tone=success],[tone=warning],[tone=critical]){--title-tone-source: attr(tone type(<color>), currentColor);--_title-tone: oklch(from var(--title-tone-source) .41 .15 h);color:oklch(from var(--title-tone-source) .33 .15 h)}a-title[tone]:not([tone=neutral],[tone=brand],[tone=info],[tone=success],[tone=warning],[tone=critical])[priority=secondary]{color:var(--_title-tone)}a-title[tone]:not([tone=neutral],[tone=brand],[tone=info],[tone=success],[tone=warning],[tone=critical])[priority=tertiary]{color:color-mix(in oklch,var(--_title-tone) 80%,transparent)}a-title[tone]:not([tone=neutral],[tone=brand],[tone=info],[tone=success],[tone=warning],[tone=critical])[priority=quaternary]{color:color-mix(in oklch,var(--_title-tone) 60%,transparent)}a-title[tone]:not([tone=neutral],[tone=brand],[tone=info],[tone=success],[tone=warning],[tone=critical])[priority=quinary]{color:color-mix(in oklch,var(--_title-tone) 40%,transparent)}.dark a-title[tone]:not([tone=neutral],[tone=brand],[tone=info],[tone=success],[tone=warning],[tone=critical]){--_title-tone: oklch(from var(--title-tone-source) .75 .11 h);color:oklch(from var(--title-tone-source) .82 .1 h)}}
@@ -33,5 +33,6 @@ export { ATabElement, register_a_tab } from './a-tab';
33
33
  export { ATabsElement, register_a_tabs } from './a-tabs';
34
34
  export { ATabPanelElement, register_a_tabpanel } from './a-tabpanel';
35
35
  export { ADialogElement, register_a_dialog } from './a-dialog';
36
+ export { ACardElement, register_a_card } from './a-card';
36
37
  import './a-title.css';
37
38
  import './a-tag.css';
@@ -18,11 +18,13 @@ import { ATabElement, register_a_tab } from "./a-tab";
18
18
  import { ATabsElement, register_a_tabs } from "./a-tabs";
19
19
  import { ATabPanelElement, register_a_tabpanel } from "./a-tabpanel";
20
20
  import { ADialogElement, register_a_dialog } from "./a-dialog";
21
+ import { ACardElement, register_a_card } from "./a-card";
21
22
  import "./a-title.css";
22
23
  import "./a-tag.css";
23
24
  export {
24
25
  AButtonElement,
25
26
  ACalendarElement,
27
+ ACardElement,
26
28
  ACheckboxElement,
27
29
  ADialogElement,
28
30
  AExpanderElement,
@@ -43,6 +45,7 @@ export {
43
45
  ATooltipElement,
44
46
  register_a_button,
45
47
  register_a_calendar,
48
+ register_a_card,
46
49
  register_a_checkbox,
47
50
  register_a_dialog,
48
51
  register_a_expander,
@@ -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
- * the others apply the matching `--text-{N}-{tone}` palette. */
176
- tone?: 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'critical';
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
- * the others apply the matching `--text-{N}-{tone}` palette. */
210
- tone?: 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'critical';
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,
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antadesign/anta",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",