@yup/taro-ui 0.0.7 → 0.1.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 (118) hide show
  1. package/README.md +52 -1
  2. package/es/_virtual/_rollupPluginBabelHelpers.js +1 -1
  3. package/es/components/button/index.d.ts +24 -5
  4. package/es/components/button/index.js +1 -1
  5. package/es/components/button/style/index.css +85 -31
  6. package/es/components/button/style/index.d.ts +1 -0
  7. package/es/components/button/style/index.js +1 -0
  8. package/es/components/checkbox/checkbox-group.d.ts +6 -2
  9. package/es/components/checkbox/checkbox-group.js +1 -1
  10. package/es/components/checkbox/index.d.ts +1 -1
  11. package/es/components/checkbox/index.js +1 -1
  12. package/es/components/checkbox/style/index.css +2 -26
  13. package/es/components/checkbox/style/index.d.ts +1 -0
  14. package/es/components/checkbox/style/index.js +1 -0
  15. package/es/components/date-picker-view/index.d.ts +40 -0
  16. package/es/components/date-picker-view/index.js +1 -0
  17. package/es/components/date-picker-view/style/index.css +3 -0
  18. package/es/components/date-picker-view/style/index.d.ts +2 -0
  19. package/es/components/date-picker-view/style/index.js +2 -0
  20. package/es/components/date-picker-view/util.d.ts +7 -0
  21. package/es/components/date-picker-view/util.js +1 -0
  22. package/es/components/form/form-item.d.ts +1 -1
  23. package/es/components/form/form-item.js +1 -1
  24. package/es/components/form/index.js +1 -1
  25. package/es/components/form/style/index.css +0 -24
  26. package/es/components/form/style/index.d.ts +1 -0
  27. package/es/components/form/style/index.js +1 -0
  28. package/es/components/icon/index.d.ts +12 -0
  29. package/es/components/icon/index.js +1 -0
  30. package/es/components/icon/style/iconfont.css +60 -0
  31. package/es/components/icon/style/iconfont.ttf +0 -0
  32. package/es/components/icon/style/iconfont.woff +0 -0
  33. package/es/components/icon/style/iconfont.woff2 +0 -0
  34. package/es/components/icon/style/index.d.ts +1 -0
  35. package/es/components/icon/style/index.js +1 -0
  36. package/es/components/input/index.d.ts +14 -2
  37. package/es/components/input/index.js +1 -1
  38. package/es/components/input/style/index.css +35 -29
  39. package/es/components/input/style/index.d.ts +2 -0
  40. package/es/components/input/style/index.js +2 -0
  41. package/es/components/input/style/search.css +21 -0
  42. package/es/components/picker-view/index.d.ts +25 -0
  43. package/es/components/picker-view/index.js +1 -0
  44. package/es/components/picker-view/style/index.css +62 -0
  45. package/es/components/picker-view/style/index.d.ts +2 -0
  46. package/es/components/picker-view/style/index.js +2 -0
  47. package/es/components/popup/index.d.ts +62 -0
  48. package/es/components/popup/index.js +1 -0
  49. package/es/components/popup/style/index.css +91 -0
  50. package/es/components/popup/style/index.d.ts +2 -0
  51. package/es/components/popup/style/index.js +2 -0
  52. package/es/components/radio/context.d.ts +5 -0
  53. package/es/components/radio/context.js +1 -0
  54. package/es/components/radio/index.d.ts +1 -1
  55. package/es/components/radio/index.js +1 -1
  56. package/es/components/radio/radio-group.d.ts +1 -1
  57. package/es/components/radio/radio-group.js +1 -1
  58. package/es/components/radio/style/group.css +5 -25
  59. package/es/components/radio/style/index.d.ts +1 -0
  60. package/es/components/radio/style/index.js +1 -0
  61. package/es/components/radio/style/radio.css +13 -28
  62. package/es/components/safe-area/index.d.ts +13 -0
  63. package/es/components/safe-area/index.js +1 -0
  64. package/es/components/safe-area/style/index.css +3 -0
  65. package/es/components/safe-area/style/index.d.ts +2 -0
  66. package/es/components/safe-area/style/index.js +2 -0
  67. package/es/components/safe-area/util.d.ts +5 -0
  68. package/es/components/safe-area/util.js +1 -0
  69. package/es/components/switch/index.d.ts +6 -0
  70. package/es/components/switch/index.js +1 -0
  71. package/es/components/switch/style/index.css +38 -0
  72. package/es/components/switch/style/index.d.ts +2 -0
  73. package/es/components/switch/style/index.js +2 -0
  74. package/es/components/toast/style/index.css +0 -24
  75. package/es/components/toast/style/index.d.ts +1 -0
  76. package/es/components/toast/style/index.js +1 -0
  77. package/es/components/toast/toast.d.ts +9 -0
  78. package/es/components/toast/toast.js +1 -1
  79. package/es/components/toast/withToast.js +1 -1
  80. package/es/global/global.css +18 -0
  81. package/es/global/index.d.ts +2 -1
  82. package/es/global/theme-default.css +18 -0
  83. package/es/global/variables.css +0 -0
  84. package/es/hooks/useRefState.d.ts +7 -0
  85. package/es/hooks/useRefState.js +1 -0
  86. package/es/index.d.ts +6 -1
  87. package/es/index.js +1 -1
  88. package/es/node_modules/@yup/taro-checkbox/dist/_virtual/_rollupPluginBabelHelpers.js +1 -0
  89. package/es/node_modules/@yup/taro-checkbox/dist/checkbox-group.js +1 -0
  90. package/es/node_modules/@yup/taro-checkbox/dist/context.js +1 -0
  91. package/es/node_modules/@yup/taro-checkbox/dist/index.js +1 -0
  92. package/es/node_modules/@yup/taro-form/dist/_virtual/_rollupPluginBabelHelpers.js +3 -0
  93. package/es/node_modules/@yup/taro-form/dist/context.js +1 -0
  94. package/es/node_modules/@yup/taro-form/dist/formItem.js +1 -0
  95. package/es/node_modules/@yup/taro-form/dist/fromStore.js +1 -0
  96. package/es/node_modules/@yup/taro-form/dist/index.js +1 -0
  97. package/es/node_modules/@yup/taro-form/dist/useForm.js +1 -0
  98. package/es/node_modules/@yup/taro-form/dist/useWatch.js +1 -0
  99. package/es/node_modules/@yup/taro-radio/dist/_virtual/_rollupPluginBabelHelpers.js +1 -0
  100. package/es/node_modules/@yup/taro-radio/dist/context.js +1 -0
  101. package/es/node_modules/@yup/taro-radio/dist/index.js +1 -0
  102. package/es/node_modules/@yup/taro-radio/dist/radio-group.js +1 -0
  103. package/es/style/iconfont.ttf +0 -0
  104. package/es/style/iconfont.woff +0 -0
  105. package/es/style/iconfont.woff2 +0 -0
  106. package/es/style/index.css +463 -0
  107. package/package.json +13 -7
  108. package/es/_virtual/_commonjsHelpers.js +0 -1
  109. package/es/_virtual/index.js +0 -1
  110. package/es/_virtual/jsx-runtime.js +0 -1
  111. package/es/_virtual/react-jsx-runtime.development.js +0 -1
  112. package/es/_virtual/react-jsx-runtime.production.min.js +0 -1
  113. package/es/global.css +0 -24
  114. package/es/node_modules/classnames/index.js +0 -1
  115. package/es/node_modules/react/cjs/react-jsx-runtime.development.js +0 -1
  116. package/es/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -10
  117. package/es/node_modules/react/jsx-runtime.js +0 -1
  118. package/es/utils/react.d.ts +0 -2
@@ -10,13 +10,25 @@ export interface InputProps extends TaroInputProps {
10
10
  */
11
11
  clearIcon?: React.ReactNode;
12
12
  /**
13
- * 是否显示字数统计
13
+ * 是否显示尾部字数统计
14
14
  */
15
15
  showCount?: boolean;
16
16
  /**
17
- * 边框样式 outlined 边框 borderless 无边框
17
+ * 边框样式 outlined 边框 borderless 无边框样式
18
18
  */
19
19
  variant?: 'outlined' | 'borderless';
20
+ /**
21
+ * change事件 返回输入值
22
+ */
23
+ onChange?: (val: string) => void;
24
+ /**
25
+ * 输入框的值触发 注意点击删除Icon会触发onChange
26
+ */
27
+ onDelete?: () => void;
28
+ /**
29
+ * 自定义前缀Icon
30
+ */
31
+ prefixIcon?: React.ReactNode;
20
32
  }
21
33
  declare const Input: React.FC<InputProps>;
22
34
  export default Input;
@@ -1 +1 @@
1
- import{objectWithoutProperties as e,slicedToArray as l,objectSpread2 as a}from"../../_virtual/_rollupPluginBabelHelpers.js";import{j as t}from"../../node_modules/react/jsx-runtime.js";import n from"react";import o from"../../node_modules/classnames/index.js";import{View as r,Input as s,Text as i}from"@tarojs/components";var u=["variant","allowClear","showCount","clearIcon","className","style","onClick","onInput","maxlength","placeholderStyle","defaultValue"],c=function(c){c.variant,c.allowClear;var p=c.showCount;c.clearIcon;var m=c.className,d=c.style,h=c.onClick,j=c.onInput,x=c.maxlength;c.placeholderStyle;var f=c.defaultValue,y=e(c,u),v=n.useState(f||""),g=l(v,2),C=g[0],N=g[1];return n.useEffect(function(){"value"in y&&N(y.value||"")},[y]),t.jsxs(r,{className:o("ypmini-taro-input-wrapper",m),style:d,onClick:h,children:[t.jsx(s,a({placeholderStyle:"font-size: 17px;color: #00000040;",placeholderTextColor:"#00000040",value:C,onInput:function(e){N(e.detail.value),j&&j(e)},maxlength:x,className:"ypmini-taro-input"},y)),t.jsx(r,{className:"ypmini-taro-input-clear"}),p?t.jsxs(r,{className:"ypmini-taro-input-count",children:[t.jsx(i,{className:o("ypmini-taro-input-count-current",{"ypmini-taro-input-count-current-light":(null==C?void 0:C.length)>0}),children:null==C?void 0:C.length}),x?t.jsxs(t.Fragment,{children:["/",t.jsx(i,{className:"ypmini-taro-input-count-total",children:x||0})]}):null]}):null]})};export{c as default};
1
+ import{objectWithoutProperties as e,slicedToArray as n,objectSpread2 as l}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as a,jsx as t,Fragment as o}from"react/jsx-runtime";import i from"react";import r from"classnames";import{View as u,Input as c,Text as s}from"@tarojs/components";import p from"../icon/index.js";var m=["variant","allowClear","showCount","clearIcon","className","style","onClick","onInput","maxlength","defaultValue","onChange","onDelete","prefixIcon"],d=function(d){var f=d.variant,h=void 0===f?"outlined":f,v=d.allowClear,y=void 0===v||v,x=d.showCount;d.clearIcon;var C=d.className,g=d.style,N=d.onClick,I=d.onInput,w=d.maxlength,j=d.defaultValue,b=d.onChange,k=d.onDelete,S=d.prefixIcon,D=e(d,m),P=i.useState(j||""),T=n(P,2),V=T[0],_=T[1],z=i.useRef(null);return i.useEffect(function(){"value"in D&&_(D.value||"")},[D]),a(u,{className:r("ypmini-taro-input-wrapper",{"ypmini-taro-input-borderless-wrapper":"borderless"===h},C),style:g,onClick:N,children:[S?t(u,{className:"ypmini-taro-input-prefix-icon-wrapper",children:S}):null,t(c,l({ref:z,placeholderStyle:"font-size: 17px;color: #00000040;",placeholderTextColor:"#00000040",value:V,onInput:function(e){_(e.detail.value),I&&I(e),b&&b(e.detail.value)},maxlength:w,className:"ypmini-taro-input"},D)),y&&null!=V&&V.length?t(u,{className:"ypmini-taro-input-clear",onClick:function(){_(""),k&&k(),b&&b("")},children:t(p,{className:"ypmini-taro-input-clear-icon",name:"delete-fill"})}):null,x?a(u,{className:"ypmini-taro-input-count",children:[t(s,{className:r("ypmini-taro-input-count-current",{"ypmini-taro-input-count-current-light":(null==V?void 0:V.length)>0}),children:null==V?void 0:V.length}),w?a(o,{children:["/",t(s,{className:"ypmini-taro-input-count-total",children:w||0})]}):null]}):null]})};export{d as default};
@@ -1,55 +1,61 @@
1
1
  :root,
2
- page {
3
- --ypmini-hd: 2;
4
- }
5
- :root,
6
- page {
7
- --yp-color-primary: #0092ff;
8
- --yp-color-text: rgba(0, 0, 0, 0.85);
9
- --yp-color-text-light: #0092ff;
10
- --yp-color-text-weak: rgba(0, 0, 0, 0.45);
11
- --yp-border-color: #e9edf3;
12
- --yp-color-text-primary: #333;
13
- --yp-color-text-link: var(--yp-color-primary);
14
- --yp-color-text-secondary: #666;
15
- --yp-color-text-disabled: #ccc;
16
- --yp-color-text-placeholder: #999;
17
- --yp-font-size-default: calc(17px * var(--ypmini-hd));
18
- --yp-radio-circle-checked-color: var(--yp-color-primary);
19
- --yp-radio-button-checked-color: var(--yp-color-primary);
20
- --yp-checkbox-circle-checked-color: var(--yp-color-primary);
21
- --yp-checkbox-button-checked-color: var(--yp-color-primary);
22
- --yp-border-radius-base: calc(4px * var(--ypmini-hd));
23
- --yp-space-horizontal-base: calc(12px * var(--ypmini-hd));
24
- }
25
- :root,
26
2
  page {
27
3
  --input-placeholder-color: rgba(0, 0, 0, 0.25);
28
- --input-text-color: var(--yp-color-text);
29
- --input-font-size: var(--yp-font-size-default);
4
+ --input-text-color: var(--ypmini-color-text);
5
+ --input-font-size: var(--ypmini-font-size-default);
6
+ --input-delete-cion-color: #00000040;
7
+ --input-delete-cion-size: calc(var(--ypmini-hd) * 16px);
8
+ --input-height: calc(48px * var(--ypmini-hd));
9
+ --input-prefix-icon-size: calc(16px * var(--ypmini-hd));
10
+ --input-border-color: var(--ypmini-border-color);
11
+ --input-prefix-icon-color: #000000a6;
30
12
  }
31
13
  .ypmini-taro-input-wrapper {
32
14
  display: flex;
15
+ align-items: center;
16
+ height: var(--input-height);
33
17
  font-size: var(--input-font-size);
34
- padding: 32px 24px;
18
+ padding: 0px 24px;
35
19
  border-radius: 16px;
36
- border: 2px solid #e9edf3;
20
+ border: 2px solid var(--input-border-color);
37
21
  box-sizing: border-box;
38
22
  }
23
+ .ypmini-taro-input-borderless-wrapper {
24
+ border: unset;
25
+ }
39
26
  .ypmini-taro-input {
40
27
  color: var(--input-text-color);
41
28
  flex: 1;
42
29
  border: none;
43
30
  }
31
+ .ypmini-taro-input input::placeholder {
32
+ color: var(--input-placeholder-color);
33
+ }
44
34
  .ypmini-input-placeholder {
45
35
  color: var(--input-placeholder-color);
46
36
  }
37
+ .ypmini-taro-input-clear {
38
+ display: flex;
39
+ align-items: center;
40
+ }
41
+ .ypmini-taro-input-clear-icon {
42
+ color: var(--input-delete-cion-color);
43
+ font-size: var(--input-delete-cion-size);
44
+ }
47
45
  .ypmini-taro-input-count {
48
46
  color: rgba(0, 0, 0, 0.45);
49
47
  font-size: 30px;
50
48
  display: flex;
51
49
  align-items: center;
50
+ margin-left: 8px;
52
51
  }
53
52
  .ypmini-taro-input-count .ypmini-taro-input-count-current-light {
54
- color: var(--yp-color-text-light);
53
+ color: var(--ypmini-color-text-light);
54
+ }
55
+ .ypmini-taro-input-prefix-icon-wrapper {
56
+ display: flex;
57
+ align-items: center;
58
+ font-size: var(--input-prefix-icon-size);
59
+ margin-right: 16px;
60
+ color: var(--input-prefix-icon-color);
55
61
  }
@@ -1 +1,3 @@
1
+ import '../../../global/theme-default.less';
1
2
  import './index.less';
3
+ import './search.less';
@@ -1 +1,3 @@
1
+ import '../../../global/theme-default.css';
1
2
  import './index.css';
3
+ import './search.css';
@@ -0,0 +1,21 @@
1
+ :root,
2
+ page {
3
+ --search-input-backgroud: hsl(223, 54%, 97%);
4
+ --search-input-height: calc(var(--ypmini-hd) * 48px);
5
+ --search-input-font-size: calc(var(--ypmini-hd) * 15px);
6
+ }
7
+ .ypmini-search-input-wrapper {
8
+ padding: 0px 24px;
9
+ border-radius: 16px;
10
+ height: var(--search-input-height);
11
+ display: inline-flex;
12
+ align-items: center;
13
+ font-size: var(--search-input-font-size);
14
+ background: var(--search-input-backgroud);
15
+ }
16
+ .ypmini-search-input {
17
+ font-size: var(--input-font-size);
18
+ }
19
+ .ypmini-search-input-icon {
20
+ font-size: 32px;
21
+ }
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { PickerViewProps as TaroPickerViewProps } from '@tarojs/components';
3
+ export interface ColumnType {
4
+ label?: React.ReactNode;
5
+ value: string;
6
+ }
7
+ export interface PickerViewProps extends Omit<TaroPickerViewProps, 'children'> {
8
+ /**
9
+ * picker-view列配置数据
10
+ */
11
+ columns: ColumnType[][];
12
+ /**
13
+ * 是否禁用
14
+ */
15
+ disabled?: boolean;
16
+ /**
17
+ * 自定义选项格式化
18
+ */
19
+ cellRender?: (item: ColumnType, option: {
20
+ colIndex: number;
21
+ originNode: React.ReactNode;
22
+ }) => React.ReactNode;
23
+ }
24
+ declare const PickerView: React.FC<PickerViewProps>;
25
+ export default PickerView;
@@ -0,0 +1 @@
1
+ import{objectWithoutProperties as i,objectSpread2 as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as r,jsx as a}from"react/jsx-runtime";import l from"classnames";import{View as n,PickerView as c,PickerViewColumn as s}from"@tarojs/components";var o=["columns","className","indicatorClass","cellRender","disabled"],m=function(m){var t=m.columns,p=m.className,u=m.indicatorClass,d=m.cellRender,v=m.disabled,f=i(m,o);return r(n,{className:l("ypmini-picker-view-wrapper",p),children:[v?a(n,{className:"ypmini-picker-view-mask"}):null,a(c,e(e({className:l("ypmini-picker-view"),indicatorClass:l("ypmini-picker-view-indicator",u)},f),{},{children:null==t?void 0:t.map(function(i,e){return a(s,{className:"ypmini-picker-view-column",children:null==i?void 0:i.map(function(i){return function(i,e){var r=a(n,{className:"ypmini-picker-view-column-item",children:i.label},i.value);return d?d(i,{colIndex:e,originNode:r}):r}(i,e)})},e)})}))]})};export{m as default};
@@ -0,0 +1,62 @@
1
+ :root,
2
+ page {
3
+ --ypmini-picker-view-column-font-size: var(--ypmini-font-size-large);
4
+ --ypmini-picker-view-column-font-color: #00000040;
5
+ --ypmini-picker-view-column-active-fot-color: ##000000a6;
6
+ --ypmini-picker-view-column-active-font-size: var(--ypmini-font-size-max);
7
+ --ypmini-picker-view-column-height: calc(var(--ypmini-hd) * 52px);
8
+ --ypmini-picker-view-indicator-background-color: #f5f7fc;
9
+ --ypmini-picker-view-indicator-border-radius: calc(var(--ypmini-hd) * 8px);
10
+ --ypmini-picker-view-disabled-mask-index: 100;
11
+ --ypmini-picker-view-disabled-mask-background-color: rgba(255, 255, 255, 0.6);
12
+ }
13
+ .ypmini-picker-view-wrapper {
14
+ position: relative;
15
+ height: 100%;
16
+ }
17
+ .ypmini-picker-view {
18
+ height: 100%;
19
+ }
20
+ .ypmini-picker-view-column {
21
+ z-index: 20;
22
+ }
23
+ .ypmini-picker-view-column .ypmini-picker-view-indicator {
24
+ background: var(--ypmini-picker-view-indicator-background-color);
25
+ z-index: 0;
26
+ }
27
+ .ypmini-picker-view-column::first-child .ypmini-picker-view-indicator {
28
+ border-top-left-radius: var(--ypmini-picker-view-indicator-border-radius);
29
+ border-bottom-left-radius: var(--ypmini-picker-view-indicator-border-radius);
30
+ }
31
+ .ypmini-picker-view-column::last-child .ypmini-picker-view-indicator {
32
+ border-top-right-radius: var(--ypmini-picker-view-indicator-border-radius);
33
+ border-bottom-right-radius: var(--ypmini-picker-view-indicator-border-radius);
34
+ }
35
+ .ypmini-picker-view-column-item {
36
+ height: var(--ypmini-picker-view-column-height);
37
+ line-height: var(--ypmini-picker-view-column-height);
38
+ font-size: var(--ypmini-picker-view-column-font-size);
39
+ }
40
+ .ypmini-picker-view-indicator {
41
+ height: var(--ypmini-picker-view-column-height);
42
+ background: var(--ypmini-picker-view-indicator-background-color);
43
+ z-index: 0;
44
+ border-radius: 16px;
45
+ border-bottom: unset;
46
+ border-top: unset;
47
+ }
48
+ .ypmini-picker-view-indicator::before {
49
+ display: none;
50
+ }
51
+ .ypmini-picker-view-indicator::after {
52
+ display: none;
53
+ }
54
+ .ypmini-picker-view-mask {
55
+ position: absolute;
56
+ left: 0;
57
+ right: 0;
58
+ bottom: 0;
59
+ top: 0;
60
+ z-index: var(--ypmini-picker-view-disabled-mask-index);
61
+ background-color: var(--ypmini-picker-view-disabled-mask-background-color);
62
+ }
@@ -0,0 +1,2 @@
1
+ import '../../../global/theme-default.less';
2
+ import './index.less';
@@ -0,0 +1,2 @@
1
+ import '../../../global/theme-default.css';
2
+ import './index.css';
@@ -0,0 +1,62 @@
1
+ import React from 'react';
2
+ import { ViewProps } from '@tarojs/components';
3
+ export interface PopupProps extends Omit<ViewProps, 'children'> {
4
+ /**
5
+ * 是否显示弹出层
6
+ */
7
+ visible?: boolean;
8
+ /**
9
+ * 弹出层内容
10
+ */
11
+ children?: React.ReactNode;
12
+ /**
13
+ * 是否显示遮罩层
14
+ */
15
+ mask?: boolean;
16
+ /**
17
+ * 点击遮罩层是否关闭
18
+ */
19
+ maskClosable?: boolean;
20
+ /**
21
+ * 弹出层圆角
22
+ */
23
+ round?: boolean;
24
+ /**
25
+ * 动画时长,单位毫秒
26
+ */
27
+ duration?: number;
28
+ /**
29
+ * 关闭时触发
30
+ */
31
+ onClose?: () => void;
32
+ /**
33
+ * 动画结束后触发
34
+ */
35
+ afterClose?: () => void;
36
+ /**
37
+ * 点击取消触发
38
+ */
39
+ onCancel?: () => void;
40
+ /**
41
+ * 点击确认后触发
42
+ */
43
+ onConfirm?: () => void;
44
+ /**
45
+ * 标题
46
+ */
47
+ title?: React.ReactNode;
48
+ /**
49
+ * 取消按钮文字
50
+ */
51
+ cancelText?: React.ReactNode;
52
+ /**
53
+ * 确认按钮文字
54
+ */
55
+ confirmText?: React.ReactNode;
56
+ /**
57
+ * 自定义头
58
+ */
59
+ customHeader?: React.ReactNode;
60
+ }
61
+ declare const Popup: React.FC<PopupProps>;
62
+ export default Popup;
@@ -0,0 +1 @@
1
+ import{objectWithoutProperties as i,slicedToArray as e,objectSpread2 as o}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as n,jsx as r}from"react/jsx-runtime";import{useState as a,useEffect as l}from"react";import p from"classnames";import{View as t}from"@tarojs/components";var s=["visible","children","className","mask","maskClosable","round","duration","onClose","afterClose","onCancel","onConfirm","cancelText","confirmText","title","style","customHeader"],c=function(c){var m=c.visible,u=void 0!==m&&m,d=c.children,f=c.className,v=c.mask,y=void 0===v||v,C=c.maskClosable,h=void 0===C||C,b=c.round,k=void 0===b||b,N=c.duration,T=void 0===N?300:N,x=c.onClose,j=c.afterClose,H=c.onCancel,P=c.onConfirm,g=c.cancelText,w=void 0===g?"取消":g,_=c.confirmText,A=void 0===_?"确定":_,B=c.title,S=c.style,W=c.customHeader,q=i(c,s),z=a(!1),D=e(z,2),E=D[0],F=D[1],G=a(!1),I=e(G,2),J=I[0],K=I[1];l(function(){if(u){K(!0);var i=setTimeout(function(){F(!0)},10);return function(){return clearTimeout(i)}}F(!1);var e=setTimeout(function(){K(!1),null==j||j()},T);return function(){return clearTimeout(e)}},[u,T,j]);return J?n(t,o(o({className:p("ypmini-popup-wrapper",{"ypmini-popup-wrapper-visible":E}),style:{"--ypmini-popup-duration":"".concat(T,"ms")}},q),{},{children:[y&&r(t,{className:p("ypmini-popup-mask",{"ypmini-popup-mask-visible":E}),onClick:function(){h&&(null==x||x())}}),n(t,{className:p("ypmini-popup",f,{"ypmini-popup-visible":E,"ypmini-popup-round":k}),style:S,onClick:function(i){i.stopPropagation()},children:[W||n(t,{className:"ypmini-popup-header",children:[r(t,{className:"ypmini-popup-header-cancel",onClick:function(){null==H||H()},children:w}),r(t,{className:"ypmini-popup-header-title",children:B}),r(t,{className:"ypmini-popup-header-confirm",onClick:function(){null==P||P()},children:A})]}),d]})]})):null};export{c as default};
@@ -0,0 +1,91 @@
1
+ :root,
2
+ page {
3
+ --ypmini-popup-background: #fff;
4
+ --ypmini-popup-border-radius: calc(12px * var(--ypmini-hd));
5
+ --ypmini-popup-mask-background: rgba(0, 0, 0, 0.5);
6
+ --ypmini-popup-z-index: 1000;
7
+ --ypmini-popup-duration: 300ms;
8
+ --ypmini-popup-title-font-size: var(--ypmini-font-size-large);
9
+ --ypmini-popup-title-font-color: rgba(0, 0, 0, 0.85);
10
+ --ypmini-popup-confirm-text-font-color: var(--ypmini-primary-color);
11
+ --ypmini-popup-cancel-text-font-color: rgba(0, 0, 0, 0.65);
12
+ --ypmini-popup-confirm-text-font-size: var(--ypmini-font-size-default);
13
+ --ypmini-popup-cancel-text-font-size: var(--ypmini-font-size-default);
14
+ }
15
+ .ypmini-popup-wrapper {
16
+ position: fixed;
17
+ top: 0;
18
+ left: 0;
19
+ right: 0;
20
+ bottom: 0;
21
+ z-index: var(--ypmini-popup-z-index);
22
+ pointer-events: none;
23
+ }
24
+ .ypmini-popup-wrapper-visible {
25
+ pointer-events: auto;
26
+ }
27
+ .ypmini-popup-mask {
28
+ position: absolute;
29
+ top: 0;
30
+ left: 0;
31
+ right: 0;
32
+ bottom: 0;
33
+ background: var(--ypmini-popup-mask-background);
34
+ opacity: 0;
35
+ transition: opacity var(--ypmini-popup-duration) ease;
36
+ }
37
+ .ypmini-popup-mask-visible {
38
+ opacity: 1;
39
+ }
40
+ .ypmini-popup {
41
+ position: absolute;
42
+ left: 0;
43
+ right: 0;
44
+ bottom: 0;
45
+ background: var(--ypmini-popup-background);
46
+ transform: translateY(100%);
47
+ transition: transform var(--ypmini-popup-duration) ease;
48
+ max-height: 80vh;
49
+ overflow-y: auto;
50
+ }
51
+ .ypmini-popup-visible {
52
+ transform: translateY(0);
53
+ }
54
+ .ypmini-popup-round {
55
+ border-radius: var(--ypmini-popup-border-radius) var(--ypmini-popup-border-radius) 0 0;
56
+ }
57
+ .ypmini-popup-header {
58
+ padding: 16px;
59
+ display: flex;
60
+ max-width: 100%;
61
+ align-items: center;
62
+ justify-content: space-between;
63
+ }
64
+ .ypmini-popup-header-cancel {
65
+ color: var(--ypmini-popup-cancel-text-font-color);
66
+ font-weight: 400;
67
+ font-size: var(--ypmini-popup-cancel-text-fontsize);
68
+ flex: 0 0 56px;
69
+ white-space: nowrap;
70
+ text-align: left;
71
+ }
72
+ .ypmini-popup-header-title {
73
+ flex: 1;
74
+ text-align: center;
75
+ color: var(--ypmini-popup-title-font-color);
76
+ font-weight: 500;
77
+ font-size: var(--ypmini-font-size-large);
78
+ margin-left: 44px;
79
+ margin-right: 44px;
80
+ white-space: nowrap;
81
+ overflow: hidden;
82
+ text-overflow: ellipsis;
83
+ }
84
+ .ypmini-popup-header-confirm {
85
+ color: var(--ypmini-popup-confirm-text-font-color);
86
+ font-weight: 400;
87
+ font-size: var(--ypmini-popup-confirm-text-fontsize);
88
+ flex: 0 0 56px;
89
+ white-space: nowrap;
90
+ text-align: right;
91
+ }
@@ -0,0 +1,2 @@
1
+ import '../../../global/theme-default.less';
2
+ import './index.less';
@@ -0,0 +1,2 @@
1
+ import '../../../global/theme-default.css';
2
+ import './index.css';
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ declare const RadioContext: React.Context<{
3
+ type?: "button" | "default";
4
+ }>;
5
+ export default RadioContext;
@@ -0,0 +1 @@
1
+ import t from"react";var e=t.createContext({});export{e as default};
@@ -3,7 +3,7 @@ import { RadioProps as YpRadioProps } from '@yup/taro-radio';
3
3
  import RadioGroup from './radio-group';
4
4
  export interface RadioProps extends YpRadioProps {
5
5
  /**
6
- * button按钮样式,auto默认选中样式
6
+ * 单选内置样式类型 button按钮样式,default 原始样式,默认button样式,如果需要自定义覆盖复选框样式可以通过icon props函数属性覆盖
7
7
  */
8
8
  type?: 'button' | 'default';
9
9
  }
@@ -1 +1 @@
1
- import{objectWithoutProperties as r,objectSpread2 as o}from"../../_virtual/_rollupPluginBabelHelpers.js";import{j as t}from"../../node_modules/react/jsx-runtime.js";import{View as e}from"@tarojs/components";import i from"../../node_modules/classnames/index.js";import a from"@yup/taro-radio";import s from"./radio-group.js";var n=["children","type"],m=function(s){var m=s.children;s.type;var p=r(s,n);return t.jsx(a,o({className:"ypmini-taro-radio",icon:function(r){return t.jsx(e,{className:i("ypmini-taro-radio-button",{"ypmini-taro-radio-button-checked":r}),children:m})}},p))};m.Group=s;export{m as default};
1
+ import{objectWithoutProperties as r,objectSpread2 as o}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as t}from"react/jsx-runtime";import{View as i}from"@tarojs/components";import e from"classnames";import a from"react";import n from"../../node_modules/@yup/taro-radio/dist/index.js";import m from"./radio-group.js";import d from"./context.js";var p=["children","type"],u=function(m){var u=m.children,s=m.type,c=void 0===s?"button":s,l=r(m,p),f=a.useContext(d).type;return t(n,o({className:e("ypmini-taro-radio",{"ypmini-taro-radio-default":"default"===(f||c),"ypmini-taro-radio-button":"button"===(f||c)}),icon:function(r){return t(i,"default"===c?{className:e("ypmini-taro-radio-default-inner",{"ypmini-taro-radio-default-inner-checked":r}),children:u}:{className:e("ypmini-taro-radio-button-inner",{"ypmini-taro-radio-button-inner-checked":r}),children:u})}},l))};u.Group=m;export{u as default};
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { RadioGroupProps as YpRadioGroupProps } from '@yup/taro-radio/dist/types/type';
3
3
  export interface RadioGroupProps extends YpRadioGroupProps {
4
4
  /**
5
- * button按钮样式,auto默认选中样式
5
+ * 单选组内置样式类型 button按钮样式,default 原始样式,默认button样式,如果需要自定义覆盖复选框样式可以通过icon props函数属性覆盖
6
6
  */
7
7
  type?: 'button' | 'default';
8
8
  }
@@ -1 +1 @@
1
- import{objectWithoutProperties as o,objectSpread2 as r}from"../../_virtual/_rollupPluginBabelHelpers.js";import{j as e}from"../../node_modules/react/jsx-runtime.js";import i from"../../node_modules/classnames/index.js";import t from"@yup/taro-radio";var a=["children","type","block"],p=function(p){var s=p.children,l=p.type,n=p.block,u=void 0!==n&&n,m=o(p,a);return e.jsx(t.Group,r(r({className:i("ypmini-radio-group",{"ypmini-radio-group--button":"button"===l,"ypmini-radio-group--block":u})},m),{},{children:s}))};export{p as default};
1
+ import{objectWithoutProperties as r,objectSpread2 as o}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as i}from"react/jsx-runtime";import e from"classnames";import t from"../../node_modules/@yup/taro-radio/dist/index.js";import p from"./context.js";var a=["children","type","block"],l=function(l){var n=l.children,m=l.type,u=l.block,d=void 0!==u&&u,s=r(l,a);return i(p.Provider,{value:{type:m},children:i(t.Group,o(o({className:e("ypmini-radio-group",{"ypmini-radio-group-button":"button"===m,"ypmini-radio-group-block":d})},s),{},{children:n}))})};export{l as default};
@@ -1,34 +1,14 @@
1
- :root,
2
- page {
3
- --ypmini-hd: 2;
4
- }
5
- :root,
6
- page {
7
- --yp-color-primary: #0092ff;
8
- --yp-color-text: rgba(0, 0, 0, 0.85);
9
- --yp-color-text-light: #0092ff;
10
- --yp-color-text-weak: rgba(0, 0, 0, 0.45);
11
- --yp-border-color: #e9edf3;
12
- --yp-color-text-primary: #333;
13
- --yp-color-text-link: var(--yp-color-primary);
14
- --yp-color-text-secondary: #666;
15
- --yp-color-text-disabled: #ccc;
16
- --yp-color-text-placeholder: #999;
17
- --yp-font-size-default: calc(17px * var(--ypmini-hd));
18
- --yp-radio-circle-checked-color: var(--yp-color-primary);
19
- --yp-radio-button-checked-color: var(--yp-color-primary);
20
- --yp-checkbox-circle-checked-color: var(--yp-color-primary);
21
- --yp-checkbox-button-checked-color: var(--yp-color-primary);
22
- --yp-border-radius-base: calc(4px * var(--ypmini-hd));
23
- --yp-space-horizontal-base: calc(12px * var(--ypmini-hd));
24
- }
25
1
  .ypmini-radio-group {
26
2
  display: flex;
3
+ width: 100%;
27
4
  }
28
5
  .ypmini-radio-group-block {
29
6
  display: block;
30
7
  }
31
- .ypmini-radio-group .ypmini-taro-radio {
8
+ .ypmini-radio-group-button {
9
+ display: flex;
10
+ }
11
+ .ypmini-radio-group .ypmini-taro-radio-button {
32
12
  flex: 1;
33
13
  }
34
14
  .ypmini-radio-group .ypmini-taro-radio:not(:first-child) {
@@ -1,2 +1,3 @@
1
+ import '../../../global/theme-default.less';
1
2
  import './radio.less';
2
3
  import './group.less';
@@ -1,2 +1,3 @@
1
+ import '../../../global/theme-default.css';
1
2
  import './radio.css';
2
3
  import './group.css';
@@ -1,39 +1,24 @@
1
1
  :root,
2
- page {
3
- --ypmini-hd: 2;
4
- }
5
- :root,
6
- page {
7
- --yp-color-primary: #0092ff;
8
- --yp-color-text: rgba(0, 0, 0, 0.85);
9
- --yp-color-text-light: #0092ff;
10
- --yp-color-text-weak: rgba(0, 0, 0, 0.45);
11
- --yp-border-color: #e9edf3;
12
- --yp-color-text-primary: #333;
13
- --yp-color-text-link: var(--yp-color-primary);
14
- --yp-color-text-secondary: #666;
15
- --yp-color-text-disabled: #ccc;
16
- --yp-color-text-placeholder: #999;
17
- --yp-font-size-default: calc(17px * var(--ypmini-hd));
18
- --yp-radio-circle-checked-color: var(--yp-color-primary);
19
- --yp-radio-button-checked-color: var(--yp-color-primary);
20
- --yp-checkbox-circle-checked-color: var(--yp-color-primary);
21
- --yp-checkbox-button-checked-color: var(--yp-color-primary);
22
- --yp-border-radius-base: calc(4px * var(--ypmini-hd));
23
- --yp-space-horizontal-base: calc(12px * var(--ypmini-hd));
24
- }
25
- :root,
26
2
  page {
27
3
  --radio-button-font-size: calc(17px * var(--ypmini-hd));
28
4
  --radio-button-border-radius: calc(8px * var(--ypmini-hd));
29
5
  --radio-button-background-color: #f5f7fc;
30
6
  --radio-button-text-color: #000000d9;
31
7
  --radio-button-checked-background-color: #e0f3ff;
32
- --radio-button-checked-text-color: var(--yp-color-primary);
33
- --radio-button-checked-border-color: var(--yp-color-primary);
8
+ --radio-button-checked-text-color: var(--ypmini-primary-color);
9
+ --radio-button-checked-border-color: var(--ypmini-primary-color);
34
10
  --radio-button-height: calc(52px * var(--ypmini-hd));
11
+ --radio-default-size: calc(16px * var(--ypmini-hd));
12
+ }
13
+ .ypmini-taro-radio-default-inner {
14
+ width: var(--radio-default-size);
15
+ height: var(--radio-default-size);
16
+ border-radius: 100%;
17
+ }
18
+ .ypmini-taro-radio-default-inner-checked::before {
19
+ content: "☑️";
35
20
  }
36
- .ypmini-taro-radio-button {
21
+ .ypmini-taro-radio-button-inner {
37
22
  background-color: var(--radio-button-background-color);
38
23
  color: var(--radio-button-text-color);
39
24
  font-size: var(--radio-button-font-size);
@@ -44,7 +29,7 @@ page {
44
29
  box-sizing: border-box;
45
30
  border-radius: var(--radio-button-border-radius);
46
31
  }
47
- .ypmini-taro-radio-button-checked {
32
+ .ypmini-taro-radio-button-inner-checked {
48
33
  background-color: var(--radio-button-checked-background-color);
49
34
  color: var(--radio-button-checked-text-color);
50
35
  border-color: var(--radio-button-checked-border-color);
@@ -0,0 +1,13 @@
1
+ import { ViewProps } from '@tarojs/components';
2
+ import React from 'react';
3
+ export interface SafeAreaProps extends ViewProps {
4
+ /**
5
+ * 安全距离位置 top 顶部,bottom 底部
6
+ */
7
+ position?: 'top' | 'bottom';
8
+ }
9
+ /**
10
+ * 安全区域组件 用于安全区域占位
11
+ */
12
+ declare const SafeArea: React.FC<SafeAreaProps>;
13
+ export default SafeArea;
@@ -0,0 +1 @@
1
+ import{objectWithoutProperties as t,slicedToArray as o,objectSpread2 as r}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as e}from"react/jsx-runtime";import{View as a}from"@tarojs/components";import{useState as i,useEffect as s}from"react";import m from"classnames";import{getSystemInfo as p}from"./util.js";var l=["position","className","style","children"],n=function(n){var c=n.position,d=void 0===c?"bottom":c,f=n.className,u=n.style,b=n.children,h=t(n,l),j=i({top:0,bottom:0}),v=o(j,2),g=v[0],y=v[1];return s(function(){var t=p(),o=t.bottomSafeAreaHeight,r=t.statusBarHeight;y({top:r,bottom:o})},[]),e(a,r(r({className:m("ypmini-safe-area-view",f),style:r({paddingTop:"top"===d?g.top:0,paddingBottom:"bottom"===d?g.bottom:0},u)},h),{},{children:b}))};export{n as default};
@@ -0,0 +1,3 @@
1
+ .ypmini-safe-area-view {
2
+ box-sizing: border-box;
3
+ }
@@ -0,0 +1,2 @@
1
+ import '../../../global/theme-default.less';
2
+ import './index.less';
@@ -0,0 +1,2 @@
1
+ import '../../../global/theme-default.css';
2
+ import './index.css';
@@ -0,0 +1,5 @@
1
+ export declare const getSystemInfo: () => {
2
+ /** 顶部距离 */
3
+ statusBarHeight: number;
4
+ bottomSafeAreaHeight: number;
5
+ };
@@ -0,0 +1 @@
1
+ import t from"@tarojs/taro";var e=function(){try{var e,a=null==t||null===(e=t.getSystemInfoSync)||void 0===e?void 0:e.call(t);return{statusBarHeight:a.statusBarHeight||0,bottomSafeAreaHeight:null!=a&&a.safeArea&&a.safeArea.bottom>0?a.screenHeight-a.safeArea.bottom:0}}catch(t){return{statusBarHeight:0,bottomSafeAreaHeight:0}}};export{e as getSystemInfo};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { SwitchProps as TaroSwitchProps } from '@tarojs/components';
3
+ export interface SwitchProps extends TaroSwitchProps {
4
+ }
5
+ declare const Switch: React.FC<SwitchProps>;
6
+ export default Switch;
@@ -0,0 +1 @@
1
+ import{objectWithoutProperties as r,objectSpread2 as a}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as o}from"react/jsx-runtime";import s from"classnames";import{Switch as t}from"@tarojs/components";var e=["className"],m=function(m){var i=m.className,c=r(m,e);return o(t,a({className:s("ypmini-switch",i),color:"#0092ff"},c))};export{m as default};