@yup/taro-ui 0.0.8 → 1.0.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 +228 -1
- package/es/_virtual/_rollupPluginBabelHelpers.js +3 -1
- package/es/components/avatar/index.d.ts +18 -0
- package/es/components/avatar/index.js +1 -0
- package/es/components/avatar/style/index.css +28 -0
- package/es/components/avatar/style/index.d.ts +2 -0
- package/es/components/avatar/style/index.js +2 -0
- package/es/components/button/index.d.ts +19 -3
- package/es/components/button/index.js +1 -1
- package/es/components/button/style/index.css +118 -48
- package/es/components/button/style/index.d.ts +1 -0
- package/es/components/button/style/index.js +1 -0
- package/es/components/checkbox/checkbox-group.d.ts +6 -2
- package/es/components/checkbox/checkbox-group.js +1 -1
- package/es/components/checkbox/index.js +1 -1
- package/es/components/checkbox/style/index.css +2 -24
- package/es/components/checkbox/style/index.d.ts +1 -0
- package/es/components/checkbox/style/index.js +1 -0
- package/es/components/city-selector/hooks/useLevel2Multiple.d.ts +24 -0
- package/es/components/city-selector/hooks/useLevel2Multiple.js +1 -0
- package/es/components/city-selector/hooks/useLevel2Single.d.ts +19 -0
- package/es/components/city-selector/hooks/useLevel2Single.js +1 -0
- package/es/components/city-selector/hooks/useMultiple.d.ts +28 -0
- package/es/components/city-selector/hooks/useMultiple.js +1 -0
- package/es/components/city-selector/hooks/useSingle.d.ts +23 -0
- package/es/components/city-selector/hooks/useSingle.js +1 -0
- package/es/components/city-selector/index.d.ts +5 -0
- package/es/components/city-selector/index.js +1 -0
- package/es/components/city-selector/style/index.css +153 -0
- package/es/components/city-selector/style/index.d.ts +2 -0
- package/es/components/city-selector/util.d.ts +2 -0
- package/es/components/city-selector/util.js +1 -0
- package/es/components/date-picker-view/index.d.ts +40 -0
- package/es/components/date-picker-view/index.js +1 -0
- package/es/components/date-picker-view/style/index.css +3 -0
- package/es/components/date-picker-view/style/index.d.ts +2 -0
- package/es/components/date-picker-view/style/index.js +2 -0
- package/es/components/date-picker-view/util.d.ts +7 -0
- package/es/components/date-picker-view/util.js +1 -0
- package/es/components/dialog/context.d.ts +4 -0
- package/es/components/dialog/index.d.ts +31 -0
- package/es/components/dialog/index.js +1 -0
- package/es/components/dialog/style/index.css +113 -0
- package/es/components/dialog/style/index.d.ts +2 -0
- package/es/components/dialog/style/index.js +2 -0
- package/es/components/form/form-item.js +1 -1
- package/es/components/form/index.js +1 -1
- package/es/components/form/style/index.css +0 -22
- package/es/components/form/style/index.d.ts +1 -0
- package/es/components/form/style/index.js +1 -0
- package/es/components/icon/index.d.ts +12 -0
- package/es/components/icon/index.js +1 -0
- package/es/components/icon/style/iconfont.css +72 -0
- package/es/components/icon/style/iconfont.ttf +0 -0
- package/es/components/icon/style/iconfont.woff +0 -0
- package/es/components/icon/style/iconfont.woff2 +0 -0
- package/es/components/icon/style/index.d.ts +1 -0
- package/es/components/icon/style/index.js +1 -0
- package/es/components/input/index.d.ts +12 -0
- package/es/components/input/index.js +1 -1
- package/es/components/input/style/index.css +33 -32
- package/es/components/input/style/index.d.ts +2 -0
- package/es/components/input/style/index.js +2 -0
- package/es/components/input/style/search.css +21 -0
- package/es/components/media-uploader/index.d.ts +123 -0
- package/es/components/media-uploader/index.js +1 -0
- package/es/components/media-uploader/style/index.css +93 -0
- package/es/components/media-uploader/style/index.d.ts +2 -0
- package/es/components/media-uploader/style/index.js +2 -0
- package/es/components/picker-view/index.d.ts +25 -0
- package/es/components/picker-view/index.js +1 -0
- package/es/components/picker-view/style/index.css +62 -0
- package/es/components/picker-view/style/index.d.ts +2 -0
- package/es/components/picker-view/style/index.js +2 -0
- package/es/components/popup/index.d.ts +62 -0
- package/es/components/popup/index.js +1 -0
- package/es/components/popup/style/index.css +91 -0
- package/es/components/popup/style/index.d.ts +2 -0
- package/es/components/popup/style/index.js +2 -0
- package/es/components/radio/context.d.ts +5 -0
- package/es/components/radio/context.js +1 -0
- package/es/components/radio/index.js +1 -1
- package/es/components/radio/radio-group.js +1 -1
- package/es/components/radio/style/group.css +0 -22
- package/es/components/radio/style/index.d.ts +1 -0
- package/es/components/radio/style/index.js +1 -0
- package/es/components/radio/style/radio.css +11 -24
- package/es/components/safe-area/index.d.ts +13 -0
- package/es/components/safe-area/index.js +1 -0
- package/es/components/safe-area/style/index.css +3 -0
- package/es/components/safe-area/style/index.d.ts +2 -0
- package/es/components/safe-area/style/index.js +2 -0
- package/es/components/safe-area/util.d.ts +5 -0
- package/es/components/safe-area/util.js +1 -0
- package/es/components/switch/index.d.ts +6 -0
- package/es/components/switch/index.js +1 -0
- package/es/components/switch/style/index.css +38 -0
- package/es/components/switch/style/index.d.ts +2 -0
- package/es/components/switch/style/index.js +2 -0
- package/es/components/tag/index.d.ts +18 -0
- package/es/components/tag/index.js +1 -0
- package/es/components/tag/style/index.css +92 -0
- package/es/components/tag/style/index.d.ts +2 -0
- package/es/components/tag/style/index.js +2 -0
- package/es/components/toast/style/index.css +0 -22
- package/es/components/toast/style/index.d.ts +1 -0
- package/es/components/toast/style/index.js +1 -0
- package/es/components/toast/toast.js +1 -1
- package/es/components/toast/withToast.js +1 -1
- package/es/global/global.css +21 -0
- package/es/global/index.d.ts +2 -1
- package/es/global/theme-default.css +21 -0
- package/es/global/variables.css +0 -0
- package/es/hooks/useRefState.d.ts +7 -0
- package/es/hooks/useRefState.js +1 -0
- package/es/index.d.ts +26 -0
- package/es/index.js +1 -1
- package/es/node_modules/@yup/taro-checkbox/dist/_virtual/_rollupPluginBabelHelpers.js +1 -0
- package/es/node_modules/@yup/taro-checkbox/dist/checkbox-group.js +1 -0
- package/es/node_modules/@yup/taro-checkbox/dist/context.js +1 -0
- package/es/node_modules/@yup/taro-checkbox/dist/index.js +1 -0
- package/es/node_modules/@yup/taro-form/dist/_virtual/_rollupPluginBabelHelpers.js +3 -0
- package/es/node_modules/@yup/taro-form/dist/context.js +1 -0
- package/es/node_modules/@yup/taro-form/dist/formItem.js +1 -0
- package/es/node_modules/@yup/taro-form/dist/fromStore.js +1 -0
- package/es/node_modules/@yup/taro-form/dist/index.js +1 -0
- package/es/node_modules/@yup/taro-form/dist/useForm.js +1 -0
- package/es/node_modules/@yup/taro-form/dist/useWatch.js +1 -0
- package/es/node_modules/@yup/taro-radio/dist/_virtual/_rollupPluginBabelHelpers.js +1 -0
- package/es/node_modules/@yup/taro-radio/dist/context.js +1 -0
- package/es/node_modules/@yup/taro-radio/dist/index.js +1 -0
- package/es/node_modules/@yup/taro-radio/dist/radio-group.js +1 -0
- package/es/style/iconfont.ttf +0 -0
- package/es/style/iconfont.woff +0 -0
- package/es/style/iconfont.woff2 +0 -0
- package/es/style/index.css +282 -227
- package/es/utils/is.js +1 -1
- package/package.json +16 -9
- package/es/_virtual/_commonjsHelpers.js +0 -1
- package/es/_virtual/index.js +0 -1
- package/es/_virtual/jsx-runtime.js +0 -1
- package/es/_virtual/react-jsx-runtime.development.js +0 -1
- package/es/_virtual/react-jsx-runtime.production.min.js +0 -1
- package/es/global.css +0 -22
- package/es/node_modules/classnames/index.js +0 -1
- package/es/node_modules/react/cjs/react-jsx-runtime.development.js +0 -1
- package/es/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -10
- package/es/node_modules/react/jsx-runtime.js +0 -1
- package/es/utils/react.d.ts +0 -2
package/README.md
CHANGED
|
@@ -1,3 +1,230 @@
|
|
|
1
1
|
# yp-taro-ui
|
|
2
2
|
|
|
3
|
-
鱼泡Taro UI
|
|
3
|
+
鱼泡 Taro UI 组件库(抖音小程序)
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @yup/taro-ui
|
|
9
|
+
# 或
|
|
10
|
+
yarn add @yup/taro-ui
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 按需加载
|
|
14
|
+
|
|
15
|
+
配合 `babel-plugin-import` 插件实现按需加载,自动引入组件样式。
|
|
16
|
+
|
|
17
|
+
### 安装插件
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install babel-plugin-import --save-dev
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 配置 babel
|
|
24
|
+
|
|
25
|
+
在 `babel.config.js` 或 `.babelrc` 中添加:
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
{
|
|
29
|
+
"plugins": [
|
|
30
|
+
["import", {
|
|
31
|
+
"libraryName": "@yup/taro-ui",
|
|
32
|
+
"libraryDirectory": "es/components",
|
|
33
|
+
"style": true
|
|
34
|
+
}]
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 使用
|
|
40
|
+
|
|
41
|
+
配置后可以直接按需引入组件:
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import { Button, Input } from '@yup/taro-ui';
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 开发指南
|
|
50
|
+
|
|
51
|
+
### 环境要求
|
|
52
|
+
|
|
53
|
+
- Node.js >= 16
|
|
54
|
+
- npm >= 8 或 yarn >= 1.22
|
|
55
|
+
|
|
56
|
+
### 开发命令
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# 安装依赖
|
|
60
|
+
npm install
|
|
61
|
+
|
|
62
|
+
# 启动文档开发服务(端口 8888)
|
|
63
|
+
npm run dev
|
|
64
|
+
# 或
|
|
65
|
+
npm start
|
|
66
|
+
|
|
67
|
+
# 构建文档
|
|
68
|
+
npm run build:doc
|
|
69
|
+
|
|
70
|
+
# 构建组件库
|
|
71
|
+
npm run build:components
|
|
72
|
+
|
|
73
|
+
# 代码检查
|
|
74
|
+
npm run lint
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 发布说明
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# 构建并发布(手动更新版本号)
|
|
81
|
+
npm run release
|
|
82
|
+
|
|
83
|
+
# 自动更新 patch 版本并发布
|
|
84
|
+
npm run release:patch
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
发布前请确保:
|
|
88
|
+
1. 代码已通过 lint 检查
|
|
89
|
+
2. 组件功能测试通过
|
|
90
|
+
3. 文档已更新
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 组件编写规范
|
|
95
|
+
|
|
96
|
+
### 目录结构
|
|
97
|
+
|
|
98
|
+
每个组件遵循以下目录结构:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
src/components/
|
|
102
|
+
└── button/ # 组件目录(小写,kebab-case)
|
|
103
|
+
├── index.tsx # 组件主文件
|
|
104
|
+
├── demos/ # 示例目录
|
|
105
|
+
│ ├── demo1.tsx # 示例1
|
|
106
|
+
│ ├── demo2.tsx # 示例2
|
|
107
|
+
│ └── ...
|
|
108
|
+
└── style/ # 样式目录
|
|
109
|
+
├── index.ts # 样式入口(用于按需加载)
|
|
110
|
+
└── index.less # 组件样式
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### 组件编写规范
|
|
114
|
+
|
|
115
|
+
1. **命名规范**
|
|
116
|
+
- 组件目录:小写 + 连字符(如 `date-picker-view`)
|
|
117
|
+
- 组件名:大驼峰(如 `DatePickerView`)
|
|
118
|
+
- 样式类名前缀:`ypmini-组件名`(如 `ypmini-button`)
|
|
119
|
+
|
|
120
|
+
2. **类型定义**
|
|
121
|
+
- 导出组件的 Props 类型
|
|
122
|
+
- 使用 JSDoc 注释说明每个属性
|
|
123
|
+
|
|
124
|
+
```tsx
|
|
125
|
+
export interface ButtonProps {
|
|
126
|
+
/**
|
|
127
|
+
* 按钮类型
|
|
128
|
+
*/
|
|
129
|
+
type?: 'primary' | 'default';
|
|
130
|
+
/**
|
|
131
|
+
* 是否禁用
|
|
132
|
+
*/
|
|
133
|
+
disabled?: boolean;
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
3. **组件导出**
|
|
138
|
+
- 在 `src/index.ts` 中导出组件
|
|
139
|
+
- 同时导出类型定义
|
|
140
|
+
|
|
141
|
+
```tsx
|
|
142
|
+
export { default as Button } from './components/button';
|
|
143
|
+
export type { ButtonProps } from './components/button';
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
4. **样式规范**
|
|
147
|
+
- 使用 Less 编写样式
|
|
148
|
+
- 支持 CSS 变量自定义
|
|
149
|
+
- `style/index.ts` 内容:
|
|
150
|
+
|
|
151
|
+
```ts
|
|
152
|
+
import './index.less';
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Demo 编写规范
|
|
156
|
+
|
|
157
|
+
```tsx
|
|
158
|
+
/**
|
|
159
|
+
* title: 示例标题
|
|
160
|
+
* description: 示例描述
|
|
161
|
+
*/
|
|
162
|
+
export default () => {
|
|
163
|
+
return (
|
|
164
|
+
<div style={{ padding: 16 }}>
|
|
165
|
+
<h5>基础用法</h5>
|
|
166
|
+
<Button>按钮</Button>
|
|
167
|
+
</div>
|
|
168
|
+
);
|
|
169
|
+
};
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## 文档编写
|
|
175
|
+
|
|
176
|
+
### 文档目录
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
docs/components/
|
|
180
|
+
└── button/
|
|
181
|
+
└── index.md # 组件文档
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### 文档模板
|
|
185
|
+
|
|
186
|
+
```markdown
|
|
187
|
+
---
|
|
188
|
+
sidebar: true
|
|
189
|
+
toc: content
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
# Button 按钮
|
|
193
|
+
|
|
194
|
+
组件描述。
|
|
195
|
+
|
|
196
|
+
## 何时使用
|
|
197
|
+
|
|
198
|
+
- 使用场景1
|
|
199
|
+
- 使用场景2
|
|
200
|
+
|
|
201
|
+
## 示例
|
|
202
|
+
|
|
203
|
+
<code src="../../../src/components/button/demos/demo1.tsx"></code>
|
|
204
|
+
|
|
205
|
+
## API
|
|
206
|
+
|
|
207
|
+
### 属性
|
|
208
|
+
|
|
209
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
210
|
+
| --- | --- | --- | --- |
|
|
211
|
+
| `type` | 按钮类型 | `'primary'` \| `'default'` | `'default'` |
|
|
212
|
+
|
|
213
|
+
### CSS 变量
|
|
214
|
+
|
|
215
|
+
| 变量 | 说明 | 默认值 |
|
|
216
|
+
| --- | --- | --- |
|
|
217
|
+
| `--button-color` | 按钮颜色 | `#1890ff` |
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### 添加新组件文档
|
|
221
|
+
|
|
222
|
+
1. 在 `docs/components/` 下创建组件目录和 `index.md`
|
|
223
|
+
2. 在 `.dumirc.ts` 的 `sidebars` 中添加组件导航
|
|
224
|
+
3. 在 `.dumirc.ts` 的 `sidebar` 配置中添加路由映射
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## License
|
|
229
|
+
|
|
230
|
+
MIT
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
function r(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=Array(t);e<t;e++)n[e]=r[e];return n}function t(r){if(Array.isArray(r))return r}function e(r,t,e){return(t=
|
|
1
|
+
function r(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=Array(t);e<t;e++)n[e]=r[e];return n}function t(r){if(Array.isArray(r))return r}function e(t){if(Array.isArray(t))return r(t)}function n(r,t,e,n,o,i,a){try{var u=r[i](a),f=u.value}catch(r){return void e(r)}u.done?t(f):Promise.resolve(f).then(n,o)}function o(r){return function(){var t=this,e=arguments;return new Promise(function(o,i){var a=r.apply(t,e);function u(r){n(a,o,i,u,f,"next",r)}function f(r){n(a,o,i,u,f,"throw",r)}u(void 0)})}}function i(r,t){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=S(r))||t&&r&&"number"==typeof r.length){e&&(r=e);var n=0,o=function(){};return{s:o,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){e=e.call(r)},n:function(){var r=e.next();return a=r.done,r},e:function(r){u=!0,i=r},f:function(){try{a||null==e.return||e.return()}finally{if(u)throw i}}}}function a(r,t,e){return(t=j(t))in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function u(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function f(r,t){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var n,o,i,a,u=[],f=!0,c=!1;try{if(i=(e=e.call(r)).next,0===t){if(Object(e)!==e)return;f=!1}else for(;!(f=(n=i.call(e)).done)&&(u.push(n.value),u.length!==t);f=!0);}catch(r){c=!0,o=r}finally{try{if(!f&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})),e.push.apply(e,n)}return e}function s(r){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?y(Object(e),!0).forEach(function(t){a(r,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):y(Object(e)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))})}return r}function p(r,t){if(null==r)return{};var e,n,o=b(r,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(n=0;n<i.length;n++)e=i[n],-1===t.indexOf(e)&&{}.propertyIsEnumerable.call(r,e)&&(o[e]=r[e])}return o}function b(r,t){if(null==r)return{};var e={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==t.indexOf(n))continue;e[n]=r[n]}return e}function v(){
|
|
2
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
3
|
+
var r,t,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function i(e,n,o,i){var f=n&&n.prototype instanceof u?n:u,c=Object.create(f.prototype);return m(c,"_invoke",function(e,n,o){var i,u,f,c=0,l=o||[],y=!1,s={p:0,n:0,v:r,a:p,f:p.bind(r,4),d:function(t,e){return i=t,u=0,f=r,s.n=e,a}};function p(e,n){for(u=e,f=n,t=0;!y&&c&&!o&&t<l.length;t++){var o,i=l[t],p=s.p,b=i[2];e>3?(o=b===n)&&(f=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=r):i[0]<=p&&((o=e<2&&p<i[1])?(u=0,s.v=n,s.n=i[1]):p<b&&(o=e<3||i[0]>n||n>b)&&(i[4]=e,i[5]=n,s.n=b,u=0))}if(o||e>1)return a;throw y=!0,n}return function(o,l,b){if(c>1)throw TypeError("Generator is already running");for(y&&1===l&&p(l,b),u=l,f=b;(t=u<2?r:f)||!y;){i||(u?u<3?(u>1&&(s.n=-1),p(u,f)):s.n=f:s.v=f);try{if(c=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,f)))throw TypeError("iterator result is not an object");if(!t.done)return t;f=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(f=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=r}else if((t=(y=s.n<0)?f:e.call(n,s))!==a)break}catch(t){i=r,u=1,f=t}finally{c=1}}return{value:t,done:y}}}(e,o,i),!0),c}var a={};function u(){}function f(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(m(t={},n,function(){return this}),t),y=c.prototype=u.prototype=Object.create(l);function s(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,c):(r.__proto__=c,m(r,o,"GeneratorFunction")),r.prototype=Object.create(y),r}return f.prototype=c,m(y,"constructor",c),m(c,"constructor",f),f.displayName="GeneratorFunction",m(c,o,"GeneratorFunction"),m(y),m(y,o,"Generator"),m(y,n,function(){return this}),m(y,"toString",function(){return"[object Generator]"}),(v=function(){return{w:i,m:s}})()}function m(r,t,e,n){var o=Object.defineProperty;try{o({},"",{})}catch(r){o=0}m=function(r,t,e,n){function i(t,e){m(r,t,function(r){return this._invoke(t,e,r)})}t?o?o(r,t,{value:e,enumerable:!n,configurable:!n,writable:!n}):r[t]=e:(i("next",0),i("throw",1),i("return",2))},m(r,t,e,n)}function d(r){if(null!=r){var t=r["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],e=0;if(t)return t.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length))return{next:function(){return r&&e>=r.length&&(r=void 0),{value:r&&r[e++],done:!r}}}}throw new TypeError(typeof r+" is not iterable")}function h(r,e){return t(r)||f(r,e)||S(r,e)||c()}function O(r){return e(r)||u(r)||S(r)||l()}function g(r,t){if("object"!=typeof r||!r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var n=e.call(r,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}function j(r){var t=g(r,"string");return"symbol"==typeof t?t:t+""}function w(r){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},w(r)}function S(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}export{r as arrayLikeToArray,t as arrayWithHoles,e as arrayWithoutHoles,o as asyncToGenerator,i as createForOfIteratorHelper,a as defineProperty,u as iterableToArray,f as iterableToArrayLimit,c as nonIterableRest,l as nonIterableSpread,s as objectSpread2,p as objectWithoutProperties,b as objectWithoutPropertiesLoose,v as regenerator,m as regeneratorDefine,d as regeneratorValues,h as slicedToArray,O as toConsumableArray,g as toPrimitive,j as toPropertyKey,w as typeof,S as unsupportedIterableToArray};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewProps, ImageProps } from '@tarojs/components';
|
|
3
|
+
export interface AvatarProps extends ViewProps {
|
|
4
|
+
/**
|
|
5
|
+
* 头像路径
|
|
6
|
+
*/
|
|
7
|
+
src: string;
|
|
8
|
+
/**
|
|
9
|
+
* 大小规格
|
|
10
|
+
*/
|
|
11
|
+
size?: 'default' | 'middle';
|
|
12
|
+
/**
|
|
13
|
+
* 头像图片属性
|
|
14
|
+
*/
|
|
15
|
+
avatarImageProps?: ImageProps;
|
|
16
|
+
}
|
|
17
|
+
declare const Avatar: React.FC<AvatarProps>;
|
|
18
|
+
export default Avatar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{objectWithoutProperties as a,objectSpread2 as r}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as e}from"react/jsx-runtime";import s from"classnames";import{View as t,Image as o}from"@tarojs/components";var i=["src","size","className","avatarImageProps"],m=function(m){var c=m.src,l=m.size,p=void 0===l?"default":l,n=m.className,u=m.avatarImageProps,v=a(m,i);return e(t,r(r({className:s("ypmini-avatar","ypmini-avatar-".concat(p),n)},v),{},{children:e(o,r(r({mode:"aspectFill",className:"ypmini-avatar-image"},u||{}),{},{src:c}))}))};export{m as default};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
page,
|
|
2
|
+
:root {
|
|
3
|
+
--ypmini-avatar-size-default: calc(24px * var(--ypmini-hd));
|
|
4
|
+
--ypmini-avatar-size-middle: calc(48px * var(--ypmini-hd));
|
|
5
|
+
--ypmini-avatar-border-radius: 100%;
|
|
6
|
+
}
|
|
7
|
+
.ypmini-avatar {
|
|
8
|
+
--size: var(--ypmini-avatar-size-default);
|
|
9
|
+
--border-radius: var(--ypmini-avatar-border-radius);
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
width: var(--size);
|
|
15
|
+
height: var(--size);
|
|
16
|
+
border-radius: var(--border-radius);
|
|
17
|
+
}
|
|
18
|
+
.ypmini-avatar-default {
|
|
19
|
+
--size: var(--ypmini-avatar-size-default);
|
|
20
|
+
}
|
|
21
|
+
.ypmini-avatar-middle {
|
|
22
|
+
--size: var(--ypmini-avatar-size-middle);
|
|
23
|
+
}
|
|
24
|
+
.ypmini-avatar-image {
|
|
25
|
+
object-fit: cover;
|
|
26
|
+
height: 100%;
|
|
27
|
+
width: 100%;
|
|
28
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ButtonProps as TaroButtonProps } from '@tarojs/components';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export interface ButtonProps extends Omit<TaroButtonProps, 'type'> {
|
|
3
|
+
export interface ButtonProps extends Omit<TaroButtonProps, 'type' | 'size'> {
|
|
4
4
|
/**
|
|
5
|
-
* 按钮样式类型 primary 主题色样式按钮 default 默认样式 secondary
|
|
5
|
+
* 按钮样式类型 主要是颜色控制 primary 主题色样式按钮 default 默认样式 secondary 次级主题色样式 warning 强调警告的颜色(红色背景)
|
|
6
6
|
*/
|
|
7
|
-
styleType?: 'primary' | 'default' | 'secondary';
|
|
7
|
+
styleType?: 'primary' | 'default' | 'secondary' | "warning";
|
|
8
8
|
/**
|
|
9
9
|
* 是否启用禁用样式(启用禁用样式按钮依然可以点击和disabled有区别 只是样式支持),如果想要按钮有禁用样式 但是依然可点击可以用这个属性
|
|
10
10
|
*/
|
|
@@ -17,6 +17,22 @@ export interface ButtonProps extends Omit<TaroButtonProps, 'type'> {
|
|
|
17
17
|
* icon的支持
|
|
18
18
|
*/
|
|
19
19
|
icon?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* 形状控制 default 默认形状,round 大圆角
|
|
22
|
+
*/
|
|
23
|
+
shape?: "default" | "round";
|
|
24
|
+
/**
|
|
25
|
+
* 按钮大小规格 主要是高度控制
|
|
26
|
+
*/
|
|
27
|
+
size?: "default" | "middle" | "small" | "large";
|
|
28
|
+
/**
|
|
29
|
+
* 填充样式 todo solid 背景完全填充的样式,outlined 有外边框,无背景的样式
|
|
30
|
+
*/
|
|
31
|
+
variant?: "outlined" | 'solid';
|
|
32
|
+
/**
|
|
33
|
+
* 幽灵按钮 背景透明的按钮
|
|
34
|
+
*/
|
|
35
|
+
ghost?: boolean;
|
|
20
36
|
}
|
|
21
37
|
declare const Button: React.FC<ButtonProps>;
|
|
22
38
|
export default Button;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{objectWithoutProperties as t,objectSpread2 as
|
|
1
|
+
import{objectWithoutProperties as t,objectSpread2 as i}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{Button as n,Text as e}from"@tarojs/components";import r from"classnames";var l=["children","styleType","className","block","disabled","disabledStyle","icon","ghost","shape","size","variant"],s=function(s){var d=s.children,m=s.styleType,u=void 0===m?"default":m,p=s.className,b=s.block,y=void 0===b||b,c=s.disabled,f=s.disabledStyle,h=s.icon,g=s.ghost,v=s.shape,z=void 0===v?"default":v,N=s.size,j=void 0===N?"default":N,w=s.variant,k=void 0===w?"solid":w,S=t(s,l);return a(n,i(i({className:r("ypmini-taro-button",{"ypmini-taro-button-ghost":g,"ypmini-taro-button-outlined":"outlined"===k,"ypmini-taro-button-solid":"solid"===k,"ypmini-taro-button-size-default":"default"===j,"ypmini-taro-button-size-large":"large"===j,"ypmini-taro-button-size-small":"small"===j,"ypmini-taro-button-size-middle":"middle"===j,"ypmini-taro-button-shape-default":"default"===z,"ypmini-taro-button-shape-round":"round"===z,"ypmini-taro-button-primary":"primary"===u,"ypmini-taro-button-primary-disabled":"primary"===u&&(c||f),"ypmini-taro-button-secondary":"secondary"===u,"ypmini-taro-button-secondary-disabled":"secondary"===u&&(c||f),"ypmini-taro-button-default":"default"===u,"ypmini-taro-button-warning":"warning"===u,"ypmini-taro-button-warning-disabled":"warning"===u&&(c||f),"ypmini-taro-button-default-disabled":"default"===u&&(c||f),"ypmini-taro-button-block":y},p),disabled:c},S),{},{children:h?o(e,{className:"ypmini-taro-button-icon-wrapper",children:[a(e,{className:"ypmini-taro-button-icon",children:h}),a(e,{className:"ypmini-taro-button-icon-content",children:d})]}):d}))};export{s as default};
|
|
@@ -1,84 +1,154 @@
|
|
|
1
1
|
:root,
|
|
2
2
|
page {
|
|
3
|
-
--ypmini-
|
|
4
|
-
--
|
|
5
|
-
--
|
|
6
|
-
--
|
|
7
|
-
--
|
|
8
|
-
--
|
|
9
|
-
--
|
|
10
|
-
--
|
|
11
|
-
--
|
|
12
|
-
--
|
|
13
|
-
--
|
|
14
|
-
--
|
|
15
|
-
--
|
|
16
|
-
--
|
|
17
|
-
--
|
|
18
|
-
--
|
|
19
|
-
--
|
|
20
|
-
--
|
|
21
|
-
--
|
|
22
|
-
|
|
23
|
-
:
|
|
24
|
-
|
|
25
|
-
--
|
|
26
|
-
--button-
|
|
27
|
-
--
|
|
28
|
-
--default-button-
|
|
29
|
-
--primary-button-background: var(--yp-color-primary);
|
|
30
|
-
--primary-button-disabled-background: #99d3ff;
|
|
31
|
-
--primary-button-disabled-text-color: rgba(255, 255, 255, 0.45);
|
|
32
|
-
--primary-button-text-color: #fff;
|
|
33
|
-
--secondary-button-background: #00cbff;
|
|
34
|
-
--secondary-button-text-color: #ffffff;
|
|
3
|
+
--ypmini-border-radius: calc(8px * var(--ypmini-hd));
|
|
4
|
+
--ypmini-button-height-large: calc(48px * var(--ypmini-hd));
|
|
5
|
+
--ypmini-button-height-default: calc(44px * var(--ypmini-hd));
|
|
6
|
+
--ypmini-button-height-middle: calc(40px * var(--ypmini-hd));
|
|
7
|
+
--ypmini-button-height-small: calc(32px * var(--ypmini-hd));
|
|
8
|
+
--ypmini-button-font-size-samll: calc(14px * var(--ypmini-hd));
|
|
9
|
+
--ypmini-button-font-size-moddle: calc(15px * var(--ypmini-hd));
|
|
10
|
+
--ypmini-button-font-size-default: calc(17px * var(--ypmini-hd));
|
|
11
|
+
--ypmini-button-font-size-large: calc(17px * var(--ypmini-hd));
|
|
12
|
+
--ypmini-default-button-background: #f5f7fc;
|
|
13
|
+
--ypmini-default-button-text-color: rgba(0, 0, 0, 0.65);
|
|
14
|
+
--ypmini-default-button-ghost-color: rgba(0, 0, 0, 0.65);
|
|
15
|
+
--ypmini-primary-button-background: var(--ypmini-primary-color);
|
|
16
|
+
--ypmini-primary-button-ghost-color: var(--ypmini-primary-color);
|
|
17
|
+
--ypmini-primary-button-disabled-background: #99d3ff;
|
|
18
|
+
--ypmini-primary-button-disabled-text-color: rgba(255, 255, 255, 0.45);
|
|
19
|
+
--ypmini-primary-button-text-color: #fff;
|
|
20
|
+
--ypmini-secondary-button-background: #00cbff;
|
|
21
|
+
--ypmini-secondary-button-text-color: #ffffff;
|
|
22
|
+
--ypmini-secondary-button-ghost-color: #00cbff;
|
|
23
|
+
--ypmini-warning-button-background: #FF5A57;
|
|
24
|
+
--ypmini-warning-button-text-color: #ffffff;
|
|
25
|
+
--ypmini-warning-button-ghost-color: #FF5A57;
|
|
26
|
+
--ypmini-warning-button-outlined-color: #E8362E;
|
|
27
|
+
--ypmini-primary-button-outlined-color: var(--ypmini-primary-color);
|
|
28
|
+
--ypmini-default-button-outlined-color: rgba(0, 0, 0, 0.65);
|
|
35
29
|
}
|
|
36
30
|
.ypmini-taro-button {
|
|
37
|
-
padding: 0
|
|
31
|
+
padding: 0 24px;
|
|
38
32
|
border: unset;
|
|
39
33
|
font-weight: bold;
|
|
40
|
-
font-size:
|
|
34
|
+
font-size: var(--ypmini-button-font-size-default);
|
|
41
35
|
width: auto;
|
|
42
|
-
height: var(--button-height);
|
|
43
|
-
line-height: var(--button-height);
|
|
44
|
-
color: var(--
|
|
45
|
-
border-radius: var(--border-radius);
|
|
36
|
+
height: var(--ypmini-button-height-default);
|
|
37
|
+
line-height: var(--ypmini-button-height-default);
|
|
38
|
+
color: var(--ypmini-color-text);
|
|
39
|
+
border-radius: var(--ypmini-border-radius);
|
|
46
40
|
display: inline-block;
|
|
47
41
|
white-space: nowrap;
|
|
48
42
|
}
|
|
49
43
|
.ypmini-taro-button:after {
|
|
50
44
|
display: none;
|
|
51
45
|
}
|
|
46
|
+
.ypmini-taro-button-shape-default {
|
|
47
|
+
padding: 0 24px;
|
|
48
|
+
}
|
|
49
|
+
.ypmini-taro-button-shape-round {
|
|
50
|
+
padding: 0px 24px;
|
|
51
|
+
border-radius: 1998px;
|
|
52
|
+
}
|
|
53
|
+
.ypmini-taro-button-size-large {
|
|
54
|
+
height: var(--ypmini-button-height-large);
|
|
55
|
+
line-height: var(--ypmini-button-height-large);
|
|
56
|
+
font-weight: bold;
|
|
57
|
+
font-size: var(--ypmini-button-font-size-large);
|
|
58
|
+
}
|
|
59
|
+
.ypmini-taro-button-size-middle {
|
|
60
|
+
font-weight: 400;
|
|
61
|
+
font-size: var(--ypmini-button-font-size-middle);
|
|
62
|
+
height: var(--ypmini-button-height-middle);
|
|
63
|
+
line-height: var(--ypmini-button-height-middle);
|
|
64
|
+
}
|
|
65
|
+
.ypmini-taro-button-size-default {
|
|
66
|
+
height: var(--ypmini-button-height-default);
|
|
67
|
+
line-height: var(--ypmini-button-height-default);
|
|
68
|
+
}
|
|
69
|
+
.ypmini-taro-button-size-small {
|
|
70
|
+
font-weight: 400;
|
|
71
|
+
font-size: var(--ypmini-button-font-size-middle);
|
|
72
|
+
height: var(--ypmini-button-height-small);
|
|
73
|
+
line-height: var(--ypmini-button-height-small);
|
|
74
|
+
}
|
|
75
|
+
.ypmini-taro-button-warning {
|
|
76
|
+
background: var(--ypmini-warning-button-background);
|
|
77
|
+
color: var(--ypmini-warning-button-text-color);
|
|
78
|
+
}
|
|
79
|
+
.ypmini-taro-button-warning.ypmini-taro-button-warning-disabled {
|
|
80
|
+
opacity: 0.6;
|
|
81
|
+
}
|
|
82
|
+
.ypmini-taro-button-warning.ypmini-taro-button-warning-disabled.ypmini-taro-button-warning.ypmini-taro-button-warning-disabled[disabled] {
|
|
83
|
+
color: var(--ypmini-warning-button-text-color);
|
|
84
|
+
}
|
|
85
|
+
.ypmini-taro-button-warning.ypmini-taro-button-outlined {
|
|
86
|
+
border: 2px solid var(--ypmini-warning-button-outlined-color);
|
|
87
|
+
color: var(--ypmini-warning-button-outlined-color);
|
|
88
|
+
background: transparent;
|
|
89
|
+
}
|
|
90
|
+
.ypmini-taro-button-warning.ypmini-taro-button-ghost {
|
|
91
|
+
background: transparent;
|
|
92
|
+
color: var(--ypmini-warning-button-ghost-color);
|
|
93
|
+
}
|
|
52
94
|
.ypmini-taro-button-primary {
|
|
53
|
-
background: var(--primary-button-background);
|
|
54
|
-
color: var(--primary-button-text-color);
|
|
95
|
+
background: var(--ypmini-primary-button-background);
|
|
96
|
+
color: var(--ypmini-primary-button-text-color);
|
|
55
97
|
}
|
|
56
98
|
.ypmini-taro-button-primary.ypmini-taro-button-primary-disabled {
|
|
57
|
-
color: var(--primary-button-disabled-text-color);
|
|
58
|
-
background: var(--primary-button-disabled-background);
|
|
99
|
+
color: var(--ypmini-primary-button-disabled-text-color);
|
|
100
|
+
background: var(--ypmini-primary-button-disabled-background);
|
|
101
|
+
}
|
|
102
|
+
.ypmini-taro-button-primary.ypmini-taro-button-outlined {
|
|
103
|
+
border: 2px solid var(--ypmini-primary-button-outlined-color);
|
|
104
|
+
color: var(--ypmini-primary-button-outlined-color);
|
|
105
|
+
background: transparent;
|
|
106
|
+
}
|
|
107
|
+
.ypmini-taro-button-primary.ypmini-taro-button-ghost {
|
|
108
|
+
background: transparent;
|
|
109
|
+
color: var(--ypmini-primary-button-ghost-color);
|
|
59
110
|
}
|
|
60
111
|
.ypmini-taro-button-default {
|
|
61
|
-
background: var(--default-button-background);
|
|
62
|
-
color: var(--default-button-text-color);
|
|
112
|
+
background: var(--ypmini-default-button-background);
|
|
113
|
+
color: var(--ypmini-default-button-text-color);
|
|
63
114
|
}
|
|
64
115
|
.ypmini-taro-button-default.ypmini-taro-button-default-disabled {
|
|
65
116
|
opacity: 0.6;
|
|
66
117
|
}
|
|
67
118
|
.ypmini-taro-button-default.ypmini-taro-button-default-disabled.ypmini-taro-button-default.ypmini-taro-button-default-disabled[disabled] {
|
|
68
|
-
color: var(--default-button-text-color);
|
|
119
|
+
color: var(--ypmini-default-button-text-color);
|
|
120
|
+
}
|
|
121
|
+
.ypmini-taro-button-default.ypmini-taro-button-outlined {
|
|
122
|
+
border: 2px solid var(--ypmini-default-button-outlined-color);
|
|
123
|
+
color: var(--ypmini-default-button-outlined-color);
|
|
124
|
+
background: transparent;
|
|
125
|
+
}
|
|
126
|
+
.ypmini-taro-button-default.ypmini-taro-button-ghost {
|
|
127
|
+
background: transparent;
|
|
128
|
+
color: var(--ypmini-default-button-ghost-color);
|
|
69
129
|
}
|
|
70
130
|
.ypmini-taro-button-secondary {
|
|
71
|
-
background: var(--secondary-button-background);
|
|
72
|
-
color: var(--secondary-button-text-color);
|
|
131
|
+
background: var(--ypmini-secondary-button-background);
|
|
132
|
+
color: var(--ypmini-secondary-button-text-color);
|
|
73
133
|
}
|
|
74
134
|
.ypmini-taro-button-secondary.ypmini-taro-button-secondary-disabled {
|
|
75
135
|
opacity: 0.6;
|
|
76
136
|
}
|
|
77
137
|
.ypmini-taro-button-secondary.ypmini-taro-button-secondary-disabled.ypmini-taro-button-secondary.ypmini-taro-button-secondary-disabled[disabled] {
|
|
78
|
-
color: var(--secondary-button-text-color);
|
|
138
|
+
color: var(--ypmini-secondary-button-text-color);
|
|
139
|
+
}
|
|
140
|
+
.ypmini-taro-button-secondary.ypmini-taro-button-outlined {
|
|
141
|
+
border: 2px solid var(--ypmini-secondary-button-background);
|
|
142
|
+
color: var(--ypmini-secondary-button-background);
|
|
143
|
+
background: transparent;
|
|
144
|
+
}
|
|
145
|
+
.ypmini-taro-button-secondary.ypmini-taro-button-ghost {
|
|
146
|
+
background: transparent;
|
|
147
|
+
color: var(--ypmini-secondary-button-ghost-color);
|
|
79
148
|
}
|
|
80
149
|
.ypmini-taro-button-block {
|
|
81
150
|
display: block;
|
|
151
|
+
width: 100%;
|
|
82
152
|
}
|
|
83
153
|
.ypmini-taro-button-icon-wrapper {
|
|
84
154
|
display: flex;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CheckboxGroupProps as YpCheckboxGroupProps } from '@yup/taro-checkbox/dist/types/type';
|
|
3
|
-
export interface CheckboxGroupProps extends YpCheckboxGroupProps {
|
|
2
|
+
import { CheckboxGroupProps as YpCheckboxGroupProps, ValueType } from '@yup/taro-checkbox/dist/types/type';
|
|
3
|
+
export interface CheckboxGroupProps extends Omit<YpCheckboxGroupProps, 'onChange'> {
|
|
4
4
|
/**
|
|
5
5
|
* 多选类型
|
|
6
6
|
*/
|
|
7
7
|
type?: 'button' | 'default';
|
|
8
|
+
/**
|
|
9
|
+
* change事件
|
|
10
|
+
*/
|
|
11
|
+
onChange?: (value: ValueType) => void;
|
|
8
12
|
}
|
|
9
13
|
declare const CheckboxGroup: React.FC<CheckboxGroupProps>;
|
|
10
14
|
export default CheckboxGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{objectWithoutProperties as o,objectSpread2 as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{
|
|
1
|
+
import{objectWithoutProperties as o,objectSpread2 as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as r}from"react/jsx-runtime";import t from"classnames";import n from"../../node_modules/@yup/taro-checkbox/dist/index.js";var p=["type","block","onChange"],a=function(a){var i=a.type,c=a.block,u=a.onChange,m=o(a,p);return r(n.Group,e({onChange:u,className:t("ypmini-checkbox-group",{"ypmini-checkbox-group-button":"button"===i,"ypmini-checkbox-group-block":c})},m))};export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{objectWithoutProperties as o,objectSpread2 as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{
|
|
1
|
+
import{objectWithoutProperties as o,objectSpread2 as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as r}from"react/jsx-runtime";import t from"classnames";import{View as c}from"@tarojs/components";import i from"../../node_modules/@yup/taro-checkbox/dist/index.js";import n from"./checkbox-group.js";var s=["className","children","type"],m=function(n){var m=n.className,a=n.children,p=n.type,u=void 0===p?"button":p,l=o(n,s);return r(i,e({className:t("ypmini-checkbox",m),icon:function(o){return"button"===u?r(c,{className:t("ypmini-checkbox-button",{"ypmini-checkbox-button-checked":o}),children:a}):a}},l))};m.Group=n;export{m as default};
|
|
@@ -1,34 +1,12 @@
|
|
|
1
1
|
:root,
|
|
2
|
-
page {
|
|
3
|
-
--ypmini-hd: 2;
|
|
4
|
-
--yp-color-primary: #0092ff;
|
|
5
|
-
--yp-color-text: rgba(0, 0, 0, 0.85);
|
|
6
|
-
--yp-color-text-light: #0092ff;
|
|
7
|
-
--yp-color-text-weak: rgba(0, 0, 0, 0.45);
|
|
8
|
-
--yp-border-color: #e9edf3;
|
|
9
|
-
--yp-color-text-primary: #333;
|
|
10
|
-
--yp-color-text-link: var(--yp-color-primary);
|
|
11
|
-
--yp-color-text-secondary: #666;
|
|
12
|
-
--yp-color-text-disabled: #ccc;
|
|
13
|
-
--yp-color-text-placeholder: #999;
|
|
14
|
-
--yp-font-size-default: calc(17px * var(--ypmini-hd));
|
|
15
|
-
--yp-radio-circle-checked-color: var(--yp-color-primary);
|
|
16
|
-
--yp-radio-button-checked-color: var(--yp-color-primary);
|
|
17
|
-
--yp-checkbox-circle-checked-color: var(--yp-color-primary);
|
|
18
|
-
--yp-checkbox-button-checked-color: var(--yp-color-primary);
|
|
19
|
-
--yp-border-radius-base: calc(4px * var(--ypmini-hd));
|
|
20
|
-
--yp-border-radius-button: calc(8px * var(--ypmini-hd));
|
|
21
|
-
--yp-space-horizontal-base: calc(12px * var(--ypmini-hd));
|
|
22
|
-
}
|
|
23
|
-
:root,
|
|
24
2
|
page {
|
|
25
3
|
--checkbox-button-font-size: calc(17px * var(--ypmini-hd));
|
|
26
4
|
--checkbox-button-border-radius: calc(8px * var(--ypmini-hd));
|
|
27
5
|
--checkbox-button-background-color: #f5f7fc;
|
|
28
6
|
--checkbox-button-text-color: #000000d9;
|
|
29
7
|
--checkbox-button-checked-background-color: #e0f3ff;
|
|
30
|
-
--checkbox-button-checked-text-color: var(--
|
|
31
|
-
--checkbox-button-checked-border-color: var(--
|
|
8
|
+
--checkbox-button-checked-text-color: var(--ypmini-primary-color);
|
|
9
|
+
--checkbox-button-checked-border-color: var(--ypmini-primary-color);
|
|
32
10
|
--checkbox-button-height: calc(52px * var(--ypmini-hd));
|
|
33
11
|
}
|
|
34
12
|
.ypmini-checkbox-button {
|