@astryx-vue/core 0.17.0 → 0.18.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/dist/AppShell/index.d.ts +1 -1
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Card/index.d.ts +1 -1
- package/dist/Carousel/index.d.ts +1 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/Code/index.d.ts +1 -1
- package/dist/Collapsible/index.d.ts +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-Dk9BQQbT.js → Collapsible-ExzU7vC0.js} +104 -40
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ContextMenu/index.d.ts +1 -1
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/Dialog/index.d.ts +1 -1
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Drawer/index.d.ts +1 -1
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/Heading/index.d.ts +1 -1
- package/dist/HoverCard/index.d.ts +1 -1
- package/dist/InfoTip/index.d.ts +1 -1
- package/dist/Link/index.d.ts +1 -1
- package/dist/List/index.d.ts +1 -1
- package/dist/{MediaTheme-Bkj-_DFN.js → MediaTheme-DfcdEWx-.js} +2 -36
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Popover/index.d.ts +1 -1
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/Resizable/index.d.ts +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/Selector/index.d.ts +1 -1
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/TabList/index.d.ts +1 -1
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-CRKljXg4.js → Table-iemur_3E.js} +372 -1
- package/dist/Text/index.d.ts +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/Theme/index.js +3 -2
- package/dist/{Theme-iqi6AvU_.js → Theme-1RJVaRgz.js} +3 -38
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/Timer/index.d.ts +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Toast/index.js +1 -1
- package/dist/{Toast-CzbqvHDN.js → Toast-D4Q6wvYu.js} +1 -1
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/Token/index.d.ts +1 -1
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-CNj4KnHH.js → TreeList-ugSF9DWj.js} +117 -2
- package/dist/composables/index.d.ts +3 -2
- package/dist/composables/index.js +2 -2
- package/dist/{composables-BKHcPgN0.js → composables-BgfubKnk.js} +39 -332
- package/dist/handle-BPXdHbkr.js +458 -0
- package/dist/{index-CO9GW-ik.d.ts → index-B-3EGjfQ.d.ts} +1 -1
- package/dist/{index-TXcNH86P.d.ts → index-B1eCxBCY.d.ts} +1 -1
- package/dist/{index-9eluGe3a.d.ts → index-BBTU-TKb.d.ts} +1 -1
- package/dist/{index-85RFPeV0.d.ts → index-BKpnfdq1.d.ts} +4 -4
- package/dist/{index-CyMStZq4.d.ts → index-B_PKY-Wn.d.ts} +5 -5
- package/dist/{index-CTjkJP4x.d.ts → index-Bgk1Rj2A.d.ts} +1 -1
- package/dist/{index-CuW4AQ7M.d.ts → index-BhxqUt3y.d.ts} +2 -2
- package/dist/{index-DofC9Rll.d.ts → index-BtqvPjAf.d.ts} +1 -1
- package/dist/{index-ChqMaV6N.d.ts → index-Bzi3A980.d.ts} +1 -1
- package/dist/{index-DK0Wdo9N.d.ts → index-BzmcDJau.d.ts} +4 -4
- package/dist/{index-CMLnSg3T.d.ts → index-C4S65SAW.d.ts} +8 -1
- package/dist/{index-dWlCpnua.d.ts → index-C5e2rZML.d.ts} +2 -2
- package/dist/{index-waTkqxTz.d.ts → index-C89cIh4E.d.ts} +1 -1
- package/dist/{index-D05JGsT3.d.ts → index-C8wfe0Mr.d.ts} +1 -1
- package/dist/{index-rdwI-mcm.d.ts → index-CtYlR9Cu.d.ts} +1 -1
- package/dist/{index-QnlWyUxN.d.ts → index-DE1genab.d.ts} +2 -2
- package/dist/{index-BxWCX2pJ.d.ts → index-DFLPv9io.d.ts} +3 -3
- package/dist/{index-BL4mH8aK.d.ts → index-DMN_JVEt.d.ts} +1 -1
- package/dist/{index-Cy1rEWC-.d.ts → index-DMcf0QeR.d.ts} +2 -2
- package/dist/{index-DYabo8TI.d.ts → index-DPhQZXYw.d.ts} +1 -1
- package/dist/{index-B0iRA00v.d.ts → index-DmAEpn5E.d.ts} +2 -2
- package/dist/{index-CH-xSiJz.d.ts → index-DtZUOyCy.d.ts} +2 -2
- package/dist/{index-CbA8rR_b.d.ts → index-FeZXsFO-.d.ts} +2 -2
- package/dist/{index-C1zwvxPH.d.ts → index-KcCNhdAw.d.ts} +2 -2
- package/dist/{index-lmd9LZKB.d.ts → index-PffxihMx.d.ts} +1 -1
- package/dist/{index-B95VIgRl.d.ts → index-Y4H4X6Vy.d.ts} +63 -57
- package/dist/{index-COgrQZIL.d.ts → index-YKCx03zD.d.ts} +2 -2
- package/dist/{index-tuNsmJxw.d.ts → index-gu5EvbE0.d.ts} +1 -0
- package/dist/{index-9tZJgo0R.d.ts → index-o00Upzjp.d.ts} +1 -1
- package/dist/{index-wY6dKz6c.d.ts → index-ql9ApSTF.d.ts} +9 -2
- package/dist/index.d.ts +33 -32
- package/dist/index.js +9 -8
- package/dist/landing-Bs0aMIsR.js +2049 -0
- package/dist/motionTokenDefaults-EFzpiAF5.js +38 -0
- package/dist/tokenName-0U-WEH09.js +36 -0
- package/dist/useAnimatedLayout-C0koWm4a.d.ts +56 -0
- package/package.json +1 -1
- package/styles/table.css +19 -0
- package/dist/{index-D8lv2BiD.d.ts → index-BqhgeAT4.d.ts} +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region src/Theme/motionTokenDefaults.ts
|
|
2
|
+
/**
|
|
3
|
+
* @file motionTokenDefaults.ts
|
|
4
|
+
* @input Nothing: the values `@astryx-vue/themes` declares on `:root`
|
|
5
|
+
* @output durationDefaults and easeDefaults, keyed by the theme vocabulary's
|
|
6
|
+
* unprefixed names, and their name types
|
|
7
|
+
* @position Theme utility with no imports. The neutral theme stylesheet
|
|
8
|
+
* (`packages/themes/neutral/base.css`) declares these values as
|
|
9
|
+
* `--astryx-duration-*` and `--astryx-ease-*`; motionTokenDefaults.test.ts
|
|
10
|
+
* keeps the two equal. Motion tokens a theme generates (`tempo`,
|
|
11
|
+
* `character`) start from these values, and the motion foundation falls
|
|
12
|
+
* back to them where no stylesheet applies. Pure; safe on the server.
|
|
13
|
+
*/
|
|
14
|
+
const durationDefaults = {
|
|
15
|
+
"--duration-fast-min": "95ms",
|
|
16
|
+
"--duration-fast": "125ms",
|
|
17
|
+
"--duration-fast-max": "165ms",
|
|
18
|
+
"--duration-medium-min": "225ms",
|
|
19
|
+
"--duration-medium": "300ms",
|
|
20
|
+
"--duration-medium-max": "400ms",
|
|
21
|
+
"--duration-slow-min": "525ms",
|
|
22
|
+
"--duration-slow": "700ms",
|
|
23
|
+
"--duration-slow-max": "935ms",
|
|
24
|
+
/** The standard dismissal duration. */
|
|
25
|
+
"--duration-exit": "var(--duration-fast)"
|
|
26
|
+
};
|
|
27
|
+
const easeDefaults = {
|
|
28
|
+
/** Decelerates: state changes. */
|
|
29
|
+
"--ease-standard": "cubic-bezier(0.24, 1, 0.4, 1)",
|
|
30
|
+
/** Entrances. A theme's `character` sets it; at `'standard'` it equals `--ease-standard`. */
|
|
31
|
+
"--ease-entrance": "cubic-bezier(0.24, 1, 0.4, 1)",
|
|
32
|
+
/** Moves on screen. A theme's `character` sets it; at `'standard'` it equals `--ease-standard`. */
|
|
33
|
+
"--ease-move": "cubic-bezier(0.24, 1, 0.4, 1)",
|
|
34
|
+
/** Accelerates: things leaving. */
|
|
35
|
+
"--ease-exit": "cubic-bezier(0.3, 0, 0.6, 0.6)"
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { easeDefaults as n, durationDefaults as t };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//#region src/Theme/tokenName.ts
|
|
2
|
+
/** Unprefixed theme vocabulary: `--color-accent`, `--spacing-4`, `--font-size-base`. */
|
|
3
|
+
const THEME_TOKEN_PREFIX = /^--(?:color|font|text|radius|duration|ease|spacing|size|shadow|border|focus|heading)-/;
|
|
4
|
+
/** Accept `--color-accent`, `--astryx-color-accent`, or `color-accent`. */
|
|
5
|
+
function normalizeTokenName(name) {
|
|
6
|
+
const trimmed = name.trim();
|
|
7
|
+
if (trimmed.startsWith("--astryx-")) return trimmed;
|
|
8
|
+
if (trimmed.startsWith("--")) return `--astryx-${trimmed.slice(2)}`;
|
|
9
|
+
return `--astryx-${trimmed}`;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Whether a custom-property name belongs to the shared theme vocabulary,
|
|
13
|
+
* written either way: `--color-accent` or `--astryx-color-accent`.
|
|
14
|
+
*
|
|
15
|
+
* A theme-local token may not use one of these names, because the shared
|
|
16
|
+
* name already has a meaning every component reads.
|
|
17
|
+
*/
|
|
18
|
+
function isPortableTokenName(name) {
|
|
19
|
+
const trimmed = name.trim();
|
|
20
|
+
const bare = trimmed.startsWith("--astryx-") ? `--${trimmed.slice(9)}` : trimmed;
|
|
21
|
+
return THEME_TOKEN_PREFIX.test(bare);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Rewrite `var(--color-accent)` to `var(--astryx-color-accent)`.
|
|
25
|
+
*
|
|
26
|
+
* Custom properties outside the theme vocabulary are left alone, so a
|
|
27
|
+
* theme-local `var(--brand-ink)` keeps its exact name.
|
|
28
|
+
*/
|
|
29
|
+
function prefixTokenReferences(value) {
|
|
30
|
+
return value.replace(/var\(\s*(--(?!astryx-)[\w-]+)/g, (match, name) => {
|
|
31
|
+
if (!THEME_TOKEN_PREFIX.test(name)) return match;
|
|
32
|
+
return `var(${normalizeTokenName(name)}`;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { normalizeTokenName as n, prefixTokenReferences as r, isPortableTokenName as t };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ComponentPublicInstance, MaybeRefOrGetter } from "vue";
|
|
2
|
+
//#region src/motion/layout/handle.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* @file handle.ts
|
|
5
|
+
* @position Internal to motion/layout; split from upstream motion/animatedLayout.ts
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* The opaque handle `useAnimatedLayout` returns. A component that receives it
|
|
9
|
+
* reports its size changes to the handle's container, the area the glide
|
|
10
|
+
* stays inside.
|
|
11
|
+
*/
|
|
12
|
+
interface AnimatedLayout {
|
|
13
|
+
/**
|
|
14
|
+
* A brand that is never present, so the handle types of the package and a
|
|
15
|
+
* swizzled copy match.
|
|
16
|
+
*/
|
|
17
|
+
readonly '@astryxdesign/core/animated-layout/v1'?: never;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/composables/useAnimatedLayout.d.ts
|
|
21
|
+
interface UseAnimatedLayoutOptions {
|
|
22
|
+
/**
|
|
23
|
+
* 内容在里面滑动的容器:滚动容器或面板。可以是模板 ref、getter 或元素本身;
|
|
24
|
+
* 给组件实例时取它的根元素。
|
|
25
|
+
*/
|
|
26
|
+
containerRef: MaybeRefOrGetter<Element | ComponentPublicInstance | null | undefined>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 返回一个句柄,交给尺寸会变的组件(例如 TreeList、Collapsible)。组件尺寸变化时,
|
|
30
|
+
* 它和 `containerRef` 里排在它后面的内容按同一条动效一起滑到新位置。固定定位和吸住的
|
|
31
|
+
* 粘性元素不动,滑动从不滚动容器,并遵从「减少动态效果」。
|
|
32
|
+
*
|
|
33
|
+
* 容器在变化发生时才读,所以句柄只创建一次,之后 ref 指向别的元素也能读到。
|
|
34
|
+
* 句柄没有公开成员。服务端渲染时不碰 DOM。
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```vue
|
|
38
|
+
* <script setup lang="ts">
|
|
39
|
+
* import { useAnimatedLayout } from '@astryx-vue/core'
|
|
40
|
+
* import { useTemplateRef } from 'vue'
|
|
41
|
+
*
|
|
42
|
+
* const container = useTemplateRef<HTMLElement>('container')
|
|
43
|
+
* const animatedLayout = useAnimatedLayout({ containerRef: container })
|
|
44
|
+
* </script>
|
|
45
|
+
*
|
|
46
|
+
* <template>
|
|
47
|
+
* <div ref="container">
|
|
48
|
+
* <TreeList :items="items" :animated-layout="animatedLayout" />
|
|
49
|
+
* <p>备注</p>
|
|
50
|
+
* </div>
|
|
51
|
+
* </template>
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
declare function useAnimatedLayout({ containerRef }: UseAnimatedLayoutOptions): AnimatedLayout;
|
|
55
|
+
//#endregion
|
|
56
|
+
export { useAnimatedLayout as n, AnimatedLayout as r, UseAnimatedLayoutOptions as t };
|
package/package.json
CHANGED
package/styles/table.css
CHANGED
|
@@ -784,6 +784,25 @@
|
|
|
784
784
|
border-bottom-width: 0;
|
|
785
785
|
}
|
|
786
786
|
|
|
787
|
+
/*
|
|
788
|
+
* 行展开带着布局动效滑动时(Table/glidingDivider.ts),合并边框画在格子原来的位置,
|
|
789
|
+
* 不会跟着行走。滑动期间移动行的格子边框变透明,由一个格子的 ::after 横跨整行画同一条线;
|
|
790
|
+
* 线以行为定位参照(格子本身不定位),所以不受格子 overflow 裁切,也不改变列宽。
|
|
791
|
+
*/
|
|
792
|
+
.astryx-table tr[data-astryx-row-gliding] {
|
|
793
|
+
position: relative;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
.astryx-table td[data-astryx-cell-gliding='line']::after {
|
|
797
|
+
content: '';
|
|
798
|
+
position: absolute;
|
|
799
|
+
inset-inline: 0;
|
|
800
|
+
bottom: calc(-1 * var(--_table-row-glide-offset, 0px));
|
|
801
|
+
height: 0;
|
|
802
|
+
border-bottom: var(--_table-row-glide-width, 0px) var(--_table-row-glide-style, solid) var(--_table-row-glide-color, var(--astryx-color-border, light-dark(#ebebeb, #ffffff1a)));
|
|
803
|
+
pointer-events: none;
|
|
804
|
+
}
|
|
805
|
+
|
|
787
806
|
.astryx-table__row-index {
|
|
788
807
|
font-family: var(--astryx-font-family-code, ui-monospace, monospace);
|
|
789
808
|
font-size: var(--astryx-text-supporting-size, 0.75rem);
|
|
@@ -43,9 +43,9 @@ declare const __VLS_base: import("vue").DefineComponent<TokenProps, {}, {}, {},
|
|
|
43
43
|
onRemove?: ((event: Event) => any) | undefined;
|
|
44
44
|
}>, {
|
|
45
45
|
size: TokenSize;
|
|
46
|
-
color: "default" | "blue" | "cyan" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow";
|
|
47
46
|
labelHidden: boolean;
|
|
48
47
|
disabled: boolean;
|
|
48
|
+
color: "default" | "blue" | "cyan" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow";
|
|
49
49
|
removable: boolean;
|
|
50
50
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
51
51
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|