@antadesign/anta 0.3.14 → 0.3.15
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 +10 -0
- package/dist/anta_helpers.js +9 -0
- package/dist/components/Select.module.css +1 -1
- package/dist/elements/a-banner.js +2 -7
- package/dist/elements/a-input.css +1 -1
- package/dist/elements/a-input.js +1 -0
- package/dist/elements/index.d.ts +2 -0
- package/dist/elements/index.js +6 -0
- package/dist/general_types.d.ts +39 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/jsx-runtime.d.ts +6 -1
- package/dist/jsx-runtime.js +7 -1
- package/package.json +1 -1
package/dist/anta_helpers.d.ts
CHANGED
|
@@ -54,6 +54,16 @@ export declare const ISOLATE_HINT: string;
|
|
|
54
54
|
* `'open'` is `'closed'`, so an absent / malformed attribute reads closed. Kept
|
|
55
55
|
* here so the two elements can't drift on how the token is parsed. */
|
|
56
56
|
export declare function parseOpenState(v: string | null): 'open' | 'closed';
|
|
57
|
+
/** Install a delegated "dismiss from an action" click handler: any element inside
|
|
58
|
+
* `host` carrying `[attr]` runs `onDismiss` on click, scoped to the nearest host
|
|
59
|
+
* of `host`'s own tag (so a control inside a nested same-tag element doesn't also
|
|
60
|
+
* dismiss the outer one). A read-only light-DOM walk — no host / tree mutation —
|
|
61
|
+
* that catches any activated control (native `<button>`, `<a>`, `<a-button>`,
|
|
62
|
+
* `<a-menu-item>`) with keyboard activation for free. Shared by `a-toast`
|
|
63
|
+
* (`data-toast-dismiss`) and `a-banner` (`data-banner-dismiss`), mirroring
|
|
64
|
+
* `a-dialog`'s `data-dialog-close` family; keep the one copy here so a future fix
|
|
65
|
+
* (e.g. skipping `[disabled]` triggers) lands for every element at once. */
|
|
66
|
+
export declare function installDismissTrigger(host: HTMLElement, attr: string, onDismiss: () => void): void;
|
|
57
67
|
/** The six named tones every toned component shares. Anything else is a literal
|
|
58
68
|
* CSS colour the element resolves through its `--{component}-tone-source` var. */
|
|
59
69
|
export declare const NAMED_TONES: Set<string>;
|
package/dist/anta_helpers.js
CHANGED
|
@@ -21,6 +21,14 @@ const ISOLATE_HINT = IS_MAC ? "\u2325+Click to select only this" : "Alt+Click to
|
|
|
21
21
|
function parseOpenState(v) {
|
|
22
22
|
return v === "open" ? "open" : "closed";
|
|
23
23
|
}
|
|
24
|
+
function installDismissTrigger(host, attr, onDismiss) {
|
|
25
|
+
host.addEventListener("click", (e) => {
|
|
26
|
+
const target = e.target;
|
|
27
|
+
if (!(target instanceof Element)) return;
|
|
28
|
+
const trigger = target.closest(`[${attr}]`);
|
|
29
|
+
if (trigger && trigger.closest(host.localName) === host) onDismiss();
|
|
30
|
+
});
|
|
31
|
+
}
|
|
24
32
|
const NAMED_TONES = /* @__PURE__ */ new Set([
|
|
25
33
|
"brand",
|
|
26
34
|
"neutral",
|
|
@@ -138,6 +146,7 @@ export {
|
|
|
138
146
|
SelectableChildElement,
|
|
139
147
|
anchorRect,
|
|
140
148
|
hasChildren,
|
|
149
|
+
installDismissTrigger,
|
|
141
150
|
isInsideOpenMenu,
|
|
142
151
|
isMenuOpen,
|
|
143
152
|
nativeStateChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.chevron{
|
|
1
|
+
.chevron{transition:transform .15s ease}.chevron.open{transform:rotate(180deg)}.filter{padding:4px 4px 0}.footer{padding:var(--menu-padding, 4px);border-top:1px solid var(--border-4)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLElementBase, parseOpenState } from "../anta_helpers";
|
|
1
|
+
import { HTMLElementBase, installDismissTrigger, parseOpenState } from "../anta_helpers";
|
|
2
2
|
import "./a-banner.css";
|
|
3
3
|
const DISMISS_TRIGGER = "dismissrequest";
|
|
4
4
|
const DISMISS_ATTR = "data-banner-dismiss";
|
|
@@ -65,12 +65,7 @@ class ABannerElement extends HTMLElementBase {
|
|
|
65
65
|
e.stopPropagation();
|
|
66
66
|
this.#requestDismiss();
|
|
67
67
|
});
|
|
68
|
-
this
|
|
69
|
-
const target = e.target;
|
|
70
|
-
if (!(target instanceof Element)) return;
|
|
71
|
-
const trigger = target.closest(`[${DISMISS_ATTR}]`);
|
|
72
|
-
if (trigger && trigger.closest("a-banner") === this) this.#requestDismiss();
|
|
73
|
-
});
|
|
68
|
+
installDismissTrigger(this, DISMISS_ATTR, () => this.#requestDismiss());
|
|
74
69
|
}
|
|
75
70
|
/** Controlled mode: the `state` attribute is present and owns visibility. */
|
|
76
71
|
get #controlled() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer anta{a-input:not(:defined){display:grid;grid-template-columns:minmax(0,1fr);row-gap:4px}a-input:not(:defined)>[slot=leading],a-input:not(:defined)>[slot=trailing],a-input:not(:defined)>[slot=clear],a-input:not(:defined)>[slot=hint]{display:none!important}a-input:not(:defined)>[slot=label]{display:block;color:var(--input-label);font-family:var(--sans-serif);font-size:15px;line-height:20px;font-weight:500}a-input[size=small]:not(:defined)>[slot=label]{font-size:13px;line-height:16px}a-input[size=large]:not(:defined)>[slot=label]{font-size:17px;line-height:22px}a-input:not(:defined):after{content:attr(placeholder);display:block;min-height:28px;line-height:28px;padding-inline:7px;border-radius:4px;box-shadow:inset 0 0 0 .5px var(--input-border);color:var(--input-placeholder);font-family:var(--sans-serif);font-size:15px;font-weight:400;font-feature-settings:"ss02","ss05","tnum";font-variation-settings:"wdth" 100,"slnt" 0,"ital" 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}a-input[value]:not([value=""]):not([type=password]):not(:defined):after{content:attr(value);color:var(--input-text)}a-input[size=small]:not(:defined):after{min-height:24px;line-height:24px;font-size:13px}a-input[size=large]:not(:defined):after{min-height:32px;line-height:32px;font-size:17px}a-input[round]:not(:defined):after{border-radius:var(--input-round, 999px)}a-input{transition:opacity .28s ease-out 40ms}a-input:not(:defined){opacity:.5}@media(prefers-reduced-motion:reduce){a-input{transition:none}}a-input{--input-bg: var(--bg-1);--input-border: var(--border-2);--input-text: var(--text-1);--input-label: var(--text-3);--input-placeholder: var(--text-4);--input-adornment: var(--text-3);--input-hint: var(--text-3);width:100%}a-input[round]{--input-round: attr(round type(<length>), 999px)}a-input[tone]:not([tone=""]):not([status]){--input-tone-source: attr(tone type(<color>), var(--border-2));--input-border: oklch(from var(--input-tone-source) .7 calc(c*.8) h);.dark &{--input-border: oklch(from var(--input-tone-source) .5 calc(c*.8) h)}}a-input[status=critical]{--input-status-source: var(--anta-seed-critical);--input-bg: var(--bg-2-critical);--input-hint: var(--text-2-critical)}a-input[status=warning]{--input-status-source: var(--anta-seed-warning);--input-bg: var(--bg-2-warning);--input-hint: var(--text-2-warning)}a-input[status=success]{--input-status-source: var(--anta-seed-success);--input-bg: var(--bg-2-success);--input-hint: var(--text-2-success)}a-input[status=info]{--input-status-source: var(--anta-seed-info);--input-bg: var(--bg-2-info);--input-hint: var(--text-2-info)}a-input[status=brand]{--input-status-source: var(--anta-seed-brand);--input-bg: var(--bg-2-brand);--input-hint: var(--text-2-brand)}a-input[status]{--input-border: oklch(from var(--input-status-source) .58 c h)}.dark a-input[status]{--input-border: oklch(from var(--input-status-source) .52 c h)}a-input:disabled{--input-bg: #44374b12;--input-border: #44374b26;--input-text: var(--text-4);--input-label: var(--text-4);--input-hint: var(--text-5);cursor:not-allowed}a-input[status]:disabled{--input-bg: #44374b12;--input-border: #44374b26;--input-hint: var(--text-5)}.dark a-input:disabled{--input-bg: #e4d1ef0d;--input-border: #e4d1ef1f}.dark a-input[status]:disabled{--input-bg: #e4d1ef0d;--input-border: #e4d1ef1f;--input-hint: var(--text-5)}a-input[size=small] a-icon{--icon-size: 14px}a-input[size=large] a-icon{--icon-size: 18px}a-input [slot=hint]>a-icon{margin-block-start:1px}a-input[size=small] [slot=hint]>a-icon{margin-block-start:.5px}a-input[size=large] [slot=hint]>a-icon{margin-block-start:1.5px}}
|
|
1
|
+
@layer anta{a-input:not(:defined){display:grid;grid-template-columns:minmax(0,1fr);row-gap:4px}a-input:not(:defined)>[slot=leading],a-input:not(:defined)>[slot=trailing],a-input:not(:defined)>[slot=clear],a-input:not(:defined)>[slot=hint]{display:none!important}a-input:not(:defined)>[slot=label]{display:block;color:var(--input-label);font-family:var(--sans-serif);font-size:15px;line-height:20px;font-weight:500}a-input[size=small]:not(:defined)>[slot=label]{font-size:13px;line-height:16px}a-input[size=large]:not(:defined)>[slot=label]{font-size:17px;line-height:22px}a-input:not(:defined):after{content:attr(placeholder);display:block;min-height:28px;line-height:28px;padding-inline:7px;border-radius:4px;box-shadow:inset 0 0 0 .5px var(--input-border);color:var(--input-placeholder);font-family:var(--sans-serif);font-size:15px;font-weight:400;font-feature-settings:"ss02","ss05","tnum";font-variation-settings:"wdth" 100,"slnt" 0,"ital" 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}a-input[value]:not([value=""]):not([type=password]):not(:defined):after{content:attr(value);color:var(--input-text)}a-input[size=small]:not(:defined):after{min-height:24px;line-height:24px;font-size:13px}a-input[size=large]:not(:defined):after{min-height:32px;line-height:32px;font-size:17px}a-input[round]:not(:defined):after{border-radius:var(--input-round, 999px)}a-input{transition:opacity .28s ease-out 40ms}a-input:not(:defined){opacity:.5}@media(prefers-reduced-motion:reduce){a-input{transition:none}}a-input{--input-bg: var(--bg-1);--input-border: var(--border-2);--input-text: var(--text-1);--input-label: var(--text-3);--input-placeholder: var(--text-4);--input-adornment: var(--text-3);--input-hint: var(--text-3);--input-trailing-inset: 7px;width:100%}a-input:has([slot=trailing] :is(a-button,button)),a-input:has([slot=trailing]:is(a-button,button)){--input-trailing-inset: 0}a-input[round]{--input-round: attr(round type(<length>), 999px)}a-input[tone]:not([tone=""]):not([status]){--input-tone-source: attr(tone type(<color>), var(--border-2));--input-border: oklch(from var(--input-tone-source) .7 calc(c*.8) h);.dark &{--input-border: oklch(from var(--input-tone-source) .5 calc(c*.8) h)}}a-input[status=critical]{--input-status-source: var(--anta-seed-critical);--input-bg: var(--bg-2-critical);--input-hint: var(--text-2-critical)}a-input[status=warning]{--input-status-source: var(--anta-seed-warning);--input-bg: var(--bg-2-warning);--input-hint: var(--text-2-warning)}a-input[status=success]{--input-status-source: var(--anta-seed-success);--input-bg: var(--bg-2-success);--input-hint: var(--text-2-success)}a-input[status=info]{--input-status-source: var(--anta-seed-info);--input-bg: var(--bg-2-info);--input-hint: var(--text-2-info)}a-input[status=brand]{--input-status-source: var(--anta-seed-brand);--input-bg: var(--bg-2-brand);--input-hint: var(--text-2-brand)}a-input[status]{--input-border: oklch(from var(--input-status-source) .58 c h)}.dark a-input[status]{--input-border: oklch(from var(--input-status-source) .52 c h)}a-input:disabled{--input-bg: #44374b12;--input-border: #44374b26;--input-text: var(--text-4);--input-label: var(--text-4);--input-hint: var(--text-5);cursor:not-allowed}a-input[status]:disabled{--input-bg: #44374b12;--input-border: #44374b26;--input-hint: var(--text-5)}.dark a-input:disabled{--input-bg: #e4d1ef0d;--input-border: #e4d1ef1f}.dark a-input[status]:disabled{--input-bg: #e4d1ef0d;--input-border: #e4d1ef1f;--input-hint: var(--text-5)}a-input[size=small] a-icon{--icon-size: 14px}a-input[size=large] a-icon{--icon-size: 18px}a-input [slot=hint]>a-icon{margin-block-start:1px}a-input[size=small] [slot=hint]>a-icon{margin-block-start:.5px}a-input[size=large] [slot=hint]>a-icon{margin-block-start:1.5px}}
|
package/dist/elements/a-input.js
CHANGED
|
@@ -173,6 +173,7 @@ const SHADOW_STYLE = `
|
|
|
173
173
|
:host([readonly]) slot[name="clear"] { display: none; }
|
|
174
174
|
|
|
175
175
|
.field.has-leading slot[name="leading"] { margin-inline-start: 7px; }
|
|
176
|
+
.field.has-trailing slot[name="trailing"] { margin-inline-end: var(--input-trailing-inset, 7px); }
|
|
176
177
|
.field.has-leading input,
|
|
177
178
|
.field.has-leading textarea { padding-inline-start: 5px; }
|
|
178
179
|
:host([multiline]) .field.has-leading slot[name="leading"],
|
package/dist/elements/index.d.ts
CHANGED
|
@@ -36,5 +36,7 @@ export { ATabPanelElement, register_a_tabpanel } from './a-tabpanel';
|
|
|
36
36
|
export { ADialogElement, register_a_dialog } from './a-dialog';
|
|
37
37
|
export { ACardElement, register_a_card } from './a-card';
|
|
38
38
|
export { ABannerElement, register_a_banner } from './a-banner';
|
|
39
|
+
export { AToasterElement, register_a_toaster } from './a-toaster';
|
|
40
|
+
export { AToastElement, register_a_toast } from './a-toast';
|
|
39
41
|
import './a-title.css';
|
|
40
42
|
import './a-tag.css';
|
package/dist/elements/index.js
CHANGED
|
@@ -21,6 +21,8 @@ import { ATabPanelElement, register_a_tabpanel } from "./a-tabpanel";
|
|
|
21
21
|
import { ADialogElement, register_a_dialog } from "./a-dialog";
|
|
22
22
|
import { ACardElement, register_a_card } from "./a-card";
|
|
23
23
|
import { ABannerElement, register_a_banner } from "./a-banner";
|
|
24
|
+
import { AToasterElement, register_a_toaster } from "./a-toaster";
|
|
25
|
+
import { AToastElement, register_a_toast } from "./a-toast";
|
|
24
26
|
import "./a-title.css";
|
|
25
27
|
import "./a-tag.css";
|
|
26
28
|
export {
|
|
@@ -46,6 +48,8 @@ export {
|
|
|
46
48
|
ATabPanelElement,
|
|
47
49
|
ATabsElement,
|
|
48
50
|
ATextElement,
|
|
51
|
+
AToastElement,
|
|
52
|
+
AToasterElement,
|
|
49
53
|
ATooltipElement,
|
|
50
54
|
register_a_banner,
|
|
51
55
|
register_a_button,
|
|
@@ -69,5 +73,7 @@ export {
|
|
|
69
73
|
register_a_tabpanel,
|
|
70
74
|
register_a_tabs,
|
|
71
75
|
register_a_text,
|
|
76
|
+
register_a_toast,
|
|
77
|
+
register_a_toaster,
|
|
72
78
|
register_a_tooltip
|
|
73
79
|
};
|
package/dist/general_types.d.ts
CHANGED
|
@@ -1121,3 +1121,42 @@ export interface ABannerAttributes extends BaseAttributes {
|
|
|
1121
1121
|
prev: 'open' | 'closed';
|
|
1122
1122
|
}>) => void;
|
|
1123
1123
|
}
|
|
1124
|
+
/**
|
|
1125
|
+
* Attributes for the `<a-toaster>` custom element — a viewport-anchored
|
|
1126
|
+
* notification region. One instance hosts all six placement zones; each
|
|
1127
|
+
* `<a-toast>` routes to a corner/edge by its `slot` attribute. Keep one mounted
|
|
1128
|
+
* (the `<Toaster>` wrapper, or by hand). Exposes `::part(region)`. Low-level
|
|
1129
|
+
* attributes; for the typed JSX wrapper use `Toaster` from `@antadesign/anta`.
|
|
1130
|
+
*/
|
|
1131
|
+
export interface AToasterAttributes extends BaseAttributes {
|
|
1132
|
+
/** Accessible name for the region landmark. */
|
|
1133
|
+
'aria-label'?: string;
|
|
1134
|
+
}
|
|
1135
|
+
/**
|
|
1136
|
+
* Attributes for the `<a-toast>` custom element — one item inside an
|
|
1137
|
+
* `<a-toaster>`. A style-neutral container around slotted content: it owns the
|
|
1138
|
+
* enter/exit animation and the auto-dismiss timer (paused on hover / focus), with
|
|
1139
|
+
* no chrome of its own (no ✕, no surface — the content brings its own look and its
|
|
1140
|
+
* own dismiss affordance). Route it to a placement zone with `slot`
|
|
1141
|
+
* (`slot="bottom-right"`, …). It never removes itself — on dismiss it animates out
|
|
1142
|
+
* then emits a bubbling `dismiss`, and the owner removes the node. For an
|
|
1143
|
+
* announcement, give it `role="status"` (polite) or `role="alert"` (assertive).
|
|
1144
|
+
*/
|
|
1145
|
+
export interface AToastAttributes extends BaseAttributes {
|
|
1146
|
+
/** Auto-dismiss delay in ms (default 5000). Empty / non-positive uses the
|
|
1147
|
+
* default; `Infinity` keeps it until dismissed (sticky). */
|
|
1148
|
+
duration?: number | string;
|
|
1149
|
+
/** Set by the wrapper to request dismissal (a programmatic `dismiss`): the
|
|
1150
|
+
* element plays its exit and emits `dismiss`. Presence-based (`''` on, omit off). */
|
|
1151
|
+
leaving?: boolean | '';
|
|
1152
|
+
/** Bumped on an in-place update so the element restarts its auto-dismiss timer. */
|
|
1153
|
+
rev?: number | string;
|
|
1154
|
+
/** A live DOM node to show as the content (the wrapper's DOM-node branch);
|
|
1155
|
+
* set as a property, not a string attribute. String / JSX content is slotted
|
|
1156
|
+
* as children instead. */
|
|
1157
|
+
content?: Node;
|
|
1158
|
+
/** Fires after the exit animation, when the toast has dismissed — a bubbling
|
|
1159
|
+
* `CustomEvent`. The owner removes the node in response. All-lowercase so both
|
|
1160
|
+
* renderers bind it (React 19 keeps the case after `on`; Preact lowercases). */
|
|
1161
|
+
ondismiss?: (e: CustomEvent) => void;
|
|
1162
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -76,6 +76,8 @@ export { Card } from './components/Card';
|
|
|
76
76
|
export type { CardProps } from './components/Card';
|
|
77
77
|
export { Banner } from './components/Banner';
|
|
78
78
|
export type { BannerProps } from './components/Banner';
|
|
79
|
+
export { Toaster, createToaster } from './components/Toaster';
|
|
80
|
+
export type { ToasterProps, ToasterManager, ToastOptions, ToastPlacement, ToastContent, ToastRender, } from './components/Toaster';
|
|
79
81
|
export type { BaseProps, BaseAttributes } from './general_types';
|
|
80
82
|
export { configure } from './jsx-runtime';
|
|
81
83
|
export type { AntaIntrinsicElements } from './jsx-runtime';
|
package/dist/index.js
CHANGED
|
@@ -43,6 +43,7 @@ import { TabPanel } from "./components/TabPanel";
|
|
|
43
43
|
import { Dialog } from "./components/Dialog";
|
|
44
44
|
import { Card } from "./components/Card";
|
|
45
45
|
import { Banner } from "./components/Banner";
|
|
46
|
+
import { Toaster, createToaster } from "./components/Toaster";
|
|
46
47
|
import { configure } from "./jsx-runtime";
|
|
47
48
|
export {
|
|
48
49
|
Banner,
|
|
@@ -74,10 +75,12 @@ export {
|
|
|
74
75
|
Tag,
|
|
75
76
|
Text,
|
|
76
77
|
Title,
|
|
78
|
+
Toaster,
|
|
77
79
|
Tooltip,
|
|
78
80
|
buildMonth,
|
|
79
81
|
clampDate,
|
|
80
82
|
configure,
|
|
83
|
+
createToaster,
|
|
81
84
|
dateFormatPattern,
|
|
82
85
|
dateTimeFormatPattern,
|
|
83
86
|
firstDayOfWeek,
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ type JsxFunction = {
|
|
|
8
8
|
type UseState = <S>(initial: S | (() => S)) => [S, (next: S | ((prev: S) => S)) => void];
|
|
9
9
|
type UseId = () => string;
|
|
10
10
|
type UseMemo = <T>(factory: () => T, deps: unknown[]) => T;
|
|
11
|
+
type UseSyncExternalStore = <T>(subscribe: (onChange: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T) => T;
|
|
11
12
|
declare let _Fragment: ComponentType;
|
|
12
13
|
/**
|
|
13
14
|
* Swap the underlying JSX factory (and, optionally, the hooks) used by all anta
|
|
@@ -32,16 +33,18 @@ export declare function configure(jsx: JsxFunction, Fragment?: ComponentType, ho
|
|
|
32
33
|
useState?: UseState;
|
|
33
34
|
useId?: UseId;
|
|
34
35
|
useMemo?: UseMemo;
|
|
36
|
+
useSyncExternalStore?: UseSyncExternalStore;
|
|
35
37
|
}): void;
|
|
36
38
|
/** Hooks indirection so wrappers depend on the configured renderer, not a hard
|
|
37
39
|
* `import … from 'react'`. Call these exactly like the React hooks. */
|
|
38
40
|
export declare function useState<S>(initial: S | (() => S)): [S, (next: S | ((prev: S) => S)) => void];
|
|
39
41
|
export declare function useId(): string;
|
|
40
42
|
export declare function useMemo<T>(factory: () => T, deps: unknown[]): T;
|
|
43
|
+
export declare function useSyncExternalStore<T>(subscribe: (onChange: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T): T;
|
|
41
44
|
export declare function jsx(type: ComponentType, props: Record<string, unknown> | null, key?: string | number): unknown;
|
|
42
45
|
export declare function jsxs(type: ComponentType, props: Record<string, unknown> | null, key?: string | number): unknown;
|
|
43
46
|
export { _Fragment as Fragment };
|
|
44
|
-
import type { AProgressAttributes, ATextAttributes, ATitleAttributes, ATagAttributes, AExpanderAttributes, AIconAttributes, AButtonAttributes, ACopyAttributes, ACheckboxAttributes, ATooltipAttributes, AInputAttributes, AInputTimeAttributes, ACalendarAttributes, ARadioAttributes, ARadioGroupAttributes, AMenuAttributes, AMenuItemAttributes, AMenuGroupAttributes, ATabsAttributes, ATabAttributes, ATabpanelAttributes, ADialogAttributes, ACardAttributes, ABannerAttributes, BaseAttributes } from './general_types';
|
|
47
|
+
import type { AProgressAttributes, ATextAttributes, ATitleAttributes, ATagAttributes, AExpanderAttributes, AIconAttributes, AButtonAttributes, ACopyAttributes, ACheckboxAttributes, ATooltipAttributes, AInputAttributes, AInputTimeAttributes, ACalendarAttributes, ARadioAttributes, ARadioGroupAttributes, AMenuAttributes, AMenuItemAttributes, AMenuGroupAttributes, ATabsAttributes, ATabAttributes, ATabpanelAttributes, ADialogAttributes, ACardAttributes, ABannerAttributes, AToasterAttributes, AToastAttributes, BaseAttributes } from './general_types';
|
|
45
48
|
export declare namespace JSX {
|
|
46
49
|
interface IntrinsicElements extends React.JSX.IntrinsicElements, AntaIntrinsicElements {
|
|
47
50
|
}
|
|
@@ -96,4 +99,6 @@ export interface AntaIntrinsicElements {
|
|
|
96
99
|
'a-card': ACardAttributes;
|
|
97
100
|
'a-banner': ABannerAttributes;
|
|
98
101
|
'a-banner-message': BaseAttributes;
|
|
102
|
+
'a-toaster': AToasterAttributes;
|
|
103
|
+
'a-toast': AToastAttributes;
|
|
99
104
|
}
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -4,12 +4,14 @@ let _Fragment = React.Fragment;
|
|
|
4
4
|
let _useState = React.useState;
|
|
5
5
|
let _useId = React.useId;
|
|
6
6
|
let _useMemo = React.useMemo;
|
|
7
|
+
let _useSyncExternalStore = React.useSyncExternalStore;
|
|
7
8
|
function configure(jsx2, Fragment, hooks) {
|
|
8
9
|
_jsx = jsx2;
|
|
9
10
|
if (Fragment !== void 0) _Fragment = Fragment;
|
|
10
11
|
if (hooks?.useState) _useState = hooks.useState;
|
|
11
12
|
if (hooks?.useId) _useId = hooks.useId;
|
|
12
13
|
if (hooks?.useMemo) _useMemo = hooks.useMemo;
|
|
14
|
+
if (hooks?.useSyncExternalStore) _useSyncExternalStore = hooks.useSyncExternalStore;
|
|
13
15
|
}
|
|
14
16
|
function useState(initial) {
|
|
15
17
|
return _useState(initial);
|
|
@@ -20,6 +22,9 @@ function useId() {
|
|
|
20
22
|
function useMemo(factory, deps) {
|
|
21
23
|
return _useMemo(factory, deps);
|
|
22
24
|
}
|
|
25
|
+
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
26
|
+
return _useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
27
|
+
}
|
|
23
28
|
function jsx(type, props, key) {
|
|
24
29
|
const { children, ...rest } = props ?? {};
|
|
25
30
|
const p = key !== void 0 ? { ...rest, key } : rest;
|
|
@@ -43,5 +48,6 @@ export {
|
|
|
43
48
|
jsxs,
|
|
44
49
|
useId,
|
|
45
50
|
useMemo,
|
|
46
|
-
useState
|
|
51
|
+
useState,
|
|
52
|
+
useSyncExternalStore
|
|
47
53
|
};
|