杜府 3 éve
szülő
commit
f2c44cb860
29 módosított fájl, 178 hozzáadás és 2 törlés
  1. 69 0
      components/README.md
  2. 0 0
      components/assets/fonts/stdf.remixicon.symbol.svg
  3. 1 0
      components/assets/svg_base/ri-arrow-left-s-line.svg
  4. 1 0
      components/assets/svg_base/ri-arrow-right-s-line.svg
  5. 1 0
      components/assets/svg_base/ri-barcode-fill.svg
  6. 1 0
      components/assets/svg_base/ri-checkbox-blank-circle-line.svg
  7. 1 0
      components/assets/svg_base/ri-checkbox-circle-line.svg
  8. 1 0
      components/assets/svg_base/ri-close-circle-fill.svg
  9. 1 0
      components/assets/svg_base/ri-close-circle-line.svg
  10. 1 0
      components/assets/svg_base/ri-close-line.svg
  11. 1 0
      components/assets/svg_base/ri-code-box-fill.svg
  12. 1 0
      components/assets/svg_base/ri-error-warning-line.svg
  13. 1 0
      components/assets/svg_base/ri-image-2-fill.svg
  14. 1 0
      components/assets/svg_base/ri-information-line.svg
  15. 1 0
      components/assets/svg_base/ri-movie-2-fill.svg
  16. 1 0
      components/assets/svg_base/ri-qr-code-fill.svg
  17. 1 0
      components/assets/svg_base/ri-radio-button-line.svg
  18. 1 0
      components/assets/svg_base/ri-star-fill.svg
  19. 1 0
      components/assets/svg_base/ri-survey-fill.svg
  20. 1 0
      components/assets/svg_base/ri-survey-line.svg
  21. 1 0
      components/assets/svg_base/ri-user-3-line.svg
  22. 1 0
      components/assets/svg_base/ri-volume-down-line.svg
  23. 1 1
      components/package.json
  24. 5 1
      components/src/icon/guide.md
  25. 4 0
      components/src/icon/guide_en.md
  26. 1 0
      doc/blog/20230430
  27. 21 0
      package-lock.json
  28. 32 0
      package.json
  29. 25 0
      updatedV.js

+ 69 - 0
components/README.md

@@ -0,0 +1,69 @@
+<div align="center">
+
+  <img src="https://stdf.design/assets/images/stdf_512px.png" alt="logo" width="100" height="auto" />
+  <h1>S T D F</h1>
+
+[![npm (tag)](https://img.shields.io/npm/v/stdf)](https://www.npmjs.com/package/stdf) [![npm](https://img.shields.io/npm/dw/stdf)](https://www.npmjs.com/package/stdf)
+
+  <h4>
+    <a href="https://github.com/dufu1991/stdf/blob/main/README_en.md" target="_blank">English Doc</a>
+  <span> · </span>
+    <a href="https://stdf.design?lang=zh_CN" target="_blank">中文网站</a>
+  <span> · </span>
+    <a href="https://stdf.design?lang=en_US" target="_blank">英文网站</a>
+  </h4>
+</div>
+
+# 介绍
+
+基于 [Svelte](https://svelte.dev) 与 [Tailwind](https://www.tailwindcss.com) 的移动 web 组件库。
+
+> **S**imple - 简单 · **T**hin - 轻量 · **D**esign - 设计 · **F**ast - 快速
+
+# 特性
+
+-   🚀 无运行时,无虚拟 DOM,线上运行更快;
+-   🧰 API 丰富,轻松配置出符合需求的组件样式;
+-   ✍ 基于 Svelte 和 Tailwind,编码迅速轻松;
+-   🍭 支持暗色模式;
+-   📖 提供丰富的中英文文档和组件示例;
+-   🌍 支持国际化,已内置 60+ 种语言包;
+-   🫰 交互友好,动画参数可配,可自定义主题;
+-   🤝 支持 Tailwind 类库,如 Windi CSS、UnoCSS 等。
+
+# 快速上手
+
+## 安装
+
+已有配置好 Svelte 与 Tailwind 的工程,直接安装。
+
+```bash
+npm i stdf
+# or
+yarn add stdf
+# or
+pnpm i stdf
+```
+
+## 使用
+
+```xml
+<!-- Button Demo -->
+<script>
+import { Button } from 'stdf';
+</script>
+
+<Button>默认</Button>
+```
+
+😓 无工程?用 Vite 示例创建工程,参考 [Vite 文档](https://cn.vitejs.dev/guide/#scaffolding-your-first-vite-project)。并配置 Tailwind CSS,参考 [Tailwind CSS 文档](https://tailwindcss.com/docs/guides/vite)。
+
+# 手机预览
+
+可以手机扫描以下二维码访问手机端 Demo:
+
+<img src="https://stdf.design/assets/qr/demo_qr.png" width="220" height="220" >
+
+# 开源协议
+
+本项目基于 [MIT](https://github.com/dufu1991/stdf/blob/main/LICENSE) 协议,请自由地享受和参与开源。

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
components/assets/fonts/stdf.remixicon.symbol.svg


+ 1 - 0
components/assets/svg_base/ri-arrow-left-s-line.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-arrow-right-s-line.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.1714 12.0007L8.22168 7.05093L9.63589 5.63672L15.9999 12.0007L9.63589 18.3646L8.22168 16.9504L13.1714 12.0007Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-barcode-fill.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2 4H4V20H2V4ZM6 4H8V20H6V4ZM9 4H12V20H9V4ZM13 4H15V20H13V4ZM16 4H18V20H16V4ZM19 4H22V20H19V4Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-checkbox-blank-circle-line.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-checkbox-circle-line.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-close-circle-fill.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-close-circle-line.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 10.5858L14.8284 7.75736L16.2426 9.17157L13.4142 12L16.2426 14.8284L14.8284 16.2426L12 13.4142L9.17157 16.2426L7.75736 14.8284L10.5858 12L7.75736 9.17157L9.17157 7.75736L12 10.5858Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-close-line.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12.0007 10.5865L16.9504 5.63672L18.3646 7.05093L13.4149 12.0007L18.3646 16.9504L16.9504 18.3646L12.0007 13.4149L7.05093 18.3646L5.63672 16.9504L10.5865 12.0007L5.63672 7.05093L7.05093 5.63672L12.0007 10.5865Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-code-box-fill.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3ZM16.4645 15.5355L20 12L16.4645 8.46447L15.0503 9.87868L17.1716 12L15.0503 14.1213L16.4645 15.5355ZM6.82843 12L8.94975 9.87868L7.53553 8.46447L4 12L7.53553 15.5355L8.94975 14.1213L6.82843 12ZM11.2443 17L14.884 7H12.7557L9.11597 17H11.2443Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-error-warning-line.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-image-2-fill.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-information-line.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 7H13V9H11V7ZM11 11H13V17H11V11Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-movie-2-fill.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.001 20H20V22H12C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 15.2712 20.4293 18.1755 18.001 20ZM12 10C13.1046 10 14 9.10457 14 8C14 6.89543 13.1046 6 12 6C10.8954 6 10 6.89543 10 8C10 9.10457 10.8954 10 12 10ZM8 14C9.10457 14 10 13.1046 10 12C10 10.8954 9.10457 10 8 10C6.89543 10 6 10.8954 6 12C6 13.1046 6.89543 14 8 14ZM16 14C17.1046 14 18 13.1046 18 12C18 10.8954 17.1046 10 16 10C14.8954 10 14 10.8954 14 12C14 13.1046 14.8954 14 16 14ZM12 18C13.1046 18 14 17.1046 14 16C14 14.8954 13.1046 14 12 14C10.8954 14 10 14.8954 10 16C10 17.1046 10.8954 18 12 18Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-qr-code-fill.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16 17V16H13V13H16V15H18V17H17V19H15V21H13V18H15V17H16ZM21 21H17V19H19V17H21V21ZM3 3H11V11H3V3ZM13 3H21V11H13V3ZM3 13H11V21H3V13ZM18 13H21V15H18V13ZM6 6V8H8V6H6ZM6 16V18H8V16H6ZM16 6V8H18V6H16Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-radio-button-line.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12C17 14.7614 14.7614 17 12 17Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-star-fill.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12.0006 18.26L4.94715 22.2082L6.52248 14.2799L0.587891 8.7918L8.61493 7.84006L12.0006 0.5L15.3862 7.84006L23.4132 8.7918L17.4787 14.2799L19.054 22.2082L12.0006 18.26Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-survey-fill.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6 4V8H18V4H20.0066C20.5552 4 21 4.44495 21 4.9934V21.0066C21 21.5552 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5551 3 21.0066V4.9934C3 4.44476 3.44495 4 3.9934 4H6ZM9 17H7V19H9V17ZM9 14H7V16H9V14ZM9 11H7V13H9V11ZM16 2V6H8V2H16Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-survey-line.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 2V4H20.0066C20.5552 4 21 4.44495 21 4.9934V21.0066C21 21.5552 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5551 3 21.0066V4.9934C3 4.44476 3.44495 4 3.9934 4H7V2H17ZM7 6H5V20H19V6H17V8H7V6ZM9 16V18H7V16H9ZM9 13V15H7V13H9ZM9 10V12H7V10H9ZM15 4H9V6H15V4Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-user-3-line.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 22H18V20C18 18.3431 16.6569 17 15 17H9C7.34315 17 6 18.3431 6 20V22H4V20C4 17.2386 6.23858 15 9 15H15C17.7614 15 20 17.2386 20 20V22ZM12 13C8.68629 13 6 10.3137 6 7C6 3.68629 8.68629 1 12 1C15.3137 1 18 3.68629 18 7C18 10.3137 15.3137 13 12 13ZM12 11C14.2091 11 16 9.20914 16 7C16 4.79086 14.2091 3 12 3C9.79086 3 8 4.79086 8 7C8 9.20914 9.79086 11 12 11Z"></path></svg>

+ 1 - 0
components/assets/svg_base/ri-volume-down-line.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 7.22056L9.60282 10.0001H6V14.0001H9.60282L13 16.7796V7.22056ZM8.88889 16.0001H5C4.44772 16.0001 4 15.5524 4 15.0001V9.00007C4 8.44778 4.44772 8.00007 5 8.00007H8.88889L14.1834 3.66821C14.3971 3.49335 14.7121 3.52485 14.887 3.73857C14.9601 3.8279 15 3.93977 15 4.05519V19.9449C15 20.2211 14.7761 20.4449 14.5 20.4449C14.3846 20.4449 14.2727 20.405 14.1834 20.3319L8.88889 16.0001ZM18.8631 16.5911L17.4411 15.1691C18.3892 14.4376 19 13.2902 19 12.0001C19 10.5697 18.2493 9.31476 17.1203 8.60766L18.5589 7.16906C20.0396 8.26166 21 10.0187 21 12.0001C21 13.8422 20.1698 15.4905 18.8631 16.5911Z"></path></svg>

+ 1 - 1
components/package.json

@@ -1,6 +1,6 @@
 {
     "name": "stdf",
-    "version": "0.0.1",
+    "version": "0.0.3",
     "description": "Mobile Web component library based on Svelte and Tailwind",
     "main": "index.js",
     "scripts": {

+ 5 - 1
components/src/icon/guide.md

@@ -14,7 +14,7 @@ STDF 部分组件内使用的图标源自 [Remix Icon 图标库](https://remixic
 
 具体使用如下:
 
-| 图标名称                          | 所属组件         |
+| 图标名称                      | 所属组件         |
 | ----------------------------- | ---------------- |
 | ri-user-3-line                | Avatar           |
 | ri-arrow-right-s-line         | Cell / NoticeBar |
@@ -37,6 +37,10 @@ STDF 部分组件内使用的图标源自 [Remix Icon 图标库](https://remixic
 | ri-error-warning-line         | Toast            |
 | ri-information-line           | Toast            |
 
+可到 `node_modules/stdf/assets/fonts/stdf.remixicon.symbol.svg` 查看由这些图标组成的 SVG Sprites。
+
+可到 `node_modules/stdf/assets/svg_base/` 查看这些图标的 SVG 源文件。
+
 目前前端打包工具无论是 Webpack 还是 Vite 或者 Rollup 都有对应的 SVG Sprites 合成插件,请自行选择或手动合成。
 
 ## 图标名称

+ 4 - 0
components/src/icon/guide_en.md

@@ -37,6 +37,10 @@ Usage is as follows:
 | ri-error-warning-line         | Toast            |
 | ri-information-line           | Toast            |
 
+You can go to the `node_modules/stdf/assets/fonts/stdf.remixicon.symbol.svg` to view the SVG Sprites composed of these icons.
+
+You can go to the `node_modules/stdf/assets/svg_base/` to view svg source file of these icons.
+
 Currently, whether it is Webpack, Vite, or Rollup for front-end packaging tools, there are corresponding SVG Sprite synthesis plugins. You can choose one or combine it manually.
 
 ## Icon Name

+ 1 - 0
doc/blog/20230430

@@ -0,0 +1 @@
+d 

+ 21 - 0
package-lock.json

@@ -0,0 +1,21 @@
+{
+  "name": "stdf",
+  "version": "0.0.2",
+  "lockfileVersion": 3,
+  "requires": true,
+  "packages": {
+    "": {
+      "name": "stdf",
+      "version": "0.0.2",
+      "license": "MIT",
+      "dependencies": {
+        "fs": "^0.0.1-security"
+      }
+    },
+    "node_modules/fs": {
+      "version": "0.0.1-security",
+      "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
+      "integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w=="
+    }
+  }
+}

+ 32 - 0
package.json

@@ -0,0 +1,32 @@
+{
+	"name": "stdf",
+	"version": "0.0.3",
+	"description": "Mobile Web component library based on Svelte and Tailwind",
+	"main": "index.js",
+	"scripts": {
+		"test": "echo \"Error: no test specified\" && exit 1",
+		"cpREADME": "cp README.md ./components",
+		"updateV": "node updatedV.js",
+		"publish": "cd components && npm publish",
+		"preGit": "npm run cpREADME && npm run updateV && npm run publish"
+	},
+	"author": "dufu1991",
+	"license": "MIT",
+	"homepage": "https://stdf.design",
+	"keywords": [
+		"svelte",
+		"tailwind",
+		"ui framework",
+		"ui 组件库",
+		"移动组件库",
+		"moblie ui",
+		"web component"
+	],
+	"repository": {
+		"type": "git",
+		"url": "https://github.com/dufu1991/stdf"
+	},
+	"dependencies": {
+		"fs": "^0.0.1-security"
+	}
+}

+ 25 - 0
updatedV.js

@@ -0,0 +1,25 @@
+const fs = require('fs');
+
+fs.readFile('./components/package.json', 'utf8', (err, data) => {
+    if (err) {
+        console.error(err);
+        return;
+    }
+    const componentsObj = JSON.parse(data);
+
+    fs.readFile('./package.json', 'utf8', (err, data) => {
+        if (err) {
+            console.error(err);
+            return;
+        }
+        const stdfObj = JSON.parse(data);
+        stdfObj.version = componentsObj.version;
+        fs.writeFile('./package.json', JSON.stringify(stdfObj, '', '\t'), err => {
+            if (err) {
+                console.error(err);
+                return;
+            }
+            console.log('version updated!');
+        });
+    });
+});

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott