@antadesign/anta 0.1.1-dev.8 → 0.2.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/README.md +2 -2
- package/dist/components/Button.js +4 -3
- package/dist/components/Menu.d.ts +61 -0
- package/dist/components/Menu.js +34 -0
- package/dist/components/MenuGroup.d.ts +24 -0
- package/dist/components/MenuGroup.js +19 -0
- package/dist/components/MenuItem.d.ts +49 -0
- package/dist/components/MenuItem.js +40 -0
- package/dist/components/MenuSeparator.d.ts +14 -0
- package/dist/components/MenuSeparator.js +7 -0
- package/dist/components/Tag.d.ts +55 -0
- package/dist/components/Tag.js +40 -0
- package/dist/components/Text.d.ts +4 -2
- package/dist/components/Tooltip.d.ts +4 -2
- package/dist/elements/a-button.css +31 -8
- package/dist/elements/a-icon.shapes.css +4 -0
- package/dist/elements/a-icon.shapes.d.ts +2 -1
- package/dist/elements/a-icon.shapes.js +3 -1
- package/dist/elements/a-menu-group.css +21 -0
- package/dist/elements/a-menu-group.d.ts +13 -0
- package/dist/elements/a-menu-group.js +15 -0
- package/dist/elements/a-menu-item.css +162 -0
- package/dist/elements/a-menu-item.d.ts +27 -0
- package/dist/elements/a-menu-item.js +29 -0
- package/dist/elements/a-menu-separator.css +15 -0
- package/dist/elements/a-menu-separator.d.ts +12 -0
- package/dist/elements/a-menu-separator.js +15 -0
- package/dist/elements/a-menu.css +34 -0
- package/dist/elements/a-menu.d.ts +120 -0
- package/dist/elements/a-menu.js +649 -0
- package/dist/elements/a-tag.css +196 -0
- package/dist/elements/a-text.css +17 -13
- package/dist/elements/a-tooltip.css +21 -1
- package/dist/elements/a-tooltip.d.ts +7 -0
- package/dist/elements/a-tooltip.js +96 -19
- package/dist/elements/index.d.ts +2 -4
- package/dist/elements/index.js +1 -6
- package/dist/general_types.d.ts +15 -35
- package/dist/index.d.ts +2 -4
- package/dist/index.js +2 -4
- package/dist/jsx-runtime.d.ts +6 -5
- package/dist/reset.css +11 -7
- package/package.json +13 -15
package/dist/index.d.ts
CHANGED
|
@@ -22,15 +22,13 @@ export { Text } from './components/Text';
|
|
|
22
22
|
export type { TextProps } from './components/Text';
|
|
23
23
|
export { Title } from './components/Title';
|
|
24
24
|
export type { TitleProps } from './components/Title';
|
|
25
|
+
export { Tag } from './components/Tag';
|
|
26
|
+
export type { TagProps } from './components/Tag';
|
|
25
27
|
export { Icon } from './components/Icon';
|
|
26
28
|
export type { IconProps } from './components/Icon';
|
|
27
29
|
export { Button } from './components/Button';
|
|
28
30
|
export type { ButtonProps, BaseButtonProps, ContentMode, SubmitMode, PriorityMode, } from './components/Button';
|
|
29
31
|
export { ICON_SHAPES, ICON_SYNONYMS } from './elements/a-icon.shapes';
|
|
30
|
-
export { Sticker } from './components/Sticker';
|
|
31
|
-
export type { StickerProps } from './components/Sticker';
|
|
32
|
-
export { StickerAnimated } from './components/StickerAnimated';
|
|
33
|
-
export type { StickerAnimatedProps } from './components/StickerAnimated';
|
|
34
32
|
export { Tooltip } from './components/Tooltip';
|
|
35
33
|
export type { TooltipProps } from './components/Tooltip';
|
|
36
34
|
export type { BaseProps, BaseAttributes } from './general_types';
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Progress } from "./components/Progress";
|
|
2
2
|
import { Text } from "./components/Text";
|
|
3
3
|
import { Title } from "./components/Title";
|
|
4
|
+
import { Tag } from "./components/Tag";
|
|
4
5
|
import { Icon } from "./components/Icon";
|
|
5
6
|
import { Button } from "./components/Button";
|
|
6
7
|
import { ICON_SHAPES, ICON_SYNONYMS } from "./elements/a-icon.shapes";
|
|
7
|
-
import { Sticker } from "./components/Sticker";
|
|
8
|
-
import { StickerAnimated } from "./components/StickerAnimated";
|
|
9
8
|
import { Tooltip } from "./components/Tooltip";
|
|
10
9
|
import { configure } from "./jsx-runtime";
|
|
11
10
|
export {
|
|
@@ -14,8 +13,7 @@ export {
|
|
|
14
13
|
ICON_SYNONYMS,
|
|
15
14
|
Icon,
|
|
16
15
|
Progress,
|
|
17
|
-
|
|
18
|
-
StickerAnimated,
|
|
16
|
+
Tag,
|
|
19
17
|
Text,
|
|
20
18
|
Title,
|
|
21
19
|
Tooltip,
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -22,9 +22,9 @@ export declare function configure(jsx: JsxFunction, Fragment?: ComponentType): v
|
|
|
22
22
|
export declare function jsx(type: ComponentType, props: Record<string, unknown> | null, key?: string | number): unknown;
|
|
23
23
|
export declare function jsxs(type: ComponentType, props: Record<string, unknown> | null, key?: string | number): unknown;
|
|
24
24
|
export { _Fragment as Fragment };
|
|
25
|
-
import type { AProgressAttributes, ATextAttributes, ATitleAttributes, AIconAttributes, AButtonAttributes,
|
|
25
|
+
import type { AProgressAttributes, ATextAttributes, ATitleAttributes, ATagAttributes, AIconAttributes, AButtonAttributes, ATooltipAttributes, BaseAttributes } from './general_types';
|
|
26
26
|
export declare namespace JSX {
|
|
27
|
-
|
|
27
|
+
interface IntrinsicElements extends React.JSX.IntrinsicElements {
|
|
28
28
|
'a-progress': AProgressAttributes;
|
|
29
29
|
'a-progress-label': BaseAttributes;
|
|
30
30
|
'a-progress-number': BaseAttributes;
|
|
@@ -32,11 +32,12 @@ export declare namespace JSX {
|
|
|
32
32
|
'a-progress-hint': BaseAttributes;
|
|
33
33
|
'a-text': ATextAttributes;
|
|
34
34
|
'a-title': ATitleAttributes;
|
|
35
|
+
'a-tag': ATagAttributes;
|
|
36
|
+
'a-tag-label': BaseAttributes;
|
|
37
|
+
'a-tag-value': BaseAttributes;
|
|
35
38
|
'a-icon': AIconAttributes;
|
|
36
39
|
'a-button': AButtonAttributes;
|
|
37
40
|
'a-button-label': BaseAttributes;
|
|
38
|
-
'a-sticker': AStickerAttributes;
|
|
39
|
-
'a-sticker-animated': AStickerAnimatedAttributes;
|
|
40
41
|
'a-tooltip': ATooltipAttributes;
|
|
41
|
-
}
|
|
42
|
+
}
|
|
42
43
|
}
|
package/dist/reset.css
CHANGED
|
@@ -108,14 +108,18 @@
|
|
|
108
108
|
/* Global link defaults. Hairline underline at 75% alpha;
|
|
109
109
|
underline goes to currentColor (100%) and 1px on hover. Color
|
|
110
110
|
comes from --link-color tokens, which auto-flip in dark mode.
|
|
111
|
-
`:not([role="button"])` excludes anchor-buttons (`<a role="button">`,
|
|
111
|
+
`:not(:where([role="button"]))` excludes anchor-buttons (`<a role="button">`,
|
|
112
112
|
e.g. `<Button href>`): `a:link`/`a:visited` are pseudo-classes with the
|
|
113
113
|
same (0,1,1) specificity as `a[role="button"]`, so without the exclusion
|
|
114
114
|
they'd tie and win on source order, giving buttons link colour +
|
|
115
|
-
underline.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
underline. The `:where()` keeps the exclusion specificity-neutral so this
|
|
116
|
+
base rule stays at (0,0,1)/(0,1,1) — a bare `:not([role="button"])` would
|
|
117
|
+
add an attribute selector's weight and out-specify prose-link overrides
|
|
118
|
+
like `a-text a` / the <Button> prose-link rule, leaving their links stuck
|
|
119
|
+
on the global blue. Other contexts (nav, headings) still override as needed. */
|
|
120
|
+
a:not(:where([role="button"])),
|
|
121
|
+
a:not(:where([role="button"])):link,
|
|
122
|
+
a:not(:where([role="button"])):visited {
|
|
119
123
|
color: var(--link-color);
|
|
120
124
|
text-decoration: underline;
|
|
121
125
|
text-decoration-style: solid;
|
|
@@ -126,14 +130,14 @@
|
|
|
126
130
|
/* Hover only on real-pointer devices — gating avoids the sticky hover
|
|
127
131
|
color that lingers after a tap on touch screens. */
|
|
128
132
|
@media (hover: hover) and (pointer: fine) {
|
|
129
|
-
a:not([role="button"]):hover {
|
|
133
|
+
a:not(:where([role="button"])):hover {
|
|
130
134
|
color: var(--link-color-hover);
|
|
131
135
|
/* Underline color is left as the resting hairline (the base rule's
|
|
132
136
|
`currentColor` mix) — only the thickness grows on hover. */
|
|
133
137
|
text-decoration-thickness: 1px;
|
|
134
138
|
}
|
|
135
139
|
}
|
|
136
|
-
a:not([role="button"]):active {
|
|
140
|
+
a:not(:where([role="button"])):active {
|
|
137
141
|
text-decoration-color: color-mix(in srgb, currentColor 75%, transparent);
|
|
138
142
|
}
|
|
139
143
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antadesign/anta",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,18 +26,17 @@
|
|
|
26
26
|
"types": "./dist/elements/*.d.ts",
|
|
27
27
|
"default": "./dist/elements/*.js"
|
|
28
28
|
},
|
|
29
|
+
"./anta_helpers": {
|
|
30
|
+
"types": "./dist/anta_helpers.d.ts",
|
|
31
|
+
"default": "./dist/anta_helpers.js"
|
|
32
|
+
},
|
|
33
|
+
"./general_types": {
|
|
34
|
+
"types": "./dist/general_types.d.ts",
|
|
35
|
+
"default": "./dist/general_types.js"
|
|
36
|
+
},
|
|
29
37
|
"./tokens.css": "./dist/tokens.css",
|
|
30
38
|
"./reset.css": "./dist/reset.css",
|
|
31
39
|
"./generate-icons.mjs": "./dist/generate-icons.mjs",
|
|
32
|
-
"./generate-stickers.mjs": "./dist/generate-stickers.mjs",
|
|
33
|
-
"./stickers": {
|
|
34
|
-
"types": "./dist/components/__generated__/stickers/index.d.ts",
|
|
35
|
-
"default": "./dist/components/__generated__/stickers/index.js"
|
|
36
|
-
},
|
|
37
|
-
"./stickers/*": {
|
|
38
|
-
"types": "./dist/components/__generated__/stickers/*.d.ts",
|
|
39
|
-
"default": "./dist/components/__generated__/stickers/*.js"
|
|
40
|
-
},
|
|
41
40
|
"./*": {
|
|
42
41
|
"types": "./dist/*.d.ts",
|
|
43
42
|
"default": "./dist/*"
|
|
@@ -45,13 +44,13 @@
|
|
|
45
44
|
},
|
|
46
45
|
"scripts": {
|
|
47
46
|
"build": "pnpm run build:js && pnpm run build:css && pnpm run build:types",
|
|
48
|
-
"build:css": "find src -name '*.css' | while IFS= read -r f; do d=\"dist/${f#src/}\"; mkdir -p \"$(dirname \"$d\")\"; cp \"$f\" \"$d\"; done && cp scripts/generate-icons.mjs
|
|
47
|
+
"build:css": "find src -name '*.css' | while IFS= read -r f; do d=\"dist/${f#src/}\"; mkdir -p \"$(dirname \"$d\")\"; cp \"$f\" \"$d\"; done && cp scripts/generate-icons.mjs dist/",
|
|
49
48
|
"build:js": "esbuild $(find src \\( -name '*.ts' -o -name '*.tsx' \\) ! -name '*.d.ts') --outdir=dist --outbase=src --jsx=automatic --jsx-import-source=@antadesign/anta --format=esm --target=ES2022 --loader:.module.css=local-css --loader:.css=global-css",
|
|
50
49
|
"build:types": "tsc -p src/tsconfig.json",
|
|
51
|
-
"dev": "nodemon -w src -e ts,tsx,css -x 'pnpm run build && pnpm --filter anta-site run docs' & pnpm --filter anta-site run dev & wait",
|
|
50
|
+
"dev": "echo $$ > .dev.pid; trap 'rm -f .dev.pid' EXIT; nodemon -w src -w stickers/src -e ts,tsx,css -x 'pnpm run build && pnpm --filter @antadesign/stickers run build && pnpm --filter anta-site run docs' & pnpm --filter anta-site run dev & wait",
|
|
51
|
+
"stop": "node scripts/dev-stop.mjs",
|
|
52
52
|
"typecheck": "tsc --noEmit -p src/tsconfig.json",
|
|
53
53
|
"icons": "node scripts/generate-icons.mjs --input src/elements/icons --output src/elements --name a-icon.shapes --internal",
|
|
54
|
-
"stickers": "node scripts/generate-stickers.mjs --input src/elements/stickers --output src/components/__generated__/stickers --internal",
|
|
55
54
|
"clean": "rm -rf dist",
|
|
56
55
|
"prepare": "pnpm run build",
|
|
57
56
|
"prepublishOnly": "pnpm run build"
|
|
@@ -64,8 +63,7 @@
|
|
|
64
63
|
},
|
|
65
64
|
"dependencies": {
|
|
66
65
|
"clsx": "^2.1.0",
|
|
67
|
-
"es-toolkit": "^1.47.0"
|
|
68
|
-
"lottie-web": "^5.13.0"
|
|
66
|
+
"es-toolkit": "^1.47.0"
|
|
69
67
|
},
|
|
70
68
|
"peerDependencies": {
|
|
71
69
|
"react": "^18.0.0 || ^19.0.0"
|