tango-ui-cw 0.9.2 → 0.9.4

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 (97) hide show
  1. package/README.md +2 -2
  2. package/dist/assets/Notice//345/244/261/350/264/245.png.js +1 -0
  3. package/dist/assets/Notice//345/244/261/350/264/245.png.mjs +4 -0
  4. package/dist/assets/Notice//346/210/220/345/212/237.png.js +1 -0
  5. package/dist/assets/Notice//346/210/220/345/212/237.png.mjs +4 -0
  6. package/dist/assets/Notice//350/255/246/345/221/212.png.js +1 -0
  7. package/dist/assets/Notice//350/255/246/345/221/212.png.mjs +4 -0
  8. package/dist/assets/Upload/delLogo.png.js +1 -0
  9. package/dist/assets/Upload/delLogo.png.mjs +4 -0
  10. package/dist/assets/Upload/fileslogo.png.js +1 -0
  11. package/dist/assets/Upload/fileslogo.png.mjs +4 -0
  12. package/dist/client.mjs +3 -0
  13. package/dist/component/CSSFab/useTangoStyle.js +1 -0
  14. package/dist/component/CSSFab/useTangoStyle.mjs +170 -0
  15. package/dist/component/MaterialButton/MaterialButton.module.css.js +1 -0
  16. package/dist/component/MaterialButton/MaterialButton.module.css.mjs +17 -0
  17. package/dist/component/MaterialButton/index.js +1 -0
  18. package/dist/component/MaterialButton/index.mjs +61 -0
  19. package/dist/component/MaterialInput/MaterialInput.module.css.js +1 -0
  20. package/dist/component/MaterialInput/MaterialInput.module.css.mjs +17 -0
  21. package/dist/component/MaterialInput/index.js +1 -0
  22. package/dist/component/MaterialInput/index.mjs +36 -0
  23. package/dist/component/TBanner/TBanner.module.css.js +1 -0
  24. package/dist/component/TBanner/TBanner.module.css.mjs +35 -0
  25. package/dist/component/TBanner/index.js +1 -0
  26. package/dist/component/TBanner/index.mjs +340 -0
  27. package/dist/component/TButton/TButton.module.css.js +1 -0
  28. package/dist/component/TButton/TButton.module.css.mjs +26 -0
  29. package/dist/component/TButton/index.js +1 -0
  30. package/dist/component/TButton/index.mjs +185 -0
  31. package/dist/component/TColorPicker/TColorPicker.module.css.js +1 -0
  32. package/dist/component/TColorPicker/TColorPicker.module.css.mjs +13 -0
  33. package/dist/component/TColorPicker/index.js +1 -0
  34. package/dist/component/TColorPicker/index.mjs +61 -0
  35. package/dist/component/TDate/index.js +1 -0
  36. package/dist/component/TDate/index.mjs +144 -0
  37. package/dist/component/TDatePicker/TDatePicker.module.css.js +1 -0
  38. package/dist/component/TDatePicker/TDatePicker.module.css.mjs +9 -0
  39. package/dist/component/TDatePicker/index.js +1 -0
  40. package/dist/component/TDatePicker/index.mjs +40 -0
  41. package/dist/component/TDrawer/TDrawer.module.css.js +1 -0
  42. package/dist/component/TDrawer/TDrawer.module.css.mjs +45 -0
  43. package/dist/component/TDrawer/index.js +1 -0
  44. package/dist/component/TDrawer/index.mjs +110 -0
  45. package/dist/component/TInput/TInput.module.css.js +1 -0
  46. package/dist/component/TInput/TInput.module.css.mjs +21 -0
  47. package/dist/component/TInput/index.js +1 -0
  48. package/dist/component/TInput/index.mjs +74 -0
  49. package/dist/component/TLayout/index.js +1 -0
  50. package/dist/component/TLayout/index.mjs +52 -0
  51. package/dist/component/TLine/TLine.module.css.js +1 -0
  52. package/dist/component/TLine/TLine.module.css.mjs +19 -0
  53. package/dist/component/TLine/index.js +1 -0
  54. package/dist/component/TLine/index.mjs +34 -0
  55. package/dist/component/TMark/TMark.module.css.js +1 -0
  56. package/dist/component/TMark/TMark.module.css.mjs +7 -0
  57. package/dist/component/TMark/index.js +1 -0
  58. package/dist/component/TMark/index.mjs +51 -0
  59. package/dist/component/TModal/TModal.module.css.js +1 -0
  60. package/dist/component/TModal/TModal.module.css.mjs +29 -0
  61. package/dist/component/TModal/index.js +1 -0
  62. package/dist/component/TModal/index.mjs +109 -0
  63. package/dist/component/TNotice/NoticeProvider.js +1 -0
  64. package/dist/component/TNotice/NoticeProvider.mjs +47 -0
  65. package/dist/component/TNotice/TNotice.module.css.js +1 -0
  66. package/dist/component/TNotice/TNotice.module.css.mjs +27 -0
  67. package/dist/component/TNotice/index.js +3 -0
  68. package/dist/component/TNotice/index.mjs +39 -0
  69. package/dist/component/TNotice/useNotice.js +1 -0
  70. package/dist/component/TNotice/useNotice.mjs +18 -0
  71. package/dist/component/TSearch/TSearch.module.css.js +1 -0
  72. package/dist/component/TSearch/TSearch.module.css.mjs +21 -0
  73. package/dist/component/TSearch/index.js +1 -0
  74. package/dist/component/TSearch/index.mjs +72 -0
  75. package/dist/component/TSpace/TSpace.module.css.js +1 -0
  76. package/dist/component/TSpace/TSpace.module.css.mjs +23 -0
  77. package/dist/component/TSpace/index.js +1 -0
  78. package/dist/component/TSpace/index.mjs +45 -0
  79. package/dist/component/TTable/TTable.module.css.js +1 -0
  80. package/dist/component/TTable/TTable.module.css.mjs +25 -0
  81. package/dist/component/TTable/index.js +7 -0
  82. package/dist/component/TTable/index.mjs +153 -0
  83. package/dist/component/TTooltip/TTooltip.module.css.js +1 -0
  84. package/dist/component/TTooltip/TTooltip.module.css.mjs +17 -0
  85. package/dist/component/TTooltip/index.js +1 -0
  86. package/dist/component/TTooltip/index.mjs +33 -0
  87. package/dist/component/TUpload/TUpload.module.css.js +1 -0
  88. package/dist/component/TUpload/TUpload.module.css.mjs +15 -0
  89. package/dist/component/TUpload/index.js +1 -0
  90. package/dist/component/TUpload/index.mjs +151 -0
  91. package/dist/index.js +1 -9
  92. package/dist/index.mjs +47 -2071
  93. package/dist/styles/ThemeProvider.js +1 -0
  94. package/dist/styles/ThemeProvider.mjs +20 -0
  95. package/dist/tango-ui-cw.css +1 -0
  96. package/package.json +15 -11
  97. package/dist/index.css +0 -1
@@ -0,0 +1,35 @@
1
+ const n = "_banner_1j6sa_1", a = "_infoIcon_1j6sa_33", o = "_info_1j6sa_33", s = "_closeIcon_1j6sa_61", l = "_smallBanner_1j6sa_89", _ = "_smallInfo_1j6sa_119", e = "_smallInfoIcon_1j6sa_135", r = "_smallCloseIcon_1j6sa_145", c = "_largeBanner_1j6sa_163", I = "_largeInfoIcon_1j6sa_193", f = "_largeInfo_1j6sa_193", t = "_largeCloseIcon_1j6sa_223", g = "_smallInfoTransparent_1j6sa_235", j = "_largeInfoTransparent_1j6sa_237", m = "_infoTransparent_1j6sa_239", p = {
2
+ banner: n,
3
+ infoIcon: a,
4
+ info: o,
5
+ closeIcon: s,
6
+ smallBanner: l,
7
+ smallInfo: _,
8
+ smallInfoIcon: e,
9
+ smallCloseIcon: r,
10
+ largeBanner: c,
11
+ largeInfoIcon: I,
12
+ largeInfo: f,
13
+ largeCloseIcon: t,
14
+ smallInfoTransparent: g,
15
+ largeInfoTransparent: j,
16
+ infoTransparent: m
17
+ };
18
+ export {
19
+ n as banner,
20
+ s as closeIcon,
21
+ p as default,
22
+ o as info,
23
+ a as infoIcon,
24
+ m as infoTransparent,
25
+ c as largeBanner,
26
+ t as largeCloseIcon,
27
+ f as largeInfo,
28
+ I as largeInfoIcon,
29
+ j as largeInfoTransparent,
30
+ l as smallBanner,
31
+ r as smallCloseIcon,
32
+ _ as smallInfo,
33
+ e as smallInfoIcon,
34
+ g as smallInfoTransparent
35
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime");require("react");const r=require("./TBanner.module.css.js"),u=require("../TButton/index.js");function $(f){const{children:g="banner",onCancel:c=()=>{},onAction:p=()=>{},size:l="normal",cancelText:h="Cancel",actionText:x="Action",level:o="info",transparent:s=!1,bannerBgColor:C="",bannerBorderColor:w="",bannerIconColor:t=""}=f,m=()=>{switch(l){case"small":return r.default.smallBanner;case"large":return r.default.largeBanner;default:return r.default.banner}},n=()=>{switch(l){case"small":return r.default.smallInfoIcon;case"large":return r.default.largeInfoIcon;default:return r.default.infoIcon}},i=()=>{switch(l){case"small":return r.default.smallCloseIcon;case"large":return r.default.largeCloseIcon;default:return r.default.closeIcon}},v=()=>{switch(l){case"small":return`${s===!0?r.default.smallInfoTransparent:r.default.smallInfo}`;case"large":return`${s===!0?r.default.largeInfoTransparent:r.default.largeInfo}`;default:return`${s===!0?r.default.infoTransparent:r.default.info}`}},a=(()=>{switch(o){case"success":return{backgroundColor:`${s===!0?"transparent":"rgba(14, 43, 32, 0.8)"}`,borderColor:"#3cc29a",iconColor:`${t}`||"#3cc29a"};case"warning":return{backgroundColor:`${s===!0?"transparent":"rgba(121, 78, 8, 0.8)"}`,borderColor:"#ffcc00",iconColor:`${t}`||"#ff9900"};case"error":return{backgroundColor:`${s===!0?"transparent":"rgba(73, 20, 18,0.8)"}`,borderColor:"#ff6666",iconColor:`${t}`||"#ff3333"};case"info":default:return{backgroundColor:`${s===!0?"transparent":"rgba(18, 62, 116, 0.8)"}`,borderColor:"#64b4fa",iconColor:`${t}`||"#64b4fa"}}})(),b=e.jsxs("svg",{t:"1765636638756",className:n(),viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5548",width:"200",height:"200",children:[e.jsx("path",{d:"M512.50142 958.397886c-119.320573 0-231.499491-46.465265-315.871087-130.837884C112.258737 743.188406 65.792449 631.010511 65.792449 511.688915c0-119.319549 46.466288-231.499491 130.837884-315.871087C281.002952 111.445208 393.180847 64.979944 512.50142 64.979944s231.499491 46.465265 315.871087 130.837884c84.372619 84.372619 130.837884 196.551538 130.837884 315.871087 0 119.321596-46.465265 231.499491-130.837884 315.871087C744.000911 911.932622 631.821993 958.397886 512.50142 958.397886zM512.50142 105.962334c-223.718271 0-405.726581 182.00831-405.726581 405.726581s182.00831 405.726581 405.726581 405.726581c223.718271 0 405.727605-182.00831 405.727605-405.726581S736.220714 105.962334 512.50142 105.962334z",fill:a.iconColor,"p-id":"5549"}),e.jsx("path",{d:"M510.150886 775.953647c-18.107403 0-32.745798-14.678304-32.745798-32.785707L477.405087 452.191846c0-18.108426 14.638395-32.785707 32.745798-32.785707 18.107403 0 32.745798 14.678304 32.745798 32.785707l0 290.976094C542.896684 761.275343 528.258289 775.953647 510.150886 775.953647z",fill:a.iconColor,"p-id":"5550"}),e.jsx("path",{d:"M511.357364 296.458969m-45.080731 0a44.054 44.054 0 1 0 90.161463 0 44.054 44.054 0 1 0-90.161463 0Z",fill:a.iconColor,"p-id":"5551"})]}),j=e.jsxs("svg",{t:"1766541516754",className:n(),viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7130",width:"200",height:"200",children:[e.jsx("path",{d:"M869.472578 920.128281 154.906046 920.128281c-31.943526 0-60.545958-16.517185-76.514651-44.181245-15.968693-27.666106-15.96153-60.696384 0.016373-88.355327l357.283266-618.47194c15.971763-27.647687 44.568055-44.152593 76.496232-44.152593 31.930223-0.001023 60.527538 16.504906 76.499301 44.151569l357.283266 618.472963c15.977903 27.659967 15.984043 60.689221 0.017396 88.355327C930.018535 903.611096 901.416104 920.128281 869.472578 920.128281zM512.187265 169.139212c-15.962553 0-30.261211 8.251941-38.247092 22.075785l0 0L116.65793 809.686936c-7.989975 13.829983-7.993045 30.345122-0.008186 44.179199 7.983835 13.83203 22.285562 22.090111 38.257326 22.090111l714.566532 0c15.971763 0 30.273491-8.258081 38.256302-22.090111 7.984858-13.83203 7.980765-30.349215-0.008186-44.179199L550.437427 191.213973C542.452569 177.391153 528.152888 169.138188 512.187265 169.139212z",fill:"#f2990a","p-id":"7131"}),e.jsx("path",{d:"M513.732457 621.119233c-18.296715 0-33.257451-14.832823-33.257451-33.129538L480.475006 331.789639c0-18.296715 14.960737-33.129538 33.257451-33.129538 18.296715 0 33.257451 14.832823 33.257451 33.129538l0 256.200056C546.989909 606.28641 532.029172 621.119233 513.732457 621.119233z",fill:"#f2990a","p-id":"7132"}),e.jsx("path",{d:"M513.686409 737.619574m-49.991578 0a48.853 48.853 0 1 0 99.983155 0 48.853 48.853 0 1 0-99.983155 0Z",fill:"#f2990a","p-id":"7133"})]}),I=e.jsx("svg",{t:"1766542188417",className:n(),viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"10967",width:"200",height:"200",children:e.jsx("path",{d:"M85.333333 512C85.333333 276.352 276.352 85.333333 512 85.333333s426.666667 191.018667 426.666667 426.666667-191.018667 426.666667-426.666667 426.666667S85.333333 747.648 85.333333 512z m683.093334-256.426667a358.954667 358.954667 0 0 0-122.922667-80.768A359.466667 359.466667 0 0 0 512 149.333333c-46.08 0-90.624 8.490667-133.504 25.472A358.954667 358.954667 0 0 0 255.573333 255.573333c-35.413333 35.413333-62.336 76.373333-80.768 122.922667A359.466667 359.466667 0 0 0 149.333333 512c0 46.08 8.490667 90.624 25.472 133.504A358.954667 358.954667 0 0 0 255.573333 768.426667c35.413333 35.413333 76.373333 62.336 122.922667 80.768A359.466667 359.466667 0 0 0 512 874.666667c46.08 0 90.624-8.490667 133.504-25.472a358.954667 358.954667 0 0 0 122.922667-80.768c35.413333-35.413333 62.336-76.373333 80.768-122.922667A359.466667 359.466667 0 0 0 874.666667 512c0-46.08-8.490667-90.624-25.472-133.504A358.912 358.912 0 0 0 768.426667 255.573333zM338.517333 640.213333L466.773333 512 338.517333 383.786667l45.226667-45.226667L512 466.688l128.213333-128.213333 45.226667 45.226666L557.312 512l128.213333 128.213333-45.226666 45.226667L512 557.312l-128.213333 128.213333-45.226667-45.226666z",fill:"#f94c60","p-id":"10968"})}),L=e.jsxs("svg",{t:"1766542714832",className:n(),viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"13471",width:"200",height:"200",children:[e.jsx("path",{d:"M512.3 961.3c-247.1 0-448.1-201-448.1-448.1s201-448.1 448.1-448.1 448.1 201 448.1 448.1-201 448.1-448.1 448.1z m0-849.7c-221.4 0-401.6 180.2-401.6 401.6s180.2 401.6 401.6 401.6 401.6-180.2 401.6-401.6-180.2-401.6-401.6-401.6z",fill:"#31d9a7","p-id":"13472"}),e.jsx("path",{d:"M441.2 676c-16.4 0-32.7-5.8-45.5-17.4l-151.3-138c-9.5-8.6-10.2-23.3-1.5-32.8 8.6-9.5 23.3-10.2 32.8-1.5L427 624.2c7.6 6.9 20.8 6.9 28.4 0l293.5-267.5c9.5-8.6 24.2-8 32.8 1.5 8.6 9.5 8 24.2-1.5 32.8L486.7 658.5c-12.8 11.7-29.1 17.5-45.5 17.5z",fill:"#31d9a7","p-id":"13473"})]}),B=e.jsx("svg",{t:"1765636877672",className:i(),viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6359",width:"200",height:"200",children:e.jsx("path",{d:"M558.8 509.2l302.8-302.8c3.1-3.1 3.1-8.1 0-11.2l-30.8-30.8c-3.1-3.1-8.1-3.1-11.2 0L516.8 467.2c-1.5 1.5-4.1 1.5-5.6 0L208.3 164.3c-3.1-3.1-8.1-3.1-11.2 0l-30.8 30.8c-3.1 3.1-3.1 8.1 0 11.2l302.8 302.8c1.5 1.5 1.5 4.1 0 5.6l-302.8 303c-3.1 3.1-3.1 8.1 0 11.2l30.8 30.8c3.1 3.1 8.1 3.1 11.2 0l302.8-302.8c1.5-1.5 4.1-1.5 5.6 0l302.8 302.8c3.1 3.1 8.1 3.1 11.2 0l30.8-30.8c3.1-3.1 3.1-8.1 0-11.2L558.8 514.8c-1.5-1.5-1.5-4.1 0-5.6z",fill:"#ffffff","p-id":"6360"})}),z=()=>{switch(o){case"success":return L;case"warning":return j;case"error":return I;case"info":default:return b}},d=()=>{switch(l){case"small":return"0.8rem";case"large":return"1.2rem";default:return"1rem"}},M=()=>{switch(l){case"small":return"8px";case"large":return"12px";default:return"10px"}};return e.jsxs("div",{className:m(),style:{backgroundColor:C||a.backgroundColor,borderColor:w||a.borderColor},children:[e.jsx("div",{className:n(),children:z()}),e.jsx("div",{className:v(),children:g}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,gap:M()},children:[e.jsx(u,{type:"transparent",sx:{c:`${s===!0?"gray":"#e9e9e9"}`,br:d(),bColor:"transparent",s:l==="small"?"14px":l==="large"?"18px":"16px"},onClick:c,size:l,children:h}),e.jsx(u,{type:"transparent",sx:{c:`${s===!0?"gray":"#e9e9e9"}`,br:d(),b:1,bColor:"#797979",s:l==="small"?"14px":l==="large"?"18px":"16px"},onClick:p,size:l,children:x}),e.jsx("div",{className:i(),onClick:c,children:B})]})]})}module.exports=$;
@@ -0,0 +1,340 @@
1
+ import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
+ import "react";
3
+ import e from "./TBanner.module.css.mjs";
4
+ import f from "../TButton/index.mjs";
5
+ function j(p) {
6
+ const {
7
+ children: u = "banner",
8
+ onCancel: s = () => {
9
+ },
10
+ onAction: h = () => {
11
+ },
12
+ size: l = "normal",
13
+ cancelText: C = "Cancel",
14
+ actionText: m = "Action",
15
+ level: i = "info",
16
+ // success,info, warning, error 四种形态(颜色)
17
+ transparent: n = !1,
18
+ bannerBgColor: w = "",
19
+ // 自定义banner背景颜色
20
+ bannerBorderColor: v = "",
21
+ // 自定义banner边框颜色
22
+ bannerIconColor: t = ""
23
+ // 自定义banner Icon颜色
24
+ } = p, x = () => {
25
+ switch (l) {
26
+ case "small":
27
+ return e.smallBanner;
28
+ case "large":
29
+ return e.largeBanner;
30
+ default:
31
+ return e.banner;
32
+ }
33
+ }, a = () => {
34
+ switch (l) {
35
+ case "small":
36
+ return e.smallInfoIcon;
37
+ case "large":
38
+ return e.largeInfoIcon;
39
+ default:
40
+ return e.infoIcon;
41
+ }
42
+ }, d = () => {
43
+ switch (l) {
44
+ case "small":
45
+ return e.smallCloseIcon;
46
+ case "large":
47
+ return e.largeCloseIcon;
48
+ default:
49
+ return e.closeIcon;
50
+ }
51
+ }, b = () => {
52
+ switch (l) {
53
+ case "small":
54
+ return `${n === !0 ? e.smallInfoTransparent : e.smallInfo}`;
55
+ case "large":
56
+ return `${n === !0 ? e.largeInfoTransparent : e.largeInfo}`;
57
+ default:
58
+ return `${n === !0 ? e.infoTransparent : e.info}`;
59
+ }
60
+ }, o = (() => {
61
+ switch (i) {
62
+ case "success":
63
+ return {
64
+ backgroundColor: `${n === !0 ? "transparent" : "rgba(14, 43, 32, 0.8)"}`,
65
+ // 绿色背景
66
+ borderColor: "#3cc29a",
67
+ // 亮橙色边框
68
+ iconColor: `${t}` || "#3cc29a"
69
+ // 图标颜色
70
+ };
71
+ case "warning":
72
+ return {
73
+ backgroundColor: `${n === !0 ? "transparent" : "rgba(121, 78, 8, 0.8)"}`,
74
+ // 橙色背景
75
+ borderColor: "#ffcc00",
76
+ // 亮橙色边框
77
+ iconColor: `${t}` || "#ff9900"
78
+ // 图标颜色
79
+ };
80
+ case "error":
81
+ return {
82
+ backgroundColor: `${n === !0 ? "transparent" : "rgba(73, 20, 18,0.8)"}`,
83
+ // 红色背景
84
+ borderColor: "#ff6666",
85
+ // 亮红色边框
86
+ iconColor: `${t}` || "#ff3333"
87
+ // 图标颜色
88
+ };
89
+ case "info":
90
+ default:
91
+ return {
92
+ backgroundColor: `${n === !0 ? "transparent" : "rgba(18, 62, 116, 0.8)"}`,
93
+ // 默认蓝色背景
94
+ borderColor: "#64b4fa",
95
+ // 蓝色边框
96
+ iconColor: `${t}` || "#64b4fa"
97
+ // 图标颜色
98
+ };
99
+ }
100
+ })(), I = /* @__PURE__ */ c(
101
+ "svg",
102
+ {
103
+ t: "1765636638756",
104
+ className: a(),
105
+ viewBox: "0 0 1024 1024",
106
+ version: "1.1",
107
+ xmlns: "http://www.w3.org/2000/svg",
108
+ "p-id": "5548",
109
+ width: "200",
110
+ height: "200",
111
+ children: [
112
+ /* @__PURE__ */ r(
113
+ "path",
114
+ {
115
+ d: "M512.50142 958.397886c-119.320573 0-231.499491-46.465265-315.871087-130.837884C112.258737 743.188406 65.792449 631.010511 65.792449 511.688915c0-119.319549 46.466288-231.499491 130.837884-315.871087C281.002952 111.445208 393.180847 64.979944 512.50142 64.979944s231.499491 46.465265 315.871087 130.837884c84.372619 84.372619 130.837884 196.551538 130.837884 315.871087 0 119.321596-46.465265 231.499491-130.837884 315.871087C744.000911 911.932622 631.821993 958.397886 512.50142 958.397886zM512.50142 105.962334c-223.718271 0-405.726581 182.00831-405.726581 405.726581s182.00831 405.726581 405.726581 405.726581c223.718271 0 405.727605-182.00831 405.727605-405.726581S736.220714 105.962334 512.50142 105.962334z",
116
+ fill: o.iconColor,
117
+ "p-id": "5549"
118
+ }
119
+ ),
120
+ /* @__PURE__ */ r(
121
+ "path",
122
+ {
123
+ d: "M510.150886 775.953647c-18.107403 0-32.745798-14.678304-32.745798-32.785707L477.405087 452.191846c0-18.108426 14.638395-32.785707 32.745798-32.785707 18.107403 0 32.745798 14.678304 32.745798 32.785707l0 290.976094C542.896684 761.275343 528.258289 775.953647 510.150886 775.953647z",
124
+ fill: o.iconColor,
125
+ "p-id": "5550"
126
+ }
127
+ ),
128
+ /* @__PURE__ */ r(
129
+ "path",
130
+ {
131
+ d: "M511.357364 296.458969m-45.080731 0a44.054 44.054 0 1 0 90.161463 0 44.054 44.054 0 1 0-90.161463 0Z",
132
+ fill: o.iconColor,
133
+ "p-id": "5551"
134
+ }
135
+ )
136
+ ]
137
+ }
138
+ ), L = /* @__PURE__ */ c(
139
+ "svg",
140
+ {
141
+ t: "1766541516754",
142
+ className: a(),
143
+ viewBox: "0 0 1024 1024",
144
+ version: "1.1",
145
+ xmlns: "http://www.w3.org/2000/svg",
146
+ "p-id": "7130",
147
+ width: "200",
148
+ height: "200",
149
+ children: [
150
+ /* @__PURE__ */ r(
151
+ "path",
152
+ {
153
+ d: "M869.472578 920.128281 154.906046 920.128281c-31.943526 0-60.545958-16.517185-76.514651-44.181245-15.968693-27.666106-15.96153-60.696384 0.016373-88.355327l357.283266-618.47194c15.971763-27.647687 44.568055-44.152593 76.496232-44.152593 31.930223-0.001023 60.527538 16.504906 76.499301 44.151569l357.283266 618.472963c15.977903 27.659967 15.984043 60.689221 0.017396 88.355327C930.018535 903.611096 901.416104 920.128281 869.472578 920.128281zM512.187265 169.139212c-15.962553 0-30.261211 8.251941-38.247092 22.075785l0 0L116.65793 809.686936c-7.989975 13.829983-7.993045 30.345122-0.008186 44.179199 7.983835 13.83203 22.285562 22.090111 38.257326 22.090111l714.566532 0c15.971763 0 30.273491-8.258081 38.256302-22.090111 7.984858-13.83203 7.980765-30.349215-0.008186-44.179199L550.437427 191.213973C542.452569 177.391153 528.152888 169.138188 512.187265 169.139212z",
154
+ fill: "#f2990a",
155
+ "p-id": "7131"
156
+ }
157
+ ),
158
+ /* @__PURE__ */ r(
159
+ "path",
160
+ {
161
+ d: "M513.732457 621.119233c-18.296715 0-33.257451-14.832823-33.257451-33.129538L480.475006 331.789639c0-18.296715 14.960737-33.129538 33.257451-33.129538 18.296715 0 33.257451 14.832823 33.257451 33.129538l0 256.200056C546.989909 606.28641 532.029172 621.119233 513.732457 621.119233z",
162
+ fill: "#f2990a",
163
+ "p-id": "7132"
164
+ }
165
+ ),
166
+ /* @__PURE__ */ r(
167
+ "path",
168
+ {
169
+ d: "M513.686409 737.619574m-49.991578 0a48.853 48.853 0 1 0 99.983155 0 48.853 48.853 0 1 0-99.983155 0Z",
170
+ fill: "#f2990a",
171
+ "p-id": "7133"
172
+ }
173
+ )
174
+ ]
175
+ }
176
+ ), B = /* @__PURE__ */ r(
177
+ "svg",
178
+ {
179
+ t: "1766542188417",
180
+ className: a(),
181
+ viewBox: "0 0 1024 1024",
182
+ version: "1.1",
183
+ xmlns: "http://www.w3.org/2000/svg",
184
+ "p-id": "10967",
185
+ width: "200",
186
+ height: "200",
187
+ children: /* @__PURE__ */ r(
188
+ "path",
189
+ {
190
+ d: "M85.333333 512C85.333333 276.352 276.352 85.333333 512 85.333333s426.666667 191.018667 426.666667 426.666667-191.018667 426.666667-426.666667 426.666667S85.333333 747.648 85.333333 512z m683.093334-256.426667a358.954667 358.954667 0 0 0-122.922667-80.768A359.466667 359.466667 0 0 0 512 149.333333c-46.08 0-90.624 8.490667-133.504 25.472A358.954667 358.954667 0 0 0 255.573333 255.573333c-35.413333 35.413333-62.336 76.373333-80.768 122.922667A359.466667 359.466667 0 0 0 149.333333 512c0 46.08 8.490667 90.624 25.472 133.504A358.954667 358.954667 0 0 0 255.573333 768.426667c35.413333 35.413333 76.373333 62.336 122.922667 80.768A359.466667 359.466667 0 0 0 512 874.666667c46.08 0 90.624-8.490667 133.504-25.472a358.954667 358.954667 0 0 0 122.922667-80.768c35.413333-35.413333 62.336-76.373333 80.768-122.922667A359.466667 359.466667 0 0 0 874.666667 512c0-46.08-8.490667-90.624-25.472-133.504A358.912 358.912 0 0 0 768.426667 255.573333zM338.517333 640.213333L466.773333 512 338.517333 383.786667l45.226667-45.226667L512 466.688l128.213333-128.213333 45.226667 45.226666L557.312 512l128.213333 128.213333-45.226666 45.226667L512 557.312l-128.213333 128.213333-45.226667-45.226666z",
191
+ fill: "#f94c60",
192
+ "p-id": "10968"
193
+ }
194
+ )
195
+ }
196
+ ), z = /* @__PURE__ */ c(
197
+ "svg",
198
+ {
199
+ t: "1766542714832",
200
+ className: a(),
201
+ viewBox: "0 0 1024 1024",
202
+ version: "1.1",
203
+ xmlns: "http://www.w3.org/2000/svg",
204
+ "p-id": "13471",
205
+ width: "200",
206
+ height: "200",
207
+ children: [
208
+ /* @__PURE__ */ r(
209
+ "path",
210
+ {
211
+ d: "M512.3 961.3c-247.1 0-448.1-201-448.1-448.1s201-448.1 448.1-448.1 448.1 201 448.1 448.1-201 448.1-448.1 448.1z m0-849.7c-221.4 0-401.6 180.2-401.6 401.6s180.2 401.6 401.6 401.6 401.6-180.2 401.6-401.6-180.2-401.6-401.6-401.6z",
212
+ fill: "#31d9a7",
213
+ "p-id": "13472"
214
+ }
215
+ ),
216
+ /* @__PURE__ */ r(
217
+ "path",
218
+ {
219
+ d: "M441.2 676c-16.4 0-32.7-5.8-45.5-17.4l-151.3-138c-9.5-8.6-10.2-23.3-1.5-32.8 8.6-9.5 23.3-10.2 32.8-1.5L427 624.2c7.6 6.9 20.8 6.9 28.4 0l293.5-267.5c9.5-8.6 24.2-8 32.8 1.5 8.6 9.5 8 24.2-1.5 32.8L486.7 658.5c-12.8 11.7-29.1 17.5-45.5 17.5z",
220
+ fill: "#31d9a7",
221
+ "p-id": "13473"
222
+ }
223
+ )
224
+ ]
225
+ }
226
+ ), M = /* @__PURE__ */ r(
227
+ "svg",
228
+ {
229
+ t: "1765636877672",
230
+ className: d(),
231
+ viewBox: "0 0 1024 1024",
232
+ version: "1.1",
233
+ xmlns: "http://www.w3.org/2000/svg",
234
+ "p-id": "6359",
235
+ width: "200",
236
+ height: "200",
237
+ children: /* @__PURE__ */ r(
238
+ "path",
239
+ {
240
+ d: "M558.8 509.2l302.8-302.8c3.1-3.1 3.1-8.1 0-11.2l-30.8-30.8c-3.1-3.1-8.1-3.1-11.2 0L516.8 467.2c-1.5 1.5-4.1 1.5-5.6 0L208.3 164.3c-3.1-3.1-8.1-3.1-11.2 0l-30.8 30.8c-3.1 3.1-3.1 8.1 0 11.2l302.8 302.8c1.5 1.5 1.5 4.1 0 5.6l-302.8 303c-3.1 3.1-3.1 8.1 0 11.2l30.8 30.8c3.1 3.1 8.1 3.1 11.2 0l302.8-302.8c1.5-1.5 4.1-1.5 5.6 0l302.8 302.8c3.1 3.1 8.1 3.1 11.2 0l30.8-30.8c3.1-3.1 3.1-8.1 0-11.2L558.8 514.8c-1.5-1.5-1.5-4.1 0-5.6z",
241
+ fill: "#ffffff",
242
+ "p-id": "6360"
243
+ }
244
+ )
245
+ }
246
+ ), $ = () => {
247
+ switch (i) {
248
+ case "success":
249
+ return z;
250
+ case "warning":
251
+ return L;
252
+ case "error":
253
+ return B;
254
+ case "info":
255
+ default:
256
+ return I;
257
+ }
258
+ }, g = () => {
259
+ switch (l) {
260
+ case "small":
261
+ return "0.8rem";
262
+ case "large":
263
+ return "1.2rem";
264
+ default:
265
+ return "1rem";
266
+ }
267
+ }, k = () => {
268
+ switch (l) {
269
+ case "small":
270
+ return "8px";
271
+ case "large":
272
+ return "12px";
273
+ default:
274
+ return "10px";
275
+ }
276
+ };
277
+ return /* @__PURE__ */ c(
278
+ "div",
279
+ {
280
+ className: x(),
281
+ style: {
282
+ backgroundColor: w || o.backgroundColor,
283
+ borderColor: v || o.borderColor
284
+ },
285
+ children: [
286
+ /* @__PURE__ */ r("div", { className: a(), children: $() }),
287
+ /* @__PURE__ */ r("div", { className: b(), children: u }),
288
+ /* @__PURE__ */ c(
289
+ "div",
290
+ {
291
+ style: {
292
+ display: "flex",
293
+ alignItems: "center",
294
+ justifyContent: "flex-end",
295
+ flex: 1,
296
+ gap: k()
297
+ },
298
+ children: [
299
+ /* @__PURE__ */ r(
300
+ f,
301
+ {
302
+ type: "transparent",
303
+ sx: {
304
+ c: `${n === !0 ? "gray" : "#e9e9e9"}`,
305
+ br: g(),
306
+ bColor: "transparent",
307
+ s: l === "small" ? "14px" : l === "large" ? "18px" : "16px"
308
+ },
309
+ onClick: s,
310
+ size: l,
311
+ children: C
312
+ }
313
+ ),
314
+ /* @__PURE__ */ r(
315
+ f,
316
+ {
317
+ type: "transparent",
318
+ sx: {
319
+ c: `${n === !0 ? "gray" : "#e9e9e9"}`,
320
+ br: g(),
321
+ b: 1,
322
+ bColor: "#797979",
323
+ s: l === "small" ? "14px" : l === "large" ? "18px" : "16px"
324
+ },
325
+ onClick: h,
326
+ size: l,
327
+ children: m
328
+ }
329
+ ),
330
+ /* @__PURE__ */ r("div", { className: d(), onClick: s, children: M })
331
+ ]
332
+ }
333
+ )
334
+ ]
335
+ }
336
+ );
337
+ }
338
+ export {
339
+ j as default
340
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n="_btn_1w9w4_5",t={btn:n,"btn-content":"_btn-content_1w9w4_1","btn-default":"_btn-default_1w9w4_45","btn-transparent":"_btn-transparent_1w9w4_63","btn-danger":"_btn-danger_1w9w4_81","btn-success":"_btn-success_1w9w4_101","btn-outline":"_btn-outline_1w9w4_121","btn-enu":"_btn-enu_1w9w4_205","btn-small":"_btn-small_1w9w4_351","btn-medium":"_btn-medium_1w9w4_361","btn-large":"_btn-large_1w9w4_371","btn-huge":"_btn-huge_1w9w4_381","btn-disabled":"_btn-disabled_1w9w4_391","btn-with-icon":"_btn-with-icon_1w9w4_417","btn-icon":"_btn-icon_1w9w4_433","btn-loading":"_btn-loading_1w9w4_507","btn-loading-icon":"_btn-loading-icon_1w9w4_517","btn-loading-spin":"_btn-loading-spin_1w9w4_527","btn-loading-light":"_btn-loading-light_1w9w4_631","btn-loading-dark":"_btn-loading-dark_1w9w4_639"};exports.btn=n;exports.default=t;
@@ -0,0 +1,26 @@
1
+ const n = "_btn_1w9w4_5", t = {
2
+ btn: n,
3
+ "btn-content": "_btn-content_1w9w4_1",
4
+ "btn-default": "_btn-default_1w9w4_45",
5
+ "btn-transparent": "_btn-transparent_1w9w4_63",
6
+ "btn-danger": "_btn-danger_1w9w4_81",
7
+ "btn-success": "_btn-success_1w9w4_101",
8
+ "btn-outline": "_btn-outline_1w9w4_121",
9
+ "btn-enu": "_btn-enu_1w9w4_205",
10
+ "btn-small": "_btn-small_1w9w4_351",
11
+ "btn-medium": "_btn-medium_1w9w4_361",
12
+ "btn-large": "_btn-large_1w9w4_371",
13
+ "btn-huge": "_btn-huge_1w9w4_381",
14
+ "btn-disabled": "_btn-disabled_1w9w4_391",
15
+ "btn-with-icon": "_btn-with-icon_1w9w4_417",
16
+ "btn-icon": "_btn-icon_1w9w4_433",
17
+ "btn-loading": "_btn-loading_1w9w4_507",
18
+ "btn-loading-icon": "_btn-loading-icon_1w9w4_517",
19
+ "btn-loading-spin": "_btn-loading-spin_1w9w4_527",
20
+ "btn-loading-light": "_btn-loading-light_1w9w4_631",
21
+ "btn-loading-dark": "_btn-loading-dark_1w9w4_639"
22
+ };
23
+ export {
24
+ n as btn,
25
+ t as default
26
+ };
@@ -0,0 +1 @@
1
+ "use strict";const i=require("react/jsx-runtime"),c=require("react"),e=require("prop-types"),t=require("./TButton.module.css.js"),P=require("../CSSFab/useTangoStyle.js");function y(b){const{type:x="default",size:d="medium",sx:a={},style:w={},className:$="",onClick:j=()=>{},children:N,disabled:u=!1,outline:S=!1,enu:k=!1,icon:l=null,iconPosition:T=null,loading:n=!1,...v}=b,z=typeof a=="object"?a:{},C=P.useTangoStyle(z),q=typeof a=="string"?a.split(/\s+/).map(s=>s.startsWith("!")?s:`!${s}`).join(" "):"",g=()=>{switch(d){case"small":return 12;case"medium":return 14;case"large":return 16;case"huge":return 20;default:return 14}},o=()=>n===!0||n==="light"||n==="dark"?!0:Array.isArray(n)&&n.length>0?n[0]===!0||n[0]==="light"||n[0]==="dark":!1,A=()=>n==="light"?"light":n==="dark"||n===!0||Array.isArray(n)&&n.length>=2&&n[1]==="dark"?"dark":"light",f=()=>{const s=g(),r=A()==="dark"?L:I;return c.cloneElement(r,{className:`${r.props.className} ${o()?t.default["btn-loading-spin"]:""}`,style:{width:`${s}px`,height:`${s}px`,...r.props.style}})},B=[...[t.default.btn,t.default[`btn-${x}`],t.default[`btn-${d}`],u&&t.default["btn-disabled"],S&&t.default["btn-outline"],k&&t.default["btn-enu"],(l||o())&&t.default["btn-with-icon"],o()&&t.default["btn-loading"]].filter(Boolean),q,$].filter(Boolean).join(" "),O={...C,...w};y.propTypes={type:e.oneOf(["default","transparent","danger","success"]),size:e.oneOf(["small","medium","large","huge"]),sx:e.oneOfType([e.object,e.string]),style:e.object,onClick:e.func,className:e.string,children:e.node.isRequired,disabled:e.bool,outline:e.bool,enu:e.bool,icon:e.oneOfType([e.elementType,e.node,e.string]),iconPosition:e.string,loading:e.oneOfType([e.bool,e.oneOf(["light","dark"]),e.array])};const I=i.jsx("svg",{t:"1765518157795",className:`${t.default["btn-loading-icon"]} ${t.default["btn-loading-light"]}`,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",children:i.jsx("path",{d:"M512 1024A512 512 0 0 1 0 512a32 32 0 0 1 64 0 448 448 0 0 0 896 0 32 32 0 0 1 64 0 512 512 0 0 1-512 512z",fill:"#ffffff"})}),L=i.jsx("svg",{t:"1765518157795",className:`${t.default["btn-loading-icon"]} ${t.default["btn-loading-dark"]}`,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",children:i.jsx("path",{d:"M512 1024A512 512 0 0 1 0 512a32 32 0 0 1 64 0 448 448 0 0 0 896 0 32 32 0 0 1 64 0 512 512 0 0 1-512 512z",fill:"#2c2c2c"})}),h=()=>{if(!l)return null;const s=g();if(typeof l=="string")return i.jsx("img",{src:l,alt:"icon",className:t.default["btn-icon"],style:{width:`${s}px`,height:`${s}px`}});if(c.isValidElement(l))return c.cloneElement(l,{className:`${t.default["btn-icon"]} ${l.props.className||""}`,style:{width:`${s}px`,height:`${s}px`,...l.props.style}});const m=l;return i.jsx(m,{className:t.default["btn-icon"],style:{fontSize:`${s}px`,width:`${s}px`,height:`${s}px`}})},p=T||(l||o()?"left":null);return i.jsxs("button",{className:B,style:O,onClick:j,disabled:u||o(),...v,children:[p==="left"&&i.jsxs(i.Fragment,{children:[o()&&f(),!o()&&l&&h()]}),N,p==="right"&&i.jsxs(i.Fragment,{children:[o()&&f(),!o()&&l&&h()]})]})}module.exports=y;
@@ -0,0 +1,185 @@
1
+ import { jsxs as c, Fragment as y, jsx as r } from "react/jsx-runtime";
2
+ import d from "react";
3
+ import e from "prop-types";
4
+ import t from "./TButton.module.css.mjs";
5
+ import { useTangoStyle as E } from "../CSSFab/useTangoStyle.mjs";
6
+ function M(b) {
7
+ const {
8
+ type: x = "default",
9
+ size: g = "medium",
10
+ sx: l = {},
11
+ style: w = {},
12
+ className: $ = "",
13
+ onClick: S = () => {
14
+ },
15
+ children: N,
16
+ disabled: u = !1,
17
+ outline: k = !1,
18
+ enu: v = !1,
19
+ icon: s = null,
20
+ iconPosition: T = null,
21
+ loading: n = !1,
22
+ ...z
23
+ } = b, C = E(typeof l == "object" ? l : {}), j = typeof l == "string" ? l.split(/\s+/).map((o) => o.startsWith("!") ? o : `!${o}`).join(" ") : "", p = () => {
24
+ switch (g) {
25
+ case "small":
26
+ return 12;
27
+ case "medium":
28
+ return 14;
29
+ case "large":
30
+ return 16;
31
+ case "huge":
32
+ return 20;
33
+ default:
34
+ return 14;
35
+ }
36
+ }, i = () => n === !0 || n === "light" || n === "dark" ? !0 : Array.isArray(n) && n.length > 0 ? n[0] === !0 || n[0] === "light" || n[0] === "dark" : !1, A = () => n === "light" ? "light" : n === "dark" || n === !0 || Array.isArray(n) && n.length >= 2 && n[1] === "dark" ? "dark" : "light", f = () => {
37
+ const o = p(), a = A() === "dark" ? L : B;
38
+ return d.cloneElement(a, {
39
+ className: `${a.props.className} ${i() ? t["btn-loading-spin"] : ""}`,
40
+ style: {
41
+ width: `${o}px`,
42
+ height: `${o}px`,
43
+ ...a.props.style
44
+ }
45
+ });
46
+ }, I = [...[
47
+ t.btn,
48
+ t[`btn-${x}`],
49
+ t[`btn-${g}`],
50
+ u && t["btn-disabled"],
51
+ k && t["btn-outline"],
52
+ v && t["btn-enu"],
53
+ (s || i()) && t["btn-with-icon"],
54
+ // 修改这里,loading 时也添加图标类
55
+ i() && t["btn-loading"]
56
+ // 添加 loading 状态类
57
+ ].filter(Boolean), j, $].filter(Boolean).join(" "), O = { ...C, ...w };
58
+ M.propTypes = {
59
+ type: e.oneOf(["default", "transparent", "danger", "success"]),
60
+ // 按钮类型:默认、透明、警告、成功
61
+ size: e.oneOf(["small", "medium", "large", "huge"]),
62
+ // 按钮大小
63
+ sx: e.oneOfType([e.object, e.string]),
64
+ // 自定义样式对象
65
+ style: e.object,
66
+ // 用户传入的 style 属性,保证style属性优先级最高
67
+ onClick: e.func,
68
+ // 点击事件
69
+ className: e.string,
70
+ // 添加 className PropTypes
71
+ children: e.node.isRequired,
72
+ // 按钮内容
73
+ disabled: e.bool,
74
+ // 是否禁用
75
+ outline: e.bool,
76
+ // 是否为轮廓按钮
77
+ enu: e.bool,
78
+ // 是否为新拟态风格按钮
79
+ icon: e.oneOfType([
80
+ e.elementType,
81
+ e.node,
82
+ e.string
83
+ // 允许传入字符串(图片路径)
84
+ ]),
85
+ iconPosition: e.string,
86
+ loading: e.oneOfType([
87
+ e.bool,
88
+ e.oneOf(["light", "dark"]),
89
+ e.array
90
+ ])
91
+ };
92
+ const B = /* @__PURE__ */ r(
93
+ "svg",
94
+ {
95
+ t: "1765518157795",
96
+ className: `${t["btn-loading-icon"]} ${t["btn-loading-light"]}`,
97
+ viewBox: "0 0 1024 1024",
98
+ version: "1.1",
99
+ xmlns: "http://www.w3.org/2000/svg",
100
+ width: "200",
101
+ height: "200",
102
+ children: /* @__PURE__ */ r(
103
+ "path",
104
+ {
105
+ d: "M512 1024A512 512 0 0 1 0 512a32 32 0 0 1 64 0 448 448 0 0 0 896 0 32 32 0 0 1 64 0 512 512 0 0 1-512 512z",
106
+ fill: "#ffffff"
107
+ }
108
+ )
109
+ }
110
+ ), L = /* @__PURE__ */ r(
111
+ "svg",
112
+ {
113
+ t: "1765518157795",
114
+ className: `${t["btn-loading-icon"]} ${t["btn-loading-dark"]}`,
115
+ viewBox: "0 0 1024 1024",
116
+ version: "1.1",
117
+ xmlns: "http://www.w3.org/2000/svg",
118
+ width: "200",
119
+ height: "200",
120
+ children: /* @__PURE__ */ r(
121
+ "path",
122
+ {
123
+ d: "M512 1024A512 512 0 0 1 0 512a32 32 0 0 1 64 0 448 448 0 0 0 896 0 32 32 0 0 1 64 0 512 512 0 0 1-512 512z",
124
+ fill: "#2c2c2c"
125
+ }
126
+ )
127
+ }
128
+ ), h = () => {
129
+ if (!s) return null;
130
+ const o = p();
131
+ return typeof s == "string" ? /* @__PURE__ */ r(
132
+ "img",
133
+ {
134
+ src: s,
135
+ alt: "icon",
136
+ className: t["btn-icon"],
137
+ style: {
138
+ width: `${o}px`,
139
+ height: `${o}px`
140
+ }
141
+ }
142
+ ) : d.isValidElement(s) ? d.cloneElement(s, {
143
+ className: `${t["btn-icon"]} ${s.props.className || ""}`,
144
+ style: {
145
+ width: `${o}px`,
146
+ height: `${o}px`,
147
+ ...s.props.style
148
+ }
149
+ }) : /* @__PURE__ */ r(
150
+ s,
151
+ {
152
+ className: t["btn-icon"],
153
+ style: {
154
+ fontSize: `${o}px`,
155
+ width: `${o}px`,
156
+ height: `${o}px`
157
+ }
158
+ }
159
+ );
160
+ }, m = T || (s || i() ? "left" : null);
161
+ return /* @__PURE__ */ c(
162
+ "button",
163
+ {
164
+ className: I,
165
+ style: O,
166
+ onClick: S,
167
+ disabled: u || i(),
168
+ ...z,
169
+ children: [
170
+ m === "left" && /* @__PURE__ */ c(y, { children: [
171
+ i() && f(),
172
+ !i() && s && h()
173
+ ] }),
174
+ N,
175
+ m === "right" && /* @__PURE__ */ c(y, { children: [
176
+ i() && f(),
177
+ !i() && s && h()
178
+ ] })
179
+ ]
180
+ }
181
+ );
182
+ }
183
+ export {
184
+ M as default
185
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o="_colorPicker_4ql5w_1",r="_colorPickerDisabled_4ql5w_15",e="_colorPickerWrapper_4ql5w_23",c="_colorText_4ql5w_35",l={colorPicker:o,colorPickerDisabled:r,colorPickerWrapper:e,colorText:c};exports.colorPicker=o;exports.colorPickerDisabled=r;exports.colorPickerWrapper=e;exports.colorText=c;exports.default=l;
@@ -0,0 +1,13 @@
1
+ const o = "_colorPicker_4ql5w_1", r = "_colorPickerDisabled_4ql5w_15", c = "_colorPickerWrapper_4ql5w_23", e = "_colorText_4ql5w_35", l = {
2
+ colorPicker: o,
3
+ colorPickerDisabled: r,
4
+ colorPickerWrapper: c,
5
+ colorText: e
6
+ };
7
+ export {
8
+ o as colorPicker,
9
+ r as colorPickerDisabled,
10
+ c as colorPickerWrapper,
11
+ e as colorText,
12
+ l as default
13
+ };
@@ -0,0 +1 @@
1
+ "use strict";const a=require("react/jsx-runtime"),j=require("react"),h=require("prop-types"),d=require("./TColorPicker.module.css.js");function f(g){const{disabled:p=!1,onChange:b=()=>{},showText:m=!1}=g,[i,k]=j.useState("#000000"),v=s=>{const e=s.target.value;k(e),b&&b(e)},C=`${d.default.colorPicker} ${p?d.default.colorPickerDisabled:""}`,T=s=>{const e=parseInt(s.slice(1,3),16),r=parseInt(s.slice(3,5),16),t=parseInt(s.slice(5,7),16);return`rgb(${e}, ${r}, ${t})`},$=s=>{let e=parseInt(s.slice(1,3),16)/255,r=parseInt(s.slice(3,5),16)/255,t=parseInt(s.slice(5,7),16)/255,o=Math.max(e,r,t),c=Math.min(e,r,t),l,u,x=(o+c)/2;if(o===c)l=u=0;else{let n=o-c;switch(u=x>.5?n/(2-o-c):n/(o+c),o){case e:l=(r-t)/n+(r<t?6:0);break;case r:l=(t-e)/n+2;break;case t:l=(e-r)/n+4;break}l/=6}return`hsl(${Math.round(l*360)}, ${Math.round(u*100)}%, ${Math.round(x*100)}%)`};return a.jsxs("div",{className:d.default.colorPickerWrapper,children:[a.jsx("input",{type:"color",value:i,onChange:v,className:C,disabled:p}),m&&a.jsxs("div",{className:d.default.colorText,children:[a.jsx("div",{children:i.toUpperCase()}),a.jsx("div",{children:T(i)}),a.jsx("div",{children:$(i)})]})]})}f.propTypes={disabled:h.bool,onChange:h.func,showText:h.bool};module.exports=f;