@fibrae/semi-icons-svelte 0.5.0 → 0.6.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 CHANGED
@@ -23,7 +23,7 @@ Peer dependency: `svelte` ^5.57.0. `@fibrae/semi-icons-core` is a regular depend
23
23
  ```
24
24
 
25
25
  - Styles load with the components, with no separate import.
26
- - A single icon has no props of its own, and all attributes pass through to `Icon`. `Icon` props: `size` (`inherit`, `extra-small`, `small`, `default`, `large` or `extra-large`, `default` by default), `spin`, `rotate`, `prefixCls`, `type` and `fill` (`string` or `string[]`). `style` accepts strings only.
26
+ - A single icon has no props of its own, and all attributes pass through to `Icon`. `Icon` props: `size` (`inherit`, `extra-small`, `small`, `default`, `large` or `extra-large`, `default` by default), `spin`, `rotate`, `type` and `fill` (`string` or `string[]`). `style` accepts strings only.
27
27
  - On multi-color icons, `fill` colors each part in order. Other icons pass `fill` to the root `svg`.
28
28
  - Icons are decorative by default (`aria-hidden`). With `aria-label`, `aria-labelledby` or `tabindex >= 0`, they become `role="img"` and are no longer hidden.
29
29
  - Custom icons: the default-exported `Icon` renders your own `svg` with a `children` snippet, and the snippet parameter carries `fill`. `elementType` and ref from the React version are not supported.
package/README.zh-CN.md CHANGED
@@ -23,7 +23,7 @@ peer 依赖:`svelte` ^5.57.0。`@fibrae/semi-icons-core` 是普通依赖,随
23
23
  ```
24
24
 
25
25
  - 样式随组件引入,不需要单独引入。
26
- - 单个图标没有自己的 props,所有属性透传给 `Icon`。`Icon` 的 props:`size`(`inherit`、`extra-small`、`small`、`default`、`large`、`extra-large`,默认 `default`)、`spin`、`rotate`、`prefixCls`、`type`、`fill`(`string` 或 `string[]`);`style` 只接受字符串。
26
+ - 单个图标没有自己的 props,所有属性透传给 `Icon`。`Icon` 的 props:`size`(`inherit`、`extra-small`、`small`、`default`、`large`、`extra-large`,默认 `default`)、`spin`、`rotate`、`type`、`fill`(`string` 或 `string[]`);`style` 只接受字符串。
27
27
  - 多色图标的 `fill` 按顺序给各部分上色;其他图标把 `fill` 传给根 `svg`。
28
28
  - 图标默认是装饰性的(`aria-hidden`)。传 `aria-label`、`aria-labelledby` 或 `tabindex >= 0` 时改为 `role="img"` 且不隐藏。
29
29
  - 自定义图标:默认导出的 `Icon` 用 `children` snippet 渲染自己的 `svg`,snippet 参数带上 `fill`。不支持 React 版的 `elementType` 与 ref。
@@ -8,7 +8,6 @@
8
8
  size?: IconSize;
9
9
  spin?: boolean;
10
10
  rotate?: number;
11
- prefixCls?: string;
12
11
  type?: string;
13
12
  fill?: string | string[];
14
13
  children?: Snippet<[{ fill?: string | string[] }]>;
@@ -19,9 +18,9 @@
19
18
  import { BASE_CLASS_PREFIX } from '../env.js';
20
19
  import '@fibrae/semi-icons-core/styles/icons.css';
21
20
 
22
- let { size = 'default', spin = false, rotate, prefixCls = BASE_CLASS_PREFIX, type, fill, children, ...rest }: IconProps = $props();
21
+ let { size = 'default', spin = false, rotate, type, fill, children, ...rest }: IconProps = $props();
23
22
 
24
- const prefix = $derived(`${prefixCls}-icon`);
23
+ const prefix = `${BASE_CLASS_PREFIX}-icon`;
25
24
  const exposed = $derived(Boolean(rest['aria-label'] || rest['aria-labelledby']) || Number(rest.tabindex) >= 0);
26
25
  // The user's style comes last so it can override the rotation
27
26
  const style = $derived([Number.isSafeInteger(rotate) ? `transform: rotate(${rotate}deg)` : undefined, rest.style].filter(Boolean).join(';') || undefined);
@@ -5,7 +5,6 @@ export interface IconProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'childr
5
5
  size?: IconSize;
6
6
  spin?: boolean;
7
7
  rotate?: number;
8
- prefixCls?: string;
9
8
  type?: string;
10
9
  fill?: string | string[];
11
10
  children?: Snippet<[{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fibrae/semi-icons-svelte",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Semi icons as Svelte components; full-colour icons under @fibrae/semi-icons-svelte/lab, illustrations under @fibrae/semi-icons-svelte/illustrations",
5
5
  "license": "MIT",
6
6
  "homepage": "https://semi-design-next.pages.dev",
@@ -50,17 +50,17 @@
50
50
  "*.css"
51
51
  ],
52
52
  "dependencies": {
53
- "@fibrae/semi-icons-core": "0.5.0"
53
+ "@fibrae/semi-icons-core": "0.6.0"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "svelte": "^5.57.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@sveltejs/package": "^3.0.1",
59
+ "@sveltejs/package": "^3.0.2",
60
60
  "@sveltejs/vite-plugin-svelte": "^7.3.1",
61
61
  "@testing-library/svelte": "^5.4.2",
62
62
  "svelte": "^5.57.3",
63
- "svelte-check": "^4.7.7",
63
+ "svelte-check": "^4.7.8",
64
64
  "typescript": "^6.0.3"
65
65
  },
66
66
  "scripts": {