@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.
Files changed (116) hide show
  1. package/dist/AppShell/index.d.ts +1 -1
  2. package/dist/AvatarGroup/index.d.ts +1 -1
  3. package/dist/Banner/index.d.ts +1 -1
  4. package/dist/BottomSheet/index.d.ts +1 -1
  5. package/dist/Button/index.d.ts +1 -1
  6. package/dist/ButtonGroup/index.d.ts +1 -1
  7. package/dist/Calendar/index.d.ts +1 -1
  8. package/dist/Card/index.d.ts +1 -1
  9. package/dist/Carousel/index.d.ts +1 -1
  10. package/dist/Chat/index.d.ts +1 -1
  11. package/dist/CheckboxInput/index.d.ts +1 -1
  12. package/dist/CheckboxList/index.d.ts +1 -1
  13. package/dist/ClickableCard/index.d.ts +1 -1
  14. package/dist/Code/index.d.ts +1 -1
  15. package/dist/Collapsible/index.d.ts +1 -1
  16. package/dist/Collapsible/index.js +1 -1
  17. package/dist/{Collapsible-Dk9BQQbT.js → Collapsible-ExzU7vC0.js} +104 -40
  18. package/dist/ComplexSelector/index.d.ts +1 -1
  19. package/dist/ContextMenu/index.d.ts +1 -1
  20. package/dist/DateInput/index.d.ts +1 -1
  21. package/dist/DateRangeInput/index.d.ts +1 -1
  22. package/dist/DateTimeInput/index.d.ts +1 -1
  23. package/dist/Dialog/index.d.ts +1 -1
  24. package/dist/Divider/index.d.ts +1 -1
  25. package/dist/Drawer/index.d.ts +1 -1
  26. package/dist/FileInput/index.d.ts +1 -1
  27. package/dist/Heading/index.d.ts +1 -1
  28. package/dist/HoverCard/index.d.ts +1 -1
  29. package/dist/InfoTip/index.d.ts +1 -1
  30. package/dist/Link/index.d.ts +1 -1
  31. package/dist/List/index.d.ts +1 -1
  32. package/dist/{MediaTheme-Bkj-_DFN.js → MediaTheme-DfcdEWx-.js} +2 -36
  33. package/dist/MoreMenu/index.d.ts +1 -1
  34. package/dist/MultiSelector/index.d.ts +1 -1
  35. package/dist/NavItem/index.d.ts +1 -1
  36. package/dist/NumberInput/index.d.ts +1 -1
  37. package/dist/OverflowList/index.d.ts +1 -1
  38. package/dist/Pagination/index.d.ts +1 -1
  39. package/dist/Popover/index.d.ts +1 -1
  40. package/dist/PowerSearch/index.d.ts +1 -1
  41. package/dist/ProgressBar/index.d.ts +1 -1
  42. package/dist/Radio/index.d.ts +1 -1
  43. package/dist/RadioList/index.d.ts +1 -1
  44. package/dist/Resizable/index.d.ts +1 -1
  45. package/dist/ScrollableArea/index.d.ts +1 -1
  46. package/dist/SelectableCard/index.d.ts +1 -1
  47. package/dist/Selector/index.d.ts +1 -1
  48. package/dist/SideNav/index.d.ts +1 -1
  49. package/dist/Stepper/index.d.ts +1 -1
  50. package/dist/Switch/index.d.ts +1 -1
  51. package/dist/TabList/index.d.ts +1 -1
  52. package/dist/Table/index.d.ts +1 -1
  53. package/dist/Table/index.js +1 -1
  54. package/dist/{Table-CRKljXg4.js → Table-iemur_3E.js} +372 -1
  55. package/dist/Text/index.d.ts +1 -1
  56. package/dist/TextArea/index.d.ts +1 -1
  57. package/dist/TextInput/index.d.ts +1 -1
  58. package/dist/Theme/index.js +3 -2
  59. package/dist/{Theme-iqi6AvU_.js → Theme-1RJVaRgz.js} +3 -38
  60. package/dist/TimeInput/index.d.ts +1 -1
  61. package/dist/Timer/index.d.ts +1 -1
  62. package/dist/Timestamp/index.d.ts +1 -1
  63. package/dist/Toast/index.js +1 -1
  64. package/dist/{Toast-CzbqvHDN.js → Toast-D4Q6wvYu.js} +1 -1
  65. package/dist/ToggleButton/index.d.ts +1 -1
  66. package/dist/Token/index.d.ts +1 -1
  67. package/dist/Tokenizer/index.d.ts +1 -1
  68. package/dist/Toolbar/index.d.ts +1 -1
  69. package/dist/Tooltip/index.d.ts +1 -1
  70. package/dist/TopNav/index.d.ts +1 -1
  71. package/dist/TreeList/index.d.ts +1 -1
  72. package/dist/TreeList/index.js +1 -1
  73. package/dist/{TreeList-CNj4KnHH.js → TreeList-ugSF9DWj.js} +117 -2
  74. package/dist/composables/index.d.ts +3 -2
  75. package/dist/composables/index.js +2 -2
  76. package/dist/{composables-BKHcPgN0.js → composables-BgfubKnk.js} +39 -332
  77. package/dist/handle-BPXdHbkr.js +458 -0
  78. package/dist/{index-CO9GW-ik.d.ts → index-B-3EGjfQ.d.ts} +1 -1
  79. package/dist/{index-TXcNH86P.d.ts → index-B1eCxBCY.d.ts} +1 -1
  80. package/dist/{index-9eluGe3a.d.ts → index-BBTU-TKb.d.ts} +1 -1
  81. package/dist/{index-85RFPeV0.d.ts → index-BKpnfdq1.d.ts} +4 -4
  82. package/dist/{index-CyMStZq4.d.ts → index-B_PKY-Wn.d.ts} +5 -5
  83. package/dist/{index-CTjkJP4x.d.ts → index-Bgk1Rj2A.d.ts} +1 -1
  84. package/dist/{index-CuW4AQ7M.d.ts → index-BhxqUt3y.d.ts} +2 -2
  85. package/dist/{index-DofC9Rll.d.ts → index-BtqvPjAf.d.ts} +1 -1
  86. package/dist/{index-ChqMaV6N.d.ts → index-Bzi3A980.d.ts} +1 -1
  87. package/dist/{index-DK0Wdo9N.d.ts → index-BzmcDJau.d.ts} +4 -4
  88. package/dist/{index-CMLnSg3T.d.ts → index-C4S65SAW.d.ts} +8 -1
  89. package/dist/{index-dWlCpnua.d.ts → index-C5e2rZML.d.ts} +2 -2
  90. package/dist/{index-waTkqxTz.d.ts → index-C89cIh4E.d.ts} +1 -1
  91. package/dist/{index-D05JGsT3.d.ts → index-C8wfe0Mr.d.ts} +1 -1
  92. package/dist/{index-rdwI-mcm.d.ts → index-CtYlR9Cu.d.ts} +1 -1
  93. package/dist/{index-QnlWyUxN.d.ts → index-DE1genab.d.ts} +2 -2
  94. package/dist/{index-BxWCX2pJ.d.ts → index-DFLPv9io.d.ts} +3 -3
  95. package/dist/{index-BL4mH8aK.d.ts → index-DMN_JVEt.d.ts} +1 -1
  96. package/dist/{index-Cy1rEWC-.d.ts → index-DMcf0QeR.d.ts} +2 -2
  97. package/dist/{index-DYabo8TI.d.ts → index-DPhQZXYw.d.ts} +1 -1
  98. package/dist/{index-B0iRA00v.d.ts → index-DmAEpn5E.d.ts} +2 -2
  99. package/dist/{index-CH-xSiJz.d.ts → index-DtZUOyCy.d.ts} +2 -2
  100. package/dist/{index-CbA8rR_b.d.ts → index-FeZXsFO-.d.ts} +2 -2
  101. package/dist/{index-C1zwvxPH.d.ts → index-KcCNhdAw.d.ts} +2 -2
  102. package/dist/{index-lmd9LZKB.d.ts → index-PffxihMx.d.ts} +1 -1
  103. package/dist/{index-B95VIgRl.d.ts → index-Y4H4X6Vy.d.ts} +63 -57
  104. package/dist/{index-COgrQZIL.d.ts → index-YKCx03zD.d.ts} +2 -2
  105. package/dist/{index-tuNsmJxw.d.ts → index-gu5EvbE0.d.ts} +1 -0
  106. package/dist/{index-9tZJgo0R.d.ts → index-o00Upzjp.d.ts} +1 -1
  107. package/dist/{index-wY6dKz6c.d.ts → index-ql9ApSTF.d.ts} +9 -2
  108. package/dist/index.d.ts +33 -32
  109. package/dist/index.js +9 -8
  110. package/dist/landing-Bs0aMIsR.js +2049 -0
  111. package/dist/motionTokenDefaults-EFzpiAF5.js +38 -0
  112. package/dist/tokenName-0U-WEH09.js +36 -0
  113. package/dist/useAnimatedLayout-C0koWm4a.d.ts +56 -0
  114. package/package.json +1 -1
  115. package/styles/table.css +19 -0
  116. 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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astryx-vue/core",
3
3
  "type": "module",
4
- "version": "0.17.0",
4
+ "version": "0.18.0",
5
5
  "description": "Vue 3 components for the unofficial astryx-vue port of Astryx. Not affiliated with Meta.",
6
6
  "author": "ShenQingchuan",
7
7
  "license": "MIT",
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>;