@teamix-evo/ui 0.3.0 → 0.4.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 (42) hide show
  1. package/manifest.json +20 -0
  2. package/package.json +3 -3
  3. package/src/components/button/button.tsx +18 -14
  4. package/src/components/card/card.tsx +7 -6
  5. package/src/components/cascader/cascader.tsx +12 -5
  6. package/src/components/checkbox/checkbox.tsx +4 -2
  7. package/src/components/date-picker/date-picker.tsx +2 -2
  8. package/src/components/dialog/dialog.tsx +1 -1
  9. package/src/components/filter-bar/filter-bar.stories.tsx +4 -1
  10. package/src/components/form/form.stories.tsx +7 -4
  11. package/src/components/input/input.tsx +2 -2
  12. package/src/components/input-group/input-group.tsx +2 -2
  13. package/src/components/input-number/input-number.tsx +2 -2
  14. package/src/components/native-select/native-select.tsx +2 -2
  15. package/src/components/page-header/page-header.meta.md +3 -1
  16. package/src/components/page-header/page-header.stories.tsx +8 -1
  17. package/src/components/page-header/page-header.tsx +7 -4
  18. package/src/components/page-shell/page-shell.meta.md +116 -0
  19. package/src/components/page-shell/page-shell.stories.tsx +149 -0
  20. package/src/components/page-shell/page-shell.tsx +115 -0
  21. package/src/components/pagination/pagination.tsx +24 -34
  22. package/src/components/segmented/segmented.tsx +1 -1
  23. package/src/components/select/select.tsx +2 -2
  24. package/src/components/sidebar/sidebar.meta.md +1 -0
  25. package/src/components/sidebar/sidebar.tsx +46 -17
  26. package/src/components/slider/slider.tsx +1 -1
  27. package/src/components/table/table.tsx +4 -2
  28. package/src/components/textarea/textarea.tsx +1 -1
  29. package/src/components/time-picker/time-picker.tsx +2 -2
  30. package/src/utils/trigger-input.ts +10 -6
  31. package/src/components/button/demo/as-child.tsx +0 -24
  32. package/src/components/button/demo/basic.tsx +0 -8
  33. package/src/components/button/demo/block.tsx +0 -16
  34. package/src/components/button/demo/loading.tsx +0 -19
  35. package/src/components/button/demo/shapes.tsx +0 -18
  36. package/src/components/button/demo/sizes.tsx +0 -19
  37. package/src/components/button/demo/variants.tsx +0 -19
  38. package/src/components/button/demo/with-icon.tsx +0 -20
  39. package/src/components/input/demo/basic.tsx +0 -12
  40. package/src/components/input/demo/clearable.tsx +0 -21
  41. package/src/components/input/demo/show-count.tsx +0 -18
  42. package/src/components/input/demo/sizes.tsx +0 -15
@@ -1,19 +0,0 @@
1
- import { Button } from '@/components/ui/button';
2
-
3
- /**
4
- * Loading 状态:自动 disabled,spinner 替换 icon 占位,按钮宽度保持。
5
- * 写 `loading` 即可,不要额外加 `disabled`。
6
- */
7
- export default function Demo() {
8
- return (
9
- <div className="flex flex-wrap items-center gap-3">
10
- <Button loading>提交中</Button>
11
- <Button variant="secondary" loading>
12
- 加载
13
- </Button>
14
- <Button variant="destructive" loading>
15
- 删除中
16
- </Button>
17
- </div>
18
- );
19
- }
@@ -1,18 +0,0 @@
1
- import { X } from 'lucide-react';
2
- import { Button } from '@/components/ui/button';
3
-
4
- /**
5
- * 三种形状:default / round / circle。
6
- * circle 必须配 `size="icon"`,否则视觉会扁圆变形。
7
- */
8
- export default function Demo() {
9
- return (
10
- <div className="flex flex-wrap items-center gap-3">
11
- <Button>Default</Button>
12
- <Button shape="round">Round</Button>
13
- <Button shape="circle" size="icon" variant="ghost" aria-label="关闭">
14
- <X />
15
- </Button>
16
- </div>
17
- );
18
- }
@@ -1,19 +0,0 @@
1
- import { Plus } from 'lucide-react';
2
- import { Button } from '@/components/ui/button';
3
-
4
- /**
5
- * 四种尺寸:sm / default / lg / icon。
6
- * icon 为正方形纯图标按钮,配合 `size="icon"` 使用。
7
- */
8
- export default function Demo() {
9
- return (
10
- <div className="flex flex-wrap items-center gap-3">
11
- <Button size="sm">Small</Button>
12
- <Button size="default">Default</Button>
13
- <Button size="lg">Large</Button>
14
- <Button size="icon" aria-label="Add">
15
- <Plus />
16
- </Button>
17
- </div>
18
- );
19
- }
@@ -1,19 +0,0 @@
1
- import { Button } from '@/components/ui/button';
2
-
3
- /**
4
- * 七种 variant:default / secondary / destructive / outline / dashed / ghost / link。
5
- * 视觉差异由 OpenTrek semantic tokens 决定,无任何 mock 值。
6
- */
7
- export default function Demo() {
8
- return (
9
- <div className="flex flex-wrap items-center gap-3">
10
- <Button>Default</Button>
11
- <Button variant="secondary">Secondary</Button>
12
- <Button variant="destructive">Destructive</Button>
13
- <Button variant="outline">Outline</Button>
14
- <Button variant="dashed">Dashed</Button>
15
- <Button variant="ghost">Ghost</Button>
16
- <Button variant="link">Link</Button>
17
- </div>
18
- );
19
- }
@@ -1,20 +0,0 @@
1
- import { ChevronRight, Download } from 'lucide-react';
2
- import { Button } from '@/components/ui/button';
3
-
4
- /**
5
- * 带图标按钮:通过 `icon` prop 传入 lucide-react 节点;
6
- * 用 `iconPosition` 切换图标位置(默认 start)。
7
- */
8
- export default function Demo() {
9
- return (
10
- <div className="flex flex-wrap items-center gap-3">
11
- <Button icon={<Download />}>下载</Button>
12
- <Button icon={<ChevronRight />} iconPosition="end">
13
- 下一步
14
- </Button>
15
- <Button variant="outline" icon={<Download />}>
16
- Outline + Icon
17
- </Button>
18
- </div>
19
- );
20
- }
@@ -1,12 +0,0 @@
1
- import { Input } from '@/components/ui/input';
2
-
3
- /**
4
- * 最简用法:原生 input 的并集语义,直接当受控/非受控输入框使用。
5
- */
6
- export default function Demo() {
7
- return (
8
- <div className="w-80">
9
- <Input placeholder="请输入用户名" />
10
- </div>
11
- );
12
- }
@@ -1,21 +0,0 @@
1
- import { useState } from 'react';
2
- import { Input } from '@/components/ui/input';
3
-
4
- /**
5
- * 一键清空:受控时点 X 会触发 onChange(""),非受控时直接清掉 DOM 值并派发 input 事件。
6
- * 适合搜索框、过滤器场景。
7
- */
8
- export default function Demo() {
9
- const [value, setValue] = useState('Teamix Evo');
10
- return (
11
- <div className="flex w-80 flex-col gap-3">
12
- <Input
13
- clearable
14
- value={value}
15
- onChange={(e) => setValue(e.target.value)}
16
- placeholder="受控 + clearable"
17
- />
18
- <Input clearable defaultValue="非受控示例" />
19
- </div>
20
- );
21
- }
@@ -1,18 +0,0 @@
1
- import { Input } from '@/components/ui/input';
2
-
3
- /**
4
- * 字符计数:必须配合 `maxLength` 一起使用。
5
- * 适合给社交平台发文、签名等限长场景。
6
- */
7
- export default function Demo() {
8
- return (
9
- <div className="w-80">
10
- <Input
11
- showCount
12
- maxLength={20}
13
- defaultValue="hello teamix"
14
- placeholder="最多 20 字"
15
- />
16
- </div>
17
- );
18
- }
@@ -1,15 +0,0 @@
1
- import { Input } from '@/components/ui/input';
2
-
3
- /**
4
- * 三种尺寸:sm / md / lg,与 Button 同档。
5
- * 高度通过 internal class 控制,不要再外部覆盖 `h-*`。
6
- */
7
- export default function Demo() {
8
- return (
9
- <div className="flex w-80 flex-col gap-3">
10
- <Input size="sm" placeholder="Small" />
11
- <Input size="md" placeholder="Medium" />
12
- <Input size="lg" placeholder="Large" />
13
- </div>
14
- );
15
- }