@astryx-vue/lab 0.4.0 → 0.5.1

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/lab.css CHANGED
@@ -10,3 +10,6 @@
10
10
  @import './styles/list-input.css';
11
11
  @import './styles/diff-viewer.css';
12
12
  @import './styles/tour.css';
13
+ @import './styles/code-editor.css';
14
+ @import './styles/chat-emoji-picker.css';
15
+ @import './styles/chat-reaction-bar.css';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astryx-vue/lab",
3
3
  "type": "module",
4
- "version": "0.4.0",
4
+ "version": "0.5.1",
5
5
  "description": "Astryx lab components for Vue 3 — experimental components that may change. Ships only under the canary dist-tag.",
6
6
  "author": "ShenQingchuan",
7
7
  "license": "MIT",
@@ -53,7 +53,7 @@
53
53
  ],
54
54
  "peerDependencies": {
55
55
  "vue": "^3.5.0",
56
- "@astryx-vue/core": "^0.7.12"
56
+ "@astryx-vue/core": "^0.7.14"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/node": "26.6.4",
@@ -64,7 +64,7 @@
64
64
  "unplugin-vue": "8.0.0",
65
65
  "vue": "3.5.43",
66
66
  "vue-tsc": "3.3.12",
67
- "@astryx-vue/core": "^0.7.12"
67
+ "@astryx-vue/core": "^0.7.14"
68
68
  },
69
69
  "scripts": {
70
70
  "build": "tsdown",
@@ -0,0 +1,80 @@
1
+ @layer astryx.reset, astryx.tokens, astryx.base, astryx.components, astryx.overrides;
2
+
3
+ @layer astryx.components {
4
+ .astryx-chat-emoji-picker {
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: var(--astryx-spacing-2, 8px);
8
+ box-sizing: border-box;
9
+ min-width: 0;
10
+ }
11
+
12
+ .astryx-chat-emoji-picker__search {
13
+ width: 100%;
14
+ min-width: 0;
15
+ }
16
+
17
+ /* 8 列固定格子。方向键按这个几何走,不把格子拉成不等宽。 */
18
+ .astryx-chat-emoji-picker__grid {
19
+ display: grid;
20
+ grid-template-columns: repeat(8, 32px);
21
+ gap: var(--astryx-spacing-0-5, 2px);
22
+ justify-content: start;
23
+ }
24
+
25
+ .astryx-chat-emoji-picker__cell {
26
+ display: inline-flex;
27
+ align-items: center;
28
+ justify-content: center;
29
+ box-sizing: border-box;
30
+ width: 32px;
31
+ height: 32px;
32
+ margin: 0;
33
+ padding: 0;
34
+ border-style: none;
35
+ border-radius: var(--astryx-radius-inner, 0.375rem);
36
+ background-color: transparent;
37
+ color: inherit;
38
+ font-family: var(--astryx-font-family-body, inherit);
39
+ font-size: 18px;
40
+ line-height: var(--astryx-text-body-leading, 1.4286);
41
+ cursor: pointer;
42
+ transition-property: background-color;
43
+ transition-duration: var(--astryx-duration-fast, 125ms);
44
+ transition-timing-function: var(--astryx-ease-standard, cubic-bezier(0.24, 1, 0.4, 1));
45
+ }
46
+
47
+ /*
48
+ * 格子紧挨着,外扩的焦点环会压到旁边的格子,所以向内收 2px。
49
+ * 禁用和 aria-disabled 不给悬停底,指针也回到普通箭头(原版 a11y #5247 / #5335)。
50
+ */
51
+ @media (hover: hover) {
52
+ .astryx-chat-emoji-picker__cell:hover:where(:not(:disabled, [aria-disabled='true'])) {
53
+ background-color: var(--astryx-color-overlay-hover, light-dark(#0000000d, #ffffff0d));
54
+ }
55
+ }
56
+
57
+ .astryx-chat-emoji-picker__cell:is(:disabled, [aria-disabled='true']) {
58
+ cursor: default;
59
+ }
60
+
61
+ .astryx-chat-emoji-picker__cell:focus-visible {
62
+ outline: var(--astryx-focus-outline-width, 2px) var(--astryx-focus-outline-style, solid) var(--astryx-focus-outline-color, currentcolor);
63
+ outline-offset: -2px;
64
+ }
65
+
66
+ .astryx-chat-emoji-picker__empty {
67
+ padding-block: var(--astryx-spacing-2, 8px);
68
+ padding-inline: var(--astryx-spacing-1, 4px);
69
+ color: var(--astryx-color-text-secondary, light-dark(#6a6a6a, #9e9e9e));
70
+ font-family: var(--astryx-font-family-body, inherit);
71
+ font-size: var(--astryx-text-supporting-size, 0.75rem);
72
+ line-height: var(--astryx-text-supporting-leading, 1.6667);
73
+ }
74
+
75
+ @media (prefers-reduced-motion: reduce) {
76
+ .astryx-chat-emoji-picker__cell {
77
+ transition-duration: 0s;
78
+ }
79
+ }
80
+ }
@@ -0,0 +1,96 @@
1
+ @layer astryx.reset, astryx.tokens, astryx.base, astryx.components, astryx.overrides;
2
+
3
+ @layer astryx.components {
4
+ .astryx-chat-reaction-bar {
5
+ display: flex;
6
+ flex-wrap: wrap;
7
+ align-items: center;
8
+ gap: var(--astryx-spacing-1, 4px);
9
+ }
10
+
11
+ .astryx-chat-reaction-bar__pill,
12
+ .astryx-chat-reaction-bar__add {
13
+ box-sizing: border-box;
14
+ margin: 0;
15
+ border-width: 1px;
16
+ border-style: solid;
17
+ border-color: transparent;
18
+ background-color: var(--astryx-color-background-muted, light-dark(#f1f1f1, #1b1b1b));
19
+ font-family: var(--astryx-font-family-body, inherit);
20
+ cursor: pointer;
21
+ transition-property: border-color, background-color;
22
+ transition-duration: var(--astryx-duration-fast, 125ms);
23
+ transition-timing-function: var(--astryx-ease-standard, cubic-bezier(0.24, 1, 0.4, 1));
24
+ }
25
+
26
+ .astryx-chat-reaction-bar__pill {
27
+ display: inline-flex;
28
+ align-items: center;
29
+ gap: var(--astryx-spacing-1, 4px);
30
+ height: 24px;
31
+ padding-inline: var(--astryx-spacing-2, 8px);
32
+ border-radius: var(--astryx-radius-full, 9999px);
33
+ }
34
+
35
+ .astryx-chat-reaction-bar__pill[data-selected] {
36
+ border-color: var(--astryx-color-accent, currentcolor);
37
+ background-color: var(--astryx-color-accent-muted, light-dark(#f1f1f1, #262626));
38
+ }
39
+
40
+ /* 悬停只加深边框。自己已经选中的胶囊保持强调色,不被悬停盖掉。 */
41
+ @media (hover: hover) {
42
+ .astryx-chat-reaction-bar__pill:hover:where(:not(:disabled, [aria-disabled='true'], [data-selected])),
43
+ .astryx-chat-reaction-bar__add:hover:where(:not(:disabled, [aria-disabled='true'])) {
44
+ border-color: var(--astryx-color-border-emphasized, light-dark(#d4d4d4, #525252));
45
+ }
46
+ }
47
+
48
+ .astryx-chat-reaction-bar__pill:is(:disabled, [aria-disabled='true']),
49
+ .astryx-chat-reaction-bar__add:is(:disabled, [aria-disabled='true']) {
50
+ cursor: default;
51
+ }
52
+
53
+ .astryx-chat-reaction-bar__pill:focus-visible,
54
+ .astryx-chat-reaction-bar__add:focus-visible {
55
+ outline: var(--astryx-focus-outline-width, 2px) var(--astryx-focus-outline-style, solid) var(--astryx-focus-outline-color, currentcolor);
56
+ outline-offset: var(--astryx-focus-outline-offset, 2px);
57
+ }
58
+
59
+ .astryx-chat-reaction-bar__emoji {
60
+ font-size: var(--astryx-text-body-size, 1rem);
61
+ line-height: var(--astryx-text-body-leading, 1.4286);
62
+ }
63
+
64
+ .astryx-chat-reaction-bar__count {
65
+ color: var(--astryx-color-text-secondary, light-dark(#6a6a6a, #9e9e9e));
66
+ font-size: var(--astryx-text-supporting-size, 0.75rem);
67
+ font-weight: var(--astryx-font-weight-medium, 500);
68
+ font-variant-numeric: tabular-nums;
69
+ line-height: var(--astryx-text-supporting-leading, 1.6667);
70
+ }
71
+
72
+ .astryx-chat-reaction-bar__pill[data-selected] .astryx-chat-reaction-bar__count {
73
+ color: var(--astryx-color-text-accent, currentcolor);
74
+ font-weight: var(--astryx-font-weight-semibold, 600);
75
+ }
76
+
77
+ .astryx-chat-reaction-bar__add {
78
+ display: inline-flex;
79
+ align-items: center;
80
+ justify-content: center;
81
+ width: 32px;
82
+ height: 24px;
83
+ padding: 0;
84
+ border-radius: var(--astryx-radius-full, 9999px);
85
+ color: var(--astryx-color-icon-secondary, light-dark(#6a6a6a, #9e9e9e));
86
+ font-size: 15px;
87
+ line-height: var(--astryx-text-supporting-leading, 1.6667);
88
+ }
89
+
90
+ @media (prefers-reduced-motion: reduce) {
91
+ .astryx-chat-reaction-bar__pill,
92
+ .astryx-chat-reaction-bar__add {
93
+ transition-duration: 0s;
94
+ }
95
+ }
96
+ }
@@ -0,0 +1,95 @@
1
+ @layer astryx.reset, astryx.tokens, astryx.base, astryx.components, astryx.overrides;
2
+
3
+ @layer astryx.components {
4
+ .astryx-code-editor {
5
+ position: relative;
6
+ display: flex;
7
+ border: var(--astryx-border-width, 1px) solid var(--astryx-color-border, #ebebeb);
8
+ border-radius: var(--astryx-radius-element, 0.625rem);
9
+ background: var(--astryx-color-background-muted, #f5f5f5);
10
+ overflow: hidden;
11
+ }
12
+
13
+ .astryx-code-editor.is-focused {
14
+ border-color: var(--astryx-color-accent, #0064e0);
15
+ box-shadow: 0 0 0 1px var(--astryx-color-accent, #0064e0);
16
+ }
17
+
18
+ .astryx-code-editor__container {
19
+ display: flex;
20
+ flex: 1;
21
+ min-width: 0;
22
+ overflow: auto;
23
+ }
24
+
25
+ .astryx-code-editor__gutter {
26
+ flex-shrink: 0;
27
+ padding-block: var(--astryx-spacing-3, 12px);
28
+ padding-inline-start: var(--astryx-spacing-4, 16px);
29
+ padding-inline-end: var(--astryx-spacing-3, 12px);
30
+ border-inline-end: var(--astryx-border-width, 1px) solid var(--astryx-color-border, #ebebeb);
31
+ color: var(--astryx-color-text-disabled, #a3a3a3);
32
+ font-family: var(--astryx-font-family-code, monospace);
33
+ line-height: var(--astryx-text-code-leading, 1.5);
34
+ text-align: end;
35
+ user-select: none;
36
+ }
37
+
38
+ .astryx-code-editor__body {
39
+ position: relative;
40
+ flex: 1;
41
+ min-width: 0;
42
+ }
43
+
44
+ .astryx-code-editor__input {
45
+ display: block;
46
+ min-height: 3em;
47
+ margin: 0;
48
+ padding-block: var(--astryx-spacing-3, 12px);
49
+ padding-inline: var(--astryx-spacing-4, 16px);
50
+ color: var(--astryx-color-text-primary, #171717);
51
+ caret-color: var(--astryx-color-text-primary, #171717);
52
+ font-family: var(--astryx-font-family-code, monospace);
53
+ line-height: var(--astryx-text-code-leading, 1.5);
54
+ tab-size: 2;
55
+ white-space: pre;
56
+ word-break: normal;
57
+ overflow-wrap: normal;
58
+ outline: none;
59
+ }
60
+
61
+ .astryx-code-editor__input,
62
+ .astryx-code-editor__gutter {
63
+ font-size: var(--astryx-text-code-size, 14px);
64
+ }
65
+
66
+ .astryx-code-editor[data-size='sm'] .astryx-code-editor__input,
67
+ .astryx-code-editor[data-size='sm'] .astryx-code-editor__gutter {
68
+ font-size: var(--astryx-font-size-sm, 12px);
69
+ }
70
+
71
+ .astryx-code-editor__placeholder {
72
+ position: absolute;
73
+ top: var(--astryx-spacing-3, 12px);
74
+ inset-inline-start: var(--astryx-spacing-4, 16px);
75
+ color: var(--astryx-color-text-disabled, #a3a3a3);
76
+ font-family: var(--astryx-font-family-code, monospace);
77
+ line-height: var(--astryx-text-code-leading, 1.5);
78
+ pointer-events: none;
79
+ user-select: none;
80
+ }
81
+ }
82
+
83
+ .astryx-code-editor__input::highlight(astryx-keyword) { color: var(--astryx-code-syntax-keyword, #52237b); }
84
+ .astryx-code-editor__input::highlight(astryx-string) { color: var(--astryx-code-syntax-string, #004800); }
85
+ .astryx-code-editor__input::highlight(astryx-comment) { color: var(--astryx-code-syntax-comment, #605f52); }
86
+ .astryx-code-editor__input::highlight(astryx-number) { color: var(--astryx-code-syntax-number, #622e00); }
87
+ .astryx-code-editor__input::highlight(astryx-function) { color: var(--astryx-code-syntax-function, #203a6c); }
88
+ .astryx-code-editor__input::highlight(astryx-type) { color: var(--astryx-code-syntax-type, #52237b); }
89
+ .astryx-code-editor__input::highlight(astryx-tag) { color: var(--astryx-code-syntax-tag, #6d211c); }
90
+ .astryx-code-editor__input::highlight(astryx-attribute) { color: var(--astryx-code-syntax-attribute, #413e00); }
91
+ .astryx-code-editor__input::highlight(astryx-property) { color: var(--astryx-code-syntax-property, #203a6c); }
92
+ .astryx-code-editor__input::highlight(astryx-operator) { color: var(--astryx-code-syntax-operator, #171717); }
93
+ .astryx-code-editor__input::highlight(astryx-constant) { color: var(--astryx-code-syntax-constant, #622e00); }
94
+ .astryx-code-editor__input::highlight(astryx-punctuation) { color: var(--astryx-code-syntax-punctuation, #525252); }
95
+ .astryx-code-editor__input::highlight(astryx-variable) { color: var(--astryx-code-syntax-variable, #203a6c); }