@1337exp/taoui 1.13.1 → 2.1.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 +83 -14
- package/README.ru.md +631 -561
- package/dist/index.cjs +1208 -614
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +765 -380
- package/dist/index.mjs +1209 -615
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -4785
- package/package.json +66 -61
- package/src/styles/index.css +3 -1
- package/src/styles/primitives.css +42 -5
- package/src/styles/size.css +57 -0
- package/src/styles/surface.css +102 -0
package/package.json
CHANGED
|
@@ -1,61 +1,66 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@1337exp/taoui",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Modern UI component library for Nuxt/Vue",
|
|
5
|
-
"homepage": "https://666.io",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "./dist/index.cjs",
|
|
8
|
-
"module": "./dist/index.mjs",
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"types": "./dist/index.d.ts",
|
|
13
|
-
"import": "./dist/index.mjs",
|
|
14
|
-
"require": "./dist/index.cjs"
|
|
15
|
-
},
|
|
16
|
-
"./styles.css": "./dist/styles.css",
|
|
17
|
-
"./styles/*": "./src/styles/*",
|
|
18
|
-
"./package.json": "./package.json"
|
|
19
|
-
},
|
|
20
|
-
"files": [
|
|
21
|
-
"dist",
|
|
22
|
-
"src/styles"
|
|
23
|
-
],
|
|
24
|
-
"scripts": {
|
|
25
|
-
"build": "vite build",
|
|
26
|
-
"dev": "vite build --watch",
|
|
27
|
-
"type-check": "vue-tsc --noEmit",
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@1337exp/taoui",
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "Modern UI component library for Nuxt/Vue",
|
|
5
|
+
"homepage": "https://666.io",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.cjs",
|
|
8
|
+
"module": "./dist/index.mjs",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.mjs",
|
|
14
|
+
"require": "./dist/index.cjs"
|
|
15
|
+
},
|
|
16
|
+
"./styles.css": "./dist/styles.css",
|
|
17
|
+
"./styles/*": "./src/styles/*",
|
|
18
|
+
"./package.json": "./package.json"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"src/styles"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "vite build",
|
|
26
|
+
"dev": "vite build --watch",
|
|
27
|
+
"type-check": "vue-tsc --noEmit",
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"test:watch": "vitest",
|
|
30
|
+
"prepublishOnly": "npm run type-check && npm run test && npm run build"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git://github.com/1337exp/taoui"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"vue",
|
|
38
|
+
"nuxt",
|
|
39
|
+
"ui",
|
|
40
|
+
"components",
|
|
41
|
+
"library",
|
|
42
|
+
"design-tokens"
|
|
43
|
+
],
|
|
44
|
+
"author": "",
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"vue": "^3.4.0",
|
|
48
|
+
"nuxt": "^3.0.0"
|
|
49
|
+
},
|
|
50
|
+
"peerDependenciesMeta": {
|
|
51
|
+
"nuxt": {
|
|
52
|
+
"optional": true
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@vitejs/plugin-vue": "^5.0.0",
|
|
57
|
+
"@vue/test-utils": "^2.5.1",
|
|
58
|
+
"happy-dom": "^15.11.7",
|
|
59
|
+
"typescript": "^5.3.0",
|
|
60
|
+
"vite": "^5.0.0",
|
|
61
|
+
"vite-plugin-dts": "^3.7.0",
|
|
62
|
+
"vitest": "^2.1.9",
|
|
63
|
+
"vue": "^3.4.0",
|
|
64
|
+
"vue-tsc": "^2.0.0"
|
|
65
|
+
}
|
|
66
|
+
}
|
package/src/styles/index.css
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tao UI — styles entry point
|
|
3
3
|
*
|
|
4
|
-
* Порядок важен: primitives -> semantic (default theme) -> optional themes -> base reset.
|
|
4
|
+
* Порядок важен: primitives -> semantic (default theme) -> optional themes -> size context -> surfaces -> base reset.
|
|
5
5
|
*/
|
|
6
6
|
@import "./primitives.css";
|
|
7
7
|
@import "./semantic.css";
|
|
8
8
|
@import "./themes/light.css";
|
|
9
|
+
@import "./size.css";
|
|
10
|
+
@import "./surface.css";
|
|
9
11
|
@import "./base.css";
|
|
@@ -41,14 +41,51 @@
|
|
|
41
41
|
--tao-blue-500: #4c82f7;
|
|
42
42
|
--tao-blue-600: #3b6de0;
|
|
43
43
|
|
|
44
|
-
/* ---------- Control
|
|
45
|
-
One scale
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
/* ---------- Control size scale / Шкала размеров контролов ----------
|
|
45
|
+
One scale (small / medium / large) for every control with `size`. Components read the current values
|
|
46
|
+
from size.css (--tao-control-height etc.), never these directly.
|
|
47
|
+
Единая шкала для всех контролов с `size`. Компоненты читают текущие значения из size.css, не эти. */
|
|
48
48
|
--tao-control-height-small: 26px;
|
|
49
49
|
--tao-control-height-medium: 36px;
|
|
50
50
|
--tao-control-height-large: 44px;
|
|
51
|
-
|
|
51
|
+
|
|
52
|
+
--tao-control-padding-x-small: var(--tao-space-2);
|
|
53
|
+
--tao-control-padding-x-medium: var(--tao-space-3);
|
|
54
|
+
--tao-control-padding-x-large: var(--tao-space-4);
|
|
55
|
+
|
|
56
|
+
--tao-control-padding-y-small: var(--tao-space-1);
|
|
57
|
+
--tao-control-padding-y-medium: var(--tao-space-2);
|
|
58
|
+
--tao-control-padding-y-large: var(--tao-space-3);
|
|
59
|
+
|
|
60
|
+
--tao-control-font-size-small: var(--tao-font-size-xs);
|
|
61
|
+
--tao-control-font-size-medium: var(--tao-font-size-md);
|
|
62
|
+
--tao-control-font-size-large: var(--tao-font-size-lg);
|
|
63
|
+
|
|
64
|
+
/* Secondary text inside controls: affixes, segmented labels, service rows / Вторичный текст в контролах */
|
|
65
|
+
--tao-control-font-size-secondary-small: var(--tao-font-size-xs);
|
|
66
|
+
--tao-control-font-size-secondary-medium: var(--tao-font-size-sm);
|
|
67
|
+
--tao-control-font-size-secondary-large: var(--tao-font-size-md);
|
|
68
|
+
|
|
69
|
+
--tao-button-padding-x-small: var(--tao-space-3);
|
|
70
|
+
--tao-button-padding-x-medium: var(--tao-space-4);
|
|
71
|
+
--tao-button-padding-x-large: var(--tao-space-6);
|
|
72
|
+
|
|
73
|
+
/* Choice indicators: Checkbox box, Radio circle; Switch track is 2px taller.
|
|
74
|
+
Индикаторы выбора: квадрат Checkbox, круг Radio; дорожка Switch на 2px выше. */
|
|
75
|
+
--tao-indicator-size-small: 14px;
|
|
76
|
+
--tao-indicator-size-medium: 18px;
|
|
77
|
+
--tao-indicator-size-large: 22px;
|
|
78
|
+
|
|
79
|
+
/* Tag / Тег */
|
|
80
|
+
--tao-tag-height-small: 18px;
|
|
81
|
+
--tao-tag-height-medium: 20px;
|
|
82
|
+
--tao-tag-height-large: 24px;
|
|
83
|
+
--tao-tag-padding-x-small: 6px;
|
|
84
|
+
--tao-tag-padding-x-medium: var(--tao-space-2);
|
|
85
|
+
--tao-tag-padding-x-large: 10px;
|
|
86
|
+
--tao-tag-font-size-small: var(--tao-font-size-xs);
|
|
87
|
+
--tao-tag-font-size-medium: var(--tao-font-size-xs);
|
|
88
|
+
--tao-tag-font-size-large: var(--tao-font-size-sm);
|
|
52
89
|
|
|
53
90
|
/* ---------- Spacing scale (4px base) ---------- */
|
|
54
91
|
--tao-space-1: 4px;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tao UI — Size context / Контекст размера
|
|
3
|
+
*
|
|
4
|
+
* Controls never read the per-size primitives directly — only the "current" tokens below.
|
|
5
|
+
* :root is medium; `.tao-size-small` / `-medium` / `-large` on any element switches its whole subtree.
|
|
6
|
+
* A control with an explicit `size` prop adds the same class to itself; without the prop it inherits.
|
|
7
|
+
*
|
|
8
|
+
* Контролы читают только «текущие» токены ниже, не примитивы по размерам.
|
|
9
|
+
* :root — medium; класс `.tao-size-*` на любом элементе переключает всё поддерево.
|
|
10
|
+
* Контрол с явным `size` вешает этот же класс на себя, без prop — наследует.
|
|
11
|
+
*/
|
|
12
|
+
:root,
|
|
13
|
+
.tao-size-medium {
|
|
14
|
+
--tao-size: medium;
|
|
15
|
+
--tao-control-height: var(--tao-control-height-medium);
|
|
16
|
+
--tao-control-padding-x: var(--tao-control-padding-x-medium);
|
|
17
|
+
--tao-control-padding-y: var(--tao-control-padding-y-medium);
|
|
18
|
+
--tao-control-font-size: var(--tao-control-font-size-medium);
|
|
19
|
+
--tao-control-font-size-secondary: var(--tao-control-font-size-secondary-medium);
|
|
20
|
+
--tao-button-padding-x: var(--tao-button-padding-x-medium);
|
|
21
|
+
--tao-indicator-size: var(--tao-indicator-size-medium);
|
|
22
|
+
--tao-tag-height: var(--tao-tag-height-medium);
|
|
23
|
+
--tao-tag-padding-x: var(--tao-tag-padding-x-medium);
|
|
24
|
+
--tao-tag-font-size: var(--tao-tag-font-size-medium);
|
|
25
|
+
/* Deprecated alias, follows the current size. / Устаревший алиас, следует текущему размеру. */
|
|
26
|
+
--tao-field-height: var(--tao-control-height);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.tao-size-small {
|
|
30
|
+
--tao-size: small;
|
|
31
|
+
--tao-control-height: var(--tao-control-height-small);
|
|
32
|
+
--tao-control-padding-x: var(--tao-control-padding-x-small);
|
|
33
|
+
--tao-control-padding-y: var(--tao-control-padding-y-small);
|
|
34
|
+
--tao-control-font-size: var(--tao-control-font-size-small);
|
|
35
|
+
--tao-control-font-size-secondary: var(--tao-control-font-size-secondary-small);
|
|
36
|
+
--tao-button-padding-x: var(--tao-button-padding-x-small);
|
|
37
|
+
--tao-indicator-size: var(--tao-indicator-size-small);
|
|
38
|
+
--tao-tag-height: var(--tao-tag-height-small);
|
|
39
|
+
--tao-tag-padding-x: var(--tao-tag-padding-x-small);
|
|
40
|
+
--tao-tag-font-size: var(--tao-tag-font-size-small);
|
|
41
|
+
--tao-field-height: var(--tao-control-height);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.tao-size-large {
|
|
45
|
+
--tao-size: large;
|
|
46
|
+
--tao-control-height: var(--tao-control-height-large);
|
|
47
|
+
--tao-control-padding-x: var(--tao-control-padding-x-large);
|
|
48
|
+
--tao-control-padding-y: var(--tao-control-padding-y-large);
|
|
49
|
+
--tao-control-font-size: var(--tao-control-font-size-large);
|
|
50
|
+
--tao-control-font-size-secondary: var(--tao-control-font-size-secondary-large);
|
|
51
|
+
--tao-button-padding-x: var(--tao-button-padding-x-large);
|
|
52
|
+
--tao-indicator-size: var(--tao-indicator-size-large);
|
|
53
|
+
--tao-tag-height: var(--tao-tag-height-large);
|
|
54
|
+
--tao-tag-padding-x: var(--tao-tag-padding-x-large);
|
|
55
|
+
--tao-tag-font-size: var(--tao-tag-font-size-large);
|
|
56
|
+
--tao-field-height: var(--tao-control-height);
|
|
57
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tao UI — Surfaces / Поверхности
|
|
3
|
+
*
|
|
4
|
+
* How a panel is "made": flat fill (default), grain (film grain), glass (blurred translucent).
|
|
5
|
+
* Put `.tao-surface-grain` / `-glass` on any element — a game HUD, a landing section, a sidebar —
|
|
6
|
+
* or pass `surface` to TaoCard / TaoBlock. Theme tokens below tune the look once for the whole app.
|
|
7
|
+
*
|
|
8
|
+
* Из чего «сделана» панель: плоская заливка (по умолчанию), grain (плёночное зерно), glass (размытое
|
|
9
|
+
* полупрозрачное стекло). Класс `.tao-surface-*` — на любой элемент, или проп `surface` у TaoCard / TaoBlock.
|
|
10
|
+
* Токены ниже настраивают вид один раз на всё приложение.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/* The surface belongs to one element: a glass panel does not turn its children into glass.
|
|
14
|
+
Поверхность принадлежит одному элементу: стеклянная панель не делает стеклянными детей. */
|
|
15
|
+
@property --tao-surface-fill {
|
|
16
|
+
syntax: '*';
|
|
17
|
+
inherits: false;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@property --tao-surface-image {
|
|
21
|
+
syntax: '*';
|
|
22
|
+
inherits: false;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@property --tao-surface-image-size {
|
|
26
|
+
syntax: '*';
|
|
27
|
+
inherits: false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@property --tao-surface-inset {
|
|
31
|
+
syntax: '*';
|
|
32
|
+
inherits: false;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@property --tao-surface-backdrop {
|
|
36
|
+
syntax: '*';
|
|
37
|
+
inherits: false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* ---------- Theme tokens: dark (default) / Токены темы: тёмная ---------- */
|
|
41
|
+
:root,
|
|
42
|
+
[data-tao-theme="dark"] {
|
|
43
|
+
/* static film grain, light specks; replace with your own image / статичное зерно, светлые крапинки */
|
|
44
|
+
--tao-surface-grain-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0.07 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
|
|
45
|
+
--tao-surface-grain-size: 160px;
|
|
46
|
+
--tao-glass-fill: color-mix(in srgb, var(--tao-color-surface-raised) 55%, transparent);
|
|
47
|
+
--tao-glass-border: rgb(255 255 255 / 0.08);
|
|
48
|
+
--tao-glass-blur: 16px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* ---------- Theme tokens: light / Токены темы: светлая ----------
|
|
52
|
+
After the dark block on purpose: :root and [data-tao-theme] weigh the same, the later one wins.
|
|
53
|
+
Специально после тёмной: :root и [data-tao-theme] весят одинаково, побеждает поздний. */
|
|
54
|
+
[data-tao-theme="light"] {
|
|
55
|
+
/* dark specks / тёмные крапинки */
|
|
56
|
+
--tao-surface-grain-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.035 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
|
|
57
|
+
--tao-glass-fill: color-mix(in srgb, var(--tao-color-surface) 60%, transparent);
|
|
58
|
+
--tao-glass-border: rgb(0 0 0 / 0.08);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* ---------- Classes / Классы ---------- */
|
|
62
|
+
.tao-surface-grain {
|
|
63
|
+
--tao-surface-image: var(--tao-surface-grain-image);
|
|
64
|
+
--tao-surface-image-size: var(--tao-surface-grain-size);
|
|
65
|
+
background-image: var(--tao-surface-image);
|
|
66
|
+
background-size: var(--tao-surface-image-size);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Glass needs something behind it: use it for things that float over content (popovers, HUD, a header over a scroll).
|
|
70
|
+
Стеклу нужно что-то позади: для того, что плавает над контентом (поповеры, HUD, шапка над прокруткой). */
|
|
71
|
+
.tao-surface-glass {
|
|
72
|
+
--tao-surface-fill: var(--tao-glass-fill);
|
|
73
|
+
/* the edge keeps glass apart from what is behind / край отделяет стекло от того, что позади */
|
|
74
|
+
--tao-surface-inset: inset 0 0 0 1px var(--tao-glass-border);
|
|
75
|
+
--tao-surface-backdrop: blur(var(--tao-glass-blur)) saturate(1.4);
|
|
76
|
+
background-color: var(--tao-surface-fill);
|
|
77
|
+
box-shadow: var(--tao-surface-inset);
|
|
78
|
+
-webkit-backdrop-filter: var(--tao-surface-backdrop);
|
|
79
|
+
backdrop-filter: var(--tao-surface-backdrop);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* No blur support, or the user asked for less transparency: a solid panel.
|
|
83
|
+
Нет размытия или пользователь попросил меньше прозрачности — сплошная панель.
|
|
84
|
+
The token itself turns solid, so components that tint glass (toast, confirm) follow.
|
|
85
|
+
Сплошным становится сам токен — за ним идут и компоненты, которые подкрашивают стекло (toast, confirm). */
|
|
86
|
+
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
|
|
87
|
+
:root,
|
|
88
|
+
[data-tao-theme] {
|
|
89
|
+
--tao-glass-fill: var(--tao-color-surface-raised);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@media (prefers-reduced-transparency: reduce) {
|
|
94
|
+
:root,
|
|
95
|
+
[data-tao-theme] {
|
|
96
|
+
--tao-glass-fill: var(--tao-color-surface-raised);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.tao-surface-glass {
|
|
100
|
+
--tao-surface-backdrop: none;
|
|
101
|
+
}
|
|
102
|
+
}
|